@devtable/settings-form 4.17.0 → 4.19.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/dist/account/account-list.d.ts +9 -0
- package/dist/account/add-account.d.ts +9 -0
- package/dist/account/delete-account.d.ts +10 -0
- package/dist/account/edit-account.d.ts +10 -0
- package/dist/account/index.d.ts +4 -0
- package/dist/account/login/form.d.ts +9 -0
- package/dist/account/login/index.d.ts +11 -0
- package/dist/account/role-selector.d.ts +9 -0
- package/dist/account/styles.d.ts +9 -0
- package/dist/account/types.d.ts +3 -0
- package/dist/api-caller/account.d.ts +21 -0
- package/dist/api-caller/account.typed.d.ts +20 -0
- package/dist/api-caller/index.d.ts +13 -0
- package/dist/api-caller/role.d.ts +4 -0
- package/dist/api-caller/role.typed.d.ts +5 -0
- package/dist/datasource/styles.d.ts +3 -0
- package/dist/index.d.ts +4 -0
- package/dist/settings-form.es.js +1201 -521
- package/dist/settings-form.umd.js +10 -10
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IStyles } from './styles';
|
|
3
|
+
import { ISettingsFormConfig } from './types';
|
|
4
|
+
interface IAccountList {
|
|
5
|
+
styles?: IStyles;
|
|
6
|
+
config: ISettingsFormConfig;
|
|
7
|
+
}
|
|
8
|
+
export declare function AccountList({ styles, config }: IAccountList): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IStyles } from './styles';
|
|
3
|
+
interface IAddAccount {
|
|
4
|
+
styles?: IStyles;
|
|
5
|
+
onSuccess: () => void;
|
|
6
|
+
initialRoleID: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function AddAccount({ onSuccess, styles, initialRoleID }: IAddAccount): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IStyles } from './styles';
|
|
3
|
+
interface IDeleteAccount {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
onSuccess: () => void;
|
|
7
|
+
styles?: IStyles;
|
|
8
|
+
}
|
|
9
|
+
export declare function DeleteAccount({ id, name, onSuccess, styles }: IDeleteAccount): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IAccount } from '../api-caller/account.typed';
|
|
3
|
+
import { IStyles } from './styles';
|
|
4
|
+
interface IEditAccount {
|
|
5
|
+
styles?: IStyles;
|
|
6
|
+
onSuccess: () => void;
|
|
7
|
+
account: IAccount;
|
|
8
|
+
}
|
|
9
|
+
export declare function EditAccount({ account, onSuccess, styles }: IEditAccount): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ILoginResp } from '../../api-caller/account.typed';
|
|
3
|
+
import { IStyles } from '../styles';
|
|
4
|
+
interface ILoginForm {
|
|
5
|
+
postSubmit: (resp: ILoginResp) => void;
|
|
6
|
+
styles?: IStyles;
|
|
7
|
+
}
|
|
8
|
+
export declare function LoginForm({ postSubmit, styles }: ILoginForm): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IStyles } from '../styles';
|
|
3
|
+
import { ISettingsFormConfig } from '../types';
|
|
4
|
+
import { ILoginResp } from '../../api-caller/account.typed';
|
|
5
|
+
interface ILogin {
|
|
6
|
+
styles?: IStyles;
|
|
7
|
+
config: ISettingsFormConfig;
|
|
8
|
+
onSuccess: (resp: ILoginResp) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function Login({ styles, config, onSuccess }: ILogin): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IStyles } from './styles';
|
|
3
|
+
interface IRoleSelector {
|
|
4
|
+
value: number;
|
|
5
|
+
onChange: (v: number) => void;
|
|
6
|
+
styles: IStyles;
|
|
7
|
+
}
|
|
8
|
+
export declare const RoleSelector: import("react").ForwardRefExoticComponent<IRoleSelector & import("react").RefAttributes<unknown>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IAccount, IEditAccountPayload, ILoginResp } from './account.typed';
|
|
2
|
+
import { PaginationResponse } from './types';
|
|
3
|
+
export declare const account: {
|
|
4
|
+
login: (name: string, password: string) => Promise<ILoginResp>;
|
|
5
|
+
list: () => Promise<PaginationResponse<IAccount>>;
|
|
6
|
+
/**
|
|
7
|
+
* get current account
|
|
8
|
+
*/
|
|
9
|
+
get: () => Promise<IAccount>;
|
|
10
|
+
/**
|
|
11
|
+
* update current account
|
|
12
|
+
*/
|
|
13
|
+
update: (name: string, email: string) => Promise<IAccount>;
|
|
14
|
+
/**
|
|
15
|
+
* change current account's password
|
|
16
|
+
*/
|
|
17
|
+
changepassword: (old_password: string, new_password: string) => Promise<IAccount>;
|
|
18
|
+
create: (name: string, email: string, password: string, role_id: number) => Promise<IAccount>;
|
|
19
|
+
edit: (payload: IEditAccountPayload) => Promise<IAccount>;
|
|
20
|
+
delete: (id: string) => Promise<void>;
|
|
21
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface IAccount {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
role_id: number;
|
|
6
|
+
create_time: string;
|
|
7
|
+
update_time: string;
|
|
8
|
+
}
|
|
9
|
+
export interface IEditAccountPayload {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
email: string;
|
|
13
|
+
role_id: number;
|
|
14
|
+
reset_password: boolean;
|
|
15
|
+
new_password?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ILoginResp {
|
|
18
|
+
account: IAccount;
|
|
19
|
+
token: string;
|
|
20
|
+
}
|
|
@@ -4,4 +4,17 @@ export declare const APICaller: {
|
|
|
4
4
|
create: (type: import("./datasource.typed").DataSourceType, key: string, config: import("./datasource.typed").IDataSourceConfig) => Promise<false | import("./types").PaginationResponse<import("./datasource.typed").IDataSource>>;
|
|
5
5
|
delete: (id: string) => Promise<void>;
|
|
6
6
|
};
|
|
7
|
+
account: {
|
|
8
|
+
login: (name: string, password: string) => Promise<import("./account.typed").ILoginResp>;
|
|
9
|
+
list: () => Promise<import("./types").PaginationResponse<import("./account.typed").IAccount>>;
|
|
10
|
+
get: () => Promise<import("./account.typed").IAccount>;
|
|
11
|
+
update: (name: string, email: string) => Promise<import("./account.typed").IAccount>;
|
|
12
|
+
changepassword: (old_password: string, new_password: string) => Promise<import("./account.typed").IAccount>;
|
|
13
|
+
create: (name: string, email: string, password: string, role_id: number) => Promise<import("./account.typed").IAccount>;
|
|
14
|
+
edit: (payload: import("./account.typed").IEditAccountPayload) => Promise<import("./account.typed").IAccount>;
|
|
15
|
+
delete: (id: string) => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
role: {
|
|
18
|
+
list: () => Promise<import("./role.typed").IRole[]>;
|
|
19
|
+
};
|
|
7
20
|
};
|