@seniorsistemas/angular-components 17.2.9 → 17.2.11
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 +1698 -1649
- 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/country-phone-picker/country-phone-picker.component.d.ts +5 -0
- package/components/dynamic-form/components/fields/base-field-component.d.ts +2 -1
- package/components/dynamic-form/components/fields/country-phone-picker/country-phone-picker-field.component.d.ts +7 -0
- package/components/dynamic-form/configurations/field-type.d.ts +1 -0
- package/components/dynamic-form/configurations/fields/country-phone-picker-field.d.ts +15 -0
- package/components/dynamic-form/configurations/fields/index.d.ts +19 -0
- package/esm2015/components/country-phone-picker/country-phone-picker.component.js +13 -2
- package/esm2015/components/dynamic-form/components/fields/base-field-component.js +1 -1
- package/esm2015/components/dynamic-form/components/fields/country-phone-picker/country-phone-picker-field.component.js +17 -0
- package/esm2015/components/dynamic-form/configurations/field-type.js +2 -1
- package/esm2015/components/dynamic-form/configurations/fields/country-phone-picker-field.js +11 -0
- package/esm2015/components/dynamic-form/configurations/fields/index.js +20 -0
- package/esm2015/components/dynamic-form/configurations/form-field.js +4 -1
- package/esm2015/components/dynamic-form/dynamic-form.js +7 -4
- package/esm2015/components/dynamic-form/dynamic-form.module.js +56 -47
- package/esm2015/components/file-upload/file-upload.component.js +2 -7
- package/esm2015/components/file-upload/file-upload.module.js +3 -1
- package/esm2015/locale/fallback.js +5 -1
- package/esm2015/seniorsistemas-angular-components.js +55 -54
- package/esm5/components/country-phone-picker/country-phone-picker.component.js +13 -2
- package/esm5/components/dynamic-form/components/fields/base-field-component.js +1 -1
- package/esm5/components/dynamic-form/components/fields/country-phone-picker/country-phone-picker-field.component.js +20 -0
- package/esm5/components/dynamic-form/configurations/field-type.js +2 -1
- package/esm5/components/dynamic-form/configurations/fields/country-phone-picker-field.js +16 -0
- package/esm5/components/dynamic-form/configurations/fields/index.js +20 -0
- package/esm5/components/dynamic-form/configurations/form-field.js +4 -1
- package/esm5/components/dynamic-form/dynamic-form.js +7 -4
- package/esm5/components/dynamic-form/dynamic-form.module.js +56 -47
- package/esm5/components/file-upload/file-upload.component.js +2 -7
- package/esm5/components/file-upload/file-upload.module.js +3 -1
- package/esm5/locale/fallback.js +5 -1
- package/esm5/seniorsistemas-angular-components.js +55 -54
- package/fesm2015/seniorsistemas-angular-components.js +1508 -1466
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +1641 -1593
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.d.ts +54 -53
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -18,7 +18,7 @@ import { Hotkey, HotkeysService, HotkeyModule } from 'angular2-hotkeys';
|
|
|
18
18
|
import BigNumber, { BigNumber as BigNumber$1 } from 'bignumber.js';
|
|
19
19
|
import { AutoComplete, AutoCompleteModule } from 'primeng/autocomplete';
|
|
20
20
|
import { Dialog, DialogModule } from 'primeng/dialog';
|
|
21
|
-
import { Table,
|
|
21
|
+
import { Table, RowToggler, TableService, TableModule as TableModule$1 } from 'primeng/table';
|
|
22
22
|
import { applyMask, AlignmentOptions, CurrencyMaskDirective as CurrencyMaskDirective$1 } from '@seniorsistemas/ng2-currency-mask';
|
|
23
23
|
import { user, service } from '@seniorsistemas/senior-platform-data';
|
|
24
24
|
import * as moment_ from 'moment';
|
|
@@ -37,10 +37,10 @@ import { MultiSelectModule } from 'primeng/multiselect';
|
|
|
37
37
|
import { PanelModule as PanelModule$1 } from 'primeng/panel';
|
|
38
38
|
import { RadioButtonModule } from 'primeng/radiobutton';
|
|
39
39
|
import { SliderModule } from 'primeng/slider';
|
|
40
|
+
import { MessageService, ConfirmationService } from 'primeng/api';
|
|
40
41
|
import { ProgressBarModule as ProgressBarModule$1 } from 'primeng/progressbar';
|
|
41
42
|
import { DomSanitizer, BrowserModule } from '@angular/platform-browser';
|
|
42
43
|
import { Clipboard } from '@angular/cdk/clipboard';
|
|
43
|
-
import { MessageService, ConfirmationService } from 'primeng/api';
|
|
44
44
|
import Cropper from 'cropperjs';
|
|
45
45
|
import * as elementResizeDetectorMaker_ from 'element-resize-detector';
|
|
46
46
|
import { FocusTrapFactory, A11yModule } from '@angular/cdk/a11y';
|
|
@@ -2118,7 +2118,11 @@ var CountryPhonePickerComponent = /** @class */ (function () {
|
|
|
2118
2118
|
this.offsetTop = 0;
|
|
2119
2119
|
this.ordination = Ordination.NO;
|
|
2120
2120
|
this.selected = new EventEmitter();
|
|
2121
|
+
/**
|
|
2122
|
+
* @deprecated Use focusLost event instead.
|
|
2123
|
+
*/
|
|
2121
2124
|
this.blur = new EventEmitter();
|
|
2125
|
+
this.focusLost = new EventEmitter();
|
|
2122
2126
|
this.tabindex = 0;
|
|
2123
2127
|
this._filterCountries = function (value) {
|
|
2124
2128
|
if (!value) {
|
|
@@ -2257,6 +2261,10 @@ var CountryPhonePickerComponent = /** @class */ (function () {
|
|
|
2257
2261
|
CountryPhonePickerComponent.prototype.getPlaceholder = function () {
|
|
2258
2262
|
return this.mask.replace(/9/g, "");
|
|
2259
2263
|
};
|
|
2264
|
+
CountryPhonePickerComponent.prototype.onBlur = function (value) {
|
|
2265
|
+
this.blur.emit(value);
|
|
2266
|
+
this.focusLost.emit(value);
|
|
2267
|
+
};
|
|
2260
2268
|
CountryPhonePickerComponent.prototype._getSelectedCountryDefault = function () {
|
|
2261
2269
|
if (!this._countriesList.length) {
|
|
2262
2270
|
throw new Error("No country loaded");
|
|
@@ -2350,6 +2358,9 @@ var CountryPhonePickerComponent = /** @class */ (function () {
|
|
|
2350
2358
|
__decorate([
|
|
2351
2359
|
Output()
|
|
2352
2360
|
], CountryPhonePickerComponent.prototype, "blur", void 0);
|
|
2361
|
+
__decorate([
|
|
2362
|
+
Output()
|
|
2363
|
+
], CountryPhonePickerComponent.prototype, "focusLost", void 0);
|
|
2353
2364
|
__decorate([
|
|
2354
2365
|
ViewChild("phoneInput", { static: true })
|
|
2355
2366
|
], CountryPhonePickerComponent.prototype, "phoneInput", void 0);
|
|
@@ -2365,7 +2376,7 @@ var CountryPhonePickerComponent = /** @class */ (function () {
|
|
|
2365
2376
|
CountryPhonePickerComponent = CountryPhonePickerComponent_1 = __decorate([
|
|
2366
2377
|
Component({
|
|
2367
2378
|
selector: "s-country-phone-picker",
|
|
2368
|
-
template: "<div class=\"country-phone-picker\">\n <div class=\"phone-input\">\n <div class=\"drop\" (click)=\"open = !open\">\n <span class=\"drop-flag\" [ngClass]=\"'fi fi-' + selectedItem.id\">\n </span>\n <span class=\"drop-icon fas fa-caret-down\"></span>\n </div>\n <p class=\"phone-ddi\">{{ selectedItem.ddi }}</p>\n <input\n #phoneInput\n type=\"tel\"\n autofocus\n [mask]=\"mask\" \n [placeholder]=\"getPlaceholder()\"\n [formControl]=\"phone\"\n (focus)=\"onPhoneInputFocus()\" \n (blur)=\"
|
|
2379
|
+
template: "<div class=\"country-phone-picker\">\n <div class=\"phone-input\">\n <div class=\"drop\" (click)=\"open = !open\">\n <span class=\"drop-flag\" [ngClass]=\"'fi fi-' + selectedItem.id\">\n </span>\n <span class=\"drop-icon fas fa-caret-down\"></span>\n </div>\n <p class=\"phone-ddi\">{{ selectedItem.ddi }}</p>\n <input\n #phoneInput\n type=\"tel\"\n autofocus\n [mask]=\"mask\" \n [placeholder]=\"getPlaceholder()\"\n [formControl]=\"phone\"\n (focus)=\"onPhoneInputFocus()\" \n (blur)=\"onBlur(value)\"\n />\n </div>\n <div *ngIf=\"open\" class=\"dropdown\">\n <div class=\"search\">\n <input\n class=\"search-field\"\n type=\"text\"\n [formControl]=\"filter\">\n <span class=\"search-icon fas fa-search\"></span>\n <span\n class=\"search-clear fa fa-times\"\n (click)=\"onCleanFilter()\"></span>\n </div>\n <ul class=\"select-list\">\n <li\n *ngFor=\"let country of filteredCountriesList; let i = index;\"\n class=\"select-option\"\n [ngClass]=\"{ 'select-option--focused': i == currentItemIndex }\"\n (click)=\"onSelectItem(country)\">\n <span\n class=\"select-option__flag\"\n [ngClass]=\"'fi fi-' + country.id\">\n </span>\n <span class=\"select-option__name\">\n {{ \"platform.angular_components.country_name_\" + country.id | translate }}\n </span>\n <span class=\"select-option__ddi\">\n {{ country.ddi }}\n </span>\n </li>\n </ul>\n </div>\n</div>",
|
|
2369
2380
|
providers: [{
|
|
2370
2381
|
provide: NG_VALUE_ACCESSOR,
|
|
2371
2382
|
useExisting: forwardRef(function () { return CountryPhonePickerComponent_1; }),
|
|
@@ -2403,6 +2414,7 @@ var FieldType;
|
|
|
2403
2414
|
FieldType["Blob"] = "Blob";
|
|
2404
2415
|
FieldType["Boolean"] = "Boolean";
|
|
2405
2416
|
FieldType["Chips"] = "Chips";
|
|
2417
|
+
FieldType["CountryPhonePicker"] = "CountryPhonePicker";
|
|
2406
2418
|
FieldType["Custom"] = "Custom";
|
|
2407
2419
|
FieldType["Date"] = "Date";
|
|
2408
2420
|
FieldType["DateTime"] = "DateTime";
|
|
@@ -3372,6 +3384,19 @@ var SliderField = /** @class */ (function (_super) {
|
|
|
3372
3384
|
return SliderField;
|
|
3373
3385
|
}(Field));
|
|
3374
3386
|
|
|
3387
|
+
var CountryPhonePickerField = /** @class */ (function (_super) {
|
|
3388
|
+
__extends(CountryPhonePickerField, _super);
|
|
3389
|
+
function CountryPhonePickerField(config) {
|
|
3390
|
+
var _this = _super.call(this, config) || this;
|
|
3391
|
+
_this.countries = config.countries;
|
|
3392
|
+
_this.ordination = config.ordination;
|
|
3393
|
+
_this.onSelected = config.onSelected;
|
|
3394
|
+
_this.onFocusLost = config.onFocusLost;
|
|
3395
|
+
return _this;
|
|
3396
|
+
}
|
|
3397
|
+
return CountryPhonePickerField;
|
|
3398
|
+
}(Field));
|
|
3399
|
+
|
|
3375
3400
|
var FormField = /** @class */ (function () {
|
|
3376
3401
|
function FormField(config) {
|
|
3377
3402
|
switch (config.type) {
|
|
@@ -3409,6 +3434,8 @@ var FormField = /** @class */ (function () {
|
|
|
3409
3434
|
return new RadioButtonField(config);
|
|
3410
3435
|
case FieldType.Chips:
|
|
3411
3436
|
return new ChipsField(config);
|
|
3437
|
+
case FieldType.CountryPhonePicker:
|
|
3438
|
+
return new CountryPhonePickerField(config);
|
|
3412
3439
|
case FieldType.Blob:
|
|
3413
3440
|
return new BlobField(config);
|
|
3414
3441
|
case FieldType.Slider:
|
|
@@ -4119,155 +4146,420 @@ var DynamicFormComponent = /** @class */ (function () {
|
|
|
4119
4146
|
return DynamicFormComponent;
|
|
4120
4147
|
}());
|
|
4121
4148
|
|
|
4122
|
-
var
|
|
4123
|
-
function
|
|
4124
|
-
this.
|
|
4125
|
-
this.
|
|
4126
|
-
this.showPrimaryAction = true;
|
|
4127
|
-
this.showSecondaryAction = true;
|
|
4128
|
-
this.primaryModel = [];
|
|
4129
|
-
this.primaryAction = new EventEmitter();
|
|
4130
|
-
this.secondaryAction = new EventEmitter();
|
|
4149
|
+
var IAssistService = /** @class */ (function () {
|
|
4150
|
+
function IAssistService(http, _messageService) {
|
|
4151
|
+
this.http = http;
|
|
4152
|
+
this._messageService = _messageService;
|
|
4131
4153
|
}
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4154
|
+
IAssistService.prototype.askIA = function (context, data) {
|
|
4155
|
+
var _this = this;
|
|
4156
|
+
return this.http.post("platform/iassist/api/latest/completions", {
|
|
4157
|
+
"prompt": this._createPrompt(context, data),
|
|
4158
|
+
"provider": "OPEN_AI",
|
|
4159
|
+
"parameters": {
|
|
4160
|
+
"model": "gpt-3.5-turbo",
|
|
4161
|
+
"max_tokens": 700,
|
|
4162
|
+
"temperature": 1
|
|
4163
|
+
}
|
|
4164
|
+
}).pipe(catchError(function (err) {
|
|
4165
|
+
_this._messageService.add({
|
|
4166
|
+
severity: "error",
|
|
4167
|
+
summary: err.status ? String(err.status) : "Error",
|
|
4168
|
+
detail: (err.error && err.error.message) || err.statusText || err.message || "Error",
|
|
4169
|
+
});
|
|
4170
|
+
return throwError(err);
|
|
4171
|
+
}));
|
|
4172
|
+
};
|
|
4173
|
+
IAssistService.prototype._createPrompt = function (context, data) {
|
|
4174
|
+
return "Crie um texto gen\u00E9rico para preencher o campo de textarea.\n " + (data.label ? "O campo tem o label " + data.label + "." : "") + "\n " + (data.id ? "O campo tem o id " + data.id + "." : "") + "\n " + (data.placeholder ? "Considere as instru\u00E7\u00F5es/sugest\u00F5es do placeholder: " + data.placeholder + "." : "") + "\n Baseie-se no contexto informado pelo usu\u00E1rio: '" + context + "'.\n O texto deve ser formal e conter informa\u00E7\u00F5es pertinentes a um campo como este, como se um usu\u00E1rio real tivesse preenchido com as informa\u00E7\u00F5es necess\u00E1rias. \n O texto deve ser neutro com rela\u00E7\u00E3o a generos, ra\u00E7as, religi\u00F5es, etc.\n O texto deve ser impessoal e n\u00E3o deve conter informa\u00E7\u00F5es pessoais do usu\u00E1rio.\n N\u00E3o direcione o texto a ningu\u00E9m, n\u00E3o use express\u00F5es como: caro, atenciosamente. gostaria, agrade\u00E7o. O texto deve ser gen\u00E9rico.\n \n Exemplos de texto:\n Um campo de descri\u00E7\u00E3o de usu\u00E1rio: \"Usu\u00E1rio com 20 anos, estudante de engenharia, gosta de jogar futebol e assistir filmes.\"\n Outro exemplo de descri\u00E7\u00E3o de usu\u00E1rio: \"Usu\u00E1rio administrador, com acesso total ao sistema, respons\u00E1vel por gerenciar os usu\u00E1rios e os produtos.\"\n Um campo de descri\u00E7\u00E3o de um produto: \"O produto \u00E9 um celular, com tela de 6 polegadas, 128GB de armazenamento, 4GB de mem\u00F3ria RAM, c\u00E2mera de 12MP e bateria de 4000mAh.\"\n Outro exemplo de descri\u00E7\u00E3o de produto: \"O produto \u00E9 uma geladeira, com capacidade de 500 litros, 2 portas, cor branca, com freezer e gaveta de legumes.\"\n Outro exemplo de descri\u00E7\u00E3o de produto: \"O produto \u00E9 uma camiseta, tamanho M, cor azul, 100% algod\u00E3o, com estampa de um gato.\"\n \n Em caso de contexto incompleto crie um texto gen\u00E9rico, como se fosse um exemplo de preenchimento do campo.\n O texto \u00E9 para um campo de textarea, ent\u00E3o escreva um texto sucinto.\n Exiba apenas o texto do output";
|
|
4175
|
+
};
|
|
4176
|
+
IAssistService.ctorParameters = function () { return [
|
|
4177
|
+
{ type: HttpClient },
|
|
4178
|
+
{ type: MessageService }
|
|
4179
|
+
]; };
|
|
4180
|
+
IAssistService = __decorate([
|
|
4181
|
+
Injectable()
|
|
4182
|
+
], IAssistService);
|
|
4183
|
+
return IAssistService;
|
|
4184
|
+
}());
|
|
4185
|
+
|
|
4186
|
+
var LongPressDirective = /** @class */ (function () {
|
|
4187
|
+
function LongPressDirective() {
|
|
4188
|
+
this.sLongPressDelay = 500;
|
|
4189
|
+
this.sLongPress = new EventEmitter();
|
|
4190
|
+
this.mouseUp = new Subject();
|
|
4191
|
+
this.mouseDown = new Subject();
|
|
4192
|
+
this.ngUnsubscribe = new Subject();
|
|
4193
|
+
}
|
|
4194
|
+
LongPressDirective.prototype.onMouseUp = function (event) {
|
|
4195
|
+
this.mouseUp.next(event);
|
|
4196
|
+
};
|
|
4197
|
+
LongPressDirective.prototype.onMouseDown = function (event) {
|
|
4198
|
+
this.mouseDown.next(event);
|
|
4199
|
+
};
|
|
4200
|
+
LongPressDirective.prototype.ngOnInit = function () {
|
|
4201
|
+
var _this = this;
|
|
4202
|
+
this.mouseDown
|
|
4203
|
+
.pipe(debounceTime(this.sLongPressDelay), takeUntil(this.mouseUp), repeat(), takeUntil(this.ngUnsubscribe))
|
|
4204
|
+
.subscribe(function (event) { return _this.sLongPress.emit(event); });
|
|
4205
|
+
};
|
|
4206
|
+
LongPressDirective.prototype.ngOnDestroy = function () {
|
|
4207
|
+
this.ngUnsubscribe.next();
|
|
4208
|
+
this.ngUnsubscribe.complete();
|
|
4209
|
+
};
|
|
4159
4210
|
__decorate([
|
|
4160
4211
|
Input()
|
|
4161
|
-
],
|
|
4212
|
+
], LongPressDirective.prototype, "sLongPressDelay", void 0);
|
|
4162
4213
|
__decorate([
|
|
4163
4214
|
Output()
|
|
4164
|
-
],
|
|
4215
|
+
], LongPressDirective.prototype, "sLongPress", void 0);
|
|
4165
4216
|
__decorate([
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4217
|
+
HostListener("mouseup", ["$event"]),
|
|
4218
|
+
HostListener("touchend", ["$event"])
|
|
4219
|
+
], LongPressDirective.prototype, "onMouseUp", null);
|
|
4220
|
+
__decorate([
|
|
4221
|
+
HostListener("mousedown", ["$event"]),
|
|
4222
|
+
HostListener("touchstart", ["$event"])
|
|
4223
|
+
], LongPressDirective.prototype, "onMouseDown", null);
|
|
4224
|
+
LongPressDirective = __decorate([
|
|
4225
|
+
Directive({
|
|
4226
|
+
selector: "[sLongPress]",
|
|
4173
4227
|
})
|
|
4174
|
-
],
|
|
4175
|
-
return
|
|
4228
|
+
], LongPressDirective);
|
|
4229
|
+
return LongPressDirective;
|
|
4176
4230
|
}());
|
|
4177
4231
|
|
|
4178
|
-
var
|
|
4179
|
-
function
|
|
4180
|
-
this.
|
|
4181
|
-
this.
|
|
4232
|
+
var DoubleClickDirective = /** @class */ (function () {
|
|
4233
|
+
function DoubleClickDirective() {
|
|
4234
|
+
this.onDoubleClick = new EventEmitter();
|
|
4235
|
+
this._timeout = null;
|
|
4236
|
+
this._DOUBLE_CLICK_DELAY = 500;
|
|
4182
4237
|
}
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4238
|
+
DoubleClickDirective.prototype.onClick = function (event) {
|
|
4239
|
+
this.handleOnClickEvent(event);
|
|
4240
|
+
};
|
|
4241
|
+
DoubleClickDirective.prototype.handleOnClickEvent = function (event) {
|
|
4242
|
+
var _this = this;
|
|
4243
|
+
if (this._timeout) {
|
|
4244
|
+
this.clearTimeout();
|
|
4245
|
+
this.onDoubleClick.emit(event);
|
|
4246
|
+
}
|
|
4247
|
+
else {
|
|
4248
|
+
this._timeout = setTimeout(function () { return _this.clearTimeout(); }, this._DOUBLE_CLICK_DELAY);
|
|
4249
|
+
}
|
|
4250
|
+
};
|
|
4251
|
+
DoubleClickDirective.prototype.clearTimeout = function () {
|
|
4252
|
+
clearTimeout(this._timeout);
|
|
4253
|
+
this._timeout = null;
|
|
4186
4254
|
};
|
|
4187
|
-
EmptyStateGoBackComponent.nextId = 0;
|
|
4188
|
-
EmptyStateGoBackComponent.ctorParameters = function () { return [
|
|
4189
|
-
{ type: CookieService }
|
|
4190
|
-
]; };
|
|
4191
|
-
__decorate([
|
|
4192
|
-
Input()
|
|
4193
|
-
], EmptyStateGoBackComponent.prototype, "iconClass", void 0);
|
|
4194
|
-
__decorate([
|
|
4195
|
-
Input()
|
|
4196
|
-
], EmptyStateGoBackComponent.prototype, "title", void 0);
|
|
4197
4255
|
__decorate([
|
|
4198
|
-
|
|
4199
|
-
],
|
|
4256
|
+
Output()
|
|
4257
|
+
], DoubleClickDirective.prototype, "onDoubleClick", void 0);
|
|
4200
4258
|
__decorate([
|
|
4201
|
-
|
|
4202
|
-
],
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
selector:
|
|
4206
|
-
template: "<s-empty-state \n [iconClass]=\"iconClass\" \n [title]=\"title\" \n [description]=\"description\" \n (primaryAction)=\"goBack()\"\n [primaryActionLabel]=\"primaryActionLabel\">\n</s-empty-state>"
|
|
4259
|
+
HostListener("click", ["$event"])
|
|
4260
|
+
], DoubleClickDirective.prototype, "onClick", null);
|
|
4261
|
+
DoubleClickDirective = __decorate([
|
|
4262
|
+
Directive({
|
|
4263
|
+
selector: '[sDoubleClick]'
|
|
4207
4264
|
})
|
|
4208
|
-
],
|
|
4209
|
-
return
|
|
4265
|
+
], DoubleClickDirective);
|
|
4266
|
+
return DoubleClickDirective;
|
|
4210
4267
|
}());
|
|
4211
4268
|
|
|
4212
|
-
var
|
|
4213
|
-
function
|
|
4269
|
+
var MouseEventsModule = /** @class */ (function () {
|
|
4270
|
+
function MouseEventsModule() {
|
|
4214
4271
|
}
|
|
4215
|
-
|
|
4272
|
+
MouseEventsModule = __decorate([
|
|
4216
4273
|
NgModule({
|
|
4217
|
-
imports: [CommonModule
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4274
|
+
imports: [CommonModule],
|
|
4275
|
+
declarations: [
|
|
4276
|
+
LongPressDirective,
|
|
4277
|
+
DoubleClickDirective
|
|
4278
|
+
],
|
|
4279
|
+
exports: [
|
|
4280
|
+
LongPressDirective,
|
|
4281
|
+
DoubleClickDirective
|
|
4282
|
+
],
|
|
4221
4283
|
})
|
|
4222
|
-
],
|
|
4223
|
-
return
|
|
4284
|
+
], MouseEventsModule);
|
|
4285
|
+
return MouseEventsModule;
|
|
4224
4286
|
}());
|
|
4225
4287
|
|
|
4226
|
-
/**
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
}
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
*
|
|
4269
|
-
|
|
4270
|
-
|
|
4288
|
+
var BignumberInputDirective = /** @class */ (function (_super) {
|
|
4289
|
+
__extends(BignumberInputDirective, _super);
|
|
4290
|
+
function BignumberInputDirective() {
|
|
4291
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
4292
|
+
_this.precision = 15;
|
|
4293
|
+
_this.scale = 0;
|
|
4294
|
+
_this.decimalSeparator = ",";
|
|
4295
|
+
_this.alignTo = AlignmentOptions.LEFT;
|
|
4296
|
+
_this.allowNegative = true;
|
|
4297
|
+
return _this;
|
|
4298
|
+
}
|
|
4299
|
+
BignumberInputDirective_1 = BignumberInputDirective;
|
|
4300
|
+
BignumberInputDirective.prototype.ngOnInit = function () {
|
|
4301
|
+
this.updateVariables();
|
|
4302
|
+
_super.prototype.ngOnInit.call(this);
|
|
4303
|
+
};
|
|
4304
|
+
BignumberInputDirective.prototype.ngOnChanges = function (changes) {
|
|
4305
|
+
var placeholderChange = changes.placeholder && changes.placeholder.currentValue;
|
|
4306
|
+
if (!placeholderChange && this.scale) {
|
|
4307
|
+
this.placeholder = "0" + this.decimalSeparator + "".padEnd(this.scale, "0");
|
|
4308
|
+
}
|
|
4309
|
+
if (changes.scale ||
|
|
4310
|
+
changes.decimalSeparator ||
|
|
4311
|
+
changes.thousandsSeparator ||
|
|
4312
|
+
changes.alignTo ||
|
|
4313
|
+
changes.precision ||
|
|
4314
|
+
changes.allowNegative) {
|
|
4315
|
+
this.updateVariables();
|
|
4316
|
+
}
|
|
4317
|
+
};
|
|
4318
|
+
BignumberInputDirective.prototype.onKeypress = function (event) {
|
|
4319
|
+
var code = event.code;
|
|
4320
|
+
if (code === "Minus" || code === "NumpadSubtract") {
|
|
4321
|
+
if (this.allowNegative) {
|
|
4322
|
+
this.maxLength = this._maxLength + 1;
|
|
4323
|
+
}
|
|
4324
|
+
}
|
|
4325
|
+
else if (code === "Equal" || code === "NumpadAdd") {
|
|
4326
|
+
this.maxLength = this._maxLength;
|
|
4327
|
+
}
|
|
4328
|
+
};
|
|
4329
|
+
/**
|
|
4330
|
+
* Update the options values according to the directive input values.
|
|
4331
|
+
*/
|
|
4332
|
+
BignumberInputDirective.prototype.updateVariables = function () {
|
|
4333
|
+
var _a;
|
|
4334
|
+
this.options = {
|
|
4335
|
+
align: this.alignTo,
|
|
4336
|
+
decimalSeparator: this.decimalSeparator,
|
|
4337
|
+
thousandsSeparator: (_a = this.thousandsSeparator) !== null && _a !== void 0 ? _a : ".",
|
|
4338
|
+
scale: this.scale || 0,
|
|
4339
|
+
prefix: "",
|
|
4340
|
+
suffix: "",
|
|
4341
|
+
allowNegative: this.allowNegative
|
|
4342
|
+
};
|
|
4343
|
+
this.calculateMaxLength();
|
|
4344
|
+
};
|
|
4345
|
+
/**
|
|
4346
|
+
* Responsible to calculate the field maximum length considering the separators.
|
|
4347
|
+
*/
|
|
4348
|
+
BignumberInputDirective.prototype.calculateMaxLength = function () {
|
|
4349
|
+
var _a, _b;
|
|
4350
|
+
var decSepLength = this.decimalSeparator.length;
|
|
4351
|
+
var thoSepLength = (_b = (_a = this.thousandsSeparator) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1;
|
|
4352
|
+
var maxLength = this.precision + (this.scale ? decSepLength : 0);
|
|
4353
|
+
maxLength += Math.ceil((this.precision - (this.scale ? this.scale : 0)) / 3 - 1) * thoSepLength;
|
|
4354
|
+
this._maxLength = maxLength;
|
|
4355
|
+
this.maxLength = maxLength;
|
|
4356
|
+
};
|
|
4357
|
+
var BignumberInputDirective_1;
|
|
4358
|
+
__decorate([
|
|
4359
|
+
Input()
|
|
4360
|
+
], BignumberInputDirective.prototype, "precision", void 0);
|
|
4361
|
+
__decorate([
|
|
4362
|
+
Input()
|
|
4363
|
+
], BignumberInputDirective.prototype, "scale", void 0);
|
|
4364
|
+
__decorate([
|
|
4365
|
+
Input()
|
|
4366
|
+
], BignumberInputDirective.prototype, "decimalSeparator", void 0);
|
|
4367
|
+
__decorate([
|
|
4368
|
+
Input()
|
|
4369
|
+
], BignumberInputDirective.prototype, "thousandsSeparator", void 0);
|
|
4370
|
+
__decorate([
|
|
4371
|
+
Input()
|
|
4372
|
+
], BignumberInputDirective.prototype, "alignTo", void 0);
|
|
4373
|
+
__decorate([
|
|
4374
|
+
Input()
|
|
4375
|
+
], BignumberInputDirective.prototype, "allowNegative", void 0);
|
|
4376
|
+
__decorate([
|
|
4377
|
+
Input(),
|
|
4378
|
+
HostBinding("attr.placeholder")
|
|
4379
|
+
], BignumberInputDirective.prototype, "placeholder", void 0);
|
|
4380
|
+
__decorate([
|
|
4381
|
+
HostBinding("attr.maxLength")
|
|
4382
|
+
], BignumberInputDirective.prototype, "maxLength", void 0);
|
|
4383
|
+
__decorate([
|
|
4384
|
+
HostListener("keypress", ["$event"])
|
|
4385
|
+
], BignumberInputDirective.prototype, "onKeypress", null);
|
|
4386
|
+
BignumberInputDirective = BignumberInputDirective_1 = __decorate([
|
|
4387
|
+
Directive({
|
|
4388
|
+
selector: "input[sBignumberInput]",
|
|
4389
|
+
providers: [
|
|
4390
|
+
{
|
|
4391
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4392
|
+
useExisting: forwardRef(function () { return BignumberInputDirective_1; }),
|
|
4393
|
+
multi: true,
|
|
4394
|
+
},
|
|
4395
|
+
],
|
|
4396
|
+
})
|
|
4397
|
+
], BignumberInputDirective);
|
|
4398
|
+
return BignumberInputDirective;
|
|
4399
|
+
}(CurrencyMaskDirective$1));
|
|
4400
|
+
|
|
4401
|
+
var BignumberInputModule = /** @class */ (function () {
|
|
4402
|
+
function BignumberInputModule() {
|
|
4403
|
+
}
|
|
4404
|
+
BignumberInputModule = __decorate([
|
|
4405
|
+
NgModule({
|
|
4406
|
+
imports: [CommonModule],
|
|
4407
|
+
declarations: [BignumberInputDirective],
|
|
4408
|
+
exports: [BignumberInputDirective],
|
|
4409
|
+
})
|
|
4410
|
+
], BignumberInputModule);
|
|
4411
|
+
return BignumberInputModule;
|
|
4412
|
+
}());
|
|
4413
|
+
|
|
4414
|
+
var EmptyStateComponent = /** @class */ (function () {
|
|
4415
|
+
function EmptyStateComponent() {
|
|
4416
|
+
this.id = "s-empty-state-" + EmptyStateComponent_1.nextId++;
|
|
4417
|
+
this.iconClass = "fa fa-inbox";
|
|
4418
|
+
this.showPrimaryAction = true;
|
|
4419
|
+
this.showSecondaryAction = true;
|
|
4420
|
+
this.primaryModel = [];
|
|
4421
|
+
this.primaryAction = new EventEmitter();
|
|
4422
|
+
this.secondaryAction = new EventEmitter();
|
|
4423
|
+
}
|
|
4424
|
+
EmptyStateComponent_1 = EmptyStateComponent;
|
|
4425
|
+
var EmptyStateComponent_1;
|
|
4426
|
+
EmptyStateComponent.nextId = 0;
|
|
4427
|
+
__decorate([
|
|
4428
|
+
Input()
|
|
4429
|
+
], EmptyStateComponent.prototype, "id", void 0);
|
|
4430
|
+
__decorate([
|
|
4431
|
+
Input()
|
|
4432
|
+
], EmptyStateComponent.prototype, "iconClass", void 0);
|
|
4433
|
+
__decorate([
|
|
4434
|
+
Input()
|
|
4435
|
+
], EmptyStateComponent.prototype, "title", void 0);
|
|
4436
|
+
__decorate([
|
|
4437
|
+
Input()
|
|
4438
|
+
], EmptyStateComponent.prototype, "description", void 0);
|
|
4439
|
+
__decorate([
|
|
4440
|
+
Input()
|
|
4441
|
+
], EmptyStateComponent.prototype, "showPrimaryAction", void 0);
|
|
4442
|
+
__decorate([
|
|
4443
|
+
Input()
|
|
4444
|
+
], EmptyStateComponent.prototype, "showSecondaryAction", void 0);
|
|
4445
|
+
__decorate([
|
|
4446
|
+
Input()
|
|
4447
|
+
], EmptyStateComponent.prototype, "primaryActionLabel", void 0);
|
|
4448
|
+
__decorate([
|
|
4449
|
+
Input()
|
|
4450
|
+
], EmptyStateComponent.prototype, "secondaryActionLabel", void 0);
|
|
4451
|
+
__decorate([
|
|
4452
|
+
Input()
|
|
4453
|
+
], EmptyStateComponent.prototype, "primaryModel", void 0);
|
|
4454
|
+
__decorate([
|
|
4455
|
+
Output()
|
|
4456
|
+
], EmptyStateComponent.prototype, "primaryAction", void 0);
|
|
4457
|
+
__decorate([
|
|
4458
|
+
Output()
|
|
4459
|
+
], EmptyStateComponent.prototype, "secondaryAction", void 0);
|
|
4460
|
+
EmptyStateComponent = EmptyStateComponent_1 = __decorate([
|
|
4461
|
+
Component({
|
|
4462
|
+
selector: "s-empty-state",
|
|
4463
|
+
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>",
|
|
4464
|
+
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%}"]
|
|
4465
|
+
})
|
|
4466
|
+
], EmptyStateComponent);
|
|
4467
|
+
return EmptyStateComponent;
|
|
4468
|
+
}());
|
|
4469
|
+
|
|
4470
|
+
var EmptyStateGoBackComponent = /** @class */ (function () {
|
|
4471
|
+
function EmptyStateGoBackComponent(cookieService) {
|
|
4472
|
+
this.cookieService = cookieService;
|
|
4473
|
+
this.iconClass = "fa fa-exclamation-triangle";
|
|
4474
|
+
}
|
|
4475
|
+
EmptyStateGoBackComponent.prototype.goBack = function () {
|
|
4476
|
+
var portalUrl = this.cookieService.get("com.senior.portal.url");
|
|
4477
|
+
window.open(portalUrl, "_top");
|
|
4478
|
+
};
|
|
4479
|
+
EmptyStateGoBackComponent.nextId = 0;
|
|
4480
|
+
EmptyStateGoBackComponent.ctorParameters = function () { return [
|
|
4481
|
+
{ type: CookieService }
|
|
4482
|
+
]; };
|
|
4483
|
+
__decorate([
|
|
4484
|
+
Input()
|
|
4485
|
+
], EmptyStateGoBackComponent.prototype, "iconClass", void 0);
|
|
4486
|
+
__decorate([
|
|
4487
|
+
Input()
|
|
4488
|
+
], EmptyStateGoBackComponent.prototype, "title", void 0);
|
|
4489
|
+
__decorate([
|
|
4490
|
+
Input()
|
|
4491
|
+
], EmptyStateGoBackComponent.prototype, "description", void 0);
|
|
4492
|
+
__decorate([
|
|
4493
|
+
Input()
|
|
4494
|
+
], EmptyStateGoBackComponent.prototype, "primaryActionLabel", void 0);
|
|
4495
|
+
EmptyStateGoBackComponent = __decorate([
|
|
4496
|
+
Component({
|
|
4497
|
+
selector: "s-empty-state-go-back",
|
|
4498
|
+
template: "<s-empty-state \n [iconClass]=\"iconClass\" \n [title]=\"title\" \n [description]=\"description\" \n (primaryAction)=\"goBack()\"\n [primaryActionLabel]=\"primaryActionLabel\">\n</s-empty-state>"
|
|
4499
|
+
})
|
|
4500
|
+
], EmptyStateGoBackComponent);
|
|
4501
|
+
return EmptyStateGoBackComponent;
|
|
4502
|
+
}());
|
|
4503
|
+
|
|
4504
|
+
var EmptyStateModule = /** @class */ (function () {
|
|
4505
|
+
function EmptyStateModule() {
|
|
4506
|
+
}
|
|
4507
|
+
EmptyStateModule = __decorate([
|
|
4508
|
+
NgModule({
|
|
4509
|
+
imports: [CommonModule, ButtonModule],
|
|
4510
|
+
providers: [CookieService],
|
|
4511
|
+
declarations: [EmptyStateComponent, EmptyStateGoBackComponent],
|
|
4512
|
+
exports: [EmptyStateComponent, EmptyStateGoBackComponent],
|
|
4513
|
+
})
|
|
4514
|
+
], EmptyStateModule);
|
|
4515
|
+
return EmptyStateModule;
|
|
4516
|
+
}());
|
|
4517
|
+
|
|
4518
|
+
/**
|
|
4519
|
+
* Formats a JSON response to a JS object
|
|
4520
|
+
* @param response The response to format
|
|
4521
|
+
* @returns A JS object based on the response's body
|
|
4522
|
+
*/
|
|
4523
|
+
function formatJsonResponse(response) {
|
|
4524
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4525
|
+
return __generator(this, function (_a) {
|
|
4526
|
+
return [2 /*return*/, response.json()];
|
|
4527
|
+
});
|
|
4528
|
+
});
|
|
4529
|
+
}
|
|
4530
|
+
|
|
4531
|
+
/**
|
|
4532
|
+
* Formats a Blob response to a JS object
|
|
4533
|
+
* @param response The response to format
|
|
4534
|
+
* @returns A JS object based on the response's body
|
|
4535
|
+
*/
|
|
4536
|
+
function formatBlobResponse(response) {
|
|
4537
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4538
|
+
var textResponse;
|
|
4539
|
+
return __generator(this, function (_a) {
|
|
4540
|
+
switch (_a.label) {
|
|
4541
|
+
case 0: return [4 /*yield*/, response.blob()];
|
|
4542
|
+
case 1: return [4 /*yield*/, (_a.sent()).text()];
|
|
4543
|
+
case 2:
|
|
4544
|
+
textResponse = _a.sent();
|
|
4545
|
+
return [2 /*return*/, JSON.parse(textResponse)];
|
|
4546
|
+
}
|
|
4547
|
+
});
|
|
4548
|
+
});
|
|
4549
|
+
}
|
|
4550
|
+
|
|
4551
|
+
/**
|
|
4552
|
+
* Custom HttpClient for cases when is not possible to use the Angular's HttpClient
|
|
4553
|
+
*/
|
|
4554
|
+
var CustomHttpClient = /** @class */ (function () {
|
|
4555
|
+
function CustomHttpClient() {
|
|
4556
|
+
}
|
|
4557
|
+
/**
|
|
4558
|
+
* Executes a Http Get
|
|
4559
|
+
* @param url Url to execute the Get on
|
|
4560
|
+
* @param init Optional additional configs
|
|
4561
|
+
* @returns Whether a Promise<T> on request success or an error in request fail
|
|
4562
|
+
*/
|
|
4271
4563
|
CustomHttpClient.GET = function (url, init) {
|
|
4272
4564
|
if (init === void 0) { init = {}; }
|
|
4273
4565
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -4619,12 +4911,7 @@ var FileUploadComponent = /** @class */ (function () {
|
|
|
4619
4911
|
this.READ_PERMISSION = FileUploadPermissions.Read;
|
|
4620
4912
|
this.REMOVE_PERMISSION = FileUploadPermissions.Remove;
|
|
4621
4913
|
this.id = "s-file-upload-" + FileUploadComponent_1.nextId++;
|
|
4622
|
-
this.chooseLabel = "Anexar arquivos";
|
|
4623
|
-
this.removeLabel = "Remover";
|
|
4624
|
-
this.cancelLabel = "Cancelar";
|
|
4625
|
-
this.successTooltip = "Arquivo anexado com sucesso";
|
|
4626
4914
|
this.supportedExtensions = [];
|
|
4627
|
-
this.ariaLabelProgress = "Carregando arquivo";
|
|
4628
4915
|
this.disabled = false;
|
|
4629
4916
|
this.showFileUploadDate = false;
|
|
4630
4917
|
this.permissions = ALL_PERMISSIONS;
|
|
@@ -4881,7 +5168,7 @@ var FileUploadComponent = /** @class */ (function () {
|
|
|
4881
5168
|
FileUploadComponent = FileUploadComponent_1 = __decorate([
|
|
4882
5169
|
Component({
|
|
4883
5170
|
selector: "s-file-upload",
|
|
4884
|
-
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 *ngIf=\"permissions.includes(ADD_PERMISSION)\"\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=\"permissions.includes(READ_PERMISSION) && 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=\"permissions.includes(REMOVE_PERMISSION) && !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",
|
|
5171
|
+
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 *ngIf=\"permissions.includes(ADD_PERMISSION)\"\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel || 'platform.angular_components.attach_files' | translate\"\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=\"permissions.includes(READ_PERMISSION) && 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 || 'platform.angular_components.loading_file' | translate\">\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 || 'platform.angular_components.loading_file' | translate\">\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 || 'platform.angular_components.file_attached_successfully' | translate\"\n [pTooltip]=\"successTooltip || 'platform.angular_components.file_attached_successfully' | translate\"\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 || 'platform.angular_components.cancel' | translate }}\n </a>\n <a\n *ngIf=\"permissions.includes(REMOVE_PERMISSION) && !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 || 'platform.angular_components.remove' | translate\">\n {{ removeLabel || 'platform.angular_components.remove' | translate }}\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",
|
|
4885
5172
|
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}}"]
|
|
4886
5173
|
})
|
|
4887
5174
|
], FileUploadComponent);
|
|
@@ -4899,6 +5186,7 @@ var FileUploadModule = /** @class */ (function () {
|
|
|
4899
5186
|
ButtonModule,
|
|
4900
5187
|
TooltipModule$1,
|
|
4901
5188
|
ProgressBarModule$1,
|
|
5189
|
+
TranslateModule,
|
|
4902
5190
|
],
|
|
4903
5191
|
providers: [FileUploadService],
|
|
4904
5192
|
exports: [FileUploadComponent],
|
|
@@ -5263,294 +5551,319 @@ var MaskFormatterModule = /** @class */ (function () {
|
|
|
5263
5551
|
return MaskFormatterModule;
|
|
5264
5552
|
}());
|
|
5265
5553
|
|
|
5266
|
-
var
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5554
|
+
var PasswordStrengths;
|
|
5555
|
+
(function (PasswordStrengths) {
|
|
5556
|
+
PasswordStrengths["VeryWeak"] = "Very_weak";
|
|
5557
|
+
PasswordStrengths["Weak"] = "weak";
|
|
5558
|
+
PasswordStrengths["Medium"] = "medium";
|
|
5559
|
+
PasswordStrengths["Strong"] = "strong";
|
|
5560
|
+
})(PasswordStrengths || (PasswordStrengths = {}));
|
|
5561
|
+
|
|
5562
|
+
var PasswordStrengthPositions;
|
|
5563
|
+
(function (PasswordStrengthPositions) {
|
|
5564
|
+
PasswordStrengthPositions["Top"] = "top";
|
|
5565
|
+
PasswordStrengthPositions["Right"] = "right";
|
|
5566
|
+
PasswordStrengthPositions["Left"] = "left";
|
|
5567
|
+
})(PasswordStrengthPositions || (PasswordStrengthPositions = {}));
|
|
5568
|
+
|
|
5569
|
+
var PasswordStrengthComponent = /** @class */ (function () {
|
|
5570
|
+
function PasswordStrengthComponent() {
|
|
5571
|
+
this.weakTitle = "Fraca";
|
|
5572
|
+
this.mediumTitle = "Médio";
|
|
5573
|
+
this.strongTitle = "Forte";
|
|
5574
|
+
this.position = PasswordStrengthPositions.Right;
|
|
5575
|
+
this.left = 0;
|
|
5576
|
+
this.top = 0;
|
|
5577
|
+
this.visible = false;
|
|
5276
5578
|
}
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
this.updateVariables();
|
|
5280
|
-
_super.prototype.ngOnInit.call(this);
|
|
5579
|
+
PasswordStrengthComponent.prototype.ngOnInit = function () {
|
|
5580
|
+
this.title = this.weakTitle;
|
|
5281
5581
|
};
|
|
5282
|
-
|
|
5283
|
-
var
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5582
|
+
PasswordStrengthComponent.prototype.setPasswordStrengthPosition = function () {
|
|
5583
|
+
var passwordStrength = document.querySelector(".password-strength");
|
|
5584
|
+
switch (this.position) {
|
|
5585
|
+
case PasswordStrengthPositions.Top:
|
|
5586
|
+
passwordStrength.classList.add("password-strength--top");
|
|
5587
|
+
break;
|
|
5588
|
+
case PasswordStrengthPositions.Right:
|
|
5589
|
+
passwordStrength.classList.add("password-strength--right");
|
|
5590
|
+
break;
|
|
5591
|
+
case PasswordStrengthPositions.Left:
|
|
5592
|
+
passwordStrength.classList.add("password-strength--left");
|
|
5593
|
+
break;
|
|
5294
5594
|
}
|
|
5295
5595
|
};
|
|
5296
|
-
|
|
5297
|
-
var
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5596
|
+
PasswordStrengthComponent.prototype.updateIndicators = function (passwordStrength) {
|
|
5597
|
+
var strengthIndicator1 = document.querySelector("#strength-indicator-1");
|
|
5598
|
+
var strengthIndicator2 = document.querySelector("#strength-indicator-2");
|
|
5599
|
+
var strengthIndicator3 = document.querySelector("#strength-indicator-3");
|
|
5600
|
+
var onIndicators = [];
|
|
5601
|
+
var indicators = [
|
|
5602
|
+
strengthIndicator1,
|
|
5603
|
+
strengthIndicator2,
|
|
5604
|
+
strengthIndicator3,
|
|
5605
|
+
];
|
|
5606
|
+
var strengthClass;
|
|
5607
|
+
switch (passwordStrength) {
|
|
5608
|
+
case PasswordStrengths.VeryWeak:
|
|
5609
|
+
this.title = this.weakTitle;
|
|
5610
|
+
break;
|
|
5611
|
+
case PasswordStrengths.Weak:
|
|
5612
|
+
this.title = this.weakTitle;
|
|
5613
|
+
strengthClass = "strength-indicator--weak";
|
|
5614
|
+
onIndicators.push(strengthIndicator1);
|
|
5615
|
+
break;
|
|
5616
|
+
case PasswordStrengths.Medium:
|
|
5617
|
+
this.title = this.mediumTitle;
|
|
5618
|
+
strengthClass = "strength-indicator--medium";
|
|
5619
|
+
onIndicators.push(strengthIndicator1);
|
|
5620
|
+
onIndicators.push(strengthIndicator2);
|
|
5621
|
+
break;
|
|
5622
|
+
case PasswordStrengths.Strong:
|
|
5623
|
+
this.title = this.strongTitle;
|
|
5624
|
+
strengthClass = "strength-indicator--strong";
|
|
5625
|
+
onIndicators.push(strengthIndicator1);
|
|
5626
|
+
onIndicators.push(strengthIndicator2);
|
|
5627
|
+
onIndicators.push(strengthIndicator3);
|
|
5628
|
+
break;
|
|
5305
5629
|
}
|
|
5630
|
+
indicators.forEach(function (indicator) {
|
|
5631
|
+
indicator.classList.remove("strength-indicator--weak", "strength-indicator--medium", "strength-indicator--strong");
|
|
5632
|
+
});
|
|
5633
|
+
onIndicators.forEach(function (indicator) {
|
|
5634
|
+
indicator.classList.add(strengthClass);
|
|
5635
|
+
});
|
|
5306
5636
|
};
|
|
5307
|
-
/**
|
|
5308
|
-
* Update the options values according to the directive input values.
|
|
5309
|
-
*/
|
|
5310
|
-
BignumberInputDirective.prototype.updateVariables = function () {
|
|
5311
|
-
var _a;
|
|
5312
|
-
this.options = {
|
|
5313
|
-
align: this.alignTo,
|
|
5314
|
-
decimalSeparator: this.decimalSeparator,
|
|
5315
|
-
thousandsSeparator: (_a = this.thousandsSeparator) !== null && _a !== void 0 ? _a : ".",
|
|
5316
|
-
scale: this.scale || 0,
|
|
5317
|
-
prefix: "",
|
|
5318
|
-
suffix: "",
|
|
5319
|
-
allowNegative: this.allowNegative
|
|
5320
|
-
};
|
|
5321
|
-
this.calculateMaxLength();
|
|
5322
|
-
};
|
|
5323
|
-
/**
|
|
5324
|
-
* Responsible to calculate the field maximum length considering the separators.
|
|
5325
|
-
*/
|
|
5326
|
-
BignumberInputDirective.prototype.calculateMaxLength = function () {
|
|
5327
|
-
var _a, _b;
|
|
5328
|
-
var decSepLength = this.decimalSeparator.length;
|
|
5329
|
-
var thoSepLength = (_b = (_a = this.thousandsSeparator) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1;
|
|
5330
|
-
var maxLength = this.precision + (this.scale ? decSepLength : 0);
|
|
5331
|
-
maxLength += Math.ceil((this.precision - (this.scale ? this.scale : 0)) / 3 - 1) * thoSepLength;
|
|
5332
|
-
this._maxLength = maxLength;
|
|
5333
|
-
this.maxLength = maxLength;
|
|
5334
|
-
};
|
|
5335
|
-
var BignumberInputDirective_1;
|
|
5336
5637
|
__decorate([
|
|
5337
5638
|
Input()
|
|
5338
|
-
],
|
|
5339
|
-
__decorate([
|
|
5340
|
-
Input()
|
|
5341
|
-
], BignumberInputDirective.prototype, "scale", void 0);
|
|
5342
|
-
__decorate([
|
|
5343
|
-
Input()
|
|
5344
|
-
], BignumberInputDirective.prototype, "decimalSeparator", void 0);
|
|
5639
|
+
], PasswordStrengthComponent.prototype, "weakTitle", void 0);
|
|
5345
5640
|
__decorate([
|
|
5346
5641
|
Input()
|
|
5347
|
-
],
|
|
5642
|
+
], PasswordStrengthComponent.prototype, "mediumTitle", void 0);
|
|
5348
5643
|
__decorate([
|
|
5349
5644
|
Input()
|
|
5350
|
-
],
|
|
5645
|
+
], PasswordStrengthComponent.prototype, "strongTitle", void 0);
|
|
5351
5646
|
__decorate([
|
|
5352
5647
|
Input()
|
|
5353
|
-
],
|
|
5354
|
-
__decorate([
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
__decorate([
|
|
5359
|
-
HostBinding("attr.maxLength")
|
|
5360
|
-
], BignumberInputDirective.prototype, "maxLength", void 0);
|
|
5361
|
-
__decorate([
|
|
5362
|
-
HostListener("keypress", ["$event"])
|
|
5363
|
-
], BignumberInputDirective.prototype, "onKeypress", null);
|
|
5364
|
-
BignumberInputDirective = BignumberInputDirective_1 = __decorate([
|
|
5365
|
-
Directive({
|
|
5366
|
-
selector: "input[sBignumberInput]",
|
|
5367
|
-
providers: [
|
|
5368
|
-
{
|
|
5369
|
-
provide: NG_VALUE_ACCESSOR,
|
|
5370
|
-
useExisting: forwardRef(function () { return BignumberInputDirective_1; }),
|
|
5371
|
-
multi: true,
|
|
5372
|
-
},
|
|
5373
|
-
],
|
|
5374
|
-
})
|
|
5375
|
-
], BignumberInputDirective);
|
|
5376
|
-
return BignumberInputDirective;
|
|
5377
|
-
}(CurrencyMaskDirective$1));
|
|
5378
|
-
|
|
5379
|
-
var BignumberInputModule = /** @class */ (function () {
|
|
5380
|
-
function BignumberInputModule() {
|
|
5381
|
-
}
|
|
5382
|
-
BignumberInputModule = __decorate([
|
|
5383
|
-
NgModule({
|
|
5384
|
-
imports: [CommonModule],
|
|
5385
|
-
declarations: [BignumberInputDirective],
|
|
5386
|
-
exports: [BignumberInputDirective],
|
|
5648
|
+
], PasswordStrengthComponent.prototype, "description", void 0);
|
|
5649
|
+
PasswordStrengthComponent = __decorate([
|
|
5650
|
+
Component({
|
|
5651
|
+
template: "<div\n class=\"password-strength\"\n [ngStyle]=\"{\n 'left': left + 'px',\n 'top': top + 'px'\n }\"\n [ngClass]=\"['password-strength--' + position]\">\n <span class=\"title\">{{ title }}</span>\n <div class=\"strength-indicators\">\n <span class=\"strength-indicator\" id=\"strength-indicator-1\"></span>\n <span class=\"strength-indicator\" id=\"strength-indicator-2\"></span>\n <span class=\"strength-indicator\" id=\"strength-indicator-3\"></span>\n </div>\n <span class=\"content\">{{ description }}</span>\n</div>",
|
|
5652
|
+
styles: [".password-strength{position:fixed;transform:translateX(-50%);background-color:#fff;border-radius:2px;box-shadow:0 0 5px 1px #ccc;padding:10px;width:232px;z-index:99999}.password-strength::after{content:\"\";position:absolute}.password-strength .title{font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:700;line-height:150%}.password-strength .strength-indicators{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:10px 0}.password-strength .strength-indicators .strength-indicator{background-color:#ccc;border-radius:2px;display:inline-block;height:3px;width:64px}.password-strength .strength-indicators .strength-indicator--weak{background-color:#c13018}.password-strength .strength-indicators .strength-indicator--medium{background-color:#fcbf10}.password-strength .strength-indicators .strength-indicator--strong{background-color:#0c9348}.password-strength .content{font-family:\"Open Sans\",sans-serif;font-size:12px;font-weight:400;line-height:150%}.password-strength--top{transform:translate(-50%,-100%)}.password-strength--top::after{top:100%;right:calc(50% - 4px);border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #fff}.password-strength--right{transform:translateY(-50%)}.password-strength--right::after{bottom:calc(50% - 8px);left:-8px;border-top:8px solid transparent;border-right:8px solid #fff;border-bottom:8px solid transparent}.password-strength--left{transform:translate(-100%,-50%)}.password-strength--left::after{bottom:calc(50% - 8px);right:-8px;border-top:8px solid transparent;border-left:8px solid #fff;border-bottom:8px solid transparent}"]
|
|
5387
5653
|
})
|
|
5388
|
-
],
|
|
5389
|
-
return
|
|
5654
|
+
], PasswordStrengthComponent);
|
|
5655
|
+
return PasswordStrengthComponent;
|
|
5390
5656
|
}());
|
|
5391
5657
|
|
|
5392
|
-
var
|
|
5393
|
-
function
|
|
5394
|
-
|
|
5395
|
-
this.
|
|
5396
|
-
this.
|
|
5397
|
-
this.
|
|
5398
|
-
this.
|
|
5399
|
-
this.
|
|
5400
|
-
|
|
5401
|
-
});
|
|
5402
|
-
this.table.tableService.selectionSource$.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function () {
|
|
5403
|
-
_this.checked = _this.updateCheckedState();
|
|
5404
|
-
});
|
|
5658
|
+
var PasswordStrengthDirective = /** @class */ (function () {
|
|
5659
|
+
function PasswordStrengthDirective(elementRef, appRef, componentFactoryResolver, injector) {
|
|
5660
|
+
this.elementRef = elementRef;
|
|
5661
|
+
this.appRef = appRef;
|
|
5662
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
5663
|
+
this.injector = injector;
|
|
5664
|
+
this.enabled = true;
|
|
5665
|
+
this.position = PasswordStrengthPositions.Right;
|
|
5666
|
+
this.componentRef = null;
|
|
5405
5667
|
}
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
this.checked = this.updateCheckedState();
|
|
5409
|
-
};
|
|
5410
|
-
TableHeaderCheckboxComponent.prototype.ngOnDestroy = function () {
|
|
5411
|
-
this.ngUnsubscribe.next();
|
|
5412
|
-
};
|
|
5413
|
-
TableHeaderCheckboxComponent.prototype.onFocus = function () {
|
|
5414
|
-
this.hasFocus = true;
|
|
5668
|
+
PasswordStrengthDirective.prototype.ngOnInit = function () {
|
|
5669
|
+
this.validateProperties();
|
|
5415
5670
|
};
|
|
5416
|
-
|
|
5417
|
-
|
|
5671
|
+
PasswordStrengthDirective.prototype.onFocus = function () {
|
|
5672
|
+
var _a, _b, _c;
|
|
5673
|
+
var content = (_a = this.elementRef.nativeElement.value) !== null && _a !== void 0 ? _a : "";
|
|
5674
|
+
if (content) {
|
|
5675
|
+
this.createPasswordStrength();
|
|
5676
|
+
(_b = this.componentRef) === null || _b === void 0 ? void 0 : _b.instance.updateIndicators(this.validation(content));
|
|
5677
|
+
}
|
|
5678
|
+
else {
|
|
5679
|
+
(_c = this.componentRef) === null || _c === void 0 ? void 0 : _c.instance.updateIndicators(PasswordStrengths.VeryWeak);
|
|
5680
|
+
}
|
|
5418
5681
|
};
|
|
5419
|
-
|
|
5420
|
-
|
|
5682
|
+
PasswordStrengthDirective.prototype.onBlur = function () {
|
|
5683
|
+
this.destroyPasswordStrength();
|
|
5421
5684
|
};
|
|
5422
|
-
|
|
5423
|
-
if (
|
|
5424
|
-
|
|
5425
|
-
|
|
5685
|
+
PasswordStrengthDirective.prototype.createPasswordStrength = function () {
|
|
5686
|
+
if (this.enabled && this.componentRef === null) {
|
|
5687
|
+
var componentFactory = this.componentFactoryResolver.resolveComponentFactory(PasswordStrengthComponent);
|
|
5688
|
+
this.componentRef = componentFactory.create(this.injector);
|
|
5689
|
+
this.appRef.attachView(this.componentRef.hostView);
|
|
5690
|
+
var domElem = this.componentRef.hostView.rootNodes[0];
|
|
5691
|
+
document.body.appendChild(domElem);
|
|
5692
|
+
this.setPasswordStrengthComponentProperties();
|
|
5693
|
+
this.showPasswordStrength();
|
|
5426
5694
|
}
|
|
5427
5695
|
};
|
|
5428
|
-
|
|
5429
|
-
if (this.
|
|
5430
|
-
|
|
5431
|
-
return val && val.length > 0 && this.table.selection && this.table.selection.length > 0 && this.isAllFilteredValuesChecked();
|
|
5432
|
-
}
|
|
5433
|
-
else {
|
|
5434
|
-
var val = this.table.value;
|
|
5435
|
-
return val && val.length > 0 && this.table.selection && this.table.selection.length > 0 && this.isAllValuesChecked();
|
|
5696
|
+
PasswordStrengthDirective.prototype.showPasswordStrength = function () {
|
|
5697
|
+
if (this.componentRef !== null) {
|
|
5698
|
+
this.componentRef.instance.visible = true;
|
|
5436
5699
|
}
|
|
5437
5700
|
};
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5701
|
+
PasswordStrengthDirective.prototype.setPasswordStrengthComponentProperties = function () {
|
|
5702
|
+
if (this.componentRef != null) {
|
|
5703
|
+
this.componentRef.instance.position = this.position;
|
|
5704
|
+
this.componentRef.instance.weakTitle = this.weakTitle;
|
|
5705
|
+
this.componentRef.instance.mediumTitle = this.mediumTitle;
|
|
5706
|
+
this.componentRef.instance.strongTitle = this.strongTitle;
|
|
5707
|
+
this.componentRef.instance.description = this.description;
|
|
5708
|
+
var _a = this.elementRef.nativeElement.getBoundingClientRect(), top_1 = _a.top, right = _a.right, bottom = _a.bottom, left = _a.left;
|
|
5709
|
+
var margin = 20;
|
|
5710
|
+
var elementRefHeight = bottom - top_1;
|
|
5711
|
+
var elementRefWidth = right - left;
|
|
5712
|
+
var safeSpace = 150;
|
|
5713
|
+
var positioned = false;
|
|
5714
|
+
var invalidOptions = [];
|
|
5715
|
+
while (!positioned) {
|
|
5716
|
+
if (invalidOptions.includes(PasswordStrengthPositions.Top)
|
|
5717
|
+
&& invalidOptions.includes(PasswordStrengthPositions.Right)
|
|
5718
|
+
&& invalidOptions.includes(PasswordStrengthPositions.Left)) {
|
|
5719
|
+
this.destroyPasswordStrength();
|
|
5720
|
+
throw new Error("No space to show password strength");
|
|
5721
|
+
}
|
|
5722
|
+
switch (this.position) {
|
|
5723
|
+
case PasswordStrengthPositions.Top: {
|
|
5724
|
+
var topShift = top_1;
|
|
5725
|
+
var rightShift = document.body.clientWidth - right;
|
|
5726
|
+
var leftShift = left;
|
|
5727
|
+
if (topShift <= elementRefHeight + safeSpace || rightShift < 50 || leftShift < 50) {
|
|
5728
|
+
this.position = PasswordStrengthPositions.Right;
|
|
5729
|
+
invalidOptions.push(PasswordStrengthPositions.Top);
|
|
5730
|
+
break;
|
|
5731
|
+
}
|
|
5732
|
+
this.componentRef.instance.top = Math.round(top_1 - margin);
|
|
5733
|
+
this.componentRef.instance.left = Math.round(elementRefWidth / 2 + left);
|
|
5734
|
+
positioned = true;
|
|
5735
|
+
break;
|
|
5736
|
+
}
|
|
5737
|
+
case PasswordStrengthPositions.Right: {
|
|
5738
|
+
var rightShift = document.body.clientWidth - right;
|
|
5739
|
+
if (rightShift <= elementRefWidth + safeSpace) {
|
|
5740
|
+
this.position = PasswordStrengthPositions.Left;
|
|
5741
|
+
invalidOptions.push(PasswordStrengthPositions.Right);
|
|
5742
|
+
break;
|
|
5743
|
+
}
|
|
5744
|
+
this.componentRef.instance.top = Math.round(top_1 + elementRefHeight / 2);
|
|
5745
|
+
this.componentRef.instance.left = Math.round(right + margin);
|
|
5746
|
+
positioned = true;
|
|
5747
|
+
break;
|
|
5748
|
+
}
|
|
5749
|
+
case PasswordStrengthPositions.Left: {
|
|
5750
|
+
var leftShift = left;
|
|
5751
|
+
if (leftShift <= elementRefWidth + safeSpace) {
|
|
5752
|
+
this.position = PasswordStrengthPositions.Top;
|
|
5753
|
+
invalidOptions.push(PasswordStrengthPositions.Left);
|
|
5754
|
+
break;
|
|
5755
|
+
}
|
|
5756
|
+
this.componentRef.instance.top = Math.round(top_1 + elementRefHeight / 2);
|
|
5757
|
+
this.componentRef.instance.left = Math.round(left - margin);
|
|
5758
|
+
positioned = true;
|
|
5759
|
+
break;
|
|
5760
|
+
}
|
|
5761
|
+
default: {
|
|
5762
|
+
break;
|
|
5763
|
+
}
|
|
5764
|
+
}
|
|
5765
|
+
this.componentRef.instance.position = this.position;
|
|
5766
|
+
}
|
|
5456
5767
|
}
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5768
|
+
};
|
|
5769
|
+
PasswordStrengthDirective.prototype.validateProperties = function () {
|
|
5770
|
+
this.validation = this.validation || this.defaultValidator;
|
|
5771
|
+
if (!this.description) {
|
|
5772
|
+
throw new Error("Description is required");
|
|
5461
5773
|
}
|
|
5462
|
-
this.table.updateSelectionKeys();
|
|
5463
|
-
this.table.selectionChange.emit(this.table._selection);
|
|
5464
|
-
this.tableService.onSelectionChange();
|
|
5465
|
-
if (this.table.isStateful())
|
|
5466
|
-
this.table.saveState();
|
|
5467
5774
|
};
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5775
|
+
PasswordStrengthDirective.prototype.destroyPasswordStrength = function () {
|
|
5776
|
+
if (this.componentRef !== null) {
|
|
5777
|
+
this.appRef.detachView(this.componentRef.hostView);
|
|
5778
|
+
this.componentRef.destroy();
|
|
5779
|
+
this.componentRef = null;
|
|
5472
5780
|
}
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5781
|
+
};
|
|
5782
|
+
PasswordStrengthDirective.prototype.defaultValidator = function (content) {
|
|
5783
|
+
var points = 0;
|
|
5784
|
+
var regExpValidations = [
|
|
5785
|
+
new RegExp("(?=.*\\d)"),
|
|
5786
|
+
new RegExp("(?=.*[a-z])"),
|
|
5787
|
+
new RegExp("(?=.*[A-Z])"),
|
|
5788
|
+
new RegExp("(?=.*[!@#$%&*.\\-=+^~])"),
|
|
5789
|
+
];
|
|
5790
|
+
if (content.length >= 6) {
|
|
5791
|
+
points++;
|
|
5792
|
+
}
|
|
5793
|
+
regExpValidations.forEach(function (validation) {
|
|
5794
|
+
if (validation.test(content)) {
|
|
5795
|
+
points++;
|
|
5488
5796
|
}
|
|
5489
|
-
|
|
5797
|
+
});
|
|
5798
|
+
if (points < 1) {
|
|
5799
|
+
return PasswordStrengths.VeryWeak;
|
|
5490
5800
|
}
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
if (
|
|
5495
|
-
return
|
|
5801
|
+
else if (points < 4) {
|
|
5802
|
+
return PasswordStrengths.Weak;
|
|
5803
|
+
}
|
|
5804
|
+
else if (points < 5) {
|
|
5805
|
+
return PasswordStrengths.Medium;
|
|
5496
5806
|
}
|
|
5497
5807
|
else {
|
|
5498
|
-
|
|
5499
|
-
for (var _b = __values(this.table.value), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
5500
|
-
var rowData = _c.value;
|
|
5501
|
-
if (!this.table.isSelected(rowData)) {
|
|
5502
|
-
return false;
|
|
5503
|
-
}
|
|
5504
|
-
}
|
|
5505
|
-
}
|
|
5506
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
5507
|
-
finally {
|
|
5508
|
-
try {
|
|
5509
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
5510
|
-
}
|
|
5511
|
-
finally { if (e_2) throw e_2.error; }
|
|
5512
|
-
}
|
|
5513
|
-
return true;
|
|
5808
|
+
return PasswordStrengths.Strong;
|
|
5514
5809
|
}
|
|
5515
5810
|
};
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
{ type:
|
|
5520
|
-
{ type:
|
|
5811
|
+
PasswordStrengthDirective.ctorParameters = function () { return [
|
|
5812
|
+
{ type: ElementRef },
|
|
5813
|
+
{ type: ApplicationRef },
|
|
5814
|
+
{ type: ComponentFactoryResolver },
|
|
5815
|
+
{ type: Injector }
|
|
5521
5816
|
]; };
|
|
5522
5817
|
__decorate([
|
|
5523
|
-
Input()
|
|
5524
|
-
],
|
|
5818
|
+
Input("sPasswordStrength")
|
|
5819
|
+
], PasswordStrengthDirective.prototype, "enabled", void 0);
|
|
5525
5820
|
__decorate([
|
|
5526
|
-
Input()
|
|
5527
|
-
],
|
|
5821
|
+
Input("psValidation")
|
|
5822
|
+
], PasswordStrengthDirective.prototype, "validation", void 0);
|
|
5528
5823
|
__decorate([
|
|
5529
|
-
Input()
|
|
5530
|
-
],
|
|
5824
|
+
Input("psPosition")
|
|
5825
|
+
], PasswordStrengthDirective.prototype, "position", void 0);
|
|
5531
5826
|
__decorate([
|
|
5532
|
-
Input()
|
|
5533
|
-
],
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5827
|
+
Input("psWeakTitle")
|
|
5828
|
+
], PasswordStrengthDirective.prototype, "weakTitle", void 0);
|
|
5829
|
+
__decorate([
|
|
5830
|
+
Input("psMediumTitle")
|
|
5831
|
+
], PasswordStrengthDirective.prototype, "mediumTitle", void 0);
|
|
5832
|
+
__decorate([
|
|
5833
|
+
Input("psStrongTitle")
|
|
5834
|
+
], PasswordStrengthDirective.prototype, "strongTitle", void 0);
|
|
5835
|
+
__decorate([
|
|
5836
|
+
Input("psDescription")
|
|
5837
|
+
], PasswordStrengthDirective.prototype, "description", void 0);
|
|
5838
|
+
__decorate([
|
|
5839
|
+
HostListener("keyup"),
|
|
5840
|
+
HostListener("focus")
|
|
5841
|
+
], PasswordStrengthDirective.prototype, "onFocus", null);
|
|
5842
|
+
__decorate([
|
|
5843
|
+
HostListener("blur")
|
|
5844
|
+
], PasswordStrengthDirective.prototype, "onBlur", null);
|
|
5845
|
+
PasswordStrengthDirective = __decorate([
|
|
5846
|
+
Directive({
|
|
5847
|
+
selector: "[sPasswordStrength]",
|
|
5538
5848
|
})
|
|
5539
|
-
],
|
|
5540
|
-
return
|
|
5849
|
+
], PasswordStrengthDirective);
|
|
5850
|
+
return PasswordStrengthDirective;
|
|
5541
5851
|
}());
|
|
5542
5852
|
|
|
5543
|
-
var
|
|
5544
|
-
function
|
|
5853
|
+
var PasswordStrengthModule = /** @class */ (function () {
|
|
5854
|
+
function PasswordStrengthModule() {
|
|
5545
5855
|
}
|
|
5546
|
-
|
|
5856
|
+
PasswordStrengthModule = __decorate([
|
|
5547
5857
|
NgModule({
|
|
5548
5858
|
imports: [CommonModule],
|
|
5549
|
-
|
|
5550
|
-
|
|
5859
|
+
declarations: [
|
|
5860
|
+
PasswordStrengthComponent,
|
|
5861
|
+
PasswordStrengthDirective,
|
|
5862
|
+
],
|
|
5863
|
+
exports: [PasswordStrengthDirective],
|
|
5551
5864
|
})
|
|
5552
|
-
],
|
|
5553
|
-
return
|
|
5865
|
+
], PasswordStrengthModule);
|
|
5866
|
+
return PasswordStrengthModule;
|
|
5554
5867
|
}());
|
|
5555
5868
|
|
|
5556
5869
|
var NavigationDirective = /** @class */ (function () {
|
|
@@ -6513,223 +6826,246 @@ var TablePagingComponent = /** @class */ (function () {
|
|
|
6513
6826
|
], TablePagingComponent.prototype, "enableExportSelectedRecords", void 0);
|
|
6514
6827
|
__decorate([
|
|
6515
6828
|
Input()
|
|
6516
|
-
], TablePagingComponent.prototype, "customActions", void 0);
|
|
6517
|
-
__decorate([
|
|
6518
|
-
Input()
|
|
6519
|
-
], TablePagingComponent.prototype, "loadAllRecords", void 0);
|
|
6520
|
-
__decorate([
|
|
6521
|
-
Input()
|
|
6522
|
-
], TablePagingComponent.prototype, "loadCurrentPageRecords", void 0);
|
|
6523
|
-
__decorate([
|
|
6524
|
-
Input()
|
|
6525
|
-
], TablePagingComponent.prototype, "loadSelectedRecords", void 0);
|
|
6526
|
-
__decorate([
|
|
6527
|
-
Output()
|
|
6528
|
-
], TablePagingComponent.prototype, "totalRecordsText", void 0);
|
|
6529
|
-
TablePagingComponent = __decorate([
|
|
6530
|
-
Component({
|
|
6531
|
-
template: "<div class=\"paging-container\">\n <span class=\"total-records\">\n {{totalRecordsText}}\n </span>\n <s-button\n *ngIf=\"exportable\"\n class=\"export-button\" \n priority=\"default\" \n iconClass=\"fa fa-fw fa-file-export\" \n [disabled]=\"false\" \n [auxiliary]=\"true\" \n [tooltip]=\"getTooltipText()\" \n [model]=\"getActions()\">\n </s-button>\n</div>\n",
|
|
6532
|
-
selector: "s-table-paging",
|
|
6533
|
-
styles: [".paging-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.export-button{margin-left:6px}"]
|
|
6534
|
-
}),
|
|
6535
|
-
__param(1, Inject(HostProjectConfigsInjectionToken))
|
|
6536
|
-
], TablePagingComponent);
|
|
6537
|
-
return TablePagingComponent;
|
|
6538
|
-
}());
|
|
6539
|
-
|
|
6540
|
-
var TableModule = /** @class */ (function () {
|
|
6541
|
-
function TableModule() {
|
|
6542
|
-
}
|
|
6543
|
-
TableModule = __decorate([
|
|
6544
|
-
NgModule({
|
|
6545
|
-
imports: [
|
|
6546
|
-
CommonModule,
|
|
6547
|
-
TooltipModule,
|
|
6548
|
-
TokenListModule,
|
|
6549
|
-
TranslateModule,
|
|
6550
|
-
ButtonModule,
|
|
6551
|
-
InfoSignModule
|
|
6552
|
-
],
|
|
6553
|
-
exports: [
|
|
6554
|
-
RowTogllerDirective,
|
|
6555
|
-
NavigationDirective,
|
|
6556
|
-
TableColumnsComponent,
|
|
6557
|
-
TableFrozenPositionDirective,
|
|
6558
|
-
TablePagingComponent
|
|
6559
|
-
],
|
|
6560
|
-
declarations: [
|
|
6561
|
-
RowTogllerDirective,
|
|
6562
|
-
NavigationDirective,
|
|
6563
|
-
TableColumnsComponent,
|
|
6564
|
-
TableFrozenPositionDirective,
|
|
6565
|
-
TablePagingComponent
|
|
6566
|
-
],
|
|
6567
|
-
})
|
|
6568
|
-
], TableModule);
|
|
6569
|
-
return TableModule;
|
|
6570
|
-
}());
|
|
6571
|
-
|
|
6572
|
-
var AutocompleteFieldComponent = /** @class */ (function () {
|
|
6573
|
-
function AutocompleteFieldComponent() {
|
|
6574
|
-
}
|
|
6575
|
-
__decorate([
|
|
6576
|
-
Input()
|
|
6577
|
-
], AutocompleteFieldComponent.prototype, "field", void 0);
|
|
6578
|
-
__decorate([
|
|
6579
|
-
Input()
|
|
6580
|
-
], AutocompleteFieldComponent.prototype, "formControl", void 0);
|
|
6581
|
-
AutocompleteFieldComponent = __decorate([
|
|
6582
|
-
Component({
|
|
6583
|
-
template: "<div\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\">\n <s-lookup\n [id]=\"(field.id || field.name)\"\n [multiple]=\"field.multiple\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [lookupSuggestions]=\"field.suggestions\"\n [dataKey]=\"field.dataKey\"\n (onLookupRequest)=\"field.onSearch($event)\"\n [lookupDisplayField]=\"field.displayField\"\n [showSearch]=\"false\"\n [lookupAppendTo]=\"field.appendTo\"\n (onSelect)=\"field.onSelect ? field.onSelect($event) : null\"\n (onUnselect)=\"field.onUnselect ? field.onUnselect($event) : null\"\n (onClear)=\"field.onClear ? field.onClear($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [lookupEmptyMessage]=\"field.emptyMessage\">\n </s-lookup>\n</div>\n"
|
|
6584
|
-
})
|
|
6585
|
-
], AutocompleteFieldComponent);
|
|
6586
|
-
return AutocompleteFieldComponent;
|
|
6587
|
-
}());
|
|
6588
|
-
|
|
6589
|
-
var BooleanFieldComponent = /** @class */ (function () {
|
|
6590
|
-
function BooleanFieldComponent() {
|
|
6591
|
-
}
|
|
6592
|
-
BooleanFieldComponent.prototype.onClear = function () {
|
|
6593
|
-
this.formControl.reset();
|
|
6594
|
-
};
|
|
6595
|
-
__decorate([
|
|
6596
|
-
Input()
|
|
6597
|
-
], BooleanFieldComponent.prototype, "field", void 0);
|
|
6598
|
-
__decorate([
|
|
6599
|
-
Input()
|
|
6600
|
-
], BooleanFieldComponent.prototype, "formControl", void 0);
|
|
6601
|
-
BooleanFieldComponent = __decorate([
|
|
6602
|
-
Component({
|
|
6603
|
-
template: "<ng-container *ngIf=\"field.verticalAlignment;else horizontalAlignment\">\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"true\"\n [label]=\"field.optionsLabel.true\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-1'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n </div>\n <div class=\"ui-g-12\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"false\"\n [label]=\"field.optionsLabel.false\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-2'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n </div>\n <div\n *ngIf=\"!field.showClear && !field.required()\"\n class=\"ui-g-12\">\n <p-radioButton \n [name]=\"field.name\"\n [value]=\"null\"\n [label]=\"field.optionsLabel.empty\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-3'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton> \n </div>\n <div>\n <s-button\n *ngIf=\"field.showClear && !field.required() && !formControl.disabled\"\n [label]=\"field.optionsLabel.clear || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n </div>\n\n </div>\n</ng-container>\n\n<ng-template #horizontalAlignment>\n <div class=\"ui-g\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"true\"\n [label]=\"field.optionsLabel.true\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-1'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n \n <p-radioButton\n [name]=\"field.name\"\n [value]=\"false\"\n [label]=\"field.optionsLabel.false\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-2'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n\n <p-radioButton\n *ngIf=\"!field.showClear && !field.required()\"\n [name]=\"field.name\"\n [value]=\"null\"\n [label]=\"field.optionsLabel.empty\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-3'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n\n <s-button\n *ngIf=\"field.showClear && !field.required() && !formControl.disabled\"\n style=\"margin-left: 40px;\"\n [label]=\"field.optionsLabel.clear || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n </div>\n</ng-template>\n"
|
|
6604
|
-
})
|
|
6605
|
-
], BooleanFieldComponent);
|
|
6606
|
-
return BooleanFieldComponent;
|
|
6607
|
-
}());
|
|
6608
|
-
|
|
6609
|
-
var CalendarFieldComponent = /** @class */ (function () {
|
|
6610
|
-
function CalendarFieldComponent() {
|
|
6611
|
-
}
|
|
6612
|
-
__decorate([
|
|
6613
|
-
Input()
|
|
6614
|
-
], CalendarFieldComponent.prototype, "field", void 0);
|
|
6829
|
+
], TablePagingComponent.prototype, "customActions", void 0);
|
|
6615
6830
|
__decorate([
|
|
6616
6831
|
Input()
|
|
6617
|
-
],
|
|
6832
|
+
], TablePagingComponent.prototype, "loadAllRecords", void 0);
|
|
6618
6833
|
__decorate([
|
|
6619
6834
|
Input()
|
|
6620
|
-
],
|
|
6835
|
+
], TablePagingComponent.prototype, "loadCurrentPageRecords", void 0);
|
|
6621
6836
|
__decorate([
|
|
6622
6837
|
Input()
|
|
6623
|
-
],
|
|
6624
|
-
|
|
6838
|
+
], TablePagingComponent.prototype, "loadSelectedRecords", void 0);
|
|
6839
|
+
__decorate([
|
|
6840
|
+
Output()
|
|
6841
|
+
], TablePagingComponent.prototype, "totalRecordsText", void 0);
|
|
6842
|
+
TablePagingComponent = __decorate([
|
|
6625
6843
|
Component({
|
|
6626
|
-
template: "<div
|
|
6844
|
+
template: "<div class=\"paging-container\">\n <span class=\"total-records\">\n {{totalRecordsText}}\n </span>\n <s-button\n *ngIf=\"exportable\"\n class=\"export-button\" \n priority=\"default\" \n iconClass=\"fa fa-fw fa-file-export\" \n [disabled]=\"false\" \n [auxiliary]=\"true\" \n [tooltip]=\"getTooltipText()\" \n [model]=\"getActions()\">\n </s-button>\n</div>\n",
|
|
6845
|
+
selector: "s-table-paging",
|
|
6846
|
+
styles: [".paging-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.export-button{margin-left:6px}"]
|
|
6847
|
+
}),
|
|
6848
|
+
__param(1, Inject(HostProjectConfigsInjectionToken))
|
|
6849
|
+
], TablePagingComponent);
|
|
6850
|
+
return TablePagingComponent;
|
|
6851
|
+
}());
|
|
6852
|
+
|
|
6853
|
+
var TableModule = /** @class */ (function () {
|
|
6854
|
+
function TableModule() {
|
|
6855
|
+
}
|
|
6856
|
+
TableModule = __decorate([
|
|
6857
|
+
NgModule({
|
|
6858
|
+
imports: [
|
|
6859
|
+
CommonModule,
|
|
6860
|
+
TooltipModule,
|
|
6861
|
+
TokenListModule,
|
|
6862
|
+
TranslateModule,
|
|
6863
|
+
ButtonModule,
|
|
6864
|
+
InfoSignModule
|
|
6865
|
+
],
|
|
6866
|
+
exports: [
|
|
6867
|
+
RowTogllerDirective,
|
|
6868
|
+
NavigationDirective,
|
|
6869
|
+
TableColumnsComponent,
|
|
6870
|
+
TableFrozenPositionDirective,
|
|
6871
|
+
TablePagingComponent
|
|
6872
|
+
],
|
|
6873
|
+
declarations: [
|
|
6874
|
+
RowTogllerDirective,
|
|
6875
|
+
NavigationDirective,
|
|
6876
|
+
TableColumnsComponent,
|
|
6877
|
+
TableFrozenPositionDirective,
|
|
6878
|
+
TablePagingComponent
|
|
6879
|
+
],
|
|
6627
6880
|
})
|
|
6628
|
-
],
|
|
6629
|
-
return
|
|
6881
|
+
], TableModule);
|
|
6882
|
+
return TableModule;
|
|
6630
6883
|
}());
|
|
6631
6884
|
|
|
6632
|
-
var
|
|
6633
|
-
function
|
|
6634
|
-
|
|
6635
|
-
this.
|
|
6636
|
-
this.
|
|
6885
|
+
var TableHeaderCheckboxComponent = /** @class */ (function () {
|
|
6886
|
+
function TableHeaderCheckboxComponent(table, tableService) {
|
|
6887
|
+
var _this = this;
|
|
6888
|
+
this.table = table;
|
|
6889
|
+
this.tableService = tableService;
|
|
6890
|
+
this.id = "s-table-header-checkbox-" + TableHeaderCheckboxComponent_1.nextId++;
|
|
6891
|
+
this.ngUnsubscribe = new Subject();
|
|
6892
|
+
this.table.tableService.valueSource$.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function () {
|
|
6893
|
+
_this.checked = _this.updateCheckedState();
|
|
6894
|
+
});
|
|
6895
|
+
this.table.tableService.selectionSource$.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function () {
|
|
6896
|
+
_this.checked = _this.updateCheckedState();
|
|
6897
|
+
});
|
|
6637
6898
|
}
|
|
6638
|
-
|
|
6899
|
+
TableHeaderCheckboxComponent_1 = TableHeaderCheckboxComponent;
|
|
6900
|
+
TableHeaderCheckboxComponent.prototype.ngOnInit = function () {
|
|
6901
|
+
this.checked = this.updateCheckedState();
|
|
6902
|
+
};
|
|
6903
|
+
TableHeaderCheckboxComponent.prototype.ngOnDestroy = function () {
|
|
6904
|
+
this.ngUnsubscribe.next();
|
|
6905
|
+
};
|
|
6906
|
+
TableHeaderCheckboxComponent.prototype.onFocus = function () {
|
|
6907
|
+
this.hasFocus = true;
|
|
6908
|
+
};
|
|
6909
|
+
TableHeaderCheckboxComponent.prototype.onBlur = function () {
|
|
6910
|
+
this.hasFocus = false;
|
|
6911
|
+
};
|
|
6912
|
+
TableHeaderCheckboxComponent.prototype.isDisabled = function () {
|
|
6913
|
+
return this.disabled || !this.table.value || !this.table.value.length;
|
|
6914
|
+
};
|
|
6915
|
+
TableHeaderCheckboxComponent.prototype.onClick = function () {
|
|
6916
|
+
if (!this.disabled) {
|
|
6917
|
+
if (this.table.value && this.table.value.length > 0)
|
|
6918
|
+
this.onToggleCheckbox(!this.checked);
|
|
6919
|
+
}
|
|
6920
|
+
};
|
|
6921
|
+
TableHeaderCheckboxComponent.prototype.updateCheckedState = function () {
|
|
6922
|
+
if (this.table.filteredValue) {
|
|
6923
|
+
var val = this.table.filteredValue;
|
|
6924
|
+
return val && val.length > 0 && this.table.selection && this.table.selection.length > 0 && this.isAllFilteredValuesChecked();
|
|
6925
|
+
}
|
|
6926
|
+
else {
|
|
6927
|
+
var val = this.table.value;
|
|
6928
|
+
return val && val.length > 0 && this.table.selection && this.table.selection.length > 0 && this.isAllValuesChecked();
|
|
6929
|
+
}
|
|
6930
|
+
};
|
|
6931
|
+
TableHeaderCheckboxComponent.prototype.onToggleCheckbox = function (checked) {
|
|
6639
6932
|
var _this = this;
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
_this.
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6933
|
+
var _a = this.table, filteredValue = _a.filteredValue, value = _a.value, dataKey = _a.dataKey;
|
|
6934
|
+
var gridData = checked ? (filteredValue ? filteredValue.slice() : value.slice()) : [];
|
|
6935
|
+
if (checked) {
|
|
6936
|
+
var unselecteds = gridData
|
|
6937
|
+
.filter(function (record) { return !_this.table._selection.find(function (selected) { return record[dataKey] === selected[dataKey]; }); })
|
|
6938
|
+
.map(function (record) {
|
|
6939
|
+
if (_this.useAllObject)
|
|
6940
|
+
return record;
|
|
6941
|
+
var newRecord = {};
|
|
6942
|
+
if (_this.rowProps)
|
|
6943
|
+
_this.rowProps.forEach(function (prop) { return (newRecord[prop] = record[prop]); });
|
|
6944
|
+
else
|
|
6945
|
+
newRecord[dataKey] = record[dataKey];
|
|
6946
|
+
return newRecord;
|
|
6947
|
+
});
|
|
6948
|
+
this.table._selection = __spread(this.table._selection, unselecteds);
|
|
6949
|
+
}
|
|
6950
|
+
else {
|
|
6951
|
+
value.forEach(function (data) {
|
|
6952
|
+
_this.table._selection = _this.table._selection.filter(function (record) { return record[dataKey] !== data[dataKey]; });
|
|
6953
|
+
});
|
|
6954
|
+
}
|
|
6955
|
+
this.table.updateSelectionKeys();
|
|
6956
|
+
this.table.selectionChange.emit(this.table._selection);
|
|
6957
|
+
this.tableService.onSelectionChange();
|
|
6958
|
+
if (this.table.isStateful())
|
|
6959
|
+
this.table.saveState();
|
|
6960
|
+
};
|
|
6961
|
+
TableHeaderCheckboxComponent.prototype.isAllFilteredValuesChecked = function () {
|
|
6962
|
+
var e_1, _a;
|
|
6963
|
+
if (!this.table.filteredValue) {
|
|
6964
|
+
return false;
|
|
6965
|
+
}
|
|
6966
|
+
else {
|
|
6967
|
+
try {
|
|
6968
|
+
for (var _b = __values(this.table.filteredValue), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
6969
|
+
var rowData = _c.value;
|
|
6970
|
+
if (!this.table.isSelected(rowData)) {
|
|
6971
|
+
return false;
|
|
6972
|
+
}
|
|
6973
|
+
}
|
|
6974
|
+
}
|
|
6975
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
6976
|
+
finally {
|
|
6977
|
+
try {
|
|
6978
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
6979
|
+
}
|
|
6980
|
+
finally { if (e_1) throw e_1.error; }
|
|
6651
6981
|
}
|
|
6982
|
+
return true;
|
|
6652
6983
|
}
|
|
6653
6984
|
};
|
|
6654
|
-
|
|
6655
|
-
|
|
6985
|
+
TableHeaderCheckboxComponent.prototype.isAllValuesChecked = function () {
|
|
6986
|
+
var e_2, _a;
|
|
6987
|
+
if (!this.table.value) {
|
|
6988
|
+
return false;
|
|
6989
|
+
}
|
|
6990
|
+
else {
|
|
6991
|
+
try {
|
|
6992
|
+
for (var _b = __values(this.table.value), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
6993
|
+
var rowData = _c.value;
|
|
6994
|
+
if (!this.table.isSelected(rowData)) {
|
|
6995
|
+
return false;
|
|
6996
|
+
}
|
|
6997
|
+
}
|
|
6998
|
+
}
|
|
6999
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
7000
|
+
finally {
|
|
7001
|
+
try {
|
|
7002
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
7003
|
+
}
|
|
7004
|
+
finally { if (e_2) throw e_2.error; }
|
|
7005
|
+
}
|
|
7006
|
+
return true;
|
|
7007
|
+
}
|
|
7008
|
+
};
|
|
7009
|
+
var TableHeaderCheckboxComponent_1;
|
|
7010
|
+
TableHeaderCheckboxComponent.nextId = 0;
|
|
7011
|
+
TableHeaderCheckboxComponent.ctorParameters = function () { return [
|
|
7012
|
+
{ type: Table },
|
|
7013
|
+
{ type: TableService }
|
|
6656
7014
|
]; };
|
|
6657
7015
|
__decorate([
|
|
6658
7016
|
Input()
|
|
6659
|
-
],
|
|
7017
|
+
], TableHeaderCheckboxComponent.prototype, "id", void 0);
|
|
6660
7018
|
__decorate([
|
|
6661
7019
|
Input()
|
|
6662
|
-
],
|
|
6663
|
-
ChipsFieldComponent = __decorate([
|
|
6664
|
-
Component({
|
|
6665
|
-
template: "<div class=\"chips-field-wrapper\">\n <div style=\"width: 100%;\">\n <p-chips\n *ngIf=\"field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [pKeyFilter]=\"field.keyFilter\">\n <ng-template let-item pTemplate=\"item\">\n <span\n class=\"chip-content\"\n [sTooltip]=\"item\">\n {{ item }}\n </span>\n </ng-template>\n </p-chips>\n \n <p-chips\n *ngIf=\"!field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n <ng-template let-item pTemplate=\"item\">\n <span\n class=\"chip-content\"\n [sTooltip]=\"item\">\n {{ item }}\n </span>\n </ng-template>\n </p-chips>\n </div>\n \n <button\n *ngIf=\"field.showCopyButton && formControl.value?.length > 0 && copyButtonVisible\"\n class=\"copy-content-button\"\n (click)=\"onCopyFieldContent()\">\n {{ \"platform.angular_components.copy_field_content\" | translate }}\n </button>\n \n <span\n *ngIf=\"feedbackMessageVisible\"\n class=\"feedback-message\">\n {{ \"platform.angular_components.copied_to_clipboard\" | translate }}\n </span>\n</div>\n",
|
|
6666
|
-
styles: [".chips-field-wrapper{-ms-flex-align:start;align-items:flex-start;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.chips-field-wrapper .chip-content{display:block;overflow:hidden;padding-right:1rem;text-overflow:ellipsis}.chips-field-wrapper .copy-content-button{background-color:transparent;border:none;color:#2a6496;cursor:pointer;margin-top:8px}.chips-field-wrapper .feedback-message{color:#0c9348;display:block;margin-top:8px;-webkit-user-select:none;-ms-user-select:none;user-select:none}"]
|
|
6667
|
-
})
|
|
6668
|
-
], ChipsFieldComponent);
|
|
6669
|
-
return ChipsFieldComponent;
|
|
6670
|
-
}());
|
|
6671
|
-
|
|
6672
|
-
/**
|
|
6673
|
-
* @deprecated Should use bignumber instead
|
|
6674
|
-
*/
|
|
6675
|
-
var CurrencyFieldComponent = /** @class */ (function (_super) {
|
|
6676
|
-
__extends(CurrencyFieldComponent, _super);
|
|
6677
|
-
function CurrencyFieldComponent() {
|
|
6678
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
6679
|
-
}
|
|
7020
|
+
], TableHeaderCheckboxComponent.prototype, "disabled", void 0);
|
|
6680
7021
|
__decorate([
|
|
6681
7022
|
Input()
|
|
6682
|
-
],
|
|
7023
|
+
], TableHeaderCheckboxComponent.prototype, "rowProps", void 0);
|
|
6683
7024
|
__decorate([
|
|
6684
7025
|
Input()
|
|
6685
|
-
],
|
|
6686
|
-
|
|
7026
|
+
], TableHeaderCheckboxComponent.prototype, "useAllObject", void 0);
|
|
7027
|
+
TableHeaderCheckboxComponent = TableHeaderCheckboxComponent_1 = __decorate([
|
|
6687
7028
|
Component({
|
|
6688
|
-
|
|
7029
|
+
selector: "s-table-header-checkbox",
|
|
7030
|
+
template: "\n <div class=\"ui-chkbox ui-widget\" (click)=\"onClick()\">\n <div class=\"ui-helper-hidden-accessible\">\n <input type=\"checkbox\" [checked]=\"checked\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" [disabled]=\"isDisabled()\">\n </div>\n <div [ngClass]=\"{'ui-chkbox-box ui-widget ui-state-default':true,\n 'ui-state-active':checked, 'ui-state-disabled': isDisabled(), 'ui-state-focus': hasFocus}\">\n <span [id]=\"id\" class=\"ui-chkbox-icon ui-clickable\" [ngClass]=\"{'pi pi-check':checked}\"></span>\n </div>\n </div>\n "
|
|
6689
7031
|
})
|
|
6690
|
-
],
|
|
6691
|
-
return
|
|
6692
|
-
}(
|
|
7032
|
+
], TableHeaderCheckboxComponent);
|
|
7033
|
+
return TableHeaderCheckboxComponent;
|
|
7034
|
+
}());
|
|
6693
7035
|
|
|
6694
|
-
var
|
|
6695
|
-
|
|
6696
|
-
function FileUploadComponent() {
|
|
6697
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
7036
|
+
var TableHeaderCheckboxModule = /** @class */ (function () {
|
|
7037
|
+
function TableHeaderCheckboxModule() {
|
|
6698
7038
|
}
|
|
6699
|
-
__decorate([
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
})
|
|
6709
|
-
], FileUploadComponent);
|
|
6710
|
-
return FileUploadComponent;
|
|
6711
|
-
}(BaseFieldComponent));
|
|
7039
|
+
TableHeaderCheckboxModule = __decorate([
|
|
7040
|
+
NgModule({
|
|
7041
|
+
imports: [CommonModule],
|
|
7042
|
+
exports: [TableHeaderCheckboxComponent],
|
|
7043
|
+
declarations: [TableHeaderCheckboxComponent],
|
|
7044
|
+
})
|
|
7045
|
+
], TableHeaderCheckboxModule);
|
|
7046
|
+
return TableHeaderCheckboxModule;
|
|
7047
|
+
}());
|
|
6712
7048
|
|
|
6713
|
-
var
|
|
6714
|
-
function
|
|
7049
|
+
var AutocompleteFieldComponent = /** @class */ (function () {
|
|
7050
|
+
function AutocompleteFieldComponent() {
|
|
6715
7051
|
}
|
|
6716
7052
|
__decorate([
|
|
6717
7053
|
Input()
|
|
6718
|
-
],
|
|
7054
|
+
], AutocompleteFieldComponent.prototype, "field", void 0);
|
|
6719
7055
|
__decorate([
|
|
6720
7056
|
Input()
|
|
6721
|
-
],
|
|
6722
|
-
|
|
7057
|
+
], AutocompleteFieldComponent.prototype, "formControl", void 0);
|
|
7058
|
+
AutocompleteFieldComponent = __decorate([
|
|
6723
7059
|
Component({
|
|
6724
|
-
template: "<div\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\">\n <s-lookup\n [id]=\"(field.id || field.name)\"\n [multiple]=\"field.multiple\"\n [formControl]=\"formControl\"\n [
|
|
7060
|
+
template: "<div\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\">\n <s-lookup\n [id]=\"(field.id || field.name)\"\n [multiple]=\"field.multiple\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [lookupSuggestions]=\"field.suggestions\"\n [dataKey]=\"field.dataKey\"\n (onLookupRequest)=\"field.onSearch($event)\"\n [lookupDisplayField]=\"field.displayField\"\n [showSearch]=\"false\"\n [lookupAppendTo]=\"field.appendTo\"\n (onSelect)=\"field.onSelect ? field.onSelect($event) : null\"\n (onUnselect)=\"field.onUnselect ? field.onUnselect($event) : null\"\n (onClear)=\"field.onClear ? field.onClear($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [lookupEmptyMessage]=\"field.emptyMessage\">\n </s-lookup>\n</div>\n"
|
|
6725
7061
|
})
|
|
6726
|
-
],
|
|
6727
|
-
return
|
|
7062
|
+
], AutocompleteFieldComponent);
|
|
7063
|
+
return AutocompleteFieldComponent;
|
|
6728
7064
|
}());
|
|
6729
7065
|
|
|
6730
|
-
var
|
|
6731
|
-
__extends(
|
|
6732
|
-
function
|
|
7066
|
+
var BignumberFieldComponent = /** @class */ (function (_super) {
|
|
7067
|
+
__extends(BignumberFieldComponent, _super);
|
|
7068
|
+
function BignumberFieldComponent() {
|
|
6733
7069
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
6734
7070
|
_this.onInput = new EventEmitter();
|
|
6735
7071
|
_this.onFocus = new EventEmitter();
|
|
@@ -6737,33 +7073,35 @@ var NumberFieldComponent = /** @class */ (function (_super) {
|
|
|
6737
7073
|
_this.ngUnsubscribe = new Subject();
|
|
6738
7074
|
return _this;
|
|
6739
7075
|
}
|
|
6740
|
-
|
|
7076
|
+
BignumberFieldComponent.prototype.ngOnInit = function () {
|
|
6741
7077
|
var _this = this;
|
|
6742
|
-
this.onFocus
|
|
6743
|
-
|
|
7078
|
+
this.onFocus
|
|
7079
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
7080
|
+
.subscribe(function (event) {
|
|
7081
|
+
if (_this.field.onFocus) {
|
|
6744
7082
|
_this.field.onFocus(event);
|
|
7083
|
+
}
|
|
6745
7084
|
});
|
|
6746
|
-
this.onInput
|
|
6747
|
-
|
|
7085
|
+
this.onInput
|
|
7086
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
7087
|
+
.subscribe(function (event) {
|
|
7088
|
+
if (_this.field.onInput) {
|
|
6748
7089
|
_this.field.onInput(event);
|
|
7090
|
+
}
|
|
6749
7091
|
});
|
|
6750
|
-
this.onComplete
|
|
6751
|
-
|
|
7092
|
+
this.onComplete
|
|
7093
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
7094
|
+
.subscribe(function (event) {
|
|
7095
|
+
if (_this.field.onComplete) {
|
|
6752
7096
|
_this.field.onComplete(event);
|
|
7097
|
+
}
|
|
6753
7098
|
});
|
|
6754
7099
|
};
|
|
6755
|
-
|
|
7100
|
+
BignumberFieldComponent.prototype.ngOnDestroy = function () {
|
|
6756
7101
|
this.ngUnsubscribe.next();
|
|
6757
7102
|
this.ngUnsubscribe.complete();
|
|
6758
7103
|
};
|
|
6759
|
-
Object.defineProperty(
|
|
6760
|
-
get: function () {
|
|
6761
|
-
return NumberAlignmentOption;
|
|
6762
|
-
},
|
|
6763
|
-
enumerable: true,
|
|
6764
|
-
configurable: true
|
|
6765
|
-
});
|
|
6766
|
-
Object.defineProperty(NumberFieldComponent.prototype, "fieldType", {
|
|
7104
|
+
Object.defineProperty(BignumberFieldComponent.prototype, "fieldType", {
|
|
6767
7105
|
get: function () {
|
|
6768
7106
|
return FieldType;
|
|
6769
7107
|
},
|
|
@@ -6772,308 +7110,167 @@ var NumberFieldComponent = /** @class */ (function (_super) {
|
|
|
6772
7110
|
});
|
|
6773
7111
|
__decorate([
|
|
6774
7112
|
Input()
|
|
6775
|
-
],
|
|
7113
|
+
], BignumberFieldComponent.prototype, "field", void 0);
|
|
6776
7114
|
__decorate([
|
|
6777
7115
|
Input()
|
|
6778
|
-
],
|
|
7116
|
+
], BignumberFieldComponent.prototype, "formControl", void 0);
|
|
6779
7117
|
__decorate([
|
|
6780
7118
|
Output()
|
|
6781
|
-
],
|
|
7119
|
+
], BignumberFieldComponent.prototype, "onInput", void 0);
|
|
6782
7120
|
__decorate([
|
|
6783
7121
|
Output()
|
|
6784
|
-
],
|
|
7122
|
+
], BignumberFieldComponent.prototype, "onFocus", void 0);
|
|
6785
7123
|
__decorate([
|
|
6786
7124
|
Output()
|
|
6787
|
-
],
|
|
6788
|
-
|
|
7125
|
+
], BignumberFieldComponent.prototype, "onComplete", void 0);
|
|
7126
|
+
BignumberFieldComponent = __decorate([
|
|
6789
7127
|
Component({
|
|
6790
|
-
template: "<p-inputMask\n *ngIf=\"field.mask; else noMask\"\n type=\"text\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [mask]=\"isFunction(field.mask) ? field.mask() : field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"onFocus.next($event)\"\n (onComplete)=\"onComplete.next($event)\"\n (onInput)=\"onInput.next($event)\"\n [formControl]=\"formControl\"
|
|
7128
|
+
template: "<p-inputMask\n *ngIf=\"field.mask; else noMask\"\n type=\"text\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [mask]=\"isFunction(field.mask) ? field.mask() : field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"onFocus.next($event)\"\n (onComplete)=\"onComplete.next($event)\"\n (onInput)=\"onInput.next($event)\"\n [formControl]=\"formControl\"\n [autoClear]=\"field.autoClear\">\n</p-inputMask>\n\n<ng-template #noMask>\n <ng-container>\n <div class=\"ui-inputgroup\">\n <ng-container *ngIf=\"field.leftAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.leftAddon.label\">{{field.leftAddon.label}}</span>\n <span *ngIf=\"!field.leftAddon.label\" [ngClass]=\"field.leftAddon.icon\"></span>\n </span>\n </ng-container>\n\n <input\n [id]=\"(field.id || field.name)\"\n type=\"text\"\n [name]=\"field.name\"\n sBignumberInput\n [allowNegative]=\"field.allowNegative\"\n [precision]=\"isFunction(field.precision) ? trigger(field.precision) : field.precision\"\n [scale]=\"isFunction(field.scale) ? trigger(field.scale) : field.scale\"\n [decimalSeparator]=\"field.numberLocaleOptions.decimalSeparator\"\n [thousandsSeparator]=\"field.numberLocaleOptions.thousandsSeparator\"\n [alignTo]=\"field.alignTo\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n [formControl]=\"formControl\" />\n <ng-container *ngIf=\"field.rightAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.rightAddon.label\">{{field.rightAddon.label}}</span>\n <span *ngIf=\"!field.rightAddon.label\" [ngClass]=\"field.rightAddon.icon\"></span>\n </span>\n </ng-container>\n </div>\n </ng-container>\n</ng-template>\n",
|
|
6791
7129
|
encapsulation: ViewEncapsulation.None,
|
|
6792
7130
|
styles: ["s-number-field.ng-dirty.ng-invalid .ui-inputtext{border-color:#c13018}s-number-field.ng-dirty.ng-invalid .ui-inputtext:hover{border-color:#e44328}"]
|
|
6793
7131
|
})
|
|
6794
|
-
],
|
|
6795
|
-
return
|
|
7132
|
+
], BignumberFieldComponent);
|
|
7133
|
+
return BignumberFieldComponent;
|
|
6796
7134
|
}(BaseFieldComponent));
|
|
6797
7135
|
|
|
6798
|
-
var
|
|
6799
|
-
function
|
|
6800
|
-
this.onClick = new EventEmitter();
|
|
6801
|
-
this.onFocus = new EventEmitter();
|
|
6802
|
-
this.ngUnsubscribe = new Subject();
|
|
7136
|
+
var BooleanFieldComponent = /** @class */ (function () {
|
|
7137
|
+
function BooleanFieldComponent() {
|
|
6803
7138
|
}
|
|
6804
|
-
|
|
6805
|
-
var _this = this;
|
|
6806
|
-
this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
6807
|
-
if (_this.field.onFocus)
|
|
6808
|
-
_this.field.onFocus(event);
|
|
6809
|
-
});
|
|
6810
|
-
this.onClick.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
6811
|
-
if (_this.field.onClick)
|
|
6812
|
-
_this.field.onClick(event);
|
|
6813
|
-
});
|
|
6814
|
-
};
|
|
6815
|
-
RadioButtonComponent.prototype.ngOnDestroy = function () {
|
|
6816
|
-
this.ngUnsubscribe.next();
|
|
6817
|
-
this.ngUnsubscribe.complete();
|
|
6818
|
-
};
|
|
6819
|
-
RadioButtonComponent.prototype.onClear = function () {
|
|
7139
|
+
BooleanFieldComponent.prototype.onClear = function () {
|
|
6820
7140
|
this.formControl.reset();
|
|
6821
7141
|
};
|
|
6822
7142
|
__decorate([
|
|
6823
7143
|
Input()
|
|
6824
|
-
],
|
|
7144
|
+
], BooleanFieldComponent.prototype, "field", void 0);
|
|
6825
7145
|
__decorate([
|
|
6826
7146
|
Input()
|
|
6827
|
-
],
|
|
6828
|
-
__decorate([
|
|
6829
|
-
Output()
|
|
6830
|
-
], RadioButtonComponent.prototype, "onClick", void 0);
|
|
6831
|
-
__decorate([
|
|
6832
|
-
Output()
|
|
6833
|
-
], RadioButtonComponent.prototype, "onFocus", void 0);
|
|
6834
|
-
RadioButtonComponent = __decorate([
|
|
7147
|
+
], BooleanFieldComponent.prototype, "formControl", void 0);
|
|
7148
|
+
BooleanFieldComponent = __decorate([
|
|
6835
7149
|
Component({
|
|
6836
|
-
template: "<ng-container *ngIf=\"field.verticalAlignment;else horizontalAlignment\">\n <div class=\"ui-g\">\n <div\n
|
|
6837
|
-
encapsulation: ViewEncapsulation.None,
|
|
6838
|
-
styles: ["\n s-button.horizontal-clear-option button {\n width: min-content !important;\n }\n "]
|
|
7150
|
+
template: "<ng-container *ngIf=\"field.verticalAlignment;else horizontalAlignment\">\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"true\"\n [label]=\"field.optionsLabel.true\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-1'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n </div>\n <div class=\"ui-g-12\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"false\"\n [label]=\"field.optionsLabel.false\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-2'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n </div>\n <div\n *ngIf=\"!field.showClear && !field.required()\"\n class=\"ui-g-12\">\n <p-radioButton \n [name]=\"field.name\"\n [value]=\"null\"\n [label]=\"field.optionsLabel.empty\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-3'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton> \n </div>\n <div>\n <s-button\n *ngIf=\"field.showClear && !field.required() && !formControl.disabled\"\n [label]=\"field.optionsLabel.clear || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n </div>\n\n </div>\n</ng-container>\n\n<ng-template #horizontalAlignment>\n <div class=\"ui-g\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"true\"\n [label]=\"field.optionsLabel.true\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-1'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n \n <p-radioButton\n [name]=\"field.name\"\n [value]=\"false\"\n [label]=\"field.optionsLabel.false\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-2'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n\n <p-radioButton\n *ngIf=\"!field.showClear && !field.required()\"\n [name]=\"field.name\"\n [value]=\"null\"\n [label]=\"field.optionsLabel.empty\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-3'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n\n <s-button\n *ngIf=\"field.showClear && !field.required() && !formControl.disabled\"\n style=\"margin-left: 40px;\"\n [label]=\"field.optionsLabel.clear || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n </div>\n</ng-template>\n"
|
|
6839
7151
|
})
|
|
6840
|
-
],
|
|
6841
|
-
return
|
|
7152
|
+
], BooleanFieldComponent);
|
|
7153
|
+
return BooleanFieldComponent;
|
|
6842
7154
|
}());
|
|
6843
7155
|
|
|
6844
|
-
var
|
|
6845
|
-
|
|
6846
|
-
function SelectFieldComponent() {
|
|
6847
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
6848
|
-
}
|
|
6849
|
-
__decorate([
|
|
6850
|
-
Input()
|
|
6851
|
-
], SelectFieldComponent.prototype, "field", void 0);
|
|
6852
|
-
__decorate([
|
|
6853
|
-
Input()
|
|
6854
|
-
], SelectFieldComponent.prototype, "formControl", void 0);
|
|
6855
|
-
SelectFieldComponent = __decorate([
|
|
6856
|
-
Component({
|
|
6857
|
-
template: "<p-dropdown\n *ngIf=\"!field.multiple\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [placeholder]=\"field.placeholder || ' '\"\n [formControl]=\"formControl\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [showClear]=\"field.showClear\"\n dataKey=\"{{field.dataKey}}\"\n optionLabel=\"{{field.optionLabel}}\"\n [autoDisplayFirst]=\"field.autoDisplayFirst\"\n [appendTo]=\"field.appendTo || 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\">\n</p-dropdown>\n<p-multiSelect\n *ngIf=\"field.multiple\"\n [formControl]=\"formControl\"\n [name]=\"field.name\"\n [inputId]=\"(field.id || field.name)\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [defaultLabel]=\"field.placeholder\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [emptyFilterMessage]=\"field.emptyMessage || 'Nenhum registro encontrado'\"\n [showDelay]=\"500\"\n [selectedItemsLabel]=\"field.multipleSelectedLabel\"\n [appendTo]=\"field.appendTo || 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\">\n</p-multiSelect>\n\n"
|
|
6858
|
-
})
|
|
6859
|
-
], SelectFieldComponent);
|
|
6860
|
-
return SelectFieldComponent;
|
|
6861
|
-
}(BaseFieldComponent));
|
|
6862
|
-
|
|
6863
|
-
var TextAreaFieldComponent = /** @class */ (function () {
|
|
6864
|
-
function TextAreaFieldComponent() {
|
|
7156
|
+
var BooleanSwitchFieldComponent = /** @class */ (function () {
|
|
7157
|
+
function BooleanSwitchFieldComponent() {
|
|
6865
7158
|
}
|
|
6866
7159
|
__decorate([
|
|
6867
7160
|
Input()
|
|
6868
|
-
],
|
|
7161
|
+
], BooleanSwitchFieldComponent.prototype, "field", void 0);
|
|
6869
7162
|
__decorate([
|
|
6870
7163
|
Input()
|
|
6871
|
-
],
|
|
6872
|
-
|
|
7164
|
+
], BooleanSwitchFieldComponent.prototype, "formControl", void 0);
|
|
7165
|
+
BooleanSwitchFieldComponent = __decorate([
|
|
6873
7166
|
Component({
|
|
6874
|
-
template: "<
|
|
6875
|
-
})
|
|
6876
|
-
],
|
|
6877
|
-
return
|
|
6878
|
-
}());
|
|
6879
|
-
|
|
6880
|
-
var
|
|
6881
|
-
function
|
|
6882
|
-
|
|
6883
|
-
this._messageService = _messageService;
|
|
6884
|
-
}
|
|
6885
|
-
IAssistService.prototype.askIA = function (context, data) {
|
|
6886
|
-
var _this = this;
|
|
6887
|
-
return this.http.post("platform/iassist/api/latest/completions", {
|
|
6888
|
-
"prompt": this._createPrompt(context, data),
|
|
6889
|
-
"provider": "OPEN_AI",
|
|
6890
|
-
"parameters": {
|
|
6891
|
-
"model": "gpt-3.5-turbo",
|
|
6892
|
-
"max_tokens": 700,
|
|
6893
|
-
"temperature": 1
|
|
6894
|
-
}
|
|
6895
|
-
}).pipe(catchError(function (err) {
|
|
6896
|
-
_this._messageService.add({
|
|
6897
|
-
severity: "error",
|
|
6898
|
-
summary: err.status ? String(err.status) : "Error",
|
|
6899
|
-
detail: (err.error && err.error.message) || err.statusText || err.message || "Error",
|
|
6900
|
-
});
|
|
6901
|
-
return throwError(err);
|
|
6902
|
-
}));
|
|
6903
|
-
};
|
|
6904
|
-
IAssistService.prototype._createPrompt = function (context, data) {
|
|
6905
|
-
return "Crie um texto gen\u00E9rico para preencher o campo de textarea.\n " + (data.label ? "O campo tem o label " + data.label + "." : "") + "\n " + (data.id ? "O campo tem o id " + data.id + "." : "") + "\n " + (data.placeholder ? "Considere as instru\u00E7\u00F5es/sugest\u00F5es do placeholder: " + data.placeholder + "." : "") + "\n Baseie-se no contexto informado pelo usu\u00E1rio: '" + context + "'.\n O texto deve ser formal e conter informa\u00E7\u00F5es pertinentes a um campo como este, como se um usu\u00E1rio real tivesse preenchido com as informa\u00E7\u00F5es necess\u00E1rias. \n O texto deve ser neutro com rela\u00E7\u00E3o a generos, ra\u00E7as, religi\u00F5es, etc.\n O texto deve ser impessoal e n\u00E3o deve conter informa\u00E7\u00F5es pessoais do usu\u00E1rio.\n N\u00E3o direcione o texto a ningu\u00E9m, n\u00E3o use express\u00F5es como: caro, atenciosamente. gostaria, agrade\u00E7o. O texto deve ser gen\u00E9rico.\n \n Exemplos de texto:\n Um campo de descri\u00E7\u00E3o de usu\u00E1rio: \"Usu\u00E1rio com 20 anos, estudante de engenharia, gosta de jogar futebol e assistir filmes.\"\n Outro exemplo de descri\u00E7\u00E3o de usu\u00E1rio: \"Usu\u00E1rio administrador, com acesso total ao sistema, respons\u00E1vel por gerenciar os usu\u00E1rios e os produtos.\"\n Um campo de descri\u00E7\u00E3o de um produto: \"O produto \u00E9 um celular, com tela de 6 polegadas, 128GB de armazenamento, 4GB de mem\u00F3ria RAM, c\u00E2mera de 12MP e bateria de 4000mAh.\"\n Outro exemplo de descri\u00E7\u00E3o de produto: \"O produto \u00E9 uma geladeira, com capacidade de 500 litros, 2 portas, cor branca, com freezer e gaveta de legumes.\"\n Outro exemplo de descri\u00E7\u00E3o de produto: \"O produto \u00E9 uma camiseta, tamanho M, cor azul, 100% algod\u00E3o, com estampa de um gato.\"\n \n Em caso de contexto incompleto crie um texto gen\u00E9rico, como se fosse um exemplo de preenchimento do campo.\n O texto \u00E9 para um campo de textarea, ent\u00E3o escreva um texto sucinto.\n Exiba apenas o texto do output";
|
|
6906
|
-
};
|
|
6907
|
-
IAssistService.ctorParameters = function () { return [
|
|
6908
|
-
{ type: HttpClient },
|
|
6909
|
-
{ type: MessageService }
|
|
6910
|
-
]; };
|
|
6911
|
-
IAssistService = __decorate([
|
|
6912
|
-
Injectable()
|
|
6913
|
-
], IAssistService);
|
|
6914
|
-
return IAssistService;
|
|
6915
|
-
}());
|
|
6916
|
-
|
|
6917
|
-
var TextAreaIAFieldComponent = /** @class */ (function () {
|
|
6918
|
-
function TextAreaIAFieldComponent(_iassistService, _formBuilder, _translateService) {
|
|
6919
|
-
this._iassistService = _iassistService;
|
|
6920
|
-
this._formBuilder = _formBuilder;
|
|
6921
|
-
this._translateService = _translateService;
|
|
6922
|
-
this.isVisible = false;
|
|
6923
|
-
this.isLoading = false;
|
|
6924
|
-
}
|
|
6925
|
-
TextAreaIAFieldComponent.prototype.ngOnInit = function () {
|
|
6926
|
-
this._createDialogFields();
|
|
6927
|
-
this._createDialogFormGroup();
|
|
6928
|
-
};
|
|
6929
|
-
TextAreaIAFieldComponent.prototype.showDialog = function () {
|
|
6930
|
-
this.isVisible = true;
|
|
6931
|
-
};
|
|
6932
|
-
TextAreaIAFieldComponent.prototype.onHideDialog = function () {
|
|
6933
|
-
this.formGroup.get("context").setValue("");
|
|
6934
|
-
};
|
|
6935
|
-
TextAreaIAFieldComponent.prototype.hideDialog = function () {
|
|
6936
|
-
this.isVisible = false;
|
|
6937
|
-
};
|
|
6938
|
-
TextAreaIAFieldComponent.prototype.submitContext = function () {
|
|
6939
|
-
var _this = this;
|
|
6940
|
-
var context = this.formGroup.get("context");
|
|
6941
|
-
this.isLoading = true;
|
|
6942
|
-
this._iassistService.askIA(context.value, {
|
|
6943
|
-
id: this.field.id,
|
|
6944
|
-
label: this.field.label,
|
|
6945
|
-
placeholder: this.field.placeholder,
|
|
6946
|
-
})
|
|
6947
|
-
.pipe(catchError(function (err) {
|
|
6948
|
-
_this.isLoading = false;
|
|
6949
|
-
return throwError(err);
|
|
6950
|
-
}))
|
|
6951
|
-
.subscribe(function (res) {
|
|
6952
|
-
_this.formControl.setValue(res.text);
|
|
6953
|
-
_this.isLoading = false;
|
|
6954
|
-
});
|
|
6955
|
-
this.hideDialog();
|
|
6956
|
-
};
|
|
6957
|
-
TextAreaIAFieldComponent.prototype._createDialogFields = function () {
|
|
6958
|
-
this.fields = [
|
|
6959
|
-
new FormField({
|
|
6960
|
-
name: "context",
|
|
6961
|
-
type: FieldType.String,
|
|
6962
|
-
label: this._translateService.instant("platform.angular_components.context"),
|
|
6963
|
-
size: { sm: 12, md: 12, lg: 12, xl: 12 },
|
|
6964
|
-
}),
|
|
6965
|
-
];
|
|
6966
|
-
};
|
|
6967
|
-
TextAreaIAFieldComponent.prototype._createDialogFormGroup = function () {
|
|
6968
|
-
this.formGroup = this._formBuilder.group({
|
|
6969
|
-
context: [""],
|
|
6970
|
-
});
|
|
6971
|
-
};
|
|
6972
|
-
TextAreaIAFieldComponent.ctorParameters = function () { return [
|
|
6973
|
-
{ type: IAssistService },
|
|
6974
|
-
{ type: FormBuilder },
|
|
6975
|
-
{ type: TranslateService }
|
|
6976
|
-
]; };
|
|
7167
|
+
template: "<div class=\"ui-grid ui-grid-responsive ui-grid-pad ui-fluid\">\n <div class=\"ui-grid-row\">\n <div class=\"i-grid-col-1\">\n <s-switch\n [id]=\"(field.id || field.name)\"\n [inputName]=\"field.name\"\n [formControl]=\"formControl\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n (valueChanged)=\"field.onChange ? field.onChange($event) : null\">\n </s-switch>\n </div>\n <div class=\"i-grid-col-1\" *ngIf=\"field.optionsLabel\">\n <ng-container *ngIf=\"formControl.value; else caseFalse\">\n <span>{{ field.optionsLabel.true }}</span>\n </ng-container>\n <ng-template #caseFalse>\n <span>{{ field.optionsLabel.false }}</span>\n </ng-template>\n </div>\n </div>\n</div>"
|
|
7168
|
+
})
|
|
7169
|
+
], BooleanSwitchFieldComponent);
|
|
7170
|
+
return BooleanSwitchFieldComponent;
|
|
7171
|
+
}());
|
|
7172
|
+
|
|
7173
|
+
var CalendarFieldComponent = /** @class */ (function () {
|
|
7174
|
+
function CalendarFieldComponent() {
|
|
7175
|
+
}
|
|
6977
7176
|
__decorate([
|
|
6978
7177
|
Input()
|
|
6979
|
-
],
|
|
7178
|
+
], CalendarFieldComponent.prototype, "field", void 0);
|
|
6980
7179
|
__decorate([
|
|
6981
7180
|
Input()
|
|
6982
|
-
],
|
|
6983
|
-
|
|
7181
|
+
], CalendarFieldComponent.prototype, "formControl", void 0);
|
|
7182
|
+
__decorate([
|
|
7183
|
+
Input()
|
|
7184
|
+
], CalendarFieldComponent.prototype, "showTime", void 0);
|
|
7185
|
+
__decorate([
|
|
7186
|
+
Input()
|
|
7187
|
+
], CalendarFieldComponent.prototype, "timeOnly", void 0);
|
|
7188
|
+
CalendarFieldComponent = __decorate([
|
|
6984
7189
|
Component({
|
|
6985
|
-
template: "<
|
|
6986
|
-
styles: [".footer-content{display:-ms-flexbox;display:flex;-ms-flex-positive:0;flex-grow:0}.textarea-ia{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;gap:8px}.iassist-button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border:none;border-radius:50%;box-shadow:none;cursor:pointer;height:32px;width:32px}.dialog-header{display:-ms-flexbox;display:flex;gap:12px}.dialog-header .iassist-icon{display:block;height:24px;width:24px}"]
|
|
7190
|
+
template: "<div\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\">\n <!-- Remover as propriedades [showTransitionOptions] e [hideTransitionOptions] quando atualizar para o PrimeNG v10, esses atributos foram\n usados para remover um bug ocasionado pela anima\u00E7\u00E3o do componente p-calendar, bug explicado nas issues: #ERPROM-5534, #ERPROM-8248 e #DSN-1045. -->\n <p-calendar\n #calendar\n sCalendarMask\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [showIcon]=\"true\"\n [timeOnly]=\"timeOnly\"\n [selectionMode]=\"field.selectionMode\"\n [rangeSeparator]=\"field.rangeSeparator\"\n [showTime]=\"showTime\"\n [showSeconds]=\"field.showSeconds\"\n [showOnFocus]=\"field.showOnFocus\"\n [formControl]=\"formControl\"\n [icon]=\"timeOnly ? 'fa fa-clock' : 'fa fa-calendar'\"\n [minDate]=\"field.minDate\"\n [maxDate]=\"field.maxDate\"\n [defaultDate]=\"field.defaultDate\"\n [locale]=\"field.calendarLocaleOptions\"\n [dateFormat]=\"field.calendarLocaleOptions.dateFormat\"\n [hourFormat]=\"field.calendarLocaleOptions.hourFormat\"\n [view]=\"field.view\"\n [placeholder]=\"field.placeholder\"\n inputStyleClass=\"mousetrap\"\n [appendTo]=\"field.appendTo\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event): null\"\n (onSelect)=\"field.onSelect ? field.onSelect($event) : null\"\n (onClose)=\"field.onClose ? field.onClose($event) : null\"\n (onTodayClick)=\"field.onTodayClick ? field.onTodayClick($event) : null\"\n (onClearClick)=\"field.onClearClick ? field.onClearClick($event) : null\"\n (onMonthChange)=\"field.onMonthChange ? field.onMonthChange($event) : null\"\n (onYearChange)=\"field.onYearChange ? field.onYearChange($event) : null\"\n [showTransitionOptions]=\"'0ms'\"\n [hideTransitionOptions]=\"'0ms'\">\n </p-calendar>\n</div>\n"
|
|
6987
7191
|
})
|
|
6988
|
-
],
|
|
6989
|
-
return
|
|
7192
|
+
], CalendarFieldComponent);
|
|
7193
|
+
return CalendarFieldComponent;
|
|
6990
7194
|
}());
|
|
6991
7195
|
|
|
6992
|
-
var
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
_this.onFocus = new EventEmitter();
|
|
6998
|
-
_this.onComplete = new EventEmitter();
|
|
6999
|
-
_this.ngUnsubscribe = new Subject();
|
|
7000
|
-
return _this;
|
|
7196
|
+
var ChipsFieldComponent = /** @class */ (function () {
|
|
7197
|
+
function ChipsFieldComponent(clipboard) {
|
|
7198
|
+
this.clipboard = clipboard;
|
|
7199
|
+
this.feedbackMessageVisible = false;
|
|
7200
|
+
this.copyButtonVisible = true;
|
|
7001
7201
|
}
|
|
7002
|
-
|
|
7202
|
+
ChipsFieldComponent.prototype.onCopyFieldContent = function () {
|
|
7003
7203
|
var _this = this;
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
if (
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
TextFieldComponent.prototype.ngOnDestroy = function () {
|
|
7018
|
-
this.ngUnsubscribe.next();
|
|
7019
|
-
this.ngUnsubscribe.complete();
|
|
7204
|
+
if (this.formControl.value) {
|
|
7205
|
+
this.copyButtonVisible = false;
|
|
7206
|
+
this.feedbackMessageVisible = true;
|
|
7207
|
+
setTimeout(function () {
|
|
7208
|
+
_this.feedbackMessageVisible = false;
|
|
7209
|
+
_this.copyButtonVisible = true;
|
|
7210
|
+
}, 3000);
|
|
7211
|
+
var content = this.formControl.value.join(this.field.separator || "\n");
|
|
7212
|
+
this.clipboard.copy(content);
|
|
7213
|
+
if (this.field.onCopy) {
|
|
7214
|
+
this.field.onCopy(content);
|
|
7215
|
+
}
|
|
7216
|
+
}
|
|
7020
7217
|
};
|
|
7218
|
+
ChipsFieldComponent.ctorParameters = function () { return [
|
|
7219
|
+
{ type: Clipboard }
|
|
7220
|
+
]; };
|
|
7021
7221
|
__decorate([
|
|
7022
7222
|
Input()
|
|
7023
|
-
],
|
|
7223
|
+
], ChipsFieldComponent.prototype, "field", void 0);
|
|
7024
7224
|
__decorate([
|
|
7025
7225
|
Input()
|
|
7026
|
-
],
|
|
7027
|
-
__decorate([
|
|
7028
|
-
Output()
|
|
7029
|
-
], TextFieldComponent.prototype, "onInput", void 0);
|
|
7030
|
-
__decorate([
|
|
7031
|
-
Output()
|
|
7032
|
-
], TextFieldComponent.prototype, "onFocus", void 0);
|
|
7033
|
-
__decorate([
|
|
7034
|
-
Output()
|
|
7035
|
-
], TextFieldComponent.prototype, "onComplete", void 0);
|
|
7036
|
-
TextFieldComponent = __decorate([
|
|
7226
|
+
], ChipsFieldComponent.prototype, "formControl", void 0);
|
|
7227
|
+
ChipsFieldComponent = __decorate([
|
|
7037
7228
|
Component({
|
|
7038
|
-
template: "<
|
|
7039
|
-
|
|
7040
|
-
styles: ["s-text-field.ng-dirty.ng-invalid .ui-inputtext{border-color:#c13018}s-text-field.ng-dirty.ng-invalid .ui-inputtext:hover{border-color:#e44328}"]
|
|
7229
|
+
template: "<div class=\"chips-field-wrapper\">\n <div style=\"width: 100%;\">\n <p-chips\n *ngIf=\"field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [pKeyFilter]=\"field.keyFilter\">\n <ng-template let-item pTemplate=\"item\">\n <span\n class=\"chip-content\"\n [sTooltip]=\"item\">\n {{ item }}\n </span>\n </ng-template>\n </p-chips>\n \n <p-chips\n *ngIf=\"!field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n <ng-template let-item pTemplate=\"item\">\n <span\n class=\"chip-content\"\n [sTooltip]=\"item\">\n {{ item }}\n </span>\n </ng-template>\n </p-chips>\n </div>\n \n <button\n *ngIf=\"field.showCopyButton && formControl.value?.length > 0 && copyButtonVisible\"\n class=\"copy-content-button\"\n (click)=\"onCopyFieldContent()\">\n {{ \"platform.angular_components.copy_field_content\" | translate }}\n </button>\n \n <span\n *ngIf=\"feedbackMessageVisible\"\n class=\"feedback-message\">\n {{ \"platform.angular_components.copied_to_clipboard\" | translate }}\n </span>\n</div>\n",
|
|
7230
|
+
styles: [".chips-field-wrapper{-ms-flex-align:start;align-items:flex-start;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.chips-field-wrapper .chip-content{display:block;overflow:hidden;padding-right:1rem;text-overflow:ellipsis}.chips-field-wrapper .copy-content-button{background-color:transparent;border:none;color:#2a6496;cursor:pointer;margin-top:8px}.chips-field-wrapper .feedback-message{color:#0c9348;display:block;margin-top:8px;-webkit-user-select:none;-ms-user-select:none;user-select:none}"]
|
|
7041
7231
|
})
|
|
7042
|
-
],
|
|
7043
|
-
return
|
|
7044
|
-
}(
|
|
7232
|
+
], ChipsFieldComponent);
|
|
7233
|
+
return ChipsFieldComponent;
|
|
7234
|
+
}());
|
|
7045
7235
|
|
|
7046
|
-
var
|
|
7047
|
-
function
|
|
7236
|
+
var CountryPhonePickerFieldComponent = /** @class */ (function () {
|
|
7237
|
+
function CountryPhonePickerFieldComponent() {
|
|
7048
7238
|
}
|
|
7049
|
-
RowComponent.prototype.ngOnInit = function () { };
|
|
7050
|
-
RowComponent.prototype.getErrorMessages = function (errorMessages) {
|
|
7051
|
-
if (errorMessages)
|
|
7052
|
-
return this.isFunction(errorMessages) ? errorMessages() : errorMessages;
|
|
7053
|
-
return this.errorMessages;
|
|
7054
|
-
};
|
|
7055
|
-
RowComponent.prototype.isFunction = function (value) {
|
|
7056
|
-
return value instanceof Function;
|
|
7057
|
-
};
|
|
7058
7239
|
__decorate([
|
|
7059
7240
|
Input()
|
|
7060
|
-
],
|
|
7241
|
+
], CountryPhonePickerFieldComponent.prototype, "field", void 0);
|
|
7061
7242
|
__decorate([
|
|
7062
7243
|
Input()
|
|
7063
|
-
],
|
|
7244
|
+
], CountryPhonePickerFieldComponent.prototype, "formControl", void 0);
|
|
7245
|
+
CountryPhonePickerFieldComponent = __decorate([
|
|
7246
|
+
Component({
|
|
7247
|
+
template: "<s-country-phone-picker\n [formControl]=\"formControl\"\n [ordination]=\"field.ordination\"\n [countries]=\"field.countries\"\n (selected)=\"field.onSelected\"\n (focusLost)=\"field.onFocusLost\">\n</s-country-phone-picker>"
|
|
7248
|
+
})
|
|
7249
|
+
], CountryPhonePickerFieldComponent);
|
|
7250
|
+
return CountryPhonePickerFieldComponent;
|
|
7251
|
+
}());
|
|
7252
|
+
|
|
7253
|
+
/**
|
|
7254
|
+
* @deprecated Should use bignumber instead
|
|
7255
|
+
*/
|
|
7256
|
+
var CurrencyFieldComponent = /** @class */ (function (_super) {
|
|
7257
|
+
__extends(CurrencyFieldComponent, _super);
|
|
7258
|
+
function CurrencyFieldComponent() {
|
|
7259
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
7260
|
+
}
|
|
7064
7261
|
__decorate([
|
|
7065
7262
|
Input()
|
|
7066
|
-
],
|
|
7263
|
+
], CurrencyFieldComponent.prototype, "field", void 0);
|
|
7067
7264
|
__decorate([
|
|
7068
7265
|
Input()
|
|
7069
|
-
],
|
|
7070
|
-
|
|
7266
|
+
], CurrencyFieldComponent.prototype, "formControl", void 0);
|
|
7267
|
+
CurrencyFieldComponent = __decorate([
|
|
7071
7268
|
Component({
|
|
7072
|
-
template: "
|
|
7269
|
+
template: "<div class=\"ui-inputgroup\">\n <span\n *ngIf=\"field.numberLocaleOptions.currencySymbol\"\n class=\"ui-inputgroup-addon\">\n {{ field.numberLocaleOptions.currencySymbol }}\n </span>\n <input\n *ngIf=\"!field.mask\"\n type=\"text\"\n [id]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [formControl]=\"formControl\"\n sNumberInput\n [precision]=\"isFunction(field.precision) ? trigger(field.precision) : field.precision\"\n [scale]=\"isFunction(field.scale) ? trigger(field.scale) : field.scale\"\n [decimalSeparator]=\"field.numberLocaleOptions.decimalSeparator\"\n [thousandsSeparator]=\"field.numberLocaleOptions.thousandsSeparator\"\n [alignTo]=\"field.alignTo\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"field.onFocus ? field.onFocus($event): null\" />\n <p-inputMask\n *ngIf=\"field.mask\"\n type=\"text\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [formControl]=\"formControl\"\n [mask]=\"field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event): null\"\n (onComplete)=\"field.onComplete ? field.onComplete($event) : null\"\n (onInput)=\"field.onInput ? field.onInput($event) : null\" >\n </p-inputMask>\n</div>\n"
|
|
7073
7270
|
})
|
|
7074
|
-
],
|
|
7075
|
-
return
|
|
7076
|
-
}());
|
|
7271
|
+
], CurrencyFieldComponent);
|
|
7272
|
+
return CurrencyFieldComponent;
|
|
7273
|
+
}(BaseFieldComponent));
|
|
7077
7274
|
|
|
7078
7275
|
var FieldsetComponent = /** @class */ (function () {
|
|
7079
7276
|
function FieldsetComponent() {
|
|
@@ -7099,79 +7296,45 @@ var FieldsetComponent = /** @class */ (function () {
|
|
|
7099
7296
|
return FieldsetComponent;
|
|
7100
7297
|
}());
|
|
7101
7298
|
|
|
7102
|
-
var
|
|
7103
|
-
|
|
7299
|
+
var FileUploadComponent$1 = /** @class */ (function (_super) {
|
|
7300
|
+
__extends(FileUploadComponent, _super);
|
|
7301
|
+
function FileUploadComponent() {
|
|
7302
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
7104
7303
|
}
|
|
7105
7304
|
__decorate([
|
|
7106
7305
|
Input()
|
|
7107
|
-
],
|
|
7108
|
-
__decorate([
|
|
7109
|
-
Input()
|
|
7110
|
-
], SectionComponent.prototype, "config", void 0);
|
|
7111
|
-
__decorate([
|
|
7112
|
-
Input()
|
|
7113
|
-
], SectionComponent.prototype, "group", void 0);
|
|
7306
|
+
], FileUploadComponent.prototype, "field", void 0);
|
|
7114
7307
|
__decorate([
|
|
7115
7308
|
Input()
|
|
7116
|
-
],
|
|
7117
|
-
|
|
7309
|
+
], FileUploadComponent.prototype, "formControl", void 0);
|
|
7310
|
+
FileUploadComponent = __decorate([
|
|
7118
7311
|
Component({
|
|
7119
|
-
template: "
|
|
7312
|
+
template: "<s-file-upload [id]=\"(field.id || field.name)\" [accept]=\"field.accept\" [files]=\"field.files\" [multiple]=\"field.multiple\"\n [chooseLabel]=\"field.chooseLabel\" [removeLabel]=\"field.removeLabel\" [cancelLabel]=\"field.cancelLabel\"\n [successTooltip]=\"field.successTooltip\" (uploadHandler)=\"field.onUploadFile($event, field)\"\n (removeFile)=\"field.onRemoveFile($event, field)\" (cancelUpload)=\"field.onCancelUpload($event, field)\"\n (downloadFile)=\"field.onDownloadFile($event, field)\" [formGroup]=\"formControl\"\n [showFileUploadDate]=\"field.showFileUploadDate\"> \n</s-file-upload>\n"
|
|
7120
7313
|
})
|
|
7121
|
-
],
|
|
7122
|
-
return
|
|
7123
|
-
}());
|
|
7314
|
+
], FileUploadComponent);
|
|
7315
|
+
return FileUploadComponent;
|
|
7316
|
+
}(BaseFieldComponent));
|
|
7124
7317
|
|
|
7125
|
-
var
|
|
7126
|
-
function
|
|
7318
|
+
var LookupFieldComponent = /** @class */ (function () {
|
|
7319
|
+
function LookupFieldComponent() {
|
|
7127
7320
|
}
|
|
7128
|
-
DynamicFieldComponent.prototype.getErrorMessages = function (errorMessages) {
|
|
7129
|
-
if (errorMessages)
|
|
7130
|
-
return this.isFunction(errorMessages)
|
|
7131
|
-
? __assign(__assign({}, this.errorMessages), errorMessages()) : __assign(__assign({}, this.errorMessages), errorMessages);
|
|
7132
|
-
return this.errorMessages;
|
|
7133
|
-
};
|
|
7134
|
-
DynamicFieldComponent.prototype.isFunction = function (value) {
|
|
7135
|
-
return value instanceof Function;
|
|
7136
|
-
};
|
|
7137
|
-
__decorate([
|
|
7138
|
-
Input()
|
|
7139
|
-
], DynamicFieldComponent.prototype, "id", void 0);
|
|
7140
|
-
__decorate([
|
|
7141
|
-
Input()
|
|
7142
|
-
], DynamicFieldComponent.prototype, "fields", void 0);
|
|
7143
|
-
__decorate([
|
|
7144
|
-
Input()
|
|
7145
|
-
], DynamicFieldComponent.prototype, "form", void 0);
|
|
7146
7321
|
__decorate([
|
|
7147
7322
|
Input()
|
|
7148
|
-
],
|
|
7323
|
+
], LookupFieldComponent.prototype, "field", void 0);
|
|
7149
7324
|
__decorate([
|
|
7150
7325
|
Input()
|
|
7151
|
-
],
|
|
7152
|
-
|
|
7326
|
+
], LookupFieldComponent.prototype, "formControl", void 0);
|
|
7327
|
+
LookupFieldComponent = __decorate([
|
|
7153
7328
|
Component({
|
|
7154
|
-
|
|
7155
|
-
template: "<div class=\"ui-fluid\" [formGroup]=\"form\">\n <div class=\"ui-g\">\n <ng-container *ngFor=\"let field of fields\">\n <div\n *ngIf=\"!field.visible || field.visible()\"\n [ngClass]=\"field.gridClass\">\n <span *ngIf=\"field.label\">\n <label\n *sInfoSign=\"field.infoSign; displayTime: displayTimeInfoSign\"\n [for]=\"field.name\"\n [ngClass]=\"{ 'required': field.required() }\">\n {{ field.label }}\n </label>\n </span>\n <ng-container *sDynamicForm=\"{\n id: id,\n config: field,\n group: form\n }\">\n </ng-container>\n <s-control-errors\n [form]=\"form\"\n [control]=\"form.controls[field.name]\"\n [errorMessages]=\"getErrorMessages(field.errorMessages)\">\n </s-control-errors>\n <ng-template\n *ngIf=\"field?.bottomTemplate\"\n [ngTemplateOutlet]=\"field.bottomTemplate\">\n </ng-template>\n </div>\n </ng-container>\n </div>\n</div>"
|
|
7329
|
+
template: "<div\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\">\n <s-lookup\n [id]=\"(field.id || field.name)\"\n [multiple]=\"field.multiple\"\n [formControl]=\"formControl\"\n [lookupSuggestions]=\"field.lookupSuggestions\"\n [dataKey]=\"field.dataKey\"\n [placeholder]=\"field.placeholder\"\n [searchFields]=\"field.searchFields\"\n [searchGridFields]=\"field.searchGridFields\"\n [searchGridData]=\"field.gridData\"\n (onLookupRequest)=\"field.onLookupRequest($event)\"\n (onSearchRequest)=\"field.onSearchRequest($event)\"\n [lookupDisplayField]=\"field.lookupDisplayField\"\n [searchTotalRecords]=\"field.searchTotalRecords\"\n [searchTotalRecordsLabel]=\"field.searchTotalRecordsLabel\"\n [searchTitle]=\"field.searchTitle\"\n [selectLabel]=\"field.selectLabel\"\n [searchEmptyTitle]=\"field.searchEmptyTitle\"\n [filterLabel]=\"field.filterLabel\"\n [filterTitle]=\"field.filterTitle\"\n [clearLabel]=\"field.clearLabel\"\n [cancelLabel]=\"field.cancelLabel\"\n [emptyFieldLabel]=\"field.emptyFieldLabel \"\n (onSelect)=\"field.onSelect($event)\"\n (onUnselect)=\"field.onUnselect($event)\"\n (onClear)=\"field.onClear ? field.onClear($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [lookupAppendTo]=\"field.appendTo\"\n [lookupEmptyMessage]=\"field.emptyMessage\"\n [recordLabel]=\"field.recordLabel\"\n [recordsLabel]=\"field.recordsLabel\"\n [defaultFilter]=\"field.defaultFilter\"\n [autocompleteForceSelection]=\"field.autocompleteForceSelection\">\n </s-lookup>\n</div>\n"
|
|
7156
7330
|
})
|
|
7157
|
-
],
|
|
7158
|
-
return
|
|
7331
|
+
], LookupFieldComponent);
|
|
7332
|
+
return LookupFieldComponent;
|
|
7159
7333
|
}());
|
|
7160
7334
|
|
|
7161
|
-
var
|
|
7162
|
-
(
|
|
7163
|
-
|
|
7164
|
-
})(GridType || (GridType = {}));
|
|
7165
|
-
|
|
7166
|
-
var StructureType;
|
|
7167
|
-
(function (StructureType) {
|
|
7168
|
-
StructureType["Fieldset"] = "Fieldset";
|
|
7169
|
-
StructureType["Section"] = "Section";
|
|
7170
|
-
})(StructureType || (StructureType = {}));
|
|
7171
|
-
|
|
7172
|
-
var BignumberFieldComponent = /** @class */ (function (_super) {
|
|
7173
|
-
__extends(BignumberFieldComponent, _super);
|
|
7174
|
-
function BignumberFieldComponent() {
|
|
7335
|
+
var NumberFieldComponent = /** @class */ (function (_super) {
|
|
7336
|
+
__extends(NumberFieldComponent, _super);
|
|
7337
|
+
function NumberFieldComponent() {
|
|
7175
7338
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
7176
7339
|
_this.onInput = new EventEmitter();
|
|
7177
7340
|
_this.onFocus = new EventEmitter();
|
|
@@ -7179,35 +7342,33 @@ var BignumberFieldComponent = /** @class */ (function (_super) {
|
|
|
7179
7342
|
_this.ngUnsubscribe = new Subject();
|
|
7180
7343
|
return _this;
|
|
7181
7344
|
}
|
|
7182
|
-
|
|
7345
|
+
NumberFieldComponent.prototype.ngOnInit = function () {
|
|
7183
7346
|
var _this = this;
|
|
7184
|
-
this.onFocus
|
|
7185
|
-
|
|
7186
|
-
.subscribe(function (event) {
|
|
7187
|
-
if (_this.field.onFocus) {
|
|
7347
|
+
this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
7348
|
+
if (_this.field.onFocus)
|
|
7188
7349
|
_this.field.onFocus(event);
|
|
7189
|
-
}
|
|
7190
7350
|
});
|
|
7191
|
-
this.onInput
|
|
7192
|
-
|
|
7193
|
-
.subscribe(function (event) {
|
|
7194
|
-
if (_this.field.onInput) {
|
|
7351
|
+
this.onInput.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
7352
|
+
if (_this.field.onInput)
|
|
7195
7353
|
_this.field.onInput(event);
|
|
7196
|
-
}
|
|
7197
7354
|
});
|
|
7198
|
-
this.onComplete
|
|
7199
|
-
|
|
7200
|
-
.subscribe(function (event) {
|
|
7201
|
-
if (_this.field.onComplete) {
|
|
7355
|
+
this.onComplete.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
7356
|
+
if (_this.field.onComplete)
|
|
7202
7357
|
_this.field.onComplete(event);
|
|
7203
|
-
}
|
|
7204
7358
|
});
|
|
7205
7359
|
};
|
|
7206
|
-
|
|
7360
|
+
NumberFieldComponent.prototype.ngOnDestroy = function () {
|
|
7207
7361
|
this.ngUnsubscribe.next();
|
|
7208
7362
|
this.ngUnsubscribe.complete();
|
|
7209
7363
|
};
|
|
7210
|
-
Object.defineProperty(
|
|
7364
|
+
Object.defineProperty(NumberFieldComponent.prototype, "numberAlignmentOption", {
|
|
7365
|
+
get: function () {
|
|
7366
|
+
return NumberAlignmentOption;
|
|
7367
|
+
},
|
|
7368
|
+
enumerable: true,
|
|
7369
|
+
configurable: true
|
|
7370
|
+
});
|
|
7371
|
+
Object.defineProperty(NumberFieldComponent.prototype, "fieldType", {
|
|
7211
7372
|
get: function () {
|
|
7212
7373
|
return FieldType;
|
|
7213
7374
|
},
|
|
@@ -7216,46 +7377,29 @@ var BignumberFieldComponent = /** @class */ (function (_super) {
|
|
|
7216
7377
|
});
|
|
7217
7378
|
__decorate([
|
|
7218
7379
|
Input()
|
|
7219
|
-
],
|
|
7380
|
+
], NumberFieldComponent.prototype, "field", void 0);
|
|
7220
7381
|
__decorate([
|
|
7221
7382
|
Input()
|
|
7222
|
-
],
|
|
7383
|
+
], NumberFieldComponent.prototype, "formControl", void 0);
|
|
7223
7384
|
__decorate([
|
|
7224
7385
|
Output()
|
|
7225
|
-
],
|
|
7386
|
+
], NumberFieldComponent.prototype, "onInput", void 0);
|
|
7226
7387
|
__decorate([
|
|
7227
7388
|
Output()
|
|
7228
|
-
],
|
|
7389
|
+
], NumberFieldComponent.prototype, "onFocus", void 0);
|
|
7229
7390
|
__decorate([
|
|
7230
7391
|
Output()
|
|
7231
|
-
],
|
|
7232
|
-
|
|
7392
|
+
], NumberFieldComponent.prototype, "onComplete", void 0);
|
|
7393
|
+
NumberFieldComponent = __decorate([
|
|
7233
7394
|
Component({
|
|
7234
|
-
template: "<p-inputMask\n *ngIf=\"field.mask; else noMask\"\n type=\"text\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [mask]=\"isFunction(field.mask) ? field.mask() : field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"onFocus.next($event)\"\n (onComplete)=\"onComplete.next($event)\"\n (onInput)=\"onInput.next($event)\"\n [formControl]=\"formControl\"
|
|
7395
|
+
template: "<p-inputMask\n *ngIf=\"field.mask; else noMask\"\n type=\"text\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [mask]=\"isFunction(field.mask) ? field.mask() : field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"onFocus.next($event)\"\n (onComplete)=\"onComplete.next($event)\"\n (onInput)=\"onInput.next($event)\"\n [formControl]=\"formControl\" >\n</p-inputMask>\n<ng-template #noMask>\n <ng-container>\n <div class=\"ui-inputgroup\">\n <ng-container *ngIf=\"field.leftAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.leftAddon.label\">{{field.leftAddon.label}}</span>\n <span *ngIf=\"!field.leftAddon.label\" [ngClass]=\"field.leftAddon.icon\"></span>\n </span>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"field.type === fieldType.Double && field.alignTo === numberAlignmentOption.LEFT ? localizedNumber : input\"></ng-container>\n\n <ng-container *ngIf=\"field.rightAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.rightAddon.label\">{{field.rightAddon.label}}</span>\n <span *ngIf=\"!field.rightAddon.label\" [ngClass]=\"field.rightAddon.icon\"></span>\n </span>\n </ng-container>\n </div>\n </ng-container>\n</ng-template>\n<ng-template #input>\n <input\n [id]=\"(field.id || field.name)\"\n type=\"text\"\n [name]=\"field.name\"\n sNumberInput\n [precision]=\"isFunction(field.precision) ? trigger(field.precision) : field.precision\"\n [scale]=\"isFunction(field.scale) ? trigger(field.scale) : field.scale\"\n [decimalSeparator]=\"field.numberLocaleOptions.decimalSeparator\"\n [thousandsSeparator]=\"field.numberLocaleOptions.thousandsSeparator\"\n [alignTo]=\"field.alignTo\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n [formControl]=\"formControl\" />\n</ng-template>\n<ng-template #localizedNumber>\n <input\n [id]=\"(field.id || field.name)\"\n type=\"text\"\n [name]=\"field.name\"\n sLocalizedNumberInput\n [precision]=\"isFunction(field.precision) ? trigger(field.precision) : field.precision\"\n [decimalSeparator]=\"field.numberLocaleOptions.decimalSeparator\"\n [thousandsSeparator]=\"field.numberLocaleOptions.thousandsSeparator\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n [formControl]=\"formControl\" />\n</ng-template>\n",
|
|
7235
7396
|
encapsulation: ViewEncapsulation.None,
|
|
7236
7397
|
styles: ["s-number-field.ng-dirty.ng-invalid .ui-inputtext{border-color:#c13018}s-number-field.ng-dirty.ng-invalid .ui-inputtext:hover{border-color:#e44328}"]
|
|
7237
7398
|
})
|
|
7238
|
-
],
|
|
7239
|
-
return
|
|
7399
|
+
], NumberFieldComponent);
|
|
7400
|
+
return NumberFieldComponent;
|
|
7240
7401
|
}(BaseFieldComponent));
|
|
7241
7402
|
|
|
7242
|
-
var BooleanSwitchFieldComponent = /** @class */ (function () {
|
|
7243
|
-
function BooleanSwitchFieldComponent() {
|
|
7244
|
-
}
|
|
7245
|
-
__decorate([
|
|
7246
|
-
Input()
|
|
7247
|
-
], BooleanSwitchFieldComponent.prototype, "field", void 0);
|
|
7248
|
-
__decorate([
|
|
7249
|
-
Input()
|
|
7250
|
-
], BooleanSwitchFieldComponent.prototype, "formControl", void 0);
|
|
7251
|
-
BooleanSwitchFieldComponent = __decorate([
|
|
7252
|
-
Component({
|
|
7253
|
-
template: "<div class=\"ui-grid ui-grid-responsive ui-grid-pad ui-fluid\">\n <div class=\"ui-grid-row\">\n <div class=\"i-grid-col-1\">\n <s-switch\n [id]=\"(field.id || field.name)\"\n [inputName]=\"field.name\"\n [formControl]=\"formControl\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n (valueChanged)=\"field.onChange ? field.onChange($event) : null\">\n </s-switch>\n </div>\n <div class=\"i-grid-col-1\" *ngIf=\"field.optionsLabel\">\n <ng-container *ngIf=\"formControl.value; else caseFalse\">\n <span>{{ field.optionsLabel.true }}</span>\n </ng-container>\n <ng-template #caseFalse>\n <span>{{ field.optionsLabel.false }}</span>\n </ng-template>\n </div>\n </div>\n</div>"
|
|
7254
|
-
})
|
|
7255
|
-
], BooleanSwitchFieldComponent);
|
|
7256
|
-
return BooleanSwitchFieldComponent;
|
|
7257
|
-
}());
|
|
7258
|
-
|
|
7259
7403
|
var PasswordFieldComponent = /** @class */ (function () {
|
|
7260
7404
|
function PasswordFieldComponent() {
|
|
7261
7405
|
this.onInput = new EventEmitter();
|
|
@@ -7316,751 +7460,649 @@ var PasswordFieldComponent = /** @class */ (function () {
|
|
|
7316
7460
|
return PasswordFieldComponent;
|
|
7317
7461
|
}());
|
|
7318
7462
|
|
|
7319
|
-
var
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
_this.onSlideEnd = new EventEmitter();
|
|
7325
|
-
_this.ngUnsubscribe = new Subject();
|
|
7326
|
-
return _this;
|
|
7463
|
+
var RadioButtonComponent = /** @class */ (function () {
|
|
7464
|
+
function RadioButtonComponent() {
|
|
7465
|
+
this.onClick = new EventEmitter();
|
|
7466
|
+
this.onFocus = new EventEmitter();
|
|
7467
|
+
this.ngUnsubscribe = new Subject();
|
|
7327
7468
|
}
|
|
7328
|
-
|
|
7469
|
+
RadioButtonComponent.prototype.ngOnInit = function () {
|
|
7329
7470
|
var _this = this;
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
if (_this.field.onChange) {
|
|
7334
|
-
_this.field.onChange(event);
|
|
7335
|
-
}
|
|
7471
|
+
this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
7472
|
+
if (_this.field.onFocus)
|
|
7473
|
+
_this.field.onFocus(event);
|
|
7336
7474
|
});
|
|
7337
|
-
this.
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
_this.field.onSlideEnd(event);
|
|
7341
|
-
}
|
|
7475
|
+
this.onClick.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
7476
|
+
if (_this.field.onClick)
|
|
7477
|
+
_this.field.onClick(event);
|
|
7342
7478
|
});
|
|
7343
|
-
var values = ((_a = this.field) === null || _a === void 0 ? void 0 : _a.range) ? [this.field.min, this.field.max] : this.field.min;
|
|
7344
|
-
this.formControl.setValue((_b = this.field.defaultValue) !== null && _b !== void 0 ? _b : values);
|
|
7345
7479
|
};
|
|
7346
|
-
|
|
7480
|
+
RadioButtonComponent.prototype.ngOnDestroy = function () {
|
|
7347
7481
|
this.ngUnsubscribe.next();
|
|
7348
7482
|
this.ngUnsubscribe.complete();
|
|
7349
7483
|
};
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
return FieldType;
|
|
7353
|
-
},
|
|
7354
|
-
enumerable: true,
|
|
7355
|
-
configurable: true
|
|
7356
|
-
});
|
|
7357
|
-
SliderFieldComponent.prototype.getRangeLabel = function () {
|
|
7358
|
-
var _a, _b, _c, _d;
|
|
7359
|
-
var _e = __read((_a = this.formControl.value) !== null && _a !== void 0 ? _a : [0, 0], 2), value0 = _e[0], value1 = _e[1];
|
|
7360
|
-
var prefix = (_b = this.field.prefix) !== null && _b !== void 0 ? _b : '';
|
|
7361
|
-
var suffix = (_c = this.field.suffix) !== null && _c !== void 0 ? _c : '';
|
|
7362
|
-
var separator = (_d = this.field.rangeSeparator) !== null && _d !== void 0 ? _d : ' - ';
|
|
7363
|
-
if (!value0 || value0 < this.field.min) {
|
|
7364
|
-
value0 = this.field.min;
|
|
7365
|
-
}
|
|
7366
|
-
if (!value1 || value1 > this.field.max) {
|
|
7367
|
-
value1 = this.field.max;
|
|
7368
|
-
}
|
|
7369
|
-
return "" + prefix + value0 + suffix + separator + prefix + value1 + suffix;
|
|
7370
|
-
};
|
|
7371
|
-
SliderFieldComponent.prototype.getNonRangeLabel = function () {
|
|
7372
|
-
var _a, _b, _c;
|
|
7373
|
-
var value = (_a = this.formControl) === null || _a === void 0 ? void 0 : _a.value;
|
|
7374
|
-
var prefix = (_b = this.field.prefix) !== null && _b !== void 0 ? _b : '';
|
|
7375
|
-
var suffix = (_c = this.field.suffix) !== null && _c !== void 0 ? _c : '';
|
|
7376
|
-
if (!value || value < this.field.min) {
|
|
7377
|
-
value = this.field.min;
|
|
7378
|
-
}
|
|
7379
|
-
if (value > this.field.max) {
|
|
7380
|
-
value = this.field.max;
|
|
7381
|
-
}
|
|
7382
|
-
return "" + prefix + value + suffix;
|
|
7484
|
+
RadioButtonComponent.prototype.onClear = function () {
|
|
7485
|
+
this.formControl.reset();
|
|
7383
7486
|
};
|
|
7384
|
-
Object.defineProperty(SliderFieldComponent.prototype, "label", {
|
|
7385
|
-
get: function () {
|
|
7386
|
-
return this.field.range ? this.getRangeLabel() : this.getNonRangeLabel();
|
|
7387
|
-
},
|
|
7388
|
-
enumerable: true,
|
|
7389
|
-
configurable: true
|
|
7390
|
-
});
|
|
7391
7487
|
__decorate([
|
|
7392
7488
|
Input()
|
|
7393
|
-
],
|
|
7489
|
+
], RadioButtonComponent.prototype, "field", void 0);
|
|
7394
7490
|
__decorate([
|
|
7395
7491
|
Input()
|
|
7396
|
-
],
|
|
7492
|
+
], RadioButtonComponent.prototype, "formControl", void 0);
|
|
7397
7493
|
__decorate([
|
|
7398
7494
|
Output()
|
|
7399
|
-
],
|
|
7495
|
+
], RadioButtonComponent.prototype, "onClick", void 0);
|
|
7400
7496
|
__decorate([
|
|
7401
7497
|
Output()
|
|
7402
|
-
],
|
|
7403
|
-
|
|
7498
|
+
], RadioButtonComponent.prototype, "onFocus", void 0);
|
|
7499
|
+
RadioButtonComponent = __decorate([
|
|
7404
7500
|
Component({
|
|
7405
|
-
template: "<ng-container>\n <div class=\"
|
|
7406
|
-
|
|
7501
|
+
template: "<ng-container *ngIf=\"field.verticalAlignment;else horizontalAlignment\">\n <div class=\"ui-g\">\n <div\n *ngFor=\"let option of field.options; let i = index\"\n class=\"ui-g-12\">\n <ng-container\n [ngTemplateOutlet]=\"radioButton\"\n [ngTemplateOutletContext]=\"{option: option, index: i}\">\n </ng-container>\n </div>\n <s-button\n *ngIf=\"field.showClear && !field.required() && !formControl.disabled\"\n [label]=\"field.clearLabel || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n </div>\n</ng-container>\n\n<ng-template #horizontalAlignment>\n <div class=\"ui-g\">\n <ng-container\n *ngFor=\"let option of field.options; let i = index\"\n [ngTemplateOutlet]=\"radioButton\"\n [ngTemplateOutletContext]=\"{option: option, index: i}\">\n </ng-container>\n </div>\n <s-button\n *ngIf=\"field.showClear && !field.required() && !formControl.disabled\"\n class=\"horizontal-clear-option\"\n [label]=\"field.clearLabel || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n</ng-template>\n\n<ng-template #radioButton let-option=\"option\" let-i=\"index\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"option.value\"\n [label]=\"option.label\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-' + i\"\n [sTooltip]=\"field.tooltip\"\n (onClick)=\"onClick.next($event)\"\n (onFocus)=\"onFocus.next($event)\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n</ng-template>\n",
|
|
7502
|
+
encapsulation: ViewEncapsulation.None,
|
|
7503
|
+
styles: ["\n s-button.horizontal-clear-option button {\n width: min-content !important;\n }\n "]
|
|
7407
7504
|
})
|
|
7408
|
-
],
|
|
7409
|
-
return
|
|
7410
|
-
}(
|
|
7505
|
+
], RadioButtonComponent);
|
|
7506
|
+
return RadioButtonComponent;
|
|
7507
|
+
}());
|
|
7411
7508
|
|
|
7412
|
-
var
|
|
7413
|
-
function
|
|
7414
|
-
var group = _a.group, errorMessages = _a.errorMessages;
|
|
7415
|
-
this.group = group;
|
|
7416
|
-
this.errorMessages = errorMessages;
|
|
7509
|
+
var SectionComponent = /** @class */ (function () {
|
|
7510
|
+
function SectionComponent() {
|
|
7417
7511
|
}
|
|
7418
|
-
|
|
7512
|
+
__decorate([
|
|
7513
|
+
Input()
|
|
7514
|
+
], SectionComponent.prototype, "id", void 0);
|
|
7515
|
+
__decorate([
|
|
7516
|
+
Input()
|
|
7517
|
+
], SectionComponent.prototype, "config", void 0);
|
|
7518
|
+
__decorate([
|
|
7519
|
+
Input()
|
|
7520
|
+
], SectionComponent.prototype, "group", void 0);
|
|
7521
|
+
__decorate([
|
|
7522
|
+
Input()
|
|
7523
|
+
], SectionComponent.prototype, "errorMessages", void 0);
|
|
7524
|
+
SectionComponent = __decorate([
|
|
7525
|
+
Component({
|
|
7526
|
+
template: "\n <h3 *ngIf=\"config?.header\" class=\"sds-section-title\">{{config.header}}</h3>\n <ng-container *ngFor=\"let conf of config.configs\">\n <ng-container *sDynamicForm=\"{ id: id, config: conf, group: group, errorMessages: errorMessages }\"></ng-container>\n </ng-container>\n "
|
|
7527
|
+
})
|
|
7528
|
+
], SectionComponent);
|
|
7529
|
+
return SectionComponent;
|
|
7419
7530
|
}());
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
group: group,
|
|
7426
|
-
errorMessages: errorMessages,
|
|
7427
|
-
}) || this;
|
|
7428
|
-
_this.field = field;
|
|
7429
|
-
_this.setFieldPropertiesByType();
|
|
7430
|
-
return _this;
|
|
7431
|
-
}
|
|
7432
|
-
DynamicField.prototype.setFieldPropertiesByType = function () {
|
|
7433
|
-
if (this.field.type === FieldType.Integer || this.field.type === FieldType.Double) {
|
|
7434
|
-
this.field.numberLocaleOptions.currencySymbol = "";
|
|
7435
|
-
}
|
|
7436
|
-
};
|
|
7437
|
-
DynamicField.prototype.createComponent = function (resolver, container) {
|
|
7438
|
-
var componentFactory = resolver.resolveComponentFactory(this.getComponent());
|
|
7439
|
-
var component = container.createComponent(componentFactory);
|
|
7440
|
-
component.instance.field = this.field;
|
|
7441
|
-
// Must be this way because some teams use name like "e070emp.codemp"
|
|
7442
|
-
component.instance.formControl = this.group["controls"][this.field.name];
|
|
7443
|
-
component.instance.errorMessages = this.errorMessages;
|
|
7444
|
-
this.setVariablesByType(component);
|
|
7445
|
-
return component;
|
|
7446
|
-
};
|
|
7447
|
-
DynamicField.prototype.setVariablesByType = function (component) {
|
|
7448
|
-
if (this.field.type == FieldType.Time) {
|
|
7449
|
-
component.instance.timeOnly = true;
|
|
7450
|
-
}
|
|
7451
|
-
if ([FieldType.LocalDateTime, FieldType.DateTime, FieldType.Time].includes(this.field.type)) {
|
|
7452
|
-
component.instance.showTime = true;
|
|
7453
|
-
}
|
|
7454
|
-
};
|
|
7455
|
-
DynamicField.prototype.updateVariables = function (component) {
|
|
7456
|
-
component.instance.field = this.field;
|
|
7457
|
-
component.instance.formControl = this.group["controls"][this.field.name];
|
|
7458
|
-
this.setVariablesByType(component);
|
|
7459
|
-
};
|
|
7460
|
-
DynamicField.prototype.getComponent = function () {
|
|
7461
|
-
switch (this.field.type) {
|
|
7462
|
-
case FieldType.Autocomplete:
|
|
7463
|
-
return AutocompleteFieldComponent;
|
|
7464
|
-
case FieldType.Binary:
|
|
7465
|
-
case FieldType.String:
|
|
7466
|
-
return TextFieldComponent;
|
|
7467
|
-
case FieldType.Boolean:
|
|
7468
|
-
return this.field.representedBy === "switch" ? BooleanSwitchFieldComponent : BooleanFieldComponent;
|
|
7469
|
-
case FieldType.Chips:
|
|
7470
|
-
return ChipsFieldComponent;
|
|
7471
|
-
case FieldType.Date:
|
|
7472
|
-
case FieldType.DateTime:
|
|
7473
|
-
case FieldType.LocalDateTime:
|
|
7474
|
-
case FieldType.Time:
|
|
7475
|
-
return CalendarFieldComponent;
|
|
7476
|
-
case FieldType.Number:
|
|
7477
|
-
case FieldType.Integer:
|
|
7478
|
-
case FieldType.Double:
|
|
7479
|
-
return BignumberFieldComponent;
|
|
7480
|
-
case FieldType.Enum:
|
|
7481
|
-
return SelectFieldComponent;
|
|
7482
|
-
case FieldType.Lookup:
|
|
7483
|
-
return LookupFieldComponent;
|
|
7484
|
-
case FieldType.Money:
|
|
7485
|
-
return CurrencyFieldComponent;
|
|
7486
|
-
case FieldType.Radio:
|
|
7487
|
-
return RadioButtonComponent;
|
|
7488
|
-
case FieldType.Text:
|
|
7489
|
-
return TextAreaFieldComponent;
|
|
7490
|
-
case FieldType.TextIA:
|
|
7491
|
-
return TextAreaIAFieldComponent;
|
|
7492
|
-
case FieldType.Password:
|
|
7493
|
-
return PasswordFieldComponent;
|
|
7494
|
-
case FieldType.Blob:
|
|
7495
|
-
return FileUploadComponent$1;
|
|
7496
|
-
case FieldType.Slider:
|
|
7497
|
-
return SliderFieldComponent;
|
|
7498
|
-
case FieldType.Custom:
|
|
7499
|
-
return this.field.CustomFieldComponentClass;
|
|
7500
|
-
default:
|
|
7501
|
-
throw new Error("Trying to use an unsupported type (" + this.field.type + ").");
|
|
7502
|
-
}
|
|
7503
|
-
};
|
|
7504
|
-
return DynamicField;
|
|
7505
|
-
}(DynamicForm));
|
|
7506
|
-
var DynamicStructure = /** @class */ (function (_super) {
|
|
7507
|
-
__extends(DynamicStructure, _super);
|
|
7508
|
-
function DynamicStructure(_a) {
|
|
7509
|
-
var group = _a.group, config = _a.config, errorMessages = _a.errorMessages;
|
|
7510
|
-
var _this = _super.call(this, {
|
|
7511
|
-
group: group,
|
|
7512
|
-
errorMessages: errorMessages,
|
|
7513
|
-
}) || this;
|
|
7514
|
-
_this.config = config;
|
|
7515
|
-
return _this;
|
|
7531
|
+
|
|
7532
|
+
var SelectFieldComponent = /** @class */ (function (_super) {
|
|
7533
|
+
__extends(SelectFieldComponent, _super);
|
|
7534
|
+
function SelectFieldComponent() {
|
|
7535
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
7516
7536
|
}
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
return DynamicStructure;
|
|
7539
|
-
}(DynamicForm));
|
|
7540
|
-
var DynamicGrid = /** @class */ (function (_super) {
|
|
7541
|
-
__extends(DynamicGrid, _super);
|
|
7542
|
-
function DynamicGrid(_a) {
|
|
7543
|
-
var group = _a.group, config = _a.config, errorMessages = _a.errorMessages;
|
|
7544
|
-
var _this = _super.call(this, { group: group, errorMessages: errorMessages }) || this;
|
|
7545
|
-
_this.config = config;
|
|
7537
|
+
__decorate([
|
|
7538
|
+
Input()
|
|
7539
|
+
], SelectFieldComponent.prototype, "field", void 0);
|
|
7540
|
+
__decorate([
|
|
7541
|
+
Input()
|
|
7542
|
+
], SelectFieldComponent.prototype, "formControl", void 0);
|
|
7543
|
+
SelectFieldComponent = __decorate([
|
|
7544
|
+
Component({
|
|
7545
|
+
template: "<p-dropdown\n *ngIf=\"!field.multiple\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [placeholder]=\"field.placeholder || ' '\"\n [formControl]=\"formControl\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [showClear]=\"field.showClear\"\n dataKey=\"{{field.dataKey}}\"\n optionLabel=\"{{field.optionLabel}}\"\n [autoDisplayFirst]=\"field.autoDisplayFirst\"\n [appendTo]=\"field.appendTo || 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\">\n</p-dropdown>\n<p-multiSelect\n *ngIf=\"field.multiple\"\n [formControl]=\"formControl\"\n [name]=\"field.name\"\n [inputId]=\"(field.id || field.name)\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [defaultLabel]=\"field.placeholder\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [emptyFilterMessage]=\"field.emptyMessage || 'Nenhum registro encontrado'\"\n [showDelay]=\"500\"\n [selectedItemsLabel]=\"field.multipleSelectedLabel\"\n [appendTo]=\"field.appendTo || 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\">\n</p-multiSelect>\n\n"
|
|
7546
|
+
})
|
|
7547
|
+
], SelectFieldComponent);
|
|
7548
|
+
return SelectFieldComponent;
|
|
7549
|
+
}(BaseFieldComponent));
|
|
7550
|
+
|
|
7551
|
+
var SliderFieldComponent = /** @class */ (function (_super) {
|
|
7552
|
+
__extends(SliderFieldComponent, _super);
|
|
7553
|
+
function SliderFieldComponent() {
|
|
7554
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
7555
|
+
_this.onChange = new EventEmitter();
|
|
7556
|
+
_this.onSlideEnd = new EventEmitter();
|
|
7557
|
+
_this.ngUnsubscribe = new Subject();
|
|
7546
7558
|
return _this;
|
|
7547
7559
|
}
|
|
7548
|
-
|
|
7549
|
-
var
|
|
7550
|
-
var
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7560
|
+
SliderFieldComponent.prototype.ngOnInit = function () {
|
|
7561
|
+
var _this = this;
|
|
7562
|
+
var _a, _b;
|
|
7563
|
+
this.onChange.pipe(takeUntil(this.ngUnsubscribe))
|
|
7564
|
+
.subscribe(function (event) {
|
|
7565
|
+
if (_this.field.onChange) {
|
|
7566
|
+
_this.field.onChange(event);
|
|
7567
|
+
}
|
|
7568
|
+
});
|
|
7569
|
+
this.onSlideEnd.pipe(takeUntil(this.ngUnsubscribe))
|
|
7570
|
+
.subscribe(function (event) {
|
|
7571
|
+
if (_this.field.onSlideEnd) {
|
|
7572
|
+
_this.field.onSlideEnd(event);
|
|
7573
|
+
}
|
|
7574
|
+
});
|
|
7575
|
+
var values = ((_a = this.field) === null || _a === void 0 ? void 0 : _a.range) ? [this.field.min, this.field.max] : this.field.min;
|
|
7576
|
+
this.formControl.setValue((_b = this.field.defaultValue) !== null && _b !== void 0 ? _b : values);
|
|
7559
7577
|
};
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
return RowComponent;
|
|
7564
|
-
default:
|
|
7565
|
-
throw new Error("Trying to use an unsupported type (" + this.config.type + ").");
|
|
7566
|
-
}
|
|
7578
|
+
SliderFieldComponent.prototype.ngOnDestroy = function () {
|
|
7579
|
+
this.ngUnsubscribe.next();
|
|
7580
|
+
this.ngUnsubscribe.complete();
|
|
7567
7581
|
};
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
var DynamicFormDirective = /** @class */ (function () {
|
|
7572
|
-
function DynamicFormDirective(resolver, container) {
|
|
7573
|
-
this.resolver = resolver;
|
|
7574
|
-
this.container = container;
|
|
7575
|
-
}
|
|
7576
|
-
Object.defineProperty(DynamicFormDirective.prototype, "sDynamicForm", {
|
|
7577
|
-
set: function (context) {
|
|
7578
|
-
var id = context.id, config = context.config, group = context.group, errorMessages = context.errorMessages;
|
|
7579
|
-
this.id = id;
|
|
7580
|
-
this.config = config;
|
|
7581
|
-
this.group = group;
|
|
7582
|
-
this.errorMessages = errorMessages;
|
|
7582
|
+
Object.defineProperty(SliderFieldComponent.prototype, "fieldType", {
|
|
7583
|
+
get: function () {
|
|
7584
|
+
return FieldType;
|
|
7583
7585
|
},
|
|
7584
7586
|
enumerable: true,
|
|
7585
7587
|
configurable: true
|
|
7586
7588
|
});
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
errorMessages: this.errorMessages,
|
|
7596
|
-
});
|
|
7597
|
-
}
|
|
7598
|
-
else if (this.isStructure()) {
|
|
7599
|
-
this.directiveConfig = new DynamicStructure({
|
|
7600
|
-
group: this.group,
|
|
7601
|
-
config: this.config,
|
|
7602
|
-
errorMessages: this.errorMessages,
|
|
7603
|
-
});
|
|
7589
|
+
SliderFieldComponent.prototype.getRangeLabel = function () {
|
|
7590
|
+
var _a, _b, _c, _d;
|
|
7591
|
+
var _e = __read((_a = this.formControl.value) !== null && _a !== void 0 ? _a : [0, 0], 2), value0 = _e[0], value1 = _e[1];
|
|
7592
|
+
var prefix = (_b = this.field.prefix) !== null && _b !== void 0 ? _b : '';
|
|
7593
|
+
var suffix = (_c = this.field.suffix) !== null && _c !== void 0 ? _c : '';
|
|
7594
|
+
var separator = (_d = this.field.rangeSeparator) !== null && _d !== void 0 ? _d : ' - ';
|
|
7595
|
+
if (!value0 || value0 < this.field.min) {
|
|
7596
|
+
value0 = this.field.min;
|
|
7604
7597
|
}
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
group: this.group,
|
|
7608
|
-
config: this.config,
|
|
7609
|
-
errorMessages: this.errorMessages,
|
|
7610
|
-
});
|
|
7598
|
+
if (!value1 || value1 > this.field.max) {
|
|
7599
|
+
value1 = this.field.max;
|
|
7611
7600
|
}
|
|
7612
|
-
|
|
7613
|
-
throw new Error("Trying to use an unsupported type (" + this.config.type + ").");
|
|
7614
|
-
this.component = this.directiveConfig.createComponent(this.resolver, this.container);
|
|
7615
|
-
this.component.instance.id = this.id;
|
|
7616
|
-
this.component.instance.errorMessages = this.errorMessages;
|
|
7601
|
+
return "" + prefix + value0 + suffix + separator + prefix + value1 + suffix;
|
|
7617
7602
|
};
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7603
|
+
SliderFieldComponent.prototype.getNonRangeLabel = function () {
|
|
7604
|
+
var _a, _b, _c;
|
|
7605
|
+
var value = (_a = this.formControl) === null || _a === void 0 ? void 0 : _a.value;
|
|
7606
|
+
var prefix = (_b = this.field.prefix) !== null && _b !== void 0 ? _b : '';
|
|
7607
|
+
var suffix = (_c = this.field.suffix) !== null && _c !== void 0 ? _c : '';
|
|
7608
|
+
if (!value || value < this.field.min) {
|
|
7609
|
+
value = this.field.min;
|
|
7610
|
+
}
|
|
7611
|
+
if (value > this.field.max) {
|
|
7612
|
+
value = this.field.max;
|
|
7622
7613
|
}
|
|
7614
|
+
return "" + prefix + value + suffix;
|
|
7623
7615
|
};
|
|
7624
|
-
|
|
7625
|
-
|
|
7616
|
+
Object.defineProperty(SliderFieldComponent.prototype, "label", {
|
|
7617
|
+
get: function () {
|
|
7618
|
+
return this.field.range ? this.getRangeLabel() : this.getNonRangeLabel();
|
|
7619
|
+
},
|
|
7620
|
+
enumerable: true,
|
|
7621
|
+
configurable: true
|
|
7622
|
+
});
|
|
7623
|
+
__decorate([
|
|
7624
|
+
Input()
|
|
7625
|
+
], SliderFieldComponent.prototype, "field", void 0);
|
|
7626
|
+
__decorate([
|
|
7627
|
+
Input()
|
|
7628
|
+
], SliderFieldComponent.prototype, "formControl", void 0);
|
|
7629
|
+
__decorate([
|
|
7630
|
+
Output()
|
|
7631
|
+
], SliderFieldComponent.prototype, "onChange", void 0);
|
|
7632
|
+
__decorate([
|
|
7633
|
+
Output()
|
|
7634
|
+
], SliderFieldComponent.prototype, "onSlideEnd", void 0);
|
|
7635
|
+
SliderFieldComponent = __decorate([
|
|
7636
|
+
Component({
|
|
7637
|
+
template: "<ng-container>\n <div class=\"slider-group\">\n <div class=\"slider-label\">\n <span>{{label}}</span>\n </div>\n <p-slider \n [id]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [range]=\"field.range\"\n [orientation]=\"field.orientation\"\n [min]=\"field.min\" \n [max]=\"field.max\"\n [step]=\"field.step\"\n [animate]=\"field.animate\" \n (onChange)=\"field.onChange ? field.onChange($event) : null\"\n (onSlideEnd)=\"field.onSlideEnd ? field.onSlideEnd($event) : null\">\n </p-slider>\n </div>\n</ng-container>",
|
|
7638
|
+
styles: [".slider-label{margin-bottom:5px;margin-left:-10px}.slider-group{margin-left:9px;margin-right:11px}"]
|
|
7639
|
+
})
|
|
7640
|
+
], SliderFieldComponent);
|
|
7641
|
+
return SliderFieldComponent;
|
|
7642
|
+
}(BaseFieldComponent));
|
|
7643
|
+
|
|
7644
|
+
var TextAreaFieldComponent = /** @class */ (function () {
|
|
7645
|
+
function TextAreaFieldComponent() {
|
|
7646
|
+
}
|
|
7647
|
+
__decorate([
|
|
7648
|
+
Input()
|
|
7649
|
+
], TextAreaFieldComponent.prototype, "field", void 0);
|
|
7650
|
+
__decorate([
|
|
7651
|
+
Input()
|
|
7652
|
+
], TextAreaFieldComponent.prototype, "formControl", void 0);
|
|
7653
|
+
TextAreaFieldComponent = __decorate([
|
|
7654
|
+
Component({
|
|
7655
|
+
template: "<textarea\n [id]=\"(field.id || field.name)\"\n *ngIf=\"!field.keyFilter\"\n pInputTextarea\n [rows]=\"field.rows\"\n [cols]=\"field.cols\"\n [formControl]=\"formControl\"\n style=\"resize: vertical;\"\n [ngStyle]=\"field.style\"\n></textarea>\n<textarea\n [id]=\"(field.id || field.name)\"\n *ngIf=\"field.keyFilter\"\n pInputTextarea\n [rows]=\"field.rows\"\n [cols]=\"field.cols\"\n [formControl]=\"formControl\"\n style=\"resize: vertical;\"\n [pKeyFilter]=\"field.keyFilter\"\n [ngStyle]=\"field.style\"\n></textarea>\n"
|
|
7656
|
+
})
|
|
7657
|
+
], TextAreaFieldComponent);
|
|
7658
|
+
return TextAreaFieldComponent;
|
|
7659
|
+
}());
|
|
7660
|
+
|
|
7661
|
+
var TextAreaIAFieldComponent = /** @class */ (function () {
|
|
7662
|
+
function TextAreaIAFieldComponent(_iassistService, _formBuilder, _translateService) {
|
|
7663
|
+
this._iassistService = _iassistService;
|
|
7664
|
+
this._formBuilder = _formBuilder;
|
|
7665
|
+
this._translateService = _translateService;
|
|
7666
|
+
this.isVisible = false;
|
|
7667
|
+
this.isLoading = false;
|
|
7668
|
+
}
|
|
7669
|
+
TextAreaIAFieldComponent.prototype.ngOnInit = function () {
|
|
7670
|
+
this._createDialogFields();
|
|
7671
|
+
this._createDialogFormGroup();
|
|
7626
7672
|
};
|
|
7627
|
-
|
|
7628
|
-
|
|
7673
|
+
TextAreaIAFieldComponent.prototype.showDialog = function () {
|
|
7674
|
+
this.isVisible = true;
|
|
7675
|
+
};
|
|
7676
|
+
TextAreaIAFieldComponent.prototype.onHideDialog = function () {
|
|
7677
|
+
this.formGroup.get("context").setValue("");
|
|
7678
|
+
};
|
|
7679
|
+
TextAreaIAFieldComponent.prototype.hideDialog = function () {
|
|
7680
|
+
this.isVisible = false;
|
|
7681
|
+
};
|
|
7682
|
+
TextAreaIAFieldComponent.prototype.submitContext = function () {
|
|
7683
|
+
var _this = this;
|
|
7684
|
+
var context = this.formGroup.get("context");
|
|
7685
|
+
this.isLoading = true;
|
|
7686
|
+
this._iassistService.askIA(context.value, {
|
|
7687
|
+
id: this.field.id,
|
|
7688
|
+
label: this.field.label,
|
|
7689
|
+
placeholder: this.field.placeholder,
|
|
7690
|
+
})
|
|
7691
|
+
.pipe(catchError(function (err) {
|
|
7692
|
+
_this.isLoading = false;
|
|
7693
|
+
return throwError(err);
|
|
7694
|
+
}))
|
|
7695
|
+
.subscribe(function (res) {
|
|
7696
|
+
_this.formControl.setValue(res.text);
|
|
7697
|
+
_this.isLoading = false;
|
|
7698
|
+
});
|
|
7699
|
+
this.hideDialog();
|
|
7700
|
+
};
|
|
7701
|
+
TextAreaIAFieldComponent.prototype._createDialogFields = function () {
|
|
7702
|
+
this.fields = [
|
|
7703
|
+
new FormField({
|
|
7704
|
+
name: "context",
|
|
7705
|
+
type: FieldType.String,
|
|
7706
|
+
label: this._translateService.instant("platform.angular_components.context"),
|
|
7707
|
+
size: { sm: 12, md: 12, lg: 12, xl: 12 },
|
|
7708
|
+
}),
|
|
7709
|
+
];
|
|
7629
7710
|
};
|
|
7630
|
-
|
|
7631
|
-
|
|
7711
|
+
TextAreaIAFieldComponent.prototype._createDialogFormGroup = function () {
|
|
7712
|
+
this.formGroup = this._formBuilder.group({
|
|
7713
|
+
context: [""],
|
|
7714
|
+
});
|
|
7632
7715
|
};
|
|
7633
|
-
|
|
7634
|
-
{ type:
|
|
7635
|
-
{ type:
|
|
7716
|
+
TextAreaIAFieldComponent.ctorParameters = function () { return [
|
|
7717
|
+
{ type: IAssistService },
|
|
7718
|
+
{ type: FormBuilder },
|
|
7719
|
+
{ type: TranslateService }
|
|
7636
7720
|
]; };
|
|
7637
7721
|
__decorate([
|
|
7638
7722
|
Input()
|
|
7639
|
-
],
|
|
7723
|
+
], TextAreaIAFieldComponent.prototype, "field", void 0);
|
|
7640
7724
|
__decorate([
|
|
7641
|
-
Input(
|
|
7642
|
-
],
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
]
|
|
7646
|
-
|
|
7725
|
+
Input()
|
|
7726
|
+
], TextAreaIAFieldComponent.prototype, "formControl", void 0);
|
|
7727
|
+
TextAreaIAFieldComponent = __decorate([
|
|
7728
|
+
Component({
|
|
7729
|
+
template: "<s-loading-state\n [loading]=\"isLoading\"\n [blockWindow]=\"true\"> \n</s-loading-state>\n\n<p-dialog\n [(visible)]=\"isVisible\"\n [modal]=\"true\"\n [style]=\"{ width: '50vw' }\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n (onHide)=\"onHideDialog()\">\n <p-header>\n <div class=\"dialog-header\">\n <span class=\"iassist-icon\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </span>\n {{ 'platform.angular_components.iassist_text_generator' | translate }}\n </div>\n </p-header>\n <s-dynamic-form\n [fields]=\"fields\"\n [form]=\"formGroup\">\n </s-dynamic-form>\n <p-footer>\n <div class=\"footer-content\">\n <s-button\n id=\"-submit-button\"\n type=\"button\"\n [label]=\"'platform.angular_components.generate_text' | translate\"\n (onClick)=\"submitContext()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n showDelay=\"500\">\n </s-button>\n <s-button\n id=\"-cancel-button\"\n type=\"button\"\n priority=\"link\"\n [label]=\"'platform.angular_components.cancel' | translate\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n showDelay=\"500\">\n </s-button>\n </div>\n </p-footer>\n</p-dialog>\n\n<div class=\"textarea-ia\">\n <textarea\n [id]=\"(field.id || field.name)\"\n pInputTextarea\n [rows]=\"field.rows\"\n [cols]=\"field.cols\"\n [formControl]=\"formControl\"\n style=\"resize: vertical;\"\n [ngStyle]=\"field.style\">\n </textarea>\n <button\n class=\"iassist-button\"\n (click)=\"showDialog()\"\n [sTooltip]=\"'platform.angular_components.iassist_text_generator' | translate\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </button>\n</div>\n\n<ng-template #iassistIcon>\n <svg style=\"width: 100%; height: 100%;\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5.81451 18.1054L5.99593 17.6059L7.52166 13.4099L7.60877 13.1726L7.61277 13.1614L7.94285 12.2543L8.01159 12.0648L8.05394 11.949L5.2998 8.52426L5.02726 8.18379C5.00569 8.15821 4.9881 8.13104 4.97292 8.10226C4.90099 7.9632 4.85063 7.81294 4.82186 7.6531C4.73075 7.1344 4.90418 6.60771 5.28382 6.24326C5.29421 6.23447 5.3038 6.22567 5.31419 6.21688L5.47164 6.0914L9.3439 3.00238L9.5469 2.84094L9.57088 2.82096L10.4101 2.15041L11.8007 1.04188C11.2181 0.925188 10.6163 0.863647 10.0001 0.863647C4.95374 0.863647 0.863281 4.9541 0.863281 9.99963C0.863281 13.5346 2.87254 16.5989 5.80971 18.1182\" fill=\"#0FA389\"/>\n <path d=\"M14.099 1.83472L13.9495 2.24632L11.997 7.61074L11.9427 7.7594L11.9003 7.87369L14.7448 11.4103C14.7463 11.4127 14.7479 11.4143 14.7495 11.4167L14.9414 11.654C14.9541 11.67 14.9661 11.6868 14.9765 11.7044C15.0764 11.8698 15.1444 12.0505 15.1779 12.2431C15.273 12.7826 15.0812 13.3284 14.676 13.6897C14.656 13.7129 14.6345 13.7344 14.6105 13.7536L11.8563 15.9507L11.6789 16.0922L11.6022 16.1537L10.7406 16.8402V16.841L10.3937 17.1176L9.85747 17.5452L9.39951 17.9112L8.11035 18.9398C8.72016 19.0677 9.35155 19.1364 9.99973 19.1364C15.0461 19.1364 19.1365 15.046 19.1365 9.99964C19.1365 6.42789 17.0857 3.33727 14.099 1.83472Z\" fill=\"#0FA389\"/>\n <path d=\"M14.7287 12.3222C14.7047 12.1832 14.6551 12.0545 14.5864 11.941L14.3954 11.7036C14.3954 11.7036 14.3946 11.7028 14.3938 11.7028L11.3839 7.96005L10.5031 6.86511L10.4256 6.7676L9.03255 5.03487L8.83674 4.79191C8.79278 4.71678 8.75681 4.63446 8.73204 4.54814C8.72085 4.51058 8.71286 4.47222 8.70566 4.43465C8.68568 4.32196 8.68408 4.21007 8.69847 4.10217L8.62334 4.16291L8.44511 4.30438L5.75731 6.44871L5.60066 6.57339C5.34011 6.82275 5.20584 7.19279 5.27218 7.57482C5.29296 7.68751 5.32892 7.79541 5.37927 7.89292C5.37927 7.89292 5.37927 7.89292 5.38007 7.89371L5.6566 8.23818L8.57139 11.8627L8.63293 11.9394L9.53047 13.0559L9.59041 13.1303L9.98363 13.6186L11.0178 14.9046C11.0186 14.9054 11.0194 14.9069 11.0202 14.9077L11.1361 15.0516V15.0524C11.2184 15.1755 11.2768 15.317 11.3048 15.4728C11.3239 15.5807 11.3263 15.6878 11.3143 15.7925L11.3175 15.7965L11.3943 15.735L11.5717 15.5935L14.3266 13.3964L14.3218 13.3908C14.6335 13.1438 14.8022 12.7394 14.7287 12.3222Z\" fill=\"#F3F3F5\"/>\n <path d=\"M10.6822 15.0082C10.6814 15.0074 10.6806 15.0058 10.6806 15.005L10.5672 14.8643L10.3809 14.6325L10.3282 14.567L10.2211 14.4335L9.40028 13.4129L9.32835 13.3242L8.77289 12.6345L8.68098 12.5194L8.44121 12.2205L8.37168 12.4099L8.04159 13.317L8.0376 13.329L7.95128 13.5664L6.42475 17.7623L6.24333 18.2618L5.90605 19.1881L5.73262 19.6645C5.73182 19.6661 5.73102 19.6677 5.73102 19.6685C5.72863 19.6749 5.72703 19.6821 5.72543 19.6885C5.71584 19.7228 5.71424 19.758 5.72063 19.7948C5.74461 19.929 5.87329 20.0193 6.00836 19.9962C6.04112 19.9898 6.07229 19.9778 6.09867 19.9602C6.09867 19.9602 6.09947 19.9602 6.10027 19.9594L6.14103 19.9266L7.39422 18.9268L9.11496 17.5537L9.57292 17.1877L10.1092 16.7601L10.4561 16.4827L10.4537 16.4811C10.7582 16.2382 10.9236 15.8402 10.8509 15.4294C10.8237 15.2735 10.7654 15.1313 10.6822 15.0082Z\" fill=\"#0C847B\"/>\n <path d=\"M9.17644 4.56325C9.2124 4.68713 9.26915 4.80062 9.34268 4.90053C9.34348 4.90053 9.34428 4.90213 9.34428 4.90213L9.40342 4.97645C9.40502 4.97805 9.40582 4.97885 9.40662 4.98045L9.56806 5.17946L9.64878 5.28096L9.67915 5.31932L9.8414 5.51993L10.5559 6.40947L10.7054 6.59569L11.2169 7.23188L11.5142 7.60192L11.5693 7.45247L13.5202 2.08964L14.1596 0.332135C14.1596 0.330536 14.1604 0.328139 14.1612 0.32654C14.174 0.288177 14.1772 0.246617 14.17 0.205058C14.1468 0.0699879 14.0182 -0.0195258 13.8823 0.00365186C13.8407 0.0116442 13.8024 0.028428 13.7712 0.0540033L12.578 1.00589L12.498 1.06982L10.6958 2.50844L9.85658 3.17819L9.8326 3.19737L9.6296 3.35961L9.45297 3.50028C9.2116 3.73925 9.08692 4.08931 9.15006 4.44976C9.15726 4.48813 9.16525 4.52649 9.17644 4.56325Z\" fill=\"#0C847B\"/>\n </svg>\n</ng-template>",
|
|
7730
|
+
styles: [".footer-content{display:-ms-flexbox;display:flex;-ms-flex-positive:0;flex-grow:0}.textarea-ia{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;gap:8px}.iassist-button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border:none;border-radius:50%;box-shadow:none;cursor:pointer;height:32px;width:32px}.dialog-header{display:-ms-flexbox;display:flex;gap:12px}.dialog-header .iassist-icon{display:block;height:24px;width:24px}"]
|
|
7731
|
+
})
|
|
7732
|
+
], TextAreaIAFieldComponent);
|
|
7733
|
+
return TextAreaIAFieldComponent;
|
|
7647
7734
|
}());
|
|
7648
7735
|
|
|
7649
|
-
var
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7736
|
+
var TextFieldComponent = /** @class */ (function (_super) {
|
|
7737
|
+
__extends(TextFieldComponent, _super);
|
|
7738
|
+
function TextFieldComponent() {
|
|
7739
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
7740
|
+
_this.onInput = new EventEmitter();
|
|
7741
|
+
_this.onFocus = new EventEmitter();
|
|
7742
|
+
_this.onComplete = new EventEmitter();
|
|
7743
|
+
_this.ngUnsubscribe = new Subject();
|
|
7744
|
+
return _this;
|
|
7656
7745
|
}
|
|
7657
|
-
|
|
7658
|
-
this.mouseUp.next(event);
|
|
7659
|
-
};
|
|
7660
|
-
LongPressDirective.prototype.onMouseDown = function (event) {
|
|
7661
|
-
this.mouseDown.next(event);
|
|
7662
|
-
};
|
|
7663
|
-
LongPressDirective.prototype.ngOnInit = function () {
|
|
7746
|
+
TextFieldComponent.prototype.ngOnInit = function () {
|
|
7664
7747
|
var _this = this;
|
|
7665
|
-
this.
|
|
7666
|
-
|
|
7667
|
-
|
|
7748
|
+
this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
7749
|
+
if (_this.field.onFocus)
|
|
7750
|
+
_this.field.onFocus(event);
|
|
7751
|
+
});
|
|
7752
|
+
this.onInput.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
7753
|
+
if (_this.field.onInput)
|
|
7754
|
+
_this.field.onInput(event);
|
|
7755
|
+
});
|
|
7756
|
+
this.onComplete.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
7757
|
+
if (_this.field.onComplete)
|
|
7758
|
+
_this.field.onComplete(event);
|
|
7759
|
+
});
|
|
7668
7760
|
};
|
|
7669
|
-
|
|
7761
|
+
TextFieldComponent.prototype.ngOnDestroy = function () {
|
|
7670
7762
|
this.ngUnsubscribe.next();
|
|
7671
7763
|
this.ngUnsubscribe.complete();
|
|
7672
7764
|
};
|
|
7673
7765
|
__decorate([
|
|
7674
7766
|
Input()
|
|
7675
|
-
],
|
|
7767
|
+
], TextFieldComponent.prototype, "field", void 0);
|
|
7768
|
+
__decorate([
|
|
7769
|
+
Input()
|
|
7770
|
+
], TextFieldComponent.prototype, "formControl", void 0);
|
|
7676
7771
|
__decorate([
|
|
7677
7772
|
Output()
|
|
7678
|
-
],
|
|
7773
|
+
], TextFieldComponent.prototype, "onInput", void 0);
|
|
7679
7774
|
__decorate([
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
], LongPressDirective.prototype, "onMouseUp", null);
|
|
7775
|
+
Output()
|
|
7776
|
+
], TextFieldComponent.prototype, "onFocus", void 0);
|
|
7683
7777
|
__decorate([
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7778
|
+
Output()
|
|
7779
|
+
], TextFieldComponent.prototype, "onComplete", void 0);
|
|
7780
|
+
TextFieldComponent = __decorate([
|
|
7781
|
+
Component({
|
|
7782
|
+
template: "<p-inputMask\n *ngIf=\"field.mask; else noMask\"\n [type]=\"field.inputType || 'text'\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [mask]=\"isFunction(field.mask) ? field.mask() : field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"onFocus.next($event)\"\n (onComplete)=\"onComplete.next($event)\"\n (onInput)=\"onInput.next($event)\"\n [formControl]=\"formControl\">\n</p-inputMask>\n<ng-template #noMask>\n <ng-container>\n <div class=\"ui-inputgroup\">\n <ng-container *ngIf=\"field.leftAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.leftAddon.label\">{{field.leftAddon.label}}</span>\n <span *ngIf=\"!field.leftAddon.label\" [ngClass]=\"field.leftAddon.icon\"></span>\n </span>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"field.keyFilter ? inputKeyFilter : input\"></ng-container>\n <ng-container *ngIf=\"field.rightAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.rightAddon.label\">{{field.rightAddon.label}}</span>\n <span *ngIf=\"!field.rightAddon.label\" [ngClass]=\"field.rightAddon.icon\"></span>\n </span>\n </ng-container>\n </div>\n </ng-container>\n</ng-template>\n<ng-template #input>\n <input\n [type]=\"field.inputType || 'text'\"\n [id]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n [maxLength]=\"field.maxLength\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n (input)=\"onInput.next($event)\"\n [formControl]=\"formControl\"\n [ngStyle]=\"field.style\" />\n</ng-template>\n<ng-template #inputKeyFilter>\n <input\n #inputText\n [type]=\"field.inputType || 'text'\"\n [id]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n [maxLength]=\"field.maxLength\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n (input)=\"onInput.next($event)\"\n [pKeyFilter]=\"field.keyFilter\"\n [formControl]=\"formControl\"\n [ngStyle]=\"field.style\" />\n</ng-template>\n",
|
|
7783
|
+
encapsulation: ViewEncapsulation.None,
|
|
7784
|
+
styles: ["s-text-field.ng-dirty.ng-invalid .ui-inputtext{border-color:#c13018}s-text-field.ng-dirty.ng-invalid .ui-inputtext:hover{border-color:#e44328}"]
|
|
7690
7785
|
})
|
|
7691
|
-
],
|
|
7692
|
-
return
|
|
7693
|
-
}());
|
|
7786
|
+
], TextFieldComponent);
|
|
7787
|
+
return TextFieldComponent;
|
|
7788
|
+
}(BaseFieldComponent));
|
|
7694
7789
|
|
|
7695
|
-
var
|
|
7696
|
-
function
|
|
7697
|
-
this.onDoubleClick = new EventEmitter();
|
|
7698
|
-
this._timeout = null;
|
|
7699
|
-
this._DOUBLE_CLICK_DELAY = 500;
|
|
7790
|
+
var RowComponent = /** @class */ (function () {
|
|
7791
|
+
function RowComponent() {
|
|
7700
7792
|
}
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
if (this._timeout) {
|
|
7707
|
-
this.clearTimeout();
|
|
7708
|
-
this.onDoubleClick.emit(event);
|
|
7709
|
-
}
|
|
7710
|
-
else {
|
|
7711
|
-
this._timeout = setTimeout(function () { return _this.clearTimeout(); }, this._DOUBLE_CLICK_DELAY);
|
|
7712
|
-
}
|
|
7793
|
+
RowComponent.prototype.ngOnInit = function () { };
|
|
7794
|
+
RowComponent.prototype.getErrorMessages = function (errorMessages) {
|
|
7795
|
+
if (errorMessages)
|
|
7796
|
+
return this.isFunction(errorMessages) ? errorMessages() : errorMessages;
|
|
7797
|
+
return this.errorMessages;
|
|
7713
7798
|
};
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
this._timeout = null;
|
|
7799
|
+
RowComponent.prototype.isFunction = function (value) {
|
|
7800
|
+
return value instanceof Function;
|
|
7717
7801
|
};
|
|
7718
7802
|
__decorate([
|
|
7719
|
-
|
|
7720
|
-
],
|
|
7803
|
+
Input()
|
|
7804
|
+
], RowComponent.prototype, "id", void 0);
|
|
7721
7805
|
__decorate([
|
|
7722
|
-
|
|
7723
|
-
],
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
}());
|
|
7750
|
-
|
|
7751
|
-
var PasswordStrengths;
|
|
7752
|
-
(function (PasswordStrengths) {
|
|
7753
|
-
PasswordStrengths["VeryWeak"] = "Very_weak";
|
|
7754
|
-
PasswordStrengths["Weak"] = "weak";
|
|
7755
|
-
PasswordStrengths["Medium"] = "medium";
|
|
7756
|
-
PasswordStrengths["Strong"] = "strong";
|
|
7757
|
-
})(PasswordStrengths || (PasswordStrengths = {}));
|
|
7758
|
-
|
|
7759
|
-
var PasswordStrengthPositions;
|
|
7760
|
-
(function (PasswordStrengthPositions) {
|
|
7761
|
-
PasswordStrengthPositions["Top"] = "top";
|
|
7762
|
-
PasswordStrengthPositions["Right"] = "right";
|
|
7763
|
-
PasswordStrengthPositions["Left"] = "left";
|
|
7764
|
-
})(PasswordStrengthPositions || (PasswordStrengthPositions = {}));
|
|
7765
|
-
|
|
7766
|
-
var PasswordStrengthComponent = /** @class */ (function () {
|
|
7767
|
-
function PasswordStrengthComponent() {
|
|
7768
|
-
this.weakTitle = "Fraca";
|
|
7769
|
-
this.mediumTitle = "Médio";
|
|
7770
|
-
this.strongTitle = "Forte";
|
|
7771
|
-
this.position = PasswordStrengthPositions.Right;
|
|
7772
|
-
this.left = 0;
|
|
7773
|
-
this.top = 0;
|
|
7774
|
-
this.visible = false;
|
|
7775
|
-
}
|
|
7776
|
-
PasswordStrengthComponent.prototype.ngOnInit = function () {
|
|
7777
|
-
this.title = this.weakTitle;
|
|
7778
|
-
};
|
|
7779
|
-
PasswordStrengthComponent.prototype.setPasswordStrengthPosition = function () {
|
|
7780
|
-
var passwordStrength = document.querySelector(".password-strength");
|
|
7781
|
-
switch (this.position) {
|
|
7782
|
-
case PasswordStrengthPositions.Top:
|
|
7783
|
-
passwordStrength.classList.add("password-strength--top");
|
|
7784
|
-
break;
|
|
7785
|
-
case PasswordStrengthPositions.Right:
|
|
7786
|
-
passwordStrength.classList.add("password-strength--right");
|
|
7787
|
-
break;
|
|
7788
|
-
case PasswordStrengthPositions.Left:
|
|
7789
|
-
passwordStrength.classList.add("password-strength--left");
|
|
7790
|
-
break;
|
|
7791
|
-
}
|
|
7792
|
-
};
|
|
7793
|
-
PasswordStrengthComponent.prototype.updateIndicators = function (passwordStrength) {
|
|
7794
|
-
var strengthIndicator1 = document.querySelector("#strength-indicator-1");
|
|
7795
|
-
var strengthIndicator2 = document.querySelector("#strength-indicator-2");
|
|
7796
|
-
var strengthIndicator3 = document.querySelector("#strength-indicator-3");
|
|
7797
|
-
var onIndicators = [];
|
|
7798
|
-
var indicators = [
|
|
7799
|
-
strengthIndicator1,
|
|
7800
|
-
strengthIndicator2,
|
|
7801
|
-
strengthIndicator3,
|
|
7802
|
-
];
|
|
7803
|
-
var strengthClass;
|
|
7804
|
-
switch (passwordStrength) {
|
|
7805
|
-
case PasswordStrengths.VeryWeak:
|
|
7806
|
-
this.title = this.weakTitle;
|
|
7807
|
-
break;
|
|
7808
|
-
case PasswordStrengths.Weak:
|
|
7809
|
-
this.title = this.weakTitle;
|
|
7810
|
-
strengthClass = "strength-indicator--weak";
|
|
7811
|
-
onIndicators.push(strengthIndicator1);
|
|
7812
|
-
break;
|
|
7813
|
-
case PasswordStrengths.Medium:
|
|
7814
|
-
this.title = this.mediumTitle;
|
|
7815
|
-
strengthClass = "strength-indicator--medium";
|
|
7816
|
-
onIndicators.push(strengthIndicator1);
|
|
7817
|
-
onIndicators.push(strengthIndicator2);
|
|
7818
|
-
break;
|
|
7819
|
-
case PasswordStrengths.Strong:
|
|
7820
|
-
this.title = this.strongTitle;
|
|
7821
|
-
strengthClass = "strength-indicator--strong";
|
|
7822
|
-
onIndicators.push(strengthIndicator1);
|
|
7823
|
-
onIndicators.push(strengthIndicator2);
|
|
7824
|
-
onIndicators.push(strengthIndicator3);
|
|
7825
|
-
break;
|
|
7826
|
-
}
|
|
7827
|
-
indicators.forEach(function (indicator) {
|
|
7828
|
-
indicator.classList.remove("strength-indicator--weak", "strength-indicator--medium", "strength-indicator--strong");
|
|
7829
|
-
});
|
|
7830
|
-
onIndicators.forEach(function (indicator) {
|
|
7831
|
-
indicator.classList.add(strengthClass);
|
|
7832
|
-
});
|
|
7806
|
+
Input()
|
|
7807
|
+
], RowComponent.prototype, "config", void 0);
|
|
7808
|
+
__decorate([
|
|
7809
|
+
Input()
|
|
7810
|
+
], RowComponent.prototype, "group", void 0);
|
|
7811
|
+
__decorate([
|
|
7812
|
+
Input()
|
|
7813
|
+
], RowComponent.prototype, "errorMessages", void 0);
|
|
7814
|
+
RowComponent = __decorate([
|
|
7815
|
+
Component({
|
|
7816
|
+
template: "\n <div class=\"ui-fluid\" [formGroup]=\"group\">\n <div class=\"ui-g\">\n <ng-container *ngFor=\"let field of config.fields\">\n <div [ngClass]=\"field.gridClass\" *ngIf=\"field.visible()\">\n <label\n [for]=\"field.name\"\n [ngClass]=\"{ 'required': field.required() }\"\n *sInfoSign=\"field.infoSign\"\n >\n {{ field.label }}\n </label>\n <ng-container *sDynamicForm=\"{ id: id, config: field, group: group}\"></ng-container>\n <s-control-errors [form]=\"group\" [control]=\"group.controls[field.name]\"\n [errorMessages]=\"getErrorMessages(field.errorMessages)\"></s-control-errors>\n <ng-template *ngIf=\"field?.bottomTemplate\" [ngTemplateOutlet]=\"field.bottomTemplate\"></ng-template>\n </div>\n </ng-container>\n </div>\n "
|
|
7817
|
+
})
|
|
7818
|
+
], RowComponent);
|
|
7819
|
+
return RowComponent;
|
|
7820
|
+
}());
|
|
7821
|
+
|
|
7822
|
+
var DynamicFieldComponent = /** @class */ (function () {
|
|
7823
|
+
function DynamicFieldComponent() {
|
|
7824
|
+
}
|
|
7825
|
+
DynamicFieldComponent.prototype.getErrorMessages = function (errorMessages) {
|
|
7826
|
+
if (errorMessages)
|
|
7827
|
+
return this.isFunction(errorMessages)
|
|
7828
|
+
? __assign(__assign({}, this.errorMessages), errorMessages()) : __assign(__assign({}, this.errorMessages), errorMessages);
|
|
7829
|
+
return this.errorMessages;
|
|
7830
|
+
};
|
|
7831
|
+
DynamicFieldComponent.prototype.isFunction = function (value) {
|
|
7832
|
+
return value instanceof Function;
|
|
7833
7833
|
};
|
|
7834
7834
|
__decorate([
|
|
7835
7835
|
Input()
|
|
7836
|
-
],
|
|
7836
|
+
], DynamicFieldComponent.prototype, "id", void 0);
|
|
7837
7837
|
__decorate([
|
|
7838
7838
|
Input()
|
|
7839
|
-
],
|
|
7839
|
+
], DynamicFieldComponent.prototype, "fields", void 0);
|
|
7840
7840
|
__decorate([
|
|
7841
7841
|
Input()
|
|
7842
|
-
],
|
|
7842
|
+
], DynamicFieldComponent.prototype, "form", void 0);
|
|
7843
7843
|
__decorate([
|
|
7844
7844
|
Input()
|
|
7845
|
-
],
|
|
7846
|
-
|
|
7845
|
+
], DynamicFieldComponent.prototype, "errorMessages", void 0);
|
|
7846
|
+
__decorate([
|
|
7847
|
+
Input()
|
|
7848
|
+
], DynamicFieldComponent.prototype, "displayTimeInfoSign", void 0);
|
|
7849
|
+
DynamicFieldComponent = __decorate([
|
|
7847
7850
|
Component({
|
|
7848
|
-
|
|
7849
|
-
|
|
7851
|
+
selector: "s-dynamic-field",
|
|
7852
|
+
template: "<div class=\"ui-fluid\" [formGroup]=\"form\">\n <div class=\"ui-g\">\n <ng-container *ngFor=\"let field of fields\">\n <div\n *ngIf=\"!field.visible || field.visible()\"\n [ngClass]=\"field.gridClass\">\n <span *ngIf=\"field.label\">\n <label\n *sInfoSign=\"field.infoSign; displayTime: displayTimeInfoSign\"\n [for]=\"field.name\"\n [ngClass]=\"{ 'required': field.required() }\">\n {{ field.label }}\n </label>\n </span>\n <ng-container *sDynamicForm=\"{\n id: id,\n config: field,\n group: form\n }\">\n </ng-container>\n <s-control-errors\n [form]=\"form\"\n [control]=\"form.controls[field.name]\"\n [errorMessages]=\"getErrorMessages(field.errorMessages)\">\n </s-control-errors>\n <ng-template\n *ngIf=\"field?.bottomTemplate\"\n [ngTemplateOutlet]=\"field.bottomTemplate\">\n </ng-template>\n </div>\n </ng-container>\n </div>\n</div>"
|
|
7850
7853
|
})
|
|
7851
|
-
],
|
|
7852
|
-
return
|
|
7854
|
+
], DynamicFieldComponent);
|
|
7855
|
+
return DynamicFieldComponent;
|
|
7853
7856
|
}());
|
|
7854
7857
|
|
|
7855
|
-
var
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7858
|
+
var GridType;
|
|
7859
|
+
(function (GridType) {
|
|
7860
|
+
GridType["Row"] = "Row";
|
|
7861
|
+
})(GridType || (GridType = {}));
|
|
7862
|
+
|
|
7863
|
+
var StructureType;
|
|
7864
|
+
(function (StructureType) {
|
|
7865
|
+
StructureType["Fieldset"] = "Fieldset";
|
|
7866
|
+
StructureType["Section"] = "Section";
|
|
7867
|
+
})(StructureType || (StructureType = {}));
|
|
7868
|
+
|
|
7869
|
+
var DynamicForm = /** @class */ (function () {
|
|
7870
|
+
function DynamicForm(_a) {
|
|
7871
|
+
var group = _a.group, errorMessages = _a.errorMessages;
|
|
7872
|
+
this.group = group;
|
|
7873
|
+
this.errorMessages = errorMessages;
|
|
7864
7874
|
}
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
var
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
}
|
|
7875
|
-
|
|
7876
|
-
|
|
7875
|
+
return DynamicForm;
|
|
7876
|
+
}());
|
|
7877
|
+
var DynamicField = /** @class */ (function (_super) {
|
|
7878
|
+
__extends(DynamicField, _super);
|
|
7879
|
+
function DynamicField(_a) {
|
|
7880
|
+
var group = _a.group, field = _a.field, errorMessages = _a.errorMessages;
|
|
7881
|
+
var _this = _super.call(this, {
|
|
7882
|
+
group: group,
|
|
7883
|
+
errorMessages: errorMessages,
|
|
7884
|
+
}) || this;
|
|
7885
|
+
_this.field = field;
|
|
7886
|
+
_this.setFieldPropertiesByType();
|
|
7887
|
+
return _this;
|
|
7888
|
+
}
|
|
7889
|
+
DynamicField.prototype.setFieldPropertiesByType = function () {
|
|
7890
|
+
if (this.field.type === FieldType.Integer || this.field.type === FieldType.Double) {
|
|
7891
|
+
this.field.numberLocaleOptions.currencySymbol = "";
|
|
7877
7892
|
}
|
|
7878
7893
|
};
|
|
7879
|
-
|
|
7880
|
-
this.
|
|
7894
|
+
DynamicField.prototype.createComponent = function (resolver, container) {
|
|
7895
|
+
var componentFactory = resolver.resolveComponentFactory(this.getComponent());
|
|
7896
|
+
var component = container.createComponent(componentFactory);
|
|
7897
|
+
component.instance.field = this.field;
|
|
7898
|
+
// Must be this way because some teams use name like "e070emp.codemp"
|
|
7899
|
+
component.instance.formControl = this.group["controls"][this.field.name];
|
|
7900
|
+
component.instance.errorMessages = this.errorMessages;
|
|
7901
|
+
this.setVariablesByType(component);
|
|
7902
|
+
return component;
|
|
7881
7903
|
};
|
|
7882
|
-
|
|
7883
|
-
if (this.
|
|
7884
|
-
|
|
7885
|
-
this.componentRef = componentFactory.create(this.injector);
|
|
7886
|
-
this.appRef.attachView(this.componentRef.hostView);
|
|
7887
|
-
var domElem = this.componentRef.hostView.rootNodes[0];
|
|
7888
|
-
document.body.appendChild(domElem);
|
|
7889
|
-
this.setPasswordStrengthComponentProperties();
|
|
7890
|
-
this.showPasswordStrength();
|
|
7904
|
+
DynamicField.prototype.setVariablesByType = function (component) {
|
|
7905
|
+
if (this.field.type == FieldType.Time) {
|
|
7906
|
+
component.instance.timeOnly = true;
|
|
7891
7907
|
}
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
if (this.componentRef !== null) {
|
|
7895
|
-
this.componentRef.instance.visible = true;
|
|
7908
|
+
if ([FieldType.LocalDateTime, FieldType.DateTime, FieldType.Time].includes(this.field.type)) {
|
|
7909
|
+
component.instance.showTime = true;
|
|
7896
7910
|
}
|
|
7897
7911
|
};
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
var leftShift = left;
|
|
7948
|
-
if (leftShift <= elementRefWidth + safeSpace) {
|
|
7949
|
-
this.position = PasswordStrengthPositions.Top;
|
|
7950
|
-
invalidOptions.push(PasswordStrengthPositions.Left);
|
|
7951
|
-
break;
|
|
7952
|
-
}
|
|
7953
|
-
this.componentRef.instance.top = Math.round(top_1 + elementRefHeight / 2);
|
|
7954
|
-
this.componentRef.instance.left = Math.round(left - margin);
|
|
7955
|
-
positioned = true;
|
|
7956
|
-
break;
|
|
7957
|
-
}
|
|
7958
|
-
default: {
|
|
7959
|
-
break;
|
|
7960
|
-
}
|
|
7961
|
-
}
|
|
7962
|
-
this.componentRef.instance.position = this.position;
|
|
7963
|
-
}
|
|
7912
|
+
DynamicField.prototype.updateVariables = function (component) {
|
|
7913
|
+
component.instance.field = this.field;
|
|
7914
|
+
component.instance.formControl = this.group["controls"][this.field.name];
|
|
7915
|
+
this.setVariablesByType(component);
|
|
7916
|
+
};
|
|
7917
|
+
DynamicField.prototype.getComponent = function () {
|
|
7918
|
+
switch (this.field.type) {
|
|
7919
|
+
case FieldType.Autocomplete:
|
|
7920
|
+
return AutocompleteFieldComponent;
|
|
7921
|
+
case FieldType.Binary:
|
|
7922
|
+
case FieldType.String:
|
|
7923
|
+
return TextFieldComponent;
|
|
7924
|
+
case FieldType.Boolean:
|
|
7925
|
+
return this.field.representedBy === "switch" ? BooleanSwitchFieldComponent : BooleanFieldComponent;
|
|
7926
|
+
case FieldType.Chips:
|
|
7927
|
+
return ChipsFieldComponent;
|
|
7928
|
+
case FieldType.CountryPhonePicker:
|
|
7929
|
+
return CountryPhonePickerFieldComponent;
|
|
7930
|
+
case FieldType.Date:
|
|
7931
|
+
case FieldType.DateTime:
|
|
7932
|
+
case FieldType.LocalDateTime:
|
|
7933
|
+
case FieldType.Time:
|
|
7934
|
+
return CalendarFieldComponent;
|
|
7935
|
+
case FieldType.Number:
|
|
7936
|
+
case FieldType.Integer:
|
|
7937
|
+
case FieldType.Double:
|
|
7938
|
+
return BignumberFieldComponent;
|
|
7939
|
+
case FieldType.Enum:
|
|
7940
|
+
return SelectFieldComponent;
|
|
7941
|
+
case FieldType.Lookup:
|
|
7942
|
+
return LookupFieldComponent;
|
|
7943
|
+
case FieldType.Money:
|
|
7944
|
+
return CurrencyFieldComponent;
|
|
7945
|
+
case FieldType.Radio:
|
|
7946
|
+
return RadioButtonComponent;
|
|
7947
|
+
case FieldType.Text:
|
|
7948
|
+
return TextAreaFieldComponent;
|
|
7949
|
+
case FieldType.TextIA:
|
|
7950
|
+
return TextAreaIAFieldComponent;
|
|
7951
|
+
case FieldType.Password:
|
|
7952
|
+
return PasswordFieldComponent;
|
|
7953
|
+
case FieldType.Blob:
|
|
7954
|
+
return FileUploadComponent$1;
|
|
7955
|
+
case FieldType.Slider:
|
|
7956
|
+
return SliderFieldComponent;
|
|
7957
|
+
case FieldType.Custom:
|
|
7958
|
+
return this.field.CustomFieldComponentClass;
|
|
7959
|
+
default:
|
|
7960
|
+
throw new Error("Trying to use an unsupported type (" + this.field.type + ").");
|
|
7964
7961
|
}
|
|
7965
7962
|
};
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7963
|
+
return DynamicField;
|
|
7964
|
+
}(DynamicForm));
|
|
7965
|
+
var DynamicStructure = /** @class */ (function (_super) {
|
|
7966
|
+
__extends(DynamicStructure, _super);
|
|
7967
|
+
function DynamicStructure(_a) {
|
|
7968
|
+
var group = _a.group, config = _a.config, errorMessages = _a.errorMessages;
|
|
7969
|
+
var _this = _super.call(this, {
|
|
7970
|
+
group: group,
|
|
7971
|
+
errorMessages: errorMessages,
|
|
7972
|
+
}) || this;
|
|
7973
|
+
_this.config = config;
|
|
7974
|
+
return _this;
|
|
7975
|
+
}
|
|
7976
|
+
DynamicStructure.prototype.createComponent = function (resolver, container) {
|
|
7977
|
+
var componentFactory = resolver.resolveComponentFactory(this.getComponent());
|
|
7978
|
+
var component = container.createComponent(componentFactory);
|
|
7979
|
+
component.instance.config = this.config;
|
|
7980
|
+
component.instance.group = this.group;
|
|
7981
|
+
return component;
|
|
7982
|
+
};
|
|
7983
|
+
DynamicStructure.prototype.updateVariables = function (component) {
|
|
7984
|
+
component.instance.structure = this.config;
|
|
7985
|
+
component.instance.group = this.group;
|
|
7971
7986
|
};
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7987
|
+
DynamicStructure.prototype.getComponent = function () {
|
|
7988
|
+
switch (this.config.type) {
|
|
7989
|
+
case StructureType.Fieldset:
|
|
7990
|
+
return FieldsetComponent;
|
|
7991
|
+
case StructureType.Section:
|
|
7992
|
+
return SectionComponent;
|
|
7993
|
+
default:
|
|
7994
|
+
throw new Error("Trying to use an unsupported type (" + this.config.type + ").");
|
|
7977
7995
|
}
|
|
7978
7996
|
};
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7997
|
+
return DynamicStructure;
|
|
7998
|
+
}(DynamicForm));
|
|
7999
|
+
var DynamicGrid = /** @class */ (function (_super) {
|
|
8000
|
+
__extends(DynamicGrid, _super);
|
|
8001
|
+
function DynamicGrid(_a) {
|
|
8002
|
+
var group = _a.group, config = _a.config, errorMessages = _a.errorMessages;
|
|
8003
|
+
var _this = _super.call(this, { group: group, errorMessages: errorMessages }) || this;
|
|
8004
|
+
_this.config = config;
|
|
8005
|
+
return _this;
|
|
8006
|
+
}
|
|
8007
|
+
DynamicGrid.prototype.createComponent = function (resolver, container) {
|
|
8008
|
+
var componentFactory = resolver.resolveComponentFactory(this.getComponent());
|
|
8009
|
+
var component = container.createComponent(componentFactory);
|
|
8010
|
+
component.instance.config = this.config;
|
|
8011
|
+
component.instance.group = this.group;
|
|
8012
|
+
component.instance.errorMessages = this.errorMessages;
|
|
8013
|
+
return component;
|
|
8014
|
+
};
|
|
8015
|
+
DynamicGrid.prototype.updateVariables = function (component) {
|
|
8016
|
+
component.instance.config = this.config;
|
|
8017
|
+
component.instance.group = this.group;
|
|
8018
|
+
};
|
|
8019
|
+
DynamicGrid.prototype.getComponent = function () {
|
|
8020
|
+
switch (this.config.type) {
|
|
8021
|
+
case GridType.Row:
|
|
8022
|
+
return RowComponent;
|
|
8023
|
+
default:
|
|
8024
|
+
throw new Error("Trying to use an unsupported type (" + this.config.type + ").");
|
|
7989
8025
|
}
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
8026
|
+
};
|
|
8027
|
+
return DynamicGrid;
|
|
8028
|
+
}(DynamicForm));
|
|
8029
|
+
|
|
8030
|
+
var DynamicFormDirective = /** @class */ (function () {
|
|
8031
|
+
function DynamicFormDirective(resolver, container) {
|
|
8032
|
+
this.resolver = resolver;
|
|
8033
|
+
this.container = container;
|
|
8034
|
+
}
|
|
8035
|
+
Object.defineProperty(DynamicFormDirective.prototype, "sDynamicForm", {
|
|
8036
|
+
set: function (context) {
|
|
8037
|
+
var id = context.id, config = context.config, group = context.group, errorMessages = context.errorMessages;
|
|
8038
|
+
this.id = id;
|
|
8039
|
+
this.config = config;
|
|
8040
|
+
this.group = group;
|
|
8041
|
+
this.errorMessages = errorMessages;
|
|
8042
|
+
},
|
|
8043
|
+
enumerable: true,
|
|
8044
|
+
configurable: true
|
|
8045
|
+
});
|
|
8046
|
+
DynamicFormDirective.prototype.ngOnInit = function () {
|
|
8047
|
+
if (this.isField()) {
|
|
8048
|
+
if (!(this.config.id) && this.id) {
|
|
8049
|
+
this.config.id = this.id + "-" + this.config.name;
|
|
7993
8050
|
}
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
8051
|
+
this.directiveConfig = new DynamicField({
|
|
8052
|
+
group: this.group,
|
|
8053
|
+
field: this.config,
|
|
8054
|
+
errorMessages: this.errorMessages,
|
|
8055
|
+
});
|
|
7997
8056
|
}
|
|
7998
|
-
else if (
|
|
7999
|
-
|
|
8057
|
+
else if (this.isStructure()) {
|
|
8058
|
+
this.directiveConfig = new DynamicStructure({
|
|
8059
|
+
group: this.group,
|
|
8060
|
+
config: this.config,
|
|
8061
|
+
errorMessages: this.errorMessages,
|
|
8062
|
+
});
|
|
8000
8063
|
}
|
|
8001
|
-
else if (
|
|
8002
|
-
|
|
8064
|
+
else if (this.isGrid()) {
|
|
8065
|
+
this.directiveConfig = new DynamicGrid({
|
|
8066
|
+
group: this.group,
|
|
8067
|
+
config: this.config,
|
|
8068
|
+
errorMessages: this.errorMessages,
|
|
8069
|
+
});
|
|
8003
8070
|
}
|
|
8004
|
-
else
|
|
8005
|
-
|
|
8071
|
+
else
|
|
8072
|
+
throw new Error("Trying to use an unsupported type (" + this.config.type + ").");
|
|
8073
|
+
this.component = this.directiveConfig.createComponent(this.resolver, this.container);
|
|
8074
|
+
this.component.instance.id = this.id;
|
|
8075
|
+
this.component.instance.errorMessages = this.errorMessages;
|
|
8076
|
+
};
|
|
8077
|
+
DynamicFormDirective.prototype.ngOnChanges = function () {
|
|
8078
|
+
if (this.component) {
|
|
8079
|
+
this.directiveConfig.updateVariables(this.component);
|
|
8080
|
+
this.component.instance.errorMessages = this.errorMessages;
|
|
8006
8081
|
}
|
|
8007
8082
|
};
|
|
8008
|
-
|
|
8009
|
-
|
|
8010
|
-
|
|
8083
|
+
DynamicFormDirective.prototype.isField = function () {
|
|
8084
|
+
return FieldType[this.config.type];
|
|
8085
|
+
};
|
|
8086
|
+
DynamicFormDirective.prototype.isStructure = function () {
|
|
8087
|
+
return StructureType[this.config.type];
|
|
8088
|
+
};
|
|
8089
|
+
DynamicFormDirective.prototype.isGrid = function () {
|
|
8090
|
+
return GridType[this.config.type];
|
|
8091
|
+
};
|
|
8092
|
+
DynamicFormDirective.ctorParameters = function () { return [
|
|
8011
8093
|
{ type: ComponentFactoryResolver },
|
|
8012
|
-
{ type:
|
|
8094
|
+
{ type: ViewContainerRef }
|
|
8013
8095
|
]; };
|
|
8014
8096
|
__decorate([
|
|
8015
|
-
Input(
|
|
8016
|
-
],
|
|
8017
|
-
__decorate([
|
|
8018
|
-
Input("psValidation")
|
|
8019
|
-
], PasswordStrengthDirective.prototype, "validation", void 0);
|
|
8020
|
-
__decorate([
|
|
8021
|
-
Input("psPosition")
|
|
8022
|
-
], PasswordStrengthDirective.prototype, "position", void 0);
|
|
8023
|
-
__decorate([
|
|
8024
|
-
Input("psWeakTitle")
|
|
8025
|
-
], PasswordStrengthDirective.prototype, "weakTitle", void 0);
|
|
8026
|
-
__decorate([
|
|
8027
|
-
Input("psMediumTitle")
|
|
8028
|
-
], PasswordStrengthDirective.prototype, "mediumTitle", void 0);
|
|
8029
|
-
__decorate([
|
|
8030
|
-
Input("psStrongTitle")
|
|
8031
|
-
], PasswordStrengthDirective.prototype, "strongTitle", void 0);
|
|
8032
|
-
__decorate([
|
|
8033
|
-
Input("psDescription")
|
|
8034
|
-
], PasswordStrengthDirective.prototype, "description", void 0);
|
|
8035
|
-
__decorate([
|
|
8036
|
-
HostListener("keyup"),
|
|
8037
|
-
HostListener("focus")
|
|
8038
|
-
], PasswordStrengthDirective.prototype, "onFocus", null);
|
|
8097
|
+
Input()
|
|
8098
|
+
], DynamicFormDirective.prototype, "sDynamicForm", null);
|
|
8039
8099
|
__decorate([
|
|
8040
|
-
|
|
8041
|
-
],
|
|
8042
|
-
|
|
8043
|
-
Directive({
|
|
8044
|
-
|
|
8045
|
-
|
|
8046
|
-
], PasswordStrengthDirective);
|
|
8047
|
-
return PasswordStrengthDirective;
|
|
8048
|
-
}());
|
|
8049
|
-
|
|
8050
|
-
var PasswordStrengthModule = /** @class */ (function () {
|
|
8051
|
-
function PasswordStrengthModule() {
|
|
8052
|
-
}
|
|
8053
|
-
PasswordStrengthModule = __decorate([
|
|
8054
|
-
NgModule({
|
|
8055
|
-
imports: [CommonModule],
|
|
8056
|
-
declarations: [
|
|
8057
|
-
PasswordStrengthComponent,
|
|
8058
|
-
PasswordStrengthDirective,
|
|
8059
|
-
],
|
|
8060
|
-
exports: [PasswordStrengthDirective],
|
|
8061
|
-
})
|
|
8062
|
-
], PasswordStrengthModule);
|
|
8063
|
-
return PasswordStrengthModule;
|
|
8100
|
+
Input("sDynamicFormDisplayTimeInfoSign")
|
|
8101
|
+
], DynamicFormDirective.prototype, "displayTimeInfoSign", void 0);
|
|
8102
|
+
DynamicFormDirective = __decorate([
|
|
8103
|
+
Directive({ selector: "[sDynamicForm]" })
|
|
8104
|
+
], DynamicFormDirective);
|
|
8105
|
+
return DynamicFormDirective;
|
|
8064
8106
|
}());
|
|
8065
8107
|
|
|
8066
8108
|
var DynamicFormModule = /** @class */ (function () {
|
|
@@ -8069,36 +8111,36 @@ var DynamicFormModule = /** @class */ (function () {
|
|
|
8069
8111
|
DynamicFormModule = __decorate([
|
|
8070
8112
|
NgModule({
|
|
8071
8113
|
imports: [
|
|
8072
|
-
CommonModule,
|
|
8073
|
-
FormsModule,
|
|
8074
|
-
ReactiveFormsModule,
|
|
8075
|
-
TooltipModule,
|
|
8076
|
-
InputTextModule,
|
|
8077
|
-
CheckboxModule,
|
|
8078
|
-
CalendarModule,
|
|
8079
|
-
InputMaskModule,
|
|
8080
|
-
DropdownModule,
|
|
8081
|
-
NumberInputModule,
|
|
8082
|
-
BignumberInputModule,
|
|
8083
|
-
LocalizedNumberInputModule,
|
|
8084
|
-
ControlErrorsModule,
|
|
8085
|
-
LocaleModule,
|
|
8086
8114
|
AutoCompleteModule,
|
|
8087
|
-
|
|
8088
|
-
ButtonModule$1,
|
|
8115
|
+
BignumberInputModule,
|
|
8089
8116
|
ButtonModule,
|
|
8090
|
-
|
|
8117
|
+
CalendarMaskModule,
|
|
8118
|
+
CalendarModule,
|
|
8119
|
+
CheckboxModule,
|
|
8120
|
+
ChipsModule,
|
|
8121
|
+
CommonModule,
|
|
8122
|
+
ControlErrorsModule,
|
|
8123
|
+
CountryPhonePickerModule,
|
|
8091
8124
|
DialogModule,
|
|
8092
|
-
|
|
8093
|
-
TableModule$1,
|
|
8125
|
+
DropdownModule,
|
|
8094
8126
|
EmptyStateModule,
|
|
8095
|
-
|
|
8127
|
+
FormsModule,
|
|
8096
8128
|
HotkeyModule,
|
|
8097
|
-
|
|
8098
|
-
CalendarMaskModule,
|
|
8129
|
+
InputMaskModule,
|
|
8099
8130
|
InputTextareaModule,
|
|
8100
|
-
|
|
8131
|
+
InputTextModule,
|
|
8101
8132
|
KeyFilterModule,
|
|
8133
|
+
LoadingStateModule,
|
|
8134
|
+
LocaleModule,
|
|
8135
|
+
LocalizedNumberInputModule,
|
|
8136
|
+
PanelModule$1,
|
|
8137
|
+
ButtonModule$1,
|
|
8138
|
+
TableModule$1,
|
|
8139
|
+
MultiSelectModule,
|
|
8140
|
+
NumberInputModule,
|
|
8141
|
+
RadioButtonModule,
|
|
8142
|
+
ReactiveFormsModule,
|
|
8143
|
+
TooltipModule,
|
|
8102
8144
|
FieldsetModule,
|
|
8103
8145
|
TableHeaderCheckboxModule,
|
|
8104
8146
|
FileUploadModule,
|
|
@@ -8114,52 +8156,54 @@ var DynamicFormModule = /** @class */ (function () {
|
|
|
8114
8156
|
],
|
|
8115
8157
|
declarations: [
|
|
8116
8158
|
AutocompleteFieldComponent,
|
|
8159
|
+
BignumberFieldComponent,
|
|
8117
8160
|
BooleanFieldComponent,
|
|
8161
|
+
BooleanSwitchFieldComponent,
|
|
8118
8162
|
CalendarFieldComponent,
|
|
8119
8163
|
ChipsFieldComponent,
|
|
8164
|
+
CountryPhonePickerFieldComponent,
|
|
8120
8165
|
CurrencyFieldComponent,
|
|
8121
|
-
DynamicFormComponent,
|
|
8122
8166
|
DynamicFieldComponent,
|
|
8167
|
+
DynamicFormComponent,
|
|
8123
8168
|
DynamicFormDirective,
|
|
8124
8169
|
FieldsetComponent,
|
|
8125
8170
|
FileUploadComponent$1,
|
|
8126
8171
|
LookupComponent,
|
|
8127
8172
|
LookupFieldComponent,
|
|
8128
8173
|
NumberFieldComponent,
|
|
8129
|
-
|
|
8174
|
+
PasswordFieldComponent,
|
|
8130
8175
|
RadioButtonComponent,
|
|
8131
8176
|
RowComponent,
|
|
8132
8177
|
SectionComponent,
|
|
8133
8178
|
SelectFieldComponent,
|
|
8179
|
+
SliderFieldComponent,
|
|
8134
8180
|
TextAreaFieldComponent,
|
|
8135
8181
|
TextAreaIAFieldComponent,
|
|
8136
8182
|
TextFieldComponent,
|
|
8137
|
-
BooleanSwitchFieldComponent,
|
|
8138
|
-
PasswordFieldComponent,
|
|
8139
|
-
SliderFieldComponent,
|
|
8140
8183
|
],
|
|
8141
8184
|
exports: [DynamicFormComponent, LookupComponent],
|
|
8142
8185
|
entryComponents: [
|
|
8143
8186
|
AutocompleteFieldComponent,
|
|
8187
|
+
BignumberFieldComponent,
|
|
8144
8188
|
BooleanFieldComponent,
|
|
8189
|
+
BooleanSwitchFieldComponent,
|
|
8145
8190
|
CalendarFieldComponent,
|
|
8146
8191
|
ChipsFieldComponent,
|
|
8192
|
+
CountryPhonePickerFieldComponent,
|
|
8147
8193
|
CurrencyFieldComponent,
|
|
8148
8194
|
FieldsetComponent,
|
|
8149
8195
|
FileUploadComponent$1,
|
|
8150
8196
|
LookupFieldComponent,
|
|
8151
8197
|
NumberFieldComponent,
|
|
8152
|
-
|
|
8198
|
+
PasswordFieldComponent,
|
|
8153
8199
|
RadioButtonComponent,
|
|
8154
8200
|
RowComponent,
|
|
8155
8201
|
SectionComponent,
|
|
8156
8202
|
SelectFieldComponent,
|
|
8203
|
+
SliderFieldComponent,
|
|
8157
8204
|
TextAreaFieldComponent,
|
|
8158
8205
|
TextAreaIAFieldComponent,
|
|
8159
8206
|
TextFieldComponent,
|
|
8160
|
-
PasswordFieldComponent,
|
|
8161
|
-
BooleanSwitchFieldComponent,
|
|
8162
|
-
SliderFieldComponent,
|
|
8163
8207
|
],
|
|
8164
8208
|
providers: [
|
|
8165
8209
|
HotkeysService,
|
|
@@ -15492,6 +15536,10 @@ var PanelModule = /** @class */ (function () {
|
|
|
15492
15536
|
}());
|
|
15493
15537
|
|
|
15494
15538
|
var fallback = {
|
|
15539
|
+
"platform.angular_components.attach_files": "Anexar arquivos",
|
|
15540
|
+
"platform.angular_components.remove": "Remover",
|
|
15541
|
+
"platform.angular_components.file_attached_successfully": "Arquivo anexado com sucesso",
|
|
15542
|
+
"platform.angular_components.loading_file": "Carregando arquivo",
|
|
15495
15543
|
"platform.angular_components.iassist_text_generator": "IAssist Gerador de texto",
|
|
15496
15544
|
"platform.angular_components.copied_to_clipboard": "Copiado para área de transferência",
|
|
15497
15545
|
"platform.angular_components.copy_field_content": "Copiar conteúdo preenchido",
|
|
@@ -15738,5 +15786,5 @@ var fallback = {
|
|
|
15738
15786
|
* Generated bundle index. Do not edit.
|
|
15739
15787
|
*/
|
|
15740
15788
|
|
|
15741
|
-
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, GanttComponent, GanttModule, 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, RatingScaleComponent, RatingScaleModule, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, SlidePanelComponent, SlidePanelModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, SwitchComponent, SwitchModule, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TieredMenuDirective, TieredMenuModule, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, ViewMode, WorkspaceSwitchComponent, WorkspaceSwitchModule, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb,
|
|
15789
|
+
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, GanttComponent, GanttModule, 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, RatingScaleComponent, RatingScaleModule, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, SlidePanelComponent, SlidePanelModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, SwitchComponent, SwitchModule, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TieredMenuDirective, TieredMenuModule, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, ViewMode, WorkspaceSwitchComponent, WorkspaceSwitchModule, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, RadioButtonComponent as ɵba, RowComponent as ɵbb, SectionComponent as ɵbc, SelectFieldComponent as ɵbd, SliderFieldComponent as ɵbe, TextAreaFieldComponent as ɵbf, TextAreaIAFieldComponent as ɵbg, IAssistService as ɵbh, TextFieldComponent as ɵbi, DecimalField as ɵbk, SideTableComponent as ɵbl, StructureModule as ɵbm, HeaderComponent as ɵbn, FooterComponent as ɵbo, NumberLocaleOptions as ɵbp, ThumbnailService as ɵbq, BorderButtonModule as ɵbr, BorderButtonComponent as ɵbs, TimelineItemModule as ɵbt, TimelineIconItemComponent as ɵbu, HorizontalTimelineModule as ɵbv, HorizontalTimelineComponent as ɵbw, VerticalTimelineModule as ɵbx, VerticalTimelineComponent as ɵby, RangeLineComponent as ɵbz, CountryPhonePickerService as ɵc, CollapseOptionComponent as ɵca, CollapsedItemsComponent as ɵcb, VerticalItemsComponent as ɵcc, InfiniteScrollModule as ɵcd, InfiniteScrollDirective as ɵce, CustomTranslationsModule as ɵcf, CodeEditorComponent as ɵcg, CoreFacade as ɵch, CodeMirror6Core as ɵci, TieredMenuEventService as ɵcj, TieredMenuService as ɵck, TieredMenuComponent as ɵcl, TieredMenuNestedComponent as ɵcm, TieredMenuItemComponent as ɵcn, TieredMenuDividerComponent as ɵco, 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, BignumberFieldComponent as ɵm, BooleanFieldComponent as ɵn, BooleanSwitchFieldComponent as ɵo, CalendarFieldComponent as ɵp, ChipsFieldComponent as ɵq, CountryPhonePickerFieldComponent as ɵr, CurrencyFieldComponent as ɵs, DynamicFieldComponent as ɵt, DynamicFormDirective as ɵu, FieldsetComponent as ɵv, FileUploadComponent$1 as ɵw, LookupFieldComponent as ɵx, NumberFieldComponent as ɵy, PasswordFieldComponent as ɵz };
|
|
15742
15790
|
//# sourceMappingURL=seniorsistemas-angular-components.js.map
|