@seniorsistemas/angular-components 16.10.18 → 16.11.0
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/bundles/seniorsistemas-angular-components.umd.js +4253 -4045
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/accordion/accordion.component.d.ts +15 -0
- package/components/accordion/accordion.module.d.ts +2 -0
- package/components/accordion/components/accordion-panel/accordion-panel.component.d.ts +25 -0
- package/components/accordion/index.d.ts +3 -0
- package/components/accordion/models/accordion-button-settings.d.ts +4 -0
- package/components/accordion/models/accordion-switch-settings.d.ts +4 -0
- package/esm2015/components/accordion/accordion.component.js +77 -0
- package/esm2015/components/accordion/accordion.module.js +32 -0
- package/esm2015/components/accordion/components/accordion-panel/accordion-panel.component.js +101 -0
- package/esm2015/components/accordion/index.js +4 -0
- package/esm2015/components/accordion/models/accordion-button-settings.js +1 -0
- package/esm2015/components/accordion/models/accordion-switch-settings.js +1 -0
- package/esm2015/public-api.js +2 -1
- package/esm2015/seniorsistemas-angular-components.js +7 -7
- package/esm5/components/accordion/accordion.component.js +80 -0
- package/esm5/components/accordion/accordion.module.js +35 -0
- package/esm5/components/accordion/components/accordion-panel/accordion-panel.component.js +107 -0
- package/esm5/components/accordion/index.js +4 -0
- package/esm5/components/accordion/models/accordion-button-settings.js +1 -0
- package/esm5/components/accordion/models/accordion-switch-settings.js +1 -0
- package/esm5/public-api.js +2 -1
- package/esm5/seniorsistemas-angular-components.js +7 -7
- package/fesm2015/seniorsistemas-angular-components.js +2082 -1889
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +4276 -4071
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/seniorsistemas-angular-components.d.ts +6 -6
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { __decorate, __rest, __awaiter, __param } from 'tslib';
|
|
2
|
-
import { EventEmitter, Input, Output,
|
|
2
|
+
import { EventEmitter, Input, Output, Component, ContentChildren, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, HostListener, Directive, NgModule, HostBinding, ViewChild, Renderer2, forwardRef, Pipe, ViewEncapsulation, InjectionToken, Inject, TemplateRef, ViewContainerRef, ChangeDetectorRef, Optional, ContentChild } from '@angular/core';
|
|
3
|
+
import { trigger, transition, style as style$7, animate, state, group, query, animateChild } from '@angular/animations';
|
|
3
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { FormsModule, ReactiveFormsModule, FormControl, NG_VALUE_ACCESSOR, FormGroup, NG_VALIDATORS, Validators, FormArray, ControlContainer } from '@angular/forms';
|
|
6
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
7
|
+
import { InputSwitchModule } from 'primeng/inputswitch';
|
|
4
8
|
import { RouterModule, NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router } from '@angular/router';
|
|
5
9
|
import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
|
|
6
10
|
import { Subject, of, from, forkJoin, throwError, ReplaySubject } from 'rxjs';
|
|
@@ -9,8 +13,6 @@ import { TieredMenu, TieredMenuModule } from 'primeng/tieredmenu';
|
|
|
9
13
|
import { TooltipModule as TooltipModule$1 } from 'primeng/tooltip';
|
|
10
14
|
import { DomHandler } from 'primeng/dom';
|
|
11
15
|
import { Calendar, CalendarModule } from 'primeng/calendar';
|
|
12
|
-
import { trigger, state, style as style$7, transition, animate, group, query, animateChild } from '@angular/animations';
|
|
13
|
-
import { FormsModule, ReactiveFormsModule, FormControl, NG_VALUE_ACCESSOR, FormGroup, NG_VALIDATORS, Validators, FormArray, ControlContainer } from '@angular/forms';
|
|
14
16
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
15
17
|
import { NgxMaskModule } from 'ngx-mask';
|
|
16
18
|
import { HttpClient, HttpEventType, HttpClientModule } from '@angular/common/http';
|
|
@@ -34,7 +36,6 @@ import { InputTextModule } from 'primeng/inputtext';
|
|
|
34
36
|
import { InputTextareaModule } from 'primeng/inputtextarea';
|
|
35
37
|
import { KeyFilterModule } from 'primeng/keyfilter';
|
|
36
38
|
import { MultiSelectModule } from 'primeng/multiselect';
|
|
37
|
-
import { InputSwitchModule } from 'primeng/inputswitch';
|
|
38
39
|
import { PanelModule as PanelModule$1 } from 'primeng/panel';
|
|
39
40
|
import { RadioButtonModule } from 'primeng/radiobutton';
|
|
40
41
|
import { SliderModule } from 'primeng/slider';
|
|
@@ -57,535 +58,1103 @@ import { autocompletion, pickedCompletion, startCompletion } from '@codemirror/a
|
|
|
57
58
|
import { showTooltip } from '@codemirror/tooltip';
|
|
58
59
|
import { lineNumbers } from '@codemirror/gutter';
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
(function (BadgeColors) {
|
|
62
|
-
BadgeColors["Red"] = "red";
|
|
63
|
-
BadgeColors["Orange"] = "orange";
|
|
64
|
-
BadgeColors["Yellow"] = "yellow";
|
|
65
|
-
BadgeColors["Blue"] = "blue";
|
|
66
|
-
BadgeColors["Green"] = "green";
|
|
67
|
-
BadgeColors["Gray"] = "gray";
|
|
68
|
-
})(BadgeColors || (BadgeColors = {}));
|
|
69
|
-
|
|
70
|
-
var BadgeTypes;
|
|
71
|
-
(function (BadgeTypes) {
|
|
72
|
-
BadgeTypes["Pill"] = "pill";
|
|
73
|
-
BadgeTypes["Chip"] = "chip";
|
|
74
|
-
})(BadgeTypes || (BadgeTypes = {}));
|
|
75
|
-
|
|
76
|
-
let BadgeComponent = class BadgeComponent {
|
|
61
|
+
let AccordionPanelComponent = class AccordionPanelComponent {
|
|
77
62
|
constructor() {
|
|
78
|
-
this.
|
|
79
|
-
this.
|
|
80
|
-
this.
|
|
81
|
-
this.
|
|
82
|
-
this.
|
|
63
|
+
this.disabled = false;
|
|
64
|
+
this.cache = false;
|
|
65
|
+
this.panelOpened = new EventEmitter();
|
|
66
|
+
this.panelClosed = new EventEmitter();
|
|
67
|
+
this._isOpen = false;
|
|
68
|
+
this.isAnimating = false;
|
|
69
|
+
this.isContentAnimationDisabled = true;
|
|
83
70
|
}
|
|
84
|
-
|
|
85
|
-
this.
|
|
71
|
+
get isOpen() {
|
|
72
|
+
return this._isOpen;
|
|
73
|
+
}
|
|
74
|
+
set isOpen(isOpen) {
|
|
75
|
+
this._isOpen = isOpen;
|
|
76
|
+
}
|
|
77
|
+
ngOnInit() {
|
|
78
|
+
if (this.switch) {
|
|
79
|
+
this.switchState = this.switch.state;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
ngAfterViewInit() {
|
|
83
|
+
// to executed at a safe time prior to control returning to the browser's event loop
|
|
84
|
+
queueMicrotask(() => {
|
|
85
|
+
this.isContentAnimationDisabled = false;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
onIconButtonsClick(event, callback) {
|
|
89
|
+
if (this.disabled) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
event.stopPropagation();
|
|
93
|
+
callback();
|
|
94
|
+
}
|
|
95
|
+
onTabClick() {
|
|
96
|
+
if (this.disabled || this.isAnimating) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this.isOpen = !this.isOpen;
|
|
100
|
+
}
|
|
101
|
+
onContentAnimationStart() {
|
|
102
|
+
this.isAnimating = true;
|
|
103
|
+
}
|
|
104
|
+
onContentAnimationDone() {
|
|
105
|
+
this.isAnimating = false;
|
|
106
|
+
if (this.isOpen) {
|
|
107
|
+
this.panelOpened.emit();
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
this.panelClosed.emit();
|
|
111
|
+
}
|
|
86
112
|
}
|
|
87
113
|
};
|
|
88
114
|
__decorate([
|
|
89
115
|
Input()
|
|
90
|
-
],
|
|
91
|
-
__decorate([
|
|
92
|
-
Input()
|
|
93
|
-
], BadgeComponent.prototype, "color", void 0);
|
|
116
|
+
], AccordionPanelComponent.prototype, "header", void 0);
|
|
94
117
|
__decorate([
|
|
95
118
|
Input()
|
|
96
|
-
],
|
|
119
|
+
], AccordionPanelComponent.prototype, "buttons", void 0);
|
|
97
120
|
__decorate([
|
|
98
121
|
Input()
|
|
99
|
-
],
|
|
122
|
+
], AccordionPanelComponent.prototype, "disabled", void 0);
|
|
100
123
|
__decorate([
|
|
101
124
|
Input()
|
|
102
|
-
],
|
|
125
|
+
], AccordionPanelComponent.prototype, "switch", void 0);
|
|
103
126
|
__decorate([
|
|
104
127
|
Input()
|
|
105
|
-
],
|
|
128
|
+
], AccordionPanelComponent.prototype, "validationMessage", void 0);
|
|
106
129
|
__decorate([
|
|
107
130
|
Input()
|
|
108
|
-
],
|
|
131
|
+
], AccordionPanelComponent.prototype, "cache", void 0);
|
|
109
132
|
__decorate([
|
|
110
133
|
Output()
|
|
111
|
-
],
|
|
134
|
+
], AccordionPanelComponent.prototype, "panelOpened", void 0);
|
|
112
135
|
__decorate([
|
|
113
|
-
|
|
114
|
-
],
|
|
115
|
-
|
|
136
|
+
Output()
|
|
137
|
+
], AccordionPanelComponent.prototype, "panelClosed", void 0);
|
|
138
|
+
AccordionPanelComponent = __decorate([
|
|
116
139
|
Component({
|
|
117
|
-
selector: "s-
|
|
118
|
-
template: "<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
],
|
|
131
|
-
declarations: [BadgeComponent],
|
|
132
|
-
exports: [
|
|
133
|
-
BadgeComponent,
|
|
134
|
-
RouterModule,
|
|
140
|
+
selector: "s-accordion-panel",
|
|
141
|
+
template: "<div\n class=\"accordion-panel\"\n [ngClass]=\"{\n 'accordion-panel--open': isOpen,\n 'accordion-panel--disabled': disabled\n }\">\n <div class=\"header\" (click)=\"onTabClick()\">\n <div class=\"header__title\">\n <span class=\"icon\" [ngClass]=\"isOpen ? 'fas fa-minus' : 'fas fa-plus'\"></span>\n <span\n *ngIf=\"validationMessage\"\n class=\"exclamation-icon fas fa-exclamation-circle\"\n [sTooltip]=\"validationMessage\">\n </span>\n <span class=\"title\">{{ header }}</span>\n </div>\n <div class=\"header__controls\">\n <button\n *ngFor=\"let button of buttons\"\n class=\"icon-button\"\n [ngClass]=\"button.icon\"\n (click)=\"onIconButtonsClick($event, button.onClick)\">\n </button>\n <p-inputSwitch\n *ngIf=\"switch\"\n class=\"switch\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"switchState\"\n (click)=\"$event.stopPropagation()\"\n (onChange)=\"switch.onChange($event)\">\n </p-inputSwitch>\n </div>\n </div>\n <ng-container *ngIf=\"cache; then thenBlock else elseBlock\"></ng-container>\n</div>\n\n<ng-template #thenBlock>\n <div\n class=\"content\"\n [hidden]=\"!isOpen\"\n @contentAnimation\n [@.disabled]=\"isContentAnimationDisabled\"\n (@contentAnimation.start)=\"onContentAnimationStart()\"\n (@contentAnimation.done)=\"onContentAnimationDone()\">\n <div class=\"content-container\">\n <ng-content></ng-content>\n </div>\n </div>\n</ng-template>\n\n<ng-template #elseBlock>\n <div\n *ngIf=\"isOpen\"\n class=\"content\"\n @contentAnimation\n [@.disabled]=\"isContentAnimationDisabled\" \n (@contentAnimation.start)=\"onContentAnimationStart()\"\n (@contentAnimation.done)=\"onContentAnimationDone()\">\n <div class=\"content-container\">\n <ng-content></ng-content>\n </div>\n </div>\n</ng-template>",
|
|
142
|
+
animations: [
|
|
143
|
+
trigger("contentAnimation", [
|
|
144
|
+
transition(":enter", [
|
|
145
|
+
style$7({ height: "0" }),
|
|
146
|
+
animate("200ms linear", style$7({ height: "*" })),
|
|
147
|
+
]),
|
|
148
|
+
transition(":leave", [
|
|
149
|
+
style$7({ height: "*" }),
|
|
150
|
+
animate("200ms linear", style$7({ height: "0" })),
|
|
151
|
+
]),
|
|
152
|
+
]),
|
|
135
153
|
],
|
|
154
|
+
styles: [".accordion-panel{border-bottom:1px solid #c1c1cc}.accordion-panel .header{-ms-flex-align:center;align-items:center;background-color:#fff;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:16px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.accordion-panel .header .header__title{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.accordion-panel .header .header__title .icon{color:#212533;font-size:1rem;margin-right:12px}.accordion-panel .header .header__title .exclamation-icon{color:#c13018;font-size:1rem;margin-right:12px}.accordion-panel .header .header__title .title{font-family:\"Open Sans\" sans-serif;font-size:.875rem;font-weight:700;line-height:150%;text-transform:uppercase}.accordion-panel .header .header__controls{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;margin-left:16px}.accordion-panel .header .header__controls .icon-button{color:#212533;cursor:pointer;font-size:1rem;margin-left:16px;border:none;background:0 0}.accordion-panel .header .header__controls .switch{padding-left:16px}.accordion-panel .content{background-color:#fff;overflow:hidden}.accordion-panel .content .content-container{margin:20px}.accordion-panel--open .header{background-color:#eeebf2;border-bottom:1px solid #c1c1cc}.accordion-panel--disabled .header{cursor:auto}.accordion-panel--disabled .header .header__title .icon,.accordion-panel--disabled .header .header__title .title{color:#c1c1cc}.accordion-panel--disabled .header .header__controls .icon-button{color:#c1c1cc;cursor:auto}"]
|
|
136
155
|
})
|
|
137
|
-
],
|
|
156
|
+
], AccordionPanelComponent);
|
|
138
157
|
|
|
139
|
-
let
|
|
140
|
-
constructor(
|
|
141
|
-
this.
|
|
142
|
-
this.
|
|
143
|
-
this.targetHomeUrl = "_self";
|
|
144
|
-
this.ngUnsubscribe = new Subject();
|
|
145
|
-
this.router.events
|
|
146
|
-
.pipe(takeUntil(this.ngUnsubscribe), filter(event => event instanceof NavigationEnd))
|
|
147
|
-
.subscribe(() => this.onNavigationEnd());
|
|
148
|
-
}
|
|
149
|
-
onNavigationEnd() {
|
|
150
|
-
const currentRoute = this.activatedRoute.root;
|
|
151
|
-
const validRoutes = this.getValidChildren(currentRoute);
|
|
152
|
-
this.title = this.getCurrentTitle(validRoutes);
|
|
153
|
-
this.home = this.getCurrentHome(validRoutes);
|
|
154
|
-
this.items = this.getCurrentItems(validRoutes);
|
|
155
|
-
}
|
|
156
|
-
getValidChildren(route) {
|
|
157
|
-
const valid = route.routeConfig && route.routeConfig.path && route.routeConfig.component && route.outlet === PRIMARY_OUTLET;
|
|
158
|
-
return route.children.reduce((validRoutes, child) => [...validRoutes, ...this.getValidChildren(child)], valid ? [route] : []);
|
|
158
|
+
let AccordionComponent = class AccordionComponent {
|
|
159
|
+
constructor() {
|
|
160
|
+
this.multiple = false;
|
|
161
|
+
this._panels = [];
|
|
159
162
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
163
|
+
ngAfterContentInit() {
|
|
164
|
+
this._panels = this.panelsComponents.toArray();
|
|
165
|
+
this._openSubs = new Array(this._panels.length);
|
|
166
|
+
this._setupTabs();
|
|
164
167
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
ngOnChanges(changes) {
|
|
169
|
+
if (changes.multiple) {
|
|
170
|
+
if (changes.multiple.currentValue) {
|
|
171
|
+
this._enableMultiplePanelBehavior();
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
this._enableSinglePanelBehavior();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
172
177
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
_setupTabs() {
|
|
179
|
+
var _a;
|
|
180
|
+
if ((_a = this._panels) === null || _a === void 0 ? void 0 : _a.length) {
|
|
181
|
+
if (this.activeIndex !== undefined && this.activeIndex !== null) {
|
|
182
|
+
const activeTab = this._panels[this.activeIndex];
|
|
183
|
+
if (!activeTab) {
|
|
184
|
+
throw new Error("activeIndex does not represent any panel.");
|
|
185
|
+
}
|
|
186
|
+
if (!activeTab.disabled) {
|
|
187
|
+
this._panels[this.activeIndex].isOpen = true;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
179
191
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return {
|
|
187
|
-
label,
|
|
188
|
-
routerLink,
|
|
189
|
-
queryParams: route.snapshot.queryParams,
|
|
190
|
-
routerLinkActiveOptions: { exact: true },
|
|
191
|
-
disabled,
|
|
192
|
-
};
|
|
192
|
+
_closeOtherTabs(exception) {
|
|
193
|
+
this._panels.forEach((panel, index) => {
|
|
194
|
+
if (index !== exception) {
|
|
195
|
+
panel.isOpen = false;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
193
198
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
_enableSinglePanelBehavior() {
|
|
200
|
+
this._panels.forEach((panel, index) => {
|
|
201
|
+
this._openSubs[index] = panel.panelOpened.subscribe(() => {
|
|
202
|
+
this._closeOtherTabs(index);
|
|
203
|
+
});
|
|
204
|
+
});
|
|
200
205
|
}
|
|
201
|
-
|
|
202
|
-
this.
|
|
203
|
-
|
|
206
|
+
_enableMultiplePanelBehavior() {
|
|
207
|
+
this._panels.forEach((_, index) => {
|
|
208
|
+
if (this._openSubs[index]) {
|
|
209
|
+
this._openSubs[index].unsubscribe();
|
|
210
|
+
}
|
|
211
|
+
});
|
|
204
212
|
}
|
|
205
213
|
};
|
|
206
|
-
BreadcrumbComponent.ctorParameters = () => [
|
|
207
|
-
{ type: ActivatedRoute },
|
|
208
|
-
{ type: Router }
|
|
209
|
-
];
|
|
210
214
|
__decorate([
|
|
211
215
|
Input()
|
|
212
|
-
],
|
|
216
|
+
], AccordionComponent.prototype, "activeIndex", void 0);
|
|
213
217
|
__decorate([
|
|
214
218
|
Input()
|
|
215
|
-
],
|
|
216
|
-
|
|
219
|
+
], AccordionComponent.prototype, "multiple", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
ContentChildren(AccordionPanelComponent)
|
|
222
|
+
], AccordionComponent.prototype, "panelsComponents", void 0);
|
|
223
|
+
AccordionComponent = __decorate([
|
|
217
224
|
Component({
|
|
218
|
-
selector:
|
|
219
|
-
template: "<
|
|
225
|
+
selector: "s-accordion",
|
|
226
|
+
template: "<div class=\"accordion\">\n <ng-content></ng-content>\n</div>",
|
|
227
|
+
styles: [".accordion{border:1px solid #c1c1cc;border-radius:6px;overflow:hidden}"]
|
|
220
228
|
})
|
|
221
|
-
],
|
|
229
|
+
], AccordionComponent);
|
|
222
230
|
|
|
223
|
-
|
|
231
|
+
var TooltipPosition;
|
|
232
|
+
(function (TooltipPosition) {
|
|
233
|
+
TooltipPosition["Top"] = "top";
|
|
234
|
+
TooltipPosition["Bottom"] = "bottom";
|
|
235
|
+
TooltipPosition["Left"] = "left";
|
|
236
|
+
TooltipPosition["Right"] = "right";
|
|
237
|
+
})(TooltipPosition || (TooltipPosition = {}));
|
|
238
|
+
|
|
239
|
+
let TooltipComponent = class TooltipComponent {
|
|
240
|
+
constructor() {
|
|
241
|
+
this.tooltip = "";
|
|
242
|
+
this.position = TooltipPosition.Top;
|
|
243
|
+
this.left = 0;
|
|
244
|
+
this.top = 0;
|
|
245
|
+
this.visible = false;
|
|
246
|
+
this.escape = false;
|
|
247
|
+
}
|
|
224
248
|
};
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
exports: [BreadcrumbComponent, RouterModule],
|
|
249
|
+
TooltipComponent = __decorate([
|
|
250
|
+
Component({
|
|
251
|
+
template: "<div\n class=\"tooltip\"\n [ngClass]=\"['tooltip--' + position]\"\n [class.tooltip--visible]=\"visible\"\n [ngStyle]=\"{\n 'left': left + 'px',\n 'top': top + 'px'\n }\">\n <ng-template\n *ngIf=\"escape;\n then escapeTemplate;\n else noEscapeTemplate\">\n </ng-template> \n</div>\n\n<ng-template #noEscapeTemplate>\n <span\n class=\"tooltip__content\"\n [innerHTML]=\"tooltip\">\n </span>\n</ng-template>\n\n<ng-template #escapeTemplate>\n <span class=\"tooltip__content\">\n {{ tooltip }}\n </span>\n</ng-template>",
|
|
252
|
+
styles: [".tooltip{background-color:#000;border-radius:2px;color:#fff;font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:400;line-height:21px;margin-top:5px;opacity:0;padding:8px;position:fixed;transform:translateX(-50%);text-align:center;max-width:150px;word-wrap:break-word;z-index:99999}.tooltip--visible{opacity:1;transition:opacity .3s}.tooltip::before{content:\"\";height:0;position:absolute;width:0}.tooltip--bottom{margin-top:8px;transform:translateX(-50%)}.tooltip--bottom::before{border:5px solid transparent;border-bottom:5px solid #000;left:calc(50% - 5px);top:-10px}.tooltip--top{margin-bottom:8px;transform:translate(-50%,-100%)}.tooltip--top::before{border:5px solid transparent;border-top:5px solid #000;left:calc(50% - 5px);bottom:-10px}.tooltip--left{margin-right:28px;transform:translate(calc(-100% - 7px),-50%)}.tooltip--left::before{border:5px solid transparent;border-left:5px solid #000;right:-10px;bottom:calc(50% - 5px)}.tooltip--right{margin-left:7px;transform:translateY(-50%)}.tooltip--right::before{border:5px solid transparent;border-right:5px solid #000;left:-10px;bottom:calc(50% - 5px)}"]
|
|
230
253
|
})
|
|
231
|
-
],
|
|
254
|
+
], TooltipComponent);
|
|
232
255
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
256
|
+
const DEFAULT_TIMER = 300;
|
|
257
|
+
let DebounceUtils = class DebounceUtils {
|
|
258
|
+
debounce(func, timeout = DEFAULT_TIMER) {
|
|
259
|
+
let timer;
|
|
260
|
+
return (...args) => {
|
|
261
|
+
clearTimeout(timer);
|
|
262
|
+
timer = setTimeout(() => {
|
|
263
|
+
func.apply(this, args);
|
|
264
|
+
}, timeout);
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
debounceLeading(func, timeout = DEFAULT_TIMER) {
|
|
268
|
+
let timer;
|
|
269
|
+
return (...args) => {
|
|
270
|
+
if (!timer) {
|
|
271
|
+
func.apply(this, args);
|
|
272
|
+
}
|
|
273
|
+
clearTimeout(timer);
|
|
274
|
+
timer = setTimeout(() => {
|
|
275
|
+
timer = null;
|
|
276
|
+
}, timeout);
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
DebounceUtils.ɵprov = ɵɵdefineInjectable({ factory: function DebounceUtils_Factory() { return new DebounceUtils(); }, token: DebounceUtils, providedIn: "root" });
|
|
281
|
+
DebounceUtils = __decorate([
|
|
282
|
+
Injectable({
|
|
283
|
+
providedIn: 'root',
|
|
284
|
+
})
|
|
285
|
+
], DebounceUtils);
|
|
240
286
|
|
|
241
|
-
var
|
|
242
|
-
(function (
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
})(
|
|
287
|
+
var MobileBehavior;
|
|
288
|
+
(function (MobileBehavior) {
|
|
289
|
+
MobileBehavior["Pressing"] = "pressing";
|
|
290
|
+
MobileBehavior["Tap"] = "tap";
|
|
291
|
+
})(MobileBehavior || (MobileBehavior = {}));
|
|
246
292
|
|
|
247
|
-
var
|
|
248
|
-
(function (
|
|
249
|
-
|
|
250
|
-
|
|
293
|
+
var TooltipEvent;
|
|
294
|
+
(function (TooltipEvent) {
|
|
295
|
+
TooltipEvent["Focus"] = "focus";
|
|
296
|
+
TooltipEvent["Hover"] = "hover";
|
|
297
|
+
})(TooltipEvent || (TooltipEvent = {}));
|
|
251
298
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
this.
|
|
256
|
-
this.
|
|
257
|
-
this.
|
|
258
|
-
this.
|
|
259
|
-
this.
|
|
260
|
-
this.
|
|
261
|
-
this.
|
|
262
|
-
this.
|
|
263
|
-
this.
|
|
264
|
-
this.
|
|
265
|
-
this.
|
|
299
|
+
let TooltipDirective = class TooltipDirective {
|
|
300
|
+
constructor(elementRef, appRef, componentFactoryResolver, injector, debounceUtils) {
|
|
301
|
+
this.elementRef = elementRef;
|
|
302
|
+
this.appRef = appRef;
|
|
303
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
304
|
+
this.injector = injector;
|
|
305
|
+
this.debounceUtils = debounceUtils;
|
|
306
|
+
this.position = TooltipPosition.Top;
|
|
307
|
+
this.showDelay = 500;
|
|
308
|
+
this.tooltipEvent = TooltipEvent.Hover;
|
|
309
|
+
this.escape = false;
|
|
310
|
+
this.visible = true;
|
|
311
|
+
this.mobileBehavior = MobileBehavior.Pressing;
|
|
312
|
+
this.componentRef = null;
|
|
313
|
+
this.boundOnWindowMouseMoveFunction = this.onWindowMouseMove.bind(this);
|
|
314
|
+
this.debounceCreateTooltipFunction = this.debounceUtils.debounceLeading(() => this.createTootip());
|
|
266
315
|
}
|
|
267
316
|
ngOnInit() {
|
|
268
|
-
this.
|
|
269
|
-
if (!this.model || !this.model.length)
|
|
270
|
-
return;
|
|
271
|
-
this.menu.model = this.model;
|
|
272
|
-
this.menu.toggle(event);
|
|
273
|
-
});
|
|
317
|
+
this.validatePosition();
|
|
274
318
|
}
|
|
275
|
-
|
|
276
|
-
|
|
319
|
+
ngOnDestroy() {
|
|
320
|
+
this.destroy();
|
|
277
321
|
}
|
|
278
|
-
|
|
279
|
-
|
|
322
|
+
onWindowMouseMove(event) {
|
|
323
|
+
if (!this.componentRef) {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
const elementRect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
327
|
+
const toolTipRect = this.tooltipDivElement.getBoundingClientRect();
|
|
328
|
+
const totalElementArea = {
|
|
329
|
+
top: Math.min(elementRect.top, toolTipRect.top),
|
|
330
|
+
right: Math.max(elementRect.right, toolTipRect.right),
|
|
331
|
+
left: Math.min(elementRect.left, toolTipRect.left),
|
|
332
|
+
bottom: Math.max(elementRect.bottom, toolTipRect.bottom)
|
|
333
|
+
};
|
|
334
|
+
if (this.isMousePositionOutsideOfElement(event.clientX, event.clientY, totalElementArea)) {
|
|
335
|
+
this.destroy();
|
|
336
|
+
}
|
|
280
337
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
const hasText = this.label;
|
|
284
|
-
const isMultiple = this.model && this.model.length;
|
|
285
|
-
if (hasText || (hasIcon && isMultiple))
|
|
286
|
-
this.minWidth = "80px";
|
|
287
|
-
if (hasText && hasIcon && isMultiple)
|
|
288
|
-
this.minWidth = "100px";
|
|
338
|
+
isMousePositionOutsideOfElement(mouseX, mouseY, elementArea) {
|
|
339
|
+
return mouseX < elementArea.left || mouseX >= elementArea.right || mouseY < elementArea.top || mouseY >= elementArea.bottom;
|
|
289
340
|
}
|
|
290
|
-
|
|
291
|
-
|
|
341
|
+
// whenever the component with the tooltip is clicked I destroy the tooltip.
|
|
342
|
+
// whenever a key is pressed on the component with the tooltip I destroy the tooltip.
|
|
343
|
+
onClick() {
|
|
344
|
+
if (this.tooltipEvent === TooltipEvent.Hover &&
|
|
345
|
+
!navigator.userAgent.match(/Android/i) &&
|
|
346
|
+
!navigator.userAgent.match(/iPhone/i)) {
|
|
347
|
+
this.destroy();
|
|
348
|
+
}
|
|
292
349
|
}
|
|
293
|
-
|
|
294
|
-
|
|
350
|
+
// whenever you touch outside the component with the tooltip I destroy the tooltip.
|
|
351
|
+
onDocumentTouchStart() {
|
|
352
|
+
if (this.tooltipEvent === TooltipEvent.Hover) {
|
|
353
|
+
this.destroy();
|
|
354
|
+
}
|
|
295
355
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
], ButtonComponent.prototype, "minWidth", void 0);
|
|
301
|
-
__decorate([
|
|
302
|
-
Input()
|
|
303
|
-
], ButtonComponent.prototype, "id", void 0);
|
|
304
|
-
__decorate([
|
|
305
|
-
Input()
|
|
306
|
-
], ButtonComponent.prototype, "label", void 0);
|
|
307
|
-
__decorate([
|
|
308
|
-
Input()
|
|
309
|
-
], ButtonComponent.prototype, "tooltip", void 0);
|
|
310
|
-
__decorate([
|
|
311
|
-
Input()
|
|
312
|
-
], ButtonComponent.prototype, "iconClass", void 0);
|
|
313
|
-
__decorate([
|
|
314
|
-
Input()
|
|
315
|
-
], ButtonComponent.prototype, "rightIconClass", void 0);
|
|
316
|
-
__decorate([
|
|
317
|
-
Input()
|
|
318
|
-
], ButtonComponent.prototype, "caret", void 0);
|
|
319
|
-
__decorate([
|
|
320
|
-
Input()
|
|
321
|
-
], ButtonComponent.prototype, "styleClass", void 0);
|
|
322
|
-
__decorate([
|
|
323
|
-
Input()
|
|
324
|
-
], ButtonComponent.prototype, "baseZIndex", void 0);
|
|
325
|
-
__decorate([
|
|
326
|
-
Input()
|
|
327
|
-
], ButtonComponent.prototype, "disabled", void 0);
|
|
328
|
-
__decorate([
|
|
329
|
-
Input()
|
|
330
|
-
], ButtonComponent.prototype, "auxiliary", void 0);
|
|
331
|
-
__decorate([
|
|
332
|
-
Input()
|
|
333
|
-
], ButtonComponent.prototype, "type", void 0);
|
|
334
|
-
__decorate([
|
|
335
|
-
Input()
|
|
336
|
-
], ButtonComponent.prototype, "priority", void 0);
|
|
337
|
-
__decorate([
|
|
338
|
-
Input()
|
|
339
|
-
], ButtonComponent.prototype, "model", void 0);
|
|
340
|
-
__decorate([
|
|
341
|
-
Input()
|
|
342
|
-
], ButtonComponent.prototype, "size", void 0);
|
|
343
|
-
__decorate([
|
|
344
|
-
Input()
|
|
345
|
-
], ButtonComponent.prototype, "slide", void 0);
|
|
346
|
-
__decorate([
|
|
347
|
-
Input()
|
|
348
|
-
], ButtonComponent.prototype, "animation", void 0);
|
|
349
|
-
__decorate([
|
|
350
|
-
Output()
|
|
351
|
-
], ButtonComponent.prototype, "onClick", void 0);
|
|
352
|
-
__decorate([
|
|
353
|
-
ViewChild(TieredMenu, { static: true })
|
|
354
|
-
], ButtonComponent.prototype, "menu", void 0);
|
|
355
|
-
ButtonComponent = ButtonComponent_1 = __decorate([
|
|
356
|
-
Component({
|
|
357
|
-
selector: "s-button",
|
|
358
|
-
template: "<p-tieredMenu [id]=\"id + '-menu'\" [popup]=\"true\" appendTo=\"body\" [baseZIndex]=\"baseZIndex\"></p-tieredMenu>\n\n<button\n [id]=\"id\"\n [type]=\"type\"\n [class]=\"styleClass\"\n [ngClass]=\"{\n 's-button-auxiliary': auxiliary,\n 's-button-with-icon': iconClass,\n 's-button-with-text': label,\n 's-button-empty': !iconClass && !label,\n 's-button-size-default': size === 'default',\n 's-button-size-small': size === 'small',\n 's-button-priority-default': priority === 'default',\n 's-button-priority-primary': priority === 'primary',\n 's-button-priority-secondary': priority === 'secondary',\n 's-button-priority-link': priority === 'link',\n 's-button-multiple': (caret && (model && model.length)) || rightIconClass,\n 's-button-active': isOpen(),\n 's-button--slide': validateSlideButton(),\n 's-button--rotate-animation': isRotateAnimation()\n }\"\n [disabled]=\"disabled\"\n [pTooltip]=\"tooltip\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [tooltipZIndex]=\"tooltipZIndex\"\n (click)=\"onClick.emit($event)\"\n (mouseenter)=\"updateTooltipZIndex()\"\n>\n <span \n *ngIf=\"iconClass\" \n [class]=\"iconClass\" \n [ngClass]=\"{ \n 's-button-icon': true,\n 's-button-icon-margin-right': !label && model && model.length\n }\" \n aria-hidden=\"true\">\n </span>\n <span \n *ngIf=\"label\" \n class=\"s-button-text\"\n [ngClass]=\"{\n 's-button-icon-margin-right': !!rightIconClass || (model && model.length),\n 's-button-icon-margin-left': !!iconClass\n }\">\n {{ label }}\n </span>\n <ng-content></ng-content>\n <span \n *ngIf=\"rightIconClass\" \n [class]=\"rightIconClass\" \n [ngClass]=\"{ 's-button-right-icon': true }\" \n aria-hidden=\"true\">\n </span>\n <span\n *ngIf=\"caret && (model && model.length)\" \n class=\"fa fa-fw fa-caret-down\"\n aria-hidden=\"true\">\n </span>\n</button>\n",
|
|
359
|
-
styles: ["button{-ms-flex-align:center;align-items:center;border-radius:4px;border:1px solid;cursor:pointer;font-family:\"Open Sans\",sans-serif;font-size:14px;height:34px;max-width:100%;min-width:40px;outline:0;overflow:visible;padding:5px 10px;position:relative;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;text-decoration:none;text-transform:none;vertical-align:bottom;transition:background-color .2s ease-out,color .2s ease-out,border-color .2s ease-out}button:disabled{opacity:.5;filter:Alpha(Opacity=50);background-image:none}button:disabled,button:disabled *{cursor:text!important}button.s-button-auxiliary{border-radius:20px}button.s-button-size-small{padding:0 20px;height:25px}button.s-button-with-icon.s-button-multiple,button.s-button-with-text{min-width:80px}button.s-button-with-icon.s-button-with-text.s-button-multiple{min-width:100px}button .s-button-icon,button .s-button-menu-icon,button .s-button-right-icon,button.s-button-with-icon.s-button-multiple:not(.s-button-with-text) .s-button-icon{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}button.s-button-multiple .s-button-text{display:-ms-flexbox;display:flex;-ms-flex-pack:left;justify-content:left;-ms-flex-align:left;align-items:left}button.s-button-with-icon .s-button-text{display:-ms-flexbox;display:flex;-ms-flex-pack:right;justify-content:right;-ms-flex-align:right;align-items:right}.s-button-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.s-button-menu-icon{right:10px;transition:transform .2s ease-out}.s-button-icon-margin-left{margin-left:10px}.s-button-icon-margin-right{margin-right:10px}.s-button-active .s-button-menu-icon{transform:rotateX(180deg)}button,button.s-button-priority-primary{background-color:#428bca;border-color:#428bca}button .s-button-icon,button .s-button-menu-icon,button .s-button-right-icon,button .s-button-text,button.s-button-priority-primary .s-button-icon,button.s-button-priority-primary .s-button-menu-icon,button.s-button-priority-primary .s-button-right-icon,button.s-button-priority-primary .s-button-text{color:#fff}button.s-button-priority-primary:hover,button:hover{background-color:#2a6496}button.s-button-priority-primary:focus,button:focus{background-color:#2a6496;border-color:#22dce6}button.s-button-active:not(:disabled),button.s-button-priority-primary.s-button-active:not(:disabled),button.s-button-priority-primary:active:not(:disabled),button:active:not(:disabled){background-color:#245682;border-color:#245682}button.s-button-priority-secondary{background-color:#7892a1;border-color:#7892a1}button.s-button-priority-secondary .s-button-icon,button.s-button-priority-secondary .s-button-menu-icon,button.s-button-priority-secondary .s-button-right-icon,button.s-button-priority-secondary .s-button-text{color:#fff}button.s-button-priority-secondary:hover{background-color:#546b79}button.s-button-priority-secondary:focus{background-color:#546b79;border-color:#22dce6}button.s-button-priority-secondary.s-button-active:not(:disabled),button.s-button-priority-secondary:active:not(:disabled){background-color:#495e6a;border-color:#495e6a}button.s-button-priority-default{background-color:#fff;border-color:#ccc}button.s-button-priority-default .s-button-icon,button.s-button-priority-default .s-button-menu-icon,button.s-button-priority-default .s-button-right-icon,button.s-button-priority-default .s-button-text{color:#333}button.s-button-priority-default:hover{background-color:#d9d9d9}button.s-button-priority-default:focus{background-color:#d9d9d9;border-color:#22dce6}button.s-button-priority-default.s-button-active:not(:disabled),button.s-button-priority-default:active:not(:disabled){background-color:#ccc;border-color:#ccc}button.s-button-priority-link{background-color:transparent;border-color:transparent}button.s-button-priority-link .s-button-icon,button.s-button-priority-link .s-button-menu-icon,button.s-button-priority-link .s-button-right-icon,button.s-button-priority-link .s-button-text{color:#428bca}button.s-button-priority-link:hover{background-color:transparent}button.s-button-priority-link:hover .s-button-icon,button.s-button-priority-link:hover .s-button-menu-icon,button.s-button-priority-link:hover .s-button-right-icon,button.s-button-priority-link:hover .s-button-text{color:#2a6496}button.s-button-priority-link:focus{border-color:#22dce6;background-color:transparent}button.s-button-priority-link:focus .s-button-icon,button.s-button-priority-link:focus .s-button-menu-icon,button.s-button-priority-link:focus .s-button-right-icon,button.s-button-priority-link:focus .s-button-text{color:#2a6496}button.s-button-priority-link.s-button-active:not(:disabled),button.s-button-priority-link:active:not(:disabled){background-color:transparent;border-color:transparent}button.s-button-priority-link.s-button-active:not(:disabled) .s-button-icon,button.s-button-priority-link.s-button-active:not(:disabled) .s-button-menu-icon,button.s-button-priority-link.s-button-active:not(:disabled) .s-button-right-icon,button.s-button-priority-link.s-button-active:not(:disabled) .s-button-text,button.s-button-priority-link:active:not(:disabled) .s-button-icon,button.s-button-priority-link:active:not(:disabled) .s-button-menu-icon,button.s-button-priority-link:active:not(:disabled) .s-button-right-icon,button.s-button-priority-link:active:not(:disabled) .s-button-text{color:#245682}.s-button--slide.s-button-with-icon.s-button-multiple,.s-button--slide.s-button-with-text{min-width:40px}.s-button--slide .s-button-text{position:absolute;opacity:0;width:0}.s-button--slide:hover .s-button-text{transition:1s;position:relative;opacity:1;width:auto}.s-button--slide:hover.s-button--rotate-animation .s-button-icon,.s-button--slide:hover.s-button--rotate-animation .s-button-right-icon{transition:1.5s;transform:rotate(360deg)}"]
|
|
360
|
-
})
|
|
361
|
-
], ButtonComponent);
|
|
362
|
-
|
|
363
|
-
let ButtonModule = class ButtonModule {
|
|
364
|
-
};
|
|
365
|
-
ButtonModule = __decorate([
|
|
366
|
-
NgModule({
|
|
367
|
-
imports: [CommonModule, RouterModule, TieredMenuModule, TooltipModule$1],
|
|
368
|
-
declarations: [ButtonComponent],
|
|
369
|
-
exports: [ButtonComponent],
|
|
370
|
-
})
|
|
371
|
-
], ButtonModule);
|
|
372
|
-
|
|
373
|
-
let CalendarMaskDirective = class CalendarMaskDirective {
|
|
374
|
-
constructor(host, renderer) {
|
|
375
|
-
this.host = host;
|
|
376
|
-
this.renderer = renderer;
|
|
377
|
-
this.SELECTORS = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
378
|
-
this.slotChar = "_";
|
|
379
|
-
this.autoClear = false;
|
|
380
|
-
this.firstTime = true;
|
|
356
|
+
onFocus() {
|
|
357
|
+
if (this.tooltipEvent === TooltipEvent.Focus) {
|
|
358
|
+
this.createTootip();
|
|
359
|
+
}
|
|
381
360
|
}
|
|
382
|
-
|
|
383
|
-
this.
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
this.onInputFocus();
|
|
387
|
-
});
|
|
388
|
-
this.blurListener = this.renderer.listen(this.input, "blur", (event) => {
|
|
389
|
-
this.onInputBlur(event);
|
|
390
|
-
});
|
|
391
|
-
this.keydownListener = this.renderer.listen(this.input, "keydown", (event) => {
|
|
392
|
-
this.onKeyDown(event);
|
|
393
|
-
});
|
|
394
|
-
this.keypressListener = this.renderer.listen(this.input, "keypress", (event) => {
|
|
395
|
-
this.onKeyPress(event);
|
|
396
|
-
});
|
|
397
|
-
this.inputListener = this.renderer.listen(this.input, "input", (event) => {
|
|
398
|
-
this.onInputChange(event);
|
|
399
|
-
});
|
|
400
|
-
this.pasteListener = this.renderer.listen(this.input, "paste", (event) => {
|
|
401
|
-
this.handleInputChange(event);
|
|
402
|
-
});
|
|
361
|
+
onBlur() {
|
|
362
|
+
if (this.tooltipEvent === TooltipEvent.Focus) {
|
|
363
|
+
this.destroy();
|
|
364
|
+
}
|
|
403
365
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
this.initMask();
|
|
366
|
+
onMouseEnter() {
|
|
367
|
+
if (this.tooltipEvent === TooltipEvent.Hover) {
|
|
368
|
+
this.debounceCreateTooltipFunction();
|
|
369
|
+
}
|
|
409
370
|
}
|
|
410
|
-
|
|
411
|
-
|
|
371
|
+
onMouseLeave() {
|
|
372
|
+
if (this.tooltipEvent === TooltipEvent.Hover) {
|
|
373
|
+
this.destroy();
|
|
374
|
+
}
|
|
412
375
|
}
|
|
413
|
-
|
|
414
|
-
this.
|
|
415
|
-
|
|
416
|
-
|
|
376
|
+
onTouchStart() {
|
|
377
|
+
if (this.tooltipEvent === TooltipEvent.Hover) {
|
|
378
|
+
window.clearTimeout(this.touchTimeout);
|
|
379
|
+
this.touchTimeout = window.setTimeout(this.createTootip.bind(this), this.mobileBehavior === MobileBehavior.Pressing ? this.showDelay : 0);
|
|
380
|
+
}
|
|
417
381
|
}
|
|
418
|
-
|
|
419
|
-
this.
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
this.
|
|
423
|
-
}
|
|
424
|
-
else {
|
|
425
|
-
this.input.value = this.value;
|
|
382
|
+
onTouchEnd() {
|
|
383
|
+
if (this.tooltipEvent === TooltipEvent.Hover) {
|
|
384
|
+
if (this.mobileBehavior === MobileBehavior.Pressing) {
|
|
385
|
+
window.clearTimeout(this.touchTimeout);
|
|
386
|
+
this.destroy();
|
|
426
387
|
}
|
|
427
|
-
this.checkVal();
|
|
428
|
-
this.focusText = this.input.value;
|
|
429
|
-
this.updateFilledState();
|
|
430
388
|
}
|
|
431
389
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
}
|
|
442
|
-
this.updateModel(e);
|
|
443
|
-
const event = document.createEvent("HTMLEvents");
|
|
444
|
-
event.initEvent("change", true, false);
|
|
445
|
-
this.input.dispatchEvent(event);
|
|
390
|
+
validatePosition() {
|
|
391
|
+
const containsPosition = [
|
|
392
|
+
TooltipPosition.Top,
|
|
393
|
+
TooltipPosition.Right,
|
|
394
|
+
TooltipPosition.Bottom,
|
|
395
|
+
TooltipPosition.Left,
|
|
396
|
+
].includes(this.position);
|
|
397
|
+
if (!containsPosition) {
|
|
398
|
+
this.position = TooltipPosition.Top;
|
|
399
|
+
throw new Error(`Tooltip ${this.position} position is unexpected`);
|
|
446
400
|
}
|
|
447
401
|
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
begin = pos.begin;
|
|
462
|
-
end = pos.end;
|
|
463
|
-
if (end - begin === 0) {
|
|
464
|
-
begin = k !== 46 ? this.seekPrev(begin) : (end = this.seekNext(begin - 1));
|
|
465
|
-
end = k === 46 ? this.seekNext(end) : end;
|
|
402
|
+
createTootip() {
|
|
403
|
+
var _a;
|
|
404
|
+
if (this.componentRef === null && ((_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
405
|
+
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(TooltipComponent);
|
|
406
|
+
this.componentRef = componentFactory.create(this.injector);
|
|
407
|
+
this.appRef.attachView(this.componentRef.hostView);
|
|
408
|
+
const domElem = this.componentRef.hostView.rootNodes[0];
|
|
409
|
+
document.body.appendChild(domElem);
|
|
410
|
+
this.setTooltipComponentProperties();
|
|
411
|
+
this.showTimeout = window.setTimeout(this.showTooltip.bind(this), this.showDelay);
|
|
412
|
+
this.tooltipDivElement = domElem.querySelector('.tooltip');
|
|
413
|
+
if (this.displayTime) {
|
|
414
|
+
window.setTimeout(this.destroy.bind(this), this.displayTime);
|
|
466
415
|
}
|
|
467
|
-
this.clearBuffer(begin, end);
|
|
468
|
-
this.shiftL(begin, end - 1);
|
|
469
|
-
this.updateModel(e);
|
|
470
|
-
e.preventDefault();
|
|
471
|
-
}
|
|
472
|
-
else if (k === 13) {
|
|
473
|
-
// Enter
|
|
474
|
-
this.onInputBlur(e);
|
|
475
|
-
this.updateModel(e);
|
|
476
|
-
}
|
|
477
|
-
else if (k === 27) {
|
|
478
|
-
// Escape
|
|
479
|
-
this.input.value = this.focusText;
|
|
480
|
-
this.caret(0, this.checkVal());
|
|
481
|
-
this.updateModel(e);
|
|
482
|
-
e.preventDefault();
|
|
483
416
|
}
|
|
484
417
|
}
|
|
485
|
-
|
|
486
|
-
if (this.
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
const pos = this.caret();
|
|
490
|
-
let p;
|
|
491
|
-
let c;
|
|
492
|
-
let next;
|
|
493
|
-
if (e.ctrlKey || e.altKey || e.metaKey || k < 32 || (k > 34 && k < 41)) {
|
|
494
|
-
// Ignore
|
|
495
|
-
return;
|
|
418
|
+
showTooltip() {
|
|
419
|
+
if (this.componentRef !== null) {
|
|
420
|
+
this.componentRef.instance.visible = true;
|
|
421
|
+
window.addEventListener('mousemove', this.boundOnWindowMouseMoveFunction);
|
|
496
422
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
423
|
+
}
|
|
424
|
+
setTooltipComponentProperties() {
|
|
425
|
+
const margin = 20;
|
|
426
|
+
const anchorSize = 5;
|
|
427
|
+
if (this.componentRef !== null) {
|
|
428
|
+
this.componentRef.instance.tooltip = this.tooltip;
|
|
429
|
+
this.componentRef.instance.escape = this.escape;
|
|
430
|
+
const { left, right, top, bottom } = this.elementRef.nativeElement.getBoundingClientRect();
|
|
431
|
+
const tooltipHeight = bottom - top;
|
|
432
|
+
const tooltipWidth = right - left;
|
|
433
|
+
const safeSpace = 150;
|
|
434
|
+
let positioned = false;
|
|
435
|
+
const invalidOptions = [];
|
|
436
|
+
while (!positioned) {
|
|
437
|
+
if (invalidOptions.includes(TooltipPosition.Top)
|
|
438
|
+
&& invalidOptions.includes(TooltipPosition.Bottom)
|
|
439
|
+
&& invalidOptions.includes(TooltipPosition.Left)
|
|
440
|
+
&& invalidOptions.includes(TooltipPosition.Right)) {
|
|
441
|
+
this.destroy();
|
|
442
|
+
throw new Error("No space to show tooltip");
|
|
443
|
+
}
|
|
444
|
+
switch (this.position) {
|
|
445
|
+
case TooltipPosition.Top: {
|
|
446
|
+
if (invalidOptions.includes(TooltipPosition.Top)) {
|
|
447
|
+
this.position = TooltipPosition.Left;
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
const topShift = top;
|
|
451
|
+
if (topShift <= tooltipHeight + safeSpace) {
|
|
452
|
+
this.position = TooltipPosition.Bottom;
|
|
453
|
+
invalidOptions.push(TooltipPosition.Top);
|
|
454
|
+
positioned = false;
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
this.componentRef.instance.left = Math.round(tooltipWidth / 2 + left);
|
|
458
|
+
this.componentRef.instance.top = Math.round(top - margin - anchorSize);
|
|
459
|
+
positioned = true;
|
|
460
|
+
break;
|
|
516
461
|
}
|
|
517
|
-
|
|
518
|
-
|
|
462
|
+
case TooltipPosition.Bottom: {
|
|
463
|
+
if (invalidOptions.includes(TooltipPosition.Bottom)) {
|
|
464
|
+
this.position = TooltipPosition.Left;
|
|
465
|
+
break;
|
|
466
|
+
}
|
|
467
|
+
const bottomShift = document.body.clientHeight - bottom;
|
|
468
|
+
if (bottomShift <= tooltipHeight + safeSpace) {
|
|
469
|
+
this.position = TooltipPosition.Top;
|
|
470
|
+
invalidOptions.push(TooltipPosition.Bottom);
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
this.componentRef.instance.left = Math.round(tooltipWidth / 2 + left);
|
|
474
|
+
this.componentRef.instance.top = Math.round(bottom + margin);
|
|
475
|
+
positioned = true;
|
|
476
|
+
break;
|
|
519
477
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
478
|
+
case TooltipPosition.Left: {
|
|
479
|
+
if (invalidOptions.includes(TooltipPosition.Left)) {
|
|
480
|
+
this.position = TooltipPosition.Top;
|
|
481
|
+
break;
|
|
482
|
+
}
|
|
483
|
+
const leftShift = left;
|
|
484
|
+
if (leftShift <= tooltipWidth + safeSpace) {
|
|
485
|
+
this.position = TooltipPosition.Right;
|
|
486
|
+
invalidOptions.push(TooltipPosition.Left);
|
|
487
|
+
positioned = false;
|
|
488
|
+
break;
|
|
489
|
+
}
|
|
490
|
+
this.componentRef.instance.left = Math.round(left - margin);
|
|
491
|
+
this.componentRef.instance.top = Math.round(top + tooltipHeight / 2 - anchorSize);
|
|
492
|
+
positioned = true;
|
|
493
|
+
break;
|
|
494
|
+
}
|
|
495
|
+
case TooltipPosition.Right: {
|
|
496
|
+
if (invalidOptions.includes(TooltipPosition.Right)) {
|
|
497
|
+
this.position = TooltipPosition.Top;
|
|
498
|
+
break;
|
|
499
|
+
}
|
|
500
|
+
const rightShift = document.body.clientWidth - right;
|
|
501
|
+
if (rightShift <= tooltipWidth + safeSpace) {
|
|
502
|
+
this.position = TooltipPosition.Left;
|
|
503
|
+
invalidOptions.push(TooltipPosition.Right);
|
|
504
|
+
positioned = false;
|
|
505
|
+
break;
|
|
506
|
+
}
|
|
507
|
+
this.componentRef.instance.left = Math.round(right + margin);
|
|
508
|
+
this.componentRef.instance.top = Math.round(top + tooltipHeight / 2 - anchorSize);
|
|
509
|
+
positioned = true;
|
|
510
|
+
break;
|
|
511
|
+
}
|
|
512
|
+
default: {
|
|
542
513
|
break;
|
|
543
514
|
}
|
|
544
515
|
}
|
|
545
|
-
|
|
546
|
-
this.clearBuffer(i + 1, this.len);
|
|
547
|
-
break;
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
else {
|
|
551
|
-
if (this.buffer[i] === test.charAt(pos)) {
|
|
552
|
-
pos++;
|
|
553
|
-
}
|
|
554
|
-
if (i < this.partialPosition) {
|
|
555
|
-
lastMatch = i;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
if (allow) {
|
|
560
|
-
this.writeBuffer();
|
|
561
|
-
}
|
|
562
|
-
else if (lastMatch + 1 < this.partialPosition) {
|
|
563
|
-
if (this.autoClear || this.buffer.join("") === this.defaultBuffer) {
|
|
564
|
-
// Invalid value. Remove it and replace it with the
|
|
565
|
-
// mask, which is the default behavior.
|
|
566
|
-
if (this.input.value) {
|
|
567
|
-
this.input.value = "";
|
|
568
|
-
}
|
|
569
|
-
this.clearBuffer(0, this.len);
|
|
570
|
-
}
|
|
571
|
-
else {
|
|
572
|
-
// Invalid value, but we opt to show the value to the
|
|
573
|
-
// user and allow them to correct their mistake.
|
|
574
|
-
this.writeBuffer();
|
|
516
|
+
this.componentRef.instance.position = this.position;
|
|
575
517
|
}
|
|
576
518
|
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
519
|
+
}
|
|
520
|
+
destroy() {
|
|
521
|
+
if (this.componentRef !== null) {
|
|
522
|
+
window.clearTimeout(this.showTimeout);
|
|
523
|
+
this.appRef.detachView(this.componentRef.hostView);
|
|
524
|
+
this.componentRef.destroy();
|
|
525
|
+
this.componentRef = null;
|
|
526
|
+
this.tooltipDivElement = null;
|
|
580
527
|
}
|
|
581
|
-
|
|
528
|
+
window.removeEventListener('mousemove', this.boundOnWindowMouseMoveFunction);
|
|
582
529
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
530
|
+
};
|
|
531
|
+
TooltipDirective.ctorParameters = () => [
|
|
532
|
+
{ type: ElementRef },
|
|
533
|
+
{ type: ApplicationRef },
|
|
534
|
+
{ type: ComponentFactoryResolver },
|
|
535
|
+
{ type: Injector },
|
|
536
|
+
{ type: DebounceUtils }
|
|
537
|
+
];
|
|
538
|
+
__decorate([
|
|
539
|
+
Input("sTooltip")
|
|
540
|
+
], TooltipDirective.prototype, "tooltip", void 0);
|
|
541
|
+
__decorate([
|
|
542
|
+
Input("tooltipPosition")
|
|
543
|
+
], TooltipDirective.prototype, "position", void 0);
|
|
544
|
+
__decorate([
|
|
545
|
+
Input()
|
|
546
|
+
], TooltipDirective.prototype, "showDelay", void 0);
|
|
547
|
+
__decorate([
|
|
548
|
+
Input()
|
|
549
|
+
], TooltipDirective.prototype, "displayTime", void 0);
|
|
550
|
+
__decorate([
|
|
551
|
+
Input()
|
|
552
|
+
], TooltipDirective.prototype, "tooltipEvent", void 0);
|
|
553
|
+
__decorate([
|
|
554
|
+
Input()
|
|
555
|
+
], TooltipDirective.prototype, "escape", void 0);
|
|
556
|
+
__decorate([
|
|
557
|
+
Input()
|
|
558
|
+
], TooltipDirective.prototype, "visible", void 0);
|
|
559
|
+
__decorate([
|
|
560
|
+
Input()
|
|
561
|
+
], TooltipDirective.prototype, "mobileBehavior", void 0);
|
|
562
|
+
__decorate([
|
|
563
|
+
HostListener("click"),
|
|
564
|
+
HostListener("keydown")
|
|
565
|
+
], TooltipDirective.prototype, "onClick", null);
|
|
566
|
+
__decorate([
|
|
567
|
+
HostListener("document:touchstart")
|
|
568
|
+
], TooltipDirective.prototype, "onDocumentTouchStart", null);
|
|
569
|
+
__decorate([
|
|
570
|
+
HostListener("focus")
|
|
571
|
+
], TooltipDirective.prototype, "onFocus", null);
|
|
572
|
+
__decorate([
|
|
573
|
+
HostListener("blur")
|
|
574
|
+
], TooltipDirective.prototype, "onBlur", null);
|
|
575
|
+
__decorate([
|
|
576
|
+
HostListener("mouseenter")
|
|
577
|
+
], TooltipDirective.prototype, "onMouseEnter", null);
|
|
578
|
+
__decorate([
|
|
579
|
+
HostListener("mouseleave"),
|
|
580
|
+
HostListener("wheel")
|
|
581
|
+
], TooltipDirective.prototype, "onMouseLeave", null);
|
|
582
|
+
__decorate([
|
|
583
|
+
HostListener("touchstart")
|
|
584
|
+
], TooltipDirective.prototype, "onTouchStart", null);
|
|
585
|
+
__decorate([
|
|
586
|
+
HostListener("touchend")
|
|
587
|
+
], TooltipDirective.prototype, "onTouchEnd", null);
|
|
588
|
+
TooltipDirective = __decorate([
|
|
589
|
+
Directive({
|
|
590
|
+
selector: "[sTooltip]",
|
|
591
|
+
})
|
|
592
|
+
], TooltipDirective);
|
|
593
|
+
|
|
594
|
+
let TooltipModule = class TooltipModule {
|
|
595
|
+
};
|
|
596
|
+
TooltipModule = __decorate([
|
|
597
|
+
NgModule({
|
|
598
|
+
imports: [CommonModule],
|
|
599
|
+
declarations: [
|
|
600
|
+
TooltipComponent,
|
|
601
|
+
TooltipDirective,
|
|
602
|
+
],
|
|
603
|
+
exports: [TooltipDirective],
|
|
604
|
+
})
|
|
605
|
+
], TooltipModule);
|
|
606
|
+
|
|
607
|
+
let AccordionModule = class AccordionModule {
|
|
608
|
+
};
|
|
609
|
+
AccordionModule = __decorate([
|
|
610
|
+
NgModule({
|
|
611
|
+
imports: [
|
|
612
|
+
CommonModule,
|
|
613
|
+
FormsModule,
|
|
614
|
+
BrowserAnimationsModule,
|
|
615
|
+
TooltipModule,
|
|
616
|
+
InputSwitchModule,
|
|
617
|
+
],
|
|
618
|
+
declarations: [
|
|
619
|
+
AccordionComponent,
|
|
620
|
+
AccordionPanelComponent,
|
|
621
|
+
],
|
|
622
|
+
exports: [
|
|
623
|
+
AccordionComponent,
|
|
624
|
+
AccordionPanelComponent,
|
|
625
|
+
],
|
|
626
|
+
})
|
|
627
|
+
], AccordionModule);
|
|
628
|
+
|
|
629
|
+
var BadgeColors;
|
|
630
|
+
(function (BadgeColors) {
|
|
631
|
+
BadgeColors["Red"] = "red";
|
|
632
|
+
BadgeColors["Orange"] = "orange";
|
|
633
|
+
BadgeColors["Yellow"] = "yellow";
|
|
634
|
+
BadgeColors["Blue"] = "blue";
|
|
635
|
+
BadgeColors["Green"] = "green";
|
|
636
|
+
BadgeColors["Gray"] = "gray";
|
|
637
|
+
})(BadgeColors || (BadgeColors = {}));
|
|
638
|
+
|
|
639
|
+
var BadgeTypes;
|
|
640
|
+
(function (BadgeTypes) {
|
|
641
|
+
BadgeTypes["Pill"] = "pill";
|
|
642
|
+
BadgeTypes["Chip"] = "chip";
|
|
643
|
+
})(BadgeTypes || (BadgeTypes = {}));
|
|
644
|
+
|
|
645
|
+
let BadgeComponent = class BadgeComponent {
|
|
646
|
+
constructor() {
|
|
647
|
+
this.type = BadgeTypes.Pill;
|
|
648
|
+
this.color = BadgeColors.Blue;
|
|
649
|
+
this.selectable = false;
|
|
650
|
+
this.iconPosition = "left";
|
|
651
|
+
this.selected = new EventEmitter();
|
|
652
|
+
}
|
|
653
|
+
onClick() {
|
|
654
|
+
this.selected.emit(this.text);
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
__decorate([
|
|
658
|
+
Input()
|
|
659
|
+
], BadgeComponent.prototype, "type", void 0);
|
|
660
|
+
__decorate([
|
|
661
|
+
Input()
|
|
662
|
+
], BadgeComponent.prototype, "color", void 0);
|
|
663
|
+
__decorate([
|
|
664
|
+
Input()
|
|
665
|
+
], BadgeComponent.prototype, "title", void 0);
|
|
666
|
+
__decorate([
|
|
667
|
+
Input()
|
|
668
|
+
], BadgeComponent.prototype, "text", void 0);
|
|
669
|
+
__decorate([
|
|
670
|
+
Input()
|
|
671
|
+
], BadgeComponent.prototype, "selectable", void 0);
|
|
672
|
+
__decorate([
|
|
673
|
+
Input()
|
|
674
|
+
], BadgeComponent.prototype, "iconClass", void 0);
|
|
675
|
+
__decorate([
|
|
676
|
+
Input()
|
|
677
|
+
], BadgeComponent.prototype, "iconPosition", void 0);
|
|
678
|
+
__decorate([
|
|
679
|
+
Output()
|
|
680
|
+
], BadgeComponent.prototype, "selected", void 0);
|
|
681
|
+
__decorate([
|
|
682
|
+
HostListener("click")
|
|
683
|
+
], BadgeComponent.prototype, "onClick", null);
|
|
684
|
+
BadgeComponent = __decorate([
|
|
685
|
+
Component({
|
|
686
|
+
selector: "s-badge",
|
|
687
|
+
template: "<span\n class=\"badge\"\n [ngClass]=\"{\n 'badge--pill': type === 'pill',\n 'badge--chip': type === 'chip', \n 'badge--red': color === 'red',\n 'badge--orange': color === 'orange',\n 'badge--yellow': color === 'yellow',\n 'badge--blue': color === 'blue',\n 'badge--green': color === 'green',\n 'badge--gray': color === 'gray',\n 'badge--selectable': selectable\n }\">\n <span\n *ngIf=\"iconClass\"\n [class]=\"'badge-icon ' + iconClass\"\n [ngClass]=\"{\n 'badge-icon--left': iconPosition === 'left' && text,\n 'badge-icon--right': iconPosition === 'right' && text\n }\">\n </span>\n <span *ngIf=\"title\" class=\"badge-title\">{{ title }}:</span>\n <span class=\"badge-text\">{{ text }}</span>\n</span>",
|
|
688
|
+
styles: [".badge{-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;height:1.25rem;-ms-flex-pack:center;justify-content:center;min-width:20px;padding:0 .5rem}.badge--chip{border-radius:4px}.badge--pill{border-radius:12px}.badge .badge-title{color:#212533;font-family:\"Open Sans\",sans-serif;font-size:12px;font-weight:700;line-height:150%;margin-right:.125rem}.badge .badge-text{color:#212533;font-family:\"Open Sans\",sans-serif;font-size:.75rem;font-weight:400;line-height:150%}.badge .badge-icon{color:#212533;font-size:10px}.badge .badge-icon--left{margin-right:8px}.badge .badge-icon--right{margin-left:8px;-ms-flex-order:2;order:2}.badge--red{background-color:#fcd2d2;border:1px solid #c13018}.badge--orange{background-color:#fce3ba;border:1px solid #f8931f}.badge--yellow{background-color:#fef4e3;border:1px solid #fcbf10}.badge--blue{background-color:#d5e8ec;border:1px solid #428bca}.badge--green{background-color:#e6ffb3;border:1px solid #0c9348}.badge--gray{background-color:#e5eaea;border:1px solid #697882}.badge--selectable{cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none}"]
|
|
689
|
+
})
|
|
690
|
+
], BadgeComponent);
|
|
691
|
+
|
|
692
|
+
let BadgeModule = class BadgeModule {
|
|
693
|
+
};
|
|
694
|
+
BadgeModule = __decorate([
|
|
695
|
+
NgModule({
|
|
696
|
+
imports: [
|
|
697
|
+
CommonModule,
|
|
698
|
+
RouterModule,
|
|
699
|
+
],
|
|
700
|
+
declarations: [BadgeComponent],
|
|
701
|
+
exports: [
|
|
702
|
+
BadgeComponent,
|
|
703
|
+
RouterModule,
|
|
704
|
+
],
|
|
705
|
+
})
|
|
706
|
+
], BadgeModule);
|
|
707
|
+
|
|
708
|
+
let BreadcrumbComponent = class BreadcrumbComponent {
|
|
709
|
+
constructor(activatedRoute, router) {
|
|
710
|
+
this.activatedRoute = activatedRoute;
|
|
711
|
+
this.router = router;
|
|
712
|
+
this.targetHomeUrl = "_self";
|
|
713
|
+
this.ngUnsubscribe = new Subject();
|
|
714
|
+
this.router.events
|
|
715
|
+
.pipe(takeUntil(this.ngUnsubscribe), filter(event => event instanceof NavigationEnd))
|
|
716
|
+
.subscribe(() => this.onNavigationEnd());
|
|
717
|
+
}
|
|
718
|
+
onNavigationEnd() {
|
|
719
|
+
const currentRoute = this.activatedRoute.root;
|
|
720
|
+
const validRoutes = this.getValidChildren(currentRoute);
|
|
721
|
+
this.title = this.getCurrentTitle(validRoutes);
|
|
722
|
+
this.home = this.getCurrentHome(validRoutes);
|
|
723
|
+
this.items = this.getCurrentItems(validRoutes);
|
|
724
|
+
}
|
|
725
|
+
getValidChildren(route) {
|
|
726
|
+
const valid = route.routeConfig && route.routeConfig.path && route.routeConfig.component && route.outlet === PRIMARY_OUTLET;
|
|
727
|
+
return route.children.reduce((validRoutes, child) => [...validRoutes, ...this.getValidChildren(child)], valid ? [route] : []);
|
|
728
|
+
}
|
|
729
|
+
getCurrentTitle(routes) {
|
|
730
|
+
const last = routes[routes.length - 1];
|
|
731
|
+
if (last && last.routeConfig)
|
|
732
|
+
return this.getTitle(last);
|
|
733
|
+
}
|
|
734
|
+
getCurrentHome(routes) {
|
|
735
|
+
let home;
|
|
736
|
+
if (this.homeUrl)
|
|
737
|
+
home = { url: this.homeUrl, icon: "fa fa-home", target: this.targetHomeUrl };
|
|
738
|
+
else if (routes.length)
|
|
739
|
+
home = Object.assign(Object.assign({}, this.getMenuItem(routes[0], routes.length === 1)), { icon: "fa fa-home" });
|
|
740
|
+
return home;
|
|
741
|
+
}
|
|
742
|
+
getCurrentItems(routes) {
|
|
743
|
+
if (!routes.length)
|
|
744
|
+
return;
|
|
745
|
+
const items = this.homeUrl ? routes : routes.slice(1);
|
|
746
|
+
if (items.length)
|
|
747
|
+
return items.map((route, i) => this.getMenuItem(route, i === routes.length - 1));
|
|
748
|
+
}
|
|
749
|
+
getMenuItem(route, disabled = false) {
|
|
750
|
+
const label = this.getTitle(route);
|
|
751
|
+
const routes = route.pathFromRoot;
|
|
752
|
+
const routerLink = routes
|
|
753
|
+
.slice(0, routes.indexOf(route) + 1)
|
|
754
|
+
.reduce((result, item) => [...result, ...item.snapshot.url.map(url => url.path)], ["/"]);
|
|
755
|
+
return {
|
|
756
|
+
label,
|
|
757
|
+
routerLink,
|
|
758
|
+
queryParams: route.snapshot.queryParams,
|
|
759
|
+
routerLinkActiveOptions: { exact: true },
|
|
760
|
+
disabled,
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
getTitle(route) {
|
|
764
|
+
const { snapshot, routeConfig } = route;
|
|
765
|
+
const title = snapshot.data.routeTitle;
|
|
766
|
+
if (!title)
|
|
767
|
+
throw new Error(`No routeTitle defined for the route /${routeConfig.path}`);
|
|
768
|
+
return title;
|
|
769
|
+
}
|
|
770
|
+
ngOnDestroy() {
|
|
771
|
+
this.ngUnsubscribe.next();
|
|
772
|
+
this.ngUnsubscribe.complete();
|
|
773
|
+
}
|
|
774
|
+
};
|
|
775
|
+
BreadcrumbComponent.ctorParameters = () => [
|
|
776
|
+
{ type: ActivatedRoute },
|
|
777
|
+
{ type: Router }
|
|
778
|
+
];
|
|
779
|
+
__decorate([
|
|
780
|
+
Input()
|
|
781
|
+
], BreadcrumbComponent.prototype, "homeUrl", void 0);
|
|
782
|
+
__decorate([
|
|
783
|
+
Input()
|
|
784
|
+
], BreadcrumbComponent.prototype, "targetHomeUrl", void 0);
|
|
785
|
+
BreadcrumbComponent = __decorate([
|
|
786
|
+
Component({
|
|
787
|
+
selector: `s-breadcrumb`,
|
|
788
|
+
template: "<h1 class=\"sds-page-title\">{{title}}</h1>\n<p-breadcrumb [home]=\"home\" [model]=\"items\"></p-breadcrumb>"
|
|
789
|
+
})
|
|
790
|
+
], BreadcrumbComponent);
|
|
791
|
+
|
|
792
|
+
let BreadcrumbModule = class BreadcrumbModule {
|
|
793
|
+
};
|
|
794
|
+
BreadcrumbModule = __decorate([
|
|
795
|
+
NgModule({
|
|
796
|
+
imports: [CommonModule, BreadcrumbModule$1, RouterModule],
|
|
797
|
+
declarations: [BreadcrumbComponent],
|
|
798
|
+
exports: [BreadcrumbComponent, RouterModule],
|
|
799
|
+
})
|
|
800
|
+
], BreadcrumbModule);
|
|
801
|
+
|
|
802
|
+
var ButtonPriority;
|
|
803
|
+
(function (ButtonPriority) {
|
|
804
|
+
ButtonPriority["Default"] = "default";
|
|
805
|
+
ButtonPriority["Primary"] = "primary";
|
|
806
|
+
ButtonPriority["Secondary"] = "secondary";
|
|
807
|
+
ButtonPriority["Link"] = "link";
|
|
808
|
+
})(ButtonPriority || (ButtonPriority = {}));
|
|
809
|
+
|
|
810
|
+
var ButtonSize;
|
|
811
|
+
(function (ButtonSize) {
|
|
812
|
+
ButtonSize["Default"] = "default";
|
|
813
|
+
ButtonSize["Small"] = "small";
|
|
814
|
+
})(ButtonSize || (ButtonSize = {}));
|
|
815
|
+
|
|
816
|
+
var EnumButtonAnimation;
|
|
817
|
+
(function (EnumButtonAnimation) {
|
|
818
|
+
EnumButtonAnimation["rotate"] = "rotate";
|
|
819
|
+
})(EnumButtonAnimation || (EnumButtonAnimation = {}));
|
|
820
|
+
|
|
821
|
+
var ButtonComponent_1;
|
|
822
|
+
let ButtonComponent = ButtonComponent_1 = class ButtonComponent {
|
|
823
|
+
constructor() {
|
|
824
|
+
this.minWidth = "40px";
|
|
825
|
+
this.id = `s-button-${ButtonComponent_1.nextId++}`;
|
|
826
|
+
this.caret = true;
|
|
827
|
+
this.baseZIndex = 0;
|
|
828
|
+
this.disabled = false;
|
|
829
|
+
this.auxiliary = false;
|
|
830
|
+
this.type = "button";
|
|
831
|
+
this.priority = ButtonPriority.Primary;
|
|
832
|
+
this.model = [];
|
|
833
|
+
this.size = ButtonSize.Default;
|
|
834
|
+
this.onClick = new EventEmitter();
|
|
835
|
+
}
|
|
836
|
+
ngOnInit() {
|
|
837
|
+
this.onClick.subscribe((event) => {
|
|
838
|
+
if (!this.model || !this.model.length)
|
|
839
|
+
return;
|
|
840
|
+
this.menu.model = this.model;
|
|
841
|
+
this.menu.toggle(event);
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
validateSlideButton() {
|
|
845
|
+
return this.slide && (this.priority == ButtonPriority.Default || this.priority == ButtonPriority.Link) && this.label.length;
|
|
846
|
+
}
|
|
847
|
+
isOpen() {
|
|
848
|
+
return this.model && this.model.length && this.menu.visible;
|
|
849
|
+
}
|
|
850
|
+
ngOnChanges(changes) {
|
|
851
|
+
const hasIcon = this.iconClass;
|
|
852
|
+
const hasText = this.label;
|
|
853
|
+
const isMultiple = this.model && this.model.length;
|
|
854
|
+
if (hasText || (hasIcon && isMultiple))
|
|
855
|
+
this.minWidth = "80px";
|
|
856
|
+
if (hasText && hasIcon && isMultiple)
|
|
857
|
+
this.minWidth = "100px";
|
|
858
|
+
}
|
|
859
|
+
updateTooltipZIndex() {
|
|
860
|
+
this.tooltipZIndex = this.baseZIndex + ++DomHandler.zindex;
|
|
861
|
+
}
|
|
862
|
+
isRotateAnimation() {
|
|
863
|
+
return this.animation === EnumButtonAnimation.rotate;
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
ButtonComponent.nextId = 0;
|
|
867
|
+
__decorate([
|
|
868
|
+
HostBinding("style.min-width")
|
|
869
|
+
], ButtonComponent.prototype, "minWidth", void 0);
|
|
870
|
+
__decorate([
|
|
871
|
+
Input()
|
|
872
|
+
], ButtonComponent.prototype, "id", void 0);
|
|
873
|
+
__decorate([
|
|
874
|
+
Input()
|
|
875
|
+
], ButtonComponent.prototype, "label", void 0);
|
|
876
|
+
__decorate([
|
|
877
|
+
Input()
|
|
878
|
+
], ButtonComponent.prototype, "tooltip", void 0);
|
|
879
|
+
__decorate([
|
|
880
|
+
Input()
|
|
881
|
+
], ButtonComponent.prototype, "iconClass", void 0);
|
|
882
|
+
__decorate([
|
|
883
|
+
Input()
|
|
884
|
+
], ButtonComponent.prototype, "rightIconClass", void 0);
|
|
885
|
+
__decorate([
|
|
886
|
+
Input()
|
|
887
|
+
], ButtonComponent.prototype, "caret", void 0);
|
|
888
|
+
__decorate([
|
|
889
|
+
Input()
|
|
890
|
+
], ButtonComponent.prototype, "styleClass", void 0);
|
|
891
|
+
__decorate([
|
|
892
|
+
Input()
|
|
893
|
+
], ButtonComponent.prototype, "baseZIndex", void 0);
|
|
894
|
+
__decorate([
|
|
895
|
+
Input()
|
|
896
|
+
], ButtonComponent.prototype, "disabled", void 0);
|
|
897
|
+
__decorate([
|
|
898
|
+
Input()
|
|
899
|
+
], ButtonComponent.prototype, "auxiliary", void 0);
|
|
900
|
+
__decorate([
|
|
901
|
+
Input()
|
|
902
|
+
], ButtonComponent.prototype, "type", void 0);
|
|
903
|
+
__decorate([
|
|
904
|
+
Input()
|
|
905
|
+
], ButtonComponent.prototype, "priority", void 0);
|
|
906
|
+
__decorate([
|
|
907
|
+
Input()
|
|
908
|
+
], ButtonComponent.prototype, "model", void 0);
|
|
909
|
+
__decorate([
|
|
910
|
+
Input()
|
|
911
|
+
], ButtonComponent.prototype, "size", void 0);
|
|
912
|
+
__decorate([
|
|
913
|
+
Input()
|
|
914
|
+
], ButtonComponent.prototype, "slide", void 0);
|
|
915
|
+
__decorate([
|
|
916
|
+
Input()
|
|
917
|
+
], ButtonComponent.prototype, "animation", void 0);
|
|
918
|
+
__decorate([
|
|
919
|
+
Output()
|
|
920
|
+
], ButtonComponent.prototype, "onClick", void 0);
|
|
921
|
+
__decorate([
|
|
922
|
+
ViewChild(TieredMenu, { static: true })
|
|
923
|
+
], ButtonComponent.prototype, "menu", void 0);
|
|
924
|
+
ButtonComponent = ButtonComponent_1 = __decorate([
|
|
925
|
+
Component({
|
|
926
|
+
selector: "s-button",
|
|
927
|
+
template: "<p-tieredMenu [id]=\"id + '-menu'\" [popup]=\"true\" appendTo=\"body\" [baseZIndex]=\"baseZIndex\"></p-tieredMenu>\n\n<button\n [id]=\"id\"\n [type]=\"type\"\n [class]=\"styleClass\"\n [ngClass]=\"{\n 's-button-auxiliary': auxiliary,\n 's-button-with-icon': iconClass,\n 's-button-with-text': label,\n 's-button-empty': !iconClass && !label,\n 's-button-size-default': size === 'default',\n 's-button-size-small': size === 'small',\n 's-button-priority-default': priority === 'default',\n 's-button-priority-primary': priority === 'primary',\n 's-button-priority-secondary': priority === 'secondary',\n 's-button-priority-link': priority === 'link',\n 's-button-multiple': (caret && (model && model.length)) || rightIconClass,\n 's-button-active': isOpen(),\n 's-button--slide': validateSlideButton(),\n 's-button--rotate-animation': isRotateAnimation()\n }\"\n [disabled]=\"disabled\"\n [pTooltip]=\"tooltip\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [tooltipZIndex]=\"tooltipZIndex\"\n (click)=\"onClick.emit($event)\"\n (mouseenter)=\"updateTooltipZIndex()\"\n>\n <span \n *ngIf=\"iconClass\" \n [class]=\"iconClass\" \n [ngClass]=\"{ \n 's-button-icon': true,\n 's-button-icon-margin-right': !label && model && model.length\n }\" \n aria-hidden=\"true\">\n </span>\n <span \n *ngIf=\"label\" \n class=\"s-button-text\"\n [ngClass]=\"{\n 's-button-icon-margin-right': !!rightIconClass || (model && model.length),\n 's-button-icon-margin-left': !!iconClass\n }\">\n {{ label }}\n </span>\n <ng-content></ng-content>\n <span \n *ngIf=\"rightIconClass\" \n [class]=\"rightIconClass\" \n [ngClass]=\"{ 's-button-right-icon': true }\" \n aria-hidden=\"true\">\n </span>\n <span\n *ngIf=\"caret && (model && model.length)\" \n class=\"fa fa-fw fa-caret-down\"\n aria-hidden=\"true\">\n </span>\n</button>\n",
|
|
928
|
+
styles: ["button{-ms-flex-align:center;align-items:center;border-radius:4px;border:1px solid;cursor:pointer;font-family:\"Open Sans\",sans-serif;font-size:14px;height:34px;max-width:100%;min-width:40px;outline:0;overflow:visible;padding:5px 10px;position:relative;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;text-decoration:none;text-transform:none;vertical-align:bottom;transition:background-color .2s ease-out,color .2s ease-out,border-color .2s ease-out}button:disabled{opacity:.5;filter:Alpha(Opacity=50);background-image:none}button:disabled,button:disabled *{cursor:text!important}button.s-button-auxiliary{border-radius:20px}button.s-button-size-small{padding:0 20px;height:25px}button.s-button-with-icon.s-button-multiple,button.s-button-with-text{min-width:80px}button.s-button-with-icon.s-button-with-text.s-button-multiple{min-width:100px}button .s-button-icon,button .s-button-menu-icon,button .s-button-right-icon,button.s-button-with-icon.s-button-multiple:not(.s-button-with-text) .s-button-icon{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}button.s-button-multiple .s-button-text{display:-ms-flexbox;display:flex;-ms-flex-pack:left;justify-content:left;-ms-flex-align:left;align-items:left}button.s-button-with-icon .s-button-text{display:-ms-flexbox;display:flex;-ms-flex-pack:right;justify-content:right;-ms-flex-align:right;align-items:right}.s-button-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.s-button-menu-icon{right:10px;transition:transform .2s ease-out}.s-button-icon-margin-left{margin-left:10px}.s-button-icon-margin-right{margin-right:10px}.s-button-active .s-button-menu-icon{transform:rotateX(180deg)}button,button.s-button-priority-primary{background-color:#428bca;border-color:#428bca}button .s-button-icon,button .s-button-menu-icon,button .s-button-right-icon,button .s-button-text,button.s-button-priority-primary .s-button-icon,button.s-button-priority-primary .s-button-menu-icon,button.s-button-priority-primary .s-button-right-icon,button.s-button-priority-primary .s-button-text{color:#fff}button.s-button-priority-primary:hover,button:hover{background-color:#2a6496}button.s-button-priority-primary:focus,button:focus{background-color:#2a6496;border-color:#22dce6}button.s-button-active:not(:disabled),button.s-button-priority-primary.s-button-active:not(:disabled),button.s-button-priority-primary:active:not(:disabled),button:active:not(:disabled){background-color:#245682;border-color:#245682}button.s-button-priority-secondary{background-color:#7892a1;border-color:#7892a1}button.s-button-priority-secondary .s-button-icon,button.s-button-priority-secondary .s-button-menu-icon,button.s-button-priority-secondary .s-button-right-icon,button.s-button-priority-secondary .s-button-text{color:#fff}button.s-button-priority-secondary:hover{background-color:#546b79}button.s-button-priority-secondary:focus{background-color:#546b79;border-color:#22dce6}button.s-button-priority-secondary.s-button-active:not(:disabled),button.s-button-priority-secondary:active:not(:disabled){background-color:#495e6a;border-color:#495e6a}button.s-button-priority-default{background-color:#fff;border-color:#ccc}button.s-button-priority-default .s-button-icon,button.s-button-priority-default .s-button-menu-icon,button.s-button-priority-default .s-button-right-icon,button.s-button-priority-default .s-button-text{color:#333}button.s-button-priority-default:hover{background-color:#d9d9d9}button.s-button-priority-default:focus{background-color:#d9d9d9;border-color:#22dce6}button.s-button-priority-default.s-button-active:not(:disabled),button.s-button-priority-default:active:not(:disabled){background-color:#ccc;border-color:#ccc}button.s-button-priority-link{background-color:transparent;border-color:transparent}button.s-button-priority-link .s-button-icon,button.s-button-priority-link .s-button-menu-icon,button.s-button-priority-link .s-button-right-icon,button.s-button-priority-link .s-button-text{color:#428bca}button.s-button-priority-link:hover{background-color:transparent}button.s-button-priority-link:hover .s-button-icon,button.s-button-priority-link:hover .s-button-menu-icon,button.s-button-priority-link:hover .s-button-right-icon,button.s-button-priority-link:hover .s-button-text{color:#2a6496}button.s-button-priority-link:focus{border-color:#22dce6;background-color:transparent}button.s-button-priority-link:focus .s-button-icon,button.s-button-priority-link:focus .s-button-menu-icon,button.s-button-priority-link:focus .s-button-right-icon,button.s-button-priority-link:focus .s-button-text{color:#2a6496}button.s-button-priority-link.s-button-active:not(:disabled),button.s-button-priority-link:active:not(:disabled){background-color:transparent;border-color:transparent}button.s-button-priority-link.s-button-active:not(:disabled) .s-button-icon,button.s-button-priority-link.s-button-active:not(:disabled) .s-button-menu-icon,button.s-button-priority-link.s-button-active:not(:disabled) .s-button-right-icon,button.s-button-priority-link.s-button-active:not(:disabled) .s-button-text,button.s-button-priority-link:active:not(:disabled) .s-button-icon,button.s-button-priority-link:active:not(:disabled) .s-button-menu-icon,button.s-button-priority-link:active:not(:disabled) .s-button-right-icon,button.s-button-priority-link:active:not(:disabled) .s-button-text{color:#245682}.s-button--slide.s-button-with-icon.s-button-multiple,.s-button--slide.s-button-with-text{min-width:40px}.s-button--slide .s-button-text{position:absolute;opacity:0;width:0}.s-button--slide:hover .s-button-text{transition:1s;position:relative;opacity:1;width:auto}.s-button--slide:hover.s-button--rotate-animation .s-button-icon,.s-button--slide:hover.s-button--rotate-animation .s-button-right-icon{transition:1.5s;transform:rotate(360deg)}"]
|
|
929
|
+
})
|
|
930
|
+
], ButtonComponent);
|
|
931
|
+
|
|
932
|
+
let ButtonModule = class ButtonModule {
|
|
933
|
+
};
|
|
934
|
+
ButtonModule = __decorate([
|
|
935
|
+
NgModule({
|
|
936
|
+
imports: [CommonModule, RouterModule, TieredMenuModule, TooltipModule$1],
|
|
937
|
+
declarations: [ButtonComponent],
|
|
938
|
+
exports: [ButtonComponent],
|
|
939
|
+
})
|
|
940
|
+
], ButtonModule);
|
|
941
|
+
|
|
942
|
+
let CalendarMaskDirective = class CalendarMaskDirective {
|
|
943
|
+
constructor(host, renderer) {
|
|
944
|
+
this.host = host;
|
|
945
|
+
this.renderer = renderer;
|
|
946
|
+
this.SELECTORS = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
947
|
+
this.slotChar = "_";
|
|
948
|
+
this.autoClear = false;
|
|
949
|
+
this.firstTime = true;
|
|
950
|
+
}
|
|
951
|
+
setListeners() {
|
|
952
|
+
this.input = this.host.inputfieldViewChild.nativeElement;
|
|
953
|
+
this.value = this.input.value;
|
|
954
|
+
this.focusListener = this.renderer.listen(this.input, "focus", () => {
|
|
955
|
+
this.onInputFocus();
|
|
956
|
+
});
|
|
957
|
+
this.blurListener = this.renderer.listen(this.input, "blur", (event) => {
|
|
958
|
+
this.onInputBlur(event);
|
|
959
|
+
});
|
|
960
|
+
this.keydownListener = this.renderer.listen(this.input, "keydown", (event) => {
|
|
961
|
+
this.onKeyDown(event);
|
|
962
|
+
});
|
|
963
|
+
this.keypressListener = this.renderer.listen(this.input, "keypress", (event) => {
|
|
964
|
+
this.onKeyPress(event);
|
|
965
|
+
});
|
|
966
|
+
this.inputListener = this.renderer.listen(this.input, "input", (event) => {
|
|
967
|
+
this.onInputChange(event);
|
|
968
|
+
});
|
|
969
|
+
this.pasteListener = this.renderer.listen(this.input, "paste", (event) => {
|
|
970
|
+
this.handleInputChange(event);
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
ngOnInit() {
|
|
974
|
+
const ua = navigator.userAgent;
|
|
975
|
+
this.androidChrome = /chrome/i.test(ua) && /android/i.test(ua);
|
|
976
|
+
this.createMaskFromDateFormat();
|
|
977
|
+
this.initMask();
|
|
978
|
+
}
|
|
979
|
+
get mask() {
|
|
980
|
+
return this._mask;
|
|
981
|
+
}
|
|
982
|
+
set mask(val) {
|
|
983
|
+
this._mask = val;
|
|
984
|
+
this.initMask();
|
|
985
|
+
this.writeValue("");
|
|
986
|
+
}
|
|
987
|
+
writeValue(value) {
|
|
988
|
+
this.value = value;
|
|
989
|
+
if (this.input) {
|
|
990
|
+
if (this.value == undefined) {
|
|
991
|
+
this.input.value = "";
|
|
992
|
+
}
|
|
993
|
+
else {
|
|
994
|
+
this.input.value = this.value;
|
|
995
|
+
}
|
|
996
|
+
this.checkVal();
|
|
997
|
+
this.focusText = this.input.value;
|
|
998
|
+
this.updateFilledState();
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
onInputBlur(e) {
|
|
1002
|
+
this.checkVal();
|
|
1003
|
+
this.updateFilledState();
|
|
1004
|
+
if (this.value != this.focusText) {
|
|
1005
|
+
if (!this.input.disabled &&
|
|
1006
|
+
(this.value === undefined || this.value === null || this.value.indexOf(this.slotChar) >= 0)) {
|
|
1007
|
+
this.value = "";
|
|
1008
|
+
e.target.value = "";
|
|
1009
|
+
this.host.updateModel(null);
|
|
1010
|
+
}
|
|
1011
|
+
this.updateModel(e);
|
|
1012
|
+
const event = document.createEvent("HTMLEvents");
|
|
1013
|
+
event.initEvent("change", true, false);
|
|
1014
|
+
this.input.dispatchEvent(event);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
onKeyDown(e) {
|
|
1018
|
+
if (this.host.readonlyInput) {
|
|
1019
|
+
return;
|
|
1020
|
+
}
|
|
1021
|
+
const k = e.which || e.keyCode;
|
|
1022
|
+
const iPhone = /iphone/i.test(navigator.userAgent);
|
|
1023
|
+
let pos;
|
|
1024
|
+
let begin;
|
|
1025
|
+
let end;
|
|
1026
|
+
this.oldVal = this.input.value;
|
|
1027
|
+
// Backspace, delete, and escape get special treatment
|
|
1028
|
+
if (k === 8 || k === 46 || (iPhone && k === 127)) {
|
|
1029
|
+
pos = this.caret();
|
|
1030
|
+
begin = pos.begin;
|
|
1031
|
+
end = pos.end;
|
|
1032
|
+
if (end - begin === 0) {
|
|
1033
|
+
begin = k !== 46 ? this.seekPrev(begin) : (end = this.seekNext(begin - 1));
|
|
1034
|
+
end = k === 46 ? this.seekNext(end) : end;
|
|
1035
|
+
}
|
|
1036
|
+
this.clearBuffer(begin, end);
|
|
1037
|
+
this.shiftL(begin, end - 1);
|
|
1038
|
+
this.updateModel(e);
|
|
1039
|
+
e.preventDefault();
|
|
1040
|
+
}
|
|
1041
|
+
else if (k === 13) {
|
|
1042
|
+
// Enter
|
|
1043
|
+
this.onInputBlur(e);
|
|
1044
|
+
this.updateModel(e);
|
|
1045
|
+
}
|
|
1046
|
+
else if (k === 27) {
|
|
1047
|
+
// Escape
|
|
1048
|
+
this.input.value = this.focusText;
|
|
1049
|
+
this.caret(0, this.checkVal());
|
|
1050
|
+
this.updateModel(e);
|
|
1051
|
+
e.preventDefault();
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
onKeyPress(e) {
|
|
1055
|
+
if (this.host.readonlyInput)
|
|
1056
|
+
return;
|
|
1057
|
+
const k = e.which || e.keyCode;
|
|
1058
|
+
const pos = this.caret();
|
|
1059
|
+
let p;
|
|
1060
|
+
let c;
|
|
1061
|
+
let next;
|
|
1062
|
+
if (e.ctrlKey || e.altKey || e.metaKey || k < 32 || (k > 34 && k < 41)) {
|
|
1063
|
+
// Ignore
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1066
|
+
else if (k && k !== 13) {
|
|
1067
|
+
if (pos.end - pos.begin !== 0) {
|
|
1068
|
+
this.clearBuffer(pos.begin, pos.end);
|
|
1069
|
+
this.shiftL(pos.begin, pos.end - 1);
|
|
1070
|
+
}
|
|
1071
|
+
p = this.seekNext(pos.begin - 1);
|
|
1072
|
+
if (p < this.len) {
|
|
1073
|
+
c = String.fromCharCode(k);
|
|
1074
|
+
if (this.tests[p].test(c)) {
|
|
1075
|
+
this.shiftR(p);
|
|
1076
|
+
this.buffer[p] = c;
|
|
1077
|
+
this.writeBuffer();
|
|
1078
|
+
next = this.seekNext(p);
|
|
1079
|
+
if (/android/i.test(navigator.userAgent)) {
|
|
1080
|
+
// Path for CSP Violation on FireFox OS 1.1
|
|
1081
|
+
const proxy = () => {
|
|
1082
|
+
this.caret(next);
|
|
1083
|
+
};
|
|
1084
|
+
setTimeout(proxy, 0);
|
|
1085
|
+
}
|
|
1086
|
+
else {
|
|
1087
|
+
this.caret(next);
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
e.preventDefault();
|
|
1092
|
+
}
|
|
1093
|
+
this.updateModel(e);
|
|
1094
|
+
this.updateFilledState();
|
|
1095
|
+
}
|
|
1096
|
+
checkVal(allow) {
|
|
1097
|
+
// Try to place characters where they belong
|
|
1098
|
+
const test = this.input.value;
|
|
1099
|
+
let lastMatch = -1;
|
|
1100
|
+
let i;
|
|
1101
|
+
let c;
|
|
1102
|
+
let pos = 0;
|
|
1103
|
+
for (i = 0; i < this.len; i++) {
|
|
1104
|
+
if (this.tests[i]) {
|
|
1105
|
+
this.buffer[i] = this.getPlaceholder(i);
|
|
1106
|
+
while (pos++ < test.length) {
|
|
1107
|
+
c = test.charAt(pos - 1);
|
|
1108
|
+
if (this.tests[i].test(c)) {
|
|
1109
|
+
this.buffer[i] = c;
|
|
1110
|
+
lastMatch = i;
|
|
1111
|
+
break;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
if (pos > test.length) {
|
|
1115
|
+
this.clearBuffer(i + 1, this.len);
|
|
1116
|
+
break;
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
else {
|
|
1120
|
+
if (this.buffer[i] === test.charAt(pos)) {
|
|
1121
|
+
pos++;
|
|
1122
|
+
}
|
|
1123
|
+
if (i < this.partialPosition) {
|
|
1124
|
+
lastMatch = i;
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
if (allow) {
|
|
1129
|
+
this.writeBuffer();
|
|
1130
|
+
}
|
|
1131
|
+
else if (lastMatch + 1 < this.partialPosition) {
|
|
1132
|
+
if (this.autoClear || this.buffer.join("") === this.defaultBuffer) {
|
|
1133
|
+
// Invalid value. Remove it and replace it with the
|
|
1134
|
+
// mask, which is the default behavior.
|
|
1135
|
+
if (this.input.value) {
|
|
1136
|
+
this.input.value = "";
|
|
1137
|
+
}
|
|
1138
|
+
this.clearBuffer(0, this.len);
|
|
1139
|
+
}
|
|
1140
|
+
else {
|
|
1141
|
+
// Invalid value, but we opt to show the value to the
|
|
1142
|
+
// user and allow them to correct their mistake.
|
|
1143
|
+
this.writeBuffer();
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
else {
|
|
1147
|
+
this.writeBuffer();
|
|
1148
|
+
this.input.value = this.input.value.substring(0, lastMatch + 1);
|
|
1149
|
+
}
|
|
1150
|
+
return this.partialPosition ? i : this.firstNonMaskPos;
|
|
1151
|
+
}
|
|
1152
|
+
onInputFocus() {
|
|
1153
|
+
if (this.host.readonlyInput)
|
|
1154
|
+
return;
|
|
1155
|
+
clearTimeout(this.caretTimeoutId);
|
|
1156
|
+
let pos;
|
|
1157
|
+
this.focusText = this.input.value;
|
|
589
1158
|
pos = this.checkVal();
|
|
590
1159
|
this.caretTimeoutId = setTimeout(() => {
|
|
591
1160
|
if (this.input !== document.activeElement) {
|
|
@@ -2609,1604 +3178,1228 @@ let LookupComponent = LookupComponent_1 = class LookupComponent {
|
|
|
2609
3178
|
ngAfterViewInit() {
|
|
2610
3179
|
this.autocomplete.onOverlayAnimationDone = (event) => { };
|
|
2611
3180
|
}
|
|
2612
|
-
ngOnChanges(changes) {
|
|
2613
|
-
if (this.dialogVisible && changes.searchGridData) {
|
|
2614
|
-
this.loading = false;
|
|
2615
|
-
}
|
|
2616
|
-
this._setFocusFilter();
|
|
2617
|
-
}
|
|
2618
|
-
ngOnDestroy() {
|
|
2619
|
-
this.ngUnsubscribe.next();
|
|
2620
|
-
this.ngUnsubscribe.complete();
|
|
2621
|
-
}
|
|
2622
|
-
getGridData() {
|
|
2623
|
-
return this.searchGridData;
|
|
2624
|
-
}
|
|
2625
|
-
getLookupSuggestions() {
|
|
2626
|
-
return this.lookupSuggestions;
|
|
2627
|
-
}
|
|
2628
|
-
makeSearchRequestParams(event) {
|
|
2629
|
-
const filters = this.formGroupDialog.getRawValue();
|
|
2630
|
-
const params = Object.assign(Object.assign({}, event), { filterData: filters });
|
|
2631
|
-
const { multiSortMeta } = event;
|
|
2632
|
-
this.multiSortMeta = multiSortMeta || this.multiSortMeta;
|
|
2633
|
-
return params;
|
|
2634
|
-
}
|
|
2635
|
-
lazyLoadGrid(event) {
|
|
2636
|
-
// Ao definir uma ordenação na tabela do lookup esse método é chamado 2 vezes https://github.com/primefaces/primeng/issues/5480
|
|
2637
|
-
const params = this.makeSearchRequestParams(event);
|
|
2638
|
-
this.onSearchRequest.next(params);
|
|
2639
|
-
}
|
|
2640
|
-
lazyLoadLookup(event) {
|
|
2641
|
-
this.onLookupRequest.next(event.query);
|
|
2642
|
-
}
|
|
2643
|
-
setDefaultFilters() {
|
|
2644
|
-
if (!this.defaultFilter)
|
|
2645
|
-
return;
|
|
2646
|
-
this.defaultFilter
|
|
2647
|
-
.filter(({ field }) => this.formGroupDialog.contains(field) &&
|
|
2648
|
-
!this.formGroupDialog.get([field]).dirty)
|
|
2649
|
-
.forEach(({ value, field }) => {
|
|
2650
|
-
this.formGroupDialog
|
|
2651
|
-
.get([field])
|
|
2652
|
-
.patchValue(value instanceof Function ? value() : value);
|
|
2653
|
-
});
|
|
2654
|
-
}
|
|
2655
|
-
showDialog() {
|
|
2656
|
-
this.setDefaultFilters();
|
|
2657
|
-
this.searchGridData = undefined;
|
|
2658
|
-
this.onTouched();
|
|
2659
|
-
this.hotkeysService.pause([...this.hotkeysService.hotkeys]);
|
|
2660
|
-
this.setHotkeys();
|
|
2661
|
-
let selected = [];
|
|
2662
|
-
if (this.multiple && this.value) {
|
|
2663
|
-
selected = selected.concat(this.value);
|
|
2664
|
-
}
|
|
2665
|
-
else if (this.value) {
|
|
2666
|
-
selected = [this.value];
|
|
2667
|
-
}
|
|
2668
|
-
this.selected = selected;
|
|
2669
|
-
this.loading = true;
|
|
2670
|
-
this.dialogVisible = true;
|
|
2671
|
-
}
|
|
2672
|
-
hideDialog() {
|
|
2673
|
-
const { inputEL, multiInputEL } = this.autocomplete;
|
|
2674
|
-
this.dialogVisible = false;
|
|
2675
|
-
this.collapsed = false;
|
|
2676
|
-
this.hotkeysService.unpause([...this.hotkeysService.pausedHotkeys]);
|
|
2677
|
-
if (this.multiple)
|
|
2678
|
-
multiInputEL.nativeElement.focus();
|
|
2679
|
-
else
|
|
2680
|
-
inputEL.nativeElement.focus();
|
|
2681
|
-
}
|
|
2682
|
-
search() {
|
|
2683
|
-
this.resetTable();
|
|
2684
|
-
this.collapsed = true;
|
|
2685
|
-
this.dialog.moveOnTop();
|
|
2686
|
-
}
|
|
2687
|
-
clear() {
|
|
2688
|
-
this.formGroupDialog.reset(this.originalFormValues);
|
|
2689
|
-
this.resetTable();
|
|
2690
|
-
}
|
|
2691
|
-
resetTable() {
|
|
2692
|
-
this.table.reset();
|
|
2693
|
-
}
|
|
2694
|
-
select() {
|
|
2695
|
-
if (!this.selected.length)
|
|
2696
|
-
return;
|
|
2697
|
-
const selected = this.selected && (this.multiple ? this.selected : this.selected[0]);
|
|
2698
|
-
this.value = selected;
|
|
2699
|
-
this.onSelect.next(selected);
|
|
2700
|
-
this.hideDialog();
|
|
2701
|
-
}
|
|
2702
|
-
onSelectionChange(selected) {
|
|
2703
|
-
if (!selected)
|
|
2704
|
-
return;
|
|
2705
|
-
if (Array.isArray(selected))
|
|
2706
|
-
this.selected = selected;
|
|
2707
|
-
else
|
|
2708
|
-
this.selected = [selected];
|
|
2709
|
-
}
|
|
2710
|
-
registerOnChange(fn) {
|
|
2711
|
-
this.onChange = (val) => {
|
|
2712
|
-
this.writeValue(val);
|
|
2713
|
-
fn(val);
|
|
2714
|
-
};
|
|
2715
|
-
}
|
|
2716
|
-
registerOnTouched(fn) {
|
|
2717
|
-
this.onTouched = fn;
|
|
2718
|
-
}
|
|
2719
|
-
writeValue(value) {
|
|
2720
|
-
this.value = value;
|
|
2721
|
-
}
|
|
2722
|
-
setDisabledState(disabled) {
|
|
2723
|
-
this.disabled = disabled;
|
|
2724
|
-
}
|
|
2725
|
-
getFieldValue(obj, path) {
|
|
2726
|
-
return path.split(".").reduce((result, prop) => (result[prop] === undefined ? "" : result[prop]), obj);
|
|
2727
|
-
}
|
|
2728
|
-
getLabelForValue(value, options) {
|
|
2729
|
-
if (!options)
|
|
2730
|
-
return value;
|
|
2731
|
-
const option = options.find(opt => opt.value === value);
|
|
2732
|
-
return option ? option.label : value;
|
|
2733
|
-
}
|
|
2734
|
-
isBooleanValue(obj, path) {
|
|
2735
|
-
const value = this.getFieldValue(obj, path);
|
|
2736
|
-
if (value === true || value === false)
|
|
2737
|
-
return true;
|
|
2738
|
-
else
|
|
2739
|
-
return false;
|
|
2740
|
-
}
|
|
2741
|
-
getBooleanLabel(obj, path, optionsLabel) {
|
|
2742
|
-
const value = this.getFieldValue(obj, path);
|
|
2743
|
-
if (value === true)
|
|
2744
|
-
return optionsLabel.true;
|
|
2745
|
-
else if (value === false)
|
|
2746
|
-
return optionsLabel.false;
|
|
2747
|
-
else
|
|
2748
|
-
return this.emptyFieldLabel;
|
|
2749
|
-
}
|
|
2750
|
-
isNumber(obj, path) {
|
|
2751
|
-
return !(new BigNumber(this.getFieldValue(obj, path)).isNaN());
|
|
2752
|
-
}
|
|
2753
|
-
setHotkeys() {
|
|
2754
|
-
const clearHotkey = this.newHotkey("alt+shift+l", this.clear.bind(this));
|
|
2755
|
-
const findHotkey = this.newHotkey("alt+shift+f", this.search.bind(this));
|
|
2756
|
-
const hideHotkey = this.newHotkey("alt+shift+c", this.hideDialog.bind(this));
|
|
2757
|
-
const selectHotkey = this.newHotkey("alt+shift+s", this.select.bind(this));
|
|
2758
|
-
const bindedHotkeys = [clearHotkey, findHotkey, hideHotkey, selectHotkey];
|
|
2759
|
-
bindedHotkeys.forEach((hotkey) => this.hotkeysService.add(hotkey));
|
|
2760
|
-
}
|
|
2761
|
-
newHotkey(combo, fn) {
|
|
2762
|
-
return new Hotkey(combo, () => {
|
|
2763
|
-
fn();
|
|
2764
|
-
return false;
|
|
2765
|
-
}, ["INPUT", "SELECT", "TEXTAREA"]);
|
|
2766
|
-
}
|
|
2767
|
-
filterToggle() {
|
|
2768
|
-
if (this.animating)
|
|
2769
|
-
return;
|
|
2770
|
-
this.animating = true;
|
|
2771
|
-
this.collapsed = !this.collapsed;
|
|
2772
|
-
}
|
|
2773
|
-
onToggleDone() {
|
|
2774
|
-
this.animating = false;
|
|
2775
|
-
}
|
|
2776
|
-
/**
|
|
2777
|
-
* Calculate the table column size. The minimum value is 14.286em, which is equals to 200px duo to the current font size.
|
|
2778
|
-
* @param label Column name.
|
|
2779
|
-
*/
|
|
2780
|
-
getColWidth(label) {
|
|
2781
|
-
const size = label.length;
|
|
2782
|
-
if (size < 14.286)
|
|
2783
|
-
return `14.286em`;
|
|
2784
|
-
return `${size}em`;
|
|
2785
|
-
}
|
|
2786
|
-
getScale(scale) {
|
|
2787
|
-
return this.isFunction(scale) ? scale() : scale;
|
|
2788
|
-
}
|
|
2789
|
-
isFunction(value) {
|
|
2790
|
-
return value instanceof Function;
|
|
2791
|
-
}
|
|
2792
|
-
getIntegerMaskConfig(col) {
|
|
2793
|
-
var _a;
|
|
2794
|
-
return {
|
|
2795
|
-
scale: 0,
|
|
2796
|
-
thousandsSeparator: (_a = col.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.thousandsSeparator,
|
|
2797
|
-
prefix: "",
|
|
2798
|
-
};
|
|
3181
|
+
ngOnChanges(changes) {
|
|
3182
|
+
if (this.dialogVisible && changes.searchGridData) {
|
|
3183
|
+
this.loading = false;
|
|
3184
|
+
}
|
|
3185
|
+
this._setFocusFilter();
|
|
2799
3186
|
}
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
scale: this.getScale(col.scale),
|
|
2804
|
-
decimalSeparator: (_a = col.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator,
|
|
2805
|
-
thousandsSeparator: (_b = col.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator,
|
|
2806
|
-
prefix: "",
|
|
2807
|
-
};
|
|
3187
|
+
ngOnDestroy() {
|
|
3188
|
+
this.ngUnsubscribe.next();
|
|
3189
|
+
this.ngUnsubscribe.complete();
|
|
2808
3190
|
}
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
return {
|
|
2812
|
-
scale: this.getScale(col.scale),
|
|
2813
|
-
decimalSeparator: (_a = col.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator,
|
|
2814
|
-
thousandsSeparator: (_b = col.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator,
|
|
2815
|
-
prefix: (_c = col.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol,
|
|
2816
|
-
};
|
|
3191
|
+
getGridData() {
|
|
3192
|
+
return this.searchGridData;
|
|
2817
3193
|
}
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
return {
|
|
2821
|
-
scale: this.getScale(col.scale),
|
|
2822
|
-
decimalSeparator: (_a = col.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator,
|
|
2823
|
-
thousandsSeparator: (_b = col.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator,
|
|
2824
|
-
prefix: (_c = col.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol
|
|
2825
|
-
};
|
|
3194
|
+
getLookupSuggestions() {
|
|
3195
|
+
return this.lookupSuggestions;
|
|
2826
3196
|
}
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
3197
|
+
makeSearchRequestParams(event) {
|
|
3198
|
+
const filters = this.formGroupDialog.getRawValue();
|
|
3199
|
+
const params = Object.assign(Object.assign({}, event), { filterData: filters });
|
|
3200
|
+
const { multiSortMeta } = event;
|
|
3201
|
+
this.multiSortMeta = multiSortMeta || this.multiSortMeta;
|
|
3202
|
+
return params;
|
|
2830
3203
|
}
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
if (input) {
|
|
2836
|
-
input.focus();
|
|
2837
|
-
}
|
|
2838
|
-
}
|
|
3204
|
+
lazyLoadGrid(event) {
|
|
3205
|
+
// Ao definir uma ordenação na tabela do lookup esse método é chamado 2 vezes https://github.com/primefaces/primeng/issues/5480
|
|
3206
|
+
const params = this.makeSearchRequestParams(event);
|
|
3207
|
+
this.onSearchRequest.next(params);
|
|
2839
3208
|
}
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
{
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
__decorate([
|
|
2855
|
-
Input()
|
|
2856
|
-
], LookupComponent.prototype, "multiple", void 0);
|
|
2857
|
-
__decorate([
|
|
2858
|
-
Input()
|
|
2859
|
-
], LookupComponent.prototype, "dataKey", void 0);
|
|
2860
|
-
__decorate([
|
|
2861
|
-
Input()
|
|
2862
|
-
], LookupComponent.prototype, "required", void 0);
|
|
2863
|
-
__decorate([
|
|
2864
|
-
Input()
|
|
2865
|
-
], LookupComponent.prototype, "disabled", void 0);
|
|
2866
|
-
__decorate([
|
|
2867
|
-
Input()
|
|
2868
|
-
], LookupComponent.prototype, "showSearch", void 0);
|
|
2869
|
-
__decorate([
|
|
2870
|
-
Input()
|
|
2871
|
-
], LookupComponent.prototype, "lookupSuggestions", void 0);
|
|
2872
|
-
__decorate([
|
|
2873
|
-
Input()
|
|
2874
|
-
], LookupComponent.prototype, "lookupDisplayField", void 0);
|
|
2875
|
-
__decorate([
|
|
2876
|
-
Input()
|
|
2877
|
-
], LookupComponent.prototype, "lookupDisplayFieldTooltip", void 0);
|
|
2878
|
-
__decorate([
|
|
2879
|
-
Input()
|
|
2880
|
-
], LookupComponent.prototype, "lookupEmptyMessage", void 0);
|
|
2881
|
-
__decorate([
|
|
2882
|
-
Input()
|
|
2883
|
-
], LookupComponent.prototype, "lookupAppendTo", void 0);
|
|
2884
|
-
__decorate([
|
|
2885
|
-
Input()
|
|
2886
|
-
], LookupComponent.prototype, "searchTitle", void 0);
|
|
2887
|
-
__decorate([
|
|
2888
|
-
Input()
|
|
2889
|
-
], LookupComponent.prototype, "searchEmptyTitle", void 0);
|
|
2890
|
-
__decorate([
|
|
2891
|
-
Input()
|
|
2892
|
-
], LookupComponent.prototype, "searchEmptyDescription", void 0);
|
|
2893
|
-
__decorate([
|
|
2894
|
-
Input()
|
|
2895
|
-
], LookupComponent.prototype, "searchGridData", void 0);
|
|
2896
|
-
__decorate([
|
|
2897
|
-
Input()
|
|
2898
|
-
], LookupComponent.prototype, "searchTotalRecords", void 0);
|
|
2899
|
-
__decorate([
|
|
2900
|
-
Input()
|
|
2901
|
-
], LookupComponent.prototype, "searchFields", void 0);
|
|
2902
|
-
__decorate([
|
|
2903
|
-
Input()
|
|
2904
|
-
], LookupComponent.prototype, "searchGridFields", void 0);
|
|
2905
|
-
__decorate([
|
|
2906
|
-
Input()
|
|
2907
|
-
], LookupComponent.prototype, "multiSortMeta", void 0);
|
|
2908
|
-
__decorate([
|
|
2909
|
-
Input()
|
|
2910
|
-
], LookupComponent.prototype, "filterTitle", void 0);
|
|
2911
|
-
__decorate([
|
|
2912
|
-
Input()
|
|
2913
|
-
], LookupComponent.prototype, "filterLabel", void 0);
|
|
2914
|
-
__decorate([
|
|
2915
|
-
Input()
|
|
2916
|
-
], LookupComponent.prototype, "clearLabel", void 0);
|
|
2917
|
-
__decorate([
|
|
2918
|
-
Input()
|
|
2919
|
-
], LookupComponent.prototype, "cancelLabel", void 0);
|
|
2920
|
-
__decorate([
|
|
2921
|
-
Input()
|
|
2922
|
-
], LookupComponent.prototype, "selectLabel", void 0);
|
|
2923
|
-
__decorate([
|
|
2924
|
-
Input()
|
|
2925
|
-
], LookupComponent.prototype, "emptyFieldLabel", void 0);
|
|
2926
|
-
__decorate([
|
|
2927
|
-
Input()
|
|
2928
|
-
], LookupComponent.prototype, "recordLabel", void 0);
|
|
2929
|
-
__decorate([
|
|
2930
|
-
Input()
|
|
2931
|
-
], LookupComponent.prototype, "recordsLabel", void 0);
|
|
2932
|
-
__decorate([
|
|
2933
|
-
Input()
|
|
2934
|
-
], LookupComponent.prototype, "placeholder", void 0);
|
|
2935
|
-
__decorate([
|
|
2936
|
-
Input()
|
|
2937
|
-
], LookupComponent.prototype, "searchTotalRecordsLabel", void 0);
|
|
2938
|
-
__decorate([
|
|
2939
|
-
Input()
|
|
2940
|
-
], LookupComponent.prototype, "sortableColumnsDisabled", void 0);
|
|
2941
|
-
__decorate([
|
|
2942
|
-
Input()
|
|
2943
|
-
], LookupComponent.prototype, "lookupRowProps", void 0);
|
|
2944
|
-
__decorate([
|
|
2945
|
-
Input()
|
|
2946
|
-
], LookupComponent.prototype, "defaultFilter", void 0);
|
|
2947
|
-
__decorate([
|
|
2948
|
-
Output()
|
|
2949
|
-
], LookupComponent.prototype, "onLookupRequest", void 0);
|
|
2950
|
-
__decorate([
|
|
2951
|
-
Output()
|
|
2952
|
-
], LookupComponent.prototype, "onSearchRequest", void 0);
|
|
2953
|
-
__decorate([
|
|
2954
|
-
Output()
|
|
2955
|
-
], LookupComponent.prototype, "onFocus", void 0);
|
|
2956
|
-
__decorate([
|
|
2957
|
-
Output()
|
|
2958
|
-
], LookupComponent.prototype, "onBlur", void 0);
|
|
2959
|
-
__decorate([
|
|
2960
|
-
Output()
|
|
2961
|
-
], LookupComponent.prototype, "onKeyUp", void 0);
|
|
2962
|
-
__decorate([
|
|
2963
|
-
Output()
|
|
2964
|
-
], LookupComponent.prototype, "onSelect", void 0);
|
|
2965
|
-
__decorate([
|
|
2966
|
-
Output()
|
|
2967
|
-
], LookupComponent.prototype, "onUnselect", void 0);
|
|
2968
|
-
__decorate([
|
|
2969
|
-
Output()
|
|
2970
|
-
], LookupComponent.prototype, "onClear", void 0);
|
|
2971
|
-
__decorate([
|
|
2972
|
-
ViewChild(Table, { static: false })
|
|
2973
|
-
], LookupComponent.prototype, "table", void 0);
|
|
2974
|
-
__decorate([
|
|
2975
|
-
ViewChild(Dialog, { static: false })
|
|
2976
|
-
], LookupComponent.prototype, "dialog", void 0);
|
|
2977
|
-
__decorate([
|
|
2978
|
-
ViewChild(AutoComplete, { static: false })
|
|
2979
|
-
], LookupComponent.prototype, "autocomplete", void 0);
|
|
2980
|
-
LookupComponent = LookupComponent_1 = __decorate([
|
|
2981
|
-
Component({
|
|
2982
|
-
selector: "s-lookup",
|
|
2983
|
-
template: "<div [ngClass]=\"{ inputgroup: showSearch }\">\n <p-autoComplete\n #autocomplete\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [dataKey]=\"dataKey\"\n [multiple]=\"multiple\"\n [inputId]=\"id + '-autocomplete'\"\n [forceSelection]=\"autocompleteForceSelection\"\n [suggestions]=\"getLookupSuggestions()\"\n (completeMethod)=\"lazyLoadLookup($event)\"\n (onSelect)=\"onSelect.next($event)\"\n (onBlur)=\"onBlur.next($event)\"\n (onFocus)=\"onFocus.next($event)\"\n (onUnselect)=\"onUnselect.next($event)\"\n (onClear)=\"onClear.next($event)\"\n (onKeyUp)=\"onKeyUp.next($event)\"\n [field]=\"lookupDisplayField\"\n [emptyMessage]=\"lookupEmptyMessage\"\n [dropdown]=\"!showSearch\"\n [appendTo]=\"lookupAppendTo\"\n [placeholder]=\"placeholder || ' '\"\n [autoHighlight]=\"true\"\n inputStyleClass=\"mousetrap\">\n <ng-template let-item pTemplate=\"selectedItem\">\n <span\n class=\"ui-autocomplete-token-label ng-tns-c65-43 ng-star-inserted\"\n [sTooltip]=\"lookupDisplayFieldTooltip ? item[lookupDisplayField] : null\"\n tooltipPosition=\"top\">\n {{item[lookupDisplayField]}}\n </span>\n </ng-template>\n </p-autoComplete>\n <button\n *ngIf=\"showSearch\"\n pButton\n type=\"button\"\n icon=\"fa fa-search\"\n class=\"button-addon\"\n [disabled]=\"disabled\"\n (click)=\"showDialog()\">\n </button>\n</div>\n<p-dialog\n appendTo=\"body\"\n styleClass=\"s-lookup-modal\"\n [header]=\"searchTitle\"\n [(visible)]=\"dialogVisible\"\n [modal]=\"true\"\n (onHide)=\"hideDialog()\"\n [blockScroll]=\"true\"\n [focusOnShow]=\"true\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n #dialog>\n <div\n *ngIf=\"dialogVisible\"\n class=\"s-lookup-modal-container\">\n <div\n *ngIf=\"searchFields && searchFields.length\"\n class=\"filter\"\n [@collapseContent]=\"collapsed \n ? { value: 'hidden', params: { transitionParams: transitionOptions } }\n : { value: 'visible', params: { transitionParams: transitionOptions } }\"\n (@collapseContent.done)=\"onToggleDone()\">\n <form\n [formGroup]=\"formGroupDialog\"\n novalidate\n autocomplete=\"off\">\n <div\n *ngIf=\"!collapsed\"\n class=\"form-content\"\n [@childCollapseContent]=\"collapsed\n ? { value: ':leave', params: { transitionParams: transitionOptions } }\n : { value: ':enter', params: { transitionParams: transitionOptions } }\">\n <div class=\"filter-title sds-section-title\">{{ filterTitle }}</div>\n <div class=\"form-fields\">\n <s-dynamic-form\n [fields]=\"searchFields\"\n [form]=\"formGroupDialog\">\n </s-dynamic-form>\n </div>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button\n [id]=\"id + '-filter-button'\"\n type=\"submit\"\n [label]=\"filterLabel\"\n (onClick)=\"search()\"\n sTooltip=\"(ALT + SHIFT + F)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n <s-button\n [id]=\"id + '-clear-button'\"\n type=\"button\"\n [label]=\"clearLabel\"\n (onClick)=\"clear()\"\n priority=\"link\"\n sTooltip=\"(ALT + SHIFT + L)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n </div>\n </div>\n </div>\n </form>\n </div>\n <div\n *ngIf=\"searchFields && searchFields.length\"\n class=\"filter-toggle\">\n <div class=\"filter-toggle--start-border-mask\"></div>\n <button\n [id]=\"id + '-filter-toggle-button'\"\n type=\"button\"\n (click)=\"filterToggle()\">\n <span\n class=\"fa\"\n [ngClass]=\"{'fa-chevron-left': !collapsed, 'fa-chevron-right': collapsed}\"\n aria-hidden=\"true\">\n </span>\n </button>\n <div class=\"filter-toggle--end-border-mask\"></div>\n </div>\n <div\n class=\"content\"\n [ngClass]=\"{'empty-content': !searchTotalRecords && !loading}\">\n <s-empty-state\n [id]=\"id + '-empty-state'\"\n *ngIf=\"!searchTotalRecords && !loading\"\n [title]=\"searchEmptyTitle\"\n [description]=\"searchEmptyDescription\"\n iconClass=\"fa fa-search\">\n </s-empty-state>\n <p-table\n [dataKey]=\"dataKey\"\n [value]=\"getGridData()\"\n [columns]=\"searchGridFields\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n sortMode=\"multiple\"\n [totalRecords]=\"searchTotalRecords\"\n [rows]=\"10\"\n [selection]=\"selected\"\n (onLazyLoad)=\"lazyLoadGrid($event)\"\n *sLoadingState=\"loading\"\n [multiSortMeta]=\"multiSortMeta\"\n [attr.data-hidden]=\"!searchTotalRecords && !loading\"\n [selectionMode]=\"multiple ? 'multiple' : 'single'\"\n (selectionChange)=\"onSelectionChange($event)\">\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col\n *ngIf=\"multiple\"\n style=\"width: 50px\" />\n <col\n *ngFor=\"let col of columns\"\n [style.width]=\"col.width\" />\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th\n *ngIf=\"multiple\"\n style=\"width: 50px\">\n <s-table-header-checkbox\n [useAllObject]=\"lookupRowProps ? false : true\"\n [rowProps]=\"lookupRowProps\">\n </s-table-header-checkbox>\n </th>\n <th\n [style.width]=\"col.width\"\n *ngFor=\"let col of columns\"\n [pSortableColumn]=\"col.name\"\n [pSortableColumnDisabled]=\"sortableColumnsDisabled?.includes(col.name)\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.label }}</span>\n <p-sortIcon\n [field]=\"col.name\"\n *ngIf=\"!sortableColumnsDisabled?.includes(col.name)\">\n </p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template\n pTemplate=\"body\"\n let-rowData\n let-columns\n let-rowIndex=\"rowIndex\">\n <tr\n sNavigation\n [pSelectableRow]=\"rowData\"\n [pSelectableRowIndex]=\"rowIndex\"\n sDoubleClick (onDoubleClick)=\"onTableRowDoubleClick(rowData)\">\n <td\n *ngIf=\"multiple\"\n style=\"width: 50px\"\n tabindex=\"0\">\n <p-tableCheckbox\n [value]=\"rowData\"\n [pSelectableRow]=\"rowData\">\n </p-tableCheckbox>\n </td>\n <td\n [style.width]=\"col['width']\"\n *ngFor=\"let col of searchGridFields\"\n [ngSwitch]=\"col.type\"\n tabindex=\"0\">\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <ng-container *ngIf=\"isBooleanValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getBooleanLabel(rowData, col.name, col.optionsLabel) }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Date'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate: col.calendarLocaleOptions?.dateFormat || \"L\" | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'LocalDateTime'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Time'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedTime: col.calendarLocaleOptions?.dateFormat || \"LTS\" | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Integer'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getIntegerMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Double'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getDoubleMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Money'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getMoneyMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Number'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getNumberMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Enum'\">\n <ng-container\n *ngIf=\"getLabelForValue(getFieldValue(rowData, col.name), col.options); else emptyTemplate\"\n >\n <span> {{ getLabelForValue(getFieldValue(rowData, col.name), col.options) }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"col.mask && col.mask()\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name))\">\n <span>{{ getFieldValue(rowData, col.name) | sMaskFormatter: col.mask() }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!(col.mask && col.mask())\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name)); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) }}</span>\n </ng-container>\n </ng-container>\n </ng-container>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span [attr.data-hidden]=\"loading\">\n {{ printRecordTotalizer() }}\n </span>\n </ng-template>\n </p-table>\n </div>\n </div>\n <p-footer>\n <s-button\n [id]=\"id + '-select-button'\"\n type=\"button\"\n [label]=\"selectLabel\"\n (onClick)=\"select()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [disabled]=\"!selected?.length\">\n </s-button>\n <s-button\n [id]=\"id + '-cancel-button'\"\n type=\"button\"\n priority=\"link\"\n [label]=\"cancelLabel\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n </p-footer>\n</p-dialog>\n<ng-template #emptyTemplate>\n <span [ngClass]=\"'sds-empty-value'\">{{ emptyFieldLabel }}</span>\n</ng-template>\n",
|
|
2984
|
-
providers: [
|
|
2985
|
-
{
|
|
2986
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2987
|
-
useExisting: forwardRef(() => LookupComponent_1),
|
|
2988
|
-
multi: true,
|
|
2989
|
-
},
|
|
2990
|
-
],
|
|
2991
|
-
encapsulation: ViewEncapsulation.None,
|
|
2992
|
-
animations: [
|
|
2993
|
-
trigger("collapseContent", [
|
|
2994
|
-
state("hidden", style$7({
|
|
2995
|
-
width: "10px",
|
|
2996
|
-
padding: 0,
|
|
2997
|
-
})),
|
|
2998
|
-
state("visible", style$7({
|
|
2999
|
-
width: "*",
|
|
3000
|
-
})),
|
|
3001
|
-
transition("visible <=> hidden", [group([query("@childCollapseContent", animateChild()), animate("{{transitionParams}}")])]),
|
|
3002
|
-
]),
|
|
3003
|
-
trigger("childCollapseContent", [
|
|
3004
|
-
state(":leave", style$7({
|
|
3005
|
-
opacity: 0,
|
|
3006
|
-
})),
|
|
3007
|
-
state(":enter", style$7({
|
|
3008
|
-
opacity: 1,
|
|
3009
|
-
})),
|
|
3010
|
-
transition("* <=> *", animate("{{transitionParams}}")),
|
|
3011
|
-
]),
|
|
3012
|
-
],
|
|
3013
|
-
styles: ["s-lookup.ng-dirty.ng-invalid .ui-inputtext{border-color:#c13018}s-lookup .ui-inputtext{border-top-right-radius:0;border-bottom-right-radius:0}s-lookup .inputgroup p-autocomplete+button,s-lookup p-autocomplete .ui-autocomplete-dropdown.ui-button{background-color:#fff;border-color:#ccc;border-width:1px 1px 1px 0;color:#333;min-height:34px;height:auto!important;min-width:auto;width:34px!important;overflow:hidden;border-top-left-radius:0;border-bottom-left-radius:0}.ui-fluid s-lookup .inputgroup,s-lookup p-autocomplete span.ui-autocomplete-multiple{display:-ms-flexbox;display:flex}.ui-fluid s-lookup .inputgroup p-autocomplete{display:inline-block}.ui-fluid s-lookup .inputgroup p-autocomplete,.ui-fluid s-lookup p-autocomplete .ui-autocomplete-input{width:calc(100% - 34px)}.ui-fluid s-lookup .inputgroup p-autocomplete .ui-autocomplete-input{width:100%}s-lookup .inputgroup p-autocomplete+button:enabled:hover,s-lookup .inputgroup p-autocomplete+button:focus{background-color:#e6e6e6;border-color:#ccc}s-lookup .inputgroup p-autocomplete .ui-widget .ui-inputtext{border-right-width:1px;border-right-style:solid}s-lookup .ui-autocomplete-input-token,s-lookup .ui-autocomplete-input-token input{width:100%}s-lookup .ui-autocomplete .ui-autocomplete-token{max-width:100%}s-lookup .ui-autocomplete .ui-autocomplete-token-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}body .s-lookup-modal.ui-dialog .ui-dialog-content{padding:0;margin-bottom:0;max-height:none}s-lookup .ui-table-scrollable-body{min-width:100%}.s-lookup-modal{height:80%!important;max-width:100%!important;max-height:inherit!important;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:column;flex-direction:column}.s-lookup-modal .ui-dialog-content{height:auto!important;-ms-flex:1;flex:1;overflow:auto}.s-lookup-modal .ui-dialog-footer,.s-lookup-modal .ui-dialog-header{-ms-flex-negative:0;flex-shrink:0;border-radius:0 0 4px 4px}.s-lookup-modal .s-lookup-modal-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:100%;width:100%}.s-lookup-modal .s-lookup-modal-container .filter{position:relative;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;width:85%;background-color:rgba(229,234,234,.5);height:100%;padding:.571rem}.s-lookup-modal .s-lookup-modal-container .filter form{width:100%;height:100%}.s-lookup-modal .s-lookup-modal-container .filter form .form-content{height:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.s-lookup-modal .s-lookup-modal-container .filter form .form-content .filter-title{padding-left:.5rem}.s-lookup-modal .s-lookup-modal-container .filter form .form-content .form-fields{overflow-y:auto}.s-lookup-modal .s-lookup-modal-container .filter-toggle{-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;width:34px;border-radius:0 4px 4px 0}.s-lookup-modal .s-lookup-modal-container .filter-toggle button{-ms-flex-align:center;align-items:center;position:relative;background-color:rgba(229,234,234,.5);height:34px;width:100%;border:1px solid #e5eaea;outline:0;border-left:none;border-radius:0 4px 4px 0;cursor:pointer;text-decoration:none;text-transform:none;padding:7px;transition:background-color .2s ease-out,color .2s ease-out,border-color .2s ease-out}.s-lookup-modal .s-lookup-modal-container .filter-toggle button:focus,.s-lookup-modal .s-lookup-modal-container .filter-toggle button:hover{background-color:rgba(201,211,211,.5);border-color:#c9d3d3}.s-lookup-modal .s-lookup-modal-container .filter-toggle--start-border-mask{height:15px;border-left:1px solid #e5eaea}.s-lookup-modal .s-lookup-modal-container .filter-toggle--end-border-mask{height:calc(100% - 49px);border-left:1px solid #e5eaea}.s-lookup-modal .s-lookup-modal-container .content{-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:auto;flex-basis:auto;overflow-x:auto;padding:.5rem}.s-lookup-modal .s-lookup-modal-container .content.empty-content{-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center}.s-lookup-modal .s-lookup-modal-container .content .s-loading-state-container,.s-lookup-modal .s-lookup-modal-container .content .s-loading-state-container .contents{height:100%}.s-lookup-modal .s-lookup-modal-container .content p-table{position:relative;height:100%}.s-lookup-modal .s-lookup-modal-container .content p-table .ui-table{height:100%}.s-lookup-modal .s-lookup-modal-container .content p-table .ui-table .ui-table-scrollable-wrapper{height:calc(100% - 60px)}.s-lookup-modal .s-lookup-modal-container .content p-table .ui-table .ui-table-scrollable-wrapper .ui-table-scrollable-view{height:100%}.s-lookup-modal .s-lookup-modal-container .content p-table .ui-table .ui-table-scrollable-wrapper .ui-table-scrollable-view .ui-table-scrollable-body{position:relative;height:calc(100% - 60px)}@media (max-width:767px){.s-lookup-modal{border:none!important;top:0!important;left:0!important;width:100%!important;height:100%!important}}@media (min-width:768px){.s-lookup-modal{width:80%!important}.s-lookup-modal .s-lookup-modal-container .filter{width:40%}}@media (min-width:1200px){.s-lookup-modal{width:60%!important}.s-lookup-modal .s-lookup-modal-container .filter{width:30%}}"]
|
|
3014
|
-
})
|
|
3015
|
-
], LookupComponent);
|
|
3016
|
-
|
|
3017
|
-
class BaseFieldComponent {
|
|
3018
|
-
isFunction(value) {
|
|
3019
|
-
return value instanceof Function;
|
|
3209
|
+
lazyLoadLookup(event) {
|
|
3210
|
+
this.onLookupRequest.next(event.query);
|
|
3211
|
+
}
|
|
3212
|
+
setDefaultFilters() {
|
|
3213
|
+
if (!this.defaultFilter)
|
|
3214
|
+
return;
|
|
3215
|
+
this.defaultFilter
|
|
3216
|
+
.filter(({ field }) => this.formGroupDialog.contains(field) &&
|
|
3217
|
+
!this.formGroupDialog.get([field]).dirty)
|
|
3218
|
+
.forEach(({ value, field }) => {
|
|
3219
|
+
this.formGroupDialog
|
|
3220
|
+
.get([field])
|
|
3221
|
+
.patchValue(value instanceof Function ? value() : value);
|
|
3222
|
+
});
|
|
3020
3223
|
}
|
|
3021
|
-
|
|
3022
|
-
|
|
3224
|
+
showDialog() {
|
|
3225
|
+
this.setDefaultFilters();
|
|
3226
|
+
this.searchGridData = undefined;
|
|
3227
|
+
this.onTouched();
|
|
3228
|
+
this.hotkeysService.pause([...this.hotkeysService.hotkeys]);
|
|
3229
|
+
this.setHotkeys();
|
|
3230
|
+
let selected = [];
|
|
3231
|
+
if (this.multiple && this.value) {
|
|
3232
|
+
selected = selected.concat(this.value);
|
|
3233
|
+
}
|
|
3234
|
+
else if (this.value) {
|
|
3235
|
+
selected = [this.value];
|
|
3236
|
+
}
|
|
3237
|
+
this.selected = selected;
|
|
3238
|
+
this.loading = true;
|
|
3239
|
+
this.dialogVisible = true;
|
|
3023
3240
|
}
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
DynamicType["DateTime"] = "DateTime";
|
|
3034
|
-
DynamicType["LocalDateTime"] = "LocalDateTime";
|
|
3035
|
-
DynamicType["Double"] = "Double";
|
|
3036
|
-
DynamicType["Enum"] = "Enum";
|
|
3037
|
-
DynamicType["Fieldset"] = "Fieldset";
|
|
3038
|
-
DynamicType["Integer"] = "Integer";
|
|
3039
|
-
DynamicType["Lookup"] = "Lookup";
|
|
3040
|
-
DynamicType["Money"] = "Money";
|
|
3041
|
-
DynamicType["Radio"] = "Radio";
|
|
3042
|
-
DynamicType["Row"] = "Row";
|
|
3043
|
-
DynamicType["Section"] = "Section";
|
|
3044
|
-
DynamicType["String"] = "String";
|
|
3045
|
-
DynamicType["Text"] = "Text";
|
|
3046
|
-
DynamicType["Time"] = "Time";
|
|
3047
|
-
DynamicType["Number"] = "Number";
|
|
3048
|
-
DynamicType["Password"] = "Password";
|
|
3049
|
-
DynamicType["Slider"] = "Slider";
|
|
3050
|
-
})(DynamicType || (DynamicType = {}));
|
|
3051
|
-
|
|
3052
|
-
class Grid {
|
|
3053
|
-
constructor(config) {
|
|
3054
|
-
Object.assign(this, Object.assign({}, config));
|
|
3241
|
+
hideDialog() {
|
|
3242
|
+
const { inputEL, multiInputEL } = this.autocomplete;
|
|
3243
|
+
this.dialogVisible = false;
|
|
3244
|
+
this.collapsed = false;
|
|
3245
|
+
this.hotkeysService.unpause([...this.hotkeysService.pausedHotkeys]);
|
|
3246
|
+
if (this.multiple)
|
|
3247
|
+
multiInputEL.nativeElement.focus();
|
|
3248
|
+
else
|
|
3249
|
+
inputEL.nativeElement.focus();
|
|
3055
3250
|
}
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
super(config);
|
|
3251
|
+
search() {
|
|
3252
|
+
this.resetTable();
|
|
3253
|
+
this.collapsed = true;
|
|
3254
|
+
this.dialog.moveOnTop();
|
|
3061
3255
|
}
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
constructor(config) {
|
|
3066
|
-
Object.assign(this, Object.assign({}, config));
|
|
3256
|
+
clear() {
|
|
3257
|
+
this.formGroupDialog.reset(this.originalFormValues);
|
|
3258
|
+
this.resetTable();
|
|
3067
3259
|
}
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
class Fieldset extends Structure {
|
|
3071
|
-
constructor(config) {
|
|
3072
|
-
super(config);
|
|
3073
|
-
Object.assign(this, Object.assign({}, config));
|
|
3260
|
+
resetTable() {
|
|
3261
|
+
this.table.reset();
|
|
3074
3262
|
}
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3263
|
+
select() {
|
|
3264
|
+
if (!this.selected.length)
|
|
3265
|
+
return;
|
|
3266
|
+
const selected = this.selected && (this.multiple ? this.selected : this.selected[0]);
|
|
3267
|
+
this.value = selected;
|
|
3268
|
+
this.onSelect.next(selected);
|
|
3269
|
+
this.hideDialog();
|
|
3080
3270
|
}
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3271
|
+
onSelectionChange(selected) {
|
|
3272
|
+
if (!selected)
|
|
3273
|
+
return;
|
|
3274
|
+
if (Array.isArray(selected))
|
|
3275
|
+
this.selected = selected;
|
|
3276
|
+
else
|
|
3277
|
+
this.selected = [selected];
|
|
3278
|
+
}
|
|
3279
|
+
registerOnChange(fn) {
|
|
3280
|
+
this.onChange = (val) => {
|
|
3281
|
+
this.writeValue(val);
|
|
3282
|
+
fn(val);
|
|
3283
|
+
};
|
|
3284
|
+
}
|
|
3285
|
+
registerOnTouched(fn) {
|
|
3286
|
+
this.onTouched = fn;
|
|
3287
|
+
}
|
|
3288
|
+
writeValue(value) {
|
|
3289
|
+
this.value = value;
|
|
3290
|
+
}
|
|
3291
|
+
setDisabledState(disabled) {
|
|
3292
|
+
this.disabled = disabled;
|
|
3293
|
+
}
|
|
3294
|
+
getFieldValue(obj, path) {
|
|
3295
|
+
return path.split(".").reduce((result, prop) => (result[prop] === undefined ? "" : result[prop]), obj);
|
|
3296
|
+
}
|
|
3297
|
+
getLabelForValue(value, options) {
|
|
3298
|
+
if (!options)
|
|
3299
|
+
return value;
|
|
3300
|
+
const option = options.find(opt => opt.value === value);
|
|
3301
|
+
return option ? option.label : value;
|
|
3302
|
+
}
|
|
3303
|
+
isBooleanValue(obj, path) {
|
|
3304
|
+
const value = this.getFieldValue(obj, path);
|
|
3305
|
+
if (value === true || value === false)
|
|
3306
|
+
return true;
|
|
3307
|
+
else
|
|
3308
|
+
return false;
|
|
3309
|
+
}
|
|
3310
|
+
getBooleanLabel(obj, path, optionsLabel) {
|
|
3311
|
+
const value = this.getFieldValue(obj, path);
|
|
3312
|
+
if (value === true)
|
|
3313
|
+
return optionsLabel.true;
|
|
3314
|
+
else if (value === false)
|
|
3315
|
+
return optionsLabel.false;
|
|
3316
|
+
else
|
|
3317
|
+
return this.emptyFieldLabel;
|
|
3318
|
+
}
|
|
3319
|
+
isNumber(obj, path) {
|
|
3320
|
+
return !(new BigNumber(this.getFieldValue(obj, path)).isNaN());
|
|
3321
|
+
}
|
|
3322
|
+
setHotkeys() {
|
|
3323
|
+
const clearHotkey = this.newHotkey("alt+shift+l", this.clear.bind(this));
|
|
3324
|
+
const findHotkey = this.newHotkey("alt+shift+f", this.search.bind(this));
|
|
3325
|
+
const hideHotkey = this.newHotkey("alt+shift+c", this.hideDialog.bind(this));
|
|
3326
|
+
const selectHotkey = this.newHotkey("alt+shift+s", this.select.bind(this));
|
|
3327
|
+
const bindedHotkeys = [clearHotkey, findHotkey, hideHotkey, selectHotkey];
|
|
3328
|
+
bindedHotkeys.forEach((hotkey) => this.hotkeysService.add(hotkey));
|
|
3329
|
+
}
|
|
3330
|
+
newHotkey(combo, fn) {
|
|
3331
|
+
return new Hotkey(combo, () => {
|
|
3332
|
+
fn();
|
|
3333
|
+
return false;
|
|
3334
|
+
}, ["INPUT", "SELECT", "TEXTAREA"]);
|
|
3335
|
+
}
|
|
3336
|
+
filterToggle() {
|
|
3337
|
+
if (this.animating)
|
|
3338
|
+
return;
|
|
3339
|
+
this.animating = true;
|
|
3340
|
+
this.collapsed = !this.collapsed;
|
|
3341
|
+
}
|
|
3342
|
+
onToggleDone() {
|
|
3343
|
+
this.animating = false;
|
|
3344
|
+
}
|
|
3345
|
+
/**
|
|
3346
|
+
* Calculate the table column size. The minimum value is 14.286em, which is equals to 200px duo to the current font size.
|
|
3347
|
+
* @param label Column name.
|
|
3348
|
+
*/
|
|
3349
|
+
getColWidth(label) {
|
|
3350
|
+
const size = label.length;
|
|
3351
|
+
if (size < 14.286)
|
|
3352
|
+
return `14.286em`;
|
|
3353
|
+
return `${size}em`;
|
|
3354
|
+
}
|
|
3355
|
+
getScale(scale) {
|
|
3356
|
+
return this.isFunction(scale) ? scale() : scale;
|
|
3357
|
+
}
|
|
3358
|
+
isFunction(value) {
|
|
3359
|
+
return value instanceof Function;
|
|
3360
|
+
}
|
|
3361
|
+
getIntegerMaskConfig(col) {
|
|
3362
|
+
var _a;
|
|
3363
|
+
return {
|
|
3364
|
+
scale: 0,
|
|
3365
|
+
thousandsSeparator: (_a = col.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.thousandsSeparator,
|
|
3366
|
+
prefix: "",
|
|
3367
|
+
};
|
|
3368
|
+
}
|
|
3369
|
+
getDoubleMaskConfig(col) {
|
|
3370
|
+
var _a, _b;
|
|
3371
|
+
return {
|
|
3372
|
+
scale: this.getScale(col.scale),
|
|
3373
|
+
decimalSeparator: (_a = col.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator,
|
|
3374
|
+
thousandsSeparator: (_b = col.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator,
|
|
3375
|
+
prefix: "",
|
|
3376
|
+
};
|
|
3377
|
+
}
|
|
3378
|
+
getMoneyMaskConfig(col) {
|
|
3379
|
+
var _a, _b, _c;
|
|
3380
|
+
return {
|
|
3381
|
+
scale: this.getScale(col.scale),
|
|
3382
|
+
decimalSeparator: (_a = col.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator,
|
|
3383
|
+
thousandsSeparator: (_b = col.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator,
|
|
3384
|
+
prefix: (_c = col.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol,
|
|
3385
|
+
};
|
|
3131
3386
|
}
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3387
|
+
getNumberMaskConfig(col) {
|
|
3388
|
+
var _a, _b, _c;
|
|
3389
|
+
return {
|
|
3390
|
+
scale: this.getScale(col.scale),
|
|
3391
|
+
decimalSeparator: (_a = col.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator,
|
|
3392
|
+
thousandsSeparator: (_b = col.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator,
|
|
3393
|
+
prefix: (_c = col.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol
|
|
3394
|
+
};
|
|
3395
|
+
}
|
|
3396
|
+
onTableRowDoubleClick(rowData) {
|
|
3397
|
+
this.selected = [rowData];
|
|
3398
|
+
this.select();
|
|
3399
|
+
}
|
|
3400
|
+
_setFocusFilter() {
|
|
3401
|
+
var _a, _b, _c;
|
|
3402
|
+
if (this.dialogVisible && !this.collapsed) {
|
|
3403
|
+
const input = (_c = (_b = (_a = this.dialog) === null || _a === void 0 ? void 0 : _a.contentViewChild) === null || _b === void 0 ? void 0 : _b.nativeElement) === null || _c === void 0 ? void 0 : _c.getElementsByTagName('input')[0];
|
|
3404
|
+
if (input) {
|
|
3405
|
+
input.focus();
|
|
3406
|
+
}
|
|
3407
|
+
}
|
|
3137
3408
|
}
|
|
3138
3409
|
};
|
|
3410
|
+
LookupComponent.nextId = 0;
|
|
3411
|
+
LookupComponent.ctorParameters = () => [
|
|
3412
|
+
{ type: HotkeysService }
|
|
3413
|
+
];
|
|
3139
3414
|
__decorate([
|
|
3140
3415
|
Input()
|
|
3141
|
-
],
|
|
3416
|
+
], LookupComponent.prototype, "formControlName", void 0);
|
|
3142
3417
|
__decorate([
|
|
3143
3418
|
Input()
|
|
3144
|
-
],
|
|
3419
|
+
], LookupComponent.prototype, "id", void 0);
|
|
3145
3420
|
__decorate([
|
|
3146
3421
|
Input()
|
|
3147
|
-
],
|
|
3422
|
+
], LookupComponent.prototype, "autocompleteForceSelection", void 0);
|
|
3148
3423
|
__decorate([
|
|
3149
3424
|
Input()
|
|
3150
|
-
],
|
|
3425
|
+
], LookupComponent.prototype, "multiple", void 0);
|
|
3151
3426
|
__decorate([
|
|
3152
3427
|
Input()
|
|
3153
|
-
],
|
|
3428
|
+
], LookupComponent.prototype, "dataKey", void 0);
|
|
3154
3429
|
__decorate([
|
|
3155
3430
|
Input()
|
|
3156
|
-
],
|
|
3157
|
-
DynamicFormComponent = __decorate([
|
|
3158
|
-
Component({
|
|
3159
|
-
selector: "s-dynamic-form",
|
|
3160
|
-
template: "<div *ngIf=\"configs; else templateFields\">\n <ng-container *ngFor=\"let config of configs\">\n <ng-container *sDynamicForm=\"{ id: id, config: config, group: form, errorMessages: errorMessages }\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #templateFields>\n <s-dynamic-field [id]=\"id\" [fields]=\"fields\" [form]=\"form\" [errorMessages]=\"errorMessages\" [displayTimeInfoSign]=\"displayTimeInfoSign\"></s-dynamic-field>\n</ng-template>\n",
|
|
3161
|
-
encapsulation: ViewEncapsulation.None,
|
|
3162
|
-
styles: ["label.required:after{content:\" *\";color:#c13018}"]
|
|
3163
|
-
})
|
|
3164
|
-
], DynamicFormComponent);
|
|
3165
|
-
|
|
3166
|
-
var EmptyStateComponent_1;
|
|
3167
|
-
let EmptyStateComponent = EmptyStateComponent_1 = class EmptyStateComponent {
|
|
3168
|
-
constructor() {
|
|
3169
|
-
this.id = `s-empty-state-${EmptyStateComponent_1.nextId++}`;
|
|
3170
|
-
this.iconClass = "fa fa-inbox";
|
|
3171
|
-
this.showPrimaryAction = true;
|
|
3172
|
-
this.showSecondaryAction = true;
|
|
3173
|
-
this.primaryModel = [];
|
|
3174
|
-
this.primaryAction = new EventEmitter();
|
|
3175
|
-
this.secondaryAction = new EventEmitter();
|
|
3176
|
-
}
|
|
3177
|
-
};
|
|
3178
|
-
EmptyStateComponent.nextId = 0;
|
|
3431
|
+
], LookupComponent.prototype, "required", void 0);
|
|
3179
3432
|
__decorate([
|
|
3180
3433
|
Input()
|
|
3181
|
-
],
|
|
3434
|
+
], LookupComponent.prototype, "disabled", void 0);
|
|
3182
3435
|
__decorate([
|
|
3183
3436
|
Input()
|
|
3184
|
-
],
|
|
3437
|
+
], LookupComponent.prototype, "showSearch", void 0);
|
|
3185
3438
|
__decorate([
|
|
3186
3439
|
Input()
|
|
3187
|
-
],
|
|
3440
|
+
], LookupComponent.prototype, "lookupSuggestions", void 0);
|
|
3188
3441
|
__decorate([
|
|
3189
3442
|
Input()
|
|
3190
|
-
],
|
|
3443
|
+
], LookupComponent.prototype, "lookupDisplayField", void 0);
|
|
3191
3444
|
__decorate([
|
|
3192
3445
|
Input()
|
|
3193
|
-
],
|
|
3446
|
+
], LookupComponent.prototype, "lookupDisplayFieldTooltip", void 0);
|
|
3194
3447
|
__decorate([
|
|
3195
3448
|
Input()
|
|
3196
|
-
],
|
|
3449
|
+
], LookupComponent.prototype, "lookupEmptyMessage", void 0);
|
|
3197
3450
|
__decorate([
|
|
3198
3451
|
Input()
|
|
3199
|
-
],
|
|
3452
|
+
], LookupComponent.prototype, "lookupAppendTo", void 0);
|
|
3200
3453
|
__decorate([
|
|
3201
3454
|
Input()
|
|
3202
|
-
],
|
|
3455
|
+
], LookupComponent.prototype, "searchTitle", void 0);
|
|
3203
3456
|
__decorate([
|
|
3204
3457
|
Input()
|
|
3205
|
-
],
|
|
3458
|
+
], LookupComponent.prototype, "searchEmptyTitle", void 0);
|
|
3206
3459
|
__decorate([
|
|
3207
|
-
|
|
3208
|
-
],
|
|
3460
|
+
Input()
|
|
3461
|
+
], LookupComponent.prototype, "searchEmptyDescription", void 0);
|
|
3209
3462
|
__decorate([
|
|
3210
|
-
|
|
3211
|
-
],
|
|
3212
|
-
EmptyStateComponent = EmptyStateComponent_1 = __decorate([
|
|
3213
|
-
Component({
|
|
3214
|
-
selector: `s-empty-state`,
|
|
3215
|
-
template: "<div [id]=\"id\" class=\"container\">\n <div [id]=\"id + '-icon'\" class=\"icon\">\n <i [attr.class]=\"iconClass ? iconClass : 'fa fa-cogs'\" aria-hidden=\"true\"></i>\n </div>\n <div [id]=\"id + '-title'\" class=\"title\">{{title}}</div>\n <div [id]=\"id + '-description'\" class=\"description\" *ngIf=\"description\">\n <p>{{description}}</p>\n </div>\n <div [id]=\"id + '-actions'\" class=\"actions\" *ngIf=\"showPrimaryAction && primaryActionLabel\">\n <s-button [id]=\"id + '-primary-action'\" type=\"button\" [label]=\"primaryActionLabel\"\n [model]=\"primaryModel\" (click)=\"primaryAction.next()\"></s-button>\n <s-button [id]=\"id + '-secondary-action'\" *ngIf=\"showSecondaryAction && secondaryActionLabel\" id=\"secondaryAction\" type=\"button\"\n [label]=\"secondaryActionLabel\" priority=\"link\" (click)=\"secondaryAction.next()\"></s-button>\n </div>\n</div>",
|
|
3216
|
-
styles: [".container{width:100%;text-align:center}.title{font-weight:700;margin-bottom:10px}.description{margin-bottom:15px;color:#999;padding:0 20px;text-align:center}.description>p{margin:auto;max-width:400px;max-height:80px;overflow:hidden}.icon{color:#d8d8d8;font-size:6em}.actions{text-align:center;width:100%}"]
|
|
3217
|
-
})
|
|
3218
|
-
], EmptyStateComponent);
|
|
3219
|
-
|
|
3220
|
-
let EmptyStateGoBackComponent = class EmptyStateGoBackComponent {
|
|
3221
|
-
constructor(cookieService) {
|
|
3222
|
-
this.cookieService = cookieService;
|
|
3223
|
-
this.iconClass = "fa fa-exclamation-triangle";
|
|
3224
|
-
}
|
|
3225
|
-
goBack() {
|
|
3226
|
-
const portalUrl = this.cookieService.get("com.senior.portal.url");
|
|
3227
|
-
window.open(portalUrl, "_top");
|
|
3228
|
-
}
|
|
3229
|
-
};
|
|
3230
|
-
EmptyStateGoBackComponent.nextId = 0;
|
|
3231
|
-
EmptyStateGoBackComponent.ctorParameters = () => [
|
|
3232
|
-
{ type: CookieService }
|
|
3233
|
-
];
|
|
3463
|
+
Input()
|
|
3464
|
+
], LookupComponent.prototype, "searchGridData", void 0);
|
|
3234
3465
|
__decorate([
|
|
3235
3466
|
Input()
|
|
3236
|
-
],
|
|
3467
|
+
], LookupComponent.prototype, "searchTotalRecords", void 0);
|
|
3237
3468
|
__decorate([
|
|
3238
3469
|
Input()
|
|
3239
|
-
],
|
|
3470
|
+
], LookupComponent.prototype, "searchFields", void 0);
|
|
3240
3471
|
__decorate([
|
|
3241
3472
|
Input()
|
|
3242
|
-
],
|
|
3473
|
+
], LookupComponent.prototype, "searchGridFields", void 0);
|
|
3243
3474
|
__decorate([
|
|
3244
3475
|
Input()
|
|
3245
|
-
],
|
|
3246
|
-
|
|
3476
|
+
], LookupComponent.prototype, "multiSortMeta", void 0);
|
|
3477
|
+
__decorate([
|
|
3478
|
+
Input()
|
|
3479
|
+
], LookupComponent.prototype, "filterTitle", void 0);
|
|
3480
|
+
__decorate([
|
|
3481
|
+
Input()
|
|
3482
|
+
], LookupComponent.prototype, "filterLabel", void 0);
|
|
3483
|
+
__decorate([
|
|
3484
|
+
Input()
|
|
3485
|
+
], LookupComponent.prototype, "clearLabel", void 0);
|
|
3486
|
+
__decorate([
|
|
3487
|
+
Input()
|
|
3488
|
+
], LookupComponent.prototype, "cancelLabel", void 0);
|
|
3489
|
+
__decorate([
|
|
3490
|
+
Input()
|
|
3491
|
+
], LookupComponent.prototype, "selectLabel", void 0);
|
|
3492
|
+
__decorate([
|
|
3493
|
+
Input()
|
|
3494
|
+
], LookupComponent.prototype, "emptyFieldLabel", void 0);
|
|
3495
|
+
__decorate([
|
|
3496
|
+
Input()
|
|
3497
|
+
], LookupComponent.prototype, "recordLabel", void 0);
|
|
3498
|
+
__decorate([
|
|
3499
|
+
Input()
|
|
3500
|
+
], LookupComponent.prototype, "recordsLabel", void 0);
|
|
3501
|
+
__decorate([
|
|
3502
|
+
Input()
|
|
3503
|
+
], LookupComponent.prototype, "placeholder", void 0);
|
|
3504
|
+
__decorate([
|
|
3505
|
+
Input()
|
|
3506
|
+
], LookupComponent.prototype, "searchTotalRecordsLabel", void 0);
|
|
3507
|
+
__decorate([
|
|
3508
|
+
Input()
|
|
3509
|
+
], LookupComponent.prototype, "sortableColumnsDisabled", void 0);
|
|
3510
|
+
__decorate([
|
|
3511
|
+
Input()
|
|
3512
|
+
], LookupComponent.prototype, "lookupRowProps", void 0);
|
|
3513
|
+
__decorate([
|
|
3514
|
+
Input()
|
|
3515
|
+
], LookupComponent.prototype, "defaultFilter", void 0);
|
|
3516
|
+
__decorate([
|
|
3517
|
+
Output()
|
|
3518
|
+
], LookupComponent.prototype, "onLookupRequest", void 0);
|
|
3519
|
+
__decorate([
|
|
3520
|
+
Output()
|
|
3521
|
+
], LookupComponent.prototype, "onSearchRequest", void 0);
|
|
3522
|
+
__decorate([
|
|
3523
|
+
Output()
|
|
3524
|
+
], LookupComponent.prototype, "onFocus", void 0);
|
|
3525
|
+
__decorate([
|
|
3526
|
+
Output()
|
|
3527
|
+
], LookupComponent.prototype, "onBlur", void 0);
|
|
3528
|
+
__decorate([
|
|
3529
|
+
Output()
|
|
3530
|
+
], LookupComponent.prototype, "onKeyUp", void 0);
|
|
3531
|
+
__decorate([
|
|
3532
|
+
Output()
|
|
3533
|
+
], LookupComponent.prototype, "onSelect", void 0);
|
|
3534
|
+
__decorate([
|
|
3535
|
+
Output()
|
|
3536
|
+
], LookupComponent.prototype, "onUnselect", void 0);
|
|
3537
|
+
__decorate([
|
|
3538
|
+
Output()
|
|
3539
|
+
], LookupComponent.prototype, "onClear", void 0);
|
|
3540
|
+
__decorate([
|
|
3541
|
+
ViewChild(Table, { static: false })
|
|
3542
|
+
], LookupComponent.prototype, "table", void 0);
|
|
3543
|
+
__decorate([
|
|
3544
|
+
ViewChild(Dialog, { static: false })
|
|
3545
|
+
], LookupComponent.prototype, "dialog", void 0);
|
|
3546
|
+
__decorate([
|
|
3547
|
+
ViewChild(AutoComplete, { static: false })
|
|
3548
|
+
], LookupComponent.prototype, "autocomplete", void 0);
|
|
3549
|
+
LookupComponent = LookupComponent_1 = __decorate([
|
|
3247
3550
|
Component({
|
|
3248
|
-
selector:
|
|
3249
|
-
template: "<s-empty-state \n [iconClass]=\"iconClass\" \n [title]=\"title\" \n [description]=\"description\" \n (primaryAction)=\"goBack()\"\n [primaryActionLabel]=\"primaryActionLabel\">\n</s-empty-state>"
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
}
|
|
3551
|
+
selector: "s-lookup",
|
|
3552
|
+
template: "<div [ngClass]=\"{ inputgroup: showSearch }\">\n <p-autoComplete\n #autocomplete\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [dataKey]=\"dataKey\"\n [multiple]=\"multiple\"\n [inputId]=\"id + '-autocomplete'\"\n [forceSelection]=\"autocompleteForceSelection\"\n [suggestions]=\"getLookupSuggestions()\"\n (completeMethod)=\"lazyLoadLookup($event)\"\n (onSelect)=\"onSelect.next($event)\"\n (onBlur)=\"onBlur.next($event)\"\n (onFocus)=\"onFocus.next($event)\"\n (onUnselect)=\"onUnselect.next($event)\"\n (onClear)=\"onClear.next($event)\"\n (onKeyUp)=\"onKeyUp.next($event)\"\n [field]=\"lookupDisplayField\"\n [emptyMessage]=\"lookupEmptyMessage\"\n [dropdown]=\"!showSearch\"\n [appendTo]=\"lookupAppendTo\"\n [placeholder]=\"placeholder || ' '\"\n [autoHighlight]=\"true\"\n inputStyleClass=\"mousetrap\">\n <ng-template let-item pTemplate=\"selectedItem\">\n <span\n class=\"ui-autocomplete-token-label ng-tns-c65-43 ng-star-inserted\"\n [sTooltip]=\"lookupDisplayFieldTooltip ? item[lookupDisplayField] : null\"\n tooltipPosition=\"top\">\n {{item[lookupDisplayField]}}\n </span>\n </ng-template>\n </p-autoComplete>\n <button\n *ngIf=\"showSearch\"\n pButton\n type=\"button\"\n icon=\"fa fa-search\"\n class=\"button-addon\"\n [disabled]=\"disabled\"\n (click)=\"showDialog()\">\n </button>\n</div>\n<p-dialog\n appendTo=\"body\"\n styleClass=\"s-lookup-modal\"\n [header]=\"searchTitle\"\n [(visible)]=\"dialogVisible\"\n [modal]=\"true\"\n (onHide)=\"hideDialog()\"\n [blockScroll]=\"true\"\n [focusOnShow]=\"true\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n #dialog>\n <div\n *ngIf=\"dialogVisible\"\n class=\"s-lookup-modal-container\">\n <div\n *ngIf=\"searchFields && searchFields.length\"\n class=\"filter\"\n [@collapseContent]=\"collapsed \n ? { value: 'hidden', params: { transitionParams: transitionOptions } }\n : { value: 'visible', params: { transitionParams: transitionOptions } }\"\n (@collapseContent.done)=\"onToggleDone()\">\n <form\n [formGroup]=\"formGroupDialog\"\n novalidate\n autocomplete=\"off\">\n <div\n *ngIf=\"!collapsed\"\n class=\"form-content\"\n [@childCollapseContent]=\"collapsed\n ? { value: ':leave', params: { transitionParams: transitionOptions } }\n : { value: ':enter', params: { transitionParams: transitionOptions } }\">\n <div class=\"filter-title sds-section-title\">{{ filterTitle }}</div>\n <div class=\"form-fields\">\n <s-dynamic-form\n [fields]=\"searchFields\"\n [form]=\"formGroupDialog\">\n </s-dynamic-form>\n </div>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button\n [id]=\"id + '-filter-button'\"\n type=\"submit\"\n [label]=\"filterLabel\"\n (onClick)=\"search()\"\n sTooltip=\"(ALT + SHIFT + F)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n <s-button\n [id]=\"id + '-clear-button'\"\n type=\"button\"\n [label]=\"clearLabel\"\n (onClick)=\"clear()\"\n priority=\"link\"\n sTooltip=\"(ALT + SHIFT + L)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n </div>\n </div>\n </div>\n </form>\n </div>\n <div\n *ngIf=\"searchFields && searchFields.length\"\n class=\"filter-toggle\">\n <div class=\"filter-toggle--start-border-mask\"></div>\n <button\n [id]=\"id + '-filter-toggle-button'\"\n type=\"button\"\n (click)=\"filterToggle()\">\n <span\n class=\"fa\"\n [ngClass]=\"{'fa-chevron-left': !collapsed, 'fa-chevron-right': collapsed}\"\n aria-hidden=\"true\">\n </span>\n </button>\n <div class=\"filter-toggle--end-border-mask\"></div>\n </div>\n <div\n class=\"content\"\n [ngClass]=\"{'empty-content': !searchTotalRecords && !loading}\">\n <s-empty-state\n [id]=\"id + '-empty-state'\"\n *ngIf=\"!searchTotalRecords && !loading\"\n [title]=\"searchEmptyTitle\"\n [description]=\"searchEmptyDescription\"\n iconClass=\"fa fa-search\">\n </s-empty-state>\n <p-table\n [dataKey]=\"dataKey\"\n [value]=\"getGridData()\"\n [columns]=\"searchGridFields\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n sortMode=\"multiple\"\n [totalRecords]=\"searchTotalRecords\"\n [rows]=\"10\"\n [selection]=\"selected\"\n (onLazyLoad)=\"lazyLoadGrid($event)\"\n *sLoadingState=\"loading\"\n [multiSortMeta]=\"multiSortMeta\"\n [attr.data-hidden]=\"!searchTotalRecords && !loading\"\n [selectionMode]=\"multiple ? 'multiple' : 'single'\"\n (selectionChange)=\"onSelectionChange($event)\">\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col\n *ngIf=\"multiple\"\n style=\"width: 50px\" />\n <col\n *ngFor=\"let col of columns\"\n [style.width]=\"col.width\" />\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th\n *ngIf=\"multiple\"\n style=\"width: 50px\">\n <s-table-header-checkbox\n [useAllObject]=\"lookupRowProps ? false : true\"\n [rowProps]=\"lookupRowProps\">\n </s-table-header-checkbox>\n </th>\n <th\n [style.width]=\"col.width\"\n *ngFor=\"let col of columns\"\n [pSortableColumn]=\"col.name\"\n [pSortableColumnDisabled]=\"sortableColumnsDisabled?.includes(col.name)\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.label }}</span>\n <p-sortIcon\n [field]=\"col.name\"\n *ngIf=\"!sortableColumnsDisabled?.includes(col.name)\">\n </p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template\n pTemplate=\"body\"\n let-rowData\n let-columns\n let-rowIndex=\"rowIndex\">\n <tr\n sNavigation\n [pSelectableRow]=\"rowData\"\n [pSelectableRowIndex]=\"rowIndex\"\n sDoubleClick (onDoubleClick)=\"onTableRowDoubleClick(rowData)\">\n <td\n *ngIf=\"multiple\"\n style=\"width: 50px\"\n tabindex=\"0\">\n <p-tableCheckbox\n [value]=\"rowData\"\n [pSelectableRow]=\"rowData\">\n </p-tableCheckbox>\n </td>\n <td\n [style.width]=\"col['width']\"\n *ngFor=\"let col of searchGridFields\"\n [ngSwitch]=\"col.type\"\n tabindex=\"0\">\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <ng-container *ngIf=\"isBooleanValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getBooleanLabel(rowData, col.name, col.optionsLabel) }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Date'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate: col.calendarLocaleOptions?.dateFormat || \"L\" | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'LocalDateTime'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Time'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedTime: col.calendarLocaleOptions?.dateFormat || \"LTS\" | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Integer'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getIntegerMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Double'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getDoubleMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Money'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getMoneyMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Number'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getNumberMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Enum'\">\n <ng-container\n *ngIf=\"getLabelForValue(getFieldValue(rowData, col.name), col.options); else emptyTemplate\"\n >\n <span> {{ getLabelForValue(getFieldValue(rowData, col.name), col.options) }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"col.mask && col.mask()\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name))\">\n <span>{{ getFieldValue(rowData, col.name) | sMaskFormatter: col.mask() }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!(col.mask && col.mask())\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name)); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) }}</span>\n </ng-container>\n </ng-container>\n </ng-container>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span [attr.data-hidden]=\"loading\">\n {{ printRecordTotalizer() }}\n </span>\n </ng-template>\n </p-table>\n </div>\n </div>\n <p-footer>\n <s-button\n [id]=\"id + '-select-button'\"\n type=\"button\"\n [label]=\"selectLabel\"\n (onClick)=\"select()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [disabled]=\"!selected?.length\">\n </s-button>\n <s-button\n [id]=\"id + '-cancel-button'\"\n type=\"button\"\n priority=\"link\"\n [label]=\"cancelLabel\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n </p-footer>\n</p-dialog>\n<ng-template #emptyTemplate>\n <span [ngClass]=\"'sds-empty-value'\">{{ emptyFieldLabel }}</span>\n</ng-template>\n",
|
|
3553
|
+
providers: [
|
|
3554
|
+
{
|
|
3555
|
+
provide: NG_VALUE_ACCESSOR,
|
|
3556
|
+
useExisting: forwardRef(() => LookupComponent_1),
|
|
3557
|
+
multi: true,
|
|
3558
|
+
},
|
|
3559
|
+
],
|
|
3560
|
+
encapsulation: ViewEncapsulation.None,
|
|
3561
|
+
animations: [
|
|
3562
|
+
trigger("collapseContent", [
|
|
3563
|
+
state("hidden", style$7({
|
|
3564
|
+
width: "10px",
|
|
3565
|
+
padding: 0,
|
|
3566
|
+
})),
|
|
3567
|
+
state("visible", style$7({
|
|
3568
|
+
width: "*",
|
|
3569
|
+
})),
|
|
3570
|
+
transition("visible <=> hidden", [group([query("@childCollapseContent", animateChild()), animate("{{transitionParams}}")])]),
|
|
3571
|
+
]),
|
|
3572
|
+
trigger("childCollapseContent", [
|
|
3573
|
+
state(":leave", style$7({
|
|
3574
|
+
opacity: 0,
|
|
3575
|
+
})),
|
|
3576
|
+
state(":enter", style$7({
|
|
3577
|
+
opacity: 1,
|
|
3578
|
+
})),
|
|
3579
|
+
transition("* <=> *", animate("{{transitionParams}}")),
|
|
3580
|
+
]),
|
|
3581
|
+
],
|
|
3582
|
+
styles: ["s-lookup.ng-dirty.ng-invalid .ui-inputtext{border-color:#c13018}s-lookup .ui-inputtext{border-top-right-radius:0;border-bottom-right-radius:0}s-lookup .inputgroup p-autocomplete+button,s-lookup p-autocomplete .ui-autocomplete-dropdown.ui-button{background-color:#fff;border-color:#ccc;border-width:1px 1px 1px 0;color:#333;min-height:34px;height:auto!important;min-width:auto;width:34px!important;overflow:hidden;border-top-left-radius:0;border-bottom-left-radius:0}.ui-fluid s-lookup .inputgroup,s-lookup p-autocomplete span.ui-autocomplete-multiple{display:-ms-flexbox;display:flex}.ui-fluid s-lookup .inputgroup p-autocomplete{display:inline-block}.ui-fluid s-lookup .inputgroup p-autocomplete,.ui-fluid s-lookup p-autocomplete .ui-autocomplete-input{width:calc(100% - 34px)}.ui-fluid s-lookup .inputgroup p-autocomplete .ui-autocomplete-input{width:100%}s-lookup .inputgroup p-autocomplete+button:enabled:hover,s-lookup .inputgroup p-autocomplete+button:focus{background-color:#e6e6e6;border-color:#ccc}s-lookup .inputgroup p-autocomplete .ui-widget .ui-inputtext{border-right-width:1px;border-right-style:solid}s-lookup .ui-autocomplete-input-token,s-lookup .ui-autocomplete-input-token input{width:100%}s-lookup .ui-autocomplete .ui-autocomplete-token{max-width:100%}s-lookup .ui-autocomplete .ui-autocomplete-token-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}body .s-lookup-modal.ui-dialog .ui-dialog-content{padding:0;margin-bottom:0;max-height:none}s-lookup .ui-table-scrollable-body{min-width:100%}.s-lookup-modal{height:80%!important;max-width:100%!important;max-height:inherit!important;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:column;flex-direction:column}.s-lookup-modal .ui-dialog-content{height:auto!important;-ms-flex:1;flex:1;overflow:auto}.s-lookup-modal .ui-dialog-footer,.s-lookup-modal .ui-dialog-header{-ms-flex-negative:0;flex-shrink:0;border-radius:0 0 4px 4px}.s-lookup-modal .s-lookup-modal-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:100%;width:100%}.s-lookup-modal .s-lookup-modal-container .filter{position:relative;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;width:85%;background-color:rgba(229,234,234,.5);height:100%;padding:.571rem}.s-lookup-modal .s-lookup-modal-container .filter form{width:100%;height:100%}.s-lookup-modal .s-lookup-modal-container .filter form .form-content{height:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.s-lookup-modal .s-lookup-modal-container .filter form .form-content .filter-title{padding-left:.5rem}.s-lookup-modal .s-lookup-modal-container .filter form .form-content .form-fields{overflow-y:auto}.s-lookup-modal .s-lookup-modal-container .filter-toggle{-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;width:34px;border-radius:0 4px 4px 0}.s-lookup-modal .s-lookup-modal-container .filter-toggle button{-ms-flex-align:center;align-items:center;position:relative;background-color:rgba(229,234,234,.5);height:34px;width:100%;border:1px solid #e5eaea;outline:0;border-left:none;border-radius:0 4px 4px 0;cursor:pointer;text-decoration:none;text-transform:none;padding:7px;transition:background-color .2s ease-out,color .2s ease-out,border-color .2s ease-out}.s-lookup-modal .s-lookup-modal-container .filter-toggle button:focus,.s-lookup-modal .s-lookup-modal-container .filter-toggle button:hover{background-color:rgba(201,211,211,.5);border-color:#c9d3d3}.s-lookup-modal .s-lookup-modal-container .filter-toggle--start-border-mask{height:15px;border-left:1px solid #e5eaea}.s-lookup-modal .s-lookup-modal-container .filter-toggle--end-border-mask{height:calc(100% - 49px);border-left:1px solid #e5eaea}.s-lookup-modal .s-lookup-modal-container .content{-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:auto;flex-basis:auto;overflow-x:auto;padding:.5rem}.s-lookup-modal .s-lookup-modal-container .content.empty-content{-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center}.s-lookup-modal .s-lookup-modal-container .content .s-loading-state-container,.s-lookup-modal .s-lookup-modal-container .content .s-loading-state-container .contents{height:100%}.s-lookup-modal .s-lookup-modal-container .content p-table{position:relative;height:100%}.s-lookup-modal .s-lookup-modal-container .content p-table .ui-table{height:100%}.s-lookup-modal .s-lookup-modal-container .content p-table .ui-table .ui-table-scrollable-wrapper{height:calc(100% - 60px)}.s-lookup-modal .s-lookup-modal-container .content p-table .ui-table .ui-table-scrollable-wrapper .ui-table-scrollable-view{height:100%}.s-lookup-modal .s-lookup-modal-container .content p-table .ui-table .ui-table-scrollable-wrapper .ui-table-scrollable-view .ui-table-scrollable-body{position:relative;height:calc(100% - 60px)}@media (max-width:767px){.s-lookup-modal{border:none!important;top:0!important;left:0!important;width:100%!important;height:100%!important}}@media (min-width:768px){.s-lookup-modal{width:80%!important}.s-lookup-modal .s-lookup-modal-container .filter{width:40%}}@media (min-width:1200px){.s-lookup-modal{width:60%!important}.s-lookup-modal .s-lookup-modal-container .filter{width:30%}}"]
|
|
3583
|
+
})
|
|
3584
|
+
], LookupComponent);
|
|
3281
3585
|
|
|
3282
|
-
class
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
}
|
|
3286
|
-
static addClass(element, className) {
|
|
3287
|
-
element.nativeElement.className = `${element.nativeElement.className} ${className}`;
|
|
3288
|
-
}
|
|
3289
|
-
static removeClass(element, className) {
|
|
3290
|
-
if (element.nativeElement.className.includes(className)) {
|
|
3291
|
-
element.nativeElement.className = element.nativeElement.className.replace(className, "");
|
|
3292
|
-
}
|
|
3293
|
-
}
|
|
3294
|
-
static exportCSV(columns = [], data = [], csvSeparator = ";", documentName = "download") {
|
|
3295
|
-
let csv = "\ufeff";
|
|
3296
|
-
columns.filter((column) => column.exportable && column.field).forEach((column, i) => {
|
|
3297
|
-
csv += `"${column.header || column.field}"`;
|
|
3298
|
-
if (i < columns.length - 1)
|
|
3299
|
-
csv += csvSeparator;
|
|
3300
|
-
});
|
|
3301
|
-
data.forEach((record) => {
|
|
3302
|
-
csv += "\n";
|
|
3303
|
-
columns.filter((column) => column.exportable && column.field).forEach((column, i) => {
|
|
3304
|
-
let cellData;
|
|
3305
|
-
if (Array.isArray(column.field)) {
|
|
3306
|
-
const fieldValues = column.field.map((col) => this.resolveFieldData(record, col));
|
|
3307
|
-
cellData = fieldValues
|
|
3308
|
-
.flat()
|
|
3309
|
-
.filter((value) => value !== null && value !== undefined)
|
|
3310
|
-
.join(column.separator);
|
|
3311
|
-
}
|
|
3312
|
-
else {
|
|
3313
|
-
cellData = this.resolveFieldData(record, column.field);
|
|
3314
|
-
}
|
|
3315
|
-
if (cellData != null)
|
|
3316
|
-
cellData = String(cellData).replace(/"/g, `""`);
|
|
3317
|
-
else
|
|
3318
|
-
cellData = "";
|
|
3319
|
-
csv += `"${cellData}"`;
|
|
3320
|
-
if (i < columns.length - 1)
|
|
3321
|
-
csv += csvSeparator;
|
|
3322
|
-
});
|
|
3323
|
-
});
|
|
3324
|
-
const blob = new Blob([csv], {
|
|
3325
|
-
type: "text/csv;charset=utf-8;",
|
|
3326
|
-
});
|
|
3327
|
-
if (window.navigator.msSaveOrOpenBlob)
|
|
3328
|
-
navigator.msSaveOrOpenBlob(blob, documentName + ".csv");
|
|
3329
|
-
else {
|
|
3330
|
-
const link = document.createElement("a");
|
|
3331
|
-
link.style.display = "none";
|
|
3332
|
-
document.body.appendChild(link);
|
|
3333
|
-
if (link.download !== undefined) {
|
|
3334
|
-
link.setAttribute("href", URL.createObjectURL(blob));
|
|
3335
|
-
link.setAttribute("download", documentName + ".csv");
|
|
3336
|
-
link.click();
|
|
3337
|
-
}
|
|
3338
|
-
else {
|
|
3339
|
-
csv = "data:text/csv;charset=utf-8," + csv;
|
|
3340
|
-
window.open(encodeURI(csv));
|
|
3341
|
-
}
|
|
3342
|
-
document.body.removeChild(link);
|
|
3343
|
-
}
|
|
3344
|
-
}
|
|
3345
|
-
static resolveFieldData(data, field) {
|
|
3346
|
-
if (data && field) {
|
|
3347
|
-
if (this.isFunction(field))
|
|
3348
|
-
return field(data);
|
|
3349
|
-
else if (field.indexOf(".") == -1)
|
|
3350
|
-
return data[field];
|
|
3351
|
-
else {
|
|
3352
|
-
const fields = field.split(".");
|
|
3353
|
-
let value = data;
|
|
3354
|
-
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
3355
|
-
if (value == null) {
|
|
3356
|
-
return null;
|
|
3357
|
-
}
|
|
3358
|
-
value = value[fields[i]];
|
|
3359
|
-
}
|
|
3360
|
-
return value;
|
|
3361
|
-
}
|
|
3362
|
-
}
|
|
3363
|
-
else
|
|
3364
|
-
return null;
|
|
3586
|
+
class BaseFieldComponent {
|
|
3587
|
+
isFunction(value) {
|
|
3588
|
+
return value instanceof Function;
|
|
3365
3589
|
}
|
|
3366
|
-
|
|
3367
|
-
return
|
|
3590
|
+
trigger(callback) {
|
|
3591
|
+
return callback();
|
|
3368
3592
|
}
|
|
3369
3593
|
}
|
|
3370
3594
|
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
DebounceUtils = __decorate([
|
|
3397
|
-
Injectable({
|
|
3398
|
-
providedIn: 'root',
|
|
3399
|
-
})
|
|
3400
|
-
], DebounceUtils);
|
|
3595
|
+
var DynamicType;
|
|
3596
|
+
(function (DynamicType) {
|
|
3597
|
+
DynamicType["Autocomplete"] = "Autocomplete";
|
|
3598
|
+
DynamicType["Binary"] = "Binary";
|
|
3599
|
+
DynamicType["Boolean"] = "Boolean";
|
|
3600
|
+
DynamicType["Chips"] = "Chips";
|
|
3601
|
+
DynamicType["Date"] = "Date";
|
|
3602
|
+
DynamicType["DateTime"] = "DateTime";
|
|
3603
|
+
DynamicType["LocalDateTime"] = "LocalDateTime";
|
|
3604
|
+
DynamicType["Double"] = "Double";
|
|
3605
|
+
DynamicType["Enum"] = "Enum";
|
|
3606
|
+
DynamicType["Fieldset"] = "Fieldset";
|
|
3607
|
+
DynamicType["Integer"] = "Integer";
|
|
3608
|
+
DynamicType["Lookup"] = "Lookup";
|
|
3609
|
+
DynamicType["Money"] = "Money";
|
|
3610
|
+
DynamicType["Radio"] = "Radio";
|
|
3611
|
+
DynamicType["Row"] = "Row";
|
|
3612
|
+
DynamicType["Section"] = "Section";
|
|
3613
|
+
DynamicType["String"] = "String";
|
|
3614
|
+
DynamicType["Text"] = "Text";
|
|
3615
|
+
DynamicType["Time"] = "Time";
|
|
3616
|
+
DynamicType["Number"] = "Number";
|
|
3617
|
+
DynamicType["Password"] = "Password";
|
|
3618
|
+
DynamicType["Slider"] = "Slider";
|
|
3619
|
+
})(DynamicType || (DynamicType = {}));
|
|
3401
3620
|
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
*/
|
|
3407
|
-
function formatJsonResponse(response) {
|
|
3408
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3409
|
-
return response.json();
|
|
3410
|
-
});
|
|
3621
|
+
class Grid {
|
|
3622
|
+
constructor(config) {
|
|
3623
|
+
Object.assign(this, Object.assign({}, config));
|
|
3624
|
+
}
|
|
3411
3625
|
}
|
|
3412
3626
|
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
*/
|
|
3418
|
-
function formatBlobResponse(response) {
|
|
3419
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3420
|
-
const textResponse = yield (yield response.blob()).text();
|
|
3421
|
-
return JSON.parse(textResponse);
|
|
3422
|
-
});
|
|
3627
|
+
class Row extends Grid {
|
|
3628
|
+
constructor(config) {
|
|
3629
|
+
super(config);
|
|
3630
|
+
}
|
|
3423
3631
|
}
|
|
3424
3632
|
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
class CustomHttpClient {
|
|
3429
|
-
/**
|
|
3430
|
-
* Executes a Http Get
|
|
3431
|
-
* @param url Url to execute the Get on
|
|
3432
|
-
* @param init Optional additional configs
|
|
3433
|
-
* @returns Whether a Promise<T> on request success or an error in request fail
|
|
3434
|
-
*/
|
|
3435
|
-
static GET(url, init = {}) {
|
|
3436
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3437
|
-
const response = yield this.interceptRequest(url, Object.assign(Object.assign({}, init), { method: "GET" }));
|
|
3438
|
-
return this.formatResponse(response);
|
|
3439
|
-
});
|
|
3440
|
-
}
|
|
3441
|
-
/**
|
|
3442
|
-
* Executes a Http Post
|
|
3443
|
-
* @param url Url to execute the Post on
|
|
3444
|
-
* @param body Info to send to server on Post
|
|
3445
|
-
* @param init Optional additional configs
|
|
3446
|
-
* @returns Whether a Promise<T> on request success or an error in request fail
|
|
3447
|
-
*/
|
|
3448
|
-
static POST(url, body, init = {}) {
|
|
3449
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3450
|
-
const headers = new Headers(init.headers);
|
|
3451
|
-
headers.append("Content-Type", "application/json");
|
|
3452
|
-
headers.append("Accept", "application/json");
|
|
3453
|
-
const response = yield this.interceptRequest(url, Object.assign(Object.assign({}, init), { method: "POST", body: JSON.stringify(body), headers }));
|
|
3454
|
-
return this.formatResponse(response);
|
|
3455
|
-
});
|
|
3456
|
-
}
|
|
3457
|
-
/**
|
|
3458
|
-
* Intercepts the original request to add a required header for Senior in case of a internal request
|
|
3459
|
-
* @param url Url from the original request
|
|
3460
|
-
* @param originalReq Configs from the original request
|
|
3461
|
-
* @returns Whether a Promise<Response> if the request was made successfully or an error
|
|
3462
|
-
*/
|
|
3463
|
-
static interceptRequest(url, originalReq = {}) {
|
|
3464
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3465
|
-
try {
|
|
3466
|
-
if (!url.includes("://")) {
|
|
3467
|
-
const restUrl = yield service.getRestUrl();
|
|
3468
|
-
const authHeader = yield user.getAuthHeader();
|
|
3469
|
-
const headers = new Headers(originalReq.headers);
|
|
3470
|
-
headers.append("Authorization", authHeader);
|
|
3471
|
-
const request = new Request(restUrl + url, Object.assign(Object.assign({}, originalReq), { headers }));
|
|
3472
|
-
return fetch(request);
|
|
3473
|
-
}
|
|
3474
|
-
return fetch(url, originalReq);
|
|
3475
|
-
}
|
|
3476
|
-
catch (err) {
|
|
3477
|
-
throw new Error(`Error fetching requested URL: ${err}`);
|
|
3478
|
-
}
|
|
3479
|
-
});
|
|
3480
|
-
}
|
|
3481
|
-
/**
|
|
3482
|
-
* Formats the request response to an object<T> or {}
|
|
3483
|
-
* @param response The response to be formatted
|
|
3484
|
-
* @returns Whether a Promise<T> if the response status is in the range 200-299 an error
|
|
3485
|
-
*/
|
|
3486
|
-
static formatResponse(response) {
|
|
3487
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3488
|
-
const contentType = response.headers.get("content-type");
|
|
3489
|
-
const formatter = CustomHttpClient._responseFormatterMap.get(contentType);
|
|
3490
|
-
const formattedContentType = formatter ? yield formatter(response) : {};
|
|
3491
|
-
if (response.ok)
|
|
3492
|
-
return formattedContentType;
|
|
3493
|
-
throw new Error(JSON.stringify(formattedContentType));
|
|
3494
|
-
});
|
|
3633
|
+
class Structure {
|
|
3634
|
+
constructor(config) {
|
|
3635
|
+
Object.assign(this, Object.assign({}, config));
|
|
3495
3636
|
}
|
|
3496
3637
|
}
|
|
3497
|
-
CustomHttpClient._responseFormatterMap = new Map([
|
|
3498
|
-
["application/json", formatJsonResponse],
|
|
3499
|
-
["application/octet-stream", formatBlobResponse]
|
|
3500
|
-
]);
|
|
3501
3638
|
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
/**
|
|
3507
|
-
* Method used to get the translation for an key based on the host project's translations. Always use the first available language
|
|
3508
|
-
* @param key Key used to search the translation
|
|
3509
|
-
* @returns The translation for the informed key or the key in case there is no translation
|
|
3510
|
-
*/
|
|
3511
|
-
static translate(key) {
|
|
3512
|
-
var _a, _b;
|
|
3513
|
-
if (key === undefined || key === null)
|
|
3514
|
-
return "";
|
|
3515
|
-
const translationKey = `${CustomTranslationsService._TRANSLATION_PREFIX}${key}`;
|
|
3516
|
-
const firstLanguageTranslations = (_a = Object.values(CustomTranslationsService._translations)[0]) !== null && _a !== void 0 ? _a : {};
|
|
3517
|
-
return (_b = firstLanguageTranslations[translationKey]) !== null && _b !== void 0 ? _b : translationKey;
|
|
3518
|
-
}
|
|
3519
|
-
/**
|
|
3520
|
-
* Method used to set the translations that will be used as base when calling the "translate" method
|
|
3521
|
-
* @param translations Translations to use as base
|
|
3522
|
-
*/
|
|
3523
|
-
static setTranslations(translations) {
|
|
3524
|
-
CustomTranslationsService._translations = translations !== null && translations !== void 0 ? translations : {};
|
|
3639
|
+
class Fieldset extends Structure {
|
|
3640
|
+
constructor(config) {
|
|
3641
|
+
super(config);
|
|
3642
|
+
Object.assign(this, Object.assign({}, config));
|
|
3525
3643
|
}
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
const { domain, service } = hostProjectConfigs !== null && hostProjectConfigs !== void 0 ? hostProjectConfigs : {};
|
|
3532
|
-
const prefix = `${domain}.${service}.`;
|
|
3533
|
-
CustomTranslationsService._TRANSLATION_PREFIX = prefix;
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3646
|
+
class Section extends Structure {
|
|
3647
|
+
constructor(config) {
|
|
3648
|
+
super(config);
|
|
3534
3649
|
}
|
|
3535
3650
|
}
|
|
3536
|
-
CustomTranslationsService._translations = {};
|
|
3537
|
-
CustomTranslationsService._TRANSLATION_PREFIX = "";
|
|
3538
3651
|
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3652
|
+
class DynamicConfig {
|
|
3653
|
+
constructor(config) {
|
|
3654
|
+
const { type, representedBy } = config;
|
|
3655
|
+
switch (type) {
|
|
3656
|
+
case DynamicType.Autocomplete:
|
|
3657
|
+
return new AutocompleteField(config);
|
|
3658
|
+
case DynamicType.Binary:
|
|
3659
|
+
case DynamicType.String:
|
|
3660
|
+
return new TextField(config);
|
|
3661
|
+
case DynamicType.Password:
|
|
3662
|
+
return new PasswordField(config);
|
|
3663
|
+
case DynamicType.Boolean:
|
|
3664
|
+
if (representedBy === "switch") {
|
|
3665
|
+
return new BooleanSwitchField(config);
|
|
3549
3666
|
}
|
|
3550
|
-
|
|
3551
|
-
|
|
3667
|
+
return new BooleanField(config);
|
|
3668
|
+
case DynamicType.Chips:
|
|
3669
|
+
return new ChipsField(config);
|
|
3670
|
+
case DynamicType.Date:
|
|
3671
|
+
case DynamicType.DateTime:
|
|
3672
|
+
case DynamicType.LocalDateTime:
|
|
3673
|
+
case DynamicType.Time:
|
|
3674
|
+
return new CalendarField(config);
|
|
3675
|
+
case DynamicType.Double:
|
|
3676
|
+
return new DecimalField(config);
|
|
3677
|
+
case DynamicType.Enum:
|
|
3678
|
+
return new SelectField(config);
|
|
3679
|
+
case DynamicType.Fieldset:
|
|
3680
|
+
return new Fieldset(config);
|
|
3681
|
+
case DynamicType.Integer:
|
|
3682
|
+
return new NumberField(config);
|
|
3683
|
+
case DynamicType.Number:
|
|
3684
|
+
return new BignumberField(config);
|
|
3685
|
+
case DynamicType.Lookup:
|
|
3686
|
+
return new LookupField(config);
|
|
3687
|
+
case DynamicType.Money:
|
|
3688
|
+
return new CurrencyField(config);
|
|
3689
|
+
case DynamicType.Radio:
|
|
3690
|
+
return new RadioButtonField(config);
|
|
3691
|
+
case DynamicType.Row:
|
|
3692
|
+
return new Row(config);
|
|
3693
|
+
case DynamicType.Section:
|
|
3694
|
+
return new Section(config);
|
|
3695
|
+
case DynamicType.Slider:
|
|
3696
|
+
return new SliderField(config);
|
|
3697
|
+
case DynamicType.Text:
|
|
3698
|
+
return new TextAreaField(config);
|
|
3699
|
+
}
|
|
3700
|
+
}
|
|
3701
|
+
}
|
|
3702
|
+
|
|
3703
|
+
let DynamicFormComponent = class DynamicFormComponent {
|
|
3704
|
+
constructor() {
|
|
3705
|
+
this.errorMessages = {};
|
|
3552
3706
|
}
|
|
3553
3707
|
};
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
],
|
|
3708
|
+
__decorate([
|
|
3709
|
+
Input()
|
|
3710
|
+
], DynamicFormComponent.prototype, "id", void 0);
|
|
3711
|
+
__decorate([
|
|
3712
|
+
Input()
|
|
3713
|
+
], DynamicFormComponent.prototype, "configs", void 0);
|
|
3714
|
+
__decorate([
|
|
3715
|
+
Input()
|
|
3716
|
+
], DynamicFormComponent.prototype, "fields", void 0);
|
|
3717
|
+
__decorate([
|
|
3718
|
+
Input()
|
|
3719
|
+
], DynamicFormComponent.prototype, "form", void 0);
|
|
3720
|
+
__decorate([
|
|
3721
|
+
Input()
|
|
3722
|
+
], DynamicFormComponent.prototype, "errorMessages", void 0);
|
|
3723
|
+
__decorate([
|
|
3724
|
+
Input()
|
|
3725
|
+
], DynamicFormComponent.prototype, "displayTimeInfoSign", void 0);
|
|
3726
|
+
DynamicFormComponent = __decorate([
|
|
3727
|
+
Component({
|
|
3728
|
+
selector: "s-dynamic-form",
|
|
3729
|
+
template: "<div *ngIf=\"configs; else templateFields\">\n <ng-container *ngFor=\"let config of configs\">\n <ng-container *sDynamicForm=\"{ id: id, config: config, group: form, errorMessages: errorMessages }\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #templateFields>\n <s-dynamic-field [id]=\"id\" [fields]=\"fields\" [form]=\"form\" [errorMessages]=\"errorMessages\" [displayTimeInfoSign]=\"displayTimeInfoSign\"></s-dynamic-field>\n</ng-template>\n",
|
|
3730
|
+
encapsulation: ViewEncapsulation.None,
|
|
3731
|
+
styles: ["label.required:after{content:\" *\";color:#c13018}"]
|
|
3732
|
+
})
|
|
3733
|
+
], DynamicFormComponent);
|
|
3557
3734
|
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
this.
|
|
3565
|
-
this.
|
|
3566
|
-
this.
|
|
3735
|
+
var EmptyStateComponent_1;
|
|
3736
|
+
let EmptyStateComponent = EmptyStateComponent_1 = class EmptyStateComponent {
|
|
3737
|
+
constructor() {
|
|
3738
|
+
this.id = `s-empty-state-${EmptyStateComponent_1.nextId++}`;
|
|
3739
|
+
this.iconClass = "fa fa-inbox";
|
|
3740
|
+
this.showPrimaryAction = true;
|
|
3741
|
+
this.showSecondaryAction = true;
|
|
3742
|
+
this.primaryModel = [];
|
|
3743
|
+
this.primaryAction = new EventEmitter();
|
|
3744
|
+
this.secondaryAction = new EventEmitter();
|
|
3567
3745
|
}
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3746
|
+
};
|
|
3747
|
+
EmptyStateComponent.nextId = 0;
|
|
3748
|
+
__decorate([
|
|
3749
|
+
Input()
|
|
3750
|
+
], EmptyStateComponent.prototype, "id", void 0);
|
|
3751
|
+
__decorate([
|
|
3752
|
+
Input()
|
|
3753
|
+
], EmptyStateComponent.prototype, "iconClass", void 0);
|
|
3754
|
+
__decorate([
|
|
3755
|
+
Input()
|
|
3756
|
+
], EmptyStateComponent.prototype, "title", void 0);
|
|
3757
|
+
__decorate([
|
|
3758
|
+
Input()
|
|
3759
|
+
], EmptyStateComponent.prototype, "description", void 0);
|
|
3760
|
+
__decorate([
|
|
3761
|
+
Input()
|
|
3762
|
+
], EmptyStateComponent.prototype, "showPrimaryAction", void 0);
|
|
3763
|
+
__decorate([
|
|
3764
|
+
Input()
|
|
3765
|
+
], EmptyStateComponent.prototype, "showSecondaryAction", void 0);
|
|
3766
|
+
__decorate([
|
|
3767
|
+
Input()
|
|
3768
|
+
], EmptyStateComponent.prototype, "primaryActionLabel", void 0);
|
|
3769
|
+
__decorate([
|
|
3770
|
+
Input()
|
|
3771
|
+
], EmptyStateComponent.prototype, "secondaryActionLabel", void 0);
|
|
3772
|
+
__decorate([
|
|
3773
|
+
Input()
|
|
3774
|
+
], EmptyStateComponent.prototype, "primaryModel", void 0);
|
|
3775
|
+
__decorate([
|
|
3776
|
+
Output()
|
|
3777
|
+
], EmptyStateComponent.prototype, "primaryAction", void 0);
|
|
3778
|
+
__decorate([
|
|
3779
|
+
Output()
|
|
3780
|
+
], EmptyStateComponent.prototype, "secondaryAction", void 0);
|
|
3781
|
+
EmptyStateComponent = EmptyStateComponent_1 = __decorate([
|
|
3782
|
+
Component({
|
|
3783
|
+
selector: `s-empty-state`,
|
|
3784
|
+
template: "<div [id]=\"id\" class=\"container\">\n <div [id]=\"id + '-icon'\" class=\"icon\">\n <i [attr.class]=\"iconClass ? iconClass : 'fa fa-cogs'\" aria-hidden=\"true\"></i>\n </div>\n <div [id]=\"id + '-title'\" class=\"title\">{{title}}</div>\n <div [id]=\"id + '-description'\" class=\"description\" *ngIf=\"description\">\n <p>{{description}}</p>\n </div>\n <div [id]=\"id + '-actions'\" class=\"actions\" *ngIf=\"showPrimaryAction && primaryActionLabel\">\n <s-button [id]=\"id + '-primary-action'\" type=\"button\" [label]=\"primaryActionLabel\"\n [model]=\"primaryModel\" (click)=\"primaryAction.next()\"></s-button>\n <s-button [id]=\"id + '-secondary-action'\" *ngIf=\"showSecondaryAction && secondaryActionLabel\" id=\"secondaryAction\" type=\"button\"\n [label]=\"secondaryActionLabel\" priority=\"link\" (click)=\"secondaryAction.next()\"></s-button>\n </div>\n</div>",
|
|
3785
|
+
styles: [".container{width:100%;text-align:center}.title{font-weight:700;margin-bottom:10px}.description{margin-bottom:15px;color:#999;padding:0 20px;text-align:center}.description>p{margin:auto;max-width:400px;max-height:80px;overflow:hidden}.icon{color:#d8d8d8;font-size:6em}.actions{text-align:center;width:100%}"]
|
|
3786
|
+
})
|
|
3787
|
+
], EmptyStateComponent);
|
|
3788
|
+
|
|
3789
|
+
let EmptyStateGoBackComponent = class EmptyStateGoBackComponent {
|
|
3790
|
+
constructor(cookieService) {
|
|
3791
|
+
this.cookieService = cookieService;
|
|
3792
|
+
this.iconClass = "fa fa-exclamation-triangle";
|
|
3793
|
+
}
|
|
3794
|
+
goBack() {
|
|
3795
|
+
const portalUrl = this.cookieService.get("com.senior.portal.url");
|
|
3796
|
+
window.open(portalUrl, "_top");
|
|
3571
3797
|
}
|
|
3572
3798
|
};
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
{ type:
|
|
3576
|
-
];
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3799
|
+
EmptyStateGoBackComponent.nextId = 0;
|
|
3800
|
+
EmptyStateGoBackComponent.ctorParameters = () => [
|
|
3801
|
+
{ type: CookieService }
|
|
3802
|
+
];
|
|
3803
|
+
__decorate([
|
|
3804
|
+
Input()
|
|
3805
|
+
], EmptyStateGoBackComponent.prototype, "iconClass", void 0);
|
|
3806
|
+
__decorate([
|
|
3807
|
+
Input()
|
|
3808
|
+
], EmptyStateGoBackComponent.prototype, "title", void 0);
|
|
3809
|
+
__decorate([
|
|
3810
|
+
Input()
|
|
3811
|
+
], EmptyStateGoBackComponent.prototype, "description", void 0);
|
|
3812
|
+
__decorate([
|
|
3813
|
+
Input()
|
|
3814
|
+
], EmptyStateGoBackComponent.prototype, "primaryActionLabel", void 0);
|
|
3815
|
+
EmptyStateGoBackComponent = __decorate([
|
|
3816
|
+
Component({
|
|
3817
|
+
selector: `s-empty-state-go-back`,
|
|
3818
|
+
template: "<s-empty-state \n [iconClass]=\"iconClass\" \n [title]=\"title\" \n [description]=\"description\" \n (primaryAction)=\"goBack()\"\n [primaryActionLabel]=\"primaryActionLabel\">\n</s-empty-state>"
|
|
3819
|
+
})
|
|
3820
|
+
], EmptyStateGoBackComponent);
|
|
3821
|
+
|
|
3822
|
+
let EmptyStateModule = class EmptyStateModule {
|
|
3823
|
+
};
|
|
3824
|
+
EmptyStateModule = __decorate([
|
|
3825
|
+
NgModule({
|
|
3826
|
+
imports: [CommonModule, ButtonModule],
|
|
3827
|
+
providers: [CookieService],
|
|
3828
|
+
declarations: [EmptyStateComponent, EmptyStateGoBackComponent],
|
|
3829
|
+
exports: [EmptyStateComponent, EmptyStateGoBackComponent],
|
|
3830
|
+
})
|
|
3831
|
+
], EmptyStateModule);
|
|
3832
|
+
|
|
3833
|
+
var ValidateErrors;
|
|
3834
|
+
(function (ValidateErrors) {
|
|
3835
|
+
ValidateErrors["MAX_FILE_SIZE"] = "MAX_FILE_SIZE";
|
|
3836
|
+
ValidateErrors["MAX_FILE_LIMIT"] = "MAX_FILE_LIMIT";
|
|
3837
|
+
ValidateErrors["UNSUPPORTED_EXTENSION"] = "UNSUPPORTED_EXTENSION";
|
|
3838
|
+
})(ValidateErrors || (ValidateErrors = {}));
|
|
3839
|
+
|
|
3840
|
+
const Breakpoints = {
|
|
3841
|
+
SM_MIN: 0,
|
|
3842
|
+
SM_MAX: 767,
|
|
3843
|
+
MD_MIN: 768,
|
|
3844
|
+
MD_MAX: 991,
|
|
3845
|
+
LG_MIN: 992,
|
|
3846
|
+
LG_MAX: 1199,
|
|
3847
|
+
XL_MIN: 1200,
|
|
3848
|
+
XL_MAX: Infinity,
|
|
3849
|
+
};
|
|
3581
3850
|
|
|
3582
|
-
|
|
3851
|
+
class ExportUtils {
|
|
3583
3852
|
constructor() {
|
|
3584
|
-
|
|
3585
|
-
this.TOKEN = new AbortController();
|
|
3586
|
-
}
|
|
3587
|
-
getMetadataCustomField(request) {
|
|
3588
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3589
|
-
return CustomHttpClient.POST(`${this.BASE_URL_FIELD_CUSTOMIZATION}/queries/getFileMetadata`, request, { signal: this.TOKEN.signal });
|
|
3590
|
-
});
|
|
3853
|
+
throw new Error("Classe não deve ser instanciada.");
|
|
3591
3854
|
}
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
Injectable()
|
|
3595
|
-
], FileUploadService);
|
|
3596
|
-
|
|
3597
|
-
var FileUploadComponent_1;
|
|
3598
|
-
const moment$3 = moment_;
|
|
3599
|
-
let FileUploadComponent = FileUploadComponent_1 = class FileUploadComponent {
|
|
3600
|
-
constructor(sanitizer, fileUploadService, translate) {
|
|
3601
|
-
this.sanitizer = sanitizer;
|
|
3602
|
-
this.fileUploadService = fileUploadService;
|
|
3603
|
-
this.translate = translate;
|
|
3604
|
-
this.id = `s-file-upload-${FileUploadComponent_1.nextId++}`;
|
|
3605
|
-
this.chooseLabel = "Anexar arquivos";
|
|
3606
|
-
this.removeLabel = "Remover";
|
|
3607
|
-
this.cancelLabel = "Cancelar";
|
|
3608
|
-
this.successTooltip = "Arquivo anexado com sucesso";
|
|
3609
|
-
this.supportedExtensions = [];
|
|
3610
|
-
this.ariaLabelProgress = "Carregando arquivo";
|
|
3611
|
-
this.disabled = false;
|
|
3612
|
-
this.showFileUploadDate = false;
|
|
3613
|
-
this.uploadHandler = new EventEmitter();
|
|
3614
|
-
this.removeFile = new EventEmitter();
|
|
3615
|
-
this.cancelUpload = new EventEmitter();
|
|
3616
|
-
this.downloadFile = new EventEmitter();
|
|
3617
|
-
this.validateErrors = new EventEmitter();
|
|
3618
|
-
this._files = [];
|
|
3619
|
-
this.ngUsubscribe = new Subject();
|
|
3620
|
-
this.inputValue = "";
|
|
3855
|
+
static addClass(element, className) {
|
|
3856
|
+
element.nativeElement.className = `${element.nativeElement.className} ${className}`;
|
|
3621
3857
|
}
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
this.getUploadDate(files);
|
|
3858
|
+
static removeClass(element, className) {
|
|
3859
|
+
if (element.nativeElement.className.includes(className)) {
|
|
3860
|
+
element.nativeElement.className = element.nativeElement.className.replace(className, "");
|
|
3626
3861
|
}
|
|
3627
|
-
this._files = files.map(file => {
|
|
3628
|
-
if (this.isImage(file)) {
|
|
3629
|
-
file.objectURL = this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(file));
|
|
3630
|
-
}
|
|
3631
|
-
return file;
|
|
3632
|
-
});
|
|
3633
|
-
}
|
|
3634
|
-
ngOnInit() {
|
|
3635
|
-
this.supportedExtensions = this.supportedExtensions
|
|
3636
|
-
.map(extension => extension.replace(".", "").toLowerCase());
|
|
3637
|
-
}
|
|
3638
|
-
ngOnDestroy() {
|
|
3639
|
-
this.ngUsubscribe.next();
|
|
3640
|
-
this.ngUsubscribe.complete();
|
|
3641
|
-
}
|
|
3642
|
-
ngAfterContentInit() {
|
|
3643
|
-
this.update();
|
|
3644
|
-
}
|
|
3645
|
-
onResize() {
|
|
3646
|
-
this.update();
|
|
3647
3862
|
}
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3863
|
+
static exportCSV(columns = [], data = [], csvSeparator = ";", documentName = "download") {
|
|
3864
|
+
let csv = "\ufeff";
|
|
3865
|
+
columns.filter((column) => column.exportable && column.field).forEach((column, i) => {
|
|
3866
|
+
csv += `"${column.header || column.field}"`;
|
|
3867
|
+
if (i < columns.length - 1)
|
|
3868
|
+
csv += csvSeparator;
|
|
3869
|
+
});
|
|
3870
|
+
data.forEach((record) => {
|
|
3871
|
+
csv += "\n";
|
|
3872
|
+
columns.filter((column) => column.exportable && column.field).forEach((column, i) => {
|
|
3873
|
+
let cellData;
|
|
3874
|
+
if (Array.isArray(column.field)) {
|
|
3875
|
+
const fieldValues = column.field.map((col) => this.resolveFieldData(record, col));
|
|
3876
|
+
cellData = fieldValues
|
|
3877
|
+
.flat()
|
|
3878
|
+
.filter((value) => value !== null && value !== undefined)
|
|
3879
|
+
.join(column.separator);
|
|
3880
|
+
}
|
|
3881
|
+
else {
|
|
3882
|
+
cellData = this.resolveFieldData(record, column.field);
|
|
3883
|
+
}
|
|
3884
|
+
if (cellData != null)
|
|
3885
|
+
cellData = String(cellData).replace(/"/g, `""`);
|
|
3886
|
+
else
|
|
3887
|
+
cellData = "";
|
|
3888
|
+
csv += `"${cellData}"`;
|
|
3889
|
+
if (i < columns.length - 1)
|
|
3890
|
+
csv += csvSeparator;
|
|
3657
3891
|
});
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3892
|
+
});
|
|
3893
|
+
const blob = new Blob([csv], {
|
|
3894
|
+
type: "text/csv;charset=utf-8;",
|
|
3895
|
+
});
|
|
3896
|
+
if (window.navigator.msSaveOrOpenBlob)
|
|
3897
|
+
navigator.msSaveOrOpenBlob(blob, documentName + ".csv");
|
|
3898
|
+
else {
|
|
3899
|
+
const link = document.createElement("a");
|
|
3900
|
+
link.style.display = "none";
|
|
3901
|
+
document.body.appendChild(link);
|
|
3902
|
+
if (link.download !== undefined) {
|
|
3903
|
+
link.setAttribute("href", URL.createObjectURL(blob));
|
|
3904
|
+
link.setAttribute("download", documentName + ".csv");
|
|
3905
|
+
link.click();
|
|
3668
3906
|
}
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
validation: ValidateErrors.MAX_FILE_SIZE,
|
|
3673
|
-
});
|
|
3674
|
-
continue;
|
|
3907
|
+
else {
|
|
3908
|
+
csv = "data:text/csv;charset=utf-8," + csv;
|
|
3909
|
+
window.open(encodeURI(csv));
|
|
3675
3910
|
}
|
|
3676
|
-
|
|
3677
|
-
}
|
|
3678
|
-
if (newFiles.length) {
|
|
3679
|
-
this.files = this.files.concat(newFiles);
|
|
3680
|
-
this.uploadHandler.emit({
|
|
3681
|
-
files: newFiles,
|
|
3682
|
-
});
|
|
3911
|
+
document.body.removeChild(link);
|
|
3683
3912
|
}
|
|
3684
|
-
this.clearFileInput();
|
|
3685
3913
|
}
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3914
|
+
static resolveFieldData(data, field) {
|
|
3915
|
+
if (data && field) {
|
|
3916
|
+
if (this.isFunction(field))
|
|
3917
|
+
return field(data);
|
|
3918
|
+
else if (field.indexOf(".") == -1)
|
|
3919
|
+
return data[field];
|
|
3920
|
+
else {
|
|
3921
|
+
const fields = field.split(".");
|
|
3922
|
+
let value = data;
|
|
3923
|
+
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
3924
|
+
if (value == null) {
|
|
3925
|
+
return null;
|
|
3926
|
+
}
|
|
3927
|
+
value = value[fields[i]];
|
|
3928
|
+
}
|
|
3929
|
+
return value;
|
|
3930
|
+
}
|
|
3691
3931
|
}
|
|
3932
|
+
else
|
|
3933
|
+
return null;
|
|
3692
3934
|
}
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
if (removedFiles.length) {
|
|
3696
|
-
this.cancelUpload.emit(index);
|
|
3697
|
-
}
|
|
3698
|
-
this.clearFileInput();
|
|
3935
|
+
static isFunction(obj) {
|
|
3936
|
+
return !!(obj && obj.constructor && obj.call && obj.apply);
|
|
3699
3937
|
}
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3938
|
+
}
|
|
3939
|
+
|
|
3940
|
+
/**
|
|
3941
|
+
* Formats a JSON response to a JS object
|
|
3942
|
+
* @param response The response to format
|
|
3943
|
+
* @returns A JS object based on the response's body
|
|
3944
|
+
*/
|
|
3945
|
+
function formatJsonResponse(response) {
|
|
3946
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3947
|
+
return response.json();
|
|
3948
|
+
});
|
|
3949
|
+
}
|
|
3950
|
+
|
|
3951
|
+
/**
|
|
3952
|
+
* Formats a Blob response to a JS object
|
|
3953
|
+
* @param response The response to format
|
|
3954
|
+
* @returns A JS object based on the response's body
|
|
3955
|
+
*/
|
|
3956
|
+
function formatBlobResponse(response) {
|
|
3957
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3958
|
+
const textResponse = yield (yield response.blob()).text();
|
|
3959
|
+
return JSON.parse(textResponse);
|
|
3960
|
+
});
|
|
3961
|
+
}
|
|
3962
|
+
|
|
3963
|
+
/**
|
|
3964
|
+
* Custom HttpClient for cases when is not possible to use the Angular's HttpClient
|
|
3965
|
+
*/
|
|
3966
|
+
class CustomHttpClient {
|
|
3967
|
+
/**
|
|
3968
|
+
* Executes a Http Get
|
|
3969
|
+
* @param url Url to execute the Get on
|
|
3970
|
+
* @param init Optional additional configs
|
|
3971
|
+
* @returns Whether a Promise<T> on request success or an error in request fail
|
|
3972
|
+
*/
|
|
3973
|
+
static GET(url, init = {}) {
|
|
3974
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3975
|
+
const response = yield this.interceptRequest(url, Object.assign(Object.assign({}, init), { method: "GET" }));
|
|
3976
|
+
return this.formatResponse(response);
|
|
3704
3977
|
});
|
|
3705
3978
|
}
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
return
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3979
|
+
/**
|
|
3980
|
+
* Executes a Http Post
|
|
3981
|
+
* @param url Url to execute the Post on
|
|
3982
|
+
* @param body Info to send to server on Post
|
|
3983
|
+
* @param init Optional additional configs
|
|
3984
|
+
* @returns Whether a Promise<T> on request success or an error in request fail
|
|
3985
|
+
*/
|
|
3986
|
+
static POST(url, body, init = {}) {
|
|
3987
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3988
|
+
const headers = new Headers(init.headers);
|
|
3989
|
+
headers.append("Content-Type", "application/json");
|
|
3990
|
+
headers.append("Accept", "application/json");
|
|
3991
|
+
const response = yield this.interceptRequest(url, Object.assign(Object.assign({}, init), { method: "POST", body: JSON.stringify(body), headers }));
|
|
3992
|
+
return this.formatResponse(response);
|
|
3993
|
+
});
|
|
3721
3994
|
}
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3995
|
+
/**
|
|
3996
|
+
* Intercepts the original request to add a required header for Senior in case of a internal request
|
|
3997
|
+
* @param url Url from the original request
|
|
3998
|
+
* @param originalReq Configs from the original request
|
|
3999
|
+
* @returns Whether a Promise<Response> if the request was made successfully or an error
|
|
4000
|
+
*/
|
|
4001
|
+
static interceptRequest(url, originalReq = {}) {
|
|
4002
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4003
|
+
try {
|
|
4004
|
+
if (!url.includes("://")) {
|
|
4005
|
+
const restUrl = yield service.getRestUrl();
|
|
4006
|
+
const authHeader = yield user.getAuthHeader();
|
|
4007
|
+
const headers = new Headers(originalReq.headers);
|
|
4008
|
+
headers.append("Authorization", authHeader);
|
|
4009
|
+
const request = new Request(restUrl + url, Object.assign(Object.assign({}, originalReq), { headers }));
|
|
4010
|
+
return fetch(request);
|
|
4011
|
+
}
|
|
4012
|
+
return fetch(url, originalReq);
|
|
4013
|
+
}
|
|
4014
|
+
catch (err) {
|
|
4015
|
+
throw new Error(`Error fetching requested URL: ${err}`);
|
|
4016
|
+
}
|
|
4017
|
+
});
|
|
3727
4018
|
}
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
return
|
|
4019
|
+
/**
|
|
4020
|
+
* Formats the request response to an object<T> or {}
|
|
4021
|
+
* @param response The response to be formatted
|
|
4022
|
+
* @returns Whether a Promise<T> if the response status is in the range 200-299 an error
|
|
4023
|
+
*/
|
|
4024
|
+
static formatResponse(response) {
|
|
4025
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4026
|
+
const contentType = response.headers.get("content-type");
|
|
4027
|
+
const formatter = CustomHttpClient._responseFormatterMap.get(contentType);
|
|
4028
|
+
const formattedContentType = formatter ? yield formatter(response) : {};
|
|
4029
|
+
if (response.ok)
|
|
4030
|
+
return formattedContentType;
|
|
4031
|
+
throw new Error(JSON.stringify(formattedContentType));
|
|
4032
|
+
});
|
|
3735
4033
|
}
|
|
3736
|
-
|
|
3737
|
-
|
|
4034
|
+
}
|
|
4035
|
+
CustomHttpClient._responseFormatterMap = new Map([
|
|
4036
|
+
["application/json", formatJsonResponse],
|
|
4037
|
+
["application/octet-stream", formatBlobResponse]
|
|
4038
|
+
]);
|
|
4039
|
+
|
|
4040
|
+
/**
|
|
4041
|
+
* Custom translator for cases when is not possible to use the "TranslateService" from "@ngx-translate/core"
|
|
4042
|
+
*/
|
|
4043
|
+
class CustomTranslationsService {
|
|
4044
|
+
/**
|
|
4045
|
+
* Method used to get the translation for an key based on the host project's translations. Always use the first available language
|
|
4046
|
+
* @param key Key used to search the translation
|
|
4047
|
+
* @returns The translation for the informed key or the key in case there is no translation
|
|
4048
|
+
*/
|
|
4049
|
+
static translate(key) {
|
|
4050
|
+
var _a, _b;
|
|
4051
|
+
if (key === undefined || key === null)
|
|
4052
|
+
return "";
|
|
4053
|
+
const translationKey = `${CustomTranslationsService._TRANSLATION_PREFIX}${key}`;
|
|
4054
|
+
const firstLanguageTranslations = (_a = Object.values(CustomTranslationsService._translations)[0]) !== null && _a !== void 0 ? _a : {};
|
|
4055
|
+
return (_b = firstLanguageTranslations[translationKey]) !== null && _b !== void 0 ? _b : translationKey;
|
|
3738
4056
|
}
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
4057
|
+
/**
|
|
4058
|
+
* Method used to set the translations that will be used as base when calling the "translate" method
|
|
4059
|
+
* @param translations Translations to use as base
|
|
4060
|
+
*/
|
|
4061
|
+
static setTranslations(translations) {
|
|
4062
|
+
CustomTranslationsService._translations = translations !== null && translations !== void 0 ? translations : {};
|
|
3745
4063
|
}
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
const
|
|
3752
|
-
|
|
4064
|
+
/**
|
|
4065
|
+
* Method used to set the prefix that will be used when calling the "translate" method
|
|
4066
|
+
* @param hostProjectConfigs The host project's configs used to create the prefix
|
|
4067
|
+
*/
|
|
4068
|
+
static setTranslationsPrefix(hostProjectConfigs) {
|
|
4069
|
+
const { domain, service } = hostProjectConfigs !== null && hostProjectConfigs !== void 0 ? hostProjectConfigs : {};
|
|
4070
|
+
const prefix = `${domain}.${service}.`;
|
|
4071
|
+
CustomTranslationsService._TRANSLATION_PREFIX = prefix;
|
|
3753
4072
|
}
|
|
3754
|
-
}
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
{ type: DomSanitizer },
|
|
3758
|
-
{ type: FileUploadService },
|
|
3759
|
-
{ type: TranslateService }
|
|
3760
|
-
];
|
|
3761
|
-
__decorate([
|
|
3762
|
-
ViewChild("inputUpload", { static: false })
|
|
3763
|
-
], FileUploadComponent.prototype, "inputUpload", void 0);
|
|
3764
|
-
__decorate([
|
|
3765
|
-
ViewChild("anchor", { static: false })
|
|
3766
|
-
], FileUploadComponent.prototype, "anchor", void 0);
|
|
3767
|
-
__decorate([
|
|
3768
|
-
Input()
|
|
3769
|
-
], FileUploadComponent.prototype, "id", void 0);
|
|
3770
|
-
__decorate([
|
|
3771
|
-
Input()
|
|
3772
|
-
], FileUploadComponent.prototype, "chooseLabel", void 0);
|
|
3773
|
-
__decorate([
|
|
3774
|
-
Input()
|
|
3775
|
-
], FileUploadComponent.prototype, "removeLabel", void 0);
|
|
3776
|
-
__decorate([
|
|
3777
|
-
Input()
|
|
3778
|
-
], FileUploadComponent.prototype, "cancelLabel", void 0);
|
|
3779
|
-
__decorate([
|
|
3780
|
-
Input()
|
|
3781
|
-
], FileUploadComponent.prototype, "successTooltip", void 0);
|
|
3782
|
-
__decorate([
|
|
3783
|
-
Input()
|
|
3784
|
-
], FileUploadComponent.prototype, "multiple", void 0);
|
|
3785
|
-
__decorate([
|
|
3786
|
-
Input()
|
|
3787
|
-
], FileUploadComponent.prototype, "accept", void 0);
|
|
3788
|
-
__decorate([
|
|
3789
|
-
Input()
|
|
3790
|
-
], FileUploadComponent.prototype, "supportedExtensions", void 0);
|
|
3791
|
-
__decorate([
|
|
3792
|
-
Input()
|
|
3793
|
-
], FileUploadComponent.prototype, "ariaLabelFileName", void 0);
|
|
3794
|
-
__decorate([
|
|
3795
|
-
Input()
|
|
3796
|
-
], FileUploadComponent.prototype, "maxFileSize", void 0);
|
|
3797
|
-
__decorate([
|
|
3798
|
-
Input()
|
|
3799
|
-
], FileUploadComponent.prototype, "fileLimit", void 0);
|
|
3800
|
-
__decorate([
|
|
3801
|
-
Input()
|
|
3802
|
-
], FileUploadComponent.prototype, "ariaLabelProgress", void 0);
|
|
3803
|
-
__decorate([
|
|
3804
|
-
Input()
|
|
3805
|
-
], FileUploadComponent.prototype, "ariaLabelSuccess", void 0);
|
|
3806
|
-
__decorate([
|
|
3807
|
-
Input()
|
|
3808
|
-
], FileUploadComponent.prototype, "ariaLabelError", void 0);
|
|
3809
|
-
__decorate([
|
|
3810
|
-
Input()
|
|
3811
|
-
], FileUploadComponent.prototype, "ariaLabelRemove", void 0);
|
|
3812
|
-
__decorate([
|
|
3813
|
-
Input()
|
|
3814
|
-
], FileUploadComponent.prototype, "formGroup", void 0);
|
|
3815
|
-
__decorate([
|
|
3816
|
-
Input()
|
|
3817
|
-
], FileUploadComponent.prototype, "disabled", void 0);
|
|
3818
|
-
__decorate([
|
|
3819
|
-
Input()
|
|
3820
|
-
], FileUploadComponent.prototype, "showFileUploadDate", void 0);
|
|
3821
|
-
__decorate([
|
|
3822
|
-
Input()
|
|
3823
|
-
], FileUploadComponent.prototype, "files", null);
|
|
3824
|
-
__decorate([
|
|
3825
|
-
Output()
|
|
3826
|
-
], FileUploadComponent.prototype, "uploadHandler", void 0);
|
|
3827
|
-
__decorate([
|
|
3828
|
-
Output()
|
|
3829
|
-
], FileUploadComponent.prototype, "removeFile", void 0);
|
|
3830
|
-
__decorate([
|
|
3831
|
-
Output()
|
|
3832
|
-
], FileUploadComponent.prototype, "cancelUpload", void 0);
|
|
3833
|
-
__decorate([
|
|
3834
|
-
Output()
|
|
3835
|
-
], FileUploadComponent.prototype, "downloadFile", void 0);
|
|
3836
|
-
__decorate([
|
|
3837
|
-
Output()
|
|
3838
|
-
], FileUploadComponent.prototype, "validateErrors", void 0);
|
|
3839
|
-
__decorate([
|
|
3840
|
-
HostListener("window:resize")
|
|
3841
|
-
], FileUploadComponent.prototype, "onResize", null);
|
|
3842
|
-
FileUploadComponent = FileUploadComponent_1 = __decorate([
|
|
3843
|
-
Component({
|
|
3844
|
-
selector: "s-file-upload",
|
|
3845
|
-
template: "<div\n [id]=\"id\"\n class=\"s-fileupload\">\n <div class=\"s-fileupload-choose\">\n <input\n #inputUpload\n [id]=\"id+'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"onFileSelect($event.dataTransfer\n ? $event.dataTransfer.files\n : $event.target.files)\"> \n <s-button\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel\"\n (onClick)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formGroup?.disabled\"\n [auxiliary]=\"false\">\n </s-button>\n </div>\n\n <section\n *ngIf=\"files.length\" \n [id]=\"id + 'fileupload-list'\"\n class=\"s-fileupload-list\"\n role=\"grid\">\n <ng-container *ngFor=\"let file of files; let i = index\">\n <div\n class=\"s-fileupload-list-file\"\n role=\"row\">\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"s-fileupload-list-file-name\"\n role=\"gridcell\">\n <ng-container *ngTemplateOutlet=\"file.savedFile || file.progress === 100\n ? descriptionUrl\n : description; context: {\n $implicit: file,\n index: i\n }\">\n </ng-container>\n <span *ngIf=\"modifiedDate\" class=\"s-fileupload-list-file-name-date\">{{ modifiedDate }}</span>\n </div>\n <div\n class=\"s-fileupload-list-file-status\"\n role=\"gridcell\">\n <p-progressBar\n *ngIf=\"file.isUploading && !isSmallDevice\"\n [style]=\"{ 'width': '250px', 'background-color': '#d8d8d8', 'border-radius': '0px', 'height': '14px'}\"\n [value]=\"file.progress\"\n [showValue]=\"false\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelProgress\">\n </p-progressBar>\n <span\n *ngIf=\"file.isUploading && isSmallDevice\" \n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"ariaLabelProgress\">\n </span>\n <span\n *ngIf=\"!file.isUploading && !file.error && file.progress === 100\"\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelSuccess || successTooltip\"\n [pTooltip]=\"successTooltip\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\">\n </span>\n <span\n *ngIf=\"file.error?.message\" \n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [pTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\">\n </span>\n </div>\n <div\n class=\"s-fileupload-list-file-actions\"\n role=\"gridcell\">\n <a\n *ngIf=\"file.isUploading\"\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\">\n {{cancelLabel}}\n </a>\n <a\n *ngIf=\"!file.isUploading && !(disabled || !!formGroup?.disabled)\"\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"ariaLabelRemove || removeLabel\">\n {{removeLabel}}\n </a>\n </div>\n </div>\n </ng-container>\n </section>\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i = index>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\">{{file.name}}\n </a>\n <a\n style=\"display: none;\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor>\n </a>\n</ng-template>\n\n<ng-template\n #description\n let-file>\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\">\n {{file.name}}\n </span>\n</ng-template>\n",
|
|
3846
|
-
styles: [".s-fileupload .s-fileupload-choose{position:relative;margin:15px 0;width:-webkit-max-content;width:max-content}.s-fileupload input[type=file]{display:none}.s-fileupload-list{border:1px solid #ccc}.s-fileupload-list-file:not(:first-child){border-top:1px solid #ccc}.s-fileupload-list .s-fileupload-list-file{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:justify;justify-content:space-between;padding:15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-item-align:center;align-self:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name .s-fileupload-list-file-name-date{font-size:.75rem;color:#999}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name>a{cursor:pointer;text-decoration:none}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center}.s-fileupload-list .s-fileupload-list-file .fas.fa-circle-notch{color:#d8d8d8;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-check{color:#0c9348;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-times{color:#c13018;font-size:12px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin-top:15px;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center;width:100%}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action{text-decoration:none;color:#428bca}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :focus,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :visited,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action:hover{text-decoration:none}@media (min-width:768px){.s-fileupload-list .s-fileupload-list-file{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{width:auto;-ms-flex-positive:2;flex-grow:2}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{margin:0 15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin:0;width:auto}}"]
|
|
3847
|
-
})
|
|
3848
|
-
], FileUploadComponent);
|
|
4073
|
+
}
|
|
4074
|
+
CustomTranslationsService._translations = {};
|
|
4075
|
+
CustomTranslationsService._TRANSLATION_PREFIX = "";
|
|
3849
4076
|
|
|
3850
|
-
|
|
4077
|
+
var AngularComponentsModule_1;
|
|
4078
|
+
const HostProjectConfigsInjectionToken = new InjectionToken("hostProjectConfigs");
|
|
4079
|
+
let AngularComponentsModule = AngularComponentsModule_1 = class AngularComponentsModule {
|
|
4080
|
+
static forRoot(config) {
|
|
4081
|
+
return {
|
|
4082
|
+
ngModule: AngularComponentsModule_1,
|
|
4083
|
+
providers: [
|
|
4084
|
+
{
|
|
4085
|
+
provide: HostProjectConfigsInjectionToken,
|
|
4086
|
+
useValue: config
|
|
4087
|
+
}
|
|
4088
|
+
]
|
|
4089
|
+
};
|
|
4090
|
+
}
|
|
3851
4091
|
};
|
|
3852
|
-
|
|
3853
|
-
NgModule({
|
|
3854
|
-
|
|
3855
|
-
imports: [
|
|
3856
|
-
CommonModule,
|
|
3857
|
-
ButtonModule,
|
|
3858
|
-
TooltipModule$1,
|
|
3859
|
-
ProgressBarModule$1,
|
|
3860
|
-
],
|
|
3861
|
-
providers: [FileUploadService],
|
|
3862
|
-
exports: [FileUploadComponent],
|
|
3863
|
-
})
|
|
3864
|
-
], FileUploadModule);
|
|
4092
|
+
AngularComponentsModule = AngularComponentsModule_1 = __decorate([
|
|
4093
|
+
NgModule({})
|
|
4094
|
+
], AngularComponentsModule);
|
|
3865
4095
|
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
4096
|
+
/**
|
|
4097
|
+
* Responsible for setting up the translations that will be used by the "CustomTranslationsService".
|
|
4098
|
+
* Uses the host project's translations set by using the "TranslationsModule" from "@seniorsistemas/platform-components"
|
|
4099
|
+
*/
|
|
4100
|
+
let CustomTranslationsModule = class CustomTranslationsModule {
|
|
4101
|
+
constructor(translate, hostProjectConfigs) {
|
|
4102
|
+
this.translate = translate;
|
|
4103
|
+
this.hostProjectConfigs = hostProjectConfigs;
|
|
4104
|
+
this.factoryTranslations(this.translate, this.hostProjectConfigs);
|
|
4105
|
+
}
|
|
4106
|
+
factoryTranslations(translate, hostProjectConfigs) {
|
|
4107
|
+
CustomTranslationsService.setTranslations(translate.translations);
|
|
4108
|
+
CustomTranslationsService.setTranslationsPrefix(hostProjectConfigs);
|
|
4109
|
+
}
|
|
4110
|
+
};
|
|
4111
|
+
CustomTranslationsModule.ctorParameters = () => [
|
|
4112
|
+
{ type: TranslateService },
|
|
4113
|
+
{ type: undefined, decorators: [{ type: Inject, args: [HostProjectConfigsInjectionToken,] }] }
|
|
4114
|
+
];
|
|
4115
|
+
CustomTranslationsModule = __decorate([
|
|
4116
|
+
NgModule(),
|
|
4117
|
+
__param(1, Inject(HostProjectConfigsInjectionToken))
|
|
4118
|
+
], CustomTranslationsModule);
|
|
3873
4119
|
|
|
3874
|
-
let
|
|
4120
|
+
let FileUploadService = class FileUploadService {
|
|
3875
4121
|
constructor() {
|
|
3876
|
-
this.
|
|
3877
|
-
this.
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
this
|
|
3881
|
-
|
|
4122
|
+
this.BASE_URL_FIELD_CUSTOMIZATION = "platform/field_customization";
|
|
4123
|
+
this.TOKEN = new AbortController();
|
|
4124
|
+
}
|
|
4125
|
+
getMetadataCustomField(request) {
|
|
4126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4127
|
+
return CustomHttpClient.POST(`${this.BASE_URL_FIELD_CUSTOMIZATION}/queries/getFileMetadata`, request, { signal: this.TOKEN.signal });
|
|
4128
|
+
});
|
|
3882
4129
|
}
|
|
3883
4130
|
};
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
styles: [".tooltip{background-color:#000;border-radius:2px;color:#fff;font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:400;line-height:21px;margin-top:5px;opacity:0;padding:8px;position:fixed;transform:translateX(-50%);text-align:center;max-width:150px;word-wrap:break-word;z-index:99999}.tooltip--visible{opacity:1;transition:opacity .3s}.tooltip::before{content:\"\";height:0;position:absolute;width:0}.tooltip--bottom{margin-top:8px;transform:translateX(-50%)}.tooltip--bottom::before{border:5px solid transparent;border-bottom:5px solid #000;left:calc(50% - 5px);top:-10px}.tooltip--top{margin-bottom:8px;transform:translate(-50%,-100%)}.tooltip--top::before{border:5px solid transparent;border-top:5px solid #000;left:calc(50% - 5px);bottom:-10px}.tooltip--left{margin-right:28px;transform:translate(calc(-100% - 7px),-50%)}.tooltip--left::before{border:5px solid transparent;border-left:5px solid #000;right:-10px;bottom:calc(50% - 5px)}.tooltip--right{margin-left:7px;transform:translateY(-50%)}.tooltip--right::before{border:5px solid transparent;border-right:5px solid #000;left:-10px;bottom:calc(50% - 5px)}"]
|
|
3888
|
-
})
|
|
3889
|
-
], TooltipComponent);
|
|
3890
|
-
|
|
3891
|
-
var MobileBehavior;
|
|
3892
|
-
(function (MobileBehavior) {
|
|
3893
|
-
MobileBehavior["Pressing"] = "pressing";
|
|
3894
|
-
MobileBehavior["Tap"] = "tap";
|
|
3895
|
-
})(MobileBehavior || (MobileBehavior = {}));
|
|
3896
|
-
|
|
3897
|
-
var TooltipEvent;
|
|
3898
|
-
(function (TooltipEvent) {
|
|
3899
|
-
TooltipEvent["Focus"] = "focus";
|
|
3900
|
-
TooltipEvent["Hover"] = "hover";
|
|
3901
|
-
})(TooltipEvent || (TooltipEvent = {}));
|
|
4131
|
+
FileUploadService = __decorate([
|
|
4132
|
+
Injectable()
|
|
4133
|
+
], FileUploadService);
|
|
3902
4134
|
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
this.
|
|
3908
|
-
this.
|
|
3909
|
-
this.
|
|
3910
|
-
this.
|
|
3911
|
-
this.
|
|
3912
|
-
this.
|
|
3913
|
-
this.
|
|
3914
|
-
this.
|
|
3915
|
-
this.
|
|
3916
|
-
this.
|
|
3917
|
-
this.
|
|
3918
|
-
this.
|
|
4135
|
+
var FileUploadComponent_1;
|
|
4136
|
+
const moment$3 = moment_;
|
|
4137
|
+
let FileUploadComponent = FileUploadComponent_1 = class FileUploadComponent {
|
|
4138
|
+
constructor(sanitizer, fileUploadService, translate) {
|
|
4139
|
+
this.sanitizer = sanitizer;
|
|
4140
|
+
this.fileUploadService = fileUploadService;
|
|
4141
|
+
this.translate = translate;
|
|
4142
|
+
this.id = `s-file-upload-${FileUploadComponent_1.nextId++}`;
|
|
4143
|
+
this.chooseLabel = "Anexar arquivos";
|
|
4144
|
+
this.removeLabel = "Remover";
|
|
4145
|
+
this.cancelLabel = "Cancelar";
|
|
4146
|
+
this.successTooltip = "Arquivo anexado com sucesso";
|
|
4147
|
+
this.supportedExtensions = [];
|
|
4148
|
+
this.ariaLabelProgress = "Carregando arquivo";
|
|
4149
|
+
this.disabled = false;
|
|
4150
|
+
this.showFileUploadDate = false;
|
|
4151
|
+
this.uploadHandler = new EventEmitter();
|
|
4152
|
+
this.removeFile = new EventEmitter();
|
|
4153
|
+
this.cancelUpload = new EventEmitter();
|
|
4154
|
+
this.downloadFile = new EventEmitter();
|
|
4155
|
+
this.validateErrors = new EventEmitter();
|
|
4156
|
+
this._files = [];
|
|
4157
|
+
this.ngUsubscribe = new Subject();
|
|
4158
|
+
this.inputValue = "";
|
|
4159
|
+
}
|
|
4160
|
+
set files(files) {
|
|
4161
|
+
var _a;
|
|
4162
|
+
if (this.showFileUploadDate && ((_a = files[0]) === null || _a === void 0 ? void 0 : _a.objectId)) {
|
|
4163
|
+
this.getUploadDate(files);
|
|
4164
|
+
}
|
|
4165
|
+
this._files = files.map(file => {
|
|
4166
|
+
if (this.isImage(file)) {
|
|
4167
|
+
file.objectURL = this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(file));
|
|
4168
|
+
}
|
|
4169
|
+
return file;
|
|
4170
|
+
});
|
|
3919
4171
|
}
|
|
3920
4172
|
ngOnInit() {
|
|
3921
|
-
this.
|
|
4173
|
+
this.supportedExtensions = this.supportedExtensions
|
|
4174
|
+
.map(extension => extension.replace(".", "").toLowerCase());
|
|
3922
4175
|
}
|
|
3923
4176
|
ngOnDestroy() {
|
|
3924
|
-
this.
|
|
4177
|
+
this.ngUsubscribe.next();
|
|
4178
|
+
this.ngUsubscribe.complete();
|
|
3925
4179
|
}
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
return;
|
|
3929
|
-
}
|
|
3930
|
-
const elementRect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
3931
|
-
const toolTipRect = this.tooltipDivElement.getBoundingClientRect();
|
|
3932
|
-
const totalElementArea = {
|
|
3933
|
-
top: Math.min(elementRect.top, toolTipRect.top),
|
|
3934
|
-
right: Math.max(elementRect.right, toolTipRect.right),
|
|
3935
|
-
left: Math.min(elementRect.left, toolTipRect.left),
|
|
3936
|
-
bottom: Math.max(elementRect.bottom, toolTipRect.bottom)
|
|
3937
|
-
};
|
|
3938
|
-
if (this.isMousePositionOutsideOfElement(event.clientX, event.clientY, totalElementArea)) {
|
|
3939
|
-
this.destroy();
|
|
3940
|
-
}
|
|
4180
|
+
ngAfterContentInit() {
|
|
4181
|
+
this.update();
|
|
3941
4182
|
}
|
|
3942
|
-
|
|
3943
|
-
|
|
4183
|
+
onResize() {
|
|
4184
|
+
this.update();
|
|
3944
4185
|
}
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
!navigator.userAgent.match(/Android/i) &&
|
|
3950
|
-
!navigator.userAgent.match(/iPhone/i)) {
|
|
3951
|
-
this.destroy();
|
|
4186
|
+
onFileSelect(files) {
|
|
4187
|
+
const newFiles = [];
|
|
4188
|
+
if (!this.multiple) {
|
|
4189
|
+
this.files = [];
|
|
3952
4190
|
}
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
4191
|
+
if (this.isFileLimitExceeded(files)) {
|
|
4192
|
+
this.validateErrors.emit({
|
|
4193
|
+
files,
|
|
4194
|
+
validation: ValidateErrors.MAX_FILE_LIMIT,
|
|
4195
|
+
});
|
|
4196
|
+
this.clearFileInput();
|
|
4197
|
+
return;
|
|
3958
4198
|
}
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
4199
|
+
for (const file of files) {
|
|
4200
|
+
if (this.isUnsupportedFileExtension(file)) {
|
|
4201
|
+
this.validateErrors.emit({
|
|
4202
|
+
files: [file],
|
|
4203
|
+
validation: ValidateErrors.UNSUPPORTED_EXTENSION,
|
|
4204
|
+
});
|
|
4205
|
+
continue;
|
|
4206
|
+
}
|
|
4207
|
+
if (this.isFileSizeExceeded(file)) {
|
|
4208
|
+
this.validateErrors.emit({
|
|
4209
|
+
files: [file],
|
|
4210
|
+
validation: ValidateErrors.MAX_FILE_SIZE,
|
|
4211
|
+
});
|
|
4212
|
+
continue;
|
|
4213
|
+
}
|
|
4214
|
+
newFiles.push(file);
|
|
3963
4215
|
}
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
4216
|
+
if (newFiles.length) {
|
|
4217
|
+
this.files = this.files.concat(newFiles);
|
|
4218
|
+
this.uploadHandler.emit({
|
|
4219
|
+
files: newFiles,
|
|
4220
|
+
});
|
|
3968
4221
|
}
|
|
4222
|
+
this.clearFileInput();
|
|
3969
4223
|
}
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
4224
|
+
onRemoveFile(file) {
|
|
4225
|
+
const fileIndex = this.files.indexOf(file);
|
|
4226
|
+
const removedFiles = this.files.splice(fileIndex, 1);
|
|
4227
|
+
if (removedFiles.length) {
|
|
4228
|
+
this.removeFile.emit({ file });
|
|
3973
4229
|
}
|
|
3974
4230
|
}
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
4231
|
+
onCancelUpload(index) {
|
|
4232
|
+
const removedFiles = this.files.splice(index, 1);
|
|
4233
|
+
if (removedFiles.length) {
|
|
4234
|
+
this.cancelUpload.emit(index);
|
|
3978
4235
|
}
|
|
4236
|
+
this.clearFileInput();
|
|
3979
4237
|
}
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
}
|
|
4238
|
+
onDowloadFile(index) {
|
|
4239
|
+
this.downloadFile.emit({
|
|
4240
|
+
index,
|
|
4241
|
+
anchor: this.anchor,
|
|
4242
|
+
});
|
|
3985
4243
|
}
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
if (this.mobileBehavior === MobileBehavior.Pressing) {
|
|
3989
|
-
window.clearTimeout(this.touchTimeout);
|
|
3990
|
-
this.destroy();
|
|
3991
|
-
}
|
|
3992
|
-
}
|
|
4244
|
+
get files() {
|
|
4245
|
+
return this._files;
|
|
3993
4246
|
}
|
|
3994
|
-
|
|
3995
|
-
const
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4247
|
+
update() {
|
|
4248
|
+
const windowWidth = window.innerWidth;
|
|
4249
|
+
this.isSmallDevice = windowWidth <= Breakpoints.SM_MAX;
|
|
4250
|
+
}
|
|
4251
|
+
isImage(file) {
|
|
4252
|
+
return /^image\//.test(file.type);
|
|
4253
|
+
}
|
|
4254
|
+
isFileLimitExceeded(files) {
|
|
4255
|
+
if (!this.fileLimit) {
|
|
4256
|
+
return false;
|
|
4004
4257
|
}
|
|
4258
|
+
return this.files.length + files.length > this.fileLimit;
|
|
4005
4259
|
}
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(TooltipComponent);
|
|
4010
|
-
this.componentRef = componentFactory.create(this.injector);
|
|
4011
|
-
this.appRef.attachView(this.componentRef.hostView);
|
|
4012
|
-
const domElem = this.componentRef.hostView.rootNodes[0];
|
|
4013
|
-
document.body.appendChild(domElem);
|
|
4014
|
-
this.setTooltipComponentProperties();
|
|
4015
|
-
this.showTimeout = window.setTimeout(this.showTooltip.bind(this), this.showDelay);
|
|
4016
|
-
this.tooltipDivElement = domElem.querySelector('.tooltip');
|
|
4017
|
-
if (this.displayTime) {
|
|
4018
|
-
window.setTimeout(this.destroy.bind(this), this.displayTime);
|
|
4019
|
-
}
|
|
4260
|
+
isFileSizeExceeded(file) {
|
|
4261
|
+
if (!this.maxFileSize) {
|
|
4262
|
+
return false;
|
|
4020
4263
|
}
|
|
4264
|
+
return file.size > this.maxFileSize;
|
|
4021
4265
|
}
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4266
|
+
isUnsupportedFileExtension(file) {
|
|
4267
|
+
var _a;
|
|
4268
|
+
if ((_a = this.supportedExtensions) === null || _a === void 0 ? void 0 : _a.length) {
|
|
4269
|
+
const extension = file.name.split(".").pop().toLowerCase();
|
|
4270
|
+
return !this.supportedExtensions.includes(extension);
|
|
4026
4271
|
}
|
|
4272
|
+
return false;
|
|
4027
4273
|
}
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
const anchorSize = 5;
|
|
4031
|
-
if (this.componentRef !== null) {
|
|
4032
|
-
this.componentRef.instance.tooltip = this.tooltip;
|
|
4033
|
-
this.componentRef.instance.escape = this.escape;
|
|
4034
|
-
const { left, right, top, bottom } = this.elementRef.nativeElement.getBoundingClientRect();
|
|
4035
|
-
const tooltipHeight = bottom - top;
|
|
4036
|
-
const tooltipWidth = right - left;
|
|
4037
|
-
const safeSpace = 150;
|
|
4038
|
-
let positioned = false;
|
|
4039
|
-
const invalidOptions = [];
|
|
4040
|
-
while (!positioned) {
|
|
4041
|
-
if (invalidOptions.includes(TooltipPosition.Top)
|
|
4042
|
-
&& invalidOptions.includes(TooltipPosition.Bottom)
|
|
4043
|
-
&& invalidOptions.includes(TooltipPosition.Left)
|
|
4044
|
-
&& invalidOptions.includes(TooltipPosition.Right)) {
|
|
4045
|
-
this.destroy();
|
|
4046
|
-
throw new Error("No space to show tooltip");
|
|
4047
|
-
}
|
|
4048
|
-
switch (this.position) {
|
|
4049
|
-
case TooltipPosition.Top: {
|
|
4050
|
-
if (invalidOptions.includes(TooltipPosition.Top)) {
|
|
4051
|
-
this.position = TooltipPosition.Left;
|
|
4052
|
-
break;
|
|
4053
|
-
}
|
|
4054
|
-
const topShift = top;
|
|
4055
|
-
if (topShift <= tooltipHeight + safeSpace) {
|
|
4056
|
-
this.position = TooltipPosition.Bottom;
|
|
4057
|
-
invalidOptions.push(TooltipPosition.Top);
|
|
4058
|
-
positioned = false;
|
|
4059
|
-
break;
|
|
4060
|
-
}
|
|
4061
|
-
this.componentRef.instance.left = Math.round(tooltipWidth / 2 + left);
|
|
4062
|
-
this.componentRef.instance.top = Math.round(top - margin - anchorSize);
|
|
4063
|
-
positioned = true;
|
|
4064
|
-
break;
|
|
4065
|
-
}
|
|
4066
|
-
case TooltipPosition.Bottom: {
|
|
4067
|
-
if (invalidOptions.includes(TooltipPosition.Bottom)) {
|
|
4068
|
-
this.position = TooltipPosition.Left;
|
|
4069
|
-
break;
|
|
4070
|
-
}
|
|
4071
|
-
const bottomShift = document.body.clientHeight - bottom;
|
|
4072
|
-
if (bottomShift <= tooltipHeight + safeSpace) {
|
|
4073
|
-
this.position = TooltipPosition.Top;
|
|
4074
|
-
invalidOptions.push(TooltipPosition.Bottom);
|
|
4075
|
-
break;
|
|
4076
|
-
}
|
|
4077
|
-
this.componentRef.instance.left = Math.round(tooltipWidth / 2 + left);
|
|
4078
|
-
this.componentRef.instance.top = Math.round(bottom + margin);
|
|
4079
|
-
positioned = true;
|
|
4080
|
-
break;
|
|
4081
|
-
}
|
|
4082
|
-
case TooltipPosition.Left: {
|
|
4083
|
-
if (invalidOptions.includes(TooltipPosition.Left)) {
|
|
4084
|
-
this.position = TooltipPosition.Top;
|
|
4085
|
-
break;
|
|
4086
|
-
}
|
|
4087
|
-
const leftShift = left;
|
|
4088
|
-
if (leftShift <= tooltipWidth + safeSpace) {
|
|
4089
|
-
this.position = TooltipPosition.Right;
|
|
4090
|
-
invalidOptions.push(TooltipPosition.Left);
|
|
4091
|
-
positioned = false;
|
|
4092
|
-
break;
|
|
4093
|
-
}
|
|
4094
|
-
this.componentRef.instance.left = Math.round(left - margin);
|
|
4095
|
-
this.componentRef.instance.top = Math.round(top + tooltipHeight / 2 - anchorSize);
|
|
4096
|
-
positioned = true;
|
|
4097
|
-
break;
|
|
4098
|
-
}
|
|
4099
|
-
case TooltipPosition.Right: {
|
|
4100
|
-
if (invalidOptions.includes(TooltipPosition.Right)) {
|
|
4101
|
-
this.position = TooltipPosition.Top;
|
|
4102
|
-
break;
|
|
4103
|
-
}
|
|
4104
|
-
const rightShift = document.body.clientWidth - right;
|
|
4105
|
-
if (rightShift <= tooltipWidth + safeSpace) {
|
|
4106
|
-
this.position = TooltipPosition.Left;
|
|
4107
|
-
invalidOptions.push(TooltipPosition.Right);
|
|
4108
|
-
positioned = false;
|
|
4109
|
-
break;
|
|
4110
|
-
}
|
|
4111
|
-
this.componentRef.instance.left = Math.round(right + margin);
|
|
4112
|
-
this.componentRef.instance.top = Math.round(top + tooltipHeight / 2 - anchorSize);
|
|
4113
|
-
positioned = true;
|
|
4114
|
-
break;
|
|
4115
|
-
}
|
|
4116
|
-
default: {
|
|
4117
|
-
break;
|
|
4118
|
-
}
|
|
4119
|
-
}
|
|
4120
|
-
this.componentRef.instance.position = this.position;
|
|
4121
|
-
}
|
|
4122
|
-
}
|
|
4274
|
+
clearFileInput() {
|
|
4275
|
+
this.inputUpload.nativeElement.value = null;
|
|
4123
4276
|
}
|
|
4124
|
-
|
|
4125
|
-
if (
|
|
4126
|
-
|
|
4127
|
-
this.appRef.detachView(this.componentRef.hostView);
|
|
4128
|
-
this.componentRef.destroy();
|
|
4129
|
-
this.componentRef = null;
|
|
4130
|
-
this.tooltipDivElement = null;
|
|
4277
|
+
getUploadDate(blobFile) {
|
|
4278
|
+
if (!blobFile) {
|
|
4279
|
+
return;
|
|
4131
4280
|
}
|
|
4132
|
-
|
|
4281
|
+
this.fileUploadService.getMetadataCustomField({ objectId: blobFile[0].objectId })
|
|
4282
|
+
.then(metadata => this.setModifiedDate(metadata));
|
|
4283
|
+
}
|
|
4284
|
+
setModifiedDate(metadata) {
|
|
4285
|
+
const hour = moment$3(metadata.modified).format("HH");
|
|
4286
|
+
const minutes = moment$3(metadata.modified).format("mm");
|
|
4287
|
+
const day = moment$3(metadata.modified).format("DD");
|
|
4288
|
+
const month = moment$3(metadata.modified).format("MM");
|
|
4289
|
+
const fullYear = moment$3(metadata.modified).format("YYYY");
|
|
4290
|
+
this.modifiedDate = this.translate.instant("platform.angular_components.date_modified_custom_blob", { hour, minutes, day, month, fullYear });
|
|
4133
4291
|
}
|
|
4134
4292
|
};
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
{ type:
|
|
4138
|
-
{ type:
|
|
4139
|
-
{ type:
|
|
4140
|
-
{ type: DebounceUtils }
|
|
4293
|
+
FileUploadComponent.nextId = 0;
|
|
4294
|
+
FileUploadComponent.ctorParameters = () => [
|
|
4295
|
+
{ type: DomSanitizer },
|
|
4296
|
+
{ type: FileUploadService },
|
|
4297
|
+
{ type: TranslateService }
|
|
4141
4298
|
];
|
|
4142
4299
|
__decorate([
|
|
4143
|
-
|
|
4144
|
-
],
|
|
4300
|
+
ViewChild("inputUpload", { static: false })
|
|
4301
|
+
], FileUploadComponent.prototype, "inputUpload", void 0);
|
|
4145
4302
|
__decorate([
|
|
4146
|
-
|
|
4147
|
-
],
|
|
4303
|
+
ViewChild("anchor", { static: false })
|
|
4304
|
+
], FileUploadComponent.prototype, "anchor", void 0);
|
|
4148
4305
|
__decorate([
|
|
4149
4306
|
Input()
|
|
4150
|
-
],
|
|
4307
|
+
], FileUploadComponent.prototype, "id", void 0);
|
|
4151
4308
|
__decorate([
|
|
4152
4309
|
Input()
|
|
4153
|
-
],
|
|
4310
|
+
], FileUploadComponent.prototype, "chooseLabel", void 0);
|
|
4154
4311
|
__decorate([
|
|
4155
4312
|
Input()
|
|
4156
|
-
],
|
|
4313
|
+
], FileUploadComponent.prototype, "removeLabel", void 0);
|
|
4157
4314
|
__decorate([
|
|
4158
4315
|
Input()
|
|
4159
|
-
],
|
|
4316
|
+
], FileUploadComponent.prototype, "cancelLabel", void 0);
|
|
4160
4317
|
__decorate([
|
|
4161
4318
|
Input()
|
|
4162
|
-
],
|
|
4319
|
+
], FileUploadComponent.prototype, "successTooltip", void 0);
|
|
4163
4320
|
__decorate([
|
|
4164
4321
|
Input()
|
|
4165
|
-
],
|
|
4322
|
+
], FileUploadComponent.prototype, "multiple", void 0);
|
|
4166
4323
|
__decorate([
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
], TooltipDirective.prototype, "onClick", null);
|
|
4324
|
+
Input()
|
|
4325
|
+
], FileUploadComponent.prototype, "accept", void 0);
|
|
4170
4326
|
__decorate([
|
|
4171
|
-
|
|
4172
|
-
],
|
|
4327
|
+
Input()
|
|
4328
|
+
], FileUploadComponent.prototype, "supportedExtensions", void 0);
|
|
4173
4329
|
__decorate([
|
|
4174
|
-
|
|
4175
|
-
],
|
|
4330
|
+
Input()
|
|
4331
|
+
], FileUploadComponent.prototype, "ariaLabelFileName", void 0);
|
|
4176
4332
|
__decorate([
|
|
4177
|
-
|
|
4178
|
-
],
|
|
4333
|
+
Input()
|
|
4334
|
+
], FileUploadComponent.prototype, "maxFileSize", void 0);
|
|
4179
4335
|
__decorate([
|
|
4180
|
-
|
|
4181
|
-
],
|
|
4336
|
+
Input()
|
|
4337
|
+
], FileUploadComponent.prototype, "fileLimit", void 0);
|
|
4182
4338
|
__decorate([
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
], TooltipDirective.prototype, "onMouseLeave", null);
|
|
4339
|
+
Input()
|
|
4340
|
+
], FileUploadComponent.prototype, "ariaLabelProgress", void 0);
|
|
4186
4341
|
__decorate([
|
|
4187
|
-
|
|
4188
|
-
],
|
|
4342
|
+
Input()
|
|
4343
|
+
], FileUploadComponent.prototype, "ariaLabelSuccess", void 0);
|
|
4189
4344
|
__decorate([
|
|
4190
|
-
|
|
4191
|
-
],
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4345
|
+
Input()
|
|
4346
|
+
], FileUploadComponent.prototype, "ariaLabelError", void 0);
|
|
4347
|
+
__decorate([
|
|
4348
|
+
Input()
|
|
4349
|
+
], FileUploadComponent.prototype, "ariaLabelRemove", void 0);
|
|
4350
|
+
__decorate([
|
|
4351
|
+
Input()
|
|
4352
|
+
], FileUploadComponent.prototype, "formGroup", void 0);
|
|
4353
|
+
__decorate([
|
|
4354
|
+
Input()
|
|
4355
|
+
], FileUploadComponent.prototype, "disabled", void 0);
|
|
4356
|
+
__decorate([
|
|
4357
|
+
Input()
|
|
4358
|
+
], FileUploadComponent.prototype, "showFileUploadDate", void 0);
|
|
4359
|
+
__decorate([
|
|
4360
|
+
Input()
|
|
4361
|
+
], FileUploadComponent.prototype, "files", null);
|
|
4362
|
+
__decorate([
|
|
4363
|
+
Output()
|
|
4364
|
+
], FileUploadComponent.prototype, "uploadHandler", void 0);
|
|
4365
|
+
__decorate([
|
|
4366
|
+
Output()
|
|
4367
|
+
], FileUploadComponent.prototype, "removeFile", void 0);
|
|
4368
|
+
__decorate([
|
|
4369
|
+
Output()
|
|
4370
|
+
], FileUploadComponent.prototype, "cancelUpload", void 0);
|
|
4371
|
+
__decorate([
|
|
4372
|
+
Output()
|
|
4373
|
+
], FileUploadComponent.prototype, "downloadFile", void 0);
|
|
4374
|
+
__decorate([
|
|
4375
|
+
Output()
|
|
4376
|
+
], FileUploadComponent.prototype, "validateErrors", void 0);
|
|
4377
|
+
__decorate([
|
|
4378
|
+
HostListener("window:resize")
|
|
4379
|
+
], FileUploadComponent.prototype, "onResize", null);
|
|
4380
|
+
FileUploadComponent = FileUploadComponent_1 = __decorate([
|
|
4381
|
+
Component({
|
|
4382
|
+
selector: "s-file-upload",
|
|
4383
|
+
template: "<div\n [id]=\"id\"\n class=\"s-fileupload\">\n <div class=\"s-fileupload-choose\">\n <input\n #inputUpload\n [id]=\"id+'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"onFileSelect($event.dataTransfer\n ? $event.dataTransfer.files\n : $event.target.files)\"> \n <s-button\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel\"\n (onClick)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formGroup?.disabled\"\n [auxiliary]=\"false\">\n </s-button>\n </div>\n\n <section\n *ngIf=\"files.length\" \n [id]=\"id + 'fileupload-list'\"\n class=\"s-fileupload-list\"\n role=\"grid\">\n <ng-container *ngFor=\"let file of files; let i = index\">\n <div\n class=\"s-fileupload-list-file\"\n role=\"row\">\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"s-fileupload-list-file-name\"\n role=\"gridcell\">\n <ng-container *ngTemplateOutlet=\"file.savedFile || file.progress === 100\n ? descriptionUrl\n : description; context: {\n $implicit: file,\n index: i\n }\">\n </ng-container>\n <span *ngIf=\"modifiedDate\" class=\"s-fileupload-list-file-name-date\">{{ modifiedDate }}</span>\n </div>\n <div\n class=\"s-fileupload-list-file-status\"\n role=\"gridcell\">\n <p-progressBar\n *ngIf=\"file.isUploading && !isSmallDevice\"\n [style]=\"{ 'width': '250px', 'background-color': '#d8d8d8', 'border-radius': '0px', 'height': '14px'}\"\n [value]=\"file.progress\"\n [showValue]=\"false\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelProgress\">\n </p-progressBar>\n <span\n *ngIf=\"file.isUploading && isSmallDevice\" \n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"ariaLabelProgress\">\n </span>\n <span\n *ngIf=\"!file.isUploading && !file.error && file.progress === 100\"\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelSuccess || successTooltip\"\n [pTooltip]=\"successTooltip\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\">\n </span>\n <span\n *ngIf=\"file.error?.message\" \n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [pTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\">\n </span>\n </div>\n <div\n class=\"s-fileupload-list-file-actions\"\n role=\"gridcell\">\n <a\n *ngIf=\"file.isUploading\"\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\">\n {{cancelLabel}}\n </a>\n <a\n *ngIf=\"!file.isUploading && !(disabled || !!formGroup?.disabled)\"\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"ariaLabelRemove || removeLabel\">\n {{removeLabel}}\n </a>\n </div>\n </div>\n </ng-container>\n </section>\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i = index>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\">{{file.name}}\n </a>\n <a\n style=\"display: none;\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor>\n </a>\n</ng-template>\n\n<ng-template\n #description\n let-file>\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\">\n {{file.name}}\n </span>\n</ng-template>\n",
|
|
4384
|
+
styles: [".s-fileupload .s-fileupload-choose{position:relative;margin:15px 0;width:-webkit-max-content;width:max-content}.s-fileupload input[type=file]{display:none}.s-fileupload-list{border:1px solid #ccc}.s-fileupload-list-file:not(:first-child){border-top:1px solid #ccc}.s-fileupload-list .s-fileupload-list-file{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:justify;justify-content:space-between;padding:15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-item-align:center;align-self:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name .s-fileupload-list-file-name-date{font-size:.75rem;color:#999}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name>a{cursor:pointer;text-decoration:none}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center}.s-fileupload-list .s-fileupload-list-file .fas.fa-circle-notch{color:#d8d8d8;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-check{color:#0c9348;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-times{color:#c13018;font-size:12px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin-top:15px;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center;width:100%}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action{text-decoration:none;color:#428bca}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :focus,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :visited,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action:hover{text-decoration:none}@media (min-width:768px){.s-fileupload-list .s-fileupload-list-file{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{width:auto;-ms-flex-positive:2;flex-grow:2}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{margin:0 15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin:0;width:auto}}"]
|
|
4195
4385
|
})
|
|
4196
|
-
],
|
|
4386
|
+
], FileUploadComponent);
|
|
4197
4387
|
|
|
4198
|
-
let
|
|
4388
|
+
let FileUploadModule = class FileUploadModule {
|
|
4199
4389
|
};
|
|
4200
|
-
|
|
4390
|
+
FileUploadModule = __decorate([
|
|
4201
4391
|
NgModule({
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4392
|
+
declarations: [FileUploadComponent],
|
|
4393
|
+
imports: [
|
|
4394
|
+
CommonModule,
|
|
4395
|
+
ButtonModule,
|
|
4396
|
+
TooltipModule$1,
|
|
4397
|
+
ProgressBarModule$1,
|
|
4206
4398
|
],
|
|
4207
|
-
|
|
4399
|
+
providers: [FileUploadService],
|
|
4400
|
+
exports: [FileUploadComponent],
|
|
4208
4401
|
})
|
|
4209
|
-
],
|
|
4402
|
+
], FileUploadModule);
|
|
4210
4403
|
|
|
4211
4404
|
let InfoSignComponent = class InfoSignComponent {
|
|
4212
4405
|
};
|
|
@@ -11614,5 +11807,5 @@ const fallback = {
|
|
|
11614
11807
|
* Generated bundle index. Do not edit.
|
|
11615
11808
|
*/
|
|
11616
11809
|
|
|
11617
|
-
export { AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CountryPhonePickerComponent, CountryPhonePickerModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DebounceUtils, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, EnumSeverity, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FileValidation, FormField, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, Ordination, PanelComponent, PanelModule, PasswordField, PasswordStrengthComponent, PasswordStrengthDirective, PasswordStrengthModule, PasswordStrengthPositions, PasswordStrengths, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, WorkspaceSwitchComponent, WorkspaceSwitchModule, countries, fallback,
|
|
11810
|
+
export { AccordionComponent, AccordionModule, AccordionPanelComponent, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CountryPhonePickerComponent, CountryPhonePickerModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DebounceUtils, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, EnumSeverity, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FileValidation, FormField, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, Ordination, PanelComponent, PanelModule, PasswordField, PasswordStrengthComponent, PasswordStrengthDirective, PasswordStrengthModule, PasswordStrengthPositions, PasswordStrengths, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, WorkspaceSwitchComponent, WorkspaceSwitchModule, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, SelectFieldComponent as ɵba, TextAreaFieldComponent as ɵbb, TextFieldComponent as ɵbc, BooleanSwitchFieldComponent as ɵbd, PasswordFieldComponent as ɵbe, SliderFieldComponent as ɵbf, DecimalField as ɵbh, StructureModule as ɵbi, HeaderComponent as ɵbj, FooterComponent as ɵbk, NumberLocaleOptions as ɵbl, ThumbnailService as ɵbm, BorderButtonModule as ɵbn, BorderButtonComponent as ɵbo, TimelineItemModule as ɵbp, TimelineIconItemComponent as ɵbq, HorizontalTimelineModule as ɵbr, HorizontalTimelineComponent as ɵbs, VerticalTimelineModule as ɵbt, VerticalTimelineComponent as ɵbu, RangeLineComponent as ɵbv, CollapseOptionComponent as ɵbw, CollapsedItemsComponent as ɵbx, VerticalItemsComponent as ɵby, InfiniteScrollModule as ɵbz, CountryPhonePickerService as ɵc, InfiniteScrollDirective as ɵca, CustomTranslationsModule as ɵcb, CodeEditorComponent as ɵcc, CoreFacade as ɵcd, CodeMirror6Core as ɵce, LocalizedCurrencyImpurePipe as ɵd, LocalizedBignumberPipe as ɵe, LocalizedBignumberImpurePipe as ɵf, EmptyStateGoBackComponent as ɵg, FileUploadService as ɵh, InfoSignComponent as ɵi, TableColumnsComponent as ɵj, TablePagingComponent as ɵk, AutocompleteFieldComponent as ɵl, BooleanFieldComponent as ɵm, CalendarFieldComponent as ɵn, ChipsFieldComponent as ɵo, CurrencyFieldComponent as ɵp, DynamicFieldComponent as ɵq, DynamicFormDirective as ɵr, FieldsetComponent as ɵs, FileUploadComponent$1 as ɵt, LookupFieldComponent as ɵu, NumberFieldComponent as ɵv, BignumberFieldComponent as ɵw, RadioButtonComponent as ɵx, RowComponent as ɵy, SectionComponent as ɵz };
|
|
11618
11811
|
//# sourceMappingURL=seniorsistemas-angular-components.js.map
|