@sankhyalabs/ezui 7.1.0-dev.2 → 7.1.0-dev.21

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 (225) hide show
  1. package/dist/cjs/{ApplicationUtils-d04f5c94.js → ApplicationUtils-4fb87a9e.js} +1 -1
  2. package/dist/cjs/{app-globals-c128c97e.js → app-globals-cb31a206.js} +1 -1
  3. package/dist/cjs/ez-actions-button.cjs.entry.js +2 -2
  4. package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-avatar.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -2
  9. package/dist/cjs/{ez-combo-box-list_4.cjs.entry.js → ez-combo-box-list_5.cjs.entry.js} +150 -3
  10. package/dist/cjs/ez-combo-box.cjs.entry.js +2 -2
  11. package/dist/cjs/ez-date-input.cjs.entry.js +11 -4
  12. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  13. package/dist/cjs/ez-dialog.cjs.entry.js +2 -2
  14. package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  16. package/dist/cjs/ez-form-view.cjs.entry.js +15 -7
  17. package/dist/cjs/ez-form.cjs.entry.js +17 -6
  18. package/dist/cjs/ez-grid.cjs.entry.js +12 -5
  19. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-link-builder_6.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-modal-container.cjs.entry.js +16 -17
  23. package/dist/cjs/ez-modal.cjs.entry.js +2 -2
  24. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
  25. package/dist/cjs/ez-number-input.cjs.entry.js +3 -1
  26. package/dist/cjs/ez-pagination.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-popup.cjs.entry.js +20 -8
  28. package/dist/cjs/ez-search-plus.cjs.entry.js +18 -4
  29. package/dist/cjs/ez-search-result-list.cjs.entry.js +1 -1
  30. package/dist/cjs/ez-search.cjs.entry.js +30 -26
  31. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
  32. package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
  33. package/dist/cjs/ez-sortable-list.cjs.entry.js +1 -1
  34. package/dist/cjs/ez-spinner.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-split-button.cjs.entry.js +2 -2
  36. package/dist/cjs/ez-split-item.cjs.entry.js +2 -2
  37. package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
  38. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  39. package/dist/cjs/ez-tooltip.cjs.entry.js +13 -2
  40. package/dist/cjs/ez-tree.cjs.entry.js +155 -8
  41. package/dist/cjs/ez-upload.cjs.entry.js +2 -2
  42. package/dist/cjs/ezui.cjs.js +3 -3
  43. package/dist/cjs/filter-column.cjs.entry.js +1 -1
  44. package/dist/cjs/index-a7b0c73d.js +2 -2
  45. package/dist/cjs/{index-00d0166b.js → index-e61642ff.js} +24 -0
  46. package/dist/cjs/loader.cjs.js +3 -3
  47. package/dist/cjs/{purify-47a2f27b.js → purify-b30a5718.js} +41 -12
  48. package/dist/cjs/{search-column-9aa090ec.js → search-column-51e50b59.js} +3 -3
  49. package/dist/collection/collection-manifest.json +1 -0
  50. package/dist/collection/components/ez-chip/ez-chip.css +3 -0
  51. package/dist/collection/components/ez-date-input/ez-date-input.js +28 -3
  52. package/dist/collection/components/ez-dialog/ez-dialog.css +6 -1
  53. package/dist/collection/components/ez-form/ez-form.js +23 -1
  54. package/dist/collection/components/ez-form-view/ez-form-view.js +24 -2
  55. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +4 -2
  56. package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
  57. package/dist/collection/components/ez-form-view/fieldbuilder/templates/ImageInput.tpl.js +4 -0
  58. package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +3 -1
  59. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +5 -1
  60. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +3 -0
  61. package/dist/collection/components/ez-image-input/ez-image-input.css +173 -0
  62. package/dist/collection/components/ez-image-input/ez-image-input.js +324 -0
  63. package/dist/collection/components/ez-modal/ez-modal.css +3 -0
  64. package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -9
  65. package/dist/collection/components/ez-modal-container/ez-modal-container.js +32 -15
  66. package/dist/collection/components/ez-number-input/ez-number-input.js +16 -0
  67. package/dist/collection/components/ez-popup/ez-popup.css +9 -4
  68. package/dist/collection/components/ez-popup/ez-popup.js +24 -7
  69. package/dist/collection/components/ez-search/ez-search.js +41 -19
  70. package/dist/collection/components/ez-search-plus/ez-search-plus.js +16 -2
  71. package/dist/collection/components/ez-split-button/ez-split-button.css +7 -2
  72. package/dist/collection/components/ez-text-input/ez-text-input.css +3 -3
  73. package/dist/collection/components/ez-tooltip/ez-tooltip.js +13 -2
  74. package/dist/collection/components/ez-tree/ez-tree.css +4 -0
  75. package/dist/collection/components/ez-tree/ez-tree.js +185 -6
  76. package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +4 -1
  77. package/dist/collection/components/ez-tree/types/Node.js +7 -0
  78. package/dist/collection/components/ez-tree/types/Tree.js +19 -0
  79. package/dist/collection/components/ez-tree/types/UpdateItemConfig.js +1 -0
  80. package/dist/collection/utils/form/DataBinder.js +1 -1
  81. package/dist/collection/utils/form/FormMetadata.js +12 -2
  82. package/dist/collection/utils/i18n/locales/en-us.js +8 -0
  83. package/dist/collection/utils/i18n/locales/es-es.js +8 -0
  84. package/dist/collection/utils/i18n/locales/pt-br.js +8 -0
  85. package/dist/custom-elements/index.d.ts +6 -0
  86. package/dist/custom-elements/index.js +530 -105
  87. package/dist/esm/{ApplicationUtils-12768f5a.js → ApplicationUtils-985c24ae.js} +1 -1
  88. package/dist/esm/{app-globals-9507c20e.js → app-globals-75f8a758.js} +1 -1
  89. package/dist/esm/ez-actions-button.entry.js +2 -2
  90. package/dist/esm/ez-alert-list.entry.js +1 -1
  91. package/dist/esm/ez-avatar.entry.js +1 -1
  92. package/dist/esm/ez-calendar.entry.js +1 -1
  93. package/dist/esm/ez-chip.entry.js +1 -1
  94. package/dist/esm/ez-collapsible-box.entry.js +2 -2
  95. package/dist/esm/{ez-combo-box-list_4.entry.js → ez-combo-box-list_5.entry.js} +150 -4
  96. package/dist/esm/ez-combo-box.entry.js +2 -2
  97. package/dist/esm/ez-date-input.entry.js +11 -4
  98. package/dist/esm/ez-date-time-input.entry.js +1 -1
  99. package/dist/esm/ez-dialog.entry.js +2 -2
  100. package/dist/esm/ez-double-list.entry.js +1 -1
  101. package/dist/esm/ez-file-item.entry.js +1 -1
  102. package/dist/esm/ez-form-view.entry.js +15 -7
  103. package/dist/esm/ez-form.entry.js +17 -6
  104. package/dist/esm/ez-grid.entry.js +12 -5
  105. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  106. package/dist/esm/ez-link-builder_6.entry.js +1 -1
  107. package/dist/esm/ez-list.entry.js +1 -1
  108. package/dist/esm/ez-modal-container.entry.js +16 -17
  109. package/dist/esm/ez-modal.entry.js +2 -2
  110. package/dist/esm/ez-multi-selection-list.entry.js +1 -1
  111. package/dist/esm/ez-number-input.entry.js +3 -1
  112. package/dist/esm/ez-pagination.entry.js +1 -1
  113. package/dist/esm/ez-popup.entry.js +20 -8
  114. package/dist/esm/ez-search-plus.entry.js +18 -4
  115. package/dist/esm/ez-search-result-list.entry.js +1 -1
  116. package/dist/esm/ez-search.entry.js +25 -21
  117. package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
  118. package/dist/esm/ez-skeleton.entry.js +1 -1
  119. package/dist/esm/ez-sortable-list.entry.js +1 -1
  120. package/dist/esm/ez-spinner.entry.js +1 -1
  121. package/dist/esm/ez-split-button.entry.js +2 -2
  122. package/dist/esm/ez-split-item.entry.js +2 -2
  123. package/dist/esm/ez-text-input.entry.js +1 -1
  124. package/dist/esm/ez-time-input.entry.js +1 -1
  125. package/dist/esm/ez-tooltip.entry.js +13 -2
  126. package/dist/esm/ez-tree.entry.js +155 -8
  127. package/dist/esm/ez-upload.entry.js +2 -2
  128. package/dist/esm/ezui.js +3 -3
  129. package/dist/esm/filter-column.entry.js +1 -1
  130. package/dist/esm/{index-62fc771e.js → index-a3b24b5d.js} +24 -0
  131. package/dist/esm/index-baa5e267.js +2 -2
  132. package/dist/esm/loader.js +3 -3
  133. package/dist/esm/{purify-dc6814bf.js → purify-9357603c.js} +41 -12
  134. package/dist/esm/{search-column-83562552.js → search-column-0c42248b.js} +3 -3
  135. package/dist/ezui/ezui.esm.js +1 -1
  136. package/dist/ezui/{p-e882635e.entry.js → p-0aafbc30.entry.js} +1 -1
  137. package/dist/ezui/{p-0c0eb410.entry.js → p-0e325699.entry.js} +1 -1
  138. package/dist/ezui/{p-5a11cf56.js → p-0ec5c128.js} +1 -1
  139. package/dist/ezui/p-1bf40959.entry.js +1 -0
  140. package/dist/ezui/p-1c3f43e8.entry.js +1 -0
  141. package/dist/ezui/{p-1cde96f9.entry.js → p-2676e2a3.entry.js} +1 -1
  142. package/dist/ezui/{p-e27d7dc2.entry.js → p-28af6826.entry.js} +1 -1
  143. package/dist/ezui/{p-1adf7139.entry.js → p-2b23906a.entry.js} +1 -1
  144. package/dist/ezui/{p-1730ee24.entry.js → p-2e5de2a7.entry.js} +1 -1
  145. package/dist/ezui/{p-5ab08b60.entry.js → p-2fd16ff2.entry.js} +1 -1
  146. package/dist/ezui/{p-d66bf34e.entry.js → p-3d71e8e1.entry.js} +2 -2
  147. package/dist/ezui/{p-6f119d5f.entry.js → p-3fcf79c7.entry.js} +1 -1
  148. package/dist/ezui/p-474076b3.js +1 -0
  149. package/dist/ezui/{p-a401041c.entry.js → p-47d9256e.entry.js} +1 -1
  150. package/dist/ezui/{p-124699e0.entry.js → p-4ea5c8a7.entry.js} +1 -1
  151. package/dist/ezui/p-582c3f90.entry.js +1 -0
  152. package/dist/ezui/{p-6a9a20a0.entry.js → p-5e6de2c1.entry.js} +1 -1
  153. package/dist/ezui/{p-2a70f094.entry.js → p-6570ca10.entry.js} +1 -1
  154. package/dist/ezui/{p-e99cbb51.entry.js → p-67f9fadb.entry.js} +1 -1
  155. package/dist/ezui/p-6a982147.js +1 -0
  156. package/dist/ezui/p-6c484770.entry.js +1 -0
  157. package/dist/ezui/{p-1266fe78.entry.js → p-6d7f2fdc.entry.js} +1 -1
  158. package/dist/ezui/p-6f466aec.entry.js +1 -0
  159. package/dist/ezui/{p-3fe05d6b.entry.js → p-714452c7.entry.js} +1 -1
  160. package/dist/ezui/{p-957d08cd.entry.js → p-7624767b.entry.js} +1 -1
  161. package/dist/ezui/p-782fe2e3.entry.js +1 -0
  162. package/dist/ezui/p-8709c4f6.entry.js +1 -0
  163. package/dist/ezui/{p-8dc267ff.entry.js → p-8a8006e6.entry.js} +1 -1
  164. package/dist/ezui/{p-0e49c0ff.entry.js → p-8d626d2b.entry.js} +1 -1
  165. package/dist/ezui/{p-79277e43.entry.js → p-9568a93d.entry.js} +1 -1
  166. package/dist/ezui/p-9771ea3c.entry.js +1 -0
  167. package/dist/ezui/p-98218fbc.js +1 -0
  168. package/dist/ezui/p-9d004e22.entry.js +1 -0
  169. package/dist/ezui/{p-eee3c7ff.entry.js → p-a13e65a4.entry.js} +1 -1
  170. package/dist/ezui/{p-e8c6c973.entry.js → p-a1a63294.entry.js} +1 -1
  171. package/dist/ezui/p-c711900a.entry.js +1 -0
  172. package/dist/ezui/p-cfa26133.entry.js +1 -0
  173. package/dist/ezui/{p-a7eab406.entry.js → p-dc192d01.entry.js} +1 -1
  174. package/dist/ezui/p-dff9862b.js +3 -0
  175. package/dist/ezui/{p-59a98e31.entry.js → p-e2e0dd76.entry.js} +1 -1
  176. package/dist/ezui/{p-2ba2d792.entry.js → p-e4a579f2.entry.js} +1 -1
  177. package/dist/ezui/{p-59092a66.entry.js → p-e82a12c6.entry.js} +1 -1
  178. package/dist/ezui/p-f1bbf23f.entry.js +1 -0
  179. package/dist/ezui/p-f34ec732.entry.js +1 -0
  180. package/dist/ezui/p-f45ddc1f.entry.js +1 -0
  181. package/dist/types/components/ez-date-input/ez-date-input.d.ts +5 -1
  182. package/dist/types/components/ez-form/ez-form.d.ts +5 -0
  183. package/dist/types/components/ez-form-view/ez-form-view.d.ts +4 -0
  184. package/dist/types/components/ez-form-view/fieldbuilder/FieldBuilder.d.ts +3 -1
  185. package/dist/types/components/ez-form-view/fieldbuilder/templates/ImageInput.tpl.d.ts +2 -0
  186. package/dist/types/components/ez-image-input/ez-image-input.d.ts +42 -0
  187. package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +6 -2
  188. package/dist/types/components/ez-number-input/ez-number-input.d.ts +4 -0
  189. package/dist/types/components/ez-popup/ez-popup.d.ts +3 -0
  190. package/dist/types/components/ez-search/ez-search.d.ts +5 -6
  191. package/dist/types/components/ez-search-plus/ez-search-plus.d.ts +1 -0
  192. package/dist/types/components/ez-tooltip/ez-tooltip.d.ts +3 -0
  193. package/dist/types/components/ez-tree/ez-tree.d.ts +20 -1
  194. package/dist/types/components/ez-tree/types/Node.d.ts +1 -0
  195. package/dist/types/components/ez-tree/types/Tree.d.ts +1 -0
  196. package/dist/types/components/ez-tree/types/UpdateItemConfig.d.ts +4 -0
  197. package/dist/types/components.d.ts +140 -1
  198. package/dist/types/utils/form/interfaces/IFormSheetMetadata.d.ts +1 -0
  199. package/dist/types/utils/form/interfaces/ITabConfig.d.ts +1 -0
  200. package/dist/types/utils/i18n/locales/en-us.d.ts +8 -0
  201. package/dist/types/utils/i18n/locales/es-es.d.ts +8 -0
  202. package/dist/types/utils/i18n/locales/pt-br.d.ts +8 -0
  203. package/dist/types/utils/i18n/translations.d.ts +24 -0
  204. package/package.json +1 -1
  205. package/react/components.d.ts +1 -0
  206. package/react/components.js +1 -0
  207. package/react/components.js.map +1 -1
  208. package/dist/ezui/p-02f6e3b0.entry.js +0 -1
  209. package/dist/ezui/p-0b333f09.entry.js +0 -1
  210. package/dist/ezui/p-14807f4e.js +0 -1
  211. package/dist/ezui/p-191cfbc8.entry.js +0 -1
  212. package/dist/ezui/p-1bfef8e5.entry.js +0 -1
  213. package/dist/ezui/p-228a4d2f.js +0 -3
  214. package/dist/ezui/p-2df50161.entry.js +0 -1
  215. package/dist/ezui/p-4e1df756.entry.js +0 -1
  216. package/dist/ezui/p-623161e2.js +0 -1
  217. package/dist/ezui/p-641ee538.js +0 -1
  218. package/dist/ezui/p-7f8c1fce.entry.js +0 -1
  219. package/dist/ezui/p-8bb3aeb0.entry.js +0 -1
  220. package/dist/ezui/p-ba7e908a.entry.js +0 -1
  221. package/dist/ezui/p-bd6146c5.entry.js +0 -1
  222. package/dist/ezui/p-c943f7c4.entry.js +0 -1
  223. package/dist/ezui/p-d0e6911e.entry.js +0 -1
  224. package/dist/ezui/p-e46a4d06.entry.js +0 -1
  225. package/dist/ezui/p-f958dcb1.entry.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import CSSVarsUtils from "../../utils/CSSVarsUtils";
3
3
  import { ElementIDUtils, ObjectUtils, StringUtils } from "@sankhyalabs/core";
4
- import { ApplicationUtils } from "../../utils";
4
+ import { ApplicationUtils, SearchMode } from "../../utils";
5
5
  import { replaceHighlight, replaceQuotes } from "./utils/searchFormatters";
6
6
  import initI18n from '../../utils/i18n';
7
7
  export class EzSearch {
@@ -43,6 +43,7 @@ export class EzSearch {
43
43
  this.alternativePlaceholder = undefined;
44
44
  this.showMore = undefined;
45
45
  this.suppressInputPersist = false;
46
+ this.hideDescriptionInput = false;
46
47
  }
47
48
  observeErrorMessage() {
48
49
  var _a;
@@ -350,7 +351,7 @@ export class EzSearch {
350
351
  }
351
352
  }
352
353
  async loadDescriptionValue(argument) {
353
- var _a, _b;
354
+ var _a, _b, _c;
354
355
  if (argument == undefined) {
355
356
  return;
356
357
  }
@@ -358,21 +359,30 @@ export class EzSearch {
358
359
  this.loadOptionValue(argument);
359
360
  return;
360
361
  }
362
+ const searchMode = this.hideDescriptionInput ? SearchMode.LOAD_DESCRIPTION : SearchMode.PREDICTIVE;
361
363
  const searchArgument = {
362
- mode: SearchMode.PREDICTIVE,
364
+ mode: searchMode,
363
365
  argument
364
366
  };
365
- const source = await ((_b = this.optionLoader) === null || _b === void 0 ? void 0 : _b.call(this, searchArgument, this.contextProperties));
366
- if (source == undefined) {
367
- return;
368
- }
369
- if (source instanceof Promise) {
370
- source.then((result) => {
371
- this.setDescriptionValue(result);
372
- });
367
+ try {
368
+ const source = await ((_b = this.optionLoader) === null || _b === void 0 ? void 0 : _b.call(this, searchArgument, this.contextProperties));
369
+ if (source == undefined) {
370
+ return;
371
+ }
372
+ if (source instanceof Promise) {
373
+ source.then((result) => {
374
+ this.setDescriptionValue(result);
375
+ });
376
+ }
377
+ else {
378
+ this.setDescriptionValue(source);
379
+ }
373
380
  }
374
- else {
375
- this.setDescriptionValue(source);
381
+ catch (error) {
382
+ if (((_c = error === null || error === void 0 ? void 0 : error.constructor) === null || _c === void 0 ? void 0 : _c.name) === "WarningException") {
383
+ this.errorMessage = error.message;
384
+ }
385
+ throw error;
376
386
  }
377
387
  }
378
388
  setDescriptionValue(source) {
@@ -1107,6 +1117,24 @@ export class EzSearch {
1107
1117
  "attribute": "suppress-input-persist",
1108
1118
  "reflect": false,
1109
1119
  "defaultValue": "false"
1120
+ },
1121
+ "hideDescriptionInput": {
1122
+ "type": "boolean",
1123
+ "mutable": true,
1124
+ "complexType": {
1125
+ "original": "boolean",
1126
+ "resolved": "boolean",
1127
+ "references": {}
1128
+ },
1129
+ "required": false,
1130
+ "optional": false,
1131
+ "docs": {
1132
+ "tags": [],
1133
+ "text": "Se true o campo de descri\u00E7\u00E3o n\u00E3o ser\u00E1 exibido."
1134
+ },
1135
+ "attribute": "hide-description-input",
1136
+ "reflect": true,
1137
+ "defaultValue": "false"
1110
1138
  }
1111
1139
  };
1112
1140
  }
@@ -1247,9 +1275,3 @@ export class EzSearch {
1247
1275
  }];
1248
1276
  }
1249
1277
  }
1250
- var SearchMode;
1251
- (function (SearchMode) {
1252
- SearchMode["ADVANCED"] = "ADVANCED";
1253
- SearchMode["PRELOAD"] = "PRELOAD";
1254
- SearchMode["PREDICTIVE"] = "PREDICTIVE";
1255
- })(SearchMode || (SearchMode = {}));
@@ -6,6 +6,7 @@ export class EzSearchPlus {
6
6
  constructor() {
7
7
  this.SEARCH_DESCRIPTION_TIMEOUT = 300;
8
8
  this.INTERVAL_TO_RETRY_ASYNC_VALUE = 100;
9
+ this._ignoreNextValue = false;
9
10
  this.value = undefined;
10
11
  this.enabled = true;
11
12
  this.disableCodeInput = false;
@@ -38,6 +39,11 @@ export class EzSearchPlus {
38
39
  this.showLoading = true;
39
40
  }
40
41
  async observeValue(newValue, oldValue) {
42
+ var _a;
43
+ if (this._ignoreNextValue) {
44
+ this._ignoreNextValue = false;
45
+ return;
46
+ }
41
47
  const newNormalizedValue = this.normalizeValueToCodeValue(newValue);
42
48
  const oldNormalizedValue = this.normalizeValueToCodeValue(oldValue);
43
49
  if (newNormalizedValue === oldNormalizedValue) {
@@ -57,12 +63,17 @@ export class EzSearchPlus {
57
63
  }
58
64
  }
59
65
  catch (err) {
60
- this.value = undefined;
66
+ this._ignoreNextValue = true;
67
+ this.clearSearch();
61
68
  console.warn("[EzSearchPlus] Erro ao obter descrição do registro.", err);
69
+ if (((_a = err === null || err === void 0 ? void 0 : err.constructor) === null || _a === void 0 ? void 0 : _a.name) === "WarningException") {
70
+ this.errorMessage = err.message;
71
+ }
62
72
  throw err;
63
73
  }
64
74
  this.value = this.buildCurrentValue();
65
75
  this.ezChange.emit(this.value);
76
+ this.errorMessage = null;
66
77
  }
67
78
  canShowLoadSpinDescription() {
68
79
  return this.isLoadingDescription;
@@ -141,8 +152,11 @@ export class EzSearchPlus {
141
152
  }
142
153
  clearSearch() {
143
154
  this.value = null;
155
+ this.codeValue = null;
144
156
  this.descriptionValue = null;
145
- this._textInputDescriptionValue.value = null;
157
+ if (!this.hideDescriptionInput) {
158
+ this._textInputDescriptionValue.value = null;
159
+ }
146
160
  }
147
161
  getCodLabel() {
148
162
  var _a;
@@ -42,7 +42,7 @@
42
42
  /*@doc Define a família da fonte do label.*/
43
43
  --ez-split-button--font-family: var(--font-pattern, Arial);
44
44
  /*@doc Define o peso da fonte do label.*/
45
- --ez-split-button--font-weight: var(--font-weight--regular,400);
45
+ --ez-split-button--font-weight: var(--font-weight--medium, 500);
46
46
  /*@doc Define o raio da borda do botão.*/
47
47
  --ez-split-button--border-radius: var(--border--radius-24, 24px);
48
48
  /*@doc Define a cor do texto e do ícone quando o cursor está sobre o botão.*/
@@ -137,7 +137,12 @@
137
137
  .ez-split-button.medium {
138
138
  --ez-split-button--height: var(--space--32, 32px);
139
139
  }
140
-
140
+
141
+ .ez-split-button.small {
142
+ --ez-split-button--height: var(--space--32, 32px);
143
+ --ez-split-button--font-size: var(--text--small, 12px);
144
+ }
145
+
141
146
  ez-icon {
142
147
  --ez-icon--color: inherit;
143
148
  }
@@ -213,7 +213,7 @@ input:read-only {
213
213
  white-space: nowrap;
214
214
  -webkit-transition: font-size .05s, top .05s;
215
215
  transition: font-size .05s, top .05s;
216
- width: calc(100% - var(--ez-text-input__label--padding-right));
216
+ width: calc(100% - (var(--ez-text-input__label--padding-right) + var(--ez-text-input__label--padding-left)));
217
217
  left: var(--ez-text-input--space--medium);
218
218
 
219
219
  /*public*/
@@ -245,7 +245,7 @@ input:read-only {
245
245
  text-align: left;
246
246
  left: calc(var(--ez-text-input__icon--width) + 2px);
247
247
  /*borda*/
248
- width: calc(100% - var(--ez-text-input__icon--width));
248
+ width: calc(100% - (var(--ez-text-input__icon--width) + var(--ez-text-input__label--padding-right)));
249
249
  }
250
250
 
251
251
  .input__label--left.hasError {
@@ -255,7 +255,7 @@ input:read-only {
255
255
  .input__label--right {
256
256
  /*public*/
257
257
  right: var(--ez-text-input__icon--width);
258
- width: calc(100% - var(--ez-text-input__icon--width));
258
+ width: calc(100% - (var(--ez-text-input__icon--width) + var(--ez-text-input__label--padding-left)));
259
259
  }
260
260
  .input__label--right.hasError {
261
261
  width: calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing));
@@ -4,6 +4,7 @@ import { h, Host } from "@stencil/core";
4
4
  export class EzTooltip {
5
5
  constructor() {
6
6
  this._opened = false;
7
+ this._eventsRegistered = false;
7
8
  this.message = undefined;
8
9
  this.anchoringElement = undefined;
9
10
  this.placement = 'bottom';
@@ -99,6 +100,7 @@ export class EzTooltip {
99
100
  this._mouseLeaveHandler = () => this.closeTooltip();
100
101
  element.addEventListener('mouseenter', this._mouseEnterHandler);
101
102
  element.addEventListener('mouseleave', this._mouseLeaveHandler);
103
+ this._eventsRegistered = true;
102
104
  }
103
105
  removeEvents(element = this.anchoringElement) {
104
106
  if (!element) {
@@ -110,10 +112,19 @@ export class EzTooltip {
110
112
  if (this._mouseLeaveHandler) {
111
113
  element.removeEventListener('mouseleave', this._mouseLeaveHandler);
112
114
  }
115
+ this._eventsRegistered = false;
116
+ }
117
+ initializeTooltip() {
118
+ if (this._element && this.anchoringElement && !this._eventsRegistered) {
119
+ this.setEvents();
120
+ this.addInfoId();
121
+ }
122
+ }
123
+ connectedCallback() {
124
+ this.initializeTooltip();
113
125
  }
114
126
  componentDidLoad() {
115
- this.setEvents();
116
- this.addInfoId();
127
+ this.initializeTooltip();
117
128
  }
118
129
  addInfoId() {
119
130
  if (this._element) {
@@ -8,6 +8,9 @@
8
8
  --ez-tree--margin: var(--space--extra-small, 3px);
9
9
  /*@doc Define a margem da direita do componente.*/
10
10
  --ez-tree--margin-right: 0px;
11
+
12
+ /*@doc Define se o texto dos itens pode ser selecionado pelo usuário.*/
13
+ --ez-tree--user-select: auto;
11
14
 
12
15
  /* Fontes e cor de ícones*/
13
16
  /*@doc Define a família da fonte.*/
@@ -197,6 +200,7 @@ ul.first-level {
197
200
  text-overflow: ellipsis;
198
201
  overflow: hidden;
199
202
  white-space: nowrap;
203
+ user-select: var(--ez-tree--user-select);
200
204
 
201
205
  /*public*/
202
206
  font-family: var(--ez-tree--font-family);
@@ -7,11 +7,18 @@ import initI18n from '../../utils/i18n';
7
7
  export class EzTree {
8
8
  constructor() {
9
9
  this._onItemClick = (item) => {
10
- this._onIconClick(item);
10
+ if (!this.selectable) {
11
+ this.openClose(item);
12
+ return;
13
+ }
14
+ if (this.value && this.value.id === item.id) {
15
+ this.value = undefined;
16
+ return;
17
+ }
18
+ this.value = item;
11
19
  };
12
20
  this._onIconClick = (item) => {
13
21
  this.openClose(item);
14
- this.value = item;
15
22
  };
16
23
  this._tree = new Tree(() => forceUpdate(this));
17
24
  this._waintingForLoad = undefined;
@@ -21,6 +28,7 @@ export class EzTree {
21
28
  this.iconResolver = defaultIconResolver;
22
29
  this.tooltipResolver = undefined;
23
30
  this.enableHierarchicalFilter = true;
31
+ this.selectable = true;
24
32
  }
25
33
  /**
26
34
  * Efetua a seleção de um item.
@@ -71,10 +79,14 @@ export class EzTree {
71
79
  parentId = (_a = this.value) === null || _a === void 0 ? void 0 : _a.id;
72
80
  }
73
81
  this._tree.addChildAt(parentId, item);
82
+ this.addItemInIndexedList(parentId, item);
74
83
  const node = this._tree.getNode(parentId);
75
84
  if (node) {
76
85
  node.item.expanded = true;
77
86
  }
87
+ else {
88
+ this.collapseAll();
89
+ }
78
90
  }
79
91
  /**
80
92
  * Efetua a seleção de um item.
@@ -97,12 +109,48 @@ export class EzTree {
97
109
  /**
98
110
  * Atualiza um item
99
111
  */
100
- async updateItem(item) {
101
- var _a;
102
- this._tree.updateItem(item);
112
+ async updateItem(item, config) {
113
+ var _a, _b, _c;
114
+ if (Array.isArray(item)) {
115
+ item.forEach(i => this.updateItem(i, config));
116
+ return;
117
+ }
118
+ if (config === null || config === void 0 ? void 0 : config.updatedBySelectedId) {
119
+ Object.assign(item, { id: this.selectedId });
120
+ }
121
+ this._tree.updateItem((config === null || config === void 0 ? void 0 : config.forceDefaultValues) ? this.applyDefaultValues(item) : item);
122
+ this.updateItemInIndexedList(item, config === null || config === void 0 ? void 0 : config.forceDefaultValues);
103
123
  const node = (_a = this._tree) === null || _a === void 0 ? void 0 : _a.getNode(this.selectedId);
104
124
  if (node == undefined) {
105
125
  this.value = this._visibleItems ? this._visibleItems[0] : undefined;
126
+ this._tree.collapseAll();
127
+ }
128
+ if (((_b = this.value) === null || _b === void 0 ? void 0 : _b.id) === item.id) {
129
+ this.value = item;
130
+ this.ezChange.emit(this.value);
131
+ return;
132
+ }
133
+ const childSelected = this.getItemById((_c = this.value) === null || _c === void 0 ? void 0 : _c.id, [item]);
134
+ if (childSelected) {
135
+ this.value = childSelected;
136
+ this.ezChange.emit(this.value);
137
+ }
138
+ }
139
+ /**
140
+ * Remove um item da árvore pelo seu ID.
141
+ * Se o item removido estiver selecionado, a seleção será limpa.
142
+ */
143
+ async removeItem(id) {
144
+ var _a;
145
+ id = id !== null && id !== void 0 ? id : this.selectedId;
146
+ if (!id) {
147
+ return;
148
+ }
149
+ this._tree.removeItem(id);
150
+ this.removeItemFromIndexedList(id);
151
+ this.ezRemoveItem.emit(id);
152
+ if (((_a = this.value) === null || _a === void 0 ? void 0 : _a.id) === id) {
153
+ this.value = undefined;
106
154
  }
107
155
  }
108
156
  /**
@@ -190,6 +238,75 @@ export class EzTree {
190
238
  event.preventDefault();
191
239
  }
192
240
  }
241
+ getItemById(id, items) {
242
+ for (const treeItem of items) {
243
+ if (treeItem.id === id) {
244
+ return treeItem;
245
+ }
246
+ else if (treeItem.children && Array.isArray(treeItem.children)) {
247
+ const itemFound = this.getItemById(id, treeItem.children);
248
+ if (itemFound) {
249
+ return itemFound;
250
+ }
251
+ }
252
+ }
253
+ return undefined;
254
+ }
255
+ addItemInIndexedList(parentId, item, items) {
256
+ var _a, _b;
257
+ items = (_a = items !== null && items !== void 0 ? items : this.items) !== null && _a !== void 0 ? _a : [];
258
+ if (!parentId) {
259
+ items.push(item);
260
+ }
261
+ const itemFound = this.getItemById(parentId, items);
262
+ itemFound.children = ((_b = itemFound.children) !== null && _b !== void 0 ? _b : []);
263
+ itemFound.children.push(item);
264
+ itemFound.childrenCount = itemFound.children.length;
265
+ }
266
+ applyDefaultValues(item) {
267
+ if (item.disabled === undefined) {
268
+ item.disabled = false;
269
+ }
270
+ if (item.expanded === undefined) {
271
+ item.expanded = false;
272
+ }
273
+ return item;
274
+ }
275
+ updateItemInIndexedList(item, forceDefaultValues = false) {
276
+ if (!item || !this.items) {
277
+ return;
278
+ }
279
+ const itemFound = this.getItemById(item.id, this.items);
280
+ if (itemFound) {
281
+ Object.assign(itemFound, forceDefaultValues ? this.applyDefaultValues(item) : item);
282
+ }
283
+ }
284
+ removeItemFromIndexedList(id, items) {
285
+ var _a;
286
+ items = (_a = items !== null && items !== void 0 ? items : this.items) !== null && _a !== void 0 ? _a : [];
287
+ if (!id) {
288
+ return false;
289
+ }
290
+ const rootIndex = items.findIndex(item => item.id === id);
291
+ if (rootIndex !== -1) {
292
+ items.splice(rootIndex, 1);
293
+ return true;
294
+ }
295
+ for (const treeItem of items) {
296
+ if (treeItem.children && Array.isArray(treeItem.children)) {
297
+ const childIndex = treeItem.children.findIndex(child => child.id === id);
298
+ if (childIndex !== -1) {
299
+ treeItem.children.splice(childIndex, 1);
300
+ treeItem.childrenCount = treeItem.children.length;
301
+ return true;
302
+ }
303
+ if (this.removeItemFromIndexedList(id, treeItem.children)) {
304
+ return true;
305
+ }
306
+ }
307
+ }
308
+ return false;
309
+ }
193
310
  getItemPathAttrs({ id, label }) {
194
311
  return { id, label };
195
312
  }
@@ -427,6 +544,24 @@ export class EzTree {
427
544
  "attribute": "enable-hierarchical-filter",
428
545
  "reflect": false,
429
546
  "defaultValue": "true"
547
+ },
548
+ "selectable": {
549
+ "type": "boolean",
550
+ "mutable": false,
551
+ "complexType": {
552
+ "original": "boolean",
553
+ "resolved": "boolean",
554
+ "references": {}
555
+ },
556
+ "required": false,
557
+ "optional": false,
558
+ "docs": {
559
+ "tags": [],
560
+ "text": "Define se os itens da \u00E1rvore s\u00E3o selecion\u00E1veis."
561
+ },
562
+ "attribute": "selectable",
563
+ "reflect": false,
564
+ "defaultValue": "true"
430
565
  }
431
566
  };
432
567
  }
@@ -497,6 +632,21 @@ export class EzTree {
497
632
  }
498
633
  }
499
634
  }
635
+ }, {
636
+ "method": "ezRemoveItem",
637
+ "name": "ezRemoveItem",
638
+ "bubbles": true,
639
+ "cancelable": true,
640
+ "composed": true,
641
+ "docs": {
642
+ "tags": [],
643
+ "text": "Emitido ao remover um item da \u00E1rvore."
644
+ },
645
+ "complexType": {
646
+ "original": "string",
647
+ "resolved": "string",
648
+ "references": {}
649
+ }
500
650
  }];
501
651
  }
502
652
  static get methods() {
@@ -662,10 +812,13 @@ export class EzTree {
662
812
  },
663
813
  "updateItem": {
664
814
  "complexType": {
665
- "signature": "(item: ITreeItem) => Promise<void>",
815
+ "signature": "(item: ITreeItem | ITreeItem[], config?: Partial<UpdateItemConfig>) => Promise<void>",
666
816
  "parameters": [{
667
817
  "tags": [],
668
818
  "text": ""
819
+ }, {
820
+ "tags": [],
821
+ "text": ""
669
822
  }],
670
823
  "references": {
671
824
  "Promise": {
@@ -674,6 +827,13 @@ export class EzTree {
674
827
  "ITreeItem": {
675
828
  "location": "import",
676
829
  "path": "./interfaces/ITreeItem"
830
+ },
831
+ "Partial": {
832
+ "location": "global"
833
+ },
834
+ "UpdateItemConfig": {
835
+ "location": "import",
836
+ "path": "./types/UpdateItemConfig"
677
837
  }
678
838
  },
679
839
  "return": "Promise<void>"
@@ -683,6 +843,25 @@ export class EzTree {
683
843
  "tags": []
684
844
  }
685
845
  },
846
+ "removeItem": {
847
+ "complexType": {
848
+ "signature": "(id?: string) => Promise<void>",
849
+ "parameters": [{
850
+ "tags": [],
851
+ "text": ""
852
+ }],
853
+ "references": {
854
+ "Promise": {
855
+ "location": "global"
856
+ }
857
+ },
858
+ "return": "Promise<void>"
859
+ },
860
+ "docs": {
861
+ "text": "Remove um item da \u00E1rvore pelo seu ID.\nSe o item removido estiver selecionado, a sele\u00E7\u00E3o ser\u00E1 limpa.",
862
+ "tags": []
863
+ }
864
+ },
686
865
  "getItem": {
687
866
  "complexType": {
688
867
  "signature": "(id: string) => Promise<ITreeItem>",
@@ -20,12 +20,15 @@ export const TreeItem = (props) => {
20
20
  iconClick(treeItem);
21
21
  }
22
22
  }
23
+ function handleIconDoubleClick(event) {
24
+ event.stopPropagation();
25
+ }
23
26
  return (h("ul", { class: level === 1 ? "first-level" : undefined }, h("li", Object.assign({ title: tooltipResolver(treeItem, !disabled, level), class: `tree-item ${treeItem.id !== selectedId ? "tree-item-error" : ""}`, onClick: () => available && itemClick(treeItem), onDblClick: () => available && itemDoubleClick(treeItem) }, {
24
27
  disabled,
25
28
  selected: treeItem.id === selectedId,
26
29
  [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezTreeItem_${treeItem.id}`)
27
30
  }), h("div", { class: "item-label-container" }, h("div", { class: "item-icon-box" }, expandable &&
28
- h("ez-icon", { id: treeItem.id, class: "item-icon", size: "small", iconName: iconResolver(treeItem, expanded, level), onClick: (event) => handleIconClick(event) })), h("label", { class: `item-label ${treeItem.bold ? "item-label--bold" : ""}` }, treeItem.label)), getBadgeElement(treeItem.id, treeItem.badge, treeItem.id === selectedId)), expanded
31
+ h("ez-icon", { id: treeItem.id, class: "item-icon", size: "small", iconName: iconResolver(treeItem, expanded, level), onClick: (event) => handleIconClick(event), onDblClick: (event) => handleIconDoubleClick(event) })), h("label", { class: `item-label ${treeItem.bold ? "item-label--bold" : ""}` }, treeItem.label)), getBadgeElement(treeItem.id, treeItem.badge, treeItem.id === selectedId)), expanded
29
32
  && node.getChildren().map(child => h(TreeItem, { selectedId: selectedId, node: child, itemClick: itemClick, iconClick: iconClick, level: level + 1, iconResolver: iconResolver, tooltipResolver: tooltipResolver, itemsList: itemsList, itemDoubleClick: itemDoubleClick }))));
30
33
  };
31
34
  function getBadgeElement(itemId, badge, isSelectedItem) {
@@ -69,6 +69,13 @@ export class Node {
69
69
  this.children.set(item.id, new Node(tree, item, this));
70
70
  }
71
71
  }
72
+ removeChild(id) {
73
+ if (this.children.has(id)) {
74
+ this.children.delete(id);
75
+ return true;
76
+ }
77
+ return false;
78
+ }
72
79
  addPlaceHolder() {
73
80
  this.children.clear();
74
81
  const id = this.item.id;
@@ -9,6 +9,8 @@ export class Tree extends Node {
9
9
  async addChildAt(parentId, item) {
10
10
  const parent = this.getNode(parentId);
11
11
  if (parent == undefined) {
12
+ this.addChild(this, item);
13
+ this._changeCallback();
12
14
  return;
13
15
  }
14
16
  parent.addChild(this, item);
@@ -72,6 +74,23 @@ export class Tree extends Node {
72
74
  }
73
75
  this._changeCallback();
74
76
  }
77
+ removeItem(id) {
78
+ if (!id) {
79
+ return;
80
+ }
81
+ const node = this.getNode(id);
82
+ if (!node) {
83
+ return;
84
+ }
85
+ if (node.parent) {
86
+ node.parent.removeChild(id);
87
+ }
88
+ else {
89
+ this.children.delete(id);
90
+ }
91
+ this._disabledValues.delete(id);
92
+ this._changeCallback();
93
+ }
75
94
  async open(path) {
76
95
  return new Promise(async (resolve) => {
77
96
  await this.walkPath(this, path, node => node.item.expanded = true);
@@ -120,7 +120,7 @@ export default class DataBinder {
120
120
  clearFieldError(fieldName) {
121
121
  var _a;
122
122
  const field = (_a = this._fields.get(fieldName)) === null || _a === void 0 ? void 0 : _a.field;
123
- if (field["errorMessage"]) {
123
+ if (field && field["errorMessage"]) {
124
124
  field["errorMessage"] = "";
125
125
  this._dataUnit.clearInvalid(this.getCurrentRecordId(), fieldName);
126
126
  }
@@ -91,14 +91,23 @@ function handleDetailTabs(dataUnit, config, sheets) {
91
91
  function handleCustomTabs(customGuides, config, sheets) {
92
92
  customGuides.forEach((guide) => {
93
93
  const tabConfig = getTabFromConfig(guide.label, config);
94
+ const ctxProps = {};
95
+ Object.entries(guide).forEach(([key, value]) => {
96
+ if (!isReservedKey(key)) {
97
+ ctxProps[key] = value;
98
+ }
99
+ });
94
100
  if (tabConfig) {
95
- sheets.set(Object.assign(tabConfig, { name: guide.id, isCustom: true }), []);
101
+ sheets.set(Object.assign(tabConfig, { name: guide.id, isCustom: true, ctxProps }), []);
96
102
  return;
97
103
  }
98
- const sheet = { label: guide.label, name: guide.id, isCustom: true, visible: true };
104
+ const sheet = { label: guide.label, name: guide.id, isCustom: true, visible: true, ctxProps };
99
105
  sheets.set(sheet, []);
100
106
  });
101
107
  }
108
+ function isReservedKey(key) {
109
+ return ['id', 'label'].includes(key);
110
+ }
102
111
  function parseTabToFormSheet(key, fields) {
103
112
  const i18n = getI18n();
104
113
  return {
@@ -106,6 +115,7 @@ function parseTabToFormSheet(key, fields) {
106
115
  name: key.name || key.label,
107
116
  isCustom: key.isCustom,
108
117
  isDetail: key.isDetail,
118
+ ctxProps: key.ctxProps,
109
119
  fields
110
120
  };
111
121
  }
@@ -30,6 +30,14 @@ export default {
30
30
  uploadErrorTitle: "Uploading file",
31
31
  uploadingMessage: "Files are being uploaded. Please wait for completion or cancel the upload."
32
32
  },
33
+ "ez-image-input": {
34
+ defaultLabel: "Upload Image",
35
+ imageAlt: "Uploaded image",
36
+ removeImage: "Remove image",
37
+ invalidFileType: "The selected file is not a valid image.",
38
+ fileTooLarge: "The image must be less than {{maxSize}}.",
39
+ imagePreview: "Image Preview",
40
+ },
33
41
  "ez-calendar": {
34
42
  month: {
35
43
  0: "January",
@@ -30,6 +30,14 @@ export default {
30
30
  uploadErrorTitle: "Subiendo archivo",
31
31
  uploadingMessage: "Se están subiendo archivos. Por favor, espere a que se complete o cancele la subida.",
32
32
  },
33
+ "ez-image-input": {
34
+ defaultLabel: "Subir Imagen",
35
+ imageAlt: "Imagen cargada",
36
+ removeImage: "Eliminar imagen",
37
+ invalidFileType: "El archivo seleccionado no es una imagen válida.",
38
+ fileTooLarge: "La imagen debe tener menos de {{maxSize}}.",
39
+ imagePreview: "Vista Previa de Imagen",
40
+ },
33
41
  "ez-calendar": {
34
42
  month: {
35
43
  0: "Enero",