@updevs/components 1.0.0-alpha.1 → 1.0.0-alpha.100
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/README.md +1 -24
- package/assets/styles/_bootstrap-components.scss +55 -0
- package/assets/styles/_bootstrap-config.scss +7 -0
- package/assets/styles/_bootstrap-override.scss +78 -0
- package/assets/styles/_config.scss +9 -0
- package/assets/styles/_core.scss +80 -0
- package/assets/styles/_debug.scss +49 -0
- package/assets/styles/_mixins.scss +2 -0
- package/assets/styles/_props.scss +91 -0
- package/assets/styles/_seven-columns.scss +73 -0
- package/assets/styles/_updevs.scss +25 -0
- package/assets/styles/_utilities-marketing.scss +209 -0
- package/assets/styles/_utilities.scss +133 -0
- package/assets/styles/_variables-dark.scss +19 -0
- package/assets/styles/_variables.scss +1003 -0
- package/assets/styles/fonts/_webfonts.scss +15 -0
- package/assets/styles/helpers/_index.scss +143 -0
- package/assets/styles/layout/_animations.scss +62 -0
- package/assets/styles/layout/_core.scss +62 -0
- package/assets/styles/layout/_dark.scss +77 -0
- package/assets/styles/layout/_footer.scss +12 -0
- package/assets/styles/layout/_navbar.scss +392 -0
- package/assets/styles/layout/_page.scss +170 -0
- package/assets/styles/layout/_root.scss +64 -0
- package/assets/styles/marketing/_browser.scss +67 -0
- package/assets/styles/marketing/_core.scss +8 -0
- package/assets/styles/marketing/_filters.scss +0 -0
- package/assets/styles/marketing/_hero.scss +70 -0
- package/assets/styles/marketing/_pricing.scss +111 -0
- package/assets/styles/marketing/_sections.scss +124 -0
- package/assets/styles/marketing/_shape.scss +31 -0
- package/assets/styles/mixins/_functions.scss +96 -0
- package/assets/styles/mixins/_mixins.scss +68 -0
- package/assets/styles/ui/_accordion.scss +178 -0
- package/assets/styles/ui/_alerts.scss +101 -0
- package/assets/styles/ui/_avatars.scss +145 -0
- package/assets/styles/ui/_badges.scss +113 -0
- package/assets/styles/ui/_breadcrumbs.scss +50 -0
- package/assets/styles/ui/_button-group.scss +16 -0
- package/assets/styles/ui/_buttons.scss +261 -0
- package/assets/styles/ui/_calendars.scss +104 -0
- package/assets/styles/ui/_cards.scss +595 -0
- package/assets/styles/ui/_carousel.scss +68 -0
- package/assets/styles/ui/_charts.scss +61 -0
- package/assets/styles/ui/_chat.scss +38 -0
- package/assets/styles/ui/_chips.scss +0 -0
- package/assets/styles/ui/_close.scss +60 -0
- package/assets/styles/ui/_datagrid.scss +17 -0
- package/assets/styles/ui/_dropdowns.scss +120 -0
- package/assets/styles/ui/_empty.scss +60 -0
- package/assets/styles/ui/_flags.scss +31 -0
- package/assets/styles/ui/_forms.scss +250 -0
- package/assets/styles/ui/_grid.scss +115 -0
- package/assets/styles/ui/_icons.scss +72 -0
- package/assets/styles/ui/_images.scss +19 -0
- package/assets/styles/ui/_legend.scss +12 -0
- package/assets/styles/ui/_lists.scss +123 -0
- package/assets/styles/ui/_loaders.scss +72 -0
- package/assets/styles/ui/_login.scss +3 -0
- package/assets/styles/ui/_markdown.scss +53 -0
- package/assets/styles/ui/_modals.scss +67 -0
- package/assets/styles/ui/_nav.scss +106 -0
- package/assets/styles/ui/_offcanvas.scss +17 -0
- package/assets/styles/ui/_pagination.scss +58 -0
- package/assets/styles/ui/_payments.scss +28 -0
- package/assets/styles/ui/_placeholder.scss +9 -0
- package/assets/styles/ui/_popovers.scss +2 -0
- package/assets/styles/ui/_progress.scss +107 -0
- package/assets/styles/ui/_ribbons.scss +157 -0
- package/assets/styles/ui/_segmented.scss +101 -0
- package/assets/styles/ui/_signature.scss +15 -0
- package/assets/styles/ui/_social.scss +52 -0
- package/assets/styles/ui/_stars.scss +13 -0
- package/assets/styles/ui/_status.scss +163 -0
- package/assets/styles/ui/_steps.scss +156 -0
- package/assets/styles/ui/_switch-icon.scss +211 -0
- package/assets/styles/ui/_tables.scss +176 -0
- package/assets/styles/ui/_tags.scss +57 -0
- package/assets/styles/ui/_timeline.scss +61 -0
- package/assets/styles/ui/_toasts.scss +18 -0
- package/assets/styles/ui/_toolbar.scss +10 -0
- package/assets/styles/ui/_tracking.scss +29 -0
- package/assets/styles/ui/_type.scss +330 -0
- package/assets/styles/ui/forms/_form-check.scss +91 -0
- package/assets/styles/ui/forms/_form-colorinput.scss +54 -0
- package/assets/styles/ui/forms/_form-custom.scss +28 -0
- package/assets/styles/ui/forms/_form-icon.scss +35 -0
- package/assets/styles/ui/forms/_form-imagecheck.scss +105 -0
- package/assets/styles/ui/forms/_form-selectgroup.scss +153 -0
- package/assets/styles/ui/forms/_validation.scss +13 -0
- package/assets/styles/ui/typo/_hr.scss +76 -0
- package/assets/styles/utils/_background.scss +15 -0
- package/assets/styles/utils/_colors.scss +101 -0
- package/assets/styles/utils/_opacity.scss +7 -0
- package/assets/styles/utils/_scroll.scss +45 -0
- package/assets/styles/utils/_shadow.scss +17 -0
- package/assets/styles/utils/_sizing.scss +10 -0
- package/assets/styles/utils/_text.scss +14 -0
- package/assets/styles/vendor/_apexcharts.scss +52 -0
- package/assets/styles/vendor/_coloris.scss +72 -0
- package/assets/styles/vendor/_dropzone.scss +27 -0
- package/assets/styles/vendor/_fslightbox.scss +13 -0
- package/assets/styles/vendor/_jsvectormap.scss +47 -0
- package/assets/styles/vendor/_litepicker.scss +69 -0
- package/assets/styles/vendor/_nouislider.scss +49 -0
- package/assets/styles/vendor/_plyr.scss +3 -0
- package/assets/styles/vendor/_stars-rating.scss +22 -0
- package/assets/styles/vendor/_tom-select.scss +81 -0
- package/assets/styles/vendor/_turbo.scss +3 -0
- package/assets/styles/vendor/_typed.scss +4 -0
- package/assets/styles/vendor/_wysiwyg.scss +46 -0
- package/fesm2022/updevs-components-badge.mjs +89 -0
- package/fesm2022/updevs-components-badge.mjs.map +1 -0
- package/fesm2022/updevs-components-button.mjs +193 -0
- package/fesm2022/updevs-components-button.mjs.map +1 -0
- package/fesm2022/updevs-components-calendar.mjs +582 -0
- package/fesm2022/updevs-components-calendar.mjs.map +1 -0
- package/fesm2022/updevs-components-card.mjs +242 -0
- package/fesm2022/updevs-components-card.mjs.map +1 -0
- package/fesm2022/updevs-components-drag-and-drop.mjs +185 -0
- package/fesm2022/updevs-components-drag-and-drop.mjs.map +1 -0
- package/fesm2022/updevs-components-dropdown.mjs +247 -0
- package/fesm2022/updevs-components-dropdown.mjs.map +1 -0
- package/fesm2022/updevs-components-form-controls-abstractions.mjs +106 -0
- package/fesm2022/updevs-components-form-controls-abstractions.mjs.map +1 -0
- package/fesm2022/updevs-components-form-controls-checkbox.mjs +99 -0
- package/fesm2022/updevs-components-form-controls-checkbox.mjs.map +1 -0
- package/fesm2022/updevs-components-form-controls-date-picker.mjs +175 -0
- package/fesm2022/updevs-components-form-controls-date-picker.mjs.map +1 -0
- package/fesm2022/updevs-components-form-controls-file-upload.mjs +272 -0
- package/fesm2022/updevs-components-form-controls-file-upload.mjs.map +1 -0
- package/fesm2022/updevs-components-form-controls-input.mjs +281 -0
- package/fesm2022/updevs-components-form-controls-input.mjs.map +1 -0
- package/fesm2022/updevs-components-form-controls-radio.mjs +98 -0
- package/fesm2022/updevs-components-form-controls-radio.mjs.map +1 -0
- package/fesm2022/updevs-components-form-controls-select.mjs +600 -0
- package/fesm2022/updevs-components-form-controls-select.mjs.map +1 -0
- package/fesm2022/updevs-components-form-controls-textarea.mjs +79 -0
- package/fesm2022/updevs-components-form-controls-textarea.mjs.map +1 -0
- package/fesm2022/updevs-components-form-controls-time-picker.mjs +345 -0
- package/fesm2022/updevs-components-form-controls-time-picker.mjs.map +1 -0
- package/fesm2022/updevs-components-form.mjs +562 -0
- package/fesm2022/updevs-components-form.mjs.map +1 -0
- package/fesm2022/updevs-components-layout.mjs +1054 -0
- package/fesm2022/updevs-components-layout.mjs.map +1 -0
- package/fesm2022/updevs-components-link.mjs +79 -0
- package/fesm2022/updevs-components-link.mjs.map +1 -0
- package/fesm2022/updevs-components-list.mjs +215 -0
- package/fesm2022/updevs-components-list.mjs.map +1 -0
- package/fesm2022/updevs-components-modal.mjs +505 -0
- package/fesm2022/updevs-components-modal.mjs.map +1 -0
- package/fesm2022/updevs-components-paginator.mjs +160 -0
- package/fesm2022/updevs-components-paginator.mjs.map +1 -0
- package/fesm2022/updevs-components-popover.mjs +215 -0
- package/fesm2022/updevs-components-popover.mjs.map +1 -0
- package/fesm2022/updevs-components-pricing.mjs +130 -0
- package/fesm2022/updevs-components-pricing.mjs.map +1 -0
- package/fesm2022/updevs-components-table.mjs +2060 -0
- package/fesm2022/updevs-components-table.mjs.map +1 -0
- package/fesm2022/updevs-components.mjs +33 -0
- package/fesm2022/updevs-components.mjs.map +1 -0
- package/package.json +127 -14
- package/types/updevs-components-badge.d.ts +44 -0
- package/types/updevs-components-button.d.ts +75 -0
- package/types/updevs-components-calendar.d.ts +175 -0
- package/types/updevs-components-card.d.ts +92 -0
- package/types/updevs-components-drag-and-drop.d.ts +74 -0
- package/types/updevs-components-dropdown.d.ts +124 -0
- package/types/updevs-components-form-controls-abstractions.d.ts +49 -0
- package/types/updevs-components-form-controls-checkbox.d.ts +33 -0
- package/types/updevs-components-form-controls-date-picker.d.ts +80 -0
- package/types/updevs-components-form-controls-file-upload.d.ts +69 -0
- package/types/updevs-components-form-controls-input.d.ts +95 -0
- package/types/updevs-components-form-controls-radio.d.ts +32 -0
- package/types/updevs-components-form-controls-select.d.ts +200 -0
- package/types/updevs-components-form-controls-textarea.d.ts +31 -0
- package/types/updevs-components-form-controls-time-picker.d.ts +164 -0
- package/types/updevs-components-form.d.ts +356 -0
- package/types/updevs-components-layout.d.ts +490 -0
- package/types/updevs-components-link.d.ts +34 -0
- package/types/updevs-components-list.d.ts +107 -0
- package/types/updevs-components-modal.d.ts +155 -0
- package/types/updevs-components-paginator.d.ts +58 -0
- package/types/updevs-components-popover.d.ts +63 -0
- package/types/updevs-components-pricing.d.ts +91 -0
- package/types/updevs-components-table.d.ts +619 -0
- package/types/updevs-components.d.ts +44 -0
- package/CHANGELOG.md +0 -8
- package/ng-package.json +0 -7
- package/src/lib/components.component.spec.ts +0 -23
- package/src/lib/components.component.ts +0 -14
- package/src/lib/components.module.ts +0 -17
- package/src/lib/components.service.spec.ts +0 -16
- package/src/lib/components.service.ts +0 -9
- package/src/public-api.ts +0 -7
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injectable, EventEmitter, input, computed, effect, Output, HostBinding, Component, model, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1$1 from '@angular/forms';
|
|
4
|
+
import { Validators, FormGroup, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { TextService, UpdSdkModule } from '@updevs/sdk';
|
|
6
|
+
import { BaseComponent } from '@updevs/sdk/layout';
|
|
7
|
+
import { startWith } from 'rxjs';
|
|
8
|
+
import * as i1 from '@updevs/components/button';
|
|
9
|
+
import { UpdButtonModule } from '@updevs/components/button';
|
|
10
|
+
import * as i1$2 from '@jsverse/transloco';
|
|
11
|
+
import { TranslocoDirective } from '@jsverse/transloco';
|
|
12
|
+
import { ColumnSizeHelper } from '@updevs/components';
|
|
13
|
+
import * as i5 from '@updevs/components/form-controls/select';
|
|
14
|
+
import { Defaults, UpdSelectModule } from '@updevs/components/form-controls/select';
|
|
15
|
+
import * as i2 from '@updevs/components/form-controls/input';
|
|
16
|
+
import { UpdInputModule } from '@updevs/components/form-controls/input';
|
|
17
|
+
import * as i3 from '@updevs/components/form-controls/checkbox';
|
|
18
|
+
import { UpdCheckboxModule } from '@updevs/components/form-controls/checkbox';
|
|
19
|
+
import * as i4 from '@updevs/components/form-controls/radio';
|
|
20
|
+
import { UpdRadioModule } from '@updevs/components/form-controls/radio';
|
|
21
|
+
import * as i6 from '@updevs/components/form-controls/textarea';
|
|
22
|
+
import { UpdTextareaModule } from '@updevs/components/form-controls/textarea';
|
|
23
|
+
import * as i7 from '@updevs/components/form-controls/file-upload';
|
|
24
|
+
import { UpdFileUploadModule } from '@updevs/components/form-controls/file-upload';
|
|
25
|
+
import { CommonModule } from '@angular/common';
|
|
26
|
+
import { UpdDatePickerModule } from '@updevs/components/form-controls/date-picker';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* How a parent field influences its child.
|
|
30
|
+
**/
|
|
31
|
+
var AttachmentTypeEnum;
|
|
32
|
+
(function (AttachmentTypeEnum) {
|
|
33
|
+
/**
|
|
34
|
+
* Enable / disable behaviour (default).
|
|
35
|
+
**/
|
|
36
|
+
AttachmentTypeEnum["Disabled"] = "disabled";
|
|
37
|
+
/**
|
|
38
|
+
* Child waits for the parent to have a value and (re)loads afterwards.
|
|
39
|
+
**/
|
|
40
|
+
AttachmentTypeEnum["ParentLoad"] = "parentLoad";
|
|
41
|
+
})(AttachmentTypeEnum || (AttachmentTypeEnum = {}));
|
|
42
|
+
|
|
43
|
+
var DynamicFieldType;
|
|
44
|
+
(function (DynamicFieldType) {
|
|
45
|
+
DynamicFieldType[DynamicFieldType["Input"] = 1] = "Input";
|
|
46
|
+
DynamicFieldType[DynamicFieldType["Select"] = 2] = "Select";
|
|
47
|
+
DynamicFieldType[DynamicFieldType["SelectMultiple"] = 3] = "SelectMultiple";
|
|
48
|
+
DynamicFieldType[DynamicFieldType["Label"] = 4] = "Label";
|
|
49
|
+
DynamicFieldType[DynamicFieldType["Checkbox"] = 5] = "Checkbox";
|
|
50
|
+
DynamicFieldType[DynamicFieldType["CheckboxGroup"] = 6] = "CheckboxGroup";
|
|
51
|
+
DynamicFieldType[DynamicFieldType["Radio"] = 7] = "Radio";
|
|
52
|
+
DynamicFieldType[DynamicFieldType["RadioGroup"] = 8] = "RadioGroup";
|
|
53
|
+
DynamicFieldType[DynamicFieldType["TextArea"] = 9] = "TextArea";
|
|
54
|
+
DynamicFieldType[DynamicFieldType["FileUpload"] = 10] = "FileUpload";
|
|
55
|
+
DynamicFieldType[DynamicFieldType["MaskedInput"] = 11] = "MaskedInput";
|
|
56
|
+
DynamicFieldType[DynamicFieldType["Button"] = 12] = "Button";
|
|
57
|
+
DynamicFieldType[DynamicFieldType["ButtonGroup"] = 13] = "ButtonGroup";
|
|
58
|
+
})(DynamicFieldType || (DynamicFieldType = {}));
|
|
59
|
+
|
|
60
|
+
class ErrorsHelper {
|
|
61
|
+
constructor() {
|
|
62
|
+
this.errors = {
|
|
63
|
+
'required': { text: 'UpDevs.Form.ErrorMessages.Required' },
|
|
64
|
+
'requiredTrue': { text: 'UpDevs.Form.ErrorMessages.RequiredTrue' },
|
|
65
|
+
'generic': { text: 'UpDevs.Form.ErrorMessages.Generic' },
|
|
66
|
+
'email': { text: 'UpDevs.Form.ErrorMessages.Email' },
|
|
67
|
+
'max': { text: 'UpDevs.Form.ErrorMessages.Max', defaultErrorParamToShow: 'max' },
|
|
68
|
+
'min': { text: 'UpDevs.Form.ErrorMessages.Min', defaultErrorParamToShow: 'min' },
|
|
69
|
+
'maxlength': { text: 'UpDevs.Form.ErrorMessages.MaxLength', defaultErrorParamToShow: 'requiredLength' },
|
|
70
|
+
'minlength': { text: 'UpDevs.Form.ErrorMessages.MinLength', defaultErrorParamToShow: 'requiredLength' }
|
|
71
|
+
};
|
|
72
|
+
this.textService = inject(TextService);
|
|
73
|
+
}
|
|
74
|
+
getMessages(control, customConfig) {
|
|
75
|
+
if (!control.errors) {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
const errorMessages = [];
|
|
79
|
+
const genericText = this.textService.getText({ text: this.errors['generic'].text, isTranslated: false });
|
|
80
|
+
const combinedErrorMessagesList = Object.assign({}, this.errors, customConfig || {});
|
|
81
|
+
const controlErrorKeys = Object.keys(control.errors);
|
|
82
|
+
controlErrorKeys.forEach(key => {
|
|
83
|
+
const customError = !!control.errors ? control.errors[key] : undefined;
|
|
84
|
+
if (!!customError?.errorText) {
|
|
85
|
+
errorMessages.push(this.textService.getText(customError.errorText));
|
|
86
|
+
}
|
|
87
|
+
else if (key in combinedErrorMessagesList) {
|
|
88
|
+
const config = combinedErrorMessagesList[key];
|
|
89
|
+
let params;
|
|
90
|
+
if (config.showLength) {
|
|
91
|
+
params = { value: control.value?.length || 0 };
|
|
92
|
+
}
|
|
93
|
+
if (!!config.defaultErrorParamToShow) {
|
|
94
|
+
params = { value: control.errors[key][config.defaultErrorParamToShow] };
|
|
95
|
+
}
|
|
96
|
+
errorMessages.push(this.textService.getText({ text: config.text, isTranslated: false }, params));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
if (controlErrorKeys.length > 0 && errorMessages.length < 1) {
|
|
100
|
+
errorMessages.push(genericText);
|
|
101
|
+
}
|
|
102
|
+
return errorMessages;
|
|
103
|
+
}
|
|
104
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ErrorsHelper, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
105
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ErrorsHelper }); }
|
|
106
|
+
}
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ErrorsHelper, decorators: [{
|
|
108
|
+
type: Injectable
|
|
109
|
+
}] });
|
|
110
|
+
|
|
111
|
+
class DynamicFieldComponent extends BaseComponent {
|
|
112
|
+
get hostClasses() {
|
|
113
|
+
return this.wrapperClasses();
|
|
114
|
+
}
|
|
115
|
+
get formControl() {
|
|
116
|
+
return this.formGroup().controls[this.field().name];
|
|
117
|
+
}
|
|
118
|
+
get inputField() {
|
|
119
|
+
return this.field();
|
|
120
|
+
}
|
|
121
|
+
get checkboxField() {
|
|
122
|
+
return this.field();
|
|
123
|
+
}
|
|
124
|
+
get checkboxGroupField() {
|
|
125
|
+
return this.field();
|
|
126
|
+
}
|
|
127
|
+
get radioField() {
|
|
128
|
+
return this.field();
|
|
129
|
+
}
|
|
130
|
+
get radioGroupField() {
|
|
131
|
+
return this.field();
|
|
132
|
+
}
|
|
133
|
+
get selectField() {
|
|
134
|
+
return this.field();
|
|
135
|
+
}
|
|
136
|
+
get singleSelectField() {
|
|
137
|
+
return this.field();
|
|
138
|
+
}
|
|
139
|
+
get textareaField() {
|
|
140
|
+
return this.field();
|
|
141
|
+
}
|
|
142
|
+
get fileUploadField() {
|
|
143
|
+
return this.field();
|
|
144
|
+
}
|
|
145
|
+
get maskedField() {
|
|
146
|
+
return this.field();
|
|
147
|
+
}
|
|
148
|
+
get buttonField() {
|
|
149
|
+
return this.field();
|
|
150
|
+
}
|
|
151
|
+
get buttonGroupField() {
|
|
152
|
+
return this.field();
|
|
153
|
+
}
|
|
154
|
+
get checkboxGroupOptionsKeys() {
|
|
155
|
+
return Object.keys(this.checkboxGroupField.options);
|
|
156
|
+
}
|
|
157
|
+
get radioGroupOptionsKeys() {
|
|
158
|
+
return Object.keys(this.radioGroupField.options);
|
|
159
|
+
}
|
|
160
|
+
get fileNameControl() {
|
|
161
|
+
return !!this.fileUploadField.fileNameFormProperty
|
|
162
|
+
? this.formGroup().controls[this.fileUploadField.fileNameFormProperty]
|
|
163
|
+
: undefined;
|
|
164
|
+
}
|
|
165
|
+
constructor() {
|
|
166
|
+
super();
|
|
167
|
+
this.submitForm = new EventEmitter();
|
|
168
|
+
this.DynamicFieldType = DynamicFieldType;
|
|
169
|
+
this.SelectDefaults = Defaults;
|
|
170
|
+
this.formGroup = input.required(...(ngDevMode ? [{ debugName: "formGroup" }] : []));
|
|
171
|
+
this.field = input.required(...(ngDevMode ? [{ debugName: "field" }] : []));
|
|
172
|
+
this.layout = input.required(...(ngDevMode ? [{ debugName: "layout" }] : []));
|
|
173
|
+
this.validationStatusDescriptions = [];
|
|
174
|
+
this.textService = inject(TextService);
|
|
175
|
+
this.wrapperClasses = computed(() => {
|
|
176
|
+
const isVisible = this.field().isVisible?.() ?? true;
|
|
177
|
+
const columnClasses = ColumnSizeHelper.getSizeClasses(this.field().colSize);
|
|
178
|
+
return `${columnClasses} ${isVisible ? '' : 'd-none'}`;
|
|
179
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClasses" }] : []));
|
|
180
|
+
this.errorsHelper = inject(ErrorsHelper);
|
|
181
|
+
effect(() => {
|
|
182
|
+
const control = this.formControl;
|
|
183
|
+
const isVisible = this.field().isVisible?.() ?? true;
|
|
184
|
+
// If a field is not visible, we should remove its validators and restore if it becomes visible again.
|
|
185
|
+
if (!!control) {
|
|
186
|
+
if (isVisible) {
|
|
187
|
+
const fieldConfig = this.field();
|
|
188
|
+
const originalValidators = fieldConfig.validators || [];
|
|
189
|
+
const finalValidators = [...originalValidators];
|
|
190
|
+
if (fieldConfig.isRequired && !originalValidators.includes(Validators.required)) {
|
|
191
|
+
finalValidators.push(Validators.required);
|
|
192
|
+
}
|
|
193
|
+
control.setValidators(finalValidators);
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
control.clearValidators();
|
|
197
|
+
}
|
|
198
|
+
control.updateValueAndValidity({ emitEvent: false });
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
ngOnInit() {
|
|
203
|
+
if (!!this.formControl) {
|
|
204
|
+
const statusSub = this.formControl.statusChanges.subscribe(status => {
|
|
205
|
+
this.updateValidationDisplay();
|
|
206
|
+
this.field().onValidationStatusChanged?.(status);
|
|
207
|
+
});
|
|
208
|
+
const valueSub = this.formControl.valueChanges.subscribe(value => this.field().onValueChanged?.(value));
|
|
209
|
+
this.addSubscriptions(statusSub, valueSub);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
onBlur() {
|
|
213
|
+
if (!!this.formControl) {
|
|
214
|
+
this.formControl.markAsTouched();
|
|
215
|
+
this.updateValidationDisplay();
|
|
216
|
+
this.field().onBlur?.();
|
|
217
|
+
this.field().onTouched?.();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
onFocus() {
|
|
221
|
+
this.field().onFocus?.();
|
|
222
|
+
}
|
|
223
|
+
onInput(event) {
|
|
224
|
+
const value = event.target?.value;
|
|
225
|
+
this.field().onInput?.(value);
|
|
226
|
+
}
|
|
227
|
+
setControlValue(value) {
|
|
228
|
+
this.formControl.setValue(value);
|
|
229
|
+
this.formControl.markAsDirty();
|
|
230
|
+
}
|
|
231
|
+
getText(textModel) {
|
|
232
|
+
return this.textService.getText(textModel);
|
|
233
|
+
}
|
|
234
|
+
getOptionDescription(key, type) {
|
|
235
|
+
return type === 'checkbox' ?
|
|
236
|
+
this.checkboxGroupField.options[key] : this.radioGroupField.options[key];
|
|
237
|
+
}
|
|
238
|
+
handleFileSelected(event) {
|
|
239
|
+
this.formControl.setValue(!!this.fileUploadField.saveAsDataUrl ? event?.dataUrl : event?.file);
|
|
240
|
+
this.formControl.markAsDirty();
|
|
241
|
+
if (!!this.fileUploadField.fileNameFormProperty) {
|
|
242
|
+
this.fileNameControl.setValue(event?.file.name);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
onInputEnter() {
|
|
246
|
+
if (!!this.inputField.shouldSubmitOnEnter) {
|
|
247
|
+
this.submitForm.next();
|
|
248
|
+
}
|
|
249
|
+
this.field().onEnter?.();
|
|
250
|
+
}
|
|
251
|
+
updateValidationDisplay() {
|
|
252
|
+
if (this.formControl && this.formControl.invalid && this.formControl.touched) {
|
|
253
|
+
this.validationStatusDescriptions = this.errorsHelper.getMessages(this.formControl)
|
|
254
|
+
.map(t => ({ text: t, isTranslated: true }));
|
|
255
|
+
this.validationStatus = 'invalid';
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
this.validationStatusDescriptions = [];
|
|
259
|
+
this.validationStatus = this.field().showValidStatus && this.formControl?.touched ? 'valid' : undefined;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: DynamicFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
263
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.4", type: DynamicFieldComponent, isStandalone: false, selector: "upd-dynamic-field", inputs: { formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null }, field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { submitForm: "submitForm" }, host: { properties: { "class": "this.hostClasses" } }, usesInheritance: true, ngImport: i0, template: "@switch (field().type) {\n @case (DynamicFieldType.Input) {\n <upd-input [name]=\"field().name\" [label]=\"field().label\" [placeholder]=\"field().placeholder\" [hint]=\"field().hint\"\n [hintAsTooltip]=\"field().hintAsTooltip || false\" [validationStatus]=\"validationStatus\"\n [validationStatusDescriptions]=\"validationStatusDescriptions\" [layout]=\"layout()\" [isDisabled]=\"field().isDisabled || false\"\n [type]=\"inputField.inputType || 'text'\" [labelColSize]=\"field().labelColSize\" [value]=\"formControl.value\"\n (valueChange)=\"setControlValue($event)\" (blurred)=\"onBlur()\" (keyUpEnter)=\"onInputEnter()\" (focus)=\"onFocus()\"\n (input)=\"onInput($event)\">\n @if (!!inputField.prefix) {\n <ng-template updInputPrepend>\n {{ textService.getText(inputField.prefix) }}\n </ng-template>\n }\n\n @if (!!inputField.suffix) {\n <ng-template updInputAppend>\n {{ textService.getText(inputField.suffix) }}\n </ng-template>\n }\n </upd-input>\n }\n @case (DynamicFieldType.Checkbox) {\n <upd-checkbox [name]=\"field().name\" [label]=\"field().label\" [hint]=\"field().hint\" [hintAsTooltip]=\"field().hintAsTooltip || false\"\n [validationStatus]=\"validationStatus\" [validationStatusDescriptions]=\"validationStatusDescriptions\" [value]=\"true\"\n [isDisabled]=\"field().isDisabled || false\" [isChecked]=\"formControl.value\" [isInline]=\"checkboxField.isInline || false\"\n [isSwitch]=\"checkboxField.isSwitch || false\" (changed)=\"setControlValue($event)\" (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"></upd-checkbox>\n }\n @case (DynamicFieldType.CheckboxGroup) {\n @if (!!field().label) {\n <label class=\"form-label\">{{ getText(field().label) }}</label>\n }\n\n @for (option of checkboxGroupOptionsKeys; track option) {\n <upd-checkbox [name]=\"field().name\" [label]=\"getOptionDescription(option, 'checkbox')\" [hint]=\"field().hint\"\n [hintAsTooltip]=\"field().hintAsTooltip || false\" [validationStatus]=\"validationStatus\"\n [validationStatusDescriptions]=\"validationStatusDescriptions\" [value]=\"option\" [isDisabled]=\"field().isDisabled || false\"\n [isChecked]=\"formControl.value\" [isInline]=\"checkboxField.isInline || false\" [isSwitch]=\"checkboxField.isSwitch || false\"\n (changed)=\"setControlValue(option)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"></upd-checkbox>\n }\n }\n @case (DynamicFieldType.Radio) {\n <upd-radio [name]=\"field().name\" [label]=\"field().label\" [hint]=\"field().hint\" [hintAsTooltip]=\"field().hintAsTooltip || false\"\n [validationStatus]=\"validationStatus\" [validationStatusDescriptions]=\"validationStatusDescriptions\" [value]=\"true\"\n [isChecked]=\"formControl.value\" [isDisabled]=\"field().isDisabled || false\" [isInline]=\"radioField.isInline || false\"\n (selected)=\"setControlValue($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\">\n </upd-radio>\n }\n @case (DynamicFieldType.RadioGroup) {\n @if (!!field().label) {\n <label class=\"form-label\">{{ getText(field().label) }}</label>\n }\n\n @for (option of radioGroupOptionsKeys; track option) {\n <upd-radio [name]=\"field().name\" [label]=\"getOptionDescription(option, 'radio')\" [hint]=\"field().hint\"\n [hintAsTooltip]=\"field().hintAsTooltip || false\" [validationStatus]=\"validationStatus\"\n [validationStatusDescriptions]=\"validationStatusDescriptions\" [value]=\"option\" [isDisabled]=\"field().isDisabled || false\"\n [isChecked]=\"formControl.value\" [isInline]=\"checkboxField.isInline || false\"\n (selected)=\"setControlValue(option)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"></upd-radio>\n }\n }\n @case (DynamicFieldType.Select) {\n <upd-select [name]=\"field().name\" [label]=\"field().label\" [hint]=\"field().hint\" [hintAsTooltip]=\"field().hintAsTooltip || false\"\n [validationStatus]=\"validationStatus\" [validationStatusDescriptions]=\"validationStatusDescriptions\"\n [useSystemStyle]=\"singleSelectField.useSystemStyle || false\" [isDisabled]=\"field().isDisabled || false\"\n [items]=\"selectField.items\" [layout]=\"layout()\" [labelColSize]=\"field().labelColSize\" [store]=\"selectField.store!\"\n [observable]=\"selectField.observable\" [itemKey]=\"selectField.itemKey\" [itemValue]=\"selectField.itemValue\"\n [dropdownMaxHeight]=\"selectField.dropdownMaxHeight || SelectDefaults.dropdownMaxHeight\"\n [typeaheadDebounce]=\"selectField.typeaheadDebounce || SelectDefaults.typeaheadDebounce\"\n [shouldAutoSearch]=\"selectField.shouldAutoSearch || SelectDefaults.shouldAutoSearch\"\n [shouldCloseOnOutsideClick]=\"selectField.shouldCloseOnOutsideClick || SelectDefaults.shouldCloseOnOutsideClick\"\n [shouldTruncateSelectedText]=\"selectField.shouldTruncateSelectedText\" [parentValue]=\"selectField.parentValue\"\n [value]=\"formControl.value\" (selectedItem)=\"setControlValue($event?.value)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"></upd-select>\n }\n @case (DynamicFieldType.SelectMultiple) {\n <upd-select-multiple [name]=\"field().name\" [label]=\"field().label\" [hint]=\"field().hint\"\n [hintAsTooltip]=\"field().hintAsTooltip || false\" [validationStatus]=\"validationStatus\"\n [validationStatusDescriptions]=\"validationStatusDescriptions\" [isDisabled]=\"field().isDisabled || false\"\n [items]=\"selectField.items\" [layout]=\"layout()\" [labelColSize]=\"field().labelColSize\" [store]=\"selectField.store!\"\n [observable]=\"selectField.observable\" [itemKey]=\"selectField.itemKey\" [itemValue]=\"selectField.itemValue\"\n [dropdownMaxHeight]=\"selectField.dropdownMaxHeight || SelectDefaults.dropdownMaxHeight\"\n [typeaheadDebounce]=\"selectField.typeaheadDebounce || SelectDefaults.typeaheadDebounce\"\n [shouldAutoSearch]=\"selectField.shouldAutoSearch || SelectDefaults.shouldAutoSearch\" [parentValue]=\"selectField.parentValue\"\n [shouldCloseOnOutsideClick]=\"selectField.shouldCloseOnOutsideClick || SelectDefaults.shouldCloseOnOutsideClick\"\n [selectedValues]=\"formControl.value\" (selectedIds)=\"setControlValue($event)\" (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"></upd-select-multiple>\n }\n @case (DynamicFieldType.Label) {\n <label class=\"form-label\">{{ getText(field().label) }}</label>\n }\n @case (DynamicFieldType.TextArea) {\n <upd-textarea [name]=\"field().name\" [label]=\"field().label\" [placeholder]=\"field().placeholder\" [hint]=\"field().hint\"\n [hintAsTooltip]=\"field().hintAsTooltip || false\" [validationStatus]=\"validationStatus\"\n [validationStatusDescriptions]=\"validationStatusDescriptions\" [isDisabled]=\"field().isDisabled || false\"\n [value]=\"formControl.value\" [customClasses]=\"textareaField.customClasses\" [wrapperClasses]=\"textareaField.wrapperClasses\"\n [maxLength]=\"textareaField.maxLength\" [rows]=\"textareaField.rows\"\n [displayCharactersCount]=\"textareaField.displayCharactersCount || false\" (valueChange)=\"setControlValue($event)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (input)=\"onInput($event)\" (keydown.enter)=\"onInputEnter()\">\n </upd-textarea>\n }\n @case (DynamicFieldType.FileUpload) {\n <upd-file-upload [name]=\"field().name\" [label]=\"field().label\" [hint]=\"field().hint\" [isDisabled]=\"field().isDisabled || false\"\n [hintAsTooltip]=\"field().hintAsTooltip || false\" [validationStatus]=\"validationStatus\" [fileName]=\"fileNameControl?.value\"\n [validationStatusDescriptions]=\"validationStatusDescriptions\" [allowFilesDrop]=\"fileUploadField.allowFilesDrop || false\"\n [title]=\"fileUploadField.title\" [labelColSize]=\"field().labelColSize\" [minFileSize]=\"fileUploadField.minFileSize\"\n [isMultiple]=\"fileUploadField.isMultiple || false\" [allowedExtensions]=\"fileUploadField.allowedExtensions || '*'\"\n [maxFileSize]=\"fileUploadField.maxFileSize\" [layout]=\"layout()\" (fileChanged)=\"handleFileSelected($event)\" (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"></upd-file-upload>\n }\n @case (DynamicFieldType.MaskedInput) {\n <upd-input [name]=\"field().name\" [label]=\"field().label\" [placeholder]=\"field().placeholder\" [hint]=\"field().hint\"\n [hintAsTooltip]=\"field().hintAsTooltip || false\" [validationStatus]=\"validationStatus\" [mask]=\"maskedField.mask\"\n [maskConfig]=\"maskedField.maskConfig\" [validationStatusDescriptions]=\"validationStatusDescriptions\" [layout]=\"layout()\"\n [isDisabled]=\"field().isDisabled || false\" [type]=\"inputField.inputType || 'text'\" [labelColSize]=\"field().labelColSize\"\n [value]=\"formControl.value\" (valueChange)=\"setControlValue($event)\" (blurred)=\"onBlur()\" (keyUpEnter)=\"onInputEnter()\"\n (focus)=\"onFocus()\" (input)=\"onInput($event)\">\n @if (!!inputField.prefix) {\n <ng-template updInputPrepend>\n {{ textService.getText(inputField.prefix) }}\n </ng-template>\n }\n\n @if (!!inputField.suffix) {\n <ng-template updInputAppend>\n {{ textService.getText(inputField.suffix) }}\n </ng-template>\n }\n </upd-input>\n }\n @case (DynamicFieldType.Button) {\n <upd-button [text]=\"field().label\" [isDisabled]=\"field().isDisabled || false\" [model]=\"buttonField.model\" />\n }\n @case (DynamicFieldType.ButtonGroup) {\n @if (!!field().label) {\n <label class=\"form-label\">{{ getText(field().label) }}</label>\n }\n\n <div class=\"btn-group\" role=\"group\">\n @for (btn of buttonGroupField.buttons; track btn) {\n <upd-button [model]=\"btn\" [isDisabled]=\"field().isDisabled || false\" />\n }\n </div>\n }\n}\n", styles: [""], dependencies: [{ kind: "component", type: i1.ButtonComponent, selector: "upd-button", inputs: ["model", "text", "brandColorStyle", "customClasses", "isOutline", "isGhost", "isSquare", "isPill", "isIcon", "isLoading", "isList", "isFloating", "isAction", "isNavigationLink", "isLink", "shouldIgnoreBtnClass", "iconModel", "iconPosition", "isDisabled", "isActive", "badgeConfig", "colorStyle", "size", "title", "stopPropagation"], outputs: ["clicked"] }, { kind: "component", type: i2.InputComponent, selector: "upd-input", inputs: ["type", "mask", "maskConfig", "value", "size", "customClasses", "wrapperClasses", "maxLength", "isPlainText", "isReadOnly", "isLoading", "isRound", "isFlush", "isInputGroupFlat", "isPrependButton", "isAppendButton", "isFloating", "loaderPosition", "prependIconModel", "appendIconModel", "isValidationStatusLight", "layout"], outputs: ["valueChange", "blurred", "keyDown", "keyDownEsc", "keyUpEnter"] }, { kind: "directive", type: i2.InputAppendDirective, selector: "ng-template[updInputAppend]" }, { kind: "directive", type: i2.InputPrependDirective, selector: "ng-template[updInputPrepend]" }, { kind: "component", type: i3.CheckboxComponent, selector: "upd-checkbox", inputs: ["wrapperClasses", "value", "customClasses", "isChecked", "isInline", "isSwitch", "isIndeterminate"], outputs: ["changed", "isCheckedChange", "isIndeterminateChange"] }, { kind: "component", type: i4.RadioComponent, selector: "upd-radio", inputs: ["wrapperClasses", "value", "customClasses", "isChecked", "isInline"], outputs: ["selected"] }, { kind: "component", type: i5.SelectComponent, selector: "upd-select", inputs: ["useSystemStyle", "shouldShowClearButton", "shouldTruncateSelectedText", "isCompact", "value"], outputs: ["valueChange", "selectedItem"] }, { kind: "component", type: i5.SelectMultipleComponent, selector: "upd-select-multiple", inputs: ["selectedValues"], outputs: ["selectedItems", "selectedIds"] }, { kind: "component", type: i6.TextareaComponent, selector: "upd-textarea", inputs: ["value", "customClasses", "wrapperClasses", "maxLength", "rows", "displayCharactersCount"], outputs: ["valueChange"] }, { kind: "component", type: i7.FileUploadComponent, selector: "upd-file-upload", inputs: ["fileName", "title", "allowFilesDrop", "isMultiple", "allowedExtensions", "minFileSize", "maxFileSize", "layout"], outputs: ["fileChanged"] }] }); }
|
|
264
|
+
}
|
|
265
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: DynamicFieldComponent, decorators: [{
|
|
266
|
+
type: Component,
|
|
267
|
+
args: [{ standalone: false, selector: 'upd-dynamic-field', template: "@switch (field().type) {\n @case (DynamicFieldType.Input) {\n <upd-input [name]=\"field().name\" [label]=\"field().label\" [placeholder]=\"field().placeholder\" [hint]=\"field().hint\"\n [hintAsTooltip]=\"field().hintAsTooltip || false\" [validationStatus]=\"validationStatus\"\n [validationStatusDescriptions]=\"validationStatusDescriptions\" [layout]=\"layout()\" [isDisabled]=\"field().isDisabled || false\"\n [type]=\"inputField.inputType || 'text'\" [labelColSize]=\"field().labelColSize\" [value]=\"formControl.value\"\n (valueChange)=\"setControlValue($event)\" (blurred)=\"onBlur()\" (keyUpEnter)=\"onInputEnter()\" (focus)=\"onFocus()\"\n (input)=\"onInput($event)\">\n @if (!!inputField.prefix) {\n <ng-template updInputPrepend>\n {{ textService.getText(inputField.prefix) }}\n </ng-template>\n }\n\n @if (!!inputField.suffix) {\n <ng-template updInputAppend>\n {{ textService.getText(inputField.suffix) }}\n </ng-template>\n }\n </upd-input>\n }\n @case (DynamicFieldType.Checkbox) {\n <upd-checkbox [name]=\"field().name\" [label]=\"field().label\" [hint]=\"field().hint\" [hintAsTooltip]=\"field().hintAsTooltip || false\"\n [validationStatus]=\"validationStatus\" [validationStatusDescriptions]=\"validationStatusDescriptions\" [value]=\"true\"\n [isDisabled]=\"field().isDisabled || false\" [isChecked]=\"formControl.value\" [isInline]=\"checkboxField.isInline || false\"\n [isSwitch]=\"checkboxField.isSwitch || false\" (changed)=\"setControlValue($event)\" (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"></upd-checkbox>\n }\n @case (DynamicFieldType.CheckboxGroup) {\n @if (!!field().label) {\n <label class=\"form-label\">{{ getText(field().label) }}</label>\n }\n\n @for (option of checkboxGroupOptionsKeys; track option) {\n <upd-checkbox [name]=\"field().name\" [label]=\"getOptionDescription(option, 'checkbox')\" [hint]=\"field().hint\"\n [hintAsTooltip]=\"field().hintAsTooltip || false\" [validationStatus]=\"validationStatus\"\n [validationStatusDescriptions]=\"validationStatusDescriptions\" [value]=\"option\" [isDisabled]=\"field().isDisabled || false\"\n [isChecked]=\"formControl.value\" [isInline]=\"checkboxField.isInline || false\" [isSwitch]=\"checkboxField.isSwitch || false\"\n (changed)=\"setControlValue(option)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"></upd-checkbox>\n }\n }\n @case (DynamicFieldType.Radio) {\n <upd-radio [name]=\"field().name\" [label]=\"field().label\" [hint]=\"field().hint\" [hintAsTooltip]=\"field().hintAsTooltip || false\"\n [validationStatus]=\"validationStatus\" [validationStatusDescriptions]=\"validationStatusDescriptions\" [value]=\"true\"\n [isChecked]=\"formControl.value\" [isDisabled]=\"field().isDisabled || false\" [isInline]=\"radioField.isInline || false\"\n (selected)=\"setControlValue($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\">\n </upd-radio>\n }\n @case (DynamicFieldType.RadioGroup) {\n @if (!!field().label) {\n <label class=\"form-label\">{{ getText(field().label) }}</label>\n }\n\n @for (option of radioGroupOptionsKeys; track option) {\n <upd-radio [name]=\"field().name\" [label]=\"getOptionDescription(option, 'radio')\" [hint]=\"field().hint\"\n [hintAsTooltip]=\"field().hintAsTooltip || false\" [validationStatus]=\"validationStatus\"\n [validationStatusDescriptions]=\"validationStatusDescriptions\" [value]=\"option\" [isDisabled]=\"field().isDisabled || false\"\n [isChecked]=\"formControl.value\" [isInline]=\"checkboxField.isInline || false\"\n (selected)=\"setControlValue(option)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"></upd-radio>\n }\n }\n @case (DynamicFieldType.Select) {\n <upd-select [name]=\"field().name\" [label]=\"field().label\" [hint]=\"field().hint\" [hintAsTooltip]=\"field().hintAsTooltip || false\"\n [validationStatus]=\"validationStatus\" [validationStatusDescriptions]=\"validationStatusDescriptions\"\n [useSystemStyle]=\"singleSelectField.useSystemStyle || false\" [isDisabled]=\"field().isDisabled || false\"\n [items]=\"selectField.items\" [layout]=\"layout()\" [labelColSize]=\"field().labelColSize\" [store]=\"selectField.store!\"\n [observable]=\"selectField.observable\" [itemKey]=\"selectField.itemKey\" [itemValue]=\"selectField.itemValue\"\n [dropdownMaxHeight]=\"selectField.dropdownMaxHeight || SelectDefaults.dropdownMaxHeight\"\n [typeaheadDebounce]=\"selectField.typeaheadDebounce || SelectDefaults.typeaheadDebounce\"\n [shouldAutoSearch]=\"selectField.shouldAutoSearch || SelectDefaults.shouldAutoSearch\"\n [shouldCloseOnOutsideClick]=\"selectField.shouldCloseOnOutsideClick || SelectDefaults.shouldCloseOnOutsideClick\"\n [shouldTruncateSelectedText]=\"selectField.shouldTruncateSelectedText\" [parentValue]=\"selectField.parentValue\"\n [value]=\"formControl.value\" (selectedItem)=\"setControlValue($event?.value)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"></upd-select>\n }\n @case (DynamicFieldType.SelectMultiple) {\n <upd-select-multiple [name]=\"field().name\" [label]=\"field().label\" [hint]=\"field().hint\"\n [hintAsTooltip]=\"field().hintAsTooltip || false\" [validationStatus]=\"validationStatus\"\n [validationStatusDescriptions]=\"validationStatusDescriptions\" [isDisabled]=\"field().isDisabled || false\"\n [items]=\"selectField.items\" [layout]=\"layout()\" [labelColSize]=\"field().labelColSize\" [store]=\"selectField.store!\"\n [observable]=\"selectField.observable\" [itemKey]=\"selectField.itemKey\" [itemValue]=\"selectField.itemValue\"\n [dropdownMaxHeight]=\"selectField.dropdownMaxHeight || SelectDefaults.dropdownMaxHeight\"\n [typeaheadDebounce]=\"selectField.typeaheadDebounce || SelectDefaults.typeaheadDebounce\"\n [shouldAutoSearch]=\"selectField.shouldAutoSearch || SelectDefaults.shouldAutoSearch\" [parentValue]=\"selectField.parentValue\"\n [shouldCloseOnOutsideClick]=\"selectField.shouldCloseOnOutsideClick || SelectDefaults.shouldCloseOnOutsideClick\"\n [selectedValues]=\"formControl.value\" (selectedIds)=\"setControlValue($event)\" (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"></upd-select-multiple>\n }\n @case (DynamicFieldType.Label) {\n <label class=\"form-label\">{{ getText(field().label) }}</label>\n }\n @case (DynamicFieldType.TextArea) {\n <upd-textarea [name]=\"field().name\" [label]=\"field().label\" [placeholder]=\"field().placeholder\" [hint]=\"field().hint\"\n [hintAsTooltip]=\"field().hintAsTooltip || false\" [validationStatus]=\"validationStatus\"\n [validationStatusDescriptions]=\"validationStatusDescriptions\" [isDisabled]=\"field().isDisabled || false\"\n [value]=\"formControl.value\" [customClasses]=\"textareaField.customClasses\" [wrapperClasses]=\"textareaField.wrapperClasses\"\n [maxLength]=\"textareaField.maxLength\" [rows]=\"textareaField.rows\"\n [displayCharactersCount]=\"textareaField.displayCharactersCount || false\" (valueChange)=\"setControlValue($event)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (input)=\"onInput($event)\" (keydown.enter)=\"onInputEnter()\">\n </upd-textarea>\n }\n @case (DynamicFieldType.FileUpload) {\n <upd-file-upload [name]=\"field().name\" [label]=\"field().label\" [hint]=\"field().hint\" [isDisabled]=\"field().isDisabled || false\"\n [hintAsTooltip]=\"field().hintAsTooltip || false\" [validationStatus]=\"validationStatus\" [fileName]=\"fileNameControl?.value\"\n [validationStatusDescriptions]=\"validationStatusDescriptions\" [allowFilesDrop]=\"fileUploadField.allowFilesDrop || false\"\n [title]=\"fileUploadField.title\" [labelColSize]=\"field().labelColSize\" [minFileSize]=\"fileUploadField.minFileSize\"\n [isMultiple]=\"fileUploadField.isMultiple || false\" [allowedExtensions]=\"fileUploadField.allowedExtensions || '*'\"\n [maxFileSize]=\"fileUploadField.maxFileSize\" [layout]=\"layout()\" (fileChanged)=\"handleFileSelected($event)\" (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"></upd-file-upload>\n }\n @case (DynamicFieldType.MaskedInput) {\n <upd-input [name]=\"field().name\" [label]=\"field().label\" [placeholder]=\"field().placeholder\" [hint]=\"field().hint\"\n [hintAsTooltip]=\"field().hintAsTooltip || false\" [validationStatus]=\"validationStatus\" [mask]=\"maskedField.mask\"\n [maskConfig]=\"maskedField.maskConfig\" [validationStatusDescriptions]=\"validationStatusDescriptions\" [layout]=\"layout()\"\n [isDisabled]=\"field().isDisabled || false\" [type]=\"inputField.inputType || 'text'\" [labelColSize]=\"field().labelColSize\"\n [value]=\"formControl.value\" (valueChange)=\"setControlValue($event)\" (blurred)=\"onBlur()\" (keyUpEnter)=\"onInputEnter()\"\n (focus)=\"onFocus()\" (input)=\"onInput($event)\">\n @if (!!inputField.prefix) {\n <ng-template updInputPrepend>\n {{ textService.getText(inputField.prefix) }}\n </ng-template>\n }\n\n @if (!!inputField.suffix) {\n <ng-template updInputAppend>\n {{ textService.getText(inputField.suffix) }}\n </ng-template>\n }\n </upd-input>\n }\n @case (DynamicFieldType.Button) {\n <upd-button [text]=\"field().label\" [isDisabled]=\"field().isDisabled || false\" [model]=\"buttonField.model\" />\n }\n @case (DynamicFieldType.ButtonGroup) {\n @if (!!field().label) {\n <label class=\"form-label\">{{ getText(field().label) }}</label>\n }\n\n <div class=\"btn-group\" role=\"group\">\n @for (btn of buttonGroupField.buttons; track btn) {\n <upd-button [model]=\"btn\" [isDisabled]=\"field().isDisabled || false\" />\n }\n </div>\n }\n}\n" }]
|
|
268
|
+
}], ctorParameters: () => [], propDecorators: { hostClasses: [{
|
|
269
|
+
type: HostBinding,
|
|
270
|
+
args: ['class']
|
|
271
|
+
}], submitForm: [{
|
|
272
|
+
type: Output
|
|
273
|
+
}], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: true }] }], field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: true }] }] } });
|
|
274
|
+
|
|
275
|
+
class FormComponent extends BaseComponent {
|
|
276
|
+
get titleText() {
|
|
277
|
+
return this.textService.getText(this.title());
|
|
278
|
+
}
|
|
279
|
+
constructor() {
|
|
280
|
+
super();
|
|
281
|
+
this.initialized = new EventEmitter();
|
|
282
|
+
this.dataLoaded = new EventEmitter(); // TODO: implementar
|
|
283
|
+
this.submitted = new EventEmitter();
|
|
284
|
+
/**
|
|
285
|
+
* Rows to generate the form.
|
|
286
|
+
*/
|
|
287
|
+
this.rows = input.required(...(ngDevMode ? [{ debugName: "rows" }] : []));
|
|
288
|
+
/**
|
|
289
|
+
* Form's layout.
|
|
290
|
+
*/
|
|
291
|
+
this.layout = input('vertical', ...(ngDevMode ? [{ debugName: "layout" }] : []));
|
|
292
|
+
/**
|
|
293
|
+
* Title of the form.
|
|
294
|
+
* Optional.
|
|
295
|
+
*/
|
|
296
|
+
this.title = input(undefined, ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
297
|
+
/**
|
|
298
|
+
* Whether the actions section will be displayed.
|
|
299
|
+
*/
|
|
300
|
+
this.hasActionsSection = input(true, ...(ngDevMode ? [{ debugName: "hasActionsSection" }] : []));
|
|
301
|
+
/**
|
|
302
|
+
* Whether the form is contained in a card.
|
|
303
|
+
* If true, it'll display a card as a form wrapper.
|
|
304
|
+
*/
|
|
305
|
+
this.isCard = input(false, ...(ngDevMode ? [{ debugName: "isCard" }] : []));
|
|
306
|
+
/**
|
|
307
|
+
* Whether the form is in read only mode, which means no fields can be edited.
|
|
308
|
+
*/
|
|
309
|
+
this.isDisabled = input(false, { ...(ngDevMode ? { debugName: "isDisabled" } : {}), transform: (val) => typeof val === 'string' ? val === '' : val });
|
|
310
|
+
/**
|
|
311
|
+
* Whether the form is loading.
|
|
312
|
+
*/
|
|
313
|
+
this.isLoading = input(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : [])); // TODO: implementar
|
|
314
|
+
/**
|
|
315
|
+
* Whether the form is saving.
|
|
316
|
+
*/
|
|
317
|
+
this.isSaving = input(false, ...(ngDevMode ? [{ debugName: "isSaving" }] : [])); // TODO: implementar
|
|
318
|
+
/**
|
|
319
|
+
* Current form data.
|
|
320
|
+
*/
|
|
321
|
+
this.formData = model({}, ...(ngDevMode ? [{ debugName: "formData" }] : []));
|
|
322
|
+
this.formGroup = model(new FormGroup({}), ...(ngDevMode ? [{ debugName: "formGroup" }] : []));
|
|
323
|
+
this.textService = inject(TextService);
|
|
324
|
+
effect(() => {
|
|
325
|
+
this.rows();
|
|
326
|
+
this.setupFormGroup();
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
ngOnInit() {
|
|
330
|
+
this.setupFormGroup();
|
|
331
|
+
this.initialized.emit();
|
|
332
|
+
const valueChangesSub = this.formGroup().valueChanges.subscribe(() => this.formData.set(this.formGroup().getRawValue()));
|
|
333
|
+
this.addSubscriptions(valueChangesSub);
|
|
334
|
+
}
|
|
335
|
+
submit() {
|
|
336
|
+
this.formGroup().markAllAsTouched();
|
|
337
|
+
this.formGroup().updateValueAndValidity();
|
|
338
|
+
Object.values(this.formGroup().controls).forEach(control => control.updateValueAndValidity());
|
|
339
|
+
if (this.formGroup().valid) {
|
|
340
|
+
this.submitted.emit(this.formGroup().value);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
setupFormGroup() {
|
|
344
|
+
const allFields = this.rows().map(r => r.fields).reduce((acc, fields) => acc.concat(fields), []);
|
|
345
|
+
allFields.forEach(field => {
|
|
346
|
+
const validators = field.validators || [];
|
|
347
|
+
if (field.isRequired && !validators.includes(Validators.required)) {
|
|
348
|
+
validators.push(Validators.required);
|
|
349
|
+
}
|
|
350
|
+
// TODO: handle extra cases, when ready. DateRange, DateTimeRange, TimeRange, etc.
|
|
351
|
+
switch (field.type) {
|
|
352
|
+
case DynamicFieldType.FileUpload:
|
|
353
|
+
this.formGroup().addControl(field.name, new FormControl({
|
|
354
|
+
value: field.initValue,
|
|
355
|
+
disabled: field.isDisabled || this.isDisabled()
|
|
356
|
+
}, { validators: validators }));
|
|
357
|
+
const fileNameFormProp = field.fileNameFormProperty;
|
|
358
|
+
if (!!fileNameFormProp) {
|
|
359
|
+
this.formGroup().addControl(fileNameFormProp, new FormControl({
|
|
360
|
+
value: field.initValue,
|
|
361
|
+
disabled: field.isDisabled || this.isDisabled()
|
|
362
|
+
}, { validators: validators }));
|
|
363
|
+
}
|
|
364
|
+
break;
|
|
365
|
+
// Buttons don't generate values, so they don't need to have a control.
|
|
366
|
+
case DynamicFieldType.Button:
|
|
367
|
+
case DynamicFieldType.ButtonGroup:
|
|
368
|
+
break;
|
|
369
|
+
default:
|
|
370
|
+
this.formGroup().addControl(field.name, new FormControl({
|
|
371
|
+
value: field.initValue,
|
|
372
|
+
disabled: field.isDisabled || this.isDisabled()
|
|
373
|
+
}, { validators: validators, updateOn: field.updateOn || 'blur' }));
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
this.bindAttachments(allFields);
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Glue the declarative AttachmentRule array to actual FormControls.
|
|
380
|
+
**/
|
|
381
|
+
bindAttachments(fields) {
|
|
382
|
+
fields.forEach(childField => {
|
|
383
|
+
if (!childField.attachments?.length) {
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
const childCtrl = this.formGroup().get(childField.name);
|
|
387
|
+
childField.attachments.forEach((rule) => {
|
|
388
|
+
const parentCtrl = this.formGroup().get(rule.name);
|
|
389
|
+
if (!parentCtrl) {
|
|
390
|
+
console.warn(`[FormComponent] attachment parent '${rule.name}' not found`);
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
const sub = parentCtrl.valueChanges
|
|
394
|
+
.pipe(startWith(parentCtrl.value))
|
|
395
|
+
.subscribe(parentVal => {
|
|
396
|
+
const childVal = childCtrl.value;
|
|
397
|
+
let shouldDisable = false;
|
|
398
|
+
if (rule.type === AttachmentTypeEnum.ParentLoad || rule.disableIfEmpty) {
|
|
399
|
+
shouldDisable = parentVal === null || parentVal === undefined || parentVal === '';
|
|
400
|
+
}
|
|
401
|
+
if (!!rule.disableIf) {
|
|
402
|
+
shouldDisable = rule.disableIf(childVal, parentVal);
|
|
403
|
+
}
|
|
404
|
+
if (shouldDisable) {
|
|
405
|
+
if (rule.clearValueIfDisabled && childCtrl.enabled) {
|
|
406
|
+
childCtrl.setValue(null, { emitEvent: false });
|
|
407
|
+
}
|
|
408
|
+
childField.parentValue = undefined;
|
|
409
|
+
childCtrl.disable({ emitEvent: false });
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
childField.parentValue = parentVal;
|
|
413
|
+
if (childCtrl.disabled) {
|
|
414
|
+
childCtrl.enable({ emitEvent: false });
|
|
415
|
+
}
|
|
416
|
+
if (rule.clearValueIfEmpty && !parentVal) {
|
|
417
|
+
childCtrl.setValue(null, { emitEvent: false });
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
if (rule.visibleIf) {
|
|
421
|
+
const visible = rule.visibleIf(childVal, parentVal);
|
|
422
|
+
childField.isHidden = !visible;
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
this.addSubscriptions(sub);
|
|
426
|
+
});
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: FormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
430
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.4", type: FormComponent, isStandalone: false, selector: "upd-form", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: true, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, hasActionsSection: { classPropertyName: "hasActionsSection", publicName: "hasActionsSection", isSignal: true, isRequired: false, transformFunction: null }, isCard: { classPropertyName: "isCard", publicName: "isCard", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isSaving: { classPropertyName: "isSaving", publicName: "isSaving", isSignal: true, isRequired: false, transformFunction: null }, formData: { classPropertyName: "formData", publicName: "formData", isSignal: true, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { initialized: "initialized", dataLoaded: "dataLoaded", submitted: "submitted", formData: "formDataChange", formGroup: "formGroupChange" }, usesInheritance: true, ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'UpDevs.Form'\">\n <div [class.card]=\"isCard()\">\n @if (!!titleText) {\n <div [class.card-header]=\"isCard()\">\n <h3 [class.card-title]=\"isCard()\">{{ titleText }}</h3>\n </div>\n }\n <div [class.card-body]=\"isCard()\">\n @for (row of rows(); track row; let isFirst = $first) {\n <div class=\"row\" [class.mt-4]=\"!isFirst\">\n @if (!!row.title) {\n <div class=\"card-title col-12\">{{ textService.getText(row.title) }}</div>\n }\n\n @for (field of row.fields; track field.name) {\n @if (!field.isHidden) {\n <upd-dynamic-field [layout]=\"layout()\" [field]=\"field\" [formGroup]=\"formGroup()\" (submitForm)=\"submit()\">\n </upd-dynamic-field>\n }\n }\n </div>\n }\n </div>\n\n @if (hasActionsSection()) {\n <div [class.card-footer]=\"isCard()\" [class.mt-4]=\"!isCard()\">\n <upd-button colorStyle=\"primary\" (clicked)=\"submit()\">\n {{ t('Submit') }}\n </upd-button>\n </div>\n }\n </div>\n</ng-container>", styles: [""], dependencies: [{ kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i1.ButtonComponent, selector: "upd-button", inputs: ["model", "text", "brandColorStyle", "customClasses", "isOutline", "isGhost", "isSquare", "isPill", "isIcon", "isLoading", "isList", "isFloating", "isAction", "isNavigationLink", "isLink", "shouldIgnoreBtnClass", "iconModel", "iconPosition", "isDisabled", "isActive", "badgeConfig", "colorStyle", "size", "title", "stopPropagation"], outputs: ["clicked"] }, { kind: "directive", type: i1$2.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: DynamicFieldComponent, selector: "upd-dynamic-field", inputs: ["formGroup", "field", "layout"], outputs: ["submitForm"] }] }); }
|
|
431
|
+
}
|
|
432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: FormComponent, decorators: [{
|
|
433
|
+
type: Component,
|
|
434
|
+
args: [{ standalone: false, selector: 'upd-form', template: "<ng-container *transloco=\"let t; prefix: 'UpDevs.Form'\">\n <div [class.card]=\"isCard()\">\n @if (!!titleText) {\n <div [class.card-header]=\"isCard()\">\n <h3 [class.card-title]=\"isCard()\">{{ titleText }}</h3>\n </div>\n }\n <div [class.card-body]=\"isCard()\">\n @for (row of rows(); track row; let isFirst = $first) {\n <div class=\"row\" [class.mt-4]=\"!isFirst\">\n @if (!!row.title) {\n <div class=\"card-title col-12\">{{ textService.getText(row.title) }}</div>\n }\n\n @for (field of row.fields; track field.name) {\n @if (!field.isHidden) {\n <upd-dynamic-field [layout]=\"layout()\" [field]=\"field\" [formGroup]=\"formGroup()\" (submitForm)=\"submit()\">\n </upd-dynamic-field>\n }\n }\n </div>\n }\n </div>\n\n @if (hasActionsSection()) {\n <div [class.card-footer]=\"isCard()\" [class.mt-4]=\"!isCard()\">\n <upd-button colorStyle=\"primary\" (clicked)=\"submit()\">\n {{ t('Submit') }}\n </upd-button>\n </div>\n }\n </div>\n</ng-container>" }]
|
|
435
|
+
}], ctorParameters: () => [], propDecorators: { initialized: [{
|
|
436
|
+
type: Output
|
|
437
|
+
}], dataLoaded: [{
|
|
438
|
+
type: Output
|
|
439
|
+
}], submitted: [{
|
|
440
|
+
type: Output
|
|
441
|
+
}], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: true }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], hasActionsSection: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasActionsSection", required: false }] }], isCard: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCard", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], isSaving: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSaving", required: false }] }], formData: [{ type: i0.Input, args: [{ isSignal: true, alias: "formData", required: false }] }, { type: i0.Output, args: ["formDataChange"] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: false }] }, { type: i0.Output, args: ["formGroupChange"] }] } });
|
|
442
|
+
|
|
443
|
+
var UpDevs$1 = {
|
|
444
|
+
Form: {
|
|
445
|
+
Submit: "Submit",
|
|
446
|
+
ErrorMessages: {
|
|
447
|
+
Generic: "Error",
|
|
448
|
+
Email: "Invalid email",
|
|
449
|
+
Max: "Value should not be greater than {{value}}",
|
|
450
|
+
Min: "Value should not be lower than {{value}}",
|
|
451
|
+
MaxLength: "Maximum length: {{value}}",
|
|
452
|
+
MinLength: "Minimum length: {{value}}",
|
|
453
|
+
Required: "Required field",
|
|
454
|
+
RequiredTrue: "This field must be selected"
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
var en = {
|
|
459
|
+
UpDevs: UpDevs$1
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
var en$1 = /*#__PURE__*/Object.freeze({
|
|
463
|
+
__proto__: null,
|
|
464
|
+
UpDevs: UpDevs$1,
|
|
465
|
+
default: en
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
var UpDevs = {
|
|
469
|
+
Form: {
|
|
470
|
+
Submit: "Enviar",
|
|
471
|
+
ErrorMessages: {
|
|
472
|
+
Generic: "Erro",
|
|
473
|
+
Email: "E-mail inválido",
|
|
474
|
+
Max: "O valor não pode ser maior do que {{value}}",
|
|
475
|
+
Min: "O valor não pode ser menor do que {{value}}",
|
|
476
|
+
MaxLength: "Tamanho máximo permitido: {{value}}",
|
|
477
|
+
MinLength: "Tamanho mínimo permitido: {{value}}",
|
|
478
|
+
Required: "Campo obrigatório",
|
|
479
|
+
RequiredTrue: "Este campo deve ser selecionado"
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
var pt = {
|
|
484
|
+
UpDevs: UpDevs
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
var pt$1 = /*#__PURE__*/Object.freeze({
|
|
488
|
+
__proto__: null,
|
|
489
|
+
UpDevs: UpDevs,
|
|
490
|
+
default: pt
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
class UpdFormModule {
|
|
494
|
+
constructor(translocoService) {
|
|
495
|
+
translocoService.setFallbackLangForMissingTranslation({ fallbackLang: 'en' });
|
|
496
|
+
translocoService.setTranslation(en$1, 'en');
|
|
497
|
+
translocoService.setTranslation(pt$1, 'pt');
|
|
498
|
+
}
|
|
499
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: UpdFormModule, deps: [{ token: i1$2.TranslocoService }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
500
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.4", ngImport: i0, type: UpdFormModule, declarations: [FormComponent,
|
|
501
|
+
DynamicFieldComponent], imports: [CommonModule,
|
|
502
|
+
ReactiveFormsModule,
|
|
503
|
+
UpdButtonModule,
|
|
504
|
+
TranslocoDirective,
|
|
505
|
+
UpdInputModule,
|
|
506
|
+
UpdCheckboxModule,
|
|
507
|
+
UpdRadioModule,
|
|
508
|
+
UpdDatePickerModule,
|
|
509
|
+
UpdSelectModule,
|
|
510
|
+
UpdTextareaModule,
|
|
511
|
+
UpdFileUploadModule,
|
|
512
|
+
UpdSdkModule], exports: [FormComponent] }); }
|
|
513
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: UpdFormModule, providers: [
|
|
514
|
+
ErrorsHelper
|
|
515
|
+
], imports: [CommonModule,
|
|
516
|
+
ReactiveFormsModule,
|
|
517
|
+
UpdButtonModule,
|
|
518
|
+
UpdInputModule,
|
|
519
|
+
UpdCheckboxModule,
|
|
520
|
+
UpdRadioModule,
|
|
521
|
+
UpdDatePickerModule,
|
|
522
|
+
UpdSelectModule,
|
|
523
|
+
UpdTextareaModule,
|
|
524
|
+
UpdFileUploadModule,
|
|
525
|
+
UpdSdkModule] }); }
|
|
526
|
+
}
|
|
527
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: UpdFormModule, decorators: [{
|
|
528
|
+
type: NgModule,
|
|
529
|
+
args: [{
|
|
530
|
+
imports: [
|
|
531
|
+
CommonModule,
|
|
532
|
+
ReactiveFormsModule,
|
|
533
|
+
UpdButtonModule,
|
|
534
|
+
TranslocoDirective,
|
|
535
|
+
UpdInputModule,
|
|
536
|
+
UpdCheckboxModule,
|
|
537
|
+
UpdRadioModule,
|
|
538
|
+
UpdDatePickerModule,
|
|
539
|
+
UpdSelectModule,
|
|
540
|
+
UpdTextareaModule,
|
|
541
|
+
UpdFileUploadModule,
|
|
542
|
+
UpdSdkModule
|
|
543
|
+
],
|
|
544
|
+
declarations: [
|
|
545
|
+
FormComponent,
|
|
546
|
+
DynamicFieldComponent
|
|
547
|
+
],
|
|
548
|
+
exports: [
|
|
549
|
+
FormComponent
|
|
550
|
+
],
|
|
551
|
+
providers: [
|
|
552
|
+
ErrorsHelper
|
|
553
|
+
]
|
|
554
|
+
}]
|
|
555
|
+
}], ctorParameters: () => [{ type: i1$2.TranslocoService }] });
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Generated bundle index. Do not edit.
|
|
559
|
+
*/
|
|
560
|
+
|
|
561
|
+
export { AttachmentTypeEnum, DynamicFieldType, FormComponent, UpdFormModule };
|
|
562
|
+
//# sourceMappingURL=updevs-components-form.mjs.map
|