monkey-style-guide-v2 0.0.116 → 0.0.117
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.
|
@@ -2,17 +2,17 @@ import { trigger, state, transition, style, animate, keyframes } from '@angular/
|
|
|
2
2
|
import * as i1 from '@angular/common';
|
|
3
3
|
import { CommonModule, NgTemplateOutlet, CurrencyPipe } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { Injectable, input, Component, TemplateRef, inject, booleanAttribute, Input, HostBinding, ViewEncapsulation, output, Directive, InjectionToken, EventEmitter, Output, ViewContainerRef, ElementRef, NgZone,
|
|
5
|
+
import { Injectable, input, Component, TemplateRef, inject, booleanAttribute, Input, HostBinding, ViewEncapsulation, output, Directive, InjectionToken, LOCALE_ID, DestroyRef, signal, computed, effect, EventEmitter, Output, ViewContainerRef, ElementRef, NgZone, Optional, Inject, HostListener, NgModule, ChangeDetectorRef, DEFAULT_CURRENCY_CODE, ContentChildren, ContentChild, ViewChild, Injector, forwardRef, ChangeDetectionStrategy, ViewChildren, DOCUMENT } from '@angular/core';
|
|
6
6
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
7
|
import * as i3 from '@angular/forms';
|
|
8
8
|
import { Validators, NgControl, FormsModule, ReactiveFormsModule, FormControlDirective, NgModel, FormControlName, FormGroupDirective, NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
9
|
-
import {
|
|
9
|
+
import { of, map, BehaviorSubject, firstValueFrom, filter, merge, Subject, debounceTime, distinctUntilChanged, switchMap, catchError, Subscription } from 'rxjs';
|
|
10
|
+
import { HttpClient } from '@angular/common/http';
|
|
10
11
|
import * as i1$1 from '@angular/cdk/overlay';
|
|
11
12
|
import { Overlay, OverlayPositionBuilder, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
|
|
12
13
|
import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
|
|
13
14
|
import * as i1$2 from '@angular/router';
|
|
14
15
|
import { Router, NavigationStart, NavigationEnd } from '@angular/router';
|
|
15
|
-
import { HttpClient } from '@angular/common/http';
|
|
16
16
|
import { format, parseISO, addYears, subYears, subMonths, addMonths, getMonth, getYear, startOfWeek, startOfMonth, endOfWeek, endOfMonth, isSameMonth, isBefore, isAfter, isToday, addDays, isWithinInterval, subDays } from 'date-fns';
|
|
17
17
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
18
18
|
import { getSupportedInputTypes } from '@angular/cdk/platform';
|
|
@@ -920,91 +920,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
920
920
|
type: Input
|
|
921
921
|
}] } });
|
|
922
922
|
|
|
923
|
-
/** ************************
|
|
924
|
-
* Copyright Monkey Exchange. All Rights Reserved
|
|
925
|
-
* This style guide was developed by Monkey Exchange Team
|
|
926
|
-
* MIT Licence
|
|
927
|
-
************************* */
|
|
928
|
-
class MonkeyDisplayDirective {
|
|
929
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyDisplayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
930
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.14", type: MonkeyDisplayDirective, isStandalone: false, selector: "monkey-display", ngImport: i0 }); }
|
|
931
|
-
}
|
|
932
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyDisplayDirective, decorators: [{
|
|
933
|
-
type: Directive,
|
|
934
|
-
args: [{
|
|
935
|
-
selector: 'monkey-display',
|
|
936
|
-
standalone: false
|
|
937
|
-
}]
|
|
938
|
-
}] });
|
|
939
|
-
|
|
940
|
-
/** ************************
|
|
941
|
-
* Copyright Monkey Exchange. All Rights Reserved
|
|
942
|
-
* This style guide was developed by Monkey Exchange Team
|
|
943
|
-
* MIT Licence
|
|
944
|
-
************************* */
|
|
945
|
-
class MonkeyErrorDirective {
|
|
946
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyErrorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
947
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.14", type: MonkeyErrorDirective, isStandalone: false, selector: "monkey-error", ngImport: i0 }); }
|
|
948
|
-
}
|
|
949
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyErrorDirective, decorators: [{
|
|
950
|
-
type: Directive,
|
|
951
|
-
args: [{
|
|
952
|
-
selector: 'monkey-error',
|
|
953
|
-
standalone: false
|
|
954
|
-
}]
|
|
955
|
-
}] });
|
|
956
|
-
|
|
957
|
-
/** ************************
|
|
958
|
-
* Copyright Monkey Exchange. All Rights Reserved
|
|
959
|
-
* This style guide was developed by Monkey Exchange Team
|
|
960
|
-
* MIT Licence
|
|
961
|
-
************************* */
|
|
962
|
-
class MonkeyHelperDirective {
|
|
963
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyHelperDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
964
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.14", type: MonkeyHelperDirective, isStandalone: false, selector: "monkey-helper", ngImport: i0 }); }
|
|
965
|
-
}
|
|
966
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyHelperDirective, decorators: [{
|
|
967
|
-
type: Directive,
|
|
968
|
-
args: [{
|
|
969
|
-
selector: 'monkey-helper',
|
|
970
|
-
standalone: false
|
|
971
|
-
}]
|
|
972
|
-
}] });
|
|
973
|
-
|
|
974
|
-
/** ************************
|
|
975
|
-
* Copyright Monkey Exchange. All Rights Reserved
|
|
976
|
-
* This style guide was developed by Monkey Exchange Team
|
|
977
|
-
* MIT Licence
|
|
978
|
-
************************* */
|
|
979
|
-
class MonkeyInfoDirective {
|
|
980
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyInfoDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
981
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.14", type: MonkeyInfoDirective, isStandalone: false, selector: "monkey-info", ngImport: i0 }); }
|
|
982
|
-
}
|
|
983
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyInfoDirective, decorators: [{
|
|
984
|
-
type: Directive,
|
|
985
|
-
args: [{
|
|
986
|
-
selector: 'monkey-info',
|
|
987
|
-
standalone: false
|
|
988
|
-
}]
|
|
989
|
-
}] });
|
|
990
|
-
|
|
991
|
-
/** ************************
|
|
992
|
-
* Copyright Monkey Exchange. All Rights Reserved
|
|
993
|
-
* This style guide was developed by Monkey Exchange Team
|
|
994
|
-
* MIT Licence
|
|
995
|
-
************************* */
|
|
996
|
-
class MonkeyLabelDirective {
|
|
997
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
998
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.14", type: MonkeyLabelDirective, isStandalone: false, selector: "monkey-label", ngImport: i0 }); }
|
|
999
|
-
}
|
|
1000
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyLabelDirective, decorators: [{
|
|
1001
|
-
type: Directive,
|
|
1002
|
-
args: [{
|
|
1003
|
-
selector: 'monkey-label',
|
|
1004
|
-
standalone: false
|
|
1005
|
-
}]
|
|
1006
|
-
}] });
|
|
1007
|
-
|
|
1008
923
|
/** ************************
|
|
1009
924
|
* Copyright Monkey Exchange. All Rights Reserved
|
|
1010
925
|
* This style guide was developed by Monkey Exchange Team
|
|
@@ -1023,404 +938,467 @@ function injectTokenWithWarning(token, name) {
|
|
|
1023
938
|
return value;
|
|
1024
939
|
}
|
|
1025
940
|
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
************************* */
|
|
1031
|
-
class MonkeyPopoverContentComponent {
|
|
1032
|
-
constructor(host) {
|
|
1033
|
-
this.host = host;
|
|
1034
|
-
this.onClose = new EventEmitter();
|
|
1035
|
-
this.enableAutofocus = false;
|
|
1036
|
-
// not to do
|
|
941
|
+
class MonkeyEcxAddressService {
|
|
942
|
+
constructor() {
|
|
943
|
+
this._http = inject(HttpClient);
|
|
944
|
+
this._googleApiKey = injectTokenWithWarning(MECX_GOOGLE_API_KEY, 'MECX_GOOGLE_API_KEY');
|
|
1037
945
|
}
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
focusable?.focus();
|
|
946
|
+
mappingData(places) {
|
|
947
|
+
const getComponent = (components, type, field = 'longText') => {
|
|
948
|
+
const result = components.find((c) => {
|
|
949
|
+
return c.types.includes(type);
|
|
1043
950
|
});
|
|
1044
|
-
|
|
951
|
+
return result?.[field] || '';
|
|
952
|
+
};
|
|
953
|
+
return places.map((_) => {
|
|
954
|
+
const { addressComponents } = _;
|
|
955
|
+
const address = getComponent(addressComponents, 'route');
|
|
956
|
+
const addressNumber = getComponent(addressComponents, 'street_number');
|
|
957
|
+
const neighborhood = getComponent(addressComponents, 'sublocality_level_1');
|
|
958
|
+
const city = getComponent(addressComponents, 'administrative_area_level_2');
|
|
959
|
+
const state = getComponent(addressComponents, 'administrative_area_level_1');
|
|
960
|
+
const country = getComponent(addressComponents, 'country', 'shortText');
|
|
961
|
+
const zipCode = getComponent(addressComponents, 'postal_code');
|
|
962
|
+
return {
|
|
963
|
+
formattedAddress: _.formattedAddress,
|
|
964
|
+
adrFormatAddress: _.adrFormatAddress,
|
|
965
|
+
address,
|
|
966
|
+
addressNumber,
|
|
967
|
+
neighborhood,
|
|
968
|
+
city,
|
|
969
|
+
state,
|
|
970
|
+
country,
|
|
971
|
+
zipCode
|
|
972
|
+
};
|
|
973
|
+
});
|
|
1045
974
|
}
|
|
1046
|
-
|
|
1047
|
-
|
|
975
|
+
get(textQuery) {
|
|
976
|
+
if (!textQuery) {
|
|
977
|
+
return of([]);
|
|
978
|
+
}
|
|
979
|
+
return this._http
|
|
980
|
+
.post('https://places.googleapis.com/v1/places:searchText', {
|
|
981
|
+
textQuery
|
|
982
|
+
}, {
|
|
983
|
+
headers: {
|
|
984
|
+
'X-Goog-Api-Key': this._googleApiKey,
|
|
985
|
+
'X-Goog-FieldMask': 'places.formattedAddress,places.addressComponents,places.displayName,places.adrFormatAddress'
|
|
986
|
+
}
|
|
987
|
+
})
|
|
988
|
+
.pipe(map((resp) => {
|
|
989
|
+
return this.mappingData(resp.places);
|
|
990
|
+
}));
|
|
1048
991
|
}
|
|
1049
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type:
|
|
1050
|
-
static { this.ɵ
|
|
1051
|
-
<div class="mecx-popover-container">
|
|
1052
|
-
@if (!hideHeader) {
|
|
1053
|
-
<div class="mecx-popover-header">
|
|
1054
|
-
@if (title) {
|
|
1055
|
-
<div>
|
|
1056
|
-
<ng-container *ngIf="isTemplate(title); else stringTitle">
|
|
1057
|
-
<ng-container *ngTemplateOutlet="title"></ng-container>
|
|
1058
|
-
</ng-container>
|
|
1059
|
-
<ng-template #stringTitle>
|
|
1060
|
-
{{ title }}
|
|
1061
|
-
</ng-template>
|
|
1062
|
-
</div>
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
@if (!hideClose) {
|
|
1066
|
-
<util-icon class="mecx-popover-close" name="clear" (click)="onClose.next(null)" />
|
|
1067
|
-
}
|
|
1068
|
-
</div>
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
<div class="mecx-popover-content" [class.add-radius]="hideHeader">
|
|
1072
|
-
<ng-container *ngTemplateOutlet="content"></ng-container>
|
|
1073
|
-
</div>
|
|
1074
|
-
|
|
1075
|
-
@if (!hideActions) {
|
|
1076
|
-
<div class="mecx-popover-actions" *ngIf="actions">
|
|
1077
|
-
<ng-container *ngIf="isTemplate(actions); else stringActions">
|
|
1078
|
-
<ng-container *ngTemplateOutlet="actions"></ng-container>
|
|
1079
|
-
</ng-container>
|
|
1080
|
-
<ng-template #stringActions>
|
|
1081
|
-
<span>{{ actions }}</span>
|
|
1082
|
-
</ng-template>
|
|
1083
|
-
</div>
|
|
1084
|
-
}
|
|
1085
|
-
</div>
|
|
1086
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: UtilIconComponent, selector: "util-icon", inputs: ["name"] }] }); }
|
|
992
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyEcxAddressService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
993
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyEcxAddressService, providedIn: 'root' }); }
|
|
1087
994
|
}
|
|
1088
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type:
|
|
1089
|
-
type:
|
|
1090
|
-
args: [{
|
|
1091
|
-
|
|
1092
|
-
imports: [CommonModule, NgTemplateOutlet, UtilIconComponent],
|
|
1093
|
-
template: `
|
|
1094
|
-
<div class="mecx-popover-container">
|
|
1095
|
-
@if (!hideHeader) {
|
|
1096
|
-
<div class="mecx-popover-header">
|
|
1097
|
-
@if (title) {
|
|
1098
|
-
<div>
|
|
1099
|
-
<ng-container *ngIf="isTemplate(title); else stringTitle">
|
|
1100
|
-
<ng-container *ngTemplateOutlet="title"></ng-container>
|
|
1101
|
-
</ng-container>
|
|
1102
|
-
<ng-template #stringTitle>
|
|
1103
|
-
{{ title }}
|
|
1104
|
-
</ng-template>
|
|
1105
|
-
</div>
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
@if (!hideClose) {
|
|
1109
|
-
<util-icon class="mecx-popover-close" name="clear" (click)="onClose.next(null)" />
|
|
1110
|
-
}
|
|
1111
|
-
</div>
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
<div class="mecx-popover-content" [class.add-radius]="hideHeader">
|
|
1115
|
-
<ng-container *ngTemplateOutlet="content"></ng-container>
|
|
1116
|
-
</div>
|
|
995
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyEcxAddressService, decorators: [{
|
|
996
|
+
type: Injectable,
|
|
997
|
+
args: [{ providedIn: 'root' }]
|
|
998
|
+
}] });
|
|
1117
999
|
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1000
|
+
/* eslint-disable no-console */
|
|
1001
|
+
/** ************************
|
|
1002
|
+
* Copyright Monkey Exchange. All Rights Reserved
|
|
1003
|
+
* This style guide was developed by Monkey Exchange Team
|
|
1004
|
+
* MIT Licence
|
|
1005
|
+
************************* */
|
|
1006
|
+
class MonkeyDictionaryService {
|
|
1007
|
+
constructor() {
|
|
1008
|
+
this._localeId = inject(LOCALE_ID);
|
|
1009
|
+
this._destroyRef = inject(DestroyRef);
|
|
1010
|
+
this._data$ = new BehaviorSubject({
|
|
1011
|
+
'pt-BR': {
|
|
1012
|
+
EDIT: 'Editar',
|
|
1013
|
+
'NO-RESULTS': 'Nenhum resultado encontrado',
|
|
1014
|
+
'NO-DATA': 'Sem dados',
|
|
1015
|
+
'NO-DATA-ADDRESS': 'Nenhum endereço encontrado com esta pesquisa',
|
|
1016
|
+
'NOT-PROVIDED': 'Não informado',
|
|
1017
|
+
LOADING: 'Carregando...',
|
|
1018
|
+
'DATE-RANGE': {
|
|
1019
|
+
'START-DATE': 'Data de início',
|
|
1020
|
+
'END-DATE': 'Data de término',
|
|
1021
|
+
INVALID: 'Intervalo de datas inválido',
|
|
1022
|
+
ACTIONS: {
|
|
1023
|
+
CANCEL: 'Cancelar',
|
|
1024
|
+
APPLY: 'Aplicar'
|
|
1025
|
+
},
|
|
1026
|
+
'WEEK-DAYS': ['Dom.', '2ª', '3ª', '4ª', '5ª', '6ª', 'Sab.'],
|
|
1027
|
+
MONTHS: {
|
|
1028
|
+
0: 'Janeiro',
|
|
1029
|
+
1: 'Fevereiro',
|
|
1030
|
+
2: 'Março',
|
|
1031
|
+
3: 'Abril',
|
|
1032
|
+
4: 'Maio',
|
|
1033
|
+
5: 'Junho',
|
|
1034
|
+
6: 'Julho',
|
|
1035
|
+
7: 'Agosto',
|
|
1036
|
+
8: 'Setembro',
|
|
1037
|
+
9: 'Outubro',
|
|
1038
|
+
10: 'Novembro',
|
|
1039
|
+
11: 'Dezembro'
|
|
1040
|
+
},
|
|
1041
|
+
'QUICK-ACTIONS': {
|
|
1042
|
+
CUSTOM: 'Customizado',
|
|
1043
|
+
LAST_30_DAYS: 'Ultimos 30 dias',
|
|
1044
|
+
LAST_60_DAYS: 'Ultimos 60 dias',
|
|
1045
|
+
LAST_90_DAYS: 'Ultimos 90 dias',
|
|
1046
|
+
LAST_6_MONTHS: 'Ultimos 6 meses',
|
|
1047
|
+
LAST_12_MONTHS: 'Ultimos 12 meses',
|
|
1048
|
+
NEXT_30_DAYS: 'Próximos 30 dias',
|
|
1049
|
+
NEXT_60_DAYS: 'Próximos 60 dias',
|
|
1050
|
+
NEXT_90_DAYS: 'Próximos 90 dias',
|
|
1051
|
+
NEXT_6_MONTHS: 'Próximos 6 meses',
|
|
1052
|
+
NEXT_12_MONTHS: 'Próximos 12 meses'
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
},
|
|
1056
|
+
'es-CL': {
|
|
1057
|
+
EDIT: 'Editar',
|
|
1058
|
+
'NO-RESULTS': 'No se encontraron resultados',
|
|
1059
|
+
'NO-DATA': 'Sin datos',
|
|
1060
|
+
'NO-DATA-ADDRESS': 'No se encontraron direcciones con esta búsqueda',
|
|
1061
|
+
'NOT-PROVIDED': 'No informado',
|
|
1062
|
+
LOADING: 'Cargando...',
|
|
1063
|
+
'DATE-RANGE': {
|
|
1064
|
+
'START-DATE': 'Fecha de inicio',
|
|
1065
|
+
'END-DATE': 'Fecha de termino',
|
|
1066
|
+
INVALID: 'Rango de fechas no válido',
|
|
1067
|
+
ACTIONS: {
|
|
1068
|
+
CANCEL: 'Cancelar',
|
|
1069
|
+
APPLY: 'Aplicar'
|
|
1070
|
+
},
|
|
1071
|
+
'WEEK-DAYS': ['Dom.', 'Lun.', 'Mar.', 'Mié.', 'Jue.', 'Vie.', 'Sab.'],
|
|
1072
|
+
MONTHS: {
|
|
1073
|
+
0: 'Enero',
|
|
1074
|
+
1: 'Febrero',
|
|
1075
|
+
2: 'Marzo',
|
|
1076
|
+
3: 'Abril',
|
|
1077
|
+
4: 'Mayo',
|
|
1078
|
+
5: 'Junio',
|
|
1079
|
+
6: 'Julio',
|
|
1080
|
+
7: 'Agosto',
|
|
1081
|
+
8: 'Septiembre',
|
|
1082
|
+
9: 'Octubre',
|
|
1083
|
+
10: 'Noviembre',
|
|
1084
|
+
11: 'Diciembre'
|
|
1085
|
+
},
|
|
1086
|
+
'QUICK-ACTIONS': {
|
|
1087
|
+
CUSTOM: 'Personalizado',
|
|
1088
|
+
LAST_30_DAYS: 'Últimos 30 días',
|
|
1089
|
+
LAST_60_DAYS: 'Últimos 60 días',
|
|
1090
|
+
LAST_90_DAYS: 'Últimos 90 días',
|
|
1091
|
+
LAST_6_MONTHS: 'Últimos 6 meses',
|
|
1092
|
+
LAST_12_MONTHS: 'Últimos 12 meses',
|
|
1093
|
+
NEXT_30_DAYS: 'Próximos 30 días',
|
|
1094
|
+
NEXT_60_DAYS: 'Próximos 60 días',
|
|
1095
|
+
NEXT_90_DAYS: 'Próximos 90 días',
|
|
1096
|
+
NEXT_6_MONTHS: 'Próximos 6 meses',
|
|
1097
|
+
NEXT_12_MONTHS: 'Próximos 12 meses'
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
},
|
|
1101
|
+
'es-MX': {
|
|
1102
|
+
EDIT: 'Editar',
|
|
1103
|
+
'NO-RESULTS': 'No se encontraron resultados',
|
|
1104
|
+
'NO-DATA': 'Sin datos',
|
|
1105
|
+
'NO-DATA-ADDRESS': 'No se encontraron direcciones con esta búsqueda',
|
|
1106
|
+
'NOT-PROVIDED': 'No informado',
|
|
1107
|
+
LOADING: 'Cargando...',
|
|
1108
|
+
'DATE-RANGE': {
|
|
1109
|
+
'START-DATE': 'Fecha de inicio',
|
|
1110
|
+
'END-DATE': 'Fecha de termino',
|
|
1111
|
+
INVALID: 'Rango de fechas no válido',
|
|
1112
|
+
ACTIONS: {
|
|
1113
|
+
CANCEL: 'Cancelar',
|
|
1114
|
+
APPLY: 'Aplicar'
|
|
1115
|
+
},
|
|
1116
|
+
'WEEK-DAYS': ['Dom.', 'Lun.', 'Mar.', 'Mié.', 'Jue.', 'Vie.', 'Sab.'],
|
|
1117
|
+
MONTHS: {
|
|
1118
|
+
0: 'Enero',
|
|
1119
|
+
1: 'Febrero',
|
|
1120
|
+
2: 'Marzo',
|
|
1121
|
+
3: 'Abril',
|
|
1122
|
+
4: 'Mayo',
|
|
1123
|
+
5: 'Junio',
|
|
1124
|
+
6: 'Julio',
|
|
1125
|
+
7: 'Agosto',
|
|
1126
|
+
8: 'Septiembre',
|
|
1127
|
+
9: 'Octubre',
|
|
1128
|
+
10: 'Noviembre',
|
|
1129
|
+
11: 'Diciembre'
|
|
1130
|
+
},
|
|
1131
|
+
'QUICK-ACTIONS': {
|
|
1132
|
+
CUSTOM: 'Personalizado',
|
|
1133
|
+
LAST_30_DAYS: 'Últimos 30 días',
|
|
1134
|
+
LAST_60_DAYS: 'Últimos 60 días',
|
|
1135
|
+
LAST_90_DAYS: 'Últimos 90 días',
|
|
1136
|
+
LAST_6_MONTHS: 'Últimos 6 meses',
|
|
1137
|
+
LAST_12_MONTHS: 'Últimos 12 meses',
|
|
1138
|
+
NEXT_30_DAYS: 'Próximos 30 días',
|
|
1139
|
+
NEXT_60_DAYS: 'Próximos 60 días',
|
|
1140
|
+
NEXT_90_DAYS: 'Próximos 90 días',
|
|
1141
|
+
NEXT_6_MONTHS: 'Próximos 6 meses',
|
|
1142
|
+
NEXT_12_MONTHS: 'Próximos 12 meses'
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
},
|
|
1146
|
+
'en-US': {
|
|
1147
|
+
EDIT: 'Edit',
|
|
1148
|
+
'NO-RESULTS': 'No results found',
|
|
1149
|
+
'NO-DATA': 'No data',
|
|
1150
|
+
'NO-DATA-ADDRESS': 'No address found with this search',
|
|
1151
|
+
'NOT-PROVIDED': 'Not provided',
|
|
1152
|
+
LOADING: 'Loading...',
|
|
1153
|
+
'DATE-RANGE': {
|
|
1154
|
+
'START-DATE': 'Start date',
|
|
1155
|
+
'END-DATE': 'End Date',
|
|
1156
|
+
INVALID: 'Invalid date range',
|
|
1157
|
+
ACTIONS: {
|
|
1158
|
+
CANCEL: 'Cancel',
|
|
1159
|
+
APPLY: 'Apply'
|
|
1160
|
+
},
|
|
1161
|
+
'WEEK-DAYS': ['Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.'],
|
|
1162
|
+
MONTHS: {
|
|
1163
|
+
0: 'January',
|
|
1164
|
+
1: 'February',
|
|
1165
|
+
2: 'March',
|
|
1166
|
+
3: 'April',
|
|
1167
|
+
4: 'May',
|
|
1168
|
+
5: 'June',
|
|
1169
|
+
6: 'July',
|
|
1170
|
+
7: 'August',
|
|
1171
|
+
8: 'September',
|
|
1172
|
+
9: 'October',
|
|
1173
|
+
10: 'November',
|
|
1174
|
+
11: 'December'
|
|
1175
|
+
},
|
|
1176
|
+
'QUICK-ACTIONS': {
|
|
1177
|
+
CUSTOM: 'Custom',
|
|
1178
|
+
LAST_30_DAYS: 'Last 30 days',
|
|
1179
|
+
LAST_60_DAYS: 'Last 60 days',
|
|
1180
|
+
LAST_90_DAYS: 'Last 90 days',
|
|
1181
|
+
LAST_6_MONTHS: 'Last 6 months',
|
|
1182
|
+
LAST_12_MONTHS: 'Last 12 months',
|
|
1183
|
+
NEXT_30_DAYS: 'Next 30 days',
|
|
1184
|
+
NEXT_60_DAYS: 'Next 60 days',
|
|
1185
|
+
NEXT_90_DAYS: 'Next 90 days',
|
|
1186
|
+
NEXT_6_MONTHS: 'Next 6 months',
|
|
1187
|
+
NEXT_12_MONTHS: 'Next 12 months'
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
});
|
|
1192
|
+
const tokenSubject = inject(MECX_I18N_WRAPPER, { optional: true });
|
|
1193
|
+
tokenSubject?.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((value) => {
|
|
1194
|
+
this.handleWrapperValues(value);
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1197
|
+
handleWrapperValues(value) {
|
|
1198
|
+
try {
|
|
1199
|
+
const locale = this._localeId || 'pt-BR';
|
|
1200
|
+
const wrappedData = JSON.parse(value);
|
|
1201
|
+
const currentData = this._data$.value;
|
|
1202
|
+
const updated = {
|
|
1203
|
+
...currentData,
|
|
1204
|
+
[locale]: {
|
|
1205
|
+
...currentData[locale],
|
|
1206
|
+
...wrappedData
|
|
1207
|
+
}
|
|
1208
|
+
};
|
|
1209
|
+
this._data$.next(updated);
|
|
1161
1210
|
}
|
|
1162
|
-
|
|
1163
|
-
|
|
1211
|
+
catch (e) {
|
|
1212
|
+
// eslint-disable-next-line no-console
|
|
1213
|
+
console.error(`MonkeyDictionaryService - handleWrapperValues -> ${e}`);
|
|
1164
1214
|
}
|
|
1165
1215
|
}
|
|
1166
|
-
get
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
}
|
|
1172
|
-
get target() {
|
|
1173
|
-
return this._target;
|
|
1216
|
+
get(key) {
|
|
1217
|
+
const locale = this._localeId || 'pt-BR';
|
|
1218
|
+
return this._data$.pipe(map((data) => {
|
|
1219
|
+
return data[locale]?.[key] ?? null;
|
|
1220
|
+
}));
|
|
1174
1221
|
}
|
|
1222
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyDictionaryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1223
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyDictionaryService, providedIn: 'root' }); }
|
|
1224
|
+
}
|
|
1225
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyDictionaryService, decorators: [{
|
|
1226
|
+
type: Injectable,
|
|
1227
|
+
args: [{
|
|
1228
|
+
providedIn: 'root'
|
|
1229
|
+
}]
|
|
1230
|
+
}], ctorParameters: () => [] });
|
|
1231
|
+
|
|
1232
|
+
/** ************************
|
|
1233
|
+
* Copyright Monkey Exchange. All Rights Reserved
|
|
1234
|
+
* This style guide was developed by Monkey Exchange Team
|
|
1235
|
+
* MIT Licence
|
|
1236
|
+
************************* */
|
|
1237
|
+
class MonkeyStepperService {
|
|
1175
1238
|
constructor() {
|
|
1176
|
-
this.
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
this._overlayPositionBuilder = inject(OverlayPositionBuilder);
|
|
1182
|
-
this._router = inject(Router);
|
|
1183
|
-
this._destroyRef = inject(DestroyRef);
|
|
1184
|
-
this._show = false;
|
|
1185
|
-
this.minwidth = false;
|
|
1186
|
-
this.backdrop = true;
|
|
1187
|
-
this.watch = false;
|
|
1188
|
-
this.dir = 'ltr';
|
|
1189
|
-
this.contextmenu = false;
|
|
1190
|
-
this._router.events
|
|
1191
|
-
.pipe(filter((event) => {
|
|
1192
|
-
return event instanceof NavigationStart;
|
|
1193
|
-
}), takeUntilDestroyed(this._destroyRef))
|
|
1194
|
-
.subscribe(() => {
|
|
1195
|
-
this.closePopover();
|
|
1239
|
+
this._steppers = signal(new Map(), ...(ngDevMode ? [{ debugName: "_steppers" }] : []));
|
|
1240
|
+
}
|
|
1241
|
+
currentStep(id) {
|
|
1242
|
+
return computed(() => {
|
|
1243
|
+
return this._steppers().get(id);
|
|
1196
1244
|
});
|
|
1197
1245
|
}
|
|
1198
|
-
|
|
1199
|
-
this.
|
|
1200
|
-
|
|
1246
|
+
setCurrentStep(id, step) {
|
|
1247
|
+
this._steppers.update((items) => {
|
|
1248
|
+
return new Map(items).set(id, step);
|
|
1249
|
+
});
|
|
1201
1250
|
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1251
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyStepperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1252
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyStepperService, providedIn: 'root' }); }
|
|
1253
|
+
}
|
|
1254
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyStepperService, decorators: [{
|
|
1255
|
+
type: Injectable,
|
|
1256
|
+
args: [{
|
|
1257
|
+
providedIn: 'root'
|
|
1258
|
+
}]
|
|
1259
|
+
}] });
|
|
1260
|
+
|
|
1261
|
+
class MonkeyToastRef {
|
|
1262
|
+
constructor(componentRef) {
|
|
1263
|
+
this.componentRef = componentRef;
|
|
1264
|
+
// not to do
|
|
1210
1265
|
}
|
|
1211
|
-
|
|
1212
|
-
this.
|
|
1213
|
-
this._resizeObserver = undefined;
|
|
1214
|
-
if (this._overlayRef) {
|
|
1215
|
-
this._overlayRef.dispose();
|
|
1216
|
-
this._overlayRef = undefined;
|
|
1217
|
-
}
|
|
1266
|
+
close() {
|
|
1267
|
+
this.componentRef.instance.close();
|
|
1218
1268
|
}
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
originY: axis,
|
|
1250
|
-
overlayX: 'start',
|
|
1251
|
-
overlayY: oppositeVertical[axis]
|
|
1252
|
-
};
|
|
1253
|
-
};
|
|
1254
|
-
const rtl = (axis) => {
|
|
1255
|
-
return {
|
|
1256
|
-
originX: 'end',
|
|
1257
|
-
originY: axis,
|
|
1258
|
-
overlayX: 'end',
|
|
1259
|
-
overlayY: oppositeVertical[axis]
|
|
1260
|
-
};
|
|
1261
|
-
};
|
|
1262
|
-
const side = (axisX, axisY) => {
|
|
1263
|
-
return {
|
|
1264
|
-
originX: axisX,
|
|
1265
|
-
originY: axisY,
|
|
1266
|
-
overlayX: oppositeHorizontal[axisX],
|
|
1267
|
-
overlayY: axisY
|
|
1268
|
-
};
|
|
1269
|
-
};
|
|
1270
|
-
const cmp = dir ?? this._options?.dir ?? this.dir;
|
|
1271
|
-
switch (cmp) {
|
|
1272
|
-
case 'ct':
|
|
1273
|
-
return [centerY('top'), centerY('bottom'), centerX('start'), centerX('end')];
|
|
1274
|
-
case 'cr':
|
|
1275
|
-
return [centerX('end'), centerX('start'), centerY('top'), centerY('bottom')];
|
|
1276
|
-
case 'cc':
|
|
1277
|
-
return [centerX('center')];
|
|
1278
|
-
case 'ltr':
|
|
1279
|
-
return [ltr('bottom'), ltr('top')];
|
|
1280
|
-
case 'rtl':
|
|
1281
|
-
return [rtl('bottom'), rtl('top')];
|
|
1282
|
-
case 'tltr':
|
|
1283
|
-
return [ltr('top'), ltr('bottom')];
|
|
1284
|
-
case 'trtl':
|
|
1285
|
-
return [rtl('top'), rtl('bottom')];
|
|
1286
|
-
case 'rt':
|
|
1287
|
-
return [side('end', 'top'), side('end', 'bottom'), ltr('top')];
|
|
1288
|
-
case 'rb':
|
|
1289
|
-
return [side('end', 'bottom'), side('end', 'top'), ltr('bottom'), rtl('bottom')];
|
|
1290
|
-
case 'lt':
|
|
1291
|
-
return [side('start', 'top'), side('start', 'bottom'), rtl('top')];
|
|
1292
|
-
case 'lb':
|
|
1293
|
-
return [side('start', 'bottom'), side('start', 'top'), rtl('bottom')];
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
/** ************************
|
|
1272
|
+
* Copyright Monkey Exchange. All Rights Reserved
|
|
1273
|
+
* This style guide was developed by Monkey Exchange Team
|
|
1274
|
+
* MIT Licence
|
|
1275
|
+
************************* */
|
|
1276
|
+
|
|
1277
|
+
/** ************************
|
|
1278
|
+
* Copyright Monkey Exchange. All Rights Reserved
|
|
1279
|
+
* This style guide was developed by Monkey Exchange Team
|
|
1280
|
+
* MIT Licence
|
|
1281
|
+
************************* */
|
|
1282
|
+
class MonkeyToastService {
|
|
1283
|
+
constructor() {
|
|
1284
|
+
this.overlay = inject(Overlay);
|
|
1285
|
+
}
|
|
1286
|
+
getPositionStrategy(position) {
|
|
1287
|
+
const globalPosition = this.overlay.position().global();
|
|
1288
|
+
switch (position) {
|
|
1289
|
+
case 'top-left':
|
|
1290
|
+
return globalPosition.top('40px').start('40px');
|
|
1291
|
+
case 'top-center':
|
|
1292
|
+
return globalPosition.top('40px').centerHorizontally();
|
|
1293
|
+
case 'top-right':
|
|
1294
|
+
return globalPosition.top('40px').end('40px');
|
|
1295
|
+
case 'bottom-left':
|
|
1296
|
+
return globalPosition.bottom('40px').start('40px');
|
|
1297
|
+
case 'bottom-center':
|
|
1298
|
+
return globalPosition.bottom('40px').centerHorizontally();
|
|
1294
1299
|
default:
|
|
1295
|
-
return
|
|
1300
|
+
return globalPosition.bottom('40px').end('40px');
|
|
1296
1301
|
}
|
|
1297
1302
|
}
|
|
1298
|
-
|
|
1299
|
-
if (
|
|
1300
|
-
|
|
1301
|
-
console.error('MonkeyPopoverDirective -> target element is not defined.');
|
|
1302
|
-
return;
|
|
1303
|
+
show(toastConfig) {
|
|
1304
|
+
if (this.lastToast) {
|
|
1305
|
+
this.lastToast.close();
|
|
1303
1306
|
}
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1306
|
-
.
|
|
1307
|
-
.withPush(true)
|
|
1308
|
-
.withGrowAfterOpen(true)
|
|
1309
|
-
.withPositions(this.getPositions(options?.dir));
|
|
1310
|
-
this._overlayRef = this._overlay.create({
|
|
1311
|
-
positionStrategy: this._positionStrategy,
|
|
1312
|
-
disposeOnNavigation: true,
|
|
1313
|
-
direction: 'ltr',
|
|
1314
|
-
hasBackdrop: this.backdrop,
|
|
1315
|
-
scrollStrategy: this._overlay.scrollStrategies.reposition(),
|
|
1316
|
-
backdropClass: 'cdk-overlay-transparent-backdrop',
|
|
1317
|
-
width: this._options?.minwidth || this.minwidth ? this.target.offsetWidth - 2 : undefined,
|
|
1318
|
-
maxHeight: '95%',
|
|
1319
|
-
height: this.height
|
|
1307
|
+
const overlayRef = this.overlay.create({
|
|
1308
|
+
hasBackdrop: false,
|
|
1309
|
+
positionStrategy: this.getPositionStrategy(toastConfig.position)
|
|
1320
1310
|
});
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1311
|
+
const portal = new ComponentPortal(MonkeyToastComponent);
|
|
1312
|
+
const componentRef = overlayRef.attach(portal);
|
|
1313
|
+
this.lastToast = new MonkeyToastRef(componentRef);
|
|
1314
|
+
componentRef.instance.id = getRandomString(6);
|
|
1315
|
+
componentRef.instance.type = toastConfig.type ?? 'default';
|
|
1316
|
+
componentRef.instance.icon = toastConfig.icon;
|
|
1317
|
+
componentRef.instance.isClosable = toastConfig.isClosable ?? false;
|
|
1318
|
+
componentRef.instance.message = toastConfig.message;
|
|
1319
|
+
componentRef.instance.actionLabel = toastConfig.actionLabel;
|
|
1320
|
+
componentRef.instance.actionIcon = toastConfig.actionIcon;
|
|
1321
|
+
componentRef.instance.onActionClick.subscribe(() => {
|
|
1322
|
+
if (toastConfig.action) {
|
|
1323
|
+
toastConfig.action();
|
|
1324
|
+
if (toastConfig.closeOnAction ?? true) {
|
|
1325
|
+
componentRef.instance.close();
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1326
1328
|
});
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
this._componentRef.instance.hideActions = this.hideActions;
|
|
1335
|
-
this._componentRef.instance.enableAutofocus = this.enableAutofocus;
|
|
1336
|
-
if (!this.hideClose || !this.hideHeader) {
|
|
1337
|
-
this._componentRef.instance.onClose
|
|
1338
|
-
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
1339
|
-
.subscribe(() => {
|
|
1340
|
-
this.closePopover();
|
|
1341
|
-
});
|
|
1342
|
-
}
|
|
1343
|
-
if (this.watch && 'ResizeObserver' in window) {
|
|
1344
|
-
this._resizeObserver = new ResizeObserver(() => {
|
|
1345
|
-
this._overlayRef?.updatePosition();
|
|
1346
|
-
});
|
|
1347
|
-
this._resizeObserver.observe(this._componentRef.location.nativeElement);
|
|
1329
|
+
componentRef.instance.onClose.subscribe(() => {
|
|
1330
|
+
overlayRef.detach();
|
|
1331
|
+
});
|
|
1332
|
+
if (!toastConfig.keepOpen) {
|
|
1333
|
+
setTimeout(() => {
|
|
1334
|
+
componentRef.instance.close();
|
|
1335
|
+
}, toastConfig.duration ?? 4000);
|
|
1348
1336
|
}
|
|
1337
|
+
return componentRef.instance;
|
|
1349
1338
|
}
|
|
1350
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type:
|
|
1351
|
-
static { this.ɵ
|
|
1339
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1340
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyToastService, providedIn: 'root' }); }
|
|
1352
1341
|
}
|
|
1353
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type:
|
|
1354
|
-
type:
|
|
1342
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyToastService, decorators: [{
|
|
1343
|
+
type: Injectable,
|
|
1355
1344
|
args: [{
|
|
1356
|
-
|
|
1345
|
+
providedIn: 'root'
|
|
1346
|
+
}]
|
|
1347
|
+
}] });
|
|
1348
|
+
|
|
1349
|
+
/** ************************
|
|
1350
|
+
* Copyright Monkey Exchange. All Rights Reserved
|
|
1351
|
+
* This style guide was developed by Monkey Exchange Team
|
|
1352
|
+
* MIT Licence
|
|
1353
|
+
************************* */
|
|
1354
|
+
|
|
1355
|
+
/** ************************
|
|
1356
|
+
* Copyright Monkey Exchange. All Rights Reserved
|
|
1357
|
+
* This style guide was developed by Monkey Exchange Team
|
|
1358
|
+
* MIT Licence
|
|
1359
|
+
************************* */
|
|
1360
|
+
class MonkeyDisplayDirective {
|
|
1361
|
+
constructor(el) {
|
|
1362
|
+
this.el = el;
|
|
1363
|
+
this.fallbackText = 'Not provided';
|
|
1364
|
+
this.i18nDictionary = inject(MonkeyDictionaryService).get('NOT-PROVIDED');
|
|
1365
|
+
this.displayValue = input.required(...(ngDevMode ? [{ debugName: "displayValue" }] : []));
|
|
1366
|
+
this.displayedText = computed(() => {
|
|
1367
|
+
const value = this.displayValue();
|
|
1368
|
+
if (value === null || value === undefined || value === '') {
|
|
1369
|
+
return this.fallbackText;
|
|
1370
|
+
}
|
|
1371
|
+
return String(value);
|
|
1372
|
+
}, ...(ngDevMode ? [{ debugName: "displayedText" }] : []));
|
|
1373
|
+
effect(async () => {
|
|
1374
|
+
this.el.nativeElement.textContent = this.displayedText();
|
|
1375
|
+
this.fallbackText = await firstValueFrom(this.i18nDictionary);
|
|
1376
|
+
});
|
|
1377
|
+
}
|
|
1378
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyDisplayDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1379
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.14", type: MonkeyDisplayDirective, isStandalone: false, selector: "monkey-display", inputs: { displayValue: { classPropertyName: "displayValue", publicName: "displayValue", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
1380
|
+
}
|
|
1381
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyDisplayDirective, decorators: [{
|
|
1382
|
+
type: Directive,
|
|
1383
|
+
args: [{
|
|
1384
|
+
selector: 'monkey-display',
|
|
1357
1385
|
standalone: false
|
|
1358
1386
|
}]
|
|
1359
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
1360
|
-
type: Optional
|
|
1361
|
-
}, {
|
|
1362
|
-
type: Inject,
|
|
1363
|
-
args: [MECX_POPOVER_OPTIONS]
|
|
1364
|
-
}], popover: [{
|
|
1365
|
-
type: Input,
|
|
1366
|
-
args: ['monkeyPopover']
|
|
1367
|
-
}], closed: [{
|
|
1368
|
-
type: Input,
|
|
1369
|
-
args: ['monkeyPopoverClosed']
|
|
1370
|
-
}], target: [{
|
|
1371
|
-
type: Input,
|
|
1372
|
-
args: ['monkeyPopoverTarget']
|
|
1373
|
-
}], minwidth: [{
|
|
1374
|
-
type: Input,
|
|
1375
|
-
args: ['monkeyPopoverMinwidth']
|
|
1376
|
-
}], backdrop: [{
|
|
1377
|
-
type: Input,
|
|
1378
|
-
args: ['monkeyPopoverBackdrop']
|
|
1379
|
-
}], watch: [{
|
|
1380
|
-
type: Input,
|
|
1381
|
-
args: ['monkeyPopoverWatch']
|
|
1382
|
-
}], dir: [{
|
|
1383
|
-
type: Input,
|
|
1384
|
-
args: ['monkeyPopoverDir']
|
|
1385
|
-
}], contextmenu: [{
|
|
1386
|
-
type: Input,
|
|
1387
|
-
args: ['monkeyPopoverContextmenu']
|
|
1388
|
-
}], height: [{
|
|
1389
|
-
type: Input,
|
|
1390
|
-
args: ['monkeyPopoverHeight']
|
|
1391
|
-
}], title: [{
|
|
1392
|
-
type: Input,
|
|
1393
|
-
args: ['monkeyPopoverTitle']
|
|
1394
|
-
}], actions: [{
|
|
1395
|
-
type: Input,
|
|
1396
|
-
args: ['monkeyPopoverActions']
|
|
1397
|
-
}], hideClose: [{
|
|
1398
|
-
type: Input,
|
|
1399
|
-
args: [{ alias: 'monkeyPopoverHideClose', transform: booleanAttribute }]
|
|
1400
|
-
}], hideHeader: [{
|
|
1401
|
-
type: Input,
|
|
1402
|
-
args: [{ alias: 'monkeyPopoverHideHeader', transform: booleanAttribute }]
|
|
1403
|
-
}], hideActions: [{
|
|
1404
|
-
type: Input,
|
|
1405
|
-
args: [{ alias: 'monkeyPopoverHideActions', transform: booleanAttribute }]
|
|
1406
|
-
}], enableAutofocus: [{
|
|
1407
|
-
type: Input,
|
|
1408
|
-
args: [{ alias: 'monkeyPopoverEnableAutofocus', transform: booleanAttribute }]
|
|
1409
|
-
}] } });
|
|
1387
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { displayValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayValue", required: true }] }] } });
|
|
1410
1388
|
|
|
1411
1389
|
/** ************************
|
|
1412
1390
|
* Copyright Monkey Exchange. All Rights Reserved
|
|
1413
1391
|
* This style guide was developed by Monkey Exchange Team
|
|
1414
1392
|
* MIT Licence
|
|
1415
1393
|
************************* */
|
|
1416
|
-
class
|
|
1417
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type:
|
|
1418
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.14", type:
|
|
1394
|
+
class MonkeyErrorDirective {
|
|
1395
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyErrorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1396
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.14", type: MonkeyErrorDirective, isStandalone: false, selector: "monkey-error", ngImport: i0 }); }
|
|
1419
1397
|
}
|
|
1420
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type:
|
|
1398
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyErrorDirective, decorators: [{
|
|
1421
1399
|
type: Directive,
|
|
1422
1400
|
args: [{
|
|
1423
|
-
selector: 'monkey-
|
|
1401
|
+
selector: 'monkey-error',
|
|
1424
1402
|
standalone: false
|
|
1425
1403
|
}]
|
|
1426
1404
|
}] });
|
|
@@ -1430,95 +1408,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
1430
1408
|
* This style guide was developed by Monkey Exchange Team
|
|
1431
1409
|
* MIT Licence
|
|
1432
1410
|
************************* */
|
|
1433
|
-
class
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
this.action = null;
|
|
1437
|
-
}
|
|
1438
|
-
set _hasAction(value) {
|
|
1439
|
-
this.hasAction = true;
|
|
1440
|
-
}
|
|
1441
|
-
onClick(event) {
|
|
1442
|
-
if (!this.action) {
|
|
1443
|
-
event.preventDefault();
|
|
1444
|
-
event.stopPropagation();
|
|
1445
|
-
}
|
|
1446
|
-
else {
|
|
1447
|
-
this.action(event);
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeySuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1451
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.14", type: MonkeySuffixDirective, isStandalone: false, selector: "monkey-suffix", inputs: { _hasAction: ["hasAction", "_hasAction"] }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.has-action": "hasAction" } }, ngImport: i0 }); }
|
|
1411
|
+
class MonkeyHelperDirective {
|
|
1412
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyHelperDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1413
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.14", type: MonkeyHelperDirective, isStandalone: false, selector: "monkey-helper", ngImport: i0 }); }
|
|
1452
1414
|
}
|
|
1453
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type:
|
|
1415
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyHelperDirective, decorators: [{
|
|
1454
1416
|
type: Directive,
|
|
1455
1417
|
args: [{
|
|
1456
|
-
selector: 'monkey-
|
|
1457
|
-
host: {
|
|
1458
|
-
'[class.has-action]': 'hasAction'
|
|
1459
|
-
},
|
|
1418
|
+
selector: 'monkey-helper',
|
|
1460
1419
|
standalone: false
|
|
1461
1420
|
}]
|
|
1462
|
-
}]
|
|
1463
|
-
type: Input,
|
|
1464
|
-
args: ['hasAction']
|
|
1465
|
-
}], onClick: [{
|
|
1466
|
-
type: HostListener,
|
|
1467
|
-
args: ['click', ['$event']]
|
|
1468
|
-
}] } });
|
|
1421
|
+
}] });
|
|
1469
1422
|
|
|
1470
1423
|
/** ************************
|
|
1471
1424
|
* Copyright Monkey Exchange. All Rights Reserved
|
|
1472
1425
|
* This style guide was developed by Monkey Exchange Team
|
|
1473
1426
|
* MIT Licence
|
|
1474
1427
|
************************* */
|
|
1475
|
-
class
|
|
1476
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type:
|
|
1477
|
-
static { this.ɵ
|
|
1478
|
-
MonkeyHelperDirective,
|
|
1479
|
-
MonkeyInfoDirective,
|
|
1480
|
-
MonkeyLabelDirective,
|
|
1481
|
-
MonkeyDisplayDirective,
|
|
1482
|
-
MonkeyPrefixDirective,
|
|
1483
|
-
MonkeySuffixDirective,
|
|
1484
|
-
MonkeyBadgeDirective,
|
|
1485
|
-
MonkeyPopoverDirective], imports: [MonkeyPopoverContentComponent], exports: [MonkeyErrorDirective,
|
|
1486
|
-
MonkeyHelperDirective,
|
|
1487
|
-
MonkeyInfoDirective,
|
|
1488
|
-
MonkeyLabelDirective,
|
|
1489
|
-
MonkeyDisplayDirective,
|
|
1490
|
-
MonkeyPrefixDirective,
|
|
1491
|
-
MonkeySuffixDirective,
|
|
1492
|
-
MonkeyBadgeDirective,
|
|
1493
|
-
MonkeyPopoverDirective] }); }
|
|
1494
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyDirectivesModule, imports: [MonkeyPopoverContentComponent] }); }
|
|
1428
|
+
class MonkeyInfoDirective {
|
|
1429
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyInfoDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1430
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.14", type: MonkeyInfoDirective, isStandalone: false, selector: "monkey-info", ngImport: i0 }); }
|
|
1495
1431
|
}
|
|
1496
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type:
|
|
1497
|
-
type:
|
|
1432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyInfoDirective, decorators: [{
|
|
1433
|
+
type: Directive,
|
|
1498
1434
|
args: [{
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
MonkeyErrorDirective,
|
|
1502
|
-
MonkeyHelperDirective,
|
|
1503
|
-
MonkeyInfoDirective,
|
|
1504
|
-
MonkeyLabelDirective,
|
|
1505
|
-
MonkeyDisplayDirective,
|
|
1506
|
-
MonkeyPrefixDirective,
|
|
1507
|
-
MonkeySuffixDirective,
|
|
1508
|
-
MonkeyBadgeDirective,
|
|
1509
|
-
MonkeyPopoverDirective
|
|
1510
|
-
],
|
|
1511
|
-
exports: [
|
|
1512
|
-
MonkeyErrorDirective,
|
|
1513
|
-
MonkeyHelperDirective,
|
|
1514
|
-
MonkeyInfoDirective,
|
|
1515
|
-
MonkeyLabelDirective,
|
|
1516
|
-
MonkeyDisplayDirective,
|
|
1517
|
-
MonkeyPrefixDirective,
|
|
1518
|
-
MonkeySuffixDirective,
|
|
1519
|
-
MonkeyBadgeDirective,
|
|
1520
|
-
MonkeyPopoverDirective
|
|
1521
|
-
]
|
|
1435
|
+
selector: 'monkey-info',
|
|
1436
|
+
standalone: false
|
|
1522
1437
|
}]
|
|
1523
1438
|
}] });
|
|
1524
1439
|
|
|
@@ -1527,412 +1442,514 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
1527
1442
|
* This style guide was developed by Monkey Exchange Team
|
|
1528
1443
|
* MIT Licence
|
|
1529
1444
|
************************* */
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
this._http = inject(HttpClient);
|
|
1534
|
-
this._googleApiKey = injectTokenWithWarning(MECX_GOOGLE_API_KEY, 'MECX_GOOGLE_API_KEY');
|
|
1535
|
-
}
|
|
1536
|
-
mappingData(places) {
|
|
1537
|
-
const getComponent = (components, type, field = 'longText') => {
|
|
1538
|
-
const result = components.find((c) => {
|
|
1539
|
-
return c.types.includes(type);
|
|
1540
|
-
});
|
|
1541
|
-
return result?.[field] || '';
|
|
1542
|
-
};
|
|
1543
|
-
return places.map((_) => {
|
|
1544
|
-
const { addressComponents } = _;
|
|
1545
|
-
const address = getComponent(addressComponents, 'route');
|
|
1546
|
-
const addressNumber = getComponent(addressComponents, 'street_number');
|
|
1547
|
-
const neighborhood = getComponent(addressComponents, 'sublocality_level_1');
|
|
1548
|
-
const city = getComponent(addressComponents, 'administrative_area_level_2');
|
|
1549
|
-
const state = getComponent(addressComponents, 'administrative_area_level_1');
|
|
1550
|
-
const country = getComponent(addressComponents, 'country', 'shortText');
|
|
1551
|
-
const zipCode = getComponent(addressComponents, 'postal_code');
|
|
1552
|
-
return {
|
|
1553
|
-
formattedAddress: _.formattedAddress,
|
|
1554
|
-
adrFormatAddress: _.adrFormatAddress,
|
|
1555
|
-
address,
|
|
1556
|
-
addressNumber,
|
|
1557
|
-
neighborhood,
|
|
1558
|
-
city,
|
|
1559
|
-
state,
|
|
1560
|
-
country,
|
|
1561
|
-
zipCode
|
|
1562
|
-
};
|
|
1563
|
-
});
|
|
1564
|
-
}
|
|
1565
|
-
get(textQuery) {
|
|
1566
|
-
if (!textQuery) {
|
|
1567
|
-
return of([]);
|
|
1568
|
-
}
|
|
1569
|
-
return this._http
|
|
1570
|
-
.post('https://places.googleapis.com/v1/places:searchText', {
|
|
1571
|
-
textQuery
|
|
1572
|
-
}, {
|
|
1573
|
-
headers: {
|
|
1574
|
-
'X-Goog-Api-Key': this._googleApiKey,
|
|
1575
|
-
'X-Goog-FieldMask': 'places.formattedAddress,places.addressComponents,places.displayName,places.adrFormatAddress'
|
|
1576
|
-
}
|
|
1577
|
-
})
|
|
1578
|
-
.pipe(map((resp) => {
|
|
1579
|
-
return this.mappingData(resp.places);
|
|
1580
|
-
}));
|
|
1581
|
-
}
|
|
1582
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyEcxAddressService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1583
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyEcxAddressService, providedIn: 'root' }); }
|
|
1445
|
+
class MonkeyLabelDirective {
|
|
1446
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1447
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.14", type: MonkeyLabelDirective, isStandalone: false, selector: "monkey-label", ngImport: i0 }); }
|
|
1584
1448
|
}
|
|
1585
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type:
|
|
1586
|
-
type:
|
|
1587
|
-
args: [{
|
|
1449
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyLabelDirective, decorators: [{
|
|
1450
|
+
type: Directive,
|
|
1451
|
+
args: [{
|
|
1452
|
+
selector: 'monkey-label',
|
|
1453
|
+
standalone: false
|
|
1454
|
+
}]
|
|
1588
1455
|
}] });
|
|
1589
1456
|
|
|
1590
|
-
/* eslint-disable no-console */
|
|
1591
1457
|
/** ************************
|
|
1592
1458
|
* Copyright Monkey Exchange. All Rights Reserved
|
|
1593
1459
|
* This style guide was developed by Monkey Exchange Team
|
|
1594
1460
|
* MIT Licence
|
|
1595
1461
|
************************* */
|
|
1596
|
-
class
|
|
1597
|
-
constructor() {
|
|
1598
|
-
this.
|
|
1599
|
-
this.
|
|
1600
|
-
this.
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
8: 'September',
|
|
1762
|
-
9: 'October',
|
|
1763
|
-
10: 'November',
|
|
1764
|
-
11: 'December'
|
|
1765
|
-
},
|
|
1766
|
-
'QUICK-ACTIONS': {
|
|
1767
|
-
CUSTOM: 'Custom',
|
|
1768
|
-
LAST_30_DAYS: 'Last 30 days',
|
|
1769
|
-
LAST_60_DAYS: 'Last 60 days',
|
|
1770
|
-
LAST_90_DAYS: 'Last 90 days',
|
|
1771
|
-
LAST_6_MONTHS: 'Last 6 months',
|
|
1772
|
-
LAST_12_MONTHS: 'Last 12 months',
|
|
1773
|
-
NEXT_30_DAYS: 'Next 30 days',
|
|
1774
|
-
NEXT_60_DAYS: 'Next 60 days',
|
|
1775
|
-
NEXT_90_DAYS: 'Next 90 days',
|
|
1776
|
-
NEXT_6_MONTHS: 'Next 6 months',
|
|
1777
|
-
NEXT_12_MONTHS: 'Next 12 months'
|
|
1778
|
-
}
|
|
1779
|
-
}
|
|
1780
|
-
}
|
|
1781
|
-
});
|
|
1782
|
-
const tokenSubject = inject(MECX_I18N_WRAPPER, { optional: true });
|
|
1783
|
-
tokenSubject?.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((value) => {
|
|
1784
|
-
this.handleWrapperValues(value);
|
|
1462
|
+
class MonkeyPopoverContentComponent {
|
|
1463
|
+
constructor(host) {
|
|
1464
|
+
this.host = host;
|
|
1465
|
+
this.onClose = new EventEmitter();
|
|
1466
|
+
this.enableAutofocus = false;
|
|
1467
|
+
// not to do
|
|
1468
|
+
}
|
|
1469
|
+
ngAfterViewInit() {
|
|
1470
|
+
if (this.enableAutofocus) {
|
|
1471
|
+
setTimeout(() => {
|
|
1472
|
+
const focusable = this.host.nativeElement.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
1473
|
+
focusable?.focus();
|
|
1474
|
+
});
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
isTemplate(value) {
|
|
1478
|
+
return value instanceof TemplateRef;
|
|
1479
|
+
}
|
|
1480
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyPopoverContentComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1481
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: MonkeyPopoverContentComponent, isStandalone: true, selector: "monkey-popover-content", inputs: { title: "title", content: "content", actions: "actions", hideHeader: ["hideHeader", "hideHeader", booleanAttribute], hideClose: ["hideClose", "hideClose", booleanAttribute], hideActions: ["hideActions", "hideActions", booleanAttribute], enableAutofocus: "enableAutofocus" }, outputs: { onClose: "onClose" }, ngImport: i0, template: `
|
|
1482
|
+
<div class="mecx-popover-container">
|
|
1483
|
+
@if (!hideHeader) {
|
|
1484
|
+
<div class="mecx-popover-header">
|
|
1485
|
+
@if (title) {
|
|
1486
|
+
<div>
|
|
1487
|
+
<ng-container *ngIf="isTemplate(title); else stringTitle">
|
|
1488
|
+
<ng-container *ngTemplateOutlet="title"></ng-container>
|
|
1489
|
+
</ng-container>
|
|
1490
|
+
<ng-template #stringTitle>
|
|
1491
|
+
{{ title }}
|
|
1492
|
+
</ng-template>
|
|
1493
|
+
</div>
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
@if (!hideClose) {
|
|
1497
|
+
<util-icon class="mecx-popover-close" name="clear" (click)="onClose.next(null)" />
|
|
1498
|
+
}
|
|
1499
|
+
</div>
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
<div class="mecx-popover-content" [class.add-radius]="hideHeader">
|
|
1503
|
+
<ng-container *ngTemplateOutlet="content"></ng-container>
|
|
1504
|
+
</div>
|
|
1505
|
+
|
|
1506
|
+
@if (!hideActions) {
|
|
1507
|
+
<div class="mecx-popover-actions" *ngIf="actions">
|
|
1508
|
+
<ng-container *ngIf="isTemplate(actions); else stringActions">
|
|
1509
|
+
<ng-container *ngTemplateOutlet="actions"></ng-container>
|
|
1510
|
+
</ng-container>
|
|
1511
|
+
<ng-template #stringActions>
|
|
1512
|
+
<span>{{ actions }}</span>
|
|
1513
|
+
</ng-template>
|
|
1514
|
+
</div>
|
|
1515
|
+
}
|
|
1516
|
+
</div>
|
|
1517
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: UtilIconComponent, selector: "util-icon", inputs: ["name"] }] }); }
|
|
1518
|
+
}
|
|
1519
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyPopoverContentComponent, decorators: [{
|
|
1520
|
+
type: Component,
|
|
1521
|
+
args: [{
|
|
1522
|
+
selector: 'monkey-popover-content',
|
|
1523
|
+
imports: [CommonModule, NgTemplateOutlet, UtilIconComponent],
|
|
1524
|
+
template: `
|
|
1525
|
+
<div class="mecx-popover-container">
|
|
1526
|
+
@if (!hideHeader) {
|
|
1527
|
+
<div class="mecx-popover-header">
|
|
1528
|
+
@if (title) {
|
|
1529
|
+
<div>
|
|
1530
|
+
<ng-container *ngIf="isTemplate(title); else stringTitle">
|
|
1531
|
+
<ng-container *ngTemplateOutlet="title"></ng-container>
|
|
1532
|
+
</ng-container>
|
|
1533
|
+
<ng-template #stringTitle>
|
|
1534
|
+
{{ title }}
|
|
1535
|
+
</ng-template>
|
|
1536
|
+
</div>
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
@if (!hideClose) {
|
|
1540
|
+
<util-icon class="mecx-popover-close" name="clear" (click)="onClose.next(null)" />
|
|
1541
|
+
}
|
|
1542
|
+
</div>
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
<div class="mecx-popover-content" [class.add-radius]="hideHeader">
|
|
1546
|
+
<ng-container *ngTemplateOutlet="content"></ng-container>
|
|
1547
|
+
</div>
|
|
1548
|
+
|
|
1549
|
+
@if (!hideActions) {
|
|
1550
|
+
<div class="mecx-popover-actions" *ngIf="actions">
|
|
1551
|
+
<ng-container *ngIf="isTemplate(actions); else stringActions">
|
|
1552
|
+
<ng-container *ngTemplateOutlet="actions"></ng-container>
|
|
1553
|
+
</ng-container>
|
|
1554
|
+
<ng-template #stringActions>
|
|
1555
|
+
<span>{{ actions }}</span>
|
|
1556
|
+
</ng-template>
|
|
1557
|
+
</div>
|
|
1558
|
+
}
|
|
1559
|
+
</div>
|
|
1560
|
+
`
|
|
1561
|
+
}]
|
|
1562
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { title: [{
|
|
1563
|
+
type: Input
|
|
1564
|
+
}], content: [{
|
|
1565
|
+
type: Input
|
|
1566
|
+
}], actions: [{
|
|
1567
|
+
type: Input
|
|
1568
|
+
}], onClose: [{
|
|
1569
|
+
type: Output
|
|
1570
|
+
}], hideHeader: [{
|
|
1571
|
+
type: Input,
|
|
1572
|
+
args: [{ transform: booleanAttribute }]
|
|
1573
|
+
}], hideClose: [{
|
|
1574
|
+
type: Input,
|
|
1575
|
+
args: [{ transform: booleanAttribute }]
|
|
1576
|
+
}], hideActions: [{
|
|
1577
|
+
type: Input,
|
|
1578
|
+
args: [{ transform: booleanAttribute }]
|
|
1579
|
+
}], enableAutofocus: [{
|
|
1580
|
+
type: Input
|
|
1581
|
+
}] } });
|
|
1582
|
+
class MonkeyPopoverDirective {
|
|
1583
|
+
set popover(show) {
|
|
1584
|
+
if (this._show === show) {
|
|
1585
|
+
return;
|
|
1586
|
+
}
|
|
1587
|
+
this._show = show;
|
|
1588
|
+
if (show) {
|
|
1589
|
+
setTimeout(() => {
|
|
1590
|
+
this.createPopover();
|
|
1591
|
+
}, 0);
|
|
1592
|
+
}
|
|
1593
|
+
else {
|
|
1594
|
+
this.disposePopover();
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
get popover() {
|
|
1598
|
+
return this._show;
|
|
1599
|
+
}
|
|
1600
|
+
set target(value) {
|
|
1601
|
+
this._target = value;
|
|
1602
|
+
}
|
|
1603
|
+
get target() {
|
|
1604
|
+
return this._target;
|
|
1605
|
+
}
|
|
1606
|
+
constructor() {
|
|
1607
|
+
this._tpl = inject(TemplateRef);
|
|
1608
|
+
this._vcr = inject(ViewContainerRef);
|
|
1609
|
+
this._el = inject(ElementRef);
|
|
1610
|
+
this._zone = inject(NgZone);
|
|
1611
|
+
this._overlay = inject(Overlay);
|
|
1612
|
+
this._overlayPositionBuilder = inject(OverlayPositionBuilder);
|
|
1613
|
+
this._router = inject(Router);
|
|
1614
|
+
this._destroyRef = inject(DestroyRef);
|
|
1615
|
+
this._show = false;
|
|
1616
|
+
this.minwidth = false;
|
|
1617
|
+
this.backdrop = true;
|
|
1618
|
+
this.watch = false;
|
|
1619
|
+
this.dir = 'ltr';
|
|
1620
|
+
this.contextmenu = false;
|
|
1621
|
+
this._router.events
|
|
1622
|
+
.pipe(filter((event) => {
|
|
1623
|
+
return event instanceof NavigationStart;
|
|
1624
|
+
}), takeUntilDestroyed(this._destroyRef))
|
|
1625
|
+
.subscribe(() => {
|
|
1626
|
+
this.closePopover();
|
|
1785
1627
|
});
|
|
1786
1628
|
}
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1629
|
+
ngOnDestroy() {
|
|
1630
|
+
this.disposePopover();
|
|
1631
|
+
this._resizeObserver?.disconnect();
|
|
1632
|
+
}
|
|
1633
|
+
closePopover(event) {
|
|
1634
|
+
if (this._show) {
|
|
1635
|
+
this._show = false;
|
|
1636
|
+
this.disposePopover();
|
|
1637
|
+
this._zone.run(() => {
|
|
1638
|
+
this.closed?.(event);
|
|
1639
|
+
});
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
disposePopover() {
|
|
1643
|
+
this._resizeObserver?.disconnect();
|
|
1644
|
+
this._resizeObserver = undefined;
|
|
1645
|
+
if (this._overlayRef) {
|
|
1646
|
+
this._overlayRef.dispose();
|
|
1647
|
+
this._overlayRef = undefined;
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
getPositions(dir) {
|
|
1651
|
+
const oppositeVertical = {
|
|
1652
|
+
top: 'bottom',
|
|
1653
|
+
bottom: 'top',
|
|
1654
|
+
center: 'center'
|
|
1655
|
+
};
|
|
1656
|
+
const oppositeHorizontal = {
|
|
1657
|
+
start: 'end',
|
|
1658
|
+
end: 'start',
|
|
1659
|
+
center: 'center'
|
|
1660
|
+
};
|
|
1661
|
+
const centerY = (pos) => {
|
|
1662
|
+
return {
|
|
1663
|
+
originX: 'center',
|
|
1664
|
+
originY: pos,
|
|
1665
|
+
overlayX: 'center',
|
|
1666
|
+
overlayY: oppositeVertical[pos]
|
|
1798
1667
|
};
|
|
1799
|
-
|
|
1668
|
+
};
|
|
1669
|
+
const centerX = (pos) => {
|
|
1670
|
+
return {
|
|
1671
|
+
originX: oppositeHorizontal[pos],
|
|
1672
|
+
originY: 'center',
|
|
1673
|
+
overlayX: pos,
|
|
1674
|
+
overlayY: 'center'
|
|
1675
|
+
};
|
|
1676
|
+
};
|
|
1677
|
+
const ltr = (axis) => {
|
|
1678
|
+
return {
|
|
1679
|
+
originX: 'start',
|
|
1680
|
+
originY: axis,
|
|
1681
|
+
overlayX: 'start',
|
|
1682
|
+
overlayY: oppositeVertical[axis]
|
|
1683
|
+
};
|
|
1684
|
+
};
|
|
1685
|
+
const rtl = (axis) => {
|
|
1686
|
+
return {
|
|
1687
|
+
originX: 'end',
|
|
1688
|
+
originY: axis,
|
|
1689
|
+
overlayX: 'end',
|
|
1690
|
+
overlayY: oppositeVertical[axis]
|
|
1691
|
+
};
|
|
1692
|
+
};
|
|
1693
|
+
const side = (axisX, axisY) => {
|
|
1694
|
+
return {
|
|
1695
|
+
originX: axisX,
|
|
1696
|
+
originY: axisY,
|
|
1697
|
+
overlayX: oppositeHorizontal[axisX],
|
|
1698
|
+
overlayY: axisY
|
|
1699
|
+
};
|
|
1700
|
+
};
|
|
1701
|
+
const cmp = dir ?? this._options?.dir ?? this.dir;
|
|
1702
|
+
switch (cmp) {
|
|
1703
|
+
case 'ct':
|
|
1704
|
+
return [centerY('top'), centerY('bottom'), centerX('start'), centerX('end')];
|
|
1705
|
+
case 'cr':
|
|
1706
|
+
return [centerX('end'), centerX('start'), centerY('top'), centerY('bottom')];
|
|
1707
|
+
case 'cc':
|
|
1708
|
+
return [centerX('center')];
|
|
1709
|
+
case 'ltr':
|
|
1710
|
+
return [ltr('bottom'), ltr('top')];
|
|
1711
|
+
case 'rtl':
|
|
1712
|
+
return [rtl('bottom'), rtl('top')];
|
|
1713
|
+
case 'tltr':
|
|
1714
|
+
return [ltr('top'), ltr('bottom')];
|
|
1715
|
+
case 'trtl':
|
|
1716
|
+
return [rtl('top'), rtl('bottom')];
|
|
1717
|
+
case 'rt':
|
|
1718
|
+
return [side('end', 'top'), side('end', 'bottom'), ltr('top')];
|
|
1719
|
+
case 'rb':
|
|
1720
|
+
return [side('end', 'bottom'), side('end', 'top'), ltr('bottom'), rtl('bottom')];
|
|
1721
|
+
case 'lt':
|
|
1722
|
+
return [side('start', 'top'), side('start', 'bottom'), rtl('top')];
|
|
1723
|
+
case 'lb':
|
|
1724
|
+
return [side('start', 'bottom'), side('start', 'top'), rtl('bottom')];
|
|
1725
|
+
default:
|
|
1726
|
+
return [];
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
createPopover(origin, options) {
|
|
1730
|
+
if (!this.target) {
|
|
1731
|
+
// eslint-disable-next-line no-console
|
|
1732
|
+
console.error('MonkeyPopoverDirective -> target element is not defined.');
|
|
1733
|
+
return;
|
|
1734
|
+
}
|
|
1735
|
+
const originEl = this.target instanceof HTMLElement ? this.target : this.target.element;
|
|
1736
|
+
this._positionStrategy = this._overlayPositionBuilder
|
|
1737
|
+
.flexibleConnectedTo(origin ?? originEl)
|
|
1738
|
+
.withPush(true)
|
|
1739
|
+
.withGrowAfterOpen(true)
|
|
1740
|
+
.withPositions(this.getPositions(options?.dir));
|
|
1741
|
+
this._overlayRef = this._overlay.create({
|
|
1742
|
+
positionStrategy: this._positionStrategy,
|
|
1743
|
+
disposeOnNavigation: true,
|
|
1744
|
+
direction: 'ltr',
|
|
1745
|
+
hasBackdrop: this.backdrop,
|
|
1746
|
+
scrollStrategy: this._overlay.scrollStrategies.reposition(),
|
|
1747
|
+
backdropClass: 'cdk-overlay-transparent-backdrop',
|
|
1748
|
+
width: this._options?.minwidth || this.minwidth ? this.target.offsetWidth - 2 : undefined,
|
|
1749
|
+
maxHeight: '95%',
|
|
1750
|
+
height: this.height
|
|
1751
|
+
});
|
|
1752
|
+
this._overlayRef
|
|
1753
|
+
.backdropClick()
|
|
1754
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
1755
|
+
.subscribe((event) => {
|
|
1756
|
+
this.closePopover(event);
|
|
1757
|
+
});
|
|
1758
|
+
const portal = new ComponentPortal(MonkeyPopoverContentComponent, this._vcr);
|
|
1759
|
+
this._componentRef = this._overlayRef.attach(portal);
|
|
1760
|
+
this._componentRef.instance.content = this._tpl;
|
|
1761
|
+
this._componentRef.instance.title = this.title;
|
|
1762
|
+
this._componentRef.instance.actions = this.actions;
|
|
1763
|
+
this._componentRef.instance.hideClose = this.hideClose;
|
|
1764
|
+
this._componentRef.instance.hideHeader = this.hideHeader;
|
|
1765
|
+
this._componentRef.instance.hideActions = this.hideActions;
|
|
1766
|
+
this._componentRef.instance.enableAutofocus = this.enableAutofocus;
|
|
1767
|
+
if (!this.hideClose || !this.hideHeader) {
|
|
1768
|
+
this._componentRef.instance.onClose
|
|
1769
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
1770
|
+
.subscribe(() => {
|
|
1771
|
+
this.closePopover();
|
|
1772
|
+
});
|
|
1800
1773
|
}
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1774
|
+
if (this.watch && 'ResizeObserver' in window) {
|
|
1775
|
+
this._resizeObserver = new ResizeObserver(() => {
|
|
1776
|
+
this._overlayRef?.updatePosition();
|
|
1777
|
+
});
|
|
1778
|
+
this._resizeObserver.observe(this._componentRef.location.nativeElement);
|
|
1804
1779
|
}
|
|
1805
1780
|
}
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
return this._data$.pipe(map((data) => {
|
|
1809
|
-
return data[locale]?.[key] ?? null;
|
|
1810
|
-
}));
|
|
1811
|
-
}
|
|
1812
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyDictionaryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1813
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyDictionaryService, providedIn: 'root' }); }
|
|
1781
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyPopoverDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1782
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.3.14", type: MonkeyPopoverDirective, isStandalone: false, selector: "[monkeyPopover]", inputs: { popover: ["monkeyPopover", "popover"], closed: ["monkeyPopoverClosed", "closed"], target: ["monkeyPopoverTarget", "target"], minwidth: ["monkeyPopoverMinwidth", "minwidth"], backdrop: ["monkeyPopoverBackdrop", "backdrop"], watch: ["monkeyPopoverWatch", "watch"], dir: ["monkeyPopoverDir", "dir"], contextmenu: ["monkeyPopoverContextmenu", "contextmenu"], height: ["monkeyPopoverHeight", "height"], title: ["monkeyPopoverTitle", "title"], actions: ["monkeyPopoverActions", "actions"], hideClose: ["monkeyPopoverHideClose", "hideClose", booleanAttribute], hideHeader: ["monkeyPopoverHideHeader", "hideHeader", booleanAttribute], hideActions: ["monkeyPopoverHideActions", "hideActions", booleanAttribute], enableAutofocus: ["monkeyPopoverEnableAutofocus", "enableAutofocus", booleanAttribute] }, ngImport: i0 }); }
|
|
1814
1783
|
}
|
|
1815
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type:
|
|
1816
|
-
type:
|
|
1784
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyPopoverDirective, decorators: [{
|
|
1785
|
+
type: Directive,
|
|
1817
1786
|
args: [{
|
|
1818
|
-
|
|
1787
|
+
selector: '[monkeyPopover]',
|
|
1788
|
+
standalone: false
|
|
1819
1789
|
}]
|
|
1820
|
-
}], ctorParameters: () => []
|
|
1790
|
+
}], ctorParameters: () => [], propDecorators: { _options: [{
|
|
1791
|
+
type: Optional
|
|
1792
|
+
}, {
|
|
1793
|
+
type: Inject,
|
|
1794
|
+
args: [MECX_POPOVER_OPTIONS]
|
|
1795
|
+
}], popover: [{
|
|
1796
|
+
type: Input,
|
|
1797
|
+
args: ['monkeyPopover']
|
|
1798
|
+
}], closed: [{
|
|
1799
|
+
type: Input,
|
|
1800
|
+
args: ['monkeyPopoverClosed']
|
|
1801
|
+
}], target: [{
|
|
1802
|
+
type: Input,
|
|
1803
|
+
args: ['monkeyPopoverTarget']
|
|
1804
|
+
}], minwidth: [{
|
|
1805
|
+
type: Input,
|
|
1806
|
+
args: ['monkeyPopoverMinwidth']
|
|
1807
|
+
}], backdrop: [{
|
|
1808
|
+
type: Input,
|
|
1809
|
+
args: ['monkeyPopoverBackdrop']
|
|
1810
|
+
}], watch: [{
|
|
1811
|
+
type: Input,
|
|
1812
|
+
args: ['monkeyPopoverWatch']
|
|
1813
|
+
}], dir: [{
|
|
1814
|
+
type: Input,
|
|
1815
|
+
args: ['monkeyPopoverDir']
|
|
1816
|
+
}], contextmenu: [{
|
|
1817
|
+
type: Input,
|
|
1818
|
+
args: ['monkeyPopoverContextmenu']
|
|
1819
|
+
}], height: [{
|
|
1820
|
+
type: Input,
|
|
1821
|
+
args: ['monkeyPopoverHeight']
|
|
1822
|
+
}], title: [{
|
|
1823
|
+
type: Input,
|
|
1824
|
+
args: ['monkeyPopoverTitle']
|
|
1825
|
+
}], actions: [{
|
|
1826
|
+
type: Input,
|
|
1827
|
+
args: ['monkeyPopoverActions']
|
|
1828
|
+
}], hideClose: [{
|
|
1829
|
+
type: Input,
|
|
1830
|
+
args: [{ alias: 'monkeyPopoverHideClose', transform: booleanAttribute }]
|
|
1831
|
+
}], hideHeader: [{
|
|
1832
|
+
type: Input,
|
|
1833
|
+
args: [{ alias: 'monkeyPopoverHideHeader', transform: booleanAttribute }]
|
|
1834
|
+
}], hideActions: [{
|
|
1835
|
+
type: Input,
|
|
1836
|
+
args: [{ alias: 'monkeyPopoverHideActions', transform: booleanAttribute }]
|
|
1837
|
+
}], enableAutofocus: [{
|
|
1838
|
+
type: Input,
|
|
1839
|
+
args: [{ alias: 'monkeyPopoverEnableAutofocus', transform: booleanAttribute }]
|
|
1840
|
+
}] } });
|
|
1821
1841
|
|
|
1822
1842
|
/** ************************
|
|
1823
1843
|
* Copyright Monkey Exchange. All Rights Reserved
|
|
1824
1844
|
* This style guide was developed by Monkey Exchange Team
|
|
1825
1845
|
* MIT Licence
|
|
1826
1846
|
************************* */
|
|
1827
|
-
class
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
}
|
|
1831
|
-
currentStep(id) {
|
|
1832
|
-
return computed(() => {
|
|
1833
|
-
return this._steppers().get(id);
|
|
1834
|
-
});
|
|
1835
|
-
}
|
|
1836
|
-
setCurrentStep(id, step) {
|
|
1837
|
-
this._steppers.update((items) => {
|
|
1838
|
-
return new Map(items).set(id, step);
|
|
1839
|
-
});
|
|
1840
|
-
}
|
|
1841
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyStepperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1842
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyStepperService, providedIn: 'root' }); }
|
|
1847
|
+
class MonkeyPrefixDirective {
|
|
1848
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyPrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1849
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.14", type: MonkeyPrefixDirective, isStandalone: false, selector: "monkey-prefix", ngImport: i0 }); }
|
|
1843
1850
|
}
|
|
1844
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type:
|
|
1845
|
-
type:
|
|
1851
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyPrefixDirective, decorators: [{
|
|
1852
|
+
type: Directive,
|
|
1846
1853
|
args: [{
|
|
1847
|
-
|
|
1854
|
+
selector: 'monkey-prefix',
|
|
1855
|
+
standalone: false
|
|
1848
1856
|
}]
|
|
1849
1857
|
}] });
|
|
1850
1858
|
|
|
1851
|
-
class MonkeyToastRef {
|
|
1852
|
-
constructor(componentRef) {
|
|
1853
|
-
this.componentRef = componentRef;
|
|
1854
|
-
// not to do
|
|
1855
|
-
}
|
|
1856
|
-
close() {
|
|
1857
|
-
this.componentRef.instance.close();
|
|
1858
|
-
}
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1861
|
-
/** ************************
|
|
1862
|
-
* Copyright Monkey Exchange. All Rights Reserved
|
|
1863
|
-
* This style guide was developed by Monkey Exchange Team
|
|
1864
|
-
* MIT Licence
|
|
1865
|
-
************************* */
|
|
1866
|
-
|
|
1867
1859
|
/** ************************
|
|
1868
1860
|
* Copyright Monkey Exchange. All Rights Reserved
|
|
1869
1861
|
* This style guide was developed by Monkey Exchange Team
|
|
1870
1862
|
* MIT Licence
|
|
1871
1863
|
************************* */
|
|
1872
|
-
class
|
|
1864
|
+
class MonkeySuffixDirective {
|
|
1873
1865
|
constructor() {
|
|
1874
|
-
this.
|
|
1866
|
+
this.hasAction = false;
|
|
1867
|
+
this.action = null;
|
|
1875
1868
|
}
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
switch (position) {
|
|
1879
|
-
case 'top-left':
|
|
1880
|
-
return globalPosition.top('40px').start('40px');
|
|
1881
|
-
case 'top-center':
|
|
1882
|
-
return globalPosition.top('40px').centerHorizontally();
|
|
1883
|
-
case 'top-right':
|
|
1884
|
-
return globalPosition.top('40px').end('40px');
|
|
1885
|
-
case 'bottom-left':
|
|
1886
|
-
return globalPosition.bottom('40px').start('40px');
|
|
1887
|
-
case 'bottom-center':
|
|
1888
|
-
return globalPosition.bottom('40px').centerHorizontally();
|
|
1889
|
-
default:
|
|
1890
|
-
return globalPosition.bottom('40px').end('40px');
|
|
1891
|
-
}
|
|
1869
|
+
set _hasAction(value) {
|
|
1870
|
+
this.hasAction = true;
|
|
1892
1871
|
}
|
|
1893
|
-
|
|
1894
|
-
if (this.
|
|
1895
|
-
|
|
1872
|
+
onClick(event) {
|
|
1873
|
+
if (!this.action) {
|
|
1874
|
+
event.preventDefault();
|
|
1875
|
+
event.stopPropagation();
|
|
1896
1876
|
}
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
positionStrategy: this.getPositionStrategy(toastConfig.position)
|
|
1900
|
-
});
|
|
1901
|
-
const portal = new ComponentPortal(MonkeyToastComponent);
|
|
1902
|
-
const componentRef = overlayRef.attach(portal);
|
|
1903
|
-
this.lastToast = new MonkeyToastRef(componentRef);
|
|
1904
|
-
componentRef.instance.id = getRandomString(6);
|
|
1905
|
-
componentRef.instance.type = toastConfig.type ?? 'default';
|
|
1906
|
-
componentRef.instance.icon = toastConfig.icon;
|
|
1907
|
-
componentRef.instance.isClosable = toastConfig.isClosable ?? false;
|
|
1908
|
-
componentRef.instance.message = toastConfig.message;
|
|
1909
|
-
componentRef.instance.actionLabel = toastConfig.actionLabel;
|
|
1910
|
-
componentRef.instance.actionIcon = toastConfig.actionIcon;
|
|
1911
|
-
componentRef.instance.onActionClick.subscribe(() => {
|
|
1912
|
-
if (toastConfig.action) {
|
|
1913
|
-
toastConfig.action();
|
|
1914
|
-
if (toastConfig.closeOnAction ?? true) {
|
|
1915
|
-
componentRef.instance.close();
|
|
1916
|
-
}
|
|
1917
|
-
}
|
|
1918
|
-
});
|
|
1919
|
-
componentRef.instance.onClose.subscribe(() => {
|
|
1920
|
-
overlayRef.detach();
|
|
1921
|
-
});
|
|
1922
|
-
if (!toastConfig.keepOpen) {
|
|
1923
|
-
setTimeout(() => {
|
|
1924
|
-
componentRef.instance.close();
|
|
1925
|
-
}, toastConfig.duration ?? 4000);
|
|
1877
|
+
else {
|
|
1878
|
+
this.action(event);
|
|
1926
1879
|
}
|
|
1927
|
-
return componentRef.instance;
|
|
1928
1880
|
}
|
|
1929
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type:
|
|
1930
|
-
static { this.ɵ
|
|
1881
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeySuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1882
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.14", type: MonkeySuffixDirective, isStandalone: false, selector: "monkey-suffix", inputs: { _hasAction: ["hasAction", "_hasAction"] }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.has-action": "hasAction" } }, ngImport: i0 }); }
|
|
1931
1883
|
}
|
|
1932
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type:
|
|
1933
|
-
type:
|
|
1884
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeySuffixDirective, decorators: [{
|
|
1885
|
+
type: Directive,
|
|
1934
1886
|
args: [{
|
|
1935
|
-
|
|
1887
|
+
selector: 'monkey-suffix',
|
|
1888
|
+
host: {
|
|
1889
|
+
'[class.has-action]': 'hasAction'
|
|
1890
|
+
},
|
|
1891
|
+
standalone: false
|
|
1892
|
+
}]
|
|
1893
|
+
}], propDecorators: { _hasAction: [{
|
|
1894
|
+
type: Input,
|
|
1895
|
+
args: ['hasAction']
|
|
1896
|
+
}], onClick: [{
|
|
1897
|
+
type: HostListener,
|
|
1898
|
+
args: ['click', ['$event']]
|
|
1899
|
+
}] } });
|
|
1900
|
+
|
|
1901
|
+
/** ************************
|
|
1902
|
+
* Copyright Monkey Exchange. All Rights Reserved
|
|
1903
|
+
* This style guide was developed by Monkey Exchange Team
|
|
1904
|
+
* MIT Licence
|
|
1905
|
+
************************* */
|
|
1906
|
+
class MonkeyDirectivesModule {
|
|
1907
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1908
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.14", ngImport: i0, type: MonkeyDirectivesModule, declarations: [MonkeyErrorDirective,
|
|
1909
|
+
MonkeyHelperDirective,
|
|
1910
|
+
MonkeyInfoDirective,
|
|
1911
|
+
MonkeyLabelDirective,
|
|
1912
|
+
MonkeyDisplayDirective,
|
|
1913
|
+
MonkeyPrefixDirective,
|
|
1914
|
+
MonkeySuffixDirective,
|
|
1915
|
+
MonkeyBadgeDirective,
|
|
1916
|
+
MonkeyPopoverDirective], imports: [MonkeyPopoverContentComponent], exports: [MonkeyErrorDirective,
|
|
1917
|
+
MonkeyHelperDirective,
|
|
1918
|
+
MonkeyInfoDirective,
|
|
1919
|
+
MonkeyLabelDirective,
|
|
1920
|
+
MonkeyDisplayDirective,
|
|
1921
|
+
MonkeyPrefixDirective,
|
|
1922
|
+
MonkeySuffixDirective,
|
|
1923
|
+
MonkeyBadgeDirective,
|
|
1924
|
+
MonkeyPopoverDirective] }); }
|
|
1925
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyDirectivesModule, imports: [MonkeyPopoverContentComponent] }); }
|
|
1926
|
+
}
|
|
1927
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MonkeyDirectivesModule, decorators: [{
|
|
1928
|
+
type: NgModule,
|
|
1929
|
+
args: [{
|
|
1930
|
+
imports: [MonkeyPopoverContentComponent],
|
|
1931
|
+
declarations: [
|
|
1932
|
+
MonkeyErrorDirective,
|
|
1933
|
+
MonkeyHelperDirective,
|
|
1934
|
+
MonkeyInfoDirective,
|
|
1935
|
+
MonkeyLabelDirective,
|
|
1936
|
+
MonkeyDisplayDirective,
|
|
1937
|
+
MonkeyPrefixDirective,
|
|
1938
|
+
MonkeySuffixDirective,
|
|
1939
|
+
MonkeyBadgeDirective,
|
|
1940
|
+
MonkeyPopoverDirective
|
|
1941
|
+
],
|
|
1942
|
+
exports: [
|
|
1943
|
+
MonkeyErrorDirective,
|
|
1944
|
+
MonkeyHelperDirective,
|
|
1945
|
+
MonkeyInfoDirective,
|
|
1946
|
+
MonkeyLabelDirective,
|
|
1947
|
+
MonkeyDisplayDirective,
|
|
1948
|
+
MonkeyPrefixDirective,
|
|
1949
|
+
MonkeySuffixDirective,
|
|
1950
|
+
MonkeyBadgeDirective,
|
|
1951
|
+
MonkeyPopoverDirective
|
|
1952
|
+
]
|
|
1936
1953
|
}]
|
|
1937
1954
|
}] });
|
|
1938
1955
|
|