iss-ctrl 0.0.17 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{iss-ctrl-iss-ctrl-BHW3shB0.mjs → iss-ctrl-iss-ctrl-Cy9p_PEj.mjs} +92 -60
- package/fesm2022/iss-ctrl-iss-ctrl-Cy9p_PEj.mjs.map +1 -0
- package/fesm2022/{iss-ctrl-load-event-BBKfb4GM.mjs → iss-ctrl-load-event-DbAc-Wqq.mjs} +3 -3
- package/fesm2022/{iss-ctrl-load-event-BBKfb4GM.mjs.map → iss-ctrl-load-event-DbAc-Wqq.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-load-options-event-jsZAQloX.mjs → iss-ctrl-load-options-event-CmXkuQ5O.mjs} +3 -3
- package/fesm2022/{iss-ctrl-load-options-event-jsZAQloX.mjs.map → iss-ctrl-load-options-event-CmXkuQ5O.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-load-value-event-ClkNTtds.mjs → iss-ctrl-load-value-event-DmX9Pkzf.mjs} +3 -3
- package/fesm2022/{iss-ctrl-load-value-event-ClkNTtds.mjs.map → iss-ctrl-load-value-event-DmX9Pkzf.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-note.field-Co2Og2eO.mjs → iss-ctrl-note.field-CbLlparb.mjs} +2 -2
- package/fesm2022/{iss-ctrl-note.field-Co2Og2eO.mjs.map → iss-ctrl-note.field-CbLlparb.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-replace-api-keys-Bx7wo5zl.mjs → iss-ctrl-replace-api-keys-C_mYQdtP.mjs} +2 -2
- package/fesm2022/{iss-ctrl-replace-api-keys-Bx7wo5zl.mjs.map → iss-ctrl-replace-api-keys-C_mYQdtP.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-set-value-event-D38jsLlO.mjs → iss-ctrl-set-value-event-vKIrSRgu.mjs} +2 -2
- package/fesm2022/{iss-ctrl-set-value-event-D38jsLlO.mjs.map → iss-ctrl-set-value-event-vKIrSRgu.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-table.field-BcuL_fSr.mjs → iss-ctrl-table.field-CvqXIE4q.mjs} +2 -2
- package/fesm2022/{iss-ctrl-table.field-BcuL_fSr.mjs.map → iss-ctrl-table.field-CvqXIE4q.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-trigger-based-on-json-value-B6M5dYnm.mjs → iss-ctrl-trigger-based-on-json-value-wyn6AXWA.mjs} +2 -2
- package/fesm2022/{iss-ctrl-trigger-based-on-json-value-B6M5dYnm.mjs.map → iss-ctrl-trigger-based-on-json-value-wyn6AXWA.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-user-picker.field-BCd6g9jz.mjs → iss-ctrl-user-picker.field-BhjVNeqN.mjs} +2 -2
- package/fesm2022/{iss-ctrl-user-picker.field-BCd6g9jz.mjs.map → iss-ctrl-user-picker.field-BhjVNeqN.mjs.map} +1 -1
- package/fesm2022/iss-ctrl.mjs +1 -1
- package/package.json +1 -1
- package/types/iss-ctrl.d.ts +19 -7
- package/fesm2022/iss-ctrl-iss-ctrl-BHW3shB0.mjs.map +0 -1
|
@@ -167,6 +167,9 @@ class ControlBase {
|
|
|
167
167
|
this.touched.set(true);
|
|
168
168
|
this.onTouch();
|
|
169
169
|
}
|
|
170
|
+
validate(control) {
|
|
171
|
+
return this.ctrl.errors;
|
|
172
|
+
}
|
|
170
173
|
/**
|
|
171
174
|
* Whether the control currently holds no value.
|
|
172
175
|
*
|
|
@@ -182,9 +185,6 @@ class ControlBase {
|
|
|
182
185
|
}
|
|
183
186
|
return value === null || value === undefined || value === "";
|
|
184
187
|
}
|
|
185
|
-
validate(control) {
|
|
186
|
-
return this.ctrl.errors;
|
|
187
|
-
}
|
|
188
188
|
onTouch = () => { };
|
|
189
189
|
onPropagateValue = (_) => { };
|
|
190
190
|
emitValue(value) {
|
|
@@ -381,10 +381,6 @@ class ChipsControl extends ControlBase {
|
|
|
381
381
|
this.keywords.set([]);
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
-
// the chips are the value here; `ctrl` stays untouched
|
|
385
|
-
isEmpty() {
|
|
386
|
-
return this.keywords().length === 0;
|
|
387
|
-
}
|
|
388
384
|
remove(keyword) {
|
|
389
385
|
if (this.disabled() || this.readonly()) {
|
|
390
386
|
return;
|
|
@@ -412,6 +408,10 @@ class ChipsControl extends ControlBase {
|
|
|
412
408
|
event.chipInput.clear();
|
|
413
409
|
this.emitValue(this.#stringifyValues());
|
|
414
410
|
}
|
|
411
|
+
// the chips are the value here; `ctrl` stays untouched
|
|
412
|
+
isEmpty() {
|
|
413
|
+
return this.keywords().length === 0;
|
|
414
|
+
}
|
|
415
415
|
#stringifyValues() {
|
|
416
416
|
return this.keywords().map((s) => s.trim()).join();
|
|
417
417
|
}
|
|
@@ -1114,11 +1114,6 @@ class DateRangePickerControl extends ControlBase {
|
|
|
1114
1114
|
this.onDateRangeObjectChange.emit(this.#getEmissionObject(values.start, values.end));
|
|
1115
1115
|
}));
|
|
1116
1116
|
}
|
|
1117
|
-
// the endpoints live on `range`; `ctrl` only holds the emitted value of a complete range
|
|
1118
|
-
isEmpty() {
|
|
1119
|
-
const { start, end } = this.range.getRawValue();
|
|
1120
|
-
return !start && !end;
|
|
1121
|
-
}
|
|
1122
1117
|
setDisabledState(isDisabled) {
|
|
1123
1118
|
super.setDisabledState(isDisabled);
|
|
1124
1119
|
// the template binds `range`, disabling ctrl alone leaves the inputs live
|
|
@@ -1160,6 +1155,11 @@ class DateRangePickerControl extends ControlBase {
|
|
|
1160
1155
|
ngOnDestroy() {
|
|
1161
1156
|
this.#sub.unsubscribe();
|
|
1162
1157
|
}
|
|
1158
|
+
// the endpoints live on `range`; `ctrl` only holds the emitted value of a complete range
|
|
1159
|
+
isEmpty() {
|
|
1160
|
+
const { start, end } = this.range.getRawValue();
|
|
1161
|
+
return !start && !end;
|
|
1162
|
+
}
|
|
1163
1163
|
openPicker(picker) {
|
|
1164
1164
|
if (this.readonly()) {
|
|
1165
1165
|
return;
|
|
@@ -6049,7 +6049,8 @@ class FieldEvent {
|
|
|
6049
6049
|
* | `visible()` | `boolean` | Whether the field is rendered at all. |
|
|
6050
6050
|
* | `loading()` | `boolean` | Shows the field's own loading state. |
|
|
6051
6051
|
* | `config` | `FieldConfig` | Per-type configuration — see {@link FieldConfig}. |
|
|
6052
|
-
* | `validation` | `any` | Synchronous validation rules. |
|
|
6052
|
+
* | `validation` | `any` | Synchronous validation rules, exactly as the JSON declared them. |
|
|
6053
|
+
* | `validationFns` | `Record<string, Function>` | Validator factory behind each active rule, resolved by the outlet. |
|
|
6053
6054
|
* | `asyncValidation` | `FieldAsyncValidation` | Remote validation rules. |
|
|
6054
6055
|
* | `events` | `FieldEvent[]` | Cross-field reactions (show, hide, set value, …). |
|
|
6055
6056
|
* | `children` | `IssField[]` | Nested fields, used by table and group fields. |
|
|
@@ -6073,6 +6074,10 @@ class IssField {
|
|
|
6073
6074
|
wasVisible = signal(true, ...(ngDevMode ? [{ debugName: "wasVisible" }] : /* istanbul ignore next */ []));
|
|
6074
6075
|
events;
|
|
6075
6076
|
validation;
|
|
6077
|
+
// The lazily imported factory behind each active rule in `validation`, keyed by rule name.
|
|
6078
|
+
// The factories are kept beside the rules instead of inside them so `validation` stays the
|
|
6079
|
+
// object the JSON declared: what a rule says is the API's, how it is applied is ours.
|
|
6080
|
+
validationFns = {};
|
|
6076
6081
|
asyncValidation;
|
|
6077
6082
|
children;
|
|
6078
6083
|
apiResponse = new BehaviorSubject(null);
|
|
@@ -6163,6 +6168,18 @@ const VALIDATORS = {
|
|
|
6163
6168
|
fileSize: () => Promise.resolve().then(function () { return file_validator; }).then((c) => c.FileValidators.size),
|
|
6164
6169
|
fileType: () => Promise.resolve().then(function () { return file_validator; }).then((c) => c.FileValidators.type),
|
|
6165
6170
|
};
|
|
6171
|
+
/**
|
|
6172
|
+
* Whether a rule in a field's `validation` is switched on.
|
|
6173
|
+
*
|
|
6174
|
+
* The rule's value is the argument its validator is built with, so it is also what says
|
|
6175
|
+
* whether the rule applies at all: `{ "required": false }` is an optional field, not a
|
|
6176
|
+
* required one, and a rule the API left out or sent as null is off the same way. Values
|
|
6177
|
+
* that are falsy but meaningful — `0`, `""` — are rules, so only the three off states are
|
|
6178
|
+
* rejected here.
|
|
6179
|
+
*/
|
|
6180
|
+
function isActiveValidationRule(value) {
|
|
6181
|
+
return value !== undefined && value !== null && value !== false;
|
|
6182
|
+
}
|
|
6166
6183
|
|
|
6167
6184
|
class FormEngine {
|
|
6168
6185
|
// Fields are stored per host FormGroup, never on the service itself: a single root
|
|
@@ -6247,9 +6264,11 @@ class FormEngine {
|
|
|
6247
6264
|
trackChangesValidations(field, form) {
|
|
6248
6265
|
const changes$ = [];
|
|
6249
6266
|
const masterNames = new Set();
|
|
6250
|
-
|
|
6267
|
+
// A rule that names another field — `beforeDate`, say — carries that name as its value, and
|
|
6268
|
+
// `processTrackChanges` ignores every value that is not a string.
|
|
6269
|
+
const iterateOn = Object.entries(field.validation ?? {});
|
|
6251
6270
|
iterateOn.forEach((validationObj) => {
|
|
6252
|
-
this.processTrackChanges(validationObj[1]
|
|
6271
|
+
this.processTrackChanges(validationObj[1], masterNames, changes$, field, form);
|
|
6253
6272
|
});
|
|
6254
6273
|
return merge(...changes$);
|
|
6255
6274
|
}
|
|
@@ -6281,8 +6300,10 @@ class FormEngine {
|
|
|
6281
6300
|
changes$.push(this.#mapMasterFieldValueChangesToFieldChanges(masterField, masterCtrl));
|
|
6282
6301
|
}
|
|
6283
6302
|
}
|
|
6303
|
+
// A field carries validation only where a rule is actually switched on: one sent as `false`
|
|
6304
|
+
// or `null` says the field is free of it, so it counts for nothing here.
|
|
6284
6305
|
fieldHasValidation(field) {
|
|
6285
|
-
return !!
|
|
6306
|
+
return !!field.validation && Object.values(field.validation).some(isActiveValidationRule);
|
|
6286
6307
|
}
|
|
6287
6308
|
fieldHasAsyncValidation(field) {
|
|
6288
6309
|
return !!(field.asyncValidation && Object.values(field.asyncValidation).filter((v) => v).length);
|
|
@@ -6290,7 +6311,7 @@ class FormEngine {
|
|
|
6290
6311
|
isFormValid(form, fields) {
|
|
6291
6312
|
return fields.map((childField) => {
|
|
6292
6313
|
const currentCtrl = form.get(childField.name);
|
|
6293
|
-
if (childField.validation?.required
|
|
6314
|
+
if (isActiveValidationRule(childField.validation?.required) && childField.visible() && childField.mode() === "edit" && currentCtrl?.status !== "DISABLED") {
|
|
6294
6315
|
return currentCtrl?.valid;
|
|
6295
6316
|
}
|
|
6296
6317
|
return true;
|
|
@@ -6316,8 +6337,15 @@ class FormEngine {
|
|
|
6316
6337
|
}
|
|
6317
6338
|
return registration;
|
|
6318
6339
|
}
|
|
6340
|
+
// Builds each switched-on rule into its validator, out of the value the rule was given:
|
|
6341
|
+
// `{ "minLength": 3 }` is what makes the validator refuse two characters, and `{ "required":
|
|
6342
|
+
// false }` builds nothing at all. The field rides along as the second argument for the rules
|
|
6343
|
+
// that need their neighbours — `beforeDate` and friends — and is ignored by the rest.
|
|
6344
|
+
// A rule whose factory never resolved is skipped rather than called.
|
|
6319
6345
|
#validatorsToNgValidators(field) {
|
|
6320
|
-
return
|
|
6346
|
+
return Object.entries(field.validation ?? {})
|
|
6347
|
+
.filter(([key, value]) => isActiveValidationRule(value) && typeof field.validationFns?.[key] === "function")
|
|
6348
|
+
.map(([key, value]) => field.validationFns[key](value, field));
|
|
6321
6349
|
}
|
|
6322
6350
|
#mapNgValidators(validationObj) {
|
|
6323
6351
|
return Object.entries((validationObj ? validationObj : {}))
|
|
@@ -6383,22 +6411,22 @@ const COMPONENTS = {
|
|
|
6383
6411
|
datetime: () => Promise.resolve().then(function () { return datetimePicker_field; }).then((c) => c.DatetimePickerField),
|
|
6384
6412
|
date_range: () => Promise.resolve().then(function () { return dateRangePicker_field; }).then((c) => c.DateRangePickerField),
|
|
6385
6413
|
attachment: () => Promise.resolve().then(function () { return filePicker_field; }).then((c) => c.FilePickerField),
|
|
6386
|
-
userPicker: () => import('./iss-ctrl-user-picker.field-
|
|
6414
|
+
userPicker: () => import('./iss-ctrl-user-picker.field-BhjVNeqN.mjs').then((c) => c.UserPickerField),
|
|
6387
6415
|
vehicle_plate: () => Promise.resolve().then(function () { return plate_field; }).then((c) => c.PlateField),
|
|
6388
|
-
enrichment: () => import('./iss-ctrl-note.field-
|
|
6416
|
+
enrichment: () => import('./iss-ctrl-note.field-CbLlparb.mjs').then((c) => c.NoteField),
|
|
6389
6417
|
mobile: () => Promise.resolve().then(function () { return mobile_field; }).then((c) => c.MobileField),
|
|
6390
|
-
table: () => import('./iss-ctrl-table.field-
|
|
6418
|
+
table: () => import('./iss-ctrl-table.field-CvqXIE4q.mjs').then((c) => c.TableField),
|
|
6391
6419
|
chips: () => Promise.resolve().then(function () { return chips_field; }).then((c) => c.ChipsField),
|
|
6392
6420
|
switch: () => Promise.resolve().then(function () { return slideToggle_field; }).then((c) => c.SlideToggleField),
|
|
6393
6421
|
};
|
|
6394
6422
|
|
|
6395
6423
|
const SERVICES = {
|
|
6396
|
-
setValue: () => import('./iss-ctrl-set-value-event-
|
|
6424
|
+
setValue: () => import('./iss-ctrl-set-value-event-vKIrSRgu.mjs').then((s) => s.SetValueEvent),
|
|
6397
6425
|
show: () => import('./iss-ctrl-show-event-BcRCwAfo.mjs').then((s) => s.ShowEvent),
|
|
6398
|
-
load: () => import('./iss-ctrl-load-value-event-
|
|
6399
|
-
loadOptions: () => import('./iss-ctrl-load-options-event-
|
|
6400
|
-
triggerBasedOnJsonValue: () => import('./iss-ctrl-trigger-based-on-json-value-
|
|
6401
|
-
replaceApiKeyDefaultImpl: () => import('./iss-ctrl-replace-api-keys-
|
|
6426
|
+
load: () => import('./iss-ctrl-load-value-event-DmX9Pkzf.mjs').then((s) => s.LoadValueEvent),
|
|
6427
|
+
loadOptions: () => import('./iss-ctrl-load-options-event-CmXkuQ5O.mjs').then((s) => s.LoadOptionsEvent),
|
|
6428
|
+
triggerBasedOnJsonValue: () => import('./iss-ctrl-trigger-based-on-json-value-wyn6AXWA.mjs').then((s) => s.TriggerBasedOnJsonValue),
|
|
6429
|
+
replaceApiKeyDefaultImpl: () => import('./iss-ctrl-replace-api-keys-C_mYQdtP.mjs').then((s) => s.ReplaceApiKeys),
|
|
6402
6430
|
};
|
|
6403
6431
|
|
|
6404
6432
|
// Read-only counterpart of COMPONENTS: the component used to render a field's value
|
|
@@ -6585,6 +6613,11 @@ class Outlet {
|
|
|
6585
6613
|
action.config.fn = configFn;
|
|
6586
6614
|
}));
|
|
6587
6615
|
}
|
|
6616
|
+
// Resolves the validator behind every rule the field switched on. `validation` itself is left
|
|
6617
|
+
// exactly as it arrived — the caller's own object, which it may still read and re-render — so
|
|
6618
|
+
// the factories land in `validationFns` and the rules keep the values they were given.
|
|
6619
|
+
// A rule that is off carries no validator: nothing is imported for it and nothing is built
|
|
6620
|
+
// from it, which is what makes `{ "required": false }` an optional field.
|
|
6588
6621
|
async #loadFieldValidation(f) {
|
|
6589
6622
|
if (!f.validation)
|
|
6590
6623
|
return;
|
|
@@ -6593,13 +6626,10 @@ class Outlet {
|
|
|
6593
6626
|
console.error(`${key} not found`);
|
|
6594
6627
|
return false;
|
|
6595
6628
|
}
|
|
6596
|
-
return validation
|
|
6629
|
+
return isActiveValidationRule(validation);
|
|
6597
6630
|
});
|
|
6598
|
-
await Promise.all(validationEntries.map(async ([key
|
|
6599
|
-
f.
|
|
6600
|
-
fn: await VALIDATORS[key](),
|
|
6601
|
-
value: validation
|
|
6602
|
-
};
|
|
6631
|
+
await Promise.all(validationEntries.map(async ([key]) => {
|
|
6632
|
+
f.validationFns[key] = await VALIDATORS[key]();
|
|
6603
6633
|
}));
|
|
6604
6634
|
}
|
|
6605
6635
|
#listenToHostFormGroupChanges() {
|
|
@@ -6621,7 +6651,7 @@ class Outlet {
|
|
|
6621
6651
|
/>
|
|
6622
6652
|
}
|
|
6623
6653
|
}
|
|
6624
|
-
`, isInline: true, styles: [":host{display:flex;flex-direction:column;gap:
|
|
6654
|
+
`, isInline: true, styles: [":host{display:flex;flex-direction:column;gap:2rem}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "pipe", type: FieldDataInjector, name: "FieldDataInjector" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6625
6655
|
}
|
|
6626
6656
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: Outlet, decorators: [{
|
|
6627
6657
|
type: Component,
|
|
@@ -6639,7 +6669,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
6639
6669
|
/>
|
|
6640
6670
|
}
|
|
6641
6671
|
}
|
|
6642
|
-
`, styles: [":host{display:flex;flex-direction:column;gap:
|
|
6672
|
+
`, styles: [":host{display:flex;flex-direction:column;gap:2rem}\n"] }]
|
|
6643
6673
|
}], propDecorators: { ready: [{ type: i0.Output, args: ["ready"] }], fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: true }] }] } });
|
|
6644
6674
|
|
|
6645
6675
|
const VIEW_PROVIDER = {
|
|
@@ -6793,33 +6823,33 @@ class ValidationMessageComponent {
|
|
|
6793
6823
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ValidationMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6794
6824
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: ValidationMessageComponent, isStandalone: true, selector: "iss-validation-message-viewer", inputs: { errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: true, transformFunction: null }, showMessage: { classPropertyName: "showMessage", publicName: "showMessage", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
6795
6825
|
@if (errors() !== null && showMessage()) {
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
<
|
|
6799
|
-
|
|
6800
|
-
|
|
6826
|
+
<div class="messages">
|
|
6827
|
+
@for (error of errors() ?? {} | keyvalue; track error) {
|
|
6828
|
+
<p>
|
|
6829
|
+
<mat-error>{{ getValidationMessage(error) | translate }}</mat-error>
|
|
6830
|
+
</p>
|
|
6831
|
+
}
|
|
6832
|
+
</div>
|
|
6801
6833
|
}
|
|
6802
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "pipe", type: KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
6834
|
+
`, isInline: true, styles: [":host{display:block;position:relative}.messages{position:absolute;inset-inline:0;top:0;z-index:1}p{margin:0}\n"], dependencies: [{ kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "pipe", type: KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
6803
6835
|
}
|
|
6804
6836
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ValidationMessageComponent, decorators: [{
|
|
6805
6837
|
type: Component,
|
|
6806
|
-
args: [{
|
|
6807
|
-
selector: "iss-validation-message-viewer",
|
|
6808
|
-
imports: [
|
|
6838
|
+
args: [{ selector: "iss-validation-message-viewer", imports: [
|
|
6809
6839
|
KeyValuePipe,
|
|
6810
6840
|
TranslatePipe,
|
|
6811
6841
|
MatError
|
|
6812
|
-
],
|
|
6813
|
-
template: `
|
|
6842
|
+
], template: `
|
|
6814
6843
|
@if (errors() !== null && showMessage()) {
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
<
|
|
6818
|
-
|
|
6819
|
-
|
|
6844
|
+
<div class="messages">
|
|
6845
|
+
@for (error of errors() ?? {} | keyvalue; track error) {
|
|
6846
|
+
<p>
|
|
6847
|
+
<mat-error>{{ getValidationMessage(error) | translate }}</mat-error>
|
|
6848
|
+
</p>
|
|
6849
|
+
}
|
|
6850
|
+
</div>
|
|
6820
6851
|
}
|
|
6821
|
-
`,
|
|
6822
|
-
}]
|
|
6852
|
+
`, styles: [":host{display:block;position:relative}.messages{position:absolute;inset-inline:0;top:0;z-index:1}p{margin:0}\n"] }]
|
|
6823
6853
|
}], propDecorators: { errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: true }] }], showMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMessage", required: true }] }] } });
|
|
6824
6854
|
|
|
6825
6855
|
class EventTrigger {
|
|
@@ -8562,10 +8592,10 @@ class FilePickerField extends FieldBase {
|
|
|
8562
8592
|
super.ngOnDestroy();
|
|
8563
8593
|
this.#valueEffect.destroy();
|
|
8564
8594
|
}
|
|
8565
|
-
//
|
|
8595
|
+
// The accepted extensions are the `fileType` rule's own value, the same one its validator is
|
|
8596
|
+
// built from — a list, or the comma-separated string an older definition wrote it as.
|
|
8566
8597
|
#acceptFactory() {
|
|
8567
|
-
const
|
|
8568
|
-
const extensions = fileType && fileType.hasOwnProperty("fn") ? fileType.value : fileType;
|
|
8598
|
+
const extensions = this.field.validation?.["fileType"];
|
|
8569
8599
|
if (!extensions) {
|
|
8570
8600
|
return "";
|
|
8571
8601
|
}
|
|
@@ -9402,11 +9432,13 @@ var file_validator = /*#__PURE__*/Object.freeze({
|
|
|
9402
9432
|
});
|
|
9403
9433
|
|
|
9404
9434
|
class TimeValidator {
|
|
9405
|
-
|
|
9435
|
+
// The rule's value is the name of the field this one must not run past, so it arrives here
|
|
9436
|
+
// rather than being read back off the field.
|
|
9437
|
+
static beforeDate(otherFieldName) {
|
|
9406
9438
|
const controlContainer = inject(ControlContainer);
|
|
9407
9439
|
const parentForm = controlContainer.control;
|
|
9408
9440
|
return (control) => {
|
|
9409
|
-
const anotherControl = parentForm.get(
|
|
9441
|
+
const anotherControl = parentForm.get(otherFieldName);
|
|
9410
9442
|
if (anotherControl) {
|
|
9411
9443
|
const anotherControlValue = anotherControl.getRawValue();
|
|
9412
9444
|
const controlValue = control.getRawValue();
|
|
@@ -9419,7 +9451,7 @@ class TimeValidator {
|
|
|
9419
9451
|
return null;
|
|
9420
9452
|
};
|
|
9421
9453
|
}
|
|
9422
|
-
static afterDate(
|
|
9454
|
+
static afterDate(otherFieldName) {
|
|
9423
9455
|
return (control) => {
|
|
9424
9456
|
return null;
|
|
9425
9457
|
};
|
|
@@ -9437,5 +9469,5 @@ var time_validator = /*#__PURE__*/Object.freeze({
|
|
|
9437
9469
|
* Generated bundle index. Do not edit.
|
|
9438
9470
|
*/
|
|
9439
9471
|
|
|
9440
|
-
export { PlateViewer as $, TimePickerField as A, DatePickerField as B, ControlBase as C, DatePickerControl as D, Employee as E, FieldBase as F, DatetimePickerField as G, HOST as H, IssField as I, DateRangePickerField as J, InputViewer as K, Loader as L, MobileControl as M, TextareaViewer as N, Outlet as O, PLACEHOLDER_REGEX as P, ChipsViewer as Q, RadioControl as R, SelectControl as S, TextareaControl as T, RadioViewer as U, VIEW_PROVIDER as V, SelectViewer as W, MobileViewer as X, CheckboxViewer as Y, ToggleButtonViewer as Z, SlideToggleViewer as _, ValidationMessageComponent as a, AttachmentViewer as a0, TimePickerViewer as a1, DatePickerViewer as a2, DatePickerTimeViewer as a3, DateRangePickerViewer as a4, DEFAULT_COUNTRY as a5, COUNTRIES as a6, DATE_FORMAT_ADAPTER as a7, DATETIME_FORMAT as a8, PLATE_LETTERS as a9,
|
|
9441
|
-
//# sourceMappingURL=iss-ctrl-iss-ctrl-
|
|
9472
|
+
export { PlateViewer as $, TimePickerField as A, DatePickerField as B, ControlBase as C, DatePickerControl as D, Employee as E, FieldBase as F, DatetimePickerField as G, HOST as H, IssField as I, DateRangePickerField as J, InputViewer as K, Loader as L, MobileControl as M, TextareaViewer as N, Outlet as O, PLACEHOLDER_REGEX as P, ChipsViewer as Q, RadioControl as R, SelectControl as S, TextareaControl as T, RadioViewer as U, VIEW_PROVIDER as V, SelectViewer as W, MobileViewer as X, CheckboxViewer as Y, ToggleButtonViewer as Z, SlideToggleViewer as _, ValidationMessageComponent as a, AttachmentViewer as a0, TimePickerViewer as a1, DatePickerViewer as a2, DatePickerTimeViewer as a3, DateRangePickerViewer as a4, DEFAULT_COUNTRY as a5, COUNTRIES as a6, DATE_FORMAT_ADAPTER as a7, DATETIME_FORMAT as a8, PLATE_LETTERS as a9, getHijriParts as aA, startOfHijriMonth as aB, getHijriDaysInMonth as aC, createHijriDate as aD, formatHijriDate as aE, parseHijriDate as aF, toHijriDisplay as aG, IssValidators as aH, FileValidators as aI, TimeValidator as aJ, VALIDATION_MESSAGES as aa, COMPONENTS as ab, SERVICES as ac, VALIDATORS as ad, isActiveValidationRule as ae, FIELD_DATA as af, UI_LANGUAGE as ag, ATTACHMENT_UPLOAD_URL as ah, ATTACHMENT_UPLOAD_RESPONSE_MAPPER as ai, ATTACHMENT_DOWNLOAD_URL as aj, USER_SEARCH_API as ak, HintsComponent as al, Droppable as am, ArabicNumberPipe as an, FieldDataInjector as ao, PlateLetterPipe as ap, SelectStatusPipe as aq, TranslatePipe as ar, FileHandler as as, IssDateAdapter as at, provideIssDateAdapter as au, Phone as av, arrayFrom as aw, formatFileSize as ax, HIJRI_LOCALE as ay, HIJRI_MONTH_NAMES as az, ViewerBase as b, FormEngine as c, CheckboxControl as d, ChipsControl as e, DateRangePickerControl as f, getPropertyByPath as g, DatetimePickerControl as h, FilePickerControl as i, InputControl as j, PlateControl as k, SlideToggleControl as l, TimePickerControl as m, ToggleButtonControl as n, InputField as o, TextareaField as p, ChipsField as q, replacePlaceholders as r, RadioField as s, SelectField as t, MobileField as u, CheckboxField as v, ToggleButtonField as w, SlideToggleField as x, PlateField as y, FilePickerField as z };
|
|
9473
|
+
//# sourceMappingURL=iss-ctrl-iss-ctrl-Cy9p_PEj.mjs.map
|