{"version":3,"file":"ngx-t-forms-input-custom.component-BrZ59sIz.mjs","sources":["../../../projects/ngx-t-forms/src/lib/shared/functions/inputTypePresentation.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/basic-input-input-element/core/input-custom/input-custom.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/basic-input-input-element/core/input-custom/input-custom.component.html"],"sourcesContent":["/**\n * @file The presentation half of what a column's `type` promises.\n *\n * **The gap this closes.** `inputTypeValidators.ts` made `tel` / `url` / `color`\n * mean something to the form control. This file makes them mean something to the\n * person filling the form in: the right on-screen keyboard, and a phone number\n * that reads as a phone number.\n *\n * Before this, `type: 'tel'` reached the DOM as `<input type=\"tel\">` and nothing\n * else — no `inputmode`, so a phone field opened the full alphabetic keyboard on\n * a handset, and `0821234567` stayed an undifferentiated run of ten digits.\n *\n * Pure functions with no Angular or DOM dependency, so they are equally usable\n * from a component, a renderer, or a test.\n */\nimport { InputTypes } from 'ngx-t-forms-types';\n\n/**\n * The `inputmode` values a browser understands. Narrower than the HTML spec's\n * full list — only the modes a declared {@link InputTypes} can imply.\n */\nexport type InputMode = 'tel' | 'email' | 'url' | 'decimal' | 'search';\n\n/** Digits in the last group of a formatted phone number. */\nconst TEL_TAIL_GROUP = 4;\n/** Digits in every group before the last. */\nconst TEL_GROUP = 3;\n/** Below this, the number is too short to group meaningfully; above it, E.164 says it is not a number. */\nconst TEL_MIN_DIGITS = 7;\nconst TEL_MAX_DIGITS = 15;\n\n/**\n * ITU-T E.164 country calling codes that are one or two digits long. Every code\n * not listed here is three digits.\n *\n * Spelled out rather than inferred because the length of a calling code is not\n * derivable from its value — `27` is South Africa but `271` is nothing, while\n * `26` is nothing and `263` is Zimbabwe. Splitting on the wrong boundary is what\n * turns `+27 82 123 4567` into the unreadable `+2 782 123 4567`.\n */\nconst ONE_DIGIT_CODES: ReadonlySet<string> = new Set(['1', '7']);\nconst TWO_DIGIT_CODES: ReadonlySet<string> = new Set([\n  '20', '27',\n  '30', '31', '32', '33', '34', '36', '39',\n  '40', '41', '43', '44', '45', '46', '47', '48', '49',\n  '51', '52', '53', '54', '55', '56', '57', '58',\n  '60', '61', '62', '63', '64', '65', '66',\n  '81', '82', '84', '86',\n  '90', '91', '92', '93', '94', '95', '98',\n]);\n\n// ---------------------------------------------------------------------------\n// Keyboard hint\n// ---------------------------------------------------------------------------\n\n/**\n * The `inputmode` a declared column type implies, or `null` when the type\n * implies no particular keyboard.\n *\n * `type` alone already picks the keyboard on most desktop browsers, but on a\n * handset it is `inputmode` that decides — which is why a `tel` column opened\n * the alphabetic keyboard. Temporal types are left alone: they render a native\n * picker, and forcing a keyboard mode onto one only fights it.\n *\n * @param type - The column's declared `type`, in any casing, possibly absent.\n * @returns The `inputmode` attribute value, or `null` to leave it unset.\n *\n * @example\n *   resolveInputMode(InputTypes.Tel);  // 'tel'\n *   resolveInputMode(InputTypes.Text); // null\n */\nexport function resolveInputMode(type: string | undefined): InputMode | null {\n  switch (typeof type === 'string' ? type.toLowerCase() : '') {\n    case InputTypes.Tel:\n      return 'tel';\n    case InputTypes.Email:\n      return 'email';\n    case InputTypes.Url:\n      return 'url';\n    case InputTypes.Number:\n      return 'decimal';\n    case InputTypes.Search:\n      return 'search';\n    default:\n      return null;\n  }\n}\n\n// ---------------------------------------------------------------------------\n// Phone number formatting\n// ---------------------------------------------------------------------------\n\n/**\n * Groups a complete phone number for display: `0821234567` → `082 123 4567`,\n * `+27821234567` → `+27 82 123 4567`.\n *\n * **Why grouping runs on a finished number, not on every keystroke.** Groups are\n * measured from the right, so the boundaries only settle once the last digit is\n * in. Applied live, the same rule would reflow the field under the caret on\n * every press — `082 1234` becoming `0 821 2345` becoming `08 212 3456` — and\n * `InputCustomComponent` deliberately never rewrites the DOM mid-keystroke\n * (doing so used to drop characters during fast typing). Callers apply this on\n * blur and on external writes, where the value is whole and the caret is gone.\n *\n * Right-to-left grouping is what makes one rule fit both plans: a 9-digit South\n * African subscriber number lands on `82 123 4567` and a 10-digit North American\n * one on `555 123 4567`, with no per-country national format to maintain.\n *\n * **Fail-open.** Anything that is not a recognisable phone number — free text, a\n * digit count outside E.164's range, an incomplete entry — is returned exactly\n * as given. This never destroys what someone typed; rejecting it is\n * `inputTypeValidators.ts`'s job, and it reports on the original text.\n *\n * @param raw - The value as typed or stored.\n * @returns The grouped number, or `raw` unchanged when it cannot be read as one.\n *\n * @example\n *   formatTelForDisplay('0821234567');    // '082 123 4567'\n *   formatTelForDisplay('+27821234567');  // '+27 82 123 4567'\n *   formatTelForDisplay('call me');       // 'call me'\n */\nexport function formatTelForDisplay(raw: string): string {\n  const trimmed = raw.trim();\n  if (trimmed === '') return raw;\n\n  const international = trimmed.startsWith('+');\n  const digits = trimmed.replace(/\\D/g, '');\n\n  // Any letter, or a stray `+` past the first character, means this is not a\n  // phone number we can safely rewrite.\n  if (/[^\\d\\s().+-]/.test(trimmed) || trimmed.indexOf('+', 1) !== -1) return raw;\n  if (digits.length < TEL_MIN_DIGITS || digits.length > TEL_MAX_DIGITS) return raw;\n\n  if (!international) return groupFromRight(digits);\n\n  const codeLength = callingCodeLength(digits);\n  const national = digits.slice(codeLength);\n  if (national === '') return raw;\n  return `+${digits.slice(0, codeLength)} ${groupFromRight(national)}`;\n}\n\n/**\n * How many leading digits of an international number form its calling code.\n * Falls back to three, the length of every code outside {@link ONE_DIGIT_CODES}\n * and {@link TWO_DIGIT_CODES}.\n */\nfunction callingCodeLength(digits: string): number {\n  if (ONE_DIGIT_CODES.has(digits.slice(0, 1))) return 1;\n  if (TWO_DIGIT_CODES.has(digits.slice(0, 2))) return 2;\n  return 3;\n}\n\n/**\n * Splits digits into a final group of {@link TEL_TAIL_GROUP} preceded by groups\n * of {@link TEL_GROUP}, measured from the right so the leading group absorbs the\n * remainder: `821234567` → `82 123 4567`.\n */\nfunction groupFromRight(digits: string): string {\n  if (digits.length <= TEL_TAIL_GROUP) return digits;\n\n  const groups: string[] = [digits.slice(-TEL_TAIL_GROUP)];\n  let head = digits.slice(0, -TEL_TAIL_GROUP);\n  while (head.length > TEL_GROUP) {\n    groups.unshift(head.slice(-TEL_GROUP));\n    head = head.slice(0, -TEL_GROUP);\n  }\n  groups.unshift(head);\n  return groups.join(' ');\n}\n","import {\r\n  AfterViewInit,\r\n  ChangeDetectionStrategy,\r\n  Component,\r\n  DestroyRef,\r\n  ElementRef,\r\n  Input,\r\n  OnInit,\r\n  Optional,\r\n  Self,\r\n  ViewEncapsulation,\r\n  forwardRef,\r\n  inject,\r\n  viewChild,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { NgControl } from '@angular/forms';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { InputTypes, ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport { Subject, debounceTime } from 'rxjs';\r\n\r\nimport {\r\n  BaseCustomInput,\r\n  BaseCustomInputConfig,\r\n} from '../../../../../../services/core/t-input-controller/functions/baseCustomInput';\r\nimport {\r\n  formatTelForDisplay,\r\n  resolveInputMode,\r\n} from '../../../../../../shared/functions/inputTypePresentation';\r\nimport type { InputMode } from '../../../../../../shared/functions/inputTypePresentation';\r\n\r\nconst customInputConfig: BaseCustomInputConfig = {\r\n  controlType: 'lib-input-custom',\r\n  nextId: 0,\r\n};\r\n\r\n@Component({\r\n  selector: 'lib-input-custom',\r\n  imports: [MatInputModule],\r\n  templateUrl: './input-custom.component.html',\r\n  styleUrl: './input-custom.component.css',\r\n  changeDetection: ChangeDetectionStrategy.OnPush,\r\n  encapsulation: ViewEncapsulation.Emulated,\r\n  host: {\r\n    '[class.floating]': 'shouldLabelFloat',\r\n    '[id]': 'id',\r\n  },\r\n  providers: [\r\n    {\r\n      provide: MatFormFieldControl,\r\n      //:Note\r\n      useExisting: forwardRef(() => InputCustomComponent),\r\n    },\r\n  ],\r\n})\r\nexport class InputCustomComponent\r\n  extends BaseCustomInput<string | number | Date>\r\n  implements OnInit, AfterViewInit\r\n{\r\n  // Kept as @Input() because BaseCustomInput exposes `required`/`disabled`/`placeholder`\r\n  // as setter-backed @Input()s tied to MatFormFieldControl `stateChanges`. Keeping\r\n  // `inputConfig` as a classic @Input keeps the imperative-setter ergonomic consistent\r\n  // with the base class and avoids mixing signal + setter inputs on one component.\r\n  @Input() inputConfig!: ITowerStepColumn;\r\n\r\n  readonly #destroyRef = inject(DestroyRef);\r\n  readonly #debounceTimeMs = 300;\r\n  readonly #valueSubject = new Subject<string>();\r\n\r\n  // The native input is left uncontrolled while the user types: binding the\r\n  // (debounced, therefore lagging) model to `[value]` made Angular overwrite the\r\n  // DOM mid-keystroke and drop characters during fast typing. We instead push the\r\n  // model to the DOM only on external writes (writeValue) — never while typing.\r\n  // TS `private` (not ES `#private`): Angular signal queries cannot sit on an ES-private field.\r\n  private readonly inputEl = viewChild<ElementRef<HTMLInputElement>>('inputEl');\r\n\r\n  constructor(\r\n    @Optional() @Self() ngControl: NgControl,\r\n    elementRef: ElementRef<HTMLElement>,\r\n  ) {\r\n    super(ngControl, elementRef, customInputConfig);\r\n  }\r\n\r\n  override get empty(): boolean {\r\n    const n = this.value;\r\n    // Check for null, undefined, or empty string, but allow 0\r\n    return n === null || n === undefined || n === '';\r\n  }\r\n\r\n  override get shouldLabelFloat(): boolean {\r\n    return true;\r\n  }\r\n\r\n  /**\r\n   * The on-screen keyboard the bound column's `type` implies, or `null` to leave\r\n   * `inputmode` unset. A getter rather than a signal because `inputConfig` is a\r\n   * setter-free classic `@Input()` (see its comment above) — the lookup is a\r\n   * single switch, so re-reading it per change detection costs nothing.\r\n   */\r\n  protected get inputMode(): InputMode | null {\r\n    return resolveInputMode(this.inputConfig?.type);\r\n  }\r\n\r\n  ngOnInit(): void {\r\n    this.#valueSubject\r\n      .pipe(debounceTime(this.#debounceTimeMs), takeUntilDestroyed(this.#destroyRef))\r\n      .subscribe((next) => {\r\n        // The base `value` setter guards on equality and fires onChange + stateChanges.\r\n        // Only the (heavier) form propagation + validation is debounced — never the display.\r\n        this.value = next;\r\n      });\r\n  }\r\n\r\n  ngAfterViewInit(): void {\r\n    // Reflect any value the form set before the view existed (initial bind / patch).\r\n    this.#syncInputFromModel();\r\n  }\r\n\r\n  override writeValue(value: string | number | Date): void {\r\n    super.writeValue(value);\r\n    // External model change (patchValue / reset) — push it to the DOM. This never\r\n    // runs in response to the user's own typing, so it can't clobber the cursor.\r\n    this.#syncInputFromModel();\r\n  }\r\n\r\n  protected onInputChange($event: Event): void {\r\n    const next = ($event.target as HTMLInputElement | null)?.value ?? '';\r\n    this.#valueSubject.next(next);\r\n  }\r\n\r\n  #syncInputFromModel(): void {\r\n    const el = this.inputEl()?.nativeElement;\r\n    if (!el) {\r\n      return;\r\n    }\r\n    const v = this.value;\r\n    // Grouped for display only. The model keeps whatever the consumer patched in,\r\n    // so simply loading a form never rewrites stored data — only the user's own\r\n    // blur does that.\r\n    el.value = v === null || v === undefined ? '' : this.#forDisplay(String(v));\r\n  }\r\n\r\n  /** Applies the declared type's display format, if it has one. */\r\n  #forDisplay(value: string): string {\r\n    return this.inputConfig?.type === InputTypes.Tel ? formatTelForDisplay(value) : value;\r\n  }\r\n\r\n  /**\r\n   * Groups the typed phone number once the field is left, and commits the grouped\r\n   * text as the value so what is stored matches what is shown.\r\n   *\r\n   * Runs on blur rather than on input because the grouping is measured from the\r\n   * right — applied per keystroke it would reflow the text under the caret, and\r\n   * this component deliberately never rewrites the DOM while the user types.\r\n   *\r\n   * The formatted text re-enters `#valueSubject` as well as being set directly:\r\n   * a keystroke from the last 300ms may still be in flight, and re-entering the\r\n   * debounce supersedes it rather than letting it land afterwards and leave the\r\n   * model holding the ungrouped text. The direct write keeps the control correct\r\n   * in the meantime; the base setter's equality guard makes the later duplicate a\r\n   * no-op.\r\n   */\r\n  #applyDisplayFormatOnBlur(): void {\r\n    const el = this.inputEl()?.nativeElement;\r\n    if (!el || this.inputConfig?.type !== InputTypes.Tel) {\r\n      return;\r\n    }\r\n    const formatted = formatTelForDisplay(el.value);\r\n    if (formatted === el.value) {\r\n      return;\r\n    }\r\n    el.value = formatted;\r\n    this.value = formatted;\r\n    this.#valueSubject.next(formatted);\r\n  }\r\n\r\n  protected onInputBlur($event: FocusEvent): void {\r\n    this.#applyDisplayFormatOnBlur();\r\n    this.touched = true; // Mark as touched on blur\r\n    this.onTouched();\r\n    this.blur.emit($event);\r\n  }\r\n}\r\n","@if (inputConfig) {\r\n  <input matInput\r\n    #inputEl\r\n    [readonly]=\"inputConfig.readonly || inputConfig.disabled\"\r\n    (blur)=\"onInputBlur($event)\"\r\n    [pattern]=\"inputConfig.pattern || ''\"\r\n    [required]=\"inputConfig.required\"\r\n    [attr.maxlength]=\"inputConfig.maxLength\"\r\n    [type]=\"inputConfig.type || 'text'\"\n    [attr.inputmode]=\"inputMode\"\r\n    (input)=\"onInputChange($event)\"\r\n    [attr.minlength]=\"inputConfig.minLength\"\r\n    [autocomplete]=\"inputConfig.autocomplete\"\r\n    [min]=\"inputConfig.min\"\r\n    [max]=\"inputConfig.max\" />\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;AASH;AACA,MAAM,cAAc,GAAG,CAAC;AACxB;AACA,MAAM,SAAS,GAAG,CAAC;AACnB;AACA,MAAM,cAAc,GAAG,CAAC;AACxB,MAAM,cAAc,GAAG,EAAE;AAEzB;;;;;;;;AAQG;AACH,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAChE,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC;AACnD,IAAA,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;AACxC,IAAA,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;AACpD,IAAA,IAAI,EAAE,IAAI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