szld-libs 0.2.6 → 0.2.8
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/style.css +1 -1
- package/dist/szld-components.es.js +7569 -6909
- package/dist/szld-components.umd.js +110 -46
- package/es/components/AuthButton/index.d.ts +1 -2
- package/es/components/BackHeader/index.d.ts +1 -1
- package/es/components/CoralButton/index.d.ts +1 -2
- package/es/components/CreateForm/index.d.ts +2 -2
- package/es/components/Echarts/index.d.ts +1 -2
- package/es/components/EditTable/index.d.ts +1 -2
- package/es/components/SearchTable/index.d.ts +1 -2
- package/es/components/SearchTable/index.js +0 -1
- package/es/components/Upload/index.d.ts +1 -1
- package/es/components/VirtualTable/index.d.ts +1 -2
- package/es/components/common/403.d.ts +1 -2
- package/es/components/common/404.d.ts +1 -2
- package/es/utils/index.js +0 -2
- package/es/utils/verify-code.js +13 -0
- package/lib/components/AuthButton/index.d.ts +1 -2
- package/lib/components/BackHeader/index.d.ts +1 -1
- package/lib/components/CoralButton/index.d.ts +1 -2
- package/lib/components/CreateForm/index.d.ts +2 -2
- package/lib/components/Echarts/index.d.ts +1 -2
- package/lib/components/EditTable/index.d.ts +1 -2
- package/lib/components/SearchTable/index.d.ts +1 -2
- package/lib/components/SearchTable/index.js +0 -1
- package/lib/components/Upload/index.d.ts +1 -1
- package/lib/components/VirtualTable/index.d.ts +1 -2
- package/lib/components/common/403.d.ts +1 -2
- package/lib/components/common/404.d.ts +1 -2
- package/lib/utils/index.js +0 -2
- package/lib/utils/verify-code.js +13 -0
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ButtonProps } from "antd";
|
|
3
2
|
export interface AuthButtonProps extends ButtonProps {
|
|
4
3
|
auth?: boolean;
|
|
5
4
|
}
|
|
6
|
-
declare const AuthButton: (props: AuthButtonProps) => JSX.Element | null;
|
|
5
|
+
declare const AuthButton: (props: AuthButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
6
|
export default AuthButton;
|
|
@@ -9,5 +9,5 @@ interface BackHeaderProps {
|
|
|
9
9
|
titleStyle?: CSSProperties;
|
|
10
10
|
level?: 1 | 2 | 3 | 4 | 5;
|
|
11
11
|
}
|
|
12
|
-
declare const BackHeader: (props: BackHeaderProps) => JSX.Element;
|
|
12
|
+
declare const BackHeader: (props: BackHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export default BackHeader;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ButtonProps } from "antd";
|
|
3
2
|
interface AuthProps {
|
|
4
3
|
PId: number;
|
|
@@ -7,5 +6,5 @@ export interface CoralButtonProps extends ButtonProps {
|
|
|
7
6
|
PId: number;
|
|
8
7
|
auths?: AuthProps[];
|
|
9
8
|
}
|
|
10
|
-
declare const CoralButton: (props: CoralButtonProps) => JSX.Element;
|
|
9
|
+
declare const CoralButton: (props: CoralButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
export default CoralButton;
|
|
@@ -44,12 +44,12 @@ export interface CreateFormProps {
|
|
|
44
44
|
readonly?: boolean;
|
|
45
45
|
hiddenTitle?: boolean;
|
|
46
46
|
}
|
|
47
|
-
declare const CreateForm: (props: CreateFormProps) => JSX.Element;
|
|
47
|
+
declare const CreateForm: (props: CreateFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
48
48
|
interface FormFieldsProps extends Pick<CreateFormItemProps<ValueType>, "valueType" | "valueProps"> {
|
|
49
49
|
onChange?: (e: any) => void;
|
|
50
50
|
value?: any;
|
|
51
51
|
onBtnClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>, item: ValueBtnProps) => void;
|
|
52
52
|
inputRef?: any;
|
|
53
53
|
}
|
|
54
|
-
export declare const FormFields: (props: FormFieldsProps) => React.ReactElement<any, string | React.JSXElementConstructor<any
|
|
54
|
+
export declare const FormFields: (props: FormFieldsProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
55
55
|
export default CreateForm;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import * as echarts from 'echarts/core';
|
|
3
2
|
import { BarSeriesOption, LineSeriesOption } from 'echarts/charts';
|
|
4
3
|
import { TitleComponentOption, TooltipComponentOption, GridComponentOption, DatasetComponentOption } from 'echarts/components';
|
|
@@ -10,5 +9,5 @@ export interface EchartsProps {
|
|
|
10
9
|
* @param props : EchartsProps 传入图标配置项
|
|
11
10
|
* 外部包裹一层dom元素定义width和height,内部自动占满
|
|
12
11
|
*/
|
|
13
|
-
declare const Echarts: (props: EchartsProps) => JSX.Element;
|
|
12
|
+
declare const Echarts: (props: EchartsProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
export default Echarts;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TableProps } from "antd";
|
|
3
2
|
import { Rule } from "antd/es/form";
|
|
4
3
|
import { ColumnType } from "antd/es/table";
|
|
@@ -13,5 +12,5 @@ export interface EditTableProps<RecordType> extends Omit<TableProps<RecordType>,
|
|
|
13
12
|
columns: ColumnsType<RecordType>[];
|
|
14
13
|
onChange?: (row: RecordType) => void;
|
|
15
14
|
}
|
|
16
|
-
declare function EditTable<DataType extends object = any>(props: EditTableProps<DataType>): JSX.Element;
|
|
15
|
+
declare function EditTable<DataType extends object = any>(props: EditTableProps<DataType>): import("react/jsx-runtime").JSX.Element;
|
|
17
16
|
export default EditTable;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TableProps } from "antd";
|
|
3
2
|
import { ColumnType } from "antd/es/table";
|
|
4
3
|
import { CreateFormProps } from "../CreateForm";
|
|
@@ -14,5 +13,5 @@ export interface SearchTableProps<RecordType> {
|
|
|
14
13
|
searchProps?: CreateFormProps;
|
|
15
14
|
tableProps?: MTableProps<RecordType>;
|
|
16
15
|
}
|
|
17
|
-
declare function SearchTable<RecordType extends object = any>(props: SearchTableProps<RecordType>): JSX.Element;
|
|
16
|
+
declare function SearchTable<RecordType extends object = any>(props: SearchTableProps<RecordType>): import("react/jsx-runtime").JSX.Element;
|
|
18
17
|
export default SearchTable;
|
|
@@ -24,7 +24,6 @@ function SearchTable(props) {
|
|
|
24
24
|
...rest,
|
|
25
25
|
className: classNames(classes.table, tableProps == null ? void 0 : tableProps.className),
|
|
26
26
|
pagination: typeof (tableProps == null ? void 0 : tableProps.pagination) === "boolean" ? tableProps.pagination : {
|
|
27
|
-
hideOnSinglePage: true,
|
|
28
27
|
showPrevNextJumpers: true,
|
|
29
28
|
showQuickJumper: true,
|
|
30
29
|
showSizeChanger: true,
|
|
@@ -10,5 +10,5 @@ export interface UploadFileProps extends UploadProps {
|
|
|
10
10
|
limit?: number;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
declare const UploadFile: (props: UploadFileProps) => JSX.Element;
|
|
13
|
+
declare const UploadFile: (props: UploadFileProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default UploadFile;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { EditTableProps } from "../EditTable";
|
|
3
|
-
declare function VirtualTable<DataType extends object = any>(props: EditTableProps<DataType>): JSX.Element;
|
|
2
|
+
declare function VirtualTable<DataType extends object = any>(props: EditTableProps<DataType>): import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default VirtualTable;
|
package/es/utils/index.js
CHANGED
package/es/utils/verify-code.js
CHANGED
|
@@ -6,12 +6,19 @@ var __publicField = (obj, key, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
class getGVerify {
|
|
8
8
|
constructor(options) {
|
|
9
|
+
//创建图形验证码
|
|
9
10
|
__publicField(this, "options", {
|
|
11
|
+
//默认值
|
|
10
12
|
id: "",
|
|
13
|
+
//容器Id
|
|
11
14
|
canvasId: "verifyCanvas",
|
|
15
|
+
//canvas的ID
|
|
12
16
|
width: 100,
|
|
17
|
+
//默认canvas宽度
|
|
13
18
|
height: 30,
|
|
19
|
+
//默认canvas高度
|
|
14
20
|
type: "blend",
|
|
21
|
+
//图形验证码默认类型blend:数字字母混合类型、number:纯数字、letter:纯字母
|
|
15
22
|
code: ""
|
|
16
23
|
});
|
|
17
24
|
this.options = options;
|
|
@@ -22,6 +29,7 @@ class getGVerify {
|
|
|
22
29
|
this._init();
|
|
23
30
|
this.refresh();
|
|
24
31
|
}
|
|
32
|
+
/**初始化方法**/
|
|
25
33
|
_init() {
|
|
26
34
|
const con = document.getElementById(this.options.id);
|
|
27
35
|
const canvas = document.createElement("canvas");
|
|
@@ -37,6 +45,7 @@ class getGVerify {
|
|
|
37
45
|
this.refresh();
|
|
38
46
|
};
|
|
39
47
|
}
|
|
48
|
+
/**生成验证码**/
|
|
40
49
|
refresh() {
|
|
41
50
|
this.options.code = "";
|
|
42
51
|
const canvas = document.getElementById(this.options.canvasId);
|
|
@@ -87,6 +96,7 @@ class getGVerify {
|
|
|
87
96
|
ctx.fill();
|
|
88
97
|
}
|
|
89
98
|
}
|
|
99
|
+
/**验证验证码**/
|
|
90
100
|
validate(code) {
|
|
91
101
|
const verifyCode = code.toLowerCase();
|
|
92
102
|
const v_code = this.options.code.toLowerCase();
|
|
@@ -96,13 +106,16 @@ class getGVerify {
|
|
|
96
106
|
return false;
|
|
97
107
|
}
|
|
98
108
|
}
|
|
109
|
+
/**生成字母数组**/
|
|
99
110
|
getAllLetter() {
|
|
100
111
|
const letterStr = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z";
|
|
101
112
|
return letterStr.split(",");
|
|
102
113
|
}
|
|
114
|
+
/**生成一个随机数**/
|
|
103
115
|
randomNum(min, max) {
|
|
104
116
|
return Math.floor(Math.random() * (max - min) + min);
|
|
105
117
|
}
|
|
118
|
+
/**生成一个随机色**/
|
|
106
119
|
randomColor(min, max) {
|
|
107
120
|
const r = this.randomNum(min, max);
|
|
108
121
|
const g = this.randomNum(min, max);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ButtonProps } from "antd";
|
|
3
2
|
export interface AuthButtonProps extends ButtonProps {
|
|
4
3
|
auth?: boolean;
|
|
5
4
|
}
|
|
6
|
-
declare const AuthButton: (props: AuthButtonProps) => JSX.Element | null;
|
|
5
|
+
declare const AuthButton: (props: AuthButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
6
|
export default AuthButton;
|
|
@@ -9,5 +9,5 @@ interface BackHeaderProps {
|
|
|
9
9
|
titleStyle?: CSSProperties;
|
|
10
10
|
level?: 1 | 2 | 3 | 4 | 5;
|
|
11
11
|
}
|
|
12
|
-
declare const BackHeader: (props: BackHeaderProps) => JSX.Element;
|
|
12
|
+
declare const BackHeader: (props: BackHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export default BackHeader;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ButtonProps } from "antd";
|
|
3
2
|
interface AuthProps {
|
|
4
3
|
PId: number;
|
|
@@ -7,5 +6,5 @@ export interface CoralButtonProps extends ButtonProps {
|
|
|
7
6
|
PId: number;
|
|
8
7
|
auths?: AuthProps[];
|
|
9
8
|
}
|
|
10
|
-
declare const CoralButton: (props: CoralButtonProps) => JSX.Element;
|
|
9
|
+
declare const CoralButton: (props: CoralButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
export default CoralButton;
|
|
@@ -44,12 +44,12 @@ export interface CreateFormProps {
|
|
|
44
44
|
readonly?: boolean;
|
|
45
45
|
hiddenTitle?: boolean;
|
|
46
46
|
}
|
|
47
|
-
declare const CreateForm: (props: CreateFormProps) => JSX.Element;
|
|
47
|
+
declare const CreateForm: (props: CreateFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
48
48
|
interface FormFieldsProps extends Pick<CreateFormItemProps<ValueType>, "valueType" | "valueProps"> {
|
|
49
49
|
onChange?: (e: any) => void;
|
|
50
50
|
value?: any;
|
|
51
51
|
onBtnClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>, item: ValueBtnProps) => void;
|
|
52
52
|
inputRef?: any;
|
|
53
53
|
}
|
|
54
|
-
export declare const FormFields: (props: FormFieldsProps) => React.ReactElement<any, string | React.JSXElementConstructor<any
|
|
54
|
+
export declare const FormFields: (props: FormFieldsProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
55
55
|
export default CreateForm;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import * as echarts from 'echarts/core';
|
|
3
2
|
import { BarSeriesOption, LineSeriesOption } from 'echarts/charts';
|
|
4
3
|
import { TitleComponentOption, TooltipComponentOption, GridComponentOption, DatasetComponentOption } from 'echarts/components';
|
|
@@ -10,5 +9,5 @@ export interface EchartsProps {
|
|
|
10
9
|
* @param props : EchartsProps 传入图标配置项
|
|
11
10
|
* 外部包裹一层dom元素定义width和height,内部自动占满
|
|
12
11
|
*/
|
|
13
|
-
declare const Echarts: (props: EchartsProps) => JSX.Element;
|
|
12
|
+
declare const Echarts: (props: EchartsProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
export default Echarts;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TableProps } from "antd";
|
|
3
2
|
import { Rule } from "antd/es/form";
|
|
4
3
|
import { ColumnType } from "antd/es/table";
|
|
@@ -13,5 +12,5 @@ export interface EditTableProps<RecordType> extends Omit<TableProps<RecordType>,
|
|
|
13
12
|
columns: ColumnsType<RecordType>[];
|
|
14
13
|
onChange?: (row: RecordType) => void;
|
|
15
14
|
}
|
|
16
|
-
declare function EditTable<DataType extends object = any>(props: EditTableProps<DataType>): JSX.Element;
|
|
15
|
+
declare function EditTable<DataType extends object = any>(props: EditTableProps<DataType>): import("react/jsx-runtime").JSX.Element;
|
|
17
16
|
export default EditTable;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TableProps } from "antd";
|
|
3
2
|
import { ColumnType } from "antd/es/table";
|
|
4
3
|
import { CreateFormProps } from "../CreateForm";
|
|
@@ -14,5 +13,5 @@ export interface SearchTableProps<RecordType> {
|
|
|
14
13
|
searchProps?: CreateFormProps;
|
|
15
14
|
tableProps?: MTableProps<RecordType>;
|
|
16
15
|
}
|
|
17
|
-
declare function SearchTable<RecordType extends object = any>(props: SearchTableProps<RecordType>): JSX.Element;
|
|
16
|
+
declare function SearchTable<RecordType extends object = any>(props: SearchTableProps<RecordType>): import("react/jsx-runtime").JSX.Element;
|
|
18
17
|
export default SearchTable;
|
|
@@ -25,7 +25,6 @@ function SearchTable(props) {
|
|
|
25
25
|
...rest,
|
|
26
26
|
className: classNames(classes.table, tableProps == null ? void 0 : tableProps.className),
|
|
27
27
|
pagination: typeof (tableProps == null ? void 0 : tableProps.pagination) === "boolean" ? tableProps.pagination : {
|
|
28
|
-
hideOnSinglePage: true,
|
|
29
28
|
showPrevNextJumpers: true,
|
|
30
29
|
showQuickJumper: true,
|
|
31
30
|
showSizeChanger: true,
|
|
@@ -10,5 +10,5 @@ export interface UploadFileProps extends UploadProps {
|
|
|
10
10
|
limit?: number;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
declare const UploadFile: (props: UploadFileProps) => JSX.Element;
|
|
13
|
+
declare const UploadFile: (props: UploadFileProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default UploadFile;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { EditTableProps } from "../EditTable";
|
|
3
|
-
declare function VirtualTable<DataType extends object = any>(props: EditTableProps<DataType>): JSX.Element;
|
|
2
|
+
declare function VirtualTable<DataType extends object = any>(props: EditTableProps<DataType>): import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default VirtualTable;
|
package/lib/utils/index.js
CHANGED
package/lib/utils/verify-code.js
CHANGED
|
@@ -8,12 +8,19 @@ var __publicField = (obj, key, value) => {
|
|
|
8
8
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
9
9
|
class getGVerify {
|
|
10
10
|
constructor(options) {
|
|
11
|
+
//创建图形验证码
|
|
11
12
|
__publicField(this, "options", {
|
|
13
|
+
//默认值
|
|
12
14
|
id: "",
|
|
15
|
+
//容器Id
|
|
13
16
|
canvasId: "verifyCanvas",
|
|
17
|
+
//canvas的ID
|
|
14
18
|
width: 100,
|
|
19
|
+
//默认canvas宽度
|
|
15
20
|
height: 30,
|
|
21
|
+
//默认canvas高度
|
|
16
22
|
type: "blend",
|
|
23
|
+
//图形验证码默认类型blend:数字字母混合类型、number:纯数字、letter:纯字母
|
|
17
24
|
code: ""
|
|
18
25
|
});
|
|
19
26
|
this.options = options;
|
|
@@ -24,6 +31,7 @@ class getGVerify {
|
|
|
24
31
|
this._init();
|
|
25
32
|
this.refresh();
|
|
26
33
|
}
|
|
34
|
+
/**初始化方法**/
|
|
27
35
|
_init() {
|
|
28
36
|
const con = document.getElementById(this.options.id);
|
|
29
37
|
const canvas = document.createElement("canvas");
|
|
@@ -39,6 +47,7 @@ class getGVerify {
|
|
|
39
47
|
this.refresh();
|
|
40
48
|
};
|
|
41
49
|
}
|
|
50
|
+
/**生成验证码**/
|
|
42
51
|
refresh() {
|
|
43
52
|
this.options.code = "";
|
|
44
53
|
const canvas = document.getElementById(this.options.canvasId);
|
|
@@ -89,6 +98,7 @@ class getGVerify {
|
|
|
89
98
|
ctx.fill();
|
|
90
99
|
}
|
|
91
100
|
}
|
|
101
|
+
/**验证验证码**/
|
|
92
102
|
validate(code) {
|
|
93
103
|
const verifyCode = code.toLowerCase();
|
|
94
104
|
const v_code = this.options.code.toLowerCase();
|
|
@@ -98,13 +108,16 @@ class getGVerify {
|
|
|
98
108
|
return false;
|
|
99
109
|
}
|
|
100
110
|
}
|
|
111
|
+
/**生成字母数组**/
|
|
101
112
|
getAllLetter() {
|
|
102
113
|
const letterStr = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z";
|
|
103
114
|
return letterStr.split(",");
|
|
104
115
|
}
|
|
116
|
+
/**生成一个随机数**/
|
|
105
117
|
randomNum(min, max) {
|
|
106
118
|
return Math.floor(Math.random() * (max - min) + min);
|
|
107
119
|
}
|
|
120
|
+
/**生成一个随机色**/
|
|
108
121
|
randomColor(min, max) {
|
|
109
122
|
const r = this.randomNum(min, max);
|
|
110
123
|
const g = this.randomNum(min, max);
|