@sankhyalabs/ezui 1.1.74 → 1.1.75

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.
@@ -1,6 +1,6 @@
1
- import { Component, h, Prop, Element, Event, Method, Watch, forceUpdate } from '@stencil/core';
2
- import Application from '../../utils/Application';
3
- import RemoteFile from './RemoteFile';
1
+ import { Component, h, Prop, Element, Event, Method, Watch, forceUpdate } from "@stencil/core";
2
+ import Application from "../../utils/Application";
3
+ import RemoteFile from "./RemoteFile";
4
4
  export class EzUpload {
5
5
  constructor() {
6
6
  this._filePointers = new Map();
@@ -28,28 +28,31 @@ export class EzUpload {
28
28
  }
29
29
  normalizeRequestHeaders() {
30
30
  this._requestHeaders = new Map();
31
- if (typeof this.requestheaders == 'string') {
31
+ if (typeof this.requestHeaders == "string") {
32
32
  try {
33
- this.requestheaders = JSON.parse(this.requestheaders);
33
+ this.requestHeaders = JSON.parse(this.requestHeaders);
34
34
  }
35
35
  catch (e) {
36
- this.requestheaders = undefined;
36
+ this.requestHeaders = undefined;
37
37
  }
38
38
  }
39
- for (var key in this.requestheaders) {
40
- this._requestHeaders.set(key, this.requestheaders[key]);
39
+ for (var key in this.requestHeaders) {
40
+ this._requestHeaders.set(key, this.requestHeaders[key]);
41
41
  }
42
42
  }
43
+ /**
44
+ * Método responsável por adicionar um ou mais arquivos ao componente.
45
+ */
43
46
  async addFiles(files) {
44
- if (this.maxfiles > 0) {
47
+ if (this.maxFiles > 0) {
45
48
  let countDistinctFiles = this._filePointers.size;
46
49
  files.forEach(file => {
47
50
  if (!this._filePointers.has(file.name)) {
48
51
  countDistinctFiles++;
49
52
  }
50
53
  });
51
- if (countDistinctFiles > this.maxfiles) {
52
- this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
54
+ if (countDistinctFiles > this.maxFiles) {
55
+ this.showError(`A quantidade máxima de arquivos é ${this.maxFiles}.`);
53
56
  return;
54
57
  }
55
58
  }
@@ -76,7 +79,7 @@ export class EzUpload {
76
79
  if (this.validateFile(file)) {
77
80
  const uploadingFile = new RemoteFile(file);
78
81
  this._filePointers.set(file.name, uploadingFile);
79
- uploadingFile.upload(this.urlupload, this._requestHeaders, (file) => this.updateFeedback(file))
82
+ uploadingFile.upload(this.urlUpload, this._requestHeaders, (file) => this.updateFeedback(file))
80
83
  .then((files) => files.forEach(ezFile => this.finishUpload(ezFile)))
81
84
  .catch(msg => this.showError(msg));
82
85
  forceUpdate(this);
@@ -97,13 +100,13 @@ export class EzUpload {
97
100
  this.ezChange.emit(this.value);
98
101
  }
99
102
  buildProgressId(uploading) {
100
- let sanitizedName = uploading.name.replace(/[^a-z0-9_]/gi, '_');
103
+ let sanitizedName = uploading.name.replace(/[^a-z0-9_]/gi, "_");
101
104
  return `PROGRESS_${sanitizedName}_${uploading.file.lastModified}`;
102
105
  }
103
106
  updateFeedback(uf) {
104
107
  window.requestAnimationFrame(() => {
105
108
  if (this._host) {
106
- const progress = this._host.shadowRoot.querySelector('#' + this.buildProgressId(uf));
109
+ const progress = this._host.shadowRoot.querySelector("#" + this.buildProgressId(uf));
107
110
  if (progress) {
108
111
  progress.value = uf.progress;
109
112
  }
@@ -111,20 +114,20 @@ export class EzUpload {
111
114
  });
112
115
  }
113
116
  validateFile(file) {
114
- if (!this._filePointers.has(file.name) && this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
115
- this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
117
+ if (!this._filePointers.has(file.name) && this.maxFiles > 0 && this._filePointers.size >= this.maxFiles) {
118
+ this.showError(`A quantidade máxima de arquivos é ${this.maxFiles}.`);
116
119
  return false;
117
120
  }
118
121
  if (file.size === 0) {
119
122
  this.showError(`Erro de permissão: O arquivo "${file.name}" não pode ser enviado.`);
120
123
  return false;
121
124
  }
122
- if (!this.urlupload) {
125
+ if (!this.urlUpload) {
123
126
  this.showError("Endereço de upload não informado");
124
127
  return false;
125
128
  }
126
- if (this.maxfilesize >= 0 && file.size > this.maxfilesize) {
127
- this.showError("O tamanho máximo dos arquivos é de " + this.formatBytes(this.maxfilesize));
129
+ if (this.maxFileSize >= 0 && file.size > this.maxFileSize) {
130
+ this.showError("O tamanho máximo dos arquivos é de " + this.formatBytes(this.maxFileSize));
128
131
  return false;
129
132
  }
130
133
  return true;
@@ -134,17 +137,17 @@ export class EzUpload {
134
137
  }
135
138
  formatBytes(bytes, decimals = 1) {
136
139
  if (bytes === 0)
137
- return '0 Bytes';
140
+ return "0 Bytes";
138
141
  const k = 1024;
139
142
  const dm = decimals < 0 ? 0 : decimals;
140
- const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
143
+ const sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
141
144
  const i = Math.floor(Math.log(bytes) / Math.log(k));
142
- return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
145
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
143
146
  }
144
147
  onFileInputChange(event) {
145
148
  const input = event.target;
146
149
  this.addFiles(Array.from(input.files));
147
- this._fileInput.value = '';
150
+ this._fileInput.value = "";
148
151
  }
149
152
  isRemoteFile(item) {
150
153
  return "file" in item;
@@ -160,10 +163,10 @@ export class EzUpload {
160
163
  this.removeFromList(name);
161
164
  }
162
165
  else {
163
- if (this.urldelete) {
166
+ if (this.urlDelete) {
164
167
  const uploadingFile = new RemoteFile(null);
165
168
  this._filePointers.set(item.name, uploadingFile);
166
- uploadingFile.delete(item, this.urldelete, null)
169
+ uploadingFile.delete(item, this.urlDelete, null)
167
170
  .then(_ok => this.removeFromList(name))
168
171
  .catch(msg => this.showError(msg));
169
172
  }
@@ -179,20 +182,20 @@ export class EzUpload {
179
182
  }
180
183
  componentDidLoad() {
181
184
  if (this.enabled && this._dropZone && window.FileList && window.File) {
182
- this._dropZone.addEventListener('dragover', event => {
185
+ this._dropZone.addEventListener("dragover", event => {
183
186
  event.stopPropagation();
184
187
  event.preventDefault();
185
- event.dataTransfer.dropEffect = 'copy';
186
- this._dropZone.style.background = '#c2dbff';
188
+ event.dataTransfer.dropEffect = "copy";
189
+ this._dropZone.style.background = "#c2dbff";
187
190
  });
188
- this._dropZone.addEventListener('drop', event => {
191
+ this._dropZone.addEventListener("drop", event => {
189
192
  event.stopPropagation();
190
193
  event.preventDefault();
191
194
  this.addFiles(Array.from(event.dataTransfer.files));
192
- this._dropZone.style.background = '';
195
+ this._dropZone.style.background = "";
193
196
  });
194
- this._dropZone.addEventListener('dragleave', _event => {
195
- this._dropZone.style.background = '';
197
+ this._dropZone.addEventListener("dragleave", _event => {
198
+ this._dropZone.style.background = "";
196
199
  });
197
200
  }
198
201
  }
@@ -204,13 +207,13 @@ export class EzUpload {
204
207
  }
205
208
  }
206
209
  render() {
207
- return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass('iu', 'background--disabled') },
210
+ return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass("iu", "background--disabled") },
208
211
  h("div", { class: "iu__container", onClick: () => this.openFilesDialog() },
209
212
  h("div", { class: "iu_header" },
210
- this.label ? h("label", { class: this.evalDisabledClass('iu__label', 'text--disabled'), title: this.label }, this.label) : null,
211
- h("div", { class: this.evalDisabledClass('iu__icon-label', 'mouse-pointer--disabled') },
213
+ this.label ? h("label", { class: this.evalDisabledClass("iu__label", "text--disabled"), title: this.label }, this.label) : null,
214
+ h("div", { class: this.evalDisabledClass("iu__icon-label", "mouse-pointer--disabled") },
212
215
  h("button", { class: "iu__file-icon", disabled: !this.enabled }),
213
- h("div", { class: this.evalDisabledClass('text text--center text--medium text--primary', 'text--disabled') }, this.enabled ? 'Arraste e solte ou clique para adicionar arquivos' : 'Somente leitura'))),
216
+ h("div", { class: this.evalDisabledClass("text text--center text--medium text--primary", "text--disabled") }, this.enabled ? "Arraste e solte ou clique para adicionar arquivos" : "Somente leitura"))),
214
217
  this.buildFooter()),
215
218
  h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
216
219
  }
@@ -224,8 +227,8 @@ export class EzUpload {
224
227
  }
225
228
  buildFileItem(item) {
226
229
  const fileName = item.name;
227
- const progress = Number(item['progress']);
228
- const downloadURL = item['downloadURL'];
230
+ const progress = Number(item["progress"]);
231
+ const downloadURL = item["downloadURL"];
229
232
  const label = `${fileName} (${this.formatBytes(item.size)})`;
230
233
  return (h("div", { class: "iu__item", key: fileName, onClick: evt => evt.stopPropagation() },
231
234
  h("div", { class: "iu__item-label modificador" },
@@ -290,7 +293,7 @@ export class EzUpload {
290
293
  "reflect": false,
291
294
  "defaultValue": "true"
292
295
  },
293
- "maxfilesize": {
296
+ "maxFileSize": {
294
297
  "type": "number",
295
298
  "mutable": false,
296
299
  "complexType": {
@@ -304,10 +307,10 @@ export class EzUpload {
304
307
  "tags": [],
305
308
  "text": "Define o tamanho m\u00E1ximo (em bytes) de cada arquivo que pode ser transferido"
306
309
  },
307
- "attribute": "maxfilesize",
310
+ "attribute": "max-file-size",
308
311
  "reflect": false
309
312
  },
310
- "maxfiles": {
313
+ "maxFiles": {
311
314
  "type": "number",
312
315
  "mutable": false,
313
316
  "complexType": {
@@ -321,10 +324,10 @@ export class EzUpload {
321
324
  "tags": [],
322
325
  "text": "Define um limite para a quantidade de arquivos"
323
326
  },
324
- "attribute": "maxfiles",
327
+ "attribute": "max-files",
325
328
  "reflect": false
326
329
  },
327
- "requestheaders": {
330
+ "requestHeaders": {
328
331
  "type": "any",
329
332
  "mutable": false,
330
333
  "complexType": {
@@ -338,10 +341,10 @@ export class EzUpload {
338
341
  "tags": [],
339
342
  "text": "Headers para a requisi\u00E7\u00E3o Http"
340
343
  },
341
- "attribute": "requestheaders",
344
+ "attribute": "request-headers",
342
345
  "reflect": false
343
346
  },
344
- "urlupload": {
347
+ "urlUpload": {
345
348
  "type": "string",
346
349
  "mutable": false,
347
350
  "complexType": {
@@ -355,10 +358,10 @@ export class EzUpload {
355
358
  "tags": [],
356
359
  "text": "Define a URL de upload"
357
360
  },
358
- "attribute": "urlupload",
361
+ "attribute": "url-upload",
359
362
  "reflect": false
360
363
  },
361
- "urldelete": {
364
+ "urlDelete": {
362
365
  "type": "string",
363
366
  "mutable": false,
364
367
  "complexType": {
@@ -372,7 +375,7 @@ export class EzUpload {
372
375
  "tags": [],
373
376
  "text": "Define a URL de dele\u00E7\u00E3o"
374
377
  },
375
- "attribute": "urldelete",
378
+ "attribute": "url-delete",
376
379
  "reflect": false
377
380
  },
378
381
  "value": {
@@ -443,7 +446,7 @@ export class EzUpload {
443
446
  "return": "Promise<void>"
444
447
  },
445
448
  "docs": {
446
- "text": "",
449
+ "text": "M\u00E9todo respons\u00E1vel por adicionar um ou mais arquivos ao componente.",
447
450
  "tags": []
448
451
  }
449
452
  }
@@ -453,7 +456,7 @@ export class EzUpload {
453
456
  "propName": "value",
454
457
  "methodName": "changeValue"
455
458
  }, {
456
- "propName": "requestheaders",
459
+ "propName": "requestHeaders",
457
460
  "methodName": "normalizeRequestHeaders"
458
461
  }]; }
459
462
  }
@@ -764,7 +764,7 @@ var Method;
764
764
  Method[Method["DELETE"] = 3] = "DELETE";
765
765
  })(Method || (Method = {}));
766
766
 
767
- const ezCalendarCss = ":host{--cal--font-family:var(--font-pattern, Arial);--cal--color:var(--title--primary, #626e82);--cal--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--cal__body--background-color:var(--background--xlight, #FFF);--cal__body--padding:var(--space--medium, 12px);--cal__body--border-radius:var(--border--radius-medium, 12px);--cal__body--shadow:var(--shadow, 0px 0px 16px 0px #000);--cal__header-line--stroke:2px;--cal__header-line--color:var(--color--strokes, #C0C0C0);--cal__nav-btn--fill:var(--text--primary, #008561);--cal__nav-btn--hover--fill:var(--color--primary, #350404);--cal__nav-btn--width:10px;--cal__nav-btn--height:16px;--cal__nav-btn--previous-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--cal__nav-btn--next-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--cal__cell--margin:0px var(--space--small, 12px);--cal__cell--width:var(--space--large, 24px);--cal__cell--padding:var(--space--extra-small, 3px) 0px;--cal__cell--border-radius:var(--border--radius-small, 6px);--cal__cell--over--background-color:var(--color--strokes, #C0C0C0);--cal__cell--outset--color:var(--color--strokes, #C0C0C0);--cal__cell--selected--background-color:var(--color--primary, #008561);--cal__cell--selected--color:var(--color--inverted, #FFF);--cal__btn-today--color:var(--color--primary);--cal__btn-today--hover--background-color:var(--color--strokes, #C0C0C0);--cal__btn-today--border-radius:var(--border--radius-small, 6px);position:relative;display:flex;user-select:none}.calendar{z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--cal__body--background-color);padding:var(--cal__body--padding);border-radius:var(--cal__body--border-radius);box-shadow:var(--cal__body--shadow)}.calendar__header{display:flex;justify-content:space-between;padding-bottom:var(--space--medium, 12px);margin:var(--space--small, 6px) var(--space--, 12px);font-family:var(--cal--font-family);color:var(--cal--color);text-shadow:var(--cal--text-shadow);border-bottom:solid var(--cal__header-line--stroke) var(--cal__header-line--color)}.calendar__btn-next,.calendar__btn-previous{outline:none;border:none;background-color:unset;cursor:pointer;padding:0px}.calendar__btn-next::after,.calendar__btn-previous::after{content:'';display:flex;background-color:var(--cal__nav-btn--fill);width:var(--cal__nav-btn--width);height:var(--cal__nav-btn--height)}.calendar__btn-previous::after{-webkit-mask-image:var(--cal__nav-btn--previous-image);mask-image:var(--cal__nav-btn--previous-image)}.calendar__btn-next::after{-webkit-mask-image:var(--cal__nav-btn--next-image);mask-image:var(--cal__nav-btn--next-image)}.calendar__btn-next:hover::after,.calendar__btn-previous:hover::after{background-color:var(--cal__nav-btn--hover--fill)}.calendar__lbl-month{font-weight:var(--text-weight--large, 600);font-size:var(--title--medium, 16px);font-family:var(--cal--font-family);color:var(--cal--color);text-shadow:var(--cal--text-shadow)}.calendar__line{display:flex;padding:0px;margin:0px}.calendar__cell{display:flex;justify-content:center;align-content:center;cursor:pointer;font-size:var(--text--small, 12px);font-family:var(--cal--font-family);color:var(--cal--color);text-shadow:var(--cal--text-shadow);padding:var(--cal__cell--padding);margin:var(--cal__cell--margin);min-width:var(--cal__cell--width);border-radius:var(--cal__cell--border-radius)}.calendar__cell:hover{background-color:var(--cal__cell--over--background-color)}.calendar__cell--secondary{color:var(--cal__cell--outset--color)}.calendar__cell--unselectable:hover{background-color:unset;border-radius:unset;cursor:unset}.calendar__cell--unselectable{font-weight:var(--text-weight--large, 600);font-family:var(--cal--font-family);color:var(--cal--color);text-shadow:var(--cal--text-shadow)}.calendar__cell--selected,.calendar__cell--selected:hover{background-color:var(--cal__cell--selected--background-color);color:var(--cal__cell--selected--color)}.calendar__body{padding:var(--space--small, 6px) 0px}.calendar__footer{display:flex;flex-direction:column}.calendar__btn-today{border:none;background-color:unset;cursor:pointer;font-weight:var(--text-weight--large, 600);font-size:var(--title--small);padding:var(--space--extra-small, 6px);font-family:var(--cal--font-family);text-shadow:var(--cal--text-shadow);color:var(--cal__btn-today--color);border-radius:var(--cal__btn-today--border-radius)}.calendar__btn-today:hover{background-color:var(--cal__btn-today--hover--background-color)}";
767
+ const ezCalendarCss = ":host{--ez-calendar--font-family:var(--font-pattern, Arial);--ez-calendar--color:var(--title--primary, #626e82);--ez-calendar--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-calendar__body--background-color:var(--background--xlight, #FFF);--ez-calendar__body--padding:var(--space--medium, 12px);--ez-calendar__body--border-radius:var(--border--radius-medium, 12px);--ez-calendar__body--shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-calendar__header-line--stroke:2px;--ez-calendar__header-line--color:var(--color--strokes, #C0C0C0);--ez-calendar__nav-btn--fill:var(--text--primary, #008561);--ez-calendar__nav-btn--hover--fill:var(--color--primary, #350404);--ez-calendar__nav-btn--width:10px;--ez-calendar__nav-btn--height:16px;--ez-calendar__nav-btn--previous-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--ez-calendar__nav-btn--next-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--ez-calendar__cell--margin:0px var(--space--small, 12px);--ez-calendar__cell--width:var(--space--large, 24px);--ez-calendar__cell--padding:var(--space--extra-small, 3px) 0px;--ez-calendar__cell--border-radius:var(--border--radius-small, 6px);--ez-calendar__cell--over--background-color:var(--color--strokes, #C0C0C0);--ez-calendar__cell--outset--color:var(--color--strokes, #C0C0C0);--ez-calendar__cell--selected--background-color:var(--color--primary, #008561);--ez-calendar__cell--selected--color:var(--color--inverted, #FFF);--ez-calendar__btn-today--color:var(--color--primary);--ez-calendar__btn-today--hover--background-color:var(--color--strokes, #C0C0C0);--ez-calendar__btn-today--border-radius:var(--border--radius-small, 6px);position:relative;display:flex;user-select:none}.calendar{z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--ez-calendar__body--background-color);padding:var(--ez-calendar__body--padding);border-radius:var(--ez-calendar__body--border-radius);box-shadow:var(--ez-calendar__body--shadow)}.calendar__header{display:flex;justify-content:space-between;padding-bottom:var(--space--medium, 12px);margin:var(--space--small, 6px) var(--space--, 12px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);border-bottom:solid var(--ez-calendar__header-line--stroke) var(--ez-calendar__header-line--color)}.calendar__btn-next,.calendar__btn-previous{outline:none;border:none;background-color:unset;cursor:pointer;padding:0px}.calendar__btn-next::after,.calendar__btn-previous::after{content:'';display:flex;background-color:var(--ez-calendar__nav-btn--fill);width:var(--ez-calendar__nav-btn--width);height:var(--ez-calendar__nav-btn--height)}.calendar__btn-previous::after{-webkit-mask-image:var(--ez-calendar__nav-btn--previous-image);mask-image:var(--ez-calendar__nav-btn--previous-image)}.calendar__btn-next::after{-webkit-mask-image:var(--ez-calendar__nav-btn--next-image);mask-image:var(--ez-calendar__nav-btn--next-image)}.calendar__btn-next:hover::after,.calendar__btn-previous:hover::after{background-color:var(--ez-calendar__nav-btn--hover--fill)}.calendar__lbl-month{font-weight:var(--text-weight--large, 600);font-size:var(--title--medium, 16px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__line{display:flex;padding:0px;margin:0px}.calendar__cell{display:flex;justify-content:center;align-content:center;cursor:pointer;font-size:var(--text--small, 12px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);padding:var(--ez-calendar__cell--padding);margin:var(--ez-calendar__cell--margin);min-width:var(--ez-calendar__cell--width);border-radius:var(--ez-calendar__cell--border-radius)}.calendar__cell:hover{background-color:var(--ez-calendar__cell--over--background-color)}.calendar__cell--secondary{color:var(--ez-calendar__cell--outset--color)}.calendar__cell--unselectable:hover{background-color:unset;border-radius:unset;cursor:unset}.calendar__cell--unselectable{font-weight:var(--text-weight--large, 600);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__cell--selected,.calendar__cell--selected:hover{background-color:var(--ez-calendar__cell--selected--background-color);color:var(--ez-calendar__cell--selected--color)}.calendar__body{padding:var(--space--small, 6px) 0px}.calendar__footer{display:flex;flex-direction:column}.calendar__btn-today{border:none;background-color:unset;cursor:pointer;font-weight:var(--text-weight--large, 600);font-size:var(--title--small);padding:var(--space--extra-small, 6px);font-family:var(--ez-calendar--font-family);text-shadow:var(--ez-calendar--text-shadow);color:var(--ez-calendar__btn-today--color);border-radius:var(--ez-calendar__btn-today--border-radius)}.calendar__btn-today:hover{background-color:var(--ez-calendar__btn-today--hover--background-color)}";
768
768
 
769
769
  let EzCalendar$1 = class extends HTMLElement {
770
770
  constructor() {
@@ -773,9 +773,9 @@ let EzCalendar$1 = class extends HTMLElement {
773
773
  this.__attachShadow();
774
774
  this.ezChange = createEvent(this, "ezChange", 7);
775
775
  this._firstRender = true;
776
- this._todayLabel = 'Hoje';
777
- this._weekDayLabels = ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'];
778
- this._monthLabels = ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'];
776
+ this._todayLabel = "Hoje";
777
+ this._weekDayLabels = ["D", "S", "T", "Q", "Q", "S", "S"];
778
+ this._monthLabels = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
779
779
  /**
780
780
  * A data selecionada no calendário
781
781
  */
@@ -796,18 +796,21 @@ let EzCalendar$1 = class extends HTMLElement {
796
796
  if (this.floating) {
797
797
  this._floatingID = FloatingManager.float(this._box, this._container, { autoClose: true, top, left, bottom, right });
798
798
  window.requestAnimationFrame(() => {
799
- this._box.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' });
799
+ this._box.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
800
800
  });
801
801
  }
802
802
  }
803
+ /**
804
+ * Método necessário para ajustar o posicionamento do calendar acima ou abaixo do ez-date-input conforme a disponibilidade de espaço.
805
+ */
803
806
  async fitVertical(topOffset, bottomOffset) {
804
807
  const neededHeight = this._container.getBoundingClientRect().bottom + this._calendarHeight;
805
808
  const availableBottom = (window.innerHeight || document.documentElement.clientHeight) > neededHeight;
806
809
  if (availableBottom) {
807
- this.show(topOffset + 'px', undefined, 'unset');
810
+ this.show(topOffset + "px", undefined, "unset");
808
811
  }
809
812
  else {
810
- this.show('unset', undefined, bottomOffset + 'px');
813
+ this.show("unset", undefined, bottomOffset + "px");
811
814
  }
812
815
  }
813
816
  /**
@@ -3409,7 +3412,7 @@ const Field = ({ dataUnit, field, forceScroll, enabled }) => {
3409
3412
  const headers = strHeaders ? JSON.parse(strHeaders) : {};
3410
3413
  const maxfiles = Number(getProp(properties, "maxfiles") || 0);
3411
3414
  return (h("div", { class: "col col--sd-12 padding--small" }, loadingData ? h("place-holder", null) :
3412
- h("ez-upload", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.detail), urlupload: target, requestheaders: headers, maxfiles: maxfiles })));
3415
+ h("ez-upload", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.detail), urlUpload: target, requestHeaders: headers, maxFiles: maxfiles })));
3413
3416
  case 'DATE':
3414
3417
  return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? h("place-holder", null) :
3415
3418
  h("ez-date-input", { value: !value ? null : DateUtils.clearTime(value), label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target['value']), errorMessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key }));
@@ -5199,7 +5202,7 @@ let EzTimeInput$1 = class extends HTMLElement {
5199
5202
  }
5200
5203
  }
5201
5204
  render() {
5202
- return (h(Host, null, h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage }, h("ez-icon", { slot: "leftIcon", href: getAssetPath("./assets/actions-sprite.svg") + "#timer-outline" }))));
5205
+ return (h(Host, null, h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage }, h("ez-icon", { slot: "leftIcon", href: getAssetPath("../assets/actions-sprite.svg") + "#timer-outline" }))));
5203
5206
  }
5204
5207
  static get assetsDirs() { return ["../assets"]; }
5205
5208
  get _elem() { return this; }
@@ -5335,7 +5338,7 @@ class RemoteFile {
5335
5338
  }
5336
5339
  }
5337
5340
 
5338
- const ezUploadCss = ":host{--iu--height:42px;--iu--width:100%;--iu__icon--width:48px;--iu__container--background-color:var(--background--medium, #d2dce9);--iu__color--primary:var(--color--primary, #008561);--iu--padding--extra-small:var(--space--extra-small, 3px);--iu--padding--small:var(--space--small, 6px);--iu--padding--medium:var(--space--medium, 12px);--iu--padding--large:var(--space--large, 24px);--iu__border--color:var(--color-strokes, #DCE0E8);--iu--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--iu--text--primary:var(--text-primary, #626e82);--iu--font-size:var(--text--medium, 14px);--iu--font-family:var(--font-pattern, Arial);--iu--font-weight:var(--text-weight--large, 500);--iu__btn__cancel-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"8x\" width=\"8px\"><path d=\"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\"/></svg>');--iu__file-icon-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"11x\" width=\"9px\"><path d=\"M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z\"/></svg>');display:flex;flex-wrap:wrap;position:relative;font-family:var(--iu--font-family);font-size:var(--iu--font-size);width:var(--iu--width);font-weight:var(--iu--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--iu__container--background-color);padding:var(--iu--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--iu__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--iu--padding--medium) var(--iu--padding--medium) var(--iu--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--iu--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--iu__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--iu__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--iu__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--iu__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.text{font-family:\"Sora\", \"Algerian\";text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--iu--text--primary);text-shadow:var(--iu--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--iu__btn__cancel-image);mask-image:var(--iu__btn__cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--iu--font-family);font-size:var(--text--extra-small);font-weight:var(--iu--font-weight);color:var(--iu--text--primary);text-shadow:var(--iu--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon:disabled{cursor:unset}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--iu__file-icon-image);mask-image:var(--iu__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;padding:var(--iu--padding--large) 0px;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:unset}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
5341
+ const ezUploadCss = ":host{--ez-upload--height:42px;--ez-upload--width:100%;--ez-upload__icon--width:48px;--ez-upload__container--background-color:var(--background--medium, #d2dce9);--ez-upload__color--primary:var(--color--primary, #008561);--ez-upload--padding--extra-small:var(--space--extra-small, 3px);--ez-upload--padding--small:var(--space--small, 6px);--ez-upload--padding--medium:var(--space--medium, 12px);--ez-upload--padding--large:var(--space--large, 24px);--ez-upload__border--color:var(--color-strokes, #DCE0E8);--ez-upload--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-upload--text--primary:var(--text-primary, #626e82);--ez-upload--font-size:var(--text--medium, 14px);--ez-upload--font-family:var(--font-pattern, Arial);--ez-upload--font-weight:var(--text-weight--large, 500);--ez-upload__btn__cancel-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"8x\" width=\"8px\"><path d=\"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\"/></svg>');--ez-upload__file-icon-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"11x\" width=\"9px\"><path d=\"M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z\"/></svg>');display:flex;flex-wrap:wrap;position:relative;font-family:var(--ez-upload--font-family);font-size:var(--ez-upload--font-size);width:var(--ez-upload--width);font-weight:var(--ez-upload--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:var(--ez-upload--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--ez-upload--padding--medium) var(--ez-upload--padding--medium) var(--ez-upload--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--ez-upload--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--ez-upload__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--ez-upload__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.text{font-family:\"Sora\", \"Algerian\";text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--ez-upload__btn__cancel-image);mask-image:var(--ez-upload__btn__cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-upload--font-family);font-size:var(--text--extra-small);font-weight:var(--ez-upload--font-weight);color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon:disabled{cursor:unset}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--ez-upload__file-icon-image);mask-image:var(--ez-upload__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;padding:var(--ez-upload--padding--large) 0px;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:unset}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
5339
5342
 
5340
5343
  let EzUpload$1 = class extends HTMLElement {
5341
5344
  constructor() {
@@ -5368,28 +5371,31 @@ let EzUpload$1 = class extends HTMLElement {
5368
5371
  }
5369
5372
  normalizeRequestHeaders() {
5370
5373
  this._requestHeaders = new Map();
5371
- if (typeof this.requestheaders == 'string') {
5374
+ if (typeof this.requestHeaders == "string") {
5372
5375
  try {
5373
- this.requestheaders = JSON.parse(this.requestheaders);
5376
+ this.requestHeaders = JSON.parse(this.requestHeaders);
5374
5377
  }
5375
5378
  catch (e) {
5376
- this.requestheaders = undefined;
5379
+ this.requestHeaders = undefined;
5377
5380
  }
5378
5381
  }
5379
- for (var key in this.requestheaders) {
5380
- this._requestHeaders.set(key, this.requestheaders[key]);
5382
+ for (var key in this.requestHeaders) {
5383
+ this._requestHeaders.set(key, this.requestHeaders[key]);
5381
5384
  }
5382
5385
  }
5386
+ /**
5387
+ * Método responsável por adicionar um ou mais arquivos ao componente.
5388
+ */
5383
5389
  async addFiles(files) {
5384
- if (this.maxfiles > 0) {
5390
+ if (this.maxFiles > 0) {
5385
5391
  let countDistinctFiles = this._filePointers.size;
5386
5392
  files.forEach(file => {
5387
5393
  if (!this._filePointers.has(file.name)) {
5388
5394
  countDistinctFiles++;
5389
5395
  }
5390
5396
  });
5391
- if (countDistinctFiles > this.maxfiles) {
5392
- this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
5397
+ if (countDistinctFiles > this.maxFiles) {
5398
+ this.showError(`A quantidade máxima de arquivos é ${this.maxFiles}.`);
5393
5399
  return;
5394
5400
  }
5395
5401
  }
@@ -5416,7 +5422,7 @@ let EzUpload$1 = class extends HTMLElement {
5416
5422
  if (this.validateFile(file)) {
5417
5423
  const uploadingFile = new RemoteFile(file);
5418
5424
  this._filePointers.set(file.name, uploadingFile);
5419
- uploadingFile.upload(this.urlupload, this._requestHeaders, (file) => this.updateFeedback(file))
5425
+ uploadingFile.upload(this.urlUpload, this._requestHeaders, (file) => this.updateFeedback(file))
5420
5426
  .then((files) => files.forEach(ezFile => this.finishUpload(ezFile)))
5421
5427
  .catch(msg => this.showError(msg));
5422
5428
  forceUpdate(this);
@@ -5437,13 +5443,13 @@ let EzUpload$1 = class extends HTMLElement {
5437
5443
  this.ezChange.emit(this.value);
5438
5444
  }
5439
5445
  buildProgressId(uploading) {
5440
- let sanitizedName = uploading.name.replace(/[^a-z0-9_]/gi, '_');
5446
+ let sanitizedName = uploading.name.replace(/[^a-z0-9_]/gi, "_");
5441
5447
  return `PROGRESS_${sanitizedName}_${uploading.file.lastModified}`;
5442
5448
  }
5443
5449
  updateFeedback(uf) {
5444
5450
  window.requestAnimationFrame(() => {
5445
5451
  if (this._host) {
5446
- const progress = this._host.shadowRoot.querySelector('#' + this.buildProgressId(uf));
5452
+ const progress = this._host.shadowRoot.querySelector("#" + this.buildProgressId(uf));
5447
5453
  if (progress) {
5448
5454
  progress.value = uf.progress;
5449
5455
  }
@@ -5451,20 +5457,20 @@ let EzUpload$1 = class extends HTMLElement {
5451
5457
  });
5452
5458
  }
5453
5459
  validateFile(file) {
5454
- if (!this._filePointers.has(file.name) && this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
5455
- this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
5460
+ if (!this._filePointers.has(file.name) && this.maxFiles > 0 && this._filePointers.size >= this.maxFiles) {
5461
+ this.showError(`A quantidade máxima de arquivos é ${this.maxFiles}.`);
5456
5462
  return false;
5457
5463
  }
5458
5464
  if (file.size === 0) {
5459
5465
  this.showError(`Erro de permissão: O arquivo "${file.name}" não pode ser enviado.`);
5460
5466
  return false;
5461
5467
  }
5462
- if (!this.urlupload) {
5468
+ if (!this.urlUpload) {
5463
5469
  this.showError("Endereço de upload não informado");
5464
5470
  return false;
5465
5471
  }
5466
- if (this.maxfilesize >= 0 && file.size > this.maxfilesize) {
5467
- this.showError("O tamanho máximo dos arquivos é de " + this.formatBytes(this.maxfilesize));
5472
+ if (this.maxFileSize >= 0 && file.size > this.maxFileSize) {
5473
+ this.showError("O tamanho máximo dos arquivos é de " + this.formatBytes(this.maxFileSize));
5468
5474
  return false;
5469
5475
  }
5470
5476
  return true;
@@ -5474,17 +5480,17 @@ let EzUpload$1 = class extends HTMLElement {
5474
5480
  }
5475
5481
  formatBytes(bytes, decimals = 1) {
5476
5482
  if (bytes === 0)
5477
- return '0 Bytes';
5483
+ return "0 Bytes";
5478
5484
  const k = 1024;
5479
5485
  const dm = decimals < 0 ? 0 : decimals;
5480
- const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
5486
+ const sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
5481
5487
  const i = Math.floor(Math.log(bytes) / Math.log(k));
5482
- return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
5488
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
5483
5489
  }
5484
5490
  onFileInputChange(event) {
5485
5491
  const input = event.target;
5486
5492
  this.addFiles(Array.from(input.files));
5487
- this._fileInput.value = '';
5493
+ this._fileInput.value = "";
5488
5494
  }
5489
5495
  isRemoteFile(item) {
5490
5496
  return "file" in item;
@@ -5500,10 +5506,10 @@ let EzUpload$1 = class extends HTMLElement {
5500
5506
  this.removeFromList(name);
5501
5507
  }
5502
5508
  else {
5503
- if (this.urldelete) {
5509
+ if (this.urlDelete) {
5504
5510
  const uploadingFile = new RemoteFile(null);
5505
5511
  this._filePointers.set(item.name, uploadingFile);
5506
- uploadingFile.delete(item, this.urldelete, null)
5512
+ uploadingFile.delete(item, this.urlDelete, null)
5507
5513
  .then(_ok => this.removeFromList(name))
5508
5514
  .catch(msg => this.showError(msg));
5509
5515
  }
@@ -5519,20 +5525,20 @@ let EzUpload$1 = class extends HTMLElement {
5519
5525
  }
5520
5526
  componentDidLoad() {
5521
5527
  if (this.enabled && this._dropZone && window.FileList && window.File) {
5522
- this._dropZone.addEventListener('dragover', event => {
5528
+ this._dropZone.addEventListener("dragover", event => {
5523
5529
  event.stopPropagation();
5524
5530
  event.preventDefault();
5525
- event.dataTransfer.dropEffect = 'copy';
5526
- this._dropZone.style.background = '#c2dbff';
5531
+ event.dataTransfer.dropEffect = "copy";
5532
+ this._dropZone.style.background = "#c2dbff";
5527
5533
  });
5528
- this._dropZone.addEventListener('drop', event => {
5534
+ this._dropZone.addEventListener("drop", event => {
5529
5535
  event.stopPropagation();
5530
5536
  event.preventDefault();
5531
5537
  this.addFiles(Array.from(event.dataTransfer.files));
5532
- this._dropZone.style.background = '';
5538
+ this._dropZone.style.background = "";
5533
5539
  });
5534
- this._dropZone.addEventListener('dragleave', _event => {
5535
- this._dropZone.style.background = '';
5540
+ this._dropZone.addEventListener("dragleave", _event => {
5541
+ this._dropZone.style.background = "";
5536
5542
  });
5537
5543
  }
5538
5544
  }
@@ -5544,7 +5550,7 @@ let EzUpload$1 = class extends HTMLElement {
5544
5550
  }
5545
5551
  }
5546
5552
  render() {
5547
- return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass('iu', 'background--disabled') }, h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, h("div", { class: "iu_header" }, this.label ? h("label", { class: this.evalDisabledClass('iu__label', 'text--disabled'), title: this.label }, this.label) : null, h("div", { class: this.evalDisabledClass('iu__icon-label', 'mouse-pointer--disabled') }, h("button", { class: "iu__file-icon", disabled: !this.enabled }), h("div", { class: this.evalDisabledClass('text text--center text--medium text--primary', 'text--disabled') }, this.enabled ? 'Arraste e solte ou clique para adicionar arquivos' : 'Somente leitura'))), this.buildFooter()), h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
5553
+ return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass("iu", "background--disabled") }, h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, h("div", { class: "iu_header" }, this.label ? h("label", { class: this.evalDisabledClass("iu__label", "text--disabled"), title: this.label }, this.label) : null, h("div", { class: this.evalDisabledClass("iu__icon-label", "mouse-pointer--disabled") }, h("button", { class: "iu__file-icon", disabled: !this.enabled }), h("div", { class: this.evalDisabledClass("text text--center text--medium text--primary", "text--disabled") }, this.enabled ? "Arraste e solte ou clique para adicionar arquivos" : "Somente leitura"))), this.buildFooter()), h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
5548
5554
  }
5549
5555
  buildFooter() {
5550
5556
  if (this._filePointers.size === 0) {
@@ -5556,8 +5562,8 @@ let EzUpload$1 = class extends HTMLElement {
5556
5562
  }
5557
5563
  buildFileItem(item) {
5558
5564
  const fileName = item.name;
5559
- const progress = Number(item['progress']);
5560
- const downloadURL = item['downloadURL'];
5565
+ const progress = Number(item["progress"]);
5566
+ const downloadURL = item["downloadURL"];
5561
5567
  const label = `${fileName} (${this.formatBytes(item.size)})`;
5562
5568
  return (h("div", { class: "iu__item", key: fileName, onClick: evt => evt.stopPropagation() }, h("div", { class: "iu__item-label modificador" }, h("div", { title: label, class: "col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle" }, downloadURL ? h("a", { href: downloadURL, download: true }, label) : label)), isNaN(progress)
5563
5569
  ?
@@ -5575,7 +5581,7 @@ let EzUpload$1 = class extends HTMLElement {
5575
5581
  get _host() { return this; }
5576
5582
  static get watchers() { return {
5577
5583
  "value": ["changeValue"],
5578
- "requestheaders": ["normalizeRequestHeaders"]
5584
+ "requestHeaders": ["normalizeRequestHeaders"]
5579
5585
  }; }
5580
5586
  static get style() { return ezUploadCss; }
5581
5587
  };
@@ -5739,7 +5745,7 @@ const EzTextArea = /*@__PURE__*/proxyCustomElement(EzTextArea$1, [1,"ez-text-are
5739
5745
  const EzTextInput = /*@__PURE__*/proxyCustomElement(EzTextInput$1, [1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"mask":[1],"restrict":[1]}]);
5740
5746
  const EzTimeInput = /*@__PURE__*/proxyCustomElement(EzTimeInput$1, [1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"]}]);
5741
5747
  const EzToast = /*@__PURE__*/proxyCustomElement(EzToast$1, [1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"]}]);
5742
- const EzUpload = /*@__PURE__*/proxyCustomElement(EzUpload$1, [1,"ez-upload",{"label":[1],"enabled":[4],"maxfilesize":[2],"maxfiles":[2],"requestheaders":[8],"urlupload":[1],"urldelete":[1],"value":[1040]}]);
5748
+ const EzUpload = /*@__PURE__*/proxyCustomElement(EzUpload$1, [1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040]}]);
5743
5749
  const FormMetadata = /*@__PURE__*/proxyCustomElement(FormMetadata$1, [1,"form-metadata",{"name":[1],"label":[1],"dataunit":[1025],"many":[4],"autoload":[4],"metadata":[1040]}]);
5744
5750
  const PlaceHolder = /*@__PURE__*/proxyCustomElement(PlaceHolder$1, [1,"place-holder"]);
5745
5751
  const defineCustomElements = (opts) => {