@skyux/autonumeric 5.6.0 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/skyux-autonumeric.umd.js +2 -2
- package/documentation.json +1 -44
- package/esm2015/lib/modules/autonumeric/autonumeric.directive.js +2 -2
- package/esm2015/lib/modules/autonumeric/autonumeric.directive.js.map +1 -1
- package/fesm2015/skyux-autonumeric.js +2 -2
- package/fesm2015/skyux-autonumeric.js.map +1 -1
- package/package.json +10 -10
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
this.changeDetector = changeDetector;
|
|
77
77
|
this.isFirstChange = true;
|
|
78
78
|
this.ngUnsubscribe = new rxjs.Subject();
|
|
79
|
-
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
80
80
|
this.onChange = function (_) { };
|
|
81
|
-
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
82
82
|
this.onTouched = function () { };
|
|
83
83
|
this.autonumericInstance = new AutoNumeric__default["default"](this.elementRef.nativeElement);
|
|
84
84
|
}
|
package/documentation.json
CHANGED
|
@@ -33,29 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
],
|
|
36
|
-
"children": [
|
|
37
|
-
{
|
|
38
|
-
"id": 67,
|
|
39
|
-
"name": "constructor",
|
|
40
|
-
"kind": 512,
|
|
41
|
-
"kindString": "Constructor",
|
|
42
|
-
"flags": {},
|
|
43
|
-
"signatures": [
|
|
44
|
-
{
|
|
45
|
-
"id": 68,
|
|
46
|
-
"name": "new SkyAutonumericModule",
|
|
47
|
-
"kind": 16384,
|
|
48
|
-
"kindString": "Constructor signature",
|
|
49
|
-
"flags": {},
|
|
50
|
-
"type": {
|
|
51
|
-
"type": "reference",
|
|
52
|
-
"id": 66,
|
|
53
|
-
"name": "SkyAutonumericModule"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
],
|
|
36
|
+
"children": [],
|
|
59
37
|
"groups": [
|
|
60
38
|
{
|
|
61
39
|
"title": "Constructors",
|
|
@@ -97,27 +75,6 @@
|
|
|
97
75
|
}
|
|
98
76
|
],
|
|
99
77
|
"children": [
|
|
100
|
-
{
|
|
101
|
-
"id": 61,
|
|
102
|
-
"name": "constructor",
|
|
103
|
-
"kind": 512,
|
|
104
|
-
"kindString": "Constructor",
|
|
105
|
-
"flags": {},
|
|
106
|
-
"signatures": [
|
|
107
|
-
{
|
|
108
|
-
"id": 62,
|
|
109
|
-
"name": "new SkyAutonumericOptionsProvider",
|
|
110
|
-
"kind": 16384,
|
|
111
|
-
"kindString": "Constructor signature",
|
|
112
|
-
"flags": {},
|
|
113
|
-
"type": {
|
|
114
|
-
"type": "reference",
|
|
115
|
-
"id": 60,
|
|
116
|
-
"name": "SkyAutonumericOptionsProvider"
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
]
|
|
120
|
-
},
|
|
121
78
|
{
|
|
122
79
|
"id": 63,
|
|
123
80
|
"name": "getConfig",
|
|
@@ -30,9 +30,9 @@ export class SkyAutonumericDirective {
|
|
|
30
30
|
this.changeDetector = changeDetector;
|
|
31
31
|
this.isFirstChange = true;
|
|
32
32
|
this.ngUnsubscribe = new Subject();
|
|
33
|
-
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
34
34
|
this.onChange = (_) => { };
|
|
35
|
-
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
36
36
|
this.onTouched = () => { };
|
|
37
37
|
this.autonumericInstance = new AutoNumeric(this.elementRef.nativeElement);
|
|
38
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autonumeric.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/autonumeric/src/lib/modules/autonumeric/autonumeric.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,UAAU,EAC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B,EAAE,yBAAyB,CAAC;4FAE3D,uBAAuB;kBAJnC,SAAS;mBAAC;oBACT,QAAQ,EAAE,uBAAuB;oBACjC,SAAS,EAAE,CAAC,8BAA8B,EAAE,yBAAyB,CAAC;iBACvE;qMAQY,cAAc;sBADxB,KAAK;gBAgHC,MAAM;sBADZ,YAAY;uBAAC,MAAM","sourcesContent":["import {\n ChangeDetectorRef,\n Directive,\n ElementRef,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Renderer2,\n forwardRef,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\n\nimport AutoNumeric from 'autonumeric';\nimport { Subject, fromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyAutonumericOptions } from './autonumeric-options';\nimport { SkyAutonumericOptionsProvider } from './autonumeric-options-provider';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_AUTONUMERIC_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyAutonumericDirective),\n multi: true,\n};\n\nconst SKY_AUTONUMERIC_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyAutonumericDirective),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Wraps the [autoNumeric utility](https://github.com/autoNumeric/autoNumeric) to format\n * any type of number, including currency.\n */\n@Directive({\n selector: 'input[skyAutonumeric]',\n providers: [SKY_AUTONUMERIC_VALUE_ACCESSOR, SKY_AUTONUMERIC_VALIDATOR],\n})\nexport class SkyAutonumericDirective\n implements OnInit, OnDestroy, ControlValueAccessor, Validator\n{\n /**\n * Assigns the name of a property from `SkyAutonumericOptionsProvider`.\n */\n @Input()\n public set skyAutonumeric(value: SkyAutonumericOptions) {\n this.autonumericOptions = this.mergeOptions(value);\n this.updateAutonumericInstance();\n }\n\n private autonumericInstance: AutoNumeric;\n private autonumericOptions: SkyAutonumericOptions | undefined;\n private control: AbstractControl | undefined;\n private isFirstChange = true;\n private value: number | undefined;\n\n private ngUnsubscribe = new Subject<void>();\n\n constructor(\n private elementRef: ElementRef,\n private globalConfig: SkyAutonumericOptionsProvider,\n private renderer: Renderer2,\n private changeDetector: ChangeDetectorRef\n ) {\n this.autonumericInstance = new AutoNumeric(this.elementRef.nativeElement);\n }\n\n public ngOnInit(): void {\n // Ensure that we set the global config even if no local config has been given.\n if (!this.autonumericOptions) {\n this.autonumericOptions = this.globalConfig.getConfig();\n }\n this.updateAutonumericInstance();\n\n fromEvent(this.elementRef.nativeElement, 'input')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n const numericValue: number | undefined = this.getNumericValue();\n\n /* istanbul ignore else */\n if (this.value !== numericValue) {\n this.value = numericValue;\n this.onChange(numericValue);\n }\n\n /* istanbul ignore else */\n if (this.control && !this.control.dirty) {\n this.control.markAsDirty();\n }\n\n this.changeDetector.markForCheck();\n });\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n /**\n * Implemented as part of ControlValueAccessor.\n */\n public setDisabledState(value: boolean): void {\n this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', value);\n }\n\n public writeValue(value: number | undefined): void {\n if (this.value !== value) {\n this.value = value;\n this.onChange(value);\n\n // Mark the control as \"pristine\" if it is initialized with a value.\n const initializedWithValue =\n this.isFirstChange && this.control && this.value !== null;\n if (initializedWithValue) {\n this.isFirstChange = false;\n this.control!.markAsPristine();\n }\n }\n\n if (typeof value === 'number') {\n this.autonumericInstance.set(value);\n } else {\n this.autonumericInstance.clear();\n }\n }\n\n public validate(control: AbstractControl): ValidationErrors | null {\n const noErrors = null; // tslint:disable-line: no-null-keyword\n\n if (!this.control) {\n this.control = control;\n }\n\n if (control.value === null || control.value === undefined) {\n return noErrors;\n }\n\n if (typeof control.value !== 'number') {\n return {\n notTypeOfNumber: { value: control.value },\n };\n }\n\n return noErrors;\n }\n\n public registerOnChange(fn: (value: number | undefined) => void): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n @HostListener('blur')\n public onBlur(): void {\n this.onTouched();\n }\n\n private getNumericValue(): number | undefined {\n const inputValue = this.getInputValue();\n return inputValue && !this.isInputValueTheCurrencySymbol(inputValue)\n ? this.autonumericInstance.getNumber()\n : undefined;\n }\n\n /**\n * Due to AutoNumeric's hover logic - when AutoNumeric has a currency symbol the value\n * that we get back on empty fields will be the currency symbol.\n * The following logic ensures that we don't accidentally set\n * a form value when the only input was the programatically-added currency symbol.\n */\n private isInputValueTheCurrencySymbol(inputValue: string): boolean {\n /* istanbul ignore next */\n const currencySymbol = (\n (this.autonumericOptions as AutoNumeric.Options)?.currencySymbol ?? ''\n ).trim();\n return !!currencySymbol && inputValue === currencySymbol;\n }\n\n private getInputValue(): string {\n return this.elementRef.nativeElement.value;\n }\n\n private updateAutonumericInstance(): void {\n this.autonumericInstance.update(\n this.autonumericOptions as AutoNumeric.Options\n );\n }\n\n private mergeOptions(value: SkyAutonumericOptions): SkyAutonumericOptions {\n const globalOptions = this.globalConfig.getConfig();\n\n let newOptions: SkyAutonumericOptions;\n if (typeof value === 'string') {\n const predefinedOptions = AutoNumeric.getPredefinedOptions();\n newOptions = predefinedOptions[\n value as keyof AutoNumeric.Options\n ] as AutoNumeric.Options;\n } else {\n newOptions = value;\n }\n\n return Object.assign({}, globalOptions, newOptions);\n }\n\n /* istanbul ignore next */\n private onChange = (_: number | undefined) => {};\n /* istanbul ignore next */\n private onTouched = () => {};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"autonumeric.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/autonumeric/src/lib/modules/autonumeric/autonumeric.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EAGL,SAAS,EACT,UAAU,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JnC,SAAS;mBAAC;oBACT,QAAQ,EAAE,uBAAuB;oBACjC,SAAS,EAAE,CAAC,8BAA8B,EAAE,yBAAyB,CAAC;iBACvE;qMAQY,cAAc;sBADxB,KAAK;gBAgHC,MAAM;sBADZ,YAAY;uBAAC,MAAM","sourcesContent":["import {\n ChangeDetectorRef,\n Directive,\n ElementRef,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Renderer2,\n forwardRef,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\n\nimport AutoNumeric from 'autonumeric';\nimport { Subject, fromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyAutonumericOptions } from './autonumeric-options';\nimport { SkyAutonumericOptionsProvider } from './autonumeric-options-provider';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_AUTONUMERIC_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyAutonumericDirective),\n multi: true,\n};\n\nconst SKY_AUTONUMERIC_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyAutonumericDirective),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Wraps the [autoNumeric utility](https://github.com/autoNumeric/autoNumeric) to format\n * any type of number, including currency.\n */\n@Directive({\n selector: 'input[skyAutonumeric]',\n providers: [SKY_AUTONUMERIC_VALUE_ACCESSOR, SKY_AUTONUMERIC_VALIDATOR],\n})\nexport class SkyAutonumericDirective\n implements OnInit, OnDestroy, ControlValueAccessor, Validator\n{\n /**\n * Assigns the name of a property from `SkyAutonumericOptionsProvider`.\n */\n @Input()\n public set skyAutonumeric(value: SkyAutonumericOptions) {\n this.autonumericOptions = this.mergeOptions(value);\n this.updateAutonumericInstance();\n }\n\n private autonumericInstance: AutoNumeric;\n private autonumericOptions: SkyAutonumericOptions | undefined;\n private control: AbstractControl | undefined;\n private isFirstChange = true;\n private value: number | undefined;\n\n private ngUnsubscribe = new Subject<void>();\n\n constructor(\n private elementRef: ElementRef,\n private globalConfig: SkyAutonumericOptionsProvider,\n private renderer: Renderer2,\n private changeDetector: ChangeDetectorRef\n ) {\n this.autonumericInstance = new AutoNumeric(this.elementRef.nativeElement);\n }\n\n public ngOnInit(): void {\n // Ensure that we set the global config even if no local config has been given.\n if (!this.autonumericOptions) {\n this.autonumericOptions = this.globalConfig.getConfig();\n }\n this.updateAutonumericInstance();\n\n fromEvent(this.elementRef.nativeElement, 'input')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n const numericValue: number | undefined = this.getNumericValue();\n\n /* istanbul ignore else */\n if (this.value !== numericValue) {\n this.value = numericValue;\n this.onChange(numericValue);\n }\n\n /* istanbul ignore else */\n if (this.control && !this.control.dirty) {\n this.control.markAsDirty();\n }\n\n this.changeDetector.markForCheck();\n });\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n /**\n * Implemented as part of ControlValueAccessor.\n */\n public setDisabledState(value: boolean): void {\n this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', value);\n }\n\n public writeValue(value: number | undefined): void {\n if (this.value !== value) {\n this.value = value;\n this.onChange(value);\n\n // Mark the control as \"pristine\" if it is initialized with a value.\n const initializedWithValue =\n this.isFirstChange && this.control && this.value !== null;\n if (initializedWithValue) {\n this.isFirstChange = false;\n this.control!.markAsPristine();\n }\n }\n\n if (typeof value === 'number') {\n this.autonumericInstance.set(value);\n } else {\n this.autonumericInstance.clear();\n }\n }\n\n public validate(control: AbstractControl): ValidationErrors | null {\n const noErrors = null; // tslint:disable-line: no-null-keyword\n\n if (!this.control) {\n this.control = control;\n }\n\n if (control.value === null || control.value === undefined) {\n return noErrors;\n }\n\n if (typeof control.value !== 'number') {\n return {\n notTypeOfNumber: { value: control.value },\n };\n }\n\n return noErrors;\n }\n\n public registerOnChange(fn: (value: number | undefined) => void): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n @HostListener('blur')\n public onBlur(): void {\n this.onTouched();\n }\n\n private getNumericValue(): number | undefined {\n const inputValue = this.getInputValue();\n return inputValue && !this.isInputValueTheCurrencySymbol(inputValue)\n ? this.autonumericInstance.getNumber()\n : undefined;\n }\n\n /**\n * Due to AutoNumeric's hover logic - when AutoNumeric has a currency symbol the value\n * that we get back on empty fields will be the currency symbol.\n * The following logic ensures that we don't accidentally set\n * a form value when the only input was the programatically-added currency symbol.\n */\n private isInputValueTheCurrencySymbol(inputValue: string): boolean {\n /* istanbul ignore next */\n const currencySymbol = (\n (this.autonumericOptions as AutoNumeric.Options)?.currencySymbol ?? ''\n ).trim();\n return !!currencySymbol && inputValue === currencySymbol;\n }\n\n private getInputValue(): string {\n return this.elementRef.nativeElement.value;\n }\n\n private updateAutonumericInstance(): void {\n this.autonumericInstance.update(\n this.autonumericOptions as AutoNumeric.Options\n );\n }\n\n private mergeOptions(value: SkyAutonumericOptions): SkyAutonumericOptions {\n const globalOptions = this.globalConfig.getConfig();\n\n let newOptions: SkyAutonumericOptions;\n if (typeof value === 'string') {\n const predefinedOptions = AutoNumeric.getPredefinedOptions();\n newOptions = predefinedOptions[\n value as keyof AutoNumeric.Options\n ] as AutoNumeric.Options;\n } else {\n newOptions = value;\n }\n\n return Object.assign({}, globalOptions, newOptions);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onChange = (_: number | undefined) => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onTouched = () => {};\n}\n"]}
|
|
@@ -52,9 +52,9 @@ class SkyAutonumericDirective {
|
|
|
52
52
|
this.changeDetector = changeDetector;
|
|
53
53
|
this.isFirstChange = true;
|
|
54
54
|
this.ngUnsubscribe = new Subject();
|
|
55
|
-
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
56
56
|
this.onChange = (_) => { };
|
|
57
|
-
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
58
58
|
this.onTouched = () => { };
|
|
59
59
|
this.autonumericInstance = new AutoNumeric(this.elementRef.nativeElement);
|
|
60
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skyux-autonumeric.js","sources":["../../../../../libs/components/autonumeric/src/lib/modules/autonumeric/autonumeric-options-provider.ts","../../../../../libs/components/autonumeric/src/lib/modules/autonumeric/autonumeric.directive.ts","../../../../../libs/components/autonumeric/src/lib/modules/autonumeric/autonumeric.module.ts","../../../../../libs/components/autonumeric/src/skyux-autonumeric.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { SkyAutonumericOptions } from './autonumeric-options';\n\n/**\n * Provides options to the underlying [autoNumeric utility](https://github.com/autoNumeric/autoNumeric).\n * This can set global options on multiple input fields.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyAutonumericOptionsProvider {\n /**\n * Specifies the value for a settings object to pass to the autoNumeric utility.\n * This overrides any default options specified by the `skyAutonumeric` attribute.\n */\n public getConfig(): SkyAutonumericOptions {\n return {};\n }\n}\n","import {\n ChangeDetectorRef,\n Directive,\n ElementRef,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Renderer2,\n forwardRef,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\n\nimport AutoNumeric from 'autonumeric';\nimport { Subject, fromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyAutonumericOptions } from './autonumeric-options';\nimport { SkyAutonumericOptionsProvider } from './autonumeric-options-provider';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_AUTONUMERIC_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyAutonumericDirective),\n multi: true,\n};\n\nconst SKY_AUTONUMERIC_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyAutonumericDirective),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Wraps the [autoNumeric utility](https://github.com/autoNumeric/autoNumeric) to format\n * any type of number, including currency.\n */\n@Directive({\n selector: 'input[skyAutonumeric]',\n providers: [SKY_AUTONUMERIC_VALUE_ACCESSOR, SKY_AUTONUMERIC_VALIDATOR],\n})\nexport class SkyAutonumericDirective\n implements OnInit, OnDestroy, ControlValueAccessor, Validator\n{\n /**\n * Assigns the name of a property from `SkyAutonumericOptionsProvider`.\n */\n @Input()\n public set skyAutonumeric(value: SkyAutonumericOptions) {\n this.autonumericOptions = this.mergeOptions(value);\n this.updateAutonumericInstance();\n }\n\n private autonumericInstance: AutoNumeric;\n private autonumericOptions: SkyAutonumericOptions | undefined;\n private control: AbstractControl | undefined;\n private isFirstChange = true;\n private value: number | undefined;\n\n private ngUnsubscribe = new Subject<void>();\n\n constructor(\n private elementRef: ElementRef,\n private globalConfig: SkyAutonumericOptionsProvider,\n private renderer: Renderer2,\n private changeDetector: ChangeDetectorRef\n ) {\n this.autonumericInstance = new AutoNumeric(this.elementRef.nativeElement);\n }\n\n public ngOnInit(): void {\n // Ensure that we set the global config even if no local config has been given.\n if (!this.autonumericOptions) {\n this.autonumericOptions = this.globalConfig.getConfig();\n }\n this.updateAutonumericInstance();\n\n fromEvent(this.elementRef.nativeElement, 'input')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n const numericValue: number | undefined = this.getNumericValue();\n\n /* istanbul ignore else */\n if (this.value !== numericValue) {\n this.value = numericValue;\n this.onChange(numericValue);\n }\n\n /* istanbul ignore else */\n if (this.control && !this.control.dirty) {\n this.control.markAsDirty();\n }\n\n this.changeDetector.markForCheck();\n });\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n /**\n * Implemented as part of ControlValueAccessor.\n */\n public setDisabledState(value: boolean): void {\n this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', value);\n }\n\n public writeValue(value: number | undefined): void {\n if (this.value !== value) {\n this.value = value;\n this.onChange(value);\n\n // Mark the control as \"pristine\" if it is initialized with a value.\n const initializedWithValue =\n this.isFirstChange && this.control && this.value !== null;\n if (initializedWithValue) {\n this.isFirstChange = false;\n this.control!.markAsPristine();\n }\n }\n\n if (typeof value === 'number') {\n this.autonumericInstance.set(value);\n } else {\n this.autonumericInstance.clear();\n }\n }\n\n public validate(control: AbstractControl): ValidationErrors | null {\n const noErrors = null; // tslint:disable-line: no-null-keyword\n\n if (!this.control) {\n this.control = control;\n }\n\n if (control.value === null || control.value === undefined) {\n return noErrors;\n }\n\n if (typeof control.value !== 'number') {\n return {\n notTypeOfNumber: { value: control.value },\n };\n }\n\n return noErrors;\n }\n\n public registerOnChange(fn: (value: number | undefined) => void): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n @HostListener('blur')\n public onBlur(): void {\n this.onTouched();\n }\n\n private getNumericValue(): number | undefined {\n const inputValue = this.getInputValue();\n return inputValue && !this.isInputValueTheCurrencySymbol(inputValue)\n ? this.autonumericInstance.getNumber()\n : undefined;\n }\n\n /**\n * Due to AutoNumeric's hover logic - when AutoNumeric has a currency symbol the value\n * that we get back on empty fields will be the currency symbol.\n * The following logic ensures that we don't accidentally set\n * a form value when the only input was the programatically-added currency symbol.\n */\n private isInputValueTheCurrencySymbol(inputValue: string): boolean {\n /* istanbul ignore next */\n const currencySymbol = (\n (this.autonumericOptions as AutoNumeric.Options)?.currencySymbol ?? ''\n ).trim();\n return !!currencySymbol && inputValue === currencySymbol;\n }\n\n private getInputValue(): string {\n return this.elementRef.nativeElement.value;\n }\n\n private updateAutonumericInstance(): void {\n this.autonumericInstance.update(\n this.autonumericOptions as AutoNumeric.Options\n );\n }\n\n private mergeOptions(value: SkyAutonumericOptions): SkyAutonumericOptions {\n const globalOptions = this.globalConfig.getConfig();\n\n let newOptions: SkyAutonumericOptions;\n if (typeof value === 'string') {\n const predefinedOptions = AutoNumeric.getPredefinedOptions();\n newOptions = predefinedOptions[\n value as keyof AutoNumeric.Options\n ] as AutoNumeric.Options;\n } else {\n newOptions = value;\n }\n\n return Object.assign({}, globalOptions, newOptions);\n }\n\n /* istanbul ignore next */\n private onChange = (_: number | undefined) => {};\n /* istanbul ignore next */\n private onTouched = () => {};\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { SkyAutonumericDirective } from './autonumeric.directive';\n\n@NgModule({\n declarations: [SkyAutonumericDirective],\n imports: [CommonModule, FormsModule, ReactiveFormsModule],\n exports: [SkyAutonumericDirective],\n})\nexport class SkyAutonumericModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAIA;;;;MAOa,6BAA6B;;;;;IAKjC,SAAS;QACd,OAAO,EAAE,CAAC;KACX;;2HAPU,6BAA6B;+HAA7B,6BAA6B,cAF5B,MAAM;4FAEP,6BAA6B;kBAHzC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;ACiBD;AACA,MAAM,8BAA8B,GAAG;IACrC,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,MAAM,uBAAuB,CAAC;IACtD,KAAK,EAAE,IAAI;CACZ,CAAC;AAEF,MAAM,yBAAyB,GAAG;IAChC,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,UAAU,CAAC,MAAM,uBAAuB,CAAC;IACtD,KAAK,EAAE,IAAI;CACZ,CAAC;AACF;AAEA;;;;MAQa,uBAAuB;IAoBlC,YACU,UAAsB,EACtB,YAA2C,EAC3C,QAAmB,EACnB,cAAiC;QAHjC,eAAU,GAAV,UAAU,CAAY;QACtB,iBAAY,GAAZ,YAAY,CAA+B;QAC3C,aAAQ,GAAR,QAAQ,CAAW;QACn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qHAvKU,uBAAuB;yGAAvB,uBAAuB,2IAFvB,CAAC,8BAA8B,EAAE,yBAAyB,CAAC;4FAE3D,uBAAuB;kBAJnC,SAAS;mBAAC;oBACT,QAAQ,EAAE,uBAAuB;oBACjC,SAAS,EAAE,CAAC,8BAA8B,EAAE,yBAAyB,CAAC;iBACvE;kMAQY,cAAc;sBADxB,KAAK;gBAgHC,MAAM;sBADZ,YAAY;uBAAC,MAAM;;;MC3JT,oBAAoB;;kHAApB,oBAAoB;mHAApB,oBAAoB,iBAJhB,uBAAuB,aAC5B,YAAY,EAAE,WAAW,EAAE,mBAAmB,aAC9C,uBAAuB;mHAEtB,oBAAoB,YAHtB,CAAC,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAC;4FAG9C,oBAAoB;kBALhC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;oBACvC,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAC;oBACzD,OAAO,EAAE,CAAC,uBAAuB,CAAC;iBACnC;;;ACVD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"skyux-autonumeric.js","sources":["../../../../../libs/components/autonumeric/src/lib/modules/autonumeric/autonumeric-options-provider.ts","../../../../../libs/components/autonumeric/src/lib/modules/autonumeric/autonumeric.directive.ts","../../../../../libs/components/autonumeric/src/lib/modules/autonumeric/autonumeric.module.ts","../../../../../libs/components/autonumeric/src/skyux-autonumeric.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { SkyAutonumericOptions } from './autonumeric-options';\n\n/**\n * Provides options to the underlying [autoNumeric utility](https://github.com/autoNumeric/autoNumeric).\n * This can set global options on multiple input fields.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyAutonumericOptionsProvider {\n /**\n * Specifies the value for a settings object to pass to the autoNumeric utility.\n * This overrides any default options specified by the `skyAutonumeric` attribute.\n */\n public getConfig(): SkyAutonumericOptions {\n return {};\n }\n}\n","import {\n ChangeDetectorRef,\n Directive,\n ElementRef,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Renderer2,\n forwardRef,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\n\nimport AutoNumeric from 'autonumeric';\nimport { Subject, fromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyAutonumericOptions } from './autonumeric-options';\nimport { SkyAutonumericOptionsProvider } from './autonumeric-options-provider';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_AUTONUMERIC_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyAutonumericDirective),\n multi: true,\n};\n\nconst SKY_AUTONUMERIC_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyAutonumericDirective),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Wraps the [autoNumeric utility](https://github.com/autoNumeric/autoNumeric) to format\n * any type of number, including currency.\n */\n@Directive({\n selector: 'input[skyAutonumeric]',\n providers: [SKY_AUTONUMERIC_VALUE_ACCESSOR, SKY_AUTONUMERIC_VALIDATOR],\n})\nexport class SkyAutonumericDirective\n implements OnInit, OnDestroy, ControlValueAccessor, Validator\n{\n /**\n * Assigns the name of a property from `SkyAutonumericOptionsProvider`.\n */\n @Input()\n public set skyAutonumeric(value: SkyAutonumericOptions) {\n this.autonumericOptions = this.mergeOptions(value);\n this.updateAutonumericInstance();\n }\n\n private autonumericInstance: AutoNumeric;\n private autonumericOptions: SkyAutonumericOptions | undefined;\n private control: AbstractControl | undefined;\n private isFirstChange = true;\n private value: number | undefined;\n\n private ngUnsubscribe = new Subject<void>();\n\n constructor(\n private elementRef: ElementRef,\n private globalConfig: SkyAutonumericOptionsProvider,\n private renderer: Renderer2,\n private changeDetector: ChangeDetectorRef\n ) {\n this.autonumericInstance = new AutoNumeric(this.elementRef.nativeElement);\n }\n\n public ngOnInit(): void {\n // Ensure that we set the global config even if no local config has been given.\n if (!this.autonumericOptions) {\n this.autonumericOptions = this.globalConfig.getConfig();\n }\n this.updateAutonumericInstance();\n\n fromEvent(this.elementRef.nativeElement, 'input')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n const numericValue: number | undefined = this.getNumericValue();\n\n /* istanbul ignore else */\n if (this.value !== numericValue) {\n this.value = numericValue;\n this.onChange(numericValue);\n }\n\n /* istanbul ignore else */\n if (this.control && !this.control.dirty) {\n this.control.markAsDirty();\n }\n\n this.changeDetector.markForCheck();\n });\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n /**\n * Implemented as part of ControlValueAccessor.\n */\n public setDisabledState(value: boolean): void {\n this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', value);\n }\n\n public writeValue(value: number | undefined): void {\n if (this.value !== value) {\n this.value = value;\n this.onChange(value);\n\n // Mark the control as \"pristine\" if it is initialized with a value.\n const initializedWithValue =\n this.isFirstChange && this.control && this.value !== null;\n if (initializedWithValue) {\n this.isFirstChange = false;\n this.control!.markAsPristine();\n }\n }\n\n if (typeof value === 'number') {\n this.autonumericInstance.set(value);\n } else {\n this.autonumericInstance.clear();\n }\n }\n\n public validate(control: AbstractControl): ValidationErrors | null {\n const noErrors = null; // tslint:disable-line: no-null-keyword\n\n if (!this.control) {\n this.control = control;\n }\n\n if (control.value === null || control.value === undefined) {\n return noErrors;\n }\n\n if (typeof control.value !== 'number') {\n return {\n notTypeOfNumber: { value: control.value },\n };\n }\n\n return noErrors;\n }\n\n public registerOnChange(fn: (value: number | undefined) => void): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n @HostListener('blur')\n public onBlur(): void {\n this.onTouched();\n }\n\n private getNumericValue(): number | undefined {\n const inputValue = this.getInputValue();\n return inputValue && !this.isInputValueTheCurrencySymbol(inputValue)\n ? this.autonumericInstance.getNumber()\n : undefined;\n }\n\n /**\n * Due to AutoNumeric's hover logic - when AutoNumeric has a currency symbol the value\n * that we get back on empty fields will be the currency symbol.\n * The following logic ensures that we don't accidentally set\n * a form value when the only input was the programatically-added currency symbol.\n */\n private isInputValueTheCurrencySymbol(inputValue: string): boolean {\n /* istanbul ignore next */\n const currencySymbol = (\n (this.autonumericOptions as AutoNumeric.Options)?.currencySymbol ?? ''\n ).trim();\n return !!currencySymbol && inputValue === currencySymbol;\n }\n\n private getInputValue(): string {\n return this.elementRef.nativeElement.value;\n }\n\n private updateAutonumericInstance(): void {\n this.autonumericInstance.update(\n this.autonumericOptions as AutoNumeric.Options\n );\n }\n\n private mergeOptions(value: SkyAutonumericOptions): SkyAutonumericOptions {\n const globalOptions = this.globalConfig.getConfig();\n\n let newOptions: SkyAutonumericOptions;\n if (typeof value === 'string') {\n const predefinedOptions = AutoNumeric.getPredefinedOptions();\n newOptions = predefinedOptions[\n value as keyof AutoNumeric.Options\n ] as AutoNumeric.Options;\n } else {\n newOptions = value;\n }\n\n return Object.assign({}, globalOptions, newOptions);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onChange = (_: number | undefined) => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onTouched = () => {};\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { SkyAutonumericDirective } from './autonumeric.directive';\n\n@NgModule({\n declarations: [SkyAutonumericDirective],\n imports: [CommonModule, FormsModule, ReactiveFormsModule],\n exports: [SkyAutonumericDirective],\n})\nexport class SkyAutonumericModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAIA;;;;MAOa,6BAA6B;;;;;IAKjC,SAAS;QACd,OAAO,EAAE,CAAC;KACX;;2HAPU,6BAA6B;+HAA7B,6BAA6B,cAF5B,MAAM;4FAEP,6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1,15 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyux/autonumeric",
|
|
3
|
-
"version": "5.
|
|
4
|
-
"dependencies": {
|
|
5
|
-
"autonumeric": "4.6.0",
|
|
6
|
-
"tslib": "^2.3.1"
|
|
7
|
-
},
|
|
8
|
-
"peerDependencies": {
|
|
9
|
-
"@angular/common": "^12.2.16",
|
|
10
|
-
"@angular/core": "^12.2.16",
|
|
11
|
-
"@angular/forms": "^12.2.16"
|
|
12
|
-
},
|
|
3
|
+
"version": "5.7.0",
|
|
13
4
|
"author": "Blackbaud, Inc.",
|
|
14
5
|
"keywords": [
|
|
15
6
|
"blackbaud",
|
|
@@ -24,6 +15,15 @@
|
|
|
24
15
|
"url": "https://github.com/blackbaud/skyux/issues"
|
|
25
16
|
},
|
|
26
17
|
"homepage": "https://github.com/blackbaud/skyux#readme",
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@angular/common": "^12.2.16",
|
|
20
|
+
"@angular/core": "^12.2.16",
|
|
21
|
+
"@angular/forms": "^12.2.16"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"autonumeric": "4.6.0",
|
|
25
|
+
"tslib": "^2.3.1"
|
|
26
|
+
},
|
|
27
27
|
"main": "bundles/skyux-autonumeric.umd.js",
|
|
28
28
|
"module": "fesm2015/skyux-autonumeric.js",
|
|
29
29
|
"es2015": "fesm2015/skyux-autonumeric.js",
|