asksuite-citrus 0.8.4 → 0.9.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.
- package/esm2022/lib/asksuite-citrus.module.mjs +7 -4
- package/esm2022/lib/components/autocomplete/autocomplete.component.mjs +32 -52
- package/esm2022/lib/components/toast/toast.component.mjs +68 -0
- package/esm2022/lib/services/toast/toast-ref.mjs +12 -0
- package/esm2022/lib/services/toast/toast.config.mjs +3 -0
- package/esm2022/lib/services/toast/toast.service.mjs +68 -0
- package/esm2022/public-api.mjs +5 -1
- package/fesm2022/asksuite-citrus.mjs +177 -56
- package/fesm2022/asksuite-citrus.mjs.map +1 -1
- package/lib/asksuite-citrus.module.d.ts +8 -7
- package/lib/components/autocomplete/autocomplete.component.d.ts +6 -5
- package/lib/components/toast/toast.component.d.ts +24 -0
- package/lib/services/toast/toast-ref.d.ts +7 -0
- package/lib/services/toast/toast.config.d.ts +11 -0
- package/lib/services/toast/toast.service.d.ts +23 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { EventEmitter, Component, Input, Output, forwardRef, ViewChild, HostListener, Directive, ChangeDetectionStrategy, inject, DestroyRef, HostBinding, Inject, NgModule } from '@angular/core';
|
2
|
+
import { EventEmitter, Component, Input, Output, forwardRef, ViewChild, HostListener, Directive, ChangeDetectionStrategy, inject, DestroyRef, HostBinding, Inject, InjectionToken, NgModule, Injector, Injectable } from '@angular/core';
|
3
3
|
import * as i1 from '@angular/common';
|
4
4
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
5
5
|
import * as i1$2 from '@angular/material/tooltip';
|
@@ -10,7 +10,7 @@ import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
|
|
10
10
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
11
11
|
import * as i1$3 from '@angular/cdk/overlay';
|
12
12
|
import { CdkOverlayOrigin, CdkConnectedOverlay, OverlayModule } from '@angular/cdk/overlay';
|
13
|
-
import { debounceTime,
|
13
|
+
import { debounceTime, tap, map } from 'rxjs';
|
14
14
|
import * as i8 from '@ngx-translate/core';
|
15
15
|
import { TranslateModule } from '@ngx-translate/core';
|
16
16
|
import moment from 'moment';
|
@@ -683,6 +683,7 @@ class AutocompleteComponent {
|
|
683
683
|
"-four": false,
|
684
684
|
"-many": false
|
685
685
|
};
|
686
|
+
this.optionsSelected = {};
|
686
687
|
this._destroy = inject(DestroyRef);
|
687
688
|
this.ITEMS_PER_PAGE = 40;
|
688
689
|
this._pageNumber = 1;
|
@@ -696,16 +697,13 @@ class AutocompleteComponent {
|
|
696
697
|
this.allOptionsSelectedText = null;
|
697
698
|
this.onChange = (_) => { };
|
698
699
|
this.onTouched = () => { };
|
699
|
-
this.selectionForm = formBuilder.group({});
|
700
700
|
}
|
701
701
|
ngAfterViewInit() {
|
702
|
-
this.checkAllValue = this.isAllOptionsSelected
|
702
|
+
this.checkAllValue = this.isAllOptionsSelected;
|
703
703
|
this.handleInputChange();
|
704
|
-
this.listenSelectionChange();
|
705
704
|
}
|
706
|
-
isAllOptionsSelected() {
|
707
|
-
return
|
708
|
-
&& this.options.every(value => this.selectionForm.value[value[this.valueProp]]);
|
705
|
+
get isAllOptionsSelected() {
|
706
|
+
return this.selection.length === this.options.length;
|
709
707
|
}
|
710
708
|
ngOnChanges(changes) {
|
711
709
|
if (changes['options']) {
|
@@ -713,12 +711,11 @@ class AutocompleteComponent {
|
|
713
711
|
this._reachedEnd = false;
|
714
712
|
this.paginatedFilteredOptions = [];
|
715
713
|
this.filteredOptions = changes['options'].currentValue;
|
716
|
-
this.
|
717
|
-
this.getMoreItems();
|
714
|
+
this.updateValidation();
|
718
715
|
}
|
719
716
|
}
|
720
717
|
handleInputChange() {
|
721
|
-
this.inputControl.valueChanges.pipe(takeUntilDestroyed(this._destroy), debounceTime(300),
|
718
|
+
this.inputControl.valueChanges.pipe(takeUntilDestroyed(this._destroy), debounceTime(300), tap(() => {
|
722
719
|
this._pageNumber = 1;
|
723
720
|
this._reachedEnd = false;
|
724
721
|
this.paginatedFilteredOptions = [];
|
@@ -727,28 +724,14 @@ class AutocompleteComponent {
|
|
727
724
|
this.getMoreItems();
|
728
725
|
});
|
729
726
|
}
|
730
|
-
listenSelectionChange() {
|
731
|
-
if (Object.keys(this.selectionForm.value).length) {
|
732
|
-
this.selection = this.options.filter(option => this.selectionForm.value[option[this.valueProp]]);
|
733
|
-
this.updateValidation();
|
734
|
-
this.change.detectChanges();
|
735
|
-
}
|
736
|
-
this.selectionForm
|
737
|
-
.valueChanges
|
738
|
-
.pipe(takeUntilDestroyed(this._destroy))
|
739
|
-
.subscribe((values) => {
|
740
|
-
this.handleSelectionChange(this.options.filter(option => values[option[this.valueProp]]));
|
741
|
-
this.onChange(this.selection);
|
742
|
-
this.onTouched();
|
743
|
-
this.checkAllValue = this.selection.length === this.options.length;
|
744
|
-
});
|
745
|
-
}
|
746
727
|
handleSelectionChange(values) {
|
747
728
|
this.selection = values;
|
729
|
+
this.checkAllValue = this.isAllOptionsSelected;
|
748
730
|
if (!this.chipsCollapsed) {
|
749
731
|
this.chipsCollapsed = this.selection.length < 2;
|
750
732
|
}
|
751
733
|
this.updateValidation();
|
734
|
+
this.change.detectChanges();
|
752
735
|
}
|
753
736
|
updateChipsContainerClasses() {
|
754
737
|
this.chipsContainerClasses = {
|
@@ -822,7 +805,6 @@ class AutocompleteComponent {
|
|
822
805
|
&& !this.wrapper?.nativeElement.contains(event.target)
|
823
806
|
&& !this.list?.nativeElement.contains(event.target)) {
|
824
807
|
this.hideOptions();
|
825
|
-
this.updateValidation();
|
826
808
|
this.change.detectChanges();
|
827
809
|
}
|
828
810
|
}
|
@@ -835,22 +817,32 @@ class AutocompleteComponent {
|
|
835
817
|
}
|
836
818
|
handleSelectAll(checked) {
|
837
819
|
this.selectAllOptions(checked);
|
820
|
+
this.selection = checked ? this.options : [];
|
821
|
+
this.onChange(this.selection);
|
822
|
+
this.updateValidation();
|
823
|
+
this.change.detectChanges();
|
824
|
+
}
|
825
|
+
valueChange(option, value) {
|
826
|
+
this.optionsSelected[option[this.valueProp]] = value;
|
827
|
+
this.selection = this.options.filter(o => this.optionsSelected[o[this.valueProp]]);
|
828
|
+
this.checkAllValue = this.selection.length === this.options.length;
|
829
|
+
this.onChange(this.selection);
|
830
|
+
this.onTouched();
|
831
|
+
this.updateChipsContainerClasses();
|
838
832
|
this.updateValidation();
|
839
833
|
this.change.detectChanges();
|
840
834
|
}
|
841
835
|
selectAllOptions(selected) {
|
842
|
-
this.
|
843
|
-
const newValues = Object.keys(this.selectionForm.controls)
|
836
|
+
this.optionsSelected = this.options
|
844
837
|
.reduce((acc, curr) => {
|
845
|
-
acc[curr] = selected;
|
838
|
+
acc[curr[this.valueProp]] = selected;
|
846
839
|
return acc;
|
847
840
|
}, {});
|
848
|
-
this.selectionForm.patchValue(newValues);
|
849
|
-
this.selectionForm.updateValueAndValidity();
|
850
841
|
}
|
851
842
|
handleChipAction(option) {
|
852
843
|
if (this.multiple) {
|
853
|
-
this.
|
844
|
+
this.optionsSelected[option[this.valueProp]] = false;
|
845
|
+
this.selection = this.selection.filter(selectedOption => selectedOption[this.valueProp] !== option[this.valueProp]);
|
854
846
|
}
|
855
847
|
else {
|
856
848
|
this.selectedOption = null;
|
@@ -868,7 +860,6 @@ class AutocompleteComponent {
|
|
868
860
|
const nextPageItems = sortedFilteredOptions
|
869
861
|
.slice(this.ITEMS_PER_PAGE * (this._pageNumber - 1), this.ITEMS_PER_PAGE * this._pageNumber);
|
870
862
|
if (nextPageItems.length) {
|
871
|
-
this.selectionForm.updateValueAndValidity();
|
872
863
|
this.paginatedFilteredOptions = [...this.paginatedFilteredOptions, ...nextPageItems];
|
873
864
|
this._pageNumber += 1;
|
874
865
|
}
|
@@ -893,17 +884,8 @@ class AutocompleteComponent {
|
|
893
884
|
}
|
894
885
|
});
|
895
886
|
}
|
896
|
-
updateFormControls(items, form, fb, propValue, checked) {
|
897
|
-
items.forEach(item => {
|
898
|
-
if (form.value[item[propValue]] === undefined) {
|
899
|
-
form.addControl(item[propValue], fb.control(checked), { emitEvent: false });
|
900
|
-
}
|
901
|
-
else if (!form.value[item[propValue]]) {
|
902
|
-
form.get(item[propValue])?.setValue(checked, { emitEvent: false });
|
903
|
-
}
|
904
|
-
});
|
905
|
-
}
|
906
887
|
updateValidation() {
|
888
|
+
this.checkAllValue = this.isAllOptionsSelected;
|
907
889
|
this.showChips = Boolean(this.selectedOptions.length) && this.closed && (!this.multiple || !this.checkAllValue || (this.checkAllValue && !Boolean(this.allOptionsSelectedText)));
|
908
890
|
this.showAllSelectionBtn = this.multiple && Boolean(this.selection.length > 1) && this.chipsCollapsed;
|
909
891
|
this.showPlaceholder = this.closed && (!this.selectedOptions.length || (this.checkAllValue && Boolean(this.allOptionsSelectedText) && this.multiple));
|
@@ -914,16 +896,14 @@ class AutocompleteComponent {
|
|
914
896
|
writeValue(obj) {
|
915
897
|
this.selection = [];
|
916
898
|
if (this.multiple && Array.isArray(obj)) {
|
917
|
-
this.
|
918
|
-
|
919
|
-
this.selectionForm.updateValueAndValidity();
|
899
|
+
this.optionsSelected = {};
|
900
|
+
obj.forEach(option => this.optionsSelected[option[this.valueProp]] = true);
|
920
901
|
}
|
921
902
|
else {
|
922
903
|
this.selectedOption = obj;
|
923
904
|
}
|
924
|
-
if (this.multiple
|
905
|
+
if (this.multiple) {
|
925
906
|
this.handleSelectionChange(obj);
|
926
|
-
this.checkAllValue = this.selection.length === this.options.length;
|
927
907
|
}
|
928
908
|
this.change.detectChanges();
|
929
909
|
}
|
@@ -937,11 +917,11 @@ class AutocompleteComponent {
|
|
937
917
|
this.disabled = isDisabled;
|
938
918
|
}
|
939
919
|
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 }], target: i0.ɵɵFactoryTarget.Component }); }
|
940
|
-
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" }, 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 class=\"autocomplete-wrapper\"\n [class.-closed]=\"closed\"\n [class.-opened]=\"!closed\"\n #wrapper\n (click)=\"handleAutocompleteClick()\"\n>\n <div class=\"autocomplete\" #autocomplete>\n <input class=\"search-field\"\n askAutofocus\n *ngIf=\"!closed; else selectionOrPlaceholder\"\n (click)=\"$event.stopPropagation()\"\n [formControl]=\"inputControl\"\n [placeholder]=\"placeholder\"/>\n <ng-template #selectionOrPlaceholder>\n <ng-container *ngIf=\"showChips\">\n <div class=\"chip-list\" [class.-collapsed]=\"chipsCollapsed\"\n [ngClass]=\"chipsContainerClasses\">\n <ask-chips [style.max-width]=\"chipsCollapsed ? '85%' : '95%'\"\n [showAction]=\"true\"\n *ngFor=\"let option of selectedOptions\"\n (action)=\"handleChipAction(option)\">\n {{display(option)}}\n </ask-chips>\n <span class=\"expand\" data-testid=\"see-more\" *ngIf=\"showAllSelectionBtn\"\n (click)=\"handleChipsListActionClick($event)\">\n +{{selection.length - 1}}\n </span>\n </div>\n </ng-container>\n <span class=\"empty-placeholder\" data-testid=\"placeholder\" *ngIf=\"showPlaceholder\">\n {{(checkAllValue && allOptionsSelectedText) ? allOptionsSelectedText : placeholder}}\n </span>\n </ng-template>\n <span class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\"\n *ngIf=\"chipsCollapsed\">\n {{closed ? \"expand_more\" : \"expand_less\"}}\n </span>\n </div>\n <div class=\"actions\" *ngIf=\"showExpandedSelectionActions\">\n <span class=\"see-more\" data-testid=\"see-less\"\n (click)=\"handleChipsListActionClick($event)\">\n {{'SEE_LESS' | translate}}\n </span>\n <span class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\">\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 class=\"option-item\"\n [class.-highlighted]=\"selectedOption && selectedOption[valueProp] === option[valueProp]\"\n (click)=\"handleOptionSelected(option)\">\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 (valueChange)=\"handleSelectAll($event)\" [(ngModel)]=\"checkAllValue\">Selecionar todas</ask-checkbox>\n </div>\n <form askScroll [askScrollThreshold]=\"50\"\n *ngIf=\"selectionForm.controls\"\n [formGroup]=\"selectionForm\"\n (scrollEnd)=\"getMoreItems()\"\n data-testid=\"options-form\"\n class=\"options-form\"\n [class.-select-all]=\"showSelectAllCheckbox\">\n <ng-container *ngFor=\"let option of paginatedFilteredOptions\">\n <div class=\"option-item\">\n <ask-checkbox [formControlName]=\"option[valueProp]\">{{display(option)}}</ask-checkbox>\n </div>\n </ng-container>\n </form>\n </ng-template>\n <span class=\"empty\" *ngIf=\"!filteredOptions.length\">{{emptyMessage | translate}}</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)}.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:155px;transition:all ease-in-out .3s;max-width:100%}.chip-list.-collapsed{height:31px;overflow:hidden;transition:none}.chip-list.-two{height:62px}.chip-list.-three{height:93px}.chip-list.-four{height:124px}.chip-list.-many{overflow-y:auto;height:155px}.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%}.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.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { 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: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: ChipsComponent, selector: "ask-chips", inputs: ["appearance", "showAction", "size"], 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: i8.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
920
|
+
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" }, 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 class=\"autocomplete-wrapper\"\n [class.-closed]=\"closed\"\n [class.-opened]=\"!closed\"\n #wrapper\n (click)=\"handleAutocompleteClick()\"\n>\n <div class=\"autocomplete\" #autocomplete>\n <input class=\"search-field\"\n askAutofocus\n *ngIf=\"!closed; else selectionOrPlaceholder\"\n (click)=\"$event.stopPropagation()\"\n [formControl]=\"inputControl\"\n [placeholder]=\"placeholder\"/>\n <ng-template #selectionOrPlaceholder>\n <ng-container *ngIf=\"showChips\">\n <div class=\"chip-list\" [class.-collapsed]=\"chipsCollapsed\"\n [ngClass]=\"chipsContainerClasses\">\n <ask-chips [style.max-width]=\"chipsCollapsed ? '85%' : '95%'\"\n [showAction]=\"true\"\n *ngFor=\"let option of selectedOptions\"\n (action)=\"handleChipAction(option)\">\n {{display(option)}}\n </ask-chips>\n <span class=\"expand\" data-testid=\"see-more\" *ngIf=\"showAllSelectionBtn\"\n (click)=\"handleChipsListActionClick($event)\">\n +{{selection.length - 1}}\n </span>\n </div>\n </ng-container>\n <span class=\"empty-placeholder\" data-testid=\"placeholder\" *ngIf=\"showPlaceholder\">\n {{(checkAllValue && allOptionsSelectedText) ? allOptionsSelectedText : placeholder}}\n </span>\n </ng-template>\n <span class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\"\n *ngIf=\"chipsCollapsed\">\n {{closed ? \"expand_more\" : \"expand_less\"}}\n </span>\n </div>\n <div class=\"actions\" *ngIf=\"showExpandedSelectionActions\">\n <span class=\"see-more\" data-testid=\"see-less\"\n (click)=\"handleChipsListActionClick($event)\">\n {{'SEE_LESS' | translate}}\n </span>\n <span class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\">\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 class=\"option-item\"\n [class.-highlighted]=\"selectedOption && selectedOption[valueProp] === option[valueProp]\"\n (click)=\"handleOptionSelected(option)\">\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 (valueChange)=\"handleSelectAll($event)\" [(ngModel)]=\"checkAllValue\">Selecionar todas</ask-checkbox>\n </div>\n <div askScroll [askScrollThreshold]=\"50\"\n (scrollEnd)=\"getMoreItems()\"\n data-testid=\"options-form\"\n class=\"options-form\"\n [class.-select-all]=\"showSelectAllCheckbox\">\n <ng-container *ngFor=\"let option of paginatedFilteredOptions\">\n <div class=\"option-item\">\n <ask-checkbox [value]=\"optionsSelected[option[valueProp]]\" (valueChange)=\"valueChange(option, $event)\">\n {{display(option)}}</ask-checkbox>\n </div>\n </ng-container>\n </div>\n </ng-template>\n <span class=\"empty\" *ngIf=\"!filteredOptions.length\">{{emptyMessage | translate}}</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)}.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:155px;transition:all ease-in-out .3s;max-width:100%}.chip-list.-collapsed{height:31px;overflow:hidden;transition:none}.chip-list.-two{height:62px}.chip-list.-three{height:93px}.chip-list.-four{height:124px}.chip-list.-many{overflow-y:auto;height:155px}.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%}.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"], 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: i8.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
941
921
|
}
|
942
922
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
943
923
|
type: Component,
|
944
|
-
args: [{ selector: 'ask-autocomplete', providers: [valueAccessor], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"autocomplete-wrapper\"\n [class.-closed]=\"closed\"\n [class.-opened]=\"!closed\"\n #wrapper\n (click)=\"handleAutocompleteClick()\"\n>\n <div class=\"autocomplete\" #autocomplete>\n <input class=\"search-field\"\n askAutofocus\n *ngIf=\"!closed; else selectionOrPlaceholder\"\n (click)=\"$event.stopPropagation()\"\n [formControl]=\"inputControl\"\n [placeholder]=\"placeholder\"/>\n <ng-template #selectionOrPlaceholder>\n <ng-container *ngIf=\"showChips\">\n <div class=\"chip-list\" [class.-collapsed]=\"chipsCollapsed\"\n [ngClass]=\"chipsContainerClasses\">\n <ask-chips [style.max-width]=\"chipsCollapsed ? '85%' : '95%'\"\n [showAction]=\"true\"\n *ngFor=\"let option of selectedOptions\"\n (action)=\"handleChipAction(option)\">\n {{display(option)}}\n </ask-chips>\n <span class=\"expand\" data-testid=\"see-more\" *ngIf=\"showAllSelectionBtn\"\n (click)=\"handleChipsListActionClick($event)\">\n +{{selection.length - 1}}\n </span>\n </div>\n </ng-container>\n <span class=\"empty-placeholder\" data-testid=\"placeholder\" *ngIf=\"showPlaceholder\">\n {{(checkAllValue && allOptionsSelectedText) ? allOptionsSelectedText : placeholder}}\n </span>\n </ng-template>\n <span class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\"\n *ngIf=\"chipsCollapsed\">\n {{closed ? \"expand_more\" : \"expand_less\"}}\n </span>\n </div>\n <div class=\"actions\" *ngIf=\"showExpandedSelectionActions\">\n <span class=\"see-more\" data-testid=\"see-less\"\n (click)=\"handleChipsListActionClick($event)\">\n {{'SEE_LESS' | translate}}\n </span>\n <span class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\">\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 class=\"option-item\"\n [class.-highlighted]=\"selectedOption && selectedOption[valueProp] === option[valueProp]\"\n (click)=\"handleOptionSelected(option)\">\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 (valueChange)=\"handleSelectAll($event)\" [(ngModel)]=\"checkAllValue\">Selecionar todas</ask-checkbox>\n </div>\n <
|
924
|
+
args: [{ selector: 'ask-autocomplete', providers: [valueAccessor], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"autocomplete-wrapper\"\n [class.-closed]=\"closed\"\n [class.-opened]=\"!closed\"\n #wrapper\n (click)=\"handleAutocompleteClick()\"\n>\n <div class=\"autocomplete\" #autocomplete>\n <input class=\"search-field\"\n askAutofocus\n *ngIf=\"!closed; else selectionOrPlaceholder\"\n (click)=\"$event.stopPropagation()\"\n [formControl]=\"inputControl\"\n [placeholder]=\"placeholder\"/>\n <ng-template #selectionOrPlaceholder>\n <ng-container *ngIf=\"showChips\">\n <div class=\"chip-list\" [class.-collapsed]=\"chipsCollapsed\"\n [ngClass]=\"chipsContainerClasses\">\n <ask-chips [style.max-width]=\"chipsCollapsed ? '85%' : '95%'\"\n [showAction]=\"true\"\n *ngFor=\"let option of selectedOptions\"\n (action)=\"handleChipAction(option)\">\n {{display(option)}}\n </ask-chips>\n <span class=\"expand\" data-testid=\"see-more\" *ngIf=\"showAllSelectionBtn\"\n (click)=\"handleChipsListActionClick($event)\">\n +{{selection.length - 1}}\n </span>\n </div>\n </ng-container>\n <span class=\"empty-placeholder\" data-testid=\"placeholder\" *ngIf=\"showPlaceholder\">\n {{(checkAllValue && allOptionsSelectedText) ? allOptionsSelectedText : placeholder}}\n </span>\n </ng-template>\n <span class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\"\n *ngIf=\"chipsCollapsed\">\n {{closed ? \"expand_more\" : \"expand_less\"}}\n </span>\n </div>\n <div class=\"actions\" *ngIf=\"showExpandedSelectionActions\">\n <span class=\"see-more\" data-testid=\"see-less\"\n (click)=\"handleChipsListActionClick($event)\">\n {{'SEE_LESS' | translate}}\n </span>\n <span class=\"btn-expand material-icons\"\n data-testid=\"btn-expand\"\n [class.-disabled]=\"disabled\">\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 class=\"option-item\"\n [class.-highlighted]=\"selectedOption && selectedOption[valueProp] === option[valueProp]\"\n (click)=\"handleOptionSelected(option)\">\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 (valueChange)=\"handleSelectAll($event)\" [(ngModel)]=\"checkAllValue\">Selecionar todas</ask-checkbox>\n </div>\n <div askScroll [askScrollThreshold]=\"50\"\n (scrollEnd)=\"getMoreItems()\"\n data-testid=\"options-form\"\n class=\"options-form\"\n [class.-select-all]=\"showSelectAllCheckbox\">\n <ng-container *ngFor=\"let option of paginatedFilteredOptions\">\n <div class=\"option-item\">\n <ask-checkbox [value]=\"optionsSelected[option[valueProp]]\" (valueChange)=\"valueChange(option, $event)\">\n {{display(option)}}</ask-checkbox>\n </div>\n </ng-container>\n </div>\n </ng-template>\n <span class=\"empty\" *ngIf=\"!filteredOptions.length\">{{emptyMessage | translate}}</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)}.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:155px;transition:all ease-in-out .3s;max-width:100%}.chip-list.-collapsed{height:31px;overflow:hidden;transition:none}.chip-list.-two{height:62px}.chip-list.-three{height:93px}.chip-list.-four{height:124px}.chip-list.-many{overflow-y:auto;height:155px}.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%}.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"] }]
|
945
925
|
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i1$3.Overlay }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { input: [{
|
946
926
|
type: ViewChild,
|
947
927
|
args: ["autocomplete"]
|
@@ -1503,6 +1483,84 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImpor
|
|
1503
1483
|
type: Input
|
1504
1484
|
}] } });
|
1505
1485
|
|
1486
|
+
const ASK_TOAST_CONFIG = new InjectionToken('Default toast options');
|
1487
|
+
|
1488
|
+
class ToastRef {
|
1489
|
+
constructor(overlay) {
|
1490
|
+
this.overlay = overlay;
|
1491
|
+
}
|
1492
|
+
close() {
|
1493
|
+
this.overlay.dispose();
|
1494
|
+
}
|
1495
|
+
getPosition() {
|
1496
|
+
return this.overlay.overlayElement.getBoundingClientRect();
|
1497
|
+
}
|
1498
|
+
}
|
1499
|
+
|
1500
|
+
class ToastComponent {
|
1501
|
+
constructor(data, ref) {
|
1502
|
+
this.data = data;
|
1503
|
+
this.ref = ref;
|
1504
|
+
this.message = '';
|
1505
|
+
this.icon = 'check_small';
|
1506
|
+
this.config = {
|
1507
|
+
timeout: 5000,
|
1508
|
+
};
|
1509
|
+
this.color = 'var(--success-green)';
|
1510
|
+
this.fontColor = 'var(--white)';
|
1511
|
+
this.isClosing = false;
|
1512
|
+
this.TYPES = {
|
1513
|
+
success: { color: 'var(--success-green)', icon: 'check_small', fontColor: 'var(--white)' },
|
1514
|
+
warning: { color: 'var(--warning-yellow)', icon: 'warning', fontColor: 'var(--grey-800)' },
|
1515
|
+
danger: { color: 'var(--error-red)', icon: 'error', fontColor: 'var(--white)' },
|
1516
|
+
info: { color: 'var(--facebook-blue)', icon: 'info', fontColor: 'var(--white)' },
|
1517
|
+
};
|
1518
|
+
this.message = data.message;
|
1519
|
+
this.type = data.type;
|
1520
|
+
this.config = {
|
1521
|
+
...this.config,
|
1522
|
+
...data.config
|
1523
|
+
};
|
1524
|
+
}
|
1525
|
+
set type(type) {
|
1526
|
+
this.icon = this.TYPES[type].icon;
|
1527
|
+
this.fontColor = this.TYPES[type].fontColor;
|
1528
|
+
this.color = this.TYPES[type].color;
|
1529
|
+
}
|
1530
|
+
ngOnInit() {
|
1531
|
+
if (this.config?.timeout) {
|
1532
|
+
this.timeoutRef = setTimeout(() => this.close(), this.config.timeout);
|
1533
|
+
}
|
1534
|
+
}
|
1535
|
+
ngOnDestroy() {
|
1536
|
+
clearTimeout(this.timeoutRef);
|
1537
|
+
}
|
1538
|
+
close() {
|
1539
|
+
this.isClosing = true;
|
1540
|
+
setTimeout(() => this.ref.close(), 250);
|
1541
|
+
}
|
1542
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: ToastComponent, deps: [{ token: ASK_TOAST_CONFIG }, { token: ToastRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
1543
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.6", type: ToastComponent, selector: "ask-toast", inputs: { type: "type" }, host: { properties: { "style.background-color": "this.color", "style.color": "this.fontColor", "class.closing": "this.isClosing" } }, ngImport: i0, template: "<span class=\"material-icons icon\">\n {{ icon }}\n</span>\n\n<p class=\"message\">\n {{ message }}\n</p>\n\n<button type=\"button\" class=\"close-icon\" (click)=\"close()\">\n <span class=\"material-icons icon\" [style.color]=\"fontColor\">close</span>\n</button>\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{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)}.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}:host{position:relative;display:flex;align-items:center;gap:8px;flex-direction:row;width:220px;padding:16px;border-radius:4px;box-shadow:0 0 6px #2a304229;animation:toastIn .2s ease-out 0s 1 normal forwards}@keyframes toastIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes toastOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-10px)}}:host.closing{animation:toastOut .2s ease-out 0s 1 normal forwards}:host>.icon{width:24px;height:24px;-webkit-user-select:none;user-select:none}:host>.message{font-size:1rem}.close-icon{position:absolute;display:flex;align-items:center;justify-content:center;width:14px;height:14px;border:none;outline:none;background:none;cursor:pointer;top:4px;right:4px}.close-icon>.icon{font-size:16px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
1544
|
+
}
|
1545
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: ToastComponent, decorators: [{
|
1546
|
+
type: Component,
|
1547
|
+
args: [{ selector: 'ask-toast', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"material-icons icon\">\n {{ icon }}\n</span>\n\n<p class=\"message\">\n {{ message }}\n</p>\n\n<button type=\"button\" class=\"close-icon\" (click)=\"close()\">\n <span class=\"material-icons icon\" [style.color]=\"fontColor\">close</span>\n</button>\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{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)}.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}:host{position:relative;display:flex;align-items:center;gap:8px;flex-direction:row;width:220px;padding:16px;border-radius:4px;box-shadow:0 0 6px #2a304229;animation:toastIn .2s ease-out 0s 1 normal forwards}@keyframes toastIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes toastOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-10px)}}:host.closing{animation:toastOut .2s ease-out 0s 1 normal forwards}:host>.icon{width:24px;height:24px;-webkit-user-select:none;user-select:none}:host>.message{font-size:1rem}.close-icon{position:absolute;display:flex;align-items:center;justify-content:center;width:14px;height:14px;border:none;outline:none;background:none;cursor:pointer;top:4px;right:4px}.close-icon>.icon{font-size:16px}\n"] }]
|
1548
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
1549
|
+
type: Inject,
|
1550
|
+
args: [ASK_TOAST_CONFIG]
|
1551
|
+
}] }, { type: ToastRef }]; }, propDecorators: { color: [{
|
1552
|
+
type: HostBinding,
|
1553
|
+
args: ['style.background-color']
|
1554
|
+
}], fontColor: [{
|
1555
|
+
type: HostBinding,
|
1556
|
+
args: ['style.color']
|
1557
|
+
}], isClosing: [{
|
1558
|
+
type: HostBinding,
|
1559
|
+
args: ['class.closing']
|
1560
|
+
}], type: [{
|
1561
|
+
type: Input
|
1562
|
+
}] } });
|
1563
|
+
|
1506
1564
|
class AsksuiteCitrusModule {
|
1507
1565
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: AsksuiteCitrusModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
1508
1566
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.6", ngImport: i0, type: AsksuiteCitrusModule, declarations: [ButtonComponent,
|
@@ -1523,7 +1581,8 @@ class AsksuiteCitrusModule {
|
|
1523
1581
|
BadgeDirective,
|
1524
1582
|
AutofocusDirective,
|
1525
1583
|
ScrollDirective,
|
1526
|
-
AskTooltipDirective
|
1584
|
+
AskTooltipDirective,
|
1585
|
+
ToastComponent], imports: [CommonModule,
|
1527
1586
|
FormsModule,
|
1528
1587
|
ReactiveFormsModule,
|
1529
1588
|
CdkOverlayOrigin,
|
@@ -1577,7 +1636,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImpor
|
|
1577
1636
|
BadgeDirective,
|
1578
1637
|
AutofocusDirective,
|
1579
1638
|
ScrollDirective,
|
1580
|
-
AskTooltipDirective
|
1639
|
+
AskTooltipDirective,
|
1640
|
+
ToastComponent,
|
1581
1641
|
],
|
1582
1642
|
imports: [
|
1583
1643
|
CommonModule,
|
@@ -1608,11 +1668,72 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImpor
|
|
1608
1668
|
BadgeDirective,
|
1609
1669
|
AutofocusDirective,
|
1610
1670
|
ScrollDirective,
|
1611
|
-
AskTooltipDirective
|
1671
|
+
AskTooltipDirective,
|
1612
1672
|
],
|
1613
1673
|
}]
|
1614
1674
|
}] });
|
1615
1675
|
|
1676
|
+
class ToastService {
|
1677
|
+
constructor(overlay, injector) {
|
1678
|
+
this.overlay = overlay;
|
1679
|
+
this.injector = injector;
|
1680
|
+
this.TOP_MARGIN = 72;
|
1681
|
+
this.GAP = 8;
|
1682
|
+
}
|
1683
|
+
success(message, config) {
|
1684
|
+
this.pop('success', message, config);
|
1685
|
+
}
|
1686
|
+
info(message, config) {
|
1687
|
+
this.pop('info', message, config);
|
1688
|
+
}
|
1689
|
+
danger(message, config) {
|
1690
|
+
this.pop('danger', message, config);
|
1691
|
+
}
|
1692
|
+
warning(message, config) {
|
1693
|
+
this.pop('warning', message, config);
|
1694
|
+
}
|
1695
|
+
pop(type, message, config) {
|
1696
|
+
if (this.lastToast && !this.lastToast?.overlay.overlayElement) {
|
1697
|
+
this.lastToast = undefined;
|
1698
|
+
}
|
1699
|
+
const positionStrategy = this.getPositionStrategy();
|
1700
|
+
const overlayRef = this.overlay.create({
|
1701
|
+
positionStrategy,
|
1702
|
+
});
|
1703
|
+
const toastRef = new ToastRef(overlayRef);
|
1704
|
+
const injector = this.createInjector({ type, message, config }, toastRef);
|
1705
|
+
const toastPortal = new ComponentPortal(ToastComponent, null, injector);
|
1706
|
+
overlayRef.attach(toastPortal);
|
1707
|
+
this.lastToast = toastRef;
|
1708
|
+
}
|
1709
|
+
createInjector(data, toastRef) {
|
1710
|
+
return Injector.create({
|
1711
|
+
parent: this.injector,
|
1712
|
+
providers: [
|
1713
|
+
{ provide: ASK_TOAST_CONFIG, useValue: data },
|
1714
|
+
{ provide: ToastRef, useValue: toastRef },
|
1715
|
+
]
|
1716
|
+
});
|
1717
|
+
}
|
1718
|
+
getPositionStrategy() {
|
1719
|
+
return this.overlay.position().global().top(this.getTopOffset()).centerHorizontally();
|
1720
|
+
}
|
1721
|
+
getTopOffset() {
|
1722
|
+
const offset = this.lastToast ?
|
1723
|
+
this.lastToast.getPosition().bottom + this.GAP :
|
1724
|
+
this.TOP_MARGIN;
|
1725
|
+
return `${offset}px`;
|
1726
|
+
}
|
1727
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: ToastService, deps: [{ token: i1$3.Overlay }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1728
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: ToastService, providedIn: 'root' }); }
|
1729
|
+
}
|
1730
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: ToastService, decorators: [{
|
1731
|
+
type: Injectable,
|
1732
|
+
args: [{
|
1733
|
+
providedIn: 'root'
|
1734
|
+
}]
|
1735
|
+
}], ctorParameters: function () { return [{ type: i1$3.Overlay }, { type: i0.Injector }]; } });
|
1736
|
+
|
1616
1737
|
/*
|
1617
1738
|
* Public API Surface of asksuite-citrus
|
1618
1739
|
*/
|
@@ -1621,5 +1742,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImpor
|
|
1621
1742
|
* Generated bundle index. Do not edit.
|
1622
1743
|
*/
|
1623
1744
|
|
1624
|
-
export { AskDropdownDirective, AskTooltipDirective, AsksuiteCitrusModule, AutocompleteComponent, AutofocusDirective, AvatarComponent, AvatarStatus, BadgeDirective, BoxComponent, ButtonComponent, CheckboxComponent, ChipsComponent, DEFAULT_DATE_FORMAT, DatePickerCalendarComponent, DatePickerComponent, DropdownContainerComponent, InputComponent, PeriodLabel, ScrollDirective, SelectComponent, SkeletonComponent, SpinnerDirective, formatFrom, formatTo };
|
1745
|
+
export { ASK_TOAST_CONFIG, AskDropdownDirective, AskTooltipDirective, AsksuiteCitrusModule, AutocompleteComponent, AutofocusDirective, AvatarComponent, AvatarStatus, BadgeDirective, BoxComponent, ButtonComponent, CheckboxComponent, ChipsComponent, DEFAULT_DATE_FORMAT, DatePickerCalendarComponent, DatePickerComponent, DropdownContainerComponent, InputComponent, PeriodLabel, ScrollDirective, SelectComponent, SkeletonComponent, SpinnerDirective, ToastService, formatFrom, formatTo };
|
1625
1746
|
//# sourceMappingURL=asksuite-citrus.mjs.map
|