@ibragim-dev-org/ui-forge-library 1.2.9 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,11 +37,8 @@ class DateUtils {
37
37
  const y = date.getFullYear();
38
38
  return isUsaDateFormat ? `${m}/${d}/${y}` : `${d}/${m}/${y}`;
39
39
  }
40
- static isUsaDateFormat() {
41
- const localeFromIntl = Intl.DateTimeFormat().resolvedOptions().locale;
42
- const localeFromNavigator = typeof navigator !== 'undefined' ? navigator.language : undefined;
43
- const locale = (localeFromIntl || localeFromNavigator || '').toLowerCase();
44
- return locale === 'en-us' || locale.startsWith('en-us-');
40
+ static isUsaDateFormat(format = undefined) {
41
+ return format === 'usa';
45
42
  }
46
43
  static setMonthSafe(date, month) {
47
44
  const d = new Date(date);
@@ -1164,6 +1161,7 @@ class UiDailyCalendarDirective {
1164
1161
  weekDaysEuropean = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
1165
1162
  weekDaysUsa = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
1166
1163
  $isRangeSelection = input(false, ...(ngDevMode ? [{ debugName: "$isRangeSelection" }] : []));
1164
+ $dateFormat = input(undefined, ...(ngDevMode ? [{ debugName: "$dateFormat" }] : []));
1167
1165
  $minDate = input(undefined, ...(ngDevMode ? [{ debugName: "$minDate" }] : []));
1168
1166
  $maxDate = input(undefined, ...(ngDevMode ? [{ debugName: "$maxDate" }] : []));
1169
1167
  get weekDays() {
@@ -1318,7 +1316,7 @@ class UiDailyCalendarDirective {
1318
1316
  this.$hoverDate.set(date);
1319
1317
  }
1320
1318
  isUsaDateFormat() {
1321
- return DateUtils.isUsaDateFormat();
1319
+ return DateUtils.isUsaDateFormat(this.$dateFormat());
1322
1320
  }
1323
1321
  select(date) {
1324
1322
  if (this.isDisabledDate(date)) {
@@ -1352,14 +1350,14 @@ class UiDailyCalendarDirective {
1352
1350
  }
1353
1351
  }
1354
1352
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiDailyCalendarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1355
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: UiDailyCalendarDirective, isStandalone: true, selector: "app-ui-daily-calendar", inputs: { $isRangeSelection: { classPropertyName: "$isRangeSelection", publicName: "$isRangeSelection", 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 }, $dateStart: { classPropertyName: "$dateStart", publicName: "$dateStart", isSignal: true, isRequired: false, transformFunction: null }, $dateEnd: { classPropertyName: "$dateEnd", publicName: "$dateEnd", isSignal: true, isRequired: false, transformFunction: null }, $currentMonth: { classPropertyName: "$currentMonth", publicName: "$currentMonth", isSignal: true, isRequired: true, transformFunction: null }, $currentYear: { classPropertyName: "$currentYear", publicName: "$currentYear", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { $dateStart: "$dateStartChange", $dateEnd: "$dateEndChange", $currentMonth: "$currentMonthChange", $currentYear: "$currentYearChange", $onRangeSelect: "$onRangeSelect", $onSelect: "$onSelect" }, ngImport: i0 });
1353
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: UiDailyCalendarDirective, isStandalone: true, selector: "app-ui-daily-calendar", inputs: { $isRangeSelection: { classPropertyName: "$isRangeSelection", publicName: "$isRangeSelection", isSignal: true, isRequired: false, transformFunction: null }, $dateFormat: { classPropertyName: "$dateFormat", publicName: "$dateFormat", 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 }, $dateStart: { classPropertyName: "$dateStart", publicName: "$dateStart", isSignal: true, isRequired: false, transformFunction: null }, $dateEnd: { classPropertyName: "$dateEnd", publicName: "$dateEnd", isSignal: true, isRequired: false, transformFunction: null }, $currentMonth: { classPropertyName: "$currentMonth", publicName: "$currentMonth", isSignal: true, isRequired: true, transformFunction: null }, $currentYear: { classPropertyName: "$currentYear", publicName: "$currentYear", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { $dateStart: "$dateStartChange", $dateEnd: "$dateEndChange", $currentMonth: "$currentMonthChange", $currentYear: "$currentYearChange", $onRangeSelect: "$onRangeSelect", $onSelect: "$onSelect" }, ngImport: i0 });
1356
1354
  }
1357
1355
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiDailyCalendarDirective, decorators: [{
1358
1356
  type: Directive,
1359
1357
  args: [{
1360
1358
  selector: 'app-ui-daily-calendar',
1361
1359
  }]
1362
- }], propDecorators: { $isRangeSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "$isRangeSelection", required: false }] }], $minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$minDate", required: false }] }], $maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$maxDate", required: false }] }], $dateStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dateStart", required: false }] }, { type: i0.Output, args: ["$dateStartChange"] }], $dateEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dateEnd", required: false }] }, { type: i0.Output, args: ["$dateEndChange"] }], $currentMonth: [{ type: i0.Input, args: [{ isSignal: true, alias: "$currentMonth", required: true }] }, { type: i0.Output, args: ["$currentMonthChange"] }], $currentYear: [{ type: i0.Input, args: [{ isSignal: true, alias: "$currentYear", required: true }] }, { type: i0.Output, args: ["$currentYearChange"] }], $onRangeSelect: [{ type: i0.Output, args: ["$onRangeSelect"] }], $onSelect: [{ type: i0.Output, args: ["$onSelect"] }] } });
1360
+ }], propDecorators: { $isRangeSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "$isRangeSelection", required: false }] }], $dateFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dateFormat", required: false }] }], $minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$minDate", required: false }] }], $maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$maxDate", required: false }] }], $dateStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dateStart", required: false }] }, { type: i0.Output, args: ["$dateStartChange"] }], $dateEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dateEnd", required: false }] }, { type: i0.Output, args: ["$dateEndChange"] }], $currentMonth: [{ type: i0.Input, args: [{ isSignal: true, alias: "$currentMonth", required: true }] }, { type: i0.Output, args: ["$currentMonthChange"] }], $currentYear: [{ type: i0.Input, args: [{ isSignal: true, alias: "$currentYear", required: true }] }, { type: i0.Output, args: ["$currentYearChange"] }], $onRangeSelect: [{ type: i0.Output, args: ["$onRangeSelect"] }], $onSelect: [{ type: i0.Output, args: ["$onSelect"] }] } });
1363
1361
 
1364
1362
  class UiMonthlyCalendarDirective {
1365
1363
  $date = model(new Date(), ...(ngDevMode ? [{ debugName: "$date" }] : []));
@@ -1470,6 +1468,7 @@ class UiCalendarDropdownDirective {
1470
1468
  isRangeSelection = false;
1471
1469
  minDate = undefined;
1472
1470
  maxDate = undefined;
1471
+ dateFormat = undefined;
1473
1472
  $close = signal(false, ...(ngDevMode ? [{ debugName: "$close" }] : []));
1474
1473
  $height = signal(0, ...(ngDevMode ? [{ debugName: "$height" }] : []));
1475
1474
  $width = signal(0, ...(ngDevMode ? [{ debugName: "$width" }] : []));
@@ -1539,7 +1538,7 @@ class UiCalendarDropdownDirective {
1539
1538
  this.$width.set(size.width);
1540
1539
  }
1541
1540
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiCalendarDropdownDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1542
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: UiCalendarDropdownDirective, isStandalone: true, selector: "app-ui-calendar-dropdown-calendar", inputs: { action: "action", rangeSelect: "rangeSelect", startDate: "startDate", endDate: "endDate", isRangeSelection: "isRangeSelection", minDate: "minDate", maxDate: "maxDate" }, usesOnChanges: true, ngImport: i0 });
1541
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: UiCalendarDropdownDirective, isStandalone: true, selector: "app-ui-calendar-dropdown-calendar", inputs: { action: "action", rangeSelect: "rangeSelect", startDate: "startDate", endDate: "endDate", isRangeSelection: "isRangeSelection", minDate: "minDate", maxDate: "maxDate", dateFormat: "dateFormat" }, usesOnChanges: true, ngImport: i0 });
1543
1542
  }
1544
1543
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiCalendarDropdownDirective, decorators: [{
1545
1544
  type: Directive,
@@ -1560,6 +1559,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
1560
1559
  type: Input
1561
1560
  }], maxDate: [{
1562
1561
  type: Input
1562
+ }], dateFormat: [{
1563
+ type: Input
1563
1564
  }] } });
1564
1565
 
1565
1566
  const typescript = {
@@ -3253,6 +3254,7 @@ class UiInputDirective extends UiFieldBaseDirective {
3253
3254
  renderer;
3254
3255
  $size = input('medium', ...(ngDevMode ? [{ debugName: "$size" }] : []));
3255
3256
  $placeholder = input('', ...(ngDevMode ? [{ debugName: "$placeholder" }] : []));
3257
+ $maxLength = input(undefined, ...(ngDevMode ? [{ debugName: "$maxLength" }] : []));
3256
3258
  $inputMode = input('text', ...(ngDevMode ? [{ debugName: "$inputMode" }] : []));
3257
3259
  $label = input('', ...(ngDevMode ? [{ debugName: "$label" }] : []));
3258
3260
  $shouldFocusedAfterViewInit = input(false, ...(ngDevMode ? [{ debugName: "$shouldFocusedAfterViewInit" }] : []));
@@ -3284,14 +3286,14 @@ class UiInputDirective extends UiFieldBaseDirective {
3284
3286
  });
3285
3287
  }
3286
3288
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiInputDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
3287
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: UiInputDirective, isStandalone: true, selector: "app-ui-input", inputs: { $size: { classPropertyName: "$size", publicName: "$size", isSignal: true, isRequired: false, transformFunction: null }, $placeholder: { classPropertyName: "$placeholder", publicName: "$placeholder", isSignal: true, isRequired: false, transformFunction: null }, $inputMode: { classPropertyName: "$inputMode", publicName: "$inputMode", isSignal: true, isRequired: false, transformFunction: null }, $label: { classPropertyName: "$label", publicName: "$label", isSignal: true, isRequired: false, transformFunction: null }, $shouldFocusedAfterViewInit: { classPropertyName: "$shouldFocusedAfterViewInit", publicName: "$shouldFocusedAfterViewInit", isSignal: true, isRequired: false, transformFunction: null }, $isRounded: { classPropertyName: "$isRounded", publicName: "$isRounded", isSignal: true, isRequired: false, transformFunction: null }, $hideValidatorErrors: { classPropertyName: "$hideValidatorErrors", publicName: "$hideValidatorErrors", isSignal: true, isRequired: false, transformFunction: null }, $icon: { classPropertyName: "$icon", publicName: "$icon", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
3289
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: UiInputDirective, isStandalone: true, selector: "app-ui-input", inputs: { $size: { classPropertyName: "$size", publicName: "$size", isSignal: true, isRequired: false, transformFunction: null }, $placeholder: { classPropertyName: "$placeholder", publicName: "$placeholder", isSignal: true, isRequired: false, transformFunction: null }, $maxLength: { classPropertyName: "$maxLength", publicName: "$maxLength", isSignal: true, isRequired: false, transformFunction: null }, $inputMode: { classPropertyName: "$inputMode", publicName: "$inputMode", isSignal: true, isRequired: false, transformFunction: null }, $label: { classPropertyName: "$label", publicName: "$label", isSignal: true, isRequired: false, transformFunction: null }, $shouldFocusedAfterViewInit: { classPropertyName: "$shouldFocusedAfterViewInit", publicName: "$shouldFocusedAfterViewInit", isSignal: true, isRequired: false, transformFunction: null }, $isRounded: { classPropertyName: "$isRounded", publicName: "$isRounded", isSignal: true, isRequired: false, transformFunction: null }, $hideValidatorErrors: { classPropertyName: "$hideValidatorErrors", publicName: "$hideValidatorErrors", isSignal: true, isRequired: false, transformFunction: null }, $icon: { classPropertyName: "$icon", publicName: "$icon", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
3288
3290
  }
3289
3291
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiInputDirective, decorators: [{
3290
3292
  type: Directive,
3291
3293
  args: [{
3292
3294
  selector: 'app-ui-input',
3293
3295
  }]
3294
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { $size: [{ type: i0.Input, args: [{ isSignal: true, alias: "$size", required: false }] }], $placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "$placeholder", required: false }] }], $inputMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "$inputMode", required: false }] }], $label: [{ type: i0.Input, args: [{ isSignal: true, alias: "$label", required: false }] }], $shouldFocusedAfterViewInit: [{ type: i0.Input, args: [{ isSignal: true, alias: "$shouldFocusedAfterViewInit", required: false }] }], $isRounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "$isRounded", required: false }] }], $hideValidatorErrors: [{ type: i0.Input, args: [{ isSignal: true, alias: "$hideValidatorErrors", required: false }] }], $icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "$icon", required: false }] }] } });
3296
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { $size: [{ type: i0.Input, args: [{ isSignal: true, alias: "$size", required: false }] }], $placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "$placeholder", required: false }] }], $maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "$maxLength", required: false }] }], $inputMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "$inputMode", required: false }] }], $label: [{ type: i0.Input, args: [{ isSignal: true, alias: "$label", required: false }] }], $shouldFocusedAfterViewInit: [{ type: i0.Input, args: [{ isSignal: true, alias: "$shouldFocusedAfterViewInit", required: false }] }], $isRounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "$isRounded", required: false }] }], $hideValidatorErrors: [{ type: i0.Input, args: [{ isSignal: true, alias: "$hideValidatorErrors", required: false }] }], $icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "$icon", required: false }] }] } });
3295
3297
 
3296
3298
  class UiInputCountryDirective extends UiInputDirective {
3297
3299
  $selectedCountry = signal(emptyCountry, ...(ngDevMode ? [{ debugName: "$selectedCountry" }] : []));
@@ -3354,6 +3356,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
3354
3356
  class UIInputDateDirective extends UiInputDirective {
3355
3357
  $isOpen = signal(false, ...(ngDevMode ? [{ debugName: "$isOpen" }] : []));
3356
3358
  $isRangeSelection = input(false, ...(ngDevMode ? [{ debugName: "$isRangeSelection" }] : []));
3359
+ $dateFormat = input(undefined, ...(ngDevMode ? [{ debugName: "$dateFormat" }] : []));
3357
3360
  $dividePattern = input('/', ...(ngDevMode ? [{ debugName: "$dividePattern" }] : []));
3358
3361
  $minDate = input(undefined, ...(ngDevMode ? [{ debugName: "$minDate" }] : []));
3359
3362
  $maxDate = input(undefined, ...(ngDevMode ? [{ debugName: "$maxDate" }] : []));
@@ -3372,7 +3375,7 @@ class UIInputDateDirective extends UiInputDirective {
3372
3375
  return day + pattern + month + pattern + date.getFullYear();
3373
3376
  }
3374
3377
  isUsaDateFormat() {
3375
- return DateUtils.isUsaDateFormat();
3378
+ return DateUtils.isUsaDateFormat(this.$dateFormat());
3376
3379
  }
3377
3380
  setRangeDates(dates) {
3378
3381
  if (!dates.start) {
@@ -3435,14 +3438,14 @@ class UIInputDateDirective extends UiInputDirective {
3435
3438
  return formatSingle(limited);
3436
3439
  }
3437
3440
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UIInputDateDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3438
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.1", type: UIInputDateDirective, isStandalone: true, selector: "app-ui-input-date", inputs: { $isRangeSelection: { classPropertyName: "$isRangeSelection", publicName: "$isRangeSelection", isSignal: true, isRequired: false, transformFunction: null }, $dividePattern: { classPropertyName: "$dividePattern", publicName: "$dividePattern", 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 } }, viewQueries: [{ propertyName: "$inputElement", first: true, predicate: ["input"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
3441
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.1", type: UIInputDateDirective, isStandalone: true, selector: "app-ui-input-date", inputs: { $isRangeSelection: { classPropertyName: "$isRangeSelection", publicName: "$isRangeSelection", isSignal: true, isRequired: false, transformFunction: null }, $dateFormat: { classPropertyName: "$dateFormat", publicName: "$dateFormat", isSignal: true, isRequired: false, transformFunction: null }, $dividePattern: { classPropertyName: "$dividePattern", publicName: "$dividePattern", 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 } }, viewQueries: [{ propertyName: "$inputElement", first: true, predicate: ["input"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
3439
3442
  }
3440
3443
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UIInputDateDirective, decorators: [{
3441
3444
  type: Directive,
3442
3445
  args: [{
3443
3446
  selector: 'app-ui-input-date',
3444
3447
  }]
3445
- }], propDecorators: { $isRangeSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "$isRangeSelection", required: false }] }], $dividePattern: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dividePattern", required: false }] }], $minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$minDate", required: false }] }], $maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$maxDate", required: false }] }], $inputElement: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }] } });
3448
+ }], propDecorators: { $isRangeSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "$isRangeSelection", required: false }] }], $dateFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dateFormat", required: false }] }], $dividePattern: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dividePattern", required: false }] }], $minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$minDate", required: false }] }], $maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$maxDate", required: false }] }], $inputElement: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }] } });
3446
3449
 
3447
3450
  class UIPhoneNumberDirective extends UiInputDirective {
3448
3451
  $selectedCountry = signal(emptyCountry, ...(ngDevMode ? [{ debugName: "$selectedCountry" }] : []));
@@ -3601,6 +3604,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
3601
3604
  }] } });
3602
3605
 
3603
3606
  class UiInputTimeDirective extends UiInputDirective {
3607
+ $timeFormat = input(undefined, ...(ngDevMode ? [{ debugName: "$timeFormat" }] : []));
3604
3608
  get times() {
3605
3609
  const items = [];
3606
3610
  for (let hour = 0; hour < 24; hour++) {
@@ -3610,7 +3614,7 @@ class UiInputTimeDirective extends UiInputDirective {
3610
3614
  return items;
3611
3615
  }
3612
3616
  get inputMode() {
3613
- return this.uses12HourTime() ? 'text' : 'numeric';
3617
+ return this.is12HourFormat() ? 'text' : 'numeric';
3614
3618
  }
3615
3619
  $inputElement = viewChild('input', ...(ngDevMode ? [{ debugName: "$inputElement" }] : []));
3616
3620
  $isOpen = signal(false, ...(ngDevMode ? [{ debugName: "$isOpen" }] : []));
@@ -3628,7 +3632,7 @@ class UiInputTimeDirective extends UiInputDirective {
3628
3632
  const oldMeridiemLength = this.extractMeridiem(oldValue).length;
3629
3633
  const newMeridiemLength = this.extractMeridiem(newValue).length;
3630
3634
  const meridiemAdded = newMeridiemLength > oldMeridiemLength;
3631
- const meridiemFormatted = this.uses12HourTime() && oldValue !== newValue;
3635
+ const meridiemFormatted = this.is12HourFormat() && oldValue !== newValue;
3632
3636
  super.onInput(newValue);
3633
3637
  inputElement.value = newValue;
3634
3638
  if (colonAdded || meridiemAdded || meridiemFormatted) {
@@ -3642,7 +3646,7 @@ class UiInputTimeDirective extends UiInputDirective {
3642
3646
  if (!value) {
3643
3647
  return '';
3644
3648
  }
3645
- if (this.uses12HourTime()) {
3649
+ if (this.is12HourFormat()) {
3646
3650
  return this.mask12HourTime(value);
3647
3651
  }
3648
3652
  const digits = value.replace(/\D/g, '').slice(0, 4);
@@ -3731,11 +3735,11 @@ class UiInputTimeDirective extends UiInputDirective {
3731
3735
  }
3732
3736
  return '';
3733
3737
  }
3734
- uses12HourTime() {
3735
- return new Intl.DateTimeFormat(undefined, { hour: 'numeric' }).resolvedOptions().hour12 ?? false;
3738
+ is12HourFormat() {
3739
+ return this.$timeFormat() === '12h';
3736
3740
  }
3737
3741
  formatTime(hour, minute) {
3738
- if (!this.uses12HourTime()) {
3742
+ if (!this.is12HourFormat()) {
3739
3743
  return `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;
3740
3744
  }
3741
3745
  const period = hour >= 12 ? 'PM' : 'AM';
@@ -3743,14 +3747,14 @@ class UiInputTimeDirective extends UiInputDirective {
3743
3747
  return `${normalizedHour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')} ${period}`;
3744
3748
  }
3745
3749
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiInputTimeDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3746
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.1", type: UiInputTimeDirective, isStandalone: true, selector: "app-ui-input-time", viewQueries: [{ propertyName: "$inputElement", first: true, predicate: ["input"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
3750
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.1", type: UiInputTimeDirective, isStandalone: true, selector: "app-ui-input-time", inputs: { $timeFormat: { classPropertyName: "$timeFormat", publicName: "$timeFormat", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "$inputElement", first: true, predicate: ["input"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
3747
3751
  }
3748
3752
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiInputTimeDirective, decorators: [{
3749
3753
  type: Directive,
3750
3754
  args: [{
3751
3755
  selector: 'app-ui-input-time',
3752
3756
  }]
3753
- }], propDecorators: { $inputElement: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }] } });
3757
+ }], propDecorators: { $timeFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "$timeFormat", required: false }] }], $inputElement: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }] } });
3754
3758
 
3755
3759
  class UiValidationErrorsDirective {
3756
3760
  $isError = input(false, ...(ngDevMode ? [{ debugName: "$isError" }] : []));
@@ -3767,7 +3771,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
3767
3771
 
3768
3772
  class UiTimeDropdownDirective {
3769
3773
  $close = signal(false, ...(ngDevMode ? [{ debugName: "$close" }] : []));
3770
- is12HourFormat = new Intl.DateTimeFormat(undefined, { hour: 'numeric' }).resolvedOptions().hour12 ?? false;
3771
3774
  $hourForm = signal('', ...(ngDevMode ? [{ debugName: "$hourForm" }] : []));
3772
3775
  $minuteForm = signal('', ...(ngDevMode ? [{ debugName: "$minuteForm" }] : []));
3773
3776
  $periodForm = signal('', ...(ngDevMode ? [{ debugName: "$periodForm" }] : []));
@@ -3776,39 +3779,28 @@ class UiTimeDropdownDirective {
3776
3779
  $period = form(this.$periodForm);
3777
3780
  action = () => { };
3778
3781
  initialValue = null;
3782
+ timeFormat = undefined;
3783
+ get is12HourFormat() {
3784
+ return this.timeFormat === '12h';
3785
+ }
3779
3786
  ngOnInit() {
3780
3787
  this.setInitialTime();
3781
3788
  }
3782
- onHourInput(event) {
3783
- const inputElement = event.target;
3784
- if (!inputElement) {
3785
- return;
3786
- }
3787
- const newValue = this.normalizeHourInput(inputElement.value);
3788
- inputElement.value = newValue;
3789
+ onHourInput(_) {
3790
+ const newValue = this.normalizeHourInput(this.$hour().value());
3789
3791
  this.$hour().value.set(newValue);
3790
3792
  this.emitTime();
3791
3793
  }
3792
- onMinuteInput(event) {
3793
- const inputElement = event.target;
3794
- if (!inputElement) {
3795
- return;
3796
- }
3797
- const newValue = this.normalizeMinuteInput(inputElement.value);
3798
- inputElement.value = newValue;
3794
+ onMinuteInput(_) {
3795
+ const newValue = this.normalizeMinuteInput(this.$minute().value());
3799
3796
  this.$minute().value.set(newValue);
3800
3797
  this.emitTime();
3801
3798
  }
3802
- onPeriodInput(event) {
3799
+ onPeriodInput(_) {
3803
3800
  if (!this.is12HourFormat) {
3804
3801
  return;
3805
3802
  }
3806
- const inputElement = event.target;
3807
- if (!inputElement) {
3808
- return;
3809
- }
3810
- const newValue = this.normalizePeriodInput(inputElement.value);
3811
- inputElement.value = newValue;
3803
+ const newValue = this.normalizePeriodInput(this.$period().value());
3812
3804
  this.$period().value.set(newValue);
3813
3805
  this.emitTime();
3814
3806
  }
@@ -4006,7 +3998,7 @@ class UiTimeDropdownDirective {
4006
3998
  this.action(time);
4007
3999
  }
4008
4000
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiTimeDropdownDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
4009
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: UiTimeDropdownDirective, isStandalone: true, selector: "app-ui-time-dropdown", inputs: { action: "action", initialValue: "initialValue" }, ngImport: i0 });
4001
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: UiTimeDropdownDirective, isStandalone: true, selector: "app-ui-time-dropdown", inputs: { action: "action", initialValue: "initialValue", timeFormat: "timeFormat" }, ngImport: i0 });
4010
4002
  }
4011
4003
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiTimeDropdownDirective, decorators: [{
4012
4004
  type: Directive,
@@ -4017,6 +4009,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
4017
4009
  type: Input
4018
4010
  }], initialValue: [{
4019
4011
  type: Input
4012
+ }], timeFormat: [{
4013
+ type: Input
4020
4014
  }] } });
4021
4015
 
4022
4016
  /*