Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

21
node_modules/react-number-format/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020-present Sudhanshu Yadav
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

80
node_modules/react-number-format/README.md generated vendored Executable file
View File

@@ -0,0 +1,80 @@
# react-number-format
React Number Format is an input-formatter library with a sophisticated and light weight caret engine. It ensures that a user can only enter text that meets specific numeric or string patterns, and formats the input value for display.
### Features
1. Prefix, suffix and thousands separator.
1. Input Masking.
1. Format number in an input or format as a simple text.
1. Custom pattern formatting.
1. Custom formatting handler.
1. Fully customizable
### Demos
See the many DEMO sections in [the documentation](https://s-yadav.github.io/react-number-format/docs/props).
### Install
[![npm](https://img.shields.io/npm/dm/react-number-format.svg)](https://www.npmjs.com/package/react-number-format)
Using `npm`
```
npm install react-number-format
```
Using `yarn`
```
yarn add react-number-format
```
### Documentation
Read the full documentation here
[https://s-yadav.github.io/react-number-format/docs/intro](https://s-yadav.github.io/react-number-format/docs/intro)
#### ES6
Numeric Format
```js
import { NumericFormat } from 'react-number-format';
```
NumericFormat Props: [https://s-yadav.github.io/react-number-format/docs/numeric_format](https://s-yadav.github.io/react-number-format/docs/numeric_format)
Pattern Format
```js
import { PatternFormat } from 'react-number-format';
```
PatternFormat Props: [https://s-yadav.github.io/react-number-format/docs/pattern_format](https://s-yadav.github.io/react-number-format/docs/pattern_format)
### Migrate from v4 to v5
[https://s-yadav.github.io/react-number-format/docs/migration](https://s-yadav.github.io/react-number-format/docs/migration)
### v4 doc
[v4 Docs](https://github.com/s-yadav/react-number-format/blob/master/documentation/v4.md)
### Development
- Clone the repository or download the zip
- `npm i -g yarn` to download Yarn
- `yarn` to install dependencies
- `yarn start` to run example server (<http://localhost:8084/>)
- `yarn test` to test changes
- `yarn build` to bundle files
#### Testing
Test cases are written in jasmine and run by karma
Test files : /test/\*\*/\*.spec.js
To run test : `yarn test`

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

109
node_modules/react-number-format/package.json generated vendored Executable file
View File

@@ -0,0 +1,109 @@
{
"name": "react-number-format",
"description": "React component to format number in an input or as a text.",
"version": "5.4.5",
"main": "dist/react-number-format.cjs.js",
"module": "dist/react-number-format.es.js",
"types": "types/index.d.ts",
"files": [
"dist",
"types"
],
"sideEffects": false,
"author": "Sudhanshu Yadav",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/s-yadav/react-number-format"
},
"homepage": "https://s-yadav.github.io/react-number-format/docs/intro",
"bugs": {
"mail": "sudhanshuyadav2@gmail.com",
"url": "https://github.com/s-yadav/react-number-format/issues"
},
"keywords": [
"react-component",
"react",
"currency",
"input",
"number",
"number-format",
"mask"
],
"scripts": {
"start": "webpack-dev-server --hot",
"start-doc": "docusaurus start documentation/v5 --port 9000",
"build-doc": "docusaurus build documentation/v5",
"publish-doc": "node publish_doc.js",
"format": "prettier --write ./src ./test ./example",
"build": "cross-env yarn build-dist && yarn build-types && yarn test-build && yarn test-ts && yarn format && yarn build-doc && yarn publish-doc",
"build-dist": "cross-env NODE_ENV=production rollup -c rollup.config.js",
"build-types": "tsc -p tsconfig.build.json",
"test": "vitest && yarn test-ts",
"coverage": "vitest run --coverage",
"test-build": "vitest run",
"test-ts": "yarn tsc --noEmit",
"lint": "cross-env eslint src/**"
},
"devDependencies": {
"@babel/cli": "^7.6.2",
"@babel/core": "^7.6.2",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-object-rest-spread": "^7.6.2",
"@babel/plugin-transform-flow-strip-types": "^7.4.4",
"@babel/preset-env": "^7.6.2",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.6.2",
"@cmfcmf/docusaurus-search-local": "^0.11.0",
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/preset-classic": "2.0.0-beta.18",
"@mdx-js/react": "^1.6.22",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-typescript": "^8.3.0",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.5.2",
"@types/react": "^18.0.6",
"@typescript-eslint/parser": "^5.15.0",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.6",
"babel-plugin-add-module-exports": "^1.0.2",
"babel-plugin-transform-object-assign": "^6.22.0",
"classnames": "^2.2.6",
"clsx": "^1.1.1",
"cross-env": "^6.0.3",
"eslint": "^6.5.1",
"eslint-config-prettier": "^8.3.0",
"eslint-loader": "^3.0.2",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-react": "^7.15.1",
"gh-pages": "^4.0.0",
"jsdom": "^24.0.0",
"material-ui": "^0.20.2",
"pascal-case": "3.1.2",
"prettier": "^2.2.1",
"prism-react-renderer": "^1.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-transform-hmr": "^1.0.4",
"rollup": "^1.22.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-filesize": "^6.2.0",
"rollup-plugin-license": "^0.12.1",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-uglify": "^6.0.3",
"ts-loader": "^9.2.6",
"typescript": "^4.6.3",
"vitest": "^1.6.0",
"webpack": "^5.69.1",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4"
},
"peerDependencies": {
"react": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react-dom": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
},
"packageManager": "yarn@1.22.19"
}

9
node_modules/react-number-format/types/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import NumberFormatBase from './number_format_base';
import NumericFormat from './numeric_format';
import PatternFormat from './pattern_format';
import { format as numericFormatter, removeFormatting as removeNumericFormat, getCaretBoundary as getNumericCaretBoundary, useNumericFormat } from './numeric_format';
import { format as patternFormatter, removeFormatting as removePatternFormat, getCaretBoundary as getPatternCaretBoundary, usePatternFormat } from './pattern_format';
export { NumberFormatBase, NumericFormat, PatternFormat };
export type { NumericFormatProps, NumberFormatBaseProps, PatternFormatProps, SourceInfo, NumberFormatValues, OnValueChange, InputAttributes, ChangeMeta, } from './types';
export { numericFormatter, removeNumericFormat, getNumericCaretBoundary, useNumericFormat };
export { patternFormatter, removePatternFormat, getPatternCaretBoundary, usePatternFormat };

View File

@@ -0,0 +1,3 @@
import React from 'react';
import { NumberFormatBaseProps, InputAttributes } from './types';
export default function NumberFormatBase<BaseType = InputAttributes>(props: NumberFormatBaseProps<BaseType>): React.ReactElement;

View File

@@ -0,0 +1,7 @@
import React from 'react';
import { NumericFormatProps, ChangeMeta, InputAttributes, NumberFormatBaseProps } from './types';
export declare function format<BaseType = InputAttributes>(numStr: string, props: NumericFormatProps<BaseType>): string;
export declare function removeFormatting<BaseType = InputAttributes>(value: string, changeMeta: ChangeMeta, props: NumericFormatProps<BaseType>): string;
export declare function getCaretBoundary<BaseType = InputAttributes>(formattedValue: string, props: NumericFormatProps<BaseType>): boolean[];
export declare function useNumericFormat<BaseType = InputAttributes>(props: NumericFormatProps<BaseType>): NumberFormatBaseProps<BaseType>;
export default function NumericFormat<BaseType = InputAttributes>(props: NumericFormatProps<BaseType>): React.ReactElement;

View File

@@ -0,0 +1,7 @@
import React from 'react';
import { PatternFormatProps, InputAttributes, ChangeMeta, NumberFormatBaseProps } from './types';
export declare function format<BaseType = InputAttributes>(numStr: string, props: PatternFormatProps<BaseType>): string;
export declare function removeFormatting<BaseType = InputAttributes>(value: string, changeMeta: ChangeMeta, props: PatternFormatProps<BaseType>): string;
export declare function getCaretBoundary<BaseType = InputAttributes>(formattedValue: string, props: PatternFormatProps<BaseType>): boolean[];
export declare function usePatternFormat<BaseType = InputAttributes>(props: PatternFormatProps<BaseType>): NumberFormatBaseProps<BaseType>;
export default function PatternFormat<BaseType = InputAttributes>(props: PatternFormatProps<BaseType>): React.ReactElement;

92
node_modules/react-number-format/types/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,92 @@
import React, { SyntheticEvent } from 'react';
export declare type Timeout = ReturnType<typeof setTimeout>;
export interface NumberFormatState {
value?: string;
numAsString?: string;
mounted: boolean;
}
export interface NumberFormatValues {
floatValue: number | undefined;
formattedValue: string;
value: string;
}
export declare enum SourceType {
event = "event",
props = "prop"
}
export interface SourceInfo {
event?: SyntheticEvent<HTMLInputElement>;
source: SourceType;
}
export declare type FormatInputValueFunction = (inputValue: string) => string;
export declare type RemoveFormattingFunction = (inputValue: string, changeMeta?: ChangeMeta) => string;
export interface SyntheticInputEvent extends React.SyntheticEvent<HTMLInputElement> {
readonly target: HTMLInputElement;
data: any;
}
export declare type ChangeMeta = {
from: {
start: number;
end: number;
};
to: {
start: number;
end: number;
};
lastValue: string;
};
export declare type InputAttributes = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'defaultValue' | 'value' | 'children'>;
declare type NumberFormatProps<Props, BaseType = InputAttributes> = Props & Omit<InputAttributes, keyof BaseType> & Omit<BaseType, keyof Props | 'ref'> & {
customInput?: React.ComponentType<BaseType>;
};
export declare type OnValueChange = (values: NumberFormatValues, sourceInfo: SourceInfo) => void;
export declare type IsCharacterSame = (compareProps: {
currentValue: string;
lastValue: string;
formattedValue: string;
currentValueIndex: number;
formattedValueIndex: number;
}) => boolean;
declare type NumberFormatBase = {
type?: 'text' | 'tel' | 'password';
displayType?: 'input' | 'text';
inputMode?: InputAttributes['inputMode'];
renderText?: (formattedValue: string, otherProps: Partial<NumberFormatBase>) => React.ReactNode;
format?: FormatInputValueFunction;
removeFormatting?: RemoveFormattingFunction;
getInputRef?: ((el: HTMLInputElement) => void) | React.Ref<any>;
value?: number | string | null;
defaultValue?: number | string | null;
valueIsNumericString?: boolean;
onValueChange?: OnValueChange;
isAllowed?: (values: NumberFormatValues) => boolean;
onKeyDown?: InputAttributes['onKeyDown'];
onMouseUp?: InputAttributes['onMouseUp'];
onChange?: InputAttributes['onChange'];
onFocus?: InputAttributes['onFocus'];
onBlur?: InputAttributes['onBlur'];
getCaretBoundary?: (formattedValue: string) => boolean[];
isValidInputCharacter?: (character: string) => boolean;
isCharacterSame?: IsCharacterSame;
};
export declare type NumberFormatBaseProps<BaseType = InputAttributes> = NumberFormatProps<NumberFormatBase, BaseType>;
export declare type InternalNumberFormatBase = Omit<NumberFormatBase, 'format' | 'removeFormatting' | 'getCaretBoundary' | 'isValidInputCharacter' | 'isCharacterSame'>;
export declare type NumericFormatProps<BaseType = InputAttributes> = NumberFormatProps<InternalNumberFormatBase & {
thousandSeparator?: boolean | string;
decimalSeparator?: string;
allowedDecimalSeparators?: Array<string>;
thousandsGroupStyle?: 'thousand' | 'lakh' | 'wan' | 'none';
decimalScale?: number;
fixedDecimalScale?: boolean;
allowNegative?: boolean;
allowLeadingZeros?: boolean;
suffix?: string;
prefix?: string;
}, BaseType>;
export declare type PatternFormatProps<BaseType = InputAttributes> = NumberFormatProps<InternalNumberFormatBase & {
format: string;
mask?: string | string[];
allowEmptyFormatting?: boolean;
patternChar?: string;
}, BaseType>;
export {};

92
node_modules/react-number-format/types/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,92 @@
import { NumberFormatBaseProps, FormatInputValueFunction, OnValueChange, IsCharacterSame } from './types';
export declare function noop(): void;
export declare function returnTrue(): boolean;
export declare function memoizeOnce<T extends unknown[], R extends unknown>(cb: (...args: T) => R): (...args: T) => R;
export declare function charIsNumber(char?: string): boolean;
export declare function isNil(val: any): val is null | undefined;
export declare function isNanValue(val: string | number): boolean;
export declare function isNotValidValue(val: string | number | null | undefined): boolean;
export declare function escapeRegExp(str: string): string;
export declare function getThousandsGroupRegex(thousandsGroupStyle: string): RegExp;
export declare function applyThousandSeparator(str: string, thousandSeparator: string, thousandsGroupStyle: string): string;
export declare function usePersistentCallback<T extends (...args: any[]) => any>(cb: T): T;
export declare function splitDecimal(numStr: string, allowNegative?: boolean): {
beforeDecimal: string;
afterDecimal: string;
hasNegation: boolean;
addNegation: boolean;
};
export declare function fixLeadingZero(numStr?: string): string;
/**
* limit decimal numbers to given scale
* Not used .fixedTo because that will break with big numbers
*/
export declare function limitToScale(numStr: string, scale: number, fixedDecimalScale: boolean): string;
export declare function toNumericString(num: string | number): string;
/**
* This method is required to round prop value to given scale.
* Not used .round or .fixedTo because that will break with big numbers
*/
export declare function roundToPrecision(numStr: string, scale: number, fixedDecimalScale: boolean): string;
/** set the caret positon in an input field **/
export declare function setCaretPosition(el: HTMLInputElement, caretPos: number): boolean;
/**
* TODO: remove dependency of findChangeRange, findChangedRangeFromCaretPositions is better way to find what is changed
* currently this is mostly required by test and isCharacterSame util
* Given previous value and newValue it returns the index
* start - end to which values have changed.
* This function makes assumption about only consecutive
* characters are changed which is correct assumption for caret input.
*/
export declare const findChangeRange: (prevValue: string, newValue: string) => {
from: {
start: number;
end: number;
};
to: {
start: number;
end: number;
};
};
export declare const findChangedRangeFromCaretPositions: (lastCaretPositions: {
selectionStart: number;
selectionEnd: number;
}, currentCaretPosition: number) => {
from: {
start: number;
end: number;
};
to: {
start: number;
end: number;
};
};
export declare function clamp(num: number, min: number, max: number): number;
export declare function geInputCaretPosition(el: HTMLInputElement): number;
export declare function addInputMode(): boolean;
export declare function getDefaultChangeMeta(value: string): {
from: {
start: number;
end: number;
};
to: {
start: number;
end: number;
};
lastValue: string;
};
export declare function getMaskAtIndex(mask: string | string[], index: number): string;
export declare function getCaretPosition(newFormattedValue: string, lastFormattedValue: string, curValue: string, curCaretPos: number, boundary: boolean[], isValidInputCharacter: (char: string) => boolean,
/**
* format function can change the character, the caret engine relies on mapping old value and new value
* In such case if character is changed, parent can tell which chars are equivalent
* Some example, all allowedDecimalCharacters are updated to decimalCharacters, 2nd case if user is coverting
* number to different numeric system.
*/
isCharacterSame?: IsCharacterSame): any;
export declare function getCaretPosInBoundary(value: string, caretPos: number, boundary: boolean[], direction?: string): number;
export declare function caretUnknownFormatBoundary(formattedValue: string): boolean[];
export declare function useInternalValues(value: string | number | null | undefined, defaultValue: string | number | null | undefined, valueIsNumericString: boolean, format: FormatInputValueFunction, removeFormatting: NumberFormatBaseProps['removeFormatting'], onValueChange?: NumberFormatBaseProps['onValueChange']): [{
formattedValue: string;
numAsString: string;
}, OnValueChange];