generated from Tinkoff/angular-open-source-starter
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚀 - Delete calibration on initialization + create maskitoInitialCalibrationPlugin
#604
Labels
2.x.x
Candidate for 2.0.0 release
feature
New feature or request
scope: core
Related to @maskito/core
Comments
nsbarsukov
added
feature
New feature or request
2.x.x
Candidate for 2.0.0 release
labels
Oct 18, 2023
For these cases maskito/projects/demo-integrations/cypress/tests/kit/number/number-prefix-postfix.cy.ts Lines 277 to 304 in a6777ec
Developer can use the optional argument of @tuiPure
private calculateMask(
precision: number,
decimalMode: TuiDecimal,
decimalSeparator: string,
thousandSeparator: string,
min: number,
max: number,
prefix: string,
postfix: string,
): MaskitoOptions {
const generatorParams = {
decimalSeparator,
thousandSeparator,
min,
max,
prefix,
postfix,
precision: decimalMode === 'never' ? 0 : precision,
decimalZeroPadding: decimalMode === 'always',
};
const {plugins, ...options} = maskitoNumberOptionsGenerator(generatorParams);
const initialCalibrationPlugin = maskitoInitialCalibrationPlugin(
maskitoNumberOptionsGenerator({
...generatorParams,
min: Number.MIN_SAFE_INTEGER,
max: Number.MAX_SAFE_INTEGER
})
);
return {
...options,
plugins: [
...plugins,
initialCalibrationPlugin,
maskitoCaretGuard(value => [
prefix.length,
value.length - postfix.length,
]),
],
};
} |
This was referenced Oct 18, 2023
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
2.x.x
Candidate for 2.0.0 release
feature
New feature or request
scope: core
Related to @maskito/core
Which package(s) are relevant/related to the feature request?
@maskito/core
Description
Delete this line
maskito/projects/core/src/lib/mask.ts
Line 39 in a6777ec
+ add
maskitoInitialCalibrationPlugin
(inside@maskito/core
or@maskito/kit
???):Why?
The current implementation is not so flexible as required.
Sometimes the such initial calibration is not required for developer, and develop wants calibration to work only on user's interactions.
The new way allows to select: use
maskitoInitialCalibrationPlugin
or not.The text was updated successfully, but these errors were encountered: