@zeedhi/zd-user-info-common 1.3.4 → 3.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/README.md +92 -142
- package/{types → dist/types}/UserInfoController.d.ts +8 -7
- package/dist/types/index.d.ts +5 -0
- package/{types → dist/types}/interfaces.d.ts +27 -27
- package/dist/types/tek-user-info/TekUserInfoController.d.ts +22 -0
- package/dist/types/tek-user-info/interfaces.d.ts +27 -0
- package/dist/types/tek-user-info/tek-user-info-list.d.ts +32 -0
- package/dist/types/tek-user-info/tek-user-info.d.ts +37 -0
- package/{types → dist/types}/user-info.d.ts +130 -134
- package/dist/user-info-common.es.js +635 -0
- package/package.json +31 -17
- package/dist/user-info-common.esm.js +0 -226
- package/dist/user-info-common.umd.js +0 -233
- package/types/index.d.ts +0 -2
package/README.md
CHANGED
|
@@ -1,161 +1,111 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Componente Field Group para Zeedhi
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Utilize o comando abaixo para instalar ambos automaticamente:
|
|
9
|
-
|
|
10
|
-
```sh
|
|
11
|
-
npm install @zeedhi/zd-user-info
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
Ou instale os pacotes separadamente:
|
|
15
|
-
|
|
16
|
-
```sh
|
|
17
|
-
npm install @zeedhi/zd-user-info-vue @zeedhi/zd-user-info-common
|
|
18
|
-
```
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="#instalação">Instalação</a> |
|
|
5
|
+
<a href="#uso-básico">Uso Básico</a> |
|
|
6
|
+
<a href="#propriedades">Propriedades</a> |
|
|
7
|
+
</p>
|
|
19
8
|
|
|
20
|
-
|
|
9
|
+
O component zd-user-info é um card capas de agrupar campos
|
|
21
10
|
|
|
22
|
-
|
|
11
|
+
<p align="center">
|
|
12
|
+
<img alt="zd-user-info" src="./img/user-info.png" width="100%">
|
|
13
|
+
</p>
|
|
23
14
|
|
|
24
|
-
##
|
|
15
|
+
## Instalação
|
|
25
16
|
|
|
26
|
-
Para
|
|
17
|
+
Para instalar o pacote basta rodar o seguinte comando:\
|
|
18
|
+
`npm i @zeedhi/zd-user-info`\
|
|
19
|
+
Com isso, dois pacotes serão instalados: o @zeedhi/zd-user-info-common e o @zeedhi/zd-user-info-vue.\
|
|
20
|
+
Após a instalação, é necessário que você importe o pacote @zeedhi/zd-user-info-vue dentro de seu arquivo de configuração `zeedhi.ts`
|
|
27
21
|
|
|
28
|
-
```
|
|
29
|
-
import
|
|
30
|
-
import { ZdUserInfo } from '@zeedhi/zd-user-info';
|
|
31
|
-
// import { ZdUserInfo } from '@zeedhi/zd-user-info-vue'; caso tenha instalado os pacotes separadamente
|
|
22
|
+
```shell
|
|
23
|
+
import { ZdFieldGroup } from '@zeedhi/zd-user-info-vue';
|
|
32
24
|
|
|
33
|
-
Vue.component('
|
|
25
|
+
Vue.component('ZdFieldGroup', ZdFieldGroup);
|
|
34
26
|
```
|
|
35
27
|
|
|
28
|
+
Já o pacote @zeedhi/zd-user-info-common deve ser importado no arquivo controller do componente.
|
|
29
|
+
|
|
36
30
|
## Uso Básico
|
|
37
31
|
|
|
38
|
-
Para
|
|
32
|
+
Para usar, defina a propriedade component como 'ZdFieldGroup'.
|
|
39
33
|
|
|
40
34
|
```json
|
|
41
35
|
{
|
|
42
|
-
"name": "
|
|
43
|
-
"component": "
|
|
44
|
-
"cssClass": "zd-display-flex zd-justify-end",
|
|
45
|
-
"children": [
|
|
46
|
-
{
|
|
47
|
-
"name": "user-info",
|
|
48
|
-
"component": "ZdUserInfo",
|
|
49
|
-
"user": "Jane Doe",
|
|
50
|
-
"userImage": "https://picsum.photos/id/1005/100/100.jpg",
|
|
51
|
-
"minWidth": "200px"
|
|
52
|
-
}
|
|
53
|
-
]
|
|
36
|
+
"name": "user-info-example",
|
|
37
|
+
"component": "ZdFieldGroup"
|
|
54
38
|
}
|
|
55
39
|
```
|
|
56
40
|
|
|
57
|
-
<p align="center" justify="center">
|
|
58
|
-
<img src="./img/basic-usage-1.png" alt="Basic Usage"/>
|
|
59
|
-
</p>
|
|
60
|
-
<p align="center" justify="center">
|
|
61
|
-
<img src="./img/basic-usage-2.png" alt="Basic Usage"/>
|
|
62
|
-
</p>
|
|
63
|
-
|
|
64
|
-
|
|
65
41
|
## Propriedades
|
|
66
42
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
</
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
```json
|
|
138
|
-
{
|
|
139
|
-
"name": "card",
|
|
140
|
-
"component": "ZdCard",
|
|
141
|
-
"cssClass": "zd-display-flex zd-justify-end",
|
|
142
|
-
"children": [
|
|
143
|
-
{
|
|
144
|
-
"name": "user-info",
|
|
145
|
-
"component": "ZdUserInfo",
|
|
146
|
-
"user": "Jane Doe",
|
|
147
|
-
"minWidth": "200px",
|
|
148
|
-
"activator": {
|
|
149
|
-
"name": "user-button",
|
|
150
|
-
"component": "ZdButton",
|
|
151
|
-
"icon": true,
|
|
152
|
-
"iconName": "mdi-account"
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
]
|
|
156
|
-
}
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
<p align="center" justify="center">
|
|
160
|
-
<img src="./img/example-2.png" alt="Basic Usage"/>
|
|
161
|
-
</p>
|
|
43
|
+
<table>
|
|
44
|
+
<thead>
|
|
45
|
+
<tr>
|
|
46
|
+
<th>Nome</th>
|
|
47
|
+
<th>Tipo</th>
|
|
48
|
+
<th>Default</th>
|
|
49
|
+
<th>Descrição</th>
|
|
50
|
+
</tr>
|
|
51
|
+
</thead>
|
|
52
|
+
<tbody>
|
|
53
|
+
<tr>
|
|
54
|
+
<td>disableActionRotate</td>
|
|
55
|
+
<td>boolean | string</td>
|
|
56
|
+
<td>true</td>
|
|
57
|
+
<td>Desativa a animação de rotação de ação ao expandir ou recolher o cartão recolhido</td>
|
|
58
|
+
</tr>
|
|
59
|
+
<tr>
|
|
60
|
+
<td>expandButton</td>
|
|
61
|
+
<td>IButton</td>
|
|
62
|
+
<td>undefined</td>
|
|
63
|
+
<td>Se definido, substitui o ícone de expansão pelo botão definido</td>
|
|
64
|
+
</tr>
|
|
65
|
+
<tr>
|
|
66
|
+
<td>expanded</td>
|
|
67
|
+
<td>boolean | string</td>
|
|
68
|
+
<td>false</td>
|
|
69
|
+
<td>Define se o componente está aberto ou fecahdo</td>
|
|
70
|
+
</tr>
|
|
71
|
+
<tr>
|
|
72
|
+
<td>header</td>
|
|
73
|
+
<td>IComponent[]</td>
|
|
74
|
+
<td>[]</td>
|
|
75
|
+
<td>Componentes a serem exibidos no cabeçalho</td>
|
|
76
|
+
</tr>
|
|
77
|
+
<tr>
|
|
78
|
+
<td>hideAction</td>
|
|
79
|
+
<td>boolean | string</td>
|
|
80
|
+
<td>false</td>
|
|
81
|
+
<td>Oculta o ícone de expansão</td>
|
|
82
|
+
</tr>
|
|
83
|
+
<tr>
|
|
84
|
+
<td>iconColor</td>
|
|
85
|
+
<td>string</td>
|
|
86
|
+
<td>var(--v-primary-base)</td>
|
|
87
|
+
<td>Define a cor do icone de expansão</td>
|
|
88
|
+
</tr>
|
|
89
|
+
<tr>
|
|
90
|
+
<td>iconName</td>
|
|
91
|
+
<td>string</td>
|
|
92
|
+
<td>expand</td>
|
|
93
|
+
<td>Define o icone de expansão</p>
|
|
94
|
+
</td>
|
|
95
|
+
</tr>
|
|
96
|
+
<tr>
|
|
97
|
+
<td>lazyLoad</td>
|
|
98
|
+
<td>boolean</td>
|
|
99
|
+
<td>boolean | string</td>
|
|
100
|
+
<td>O conteúdo será carregado somente quando o cartão recolhido for aberto</td>
|
|
101
|
+
</tr>
|
|
102
|
+
<tr>
|
|
103
|
+
<td>readonly</td>
|
|
104
|
+
<td>boolean | string</td>
|
|
105
|
+
<td>false</td>
|
|
106
|
+
<td>Torna o cartão recolhido somente leitura. Faz a mesma coisa que o suporte desativado, mas não altera os estilos</td>
|
|
107
|
+
</tr>
|
|
108
|
+
</tbody>
|
|
109
|
+
</table>
|
|
110
|
+
|
|
111
|
+
<hr>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { UserInfo } from './user-info';
|
|
2
|
-
|
|
3
|
-
component: UserInfo;
|
|
4
|
-
constructor(component: UserInfo);
|
|
5
|
-
get showChangeProfile(): boolean;
|
|
6
|
-
get showLogout(): boolean;
|
|
7
|
-
}
|
|
1
|
+
import { UserInfo } from './user-info';
|
|
2
|
+
declare class UserInfoController {
|
|
3
|
+
component: UserInfo;
|
|
4
|
+
constructor(component: UserInfo);
|
|
5
|
+
get showChangeProfile(): boolean;
|
|
6
|
+
get showLogout(): boolean;
|
|
7
|
+
}
|
|
8
|
+
export { UserInfoController };
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { IComponentRender } from '@zeedhi/common';
|
|
2
|
-
import { IDictionary } from '@zeedhi/core';
|
|
3
|
-
export interface IUserInfo extends IComponentRender {
|
|
4
|
-
activator?: IComponentRender;
|
|
5
|
-
avatarProps?: IDictionary;
|
|
6
|
-
bottomSlot?: IComponentRender[];
|
|
7
|
-
centerSlot?: IComponentRender[];
|
|
8
|
-
closeOnClick?: boolean;
|
|
9
|
-
closeOnContentClick?: boolean;
|
|
10
|
-
fixed?: boolean;
|
|
11
|
-
headerSlot?: IComponentRender[];
|
|
12
|
-
height?: number | string;
|
|
13
|
-
imageProps?: IDictionary;
|
|
14
|
-
offsetX?: boolean;
|
|
15
|
-
offsetY?: boolean;
|
|
16
|
-
openOnClick?: boolean;
|
|
17
|
-
openOnHover?: boolean;
|
|
18
|
-
maxHeight?: number | string;
|
|
19
|
-
maxWidth?: number | string;
|
|
20
|
-
minHeight?: number | string;
|
|
21
|
-
minWidth?: number | string;
|
|
22
|
-
topSlot?: IComponentRender[];
|
|
23
|
-
user?: string;
|
|
24
|
-
userImage?: string;
|
|
25
|
-
value?: boolean;
|
|
26
|
-
visibleItems?: IDictionary<boolean>;
|
|
27
|
-
}
|
|
1
|
+
import { IComponentRender } from '@zeedhi/common';
|
|
2
|
+
import { IDictionary } from '@zeedhi/core';
|
|
3
|
+
export interface IUserInfo extends IComponentRender {
|
|
4
|
+
activator?: IComponentRender;
|
|
5
|
+
avatarProps?: IDictionary;
|
|
6
|
+
bottomSlot?: IComponentRender[];
|
|
7
|
+
centerSlot?: IComponentRender[];
|
|
8
|
+
closeOnClick?: boolean;
|
|
9
|
+
closeOnContentClick?: boolean;
|
|
10
|
+
fixed?: boolean;
|
|
11
|
+
headerSlot?: IComponentRender[];
|
|
12
|
+
height?: number | string;
|
|
13
|
+
imageProps?: IDictionary;
|
|
14
|
+
offsetX?: boolean;
|
|
15
|
+
offsetY?: boolean;
|
|
16
|
+
openOnClick?: boolean;
|
|
17
|
+
openOnHover?: boolean;
|
|
18
|
+
maxHeight?: number | string;
|
|
19
|
+
maxWidth?: number | string;
|
|
20
|
+
minHeight?: number | string;
|
|
21
|
+
minWidth?: number | string;
|
|
22
|
+
topSlot?: IComponentRender[];
|
|
23
|
+
user?: string;
|
|
24
|
+
userImage?: string;
|
|
25
|
+
value?: boolean;
|
|
26
|
+
visibleItems?: IDictionary<boolean>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TekUserInfo } from './tek-user-info';
|
|
2
|
+
declare class TekUserInfoController {
|
|
3
|
+
component: TekUserInfo;
|
|
4
|
+
get versionInfo(): import('./interfaces').IVersionInfo | null;
|
|
5
|
+
constructor(component: TekUserInfo);
|
|
6
|
+
get name(): string;
|
|
7
|
+
set name(value: string);
|
|
8
|
+
get version(): string;
|
|
9
|
+
set version(value: string);
|
|
10
|
+
get hasDefaultEmail(): boolean;
|
|
11
|
+
get hasAboutImage(): boolean;
|
|
12
|
+
mergeText(name: string, version: string): string;
|
|
13
|
+
get mainVersion(): string;
|
|
14
|
+
protected getItems(tab: 'frontend' | 'backend' | 'modules'): string | never[];
|
|
15
|
+
get frontendItems(): string | never[];
|
|
16
|
+
get backendItems(): string | never[];
|
|
17
|
+
get modulesItems(): string | never[];
|
|
18
|
+
get showReportError(): boolean;
|
|
19
|
+
get showVersionInfo(): boolean;
|
|
20
|
+
get showAbout(): boolean;
|
|
21
|
+
}
|
|
22
|
+
export { TekUserInfoController };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IList } from '@zeedhi/common';
|
|
2
|
+
import { IUserInfo } from '../interfaces';
|
|
3
|
+
export interface IVersionInfo {
|
|
4
|
+
name: string;
|
|
5
|
+
version: string;
|
|
6
|
+
frontend: {
|
|
7
|
+
name: string;
|
|
8
|
+
version: string;
|
|
9
|
+
}[];
|
|
10
|
+
backend: {
|
|
11
|
+
name: string;
|
|
12
|
+
version: string;
|
|
13
|
+
}[];
|
|
14
|
+
modules: {
|
|
15
|
+
name: string;
|
|
16
|
+
version: string;
|
|
17
|
+
}[];
|
|
18
|
+
}
|
|
19
|
+
export interface ITekUserInfo extends IUserInfo {
|
|
20
|
+
aboutImage?: string;
|
|
21
|
+
defaultEmail?: string;
|
|
22
|
+
versionInfo?: IVersionInfo | null;
|
|
23
|
+
versionUrl?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ITekUserInfoList extends IList {
|
|
26
|
+
parentName?: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { List } from '@zeedhi/common';
|
|
2
|
+
import { ITekUserInfo, ITekUserInfoList } from './interfaces';
|
|
3
|
+
export declare class TekUserInfoList extends List implements ITekUserInfoList {
|
|
4
|
+
/**
|
|
5
|
+
* Name of the user info component
|
|
6
|
+
*/
|
|
7
|
+
parentName: string;
|
|
8
|
+
dense: boolean;
|
|
9
|
+
constructor(props: ITekUserInfo);
|
|
10
|
+
onCreated(): void;
|
|
11
|
+
protected getItems(): ({
|
|
12
|
+
name: string;
|
|
13
|
+
component: string;
|
|
14
|
+
title: string;
|
|
15
|
+
subtitle: string;
|
|
16
|
+
isVisible: string;
|
|
17
|
+
cssClass: string;
|
|
18
|
+
prependIcon?: undefined;
|
|
19
|
+
events?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
name: string;
|
|
22
|
+
component: string;
|
|
23
|
+
title: string;
|
|
24
|
+
prependIcon: string;
|
|
25
|
+
cssClass: string;
|
|
26
|
+
isVisible: string;
|
|
27
|
+
events: {
|
|
28
|
+
click: () => void;
|
|
29
|
+
};
|
|
30
|
+
subtitle?: undefined;
|
|
31
|
+
})[];
|
|
32
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Button, IComponentRender, Modal } from '@zeedhi/common';
|
|
2
|
+
import { IEventParam } from '@zeedhi/core';
|
|
3
|
+
import { UserInfo } from '../user-info';
|
|
4
|
+
import { ITekUserInfo, IVersionInfo } from './interfaces';
|
|
5
|
+
export declare class TekUserInfo extends UserInfo implements ITekUserInfo {
|
|
6
|
+
aboutModal?: Modal;
|
|
7
|
+
reportModal?: Modal;
|
|
8
|
+
/**
|
|
9
|
+
* Data about the application version
|
|
10
|
+
*/
|
|
11
|
+
versionInfo: IVersionInfo | null;
|
|
12
|
+
/**
|
|
13
|
+
* Default email address to be defined in the Report Bug form
|
|
14
|
+
*/
|
|
15
|
+
defaultEmail: string;
|
|
16
|
+
/**
|
|
17
|
+
* Url from which the version info will be retrieved
|
|
18
|
+
*/
|
|
19
|
+
versionUrl: string;
|
|
20
|
+
/**
|
|
21
|
+
* Path to the image to be shown on about modal
|
|
22
|
+
*/
|
|
23
|
+
aboutImage: string;
|
|
24
|
+
protected propBottomSlot?: IComponentRender[];
|
|
25
|
+
constructor(props: ITekUserInfo);
|
|
26
|
+
protected getBottomSlot(): IComponentRender[];
|
|
27
|
+
onAboutClick(): void;
|
|
28
|
+
protected getVersionTree(tab: 'frontend' | 'backend' | 'modules'): {
|
|
29
|
+
name: string;
|
|
30
|
+
component: string;
|
|
31
|
+
text: string;
|
|
32
|
+
}[];
|
|
33
|
+
onReportClick(): void;
|
|
34
|
+
onSendReport({ event, element }: IEventParam<Button>): Promise<void>;
|
|
35
|
+
onCreated(): void;
|
|
36
|
+
onMounted(element: any): Promise<void>;
|
|
37
|
+
}
|