{"version":3,"file":"input.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/angular/input/input-errors.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/angular/input/input-value-accessor.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/angular/input/input.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/angular/input/input.module.ts"],"sourcesContent":["/** @docs-private */\nexport function getSbbInputUnsupportedTypeError(type: string): Error {\n  return Error(`Input type \"${type}\" isn't supported by sbbInput.`);\n}\n","import { InjectionToken, WritableSignal } from '@angular/core';\n\n/**\n * This token is used to inject the object whose value should be set into `InputDirective`.\n * If none is provided, the native `HTMLInputElement` is used. Directives can provide\n * themselves for this token, in order to make `InputDirective` delegate the getting and setting of the\n * value to them.\n */\nexport const SBB_INPUT_VALUE_ACCESSOR = new InjectionToken<{ value: any | WritableSignal<any> }>(\n  'SBB_INPUT_VALUE_ACCESSOR',\n);\n","import { _IdGenerator } from '@angular/cdk/a11y';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { getSupportedInputTypes, Platform } from '@angular/cdk/platform';\nimport { AutofillMonitor } from '@angular/cdk/text-field';\nimport {\n  AfterViewInit,\n  Directive,\n  DoCheck,\n  effect,\n  ElementRef,\n  HostListener,\n  inject,\n  Input,\n  isSignal,\n  NgZone,\n  numberAttribute,\n  OnChanges,\n  OnDestroy,\n  WritableSignal,\n} from '@angular/core';\nimport { FormGroupDirective, NgControl, NgForm } from '@angular/forms';\nimport { SbbErrorStateMatcher, _ErrorStateTracker } from '@sbb-esta/angular/core';\nimport { SbbFormFieldControl } from '@sbb-esta/angular/form-field';\nimport { Subject } from 'rxjs';\n\nimport { getSbbInputUnsupportedTypeError } from './input-errors';\nimport { SBB_INPUT_VALUE_ACCESSOR } from './input-value-accessor';\n\nconst SBB_INPUT_INVALID_TYPES = [\n  'button',\n  'checkbox',\n  'file',\n  'hidden',\n  'image',\n  'radio',\n  'range',\n  'reset',\n  'submit',\n];\n\n/** Directive that allows a native input to work inside a `SbbFormField`. */\n@Directive({\n  selector: 'input[sbbInput], select[sbbInput], textarea[sbbInput]',\n  exportAs: 'sbbInput',\n  host: {\n    class: 'sbb-input-element',\n    // Native input properties that are overwritten by Angular inputs need to be synced with\n    // the native input element. Otherwise property bindings for those don't work.\n    '[attr.id]': 'id',\n    '[disabled]': 'disabled',\n    '[required]': 'required',\n    '[attr.name]': 'name || null',\n    '[attr.readonly]': 'readonly && !_isNativeSelect || null',\n    // Only mark the input as invalid for assistive technology if it has a value since the\n    // state usually overlaps with `aria-required` when the input is empty and can be redundant.\n    '[attr.aria-invalid]': '(empty && required) ? null : errorState',\n    '[attr.aria-required]': 'required',\n    '[attr.placeholder]': `!readonly ? (placeholder || null) : '-'`,\n    '[attr.tabindex]': `empty && readonly ? -1  : tabIndex`,\n  },\n  providers: [{ provide: SbbFormFieldControl, useExisting: SbbInput }],\n})\nexport class SbbInput\n  implements SbbFormFieldControl<any>, AfterViewInit, OnChanges, DoCheck, OnDestroy\n{\n  private _elementRef =\n    inject<ElementRef<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>>(ElementRef);\n  private _platform = inject(Platform);\n  private _autofillMonitor = inject(AutofillMonitor);\n  private _previousNativeValue: any;\n  private _inputValueAccessor: { value: any };\n  private _signalBasedValueAccessor?: { value: WritableSignal<any> };\n  private _errorStateTracker: _ErrorStateTracker;\n  ngControl: NgControl = inject(NgControl, { optional: true, self: true })!;\n\n  /** Whether the component is a native html select. */\n  readonly _isNativeSelect: boolean;\n\n  /** Whether the component is a textarea. */\n  readonly _isTextarea: boolean;\n\n  /**\n   * Implemented as part of SbbFormFieldControl.\n   * @docs-private\n   */\n  focused: boolean = false;\n\n  /**\n   * Implemented as part of SbbFormFieldControl.\n   * @docs-private\n   */\n  controlType: string = 'sbb-input';\n\n  /**\n   * Implemented as part of SbbFormFieldControl.\n   * @docs-private\n   */\n  autofilled: boolean = false;\n\n  /**\n   * Implemented as part of SbbFormFieldControl.\n   * @docs-private\n   */\n  stateChanges: Subject<void> = new Subject<void>();\n\n  /**\n   * Implemented as part of SbbFormFieldControl.\n   * @docs-private\n   */\n  @Input()\n  get disabled(): boolean {\n    if (this.ngControl && this.ngControl.disabled !== null) {\n      return this.ngControl.disabled;\n    }\n    return this._disabled;\n  }\n  set disabled(value: BooleanInput) {\n    this._disabled = coerceBooleanProperty(value);\n\n    // Browsers may not fire the blur event if the input is disabled too quickly.\n    // Reset from here to ensure that the element doesn't become stuck.\n    if (this.focused) {\n      this.focused = false;\n      this.stateChanges.next();\n    }\n  }\n  private _disabled = false;\n\n  /**\n   * Implemented as part of SbbFormFieldControl.\n   * @docs-private\n   */\n  @Input() id: string = inject(_IdGenerator).getId('sbb-native-input-');\n\n  /**\n   * Implemented as part of SbbFormFieldControl.\n   * @docs-private\n   */\n  @Input() placeholder: string;\n\n  /**\n   * Name of the input.\n   * @docs-private\n   */\n  @Input() name: string;\n\n  /**\n   * Implemented as part of SbbFormFieldControl.\n   * @docs-private\n   */\n  @Input()\n  get required(): boolean {\n    return this._required;\n  }\n  set required(value: BooleanInput) {\n    this._required = coerceBooleanProperty(value);\n  }\n  private _required = false;\n\n  /** Input type of the element. */\n  @Input()\n  get type(): string {\n    return this._type;\n  }\n  set type(value: string) {\n    this._type = value || 'text';\n    this._validateType();\n\n    // When using Angular inputs, developers are no longer able to set the properties on the native\n    // input element. To ensure that bindings for `type` work, we need to sync the setter\n    // with the native property. Textarea elements don't support the type property or attribute.\n    if (!this._isTextarea && getSupportedInputTypes().has(this._type)) {\n      (this._elementRef.nativeElement as HTMLInputElement).type = this._type;\n    }\n  }\n  private _type = 'text';\n\n  /** An object used to control when error messages are shown. */\n  @Input()\n  get errorStateMatcher() {\n    return this._errorStateTracker.matcher;\n  }\n  set errorStateMatcher(value: SbbErrorStateMatcher) {\n    this._errorStateTracker.matcher = value;\n  }\n\n  /**\n   * Implemented as part of SbbFormFieldControl.\n   * @docs-private\n   */\n  @Input('aria-describedby') userAriaDescribedBy: string;\n\n  /**\n   * Implemented as part of SbbFormFieldControl.\n   * @docs-private\n   */\n  @Input()\n  get value(): string {\n    return this._signalBasedValueAccessor\n      ? this._signalBasedValueAccessor.value()\n      : this._inputValueAccessor.value;\n  }\n  // Accept `any` to avoid conflicts with other directives on `<input>` that may\n  // accept different types.\n  set value(value: any) {\n    if (value !== this.value) {\n      if (this._signalBasedValueAccessor) {\n        this._signalBasedValueAccessor.value.set(value);\n      } else {\n        this._inputValueAccessor.value = value;\n      }\n      this.stateChanges.next();\n    }\n  }\n\n  /** Whether the element is readonly. */\n  @Input()\n  get readonly(): boolean {\n    return this._readonly;\n  }\n  set readonly(value: BooleanInput) {\n    this._readonly = coerceBooleanProperty(value);\n  }\n  private _readonly = false;\n  /** Tab index of the input. */\n  @Input({\n    transform: (value: unknown) => (value == null ? undefined : numberAttribute(value)),\n  })\n  tabIndex: number;\n\n  /** Whether the input is in an error state. */\n  get errorState() {\n    return this._errorStateTracker.errorState;\n  }\n  set errorState(value: boolean) {\n    this._errorStateTracker.errorState = value;\n  }\n\n  /**\n   * Implemented as part of SbbFormFieldControl.\n   * @docs-private\n   */\n  get empty(): boolean {\n    return (\n      !this._isNeverEmpty() &&\n      !this._elementRef.nativeElement.value &&\n      !this._isBadInput() &&\n      !this.autofilled\n    );\n  }\n\n  private _neverEmptyInputTypes = [\n    'date',\n    'datetime',\n    'datetime-local',\n    'month',\n    'time',\n    'week',\n  ].filter((t) => getSupportedInputTypes().has(t));\n\n  constructor(...args: unknown[]);\n  constructor() {\n    const parentForm = inject(NgForm, { optional: true })!;\n    const parentFormGroup = inject(FormGroupDirective, { optional: true })!;\n    const defaultErrorStateMatcher = inject(SbbErrorStateMatcher);\n    const accessor = inject(SBB_INPUT_VALUE_ACCESSOR, { optional: true, self: true })!;\n    const ngZone = inject(NgZone);\n\n    const element = this._elementRef.nativeElement;\n    const nodeName = element.nodeName.toLowerCase();\n\n    if (accessor) {\n      if (isSignal(accessor.value)) {\n        this._signalBasedValueAccessor = accessor;\n      } else {\n        this._inputValueAccessor = accessor;\n      }\n    } else {\n      // If no input value accessor was explicitly specified, use the element as the input value\n      // accessor.\n      this._inputValueAccessor = element;\n    }\n\n    this._previousNativeValue = this.value;\n\n    // On some versions of iOS the caret gets stuck in the wrong place when holding down the delete\n    // key. In order to get around this we need to \"jiggle\" the caret loose. Since this bug only\n    // exists on iOS, we only bother to install the listener on iOS.\n    if (this._platform.IOS) {\n      ngZone.runOutsideAngular(() => {\n        this._elementRef.nativeElement.addEventListener('keyup', this._iOSKeyupListener);\n      });\n    }\n    this._errorStateTracker = new _ErrorStateTracker(\n      defaultErrorStateMatcher,\n      this.ngControl,\n      parentFormGroup,\n      parentForm,\n      this.stateChanges,\n    );\n    this._isNativeSelect = nodeName === 'select';\n    this._isTextarea = nodeName === 'textarea';\n\n    if (this._isNativeSelect) {\n      this.controlType = (element as HTMLSelectElement).multiple\n        ? 'sbb-native-select-multiple'\n        : 'sbb-native-select';\n    }\n\n    if (this._signalBasedValueAccessor) {\n      effect(() => {\n        // Read the value so the effect can register the dependency.\n        this._signalBasedValueAccessor!.value();\n        this.stateChanges.next();\n      });\n    }\n  }\n\n  ngAfterViewInit() {\n    if (this._platform.isBrowser) {\n      this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe((event) => {\n        this.autofilled = event.isAutofilled;\n        this.stateChanges.next();\n      });\n    }\n\n    if (this._platform.IOS) {\n      this._elementRef.nativeElement.removeEventListener('keyup', this._iOSKeyupListener);\n    }\n  }\n\n  ngOnChanges() {\n    this.stateChanges.next();\n  }\n\n  ngOnDestroy() {\n    this.stateChanges.complete();\n\n    if (this._platform.isBrowser) {\n      this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement);\n    }\n  }\n\n  ngDoCheck() {\n    if (this.ngControl) {\n      // We need to re-evaluate this on every change detection cycle, because there are some\n      // error triggers that we can't subscribe to (e.g. parent form submissions). This means\n      // that whatever logic is in here has to be super lean or we risk destroying the performance.\n      this.updateErrorState();\n    }\n\n    // We need to dirty-check the native element's value, because there are some cases where\n    // we won't be notified when it changes (e.g. the consumer isn't using forms or they're\n    // updating the value using `emitEvent: false`).\n    this._dirtyCheckNativeValue();\n  }\n\n  /** Focuses the input. */\n  focus(options?: FocusOptions): void {\n    this._elementRef.nativeElement.focus(options);\n  }\n\n  /** Refreshes the error state of the input. */\n  updateErrorState() {\n    this._errorStateTracker.updateErrorState();\n  }\n\n  /** Callback for the cases where the focused state of the input changes. */\n  @HostListener('focus', ['true'])\n  @HostListener('blur', ['false'])\n  _focusChanged(isFocused: boolean) {\n    if (isFocused !== this.focused) {\n      this.focused = isFocused;\n      this.stateChanges.next();\n    }\n  }\n\n  /** Does some manual dirty checking on the native input `value` property. */\n  private _dirtyCheckNativeValue() {\n    const newValue = this._elementRef.nativeElement.value;\n\n    if (this._previousNativeValue !== newValue) {\n      this._previousNativeValue = newValue;\n      this.stateChanges.next();\n    }\n  }\n\n  /** Make sure the input is a supported type. */\n  private _validateType() {\n    if (\n      SBB_INPUT_INVALID_TYPES.indexOf(this._type) > -1 &&\n      (typeof ngDevMode === 'undefined' || ngDevMode)\n    ) {\n      throw getSbbInputUnsupportedTypeError(this._type);\n    }\n  }\n\n  /** Checks whether the input type is one of the types that are never empty. */\n  private _isNeverEmpty() {\n    return this._neverEmptyInputTypes.indexOf(this._type) > -1;\n  }\n\n  /** Checks whether the input is invalid based on the native validation. */\n  private _isBadInput() {\n    // The `validity` property won't be present on platform-server.\n    const validity = (this._elementRef.nativeElement as HTMLInputElement).validity;\n    return validity && validity.badInput;\n  }\n\n  /**\n   * Implemented as part of SbbFormFieldControl.\n   * @docs-private\n   */\n  setDescribedByIds(ids: string[]) {\n    if (ids.length) {\n      this._elementRef.nativeElement.setAttribute('aria-describedby', ids.join(' '));\n    } else {\n      this._elementRef.nativeElement.removeAttribute('aria-describedby');\n    }\n  }\n\n  /**\n   * Implemented as part of SbbFormFieldControl.\n   * @docs-private\n   */\n  onContainerClick() {\n    // Do not re-focus the input element if the element is already focused. Otherwise it can happen\n    // that someone clicks on a time input and the cursor resets to the \"hours\" field while the\n    // \"minutes\" field was actually clicked. See: https://github.com/angular/components/issues/12849\n    if (!this.focused) {\n      this.focus();\n    }\n  }\n\n  private _iOSKeyupListener = (event: Event): void => {\n    const el = event.target as HTMLInputElement;\n\n    // Note: We specifically check for 0, rather than `!el.selectionStart`, because the two\n    // indicate different things. If the value is 0, it means that the caret is at the start\n    // of the input, whereas a value of `null` means that the input doesn't support\n    // manipulating the selection range. Inputs that don't support setting the selection range\n    // will throw an error so we want to avoid calling `setSelectionRange` on them. See:\n    // https://html.spec.whatwg.org/multipage/input.html#do-not-apply\n    if (!el.value && el.selectionStart === 0 && el.selectionEnd === 0) {\n      // Note: Just setting `0, 0` doesn't fix the issue. Setting\n      // `1, 1` fixes it for the first time that you type text and\n      // then hold delete. Toggling to `1, 1` and then back to\n      // `0, 0` seems to completely fix it.\n      el.setSelectionRange(1, 1);\n      el.setSelectionRange(0, 0);\n    }\n  };\n}\n","import { TextFieldModule } from '@angular/cdk/text-field';\nimport { NgModule } from '@angular/core';\nimport { SbbCommonModule } from '@sbb-esta/angular/core';\nimport { SbbFormFieldModule } from '@sbb-esta/angular/form-field';\n\nimport { SbbInput } from './input';\n\n@NgModule({\n  imports: [TextFieldModule, SbbCommonModule, SbbFormFieldModule, SbbInput],\n  exports: [\n    TextFieldModule,\n    // We re-export the `SbbFormFieldModule` since `SbbInput` will almost always\n    // be used together with `SbbFormField`.\n    SbbFormFieldModule,\n    SbbInput,\n  ],\n})\nexport class SbbInputModule {}\n"],"names":["getSbbInputUnsupportedTypeError","type","Error","SBB_INPUT_VALUE_ACCESSOR","InjectionToken","SBB_INPUT_INVALID_TYPES","SbbInput","_elementRef","inject","ElementRef","_platform","Platform","_autofillMonitor","AutofillMonitor","_previousNativeValue","_inputValueAccessor","_signalBasedValueAccessor","_errorStateTracker","ngControl","NgControl","optional","self","_isNativeSelect","_isTextarea","focused","controlType","autofilled","stateChanges","Subject","disabled","_disabled","value","coerceBooleanProperty","next","id","_IdGenerator","getId","placeholder","name","required","_required","_type","_validateType","getSupportedInputTypes","has","nativeElement","errorStateMatcher","matcher","userAriaDescribedBy","set","readonly","_readonly","tabIndex","errorState","empty","_isNeverEmpty","_isBadInput","_neverEmptyInputTypes","filter","t","constructor","parentForm","NgForm","parentFormGroup","FormGroupDirective","defaultErrorStateMatcher","SbbErrorStateMatcher","accessor","ngZone","NgZone","element","nodeName","toLowerCase","isSignal","IOS","runOutsideAngular","addEventListener","_iOSKeyupListener","_ErrorStateTracker","multiple","effect","ngAfterViewInit","isBrowser","monitor","subscribe","event","isAutofilled","removeEventListener","ngOnChanges","ngOnDestroy","complete","stopMonitoring","ngDoCheck","updateErrorState","_dirtyCheckNativeValue","focus","options","_focusChanged","isFocused","newValue","indexOf","ngDevMode","validity","badInput","setDescribedByIds","ids","length","setAttribute","join","removeAttribute","onContainerClick","el","target","selectionStart","selectionEnd","setSelectionRange","deps","i0","ɵɵFactoryTarget","Directive","ɵdir","ɵɵngDeclareDirective","minVersion","version","isStandalone","selector","inputs","undefined","numberAttribute","provide","SbbFormFieldControl","useExisting","exportAs","usesOnChanges","ngImport","decorators","args","host","class","providers","Input","transform","HostListener","SbbInputModule","NgModule","imports","TextFieldModule","SbbCommonModule","SbbFormFieldModule","exports","ɵinj","ɵɵngDeclareInjector"],"mappings":";;;;;;;;;;;AACM,SAAUA,+BAA+BA,CAACC,IAAY,EAAA;AAC1D,EAAA,OAAOC,KAAK,CAAC,CAAeD,YAAAA,EAAAA,IAAI,gCAAgC,CAAC;AACnE;;MCKaE,wBAAwB,GAAG,IAAIC,cAAc,CACxD,0BAA0B;;ACmB5B,MAAMC,uBAAuB,GAAG,CAC9B,QAAQ,EACR,UAAU,EACV,MAAM,EACN,QAAQ,EACR,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,CACT;MAwBYC,QAAQ,CAAA;AAGXC,EAAAA,WAAW,GACjBC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