@kingteza/crud-component 1.2.2 → 1.2.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/dist/App.d.ts +151 -0
- package/dist/main.d.ts +0 -0
- package/dist/vite.svg +1 -0
- package/package.json +12 -12
- package/dist/README.md +0 -89
- package/dist/package.json +0 -122
package/dist/App.d.ts
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
export declare enum PurchaseStatus {
|
|
2
|
+
PENDING = "PENDING",
|
|
3
|
+
COMPLETED = "COMPLETED",
|
|
4
|
+
CANCELLED = "CANCELLED"
|
|
5
|
+
}
|
|
6
|
+
export declare enum TestEnum {
|
|
7
|
+
TEST = "TEST",
|
|
8
|
+
TEST2 = "TEST2",
|
|
9
|
+
TEST3 = "TEST3"
|
|
10
|
+
}
|
|
11
|
+
export type Purchase = {
|
|
12
|
+
status: PurchaseStatus;
|
|
13
|
+
test: TestEnum;
|
|
14
|
+
value: string;
|
|
15
|
+
id: string | number;
|
|
16
|
+
name: string;
|
|
17
|
+
image: string;
|
|
18
|
+
helloId: string;
|
|
19
|
+
hello?: {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
declare function App(): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export default App;
|
|
26
|
+
export declare const useWorkShiftCrudComponentProps: () => {
|
|
27
|
+
onCreate: (e: any) => Promise<void>;
|
|
28
|
+
onUpdate: (e: any) => Promise<void>;
|
|
29
|
+
onDelete: (e: any) => Promise<void>;
|
|
30
|
+
isCreating: boolean;
|
|
31
|
+
isUpdating: boolean;
|
|
32
|
+
isDeleting: boolean;
|
|
33
|
+
fields: ({
|
|
34
|
+
grid: {
|
|
35
|
+
md: number;
|
|
36
|
+
xs: number;
|
|
37
|
+
};
|
|
38
|
+
name: string;
|
|
39
|
+
label: string;
|
|
40
|
+
type: string;
|
|
41
|
+
required: boolean;
|
|
42
|
+
hideInTable?: undefined;
|
|
43
|
+
format?: undefined;
|
|
44
|
+
use12Hours?: undefined;
|
|
45
|
+
readonly?: undefined;
|
|
46
|
+
int?: undefined;
|
|
47
|
+
max?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
grid: {
|
|
50
|
+
md: number;
|
|
51
|
+
xs: number;
|
|
52
|
+
};
|
|
53
|
+
name: string;
|
|
54
|
+
label: string;
|
|
55
|
+
type: string;
|
|
56
|
+
hideInTable: boolean;
|
|
57
|
+
required?: undefined;
|
|
58
|
+
format?: undefined;
|
|
59
|
+
use12Hours?: undefined;
|
|
60
|
+
readonly?: undefined;
|
|
61
|
+
int?: undefined;
|
|
62
|
+
max?: undefined;
|
|
63
|
+
} | {
|
|
64
|
+
grid: {
|
|
65
|
+
md: number;
|
|
66
|
+
xs: number;
|
|
67
|
+
};
|
|
68
|
+
name: string;
|
|
69
|
+
label: string;
|
|
70
|
+
type: string;
|
|
71
|
+
format: string;
|
|
72
|
+
use12Hours: boolean;
|
|
73
|
+
required: boolean;
|
|
74
|
+
hideInTable?: undefined;
|
|
75
|
+
readonly?: undefined;
|
|
76
|
+
int?: undefined;
|
|
77
|
+
max?: undefined;
|
|
78
|
+
} | {
|
|
79
|
+
grid: {
|
|
80
|
+
md: number;
|
|
81
|
+
xs: number;
|
|
82
|
+
};
|
|
83
|
+
name: string;
|
|
84
|
+
label: string;
|
|
85
|
+
type: string;
|
|
86
|
+
format: string;
|
|
87
|
+
use12Hours: boolean;
|
|
88
|
+
readonly: boolean;
|
|
89
|
+
required?: undefined;
|
|
90
|
+
hideInTable?: undefined;
|
|
91
|
+
int?: undefined;
|
|
92
|
+
max?: undefined;
|
|
93
|
+
} | {
|
|
94
|
+
grid: {
|
|
95
|
+
md: number;
|
|
96
|
+
xs: number;
|
|
97
|
+
};
|
|
98
|
+
name: string;
|
|
99
|
+
label: string;
|
|
100
|
+
type: string;
|
|
101
|
+
int: boolean;
|
|
102
|
+
required: boolean;
|
|
103
|
+
hideInTable: boolean;
|
|
104
|
+
format?: undefined;
|
|
105
|
+
use12Hours?: undefined;
|
|
106
|
+
readonly?: undefined;
|
|
107
|
+
max?: undefined;
|
|
108
|
+
} | {
|
|
109
|
+
grid: {
|
|
110
|
+
md: number;
|
|
111
|
+
xs: number;
|
|
112
|
+
};
|
|
113
|
+
name: string;
|
|
114
|
+
label: string;
|
|
115
|
+
type: string;
|
|
116
|
+
int: boolean;
|
|
117
|
+
required: boolean;
|
|
118
|
+
hideInTable: boolean;
|
|
119
|
+
max: number;
|
|
120
|
+
format?: undefined;
|
|
121
|
+
use12Hours?: undefined;
|
|
122
|
+
readonly?: undefined;
|
|
123
|
+
} | {
|
|
124
|
+
name: string;
|
|
125
|
+
label: string;
|
|
126
|
+
type: string;
|
|
127
|
+
int: boolean;
|
|
128
|
+
required: boolean;
|
|
129
|
+
grid?: undefined;
|
|
130
|
+
hideInTable?: undefined;
|
|
131
|
+
format?: undefined;
|
|
132
|
+
use12Hours?: undefined;
|
|
133
|
+
readonly?: undefined;
|
|
134
|
+
max?: undefined;
|
|
135
|
+
} | {
|
|
136
|
+
grid: {
|
|
137
|
+
md: number;
|
|
138
|
+
xs: number;
|
|
139
|
+
};
|
|
140
|
+
name: string;
|
|
141
|
+
label: string;
|
|
142
|
+
type: string;
|
|
143
|
+
int: boolean;
|
|
144
|
+
required: boolean;
|
|
145
|
+
hideInTable?: undefined;
|
|
146
|
+
format?: undefined;
|
|
147
|
+
use12Hours?: undefined;
|
|
148
|
+
readonly?: undefined;
|
|
149
|
+
max?: undefined;
|
|
150
|
+
})[];
|
|
151
|
+
};
|
package/dist/main.d.ts
ADDED
|
File without changes
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kingteza/crud-component",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.4",
|
|
5
5
|
"description": "React CRUD component library with Ant Design",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"react",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"types",
|
|
12
12
|
"typings"
|
|
13
13
|
],
|
|
14
|
-
"types": "./index.d.ts",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
15
|
"author": "Kingteza",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"repository": {
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"exports": {
|
|
29
29
|
".": {
|
|
30
|
-
"types": "./index.d.ts",
|
|
31
|
-
"import": "./index.es.js",
|
|
32
|
-
"require": "./index.cjs.js"
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.es.js",
|
|
32
|
+
"require": "./dist/index.cjs.js"
|
|
33
33
|
},
|
|
34
34
|
"./common": {
|
|
35
|
-
"types": "./common/index.d.ts",
|
|
36
|
-
"import": "./common/index.es.js",
|
|
37
|
-
"require": "./common/index.cjs.js"
|
|
35
|
+
"types": "./dist/common/index.d.ts",
|
|
36
|
+
"import": "./dist/common/index.es.js",
|
|
37
|
+
"require": "./dist/common/index.cjs.js"
|
|
38
38
|
},
|
|
39
39
|
"./util": {
|
|
40
|
-
"types": "./util/index.d.ts",
|
|
41
|
-
"import": "./util/index.es.js",
|
|
42
|
-
"require": "./util/index.cjs.js"
|
|
40
|
+
"types": "./dist/util/index.d.ts",
|
|
41
|
+
"import": "./dist/util/index.es.js",
|
|
42
|
+
"require": "./dist/util/index.cjs.js"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"scripts": {
|
|
113
113
|
"dev": "vite",
|
|
114
114
|
"clean": "rm -rf dist",
|
|
115
|
-
"build": "npm run clean && tsc && vite build
|
|
115
|
+
"build": "npm run clean && tsc && vite build",
|
|
116
116
|
"release": "semantic-release",
|
|
117
117
|
"release:dry-run": "semantic-release --dry-run",
|
|
118
118
|
"lint": "eslint .",
|
package/dist/README.md
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# @kingteza/crud-component
|
|
2
|
-
|
|
3
|
-
React CRUD component library built with Ant Design and TypeScript.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @kingteza/crud-component
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Prerequisites
|
|
12
|
-
|
|
13
|
-
This library has the following peer dependencies that need to be installed:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install antd@^5.22.6 react@^18.3.1 react-dom@^18.3.1 react-router-dom@^7.0.0
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Setup
|
|
20
|
-
|
|
21
|
-
### 1. Initialize translations
|
|
22
|
-
|
|
23
|
-
The library uses i18next for internationalization. You need to set it up before using the components:
|
|
24
|
-
|
|
25
|
-
```typescript
|
|
26
|
-
import { setupI18n } from '@kingteza/crud-component';
|
|
27
|
-
|
|
28
|
-
// Basic setup with default English translations
|
|
29
|
-
setupI18n();
|
|
30
|
-
|
|
31
|
-
// Or with custom options
|
|
32
|
-
setupI18n({
|
|
33
|
-
language: 'en', // default language
|
|
34
|
-
translations: {
|
|
35
|
-
en: {
|
|
36
|
-
'crud-component': {
|
|
37
|
-
// your custom translations
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
i18nInstance: existingI18nInstance // optional: use your existing i18n instance
|
|
42
|
-
});
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### 2. Usage
|
|
46
|
-
|
|
47
|
-
```typescript
|
|
48
|
-
import { CrudComponent } from '@kingteza/crud-component';
|
|
49
|
-
import { Button } from '@kingteza/crud-component/common';
|
|
50
|
-
|
|
51
|
-
function App() {
|
|
52
|
-
return (
|
|
53
|
-
<CrudComponent
|
|
54
|
-
fields={[
|
|
55
|
-
{ type: "text", name: "name", label: "Name", required: true },
|
|
56
|
-
{ type: "select", name: "status", label: "Status", options: [
|
|
57
|
-
{ value: "active", label: "Active" },
|
|
58
|
-
{ value: "inactive", label: "Inactive" }
|
|
59
|
-
]}
|
|
60
|
-
]}
|
|
61
|
-
data={[]}
|
|
62
|
-
onSave={(data) => console.log(data)}
|
|
63
|
-
/>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### 3. Available Imports
|
|
69
|
-
|
|
70
|
-
The library provides several entry points for importing components:
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
// Main CRUD component
|
|
74
|
-
import { CrudComponent } from '@kingteza/crud-component';
|
|
75
|
-
|
|
76
|
-
// Common components
|
|
77
|
-
import { Button, Select, DatePicker } from '@kingteza/crud-component/common';
|
|
78
|
-
|
|
79
|
-
// Utility functions
|
|
80
|
-
import { DateUtil } from '@kingteza/crud-component/util';
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## Documentation
|
|
84
|
-
|
|
85
|
-
For detailed documentation of components and their props, please visit our [GitHub repository](https://github.com/kingteza/crud-component).
|
|
86
|
-
|
|
87
|
-
## License
|
|
88
|
-
|
|
89
|
-
MIT
|
package/dist/package.json
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@kingteza/crud-component",
|
|
3
|
-
"private": false,
|
|
4
|
-
"version": "1.2.1",
|
|
5
|
-
"description": "React CRUD component library with Ant Design",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"react",
|
|
8
|
-
"crud",
|
|
9
|
-
"antd",
|
|
10
|
-
"typescript",
|
|
11
|
-
"types",
|
|
12
|
-
"typings"
|
|
13
|
-
],
|
|
14
|
-
"types": "./index.d.ts",
|
|
15
|
-
"author": "Kingteza",
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "https://github.com/kingteza/crud-component"
|
|
20
|
-
},
|
|
21
|
-
"files": [
|
|
22
|
-
"dist/",
|
|
23
|
-
"README.md",
|
|
24
|
-
"package.json"
|
|
25
|
-
],
|
|
26
|
-
"type": "module",
|
|
27
|
-
"sideEffects": false,
|
|
28
|
-
"scripts": {
|
|
29
|
-
"dev": "vite",
|
|
30
|
-
"clean": "rm -rf dist",
|
|
31
|
-
"build": "npm run clean && tsc && vite build && cp package.json README.md .npmignore dist/",
|
|
32
|
-
"release": "semantic-release",
|
|
33
|
-
"release:dry-run": "semantic-release --dry-run",
|
|
34
|
-
"lint": "eslint .",
|
|
35
|
-
"tsc": "tsc",
|
|
36
|
-
"preview": "vite preview"
|
|
37
|
-
},
|
|
38
|
-
"exports": {
|
|
39
|
-
".": {
|
|
40
|
-
"types": "./index.d.ts",
|
|
41
|
-
"import": "./index.es.js",
|
|
42
|
-
"require": "./index.cjs.js"
|
|
43
|
-
},
|
|
44
|
-
"./common": {
|
|
45
|
-
"types": "./common/index.d.ts",
|
|
46
|
-
"import": "./common/index.es.js",
|
|
47
|
-
"require": "./common/index.cjs.js"
|
|
48
|
-
},
|
|
49
|
-
"./util": {
|
|
50
|
-
"types": "./util/index.d.ts",
|
|
51
|
-
"import": "./util/index.es.js",
|
|
52
|
-
"require": "./util/index.cjs.js"
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
"publishConfig": {
|
|
56
|
-
"access": "public"
|
|
57
|
-
},
|
|
58
|
-
"engines": {
|
|
59
|
-
"node": ">=22.14.0"
|
|
60
|
-
},
|
|
61
|
-
"dependencies": {
|
|
62
|
-
"@ant-design/icons": "^5.5.2",
|
|
63
|
-
"@dnd-kit/core": "^6.3.1",
|
|
64
|
-
"@dnd-kit/modifiers": "^9.0.0",
|
|
65
|
-
"@dnd-kit/sortable": "^10.0.0",
|
|
66
|
-
"@dnd-kit/utilities": "^3.2.2",
|
|
67
|
-
"@iconify/react": "^6.0.1",
|
|
68
|
-
"bootstrap-css-only": "^4.4.1",
|
|
69
|
-
"browser-image-compression": "^2.0.2",
|
|
70
|
-
"dayjs": "^1.11.13",
|
|
71
|
-
"file-saver": "^2.0.5",
|
|
72
|
-
"i18next": "^24.2.0",
|
|
73
|
-
"mime": "^4.0.6",
|
|
74
|
-
"papaparse": "^5.4.1",
|
|
75
|
-
"path-browserify": "^1.0.1",
|
|
76
|
-
"react-advanced-cropper": "^0.20.1",
|
|
77
|
-
"react-highlight-words": "^0.20.0",
|
|
78
|
-
"react-i18next": "^15.2.0",
|
|
79
|
-
"react-quill": "^2.0.0",
|
|
80
|
-
"react-responsive": "^10.0.0",
|
|
81
|
-
"react-show-more-text": "^1.7.1",
|
|
82
|
-
"uuid": "^11.0.3"
|
|
83
|
-
},
|
|
84
|
-
"devDependencies": {
|
|
85
|
-
"@anolilab/semantic-release-pnpm": "^2.0.4",
|
|
86
|
-
"@eslint/js": "^9.17.0",
|
|
87
|
-
"@semantic-release/changelog": "^6.0.3",
|
|
88
|
-
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
89
|
-
"@semantic-release/git": "^10.0.1",
|
|
90
|
-
"@semantic-release/npm": "^13.1.1",
|
|
91
|
-
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
92
|
-
"@types/file-saver": "^2.0.7",
|
|
93
|
-
"@types/papaparse": "^5.3.15",
|
|
94
|
-
"@types/path-browserify": "^1.0.3",
|
|
95
|
-
"@types/react": "^18.3.18",
|
|
96
|
-
"@types/react-dom": "^18.3.5",
|
|
97
|
-
"@types/react-show-more-text": "^1.4.5",
|
|
98
|
-
"@types/uuid": "^10.0.0",
|
|
99
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
100
|
-
"antd": "^5.22.7",
|
|
101
|
-
"eslint": "^9.17.0",
|
|
102
|
-
"eslint-plugin-react-hooks": "^5.0.0",
|
|
103
|
-
"eslint-plugin-react-refresh": "^0.4.16",
|
|
104
|
-
"globals": "^15.14.0",
|
|
105
|
-
"react": "^18.3.1",
|
|
106
|
-
"react-dom": "^18.3.1",
|
|
107
|
-
"react-router-dom": "^7.0.2",
|
|
108
|
-
"semantic-release": "^25.0.1",
|
|
109
|
-
"tsup": "^8.3.5",
|
|
110
|
-
"typescript": "~5.6.2",
|
|
111
|
-
"typescript-eslint": "^8.18.2",
|
|
112
|
-
"vite": "^6.0.5",
|
|
113
|
-
"vite-plugin-dts": "^4.4.0",
|
|
114
|
-
"vite-tsconfig-paths": "^5.1.4"
|
|
115
|
-
},
|
|
116
|
-
"peerDependencies": {
|
|
117
|
-
"antd": ">=5.22.6",
|
|
118
|
-
"react": ">=18.3.1",
|
|
119
|
-
"react-dom": ">=18.3.1",
|
|
120
|
-
"react-router-dom": ">=6.3.0"
|
|
121
|
-
}
|
|
122
|
-
}
|