@odx/angular 12.21.1 → 12.21.3

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 (29) 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/autocomplete/lib/autocomplete.component.d.ts +1 -0
  5. package/components/datepicker/lib/directives/datepicker-input-control.directive.d.ts +4 -16
  6. package/components/daterangepicker/lib/directives/daterangepicker-input-control.directive.d.ts +4 -16
  7. package/components/timepicker/lib/directives/timepicker-input-control.directive.d.ts +6 -15
  8. package/components/timepicker/lib/timepicker.service.d.ts +5 -4
  9. package/esm2022/cdk/date-input/index.mjs +2 -1
  10. package/esm2022/cdk/date-input/lib/utils/ngx-mask-init.mjs +22 -0
  11. package/esm2022/components/autocomplete/lib/autocomplete.component.mjs +24 -8
  12. package/esm2022/components/datepicker/lib/datepicker.component.mjs +3 -2
  13. package/esm2022/components/datepicker/lib/directives/datepicker-input-control.directive.mjs +8 -23
  14. package/esm2022/components/daterangepicker/lib/daterangepicker.component.mjs +4 -2
  15. package/esm2022/components/daterangepicker/lib/directives/daterangepicker-input-control.directive.mjs +8 -23
  16. package/esm2022/components/timepicker/lib/directives/timepicker-input-control.directive.mjs +17 -37
  17. package/esm2022/components/timepicker/lib/timepicker.component.mjs +21 -6
  18. package/esm2022/components/timepicker/lib/timepicker.service.mjs +42 -15
  19. package/fesm2022/odx-angular-cdk-date-input.mjs +23 -2
  20. package/fesm2022/odx-angular-cdk-date-input.mjs.map +1 -1
  21. package/fesm2022/odx-angular-components-autocomplete.mjs +23 -7
  22. package/fesm2022/odx-angular-components-autocomplete.mjs.map +1 -1
  23. package/fesm2022/odx-angular-components-datepicker.mjs +10 -24
  24. package/fesm2022/odx-angular-components-datepicker.mjs.map +1 -1
  25. package/fesm2022/odx-angular-components-daterangepicker.mjs +11 -24
  26. package/fesm2022/odx-angular-components-daterangepicker.mjs.map +1 -1
  27. package/fesm2022/odx-angular-components-timepicker.mjs +113 -90
  28. package/fesm2022/odx-angular-components-timepicker.mjs.map +1 -1
  29. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-components-autocomplete.mjs","sources":["../../../../libs/angular/components/autocomplete/src/lib/autocomplete.tokens.ts","../../../../libs/angular/components/autocomplete/src/lib/components/option/autocomplete-option.component.ts","../../../../libs/angular/components/autocomplete/src/lib/components/option/autocomplete-option.component.html","../../../../libs/angular/components/autocomplete/src/lib/directives/autocomplete-input-control.directive.ts","../../../../libs/angular/components/autocomplete/src/lib/autocomplete.component.ts","../../../../libs/angular/components/autocomplete/src/lib/autocomplete.component.html","../../../../libs/angular/components/autocomplete/src/lib/pipes/autocomplete-search-filter.pipe.ts","../../../../libs/angular/components/autocomplete/src/lib/autocomplete.module.ts","../../../../libs/angular/components/autocomplete/src/odx-angular-components-autocomplete.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { AutocompleteComponent } from './autocomplete.component';\n\nexport const AUTOCOMPLETE_CONTROL = new InjectionToken<AutocompleteComponent>('@odx/angular/components/autocomplete::AutocompleteComponent');\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { OptionControl } from '@odx/angular/cdk/option-control';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { deferFn } from '@odx/angular/utils';\nimport { AUTOCOMPLETE_CONTROL } from '../../autocomplete.tokens';\n\n/**\n * Represents an option component for the autocomplete control.\n *\n * @template T - The type of the option value.\n */\n@CSSComponent('autocomplete-option')\n@Component({\n standalone: true,\n selector: 'odx-autocomplete-option',\n imports: [CoreModule],\n templateUrl: './autocomplete-option.component.html',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AutocompleteOptionComponent<T> extends OptionControl<T> {\n protected readonly autocompleteControl = inject(AUTOCOMPLETE_CONTROL);\n\n /**\n * Sets the active styles for the option component.\n */\n public setActiveStyles(): void {\n deferFn(() => {\n this.isActive = true;\n this.cdr.markForCheck();\n });\n\n if (this.autocompleteControl.isOpen) {\n this.autocompleteControl.scrollOptionIntoView(this);\n }\n }\n\n protected selectOption(): void {\n this.autocompleteControl.selectOption(this);\n }\n}\n","<ng-content />\n","import { Directive } from '@angular/core';\nimport { ReadonlyController, WithTabIndex } from '@odx/angular';\nimport { InputControlDirective } from '@odx/angular/cdk/custom-form-control';\nimport { CSSComponent } from '@odx/angular/internal';\n\n/**\n * Directive for controlling the input in an autocomplete component.\n * Extends the base InputControlDirective class.\n */\n@CSSComponent('autocomplete__control')\n@Directive({\n standalone: true,\n selector: 'input[odxAutocompleteControl]',\n host: {\n '[attr.readonly]': 'readonlyController?.readonly || null',\n },\n providers: [ReadonlyController.connect()],\n hostDirectives: [WithTabIndex],\n})\nexport class AutocompleteInputControlDirective extends InputControlDirective {\n protected readonly readonlyController = ReadonlyController.inject();\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ContentChildren,\n forwardRef,\n HostListener,\n inject,\n input,\n QueryList,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ClickOutsideDirective } from '@odx/angular';\nimport { AutocompleteControl, ODX_SEARCH_FILTER_HOST } from '@odx/angular/cdk/autocomplete-control';\nimport { DropdownDirective } from '@odx/angular/components/dropdown';\nimport { LoadingSpinnerModule } from '@odx/angular/components/loading-spinner';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { deferFn } from '@odx/angular/utils';\nimport { filter, tap } from 'rxjs';\nimport { AUTOCOMPLETE_CONTROL } from './autocomplete.tokens';\nimport { AutocompleteOptionComponent } from './components';\nimport { AutocompleteInputControlDirective } from './directives';\n\n/**\n * Represents an autocomplete component that provides user interface for a dropdown list to select from as users type.\n * It extends `AutocompleteControl`, integrating custom logic for handling keyboard and mouse events,\n * managing the dropdown state, and updating the associated search field.\n *\n * @see {AutocompleteControl}\n *\n * @template T - The type of the value handled by the autocomplete.\n */\n@CSSComponent('autocomplete')\n@Component({\n standalone: true,\n selector: 'odx-autocomplete',\n imports: [DropdownDirective, LoadingSpinnerModule, AutocompleteOptionComponent],\n templateUrl: './autocomplete.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: AUTOCOMPLETE_CONTROL,\n useExisting: forwardRef(() => AutocompleteComponent),\n },\n {\n provide: ODX_SEARCH_FILTER_HOST,\n useExisting: AUTOCOMPLETE_CONTROL,\n },\n ],\n hostDirectives: [ClickOutsideDirective],\n})\nexport class AutocompleteComponent<T = unknown> extends AutocompleteControl<T | null> implements AfterViewInit {\n private readonly defaultActiveOptionIndex = 0;\n private patchValueFlag = false;\n protected readonly clickOutsideDirective = inject(ClickOutsideDirective, { host: true });\n\n /**\n * The list of autocomplete options.\n *\n * @type {QueryList<AutocompleteOptionComponent<T>> | undefined}\n */\n @ContentChildren(AutocompleteOptionComponent, { descendants: true, emitDistinctChangesOnly: true })\n public options?: QueryList<AutocompleteOptionComponent<T>>;\n\n /** Text to display when no options are found.\n *\n * @type {string | null}\n */\n public notFoundText = input<string | null>(null);\n\n /**\n * The search field input control.\n *\n * @type {AutocompleteInputControlDirective | undefined}\n */\n @ContentChild(AutocompleteInputControlDirective)\n public searchField?: AutocompleteInputControlDirective;\n\n public override ngAfterViewInit(): void {\n if (!this.options) return;\n if (this.value) this.updateSearchField(this.value);\n this.initKeyManager(this.options.toArray());\n this.handleQueryListOption(this.options);\n this.handleSearchFieldChanges();\n this.handleClickOutside();\n }\n\n /**\n * Selects an option, updates the value, updates the search field display,\n * emits the selected value, and closes the dropdown.\n *\n * @param {AutocompleteOptionComponent<T> | null} option - The option component to select. If the option is undefined or its value is undefined,\n * no action is taken.\n */\n public selectOption(option?: AutocompleteOptionComponent<T> | null): void {\n if (!option?.value) return;\n\n this.updateValue(option.value);\n this.updateSearchField(option.value);\n\n this.optionSelected.emit(option.value);\n\n this.closeDropdown();\n }\n\n /**\n * Resets the search field to its initial state and updates the value of the autocomplete\n * to an empty string or initial value.\n */\n public resetSearchField(): void {\n this.updateValue('' as T);\n this.searchField?.reset();\n }\n\n protected handleQueryListOption(options: QueryList<AutocompleteOptionComponent<T>>): void {\n options.changes\n .pipe(\n tap(() => deferFn(() => this.updateDropdownState())),\n filter(() => this.isOpen),\n this.takeUntilDestroyed(),\n )\n .subscribe(() => {\n deferFn(() => this.activateSelectedOption());\n });\n }\n\n protected handleSearchFieldChanges(): void {\n this.searchField?.valueChange$.pipe(this.takeUntilDestroyed()).subscribe(() => this.triggerControllerChange());\n }\n\n protected handleClickOutside(): void {\n this.clickOutsideDirective.odxClickOutside.pipe(this.takeUntilDestroyed()).subscribe(() => this.clickOutside());\n }\n\n protected clickOutside(): void {\n this.closeDropdown();\n this.blurSelectSearchField();\n }\n\n protected updateDropdownState(): void {\n if (this.patchValueFlag) {\n this.patchValueFlag = false;\n return;\n }\n if (!this.isOpen && (this.hasOptions || !!this.notFoundText())) {\n this.openDropdown();\n return;\n }\n if (this.isOpen && !this.hasOptions && !this.notFoundText()) {\n this.closeDropdown();\n }\n }\n\n @HostListener('click')\n protected handleClickEvent() {\n if (this.isLoading && this.isOpen) {\n this.closeDropdown();\n this.blurSelectSearchField();\n return;\n }\n\n if (this.isReadonly || this.isDisabled) return;\n\n if (!this.isOpen && this.hasOptions) {\n this.openDropdown();\n }\n }\n\n @HostListener('keydown', ['$event'])\n protected async handleKeyboardEvent(event: KeyboardEvent) {\n if (this.isReadonly || this.isDisabled) return;\n\n if (event.key === 'Escape') {\n this.resetSearchField();\n this.blurSelectSearchField();\n return;\n }\n\n if (this.isOpen && this.hasOptions) {\n if (event.key === 'Enter' || event.key === 'Tab') {\n event.preventDefault();\n event.stopImmediatePropagation();\n this.selectOption(this.keyManager?.activeItem as AutocompleteOptionComponent<T> | undefined);\n return;\n }\n }\n\n if (event.key === 'Enter') {\n this.optionSelected.emit((this.value ?? '') as T);\n return;\n }\n\n if (!this.isOpen && event.key === 'Tab') {\n return;\n }\n\n this.keyManager?.onKeydown(event);\n }\n\n protected activateSelectedOption(): void {\n this.keyManager?.setActiveItem(this.defaultActiveOptionIndex);\n }\n\n protected override onDropdownClosed(): void {\n super.onDropdownClosed();\n !this.searchField?.nativeElementValue && this.blurSelectSearchField();\n }\n\n private updateSearchField(value: T): void {\n if (!this.searchField) return;\n this.patchValueFlag = true;\n this.searchField.nativeElementValue = this.stringify?.(value) ?? (value as string);\n }\n\n private blurSelectSearchField(): void {\n this.searchField?.blur();\n }\n}\n","<div\n aria-haspopup=\"listbox\"\n class=\"odx-autocomplete__trigger\"\n [odxDropdown]=\"dropdownContent\"\n [odxDropdownDisabled]=\"isDisabled || isReadonly\"\n [odxDropdownOptions]=\"{ matchReferenceWidth: true, offset: 4, outerPadding: 10, position: 'bottom-start' }\"\n [odxDropdownReferenceElement]=\"dropdownReferenceElement\"\n [odxDropdownShowLoader]=\"isLoading\"\n [odxDropdownOpenTrigger]=\"[]\"\n [odxDropdownClickOutsideActive]=\"false\"\n (odxDropdownBeforeOpen)=\"onDropdownOpen()\"\n (odxDropdownAfterOpen)=\"onDropdownOpened()\"\n (odxDropdownBeforeClose)=\"onDropdownClose()\"\n (odxDropdownAfterClose)=\"onDropdownClosed()\"\n>\n <ng-content select=\"input[odxAutocompleteControl]\" />\n</div>\n<ng-template #dropdownContent>\n <div class=\"odx-dropdown__option-list\" role=\"listbox\">\n @if (hasOptions) {\n <ng-content />\n } @else if (!!notFoundText()) {\n <odx-autocomplete-option class=\"is-disabled\">{{ notFoundText() }}</odx-autocomplete-option>\n }\n </div>\n</ng-template>\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { BaseSearchFilterPipe } from '@odx/angular/cdk/autocomplete-control';\n\n@Pipe({\n pure: false,\n name: 'odxAutocompleteSearchFilter',\n standalone: true,\n})\nexport class AutocompleteSearchFilterPipe extends BaseSearchFilterPipe implements PipeTransform {}\n","import { NgModule } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { AutocompleteComponent } from './autocomplete.component';\nimport { AutocompleteOptionComponent } from './components';\nimport { AutocompleteInputControlDirective } from './directives';\nimport { AutocompleteSearchFilterPipe } from './pipes';\n\nconst modules = [AutocompleteComponent, AutocompleteInputControlDirective, AutocompleteSearchFilterPipe, AutocompleteOptionComponent];\n\n@NgModule({\n imports: modules,\n exports: [CoreModule, ...modules],\n})\nexport class AutocompleteModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAGa,oBAAoB,GAAG,IAAI,cAAc,CAAwB,6DAA6D;;ACI3I;;;;AAIG;AAUI,IAAM,2BAA2B,GAAjC,MAAM,2BAA+B,SAAQ,aAAgB,CAAA;AAA7D,IAAA,WAAA,GAAA;;AACc,QAAA,IAAA,CAAA,mBAAmB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAmBvE,KAAA;AAjBC;;AAEG;IACI,eAAe,GAAA;QACpB,OAAO,CAAC,MAAK;AACX,YAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;AACrB,YAAA,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;AAC1B,SAAC,CAAC,CAAC;AAEH,QAAA,IAAI,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE;AACnC,YAAA,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;SACrD;KACF;IAES,YAAY,GAAA;AACpB,QAAA,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;KAC7C;+GAnBU,2BAA2B,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;mGAA3B,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,E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A2B,CAIxH,EAAA,OAAA,EAAA,CAAA,UAAU,EAJL,qBAAqB,EAAE,iCAAiC,EAAE,4BAA4B,EAAE,2BAA2B,CAAA,EAAA,CAAA,CAAA,EAAA;AAMvH,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,kBAAkB,EANd,OAAA,EAAA,CAAA,qBAAqB,EAAmE,2BAA2B,EAIxH,UAAU,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAET,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,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-autocomplete.mjs","sources":["../../../../libs/angular/components/autocomplete/src/lib/autocomplete.tokens.ts","../../../../libs/angular/components/autocomplete/src/lib/components/option/autocomplete-option.component.ts","../../../../libs/angular/components/autocomplete/src/lib/components/option/autocomplete-option.component.html","../../../../libs/angular/components/autocomplete/src/lib/directives/autocomplete-input-control.directive.ts","../../../../libs/angular/components/autocomplete/src/lib/autocomplete.component.ts","../../../../libs/angular/components/autocomplete/src/lib/autocomplete.component.html","../../../../libs/angular/components/autocomplete/src/lib/pipes/autocomplete-search-filter.pipe.ts","../../../../libs/angular/components/autocomplete/src/lib/autocomplete.module.ts","../../../../libs/angular/components/autocomplete/src/odx-angular-components-autocomplete.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { AutocompleteComponent } from './autocomplete.component';\n\nexport const AUTOCOMPLETE_CONTROL = new InjectionToken<AutocompleteComponent>('@odx/angular/components/autocomplete::AutocompleteComponent');\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { OptionControl } from '@odx/angular/cdk/option-control';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { deferFn } from '@odx/angular/utils';\nimport { AUTOCOMPLETE_CONTROL } from '../../autocomplete.tokens';\n\n/**\n * Represents an option component for the autocomplete control.\n *\n * @template T - The type of the option value.\n */\n@CSSComponent('autocomplete-option')\n@Component({\n standalone: true,\n selector: 'odx-autocomplete-option',\n imports: [CoreModule],\n templateUrl: './autocomplete-option.component.html',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AutocompleteOptionComponent<T> extends OptionControl<T> {\n protected readonly autocompleteControl = inject(AUTOCOMPLETE_CONTROL);\n\n /**\n * Sets the active styles for the option component.\n */\n public setActiveStyles(): void {\n deferFn(() => {\n this.isActive = true;\n this.cdr.markForCheck();\n });\n\n if (this.autocompleteControl.isOpen) {\n this.autocompleteControl.scrollOptionIntoView(this);\n }\n }\n\n protected selectOption(): void {\n this.autocompleteControl.selectOption(this);\n }\n}\n","<ng-content />\n","import { Directive } from '@angular/core';\nimport { ReadonlyController, WithTabIndex } from '@odx/angular';\nimport { InputControlDirective } from '@odx/angular/cdk/custom-form-control';\nimport { CSSComponent } from '@odx/angular/internal';\n\n/**\n * Directive for controlling the input in an autocomplete component.\n * Extends the base InputControlDirective class.\n */\n@CSSComponent('autocomplete__control')\n@Directive({\n standalone: true,\n selector: 'input[odxAutocompleteControl]',\n host: {\n '[attr.readonly]': 'readonlyController?.readonly || null',\n },\n providers: [ReadonlyController.connect()],\n hostDirectives: [WithTabIndex],\n})\nexport class AutocompleteInputControlDirective extends InputControlDirective {\n protected readonly readonlyController = ReadonlyController.inject();\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ContentChildren,\n forwardRef,\n HostListener,\n inject,\n input,\n QueryList,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ClickOutsideDirective } from '@odx/angular';\nimport { AutocompleteControl, ODX_SEARCH_FILTER_HOST } from '@odx/angular/cdk/autocomplete-control';\nimport { DropdownDirective } from '@odx/angular/components/dropdown';\nimport { LoadingSpinnerModule } from '@odx/angular/components/loading-spinner';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { deferFn } from '@odx/angular/utils';\nimport { AUTOCOMPLETE_CONTROL } from './autocomplete.tokens';\nimport { AutocompleteOptionComponent } from './components';\nimport { AutocompleteInputControlDirective } from './directives';\n\n/**\n * Represents an autocomplete component that provides user interface for a dropdown list to select from as users type.\n * It extends `AutocompleteControl`, integrating custom logic for handling keyboard and mouse events,\n * managing the dropdown state, and updating the associated search field.\n *\n * @see {AutocompleteControl}\n *\n * @template T - The type of the value handled by the autocomplete.\n */\n@CSSComponent('autocomplete')\n@Component({\n standalone: true,\n selector: 'odx-autocomplete',\n imports: [DropdownDirective, LoadingSpinnerModule, AutocompleteOptionComponent],\n templateUrl: './autocomplete.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: AUTOCOMPLETE_CONTROL,\n useExisting: forwardRef(() => AutocompleteComponent),\n },\n {\n provide: ODX_SEARCH_FILTER_HOST,\n useExisting: AUTOCOMPLETE_CONTROL,\n },\n ],\n hostDirectives: [ClickOutsideDirective],\n})\nexport class AutocompleteComponent<T = unknown> extends AutocompleteControl<T | null> implements AfterViewInit {\n private readonly defaultActiveOptionIndex = 0;\n private patchValueFlag = false;\n private shouldOpenOnOptionUpdate = false;\n protected readonly clickOutsideDirective = inject(ClickOutsideDirective, { host: true });\n\n /**\n * The list of autocomplete options.\n *\n * @type {QueryList<AutocompleteOptionComponent<T>> | undefined}\n */\n @ContentChildren(AutocompleteOptionComponent, { descendants: true, emitDistinctChangesOnly: true })\n public options?: QueryList<AutocompleteOptionComponent<T>>;\n\n /** Text to display when no options are found.\n *\n * @type {string | null}\n */\n public notFoundText = input<string | null>(null);\n\n /**\n * The search field input control.\n *\n * @type {AutocompleteInputControlDirective | undefined}\n */\n @ContentChild(AutocompleteInputControlDirective)\n public searchField?: AutocompleteInputControlDirective;\n\n public override ngAfterViewInit(): void {\n if (!this.options) return;\n if (this.value) this.updateSearchField(this.value);\n this.initKeyManager(this.options.toArray());\n this.handleQueryListOption(this.options);\n this.handleSearchFieldChanges();\n this.handleClickOutside();\n }\n\n /**\n * Selects an option, updates the value, updates the search field display,\n * emits the selected value, and closes the dropdown.\n *\n * @param {AutocompleteOptionComponent<T> | null} option - The option component to select. If the option is undefined or its value is undefined,\n * no action is taken.\n */\n public selectOption(option?: AutocompleteOptionComponent<T> | null): void {\n if (!option?.value) return;\n\n this.updateValue(option.value);\n this.updateSearchField(option.value);\n\n this.optionSelected.emit(option.value);\n\n this.closeDropdown();\n }\n\n /**\n * Resets the search field to its initial state and updates the value of the autocomplete\n * to an empty string or initial value.\n */\n public resetSearchField(): void {\n this.updateValue('' as T);\n this.searchField?.reset();\n }\n\n protected handleQueryListOption(options: QueryList<AutocompleteOptionComponent<T>>): void {\n options.changes.pipe(this.takeUntilDestroyed()).subscribe(() => {\n this.initKeyManager(options.toArray());\n\n deferFn(() => {\n this.updateDropdownState();\n\n if (this.isOpen && this.hasOptions) {\n this.activateSelectedOption();\n }\n });\n });\n }\n\n protected handleSearchFieldChanges(): void {\n this.searchField?.valueChange$.pipe(this.takeUntilDestroyed()).subscribe(() => {\n this.shouldOpenOnOptionUpdate = true;\n this.triggerControllerChange();\n this.updateDropdownState();\n });\n }\n\n protected handleClickOutside(): void {\n this.clickOutsideDirective.odxClickOutside.pipe(this.takeUntilDestroyed()).subscribe(() => this.clickOutside());\n }\n\n protected clickOutside(): void {\n this.closeDropdown();\n this.blurSelectSearchField();\n }\n\n protected updateDropdownState(): void {\n if (this.patchValueFlag) {\n this.patchValueFlag = false;\n return;\n }\n if (!this.isOpen && this.shouldOpenOnOptionUpdate && (this.hasOptions || !!this.notFoundText() || this.isLoading)) {\n this.openDropdown();\n this.shouldOpenOnOptionUpdate = false;\n return;\n }\n if (this.isOpen && !this.hasOptions && !this.notFoundText()) {\n this.closeDropdown();\n }\n }\n\n @HostListener('click')\n protected handleClickEvent() {\n if (this.isLoading && this.isOpen) {\n this.closeDropdown();\n this.blurSelectSearchField();\n return;\n }\n\n if (this.isReadonly || this.isDisabled) return;\n\n this.shouldOpenOnOptionUpdate = true;\n\n if (!this.isOpen && this.hasOptions) {\n this.openDropdown();\n this.shouldOpenOnOptionUpdate = false;\n }\n }\n\n @HostListener('keydown', ['$event'])\n protected async handleKeyboardEvent(event: KeyboardEvent) {\n if (this.isReadonly || this.isDisabled) return;\n\n if (event.key === 'Escape') {\n this.resetSearchField();\n this.blurSelectSearchField();\n return;\n }\n\n if (!this.isOpen && ['ArrowDown', 'ArrowUp', 'PageDown', 'PageUp', 'Home', 'End'].includes(event.key)) {\n this.shouldOpenOnOptionUpdate = true;\n this.updateDropdownState();\n }\n\n if (this.isOpen && this.hasOptions) {\n if (event.key === 'Enter' || event.key === 'Tab') {\n event.preventDefault();\n event.stopImmediatePropagation();\n this.selectOption(this.keyManager?.activeItem as AutocompleteOptionComponent<T> | undefined);\n return;\n }\n }\n\n if (event.key === 'Enter') {\n this.optionSelected.emit((this.value ?? '') as T);\n return;\n }\n\n if (!this.isOpen && event.key === 'Tab') {\n return;\n }\n\n this.keyManager?.onKeydown(event);\n }\n\n protected activateSelectedOption(): void {\n this.keyManager?.setActiveItem(this.defaultActiveOptionIndex);\n }\n\n protected override onDropdownClosed(): void {\n super.onDropdownClosed();\n this.shouldOpenOnOptionUpdate = false;\n !this.searchField?.nativeElementValue && this.blurSelectSearchField();\n }\n\n private updateSearchField(value: T): void {\n if (!this.searchField) return;\n this.patchValueFlag = true;\n this.searchField.nativeElementValue = this.stringify?.(value) ?? (value as string);\n }\n\n private blurSelectSearchField(): void {\n this.searchField?.blur();\n }\n}\n","<div\n aria-haspopup=\"listbox\"\n class=\"odx-autocomplete__trigger\"\n [odxDropdown]=\"dropdownContent\"\n [odxDropdownDisabled]=\"isDisabled || isReadonly\"\n [odxDropdownOptions]=\"{ matchReferenceWidth: true, offset: 4, outerPadding: 10, position: 'bottom-start' }\"\n [odxDropdownReferenceElement]=\"dropdownReferenceElement\"\n [odxDropdownShowLoader]=\"isLoading\"\n [odxDropdownOpenTrigger]=\"[]\"\n [odxDropdownClickOutsideActive]=\"false\"\n (odxDropdownBeforeOpen)=\"onDropdownOpen()\"\n (odxDropdownAfterOpen)=\"onDropdownOpened()\"\n (odxDropdownBeforeClose)=\"onDropdownClose()\"\n (odxDropdownAfterClose)=\"onDropdownClosed()\"\n>\n <ng-content select=\"input[odxAutocompleteControl]\" />\n</div>\n<ng-template #dropdownContent>\n <div class=\"odx-dropdown__option-list\" role=\"listbox\">\n @if (hasOptions) {\n <ng-content />\n } @else if (!!notFoundText()) {\n <odx-autocomplete-option class=\"is-disabled\">{{ notFoundText() }}</odx-autocomplete-option>\n }\n </div>\n</ng-template>\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { BaseSearchFilterPipe } from '@odx/angular/cdk/autocomplete-control';\n\n@Pipe({\n pure: false,\n name: 'odxAutocompleteSearchFilter',\n standalone: true,\n})\nexport class AutocompleteSearchFilterPipe extends BaseSearchFilterPipe implements PipeTransform {}\n","import { NgModule } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { AutocompleteComponent } from './autocomplete.component';\nimport { AutocompleteOptionComponent } from './components';\nimport { AutocompleteInputControlDirective } from './directives';\nimport { AutocompleteSearchFilterPipe } from './pipes';\n\nconst modules = [AutocompleteComponent, AutocompleteInputControlDirective, AutocompleteSearchFilterPipe, AutocompleteOptionComponent];\n\n@NgModule({\n imports: modules,\n exports: [CoreModule, ...modules],\n})\nexport class AutocompleteModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAGa,oBAAoB,GAAG,IAAI,cAAc,CAAwB,6DAA6D;;ACI3I;;;;AAIG;AAUI,IA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AA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAAlB,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,kBAAkB,YANd,qBAAqB,EAAE,iCAAiC,EAAE,4BAA4B,EAAE,2BAA2B,CAIxH,EAAA,OAAA,EAAA,CAAA,UAAU,EAJL,qBAAqB,EAAE,iCAAiC,EAAE,4BAA4B,EAAE,2BAA2B,CAAA,EAAA,CAAA,CAAA,EAAA;AAMvH,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,kBAAkB,EANd,OAAA,EAAA,CAAA,qBAAqB,EAAmE,2BAA2B,EAIxH,UAAU,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAET,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,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;;;;"}
@@ -6,19 +6,19 @@ import { inject, EventEmitter, Directive, Output, HostListener, input, booleanAt
6
6
  import * as i1 from '@odx/angular';
7
7
  import { ReadonlyController, WithTabIndex, detectControllerChanges, CoreModule } from '@odx/angular';
8
8
  import { InputControlDirective, CustomFormControl } from '@odx/angular/cdk/custom-form-control';
9
- import { injectDateConfig, getDateInputMask, getDateInputValueAsDate, getDateInputFormat } from '@odx/angular/cdk/date-input';
9
+ import { injectDateConfig, getDateInputValueAsDate, getDateInputFormat, initNgxMask, getDateInputMask } from '@odx/angular/cdk/date-input';
10
10
  export { DateConfig as DatepickerConfig, DateDefaultConfig as DatepickerDefaultConfig, InputDateOrder as DatepickerInputDateOrder, DateInputFormat as DatepickerInputFormat, DateInputMask as DatepickerInputMask, getDateInputFormat as getDatepickerInputFormat, getDateInputMask as getDatepickerInputMask, getDateInputValueAsDate as getDatepickerInputValueAsDate, injectDateConfig as injectDatepickerDateConfig, provideDateConfig as provideDatepickerConfig } from '@odx/angular/cdk/date-input';
11
11
  import { ActionGroupComponent } from '@odx/angular/components/action-group';
12
12
  import { ButtonComponent } from '@odx/angular/components/button';
13
13
  import { CalendarComponent } from '@odx/angular/components/calendar';
14
- import * as i2 from '@odx/angular/components/dropdown';
14
+ import * as i2$1 from '@odx/angular/components/dropdown';
15
15
  import { DropdownDirective, DropdownModule } from '@odx/angular/components/dropdown';
16
16
  import { IconComponent } from '@odx/angular/components/icon';
17
17
  import { CSSComponent } from '@odx/angular/internal';
18
18
  import { untilDestroyed, injectElement, deferFn } from '@odx/angular/utils';
19
19
  import { startOfDay, format } from 'date-fns';
20
- import { NgxMaskPipe, provideNgxMask } from 'ngx-mask';
21
- import { fromEvent, distinctUntilChanged, tap, map } from 'rxjs';
20
+ import * as i2 from 'ngx-mask';
21
+ import { NgxMaskDirective, provideNgxMask } from 'ngx-mask';
22
22
 
23
23
  /**
24
24
  * A directive to enhance an input element as part of a datepicker control. It applies date input formatting,
@@ -33,30 +33,15 @@ import { fromEvent, distinctUntilChanged, tap, map } from 'rxjs';
33
33
  let DatepickerInputControlDirective = class DatepickerInputControlDirective extends InputControlDirective {
34
34
  constructor() {
35
35
  super(...arguments);
36
- this.maskConfig = { validation: false, leadZeroDateTime: true };
37
36
  this.readonlyController = ReadonlyController.inject();
38
37
  this.config = injectDateConfig();
39
- this.inputMask = getDateInputMask(this.config);
40
- this.ngxMaskPipe = inject(NgxMaskPipe);
38
+ this.ngxMaskDirective = inject(NgxMaskDirective);
41
39
  /**
42
40
  * Emits an event when the input field receives focus or loses focus, indicating the focus state.
43
41
  *
44
42
  * @emits {boolean} - Indicates whether the input field is focused.
45
43
  */
46
44
  this.focused = new EventEmitter();
47
- /**
48
- * Observable stream capturing and processing input events on the native element, applying the mask,
49
- * and emitting the current value.
50
- *
51
- * @emits {string} - The current value of the input field.
52
- */
53
- this.valueChange$ = fromEvent(this.element.nativeElement, 'input').pipe(distinctUntilChanged(), tap(() => this.applyMask()), map(() => this.nativeElementValue));
54
- }
55
- /**
56
- * Applies the configured input mask to the native element's value.
57
- */
58
- applyMask() {
59
- this.nativeElementValue = this.ngxMaskPipe.transform(this.nativeElementValue, this.inputMask, this.maskConfig);
60
45
  }
61
46
  /**
62
47
  * Gets the current value of the input field as a `Date` object, based on the date format from the datepicker
@@ -83,7 +68,7 @@ let DatepickerInputControlDirective = class DatepickerInputControlDirective exte
83
68
  this.focused.emit(false);
84
69
  }
85
70
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatepickerInputControlDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
86
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DatepickerInputControlDirective, isStandalone: true, selector: "input[odxDatepickerControl]", outputs: { focused: "focused" }, host: { listeners: { "focusin": "handleFocusIn()", "focusout": "handleFocusOut()" }, properties: { "attr.readonly": "readonlyController?.readonly || null", "attr.placeholder": "placeholder" } }, providers: [ReadonlyController.connect(), provideNgxMask(), NgxMaskPipe], usesInheritance: true, hostDirectives: [{ directive: i1.WithTabIndex }], ngImport: i0 }); }
71
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DatepickerInputControlDirective, isStandalone: true, selector: "input[odxDatepickerControl]", outputs: { focused: "focused" }, host: { listeners: { "focusin": "handleFocusIn()", "focusout": "handleFocusOut()" }, properties: { "attr.readonly": "readonlyController?.readonly || null", "attr.placeholder": "placeholder" } }, providers: [ReadonlyController.connect(), provideNgxMask({ validation: false, leadZeroDateTime: true })], usesInheritance: true, hostDirectives: [{ directive: i1.WithTabIndex }, { directive: i2.NgxMaskDirective }], ngImport: i0 }); }
87
72
  };
88
73
  DatepickerInputControlDirective = __decorate([
89
74
  CSSComponent('datepicker__control')
@@ -97,8 +82,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
97
82
  '[attr.readonly]': 'readonlyController?.readonly || null',
98
83
  '[attr.placeholder]': 'placeholder',
99
84
  },
100
- providers: [ReadonlyController.connect(), provideNgxMask(), NgxMaskPipe],
101
- hostDirectives: [WithTabIndex],
85
+ providers: [ReadonlyController.connect(), provideNgxMask({ validation: false, leadZeroDateTime: true })],
86
+ hostDirectives: [WithTabIndex, NgxMaskDirective],
102
87
  }]
103
88
  }], propDecorators: { focused: [{
104
89
  type: Output
@@ -241,6 +226,7 @@ let DatepickerComponent = class DatepickerComponent extends CustomFormControl {
241
226
  this.updateDateField(value);
242
227
  }
243
228
  handleDateFieldChanges() {
229
+ initNgxMask(this.dateField?.ngxMaskDirective, getDateInputMask(this.config));
244
230
  this.dateField?.valueChange$.pipe(this.takeUntilDestroyed()).subscribe(() => {
245
231
  if (!this.dateField?.valueAsDate)
246
232
  return;
@@ -264,7 +250,7 @@ let DatepickerComponent = class DatepickerComponent extends CustomFormControl {
264
250
  this.dateField.nativeElementValue = date ? format(date, dateFormat) : '';
265
251
  }
266
252
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
267
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DatepickerComponent, isStandalone: true, selector: "odx-datepicker", inputs: { filterFn: { classPropertyName: "filterFn", publicName: "filterFn", isSignal: false, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: false, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: false, isRequired: false, transformFunction: null }, dropdownPosition: { classPropertyName: "dropdownPosition", publicName: "dropdownPosition", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "selectedChange" }, host: { listeners: { "keydown.alt.ArrowDown": "openDatepicker($event)" } }, queries: [{ propertyName: "dateField", first: true, predicate: DatepickerInputControlDirective, descendants: true }], viewQueries: [{ propertyName: "dropdown", first: true, predicate: DropdownDirective, descendants: true }, { propertyName: "dropdownTriggerElement", first: true, predicate: ["dropdownTrigger"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"input[odxDatepickerControl]\" />\n\n<odx-action-group class=\"odx-datepicker__trigger-wrapper\">\n @if (clearable() && value) {\n <button odxButton class=\"odx-datepicker__clear\" (click)=\"reset()\" 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-datepicker__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]=\"value || today\"\n [filterFn]=\"filterFn\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n (selectedDateChange)=\"selectDate($event)\"\n />\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: ActionGroupComponent, selector: "odx-action-group", inputs: ["reverse"] }, { kind: "component", type: ButtonComponent, selector: "button[odxButton], a[odxButton]", inputs: ["variant", "size"] }, { kind: "component", type: CalendarComponent, selector: "odx-calendar", inputs: ["selectedDate", "selectedDateRange", "minDate", "maxDate", "filterFn"], outputs: ["selectedDateChange", "selectedDateRangeChange"] }, { kind: "ngmodule", type: DropdownModule }, { 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: IconComponent, selector: "odx-icon", inputs: ["inline", "size", "name", "iconSet", "identifier"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
253
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DatepickerComponent, isStandalone: true, selector: "odx-datepicker", inputs: { filterFn: { classPropertyName: "filterFn", publicName: "filterFn", isSignal: false, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: false, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: false, isRequired: false, transformFunction: null }, dropdownPosition: { classPropertyName: "dropdownPosition", publicName: "dropdownPosition", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "selectedChange" }, host: { listeners: { "keydown.alt.ArrowDown": "openDatepicker($event)" } }, queries: [{ propertyName: "dateField", first: true, predicate: DatepickerInputControlDirective, descendants: true }], viewQueries: [{ propertyName: "dropdown", first: true, predicate: DropdownDirective, descendants: true }, { propertyName: "dropdownTriggerElement", first: true, predicate: ["dropdownTrigger"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"input[odxDatepickerControl]\" />\n\n<odx-action-group class=\"odx-datepicker__trigger-wrapper\">\n @if (clearable() && value) {\n <button odxButton class=\"odx-datepicker__clear\" (click)=\"reset()\" 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-datepicker__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]=\"value || today\"\n [filterFn]=\"filterFn\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n (selectedDateChange)=\"selectDate($event)\"\n />\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: ActionGroupComponent, selector: "odx-action-group", inputs: ["reverse"] }, { kind: "component", type: ButtonComponent, selector: "button[odxButton], a[odxButton]", inputs: ["variant", "size"] }, { kind: "component", type: CalendarComponent, selector: "odx-calendar", inputs: ["selectedDate", "selectedDateRange", "minDate", "maxDate", "filterFn"], outputs: ["selectedDateChange", "selectedDateRangeChange"] }, { kind: "ngmodule", type: DropdownModule }, { 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: IconComponent, selector: "odx-icon", inputs: ["inline", "size", "name", "iconSet", "identifier"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
268
254
  };
269
255
  DatepickerComponent = __decorate([
270
256
  CSSComponent('datepicker'),
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-components-datepicker.mjs","sources":["../../../../libs/angular/components/datepicker/src/lib/directives/datepicker-input-control.directive.ts","../../../../libs/angular/components/datepicker/src/lib/datepicker.component.ts","../../../../libs/angular/components/datepicker/src/lib/datepicker.component.html","../../../../libs/angular/components/datepicker/src/lib/datepicker.module.ts","../../../../libs/angular/components/datepicker/src/odx-angular-components-datepicker.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 * A directive to enhance an input element as part of a datepicker control. It applies date input formatting,\n * mask handling, and emits focus events. This directive integrates with ngx-mask to handle input masking and\n * ensures that the input complies with the date format specified in the datepicker configuration.\n * Extends the `InputControlDirective` to provide input control functionality.\n * Has host directive `WithTabIndex` to manage the tabindex attribute of the input element.\n *\n * @see {InputControlDirective}\n * @see {WithTabIndex}\n */\n@CSSComponent('datepicker__control')\n@Directive({\n standalone: true,\n selector: 'input[odxDatepickerControl]',\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 DatepickerInputControlDirective 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 field receives focus or loses focus, indicating the focus state.\n *\n * @emits {boolean} - Indicates whether the input field is focused.\n */\n @Output()\n public focused = new EventEmitter<boolean>();\n\n /**\n * Observable stream capturing and processing input events on the native element, applying the mask,\n * and emitting the current value.\n *\n * @emits {string} - The current value of the input field.\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 element's value.\n */\n public applyMask(): void {\n this.nativeElementValue = this.ngxMaskPipe.transform(this.nativeElementValue, this.inputMask, this.maskConfig);\n }\n\n /**\n * Gets the current value of the input field as a `Date` object, based on the date format from the datepicker\n * configuration.\n *\n * @returns {Date | null} - The current value of the input field as a `Date` object, or `null` if the value is invalid.\n */\n public get valueAsDate(): Date | null {\n return getDateInputValueAsDate(this.config, this.nativeElementValue);\n }\n\n /**\n * Computes the placeholder text for the input based on the date format from\n * the datepicker configuration.\n *\n * @returns {string} - The placeholder text, typically the date format in uppercase.\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 ContentChild,\n ElementRef,\n EventEmitter,\n HostListener,\n input,\n Input,\n Output,\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, DateFilter } 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 { DatepickerInputControlDirective } from './directives';\n\n/**\n * Represents a datepicker component for selecting a date.\n * Extends the `CustomFormControl` class and implements the `AfterViewInit` interface.\n *\n * @see {CustomFormControl}\n */\n@CSSComponent('datepicker')\n@Component({\n selector: 'odx-datepicker',\n standalone: true,\n imports: [A11yModule, ActionGroupComponent, ButtonComponent, CalendarComponent, DropdownModule, IconComponent],\n templateUrl: './datepicker.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class DatepickerComponent extends CustomFormControl<Date | null> implements AfterViewInit {\n protected readonly takeUntilDestroyed = untilDestroyed();\n\n protected readonly config = injectDateConfig();\n\n public readonly element = injectElement();\n\n /**\n * Gets a value indicating whether the datepicker is currently open.\n *\n * @returns {boolean}\n */\n public get isOpen(): boolean {\n return !!this.dropdown.isOpen;\n }\n\n /**\n * Represents the current date.\n *\n * @type {Date}\n */\n public today = new Date();\n\n /**\n * The filter function used to determine if a date should be included or excluded in the datepicker.\n * If set to `null`, no filtering will be applied.\n *\n * @type {DateFilter | null}\n * @default null\n *\n * @example\n * ```ts\n * // Excludes mondays from the datepicker.\n * const filterFn: DateFilter = (date) => date.getDay() !== 1;\n * ```\n */\n @Input()\n public filterFn: DateFilter | null = null;\n\n /**\n * The minimum selectable date for the datepicker.\n * If set to null, there is no minimum date restriction.\n *\n * @type {Date | null}\n * @default null\n */\n @Input()\n public minDate: Date | null = null;\n\n /**\n * The maximum selectable date for the datepicker.\n * If set to null, there is no maximum date restriction.\n *\n * @type {Date | null}\n * @default null\n */\n @Input()\n public maxDate: Date | null = null;\n\n /**\n * The position of the dropdown relative to the input field.\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 when it changes.\n *\n * @emits {Date}\n */\n @Output()\n public selectedChange = new EventEmitter<Date>();\n\n /**\n * The dropdown directive used in the datepicker component.\n *\n * @type {DropdownDirective}\n */\n @ViewChild(DropdownDirective)\n public dropdown!: DropdownDirective;\n\n /**\n * The dropdown trigger element used in the datepicker component.\n *\n * @type {ElementRef<HTMLElement>}\n */\n @ViewChild('dropdownTrigger', { read: ElementRef, static: true })\n public dropdownTriggerElement!: ElementRef<HTMLElement>;\n\n /**\n * The date field input control directive used in the datepicker component.\n *\n * @type {DatepickerInputControlDirective | undefined}\n */\n @ContentChild(DatepickerInputControlDirective)\n public dateField?: DatepickerInputControlDirective;\n\n constructor() {\n super(null);\n detectControllerChanges(this).subscribe();\n }\n\n public ngAfterViewInit(): void {\n this.handleDateFieldChanges();\n this.handleDateFieldFocus();\n\n deferFn(() => {\n if (!this.value) return;\n this.updateDateField(startOfDay(this.value));\n });\n }\n\n /**\n * Selects a date.\n *\n * @param {Date | null} value - The date value to be selected.\n */\n public selectDate(value: Date | null): void {\n if (!value) return;\n\n this.updateInternalValue(value);\n\n this.selectedChange.emit(value);\n\n this.dropdown.close();\n }\n\n /**\n * Resets the datepicker's value to null.\n */\n public reset(): void {\n this.updateInternalValue(null);\n }\n\n /**\n * @internal\n * Writes a new value to the element.\n * Part of the ControlValueAccessor interface.\n * @param {Date | null} value - The new value.\n */\n public override writeValue(value: Date | null): void {\n super.writeValue(value);\n this.updateDateField(value);\n }\n\n /**\n * Opens the datepicker dropdown.\n *\n * @param {KeyboardEvent} event\n */\n @HostListener('keydown.alt.ArrowDown', ['$event'])\n public openDatepicker(event?: KeyboardEvent) {\n event?.stopPropagation();\n\n if (this.isReadonly || this.isDisabled) return;\n\n this.dropdown.open(event);\n }\n\n protected updateInternalValue(value: Date | null): void {\n this.updateValue(value);\n this.updateDateField(value);\n }\n\n protected handleDateFieldChanges(): void {\n this.dateField?.valueChange$.pipe(this.takeUntilDestroyed()).subscribe(() => {\n if (!this.dateField?.valueAsDate) return;\n this.updateValue(this.dateField?.valueAsDate ?? null);\n });\n }\n\n protected handleDateFieldFocus(): void {\n this.dateField?.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 updateDateField(date: Date | null): void {\n if (!this.dateField) return;\n\n const dateFormat = getDateInputFormat(this.config);\n this.dateField.nativeElementValue = date ? format(date, dateFormat) : '';\n }\n}\n","<ng-content select=\"input[odxDatepickerControl]\" />\n\n<odx-action-group class=\"odx-datepicker__trigger-wrapper\">\n @if (clearable() && value) {\n <button odxButton class=\"odx-datepicker__clear\" (click)=\"reset()\" 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-datepicker__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]=\"value || today\"\n [filterFn]=\"filterFn\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n (selectedDateChange)=\"selectDate($event)\"\n />\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { DatepickerComponent } from './datepicker.component';\nimport { DatepickerInputControlDirective } from './directives';\n\nconst modules = [DatepickerComponent, DatepickerInputControlDirective];\n\n@NgModule({\n imports: modules,\n exports: [CoreModule, ...modules],\n})\nexport class DatepickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAQA;;;;;;;;;AASG;AAYI,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,qBAAqB,CAAA;AAAnE,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,CAA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AC,UAAU,EAAE,GAAG,OAAO,CAAC;AAClC,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-components-datepicker.mjs","sources":["../../../../libs/angular/components/datepicker/src/lib/directives/datepicker-input-control.directive.ts","../../../../libs/angular/components/datepicker/src/lib/datepicker.component.ts","../../../../libs/angular/components/datepicker/src/lib/datepicker.component.html","../../../../libs/angular/components/datepicker/src/lib/datepicker.module.ts","../../../../libs/angular/components/datepicker/src/odx-angular-components-datepicker.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 * A directive to enhance an input element as part of a datepicker control. It applies date input formatting,\n * mask handling, and emits focus events. This directive integrates with ngx-mask to handle input masking and\n * ensures that the input complies with the date format specified in the datepicker configuration.\n * Extends the `InputControlDirective` to provide input control functionality.\n * Has host directive `WithTabIndex` to manage the tabindex attribute of the input element.\n *\n * @see {InputControlDirective}\n * @see {WithTabIndex}\n */\n@CSSComponent('datepicker__control')\n@Directive({\n standalone: true,\n selector: 'input[odxDatepickerControl]',\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 DatepickerInputControlDirective 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 field receives focus or loses focus, indicating the focus state.\n *\n * @emits {boolean} - Indicates whether the input field is focused.\n */\n @Output()\n public focused = new EventEmitter<boolean>();\n\n /**\n * Gets the current value of the input field as a `Date` object, based on the date format from the datepicker\n * configuration.\n *\n * @returns {Date | null} - The current value of the input field as a `Date` object, or `null` if the value is invalid.\n */\n public get valueAsDate(): Date | null {\n return getDateInputValueAsDate(this.config, this.nativeElementValue);\n }\n\n /**\n * Computes the placeholder text for the input based on the date format from\n * the datepicker configuration.\n *\n * @returns {string} - The placeholder text, typically the date format in uppercase.\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 ContentChild,\n ElementRef,\n EventEmitter,\n HostListener,\n input,\n Input,\n Output,\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, DateFilter } 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 { DatepickerInputControlDirective } from './directives';\n\n/**\n * Represents a datepicker component for selecting a date.\n * Extends the `CustomFormControl` class and implements the `AfterViewInit` interface.\n *\n * @see {CustomFormControl}\n */\n@CSSComponent('datepicker')\n@Component({\n selector: 'odx-datepicker',\n standalone: true,\n imports: [A11yModule, ActionGroupComponent, ButtonComponent, CalendarComponent, DropdownModule, IconComponent],\n templateUrl: './datepicker.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class DatepickerComponent extends CustomFormControl<Date | null> implements AfterViewInit {\n protected readonly takeUntilDestroyed = untilDestroyed();\n\n protected readonly config = injectDateConfig();\n\n public readonly element = injectElement();\n\n /**\n * Gets a value indicating whether the datepicker is currently open.\n *\n * @returns {boolean}\n */\n public get isOpen(): boolean {\n return !!this.dropdown.isOpen;\n }\n\n /**\n * Represents the current date.\n *\n * @type {Date}\n */\n public today = new Date();\n\n /**\n * The filter function used to determine if a date should be included or excluded in the datepicker.\n * If set to `null`, no filtering will be applied.\n *\n * @type {DateFilter | null}\n * @default null\n *\n * @example\n * ```ts\n * // Excludes mondays from the datepicker.\n * const filterFn: DateFilter = (date) => date.getDay() !== 1;\n * ```\n */\n @Input()\n public filterFn: DateFilter | null = null;\n\n /**\n * The minimum selectable date for the datepicker.\n * If set to null, there is no minimum date restriction.\n *\n * @type {Date | null}\n * @default null\n */\n @Input()\n public minDate: Date | null = null;\n\n /**\n * The maximum selectable date for the datepicker.\n * If set to null, there is no maximum date restriction.\n *\n * @type {Date | null}\n * @default null\n */\n @Input()\n public maxDate: Date | null = null;\n\n /**\n * The position of the dropdown relative to the input field.\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 when it changes.\n *\n * @emits {Date}\n */\n @Output()\n public selectedChange = new EventEmitter<Date>();\n\n /**\n * The dropdown directive used in the datepicker component.\n *\n * @type {DropdownDirective}\n */\n @ViewChild(DropdownDirective)\n public dropdown!: DropdownDirective;\n\n /**\n * The dropdown trigger element used in the datepicker component.\n *\n * @type {ElementRef<HTMLElement>}\n */\n @ViewChild('dropdownTrigger', { read: ElementRef, static: true })\n public dropdownTriggerElement!: ElementRef<HTMLElement>;\n\n /**\n * The date field input control directive used in the datepicker component.\n *\n * @type {DatepickerInputControlDirective | undefined}\n */\n @ContentChild(DatepickerInputControlDirective)\n public dateField?: DatepickerInputControlDirective;\n\n constructor() {\n super(null);\n detectControllerChanges(this).subscribe();\n }\n\n public ngAfterViewInit(): void {\n this.handleDateFieldChanges();\n this.handleDateFieldFocus();\n\n deferFn(() => {\n if (!this.value) return;\n this.updateDateField(startOfDay(this.value));\n });\n }\n\n /**\n * Selects a date.\n *\n * @param {Date | null} value - The date value to be selected.\n */\n public selectDate(value: Date | null): void {\n if (!value) return;\n\n this.updateInternalValue(value);\n\n this.selectedChange.emit(value);\n\n this.dropdown.close();\n }\n\n /**\n * Resets the datepicker's value to null.\n */\n public reset(): void {\n this.updateInternalValue(null);\n }\n\n /**\n * @internal\n * Writes a new value to the element.\n * Part of the ControlValueAccessor interface.\n * @param {Date | null} value - The new value.\n */\n public override writeValue(value: Date | null): void {\n super.writeValue(value);\n this.updateDateField(value);\n }\n\n /**\n * Opens the datepicker dropdown.\n *\n * @param {KeyboardEvent} event\n */\n @HostListener('keydown.alt.ArrowDown', ['$event'])\n public openDatepicker(event?: KeyboardEvent) {\n event?.stopPropagation();\n\n if (this.isReadonly || this.isDisabled) return;\n\n this.dropdown.open(event);\n }\n\n protected updateInternalValue(value: Date | null): void {\n this.updateValue(value);\n this.updateDateField(value);\n }\n\n protected handleDateFieldChanges(): void {\n initNgxMask(this.dateField?.ngxMaskDirective, getDateInputMask(this.config));\n this.dateField?.valueChange$.pipe(this.takeUntilDestroyed()).subscribe(() => {\n if (!this.dateField?.valueAsDate) return;\n this.updateValue(this.dateField?.valueAsDate ?? null);\n });\n }\n\n protected handleDateFieldFocus(): void {\n this.dateField?.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 updateDateField(date: Date | null): void {\n if (!this.dateField) return;\n\n const dateFormat = getDateInputFormat(this.config);\n this.dateField.nativeElementValue = date ? format(date, dateFormat) : '';\n }\n}\n","<ng-content select=\"input[odxDatepickerControl]\" />\n\n<odx-action-group class=\"odx-datepicker__trigger-wrapper\">\n @if (clearable() && value) {\n <button odxButton class=\"odx-datepicker__clear\" (click)=\"reset()\" 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-datepicker__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]=\"value || today\"\n [filterFn]=\"filterFn\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n (selectedDateChange)=\"selectDate($event)\"\n />\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { DatepickerComponent } from './datepicker.component';\nimport { DatepickerInputControlDirective } from './directives';\n\nconst modules = [DatepickerComponent, DatepickerInputControlDirective];\n\n@NgModule({\n imports: modules,\n exports: [CoreModule, ...modules],\n})\nexport class DatepickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAOA;;;;;;;;;AASG;AAYI,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,qBAAqB,CAAA;AAAnE,IAAA,WAAA,GAAA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C,OAAO,EAAA,CAAA;sBADb,KAAK;gBAUC,gBAAgB,EAAA,CAAA;sBADtB,KAAK;gBAiBC,cAAc,EAAA,CAAA;sBADpB,MAAM;gBASA,QAAQ,EAAA,CAAA;sBADd,SAAS;uBAAC,iBAAiB,CAAA;gBASrB,sBAAsB,EAAA,CAAA;sBAD5B,SAAS;uBAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;gBASzD,SAAS,EAAA,CAAA;sBADf,YAAY;uBAAC,+BAA+B,CAAA;gBAyDtC,cAAc,EAAA,CAAA;sBADpB,YAAY;uBAAC,uBAAuB,EAAE,CAAC,QAAQ,CAAC,CAAA;;;AExMnD,MAAM,OAAO,GAAG,CAAC,mBAAmB,EAAE,+BAA+B,CAAC,CAAC;MAM1D,gBAAgB,CAAA;+GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;gHAAhB,gBAAgB,EAAA,OAAA,EAAA,CANZ,mBAAmB,EAAE,+BAA+B,aAIzD,UAAU,EAJL,mBAAmB,EAAE,+BAA+B,CAAA,EAAA,CAAA,CAAA,EAAA;gHAMxD,gBAAgB,EAAA,OAAA,EAAA,CANZ,mBAAmB,EAIxB,UAAU,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAET,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,OAAO;AAChB,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,GAAG,OAAO,CAAC;AAClC,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
@@ -6,19 +6,19 @@ import { inject, EventEmitter, Directive, Output, HostListener, input, booleanAt
6
6
  import * as i1 from '@odx/angular';
7
7
  import { ReadonlyController, WithTabIndex, detectControllerChanges, CoreModule } from '@odx/angular';
8
8
  import { InputControlDirective, CustomFormControl } from '@odx/angular/cdk/custom-form-control';
9
- import { injectDateConfig, getDateInputMask, getDateInputValueAsDate, getDateInputFormat } from '@odx/angular/cdk/date-input';
9
+ import { injectDateConfig, getDateInputValueAsDate, getDateInputFormat, initNgxMask, getDateInputMask } from '@odx/angular/cdk/date-input';
10
10
  export { DateConfig as DaterangepickerConfig, DateDefaultConfig as DaterangepickerDefaultConfig, InputDateOrder as DaterangepickerInputDateOrder, DateInputFormat as DaterangepickerInputFormat, DateInputMask as DaterangepickerInputMask, getDateInputFormat as getDaterangepickerInputFormat, getDateInputMask as getDaterangepickerInputMask, getDateInputValueAsDate as getDaterangepickerInputValueAsDate, injectDateConfig as injectDaterangepickerDateConfig, provideDateConfig as provideDaterangepickerConfig } from '@odx/angular/cdk/date-input';
11
11
  import { ActionGroupComponent } from '@odx/angular/components/action-group';
12
12
  import { ButtonComponent } from '@odx/angular/components/button';
13
13
  import { provideCalendarConfig, CalendarSelectionMode, CalendarComponent, validateDaterange } from '@odx/angular/components/calendar';
14
- import * as i2 from '@odx/angular/components/dropdown';
14
+ import * as i2$1 from '@odx/angular/components/dropdown';
15
15
  import { DropdownDirective, DropdownModule } from '@odx/angular/components/dropdown';
16
16
  import { IconComponent } from '@odx/angular/components/icon';
17
17
  import { CSSComponent } from '@odx/angular/internal';
18
18
  import { untilDestroyed, injectElement, deferFn } from '@odx/angular/utils';
19
19
  import { format, startOfDay } from 'date-fns';
20
- import { NgxMaskPipe, provideNgxMask } from 'ngx-mask';
21
- import { fromEvent, distinctUntilChanged, tap, map } from 'rxjs';
20
+ import * as i2 from 'ngx-mask';
21
+ import { NgxMaskDirective, provideNgxMask } from 'ngx-mask';
22
22
  import { NG_VALIDATORS } from '@angular/forms';
23
23
 
24
24
  /**
@@ -32,30 +32,15 @@ import { NG_VALIDATORS } from '@angular/forms';
32
32
  let DaterangepickerInputControlDirective = class DaterangepickerInputControlDirective extends InputControlDirective {
33
33
  constructor() {
34
34
  super(...arguments);
35
- this.maskConfig = { validation: false, leadZeroDateTime: true };
36
35
  this.readonlyController = ReadonlyController.inject();
37
36
  this.config = injectDateConfig();
38
- this.inputMask = getDateInputMask(this.config);
39
- this.ngxMaskPipe = inject(NgxMaskPipe);
37
+ this.ngxMaskDirective = inject(NgxMaskDirective);
40
38
  /**
41
39
  * Emits an event when the input gains or loses focus, facilitating external event handling.
42
40
  *
43
41
  * @emits {boolean} - Indicates whether the input is focused.
44
42
  */
45
43
  this.focused = new EventEmitter();
46
- /**
47
- * Captures and processes changes to the input element's value, applying the mask and updating
48
- * the form control.
49
- *
50
- * @emits {string} - The updated value of the input element.
51
- */
52
- this.valueChange$ = fromEvent(this.element.nativeElement, 'input').pipe(distinctUntilChanged(), tap(() => this.applyMask()), map(() => this.nativeElementValue));
53
- }
54
- /**
55
- * Applies the configured input mask to the native input element's value.
56
- */
57
- applyMask() {
58
- this.nativeElementValue = this.ngxMaskPipe.transform(this.nativeElementValue, this.inputMask, this.maskConfig);
59
44
  }
60
45
  /**
61
46
  * Converts the current input value to a Date object based on the configuration's date format.
@@ -80,7 +65,7 @@ let DaterangepickerInputControlDirective = class DaterangepickerInputControlDire
80
65
  this.focused.emit(false);
81
66
  }
82
67
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DaterangepickerInputControlDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
83
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DaterangepickerInputControlDirective, isStandalone: true, selector: "input[odxDaterangepickerControl],input[odxDaterangepickerStartDateControl], input[odxDaterangepickerEndDateControl]", outputs: { focused: "focused" }, host: { listeners: { "focusin": "handleFocusIn()", "focusout": "handleFocusOut()" }, properties: { "attr.readonly": "readonlyController?.readonly || null", "attr.placeholder": "placeholder" } }, providers: [ReadonlyController.connect(), provideNgxMask(), NgxMaskPipe], usesInheritance: true, hostDirectives: [{ directive: i1.WithTabIndex }], ngImport: i0 }); }
68
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DaterangepickerInputControlDirective, isStandalone: true, selector: "input[odxDaterangepickerControl],input[odxDaterangepickerStartDateControl], input[odxDaterangepickerEndDateControl]", outputs: { focused: "focused" }, host: { listeners: { "focusin": "handleFocusIn()", "focusout": "handleFocusOut()" }, properties: { "attr.readonly": "readonlyController?.readonly || null", "attr.placeholder": "placeholder" } }, providers: [ReadonlyController.connect(), provideNgxMask({ validation: false, leadZeroDateTime: true })], usesInheritance: true, hostDirectives: [{ directive: i1.WithTabIndex }, { directive: i2.NgxMaskDirective }], ngImport: i0 }); }
84
69
  };
85
70
  DaterangepickerInputControlDirective = __decorate([
86
71
  CSSComponent('daterangepicker__control')
@@ -94,8 +79,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
94
79
  '[attr.readonly]': 'readonlyController?.readonly || null',
95
80
  '[attr.placeholder]': 'placeholder',
96
81
  },
97
- providers: [ReadonlyController.connect(), provideNgxMask(), NgxMaskPipe],
98
- hostDirectives: [WithTabIndex],
82
+ providers: [ReadonlyController.connect(), provideNgxMask({ validation: false, leadZeroDateTime: true })],
83
+ hostDirectives: [WithTabIndex, NgxMaskDirective],
99
84
  }]
100
85
  }], propDecorators: { focused: [{
101
86
  type: Output
@@ -257,6 +242,8 @@ let DaterangepickerComponent = class DaterangepickerComponent extends CustomForm
257
242
  this.updateEndDateField(value.end);
258
243
  }
259
244
  handleDateFieldChanges() {
245
+ initNgxMask(this.startDateField?.ngxMaskDirective, getDateInputMask(this.config));
246
+ initNgxMask(this.endDateField?.ngxMaskDirective, getDateInputMask(this.config));
260
247
  this.startDateField?.valueChange$.pipe(this.takeUntilDestroyed()).subscribe((value) => {
261
248
  this.updateWidth(this.startDateField, this.startDateMirror, value);
262
249
  this.updateValue({ start: this.startDateField?.valueAsDate ?? null, end: this.endDateField?.valueAsDate ?? null });
@@ -321,7 +308,7 @@ let DaterangepickerComponent = class DaterangepickerComponent extends CustomForm
321
308
  displayAdjacentDays: false,
322
309
  selectionMode: CalendarSelectionMode.DateRange,
323
310
  }),
324
- ], queries: [{ propertyName: "dateFields", predicate: DaterangepickerInputControlDirective }], viewQueries: [{ propertyName: "dropdown", first: true, predicate: DropdownDirective, descendants: true }, { propertyName: "dropdownTriggerElement", first: true, predicate: ["dropdownTrigger"], descendants: true, read: ElementRef, static: true }, { propertyName: "startDateMirror", first: true, predicate: ["startDateMirror"], descendants: true, read: ElementRef, static: true }, { propertyName: "endDateMirror", first: true, predicate: ["endDateMirror"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<span #startDateMirror role=\"none\" class=\"odx-daterangepicker__mirror\"></span>\n<ng-content select=\"input[odxDaterangepickerStartDateControl]\" />\n<span role=\"none\" class=\"odx-daterangepicker__separator\">\u2013</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", dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: ActionGroupComponent, selector: "odx-action-group", inputs: ["reverse"] }, { kind: "component", type: ButtonComponent, selector: "button[odxButton], a[odxButton]", inputs: ["variant", "size"] }, { kind: "component", type: CalendarComponent, selector: "odx-calendar", inputs: ["selectedDate", "selectedDateRange", "minDate", "maxDate", "filterFn"], outputs: ["selectedDateChange", "selectedDateRangeChange"] }, { kind: "ngmodule", type: DropdownModule }, { 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: IconComponent, selector: "odx-icon", inputs: ["inline", "size", "name", "iconSet", "identifier"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
311
+ ], queries: [{ propertyName: "dateFields", predicate: DaterangepickerInputControlDirective }], viewQueries: [{ propertyName: "dropdown", first: true, predicate: DropdownDirective, descendants: true }, { propertyName: "dropdownTriggerElement", first: true, predicate: ["dropdownTrigger"], descendants: true, read: ElementRef, static: true }, { propertyName: "startDateMirror", first: true, predicate: ["startDateMirror"], descendants: true, read: ElementRef, static: true }, { propertyName: "endDateMirror", first: true, predicate: ["endDateMirror"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<span #startDateMirror role=\"none\" class=\"odx-daterangepicker__mirror\"></span>\n<ng-content select=\"input[odxDaterangepickerStartDateControl]\" />\n<span role=\"none\" class=\"odx-daterangepicker__separator\">\u2013</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", dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: ActionGroupComponent, selector: "odx-action-group", inputs: ["reverse"] }, { kind: "component", type: ButtonComponent, selector: "button[odxButton], a[odxButton]", inputs: ["variant", "size"] }, { kind: "component", type: CalendarComponent, selector: "odx-calendar", inputs: ["selectedDate", "selectedDateRange", "minDate", "maxDate", "filterFn"], outputs: ["selectedDateChange", "selectedDateRangeChange"] }, { kind: "ngmodule", type: DropdownModule }, { 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: IconComponent, selector: "odx-icon", inputs: ["inline", "size", "name", "iconSet", "identifier"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
325
312
  };
326
313
  DaterangepickerComponent = __decorate([
327
314
  CSSComponent('daterangepicker'),