@uniai-fe/util-react 0.1.2 → 0.1.4
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/package.json +17 -12
- package/types/chart/index.d.ts +3 -0
- package/types/chart/index.d.ts.map +1 -0
- package/types/chart/module.d.ts +28 -0
- package/types/chart/module.d.ts.map +1 -0
- package/types/chart/types.d.ts +37 -0
- package/types/chart/types.d.ts.map +1 -0
- package/types/convert/index.d.ts +3 -0
- package/types/convert/index.d.ts.map +1 -0
- package/types/convert/module.d.ts +18 -0
- package/types/convert/module.d.ts.map +1 -0
- package/types/convert/types.d.ts +12 -0
- package/types/convert/types.d.ts.map +1 -0
- package/types/file/index.d.ts +3 -0
- package/types/file/index.d.ts.map +1 -0
- package/types/file/module.d.ts +7 -0
- package/types/file/module.d.ts.map +1 -0
- package/types/file/types.d.ts +5 -0
- package/types/file/types.d.ts.map +1 -0
- package/types/index.d.ts +5 -0
- package/types/index.d.ts.map +1 -0
- package/types/match/index.d.ts +3 -0
- package/types/match/index.d.ts.map +1 -0
- package/types/match/module.d.ts +10 -0
- package/types/match/module.d.ts.map +1 -0
- package/types/match/types.d.ts +3 -0
- package/types/match/types.d.ts.map +1 -0
- package/dist/chart/index.d.cts +0 -46
- package/dist/chart/index.d.ts +0 -46
- package/dist/convert/index.d.cts +0 -19
- package/dist/convert/index.d.ts +0 -19
- package/dist/file/index.d.cts +0 -9
- package/dist/file/index.d.ts +0 -9
- package/dist/index.d.cts +0 -6
- package/dist/index.d.ts +0 -6
- package/dist/match/index.d.cts +0 -10
- package/dist/match/index.d.ts +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniai-fe/util-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "React Utilities for UNIAI FE Projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
|
-
"packageManager": "pnpm@10.
|
|
13
|
+
"packageManager": "pnpm@10.25.0",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=24",
|
|
16
16
|
"pnpm": ">=10"
|
|
@@ -21,12 +21,17 @@
|
|
|
21
21
|
"url": "https://github.com/GraffitoRyu"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
|
-
"dist"
|
|
24
|
+
"dist",
|
|
25
|
+
"types"
|
|
25
26
|
],
|
|
26
27
|
"scripts": {
|
|
28
|
+
"format": "prettier --write .",
|
|
29
|
+
"format:check": "prettier --check .",
|
|
30
|
+
"format:types": "prettier --write \"types/**/*.d.ts\"",
|
|
27
31
|
"lint": "eslint . --max-warnings=0",
|
|
28
32
|
"typecheck": "tsc --project tsconfig.build.json --noEmit",
|
|
29
|
-
"
|
|
33
|
+
"dts": "tsc --project tsconfig.build.json",
|
|
34
|
+
"build": "pnpm format && pnpm dts && pnpm format:types && tsup",
|
|
30
35
|
"dev": "node ../../../scripts/tsup-watch-filter.mjs --watch",
|
|
31
36
|
"module:lint": "pnpm lint",
|
|
32
37
|
"module:typecheck": "pnpm typecheck",
|
|
@@ -36,34 +41,34 @@
|
|
|
36
41
|
},
|
|
37
42
|
"main": "./dist/index.cjs",
|
|
38
43
|
"module": "./dist/index.mjs",
|
|
39
|
-
"types": "./
|
|
44
|
+
"types": "./types/index.d.ts",
|
|
40
45
|
"exports": {
|
|
41
46
|
".": {
|
|
42
|
-
"types": "./
|
|
47
|
+
"types": "./types/index.d.ts",
|
|
43
48
|
"import": "./dist/index.mjs",
|
|
44
49
|
"require": "./dist/index.cjs",
|
|
45
50
|
"default": "./dist/index.mjs"
|
|
46
51
|
},
|
|
47
52
|
"./convert": {
|
|
48
|
-
"types": "./
|
|
53
|
+
"types": "./types/convert/index.d.ts",
|
|
49
54
|
"import": "./dist/convert.mjs",
|
|
50
55
|
"require": "./dist/convert.cjs",
|
|
51
56
|
"default": "./dist/convert.mjs"
|
|
52
57
|
},
|
|
53
58
|
"./match": {
|
|
54
|
-
"types": "./
|
|
59
|
+
"types": "./types/match/index.d.ts",
|
|
55
60
|
"import": "./dist/match.mjs",
|
|
56
61
|
"require": "./dist/match.cjs",
|
|
57
62
|
"default": "./dist/match.mjs"
|
|
58
63
|
},
|
|
59
64
|
"./file": {
|
|
60
|
-
"types": "./
|
|
65
|
+
"types": "./types/file/index.d.ts",
|
|
61
66
|
"import": "./dist/file.mjs",
|
|
62
67
|
"require": "./dist/file.cjs",
|
|
63
68
|
"default": "./dist/file.mjs"
|
|
64
69
|
},
|
|
65
70
|
"./chart": {
|
|
66
|
-
"types": "./
|
|
71
|
+
"types": "./types/chart/index.d.ts",
|
|
67
72
|
"import": "./dist/chart.mjs",
|
|
68
73
|
"require": "./dist/chart.cjs",
|
|
69
74
|
"default": "./dist/chart.mjs"
|
|
@@ -86,13 +91,13 @@
|
|
|
86
91
|
},
|
|
87
92
|
"devDependencies": {
|
|
88
93
|
"@types/d3-array": "^3.2.2",
|
|
89
|
-
"@types/node": "^24.10.
|
|
94
|
+
"@types/node": "^24.10.2",
|
|
90
95
|
"@types/react": "^19.2.7",
|
|
91
96
|
"@types/react-dom": "^19.2.3",
|
|
92
97
|
"@uniai-fe/eslint-config": "workspace:*",
|
|
93
98
|
"@uniai-fe/tsconfig": "workspace:*",
|
|
94
99
|
"eslint": "^9.39.1",
|
|
95
|
-
"prettier": "^3.
|
|
100
|
+
"prettier": "^3.7.4",
|
|
96
101
|
"tsup": "^8.5.1",
|
|
97
102
|
"typescript": "~5.9.3"
|
|
98
103
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart/index.tsx"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,mBAAmB,SAAS,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SVGAttributes } from "react";
|
|
2
|
+
import type { GetChartYTicksProps, RechartsXAxisTickProps } from "./types";
|
|
3
|
+
export declare const getChartYTicks: ({
|
|
4
|
+
data,
|
|
5
|
+
length,
|
|
6
|
+
pad,
|
|
7
|
+
limitMin,
|
|
8
|
+
limitMax,
|
|
9
|
+
digit,
|
|
10
|
+
outliers,
|
|
11
|
+
log,
|
|
12
|
+
}: GetChartYTicksProps) => number[] | undefined;
|
|
13
|
+
export declare const getDecimalIndex: (v: unknown) => number;
|
|
14
|
+
export declare const getDomainLimit: ({
|
|
15
|
+
value,
|
|
16
|
+
gap,
|
|
17
|
+
min,
|
|
18
|
+
max,
|
|
19
|
+
}: {
|
|
20
|
+
value: number | null;
|
|
21
|
+
gap: number;
|
|
22
|
+
min?: number;
|
|
23
|
+
max?: number;
|
|
24
|
+
}) => number | string;
|
|
25
|
+
export declare const getXAxisTextAttr: (
|
|
26
|
+
props: RechartsXAxisTickProps,
|
|
27
|
+
) => SVGAttributes<SVGTextElement>;
|
|
28
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/chart/module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAE3E,eAAO,MAAM,cAAc,GAAI,kEAS5B,mBAAmB,KAAG,MAAM,EAAE,GAAG,SAiKnC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,GAAG,OAAO,KAAG,MAMtC,CAAC;AAER,eAAO,MAAM,cAAc,GAAI,2BAK5B;IACD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,KAAG,MAAM,GAAG,MAQZ,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,OAAO,sBAAsB,KAC5B,aAAa,CAAC,cAAc,CAwB9B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { XAxisProps } from "recharts";
|
|
2
|
+
export type GetChartYTicksProps = {
|
|
3
|
+
data: unknown[];
|
|
4
|
+
length: number;
|
|
5
|
+
} & Partial<{
|
|
6
|
+
pad: number;
|
|
7
|
+
limitMin: number;
|
|
8
|
+
limitMax: number;
|
|
9
|
+
log: boolean;
|
|
10
|
+
digit: number;
|
|
11
|
+
outliers: boolean;
|
|
12
|
+
yTickWidth: number;
|
|
13
|
+
}>;
|
|
14
|
+
export type RechartsXAxisTickPayload = {
|
|
15
|
+
coordinate: number;
|
|
16
|
+
value: number | string | null;
|
|
17
|
+
index: number;
|
|
18
|
+
offset: number;
|
|
19
|
+
tickCoord: number;
|
|
20
|
+
isShow: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type TickLayoutProps = Partial<
|
|
23
|
+
Record<"width" | "height" | "x" | "y", number | string | undefined>
|
|
24
|
+
> &
|
|
25
|
+
Partial<{
|
|
26
|
+
stroke: string;
|
|
27
|
+
fill: string;
|
|
28
|
+
textAnchor: "start" | "middle" | "end" | "inherit";
|
|
29
|
+
transform: string;
|
|
30
|
+
}>;
|
|
31
|
+
export type RechartsXAxisTickProps = XAxisProps &
|
|
32
|
+
TickLayoutProps & {
|
|
33
|
+
verticalAnchor: "start" | "middle" | "end";
|
|
34
|
+
index: number;
|
|
35
|
+
payload: RechartsXAxisTickPayload;
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/chart/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,OAAO,CACnC,MAAM,CAAC,OAAO,GAAG,QAAQ,GAAG,GAAG,GAAG,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CACpE,GACC,OAAO,CAAC;IACN,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;IACnD,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC,CAAC;AAEL,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAC7C,eAAe,GAAG;IAChB,cAAc,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,wBAAwB,CAAC;CACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/convert/index.tsx"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,mBAAmB,SAAS,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ConvertArrayToJsxOptions, ConvertTextToJsxParams } from "./types";
|
|
3
|
+
export declare const convertTextToHTML: (
|
|
4
|
+
text: string,
|
|
5
|
+
tagName: string,
|
|
6
|
+
key?: string,
|
|
7
|
+
) => React.ReactNode;
|
|
8
|
+
export declare const convertTextToLineArray: (text: string) => string[];
|
|
9
|
+
export declare const convertTextToJsx: ({
|
|
10
|
+
text,
|
|
11
|
+
key,
|
|
12
|
+
callback,
|
|
13
|
+
}: ConvertTextToJsxParams) => string | React.ReactNode;
|
|
14
|
+
export declare const convertArrayToJsx: (
|
|
15
|
+
textArray: React.ReactNode[] | string,
|
|
16
|
+
options?: ConvertArrayToJsxOptions,
|
|
17
|
+
) => React.ReactNode;
|
|
18
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/convert/module.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEhF,eAAO,MAAM,iBAAiB,GAC5B,MAAM,MAAM,EACZ,SAAS,MAAM,EACf,MAAM,MAAM,KACX,KAAK,CAAC,SA4BR,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,MAAM,MAAM,KAAG,MAAM,EAI3D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,0BAI9B,sBAAsB,KAAG,MAAM,GAAG,KAAK,CAAC,SAoB1C,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,WAAW,KAAK,CAAC,SAAS,EAAE,GAAG,MAAM,EACrC,UAAU,wBAAwB,KACjC,KAAK,CAAC,SA0BR,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export type ConvertTextToJsxParams = {
|
|
3
|
+
text: string;
|
|
4
|
+
} & Partial<{
|
|
5
|
+
key: string;
|
|
6
|
+
callback: (text: string) => string | React.ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
export type ConvertArrayToJsxOptions = {
|
|
9
|
+
key?: string;
|
|
10
|
+
phraseGap?: number;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/convert/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;CACtD,CAAC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG;IACrC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/file/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,mBAAmB,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/file/module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,YAAY,GAAI,eAAe,kBAAkB,kBAsBxD,CAAC;AAEP,eAAO,MAAM,QAAQ,GAAI,MAAM,OAAO,EAAE,OAAM,OAAc,KAAG,MAgB9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/file/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/match/index.tsx"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,mBAAmB,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/match/module.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;GAEG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,GAChB,kBAAkB,CA2BpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/match/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC"}
|
package/dist/chart/index.d.cts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { SVGAttributes } from 'react';
|
|
2
|
-
import { XAxisProps } from 'recharts';
|
|
3
|
-
|
|
4
|
-
type GetChartYTicksProps = {
|
|
5
|
-
data: unknown[];
|
|
6
|
-
length: number;
|
|
7
|
-
} & Partial<{
|
|
8
|
-
pad: number;
|
|
9
|
-
limitMin: number;
|
|
10
|
-
limitMax: number;
|
|
11
|
-
log: boolean;
|
|
12
|
-
digit: number;
|
|
13
|
-
outliers: boolean;
|
|
14
|
-
yTickWidth: number;
|
|
15
|
-
}>;
|
|
16
|
-
type RechartsXAxisTickPayload = {
|
|
17
|
-
coordinate: number;
|
|
18
|
-
value: number | string | null;
|
|
19
|
-
index: number;
|
|
20
|
-
offset: number;
|
|
21
|
-
tickCoord: number;
|
|
22
|
-
isShow: boolean;
|
|
23
|
-
};
|
|
24
|
-
type TickLayoutProps = Partial<Record<"width" | "height" | "x" | "y", number | string | undefined>> & Partial<{
|
|
25
|
-
stroke: string;
|
|
26
|
-
fill: string;
|
|
27
|
-
textAnchor: "start" | "middle" | "end" | "inherit";
|
|
28
|
-
transform: string;
|
|
29
|
-
}>;
|
|
30
|
-
type RechartsXAxisTickProps = XAxisProps & TickLayoutProps & {
|
|
31
|
-
verticalAnchor: "start" | "middle" | "end";
|
|
32
|
-
index: number;
|
|
33
|
-
payload: RechartsXAxisTickPayload;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
declare const getChartYTicks: ({ data, length, pad, limitMin, limitMax, digit, outliers, log, }: GetChartYTicksProps) => number[] | undefined;
|
|
37
|
-
declare const getDecimalIndex: (v: unknown) => number;
|
|
38
|
-
declare const getDomainLimit: ({ value, gap, min, max, }: {
|
|
39
|
-
value: number | null;
|
|
40
|
-
gap: number;
|
|
41
|
-
min?: number;
|
|
42
|
-
max?: number;
|
|
43
|
-
}) => number | string;
|
|
44
|
-
declare const getXAxisTextAttr: (props: RechartsXAxisTickProps) => SVGAttributes<SVGTextElement>;
|
|
45
|
-
|
|
46
|
-
export { type GetChartYTicksProps, type RechartsXAxisTickPayload, type RechartsXAxisTickProps, type TickLayoutProps, getChartYTicks, getDecimalIndex, getDomainLimit, getXAxisTextAttr };
|
package/dist/chart/index.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { SVGAttributes } from 'react';
|
|
2
|
-
import { XAxisProps } from 'recharts';
|
|
3
|
-
|
|
4
|
-
type GetChartYTicksProps = {
|
|
5
|
-
data: unknown[];
|
|
6
|
-
length: number;
|
|
7
|
-
} & Partial<{
|
|
8
|
-
pad: number;
|
|
9
|
-
limitMin: number;
|
|
10
|
-
limitMax: number;
|
|
11
|
-
log: boolean;
|
|
12
|
-
digit: number;
|
|
13
|
-
outliers: boolean;
|
|
14
|
-
yTickWidth: number;
|
|
15
|
-
}>;
|
|
16
|
-
type RechartsXAxisTickPayload = {
|
|
17
|
-
coordinate: number;
|
|
18
|
-
value: number | string | null;
|
|
19
|
-
index: number;
|
|
20
|
-
offset: number;
|
|
21
|
-
tickCoord: number;
|
|
22
|
-
isShow: boolean;
|
|
23
|
-
};
|
|
24
|
-
type TickLayoutProps = Partial<Record<"width" | "height" | "x" | "y", number | string | undefined>> & Partial<{
|
|
25
|
-
stroke: string;
|
|
26
|
-
fill: string;
|
|
27
|
-
textAnchor: "start" | "middle" | "end" | "inherit";
|
|
28
|
-
transform: string;
|
|
29
|
-
}>;
|
|
30
|
-
type RechartsXAxisTickProps = XAxisProps & TickLayoutProps & {
|
|
31
|
-
verticalAnchor: "start" | "middle" | "end";
|
|
32
|
-
index: number;
|
|
33
|
-
payload: RechartsXAxisTickPayload;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
declare const getChartYTicks: ({ data, length, pad, limitMin, limitMax, digit, outliers, log, }: GetChartYTicksProps) => number[] | undefined;
|
|
37
|
-
declare const getDecimalIndex: (v: unknown) => number;
|
|
38
|
-
declare const getDomainLimit: ({ value, gap, min, max, }: {
|
|
39
|
-
value: number | null;
|
|
40
|
-
gap: number;
|
|
41
|
-
min?: number;
|
|
42
|
-
max?: number;
|
|
43
|
-
}) => number | string;
|
|
44
|
-
declare const getXAxisTextAttr: (props: RechartsXAxisTickProps) => SVGAttributes<SVGTextElement>;
|
|
45
|
-
|
|
46
|
-
export { type GetChartYTicksProps, type RechartsXAxisTickPayload, type RechartsXAxisTickProps, type TickLayoutProps, getChartYTicks, getDecimalIndex, getDomainLimit, getXAxisTextAttr };
|
package/dist/convert/index.d.cts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
type ConvertTextToJsxParams = {
|
|
4
|
-
text: string;
|
|
5
|
-
} & Partial<{
|
|
6
|
-
key: string;
|
|
7
|
-
callback: (text: string) => string | React.ReactNode;
|
|
8
|
-
}>;
|
|
9
|
-
type ConvertArrayToJsxOptions = {
|
|
10
|
-
key?: string;
|
|
11
|
-
phraseGap?: number;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
declare const convertTextToHTML: (text: string, tagName: string, key?: string) => React.ReactNode;
|
|
15
|
-
declare const convertTextToLineArray: (text: string) => string[];
|
|
16
|
-
declare const convertTextToJsx: ({ text, key, callback, }: ConvertTextToJsxParams) => string | React.ReactNode;
|
|
17
|
-
declare const convertArrayToJsx: (textArray: React.ReactNode[] | string, options?: ConvertArrayToJsxOptions) => React.ReactNode;
|
|
18
|
-
|
|
19
|
-
export { type ConvertArrayToJsxOptions, type ConvertTextToJsxParams, convertArrayToJsx, convertTextToHTML, convertTextToJsx, convertTextToLineArray };
|
package/dist/convert/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
type ConvertTextToJsxParams = {
|
|
4
|
-
text: string;
|
|
5
|
-
} & Partial<{
|
|
6
|
-
key: string;
|
|
7
|
-
callback: (text: string) => string | React.ReactNode;
|
|
8
|
-
}>;
|
|
9
|
-
type ConvertArrayToJsxOptions = {
|
|
10
|
-
key?: string;
|
|
11
|
-
phraseGap?: number;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
declare const convertTextToHTML: (text: string, tagName: string, key?: string) => React.ReactNode;
|
|
15
|
-
declare const convertTextToLineArray: (text: string) => string[];
|
|
16
|
-
declare const convertTextToJsx: ({ text, key, callback, }: ConvertTextToJsxParams) => string | React.ReactNode;
|
|
17
|
-
declare const convertArrayToJsx: (textArray: React.ReactNode[] | string, options?: ConvertArrayToJsxOptions) => React.ReactNode;
|
|
18
|
-
|
|
19
|
-
export { type ConvertArrayToJsxOptions, type ConvertTextToJsxParams, convertArrayToJsx, convertTextToHTML, convertTextToJsx, convertTextToLineArray };
|
package/dist/file/index.d.cts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type FileDownloadParams = {
|
|
2
|
-
url: string;
|
|
3
|
-
name: string;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
declare const fileDownload: ({ url, name }: FileDownloadParams) => Promise<void>;
|
|
7
|
-
declare const fileSize: (size: unknown, unit?: boolean) => string;
|
|
8
|
-
|
|
9
|
-
export { type FileDownloadParams, fileDownload, fileSize };
|
package/dist/file/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type FileDownloadParams = {
|
|
2
|
-
url: string;
|
|
3
|
-
name: string;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
declare const fileDownload: ({ url, name }: FileDownloadParams) => Promise<void>;
|
|
7
|
-
declare const fileSize: (size: unknown, unit?: boolean) => string;
|
|
8
|
-
|
|
9
|
-
export { type FileDownloadParams, fileDownload, fileSize };
|
package/dist/index.d.cts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { ConvertArrayToJsxOptions, ConvertTextToJsxParams, convertArrayToJsx, convertTextToHTML, convertTextToJsx, convertTextToLineArray } from './convert/index.cjs';
|
|
2
|
-
export { MatchKeywordResult, matchKeyword } from './match/index.cjs';
|
|
3
|
-
export { FileDownloadParams, fileDownload, fileSize } from './file/index.cjs';
|
|
4
|
-
export { GetChartYTicksProps, RechartsXAxisTickPayload, RechartsXAxisTickProps, TickLayoutProps, getChartYTicks, getDecimalIndex, getDomainLimit, getXAxisTextAttr } from './chart/index.cjs';
|
|
5
|
-
import 'react';
|
|
6
|
-
import 'recharts';
|
package/dist/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { ConvertArrayToJsxOptions, ConvertTextToJsxParams, convertArrayToJsx, convertTextToHTML, convertTextToJsx, convertTextToLineArray } from './convert/index.js';
|
|
2
|
-
export { MatchKeywordResult, matchKeyword } from './match/index.js';
|
|
3
|
-
export { FileDownloadParams, fileDownload, fileSize } from './file/index.js';
|
|
4
|
-
export { GetChartYTicksProps, RechartsXAxisTickPayload, RechartsXAxisTickProps, TickLayoutProps, getChartYTicks, getDecimalIndex, getDomainLimit, getXAxisTextAttr } from './chart/index.js';
|
|
5
|
-
import 'react';
|
|
6
|
-
import 'recharts';
|
package/dist/match/index.d.cts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
type MatchKeywordResult = React.ReactNode[] | string;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 일치 텍스트를 컴포넌트로 교체
|
|
7
|
-
*/
|
|
8
|
-
declare function matchKeyword(origin: string, exp: RegExp, renderKey: string): MatchKeywordResult;
|
|
9
|
-
|
|
10
|
-
export { type MatchKeywordResult, matchKeyword };
|
package/dist/match/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
type MatchKeywordResult = React.ReactNode[] | string;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 일치 텍스트를 컴포넌트로 교체
|
|
7
|
-
*/
|
|
8
|
-
declare function matchKeyword(origin: string, exp: RegExp, renderKey: string): MatchKeywordResult;
|
|
9
|
-
|
|
10
|
-
export { type MatchKeywordResult, matchKeyword };
|