@sankhyalabs/ezui 1.1.37 → 1.1.41

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.
Files changed (54) hide show
  1. package/dist/cjs/ez-button_16.cjs.entry.js +318 -207
  2. package/dist/cjs/ez-dialog.cjs.entry.js +4 -4
  3. package/dist/cjs/ez-popup.cjs.entry.js +3 -3
  4. package/dist/cjs/ez-toast.cjs.entry.js +37 -0
  5. package/dist/cjs/ezui.cjs.js +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/collection-manifest.json +2 -1
  8. package/dist/collection/components/ez-combo-box/ez-combo-box.js +18 -8
  9. package/dist/collection/components/ez-dialog/ez-dialog.js +16 -12
  10. package/dist/collection/components/ez-form/assets/trash-can-outline.svg +3 -0
  11. package/dist/collection/components/ez-form/ez-form.js +9 -0
  12. package/dist/collection/components/ez-form/subcomponents/DataUnit.js +2 -1
  13. package/dist/collection/components/ez-form/subcomponents/form-metadata.js +1 -5
  14. package/dist/collection/components/ez-form/subcomponents/structure/Field.js +2 -3
  15. package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +6 -3
  16. package/dist/collection/components/ez-popup/ez-popup.js +5 -5
  17. package/dist/collection/components/ez-search/ez-search.js +9 -7
  18. package/dist/collection/components/ez-toast/ez-toast.css +108 -0
  19. package/dist/collection/components/ez-toast/ez-toast.js +113 -0
  20. package/dist/collection/components/ez-upload/RemoteFile.js +89 -0
  21. package/dist/collection/components/ez-upload/ez-upload.css +16 -1
  22. package/dist/collection/components/ez-upload/ez-upload.js +246 -296
  23. package/dist/collection/utils/Application.js +34 -0
  24. package/dist/custom-elements/index.d.ts +6 -0
  25. package/dist/custom-elements/index.js +364 -219
  26. package/dist/esm/ez-button_16.entry.js +318 -207
  27. package/dist/esm/ez-dialog.entry.js +4 -4
  28. package/dist/esm/ez-popup.entry.js +3 -3
  29. package/dist/esm/ez-toast.entry.js +33 -0
  30. package/dist/esm/ezui.js +1 -1
  31. package/dist/esm/loader.js +1 -1
  32. package/dist/ezui/assets/trash-can-outline.svg +3 -0
  33. package/dist/ezui/ezui.esm.js +1 -1
  34. package/dist/ezui/p-1ff02df6.entry.js +1 -0
  35. package/dist/ezui/p-4a87d740.entry.js +1 -0
  36. package/dist/ezui/p-c3b18332.entry.js +1 -0
  37. package/dist/ezui/p-e9784201.entry.js +1 -0
  38. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +2 -1
  39. package/dist/types/components/ez-dialog/ez-dialog.d.ts +3 -3
  40. package/dist/types/components/ez-form/ez-form.d.ts +2 -0
  41. package/dist/types/components/ez-popup/ez-popup.d.ts +1 -1
  42. package/dist/types/components/ez-search/ez-search.d.ts +1 -1
  43. package/dist/types/components/ez-toast/ez-toast.d.ts +17 -0
  44. package/dist/types/components/ez-upload/RemoteFile.d.ts +14 -0
  45. package/dist/types/components/ez-upload/ez-upload.d.ts +49 -58
  46. package/dist/types/components.d.ts +95 -61
  47. package/dist/types/utils/Application.d.ts +6 -0
  48. package/package.json +1 -1
  49. package/react/components.d.ts +1 -0
  50. package/react/components.js +1 -0
  51. package/react/components.js.map +1 -1
  52. package/dist/ezui/p-40fe4f51.entry.js +0 -1
  53. package/dist/ezui/p-964a1871.entry.js +0 -1
  54. package/dist/ezui/p-caa50ec5.entry.js +0 -1
@@ -0,0 +1,113 @@
1
+ import { Component, h, Prop, Method } from '@stencil/core';
2
+ export class EzToast {
3
+ constructor() {
4
+ /**
5
+ * Controla o tempo de exibição do componente em milissegundos.
6
+ */
7
+ this.fadeTime = 5000;
8
+ /**
9
+ * Adiciona ícone de check no componente.
10
+ */
11
+ this.useIcon = false;
12
+ }
13
+ async show() {
14
+ this.container.classList.add("toast__container--oppened");
15
+ this.container.style.animation = `fadein 0.5s, fadeout 0.5s ${this.fadeTime / 1000}s`;
16
+ setTimeout(() => {
17
+ this.container.classList.remove("toast__container--oppened");
18
+ this.container.style.animation = `none`;
19
+ }, this.fadeTime + 400);
20
+ }
21
+ render() {
22
+ return (h("div", { ref: (el) => this.container = el, class: "toast__container" },
23
+ this.useIcon ?
24
+ h("slot", { name: "icon" })
25
+ : undefined,
26
+ h("div", { class: this.useIcon ? "message__container message__conteiner--icon" : "message__container", title: this.message },
27
+ " ",
28
+ this.message,
29
+ " "),
30
+ h("button", { class: "btn-close", onClick: () => { this.container.classList.remove("toast__container--oppened"); this.container.style.animation = `none`; } })));
31
+ }
32
+ static get is() { return "ez-toast"; }
33
+ static get encapsulation() { return "shadow"; }
34
+ static get originalStyleUrls() { return {
35
+ "$": ["ez-toast.css"]
36
+ }; }
37
+ static get styleUrls() { return {
38
+ "$": ["ez-toast.css"]
39
+ }; }
40
+ static get properties() { return {
41
+ "message": {
42
+ "type": "string",
43
+ "mutable": true,
44
+ "complexType": {
45
+ "original": "string",
46
+ "resolved": "string",
47
+ "references": {}
48
+ },
49
+ "required": false,
50
+ "optional": false,
51
+ "docs": {
52
+ "tags": [],
53
+ "text": "Mensagem exibida no componente."
54
+ },
55
+ "attribute": "message",
56
+ "reflect": false
57
+ },
58
+ "fadeTime": {
59
+ "type": "number",
60
+ "mutable": true,
61
+ "complexType": {
62
+ "original": "number",
63
+ "resolved": "number",
64
+ "references": {}
65
+ },
66
+ "required": false,
67
+ "optional": false,
68
+ "docs": {
69
+ "tags": [],
70
+ "text": "Controla o tempo de exibi\u00E7\u00E3o do componente em milissegundos."
71
+ },
72
+ "attribute": "fade-time",
73
+ "reflect": false,
74
+ "defaultValue": "5000"
75
+ },
76
+ "useIcon": {
77
+ "type": "boolean",
78
+ "mutable": true,
79
+ "complexType": {
80
+ "original": "boolean",
81
+ "resolved": "boolean",
82
+ "references": {}
83
+ },
84
+ "required": false,
85
+ "optional": false,
86
+ "docs": {
87
+ "tags": [],
88
+ "text": "Adiciona \u00EDcone de check no componente."
89
+ },
90
+ "attribute": "use-icon",
91
+ "reflect": false,
92
+ "defaultValue": "false"
93
+ }
94
+ }; }
95
+ static get methods() { return {
96
+ "show": {
97
+ "complexType": {
98
+ "signature": "() => Promise<void>",
99
+ "parameters": [],
100
+ "references": {
101
+ "Promise": {
102
+ "location": "global"
103
+ }
104
+ },
105
+ "return": "Promise<void>"
106
+ },
107
+ "docs": {
108
+ "text": "",
109
+ "tags": []
110
+ }
111
+ }
112
+ }; }
113
+ }
@@ -0,0 +1,89 @@
1
+ export default class RemoteFile {
2
+ constructor(file) {
3
+ this.file = file;
4
+ this.size = file.size;
5
+ this.name = file.name;
6
+ }
7
+ abortUpload() {
8
+ if (this._uploadingXhr) {
9
+ this._aborted = true;
10
+ this._uploadingXhr.abort();
11
+ this._uploadingXhr = undefined;
12
+ }
13
+ }
14
+ isUploading() {
15
+ return this._uploadingXhr !== undefined;
16
+ }
17
+ async upload(server, headers, updateCallBack) {
18
+ return new Promise((resolve, reject) => {
19
+ const xhr = new XMLHttpRequest();
20
+ this._uploadingXhr = xhr;
21
+ this._aborted = false;
22
+ this.progress = 0;
23
+ xhr.upload.onprogress = (e) => {
24
+ const loaded = e.loaded;
25
+ const total = e.total;
26
+ this.progress = ~~((loaded / total) * 100);
27
+ updateCallBack(this, loaded, total);
28
+ };
29
+ xhr.onreadystatechange = () => {
30
+ if (xhr.readyState == 4) {
31
+ this._uploadingXhr = undefined;
32
+ const status = xhr.status;
33
+ if (!this._aborted) {
34
+ if (status === 0) {
35
+ reject("Servidor indisponível");
36
+ }
37
+ else if (status >= 500) {
38
+ reject("Erro inesperado no servidor");
39
+ }
40
+ else if (status >= 400) {
41
+ reject("Operação não permitida");
42
+ }
43
+ }
44
+ const response = xhr.response;
45
+ if (response) {
46
+ resolve(JSON.parse(response));
47
+ }
48
+ }
49
+ };
50
+ xhr.ontimeout = () => {
51
+ reject("Tempo limite de transferência atingido.");
52
+ };
53
+ const formData = new FormData();
54
+ formData.append("ARQUIVO", this.file, this.file.name);
55
+ xhr.open("POST", server, true);
56
+ if (headers) {
57
+ headers.forEach((value, key) => xhr.setRequestHeader(key, value));
58
+ }
59
+ xhr.send(formData);
60
+ });
61
+ }
62
+ async delete(item, server, headers) {
63
+ return new Promise((resolve, reject) => {
64
+ const xhr = new XMLHttpRequest();
65
+ xhr.onreadystatechange = () => {
66
+ if (xhr.readyState == 4) {
67
+ if (xhr.status === 0) {
68
+ reject("Servidor indisponível");
69
+ }
70
+ else if (xhr.status >= 500) {
71
+ reject("Erro inesperado no servidor");
72
+ }
73
+ else if (xhr.status >= 400) {
74
+ reject("Operação não permitida");
75
+ }
76
+ resolve(true);
77
+ }
78
+ };
79
+ xhr.ontimeout = () => {
80
+ reject("Tempo limite de remoção atingido.");
81
+ };
82
+ xhr.open("DELETE", server, true);
83
+ if (headers) {
84
+ headers.forEach((value, key) => xhr.setRequestHeader(key, value));
85
+ }
86
+ xhr.send(JSON.stringify(item));
87
+ });
88
+ }
89
+ }
@@ -53,7 +53,6 @@
53
53
 
54
54
  .iu__container {
55
55
  width: 100%;
56
- height: 100%;
57
56
  display: flex;
58
57
  flex-wrap: wrap;
59
58
  justify-content: center;
@@ -200,6 +199,22 @@ progress[value]::-webkit-progress-value {
200
199
  clip-path: path("M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z");
201
200
  }
202
201
 
202
+ .iu__label{
203
+ padding: var(--space--small);
204
+ padding-top: 0;
205
+ box-sizing: border-box;
206
+ overflow: hidden;
207
+ text-overflow: ellipsis;
208
+ white-space: nowrap;
209
+
210
+ /*public*/
211
+ font-family: var(--iu--font-family);
212
+ font-size: var(--text--extra-small);
213
+ font-weight: var( --iu--font-weight);
214
+ color: var(--iu--text--primary);
215
+ text-shadow: var(--iu--text-shadow);
216
+ }
217
+
203
218
  .iu__file-icon {
204
219
  outline: none;
205
220
  border: none;