@mintplayer/ng-bootstrap 22.12.0 → 22.13.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.
@@ -1,14 +1,35 @@
1
1
  import * as i0 from '@angular/core';
2
- import { ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { input, computed, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { BsForwardAriaDirective } from '@mintplayer/ng-bootstrap/a11y';
4
+ import '@mintplayer/web-components/input-group';
3
5
 
6
+ /**
7
+ * `<bs-input-group>` — joins its children into one visually continuous control.
8
+ *
9
+ * Now a wrapper over `<mp-input-group>`. The previous version was a
10
+ * `<div class="input-group">` plus a `::ng-deep` import of Bootstrap's module,
11
+ * which could not style a `<bs-select>`: the rules Bootstrap keys on
12
+ * `.input-group > .form-select` cannot reach inside that component's shadow root,
13
+ * so a select in a group got neither the flex sizing nor collapsed inner corners.
14
+ * The WC solves it with two channels (see `input-group.styles.scss`), which is why
15
+ * the styling moved there rather than being duplicated here.
16
+ */
4
17
  class BsInputGroupComponent {
18
+ constructor() {
19
+ /** Bootstrap sizing, applied to light-DOM and `mp-*` children alike. */
20
+ this.size = input('md', /* @ts-ignore */
21
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
22
+ /** `md` is the absence of a size in Bootstrap, so it is not written at all. */
23
+ this.sizeAttr = computed(() => (this.size() === 'md' ? null : this.size()), /* @ts-ignore */
24
+ ...(ngDevMode ? [{ debugName: "sizeAttr" }] : /* istanbul ignore next */ []));
25
+ }
5
26
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsInputGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
6
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0", type: BsInputGroupComponent, isStandalone: true, selector: "bs-input-group", ngImport: i0, template: "<div class=\"input-group\">\n <ng-content></ng-content>\n</div>", styles: [":host ::ng-deep .input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%}:host ::ng-deep .input-group>.form-control,:host ::ng-deep .input-group>.form-select,:host ::ng-deep .input-group>.form-floating{position:relative;flex:1 1 auto;width:1%;min-width:0}:host ::ng-deep .input-group>.form-control:focus,:host ::ng-deep .input-group>.form-select:focus,:host ::ng-deep .input-group>.form-floating:focus-within{z-index:5}:host ::ng-deep .input-group .btn{position:relative;z-index:2}:host ::ng-deep .input-group .btn:focus{z-index:5}:host ::ng-deep .input-group-text{display:flex;align-items:center;padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:var(--bs-body-color);text-align:center;white-space:nowrap;background-color:var(--bs-tertiary-bg);border:var(--bs-border-width) solid var(--bs-border-color);border-radius:var(--bs-border-radius)}:host ::ng-deep .input-group-lg>.form-control,:host ::ng-deep .input-group-lg>.form-select,:host ::ng-deep .input-group-lg>.input-group-text,:host ::ng-deep .input-group-lg>.btn{padding:.5rem 1rem;font-size:1.25rem;border-radius:var(--bs-border-radius-lg)}:host ::ng-deep .input-group-sm>.form-control,:host ::ng-deep .input-group-sm>.form-select,:host ::ng-deep .input-group-sm>.input-group-text,:host ::ng-deep .input-group-sm>.btn{padding:.25rem .5rem;font-size:.875rem;border-radius:var(--bs-border-radius-sm)}:host ::ng-deep .input-group-lg>.form-select,:host ::ng-deep .input-group-sm>.form-select{padding-right:3rem}:host ::ng-deep .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),:host ::ng-deep .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),:host ::ng-deep .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,:host ::ng-deep .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select{border-top-right-radius:0;border-bottom-right-radius:0}:host ::ng-deep .input-group.has-validation>:nth-last-child(n+3):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),:host ::ng-deep .input-group.has-validation>.dropdown-toggle:nth-last-child(n+4),:host ::ng-deep .input-group.has-validation>.form-floating:nth-last-child(n+3)>.form-control,:host ::ng-deep .input-group.has-validation>.form-floating:nth-last-child(n+3)>.form-select{border-top-right-radius:0;border-bottom-right-radius:0}:host ::ng-deep .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-left:calc(-1 * var(--bs-border-width));border-top-left-radius:0;border-bottom-left-radius:0}:host ::ng-deep .input-group>.form-floating:not(:first-child)>.form-control,:host ::ng-deep .input-group>.form-floating:not(:first-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
27
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.0", type: BsInputGroupComponent, isStandalone: true, selector: "bs-input-group", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mp-input-group bsForwardAria [attr.size]=\"sizeAttr()\">\n <ng-content></ng-content>\n</mp-input-group>\n", dependencies: [{ kind: "directive", type: BsForwardAriaDirective, selector: "[bsForwardAria]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7
28
  }
8
29
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsInputGroupComponent, decorators: [{
9
30
  type: Component,
10
- args: [{ selector: 'bs-input-group', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"input-group\">\n <ng-content></ng-content>\n</div>", styles: [":host ::ng-deep .input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%}:host ::ng-deep .input-group>.form-control,:host ::ng-deep .input-group>.form-select,:host ::ng-deep .input-group>.form-floating{position:relative;flex:1 1 auto;width:1%;min-width:0}:host ::ng-deep .input-group>.form-control:focus,:host ::ng-deep .input-group>.form-select:focus,:host ::ng-deep .input-group>.form-floating:focus-within{z-index:5}:host ::ng-deep .input-group .btn{position:relative;z-index:2}:host ::ng-deep .input-group .btn:focus{z-index:5}:host ::ng-deep .input-group-text{display:flex;align-items:center;padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:var(--bs-body-color);text-align:center;white-space:nowrap;background-color:var(--bs-tertiary-bg);border:var(--bs-border-width) solid var(--bs-border-color);border-radius:var(--bs-border-radius)}:host ::ng-deep .input-group-lg>.form-control,:host ::ng-deep .input-group-lg>.form-select,:host ::ng-deep .input-group-lg>.input-group-text,:host ::ng-deep .input-group-lg>.btn{padding:.5rem 1rem;font-size:1.25rem;border-radius:var(--bs-border-radius-lg)}:host ::ng-deep .input-group-sm>.form-control,:host ::ng-deep .input-group-sm>.form-select,:host ::ng-deep .input-group-sm>.input-group-text,:host ::ng-deep .input-group-sm>.btn{padding:.25rem .5rem;font-size:.875rem;border-radius:var(--bs-border-radius-sm)}:host ::ng-deep .input-group-lg>.form-select,:host ::ng-deep .input-group-sm>.form-select{padding-right:3rem}:host ::ng-deep .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),:host ::ng-deep .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),:host ::ng-deep .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,:host ::ng-deep .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select{border-top-right-radius:0;border-bottom-right-radius:0}:host ::ng-deep .input-group.has-validation>:nth-last-child(n+3):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),:host ::ng-deep .input-group.has-validation>.dropdown-toggle:nth-last-child(n+4),:host ::ng-deep .input-group.has-validation>.form-floating:nth-last-child(n+3)>.form-control,:host ::ng-deep .input-group.has-validation>.form-floating:nth-last-child(n+3)>.form-select{border-top-right-radius:0;border-bottom-right-radius:0}:host ::ng-deep .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-left:calc(-1 * var(--bs-border-width));border-top-left-radius:0;border-bottom-left-radius:0}:host ::ng-deep .input-group>.form-floating:not(:first-child)>.form-control,:host ::ng-deep .input-group>.form-floating:not(:first-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0}\n"] }]
11
- }] });
31
+ args: [{ selector: 'bs-input-group', imports: [BsForwardAriaDirective], changeDetection: ChangeDetectionStrategy.OnPush, schemas: [CUSTOM_ELEMENTS_SCHEMA], template: "<mp-input-group bsForwardAria [attr.size]=\"sizeAttr()\">\n <ng-content></ng-content>\n</mp-input-group>\n" }]
32
+ }], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
12
33
 
13
34
  /**
14
35
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"mintplayer-ng-bootstrap-input-group.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/input-group/src/input-group/input-group.component.ts","../../../../libs/mintplayer-ng-bootstrap/input-group/src/input-group/input-group.component.html","../../../../libs/mintplayer-ng-bootstrap/input-group/mintplayer-ng-bootstrap-input-group.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy} from '@angular/core';\n\n@Component({\n selector: 'bs-input-group',\n templateUrl: './input-group.component.html',\n styleUrls: ['./input-group.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsInputGroupComponent {}\n","<div class=\"input-group\">\n <ng-content></ng-content>\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAQa,qBAAqB,CAAA;8GAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,0ECRlC,oEAEM,EAAA,MAAA,EAAA,CAAA,+0FAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDMO,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBANjC,SAAS;+BACE,gBAAgB,EAAA,eAAA,EAGT,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,oEAAA,EAAA,MAAA,EAAA,CAAA,+0FAAA,CAAA,EAAA;;;AENjD;;AAEG;;;;"}
1
+ {"version":3,"file":"mintplayer-ng-bootstrap-input-group.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/input-group/src/input-group/input-group.component.ts","../../../../libs/mintplayer-ng-bootstrap/input-group/src/input-group/input-group.component.html","../../../../libs/mintplayer-ng-bootstrap/input-group/mintplayer-ng-bootstrap-input-group.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, CUSTOM_ELEMENTS_SCHEMA, computed, input } from '@angular/core';\nimport { BsForwardAriaDirective } from '@mintplayer/ng-bootstrap/a11y';\n\n// Side-effect import: registers <mp-input-group>.\nimport '@mintplayer/web-components/input-group';\n\nexport type BsInputGroupSize = 'sm' | 'md' | 'lg';\n\n/**\n * `<bs-input-group>` — joins its children into one visually continuous control.\n *\n * Now a wrapper over `<mp-input-group>`. The previous version was a\n * `<div class=\"input-group\">` plus a `::ng-deep` import of Bootstrap's module,\n * which could not style a `<bs-select>`: the rules Bootstrap keys on\n * `.input-group > .form-select` cannot reach inside that component's shadow root,\n * so a select in a group got neither the flex sizing nor collapsed inner corners.\n * The WC solves it with two channels (see `input-group.styles.scss`), which is why\n * the styling moved there rather than being duplicated here.\n */\n@Component({\n selector: 'bs-input-group',\n templateUrl: './input-group.component.html',\n imports: [BsForwardAriaDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n})\nexport class BsInputGroupComponent {\n /** Bootstrap sizing, applied to light-DOM and `mp-*` children alike. */\n readonly size = input<BsInputGroupSize>('md');\n\n /** `md` is the absence of a size in Bootstrap, so it is not written at all. */\n protected readonly sizeAttr = computed(() => (this.size() === 'md' ? null : this.size()));\n}\n","<mp-input-group bsForwardAria [attr.size]=\"sizeAttr()\">\n <ng-content></ng-content>\n</mp-input-group>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAQA;;;;;;;;;;AAUG;MAQU,qBAAqB,CAAA;AAPlC,IAAA,WAAA,GAAA;;QASW,IAAA,CAAA,IAAI,GAAG,KAAK,CAAmB,IAAI;iFAAC;;QAG1B,IAAA,CAAA,QAAQ,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;qFAAC;AAC1F,IAAA;8GANY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC1BlC,+GAGA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDmBY,sBAAsB,EAAA,QAAA,EAAA,iBAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAIrB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,SAAS;+BACE,gBAAgB,EAAA,OAAA,EAEjB,CAAC,sBAAsB,CAAC,EAAA,eAAA,EAChB,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,sBAAsB,CAAC,EAAA,QAAA,EAAA,+GAAA,EAAA;;;AExBnC;;AAEG;;;;"}
@@ -0,0 +1,126 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, DestroyRef, viewChild, input, output, computed, effect, forwardRef, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ 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
+ /**
9
+ * `<bs-phone-input>` — a phone-number form control: country picker with flags,
10
+ * a dial code that cannot be edited away, and as-you-type formatting.
11
+ *
12
+ * The control value is **E.164** (`'+32470123456'`), or `null` while empty, so a
13
+ * form posts one canonical string. `(phoneChange)` carries the decomposed parts
14
+ * for consumers that need them — note `valid` is `undefined` until the selected
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
+ * ```
24
+ */
25
+ class BsPhoneInputComponent {
26
+ constructor() {
27
+ this.destroyRef = inject(DestroyRef);
28
+ this.onChange = () => undefined;
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');
33
+ /** ISO 3166-1 alpha-2, lowercase. Two-way via `(countryChange)`. */
34
+ this.country = input(null, /* @ts-ignore */
35
+ ...(ngDevMode ? [{ debugName: "country" }] : /* istanbul ignore next */ []));
36
+ /** Country to start on when the value is empty. */
37
+ this.defaultCountry = input(null, /* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "defaultCountry" }] : /* istanbul ignore next */ []));
39
+ /** BCP-47 tag for country names and their ordering. Omitted = browser locale. */
40
+ this.locale = input(null, /* @ts-ignore */
41
+ ...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
42
+ this.preferredCountries = input(null, /* @ts-ignore */
43
+ ...(ngDevMode ? [{ debugName: "preferredCountries" }] : /* istanbul ignore next */ []));
44
+ this.allowedCountries = input(null, /* @ts-ignore */
45
+ ...(ngDevMode ? [{ debugName: "allowedCountries" }] : /* istanbul ignore next */ []));
46
+ this.placeholder = input(null, /* @ts-ignore */
47
+ ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
48
+ this.autocomplete = input('tel-national', /* @ts-ignore */
49
+ ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
50
+ /** Accessible name of the number field. */
51
+ this.inputLabel = input(null, /* @ts-ignore */
52
+ ...(ngDevMode ? [{ debugName: "inputLabel" }] : /* istanbul ignore next */ []));
53
+ /** Accessible name of the country picker. */
54
+ this.countryLabel = input(null, /* @ts-ignore */
55
+ ...(ngDevMode ? [{ debugName: "countryLabel" }] : /* istanbul ignore next */ []));
56
+ this.countryChange = output();
57
+ /** The full detail: E.164 value plus country, dial code, digits and validity. */
58
+ this.phoneChange = output();
59
+ this.preferredAttr = computed(() => this.preferredCountries()?.join(',') ?? null, /* @ts-ignore */
60
+ ...(ngDevMode ? [{ debugName: "preferredAttr" }] : /* istanbul ignore next */ []));
61
+ this.allowedAttr = computed(() => this.allowedCountries()?.join(',') ?? null, /* @ts-ignore */
62
+ ...(ngDevMode ? [{ debugName: "allowedAttr" }] : /* istanbul ignore next */ []));
63
+ effect(() => {
64
+ const el = this.phoneInput()?.nativeElement;
65
+ if (el)
66
+ el.disabled = this.disabledByForm;
67
+ });
68
+ }
69
+ writeValue(value) {
70
+ const el = this.phoneInput()?.nativeElement;
71
+ // The WC decomposes E.164 into country + national digits itself, so the
72
+ // accessor never has to parse — and a value arriving before the view exists
73
+ // is applied by the same assignment once it does.
74
+ if (el)
75
+ el.value = value ?? null;
76
+ }
77
+ registerOnChange(fn) {
78
+ this.onChange = fn;
79
+ }
80
+ registerOnTouched(fn) {
81
+ this.onTouched = fn;
82
+ }
83
+ setDisabledState(isDisabled) {
84
+ this.disabledByForm = isDisabled;
85
+ const el = this.phoneInput()?.nativeElement;
86
+ if (el)
87
+ el.disabled = isDisabled;
88
+ }
89
+ onValueChange(ev) {
90
+ const detail = ev.detail;
91
+ if (this.destroyRef.destroyed)
92
+ return;
93
+ this.onChange(detail.value);
94
+ this.phoneChange.emit(detail);
95
+ }
96
+ onCountryChange(ev) {
97
+ const detail = ev.detail;
98
+ if (this.destroyRef.destroyed)
99
+ return;
100
+ // A country change is a user interaction with the control, and the number is
101
+ // usually still empty at that point — without this the field can never be
102
+ // touched, so a `required` error would never surface.
103
+ this.onTouched();
104
+ this.countryChange.emit(detail.country);
105
+ }
106
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsPhoneInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
107
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.0", type: BsPhoneInputComponent, isStandalone: true, selector: "bs-phone-input", inputs: { 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 }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", 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: { countryChange: "countryChange", phoneChange: "phoneChange" }, providers: [
108
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsPhoneInputComponent), multi: true },
109
+ ], 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 }); }
110
+ }
111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsPhoneInputComponent, decorators: [{
112
+ type: Component,
113
+ args: [{ selector: 'bs-phone-input', imports: [BsForwardAriaDirective], changeDetection: ChangeDetectionStrategy.OnPush, schemas: [CUSTOM_ELEMENTS_SCHEMA], providers: [
114
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsPhoneInputComponent), multi: true },
115
+ ], hostDirectives: [{
116
+ directive: BsControlValidityDirective,
117
+ inputs: ['errorMessages'],
118
+ }], 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" }]
119
+ }], 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"] }] } });
120
+
121
+ /**
122
+ * Generated bundle index. Do not edit.
123
+ */
124
+
125
+ export { BsPhoneInputComponent };
126
+ //# sourceMappingURL=mintplayer-ng-bootstrap-phone-input.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mintplayer-ng-bootstrap-phone-input.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/phone-input/src/component/phone-input.component.ts","../../../../libs/mintplayer-ng-bootstrap/phone-input/src/component/phone-input.component.html","../../../../libs/mintplayer-ng-bootstrap/phone-input/mintplayer-ng-bootstrap-phone-input.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n DestroyRef,\n ElementRef,\n computed,\n effect,\n forwardRef,\n inject,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BsControlValidityDirective, BsForwardAriaDirective } from '@mintplayer/ng-bootstrap/a11y';\nimport type {\n CountryChangeEventDetail,\n MpPhoneInput,\n PhoneChangeEventDetail,\n} from '@mintplayer/web-components/phone-input';\n\n// Side-effect import: registers <mp-phone-input> (and, transitively, the\n// <mp-input-group> and <mp-select> it composes).\nimport '@mintplayer/web-components/phone-input';\n\n/**\n * `<bs-phone-input>` — a phone-number form control: country picker with flags,\n * a dial code that cannot be edited away, and as-you-type formatting.\n *\n * The control value is **E.164** (`'+32470123456'`), or `null` while empty, so a\n * form posts one canonical string. `(phoneChange)` carries the decomposed parts\n * for consumers that need them — note `valid` is `undefined` until the selected\n * country's validation rules have loaded, which is deliberate rather than\n * optimistic.\n *\n * ```html\n * <bs-form>\n * <bs-phone-input [(ngModel)]=\"phone\" default-country=\"be\"\n * [errorMessages]=\"{ required: 'Enter a phone number.' }\" />\n * </bs-form>\n * ```\n */\n@Component({\n selector: 'bs-phone-input',\n templateUrl: './phone-input.component.html',\n imports: [BsForwardAriaDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsPhoneInputComponent), multi: true },\n ],\n hostDirectives: [{\n directive: BsControlValidityDirective,\n inputs: ['errorMessages'],\n }],\n})\nexport class BsPhoneInputComponent implements ControlValueAccessor {\n private readonly destroyRef = inject(DestroyRef);\n private onChange: (value: string | null) => void = () => undefined;\n private onTouched: () => void = () => undefined;\n /** Set by `setDisabledState` before the view exists, applied by the effect. */\n private disabledByForm = false;\n\n private readonly phoneInput = viewChild.required<ElementRef<MpPhoneInput>>('phoneInput');\n\n /** ISO 3166-1 alpha-2, lowercase. Two-way via `(countryChange)`. */\n readonly country = input<string | null>(null);\n /** Country to start on when the value is empty. */\n readonly defaultCountry = input<string | null>(null);\n /** BCP-47 tag for country names and their ordering. Omitted = browser locale. */\n readonly locale = input<string | null>(null);\n readonly preferredCountries = input<readonly string[] | null>(null);\n readonly allowedCountries = input<readonly string[] | null>(null);\n readonly placeholder = input<string | null>(null);\n readonly autocomplete = input<string>('tel-national');\n /** Accessible name of the number field. */\n readonly inputLabel = input<string | null>(null);\n /** Accessible name of the country picker. */\n readonly countryLabel = input<string | null>(null);\n\n readonly countryChange = output<string>();\n /** The full detail: E.164 value plus country, dial code, digits and validity. */\n readonly phoneChange = output<PhoneChangeEventDetail>();\n\n protected readonly preferredAttr = computed(() => this.preferredCountries()?.join(',') ?? null);\n protected readonly allowedAttr = computed(() => this.allowedCountries()?.join(',') ?? null);\n\n constructor() {\n effect(() => {\n const el = this.phoneInput()?.nativeElement;\n if (el) el.disabled = this.disabledByForm;\n });\n }\n\n writeValue(value: string | null): void {\n const el = this.phoneInput()?.nativeElement;\n // The WC decomposes E.164 into country + national digits itself, so the\n // accessor never has to parse — and a value arriving before the view exists\n // is applied by the same assignment once it does.\n if (el) el.value = value ?? null;\n }\n\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabledByForm = isDisabled;\n const el = this.phoneInput()?.nativeElement;\n if (el) el.disabled = isDisabled;\n }\n\n protected onValueChange(ev: Event): void {\n const detail = (ev as CustomEvent<PhoneChangeEventDetail>).detail;\n if (this.destroyRef.destroyed) return;\n this.onChange(detail.value);\n this.phoneChange.emit(detail);\n }\n\n protected onCountryChange(ev: Event): void {\n const detail = (ev as CustomEvent<CountryChangeEventDetail>).detail;\n if (this.destroyRef.destroyed) return;\n // A country change is a user interaction with the control, and the number is\n // usually still empty at that point — without this the field can never be\n // touched, so a `required` error would never surface.\n this.onTouched();\n this.countryChange.emit(detail.country);\n }\n}\n","<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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AA0BA;;;;;;;;;;;;;;;;AAgBG;MAeU,qBAAqB,CAAA;AA+BhC,IAAA,WAAA,GAAA;AA9BiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AACxC,QAAA,IAAA,CAAA,QAAQ,GAAmC,MAAM,SAAS;AAC1D,QAAA,IAAA,CAAA,SAAS,GAAe,MAAM,SAAS;;QAEvC,IAAA,CAAA,cAAc,GAAG,KAAK;AAEb,QAAA,IAAA,CAAA,UAAU,GAAG,SAAS,CAAC,QAAQ,CAA2B,YAAY,CAAC;;QAG/E,IAAA,CAAA,OAAO,GAAG,KAAK,CAAgB,IAAI;oFAAC;;QAEpC,IAAA,CAAA,cAAc,GAAG,KAAK,CAAgB,IAAI;2FAAC;;QAE3C,IAAA,CAAA,MAAM,GAAG,KAAK,CAAgB,IAAI;mFAAC;QACnC,IAAA,CAAA,kBAAkB,GAAG,KAAK,CAA2B,IAAI;+FAAC;QAC1D,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAA2B,IAAI;6FAAC;QACxD,IAAA,CAAA,WAAW,GA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YAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEhEzF;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mintplayer/ng-bootstrap",
3
3
  "private": false,
4
- "version": "22.12.0",
4
+ "version": "22.13.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -245,6 +245,10 @@
245
245
  "types": "./types/mintplayer-ng-bootstrap-parallax.d.ts",
246
246
  "default": "./fesm2022/mintplayer-ng-bootstrap-parallax.mjs"
247
247
  },
248
+ "./phone-input": {
249
+ "types": "./types/mintplayer-ng-bootstrap-phone-input.d.ts",
250
+ "default": "./fesm2022/mintplayer-ng-bootstrap-phone-input.mjs"
251
+ },
248
252
  "./placeholder": {
249
253
  "types": "./types/mintplayer-ng-bootstrap-placeholder.d.ts",
250
254
  "default": "./fesm2022/mintplayer-ng-bootstrap-placeholder.mjs"
@@ -0,0 +1,4 @@
1
+ {
2
+ "module": "../fesm2022/mintplayer-ng-bootstrap-phone-input.mjs",
3
+ "typings": "../types/mintplayer-ng-bootstrap-phone-input.d.ts"
4
+ }
@@ -1,8 +1,25 @@
1
- import * as i0 from '@angular/core';
1
+ import * as _angular_core from '@angular/core';
2
2
 
3
+ type BsInputGroupSize = 'sm' | 'md' | 'lg';
4
+ /**
5
+ * `<bs-input-group>` — joins its children into one visually continuous control.
6
+ *
7
+ * Now a wrapper over `<mp-input-group>`. The previous version was a
8
+ * `<div class="input-group">` plus a `::ng-deep` import of Bootstrap's module,
9
+ * which could not style a `<bs-select>`: the rules Bootstrap keys on
10
+ * `.input-group > .form-select` cannot reach inside that component's shadow root,
11
+ * so a select in a group got neither the flex sizing nor collapsed inner corners.
12
+ * The WC solves it with two channels (see `input-group.styles.scss`), which is why
13
+ * the styling moved there rather than being duplicated here.
14
+ */
3
15
  declare class BsInputGroupComponent {
4
- static ɵfac: i0.ɵɵFactoryDeclaration<BsInputGroupComponent, never>;
5
- static ɵcmp: i0.ɵɵComponentDeclaration<BsInputGroupComponent, "bs-input-group", never, {}, {}, never, ["*"], true, never>;
16
+ /** Bootstrap sizing, applied to light-DOM and `mp-*` children alike. */
17
+ readonly size: _angular_core.InputSignal<BsInputGroupSize>;
18
+ /** `md` is the absence of a size in Bootstrap, so it is not written at all. */
19
+ protected readonly sizeAttr: _angular_core.Signal<BsInputGroupSize | null>;
20
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsInputGroupComponent, never>;
21
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsInputGroupComponent, "bs-input-group", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
6
22
  }
7
23
 
8
24
  export { BsInputGroupComponent };
25
+ export type { BsInputGroupSize };
@@ -0,0 +1,60 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import { PhoneChangeEventDetail } from '@mintplayer/web-components/phone-input';
4
+ import * as i1 from '@mintplayer/ng-bootstrap/a11y';
5
+
6
+ /**
7
+ * `<bs-phone-input>` — a phone-number form control: country picker with flags,
8
+ * a dial code that cannot be edited away, and as-you-type formatting.
9
+ *
10
+ * The control value is **E.164** (`'+32470123456'`), or `null` while empty, so a
11
+ * form posts one canonical string. `(phoneChange)` carries the decomposed parts
12
+ * for consumers that need them — note `valid` is `undefined` until the selected
13
+ * country's validation rules have loaded, which is deliberate rather than
14
+ * optimistic.
15
+ *
16
+ * ```html
17
+ * <bs-form>
18
+ * <bs-phone-input [(ngModel)]="phone" default-country="be"
19
+ * [errorMessages]="{ required: 'Enter a phone number.' }" />
20
+ * </bs-form>
21
+ * ```
22
+ */
23
+ declare class BsPhoneInputComponent implements ControlValueAccessor {
24
+ private readonly destroyRef;
25
+ private onChange;
26
+ private onTouched;
27
+ /** Set by `setDisabledState` before the view exists, applied by the effect. */
28
+ private disabledByForm;
29
+ private readonly phoneInput;
30
+ /** ISO 3166-1 alpha-2, lowercase. Two-way via `(countryChange)`. */
31
+ readonly country: _angular_core.InputSignal<string | null>;
32
+ /** Country to start on when the value is empty. */
33
+ readonly defaultCountry: _angular_core.InputSignal<string | null>;
34
+ /** BCP-47 tag for country names and their ordering. Omitted = browser locale. */
35
+ readonly locale: _angular_core.InputSignal<string | null>;
36
+ readonly preferredCountries: _angular_core.InputSignal<readonly string[] | null>;
37
+ readonly allowedCountries: _angular_core.InputSignal<readonly string[] | null>;
38
+ readonly placeholder: _angular_core.InputSignal<string | null>;
39
+ readonly autocomplete: _angular_core.InputSignal<string>;
40
+ /** Accessible name of the number field. */
41
+ readonly inputLabel: _angular_core.InputSignal<string | null>;
42
+ /** Accessible name of the country picker. */
43
+ readonly countryLabel: _angular_core.InputSignal<string | null>;
44
+ readonly countryChange: _angular_core.OutputEmitterRef<string>;
45
+ /** The full detail: E.164 value plus country, dial code, digits and validity. */
46
+ readonly phoneChange: _angular_core.OutputEmitterRef<PhoneChangeEventDetail>;
47
+ protected readonly preferredAttr: _angular_core.Signal<string | null>;
48
+ protected readonly allowedAttr: _angular_core.Signal<string | null>;
49
+ constructor();
50
+ writeValue(value: string | null): void;
51
+ registerOnChange(fn: (value: string | null) => void): void;
52
+ registerOnTouched(fn: () => void): void;
53
+ setDisabledState(isDisabled: boolean): void;
54
+ protected onValueChange(ev: Event): void;
55
+ protected onCountryChange(ev: Event): void;
56
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsPhoneInputComponent, never>;
57
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsPhoneInputComponent, "bs-phone-input", never, { "country": { "alias": "country"; "required": false; "isSignal": true; }; "defaultCountry": { "alias": "defaultCountry"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "preferredCountries": { "alias": "preferredCountries"; "required": false; "isSignal": true; }; "allowedCountries": { "alias": "allowedCountries"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "autocomplete": { "alias": "autocomplete"; "required": false; "isSignal": true; }; "inputLabel": { "alias": "inputLabel"; "required": false; "isSignal": true; }; "countryLabel": { "alias": "countryLabel"; "required": false; "isSignal": true; }; }, { "countryChange": "countryChange"; "phoneChange": "phoneChange"; }, never, never, true, [{ directive: typeof i1.BsControlValidityDirective; inputs: { "errorMessages": "errorMessages"; }; outputs: {}; }]>;
58
+ }
59
+
60
+ export { BsPhoneInputComponent };