UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

1 lines 70.2 kB
{"version":3,"file":"ng-zorro-antd-input.mjs","sources":["../../components/input/autosize.directive.ts","../../components/input/input-addon.directive.ts","../../components/input/input-affix.directive.ts","../../components/input/input-group-slot.component.ts","../../components/input/input.directive.ts","../../components/input/input-group.component.ts","../../components/input/input-otp.component.ts","../../components/input/textarea-count.component.ts","../../components/input/input.module.ts","../../components/input/public-api.ts","../../components/input/ng-zorro-antd-input.ts"],"sourcesContent":["/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Platform } from '@angular/cdk/platform';\nimport { AfterViewInit, Directive, DoCheck, ElementRef, inject, Input, NgZone, OnDestroy } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { NzResizeService } from 'ng-zorro-antd/core/services';\n\nexport interface AutoSizeType {\n minRows?: number;\n maxRows?: number;\n}\n\n@Directive({\n selector: 'textarea[nzAutosize]',\n exportAs: 'nzAutosize',\n host: {\n // Textarea elements that have the directive applied should have a single row by default.\n // Browsers normally show two rows by default and therefore this limits the minRows binding.\n rows: '1',\n '(input)': 'noopInputHandler()'\n }\n})\nexport class NzAutosizeDirective implements AfterViewInit, OnDestroy, DoCheck {\n private autosize: boolean = false;\n private el: HTMLTextAreaElement | HTMLInputElement = inject(ElementRef).nativeElement;\n private cachedLineHeight!: number;\n private previousValue!: string;\n private previousMinRows: number | undefined;\n private minRows: number | undefined;\n private maxRows: number | undefined;\n private maxHeight: number | null = null;\n private minHeight: number | null = null;\n private destroy$ = new Subject<boolean>();\n private inputGap = 10;\n\n @Input()\n set nzAutosize(value: string | boolean | AutoSizeType) {\n const isAutoSizeType = (data: string | boolean | AutoSizeType): data is AutoSizeType =>\n typeof data !== 'string' && typeof data !== 'boolean' && (!!data.maxRows || !!data.minRows);\n if (typeof value === 'string' || value === true) {\n this.autosize = true;\n } else if (isAutoSizeType(value)) {\n this.autosize = true;\n this.minRows = value.minRows;\n this.maxRows = value.maxRows;\n this.maxHeight = this.setMaxHeight();\n this.minHeight = this.setMinHeight();\n }\n }\n\n resizeToFitContent(force: boolean = false): void {\n this.cacheTextareaLineHeight();\n\n // If we haven't determined the line-height yet, we know we're still hidden and there's no point\n // in checking the height of the textarea.\n if (!this.cachedLineHeight) {\n return;\n }\n\n const textarea = this.el as HTMLTextAreaElement;\n const value = textarea.value;\n\n // Only resize if the value or minRows have changed since these calculations can be expensive.\n if (!force && this.minRows === this.previousMinRows && value === this.previousValue) {\n return;\n }\n const placeholderText = textarea.placeholder;\n\n // Reset the textarea height to auto in order to shrink back to its default size.\n // Also temporarily force overflow:hidden, so scroll bars do not interfere with calculations.\n // Long placeholders that are wider than the textarea width may lead to a bigger scrollHeight\n // value. To ensure that the scrollHeight is not bigger than the content, the placeholders\n // need to be removed temporarily.\n textarea.classList.add('nz-textarea-autosize-measuring');\n textarea.placeholder = '';\n let height =\n Math.round((textarea.scrollHeight - this.inputGap) / this.cachedLineHeight) * this.cachedLineHeight +\n this.inputGap;\n if (this.maxHeight !== null && height > this.maxHeight) {\n height = this.maxHeight!;\n }\n if (this.minHeight !== null && height < this.minHeight) {\n height = this.minHeight!;\n }\n // Use the scrollHeight to know how large the textarea *would* be if fit its entire value.\n textarea.style.height = `${height}px`;\n textarea.classList.remove('nz-textarea-autosize-measuring');\n textarea.placeholder = placeholderText;\n\n // On Firefox resizing the textarea will prevent it from scrolling to the caret position.\n // We need to re-set the selection in order for it to scroll to the proper position.\n if (typeof requestAnimationFrame !== 'undefined') {\n this.ngZone.runOutsideAngular(() =>\n requestAnimationFrame(() => {\n const { selectionStart, selectionEnd } = textarea;\n\n // IE will throw an \"Unspecified error\" if we try to set the selection range after the\n // element has been removed from the DOM. Assert that the directive hasn't been destroyed\n // between the time we requested the animation frame and when it was executed.\n // Also note that we have to assert that the textarea is focused before we set the\n // selection range. Setting the selection range on a non-focused textarea will cause\n // it to receive focus on IE and Edge.\n if (!this.destroy$.isStopped && document.activeElement === textarea) {\n textarea.setSelectionRange(selectionStart, selectionEnd);\n }\n })\n );\n }\n\n this.previousValue = value;\n this.previousMinRows = this.minRows;\n }\n\n private cacheTextareaLineHeight(): void {\n if (this.cachedLineHeight >= 0 || !this.el.parentNode) {\n return;\n }\n\n // Use a clone element because we have to override some styles.\n const textareaClone = this.el.cloneNode(false) as HTMLTextAreaElement;\n textareaClone.rows = 1;\n\n // Use `position: absolute` so that this doesn't cause a browser layout and use\n // `visibility: hidden` so that nothing is rendered. Clear any other styles that\n // would affect the height.\n textareaClone.style.position = 'absolute';\n textareaClone.style.visibility = 'hidden';\n textareaClone.style.border = 'none';\n textareaClone.style.padding = '0';\n textareaClone.style.height = '';\n textareaClone.style.minHeight = '';\n textareaClone.style.maxHeight = '';\n\n // In Firefox it happens that textarea elements are always bigger than the specified amount\n // of rows. This is because Firefox tries to add extra space for the horizontal scrollbar.\n // As a workaround that removes the extra space for the scrollbar, we can just set overflow\n // to hidden. This ensures that there is no invalid calculation of the line height.\n // See Firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=33654\n textareaClone.style.overflow = 'hidden';\n\n this.el.parentNode!.appendChild(textareaClone);\n this.cachedLineHeight = textareaClone.clientHeight - this.inputGap;\n this.el.parentNode!.removeChild(textareaClone);\n\n // Min and max heights have to be re-calculated if the cached line height changes\n this.maxHeight = this.setMaxHeight();\n this.minHeight = this.setMinHeight();\n }\n\n setMinHeight(): number | null {\n const minHeight =\n this.minRows && this.cachedLineHeight ? this.minRows * this.cachedLineHeight + this.inputGap : null;\n\n if (minHeight !== null) {\n this.el.style.minHeight = `${minHeight}px`;\n }\n return minHeight;\n }\n\n setMaxHeight(): number | null {\n const maxHeight =\n this.maxRows && this.cachedLineHeight ? this.maxRows * this.cachedLineHeight + this.inputGap : null;\n if (maxHeight !== null) {\n this.el.style.maxHeight = `${maxHeight}px`;\n }\n return maxHeight;\n }\n\n noopInputHandler(): void {\n // no-op handler that ensures we're running change detection on input events.\n }\n\n constructor(\n private ngZone: NgZone,\n private platform: Platform,\n private resizeService: NzResizeService\n ) {}\n\n ngAfterViewInit(): void {\n if (this.autosize && this.platform.isBrowser) {\n this.resizeToFitContent();\n this.resizeService\n .subscribe()\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => this.resizeToFitContent(true));\n }\n }\n\n ngOnDestroy(): void {\n this.destroy$.next(true);\n this.destroy$.complete();\n }\n\n ngDoCheck(): void {\n if (this.autosize && this.platform.isBrowser) {\n this.resizeToFitContent();\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\n@Directive({\n selector: '[nzInputAddonBefore]'\n})\nexport class NzInputAddonBeforeDirective {}\n\n@Directive({\n selector: '[nzInputAddonAfter]'\n})\nexport class NzInputAddonAfterDirective {}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\n@Directive({\n selector: '[nzInputPrefix]'\n})\nexport class NzInputPrefixDirective {}\n\n@Directive({\n selector: '[nzInputSuffix]'\n})\nexport class NzInputSuffixDirective {}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, Input, TemplateRef, ViewEncapsulation } from '@angular/core';\n\nimport { NzOutletModule } from 'ng-zorro-antd/core/outlet';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\n@Component({\n selector: '[nz-input-group-slot]',\n preserveWhitespaces: false,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (icon) {\n <nz-icon [nzType]=\"icon\" />\n }\n <ng-container *nzStringTemplateOutlet=\"template\">{{ template }}</ng-container>\n <ng-content></ng-content>\n `,\n host: {\n '[class.ant-input-group-addon]': `type === 'addon'`,\n '[class.ant-input-prefix]': `type === 'prefix'`,\n '[class.ant-input-suffix]': `type === 'suffix'`\n },\n imports: [NzIconModule, NzOutletModule]\n})\nexport class NzInputGroupSlotComponent {\n @Input() icon?: string | null = null;\n @Input() type: 'addon' | 'prefix' | 'suffix' | null = null;\n @Input() template?: string | TemplateRef<void> | null = null;\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Direction, Directionality } from '@angular/cdk/bidi';\nimport {\n ComponentRef,\n Directive,\n ElementRef,\n Input,\n OnChanges,\n OnInit,\n Renderer2,\n SimpleChanges,\n ViewContainerRef,\n booleanAttribute,\n computed,\n inject,\n signal\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { Subject } from 'rxjs';\nimport { distinctUntilChanged, filter, takeUntil } from 'rxjs/operators';\n\nimport { NzFormItemFeedbackIconComponent, NzFormNoStatusService, NzFormStatusService } from 'ng-zorro-antd/core/form';\nimport { NzDestroyService } from 'ng-zorro-antd/core/services';\nimport { NgClassInterface, NzSizeLDSType, NzStatus, NzValidateStatus } from 'ng-zorro-antd/core/types';\nimport { getStatusClassNames } from 'ng-zorro-antd/core/util';\nimport { NZ_SPACE_COMPACT_ITEM_TYPE, NZ_SPACE_COMPACT_SIZE, NzSpaceCompactItemDirective } from 'ng-zorro-antd/space';\n\n@Directive({\n selector: 'input[nz-input],textarea[nz-input]',\n exportAs: 'nzInput',\n host: {\n class: 'ant-input',\n '[class.ant-input-disabled]': 'disabled',\n '[class.ant-input-borderless]': 'nzBorderless',\n '[class.ant-input-lg]': `finalSize() === 'large'`,\n '[class.ant-input-sm]': `finalSize() === 'small'`,\n '[attr.disabled]': 'disabled || null',\n '[class.ant-input-rtl]': `dir=== 'rtl'`,\n '[class.ant-input-stepperless]': `nzStepperless`\n },\n hostDirectives: [NzSpaceCompactItemDirective],\n providers: [NzDestroyService, { provide: NZ_SPACE_COMPACT_ITEM_TYPE, useValue: 'input' }]\n})\nexport class NzInputDirective implements OnChanges, OnInit {\n @Input({ transform: booleanAttribute }) nzBorderless = false;\n @Input() nzSize: NzSizeLDSType = 'default';\n @Input({ transform: booleanAttribute }) nzStepperless: boolean = true;\n @Input() nzStatus: NzStatus = '';\n @Input({ transform: booleanAttribute })\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: boolean) {\n this._disabled = value;\n }\n _disabled = false;\n disabled$ = new Subject<boolean>();\n\n dir: Direction = 'ltr';\n // status\n prefixCls: string = 'ant-input';\n status: NzValidateStatus = '';\n statusCls: NgClassInterface = {};\n hasFeedback: boolean = false;\n feedbackRef: ComponentRef<NzFormItemFeedbackIconComponent> | null = null;\n components: Array<ComponentRef<NzFormItemFeedbackIconComponent>> = [];\n ngControl = inject(NgControl, { self: true, optional: true });\n\n protected finalSize = computed(() => {\n if (this.compactSize) {\n return this.compactSize();\n }\n return this.size();\n });\n\n private size = signal<NzSizeLDSType>(this.nzSize);\n private compactSize = inject(NZ_SPACE_COMPACT_SIZE, { optional: true });\n private destroy$ = inject(NzDestroyService);\n private nzFormStatusService = inject(NzFormStatusService, { optional: true });\n private nzFormNoStatusService = inject(NzFormNoStatusService, { optional: true });\n\n constructor(\n private renderer: Renderer2,\n private elementRef: ElementRef,\n protected hostView: ViewContainerRef,\n private directionality: Directionality\n ) {}\n\n ngOnInit(): void {\n this.nzFormStatusService?.formStatusChanges\n .pipe(\n distinctUntilChanged((pre, cur) => {\n return pre.status === cur.status && pre.hasFeedback === cur.hasFeedback;\n }),\n takeUntil(this.destroy$)\n )\n .subscribe(({ status, hasFeedback }) => {\n this.setStatusStyles(status, hasFeedback);\n });\n\n if (this.ngControl) {\n this.ngControl.statusChanges\n ?.pipe(\n filter(() => this.ngControl!.disabled !== null),\n takeUntil(this.destroy$)\n )\n .subscribe(() => {\n this.disabled$.next(this.ngControl!.disabled!);\n });\n }\n\n this.dir = this.directionality.value;\n this.directionality.change?.pipe(takeUntil(this.destroy$)).subscribe((direction: Direction) => {\n this.dir = direction;\n });\n }\n\n ngOnChanges({ disabled, nzStatus, nzSize }: SimpleChanges): void {\n if (disabled) {\n this.disabled$.next(this.disabled);\n }\n if (nzStatus) {\n this.setStatusStyles(this.nzStatus, this.hasFeedback);\n }\n if (nzSize) {\n this.size.set(nzSize.currentValue);\n }\n }\n\n private setStatusStyles(status: NzValidateStatus, hasFeedback: boolean): void {\n // set inner status\n this.status = status;\n this.hasFeedback = hasFeedback;\n this.renderFeedbackIcon();\n // render status if nzStatus is set\n this.statusCls = getStatusClassNames(this.prefixCls, status, hasFeedback);\n Object.keys(this.statusCls).forEach(status => {\n if (this.statusCls[status]) {\n this.renderer.addClass(this.elementRef.nativeElement, status);\n } else {\n this.renderer.removeClass(this.elementRef.nativeElement, status);\n }\n });\n }\n\n private renderFeedbackIcon(): void {\n if (!this.status || !this.hasFeedback || !!this.nzFormNoStatusService) {\n // remove feedback\n this.hostView.clear();\n this.feedbackRef = null;\n return;\n }\n\n this.feedbackRef = this.feedbackRef || this.hostView.createComponent(NzFormItemFeedbackIconComponent);\n this.feedbackRef.location.nativeElement.classList.add('ant-input-suffix');\n this.feedbackRef.instance.status = this.status;\n this.feedbackRef.instance.updateIcon();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { Direction, Directionality } from '@angular/cdk/bidi';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n QueryList,\n Renderer2,\n SimpleChanges,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n inject\n} from '@angular/core';\nimport { Subject, merge } from 'rxjs';\nimport { distinctUntilChanged, map, mergeMap, startWith, switchMap, takeUntil } from 'rxjs/operators';\n\nimport { NzFormItemFeedbackIconComponent, NzFormNoStatusService, NzFormStatusService } from 'ng-zorro-antd/core/form';\nimport { NgClassInterface, NzSizeLDSType, NzStatus, NzValidateStatus } from 'ng-zorro-antd/core/types';\nimport { getStatusClassNames } from 'ng-zorro-antd/core/util';\nimport { NZ_SPACE_COMPACT_ITEM_TYPE, NzSpaceCompactItemDirective } from 'ng-zorro-antd/space';\n\nimport { NzInputGroupSlotComponent } from './input-group-slot.component';\nimport { NzInputDirective } from './input.directive';\n\n@Directive({\n selector: `nz-input-group[nzSuffix], nz-input-group[nzPrefix]`\n})\nexport class NzInputGroupWhitSuffixOrPrefixDirective {\n constructor(public elementRef: ElementRef) {}\n}\n\n@Component({\n selector: 'nz-input-group',\n exportAs: 'nzInputGroup',\n imports: [NzInputGroupSlotComponent, NgTemplateOutlet, NzFormItemFeedbackIconComponent],\n encapsulation: ViewEncapsulation.None,\n providers: [NzFormNoStatusService, { provide: NZ_SPACE_COMPACT_ITEM_TYPE, useValue: 'input' }],\n template: `\n @if (isAddOn) {\n <span class=\"ant-input-wrapper ant-input-group\">\n @if (nzAddOnBefore || nzAddOnBeforeIcon) {\n <span nz-input-group-slot type=\"addon\" [icon]=\"nzAddOnBeforeIcon\" [template]=\"nzAddOnBefore\"></span>\n }\n\n @if (isAffix || hasFeedback) {\n <span\n class=\"ant-input-affix-wrapper\"\n [class.ant-input-affix-wrapper-disabled]=\"disabled\"\n [class.ant-input-affix-wrapper-sm]=\"isSmall\"\n [class.ant-input-affix-wrapper-lg]=\"isLarge\"\n [class.ant-input-affix-wrapper-focused]=\"focused\"\n [class]=\"affixInGroupStatusCls\"\n >\n <ng-template [ngTemplateOutlet]=\"affixTemplate\"></ng-template>\n </span>\n } @else {\n <ng-template [ngTemplateOutlet]=\"contentTemplate\" />\n }\n @if (nzAddOnAfter || nzAddOnAfterIcon) {\n <span nz-input-group-slot type=\"addon\" [icon]=\"nzAddOnAfterIcon\" [template]=\"nzAddOnAfter\"></span>\n }\n </span>\n } @else {\n @if (isAffix) {\n <ng-template [ngTemplateOutlet]=\"affixTemplate\" />\n } @else {\n <ng-template [ngTemplateOutlet]=\"contentTemplate\" />\n }\n }\n\n <!-- affix template -->\n <ng-template #affixTemplate>\n @if (nzPrefix || nzPrefixIcon) {\n <span nz-input-group-slot type=\"prefix\" [icon]=\"nzPrefixIcon\" [template]=\"nzPrefix\"></span>\n }\n <ng-template [ngTemplateOutlet]=\"contentTemplate\" />\n @if (nzSuffix || nzSuffixIcon || isFeedback) {\n <span nz-input-group-slot type=\"suffix\" [icon]=\"nzSuffixIcon\" [template]=\"nzSuffix\">\n @if (isFeedback) {\n <nz-form-item-feedback-icon [status]=\"status\" />\n }\n </span>\n }\n </ng-template>\n\n <!-- content template -->\n <ng-template #contentTemplate>\n <ng-content></ng-content>\n @if (!isAddOn && !isAffix && isFeedback) {\n <span nz-input-group-slot type=\"suffix\">\n <nz-form-item-feedback-icon [status]=\"status\" />\n </span>\n }\n </ng-template>\n `,\n host: {\n '[class.ant-input-group-compact]': `nzCompact`,\n '[class.ant-input-search-enter-button]': `nzSearch`,\n '[class.ant-input-search]': `nzSearch`,\n '[class.ant-input-search-rtl]': `dir === 'rtl'`,\n '[class.ant-input-search-sm]': `nzSearch && isSmall`,\n '[class.ant-input-search-large]': `nzSearch && isLarge`,\n '[class.ant-input-group-wrapper]': `isAddOn`,\n '[class.ant-input-group-wrapper-rtl]': `dir === 'rtl'`,\n '[class.ant-input-group-wrapper-lg]': `isAddOn && isLarge`,\n '[class.ant-input-group-wrapper-sm]': `isAddOn && isSmall`,\n '[class.ant-input-affix-wrapper]': `isAffix && !isAddOn`,\n '[class.ant-input-affix-wrapper-rtl]': `dir === 'rtl'`,\n '[class.ant-input-affix-wrapper-focused]': `isAffix && focused`,\n '[class.ant-input-affix-wrapper-disabled]': `isAffix && disabled`,\n '[class.ant-input-affix-wrapper-lg]': `isAffix && !isAddOn && isLarge`,\n '[class.ant-input-affix-wrapper-sm]': `isAffix && !isAddOn && isSmall`,\n '[class.ant-input-group]': `!isAffix && !isAddOn`,\n '[class.ant-input-group-rtl]': `dir === 'rtl'`,\n '[class.ant-input-group-lg]': `!isAffix && !isAddOn && isLarge`,\n '[class.ant-input-group-sm]': `!isAffix && !isAddOn && isSmall`\n },\n hostDirectives: [NzSpaceCompactItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NzInputGroupComponent implements AfterContentInit, OnChanges, OnInit, OnDestroy {\n @ContentChildren(NzInputDirective) listOfNzInputDirective!: QueryList<NzInputDirective>;\n @Input() nzAddOnBeforeIcon?: string | null = null;\n @Input() nzAddOnAfterIcon?: string | null = null;\n @Input() nzPrefixIcon?: string | null = null;\n @Input() nzSuffixIcon?: string | null = null;\n @Input() nzAddOnBefore?: string | TemplateRef<void>;\n @Input() nzAddOnAfter?: string | TemplateRef<void>;\n @Input() nzPrefix?: string | TemplateRef<void>;\n @Input() nzStatus: NzStatus = '';\n @Input() nzSuffix?: string | TemplateRef<void>;\n @Input() nzSize: NzSizeLDSType = 'default';\n @Input({ transform: booleanAttribute }) nzSearch = false;\n /**\n * @deprecated Will be removed in v20. Use `NzSpaceCompactComponent` instead.\n */\n @Input({ transform: booleanAttribute }) nzCompact = false;\n isLarge = false;\n isSmall = false;\n isAffix = false;\n isAddOn = false;\n isFeedback = false;\n focused = false;\n disabled = false;\n dir: Direction = 'ltr';\n // status\n prefixCls: string = 'ant-input';\n affixStatusCls: NgClassInterface = {};\n groupStatusCls: NgClassInterface = {};\n affixInGroupStatusCls: NgClassInterface = {};\n status: NzValidateStatus = '';\n hasFeedback: boolean = false;\n private destroy$ = new Subject<void>();\n private nzFormStatusService = inject(NzFormStatusService, { optional: true });\n private nzFormNoStatusService = inject(NzFormNoStatusService, { optional: true });\n\n constructor(\n private focusMonitor: FocusMonitor,\n private elementRef: ElementRef,\n private renderer: Renderer2,\n private cdr: ChangeDetectorRef,\n private directionality: Directionality\n ) {}\n\n updateChildrenInputSize(): void {\n if (this.listOfNzInputDirective) {\n this.listOfNzInputDirective.forEach(item => item['size'].set(this.nzSize));\n }\n }\n\n ngOnInit(): void {\n this.nzFormStatusService?.formStatusChanges\n .pipe(\n distinctUntilChanged((pre, cur) => {\n return pre.status === cur.status && pre.hasFeedback === cur.hasFeedback;\n }),\n takeUntil(this.destroy$)\n )\n .subscribe(({ status, hasFeedback }) => {\n this.setStatusStyles(status, hasFeedback);\n });\n\n this.focusMonitor\n .monitor(this.elementRef, true)\n .pipe(takeUntil(this.destroy$))\n .subscribe(focusOrigin => {\n this.focused = !!focusOrigin;\n this.cdr.markForCheck();\n });\n\n this.dir = this.directionality.value;\n this.directionality.change?.pipe(takeUntil(this.destroy$)).subscribe((direction: Direction) => {\n this.dir = direction;\n });\n }\n\n ngAfterContentInit(): void {\n this.updateChildrenInputSize();\n const listOfInputChange$ = this.listOfNzInputDirective.changes.pipe(startWith(this.listOfNzInputDirective));\n listOfInputChange$\n .pipe(\n switchMap(list => merge(...[listOfInputChange$, ...list.map((input: NzInputDirective) => input.disabled$)])),\n mergeMap(() => listOfInputChange$),\n map(list => list.some((input: NzInputDirective) => input.disabled)),\n takeUntil(this.destroy$)\n )\n .subscribe(disabled => {\n this.disabled = disabled;\n this.cdr.markForCheck();\n });\n }\n ngOnChanges(changes: SimpleChanges): void {\n const {\n nzSize,\n nzSuffix,\n nzPrefix,\n nzPrefixIcon,\n nzSuffixIcon,\n nzAddOnAfter,\n nzAddOnBefore,\n nzAddOnAfterIcon,\n nzAddOnBeforeIcon,\n nzStatus\n } = changes;\n if (nzSize) {\n this.updateChildrenInputSize();\n this.isLarge = this.nzSize === 'large';\n this.isSmall = this.nzSize === 'small';\n }\n if (nzSuffix || nzPrefix || nzPrefixIcon || nzSuffixIcon) {\n this.isAffix = !!(this.nzSuffix || this.nzPrefix || this.nzPrefixIcon || this.nzSuffixIcon);\n }\n if (nzAddOnAfter || nzAddOnBefore || nzAddOnAfterIcon || nzAddOnBeforeIcon) {\n this.isAddOn = !!(this.nzAddOnAfter || this.nzAddOnBefore || this.nzAddOnAfterIcon || this.nzAddOnBeforeIcon);\n this.nzFormNoStatusService?.noFormStatus?.next(this.isAddOn);\n }\n if (nzStatus) {\n this.setStatusStyles(this.nzStatus, this.hasFeedback);\n }\n }\n ngOnDestroy(): void {\n this.focusMonitor.stopMonitoring(this.elementRef);\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n private setStatusStyles(status: NzValidateStatus, hasFeedback: boolean): void {\n // set inner status\n this.status = status;\n this.hasFeedback = hasFeedback;\n this.isFeedback = !!status && hasFeedback;\n const baseAffix = !!(this.nzSuffix || this.nzPrefix || this.nzPrefixIcon || this.nzSuffixIcon);\n this.isAffix = baseAffix || (!this.isAddOn && hasFeedback);\n this.affixInGroupStatusCls =\n this.isAffix || this.isFeedback\n ? (this.affixStatusCls = getStatusClassNames(`${this.prefixCls}-affix-wrapper`, status, hasFeedback))\n : {};\n this.cdr.markForCheck();\n // render status if nzStatus is set\n this.affixStatusCls = getStatusClassNames(\n `${this.prefixCls}-affix-wrapper`,\n this.isAddOn ? '' : status,\n this.isAddOn ? false : hasFeedback\n );\n this.groupStatusCls = getStatusClassNames(\n `${this.prefixCls}-group-wrapper`,\n this.isAddOn ? status : '',\n this.isAddOn ? hasFeedback : false\n );\n const statusCls = {\n ...this.affixStatusCls,\n ...this.groupStatusCls\n };\n Object.keys(statusCls).forEach(status => {\n if (statusCls[status]) {\n this.renderer.addClass(this.elementRef.nativeElement, status);\n } else {\n this.renderer.removeClass(this.elementRef.nativeElement, status);\n }\n });\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { BACKSPACE } from '@angular/cdk/keycodes';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n forwardRef,\n Input,\n numberAttribute,\n OnChanges,\n QueryList,\n SimpleChanges,\n ViewChildren,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormArray,\n FormBuilder,\n FormControl,\n NG_VALUE_ACCESSOR,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\nimport { takeUntil, tap } from 'rxjs/operators';\n\nimport { NzDestroyService } from 'ng-zorro-antd/core/services';\nimport { NzSafeAny, NzSizeLDSType, NzStatus, OnTouchedType } from 'ng-zorro-antd/core/types';\n\nimport { NzInputDirective } from './input.directive';\n\n@Component({\n selector: 'nz-input-otp',\n exportAs: 'nzInputOtp',\n preserveWhitespaces: false,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @for (item of otpArray.controls; track $index) {\n <input\n nz-input\n class=\"ant-otp-input\"\n type=\"text\"\n maxlength=\"1\"\n size=\"1\"\n [nzSize]=\"nzSize\"\n [formControl]=\"item\"\n [nzStatus]=\"nzStatus\"\n (input)=\"onInput($index, $event)\"\n (focus)=\"onFocus($event)\"\n (keydown)=\"onKeyDown($index, $event)\"\n (paste)=\"onPaste($index, $event)\"\n #otpInput\n />\n }\n `,\n host: {\n class: 'ant-otp'\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NzInputOtpComponent),\n multi: true\n },\n NzDestroyService\n ],\n imports: [NzInputDirective, ReactiveFormsModule]\n})\nexport class NzInputOtpComponent implements ControlValueAccessor, OnChanges {\n @ViewChildren('otpInput') otpInputs!: QueryList<ElementRef>;\n\n @Input({ transform: numberAttribute }) nzLength: number = 6;\n @Input() nzSize: NzSizeLDSType = 'default';\n @Input({ transform: booleanAttribute }) disabled = false;\n @Input() nzStatus: NzStatus = '';\n @Input() nzFormatter: (value: string) => string = value => value;\n @Input() nzMask: string | null = null;\n\n protected otpArray!: FormArray<FormControl<string>>;\n private internalValue: string[] = [];\n private onChangeCallback?: (_: NzSafeAny) => void;\n onTouched: OnTouchedType = () => {};\n\n constructor(\n private readonly formBuilder: FormBuilder,\n private readonly nzDestroyService: NzDestroyService\n ) {\n this.createFormArray();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['nzLength']?.currentValue) {\n this.createFormArray();\n }\n\n if (changes['disabled']) {\n this.setDisabledState(this.disabled);\n }\n }\n\n onInput(index: number, event: Event): void {\n const inputElement = event.target as HTMLInputElement;\n const nextInput = this.otpInputs.toArray()[index + 1];\n\n if (inputElement.value && nextInput) {\n nextInput.nativeElement.focus();\n } else if (!nextInput) {\n this.selectInputBox(index);\n }\n }\n\n onFocus(event: FocusEvent): void {\n const inputElement = event.target as HTMLInputElement;\n inputElement.select();\n }\n\n onKeyDown(index: number, event: KeyboardEvent): void {\n const previousInput = this.otpInputs.toArray()[index - 1];\n\n if (event.keyCode === BACKSPACE) {\n event.preventDefault();\n\n this.internalValue[index] = '';\n this.otpArray.at(index).setValue('', { emitEvent: false });\n\n if (previousInput) {\n this.selectInputBox(index - 1);\n }\n\n this.emitValue();\n }\n }\n\n writeValue(value: string): void {\n if (!value) {\n this.otpArray.reset();\n return;\n }\n\n const controlValues = value.split('');\n this.internalValue = controlValues;\n\n controlValues.forEach((val, i) => {\n const formattedValue = this.nzFormatter(val);\n const value = this.nzMask ? this.nzMask : formattedValue;\n this.otpArray.at(i).setValue(value, { emitEvent: false });\n });\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChangeCallback = fn;\n }\n\n registerOnTouched(fn: () => {}): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n if (isDisabled) {\n this.otpArray.disable();\n } else {\n this.otpArray.enable();\n }\n }\n\n onPaste(index: number, event: ClipboardEvent): void {\n const pastedText = event.clipboardData?.getData('text') || '';\n if (!pastedText) return;\n\n let currentIndex = index;\n for (const char of pastedText.split('')) {\n if (currentIndex < this.nzLength) {\n const formattedChar = this.nzFormatter(char);\n this.internalValue[currentIndex] = char;\n const maskedValue = this.nzMask ? this.nzMask : formattedChar;\n this.otpArray.at(currentIndex).setValue(maskedValue, { emitEvent: false });\n currentIndex++;\n } else {\n break;\n }\n }\n\n event.preventDefault(); // this line is needed, otherwise the last index that is going to be selected will also be filled (in the next line).\n this.selectInputBox(currentIndex);\n this.emitValue();\n }\n\n private createFormArray(): void {\n this.otpArray = this.formBuilder.array<FormControl<string>>([]);\n this.internalValue = new Array(this.nzLength).fill('');\n\n for (let i = 0; i < this.nzLength; i++) {\n const control = this.formBuilder.nonNullable.control('', [Validators.required]);\n\n control.valueChanges\n .pipe(\n tap(value => {\n const unmaskedValue = this.nzFormatter(value);\n this.internalValue[i] = unmaskedValue;\n\n control.setValue(this.nzMask ?? unmaskedValue, { emitEvent: false });\n\n this.emitValue();\n }),\n takeUntil(this.nzDestroyService)\n )\n .subscribe();\n\n this.otpArray.push(control);\n }\n }\n\n private emitValue(): void {\n const result = this.internalValue.join('');\n if (this.onChangeCallback) {\n this.onChangeCallback(result);\n }\n }\n\n private selectInputBox(index: number): void {\n const otpInputArray = this.otpInputs.toArray();\n if (index >= otpInputArray.length) index = otpInputArray.length - 1;\n\n otpInputArray[index].nativeElement.select();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ElementRef,\n Input,\n isDevMode,\n numberAttribute,\n OnDestroy,\n Renderer2\n} from '@angular/core';\nimport { EMPTY, merge, Subject } from 'rxjs';\nimport { map, startWith, takeUntil } from 'rxjs/operators';\n\nimport { isNotNil } from 'ng-zorro-antd/core/util';\n\nimport { NzInputDirective } from './input.directive';\n\n@Component({\n selector: 'nz-textarea-count',\n template: ` <ng-content select=\"textarea[nz-input]\"></ng-content> `,\n host: {\n class: 'ant-input-textarea-show-count'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NzTextareaCountComponent implements AfterContentInit, OnDestroy {\n @ContentChild(NzInputDirective, { static: true }) nzInputDirective!: NzInputDirective;\n @Input({ transform: numberAttribute }) nzMaxCharacterCount: number = 0;\n @Input() nzComputeCharacterCount: (v: string) => number = v => v.length;\n @Input() nzFormatter: (cur: number, max: number) => string = (c, m) => `${c}${m > 0 ? `/${m}` : ``}`;\n\n private configChange$ = new Subject();\n private destroy$ = new Subject<boolean>();\n\n constructor(\n private renderer: Renderer2,\n private elementRef: ElementRef<HTMLElement>\n ) {}\n\n ngAfterContentInit(): void {\n if (!this.nzInputDirective && isDevMode()) {\n throw new Error('[nz-textarea-count]: Could not find matching textarea[nz-input] child.');\n }\n\n if (this.nzInputDirective.ngControl) {\n const valueChanges = this.nzInputDirective.ngControl.valueChanges || EMPTY;\n merge(valueChanges, this.configChange$)\n .pipe(\n takeUntil(this.destroy$),\n map(() => this.nzInputDirective.ngControl!.value),\n startWith(this.nzInputDirective.ngControl.value as string)\n )\n .subscribe(value => {\n this.setDataCount(value);\n });\n }\n }\n\n setDataCount(value: string): void {\n const inputValue = isNotNil(value) ? String(value) : '';\n const currentCount = this.nzComputeCharacterCount(inputValue);\n const dataCount = this.nzFormatter(currentCount, this.nzMaxCharacterCount);\n this.renderer.setAttribute(this.elementRef.nativeElement, 'data-count', dataCount);\n }\n\n ngOnDestroy(): void {\n this.configChange$.complete();\n this.destroy$.next(true);\n this.destroy$.complete();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { NzAutosizeDirective } from './autosize.directive';\nimport { NzInputGroupSlotComponent } from './input-group-slot.component';\nimport { NzInputGroupComponent, NzInputGroupWhitSuffixOrPrefixDirective } from './input-group.component';\nimport { NzInputOtpComponent } from './input-otp.component';\nimport { NzInputDirective } from './input.directive';\nimport { NzTextareaCountComponent } from './textarea-count.component';\n\n@NgModule({\n imports: [\n NzTextareaCountComponent,\n NzInputDirective,\n NzInputGroupComponent,\n NzAutosizeDirective,\n NzInputGroupSlotComponent,\n NzInputGroupWhitSuffixOrPrefixDirective,\n NzInputOtpComponent\n ],\n exports: [\n NzTextareaCountComponent,\n NzInputDirective,\n NzInputGroupComponent,\n NzAutosizeDirective,\n NzInputGroupWhitSuffixOrPrefixDirective,\n NzInputOtpComponent\n ]\n})\nexport class NzInputModule {}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nexport * from './autosize.directive';\nexport * from './input-addon.directive';\nexport * from './input-affix.directive';\nexport * from './input-group-slot.component';\nexport * from './input-group.component';\nexport * from './input-otp.component';\nexport * from './input.directive';\nexport * from './input.module';\nexport * from './textarea-count.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2","i1","i3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;MA2Ba,mBAAmB,CAAA;AAuJpB,IAAA,MAAA;AACA,IAAA,QAAA;AACA,IAAA,aAAA;IAxJF,QAAQ,GAAY,KAAK;AACzB,IAAA,EAAE,GAA2C,MAAM,CAAC,UAAU,CAAC,CAAC,aAAa;AAC7E,IAAA,gBAAgB;AAChB,IAAA,aAAa;AACb,IAAA,eAAe;AACf,IAAA,OAAO;AACP,IAAA,OAAO;IACP,SAAS,GAAkB,IAAI;IAC/B,SAAS,GAAkB,IAAI;AAC/B,IAAA,QAAQ,GAAG,IAAI,OAAO,EAAW;IACjC,QAAQ,GAAG,EAAE;IAErB,IACI,UAAU,CAAC,KAAsC,EAAA;AACnD,QAAA,MAAM,cAAc,GAAG,CAAC,IAAqC,KAC3D,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,SAAS,KAAK,CAAC,CAAC,IAAI,CAA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