@ptsecurity/mosaic 16.0.0 → 16.1.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/_theming.scss +9 -1
- package/_visual.scss +1 -1
- package/code-block/_code-block-theme.scss +8 -0
- package/core/locales/en-US.d.ts +7 -0
- package/core/locales/es-LA.d.ts +6 -0
- package/core/locales/fa-IR.d.ts +6 -0
- package/core/locales/locale-service.d.ts +39 -0
- package/core/locales/pt-BR.d.ts +6 -0
- package/core/locales/ru-RU.d.ts +8 -0
- package/core/locales/zh-CN.d.ts +6 -0
- package/core/pop-up/constants.d.ts +2 -1
- package/dropdown/dropdown.scss +6 -6
- package/esm2022/core/locales/en-US.mjs +9 -2
- package/esm2022/core/locales/es-LA.mjs +9 -1
- package/esm2022/core/locales/fa-IR.mjs +7 -1
- package/esm2022/core/locales/pt-BR.mjs +7 -1
- package/esm2022/core/locales/ru-RU.mjs +12 -2
- package/esm2022/core/locales/zh-CN.mjs +7 -1
- package/esm2022/core/option/option.mjs +2 -1
- package/esm2022/core/pop-up/constants.mjs +2 -1
- package/esm2022/core/pop-up/pop-up-trigger.mjs +11 -2
- package/esm2022/core/version.mjs +2 -2
- package/esm2022/datepicker/datepicker-input.directive.mjs +9 -1
- package/esm2022/dropdown/dropdown.component.mjs +3 -3
- package/esm2022/form-field/form-field.mjs +3 -3
- package/esm2022/form-field/password-hint.mjs +8 -5
- package/esm2022/input/input-number.mjs +260 -42
- package/esm2022/loader-overlay/loader-overlay.component.mjs +2 -2
- package/esm2022/modal/modal.component.mjs +7 -4
- package/esm2022/modal/modal.service.mjs +2 -2
- package/esm2022/navbar/navbar.component.mjs +2 -2
- package/esm2022/navbar/vertical-navbar.component.mjs +3 -3
- package/esm2022/popover/popover.component.mjs +3 -3
- package/esm2022/select/select.component.mjs +4 -4
- package/esm2022/timezone/timezone-select.component.mjs +3 -3
- package/esm2022/tree-select/tree-select.component.mjs +3 -3
- package/fesm2022/ptsecurity-mosaic-core.mjs +57 -3
- package/fesm2022/ptsecurity-mosaic-core.mjs.map +1 -1
- package/fesm2022/ptsecurity-mosaic-datepicker.mjs +8 -0
- package/fesm2022/ptsecurity-mosaic-datepicker.mjs.map +1 -1
- package/fesm2022/ptsecurity-mosaic-dropdown.mjs +2 -2
- package/fesm2022/ptsecurity-mosaic-dropdown.mjs.map +1 -1
- package/fesm2022/ptsecurity-mosaic-form-field.mjs +9 -6
- package/fesm2022/ptsecurity-mosaic-form-field.mjs.map +1 -1
- package/fesm2022/ptsecurity-mosaic-input.mjs +258 -42
- package/fesm2022/ptsecurity-mosaic-input.mjs.map +1 -1
- package/fesm2022/ptsecurity-mosaic-loader-overlay.mjs +2 -2
- package/fesm2022/ptsecurity-mosaic-loader-overlay.mjs.map +1 -1
- package/fesm2022/ptsecurity-mosaic-modal.mjs +7 -4
- package/fesm2022/ptsecurity-mosaic-modal.mjs.map +1 -1
- package/fesm2022/ptsecurity-mosaic-navbar.mjs +4 -4
- package/fesm2022/ptsecurity-mosaic-navbar.mjs.map +1 -1
- package/fesm2022/ptsecurity-mosaic-popover.mjs +2 -2
- package/fesm2022/ptsecurity-mosaic-popover.mjs.map +1 -1
- package/fesm2022/ptsecurity-mosaic-select.mjs +3 -3
- package/fesm2022/ptsecurity-mosaic-select.mjs.map +1 -1
- package/fesm2022/ptsecurity-mosaic-timezone.mjs +2 -2
- package/fesm2022/ptsecurity-mosaic-timezone.mjs.map +1 -1
- package/fesm2022/ptsecurity-mosaic-tree-select.mjs +2 -2
- package/fesm2022/ptsecurity-mosaic-tree-select.mjs.map +1 -1
- package/form-field/password-hint.d.ts +2 -1
- package/input/input-number.d.ts +61 -10
- package/loader-overlay/loader-overlay.scss +9 -2
- package/modal/modal.component.d.ts +1 -0
- package/navbar/navbar-item.scss +5 -0
- package/package.json +19 -18
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/default-theme.css +1 -1
@@ -2,17 +2,17 @@ import * as i3$1 from '@angular/cdk/a11y';
|
|
2
2
|
import { A11yModule } from '@angular/cdk/a11y';
|
3
3
|
import { CommonModule } from '@angular/common';
|
4
4
|
import * as i0 from '@angular/core';
|
5
|
-
import {
|
5
|
+
import { forwardRef, EventEmitter, Directive, Attribute, Optional, Inject, Input, InjectionToken, Self, Component, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core';
|
6
6
|
import * as i1 from '@angular/forms';
|
7
|
-
import { NG_VALIDATORS, Validators, FormsModule } from '@angular/forms';
|
7
|
+
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators, FormsModule } from '@angular/forms';
|
8
8
|
import * as i3 from '@ptsecurity/mosaic/core';
|
9
|
-
import { mixinErrorState, PopUpTriggers, McCommonModule } from '@ptsecurity/mosaic/core';
|
9
|
+
import { MC_LOCALE_SERVICE, mixinErrorState, PopUpTriggers, McCommonModule } from '@ptsecurity/mosaic/core';
|
10
10
|
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
11
11
|
import { getSupportedInputTypes } from '@angular/cdk/platform';
|
12
12
|
import * as i4 from '@ptsecurity/mosaic/form-field';
|
13
13
|
import { McFormFieldControl } from '@ptsecurity/mosaic/form-field';
|
14
|
-
import { Subject } from 'rxjs';
|
15
|
-
import { A, C, V, X, Z,
|
14
|
+
import { Subject, Subscription } from 'rxjs';
|
15
|
+
import { A, C, V, X, Z, NUMPAD_MINUS, DASH, FF_MINUS, DELETE, BACKSPACE, TAB, ESCAPE, ENTER, LEFT_ARROW, RIGHT_ARROW, HOME, END, isFunctionKey, isNumberKey, isNumpadKey, UP_ARROW, DOWN_ARROW } from '@ptsecurity/cdk/keycodes';
|
16
16
|
import * as i2 from '@angular/cdk/bidi';
|
17
17
|
import * as i1$1 from '@angular/cdk/overlay';
|
18
18
|
import { McTooltipTrigger, MC_TOOLTIP_SCROLL_STRATEGY } from '@ptsecurity/mosaic/tooltip';
|
@@ -23,6 +23,7 @@ function getMcInputUnsupportedTypeError(inputType) {
|
|
23
23
|
|
24
24
|
const BIG_STEP = 10;
|
25
25
|
const SMALL_STEP = 1;
|
26
|
+
// TODO: подставлять локализованный сплиттер
|
26
27
|
function normalizeSplitter(value) {
|
27
28
|
return value ? value.replace(/,/g, '.') : value;
|
28
29
|
}
|
@@ -46,20 +47,78 @@ function add(value1, value2) {
|
|
46
47
|
const precision = Math.max(getPrecision(value1), getPrecision(value2));
|
47
48
|
return (value1 * precision + value2 * precision) / precision;
|
48
49
|
}
|
50
|
+
const MC_NUMBER_INPUT_VALUE_ACCESSOR = {
|
51
|
+
provide: NG_VALUE_ACCESSOR,
|
52
|
+
useExisting: forwardRef(() => McNumberInput),
|
53
|
+
multi: true
|
54
|
+
};
|
49
55
|
class McNumberInput {
|
56
|
+
get value() {
|
57
|
+
return this._value;
|
58
|
+
}
|
59
|
+
set value(value) {
|
60
|
+
const oldValue = this.value;
|
61
|
+
this._value = value;
|
62
|
+
if (oldValue !== value) {
|
63
|
+
this.setViewValue(this.formatNumber(value));
|
64
|
+
this.valueChange.emit(value);
|
65
|
+
}
|
66
|
+
}
|
67
|
+
get disabled() {
|
68
|
+
return this._disabled;
|
69
|
+
}
|
70
|
+
set disabled(value) {
|
71
|
+
const newValue = coerceBooleanProperty(value);
|
72
|
+
const element = this.nativeElement;
|
73
|
+
if (this._disabled !== newValue) {
|
74
|
+
this._disabled = newValue;
|
75
|
+
this.disabledChange.emit(newValue);
|
76
|
+
}
|
77
|
+
// We need to null check the `blur` method, because it's undefined during SSR.
|
78
|
+
if (newValue && element.blur) {
|
79
|
+
// Normally, native input elements automatically blur if they turn disabled. This behavior
|
80
|
+
// is problematic, because it would mean that it triggers another change detection cycle,
|
81
|
+
// which then causes a changed after checked error if the input element was focused before.
|
82
|
+
element.blur();
|
83
|
+
}
|
84
|
+
}
|
50
85
|
get nativeElement() {
|
51
86
|
return this.elementRef.nativeElement;
|
52
87
|
}
|
53
|
-
|
88
|
+
get viewValue() {
|
89
|
+
return this.nativeElement.value;
|
90
|
+
}
|
91
|
+
get ngControl() {
|
92
|
+
return this.control;
|
93
|
+
}
|
94
|
+
constructor(elementRef, renderer, step, bigStep, min, max, localeService) {
|
54
95
|
this.elementRef = elementRef;
|
55
|
-
this.
|
56
|
-
this.
|
96
|
+
this.renderer = renderer;
|
97
|
+
this.localeService = localeService;
|
98
|
+
/** Emits when the value changes (either due to user input or programmatic change). */
|
99
|
+
this.valueChange = new EventEmitter();
|
100
|
+
/** Emits when the disabled state has changed */
|
101
|
+
this.disabledChange = new EventEmitter();
|
57
102
|
this.stateChanges = new Subject();
|
103
|
+
this.withThousandSeparator = true;
|
104
|
+
this._disabled = false;
|
105
|
+
this.focused = false;
|
106
|
+
this.localeSubscription = Subscription.EMPTY;
|
107
|
+
// tslint:disable-next-line:no-empty
|
108
|
+
this.onTouched = () => { };
|
109
|
+
// tslint:disable-next-line:no-empty
|
110
|
+
this.cvaOnChange = () => { };
|
111
|
+
this.updateLocaleParams = (id) => {
|
112
|
+
this.numberLocaleConfig = this.localeService.locales[id].input.number;
|
113
|
+
this.setViewValue(this.formatNumber(this.value));
|
114
|
+
};
|
58
115
|
this.step = isDigit(step) ? parseFloat(step) : SMALL_STEP;
|
59
116
|
this.bigStep = isDigit(bigStep) ? parseFloat(bigStep) : BIG_STEP;
|
60
117
|
this.min = isDigit(min) ? parseFloat(min) : -Infinity;
|
61
118
|
this.max = isDigit(max) ? parseFloat(max) : Infinity;
|
119
|
+
setTimeout(() => this.nativeElement.type = 'text', 0);
|
62
120
|
if ('valueAsNumber' in this.nativeElement) {
|
121
|
+
/* переделать алгоритм */
|
63
122
|
Object.defineProperty(Object.getPrototypeOf(this.nativeElement), 'valueAsNumber', {
|
64
123
|
// tslint:disable-next-line:no-reserved-keywords
|
65
124
|
get() {
|
@@ -68,6 +127,38 @@ class McNumberInput {
|
|
68
127
|
}
|
69
128
|
});
|
70
129
|
}
|
130
|
+
this.allNumberLocaleConfigs = this.localeService.locales.items
|
131
|
+
.map((localeItem) => {
|
132
|
+
return { id: localeItem.id, config: this.localeService.locales[localeItem.id].input.number };
|
133
|
+
});
|
134
|
+
this.localeSubscription = this.localeService.changes.subscribe(this.updateLocaleParams);
|
135
|
+
}
|
136
|
+
ngOnDestroy() {
|
137
|
+
this.localeSubscription.unsubscribe();
|
138
|
+
this.valueChange.complete();
|
139
|
+
this.disabledChange.complete();
|
140
|
+
}
|
141
|
+
onContainerClick() {
|
142
|
+
this.focus();
|
143
|
+
}
|
144
|
+
focus() {
|
145
|
+
this.nativeElement.focus();
|
146
|
+
}
|
147
|
+
// Implemented as part of ControlValueAccessor.
|
148
|
+
writeValue(value) {
|
149
|
+
this.value = value;
|
150
|
+
}
|
151
|
+
// Implemented as part of ControlValueAccessor.
|
152
|
+
registerOnChange(fn) {
|
153
|
+
this.cvaOnChange = fn;
|
154
|
+
}
|
155
|
+
// Implemented as part of ControlValueAccessor.
|
156
|
+
registerOnTouched(fn) {
|
157
|
+
this.onTouched = fn;
|
158
|
+
}
|
159
|
+
// Implemented as part of ControlValueAccessor.
|
160
|
+
setDisabledState(isDisabled) {
|
161
|
+
this.disabled = isDisabled;
|
71
162
|
}
|
72
163
|
focusChanged(isFocused) {
|
73
164
|
if (isFocused !== this.focused) {
|
@@ -83,32 +174,39 @@ class McNumberInput {
|
|
83
174
|
const isCtrlV = (e) => e.keyCode === V && (e.ctrlKey || e.metaKey);
|
84
175
|
const isCtrlX = (e) => e.keyCode === X && (e.ctrlKey || e.metaKey);
|
85
176
|
const isCtrlZ = (e) => e.keyCode === Z && (e.ctrlKey || e.metaKey);
|
86
|
-
const
|
87
|
-
|
88
|
-
(e.keyCode >= NUMPAD_ZERO && e.keyCode <= NUMPAD_NINE);
|
89
|
-
const isPeriod = (e) => e.key === '.' || e.key === ',';
|
177
|
+
const isPeriod = (e) => this.numberLocaleConfig.groupSeparator.includes(e.key)
|
178
|
+
|| [this.numberLocaleConfig.fractionSeparator, '.'].includes(e.key);
|
90
179
|
const minuses = [NUMPAD_MINUS, DASH, FF_MINUS];
|
91
180
|
const serviceKeys = [DELETE, BACKSPACE, TAB, ESCAPE, ENTER];
|
92
181
|
const arrows = [LEFT_ARROW, RIGHT_ARROW];
|
93
182
|
const allowedKeys = [HOME, END].concat(arrows).concat(serviceKeys).concat(minuses);
|
94
183
|
if (minuses.includes(keyCode) &&
|
95
|
-
(this.
|
184
|
+
(this.viewValue.includes(event.key) || this.min >= 0)) {
|
96
185
|
event.preventDefault();
|
97
186
|
return;
|
98
187
|
}
|
188
|
+
if (isPeriod(event)) {
|
189
|
+
if (event.key === this.numberLocaleConfig.fractionSeparator &&
|
190
|
+
this.viewValue.indexOf(this.numberLocaleConfig.fractionSeparator) !== -1) {
|
191
|
+
event.preventDefault();
|
192
|
+
return;
|
193
|
+
}
|
194
|
+
}
|
99
195
|
if (allowedKeys.indexOf(keyCode) !== -1 ||
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
196
|
+
[
|
197
|
+
isCtrlA,
|
198
|
+
isCtrlC,
|
199
|
+
isCtrlV,
|
200
|
+
isCtrlX,
|
201
|
+
isCtrlZ,
|
202
|
+
isFunctionKey,
|
203
|
+
isPeriod
|
204
|
+
].some((fn) => fn(event))) {
|
107
205
|
// let it happen, don't do anything
|
108
206
|
return;
|
109
207
|
}
|
110
208
|
// Ensure that it is not a number and stop the keypress
|
111
|
-
if (event.shiftKey || !
|
209
|
+
if (event.shiftKey || !isNumberKey(event) && !isNumpadKey(event)) {
|
112
210
|
event.preventDefault();
|
113
211
|
// process steps
|
114
212
|
const step = event.shiftKey ? this.bigStep : this.step;
|
@@ -120,48 +218,153 @@ class McNumberInput {
|
|
120
218
|
}
|
121
219
|
}
|
122
220
|
}
|
221
|
+
onInput(event) {
|
222
|
+
const currentValueLength = this.formatNumber(this.value)?.length || 0;
|
223
|
+
setTimeout(() => {
|
224
|
+
const fromPaste = event.inputType === 'insertFromPaste';
|
225
|
+
let formattedValue;
|
226
|
+
if (fromPaste) {
|
227
|
+
formattedValue = this.formatNumber(this.valueFromPaste);
|
228
|
+
}
|
229
|
+
else {
|
230
|
+
/*this.viewValue is raw and should be reformatted to localized number */
|
231
|
+
formattedValue = this.formatViewValue();
|
232
|
+
const offsetWhenSeparatorAdded = 2;
|
233
|
+
Promise.resolve().then(() => {
|
234
|
+
if (Math.abs(this.viewValue.length - currentValueLength) === offsetWhenSeparatorAdded) {
|
235
|
+
const cursorPosition = Math.max(0, (this.nativeElement.selectionStart || 0) + Math.sign(this.viewValue.length - currentValueLength));
|
236
|
+
this.renderer.setProperty(this.nativeElement, 'selectionStart', cursorPosition);
|
237
|
+
this.renderer.setProperty(this.nativeElement, 'selectionEnd', cursorPosition);
|
238
|
+
}
|
239
|
+
});
|
240
|
+
}
|
241
|
+
this.setViewValue(formattedValue, !fromPaste);
|
242
|
+
this.viewToModelUpdate(formattedValue);
|
243
|
+
});
|
244
|
+
}
|
123
245
|
onPaste(event) {
|
124
|
-
|
246
|
+
this.valueFromPaste = this.checkAndNormalizeLocalizedNumber(event.clipboardData?.getData('text'));
|
247
|
+
if (this.valueFromPaste === null) {
|
125
248
|
event.preventDefault();
|
126
249
|
}
|
127
250
|
}
|
128
251
|
stepUp(step) {
|
129
|
-
this.
|
130
|
-
const res = Math.max(Math.min(add(this.
|
131
|
-
this.
|
132
|
-
this.
|
252
|
+
this.nativeElement.focus();
|
253
|
+
const res = Math.max(Math.min(add(this.value || 0, step), this.max), this.min);
|
254
|
+
this.setViewValue(this.formatNumber(res));
|
255
|
+
this._value = res;
|
256
|
+
this.cvaOnChange(res);
|
257
|
+
this.valueChange.emit(res);
|
133
258
|
}
|
134
259
|
stepDown(step) {
|
135
|
-
this.
|
136
|
-
const res = Math.min(Math.max(add(this.
|
137
|
-
this.
|
138
|
-
this.
|
260
|
+
this.nativeElement.focus();
|
261
|
+
const res = Math.min(Math.max(add(this.value || 0, -step), this.min), this.max);
|
262
|
+
this.setViewValue(this.formatNumber(res));
|
263
|
+
this._value = res;
|
264
|
+
this.cvaOnChange(res);
|
265
|
+
this.valueChange.emit(res);
|
266
|
+
}
|
267
|
+
setViewValue(value, savePosition = false) {
|
268
|
+
const cursorPosition = this.nativeElement.selectionStart;
|
269
|
+
this.renderer.setProperty(this.nativeElement, 'value', value);
|
270
|
+
if (savePosition) {
|
271
|
+
this.renderer.setProperty(this.nativeElement, 'selectionStart', cursorPosition);
|
272
|
+
this.renderer.setProperty(this.nativeElement, 'selectionEnd', cursorPosition);
|
273
|
+
}
|
139
274
|
}
|
140
|
-
viewToModelUpdate(
|
141
|
-
|
142
|
-
|
275
|
+
viewToModelUpdate(newValue) {
|
276
|
+
const normalizedValue = newValue === null ? null : +this.normalizeNumber(newValue);
|
277
|
+
if (normalizedValue !== this.value) {
|
278
|
+
this._value = normalizedValue;
|
279
|
+
this.cvaOnChange(normalizedValue);
|
280
|
+
this.valueChange.emit(normalizedValue);
|
281
|
+
}
|
282
|
+
this.ngControl?.updateValueAndValidity({ emitEvent: false });
|
283
|
+
}
|
284
|
+
formatViewValue() {
|
285
|
+
if (this.viewValue === null || this.viewValue === '' || Number.isNaN(+this.normalizeNumber(this.viewValue))) {
|
286
|
+
return null;
|
287
|
+
}
|
288
|
+
const separator = this.numberLocaleConfig.groupSeparator.includes(' ')
|
289
|
+
&& this.numberLocaleConfig.fractionSeparator === ','
|
290
|
+
? /[,.]/
|
291
|
+
: this.numberLocaleConfig.fractionSeparator;
|
292
|
+
const [intPart, fractionPart] = this.viewValue.split(separator)
|
293
|
+
.map((valuePart) => this.normalizeNumber(valuePart));
|
294
|
+
return this.createLocalizedNumberFromParts(+intPart, fractionPart);
|
295
|
+
}
|
296
|
+
formatNumber(value) {
|
297
|
+
if (value === null || value === undefined) {
|
298
|
+
return null;
|
299
|
+
}
|
300
|
+
const [intPart, fractionPart] = value.toString().split('.');
|
301
|
+
return this.createLocalizedNumberFromParts(+intPart, fractionPart);
|
302
|
+
}
|
303
|
+
createLocalizedNumberFromParts(intPart, fractionPart) {
|
304
|
+
const formatOptions = {
|
305
|
+
useGrouping: this.withThousandSeparator,
|
306
|
+
maximumFractionDigits: 20
|
307
|
+
};
|
308
|
+
if (this.withThousandSeparator && this.numberLocaleConfig.startFormattingFrom) {
|
309
|
+
formatOptions.useGrouping = intPart >= Math.pow(
|
310
|
+
// tslint:disable-next-line:no-magic-numbers
|
311
|
+
10, this.numberLocaleConfig.startFormattingFrom);
|
312
|
+
}
|
313
|
+
const localeId = this.localeService.id === 'es-LA' ? 'ru-RU' : this.localeService.id;
|
314
|
+
const formatter = new Intl.NumberFormat(localeId, formatOptions);
|
315
|
+
const formattedFractionPart = fractionPart?.split('')
|
316
|
+
.map((numChar) => formatter.format(+numChar)).join('');
|
317
|
+
return formattedFractionPart === undefined
|
318
|
+
? formatter.format(intPart)
|
319
|
+
: `${formatter.format(intPart)}${this.numberLocaleConfig.fractionSeparator}${formattedFractionPart}`;
|
320
|
+
}
|
321
|
+
/**
|
322
|
+
* Method that returns a string representation of a number without localized separators
|
323
|
+
*/
|
324
|
+
normalizeNumber(value, customConfig) {
|
325
|
+
if (value === null || value === undefined) {
|
326
|
+
return '';
|
143
327
|
}
|
328
|
+
const { groupSeparator, fractionSeparator } = customConfig || this.numberLocaleConfig;
|
329
|
+
const groupSeparatorRegexp = new RegExp(`[${groupSeparator.join('')}]`, 'g');
|
330
|
+
const fractionSeparatorRegexp = new RegExp(`\\${fractionSeparator}`, 'g');
|
331
|
+
return value.toString()
|
332
|
+
.replace(groupSeparatorRegexp, '')
|
333
|
+
.replace(fractionSeparatorRegexp, '.');
|
334
|
+
}
|
335
|
+
checkAndNormalizeLocalizedNumber(num) {
|
336
|
+
if (num === null || num === undefined) {
|
337
|
+
return null;
|
338
|
+
}
|
339
|
+
/* if some locale input config satisfies pasted number, try to normalise with selected locale config */
|
340
|
+
let numberOutput = null;
|
341
|
+
for (const { config } of this.allNumberLocaleConfigs) {
|
342
|
+
const normalized = +this.normalizeNumber(num, config);
|
343
|
+
if (!Number.isNaN(normalized)) {
|
344
|
+
numberOutput = normalized;
|
345
|
+
break;
|
346
|
+
}
|
347
|
+
}
|
348
|
+
return numberOutput;
|
144
349
|
}
|
145
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: McNumberInput, deps: [{ token: i0.ElementRef }, { token:
|
146
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.5", type: McNumberInput, selector: "input[mcInput][type=\"number\"]", inputs: { bigStep: "bigStep", step: "step", min: "min", max: "max" }, host: { listeners: { "blur": "focusChanged(false)", "focus": "focusChanged(true)", "paste": "onPaste($event)", "keydown": "onKeyDown($event)" } }, exportAs: ["mcNumericalInput"], ngImport: i0 }); }
|
350
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: McNumberInput, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: 'step', attribute: true }, { token: 'big-step', attribute: true }, { token: 'min', attribute: true }, { token: 'max', attribute: true }, { token: MC_LOCALE_SERVICE, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
351
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.5", type: McNumberInput, selector: "input[mcInput][type=\"number\"]", inputs: { bigStep: "bigStep", step: "step", min: "min", max: "max", withThousandSeparator: "withThousandSeparator", startFormattingFrom: "startFormattingFrom", value: "value", disabled: "disabled" }, host: { listeners: { "blur": "focusChanged(false)", "focus": "focusChanged(true)", "paste": "onPaste($event)", "keydown": "onKeyDown($event)", "input": "onInput($event)" } }, providers: [MC_NUMBER_INPUT_VALUE_ACCESSOR], exportAs: ["mcNumericalInput"], ngImport: i0 }); }
|
147
352
|
}
|
148
353
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: McNumberInput, decorators: [{
|
149
354
|
type: Directive,
|
150
355
|
args: [{
|
151
356
|
selector: `input[mcInput][type="number"]`,
|
152
357
|
exportAs: 'mcNumericalInput',
|
358
|
+
providers: [MC_NUMBER_INPUT_VALUE_ACCESSOR],
|
153
359
|
host: {
|
154
360
|
'(blur)': 'focusChanged(false)',
|
155
361
|
'(focus)': 'focusChanged(true)',
|
156
362
|
'(paste)': 'onPaste($event)',
|
157
|
-
'(keydown)': 'onKeyDown($event)'
|
363
|
+
'(keydown)': 'onKeyDown($event)',
|
364
|
+
'(input)': 'onInput($event)'
|
158
365
|
}
|
159
366
|
}]
|
160
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type:
|
161
|
-
type: Optional
|
162
|
-
}, {
|
163
|
-
type: Self
|
164
|
-
}] }, { type: undefined, decorators: [{
|
367
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
|
165
368
|
type: Attribute,
|
166
369
|
args: ['step']
|
167
370
|
}] }, { type: undefined, decorators: [{
|
@@ -173,6 +376,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImpor
|
|
173
376
|
}] }, { type: undefined, decorators: [{
|
174
377
|
type: Attribute,
|
175
378
|
args: ['max']
|
379
|
+
}] }, { type: i3.McLocaleService, decorators: [{
|
380
|
+
type: Optional
|
381
|
+
}, {
|
382
|
+
type: Inject,
|
383
|
+
args: [MC_LOCALE_SERVICE]
|
176
384
|
}] }]; }, propDecorators: { bigStep: [{
|
177
385
|
type: Input
|
178
386
|
}], step: [{
|
@@ -181,6 +389,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImpor
|
|
181
389
|
type: Input
|
182
390
|
}], max: [{
|
183
391
|
type: Input
|
392
|
+
}], withThousandSeparator: [{
|
393
|
+
type: Input
|
394
|
+
}], startFormattingFrom: [{
|
395
|
+
type: Input
|
396
|
+
}], value: [{
|
397
|
+
type: Input
|
398
|
+
}], disabled: [{
|
399
|
+
type: Input
|
184
400
|
}] } });
|
185
401
|
|
186
402
|
const MC_INPUT_VALUE_ACCESSOR = new InjectionToken('MC_INPUT_VALUE_ACCESSOR');
|
@@ -934,5 +1150,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImpor
|
|
934
1150
|
* Generated bundle index. Do not edit.
|
935
1151
|
*/
|
936
1152
|
|
937
|
-
export { BIG_STEP, MAX_VALIDATOR, MC_INPUT_VALUE_ACCESSOR, MIN_VALIDATOR, MaxValidator, McInput, McInputBase, McInputMixinBase, McInputModule, McInputMono, McInputPassword, McNumberInput, McPasswordToggle, MinValidator, SMALL_STEP, add, getPrecision, isDigit, isFloat, isInt, normalizeSplitter };
|
1153
|
+
export { BIG_STEP, MAX_VALIDATOR, MC_INPUT_VALUE_ACCESSOR, MC_NUMBER_INPUT_VALUE_ACCESSOR, MIN_VALIDATOR, MaxValidator, McInput, McInputBase, McInputMixinBase, McInputModule, McInputMono, McInputPassword, McNumberInput, McPasswordToggle, MinValidator, SMALL_STEP, add, getPrecision, isDigit, isFloat, isInt, normalizeSplitter };
|
938
1154
|
//# sourceMappingURL=ptsecurity-mosaic-input.mjs.map
|