@mintplayer/ng-bootstrap 22.28.0 → 22.29.0
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/_bootstrap.scss +4 -101
- package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs +62 -30
- package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs +71 -64
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs +50 -46
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-card.mjs +65 -94
- package/fesm2022/mintplayer-ng-bootstrap-card.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs +122 -97
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-hierarchy.mjs +80 -133
- package/fesm2022/mintplayer-ng-bootstrap-charts-hierarchy.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-sparkline.mjs +31 -19
- package/fesm2022/mintplayer-ng-bootstrap-charts-sparkline.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-trend.mjs +41 -46
- package/fesm2022/mintplayer-ng-bootstrap-charts-trend.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-checkbox.mjs +76 -37
- package/fesm2022/mintplayer-ng-bootstrap-checkbox.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +37 -82
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs +150 -824
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs +172 -118
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datetime-picker.mjs +180 -142
- package/fesm2022/mintplayer-ng-bootstrap-datetime-picker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dock.mjs +66 -116
- package/fesm2022/mintplayer-ng-bootstrap-dock.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +41 -46
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-file-manager.mjs +80 -204
- package/fesm2022/mintplayer-ng-bootstrap-file-manager.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs +2 -2
- package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-form.mjs +2 -2
- package/fesm2022/mintplayer-ng-bootstrap-form.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs +32 -17
- package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-machine.mjs +220 -20
- package/fesm2022/mintplayer-ng-bootstrap-machine.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-multi-range.mjs +98 -129
- package/fesm2022/mintplayer-ng-bootstrap-multi-range.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs +144 -265
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-otp-input.mjs +133 -217
- package/fesm2022/mintplayer-ng-bootstrap-otp-input.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs +46 -25
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-phone-input.mjs +166 -93
- package/fesm2022/mintplayer-ng-bootstrap-phone-input.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-query-builder.mjs +148 -231
- package/fesm2022/mintplayer-ng-bootstrap-query-builder.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-radio.mjs +133 -94
- package/fesm2022/mintplayer-ng-bootstrap-radio.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs +2 -2
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-rating.mjs +76 -7
- package/fesm2022/mintplayer-ng-bootstrap-rating.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-ribbon.mjs +766 -812
- package/fesm2022/mintplayer-ng-bootstrap-ribbon.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs +206 -180
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs +202 -141
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs +113 -59
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs +133 -76
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs +60 -87
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs +86 -83
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-table.mjs +1 -2
- package/fesm2022/mintplayer-ng-bootstrap-table.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-theming.mjs +38 -34
- package/fesm2022/mintplayer-ng-bootstrap-theming.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-timeline.mjs +177 -147
- package/fesm2022/mintplayer-ng-bootstrap-timeline.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs +200 -94
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tree-select.mjs +186 -233
- package/fesm2022/mintplayer-ng-bootstrap-tree-select.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs +58 -136
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs +22 -16
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs.map +1 -1
- package/package.json +11 -9
- package/types/mintplayer-ng-bootstrap-a11y.d.ts +40 -21
- package/types/mintplayer-ng-bootstrap-accordion.d.ts +36 -33
- package/types/mintplayer-ng-bootstrap-calendar.d.ts +39 -16
- package/types/mintplayer-ng-bootstrap-card.d.ts +25 -33
- package/types/mintplayer-ng-bootstrap-carousel.d.ts +70 -55
- package/types/mintplayer-ng-bootstrap-charts-hierarchy.d.ts +65 -45
- package/types/mintplayer-ng-bootstrap-charts-sparkline.d.ts +12 -3
- package/types/mintplayer-ng-bootstrap-charts-trend.d.ts +34 -19
- package/types/mintplayer-ng-bootstrap-checkbox.d.ts +34 -8
- package/types/mintplayer-ng-bootstrap-code-snippet.d.ts +32 -59
- package/types/mintplayer-ng-bootstrap-datatable.d.ts +217 -422
- package/types/mintplayer-ng-bootstrap-datepicker.d.ts +77 -29
- package/types/mintplayer-ng-bootstrap-datetime-picker.d.ts +83 -51
- package/types/mintplayer-ng-bootstrap-dock.d.ts +57 -38
- package/types/mintplayer-ng-bootstrap-dropdown-menu.d.ts +25 -30
- package/types/mintplayer-ng-bootstrap-file-manager.d.ts +61 -81
- package/types/mintplayer-ng-bootstrap-input-group.d.ts +17 -12
- package/types/mintplayer-ng-bootstrap-machine.d.ts +112 -4
- package/types/mintplayer-ng-bootstrap-multi-range.d.ts +53 -27
- package/types/mintplayer-ng-bootstrap-navbar.d.ts +88 -164
- package/types/mintplayer-ng-bootstrap-otp-input.d.ts +63 -30
- package/types/mintplayer-ng-bootstrap-pagination.d.ts +23 -7
- package/types/mintplayer-ng-bootstrap-phone-input.d.ts +77 -47
- package/types/mintplayer-ng-bootstrap-query-builder.d.ts +95 -98
- package/types/mintplayer-ng-bootstrap-radio.d.ts +68 -35
- package/types/mintplayer-ng-bootstrap-rating.d.ts +27 -2
- package/types/mintplayer-ng-bootstrap-ribbon.d.ts +546 -220
- package/types/mintplayer-ng-bootstrap-scheduler.d.ts +82 -197
- package/types/mintplayer-ng-bootstrap-select.d.ts +113 -53
- package/types/mintplayer-ng-bootstrap-shell.d.ts +59 -33
- package/types/mintplayer-ng-bootstrap-signature-pad.d.ts +63 -27
- package/types/mintplayer-ng-bootstrap-splitter.d.ts +45 -56
- package/types/mintplayer-ng-bootstrap-tab-control.d.ts +47 -26
- package/types/mintplayer-ng-bootstrap-table.d.ts +1 -2
- package/types/mintplayer-ng-bootstrap-theming.d.ts +19 -18
- package/types/mintplayer-ng-bootstrap-timeline.d.ts +287 -117
- package/types/mintplayer-ng-bootstrap-timepicker.d.ts +100 -27
- package/types/mintplayer-ng-bootstrap-tree-select.d.ts +188 -94
- package/types/mintplayer-ng-bootstrap-treeview.d.ts +74 -59
- package/types/mintplayer-ng-bootstrap-typeahead.d.ts +3 -0
- package/src/styles/utilities/cursor.scss +0 -12
- package/src/styles/utilities/overflow.scss +0 -12
- package/src/styles/utilities/white-space.scss +0 -12
- package/src/styles/utilities/width.scss +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-otp-input.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/otp-input/src/lib/value-accessor/otp-input-value-accessor.ts","../../../../libs/mintplayer-ng-bootstrap/otp-input/src/lib/components/otp-input.component.ts","../../../../libs/mintplayer-ng-bootstrap/otp-input/mintplayer-ng-bootstrap-otp-input.ts"],"sourcesContent":["import { DestroyRef, Directive, Injector, OnInit, forwardRef, inject } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';\nimport { BsOtpInputComponent } from '../components/otp-input.component';\n\n@Directive({\n selector: 'bs-otp-input',\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => BsOtpInputValueAccessor),\n multi: true,\n }],\n host: {\n '(value-change)': 'onValueChangeEvent($event)',\n '(focusout)': 'onTouchEvent()',\n },\n})\nexport class BsOtpInputValueAccessor implements ControlValueAccessor, OnInit {\n private host = inject(BsOtpInputComponent);\n // Inject NgControl LAZILY via the injector. Eager `inject(NgControl)` here\n // creates a cycle: NgControl → NG_VALUE_ACCESSOR token → this directive →\n // NgControl. Looking it up in ngOnInit (after the form directive has\n // finished its own construction) breaks the cycle.\n private injector = inject(Injector);\n private destroyRef = inject(DestroyRef);\n private ngControl: NgControl | null = null;\n\n private onValueChange?: (value: string) => void;\n private onTouched?: () => void;\n\n ngOnInit(): void {\n this.ngControl = this.injector.get(NgControl, null);\n // Push invalid state to the WC whenever the form control's status or\n // touched state changes. Mirrors Bootstrap's .is-invalid convention: only\n // mark the boxes red after the control has been touched, otherwise we'd\n // light up a \"required\" field the moment the form mounts.\n if (!this.ngControl?.control) return;\n const sub = this.ngControl.statusChanges?.subscribe(() => this.syncInvalid());\n if (sub) this.destroyRef.onDestroy(() => sub.unsubscribe());\n // Sync once now in case the control was created already invalid+touched\n // (e.g. server-side validation rehydrate).\n queueMicrotask(() => this.syncInvalid());\n }\n\n protected onValueChangeEvent(ev: Event): void {\n if (!this.onValueChange) return;\n const detail = (ev as CustomEvent<string>).detail ?? '';\n this.onValueChange(detail);\n }\n\n protected onTouchEvent(): void {\n if (this.onTouched) this.onTouched();\n // Re-sync invalid on touch — statusChanges doesn't always fire on touched\n // alone, so we trigger the recompute here.\n this.syncInvalid();\n }\n\n private syncInvalid(): void {\n // Guard async-scheduled invocations: queueMicrotask in ngOnInit + the\n // statusChanges subscription are both possible after destroy. Reading\n // `host.elementRef()` (a required viewChild) on a destroyed view throws.\n if (this.destroyRef.destroyed) return;\n const ref = this.host.elementRef();\n if (!ref || !this.ngControl) return;\n const invalid = (this.ngControl.invalid ?? false) && (this.ngControl.touched ?? false);\n ref.nativeElement.invalid = invalid;\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onValueChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n writeValue(value: string | null | undefined): void {\n const ref = this.host.elementRef();\n if (!ref) return;\n ref.nativeElement.value = value ?? '';\n }\n\n setDisabledState(isDisabled: boolean): void {\n const ref = this.host.elementRef();\n if (!ref) return;\n if (isDisabled) {\n ref.nativeElement.setAttribute('disabled', '');\n } else {\n ref.nativeElement.removeAttribute('disabled');\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n ElementRef,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n viewChild,\n} from '@angular/core';\nimport {\n MintOtpInputElement,\n OtpInputType,\n OtpInputCase,\n OtpInputSize,\n} from '@mintplayer/web-components/otp-input';\nimport { BsOtpInputValueAccessor } from '../value-accessor/otp-input-value-accessor';\n\n@Component({\n selector: 'bs-otp-input',\n template: `\n <mp-otp-input\n #el\n class=\"bs-otp-input\"\n [attr.type]=\"type()\"\n [attr.case]=\"case()\"\n [attr.size]=\"size()\"\n [attr.invalid]=\"invalidAttr()\"\n [attr.input-label]=\"inputLabel()\"\n (value-change)=\"onValueChange($event)\"\n (complete)=\"onCompleteEvent($event)\"\n ></mp-otp-input>\n `,\n styles: [`\n :host { display: inline-block; }\n .bs-otp-input { display: inline-flex; }\n `],\n host: {\n '[attr.size]': 'size()',\n },\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [BsOtpInputValueAccessor],\n})\nexport class BsOtpInputComponent {\n readonly groups = input<number[]>([1, 1, 1, 1, 1, 1]);\n readonly type = input<OtpInputType>('numeric');\n readonly case = input<OtpInputCase>('upper');\n readonly size = input<OtpInputSize>('md');\n readonly disabled = input(false);\n readonly invalid = input(false);\n readonly inputLabel = input<string | null>(null);\n\n // `model()` already exposes a `valueChange` output for two-way [(value)]\n // binding; declaring it explicitly is an error in Angular 22 (NG1054).\n // `value.set()` in onValueChange drives that auto-output.\n readonly value = model<string | undefined>(undefined);\n\n readonly complete = output<string>();\n\n // Deliberately NOT viewChild.required: the host's focus() override below can run before\n // this view exists (a directive on the host focusing it from its constructor), and a\n // required query throws NG0951 there instead of reaching the deferred-focus fallback.\n readonly elementRef = viewChild<ElementRef<MintOtpInputElement>>('el');\n\n private readonly hostRef = inject(ElementRef<HTMLElement>);\n\n protected readonly invalidAttr = computed(() => (this.invalid() ? '' : null));\n\n constructor() {\n // Override the host DOM element's `.focus` so external directives that look\n // up the element and call `.focus()` on it (e.g. FocusOnLoadDirective's\n // `*[autofocus]`) route into the internal hidden input. Without this, the\n // call hits HTMLElement.prototype.focus which is a no-op on a non-focusable\n // host. Capture the WC ref lazily because viewChild isn't available in the\n // constructor and external directives may call .focus() before our\n // ngAfterViewInit runs.\n const host = this.hostRef.nativeElement as HTMLElement & { focus: (o?: FocusOptions) => void };\n Object.defineProperty(host, 'focus', {\n value: (options?: FocusOptions) => {\n const wc = this.elementRef()?.nativeElement;\n if (wc) {\n wc.focus(options);\n } else {\n // Defer to a microtask so a focus() call landing before the view is\n // ready still hits the WC once it mounts. FocusOnLoadDirective uses\n // setTimeout(10) which runs after microtasks, so this path is mostly\n // defensive — but it cheaply handles the race.\n Promise.resolve().then(() => this.elementRef()?.nativeElement.focus(options));\n }\n },\n configurable: true,\n writable: true,\n });\n\n // Forward signal inputs that aren't attributes (groups is a number[] —\n // attribute serialisation works for it, but property write is the canonical\n // path and avoids the \"string-from-attribute\" parse round-trip).\n effect(() => {\n const ref = this.elementRef();\n if (!ref) return;\n ref.nativeElement.groups = this.groups();\n });\n\n // Forward `value` model writes to the WC. Skip undefined so a freshly-set\n // form control's writeValue(null) can still clear the field (we map null\n // to '' inside the WC's normaliseValue).\n effect(() => {\n const ref = this.elementRef();\n if (!ref) return;\n const v = this.value();\n if (v === undefined) return;\n ref.nativeElement.value = v;\n });\n\n // Forward the `invalid` boolean to the WC's invalid property (mirrors the\n // attribute, but property write is the canonical path for a boolean).\n effect(() => {\n const ref = this.elementRef();\n if (!ref) return;\n ref.nativeElement.invalid = this.invalid();\n });\n\n // Forward `disabled` via attribute. This used to be `[attr.disabled]` in the\n // template, but that creates a race with the CVA's `setDisabledState`:\n // both write to the same DOM attribute, and any signal change in the\n // wrapper re-fires the template binding which clobbers the CVA's\n // form-disabled state. Using an effect makes the write fire only when the\n // `disabled` signal actually changes; the CVA's imperative writes are\n // unaffected because Angular doesn't reconcile attribute bindings in the\n // template anymore for this attr.\n effect(() => {\n const ref = this.elementRef();\n if (!ref) return;\n if (this.disabled()) {\n ref.nativeElement.setAttribute('disabled', '');\n } else {\n ref.nativeElement.removeAttribute('disabled');\n }\n });\n }\n\n protected onValueChange(event: Event): void {\n const detail = (event as CustomEvent<string>).detail ?? '';\n this.value.set(detail);\n }\n\n protected onCompleteEvent(event: Event): void {\n // The WC's `complete` DOM event bubbles. The wrapper's Output is also\n // named `complete`. Without stopPropagation, the parent's `(complete)`\n // binding would catch BOTH the bubbled DOM event AND the Output emit\n // below — Angular's `(name)` binding on a child component listens to\n // both channels when their names collide.\n event.stopPropagation();\n const detail = (event as CustomEvent<string>).detail ?? '';\n this.complete.emit(detail);\n }\n\n /** Move focus into the hidden input. */\n focus(options?: FocusOptions): void {\n this.elementRef()?.nativeElement.focus(options);\n }\n\n /** Reset the value to empty string. */\n clear(): void {\n this.elementRef()?.nativeElement.clear();\n }\n}\n","/**\n * Generated bundle index. Do not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AAA,EAAA,CAAA;;AClEvE;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-otp-input.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/otp-input/src/value-accessor/otp-input-value-accessor.ts","../../../../libs/mintplayer-ng-bootstrap/otp-input/src/otp-input.angular.ts","../../../../libs/mintplayer-ng-bootstrap/otp-input/src/generated/otp-input.component.generated.ts","../../../../libs/mintplayer-ng-bootstrap/otp-input/src/generated/otp-input.view.generated.html","../../../../libs/mintplayer-ng-bootstrap/otp-input/src/generated/index.ts","../../../../libs/mintplayer-ng-bootstrap/otp-input/mintplayer-ng-bootstrap-otp-input.ts"],"sourcesContent":["import { DestroyRef, Directive, ElementRef, Injector, OnInit, forwardRef, inject, signal } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BsOtpInputComponent } from '../generated';\n\n/**\n * The `ControlValueAccessor` of `bs-otp-input` (a host directive of the\n * generated component, see `otp-input.angular.ts`). A bound form control drives\n * the code through `viewValue`; every change the user makes (typing, paste,\n * `clear()`, a layout change that drops characters) reaches the form through\n * the component's `value` model, which a form write never touches.\n */\n@Directive({\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsOtpInputValueAccessor), multi: true }],\n host: {\n '(focusout)': 'onTouched()',\n },\n})\nexport class BsOtpInputValueAccessor implements ControlValueAccessor, OnInit {\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n\n /** A form control drives the code: its `viewValue` wins over the `value` input. */\n readonly bound = signal(false);\n readonly viewValue = signal('');\n readonly disabled = signal(false);\n\n private onChange: (value: string) => void = () => undefined;\n onTouched: () => void = () => undefined;\n\n ngOnInit(): void {\n // The component is created after its host directives, so it is looked up here.\n const sub = this.injector.get(BsOtpInputComponent).value.subscribe((value) => {\n if (!this.bound() || value === this.viewValue()) return;\n this.viewValue.set(value);\n this.onChange(value);\n });\n this.destroyRef.onDestroy(() => sub.unsubscribe());\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.bound.set(true);\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n writeValue(value: string | null | undefined): void {\n this.viewValue.set(value ?? '');\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n }\n}\n\n/**\n * `focus()` on the `bs-otp-input` host moves into its input, so a directive that\n * focuses the element it sits on (`autofocus` through FocusOnLoadDirective)\n * reaches the field.\n */\n@Directive({})\nexport class BsOtpInputFocusDirective {\n constructor() {\n const host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n Object.defineProperty(host, 'focus', {\n // Before the first render there is no input yet; try again once it exists.\n value: (options?: FocusOptions) => {\n const input = host.querySelector('input');\n if (input) input.focus(options);\n else queueMicrotask(() => host.querySelector('input')?.focus(options));\n },\n configurable: true,\n writable: true,\n });\n }\n}\n","import { computed, inject } from '@angular/core';\nimport { BsControlValidityDirective } from '@mintplayer/ng-bootstrap/a11y';\nimport type { OtpInputInputs } from '@mintplayer/ui-core/otp-input';\nimport { BsOtpInputFocusDirective, BsOtpInputValueAccessor } from './value-accessor/otp-input-value-accessor';\n\n/*\n * The Angular extension of the generated `bs-otp-input` (PRD #437 D10 escape\n * hatch): Angular forms, and host focus. A bound form control drives the value\n * and the disabled state, and its validity reaches the input's ARIA and message.\n */\n\nexport const hostDirectives = [\n BsOtpInputValueAccessor,\n BsOtpInputFocusDirective,\n { directive: BsControlValidityDirective, inputs: ['errorMessages'] },\n];\n\nexport function extendInputs(inputs: () => OtpInputInputs): () => OtpInputInputs {\n const accessor = inject(BsOtpInputValueAccessor, { self: true });\n const validity = inject(BsControlValidityDirective, { self: true });\n return computed<OtpInputInputs>(() => {\n const value = inputs();\n return {\n ...value,\n value: accessor.bound() ? accessor.viewValue() : value.value,\n disabled: value.disabled || accessor.disabled(),\n invalid: value.invalid || validity.invalid(),\n required: value.required || validity.required(),\n errorText: value.errorText ?? validity.errorText(),\n };\n });\n}\n","// GENERATED from the otp-input manifest (otp-input) by @mintplayer/nx-component-compiler. Do not edit.\nimport { ChangeDetectionStrategy, Component, ElementRef, booleanAttribute, inject, input, model, output } from '@angular/core';\nimport { MpPropsDirective, useCore, useScopedStyles } from '@mintplayer/ng-bootstrap/machine';\nimport { otpInputCore, type OtpInputInputs, type OtpInputMethods, otpInputScopedStyles } from '@mintplayer/ui-core/otp-input';\nimport { hostDirectives as ext_hostDirectives, extendInputs as ext_extendInputs } from '../otp-input.angular';\n\n/**\n * A segmented one-time-code input (#437): one real `<input>` behind decorative boxes.\n *\n * With JavaScript off it is a plain `.form-control` that takes the code and submits under `name`.\n * `groups` sets the boxes (`[1,1,1,1,1,1]`, or `[5,5,5,5,5]` for a product key). `value` is two-way;\n * `complete` fires when the user fills the last box. An `aria-label` on the component names the input.\n */\n@Component({\n selector: 'bs-otp-input',\n templateUrl: './otp-input.view.generated.html',\n imports: [MpPropsDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: ext_hostDirectives,\n})\nexport class BsOtpInputComponent {\n /** The host element. */\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n readonly groups = input<OtpInputInputs['groups']>([1, 1, 1, 1, 1, 1]);\n readonly type = input<OtpInputInputs['type']>('numeric');\n readonly letterCase = input<OtpInputInputs['letterCase']>('upper');\n readonly size = input<OtpInputInputs['size']>('md');\n readonly disabled = input<OtpInputInputs['disabled'], unknown>(false, { transform: booleanAttribute });\n readonly required = input<OtpInputInputs['required'], unknown>(false, { transform: booleanAttribute });\n readonly invalid = input<OtpInputInputs['invalid'], unknown>(false, { transform: booleanAttribute });\n readonly errorText = input<OtpInputInputs['errorText']>();\n readonly name = input<OtpInputInputs['name']>();\n readonly inputLabel = input<OtpInputInputs['inputLabel']>();\n readonly value = model<OtpInputInputs['value']>('');\n /** Every keystroke, paste and clear: the current, possibly partial, code. */\n readonly valuechange = output<string>();\n /** The user filled the last box. */\n readonly complete = output<string>();\n\n readonly #core = useCore(otpInputCore, { inputs: ext_extendInputs(() => ({ groups: this.groups(), type: this.type(), letterCase: this.letterCase(), size: this.size(), disabled: this.disabled(), required: this.required(), invalid: this.invalid(), errorText: this.errorText(), name: this.name(), inputLabel: this.inputLabel(), value: this.value() })), idPrefix: 'bs-otp-input', outputs: { valueChange: this.valuechange, complete: this.complete }, hostBag: (props) => ({ ...props.view.root, 'data-mps': 'otp-input' }), models: { value: this.value } });\n /** The template's props. */\n protected readonly props = this.#core.props;\n\n constructor() {\n useScopedStyles('otp-input', otpInputScopedStyles);\n }\n\n /** Empties the code, and reports it. */\n clear(...args: Parameters<OtpInputMethods['clear']>): ReturnType<OtpInputMethods['clear']> {\n return this.#core.call('clear', args) as ReturnType<OtpInputMethods['clear']>;\n }\n\n /** Moves focus into the input. */\n focusInput(...args: Parameters<OtpInputMethods['focusInput']>): ReturnType<OtpInputMethods['focusInput']> {\n return this.#core.call('focusInput', args) as ReturnType<OtpInputMethods['focusInput']>;\n }\n}\n","<!-- GENERATED from libs/mintplayer-ui-core/otp-input/src/templates/otp-input.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n@let p_view = props().view;\n<div data-mps=\"otp-input\" [mpProps]=\"p_view.container\">\n <input data-mps=\"otp-input\" [mpProps]=\"p_view.input\">\n @for (box of p_view.boxes; track box.key) {\n <span data-mps=\"otp-input\" [mpProps]=\"box.bag\">\n <span data-mps=\"otp-input\" [mpProps]=\"p_view.spacer\">\n {{ box.spacer }}\n </span>\n <span data-mps=\"otp-input\" [mpProps]=\"p_view.content\">\n {{ box.content }}\n </span>\n </span>\n }\n</div>\n@if (p_view.showFeedback) {\n <div data-mps=\"otp-input\" [mpProps]=\"p_view.feedback.attrs\">\n {{ p_view.feedback.text }}\n </div>\n}\n","// GENERATED from the otp-input manifest by @mintplayer/nx-component-compiler. Do not edit.\nexport { BsOtpInputComponent } from './otp-input.component.generated';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names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,SAAS;+BACE,cAAc,EAAA,OAAA,EAEf,CAAC,gBAAgB,CAAC,mBACV,uBAAuB,CAAC,MAAM,EAAA,cAAA,EAC/BC,cAAkB,EAAA,QAAA,EAAA,8wBAAA,EAAA;;;AElBpC;;ACAA;;AAEG;;;;"}
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import '@mintplayer/
|
|
4
|
-
import {
|
|
2
|
+
import { inject, ElementRef, input, model, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { connectPagination, isPlainClick } from '@mintplayer/ui-core/pagination';
|
|
4
|
+
import { takeHostAria } from '@mintplayer/ng-bootstrap/a11y';
|
|
5
|
+
import { MpPropsDirective } from '@mintplayer/ng-bootstrap/machine';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Bootstrap's `.pagination` markup, rendered by this component's own
|
|
9
|
+
* template (#437) from `@mintplayer/ui-core/pagination`. Pages are buttons;
|
|
10
|
+
* with `hrefFor` they are real links, so SSR output navigates with
|
|
11
|
+
* JavaScript off and a plain click selects in place. The consumer's
|
|
12
|
+
* `aria-*` / `id` / `tabindex` on `<bs-pagination>` land on the `<nav>`.
|
|
13
|
+
*/
|
|
11
14
|
class BsPaginationComponent {
|
|
12
15
|
constructor() {
|
|
16
|
+
this.host = inject(ElementRef).nativeElement;
|
|
17
|
+
this.hostAria = takeHostAria(this.host);
|
|
13
18
|
/** All page numbers. */
|
|
14
19
|
this.pageNumbers = input([], /* @ts-ignore */
|
|
15
20
|
...(ngDevMode ? [{ debugName: "pageNumbers" }] : /* istanbul ignore next */ []));
|
|
16
21
|
/** Selected number. */
|
|
17
22
|
this.selectedPageNumber = model(1, /* @ts-ignore */
|
|
18
23
|
...(ngDevMode ? [{ debugName: "selectedPageNumber" }] : /* istanbul ignore next */ []));
|
|
19
|
-
/**
|
|
24
|
+
/** Cap on visible boxes, arrows included (0 = uncapped). */
|
|
20
25
|
this.numberOfBoxes = input(0, /* @ts-ignore */
|
|
21
26
|
...(ngDevMode ? [{ debugName: "numberOfBoxes" }] : /* istanbul ignore next */ []));
|
|
22
27
|
/** Display previous/next arrows. */
|
|
@@ -25,28 +30,44 @@ class BsPaginationComponent {
|
|
|
25
30
|
/** Page number size. */
|
|
26
31
|
this.size = input('medium', /* @ts-ignore */
|
|
27
32
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
/** Localized accessible names; missing keys fall back to English. */
|
|
34
|
+
this.labels = input(null, /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
36
|
+
/** Renders every page as a link to this URL, so it works without JavaScript. */
|
|
37
|
+
this.hrefFor = input(null, /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "hrefFor" }] : /* istanbul ignore next */ []));
|
|
39
|
+
this.view = computed(() => connectPagination({
|
|
40
|
+
pageNumbers: this.pageNumbers(),
|
|
41
|
+
selectedPageNumber: this.selectedPageNumber(),
|
|
42
|
+
numberOfBoxes: this.numberOfBoxes(),
|
|
43
|
+
showArrows: this.showArrows(),
|
|
44
|
+
size: this.size(),
|
|
45
|
+
labels: this.labels(),
|
|
46
|
+
hrefFor: this.hrefFor(),
|
|
47
|
+
}), /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
|
|
49
|
+
this.navBag = computed(() => ({ ...this.view().nav, ...this.hostAria }), /* @ts-ignore */
|
|
50
|
+
...(ngDevMode ? [{ debugName: "navBag" }] : /* istanbul ignore next */ []));
|
|
51
|
+
}
|
|
52
|
+
select(page) {
|
|
53
|
+
if (page !== null)
|
|
54
|
+
this.selectedPageNumber.set(page);
|
|
38
55
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
56
|
+
onLinkClick(event, page) {
|
|
57
|
+
if (!isPlainClick(event))
|
|
58
|
+
return;
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
this.select(page);
|
|
42
61
|
}
|
|
43
62
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
44
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
63
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: BsPaginationComponent, isStandalone: true, selector: "bs-pagination", inputs: { pageNumbers: { classPropertyName: "pageNumbers", publicName: "pageNumbers", isSignal: true, isRequired: false, transformFunction: null }, selectedPageNumber: { classPropertyName: "selectedPageNumber", publicName: "selectedPageNumber", isSignal: true, isRequired: false, transformFunction: null }, numberOfBoxes: { classPropertyName: "numberOfBoxes", publicName: "numberOfBoxes", isSignal: true, isRequired: false, transformFunction: null }, showArrows: { classPropertyName: "showArrows", publicName: "showArrows", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, hrefFor: { classPropertyName: "hrefFor", publicName: "hrefFor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedPageNumber: "selectedPageNumberChange" }, host: { classAttribute: "d-block" }, ngImport: i0, template: "<nav [mpProps]=\"navBag()\">\n <ul [class]=\"view().listClass\">\n @for (entry of view().entries; track entry.key) {\n <li [class]=\"entry.itemClass\">\n @if (entry.kind === 'gap') {\n <span [mpProps]=\"entry.attrs\">{{ entry.text }}</span>\n } @else if (view().tag === 'a') {\n <a [mpProps]=\"entry.attrs\" [attr.href]=\"entry.href\" (click)=\"onLinkClick($event, entry.target)\">{{ entry.text }}</a>\n } @else {\n <button [mpProps]=\"entry.attrs\" (click)=\"select(entry.target)\">{{ entry.text }}</button>\n }\n </li>\n }\n </ul>\n</nav>\n", dependencies: [{ kind: "directive", type: MpPropsDirective, selector: "[mpProps]", inputs: ["mpProps"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
45
64
|
}
|
|
46
65
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsPaginationComponent, decorators: [{
|
|
47
66
|
type: Component,
|
|
48
|
-
args: [{ selector: 'bs-pagination', imports: [
|
|
49
|
-
|
|
67
|
+
args: [{ selector: 'bs-pagination', imports: [MpPropsDirective], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
68
|
+
'class': 'd-block',
|
|
69
|
+
}, template: "<nav [mpProps]=\"navBag()\">\n <ul [class]=\"view().listClass\">\n @for (entry of view().entries; track entry.key) {\n <li [class]=\"entry.itemClass\">\n @if (entry.kind === 'gap') {\n <span [mpProps]=\"entry.attrs\">{{ entry.text }}</span>\n } @else if (view().tag === 'a') {\n <a [mpProps]=\"entry.attrs\" [attr.href]=\"entry.href\" (click)=\"onLinkClick($event, entry.target)\">{{ entry.text }}</a>\n } @else {\n <button [mpProps]=\"entry.attrs\" (click)=\"select(entry.target)\">{{ entry.text }}</button>\n }\n </li>\n }\n </ul>\n</nav>\n" }]
|
|
70
|
+
}], propDecorators: { pageNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageNumbers", required: false }] }], selectedPageNumber: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedPageNumber", required: false }] }, { type: i0.Output, args: ["selectedPageNumberChange"] }], numberOfBoxes: [{ type: i0.Input, args: [{ isSignal: true, alias: "numberOfBoxes", required: false }] }], showArrows: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArrows", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], hrefFor: [{ type: i0.Input, args: [{ isSignal: true, alias: "hrefFor", required: false }] }] } });
|
|
50
71
|
|
|
51
72
|
/**
|
|
52
73
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-pagination.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/pagination/src/component/pagination/pagination.component.ts","../../../../libs/mintplayer-ng-bootstrap/pagination/src/component/pagination/pagination.component.html","../../../../libs/mintplayer-ng-bootstrap/pagination/mintplayer-ng-bootstrap-pagination.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-pagination.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/pagination/src/component/pagination/pagination.component.ts","../../../../libs/mintplayer-ng-bootstrap/pagination/src/component/pagination/pagination.component.html","../../../../libs/mintplayer-ng-bootstrap/pagination/mintplayer-ng-bootstrap-pagination.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n model,\n} from '@angular/core';\nimport { Size } from '@mintplayer/ng-bootstrap';\nimport {\n connectPagination,\n isPlainClick,\n type PaginationLabels,\n} from '@mintplayer/ui-core/pagination';\nimport { takeHostAria } from '@mintplayer/ng-bootstrap/a11y';\nimport { MpPropsDirective } from '@mintplayer/ng-bootstrap/machine';\n\n/**\n * Bootstrap's `.pagination` markup, rendered by this component's own\n * template (#437) from `@mintplayer/ui-core/pagination`. Pages are buttons;\n * with `hrefFor` they are real links, so SSR output navigates with\n * JavaScript off and a plain click selects in place. The consumer's\n * `aria-*` / `id` / `tabindex` on `<bs-pagination>` land on the `<nav>`.\n */\n@Component({\n selector: 'bs-pagination',\n templateUrl: './pagination.component.html',\n imports: [MpPropsDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'class': 'd-block',\n },\n})\nexport class BsPaginationComponent {\n private readonly host = inject(ElementRef).nativeElement as HTMLElement;\n private readonly hostAria = takeHostAria(this.host);\n\n /** All page numbers. */\n readonly pageNumbers = input<number[]>([]);\n /** Selected number. */\n readonly selectedPageNumber = model<number>(1);\n /** Cap on visible boxes, arrows included (0 = uncapped). */\n readonly numberOfBoxes = input<number>(0);\n /** Display previous/next arrows. */\n readonly showArrows = input<boolean>(true);\n /** Page number size. */\n readonly size = input<Size>('medium');\n /** Localized accessible names; missing keys fall back to English. */\n readonly labels = input<Partial<PaginationLabels> | null>(null);\n /** Renders every page as a link to this URL, so it works without JavaScript. */\n readonly hrefFor = input<((page: number) => string) | null>(null);\n\n readonly view = computed(() => connectPagination({\n pageNumbers: this.pageNumbers(),\n selectedPageNumber: this.selectedPageNumber(),\n numberOfBoxes: this.numberOfBoxes(),\n showArrows: this.showArrows(),\n size: this.size(),\n labels: this.labels(),\n hrefFor: this.hrefFor(),\n }));\n\n readonly navBag = computed(() => ({ ...this.view().nav, ...this.hostAria }));\n\n select(page: number | null): void {\n if (page !== null) this.selectedPageNumber.set(page);\n }\n\n onLinkClick(event: MouseEvent, page: number | null): void {\n if (!isPlainClick(event)) return;\n event.preventDefault();\n this.select(page);\n }\n}\n","<nav [mpProps]=\"navBag()\">\n <ul [class]=\"view().listClass\">\n @for (entry of view().entries; track entry.key) {\n <li [class]=\"entry.itemClass\">\n @if (entry.kind === 'gap') {\n <span [mpProps]=\"entry.attrs\">{{ entry.text }}</span>\n } @else if (view().tag === 'a') {\n <a [mpProps]=\"entry.attrs\" [attr.href]=\"entry.href\" (click)=\"onLinkClick($event, entry.target)\">{{ entry.text }}</a>\n } @else {\n <button [mpProps]=\"entry.attrs\" (click)=\"select(entry.target)\">{{ entry.text }}</button>\n }\n </li>\n }\n </ul>\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"m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AA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,kBAAA,EAAA,0BAAA,EAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,SAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EClClC,ymBAeA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDaY,gBAAgB,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAMf,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBATjC,SAAS;+BACE,eAAe,EAAA,OAAA,EAEhB,CAAC,gBAAgB,CAAC,mBACV,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,OAAO,EAAE,SAAS;AACnB,qBAAA,EAAA,QAAA,EAAA,ymBAAA,EAAA;;;AEhCH;;AAEG;;;;"}
|
|
@@ -1,124 +1,197 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, DestroyRef,
|
|
2
|
+
import { inject, Injector, DestroyRef, signal, forwardRef, Directive, ElementRef, computed, model, input, booleanAttribute, output, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { useCore, useScopedStyles, MpPropsDirective, MpTrustedHtmlPipe } from '@mintplayer/ng-bootstrap/machine';
|
|
4
|
+
import { phoneInputCore, phoneInputScopedStyles } from '@mintplayer/ui-core/phone-input';
|
|
5
|
+
import * as i2 from '@mintplayer/ng-bootstrap/a11y';
|
|
6
|
+
import { BsControlValidityDirective } from '@mintplayer/ng-bootstrap/a11y';
|
|
3
7
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
-
import * as i1 from '@mintplayer/ng-bootstrap/a11y';
|
|
5
|
-
import { BsForwardAriaDirective, BsControlValidityDirective } from '@mintplayer/ng-bootstrap/a11y';
|
|
6
|
-
import '@mintplayer/web-components/phone-input';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* form
|
|
14
|
-
*
|
|
15
|
-
* country's validation rules have loaded, which is deliberate rather than
|
|
16
|
-
* optimistic.
|
|
17
|
-
*
|
|
18
|
-
* ```html
|
|
19
|
-
* <bs-form>
|
|
20
|
-
* <bs-phone-input [(ngModel)]="phone" default-country="be"
|
|
21
|
-
* [errorMessages]="{ required: 'Enter a phone number.' }" />
|
|
22
|
-
* </bs-form>
|
|
23
|
-
* ```
|
|
10
|
+
* The `ControlValueAccessor` of `bs-phone-input` (a host directive of the
|
|
11
|
+
* generated component, see `phone-input.angular.ts`). A bound form control
|
|
12
|
+
* drives the E.164 value through `viewValue`; every change the user makes
|
|
13
|
+
* (typing, paste, a country pick, rules that load and re-derive the E.164)
|
|
14
|
+
* reaches the form through the component's `value` model, which a form write
|
|
15
|
+
* never touches.
|
|
24
16
|
*/
|
|
25
|
-
class
|
|
17
|
+
class BsPhoneInputValueAccessor {
|
|
26
18
|
constructor() {
|
|
19
|
+
this.injector = inject(Injector);
|
|
27
20
|
this.destroyRef = inject(DestroyRef);
|
|
21
|
+
/** A form control drives the value: its `viewValue` wins over the `value` input. */
|
|
22
|
+
this.bound = signal(false, /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "bound" }] : /* istanbul ignore next */ []));
|
|
24
|
+
this.viewValue = signal(null, /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "viewValue" }] : /* istanbul ignore next */ []));
|
|
26
|
+
this.disabled = signal(false, /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
28
28
|
this.onChange = () => undefined;
|
|
29
29
|
this.onTouched = () => undefined;
|
|
30
|
-
/** Set by `setDisabledState` before the view exists, applied by the effect. */
|
|
31
|
-
this.disabledByForm = false;
|
|
32
|
-
this.phoneInput = viewChild.required('phoneInput', /* @ts-ignore */
|
|
33
|
-
...(ngDevMode ? [{ debugName: "phoneInput" }] : /* istanbul ignore next */ []));
|
|
34
|
-
/** ISO 3166-1 alpha-2, lowercase. Two-way via `(countryChange)`. */
|
|
35
|
-
this.country = input(null, /* @ts-ignore */
|
|
36
|
-
...(ngDevMode ? [{ debugName: "country" }] : /* istanbul ignore next */ []));
|
|
37
|
-
/** Country to start on when the value is empty. */
|
|
38
|
-
this.defaultCountry = input(null, /* @ts-ignore */
|
|
39
|
-
...(ngDevMode ? [{ debugName: "defaultCountry" }] : /* istanbul ignore next */ []));
|
|
40
|
-
/** BCP-47 tag for country names and their ordering. Omitted = browser locale. */
|
|
41
|
-
this.locale = input(null, /* @ts-ignore */
|
|
42
|
-
...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
|
|
43
|
-
this.preferredCountries = input(null, /* @ts-ignore */
|
|
44
|
-
...(ngDevMode ? [{ debugName: "preferredCountries" }] : /* istanbul ignore next */ []));
|
|
45
|
-
this.allowedCountries = input(null, /* @ts-ignore */
|
|
46
|
-
...(ngDevMode ? [{ debugName: "allowedCountries" }] : /* istanbul ignore next */ []));
|
|
47
|
-
this.placeholder = input(null, /* @ts-ignore */
|
|
48
|
-
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
49
|
-
this.autocomplete = input('tel-national', /* @ts-ignore */
|
|
50
|
-
...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
51
|
-
/** Accessible name of the number field. */
|
|
52
|
-
this.inputLabel = input(null, /* @ts-ignore */
|
|
53
|
-
...(ngDevMode ? [{ debugName: "inputLabel" }] : /* istanbul ignore next */ []));
|
|
54
|
-
/** Accessible name of the country picker. */
|
|
55
|
-
this.countryLabel = input(null, /* @ts-ignore */
|
|
56
|
-
...(ngDevMode ? [{ debugName: "countryLabel" }] : /* istanbul ignore next */ []));
|
|
57
|
-
this.countryChange = output();
|
|
58
|
-
/** The full detail: E.164 value plus country, dial code, digits and validity. */
|
|
59
|
-
this.phoneChange = output();
|
|
60
|
-
this.preferredAttr = computed(() => this.preferredCountries()?.join(',') ?? null, /* @ts-ignore */
|
|
61
|
-
...(ngDevMode ? [{ debugName: "preferredAttr" }] : /* istanbul ignore next */ []));
|
|
62
|
-
this.allowedAttr = computed(() => this.allowedCountries()?.join(',') ?? null, /* @ts-ignore */
|
|
63
|
-
...(ngDevMode ? [{ debugName: "allowedAttr" }] : /* istanbul ignore next */ []));
|
|
64
|
-
effect(() => {
|
|
65
|
-
const el = this.phoneInput().nativeElement;
|
|
66
|
-
el.disabled = this.disabledByForm;
|
|
67
|
-
});
|
|
68
30
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
31
|
+
ngOnInit() {
|
|
32
|
+
// The component is created after its host directives, so it is looked up here.
|
|
33
|
+
const sub = this.injector.get(BsPhoneInputComponent).value.subscribe((value) => {
|
|
34
|
+
if (!this.bound() || value === this.viewValue())
|
|
35
|
+
return;
|
|
36
|
+
this.viewValue.set(value);
|
|
37
|
+
this.onChange(value);
|
|
38
|
+
});
|
|
39
|
+
this.destroyRef.onDestroy(() => sub.unsubscribe());
|
|
75
40
|
}
|
|
76
41
|
registerOnChange(fn) {
|
|
42
|
+
this.bound.set(true);
|
|
77
43
|
this.onChange = fn;
|
|
78
44
|
}
|
|
79
45
|
registerOnTouched(fn) {
|
|
80
46
|
this.onTouched = fn;
|
|
81
47
|
}
|
|
48
|
+
writeValue(value) {
|
|
49
|
+
this.viewValue.set(value || null);
|
|
50
|
+
}
|
|
82
51
|
setDisabledState(isDisabled) {
|
|
83
|
-
this.
|
|
84
|
-
|
|
85
|
-
|
|
52
|
+
this.disabled.set(isDisabled);
|
|
53
|
+
}
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsPhoneInputValueAccessor, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
55
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsPhoneInputValueAccessor, isStandalone: true, host: { listeners: { "focusout": "onTouched()" } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsPhoneInputValueAccessor), multi: true }], ngImport: i0 }); }
|
|
56
|
+
}
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsPhoneInputValueAccessor, decorators: [{
|
|
58
|
+
type: Directive,
|
|
59
|
+
args: [{
|
|
60
|
+
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsPhoneInputValueAccessor), multi: true }],
|
|
61
|
+
host: {
|
|
62
|
+
'(focusout)': 'onTouched()',
|
|
63
|
+
},
|
|
64
|
+
}]
|
|
65
|
+
}] });
|
|
66
|
+
/**
|
|
67
|
+
* `focus()` on the `bs-phone-input` host moves into the number field, not the
|
|
68
|
+
* country picker (D13), so a directive that focuses the element it sits on
|
|
69
|
+
* reaches the field.
|
|
70
|
+
*/
|
|
71
|
+
class BsPhoneInputFocusDirective {
|
|
72
|
+
constructor() {
|
|
73
|
+
const host = inject(ElementRef).nativeElement;
|
|
74
|
+
const tel = () => host.querySelector('input[type=tel]');
|
|
75
|
+
Object.defineProperty(host, 'focus', {
|
|
76
|
+
// Before the first render there is no input yet; try again once it exists.
|
|
77
|
+
value: (options) => {
|
|
78
|
+
const input = tel();
|
|
79
|
+
if (input)
|
|
80
|
+
input.focus(options);
|
|
81
|
+
else
|
|
82
|
+
queueMicrotask(() => tel()?.focus(options));
|
|
83
|
+
},
|
|
84
|
+
configurable: true,
|
|
85
|
+
writable: true,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsPhoneInputFocusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
89
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsPhoneInputFocusDirective, isStandalone: true, ngImport: i0 }); }
|
|
90
|
+
}
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsPhoneInputFocusDirective, decorators: [{
|
|
92
|
+
type: Directive,
|
|
93
|
+
args: [{}]
|
|
94
|
+
}], ctorParameters: () => [] });
|
|
95
|
+
|
|
96
|
+
/*
|
|
97
|
+
* The Angular extension of the generated `bs-phone-input` (PRD #437 D10 escape
|
|
98
|
+
* hatch): Angular forms, and host focus. A bound form control drives the value
|
|
99
|
+
* and the disabled state, and its validity reaches the number field's ARIA and
|
|
100
|
+
* message.
|
|
101
|
+
*/
|
|
102
|
+
const hostDirectives = [
|
|
103
|
+
BsPhoneInputValueAccessor,
|
|
104
|
+
BsPhoneInputFocusDirective,
|
|
105
|
+
{ directive: BsControlValidityDirective, inputs: ['errorMessages'] },
|
|
106
|
+
];
|
|
107
|
+
function extendInputs(inputs) {
|
|
108
|
+
const accessor = inject(BsPhoneInputValueAccessor, { self: true });
|
|
109
|
+
const validity = inject(BsControlValidityDirective, { self: true });
|
|
110
|
+
return computed(() => {
|
|
111
|
+
const value = inputs();
|
|
112
|
+
return {
|
|
113
|
+
...value,
|
|
114
|
+
value: accessor.bound() ? accessor.viewValue() : value.value,
|
|
115
|
+
disabled: value.disabled || accessor.disabled(),
|
|
116
|
+
invalid: value.invalid || validity.invalid(),
|
|
117
|
+
required: value.required || validity.required(),
|
|
118
|
+
errorText: value.errorText ?? validity.errorText(),
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// GENERATED from the phone-input manifest (phone-input) by @mintplayer/nx-component-compiler. Do not edit.
|
|
124
|
+
/**
|
|
125
|
+
* A phone-number field (#437): country picker with flags, dial code, and a number input that formats as
|
|
126
|
+
* the user types. `value` is two-way E.164 (`+32470123456`); `country` is two-way too.
|
|
127
|
+
*
|
|
128
|
+
* With JavaScript off it is a plain country select and tel input; the typed text submits under `name`.
|
|
129
|
+
* An `aria-label` on the component names the number input; `countryLabel` names the picker.
|
|
130
|
+
*/
|
|
131
|
+
class BsPhoneInputComponent {
|
|
132
|
+
#core;
|
|
133
|
+
constructor() {
|
|
134
|
+
/** The host element. */
|
|
135
|
+
this.elementRef = inject(ElementRef);
|
|
136
|
+
this.value = model(null, /* @ts-ignore */
|
|
137
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
138
|
+
this.country = model(null, /* @ts-ignore */
|
|
139
|
+
...(ngDevMode ? [{ debugName: "country" }] : /* istanbul ignore next */ []));
|
|
140
|
+
this.defaultCountry = input(/* @ts-ignore */
|
|
141
|
+
...(ngDevMode ? [undefined, { debugName: "defaultCountry" }] : /* istanbul ignore next */ []));
|
|
142
|
+
this.locale = input(/* @ts-ignore */
|
|
143
|
+
...(ngDevMode ? [undefined, { debugName: "locale" }] : /* istanbul ignore next */ []));
|
|
144
|
+
this.preferredCountries = input(null, /* @ts-ignore */
|
|
145
|
+
...(ngDevMode ? [{ debugName: "preferredCountries" }] : /* istanbul ignore next */ []));
|
|
146
|
+
this.allowedCountries = input(null, /* @ts-ignore */
|
|
147
|
+
...(ngDevMode ? [{ debugName: "allowedCountries" }] : /* istanbul ignore next */ []));
|
|
148
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
149
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
150
|
+
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
151
|
+
this.errorText = input(/* @ts-ignore */
|
|
152
|
+
...(ngDevMode ? [undefined, { debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
153
|
+
this.placeholder = input(/* @ts-ignore */
|
|
154
|
+
...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
155
|
+
this.autocomplete = input('tel-national', /* @ts-ignore */
|
|
156
|
+
...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
157
|
+
this.name = input(/* @ts-ignore */
|
|
158
|
+
...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
|
|
159
|
+
this.inputLabel = input(/* @ts-ignore */
|
|
160
|
+
...(ngDevMode ? [undefined, { debugName: "inputLabel" }] : /* istanbul ignore next */ []));
|
|
161
|
+
this.countryLabel = input(/* @ts-ignore */
|
|
162
|
+
...(ngDevMode ? [undefined, { debugName: "countryLabel" }] : /* istanbul ignore next */ []));
|
|
163
|
+
/** The E.164 value changed (null while empty). */
|
|
164
|
+
this.valuechange = output();
|
|
165
|
+
/** The user picked a country, or typed a `+XX` that switched it. */
|
|
166
|
+
this.countrychange = output();
|
|
167
|
+
/** Every edit, pick and rules load: the value with its parts and validity. */
|
|
168
|
+
this.phonechange = output();
|
|
169
|
+
this.#core = useCore(phoneInputCore, { inputs: extendInputs(() => ({ value: this.value(), country: this.country(), defaultCountry: this.defaultCountry(), locale: this.locale(), preferredCountries: this.preferredCountries(), allowedCountries: this.allowedCountries(), disabled: this.disabled(), required: this.required(), invalid: this.invalid(), errorText: this.errorText(), placeholder: this.placeholder(), autocomplete: this.autocomplete(), name: this.name(), inputLabel: this.inputLabel(), countryLabel: this.countryLabel() })), idPrefix: 'bs-phone-input', outputs: { valueChange: this.valuechange, countryChange: this.countrychange, phoneChange: this.phonechange }, hostBag: (props) => ({ ...props.view.root, 'data-mps': 'phone-input' }), models: { value: this.value, country: this.country } });
|
|
170
|
+
/** The template's props. */
|
|
171
|
+
this.props = this.#core.props;
|
|
172
|
+
useScopedStyles('phone-input', phoneInputScopedStyles);
|
|
86
173
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return;
|
|
91
|
-
this.onChange(detail.value);
|
|
92
|
-
this.phoneChange.emit(detail);
|
|
174
|
+
/** Moves focus into the number field, not the country picker. */
|
|
175
|
+
focusInput(...args) {
|
|
176
|
+
return this.#core.call('focusInput', args);
|
|
93
177
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return;
|
|
98
|
-
// A country change is a user interaction with the control, and the number is
|
|
99
|
-
// usually still empty at that point — without this the field can never be
|
|
100
|
-
// touched, so a `required` error would never surface.
|
|
101
|
-
this.onTouched();
|
|
102
|
-
this.countryChange.emit(detail.country);
|
|
178
|
+
/** Settles once the flags and the rules in flight have been applied. */
|
|
179
|
+
whenReady(...args) {
|
|
180
|
+
return this.#core.call('whenReady', args);
|
|
103
181
|
}
|
|
104
182
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsPhoneInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
105
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
106
|
-
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsPhoneInputComponent), multi: true },
|
|
107
|
-
], viewQueries: [{ propertyName: "phoneInput", first: true, predicate: ["phoneInput"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.BsControlValidityDirective, inputs: ["errorMessages", "errorMessages"] }], ngImport: i0, template: "<mp-phone-input\n bsForwardAria\n #phoneInput\n [attr.country]=\"country()\"\n [attr.default-country]=\"defaultCountry()\"\n [attr.locale]=\"locale()\"\n [attr.preferred-countries]=\"preferredAttr()\"\n [attr.allowed-countries]=\"allowedAttr()\"\n [attr.placeholder]=\"placeholder()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.input-label]=\"inputLabel()\"\n [attr.country-label]=\"countryLabel()\"\n (value-change)=\"onValueChange($event)\"\n (country-change)=\"onCountryChange($event)\">\n</mp-phone-input>\n", dependencies: [{ kind: "directive", type: BsForwardAriaDirective, selector: "[bsForwardAria]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
183
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: BsPhoneInputComponent, isStandalone: true, selector: "bs-phone-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, country: { classPropertyName: "country", publicName: "country", isSignal: true, isRequired: false, transformFunction: null }, defaultCountry: { classPropertyName: "defaultCountry", publicName: "defaultCountry", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, preferredCountries: { classPropertyName: "preferredCountries", publicName: "preferredCountries", isSignal: true, isRequired: false, transformFunction: null }, allowedCountries: { classPropertyName: "allowedCountries", publicName: "allowedCountries", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, inputLabel: { classPropertyName: "inputLabel", publicName: "inputLabel", isSignal: true, isRequired: false, transformFunction: null }, countryLabel: { classPropertyName: "countryLabel", publicName: "countryLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", country: "countryChange", valuechange: "valuechange", countrychange: "countrychange", phonechange: "phonechange" }, hostDirectives: [{ directive: BsPhoneInputValueAccessor }, { directive: BsPhoneInputFocusDirective }, { directive: i2.BsControlValidityDirective, inputs: ["errorMessages", "errorMessages"] }], ngImport: i0, template: "<!-- GENERATED from libs/mintplayer-ui-core/phone-input/src/templates/phone-input.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n@let p_view = props().view;\n<div data-mps=\"phone-input\" [mpProps]=\"p_view.group\">\n <select data-mps=\"phone-input\" [mpProps]=\"p_view.select\">\n @if (p_view.rich) {\n <button data-mps=\"phone-input\" type=\"button\">\n <selectedcontent></selectedcontent>\n </button>\n }\n @for (o of p_view.options; track o.key) {\n <option data-mps=\"phone-input\" [mpProps]=\"o.bag\">\n @if (p_view.rich) {\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.flagBox\" [innerHTML]=\"o.flag | mpTrustedHtml\"></span>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.richLabel\">\n {{ o.name }}\n </span>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.listOnly\">\n {{ o.dial }}\n </span>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.closedOnly\">\n {{ o.iso }}\n </span>\n } @else {\n {{ o.label }}\n }\n </option>\n }\n </select>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.addon\">\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.flag\" [innerHTML]=\"p_view.flagHtml | mpTrustedHtml\"></span>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.dial\">\n {{ p_view.dialText }}\n </span>\n </span>\n <input data-mps=\"phone-input\" [mpProps]=\"p_view.input\">\n</div>\n@if (p_view.hidden) {\n <input data-mps=\"phone-input\" [mpProps]=\"p_view.hidden\">\n}\n@if (p_view.showFeedback) {\n <div data-mps=\"phone-input\" [mpProps]=\"p_view.feedback.attrs\">\n {{ p_view.feedback.text }}\n </div>\n}\n", dependencies: [{ kind: "directive", type: MpPropsDirective, selector: "[mpProps]", inputs: ["mpProps"] }, { kind: "pipe", type: MpTrustedHtmlPipe, name: "mpTrustedHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
108
184
|
}
|
|
109
185
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsPhoneInputComponent, decorators: [{
|
|
110
186
|
type: Component,
|
|
111
|
-
args: [{ selector: 'bs-phone-input', imports: [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
inputs: ['errorMessages'],
|
|
116
|
-
}], template: "<mp-phone-input\n bsForwardAria\n #phoneInput\n [attr.country]=\"country()\"\n [attr.default-country]=\"defaultCountry()\"\n [attr.locale]=\"locale()\"\n [attr.preferred-countries]=\"preferredAttr()\"\n [attr.allowed-countries]=\"allowedAttr()\"\n [attr.placeholder]=\"placeholder()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.input-label]=\"inputLabel()\"\n [attr.country-label]=\"countryLabel()\"\n (value-change)=\"onValueChange($event)\"\n (country-change)=\"onCountryChange($event)\">\n</mp-phone-input>\n" }]
|
|
117
|
-
}], ctorParameters: () => [], propDecorators: { phoneInput: [{ type: i0.ViewChild, args: ['phoneInput', { isSignal: true }] }], country: [{ type: i0.Input, args: [{ isSignal: true, alias: "country", required: false }] }], defaultCountry: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultCountry", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], preferredCountries: [{ type: i0.Input, args: [{ isSignal: true, alias: "preferredCountries", required: false }] }], allowedCountries: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedCountries", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], inputLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputLabel", required: false }] }], countryLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "countryLabel", required: false }] }], countryChange: [{ type: i0.Output, args: ["countryChange"] }], phoneChange: [{ type: i0.Output, args: ["phoneChange"] }] } });
|
|
187
|
+
args: [{ selector: 'bs-phone-input', imports: [MpPropsDirective, MpTrustedHtmlPipe], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: hostDirectives, template: "<!-- GENERATED from libs/mintplayer-ui-core/phone-input/src/templates/phone-input.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n@let p_view = props().view;\n<div data-mps=\"phone-input\" [mpProps]=\"p_view.group\">\n <select data-mps=\"phone-input\" [mpProps]=\"p_view.select\">\n @if (p_view.rich) {\n <button data-mps=\"phone-input\" type=\"button\">\n <selectedcontent></selectedcontent>\n </button>\n }\n @for (o of p_view.options; track o.key) {\n <option data-mps=\"phone-input\" [mpProps]=\"o.bag\">\n @if (p_view.rich) {\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.flagBox\" [innerHTML]=\"o.flag | mpTrustedHtml\"></span>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.richLabel\">\n {{ o.name }}\n </span>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.listOnly\">\n {{ o.dial }}\n </span>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.closedOnly\">\n {{ o.iso }}\n </span>\n } @else {\n {{ o.label }}\n }\n </option>\n }\n </select>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.addon\">\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.flag\" [innerHTML]=\"p_view.flagHtml | mpTrustedHtml\"></span>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.dial\">\n {{ p_view.dialText }}\n </span>\n </span>\n <input data-mps=\"phone-input\" [mpProps]=\"p_view.input\">\n</div>\n@if (p_view.hidden) {\n <input data-mps=\"phone-input\" [mpProps]=\"p_view.hidden\">\n}\n@if (p_view.showFeedback) {\n <div data-mps=\"phone-input\" [mpProps]=\"p_view.feedback.attrs\">\n {{ p_view.feedback.text }}\n </div>\n}\n" }]
|
|
188
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], country: [{ type: i0.Input, args: [{ isSignal: true, alias: "country", required: false }] }, { type: i0.Output, args: ["countryChange"] }], defaultCountry: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultCountry", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], preferredCountries: [{ type: i0.Input, args: [{ isSignal: true, alias: "preferredCountries", required: false }] }], allowedCountries: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedCountries", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], inputLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputLabel", required: false }] }], countryLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "countryLabel", required: false }] }], valuechange: [{ type: i0.Output, args: ["valuechange"] }], countrychange: [{ type: i0.Output, args: ["countrychange"] }], phonechange: [{ type: i0.Output, args: ["phonechange"] }] } });
|
|
189
|
+
|
|
190
|
+
// GENERATED from the phone-input manifest by @mintplayer/nx-component-compiler. Do not edit.
|
|
118
191
|
|
|
119
192
|
/**
|
|
120
193
|
* Generated bundle index. Do not edit.
|
|
121
194
|
*/
|
|
122
195
|
|
|
123
|
-
export { BsPhoneInputComponent };
|
|
196
|
+
export { BsPhoneInputComponent, BsPhoneInputFocusDirective, BsPhoneInputValueAccessor };
|
|
124
197
|
//# sourceMappingURL=mintplayer-ng-bootstrap-phone-input.mjs.map
|