@unipin/angular-applet 21.3.0 → 21.3.2
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/fesm2022/unipin-angular-applet-accordion.mjs +12 -12
- package/fesm2022/unipin-angular-applet-alert-dialog.mjs +6 -6
- package/fesm2022/unipin-angular-applet-alert.mjs +9 -9
- package/fesm2022/unipin-angular-applet-approval.mjs +6 -6
- package/fesm2022/{unipin-angular-applet-audit-audit-modal.component-3a2P0bZr.mjs → unipin-angular-applet-audit-audit-modal.component-wPoNvU2r.mjs} +4 -4
- package/fesm2022/{unipin-angular-applet-audit-audit-modal.component-3a2P0bZr.mjs.map → unipin-angular-applet-audit-audit-modal.component-wPoNvU2r.mjs.map} +1 -1
- package/fesm2022/unipin-angular-applet-audit.mjs +7 -7
- package/fesm2022/unipin-angular-applet-auth.mjs +21 -21
- package/fesm2022/unipin-angular-applet-avatar.mjs +3 -3
- package/fesm2022/unipin-angular-applet-badge.mjs +3 -3
- package/fesm2022/unipin-angular-applet-buttons.mjs +6 -6
- package/fesm2022/unipin-angular-applet-calendar.mjs +12 -12
- package/fesm2022/unipin-angular-applet-collapsible.mjs +9 -9
- package/fesm2022/unipin-angular-applet-common.mjs +24 -24
- package/fesm2022/unipin-angular-applet-containers.mjs +12 -12
- package/fesm2022/unipin-angular-applet-dialog.mjs +21 -21
- package/fesm2022/unipin-angular-applet-forms.mjs +263 -261
- package/fesm2022/unipin-angular-applet-forms.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-froala.mjs +3 -3
- package/fesm2022/unipin-angular-applet-grids.mjs +26 -12
- package/fesm2022/unipin-angular-applet-grids.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-infinite-scroll.mjs +3 -3
- package/fesm2022/unipin-angular-applet-json-viewer.mjs +3 -3
- package/fesm2022/unipin-angular-applet-kbd.mjs +3 -3
- package/fesm2022/unipin-angular-applet-loading-dialog.mjs +6 -6
- package/fesm2022/unipin-angular-applet-markdown.mjs +9 -9
- package/fesm2022/unipin-angular-applet-popover.mjs +15 -15
- package/fesm2022/unipin-angular-applet-progress-bar.mjs +3 -3
- package/fesm2022/unipin-angular-applet-skeleton.mjs +3 -3
- package/fesm2022/unipin-angular-applet-spinner.mjs +3 -3
- package/fesm2022/unipin-angular-applet-stepper.mjs +6 -6
- package/fesm2022/unipin-angular-applet-swipeable.mjs +12 -12
- package/fesm2022/unipin-angular-applet-tabs.mjs +9 -9
- package/fesm2022/unipin-angular-applet-tooltip.mjs +3 -3
- package/package.json +2 -1
- package/types/unipin-angular-applet-forms.d.ts +60 -57
- package/types/unipin-angular-applet-grids.d.ts +1 -1
- package/common/assets/sprites/flagGlobal.png +0 -0
|
@@ -16,6 +16,201 @@ import { UpPopoverComponent, UpPopoverTriggerDirective, UpPopoverContentRefDirec
|
|
|
16
16
|
import { DecimalPipe } from '@angular/common';
|
|
17
17
|
import { matDelete, matUpload } from '@ng-icons/material-icons/baseline';
|
|
18
18
|
|
|
19
|
+
function setValidator(form, keys, validators) {
|
|
20
|
+
if (!keys.length ||
|
|
21
|
+
keys.length === 1) {
|
|
22
|
+
throw new Error('Use normal action for single keys and keys cannot be empty.');
|
|
23
|
+
}
|
|
24
|
+
keys.forEach((key) => {
|
|
25
|
+
const control = form.get(key);
|
|
26
|
+
if (control) {
|
|
27
|
+
control.setValidators(validators);
|
|
28
|
+
control.updateValueAndValidity();
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function toggleFormControls(form, keys, mode) {
|
|
34
|
+
if (!keys.length ||
|
|
35
|
+
keys.length === 1) {
|
|
36
|
+
throw new Error('Use normal action for single keys and keys cannot be empty.');
|
|
37
|
+
}
|
|
38
|
+
keys.forEach((key) => form.get(key)?.[mode]());
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function prettifyLabel(name) {
|
|
42
|
+
return name
|
|
43
|
+
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
44
|
+
.replace(/_/g, ' ')
|
|
45
|
+
.replace(/\b\w/g, char => char.toUpperCase());
|
|
46
|
+
}
|
|
47
|
+
function convertToDate(value) {
|
|
48
|
+
if (value instanceof Date)
|
|
49
|
+
return value;
|
|
50
|
+
if (typeof value === 'string' &&
|
|
51
|
+
!isNaN(Date.parse(value))) {
|
|
52
|
+
return new Date(value);
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Range validator for number and date values.
|
|
58
|
+
* @param {string} fromKey - The "from" control name
|
|
59
|
+
* @param {string} toKey - The "to" control name
|
|
60
|
+
* @returns {ValidatorFn} Throw error message when fromKey is greater than toKey
|
|
61
|
+
*
|
|
62
|
+
* Usage:
|
|
63
|
+
* this.form = new FormGroup({
|
|
64
|
+
* agingFrom: new FormControl(),
|
|
65
|
+
* agingTo: new FormControl(),
|
|
66
|
+
* }, { validators: rangeValidator('agingFrom', 'agingTo') });
|
|
67
|
+
*/
|
|
68
|
+
function validRangeValidator(fromKey, toKey) {
|
|
69
|
+
return (group) => {
|
|
70
|
+
if (!group) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
const toControl = group.get(toKey);
|
|
74
|
+
const fromControl = group.get(fromKey);
|
|
75
|
+
if (!fromControl ||
|
|
76
|
+
!toControl) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
const toValue = toControl.value;
|
|
80
|
+
const fromValue = fromControl.value;
|
|
81
|
+
if (fromValue === null ||
|
|
82
|
+
toValue === null ||
|
|
83
|
+
fromValue === '' ||
|
|
84
|
+
toValue === '') {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
let isInvalid = false;
|
|
88
|
+
const toDate = convertToDate(toValue);
|
|
89
|
+
const fromDate = convertToDate(fromValue);
|
|
90
|
+
if (fromDate && toDate) {
|
|
91
|
+
isInvalid = toDate <= fromDate;
|
|
92
|
+
}
|
|
93
|
+
else if (!isNaN(fromValue) &&
|
|
94
|
+
!isNaN(toValue)) {
|
|
95
|
+
isInvalid = Number(toValue) <= Number(fromValue);
|
|
96
|
+
}
|
|
97
|
+
return !isInvalid ? null : {
|
|
98
|
+
rangeInvalid: {
|
|
99
|
+
to: toKey,
|
|
100
|
+
from: fromKey,
|
|
101
|
+
message: `${prettifyLabel(toKey)} must be greater than ${prettifyLabel(fromKey)}`
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Validator that requires all specified form controls to have the same value.
|
|
109
|
+
*
|
|
110
|
+
* @param {string[]} controlNames - The names of the controls that must match
|
|
111
|
+
* @param {string} [message] - Optional custom error message
|
|
112
|
+
* @returns {ValidatorFn} A validator function producing an `isEqual` error if values do not match
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* this.form = new FormGroup({
|
|
116
|
+
* password: new FormControl(''),
|
|
117
|
+
* confirmPassword: new FormControl(''),
|
|
118
|
+
* }, { validators: isEqualValidator(['password', 'confirmPassword']) });
|
|
119
|
+
*/
|
|
120
|
+
function isEqualValidator(controlNames, message) {
|
|
121
|
+
return (group) => {
|
|
122
|
+
if (!group ||
|
|
123
|
+
controlNames.length < 2) {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
let isEmpty = false;
|
|
127
|
+
const values = controlNames.reduce((acc, name) => {
|
|
128
|
+
const control = group.get(name);
|
|
129
|
+
if (!control) {
|
|
130
|
+
return acc;
|
|
131
|
+
}
|
|
132
|
+
if (!control.value) {
|
|
133
|
+
isEmpty = true;
|
|
134
|
+
return acc;
|
|
135
|
+
}
|
|
136
|
+
acc.push(control.value);
|
|
137
|
+
return acc;
|
|
138
|
+
}, []);
|
|
139
|
+
if (isEmpty) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
if (!values.every(v => v === values[0])) {
|
|
143
|
+
const labels = controlNames.map((name) => {
|
|
144
|
+
return name
|
|
145
|
+
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
146
|
+
.replace(/_/g, ' ')
|
|
147
|
+
.replace(/\b\w/g, char => char.toUpperCase());
|
|
148
|
+
});
|
|
149
|
+
return {
|
|
150
|
+
isEqual: {
|
|
151
|
+
fields: controlNames,
|
|
152
|
+
message: message || `${labels.join(', ')} should have the same value`
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return null;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Validator that requires all specified form controls to have different values.
|
|
162
|
+
*
|
|
163
|
+
* @param {string[]} controlNames - The names of the controls that must all be unique
|
|
164
|
+
* @param {string} [message] - Optional custom error message
|
|
165
|
+
* @returns {ValidatorFn} A validator function producing an `isNotEqual` error if duplicate values exist
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* this.form = new FormGroup({
|
|
169
|
+
* primaryEmail: new FormControl(''),
|
|
170
|
+
* secondaryEmail: new FormControl(''),
|
|
171
|
+
* backupEmail: new FormControl(''),
|
|
172
|
+
* }, { validators: isNotEqualValidator(['primaryEmail', 'secondaryEmail', 'backupEmail']) });
|
|
173
|
+
*/
|
|
174
|
+
function isNotEqualValidator(controlNames, message) {
|
|
175
|
+
return (group) => {
|
|
176
|
+
if (!group ||
|
|
177
|
+
controlNames.length < 2) {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
let isEmpty = false;
|
|
181
|
+
const values = controlNames.reduce((acc, name) => {
|
|
182
|
+
const control = group.get(name);
|
|
183
|
+
if (!control) {
|
|
184
|
+
return acc;
|
|
185
|
+
}
|
|
186
|
+
if (!control.value) {
|
|
187
|
+
isEmpty = true;
|
|
188
|
+
return acc;
|
|
189
|
+
}
|
|
190
|
+
acc.push(control.value);
|
|
191
|
+
return acc;
|
|
192
|
+
}, []);
|
|
193
|
+
if (isEmpty) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
if (new Set(values).size !== values.length) {
|
|
197
|
+
const labels = controlNames.map((name) => {
|
|
198
|
+
return name
|
|
199
|
+
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
200
|
+
.replace(/_/g, ' ')
|
|
201
|
+
.replace(/\b\w/g, char => char.toUpperCase());
|
|
202
|
+
});
|
|
203
|
+
return {
|
|
204
|
+
isNotEqual: {
|
|
205
|
+
fields: controlNames,
|
|
206
|
+
message: message || `${labels.join(', ')} should have different values`
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
return null;
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
19
214
|
const errMessage = {
|
|
20
215
|
email: (label) => `${label} is not a valid email`,
|
|
21
216
|
required: (label) => `${label} is required`,
|
|
@@ -72,10 +267,10 @@ class UpFieldControlComponent {
|
|
|
72
267
|
this.error.set(newState);
|
|
73
268
|
}
|
|
74
269
|
}
|
|
75
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
76
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.
|
|
270
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpFieldControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
271
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpFieldControlComponent }); }
|
|
77
272
|
}
|
|
78
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpFieldControlComponent, decorators: [{
|
|
79
274
|
type: Injectable
|
|
80
275
|
}] });
|
|
81
276
|
|
|
@@ -87,15 +282,15 @@ class UpInputDirective extends UpFieldControlComponent {
|
|
|
87
282
|
return up('peer file:text-foreground placeholder:text-muted-foreground/30 selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-medium file:h-7 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm', 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none', this.error() ? 'ring-destructive/20 dark:ring-destructive/40 border-destructive focus-visible:ring-destructive/50' : '', this.inlineClass());
|
|
88
283
|
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
89
284
|
}
|
|
90
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
91
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.
|
|
285
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpInputDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
286
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: UpInputDirective, isStandalone: true, selector: "[upInput]", inputs: { inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, providers: [
|
|
92
287
|
{
|
|
93
288
|
provide: UpFieldControl,
|
|
94
289
|
useExisting: forwardRef(() => UpInputDirective)
|
|
95
290
|
}
|
|
96
291
|
], exportAs: ["upInput"], usesInheritance: true, ngImport: i0 }); }
|
|
97
292
|
}
|
|
98
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
293
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpInputDirective, decorators: [{
|
|
99
294
|
type: Directive,
|
|
100
295
|
args: [{
|
|
101
296
|
standalone: true,
|
|
@@ -280,15 +475,15 @@ class UpNumberDirective extends UpInputDirective {
|
|
|
280
475
|
decimal: decimalPart?.slice(0, this.maxDecimalDigits()),
|
|
281
476
|
};
|
|
282
477
|
}
|
|
283
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
284
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.
|
|
478
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpNumberDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
479
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: UpNumberDirective, isStandalone: true, selector: "[upNumber]", inputs: { magnifyValue: { classPropertyName: "magnifyValue", publicName: "magnifyValue", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "blur": "onBlur()", "input": "onInput($event)", "keydown": "onKeyDown($event)" }, properties: { "class": "_computedClass()" } }, providers: [
|
|
285
480
|
{
|
|
286
481
|
provide: UpFieldControl,
|
|
287
482
|
useExisting: forwardRef(() => UpNumberDirective),
|
|
288
483
|
},
|
|
289
484
|
], exportAs: ["upNumber"], usesInheritance: true, ngImport: i0 }); }
|
|
290
485
|
}
|
|
291
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
486
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpNumberDirective, decorators: [{
|
|
292
487
|
type: Directive,
|
|
293
488
|
args: [{
|
|
294
489
|
standalone: true,
|
|
@@ -405,8 +600,8 @@ class UpPasswordComponent extends UpFieldControlComponent {
|
|
|
405
600
|
this.value.set(value);
|
|
406
601
|
this._onChange(this.value());
|
|
407
602
|
}
|
|
408
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
409
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
603
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpPasswordComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
604
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: UpPasswordComponent, isStandalone: true, selector: "up-password", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange" }, host: { classAttribute: "block relative" }, providers: [
|
|
410
605
|
{
|
|
411
606
|
provide: UpFieldControl,
|
|
412
607
|
useExisting: forwardRef(() => UpPasswordComponent)
|
|
@@ -437,7 +632,7 @@ class UpPasswordComponent extends UpFieldControlComponent {
|
|
|
437
632
|
/>
|
|
438
633
|
`, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: UpInputDirective, selector: "[upInput]", inputs: ["class"], exportAs: ["upInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
439
634
|
}
|
|
440
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
635
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpPasswordComponent, decorators: [{
|
|
441
636
|
type: Component,
|
|
442
637
|
args: [{
|
|
443
638
|
standalone: true,
|
|
@@ -492,15 +687,15 @@ class UpRadioDirective extends UpFieldControlComponent {
|
|
|
492
687
|
return up('peer dark:bg-input/30 border-input size-4 min-w-0 rounded-full border bg-transparent shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-border/40 relative cursor-pointer', 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none', 'appearance-none checked:border-primary', 'checked:after:content-[\'\'] checked:after:absolute checked:after:bg-primary checked:after:rounded-full checked:after:size-2 checked:after:left-1/2 checked:after:top-1/2 checked:after:-translate-x-1/2 checked:after:-translate-y-1/2', this.error() ? 'ring-destructive/20 dark:ring-destructive/40 border-destructive focus-visible:ring-destructive/50' : '', this.inlineClass());
|
|
493
688
|
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
494
689
|
}
|
|
495
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
496
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.
|
|
690
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpRadioDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
691
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: UpRadioDirective, isStandalone: true, selector: "[upRadio]", inputs: { inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "radio" }, properties: { "class": "_computedClass()" } }, providers: [
|
|
497
692
|
{
|
|
498
693
|
provide: UpFieldControl,
|
|
499
694
|
useExisting: forwardRef(() => UpRadioDirective)
|
|
500
695
|
}
|
|
501
696
|
], exportAs: ["upRadio"], usesInheritance: true, ngImport: i0 }); }
|
|
502
697
|
}
|
|
503
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
698
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpRadioDirective, decorators: [{
|
|
504
699
|
type: Directive,
|
|
505
700
|
args: [{
|
|
506
701
|
exportAs: 'upRadio',
|
|
@@ -567,8 +762,8 @@ class UpSwitchComponent extends UpFieldControlComponent {
|
|
|
567
762
|
this._onChange(this.checked());
|
|
568
763
|
this._onTouched();
|
|
569
764
|
}
|
|
570
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
571
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
765
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpSwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
766
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: UpSwitchComponent, isStandalone: true, selector: "up-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, host: { classAttribute: "inline-flex items-center cursor-pointer" }, providers: [
|
|
572
767
|
{
|
|
573
768
|
provide: UpFieldControl,
|
|
574
769
|
useExisting: forwardRef(() => UpSwitchComponent),
|
|
@@ -590,7 +785,7 @@ class UpSwitchComponent extends UpFieldControlComponent {
|
|
|
590
785
|
</span>
|
|
591
786
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
592
787
|
}
|
|
593
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
788
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpSwitchComponent, decorators: [{
|
|
594
789
|
type: Component,
|
|
595
790
|
args: [{
|
|
596
791
|
standalone: true,
|
|
@@ -632,15 +827,15 @@ class UpCheckboxDirective extends UpFieldControlComponent {
|
|
|
632
827
|
return up('peer dark:bg-input/30 border-input size-5 min-w-0 rounded-md border bg-transparent shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-border/40 relative cursor-pointer', 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none', 'appearance-none checked:border-primary checked:bg-primary', 'checked:after:content-[\'\'] checked:after:absolute checked:after:border-white checked:after:border-b-2 checked:after:border-r-2 checked:after:w-1.5 checked:after:h-2.5 checked:after:rounded-br-xs checked:after:rotate-45 checked:after:left-1.5 checked:after:top-0.75', this.error() ? 'ring-destructive/20 dark:ring-destructive/40 border-destructive focus-visible:ring-destructive/50' : '', this.inlineClass());
|
|
633
828
|
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
634
829
|
}
|
|
635
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
636
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.
|
|
830
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpCheckboxDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
831
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: UpCheckboxDirective, isStandalone: true, selector: "[upCheckbox]", inputs: { inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "checkbox" }, properties: { "class": "_computedClass()" } }, providers: [
|
|
637
832
|
{
|
|
638
833
|
provide: UpFieldControl,
|
|
639
834
|
useExisting: forwardRef(() => UpCheckboxDirective)
|
|
640
835
|
}
|
|
641
836
|
], exportAs: ["upCheckbox"], usesInheritance: true, ngImport: i0 }); }
|
|
642
837
|
}
|
|
643
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
838
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpCheckboxDirective, decorators: [{
|
|
644
839
|
type: Directive,
|
|
645
840
|
args: [{
|
|
646
841
|
standalone: true,
|
|
@@ -666,12 +861,12 @@ class UpOptionComponent {
|
|
|
666
861
|
this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
667
862
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
668
863
|
}
|
|
669
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
670
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
864
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpOptionComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
865
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: UpOptionComponent, isStandalone: true, selector: "up-option", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
671
866
|
<ng-content />
|
|
672
867
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
673
868
|
}
|
|
674
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
869
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpOptionComponent, decorators: [{
|
|
675
870
|
type: Component,
|
|
676
871
|
args: [{
|
|
677
872
|
standalone: true,
|
|
@@ -782,8 +977,8 @@ class UpSelectComponent extends UpFieldControlComponent {
|
|
|
782
977
|
this.changed.emit(this.value());
|
|
783
978
|
}
|
|
784
979
|
}
|
|
785
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
786
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.
|
|
980
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
981
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: UpSelectComponent, isStandalone: true, selector: "up-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: true, isRequired: false, transformFunction: null }, bindValue: { classPropertyName: "bindValue", publicName: "bindValue", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, addTag: { classPropertyName: "addTag", publicName: "addTag", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", changed: "changed" }, host: { classAttribute: "block relative" }, providers: [
|
|
787
982
|
{
|
|
788
983
|
provide: UpFieldControl,
|
|
789
984
|
useExisting: forwardRef(() => UpSelectComponent)
|
|
@@ -811,7 +1006,7 @@ class UpSelectComponent extends UpFieldControlComponent {
|
|
|
811
1006
|
/>
|
|
812
1007
|
`, isInline: true, styles: [".ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{background-color:var(--accent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left{border-right-color:color-mix(in oklab,var(--primary) 50%,transparent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left:hover{background-color:color-mix(in oklab,var(--primary) 40%,transparent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{opacity:30%;top:50%!important;padding-bottom:0!important;transform:translateY(-50%)!important}.ng-select .ng-select-container{transition:all .2s ease}.ng-select .ng-select-container .ng-value-container{align-items:center;padding-left:.75rem}.ng-select .ng-select-container .ng-value-container .ng-placeholder{color:var(--muted-foreground)}.ng-select .ng-select-container .ng-arrow-wrapper{padding-right:.75rem}.ng-select .ng-select-container .ng-clear-wrapper{margin-right:.25rem;transition:color .2s ease}.ng-select .ng-select-container .ng-clear-wrapper:hover .ng-clear{color:var(--destructive)}.ng-dropdown-panel{overflow:hidden;margin-top:.25rem!important;border-color:var(--border)!important;border-radius:calc(var(--radius) - 2px)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.ng-dropdown-panel .ng-option-label{color:#000;font-size:1rem}@media screen and (min-width:48rem){.ng-dropdown-panel .ng-option-label{font-size:.875rem}}.ng-dropdown-panel .ng-option:hover,.ng-dropdown-panel .ng-option-marked{background-color:var(--accent)!important}.ng-dropdown-panel .ng-option-selected{color:#000!important;background-color:color-mix(in oklab,var(--primary) 15%,transparent)!important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "dropdownPosition", "appendTo", "outsideClickEvent", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "tabFocusOnClearButton", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "clearKeepsDisabledOptions", "deselectOnClick", "clearSearchOnAdd", "compareWith", "keyDownFn", "bindLabel", "bindValue", "appearance", "isOpen", "items"], outputs: ["bindLabelChange", "bindValueChange", "appearanceChange", "isOpenChange", "itemsChange", "blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"], exportAs: ["ngSelect"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
813
1008
|
}
|
|
814
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1009
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpSelectComponent, decorators: [{
|
|
815
1010
|
type: Component,
|
|
816
1011
|
args: [{ standalone: true, selector: 'up-select', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
817
1012
|
class: 'block relative',
|
|
@@ -856,6 +1051,7 @@ class UpCountrySelectComponent extends UpFieldControlComponent {
|
|
|
856
1051
|
this.placeholder = input('Select country', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
857
1052
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
858
1053
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
1054
|
+
this.appendTo = input('body', ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
|
|
859
1055
|
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
860
1056
|
this.changed = output();
|
|
861
1057
|
this.countries = signal([], ...(ngDevMode ? [{ debugName: "countries" }] : []));
|
|
@@ -912,8 +1108,8 @@ class UpCountrySelectComponent extends UpFieldControlComponent {
|
|
|
912
1108
|
this.changed.emit(this.countries().find(c => c.code === value));
|
|
913
1109
|
}
|
|
914
1110
|
}
|
|
915
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
916
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
1111
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpCountrySelectComponent, deps: [{ token: i1$1.CountryService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1112
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: UpCountrySelectComponent, isStandalone: true, selector: "up-country-select", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", changed: "changed" }, host: { classAttribute: "block" }, providers: [
|
|
917
1113
|
{
|
|
918
1114
|
provide: UpFieldControl,
|
|
919
1115
|
useExisting: forwardRef(() => UpCountrySelectComponent),
|
|
@@ -922,11 +1118,11 @@ class UpCountrySelectComponent extends UpFieldControlComponent {
|
|
|
922
1118
|
<up-select
|
|
923
1119
|
searchable
|
|
924
1120
|
virtualScroll
|
|
925
|
-
appendTo="body"
|
|
926
1121
|
bindValue="code"
|
|
927
1122
|
bindLabel="name"
|
|
928
1123
|
[value]="value()"
|
|
929
1124
|
[items]="countries()"
|
|
1125
|
+
[appendTo]="appendTo()"
|
|
930
1126
|
[loading]="isLoading()"
|
|
931
1127
|
[multiple]="multiple()"
|
|
932
1128
|
[class]="inlineClass()"
|
|
@@ -938,7 +1134,7 @@ class UpCountrySelectComponent extends UpFieldControlComponent {
|
|
|
938
1134
|
/>
|
|
939
1135
|
`, isInline: true, dependencies: [{ kind: "component", type: UpSelectComponent, selector: "up-select", inputs: ["label", "placeholder", "bindLabel", "bindValue", "appendTo", "class", "loading", "multiple", "required", "disabled", "clearable", "addTag", "searchable", "virtualScroll", "items", "value"], outputs: ["valueChange", "changed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
940
1136
|
}
|
|
941
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpCountrySelectComponent, decorators: [{
|
|
942
1138
|
type: Component,
|
|
943
1139
|
args: [{
|
|
944
1140
|
standalone: true,
|
|
@@ -960,11 +1156,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
960
1156
|
<up-select
|
|
961
1157
|
searchable
|
|
962
1158
|
virtualScroll
|
|
963
|
-
appendTo="body"
|
|
964
1159
|
bindValue="code"
|
|
965
1160
|
bindLabel="name"
|
|
966
1161
|
[value]="value()"
|
|
967
1162
|
[items]="countries()"
|
|
1163
|
+
[appendTo]="appendTo()"
|
|
968
1164
|
[loading]="isLoading()"
|
|
969
1165
|
[multiple]="multiple()"
|
|
970
1166
|
[class]="inlineClass()"
|
|
@@ -976,7 +1172,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
976
1172
|
/>
|
|
977
1173
|
`,
|
|
978
1174
|
}]
|
|
979
|
-
}], ctorParameters: () => [{ type: i1$1.CountryService }], propDecorators: { multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
1175
|
+
}], ctorParameters: () => [{ type: i1$1.CountryService }], propDecorators: { multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
980
1176
|
|
|
981
1177
|
class UpCurrencySelectComponent extends UpFieldControlComponent {
|
|
982
1178
|
constructor(service) {
|
|
@@ -987,6 +1183,7 @@ class UpCurrencySelectComponent extends UpFieldControlComponent {
|
|
|
987
1183
|
this.placeholder = input('Select currency', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
988
1184
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
989
1185
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
1186
|
+
this.appendTo = input('body', ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
|
|
990
1187
|
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
991
1188
|
this.changed = output();
|
|
992
1189
|
this.isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
@@ -1050,8 +1247,8 @@ class UpCurrencySelectComponent extends UpFieldControlComponent {
|
|
|
1050
1247
|
this.changed.emit(this.currencies().find(c => c.code === value));
|
|
1051
1248
|
}
|
|
1052
1249
|
}
|
|
1053
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1054
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
1250
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpCurrencySelectComponent, deps: [{ token: i1$1.CurrencyService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1251
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: UpCurrencySelectComponent, isStandalone: true, selector: "up-currency-select", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", changed: "changed" }, host: { classAttribute: "block" }, providers: [
|
|
1055
1252
|
{
|
|
1056
1253
|
provide: UpFieldControl,
|
|
1057
1254
|
useExisting: forwardRef(() => UpCurrencySelectComponent)
|
|
@@ -1060,7 +1257,6 @@ class UpCurrencySelectComponent extends UpFieldControlComponent {
|
|
|
1060
1257
|
<up-select
|
|
1061
1258
|
searchable
|
|
1062
1259
|
virtualScroll
|
|
1063
|
-
appendTo="body"
|
|
1064
1260
|
bindValue="code"
|
|
1065
1261
|
bindLabel="displayLabel"
|
|
1066
1262
|
[value]="value()"
|
|
@@ -1068,6 +1264,7 @@ class UpCurrencySelectComponent extends UpFieldControlComponent {
|
|
|
1068
1264
|
[loading]="isLoading()"
|
|
1069
1265
|
[multiple]="multiple()"
|
|
1070
1266
|
[class]="inlineClass()"
|
|
1267
|
+
[appendTo]="appendTo()"
|
|
1071
1268
|
[clearable]="clearable()"
|
|
1072
1269
|
[placeholder]="placeholder()"
|
|
1073
1270
|
[disabled]="disabled() || _disabled()"
|
|
@@ -1076,7 +1273,7 @@ class UpCurrencySelectComponent extends UpFieldControlComponent {
|
|
|
1076
1273
|
/>
|
|
1077
1274
|
`, isInline: true, dependencies: [{ kind: "component", type: UpSelectComponent, selector: "up-select", inputs: ["label", "placeholder", "bindLabel", "bindValue", "appendTo", "class", "loading", "multiple", "required", "disabled", "clearable", "addTag", "searchable", "virtualScroll", "items", "value"], outputs: ["valueChange", "changed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1078
1275
|
}
|
|
1079
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1276
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpCurrencySelectComponent, decorators: [{
|
|
1080
1277
|
type: Component,
|
|
1081
1278
|
args: [{
|
|
1082
1279
|
standalone: true,
|
|
@@ -1098,7 +1295,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1098
1295
|
<up-select
|
|
1099
1296
|
searchable
|
|
1100
1297
|
virtualScroll
|
|
1101
|
-
appendTo="body"
|
|
1102
1298
|
bindValue="code"
|
|
1103
1299
|
bindLabel="displayLabel"
|
|
1104
1300
|
[value]="value()"
|
|
@@ -1106,6 +1302,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1106
1302
|
[loading]="isLoading()"
|
|
1107
1303
|
[multiple]="multiple()"
|
|
1108
1304
|
[class]="inlineClass()"
|
|
1305
|
+
[appendTo]="appendTo()"
|
|
1109
1306
|
[clearable]="clearable()"
|
|
1110
1307
|
[placeholder]="placeholder()"
|
|
1111
1308
|
[disabled]="disabled() || _disabled()"
|
|
@@ -1114,7 +1311,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1114
1311
|
/>
|
|
1115
1312
|
`,
|
|
1116
1313
|
}]
|
|
1117
|
-
}], ctorParameters: () => [{ type: i1$1.CurrencyService }], propDecorators: { multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
1314
|
+
}], ctorParameters: () => [{ type: i1$1.CurrencyService }], propDecorators: { multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
1118
1315
|
|
|
1119
1316
|
class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
1120
1317
|
constructor() {
|
|
@@ -1190,8 +1387,8 @@ class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
|
1190
1387
|
this.changed.emit(this.value());
|
|
1191
1388
|
}
|
|
1192
1389
|
}
|
|
1193
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1194
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.
|
|
1390
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpSearchableSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1391
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: UpSearchableSelectComponent, isStandalone: true, selector: "up-searchable-select", inputs: { query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, initialItems: { classPropertyName: "initialItems", publicName: "initialItems", isSignal: true, isRequired: false, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: true, isRequired: false, transformFunction: null }, bindValue: { classPropertyName: "bindValue", publicName: "bindValue", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, addTag: { classPropertyName: "addTag", publicName: "addTag", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loading: "loadingChange", value: "valueChange", changed: "changed" }, host: { classAttribute: "block relative" }, providers: [
|
|
1195
1392
|
{
|
|
1196
1393
|
provide: UpFieldControl,
|
|
1197
1394
|
useExisting: forwardRef(() => UpSearchableSelectComponent)
|
|
@@ -1226,7 +1423,7 @@ class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
|
1226
1423
|
/>
|
|
1227
1424
|
`, isInline: true, styles: [".ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{background-color:var(--accent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left{border-right-color:color-mix(in oklab,var(--primary) 50%,transparent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left:hover{background-color:color-mix(in oklab,var(--primary) 40%,transparent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{opacity:30%;top:50%!important;padding-bottom:0!important;transform:translateY(-50%)!important}.ng-select .ng-select-container{transition:all .2s ease}.ng-select .ng-select-container .ng-value-container{align-items:center;padding-left:.75rem}.ng-select .ng-select-container .ng-value-container .ng-placeholder{color:var(--muted-foreground)}.ng-select .ng-select-container .ng-arrow-wrapper{padding-right:.75rem}.ng-select .ng-select-container .ng-clear-wrapper{margin-right:.25rem;transition:color .2s ease}.ng-select .ng-select-container .ng-clear-wrapper:hover .ng-clear{color:var(--destructive)}.ng-dropdown-panel{overflow:hidden;margin-top:.25rem!important;border-color:var(--border)!important;border-radius:calc(var(--radius) - 2px)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.ng-dropdown-panel .ng-option-label{color:#000;font-size:1rem}@media screen and (min-width:48rem){.ng-dropdown-panel .ng-option-label{font-size:.875rem}}.ng-dropdown-panel .ng-option:hover,.ng-dropdown-panel .ng-option-marked{background-color:var(--accent)!important}.ng-dropdown-panel .ng-option-selected{color:#000!important;background-color:color-mix(in oklab,var(--primary) 15%,transparent)!important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "dropdownPosition", "appendTo", "outsideClickEvent", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "tabFocusOnClearButton", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "clearKeepsDisabledOptions", "deselectOnClick", "clearSearchOnAdd", "compareWith", "keyDownFn", "bindLabel", "bindValue", "appearance", "isOpen", "items"], outputs: ["bindLabelChange", "bindValueChange", "appearanceChange", "isOpenChange", "itemsChange", "blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"], exportAs: ["ngSelect"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1228
1425
|
}
|
|
1229
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1426
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpSearchableSelectComponent, decorators: [{
|
|
1230
1427
|
type: Component,
|
|
1231
1428
|
args: [{ standalone: true, selector: 'up-searchable-select', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
1232
1429
|
class: 'block relative',
|
|
@@ -1344,8 +1541,8 @@ class UpRateGroupCodeSelectComponent extends UpFieldControlComponent {
|
|
|
1344
1541
|
this.changed.emit(value);
|
|
1345
1542
|
}
|
|
1346
1543
|
}
|
|
1347
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1348
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
1544
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpRateGroupCodeSelectComponent, deps: [{ token: i1$1.RateGroupCodeService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1545
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: UpRateGroupCodeSelectComponent, isStandalone: true, selector: "up-rate-group-code-select", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", changed: "changed" }, host: { classAttribute: "block" }, providers: [
|
|
1349
1546
|
{
|
|
1350
1547
|
provide: UpFieldControl,
|
|
1351
1548
|
useExisting: forwardRef(() => UpRateGroupCodeSelectComponent),
|
|
@@ -1370,7 +1567,7 @@ class UpRateGroupCodeSelectComponent extends UpFieldControlComponent {
|
|
|
1370
1567
|
/>
|
|
1371
1568
|
`, isInline: true, dependencies: [{ kind: "component", type: UpSearchableSelectComponent, selector: "up-searchable-select", inputs: ["query", "label", "placeholder", "initialItems", "bindLabel", "bindValue", "appendTo", "class", "addTag", "multiple", "required", "disabled", "clearable", "virtualScroll", "loading", "value"], outputs: ["loadingChange", "valueChange", "changed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1372
1569
|
}
|
|
1373
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1570
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpRateGroupCodeSelectComponent, decorators: [{
|
|
1374
1571
|
type: Component,
|
|
1375
1572
|
args: [{
|
|
1376
1573
|
standalone: true,
|
|
@@ -1462,8 +1659,8 @@ class UpDatepickerComponent extends UpFieldControlComponent {
|
|
|
1462
1659
|
this._onTouched();
|
|
1463
1660
|
this._isTouched = true;
|
|
1464
1661
|
}
|
|
1465
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1466
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.
|
|
1662
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpDatepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1663
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: UpDatepickerComponent, isStandalone: true, selector: "up-datepicker", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1467
1664
|
{
|
|
1468
1665
|
provide: UpFieldControl,
|
|
1469
1666
|
useExisting: forwardRef(() => UpDatepickerComponent),
|
|
@@ -1507,7 +1704,7 @@ class UpDatepickerComponent extends UpFieldControlComponent {
|
|
|
1507
1704
|
</up-popover>
|
|
1508
1705
|
`, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: UpButtonDirective, selector: "[upButton]", inputs: ["size", "variant", "class"], exportAs: ["upButton"] }, { kind: "component", type: UpPopoverComponent, selector: "up-popover", inputs: ["placement", "alignment", "placementOffset", "alignmentOffset"] }, { kind: "component", type: UpCalendarComponent, selector: "up-calendar", inputs: ["minDate", "maxDate", "variant", "activeDay", "activeRangeDay"], outputs: ["selected", "rangeSelected", "activeDayChange", "activeRangeDayChange"] }, { kind: "directive", type: UpPopoverTriggerDirective, selector: "[upPopoverTrigger]", exportAs: ["upPopoverTrigger"] }, { kind: "directive", type: UpPopoverContentRefDirective, selector: "[upPopoverContentRef]", exportAs: ["upPopoverContentRef"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1509
1706
|
}
|
|
1510
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1707
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpDatepickerComponent, decorators: [{
|
|
1511
1708
|
type: Component,
|
|
1512
1709
|
args: [{
|
|
1513
1710
|
standalone: true,
|
|
@@ -1618,8 +1815,8 @@ class UpDateRangePickerComponent extends UpFieldControlComponent {
|
|
|
1618
1815
|
this._onTouched();
|
|
1619
1816
|
this._isTouched = true;
|
|
1620
1817
|
}
|
|
1621
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1622
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
1818
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpDateRangePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1819
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: UpDateRangePickerComponent, isStandalone: true, selector: "up-date-range-picker", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1623
1820
|
{
|
|
1624
1821
|
provide: UpFieldControl,
|
|
1625
1822
|
useExisting: forwardRef(() => UpDateRangePickerComponent)
|
|
@@ -1664,7 +1861,7 @@ class UpDateRangePickerComponent extends UpFieldControlComponent {
|
|
|
1664
1861
|
</up-popover>
|
|
1665
1862
|
`, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: UpButtonDirective, selector: "[upButton]", inputs: ["size", "variant", "class"], exportAs: ["upButton"] }, { kind: "component", type: UpPopoverComponent, selector: "up-popover", inputs: ["placement", "alignment", "placementOffset", "alignmentOffset"] }, { kind: "component", type: UpCalendarComponent, selector: "up-calendar", inputs: ["minDate", "maxDate", "variant", "activeDay", "activeRangeDay"], outputs: ["selected", "rangeSelected", "activeDayChange", "activeRangeDayChange"] }, { kind: "directive", type: UpPopoverTriggerDirective, selector: "[upPopoverTrigger]", exportAs: ["upPopoverTrigger"] }, { kind: "directive", type: UpPopoverContentRefDirective, selector: "[upPopoverContentRef]", exportAs: ["upPopoverContentRef"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1666
1863
|
}
|
|
1667
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1864
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpDateRangePickerComponent, decorators: [{
|
|
1668
1865
|
type: Component,
|
|
1669
1866
|
args: [{
|
|
1670
1867
|
standalone: true,
|
|
@@ -1775,10 +1972,10 @@ class OpacityPipe {
|
|
|
1775
1972
|
return 'opacity-15';
|
|
1776
1973
|
}
|
|
1777
1974
|
}
|
|
1778
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1779
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.
|
|
1975
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: OpacityPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1976
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: OpacityPipe, isStandalone: true, name: "opacity" }); }
|
|
1780
1977
|
}
|
|
1781
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1978
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: OpacityPipe, decorators: [{
|
|
1782
1979
|
type: Pipe,
|
|
1783
1980
|
args: [{
|
|
1784
1981
|
name: 'opacity',
|
|
@@ -2007,8 +2204,8 @@ class UpTimeComponent {
|
|
|
2007
2204
|
this.timeChanged.emit(time);
|
|
2008
2205
|
}
|
|
2009
2206
|
}
|
|
2010
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
2011
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
2207
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpTimeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2208
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: UpTimeComponent, isStandalone: true, selector: "up-time", inputs: { minuteInterval: { classPropertyName: "minuteInterval", publicName: "minuteInterval", isSignal: true, isRequired: false, transformFunction: null }, minTime: { classPropertyName: "minTime", publicName: "minTime", isSignal: true, isRequired: false, transformFunction: null }, maxTime: { classPropertyName: "maxTime", publicName: "maxTime", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { timeChanged: "timeChanged" }, viewQueries: [{ propertyName: "hoursScroll", first: true, predicate: ["hoursScroll"], descendants: true, isSignal: true }, { propertyName: "minutesScroll", first: true, predicate: ["minutesScroll"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
2012
2209
|
<div
|
|
2013
2210
|
class="relative w-37 flex gap-2 rounded-xl border border-border bg-white p-3 shadow-lg"
|
|
2014
2211
|
[style.height.px]="containerHeight"
|
|
@@ -2095,7 +2292,7 @@ class UpTimeComponent {
|
|
|
2095
2292
|
</div>
|
|
2096
2293
|
`, isInline: true, dependencies: [{ kind: "pipe", type: DecimalPipe, name: "number" }, { kind: "pipe", type: OpacityPipe, name: "opacity" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2097
2294
|
}
|
|
2098
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2295
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpTimeComponent, decorators: [{
|
|
2099
2296
|
type: Component,
|
|
2100
2297
|
args: [{
|
|
2101
2298
|
selector: 'up-time',
|
|
@@ -2259,8 +2456,8 @@ class UpTimepickerComponent extends UpFieldControlComponent {
|
|
|
2259
2456
|
this._onTouched();
|
|
2260
2457
|
this._isTouched = true;
|
|
2261
2458
|
}
|
|
2262
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
2263
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
2459
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpTimepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2460
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: UpTimepickerComponent, isStandalone: true, selector: "up-timepicker", inputs: { minTime: { classPropertyName: "minTime", publicName: "minTime", isSignal: true, isRequired: false, transformFunction: null }, maxTime: { classPropertyName: "maxTime", publicName: "maxTime", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, initialHour: { classPropertyName: "initialHour", publicName: "initialHour", isSignal: true, isRequired: false, transformFunction: null }, initialMinute: { classPropertyName: "initialMinute", publicName: "initialMinute", isSignal: true, isRequired: false, transformFunction: null }, minuteInterval: { classPropertyName: "minuteInterval", publicName: "minuteInterval", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
2264
2461
|
{
|
|
2265
2462
|
provide: UpFieldControl,
|
|
2266
2463
|
useExisting: forwardRef(() => UpTimepickerComponent),
|
|
@@ -2304,7 +2501,7 @@ class UpTimepickerComponent extends UpFieldControlComponent {
|
|
|
2304
2501
|
</up-popover>
|
|
2305
2502
|
`, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: UpButtonDirective, selector: "[upButton]", inputs: ["size", "variant", "class"], exportAs: ["upButton"] }, { kind: "component", type: UpPopoverComponent, selector: "up-popover", inputs: ["placement", "alignment", "placementOffset", "alignmentOffset"] }, { kind: "directive", type: UpPopoverTriggerDirective, selector: "[upPopoverTrigger]", exportAs: ["upPopoverTrigger"] }, { kind: "directive", type: UpPopoverContentRefDirective, selector: "[upPopoverContentRef]", exportAs: ["upPopoverContentRef"] }, { kind: "component", type: UpTimeComponent, selector: "up-time", inputs: ["minuteInterval", "minTime", "maxTime", "value"], outputs: ["timeChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2306
2503
|
}
|
|
2307
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2504
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpTimepickerComponent, decorators: [{
|
|
2308
2505
|
type: Component,
|
|
2309
2506
|
args: [{
|
|
2310
2507
|
selector: 'up-timepicker',
|
|
@@ -2381,8 +2578,8 @@ class UpFormFieldComponent {
|
|
|
2381
2578
|
this.control().setControlName(this.label());
|
|
2382
2579
|
});
|
|
2383
2580
|
}
|
|
2384
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
2385
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
2581
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2582
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: UpFormFieldComponent, isStandalone: true, selector: "up-form-field", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, queries: [{ propertyName: "control", first: true, predicate: UpFieldControl, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
2386
2583
|
<div
|
|
2387
2584
|
class="
|
|
2388
2585
|
group flex flex-col gap-2
|
|
@@ -2419,7 +2616,7 @@ class UpFormFieldComponent {
|
|
|
2419
2616
|
}
|
|
2420
2617
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2421
2618
|
}
|
|
2422
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2619
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpFormFieldComponent, decorators: [{
|
|
2423
2620
|
type: Component,
|
|
2424
2621
|
args: [{
|
|
2425
2622
|
standalone: true,
|
|
@@ -2528,8 +2725,8 @@ class UpImagePickerComponent extends UpFieldControlComponent {
|
|
|
2528
2725
|
this._onChange(compressedFile);
|
|
2529
2726
|
}
|
|
2530
2727
|
}
|
|
2531
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
2532
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
2728
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpImagePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2729
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: UpImagePickerComponent, isStandalone: true, selector: "up-image-picker", inputs: { ratio: { classPropertyName: "ratio", publicName: "ratio", isSignal: true, isRequired: false, transformFunction: null }, imgSrc: { classPropertyName: "imgSrc", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { imgSrc: "srcChange", changed: "changed" }, providers: [
|
|
2533
2730
|
{
|
|
2534
2731
|
provide: UpFieldControl,
|
|
2535
2732
|
useExisting: forwardRef(() => UpImagePickerComponent)
|
|
@@ -2540,7 +2737,7 @@ class UpImagePickerComponent extends UpFieldControlComponent {
|
|
|
2540
2737
|
})
|
|
2541
2738
|
], viewQueries: [{ propertyName: "file", first: true, predicate: ["file"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div \n upFileDragNDrop \n draggedClass=\"border-dashed border-2 border-foreground/20\"\n [class]=\"_computedClass()\"\n [style.aspect-ratio]=\"ratio()\"\n (fileDropped)=\"selectPhoto($event)\"\n>\n @if (imgSrc()) {\n <img \n class=\"overflow-hidden object-cover size-full\"\n [alt]=\"fileName\" \n [src]=\"imgSrc()\" \n [style.aspect-ratio]=\"ratio()\"\n />\n }\n \n <div \n class=\"absolute inset-0 p-2 flex flex-col items-center justify-center text-muted-foreground cursor-pointer opacity-80 group-hover:opacity-100 transition\"\n [style.aspect-ratio]=\"ratio()\"\n >\n @if (imgSrc() === '') {\n <div \n class=\"flex flex-col items-center\"\n (click)=\"file.click()\"\n >\n <ng-icon\n size=\"24px\"\n name=\"matUpload\"\n />\n <span>Choose Image or Drag here.</span>\n </div>\n }\n @else {\n <div \n class=\"absolute flex items-center ustify-center opacity-0 group-hover:opacity-100 transition text-destructive\"\n (click)=\"clear($event)\"\n >\n <ng-icon\n size=\"24px\"\n name=\"matDelete\"\n />\n </div>\n }\n </div>\n\n <input \n type=\"file\" \n hidden \n accept=\"image/png, image/jpeg, image/jpg\" \n (change)=\"selectPhoto($event)\" \n #file\n />\n</div>\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: UpFileDragNDropDirective, selector: "[upFileDragNDrop]", inputs: ["draggedClass"], outputs: ["fileDropped"], exportAs: ["upFileDragNDrop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2542
2739
|
}
|
|
2543
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2740
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UpImagePickerComponent, decorators: [{
|
|
2544
2741
|
type: Component,
|
|
2545
2742
|
args: [{ standalone: true, selector: 'up-image-picker', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2546
2743
|
{
|
|
@@ -2557,201 +2754,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2557
2754
|
], template: "<div \n upFileDragNDrop \n draggedClass=\"border-dashed border-2 border-foreground/20\"\n [class]=\"_computedClass()\"\n [style.aspect-ratio]=\"ratio()\"\n (fileDropped)=\"selectPhoto($event)\"\n>\n @if (imgSrc()) {\n <img \n class=\"overflow-hidden object-cover size-full\"\n [alt]=\"fileName\" \n [src]=\"imgSrc()\" \n [style.aspect-ratio]=\"ratio()\"\n />\n }\n \n <div \n class=\"absolute inset-0 p-2 flex flex-col items-center justify-center text-muted-foreground cursor-pointer opacity-80 group-hover:opacity-100 transition\"\n [style.aspect-ratio]=\"ratio()\"\n >\n @if (imgSrc() === '') {\n <div \n class=\"flex flex-col items-center\"\n (click)=\"file.click()\"\n >\n <ng-icon\n size=\"24px\"\n name=\"matUpload\"\n />\n <span>Choose Image or Drag here.</span>\n </div>\n }\n @else {\n <div \n class=\"absolute flex items-center ustify-center opacity-0 group-hover:opacity-100 transition text-destructive\"\n (click)=\"clear($event)\"\n >\n <ng-icon\n size=\"24px\"\n name=\"matDelete\"\n />\n </div>\n }\n </div>\n\n <input \n type=\"file\" \n hidden \n accept=\"image/png, image/jpeg, image/jpg\" \n (change)=\"selectPhoto($event)\" \n #file\n />\n</div>\n" }]
|
|
2558
2755
|
}], ctorParameters: () => [], propDecorators: { ratio: [{ type: i0.Input, args: [{ isSignal: true, alias: "ratio", required: false }] }], imgSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }, { type: i0.Output, args: ["srcChange"] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }], file: [{ type: i0.ViewChild, args: ['file', { isSignal: true }] }] } });
|
|
2559
2756
|
|
|
2560
|
-
function setValidator(form, keys, validators) {
|
|
2561
|
-
if (!keys.length ||
|
|
2562
|
-
keys.length === 1) {
|
|
2563
|
-
throw new Error('Use normal action for single keys and keys cannot be empty.');
|
|
2564
|
-
}
|
|
2565
|
-
keys.forEach((key) => {
|
|
2566
|
-
const control = form.get(key);
|
|
2567
|
-
if (control) {
|
|
2568
|
-
control.setValidators(validators);
|
|
2569
|
-
control.updateValueAndValidity();
|
|
2570
|
-
}
|
|
2571
|
-
});
|
|
2572
|
-
}
|
|
2573
|
-
|
|
2574
|
-
function toggleFormControls(form, keys, mode) {
|
|
2575
|
-
if (!keys.length ||
|
|
2576
|
-
keys.length === 1) {
|
|
2577
|
-
throw new Error('Use normal action for single keys and keys cannot be empty.');
|
|
2578
|
-
}
|
|
2579
|
-
keys.forEach((key) => form.get(key)?.[mode]());
|
|
2580
|
-
}
|
|
2581
|
-
|
|
2582
|
-
function prettifyLabel(name) {
|
|
2583
|
-
return name
|
|
2584
|
-
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
2585
|
-
.replace(/_/g, ' ')
|
|
2586
|
-
.replace(/\b\w/g, char => char.toUpperCase());
|
|
2587
|
-
}
|
|
2588
|
-
function convertToDate(value) {
|
|
2589
|
-
if (value instanceof Date)
|
|
2590
|
-
return value;
|
|
2591
|
-
if (typeof value === 'string' &&
|
|
2592
|
-
!isNaN(Date.parse(value))) {
|
|
2593
|
-
return new Date(value);
|
|
2594
|
-
}
|
|
2595
|
-
return null;
|
|
2596
|
-
}
|
|
2597
|
-
/**
|
|
2598
|
-
* Range validator for number and date values.
|
|
2599
|
-
* @param {string} fromKey - The "from" control name
|
|
2600
|
-
* @param {string} toKey - The "to" control name
|
|
2601
|
-
* @returns {ValidatorFn} Throw error message when fromKey is greater than toKey
|
|
2602
|
-
*
|
|
2603
|
-
* Usage:
|
|
2604
|
-
* this.form = new FormGroup({
|
|
2605
|
-
* agingFrom: new FormControl(),
|
|
2606
|
-
* agingTo: new FormControl(),
|
|
2607
|
-
* }, { validators: rangeValidator('agingFrom', 'agingTo') });
|
|
2608
|
-
*/
|
|
2609
|
-
function validRangeValidator(fromKey, toKey) {
|
|
2610
|
-
return (group) => {
|
|
2611
|
-
if (!group) {
|
|
2612
|
-
return null;
|
|
2613
|
-
}
|
|
2614
|
-
const toControl = group.get(toKey);
|
|
2615
|
-
const fromControl = group.get(fromKey);
|
|
2616
|
-
if (!fromControl ||
|
|
2617
|
-
!toControl) {
|
|
2618
|
-
return null;
|
|
2619
|
-
}
|
|
2620
|
-
const toValue = toControl.value;
|
|
2621
|
-
const fromValue = fromControl.value;
|
|
2622
|
-
if (fromValue === null ||
|
|
2623
|
-
toValue === null ||
|
|
2624
|
-
fromValue === '' ||
|
|
2625
|
-
toValue === '') {
|
|
2626
|
-
return null;
|
|
2627
|
-
}
|
|
2628
|
-
let isInvalid = false;
|
|
2629
|
-
const toDate = convertToDate(toValue);
|
|
2630
|
-
const fromDate = convertToDate(fromValue);
|
|
2631
|
-
if (fromDate && toDate) {
|
|
2632
|
-
isInvalid = toDate <= fromDate;
|
|
2633
|
-
}
|
|
2634
|
-
else if (!isNaN(fromValue) &&
|
|
2635
|
-
!isNaN(toValue)) {
|
|
2636
|
-
isInvalid = Number(toValue) <= Number(fromValue);
|
|
2637
|
-
}
|
|
2638
|
-
return !isInvalid ? null : {
|
|
2639
|
-
rangeInvalid: {
|
|
2640
|
-
to: toKey,
|
|
2641
|
-
from: fromKey,
|
|
2642
|
-
message: `${prettifyLabel(toKey)} must be greater than ${prettifyLabel(fromKey)}`
|
|
2643
|
-
}
|
|
2644
|
-
};
|
|
2645
|
-
};
|
|
2646
|
-
}
|
|
2647
|
-
|
|
2648
|
-
/**
|
|
2649
|
-
* Validator that requires all specified form controls to have the same value.
|
|
2650
|
-
*
|
|
2651
|
-
* @param {string[]} controlNames - The names of the controls that must match
|
|
2652
|
-
* @param {string} [message] - Optional custom error message
|
|
2653
|
-
* @returns {ValidatorFn} A validator function producing an `isEqual` error if values do not match
|
|
2654
|
-
*
|
|
2655
|
-
* @example
|
|
2656
|
-
* this.form = new FormGroup({
|
|
2657
|
-
* password: new FormControl(''),
|
|
2658
|
-
* confirmPassword: new FormControl(''),
|
|
2659
|
-
* }, { validators: isEqualValidator(['password', 'confirmPassword']) });
|
|
2660
|
-
*/
|
|
2661
|
-
function isEqualValidator(controlNames, message) {
|
|
2662
|
-
return (group) => {
|
|
2663
|
-
if (!group ||
|
|
2664
|
-
controlNames.length < 2) {
|
|
2665
|
-
return null;
|
|
2666
|
-
}
|
|
2667
|
-
let isEmpty = false;
|
|
2668
|
-
const values = controlNames.reduce((acc, name) => {
|
|
2669
|
-
const control = group.get(name);
|
|
2670
|
-
if (!control) {
|
|
2671
|
-
return acc;
|
|
2672
|
-
}
|
|
2673
|
-
if (!control.value) {
|
|
2674
|
-
isEmpty = true;
|
|
2675
|
-
return acc;
|
|
2676
|
-
}
|
|
2677
|
-
acc.push(control.value);
|
|
2678
|
-
return acc;
|
|
2679
|
-
}, []);
|
|
2680
|
-
if (isEmpty) {
|
|
2681
|
-
return null;
|
|
2682
|
-
}
|
|
2683
|
-
if (!values.every(v => v === values[0])) {
|
|
2684
|
-
const labels = controlNames.map((name) => {
|
|
2685
|
-
return name
|
|
2686
|
-
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
2687
|
-
.replace(/_/g, ' ')
|
|
2688
|
-
.replace(/\b\w/g, char => char.toUpperCase());
|
|
2689
|
-
});
|
|
2690
|
-
return {
|
|
2691
|
-
isEqual: {
|
|
2692
|
-
fields: controlNames,
|
|
2693
|
-
message: message || `${labels.join(', ')} should have the same value`
|
|
2694
|
-
}
|
|
2695
|
-
};
|
|
2696
|
-
}
|
|
2697
|
-
return null;
|
|
2698
|
-
};
|
|
2699
|
-
}
|
|
2700
|
-
|
|
2701
|
-
/**
|
|
2702
|
-
* Validator that requires all specified form controls to have different values.
|
|
2703
|
-
*
|
|
2704
|
-
* @param {string[]} controlNames - The names of the controls that must all be unique
|
|
2705
|
-
* @param {string} [message] - Optional custom error message
|
|
2706
|
-
* @returns {ValidatorFn} A validator function producing an `isNotEqual` error if duplicate values exist
|
|
2707
|
-
*
|
|
2708
|
-
* @example
|
|
2709
|
-
* this.form = new FormGroup({
|
|
2710
|
-
* primaryEmail: new FormControl(''),
|
|
2711
|
-
* secondaryEmail: new FormControl(''),
|
|
2712
|
-
* backupEmail: new FormControl(''),
|
|
2713
|
-
* }, { validators: isNotEqualValidator(['primaryEmail', 'secondaryEmail', 'backupEmail']) });
|
|
2714
|
-
*/
|
|
2715
|
-
function isNotEqualValidator(controlNames, message) {
|
|
2716
|
-
return (group) => {
|
|
2717
|
-
if (!group ||
|
|
2718
|
-
controlNames.length < 2) {
|
|
2719
|
-
return null;
|
|
2720
|
-
}
|
|
2721
|
-
let isEmpty = false;
|
|
2722
|
-
const values = controlNames.reduce((acc, name) => {
|
|
2723
|
-
const control = group.get(name);
|
|
2724
|
-
if (!control) {
|
|
2725
|
-
return acc;
|
|
2726
|
-
}
|
|
2727
|
-
if (!control.value) {
|
|
2728
|
-
isEmpty = true;
|
|
2729
|
-
return acc;
|
|
2730
|
-
}
|
|
2731
|
-
acc.push(control.value);
|
|
2732
|
-
return acc;
|
|
2733
|
-
}, []);
|
|
2734
|
-
if (isEmpty) {
|
|
2735
|
-
return null;
|
|
2736
|
-
}
|
|
2737
|
-
if (new Set(values).size !== values.length) {
|
|
2738
|
-
const labels = controlNames.map((name) => {
|
|
2739
|
-
return name
|
|
2740
|
-
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
2741
|
-
.replace(/_/g, ' ')
|
|
2742
|
-
.replace(/\b\w/g, char => char.toUpperCase());
|
|
2743
|
-
});
|
|
2744
|
-
return {
|
|
2745
|
-
isNotEqual: {
|
|
2746
|
-
fields: controlNames,
|
|
2747
|
-
message: message || `${labels.join(', ')} should have different values`
|
|
2748
|
-
}
|
|
2749
|
-
};
|
|
2750
|
-
}
|
|
2751
|
-
return null;
|
|
2752
|
-
};
|
|
2753
|
-
}
|
|
2754
|
-
|
|
2755
2757
|
/**
|
|
2756
2758
|
* Generated bundle index. Do not edit.
|
|
2757
2759
|
*/
|