@ptsecurity/mosaic 17.2.7 → 17.2.9
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/core/locales/locale-service.d.ts +11 -0
- package/esm2022/core/locales/locale-service.mjs +34 -1
- package/esm2022/core/version.mjs +2 -2
- package/esm2022/input/input-number.mjs +31 -59
- package/esm2022/input/input.mjs +3 -3
- package/fesm2022/ptsecurity-mosaic-core.mjs +35 -2
- package/fesm2022/ptsecurity-mosaic-core.mjs.map +1 -1
- package/fesm2022/ptsecurity-mosaic-input.mjs +33 -61
- package/fesm2022/ptsecurity-mosaic-input.mjs.map +1 -1
- package/input/input-number.d.ts +10 -11
- package/input/input.d.ts +1 -1
- package/package.json +10 -10
@@ -869,6 +869,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImpor
|
|
869
869
|
type: Inject,
|
870
870
|
args: [MC_LOCALE_DATA]
|
871
871
|
}] }] });
|
872
|
+
/**
|
873
|
+
* Function that returns a string representation of a number without localized separators
|
874
|
+
*/
|
875
|
+
function normalizeNumber(value, customConfig) {
|
876
|
+
if (value === null || value === undefined) {
|
877
|
+
return '';
|
878
|
+
}
|
879
|
+
const { groupSeparator, fractionSeparator } = customConfig;
|
880
|
+
const groupSeparatorRegexp = new RegExp(`[${groupSeparator.join('')}]`, 'g');
|
881
|
+
const fractionSeparatorRegexp = new RegExp(`\\${fractionSeparator}`, 'g');
|
882
|
+
return value.toString()
|
883
|
+
.replace(groupSeparatorRegexp, '')
|
884
|
+
.replace(fractionSeparatorRegexp, '.');
|
885
|
+
}
|
886
|
+
/**
|
887
|
+
* Function that parse string and return a number. The string can be in any locale.
|
888
|
+
*/
|
889
|
+
function checkAndNormalizeLocalizedNumber(num) {
|
890
|
+
if (num === null || num === undefined) {
|
891
|
+
return null;
|
892
|
+
}
|
893
|
+
/* if some locale input config satisfies pasted number, try to normalise with selected locale config */
|
894
|
+
let numberOutput = null;
|
895
|
+
const locales = MC_DEFAULT_LOCALE_DATA_FACTORY();
|
896
|
+
for (const config of locales.items.map(({ id }) => locales[id].input.number)) {
|
897
|
+
const normalized = +normalizeNumber(num, config);
|
898
|
+
if (!Number.isNaN(normalized)) {
|
899
|
+
numberOutput = normalized;
|
900
|
+
break;
|
901
|
+
}
|
902
|
+
}
|
903
|
+
return numberOutput;
|
904
|
+
}
|
872
905
|
|
873
906
|
class McLocaleServiceModule {
|
874
907
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: McLocaleServiceModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
@@ -2983,11 +3016,11 @@ const validationTooltipShowDelay = 10;
|
|
2983
3016
|
const validationTooltipHideDelay = 3000;
|
2984
3017
|
const MC_VALIDATION = new InjectionToken('McUseValidation', { factory: () => ({ useValidation: true }) });
|
2985
3018
|
|
2986
|
-
const VERSION = new Version('17.2.
|
3019
|
+
const VERSION = new Version('17.2.9+sha-77c9026');
|
2987
3020
|
|
2988
3021
|
/**
|
2989
3022
|
* Generated bundle index. Do not edit.
|
2990
3023
|
*/
|
2991
3024
|
|
2992
|
-
export { AbsoluteDateFormatterPipe, AbsoluteDateShortFormatterPipe, AbsoluteDateTimeFormatterPipe, AbsoluteShortDateTimeFormatterPipe, AnimationCurves, BOTTOM_LEFT_POSITION_PRIORITY, BOTTOM_POSITION_PRIORITY, BOTTOM_RIGHT_POSITION_PRIORITY, DateAdapter, DateFormatter, EXTENDED_OVERLAY_POSITIONS, ErrorStateMatcher, LEFT_BOTTOM_POSITION_PRIORITY, LEFT_POSITION_PRIORITY, LEFT_TOP_POSITION_PRIORITY, MC_CUSTOM_SCROLL_STRATEGY_PROVIDER, MC_DATE_FORMATS, MC_DATE_LOCALE, MC_DATE_LOCALE_FACTORY, MC_DEFAULT_LOCALE_DATA_FACTORY, MC_DEFAULT_LOCALE_ID, MC_FORM_FIELD_REF, MC_LABEL_GLOBAL_OPTIONS, MC_LOCALE_DATA, MC_LOCALE_ID, MC_LOCALE_SERVICE, MC_NUMBER_FORMATTER_DEFAULT_OPTIONS, MC_NUMBER_FORMATTER_OPTIONS, MC_OPTION_ACTION_PARENT, MC_OPTION_PARENT_COMPONENT, MC_PARENT_ANIMATION_COMPONENT, MC_SANITY_CHECKS, MC_SELECT_SCROLL_STRATEGY, MC_SELECT_SCROLL_STRATEGY_PROVIDER, MC_TITLE_TEXT_REF, MC_VALIDATION, McCommonModule, McDataSizeModule, McDataSizePipe, McDecimalPipe, McForm, McFormElement, McFormattersModule, McFormsModule, McHighlightModule, McHighlightPipe, McLine, McLineModule, McLineSetter, McLocaleService, McLocaleServiceModule, McMeasureScrollbarService, McOptgroup, McOptgroupBase, McOptgroupMixinBase, McOption, McOptionActionBase, McOptionActionComponent, McOptionActionMixinBase, McOptionBase, McOptionModule, McOptionSelectionChange, McPopUp, McPopUpTrigger, McPseudoCheckbox, McPseudoCheckboxBase, McPseudoCheckboxMixinBase, McPseudoCheckboxModule, McRoundDecimalPipe, McSelectFooter, McSelectMatcher, McSelectSearch, McSelectSearchEmptyResult, McSelectTrigger, McTableNumberPipe, McVirtualOption, MeasurementSystem, MultipleMode, NUMBER_FORMAT_REGEXP, POSITION_MAP, POSITION_PRIORITY_STRATEGY, POSITION_TO_CSS_MAP, PopUpPlacements, PopUpSizes, PopUpTriggers, PopUpVisibility, RIGHT_BOTTOM_POSITION_PRIORITY, RIGHT_POSITION_PRIORITY, RIGHT_TOP_POSITION_PRIORITY, RangeDateFormatterPipe, RangeDateTimeFormatterPipe, RangeMiddleDateTimeFormatterPipe, RangeShortDateFormatterPipe, RangeShortDateTimeFormatterPipe, RelativeDateFormatterPipe, RelativeDateTimeFormatterPipe, RelativeShortDateFormatterPipe, RelativeShortDateTimeFormatterPipe, SELECT_PANEL_INDENT_PADDING_X, SELECT_PANEL_MAX_HEIGHT, SELECT_PANEL_PADDING_X, SELECT_PANEL_VIEWPORT_PADDING, ShowOnDirtyErrorStateMatcher, TOP_LEFT_POSITION_PRIORITY, TOP_POSITION_PRIORITY, TOP_RIGHT_POSITION_PRIORITY, ThemePalette, VERSION, countGroupLabelsBeforeOption, enUSLocaleData, esLALocaleData, escapeRegExp, faIRLocaleData, fadeAnimation, formatDataSize, getHumanizedBytes, getMcSelectDynamicMultipleError, getMcSelectNonArrayValueError, getMcSelectNonFunctionValueError, getOptionScrollPosition, isBoolean, isWithin, mcSelectAnimations, mcSelectScrollStrategyProviderFactory, mixinColor, mixinDisabled, mixinErrorState, mixinTabIndex, ptBRLocaleData, ruRULocaleData, selectEvents, sizeUnitsConfig, toBoolean, validationTooltipHideDelay, validationTooltipShowDelay, znCNLocaleData };
|
3025
|
+
export { AbsoluteDateFormatterPipe, AbsoluteDateShortFormatterPipe, AbsoluteDateTimeFormatterPipe, AbsoluteShortDateTimeFormatterPipe, AnimationCurves, BOTTOM_LEFT_POSITION_PRIORITY, BOTTOM_POSITION_PRIORITY, BOTTOM_RIGHT_POSITION_PRIORITY, DateAdapter, DateFormatter, EXTENDED_OVERLAY_POSITIONS, ErrorStateMatcher, LEFT_BOTTOM_POSITION_PRIORITY, LEFT_POSITION_PRIORITY, LEFT_TOP_POSITION_PRIORITY, MC_CUSTOM_SCROLL_STRATEGY_PROVIDER, MC_DATE_FORMATS, MC_DATE_LOCALE, MC_DATE_LOCALE_FACTORY, MC_DEFAULT_LOCALE_DATA_FACTORY, MC_DEFAULT_LOCALE_ID, MC_FORM_FIELD_REF, MC_LABEL_GLOBAL_OPTIONS, MC_LOCALE_DATA, MC_LOCALE_ID, MC_LOCALE_SERVICE, MC_NUMBER_FORMATTER_DEFAULT_OPTIONS, MC_NUMBER_FORMATTER_OPTIONS, MC_OPTION_ACTION_PARENT, MC_OPTION_PARENT_COMPONENT, MC_PARENT_ANIMATION_COMPONENT, MC_SANITY_CHECKS, MC_SELECT_SCROLL_STRATEGY, MC_SELECT_SCROLL_STRATEGY_PROVIDER, MC_TITLE_TEXT_REF, MC_VALIDATION, McCommonModule, McDataSizeModule, McDataSizePipe, McDecimalPipe, McForm, McFormElement, McFormattersModule, McFormsModule, McHighlightModule, McHighlightPipe, McLine, McLineModule, McLineSetter, McLocaleService, McLocaleServiceModule, McMeasureScrollbarService, McOptgroup, McOptgroupBase, McOptgroupMixinBase, McOption, McOptionActionBase, McOptionActionComponent, McOptionActionMixinBase, McOptionBase, McOptionModule, McOptionSelectionChange, McPopUp, McPopUpTrigger, McPseudoCheckbox, McPseudoCheckboxBase, McPseudoCheckboxMixinBase, McPseudoCheckboxModule, McRoundDecimalPipe, McSelectFooter, McSelectMatcher, McSelectSearch, McSelectSearchEmptyResult, McSelectTrigger, McTableNumberPipe, McVirtualOption, MeasurementSystem, MultipleMode, NUMBER_FORMAT_REGEXP, POSITION_MAP, POSITION_PRIORITY_STRATEGY, POSITION_TO_CSS_MAP, PopUpPlacements, PopUpSizes, PopUpTriggers, PopUpVisibility, RIGHT_BOTTOM_POSITION_PRIORITY, RIGHT_POSITION_PRIORITY, RIGHT_TOP_POSITION_PRIORITY, RangeDateFormatterPipe, RangeDateTimeFormatterPipe, RangeMiddleDateTimeFormatterPipe, RangeShortDateFormatterPipe, RangeShortDateTimeFormatterPipe, RelativeDateFormatterPipe, RelativeDateTimeFormatterPipe, RelativeShortDateFormatterPipe, RelativeShortDateTimeFormatterPipe, SELECT_PANEL_INDENT_PADDING_X, SELECT_PANEL_MAX_HEIGHT, SELECT_PANEL_PADDING_X, SELECT_PANEL_VIEWPORT_PADDING, ShowOnDirtyErrorStateMatcher, TOP_LEFT_POSITION_PRIORITY, TOP_POSITION_PRIORITY, TOP_RIGHT_POSITION_PRIORITY, ThemePalette, VERSION, checkAndNormalizeLocalizedNumber, countGroupLabelsBeforeOption, enUSLocaleData, esLALocaleData, escapeRegExp, faIRLocaleData, fadeAnimation, formatDataSize, getHumanizedBytes, getMcSelectDynamicMultipleError, getMcSelectNonArrayValueError, getMcSelectNonFunctionValueError, getOptionScrollPosition, isBoolean, isWithin, mcSelectAnimations, mcSelectScrollStrategyProviderFactory, mixinColor, mixinDisabled, mixinErrorState, mixinTabIndex, normalizeNumber, ptBRLocaleData, ruRULocaleData, selectEvents, sizeUnitsConfig, toBoolean, validationTooltipHideDelay, validationTooltipShowDelay, znCNLocaleData };
|
2993
3026
|
//# sourceMappingURL=ptsecurity-mosaic-core.mjs.map
|