@chenhui996/gg-ui 0.0.1 → 0.0.2
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/README.md +30 -63
- package/gz-ui-lib/components/form/ErrorList.d.ts +2 -1
- package/gz-ui-lib/components/form/Form.d.ts +5 -0
- package/gz-ui-lib/components/form/Item.d.ts +4 -1
- package/gz-ui-lib/components/form/List.d.ts +2 -1
- package/gz-ui-lib/components/form/Provider.d.ts +2 -1
- package/gz-ui-lib/components/form/demo/advanced-search.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/basic.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/col-24-debug.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/complex-form-control.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/component-token.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/control-hooks.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/custom-feedback-icons.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/customized-form-controls.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/disabled-input-debug.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/disabled.d.ts +6 -0
- package/gz-ui-lib/components/form/demo/dynamic-form-item.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/dynamic-form-items-complex.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/dynamic-form-items-no-style.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/dynamic-form-items.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/dynamic-rule.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/form-context.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/form-dependencies.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/form-in-modal.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/form-item-path.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/getValueProps-normalize.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/global-state.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/inline-login.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/label-debug.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/layout-can-wrap.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/layout-multiple.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/layout.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/login.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/nest-messages.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/ref-item.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/register.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/required-mark.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/size.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/style-class.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/time-related-controls.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/useWatch.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/validate-only.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/validate-other.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/validate-scroll-to-field.d.ts +7 -0
- package/gz-ui-lib/components/form/demo/validate-static.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/validate-trigger.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/variant.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/warning-only.d.ts +3 -0
- package/gz-ui-lib/components/form/demo/without-form-create.d.ts +3 -0
- package/gz-ui-lib/components/form/index.d.ts +3 -5
- package/gz-ui-lib/index.cjs +1 -1
- package/gz-ui-lib/index.d.ts +1 -1
- package/gz-ui-lib/index.js +549 -565
- package/package.json +9 -3
- /package/gz-ui-lib/{gz-ui.css → gg-ui.css} +0 -0
package/README.md
CHANGED
|
@@ -1,75 +1,42 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 基础 UI 组件库
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 安装
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
-
|
|
10
|
-
## React Compiler
|
|
5
|
+
```shell
|
|
6
|
+
npm install @chenhui996/gg-ui
|
|
7
|
+
```
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
## 使用
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
### 1. 根组件包裹(main.tsx)
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
```tsx
|
|
14
|
+
import { createRoot } from 'react-dom/client';
|
|
15
|
+
import { RouterProvider } from 'react-router-dom';
|
|
16
|
+
import { ConfigProvider } from '@chenhui996/gg-ui';
|
|
17
|
+
import { router } from '@/router';
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
createRoot(document.getElementById('root')!).render(
|
|
20
|
+
<ConfigProvider>
|
|
21
|
+
<RouterProvider router={router} />
|
|
22
|
+
</ConfigProvider>
|
|
23
|
+
);
|
|
19
24
|
|
|
20
|
-
```
|
|
21
|
-
export default defineConfig([
|
|
22
|
-
globalIgnores(['dist']),
|
|
23
|
-
{
|
|
24
|
-
files: ['**/*.{ts,tsx}'],
|
|
25
|
-
extends: [
|
|
26
|
-
// Other configs...
|
|
25
|
+
```
|
|
27
26
|
|
|
28
|
-
// Remove tseslint.configs.recommended and replace with this
|
|
29
|
-
tseslint.configs.recommendedTypeChecked,
|
|
30
|
-
// Alternatively, use this for stricter rules
|
|
31
|
-
tseslint.configs.strictTypeChecked,
|
|
32
|
-
// Optionally, add this for stylistic rules
|
|
33
|
-
tseslint.configs.stylisticTypeChecked,
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
],
|
|
37
|
-
languageOptions: {
|
|
38
|
-
parserOptions: {
|
|
39
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
40
|
-
tsconfigRootDir: import.meta.dirname,
|
|
41
|
-
},
|
|
42
|
-
// other options...
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
])
|
|
46
|
-
```
|
|
28
|
+
### 2. 组件使用
|
|
47
29
|
|
|
48
|
-
|
|
30
|
+
- 以 Button 组件为例
|
|
49
31
|
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
import reactX from 'eslint-plugin-react-x'
|
|
53
|
-
import reactDom from 'eslint-plugin-react-dom'
|
|
32
|
+
```tsx
|
|
33
|
+
import { Button } from '@chenhui996/gg-ui';
|
|
54
34
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// Enable lint rules for React DOM
|
|
64
|
-
reactDom.configs.recommended,
|
|
65
|
-
],
|
|
66
|
-
languageOptions: {
|
|
67
|
-
parserOptions: {
|
|
68
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
69
|
-
tsconfigRootDir: import.meta.dirname,
|
|
70
|
-
},
|
|
71
|
-
// other options...
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
])
|
|
75
|
-
```
|
|
35
|
+
const App = () => {
|
|
36
|
+
return (
|
|
37
|
+
<div>
|
|
38
|
+
<Button>默认按钮</Button>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
```
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { ErrorListProps } from 'antd/es/form';
|
|
2
3
|
export interface GZErrorListProps extends ErrorListProps {
|
|
3
4
|
}
|
|
4
|
-
declare const ErrorList:
|
|
5
|
+
declare const ErrorList: React.FC<GZErrorListProps>;
|
|
5
6
|
export default ErrorList;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FormProps, FormInstance } from 'antd';
|
|
2
|
+
export interface GZFormProps<Values = any> extends FormProps<Values> {
|
|
3
|
+
}
|
|
4
|
+
declare const Form: import('react').ForwardRefExoticComponent<GZFormProps<any> & import('react').RefAttributes<FormInstance<any>>>;
|
|
5
|
+
export default Form;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { FormItemProps } from 'antd';
|
|
2
2
|
export interface GZFormItemProps<Values = any> extends FormItemProps<Values> {
|
|
3
3
|
}
|
|
4
|
-
declare const Item:
|
|
4
|
+
declare const Item: {
|
|
5
|
+
<Values = any>(props: GZFormItemProps<Values>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
5
8
|
export default Item;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { FormListProps } from 'antd/es/form';
|
|
2
3
|
export interface GZFormListProps extends FormListProps {
|
|
3
4
|
}
|
|
4
|
-
declare const List:
|
|
5
|
+
declare const List: React.FC<GZFormListProps>;
|
|
5
6
|
export default List;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { FormProviderProps } from 'antd/es/form/context';
|
|
2
3
|
export interface GZFormProviderProps extends FormProviderProps {
|
|
3
4
|
}
|
|
4
|
-
declare const Provider:
|
|
5
|
+
declare const Provider: React.FC<GZFormProviderProps>;
|
|
5
6
|
export default Provider;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { Form as AntdForm,
|
|
1
|
+
import { Form as AntdForm, FormInstance } from 'antd';
|
|
2
|
+
import { default as Form, GZFormProps } from './Form';
|
|
2
3
|
import { default as Item, GZFormItemProps } from './Item';
|
|
3
4
|
import { default as List, GZFormListProps } from './List';
|
|
4
5
|
import { default as ErrorList, GZErrorListProps } from './ErrorList';
|
|
5
6
|
import { default as Provider, GZFormProviderProps } from './Provider';
|
|
6
|
-
export type { GZFormItemProps
|
|
7
|
-
export interface GZFormProps<Values = any> extends FormProps<Values> {
|
|
8
|
-
}
|
|
9
|
-
declare const Form: import('react').ForwardRefExoticComponent<GZFormProps<any> & import('react').RefAttributes<FormInstance<any>>>;
|
|
7
|
+
export type { GZFormProps, GZFormItemProps, GZFormListProps, GZErrorListProps, GZFormProviderProps, FormInstance, };
|
|
10
8
|
export type GZFormComponent = typeof Form & {
|
|
11
9
|
Item: typeof Item;
|
|
12
10
|
List: typeof List;
|