@zeedhi/zd-avatar-vue 1.3.4 → 1.5.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 +121 -0
- package/dist/avatar-vue.esm.js +4 -0
- package/dist/avatar-vue.umd.js +7 -4
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# ZdAvatar
|
|
2
|
+
|
|
3
|
+
Componente de Avatar construído com o Zeedhi Next
|
|
4
|
+
|
|
5
|
+
### Instalação
|
|
6
|
+
|
|
7
|
+
O ZdAvatar é composto pelos pacotes `@zeedhi/zd-avatar-common` e `@zeedhi/zd-avatar-vue`.
|
|
8
|
+
Utilize o comando abaixo para instalar ambos automaticamente:
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install @zeedhi/zd-avatar
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Ou instale os pacotes separadamente:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm install @zeedhi/zd-avatar-vue @zeedhi/zd-avatar-common
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Registro do Componente
|
|
21
|
+
|
|
22
|
+
Para registrá-lo, adicione o seguinte código ao inicializar a aplicação (por exemplo no arquivo `zeedhi.ts`)
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import Vue from 'vue';
|
|
26
|
+
import { ZdAvatar } from '@zeedhi/zd-avatar';
|
|
27
|
+
// import { ZdAvatar } from '@zeedhi/zd-avatar-vue'; caso tenha instalado os pacotes separadamente
|
|
28
|
+
|
|
29
|
+
Vue.component('ZdAvatar', ZdAvatar);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Uso Básico
|
|
33
|
+
|
|
34
|
+
Para utilizá-lo em um Metadata, basta definir a propriedade `component` como `"ZdAvatar"`. Para definir o conteúdo do Avatar, defina a propriedade `avatarSlot` com um array de componentes:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"name": "card",
|
|
39
|
+
"component": "ZdCard",
|
|
40
|
+
"cssClass": "zd-display-flex zd-justify-space-around zd-align-center",
|
|
41
|
+
"children": [
|
|
42
|
+
{
|
|
43
|
+
"name": "avatar-1",
|
|
44
|
+
"component": "ZdAvatar",
|
|
45
|
+
"color": "orange",
|
|
46
|
+
"size": 36,
|
|
47
|
+
"avatarSlot": [
|
|
48
|
+
{
|
|
49
|
+
"name": "icon-slot",
|
|
50
|
+
"component": "ZdIcon",
|
|
51
|
+
"color": "white",
|
|
52
|
+
"iconName": "mdi-pencil"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "avatar-2",
|
|
58
|
+
"component": "ZdAvatar",
|
|
59
|
+
"color": "primary",
|
|
60
|
+
"avatarSlot": [
|
|
61
|
+
{
|
|
62
|
+
"name": "text-slot",
|
|
63
|
+
"component": "ZdText",
|
|
64
|
+
"cssClass": "white--text",
|
|
65
|
+
"text": "ZD"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "avatar-3",
|
|
71
|
+
"component": "ZdAvatar",
|
|
72
|
+
"size": 62,
|
|
73
|
+
"avatarSlot": [
|
|
74
|
+
{
|
|
75
|
+
"name": "img-slot",
|
|
76
|
+
"component": "ZdImage",
|
|
77
|
+
"height": "100px",
|
|
78
|
+
"src": "https://picsum.photos/id/1005/200/200.jpg"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
<p align="center">
|
|
87
|
+
<img src="./img/basic-usage.png" alt="Basic Usage"/>
|
|
88
|
+
</p>
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
### Propriedades
|
|
92
|
+
|
|
93
|
+
| **Nome** | **Tipo** | **Padrão** | **Descrição** |
|
|
94
|
+
|------------|-------------------------------|------------|---------------------------------------------------------------------------------------------------------------------|
|
|
95
|
+
| avatarSlot | IComponentRender\[\] | \[\] | Componentes que serão renderizados dentro do Avatar |
|
|
96
|
+
| color | string | "primary" | Aplica a cor especificada ao componente\. Pode ser a cor por extenso no padrão do material design ou em hexadecimal |
|
|
97
|
+
| rounded | boolean \| string | false | Aplica uma borda arredondada no Avatar |
|
|
98
|
+
| size | number \| string | 48 | Largura e altura do Avatar |
|
|
99
|
+
| tile | boolean | false | Remove o border\-radius do componente |
|
|
100
|
+
| height | number \| string \| undefined | undefined | Altura do componente |
|
|
101
|
+
| maxHeight | number \| string \| undefined | undefined | Altura máxima do componente |
|
|
102
|
+
| maxWidth | number \| string \| undefined | undefined | Largura máxima do componente |
|
|
103
|
+
| minHeight | number \| string \| undefined | undefined | Altura mínima do componente |
|
|
104
|
+
| minWidth | number \| string \| undefined | undefined | Largura mínima do componente |
|
|
105
|
+
| width | number \| string \| undefined | undefined | Largura do componente |
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
#### Eventos
|
|
110
|
+
|
|
111
|
+
O Avatar aceita apenas um evento, que é o de click:
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"name": "click-avatar",
|
|
116
|
+
"component": "ZdAvatar",
|
|
117
|
+
"events": {
|
|
118
|
+
"click": "{{Controller.clickEvent}}"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
package/dist/avatar-vue.esm.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VersionService } from '@zeedhi/core';
|
|
1
2
|
import { Prop, Component } from 'vue-property-decorator';
|
|
2
3
|
import { PropWatch, ZdComponentRender } from '@zeedhi/vuetify';
|
|
3
4
|
import { Avatar } from '@zeedhi/zd-avatar-common';
|
|
@@ -301,4 +302,7 @@ __vue_render__._withStripped = true;
|
|
|
301
302
|
undefined
|
|
302
303
|
);
|
|
303
304
|
|
|
305
|
+
const packageContent = require('../package.json');
|
|
306
|
+
VersionService.addPackageVersion(packageContent.name, packageContent.version);
|
|
307
|
+
|
|
304
308
|
export { __vue_component__ as ZdAvatar, script as ZdAvatarClass };
|
package/dist/avatar-vue.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue-property-decorator'), require('@zeedhi/vuetify'), require('@zeedhi/zd-avatar-common')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue-property-decorator', '@zeedhi/vuetify', '@zeedhi/zd-avatar-common'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@zeedhi/zd-avatar-vue"] = {}, global["vue-property-decorator"], global["@zeedhi/vuetify"], global["@zeedhi/zd-avatar-common"]));
|
|
5
|
-
})(this, (function (exports, vuePropertyDecorator, vuetify, zdAvatarCommon) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@zeedhi/core'), require('vue-property-decorator'), require('@zeedhi/vuetify'), require('@zeedhi/zd-avatar-common')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@zeedhi/core', 'vue-property-decorator', '@zeedhi/vuetify', '@zeedhi/zd-avatar-common'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@zeedhi/zd-avatar-vue"] = {}, global.core, global["vue-property-decorator"], global["@zeedhi/vuetify"], global["@zeedhi/zd-avatar-common"]));
|
|
5
|
+
})(this, (function (exports, core, vuePropertyDecorator, vuetify, zdAvatarCommon) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/*! *****************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -303,6 +303,9 @@
|
|
|
303
303
|
undefined
|
|
304
304
|
);
|
|
305
305
|
|
|
306
|
+
const packageContent = require('../package.json');
|
|
307
|
+
core.VersionService.addPackageVersion(packageContent.name, packageContent.version);
|
|
308
|
+
|
|
306
309
|
exports.ZdAvatar = __vue_component__;
|
|
307
310
|
exports.ZdAvatarClass = script;
|
|
308
311
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/zd-avatar-vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Implementation of Avatar component using Zeedhi library",
|
|
5
5
|
"main": "dist/avatar-vue.umd.js",
|
|
6
6
|
"module": "dist/avatar-vue.esm.js",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"vue-class-component": "^7.2.6",
|
|
22
22
|
"vue-property-decorator": "^9.1.2"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "26216bf751a5246487f85e91933a7ccedcab6dee"
|
|
25
25
|
}
|