@odx/angular 12.21.0 → 12.21.2

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/cdk/date-input/index.d.ts +1 -0
  3. package/cdk/date-input/lib/utils/ngx-mask-init.d.ts +3 -0
  4. package/components/datepicker/lib/directives/datepicker-input-control.directive.d.ts +4 -16
  5. package/components/daterangepicker/lib/directives/daterangepicker-input-control.directive.d.ts +4 -16
  6. package/components/timepicker/lib/directives/timepicker-input-control.directive.d.ts +6 -15
  7. package/components/timepicker/lib/timepicker.service.d.ts +5 -4
  8. package/esm2022/cdk/date-input/index.mjs +2 -1
  9. package/esm2022/cdk/date-input/lib/utils/ngx-mask-init.mjs +22 -0
  10. package/esm2022/components/datepicker/lib/datepicker.component.mjs +3 -2
  11. package/esm2022/components/datepicker/lib/directives/datepicker-input-control.directive.mjs +8 -23
  12. package/esm2022/components/daterangepicker/lib/daterangepicker.component.mjs +4 -2
  13. package/esm2022/components/daterangepicker/lib/directives/daterangepicker-input-control.directive.mjs +8 -23
  14. package/esm2022/components/timepicker/lib/directives/timepicker-input-control.directive.mjs +17 -37
  15. package/esm2022/components/timepicker/lib/timepicker.component.mjs +21 -6
  16. package/esm2022/components/timepicker/lib/timepicker.service.mjs +42 -15
  17. package/esm2022/localization/lib/localization.service.mjs +5 -2
  18. package/fesm2022/odx-angular-cdk-date-input.mjs +23 -2
  19. package/fesm2022/odx-angular-cdk-date-input.mjs.map +1 -1
  20. package/fesm2022/odx-angular-components-datepicker.mjs +10 -24
  21. package/fesm2022/odx-angular-components-datepicker.mjs.map +1 -1
  22. package/fesm2022/odx-angular-components-daterangepicker.mjs +11 -24
  23. package/fesm2022/odx-angular-components-daterangepicker.mjs.map +1 -1
  24. package/fesm2022/odx-angular-components-timepicker.mjs +113 -90
  25. package/fesm2022/odx-angular-components-timepicker.mjs.map +1 -1
  26. package/fesm2022/odx-angular-localization.mjs +4 -1
  27. package/fesm2022/odx-angular-localization.mjs.map +1 -1
  28. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-components-daterangepicker.mjs","sources":["../../../../libs/angular/components/daterangepicker/src/lib/directives/daterangepicker-input-control.directive.ts","../../../../libs/angular/components/daterangepicker/src/lib/daterangepicker.component.ts","../../../../libs/angular/components/daterangepicker/src/lib/daterangepicker.component.html","../../../../libs/angular/components/daterangepicker/src/lib/range.validator.ts","../../../../libs/angular/components/daterangepicker/src/lib/required.validator.ts","../../../../libs/angular/components/daterangepicker/src/lib/daterangepicker.module.ts","../../../../libs/angular/components/daterangepicker/src/odx-angular-components-daterangepicker.ts"],"sourcesContent":["import { Directive, EventEmitter, HostListener, inject, Output } from '@angular/core';\nimport { ReadonlyController, WithTabIndex } from '@odx/angular';\nimport { InputControlDirective } from '@odx/angular/cdk/custom-form-control';\nimport { getDateInputFormat, getDateInputMask, getDateInputValueAsDate, injectDateConfig } from '@odx/angular/cdk/date-input';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { NgxMaskConfig, NgxMaskPipe, provideNgxMask } from 'ngx-mask';\nimport { distinctUntilChanged, fromEvent, map, tap } from 'rxjs';\n\n/**\n * Enhances an input element to support date range picking, applying an input mask for date formatting\n * and managing focus events. This directive is typically used within a date range picker to provide\n * consistent and configurable input behavior. Extends the `InputControlDirective` to provide form control.\n * Has host directive `WithTabIndex` to manage the tab index attribute of the input element.\n *\n * @see {InputControlDirective}\n */\n@CSSComponent('daterangepicker__control')\n@Directive({\n standalone: true,\n selector: 'input[odxDaterangepickerControl],input[odxDaterangepickerStartDateControl], input[odxDaterangepickerEndDateControl]',\n host: {\n '[attr.readonly]': 'readonlyController?.readonly || null',\n '[attr.placeholder]': 'placeholder',\n },\n providers: [ReadonlyController.connect(), provideNgxMask(), NgxMaskPipe],\n hostDirectives: [WithTabIndex],\n})\nexport class DaterangepickerInputControlDirective extends InputControlDirective {\n private readonly maskConfig: Partial<NgxMaskConfig> = { validation: false, leadZeroDateTime: true };\n\n protected readonly readonlyController = ReadonlyController.inject();\n protected readonly config = injectDateConfig();\n protected readonly inputMask = getDateInputMask(this.config);\n protected readonly ngxMaskPipe = inject(NgxMaskPipe);\n\n /**\n * Emits an event when the input gains or loses focus, facilitating external event handling.\n *\n * @emits {boolean} - Indicates whether the input is focused.\n */\n @Output()\n public focused = new EventEmitter<boolean>();\n\n /**\n * Captures and processes changes to the input element's value, applying the mask and updating\n * the form control.\n *\n * @emits {string} - The updated value of the input element.\n */\n public override valueChange$ = fromEvent(this.element.nativeElement, 'input').pipe(\n distinctUntilChanged(),\n tap(() => this.applyMask()),\n map(() => this.nativeElementValue),\n );\n\n /**\n * Applies the configured input mask to the native input element's value.\n */\n public applyMask(): void {\n this.nativeElementValue = this.ngxMaskPipe.transform(this.nativeElementValue, this.inputMask, this.maskConfig);\n }\n\n /**\n * Converts the current input value to a Date object based on the configuration's date format.\n *\n * @returns {Date | null} The parsed date object or null if the input does not represent a valid date.\n */\n public get valueAsDate(): Date | null {\n return getDateInputValueAsDate(this.config, this.nativeElementValue);\n }\n\n /**\n * Provides the placeholder text for the input, typically the date format in uppercase.\n *\n * @returns {string} The placeholder text for the input.\n */\n public get placeholder(): string {\n return getDateInputFormat(this.config).toUpperCase();\n }\n\n @HostListener('focusin')\n protected handleFocusIn(): void {\n this.focused.emit(true);\n }\n\n @HostListener('focusout')\n protected handleFocusOut(): void {\n this.focused.emit(false);\n }\n}\n","import { A11yModule } from '@angular/cdk/a11y';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n HostListener,\n input,\n Input,\n Output,\n QueryList,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { detectControllerChanges } from '@odx/angular';\nimport { CustomFormControl } from '@odx/angular/cdk/custom-form-control';\nimport { getDateInputFormat, injectDateConfig } from '@odx/angular/cdk/date-input';\nimport { ActionGroupComponent } from '@odx/angular/components/action-group';\nimport { ButtonComponent } from '@odx/angular/components/button';\nimport { CalendarComponent, CalendarSelectionMode, DateFilter, DateRange, provideCalendarConfig } from '@odx/angular/components/calendar';\nimport { DropdownDirective, DropdownModule } from '@odx/angular/components/dropdown';\nimport { IconComponent } from '@odx/angular/components/icon';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { deferFn, injectElement, Position, untilDestroyed } from '@odx/angular/utils';\nimport { format, startOfDay } from 'date-fns';\nimport { DaterangepickerInputControlDirective } from './directives';\n\n/**\n * A component for selecting a date range, integrated with dropdowns and input fields for start and end dates.\n * It supports custom configurations for minimum, maximum dates, and date filters. The component also handles\n * the dropdown's behavior for date selection and applies date formats automatically based on configuration.\n * The component extends the `CustomFormControl` class to provide form control functionality.\n *\n * @see {CustomFormControl}\n */\n@CSSComponent('daterangepicker')\n@Component({\n selector: 'odx-daterangepicker',\n standalone: true,\n imports: [A11yModule, ActionGroupComponent, ButtonComponent, CalendarComponent, DropdownModule, IconComponent],\n templateUrl: './daterangepicker.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n provideCalendarConfig({\n displayAdjacentDays: false,\n selectionMode: CalendarSelectionMode.DateRange,\n }),\n ],\n})\nexport class DaterangepickerComponent extends CustomFormControl<DateRange | null> implements AfterViewInit {\n protected readonly takeUntilDestroyed = untilDestroyed();\n\n protected readonly config = injectDateConfig();\n\n public readonly element = injectElement();\n\n /**\n * Indicates whether the dropdown part of the date range picker is open.\n *\n * @type {boolean}\n */\n public get isOpen(): boolean {\n return !!this.dropdown.isOpen;\n }\n\n /**\n * Represents today's date, used for default selections and validations.\n *\n * @type {Date}\n */\n public today = new Date();\n\n /**\n * A function that defines additional rules for disabled dates within the picker.\n *\n * @type {DateFilter | null}\n * @default null\n *\n * @example\n * ```ts\n * // Disables all Wednesdays in the picker.\n * const filterFn: DateFilter = (date: Date) => date.getDay() !== 3;\n * ```\n */\n @Input()\n public filterFn: DateFilter | null = null;\n\n /**\n * The earliest date that can be selected in the picker.\n *\n * @type {Date | null}\n * @default null\n */\n @Input()\n public minDate: Date | null = null;\n\n /**\n * The latest date that can be selected in the picker.\n *\n * @type {Date | null}\n * @default null\n */\n @Input()\n public maxDate: Date | null = null;\n\n /**\n * Position of the dropdown relative to the input fields.\n *\n * @type {Position}\n * @default Position.BOTTOM\n */\n @Input()\n public dropdownPosition: Position = 'bottom';\n\n /**\n * When set to true, the select will display a reset button.\n *\n * @type {boolean}\n * @default false\n */\n public clearable = input(false, { transform: booleanAttribute });\n\n /**\n * Emits the selected date range when it changes.\n *\n * @emits {DateRange}\n */\n @Output()\n public selectedChange = new EventEmitter<DateRange>();\n\n /**\n * Directive managing the dropdown functionality.\n *\n * @type {DropdownDirective}\n */\n @ViewChild(DropdownDirective)\n public dropdown!: DropdownDirective;\n\n /**\n * Reference to the element triggering the dropdown.\n *\n * @type {ElementRef<HTMLElement>}\n */\n @ViewChild('dropdownTrigger', { read: ElementRef, static: true })\n public dropdownTriggerElement!: ElementRef<HTMLElement>;\n\n /**\n * Query list of the input controls within the date range picker.\n *\n * @type {QueryList<DaterangepickerInputControlDirective>}\n */\n @ContentChildren(DaterangepickerInputControlDirective)\n public dateFields!: QueryList<DaterangepickerInputControlDirective>;\n\n /**\n * Reference to the element mirroring the start date input field.\n *\n * @type {ElementRef<HTMLElement>}\n */\n @ViewChild('startDateMirror', { read: ElementRef, static: true })\n public startDateMirror!: ElementRef<HTMLElement>;\n\n /**\n * Reference to the element mirroring the end date input field.\n *\n * @type {ElementRef<HTMLElement>}\n */\n @ViewChild('endDateMirror', { read: ElementRef, static: true })\n public endDateMirror!: ElementRef<HTMLElement>;\n\n /**\n * The input control for the start date.\n *\n * @type {DaterangepickerInputControlDirective | undefined}\n */\n public get startDateField(): DaterangepickerInputControlDirective | undefined {\n const [startDate, _endDate] = this.dateFields;\n return startDate;\n }\n\n /**\n * The input control for the end date.\n *\n * @type {DaterangepickerInputControlDirective | undefined}\n */\n public get endDateField(): DaterangepickerInputControlDirective | undefined {\n const [_startDate, endDate] = this.dateFields;\n return endDate;\n }\n\n constructor() {\n super(null);\n detectControllerChanges(this).subscribe();\n }\n\n public ngAfterViewInit(): void {\n this.updateWidth(this.startDateField, this.startDateMirror);\n this.updateWidth(this.endDateField, this.endDateMirror);\n this.handleDateFieldChanges();\n this.handleDateFieldFocus();\n this.updateInputFields();\n }\n\n /**\n * Selects a date range, updates the form value, and emits the selected range.\n *\n * @param {DateRange | null} value - The date range to select.\n */\n public selectDateRange(value: DateRange | null): void {\n if (!value || !value.start || !value.end) return;\n\n this.updateInternalValue(value);\n\n this.selectedChange.emit(value);\n this.dropdown.close();\n }\n\n /**\n * Resets the daterangepicker's value to an empty date range (both start and end as null).\n */\n public reset(): void {\n this.updateInternalValue({ start: null, end: null });\n }\n\n /**\n * @internal\n * Writes a new value to the element.\n * Part of the ControlValueAccessor interface.\n * @param {DateRange | null} value - The new date range value.\n */\n public override writeValue(value: DateRange | null): void {\n super.writeValue(value);\n this.updateInputFields();\n }\n\n /**\n * Opens the date range picker dropdown.\n *\n * @param {KeyboardEvent} event\n */\n @HostListener('keydown.alt.ArrowDown', ['$event'])\n public openDaterangepicker(event?: KeyboardEvent) {\n event?.stopPropagation();\n\n if (this.isReadonly || this.isDisabled) return;\n\n this.dropdown.open(event);\n }\n\n protected isEmpty(value: DateRange | null): boolean {\n return !value || !value.start || !value.end;\n }\n\n protected updateInternalValue(value: DateRange): void {\n this.updateValue(value);\n this.updateStartDateField(value.start);\n this.updateEndDateField(value.end);\n }\n\n protected handleDateFieldChanges(): void {\n this.startDateField?.valueChange$.pipe(this.takeUntilDestroyed()).subscribe((value) => {\n this.updateWidth(this.startDateField, this.startDateMirror, value);\n this.updateValue({ start: this.startDateField?.valueAsDate ?? null, end: this.endDateField?.valueAsDate ?? null });\n });\n this.endDateField?.valueChange$.pipe(this.takeUntilDestroyed()).subscribe((value) => {\n this.updateWidth(this.endDateField, this.endDateMirror, value);\n this.updateValue({ start: this.startDateField?.valueAsDate ?? null, end: this.endDateField?.valueAsDate ?? null });\n });\n }\n\n protected updateWidth(target: DaterangepickerInputControlDirective | undefined, source: ElementRef<HTMLElement>, value = ''): void {\n const compensationPx = 2;\n source.nativeElement.textContent = value || target?.placeholder || null;\n if (target) {\n deferFn(() => (target.element.nativeElement.style.width = `${source.nativeElement.offsetWidth + compensationPx}px`));\n }\n }\n\n protected handleDateFieldFocus(): void {\n this.startDateField?.focused.pipe(this.takeUntilDestroyed()).subscribe((isFocused) => {\n if (!isFocused) {\n this.onTouched();\n }\n if (this.isOpen) {\n this.dropdown.close();\n }\n });\n this.endDateField?.focused.pipe(this.takeUntilDestroyed()).subscribe((isFocused) => {\n if (!isFocused) {\n this.onTouched();\n }\n if (this.isOpen) {\n this.dropdown.close();\n }\n });\n }\n\n private updateStartDateField(date: Date | null): void {\n if (!this.startDateField) return;\n\n const dateFormat = getDateInputFormat(this.config);\n this.startDateField.nativeElementValue = date ? format(date, dateFormat) : '';\n this.updateWidth(this.startDateField, this.startDateMirror, date ? format(date, dateFormat) : '');\n }\n\n private updateEndDateField(date: Date | null): void {\n if (!this.endDateField) return;\n\n const dateFormat = getDateInputFormat(this.config);\n this.endDateField.nativeElementValue = date ? format(date, dateFormat) : '';\n this.updateWidth(this.endDateField, this.endDateMirror, date ? format(date, dateFormat) : '');\n }\n\n private updateInputFields(): void {\n deferFn(() => {\n if (this.value === null) return this.reset();\n if (!this.value || !this.value.start || !this.value.end) return;\n this.updateStartDateField(startOfDay(this.value.start));\n this.updateEndDateField(startOfDay(this.value.end));\n });\n }\n}\n","<span #startDateMirror role=\"none\" class=\"odx-daterangepicker__mirror\"></span>\n<ng-content select=\"input[odxDaterangepickerStartDateControl]\" />\n<span role=\"none\" class=\"odx-daterangepicker__separator\">–</span>\n<span #endDateMirror role=\"none\" class=\"odx-daterangepicker__mirror\"></span>\n<ng-content select=\"input[odxDaterangepickerEndDateControl]\" />\n\n<odx-action-group class=\"odx-daterangepicker__trigger-wrapper\">\n @if (clearable() && !isEmpty(value)) {\n <button class=\"odx-daterangepicker__clear\" (click)=\"reset()\" odxButton size=\"small\" aria-label=\"Reset time\">\n <odx-icon name=\"close\" iconSet=\"core\" />\n </button>\n }\n <button\n #dropdownTrigger\n odxButton\n size=\"small\"\n variant=\"ghost\"\n class=\"odx-daterangepicker__trigger\"\n [odxDropdown]=\"calendarOverlay\"\n [odxDropdownOptions]=\"{ position: dropdownPosition }\"\n [odxDropdownTriggerElement]=\"dropdownTriggerElement.nativeElement\"\n [odxDropdownHost]=\"null\"\n [odxDropdownReferenceElement]=\"element.nativeElement\"\n (odxDropdownBeforeClose)=\"onTouched()\"\n >\n <odx-icon name=\"calendar\" />\n </button>\n <ng-content select=\"[odxButton]\" ngProjectAs=\"[odxButton]\" />\n</odx-action-group>\n\n<ng-template #calendarOverlay>\n <odx-calendar\n [selectedDate]=\"today\"\n [selectedDateRange]=\"value\"\n (selectedDateRangeChange)=\"selectDateRange($event)\"\n [filterFn]=\"filterFn\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n />\n</ng-template>\n","import { Directive, forwardRef } from '@angular/core';\nimport { FormControl, NG_VALIDATORS } from '@angular/forms';\nimport { DateRange, validateDaterange } from '@odx/angular/components/calendar';\n\n/**\n * A validation directive to be used with date range picker controls. This validator ensures that the date range\n * selected is valid, meaning the start date must occur on or before the end date. If the date range is invalid,\n * this validator will provide a validation error that can be used to display an appropriate message or to style\n * the form control.\n *\n * The validator is designed to be used with form controls that manage `DateRange` objects in Angular forms.\n */\n@Directive({\n standalone: true,\n selector: 'odx-daterangepicker[formControlName], odx-daterangepicker[formControl], odx-daterangepicker[ngModel]',\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DaterangepickerRangeValidator),\n multi: true,\n },\n ],\n})\nexport class DaterangepickerRangeValidator {\n /**\n * Performs the validation check on the form control's value.\n *\n * @param {FormControl<DateRange | null>} control - The form control instance associated with the date range input.\n * @returns {ValidationErrors | null} An object expressing validation errors if the range is invalid,\n * or null if the range is valid. The object returned in case of a validation error is `{ invalidRange: true }`.\n */\n public validate({ value }: FormControl<DateRange | null>) {\n const valuesArePresent = value && value.start && value.end;\n\n const isValidRange = value && value.start && value.end && validateDaterange(value.start, value.end);\n\n return (\n valuesArePresent &&\n !isValidRange && {\n invalidRange: true,\n }\n );\n }\n}\n","import { Directive, forwardRef } from '@angular/core';\nimport { FormControl, NG_VALIDATORS } from '@angular/forms';\nimport { DateRange } from '@odx/angular/components/calendar';\n\n/**\n * A validation directive to ensure that both start and end dates are provided for a date range picker.\n * This validator is essential for forms where the date range is a required field. It checks that both the\n * start and end date values exist in the date range object. If one or both dates are missing, it flags the\n * form control as having a validation error.\n */\n@Directive({\n standalone: true,\n selector: 'odx-daterangepicker[required][formControlName], odx-daterangepicker[required][formControl], odx-daterangepicker[required][ngModel]',\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DaterangepickerRequiredValidator),\n multi: true,\n },\n ],\n})\nexport class DaterangepickerRequiredValidator {\n /**\n * Validates the form control associated with the date range input.\n * Checks if both start and end dates are present. If either is missing, it returns a validation error.\n *\n * @param {FormControl<DateRange | null>} control - The form control instance that contains the date range value.\n * @returns {ValidationErrors | null} An object expressing validation errors if the range is incomplete,\n * or null if the range is fully specified. If validation fails, the object returned is `{ required: true }`.\n */\n public validate({ value }: FormControl<DateRange | null>) {\n const isValid = value && value.start && value.end;\n\n return (\n !isValid && {\n required: true,\n }\n );\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { DaterangepickerComponent } from './daterangepicker.component';\nimport { DaterangepickerInputControlDirective } from './directives';\nimport { DaterangepickerRangeValidator } from './range.validator';\nimport { DaterangepickerRequiredValidator } from './required.validator';\n\nconst modules = [DaterangepickerComponent, DaterangepickerInputControlDirective, DaterangepickerRangeValidator, DaterangepickerRequiredValidator];\n\n@NgModule({\n imports: modules,\n exports: [CoreModule, ...modules],\n})\nexport class DaterangepickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAQA;;;;;;;AAOG;AAYI,IAAM,oCAAoC,GAA1C,MAAM,oCAAqC,SAAQ,qBAAqB,CAAA;AAAxE,IAAA,WAAA,GAAA;;QACY,IAAU,CAAA,UAAA,GAA2B,EAAE,UAAU,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC;AAEjF,QAAA,IAAA,CAAA,kBAAkB,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC;QACjD,IAAM,CAAA,MAAA,GAAG,gBAAgB,EAAE,CAAC;AAC5B,QAAA,IAAA,CAAA,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC1C,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAErD;;;;AAIG;AAEI,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,YAAY,EAAW,CAAC;AAE7C;;;;;AAKG;AACa,QAAA,IAAA,CAAA,YAAY,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAChF,oBAAoB,EAAE,EACtB,GAAG,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,EAC3B,GAAG,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,CACnC,CAAC;AAoCH,KAAA;AAlCC;;AAEG;IACI,SAAS,GAAA;QACd,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;KAChH;AAED;;;;AAIG;AACH,IAAA,IAAW,WAAW,GAAA;QACpB,OAAO,uBAAuB,CAAC,IAAI,CAAC,MAA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oBAAA,QAAQ,EAAE,oIAAoI;AAC9I,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,aAAa;AACtB,4BAAA,WAAW,EAAE,UAAU,CAAC,sCAAsC,CAAC;AAC/D,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA;AACF,iBAAA,CAAA;;;ACbD,MAAM,OAAO,GAAG,CAAC,wBAAwB,EAAE,oCAAoC,EAAE,6BAA6B,EAAE,gCAAgC,CAAC,CAAC;MAMrI,qBAAqB,CAAA;+GAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YANjB,wBAAwB,EAAE,oCAAoC,EAAE,6BAA6B,EAAE,gCAAgC,CAIpI,EAAA,OAAA,EAAA,CAAA,UAAU,EAJL,wBAAwB,EAAE,oCAAoC,EAAE,6BAA6B,EAAE,gCAAgC,CAAA,EAAA,CAAA,CAAA,EAAA;gHAMnI,qBAAqB,EAAA,OAAA,EAAA,CANjB,wBAAwB,EAI7B,UAAU,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAET,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,OAAO;AAChB,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,GAAG,OAAO,CAAC;AAClC,iBAAA,CAAA;;;ACZD;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-components-daterangepicker.mjs","sources":["../../../../libs/angular/components/daterangepicker/src/lib/directives/daterangepicker-input-control.directive.ts","../../../../libs/angular/components/daterangepicker/src/lib/daterangepicker.component.ts","../../../../libs/angular/components/daterangepicker/src/lib/daterangepicker.component.html","../../../../libs/angular/components/daterangepicker/src/lib/range.validator.ts","../../../../libs/angular/components/daterangepicker/src/lib/required.validator.ts","../../../../libs/angular/components/daterangepicker/src/lib/daterangepicker.module.ts","../../../../libs/angular/components/daterangepicker/src/odx-angular-components-daterangepicker.ts"],"sourcesContent":["import { Directive, EventEmitter, HostListener, inject, Output } from '@angular/core';\nimport { ReadonlyController, WithTabIndex } from '@odx/angular';\nimport { InputControlDirective } from '@odx/angular/cdk/custom-form-control';\nimport { getDateInputFormat, getDateInputValueAsDate, injectDateConfig } from '@odx/angular/cdk/date-input';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { NgxMaskDirective, provideNgxMask } from 'ngx-mask';\n\n/**\n * Enhances an input element to support date range picking, applying an input mask for date formatting\n * and managing focus events. This directive is typically used within a date range picker to provide\n * consistent and configurable input behavior. Extends the `InputControlDirective` to provide form control.\n * Has host directive `WithTabIndex` to manage the tab index attribute of the input element.\n *\n * @see {InputControlDirective}\n */\n@CSSComponent('daterangepicker__control')\n@Directive({\n standalone: true,\n selector: 'input[odxDaterangepickerControl],input[odxDaterangepickerStartDateControl], input[odxDaterangepickerEndDateControl]',\n host: {\n '[attr.readonly]': 'readonlyController?.readonly || null',\n '[attr.placeholder]': 'placeholder',\n },\n providers: [ReadonlyController.connect(), provideNgxMask({ validation: false, leadZeroDateTime: true })],\n hostDirectives: [WithTabIndex, NgxMaskDirective],\n})\nexport class DaterangepickerInputControlDirective extends InputControlDirective {\n protected readonly readonlyController = ReadonlyController.inject();\n protected readonly config = injectDateConfig();\n public readonly ngxMaskDirective = inject(NgxMaskDirective);\n\n /**\n * Emits an event when the input gains or loses focus, facilitating external event handling.\n *\n * @emits {boolean} - Indicates whether the input is focused.\n */\n @Output()\n public focused = new EventEmitter<boolean>();\n\n /**\n * Converts the current input value to a Date object based on the configuration's date format.\n *\n * @returns {Date | null} The parsed date object or null if the input does not represent a valid date.\n */\n public get valueAsDate(): Date | null {\n return getDateInputValueAsDate(this.config, this.nativeElementValue);\n }\n\n /**\n * Provides the placeholder text for the input, typically the date format in uppercase.\n *\n * @returns {string} The placeholder text for the input.\n */\n public get placeholder(): string {\n return getDateInputFormat(this.config).toUpperCase();\n }\n\n @HostListener('focusin')\n protected handleFocusIn(): void {\n this.focused.emit(true);\n }\n\n @HostListener('focusout')\n protected handleFocusOut(): void {\n this.focused.emit(false);\n }\n}\n","import { A11yModule } from '@angular/cdk/a11y';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n HostListener,\n input,\n Input,\n Output,\n QueryList,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { detectControllerChanges } from '@odx/angular';\nimport { CustomFormControl } from '@odx/angular/cdk/custom-form-control';\nimport { getDateInputFormat, getDateInputMask, initNgxMask, injectDateConfig } from '@odx/angular/cdk/date-input';\nimport { ActionGroupComponent } from '@odx/angular/components/action-group';\nimport { ButtonComponent } from '@odx/angular/components/button';\nimport { CalendarComponent, CalendarSelectionMode, DateFilter, DateRange, provideCalendarConfig } from '@odx/angular/components/calendar';\nimport { DropdownDirective, DropdownModule } from '@odx/angular/components/dropdown';\nimport { IconComponent } from '@odx/angular/components/icon';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { deferFn, injectElement, Position, untilDestroyed } from '@odx/angular/utils';\nimport { format, startOfDay } from 'date-fns';\nimport { DaterangepickerInputControlDirective } from './directives';\n\n/**\n * A component for selecting a date range, integrated with dropdowns and input fields for start and end dates.\n * It supports custom configurations for minimum, maximum dates, and date filters. The component also handles\n * the dropdown's behavior for date selection and applies date formats automatically based on configuration.\n * The component extends the `CustomFormControl` class to provide form control functionality.\n *\n * @see {CustomFormControl}\n */\n@CSSComponent('daterangepicker')\n@Component({\n selector: 'odx-daterangepicker',\n standalone: true,\n imports: [A11yModule, ActionGroupComponent, ButtonComponent, CalendarComponent, DropdownModule, IconComponent],\n templateUrl: './daterangepicker.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n provideCalendarConfig({\n displayAdjacentDays: false,\n selectionMode: CalendarSelectionMode.DateRange,\n }),\n ],\n})\nexport class DaterangepickerComponent extends CustomFormControl<DateRange | null> implements AfterViewInit {\n protected readonly takeUntilDestroyed = untilDestroyed();\n\n protected readonly config = injectDateConfig();\n\n public readonly element = injectElement();\n\n /**\n * Indicates whether the dropdown part of the date range picker is open.\n *\n * @type {boolean}\n */\n public get isOpen(): boolean {\n return !!this.dropdown.isOpen;\n }\n\n /**\n * Represents today's date, used for default selections and validations.\n *\n * @type {Date}\n */\n public today = new Date();\n\n /**\n * A function that defines additional rules for disabled dates within the picker.\n *\n * @type {DateFilter | null}\n * @default null\n *\n * @example\n * ```ts\n * // Disables all Wednesdays in the picker.\n * const filterFn: DateFilter = (date: Date) => date.getDay() !== 3;\n * ```\n */\n @Input()\n public filterFn: DateFilter | null = null;\n\n /**\n * The earliest date that can be selected in the picker.\n *\n * @type {Date | null}\n * @default null\n */\n @Input()\n public minDate: Date | null = null;\n\n /**\n * The latest date that can be selected in the picker.\n *\n * @type {Date | null}\n * @default null\n */\n @Input()\n public maxDate: Date | null = null;\n\n /**\n * Position of the dropdown relative to the input fields.\n *\n * @type {Position}\n * @default Position.BOTTOM\n */\n @Input()\n public dropdownPosition: Position = 'bottom';\n\n /**\n * When set to true, the select will display a reset button.\n *\n * @type {boolean}\n * @default false\n */\n public clearable = input(false, { transform: booleanAttribute });\n\n /**\n * Emits the selected date range when it changes.\n *\n * @emits {DateRange}\n */\n @Output()\n public selectedChange = new EventEmitter<DateRange>();\n\n /**\n * Directive managing the dropdown functionality.\n *\n * @type {DropdownDirective}\n */\n @ViewChild(DropdownDirective)\n public dropdown!: DropdownDirective;\n\n /**\n * Reference to the element triggering the dropdown.\n *\n * @type {ElementRef<HTMLElement>}\n */\n @ViewChild('dropdownTrigger', { read: ElementRef, static: true })\n public dropdownTriggerElement!: ElementRef<HTMLElement>;\n\n /**\n * Query list of the input controls within the date range picker.\n *\n * @type {QueryList<DaterangepickerInputControlDirective>}\n */\n @ContentChildren(DaterangepickerInputControlDirective)\n public dateFields!: QueryList<DaterangepickerInputControlDirective>;\n\n /**\n * Reference to the element mirroring the start date input field.\n *\n * @type {ElementRef<HTMLElement>}\n */\n @ViewChild('startDateMirror', { read: ElementRef, static: true })\n public startDateMirror!: ElementRef<HTMLElement>;\n\n /**\n * Reference to the element mirroring the end date input field.\n *\n * @type {ElementRef<HTMLElement>}\n */\n @ViewChild('endDateMirror', { read: ElementRef, static: true })\n public endDateMirror!: ElementRef<HTMLElement>;\n\n /**\n * The input control for the start date.\n *\n * @type {DaterangepickerInputControlDirective | undefined}\n */\n public get startDateField(): DaterangepickerInputControlDirective | undefined {\n const [startDate, _endDate] = this.dateFields;\n return startDate;\n }\n\n /**\n * The input control for the end date.\n *\n * @type {DaterangepickerInputControlDirective | undefined}\n */\n public get endDateField(): DaterangepickerInputControlDirective | undefined {\n const [_startDate, endDate] = this.dateFields;\n return endDate;\n }\n\n constructor() {\n super(null);\n detectControllerChanges(this).subscribe();\n }\n\n public ngAfterViewInit(): void {\n this.updateWidth(this.startDateField, this.startDateMirror);\n this.updateWidth(this.endDateField, this.endDateMirror);\n this.handleDateFieldChanges();\n this.handleDateFieldFocus();\n this.updateInputFields();\n }\n\n /**\n * Selects a date range, updates the form value, and emits the selected range.\n *\n * @param {DateRange | null} value - The date range to select.\n */\n public selectDateRange(value: DateRange | null): void {\n if (!value || !value.start || !value.end) return;\n\n this.updateInternalValue(value);\n\n this.selectedChange.emit(value);\n this.dropdown.close();\n }\n\n /**\n * Resets the daterangepicker's value to an empty date range (both start and end as null).\n */\n public reset(): void {\n this.updateInternalValue({ start: null, end: null });\n }\n\n /**\n * @internal\n * Writes a new value to the element.\n * Part of the ControlValueAccessor interface.\n * @param {DateRange | null} value - The new date range value.\n */\n public override writeValue(value: DateRange | null): void {\n super.writeValue(value);\n this.updateInputFields();\n }\n\n /**\n * Opens the date range picker dropdown.\n *\n * @param {KeyboardEvent} event\n */\n @HostListener('keydown.alt.ArrowDown', ['$event'])\n public openDaterangepicker(event?: KeyboardEvent) {\n event?.stopPropagation();\n\n if (this.isReadonly || this.isDisabled) return;\n\n this.dropdown.open(event);\n }\n\n protected isEmpty(value: DateRange | null): boolean {\n return !value || !value.start || !value.end;\n }\n\n protected updateInternalValue(value: DateRange): void {\n this.updateValue(value);\n this.updateStartDateField(value.start);\n this.updateEndDateField(value.end);\n }\n\n protected handleDateFieldChanges(): void {\n initNgxMask(this.startDateField?.ngxMaskDirective, getDateInputMask(this.config));\n initNgxMask(this.endDateField?.ngxMaskDirective, getDateInputMask(this.config));\n this.startDateField?.valueChange$.pipe(this.takeUntilDestroyed()).subscribe((value) => {\n this.updateWidth(this.startDateField, this.startDateMirror, value);\n this.updateValue({ start: this.startDateField?.valueAsDate ?? null, end: this.endDateField?.valueAsDate ?? null });\n });\n this.endDateField?.valueChange$.pipe(this.takeUntilDestroyed()).subscribe((value) => {\n this.updateWidth(this.endDateField, this.endDateMirror, value);\n this.updateValue({ start: this.startDateField?.valueAsDate ?? null, end: this.endDateField?.valueAsDate ?? null });\n });\n }\n\n protected updateWidth(target: DaterangepickerInputControlDirective | undefined, source: ElementRef<HTMLElement>, value = ''): void {\n const compensationPx = 2;\n source.nativeElement.textContent = value || target?.placeholder || null;\n if (target) {\n deferFn(() => (target.element.nativeElement.style.width = `${source.nativeElement.offsetWidth + compensationPx}px`));\n }\n }\n\n protected handleDateFieldFocus(): void {\n this.startDateField?.focused.pipe(this.takeUntilDestroyed()).subscribe((isFocused) => {\n if (!isFocused) {\n this.onTouched();\n }\n if (this.isOpen) {\n this.dropdown.close();\n }\n });\n this.endDateField?.focused.pipe(this.takeUntilDestroyed()).subscribe((isFocused) => {\n if (!isFocused) {\n this.onTouched();\n }\n if (this.isOpen) {\n this.dropdown.close();\n }\n });\n }\n\n private updateStartDateField(date: Date | null): void {\n if (!this.startDateField) return;\n\n const dateFormat = getDateInputFormat(this.config);\n this.startDateField.nativeElementValue = date ? format(date, dateFormat) : '';\n this.updateWidth(this.startDateField, this.startDateMirror, date ? format(date, dateFormat) : '');\n }\n\n private updateEndDateField(date: Date | null): void {\n if (!this.endDateField) return;\n\n const dateFormat = getDateInputFormat(this.config);\n this.endDateField.nativeElementValue = date ? format(date, dateFormat) : '';\n this.updateWidth(this.endDateField, this.endDateMirror, date ? format(date, dateFormat) : '');\n }\n\n private updateInputFields(): void {\n deferFn(() => {\n if (this.value === null) return this.reset();\n if (!this.value || !this.value.start || !this.value.end) return;\n this.updateStartDateField(startOfDay(this.value.start));\n this.updateEndDateField(startOfDay(this.value.end));\n });\n }\n}\n","<span #startDateMirror role=\"none\" class=\"odx-daterangepicker__mirror\"></span>\n<ng-content select=\"input[odxDaterangepickerStartDateControl]\" />\n<span role=\"none\" class=\"odx-daterangepicker__separator\">–</span>\n<span #endDateMirror role=\"none\" class=\"odx-daterangepicker__mirror\"></span>\n<ng-content select=\"input[odxDaterangepickerEndDateControl]\" />\n\n<odx-action-group class=\"odx-daterangepicker__trigger-wrapper\">\n @if (clearable() && !isEmpty(value)) {\n <button class=\"odx-daterangepicker__clear\" (click)=\"reset()\" odxButton size=\"small\" aria-label=\"Reset time\">\n <odx-icon name=\"close\" iconSet=\"core\" />\n </button>\n }\n <button\n #dropdownTrigger\n odxButton\n size=\"small\"\n variant=\"ghost\"\n class=\"odx-daterangepicker__trigger\"\n [odxDropdown]=\"calendarOverlay\"\n [odxDropdownOptions]=\"{ position: dropdownPosition }\"\n [odxDropdownTriggerElement]=\"dropdownTriggerElement.nativeElement\"\n [odxDropdownHost]=\"null\"\n [odxDropdownReferenceElement]=\"element.nativeElement\"\n (odxDropdownBeforeClose)=\"onTouched()\"\n >\n <odx-icon name=\"calendar\" />\n </button>\n <ng-content select=\"[odxButton]\" ngProjectAs=\"[odxButton]\" />\n</odx-action-group>\n\n<ng-template #calendarOverlay>\n <odx-calendar\n [selectedDate]=\"today\"\n [selectedDateRange]=\"value\"\n (selectedDateRangeChange)=\"selectDateRange($event)\"\n [filterFn]=\"filterFn\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n />\n</ng-template>\n","import { Directive, forwardRef } from '@angular/core';\nimport { FormControl, NG_VALIDATORS } from '@angular/forms';\nimport { DateRange, validateDaterange } from '@odx/angular/components/calendar';\n\n/**\n * A validation directive to be used with date range picker controls. This validator ensures that the date range\n * selected is valid, meaning the start date must occur on or before the end date. If the date range is invalid,\n * this validator will provide a validation error that can be used to display an appropriate message or to style\n * the form control.\n *\n * The validator is designed to be used with form controls that manage `DateRange` objects in Angular forms.\n */\n@Directive({\n standalone: true,\n selector: 'odx-daterangepicker[formControlName], odx-daterangepicker[formControl], odx-daterangepicker[ngModel]',\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DaterangepickerRangeValidator),\n multi: true,\n },\n ],\n})\nexport class DaterangepickerRangeValidator {\n /**\n * Performs the validation check on the form control's value.\n *\n * @param {FormControl<DateRange | null>} control - The form control instance associated with the date range input.\n * @returns {ValidationErrors | null} An object expressing validation errors if the range is invalid,\n * or null if the range is valid. The object returned in case of a validation error is `{ invalidRange: true }`.\n */\n public validate({ value }: FormControl<DateRange | null>) {\n const valuesArePresent = value && value.start && value.end;\n\n const isValidRange = value && value.start && value.end && validateDaterange(value.start, value.end);\n\n return (\n valuesArePresent &&\n !isValidRange && {\n invalidRange: true,\n }\n );\n }\n}\n","import { Directive, forwardRef } from '@angular/core';\nimport { FormControl, NG_VALIDATORS } from '@angular/forms';\nimport { DateRange } from '@odx/angular/components/calendar';\n\n/**\n * A validation directive to ensure that both start and end dates are provided for a date range picker.\n * This validator is essential for forms where the date range is a required field. It checks that both the\n * start and end date values exist in the date range object. If one or both dates are missing, it flags the\n * form control as having a validation error.\n */\n@Directive({\n standalone: true,\n selector: 'odx-daterangepicker[required][formControlName], odx-daterangepicker[required][formControl], odx-daterangepicker[required][ngModel]',\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DaterangepickerRequiredValidator),\n multi: true,\n },\n ],\n})\nexport class DaterangepickerRequiredValidator {\n /**\n * Validates the form control associated with the date range input.\n * Checks if both start and end dates are present. If either is missing, it returns a validation error.\n *\n * @param {FormControl<DateRange | null>} control - The form control instance that contains the date range value.\n * @returns {ValidationErrors | null} An object expressing validation errors if the range is incomplete,\n * or null if the range is fully specified. If validation fails, the object returned is `{ required: true }`.\n */\n public validate({ value }: FormControl<DateRange | null>) {\n const isValid = value && value.start && value.end;\n\n return (\n !isValid && {\n required: true,\n }\n );\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { DaterangepickerComponent } from './daterangepicker.component';\nimport { DaterangepickerInputControlDirective } from './directives';\nimport { DaterangepickerRangeValidator } from './range.validator';\nimport { DaterangepickerRequiredValidator } from './required.validator';\n\nconst modules = [DaterangepickerComponent, DaterangepickerInputControlDirective, DaterangepickerRangeValidator, DaterangepickerRequiredValidator];\n\n@NgModule({\n imports: modules,\n exports: [CoreModule, ...modules],\n})\nexport class DaterangepickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA;;;;;;;AAOG;AAYI,IAAM,oCAAoC,GAA1C,MAAM,oCAAqC,SAAQ,qBAAqB,CAAA;AAAxE,IAAA,WAAA,GAAA;;AACc,QAAA,IAAA,CAAA,kBAAkB,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC;QACjD,IAAM,CAAA,MAAA,GAAG,gBAAgB,EAAE,CAAC;AAC/B,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAE5D;;;;AAIG;AAEI,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,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CAAA,EAAA,CAAA,CAAA,EAAA;;4FAET,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,OAAO;AAChB,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,GAAG,OAAO,CAAC;AAClC,iBAAA,CAAA;;;ACZD;;AAEG;;;;"}
@@ -1,18 +1,19 @@
1
1
  import { __decorate, __metadata } from 'tslib';
2
2
  import * as i0 from '@angular/core';
3
- import { InjectionToken, inject, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, Injectable, Directive, input, booleanAttribute, numberAttribute, forwardRef, ViewChild, ViewChildren, Input, HostListener, NgModule } from '@angular/core';
3
+ import { InjectionToken, inject, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, signal, Injectable, Directive, input, booleanAttribute, numberAttribute, forwardRef, ViewChild, ViewChildren, Input, HostListener, NgModule } from '@angular/core';
4
4
  import * as i1 from '@odx/angular';
5
5
  import { DisabledController, detectControllerChanges, WithDisabledState, WindowRef, WithTabIndex, ReadonlyController, CoreModule } from '@odx/angular';
6
6
  import { OptionControl } from '@odx/angular/cdk/option-control';
7
7
  import { CSSComponent } from '@odx/angular/internal';
8
8
  import { InputControlDirective, CustomFormControl } from '@odx/angular/cdk/custom-form-control';
9
- import { NgxMaskPipe, provideNgxMask } from 'ngx-mask';
10
- import { fromEvent, distinctUntilChanged, map } from 'rxjs';
9
+ import { initNgxMask, ngxMaskProviderConfig } from '@odx/angular/cdk/date-input';
10
+ import * as i2 from 'ngx-mask';
11
+ import { NgxMaskDirective, provideNgxMask } from 'ngx-mask';
11
12
  import { isBefore, isEqual, isAfter } from 'date-fns';
12
13
  import { ActiveDescendantKeyManager, A11yModule } from '@angular/cdk/a11y';
13
14
  import { ActionGroupComponent } from '@odx/angular/components/action-group';
14
15
  import { ButtonComponent } from '@odx/angular/components/button';
15
- import * as i2 from '@odx/angular/components/dropdown';
16
+ import * as i2$1 from '@odx/angular/components/dropdown';
16
17
  import { DropdownDirective, DropdownModule } from '@odx/angular/components/dropdown';
17
18
  import { IconComponent } from '@odx/angular/components/icon';
18
19
  import { untilDestroyed, injectElement, isFunction } from '@odx/angular/utils';
@@ -109,14 +110,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
109
110
  class TimepickerService {
110
111
  constructor() {
111
112
  this.windowRef = inject(WindowRef);
113
+ this.useLocale = signal(false);
112
114
  }
113
115
  /**
114
- * Generates a placeholder string for time input fields.
115
- *
116
- * @param {boolean} [apm=false] - Specifies if the placeholder should include AM/PM notation.
117
- * @returns {string} The placeholder string.
116
+ * @deprecated Will be removed in a future major version. Use `useLocale` signal instead.
117
+ * Generates a placeholder string for time input fields, preserving legacy API.
118
118
  */
119
- getPlaceholder(apm = false) {
119
+ getPlaceholder(apm = this.useLocale()) {
120
120
  return apm ? '--:-- --' : '--:--';
121
121
  }
122
122
  /**
@@ -138,11 +138,15 @@ class TimepickerService {
138
138
  * @returns {time is string} True if the value is a valid time string, false otherwise.
139
139
  */
140
140
  isValidTime(time) {
141
- if (!time || typeof time !== 'string')
141
+ if (typeof time !== 'string')
142
+ return false;
143
+ const trimmedTime = time.trim();
144
+ if (!trimmedTime)
142
145
  return false;
143
- // Matches "HH:mm" (24h) or "HH:mm AM/PM" (12h)
144
- const regex = /^([01]\d|2[0-3]):([0-5]\d)(\s?(AM|PM|am|pm))?$/;
145
- return regex.test(time.trim());
146
+ return Boolean(this.parseTimeString(trimmedTime.toUpperCase()));
147
+ }
148
+ is12HourFormat(value) {
149
+ return this.isValidTime(value) && !!this.parseTimeString(value.toUpperCase())?.hour12;
146
150
  }
147
151
  /**
148
152
  * Validates if the given time is greater than or equal to a minimum time constraint.
@@ -183,19 +187,43 @@ class TimepickerService {
183
187
  * @param {boolean} [hour12=false] - Specifies if the output should use 12-hour format with AM/PM notation.
184
188
  * @returns {string} The formatted time string, or an empty string if the input time is invalid.
185
189
  */
186
- getLocalizedTimeFormat(time, hour12 = false) {
190
+ getLocalizedTimeFormat(time, hour12) {
187
191
  if (!this.isValidTime(time))
188
192
  return '';
189
- const locale = hour12 ? 'en-US' : 'en-GB';
193
+ const shouldUseHour12 = typeof hour12 === 'boolean' ? hour12 : this.useLocale();
194
+ const locale = shouldUseHour12 ? 'en-US' : 'en-GB';
190
195
  const [date] = this.convertToDates([time]);
191
196
  return new this.windowRef.nativeWindow.Intl.DateTimeFormat(locale, {
192
197
  hour: '2-digit',
193
198
  minute: '2-digit',
194
- hour12,
199
+ hour12: shouldUseHour12,
195
200
  }).format(date);
196
201
  }
197
202
  convertToDates(times) {
198
- return times.map((time) => new Date(`${time} 2022-12-19`));
203
+ return times.map((time) => {
204
+ if (typeof time !== 'string')
205
+ return new Date(NaN);
206
+ const parsed = this.parseTimeString(time.toUpperCase());
207
+ if (!parsed)
208
+ return new Date(NaN);
209
+ const { hours, minutes } = parsed;
210
+ return new Date(2022, 11, 19, hours, minutes, 0, 0);
211
+ });
212
+ }
213
+ parseTimeString(time) {
214
+ const match = time.trim().match(/^([01]?\d|2[0-3]):([0-5]\d)(?:\s?(AM|PM))?$/);
215
+ if (!match)
216
+ return null;
217
+ let hours = Number(match[1]);
218
+ const minutes = Number(match[2]);
219
+ const period = match[3]?.toUpperCase();
220
+ if (period) {
221
+ if (period === 'PM' && hours < 12)
222
+ hours += 12;
223
+ if (period === 'AM' && hours === 12)
224
+ hours = 0;
225
+ }
226
+ return { hours, minutes, hour12: Boolean(period) };
199
227
  }
200
228
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TimepickerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
201
229
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TimepickerService, providedIn: 'root' }); }
@@ -205,40 +233,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
205
233
  args: [{ providedIn: 'root' }]
206
234
  }] });
207
235
 
208
- /**
209
- * Processes and formats a time input value based on specific rules. It adjusts the input for valid time format,
210
- * especially focusing on single-digit hour inputs, ensuring minute values start with 0 if the last digit is greater
211
- * than 5, and appending 'M' to AM/PM indicators.
212
- *
213
- * @param {string} value - The current input value of the time field.
214
- * @param {InputEvent} event - The input event triggered by the user's interaction with the field.
215
- * @returns {string} The processed and potentially reformatted value.
216
- *
217
- * @example
218
- * ```ts
219
- * // Prepend 0 to single-digit hours greater than 1
220
- * processInputValue("2", { inputType: "insertText" }); // Returns "02"
221
- *
222
- * // Ensure minute values are within valid ranges
223
- * processInputValue("11:8", { inputType: "insertText" }); // Returns "11:08"
224
- *
225
- * // Append 'M' to AM/PM indicators
226
- * processInputValue("2 p", { inputType: "insertText" }); // Returns "2 PM"
227
- * ```
228
- */
229
- function processInputValue(value, event) {
230
- if (value.length === 1 && Number(value) > 1) {
231
- value = `0${value}`;
232
- }
233
- else if (value.length === 4 && Number(value.at(-1)) > 5) {
234
- value = `${value.slice(0, -1)}0${value.slice(-1)}`;
235
- }
236
- if (/[AaPp]/.test(value) && event.inputType === 'insertText') {
237
- value = `${value.toUpperCase()}M`;
238
- }
239
- return value;
240
- }
241
-
242
236
  /**
243
237
  * Directive to enhance a standard input element for time picking, integrating mask functionality for time format.
244
238
  * It automatically adapts to locale settings provided by the enclosing `TimepickerComponent` to display time in the appropriate format.
@@ -250,35 +244,15 @@ let TimepickerInputControlDirective = class TimepickerInputControlDirective exte
250
244
  super(...arguments);
251
245
  this.timepicker = inject(TIMEPICKER_CONTROL);
252
246
  this.timepickerService = inject(TimepickerService);
253
- this.ngxMaskPipe = inject(NgxMaskPipe);
254
- /**
255
- * Stream of value changes for the input element, applying the mask and processing the input based on locale.
256
- */
257
- this.valueChange$ = fromEvent(this.element.nativeElement, 'input').pipe(distinctUntilChanged(), map((event) => this.applyMask(event)));
258
- }
259
- /**
260
- * Configuration for the mask applied to the timepicker input. Adjusts based on locale settings.
261
- *
262
- * @returns {Partial<NgxMaskConfig>} The mask configuration for the timepicker input.
263
- */
264
- get maskConfig() {
265
- return {
266
- validation: false,
267
- apm: this.timepicker.useLocale,
268
- leadZeroDateTime: !this.timepicker.useLocale,
269
- patterns: {
270
- A: { pattern: new RegExp('[AaPp]') },
271
- M: { pattern: new RegExp('M') },
272
- },
273
- };
247
+ this.ngxMaskDirective = inject(NgxMaskDirective, { self: true, optional: true });
274
248
  }
275
249
  /**
276
- * Computes and returns the placeholder text for the input based on locale settings.
250
+ * Returns the placeholder text for the input based on locale settings.
277
251
  *
278
252
  * @returns {string} The placeholder text for the input.
279
253
  */
280
254
  get placeholder() {
281
- return this.timepickerService.getPlaceholder(this.timepicker.useLocale);
255
+ return this.timepickerService.useLocale() ? '--:-- --' : '--:--';
282
256
  }
283
257
  /**
284
258
  * Determines whether the timepicker input is readonly, based on the state of the parent timepicker component.
@@ -294,17 +268,17 @@ let TimepickerInputControlDirective = class TimepickerInputControlDirective exte
294
268
  * @param {Event} event - The input event triggering the mask application.
295
269
  * @returns {string} The masked input value.
296
270
  */
297
- applyMask(event) {
298
- const mask = this.timepicker.useLocale ? 'Hh:m0 AM' : 'Hh:m0';
299
- let value = this.ngxMaskPipe.transform(this.nativeElementValue, mask, this.maskConfig);
300
- if (this.timepicker.useLocale) {
301
- value = processInputValue(value, event);
271
+ applyMask(useLocale) {
272
+ if (!this.ngxMaskDirective)
273
+ return;
274
+ const mask = useLocale ? 'Hh:m0 AM' : 'Hh:m0';
275
+ useLocale !== this.ngxMaskDirective._maskService.apm && (this.ngxMaskDirective._maskService.apm = useLocale);
276
+ if (Object.hasOwn(this.ngxMaskDirective, '_maskValue') && this.ngxMaskDirective['_maskValue'] !== mask) {
277
+ initNgxMask(this.ngxMaskDirective, mask);
302
278
  }
303
- this.nativeElementValue = value;
304
- return value;
305
279
  }
306
280
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TimepickerInputControlDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
307
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: TimepickerInputControlDirective, isStandalone: true, selector: "input[odxTimepickerControl]", host: { properties: { "attr.readonly": "isReadonly || null", "attr.placeholder": "placeholder" } }, providers: [provideNgxMask(), NgxMaskPipe], usesInheritance: true, hostDirectives: [{ directive: i1.WithTabIndex }, { directive: i1.WithDisabledState }], ngImport: i0 }); }
281
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: TimepickerInputControlDirective, isStandalone: true, selector: "input[odxTimepickerControl]", host: { properties: { "attr.readonly": "isReadonly || null", "attr.placeholder": "placeholder" } }, providers: [provideNgxMask(ngxMaskProviderConfig)], usesInheritance: true, hostDirectives: [{ directive: i1.WithTabIndex }, { directive: i1.WithDisabledState }, { directive: i2.NgxMaskDirective }], ngImport: i0 }); }
308
282
  };
309
283
  TimepickerInputControlDirective = __decorate([
310
284
  CSSComponent('timepicker__control')
@@ -318,8 +292,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
318
292
  '[attr.readonly]': 'isReadonly || null',
319
293
  '[attr.placeholder]': 'placeholder',
320
294
  },
321
- providers: [provideNgxMask(), NgxMaskPipe],
322
- hostDirectives: [WithTabIndex, WithDisabledState],
295
+ providers: [provideNgxMask(ngxMaskProviderConfig)],
296
+ hostDirectives: [WithTabIndex, WithDisabledState, NgxMaskDirective],
323
297
  }]
324
298
  }] });
325
299
 
@@ -391,8 +365,10 @@ let TimepickerComponent = class TimepickerComponent extends CustomFormControl {
391
365
  * @default false
392
366
  */
393
367
  set useLocale(val) {
368
+ this.timepickerService.useLocale.set(val);
369
+ this.dateField?.applyMask(val);
394
370
  if (this.value && this.dateField) {
395
- const time = this.timepickerService.getLocalizedTimeFormat(this.value, val);
371
+ const time = this.timepickerService.getLocalizedTimeFormat(this.value);
396
372
  this.updateValue(time);
397
373
  this.dateField.nativeElementValue = time;
398
374
  }
@@ -488,8 +464,9 @@ let TimepickerComponent = class TimepickerComponent extends CustomFormControl {
488
464
  */
489
465
  writeValue(value) {
490
466
  super.writeValue(value);
491
- if (value === null || this.timepickerService.isValidTime(value))
467
+ if (value === null || this.timepickerService.isValidTime(value)) {
492
468
  this.updateInputValue();
469
+ }
493
470
  }
494
471
  onOpen() {
495
472
  this.keyManager = new ActiveDescendantKeyManager(this.options).withHomeAndEnd();
@@ -507,7 +484,17 @@ let TimepickerComponent = class TimepickerComponent extends CustomFormControl {
507
484
  }
508
485
  }
509
486
  handleDateFieldChanges() {
510
- this.dateField?.valueChange$.pipe(this.takeUntilDestroyed()).subscribe((time) => this.updateValue(time ?? null));
487
+ this.dateField?.applyMask(this.useLocale);
488
+ this.dateField?.valueChange$.pipe(this.takeUntilDestroyed()).subscribe((time) => {
489
+ const normalized = typeof time === 'string' ? time.trim() : '';
490
+ if (!normalized) {
491
+ this.updateValue(null);
492
+ return;
493
+ }
494
+ if (this.timepickerService.is12HourFormat(normalized) === this._useLocale) {
495
+ this.updateValue(this.timepickerService.getLocalizedTimeFormat(normalized));
496
+ }
497
+ });
511
498
  }
512
499
  resetValue(e) {
513
500
  e.stopImmediatePropagation();
@@ -542,7 +529,7 @@ let TimepickerComponent = class TimepickerComponent extends CustomFormControl {
542
529
  updateInputValue() {
543
530
  if (!this.dateField)
544
531
  return;
545
- this.dateField.nativeElementValue = this.timepickerService.getLocalizedTimeFormat(this.value, this.useLocale);
532
+ this.dateField.nativeElementValue = this.timepickerService.getLocalizedTimeFormat(this.value);
546
533
  }
547
534
  scrollToActiveOption(option, _opts = {}) {
548
535
  if (isFunction(option.element.nativeElement.scrollIntoView)) {
@@ -552,7 +539,7 @@ let TimepickerComponent = class TimepickerComponent extends CustomFormControl {
552
539
  setOption(option) {
553
540
  if (!option || option.disabled)
554
541
  return;
555
- const time = this.timepickerService.getLocalizedTimeFormat(option.getLabel(), this.useLocale);
542
+ const time = this.timepickerService.getLocalizedTimeFormat(option.getLabel());
556
543
  this.dateField && (this.dateField.nativeElementValue = time);
557
544
  this.updateValue(time);
558
545
  }
@@ -564,7 +551,8 @@ let TimepickerComponent = class TimepickerComponent extends CustomFormControl {
564
551
  provide: TIMEPICKER_CONTROL,
565
552
  useExisting: forwardRef(() => TimepickerComponent),
566
553
  },
567
- ], viewQueries: [{ propertyName: "dropdown", first: true, predicate: DropdownDirective, descendants: true }, { propertyName: "dateField", first: true, predicate: TimepickerInputControlDirective, descendants: true }, { propertyName: "options", predicate: TimepickerOptionComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"odx-timepicker__wrapper\">\n <input [value]=\"value\" odxTimepickerControl type=\"text\" />\n</div>\n\n<odx-action-group class=\"odx-timepicker__trigger-wrapper odx-no-margin\">\n @if (clearable() && value) {\n <button class=\"odx-timepicker__clear\" odxButton size=\"small\" aria-label=\"Reset time\" (click)=\"resetValue($event)\">\n <odx-icon name=\"close\" iconSet=\"core\" />\n </button>\n }\n <button\n #dropdownTrigger\n class=\"odx-timepicker__trigger\"\n odxButton\n size=\"small\"\n variant=\"ghost\"\n aria-label=\"Select time\"\n [odxDropdown]=\"timeList\"\n [odxDropdownOptions]=\"{ matchReferenceWidth: true, position: 'bottom-start' }\"\n [odxDropdownTriggerElement]=\"dropdownTrigger.element.nativeElement\"\n [odxDropdownReferenceElement]=\"element.nativeElement\"\n (odxDropdownBeforeClose)=\"onTouched()\"\n (odxDropdownAfterOpen)=\"onOpen()\"\n >\n <odx-icon name=\"chevron-down\" />\n </button>\n</odx-action-group>\n\n<ng-template #timeList>\n <div class=\"odx-timepicker__option-list\" role=\"listbox\">\n @for (time of timeStampsList; track $index) {\n <odx-timepicker-option [value]=\"time\" [disabled]=\"!inTimeRange(time)\" (selected)=\"timeSelected($event)\">{{ time }}</odx-timepicker-option>\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "component", type: ActionGroupComponent, selector: "odx-action-group", inputs: ["reverse"] }, { kind: "component", type: ButtonComponent, selector: "button[odxButton], a[odxButton]", inputs: ["variant", "size"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "directive", type: i1.DisabledController, selector: "[disabled]", inputs: ["disabled"] }, { kind: "directive", type: i2.DropdownDirective, selector: "[odxDropdown]", inputs: ["odxDropdown", "odxDropdownDisabled", "odxDropdownShowLoader", "odxDropdownClickOutsideActive", "odxDropdownOptions", "odxDropdownReferenceElement", "odxDropdownTriggerElement", "odxDropdownHost", "odxDropdownOpenTrigger", "odxDropdownCloseTrigger"], outputs: ["odxDropdownBeforeOpen", "odxDropdownAfterOpen", "odxDropdownBeforeClose", "odxDropdownAfterClose"], exportAs: ["odxDropdown"] }, { kind: "component", type: TimepickerOptionComponent, selector: "odx-timepicker-option", outputs: ["selected"] }, { kind: "component", type: IconComponent, selector: "odx-icon", inputs: ["inline", "size", "name", "iconSet", "identifier"] }, { kind: "directive", type: TimepickerInputControlDirective, selector: "input[odxTimepickerControl]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
554
+ TimepickerService,
555
+ ], viewQueries: [{ propertyName: "dropdown", first: true, predicate: DropdownDirective, descendants: true }, { propertyName: "dateField", first: true, predicate: TimepickerInputControlDirective, descendants: true }, { propertyName: "options", predicate: TimepickerOptionComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"odx-timepicker__wrapper\">\n <input [value]=\"value\" odxTimepickerControl type=\"text\" />\n</div>\n\n<odx-action-group class=\"odx-timepicker__trigger-wrapper odx-no-margin\">\n @if (clearable() && value) {\n <button class=\"odx-timepicker__clear\" odxButton size=\"small\" aria-label=\"Reset time\" (click)=\"resetValue($event)\">\n <odx-icon name=\"close\" iconSet=\"core\" />\n </button>\n }\n <button\n #dropdownTrigger\n class=\"odx-timepicker__trigger\"\n odxButton\n size=\"small\"\n variant=\"ghost\"\n aria-label=\"Select time\"\n [odxDropdown]=\"timeList\"\n [odxDropdownOptions]=\"{ matchReferenceWidth: true, position: 'bottom-start' }\"\n [odxDropdownTriggerElement]=\"dropdownTrigger.element.nativeElement\"\n [odxDropdownReferenceElement]=\"element.nativeElement\"\n (odxDropdownBeforeClose)=\"onTouched()\"\n (odxDropdownAfterOpen)=\"onOpen()\"\n >\n <odx-icon name=\"chevron-down\" />\n </button>\n</odx-action-group>\n\n<ng-template #timeList>\n <div class=\"odx-timepicker__option-list\" role=\"listbox\">\n @for (time of timeStampsList; track $index) {\n <odx-timepicker-option [value]=\"time\" [disabled]=\"!inTimeRange(time)\" (selected)=\"timeSelected($event)\">{{ time }}</odx-timepicker-option>\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "component", type: ActionGroupComponent, selector: "odx-action-group", inputs: ["reverse"] }, { kind: "component", type: ButtonComponent, selector: "button[odxButton], a[odxButton]", inputs: ["variant", "size"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "directive", type: i1.DisabledController, selector: "[disabled]", inputs: ["disabled"] }, { kind: "directive", type: i2$1.DropdownDirective, selector: "[odxDropdown]", inputs: ["odxDropdown", "odxDropdownDisabled", "odxDropdownShowLoader", "odxDropdownClickOutsideActive", "odxDropdownOptions", "odxDropdownReferenceElement", "odxDropdownTriggerElement", "odxDropdownHost", "odxDropdownOpenTrigger", "odxDropdownCloseTrigger"], outputs: ["odxDropdownBeforeOpen", "odxDropdownAfterOpen", "odxDropdownBeforeClose", "odxDropdownAfterClose"], exportAs: ["odxDropdown"] }, { kind: "component", type: TimepickerOptionComponent, selector: "odx-timepicker-option", outputs: ["selected"] }, { kind: "component", type: IconComponent, selector: "odx-icon", inputs: ["inline", "size", "name", "iconSet", "identifier"] }, { kind: "directive", type: TimepickerInputControlDirective, selector: "input[odxTimepickerControl]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
568
556
  };
569
557
  TimepickerComponent = __decorate([
570
558
  CSSComponent('timepicker'),
@@ -579,6 +567,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
579
567
  provide: TIMEPICKER_CONTROL,
580
568
  useExisting: forwardRef(() => TimepickerComponent),
581
569
  },
570
+ TimepickerService,
582
571
  ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [A11yModule, ActionGroupComponent, ButtonComponent, DropdownModule, TimepickerOptionComponent, IconComponent, TimepickerInputControlDirective], host: {
583
572
  '[attr.readonly]': 'readonlyController?.readonly || null',
584
573
  }, template: "<div class=\"odx-timepicker__wrapper\">\n <input [value]=\"value\" odxTimepickerControl type=\"text\" />\n</div>\n\n<odx-action-group class=\"odx-timepicker__trigger-wrapper odx-no-margin\">\n @if (clearable() && value) {\n <button class=\"odx-timepicker__clear\" odxButton size=\"small\" aria-label=\"Reset time\" (click)=\"resetValue($event)\">\n <odx-icon name=\"close\" iconSet=\"core\" />\n </button>\n }\n <button\n #dropdownTrigger\n class=\"odx-timepicker__trigger\"\n odxButton\n size=\"small\"\n variant=\"ghost\"\n aria-label=\"Select time\"\n [odxDropdown]=\"timeList\"\n [odxDropdownOptions]=\"{ matchReferenceWidth: true, position: 'bottom-start' }\"\n [odxDropdownTriggerElement]=\"dropdownTrigger.element.nativeElement\"\n [odxDropdownReferenceElement]=\"element.nativeElement\"\n (odxDropdownBeforeClose)=\"onTouched()\"\n (odxDropdownAfterOpen)=\"onOpen()\"\n >\n <odx-icon name=\"chevron-down\" />\n </button>\n</odx-action-group>\n\n<ng-template #timeList>\n <div class=\"odx-timepicker__option-list\" role=\"listbox\">\n @for (time of timeStampsList; track $index) {\n <odx-timepicker-option [value]=\"time\" [disabled]=\"!inTimeRange(time)\" (selected)=\"timeSelected($event)\">{{ time }}</odx-timepicker-option>\n }\n </div>\n</ng-template>\n" }]
@@ -623,6 +612,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
623
612
  }]
624
613
  }] });
625
614
 
615
+ /**
616
+ * Processes and formats a time input value based on specific rules. It adjusts the input for valid time format,
617
+ * especially focusing on single-digit hour inputs, ensuring minute values start with 0 if the last digit is greater
618
+ * than 5, and appending 'M' to AM/PM indicators.
619
+ *
620
+ * @param {string} value - The current input value of the time field.
621
+ * @param {InputEvent} event - The input event triggered by the user's interaction with the field.
622
+ * @returns {string} The processed and potentially reformatted value.
623
+ *
624
+ * @example
625
+ * ```ts
626
+ * // Prepend 0 to single-digit hours greater than 1
627
+ * processInputValue("2", { inputType: "insertText" }); // Returns "02"
628
+ *
629
+ * // Ensure minute values are within valid ranges
630
+ * processInputValue("11:8", { inputType: "insertText" }); // Returns "11:08"
631
+ *
632
+ * // Append 'M' to AM/PM indicators
633
+ * processInputValue("2 p", { inputType: "insertText" }); // Returns "2 PM"
634
+ * ```
635
+ */
636
+ function processInputValue(value, event) {
637
+ if (value.length === 1 && Number(value) > 1) {
638
+ value = `0${value}`;
639
+ }
640
+ else if (value.length === 4 && Number(value.at(-1)) > 5) {
641
+ value = `${value.slice(0, -1)}0${value.slice(-1)}`;
642
+ }
643
+ if (/[AaPp]/.test(value) && event.inputType === 'insertText') {
644
+ value = `${value.toUpperCase()}M`;
645
+ }
646
+ return value;
647
+ }
648
+
626
649
  /**
627
650
  * Generated bundle index. Do not edit.
628
651
  */