iss-ctrl 0.0.13 → 0.0.15
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-BN9rcLt2.mjs → iss-ctrl-iss-ctrl-BpcynMId.mjs} +733 -169
- package/fesm2022/iss-ctrl-iss-ctrl-BpcynMId.mjs.map +1 -0
- package/fesm2022/{iss-ctrl-load-event-AgBohfHa.mjs → iss-ctrl-load-event-r4xUfn0F.mjs} +3 -3
- package/fesm2022/{iss-ctrl-load-event-AgBohfHa.mjs.map → iss-ctrl-load-event-r4xUfn0F.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-load-options-event-ClQPHNBO.mjs → iss-ctrl-load-options-event-BCHN0tAM.mjs} +3 -3
- package/fesm2022/{iss-ctrl-load-options-event-CBejHpME.mjs.map → iss-ctrl-load-options-event-BCHN0tAM.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-load-value-event-CDAKsE_O.mjs → iss-ctrl-load-value-event-CilsqNpU.mjs} +3 -3
- package/fesm2022/{iss-ctrl-load-value-event-CDAKsE_O.mjs.map → iss-ctrl-load-value-event-CilsqNpU.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-note.field-C9cVaAz0.mjs → iss-ctrl-note.field-C5zBFWV-.mjs} +2 -2
- package/fesm2022/{iss-ctrl-note.field-C9cVaAz0.mjs.map → iss-ctrl-note.field-C5zBFWV-.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-replace-api-keys-Chwe42Nu.mjs → iss-ctrl-replace-api-keys-uUZLoWuP.mjs} +2 -2
- package/fesm2022/{iss-ctrl-replace-api-keys-CLP4wBYu.mjs.map → iss-ctrl-replace-api-keys-uUZLoWuP.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-set-value-event-CrpzRR6X.mjs → iss-ctrl-set-value-event-DHF2LsSf.mjs} +2 -2
- package/fesm2022/{iss-ctrl-set-value-event-C7YYwHZV.mjs.map → iss-ctrl-set-value-event-DHF2LsSf.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-table.field-BP-HMKO3.mjs → iss-ctrl-table.field-CjCWmdqf.mjs} +2 -2
- package/fesm2022/{iss-ctrl-table.field-BP-HMKO3.mjs.map → iss-ctrl-table.field-CjCWmdqf.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-trigger-based-on-json-value-DS4TR38v.mjs → iss-ctrl-trigger-based-on-json-value-BwxH6MLn.mjs} +2 -2
- package/fesm2022/{iss-ctrl-trigger-based-on-json-value-CprcFCWi.mjs.map → iss-ctrl-trigger-based-on-json-value-BwxH6MLn.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-user-picker.field-8Jb1325c.mjs → iss-ctrl-user-picker.field-Bc_yX1v9.mjs} +2 -2
- package/fesm2022/{iss-ctrl-user-picker.field-8Jb1325c.mjs.map → iss-ctrl-user-picker.field-Bc_yX1v9.mjs.map} +1 -1
- package/fesm2022/iss-ctrl.mjs +1 -1
- package/package.json +1 -1
- package/types/iss-ctrl.d.ts +213 -12
- package/upgrade.scss +8 -17
- package/fesm2022/iss-ctrl-iss-ctrl-BN9rcLt2.mjs.map +0 -1
- package/fesm2022/iss-ctrl-iss-ctrl-DOmgkxUv.mjs +0 -8924
- package/fesm2022/iss-ctrl-iss-ctrl-DOmgkxUv.mjs.map +0 -1
- package/fesm2022/iss-ctrl-iss-ctrl-WfIqBEcL.mjs +0 -8913
- package/fesm2022/iss-ctrl-iss-ctrl-WfIqBEcL.mjs.map +0 -1
- package/fesm2022/iss-ctrl-load-event-D70VZuyD.mjs +0 -60
- package/fesm2022/iss-ctrl-load-event-D70VZuyD.mjs.map +0 -1
- package/fesm2022/iss-ctrl-load-event-SlQmVmyf.mjs +0 -60
- package/fesm2022/iss-ctrl-load-event-SlQmVmyf.mjs.map +0 -1
- package/fesm2022/iss-ctrl-load-options-event-CBejHpME.mjs +0 -50
- package/fesm2022/iss-ctrl-load-options-event-ClQPHNBO.mjs.map +0 -1
- package/fesm2022/iss-ctrl-load-options-event-DHmaMAOb.mjs +0 -50
- package/fesm2022/iss-ctrl-load-options-event-DHmaMAOb.mjs.map +0 -1
- package/fesm2022/iss-ctrl-load-value-event-Bu9-rZ6T.mjs +0 -52
- package/fesm2022/iss-ctrl-load-value-event-Bu9-rZ6T.mjs.map +0 -1
- package/fesm2022/iss-ctrl-load-value-event-Cpuy1og1.mjs +0 -52
- package/fesm2022/iss-ctrl-load-value-event-Cpuy1og1.mjs.map +0 -1
- package/fesm2022/iss-ctrl-note.field-IM4x1O3b.mjs +0 -65
- package/fesm2022/iss-ctrl-note.field-IM4x1O3b.mjs.map +0 -1
- package/fesm2022/iss-ctrl-note.field-onDjqI_X.mjs +0 -65
- package/fesm2022/iss-ctrl-note.field-onDjqI_X.mjs.map +0 -1
- package/fesm2022/iss-ctrl-replace-api-keys-CLP4wBYu.mjs +0 -57
- package/fesm2022/iss-ctrl-replace-api-keys-Chwe42Nu.mjs.map +0 -1
- package/fesm2022/iss-ctrl-replace-api-keys-CvhCKvNB.mjs +0 -57
- package/fesm2022/iss-ctrl-replace-api-keys-CvhCKvNB.mjs.map +0 -1
- package/fesm2022/iss-ctrl-set-value-event-C7YYwHZV.mjs +0 -61
- package/fesm2022/iss-ctrl-set-value-event-CrpzRR6X.mjs.map +0 -1
- package/fesm2022/iss-ctrl-set-value-event-DiHESiPT.mjs +0 -61
- package/fesm2022/iss-ctrl-set-value-event-DiHESiPT.mjs.map +0 -1
- package/fesm2022/iss-ctrl-table.field-CDSVakji.mjs +0 -592
- package/fesm2022/iss-ctrl-table.field-CDSVakji.mjs.map +0 -1
- package/fesm2022/iss-ctrl-table.field-DxwfNXNc.mjs +0 -592
- package/fesm2022/iss-ctrl-table.field-DxwfNXNc.mjs.map +0 -1
- package/fesm2022/iss-ctrl-trigger-based-on-json-value-CprcFCWi.mjs +0 -24
- package/fesm2022/iss-ctrl-trigger-based-on-json-value-DS4TR38v.mjs.map +0 -1
- package/fesm2022/iss-ctrl-trigger-based-on-json-value-Dp0EhVLA.mjs +0 -24
- package/fesm2022/iss-ctrl-trigger-based-on-json-value-Dp0EhVLA.mjs.map +0 -1
- package/fesm2022/iss-ctrl-user-picker.field-Mqi37i7D.mjs +0 -225
- package/fesm2022/iss-ctrl-user-picker.field-Mqi37i7D.mjs.map +0 -1
- package/fesm2022/iss-ctrl-user-picker.field-PxT_dZ_O.mjs +0 -225
- package/fesm2022/iss-ctrl-user-picker.field-PxT_dZ_O.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe, input, signal, output, Component, CUSTOM_ELEMENTS_SCHEMA,
|
|
2
|
+
import { Pipe, input, signal, output, Component, CUSTOM_ELEMENTS_SCHEMA, InjectionToken, inject, Injectable, effect, HostListener, Directive, computed, ChangeDetectionStrategy, ElementRef, contentChild, isSignal, Injector, DestroyRef } from '@angular/core';
|
|
3
3
|
import * as i1$2 from '@angular/forms';
|
|
4
4
|
import { FormControl, ReactiveFormsModule, NG_VALUE_ACCESSOR, NG_VALIDATORS, FormGroup, FormsModule, Validators, ControlContainer } from '@angular/forms';
|
|
5
5
|
import * as i1 from '@angular/material/checkbox';
|
|
@@ -10,14 +10,12 @@ import { MatFormField, MatFormFieldModule, MatHint, MatPrefix, MatError, MatLabe
|
|
|
10
10
|
import * as i1$1 from '@angular/material/input';
|
|
11
11
|
import { MatInput, MatInputModule, MatLabel as MatLabel$1 } from '@angular/material/input';
|
|
12
12
|
import { DatePipe, NgOptimizedImage, NgClass, NgStyle, NgTemplateOutlet, NgComponentOutlet, AsyncPipe, KeyValuePipe } from '@angular/common';
|
|
13
|
-
import {
|
|
14
|
-
import { MAT_DATE_LOCALE, provideNativeDateAdapter } from '@angular/material/core';
|
|
13
|
+
import { NativeDateAdapter, MAT_DATE_LOCALE, DateAdapter, MAT_DATE_FORMATS, provideNativeDateAdapter } from '@angular/material/core';
|
|
15
14
|
import * as i2 from '@angular/material/datepicker';
|
|
16
15
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
17
16
|
import * as i3 from '@angular/material/icon';
|
|
18
17
|
import { MatIconModule, MatIcon } from '@angular/material/icon';
|
|
19
18
|
import { format } from 'date-fns';
|
|
20
|
-
import { enGB } from 'date-fns/locale';
|
|
21
19
|
import { Subscription, BehaviorSubject, merge, of, map, from, tap, debounceTime, first, forkJoin, EMPTY, catchError } from 'rxjs';
|
|
22
20
|
import * as i2$1 from '@angular/material/timepicker';
|
|
23
21
|
import { MatTimepickerModule } from '@angular/material/timepicker';
|
|
@@ -81,9 +79,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
81
79
|
*
|
|
82
80
|
* ### Content projection
|
|
83
81
|
* Controls that render a `mat-form-field` project `<label>` into the floating label.
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* removed at runtime, so a label that arrives later simply shows up.
|
|
82
|
+
* `upgrade.scss` reveals that space only while the projected `<label>` carries text, so an
|
|
83
|
+
* omitted label — or one that interpolates to an empty string — collapses it. No label markup
|
|
84
|
+
* is removed at runtime, so a label that arrives later simply shows up.
|
|
87
85
|
*
|
|
88
86
|
* @example
|
|
89
87
|
* ```html
|
|
@@ -403,8 +401,10 @@ class ChipsControl extends ControlBase {
|
|
|
403
401
|
{ provide: NG_VALUE_ACCESSOR, useExisting: ChipsControl, multi: true }
|
|
404
402
|
], usesInheritance: true, ngImport: i0, template: `
|
|
405
403
|
<mat-form-field floatLabel="auto" class="">
|
|
406
|
-
<!--
|
|
407
|
-
<mat-label class="fs-16 fc-black"
|
|
404
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
405
|
+
<mat-label class="fs-16 fc-black">
|
|
406
|
+
<ng-content select="label"></ng-content>
|
|
407
|
+
</mat-label>
|
|
408
408
|
<input
|
|
409
409
|
matInput
|
|
410
410
|
[placeholder]="placeholder()"
|
|
@@ -446,8 +446,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
446
446
|
],
|
|
447
447
|
template: `
|
|
448
448
|
<mat-form-field floatLabel="auto" class="">
|
|
449
|
-
<!--
|
|
450
|
-
<mat-label class="fs-16 fc-black"
|
|
449
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
450
|
+
<mat-label class="fs-16 fc-black">
|
|
451
|
+
<ng-content select="label"></ng-content>
|
|
452
|
+
</mat-label>
|
|
451
453
|
<input
|
|
452
454
|
matInput
|
|
453
455
|
[placeholder]="placeholder()"
|
|
@@ -479,7 +481,7 @@ const DATE_FORMAT_ADAPTER = {
|
|
|
479
481
|
display: {
|
|
480
482
|
dateInput: "dd/MM/yyyy",
|
|
481
483
|
monthYearLabel: "MMMM yyyy",
|
|
482
|
-
dateA11yLabel: "dd/MM/
|
|
484
|
+
dateA11yLabel: "dd/MM/yyyy",
|
|
483
485
|
monthYearA11yLabel: "MMMM yyyy",
|
|
484
486
|
timeInput: "hh:mm aa",
|
|
485
487
|
timeOptionLabel: "hh:mm aa",
|
|
@@ -487,6 +489,343 @@ const DATE_FORMAT_ADAPTER = {
|
|
|
487
489
|
};
|
|
488
490
|
const DATETIME_FORMAT = "dd/MM/yyyy hh:mm a";
|
|
489
491
|
|
|
492
|
+
const UI_LANGUAGE = new InjectionToken("UI SELECTED LANGUAGE");
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Umm al-Qura Hijri calendar helpers.
|
|
496
|
+
*
|
|
497
|
+
* Every function here works on a plain `Date`: a `Date` is an instant, and the Hijri
|
|
498
|
+
* calendar is only another way of naming that instant. Nothing stores Hijri numbers on the
|
|
499
|
+
* date itself, so a value converted to Hijri for display or emission is still the same day.
|
|
500
|
+
*
|
|
501
|
+
* The conversion is done by `Intl` with the `islamic-umalqura` calendar, which is the
|
|
502
|
+
* calendar used officially in Saudi Arabia.
|
|
503
|
+
*/
|
|
504
|
+
/** Locale used by the calendar UI when the Hijri calendar is on. */
|
|
505
|
+
const HIJRI_LOCALE = "ar-SA-u-ca-islamic-umalqura";
|
|
506
|
+
/** Latin-digit locale used internally to read the Hijri parts of a date. */
|
|
507
|
+
const HIJRI_PARTS_LOCALE = "en-US-u-ca-islamic-umalqura";
|
|
508
|
+
const MS_PER_DAY = 86_400_000;
|
|
509
|
+
/** 1 Muharram 1445 AH, the anchor the month estimate starts from. */
|
|
510
|
+
const ANCHOR_GREGORIAN = { year: 2023, month: 6, day: 19 };
|
|
511
|
+
const ANCHOR_HIJRI_YEAR = 1445;
|
|
512
|
+
/** Mean length of a Hijri month, used only to get close before the exact walk. */
|
|
513
|
+
const MEAN_HIJRI_MONTH = 29.530588;
|
|
514
|
+
const HIJRI_MONTH_NAMES = {
|
|
515
|
+
ar: ["محرم", "صفر", "ربيع الأول", "ربيع الآخر", "جمادى الأولى", "جمادى الآخرة", "رجب", "شعبان", "رمضان", "شوال", "ذو القعدة", "ذو الحجة"],
|
|
516
|
+
en: ["Muharram", "Safar", "Rabi' al-Awwal", "Rabi' al-Thani", "Jumada al-Ula", "Jumada al-Akhirah", "Rajab", "Sha'ban", "Ramadan", "Shawwal", "Dhu al-Qi'dah", "Dhu al-Hijjah"],
|
|
517
|
+
enShort: ["Muh", "Saf", "Rab I", "Rab II", "Jum I", "Jum II", "Raj", "Sha", "Ram", "Shaw", "Dhul-Q", "Dhul-H"],
|
|
518
|
+
};
|
|
519
|
+
const partsFormatter = new Intl.DateTimeFormat(HIJRI_PARTS_LOCALE, {
|
|
520
|
+
day: "numeric",
|
|
521
|
+
month: "numeric",
|
|
522
|
+
year: "numeric",
|
|
523
|
+
});
|
|
524
|
+
/**
|
|
525
|
+
* Reads the Hijri year, month and day a `Date` falls on.
|
|
526
|
+
*/
|
|
527
|
+
function getHijriParts(date) {
|
|
528
|
+
const parts = partsFormatter.formatToParts(date);
|
|
529
|
+
const read = (type) => parseInt(parts.find((part) => part.type === type)?.value ?? "0", 10);
|
|
530
|
+
return { year: read("year"), month: read("month") - 1, day: read("day") };
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* The Gregorian `Date` of the first day of the Hijri month `date` falls in, at midday.
|
|
534
|
+
*
|
|
535
|
+
* Midday, not midnight, so a daylight-saving shift can never push the result into the
|
|
536
|
+
* previous day while the month is being walked.
|
|
537
|
+
*/
|
|
538
|
+
function startOfHijriMonth(date) {
|
|
539
|
+
const start = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 12);
|
|
540
|
+
start.setDate(start.getDate() - (getHijriParts(start).day - 1));
|
|
541
|
+
return start;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Number of days in the Hijri month `date` falls in — 29 or 30, decided by Umm al-Qura.
|
|
545
|
+
*/
|
|
546
|
+
function getHijriDaysInMonth(date) {
|
|
547
|
+
const start = startOfHijriMonth(date);
|
|
548
|
+
// +30 days from the first of a 29 or 30 day month always lands inside the next one
|
|
549
|
+
const insideNextMonth = new Date(start.getTime());
|
|
550
|
+
insideNextMonth.setDate(insideNextMonth.getDate() + 30);
|
|
551
|
+
return Math.round((startOfHijriMonth(insideNextMonth).getTime() - start.getTime()) / MS_PER_DAY);
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Builds the `Date` for a Hijri year/month/day. The month is zero based, and a day past the
|
|
555
|
+
* end of the month is clamped to the last day of that month.
|
|
556
|
+
*/
|
|
557
|
+
function createHijriDate(year, month, day) {
|
|
558
|
+
const targetYear = year + Math.floor(month / 12);
|
|
559
|
+
const targetMonth = ((month % 12) + 12) % 12;
|
|
560
|
+
const monthsFromAnchor = (targetYear - ANCHOR_HIJRI_YEAR) * 12 + targetMonth;
|
|
561
|
+
const cursor = new Date(ANCHOR_GREGORIAN.year, ANCHOR_GREGORIAN.month, ANCHOR_GREGORIAN.day, 12);
|
|
562
|
+
cursor.setDate(cursor.getDate() + Math.round(monthsFromAnchor * MEAN_HIJRI_MONTH));
|
|
563
|
+
let start = startOfHijriMonth(cursor);
|
|
564
|
+
// the mean-month estimate drifts by a month or so over long spans; step whole months until it matches
|
|
565
|
+
for (let attempt = 0; attempt < 8; attempt++) {
|
|
566
|
+
const parts = getHijriParts(start);
|
|
567
|
+
const monthsOff = (targetYear - parts.year) * 12 + (targetMonth - parts.month);
|
|
568
|
+
if (monthsOff === 0) {
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
// 29 days plus a nudge in the direction of travel always lands inside the neighbouring month
|
|
572
|
+
start.setDate(start.getDate() + monthsOff * 29 + Math.sign(monthsOff));
|
|
573
|
+
start = startOfHijriMonth(start);
|
|
574
|
+
}
|
|
575
|
+
const clampedDay = Math.min(Math.max(day, 1), getHijriDaysInMonth(start));
|
|
576
|
+
start.setDate(start.getDate() + clampedDay - 1);
|
|
577
|
+
start.setHours(0, 0, 0, 0);
|
|
578
|
+
return start;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Formats a date as a Hijri `yyyy-MM-dd` string — the shape the form emits when
|
|
582
|
+
* `emitHijri` is on.
|
|
583
|
+
*/
|
|
584
|
+
function formatHijriDate(date) {
|
|
585
|
+
const parts = getHijriParts(date);
|
|
586
|
+
return `${pad(parts.year, 4)}-${pad(parts.month + 1, 2)}-${pad(parts.day, 2)}`;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Reads a Hijri date back into a `Date`, accepting both the emitted `yyyy-MM-dd` shape and
|
|
590
|
+
* the `dd/MM/yyyy` shape shown in the input. Returns `null` for anything else.
|
|
591
|
+
*/
|
|
592
|
+
function parseHijriDate(value) {
|
|
593
|
+
if (!value) {
|
|
594
|
+
return null;
|
|
595
|
+
}
|
|
596
|
+
// strip the bidi marks Intl adds around Arabic-locale dates
|
|
597
|
+
const clean = value.replace(/[]/g, "").trim();
|
|
598
|
+
const iso = clean.match(/^(\d{3,4})-(\d{1,2})-(\d{1,2})/);
|
|
599
|
+
if (iso) {
|
|
600
|
+
return createHijriDate(+iso[1], +iso[2] - 1, +iso[3]);
|
|
601
|
+
}
|
|
602
|
+
const slashed = clean.match(/^(\d{1,2})[/-](\d{1,2})[/-](\d{3,4})$/);
|
|
603
|
+
if (slashed) {
|
|
604
|
+
return createHijriDate(+slashed[3], +slashed[2] - 1, +slashed[1]);
|
|
605
|
+
}
|
|
606
|
+
return null;
|
|
607
|
+
}
|
|
608
|
+
function pad(value, length) {
|
|
609
|
+
return String(value).padStart(length, "0");
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Renders a stored form value as a Hijri `dd/MM/yyyy` string for the read-only viewers, or
|
|
613
|
+
* returns `null` when the field is not on the Hijri calendar and the value should be shown
|
|
614
|
+
* as an ordinary Gregorian date.
|
|
615
|
+
*
|
|
616
|
+
* The two Hijri modes store different things, so they are read differently: with `emitHijri`
|
|
617
|
+
* the value already carries Hijri numbers and only its notation changes, while with
|
|
618
|
+
* `hijriCalendar` alone the value is Gregorian and has to be converted.
|
|
619
|
+
*/
|
|
620
|
+
function toHijriDisplay(value, options) {
|
|
621
|
+
if (!value || (!options.hijriCalendar && !options.emitHijri)) {
|
|
622
|
+
return null;
|
|
623
|
+
}
|
|
624
|
+
let datePart;
|
|
625
|
+
let hours;
|
|
626
|
+
let minutes;
|
|
627
|
+
if (options.emitHijri) {
|
|
628
|
+
const matched = value.match(/^(\d{3,4})-(\d{1,2})-(\d{1,2})(?:[T ](\d{1,2}):(\d{2}))?/);
|
|
629
|
+
if (!matched) {
|
|
630
|
+
return null;
|
|
631
|
+
}
|
|
632
|
+
datePart = `${pad(+matched[3], 2)}/${pad(+matched[2], 2)}/${pad(+matched[1], 4)}`;
|
|
633
|
+
hours = +(matched[4] ?? 0);
|
|
634
|
+
minutes = +(matched[5] ?? 0);
|
|
635
|
+
}
|
|
636
|
+
else {
|
|
637
|
+
const date = new Date(value);
|
|
638
|
+
if (Number.isNaN(date.getTime())) {
|
|
639
|
+
return null;
|
|
640
|
+
}
|
|
641
|
+
const parts = getHijriParts(date);
|
|
642
|
+
datePart = `${pad(parts.day, 2)}/${pad(parts.month + 1, 2)}/${pad(parts.year, 4)}`;
|
|
643
|
+
hours = date.getHours();
|
|
644
|
+
minutes = date.getMinutes();
|
|
645
|
+
}
|
|
646
|
+
if (!options.withTime) {
|
|
647
|
+
return datePart;
|
|
648
|
+
}
|
|
649
|
+
return `${datePart} ${pad(hours % 12 || 12, 2)}:${pad(minutes, 2)} ${hours < 12 ? "AM" : "PM"}`;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* The single date adapter behind every `iss-ctrl-*` picker.
|
|
654
|
+
*
|
|
655
|
+
* It behaves as a plain Gregorian adapter — `dd/MM/yyyy` in and out — until its locale is
|
|
656
|
+
* switched to {@link HIJRI_LOCALE}, at which point the whole calendar grid becomes Umm
|
|
657
|
+
* al-Qura Hijri: the month lengths, the year and month labels and the day numbers all come
|
|
658
|
+
* from the Hijri calendar.
|
|
659
|
+
*
|
|
660
|
+
* The value never changes shape. The adapter always works on a `Date`, so a Hijri calendar
|
|
661
|
+
* still hands the control an ordinary `Date`, and it stays the control's decision whether to
|
|
662
|
+
* emit that as a Gregorian or a Hijri string.
|
|
663
|
+
*
|
|
664
|
+
* Switch modes through {@link setHijri}, never by assigning `locale` — `setLocale` is what
|
|
665
|
+
* tells an open calendar to re-render.
|
|
666
|
+
*/
|
|
667
|
+
class IssDateAdapter extends NativeDateAdapter {
|
|
668
|
+
/** The Gregorian locale to fall back to when the Hijri calendar is turned off. */
|
|
669
|
+
gregorianLocale = "en-GB";
|
|
670
|
+
#language = inject(UI_LANGUAGE, { optional: true });
|
|
671
|
+
/** Whether the adapter is currently presenting the Hijri calendar. */
|
|
672
|
+
get isHijri() {
|
|
673
|
+
return typeof this.locale === "string" && this.locale.includes("islamic");
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Turns the Hijri calendar on or off. Goes through `setLocale` so that a calendar that is
|
|
677
|
+
* already open redraws itself.
|
|
678
|
+
*/
|
|
679
|
+
setHijri(hijri) {
|
|
680
|
+
const locale = hijri ? HIJRI_LOCALE : this.gregorianLocale;
|
|
681
|
+
if (this.locale !== locale) {
|
|
682
|
+
this.setLocale(locale);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
getYear(date) {
|
|
686
|
+
return this.isHijri ? getHijriParts(date).year : date.getFullYear();
|
|
687
|
+
}
|
|
688
|
+
getMonth(date) {
|
|
689
|
+
return this.isHijri ? getHijriParts(date).month : date.getMonth();
|
|
690
|
+
}
|
|
691
|
+
getDate(date) {
|
|
692
|
+
return this.isHijri ? getHijriParts(date).day : date.getDate();
|
|
693
|
+
}
|
|
694
|
+
getMonthNames(style) {
|
|
695
|
+
if (!this.isHijri) {
|
|
696
|
+
return super.getMonthNames(style);
|
|
697
|
+
}
|
|
698
|
+
if (this.#language === "en") {
|
|
699
|
+
return style === "long" ? HIJRI_MONTH_NAMES.en : HIJRI_MONTH_NAMES.enShort;
|
|
700
|
+
}
|
|
701
|
+
return HIJRI_MONTH_NAMES.ar;
|
|
702
|
+
}
|
|
703
|
+
getDateNames() {
|
|
704
|
+
// a Hijri month never runs past 30 days, but the calendar body indexes this array by
|
|
705
|
+
// day number, so it must stay as long as the Gregorian one
|
|
706
|
+
return this.isHijri ? Array.from({ length: 31 }, (_, index) => String(index + 1)) : super.getDateNames();
|
|
707
|
+
}
|
|
708
|
+
getDayOfWeekNames(style) {
|
|
709
|
+
if (!this.isHijri) {
|
|
710
|
+
return super.getDayOfWeekNames(style);
|
|
711
|
+
}
|
|
712
|
+
// the week is the same week in both calendars, so only the language of the names changes
|
|
713
|
+
const names = new Intl.DateTimeFormat(this.#language === "en" ? "en-GB" : "ar", { weekday: style, timeZone: "utc" });
|
|
714
|
+
return Array.from({ length: 7 }, (_, index) => names.format(new Date(Date.UTC(2017, 0, index + 1))));
|
|
715
|
+
}
|
|
716
|
+
getYearName(date) {
|
|
717
|
+
return this.isHijri ? String(getHijriParts(date).year) : String(date.getFullYear());
|
|
718
|
+
}
|
|
719
|
+
getFirstDayOfWeek() {
|
|
720
|
+
return this.isHijri ? 0 : super.getFirstDayOfWeek();
|
|
721
|
+
}
|
|
722
|
+
getNumDaysInMonth(date) {
|
|
723
|
+
return this.isHijri ? getHijriDaysInMonth(date) : super.getNumDaysInMonth(date);
|
|
724
|
+
}
|
|
725
|
+
createDate(year, month, date) {
|
|
726
|
+
return this.isHijri ? createHijriDate(year, month, date) : super.createDate(year, month, date);
|
|
727
|
+
}
|
|
728
|
+
addCalendarYears(date, years) {
|
|
729
|
+
return this.addCalendarMonths(date, years * 12);
|
|
730
|
+
}
|
|
731
|
+
addCalendarMonths(date, months) {
|
|
732
|
+
if (!this.isHijri) {
|
|
733
|
+
return super.addCalendarMonths(date, months);
|
|
734
|
+
}
|
|
735
|
+
const parts = getHijriParts(date);
|
|
736
|
+
return this.#withTimeOf(createHijriDate(parts.year, parts.month + months, parts.day), date);
|
|
737
|
+
}
|
|
738
|
+
addCalendarDays(date, days) {
|
|
739
|
+
if (!this.isHijri) {
|
|
740
|
+
return super.addCalendarDays(date, days);
|
|
741
|
+
}
|
|
742
|
+
// a Hijri day is the same day, so this is plain Gregorian day arithmetic
|
|
743
|
+
const shifted = new Date(date.getTime());
|
|
744
|
+
shifted.setDate(shifted.getDate() + days);
|
|
745
|
+
return shifted;
|
|
746
|
+
}
|
|
747
|
+
parse(value, parseFormat) {
|
|
748
|
+
if (typeof value !== "string") {
|
|
749
|
+
return super.parse(value, parseFormat);
|
|
750
|
+
}
|
|
751
|
+
const clean = value.replace(/[]/g, "").trim();
|
|
752
|
+
if (!clean) {
|
|
753
|
+
return null;
|
|
754
|
+
}
|
|
755
|
+
if (this.isHijri) {
|
|
756
|
+
return parseHijriDate(clean) ?? this.invalid();
|
|
757
|
+
}
|
|
758
|
+
const slashed = clean.match(/^(\d{1,2})[/-](\d{1,2})[/-](\d{4})$/);
|
|
759
|
+
if (slashed) {
|
|
760
|
+
return new Date(+slashed[3], +slashed[2] - 1, +slashed[1]);
|
|
761
|
+
}
|
|
762
|
+
return super.parse(clean, parseFormat);
|
|
763
|
+
}
|
|
764
|
+
format(date, displayFormat) {
|
|
765
|
+
if (!this.isValid(date)) {
|
|
766
|
+
throw Error("IssDateAdapter: Cannot format invalid date.");
|
|
767
|
+
}
|
|
768
|
+
const year = this.getYear(date);
|
|
769
|
+
const month = this.getMonth(date);
|
|
770
|
+
const day = this.getDate(date);
|
|
771
|
+
// NativeDateAdapter formats through Intl in UTC, which shifts the day for anyone west of
|
|
772
|
+
// Greenwich; formatting the parts we already read keeps the rendered day the picked one.
|
|
773
|
+
// One pass, so a substituted month name can never be re-read as a token.
|
|
774
|
+
return (displayFormat ?? "dd/MM/yyyy").replace(/yyyy|MMMM|MMM|MM|dd/g, (token) => {
|
|
775
|
+
switch (token) {
|
|
776
|
+
case "yyyy":
|
|
777
|
+
return String(year).padStart(4, "0");
|
|
778
|
+
case "MMMM":
|
|
779
|
+
return this.getMonthNames("long")[month];
|
|
780
|
+
case "MMM":
|
|
781
|
+
return this.getMonthNames("short")[month];
|
|
782
|
+
case "MM":
|
|
783
|
+
return String(month + 1).padStart(2, "0");
|
|
784
|
+
default:
|
|
785
|
+
return String(day).padStart(2, "0");
|
|
786
|
+
}
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
deserialize(value) {
|
|
790
|
+
// `yyyy-MM-dd` is a calendar day, not an instant: NativeDateAdapter reads it as UTC
|
|
791
|
+
// midnight, which renders as the previous day in any negative-offset zone
|
|
792
|
+
if (typeof value === "string") {
|
|
793
|
+
const iso = value.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
|
794
|
+
if (iso) {
|
|
795
|
+
return new Date(+iso[1], +iso[2] - 1, +iso[3]);
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
return super.deserialize(value);
|
|
799
|
+
}
|
|
800
|
+
toIso8601(date) {
|
|
801
|
+
return [String(date.getFullYear()).padStart(4, "0"), String(date.getMonth() + 1).padStart(2, "0"), String(date.getDate()).padStart(2, "0")].join("-");
|
|
802
|
+
}
|
|
803
|
+
#withTimeOf(date, source) {
|
|
804
|
+
const result = new Date(date.getTime());
|
|
805
|
+
result.setHours(source.getHours(), source.getMinutes(), source.getSeconds(), source.getMilliseconds());
|
|
806
|
+
return result;
|
|
807
|
+
}
|
|
808
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IssDateAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
809
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IssDateAdapter });
|
|
810
|
+
}
|
|
811
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IssDateAdapter, decorators: [{
|
|
812
|
+
type: Injectable
|
|
813
|
+
}] });
|
|
814
|
+
/**
|
|
815
|
+
* Providers every date-based control needs: the {@link IssDateAdapter} itself, the Gregorian
|
|
816
|
+
* locale it falls back to, and the `dd/MM/yyyy` formats both of its calendars are rendered in.
|
|
817
|
+
*
|
|
818
|
+
* Declared per component, so each picker owns its adapter instance and one field switching to
|
|
819
|
+
* the Hijri calendar leaves every other field on the form alone.
|
|
820
|
+
*/
|
|
821
|
+
function provideIssDateAdapter() {
|
|
822
|
+
return [
|
|
823
|
+
{ provide: MAT_DATE_LOCALE, useValue: "en-GB" },
|
|
824
|
+
{ provide: DateAdapter, useClass: IssDateAdapter },
|
|
825
|
+
{ provide: MAT_DATE_FORMATS, useValue: DATE_FORMAT_ADAPTER },
|
|
826
|
+
];
|
|
827
|
+
}
|
|
828
|
+
|
|
490
829
|
/**
|
|
491
830
|
* `<iss-ctrl-date-picker>` — single date selection through a Material calendar.
|
|
492
831
|
*
|
|
@@ -506,6 +845,14 @@ const DATETIME_FORMAT = "dd/MM/yyyy hh:mm a";
|
|
|
506
845
|
* | `minDate` | `Date \| null` | `null` | Earliest selectable date. |
|
|
507
846
|
* | `maxDate` | `Date \| null` | `null` | Latest selectable date. |
|
|
508
847
|
* | `disabledDays` | `number[]` | `[]` | Week days to block, `0` = Sunday … `6` = Saturday. |
|
|
848
|
+
* | `hijriCalendar` | `boolean` | `false` | Shows an Umm al-Qura Hijri calendar; the value stays Gregorian. |
|
|
849
|
+
* | `emitHijri` | `boolean` | `false` | Emits the Hijri date instead of the Gregorian one. Implies `hijriCalendar`. |
|
|
850
|
+
*
|
|
851
|
+
* ### Hijri dates
|
|
852
|
+
* `hijriCalendar` only changes what the user sees: the calendar is Hijri, the input reads
|
|
853
|
+
* `dd/MM/yyyy` in Hijri, and a day shown as `16/03/1447` is still emitted as `2025-09-08`.
|
|
854
|
+
* Turn on `emitHijri` as well when the form value itself has to be the Hijri date. `minDate` and
|
|
855
|
+
* `maxDate` stay Gregorian in both cases — they are bounds on a day, not on a notation.
|
|
509
856
|
*
|
|
510
857
|
* ### Inherited from {@link ControlBase}
|
|
511
858
|
* `formControlName` · `readonly` · `className` · `(onChange)`
|
|
@@ -525,6 +872,33 @@ class DatePickerControl extends ControlBase {
|
|
|
525
872
|
* Latest selectable date.
|
|
526
873
|
*/
|
|
527
874
|
maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
875
|
+
/**
|
|
876
|
+
* Renders the calendar as an Umm al-Qura Hijri calendar, leaving the emitted value Gregorian.
|
|
877
|
+
*/
|
|
878
|
+
hijriCalendar = input(false, ...(ngDevMode ? [{ debugName: "hijriCalendar" }] : /* istanbul ignore next */ []));
|
|
879
|
+
/**
|
|
880
|
+
* Emits the picked date as a Hijri `yyyy-MM-dd` string. Implies {@link hijriCalendar}.
|
|
881
|
+
*/
|
|
882
|
+
emitHijri = input(false, ...(ngDevMode ? [{ debugName: "emitHijri" }] : /* istanbul ignore next */ []));
|
|
883
|
+
#dateAdapter = inject(DateAdapter);
|
|
884
|
+
// the adapter is provided by this component, so switching it here leaves every other
|
|
885
|
+
// picker on the form on its own calendar
|
|
886
|
+
#hijriEffectRef = effect(() => this.#dateAdapter.setHijri(this.isHijri()), ...(ngDevMode ? [{ debugName: "#hijriEffectRef" }] : /* istanbul ignore next */ []));
|
|
887
|
+
/**
|
|
888
|
+
* Whether this picker is currently showing the Hijri calendar.
|
|
889
|
+
*/
|
|
890
|
+
isHijri() {
|
|
891
|
+
return this.hijriCalendar() || this.emitHijri();
|
|
892
|
+
}
|
|
893
|
+
writeValue(value) {
|
|
894
|
+
// a Hijri value read back from the form is `1447-03-15`, which is not the day
|
|
895
|
+
// `new Date("1447-03-15")` would give the calendar
|
|
896
|
+
if (this.emitHijri() && typeof value === "string") {
|
|
897
|
+
super.writeValue(parseHijriDate(value));
|
|
898
|
+
return;
|
|
899
|
+
}
|
|
900
|
+
super.writeValue(value);
|
|
901
|
+
}
|
|
528
902
|
clear(event) {
|
|
529
903
|
if (this.readonly()) {
|
|
530
904
|
return;
|
|
@@ -543,7 +917,7 @@ class DatePickerControl extends ControlBase {
|
|
|
543
917
|
return;
|
|
544
918
|
}
|
|
545
919
|
this.markAsTouched();
|
|
546
|
-
const selectedDateString = format($event.value, "yyyy-MM-dd");
|
|
920
|
+
const selectedDateString = this.emitHijri() ? formatHijriDate($event.value) : format($event.value, "yyyy-MM-dd");
|
|
547
921
|
this.propagateValue(selectedDateString);
|
|
548
922
|
this.emitOnChangeEvent(selectedDateString);
|
|
549
923
|
}
|
|
@@ -555,16 +929,17 @@ class DatePickerControl extends ControlBase {
|
|
|
555
929
|
this.markAsTouched();
|
|
556
930
|
}
|
|
557
931
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatePickerControl, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
558
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DatePickerControl, isStandalone: true, selector: "iss-ctrl-date-picker", inputs: { disabledDays: { classPropertyName: "disabledDays", publicName: "disabledDays", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
932
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DatePickerControl, isStandalone: true, selector: "iss-ctrl-date-picker", inputs: { disabledDays: { classPropertyName: "disabledDays", publicName: "disabledDays", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, hijriCalendar: { classPropertyName: "hijriCalendar", publicName: "hijriCalendar", isSignal: true, isRequired: false, transformFunction: null }, emitHijri: { classPropertyName: "emitHijri", publicName: "emitHijri", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
559
933
|
DatePipe,
|
|
560
|
-
|
|
561
|
-
{ provide: MAT_DATE_LOCALE, useValue: enGB },
|
|
934
|
+
provideIssDateAdapter(),
|
|
562
935
|
{ provide: NG_VALUE_ACCESSOR, useExisting: DatePickerControl, multi: true },
|
|
563
936
|
{ provide: NG_VALIDATORS, useExisting: DatePickerControl, multi: true },
|
|
564
937
|
], usesInheritance: true, ngImport: i0, template: `
|
|
565
938
|
<mat-form-field floatLabel="auto" class="">
|
|
566
|
-
<!--
|
|
567
|
-
<mat-label class="fs-16 fc-black"
|
|
939
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
940
|
+
<mat-label class="fs-16 fc-black">
|
|
941
|
+
<ng-content select="label"></ng-content>
|
|
942
|
+
</mat-label>
|
|
568
943
|
<input
|
|
569
944
|
class="cursor-pointer"
|
|
570
945
|
matInput
|
|
@@ -582,7 +957,7 @@ class DatePickerControl extends ControlBase {
|
|
|
582
957
|
<mat-icon matSuffix style="cursor: pointer" (click)="clear($event)">close</mat-icon>
|
|
583
958
|
}
|
|
584
959
|
<mat-datepicker-toggle matIconSuffix [for]="picker" [disabled]="readonly()"></mat-datepicker-toggle>
|
|
585
|
-
<mat-datepicker #picker></mat-datepicker>
|
|
960
|
+
<mat-datepicker #picker [panelClass]="isHijri() ? 'iss-hijri-calendar' : ''"></mat-datepicker>
|
|
586
961
|
|
|
587
962
|
</mat-form-field>
|
|
588
963
|
`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
|
|
@@ -591,14 +966,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
591
966
|
type: Component,
|
|
592
967
|
args: [{ selector: "iss-ctrl-date-picker", imports: [MatFormFieldModule, MatInputModule, MatDatepickerModule, MatIconModule, ReactiveFormsModule], providers: [
|
|
593
968
|
DatePipe,
|
|
594
|
-
|
|
595
|
-
{ provide: MAT_DATE_LOCALE, useValue: enGB },
|
|
969
|
+
provideIssDateAdapter(),
|
|
596
970
|
{ provide: NG_VALUE_ACCESSOR, useExisting: DatePickerControl, multi: true },
|
|
597
971
|
{ provide: NG_VALIDATORS, useExisting: DatePickerControl, multi: true },
|
|
598
972
|
], template: `
|
|
599
973
|
<mat-form-field floatLabel="auto" class="">
|
|
600
|
-
<!--
|
|
601
|
-
<mat-label class="fs-16 fc-black"
|
|
974
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
975
|
+
<mat-label class="fs-16 fc-black">
|
|
976
|
+
<ng-content select="label"></ng-content>
|
|
977
|
+
</mat-label>
|
|
602
978
|
<input
|
|
603
979
|
class="cursor-pointer"
|
|
604
980
|
matInput
|
|
@@ -616,11 +992,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
616
992
|
<mat-icon matSuffix style="cursor: pointer" (click)="clear($event)">close</mat-icon>
|
|
617
993
|
}
|
|
618
994
|
<mat-datepicker-toggle matIconSuffix [for]="picker" [disabled]="readonly()"></mat-datepicker-toggle>
|
|
619
|
-
<mat-datepicker #picker></mat-datepicker>
|
|
995
|
+
<mat-datepicker #picker [panelClass]="isHijri() ? 'iss-hijri-calendar' : ''"></mat-datepicker>
|
|
620
996
|
|
|
621
997
|
</mat-form-field>
|
|
622
998
|
` }]
|
|
623
|
-
}], propDecorators: { disabledDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDays", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }] } });
|
|
999
|
+
}], propDecorators: { disabledDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDays", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], hijriCalendar: [{ type: i0.Input, args: [{ isSignal: true, alias: "hijriCalendar", required: false }] }], emitHijri: [{ type: i0.Input, args: [{ isSignal: true, alias: "emitHijri", required: false }] }] } });
|
|
624
1000
|
|
|
625
1001
|
/**
|
|
626
1002
|
* `<iss-ctrl-date-range-picker>` — a start/end date range in one field.
|
|
@@ -642,6 +1018,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
642
1018
|
* | `minDate` | `Date \| null` | `null` | Earliest selectable date. |
|
|
643
1019
|
* | `maxDate` | `Date \| null` | `null` | Latest selectable date. |
|
|
644
1020
|
* | `disabledDays` | `number[]` | `[]` | Week days to block, `0` = Sunday … `6` = Saturday. |
|
|
1021
|
+
* | `hijriCalendar` | `boolean` | `false` | Shows an Umm al-Qura Hijri calendar; the value stays Gregorian. |
|
|
1022
|
+
* | `emitHijri` | `boolean` | `false` | Emits both endpoints as Hijri dates. Implies `hijriCalendar`. |
|
|
1023
|
+
*
|
|
1024
|
+
* ### Hijri dates
|
|
1025
|
+
* `hijriCalendar` only changes what the user sees; the emitted range stays Gregorian until
|
|
1026
|
+
* `emitHijri` is on as well, at which point both endpoints carry Hijri dates. `duration` is
|
|
1027
|
+
* a count of days either way, and `minDate`/`maxDate` stay Gregorian.
|
|
645
1028
|
*
|
|
646
1029
|
* ### Inherited from {@link ControlBase}
|
|
647
1030
|
* `formControlName` · `readonly` · `className` · `(onChange)`
|
|
@@ -664,6 +1047,14 @@ class DateRangePickerControl extends ControlBase {
|
|
|
664
1047
|
* Latest selectable date.
|
|
665
1048
|
*/
|
|
666
1049
|
maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
1050
|
+
/**
|
|
1051
|
+
* Renders the calendar as an Umm al-Qura Hijri calendar, leaving the emitted range Gregorian.
|
|
1052
|
+
*/
|
|
1053
|
+
hijriCalendar = input(false, ...(ngDevMode ? [{ debugName: "hijriCalendar" }] : /* istanbul ignore next */ []));
|
|
1054
|
+
/**
|
|
1055
|
+
* Emits both endpoints as Hijri dates. Implies {@link hijriCalendar}.
|
|
1056
|
+
*/
|
|
1057
|
+
emitHijri = input(false, ...(ngDevMode ? [{ debugName: "emitHijri" }] : /* istanbul ignore next */ []));
|
|
667
1058
|
/**
|
|
668
1059
|
* Emits the selected range as an object, or `null` while the range is incomplete.
|
|
669
1060
|
*/
|
|
@@ -676,6 +1067,16 @@ class DateRangePickerControl extends ControlBase {
|
|
|
676
1067
|
end: new FormControl(null),
|
|
677
1068
|
});
|
|
678
1069
|
#sub = new Subscription();
|
|
1070
|
+
#dateAdapter = inject(DateAdapter);
|
|
1071
|
+
// the adapter is provided by this component, so switching it here leaves every other
|
|
1072
|
+
// picker on the form on its own calendar
|
|
1073
|
+
#hijriEffectRef = effect(() => this.#dateAdapter.setHijri(this.isHijri()), ...(ngDevMode ? [{ debugName: "#hijriEffectRef" }] : /* istanbul ignore next */ []));
|
|
1074
|
+
/**
|
|
1075
|
+
* Whether this picker is currently showing the Hijri calendar.
|
|
1076
|
+
*/
|
|
1077
|
+
isHijri() {
|
|
1078
|
+
return this.hijriCalendar() || this.emitHijri();
|
|
1079
|
+
}
|
|
679
1080
|
ngOnInit() {
|
|
680
1081
|
this.#sub.add(this.range.valueChanges.subscribe((values) => {
|
|
681
1082
|
if (this.readonly()) {
|
|
@@ -714,13 +1115,6 @@ class DateRangePickerControl extends ControlBase {
|
|
|
714
1115
|
this.propagateValue(null);
|
|
715
1116
|
this.emitOnChangeEvent(null);
|
|
716
1117
|
}
|
|
717
|
-
openPicker(picker) {
|
|
718
|
-
if (this.readonly()) {
|
|
719
|
-
return;
|
|
720
|
-
}
|
|
721
|
-
picker.open();
|
|
722
|
-
this.markAsTouched();
|
|
723
|
-
}
|
|
724
1118
|
writeValue(value) {
|
|
725
1119
|
if (typeof value !== "string" || !value) {
|
|
726
1120
|
this.ctrl.setValue(null, { emitEvent: false });
|
|
@@ -729,14 +1123,23 @@ class DateRangePickerControl extends ControlBase {
|
|
|
729
1123
|
}
|
|
730
1124
|
const valArr = value.split(",");
|
|
731
1125
|
const valObj = {
|
|
732
|
-
|
|
733
|
-
|
|
1126
|
+
// a Hijri endpoint read back from the form is `1447-03-15`, which is not the day
|
|
1127
|
+
// the adapter would deserialize it as
|
|
1128
|
+
start: this.#readEndpoint(valArr[0]),
|
|
1129
|
+
end: this.#readEndpoint(valArr[1]),
|
|
734
1130
|
};
|
|
735
1131
|
this.range.patchValue(valObj, { emitEvent: false });
|
|
736
1132
|
}
|
|
737
1133
|
ngOnDestroy() {
|
|
738
1134
|
this.#sub.unsubscribe();
|
|
739
1135
|
}
|
|
1136
|
+
openPicker(picker) {
|
|
1137
|
+
if (this.readonly()) {
|
|
1138
|
+
return;
|
|
1139
|
+
}
|
|
1140
|
+
picker.open();
|
|
1141
|
+
this.markAsTouched();
|
|
1142
|
+
}
|
|
740
1143
|
calendarDaysFilter = (d) => {
|
|
741
1144
|
const day = (d || new Date()).getDay();
|
|
742
1145
|
return !(this.disabledDays().includes(day));
|
|
@@ -746,7 +1149,16 @@ class DateRangePickerControl extends ControlBase {
|
|
|
746
1149
|
const end = new Date(endDate).getTime();
|
|
747
1150
|
return Math.ceil((end - start) / (1000 * 60 * 60 * 24) + 1);
|
|
748
1151
|
}
|
|
1152
|
+
#readEndpoint(value) {
|
|
1153
|
+
if (!value) {
|
|
1154
|
+
return null;
|
|
1155
|
+
}
|
|
1156
|
+
return this.emitHijri() ? parseHijriDate(value) : value;
|
|
1157
|
+
}
|
|
749
1158
|
#getFormatedDate(date) {
|
|
1159
|
+
if (this.emitHijri()) {
|
|
1160
|
+
return `${formatHijriDate(date)}${format(date, "'T'HH:mm:ss")}`;
|
|
1161
|
+
}
|
|
750
1162
|
return format(date, "yyyy-MM-dd'T'HH:mm:ss");
|
|
751
1163
|
}
|
|
752
1164
|
#getFormatedEndDate(endDate) {
|
|
@@ -766,15 +1178,16 @@ class DateRangePickerControl extends ControlBase {
|
|
|
766
1178
|
};
|
|
767
1179
|
}
|
|
768
1180
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DateRangePickerControl, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
769
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DateRangePickerControl, isStandalone: true, selector: "iss-ctrl-date-range-picker", inputs: { disabledDays: { classPropertyName: "disabledDays", publicName: "disabledDays", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDateRangeObjectChange: "onDateRangeObjectChange" }, providers: [
|
|
770
|
-
|
|
771
|
-
{ provide: MAT_DATE_LOCALE, useValue: enGB },
|
|
1181
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DateRangePickerControl, isStandalone: true, selector: "iss-ctrl-date-range-picker", inputs: { disabledDays: { classPropertyName: "disabledDays", publicName: "disabledDays", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, hijriCalendar: { classPropertyName: "hijriCalendar", publicName: "hijriCalendar", isSignal: true, isRequired: false, transformFunction: null }, emitHijri: { classPropertyName: "emitHijri", publicName: "emitHijri", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDateRangeObjectChange: "onDateRangeObjectChange" }, providers: [
|
|
1182
|
+
provideIssDateAdapter(),
|
|
772
1183
|
{ provide: NG_VALUE_ACCESSOR, useExisting: DateRangePickerControl, multi: true },
|
|
773
1184
|
], usesInheritance: true, ngImport: i0, template: `
|
|
774
1185
|
<mat-form-field floatLabel="auto" class="">
|
|
775
1186
|
|
|
776
|
-
<!--
|
|
777
|
-
<mat-label class="fs-16 fc-black"
|
|
1187
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
1188
|
+
<mat-label class="fs-16 fc-black">
|
|
1189
|
+
<ng-content select="label"></ng-content>
|
|
1190
|
+
</mat-label>
|
|
778
1191
|
<mat-date-range-input
|
|
779
1192
|
[formGroup]="range"
|
|
780
1193
|
[rangePicker]="picker"
|
|
@@ -801,7 +1214,7 @@ class DateRangePickerControl extends ControlBase {
|
|
|
801
1214
|
<mat-icon matSuffix style="cursor: pointer" (click)="clear($event)">close</mat-icon>
|
|
802
1215
|
}
|
|
803
1216
|
<mat-datepicker-toggle matSuffix [for]="picker" [disabled]="readonly()"></mat-datepicker-toggle>
|
|
804
|
-
<mat-date-range-picker #picker></mat-date-range-picker>
|
|
1217
|
+
<mat-date-range-picker #picker [panelClass]="isHijri() ? 'iss-hijri-calendar' : ''"></mat-date-range-picker>
|
|
805
1218
|
|
|
806
1219
|
</mat-form-field>
|
|
807
1220
|
`, isInline: true, dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i2.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i2.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i2.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i2.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
@@ -817,15 +1230,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
817
1230
|
MatIcon,
|
|
818
1231
|
],
|
|
819
1232
|
providers: [
|
|
820
|
-
|
|
821
|
-
{ provide: MAT_DATE_LOCALE, useValue: enGB },
|
|
1233
|
+
provideIssDateAdapter(),
|
|
822
1234
|
{ provide: NG_VALUE_ACCESSOR, useExisting: DateRangePickerControl, multi: true },
|
|
823
1235
|
],
|
|
824
1236
|
template: `
|
|
825
1237
|
<mat-form-field floatLabel="auto" class="">
|
|
826
1238
|
|
|
827
|
-
<!--
|
|
828
|
-
<mat-label class="fs-16 fc-black"
|
|
1239
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
1240
|
+
<mat-label class="fs-16 fc-black">
|
|
1241
|
+
<ng-content select="label"></ng-content>
|
|
1242
|
+
</mat-label>
|
|
829
1243
|
<mat-date-range-input
|
|
830
1244
|
[formGroup]="range"
|
|
831
1245
|
[rangePicker]="picker"
|
|
@@ -852,12 +1266,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
852
1266
|
<mat-icon matSuffix style="cursor: pointer" (click)="clear($event)">close</mat-icon>
|
|
853
1267
|
}
|
|
854
1268
|
<mat-datepicker-toggle matSuffix [for]="picker" [disabled]="readonly()"></mat-datepicker-toggle>
|
|
855
|
-
<mat-date-range-picker #picker></mat-date-range-picker>
|
|
1269
|
+
<mat-date-range-picker #picker [panelClass]="isHijri() ? 'iss-hijri-calendar' : ''"></mat-date-range-picker>
|
|
856
1270
|
|
|
857
1271
|
</mat-form-field>
|
|
858
1272
|
`
|
|
859
1273
|
}]
|
|
860
|
-
}], propDecorators: { disabledDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDays", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], onDateRangeObjectChange: [{ type: i0.Output, args: ["onDateRangeObjectChange"] }] } });
|
|
1274
|
+
}], propDecorators: { disabledDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDays", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], hijriCalendar: [{ type: i0.Input, args: [{ isSignal: true, alias: "hijriCalendar", required: false }] }], emitHijri: [{ type: i0.Input, args: [{ isSignal: true, alias: "emitHijri", required: false }] }], onDateRangeObjectChange: [{ type: i0.Output, args: ["onDateRangeObjectChange"] }] } });
|
|
861
1275
|
|
|
862
1276
|
/**
|
|
863
1277
|
* `<iss-ctrl-time-picker>` — time of day, picked from a list generated at a fixed interval.
|
|
@@ -942,8 +1356,10 @@ class TimePickerControl extends ControlBase {
|
|
|
942
1356
|
{ provide: NG_VALIDATORS, useExisting: TimePickerControl, multi: true },
|
|
943
1357
|
], usesInheritance: true, ngImport: i0, template: `
|
|
944
1358
|
<mat-form-field floatLabel="auto" class="">
|
|
945
|
-
<!--
|
|
946
|
-
<mat-label class="fs-16 fc-black"
|
|
1359
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
1360
|
+
<mat-label class="fs-16 fc-black">
|
|
1361
|
+
<ng-content select="label"></ng-content>
|
|
1362
|
+
</mat-label>
|
|
947
1363
|
<input
|
|
948
1364
|
matInput
|
|
949
1365
|
[formControl]="ctrl"
|
|
@@ -977,8 +1393,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
977
1393
|
],
|
|
978
1394
|
template: `
|
|
979
1395
|
<mat-form-field floatLabel="auto" class="">
|
|
980
|
-
<!--
|
|
981
|
-
<mat-label class="fs-16 fc-black"
|
|
1396
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
1397
|
+
<mat-label class="fs-16 fc-black">
|
|
1398
|
+
<ng-content select="label"></ng-content>
|
|
1399
|
+
</mat-label>
|
|
982
1400
|
<input
|
|
983
1401
|
matInput
|
|
984
1402
|
[formControl]="ctrl"
|
|
@@ -1020,6 +1438,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1020
1438
|
* | `minTime` | `string \| null` | `null` | Earliest selectable time, `HH:mm`. |
|
|
1021
1439
|
* | `maxTime` | `string \| null` | `null` | Latest selectable time, `HH:mm`. |
|
|
1022
1440
|
* | `disabledDays` | `number[]` | `[]` | Week days to block, `0` = Sunday … `6` = Saturday. |
|
|
1441
|
+
* | `hijriCalendar` | `boolean` | `false` | Shows an Umm al-Qura Hijri calendar; the value stays Gregorian. |
|
|
1442
|
+
* | `emitHijri` | `boolean` | `false` | Emits the date half as a Hijri date. Implies `hijriCalendar`. |
|
|
1443
|
+
*
|
|
1444
|
+
* ### Hijri dates
|
|
1445
|
+
* Both flags are handed straight to the inner date picker; the time half is untouched, so a
|
|
1446
|
+
* Hijri value reads `1447-03-15T09:30:00`.
|
|
1023
1447
|
*
|
|
1024
1448
|
* ### Inherited from {@link ControlBase}
|
|
1025
1449
|
* `formControlName` · `readonly` · `className` · `(onChange)`
|
|
@@ -1051,6 +1475,14 @@ class DatetimePickerControl extends ControlBase {
|
|
|
1051
1475
|
* Latest selectable time of day, as `HH:mm`.
|
|
1052
1476
|
*/
|
|
1053
1477
|
maxTime = input(null, ...(ngDevMode ? [{ debugName: "maxTime" }] : /* istanbul ignore next */ []));
|
|
1478
|
+
/**
|
|
1479
|
+
* Renders the calendar as an Umm al-Qura Hijri calendar, leaving the emitted date Gregorian.
|
|
1480
|
+
*/
|
|
1481
|
+
hijriCalendar = input(false, ...(ngDevMode ? [{ debugName: "hijriCalendar" }] : /* istanbul ignore next */ []));
|
|
1482
|
+
/**
|
|
1483
|
+
* Emits the date half of the value as a Hijri date. Implies {@link hijriCalendar}.
|
|
1484
|
+
*/
|
|
1485
|
+
emitHijri = input(false, ...(ngDevMode ? [{ debugName: "emitHijri" }] : /* istanbul ignore next */ []));
|
|
1054
1486
|
setDisabledState(isDisabled) {
|
|
1055
1487
|
super.setDisabledState(isDisabled);
|
|
1056
1488
|
// the template binds `datetimeForm`, disabling ctrl alone leaves the pickers live
|
|
@@ -1111,14 +1543,24 @@ class DatetimePickerControl extends ControlBase {
|
|
|
1111
1543
|
return undefined;
|
|
1112
1544
|
}
|
|
1113
1545
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatetimePickerControl, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1114
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: DatetimePickerControl, isStandalone: true, selector: "iss-ctrl-datetime-picker", inputs: { disabledDays: { classPropertyName: "disabledDays", publicName: "disabledDays", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, minTime: { classPropertyName: "minTime", publicName: "minTime", isSignal: true, isRequired: false, transformFunction: null }, maxTime: { classPropertyName: "maxTime", publicName: "maxTime", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1546
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: DatetimePickerControl, isStandalone: true, selector: "iss-ctrl-datetime-picker", inputs: { disabledDays: { classPropertyName: "disabledDays", publicName: "disabledDays", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, minTime: { classPropertyName: "minTime", publicName: "minTime", isSignal: true, isRequired: false, transformFunction: null }, maxTime: { classPropertyName: "maxTime", publicName: "maxTime", isSignal: true, isRequired: false, transformFunction: null }, hijriCalendar: { classPropertyName: "hijriCalendar", publicName: "hijriCalendar", isSignal: true, isRequired: false, transformFunction: null }, emitHijri: { classPropertyName: "emitHijri", publicName: "emitHijri", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1115
1547
|
{ provide: NG_VALUE_ACCESSOR, useExisting: DatetimePickerControl, multi: true },
|
|
1116
1548
|
{ provide: NG_VALIDATORS, useExisting: DatetimePickerControl, multi: true },
|
|
1117
1549
|
], usesInheritance: true, ngImport: i0, template: `
|
|
1118
1550
|
<form [formGroup]="datetimeForm" class="d-flex flex-row gap-1">
|
|
1119
|
-
<iss-ctrl-date-picker
|
|
1551
|
+
<iss-ctrl-date-picker
|
|
1552
|
+
(focusout)="markAsTouched()"
|
|
1553
|
+
[disabledDays]="disabledDays()"
|
|
1554
|
+
[maxDate]="maxDate()"
|
|
1555
|
+
[minDate]="minDate()"
|
|
1556
|
+
[readonly]="readonly()"
|
|
1557
|
+
[hijriCalendar]="hijriCalendar()"
|
|
1558
|
+
[emitHijri]="emitHijri()"
|
|
1559
|
+
formControlName="date"
|
|
1560
|
+
(onChange)="emit()"
|
|
1561
|
+
>
|
|
1120
1562
|
<!-- Re-projected with ngProjectAs so it still matches the date picker's own select="label";
|
|
1121
|
-
wrapping it in a second <label> instead would
|
|
1563
|
+
wrapping it in a second <label> instead would nest one inside the other and defeat the label rule in upgrade.scss. -->
|
|
1122
1564
|
<ng-content select="label" ngProjectAs="label"></ng-content>
|
|
1123
1565
|
</iss-ctrl-date-picker>
|
|
1124
1566
|
<iss-ctrl-time-picker
|
|
@@ -1130,7 +1572,7 @@ class DatetimePickerControl extends ControlBase {
|
|
|
1130
1572
|
(onChange)="emit()"
|
|
1131
1573
|
/>
|
|
1132
1574
|
</form>
|
|
1133
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatTimepickerModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: DatePickerControl, selector: "iss-ctrl-date-picker", inputs: ["disabledDays", "minDate", "maxDate"] }, { kind: "component", type: TimePickerControl, selector: "iss-ctrl-time-picker", inputs: ["interval", "minTime", "maxTime"] }] });
|
|
1575
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatTimepickerModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: DatePickerControl, selector: "iss-ctrl-date-picker", inputs: ["disabledDays", "minDate", "maxDate", "hijriCalendar", "emitHijri"] }, { kind: "component", type: TimePickerControl, selector: "iss-ctrl-time-picker", inputs: ["interval", "minTime", "maxTime"] }] });
|
|
1134
1576
|
}
|
|
1135
1577
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatetimePickerControl, decorators: [{
|
|
1136
1578
|
type: Component,
|
|
@@ -1151,9 +1593,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1151
1593
|
],
|
|
1152
1594
|
template: `
|
|
1153
1595
|
<form [formGroup]="datetimeForm" class="d-flex flex-row gap-1">
|
|
1154
|
-
<iss-ctrl-date-picker
|
|
1596
|
+
<iss-ctrl-date-picker
|
|
1597
|
+
(focusout)="markAsTouched()"
|
|
1598
|
+
[disabledDays]="disabledDays()"
|
|
1599
|
+
[maxDate]="maxDate()"
|
|
1600
|
+
[minDate]="minDate()"
|
|
1601
|
+
[readonly]="readonly()"
|
|
1602
|
+
[hijriCalendar]="hijriCalendar()"
|
|
1603
|
+
[emitHijri]="emitHijri()"
|
|
1604
|
+
formControlName="date"
|
|
1605
|
+
(onChange)="emit()"
|
|
1606
|
+
>
|
|
1155
1607
|
<!-- Re-projected with ngProjectAs so it still matches the date picker's own select="label";
|
|
1156
|
-
wrapping it in a second <label> instead would
|
|
1608
|
+
wrapping it in a second <label> instead would nest one inside the other and defeat the label rule in upgrade.scss. -->
|
|
1157
1609
|
<ng-content select="label" ngProjectAs="label"></ng-content>
|
|
1158
1610
|
</iss-ctrl-date-picker>
|
|
1159
1611
|
<iss-ctrl-time-picker
|
|
@@ -1167,7 +1619,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1167
1619
|
</form>
|
|
1168
1620
|
`
|
|
1169
1621
|
}]
|
|
1170
|
-
}], propDecorators: { disabledDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDays", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], minTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "minTime", required: false }] }], maxTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxTime", required: false }] }] } });
|
|
1622
|
+
}], propDecorators: { disabledDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDays", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], minTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "minTime", required: false }] }], maxTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxTime", required: false }] }], hijriCalendar: [{ type: i0.Input, args: [{ isSignal: true, alias: "hijriCalendar", required: false }] }], emitHijri: [{ type: i0.Input, args: [{ isSignal: true, alias: "emitHijri", required: false }] }] } });
|
|
1171
1623
|
|
|
1172
1624
|
class HintsComponent {
|
|
1173
1625
|
hints = input([], ...(ngDevMode ? [{ debugName: "hints" }] : /* istanbul ignore next */ []));
|
|
@@ -1575,8 +2027,10 @@ class InputControl extends ControlBase {
|
|
|
1575
2027
|
{ provide: NG_VALIDATORS, useExisting: InputControl, multi: true }
|
|
1576
2028
|
], usesInheritance: true, ngImport: i0, template: `
|
|
1577
2029
|
<mat-form-field floatLabel="auto" class="">
|
|
1578
|
-
<!--
|
|
1579
|
-
<mat-label class="fs-16 fc-black"
|
|
2030
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
2031
|
+
<mat-label class="fs-16 fc-black">
|
|
2032
|
+
<ng-content select="label"></ng-content>
|
|
2033
|
+
</mat-label>
|
|
1580
2034
|
<ng-content select="[issPrefix]"></ng-content>
|
|
1581
2035
|
<div (click)="emitPrefixClick()" class="cursor-pointer">
|
|
1582
2036
|
@if (prefixText()) {
|
|
@@ -1631,8 +2085,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1631
2085
|
],
|
|
1632
2086
|
template: `
|
|
1633
2087
|
<mat-form-field floatLabel="auto" class="">
|
|
1634
|
-
<!--
|
|
1635
|
-
<mat-label class="fs-16 fc-black"
|
|
2088
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
2089
|
+
<mat-label class="fs-16 fc-black">
|
|
2090
|
+
<ng-content select="label"></ng-content>
|
|
2091
|
+
</mat-label>
|
|
1636
2092
|
<ng-content select="[issPrefix]"></ng-content>
|
|
1637
2093
|
<div (click)="emitPrefixClick()" class="cursor-pointer">
|
|
1638
2094
|
@if (prefixText()) {
|
|
@@ -3965,8 +4421,10 @@ class MobileControl extends ControlBase {
|
|
|
3965
4421
|
{ provide: NG_VALIDATORS, useExisting: MobileControl, multi: true }
|
|
3966
4422
|
], usesInheritance: true, ngImport: i0, template: `
|
|
3967
4423
|
<mat-form-field floatLabel="auto" cdkOverlayOrigin #trigger="cdkOverlayOrigin">
|
|
3968
|
-
<!--
|
|
3969
|
-
<mat-label class="fs-16 fc-black"
|
|
4424
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
4425
|
+
<mat-label class="fs-16 fc-black">
|
|
4426
|
+
<ng-content select="label"></ng-content>
|
|
4427
|
+
</mat-label>
|
|
3970
4428
|
<div class="d-inline-flex align-items-center gap-1 country-flag" matPrefix (click)="toggleCountryCodeMenu()">
|
|
3971
4429
|
<img
|
|
3972
4430
|
ngSrc="./flags/{{selectedCountry().code.toLowerCase()}}.svg"
|
|
@@ -4041,8 +4499,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
4041
4499
|
{ provide: NG_VALIDATORS, useExisting: MobileControl, multi: true }
|
|
4042
4500
|
], template: `
|
|
4043
4501
|
<mat-form-field floatLabel="auto" cdkOverlayOrigin #trigger="cdkOverlayOrigin">
|
|
4044
|
-
<!--
|
|
4045
|
-
<mat-label class="fs-16 fc-black"
|
|
4502
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
4503
|
+
<mat-label class="fs-16 fc-black">
|
|
4504
|
+
<ng-content select="label"></ng-content>
|
|
4505
|
+
</mat-label>
|
|
4046
4506
|
<div class="d-inline-flex align-items-center gap-1 country-flag" matPrefix (click)="toggleCountryCodeMenu()">
|
|
4047
4507
|
<img
|
|
4048
4508
|
ngSrc="./flags/{{selectedCountry().code.toLowerCase()}}.svg"
|
|
@@ -4859,8 +5319,10 @@ class SelectControl extends ControlBase {
|
|
|
4859
5319
|
{ provide: NG_VALUE_ACCESSOR, useExisting: SelectControl, multi: true },
|
|
4860
5320
|
], queries: [{ propertyName: "optionTemplate", first: true, predicate: ["optionTemplate"], descendants: true, isSignal: true }, { propertyName: "cardViewerTemplate", first: true, predicate: ["cardViewerTemplate"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
4861
5321
|
<mat-form-field floatLabel="auto" class="">
|
|
4862
|
-
<!--
|
|
4863
|
-
<mat-label class="fs-16 fc-black"
|
|
5322
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
5323
|
+
<mat-label class="fs-16 fc-black">
|
|
5324
|
+
<ng-content select="label"></ng-content>
|
|
5325
|
+
</mat-label>
|
|
4864
5326
|
<input [formControl]="ctrl" [matAutocomplete]="auto" [matChipInputFor]="chipGrid" [placeholder]="placeholder()" [readonly]="readonly()" (blur)="markAsTouched()" class="m-0" matInput/>
|
|
4865
5327
|
@if (!disabled()) {
|
|
4866
5328
|
@if (selectedOptions().size) {
|
|
@@ -4937,8 +5399,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
4937
5399
|
{ provide: NG_VALUE_ACCESSOR, useExisting: SelectControl, multi: true },
|
|
4938
5400
|
], template: `
|
|
4939
5401
|
<mat-form-field floatLabel="auto" class="">
|
|
4940
|
-
<!--
|
|
4941
|
-
<mat-label class="fs-16 fc-black"
|
|
5402
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
5403
|
+
<mat-label class="fs-16 fc-black">
|
|
5404
|
+
<ng-content select="label"></ng-content>
|
|
5405
|
+
</mat-label>
|
|
4942
5406
|
<input [formControl]="ctrl" [matAutocomplete]="auto" [matChipInputFor]="chipGrid" [placeholder]="placeholder()" [readonly]="readonly()" (blur)="markAsTouched()" class="m-0" matInput/>
|
|
4943
5407
|
@if (!disabled()) {
|
|
4944
5408
|
@if (selectedOptions().size) {
|
|
@@ -5088,8 +5552,10 @@ class TextareaControl extends ControlBase {
|
|
|
5088
5552
|
{ provide: NG_VALIDATORS, useExisting: TextareaControl, multi: true }
|
|
5089
5553
|
], usesInheritance: true, ngImport: i0, template: `
|
|
5090
5554
|
<mat-form-field floatLabel="auto" class="custom-textarea">
|
|
5091
|
-
<!--
|
|
5092
|
-
<mat-label class="fs-16 fc-black"
|
|
5555
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
5556
|
+
<mat-label class="fs-16 fc-black">
|
|
5557
|
+
<ng-content select="label"></ng-content>
|
|
5558
|
+
</mat-label>
|
|
5093
5559
|
<textarea
|
|
5094
5560
|
matInput
|
|
5095
5561
|
[placeholder]="placeholder()"
|
|
@@ -5124,8 +5590,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
5124
5590
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
5125
5591
|
template: `
|
|
5126
5592
|
<mat-form-field floatLabel="auto" class="custom-textarea">
|
|
5127
|
-
<!--
|
|
5128
|
-
<mat-label class="fs-16 fc-black"
|
|
5593
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
5594
|
+
<mat-label class="fs-16 fc-black">
|
|
5595
|
+
<ng-content select="label"></ng-content>
|
|
5596
|
+
</mat-label>
|
|
5129
5597
|
<textarea
|
|
5130
5598
|
matInput
|
|
5131
5599
|
[placeholder]="placeholder()"
|
|
@@ -5299,7 +5767,7 @@ class FieldAsyncValidation {
|
|
|
5299
5767
|
* ### Keys by area
|
|
5300
5768
|
* - **Common:** `type` · `disabled` · `readonly` · `placeholder` · `suffix` · `hideLabel` · `multiple`
|
|
5301
5769
|
* - **Bounds:** `min` · `max` · `minLength` · `maxLength`
|
|
5302
|
-
* - **Dates:** `minDate` · `maxDate` · `dateFilter`
|
|
5770
|
+
* - **Dates:** `minDate` · `maxDate` · `dateFilter` · `hijriCalendar` · `emitHijri`
|
|
5303
5771
|
* - **Attachments:** `allowedFileSize` · `allowedFileTypes` · `minFilesCount` · `maxFilesCount` · `templateId` · `templateUrl`
|
|
5304
5772
|
* - **Users:** `minUsersCount` · `maxUsersCount`
|
|
5305
5773
|
* - **Table:** `showInTableColumns` · `tableWithFilter` · `tableWithSort` · `tableWithPagination`
|
|
@@ -5366,6 +5834,18 @@ class FieldConfig {
|
|
|
5366
5834
|
* Restricts the calendar to working days. Source: `config.acceptWorkDaysOnly`.
|
|
5367
5835
|
*/
|
|
5368
5836
|
dateFilter = signal(undefined, ...(ngDevMode ? [{ debugName: "dateFilter" }] : /* istanbul ignore next */ []));
|
|
5837
|
+
/**
|
|
5838
|
+
* Renders the calendar as an Umm al-Qura Hijri calendar. The emitted value stays Gregorian
|
|
5839
|
+
* unless {@link FieldConfig.emitHijri} is also on. Source: `config.hijriCalendar`, also
|
|
5840
|
+
* accepted as `config.HijriCalendar`.
|
|
5841
|
+
*/
|
|
5842
|
+
hijriCalendar = signal(undefined, ...(ngDevMode ? [{ debugName: "hijriCalendar" }] : /* istanbul ignore next */ []));
|
|
5843
|
+
/**
|
|
5844
|
+
* Emits the picked date as a Hijri date instead of a Gregorian one — the same day emitted
|
|
5845
|
+
* as `1447-03-16` rather than `2025-09-08`. Implies {@link FieldConfig.hijriCalendar}: a
|
|
5846
|
+
* Hijri value is always picked from a Hijri calendar.
|
|
5847
|
+
*/
|
|
5848
|
+
emitHijri = signal(undefined, ...(ngDevMode ? [{ debugName: "emitHijri" }] : /* istanbul ignore next */ []));
|
|
5369
5849
|
/**
|
|
5370
5850
|
* Id of a downloadable template offered next to an attachment field.
|
|
5371
5851
|
*/
|
|
@@ -5428,6 +5908,8 @@ class FieldConfig {
|
|
|
5428
5908
|
this.minDate.set(config?.minDate);
|
|
5429
5909
|
this.maxDate.set(config?.maxDate);
|
|
5430
5910
|
this.dateFilter.set(config?.acceptWorkDaysOnly);
|
|
5911
|
+
this.hijriCalendar.set(config?.hijriCalendar ?? config?.HijriCalendar);
|
|
5912
|
+
this.emitHijri.set(config?.emitHijri);
|
|
5431
5913
|
this.minLength.set(config?.minLength);
|
|
5432
5914
|
this.maxLength.set(config?.maxLength);
|
|
5433
5915
|
this.allowedFileSize.set(config?.allowedSize);
|
|
@@ -5874,22 +6356,22 @@ const COMPONENTS = {
|
|
|
5874
6356
|
datetime: () => Promise.resolve().then(function () { return datetimePicker_field; }).then((c) => c.DatetimePickerField),
|
|
5875
6357
|
date_range: () => Promise.resolve().then(function () { return dateRangePicker_field; }).then((c) => c.DateRangePickerField),
|
|
5876
6358
|
attachment: () => Promise.resolve().then(function () { return filePicker_field; }).then((c) => c.FilePickerField),
|
|
5877
|
-
userPicker: () => import('./iss-ctrl-user-picker.field-
|
|
6359
|
+
userPicker: () => import('./iss-ctrl-user-picker.field-Bc_yX1v9.mjs').then((c) => c.UserPickerField),
|
|
5878
6360
|
vehicle_plate: () => Promise.resolve().then(function () { return plate_field; }).then((c) => c.PlateField),
|
|
5879
|
-
enrichment: () => import('./iss-ctrl-note.field-
|
|
6361
|
+
enrichment: () => import('./iss-ctrl-note.field-C5zBFWV-.mjs').then((c) => c.NoteField),
|
|
5880
6362
|
mobile: () => Promise.resolve().then(function () { return mobile_field; }).then((c) => c.MobileField),
|
|
5881
|
-
table: () => import('./iss-ctrl-table.field-
|
|
6363
|
+
table: () => import('./iss-ctrl-table.field-CjCWmdqf.mjs').then((c) => c.TableField),
|
|
5882
6364
|
chips: () => Promise.resolve().then(function () { return chips_field; }).then((c) => c.ChipsField),
|
|
5883
6365
|
switch: () => Promise.resolve().then(function () { return slideToggle_field; }).then((c) => c.SlideToggleField),
|
|
5884
6366
|
};
|
|
5885
6367
|
|
|
5886
6368
|
const SERVICES = {
|
|
5887
|
-
setValue: () => import('./iss-ctrl-set-value-event-
|
|
6369
|
+
setValue: () => import('./iss-ctrl-set-value-event-DHF2LsSf.mjs').then((s) => s.SetValueEvent),
|
|
5888
6370
|
show: () => import('./iss-ctrl-show-event-BcRCwAfo.mjs').then((s) => s.ShowEvent),
|
|
5889
|
-
load: () => import('./iss-ctrl-load-value-event-
|
|
5890
|
-
loadOptions: () => import('./iss-ctrl-load-options-event-
|
|
5891
|
-
triggerBasedOnJsonValue: () => import('./iss-ctrl-trigger-based-on-json-value-
|
|
5892
|
-
replaceApiKeyDefaultImpl: () => import('./iss-ctrl-replace-api-keys-
|
|
6371
|
+
load: () => import('./iss-ctrl-load-value-event-CilsqNpU.mjs').then((s) => s.LoadValueEvent),
|
|
6372
|
+
loadOptions: () => import('./iss-ctrl-load-options-event-BCHN0tAM.mjs').then((s) => s.LoadOptionsEvent),
|
|
6373
|
+
triggerBasedOnJsonValue: () => import('./iss-ctrl-trigger-based-on-json-value-BwxH6MLn.mjs').then((s) => s.TriggerBasedOnJsonValue),
|
|
6374
|
+
replaceApiKeyDefaultImpl: () => import('./iss-ctrl-replace-api-keys-uUZLoWuP.mjs').then((s) => s.ReplaceApiKeys),
|
|
5893
6375
|
};
|
|
5894
6376
|
|
|
5895
6377
|
// Read-only counterpart of COMPONENTS: the component used to render a field's value
|
|
@@ -6256,8 +6738,6 @@ const VALIDATION_MESSAGES = {
|
|
|
6256
6738
|
}
|
|
6257
6739
|
};
|
|
6258
6740
|
|
|
6259
|
-
const UI_LANGUAGE = new InjectionToken("UI SELECTED LANGUAGE");
|
|
6260
|
-
|
|
6261
6741
|
class TranslatePipe {
|
|
6262
6742
|
currentLanguage = inject(UI_LANGUAGE);
|
|
6263
6743
|
transform(value, locale = "") {
|
|
@@ -8248,9 +8728,19 @@ var timePicker_field = /*#__PURE__*/Object.freeze({
|
|
|
8248
8728
|
});
|
|
8249
8729
|
|
|
8250
8730
|
class DatePickerViewer extends ViewerBase {
|
|
8731
|
+
// a field picked on the Hijri calendar reads back as a Hijri date, whichever calendar its
|
|
8732
|
+
// stored value is in
|
|
8733
|
+
hijriDate = computed(() => toHijriDisplay(this.field().ctrlValue(), {
|
|
8734
|
+
hijriCalendar: this.field().config?.hijriCalendar(),
|
|
8735
|
+
emitHijri: this.field().config?.emitHijri(),
|
|
8736
|
+
}), ...(ngDevMode ? [{ debugName: "hijriDate" }] : /* istanbul ignore next */ []));
|
|
8251
8737
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatePickerViewer, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
8252
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
8253
|
-
|
|
8738
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DatePickerViewer, isStandalone: true, selector: "iss-viewer-date-picker", usesInheritance: true, ngImport: i0, template: `
|
|
8739
|
+
@if (hijriDate(); as hijri) {
|
|
8740
|
+
{{ hijri }}
|
|
8741
|
+
} @else {
|
|
8742
|
+
{{ field().ctrlValue() | date: 'dd/MM/yyyy' }}
|
|
8743
|
+
}
|
|
8254
8744
|
`, isInline: true, dependencies: [{ kind: "pipe", type: DatePipe, name: "date" }] });
|
|
8255
8745
|
}
|
|
8256
8746
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatePickerViewer, decorators: [{
|
|
@@ -8260,8 +8750,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
8260
8750
|
imports: [
|
|
8261
8751
|
DatePipe
|
|
8262
8752
|
],
|
|
8263
|
-
template: `
|
|
8264
|
-
|
|
8753
|
+
template: `
|
|
8754
|
+
@if (hijriDate(); as hijri) {
|
|
8755
|
+
{{ hijri }}
|
|
8756
|
+
} @else {
|
|
8757
|
+
{{ field().ctrlValue() | date: 'dd/MM/yyyy' }}
|
|
8758
|
+
}
|
|
8265
8759
|
`
|
|
8266
8760
|
}]
|
|
8267
8761
|
}] });
|
|
@@ -8283,6 +8777,8 @@ var datePicker_viewer = /*#__PURE__*/Object.freeze({
|
|
|
8283
8777
|
* | `minDate` | `Date` | Earliest selectable date. |
|
|
8284
8778
|
* | `maxDate` | `Date` | Latest selectable date. |
|
|
8285
8779
|
* | `readonly` | `boolean` | Shows the value but blocks interaction. |
|
|
8780
|
+
* | `hijriCalendar` | `boolean` | Renders an Umm al-Qura Hijri calendar while the emitted value stays Gregorian. |
|
|
8781
|
+
* | `emitHijri` | `boolean` | Emits the Hijri date instead of the Gregorian one. Implies `hijriCalendar`. |
|
|
8286
8782
|
*
|
|
8287
8783
|
* ### Other field members used
|
|
8288
8784
|
* `label()`
|
|
@@ -8297,18 +8793,25 @@ var datePicker_viewer = /*#__PURE__*/Object.freeze({
|
|
|
8297
8793
|
*/
|
|
8298
8794
|
class DatePickerField extends FieldBase {
|
|
8299
8795
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatePickerField, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
8300
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DatePickerField, isStandalone: true, selector: "iss-field-date-picker", usesInheritance: true, ngImport: i0, template: `
|
|
8301
|
-
@if (field.visible()) {
|
|
8302
|
-
@if (field.mode() === "edit") {
|
|
8303
|
-
<iss-ctrl-date-picker
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8796
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DatePickerField, isStandalone: true, selector: "iss-field-date-picker", usesInheritance: true, ngImport: i0, template: `
|
|
8797
|
+
@if (field.visible()) {
|
|
8798
|
+
@if (field.mode() === "edit") {
|
|
8799
|
+
<iss-ctrl-date-picker
|
|
8800
|
+
[formControlName]="field.name"
|
|
8801
|
+
[minDate]="field.config.minDate() ?? null"
|
|
8802
|
+
[maxDate]="field.config.maxDate() ?? null"
|
|
8803
|
+
[readonly]="field.config.readonly() ?? false"
|
|
8804
|
+
[hijriCalendar]="field.config.hijriCalendar() ?? false"
|
|
8805
|
+
[emitHijri]="field.config.emitHijri() ?? false"
|
|
8806
|
+
>
|
|
8807
|
+
<label>{{ field.label() }}</label>
|
|
8808
|
+
</iss-ctrl-date-picker>
|
|
8809
|
+
<iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
|
|
8810
|
+
} @else {
|
|
8811
|
+
<iss-viewer-date-picker [field]="field"/>
|
|
8812
|
+
}
|
|
8813
|
+
}
|
|
8814
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: DatePickerControl, selector: "iss-ctrl-date-picker", inputs: ["disabledDays", "minDate", "maxDate", "hijriCalendar", "emitHijri"] }, { kind: "component", type: ValidationMessageComponent, selector: "iss-validation-message-viewer", inputs: ["errors", "showMessage"] }, { kind: "component", type: DatePickerViewer, selector: "iss-viewer-date-picker" }], viewProviders: [VIEW_PROVIDER] });
|
|
8312
8815
|
}
|
|
8313
8816
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatePickerField, decorators: [{
|
|
8314
8817
|
type: Component,
|
|
@@ -8321,17 +8824,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
8321
8824
|
ValidationMessageComponent,
|
|
8322
8825
|
DatePickerViewer
|
|
8323
8826
|
],
|
|
8324
|
-
template: `
|
|
8325
|
-
@if (field.visible()) {
|
|
8326
|
-
@if (field.mode() === "edit") {
|
|
8327
|
-
<iss-ctrl-date-picker
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8827
|
+
template: `
|
|
8828
|
+
@if (field.visible()) {
|
|
8829
|
+
@if (field.mode() === "edit") {
|
|
8830
|
+
<iss-ctrl-date-picker
|
|
8831
|
+
[formControlName]="field.name"
|
|
8832
|
+
[minDate]="field.config.minDate() ?? null"
|
|
8833
|
+
[maxDate]="field.config.maxDate() ?? null"
|
|
8834
|
+
[readonly]="field.config.readonly() ?? false"
|
|
8835
|
+
[hijriCalendar]="field.config.hijriCalendar() ?? false"
|
|
8836
|
+
[emitHijri]="field.config.emitHijri() ?? false"
|
|
8837
|
+
>
|
|
8838
|
+
<label>{{ field.label() }}</label>
|
|
8839
|
+
</iss-ctrl-date-picker>
|
|
8840
|
+
<iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
|
|
8841
|
+
} @else {
|
|
8842
|
+
<iss-viewer-date-picker [field]="field"/>
|
|
8843
|
+
}
|
|
8844
|
+
}
|
|
8335
8845
|
`
|
|
8336
8846
|
}]
|
|
8337
8847
|
}] });
|
|
@@ -8343,9 +8853,20 @@ var datePicker_field = /*#__PURE__*/Object.freeze({
|
|
|
8343
8853
|
|
|
8344
8854
|
class DatePickerTimeViewer extends ViewerBase {
|
|
8345
8855
|
DATETIME_FORMAT = DATETIME_FORMAT;
|
|
8856
|
+
// a field picked on the Hijri calendar reads back as a Hijri date, whichever calendar its
|
|
8857
|
+
// stored value is in
|
|
8858
|
+
hijriDatetime = computed(() => toHijriDisplay(this.field().ctrlValue(), {
|
|
8859
|
+
hijriCalendar: this.field().config?.hijriCalendar(),
|
|
8860
|
+
emitHijri: this.field().config?.emitHijri(),
|
|
8861
|
+
withTime: true,
|
|
8862
|
+
}), ...(ngDevMode ? [{ debugName: "hijriDatetime" }] : /* istanbul ignore next */ []));
|
|
8346
8863
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatePickerTimeViewer, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
8347
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
8348
|
-
|
|
8864
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DatePickerTimeViewer, isStandalone: true, selector: "iss-viewer-datetime-picker", usesInheritance: true, ngImport: i0, template: `
|
|
8865
|
+
@if (hijriDatetime(); as hijri) {
|
|
8866
|
+
{{ hijri }}
|
|
8867
|
+
} @else {
|
|
8868
|
+
{{ field().ctrlValue() | date: DATETIME_FORMAT }}
|
|
8869
|
+
}
|
|
8349
8870
|
`, isInline: true, dependencies: [{ kind: "pipe", type: DatePipe, name: "date" }] });
|
|
8350
8871
|
}
|
|
8351
8872
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatePickerTimeViewer, decorators: [{
|
|
@@ -8355,8 +8876,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
8355
8876
|
imports: [
|
|
8356
8877
|
DatePipe
|
|
8357
8878
|
],
|
|
8358
|
-
template: `
|
|
8359
|
-
|
|
8879
|
+
template: `
|
|
8880
|
+
@if (hijriDatetime(); as hijri) {
|
|
8881
|
+
{{ hijri }}
|
|
8882
|
+
} @else {
|
|
8883
|
+
{{ field().ctrlValue() | date: DATETIME_FORMAT }}
|
|
8884
|
+
}
|
|
8360
8885
|
`
|
|
8361
8886
|
}]
|
|
8362
8887
|
}] });
|
|
@@ -8378,6 +8903,8 @@ var datetimePicker_viewer = /*#__PURE__*/Object.freeze({
|
|
|
8378
8903
|
* | `minDate` | `Date` | Earliest selectable date. |
|
|
8379
8904
|
* | `maxDate` | `Date` | Latest selectable date. |
|
|
8380
8905
|
* | `readonly` | `boolean` | Shows the value but blocks interaction. |
|
|
8906
|
+
* | `hijriCalendar` | `boolean` | Renders an Umm al-Qura Hijri calendar while the emitted value stays Gregorian. |
|
|
8907
|
+
* | `emitHijri` | `boolean` | Emits the Hijri date instead of the Gregorian one. Implies `hijriCalendar`. |
|
|
8381
8908
|
*
|
|
8382
8909
|
* ### Other field members used
|
|
8383
8910
|
* `label()`
|
|
@@ -8392,18 +8919,25 @@ var datetimePicker_viewer = /*#__PURE__*/Object.freeze({
|
|
|
8392
8919
|
*/
|
|
8393
8920
|
class DatetimePickerField extends FieldBase {
|
|
8394
8921
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatetimePickerField, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
8395
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DatetimePickerField, isStandalone: true, selector: "iss-field-datetime-picker", usesInheritance: true, ngImport: i0, template: `
|
|
8396
|
-
@if (field.visible()) {
|
|
8397
|
-
@if (field.mode() === "edit") {
|
|
8398
|
-
<iss-ctrl-datetime-picker
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8922
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DatetimePickerField, isStandalone: true, selector: "iss-field-datetime-picker", usesInheritance: true, ngImport: i0, template: `
|
|
8923
|
+
@if (field.visible()) {
|
|
8924
|
+
@if (field.mode() === "edit") {
|
|
8925
|
+
<iss-ctrl-datetime-picker
|
|
8926
|
+
[formControlName]="field.name"
|
|
8927
|
+
[minDate]="field.config.minDate() ?? null"
|
|
8928
|
+
[maxDate]="field.config.maxDate() ?? null"
|
|
8929
|
+
[readonly]="field.config.readonly() ?? false"
|
|
8930
|
+
[hijriCalendar]="field.config.hijriCalendar() ?? false"
|
|
8931
|
+
[emitHijri]="field.config.emitHijri() ?? false"
|
|
8932
|
+
>
|
|
8933
|
+
<label>{{ field.label() }}</label>
|
|
8934
|
+
</iss-ctrl-datetime-picker>
|
|
8935
|
+
<iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
|
|
8936
|
+
} @else {
|
|
8937
|
+
<iss-viewer-datetime-picker [field]="field"/>
|
|
8938
|
+
}
|
|
8939
|
+
}
|
|
8940
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: DatetimePickerControl, selector: "iss-ctrl-datetime-picker", inputs: ["disabledDays", "minDate", "maxDate", "minTime", "maxTime", "hijriCalendar", "emitHijri"] }, { kind: "component", type: ValidationMessageComponent, selector: "iss-validation-message-viewer", inputs: ["errors", "showMessage"] }, { kind: "component", type: DatePickerTimeViewer, selector: "iss-viewer-datetime-picker" }], viewProviders: [VIEW_PROVIDER] });
|
|
8407
8941
|
}
|
|
8408
8942
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatetimePickerField, decorators: [{
|
|
8409
8943
|
type: Component,
|
|
@@ -8416,17 +8950,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
8416
8950
|
ValidationMessageComponent,
|
|
8417
8951
|
DatePickerTimeViewer,
|
|
8418
8952
|
],
|
|
8419
|
-
template: `
|
|
8420
|
-
@if (field.visible()) {
|
|
8421
|
-
@if (field.mode() === "edit") {
|
|
8422
|
-
<iss-ctrl-datetime-picker
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8953
|
+
template: `
|
|
8954
|
+
@if (field.visible()) {
|
|
8955
|
+
@if (field.mode() === "edit") {
|
|
8956
|
+
<iss-ctrl-datetime-picker
|
|
8957
|
+
[formControlName]="field.name"
|
|
8958
|
+
[minDate]="field.config.minDate() ?? null"
|
|
8959
|
+
[maxDate]="field.config.maxDate() ?? null"
|
|
8960
|
+
[readonly]="field.config.readonly() ?? false"
|
|
8961
|
+
[hijriCalendar]="field.config.hijriCalendar() ?? false"
|
|
8962
|
+
[emitHijri]="field.config.emitHijri() ?? false"
|
|
8963
|
+
>
|
|
8964
|
+
<label>{{ field.label() }}</label>
|
|
8965
|
+
</iss-ctrl-datetime-picker>
|
|
8966
|
+
<iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
|
|
8967
|
+
} @else {
|
|
8968
|
+
<iss-viewer-datetime-picker [field]="field"/>
|
|
8969
|
+
}
|
|
8970
|
+
}
|
|
8430
8971
|
`
|
|
8431
8972
|
}]
|
|
8432
8973
|
}] });
|
|
@@ -8438,14 +8979,21 @@ var datetimePicker_field = /*#__PURE__*/Object.freeze({
|
|
|
8438
8979
|
|
|
8439
8980
|
class DateRangePickerViewer extends ViewerBase {
|
|
8440
8981
|
dateRange = [];
|
|
8982
|
+
// a range picked on the Hijri calendar reads back as Hijri dates, whichever calendar its
|
|
8983
|
+
// stored value is in
|
|
8984
|
+
hijriDates = [];
|
|
8441
8985
|
ngOnInit() {
|
|
8442
8986
|
this.dateRange = this.field().ctrlValue().split(",").map((val) => val.trim());
|
|
8987
|
+
this.hijriDates = this.dateRange.map((date) => toHijriDisplay(date, {
|
|
8988
|
+
hijriCalendar: this.field().config?.hijriCalendar(),
|
|
8989
|
+
emitHijri: this.field().config?.emitHijri(),
|
|
8990
|
+
}));
|
|
8443
8991
|
}
|
|
8444
8992
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DateRangePickerViewer, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
8445
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DateRangePickerViewer, isStandalone: true, selector: "iss-viewer-date-range-picker", usesInheritance: true, ngImport: i0, template: `
|
|
8446
|
-
@for (date of dateRange; track date; let last = $last) {
|
|
8447
|
-
<span> {{ date | date: 'dd/MM/yyyy' }} {{ last ? '' : '- ' }} </span>
|
|
8448
|
-
}
|
|
8993
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DateRangePickerViewer, isStandalone: true, selector: "iss-viewer-date-range-picker", usesInheritance: true, ngImport: i0, template: `
|
|
8994
|
+
@for (date of dateRange; track date; let last = $last) {
|
|
8995
|
+
<span> {{ hijriDates[$index] ?? (date | date: 'dd/MM/yyyy') }} {{ last ? '' : '- ' }} </span>
|
|
8996
|
+
}
|
|
8449
8997
|
`, isInline: true, dependencies: [{ kind: "pipe", type: DatePipe, name: "date" }] });
|
|
8450
8998
|
}
|
|
8451
8999
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DateRangePickerViewer, decorators: [{
|
|
@@ -8455,10 +9003,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
8455
9003
|
imports: [
|
|
8456
9004
|
DatePipe
|
|
8457
9005
|
],
|
|
8458
|
-
template: `
|
|
8459
|
-
@for (date of dateRange; track date; let last = $last) {
|
|
8460
|
-
<span> {{ date | date: 'dd/MM/yyyy' }} {{ last ? '' : '- ' }} </span>
|
|
8461
|
-
}
|
|
9006
|
+
template: `
|
|
9007
|
+
@for (date of dateRange; track date; let last = $last) {
|
|
9008
|
+
<span> {{ hijriDates[$index] ?? (date | date: 'dd/MM/yyyy') }} {{ last ? '' : '- ' }} </span>
|
|
9009
|
+
}
|
|
8462
9010
|
`
|
|
8463
9011
|
}]
|
|
8464
9012
|
}] });
|
|
@@ -8480,6 +9028,8 @@ var dateRangePicker_viewer = /*#__PURE__*/Object.freeze({
|
|
|
8480
9028
|
* | `minDate` | `Date` | Earliest selectable date. |
|
|
8481
9029
|
* | `maxDate` | `Date` | Latest selectable date. |
|
|
8482
9030
|
* | `readonly` | `boolean` | Shows the value but blocks interaction. |
|
|
9031
|
+
* | `hijriCalendar` | `boolean` | Renders an Umm al-Qura Hijri calendar while the emitted value stays Gregorian. |
|
|
9032
|
+
* | `emitHijri` | `boolean` | Emits the Hijri date instead of the Gregorian one. Implies `hijriCalendar`. |
|
|
8483
9033
|
*
|
|
8484
9034
|
* ### Other field members used
|
|
8485
9035
|
* `label()`
|
|
@@ -8496,17 +9046,24 @@ var dateRangePicker_viewer = /*#__PURE__*/Object.freeze({
|
|
|
8496
9046
|
*/
|
|
8497
9047
|
class DateRangePickerField extends FieldBase {
|
|
8498
9048
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DateRangePickerField, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
8499
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DateRangePickerField, isStandalone: true, selector: "iss-field-date-range-picker", usesInheritance: true, ngImport: i0, template: `
|
|
8500
|
-
@if (field.visible()) {
|
|
8501
|
-
@if (field.mode() === "edit") {
|
|
8502
|
-
<iss-ctrl-date-range-picker
|
|
8503
|
-
|
|
8504
|
-
|
|
8505
|
-
|
|
8506
|
-
|
|
8507
|
-
|
|
8508
|
-
|
|
8509
|
-
|
|
9049
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DateRangePickerField, isStandalone: true, selector: "iss-field-date-range-picker", usesInheritance: true, ngImport: i0, template: `
|
|
9050
|
+
@if (field.visible()) {
|
|
9051
|
+
@if (field.mode() === "edit") {
|
|
9052
|
+
<iss-ctrl-date-range-picker
|
|
9053
|
+
[formControlName]="field.name"
|
|
9054
|
+
[minDate]="field.config.minDate() ?? null"
|
|
9055
|
+
[maxDate]="field.config.maxDate() ?? null"
|
|
9056
|
+
[readonly]="field.config.readonly() ?? false"
|
|
9057
|
+
[hijriCalendar]="field.config.hijriCalendar() ?? false"
|
|
9058
|
+
[emitHijri]="field.config.emitHijri() ?? false"
|
|
9059
|
+
>
|
|
9060
|
+
<label>{{ field.label() }}</label>
|
|
9061
|
+
</iss-ctrl-date-range-picker>
|
|
9062
|
+
} @else {
|
|
9063
|
+
<iss-viewer-date-range-picker [field]="field"/>
|
|
9064
|
+
}
|
|
9065
|
+
}
|
|
9066
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: DateRangePickerControl, selector: "iss-ctrl-date-range-picker", inputs: ["disabledDays", "minDate", "maxDate", "hijriCalendar", "emitHijri"], outputs: ["onDateRangeObjectChange"] }, { kind: "component", type: DateRangePickerViewer, selector: "iss-viewer-date-range-picker" }], viewProviders: [VIEW_PROVIDER] });
|
|
8510
9067
|
}
|
|
8511
9068
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DateRangePickerField, decorators: [{
|
|
8512
9069
|
type: Component,
|
|
@@ -8518,16 +9075,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
8518
9075
|
DateRangePickerControl,
|
|
8519
9076
|
DateRangePickerViewer
|
|
8520
9077
|
],
|
|
8521
|
-
template: `
|
|
8522
|
-
@if (field.visible()) {
|
|
8523
|
-
@if (field.mode() === "edit") {
|
|
8524
|
-
<iss-ctrl-date-range-picker
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
9078
|
+
template: `
|
|
9079
|
+
@if (field.visible()) {
|
|
9080
|
+
@if (field.mode() === "edit") {
|
|
9081
|
+
<iss-ctrl-date-range-picker
|
|
9082
|
+
[formControlName]="field.name"
|
|
9083
|
+
[minDate]="field.config.minDate() ?? null"
|
|
9084
|
+
[maxDate]="field.config.maxDate() ?? null"
|
|
9085
|
+
[readonly]="field.config.readonly() ?? false"
|
|
9086
|
+
[hijriCalendar]="field.config.hijriCalendar() ?? false"
|
|
9087
|
+
[emitHijri]="field.config.emitHijri() ?? false"
|
|
9088
|
+
>
|
|
9089
|
+
<label>{{ field.label() }}</label>
|
|
9090
|
+
</iss-ctrl-date-range-picker>
|
|
9091
|
+
} @else {
|
|
9092
|
+
<iss-viewer-date-range-picker [field]="field"/>
|
|
9093
|
+
}
|
|
9094
|
+
}
|
|
8531
9095
|
`
|
|
8532
9096
|
}]
|
|
8533
9097
|
}] });
|
|
@@ -8851,5 +9415,5 @@ var time_validator = /*#__PURE__*/Object.freeze({
|
|
|
8851
9415
|
* Generated bundle index. Do not edit.
|
|
8852
9416
|
*/
|
|
8853
9417
|
|
|
8854
|
-
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, VALIDATION_MESSAGES as aa, COMPONENTS as ab, SERVICES as ac, VALIDATORS as ad, FIELD_DATA as ae, UI_LANGUAGE as af, ATTACHMENT_UPLOAD_URL as ag, ATTACHMENT_UPLOAD_RESPONSE_MAPPER as ah, ATTACHMENT_DOWNLOAD_URL as ai, USER_SEARCH_API as aj, HintsComponent as ak, Droppable as al, ArabicNumberPipe as am, FieldDataInjector as an, PlateLetterPipe as ao, SelectStatusPipe as ap, TranslatePipe as aq, FileHandler as ar,
|
|
8855
|
-
//# sourceMappingURL=iss-ctrl-iss-ctrl-
|
|
9418
|
+
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, startOfHijriMonth as aA, getHijriDaysInMonth as aB, createHijriDate as aC, formatHijriDate as aD, parseHijriDate as aE, toHijriDisplay as aF, IssValidators as aG, FileValidators as aH, TimeValidator as aI, VALIDATION_MESSAGES as aa, COMPONENTS as ab, SERVICES as ac, VALIDATORS as ad, FIELD_DATA as ae, UI_LANGUAGE as af, ATTACHMENT_UPLOAD_URL as ag, ATTACHMENT_UPLOAD_RESPONSE_MAPPER as ah, ATTACHMENT_DOWNLOAD_URL as ai, USER_SEARCH_API as aj, HintsComponent as ak, Droppable as al, ArabicNumberPipe as am, FieldDataInjector as an, PlateLetterPipe as ao, SelectStatusPipe as ap, TranslatePipe as aq, FileHandler as ar, IssDateAdapter as as, provideIssDateAdapter as at, Phone as au, arrayFrom as av, formatFileSize as aw, HIJRI_LOCALE as ax, HIJRI_MONTH_NAMES as ay, getHijriParts 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 };
|
|
9419
|
+
//# sourceMappingURL=iss-ctrl-iss-ctrl-BpcynMId.mjs.map
|