@quadrel-enterprise-ui/framework 21.4.4 → 21.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quadrel-enterprise-ui/framework",
3
- "version": "21.4.4",
3
+ "version": "21.5.0",
4
4
  "exports": {
5
5
  "./jest-preset": "./jest-preset.js",
6
6
  "./package.json": {
@@ -111,10 +111,15 @@
111
111
  "i18n.qd.form.error.maxLength": "Zu hohe Anzahl von Zeichen",
112
112
  "i18n.qd.form.error.pattern": "Entspricht nicht dem Muster",
113
113
  "i18n.qd.form.error.date": "Eingabe entspricht nicht DD.MM.JJJJ",
114
+ "i18n.qd.form.error.dateTime": "Eingabe entspricht nicht DD.MM.JJJJ HH:mm",
115
+ "i18n.qd.form.error.dateTimeWithSeconds": "Eingabe entspricht nicht DD.MM.JJJJ HH:mm:ss",
114
116
  "i18n.qd.form.error.disabledDates": "Datum ausserhalb des erlaubten Bereichs",
115
117
  "i18n.qd.form.error.dateRange": "Das Datum liegt ausserhalb des gültigen Bereichs.",
118
+ "i18n.qd.form.error.dateTimeRange": "Der Zeitpunkt liegt ausserhalb des gültigen Bereichs.",
116
119
  "i18n.qd.form.error.startDateNotAfterEndDate": "Das Startdatum darf nicht hinter dem Enddatum liegen.",
117
120
  "i18n.qd.form.error.endDateNotBeforeStartDate": "Das Enddatum darf nicht vor dem Startdatum liegen.",
121
+ "i18n.qd.form.error.startDateTimeNotAfterEndDateTime": "Der Startzeitpunkt darf nicht hinter dem Endzeitpunkt liegen.",
122
+ "i18n.qd.form.error.endDateTimeNotBeforeStartDateTime": "Der Endzeitpunkt darf nicht vor dem Startzeitpunkt liegen.",
118
123
  "i18n.qd.form.error.disabledTimes": "Zeit ausserhalb des erlaubten Bereichs",
119
124
  "i18n.qd.form.error.startTimeNotAfterEndTime": "Die Startzeit darf nicht hinter der Endzeit liegen.",
120
125
  "i18n.qd.form.error.endTimeNotBeforeStartTime": "Die Endzeit darf nicht vor der Startzeit liegen.",
@@ -111,10 +111,15 @@
111
111
  "i18n.qd.form.error.maxLength": "Too many characters",
112
112
  "i18n.qd.form.error.pattern": "Does not match pattern",
113
113
  "i18n.qd.form.error.date": "Input does not correspond to DD.MM.YYYY",
114
+ "i18n.qd.form.error.dateTime": "Input does not correspond to DD.MM.YYYY HH:mm",
115
+ "i18n.qd.form.error.dateTimeWithSeconds": "Input does not correspond to DD.MM.YYYY HH:mm:ss",
114
116
  "i18n.qd.form.error.disabledDates": "Date outside the permitted range",
115
117
  "i18n.qd.form.error.dateRange": "The date is outside the valid range.",
118
+ "i18n.qd.form.error.dateTimeRange": "The date and time is outside the valid range.",
116
119
  "i18n.qd.form.error.startDateNotAfterEndDate": "The start date cannot be later than the end date.",
117
120
  "i18n.qd.form.error.endDateNotBeforeStartDate": "The end date cannot be earlier than the start date.",
121
+ "i18n.qd.form.error.startDateTimeNotAfterEndDateTime": "The start date and time cannot be later than the end date and time.",
122
+ "i18n.qd.form.error.endDateTimeNotBeforeStartDateTime": "The end date and time cannot be earlier than the start date and time.",
118
123
  "i18n.qd.form.error.disabledTimes": "Time outside the permitted range",
119
124
  "i18n.qd.form.error.startTimeNotAfterEndTime": "The start time cannot be later than the end time.",
120
125
  "i18n.qd.form.error.endTimeNotBeforeStartTime": "The end time cannot be earlier than the start time.",
@@ -111,10 +111,15 @@
111
111
  "i18n.qd.form.error.maxLength": "Trop de caractères",
112
112
  "i18n.qd.form.error.pattern": "Ne correspond pas au schéma",
113
113
  "i18n.qd.form.error.date": "La saisie ne correspond pas à JJ.MM.AAAA",
114
+ "i18n.qd.form.error.dateTime": "La saisie ne correspond pas à JJ.MM.AAAA HH:mm",
115
+ "i18n.qd.form.error.dateTimeWithSeconds": "La saisie ne correspond pas à JJ.MM.AAAA HH:mm:ss",
114
116
  "i18n.qd.form.error.disabledDates": "Date en dehors de la plage autorisée",
115
117
  "i18n.qd.form.error.dateRange": "La date est en dehors de la plage valide.",
118
+ "i18n.qd.form.error.dateTimeRange": "La date et l'heure sont en dehors de la plage valide.",
116
119
  "i18n.qd.form.error.startDateNotAfterEndDate": "La date de début ne peut pas être postérieure à la date de fin.",
117
120
  "i18n.qd.form.error.endDateNotBeforeStartDate": "La date de fin ne peut pas être antérieure à la date de début.",
121
+ "i18n.qd.form.error.startDateTimeNotAfterEndDateTime": "La date et l'heure de début ne peuvent pas être postérieures à la date et l'heure de fin.",
122
+ "i18n.qd.form.error.endDateTimeNotBeforeStartDateTime": "La date et l'heure de fin ne peuvent pas être antérieures à la date et l'heure de début.",
118
123
  "i18n.qd.form.error.disabledTimes": "Temps en dehors de la plage autorisée",
119
124
  "i18n.qd.form.error.startTimeNotAfterEndTime": "Le temps de début ne peut pas être postérieur au temps de fin.",
120
125
  "i18n.qd.form.error.endTimeNotBeforeStartTime": "Le temps de fin ne peut pas être antérieur au temps de début.",
@@ -111,10 +111,15 @@
111
111
  "i18n.qd.form.error.maxLength": "Limite caratteri superato",
112
112
  "i18n.qd.form.error.pattern": "Non corrisponde allo schema",
113
113
  "i18n.qd.form.error.date": "L'input non corrisponde a GG.MM.AAAA",
114
+ "i18n.qd.form.error.dateTime": "L'input non corrisponde a GG.MM.AAAA HH:mm",
115
+ "i18n.qd.form.error.dateTimeWithSeconds": "L'input non corrisponde a GG.MM.AAAA HH:mm:ss",
114
116
  "i18n.qd.form.error.disabledDates": "Data fuori dall'intervallo consentito",
115
117
  "i18n.qd.form.error.dateRange": "La data è al di fuori dell'intervallo valido.",
118
+ "i18n.qd.form.error.dateTimeRange": "La data e l'ora sono al di fuori dell'intervallo valido.",
116
119
  "i18n.qd.form.error.startDateNotAfterEndDate": "La data di inizio non può essere successiva alla data di fine.",
117
120
  "i18n.qd.form.error.endDateNotBeforeStartDate": "La data di fine non può essere anteriore alla data di inizio.",
121
+ "i18n.qd.form.error.startDateTimeNotAfterEndDateTime": "La data e l'ora di inizio non possono essere successive alla data e all'ora di fine.",
122
+ "i18n.qd.form.error.endDateTimeNotBeforeStartDateTime": "La data e l'ora di fine non possono essere anteriori alla data e all'ora di inizio.",
118
123
  "i18n.qd.form.error.disabledTimes": "Tempo fuori dall'intervallo consentito",
119
124
  "i18n.qd.form.error.startTimeNotAfterEndTime": "L'orario di inizio non può essere successivo all'orario di fine.",
120
125
  "i18n.qd.form.error.endTimeNotBeforeStartTime": "L'orario di fine non può essere precedente all'orario di inizio.",
@@ -6402,8 +6402,10 @@ declare class QdDatepickerComponent implements ControlValueAccessor, OnInit, OnC
6402
6402
  timePicker?: QdFormTimepickerConfiguration;
6403
6403
  private _disabledDatesValidator;
6404
6404
  private _disabledTimesValidator;
6405
+ private _dateTimeValidator;
6405
6406
  private _boundDisabledDates;
6406
6407
  private _boundDisabledTimes;
6408
+ private _boundDateTimeValidation;
6407
6409
  private _subs;
6408
6410
  private _onChange;
6409
6411
  private _onTouched;
@@ -6431,6 +6433,18 @@ declare class QdDatepickerComponent implements ControlValueAccessor, OnInit, OnC
6431
6433
  private updateDisplayedDateTime;
6432
6434
  private rebindDisabledDatesValidatorIfChanged;
6433
6435
  private rebindDisabledTimesValidatorIfChanged;
6436
+ private rebindDateTimeValidatorIfChanged;
6437
+ /**
6438
+ * Identifies the date-time error message the current config asks for. `undefined` means the
6439
+ * picker is date-only and the plain `date` message applies.
6440
+ */
6441
+ private get dateTimeValidationSignature();
6442
+ /**
6443
+ * Makes the invalid-input message name the date *and time* format the input expects. The
6444
+ * validator reports under the same `date` error key as `QdValidators.date()`, so it replaces
6445
+ * the date-only message instead of adding a second one.
6446
+ */
6447
+ private validateDateTime;
6434
6448
  private validateDisabledDates;
6435
6449
  private validateDisabledTimes;
6436
6450
  private isValidDateInput;
@@ -8453,6 +8467,30 @@ declare class QdValidators {
8453
8467
  * ```
8454
8468
  */
8455
8469
  static date(errorKey?: string): ValidatorFn;
8470
+ /**
8471
+ * Validates that the value is a real, parseable `Date` object and names the **date and time**
8472
+ * format in the error message.
8473
+ *
8474
+ * Behaves exactly like {@link QdValidators.date}, but the message points at the format a
8475
+ * date-time input expects (`DD.MM.YYYY HH:mm`, or `DD.MM.YYYY HH:mm:ss` when seconds are
8476
+ * enabled) instead of the date-only one. The error is reported under the same `date` key as
8477
+ * {@link QdValidators.date}, so adding it to a control that already carries `date()` replaces
8478
+ * that message rather than showing a second one.
8479
+ *
8480
+ * `qd-datepicker` adds this validator on its own whenever a `timePicker` is configured — reach
8481
+ * for it directly only when validating a date-time value outside of the component.
8482
+ *
8483
+ * @param enableSeconds - Whether the input accepts seconds; mirrors the datepicker config of the same name.
8484
+ * @param errorKey - Translation key returned when the value is not a valid date.
8485
+ *
8486
+ * #### **Usage**
8487
+ * ```ts
8488
+ * new QdFormControl(null, QdValidators.dateTime());
8489
+ * new QdFormControl(new Date(), QdValidators.dateTime(true));
8490
+ * new QdFormControl(new Date(), QdValidators.dateTime(false, 'date-time-error'));
8491
+ * ```
8492
+ */
8493
+ static dateTime(enableSeconds?: boolean, errorKey?: string): ValidatorFn;
8456
8494
  /**
8457
8495
  * Validates that a date does not fall inside any of the given disabled ranges.
8458
8496
  *
@@ -8506,6 +8544,44 @@ declare class QdValidators {
8506
8544
  * ```
8507
8545
  */
8508
8546
  static dateRange(partnerControlName: string, position: 'start' | 'end', errorKey?: string): ValidatorFn;
8547
+ /**
8548
+ * Validates that a date **and time** stays on the correct side of a sibling "range partner"
8549
+ * control.
8550
+ *
8551
+ * The date-time counterpart of {@link QdValidators.dateRange}: identical wiring, but the
8552
+ * comparison includes the time of day instead of stopping at the day. Use it for a from/to
8553
+ * pair of datepickers that have a `timePicker` configured — `dateRange` accepts `10:00` to
8554
+ * `08:00` on the same day, this one rejects it.
8555
+ *
8556
+ * Put it on both ends of the pair, each pointing at the other. A `'start'` control is invalid
8557
+ * when its value lies after the partner; an `'end'` control is invalid when its value lies
8558
+ * before the partner. Equal instants are valid, so a zero-length range passes. The comparison
8559
+ * is exact, which fits both picker precisions on its own: without seconds the entered values
8560
+ * carry `:00` seconds, with `enableSeconds` they carry the entered ones.
8561
+ *
8562
+ * Everything else behaves like {@link QdValidators.dateRange}: the partner value is read live
8563
+ * on every run, empty or invalid own/partner values and a missing partner control all pass,
8564
+ * and `qdRevalidates` keeps both ends in sync inside a `QdFormGroup` — see there for the cases
8565
+ * that still need a manual `updateValueAndValidity`.
8566
+ *
8567
+ * @param partnerControlName - Name of the sibling control holding the other end of the range.
8568
+ * @param position - `'start'` for the from-control, `'end'` for the to-control.
8569
+ * @param errorKey - Translation key returned when the order is violated.
8570
+ *
8571
+ * #### **Usage**
8572
+ * ```ts
8573
+ * new QdFormGroup({
8574
+ * from: new QdFormControl(null, QdValidators.dateTimeRange('to', 'start')),
8575
+ * to: new QdFormControl(null, QdValidators.dateTimeRange('from', 'end'))
8576
+ * });
8577
+ * ```
8578
+ */
8579
+ static dateTimeRange(partnerControlName: string, position: 'start' | 'end', errorKey?: string): ValidatorFn;
8580
+ /**
8581
+ * Compares a control against its range partner. Without a `granularity` the comparison is
8582
+ * exact, which is what a date *and time* range needs; `'day'` ignores the time of day.
8583
+ */
8584
+ private static isRangeOrderViolated;
8509
8585
  private static isValidDate;
8510
8586
  /**
8511
8587
  * Validates that the time of a date value does not fall inside any disabled time range.