@rxap/forms 16.0.3 → 17.0.1-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/esm2022/index.mjs +51 -41
- package/esm2022/lib/control-actions.mjs +1 -1
- package/esm2022/lib/decorators/control-async-validator.mjs +1 -1
- package/esm2022/lib/decorators/control-change.mjs +1 -1
- package/esm2022/lib/decorators/control-validator.mjs +1 -1
- package/esm2022/lib/directives/form-control-error.directive.mjs +6 -6
- package/esm2022/lib/directives/form-control-mark-dirty.directive.mjs +5 -5
- package/esm2022/lib/directives/form-control-mark-pristine.directive.mjs +5 -5
- package/esm2022/lib/directives/form-control-mark-touched.directive.mjs +5 -5
- package/esm2022/lib/directives/form-control-mark-untouched.directive.mjs +5 -5
- package/esm2022/lib/directives/form-control-name.directive.mjs +6 -6
- package/esm2022/lib/directives/form-group-name.directive.mjs +6 -6
- package/esm2022/lib/directives/form-loaded.directive.mjs +6 -6
- package/esm2022/lib/directives/form-loading-error.directive.mjs +6 -6
- package/esm2022/lib/directives/form-loading.directive.mjs +6 -6
- package/esm2022/lib/directives/form-submit-failed.directive.mjs +6 -6
- package/esm2022/lib/directives/form-submit-invalid.directive.mjs +6 -6
- package/esm2022/lib/directives/form-submit-successful.directive.mjs +6 -6
- package/esm2022/lib/directives/form-submit.directive.mjs +6 -6
- package/esm2022/lib/directives/form-submitting.directive.mjs +6 -6
- package/esm2022/lib/directives/form.directive.mjs +6 -6
- package/esm2022/lib/directives/forms.module.mjs +5 -5
- package/esm2022/lib/directives/parent-control-container.directive.mjs +4 -4
- package/esm2022/lib/form-array.mjs +1 -1
- package/esm2022/lib/form-builder.mjs +1 -1
- package/esm2022/lib/form-control.mjs +1 -1
- package/esm2022/lib/form-group.mjs +1 -1
- package/esm2022/lib/validators/is-array.mjs +1 -1
- package/esm2022/lib/validators/is-boolean.mjs +1 -1
- package/esm2022/lib/validators/is-complex.mjs +1 -1
- package/esm2022/lib/validators/is-date.mjs +1 -1
- package/esm2022/lib/validators/is-email.mjs +1 -1
- package/esm2022/lib/validators/is-enum.mjs +1 -1
- package/esm2022/lib/validators/is-int.mjs +1 -1
- package/esm2022/lib/validators/is-ip.mjs +1 -1
- package/esm2022/lib/validators/is-number.mjs +1 -1
- package/esm2022/lib/validators/is-object.mjs +1 -1
- package/esm2022/lib/validators/is-phone-number.mjs +1 -1
- package/esm2022/lib/validators/is-port.mjs +1 -1
- package/esm2022/lib/validators/is-string.mjs +1 -1
- package/esm2022/lib/validators/is-url.mjs +1 -1
- package/esm2022/lib/validators/is-uuid.mjs +1 -1
- package/fesm2022/rxap-forms.mjs +1087 -1086
- package/fesm2022/rxap-forms.mjs.map +1 -1
- package/index.d.ts +45 -37
- package/package.json +25 -26
package/fesm2022/rxap-forms.mjs
CHANGED
|
@@ -1,19 +1,711 @@
|
|
|
1
|
+
import { isMobilePhone, isEmail, isURL, isIP, isPort, isUUID } from '@rxap/validator';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Directive, Host, SkipSelf, Input, HostListener, forwardRef, Optional, Self, Inject, InjectionToken, isDevMode, Injector, EventEmitter, ChangeDetectorRef, Output, HostBinding, TemplateRef, ViewContainerRef, NgModule } from '@angular/core';
|
|
1
4
|
import * as i1 from '@angular/forms';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
5
|
+
import { FormControlName, NG_VALIDATORS, NG_ASYNC_VALIDATORS, NG_VALUE_ACCESSOR, NgControl, FormGroupName, ControlContainer, UntypedFormArray, AbstractControl, UntypedFormGroup, UntypedFormControl, Validators, FormGroupDirective } from '@angular/forms';
|
|
6
|
+
import { startWith, filter, tap, map, distinctUntilChanged, debounceTime, take } from 'rxjs/operators';
|
|
7
|
+
import { hasIndexSignature, equals, coerceArray, HasRxapOnInitMethod, assertIsArray, assertIsObject, assertIsFunction, isPromise, isObject, clone, coerceBoolean } from '@rxap/utilities';
|
|
4
8
|
import { merge, defer, of, EMPTY, Subject, isObservable, BehaviorSubject, Subscription } from 'rxjs';
|
|
5
|
-
import { equals, coerceArray, HasRxapOnInitMethod, assertIsArray, assertIsObject, assertIsFunction, isPromise, isObject, clone, hasIndexSignature, coerceBoolean } from '@rxap/utilities';
|
|
6
|
-
import * as i0 from '@angular/core';
|
|
7
|
-
import { isDevMode, Injector, InjectionToken, EventEmitter, ChangeDetectorRef, forwardRef, Directive, Inject, Optional, SkipSelf, Input, Output, HostBinding, TemplateRef, ViewContainerRef, Host, HostListener, Self, NgModule } from '@angular/core';
|
|
8
|
-
import { GetDefinitionMetadata, DefinitionMetadata } from '@rxap/definition';
|
|
9
|
-
import { getMetadata, setMetadataMapSet, setMetadataMap } from '@rxap/reflect-metadata';
|
|
10
9
|
import * as i2 from '@rxap/services';
|
|
11
10
|
import { LoadingIndicatorService } from '@rxap/services';
|
|
12
11
|
import { ToggleSubject } from '@rxap/rxjs';
|
|
12
|
+
import { GetDefinitionMetadata, DefinitionMetadata } from '@rxap/definition';
|
|
13
|
+
import { getMetadata, setMetadataMapSet, setMetadataMap } from '@rxap/reflect-metadata';
|
|
13
14
|
import * as i2$1 from '@angular/router';
|
|
14
15
|
import { Router } from '@angular/router';
|
|
15
16
|
import { ConfirmClick } from '@rxap/directives';
|
|
16
|
-
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Checks if a given value is a number.
|
|
20
|
+
*/
|
|
21
|
+
function isNumber(value, options = {}) {
|
|
22
|
+
if (typeof value !== 'number') {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
if (value === Infinity || value === -Infinity) {
|
|
26
|
+
return options.allowInfinity ?? false;
|
|
27
|
+
}
|
|
28
|
+
if (Number.isNaN(value)) {
|
|
29
|
+
return options.allowNaN ?? false;
|
|
30
|
+
}
|
|
31
|
+
if (options.maxDecimalPlaces !== undefined) {
|
|
32
|
+
let decimalPlaces = 0;
|
|
33
|
+
if (value % 1 !== 0) {
|
|
34
|
+
decimalPlaces = value.toString().split('.')[1].length;
|
|
35
|
+
}
|
|
36
|
+
if (decimalPlaces > options.maxDecimalPlaces) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return Number.isFinite(value);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated use RxapValidators.isNumber() instead
|
|
44
|
+
* @param control
|
|
45
|
+
* @constructor
|
|
46
|
+
*/
|
|
47
|
+
function IsNumber(control) {
|
|
48
|
+
if (control.value === null) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
if (isNaN(Number(control.value))) {
|
|
52
|
+
return {
|
|
53
|
+
isNumber: {
|
|
54
|
+
expected: 'A number or a string representing a number',
|
|
55
|
+
actual: control.value,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
function _IsNumber({ message, options, } = {}) {
|
|
62
|
+
return (control) => {
|
|
63
|
+
if (control.value === null) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
if (!isNumber(!options?.strict && typeof control.value === 'string' ? Number(control.value) : control.value, options)) {
|
|
67
|
+
return {
|
|
68
|
+
isNumber: {
|
|
69
|
+
expected: 'A number value',
|
|
70
|
+
actual: control.value,
|
|
71
|
+
message,
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function IsBoolean({ message } = {}) {
|
|
80
|
+
return (control) => {
|
|
81
|
+
if (control.value === null) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
if (!(control.value instanceof Boolean || typeof control.value === 'boolean')) {
|
|
85
|
+
return {
|
|
86
|
+
isBoolean: {
|
|
87
|
+
expected: 'A boolean value',
|
|
88
|
+
actual: control.value,
|
|
89
|
+
message,
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function IsObject({ message } = {}) {
|
|
98
|
+
return (control) => {
|
|
99
|
+
if (control.value === null) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
if (!(control.value !==
|
|
103
|
+
undefined &&
|
|
104
|
+
(typeof control.value === 'object' || typeof control.value === 'function') &&
|
|
105
|
+
!Array.isArray(control.value))) {
|
|
106
|
+
return {
|
|
107
|
+
isObject: {
|
|
108
|
+
expected: 'A object value',
|
|
109
|
+
actual: control.value,
|
|
110
|
+
message,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function IsString({ message } = {}) {
|
|
119
|
+
return (control) => {
|
|
120
|
+
if (control.value === null) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
if (!(control.value instanceof String || typeof control.value === 'string')) {
|
|
124
|
+
return {
|
|
125
|
+
isString: {
|
|
126
|
+
expected: 'A string value',
|
|
127
|
+
actual: control.value,
|
|
128
|
+
message,
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function IsInt({ message, options, } = {}) {
|
|
137
|
+
return (control) => {
|
|
138
|
+
if (control.value === null) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
if (!isNumber(control.value, options) || Number.isInteger(control.value)) {
|
|
142
|
+
return {
|
|
143
|
+
isInt: {
|
|
144
|
+
expected: 'A int value',
|
|
145
|
+
actual: control.value,
|
|
146
|
+
message,
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
return null;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function IsEnum({ message, entity, }) {
|
|
155
|
+
return (control) => {
|
|
156
|
+
if (control.value === null) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
if (Object.keys(entity).map(k => entity[k]).indexOf(control.value) === -1) {
|
|
160
|
+
return {
|
|
161
|
+
isEnum: {
|
|
162
|
+
expected: 'A enum value',
|
|
163
|
+
actual: control.value,
|
|
164
|
+
message,
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
return null;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function IsDate({ message } = {}) {
|
|
173
|
+
return (control) => {
|
|
174
|
+
if (control.value === null) {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
if (!(control.value instanceof Date && !isNaN(control.value.getTime()))) {
|
|
178
|
+
return {
|
|
179
|
+
isDate: {
|
|
180
|
+
expected: 'A date value',
|
|
181
|
+
actual: control.value,
|
|
182
|
+
message,
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
return null;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function IsArray({ message } = {}) {
|
|
191
|
+
return (control) => {
|
|
192
|
+
if (control.value === null) {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
if (!Array.isArray(control.value)) {
|
|
196
|
+
return {
|
|
197
|
+
isArray: {
|
|
198
|
+
expected: 'A array value',
|
|
199
|
+
actual: control.value,
|
|
200
|
+
message,
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
return null;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const regexOptions = {
|
|
209
|
+
uppercase: '.*[A-Z]',
|
|
210
|
+
special: '.*[^A-Za-z0-9]',
|
|
211
|
+
digit: '.*[0-9]',
|
|
212
|
+
lowercase: '.*[a-z]',
|
|
213
|
+
upperLower: '.*[a-zA-Z]',
|
|
214
|
+
alphaNumeric: '.*[a-zA-Z0-9]',
|
|
215
|
+
};
|
|
216
|
+
const lengthOptions = {
|
|
217
|
+
min: '.{n,}',
|
|
218
|
+
max: '.{0,n}',
|
|
219
|
+
range: '.{min,max}',
|
|
220
|
+
exact: '.{n}',
|
|
221
|
+
no_limit: '.*',
|
|
222
|
+
};
|
|
223
|
+
function inOperator(k, o) {
|
|
224
|
+
return k in o;
|
|
225
|
+
}
|
|
226
|
+
function create(options) {
|
|
227
|
+
let regex = '^';
|
|
228
|
+
for (const [key, value] of Object.entries(regexOptions)) {
|
|
229
|
+
if (inOperator(key, options) && isNumber(options[key])) {
|
|
230
|
+
regex += '(?=' + value.repeat(options[key]) + ')';
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (isNumber(options.min) && isNumber(options.max)) {
|
|
234
|
+
regex += lengthOptions.range.replace('min', options.min.toFixed(0)).replace('max', options.max.toFixed(0));
|
|
235
|
+
}
|
|
236
|
+
else if (isNumber(options.max)) {
|
|
237
|
+
regex += lengthOptions.max.replace('n', options.max.toFixed(0));
|
|
238
|
+
}
|
|
239
|
+
else if (isNumber(options.min)) {
|
|
240
|
+
regex += lengthOptions.min.replace('n', options.min.toFixed(0));
|
|
241
|
+
}
|
|
242
|
+
else if (isNumber(options.exact)) {
|
|
243
|
+
regex += lengthOptions.exact.replace('n', options.exact.toFixed(0));
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
regex += lengthOptions.no_limit;
|
|
247
|
+
}
|
|
248
|
+
regex += '$';
|
|
249
|
+
return regex;
|
|
250
|
+
}
|
|
251
|
+
function check(str, regexStringOrOptions) {
|
|
252
|
+
let regexString;
|
|
253
|
+
if (typeof regexStringOrOptions === 'object') {
|
|
254
|
+
regexString = create(regexStringOrOptions);
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
regexString = regexStringOrOptions;
|
|
258
|
+
}
|
|
259
|
+
return new RegExp(regexString).test(str);
|
|
260
|
+
}
|
|
261
|
+
function checkError(str, options) {
|
|
262
|
+
const returnObject = {};
|
|
263
|
+
for (const [key, value] of Object.entries(options)) {
|
|
264
|
+
returnObject[key] = check(str, { [key]: value });
|
|
265
|
+
}
|
|
266
|
+
return returnObject;
|
|
267
|
+
}
|
|
268
|
+
function IsComplex({ message, options, }) {
|
|
269
|
+
return (control) => {
|
|
270
|
+
if (control.value === null) {
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
const isNotString = IsString({ message })(control);
|
|
274
|
+
if (isNotString !== null) {
|
|
275
|
+
return isNotString;
|
|
276
|
+
}
|
|
277
|
+
const errors = checkError(control.value, options);
|
|
278
|
+
if (Object.keys(errors).length && Object.values(errors).some(item => !item)) {
|
|
279
|
+
return {
|
|
280
|
+
isComplex: {
|
|
281
|
+
expected: options,
|
|
282
|
+
actual: errors,
|
|
283
|
+
message,
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
return null;
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function IsPhoneNumber({ message, locale, options, } = {}) {
|
|
292
|
+
return (control) => {
|
|
293
|
+
if (control.value === null) {
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
if (!isMobilePhone(control.value, locale, options)) {
|
|
297
|
+
return {
|
|
298
|
+
isPhoneNumber: {
|
|
299
|
+
expected: 'A phone number value',
|
|
300
|
+
actual: control.value,
|
|
301
|
+
message,
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
return null;
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function IsEmail({ message, options, } = {}) {
|
|
310
|
+
return (control) => {
|
|
311
|
+
if (control.value === null) {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
if (!(typeof control.value === 'string' && isEmail(control.value, options))) {
|
|
315
|
+
return {
|
|
316
|
+
isEmail: {
|
|
317
|
+
expected: 'A email value',
|
|
318
|
+
actual: control.value,
|
|
319
|
+
message,
|
|
320
|
+
},
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
return null;
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function IsUrl({ message, options, } = {}) {
|
|
328
|
+
return (control) => {
|
|
329
|
+
if (control.value === null) {
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
if (!(typeof control.value === 'string' && isURL(control.value, options))) {
|
|
333
|
+
return {
|
|
334
|
+
isURL: {
|
|
335
|
+
expected: 'A url value',
|
|
336
|
+
actual: control.value,
|
|
337
|
+
message,
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
return null;
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function IsIP({ message, version, } = {}) {
|
|
346
|
+
return (control) => {
|
|
347
|
+
if (control.value === null) {
|
|
348
|
+
return null;
|
|
349
|
+
}
|
|
350
|
+
if (!(typeof control.value === 'string' && isIP(control.value, version))) {
|
|
351
|
+
return {
|
|
352
|
+
isIp: {
|
|
353
|
+
expected: `A valid IPv${version ?? '4'} value`,
|
|
354
|
+
actual: control.value,
|
|
355
|
+
message,
|
|
356
|
+
},
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
return null;
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
function IsPort({ message } = {}) {
|
|
364
|
+
return (control) => {
|
|
365
|
+
if (control.value === null) {
|
|
366
|
+
return null;
|
|
367
|
+
}
|
|
368
|
+
if (!(typeof control.value === 'string' && isPort(control.value))) {
|
|
369
|
+
return {
|
|
370
|
+
isPort: {
|
|
371
|
+
expected: `A valid port number between 1 and 65535`,
|
|
372
|
+
actual: control.value,
|
|
373
|
+
message,
|
|
374
|
+
},
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
return null;
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
function IsUUID({ message, version = 'all', } = {}) {
|
|
382
|
+
return (control) => {
|
|
383
|
+
if (control.value === null) {
|
|
384
|
+
return null;
|
|
385
|
+
}
|
|
386
|
+
if (!(typeof control.value === 'string' && isUUID(control.value, version))) {
|
|
387
|
+
return {
|
|
388
|
+
isUuid: {
|
|
389
|
+
expected: version === 'all' ? `A valid uuid` : `A valid uuid version ${version}`,
|
|
390
|
+
actual: control.value,
|
|
391
|
+
message,
|
|
392
|
+
},
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
return null;
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
const RxapValidators = {
|
|
400
|
+
IsNumber: _IsNumber,
|
|
401
|
+
IsBoolean,
|
|
402
|
+
IsArray,
|
|
403
|
+
IsDate,
|
|
404
|
+
IsEnum,
|
|
405
|
+
IsInt,
|
|
406
|
+
IsObject,
|
|
407
|
+
IsString,
|
|
408
|
+
IsComplex,
|
|
409
|
+
IsPhoneNumber,
|
|
410
|
+
IsEmail,
|
|
411
|
+
IsUrl,
|
|
412
|
+
IsIP,
|
|
413
|
+
IsPort,
|
|
414
|
+
IsUUID,
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* @deprecated removed use the rxapControlError or rxapControlErrors directive
|
|
419
|
+
*/
|
|
420
|
+
class FormControlErrorDirective {
|
|
421
|
+
constructor(template, parent, viewContainerRef) {
|
|
422
|
+
this.template = template;
|
|
423
|
+
this.parent = parent;
|
|
424
|
+
this.viewContainerRef = viewContainerRef;
|
|
425
|
+
}
|
|
426
|
+
ngOnInit() {
|
|
427
|
+
const control = this.parent.control?.get(this.name);
|
|
428
|
+
if (!control) {
|
|
429
|
+
throw new Error('Could not extract form control instance');
|
|
430
|
+
}
|
|
431
|
+
this.subscription = control.statusChanges.pipe(startWith(control.status), filter(status => status === 'INVALID'), tap(() => {
|
|
432
|
+
this.viewContainerRef.clear();
|
|
433
|
+
if (control.hasError(this.errorKey)) {
|
|
434
|
+
this.viewContainerRef.createEmbeddedView(this.template, { $implicit: control.getError(this.errorKey) });
|
|
435
|
+
}
|
|
436
|
+
})).subscribe();
|
|
437
|
+
}
|
|
438
|
+
ngOnDestroy() {
|
|
439
|
+
this.subscription?.unsubscribe();
|
|
440
|
+
}
|
|
441
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormControlErrorDirective, deps: [{ token: i0.TemplateRef }, { token: i1.ControlContainer, host: true, skipSelf: true }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
442
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormControlErrorDirective, isStandalone: true, selector: "[rxapFormControlError]", inputs: { name: ["rxapFormControlErrorFrom", "name"], errorKey: ["rxapFormControlErrorIf", "errorKey"] }, ngImport: i0 }); }
|
|
443
|
+
}
|
|
444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormControlErrorDirective, decorators: [{
|
|
445
|
+
type: Directive,
|
|
446
|
+
args: [{
|
|
447
|
+
selector: '[rxapFormControlError]',
|
|
448
|
+
standalone: true,
|
|
449
|
+
}]
|
|
450
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i1.ControlContainer, decorators: [{
|
|
451
|
+
type: Host
|
|
452
|
+
}, {
|
|
453
|
+
type: SkipSelf
|
|
454
|
+
}] }, { type: i0.ViewContainerRef }], propDecorators: { name: [{
|
|
455
|
+
type: Input,
|
|
456
|
+
args: [{
|
|
457
|
+
required: true,
|
|
458
|
+
alias: 'rxapFormControlErrorFrom',
|
|
459
|
+
}]
|
|
460
|
+
}], errorKey: [{
|
|
461
|
+
type: Input,
|
|
462
|
+
args: [{
|
|
463
|
+
required: true,
|
|
464
|
+
alias: 'rxapFormControlErrorIf',
|
|
465
|
+
}]
|
|
466
|
+
}] } });
|
|
467
|
+
|
|
468
|
+
class FormControlMarkDirtyDirective {
|
|
469
|
+
constructor(parent) {
|
|
470
|
+
this.parent = parent;
|
|
471
|
+
}
|
|
472
|
+
onClick() {
|
|
473
|
+
const control = this.parent.control;
|
|
474
|
+
if (control && hasIndexSignature(control) && typeof control['markAllAsDirty'] === 'function') {
|
|
475
|
+
control['markAllAsDirty']();
|
|
476
|
+
}
|
|
477
|
+
else {
|
|
478
|
+
control?.markAsDirty();
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormControlMarkDirtyDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
482
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormControlMarkDirtyDirective, isStandalone: true, selector: "[rxapFormControlMarkDirty]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
|
|
483
|
+
}
|
|
484
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormControlMarkDirtyDirective, decorators: [{
|
|
485
|
+
type: Directive,
|
|
486
|
+
args: [{
|
|
487
|
+
selector: '[rxapFormControlMarkDirty]',
|
|
488
|
+
standalone: true,
|
|
489
|
+
}]
|
|
490
|
+
}], ctorParameters: () => [{ type: i1.ControlContainer }], propDecorators: { onClick: [{
|
|
491
|
+
type: HostListener,
|
|
492
|
+
args: ['click']
|
|
493
|
+
}] } });
|
|
494
|
+
|
|
495
|
+
class FormControlMarkPristineDirective {
|
|
496
|
+
constructor(parent) {
|
|
497
|
+
this.parent = parent;
|
|
498
|
+
}
|
|
499
|
+
onClick() {
|
|
500
|
+
const control = this.parent.control;
|
|
501
|
+
if (control && hasIndexSignature(control) && typeof control['markAllAsPristine'] === 'function') {
|
|
502
|
+
control['markAllAsPristine']();
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
505
|
+
control?.markAsPristine();
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormControlMarkPristineDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
509
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormControlMarkPristineDirective, isStandalone: true, selector: "[rxapFormControlMarkPristine]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
|
|
510
|
+
}
|
|
511
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormControlMarkPristineDirective, decorators: [{
|
|
512
|
+
type: Directive,
|
|
513
|
+
args: [{
|
|
514
|
+
selector: '[rxapFormControlMarkPristine]',
|
|
515
|
+
standalone: true,
|
|
516
|
+
}]
|
|
517
|
+
}], ctorParameters: () => [{ type: i1.ControlContainer }], propDecorators: { onClick: [{
|
|
518
|
+
type: HostListener,
|
|
519
|
+
args: ['click']
|
|
520
|
+
}] } });
|
|
521
|
+
|
|
522
|
+
class FormControlMarkTouchedDirective {
|
|
523
|
+
constructor(parent) {
|
|
524
|
+
this.parent = parent;
|
|
525
|
+
}
|
|
526
|
+
onClick() {
|
|
527
|
+
this.parent.control?.markAllAsTouched();
|
|
528
|
+
}
|
|
529
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormControlMarkTouchedDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
530
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormControlMarkTouchedDirective, isStandalone: true, selector: "[rxapFormControlMarkTouched]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
|
|
531
|
+
}
|
|
532
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormControlMarkTouchedDirective, decorators: [{
|
|
533
|
+
type: Directive,
|
|
534
|
+
args: [{
|
|
535
|
+
selector: '[rxapFormControlMarkTouched]',
|
|
536
|
+
standalone: true,
|
|
537
|
+
}]
|
|
538
|
+
}], ctorParameters: () => [{ type: i1.ControlContainer }], propDecorators: { onClick: [{
|
|
539
|
+
type: HostListener,
|
|
540
|
+
args: ['click']
|
|
541
|
+
}] } });
|
|
542
|
+
|
|
543
|
+
class FormControlMarkUntouchedDirective {
|
|
544
|
+
constructor(parent) {
|
|
545
|
+
this.parent = parent;
|
|
546
|
+
}
|
|
547
|
+
onClick() {
|
|
548
|
+
const control = this.parent.control;
|
|
549
|
+
if (control && hasIndexSignature(control) && typeof control['markAllAsUntouched'] === 'function') {
|
|
550
|
+
control['markAllAsUntouched']();
|
|
551
|
+
}
|
|
552
|
+
else {
|
|
553
|
+
control?.markAsUntouched();
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormControlMarkUntouchedDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
557
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormControlMarkUntouchedDirective, isStandalone: true, selector: "[rxapFormControlMarkUntouched]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
|
|
558
|
+
}
|
|
559
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormControlMarkUntouchedDirective, decorators: [{
|
|
560
|
+
type: Directive,
|
|
561
|
+
args: [{
|
|
562
|
+
selector: '[rxapFormControlMarkUntouched]',
|
|
563
|
+
standalone: true,
|
|
564
|
+
}]
|
|
565
|
+
}], ctorParameters: () => [{ type: i1.ControlContainer }], propDecorators: { onClick: [{
|
|
566
|
+
type: HostListener,
|
|
567
|
+
args: ['click']
|
|
568
|
+
}] } });
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* A full exertion of FormControlName from @angular/forms. The only change is the
|
|
572
|
+
* ability to access the control container outside of the current component
|
|
573
|
+
*
|
|
574
|
+
* @deprecated use the ParentControlContainerDirective
|
|
575
|
+
*/
|
|
576
|
+
class FormControlNameDirective extends FormControlName {
|
|
577
|
+
constructor(parent, validators, asyncValidators, valueAccessors) {
|
|
578
|
+
super(parent, validators, asyncValidators, valueAccessors, null);
|
|
579
|
+
}
|
|
580
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormControlNameDirective, deps: [{ token: i1.ControlContainer, optional: true, skipSelf: true }, { token: NG_VALIDATORS, optional: true, self: true }, { token: NG_ASYNC_VALIDATORS, optional: true, self: true }, { token: NG_VALUE_ACCESSOR, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
581
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormControlNameDirective, isStandalone: true, selector: "[rxapFormControlName]", inputs: { name: ["rxapFormControlName", "name"] }, providers: [
|
|
582
|
+
{
|
|
583
|
+
provide: NgControl,
|
|
584
|
+
useExisting: forwardRef(() => FormControlNameDirective),
|
|
585
|
+
},
|
|
586
|
+
], exportAs: ["rxapFormControl"], usesInheritance: true, ngImport: i0 }); }
|
|
587
|
+
}
|
|
588
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormControlNameDirective, decorators: [{
|
|
589
|
+
type: Directive,
|
|
590
|
+
args: [{
|
|
591
|
+
selector: '[rxapFormControlName]',
|
|
592
|
+
providers: [
|
|
593
|
+
{
|
|
594
|
+
provide: NgControl,
|
|
595
|
+
useExisting: forwardRef(() => FormControlNameDirective),
|
|
596
|
+
},
|
|
597
|
+
],
|
|
598
|
+
exportAs: 'rxapFormControl',
|
|
599
|
+
standalone: true,
|
|
600
|
+
}]
|
|
601
|
+
}], ctorParameters: () => [{ type: i1.ControlContainer, decorators: [{
|
|
602
|
+
type: Optional
|
|
603
|
+
}, {
|
|
604
|
+
type: SkipSelf
|
|
605
|
+
}] }, { type: Array, decorators: [{
|
|
606
|
+
type: Optional
|
|
607
|
+
}, {
|
|
608
|
+
type: Self
|
|
609
|
+
}, {
|
|
610
|
+
type: Inject,
|
|
611
|
+
args: [NG_VALIDATORS]
|
|
612
|
+
}] }, { type: Array, decorators: [{
|
|
613
|
+
type: Optional
|
|
614
|
+
}, {
|
|
615
|
+
type: Self
|
|
616
|
+
}, {
|
|
617
|
+
type: Inject,
|
|
618
|
+
args: [NG_ASYNC_VALIDATORS]
|
|
619
|
+
}] }, { type: undefined, decorators: [{
|
|
620
|
+
type: Optional
|
|
621
|
+
}, {
|
|
622
|
+
type: Self
|
|
623
|
+
}, {
|
|
624
|
+
type: Inject,
|
|
625
|
+
args: [NG_VALUE_ACCESSOR]
|
|
626
|
+
}] }], propDecorators: { name: [{
|
|
627
|
+
type: Input,
|
|
628
|
+
args: ['rxapFormControlName']
|
|
629
|
+
}] } });
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* A full exertion of FormGroupName from @angular/forms. The only change is the
|
|
633
|
+
* ability to access the control container outside of the current component
|
|
634
|
+
*
|
|
635
|
+
* @deprecated use the ParentControlContainerDirective
|
|
636
|
+
*/
|
|
637
|
+
class FormGroupNameDirective extends FormGroupName {
|
|
638
|
+
get control() {
|
|
639
|
+
// TODO : add type check
|
|
640
|
+
return this.formDirective.getFormGroup(this);
|
|
641
|
+
}
|
|
642
|
+
constructor(parent, validators, asyncValidators) {
|
|
643
|
+
super(parent, validators, asyncValidators);
|
|
644
|
+
}
|
|
645
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormGroupNameDirective, deps: [{ token: i1.ControlContainer, optional: true, skipSelf: true }, { token: NG_VALIDATORS, optional: true, self: true }, { token: NG_ASYNC_VALIDATORS, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
646
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormGroupNameDirective, isStandalone: true, selector: "[rxapFormGroupName]", inputs: { name: ["rxapFormGroupName", "name"] }, providers: [
|
|
647
|
+
{
|
|
648
|
+
provide: ControlContainer,
|
|
649
|
+
useExisting: forwardRef(() => FormGroupNameDirective),
|
|
650
|
+
},
|
|
651
|
+
], exportAs: ["rxapFormGroup"], usesInheritance: true, ngImport: i0 }); }
|
|
652
|
+
}
|
|
653
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormGroupNameDirective, decorators: [{
|
|
654
|
+
type: Directive,
|
|
655
|
+
args: [{
|
|
656
|
+
selector: '[rxapFormGroupName]',
|
|
657
|
+
providers: [
|
|
658
|
+
{
|
|
659
|
+
provide: ControlContainer,
|
|
660
|
+
useExisting: forwardRef(() => FormGroupNameDirective),
|
|
661
|
+
},
|
|
662
|
+
],
|
|
663
|
+
exportAs: 'rxapFormGroup',
|
|
664
|
+
standalone: true,
|
|
665
|
+
}]
|
|
666
|
+
}], ctorParameters: () => [{ type: i1.ControlContainer, decorators: [{
|
|
667
|
+
type: Optional
|
|
668
|
+
}, {
|
|
669
|
+
type: SkipSelf
|
|
670
|
+
}] }, { type: undefined, decorators: [{
|
|
671
|
+
type: Optional
|
|
672
|
+
}, {
|
|
673
|
+
type: Self
|
|
674
|
+
}, {
|
|
675
|
+
type: Inject,
|
|
676
|
+
args: [NG_VALIDATORS]
|
|
677
|
+
}] }, { type: undefined, decorators: [{
|
|
678
|
+
type: Optional
|
|
679
|
+
}, {
|
|
680
|
+
type: Self
|
|
681
|
+
}, {
|
|
682
|
+
type: Inject,
|
|
683
|
+
args: [NG_ASYNC_VALIDATORS]
|
|
684
|
+
}] }], propDecorators: { name: [{
|
|
685
|
+
type: Input,
|
|
686
|
+
args: ['rxapFormGroupName']
|
|
687
|
+
}] } });
|
|
688
|
+
|
|
689
|
+
const RXAP_FORM_DEFINITION = new InjectionToken('rxap/forms/definition');
|
|
690
|
+
const RXAP_FORM_DEFINITION_BUILDER = new InjectionToken('rxap/forms/definition-builder');
|
|
691
|
+
const RXAP_FORM_SUBMIT_METHOD = new InjectionToken('rxap/form/submit-method');
|
|
692
|
+
const RXAP_FORM_SUBMIT_FAILED_METHOD = new InjectionToken('rxap/form/submit-failed-method');
|
|
693
|
+
const RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD = new InjectionToken('rxap/form/submit-successful-method');
|
|
694
|
+
const RXAP_FORM_LOAD_METHOD = new InjectionToken('rxap/form/load-method');
|
|
695
|
+
const RXAP_FORM_LOAD_FAILED_METHOD = new InjectionToken('rxap/form/load-failed-method');
|
|
696
|
+
const RXAP_FORM_LOAD_SUCCESSFUL_METHOD = new InjectionToken('rxap/form/load-successful-method');
|
|
697
|
+
|
|
698
|
+
var MetadataKeys;
|
|
699
|
+
(function (MetadataKeys) {
|
|
700
|
+
MetadataKeys["CONTROL_VALIDATORS"] = "rxap/forms/control-validators";
|
|
701
|
+
MetadataKeys["CONTROL_ASYNC_VALIDATORS"] = "rxap/forms/control-async-validators";
|
|
702
|
+
MetadataKeys["CONTROL_CHANGES"] = "rxap/forms/control-changes";
|
|
703
|
+
MetadataKeys["CONTROL_SET_VALUE"] = "rxap/forms/control-set-value";
|
|
704
|
+
MetadataKeys["FORM_ARRAY_GROUPS"] = "rxap/forms/form-array-groups";
|
|
705
|
+
MetadataKeys["FORM_ARRAY_CONTROLS"] = "rxap/forms/form-array-controls";
|
|
706
|
+
MetadataKeys["FORM_GROUPS"] = "rxap/forms/form-groups";
|
|
707
|
+
MetadataKeys["FORM_CONTROLS"] = "rxap/forms/form-controls";
|
|
708
|
+
})(MetadataKeys || (MetadataKeys = {}));
|
|
17
709
|
|
|
18
710
|
function getControlValue(control) {
|
|
19
711
|
if (control.getRawValue) {
|
|
@@ -340,18 +1032,6 @@ class RxapFormArray extends UntypedFormArray {
|
|
|
340
1032
|
}
|
|
341
1033
|
}
|
|
342
1034
|
|
|
343
|
-
var MetadataKeys;
|
|
344
|
-
(function (MetadataKeys) {
|
|
345
|
-
MetadataKeys["CONTROL_VALIDATORS"] = "rxap/forms/control-validators";
|
|
346
|
-
MetadataKeys["CONTROL_ASYNC_VALIDATORS"] = "rxap/forms/control-async-validators";
|
|
347
|
-
MetadataKeys["CONTROL_CHANGES"] = "rxap/forms/control-changes";
|
|
348
|
-
MetadataKeys["CONTROL_SET_VALUE"] = "rxap/forms/control-set-value";
|
|
349
|
-
MetadataKeys["FORM_ARRAY_GROUPS"] = "rxap/forms/form-array-groups";
|
|
350
|
-
MetadataKeys["FORM_ARRAY_CONTROLS"] = "rxap/forms/form-array-controls";
|
|
351
|
-
MetadataKeys["FORM_GROUPS"] = "rxap/forms/form-groups";
|
|
352
|
-
MetadataKeys["FORM_CONTROLS"] = "rxap/forms/form-controls";
|
|
353
|
-
})(MetadataKeys || (MetadataKeys = {}));
|
|
354
|
-
|
|
355
1035
|
class RxapFormGroup extends UntypedFormGroup {
|
|
356
1036
|
/**
|
|
357
1037
|
* @internal
|
|
@@ -1071,129 +1751,29 @@ class RxapFormBuilder {
|
|
|
1071
1751
|
return (getMetadata(MetadataKeys.FORM_ARRAY_GROUPS, this.definition.prototype) ??
|
|
1072
1752
|
new Map());
|
|
1073
1753
|
}
|
|
1074
|
-
extractArrayControls() {
|
|
1075
|
-
return (getMetadata(MetadataKeys.FORM_ARRAY_CONTROLS, this.definition.prototype) ?? new Map());
|
|
1076
|
-
}
|
|
1077
|
-
extractGroups() {
|
|
1078
|
-
return (getMetadata(MetadataKeys.FORM_GROUPS, this.definition.prototype) ??
|
|
1079
|
-
new Map());
|
|
1080
|
-
}
|
|
1081
|
-
extractControls() {
|
|
1082
|
-
return (getMetadata(MetadataKeys.FORM_CONTROLS, this.definition.prototype) ??
|
|
1083
|
-
new Map());
|
|
1084
|
-
}
|
|
1085
|
-
extractFormOptions() {
|
|
1086
|
-
const options = GetDefinitionMetadata(this.definition);
|
|
1087
|
-
if (!options || !options['id']) {
|
|
1088
|
-
throw new Error('Ensure that the @UseForm decorator is used.');
|
|
1089
|
-
}
|
|
1090
|
-
if (!options['providers']) {
|
|
1091
|
-
options['providers'] = [];
|
|
1092
|
-
}
|
|
1093
|
-
return options;
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
class ControlValueAccessor {
|
|
1098
|
-
constructor() {
|
|
1099
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1100
|
-
this.onChange = (value) => {
|
|
1101
|
-
};
|
|
1102
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1103
|
-
this.onTouched = () => {
|
|
1104
|
-
};
|
|
1105
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1106
|
-
this.setDisabledState = (isDisabled) => {
|
|
1107
|
-
};
|
|
1108
|
-
}
|
|
1109
|
-
registerOnChange(fn) {
|
|
1110
|
-
this.onChange = fn;
|
|
1754
|
+
extractArrayControls() {
|
|
1755
|
+
return (getMetadata(MetadataKeys.FORM_ARRAY_CONTROLS, this.definition.prototype) ?? new Map());
|
|
1111
1756
|
}
|
|
1112
|
-
|
|
1113
|
-
this.
|
|
1757
|
+
extractGroups() {
|
|
1758
|
+
return (getMetadata(MetadataKeys.FORM_GROUPS, this.definition.prototype) ??
|
|
1759
|
+
new Map());
|
|
1114
1760
|
}
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
setMetadataMapSet(controlId, propertyKey, MetadataKeys.CONTROL_ASYNC_VALIDATORS, target);
|
|
1124
|
-
}
|
|
1125
|
-
};
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
function ControlChange(...controlIds) {
|
|
1129
|
-
return function (target, propertyKey) {
|
|
1130
|
-
for (const controlId of controlIds) {
|
|
1131
|
-
setMetadataMapSet(controlId, propertyKey, MetadataKeys.CONTROL_CHANGES, target);
|
|
1761
|
+
extractControls() {
|
|
1762
|
+
return (getMetadata(MetadataKeys.FORM_CONTROLS, this.definition.prototype) ??
|
|
1763
|
+
new Map());
|
|
1764
|
+
}
|
|
1765
|
+
extractFormOptions() {
|
|
1766
|
+
const options = GetDefinitionMetadata(this.definition);
|
|
1767
|
+
if (!options || !options['id']) {
|
|
1768
|
+
throw new Error('Ensure that the @UseForm decorator is used.');
|
|
1132
1769
|
}
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
function ControlSetValue(controlId, options = {}) {
|
|
1137
|
-
return function (target, propertyKey) {
|
|
1138
|
-
setMetadataMapSet(controlId, {
|
|
1139
|
-
...options,
|
|
1140
|
-
propertyKey,
|
|
1141
|
-
}, MetadataKeys.CONTROL_SET_VALUE, target);
|
|
1142
|
-
};
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
function ControlValidator(...controlIds) {
|
|
1146
|
-
return function (target, propertyKey) {
|
|
1147
|
-
for (const controlId of controlIds) {
|
|
1148
|
-
setMetadataMapSet(controlId, propertyKey, MetadataKeys.CONTROL_VALIDATORS, target);
|
|
1770
|
+
if (!options['providers']) {
|
|
1771
|
+
options['providers'] = [];
|
|
1149
1772
|
}
|
|
1150
|
-
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
function UseFormArrayGroup(definition, options = {}) {
|
|
1154
|
-
return function (target, propertyKey) {
|
|
1155
|
-
setMetadataMap(propertyKey, {
|
|
1156
|
-
...options,
|
|
1157
|
-
definition,
|
|
1158
|
-
}, MetadataKeys.FORM_ARRAY_GROUPS, target);
|
|
1159
|
-
};
|
|
1160
|
-
}
|
|
1161
|
-
function UseFormArrayControl(options = {}) {
|
|
1162
|
-
return function (target, propertyKey) {
|
|
1163
|
-
setMetadataMap(propertyKey, options, MetadataKeys.FORM_ARRAY_CONTROLS, target);
|
|
1164
|
-
};
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
function UseFormControl(options = {}) {
|
|
1168
|
-
return function (target, propertyKey) {
|
|
1169
|
-
setMetadataMap(propertyKey, options, MetadataKeys.FORM_CONTROLS, target);
|
|
1170
|
-
};
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
function UseFormGroup(definition, options = {}) {
|
|
1174
|
-
return function (target, propertyKey) {
|
|
1175
|
-
setMetadataMap(propertyKey, {
|
|
1176
|
-
...options,
|
|
1177
|
-
definition,
|
|
1178
|
-
}, MetadataKeys.FORM_GROUPS, target);
|
|
1179
|
-
};
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
|
-
function RxapForm(optionsOrId, className = 'FormDefinition', packageName = '@rxap/forms') {
|
|
1183
|
-
return function (target) {
|
|
1184
|
-
DefinitionMetadata(optionsOrId, className, packageName)(target);
|
|
1185
|
-
};
|
|
1773
|
+
return options;
|
|
1774
|
+
}
|
|
1186
1775
|
}
|
|
1187
1776
|
|
|
1188
|
-
const RXAP_FORM_DEFINITION = new InjectionToken('rxap/forms/definition');
|
|
1189
|
-
const RXAP_FORM_DEFINITION_BUILDER = new InjectionToken('rxap/forms/definition-builder');
|
|
1190
|
-
const RXAP_FORM_SUBMIT_METHOD = new InjectionToken('rxap/form/submit-method');
|
|
1191
|
-
const RXAP_FORM_SUBMIT_FAILED_METHOD = new InjectionToken('rxap/form/submit-failed-method');
|
|
1192
|
-
const RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD = new InjectionToken('rxap/form/submit-successful-method');
|
|
1193
|
-
const RXAP_FORM_LOAD_METHOD = new InjectionToken('rxap/form/load-method');
|
|
1194
|
-
const RXAP_FORM_LOAD_FAILED_METHOD = new InjectionToken('rxap/form/load-failed-method');
|
|
1195
|
-
const RXAP_FORM_LOAD_SUCCESSFUL_METHOD = new InjectionToken('rxap/form/load-successful-method');
|
|
1196
|
-
|
|
1197
1777
|
class FormDirective extends FormGroupDirective {
|
|
1198
1778
|
get submitting() {
|
|
1199
1779
|
return this.submitting$.value;
|
|
@@ -1543,8 +2123,8 @@ class FormDirective extends FormGroupDirective {
|
|
|
1543
2123
|
this._formDefinition.ngOnDestroy();
|
|
1544
2124
|
}
|
|
1545
2125
|
}
|
|
1546
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1547
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2126
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormDirective, deps: [{ token: ChangeDetectorRef }, { token: RXAP_FORM_DEFINITION, optional: true }, { token: RXAP_FORM_SUBMIT_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_LOAD_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_LOAD_FAILED_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_LOAD_SUCCESSFUL_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_SUBMIT_FAILED_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_DEFINITION_BUILDER, optional: true, skipSelf: true }, { token: LoadingIndicatorService, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2127
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormDirective, isStandalone: true, selector: "form[rxapForm]:not([formGroup]):not([ngForm]),rxap-form,form[rxapForm]", inputs: { initial: "initial", useFormDefinition: ["rxapForm", "useFormDefinition"], submitMethod: "submitMethod" }, outputs: { ngSubmit: "ngSubmit", rxapSubmit: "rxapSubmit", invalidSubmit: "invalidSubmit", submitSuccessful$: "submitSuccessful" }, host: { listeners: { "reset": "onReset()" }, properties: { "class.rxap-submitting": "this.submitting", "class.rxap-submit-error": "this.submitError", "class.rxap-loading": "this.loading", "class.rxap-loaded": "this.loaded", "class.rxap-loading-error": "this.loadingError" } }, providers: [
|
|
1548
2128
|
{
|
|
1549
2129
|
provide: ControlContainer,
|
|
1550
2130
|
// ignore coverage
|
|
@@ -1588,7 +2168,7 @@ class FormDirective extends FormGroupDirective {
|
|
|
1588
2168
|
// endregion
|
|
1589
2169
|
], exportAs: ["rxapForm"], usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
|
|
1590
2170
|
}
|
|
1591
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormDirective, decorators: [{
|
|
1592
2172
|
type: Directive,
|
|
1593
2173
|
args: [{
|
|
1594
2174
|
selector: 'form[rxapForm]:not([formGroup]):not([ngForm]),rxap-form,form[rxapForm]',
|
|
@@ -1642,7 +2222,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1642
2222
|
exportAs: 'rxapForm',
|
|
1643
2223
|
standalone: true,
|
|
1644
2224
|
}]
|
|
1645
|
-
}], ctorParameters:
|
|
2225
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef, decorators: [{
|
|
1646
2226
|
type: Inject,
|
|
1647
2227
|
args: [ChangeDetectorRef]
|
|
1648
2228
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1664,224 +2244,76 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1664
2244
|
}, {
|
|
1665
2245
|
type: Inject,
|
|
1666
2246
|
args: [RXAP_FORM_LOAD_METHOD]
|
|
1667
|
-
}] }, { type: undefined, decorators: [{
|
|
1668
|
-
type: SkipSelf
|
|
1669
|
-
}, {
|
|
1670
|
-
type: Optional
|
|
1671
|
-
}, {
|
|
1672
|
-
type: Inject,
|
|
1673
|
-
args: [RXAP_FORM_LOAD_FAILED_METHOD]
|
|
1674
|
-
}] }, { type: undefined, decorators: [{
|
|
1675
|
-
type: SkipSelf
|
|
1676
|
-
}, {
|
|
1677
|
-
type: Optional
|
|
1678
|
-
}, {
|
|
1679
|
-
type: Inject,
|
|
1680
|
-
args: [RXAP_FORM_LOAD_SUCCESSFUL_METHOD]
|
|
1681
|
-
}] }, { type: undefined, decorators: [{
|
|
1682
|
-
type: SkipSelf
|
|
1683
|
-
}, {
|
|
1684
|
-
type: Optional
|
|
1685
|
-
}, {
|
|
1686
|
-
type: Inject,
|
|
1687
|
-
args: [RXAP_FORM_SUBMIT_FAILED_METHOD]
|
|
1688
|
-
}] }, { type: undefined, decorators: [{
|
|
1689
|
-
type: SkipSelf
|
|
1690
|
-
}, {
|
|
1691
|
-
type: Optional
|
|
1692
|
-
}, {
|
|
1693
|
-
type: Inject,
|
|
1694
|
-
args: [RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD]
|
|
1695
|
-
}] }, { type: RxapFormBuilder, decorators: [{
|
|
1696
|
-
type: SkipSelf
|
|
1697
|
-
}, {
|
|
1698
|
-
type: Optional
|
|
1699
|
-
}, {
|
|
1700
|
-
type: Inject,
|
|
1701
|
-
args: [RXAP_FORM_DEFINITION_BUILDER]
|
|
1702
|
-
}] }, { type: i2.LoadingIndicatorService, decorators: [{
|
|
1703
|
-
type: Optional
|
|
1704
|
-
}, {
|
|
1705
|
-
type: Inject,
|
|
1706
|
-
args: [LoadingIndicatorService]
|
|
1707
|
-
}] }]; }, propDecorators: { initial: [{
|
|
1708
|
-
type: Input
|
|
1709
|
-
}], rxapSubmit: [{
|
|
1710
|
-
type: Output
|
|
1711
|
-
}], invalidSubmit: [{
|
|
1712
|
-
type: Output
|
|
1713
|
-
}], submitSuccessful$: [{
|
|
1714
|
-
type: Output,
|
|
1715
|
-
args: ['submitSuccessful']
|
|
1716
|
-
}], submitting: [{
|
|
1717
|
-
type: HostBinding,
|
|
1718
|
-
args: ['class.rxap-submitting']
|
|
1719
|
-
}], submitError: [{
|
|
1720
|
-
type: HostBinding,
|
|
1721
|
-
args: ['class.rxap-submit-error']
|
|
1722
|
-
}], loading: [{
|
|
1723
|
-
type: HostBinding,
|
|
1724
|
-
args: ['class.rxap-loading']
|
|
1725
|
-
}], loaded: [{
|
|
1726
|
-
type: HostBinding,
|
|
1727
|
-
args: ['class.rxap-loaded']
|
|
1728
|
-
}], loadingError: [{
|
|
1729
|
-
type: HostBinding,
|
|
1730
|
-
args: ['class.rxap-loading-error']
|
|
1731
|
-
}], useFormDefinition: [{
|
|
1732
|
-
type: Input,
|
|
1733
|
-
args: ['rxapForm']
|
|
1734
|
-
}], submitMethod: [{
|
|
1735
|
-
type: Input
|
|
1736
|
-
}] } });
|
|
1737
|
-
|
|
1738
|
-
class FormSubmitFailedDirective {
|
|
1739
|
-
constructor(formDirective, template, viewContainerRef) {
|
|
1740
|
-
this.formDirective = formDirective;
|
|
1741
|
-
this.template = template;
|
|
1742
|
-
this.viewContainerRef = viewContainerRef;
|
|
1743
|
-
}
|
|
1744
|
-
ngAfterViewInit() {
|
|
1745
|
-
this.subscription = this.formDirective.submitError$.pipe(tap(error => {
|
|
1746
|
-
this.viewContainerRef.clear();
|
|
1747
|
-
if (error !== null) {
|
|
1748
|
-
this.viewContainerRef.createEmbeddedView(this.template, { $implicit: error });
|
|
1749
|
-
}
|
|
1750
|
-
})).subscribe();
|
|
1751
|
-
}
|
|
1752
|
-
ngOnDestroy() {
|
|
1753
|
-
this.subscription?.unsubscribe();
|
|
1754
|
-
}
|
|
1755
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormSubmitFailedDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1756
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FormSubmitFailedDirective, isStandalone: true, selector: "[rxapFormSubmitFailed]", ngImport: i0 }); }
|
|
1757
|
-
}
|
|
1758
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormSubmitFailedDirective, decorators: [{
|
|
1759
|
-
type: Directive,
|
|
1760
|
-
args: [{
|
|
1761
|
-
selector: '[rxapFormSubmitFailed]',
|
|
1762
|
-
standalone: true,
|
|
1763
|
-
}]
|
|
1764
|
-
}], ctorParameters: function () { return [{ type: FormDirective, decorators: [{
|
|
1765
|
-
type: Inject,
|
|
1766
|
-
args: [FormDirective]
|
|
1767
|
-
}] }, { type: i0.TemplateRef, decorators: [{
|
|
1768
|
-
type: Inject,
|
|
1769
|
-
args: [TemplateRef]
|
|
1770
|
-
}] }, { type: i0.ViewContainerRef, decorators: [{
|
|
1771
|
-
type: Inject,
|
|
1772
|
-
args: [ViewContainerRef]
|
|
1773
|
-
}] }]; } });
|
|
1774
|
-
|
|
1775
|
-
class FormLoadingDirective {
|
|
1776
|
-
constructor(formDirective, template, viewContainerRef) {
|
|
1777
|
-
this.formDirective = formDirective;
|
|
1778
|
-
this.template = template;
|
|
1779
|
-
this.viewContainerRef = viewContainerRef;
|
|
1780
|
-
}
|
|
1781
|
-
ngAfterViewInit() {
|
|
1782
|
-
this.subscription = this.formDirective.loading$.pipe(distinctUntilChanged(), tap(loading => {
|
|
1783
|
-
this.viewContainerRef.clear();
|
|
1784
|
-
if (loading) {
|
|
1785
|
-
this.viewContainerRef.createEmbeddedView(this.template);
|
|
1786
|
-
}
|
|
1787
|
-
})).subscribe();
|
|
1788
|
-
}
|
|
1789
|
-
ngOnDestroy() {
|
|
1790
|
-
this.subscription?.unsubscribe();
|
|
1791
|
-
}
|
|
1792
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormLoadingDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1793
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FormLoadingDirective, isStandalone: true, selector: "[rxapFormLoading]", ngImport: i0 }); }
|
|
1794
|
-
}
|
|
1795
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormLoadingDirective, decorators: [{
|
|
1796
|
-
type: Directive,
|
|
1797
|
-
args: [{
|
|
1798
|
-
selector: '[rxapFormLoading]',
|
|
1799
|
-
standalone: true,
|
|
1800
|
-
}]
|
|
1801
|
-
}], ctorParameters: function () { return [{ type: FormDirective, decorators: [{
|
|
1802
|
-
type: Inject,
|
|
1803
|
-
args: [FormDirective]
|
|
1804
|
-
}] }, { type: i0.TemplateRef, decorators: [{
|
|
1805
|
-
type: Inject,
|
|
1806
|
-
args: [TemplateRef]
|
|
1807
|
-
}] }, { type: i0.ViewContainerRef, decorators: [{
|
|
1808
|
-
type: Inject,
|
|
1809
|
-
args: [ViewContainerRef]
|
|
1810
|
-
}] }]; } });
|
|
1811
|
-
|
|
1812
|
-
class FormSubmittingDirective {
|
|
1813
|
-
constructor(formDirective, template, viewContainerRef) {
|
|
1814
|
-
this.formDirective = formDirective;
|
|
1815
|
-
this.template = template;
|
|
1816
|
-
this.viewContainerRef = viewContainerRef;
|
|
1817
|
-
}
|
|
1818
|
-
ngAfterViewInit() {
|
|
1819
|
-
this.subscription = this.formDirective.submitting$.pipe(distinctUntilChanged(), tap(loading => {
|
|
1820
|
-
this.viewContainerRef.clear();
|
|
1821
|
-
if (loading) {
|
|
1822
|
-
this.viewContainerRef.createEmbeddedView(this.template);
|
|
1823
|
-
}
|
|
1824
|
-
})).subscribe();
|
|
1825
|
-
}
|
|
1826
|
-
ngOnDestroy() {
|
|
1827
|
-
this.subscription?.unsubscribe();
|
|
1828
|
-
}
|
|
1829
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormSubmittingDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1830
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FormSubmittingDirective, isStandalone: true, selector: "[rxapFormSubmitting]", ngImport: i0 }); }
|
|
1831
|
-
}
|
|
1832
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormSubmittingDirective, decorators: [{
|
|
1833
|
-
type: Directive,
|
|
1834
|
-
args: [{
|
|
1835
|
-
selector: '[rxapFormSubmitting]',
|
|
1836
|
-
standalone: true,
|
|
1837
|
-
}]
|
|
1838
|
-
}], ctorParameters: function () { return [{ type: FormDirective, decorators: [{
|
|
2247
|
+
}] }, { type: undefined, decorators: [{
|
|
2248
|
+
type: SkipSelf
|
|
2249
|
+
}, {
|
|
2250
|
+
type: Optional
|
|
2251
|
+
}, {
|
|
1839
2252
|
type: Inject,
|
|
1840
|
-
args: [
|
|
1841
|
-
}] }, { type:
|
|
2253
|
+
args: [RXAP_FORM_LOAD_FAILED_METHOD]
|
|
2254
|
+
}] }, { type: undefined, decorators: [{
|
|
2255
|
+
type: SkipSelf
|
|
2256
|
+
}, {
|
|
2257
|
+
type: Optional
|
|
2258
|
+
}, {
|
|
1842
2259
|
type: Inject,
|
|
1843
|
-
args: [
|
|
1844
|
-
}] }, { type:
|
|
2260
|
+
args: [RXAP_FORM_LOAD_SUCCESSFUL_METHOD]
|
|
2261
|
+
}] }, { type: undefined, decorators: [{
|
|
2262
|
+
type: SkipSelf
|
|
2263
|
+
}, {
|
|
2264
|
+
type: Optional
|
|
2265
|
+
}, {
|
|
1845
2266
|
type: Inject,
|
|
1846
|
-
args: [
|
|
1847
|
-
}] }
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
this.template = template;
|
|
1853
|
-
this.viewContainerRef = viewContainerRef;
|
|
1854
|
-
}
|
|
1855
|
-
ngAfterViewInit() {
|
|
1856
|
-
this.subscription = this.formDirective.loadingError$.pipe(tap(error => {
|
|
1857
|
-
this.viewContainerRef.clear();
|
|
1858
|
-
if (error !== null) {
|
|
1859
|
-
this.viewContainerRef.createEmbeddedView(this.template, { $implicit: error });
|
|
1860
|
-
}
|
|
1861
|
-
})).subscribe();
|
|
1862
|
-
}
|
|
1863
|
-
ngOnDestroy() {
|
|
1864
|
-
this.subscription?.unsubscribe();
|
|
1865
|
-
}
|
|
1866
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormLoadingErrorDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1867
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FormLoadingErrorDirective, isStandalone: true, selector: "[rxapFormLoadingError]", ngImport: i0 }); }
|
|
1868
|
-
}
|
|
1869
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormLoadingErrorDirective, decorators: [{
|
|
1870
|
-
type: Directive,
|
|
1871
|
-
args: [{
|
|
1872
|
-
selector: '[rxapFormLoadingError]',
|
|
1873
|
-
standalone: true,
|
|
1874
|
-
}]
|
|
1875
|
-
}], ctorParameters: function () { return [{ type: FormDirective, decorators: [{
|
|
2267
|
+
args: [RXAP_FORM_SUBMIT_FAILED_METHOD]
|
|
2268
|
+
}] }, { type: undefined, decorators: [{
|
|
2269
|
+
type: SkipSelf
|
|
2270
|
+
}, {
|
|
2271
|
+
type: Optional
|
|
2272
|
+
}, {
|
|
1876
2273
|
type: Inject,
|
|
1877
|
-
args: [
|
|
1878
|
-
}] }, { type:
|
|
2274
|
+
args: [RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD]
|
|
2275
|
+
}] }, { type: RxapFormBuilder, decorators: [{
|
|
2276
|
+
type: SkipSelf
|
|
2277
|
+
}, {
|
|
2278
|
+
type: Optional
|
|
2279
|
+
}, {
|
|
1879
2280
|
type: Inject,
|
|
1880
|
-
args: [
|
|
1881
|
-
}] }, { type:
|
|
2281
|
+
args: [RXAP_FORM_DEFINITION_BUILDER]
|
|
2282
|
+
}] }, { type: i2.LoadingIndicatorService, decorators: [{
|
|
2283
|
+
type: Optional
|
|
2284
|
+
}, {
|
|
1882
2285
|
type: Inject,
|
|
1883
|
-
args: [
|
|
1884
|
-
}] }]
|
|
2286
|
+
args: [LoadingIndicatorService]
|
|
2287
|
+
}] }], propDecorators: { initial: [{
|
|
2288
|
+
type: Input
|
|
2289
|
+
}], rxapSubmit: [{
|
|
2290
|
+
type: Output
|
|
2291
|
+
}], invalidSubmit: [{
|
|
2292
|
+
type: Output
|
|
2293
|
+
}], submitSuccessful$: [{
|
|
2294
|
+
type: Output,
|
|
2295
|
+
args: ['submitSuccessful']
|
|
2296
|
+
}], submitting: [{
|
|
2297
|
+
type: HostBinding,
|
|
2298
|
+
args: ['class.rxap-submitting']
|
|
2299
|
+
}], submitError: [{
|
|
2300
|
+
type: HostBinding,
|
|
2301
|
+
args: ['class.rxap-submit-error']
|
|
2302
|
+
}], loading: [{
|
|
2303
|
+
type: HostBinding,
|
|
2304
|
+
args: ['class.rxap-loading']
|
|
2305
|
+
}], loaded: [{
|
|
2306
|
+
type: HostBinding,
|
|
2307
|
+
args: ['class.rxap-loaded']
|
|
2308
|
+
}], loadingError: [{
|
|
2309
|
+
type: HostBinding,
|
|
2310
|
+
args: ['class.rxap-loading-error']
|
|
2311
|
+
}], useFormDefinition: [{
|
|
2312
|
+
type: Input,
|
|
2313
|
+
args: ['rxapForm']
|
|
2314
|
+
}], submitMethod: [{
|
|
2315
|
+
type: Input
|
|
2316
|
+
}] } });
|
|
1885
2317
|
|
|
1886
2318
|
class FormLoadedDirective {
|
|
1887
2319
|
constructor(formDirective, template, viewContainerRef) {
|
|
@@ -1900,16 +2332,16 @@ class FormLoadedDirective {
|
|
|
1900
2332
|
ngOnDestroy() {
|
|
1901
2333
|
this.subscription?.unsubscribe();
|
|
1902
2334
|
}
|
|
1903
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1904
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2335
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormLoadedDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2336
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormLoadedDirective, isStandalone: true, selector: "[rxapFormLoaded]", ngImport: i0 }); }
|
|
1905
2337
|
}
|
|
1906
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2338
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormLoadedDirective, decorators: [{
|
|
1907
2339
|
type: Directive,
|
|
1908
2340
|
args: [{
|
|
1909
2341
|
selector: '[rxapFormLoaded]',
|
|
1910
2342
|
standalone: true,
|
|
1911
2343
|
}]
|
|
1912
|
-
}], ctorParameters:
|
|
2344
|
+
}], ctorParameters: () => [{ type: FormDirective, decorators: [{
|
|
1913
2345
|
type: Inject,
|
|
1914
2346
|
args: [FormDirective]
|
|
1915
2347
|
}] }, { type: i0.TemplateRef, decorators: [{
|
|
@@ -1918,373 +2350,153 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1918
2350
|
}] }, { type: i0.ViewContainerRef, decorators: [{
|
|
1919
2351
|
type: Inject,
|
|
1920
2352
|
args: [ViewContainerRef]
|
|
1921
|
-
}] }]
|
|
2353
|
+
}] }] });
|
|
1922
2354
|
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
class FormControlErrorDirective {
|
|
1927
|
-
constructor(template, parent, viewContainerRef) {
|
|
2355
|
+
class FormLoadingErrorDirective {
|
|
2356
|
+
constructor(formDirective, template, viewContainerRef) {
|
|
2357
|
+
this.formDirective = formDirective;
|
|
1928
2358
|
this.template = template;
|
|
1929
|
-
this.parent = parent;
|
|
1930
2359
|
this.viewContainerRef = viewContainerRef;
|
|
1931
2360
|
}
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
this.subscription = control.statusChanges.pipe(startWith(control.status), filter(status => status === 'INVALID'), tap(() => {
|
|
1938
|
-
this.viewContainerRef.clear();
|
|
1939
|
-
if (control.hasError(this.errorKey)) {
|
|
1940
|
-
this.viewContainerRef.createEmbeddedView(this.template, { $implicit: control.getError(this.errorKey) });
|
|
1941
|
-
}
|
|
1942
|
-
})).subscribe();
|
|
1943
|
-
}
|
|
1944
|
-
ngOnDestroy() {
|
|
1945
|
-
this.subscription?.unsubscribe();
|
|
1946
|
-
}
|
|
1947
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormControlErrorDirective, deps: [{ token: i0.TemplateRef }, { token: i1.ControlContainer, host: true, skipSelf: true }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1948
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FormControlErrorDirective, isStandalone: true, selector: "[rxapFormControlError]", inputs: { name: ["rxapFormControlErrorFrom", "name"], errorKey: ["rxapFormControlErrorIf", "errorKey"] }, ngImport: i0 }); }
|
|
1949
|
-
}
|
|
1950
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormControlErrorDirective, decorators: [{
|
|
1951
|
-
type: Directive,
|
|
1952
|
-
args: [{
|
|
1953
|
-
selector: '[rxapFormControlError]',
|
|
1954
|
-
standalone: true,
|
|
1955
|
-
}]
|
|
1956
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i1.ControlContainer, decorators: [{
|
|
1957
|
-
type: Host
|
|
1958
|
-
}, {
|
|
1959
|
-
type: SkipSelf
|
|
1960
|
-
}] }, { type: i0.ViewContainerRef }]; }, propDecorators: { name: [{
|
|
1961
|
-
type: Input,
|
|
1962
|
-
args: [{
|
|
1963
|
-
required: true,
|
|
1964
|
-
alias: 'rxapFormControlErrorFrom',
|
|
1965
|
-
}]
|
|
1966
|
-
}], errorKey: [{
|
|
1967
|
-
type: Input,
|
|
1968
|
-
args: [{
|
|
1969
|
-
required: true,
|
|
1970
|
-
alias: 'rxapFormControlErrorIf',
|
|
1971
|
-
}]
|
|
1972
|
-
}] } });
|
|
1973
|
-
|
|
1974
|
-
class FormControlMarkDirtyDirective {
|
|
1975
|
-
constructor(parent) {
|
|
1976
|
-
this.parent = parent;
|
|
1977
|
-
}
|
|
1978
|
-
onClick() {
|
|
1979
|
-
const control = this.parent.control;
|
|
1980
|
-
if (control && hasIndexSignature(control) && typeof control['markAllAsDirty'] === 'function') {
|
|
1981
|
-
control['markAllAsDirty']();
|
|
1982
|
-
}
|
|
1983
|
-
else {
|
|
1984
|
-
control?.markAsDirty();
|
|
1985
|
-
}
|
|
1986
|
-
}
|
|
1987
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormControlMarkDirtyDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1988
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FormControlMarkDirtyDirective, isStandalone: true, selector: "[rxapFormControlMarkDirty]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
|
|
1989
|
-
}
|
|
1990
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormControlMarkDirtyDirective, decorators: [{
|
|
1991
|
-
type: Directive,
|
|
1992
|
-
args: [{
|
|
1993
|
-
selector: '[rxapFormControlMarkDirty]',
|
|
1994
|
-
standalone: true,
|
|
1995
|
-
}]
|
|
1996
|
-
}], ctorParameters: function () { return [{ type: i1.ControlContainer }]; }, propDecorators: { onClick: [{
|
|
1997
|
-
type: HostListener,
|
|
1998
|
-
args: ['click']
|
|
1999
|
-
}] } });
|
|
2000
|
-
|
|
2001
|
-
class FormControlMarkTouchedDirective {
|
|
2002
|
-
constructor(parent) {
|
|
2003
|
-
this.parent = parent;
|
|
2004
|
-
}
|
|
2005
|
-
onClick() {
|
|
2006
|
-
this.parent.control?.markAllAsTouched();
|
|
2007
|
-
}
|
|
2008
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormControlMarkTouchedDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2009
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FormControlMarkTouchedDirective, isStandalone: true, selector: "[rxapFormControlMarkTouched]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
|
|
2010
|
-
}
|
|
2011
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormControlMarkTouchedDirective, decorators: [{
|
|
2012
|
-
type: Directive,
|
|
2013
|
-
args: [{
|
|
2014
|
-
selector: '[rxapFormControlMarkTouched]',
|
|
2015
|
-
standalone: true,
|
|
2016
|
-
}]
|
|
2017
|
-
}], ctorParameters: function () { return [{ type: i1.ControlContainer }]; }, propDecorators: { onClick: [{
|
|
2018
|
-
type: HostListener,
|
|
2019
|
-
args: ['click']
|
|
2020
|
-
}] } });
|
|
2021
|
-
|
|
2022
|
-
class FormControlMarkUntouchedDirective {
|
|
2023
|
-
constructor(parent) {
|
|
2024
|
-
this.parent = parent;
|
|
2025
|
-
}
|
|
2026
|
-
onClick() {
|
|
2027
|
-
const control = this.parent.control;
|
|
2028
|
-
if (control && hasIndexSignature(control) && typeof control['markAllAsUntouched'] === 'function') {
|
|
2029
|
-
control['markAllAsUntouched']();
|
|
2030
|
-
}
|
|
2031
|
-
else {
|
|
2032
|
-
control?.markAsUntouched();
|
|
2033
|
-
}
|
|
2034
|
-
}
|
|
2035
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormControlMarkUntouchedDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2036
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FormControlMarkUntouchedDirective, isStandalone: true, selector: "[rxapFormControlMarkUntouched]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
|
|
2037
|
-
}
|
|
2038
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormControlMarkUntouchedDirective, decorators: [{
|
|
2039
|
-
type: Directive,
|
|
2040
|
-
args: [{
|
|
2041
|
-
selector: '[rxapFormControlMarkUntouched]',
|
|
2042
|
-
standalone: true,
|
|
2043
|
-
}]
|
|
2044
|
-
}], ctorParameters: function () { return [{ type: i1.ControlContainer }]; }, propDecorators: { onClick: [{
|
|
2045
|
-
type: HostListener,
|
|
2046
|
-
args: ['click']
|
|
2047
|
-
}] } });
|
|
2048
|
-
|
|
2049
|
-
class FormControlMarkPristineDirective {
|
|
2050
|
-
constructor(parent) {
|
|
2051
|
-
this.parent = parent;
|
|
2052
|
-
}
|
|
2053
|
-
onClick() {
|
|
2054
|
-
const control = this.parent.control;
|
|
2055
|
-
if (control && hasIndexSignature(control) && typeof control['markAllAsPristine'] === 'function') {
|
|
2056
|
-
control['markAllAsPristine']();
|
|
2057
|
-
}
|
|
2058
|
-
else {
|
|
2059
|
-
control?.markAsPristine();
|
|
2060
|
-
}
|
|
2061
|
-
}
|
|
2062
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormControlMarkPristineDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2063
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FormControlMarkPristineDirective, isStandalone: true, selector: "[rxapFormControlMarkPristine]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
|
|
2064
|
-
}
|
|
2065
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormControlMarkPristineDirective, decorators: [{
|
|
2066
|
-
type: Directive,
|
|
2067
|
-
args: [{
|
|
2068
|
-
selector: '[rxapFormControlMarkPristine]',
|
|
2069
|
-
standalone: true,
|
|
2070
|
-
}]
|
|
2071
|
-
}], ctorParameters: function () { return [{ type: i1.ControlContainer }]; }, propDecorators: { onClick: [{
|
|
2072
|
-
type: HostListener,
|
|
2073
|
-
args: ['click']
|
|
2074
|
-
}] } });
|
|
2075
|
-
|
|
2076
|
-
class FormSubmitDirective extends ConfirmClick {
|
|
2077
|
-
set resetAfterSubmit(value) {
|
|
2078
|
-
this._resetAfterSubmit = coerceBoolean(value);
|
|
2079
|
-
}
|
|
2080
|
-
constructor(formDirective, router = null) {
|
|
2081
|
-
super();
|
|
2082
|
-
this.formDirective = formDirective;
|
|
2083
|
-
this.router = router;
|
|
2084
|
-
this.type = 'button';
|
|
2085
|
-
this.afterSubmit = new EventEmitter();
|
|
2086
|
-
this._resetAfterSubmit = false;
|
|
2087
|
-
}
|
|
2088
|
-
execute() {
|
|
2089
|
-
this.formDirective.form.markAllAsDirty();
|
|
2090
|
-
this.formDirective.form.markAllAsTouched();
|
|
2091
|
-
this.formDirective.cdr.markForCheck();
|
|
2092
|
-
this.subscription = this.formDirective.rxapSubmit.pipe(take(1), tap(value => {
|
|
2093
|
-
const clonedValue = clone(value);
|
|
2094
|
-
this.afterSubmit.emit(clonedValue);
|
|
2095
|
-
if (this._resetAfterSubmit) {
|
|
2096
|
-
this.formDirective.reset();
|
|
2097
|
-
}
|
|
2098
|
-
if (this.navigateAfterSubmit) {
|
|
2099
|
-
if (!this.router) {
|
|
2100
|
-
throw new Error('Could not resolve the router!');
|
|
2101
|
-
}
|
|
2102
|
-
return this.router.navigate(this.navigateAfterSubmit);
|
|
2361
|
+
ngAfterViewInit() {
|
|
2362
|
+
this.subscription = this.formDirective.loadingError$.pipe(tap(error => {
|
|
2363
|
+
this.viewContainerRef.clear();
|
|
2364
|
+
if (error !== null) {
|
|
2365
|
+
this.viewContainerRef.createEmbeddedView(this.template, { $implicit: error });
|
|
2103
2366
|
}
|
|
2104
|
-
return Promise.resolve();
|
|
2105
2367
|
})).subscribe();
|
|
2106
|
-
this.formDirective.onSubmit(new Event('submit'));
|
|
2107
2368
|
}
|
|
2108
2369
|
ngOnDestroy() {
|
|
2109
2370
|
this.subscription?.unsubscribe();
|
|
2110
2371
|
}
|
|
2111
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2112
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2372
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormLoadingErrorDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2373
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormLoadingErrorDirective, isStandalone: true, selector: "[rxapFormLoadingError]", ngImport: i0 }); }
|
|
2113
2374
|
}
|
|
2114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2375
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormLoadingErrorDirective, decorators: [{
|
|
2115
2376
|
type: Directive,
|
|
2116
2377
|
args: [{
|
|
2117
|
-
selector: '[
|
|
2118
|
-
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
2119
|
-
host: {
|
|
2120
|
-
'(click)': 'onClick()',
|
|
2121
|
-
'(confirmed)': 'onConfirm()',
|
|
2122
|
-
},
|
|
2378
|
+
selector: '[rxapFormLoadingError]',
|
|
2123
2379
|
standalone: true,
|
|
2124
2380
|
}]
|
|
2125
|
-
}], ctorParameters:
|
|
2381
|
+
}], ctorParameters: () => [{ type: FormDirective, decorators: [{
|
|
2126
2382
|
type: Inject,
|
|
2127
2383
|
args: [FormDirective]
|
|
2128
|
-
}] }, { type:
|
|
2129
|
-
type: Optional
|
|
2130
|
-
}, {
|
|
2384
|
+
}] }, { type: i0.TemplateRef, decorators: [{
|
|
2131
2385
|
type: Inject,
|
|
2132
|
-
args: [
|
|
2133
|
-
}] }
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
type: Input
|
|
2138
|
-
}], resetAfterSubmit: [{
|
|
2139
|
-
type: Input
|
|
2140
|
-
}], navigateAfterSubmit: [{
|
|
2141
|
-
type: Input
|
|
2142
|
-
}], afterSubmit: [{
|
|
2143
|
-
type: Output
|
|
2144
|
-
}] } });
|
|
2386
|
+
args: [TemplateRef]
|
|
2387
|
+
}] }, { type: i0.ViewContainerRef, decorators: [{
|
|
2388
|
+
type: Inject,
|
|
2389
|
+
args: [ViewContainerRef]
|
|
2390
|
+
}] }] });
|
|
2145
2391
|
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
*/
|
|
2152
|
-
class FormGroupNameDirective extends FormGroupName {
|
|
2153
|
-
get control() {
|
|
2154
|
-
// TODO : add type check
|
|
2155
|
-
return this.formDirective.getFormGroup(this);
|
|
2392
|
+
class FormLoadingDirective {
|
|
2393
|
+
constructor(formDirective, template, viewContainerRef) {
|
|
2394
|
+
this.formDirective = formDirective;
|
|
2395
|
+
this.template = template;
|
|
2396
|
+
this.viewContainerRef = viewContainerRef;
|
|
2156
2397
|
}
|
|
2157
|
-
|
|
2158
|
-
|
|
2398
|
+
ngAfterViewInit() {
|
|
2399
|
+
this.subscription = this.formDirective.loading$.pipe(distinctUntilChanged(), tap(loading => {
|
|
2400
|
+
this.viewContainerRef.clear();
|
|
2401
|
+
if (loading) {
|
|
2402
|
+
this.viewContainerRef.createEmbeddedView(this.template);
|
|
2403
|
+
}
|
|
2404
|
+
})).subscribe();
|
|
2159
2405
|
}
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
},
|
|
2166
|
-
], exportAs: ["rxapFormGroup"], usesInheritance: true, ngImport: i0 }); }
|
|
2406
|
+
ngOnDestroy() {
|
|
2407
|
+
this.subscription?.unsubscribe();
|
|
2408
|
+
}
|
|
2409
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormLoadingDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2410
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormLoadingDirective, isStandalone: true, selector: "[rxapFormLoading]", ngImport: i0 }); }
|
|
2167
2411
|
}
|
|
2168
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2412
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormLoadingDirective, decorators: [{
|
|
2169
2413
|
type: Directive,
|
|
2170
2414
|
args: [{
|
|
2171
|
-
selector: '[
|
|
2172
|
-
providers: [
|
|
2173
|
-
{
|
|
2174
|
-
provide: ControlContainer,
|
|
2175
|
-
useExisting: forwardRef(() => FormGroupNameDirective),
|
|
2176
|
-
},
|
|
2177
|
-
],
|
|
2178
|
-
exportAs: 'rxapFormGroup',
|
|
2415
|
+
selector: '[rxapFormLoading]',
|
|
2179
2416
|
standalone: true,
|
|
2180
2417
|
}]
|
|
2181
|
-
}], ctorParameters:
|
|
2182
|
-
type: Optional
|
|
2183
|
-
}, {
|
|
2184
|
-
type: SkipSelf
|
|
2185
|
-
}] }, { type: undefined, decorators: [{
|
|
2186
|
-
type: Optional
|
|
2187
|
-
}, {
|
|
2188
|
-
type: Self
|
|
2189
|
-
}, {
|
|
2418
|
+
}], ctorParameters: () => [{ type: FormDirective, decorators: [{
|
|
2190
2419
|
type: Inject,
|
|
2191
|
-
args: [
|
|
2192
|
-
}] }, { type:
|
|
2193
|
-
type: Optional
|
|
2194
|
-
}, {
|
|
2195
|
-
type: Self
|
|
2196
|
-
}, {
|
|
2420
|
+
args: [FormDirective]
|
|
2421
|
+
}] }, { type: i0.TemplateRef, decorators: [{
|
|
2197
2422
|
type: Inject,
|
|
2198
|
-
args: [
|
|
2199
|
-
}] }
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2423
|
+
args: [TemplateRef]
|
|
2424
|
+
}] }, { type: i0.ViewContainerRef, decorators: [{
|
|
2425
|
+
type: Inject,
|
|
2426
|
+
args: [ViewContainerRef]
|
|
2427
|
+
}] }] });
|
|
2203
2428
|
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
*/
|
|
2210
|
-
class FormControlNameDirective extends FormControlName {
|
|
2211
|
-
constructor(parent, validators, asyncValidators, valueAccessors) {
|
|
2212
|
-
super(parent, validators, asyncValidators, valueAccessors, null);
|
|
2429
|
+
class FormSubmitFailedDirective {
|
|
2430
|
+
constructor(formDirective, template, viewContainerRef) {
|
|
2431
|
+
this.formDirective = formDirective;
|
|
2432
|
+
this.template = template;
|
|
2433
|
+
this.viewContainerRef = viewContainerRef;
|
|
2213
2434
|
}
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
}
|
|
2220
|
-
|
|
2435
|
+
ngAfterViewInit() {
|
|
2436
|
+
this.subscription = this.formDirective.submitError$.pipe(tap(error => {
|
|
2437
|
+
this.viewContainerRef.clear();
|
|
2438
|
+
if (error !== null) {
|
|
2439
|
+
this.viewContainerRef.createEmbeddedView(this.template, { $implicit: error });
|
|
2440
|
+
}
|
|
2441
|
+
})).subscribe();
|
|
2442
|
+
}
|
|
2443
|
+
ngOnDestroy() {
|
|
2444
|
+
this.subscription?.unsubscribe();
|
|
2445
|
+
}
|
|
2446
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormSubmitFailedDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2447
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormSubmitFailedDirective, isStandalone: true, selector: "[rxapFormSubmitFailed]", ngImport: i0 }); }
|
|
2221
2448
|
}
|
|
2222
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2449
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormSubmitFailedDirective, decorators: [{
|
|
2223
2450
|
type: Directive,
|
|
2224
2451
|
args: [{
|
|
2225
|
-
selector: '[
|
|
2226
|
-
providers: [
|
|
2227
|
-
{
|
|
2228
|
-
provide: NgControl,
|
|
2229
|
-
useExisting: forwardRef(() => FormControlNameDirective),
|
|
2230
|
-
},
|
|
2231
|
-
],
|
|
2232
|
-
exportAs: 'rxapFormControl',
|
|
2452
|
+
selector: '[rxapFormSubmitFailed]',
|
|
2233
2453
|
standalone: true,
|
|
2234
2454
|
}]
|
|
2235
|
-
}], ctorParameters:
|
|
2236
|
-
type: Optional
|
|
2237
|
-
}, {
|
|
2238
|
-
type: SkipSelf
|
|
2239
|
-
}] }, { type: Array, decorators: [{
|
|
2240
|
-
type: Optional
|
|
2241
|
-
}, {
|
|
2242
|
-
type: Self
|
|
2243
|
-
}, {
|
|
2455
|
+
}], ctorParameters: () => [{ type: FormDirective, decorators: [{
|
|
2244
2456
|
type: Inject,
|
|
2245
|
-
args: [
|
|
2246
|
-
}] }, { type:
|
|
2247
|
-
type: Optional
|
|
2248
|
-
}, {
|
|
2249
|
-
type: Self
|
|
2250
|
-
}, {
|
|
2457
|
+
args: [FormDirective]
|
|
2458
|
+
}] }, { type: i0.TemplateRef, decorators: [{
|
|
2251
2459
|
type: Inject,
|
|
2252
|
-
args: [
|
|
2253
|
-
}] }, { type:
|
|
2254
|
-
type: Optional
|
|
2255
|
-
}, {
|
|
2256
|
-
type: Self
|
|
2257
|
-
}, {
|
|
2460
|
+
args: [TemplateRef]
|
|
2461
|
+
}] }, { type: i0.ViewContainerRef, decorators: [{
|
|
2258
2462
|
type: Inject,
|
|
2259
|
-
args: [
|
|
2260
|
-
}] }]
|
|
2261
|
-
type: Input,
|
|
2262
|
-
args: ['rxapFormControlName']
|
|
2263
|
-
}] } });
|
|
2463
|
+
args: [ViewContainerRef]
|
|
2464
|
+
}] }] });
|
|
2264
2465
|
|
|
2265
|
-
class
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2466
|
+
class FormSubmitInvalidDirective {
|
|
2467
|
+
constructor(formDirective, template, viewContainerRef) {
|
|
2468
|
+
this.formDirective = formDirective;
|
|
2469
|
+
this.template = template;
|
|
2470
|
+
this.viewContainerRef = viewContainerRef;
|
|
2471
|
+
}
|
|
2472
|
+
ngAfterViewInit() {
|
|
2473
|
+
this.subscription = this.formDirective.invalidSubmit.pipe(tap(result => {
|
|
2474
|
+
this.viewContainerRef.clear();
|
|
2475
|
+
this.viewContainerRef.createEmbeddedView(this.template, { $implicit: result });
|
|
2476
|
+
})).subscribe();
|
|
2477
|
+
}
|
|
2478
|
+
ngOnDestroy() {
|
|
2479
|
+
this.subscription?.unsubscribe();
|
|
2480
|
+
}
|
|
2481
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormSubmitInvalidDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2482
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormSubmitInvalidDirective, isStandalone: true, selector: "[rxapFormSubmitInvalid]", ngImport: i0 }); }
|
|
2273
2483
|
}
|
|
2274
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2484
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormSubmitInvalidDirective, decorators: [{
|
|
2275
2485
|
type: Directive,
|
|
2276
2486
|
args: [{
|
|
2277
|
-
|
|
2278
|
-
selector: '[formControlName][parentControlContainer],[formControlGroup][parentControlContainer]',
|
|
2279
|
-
providers: [
|
|
2280
|
-
{
|
|
2281
|
-
provide: ControlContainer,
|
|
2282
|
-
useExisting: ControlContainer,
|
|
2283
|
-
},
|
|
2284
|
-
],
|
|
2487
|
+
selector: '[rxapFormSubmitInvalid]',
|
|
2285
2488
|
standalone: true,
|
|
2286
2489
|
}]
|
|
2287
|
-
}]
|
|
2490
|
+
}], ctorParameters: () => [{ type: FormDirective, decorators: [{
|
|
2491
|
+
type: Inject,
|
|
2492
|
+
args: [FormDirective]
|
|
2493
|
+
}] }, { type: i0.TemplateRef, decorators: [{
|
|
2494
|
+
type: Inject,
|
|
2495
|
+
args: [TemplateRef]
|
|
2496
|
+
}] }, { type: i0.ViewContainerRef, decorators: [{
|
|
2497
|
+
type: Inject,
|
|
2498
|
+
args: [ViewContainerRef]
|
|
2499
|
+
}] }] });
|
|
2288
2500
|
|
|
2289
2501
|
class FormSubmitSuccessfulDirective {
|
|
2290
2502
|
constructor(formDirective, template, viewContainerRef) {
|
|
@@ -2301,51 +2513,123 @@ class FormSubmitSuccessfulDirective {
|
|
|
2301
2513
|
ngOnDestroy() {
|
|
2302
2514
|
this.subscription?.unsubscribe();
|
|
2303
2515
|
}
|
|
2304
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2305
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2516
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormSubmitSuccessfulDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2517
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormSubmitSuccessfulDirective, isStandalone: true, selector: "[rxapFormSubmitSuccessful]", ngImport: i0 }); }
|
|
2518
|
+
}
|
|
2519
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormSubmitSuccessfulDirective, decorators: [{
|
|
2520
|
+
type: Directive,
|
|
2521
|
+
args: [{
|
|
2522
|
+
selector: '[rxapFormSubmitSuccessful]',
|
|
2523
|
+
standalone: true,
|
|
2524
|
+
}]
|
|
2525
|
+
}], ctorParameters: () => [{ type: FormDirective, decorators: [{
|
|
2526
|
+
type: Inject,
|
|
2527
|
+
args: [FormDirective]
|
|
2528
|
+
}] }, { type: i0.TemplateRef, decorators: [{
|
|
2529
|
+
type: Inject,
|
|
2530
|
+
args: [TemplateRef]
|
|
2531
|
+
}] }, { type: i0.ViewContainerRef, decorators: [{
|
|
2532
|
+
type: Inject,
|
|
2533
|
+
args: [ViewContainerRef]
|
|
2534
|
+
}] }] });
|
|
2535
|
+
|
|
2536
|
+
class FormSubmitDirective extends ConfirmClick {
|
|
2537
|
+
set resetAfterSubmit(value) {
|
|
2538
|
+
this._resetAfterSubmit = coerceBoolean(value);
|
|
2539
|
+
}
|
|
2540
|
+
constructor(formDirective, router = null) {
|
|
2541
|
+
super();
|
|
2542
|
+
this.formDirective = formDirective;
|
|
2543
|
+
this.router = router;
|
|
2544
|
+
this.type = 'button';
|
|
2545
|
+
this.afterSubmit = new EventEmitter();
|
|
2546
|
+
this._resetAfterSubmit = false;
|
|
2547
|
+
}
|
|
2548
|
+
execute() {
|
|
2549
|
+
this.formDirective.form.markAllAsDirty();
|
|
2550
|
+
this.formDirective.form.markAllAsTouched();
|
|
2551
|
+
this.formDirective.cdr.markForCheck();
|
|
2552
|
+
this.subscription = this.formDirective.rxapSubmit.pipe(take(1), tap(value => {
|
|
2553
|
+
const clonedValue = clone(value);
|
|
2554
|
+
this.afterSubmit.emit(clonedValue);
|
|
2555
|
+
if (this._resetAfterSubmit) {
|
|
2556
|
+
this.formDirective.reset();
|
|
2557
|
+
}
|
|
2558
|
+
if (this.navigateAfterSubmit) {
|
|
2559
|
+
if (!this.router) {
|
|
2560
|
+
throw new Error('Could not resolve the router!');
|
|
2561
|
+
}
|
|
2562
|
+
return this.router.navigate(this.navigateAfterSubmit);
|
|
2563
|
+
}
|
|
2564
|
+
return Promise.resolve();
|
|
2565
|
+
})).subscribe();
|
|
2566
|
+
this.formDirective.onSubmit(new Event('submit'));
|
|
2567
|
+
}
|
|
2568
|
+
ngOnDestroy() {
|
|
2569
|
+
this.subscription?.unsubscribe();
|
|
2570
|
+
}
|
|
2571
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormSubmitDirective, deps: [{ token: FormDirective }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2572
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormSubmitDirective, isStandalone: true, selector: "[rxapFormSubmit]", inputs: { type: "type", resetAfterSubmit: "resetAfterSubmit", navigateAfterSubmit: "navigateAfterSubmit" }, outputs: { afterSubmit: "afterSubmit" }, host: { listeners: { "click": "onClick()", "confirmed": "onConfirm()" }, properties: { "type": "this.type" } }, usesInheritance: true, ngImport: i0 }); }
|
|
2306
2573
|
}
|
|
2307
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2574
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormSubmitDirective, decorators: [{
|
|
2308
2575
|
type: Directive,
|
|
2309
2576
|
args: [{
|
|
2310
|
-
selector: '[
|
|
2577
|
+
selector: '[rxapFormSubmit]',
|
|
2578
|
+
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
2579
|
+
host: {
|
|
2580
|
+
'(click)': 'onClick()',
|
|
2581
|
+
'(confirmed)': 'onConfirm()',
|
|
2582
|
+
},
|
|
2311
2583
|
standalone: true,
|
|
2312
2584
|
}]
|
|
2313
|
-
}], ctorParameters:
|
|
2585
|
+
}], ctorParameters: () => [{ type: FormDirective, decorators: [{
|
|
2314
2586
|
type: Inject,
|
|
2315
2587
|
args: [FormDirective]
|
|
2316
|
-
}] }, { type:
|
|
2317
|
-
type:
|
|
2318
|
-
|
|
2319
|
-
}] }, { type: i0.ViewContainerRef, decorators: [{
|
|
2588
|
+
}] }, { type: i2$1.Router, decorators: [{
|
|
2589
|
+
type: Optional
|
|
2590
|
+
}, {
|
|
2320
2591
|
type: Inject,
|
|
2321
|
-
args: [
|
|
2322
|
-
}] }]
|
|
2592
|
+
args: [Router]
|
|
2593
|
+
}] }], propDecorators: { type: [{
|
|
2594
|
+
type: HostBinding,
|
|
2595
|
+
args: ['type']
|
|
2596
|
+
}, {
|
|
2597
|
+
type: Input
|
|
2598
|
+
}], resetAfterSubmit: [{
|
|
2599
|
+
type: Input
|
|
2600
|
+
}], navigateAfterSubmit: [{
|
|
2601
|
+
type: Input
|
|
2602
|
+
}], afterSubmit: [{
|
|
2603
|
+
type: Output
|
|
2604
|
+
}] } });
|
|
2323
2605
|
|
|
2324
|
-
class
|
|
2606
|
+
class FormSubmittingDirective {
|
|
2325
2607
|
constructor(formDirective, template, viewContainerRef) {
|
|
2326
2608
|
this.formDirective = formDirective;
|
|
2327
2609
|
this.template = template;
|
|
2328
2610
|
this.viewContainerRef = viewContainerRef;
|
|
2329
2611
|
}
|
|
2330
2612
|
ngAfterViewInit() {
|
|
2331
|
-
this.subscription = this.formDirective.
|
|
2613
|
+
this.subscription = this.formDirective.submitting$.pipe(distinctUntilChanged(), tap(loading => {
|
|
2332
2614
|
this.viewContainerRef.clear();
|
|
2333
|
-
|
|
2615
|
+
if (loading) {
|
|
2616
|
+
this.viewContainerRef.createEmbeddedView(this.template);
|
|
2617
|
+
}
|
|
2334
2618
|
})).subscribe();
|
|
2335
2619
|
}
|
|
2336
2620
|
ngOnDestroy() {
|
|
2337
2621
|
this.subscription?.unsubscribe();
|
|
2338
2622
|
}
|
|
2339
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2340
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2623
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormSubmittingDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2624
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: FormSubmittingDirective, isStandalone: true, selector: "[rxapFormSubmitting]", ngImport: i0 }); }
|
|
2341
2625
|
}
|
|
2342
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2626
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: FormSubmittingDirective, decorators: [{
|
|
2343
2627
|
type: Directive,
|
|
2344
2628
|
args: [{
|
|
2345
|
-
selector: '[
|
|
2629
|
+
selector: '[rxapFormSubmitting]',
|
|
2346
2630
|
standalone: true,
|
|
2347
2631
|
}]
|
|
2348
|
-
}], ctorParameters:
|
|
2632
|
+
}], ctorParameters: () => [{ type: FormDirective, decorators: [{
|
|
2349
2633
|
type: Inject,
|
|
2350
2634
|
args: [FormDirective]
|
|
2351
2635
|
}] }, { type: i0.TemplateRef, decorators: [{
|
|
@@ -2354,11 +2638,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2354
2638
|
}] }, { type: i0.ViewContainerRef, decorators: [{
|
|
2355
2639
|
type: Inject,
|
|
2356
2640
|
args: [ViewContainerRef]
|
|
2357
|
-
}] }]
|
|
2641
|
+
}] }] });
|
|
2642
|
+
|
|
2643
|
+
class ParentControlContainerDirective {
|
|
2644
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ParentControlContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2645
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: ParentControlContainerDirective, isStandalone: true, selector: "[formControlName][parentControlContainer],[formControlGroup][parentControlContainer]", providers: [
|
|
2646
|
+
{
|
|
2647
|
+
provide: ControlContainer,
|
|
2648
|
+
useExisting: ControlContainer,
|
|
2649
|
+
},
|
|
2650
|
+
], ngImport: i0 }); }
|
|
2651
|
+
}
|
|
2652
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ParentControlContainerDirective, decorators: [{
|
|
2653
|
+
type: Directive,
|
|
2654
|
+
args: [{
|
|
2655
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
2656
|
+
selector: '[formControlName][parentControlContainer],[formControlGroup][parentControlContainer]',
|
|
2657
|
+
providers: [
|
|
2658
|
+
{
|
|
2659
|
+
provide: ControlContainer,
|
|
2660
|
+
useExisting: ControlContainer,
|
|
2661
|
+
},
|
|
2662
|
+
],
|
|
2663
|
+
standalone: true,
|
|
2664
|
+
}]
|
|
2665
|
+
}] });
|
|
2358
2666
|
|
|
2359
2667
|
class RxapFormsModule {
|
|
2360
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2361
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
2668
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: RxapFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2669
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.3", ngImport: i0, type: RxapFormsModule, imports: [FormDirective,
|
|
2362
2670
|
FormSubmitFailedDirective,
|
|
2363
2671
|
FormLoadingDirective,
|
|
2364
2672
|
FormSubmittingDirective,
|
|
@@ -2391,9 +2699,9 @@ class RxapFormsModule {
|
|
|
2391
2699
|
ParentControlContainerDirective,
|
|
2392
2700
|
FormSubmitSuccessfulDirective,
|
|
2393
2701
|
FormSubmitInvalidDirective] }); }
|
|
2394
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2702
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: RxapFormsModule }); }
|
|
2395
2703
|
}
|
|
2396
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2704
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: RxapFormsModule, decorators: [{
|
|
2397
2705
|
type: NgModule,
|
|
2398
2706
|
args: [{
|
|
2399
2707
|
imports: [
|
|
@@ -2440,419 +2748,112 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2440
2748
|
function ToFormMethod(call) {
|
|
2441
2749
|
return { call };
|
|
2442
2750
|
}
|
|
2443
|
-
/**
|
|
2444
|
-
* @deprecated use ToFormMethod instead
|
|
2445
|
-
*
|
|
2446
|
-
* @param call the call method implementation
|
|
2447
|
-
*/
|
|
2448
|
-
function ToFormSubmitMethod(call) {
|
|
2449
|
-
return ToFormMethod(call);
|
|
2450
|
-
}
|
|
2451
|
-
|
|
2452
|
-
/**
|
|
2453
|
-
* Checks if a given value is a number.
|
|
2454
|
-
*/
|
|
2455
|
-
function isNumber(value, options = {}) {
|
|
2456
|
-
if (typeof value !== 'number') {
|
|
2457
|
-
return false;
|
|
2458
|
-
}
|
|
2459
|
-
if (value === Infinity || value === -Infinity) {
|
|
2460
|
-
return options.allowInfinity ?? false;
|
|
2461
|
-
}
|
|
2462
|
-
if (Number.isNaN(value)) {
|
|
2463
|
-
return options.allowNaN ?? false;
|
|
2464
|
-
}
|
|
2465
|
-
if (options.maxDecimalPlaces !== undefined) {
|
|
2466
|
-
let decimalPlaces = 0;
|
|
2467
|
-
if (value % 1 !== 0) {
|
|
2468
|
-
decimalPlaces = value.toString().split('.')[1].length;
|
|
2469
|
-
}
|
|
2470
|
-
if (decimalPlaces > options.maxDecimalPlaces) {
|
|
2471
|
-
return false;
|
|
2472
|
-
}
|
|
2473
|
-
}
|
|
2474
|
-
return Number.isFinite(value);
|
|
2475
|
-
}
|
|
2476
|
-
/**
|
|
2477
|
-
* @deprecated use RxapValidators.isNumber() instead
|
|
2478
|
-
* @param control
|
|
2479
|
-
* @constructor
|
|
2480
|
-
*/
|
|
2481
|
-
function IsNumber(control) {
|
|
2482
|
-
if (control.value === null) {
|
|
2483
|
-
return null;
|
|
2484
|
-
}
|
|
2485
|
-
if (isNaN(Number(control.value))) {
|
|
2486
|
-
return {
|
|
2487
|
-
isNumber: {
|
|
2488
|
-
expected: 'A number or a string representing a number',
|
|
2489
|
-
actual: control.value,
|
|
2490
|
-
},
|
|
2491
|
-
};
|
|
2492
|
-
}
|
|
2493
|
-
return null;
|
|
2494
|
-
}
|
|
2495
|
-
function _IsNumber({ message, options, } = {}) {
|
|
2496
|
-
return (control) => {
|
|
2497
|
-
if (control.value === null) {
|
|
2498
|
-
return null;
|
|
2499
|
-
}
|
|
2500
|
-
if (!isNumber(!options?.strict && typeof control.value === 'string' ? Number(control.value) : control.value, options)) {
|
|
2501
|
-
return {
|
|
2502
|
-
isNumber: {
|
|
2503
|
-
expected: 'A number value',
|
|
2504
|
-
actual: control.value,
|
|
2505
|
-
message,
|
|
2506
|
-
},
|
|
2507
|
-
};
|
|
2508
|
-
}
|
|
2509
|
-
return null;
|
|
2510
|
-
};
|
|
2511
|
-
}
|
|
2512
|
-
|
|
2513
|
-
function IsBoolean({ message } = {}) {
|
|
2514
|
-
return (control) => {
|
|
2515
|
-
if (control.value === null) {
|
|
2516
|
-
return null;
|
|
2517
|
-
}
|
|
2518
|
-
if (!(control.value instanceof Boolean || typeof control.value === 'boolean')) {
|
|
2519
|
-
return {
|
|
2520
|
-
isBoolean: {
|
|
2521
|
-
expected: 'A boolean value',
|
|
2522
|
-
actual: control.value,
|
|
2523
|
-
message,
|
|
2524
|
-
},
|
|
2525
|
-
};
|
|
2526
|
-
}
|
|
2527
|
-
return null;
|
|
2528
|
-
};
|
|
2529
|
-
}
|
|
2530
|
-
|
|
2531
|
-
function IsObject({ message } = {}) {
|
|
2532
|
-
return (control) => {
|
|
2533
|
-
if (control.value === null) {
|
|
2534
|
-
return null;
|
|
2535
|
-
}
|
|
2536
|
-
if (!(control.value !==
|
|
2537
|
-
undefined &&
|
|
2538
|
-
(typeof control.value === 'object' || typeof control.value === 'function') &&
|
|
2539
|
-
!Array.isArray(control.value))) {
|
|
2540
|
-
return {
|
|
2541
|
-
isObject: {
|
|
2542
|
-
expected: 'A object value',
|
|
2543
|
-
actual: control.value,
|
|
2544
|
-
message,
|
|
2545
|
-
},
|
|
2546
|
-
};
|
|
2547
|
-
}
|
|
2548
|
-
return null;
|
|
2549
|
-
};
|
|
2550
|
-
}
|
|
2551
|
-
|
|
2552
|
-
function IsString({ message } = {}) {
|
|
2553
|
-
return (control) => {
|
|
2554
|
-
if (control.value === null) {
|
|
2555
|
-
return null;
|
|
2556
|
-
}
|
|
2557
|
-
if (!(control.value instanceof String || typeof control.value === 'string')) {
|
|
2558
|
-
return {
|
|
2559
|
-
isString: {
|
|
2560
|
-
expected: 'A string value',
|
|
2561
|
-
actual: control.value,
|
|
2562
|
-
message,
|
|
2563
|
-
},
|
|
2564
|
-
};
|
|
2565
|
-
}
|
|
2566
|
-
return null;
|
|
2567
|
-
};
|
|
2568
|
-
}
|
|
2569
|
-
|
|
2570
|
-
function IsInt({ message, options, } = {}) {
|
|
2571
|
-
return (control) => {
|
|
2572
|
-
if (control.value === null) {
|
|
2573
|
-
return null;
|
|
2574
|
-
}
|
|
2575
|
-
if (!isNumber(control.value, options) || Number.isInteger(control.value)) {
|
|
2576
|
-
return {
|
|
2577
|
-
isInt: {
|
|
2578
|
-
expected: 'A int value',
|
|
2579
|
-
actual: control.value,
|
|
2580
|
-
message,
|
|
2581
|
-
},
|
|
2582
|
-
};
|
|
2583
|
-
}
|
|
2584
|
-
return null;
|
|
2585
|
-
};
|
|
2586
|
-
}
|
|
2587
|
-
|
|
2588
|
-
function IsEnum({ message, entity, }) {
|
|
2589
|
-
return (control) => {
|
|
2590
|
-
if (control.value === null) {
|
|
2591
|
-
return null;
|
|
2592
|
-
}
|
|
2593
|
-
if (Object.keys(entity).map(k => entity[k]).indexOf(control.value) === -1) {
|
|
2594
|
-
return {
|
|
2595
|
-
isEnum: {
|
|
2596
|
-
expected: 'A enum value',
|
|
2597
|
-
actual: control.value,
|
|
2598
|
-
message,
|
|
2599
|
-
},
|
|
2600
|
-
};
|
|
2601
|
-
}
|
|
2602
|
-
return null;
|
|
2603
|
-
};
|
|
2604
|
-
}
|
|
2605
|
-
|
|
2606
|
-
function IsDate({ message } = {}) {
|
|
2607
|
-
return (control) => {
|
|
2608
|
-
if (control.value === null) {
|
|
2609
|
-
return null;
|
|
2610
|
-
}
|
|
2611
|
-
if (!(control.value instanceof Date && !isNaN(control.value.getTime()))) {
|
|
2612
|
-
return {
|
|
2613
|
-
isDate: {
|
|
2614
|
-
expected: 'A date value',
|
|
2615
|
-
actual: control.value,
|
|
2616
|
-
message,
|
|
2617
|
-
},
|
|
2618
|
-
};
|
|
2619
|
-
}
|
|
2620
|
-
return null;
|
|
2621
|
-
};
|
|
2622
|
-
}
|
|
2623
|
-
|
|
2624
|
-
function IsArray({ message } = {}) {
|
|
2625
|
-
return (control) => {
|
|
2626
|
-
if (control.value === null) {
|
|
2627
|
-
return null;
|
|
2628
|
-
}
|
|
2629
|
-
if (!Array.isArray(control.value)) {
|
|
2630
|
-
return {
|
|
2631
|
-
isArray: {
|
|
2632
|
-
expected: 'A array value',
|
|
2633
|
-
actual: control.value,
|
|
2634
|
-
message,
|
|
2635
|
-
},
|
|
2636
|
-
};
|
|
2637
|
-
}
|
|
2638
|
-
return null;
|
|
2639
|
-
};
|
|
2640
|
-
}
|
|
2641
|
-
|
|
2642
|
-
const regexOptions = {
|
|
2643
|
-
uppercase: '.*[A-Z]',
|
|
2644
|
-
special: '.*[^A-Za-z0-9]',
|
|
2645
|
-
digit: '.*[0-9]',
|
|
2646
|
-
lowercase: '.*[a-z]',
|
|
2647
|
-
upperLower: '.*[a-zA-Z]',
|
|
2648
|
-
alphaNumeric: '.*[a-zA-Z0-9]',
|
|
2649
|
-
};
|
|
2650
|
-
const lengthOptions = {
|
|
2651
|
-
min: '.{n,}',
|
|
2652
|
-
max: '.{0,n}',
|
|
2653
|
-
range: '.{min,max}',
|
|
2654
|
-
exact: '.{n}',
|
|
2655
|
-
no_limit: '.*',
|
|
2656
|
-
};
|
|
2657
|
-
function inOperator(k, o) {
|
|
2658
|
-
return k in o;
|
|
2751
|
+
/**
|
|
2752
|
+
* @deprecated use ToFormMethod instead
|
|
2753
|
+
*
|
|
2754
|
+
* @param call the call method implementation
|
|
2755
|
+
*/
|
|
2756
|
+
function ToFormSubmitMethod(call) {
|
|
2757
|
+
return ToFormMethod(call);
|
|
2659
2758
|
}
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2759
|
+
|
|
2760
|
+
function ControlAsyncValidator(...controlIds) {
|
|
2761
|
+
return function (target, propertyKey) {
|
|
2762
|
+
for (const controlId of controlIds) {
|
|
2763
|
+
setMetadataMapSet(controlId, propertyKey, MetadataKeys.CONTROL_ASYNC_VALIDATORS, target);
|
|
2665
2764
|
}
|
|
2666
|
-
}
|
|
2667
|
-
if (isNumber(options.min) && isNumber(options.max)) {
|
|
2668
|
-
regex += lengthOptions.range.replace('min', options.min.toFixed(0)).replace('max', options.max.toFixed(0));
|
|
2669
|
-
}
|
|
2670
|
-
else if (isNumber(options.max)) {
|
|
2671
|
-
regex += lengthOptions.max.replace('n', options.max.toFixed(0));
|
|
2672
|
-
}
|
|
2673
|
-
else if (isNumber(options.min)) {
|
|
2674
|
-
regex += lengthOptions.min.replace('n', options.min.toFixed(0));
|
|
2675
|
-
}
|
|
2676
|
-
else if (isNumber(options.exact)) {
|
|
2677
|
-
regex += lengthOptions.exact.replace('n', options.exact.toFixed(0));
|
|
2678
|
-
}
|
|
2679
|
-
else {
|
|
2680
|
-
regex += lengthOptions.no_limit;
|
|
2681
|
-
}
|
|
2682
|
-
regex += '$';
|
|
2683
|
-
return regex;
|
|
2684
|
-
}
|
|
2685
|
-
function check(str, regexStringOrOptions) {
|
|
2686
|
-
let regexString;
|
|
2687
|
-
if (typeof regexStringOrOptions === 'object') {
|
|
2688
|
-
regexString = create(regexStringOrOptions);
|
|
2689
|
-
}
|
|
2690
|
-
else {
|
|
2691
|
-
regexString = regexStringOrOptions;
|
|
2692
|
-
}
|
|
2693
|
-
return new RegExp(regexString).test(str);
|
|
2694
|
-
}
|
|
2695
|
-
function checkError(str, options) {
|
|
2696
|
-
const returnObject = {};
|
|
2697
|
-
for (const [key, value] of Object.entries(options)) {
|
|
2698
|
-
returnObject[key] = check(str, { [key]: value });
|
|
2699
|
-
}
|
|
2700
|
-
return returnObject;
|
|
2765
|
+
};
|
|
2701
2766
|
}
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
const isNotString = IsString({ message })(control);
|
|
2708
|
-
if (isNotString !== null) {
|
|
2709
|
-
return isNotString;
|
|
2710
|
-
}
|
|
2711
|
-
const errors = checkError(control.value, options);
|
|
2712
|
-
if (Object.keys(errors).length && Object.values(errors).some(item => !item)) {
|
|
2713
|
-
return {
|
|
2714
|
-
isComplex: {
|
|
2715
|
-
expected: options,
|
|
2716
|
-
actual: errors,
|
|
2717
|
-
message,
|
|
2718
|
-
},
|
|
2719
|
-
};
|
|
2767
|
+
|
|
2768
|
+
function ControlChange(...controlIds) {
|
|
2769
|
+
return function (target, propertyKey) {
|
|
2770
|
+
for (const controlId of controlIds) {
|
|
2771
|
+
setMetadataMapSet(controlId, propertyKey, MetadataKeys.CONTROL_CHANGES, target);
|
|
2720
2772
|
}
|
|
2721
|
-
return null;
|
|
2722
2773
|
};
|
|
2723
2774
|
}
|
|
2724
2775
|
|
|
2725
|
-
function
|
|
2726
|
-
return (
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
return {
|
|
2732
|
-
isPhoneNumber: {
|
|
2733
|
-
expected: 'A phone number value',
|
|
2734
|
-
actual: control.value,
|
|
2735
|
-
message,
|
|
2736
|
-
},
|
|
2737
|
-
};
|
|
2738
|
-
}
|
|
2739
|
-
return null;
|
|
2776
|
+
function ControlSetValue(controlId, options = {}) {
|
|
2777
|
+
return function (target, propertyKey) {
|
|
2778
|
+
setMetadataMapSet(controlId, {
|
|
2779
|
+
...options,
|
|
2780
|
+
propertyKey,
|
|
2781
|
+
}, MetadataKeys.CONTROL_SET_VALUE, target);
|
|
2740
2782
|
};
|
|
2741
2783
|
}
|
|
2742
2784
|
|
|
2743
|
-
function
|
|
2744
|
-
return (
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
}
|
|
2748
|
-
if (!(typeof control.value === 'string' && isEmail(control.value, options))) {
|
|
2749
|
-
return {
|
|
2750
|
-
isEmail: {
|
|
2751
|
-
expected: 'A email value',
|
|
2752
|
-
actual: control.value,
|
|
2753
|
-
message,
|
|
2754
|
-
},
|
|
2755
|
-
};
|
|
2785
|
+
function ControlValidator(...controlIds) {
|
|
2786
|
+
return function (target, propertyKey) {
|
|
2787
|
+
for (const controlId of controlIds) {
|
|
2788
|
+
setMetadataMapSet(controlId, propertyKey, MetadataKeys.CONTROL_VALIDATORS, target);
|
|
2756
2789
|
}
|
|
2757
|
-
return null;
|
|
2758
2790
|
};
|
|
2759
2791
|
}
|
|
2760
2792
|
|
|
2761
|
-
function
|
|
2762
|
-
return (
|
|
2763
|
-
|
|
2764
|
-
return null;
|
|
2765
|
-
}
|
|
2766
|
-
if (!(typeof control.value === 'string' && isURL(control.value, options))) {
|
|
2767
|
-
return {
|
|
2768
|
-
isURL: {
|
|
2769
|
-
expected: 'A url value',
|
|
2770
|
-
actual: control.value,
|
|
2771
|
-
message,
|
|
2772
|
-
},
|
|
2773
|
-
};
|
|
2774
|
-
}
|
|
2775
|
-
return null;
|
|
2793
|
+
function RxapForm(optionsOrId, className = 'FormDefinition', packageName = '@rxap/forms') {
|
|
2794
|
+
return function (target) {
|
|
2795
|
+
DefinitionMetadata(optionsOrId, className, packageName)(target);
|
|
2776
2796
|
};
|
|
2777
2797
|
}
|
|
2778
2798
|
|
|
2779
|
-
function
|
|
2780
|
-
return (
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
},
|
|
2791
|
-
};
|
|
2792
|
-
}
|
|
2793
|
-
return null;
|
|
2799
|
+
function UseFormArrayGroup(definition, options = {}) {
|
|
2800
|
+
return function (target, propertyKey) {
|
|
2801
|
+
setMetadataMap(propertyKey, {
|
|
2802
|
+
...options,
|
|
2803
|
+
definition,
|
|
2804
|
+
}, MetadataKeys.FORM_ARRAY_GROUPS, target);
|
|
2805
|
+
};
|
|
2806
|
+
}
|
|
2807
|
+
function UseFormArrayControl(options = {}) {
|
|
2808
|
+
return function (target, propertyKey) {
|
|
2809
|
+
setMetadataMap(propertyKey, options, MetadataKeys.FORM_ARRAY_CONTROLS, target);
|
|
2794
2810
|
};
|
|
2795
2811
|
}
|
|
2796
2812
|
|
|
2797
|
-
function
|
|
2798
|
-
return (
|
|
2799
|
-
|
|
2800
|
-
return null;
|
|
2801
|
-
}
|
|
2802
|
-
if (!(typeof control.value === 'string' && isPort(control.value))) {
|
|
2803
|
-
return {
|
|
2804
|
-
isPort: {
|
|
2805
|
-
expected: `A valid port number between 1 and 65535`,
|
|
2806
|
-
actual: control.value,
|
|
2807
|
-
message,
|
|
2808
|
-
},
|
|
2809
|
-
};
|
|
2810
|
-
}
|
|
2811
|
-
return null;
|
|
2813
|
+
function UseFormControl(options = {}) {
|
|
2814
|
+
return function (target, propertyKey) {
|
|
2815
|
+
setMetadataMap(propertyKey, options, MetadataKeys.FORM_CONTROLS, target);
|
|
2812
2816
|
};
|
|
2813
2817
|
}
|
|
2814
2818
|
|
|
2815
|
-
function
|
|
2816
|
-
return (
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
return {
|
|
2822
|
-
isUuid: {
|
|
2823
|
-
expected: version === 'all' ? `A valid uuid` : `A valid uuid version ${version}`,
|
|
2824
|
-
actual: control.value,
|
|
2825
|
-
message,
|
|
2826
|
-
},
|
|
2827
|
-
};
|
|
2828
|
-
}
|
|
2829
|
-
return null;
|
|
2819
|
+
function UseFormGroup(definition, options = {}) {
|
|
2820
|
+
return function (target, propertyKey) {
|
|
2821
|
+
setMetadataMap(propertyKey, {
|
|
2822
|
+
...options,
|
|
2823
|
+
definition,
|
|
2824
|
+
}, MetadataKeys.FORM_GROUPS, target);
|
|
2830
2825
|
};
|
|
2831
2826
|
}
|
|
2832
2827
|
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2828
|
+
class ControlValueAccessor {
|
|
2829
|
+
constructor() {
|
|
2830
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2831
|
+
this.onChange = (value) => {
|
|
2832
|
+
};
|
|
2833
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2834
|
+
this.onTouched = () => {
|
|
2835
|
+
};
|
|
2836
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2837
|
+
this.setDisabledState = (isDisabled) => {
|
|
2838
|
+
};
|
|
2839
|
+
}
|
|
2840
|
+
registerOnChange(fn) {
|
|
2841
|
+
this.onChange = fn;
|
|
2842
|
+
}
|
|
2843
|
+
registerOnTouched(fn) {
|
|
2844
|
+
this.onTouched = fn;
|
|
2845
|
+
}
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
const RXAP_FORM_INITIAL_STATE = new InjectionToken('rxap/forms/initial-state');
|
|
2849
|
+
const RXAP_FORM_CONTEXT = new InjectionToken('rxap/forms/context');
|
|
2850
2850
|
|
|
2851
|
+
// region validators
|
|
2851
2852
|
// endregion
|
|
2852
2853
|
|
|
2853
2854
|
/**
|
|
2854
2855
|
* Generated bundle index. Do not edit.
|
|
2855
2856
|
*/
|
|
2856
2857
|
|
|
2857
|
-
export { ControlAsyncValidator, ControlChange, ControlSetValue, ControlValidator, ControlValueAccessor, FormArrayControlManager, FormControlErrorDirective, FormControlMarkDirtyDirective, FormControlMarkPristineDirective, FormControlMarkTouchedDirective, FormControlMarkUntouchedDirective, FormControlNameDirective, FormDirective, FormGroupNameDirective, FormLoadedDirective, FormLoadingDirective, FormLoadingErrorDirective, FormSubmitDirective, FormSubmitFailedDirective, FormSubmitInvalidDirective, FormSubmitSuccessfulDirective, FormSubmittingDirective, IsArray, IsBoolean, IsDate, IsEnum, IsInt, IsNumber, IsObject, IsString, ParentControlContainerDirective, RXAP_FORM_CONTEXT, RXAP_FORM_DEFINITION, RXAP_FORM_DEFINITION_BUILDER, RXAP_FORM_INITIAL_STATE, RXAP_FORM_LOAD_FAILED_METHOD, RXAP_FORM_LOAD_METHOD, RXAP_FORM_LOAD_SUCCESSFUL_METHOD, RXAP_FORM_SUBMIT_FAILED_METHOD, RXAP_FORM_SUBMIT_METHOD, RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD, RxapForm, RxapFormArray, RxapFormBuilder, RxapFormControl, RxapFormGroup, RxapFormsModule, RxapValidators, ToFormMethod, ToFormSubmitMethod, UseFormArrayControl, UseFormArrayGroup, UseFormControl, UseFormGroup, _IsNumber, controlDisabled$, controlDisabledWhile, controlEnabled$, controlEnabledWhile, controlErrorChanges$, controlReadonly$, controlStatusChanges$, controlValueChanges$, disableControl, enableControl, hasErrorAndDirty, hasErrorAndTouched, isNumber, markAllDirty, markAllPristine, markAllUntouched, mergeControlValidators, selectControlValue$, validateControlOn };
|
|
2858
|
+
export { ControlAsyncValidator, ControlChange, ControlSetValue, ControlValidator, ControlValueAccessor, FormArrayControlManager, FormControlErrorDirective, FormControlMarkDirtyDirective, FormControlMarkPristineDirective, FormControlMarkTouchedDirective, FormControlMarkUntouchedDirective, FormControlNameDirective, FormDirective, FormGroupNameDirective, FormLoadedDirective, FormLoadingDirective, FormLoadingErrorDirective, FormSubmitDirective, FormSubmitFailedDirective, FormSubmitInvalidDirective, FormSubmitSuccessfulDirective, FormSubmittingDirective, IsArray, IsBoolean, IsComplex, IsDate, IsEmail, IsEnum, IsIP, IsInt, IsNumber, IsObject, IsPhoneNumber, IsPort, IsString, IsUUID, IsUrl, MetadataKeys, ParentControlContainerDirective, RXAP_FORM_CONTEXT, RXAP_FORM_DEFINITION, RXAP_FORM_DEFINITION_BUILDER, RXAP_FORM_INITIAL_STATE, RXAP_FORM_LOAD_FAILED_METHOD, RXAP_FORM_LOAD_METHOD, RXAP_FORM_LOAD_SUCCESSFUL_METHOD, RXAP_FORM_SUBMIT_FAILED_METHOD, RXAP_FORM_SUBMIT_METHOD, RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD, RxapForm, RxapFormArray, RxapFormBuilder, RxapFormControl, RxapFormGroup, RxapFormsModule, RxapValidators, ToFormMethod, ToFormSubmitMethod, UseFormArrayControl, UseFormArrayGroup, UseFormControl, UseFormGroup, _IsNumber, controlDisabled$, controlDisabledWhile, controlEnabled$, controlEnabledWhile, controlErrorChanges$, controlReadonly$, controlStatusChanges$, controlValueChanges$, disableControl, enableControl, hasErrorAndDirty, hasErrorAndTouched, isNumber, markAllDirty, markAllPristine, markAllUntouched, mergeControlValidators, selectControlValue$, validateControlOn };
|
|
2858
2859
|
//# sourceMappingURL=rxap-forms.mjs.map
|