cmat 0.0.117 → 0.0.119
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.
- package/fesm2022/cmat-components-adapter.mjs +9 -9
- package/fesm2022/cmat-components-breadcrumb.mjs +10 -9
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +6 -6
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +16 -16
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +1 -863
- package/fesm2022/cmat-components-chip-input.mjs +11 -11
- package/fesm2022/cmat-components-code-editor.mjs +3 -3
- package/fesm2022/cmat-components-color-picker.mjs +45 -45
- package/fesm2022/cmat-components-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-custom-formly.mjs +214 -214
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-data-picker.mjs +43 -40
- package/fesm2022/cmat-components-data-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-date-range.mjs +15 -16
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs +4 -4
- package/fesm2022/cmat-components-drawer.mjs +9 -9
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs +4 -4
- package/fesm2022/cmat-components-file-preview.mjs +4 -4
- package/fesm2022/cmat-components-filter-toolbar.mjs +12 -13
- package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-form-actions.mjs +6 -6
- package/fesm2022/cmat-components-fullscreen.mjs +4 -4
- package/fesm2022/cmat-components-highlight.mjs +7 -7
- package/fesm2022/cmat-components-image-viewer.mjs +7 -7
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs +3 -3
- package/fesm2022/cmat-components-json-editor.mjs +7 -7
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +6 -6
- package/fesm2022/cmat-components-loading-overlay.mjs +5 -5
- package/fesm2022/cmat-components-loading-overlay.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +4 -4
- package/fesm2022/cmat-components-material-color-picker.mjs +1 -337
- package/fesm2022/cmat-components-material-datetimepicker.mjs +1 -4312
- package/fesm2022/cmat-components-navigation.mjs +1 -3081
- package/fesm2022/cmat-components-opt-input.mjs +1 -542
- package/fesm2022/cmat-components-org-chart.mjs +1 -529
- package/fesm2022/cmat-components-page-header.mjs +4 -4
- package/fesm2022/cmat-components-pagination.mjs +21 -21
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +1 -880
- package/fesm2022/cmat-components-popover.mjs +1 -1022
- package/fesm2022/cmat-components-progress-bar.mjs +4 -4
- package/fesm2022/cmat-components-qrcode.mjs +3 -3
- package/fesm2022/cmat-components-rating.mjs +8 -8
- package/fesm2022/cmat-components-rich-text-editor.mjs +3 -3
- package/fesm2022/cmat-components-select-search.mjs +1 -930
- package/fesm2022/cmat-components-select-table.mjs +39 -39
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +28 -27
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs +5 -5
- package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +12 -12
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs +6 -6
- package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
- package/fesm2022/cmat-components-table-toolbar.mjs +4 -4
- package/fesm2022/cmat-components-timeline.mjs +19 -19
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +14 -14
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +48 -49
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +8 -8
- package/fesm2022/cmat-components-upload.mjs +17 -17
- package/fesm2022/cmat-components-x6-angular-shape.mjs +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +1 -221
- package/fesm2022/cmat-directives-arrow-cursor.mjs +3 -3
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-data-exporter.mjs +1 -544
- package/fesm2022/cmat-directives-debounce.mjs +1 -163
- package/fesm2022/cmat-directives-digit-only.mjs +6 -6
- package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +3 -3
- package/fesm2022/cmat-lib-mock-api.mjs +8 -8
- package/fesm2022/cmat-pipes-bytes.mjs +3 -3
- package/fesm2022/cmat-pipes-date-format.mjs +3 -3
- package/fesm2022/cmat-pipes-find-by-key.mjs +3 -3
- package/fesm2022/cmat-pipes-group-by.mjs +3 -3
- package/fesm2022/cmat-pipes-keys.mjs +3 -3
- package/fesm2022/cmat-pipes-secure.mjs +6 -6
- package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
- package/fesm2022/cmat-reports.mjs +86 -80
- package/fesm2022/cmat-reports.mjs.map +1 -1
- package/fesm2022/cmat-services-alert.mjs +4 -4
- package/fesm2022/cmat-services-config.mjs +6 -6
- package/fesm2022/cmat-services-confirmation.mjs +1 -185
- package/fesm2022/cmat-services-data.mjs +5 -5
- package/fesm2022/cmat-services-export-as.mjs +4 -4
- package/fesm2022/cmat-services-loading.mjs +6 -6
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-media-watcher.mjs +4 -4
- package/fesm2022/cmat-services-platform.mjs +4 -4
- package/fesm2022/cmat-services-print.mjs +3 -3
- package/fesm2022/cmat-services-splash-screen.mjs +4 -4
- package/fesm2022/cmat-services-title.mjs +6 -6
- package/fesm2022/cmat-services-translation.mjs +4 -4
- package/fesm2022/cmat-services-utils.mjs +7 -7
- package/fesm2022/cmat.mjs +77 -39579
- package/fesm2022/public-api-BE83BHd7.mjs +930 -0
- package/fesm2022/public-api-BE83BHd7.mjs.map +1 -0
- package/fesm2022/public-api-BcmOSkgf.mjs +542 -0
- package/fesm2022/public-api-BcmOSkgf.mjs.map +1 -0
- package/fesm2022/public-api-BmMqKDzm.mjs +4312 -0
- package/fesm2022/public-api-BmMqKDzm.mjs.map +1 -0
- package/fesm2022/public-api-BnRFazGR.mjs +221 -0
- package/fesm2022/public-api-BnRFazGR.mjs.map +1 -0
- package/fesm2022/public-api-C9N9rKkB.mjs +185 -0
- package/fesm2022/public-api-C9N9rKkB.mjs.map +1 -0
- package/fesm2022/public-api-CXmCX9ZQ.mjs +863 -0
- package/fesm2022/public-api-CXmCX9ZQ.mjs.map +1 -0
- package/fesm2022/public-api-CfILyvuV.mjs +880 -0
- package/fesm2022/public-api-CfILyvuV.mjs.map +1 -0
- package/fesm2022/public-api-CgtBw-7O.mjs +163 -0
- package/fesm2022/public-api-CgtBw-7O.mjs.map +1 -0
- package/fesm2022/public-api-DEtzrfqy.mjs +544 -0
- package/fesm2022/public-api-DEtzrfqy.mjs.map +1 -0
- package/fesm2022/public-api-EK51WC1y.mjs +1022 -0
- package/fesm2022/public-api-EK51WC1y.mjs.map +1 -0
- package/fesm2022/public-api-IpTsAgZ4.mjs +3081 -0
- package/fesm2022/public-api-IpTsAgZ4.mjs.map +1 -0
- package/fesm2022/public-api-iRaKIVmd.mjs +338 -0
- package/fesm2022/public-api-iRaKIVmd.mjs.map +1 -0
- package/fesm2022/public-api-nzzDLiDj.mjs +529 -0
- package/fesm2022/public-api-nzzDLiDj.mjs.map +1 -0
- package/fesm2022/{cmat-quill-docx-exporter-D9Eo73Wq.mjs → quill-docx-exporter-D9Eo73Wq.mjs} +1 -1
- package/fesm2022/quill-docx-exporter-D9Eo73Wq.mjs.map +1 -0
- package/package.json +23 -22
- package/types/cmat-components-breadcrumb.d.ts +1 -1
- package/types/cmat-components-chip-input.d.ts +3 -3
- package/types/cmat-components-custom-formly.d.ts +2 -857
- package/types/cmat-components-data-picker.d.ts +12 -6
- package/types/cmat-components-date-range.d.ts +1 -1
- package/types/cmat-components-drawer.d.ts +1 -1
- package/types/cmat-components-form-actions.d.ts +1 -1
- package/types/cmat-components-knob-input.d.ts +1 -1
- package/types/cmat-components-masonry.d.ts +2 -1
- package/types/cmat-components-material-color-picker.d.ts +1 -1
- package/types/cmat-components-material-datetimepicker.d.ts +2 -836
- package/types/cmat-components-navigation.d.ts +1 -1
- package/types/cmat-components-opt-input.d.ts +2 -113
- package/types/cmat-components-org-chart.d.ts +1 -1
- package/types/cmat-components-page-header.d.ts +1 -1
- package/types/cmat-components-password-strength.d.ts +2 -201
- package/types/cmat-components-popover.d.ts +2 -270
- package/types/cmat-components-qrcode.d.ts +2 -113
- package/types/cmat-components-rating.d.ts +1 -1
- package/types/cmat-components-rich-text-editor.d.ts +1 -1
- package/types/cmat-components-select-search.d.ts +2 -200
- package/types/cmat-components-select-table.d.ts +3 -3
- package/types/cmat-components-select-tree.d.ts +6 -5
- package/types/cmat-components-status-tag.d.ts +2 -2
- package/types/cmat-components-toast.d.ts +2 -1
- package/types/cmat-components-transfer-picker.d.ts +2 -2
- package/types/cmat-components-upload.d.ts +1 -1
- package/types/cmat-components-x6-angular-shape.d.ts +1 -1
- package/types/cmat-directives-data-exporter.d.ts +1 -1
- package/types/cmat-directives-debounce.d.ts +2 -34
- package/types/cmat-directives-equal-validator.d.ts +1 -1
- package/types/cmat-directives-seamless-auto-scroll.d.ts +1 -1
- package/types/cmat-lib-mock-api.d.ts +3 -2
- package/types/cmat-pipes-secure.d.ts +1 -1
- package/types/cmat-reports.d.ts +6 -6
- package/types/cmat-services-alert.d.ts +1 -1
- package/types/cmat-services-confirmation.d.ts +2 -36
- package/types/cmat-services-data.d.ts +1 -1
- package/types/cmat-services-export-as.d.ts +1 -1
- package/types/cmat-services-loading.d.ts +1 -1
- package/types/cmat-services-translation.d.ts +1 -1
- package/types/cmat-services-utils.d.ts +2 -2
- package/types/cmat.d.ts +78 -7676
- package/types/public-api-BFGGDRK3.d.ts +201 -0
- package/types/public-api-BXS379ev.d.ts +202 -0
- package/types/public-api-C4CvABGO.d.ts +114 -0
- package/types/public-api-CSYz4G5Z.d.ts +271 -0
- package/types/public-api-NSrmlKKH.d.ts +114 -0
- package/types/public-api-PfNpHSSm.d.ts +837 -0
- package/types/public-api-f3WtygQS.d.ts +35 -0
- package/types/public-api-nBuSXSMJ.d.ts +858 -0
- package/types/public-api-yYeZrUAV.d.ts +37 -0
- package/fesm2022/cmat-components-cascade.mjs.map +0 -1
- package/fesm2022/cmat-components-custom-formly-quill-docx-exporter-BwwGX2Ie.mjs +0 -294
- package/fesm2022/cmat-components-custom-formly-quill-docx-exporter-BwwGX2Ie.mjs.map +0 -1
- package/fesm2022/cmat-components-material-color-picker.mjs.map +0 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +0 -1
- package/fesm2022/cmat-components-navigation.mjs.map +0 -1
- package/fesm2022/cmat-components-opt-input.mjs.map +0 -1
- package/fesm2022/cmat-components-org-chart.mjs.map +0 -1
- package/fesm2022/cmat-components-password-strength.mjs.map +0 -1
- package/fesm2022/cmat-components-popover.mjs.map +0 -1
- package/fesm2022/cmat-components-select-search.mjs.map +0 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +0 -1
- package/fesm2022/cmat-directives-data-exporter.mjs.map +0 -1
- package/fesm2022/cmat-directives-debounce.mjs.map +0 -1
- package/fesm2022/cmat-quill-docx-exporter-D9Eo73Wq.mjs.map +0 -1
- package/fesm2022/cmat-services-confirmation.mjs.map +0 -1
- package/fesm2022/cmat.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api-BE83BHd7.mjs","names":[],"sources":["../../../projects/cmat/components/select-search/default-options.ts","../../../projects/cmat/components/select-search/select-no-entries-found.directive.ts","../../../projects/cmat/components/select-search/select-search-clear.directive.ts","../../../projects/cmat/components/select-search/select-search.component.ts","../../../projects/cmat/components/select-search/select-search.component.html"],"sourcesContent":["import { InjectionToken } from '@angular/core';\r\nimport { CmatSelectSearchComponent } from './select-search.component';\r\n\r\n\r\nexport const configurableDefaultOptions = [\r\n 'ariaLabel',\r\n 'clearSearchInput',\r\n 'disableInitialFocus',\r\n 'disableScrollToActiveOnOptionsChanged',\r\n 'enableClearOnEscapePressed',\r\n 'hideClearSearchButton',\r\n 'noEntriesFoundLabel',\r\n 'placeholderLabel',\r\n 'preventHomeEndKeyPropagation',\r\n 'searching',\r\n] as const;\r\n\r\nexport type ConfigurableDefaultOptions = typeof configurableDefaultOptions[number];\r\n\r\nexport const MAT_SELECTSEARCH_DEFAULT_OPTIONS = new InjectionToken<MatSelectSearchOptions>('mat-selectsearch-default-options');\r\n\r\n\r\nexport type MatSelectSearchOptions = Readonly<Partial<Pick<CmatSelectSearchComponent, ConfigurableDefaultOptions>>>;\r\n","import { Directive } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[cmatSelectNoEntriesFound]'\r\n})\r\nexport class CmatSelectNoEntriesFoundDirective { }\r\n","import { Directive } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[cmatSelectSearchClear]'\r\n})\r\nexport class CmatSelectSearchClearDirective { }\r\n","import { ViewportRuler } from '@angular/cdk/scrolling';\r\nimport { NgClass } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n contentChild,\r\n DestroyRef,\r\n ElementRef,\r\n forwardRef,\r\n HostBinding,\r\n OnInit,\r\n QueryList,\r\n viewChild,\r\n ViewEncapsulation,\r\n inject,\r\n signal,\r\n input,\r\n output,\r\n computed,\r\n effect,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport {\r\n ControlValueAccessor,\r\n FormControl,\r\n NG_VALUE_ACCESSOR,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n} from '@angular/forms';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatCheckboxModule } from '@angular/material/checkbox';\r\nimport {\r\n MatOption,\r\n _countGroupLabelsBeforeOption,\r\n} from '@angular/material/core';\r\nimport { MatFormField, MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { MatSelect } from '@angular/material/select';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { debounceTime, delay, filter, startWith, take, tap } from 'rxjs/operators';\r\nimport {\r\n MatSelectSearchOptions,\r\n MAT_SELECTSEARCH_DEFAULT_OPTIONS,\r\n} from './default-options';\r\nimport { CmatSelectNoEntriesFoundDirective } from './select-no-entries-found.directive';\r\nimport { CmatSelectSearchClearDirective } from './select-search-clear.directive';\r\n\r\nconst SELECT_PANEL_MAX_HEIGHT = 256;\r\n\r\n@Component({\r\n selector: 'cmat-select-search',\r\n templateUrl: './select-search.component.html',\r\n styleUrls: ['./select-search.component.scss'],\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => CmatSelectSearchComponent),\r\n multi: true,\r\n },\r\n ],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatSelectSearch',\r\n imports: [\r\n MatInputModule,\r\n NgClass,\r\n MatCheckboxModule,\r\n MatTooltipModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatProgressSpinnerModule,\r\n MatButtonModule\r\n ],\r\n})\r\nexport class CmatSelectSearchComponent implements OnInit, ControlValueAccessor {\r\n readonly toggleAll = output<boolean>();\r\n\r\n readonly searchSelectInput = viewChild.required<ElementRef<HTMLInputElement>>('searchSelectInput');\r\n\r\n readonly innerSelectSearch = viewChild.required<ElementRef<HTMLElement>>('innerSelectSearch');\r\n\r\n readonly clearIcon = contentChild(CmatSelectSearchClearDirective);\r\n readonly noEntriesFound = contentChild(CmatSelectNoEntriesFoundDirective);\r\n\r\n formControl: FormControl<string | null> = new FormControl<string | null>('');\r\n\r\n readonly placeholderLabel = input<string>('搜索');\r\n\r\n readonly type = input<string>('text');\r\n\r\n readonly noEntriesFoundLabel = input<string>('无结果');\r\n\r\n readonly showNoFoundLabel = input<boolean>(true);\r\n\r\n readonly clearSearchInput = input(true);\r\n\r\n readonly searching = input<boolean>(false);\r\n\r\n readonly disableInitialFocus = input<boolean>(false);\r\n\r\n readonly enableClearOnEscapePressed = input(false);\r\n\r\n readonly preventHomeEndKeyPropagation = input<boolean>(false);\r\n\r\n readonly disableScrollToActiveOnOptionsChanged = input<boolean>(false);\r\n\r\n readonly ariaLabel = input<string>('下拉搜索');\r\n\r\n readonly showToggleAllCheckbox = input<boolean>(false);\r\n\r\n readonly toggleAllCheckboxChecked = input<boolean>(false);\r\n\r\n readonly toggleAllCheckboxIndeterminate = input<boolean>(false);\r\n\r\n readonly toggleAllCheckboxTooltipMessage = input<string>('');\r\n\r\n readonly toggleAllCheckboxTooltipPosition = input<\r\n 'left' | 'right' | 'above' | 'below' | 'before' | 'after'\r\n >('below');\r\n\r\n readonly hideClearSearchButton = input<boolean>(false);\r\n\r\n readonly alwaysRestoreSelectedOptionsMulti = input<boolean>(false);\r\n\r\n /**\r\n * 输入框防抖时间(毫秒),默认 300ms\r\n * 设置为 0 可禁用防抖\r\n */\r\n readonly debounceTime = input<number>(300);\r\n\r\n /**\r\n * 可选条目数量(由父组件提供)\r\n * 用于判断是否显示\"无结果\"提示\r\n * 如果未提供,则尝试从 matSelect.options.length 自动获取\r\n */\r\n readonly optionsCount = input<number | null>(null);\r\n\r\n /**\r\n * 自动计算是否显示\"无结果\"提示\r\n * 基于 optionsCount 或 matSelect.options.length 判断\r\n */\r\n readonly showNoEntriesFound: () => boolean;\r\n\r\n protected matSelect = inject<MatSelect>(MatSelect);\r\n protected matFormField =\r\n inject<MatFormField | null>(MatFormField, { optional: true }) ?? null;\r\n private _viewportRuler = inject(ViewportRuler);\r\n private _matOption =\r\n inject<MatOption | null>(MatOption, { optional: true }) ?? null;\r\n private _defaultOptions = inject<MatSelectSearchOptions>(\r\n MAT_SELECTSEARCH_DEFAULT_OPTIONS,\r\n { optional: true },\r\n );\r\n private readonly _destroyRef = inject(DestroyRef);\r\n\r\n private _options$ = signal<QueryList<MatOption> | null>(null);\r\n private _lastExternalInputValue?: string;\r\n\r\n private _previousSelectedValues: unknown[] = [];\r\n\r\n private _activeDescendant?: HTMLElement;\r\n\r\n private readonly _valueSignal = signal('');\r\n\r\n constructor() {\r\n this._applyDefaultOptions(this._defaultOptions);\r\n\r\n this.showNoEntriesFound = computed(() => {\r\n // 优先使用父组件传递的 optionsCount(适用于 mat-table 等特殊情况)\r\n const providedCount = this.optionsCount();\r\n const optionsCount = providedCount ?? (this.matSelect?.options?.length ?? 0);\r\n \r\n const offset = this._getOptionsLengthOffset(); \r\n const hasSearchValue = !!this._valueSignal();\r\n \r\n return !!this.noEntriesFoundLabel() && hasSearchValue && optionsCount <= offset;\r\n });\r\n\r\n // 根据 debounceTime 动态构建 observable\r\n let valueChanges$ = this.formControl.valueChanges.pipe(\r\n startWith(this.formControl.value),\r\n );\r\n\r\n // 如果 debounceTime > 0,添加防抖\r\n if (this.debounceTime() > 0) {\r\n valueChanges$ = valueChanges$.pipe(debounceTime(this.debounceTime()));\r\n }\r\n\r\n valueChanges$\r\n .pipe(takeUntilDestroyed(this._destroyRef))\r\n .subscribe((value): void => {\r\n this._valueSignal.set(value ?? '');\r\n });\r\n\r\n effect((): void => {\r\n const show = this.showNoEntriesFound();\r\n if (this._matOption) {\r\n const el = this._matOption._getHostElement();\r\n if (show) {\r\n el.classList.add('cmat-select-search-no-entries-found');\r\n } else {\r\n el.classList.remove('cmat-select-search-no-entries-found');\r\n }\r\n }\r\n });\r\n }\r\n\r\n @HostBinding('class.cmat-select-search-inside-mat-option')\r\n get isInsideMatOption(): boolean {\r\n return !!this._matOption;\r\n }\r\n\r\n get value(): string {\r\n return this._valueSignal();\r\n }\r\n\r\n public get _options(): QueryList<MatOption> | null {\r\n return this._options$();\r\n }\r\n public set _options(_options: QueryList<MatOption>) {\r\n this._options$.set(_options);\r\n }\r\n\r\n onTouched: () => void = () => {\r\n /* empty */\r\n };\r\n\r\n ngOnInit(): void {\r\n const panelClass = 'cmat-select-search-panel';\r\n if (this.matSelect.panelClass) {\r\n if (Array.isArray(this.matSelect.panelClass)) {\r\n (this.matSelect.panelClass as string[]).push(panelClass);\r\n } else if (typeof this.matSelect.panelClass === 'string') {\r\n this.matSelect.panelClass = [this.matSelect.panelClass, panelClass];\r\n } else if (typeof this.matSelect.panelClass === 'object') {\r\n (this.matSelect.panelClass as Record<string, boolean>)[panelClass] =\r\n true;\r\n }\r\n } else {\r\n this.matSelect.panelClass = panelClass;\r\n }\r\n\r\n if (this._matOption) {\r\n this._matOption.disabled = true;\r\n this._matOption\r\n ._getHostElement()\r\n .classList.add('contains-cmat-select-search');\r\n this._matOption._getHostElement().setAttribute('aria-hidden', 'true');\r\n } else {\r\n console.error(\r\n '<cmat-select-search> must be placed inside a <mat-option> element',\r\n );\r\n }\r\n\r\n this.matSelect.openedChange\r\n .pipe(delay(1), takeUntilDestroyed(this._destroyRef))\r\n .subscribe((opened): void => {\r\n if (opened) {\r\n this.updateInputWidth();\r\n if (!this.disableInitialFocus()) {\r\n this.focus();\r\n }\r\n } else {\r\n if (this.clearSearchInput()) {\r\n this.reset();\r\n }\r\n }\r\n });\r\n\r\n this.matSelect.openedChange\r\n .pipe(take(1))\r\n .pipe(takeUntilDestroyed(this._destroyRef))\r\n .subscribe((): void => {\r\n if (this.matSelect._keyManager) {\r\n this.matSelect._keyManager.change\r\n .pipe(takeUntilDestroyed(this._destroyRef))\r\n .subscribe((): void =>\r\n this._adjustScrollTopToFitActiveOptionIntoView(),\r\n );\r\n } else {\r\n console.warn('_keyManager was not initialized.');\r\n }\r\n\r\n this._options = this.matSelect.options;\r\n let previousFirstOption =\r\n this._options.toArray()[this._getOptionsLengthOffset()];\r\n\r\n this._options.changes\r\n .pipe(takeUntilDestroyed(this._destroyRef))\r\n .subscribe((): void => {\r\n setTimeout((): void => {\r\n if (this._options) {\r\n const options = this._options.toArray();\r\n\r\n const currentFirstOption =\r\n options[this._getOptionsLengthOffset()];\r\n\r\n const keyManager = this.matSelect._keyManager;\r\n if (keyManager && this.matSelect.panelOpen) {\r\n const firstOptionIsChanged = !this.matSelect.compareWith(\r\n previousFirstOption,\r\n currentFirstOption,\r\n );\r\n\r\n if (\r\n firstOptionIsChanged ||\r\n !keyManager.activeItem ||\r\n !options.find((option): boolean =>\r\n this.matSelect.compareWith(option, keyManager.activeItem),\r\n )\r\n ) {\r\n keyManager.setFirstItemActive();\r\n }\r\n setTimeout((): void => {\r\n this.updateInputWidth();\r\n });\r\n\r\n if (!this.disableScrollToActiveOnOptionsChanged()) {\r\n this._adjustScrollTopToFitActiveOptionIntoView();\r\n }\r\n }\r\n previousFirstOption = currentFirstOption;\r\n }\r\n });\r\n });\r\n });\r\n this._viewportRuler\r\n .change()\r\n .pipe(takeUntilDestroyed(this._destroyRef))\r\n .subscribe((): void => {\r\n if (this.matSelect.panelOpen) {\r\n this.updateInputWidth();\r\n }\r\n });\r\n\r\n this._initMultipleHandling();\r\n }\r\n\r\n emitSelectAllBooleanToParent(state: boolean): void {\r\n this.toggleAll.emit(state);\r\n }\r\n\r\n isToggleAllCheckboxVisible(): boolean {\r\n return this.matSelect.multiple && this.showToggleAllCheckbox();\r\n }\r\n\r\n handleKeydown(event: KeyboardEvent): void {\r\n if (\r\n event.key?.length === 1 ||\r\n (this.preventHomeEndKeyPropagation() &&\r\n (event.code === 'Home' || event.code === 'End'))\r\n ) {\r\n event.stopPropagation();\r\n }\r\n\r\n if (this.matSelect.multiple && event.key && event.code === 'Enter') {\r\n setTimeout((): void => this.focus());\r\n }\r\n if (\r\n this.enableClearOnEscapePressed() === true &&\r\n event.code === 'Escape' &&\r\n this.value\r\n ) {\r\n this.reset(true);\r\n event.stopPropagation();\r\n }\r\n }\r\n\r\n handleKeyup(event: KeyboardEvent): void {\r\n // 方向键切换时同步当前高亮项\r\n if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {\r\n const ariaActiveDescendantId = this.matSelect._getAriaActiveDescendant();\r\n const index =\r\n this._options\r\n ?.toArray()\r\n .findIndex((item): boolean => item.id === ariaActiveDescendantId) ??\r\n -1;\r\n if (index >= 0) {\r\n this._unselectActiveDescendant();\r\n this._activeDescendant = this._options\r\n ?.toArray()[index]._getHostElement();\r\n this._activeDescendant?.setAttribute('aria-selected', 'true');\r\n if (ariaActiveDescendantId) {\r\n this.searchSelectInput().nativeElement.setAttribute(\r\n 'aria-activedescendant',\r\n ariaActiveDescendantId,\r\n );\r\n } else {\r\n this.searchSelectInput().nativeElement.removeAttribute(\r\n 'aria-activedescendant',\r\n );\r\n }\r\n }\r\n }\r\n }\r\n\r\n writeValue(value: string): void {\r\n this._lastExternalInputValue = value;\r\n this.formControl.setValue(value);\r\n }\r\n\r\n onBlur(): void {\r\n // 失焦时清理高亮并触发 touched\r\n this._unselectActiveDescendant();\r\n this.onTouched();\r\n }\r\n\r\n registerOnChange(fn: (value: string | null) => void): void {\r\n this.formControl.valueChanges\r\n .pipe(\r\n filter((value): boolean => value !== this._lastExternalInputValue),\r\n tap((): void => (this._lastExternalInputValue = undefined)),\r\n takeUntilDestroyed(this._destroyRef),\r\n )\r\n .subscribe(fn);\r\n }\r\n\r\n registerOnTouched(fn: () => void): void {\r\n this.onTouched = fn;\r\n }\r\n\r\n public focus(): void {\r\n // 聚焦并保持面板滚动位置\r\n if (!this.searchSelectInput() || !this.matSelect.panel) {\r\n return;\r\n }\r\n const panel = this.matSelect.panel.nativeElement as HTMLElement;\r\n const scrollTop = panel.scrollTop;\r\n\r\n this.searchSelectInput().nativeElement.focus();\r\n\r\n panel.scrollTop = scrollTop;\r\n }\r\n\r\n public reset(focus?: boolean): void {\r\n this.formControl.setValue('');\r\n if (focus) {\r\n this.focus();\r\n }\r\n }\r\n\r\n public updateInputWidth(): void {\r\n const innerEl = this.innerSelectSearch();\r\n if (!innerEl?.nativeElement) {\r\n return;\r\n }\r\n let currentElement: HTMLElement | null = innerEl.nativeElement;\r\n let panelElement: HTMLElement | null = null;\r\n while (currentElement?.parentElement) {\r\n currentElement = currentElement.parentElement;\r\n if (currentElement.classList.contains('mat-select-panel')) {\r\n panelElement = currentElement;\r\n break;\r\n }\r\n }\r\n if (panelElement) {\r\n innerEl.nativeElement.style.width =\r\n panelElement.clientWidth + 'px';\r\n }\r\n }\r\n\r\n private _getMatOptionHeight(): number {\r\n if (this.matSelect.options.length > 0) {\r\n return this.matSelect.options.first\r\n ._getHostElement()\r\n .getBoundingClientRect().height;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n private _getOptionsLengthOffset(): number {\r\n // 如果嵌套在 mat-option 内,则偏移一个选项\r\n if (this._matOption) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n }\r\n\r\n private _unselectActiveDescendant(): void {\r\n // 清理当前高亮项的 aria 状态\r\n this._activeDescendant?.removeAttribute('aria-selected');\r\n this.searchSelectInput().nativeElement.removeAttribute(\r\n 'aria-activedescendant',\r\n );\r\n }\r\n private _applyDefaultOptions(\r\n defaultOptions?: MatSelectSearchOptions | null,\r\n ): void {\r\n // 应用默认配置\r\n if (!defaultOptions) {\r\n return;\r\n }\r\n const options = defaultOptions;\r\n Object.assign(this, options);\r\n }\r\n private _initMultipleHandling(): void {\r\n if (!this.matSelect.ngControl) {\r\n if (this.matSelect.multiple) {\r\n console.error(\r\n 'the mat-select containing cmat-select-search must have a ngModel or formControl directive when multiple=true',\r\n );\r\n }\r\n return;\r\n }\r\n this._previousSelectedValues = this.matSelect.ngControl.value as unknown[];\r\n\r\n this.matSelect.ngControl.valueChanges\r\n ?.pipe(takeUntilDestroyed(this._destroyRef))\r\n .subscribe((values: unknown): void => {\r\n let restoreSelectedValues = false;\r\n let currentValues: unknown[] = Array.isArray(values) ? values : [];\r\n if (this.matSelect.multiple) {\r\n if (\r\n (this.alwaysRestoreSelectedOptionsMulti() ||\r\n this._valueSignal().length) &&\r\n this._previousSelectedValues &&\r\n Array.isArray(this._previousSelectedValues)\r\n ) {\r\n const optionValues = this.matSelect.options.map(\r\n (option): unknown => option.value,\r\n );\r\n this._previousSelectedValues.forEach((previousValue): void => {\r\n if (\r\n !currentValues.some((v: unknown): boolean =>\r\n this.matSelect.compareWith(v, previousValue),\r\n ) &&\r\n !optionValues.some((v): boolean =>\r\n this.matSelect.compareWith(v, previousValue),\r\n )\r\n ) {\r\n currentValues.push(previousValue);\r\n restoreSelectedValues = true;\r\n }\r\n });\r\n }\r\n }\r\n this._previousSelectedValues = currentValues;\r\n\r\n if (restoreSelectedValues) {\r\n this.matSelect._onChange(currentValues);\r\n }\r\n });\r\n }\r\n\r\n private _adjustScrollTopToFitActiveOptionIntoView(): void {\r\n // 滚动到当前高亮项附近\r\n if (this.matSelect.panel && this.matSelect.options.length > 0) {\r\n const matOptionHeight = this._getMatOptionHeight();\r\n const activeOptionIndex = this.matSelect._keyManager.activeItemIndex ?? 0;\r\n const labelCount = _countGroupLabelsBeforeOption(\r\n activeOptionIndex,\r\n this.matSelect.options,\r\n this.matSelect.optionGroups,\r\n );\r\n const indexOfOptionToFitIntoView =\r\n (this._matOption ? -1 : 0) + labelCount + activeOptionIndex;\r\n const currentScrollTop = (\r\n this.matSelect.panel.nativeElement as HTMLElement\r\n ).scrollTop;\r\n\r\n const innerEl = this.innerSelectSearch();\r\n const searchInputHeight = innerEl.nativeElement.offsetHeight;\r\n const amountOfVisibleOptions = Math.floor(\r\n (SELECT_PANEL_MAX_HEIGHT - searchInputHeight) / matOptionHeight,\r\n );\r\n\r\n const indexOfFirstVisibleOption =\r\n Math.round((currentScrollTop + searchInputHeight) / matOptionHeight) -\r\n 1;\r\n\r\n if (indexOfFirstVisibleOption >= indexOfOptionToFitIntoView) {\r\n (this.matSelect.panel.nativeElement as HTMLElement).scrollTop =\r\n indexOfOptionToFitIntoView * matOptionHeight;\r\n } else if (\r\n indexOfFirstVisibleOption + amountOfVisibleOptions <=\r\n indexOfOptionToFitIntoView\r\n ) {\r\n (this.matSelect.panel.nativeElement as HTMLElement).scrollTop =\r\n (indexOfOptionToFitIntoView + 1) * matOptionHeight -\r\n (SELECT_PANEL_MAX_HEIGHT - searchInputHeight);\r\n }\r\n }\r\n }\r\n}","<input matInput class=\"cmat-select-search-input cmat-select-search-hidden\" />\r\n\r\n<div\r\n #innerSelectSearch\r\n class=\"cmat-select-search-inner mat-typography mat-tab-header\"\r\n [ngClass]=\"{\r\n 'cmat-select-search-inner-multiple': matSelect.multiple,\r\n 'cmat-select-search-inner-toggle-all': isToggleAllCheckboxVisible(),\r\n }\"\r\n>\r\n @if (isToggleAllCheckboxVisible()) {\r\n <mat-checkbox\r\n class=\"cmat-select-search-toggle-all-checkbox -mr-4\"\r\n matTooltipClass=\"cmat-select-search-toggle-all-tooltip\"\r\n [color]=\"matFormField?.color\"\r\n [checked]=\"toggleAllCheckboxChecked()\"\r\n [indeterminate]=\"toggleAllCheckboxIndeterminate()\"\r\n [matTooltip]=\"toggleAllCheckboxTooltipMessage()\"\r\n [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition()\"\r\n (change)=\"emitSelectAllBooleanToParent($event.checked)\"\r\n >\r\n </mat-checkbox>\r\n }\r\n <span matPrefix class=\"flex flex-col justify-center pl-2\">\r\n <mat-icon\r\n class=\"cmat-select-search-icon\"\r\n color=\"primary\"\r\n svgIcon=\"heroicons_outline:magnifying-glass\"\r\n ></mat-icon>\r\n </span>\r\n <input\r\n #searchSelectInput\r\n matInput\r\n class=\"cmat-select-search-input cmat-input-element\"\r\n autocomplete=\"off\"\r\n [type]=\"type()\"\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholderLabel()\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n (keydown)=\"handleKeydown($event)\"\r\n (keyup)=\"handleKeyup($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n @if (searching()) {\r\n <mat-spinner class=\"cmat-select-search-spinner\" diameter=\"16\"></mat-spinner>\r\n }\r\n\r\n @if (!hideClearSearchButton() && value && !searching()) {\r\n <button\r\n type=\"button\"\r\n matIconButton\r\n aria-label=\"Clear\"\r\n class=\"cmat-select-search-clear\"\r\n (click)=\"reset(true)\"\r\n >\r\n @if (clearIcon()) {\r\n <ng-content select=\"[cmatSelectSearchClear]\"></ng-content>\r\n } @else {\r\n <mat-icon svgIcon=\"mat_outline:close\"></mat-icon>\r\n }\r\n </button>\r\n }\r\n\r\n <ng-content select=\".cmat-select-search-custom-header-content\"></ng-content>\r\n</div>\r\n\r\n@if (showNoEntriesFound()) {\r\n <div class=\"cmat-select-search-no-entries-found\">\r\n @if (noEntriesFound()) {\r\n <ng-content select=\"[cmatSelectNoEntriesFound]\"></ng-content>\r\n } @else {\r\n {{ noEntriesFoundLabel() }}\r\n }\r\n </div>\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAa,6BAA6B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACQ;AAIV,MAAa,mCAAmC,IAAI,eAAuC,kCAAkC;ACd7H,IAAa,oCAAb,MAAa,kCAAiC;CAAjC;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAiC,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAjC;EAAA,KAAA,OAAA,GAAA,qBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,MAAA;GAAiC,cAAA;GAAA,UAAA;GAAA,UAAA;EAAA,CAAA;CAAA;;AAAjC,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;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A,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,uBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,mCAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,mBAAA,CAAA;GA6HvE,MAAA;GAAY,MAAA,CAAA,4CAA4C"}
|
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, Input, ViewEncapsulation, computed, inject, input, output, signal } from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/common";
|
|
4
|
+
import { CommonModule } from "@angular/common";
|
|
5
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
6
|
+
import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
|
7
|
+
import * as i2 from "@angular/forms";
|
|
8
|
+
import { FormBuilder, FormControl, NgControl, ReactiveFormsModule } from "@angular/forms";
|
|
9
|
+
import { MatFormFieldControl } from "@angular/material/form-field";
|
|
10
|
+
import { Subject } from "rxjs";
|
|
11
|
+
var KeyboardUtil = class {
|
|
12
|
+
static ifTab(event) {
|
|
13
|
+
return this.ifKey(event, "Tab");
|
|
14
|
+
}
|
|
15
|
+
static ifDelete(event) {
|
|
16
|
+
return this.ifKey(event, "Delete;Del");
|
|
17
|
+
}
|
|
18
|
+
static ifBackspace(event) {
|
|
19
|
+
return this.ifKey(event, "Backspace");
|
|
20
|
+
}
|
|
21
|
+
static ifRightArrow(event) {
|
|
22
|
+
return this.ifKey(event, "ArrowRight;Right");
|
|
23
|
+
}
|
|
24
|
+
static ifLeftArrow(event) {
|
|
25
|
+
return this.ifKey(event, "ArrowLeft;Left");
|
|
26
|
+
}
|
|
27
|
+
static ifSpacebar(event) {
|
|
28
|
+
return this.ifKey(event, "Spacebar; ");
|
|
29
|
+
}
|
|
30
|
+
static ifKey(event, keys) {
|
|
31
|
+
return keys.split(";").some((k) => k === event.key);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
let NEXT_ID = 1;
|
|
35
|
+
var CmatOtpInputComponent = class CmatOtpInputComponent {
|
|
36
|
+
get errorState() {
|
|
37
|
+
if (this.ngControl == null) return false;
|
|
38
|
+
return (this.ngControl.invalid && ((this.ngControl.dirty ?? false) || this.ngControl.touched)) ?? false;
|
|
39
|
+
}
|
|
40
|
+
constructor() {
|
|
41
|
+
this.config = input({ length: 4 }, ...ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []);
|
|
42
|
+
this.onBlur = output();
|
|
43
|
+
this.onInputChange = output();
|
|
44
|
+
this.id = `cmat-otp-input-${NEXT_ID}`;
|
|
45
|
+
this.stateChanges = new Subject();
|
|
46
|
+
this._placeholderSignal = signal("", ...ngDevMode ? [{ debugName: "_placeholderSignal" }] : /* istanbul ignore next */ []);
|
|
47
|
+
this._requiredSignal = signal(false, ...ngDevMode ? [{ debugName: "_requiredSignal" }] : /* istanbul ignore next */ []);
|
|
48
|
+
this._disabledSignal = signal(false, ...ngDevMode ? [{ debugName: "_disabledSignal" }] : /* istanbul ignore next */ []);
|
|
49
|
+
this._valueSignal = signal(null, ...ngDevMode ? [{ debugName: "_valueSignal" }] : /* istanbul ignore next */ []);
|
|
50
|
+
this._currentValSignal = signal(null, ...ngDevMode ? [{ debugName: "_currentValSignal" }] : /* istanbul ignore next */ []);
|
|
51
|
+
this._focused = false;
|
|
52
|
+
this._activeFocusCount = 0;
|
|
53
|
+
this.controlKeys = computed(() => Object.keys(this.otpForm?.controls ?? {}), ...ngDevMode ? [{ debugName: "controlKeys" }] : /* istanbul ignore next */ []);
|
|
54
|
+
this.inputType = computed(() => {
|
|
55
|
+
const cfg = this.config();
|
|
56
|
+
return cfg?.isPasswordInput ? "password" : cfg?.allowNumbersOnly ? "tel" : "text";
|
|
57
|
+
}, ...ngDevMode ? [{ debugName: "inputType" }] : /* istanbul ignore next */ []);
|
|
58
|
+
this.componentKey = (NEXT_ID++).toString(36);
|
|
59
|
+
this.ngControl = inject(NgControl, {
|
|
60
|
+
optional: true,
|
|
61
|
+
self: true
|
|
62
|
+
});
|
|
63
|
+
this._document = inject(DOCUMENT);
|
|
64
|
+
this._formBuilder = inject(FormBuilder);
|
|
65
|
+
this._destroyRef = inject(DestroyRef);
|
|
66
|
+
this._valueChangesSub = null;
|
|
67
|
+
this._pendingTimeouts = [];
|
|
68
|
+
this._onModelChange = () => {};
|
|
69
|
+
this._onTouchedChange = () => {};
|
|
70
|
+
this.otpForm = this._formBuilder.group({});
|
|
71
|
+
if (this.ngControl != null) this.ngControl.valueAccessor = this;
|
|
72
|
+
this._rebuildForm();
|
|
73
|
+
}
|
|
74
|
+
get placeholder() {
|
|
75
|
+
return this._placeholderSignal();
|
|
76
|
+
}
|
|
77
|
+
set placeholder(value) {
|
|
78
|
+
this._placeholderSignal.set(value);
|
|
79
|
+
this.stateChanges.next();
|
|
80
|
+
}
|
|
81
|
+
get required() {
|
|
82
|
+
return this._requiredSignal();
|
|
83
|
+
}
|
|
84
|
+
set required(value) {
|
|
85
|
+
this._requiredSignal.set(coerceBooleanProperty(value));
|
|
86
|
+
this.stateChanges.next();
|
|
87
|
+
}
|
|
88
|
+
get disabled() {
|
|
89
|
+
if (!this.ngControl.disabled && this.ngControl.disabled !== null) return this.ngControl.disabled;
|
|
90
|
+
return this._disabledSignal();
|
|
91
|
+
}
|
|
92
|
+
set disabled(value) {
|
|
93
|
+
const isDisabled = coerceBooleanProperty(value);
|
|
94
|
+
this._disabledSignal.set(isDisabled);
|
|
95
|
+
this.setDisabledState(isDisabled);
|
|
96
|
+
if (isDisabled && this._focused) {
|
|
97
|
+
this._focused = false;
|
|
98
|
+
this.stateChanges.next();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
get focused() {
|
|
102
|
+
return this._focused;
|
|
103
|
+
}
|
|
104
|
+
get value() {
|
|
105
|
+
return this._valueSignal();
|
|
106
|
+
}
|
|
107
|
+
set value(val) {
|
|
108
|
+
if (val !== this._valueSignal()) {
|
|
109
|
+
this._valueSignal.set(val);
|
|
110
|
+
this.stateChanges.next();
|
|
111
|
+
this._onModelChange(val);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
get empty() {
|
|
115
|
+
return !this._valueSignal();
|
|
116
|
+
}
|
|
117
|
+
get shouldLabelFloat() {
|
|
118
|
+
return this._focused || !this.empty;
|
|
119
|
+
}
|
|
120
|
+
setDisabledState(isDisabled) {
|
|
121
|
+
if (this.otpForm) {
|
|
122
|
+
if (isDisabled) this.otpForm.disable({ emitEvent: false });
|
|
123
|
+
else this.otpForm.enable({ emitEvent: false });
|
|
124
|
+
}
|
|
125
|
+
this.stateChanges.next();
|
|
126
|
+
}
|
|
127
|
+
writeValue(value) {
|
|
128
|
+
this._currentValSignal.set(value || null);
|
|
129
|
+
if (this.otpForm && this._currentValSignal()) this.setValue(this._currentValSignal());
|
|
130
|
+
}
|
|
131
|
+
registerOnChange(fn) {
|
|
132
|
+
this._onModelChange = fn;
|
|
133
|
+
}
|
|
134
|
+
registerOnTouched(fn) {
|
|
135
|
+
this._onTouchedChange = fn;
|
|
136
|
+
}
|
|
137
|
+
onFocusIn() {
|
|
138
|
+
this._onTouchedChange();
|
|
139
|
+
this._activeFocusCount++;
|
|
140
|
+
if (!this._focused) {
|
|
141
|
+
this._focused = true;
|
|
142
|
+
this.stateChanges.next();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
onFocusOut() {
|
|
146
|
+
const timeoutId = setTimeout(() => {
|
|
147
|
+
this._removePendingTimeout(timeoutId);
|
|
148
|
+
this._activeFocusCount--;
|
|
149
|
+
if (this._activeFocusCount === 0) {
|
|
150
|
+
this._focused = false;
|
|
151
|
+
this._onTouchedChange();
|
|
152
|
+
this.onBlur.emit();
|
|
153
|
+
this.stateChanges.next();
|
|
154
|
+
}
|
|
155
|
+
}, 0);
|
|
156
|
+
this._pendingTimeouts.push(timeoutId);
|
|
157
|
+
}
|
|
158
|
+
ngAfterViewInit() {
|
|
159
|
+
if (!this.config().disableAutoFocus) {
|
|
160
|
+
const containerItem = this._document.getElementById(`c_${this.componentKey}`);
|
|
161
|
+
if (containerItem) {
|
|
162
|
+
const ele = containerItem.getElementsByClassName("cmat-otp-input")[0];
|
|
163
|
+
if (ele?.focus) ele.focus();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
ngOnDestroy() {
|
|
168
|
+
this._pendingTimeouts.forEach((id) => clearTimeout(id));
|
|
169
|
+
this._pendingTimeouts = [];
|
|
170
|
+
this._valueChangesSub?.unsubscribe();
|
|
171
|
+
this._valueChangesSub = null;
|
|
172
|
+
this.stateChanges.complete();
|
|
173
|
+
this.otpForm.reset();
|
|
174
|
+
}
|
|
175
|
+
setDescribedByIds(ids) {
|
|
176
|
+
this.userAriaDescribedBy = ids.length ? ids.join(" ") : void 0;
|
|
177
|
+
const containerItem = this._document.getElementById(`c_${this.componentKey}`);
|
|
178
|
+
if (containerItem) {
|
|
179
|
+
if (ids.length) containerItem.setAttribute("aria-describedby", ids.join(" "));
|
|
180
|
+
else containerItem.removeAttribute("aria-describedby");
|
|
181
|
+
}
|
|
182
|
+
this.stateChanges.next();
|
|
183
|
+
}
|
|
184
|
+
onContainerClick() {
|
|
185
|
+
if (!this._focused) {
|
|
186
|
+
const containerItem = this._document.getElementById(`c_${this.componentKey}`);
|
|
187
|
+
if (containerItem) containerItem.focus();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
onKeyDown($event, inputIdx) {
|
|
191
|
+
const inputTarget = $event.target;
|
|
192
|
+
const prevInputId = this.getBoxId(inputIdx - 1);
|
|
193
|
+
const currentInputId = this.getBoxId(inputIdx);
|
|
194
|
+
const nextInputId = this.getBoxId(inputIdx + 1);
|
|
195
|
+
if (KeyboardUtil.ifSpacebar($event)) {
|
|
196
|
+
$event.preventDefault();
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (KeyboardUtil.ifBackspace($event)) {
|
|
200
|
+
if (!inputTarget.value) {
|
|
201
|
+
this._clearInput(prevInputId, inputIdx - 1);
|
|
202
|
+
this._setSelected(prevInputId);
|
|
203
|
+
} else this._clearInput(currentInputId, inputIdx);
|
|
204
|
+
this._rebuildValue();
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (KeyboardUtil.ifDelete($event)) {
|
|
208
|
+
if (!inputTarget.value) {
|
|
209
|
+
this._clearInput(prevInputId, inputIdx - 1);
|
|
210
|
+
this._setSelected(prevInputId);
|
|
211
|
+
} else this._clearInput(currentInputId, inputIdx);
|
|
212
|
+
this._rebuildValue();
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (this.ifValidKeyCode($event)) {
|
|
216
|
+
inputTarget.value = $event.key;
|
|
217
|
+
const ctrlName = this._getControlName(inputIdx);
|
|
218
|
+
this.otpForm.controls[ctrlName]?.setValue($event.key);
|
|
219
|
+
$event.preventDefault();
|
|
220
|
+
this._setSelected(nextInputId);
|
|
221
|
+
this._rebuildValue();
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
onInput($event, inputIdx) {
|
|
225
|
+
const inputTarget = $event.target;
|
|
226
|
+
const currentVal = this._currentValSignal();
|
|
227
|
+
const newVal = currentVal ? `${currentVal}${inputTarget.value}` : inputTarget.value;
|
|
228
|
+
if (this.config().allowNumbersOnly && !this.validateNumber(newVal)) {
|
|
229
|
+
inputTarget.value = "";
|
|
230
|
+
$event.stopPropagation();
|
|
231
|
+
this._clearInput(null, inputIdx);
|
|
232
|
+
this._rebuildValue();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
onKeyUp($event, inputIdx) {
|
|
236
|
+
if (KeyboardUtil.ifTab($event)) inputIdx -= 1;
|
|
237
|
+
const nextInputId = this.getBoxId(inputIdx + 1);
|
|
238
|
+
const prevInputId = this.getBoxId(inputIdx - 1);
|
|
239
|
+
if (KeyboardUtil.ifRightArrow($event)) {
|
|
240
|
+
$event.preventDefault();
|
|
241
|
+
this._setSelected(nextInputId);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
if (KeyboardUtil.ifLeftArrow($event)) {
|
|
245
|
+
$event.preventDefault();
|
|
246
|
+
this._setSelected(prevInputId);
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
if (!$event.target?.value) return;
|
|
250
|
+
}
|
|
251
|
+
validateNumber(val) {
|
|
252
|
+
return !!val && /^[0-9]+$/.test(val);
|
|
253
|
+
}
|
|
254
|
+
getBoxId(idx) {
|
|
255
|
+
return `otp_${idx}_${this.componentKey}`;
|
|
256
|
+
}
|
|
257
|
+
focusTo(eleId) {
|
|
258
|
+
const ele = this._document.getElementById(eleId);
|
|
259
|
+
if (ele) ele.focus();
|
|
260
|
+
}
|
|
261
|
+
setValue(value) {
|
|
262
|
+
const cfg = this.config();
|
|
263
|
+
if (cfg.allowNumbersOnly && isNaN(value)) return;
|
|
264
|
+
this.otpForm.reset();
|
|
265
|
+
if (!value) {
|
|
266
|
+
this._rebuildValue();
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
value = value.toString().replace(/\s/g, "");
|
|
270
|
+
Array.from(value).forEach((c, idx) => {
|
|
271
|
+
if (this.otpForm.get(this._getControlName(idx))) this.otpForm.get(this._getControlName(idx)).setValue(c);
|
|
272
|
+
});
|
|
273
|
+
if (!cfg.disableAutoFocus) {
|
|
274
|
+
const outerTimeoutId = setTimeout(() => {
|
|
275
|
+
this._removePendingTimeout(outerTimeoutId);
|
|
276
|
+
const containerItem = this._document.getElementById(`c_${this.componentKey}`);
|
|
277
|
+
if (!containerItem) return;
|
|
278
|
+
const indexOfElementToFocus = value.length < cfg.length ? value.length : cfg.length - 1;
|
|
279
|
+
const ele = containerItem.getElementsByClassName("cmat-otp-input")[indexOfElementToFocus];
|
|
280
|
+
if (ele) {
|
|
281
|
+
const innerTimeoutId = setTimeout(() => {
|
|
282
|
+
this._removePendingTimeout(innerTimeoutId);
|
|
283
|
+
ele.focus();
|
|
284
|
+
}, 1);
|
|
285
|
+
this._pendingTimeouts.push(innerTimeoutId);
|
|
286
|
+
}
|
|
287
|
+
}, 0);
|
|
288
|
+
this._pendingTimeouts.push(outerTimeoutId);
|
|
289
|
+
}
|
|
290
|
+
this._rebuildValue();
|
|
291
|
+
}
|
|
292
|
+
handlePaste(e) {
|
|
293
|
+
const clipboardData = e.clipboardData ?? window.clipboardData;
|
|
294
|
+
let pastedData = "";
|
|
295
|
+
if (clipboardData) pastedData = clipboardData.getData("Text");
|
|
296
|
+
e.stopPropagation();
|
|
297
|
+
e.preventDefault();
|
|
298
|
+
if (!pastedData || this.config().allowNumbersOnly && !this.validateNumber(pastedData)) return;
|
|
299
|
+
this.setValue(pastedData);
|
|
300
|
+
}
|
|
301
|
+
getFormControl(key) {
|
|
302
|
+
return this.otpForm.controls[key];
|
|
303
|
+
}
|
|
304
|
+
_removePendingTimeout(timeoutId) {
|
|
305
|
+
const idx = this._pendingTimeouts.indexOf(timeoutId);
|
|
306
|
+
if (idx !== -1) this._pendingTimeouts.splice(idx, 1);
|
|
307
|
+
}
|
|
308
|
+
_getControlName(idx) {
|
|
309
|
+
return `ctrl_${idx}`;
|
|
310
|
+
}
|
|
311
|
+
_clearInput(eleId, inputIdx) {
|
|
312
|
+
const ctrlName = this._getControlName(inputIdx);
|
|
313
|
+
this.otpForm.controls[ctrlName]?.setValue(null);
|
|
314
|
+
if (eleId) {
|
|
315
|
+
const ele = this._document.getElementById(eleId);
|
|
316
|
+
if (ele && ele instanceof HTMLInputElement) ele.value = "";
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
_setSelected(eleId) {
|
|
320
|
+
this.focusTo(eleId);
|
|
321
|
+
const ele = this._document.getElementById(eleId);
|
|
322
|
+
if (ele instanceof HTMLInputElement) {
|
|
323
|
+
const timeoutId = setTimeout(() => {
|
|
324
|
+
this._removePendingTimeout(timeoutId);
|
|
325
|
+
ele.setSelectionRange(0, 1);
|
|
326
|
+
}, 0);
|
|
327
|
+
this._pendingTimeouts.push(timeoutId);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
ifValidKeyCode(event) {
|
|
331
|
+
const inp = event.key;
|
|
332
|
+
if (this.config()?.allowNumbersOnly) return this.validateNumber(inp);
|
|
333
|
+
return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent) || /^[a-zA-Z0-9%*_\-@#$!]$/.test(inp) && inp.length === 1;
|
|
334
|
+
}
|
|
335
|
+
_rebuildValue() {
|
|
336
|
+
let val = null;
|
|
337
|
+
const cfg = this.config();
|
|
338
|
+
Object.keys(this.otpForm.controls).forEach((k) => {
|
|
339
|
+
let ctrlVal = this.otpForm.controls[k].value;
|
|
340
|
+
if (typeof ctrlVal === "string" && ctrlVal) {
|
|
341
|
+
const isLengthExceed = ctrlVal.length > 1;
|
|
342
|
+
ctrlVal = ctrlVal[0];
|
|
343
|
+
const letterCase = cfg.letterCase?.toLocaleLowerCase();
|
|
344
|
+
if (!cfg.allowNumbersOnly && (letterCase === "upper" || letterCase === "lower")) {
|
|
345
|
+
ctrlVal = letterCase === "upper" ? ctrlVal.toUpperCase() : ctrlVal.toLowerCase();
|
|
346
|
+
this.otpForm.controls[k].setValue(ctrlVal);
|
|
347
|
+
} else if (isLengthExceed) this.otpForm.controls[k].setValue(ctrlVal);
|
|
348
|
+
val = val === null ? ctrlVal : val + ctrlVal;
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
if (this._currentValSignal() != val) {
|
|
352
|
+
this._currentValSignal.set(val);
|
|
353
|
+
this._onModelChange(val);
|
|
354
|
+
this.onInputChange.emit(val);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
_rebuildForm() {
|
|
358
|
+
this._valueChangesSub?.unsubscribe();
|
|
359
|
+
this._valueChangesSub = null;
|
|
360
|
+
this.otpForm = this._formBuilder.group({});
|
|
361
|
+
for (let index = 0; index < this.config().length; index++) this.otpForm.addControl(this._getControlName(index), new FormControl());
|
|
362
|
+
this._valueChangesSub = this.otpForm.valueChanges.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
|
|
363
|
+
Object.keys(this.otpForm.controls).forEach((k) => {
|
|
364
|
+
const val = this.otpForm.controls[k].value;
|
|
365
|
+
if (typeof val === "string" && val.length > 1) {
|
|
366
|
+
if (val.length >= this.config().length) this.setValue(val);
|
|
367
|
+
else this._rebuildValue();
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
static {
|
|
373
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
374
|
+
minVersion: "12.0.0",
|
|
375
|
+
version: "22.3.0",
|
|
376
|
+
ngImport: i0,
|
|
377
|
+
type: CmatOtpInputComponent,
|
|
378
|
+
deps: [],
|
|
379
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
static {
|
|
383
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
384
|
+
minVersion: "17.0.0",
|
|
385
|
+
version: "22.3.0",
|
|
386
|
+
type: CmatOtpInputComponent,
|
|
387
|
+
isStandalone: true,
|
|
388
|
+
selector: "cmat-otp-input",
|
|
389
|
+
inputs: {
|
|
390
|
+
config: {
|
|
391
|
+
classPropertyName: "config",
|
|
392
|
+
publicName: "config",
|
|
393
|
+
isSignal: true,
|
|
394
|
+
isRequired: false,
|
|
395
|
+
transformFunction: null
|
|
396
|
+
},
|
|
397
|
+
placeholder: {
|
|
398
|
+
classPropertyName: "placeholder",
|
|
399
|
+
publicName: "placeholder",
|
|
400
|
+
isSignal: false,
|
|
401
|
+
isRequired: false,
|
|
402
|
+
transformFunction: null
|
|
403
|
+
},
|
|
404
|
+
required: {
|
|
405
|
+
classPropertyName: "required",
|
|
406
|
+
publicName: "required",
|
|
407
|
+
isSignal: false,
|
|
408
|
+
isRequired: false,
|
|
409
|
+
transformFunction: null
|
|
410
|
+
},
|
|
411
|
+
disabled: {
|
|
412
|
+
classPropertyName: "disabled",
|
|
413
|
+
publicName: "disabled",
|
|
414
|
+
isSignal: false,
|
|
415
|
+
isRequired: false,
|
|
416
|
+
transformFunction: null
|
|
417
|
+
},
|
|
418
|
+
value: {
|
|
419
|
+
classPropertyName: "value",
|
|
420
|
+
publicName: "value",
|
|
421
|
+
isSignal: false,
|
|
422
|
+
isRequired: false,
|
|
423
|
+
transformFunction: null
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
outputs: {
|
|
427
|
+
onBlur: "onBlur",
|
|
428
|
+
onInputChange: "onInputChange"
|
|
429
|
+
},
|
|
430
|
+
host: { properties: { "attr.id": "id" } },
|
|
431
|
+
providers: [{
|
|
432
|
+
provide: MatFormFieldControl,
|
|
433
|
+
useExisting: CmatOtpInputComponent
|
|
434
|
+
}],
|
|
435
|
+
exportAs: ["cmatOtpInput"],
|
|
436
|
+
ngImport: i0,
|
|
437
|
+
template: "@if(otpForm.controls){\r\n<div class=\"cmat-otp-input-wrapper wrapper {{config().containerClass}}\" id=\"c_{{componentKey}}\"\r\n [attr.tabindex]=\"disabled ? -1 : 0\" [ngStyle]=\"config().containerStyles\" (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut()\">\r\n <div class=\"n-o-c\">\r\n @for (item of controlKeys(); track item) {\r\n <input #inp class=\"cmat-otp-input {{config().inputClass}}\" autocomplete=\"one-time-code\" [pattern]=\"config().allowNumbersOnly ? '\\\\d*' : ''\"\r\n [type]=\"inputType()\" [placeholder]=\"config().placeholder || ''\"\r\n [ngStyle]=\"config().inputStyles\" [id]=\"getBoxId($index)\"\r\n [ngClass]=\"{'error-input': (config().showError && errorState)}\"\r\n [formControl]=\"getFormControl(item)\" (paste)=\"handlePaste($event)\" (keyup)=\"onKeyUp($event,$index)\"\r\n (input)=\"onInput($event,$index)\" (keydown)=\"onKeyDown($event,$index)\">\r\n @if(config().separator && !$last){\r\n {{config().separator}}\r\n }\r\n }\r\n </div>\r\n</div>\r\n}",
|
|
438
|
+
styles: [".cmat-otp-input{width:50px;height:50px;border-radius:4px;border:1px solid;border-color:rgba(var(--cmat-text-hint-rgb),.5);text-align:center;font-size:32px}.cmat-otp-input:focus{background-color:var(--cmat-divider);border:solid 2px var(--cmat-primary)}.cmat-otp-input-wrapper .cmat-otp-input{margin:0 .51rem}.cmat-otp-input-wrapper .cmat-otp-input:first-child{margin-left:0}.cmat-otp-input-wrapper .cmat-otp-input:last-child{margin-right:0}.n-o-c{display:flex;align-items:center}.error-input{border-color:var(--cmat-warn)}@media screen and (max-width:767px){.cmat-otp-input{width:40px;font-size:24px;height:40px}}@media screen and (max-width:420px){.cmat-otp-input{width:30px;font-size:18px;height:30px}}\n"],
|
|
439
|
+
dependencies: [
|
|
440
|
+
{
|
|
441
|
+
kind: "ngmodule",
|
|
442
|
+
type: CommonModule
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
kind: "directive",
|
|
446
|
+
type: i1.NgClass,
|
|
447
|
+
selector: "[ngClass]",
|
|
448
|
+
inputs: ["class", "ngClass"]
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
kind: "directive",
|
|
452
|
+
type: i1.NgStyle,
|
|
453
|
+
selector: "[ngStyle]",
|
|
454
|
+
inputs: ["ngStyle"]
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
kind: "ngmodule",
|
|
458
|
+
type: ReactiveFormsModule
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
kind: "directive",
|
|
462
|
+
type: i2.DefaultValueAccessor,
|
|
463
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
kind: "directive",
|
|
467
|
+
type: i2.NgControlStatus,
|
|
468
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
kind: "directive",
|
|
472
|
+
type: i2.PatternValidator,
|
|
473
|
+
selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",
|
|
474
|
+
inputs: ["pattern"]
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
kind: "directive",
|
|
478
|
+
type: i2.FormControlDirective,
|
|
479
|
+
selector: "[formControl]",
|
|
480
|
+
inputs: [
|
|
481
|
+
"formControl",
|
|
482
|
+
"disabled",
|
|
483
|
+
"ngModel"
|
|
484
|
+
],
|
|
485
|
+
outputs: ["ngModelChange"],
|
|
486
|
+
exportAs: ["ngForm"]
|
|
487
|
+
}
|
|
488
|
+
],
|
|
489
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
490
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
495
|
+
minVersion: "12.0.0",
|
|
496
|
+
version: "22.3.0",
|
|
497
|
+
ngImport: i0,
|
|
498
|
+
type: CmatOtpInputComponent,
|
|
499
|
+
decorators: [{
|
|
500
|
+
type: Component,
|
|
501
|
+
args: [{
|
|
502
|
+
selector: "cmat-otp-input",
|
|
503
|
+
exportAs: "cmatOtpInput",
|
|
504
|
+
imports: [CommonModule, ReactiveFormsModule],
|
|
505
|
+
providers: [{
|
|
506
|
+
provide: MatFormFieldControl,
|
|
507
|
+
useExisting: CmatOtpInputComponent
|
|
508
|
+
}],
|
|
509
|
+
encapsulation: ViewEncapsulation.None,
|
|
510
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
511
|
+
host: { "[attr.id]": "id" },
|
|
512
|
+
template: "@if(otpForm.controls){\r\n<div class=\"cmat-otp-input-wrapper wrapper {{config().containerClass}}\" id=\"c_{{componentKey}}\"\r\n [attr.tabindex]=\"disabled ? -1 : 0\" [ngStyle]=\"config().containerStyles\" (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut()\">\r\n <div class=\"n-o-c\">\r\n @for (item of controlKeys(); track item) {\r\n <input #inp class=\"cmat-otp-input {{config().inputClass}}\" autocomplete=\"one-time-code\" [pattern]=\"config().allowNumbersOnly ? '\\\\d*' : ''\"\r\n [type]=\"inputType()\" [placeholder]=\"config().placeholder || ''\"\r\n [ngStyle]=\"config().inputStyles\" [id]=\"getBoxId($index)\"\r\n [ngClass]=\"{'error-input': (config().showError && errorState)}\"\r\n [formControl]=\"getFormControl(item)\" (paste)=\"handlePaste($event)\" (keyup)=\"onKeyUp($event,$index)\"\r\n (input)=\"onInput($event,$index)\" (keydown)=\"onKeyDown($event,$index)\">\r\n @if(config().separator && !$last){\r\n {{config().separator}}\r\n }\r\n }\r\n </div>\r\n</div>\r\n}",
|
|
513
|
+
styles: [".cmat-otp-input{width:50px;height:50px;border-radius:4px;border:1px solid;border-color:rgba(var(--cmat-text-hint-rgb),.5);text-align:center;font-size:32px}.cmat-otp-input:focus{background-color:var(--cmat-divider);border:solid 2px var(--cmat-primary)}.cmat-otp-input-wrapper .cmat-otp-input{margin:0 .51rem}.cmat-otp-input-wrapper .cmat-otp-input:first-child{margin-left:0}.cmat-otp-input-wrapper .cmat-otp-input:last-child{margin-right:0}.n-o-c{display:flex;align-items:center}.error-input{border-color:var(--cmat-warn)}@media screen and (max-width:767px){.cmat-otp-input{width:40px;font-size:24px;height:40px}}@media screen and (max-width:420px){.cmat-otp-input{width:30px;font-size:18px;height:30px}}\n"]
|
|
514
|
+
}]
|
|
515
|
+
}],
|
|
516
|
+
ctorParameters: () => [],
|
|
517
|
+
propDecorators: {
|
|
518
|
+
config: [{
|
|
519
|
+
type: i0.Input,
|
|
520
|
+
args: [{
|
|
521
|
+
isSignal: true,
|
|
522
|
+
alias: "config",
|
|
523
|
+
required: false
|
|
524
|
+
}]
|
|
525
|
+
}],
|
|
526
|
+
onBlur: [{
|
|
527
|
+
type: i0.Output,
|
|
528
|
+
args: ["onBlur"]
|
|
529
|
+
}],
|
|
530
|
+
onInputChange: [{
|
|
531
|
+
type: i0.Output,
|
|
532
|
+
args: ["onInputChange"]
|
|
533
|
+
}],
|
|
534
|
+
placeholder: [{ type: Input }],
|
|
535
|
+
required: [{ type: Input }],
|
|
536
|
+
disabled: [{ type: Input }],
|
|
537
|
+
value: [{ type: Input }]
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
export { CmatOtpInputComponent as t };
|
|
541
|
+
|
|
542
|
+
//# sourceMappingURL=public-api-BcmOSkgf.mjs.map
|