@ngstarter-ui/components 21.0.4 → 21.0.5
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/ai/component-registry.json +4 -0
- package/fesm2022/ngstarter-ui-components-logo.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-logo.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-number-input.mjs +12 -6
- package/fesm2022/ngstarter-ui-components-number-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs +60 -43
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-select.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ngstarter-ui-components-logo.d.ts +1 -1
- package/types/ngstarter-ui-components-number-input.d.ts +1 -1
- package/types/ngstarter-ui-components-phone-input.d.ts +8 -7
|
@@ -6032,6 +6032,7 @@
|
|
|
6032
6032
|
"--ngs-color-neutral-700",
|
|
6033
6033
|
"--ngs-color-surface-container",
|
|
6034
6034
|
"--ngs-color-surface-container-high",
|
|
6035
|
+
"--ngs-icon-size",
|
|
6035
6036
|
"--ngs-number-input-control-active-bg",
|
|
6036
6037
|
"--ngs-number-input-control-active-color",
|
|
6037
6038
|
"--ngs-number-input-control-bg",
|
|
@@ -6042,6 +6043,7 @@
|
|
|
6042
6043
|
"--ngs-number-input-control-hover-bg",
|
|
6043
6044
|
"--ngs-number-input-control-hover-color",
|
|
6044
6045
|
"--ngs-number-input-control-size",
|
|
6046
|
+
"--ngs-number-input-controls-wdith",
|
|
6045
6047
|
"--ngs-number-input-gap",
|
|
6046
6048
|
"--ngs-number-input-suffix-gap",
|
|
6047
6049
|
"--ngs-radius-md"
|
|
@@ -7314,6 +7316,8 @@
|
|
|
7314
7316
|
"--ngs-field-label-color",
|
|
7315
7317
|
"--ngs-field-line-height",
|
|
7316
7318
|
"--ngs-select-arrow-color",
|
|
7319
|
+
"--ngs-select-arrow-container-width",
|
|
7320
|
+
"--ngs-select-arrow-size",
|
|
7317
7321
|
"--ngs-select-border-color",
|
|
7318
7322
|
"--ngs-select-content-padding",
|
|
7319
7323
|
"--ngs-select-font-size",
|
|
@@ -3,13 +3,13 @@ import { Component, input } from '@angular/core';
|
|
|
3
3
|
|
|
4
4
|
class Logo {
|
|
5
5
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: Logo, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: Logo, isStandalone: true, selector: "ngs-logo,[ngs-logo]", host: { classAttribute: "ngs-logo" }, exportAs: ["ngsLogo"], ngImport: i0, template: "<ng-content select=\"ngs-logo-shape\"/>\n<div class=\"content\">\n <ng-content select=\"ngs-logo-text\"/>\n <ng-content select=\"ngs-logo-description\"/>\n
|
|
6
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: Logo, isStandalone: true, selector: "ngs-logo,[ngs-logo]", host: { classAttribute: "ngs-logo" }, exportAs: ["ngsLogo"], ngImport: i0, template: "<ng-content select=\"ngs-logo-shape\"/>\n<div class=\"content\">\n <ng-content/>\n <ng-content select=\"ngs-logo-text\"/>\n <ng-content select=\"ngs-logo-description\"/>\n</div>\n", styles: [":host{--ngs-logo-text-font-size: var(--ngs-font-size-xl);--ngs-logo-text-font-weight: 800;--ngs-logo-text-color: var(--ngs-color-primary);--ngs-logo-text-hover-color: var(--ngs-color-tertiary);display:inline-flex;align-items:center;gap:calc(var(--spacing, .25rem) * 3)}:host:hover{filter:brightness(110%)}:host .content{display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 1)}:host .content:empty{display:none}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] });
|
|
7
7
|
}
|
|
8
8
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: Logo, decorators: [{
|
|
9
9
|
type: Component,
|
|
10
10
|
args: [{ selector: 'ngs-logo,[ngs-logo]', exportAs: 'ngsLogo', imports: [], host: {
|
|
11
11
|
'class': 'ngs-logo',
|
|
12
|
-
}, template: "<ng-content select=\"ngs-logo-shape\"/>\n<div class=\"content\">\n <ng-content select=\"ngs-logo-text\"/>\n <ng-content select=\"ngs-logo-description\"/>\n
|
|
12
|
+
}, template: "<ng-content select=\"ngs-logo-shape\"/>\n<div class=\"content\">\n <ng-content/>\n <ng-content select=\"ngs-logo-text\"/>\n <ng-content select=\"ngs-logo-description\"/>\n</div>\n", styles: [":host{--ngs-logo-text-font-size: var(--ngs-font-size-xl);--ngs-logo-text-font-weight: 800;--ngs-logo-text-color: var(--ngs-color-primary);--ngs-logo-text-hover-color: var(--ngs-color-tertiary);display:inline-flex;align-items:center;gap:calc(var(--spacing, .25rem) * 3)}:host:hover{filter:brightness(110%)}:host .content{display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 1)}:host .content:empty{display:none}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
13
13
|
}] });
|
|
14
14
|
|
|
15
15
|
class LogoShape {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-logo.mjs","sources":["../../../projects/components/logo/src/logo/logo.ts","../../../projects/components/logo/src/logo/logo.html","../../../projects/components/logo/src/logo-shape/logo-shape.ts","../../../projects/components/logo/src/logo-shape/logo-shape.html","../../../projects/components/logo/src/logo-text/logo-text.ts","../../../projects/components/logo/src/logo-text/logo-text.html","../../../projects/components/logo/src/logo-description/logo-description.ts","../../../projects/components/logo/src/logo-description/logo-description.html","../../../projects/components/logo/ngstarter-ui-components-logo.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'ngs-logo,[ngs-logo]',\n exportAs: 'ngsLogo',\n imports: [],\n templateUrl: './logo.html',\n styleUrl: './logo.scss',\n host: {\n 'class': 'ngs-logo',\n }\n})\nexport class Logo {\n\n}\n","<ng-content select=\"ngs-logo-shape\"/>\n<div class=\"content\">\n <ng-content select=\"ngs-logo-text\"/>\n <ng-content select=\"ngs-logo-description\"/>\n
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-logo.mjs","sources":["../../../projects/components/logo/src/logo/logo.ts","../../../projects/components/logo/src/logo/logo.html","../../../projects/components/logo/src/logo-shape/logo-shape.ts","../../../projects/components/logo/src/logo-shape/logo-shape.html","../../../projects/components/logo/src/logo-text/logo-text.ts","../../../projects/components/logo/src/logo-text/logo-text.html","../../../projects/components/logo/src/logo-description/logo-description.ts","../../../projects/components/logo/src/logo-description/logo-description.html","../../../projects/components/logo/ngstarter-ui-components-logo.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'ngs-logo,[ngs-logo]',\n exportAs: 'ngsLogo',\n imports: [],\n templateUrl: './logo.html',\n styleUrl: './logo.scss',\n host: {\n 'class': 'ngs-logo',\n }\n})\nexport class Logo {\n\n}\n","<ng-content select=\"ngs-logo-shape\"/>\n<div class=\"content\">\n <ng-content/>\n <ng-content select=\"ngs-logo-text\"/>\n <ng-content select=\"ngs-logo-description\"/>\n</div>\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'ngs-logo-shape',\n imports: [],\n templateUrl: './logo-shape.html',\n styleUrl: './logo-shape.scss',\n})\nexport class LogoShape {\n\n}\n","<ng-content select=\"img\"/>\n","import { Component, input } from '@angular/core';\nimport { LogoTextSize } from '../types';\n\n@Component({\n selector: 'ngs-logo-text',\n exportAs: 'ngsLogoText',\n templateUrl: './logo-text.html',\n styleUrl: './logo-text.scss',\n host: {\n 'class': 'ngs-logo-text',\n '[attr.data-size]': 'size()',\n }\n})\nexport class LogoText {\n readonly size = input<LogoTextSize>('default');\n}\n","<ng-content/>\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'ngs-logo-description',\n imports: [],\n templateUrl: './logo-description.html',\n styleUrl: './logo-description.scss',\n})\nexport class LogoDescription {\n\n}\n","<ng-content/>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAYa,IAAI,CAAA;uGAAJ,IAAI,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAJ,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,IAAI,4ICZjB,wLAMA,EAAA,MAAA,EAAA,CAAA,ifAAA,CAAA,EAAA,CAAA;;2FDMa,IAAI,EAAA,UAAA,EAAA,CAAA;kBAVhB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,EAAA,QAAA,EACrB,SAAS,EAAA,OAAA,EACV,EAAE,EAAA,IAAA,EAGL;AACJ,wBAAA,OAAO,EAAE,UAAU;AACpB,qBAAA,EAAA,QAAA,EAAA,wLAAA,EAAA,MAAA,EAAA,CAAA,ifAAA,CAAA,EAAA;;;MEFU,SAAS,CAAA;uGAAT,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAT,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,SAAS,0ECRtB,gCACA,EAAA,MAAA,EAAA,CAAA,mZAAA,CAAA,EAAA,CAAA;;2FDOa,SAAS,EAAA,UAAA,EAAA,CAAA;kBANrB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,WACjB,EAAE,EAAA,QAAA,EAAA,gCAAA,EAAA,MAAA,EAAA,CAAA,mZAAA,CAAA,EAAA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ef, viewChild, contentChild, input, numberAttribute, booleanAttribute, signal, output, computed, effect, forwardRef, Optional, Self, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { inject, TemplateRef, Directive, ElementRef, viewChild, contentChild, input, numberAttribute, booleanAttribute, signal, output, computed, effect, forwardRef, HostListener, Optional, Self, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { NgForm, FormGroupDirective } from '@angular/forms';
|
|
5
5
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
@@ -117,7 +117,7 @@ class NumberInput {
|
|
|
117
117
|
const controlElement = this._elementRef.nativeElement;
|
|
118
118
|
controlElement.setAttribute('aria-describedby', ids.join(' '));
|
|
119
119
|
}
|
|
120
|
-
onFocusIn(
|
|
120
|
+
onFocusIn() {
|
|
121
121
|
if (!this._focused()) {
|
|
122
122
|
this._focused.set(true);
|
|
123
123
|
this.stateChanges.next();
|
|
@@ -231,12 +231,12 @@ class NumberInput {
|
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: NumberInput, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
234
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: NumberInput, isStandalone: true, selector: "ngs-number-input", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, requiredInput: { classPropertyName: "requiredInput", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, _placeholder: { classPropertyName: "_placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { attributes: { "id": "id" }, properties: { "class.floating": "shouldLabelFloat" }, classAttribute: "ngs-number-input" }, providers: [
|
|
234
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: NumberInput, isStandalone: true, selector: "ngs-number-input", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, requiredInput: { classPropertyName: "requiredInput", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, _placeholder: { classPropertyName: "_placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { attributes: { "id": "id" }, listeners: { "focusin": "onFocusIn()", "focusout": "onFocusOut($event)" }, properties: { "class.floating": "shouldLabelFloat" }, classAttribute: "ngs-number-input" }, providers: [
|
|
235
235
|
{
|
|
236
236
|
provide: FormFieldControl,
|
|
237
237
|
useExisting: forwardRef(() => NumberInput),
|
|
238
238
|
}
|
|
239
|
-
], queries: [{ propertyName: "_decreaseControlRef", first: true, predicate: DecreaseControlDirective, descendants: true, isSignal: true }, { propertyName: "_increaseControlRef", first: true, predicate: IncreaseControlDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_input", first: true, predicate: ["input"], descendants: true, isSignal: true }], exportAs: ["ngsNumberInput"], ngImport: i0, template: "<input #input type=\"number\" class=\"input\"\n
|
|
239
|
+
], queries: [{ propertyName: "_decreaseControlRef", first: true, predicate: DecreaseControlDirective, descendants: true, isSignal: true }, { propertyName: "_increaseControlRef", first: true, predicate: IncreaseControlDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_input", first: true, predicate: ["input"], descendants: true, isSignal: true }], exportAs: ["ngsNumberInput"], ngImport: i0, template: "<input #input type=\"number\" class=\"number-input\"\n [attr.min]=\"min()\"\n [attr.max]=\"max()\"\n [step]=\"step()\"\n (input)=\"inputChange($event)\">\n<div class=\"controls\">\n <button class=\"control control-decrease\" ngsRipple [disabled]=\"isDecreaseDisabled()\" (click)=\"decrease($event, input)\">\n @if (_decreaseControlRef()) {\n <ng-template [ngTemplateOutlet]=\"_decreaseControlTemplateRef\"/>\n } @else {\n <svg class=\"control-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M3.5 8h9\"/>\n </svg>\n }\n </button>\n <button class=\"control control-increase\" ngsRipple [disabled]=\"isIncreaseDisabled()\" (click)=\"increase($event, input)\">\n @if (_increaseControlRef()) {\n <ng-template [ngTemplateOutlet]=\"_increaseControlTemplateRef\"/>\n } @else {\n <svg class=\"control-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M8 3.5v9M3.5 8h9\"/>\n </svg>\n }\n </button>\n</div>\n", styles: [":host{--ngs-number-input-gap: calc(var(--spacing, .25rem) * 2);--ngs-number-input-control-bg: none;--ngs-number-input-control-color: var(--ngs-color-neutral-500);--ngs-number-input-control-hover-color: var(--ngs-color-neutral-600);--ngs-number-input-control-active-color: var(--ngs-color-neutral-700);--ngs-number-input-control-hover-bg: var(--ngs-color-surface-container);--ngs-number-input-control-active-bg: var(--ngs-color-surface-container-high);--ngs-number-input-control-font-size: 1.5rem;--ngs-number-input-control-border-radius: var(--ngs-radius-md);--ngs-number-input-suffix-gap: calc(var(--spacing, .25rem) * 3);--ngs-number-input-control-size: calc(var(--spacing, .25rem) * 7);--ngs-number-input-control-border: none;--ngs-number-input-controls-wdith: calc(var(--spacing, .25rem) * 16);display:flex!important;gap:var(--ngs-number-input-gap);padding-right:var(--ngs-number-input-controls-wdith)}:host .number-input{width:auto;max-width:none;flex-grow:1;min-width:0;background:none;outline:none;color:currentColor;font:inherit;border:none}:host .number-input::-webkit-outer-spin-button,:host .number-input::-webkit-inner-spin-button{appearance:none;margin:0}:host .controls{gap:.375rem;-webkit-user-select:none;user-select:none;position:absolute;top:0;bottom:0;right:0;display:flex;align-items:center;justify-content:center}:host .control{cursor:pointer;flex:none;display:flex;align-items:center;justify-content:center;width:var(--ngs-number-input-control-size);height:var(--ngs-number-input-control-size);background:var(--ngs-number-input-control-bg);color:var(--ngs-number-input-control-color);font-size:var(--ngs-number-input-control-font-size);line-height:var(--ngs-number-input-control-font-size);border-radius:var(--ngs-number-input-control-border-radius);position:relative;border:var(--ngs-number-input-control-border);top:1px}:host .control .control-icon{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1;stroke-linecap:round;stroke-linejoin:round}:host .control ::ng-deep ngs-icon{--ngs-icon-size: calc(var(--spacing, .25rem) * 5)}:host .control:hover{background:var(--ngs-number-input-control-hover-bg);color:var(--ngs-number-input-control-hover-color)}:host .control[disabled]{pointer-events:none;opacity:.65}:host-context(html.dark){--ngs-number-input-control-color: var(--ngs-color-neutral-300);--ngs-number-input-control-hover-color: var(--ngs-color-neutral-200);--ngs-number-input-control-hover-bg: var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: Ripple, selector: "[ngsRipple]", inputs: ["ngsRippleColor", "ngsRippleUnbounded", "ngsRippleCentered", "ngsRippleRadius", "ngsRippleAnimation", "ngsRippleDisabled", "ngsRippleTrigger"], outputs: ["ngsRippleCenteredChange", "ngsRippleDisabledChange", "ngsRippleTriggerChange"], exportAs: ["ngsRipple"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
240
240
|
}
|
|
241
241
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: NumberInput, decorators: [{
|
|
242
242
|
type: Component,
|
|
@@ -252,12 +252,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
252
252
|
'class': 'ngs-number-input',
|
|
253
253
|
'[class.floating]': 'shouldLabelFloat',
|
|
254
254
|
'id': 'id'
|
|
255
|
-
}, template: "<input #input type=\"number\" class=\"input\"\n
|
|
255
|
+
}, template: "<input #input type=\"number\" class=\"number-input\"\n [attr.min]=\"min()\"\n [attr.max]=\"max()\"\n [step]=\"step()\"\n (input)=\"inputChange($event)\">\n<div class=\"controls\">\n <button class=\"control control-decrease\" ngsRipple [disabled]=\"isDecreaseDisabled()\" (click)=\"decrease($event, input)\">\n @if (_decreaseControlRef()) {\n <ng-template [ngTemplateOutlet]=\"_decreaseControlTemplateRef\"/>\n } @else {\n <svg class=\"control-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M3.5 8h9\"/>\n </svg>\n }\n </button>\n <button class=\"control control-increase\" ngsRipple [disabled]=\"isIncreaseDisabled()\" (click)=\"increase($event, input)\">\n @if (_increaseControlRef()) {\n <ng-template [ngTemplateOutlet]=\"_increaseControlTemplateRef\"/>\n } @else {\n <svg class=\"control-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M8 3.5v9M3.5 8h9\"/>\n </svg>\n }\n </button>\n</div>\n", styles: [":host{--ngs-number-input-gap: calc(var(--spacing, .25rem) * 2);--ngs-number-input-control-bg: none;--ngs-number-input-control-color: var(--ngs-color-neutral-500);--ngs-number-input-control-hover-color: var(--ngs-color-neutral-600);--ngs-number-input-control-active-color: var(--ngs-color-neutral-700);--ngs-number-input-control-hover-bg: var(--ngs-color-surface-container);--ngs-number-input-control-active-bg: var(--ngs-color-surface-container-high);--ngs-number-input-control-font-size: 1.5rem;--ngs-number-input-control-border-radius: var(--ngs-radius-md);--ngs-number-input-suffix-gap: calc(var(--spacing, .25rem) * 3);--ngs-number-input-control-size: calc(var(--spacing, .25rem) * 7);--ngs-number-input-control-border: none;--ngs-number-input-controls-wdith: calc(var(--spacing, .25rem) * 16);display:flex!important;gap:var(--ngs-number-input-gap);padding-right:var(--ngs-number-input-controls-wdith)}:host .number-input{width:auto;max-width:none;flex-grow:1;min-width:0;background:none;outline:none;color:currentColor;font:inherit;border:none}:host .number-input::-webkit-outer-spin-button,:host .number-input::-webkit-inner-spin-button{appearance:none;margin:0}:host .controls{gap:.375rem;-webkit-user-select:none;user-select:none;position:absolute;top:0;bottom:0;right:0;display:flex;align-items:center;justify-content:center}:host .control{cursor:pointer;flex:none;display:flex;align-items:center;justify-content:center;width:var(--ngs-number-input-control-size);height:var(--ngs-number-input-control-size);background:var(--ngs-number-input-control-bg);color:var(--ngs-number-input-control-color);font-size:var(--ngs-number-input-control-font-size);line-height:var(--ngs-number-input-control-font-size);border-radius:var(--ngs-number-input-control-border-radius);position:relative;border:var(--ngs-number-input-control-border);top:1px}:host .control .control-icon{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1;stroke-linecap:round;stroke-linejoin:round}:host .control ::ng-deep ngs-icon{--ngs-icon-size: calc(var(--spacing, .25rem) * 5)}:host .control:hover{background:var(--ngs-number-input-control-hover-bg);color:var(--ngs-number-input-control-hover-color)}:host .control[disabled]{pointer-events:none;opacity:.65}:host-context(html.dark){--ngs-number-input-control-color: var(--ngs-color-neutral-300);--ngs-number-input-control-hover-color: var(--ngs-color-neutral-200);--ngs-number-input-control-hover-bg: var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
256
256
|
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
257
257
|
type: Optional
|
|
258
258
|
}, {
|
|
259
259
|
type: Self
|
|
260
|
-
}] }], propDecorators: { _input: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], _decreaseControlRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DecreaseControlDirective), { isSignal: true }] }], _increaseControlRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => IncreaseControlDirective), { isSignal: true }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], requiredInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], _placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }]
|
|
260
|
+
}] }], propDecorators: { _input: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], _decreaseControlRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DecreaseControlDirective), { isSignal: true }] }], _increaseControlRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => IncreaseControlDirective), { isSignal: true }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], requiredInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], _placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], onFocusIn: [{
|
|
261
|
+
type: HostListener,
|
|
262
|
+
args: ['focusin']
|
|
263
|
+
}], onFocusOut: [{
|
|
264
|
+
type: HostListener,
|
|
265
|
+
args: ['focusout', ['$event']]
|
|
266
|
+
}] } });
|
|
261
267
|
|
|
262
268
|
class NumberInputPrefixDirective {
|
|
263
269
|
templateRef = inject(TemplateRef);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-number-input.mjs","sources":["../../../projects/components/number-input/src/decrease-control.directive.ts","../../../projects/components/number-input/src/increase-control.directive.ts","../../../projects/components/number-input/src/number-input/number-input.ts","../../../projects/components/number-input/src/number-input/number-input.html","../../../projects/components/number-input/src/number-input-prefix.directive.ts","../../../projects/components/number-input/src/number-input-suffix.directive.ts","../../../projects/components/number-input/ngstarter-ui-components-number-input.ts"],"sourcesContent":["import { Directive, inject, TemplateRef } from '@angular/core';\n\n@Directive({\n selector: '[ngsDecreaseControl]',\n exportAs: 'ngsDecreaseControl'\n})\nexport class DecreaseControlDirective {\n readonly templateRef = inject(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n@Directive({\n selector: '[ngsIncreaseControl]',\n exportAs: 'ngsIncreaseControl'\n})\nexport class IncreaseControlDirective {\n readonly templateRef = inject(TemplateRef);\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n contentChild,\n DoCheck,\n ElementRef, forwardRef,\n inject, Input, input,\n numberAttribute,\n OnDestroy, Optional,\n output, Self,\n TemplateRef,\n viewChild,\n signal,\n computed,\n effect,\n} from '@angular/core';\nimport { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DecreaseControlDirective } from '../decrease-control.directive';\nimport { IncreaseControlDirective } from '../increase-control.directive';\nimport { FormFieldControl } from '@ngstarter-ui/components/form-field';\nimport { Subject } from 'rxjs';\nimport { Ripple } from '@ngstarter-ui/components/core';\nimport { NgTemplateOutlet } from '@angular/common';\n\n@Component({\n selector: 'ngs-number-input',\n exportAs: 'ngsNumberInput',\n imports: [\n Ripple,\n NgTemplateOutlet\n ],\n providers: [\n {\n provide: FormFieldControl,\n useExisting: forwardRef(() => NumberInput),\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './number-input.html',\n styleUrl: './number-input.scss',\n host: {\n 'class': 'ngs-number-input',\n '[class.floating]': 'shouldLabelFloat',\n 'id': 'id'\n }\n})\nexport class NumberInput implements FormFieldControl<any>, ControlValueAccessor, OnDestroy, DoCheck {\n private _parentForm = inject(NgForm, {\n optional: true,\n });\n private _parentFormGroup = inject(FormGroupDirective, {\n optional: true,\n });\n private _elementRef = inject(ElementRef);\n readonly disableAutomaticLabeling: boolean = false;\n\n private _input = viewChild.required<ElementRef>('input');\n readonly _decreaseControlRef = contentChild<DecreaseControlDirective>(DecreaseControlDirective);\n readonly _increaseControlRef = contentChild<IncreaseControlDirective>(IncreaseControlDirective);\n\n min = input(undefined, {\n transform: numberAttribute\n });\n max = input(undefined, {\n transform: numberAttribute\n });\n step = input(1, {\n transform: numberAttribute\n });\n readonly = input(false, {\n transform: booleanAttribute\n });\n\n disabledInput = input(false, {\n transform: booleanAttribute,\n alias: 'disabled'\n });\n get disabled(): boolean {\n return this.disabledInput() || this._disabled();\n }\n private _disabled = signal(false);\n\n requiredInput = input(false, {\n transform: booleanAttribute,\n alias: 'required'\n });\n get required(): boolean {\n return this.requiredInput() || this._required();\n }\n private _required = signal(false);\n\n readonly valueChange = output<number|undefined>();\n\n static nextId = 0;\n private _value = signal<number | undefined>(undefined);\n controlType?: string | undefined;\n autofilled?: boolean | undefined;\n userAriaDescribedBy?: string | undefined;\n stateChanges = new Subject<void>();\n focused = false;\n private _focused = signal(false);\n touched = false;\n errorState = false;\n private _errorState = signal(false);\n\n id = '';\n private _id = signal(`ngs-number-input${NumberInput.nextId++}`);\n\n shouldLabelFloat = false;\n private _shouldLabelFloat = computed(() => {\n return this._focused() || !this._empty();\n });\n\n empty = true;\n private _empty = computed(() => {\n const value = this._value();\n return value === undefined || value === null || value as any === '';\n });\n\n _placeholder = input<string>('', { alias: 'placeholder' });\n get placeholder(): string {\n return this._placeholder();\n }\n\n constructor(\n @Optional() @Self() public ngControl: NgControl,\n ) {\n // Replace the provider from above with this.\n if (this.ngControl != null) {\n // Setting the value accessor directly (instead of using\n // the providers) to avoid running into a circular import.\n this.ngControl.valueAccessor = this;\n }\n\n effect(() => {\n this.id = this._id();\n this.focused = this._focused();\n this.errorState = this._errorState();\n this.empty = this._empty();\n this.shouldLabelFloat = this._shouldLabelFloat();\n this.stateChanges.next();\n });\n\n effect(() => {\n const value = this._value();\n\n if (this._input()) {\n this._input().nativeElement.value = (value === undefined || value === null) ? '' : value;\n }\n });\n }\n\n setDescribedByIds(ids: string[]) {\n const controlElement = this._elementRef.nativeElement;\n controlElement.setAttribute('aria-describedby', ids.join(' '));\n }\n\n onFocusIn(event: FocusEvent) {\n if (!this._focused()) {\n this._focused.set(true);\n this.stateChanges.next();\n }\n }\n\n onFocusOut(event: FocusEvent) {\n if (!this._elementRef.nativeElement.contains(event.relatedTarget as Element)) {\n this.touched = true;\n this._focused.set(false);\n this.onTouched();\n this.stateChanges.next();\n }\n }\n\n set value(value: number | undefined) {\n if (value !== this._value()) {\n this._value.set(value);\n this.stateChanges.next();\n }\n }\n get value(): number | undefined {\n return this._value();\n }\n\n ngOnDestroy() {\n this.stateChanges.complete();\n }\n\n protected get _decreaseControlTemplateRef() {\n return this._decreaseControlRef()?.templateRef as TemplateRef<any>;\n }\n\n protected get _increaseControlTemplateRef() {\n return this._increaseControlRef()?.templateRef as TemplateRef<any>;\n }\n\n onChange: any = () => {};\n onTouched: any = () => {};\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this._disabled.set(coerceBooleanProperty(isDisabled));\n }\n\n writeValue(value: any): void {\n this.value = value;\n }\n\n decrease(event: MouseEvent, input: HTMLInputElement) {\n event.preventDefault();\n event.stopPropagation();\n let value = this._value() ?? 0;\n value -= this.step();\n this._value.set(value);\n this._emitEvent();\n }\n\n increase(event: MouseEvent, input: HTMLInputElement) {\n event.preventDefault();\n event.stopPropagation();\n let value = this._value() ?? 0;\n value += this.step();\n this._value.set(value);\n this._emitEvent();\n }\n\n isDecreaseDisabled() {\n const value = this._value();\n\n if (this.min() === undefined) {\n return false;\n }\n\n return (value !== undefined && value <= (this.min() as number)) || this.readonly() || this.disabled;\n }\n\n isIncreaseDisabled() {\n const value = this._value();\n\n if (this.max() === undefined) {\n return false;\n }\n\n return (value !== undefined && value >= (this.max() as number)) || this.readonly() || this.disabled;\n }\n\n inputChange(event: any) {\n const inputValue = event.target.value;\n const value = inputValue === '' ? undefined : +inputValue;\n this._value.set(value);\n this._emitEvent();\n }\n\n private _emitEvent() {\n const value = this._value();\n\n this.onChange(value);\n this.valueChange.emit(value);\n this.updateErrorState();\n }\n\n ngDoCheck() {\n if (this.ngControl) {\n this.updateErrorState();\n }\n }\n\n focus(): void {\n this._input().nativeElement.focus();\n }\n\n onContainerClick(event: MouseEvent) {\n if ((event.target as Element).tagName.toLowerCase() != 'input') {\n this.focus();\n }\n }\n\n private updateErrorState() {\n const parent = this._parentFormGroup || this._parentForm;\n let oldState = this._errorState();\n let newState = !!(this.ngControl?.invalid) && this.touched;\n\n if (parent) {\n newState = !!(this.ngControl?.invalid) && (this.touched || parent.submitted);\n }\n\n if (oldState !== newState) {\n this._errorState.set(newState);\n this.stateChanges.next();\n }\n }\n}\n","<input #input type=\"number\" class=\"input\"\n (focusin)=\"onFocusIn($event)\"\n (focusout)=\"onFocusOut($event)\"\n [attr.min]=\"min()\"\n [attr.max]=\"max()\"\n [step]=\"step()\"\n (input)=\"inputChange($event)\">\n<div class=\"controls\">\n <button class=\"control control-decrease\" ngsRipple [disabled]=\"isDecreaseDisabled()\" (click)=\"decrease($event, input)\">\n @if (_decreaseControlRef()) {\n <ng-template [ngTemplateOutlet]=\"_decreaseControlTemplateRef\"/>\n } @else {\n <span>−</span>\n }\n </button>\n <button class=\"control control-increase\" ngsRipple [disabled]=\"isIncreaseDisabled()\" (click)=\"increase($event, input)\">\n @if (_increaseControlRef()) {\n <ng-template [ngTemplateOutlet]=\"_increaseControlTemplateRef\"/>\n } @else {\n <span>+</span>\n }\n </button>\n</div>\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n@Directive({\n selector: '[ngsNumberInputPrefix]',\n exportAs: 'ngsNumberInputPrefix'\n})\nexport class NumberInputPrefixDirective {\n readonly templateRef = inject(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n@Directive({\n selector: '[ngsNumberInputSuffix]',\n exportAs: 'ngsNumberInputSuffix'\n})\nexport class NumberInputSuffixDirective {\n readonly templateRef = inject(TemplateRef);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAMa,wBAAwB,CAAA;AAC1B,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;uGAD/B,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAxB,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,QAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,QAAQ,EAAE;AACX,iBAAA;;;MCCY,wBAAwB,CAAA;AAC1B,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;uGAD/B,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,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CAAA;AAC5B,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;uGAD/B,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,QAAA,EAAA,CAAA,sBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAJtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,QAAQ,EAAE;AACX,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-number-input.mjs","sources":["../../../projects/components/number-input/src/decrease-control.directive.ts","../../../projects/components/number-input/src/increase-control.directive.ts","../../../projects/components/number-input/src/number-input/number-input.ts","../../../projects/components/number-input/src/number-input/number-input.html","../../../projects/components/number-input/src/number-input-prefix.directive.ts","../../../projects/components/number-input/src/number-input-suffix.directive.ts","../../../projects/components/number-input/ngstarter-ui-components-number-input.ts"],"sourcesContent":["import { Directive, inject, TemplateRef } from '@angular/core';\n\n@Directive({\n selector: '[ngsDecreaseControl]',\n exportAs: 'ngsDecreaseControl'\n})\nexport class DecreaseControlDirective {\n readonly templateRef = inject(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n@Directive({\n selector: '[ngsIncreaseControl]',\n exportAs: 'ngsIncreaseControl'\n})\nexport class IncreaseControlDirective {\n readonly templateRef = inject(TemplateRef);\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n contentChild,\n DoCheck,\n ElementRef, forwardRef,\n inject, Input, input,\n numberAttribute,\n OnDestroy, Optional,\n output, Self,\n TemplateRef,\n viewChild,\n signal,\n computed,\n effect,\n HostListener,\n} from '@angular/core';\nimport { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DecreaseControlDirective } from '../decrease-control.directive';\nimport { IncreaseControlDirective } from '../increase-control.directive';\nimport { FormFieldControl } from '@ngstarter-ui/components/form-field';\nimport { Subject } from 'rxjs';\nimport { Ripple } from '@ngstarter-ui/components/core';\nimport { NgTemplateOutlet } from '@angular/common';\n\n@Component({\n selector: 'ngs-number-input',\n exportAs: 'ngsNumberInput',\n imports: [\n Ripple,\n NgTemplateOutlet\n ],\n providers: [\n {\n provide: FormFieldControl,\n useExisting: forwardRef(() => NumberInput),\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './number-input.html',\n styleUrl: './number-input.scss',\n host: {\n 'class': 'ngs-number-input',\n '[class.floating]': 'shouldLabelFloat',\n 'id': 'id'\n }\n})\nexport class NumberInput implements FormFieldControl<any>, ControlValueAccessor, OnDestroy, DoCheck {\n private _parentForm = inject(NgForm, {\n optional: true,\n });\n private _parentFormGroup = inject(FormGroupDirective, {\n optional: true,\n });\n private _elementRef = inject(ElementRef);\n readonly disableAutomaticLabeling: boolean = false;\n\n private _input = viewChild.required<ElementRef>('input');\n readonly _decreaseControlRef = contentChild<DecreaseControlDirective>(DecreaseControlDirective);\n readonly _increaseControlRef = contentChild<IncreaseControlDirective>(IncreaseControlDirective);\n\n min = input(undefined, {\n transform: numberAttribute\n });\n max = input(undefined, {\n transform: numberAttribute\n });\n step = input(1, {\n transform: numberAttribute\n });\n readonly = input(false, {\n transform: booleanAttribute\n });\n\n disabledInput = input(false, {\n transform: booleanAttribute,\n alias: 'disabled'\n });\n get disabled(): boolean {\n return this.disabledInput() || this._disabled();\n }\n private _disabled = signal(false);\n\n requiredInput = input(false, {\n transform: booleanAttribute,\n alias: 'required'\n });\n get required(): boolean {\n return this.requiredInput() || this._required();\n }\n private _required = signal(false);\n\n readonly valueChange = output<number|undefined>();\n\n static nextId = 0;\n private _value = signal<number | undefined>(undefined);\n controlType?: string | undefined;\n autofilled?: boolean | undefined;\n userAriaDescribedBy?: string | undefined;\n stateChanges = new Subject<void>();\n focused = false;\n private _focused = signal(false);\n touched = false;\n errorState = false;\n private _errorState = signal(false);\n\n id = '';\n private _id = signal(`ngs-number-input${NumberInput.nextId++}`);\n\n shouldLabelFloat = false;\n private _shouldLabelFloat = computed(() => {\n return this._focused() || !this._empty();\n });\n\n empty = true;\n private _empty = computed(() => {\n const value = this._value();\n return value === undefined || value === null || value as any === '';\n });\n\n _placeholder = input<string>('', { alias: 'placeholder' });\n get placeholder(): string {\n return this._placeholder();\n }\n\n constructor(\n @Optional() @Self() public ngControl: NgControl,\n ) {\n // Replace the provider from above with this.\n if (this.ngControl != null) {\n // Setting the value accessor directly (instead of using\n // the providers) to avoid running into a circular import.\n this.ngControl.valueAccessor = this;\n }\n\n effect(() => {\n this.id = this._id();\n this.focused = this._focused();\n this.errorState = this._errorState();\n this.empty = this._empty();\n this.shouldLabelFloat = this._shouldLabelFloat();\n this.stateChanges.next();\n });\n\n effect(() => {\n const value = this._value();\n\n if (this._input()) {\n this._input().nativeElement.value = (value === undefined || value === null) ? '' : value;\n }\n });\n }\n\n setDescribedByIds(ids: string[]) {\n const controlElement = this._elementRef.nativeElement;\n controlElement.setAttribute('aria-describedby', ids.join(' '));\n }\n\n @HostListener('focusin')\n onFocusIn() {\n if (!this._focused()) {\n this._focused.set(true);\n this.stateChanges.next();\n }\n }\n\n @HostListener('focusout', ['$event'])\n onFocusOut(event: FocusEvent) {\n if (!this._elementRef.nativeElement.contains(event.relatedTarget as Element)) {\n this.touched = true;\n this._focused.set(false);\n this.onTouched();\n this.stateChanges.next();\n }\n }\n\n set value(value: number | undefined) {\n if (value !== this._value()) {\n this._value.set(value);\n this.stateChanges.next();\n }\n }\n get value(): number | undefined {\n return this._value();\n }\n\n ngOnDestroy() {\n this.stateChanges.complete();\n }\n\n protected get _decreaseControlTemplateRef() {\n return this._decreaseControlRef()?.templateRef as TemplateRef<any>;\n }\n\n protected get _increaseControlTemplateRef() {\n return this._increaseControlRef()?.templateRef as TemplateRef<any>;\n }\n\n onChange: any = () => {};\n onTouched: any = () => {};\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this._disabled.set(coerceBooleanProperty(isDisabled));\n }\n\n writeValue(value: any): void {\n this.value = value;\n }\n\n decrease(event: MouseEvent, input: HTMLInputElement) {\n event.preventDefault();\n event.stopPropagation();\n let value = this._value() ?? 0;\n value -= this.step();\n this._value.set(value);\n this._emitEvent();\n }\n\n increase(event: MouseEvent, input: HTMLInputElement) {\n event.preventDefault();\n event.stopPropagation();\n let value = this._value() ?? 0;\n value += this.step();\n this._value.set(value);\n this._emitEvent();\n }\n\n isDecreaseDisabled() {\n const value = this._value();\n\n if (this.min() === undefined) {\n return false;\n }\n\n return (value !== undefined && value <= (this.min() as number)) || this.readonly() || this.disabled;\n }\n\n isIncreaseDisabled() {\n const value = this._value();\n\n if (this.max() === undefined) {\n return false;\n }\n\n return (value !== undefined && value >= (this.max() as number)) || this.readonly() || this.disabled;\n }\n\n inputChange(event: any) {\n const inputValue = event.target.value;\n const value = inputValue === '' ? undefined : +inputValue;\n this._value.set(value);\n this._emitEvent();\n }\n\n private _emitEvent() {\n const value = this._value();\n\n this.onChange(value);\n this.valueChange.emit(value);\n this.updateErrorState();\n }\n\n ngDoCheck() {\n if (this.ngControl) {\n this.updateErrorState();\n }\n }\n\n focus(): void {\n this._input().nativeElement.focus();\n }\n\n onContainerClick(event: MouseEvent) {\n if ((event.target as Element).tagName.toLowerCase() != 'input') {\n this.focus();\n }\n }\n\n private updateErrorState() {\n const parent = this._parentFormGroup || this._parentForm;\n let oldState = this._errorState();\n let newState = !!(this.ngControl?.invalid) && this.touched;\n\n if (parent) {\n newState = !!(this.ngControl?.invalid) && (this.touched || parent.submitted);\n }\n\n if (oldState !== newState) {\n this._errorState.set(newState);\n this.stateChanges.next();\n }\n }\n}\n","<input #input type=\"number\" class=\"number-input\"\n [attr.min]=\"min()\"\n [attr.max]=\"max()\"\n [step]=\"step()\"\n (input)=\"inputChange($event)\">\n<div class=\"controls\">\n <button class=\"control control-decrease\" ngsRipple [disabled]=\"isDecreaseDisabled()\" (click)=\"decrease($event, input)\">\n @if (_decreaseControlRef()) {\n <ng-template [ngTemplateOutlet]=\"_decreaseControlTemplateRef\"/>\n } @else {\n <svg class=\"control-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M3.5 8h9\"/>\n </svg>\n }\n </button>\n <button class=\"control control-increase\" ngsRipple [disabled]=\"isIncreaseDisabled()\" (click)=\"increase($event, input)\">\n @if (_increaseControlRef()) {\n <ng-template [ngTemplateOutlet]=\"_increaseControlTemplateRef\"/>\n } @else {\n <svg class=\"control-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M8 3.5v9M3.5 8h9\"/>\n </svg>\n }\n </button>\n</div>\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n@Directive({\n selector: '[ngsNumberInputPrefix]',\n exportAs: 'ngsNumberInputPrefix'\n})\nexport class NumberInputPrefixDirective {\n readonly templateRef = inject(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n@Directive({\n selector: '[ngsNumberInputSuffix]',\n exportAs: 'ngsNumberInputSuffix'\n})\nexport class NumberInputSuffixDirective {\n readonly templateRef = inject(TemplateRef);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAMa,wBAAwB,CAAA;AAC1B,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;uGAD/B,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAxB,wBAAwB,EAAA,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7F,YAAY;uBAAC,SAAS;;sBAQtB,YAAY;uBAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;;;MElKzB,0BAA0B,CAAA;AAC5B,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;uGAD/B,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,QAAA,EAAA,CAAA,sBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAJtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,QAAQ,EAAE;AACX,iBAAA;;;MCCY,0BAA0B,CAAA;AAC5B,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;uGAD/B,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,QAAA,EAAA,CAAA,sBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAJtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,QAAQ,EAAE;AACX,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
2
2
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable, Pipe, inject, DestroyRef, ChangeDetectorRef, ElementRef, viewChild, signal,
|
|
4
|
+
import { Injectable, Pipe, inject, DestroyRef, ChangeDetectorRef, ElementRef, viewChild, signal, output, input, booleanAttribute, computed, effect, Input as Input$1, Optional, Self, Component } from '@angular/core';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { NgForm, ReactiveFormsModule, FormsModule, NG_VALIDATORS } from '@angular/forms';
|
|
7
7
|
import * as i2 from '@ngstarter-ui/components/core';
|
|
@@ -277,14 +277,9 @@ const phoneValidator = (control) => {
|
|
|
277
277
|
numberInstance = parsePhoneNumber(control.value);
|
|
278
278
|
}
|
|
279
279
|
catch (e) {
|
|
280
|
-
control.setValue(null);
|
|
281
280
|
return error;
|
|
282
281
|
}
|
|
283
282
|
if (numberInstance && !numberInstance.isValid()) {
|
|
284
|
-
control.setValue(null);
|
|
285
|
-
if (!control.touched) {
|
|
286
|
-
control.markAsTouched();
|
|
287
|
-
}
|
|
288
283
|
return error;
|
|
289
284
|
}
|
|
290
285
|
}
|
|
@@ -322,21 +317,11 @@ class PhoneInput {
|
|
|
322
317
|
static nextId = 0;
|
|
323
318
|
menuSearchInput = viewChild('menuSearchInput', ...(ngDevMode ? [{ debugName: "menuSearchInput" }] : /* istanbul ignore next */ []));
|
|
324
319
|
focusable = viewChild.required('focusable');
|
|
325
|
-
focused = false;
|
|
326
320
|
_focused = signal(false, ...(ngDevMode ? [{ debugName: "_focused" }] : /* istanbul ignore next */ []));
|
|
327
|
-
errorState = false;
|
|
328
321
|
_errorState = signal(false, ...(ngDevMode ? [{ debugName: "_errorState" }] : /* istanbul ignore next */ []));
|
|
329
322
|
id = '';
|
|
330
323
|
_id = signal(`ngs-phone-input-${PhoneInput.nextId++}`, ...(ngDevMode ? [{ debugName: "_id" }] : /* istanbul ignore next */ []));
|
|
331
324
|
placeholder = '';
|
|
332
|
-
empty = true;
|
|
333
|
-
shouldLabelFloat = false;
|
|
334
|
-
_shouldLabelFloat = computed(() => {
|
|
335
|
-
return this._focused() || !this.empty;
|
|
336
|
-
}, ...(ngDevMode ? [{ debugName: "_shouldLabelFloat" }] : /* istanbul ignore next */ []));
|
|
337
|
-
_empty = computed(() => {
|
|
338
|
-
return !this.phoneNumber;
|
|
339
|
-
}, ...(ngDevMode ? [{ debugName: "_empty" }] : /* istanbul ignore next */ []));
|
|
340
325
|
countryChanged = output();
|
|
341
326
|
stateChanges = new Subject();
|
|
342
327
|
describedBy = '';
|
|
@@ -345,11 +330,29 @@ class PhoneInput {
|
|
|
345
330
|
preferredCountriesInDropDown = [];
|
|
346
331
|
selectedCountry = signal(null, ...(ngDevMode ? [{ debugName: "selectedCountry" }] : /* istanbul ignore next */ []));
|
|
347
332
|
numberInstance;
|
|
348
|
-
|
|
333
|
+
_value;
|
|
349
334
|
searchCriteria;
|
|
350
335
|
_previousFormattedNumber;
|
|
351
336
|
onTouched = () => { };
|
|
352
337
|
propagateChange = (_) => { };
|
|
338
|
+
get focused() {
|
|
339
|
+
return this._focused();
|
|
340
|
+
}
|
|
341
|
+
get errorState() {
|
|
342
|
+
return this._errorState();
|
|
343
|
+
}
|
|
344
|
+
get empty() {
|
|
345
|
+
return !this.phoneNumber;
|
|
346
|
+
}
|
|
347
|
+
get shouldLabelFloat() {
|
|
348
|
+
return this._focused() || !this.empty;
|
|
349
|
+
}
|
|
350
|
+
set value(value) {
|
|
351
|
+
this.writeValue(value);
|
|
352
|
+
}
|
|
353
|
+
get value() {
|
|
354
|
+
return this._value;
|
|
355
|
+
}
|
|
353
356
|
autocomplete = input('on', ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
354
357
|
errorStateMatcher = input(this._errorStateMatcher, ...(ngDevMode ? [{ debugName: "errorStateMatcher" }] : /* istanbul ignore next */ []));
|
|
355
358
|
onlyCountries = input([], ...(ngDevMode ? [{ debugName: "onlyCountries" }] : /* istanbul ignore next */ []));
|
|
@@ -392,15 +395,14 @@ class PhoneInput {
|
|
|
392
395
|
});
|
|
393
396
|
this.fetchCountryData();
|
|
394
397
|
effect(() => {
|
|
395
|
-
this.
|
|
398
|
+
this.format();
|
|
399
|
+
if (this.numberInstance) {
|
|
400
|
+
this.phoneNumber = this.formattedPhoneNumber;
|
|
401
|
+
}
|
|
396
402
|
this.stateChanges.next();
|
|
397
403
|
});
|
|
398
404
|
effect(() => {
|
|
399
405
|
this.id = this._id();
|
|
400
|
-
this.focused = this._focused();
|
|
401
|
-
this.errorState = this._errorState();
|
|
402
|
-
this.empty = this._empty();
|
|
403
|
-
this.shouldLabelFloat = this._shouldLabelFloat();
|
|
404
406
|
this.placeholder = this._placeholder();
|
|
405
407
|
});
|
|
406
408
|
}
|
|
@@ -448,15 +450,16 @@ class PhoneInput {
|
|
|
448
450
|
}
|
|
449
451
|
onPhoneNumberChange() {
|
|
450
452
|
if (!this.phoneNumber) {
|
|
451
|
-
this.
|
|
453
|
+
this.clearValue('');
|
|
452
454
|
this.propagateChange(this.value);
|
|
453
455
|
this._changeDetectorRef.markForCheck();
|
|
456
|
+
this.stateChanges.next();
|
|
454
457
|
return;
|
|
455
458
|
}
|
|
456
459
|
try {
|
|
457
460
|
this.numberInstance = parsePhoneNumberFromString(this.phoneNumber.toString(), this.selectedCountry()?.shortCode.toUpperCase());
|
|
458
461
|
this.formatAsYouTypeIfEnabled();
|
|
459
|
-
this.
|
|
462
|
+
this._value = this.numberInstance?.number ?? this.phoneNumber.toString();
|
|
460
463
|
if (this.numberInstance && this.numberInstance.isValid()) {
|
|
461
464
|
if (this.phoneNumber !== this.formattedPhoneNumber) {
|
|
462
465
|
this.phoneNumber = this.formattedPhoneNumber;
|
|
@@ -471,10 +474,11 @@ class PhoneInput {
|
|
|
471
474
|
catch (e) {
|
|
472
475
|
// if no possible numbers are there,
|
|
473
476
|
// then the full number is passed so that validator could be triggered and proper error could be shown
|
|
474
|
-
this.
|
|
477
|
+
this._value = this.phoneNumber.toString();
|
|
475
478
|
}
|
|
476
479
|
this.propagateChange(this.value);
|
|
477
480
|
this._changeDetectorRef.markForCheck();
|
|
481
|
+
this.stateChanges.next();
|
|
478
482
|
}
|
|
479
483
|
onCountrySelect(country, el) {
|
|
480
484
|
if (this.phoneNumber) {
|
|
@@ -520,23 +524,30 @@ class PhoneInput {
|
|
|
520
524
|
this.stateChanges.next();
|
|
521
525
|
}
|
|
522
526
|
writeValue(value) {
|
|
523
|
-
if (value) {
|
|
524
|
-
this.
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
527
|
+
if (!value) {
|
|
528
|
+
this.clearValue(value);
|
|
529
|
+
this.stateChanges.next();
|
|
530
|
+
this._changeDetectorRef.detectChanges();
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
this._value = value;
|
|
534
|
+
this.numberInstance = parsePhoneNumberFromString(value);
|
|
535
|
+
if (this.numberInstance) {
|
|
536
|
+
const countryCode = this.numberInstance.country;
|
|
537
|
+
this.phoneNumber = this.formattedPhoneNumber;
|
|
538
|
+
if (!countryCode) {
|
|
539
|
+
this.stateChanges.next(undefined);
|
|
534
540
|
this._changeDetectorRef.detectChanges();
|
|
535
|
-
|
|
536
|
-
}
|
|
537
|
-
else {
|
|
538
|
-
this.phoneNumber = value;
|
|
541
|
+
return;
|
|
539
542
|
}
|
|
543
|
+
const country = this.getCountry(countryCode);
|
|
544
|
+
this.selectedCountry.set(country);
|
|
545
|
+
this.countryChanged.emit(country);
|
|
546
|
+
this._changeDetectorRef.detectChanges();
|
|
547
|
+
this.stateChanges.next();
|
|
548
|
+
}
|
|
549
|
+
else {
|
|
550
|
+
this.phoneNumber = value;
|
|
540
551
|
}
|
|
541
552
|
this.stateChanges.next(undefined);
|
|
542
553
|
// Value is set from outside using setValue()
|
|
@@ -554,11 +565,17 @@ class PhoneInput {
|
|
|
554
565
|
}
|
|
555
566
|
}
|
|
556
567
|
reset() {
|
|
557
|
-
this.
|
|
568
|
+
this.clearValue(null);
|
|
558
569
|
this.propagateChange(null);
|
|
559
570
|
this._changeDetectorRef.markForCheck();
|
|
560
571
|
this.stateChanges.next(undefined);
|
|
561
572
|
}
|
|
573
|
+
clearValue(value) {
|
|
574
|
+
this._value = value ?? '';
|
|
575
|
+
this.phoneNumber = '';
|
|
576
|
+
this.numberInstance = undefined;
|
|
577
|
+
this._previousFormattedNumber = undefined;
|
|
578
|
+
}
|
|
562
579
|
get formattedPhoneNumber() {
|
|
563
580
|
if (!this.numberInstance) {
|
|
564
581
|
return this.phoneNumber?.toString() || '';
|
|
@@ -602,7 +619,7 @@ class PhoneInput {
|
|
|
602
619
|
useValue: phoneValidator,
|
|
603
620
|
multi: true,
|
|
604
621
|
},
|
|
605
|
-
], viewQueries: [{ propertyName: "menuSearchInput", first: true, predicate: ["menuSearchInput"], descendants: true, isSignal: true }, { propertyName: "focusable", first: true, predicate: ["focusable"], descendants: true, isSignal: true }], exportAs: ["ngsPhoneInput"], ngImport: i0, template: "<div class=\"phone-input-container\">\n <button\n type=\"button\"\n ngsRipple\n [ngsMenuTriggerFor]=\"menu\"\n class=\"country-selector pe-1.5\"\n [disabled]=\"disabled\"\n (menuOpened)=\"menuSearchInput()?.nativeElement?.focus()\">\n @if (selectedCountry()) {\n <ngs-icon [name]=\"'circle-flags:' + selectedCountry()?.shortCode\" class=\"flag-icon\" />\n\n @if (selectedCountry()?.phoneCode) {\n <span class=\"country-selector-code\">{{ selectedCountry()?.phoneCode }}</span>\n }\n }\n <ngs-icon name=\"fluent:chevron-down-24-regular\" class=\"text-neutral-500 size-4 relative
|
|
622
|
+
], viewQueries: [{ propertyName: "menuSearchInput", first: true, predicate: ["menuSearchInput"], descendants: true, isSignal: true }, { propertyName: "focusable", first: true, predicate: ["focusable"], descendants: true, isSignal: true }], exportAs: ["ngsPhoneInput"], ngImport: i0, template: "<div class=\"phone-input-container\">\n <button\n type=\"button\"\n ngsRipple\n [ngsMenuTriggerFor]=\"menu\"\n class=\"country-selector pe-1.5\"\n [disabled]=\"disabled\"\n (menuOpened)=\"menuSearchInput()?.nativeElement?.focus()\">\n @if (selectedCountry()) {\n <ngs-icon [name]=\"'circle-flags:' + selectedCountry()?.shortCode\" class=\"flag-icon\" />\n\n @if (selectedCountry()?.phoneCode) {\n <span class=\"country-selector-code\">{{ selectedCountry()?.phoneCode }}</span>\n }\n }\n <ngs-icon name=\"fluent:chevron-down-24-regular\" class=\"text-neutral-500 size-4 relative ms-0.5\"/>\n </button>\n <input\n ngsInput\n type=\"tel\"\n inputmode=\"tel\"\n [autocomplete]=\"autocomplete()\"\n (blur)=\"onTouched()\"\n (keypress)=\"onInputKeyPress($event)\"\n [(ngModel)]=\"phoneNumber\"\n (ngModelChange)=\"onPhoneNumberChange()\"\n [errorStateMatcher]=\"errorStateMatcher()\"\n [placeholder]=\"_placeholder()\"\n [disabled]=\"disabled\"\n class=\"grow\"\n #focusable>\n</div>\n<ngs-menu #menu=\"ngsMenu\">\n @for (country of preferredCountriesInDropDown; track country) {\n <button type=\"button\" ngs-menu-item (click)=\"onCountrySelect(country, focusable)\">\n <div class=\"flex items-center gap-2\">\n <ngs-icon [name]=\"'circle-flags:' + country.shortCode\" class=\"flag-icon\" />\n <div class=\"label-wrapper\">\n {{ country.name }}\n <span [class.whitespace-nowrap]=\"!searchCriteria\" class=\"text-neutral-500\">{{ country.phoneCode }}</span>\n </div>\n </div>\n </button>\n }\n\n @if (preferredCountriesInDropDown.length) {\n <ngs-divider/>\n }\n\n @for (country of allCountries | search : searchCriteria; track country) {\n <button type=\"button\" ngs-menu-item (click)=\"onCountrySelect(country, focusable)\">\n <div class=\"flex items-center gap-2\">\n <ngs-icon [name]=\"'circle-flags:' + country.shortCode\" class=\"flag-icon\" />\n <div>\n {{ country.name }}\n <span [class.whitespace-nowrap]=\"!searchCriteria\" class=\"text-neutral-500\">{{ country.phoneCode }}</span>\n </div>\n </div>\n </button>\n }\n</ngs-menu>\n", styles: [":host{--ngs-phone-input-color: var(--ngs-color-neutral-600);--ngs-phone-input-opacity: 0}@media print{:host{--ngs-phone-input-flag-display: none}}:host .flag-icon{margin-inline-end:calc(var(--spacing, .25rem) * 1);--ngs-icon-size: 18px}:host.is-floating .country-selector{opacity:1}:host .phone-input-container{display:flex;align-items:center}:host input{border:none;background:none;outline:none;font:inherit;width:max-content;box-sizing:border-box;padding-right:6px;padding-left:4px;position:relative;z-index:0}:host .icon-wrapper{padding-right:24px}:host .mdc-button__label{margin-right:auto}:host .country-selector{display:flex;align-items:center;line-height:0;border-radius:0;color:var(--ngs-phone-input-color);flex-shrink:0;height:initial;opacity:var(--ngs-phone-input-opacity, 0);transition:opacity .2s;border:unset}:host .country-selector:disabled{opacity:.8}:host .country-selector-code{color:var(--ngs-phone-input-color);padding-right:0}:host-context(html.dark){--ngs-phone-input-color: var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: Ripple, selector: "[ngsRipple]", inputs: ["ngsRippleColor", "ngsRippleUnbounded", "ngsRippleCentered", "ngsRippleRadius", "ngsRippleAnimation", "ngsRippleDisabled", "ngsRippleTrigger"], outputs: ["ngsRippleCenteredChange", "ngsRippleDisabledChange", "ngsRippleTriggerChange"], exportAs: ["ngsRipple"] }, { kind: "directive", type: MenuTrigger, selector: "[ngsMenuTriggerFor]", inputs: ["ngsMenuTriggerFor", "ngsMenuTriggerData", "ngsMenuDisabled", "xPosition", "yPosition", "ngsMenuTriggerRestoreFocus"], outputs: ["menuOpened", "menuClosed"], exportAs: ["ngsMenuTrigger"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "component", type: Menu, selector: "ngs-menu", inputs: ["role", "classList", "xPosition", "yPosition"], outputs: ["closed"], exportAs: ["ngsMenu"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MenuItem, selector: "ngs-menu-item, [ngs-menu-item]", inputs: ["disabled", "role", "selected"], outputs: ["_triggered"], exportAs: ["ngsMenuItem"] }, { kind: "directive", type: Input, selector: "input[ngsInput], textarea[ngsInput]", inputs: ["id", "placeholder", "required", "disabled", "readonly", "errorStateMatcher"], exportAs: ["ngsInput"] }, { kind: "component", type: Divider, selector: "ngs-divider", inputs: ["vertical", "inset", "fixedHeight"], exportAs: ["ngsDivider"] }, { kind: "pipe", type: SearchPipe, name: "search" }] });
|
|
606
623
|
}
|
|
607
624
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PhoneInput, decorators: [{
|
|
608
625
|
type: Component,
|
|
@@ -631,7 +648,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
631
648
|
], host: {
|
|
632
649
|
'class': 'ngs-phone-input',
|
|
633
650
|
'[class.is-floating]': 'shouldLabelFloat',
|
|
634
|
-
}, template: "<div class=\"phone-input-container\">\n <button\n type=\"button\"\n ngsRipple\n [ngsMenuTriggerFor]=\"menu\"\n class=\"country-selector pe-1.5\"\n [disabled]=\"disabled\"\n (menuOpened)=\"menuSearchInput()?.nativeElement?.focus()\">\n @if (selectedCountry()) {\n <ngs-icon [name]=\"'circle-flags:' + selectedCountry()?.shortCode\" class=\"flag-icon\" />\n\n @if (selectedCountry()?.phoneCode) {\n <span class=\"country-selector-code\">{{ selectedCountry()?.phoneCode }}</span>\n }\n }\n <ngs-icon name=\"fluent:chevron-down-24-regular\" class=\"text-neutral-500 size-4 relative
|
|
651
|
+
}, template: "<div class=\"phone-input-container\">\n <button\n type=\"button\"\n ngsRipple\n [ngsMenuTriggerFor]=\"menu\"\n class=\"country-selector pe-1.5\"\n [disabled]=\"disabled\"\n (menuOpened)=\"menuSearchInput()?.nativeElement?.focus()\">\n @if (selectedCountry()) {\n <ngs-icon [name]=\"'circle-flags:' + selectedCountry()?.shortCode\" class=\"flag-icon\" />\n\n @if (selectedCountry()?.phoneCode) {\n <span class=\"country-selector-code\">{{ selectedCountry()?.phoneCode }}</span>\n }\n }\n <ngs-icon name=\"fluent:chevron-down-24-regular\" class=\"text-neutral-500 size-4 relative ms-0.5\"/>\n </button>\n <input\n ngsInput\n type=\"tel\"\n inputmode=\"tel\"\n [autocomplete]=\"autocomplete()\"\n (blur)=\"onTouched()\"\n (keypress)=\"onInputKeyPress($event)\"\n [(ngModel)]=\"phoneNumber\"\n (ngModelChange)=\"onPhoneNumberChange()\"\n [errorStateMatcher]=\"errorStateMatcher()\"\n [placeholder]=\"_placeholder()\"\n [disabled]=\"disabled\"\n class=\"grow\"\n #focusable>\n</div>\n<ngs-menu #menu=\"ngsMenu\">\n @for (country of preferredCountriesInDropDown; track country) {\n <button type=\"button\" ngs-menu-item (click)=\"onCountrySelect(country, focusable)\">\n <div class=\"flex items-center gap-2\">\n <ngs-icon [name]=\"'circle-flags:' + country.shortCode\" class=\"flag-icon\" />\n <div class=\"label-wrapper\">\n {{ country.name }}\n <span [class.whitespace-nowrap]=\"!searchCriteria\" class=\"text-neutral-500\">{{ country.phoneCode }}</span>\n </div>\n </div>\n </button>\n }\n\n @if (preferredCountriesInDropDown.length) {\n <ngs-divider/>\n }\n\n @for (country of allCountries | search : searchCriteria; track country) {\n <button type=\"button\" ngs-menu-item (click)=\"onCountrySelect(country, focusable)\">\n <div class=\"flex items-center gap-2\">\n <ngs-icon [name]=\"'circle-flags:' + country.shortCode\" class=\"flag-icon\" />\n <div>\n {{ country.name }}\n <span [class.whitespace-nowrap]=\"!searchCriteria\" class=\"text-neutral-500\">{{ country.phoneCode }}</span>\n </div>\n </div>\n </button>\n }\n</ngs-menu>\n", styles: [":host{--ngs-phone-input-color: var(--ngs-color-neutral-600);--ngs-phone-input-opacity: 0}@media print{:host{--ngs-phone-input-flag-display: none}}:host .flag-icon{margin-inline-end:calc(var(--spacing, .25rem) * 1);--ngs-icon-size: 18px}:host.is-floating .country-selector{opacity:1}:host .phone-input-container{display:flex;align-items:center}:host input{border:none;background:none;outline:none;font:inherit;width:max-content;box-sizing:border-box;padding-right:6px;padding-left:4px;position:relative;z-index:0}:host .icon-wrapper{padding-right:24px}:host .mdc-button__label{margin-right:auto}:host .country-selector{display:flex;align-items:center;line-height:0;border-radius:0;color:var(--ngs-phone-input-color);flex-shrink:0;height:initial;opacity:var(--ngs-phone-input-opacity, 0);transition:opacity .2s;border:unset}:host .country-selector:disabled{opacity:.8}:host .country-selector-code{color:var(--ngs-phone-input-color);padding-right:0}:host-context(html.dark){--ngs-phone-input-color: var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
635
652
|
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
636
653
|
type: Optional
|
|
637
654
|
}, {
|