@eui/components 19.1.1 → 19.1.2-snapshot-1741266669094
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/docs/dependencies.html +2 -2
- package/docs/js/search/search_index.js +2 -2
- package/eui-input-number/eui-input-number.component.d.ts +18 -2
- package/eui-input-number/eui-input-number.component.d.ts.map +1 -1
- package/eui-input-number/eui-number-control.directive.d.ts +1 -1
- package/eui-input-number/eui-number-control.directive.d.ts.map +1 -1
- package/eui-textarea/eui-textarea.component.d.ts.map +1 -1
- package/fesm2022/eui-components-eui-input-number.mjs +118 -35
- package/fesm2022/eui-components-eui-input-number.mjs.map +1 -1
- package/fesm2022/eui-components-eui-textarea.mjs +2 -2
- package/fesm2022/eui-components-eui-textarea.mjs.map +1 -1
- package/package.json +4 -4
@@ -1,4 +1,4 @@
|
|
1
|
-
import { DoCheck, ElementRef, OnChanges, OnDestroy, OnInit, Renderer2, SimpleChanges
|
1
|
+
import { DoCheck, ElementRef, Injector, OnChanges, OnDestroy, OnInit, Renderer2, SimpleChanges } from '@angular/core';
|
2
2
|
import { LocaleService } from '@eui/core';
|
3
3
|
import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
|
4
4
|
import Cleave from 'cleave.js';
|
@@ -185,6 +185,7 @@ export declare class EuiInputNumberComponent extends InputDirective implements O
|
|
185
185
|
*
|
186
186
|
* @param value The formatted number you want to parse e.g. 111,888.22
|
187
187
|
* @param userPrevLocaleState Use previous locale state to parse the value. By default, is false
|
188
|
+
* @param replaceSymbol Replace the decimal symbol with a dot. By default, is false
|
188
189
|
* @private
|
189
190
|
*/
|
190
191
|
private parseNumber;
|
@@ -213,7 +214,7 @@ export declare class EuiInputNumberComponent extends InputDirective implements O
|
|
213
214
|
/**
|
214
215
|
* Decimal adjustment of a number.
|
215
216
|
*
|
216
|
-
* @param
|
217
|
+
* @param value The number or string representation of a number.
|
217
218
|
* @param exp The exponent (the 10 logarithm of the adjustment base).
|
218
219
|
* @returns The adjusted value.
|
219
220
|
*/
|
@@ -224,6 +225,21 @@ export declare class EuiInputNumberComponent extends InputDirective implements O
|
|
224
225
|
* @param value
|
225
226
|
*/
|
226
227
|
private isDefined;
|
228
|
+
/**
|
229
|
+
* Check if the value is a valid number. Take into account the Big numbers
|
230
|
+
* more than 16 digits. Check if string contains only digits and dots.
|
231
|
+
* The number value must not be formatted.
|
232
|
+
* @param value the value to check
|
233
|
+
* @private
|
234
|
+
*/
|
235
|
+
private isItaNumber;
|
236
|
+
/**
|
237
|
+
* Parse the value to a number. For large numbers, the value is a string.
|
238
|
+
* The number value must not be formatted.
|
239
|
+
* @param value the value to parse
|
240
|
+
* @private
|
241
|
+
*/
|
242
|
+
private parseBigNumber;
|
227
243
|
static ɵfac: i0.ɵɵFactoryDeclaration<EuiInputNumberComponent, [null, null, { optional: true; }, null, null, null, null]>;
|
228
244
|
static ɵcmp: i0.ɵɵComponentDeclaration<EuiInputNumberComponent, "input[euiInputNumber]", never, { "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "leadingZero": { "alias": "leadingZero"; "required": false; }; "isInvalid": { "alias": "isInvalid"; "required": false; }; "fractionDigits": { "alias": "fractionDigits"; "required": false; }; "digits": { "alias": "digits"; "required": false; }; "fillFraction": { "alias": "fillFraction"; "required": false; }; "roundUp": { "alias": "roundUp"; "required": false; }; "noFormat": { "alias": "noFormat"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.EuiClearableDirective; inputs: { "euiClearable": "euiClearable"; "readonly": "readonly"; "disabled": "disabled"; }; outputs: {}; }, { directive: typeof i1.EuiLoadingDirective; inputs: { "euiLoading": "euiLoading"; "readonly": "readonly"; }; outputs: {}; }]>;
|
229
245
|
static ngAcceptInputType_min: unknown;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"eui-input-number.component.d.ts","sourceRoot":"","sources":["../../eui-input-number/eui-input-number.component.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"eui-input-number.component.d.ts","sourceRoot":"","sources":["../../eui-input-number/eui-input-number.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,OAAO,EACP,UAAU,EAIV,QAAQ,EAIR,SAAS,EACT,SAAS,EACT,MAAM,EAGN,SAAS,EACT,aAAa,EAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAe,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,YAAY,EAA+C,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE/G,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;;;AAKxD,MAAM,WAAW,cAAe,SAAQ,MAAM;IAC1C,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,4BAA4B,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1C,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IACpC,gBAAgB,CAAC,EAAE,CAAC,KA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AAO,CAAC,WAAW;IAWnB;;;;;;OAMG;IACH,OAAO,CAAC,OAAO;IAWf;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAItB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAkCtB;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAyFrB;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAIjB;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IAKnB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;yCAxrBb,uBAAuB;2CAAvB,uBAAuB;kCA8rByutP,OAAQ;kCAAR,OAAQ;0CAAR,OAAQ;qCAAR,OAAQ;2CAA3l2O,OAAQ;sCAA2k2O,OAAQ;uCAA3l2O,OAAQ;CADjsX"}
|
@@ -38,7 +38,7 @@ export declare class EuiInputNumberDirective implements ControlValueAccessor, On
|
|
38
38
|
private onTouched;
|
39
39
|
/**
|
40
40
|
* Handle the value changes of the input element and update the value of the
|
41
|
-
* directive and the form control.
|
41
|
+
* directive and the form control. For large numbers, the value is a string.
|
42
42
|
*
|
43
43
|
* @param event
|
44
44
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"eui-number-control.directive.d.ts","sourceRoot":"","sources":["../../eui-input-number/eui-number-control.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAsB,MAAM,EAAyB,MAAM,eAAe,CAAC;AACzG,OAAO,EAAE,oBAAoB,EAAqB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAkB,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;;AAIvF;;;;;;;;;;;GAWG;AACH,qBAWa,uBAAwB,YAAW,oBAAoB,EAAE,MAAM;IAUpE,OAAO,CAAC,UAAU;IACN,OAAO,CAAC,kBAAkB;IACpB,OAAO,CAAC,QAAQ;IACb,OAAO,CAAC,UAAU;IAZ3C;;OAEG;IACH,OAAO,CAAC,KAAK,CAAS;IAGtB,OAAO,CAAC,QAAQ,CAAmB;gBAGvB,UA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Component extends InputDirective {
|
|
189
189
|
if (Object.hasOwn(changes, 'roundUp')) {
|
190
190
|
if (changes['roundUp'].currentValue > 0) {
|
191
191
|
if (this.cleaveInstance) {
|
192
|
-
let number =
|
193
|
-
number = this.decimalAdjust(number, this.roundUp
|
192
|
+
let number = this.parseNumber(this.cleaveInstance.getRawValue(), false, false);
|
193
|
+
number = this.decimalAdjust(number, this.roundUp);
|
194
194
|
this.cleaveInstance.setRawValue(number.toString());
|
195
195
|
}
|
196
196
|
}
|
@@ -199,7 +199,7 @@ class EuiInputNumberComponent extends InputDirective {
|
|
199
199
|
// parse number
|
200
200
|
const number = this.parseNumber(changes['placeholder'].currentValue?.toString() || undefined);
|
201
201
|
// set placeholder in case none is provided
|
202
|
-
this.setPlaceholderAttribute(
|
202
|
+
this.setPlaceholderAttribute(!this.isItaNumber(number.toString()) ? changes['placeholder'].currentValue : number);
|
203
203
|
}
|
204
204
|
}
|
205
205
|
ngOnDestroy() {
|
@@ -218,19 +218,19 @@ class EuiInputNumberComponent extends InputDirective {
|
|
218
218
|
// create a clone of cleaveInstance
|
219
219
|
const cloneInstance = new Cleave(div, { ...this.options, numeralDecimalScale: 8 });
|
220
220
|
cloneInstance.setRawValue(value.toString());
|
221
|
-
let number =
|
222
|
-
number = this.decimalAdjust(number, this.roundUp
|
223
|
-
if (
|
224
|
-
this.cleaveInstance.setRawValue(number.toString());
|
221
|
+
let number = this.parseNumber(cloneInstance.getRawValue(), false, false);
|
222
|
+
number = this.decimalAdjust(number, this.roundUp);
|
223
|
+
if (this.isItaNumber(number.toString())) {
|
225
224
|
// TODO: investigate in the future how can this be avoided
|
226
225
|
setTimeout(() => {
|
226
|
+
this.cleaveInstance.setRawValue(number.toString());
|
227
227
|
// this.writeValue(number.toString());
|
228
228
|
}, 0);
|
229
229
|
}
|
230
230
|
}
|
231
231
|
}
|
232
232
|
onKeyDown(e) {
|
233
|
-
// check if it's a single symbol and not Special like (Ctrl, backspace etc)
|
233
|
+
// check if it's a single symbol and not Special like (Ctrl, backspace etc.)
|
234
234
|
if (e?.key?.length <= 1 && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
235
235
|
// stop event propagation if key pressed is not a number or locale character or minus sign
|
236
236
|
if (Number.isNaN(Number.parseInt(e.key, 10)) &&
|
@@ -277,8 +277,8 @@ class EuiInputNumberComponent extends InputDirective {
|
|
277
277
|
}
|
278
278
|
// in case round UP is enabled
|
279
279
|
if (this.roundUp > 0) {
|
280
|
-
const number =
|
281
|
-
this.cleaveInstance.setRawValue(this.decimalAdjust(number, this.roundUp
|
280
|
+
const number = this.parseNumber(this.cleaveInstance.getRawValue(), false, false);
|
281
|
+
this.cleaveInstance.setRawValue(this.decimalAdjust(number, this.roundUp).toString());
|
282
282
|
}
|
283
283
|
// in case min is set and value is less than min reset to the min value
|
284
284
|
if (this.min !== null && this.min !== undefined && Number.parseFloat(this.cleaveInstance.getRawValue()) < this.min) {
|
@@ -352,8 +352,8 @@ class EuiInputNumberComponent extends InputDirective {
|
|
352
352
|
opts.onValueChanged = onChangeCallback || this.onValueChanged.bind(this);
|
353
353
|
// in case round UP is enabled
|
354
354
|
if (this.roundUp > 0) {
|
355
|
-
const number =
|
356
|
-
this._elementRef.nativeElement.value = this.decimalAdjust(number, this.roundUp
|
355
|
+
const number = this.parseNumber(this._elementRef.nativeElement.value);
|
356
|
+
this._elementRef.nativeElement.value = this.decimalAdjust(number, this.roundUp);
|
357
357
|
}
|
358
358
|
// create the Cleave instance with the new or updated options
|
359
359
|
this.cleaveInstance = new Cleave(this._elementRef.nativeElement, opts);
|
@@ -394,7 +394,7 @@ class EuiInputNumberComponent extends InputDirective {
|
|
394
394
|
if (this.fillFraction) {
|
395
395
|
this.applyFractionFill(target.rawValue);
|
396
396
|
}
|
397
|
-
this.onChange(
|
397
|
+
this.onChange(this.parseNumber(target.rawValue, false, false));
|
398
398
|
// fill leading zero
|
399
399
|
if (this.leadingZero) {
|
400
400
|
const size = this.leadingZero > this.digits && this.digits > 0 ? this.digits : this.leadingZero;
|
@@ -463,9 +463,10 @@ class EuiInputNumberComponent extends InputDirective {
|
|
463
463
|
*
|
464
464
|
* @param value The formatted number you want to parse e.g. 111,888.22
|
465
465
|
* @param userPrevLocaleState Use previous locale state to parse the value. By default, is false
|
466
|
+
* @param replaceSymbol Replace the decimal symbol with a dot. By default, is false
|
466
467
|
* @private
|
467
468
|
*/
|
468
|
-
parseNumber(value, userPrevLocaleState = false) {
|
469
|
+
parseNumber(value, userPrevLocaleState = false, replaceSymbol = true) {
|
469
470
|
// locale state
|
470
471
|
const locale = userPrevLocaleState ? this.localeService?.previousLocale : this.localeService?.currentLocale || this.locale_id || 'en';
|
471
472
|
// get decimal and group symbols
|
@@ -473,7 +474,7 @@ class EuiInputNumberComponent extends InputDirective {
|
|
473
474
|
const groupSymbol = getGroup(locale);
|
474
475
|
// replace symbols to parse number
|
475
476
|
const parsedNumber = value?.split(groupSymbol).join('').split(decimalSymbol).join('.');
|
476
|
-
return
|
477
|
+
return this.parseBigNumber(replaceSymbol ? parsedNumber : value);
|
477
478
|
}
|
478
479
|
/**
|
479
480
|
* Pad leading zero to the number
|
@@ -544,27 +545,85 @@ class EuiInputNumberComponent extends InputDirective {
|
|
544
545
|
/**
|
545
546
|
* Decimal adjustment of a number.
|
546
547
|
*
|
547
|
-
* @param
|
548
|
+
* @param value The number or string representation of a number.
|
548
549
|
* @param exp The exponent (the 10 logarithm of the adjustment base).
|
549
550
|
* @returns The adjusted value.
|
550
551
|
*/
|
551
552
|
decimalAdjust(value, exp) {
|
552
|
-
//
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
553
|
+
// Ensure exp is a number
|
554
|
+
exp = +Number(exp);
|
555
|
+
// Convert input to string if it's a number
|
556
|
+
const valueStr = typeof value === 'number' ? value.toString() : String(value);
|
557
|
+
// Handle empty or invalid inputs
|
558
|
+
if (!valueStr || isNaN(Number(valueStr))) {
|
559
|
+
return '';
|
560
|
+
}
|
561
|
+
try {
|
562
|
+
// Check if the value is negative
|
563
|
+
const isNegative = valueStr.startsWith('-');
|
564
|
+
// Get the absolute value string
|
565
|
+
const absoluteValueStr = isNegative ? valueStr.substring(1) : valueStr;
|
566
|
+
// Split the number into integer and decimal parts
|
567
|
+
const parts = absoluteValueStr.split('.');
|
568
|
+
let integerPart = parts[0] || '0'; // Default to '0' if empty
|
569
|
+
let decimalPart = parts.length > 1 ? parts[1] : '';
|
570
|
+
// If there's no decimal part and exp > 0, we should add zeros
|
571
|
+
if (decimalPart === '' && exp > 0) {
|
572
|
+
decimalPart = '0'.repeat(exp);
|
573
|
+
}
|
574
|
+
// Pad decimal part with zeros if needed
|
575
|
+
if (decimalPart.length < exp) {
|
576
|
+
decimalPart = decimalPart.padEnd(exp, '0');
|
577
|
+
}
|
578
|
+
// Determine if we need to round up
|
579
|
+
let roundUp = false;
|
580
|
+
if (decimalPart.length > exp) {
|
581
|
+
const nextDigit = parseInt(decimalPart.charAt(exp), 10);
|
582
|
+
roundUp = nextDigit >= 5;
|
583
|
+
}
|
584
|
+
// Trim the decimal part to the required precision
|
585
|
+
decimalPart = decimalPart.substring(0, exp);
|
586
|
+
// Handle rounding
|
587
|
+
if (roundUp) {
|
588
|
+
if (exp === 0) {
|
589
|
+
// If exp is 0, we need to round the integer part
|
590
|
+
integerPart = (BigInt(integerPart) + 1n).toString();
|
591
|
+
}
|
592
|
+
else {
|
593
|
+
// Create a number from the decimal part
|
594
|
+
let decimalNum = parseInt(decimalPart, 10);
|
595
|
+
// Add 1 to the decimal part
|
596
|
+
decimalNum += 1;
|
597
|
+
// Check if we need to carry over to the integer part
|
598
|
+
if (decimalNum.toString().length > exp) {
|
599
|
+
integerPart = (BigInt(integerPart) + 1n).toString();
|
600
|
+
decimalNum = 0;
|
601
|
+
}
|
602
|
+
// Convert back to string and pad with leading zeros if needed
|
603
|
+
decimalPart = decimalNum.toString().padStart(exp, '0');
|
604
|
+
}
|
605
|
+
}
|
606
|
+
// Combine the parts
|
607
|
+
let result;
|
608
|
+
if (exp > 0) {
|
609
|
+
// Remove trailing zeros if they're not significant
|
610
|
+
let trimmedDecimalPart = decimalPart;
|
611
|
+
while (trimmedDecimalPart.length > 0 && trimmedDecimalPart.charAt(trimmedDecimalPart.length - 1) === '0') {
|
612
|
+
trimmedDecimalPart = trimmedDecimalPart.substring(0, trimmedDecimalPart.length - 1);
|
613
|
+
}
|
614
|
+
result = trimmedDecimalPart.length > 0 ? `${integerPart}.${trimmedDecimalPart}` : integerPart;
|
615
|
+
}
|
616
|
+
else {
|
617
|
+
result = integerPart;
|
618
|
+
}
|
619
|
+
// Restore the negative sign if needed
|
620
|
+
return isNegative ? '-' + result : result;
|
621
|
+
}
|
622
|
+
catch (error) {
|
623
|
+
console.error('Error in decimalAdjust:', error);
|
624
|
+
// If there's an error, return a formatted original value or '0'
|
625
|
+
return valueStr || '0';
|
626
|
+
}
|
568
627
|
}
|
569
628
|
/**
|
570
629
|
* Checks whether a value is defined or not
|
@@ -574,6 +633,28 @@ class EuiInputNumberComponent extends InputDirective {
|
|
574
633
|
isDefined(value) {
|
575
634
|
return value !== undefined && value !== null;
|
576
635
|
}
|
636
|
+
/**
|
637
|
+
* Check if the value is a valid number. Take into account the Big numbers
|
638
|
+
* more than 16 digits. Check if string contains only digits and dots.
|
639
|
+
* The number value must not be formatted.
|
640
|
+
* @param value the value to check
|
641
|
+
* @private
|
642
|
+
*/
|
643
|
+
isItaNumber(value) {
|
644
|
+
const length = value?.split('.')[0].length;
|
645
|
+
return length > 15 ? /^\d+(\.\d+)?$/.test(value) : !isNaN(Number(value));
|
646
|
+
}
|
647
|
+
/**
|
648
|
+
* Parse the value to a number. For large numbers, the value is a string.
|
649
|
+
* The number value must not be formatted.
|
650
|
+
* @param value the value to parse
|
651
|
+
* @private
|
652
|
+
*/
|
653
|
+
parseBigNumber(value) {
|
654
|
+
// for large numbers, the value is a string
|
655
|
+
const length = value?.split('.')[0].length;
|
656
|
+
return length > 15 ? value : Number.parseFloat(value);
|
657
|
+
}
|
577
658
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EuiInputNumberComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.LocaleService, optional: true }, { token: LOCALE_ID }, { token: i0.Injector }, { token: DOCUMENT }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component }); }
|
578
659
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.1", type: EuiInputNumberComponent, isStandalone: true, selector: "input[euiInputNumber]", inputs: { min: ["min", "min", numberAttribute], max: ["max", "max", numberAttribute], leadingZero: ["leadingZero", "leadingZero", numberAttribute], isInvalid: "isInvalid", fractionDigits: "fractionDigits", digits: ["digits", "digits", numberAttribute], fillFraction: ["fillFraction", "fillFraction", booleanAttribute], roundUp: ["roundUp", "roundUp", numberAttribute], noFormat: ["noFormat", "noFormat", booleanAttribute], value: "value" }, host: { listeners: { "blur": "onTouched()", "paste": "onPaste($event)", "keydown": "onKeyDown($event)", "focusout": "onFocusout()" }, properties: { "class": "this.cssClasses", "attr.type": "this.type" } }, usesInheritance: true, usesOnChanges: true, hostDirectives: [{ directive: i2.EuiClearableDirective, inputs: ["euiClearable", "euiClearable", "readonly", "readonly", "disabled", "disabled"] }, { directive: i2.EuiLoadingDirective, inputs: ["euiLoading", "euiLoading", "readonly", "readonly"] }], ngImport: i0, template: '', isInline: true, styles: [":root{--_eui-scrollbars-foreground-color: var(--eui-c-neutral-lightest)}html.eui-t-dark{--_eui-scrollbars-foreground-color: var(--eui-c-neutral-light)}.eui-19 :host.eui-input-number{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:var(--eui-f-m);appearance:none;background-color:var(--eui-c-white);border:1px solid var(--eui-c-neutral-lighter);border-radius:var(--eui-br-m);box-shadow:none;color:var(--eui-c-text);padding:calc(var(--eui-s-xs) - 1px) calc(var(--eui-s-m) - 1px);width:100%}.eui-19 :host.eui-input-number:focus:not([readonly]){outline:2px solid var(--eui-c-focus)!important;outline-offset:-2px!important;transition:none}.eui-19 :host.eui-input-number:focus-visible:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 :host.eui-input-number [tabindex=\"0\"]:focus:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 :host.eui-input-number:not([hidden]){display:block}.eui-19 :host.eui-input-number::placeholder{color:var(--eui-c-neutral-lighter)!important;opacity:1}.eui-19 :host.eui-input-number[readonly]{background-color:transparent;border-color:transparent;box-shadow:none;height:inherit;padding-left:0;padding-right:0;pointer-events:none}.eui-19 :host.eui-input-number[readonly]+.eui-feedback-message,.eui-19 :host.eui-input-number[readonly]+.eui-input-maxlength{appearance:none;display:none}.eui-19 :host.eui-input-number[disabled]:not([readonly]),.eui-19 :host.eui-input-number--disabled:not([readonly]){background-color:var(--eui-c-neutral-bg-light)!important;border:1px solid var(--eui-c-neutral-lightest);color:var(--eui-c-neutral-light);pointer-events:none}.eui-19 :host.eui-input-number--invalid,.eui-19 :host.eui-input-number--danger{border:1px solid var(--eui-c-danger)}.eui-19 :host.eui-input-number--clearable{padding-right:var(--eui-s-2xl)}.eui-19 :host.eui-input-number--clearable-icon{cursor:pointer;position:absolute;right:var(--eui-s-s);-webkit-user-select:none;user-select:none;visibility:visible}.eui-19 :host.eui-input-number--clearable-icon:focus:not([readonly]){outline:2px solid var(--eui-c-focus)!important;outline-offset:-2px!important;transition:none}.eui-19 :host.eui-input-number--clearable-icon:focus-visible:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 :host.eui-input-number--clearable-icon [tabindex=\"0\"]:focus:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 :host.eui-input-number--clearable-icon>svg{fill:var(--eui-c-neutral-lighter)}.eui-19 :host.eui-input-number--clearable-icon>svg:hover{fill:var(--eui-c-danger)}.eui-19 :host.eui-input-number--loading{padding-right:var(--eui-s-2xl)}.eui-19 :host.eui-input-number--loading-icon{align-items:center;display:flex}.eui-19 :host.eui-input-number--loading-icon:after,.eui-19 :host.eui-input-number--loading-icon:before{content:\"\";height:var(--eui-s-l);position:absolute;right:var(--eui-s-s);width:var(--eui-s-l)}.eui-19 :host.eui-input-number--loading-icon:before{border:var(--eui-s-2xs) solid rgba(0,0,0,.35);border-radius:100%}.eui-19 :host.eui-input-number--loading-icon:after{animation:loading .6s linear;animation-iteration-count:infinite;border-color:var(--eui-c-white) transparent transparent;border-radius:100%;border-style:solid;border-width:var(--eui-s-2xs);box-shadow:0 0 0 1px transparent}.eui-19 :host.eui-input-number--loading-icon--sm:after,.eui-19 :host.eui-input-number--loading-icon--sm:before{height:var(--eui-s-m);width:var(--eui-s-m)}@keyframes loading{to{transform:rotate(360deg)}}.eui-19 :host.eui-input-number[readonly]{pointer-events:auto}\n"] }); }
|
579
660
|
}
|
@@ -720,16 +801,18 @@ class EuiInputNumberDirective {
|
|
720
801
|
}
|
721
802
|
/**
|
722
803
|
* Handle the value changes of the input element and update the value of the
|
723
|
-
* directive and the form control.
|
804
|
+
* directive and the form control. For large numbers, the value is a string.
|
724
805
|
*
|
725
806
|
* @param event
|
726
807
|
*/
|
727
808
|
valueChanges(event) {
|
728
809
|
const { target } = event;
|
729
810
|
this.euiNumberComponent['onValueChanged'](event);
|
730
|
-
|
811
|
+
// for large numbers, the value is a string
|
812
|
+
const length = target.rawValue.split('.')[0].length;
|
813
|
+
const numberCoerce = length > 15 ? target.rawValue : Number.parseFloat(target.rawValue);
|
731
814
|
if (this.value !== numberCoerce && this.onChange) {
|
732
|
-
this.onChange(isNaN(numberCoerce) ? null : numberCoerce);
|
815
|
+
this.onChange(length > 15 ? target.rawValue : (isNaN(numberCoerce) ? null : numberCoerce));
|
733
816
|
}
|
734
817
|
}
|
735
818
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EuiInputNumberDirective, deps: [{ token: i0.ElementRef }, { token: EuiInputNumberComponent, optional: true }, { token: DOCUMENT }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Directive }); }
|