@arkyn/types 1.3.63 → 1.3.65

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  import type { Replacement } from "@react-input/mask";
2
2
  import type { LucideIcon } from "lucide-react";
3
- import type { InputHTMLAttributes } from "react";
3
+ import type { ChangeEvent, InputHTMLAttributes, KeyboardEvent } from "react";
4
4
  type InputBaseTypes = "button" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week";
5
5
  type BaseInputProps<T extends string> = {
6
6
  isLoading?: boolean;
@@ -15,11 +15,13 @@ type BaseInputProps<T extends string> = {
15
15
  name: string;
16
16
  } & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix" | "type" | "name">;
17
17
  type CurrencyInputProps = Omit<BaseInputProps<"currency">, "max" | "defaultValue" | "value" | "onChange"> & {
18
- defaultValue?: number;
19
- onChange?: (value: number) => void;
20
- value?: number;
18
+ defaultValue?: string;
19
+ onChangeValue?: (event: ChangeEvent<HTMLInputElement>, originalValue: string, maskedValue: string) => void;
20
+ onKeyPress?: (event: KeyboardEvent<HTMLInputElement>, originalValue: string, maskedValue: string) => void;
21
+ value?: string;
21
22
  max?: number;
22
- showCents?: boolean;
23
+ locale?: string;
24
+ currency?: string;
23
25
  };
24
26
  type MaskedInputProps = BaseInputProps<"masked"> & {
25
27
  mask: string;
@@ -1 +1 @@
1
- {"version":3,"file":"InputProps.d.ts","sourceRoot":"","sources":["../../src/components/InputProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAEjD,KAAK,cAAc,GACf,QAAQ,GACR,OAAO,GACP,MAAM,GACN,gBAAgB,GAChB,OAAO,GACP,MAAM,GACN,QAAQ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WAAW,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,KAAK,iBAAiB,GAAG,IAAI,CAC3B,cAAc,CAAC,UAAU,CAAC,EAC1B,OAAO,GAAG,cAAc,CACzB,GAAG;IACF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,gBAAgB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEvD,KAAK,UAAU,GACX,kBAAkB,GAClB,gBAAgB,GAChB,gBAAgB,GAChB,iBAAiB,CAAC;AAEtB,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACjB,CAAC"}
1
+ {"version":3,"file":"InputProps.d.ts","sourceRoot":"","sources":["../../src/components/InputProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7E,KAAK,cAAc,GACf,QAAQ,GACR,OAAO,GACP,MAAM,GACN,gBAAgB,GAChB,OAAO,GACP,MAAM,GACN,QAAQ,GACR,OAAO,GACP,OAAO,GACP,QAAQ,GACR,UAAU,GACV,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,MAAM,CAAC;AAEX,KAAK,cAAc,CAAC,CAAC,SAAS,MAAM,IAAI;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,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AG,cAAc,CACzB,GAAG;IACF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,gBAAgB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEvD,KAAK,UAAU,GACX,kBAAkB,GAClB,gBAAgB,GAChB,gBAAgB,GAChB,iBAAiB,CAAC;AAEtB,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkyn/types",
3
- "version": "1.3.63",
3
+ "version": "1.3.65",
4
4
  "main": "./dist/bundle.js",
5
5
  "module": "./src/index.ts",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  import type { Replacement } from "@react-input/mask";
2
2
  import type { LucideIcon } from "lucide-react";
3
- import type { InputHTMLAttributes } from "react";
3
+ import type { ChangeEvent, InputHTMLAttributes, KeyboardEvent } from "react";
4
4
 
5
5
  type InputBaseTypes =
6
6
  | "button"
@@ -48,11 +48,21 @@ type CurrencyInputProps = Omit<
48
48
  BaseInputProps<"currency">,
49
49
  "max" | "defaultValue" | "value" | "onChange"
50
50
  > & {
51
- defaultValue?: number;
52
- onChange?: (value: number) => void;
53
- value?: number;
51
+ defaultValue?: string;
52
+ onChangeValue?: (
53
+ event: ChangeEvent<HTMLInputElement>,
54
+ originalValue: string,
55
+ maskedValue: string
56
+ ) => void;
57
+ onKeyPress?: (
58
+ event: KeyboardEvent<HTMLInputElement>,
59
+ originalValue: string,
60
+ maskedValue: string
61
+ ) => void;
62
+ value?: string;
54
63
  max?: number;
55
- showCents?: boolean;
64
+ locale?: string;
65
+ currency?: string;
56
66
  };
57
67
 
58
68
  type MaskedInputProps = BaseInputProps<"masked"> & {