asksuite-citrus 1.5.8 → 1.5.10
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.
- package/esm2022/lib/components/autocomplete/autocomplete.component.mjs +13 -4
- package/esm2022/lib/directives/ask-dropdown.directive.mjs +24 -2
- package/fesm2022/asksuite-citrus.mjs +35 -4
- package/fesm2022/asksuite-citrus.mjs.map +1 -1
- package/lib/components/autocomplete/autocomplete.component.d.ts +4 -1
- package/lib/directives/ask-dropdown.directive.d.ts +8 -1
- package/package.json +1 -1
@@ -574,6 +574,7 @@ class AutocompleteComponent {
|
|
574
574
|
this.change = change;
|
575
575
|
this.translate = translate;
|
576
576
|
this.inputControl = new FormControl("");
|
577
|
+
this.fixedOptionsItems = [];
|
577
578
|
this.filteredOptions = [];
|
578
579
|
this.paginatedFilteredOptions = [];
|
579
580
|
this.selection = [];
|
@@ -600,6 +601,7 @@ class AutocompleteComponent {
|
|
600
601
|
this.multiple = false;
|
601
602
|
this.valueProp = '';
|
602
603
|
this.options = [];
|
604
|
+
this.fixedOptions = [];
|
603
605
|
this.placeholder = '';
|
604
606
|
this.emptyMessage = 'NO_OPTIONS';
|
605
607
|
this.selectAll = false;
|
@@ -611,8 +613,12 @@ class AutocompleteComponent {
|
|
611
613
|
}
|
612
614
|
ngAfterViewInit() {
|
613
615
|
this.checkAllValue = this.isAllOptionsSelected;
|
616
|
+
this.checkFixedOptions();
|
614
617
|
this.handleInputChange();
|
615
618
|
}
|
619
|
+
checkFixedOptions() {
|
620
|
+
this.fixedOptionsItems = this.options.filter(option => this.fixedOptions.includes(option[this.valueProp]));
|
621
|
+
}
|
616
622
|
get isAllOptionsSelected() {
|
617
623
|
return this.selection.length === this.options.length;
|
618
624
|
}
|
@@ -620,7 +626,8 @@ class AutocompleteComponent {
|
|
620
626
|
if (changes['options']) {
|
621
627
|
this._pageNumber = 1;
|
622
628
|
this.paginatedFilteredOptions = [];
|
623
|
-
this.filteredOptions = changes['options'].currentValue
|
629
|
+
this.filteredOptions = changes['options'].currentValue
|
630
|
+
.filter((option) => !this.fixedOptions.includes(option[this.valueProp]));
|
624
631
|
this.updateValidation();
|
625
632
|
}
|
626
633
|
}
|
@@ -829,11 +836,11 @@ class AutocompleteComponent {
|
|
829
836
|
this.disabled = isDisabled;
|
830
837
|
}
|
831
838
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: AutocompleteComponent, deps: [{ token: i1$1.FormBuilder }, { token: i1$3.Overlay }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
832
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.6", type: AutocompleteComponent, selector: "ask-autocomplete", inputs: { filterFn: "filterFn", displayFn: "displayFn", multiple: "multiple", valueProp: "valueProp", options: "options", placeholder: "placeholder", emptyMessage: "emptyMessage", selectAll: "selectAll", allOptionsSelectedText: "allOptionsSelectedText", selectAllMessage: "selectAllMessage", iconPropReference: "iconPropReference" }, outputs: { itemCheck: "itemCheck" }, host: { listeners: { "window:mousedown": "handleClick($event)" } }, providers: [valueAccessor], viewQueries: [{ propertyName: "input", first: true, predicate: ["autocomplete"], descendants: true }, { propertyName: "list", first: true, predicate: ["list"], descendants: true }, { propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true }, { propertyName: "overlayContent", first: true, predicate: ["overlayContent"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"autocomplete-wrapper\"\n data-testid=\"autocomplete-wrapper\"\n [class.-closed]=\"closed\"\n [class.-opened]=\"!closed\"\n #wrapper\n (click)=\"handleAutocompleteClick()\"\n>\n <div class=\"autocomplete\" #autocomplete>\n <input\n class=\"search-field\"\n askAutofocus\n *ngIf=\"!closed; else selectionOrPlaceholder\"\n (click)=\"$event.stopPropagation()\"\n [formControl]=\"inputControl\"\n [placeholder]=\"placeholder\"\n />\n <ng-template #selectionOrPlaceholder>\n <ng-container *ngIf=\"showChips\">\n <div\n class=\"chip-list\"\n [class.-collapsed]=\"chipsCollapsed\"\n [ngClass]=\"chipsContainerClasses\"\n >\n <ask-chips\n [style.max-width]=\"chipsCollapsed ? '85%' : '95%'\"\n [showAction]=\"true\"\n *ngFor=\"let option of selectedOptions\"\n (action)=\"handleChipAction(option)\"\n >\n {{ display(option) }}\n </ask-chips>\n <span\n class=\"expand\"\n data-testid=\"see-more\"\n *ngIf=\"showAllSelectionBtn\"\n (click)=\"handleChipsListActionClick($event)\"\n >\n +{{ selection.length - 1 }}\n </span>\n </div>\n </ng-container>\n <span\n class=\"empty-placeholder\"\n data-testid=\"placeholder\"\n *ngIf=\"showPlaceholder\"\n >\n {{\n checkAllValue && allOptionsSelectedText\n ? allOptionsSelectedText\n : placeholder\n }}\n </span>\n </ng-template>\n <span\n class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\"\n *ngIf=\"chipsCollapsed\"\n >\n {{ closed ? \"expand_more\" : \"expand_less\" }}\n </span>\n </div>\n <div class=\"actions\" *ngIf=\"showExpandedSelectionActions\">\n <span\n class=\"see-more\"\n data-testid=\"see-less\"\n (click)=\"handleChipsListActionClick($event)\"\n >\n {{ \"SEE_LESS\" | translate }}\n </span>\n <span\n class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\"\n >\n {{ closed ? \"expand_more\" : \"expand_less\" }}\n </span>\n </div>\n</div>\n\n<ng-template #overlayContent>\n <div #list class=\"menu-container\" [class.-multiple]=\"multiple\">\n <ng-container *ngIf=\"!multiple; else multipleSelection\">\n <div class=\"list\" askScroll [askScrollThreshold]=\"50\">\n <ng-container *ngFor=\"let option of paginatedFilteredOptions\">\n <div\n class=\"option-item\"\n [class.-highlighted]=\"\n selectedOption && selectedOption[valueProp] === option[valueProp]\n \"\n (click)=\"handleOptionSelected(option)\"\n >\n <p class=\"text\">{{ display(option) }}</p>\n </div>\n </ng-container>\n </div>\n </ng-container>\n <ng-template #multipleSelection>\n <div class=\"option-item\" *ngIf=\"showSelectAllCheckbox\">\n <ask-checkbox\n (valueChange)=\"handleSelectAll($event)\"\n [(ngModel)]=\"checkAllValue\"\n >{{selectAllMessage}}</ask-checkbox\n >\n </div>\n <div\n askScroll\n [askScrollThreshold]=\"50\"\n (scrollEnd)=\"getMoreItems()\"\n data-testid=\"options-form\"\n class=\"options-form\"\n [class.-select-all]=\"showSelectAllCheckbox\"\n >\n <ng-container *ngFor=\"let option of paginatedFilteredOptions\">\n <div class=\"option-item\">\n <ask-checkbox\n [value]=\"optionsSelected[option[valueProp]]\"\n (valueChange)=\"valueChange(option, $event)\"\n >\n <div class=\"checkbox-content\">\n <img\n data-testid=\"checkbox-item-icon\"\n class=\"icon\"\n *ngIf=\"iconPropReference\"\n [src]=\"option[iconPropReference]\"\n alt=\"\"\n />\n {{ display(option) }}\n </div>\n </ask-checkbox>\n </div>\n </ng-container>\n </div>\n </ng-template>\n <span class=\"empty\" *ngIf=\"!filteredOptions.length\">{{\n emptyMessage | translate\n }}</span>\n </div>\n</ng-template>\n", styles: [":root{--asksuite-orange: #FF5724;--white: #FFF;--grey-50: #F5F7FA;--grey-100: #E4E7EB;--grey-200: #CBD2D9;--grey-300: #9AA5B1;--grey-400: #7B8794;--grey-500: #616E7C;--grey-600: #52606D;--grey-700: #3E4C59;--grey-800: #2A3042;--grey-900: #1F2933;--yellow-50: #FFF8E2;--yellow-200: #FFECB3;--success-green: #4BAF50;--warning-yellow: #FFC107;--error-red: #E8453E;--shadow: rgba(42, 48, 66, .1607843137);--lightblue-tag: #CDF9F3;--lavender-tag: #D4DAF3;--green-tag: #CEEEAA;--pink-tag: #FBC5FF;--orange-tag: #FED5C9;--purple-tag: #DDBFE5;--yellow-tag: #FFE0B2;--blue-tag: #B2E5FD;--brown-tag: #EFC89C;--whatsapp-green: #68B35D;--facebook-blue: #0084FF;--instagram-pink: #D53E91;--google-blue: #345DC8;--telegram-blue: #34AADF;--telephone-yellow: #FECB00;--primary-background: #FFF;--secondary-background: #EFF3F8;--hover-background: #F5F7FA;--divider-background: #E4E7EB;--font-color-100: #2A3042;--font-color-200: #616E7C;--font-color-300: #9AA5B1}:root{--font-default: $font-default;--font-code: $font-code}:root{--font-xs: $font-xs;--font-sm: $font-sm;--font-md: $font-md;--font-lg: $font-lg;--font-xl: $font-xl;--font-xxl: $font-xxl}:root{--font-weight-regular: $font-weight-regular;--font-weight-medium: $font-weight-medium}:root{--radii-px: $radii-px;--radii-xs: $radii-xs;--radii-sm: $radii-sm;--radii-md: $radii-md;--radii-lg: $radii-lg;--radii-full: $radii-full}.ellipsis,.option-item>.text,.option-item{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scale-in-center{animation:scale-in-center .3s ease-in-out both}@keyframes scale-in-center{0%{transform:scale(0);opacity:1}to{transform:scale(1);opacity:1}}.scale-out-center{animation:scale-out-center .3s ease-in-out both}@keyframes scale-out-center{0%{transform:scale(1);opacity:1}to{transform:scale(0);opacity:1}}.ask-tooltip{background-color:#7b8794;color:#fff;padding:4px;border-radius:8px;position:relative}.ask-tooltip>div{text-align:center!important}.ask-tooltip:after{position:absolute;content:\"\";width:10px;height:10px;background-color:inherit}.ask-tooltip.-above{margin-bottom:4px}.ask-tooltip.-above:after{bottom:-5px;left:50%;transform:translate(-50%) rotate(45deg)}.ask-tooltip.-below{margin-top:4px}.ask-tooltip.-below:after{top:-5px;left:50%;transform:translate(-50%) rotate(45deg)}.ask-tooltip.-after,.ask-tooltip.-right{margin-left:4px}.ask-tooltip.-after:after,.ask-tooltip.-right:after{left:-5px;top:50%;transform:translateY(-50%) rotate(45deg)}.ask-tooltip.-before,.ask-tooltip.-left{margin-right:4px}.ask-tooltip.-before:after,.ask-tooltip.-left:after{right:-5px;top:50%;transform:translateY(-50%) rotate(45deg)}.ask-button{padding:8px 24px;border-radius:6px;border:none;outline:none;height:48px;font-size:1rem;transition:background-color .1s,box-shadow .1s;cursor:pointer;font-weight:500;background:white;color:var(--grey-500)}.ask-button:not(.-primary,.-secondary){box-shadow:0 1px 2px #2a304229}.ask-button:not(.-primary):hover:not(:disabled){box-shadow:0 0 6px #2a304229}.ask-button:hover:not(:disabled){box-shadow:0 0 6px #ff572466}.ask-button:active:not(:disabled){background-color:#f34915}.ask-button:disabled{cursor:not-allowed;background-color:#9aa5b1}.ask-button.-primary{background:#FF5724;color:#fff}.ask-modal-header{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:0 24px 9px}.ask-modal-body{flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;padding:20px 24px;max-height:65vh;display:block}.ask-modal-footer{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;justify-content:flex-end;box-sizing:border-box;min-height:52px;margin:0;padding:8px;border-top:1px solid rgba(0,0,0,0)}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}*{box-sizing:border-box}*,button,select,textarea{font-family:Inter,sans-serif;font-weight:400}input{font-size:1rem}.ask-badge{position:relative}.ask-badge>.badge{position:absolute;display:flex;justify-content:center;align-items:center;background-color:var(--bg-color);color:#fff;font-size:12px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:50%;box-shadow:0 2px 6px -1px #00000080}.ask-badge>.badge.-primary{--bg-color: var(--asksuite-orange)}.ask-badge>.badge.-secondary{--bg-color: var(--grey-800)}.ask-badge>.badge.-top{top:-10px}.ask-badge>.badge.-bottom{bottom:-10px}.ask-badge>.badge.-left{left:-10px}.ask-badge>.badge.-right{right:-10px}.ask-badge>.badge.-small{width:18px;height:18px;font-size:10px}.ask-badge>.badge.-regular{width:22px;height:22px;font-size:11px}.ask-badge>.badge.-large{width:28px;height:28px;font-size:12px}.ask-dropdown-top-right{margin-left:8px}.ask-dropdown-top-left{margin-right:8px}.ask-dropdown-bottom-right,.ask-dropdown-bottom-left{margin-top:8px}.autocomplete-wrapper{position:relative;border:1px solid #CBD2D9;border-radius:4px;padding:16px}.autocomplete-wrapper:hover{cursor:pointer}.autocomplete-wrapper>.autocomplete{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.autocomplete-wrapper>.actions{width:100%;display:flex;flex-direction:row;justify-content:space-between;align-items:center}.autocomplete-wrapper.-opened{border-bottom-right-radius:0;border-bottom-left-radius:0}.autocomplete-wrapper.-closed{transition:all ease-in-out .3s;min-height:54px}.search-field{font-style:inherit;width:100%;border:none;height:100%}.search-field:focus{border:none;outline:none}.search-field::placeholder{opacity:.6}.option-item{display:flex;flex-direction:row;align-items:center;padding-left:1rem;height:36px;width:100%}.option-item.-highlighted{background-color:#e4e7eb}.option-item:hover{cursor:pointer;background-color:#f5f7fa}.see-more,.chip-list>.expand{color:#616e7c;text-decoration:underline;font-size:.875rem;font-weight:500}.see-more:hover,.chip-list>.expand:hover{cursor:pointer}.chip-list{display:flex;align-items:center;flex-direction:row;flex-wrap:wrap;gap:.5rem;flex:1;max-height:calc(120px + 2.5rem);transition:all ease-in-out .3s;max-width:100%}.chip-list.-collapsed{height:24px;overflow:hidden;transition:none}.chip-list.-two{height:calc(48px + 1rem)}.chip-list.-three{height:calc(72px + 1.5rem)}.chip-list.-four{height:calc(96px + 2rem)}.chip-list.-many{overflow-y:auto;height:calc(120px + 2.5rem)}.btn-expand:hover{cursor:pointer}.btn-expand.-disabled{color:#7b8794}.empty-placeholder{font-size:.875rem}.empty-placeholder:hover{cursor:pointer}.list-box,.menu-container>.list,.options-form{min-height:1rem;overflow-y:scroll;max-height:100%}.list-box.-select-all,.menu-container>.-select-all.list,.-select-all.options-form{max-height:80%}.checkbox-content{display:flex;gap:8px;align-items:center}.checkbox-content>.icon{width:16px;height:16px}.menu-container{width:100%;background:white;max-height:165px;border:1px solid #CBD2D9;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-top:none;padding:8px 0}.menu-container>.empty{text-align:center;display:inline-block;width:100%}.menu-container.-multiple{max-height:228px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: ChipsComponent, selector: "ask-chips", inputs: ["appearance", "showAction", "size", "color"], outputs: ["action"] }, { kind: "component", type: CheckboxComponent, selector: "ask-checkbox", inputs: ["value", "disabled"], outputs: ["valueChange", "change", "click", "focus"] }, { kind: "directive", type: AutofocusDirective, selector: "[askAutofocus]" }, { kind: "directive", type: ScrollDirective, selector: "[askScroll]", inputs: ["askScrollThreshold"], outputs: ["scrollEnd"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
839
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.6", type: AutocompleteComponent, selector: "ask-autocomplete", inputs: { filterFn: "filterFn", displayFn: "displayFn", multiple: "multiple", valueProp: "valueProp", options: "options", fixedOptions: "fixedOptions", placeholder: "placeholder", emptyMessage: "emptyMessage", selectAll: "selectAll", allOptionsSelectedText: "allOptionsSelectedText", selectAllMessage: "selectAllMessage", iconPropReference: "iconPropReference" }, outputs: { itemCheck: "itemCheck" }, host: { listeners: { "window:mousedown": "handleClick($event)" } }, providers: [valueAccessor], viewQueries: [{ propertyName: "input", first: true, predicate: ["autocomplete"], descendants: true }, { propertyName: "list", first: true, predicate: ["list"], descendants: true }, { propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true }, { propertyName: "overlayContent", first: true, predicate: ["overlayContent"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"autocomplete-wrapper\"\n data-testid=\"autocomplete-wrapper\"\n [class.-closed]=\"closed\"\n [class.-opened]=\"!closed\"\n #wrapper\n (click)=\"handleAutocompleteClick()\"\n>\n <div class=\"autocomplete\" #autocomplete>\n <input\n class=\"search-field\"\n askAutofocus\n *ngIf=\"!closed; else selectionOrPlaceholder\"\n (click)=\"$event.stopPropagation()\"\n [formControl]=\"inputControl\"\n [placeholder]=\"placeholder\"\n />\n <ng-template #selectionOrPlaceholder>\n <ng-container *ngIf=\"showChips\">\n <div\n class=\"chip-list\"\n [class.-collapsed]=\"chipsCollapsed\"\n [ngClass]=\"chipsContainerClasses\"\n >\n <ask-chips\n [style.max-width]=\"chipsCollapsed ? '85%' : '95%'\"\n [showAction]=\"true\"\n *ngFor=\"let option of selectedOptions\"\n (action)=\"handleChipAction(option)\"\n >\n {{ display(option) }}\n </ask-chips>\n <span\n class=\"expand\"\n data-testid=\"see-more\"\n *ngIf=\"showAllSelectionBtn\"\n (click)=\"handleChipsListActionClick($event)\"\n >\n +{{ selection.length - 1 }}\n </span>\n </div>\n </ng-container>\n <span\n class=\"empty-placeholder\"\n data-testid=\"placeholder\"\n *ngIf=\"showPlaceholder\"\n >\n {{\n checkAllValue && allOptionsSelectedText\n ? allOptionsSelectedText\n : placeholder\n }}\n </span>\n </ng-template>\n <span\n class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\"\n *ngIf=\"chipsCollapsed\"\n >\n {{ closed ? \"expand_more\" : \"expand_less\" }}\n </span>\n </div>\n <div class=\"actions\" *ngIf=\"showExpandedSelectionActions\">\n <span\n class=\"see-more\"\n data-testid=\"see-less\"\n (click)=\"handleChipsListActionClick($event)\"\n >\n {{ \"SEE_LESS\" | translate }}\n </span>\n <span\n class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\"\n >\n {{ closed ? \"expand_more\" : \"expand_less\" }}\n </span>\n </div>\n</div>\n\n<ng-template #overlayContent>\n <div #list class=\"menu-container\" [class.-multiple]=\"multiple\">\n <ng-container *ngIf=\"!multiple; else multipleSelection\">\n <div class=\"list\" askScroll [askScrollThreshold]=\"50\">\n <ng-container *ngFor=\"let option of paginatedFilteredOptions\">\n <div\n class=\"option-item\"\n [class.-highlighted]=\"\n selectedOption && selectedOption[valueProp] === option[valueProp]\n \"\n (click)=\"handleOptionSelected(option)\"\n >\n <p class=\"text\">{{ display(option) }}</p>\n </div>\n </ng-container>\n </div>\n </ng-container>\n <ng-template #multipleSelection>\n <div class=\"option-item\" *ngIf=\"showSelectAllCheckbox\">\n <ask-checkbox\n (valueChange)=\"handleSelectAll($event)\"\n [(ngModel)]=\"checkAllValue\"\n >{{selectAllMessage}}</ask-checkbox\n >\n </div>\n\n <ng-container *ngFor=\"let option of fixedOptionsItems\">\n <div class=\"option-item\">\n <ask-checkbox\n [value]=\"optionsSelected[option[valueProp]]\"\n (valueChange)=\"valueChange(option, $event)\"\n >\n <div class=\"checkbox-content\">\n <img\n data-testid=\"checkbox-item-icon\"\n class=\"icon\"\n *ngIf=\"iconPropReference\"\n [src]=\"option[iconPropReference]\"\n alt=\"\"\n />\n {{ display(option) }}\n </div>\n </ask-checkbox>\n </div>\n </ng-container>\n\n <div\n askScroll\n [askScrollThreshold]=\"50\"\n (scrollEnd)=\"getMoreItems()\"\n data-testid=\"options-form\"\n class=\"options-form\"\n [class.-select-all]=\"showSelectAllCheckbox\"\n >\n <ng-container *ngFor=\"let option of paginatedFilteredOptions\">\n <div class=\"option-item\">\n <ask-checkbox\n [value]=\"optionsSelected[option[valueProp]]\"\n (valueChange)=\"valueChange(option, $event)\"\n >\n <div class=\"checkbox-content\">\n <img\n data-testid=\"checkbox-item-icon\"\n class=\"icon\"\n *ngIf=\"iconPropReference\"\n [src]=\"option[iconPropReference]\"\n alt=\"\"\n />\n {{ display(option) }}\n </div>\n </ask-checkbox>\n </div>\n </ng-container>\n </div>\n </ng-template>\n <span class=\"empty\" *ngIf=\"!filteredOptions.length\">{{\n emptyMessage | translate\n }}</span>\n </div>\n</ng-template>\n", styles: [":root{--asksuite-orange: #FF5724;--white: #FFF;--grey-50: #F5F7FA;--grey-100: #E4E7EB;--grey-200: #CBD2D9;--grey-300: #9AA5B1;--grey-400: #7B8794;--grey-500: #616E7C;--grey-600: #52606D;--grey-700: #3E4C59;--grey-800: #2A3042;--grey-900: #1F2933;--yellow-50: #FFF8E2;--yellow-200: #FFECB3;--success-green: #4BAF50;--warning-yellow: #FFC107;--error-red: #E8453E;--shadow: rgba(42, 48, 66, .1607843137);--lightblue-tag: #CDF9F3;--lavender-tag: #D4DAF3;--green-tag: #CEEEAA;--pink-tag: #FBC5FF;--orange-tag: #FED5C9;--purple-tag: #DDBFE5;--yellow-tag: #FFE0B2;--blue-tag: #B2E5FD;--brown-tag: #EFC89C;--whatsapp-green: #68B35D;--facebook-blue: #0084FF;--instagram-pink: #D53E91;--google-blue: #345DC8;--telegram-blue: #34AADF;--telephone-yellow: #FECB00;--primary-background: #FFF;--secondary-background: #EFF3F8;--hover-background: #F5F7FA;--divider-background: #E4E7EB;--font-color-100: #2A3042;--font-color-200: #616E7C;--font-color-300: #9AA5B1}:root{--font-default: $font-default;--font-code: $font-code}:root{--font-xs: $font-xs;--font-sm: $font-sm;--font-md: $font-md;--font-lg: $font-lg;--font-xl: $font-xl;--font-xxl: $font-xxl}:root{--font-weight-regular: $font-weight-regular;--font-weight-medium: $font-weight-medium}:root{--radii-px: $radii-px;--radii-xs: $radii-xs;--radii-sm: $radii-sm;--radii-md: $radii-md;--radii-lg: $radii-lg;--radii-full: $radii-full}.ellipsis,.option-item>.text,.option-item{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scale-in-center{animation:scale-in-center .3s ease-in-out both}@keyframes scale-in-center{0%{transform:scale(0);opacity:1}to{transform:scale(1);opacity:1}}.scale-out-center{animation:scale-out-center .3s ease-in-out both}@keyframes scale-out-center{0%{transform:scale(1);opacity:1}to{transform:scale(0);opacity:1}}.ask-tooltip{background-color:#7b8794;color:#fff;padding:4px;border-radius:8px;position:relative}.ask-tooltip>div{text-align:center!important}.ask-tooltip:after{position:absolute;content:\"\";width:10px;height:10px;background-color:inherit}.ask-tooltip.-above{margin-bottom:4px}.ask-tooltip.-above:after{bottom:-5px;left:50%;transform:translate(-50%) rotate(45deg)}.ask-tooltip.-below{margin-top:4px}.ask-tooltip.-below:after{top:-5px;left:50%;transform:translate(-50%) rotate(45deg)}.ask-tooltip.-after,.ask-tooltip.-right{margin-left:4px}.ask-tooltip.-after:after,.ask-tooltip.-right:after{left:-5px;top:50%;transform:translateY(-50%) rotate(45deg)}.ask-tooltip.-before,.ask-tooltip.-left{margin-right:4px}.ask-tooltip.-before:after,.ask-tooltip.-left:after{right:-5px;top:50%;transform:translateY(-50%) rotate(45deg)}.ask-button{padding:8px 24px;border-radius:6px;border:none;outline:none;height:48px;font-size:1rem;transition:background-color .1s,box-shadow .1s;cursor:pointer;font-weight:500;background:white;color:var(--grey-500)}.ask-button:not(.-primary,.-secondary){box-shadow:0 1px 2px #2a304229}.ask-button:not(.-primary):hover:not(:disabled){box-shadow:0 0 6px #2a304229}.ask-button:hover:not(:disabled){box-shadow:0 0 6px #ff572466}.ask-button:active:not(:disabled){background-color:#f34915}.ask-button:disabled{cursor:not-allowed;background-color:#9aa5b1}.ask-button.-primary{background:#FF5724;color:#fff}.ask-modal-header{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:0 24px 9px}.ask-modal-body{flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;padding:20px 24px;max-height:65vh;display:block}.ask-modal-footer{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;justify-content:flex-end;box-sizing:border-box;min-height:52px;margin:0;padding:8px;border-top:1px solid rgba(0,0,0,0)}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}*{box-sizing:border-box}*,button,select,textarea{font-family:Inter,sans-serif;font-weight:400}input{font-size:1rem}.ask-badge{position:relative}.ask-badge>.badge{position:absolute;display:flex;justify-content:center;align-items:center;background-color:var(--bg-color);color:#fff;font-size:12px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:50%;box-shadow:0 2px 6px -1px #00000080}.ask-badge>.badge.-primary{--bg-color: var(--asksuite-orange)}.ask-badge>.badge.-secondary{--bg-color: var(--grey-800)}.ask-badge>.badge.-top{top:-10px}.ask-badge>.badge.-bottom{bottom:-10px}.ask-badge>.badge.-left{left:-10px}.ask-badge>.badge.-right{right:-10px}.ask-badge>.badge.-small{width:18px;height:18px;font-size:10px}.ask-badge>.badge.-regular{width:22px;height:22px;font-size:11px}.ask-badge>.badge.-large{width:28px;height:28px;font-size:12px}.ask-dropdown-top-right{margin-left:8px}.ask-dropdown-top-left{margin-right:8px}.ask-dropdown-bottom-right,.ask-dropdown-bottom-left{margin-top:8px}.autocomplete-wrapper{position:relative;border:1px solid #CBD2D9;border-radius:4px;padding:16px}.autocomplete-wrapper:hover{cursor:pointer}.autocomplete-wrapper>.autocomplete{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.autocomplete-wrapper>.actions{width:100%;display:flex;flex-direction:row;justify-content:space-between;align-items:center}.autocomplete-wrapper.-opened{border-bottom-right-radius:0;border-bottom-left-radius:0}.autocomplete-wrapper.-closed{transition:all ease-in-out .3s;min-height:54px}.search-field{font-style:inherit;width:100%;border:none;height:100%}.search-field:focus{border:none;outline:none}.search-field::placeholder{opacity:.6}.option-item{display:flex;flex-direction:row;align-items:center;padding-left:1rem;height:36px;width:100%}.option-item.-highlighted{background-color:#e4e7eb}.option-item:hover{cursor:pointer;background-color:#f5f7fa}.see-more,.chip-list>.expand{color:#616e7c;text-decoration:underline;font-size:.875rem;font-weight:500}.see-more:hover,.chip-list>.expand:hover{cursor:pointer}.chip-list{display:flex;align-items:center;flex-direction:row;flex-wrap:wrap;gap:.5rem;flex:1;max-height:calc(120px + 2.5rem);transition:all ease-in-out .3s;max-width:100%}.chip-list.-collapsed{height:24px;overflow:hidden;transition:none}.chip-list.-two{height:calc(48px + 1rem)}.chip-list.-three{height:calc(72px + 1.5rem)}.chip-list.-four{height:calc(96px + 2rem)}.chip-list.-many{overflow-y:auto;height:calc(120px + 2.5rem)}.btn-expand:hover{cursor:pointer}.btn-expand.-disabled{color:#7b8794}.empty-placeholder{font-size:.875rem}.empty-placeholder:hover{cursor:pointer}.list-box,.menu-container>.list,.options-form{min-height:1rem;overflow-y:scroll;max-height:100%}.list-box.-select-all,.menu-container>.-select-all.list,.-select-all.options-form{max-height:180px}.checkbox-content{display:flex;gap:8px;align-items:center}.checkbox-content>.icon{width:16px;height:16px}.menu-container{width:100%;background:white;border:1px solid #CBD2D9;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-top:none;padding:8px 0}.menu-container>.list{max-height:180px}.menu-container>.empty{text-align:center;display:inline-block;width:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: ChipsComponent, selector: "ask-chips", inputs: ["appearance", "showAction", "size", "color"], outputs: ["action"] }, { kind: "component", type: CheckboxComponent, selector: "ask-checkbox", inputs: ["value", "disabled"], outputs: ["valueChange", "change", "click", "focus"] }, { kind: "directive", type: AutofocusDirective, selector: "[askAutofocus]" }, { kind: "directive", type: ScrollDirective, selector: "[askScroll]", inputs: ["askScrollThreshold"], outputs: ["scrollEnd"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
833
840
|
}
|
834
841
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
835
842
|
type: Component,
|
836
|
-
args: [{ selector: 'ask-autocomplete', providers: [valueAccessor], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"autocomplete-wrapper\"\n data-testid=\"autocomplete-wrapper\"\n [class.-closed]=\"closed\"\n [class.-opened]=\"!closed\"\n #wrapper\n (click)=\"handleAutocompleteClick()\"\n>\n <div class=\"autocomplete\" #autocomplete>\n <input\n class=\"search-field\"\n askAutofocus\n *ngIf=\"!closed; else selectionOrPlaceholder\"\n (click)=\"$event.stopPropagation()\"\n [formControl]=\"inputControl\"\n [placeholder]=\"placeholder\"\n />\n <ng-template #selectionOrPlaceholder>\n <ng-container *ngIf=\"showChips\">\n <div\n class=\"chip-list\"\n [class.-collapsed]=\"chipsCollapsed\"\n [ngClass]=\"chipsContainerClasses\"\n >\n <ask-chips\n [style.max-width]=\"chipsCollapsed ? '85%' : '95%'\"\n [showAction]=\"true\"\n *ngFor=\"let option of selectedOptions\"\n (action)=\"handleChipAction(option)\"\n >\n {{ display(option) }}\n </ask-chips>\n <span\n class=\"expand\"\n data-testid=\"see-more\"\n *ngIf=\"showAllSelectionBtn\"\n (click)=\"handleChipsListActionClick($event)\"\n >\n +{{ selection.length - 1 }}\n </span>\n </div>\n </ng-container>\n <span\n class=\"empty-placeholder\"\n data-testid=\"placeholder\"\n *ngIf=\"showPlaceholder\"\n >\n {{\n checkAllValue && allOptionsSelectedText\n ? allOptionsSelectedText\n : placeholder\n }}\n </span>\n </ng-template>\n <span\n class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\"\n *ngIf=\"chipsCollapsed\"\n >\n {{ closed ? \"expand_more\" : \"expand_less\" }}\n </span>\n </div>\n <div class=\"actions\" *ngIf=\"showExpandedSelectionActions\">\n <span\n class=\"see-more\"\n data-testid=\"see-less\"\n (click)=\"handleChipsListActionClick($event)\"\n >\n {{ \"SEE_LESS\" | translate }}\n </span>\n <span\n class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\"\n >\n {{ closed ? \"expand_more\" : \"expand_less\" }}\n </span>\n </div>\n</div>\n\n<ng-template #overlayContent>\n <div #list class=\"menu-container\" [class.-multiple]=\"multiple\">\n <ng-container *ngIf=\"!multiple; else multipleSelection\">\n <div class=\"list\" askScroll [askScrollThreshold]=\"50\">\n <ng-container *ngFor=\"let option of paginatedFilteredOptions\">\n <div\n class=\"option-item\"\n [class.-highlighted]=\"\n selectedOption && selectedOption[valueProp] === option[valueProp]\n \"\n (click)=\"handleOptionSelected(option)\"\n >\n <p class=\"text\">{{ display(option) }}</p>\n </div>\n </ng-container>\n </div>\n </ng-container>\n <ng-template #multipleSelection>\n <div class=\"option-item\" *ngIf=\"showSelectAllCheckbox\">\n <ask-checkbox\n (valueChange)=\"handleSelectAll($event)\"\n [(ngModel)]=\"checkAllValue\"\n >{{selectAllMessage}}</ask-checkbox\n >\n </div>\n <div\n askScroll\n [askScrollThreshold]=\"50\"\n (scrollEnd)=\"getMoreItems()\"\n data-testid=\"options-form\"\n class=\"options-form\"\n [class.-select-all]=\"showSelectAllCheckbox\"\n >\n <ng-container *ngFor=\"let option of paginatedFilteredOptions\">\n <div class=\"option-item\">\n <ask-checkbox\n [value]=\"optionsSelected[option[valueProp]]\"\n (valueChange)=\"valueChange(option, $event)\"\n >\n <div class=\"checkbox-content\">\n <img\n data-testid=\"checkbox-item-icon\"\n class=\"icon\"\n *ngIf=\"iconPropReference\"\n [src]=\"option[iconPropReference]\"\n alt=\"\"\n />\n {{ display(option) }}\n </div>\n </ask-checkbox>\n </div>\n </ng-container>\n </div>\n </ng-template>\n <span class=\"empty\" *ngIf=\"!filteredOptions.length\">{{\n emptyMessage | translate\n }}</span>\n </div>\n</ng-template>\n", styles: [":root{--asksuite-orange: #FF5724;--white: #FFF;--grey-50: #F5F7FA;--grey-100: #E4E7EB;--grey-200: #CBD2D9;--grey-300: #9AA5B1;--grey-400: #7B8794;--grey-500: #616E7C;--grey-600: #52606D;--grey-700: #3E4C59;--grey-800: #2A3042;--grey-900: #1F2933;--yellow-50: #FFF8E2;--yellow-200: #FFECB3;--success-green: #4BAF50;--warning-yellow: #FFC107;--error-red: #E8453E;--shadow: rgba(42, 48, 66, .1607843137);--lightblue-tag: #CDF9F3;--lavender-tag: #D4DAF3;--green-tag: #CEEEAA;--pink-tag: #FBC5FF;--orange-tag: #FED5C9;--purple-tag: #DDBFE5;--yellow-tag: #FFE0B2;--blue-tag: #B2E5FD;--brown-tag: #EFC89C;--whatsapp-green: #68B35D;--facebook-blue: #0084FF;--instagram-pink: #D53E91;--google-blue: #345DC8;--telegram-blue: #34AADF;--telephone-yellow: #FECB00;--primary-background: #FFF;--secondary-background: #EFF3F8;--hover-background: #F5F7FA;--divider-background: #E4E7EB;--font-color-100: #2A3042;--font-color-200: #616E7C;--font-color-300: #9AA5B1}:root{--font-default: $font-default;--font-code: $font-code}:root{--font-xs: $font-xs;--font-sm: $font-sm;--font-md: $font-md;--font-lg: $font-lg;--font-xl: $font-xl;--font-xxl: $font-xxl}:root{--font-weight-regular: $font-weight-regular;--font-weight-medium: $font-weight-medium}:root{--radii-px: $radii-px;--radii-xs: $radii-xs;--radii-sm: $radii-sm;--radii-md: $radii-md;--radii-lg: $radii-lg;--radii-full: $radii-full}.ellipsis,.option-item>.text,.option-item{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scale-in-center{animation:scale-in-center .3s ease-in-out both}@keyframes scale-in-center{0%{transform:scale(0);opacity:1}to{transform:scale(1);opacity:1}}.scale-out-center{animation:scale-out-center .3s ease-in-out both}@keyframes scale-out-center{0%{transform:scale(1);opacity:1}to{transform:scale(0);opacity:1}}.ask-tooltip{background-color:#7b8794;color:#fff;padding:4px;border-radius:8px;position:relative}.ask-tooltip>div{text-align:center!important}.ask-tooltip:after{position:absolute;content:\"\";width:10px;height:10px;background-color:inherit}.ask-tooltip.-above{margin-bottom:4px}.ask-tooltip.-above:after{bottom:-5px;left:50%;transform:translate(-50%) rotate(45deg)}.ask-tooltip.-below{margin-top:4px}.ask-tooltip.-below:after{top:-5px;left:50%;transform:translate(-50%) rotate(45deg)}.ask-tooltip.-after,.ask-tooltip.-right{margin-left:4px}.ask-tooltip.-after:after,.ask-tooltip.-right:after{left:-5px;top:50%;transform:translateY(-50%) rotate(45deg)}.ask-tooltip.-before,.ask-tooltip.-left{margin-right:4px}.ask-tooltip.-before:after,.ask-tooltip.-left:after{right:-5px;top:50%;transform:translateY(-50%) rotate(45deg)}.ask-button{padding:8px 24px;border-radius:6px;border:none;outline:none;height:48px;font-size:1rem;transition:background-color .1s,box-shadow .1s;cursor:pointer;font-weight:500;background:white;color:var(--grey-500)}.ask-button:not(.-primary,.-secondary){box-shadow:0 1px 2px #2a304229}.ask-button:not(.-primary):hover:not(:disabled){box-shadow:0 0 6px #2a304229}.ask-button:hover:not(:disabled){box-shadow:0 0 6px #ff572466}.ask-button:active:not(:disabled){background-color:#f34915}.ask-button:disabled{cursor:not-allowed;background-color:#9aa5b1}.ask-button.-primary{background:#FF5724;color:#fff}.ask-modal-header{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:0 24px 9px}.ask-modal-body{flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;padding:20px 24px;max-height:65vh;display:block}.ask-modal-footer{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;justify-content:flex-end;box-sizing:border-box;min-height:52px;margin:0;padding:8px;border-top:1px solid rgba(0,0,0,0)}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}*{box-sizing:border-box}*,button,select,textarea{font-family:Inter,sans-serif;font-weight:400}input{font-size:1rem}.ask-badge{position:relative}.ask-badge>.badge{position:absolute;display:flex;justify-content:center;align-items:center;background-color:var(--bg-color);color:#fff;font-size:12px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:50%;box-shadow:0 2px 6px -1px #00000080}.ask-badge>.badge.-primary{--bg-color: var(--asksuite-orange)}.ask-badge>.badge.-secondary{--bg-color: var(--grey-800)}.ask-badge>.badge.-top{top:-10px}.ask-badge>.badge.-bottom{bottom:-10px}.ask-badge>.badge.-left{left:-10px}.ask-badge>.badge.-right{right:-10px}.ask-badge>.badge.-small{width:18px;height:18px;font-size:10px}.ask-badge>.badge.-regular{width:22px;height:22px;font-size:11px}.ask-badge>.badge.-large{width:28px;height:28px;font-size:12px}.ask-dropdown-top-right{margin-left:8px}.ask-dropdown-top-left{margin-right:8px}.ask-dropdown-bottom-right,.ask-dropdown-bottom-left{margin-top:8px}.autocomplete-wrapper{position:relative;border:1px solid #CBD2D9;border-radius:4px;padding:16px}.autocomplete-wrapper:hover{cursor:pointer}.autocomplete-wrapper>.autocomplete{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.autocomplete-wrapper>.actions{width:100%;display:flex;flex-direction:row;justify-content:space-between;align-items:center}.autocomplete-wrapper.-opened{border-bottom-right-radius:0;border-bottom-left-radius:0}.autocomplete-wrapper.-closed{transition:all ease-in-out .3s;min-height:54px}.search-field{font-style:inherit;width:100%;border:none;height:100%}.search-field:focus{border:none;outline:none}.search-field::placeholder{opacity:.6}.option-item{display:flex;flex-direction:row;align-items:center;padding-left:1rem;height:36px;width:100%}.option-item.-highlighted{background-color:#e4e7eb}.option-item:hover{cursor:pointer;background-color:#f5f7fa}.see-more,.chip-list>.expand{color:#616e7c;text-decoration:underline;font-size:.875rem;font-weight:500}.see-more:hover,.chip-list>.expand:hover{cursor:pointer}.chip-list{display:flex;align-items:center;flex-direction:row;flex-wrap:wrap;gap:.5rem;flex:1;max-height:calc(120px + 2.5rem);transition:all ease-in-out .3s;max-width:100%}.chip-list.-collapsed{height:24px;overflow:hidden;transition:none}.chip-list.-two{height:calc(48px + 1rem)}.chip-list.-three{height:calc(72px + 1.5rem)}.chip-list.-four{height:calc(96px + 2rem)}.chip-list.-many{overflow-y:auto;height:calc(120px + 2.5rem)}.btn-expand:hover{cursor:pointer}.btn-expand.-disabled{color:#7b8794}.empty-placeholder{font-size:.875rem}.empty-placeholder:hover{cursor:pointer}.list-box,.menu-container>.list,.options-form{min-height:1rem;overflow-y:scroll;max-height:100%}.list-box.-select-all,.menu-container>.-select-all.list,.-select-all.options-form{max-height:80%}.checkbox-content{display:flex;gap:8px;align-items:center}.checkbox-content>.icon{width:16px;height:16px}.menu-container{width:100%;background:white;max-height:165px;border:1px solid #CBD2D9;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-top:none;padding:8px 0}.menu-container>.empty{text-align:center;display:inline-block;width:100%}.menu-container.-multiple{max-height:228px}\n"] }]
|
843
|
+
args: [{ selector: 'ask-autocomplete', providers: [valueAccessor], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"autocomplete-wrapper\"\n data-testid=\"autocomplete-wrapper\"\n [class.-closed]=\"closed\"\n [class.-opened]=\"!closed\"\n #wrapper\n (click)=\"handleAutocompleteClick()\"\n>\n <div class=\"autocomplete\" #autocomplete>\n <input\n class=\"search-field\"\n askAutofocus\n *ngIf=\"!closed; else selectionOrPlaceholder\"\n (click)=\"$event.stopPropagation()\"\n [formControl]=\"inputControl\"\n [placeholder]=\"placeholder\"\n />\n <ng-template #selectionOrPlaceholder>\n <ng-container *ngIf=\"showChips\">\n <div\n class=\"chip-list\"\n [class.-collapsed]=\"chipsCollapsed\"\n [ngClass]=\"chipsContainerClasses\"\n >\n <ask-chips\n [style.max-width]=\"chipsCollapsed ? '85%' : '95%'\"\n [showAction]=\"true\"\n *ngFor=\"let option of selectedOptions\"\n (action)=\"handleChipAction(option)\"\n >\n {{ display(option) }}\n </ask-chips>\n <span\n class=\"expand\"\n data-testid=\"see-more\"\n *ngIf=\"showAllSelectionBtn\"\n (click)=\"handleChipsListActionClick($event)\"\n >\n +{{ selection.length - 1 }}\n </span>\n </div>\n </ng-container>\n <span\n class=\"empty-placeholder\"\n data-testid=\"placeholder\"\n *ngIf=\"showPlaceholder\"\n >\n {{\n checkAllValue && allOptionsSelectedText\n ? allOptionsSelectedText\n : placeholder\n }}\n </span>\n </ng-template>\n <span\n class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\"\n *ngIf=\"chipsCollapsed\"\n >\n {{ closed ? \"expand_more\" : \"expand_less\" }}\n </span>\n </div>\n <div class=\"actions\" *ngIf=\"showExpandedSelectionActions\">\n <span\n class=\"see-more\"\n data-testid=\"see-less\"\n (click)=\"handleChipsListActionClick($event)\"\n >\n {{ \"SEE_LESS\" | translate }}\n </span>\n <span\n class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\"\n >\n {{ closed ? \"expand_more\" : \"expand_less\" }}\n </span>\n </div>\n</div>\n\n<ng-template #overlayContent>\n <div #list class=\"menu-container\" [class.-multiple]=\"multiple\">\n <ng-container *ngIf=\"!multiple; else multipleSelection\">\n <div class=\"list\" askScroll [askScrollThreshold]=\"50\">\n <ng-container *ngFor=\"let option of paginatedFilteredOptions\">\n <div\n class=\"option-item\"\n [class.-highlighted]=\"\n selectedOption && selectedOption[valueProp] === option[valueProp]\n \"\n (click)=\"handleOptionSelected(option)\"\n >\n <p class=\"text\">{{ display(option) }}</p>\n </div>\n </ng-container>\n </div>\n </ng-container>\n <ng-template #multipleSelection>\n <div class=\"option-item\" *ngIf=\"showSelectAllCheckbox\">\n <ask-checkbox\n (valueChange)=\"handleSelectAll($event)\"\n [(ngModel)]=\"checkAllValue\"\n >{{selectAllMessage}}</ask-checkbox\n >\n </div>\n\n <ng-container *ngFor=\"let option of fixedOptionsItems\">\n <div class=\"option-item\">\n <ask-checkbox\n [value]=\"optionsSelected[option[valueProp]]\"\n (valueChange)=\"valueChange(option, $event)\"\n >\n <div class=\"checkbox-content\">\n <img\n data-testid=\"checkbox-item-icon\"\n class=\"icon\"\n *ngIf=\"iconPropReference\"\n [src]=\"option[iconPropReference]\"\n alt=\"\"\n />\n {{ display(option) }}\n </div>\n </ask-checkbox>\n </div>\n </ng-container>\n\n <div\n askScroll\n [askScrollThreshold]=\"50\"\n (scrollEnd)=\"getMoreItems()\"\n data-testid=\"options-form\"\n class=\"options-form\"\n [class.-select-all]=\"showSelectAllCheckbox\"\n >\n <ng-container *ngFor=\"let option of paginatedFilteredOptions\">\n <div class=\"option-item\">\n <ask-checkbox\n [value]=\"optionsSelected[option[valueProp]]\"\n (valueChange)=\"valueChange(option, $event)\"\n >\n <div class=\"checkbox-content\">\n <img\n data-testid=\"checkbox-item-icon\"\n class=\"icon\"\n *ngIf=\"iconPropReference\"\n [src]=\"option[iconPropReference]\"\n alt=\"\"\n />\n {{ display(option) }}\n </div>\n </ask-checkbox>\n </div>\n </ng-container>\n </div>\n </ng-template>\n <span class=\"empty\" *ngIf=\"!filteredOptions.length\">{{\n emptyMessage | translate\n }}</span>\n </div>\n</ng-template>\n", styles: [":root{--asksuite-orange: #FF5724;--white: #FFF;--grey-50: #F5F7FA;--grey-100: #E4E7EB;--grey-200: #CBD2D9;--grey-300: #9AA5B1;--grey-400: #7B8794;--grey-500: #616E7C;--grey-600: #52606D;--grey-700: #3E4C59;--grey-800: #2A3042;--grey-900: #1F2933;--yellow-50: #FFF8E2;--yellow-200: #FFECB3;--success-green: #4BAF50;--warning-yellow: #FFC107;--error-red: #E8453E;--shadow: rgba(42, 48, 66, .1607843137);--lightblue-tag: #CDF9F3;--lavender-tag: #D4DAF3;--green-tag: #CEEEAA;--pink-tag: #FBC5FF;--orange-tag: #FED5C9;--purple-tag: #DDBFE5;--yellow-tag: #FFE0B2;--blue-tag: #B2E5FD;--brown-tag: #EFC89C;--whatsapp-green: #68B35D;--facebook-blue: #0084FF;--instagram-pink: #D53E91;--google-blue: #345DC8;--telegram-blue: #34AADF;--telephone-yellow: #FECB00;--primary-background: #FFF;--secondary-background: #EFF3F8;--hover-background: #F5F7FA;--divider-background: #E4E7EB;--font-color-100: #2A3042;--font-color-200: #616E7C;--font-color-300: #9AA5B1}:root{--font-default: $font-default;--font-code: $font-code}:root{--font-xs: $font-xs;--font-sm: $font-sm;--font-md: $font-md;--font-lg: $font-lg;--font-xl: $font-xl;--font-xxl: $font-xxl}:root{--font-weight-regular: $font-weight-regular;--font-weight-medium: $font-weight-medium}:root{--radii-px: $radii-px;--radii-xs: $radii-xs;--radii-sm: $radii-sm;--radii-md: $radii-md;--radii-lg: $radii-lg;--radii-full: $radii-full}.ellipsis,.option-item>.text,.option-item{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scale-in-center{animation:scale-in-center .3s ease-in-out both}@keyframes scale-in-center{0%{transform:scale(0);opacity:1}to{transform:scale(1);opacity:1}}.scale-out-center{animation:scale-out-center .3s ease-in-out both}@keyframes scale-out-center{0%{transform:scale(1);opacity:1}to{transform:scale(0);opacity:1}}.ask-tooltip{background-color:#7b8794;color:#fff;padding:4px;border-radius:8px;position:relative}.ask-tooltip>div{text-align:center!important}.ask-tooltip:after{position:absolute;content:\"\";width:10px;height:10px;background-color:inherit}.ask-tooltip.-above{margin-bottom:4px}.ask-tooltip.-above:after{bottom:-5px;left:50%;transform:translate(-50%) rotate(45deg)}.ask-tooltip.-below{margin-top:4px}.ask-tooltip.-below:after{top:-5px;left:50%;transform:translate(-50%) rotate(45deg)}.ask-tooltip.-after,.ask-tooltip.-right{margin-left:4px}.ask-tooltip.-after:after,.ask-tooltip.-right:after{left:-5px;top:50%;transform:translateY(-50%) rotate(45deg)}.ask-tooltip.-before,.ask-tooltip.-left{margin-right:4px}.ask-tooltip.-before:after,.ask-tooltip.-left:after{right:-5px;top:50%;transform:translateY(-50%) rotate(45deg)}.ask-button{padding:8px 24px;border-radius:6px;border:none;outline:none;height:48px;font-size:1rem;transition:background-color .1s,box-shadow .1s;cursor:pointer;font-weight:500;background:white;color:var(--grey-500)}.ask-button:not(.-primary,.-secondary){box-shadow:0 1px 2px #2a304229}.ask-button:not(.-primary):hover:not(:disabled){box-shadow:0 0 6px #2a304229}.ask-button:hover:not(:disabled){box-shadow:0 0 6px #ff572466}.ask-button:active:not(:disabled){background-color:#f34915}.ask-button:disabled{cursor:not-allowed;background-color:#9aa5b1}.ask-button.-primary{background:#FF5724;color:#fff}.ask-modal-header{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:0 24px 9px}.ask-modal-body{flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;padding:20px 24px;max-height:65vh;display:block}.ask-modal-footer{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;justify-content:flex-end;box-sizing:border-box;min-height:52px;margin:0;padding:8px;border-top:1px solid rgba(0,0,0,0)}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}*{box-sizing:border-box}*,button,select,textarea{font-family:Inter,sans-serif;font-weight:400}input{font-size:1rem}.ask-badge{position:relative}.ask-badge>.badge{position:absolute;display:flex;justify-content:center;align-items:center;background-color:var(--bg-color);color:#fff;font-size:12px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:50%;box-shadow:0 2px 6px -1px #00000080}.ask-badge>.badge.-primary{--bg-color: var(--asksuite-orange)}.ask-badge>.badge.-secondary{--bg-color: var(--grey-800)}.ask-badge>.badge.-top{top:-10px}.ask-badge>.badge.-bottom{bottom:-10px}.ask-badge>.badge.-left{left:-10px}.ask-badge>.badge.-right{right:-10px}.ask-badge>.badge.-small{width:18px;height:18px;font-size:10px}.ask-badge>.badge.-regular{width:22px;height:22px;font-size:11px}.ask-badge>.badge.-large{width:28px;height:28px;font-size:12px}.ask-dropdown-top-right{margin-left:8px}.ask-dropdown-top-left{margin-right:8px}.ask-dropdown-bottom-right,.ask-dropdown-bottom-left{margin-top:8px}.autocomplete-wrapper{position:relative;border:1px solid #CBD2D9;border-radius:4px;padding:16px}.autocomplete-wrapper:hover{cursor:pointer}.autocomplete-wrapper>.autocomplete{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.autocomplete-wrapper>.actions{width:100%;display:flex;flex-direction:row;justify-content:space-between;align-items:center}.autocomplete-wrapper.-opened{border-bottom-right-radius:0;border-bottom-left-radius:0}.autocomplete-wrapper.-closed{transition:all ease-in-out .3s;min-height:54px}.search-field{font-style:inherit;width:100%;border:none;height:100%}.search-field:focus{border:none;outline:none}.search-field::placeholder{opacity:.6}.option-item{display:flex;flex-direction:row;align-items:center;padding-left:1rem;height:36px;width:100%}.option-item.-highlighted{background-color:#e4e7eb}.option-item:hover{cursor:pointer;background-color:#f5f7fa}.see-more,.chip-list>.expand{color:#616e7c;text-decoration:underline;font-size:.875rem;font-weight:500}.see-more:hover,.chip-list>.expand:hover{cursor:pointer}.chip-list{display:flex;align-items:center;flex-direction:row;flex-wrap:wrap;gap:.5rem;flex:1;max-height:calc(120px + 2.5rem);transition:all ease-in-out .3s;max-width:100%}.chip-list.-collapsed{height:24px;overflow:hidden;transition:none}.chip-list.-two{height:calc(48px + 1rem)}.chip-list.-three{height:calc(72px + 1.5rem)}.chip-list.-four{height:calc(96px + 2rem)}.chip-list.-many{overflow-y:auto;height:calc(120px + 2.5rem)}.btn-expand:hover{cursor:pointer}.btn-expand.-disabled{color:#7b8794}.empty-placeholder{font-size:.875rem}.empty-placeholder:hover{cursor:pointer}.list-box,.menu-container>.list,.options-form{min-height:1rem;overflow-y:scroll;max-height:100%}.list-box.-select-all,.menu-container>.-select-all.list,.-select-all.options-form{max-height:180px}.checkbox-content{display:flex;gap:8px;align-items:center}.checkbox-content>.icon{width:16px;height:16px}.menu-container{width:100%;background:white;border:1px solid #CBD2D9;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-top:none;padding:8px 0}.menu-container>.list{max-height:180px}.menu-container>.empty{text-align:center;display:inline-block;width:100%}\n"] }]
|
837
844
|
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i1$3.Overlay }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }, { type: i3.TranslateService }]; }, propDecorators: { input: [{
|
838
845
|
type: ViewChild,
|
839
846
|
args: ["autocomplete"]
|
@@ -856,6 +863,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImpor
|
|
856
863
|
type: Input
|
857
864
|
}], options: [{
|
858
865
|
type: Input
|
866
|
+
}], fixedOptions: [{
|
867
|
+
type: Input
|
859
868
|
}], placeholder: [{
|
860
869
|
type: Input
|
861
870
|
}], emptyMessage: [{
|
@@ -1593,7 +1602,9 @@ class AskDropdownDirective {
|
|
1593
1602
|
this.dropdownName = '';
|
1594
1603
|
this.dropdownDisabled = false;
|
1595
1604
|
this.dropdownOpenOnHover = false;
|
1605
|
+
this.mouseThreshold = 300;
|
1596
1606
|
this.askDropdownOnClose = new EventEmitter();
|
1607
|
+
this.mouseLocation = { mouseX: 0, mouseY: 0 };
|
1597
1608
|
this._isRendered = false;
|
1598
1609
|
this.overlayConfig = {};
|
1599
1610
|
this.AVAILABLE_POSITIONS = {
|
@@ -1654,6 +1665,14 @@ class AskDropdownDirective {
|
|
1654
1665
|
showOnHoverIn() {
|
1655
1666
|
if (this.dropdownOpenOnHover) {
|
1656
1667
|
this.show();
|
1668
|
+
this.mouseLocation = this.onMouseMove(event);
|
1669
|
+
this.mouseDistanceSubscription = fromEvent(document.body, 'mousemove').subscribe((e) => {
|
1670
|
+
const mouseYCloseOn = Math.abs(this.mouseLocation.mouseY - e.pageY) <= this.mouseThreshold;
|
1671
|
+
const mouseXCloseOn = Math.abs(this.mouseLocation.mouseX - e.pageX) <= this.mouseThreshold;
|
1672
|
+
if (!(mouseYCloseOn && mouseXCloseOn)) {
|
1673
|
+
this.close();
|
1674
|
+
}
|
1675
|
+
});
|
1657
1676
|
}
|
1658
1677
|
}
|
1659
1678
|
show() {
|
@@ -1673,6 +1692,13 @@ class AskDropdownDirective {
|
|
1673
1692
|
}
|
1674
1693
|
this._isRendered = true;
|
1675
1694
|
}
|
1695
|
+
onMouseMove(event) {
|
1696
|
+
const location = {
|
1697
|
+
mouseX: event.clientX,
|
1698
|
+
mouseY: event.pageY
|
1699
|
+
};
|
1700
|
+
return location;
|
1701
|
+
}
|
1676
1702
|
close() {
|
1677
1703
|
this.containerRef = undefined;
|
1678
1704
|
this.overlayRef.detach();
|
@@ -1681,12 +1707,15 @@ class AskDropdownDirective {
|
|
1681
1707
|
if (this.mouseOutSubscription) {
|
1682
1708
|
this.mouseOutSubscription.unsubscribe();
|
1683
1709
|
}
|
1710
|
+
if (this.mouseDistanceSubscription) {
|
1711
|
+
this.mouseDistanceSubscription.unsubscribe();
|
1712
|
+
}
|
1684
1713
|
}
|
1685
1714
|
get isRendered() {
|
1686
1715
|
return this._isRendered;
|
1687
1716
|
}
|
1688
1717
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: AskDropdownDirective, deps: [{ token: i1$3.OverlayPositionBuilder }, { token: i0.ElementRef }, { token: i1$3.Overlay }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
1689
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.6", type: AskDropdownDirective, selector: "[askDropdown]", inputs: { askDropdown: "askDropdown", dropdownName: "dropdownName", positions: "positions", dropdownDisabled: "dropdownDisabled", dropdownOpenOnHover: "dropdownOpenOnHover" }, outputs: { askDropdownOnClose: "askDropdownOnClose" }, host: { listeners: { "mouseenter": "showOnHoverIn()", "click": "show()" } }, ngImport: i0 }); }
|
1718
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.6", type: AskDropdownDirective, selector: "[askDropdown]", inputs: { askDropdown: "askDropdown", dropdownName: "dropdownName", positions: "positions", dropdownDisabled: "dropdownDisabled", dropdownOpenOnHover: "dropdownOpenOnHover", mouseThreshold: "mouseThreshold" }, outputs: { askDropdownOnClose: "askDropdownOnClose" }, host: { listeners: { "mouseenter": "showOnHoverIn()", "click": "show()" } }, ngImport: i0 }); }
|
1690
1719
|
}
|
1691
1720
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: AskDropdownDirective, decorators: [{
|
1692
1721
|
type: Directive,
|
@@ -1703,6 +1732,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImpor
|
|
1703
1732
|
type: Input
|
1704
1733
|
}], dropdownOpenOnHover: [{
|
1705
1734
|
type: Input
|
1735
|
+
}], mouseThreshold: [{
|
1736
|
+
type: Input
|
1706
1737
|
}], askDropdownOnClose: [{
|
1707
1738
|
type: Output
|
1708
1739
|
}], showOnHoverIn: [{
|