@fundamental-ngx/cdk 0.42.0-rc.2 → 0.42.0-rc.21

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 (37) hide show
  1. package/data-source/data-source.directive.d.ts +2 -2
  2. package/esm2020/data-source/data-source.directive.mjs +7 -3
  3. package/esm2020/forms/cva/cva.directive.mjs +3 -9
  4. package/esm2020/utils/decorators/apply-css-class.decorator.mjs +16 -15
  5. package/esm2020/utils/decorators/apply-css-style.decorator.mjs +5 -7
  6. package/esm2020/utils/directives/focusable-item/focusable-item.directive.mjs +44 -33
  7. package/esm2020/utils/directives/focusable-list/focusable-list.directive.mjs +43 -21
  8. package/esm2020/utils/directives/selectable-list/selectable-item.directive.mjs +4 -8
  9. package/esm2020/utils/directives/selectable-list/selectable-item.token.mjs +1 -1
  10. package/esm2020/utils/drag-and-drop/dnd-list/dnd-list.directive.mjs +7 -2
  11. package/esm2020/utils/dynamic-component/dynamic-component-container.mjs +3 -3
  12. package/esm2020/utils/helpers/get-native-element.mjs +6 -5
  13. package/esm2020/utils/interfaces/has-element-ref.interface.mjs +1 -1
  14. package/fesm2015/fundamental-ngx-cdk-data-source.mjs +6 -2
  15. package/fesm2015/fundamental-ngx-cdk-data-source.mjs.map +1 -1
  16. package/fesm2015/fundamental-ngx-cdk-forms.mjs +3 -8
  17. package/fesm2015/fundamental-ngx-cdk-forms.mjs.map +1 -1
  18. package/fesm2015/fundamental-ngx-cdk-utils.mjs +117 -80
  19. package/fesm2015/fundamental-ngx-cdk-utils.mjs.map +1 -1
  20. package/fesm2020/fundamental-ngx-cdk-data-source.mjs +6 -2
  21. package/fesm2020/fundamental-ngx-cdk-data-source.mjs.map +1 -1
  22. package/fesm2020/fundamental-ngx-cdk-forms.mjs +3 -8
  23. package/fesm2020/fundamental-ngx-cdk-forms.mjs.map +1 -1
  24. package/fesm2020/fundamental-ngx-cdk-utils.mjs +117 -80
  25. package/fesm2020/fundamental-ngx-cdk-utils.mjs.map +1 -1
  26. package/forms/cva/cva.directive.d.ts +0 -2
  27. package/fundamental-ngx-cdk-v0.42.0-rc.21.tgz +0 -0
  28. package/package.json +3 -3
  29. package/utils/directives/focusable-item/focusable-item.directive.d.ts +20 -15
  30. package/utils/directives/focusable-list/focusable-list.directive.d.ts +28 -12
  31. package/utils/directives/selectable-list/selectable-item.directive.d.ts +2 -4
  32. package/utils/directives/selectable-list/selectable-item.token.d.ts +1 -1
  33. package/utils/drag-and-drop/dnd-list/dnd-list.directive.d.ts +3 -1
  34. package/utils/dynamic-component/dynamic-component-container.d.ts +2 -2
  35. package/utils/helpers/get-native-element.d.ts +3 -3
  36. package/utils/interfaces/has-element-ref.interface.d.ts +1 -1
  37. package/fundamental-ngx-cdk-v0.42.0-rc.2.tgz +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"fundamental-ngx-cdk-forms.mjs","sources":["../../../../libs/cdk/src/lib/forms/helpers/state.ts","../../../../libs/cdk/src/lib/forms/tokens/form-field.token.ts","../../../../libs/cdk/src/lib/forms/cva/cva.directive.ts","../../../../libs/cdk/src/lib/forms/forms.module.ts","../../../../libs/cdk/src/lib/forms/cva/cva-control.class.ts","../../../../libs/cdk/src/lib/forms/models/form-field.ts","../../../../libs/cdk/src/lib/forms/models/select-item.ts","../../../../libs/cdk/src/lib/forms/tokens/form-field-control.token.ts","../../../../libs/cdk/src/lib/forms/fundamental-ngx-cdk-forms.ts"],"sourcesContent":["import { FormStates } from '../models/form-state';\n\nconst stateSet = new Set<FormStates>(['success', 'error', 'warning', 'default', 'information']);\n\n/** Checks if the given state is a valid control state. */\nexport function isValidControlState(value: any): value is FormStates {\n return stateSet.has(value);\n}\n","import { InjectionToken } from '@angular/core';\nimport { FormField } from '../models/form-field';\n\nexport const FD_FORM_FIELD = new InjectionToken<FormField>('FdFormField');\n","import {\n AfterViewInit,\n Directive,\n DoCheck,\n ElementRef,\n EventEmitter,\n inject,\n Input,\n isDevMode,\n OnDestroy,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport { ControlContainer, ControlValueAccessor, FormControl, NgControl, NgForm } from '@angular/forms';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Subject, Subscription } from 'rxjs';\nimport { BaseCVA } from '../models/cva';\nimport { isValidControlState } from '../helpers/state';\nimport { FormStates } from '../models/form-state';\nimport { FormField } from '../models/form-field';\nimport { FormFieldControl } from '../models/form-field-control';\nimport { FD_FORM_FIELD } from '../tokens/form-field.token';\nimport { DestroyedService, Nullable } from '@fundamental-ngx/cdk/utils';\n\nlet randomId = 0;\n\n@Directive({\n selector: '[fdkCva]',\n standalone: true,\n providers: [DestroyedService]\n})\nexport class CvaDirective<T = any>\n implements BaseCVA, FormFieldControl, OnInit, DoCheck, AfterViewInit, OnDestroy, ControlValueAccessor\n{\n /**\n * NgControl instance.\n */\n readonly ngControl = inject(NgControl, {\n optional: true\n });\n\n /**\n * Form container instance. Usually ngForm or FormGroup directives.\n */\n readonly controlContainer = inject(ControlContainer, {\n optional: true,\n skipSelf: true\n });\n\n /**\n * Separate NgForm instance. For cases when formGroup is used with the form itself.\n */\n readonly ngForm = inject(NgForm, {\n optional: true,\n skipSelf: true\n });\n\n /**\n * Element reference.\n */\n readonly elementRef = inject(ElementRef);\n\n /** @hidden */\n value: T;\n\n /** @hidden */\n constructor() {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n /** @hidden */\n private _defaultId = `fd-input-id-${randomId++}`;\n /** @hidden */\n private _disabled: boolean;\n /** @hidden */\n private _editable = true;\n /** @hidden */\n private _destroyed = new Subject<void>();\n\n /** ID for the Element */\n @Input()\n id: string = this._defaultId;\n\n /** Input placeholder */\n @Input()\n placeholder: string;\n\n /**\n * The state of the form control - applies css classes.\n * Can be 'success', 'error', 'warning', 'default', 'information'.\n *\n * @default 'default'\n */\n @Input()\n set state(state: FormStates | undefined) {\n if (!state || isValidControlState(state)) {\n this._state = state;\n } else if (isDevMode()) {\n console.warn(`Provided value \"${state}\" is not a valid option for FormStates type`);\n }\n }\n get state(): FormStates {\n if (this._state) {\n return this._state;\n }\n\n if (!this.controlInvalid) {\n return 'default';\n }\n\n return this.formField?.getPriorityState() || 'error';\n }\n\n /** Holds the message with respect to state */\n @Input()\n stateMessage: Nullable<string>;\n\n /**\n * @hidden\n * The state of the form control - applies css classes.\n * Can be `success`, `error`, `warning`, `information` or 'default'\n */\n private _state: FormStates | undefined;\n\n /** Whether the input is disabled */\n @Input()\n set disabled(value: boolean) {\n this.setDisabledState(value);\n }\n get disabled(): boolean {\n if (this.ngControl && this.ngControl.disabled !== null) {\n return this.ngControl.disabled;\n }\n return this._disabled;\n }\n\n /**\n * readOnly Value to Mark component read only\n */\n @Input()\n readonly: boolean;\n\n /** Binds to control aria-labelledBy attribute */\n @Input()\n ariaLabelledBy: Nullable<string>;\n\n /** Sets control aria-label attribute value */\n @Input()\n ariaLabel: Nullable<string>;\n\n /**\n * Tell the component if we are in editing mode.\n */\n @Input()\n set editable(value: BooleanInput) {\n const newVal = coerceBooleanProperty(value);\n if (this._editable !== newVal) {\n this._editable = newVal;\n this._markForCheck();\n this.stateChanges.next('editable');\n }\n }\n get editable(): boolean {\n return this._editable;\n }\n\n /**\n * Name of the control.\n */\n @Input()\n name: string;\n\n /**\n * Emits when change detection is needed.\n */\n @Output()\n detectChanges = new EventEmitter<void>();\n\n /**\n * Emits when mark for changes detection is needed.\n */\n @Output()\n markForCheck = new EventEmitter<void>();\n\n /** @hidden */\n protected _subscriptions = new Subscription();\n\n /**\n * Reference to internal Input element\n */\n @ViewChild('inputElementRef', { static: true, read: ElementRef })\n protected _elementRef: ElementRef;\n\n /**\n * See @FormFieldControl\n */\n focused = false;\n\n /** Whether control has errors */\n get controlInvalid(): boolean {\n return this._controlInvalid;\n }\n\n /**\n * @hidden\n */\n private _controlInvalid = false;\n /**\n * See @FormFieldControl\n */\n readonly stateChanges: Subject<any> = new Subject<any>();\n\n /** @hidden */\n readonly formField: FormField | null = inject(FD_FORM_FIELD, {\n skipSelf: true,\n optional: true\n });\n\n /** set when input field is mandatory form field */\n required: boolean;\n\n /** @hidden */\n onChange: (value: any) => void = () => {};\n\n /** @hidden */\n onTouched = (): void => {};\n\n /** @hidden */\n ngOnInit(): void {\n this.formField?.registerFormFieldControl(this);\n }\n\n /**\n * Re-validate and emit event to parent container on every CD cycle as they are some errors\n * that we can't subscribe to.\n */\n ngDoCheck(): void {\n if (this.ngControl) {\n this.updateErrorState();\n }\n }\n\n /** @hidden */\n ngAfterViewInit(): void {\n if (this.ngControl) {\n this._subscriptions.add(\n this.ngControl.statusChanges?.subscribe(() => {\n this._markForCheck();\n })\n );\n }\n\n const labelAndHelpId = `fdp-form-label-content-${this.id}`;\n // if not specified, associate label and inline help ids with the input,\n // else add these ids to the specified ones\n if (!this.ariaLabelledBy) {\n this.ariaLabelledBy = labelAndHelpId;\n } else {\n this.ariaLabelledBy += ' ' + labelAndHelpId;\n }\n this._markForCheck();\n }\n\n /** @hidden */\n registerOnChange(fn: (_: any) => void): void {\n this.onChange = fn;\n }\n\n /** @hidden */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @hidden */\n ngOnDestroy(): void {\n this._subscriptions.unsubscribe();\n this.stateChanges.complete();\n this._destroyed.next();\n this._destroyed.complete();\n this.formField?.unregisterFormFieldControl(this);\n }\n\n /** @hidden */\n setDisabledState(isDisabled: BooleanInput): void {\n const newState = coerceBooleanProperty(isDisabled);\n this._markForCheck();\n if (newState !== this._disabled) {\n this._disabled = newState;\n this.stateChanges.next('setDisabledState');\n }\n }\n\n /**\n * Method for setting the value\n * @param value\n */\n writeValue(value: T): void {\n this.value = value;\n this.stateChanges.next('writeValue');\n this._markForCheck();\n }\n\n /**\n *\n * Keeps track of element focus\n */\n _onFocusChanged(isFocused: boolean): void {\n if (isFocused !== this.focused && (!this.disabled || !isFocused)) {\n this.focused = isFocused;\n this.stateChanges.next('_onFocusChanged');\n }\n\n if (!isFocused) {\n this.onTouched();\n }\n }\n\n /**\n * Handles even when we click on parent container which is the FormField Wrapping this\n * control\n */\n onContainerClick(event: MouseEvent): void {\n this.focus(event);\n }\n\n /**\n * In most of the cases when working with input element directly you should be just find to assign\n * variable to this element\n *\n * ```\n * <input #inputElementRef fd-form-control ...>\n * ```\n *\n * and this default behavior used. For other cases implement focus.\n *\n */\n focus(event?: MouseEvent): void {\n if (this._elementRef && !this.focused) {\n this._elementRef.nativeElement.focus(event);\n }\n }\n\n /**\n * Need re-validates errors on every CD iteration to make sure we are also\n * covering non-control errors, errors that happens outside of this control\n */\n updateErrorState(): void {\n const parent = this.ngForm;\n const parentControlContainer = this.controlContainer;\n const control = this.ngControl ? (this.ngControl.control as FormControl) : null;\n const newStatusIsError = !!(\n control?.invalid &&\n (control.dirty || control.touched || parent?.submitted || (parentControlContainer as any)?.submitted)\n );\n\n if (newStatusIsError !== this.controlInvalid) {\n this._controlInvalid = newStatusIsError;\n this.stateChanges.next('updateErrorState');\n this._markForCheck();\n }\n }\n\n /**\n * Used to change the value of a control.\n * @param value the value to be applied\n * @param emitOnChange whether to emit \"onChange\" event.\n * Should be \"false\", if the change is made programmatically (internally) by the control, \"true\" otherwise\n */\n setValue(value: T, emitOnChange = true): void {\n if (value !== this.value) {\n this.writeValue(value);\n if (emitOnChange) {\n this.onChange(value);\n }\n this._markForCheck();\n }\n }\n\n /** @hidden */\n private _markForCheck(): void {\n this.markForCheck.emit();\n }\n\n /** @hidden */\n private _detectChanges(): void {\n this.detectChanges.emit();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CvaDirective } from './cva/cva.directive';\n\n@NgModule({\n imports: [CvaDirective],\n exports: [CvaDirective]\n})\nexport class FormsModule {}\n","import { ChangeDetectorRef, inject, Injectable } from '@angular/core';\nimport { takeUntil } from 'rxjs';\nimport { CvaDirective } from './cva.directive';\nimport { DestroyedService } from '@fundamental-ngx/cdk/utils';\n\n/**\n * Base ControlValueAccessor control class.\n * Used in conjunction with CvaDirective.\n *\n * This class performs generic change detection based on `CvaDirective` outputs.\n */\n@Injectable()\nexport class CvaControl<T> {\n /**\n * Control value accessor directive instance.\n */\n public cvaDirective = inject<CvaDirective<T>>(CvaDirective, {\n self: true,\n optional: true\n });\n\n /**\n * Change detector instance.\n */\n protected _changeDetector = inject(ChangeDetectorRef);\n\n /** @Hidden */\n protected _destroy$ = inject(DestroyedService);\n\n /** @hidden */\n listenToChanges(): void {\n this.cvaDirective?.markForCheck.pipe(takeUntil(this._destroy$)).subscribe(() => {\n this._changeDetector.detectChanges();\n });\n\n this.cvaDirective?.detectChanges.pipe(takeUntil(this._destroy$)).subscribe(() => {\n this._changeDetector.detectChanges();\n });\n }\n}\n","import { QueryList } from '@angular/core';\nimport { FormError } from './form-error';\nimport { FormFieldControl } from './form-field-control';\nimport { FormStates } from './form-state';\n\n/**\n * FormField base class.\n *\n * This class is used to create form field components.\n *\n */\nexport abstract class FormField {\n /**\n * Register underlying form control\n */\n registerFormFieldControl: (control: FormFieldControl) => void;\n /**\n * Unregister underlying form control\n */\n unregisterFormFieldControl: (control: FormFieldControl) => void;\n\n /**\n * Set default columns layout\n */\n setDefaultColumnLayout: () => void;\n\n /** Gets field error priority state. */\n getPriorityState: () => FormStates;\n\n /** Groups errors. */\n groupErrors: () => void;\n\n /** Sets error directives from parent container */\n setErrorDirectives: (directives: QueryList<FormError>) => void;\n}\n","/**\n * Interface SelectItem is used to deal with complex object in order to be able to format\n * custom label that is shown in the options.\n *\n * Used in various controls: Select, RadioGroup, CheckboxGroup, Combobox\n */\nexport interface SelectItem<T = any> {\n /**\n * Item text shown in the popup\n */\n label: string;\n\n /**\n * References to the object instance\n */\n value: T;\n disabled?: boolean;\n\n icon?: string;\n /**\n * Trigger values is a text for selected item\n */\n triggerValue?: string;\n\n isGroup?: boolean;\n secondaryText?: string;\n children?: SelectItem[];\n}\n\nexport interface OptionItem<T = any> {\n /** Item text */\n label: string;\n\n /**\n * References to the object instance\n */\n value: T;\n id?: string;\n isGroup?: boolean;\n secondaryText?: string;\n children?: OptionItem[];\n}\n\nexport interface SelectableOptionItem<T = any> extends OptionItem<T> {\n selected?: boolean;\n children?: SelectableOptionItem[];\n}\n\n/** @hidden */\nexport function isSelectableItem(item: SelectItem): item is SelectItem {\n return (\n item &&\n item.label !== undefined &&\n item.value !== undefined &&\n Object.prototype.hasOwnProperty.call(item, 'selected')\n );\n}\n\n/** @hidden */\nexport function isSelectItem(item: SelectItem): item is SelectItem {\n return item && item.label !== undefined && item.value !== undefined;\n}\n\nexport const isOptionItem = isSelectItem;\nexport const isSelectableOptionItem = isSelectableItem;\n","import { InjectionToken } from '@angular/core';\nimport { FormFieldControl } from '../models/form-field-control';\n\nexport const FD_FORM_FIELD_CONTROL = new InjectionToken<FormFieldControl>('FdFormFieldControl');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEA,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAa,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC;AAEhG;AACM,SAAU,mBAAmB,CAAC,KAAU,EAAA;AAC1C,IAAA,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC/B;;MCJa,aAAa,GAAG,IAAI,cAAc,CAAY,aAAa;;ACsBxE,IAAI,QAAQ,GAAG,CAAC,CAAC;MAOJ,YAAY,CAAA;;AAmCrB,IAAA,WAAA,GAAA;AAhCA;;AAEG;AACM,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE;AACnC,YAAA,QAAQ,EAAE,IAAI;AACjB,SAAA,CAAC,CAAC;AAEH;;AAEG;AACM,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,EAAE;AACjD,YAAA,QAAQ,EAAE,IAAI;AACd,YAAA,QAAQ,EAAE,IAAI;AACjB,SAAA,CAAC,CAAC;AAEH;;AAEG;AACM,QAAA,IAAA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,CAAA;AAuB9B;;ACcD;AACM,SAAU,gBAAgB,CAAC,IAAgB,EAAA;AAC7C,IAAA,QACI,IAAI;QACJ,IAAI,CAAC,KAAK,KAAK,SAAS;QACxB,IAAI,CAAC,KAAK,KAAK,SAAS;AACxB,QAAA,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EACxD;AACN,CAAC;AAED;AACM,SAAU,YAAY,CAAC,IAAgB,EAAA;AACzC,IAAA,OAAO,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC;AACxE,CAAC;AAEM,MAAM,YAAY,GAAG,aAAa;AAClC,MAAM,sBAAsB,GAAG;;MC7DzB,qBAAqB,GAAG,IAAI,cAAc,CAAmB,oBAAoB;;ACH9F;;AAEG;;;;"}
1
+ {"version":3,"file":"fundamental-ngx-cdk-forms.mjs","sources":["../../../../libs/cdk/src/lib/forms/helpers/state.ts","../../../../libs/cdk/src/lib/forms/tokens/form-field.token.ts","../../../../libs/cdk/src/lib/forms/cva/cva.directive.ts","../../../../libs/cdk/src/lib/forms/forms.module.ts","../../../../libs/cdk/src/lib/forms/cva/cva-control.class.ts","../../../../libs/cdk/src/lib/forms/models/form-field.ts","../../../../libs/cdk/src/lib/forms/models/select-item.ts","../../../../libs/cdk/src/lib/forms/tokens/form-field-control.token.ts","../../../../libs/cdk/src/lib/forms/fundamental-ngx-cdk-forms.ts"],"sourcesContent":["import { FormStates } from '../models/form-state';\n\nconst stateSet = new Set<FormStates>(['success', 'error', 'warning', 'default', 'information']);\n\n/** Checks if the given state is a valid control state. */\nexport function isValidControlState(value: any): value is FormStates {\n return stateSet.has(value);\n}\n","import { InjectionToken } from '@angular/core';\nimport { FormField } from '../models/form-field';\n\nexport const FD_FORM_FIELD = new InjectionToken<FormField>('FdFormField');\n","import {\n AfterViewInit,\n Directive,\n DoCheck,\n ElementRef,\n EventEmitter,\n inject,\n Input,\n isDevMode,\n OnDestroy,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport { ControlContainer, ControlValueAccessor, FormControl, NgControl, NgForm } from '@angular/forms';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Subject, Subscription } from 'rxjs';\nimport { BaseCVA } from '../models/cva';\nimport { isValidControlState } from '../helpers/state';\nimport { FormStates } from '../models/form-state';\nimport { FormField } from '../models/form-field';\nimport { FormFieldControl } from '../models/form-field-control';\nimport { FD_FORM_FIELD } from '../tokens/form-field.token';\nimport { Nullable } from '@fundamental-ngx/cdk/utils';\n\nlet randomId = 0;\n\n@Directive({\n selector: '[fdkCva]',\n standalone: true\n})\nexport class CvaDirective<T = any>\n implements BaseCVA, FormFieldControl, OnInit, DoCheck, AfterViewInit, OnDestroy, ControlValueAccessor\n{\n /**\n * NgControl instance.\n */\n readonly ngControl = inject(NgControl, {\n optional: true\n });\n\n /**\n * Form container instance. Usually ngForm or FormGroup directives.\n */\n readonly controlContainer = inject(ControlContainer, {\n optional: true,\n skipSelf: true\n });\n\n /**\n * Separate NgForm instance. For cases when formGroup is used with the form itself.\n */\n readonly ngForm = inject(NgForm, {\n optional: true,\n skipSelf: true\n });\n\n /**\n * Element reference.\n */\n readonly elementRef = inject(ElementRef);\n\n /** @hidden */\n value: T;\n\n /** @hidden */\n constructor() {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n /** @hidden */\n private _defaultId = `fd-input-id-${randomId++}`;\n /** @hidden */\n private _disabled: boolean;\n /** @hidden */\n private _editable = true;\n\n /** ID for the Element */\n @Input()\n id: string = this._defaultId;\n\n /** Input placeholder */\n @Input()\n placeholder: string;\n\n /**\n * The state of the form control - applies css classes.\n * Can be 'success', 'error', 'warning', 'default', 'information'.\n *\n * @default 'default'\n */\n @Input()\n set state(state: FormStates | undefined) {\n if (!state || isValidControlState(state)) {\n this._state = state;\n } else if (isDevMode()) {\n console.warn(`Provided value \"${state}\" is not a valid option for FormStates type`);\n }\n }\n get state(): FormStates {\n if (this._state) {\n return this._state;\n }\n\n if (!this.controlInvalid) {\n return 'default';\n }\n\n return this.formField?.getPriorityState() || 'error';\n }\n\n /** Holds the message with respect to state */\n @Input()\n stateMessage: Nullable<string>;\n\n /**\n * @hidden\n * The state of the form control - applies css classes.\n * Can be `success`, `error`, `warning`, `information` or 'default'\n */\n private _state: FormStates | undefined;\n\n /** Whether the input is disabled */\n @Input()\n set disabled(value: boolean) {\n this.setDisabledState(value);\n }\n get disabled(): boolean {\n if (this.ngControl && this.ngControl.disabled !== null) {\n return this.ngControl.disabled;\n }\n return this._disabled;\n }\n\n /**\n * readOnly Value to Mark component read only\n */\n @Input()\n readonly: boolean;\n\n /** Binds to control aria-labelledBy attribute */\n @Input()\n ariaLabelledBy: Nullable<string>;\n\n /** Sets control aria-label attribute value */\n @Input()\n ariaLabel: Nullable<string>;\n\n /**\n * Tell the component if we are in editing mode.\n */\n @Input()\n set editable(value: BooleanInput) {\n const newVal = coerceBooleanProperty(value);\n if (this._editable !== newVal) {\n this._editable = newVal;\n this._markForCheck();\n this.stateChanges.next('editable');\n }\n }\n get editable(): boolean {\n return this._editable;\n }\n\n /**\n * Name of the control.\n */\n @Input()\n name: string;\n\n /**\n * Emits when change detection is needed.\n */\n @Output()\n detectChanges = new EventEmitter<void>();\n\n /**\n * Emits when mark for changes detection is needed.\n */\n @Output()\n markForCheck = new EventEmitter<void>();\n\n /** @hidden */\n protected _subscriptions = new Subscription();\n\n /**\n * Reference to internal Input element\n */\n @ViewChild('inputElementRef', { static: true, read: ElementRef })\n protected _elementRef: ElementRef;\n\n /**\n * See @FormFieldControl\n */\n focused = false;\n\n /** Whether control has errors */\n get controlInvalid(): boolean {\n return this._controlInvalid;\n }\n\n /**\n * @hidden\n */\n private _controlInvalid = false;\n /**\n * See @FormFieldControl\n */\n readonly stateChanges: Subject<any> = new Subject<any>();\n\n /** @hidden */\n readonly formField: FormField | null = inject(FD_FORM_FIELD, {\n skipSelf: true,\n optional: true\n });\n\n /** set when input field is mandatory form field */\n required: boolean;\n\n /** @hidden */\n onChange: (value: any) => void = () => {};\n\n /** @hidden */\n onTouched = (): void => {};\n\n /** @hidden */\n ngOnInit(): void {\n this.formField?.registerFormFieldControl(this);\n }\n\n /**\n * Re-validate and emit event to parent container on every CD cycle as they are some errors\n * that we can't subscribe to.\n */\n ngDoCheck(): void {\n if (this.ngControl) {\n this.updateErrorState();\n }\n }\n\n /** @hidden */\n ngAfterViewInit(): void {\n if (this.ngControl) {\n this._subscriptions.add(\n this.ngControl.statusChanges?.subscribe(() => {\n this._markForCheck();\n })\n );\n }\n\n const labelAndHelpId = `fdp-form-label-content-${this.id}`;\n // if not specified, associate label and inline help ids with the input,\n // else add these ids to the specified ones\n if (!this.ariaLabelledBy) {\n this.ariaLabelledBy = labelAndHelpId;\n } else {\n this.ariaLabelledBy += ' ' + labelAndHelpId;\n }\n this._markForCheck();\n }\n\n /** @hidden */\n registerOnChange(fn: (_: any) => void): void {\n this.onChange = fn;\n }\n\n /** @hidden */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @hidden */\n ngOnDestroy(): void {\n this._subscriptions.unsubscribe();\n this.stateChanges.complete();\n this.formField?.unregisterFormFieldControl(this);\n }\n\n /** @hidden */\n setDisabledState(isDisabled: BooleanInput): void {\n const newState = coerceBooleanProperty(isDisabled);\n this._markForCheck();\n if (newState !== this._disabled) {\n this._disabled = newState;\n this.stateChanges.next('setDisabledState');\n }\n }\n\n /**\n * Method for setting the value\n * @param value\n */\n writeValue(value: T): void {\n this.value = value;\n this.stateChanges.next('writeValue');\n this._markForCheck();\n }\n\n /**\n *\n * Keeps track of element focus\n */\n _onFocusChanged(isFocused: boolean): void {\n if (isFocused !== this.focused && (!this.disabled || !isFocused)) {\n this.focused = isFocused;\n this.stateChanges.next('_onFocusChanged');\n }\n\n if (!isFocused) {\n this.onTouched();\n }\n }\n\n /**\n * Handles even when we click on parent container which is the FormField Wrapping this\n * control\n */\n onContainerClick(event: MouseEvent): void {\n this.focus(event);\n }\n\n /**\n * In most of the cases when working with input element directly you should be just find to assign\n * variable to this element\n *\n * ```\n * <input #inputElementRef fd-form-control ...>\n * ```\n *\n * and this default behavior used. For other cases implement focus.\n *\n */\n focus(event?: MouseEvent): void {\n if (this._elementRef && !this.focused) {\n this._elementRef.nativeElement.focus(event);\n }\n }\n\n /**\n * Need re-validates errors on every CD iteration to make sure we are also\n * covering non-control errors, errors that happens outside of this control\n */\n updateErrorState(): void {\n const parent = this.ngForm;\n const parentControlContainer = this.controlContainer;\n const control = this.ngControl ? (this.ngControl.control as FormControl) : null;\n const newStatusIsError = !!(\n control?.invalid &&\n (control.dirty || control.touched || parent?.submitted || (parentControlContainer as any)?.submitted)\n );\n\n if (newStatusIsError !== this.controlInvalid) {\n this._controlInvalid = newStatusIsError;\n this.stateChanges.next('updateErrorState');\n this._markForCheck();\n }\n }\n\n /**\n * Used to change the value of a control.\n * @param value the value to be applied\n * @param emitOnChange whether to emit \"onChange\" event.\n * Should be \"false\", if the change is made programmatically (internally) by the control, \"true\" otherwise\n */\n setValue(value: T, emitOnChange = true): void {\n if (value !== this.value) {\n this.writeValue(value);\n if (emitOnChange) {\n this.onChange(value);\n }\n this._markForCheck();\n }\n }\n\n /** @hidden */\n private _markForCheck(): void {\n this.markForCheck.emit();\n }\n\n /** @hidden */\n private _detectChanges(): void {\n this.detectChanges.emit();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CvaDirective } from './cva/cva.directive';\n\n@NgModule({\n imports: [CvaDirective],\n exports: [CvaDirective]\n})\nexport class FormsModule {}\n","import { ChangeDetectorRef, inject, Injectable } from '@angular/core';\nimport { takeUntil } from 'rxjs';\nimport { CvaDirective } from './cva.directive';\nimport { DestroyedService } from '@fundamental-ngx/cdk/utils';\n\n/**\n * Base ControlValueAccessor control class.\n * Used in conjunction with CvaDirective.\n *\n * This class performs generic change detection based on `CvaDirective` outputs.\n */\n@Injectable()\nexport class CvaControl<T> {\n /**\n * Control value accessor directive instance.\n */\n public cvaDirective = inject<CvaDirective<T>>(CvaDirective, {\n self: true,\n optional: true\n });\n\n /**\n * Change detector instance.\n */\n protected _changeDetector = inject(ChangeDetectorRef);\n\n /** @Hidden */\n protected _destroy$ = inject(DestroyedService);\n\n /** @hidden */\n listenToChanges(): void {\n this.cvaDirective?.markForCheck.pipe(takeUntil(this._destroy$)).subscribe(() => {\n this._changeDetector.detectChanges();\n });\n\n this.cvaDirective?.detectChanges.pipe(takeUntil(this._destroy$)).subscribe(() => {\n this._changeDetector.detectChanges();\n });\n }\n}\n","import { QueryList } from '@angular/core';\nimport { FormError } from './form-error';\nimport { FormFieldControl } from './form-field-control';\nimport { FormStates } from './form-state';\n\n/**\n * FormField base class.\n *\n * This class is used to create form field components.\n *\n */\nexport abstract class FormField {\n /**\n * Register underlying form control\n */\n registerFormFieldControl: (control: FormFieldControl) => void;\n /**\n * Unregister underlying form control\n */\n unregisterFormFieldControl: (control: FormFieldControl) => void;\n\n /**\n * Set default columns layout\n */\n setDefaultColumnLayout: () => void;\n\n /** Gets field error priority state. */\n getPriorityState: () => FormStates;\n\n /** Groups errors. */\n groupErrors: () => void;\n\n /** Sets error directives from parent container */\n setErrorDirectives: (directives: QueryList<FormError>) => void;\n}\n","/**\n * Interface SelectItem is used to deal with complex object in order to be able to format\n * custom label that is shown in the options.\n *\n * Used in various controls: Select, RadioGroup, CheckboxGroup, Combobox\n */\nexport interface SelectItem<T = any> {\n /**\n * Item text shown in the popup\n */\n label: string;\n\n /**\n * References to the object instance\n */\n value: T;\n disabled?: boolean;\n\n icon?: string;\n /**\n * Trigger values is a text for selected item\n */\n triggerValue?: string;\n\n isGroup?: boolean;\n secondaryText?: string;\n children?: SelectItem[];\n}\n\nexport interface OptionItem<T = any> {\n /** Item text */\n label: string;\n\n /**\n * References to the object instance\n */\n value: T;\n id?: string;\n isGroup?: boolean;\n secondaryText?: string;\n children?: OptionItem[];\n}\n\nexport interface SelectableOptionItem<T = any> extends OptionItem<T> {\n selected?: boolean;\n children?: SelectableOptionItem[];\n}\n\n/** @hidden */\nexport function isSelectableItem(item: SelectItem): item is SelectItem {\n return (\n item &&\n item.label !== undefined &&\n item.value !== undefined &&\n Object.prototype.hasOwnProperty.call(item, 'selected')\n );\n}\n\n/** @hidden */\nexport function isSelectItem(item: SelectItem): item is SelectItem {\n return item && item.label !== undefined && item.value !== undefined;\n}\n\nexport const isOptionItem = isSelectItem;\nexport const isSelectableOptionItem = isSelectableItem;\n","import { InjectionToken } from '@angular/core';\nimport { FormFieldControl } from '../models/form-field-control';\n\nexport const FD_FORM_FIELD_CONTROL = new InjectionToken<FormFieldControl>('FdFormFieldControl');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEA,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAa,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC;AAEhG;AACM,SAAU,mBAAmB,CAAC,KAAU,EAAA;AAC1C,IAAA,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC/B;;MCJa,aAAa,GAAG,IAAI,cAAc,CAAY,aAAa;;ACsBxE,IAAI,QAAQ,GAAG,CAAC,CAAC;MAMJ,YAAY,CAAA;;AAmCrB,IAAA,WAAA,GAAA;AAhCA;;AAEG;AACM,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE;AACnC,YAAA,QAAQ,EAAE,IAAI;AACjB,SAAA,CAAC,CAAC;AAEH;;AAEG;AACM,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,EAAE;AACjD,YAAA,QAAQ,EAAE,IAAI;AACd,YAAA,QAAQ,EAAE,IAAI;AACjB,SAAA,CAAC,CAAC;AAEH;;AAEG;AACM,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE;AAC7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EAAE,SAAS,CAAC,MAAK;AAC3E,YAAA,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;AACzC,SAAC,CAAC,CAAC;AAEH,QAAA,CAAA,EAAA,GAAA,IAAI,CAAC,YAAY,0CAAE,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,MAAK;AAC5E,YAAA,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;AACzC,SAAC,CAAC,CAAC;KACN;;uGA1BQ,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;2GAAV,UAAU,EAAA,CAAA,CAAA;2FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBADtB,UAAU;;;ACNX;;;;;AAKG;MACmB,SAAS,CAAA;AAuB9B;;ACcD;AACM,SAAU,gBAAgB,CAAC,IAAgB,EAAA;AAC7C,IAAA,QACI,IAAI;QACJ,IAAI,CAAC,KAAK,KAAK,SAAS;QACxB,IAAI,CAAC,KAAK,KAAK,SAAS;AACxB,QAAA,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EACxD;AACN,CAAC;AAED;AACM,SAAU,YAAY,CAAC,IAAgB,EAAA;AACzC,IAAA,OAAO,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC;AACxE,CAAC;AAEM,MAAM,YAAY,GAAG,aAAa;AAClC,MAAM,sBAAsB,GAAG;;MC7DzB,qBAAqB,GAAG,IAAI,cAAc,CAAmB,oBAAoB;;ACH9F;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Injectable, Optional, Inject, isDevMode, inject, Directive, EventEmitter, Input, Output, HostListener, NgModule, ContentChildren, forwardRef, HostBinding, ElementRef, INJECTOR, ContentChild, Self, SkipSelf, PLATFORM_ID, QueryList, ViewContainerRef, Component, Injector, NgModuleFactory, Pipe, TemplateRef, ViewChild, NgZone } from '@angular/core';
2
+ import { InjectionToken, Injectable, Optional, Inject, isDevMode, inject, Directive, EventEmitter, Input, Output, HostListener, NgModule, ContentChildren, forwardRef, HostBinding, ElementRef, INJECTOR, ContentChild, NgZone, Renderer2, Self, SkipSelf, PLATFORM_ID, QueryList, ViewContainerRef, Component, Injector, NgModuleFactory, Pipe, TemplateRef, ViewChild } from '@angular/core';
3
3
  import { DOCUMENT, CommonModule, AsyncPipe } from '@angular/common';
4
4
  import { BehaviorSubject, Subject, ReplaySubject, Observable, fromEvent, NEVER, merge, Subscription, takeUntil as takeUntil$1, startWith as startWith$1, switchMap, combineLatest, firstValueFrom, filter as filter$1, isObservable, of, map as map$1, take as take$1 } from 'rxjs';
5
5
  import { takeUntil, filter, distinctUntilChanged, startWith, map, tap, take, debounceTime, mapTo, pairwise, finalize, shareReplay, switchMap as switchMap$1, delay } from 'rxjs/operators';
@@ -9,7 +9,7 @@ import { EVENT_MANAGER_PLUGINS } from '@angular/platform-browser';
9
9
  import { RIGHT_ARROW, DOWN_ARROW, LEFT_ARROW, UP_ARROW, SPACE, ESCAPE, DELETE, ENTER, MAC_ENTER, TAB, HOME, END, ALT, CONTROL, META, SHIFT, BACKSPACE, A, C, V, X, PAGE_UP, PAGE_DOWN, DASH, NUMPAD_MINUS, NUMPAD_ZERO, NUMPAD_ONE, NUMPAD_TWO, NUMPAD_THREE, NUMPAD_FOUR, NUMPAD_FIVE, NUMPAD_SIX, NUMPAD_SEVEN, NUMPAD_EIGHT, NUMPAD_NINE, F2, hasModifierKey } from '@angular/cdk/keycodes';
10
10
  import { coerceBooleanProperty, coerceElement, coerceNumberProperty, coerceArray, coerceCssPixelValue } from '@angular/cdk/coercion';
11
11
  import * as i1$1 from '@angular/cdk/a11y';
12
- import { FocusKeyManager } from '@angular/cdk/a11y';
12
+ import { FocusKeyManager, LiveAnnouncer } from '@angular/cdk/a11y';
13
13
  import { createFocusTrap } from 'focus-trap';
14
14
  import * as i1$2 from '@angular/cdk/observers';
15
15
  import * as i1$3 from '@angular/cdk/overlay';
@@ -1362,16 +1362,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
1362
1362
  */
1363
1363
  function getNativeElement(element) {
1364
1364
  let coercible = element;
1365
- if (isHasElementRef(element)) {
1366
- coercible = element.elementRef();
1365
+ if (hasElementRef(element)) {
1366
+ coercible = element.elementRef;
1367
1367
  }
1368
1368
  return coerceElement(coercible);
1369
1369
  }
1370
1370
  /**
1371
1371
  * Checks whether object has element reference in it.
1372
1372
  */
1373
- function isHasElementRef(something) {
1374
- return something && typeof something['elementRef'] === 'function';
1373
+ function hasElementRef(something) {
1374
+ return something && something['elementRef'] instanceof ElementRef;
1375
1375
  }
1376
1376
 
1377
1377
  class AttributeObserver {
@@ -2958,12 +2958,7 @@ class FocusableItemDirective {
2958
2958
  return this._tabbable ? 0 : -1;
2959
2959
  }
2960
2960
  /** @hidden */
2961
- constructor(_elementRef, _focusableObserver, _destroy$, _tabbableElementService, _liveAnnouncer) {
2962
- this._elementRef = _elementRef;
2963
- this._focusableObserver = _focusableObserver;
2964
- this._destroy$ = _destroy$;
2965
- this._tabbableElementService = _tabbableElementService;
2966
- this._liveAnnouncer = _liveAnnouncer;
2961
+ constructor() {
2967
2962
  /** Function, which returns a string to be announced by screen-reader whenever an item which is in grid receives focus. */
2968
2963
  this.cellFocusedEventAnnouncer = this._defaultItemFocusedEventAnnouncer;
2969
2964
  /** Event emitted when the cell receives focus, not being emitted when focus moves between item's children. */
@@ -2976,18 +2971,45 @@ class FocusableItemDirective {
2976
2971
  this._tabbableElements = new Map();
2977
2972
  /** @hidden */
2978
2973
  this._tabbable = true;
2974
+ /** Element reference. */
2975
+ this.elementRef = inject(ElementRef);
2976
+ /** @hidden */
2977
+ this._focusableObserver = inject(FocusableObserver);
2978
+ /** @hidden */
2979
+ this._destroy$ = inject(DestroyedService);
2980
+ /** @hidden */
2981
+ this._tabbableElementService = inject(TabbableElementService);
2982
+ /** @hidden */
2983
+ this._liveAnnouncer = inject(LiveAnnouncer);
2984
+ /** @hidden */
2985
+ this._zone = inject(NgZone);
2986
+ /** @hidden */
2987
+ this._document = inject(DOCUMENT);
2979
2988
  this._focusableObserver
2980
- .observe(this._elementRef, false)
2989
+ .observe(this.elementRef, false)
2981
2990
  .pipe(takeUntil$1(this._destroy$))
2982
2991
  .subscribe((isFocusable) => {
2983
2992
  if (!isFocusable && isFocusable !== this.fdkFocusableItem) {
2984
2993
  this.fdkFocusableItem = isFocusable;
2985
2994
  }
2986
2995
  });
2987
- }
2988
- /** Element reference. */
2989
- elementRef() {
2990
- return this._elementRef;
2996
+ this._zone.runOutsideAngular(() => {
2997
+ fromEvent(this.elementRef.nativeElement, 'focusin')
2998
+ .pipe(takeUntil$1(this._destroy$))
2999
+ .subscribe(() => __awaiter(this, void 0, void 0, function* () {
3000
+ yield this._onFocusin();
3001
+ }));
3002
+ fromEvent(this.elementRef.nativeElement, 'focusout')
3003
+ .pipe(takeUntil$1(this._destroy$))
3004
+ .subscribe(() => {
3005
+ this._onFocusout();
3006
+ });
3007
+ fromEvent(this.elementRef.nativeElement, 'keydown')
3008
+ .pipe(takeUntil$1(this._destroy$))
3009
+ .subscribe((event) => {
3010
+ this._onKeydown(event);
3011
+ });
3012
+ });
2991
3013
  }
2992
3014
  /** Set tabbable state */
2993
3015
  setTabbable(state) {
@@ -3032,18 +3054,18 @@ class FocusableItemDirective {
3032
3054
  if (!this.fdkFocusableItem) {
3033
3055
  return;
3034
3056
  }
3035
- const isFocused = document.activeElement === this._elementRef.nativeElement;
3057
+ const isFocused = this._document.activeElement === this.elementRef.nativeElement;
3036
3058
  const shouldFocusChild = KeyUtil.isKeyCode(event, [ENTER, MAC_ENTER, F2]) && !event.shiftKey && isFocused;
3037
3059
  const shouldFocusCell = ((KeyUtil.isKeyCode(event, F2) && event.shiftKey) || KeyUtil.isKeyCode(event, ESCAPE)) && !isFocused;
3038
3060
  if (shouldFocusChild) {
3039
3061
  event.stopPropagation();
3040
- const tabbableElement = this._tabbableElementService.getTabbableElement(this.elementRef().nativeElement, false, true);
3062
+ const tabbableElement = this._tabbableElementService.getTabbableElement(this.elementRef.nativeElement, false, true);
3041
3063
  tabbableElement === null || tabbableElement === void 0 ? void 0 : tabbableElement.focus();
3042
3064
  return;
3043
3065
  }
3044
3066
  else if (shouldFocusCell) {
3045
3067
  event.stopPropagation();
3046
- this._elementRef.nativeElement.focus();
3068
+ this.elementRef.nativeElement.focus();
3047
3069
  return;
3048
3070
  }
3049
3071
  if (isFocused) {
@@ -3062,7 +3084,7 @@ class FocusableItemDirective {
3062
3084
  _disableTabbableElements() {
3063
3085
  // Since we cannot select by tabindex attribute (links, inputs, buttons might not have one but still can be focusable),
3064
3086
  // Select all elements from the cell and filter by tabIndex property.
3065
- Array.from(this._elementRef.nativeElement.querySelectorAll('*'))
3087
+ Array.from(this.elementRef.nativeElement.querySelectorAll('*'))
3066
3088
  .filter((elm) => elm.tabIndex >= 0)
3067
3089
  .forEach((elm) => {
3068
3090
  this._tabbableElements.set(elm, elm.tabIndex);
@@ -3074,8 +3096,8 @@ class FocusableItemDirective {
3074
3096
  return `Column ${position.colIndex + 1} of ${position.totalCols}, row: ${position.rowIndex + 1} of ${position.totalRows}`;
3075
3097
  }
3076
3098
  }
3077
- FocusableItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FocusableItemDirective, deps: [{ token: i0.ElementRef }, { token: FocusableObserver }, { token: DestroyedService }, { token: TabbableElementService }, { token: i1$1.LiveAnnouncer }], target: i0.ɵɵFactoryTarget.Directive });
3078
- FocusableItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.8", type: FocusableItemDirective, isStandalone: true, selector: "[fdkFocusableItem]", inputs: { fdkFocusableItem: "fdkFocusableItem", cellFocusedEventAnnouncer: "cellFocusedEventAnnouncer" }, outputs: { cellFocused: "cellFocused" }, host: { listeners: { "focusin": "_onFocusin()", "focusout": "_onFocusout()", "keydown": "_onKeydown($event)" }, properties: { "attr.tabindex": "this._tabindex" } }, providers: [
3099
+ FocusableItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FocusableItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3100
+ FocusableItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.8", type: FocusableItemDirective, isStandalone: true, selector: "[fdkFocusableItem]", inputs: { fdkFocusableItem: "fdkFocusableItem", cellFocusedEventAnnouncer: "cellFocusedEventAnnouncer" }, outputs: { cellFocused: "cellFocused" }, host: { properties: { "attr.tabindex": "this._tabindex" } }, providers: [
3079
3101
  {
3080
3102
  provide: FDK_FOCUSABLE_ITEM_DIRECTIVE,
3081
3103
  useExisting: FocusableItemDirective
@@ -3095,7 +3117,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
3095
3117
  DestroyedService
3096
3118
  ]
3097
3119
  }]
3098
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: FocusableObserver }, { type: DestroyedService }, { type: TabbableElementService }, { type: i1$1.LiveAnnouncer }]; }, propDecorators: { fdkFocusableItem: [{
3120
+ }], ctorParameters: function () { return []; }, propDecorators: { fdkFocusableItem: [{
3099
3121
  type: Input
3100
3122
  }], cellFocusedEventAnnouncer: [{
3101
3123
  type: Input
@@ -3104,15 +3126,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
3104
3126
  }], _tabindex: [{
3105
3127
  type: HostBinding,
3106
3128
  args: ['attr.tabindex']
3107
- }], _onFocusin: [{
3108
- type: HostListener,
3109
- args: ['focusin']
3110
- }], _onFocusout: [{
3111
- type: HostListener,
3112
- args: ['focusout']
3113
- }], _onKeydown: [{
3114
- type: HostListener,
3115
- args: ['keydown', ['$event']]
3116
3129
  }] } });
3117
3130
 
3118
3131
  class FocusableItemModule {
@@ -3384,16 +3397,15 @@ class FocusableListDirective {
3384
3397
  return this._focusable;
3385
3398
  }
3386
3399
  /** @hidden */
3400
+ get _focusableItems() {
3401
+ return this._items ? this._items : this._projectedFocusableItems;
3402
+ }
3403
+ /** @hidden */
3387
3404
  get _tabindex() {
3388
3405
  return this._tabbable ? 0 : -1;
3389
3406
  }
3390
3407
  /** @hidden */
3391
- constructor(_renderer, _destroy$, _elementRef, _liveAnnouncer, _focusableObserver) {
3392
- this._renderer = _renderer;
3393
- this._destroy$ = _destroy$;
3394
- this._elementRef = _elementRef;
3395
- this._liveAnnouncer = _liveAnnouncer;
3396
- this._focusableObserver = _focusableObserver;
3408
+ constructor() {
3397
3409
  /** @hidden */
3398
3410
  this._focusable = false;
3399
3411
  /** Direction of navigation. Should be set to 'grid' when list is a part of grid. */
@@ -3419,6 +3431,20 @@ class FocusableListDirective {
3419
3431
  /** @hidden */
3420
3432
  this._refreshItems$ = new Subject();
3421
3433
  /** @hidden */
3434
+ this._refresh$ = new Subject();
3435
+ /** @hidden */
3436
+ this._renderer = inject(Renderer2);
3437
+ /** @hidden */
3438
+ this._destroy$ = inject(DestroyedService);
3439
+ /** @hidden */
3440
+ this._elementRef = inject(ElementRef);
3441
+ /** @hidden */
3442
+ this._liveAnnouncer = inject(LiveAnnouncer);
3443
+ /** @hidden */
3444
+ this._focusableObserver = inject(FocusableObserver);
3445
+ /** @hidden */
3446
+ this._document = inject(DOCUMENT);
3447
+ /** @hidden */
3422
3448
  this._isVisible = false;
3423
3449
  intersectionObservable(this._elementRef.nativeElement, { threshold: 0.25 })
3424
3450
  .pipe(takeUntil(this._destroy$))
@@ -3446,13 +3472,24 @@ class FocusableListDirective {
3446
3472
  }
3447
3473
  /** @hidden */
3448
3474
  ngAfterViewInit() {
3475
+ this._listenOnItems();
3476
+ }
3477
+ /** Set items programmatically. */
3478
+ setItems(items) {
3479
+ this._items = items;
3480
+ this._listenOnItems();
3481
+ }
3482
+ /** @hidden */
3483
+ _listenOnItems() {
3484
+ const refresh$ = merge(this._refresh$, this._destroy$);
3485
+ this._refresh$.next();
3449
3486
  this._focusableItems.changes
3450
- .pipe(startWith(this._focusableItems), map((queryList) => queryList.toArray()), tap((items) => {
3487
+ .pipe(startWith(null), map(() => this._focusableItems.toArray()), tap((items) => {
3451
3488
  const focusableItems = items.map((item, index) => ({
3452
3489
  index,
3453
3490
  focusable: () => item.fdkFocusableItem,
3454
- elementRef: () => item.elementRef(),
3455
- focus: () => item.elementRef().nativeElement.focus(),
3491
+ elementRef: item.elementRef,
3492
+ focus: () => item.elementRef.nativeElement.focus(),
3456
3493
  keydown: item._keydown$
3457
3494
  }));
3458
3495
  const direction = this.navigationDirection === 'grid' ? 'horizontal' : this.navigationDirection;
@@ -3461,7 +3498,7 @@ class FocusableListDirective {
3461
3498
  contentDirection: this.contentDirection,
3462
3499
  wrap: this.wrap
3463
3500
  });
3464
- }), takeUntil(this._destroy$))
3501
+ }), takeUntil(refresh$))
3465
3502
  .subscribe();
3466
3503
  }
3467
3504
  /** @hidden */
@@ -3476,7 +3513,7 @@ class FocusableListDirective {
3476
3513
  if (event.defaultPrevented) {
3477
3514
  return;
3478
3515
  }
3479
- const isFocused = document.activeElement === this._elementRef.nativeElement;
3516
+ const isFocused = this._document.activeElement === this._elementRef.nativeElement;
3480
3517
  const shouldFocusChild = KeyUtil.isKeyCode(event, [ENTER, MAC_ENTER, F2]) && !event.shiftKey && isFocused;
3481
3518
  const shouldFocusList = ((KeyUtil.isKeyCode(event, F2) && event.shiftKey) || KeyUtil.isKeyCode(event, ESCAPE)) && !isFocused;
3482
3519
  if (shouldFocusChild) {
@@ -3503,7 +3540,7 @@ class FocusableListDirective {
3503
3540
  return false;
3504
3541
  });
3505
3542
  if (availableIndex != null) {
3506
- scrollIntoView((_a = this._focusableItems.get(availableIndex)) === null || _a === void 0 ? void 0 : _a.elementRef().nativeElement, scrollPosition);
3543
+ scrollIntoView((_a = this._focusableItems.get(availableIndex)) === null || _a === void 0 ? void 0 : _a.elementRef.nativeElement, scrollPosition);
3507
3544
  (_b = this._keyManager) === null || _b === void 0 ? void 0 : _b.setActiveItem(availableIndex);
3508
3545
  }
3509
3546
  }
@@ -3597,14 +3634,14 @@ class FocusableListDirective {
3597
3634
  return `Row: ${position.rowIndex + 1} of ${position.totalRows}, use F2 button to dive in and focus list's item`;
3598
3635
  }
3599
3636
  }
3600
- FocusableListDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FocusableListDirective, deps: [{ token: i0.Renderer2 }, { token: DestroyedService }, { token: i0.ElementRef }, { token: i1$1.LiveAnnouncer }, { token: FocusableObserver }], target: i0.ɵɵFactoryTarget.Directive });
3637
+ FocusableListDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FocusableListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3601
3638
  FocusableListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.8", type: FocusableListDirective, isStandalone: true, selector: "[fdkFocusableList]", inputs: { focusable: "focusable", navigationDirection: "navigationDirection", contentDirection: "contentDirection", wrap: "wrap", listFocusedEventAnnouncer: "listFocusedEventAnnouncer" }, outputs: { itemFocused: "itemFocused" }, host: { listeners: { "keydown": "_onKeydown($event)", "focus": "_onFocus()" }, properties: { "attr.tabindex": "this._tabindex" } }, providers: [
3602
3639
  {
3603
3640
  provide: FDK_FOCUSABLE_LIST_DIRECTIVE,
3604
3641
  useExisting: FocusableListDirective
3605
3642
  },
3606
3643
  DestroyedService
3607
- ], queries: [{ propertyName: "_focusableItems", predicate: FDK_FOCUSABLE_ITEM_DIRECTIVE, descendants: true }], exportAs: ["fdkFocusableList"], usesOnChanges: true, ngImport: i0 });
3644
+ ], queries: [{ propertyName: "_projectedFocusableItems", predicate: FDK_FOCUSABLE_ITEM_DIRECTIVE, descendants: true }], exportAs: ["fdkFocusableList"], usesOnChanges: true, ngImport: i0 });
3608
3645
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FocusableListDirective, decorators: [{
3609
3646
  type: Directive,
3610
3647
  args: [{
@@ -3619,7 +3656,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
3619
3656
  DestroyedService
3620
3657
  ]
3621
3658
  }]
3622
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: DestroyedService }, { type: i0.ElementRef }, { type: i1$1.LiveAnnouncer }, { type: FocusableObserver }]; }, propDecorators: { focusable: [{
3659
+ }], ctorParameters: function () { return []; }, propDecorators: { focusable: [{
3623
3660
  type: Input
3624
3661
  }], navigationDirection: [{
3625
3662
  type: Input
@@ -3631,7 +3668,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
3631
3668
  type: Input
3632
3669
  }], itemFocused: [{
3633
3670
  type: Output
3634
- }], _focusableItems: [{
3671
+ }], _projectedFocusableItems: [{
3635
3672
  type: ContentChildren,
3636
3673
  args: [FDK_FOCUSABLE_ITEM_DIRECTIVE, { descendants: true }]
3637
3674
  }], _tabindex: [{
@@ -4811,13 +4848,13 @@ class SelectableItemDirective {
4811
4848
  (!this.readonly$ || !((_c = this.readonly$) === null || _c === void 0 ? void 0 : _c.fdkReadonly)));
4812
4849
  }
4813
4850
  /** @hidden */
4814
- constructor(provider, disabled$, readonly$, selectionService, _elementRef, _cd, _clicked) {
4851
+ constructor(provider, disabled$, readonly$, selectionService, elementRef, _cd, _clicked) {
4815
4852
  var _a;
4816
4853
  this.provider = provider;
4817
4854
  this.disabled$ = disabled$;
4818
4855
  this.readonly$ = readonly$;
4819
4856
  this.selectionService = selectionService;
4820
- this._elementRef = _elementRef;
4857
+ this.elementRef = elementRef;
4821
4858
  this._cd = _cd;
4822
4859
  /** Event emitted when selection state being changed for selectable item. */
4823
4860
  this.selected = new EventEmitter();
@@ -4844,7 +4881,7 @@ class SelectableItemDirective {
4844
4881
  }
4845
4882
  else {
4846
4883
  this._selected = isSelected;
4847
- const htmlElement = this._elementRef.nativeElement;
4884
+ const htmlElement = this.elementRef.nativeElement;
4848
4885
  const { classList } = htmlElement;
4849
4886
  if (isSelected) {
4850
4887
  classList.add('is-selected');
@@ -4857,10 +4894,6 @@ class SelectableItemDirective {
4857
4894
  this.selected.emit(isSelected);
4858
4895
  }
4859
4896
  /** @hidden */
4860
- elementRef() {
4861
- return this._elementRef;
4862
- }
4863
- /** @hidden */
4864
4897
  _listenToDisablingEvents() {
4865
4898
  const disablingEvents$ = [];
4866
4899
  if (this.disabled$) {
@@ -5236,6 +5269,8 @@ class DndListDirective {
5236
5269
  this.itemsChange = new EventEmitter();
5237
5270
  /** Event that is thrown when the item is dropped */
5238
5271
  this.itemDropped = new EventEmitter();
5272
+ /** Event that is thrown when predicate function returned false. */
5273
+ this.dropCancelled = new EventEmitter();
5239
5274
  /** @hidden */
5240
5275
  this._closestItemIndex = null;
5241
5276
  /** @hidden */
@@ -5377,6 +5412,7 @@ class DndListDirective {
5377
5412
  this._closestItemIndex = null;
5378
5413
  this._closestItemPosition = null;
5379
5414
  if (!result) {
5415
+ this.dropCancelled.emit();
5380
5416
  return;
5381
5417
  }
5382
5418
  if (draggedItemIndex !== replacedItemIndex) {
@@ -5513,7 +5549,7 @@ class DndListDirective {
5513
5549
  }
5514
5550
  }
5515
5551
  DndListDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DndListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5516
- DndListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.8", type: DndListDirective, selector: "[fdkDndList], [fd-dnd-list]", inputs: { gridMode: "gridMode", dropMode: "dropMode", threshold: "threshold", replaceMode: "replaceMode", items: "items", draggable: "draggable", dropPredicate: "dropPredicate", dragoverPredicate: "dragoverPredicate" }, outputs: { dropPredicateCalculating: "dropPredicateCalculating", itemsChange: "itemsChange", itemDropped: "itemDropped" }, host: { properties: { "class": "this._initialClass" } }, providers: [{ provide: DND_LIST, useExisting: forwardRef(() => DndListDirective) }], queries: [{ propertyName: "dndItems", predicate: DND_ITEM }], ngImport: i0 });
5552
+ DndListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.8", type: DndListDirective, selector: "[fdkDndList], [fd-dnd-list]", inputs: { gridMode: "gridMode", dropMode: "dropMode", threshold: "threshold", replaceMode: "replaceMode", items: "items", draggable: "draggable", dropPredicate: "dropPredicate", dragoverPredicate: "dragoverPredicate" }, outputs: { dropPredicateCalculating: "dropPredicateCalculating", itemsChange: "itemsChange", itemDropped: "itemDropped", dropCancelled: "dropCancelled" }, host: { properties: { "class": "this._initialClass" } }, providers: [{ provide: DND_LIST, useExisting: forwardRef(() => DndListDirective) }], queries: [{ propertyName: "dndItems", predicate: DND_ITEM }], ngImport: i0 });
5517
5553
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DndListDirective, decorators: [{
5518
5554
  type: Directive,
5519
5555
  args: [{
@@ -5542,6 +5578,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
5542
5578
  type: Output
5543
5579
  }], itemDropped: [{
5544
5580
  type: Output
5581
+ }], dropCancelled: [{
5582
+ type: Output
5545
5583
  }], dndItems: [{
5546
5584
  type: ContentChildren,
5547
5585
  args: [DND_ITEM]
@@ -6167,25 +6205,26 @@ function applyCssClass(target, propertyKey, descriptor) {
6167
6205
  const originalMethod = descriptor.value;
6168
6206
  descriptor.value = function () {
6169
6207
  const self = this;
6170
- if (!self.elementRef) {
6208
+ if (!('elementRef' in self)) {
6171
6209
  throw ELEMENT_REF_EXCEPTION;
6172
6210
  }
6173
6211
  const classListToApply = sanitize(originalMethod.apply(this));
6174
- const elementRef = self.elementRef.apply(this);
6212
+ const elementRef = self.elementRef;
6175
6213
  const nativeElement = elementRef === null || elementRef === void 0 ? void 0 : elementRef.nativeElement;
6176
- if (nativeElement) {
6177
- if (!nativeElement._classMap) {
6178
- nativeElement._classMap = {};
6179
- }
6180
- if (!self._uuidv4) {
6181
- self._uuidv4 = uuidv4();
6182
- }
6183
- const currentClassList = Array.from(nativeElement.classList);
6184
- const previousClassListToApply = nativeElement._classMap[self._uuidv4] || [];
6185
- const newClassList = createComponentClassList(currentClassList, previousClassListToApply, classListToApply);
6186
- nativeElement.className = newClassList.join(' ');
6187
- nativeElement._classMap[self._uuidv4] = classListToApply;
6214
+ if (!nativeElement) {
6215
+ return classListToApply;
6188
6216
  }
6217
+ if (!nativeElement._classMap) {
6218
+ nativeElement._classMap = {};
6219
+ }
6220
+ if (!self._uuidv4) {
6221
+ self._uuidv4 = uuidv4();
6222
+ }
6223
+ const currentClassList = Array.from(nativeElement.classList);
6224
+ const previousClassListToApply = nativeElement._classMap[self._uuidv4] || [];
6225
+ const newClassList = createComponentClassList(currentClassList, previousClassListToApply, classListToApply);
6226
+ nativeElement.className = newClassList.join(' ');
6227
+ nativeElement._classMap[self._uuidv4] = classListToApply;
6189
6228
  return classListToApply;
6190
6229
  };
6191
6230
  }
@@ -6229,12 +6268,10 @@ function applyCssStyle(target, propertyKey, descriptor) {
6229
6268
  throw ELEMENT_REF_EXCEPTION;
6230
6269
  }
6231
6270
  const _styles = originalMethod.apply(this);
6232
- if (self.elementRef()) {
6233
- const htmlElement = self.elementRef().nativeElement;
6234
- Object.keys(_styles).forEach((key) => {
6235
- htmlElement.style[key] = _styles[key];
6236
- });
6237
- }
6271
+ const htmlElement = self.elementRef.nativeElement;
6272
+ Object.keys(_styles).forEach((key) => {
6273
+ htmlElement.style[key] = _styles[key];
6274
+ });
6238
6275
  return _styles;
6239
6276
  };
6240
6277
  }
@@ -6286,8 +6323,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
6286
6323
 
6287
6324
  class DynamicComponentContainer {
6288
6325
  /** @hidden */
6289
- constructor(_elementRef, _injector, _cdr) {
6290
- this._elementRef = _elementRef;
6326
+ constructor(elementRef, _injector, _cdr) {
6327
+ this.elementRef = elementRef;
6291
6328
  this._injector = _injector;
6292
6329
  this._cdr = _cdr;
6293
6330
  /** @hidden */
@@ -7514,5 +7551,5 @@ class BaseToastDurationDismissibleConfig extends BaseToastConfig {
7514
7551
  * Generated bundle index. Do not edit.
7515
7552
  */
7516
7553
 
7517
- export { ANY_LANGUAGE_LETTERS_GROUP_REGEX, ANY_LANGUAGE_LETTERS_REGEX, AbstractFdNgxClass, AsyncOrSyncPipe, AttributeObserver, AutoCompleteDirective, AutoCompleteModule, BaseAnimatedToastConfig, BaseDismissibleToastService, BaseToastActionDismissibleRef, BaseToastConfig, BaseToastContainerComponent, BaseToastDurationDismissibleConfig, BaseToastDurationDismissibleContainerComponent, BaseToastDurationDismissibleRef, BaseToastOverlayContainer, BaseToastPosition, BaseToastRef, BaseToastService, BreakpointDirective, BreakpointModule, ClickedBehaviorModule, ClickedDirective, ContentDensityService, DECIMAL_NUMBER_UNICODE_GROUP_REGEX, DECIMAL_NUMBER_UNICODE_RANGE, DECIMAL_NUMBER_UNICODE_REGEX, DEFAULT_CONTENT_DENSITY, DND_ITEM, DND_LIST, DefaultReadonlyViewModifier, DeprecatedAutoCompleteDirective, DeprecatedClickedDirective, DeprecatedDisabledBehaviorDirective, DeprecatedFocusKeyManagerItemDirective, DeprecatedFocusKeyManagerListDirective, DeprecatedFocusableItemDirective, DeprecatedFocusableListDirective, DeprecatedIgnoreClickOnSelectionDirective, DeprecatedInitialFocusDirective, DeprecatedLineClampDirective, DeprecatedLineClampTargetDirective, DeprecatedOnlyDigitsDirective, DeprecatedOverflowListDirective, DeprecatedOverflowListItemDirective, DeprecatedReadonlyBehaviorDirective, DeprecatedRepeatDirective, DeprecatedResizeDirective, DeprecatedResizeHandleDirective, DeprecatedTemplateSelectorDirective, DeprecatedTruncateSelectorDirective, DestroyedService, DisabledBehaviorDirective, DisabledBehaviorModule, DisabledObserver, DisplayFnPipe, DndItemDirective, DndKeyboardGroupDirective, DndKeyboardItemDirective, DndListDirective, DragAndDropModule, DynamicComponentContainer, DynamicComponentInjector, DynamicComponentService, DynamicPortalComponent, ELEMENT_REF_EXCEPTION, FDK_DISABLED_DIRECTIVE, FDK_FOCUSABLE_GRID_DIRECTIVE, FDK_FOCUSABLE_ITEM_DIRECTIVE, FDK_FOCUSABLE_LIST_DIRECTIVE, FDK_READONLY_DIRECTIVE, FDK_SELECTABLE_ITEM_PROVIDER, FOCUSABLE_ITEM, FdkClickedProvider, FdkDisabledProvider, FdkReadonlyProvider, FilterStringsPipe, FocusKeyManagerHelpersModule, FocusKeyManagerItemDirective, FocusKeyManagerListDirective, FocusTrapService, FocusableGridDirective, FocusableGridModule, FocusableItemDirective, FocusableItemModule, FocusableListDirective, FocusableListModule, FocusableObserver, FunctionStrategy, INVALID_DATE_ERROR, IgnoreClickOnSelectionDirective, IgnoreClickOnSelectionDirectiveToken, IgnoreClickOnSelectionModule, InitialFocusDirective, InitialFocusModule, IsCompactDensityPipe, KeyUtil, KeyboardSupportService, LETTERS_UNICODE_RANGE, LIST_ITEM_COMPONENT, LineClampDirective, LineClampModule, LineClampTargetDirective, LocalStorageService, MOBILE_CONFIG_ERROR, MakeAsyncPipe, ModuleDeprecations, OVERFLOW_PRIORITY_SCORE, ObservableStrategy, OnlyDigitsDirective, OnlyDigitsModule, OverflowListDirective, OverflowListItemDirective, OverflowListModule, PipeModule, PromiseStrategy, RTL_LANGUAGE, RangeSelector, ReadonlyBehaviorDirective, ReadonlyBehaviorModule, ReadonlyObserver, RepeatDirective, RepeatModule, ResizeDirective, ResizeHandleDirective, ResizeModule, ResizeObserverFactory, ResizeObserverService, RtlService, SafePipe, SearchHighlightPipe, SelectComponentRootToken, SelectableItemDirective, SelectableItemToken, SelectableListDirective, SelectableListModule, SelectionService, THEME_SWITCHER_ROUTER_MISSING_ERROR, TabbableElementService, TemplateDirective, TemplateModule, ThemesService, ToastBottomCenterPosition, ToastBottomLeftPosition, ToastBottomRightPosition, ToastTopCenterPosition, ToastTopLeftPosition, ToastTopRightPosition, TruncateDirective, TruncateModule, TruncatePipe, TwoDigitsPipe, UtilsModule, ValueByPathPipe, ValueStrategy, ViewportSizeObservable, alternateSetter, applyCssClass, applyCssStyle, baseToastAnimations, coerceArraySafe, coerceBoolean, coerceCssPixel, consumerProviderFactory, getDocumentFontSize, getElementCapacity, getElementWidth, getNativeElement, getRandomColorAccent, intersectionObservable, isBlank, isBoolean, isCompactDensity, isFunction, isHasElementRef, isJsObject, isNumber, isObject, isOdd, isPresent, isPromise, isString, isStringMap, isSubscribable, isType, isValidContentDensity, moduleDeprecationsFactory, moduleDeprecationsProvider, parserFileSize, pxToNum, resizeObservable, scrollIntoView, scrollTop, selectStrategy, setDisabledState, setReadonlyState, toNativeElement, toastConnectedBottomLeftPosition, toastConnectedBottomPosition, toastConnectedBottomRightPosition, toastConnectedTopLeftPosition, toastConnectedTopPosition, toastConnectedTopRightPosition, uuidv4 };
7554
+ export { ANY_LANGUAGE_LETTERS_GROUP_REGEX, ANY_LANGUAGE_LETTERS_REGEX, AbstractFdNgxClass, AsyncOrSyncPipe, AttributeObserver, AutoCompleteDirective, AutoCompleteModule, BaseAnimatedToastConfig, BaseDismissibleToastService, BaseToastActionDismissibleRef, BaseToastConfig, BaseToastContainerComponent, BaseToastDurationDismissibleConfig, BaseToastDurationDismissibleContainerComponent, BaseToastDurationDismissibleRef, BaseToastOverlayContainer, BaseToastPosition, BaseToastRef, BaseToastService, BreakpointDirective, BreakpointModule, ClickedBehaviorModule, ClickedDirective, ContentDensityService, DECIMAL_NUMBER_UNICODE_GROUP_REGEX, DECIMAL_NUMBER_UNICODE_RANGE, DECIMAL_NUMBER_UNICODE_REGEX, DEFAULT_CONTENT_DENSITY, DND_ITEM, DND_LIST, DefaultReadonlyViewModifier, DeprecatedAutoCompleteDirective, DeprecatedClickedDirective, DeprecatedDisabledBehaviorDirective, DeprecatedFocusKeyManagerItemDirective, DeprecatedFocusKeyManagerListDirective, DeprecatedFocusableItemDirective, DeprecatedFocusableListDirective, DeprecatedIgnoreClickOnSelectionDirective, DeprecatedInitialFocusDirective, DeprecatedLineClampDirective, DeprecatedLineClampTargetDirective, DeprecatedOnlyDigitsDirective, DeprecatedOverflowListDirective, DeprecatedOverflowListItemDirective, DeprecatedReadonlyBehaviorDirective, DeprecatedRepeatDirective, DeprecatedResizeDirective, DeprecatedResizeHandleDirective, DeprecatedTemplateSelectorDirective, DeprecatedTruncateSelectorDirective, DestroyedService, DisabledBehaviorDirective, DisabledBehaviorModule, DisabledObserver, DisplayFnPipe, DndItemDirective, DndKeyboardGroupDirective, DndKeyboardItemDirective, DndListDirective, DragAndDropModule, DynamicComponentContainer, DynamicComponentInjector, DynamicComponentService, DynamicPortalComponent, ELEMENT_REF_EXCEPTION, FDK_DISABLED_DIRECTIVE, FDK_FOCUSABLE_GRID_DIRECTIVE, FDK_FOCUSABLE_ITEM_DIRECTIVE, FDK_FOCUSABLE_LIST_DIRECTIVE, FDK_READONLY_DIRECTIVE, FDK_SELECTABLE_ITEM_PROVIDER, FOCUSABLE_ITEM, FdkClickedProvider, FdkDisabledProvider, FdkReadonlyProvider, FilterStringsPipe, FocusKeyManagerHelpersModule, FocusKeyManagerItemDirective, FocusKeyManagerListDirective, FocusTrapService, FocusableGridDirective, FocusableGridModule, FocusableItemDirective, FocusableItemModule, FocusableListDirective, FocusableListModule, FocusableObserver, FunctionStrategy, INVALID_DATE_ERROR, IgnoreClickOnSelectionDirective, IgnoreClickOnSelectionDirectiveToken, IgnoreClickOnSelectionModule, InitialFocusDirective, InitialFocusModule, IsCompactDensityPipe, KeyUtil, KeyboardSupportService, LETTERS_UNICODE_RANGE, LIST_ITEM_COMPONENT, LineClampDirective, LineClampModule, LineClampTargetDirective, LocalStorageService, MOBILE_CONFIG_ERROR, MakeAsyncPipe, ModuleDeprecations, OVERFLOW_PRIORITY_SCORE, ObservableStrategy, OnlyDigitsDirective, OnlyDigitsModule, OverflowListDirective, OverflowListItemDirective, OverflowListModule, PipeModule, PromiseStrategy, RTL_LANGUAGE, RangeSelector, ReadonlyBehaviorDirective, ReadonlyBehaviorModule, ReadonlyObserver, RepeatDirective, RepeatModule, ResizeDirective, ResizeHandleDirective, ResizeModule, ResizeObserverFactory, ResizeObserverService, RtlService, SafePipe, SearchHighlightPipe, SelectComponentRootToken, SelectableItemDirective, SelectableItemToken, SelectableListDirective, SelectableListModule, SelectionService, THEME_SWITCHER_ROUTER_MISSING_ERROR, TabbableElementService, TemplateDirective, TemplateModule, ThemesService, ToastBottomCenterPosition, ToastBottomLeftPosition, ToastBottomRightPosition, ToastTopCenterPosition, ToastTopLeftPosition, ToastTopRightPosition, TruncateDirective, TruncateModule, TruncatePipe, TwoDigitsPipe, UtilsModule, ValueByPathPipe, ValueStrategy, ViewportSizeObservable, alternateSetter, applyCssClass, applyCssStyle, baseToastAnimations, coerceArraySafe, coerceBoolean, coerceCssPixel, consumerProviderFactory, getDocumentFontSize, getElementCapacity, getElementWidth, getNativeElement, getRandomColorAccent, hasElementRef, intersectionObservable, isBlank, isBoolean, isCompactDensity, isFunction, isJsObject, isNumber, isObject, isOdd, isPresent, isPromise, isString, isStringMap, isSubscribable, isType, isValidContentDensity, moduleDeprecationsFactory, moduleDeprecationsProvider, parserFileSize, pxToNum, resizeObservable, scrollIntoView, scrollTop, selectStrategy, setDisabledState, setReadonlyState, toNativeElement, toastConnectedBottomLeftPosition, toastConnectedBottomPosition, toastConnectedBottomRightPosition, toastConnectedTopLeftPosition, toastConnectedTopPosition, toastConnectedTopRightPosition, uuidv4 };
7518
7555
  //# sourceMappingURL=fundamental-ngx-cdk-utils.mjs.map