patronet-pdf-generator 1.0.0
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 +19 -0
- package/src/component/app.tsx +25 -0
- package/src/index.ts +3 -0
- package/tsconfig.json +32 -0
package/package.json
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"name": "patronet-pdf-generator",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"main": "src/index.ts",
|
5
|
+
"types": "dist/esm/index.d.ts",
|
6
|
+
"scripts": {
|
7
|
+
"prepare": "npm run build",
|
8
|
+
"build": "tsc"
|
9
|
+
},
|
10
|
+
"peerDependencies": {
|
11
|
+
"react": "^18.3.1",
|
12
|
+
"react-dom": "^18.3.1"
|
13
|
+
},
|
14
|
+
"dependencies": {
|
15
|
+
"@react-pdf/renderer": "^3.0.0",
|
16
|
+
"@types/react": "^19.1.5",
|
17
|
+
"typescript": "^5.8.3"
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
|
3
|
+
type props = {
|
4
|
+
value: number;
|
5
|
+
};
|
6
|
+
|
7
|
+
const MyComponent = ({ value = 0 }: props) => {
|
8
|
+
const [counter, setCounter] = useState(value);
|
9
|
+
|
10
|
+
const onMinus = () => {
|
11
|
+
setCounter((val) => val - 1);
|
12
|
+
};
|
13
|
+
const onPlus = () => {
|
14
|
+
setCounter((val) => val + 1);
|
15
|
+
};
|
16
|
+
return (
|
17
|
+
<div>
|
18
|
+
<h2>number: {counter}</h2>
|
19
|
+
<button onClick={onMinus}>+</button>
|
20
|
+
<button onClick={onPlus}>-</button>
|
21
|
+
</div>
|
22
|
+
);
|
23
|
+
};
|
24
|
+
|
25
|
+
export default MyComponent;
|
package/src/index.ts
ADDED
package/tsconfig.json
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"module": "esnext",
|
4
|
+
"lib": [
|
5
|
+
"dom",
|
6
|
+
"esnext"
|
7
|
+
],
|
8
|
+
"importHelpers": true,
|
9
|
+
"declaration": true,
|
10
|
+
"sourceMap": true,
|
11
|
+
"rootDir": "./src",
|
12
|
+
"outDir": "./dist/esm",
|
13
|
+
"strict": true,
|
14
|
+
"noImplicitReturns": true,
|
15
|
+
"noFallthroughCasesInSwitch": true,
|
16
|
+
"noUnusedLocals": true,
|
17
|
+
"noUnusedParameters": true,
|
18
|
+
"moduleResolution": "node",
|
19
|
+
"jsx": "react",
|
20
|
+
"target": "es5",
|
21
|
+
"esModuleInterop": true,
|
22
|
+
"skipLibCheck": true,
|
23
|
+
"forceConsistentCasingInFileNames": true,
|
24
|
+
},
|
25
|
+
"include": [
|
26
|
+
"src"
|
27
|
+
],
|
28
|
+
"exclude": [
|
29
|
+
"dist",
|
30
|
+
"node_modules"
|
31
|
+
]
|
32
|
+
}
|