@sankhyalabs/ezui 3.0.3 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/dist/cjs/{ApplicationUtils-350ac2ff.js → ApplicationUtils-1eef635f.js} +8 -4
  2. package/dist/cjs/constants-5a75e2f3.js +5 -0
  3. package/dist/cjs/ez-actions-button.cjs.entry.js +2 -2
  4. package/dist/cjs/ez-alert.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-application.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-breadcrumb.cjs.entry.js +263 -9
  7. package/dist/cjs/ez-button.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-check.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -2
  13. package/dist/cjs/ez-combo-box.cjs.entry.js +95 -11
  14. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  16. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  17. package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
  18. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  19. package/dist/cjs/ez-filter-input_4.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-form-view.cjs.entry.js +3 -2
  21. package/dist/cjs/ez-form.cjs.entry.js +2 -2
  22. package/dist/cjs/ez-grid.cjs.entry.js +1 -1
  23. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  24. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  25. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  26. package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  28. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  29. package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
  30. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  31. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  32. package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
  33. package/dist/cjs/ez-search.cjs.entry.js +1 -1
  34. package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
  36. package/dist/cjs/ez-text-edit.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-toast.cjs.entry.js +11 -3
  40. package/dist/cjs/ez-upload.cjs.entry.js +2 -2
  41. package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
  42. package/dist/cjs/ezui.cjs.js +2 -2
  43. package/dist/cjs/{index-892780f1.js → index-b54f47a1.js} +5 -0
  44. package/dist/cjs/loader.cjs.js +2 -2
  45. package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.css +10 -1
  46. package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.js +291 -9
  47. package/dist/collection/components/ez-breadcrumb/subcomponents/breadcrumb-item.js +31 -0
  48. package/dist/collection/components/ez-combo-box/ez-combo-box.js +93 -9
  49. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +2 -1
  50. package/dist/collection/components/ez-toast/ez-toast.css +1 -1
  51. package/dist/collection/components/ez-toast/ez-toast.js +9 -1
  52. package/dist/collection/utils/ApplicationUtils.js +8 -4
  53. package/dist/collection/utils/constants.js +1 -0
  54. package/dist/custom-elements/index.js +377 -26
  55. package/dist/esm/{ApplicationUtils-9fda4796.js → ApplicationUtils-79bf1d95.js} +8 -4
  56. package/dist/esm/constants-ca136201.js +3 -0
  57. package/dist/esm/ez-actions-button.entry.js +2 -2
  58. package/dist/esm/ez-alert.entry.js +1 -1
  59. package/dist/esm/ez-application.entry.js +1 -1
  60. package/dist/esm/ez-breadcrumb.entry.js +264 -10
  61. package/dist/esm/ez-button.entry.js +1 -1
  62. package/dist/esm/ez-calendar.entry.js +1 -1
  63. package/dist/esm/ez-card-item.entry.js +1 -1
  64. package/dist/esm/ez-check.entry.js +1 -1
  65. package/dist/esm/ez-chip.entry.js +1 -1
  66. package/dist/esm/ez-collapsible-box.entry.js +2 -2
  67. package/dist/esm/ez-combo-box.entry.js +95 -11
  68. package/dist/esm/ez-date-input.entry.js +1 -1
  69. package/dist/esm/ez-date-time-input.entry.js +1 -1
  70. package/dist/esm/ez-dialog.entry.js +1 -1
  71. package/dist/esm/ez-dropdown.entry.js +1 -1
  72. package/dist/esm/ez-file-item.entry.js +1 -1
  73. package/dist/esm/ez-filter-input_4.entry.js +1 -1
  74. package/dist/esm/ez-form-view.entry.js +3 -2
  75. package/dist/esm/ez-form.entry.js +2 -2
  76. package/dist/esm/ez-grid.entry.js +1 -1
  77. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  78. package/dist/esm/ez-icon.entry.js +1 -1
  79. package/dist/esm/ez-list.entry.js +1 -1
  80. package/dist/esm/ez-loading-bar.entry.js +1 -1
  81. package/dist/esm/ez-modal-container.entry.js +1 -1
  82. package/dist/esm/ez-modal.entry.js +1 -1
  83. package/dist/esm/ez-number-input.entry.js +1 -1
  84. package/dist/esm/ez-popover.entry.js +1 -1
  85. package/dist/esm/ez-popup.entry.js +1 -1
  86. package/dist/esm/ez-radio-button.entry.js +1 -1
  87. package/dist/esm/ez-search.entry.js +1 -1
  88. package/dist/esm/ez-tabselector.entry.js +1 -1
  89. package/dist/esm/ez-text-area.entry.js +1 -1
  90. package/dist/esm/ez-text-edit.entry.js +2 -2
  91. package/dist/esm/ez-text-input.entry.js +1 -1
  92. package/dist/esm/ez-time-input.entry.js +1 -1
  93. package/dist/esm/ez-toast.entry.js +11 -3
  94. package/dist/esm/ez-upload.entry.js +2 -2
  95. package/dist/esm/ez-view-stack.entry.js +1 -1
  96. package/dist/esm/ezui.js +3 -3
  97. package/dist/esm/{index-de655f48.js → index-c27164d3.js} +5 -0
  98. package/dist/esm/loader.js +3 -3
  99. package/dist/ezui/ezui.esm.js +1 -1
  100. package/dist/ezui/{p-7ffd12e7.js → p-00ea9b50.js} +2 -2
  101. package/dist/ezui/{p-0c7e81fe.entry.js → p-044a3427.entry.js} +1 -1
  102. package/dist/ezui/{p-6818dd0a.entry.js → p-064e558f.entry.js} +1 -1
  103. package/dist/ezui/{p-c98e571a.entry.js → p-0f76448d.entry.js} +1 -1
  104. package/dist/ezui/{p-36f7ec68.entry.js → p-124859c3.entry.js} +1 -1
  105. package/dist/ezui/{p-9613fae6.entry.js → p-149442dd.entry.js} +1 -1
  106. package/dist/ezui/{p-493e2af4.entry.js → p-1806b3c6.entry.js} +1 -1
  107. package/dist/ezui/{p-37b4bf04.entry.js → p-1a1c2eda.entry.js} +1 -1
  108. package/dist/ezui/{p-eceb9382.entry.js → p-1cfae451.entry.js} +1 -1
  109. package/dist/ezui/{p-07b99b94.entry.js → p-216e1153.entry.js} +1 -1
  110. package/dist/ezui/{p-1b95836f.entry.js → p-2c5f1107.entry.js} +1 -1
  111. package/dist/ezui/{p-fcf6cf57.entry.js → p-2d16e8c2.entry.js} +1 -1
  112. package/dist/ezui/p-30afcb93.entry.js +1 -0
  113. package/dist/ezui/{p-a323b415.entry.js → p-330aef41.entry.js} +1 -1
  114. package/dist/ezui/p-3f4ae3a3.js +1 -0
  115. package/dist/ezui/p-51ecf138.entry.js +1 -0
  116. package/dist/ezui/{p-f670bd32.entry.js → p-52e5cc09.entry.js} +1 -1
  117. package/dist/ezui/{p-c0184982.entry.js → p-66dba09c.entry.js} +1 -1
  118. package/dist/ezui/p-68acdc61.entry.js +1 -0
  119. package/dist/ezui/{p-4bfed869.entry.js → p-74379544.entry.js} +1 -1
  120. package/dist/ezui/{p-b1e4ccf4.entry.js → p-74b3615b.entry.js} +1 -1
  121. package/dist/ezui/{p-db131605.entry.js → p-77d70bae.entry.js} +1 -1
  122. package/dist/ezui/{p-600f1732.entry.js → p-78b28632.entry.js} +1 -1
  123. package/dist/ezui/{p-a4b281ca.entry.js → p-7ff5d0cc.entry.js} +1 -1
  124. package/dist/ezui/{p-cc5cfcb7.entry.js → p-80f79b1c.entry.js} +1 -1
  125. package/dist/ezui/{p-06b3e801.entry.js → p-85c1e00f.entry.js} +1 -1
  126. package/dist/ezui/{p-c1300e84.entry.js → p-8f1a5e21.entry.js} +1 -1
  127. package/dist/ezui/p-90c3d4fd.entry.js +1 -0
  128. package/dist/ezui/{p-b941aeee.entry.js → p-936ae3ac.entry.js} +1 -1
  129. package/dist/ezui/{p-b3c7b243.entry.js → p-93c8bdc6.entry.js} +1 -1
  130. package/dist/ezui/p-a0e47238.entry.js +1 -0
  131. package/dist/ezui/{p-86d29565.entry.js → p-aaba630e.entry.js} +1 -1
  132. package/dist/ezui/{p-62481744.entry.js → p-bb011a51.entry.js} +1 -1
  133. package/dist/ezui/{p-fd87638e.entry.js → p-bb0607a6.entry.js} +1 -1
  134. package/dist/ezui/{p-b405d9b6.entry.js → p-bf442859.entry.js} +1 -1
  135. package/dist/ezui/{p-8ca4750d.entry.js → p-bfca509e.entry.js} +1 -1
  136. package/dist/ezui/{p-82db6de7.entry.js → p-cd1e0679.entry.js} +1 -1
  137. package/dist/ezui/{p-cc40fcb3.entry.js → p-ce1408dd.entry.js} +1 -1
  138. package/dist/ezui/{p-1581fece.entry.js → p-dd13d0e6.entry.js} +1 -1
  139. package/dist/ezui/{p-a67e056f.entry.js → p-e6cf82e8.entry.js} +1 -1
  140. package/dist/ezui/{p-695facd0.entry.js → p-e8271a0e.entry.js} +1 -1
  141. package/dist/ezui/p-efb43dd8.js +1 -0
  142. package/dist/types/components/ez-breadcrumb/ez-breadcrumb.d.ts +52 -2
  143. package/dist/types/components/ez-breadcrumb/subcomponents/breadcrumb-item.d.ts +13 -0
  144. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +10 -0
  145. package/dist/types/components/ez-toast/ez-toast.d.ts +1 -0
  146. package/dist/types/components.d.ts +25 -1
  147. package/dist/types/utils/ApplicationUtils.d.ts +4 -4
  148. package/dist/types/utils/constants.d.ts +1 -0
  149. package/package.json +1 -1
  150. package/dist/ezui/p-69a913b8.js +0 -1
  151. package/dist/ezui/p-a8c7355e.entry.js +0 -1
  152. package/dist/ezui/p-ada6e6b0.entry.js +0 -1
  153. package/dist/ezui/p-d6dd32b2.entry.js +0 -1
  154. package/dist/ezui/p-e0d756d9.entry.js +0 -1
  155. package/dist/ezui/p-f18d39e6.entry.js +0 -1
@@ -1,6 +1,6 @@
1
1
  import { HTMLElement as HTMLElement$1, createEvent, h, Host, forceUpdate, proxyCustomElement } from '@stencil/core/internal/client';
2
2
  export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
3
- import { FloatingManager, ElementIDUtils, StringUtils as StringUtils$1, DateUtils as DateUtils$1, TimeFormatter, ObjectUtils as ObjectUtils$1, Action, WaitingChangeException, ApplicationContext, UserInterface, DataUnitAction, DataUnit, NumberUtils as NumberUtils$1, DataType, SortMode, JSUtils, MaskFormatter } from '@sankhyalabs/core';
3
+ import { FloatingManager, ElementIDUtils, JSUtils, StringUtils as StringUtils$1, DateUtils as DateUtils$1, TimeFormatter, ObjectUtils as ObjectUtils$1, Action, WaitingChangeException, ApplicationContext, UserInterface, DataUnitAction, DataUnit, NumberUtils as NumberUtils$1, DataType, SortMode, MaskFormatter } from '@sankhyalabs/core';
4
4
 
5
5
  var DialogType;
6
6
  (function (DialogType) {
@@ -40,13 +40,17 @@ class ApplicationUtils {
40
40
  return ApplicationUtils.showDialog(title, message, icon, false, DialogType.DEFAULT, options);
41
41
  }
42
42
  static async info(message, options = ApplicationUtils.defaultMessageOptions) {
43
+ if (options !== ApplicationUtils.defaultMessageOptions) {
44
+ options = Object.assign(Object.assign({}, ApplicationUtils.defaultMessageOptions), options);
45
+ }
46
+ let useIcon = false;
43
47
  let toast = document.querySelector("ez-toast");
44
48
  if (!toast) {
45
49
  toast = document.createElement("ez-toast");
46
50
  const icon = document.createElement("ez-icon");
47
51
  icon.className = "ez-margin-right--small";
48
52
  icon.slot = "icon";
49
- icon.style.setProperty('--ez-icon--color', 'var(--color--success)');
53
+ icon.style.setProperty("--ez-icon--color", "var(--color--success)");
50
54
  toast.appendChild(icon);
51
55
  window.document.body.appendChild(toast);
52
56
  }
@@ -54,13 +58,13 @@ class ApplicationUtils {
54
58
  const iconElem = toast.querySelector("ez-icon");
55
59
  if (iconElem) {
56
60
  iconElem.iconName = options.iconName;
57
- toast.useIcon = true;
61
+ useIcon = true;
58
62
  }
59
63
  }
60
64
  else {
61
- toast.useIcon = false;
65
+ useIcon = false;
62
66
  }
63
- toast.show(message, 5000, false, options.canClose);
67
+ toast.show(message, 5000, useIcon, options.canClose);
64
68
  }
65
69
  }
66
70
  ApplicationUtils.defaultMessageOptions = {
@@ -390,29 +394,283 @@ const EzApplication$1 = class extends HTMLElement$1 {
390
394
  static get style() { return ezApplicationCss; }
391
395
  };
392
396
 
393
- const ezBreadcrumbCss = ":host{--breadcrumb__item--label--color--title-primary:var(--color--title-primary, #2B3A54);--breadcrumb__item--label--color--active:var(--color--primary, '#008561');--breadcrumb__item--label--font-weight:var(--text-weight--large, 600);display:block;font-size:var(--text--medium, 14px);font-family:var(--font-pattern, \"Roboto\");font-weight:var(--text-weight--medium, 400)}.breadcrumb__list{list-style-type:none;display:inline-block;margin:0;padding:0}.breadcrumb__item{display:inline-flex;align-items:center;cursor:pointer}.breadcrumb__item--label{color:var(--breadcrumb__item--label--color--title-primary);margin:0px}.breadcrumb__item--icon{padding-right:3px;color:var(--breadcrumb__item--label--color--title-primary)}.breadcrumb__item--chevron{padding:0px 6px;cursor:default}.active{color:var(--breadcrumb__item--label--color--active);font-weight:var(--breadcrumb__item--label--font-weight);cursor:default}.active-icon{--icon--color:var(--breadcrumb__item--label--color--active);cursor:default}";
397
+ const BreadcrumbItem = (props) => {
398
+ const { items, selectedItem, itemsHidden, showDropdown, handleShowDropdown, collapseConfigPosition, ellipsesPositionedEnd } = props;
399
+ const formatDropdownItems = () => {
400
+ return itemsHidden.map((item) => ({
401
+ id: item.id,
402
+ label: item.label,
403
+ type: 'item',
404
+ children: null,
405
+ iconName: item.iconName || null,
406
+ subAction: null,
407
+ group: null
408
+ }));
409
+ };
410
+ const onClickEllipsis = (evt) => {
411
+ evt.stopPropagation();
412
+ handleShowDropdown(!showDropdown);
413
+ };
414
+ const createEllipsis = (item) => {
415
+ return (h("li", Object.assign({ class: "breadcrumb__item", onClick: evt => onClickEllipsis(evt) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezBreadcrumbItem_ellipsis`) }),
416
+ ellipsesPositionedEnd && h("ez-icon", Object.assign({ class: "breadcrumb__item--chevron", size: "small", iconName: "chevron-right" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`iconPath${item.id}`)}` })),
417
+ h("span", { class: "ellipses__item" }, "..."),
418
+ ellipsesPositionedEnd || h("ez-icon", Object.assign({ class: "breadcrumb__item--chevron", size: "small", iconName: "chevron-right" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`iconPath${item.id}`)}` })),
419
+ showDropdown &&
420
+ h("ez-dropdown", Object.assign({ class: "dropdown-ellipsis", items: formatDropdownItems(), onEzClick: (evt) => {
421
+ const { id, label, iconName } = evt.detail;
422
+ selectedItem.emit({ id, label, iconName });
423
+ } }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("dropdown")}` }))));
424
+ };
425
+ return (h("div", { class: "breadcrumb__items" }, items.map((item, index) => {
426
+ const isLastItem = index === (items.length - 1);
427
+ return (h("div", { class: "breadcrumb__group" },
428
+ collapseConfigPosition === index && createEllipsis(item),
429
+ h("li", Object.assign({ class: "breadcrumb__item", id: item.id }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezBreadcrumb_item_${item.id}_${item.label}`) }),
430
+ item.iconName && h("ez-icon", Object.assign({ class: `breadcrumb__item--icon ${(isLastItem && !ellipsesPositionedEnd) ? 'active-icon' : ''}`, size: "small", iconName: item.iconName }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`iconItem${item.id}`)}` })),
431
+ h("p", { class: `breadcrumb__item--label ${(isLastItem && !ellipsesPositionedEnd) ? 'active' : ''}`, onClick: (ellipsesPositionedEnd || !isLastItem) ? () => selectedItem.emit(item) : undefined }, item.label),
432
+ !isLastItem && h("ez-icon", Object.assign({ class: "breadcrumb__item--chevron", size: "small", iconName: "chevron-right" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`iconPath${item.id}`)}` }))),
433
+ (collapseConfigPosition - 1 === index && ellipsesPositionedEnd) && createEllipsis(item)));
434
+ })));
435
+ };
436
+
437
+ const ezBreadcrumbCss = ":host{--breadcrumb__item--label--color--title-primary:var(--color--title-primary, #2B3A54);--breadcrumb__item--label--color--active:var(--color--primary, '#008561');--breadcrumb__item--label--font-weight:var(--text-weight--large, 600);display:block;font-size:var(--text--medium, 14px);font-family:var(--font-pattern, \"Roboto\");font-weight:var(--text-weight--medium, 400)}.breadcrumb__group{display:flex}.breadcrumb__list{list-style-type:none;display:inline-block;margin:0;padding:0;overflow:hidden;white-space:nowrap}.breadcrumb__item{display:inline-flex;align-items:center;cursor:pointer}.breadcrumb__item--label{color:var(--breadcrumb__item--label--color--title-primary);margin:0px}.breadcrumb__item--icon{padding-right:3px;color:var(--breadcrumb__item--label--color--title-primary)}.breadcrumb__item--chevron{padding:0px 6px;cursor:default}.active{color:var(--breadcrumb__item--label--color--active);font-weight:var(--breadcrumb__item--label--font-weight);cursor:default}.active-icon{--icon--color:var(--breadcrumb__item--label--color--active);cursor:default}.breadcrumb__items{display:flex}";
394
438
 
395
439
  const EzBreadcrumb$1 = class extends HTMLElement$1 {
396
440
  constructor() {
397
441
  super();
398
442
  this.__registerHost();
399
443
  this.__attachShadow();
400
- this.ezClick = createEvent(this, "ezClick", 7);
444
+ this.selectedItem = createEvent(this, "selectedItem", 7);
445
+ this._ellipsesPositionedEnd = false;
446
+ this._renderSecond = false;
447
+ this.INDEX_ITEM_TO_REMOVE = 1; // sempre removemos o segundo item.
448
+ this.CHEVRON_SIZE = 28;
449
+ this.handleShowDropdown = (newState) => {
450
+ this.showDropdown = newState;
451
+ };
401
452
  this.items = [];
453
+ this.fillMode = "auto";
454
+ this.maxItems = 4;
455
+ this.positionEllipsis = 1;
456
+ this.visibleItems = undefined;
457
+ this.hiddenItems = [];
458
+ this.showDropdown = false;
459
+ this.collapseConfigPosition = -1;
460
+ }
461
+ watchPropHandler() {
462
+ this.fillMode === "auto" && this.handleResize();
463
+ }
464
+ watchPropHiddenItems() {
465
+ if (this.fillMode === 'auto') {
466
+ this.collapseConfigPosition = this.hiddenItems.length > 0 ? 1 : -1;
467
+ }
468
+ }
469
+ componentDidUpdate() {
470
+ this.positionDropdown();
471
+ this.setEvents();
472
+ }
473
+ componentWillLoad() {
474
+ this.visibleItems = [...this.items];
475
+ if (this.fillMode === 'regular') {
476
+ this.configModeRegular();
477
+ }
478
+ else if (this.fillMode === 'auto') {
479
+ this.startResize();
480
+ }
481
+ this.setEvents();
482
+ }
483
+ closeDropdown(evt) {
484
+ const target = evt === null || evt === void 0 ? void 0 : evt.target;
485
+ if (target == undefined) {
486
+ return;
487
+ }
488
+ if (target !== this._element.shadowRoot.querySelector(".ellipses__item")) {
489
+ this.showDropdown = false;
490
+ }
491
+ }
492
+ setEvents() {
493
+ document.removeEventListener("click", this.closeDropdown.bind(this));
494
+ document.addEventListener("click", this.closeDropdown.bind(this));
495
+ document.removeEventListener("scroll", this.positionDropdown.bind(this));
496
+ document.addEventListener("scroll", this.positionDropdown.bind(this));
402
497
  }
403
498
  componentDidLoad() {
404
499
  ElementIDUtils.addIDInfo(this._element);
405
500
  }
406
- handleItemClick(itemSelected) {
407
- this.ezClick.emit(itemSelected);
501
+ componentDidRender() {
502
+ if (this.fillMode === 'auto') {
503
+ this.configResize();
504
+ }
505
+ }
506
+ configResize() {
507
+ if (this._resizeObserver != undefined) {
508
+ this._resizeObserver.unobserve(this._element.parentElement);
509
+ }
510
+ this._resizeObserver = new ResizeObserver(JSUtils.debounce(this.handleResize.bind(this), 200));
511
+ this._resizeObserver.observe(this._element.parentElement);
512
+ }
513
+ handleResize() {
514
+ const ELLIPSIS_SIZE = 39;
515
+ if (!this._renderSecond) {
516
+ this._renderSecond = true;
517
+ return;
518
+ }
519
+ let { offsetWidth } = this._element.parentElement;
520
+ let sumVisibleItems = 0;
521
+ this.visibleItems.forEach(item => sumVisibleItems += item.width);
522
+ //Se existe o ellipsis, devemos cconsidera-lo no calculo
523
+ const offset = this.collapseConfigPosition > -1 ? ELLIPSIS_SIZE : 0;
524
+ if (offsetWidth < sumVisibleItems + offset) {
525
+ this.handleCollapse(offsetWidth, sumVisibleItems);
526
+ }
527
+ else if (offsetWidth >= sumVisibleItems + offset) {
528
+ this.handleExpand(offsetWidth);
529
+ }
530
+ }
531
+ handleCollapse(containerWidth, itemsWidth) {
532
+ const MIN_VISIBLE_ITEMS = 2;
533
+ if (this.visibleItems.length <= MIN_VISIBLE_ITEMS) {
534
+ return;
535
+ }
536
+ let tmpVisibleItems = [...this.visibleItems];
537
+ let tmpHiddenItems = [...this.hiddenItems];
538
+ let secondItem = tmpVisibleItems[this.INDEX_ITEM_TO_REMOVE];
539
+ let hasChange = false;
540
+ while (tmpVisibleItems.length > MIN_VISIBLE_ITEMS &&
541
+ secondItem != undefined &&
542
+ itemsWidth > containerWidth) {
543
+ hasChange = true;
544
+ tmpVisibleItems = tmpVisibleItems.filter((_, index) => index !== this.INDEX_ITEM_TO_REMOVE);
545
+ tmpHiddenItems = [...tmpHiddenItems, secondItem];
546
+ itemsWidth -= secondItem.width;
547
+ secondItem = tmpVisibleItems[this.INDEX_ITEM_TO_REMOVE];
548
+ }
549
+ if (hasChange) {
550
+ this.visibleItems = tmpVisibleItems;
551
+ this.hiddenItems = tmpHiddenItems;
552
+ this.showDropdown = false;
553
+ }
554
+ }
555
+ handleExpand(containerWidth) {
556
+ if (!this.hiddenItems.length) {
557
+ return;
558
+ }
559
+ let widthFreeZone = Math.abs(this._elBreadcrumbList.offsetWidth - containerWidth);
560
+ let tmpVisibleItems = [...this.visibleItems];
561
+ let tmpHiddenItems = [...this.hiddenItems];
562
+ let lastHiddenElement = tmpHiddenItems[tmpHiddenItems.length - 1];
563
+ let hasChange = false;
564
+ while (lastHiddenElement && widthFreeZone >= lastHiddenElement.width) {
565
+ widthFreeZone -= lastHiddenElement.width;
566
+ tmpHiddenItems.pop();
567
+ tmpVisibleItems.splice(this.INDEX_ITEM_TO_REMOVE, 0, lastHiddenElement);
568
+ lastHiddenElement = tmpHiddenItems[tmpHiddenItems.length - 1];
569
+ hasChange = true;
570
+ }
571
+ if (hasChange) {
572
+ this.visibleItems = tmpVisibleItems;
573
+ this.hiddenItems = tmpHiddenItems;
574
+ this.showDropdown = false;
575
+ }
576
+ }
577
+ configModeRegular() {
578
+ if (this.visibleItems.length > this.maxItems) {
579
+ const amountsItemsToHide = Math.abs(this.visibleItems.length - this.maxItems);
580
+ if (this.positionEllipsis === 0) {
581
+ const itemsToTransfer = this.visibleItems.slice(0, amountsItemsToHide);
582
+ this.hiddenItems.push(...itemsToTransfer);
583
+ this.visibleItems.splice(0, amountsItemsToHide);
584
+ }
585
+ else if (this.positionEllipsis >= this.maxItems) {
586
+ const itemsToTransfer = this.visibleItems.slice(this.maxItems);
587
+ this.hiddenItems.push(...itemsToTransfer);
588
+ this.visibleItems.splice(this.maxItems);
589
+ this._ellipsesPositionedEnd = true;
590
+ }
591
+ else {
592
+ const removedItems = this.visibleItems.splice(this.positionEllipsis, amountsItemsToHide);
593
+ this.hiddenItems.push(...removedItems);
594
+ }
595
+ this.collapseConfigPosition = this.positionEllipsis;
596
+ }
597
+ }
598
+ positionDropdown() {
599
+ var _a;
600
+ const bounding = (_a = this._element.shadowRoot.querySelector(".ellipses__item")) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
601
+ const elDropdown = this._element.shadowRoot.querySelector(".dropdown-ellipsis");
602
+ if (bounding == undefined || elDropdown == undefined) {
603
+ return;
604
+ }
605
+ elDropdown.style.top = (bounding.y + bounding.height + 5) + "px";
606
+ elDropdown.style.left = bounding.x + "px";
607
+ }
608
+ ;
609
+ async startResize() {
610
+ const areaAvailable = this._element.parentElement.offsetWidth;
611
+ const ELLIPSIS_SIZE = 10;
612
+ const measureItemSize = async (item, index) => {
613
+ item.width = await this.measureSizeHTMLElement(item);
614
+ /*
615
+ Se é o ultimo item, desconsideramos o icone CHEVRON
616
+ */
617
+ if (index === this.visibleItems.length - 1) {
618
+ item.width -= this.CHEVRON_SIZE;
619
+ }
620
+ return item;
621
+ };
622
+ const measuredItems = await Promise.all(this.visibleItems.map(measureItemSize));
623
+ const sizeBreadcrumb = measuredItems.reduce((total, item) => total + item.width, 0);
624
+ if (sizeBreadcrumb > areaAvailable) {
625
+ const tempItemsVisible = [];
626
+ const tempItemsHidden = [...measuredItems];
627
+ const firstItem = tempItemsHidden.shift();
628
+ const lastItem = tempItemsHidden.pop();
629
+ lastItem.width += ELLIPSIS_SIZE;
630
+ tempItemsVisible.push(firstItem, lastItem);
631
+ let sizeTempItemsHiddenResult = tempItemsVisible.reduce((total, item) => total + item.width, 0);
632
+ let newAreaAvailable = Math.abs(sizeTempItemsHiddenResult - areaAvailable);
633
+ tempItemsHidden.reverse().forEach((item) => {
634
+ if (item.width < newAreaAvailable) {
635
+ const firstItemForListHidden = tempItemsHidden.shift();
636
+ tempItemsVisible.splice(1, 0, firstItemForListHidden);
637
+ sizeTempItemsHiddenResult = tempItemsVisible.reduce((total, item) => total + item.width, 0);
638
+ newAreaAvailable = Math.abs(sizeTempItemsHiddenResult - areaAvailable);
639
+ }
640
+ });
641
+ this.visibleItems = [...tempItemsVisible];
642
+ this.hiddenItems = [...tempItemsHidden.reverse()];
643
+ }
644
+ }
645
+ measureSizeHTMLElement(item) {
646
+ return new Promise((resolve) => {
647
+ const ICON_SIZE = 19;
648
+ this.waitFontLoad().then(() => {
649
+ if (this._textMesurement === undefined) {
650
+ this._textMesurement = this._element.shadowRoot.ownerDocument.createElement("canvas");
651
+ }
652
+ const context = this._textMesurement.getContext("2d");
653
+ context.font = "14px Roboto, Algerian";
654
+ resolve((item.iconName ? ICON_SIZE : 0) + this.CHEVRON_SIZE + context.measureText(item.label).width);
655
+ });
656
+ });
657
+ }
658
+ waitFontLoad() {
659
+ return new Promise((resolve) => {
660
+ document.fonts.load("14px Roboto").then(() => resolve(), resolve());
661
+ });
662
+ }
663
+ getItemContent() {
664
+ return (h("nav", { class: "breadcrumb" }, h("ol", { class: "breadcrumb__list", ref: elem => this._elBreadcrumbList = elem }, h(BreadcrumbItem, { items: this.visibleItems, selectedItem: this.selectedItem, itemsHidden: this.hiddenItems, showDropdown: this.showDropdown, handleShowDropdown: this.handleShowDropdown, collapseConfigPosition: this.collapseConfigPosition, ellipsesPositionedEnd: this._ellipsesPositionedEnd }))));
408
665
  }
409
666
  render() {
410
- return (h("nav", { class: "breadcrumb" }, h("ol", { class: "breadcrumb__list" }, this.items.map((item, index) => {
411
- const isLastItem = index === (this.items.length - 1);
412
- return (h("li", Object.assign({ class: "breadcrumb__item", id: item.id }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezBreadcrumbItem_${item.id}`) }), item.iconName && h("ez-icon", Object.assign({ class: `breadcrumb__item--icon ${isLastItem ? 'active-icon' : ''}`, size: "small", iconName: item.iconName }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`iconItem${item.id}`)}` })), h("p", { class: `breadcrumb__item--label ${isLastItem ? 'active' : ''}`, onClick: !isLastItem ? () => this.handleItemClick(item) : undefined }, item.label), !isLastItem && h("ez-icon", Object.assign({ class: "breadcrumb__item--chevron", size: "small", iconName: "chevron-right" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`iconPath${item.id}`)}` }))));
413
- }))));
667
+ return this.getItemContent();
414
668
  }
415
669
  get _element() { return this; }
670
+ static get watchers() { return {
671
+ "items": ["watchPropHandler"],
672
+ "hiddenItems": ["watchPropHiddenItems"]
673
+ }; }
416
674
  static get style() { return ezBreadcrumbCss; }
417
675
  };
418
676
 
@@ -1041,6 +1299,8 @@ const EzCollapsibleBox$1 = class extends HTMLElement$1 {
1041
1299
  static get style() { return ezCollapsibleBoxCss; }
1042
1300
  };
1043
1301
 
1302
+ const REQUIRED_INFO = " (obrigatório) *";
1303
+
1044
1304
  const ezComboBoxCss = ":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box--line-height:calc(var(--text--medium, 14px) + 4px);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn--color:var(--title--primary, #2B3A54);--ez-combo-box__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-hover--color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #2B3A54);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium) + 4px);--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-combo-box__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-combo-box__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-combo-box__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-combo-box__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small) + 9px);background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-combo-box__scrollbar--color-clicked) var(--ez-combo-box__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__scrollbar--color-background);width:var(--ez-combo-box__scrollbar--width);max-width:var(--ez-combo-box__scrollbar--width);min-width:var(--ez-combo-box__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__scrollbar--color-background);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__scrollbar--color-default);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-combo-box__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-combo-box__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size);line-height:var(--ez-combo-box--line-height)}.item__label{font-weight:var(--ez-combo-box--font-weight--medium)}.item__label--bold{font-weight:var(--ez-combo-box--font-weight--large)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-combo-box__list-height)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:hover{color:var(--ez-combo-box__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
1045
1305
 
1046
1306
  const EzComboBox$1 = class extends HTMLElement$1 {
@@ -1055,6 +1315,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
1055
1315
  this._maxWidthValue = 0;
1056
1316
  this._tabPressed = false;
1057
1317
  this._textEmptyList = "Nenhum resultado encontrado";
1318
+ this._textEmptySearch = "Nenhum resultado de {0} encontrado";
1058
1319
  this._preSelection = undefined;
1059
1320
  this._visibleOptions = undefined;
1060
1321
  this._startLoading = false;
@@ -1084,15 +1345,14 @@ const EzComboBox$1 = class extends HTMLElement$1 {
1084
1345
  }
1085
1346
  }
1086
1347
  observeValue(newValue, oldValue) {
1087
- var _a, _b, _c, _d;
1088
1348
  if (this._textInput && newValue != oldValue) {
1089
1349
  const newValueSelected = this.getSelectedOption(newValue);
1090
1350
  const oldValueSelected = this.getSelectedOption(oldValue);
1091
1351
  const currentValue = this.getSelectedOption(this.value);
1092
- if (((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) != ((_b = newValueSelected === null || newValueSelected === void 0 ? void 0 : newValueSelected.value) === null || _b === void 0 ? void 0 : _b.toString())) {
1352
+ if (this.isDifferentValues(currentValue, newValueSelected)) {
1093
1353
  this.value = newValueSelected;
1094
1354
  }
1095
- if (((_c = newValueSelected === null || newValueSelected === void 0 ? void 0 : newValueSelected.value) === null || _c === void 0 ? void 0 : _c.toString()) !== ((_d = oldValueSelected === null || oldValueSelected === void 0 ? void 0 : oldValueSelected.value) === null || _d === void 0 ? void 0 : _d.toString())) {
1355
+ if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
1096
1356
  this.setInputValue();
1097
1357
  const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
1098
1358
  this.ezChange.emit(valueEmitted);
@@ -1121,12 +1381,24 @@ const EzComboBox$1 = class extends HTMLElement$1 {
1121
1381
  async isInvalid() {
1122
1382
  return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
1123
1383
  }
1384
+ isDifferentValues(firstValue, secondValue) {
1385
+ return JSON.stringify(firstValue || {}) !== JSON.stringify(secondValue || {});
1386
+ }
1387
+ getFormattedText(currentValue) {
1388
+ if (currentValue == undefined) {
1389
+ return;
1390
+ }
1391
+ if (!this.showSelectedValue || currentValue.value == undefined) {
1392
+ return currentValue.label;
1393
+ }
1394
+ if (!currentValue.label) {
1395
+ return;
1396
+ }
1397
+ return `${currentValue.value} - ${currentValue.label}`;
1398
+ }
1124
1399
  getText() {
1125
- let text = "";
1126
1400
  const currentValue = this.getSelectedOption(this.value);
1127
- if (currentValue) {
1128
- text = this.showSelectedValue ? `${currentValue.value} - ${currentValue.label}` : currentValue.label;
1129
- }
1401
+ const text = this.getFormattedText(currentValue);
1130
1402
  if (text == undefined) {
1131
1403
  return;
1132
1404
  }
@@ -1185,6 +1457,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
1185
1457
  }
1186
1458
  buildItem(opt, index) {
1187
1459
  const widthValue = this.showOptionValue && this._maxWidthValue > 0 ? `${this._maxWidthValue}px` : '';
1460
+ opt.label = opt.label || (opt.value ? `<SEM ${this.getFieldLabel()}>` : "");
1188
1461
  return h("li", { class: index === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.selectOption(opt), onMouseOver: () => this._preSelection = index }, this.showOptionValue
1189
1462
  ? h("span", { class: "item__value", title: opt.value, style: { width: widthValue, minWidth: widthValue, maxWidth: widthValue } }, opt.value)
1190
1463
  : undefined, h("span", { class: "item__label " + (this.showOptionValue ? "item__label--bold" : ""), title: opt.label }, opt.label));
@@ -1320,7 +1593,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
1320
1593
  if ((this._textInput.value || '') !== textValue) {
1321
1594
  this._textInput.value = textValue;
1322
1595
  if (clearError) {
1323
- this.errorMessage = "";
1596
+ this.errorMessage = null;
1324
1597
  }
1325
1598
  }
1326
1599
  }
@@ -1347,6 +1620,71 @@ const EzComboBox$1 = class extends HTMLElement$1 {
1347
1620
  }
1348
1621
  }
1349
1622
  }
1623
+ validateDescriptionValue() {
1624
+ if (!this.searchMode || typeof this.value !== "object") {
1625
+ return;
1626
+ }
1627
+ const { label, value } = this.value || {};
1628
+ if (label || value == undefined) {
1629
+ return;
1630
+ }
1631
+ this.loadDescriptionValue(value);
1632
+ }
1633
+ async loadDescriptionValue(argument) {
1634
+ var _a, _b;
1635
+ if (argument == undefined) {
1636
+ return;
1637
+ }
1638
+ if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1639
+ this.loadOptionValue(argument);
1640
+ return;
1641
+ }
1642
+ const searchArgument = {
1643
+ mode: SearchMode.PREDICTIVE,
1644
+ argument
1645
+ };
1646
+ const source = await ((_b = this.optionLoader) === null || _b === void 0 ? void 0 : _b.call(this, searchArgument));
1647
+ if (source == undefined) {
1648
+ return;
1649
+ }
1650
+ if (source instanceof Promise) {
1651
+ source.then((result) => {
1652
+ this.setDescriptionValue(result);
1653
+ });
1654
+ }
1655
+ else {
1656
+ this.setDescriptionValue(source);
1657
+ }
1658
+ }
1659
+ setDescriptionValue(source) {
1660
+ const value = (source === null || source === void 0 ? void 0 : source[0]) || source;
1661
+ if (value == undefined || !Object.keys(value).length) {
1662
+ this.showNoResultMessage();
1663
+ return;
1664
+ }
1665
+ if (!value.label) {
1666
+ value.label = `<SEM ${this.getFieldLabel()}>`;
1667
+ }
1668
+ this.value = value;
1669
+ }
1670
+ loadOptionValue(argument) {
1671
+ var _a;
1672
+ const source = (_a = this.options) === null || _a === void 0 ? void 0 : _a.find((opt) => opt.value === argument);
1673
+ if (source != undefined) {
1674
+ this.selectOption(source);
1675
+ }
1676
+ else {
1677
+ this.showNoResultMessage();
1678
+ }
1679
+ }
1680
+ async showNoResultMessage() {
1681
+ this.clearSearch();
1682
+ ApplicationUtils.info(this._textEmptySearch.replace("{0}", this.getFieldLabel()));
1683
+ }
1684
+ getFieldLabel() {
1685
+ var _a;
1686
+ return (_a = this.label) === null || _a === void 0 ? void 0 : _a.replace(REQUIRED_INFO, "").toUpperCase();
1687
+ }
1350
1688
  //---------------------------------------------
1351
1689
  // Lifecycle web component
1352
1690
  //---------------------------------------------
@@ -1386,6 +1724,11 @@ const EzComboBox$1 = class extends HTMLElement$1 {
1386
1724
  CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
1387
1725
  this.setInputValue(false);
1388
1726
  }
1727
+ componentShouldUpdate(newValue, oldValue) {
1728
+ if (this.isDifferentValues(newValue, oldValue)) {
1729
+ this.validateDescriptionValue();
1730
+ }
1731
+ }
1389
1732
  //---------------------------------------------
1390
1733
  // Event handlers
1391
1734
  //---------------------------------------------
@@ -1427,7 +1770,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
1427
1770
  clearDeboucingTimeout() {
1428
1771
  if (this._changeDeboucingTimeout) {
1429
1772
  window.clearTimeout(this._changeDeboucingTimeout);
1430
- this._changeDeboucingTimeout = undefined;
1773
+ this._changeDeboucingTimeout = null;
1431
1774
  }
1432
1775
  }
1433
1776
  onTextInputClickHandler() {
@@ -3681,7 +4024,7 @@ uiBuilders.set(UserInterface.SEARCH, buildSearch);
3681
4024
  uiBuilders.set(UserInterface.LONGTEXT, buildTextArea);
3682
4025
  const fieldBuilder = (field) => {
3683
4026
  const builder = uiBuilders.get(field.userInterface) || buildTextInput;
3684
- const label = field.required ? `${field.label} (obrigatório) *` : field.label;
4027
+ const label = field.required ? `${field.label}${REQUIRED_INFO}` : field.label;
3685
4028
  return builder(Object.assign(Object.assign({}, field), { label }));
3686
4029
  };
3687
4030
 
@@ -125827,7 +126170,7 @@ const EzTimeInput$1 = class extends HTMLElement$1 {
125827
126170
  static get style() { return ezTimeInputCss; }
125828
126171
  };
125829
126172
 
125830
- const ezToastCss = ":host{--ez-toast__btn__close__image:url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg%22%3E<path d=\"M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z\"/></svg>');--ez-toast__container--z-index:var(--more-visible, 2);--ez-toast__container--background-color:var(--color--secondary, #383c45);--ez-toast__container--left:var(--space--large, 24px);--ez-toast__container--bottom:var(--space--large, 24px);--ez-toast__container--width:400px;--ez-toast__icon--padding-left:var(--space--small, 6px)}.toast__container{position:fixed;display:flex;box-sizing:border-box;border-radius:6px;align-items:center;padding:12px;visibility:hidden;width:var(--ez-toast__container--width);left:var(--ez-toast__container--left);bottom:var(--ez-toast__container--bottom);z-index:var(--ez-toast__container--z-index);background-color:var(--ez-toast__container--background-color)}.message__container{text-shadow:0 0 0 #353535, 0 0 1px transparent;color:#FFFFFF;font-size:14px;width:90%;overflow:hidden;hyphens:auto;height:auto;-webkit-box-orient:vertical;-webkit-line-clamp:4;display:-webkit-box;text-overflow:ellipsis;font-family:var(--font-pattern, \"Roboto\")}.message__conteiner--icon{width:80%;padding-left:var(--ez-toast__icon--padding-left)}.btn-close{margin-top:3px;display:flex;justify-content:flex-end;align-self:flex-start;padding:0;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:#FFFFFF;width:12px;height:12px;-webkit-mask-image:var(--ez-toast__btn__close__image);mask-image:var(--ez-toast__btn__close__image)}.toast__container--opened{animation:fadein 0.5s, fadeout 0.5s 3s;visibility:visible}@-webkit-keyframes fadein{from{opacity:0;left:calc(var(--ez-toast__container--left) * -1)}to{opacity:1;left:var(--ez-toast__container--left)}}@keyframes fadein{from{opacity:0;left:calc(var(--ez-toast__container--left) * -1)}to{opacity:1;left:var(--ez-toast__container--left)}}@-webkit-keyframes fadeout{from{opacity:1;left:var(--ez-toast__container--left)}to{bottom:0;opacity:0}}@keyframes fadeout{from{opacity:1;left:var(--ez-toast__container--left)}to{bottom:0;opacity:0}}";
126173
+ const ezToastCss = ":host{--ez-toast__btn__close__image:url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg%22%3E<path d=\"M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z\"/></svg>');--ez-toast__container--z-index:var(--more-visible, 2);--ez-toast__container--background-color:var(--color--secondary, #383c45);--ez-toast__container--left:var(--space--large, 24px);--ez-toast__container--bottom:var(--space--large, 24px);--ez-toast__container--width:400px;--ez-toast__icon--padding-left:var(--space--small, 6px)}.toast__container{position:fixed;display:flex;box-sizing:border-box;border-radius:6px;align-items:center;padding:12px;visibility:hidden;width:var(--ez-toast__container--width);left:var(--ez-toast__container--left);bottom:var(--ez-toast__container--bottom);z-index:var(--ez-toast__container--z-index);background-color:var(--ez-toast__container--background-color)}.message__container{text-shadow:0 0 0 #353535, 0 0 1px transparent;color:#FFFFFF;font-size:14px;width:90%;overflow:hidden;hyphens:auto;height:auto;-webkit-box-orient:vertical;-webkit-line-clamp:4;display:-webkit-box;text-overflow:ellipsis;font-family:var(--font-pattern, \"Roboto\")}.message__container--icon{width:80%;padding-left:var(--ez-toast__icon--padding-left)}.btn-close{margin-top:3px;display:flex;justify-content:flex-end;align-self:flex-start;padding:0;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:#FFFFFF;width:12px;height:12px;-webkit-mask-image:var(--ez-toast__btn__close__image);mask-image:var(--ez-toast__btn__close__image)}.toast__container--opened{animation:fadein 0.5s, fadeout 0.5s 3s;visibility:visible}@-webkit-keyframes fadein{from{opacity:0;left:calc(var(--ez-toast__container--left) * -1)}to{opacity:1;left:var(--ez-toast__container--left)}}@keyframes fadein{from{opacity:0;left:calc(var(--ez-toast__container--left) * -1)}to{opacity:1;left:var(--ez-toast__container--left)}}@-webkit-keyframes fadeout{from{opacity:1;left:var(--ez-toast__container--left)}to{bottom:0;opacity:0}}@keyframes fadeout{from{opacity:1;left:var(--ez-toast__container--left)}to{bottom:0;opacity:0}}";
125831
126174
 
125832
126175
  const EzToast$1 = class extends HTMLElement$1 {
125833
126176
  constructor() {
@@ -125851,6 +126194,9 @@ const EzToast$1 = class extends HTMLElement$1 {
125851
126194
  return new Promise(resolve => {
125852
126195
  var _a;
125853
126196
  if ((_a = this.container) === null || _a === void 0 ? void 0 : _a.classList.contains(this._toastOpenedClass)) {
126197
+ if (this.isRepeatedMessage(message)) {
126198
+ return;
126199
+ }
125854
126200
  this._nextMessages.push({ message, fadeTime, useIcon, canClose, callBack: resolve });
125855
126201
  }
125856
126202
  else {
@@ -125884,6 +126230,11 @@ const EzToast$1 = class extends HTMLElement$1 {
125884
126230
  this._currentMessageInfo.callBack(true);
125885
126231
  }
125886
126232
  }
126233
+ isRepeatedMessage(message) {
126234
+ var _a, _b;
126235
+ return ((_a = this._nextMessages) === null || _a === void 0 ? void 0 : _a.some((info) => info.message === message))
126236
+ || ((_b = this._currentMessageInfo) === null || _b === void 0 ? void 0 : _b.message) === message;
126237
+ }
125887
126238
  makeToastInvisible() {
125888
126239
  this.container.classList.remove(this._toastOpenedClass);
125889
126240
  this.container.style.animation = `none`;
@@ -125906,7 +126257,7 @@ const EzToast$1 = class extends HTMLElement$1 {
125906
126257
  }
125907
126258
  render() {
125908
126259
  return (h(Host, null, h("div", { ref: (el) => this.container = el, class: "toast__container" }, this._currentMessageInfo.useIcon &&
125909
- h("slot", { name: "icon" }), h("div", { lang: this._lang, ref: (el) => this._elemText = el, class: this._currentMessageInfo.useIcon ? "message__container message__conteiner--icon" : "message__container", title: this._currentMessageInfo.message, innerHTML: this._currentMessageInfo.message }), this._currentMessageInfo.canClose &&
126260
+ h("slot", { name: "icon" }), h("div", { lang: this._lang, ref: (el) => this._elemText = el, class: this._currentMessageInfo.useIcon ? "message__container message__container--icon" : "message__container", title: this._currentMessageInfo.message, innerHTML: this._currentMessageInfo.message }), this._currentMessageInfo.canClose &&
125910
126261
  h("button", { class: "btn-close", onClick: () => { this.hideToast(); }, ref: (el) => this._elemBtnClose = el }))));
125911
126262
  }
125912
126263
  get _element() { return this; }
@@ -126873,7 +127224,7 @@ const EzViewStack$1 = class extends HTMLElement$1 {
126873
127224
  const EzActionsButton = /*@__PURE__*/proxyCustomElement(EzActionsButton$1, [1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32]}]);
126874
127225
  const EzAlert = /*@__PURE__*/proxyCustomElement(EzAlert$1, [1,"ez-alert",{"alertType":[513,"alert-type"]}]);
126875
127226
  const EzApplication = /*@__PURE__*/proxyCustomElement(EzApplication$1, [0,"ez-application"]);
126876
- const EzBreadcrumb = /*@__PURE__*/proxyCustomElement(EzBreadcrumb$1, [1,"ez-breadcrumb",{"items":[1040]}]);
127227
+ const EzBreadcrumb = /*@__PURE__*/proxyCustomElement(EzBreadcrumb$1, [1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]);
126877
127228
  const EzButton = /*@__PURE__*/proxyCustomElement(EzButton$1, [1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513]}]);
126878
127229
  const EzCalendar = /*@__PURE__*/proxyCustomElement(EzCalendar$1, [1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"]}]);
126879
127230
  const EzCardItem = /*@__PURE__*/proxyCustomElement(EzCardItem$1, [1,"ez-card-item",{"item":[16]}]);
@@ -30,13 +30,17 @@ class ApplicationUtils {
30
30
  return ApplicationUtils.showDialog(title, message, icon, false, DialogType.DEFAULT, options);
31
31
  }
32
32
  static async info(message, options = ApplicationUtils.defaultMessageOptions) {
33
+ if (options !== ApplicationUtils.defaultMessageOptions) {
34
+ options = Object.assign(Object.assign({}, ApplicationUtils.defaultMessageOptions), options);
35
+ }
36
+ let useIcon = false;
33
37
  let toast = document.querySelector("ez-toast");
34
38
  if (!toast) {
35
39
  toast = document.createElement("ez-toast");
36
40
  const icon = document.createElement("ez-icon");
37
41
  icon.className = "ez-margin-right--small";
38
42
  icon.slot = "icon";
39
- icon.style.setProperty('--ez-icon--color', 'var(--color--success)');
43
+ icon.style.setProperty("--ez-icon--color", "var(--color--success)");
40
44
  toast.appendChild(icon);
41
45
  window.document.body.appendChild(toast);
42
46
  }
@@ -44,13 +48,13 @@ class ApplicationUtils {
44
48
  const iconElem = toast.querySelector("ez-icon");
45
49
  if (iconElem) {
46
50
  iconElem.iconName = options.iconName;
47
- toast.useIcon = true;
51
+ useIcon = true;
48
52
  }
49
53
  }
50
54
  else {
51
- toast.useIcon = false;
55
+ useIcon = false;
52
56
  }
53
- toast.show(message, 5000, false, options.canClose);
57
+ toast.show(message, 5000, useIcon, options.canClose);
54
58
  }
55
59
  }
56
60
  ApplicationUtils.defaultMessageOptions = {
@@ -0,0 +1,3 @@
1
+ const REQUIRED_INFO = " (obrigatório) *";
2
+
3
+ export { REQUIRED_INFO as R };
@@ -1,6 +1,6 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-de655f48.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-c27164d3.js';
2
2
  import { FloatingManager, ElementIDUtils } from '@sankhyalabs/core';
3
- import './ApplicationUtils-9fda4796.js';
3
+ import './ApplicationUtils-79bf1d95.js';
4
4
  import { C as CSSVarsUtils } from './CSSVarsUtils-00f67f32.js';
5
5
  import './DialogType-54a62731.js';
6
6
  import './CheckMode-bdb2ec19.js';
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-de655f48.js';
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-c27164d3.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
 
4
4
  const ezAlertCss = ":host{--ez-alert-alert-container--padding-up-down:var(--space--small, 6px);--ez-alert-alert-container--padding-right-left:var(--space--medium, 12px);--ez-alert-alert-container--gap:var(--space--medium, 12px);--ez-alert-alert-container--border-radius:var(--border--radius-medium, 12px);--ez-alert-alert-container--font-color-warn:var(--color--alert-warning-900, #8C6B00);--ez-alert-alert-container--icon-warn:var(--color--alert-warning-900, #8C6B00);--ez-alert-alert-container--background-color-warn:var(--color--alert-warning-200, #FFF7D5);--ez-alert-alert-container--font-color-critical:var(--color--alert-error, #BD0025);--ez-alert-alert-container--icon-critical:var(--color--alert-error, #BD0025);--ez-alert-alert-container--background-color-critical:var(--color--alert-error-200, #F7E0E5);--ez-alert-alert-container--font-color-success:var(--color--alert-success, #157A00);--ez-alert-alert-container--icon-success:var(--color--alert-success, #157A00);--ez-alert-alert-container--background-color-success:var(--color--alert-success-200, #E7F6E0);font-size:var(--text--small, 12px);font-family:var(--font-pattern, \"Roboto\");width:100%;hyphens:auto;display:block}.alert-container{display:flex;align-items:center;gap:var(--ez-alert-alert-container--gap);padding:var(--ez-alert-alert-container--padding-up-down) var(--ez-alert-alert-container--padding-right-left);border-radius:var(--ez-alert-alert-container--border-radius)}.warn{background-color:var(--ez-alert-alert-container--background-color-warn);color:var(--ez-alert-alert-container--font-color-warn)}.critical{background-color:var(--ez-alert-alert-container--background-color-critical);color:var(--ez-alert-alert-container--font-color-critical)}.success{background-color:var(--ez-alert-alert-container--background-color-success);color:var(--ez-alert-alert-container--font-color-success)}ez-icon{--ez-icon--color:inherit}.alert-container__icon-warn{--ez-icon--color:var(--ez-alert-alert-container--icon-warn)}.alert-container__icon-critical{--ez-icon--color:var(--ez-alert-alert-container--icon-critical)}.alert-container__icon-success{--ez-icon--color:var(--ez-alert-alert-container--icon-success)}";
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-de655f48.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-c27164d3.js';
2
2
 
3
3
  const ezApplicationCss = "";
4
4