@sankhyalabs/ezui 1.1.143 → 1.1.146

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 (52) hide show
  1. package/dist/cjs/ez-button.cjs.entry.js +1 -1
  2. package/dist/cjs/ez-card-item.cjs.entry.js +44 -0
  3. package/dist/cjs/ez-collapsible-box.cjs.entry.js +3 -2
  4. package/dist/cjs/ez-combo-box.cjs.entry.js +41 -20
  5. package/dist/cjs/ez-form.cjs.entry.js +18 -10
  6. package/dist/cjs/ez-grid.cjs.entry.js +2 -1
  7. package/dist/cjs/ez-upload.cjs.entry.js +3 -3
  8. package/dist/cjs/ezui.cjs.js +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/collection/collection-manifest.json +1 -0
  11. package/dist/collection/components/ez-button/ez-button.css +6 -0
  12. package/dist/collection/components/ez-card-item/ez-card-item.css +115 -0
  13. package/dist/collection/components/ez-card-item/ez-card-item.js +86 -0
  14. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +4 -0
  15. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +2 -1
  16. package/dist/collection/components/ez-combo-box/ez-combo-box.js +43 -21
  17. package/dist/collection/components/ez-form/ez-form.js +15 -7
  18. package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +3 -3
  19. package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +2 -1
  20. package/dist/collection/components/ez-upload/ez-upload.js +3 -3
  21. package/dist/custom-elements/index.d.ts +6 -0
  22. package/dist/custom-elements/index.js +111 -39
  23. package/dist/esm/ez-button.entry.js +1 -1
  24. package/dist/esm/ez-card-item.entry.js +40 -0
  25. package/dist/esm/ez-collapsible-box.entry.js +3 -2
  26. package/dist/esm/ez-combo-box.entry.js +41 -20
  27. package/dist/esm/ez-form.entry.js +18 -10
  28. package/dist/esm/ez-grid.entry.js +2 -1
  29. package/dist/esm/ez-upload.entry.js +3 -3
  30. package/dist/esm/ezui.js +1 -1
  31. package/dist/esm/loader.js +1 -1
  32. package/dist/ezui/ezui.esm.js +1 -1
  33. package/dist/ezui/p-024df41e.entry.js +1 -0
  34. package/dist/ezui/p-23369322.entry.js +1 -0
  35. package/dist/ezui/{p-6816c9ee.entry.js → p-3372d9a7.entry.js} +1 -1
  36. package/dist/ezui/p-5a05f1ea.entry.js +1 -0
  37. package/dist/ezui/p-6395ed55.entry.js +1 -0
  38. package/dist/ezui/p-8f4fac31.entry.js +1 -0
  39. package/dist/ezui/{p-8cb2c629.entry.js → p-c15d4d6f.entry.js} +1 -1
  40. package/dist/types/components/ez-card-item/ez-card-item.d.ts +23 -0
  41. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +5 -1
  42. package/dist/types/components/ez-grid/controller/DataUnitBridge.d.ts +1 -0
  43. package/dist/types/components/ez-upload/ez-upload.d.ts +1 -1
  44. package/dist/types/components.d.ts +17 -0
  45. package/package.json +3 -3
  46. package/react/components.d.ts +1 -0
  47. package/react/components.js +1 -0
  48. package/react/components.js.map +1 -1
  49. package/dist/ezui/p-7746460e.entry.js +0 -1
  50. package/dist/ezui/p-8639fc8c.entry.js +0 -1
  51. package/dist/ezui/p-cabe3671.entry.js +0 -1
  52. package/dist/ezui/p-dd6f4872.entry.js +0 -1
@@ -132,6 +132,10 @@ ez-icon {
132
132
  justify-content: space-between;
133
133
  }
134
134
 
135
+ .collapsible-box__title--no-margin {
136
+ margin-bottom: 0;
137
+ }
138
+
135
139
  .collapsible-box__content {
136
140
  /*private*/
137
141
  display: flex;
@@ -42,7 +42,8 @@ export class EzCollapsibleBox {
42
42
  h("div", { class: "collapsible-box__header" },
43
43
  h("button", { onClick: () => this.showHide(), class: "collapsible-box__title" +
44
44
  (this.iconPlacement === "right" ? " collapsible-box__title--icon-right" : "") +
45
- (this.stretchTitle ? " collapsible-box__title--stretched" : "") },
45
+ (this.stretchTitle ? " collapsible-box__title--stretched" : "") +
46
+ (this.value ? " collapsible-box__title--no-margin" : "") },
46
47
  h("ez-icon", { slot: "icon", "icon-name": "chevron-right", size: this.getHeaderSize(), class: "collapsible-box__icon collapsible-box__icon--" + this.getHeaderSize() + (this.value ? " collapsible-box__icon--collapsed" : "") }),
47
48
  h("label", { class: "collapsible-box__label font--" + this.getHeaderSize(), title: this.label }, this.label))),
48
49
  h("div", { class: "collapsible-box__content" + (this.value ? "" : " collapsible-box__content--show") },
@@ -3,6 +3,9 @@ import { Component, h, Host, Prop, State, Event, Element, Watch, Method } from "
3
3
  import CSSVarsUtils from "../../utils/CSSVarsUtils";
4
4
  export class EzComboBox {
5
5
  constructor() {
6
+ this._limitCharsToSearch = 3;
7
+ this._deboucingTime = 300;
8
+ this._startLoading = false;
6
9
  /**
7
10
  * Deixa o campo disponível ou não para interação com usuário.
8
11
  */
@@ -141,19 +144,8 @@ export class EzComboBox {
141
144
  this._preSelection = undefined;
142
145
  }
143
146
  }
144
- selectOption(opt) {
145
- const currentOpt = this.getSelectedOption();
146
- if (currentOpt !== opt) {
147
- const adjustedOpt = !(opt === null || opt === void 0 ? void 0 : opt.value) ? undefined : opt;
148
- this.value = adjustedOpt;
149
- this.errorMessage = "";
150
- this.ezChange.emit(adjustedOpt);
151
- }
152
- else {
153
- this.observeValue();
154
- }
155
- }
156
147
  updateSource(source) {
148
+ this._startLoading = false;
157
149
  if (source instanceof Promise) {
158
150
  source.then(result => this.updateSource(result));
159
151
  this.updateVisibleOptions();
@@ -164,12 +156,26 @@ export class EzComboBox {
164
156
  this.updateVisibleOptions();
165
157
  }
166
158
  else {
167
- this.value = source;
159
+ this.selectOption(source);
168
160
  }
169
161
  }
170
162
  }
163
+ selectOption(newOption) {
164
+ var _a, _b;
165
+ const currentOpt = this.getSelectedOption();
166
+ if (((_a = currentOpt === null || currentOpt === void 0 ? void 0 : currentOpt.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOption === null || newOption === void 0 ? void 0 : newOption.value) === null || _b === void 0 ? void 0 : _b.toString())) {
167
+ const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
168
+ this.value = adjustedOpt;
169
+ this.errorMessage = "";
170
+ this.ezChange.emit(this.value);
171
+ }
172
+ else {
173
+ this.observeValue();
174
+ }
175
+ }
171
176
  loadOptions(mode, argument = "") {
172
177
  this._criteria = argument;
178
+ this._startLoading = true;
173
179
  if (this.optionLoader) {
174
180
  this.updateSource(this.optionLoader({ mode, argument }));
175
181
  }
@@ -226,25 +232,40 @@ export class EzComboBox {
226
232
  this.searchMode ? this.loadOptions("ADVANCED") : this.showOptions();
227
233
  }
228
234
  onTextInputChangeHandler(event) {
235
+ var _a;
236
+ this.clearDeboucingTimeout();
237
+ if (this._startLoading) {
238
+ this._changeDeboucingTimeout = window.setTimeout(() => {
239
+ this.onTextInputChangeHandler(event);
240
+ }, this._deboucingTime);
241
+ return;
242
+ }
229
243
  if (!this._criteria) {
230
244
  this._inputElement.value = event.data;
231
245
  }
232
- const argument = event.target.value;
246
+ const argument = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.trim();
247
+ const argumentNumber = Number(argument || undefined);
233
248
  this._criteria = argument;
234
- if (this._criteria) {
249
+ if (argument && (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch)) {
235
250
  if (this.searchMode) {
236
- if (this._changeDeboucingTimeout) {
237
- window.clearTimeout(this._changeDeboucingTimeout);
238
- }
239
251
  this._changeDeboucingTimeout = window.setTimeout(() => {
240
- this.loadOptions("PREDICTIVE", argument);
241
- }, 200);
252
+ this.loadOptions("PREDICTIVE", isNaN(argumentNumber) ? argument : argumentNumber.toString());
253
+ }, this._deboucingTime);
242
254
  }
243
255
  else {
244
256
  this.updateVisibleOptions();
245
257
  }
246
258
  this.showOptions();
247
259
  }
260
+ else {
261
+ this.hideOptions();
262
+ }
263
+ }
264
+ clearDeboucingTimeout() {
265
+ if (this._changeDeboucingTimeout) {
266
+ window.clearTimeout(this._changeDeboucingTimeout);
267
+ this._changeDeboucingTimeout = undefined;
268
+ }
248
269
  }
249
270
  onTextInputClickHandler() {
250
271
  if (!this.searchMode) {
@@ -530,7 +551,8 @@ export class EzComboBox {
530
551
  }; }
531
552
  static get states() { return {
532
553
  "_preSelection": {},
533
- "_visibleOptions": {}
554
+ "_visibleOptions": {},
555
+ "_startLoading": {}
534
556
  }; }
535
557
  static get events() { return [{
536
558
  "method": "ezChange",
@@ -45,12 +45,20 @@ export class EzForm {
45
45
  requiredFields.forEach(field => {
46
46
  const value = record[field];
47
47
  const fieldElem = this._element.querySelector(`[data-field-name=${field}]`);
48
- if (value === null || value === undefined || value === "") {
49
- invalidFields.push(field);
50
- fieldElem["errorMessage"] = "Essa informação é obrigatória";
51
- }
52
- else {
53
- fieldElem["errorMessage"] = "";
48
+ /**
49
+ * TODO: fieldElem vai ser vazio quando o campo está em uma aba que
50
+ * está escondida.
51
+ * Temos que tratar esse caso para apresentar a mensagem de erro
52
+ * na aba, isso será tratado no card: https://sankhya.atlassian.net/browse/SKA-44182
53
+ */
54
+ if (fieldElem) {
55
+ if (value === null || value === undefined || value === "") {
56
+ invalidFields.push(field);
57
+ fieldElem["errorMessage"] = "Essa informação é obrigatória";
58
+ }
59
+ else {
60
+ fieldElem["errorMessage"] = "";
61
+ }
54
62
  }
55
63
  });
56
64
  const isValid = invalidFields.length === 0;
@@ -77,7 +85,7 @@ export class EzForm {
77
85
  return result;
78
86
  }
79
87
  processMetadata() {
80
- if (!this.isStatic()) {
88
+ if (!this.isStatic() && this.dataUnit) {
81
89
  const metadata = this.config && this.config.length > 0 ? buildFromConfig(this.config, this.dataUnit) : buildFromDataUnit(this.dataUnit);
82
90
  this._store.dispatch(loadMetadata(metadata));
83
91
  }
@@ -57,7 +57,7 @@ function getTabConfig(tab, sheets) {
57
57
  return tabConfig || { label: tab, visible: true };
58
58
  }
59
59
  function sortTabs(a, b) {
60
- return a[0].label == 'Geral' ? -1 : (a[0].order || 10000) - (b[0].order || 10000);
60
+ return a[0].label == '__main' ? -1 : (a[0].order || 10000) - (b[0].order || 10000);
61
61
  }
62
62
  export const buildFromConfig = (fields, dataUnit) => {
63
63
  const sheets = new Map();
@@ -67,7 +67,7 @@ export const buildFromConfig = (fields, dataUnit) => {
67
67
  fields.forEach(config => {
68
68
  var _a, _b, _c;
69
69
  if (config.visible !== false) {
70
- const tabConfig = getTabConfig(config.tab || "Geral", sheets);
70
+ const tabConfig = getTabConfig(config.tab || "__main", sheets);
71
71
  const descriptor = dataUnit.getField(config.name);
72
72
  if (descriptor && tabConfig.visible) {
73
73
  if (!sheets.has(tabConfig)) {
@@ -108,7 +108,7 @@ export const buildFromConfig = (fields, dataUnit) => {
108
108
  .sort(sortTabs)
109
109
  .forEach(([key, value]) => {
110
110
  metadata.addSheet({
111
- label: key.label,
111
+ label: (key.label === "__main") ? "Principal" : key.label,
112
112
  name: key.label,
113
113
  items: Array.from(value.values()),
114
114
  requiredFields,
@@ -1,6 +1,7 @@
1
1
  import { Action } from "@sankhyalabs/core";
2
2
  export default class DataUnitBridge {
3
3
  constructor(gridController, dataUnit) {
4
+ this.RECORD_ARCHIVE = "__RECORD_ARCHIVE__";
4
5
  this.processAction = (action) => {
5
6
  switch (action.type) {
6
7
  case Action.METADATA_LOADED:
@@ -37,7 +38,7 @@ export default class DataUnitBridge {
37
38
  if (this._dataUnit.metadata) {
38
39
  this._dataUnit.metadata.fields.forEach(f => {
39
40
  var _a;
40
- if (f.visible !== false) {
41
+ if (f.visible !== false && f.name !== this.RECORD_ARCHIVE) {
41
42
  const props = new Map();
42
43
  const properties = this._dataUnit.getField(f.name).properties;
43
44
  for (const value in properties) {
@@ -101,7 +101,7 @@ export class EzUpload {
101
101
  }
102
102
  this._filePointers.set(file.name, uploadingFile);
103
103
  uploadingFile.upload(this.urlUpload, this._requestHeaders, (file) => this.updateFeedback(file))
104
- .then((files) => files.forEach(ezFile => this.finishUpload(ezFile)))
104
+ .then((files) => files.forEach(ezFile => this.finishUpload(uploadingFile.name, ezFile)))
105
105
  .catch(msg => {
106
106
  this.ezCancelWaitingChange.emit();
107
107
  this.showError(msg);
@@ -114,8 +114,8 @@ export class EzUpload {
114
114
  throw error;
115
115
  }
116
116
  }
117
- finishUpload(ezFile) {
118
- this._filePointers.set(ezFile.name, ezFile);
117
+ finishUpload(key, ezFile) {
118
+ this._filePointers.set(key, ezFile);
119
119
  this.updateValue();
120
120
  }
121
121
  updateValue() {
@@ -20,6 +20,12 @@ export const EzCalendar: {
20
20
  new (): EzCalendar;
21
21
  };
22
22
 
23
+ interface EzCardItem extends Components.EzCardItem, HTMLElement {}
24
+ export const EzCardItem: {
25
+ prototype: EzCardItem;
26
+ new (): EzCardItem;
27
+ };
28
+
23
29
  interface EzCheck extends Components.EzCheck, HTMLElement {}
24
30
  export const EzCheck: {
25
31
  prototype: EzCheck;
@@ -23,7 +23,7 @@ let EzApplication$1 = class extends HTMLElement$1 {
23
23
  static get style() { return ezApplicationCss; }
24
24
  };
25
25
 
26
- const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover-color:var(--color--primary-600);--ez-button--hover--background-color:var(--background--medium, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--xlarge, 4px solid) var(--color--primary-300);--ez-button--focus--box-shadow:none;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:focus{outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}";
26
+ const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover-color:var(--color--primary-600);--ez-button--hover--background-color:var(--background--medium, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--xlarge, 4px solid) var(--color--primary-300);--ez-button--focus--box-shadow:none;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:focus{outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:focus{outline:none;outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}";
27
27
 
28
28
  let EzButton$1 = class extends HTMLElement$1 {
29
29
  constructor() {
@@ -312,6 +312,45 @@ let EzCalendar$1 = class extends HTMLElement$1 {
312
312
  static get style() { return ezCalendarCss; }
313
313
  };
314
314
 
315
+ const ezCardItemCss = ":host{--ez-card-item--font-size:var(--text--medium, 14px);--ez-card-item--font-family:var(--font-pattern, Arial);--ez-card-item--font-weight:var(--text-weight--medium, 400);--ez-card-item--font-weight-large:var(--text-weight--large, 600);--ez-card-item--color:var(--title--primary, #626e82);--ez-card-item__detail-label--color:var(--text--secondary, #A2ABB9);--ez-card-item__detail--padding-bottom:var(--space--extra-small, 3px);--ez-card-item__title--padding-bottom:var(--space--extra-small, 3px);--ez-card-item__highlight--color:var(--color--primary-300, #E2F4EF);width:100%;display:flex;cursor:pointer}.card-item{display:flex;flex-direction:column;width:100%;cursor:pointer;padding:12px;z-index:0;position:relative}.card-item:hover{background:#F0F3F7;border-radius:12px}.card-item__title{line-height:18px;cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight-large);color:var(--ez-card-item--color);padding-bottom:var(--ez-card-item__title--padding-bottom)}.card-item__details{display:flex;cursor:pointer;justify-content:space-between;gap:var(--space--small, 6px)}.card-item__details-left{cursor:pointer;width:50%}.card-item__details-right{width:50%;cursor:pointer}.card-item__detail:not(:last-child){cursor:pointer;padding-bottom:var(--ez-card-item__detail--padding-bottom)}.card-item__detail-label{cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight);color:var(--ez-card-item__detail-label--color)}.card-item__detail-value{cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight);color:var(--ez-card-item--color)}.card-item__highlight{position:relative;border-radius:8px;z-index:-1;background-color:var(--ez-card-item__highlight--color);outline:2px solid var(--ez-card-item__highlight--color);box-shadow:-4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color)}";
316
+
317
+ let EzCardItem$1 = class extends HTMLElement$1 {
318
+ constructor() {
319
+ super();
320
+ this.__registerHost();
321
+ this.__attachShadow();
322
+ this.ezClick = createEvent(this, "ezClick", 7);
323
+ }
324
+ componentWillRender() {
325
+ this.createDetailList();
326
+ }
327
+ createDetailList() {
328
+ var _a, _b, _c;
329
+ this._details = { detailsLeft: [], detailsRight: [] };
330
+ let cont = 0;
331
+ if ((_a = this.item) === null || _a === void 0 ? void 0 : _a.details) {
332
+ for (const attribute in this.item.details) {
333
+ cont < 3 ?
334
+ this._details.detailsLeft.push({ label: attribute, value: (_b = this.item.details[attribute]) === null || _b === void 0 ? void 0 : _b.toString() }) :
335
+ this._details.detailsRight.push({ label: attribute, value: (_c = this.item.details[attribute]) === null || _c === void 0 ? void 0 : _c.toString() });
336
+ cont++;
337
+ }
338
+ }
339
+ }
340
+ buildDetailContent(detail) {
341
+ return h("div", { class: "card-item__detail" }, h("label", { class: "card-item__detail-label" }, detail.label), ": ", h("label", { class: "card-item__detail-value", innerHTML: detail.value }));
342
+ }
343
+ render() {
344
+ return (h(Host, null, this.item &&
345
+ h("div", { class: "card-item", onClick: () => { this.ezClick.emit(this.item); } }, h("label", { class: "card-item__title", innerHTML: this.item.key + ' - ' + this.item.title }), h("div", { class: "card-item__details" }, h("div", { class: "card-item__details-left" }, this._details.detailsLeft.map(detail => {
346
+ return this.buildDetailContent(detail);
347
+ })), h("div", { class: "card-item__details-right" }, this._details.detailsRight.map(detail => {
348
+ return this.buildDetailContent(detail);
349
+ }))))));
350
+ }
351
+ static get style() { return ezCardItemCss; }
352
+ };
353
+
315
354
  const ezCheckCss = ":host{--ez-check--box--width:18px;--ez-check--box--height:18px;--ez-check--width:calc(var(--ez-check--box--width) + 14px);--ez-check--height:calc(var(--ez-check--box--width) + 14px);--ez-check--border-radius:var(--border--radius-small);--ez-check--checked--background-color:var(--color--primary-200);--ez-check--focus--background-color:var(--color--strokes, #FFFFFF);--ez-check--hover--background-color:var(--background--medium);--ez-check--checked--disabled--background-color:var(--color--disable-secondary);--ez-check--border:var(--border--medium) var(--title--primary);--ez-check--disabled--border:var(--border--medium) var(--color--strokes);--ez-check--checked--border:var(--border--medium) var(--color--primary);--ez-check--checked--hover--background-color:var(--color--primary-200);--ez-check--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--ez-check--check--image:url('data:image/svg+xml;utf8,<svg width=\"8\" height=\"7\" viewBox=\"0 0 8 7\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z\"/></svg>');--ez-check--check--background-color:var(--color--primary);--ez-check--check--disabled--background-color:var(--color--strokes);--ez-switch--slider--width:34px;--ez-switch--slider--height:14px;--ez-switch--pin--width:19px;--ez-switch--pin--height:19px;--ez-switch--focus--width:32px;--ez-switch--focus--height:32px;--ez-switch--background-color:var(--color--strokes);--ez-switch--disabled--background-color:var(--color--disable-secondary);--ez-switch--disabled--checked--background-color:var(--color--primary-300);--ez-switch--checked--background-color:var(--color--primary);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-primary);--ez-switch--pin--checked--background-color:var(--background--xlight);--ez-switch--pin--checked--disabled--background-color:#E8F7F4;--ez-switch--pin--focus--background-color:var(--text--disable);--ez-switch--pin--checked--focus--background-color:var(--color--primary);--ez-switch--pin--border-color:var(--text--primary);--ez-switch--pin--disabled--border-color:var(--text--secondary);--ez-check--label--font-size:var(--text--medium, 14px);--ez-check--label--font-family:var(--font-pattern, Arial);--ez-check--label--color:var(--title--primary, #000);--ez-check--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;width:100%;align-items:center;margin:0}input.regularMode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative;width:var(--ez-check--width);height:var(--ez-check--height)}input.regularMode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regularMode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regularMode:disabled{cursor:auto;background:none}input.regularMode::before{box-sizing:border-box;content:\"\";display:block;width:var(--ez-check--box--width);height:var(--ez-check--box--height);border-radius:var(--ez-check--border-radius);border:var(--ez-check--border)}input.regularMode:disabled::before{border:var(--ez-check--disabled--border)}input.regularMode:checked:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regularMode:checked:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regularMode:checked::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regularMode:checked:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regularMode:checked::after{display:flex;position:absolute;content:\"\";background-color:var(--ez-check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--ez-check--check--image);mask-image:var(--ez-check--check--image)}input.regularMode:checked:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switchMode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:var(--border--small, 1px solid) var(--ez-switch--pin--border-color, #626e82);transition:background-color var(--transition);width:var(--ez-switch--slider--width);height:var(--ez-switch--slider--height);background-color:var(--ez-switch--background-color)}input.switchMode:disabled{background-color:var(--ez-switch--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switchMode:checked:disabled{background-color:var(--ez-switch--disabled--checked--background-color)}input.switchMode::after{content:\"\";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transition:border-color var(--transition);transform:translateX(-2px) translateY(-4px);border-radius:50%;border:var(--border--small, 1px solid) var(--ez-switch--pin--border-color, #626e82);width:var(--ez-switch--pin--width);height:var(--ez-switch--pin--height);background-color:var(--ez-switch--pin--background-color)}input.switchMode:disabled::after{background-color:var(--ez-switch--pin--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switchMode:checked{transition:background-color var(--transition), border var(--transition);background-color:var(--ez-switch--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switchMode::before{display:block;content:\"\";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--ez-switch--focus--width);height:var(--ez-switch--focus--height);top:calc((var(--ez-switch--slider--height) - var(--ez-switch--focus--height)) / 2);left:calc((var(--ez-switch--pin--width) - var(--ez-switch--focus--width) - 2px) / 2);background-color:var(--ez-switch--pin--focus--background-color)}input.switchMode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switchMode:checked:focus::before{background-color:var(--ez-switch--pin--checked--focus--background-color);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width) + 2px))}input.switchMode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transition:border-color var(--transition);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width))) translateY(-4px);box-shadow:var(--shadow);background-color:var(--ez-switch--pin--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switchMode:checked:disabled::after{background-color:var(--ez-switch--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-check--label--color);text-shadow:var(--text-shadow);font-size:var(--ez-check--label--font-size);font-family:var(--ez-check--label--font-family);cursor:default;padding-left:var(--space--small)}.label--disabled{color:var(--ez-check--label--disabled--color)}";
316
355
 
317
356
  let EzCheck$1 = class extends HTMLElement$1 {
@@ -479,7 +518,7 @@ let EzChip$1 = class extends HTMLElement$1 {
479
518
  static get style() { return ezChipCss; }
480
519
  };
481
520
 
482
- const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box--focus--color:var(--color--primary-600);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}ez-icon{--ez-icon--color:inherit}.collapsible-box{display:flex;flex-direction:column;width:100%}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:auto;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;color:var(--ez-collapsible-box--color);--ez-icon--color:var(--ez-collapsible-box__icon--color);margin-bottom:var(--space--medium, 12px)}.collapsible-box__title:focus{color:var(--ez-collapsible-box--focus--color);--ez-icon--color:var(--ez-collapsible-box--focus--color)}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--stretched{width:100%;justify-content:space-between}.collapsible-box__content{display:flex;flex-wrap:wrap;width:100%;height:0px;max-height:0px;opacity:0;overflow:hidden;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;overflow:visible;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";
521
+ const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box--focus--color:var(--color--primary-600);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}ez-icon{--ez-icon--color:inherit}.collapsible-box{display:flex;flex-direction:column;width:100%}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:auto;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;color:var(--ez-collapsible-box--color);--ez-icon--color:var(--ez-collapsible-box__icon--color);margin-bottom:var(--space--medium, 12px)}.collapsible-box__title:focus{color:var(--ez-collapsible-box--focus--color);--ez-icon--color:var(--ez-collapsible-box--focus--color)}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--stretched{width:100%;justify-content:space-between}.collapsible-box__title--no-margin{margin-bottom:0}.collapsible-box__content{display:flex;flex-wrap:wrap;width:100%;height:0px;max-height:0px;opacity:0;overflow:hidden;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;overflow:visible;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";
483
522
 
484
523
  let EzCollapsibleBox$1 = class extends HTMLElement$1 {
485
524
  constructor() {
@@ -526,7 +565,8 @@ let EzCollapsibleBox$1 = class extends HTMLElement$1 {
526
565
  render() {
527
566
  return (h("div", { class: "collapsible-box" }, h("div", { class: "collapsible-box__header" }, h("button", { onClick: () => this.showHide(), class: "collapsible-box__title" +
528
567
  (this.iconPlacement === "right" ? " collapsible-box__title--icon-right" : "") +
529
- (this.stretchTitle ? " collapsible-box__title--stretched" : "") }, h("ez-icon", { slot: "icon", "icon-name": "chevron-right", size: this.getHeaderSize(), class: "collapsible-box__icon collapsible-box__icon--" + this.getHeaderSize() + (this.value ? " collapsible-box__icon--collapsed" : "") }), h("label", { class: "collapsible-box__label font--" + this.getHeaderSize(), title: this.label }, this.label))), h("div", { class: "collapsible-box__content" + (this.value ? "" : " collapsible-box__content--show") }, h("slot", null))));
568
+ (this.stretchTitle ? " collapsible-box__title--stretched" : "") +
569
+ (this.value ? " collapsible-box__title--no-margin" : "") }, h("ez-icon", { slot: "icon", "icon-name": "chevron-right", size: this.getHeaderSize(), class: "collapsible-box__icon collapsible-box__icon--" + this.getHeaderSize() + (this.value ? " collapsible-box__icon--collapsed" : "") }), h("label", { class: "collapsible-box__label font--" + this.getHeaderSize(), title: this.label }, this.label))), h("div", { class: "collapsible-box__content" + (this.value ? "" : " collapsible-box__content--show") }, h("slot", null))));
530
570
  }
531
571
  static get watchers() { return {
532
572
  "value": ["observeCollapsedValue"]
@@ -560,6 +600,9 @@ let EzComboBox$1 = class extends HTMLElement$1 {
560
600
  this.__registerHost();
561
601
  this.__attachShadow();
562
602
  this.ezChange = createEvent(this, "ezChange", 7);
603
+ this._limitCharsToSearch = 3;
604
+ this._deboucingTime = 300;
605
+ this._startLoading = false;
563
606
  /**
564
607
  * Deixa o campo disponível ou não para interação com usuário.
565
608
  */
@@ -696,19 +739,8 @@ let EzComboBox$1 = class extends HTMLElement$1 {
696
739
  this._preSelection = undefined;
697
740
  }
698
741
  }
699
- selectOption(opt) {
700
- const currentOpt = this.getSelectedOption();
701
- if (currentOpt !== opt) {
702
- const adjustedOpt = !(opt === null || opt === void 0 ? void 0 : opt.value) ? undefined : opt;
703
- this.value = adjustedOpt;
704
- this.errorMessage = "";
705
- this.ezChange.emit(adjustedOpt);
706
- }
707
- else {
708
- this.observeValue();
709
- }
710
- }
711
742
  updateSource(source) {
743
+ this._startLoading = false;
712
744
  if (source instanceof Promise) {
713
745
  source.then(result => this.updateSource(result));
714
746
  this.updateVisibleOptions();
@@ -719,12 +751,26 @@ let EzComboBox$1 = class extends HTMLElement$1 {
719
751
  this.updateVisibleOptions();
720
752
  }
721
753
  else {
722
- this.value = source;
754
+ this.selectOption(source);
723
755
  }
724
756
  }
725
757
  }
758
+ selectOption(newOption) {
759
+ var _a, _b;
760
+ const currentOpt = this.getSelectedOption();
761
+ if (((_a = currentOpt === null || currentOpt === void 0 ? void 0 : currentOpt.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOption === null || newOption === void 0 ? void 0 : newOption.value) === null || _b === void 0 ? void 0 : _b.toString())) {
762
+ const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
763
+ this.value = adjustedOpt;
764
+ this.errorMessage = "";
765
+ this.ezChange.emit(this.value);
766
+ }
767
+ else {
768
+ this.observeValue();
769
+ }
770
+ }
726
771
  loadOptions(mode, argument = "") {
727
772
  this._criteria = argument;
773
+ this._startLoading = true;
728
774
  if (this.optionLoader) {
729
775
  this.updateSource(this.optionLoader({ mode, argument }));
730
776
  }
@@ -781,25 +827,40 @@ let EzComboBox$1 = class extends HTMLElement$1 {
781
827
  this.searchMode ? this.loadOptions("ADVANCED") : this.showOptions();
782
828
  }
783
829
  onTextInputChangeHandler(event) {
830
+ var _a;
831
+ this.clearDeboucingTimeout();
832
+ if (this._startLoading) {
833
+ this._changeDeboucingTimeout = window.setTimeout(() => {
834
+ this.onTextInputChangeHandler(event);
835
+ }, this._deboucingTime);
836
+ return;
837
+ }
784
838
  if (!this._criteria) {
785
839
  this._inputElement.value = event.data;
786
840
  }
787
- const argument = event.target.value;
841
+ const argument = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.trim();
842
+ const argumentNumber = Number(argument || undefined);
788
843
  this._criteria = argument;
789
- if (this._criteria) {
844
+ if (argument && (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch)) {
790
845
  if (this.searchMode) {
791
- if (this._changeDeboucingTimeout) {
792
- window.clearTimeout(this._changeDeboucingTimeout);
793
- }
794
846
  this._changeDeboucingTimeout = window.setTimeout(() => {
795
- this.loadOptions("PREDICTIVE", argument);
796
- }, 200);
847
+ this.loadOptions("PREDICTIVE", isNaN(argumentNumber) ? argument : argumentNumber.toString());
848
+ }, this._deboucingTime);
797
849
  }
798
850
  else {
799
851
  this.updateVisibleOptions();
800
852
  }
801
853
  this.showOptions();
802
854
  }
855
+ else {
856
+ this.hideOptions();
857
+ }
858
+ }
859
+ clearDeboucingTimeout() {
860
+ if (this._changeDeboucingTimeout) {
861
+ window.clearTimeout(this._changeDeboucingTimeout);
862
+ this._changeDeboucingTimeout = undefined;
863
+ }
803
864
  }
804
865
  onTextInputClickHandler() {
805
866
  if (!this.searchMode) {
@@ -1436,7 +1497,7 @@ function getTabConfig(tab, sheets) {
1436
1497
  return tabConfig || { label: tab, visible: true };
1437
1498
  }
1438
1499
  function sortTabs(a, b) {
1439
- return a[0].label == 'Geral' ? -1 : (a[0].order || 10000) - (b[0].order || 10000);
1500
+ return a[0].label == '__main' ? -1 : (a[0].order || 10000) - (b[0].order || 10000);
1440
1501
  }
1441
1502
  const buildFromConfig = (fields, dataUnit) => {
1442
1503
  const sheets = new Map();
@@ -1446,7 +1507,7 @@ const buildFromConfig = (fields, dataUnit) => {
1446
1507
  fields.forEach(config => {
1447
1508
  var _a, _b, _c;
1448
1509
  if (config.visible !== false) {
1449
- const tabConfig = getTabConfig(config.tab || "Geral", sheets);
1510
+ const tabConfig = getTabConfig(config.tab || "__main", sheets);
1450
1511
  const descriptor = dataUnit.getField(config.name);
1451
1512
  if (descriptor && tabConfig.visible) {
1452
1513
  if (!sheets.has(tabConfig)) {
@@ -1487,7 +1548,7 @@ const buildFromConfig = (fields, dataUnit) => {
1487
1548
  .sort(sortTabs)
1488
1549
  .forEach(([key, value]) => {
1489
1550
  metadata.addSheet({
1490
- label: key.label,
1551
+ label: (key.label === "__main") ? "Principal" : key.label,
1491
1552
  name: key.label,
1492
1553
  items: Array.from(value.values()),
1493
1554
  requiredFields,
@@ -2099,12 +2160,20 @@ let EzForm$1 = class extends HTMLElement$1 {
2099
2160
  requiredFields.forEach(field => {
2100
2161
  const value = record[field];
2101
2162
  const fieldElem = this._element.querySelector(`[data-field-name=${field}]`);
2102
- if (value === null || value === undefined || value === "") {
2103
- invalidFields.push(field);
2104
- fieldElem["errorMessage"] = "Essa informação é obrigatória";
2105
- }
2106
- else {
2107
- fieldElem["errorMessage"] = "";
2163
+ /**
2164
+ * TODO: fieldElem vai ser vazio quando o campo está em uma aba que
2165
+ * está escondida.
2166
+ * Temos que tratar esse caso para apresentar a mensagem de erro
2167
+ * na aba, isso será tratado no card: https://sankhya.atlassian.net/browse/SKA-44182
2168
+ */
2169
+ if (fieldElem) {
2170
+ if (value === null || value === undefined || value === "") {
2171
+ invalidFields.push(field);
2172
+ fieldElem["errorMessage"] = "Essa informação é obrigatória";
2173
+ }
2174
+ else {
2175
+ fieldElem["errorMessage"] = "";
2176
+ }
2108
2177
  }
2109
2178
  });
2110
2179
  const isValid = invalidFields.length === 0;
@@ -2131,7 +2200,7 @@ let EzForm$1 = class extends HTMLElement$1 {
2131
2200
  return result;
2132
2201
  }
2133
2202
  processMetadata() {
2134
- if (!this.isStatic()) {
2203
+ if (!this.isStatic() && this.dataUnit) {
2135
2204
  const metadata = this.config && this.config.length > 0 ? buildFromConfig(this.config, this.dataUnit) : buildFromDataUnit(this.dataUnit);
2136
2205
  this._store.dispatch(loadMetadata(metadata));
2137
2206
  }
@@ -112731,6 +112800,7 @@ class AgGridController {
112731
112800
 
112732
112801
  class DataUnitBridge {
112733
112802
  constructor(gridController, dataUnit) {
112803
+ this.RECORD_ARCHIVE = "__RECORD_ARCHIVE__";
112734
112804
  this.processAction = (action) => {
112735
112805
  switch (action.type) {
112736
112806
  case Action.METADATA_LOADED:
@@ -112767,7 +112837,7 @@ class DataUnitBridge {
112767
112837
  if (this._dataUnit.metadata) {
112768
112838
  this._dataUnit.metadata.fields.forEach(f => {
112769
112839
  var _a;
112770
- if (f.visible !== false) {
112840
+ if (f.visible !== false && f.name !== this.RECORD_ARCHIVE) {
112771
112841
  const props = new Map();
112772
112842
  const properties = this._dataUnit.getField(f.name).properties;
112773
112843
  for (const value in properties) {
@@ -115005,7 +115075,7 @@ let EzUpload$1 = class extends HTMLElement$1 {
115005
115075
  }
115006
115076
  this._filePointers.set(file.name, uploadingFile);
115007
115077
  uploadingFile.upload(this.urlUpload, this._requestHeaders, (file) => this.updateFeedback(file))
115008
- .then((files) => files.forEach(ezFile => this.finishUpload(ezFile)))
115078
+ .then((files) => files.forEach(ezFile => this.finishUpload(uploadingFile.name, ezFile)))
115009
115079
  .catch(msg => {
115010
115080
  this.ezCancelWaitingChange.emit();
115011
115081
  this.showError(msg);
@@ -115018,8 +115088,8 @@ let EzUpload$1 = class extends HTMLElement$1 {
115018
115088
  throw error;
115019
115089
  }
115020
115090
  }
115021
- finishUpload(ezFile) {
115022
- this._filePointers.set(ezFile.name, ezFile);
115091
+ finishUpload(key, ezFile) {
115092
+ this._filePointers.set(key, ezFile);
115023
115093
  this.updateValue();
115024
115094
  }
115025
115095
  updateValue() {
@@ -115784,10 +115854,11 @@ let TestDu$1 = class extends HTMLElement$1 {
115784
115854
  const EzApplication = /*@__PURE__*/proxyCustomElement(EzApplication$1, [0,"ez-application"]);
115785
115855
  const EzButton = /*@__PURE__*/proxyCustomElement(EzButton$1, [1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513]}]);
115786
115856
  const EzCalendar = /*@__PURE__*/proxyCustomElement(EzCalendar$1, [1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"]}]);
115857
+ const EzCardItem = /*@__PURE__*/proxyCustomElement(EzCardItem$1, [1,"ez-card-item",{"item":[16]}]);
115787
115858
  const EzCheck = /*@__PURE__*/proxyCustomElement(EzCheck$1, [1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"mode":[513]}]);
115788
115859
  const EzChip = /*@__PURE__*/proxyCustomElement(EzChip$1, [1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540]}]);
115789
115860
  const EzCollapsibleBox = /*@__PURE__*/proxyCustomElement(EzCollapsibleBox$1, [1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"stretchTitle":[516,"stretch-title"]}]);
115790
- const EzComboBox = /*@__PURE__*/proxyCustomElement(EzComboBox$1, [1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32]}]);
115861
+ const EzComboBox = /*@__PURE__*/proxyCustomElement(EzComboBox$1, [1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32]}]);
115791
115862
  const EzDateInput = /*@__PURE__*/proxyCustomElement(EzDateInput$1, [1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513]}]);
115792
115863
  const EzDateTimeInput = /*@__PURE__*/proxyCustomElement(EzDateTimeInput$1, [1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513]}]);
115793
115864
  const EzDialog = /*@__PURE__*/proxyCustomElement(EzDialog$1, [1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"]}]);
@@ -115818,6 +115889,7 @@ const defineCustomElements = (opts) => {
115818
115889
  EzApplication,
115819
115890
  EzButton,
115820
115891
  EzCalendar,
115892
+ EzCardItem,
115821
115893
  EzCheck,
115822
115894
  EzChip,
115823
115895
  EzCollapsibleBox,
@@ -115854,4 +115926,4 @@ const defineCustomElements = (opts) => {
115854
115926
  }
115855
115927
  };
115856
115928
 
115857
- export { EzApplication, EzButton, EzCalendar, EzCheck, EzChip, EzCollapsibleBox, EzComboBox, EzDateInput, EzDateTimeInput, EzDialog, EzFilterInput, EzForm, EzGrid, EzIcon, EzList, EzLoadingBar, EzModal, EzNumberInput, EzPopover, EzPopup, EzSearch, EzTabselector, EzTextArea, EzTextInput, EzTimeInput, EzToast, EzUpload, EzViewStack, GridConfig, SelectBox, TestDu, defineCustomElements };
115929
+ export { EzApplication, EzButton, EzCalendar, EzCardItem, EzCheck, EzChip, EzCollapsibleBox, EzComboBox, EzDateInput, EzDateTimeInput, EzDialog, EzFilterInput, EzForm, EzGrid, EzIcon, EzList, EzLoadingBar, EzModal, EzNumberInput, EzPopover, EzPopup, EzSearch, EzTabselector, EzTextArea, EzTextInput, EzTimeInput, EzToast, EzUpload, EzViewStack, GridConfig, SelectBox, TestDu, defineCustomElements };
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h } from './index-b21f0a10.js';
2
2
 
3
- const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover-color:var(--color--primary-600);--ez-button--hover--background-color:var(--background--medium, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--xlarge, 4px solid) var(--color--primary-300);--ez-button--focus--box-shadow:none;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:focus{outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}";
3
+ const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover-color:var(--color--primary-600);--ez-button--hover--background-color:var(--background--medium, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--xlarge, 4px solid) var(--color--primary-300);--ez-button--focus--box-shadow:none;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:focus{outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:focus{outline:none;outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}";
4
4
 
5
5
  let EzButton = class {
6
6
  constructor(hostRef) {