@sankhyalabs/ezui 1.2.0-beta.2 → 1.2.0-beta.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 (216) hide show
  1. package/dist/cjs/{ApplicationUtils-483c0a9e.js → ApplicationUtils-edc62c5c.js} +6 -2
  2. package/dist/cjs/{CSSVarsUtils-09b431cc.js → CSSVarsUtils-af809e73.js} +17 -0
  3. package/dist/cjs/{DialogType-a1e288e6.js → DialogType-aa435c52.js} +1 -0
  4. package/dist/cjs/FieldBuilder-cd3e45ed.js +119 -0
  5. package/dist/cjs/ez-actions-button.cjs.entry.js +67 -15
  6. package/dist/cjs/ez-button.cjs.entry.js +12 -10
  7. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-chip.cjs.entry.js +6 -6
  9. package/dist/cjs/ez-collapsible-box.cjs.entry.js +85 -6
  10. package/dist/cjs/ez-combo-box.cjs.entry.js +38 -13
  11. package/dist/cjs/ez-date-input.cjs.entry.js +9 -14
  12. package/dist/cjs/ez-date-time-input.cjs.entry.js +9 -14
  13. package/dist/cjs/ez-dialog.cjs.entry.js +42 -7
  14. package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-form.cjs.entry.js +44 -133
  16. package/dist/cjs/ez-grid-config.cjs.entry.js +4 -5
  17. package/dist/cjs/ez-grid.cjs.entry.js +97 -10
  18. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  19. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-modal-container.cjs.entry.js +54 -0
  21. package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  23. package/dist/cjs/ez-popup.cjs.entry.js +7 -3
  24. package/dist/cjs/ez-radio-button.cjs.entry.js +2 -2
  25. package/dist/cjs/ez-scroller.cjs.entry.js +1 -1
  26. package/dist/cjs/ez-search.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-tabselector.cjs.entry.js +7 -5
  28. package/dist/cjs/ez-text-area.cjs.entry.js +6 -6
  29. package/dist/cjs/ez-text-edit.cjs.entry.js +103 -0
  30. package/dist/cjs/ez-text-input.cjs.entry.js +11 -1
  31. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  32. package/dist/cjs/ez-upload.cjs.entry.js +2 -2
  33. package/dist/cjs/ez-view-stack.cjs.entry.js +9 -5
  34. package/dist/cjs/ezui.cjs.js +1 -1
  35. package/dist/cjs/loader.cjs.js +1 -1
  36. package/dist/collection/collection-manifest.json +6 -4
  37. package/dist/collection/components/ez-actions-button/ez-actions-button.css +49 -20
  38. package/dist/collection/components/ez-actions-button/ez-actions-button.js +219 -23
  39. package/dist/collection/components/ez-button/ez-button.css +1 -6
  40. package/dist/collection/components/ez-button/ez-button.js +11 -9
  41. package/dist/collection/components/ez-calendar/ez-calendar.css +17 -20
  42. package/dist/collection/components/ez-chip/ez-chip.css +6 -3
  43. package/dist/collection/components/ez-chip/ez-chip.js +5 -5
  44. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +16 -0
  45. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +226 -7
  46. package/dist/collection/components/ez-combo-box/ez-combo-box.css +1 -22
  47. package/dist/collection/components/ez-combo-box/ez-combo-box.js +42 -18
  48. package/dist/collection/components/ez-date-input/ez-date-input.js +8 -13
  49. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +8 -13
  50. package/dist/collection/components/ez-dialog/DialogType.js +1 -0
  51. package/dist/collection/components/ez-dialog/ez-dialog.css +19 -25
  52. package/dist/collection/components/ez-dialog/ez-dialog.js +41 -6
  53. package/dist/collection/components/ez-form/DataBinder.js +1 -0
  54. package/dist/collection/components/ez-form/ez-form.js +22 -13
  55. package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +1 -1
  56. package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +24 -14
  57. package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +3 -0
  58. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +64 -10
  59. package/dist/collection/components/ez-grid/controller/ag-grid/components/cellRenderer.js +31 -0
  60. package/dist/collection/components/ez-grid/ez-grid.js +40 -3
  61. package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.css +36 -25
  62. package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.js +1 -2
  63. package/dist/collection/components/ez-grid/subcomponents/ez-select-box/ez-select-box.js +5 -4
  64. package/dist/collection/components/ez-icon/ez-icon.css +117 -98
  65. package/dist/collection/components/ez-list/ez-list.css +9 -1
  66. package/dist/collection/components/ez-modal-container/ez-modal-container.css +38 -0
  67. package/dist/collection/components/ez-modal-container/ez-modal-container.js +166 -0
  68. package/dist/collection/components/ez-modal-container/index.js +2 -0
  69. package/dist/collection/components/ez-modal-container/modal-action.js +8 -0
  70. package/dist/collection/components/ez-modal-container/modal-button-status.js +7 -0
  71. package/dist/collection/components/ez-popover/ez-popover.css +1 -1
  72. package/dist/collection/components/ez-popup/ez-popup.css +4 -0
  73. package/dist/collection/components/ez-popup/ez-popup.js +26 -4
  74. package/dist/collection/components/ez-radio-button/ez-radio-button.css +16 -5
  75. package/dist/collection/components/ez-radio-button/ez-radio-button.js +1 -1
  76. package/dist/collection/components/ez-scroller/ez-scroller.css +4 -2
  77. package/dist/collection/components/ez-search/ez-search.js +6 -6
  78. package/dist/collection/components/ez-tabselector/ez-tabselector.css +9 -0
  79. package/dist/collection/components/ez-tabselector/ez-tabselector.js +7 -3
  80. package/dist/collection/components/ez-text-area/ez-text-area.css +6 -3
  81. package/dist/collection/components/ez-text-area/ez-text-area.js +5 -5
  82. package/dist/collection/components/ez-text-edit/ez-text-edit.css +19 -0
  83. package/dist/collection/components/ez-text-edit/ez-text-edit.js +188 -0
  84. package/dist/collection/components/ez-text-input/ez-text-input.css +18 -2
  85. package/dist/collection/components/ez-text-input/ez-text-input.js +28 -0
  86. package/dist/collection/components/ez-view-stack/ez-view-stack.js +12 -6
  87. package/dist/collection/utils/ApplicationUtils.js +5 -1
  88. package/dist/collection/utils/CSSVarsUtils.js +17 -0
  89. package/dist/collection/utils/index.js +1 -0
  90. package/dist/custom-elements/index.d.ts +12 -0
  91. package/dist/custom-elements/index.js +728 -254
  92. package/dist/esm/{ApplicationUtils-5f87ae60.js → ApplicationUtils-205ac4bc.js} +6 -2
  93. package/dist/esm/{CSSVarsUtils-499b75c2.js → CSSVarsUtils-00f67f32.js} +17 -0
  94. package/dist/esm/{DialogType-72afa679.js → DialogType-4059dc4d.js} +1 -0
  95. package/dist/esm/FieldBuilder-9e9545fc.js +117 -0
  96. package/dist/esm/ez-actions-button.entry.js +67 -15
  97. package/dist/esm/ez-button.entry.js +12 -10
  98. package/dist/esm/ez-calendar.entry.js +1 -1
  99. package/dist/esm/ez-chip.entry.js +6 -6
  100. package/dist/esm/ez-collapsible-box.entry.js +86 -7
  101. package/dist/esm/ez-combo-box.entry.js +38 -13
  102. package/dist/esm/ez-date-input.entry.js +9 -14
  103. package/dist/esm/ez-date-time-input.entry.js +10 -15
  104. package/dist/esm/ez-dialog.entry.js +42 -7
  105. package/dist/esm/ez-filter-input.entry.js +1 -1
  106. package/dist/esm/ez-form.entry.js +43 -132
  107. package/dist/esm/ez-grid-config.entry.js +4 -5
  108. package/dist/esm/ez-grid.entry.js +97 -10
  109. package/dist/esm/ez-icon.entry.js +1 -1
  110. package/dist/esm/ez-list.entry.js +1 -1
  111. package/dist/esm/ez-modal-container.entry.js +50 -0
  112. package/dist/esm/ez-number-input.entry.js +1 -1
  113. package/dist/esm/ez-popover.entry.js +1 -1
  114. package/dist/esm/ez-popup.entry.js +7 -3
  115. package/dist/esm/ez-radio-button.entry.js +2 -2
  116. package/dist/esm/ez-scroller.entry.js +1 -1
  117. package/dist/esm/ez-search.entry.js +1 -1
  118. package/dist/esm/ez-tabselector.entry.js +7 -5
  119. package/dist/esm/ez-text-area.entry.js +6 -6
  120. package/dist/esm/ez-text-edit.entry.js +99 -0
  121. package/dist/esm/ez-text-input.entry.js +11 -1
  122. package/dist/esm/ez-time-input.entry.js +1 -1
  123. package/dist/esm/ez-upload.entry.js +2 -2
  124. package/dist/esm/ez-view-stack.entry.js +9 -5
  125. package/dist/esm/ezui.js +1 -1
  126. package/dist/esm/loader.js +1 -1
  127. package/dist/ezui/ezui.esm.js +1 -1
  128. package/dist/ezui/p-0b44cf1c.js +1 -0
  129. package/dist/ezui/p-0c7203d5.entry.js +1 -0
  130. package/dist/ezui/p-2cc6dd66.entry.js +1 -0
  131. package/dist/ezui/p-2ccad880.entry.js +1 -0
  132. package/dist/ezui/p-333d79c4.entry.js +1 -0
  133. package/dist/ezui/p-3987f8d8.entry.js +1 -0
  134. package/dist/ezui/p-3c87845d.entry.js +1 -0
  135. package/dist/ezui/{p-768053d0.entry.js → p-43bb6a59.entry.js} +1 -1
  136. package/dist/ezui/p-4a5e37a7.js +1 -0
  137. package/dist/ezui/p-4ad647fc.entry.js +1 -0
  138. package/dist/ezui/p-54ecd19a.js +1 -0
  139. package/dist/ezui/{p-03742d3e.entry.js → p-56688470.entry.js} +1 -1
  140. package/dist/ezui/{p-b901ba02.entry.js → p-5a1927a2.entry.js} +1 -1
  141. package/dist/ezui/{p-b2cf7db2.entry.js → p-63d567cc.entry.js} +1 -1
  142. package/dist/ezui/p-6befd7e4.entry.js +1 -0
  143. package/dist/ezui/p-712bd293.entry.js +1 -0
  144. package/dist/ezui/{p-d9c72ff7.entry.js → p-72c75a43.entry.js} +1 -1
  145. package/dist/ezui/{p-15d18ece.entry.js → p-744eb735.entry.js} +1 -1
  146. package/dist/ezui/{p-81eb2738.entry.js → p-802d23d9.entry.js} +1 -1
  147. package/dist/ezui/p-86daa81a.entry.js +1 -0
  148. package/dist/ezui/{p-72ab066f.entry.js → p-b706619e.entry.js} +1 -1
  149. package/dist/ezui/p-bca406db.entry.js +1 -0
  150. package/dist/ezui/p-be06251d.entry.js +1 -0
  151. package/dist/ezui/{p-e7d03a0d.entry.js → p-bffae598.entry.js} +1 -1
  152. package/dist/ezui/p-d91527dc.entry.js +1 -0
  153. package/dist/ezui/p-dd257f17.entry.js +1 -0
  154. package/dist/ezui/p-e1148f5c.js +1 -0
  155. package/dist/ezui/p-e1f2b5da.entry.js +1 -0
  156. package/dist/ezui/p-e230bfd2.entry.js +1 -0
  157. package/dist/ezui/{p-5c721278.entry.js → p-e3ee814c.entry.js} +1 -1
  158. package/dist/ezui/p-e697ffd5.entry.js +1 -0
  159. package/dist/ezui/p-ec9decf2.entry.js +1 -0
  160. package/dist/ezui/p-f36dbc21.entry.js +1 -0
  161. package/dist/types/components/ez-actions-button/ez-actions-button.d.ts +42 -9
  162. package/dist/types/components/ez-chip/ez-chip.d.ts +1 -1
  163. package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +46 -1
  164. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +15 -5
  165. package/dist/types/components/ez-date-input/ez-date-input.d.ts +0 -1
  166. package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +0 -1
  167. package/dist/types/components/ez-dialog/DialogType.d.ts +1 -0
  168. package/dist/types/components/ez-dialog/ez-dialog.d.ts +3 -0
  169. package/dist/types/components/ez-form/DataBinder.d.ts +2 -2
  170. package/dist/types/components/ez-form/ez-form.d.ts +21 -11
  171. package/dist/types/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.d.ts +3 -3
  172. package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +2 -5
  173. package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +3 -3
  174. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +11 -0
  175. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +5 -1
  176. package/dist/types/components/ez-grid/controller/ag-grid/components/cellRenderer.d.ts +9 -0
  177. package/dist/types/components/ez-grid/ez-grid.d.ts +8 -3
  178. package/dist/types/components/ez-grid/subcomponents/ez-select-box/ez-select-box.d.ts +2 -6
  179. package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +43 -0
  180. package/dist/types/components/ez-modal-container/index.d.ts +2 -0
  181. package/dist/types/components/ez-modal-container/modal-action.d.ts +7 -0
  182. package/dist/types/components/ez-modal-container/modal-button-status.d.ts +6 -0
  183. package/dist/types/components/ez-popup/ez-popup.d.ts +4 -0
  184. package/dist/types/components/ez-search/ez-search.d.ts +3 -3
  185. package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +2 -0
  186. package/dist/types/components/ez-text-edit/ez-text-edit.d.ts +39 -0
  187. package/dist/types/components/ez-text-input/ez-text-input.d.ts +5 -0
  188. package/dist/types/components/ez-view-stack/ez-view-stack.d.ts +5 -1
  189. package/dist/types/components.d.ts +266 -28
  190. package/dist/types/utils/ApplicationUtils.d.ts +1 -0
  191. package/dist/types/utils/CSSVarsUtils.d.ts +1 -0
  192. package/dist/types/utils/index.d.ts +1 -0
  193. package/package.json +5 -5
  194. package/react/components.d.ts +2 -0
  195. package/react/components.js +2 -0
  196. package/react/components.js.map +1 -1
  197. package/dist/ezui/p-3263a002.js +0 -1
  198. package/dist/ezui/p-3ae441ec.entry.js +0 -1
  199. package/dist/ezui/p-3ffdde40.entry.js +0 -1
  200. package/dist/ezui/p-416bedbe.entry.js +0 -1
  201. package/dist/ezui/p-47e06040.entry.js +0 -1
  202. package/dist/ezui/p-6cfe20a0.entry.js +0 -1
  203. package/dist/ezui/p-719e9ef9.entry.js +0 -1
  204. package/dist/ezui/p-787fbdfe.js +0 -1
  205. package/dist/ezui/p-7fe1ac9a.entry.js +0 -1
  206. package/dist/ezui/p-898b9906.js +0 -1
  207. package/dist/ezui/p-9c3c9da8.entry.js +0 -1
  208. package/dist/ezui/p-a27dafa4.entry.js +0 -1
  209. package/dist/ezui/p-a3ff4f0e.entry.js +0 -1
  210. package/dist/ezui/p-aba3fa6c.entry.js +0 -1
  211. package/dist/ezui/p-b3e978aa.entry.js +0 -1
  212. package/dist/ezui/p-cccd8cde.entry.js +0 -1
  213. package/dist/ezui/p-cf283c4a.entry.js +0 -1
  214. package/dist/ezui/p-d0671e14.entry.js +0 -1
  215. package/dist/ezui/p-e0f06d73.entry.js +0 -1
  216. package/dist/ezui/p-ed835b36.entry.js +0 -1
@@ -54,16 +54,16 @@ export class EzChip {
54
54
  }
55
55
  }
56
56
  observeValue() {
57
- (this.value && this.mode !== "action") ? this._divElem.classList.add("label__container--active") : this._divElem.classList.remove("label__container--active");
57
+ (this.value && this.mode !== "action") ? this._containerElem.classList.add("label__container--active") : this._containerElem.classList.remove("label__container--active");
58
58
  }
59
59
  observeEnabled() {
60
60
  if (this.enabled) {
61
- this._divElem.classList.remove("label__container--disabled");
61
+ this._containerElem.classList.remove("label__container--disabled");
62
62
  this._labelElem.classList.remove("lbl--disabled");
63
63
  this._labelElem.classList.remove("cursor-disable");
64
64
  }
65
65
  else {
66
- this._divElem.classList.add("label__container--disabled");
66
+ this._containerElem.classList.add("label__container--disabled");
67
67
  this._labelElem.classList.add("lbl--disabled");
68
68
  this._labelElem.classList.add("cursor-disable");
69
69
  }
@@ -72,13 +72,13 @@ export class EzChip {
72
72
  // Lifecycle web component
73
73
  //---------------------------------------------
74
74
  componentDidLoad() {
75
- if (this._divElem) {
75
+ if (this._containerElem) {
76
76
  this.observeValue();
77
77
  this.observeEnabled();
78
78
  }
79
79
  }
80
80
  render() {
81
- return (h("div", { onClick: (ev) => this.handleClick(ev), class: "label__container" + (this.removePosition === "left" ? " label__container--row-reverse" : ""), ref: (el) => this._divElem = el },
81
+ return (h("button", { onClick: (ev) => this.handleClick(ev), class: "label__container" + (this.removePosition === "left" ? " label__container--row-reverse" : ""), ref: (el) => this._containerElem = el },
82
82
  h("div", { class: "label__content" },
83
83
  h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }),
84
84
  h("label", { class: "lbl " + (this.value ? "lbl--active " : ""), ref: (el) => this._labelElem = el }, this.label),
@@ -80,12 +80,14 @@ ez-icon {
80
80
 
81
81
  .collapsible-box__label {
82
82
  /*private*/
83
+ display: flex;
83
84
  white-space: nowrap;
84
85
  overflow: hidden;
85
86
  cursor: pointer;
86
87
  text-overflow: ellipsis;
87
88
  box-sizing: border-box;
88
89
  margin-left: 6px;
90
+ gap: 6px;
89
91
 
90
92
  /*public*/
91
93
  font-family: var(--ez-collapsible-box--font-family);
@@ -93,6 +95,20 @@ ez-icon {
93
95
  font-weight: var(--ez-collapsible-box--font-weight);
94
96
  }
95
97
 
98
+ .collapsible-box__label ez-icon {
99
+ visibility: hidden;
100
+ transition: 0.25s linear;
101
+ }
102
+
103
+ .collapsible-box__label:hover ez-icon {
104
+ visibility: visible;
105
+ }
106
+
107
+ .collapsible-box__text-edit {
108
+ /*private*/
109
+ margin-left: 6px;
110
+ }
111
+
96
112
  .collapsible-box__icon {
97
113
  /*private*/
98
114
  transform: rotate(90deg) translate(0px, 14%);
@@ -1,6 +1,8 @@
1
- import { Component, h, Prop, Event, Watch, Method } from "@stencil/core";
1
+ import { Component, h, Prop, Event, Watch, Method, Element, State } from "@stencil/core";
2
+ import { ApplicationUtils } from "../../utils";
2
3
  export class EzCollapsibleBox {
3
4
  constructor() {
5
+ this._activeEditText = false;
4
6
  /**
5
7
  * Valor externalizado que garante a exibição ou não do componente.
6
8
  */
@@ -17,9 +19,14 @@ export class EzCollapsibleBox {
17
19
  * Define se o titulo irá ocupar toda a largura do componente.
18
20
  */
19
21
  this.stretchTitle = false;
20
- }
21
- observeCollapsedValue() {
22
- this.ezChange.emit(this.value);
22
+ /**
23
+ * Ativa o ícone para remoção do componente.
24
+ */
25
+ this.removable = false;
26
+ /**
27
+ * Ativa o ícone para edição do componente.
28
+ */
29
+ this.editable = false;
23
30
  }
24
31
  /**
25
32
  * Esconde ou revela o conteúdo do componente.
@@ -27,6 +34,23 @@ export class EzCollapsibleBox {
27
34
  async showHide() {
28
35
  this.value = !this.value;
29
36
  }
37
+ /**
38
+ * Aplica focus no campo de edição de título.
39
+ */
40
+ async applyFocusTextEdit() {
41
+ var _a;
42
+ (_a = this._refTextEdit) === null || _a === void 0 ? void 0 : _a.applyFocusSelect();
43
+ }
44
+ /**
45
+ * Fecha a edição de título.
46
+ */
47
+ async cancelEdition() {
48
+ this._activeEditText = false;
49
+ this.ezEditLabelMode.emit(this._activeEditText);
50
+ }
51
+ observeCollapsedValue() {
52
+ this.ezChange.emit(this.value);
53
+ }
30
54
  /**
31
55
  * Retorna o tamanho configurado do texto e do ícone.
32
56
  */
@@ -37,15 +61,66 @@ export class EzCollapsibleBox {
37
61
  const sizeCustom = sizeAlias.includes(sizeLowerCase) ? sizeLowerCase.replace('x', 'x-') : sizeLowerCase;
38
62
  return sizeList.includes(sizeCustom) ? sizeCustom : "small";
39
63
  }
64
+ removeElement() {
65
+ this._hostElement && this._hostElement.remove();
66
+ this.ezRemove.emit(this);
67
+ }
68
+ editLabel(evt) {
69
+ evt.preventDefault();
70
+ evt.stopPropagation();
71
+ this._activeEditText = true;
72
+ this.ezEditLabelMode.emit(this._activeEditText);
73
+ }
74
+ confirmRemove(evt) {
75
+ evt.preventDefault();
76
+ evt.stopPropagation();
77
+ ApplicationUtils.confirm("Aviso", `Deseja realmente remover o grupo <b>${this.label}</b>?`)
78
+ .then((canRemove) => {
79
+ if (canRemove) {
80
+ this.removeElement();
81
+ }
82
+ });
83
+ }
84
+ saveEditionText(editDetails) {
85
+ const { newValue } = editDetails.detail;
86
+ let canSave = true;
87
+ if (this.conditionalSave) {
88
+ canSave = this.conditionalSave(newValue);
89
+ }
90
+ if (this.label !== newValue && canSave) {
91
+ this.label = newValue;
92
+ this._activeEditText = false;
93
+ this.ezSaveEditLabel.emit(editDetails.detail);
94
+ this.ezEditLabelMode.emit(this._activeEditText);
95
+ }
96
+ }
97
+ getStyledLabel() {
98
+ if (this._refLabel == undefined) {
99
+ return;
100
+ }
101
+ let styledLabel = {
102
+ fontSize: window.getComputedStyle(this._refLabel).getPropertyValue('font-size'),
103
+ fontWeight: window.getComputedStyle(this._refLabel).getPropertyValue('font-weight'),
104
+ fontFamily: window.getComputedStyle(this._refLabel).getPropertyValue('font-family')
105
+ };
106
+ return styledLabel;
107
+ }
40
108
  render() {
41
109
  return (h("div", { class: "collapsible-box" },
42
110
  h("div", { class: "collapsible-box__header" },
43
- h("button", { onClick: () => this.showHide(), class: "collapsible-box__title" +
111
+ h("button", Object.assign({}, (!this._activeEditText ? { onClick: () => { this.showHide(); } } : null), { class: "collapsible-box__title" +
44
112
  (this.iconPlacement === "right" ? " collapsible-box__title--icon-right" : "") +
45
113
  (this.stretchTitle ? " collapsible-box__title--stretched" : "") +
46
- (this.value ? " collapsible-box__title--no-margin" : "") },
114
+ (this.value ? " collapsible-box__title--no-margin" : "") }),
47
115
  h("ez-icon", { slot: "icon", "icon-name": "chevron-right", size: this.getHeaderSize(), class: "collapsible-box__icon collapsible-box__icon--" + this.getHeaderSize() + (this.value ? " collapsible-box__icon--collapsed" : "") }),
48
- h("label", { class: "collapsible-box__label font--" + this.getHeaderSize(), title: this.label }, this.label))),
116
+ !this._activeEditText ?
117
+ h("label", { class: "collapsible-box__label font--" + this.getHeaderSize(), title: this.label, ref: elem => this._refLabel = elem },
118
+ h("span", null, this.label),
119
+ this.editable &&
120
+ h("ez-icon", { slot: "icon", "icon-name": "edit", onClick: (evt) => this.editLabel(evt), title: "Editar" }),
121
+ this.removable &&
122
+ h("ez-icon", { slot: "icon", "icon-name": "delete", onClick: (evt) => this.confirmRemove(evt), title: "Remover" })) :
123
+ h("ez-text-edit", { class: "collapsible-box__text-edit", ref: ref => this._refTextEdit = ref, value: this.label, styled: this.getStyledLabel(), onSaveEdition: (ev) => this.saveEditionText(ev), onCancelEdition: () => this.cancelEdition() }))),
49
124
  h("div", { class: "collapsible-box__content" + (this.value ? "" : " collapsible-box__content--show") },
50
125
  h("slot", null))));
51
126
  }
@@ -146,8 +221,66 @@ export class EzCollapsibleBox {
146
221
  "attribute": "stretch-title",
147
222
  "reflect": true,
148
223
  "defaultValue": "false"
224
+ },
225
+ "removable": {
226
+ "type": "boolean",
227
+ "mutable": false,
228
+ "complexType": {
229
+ "original": "boolean",
230
+ "resolved": "boolean",
231
+ "references": {}
232
+ },
233
+ "required": false,
234
+ "optional": false,
235
+ "docs": {
236
+ "tags": [],
237
+ "text": "Ativa o \u00EDcone para remo\u00E7\u00E3o do componente."
238
+ },
239
+ "attribute": "removable",
240
+ "reflect": true,
241
+ "defaultValue": "false"
242
+ },
243
+ "editable": {
244
+ "type": "boolean",
245
+ "mutable": false,
246
+ "complexType": {
247
+ "original": "boolean",
248
+ "resolved": "boolean",
249
+ "references": {}
250
+ },
251
+ "required": false,
252
+ "optional": false,
253
+ "docs": {
254
+ "tags": [],
255
+ "text": "Ativa o \u00EDcone para edi\u00E7\u00E3o do componente."
256
+ },
257
+ "attribute": "editable",
258
+ "reflect": true,
259
+ "defaultValue": "false"
260
+ },
261
+ "conditionalSave": {
262
+ "type": "unknown",
263
+ "mutable": false,
264
+ "complexType": {
265
+ "original": "Function",
266
+ "resolved": "Function",
267
+ "references": {
268
+ "Function": {
269
+ "location": "global"
270
+ }
271
+ }
272
+ },
273
+ "required": false,
274
+ "optional": false,
275
+ "docs": {
276
+ "tags": [],
277
+ "text": "Define uma condi\u00E7\u00E3o para salvar ou n\u00E3o uma altera\u00E7\u00E3o."
278
+ }
149
279
  }
150
280
  }; }
281
+ static get states() { return {
282
+ "_activeEditText": {}
283
+ }; }
151
284
  static get events() { return [{
152
285
  "method": "ezChange",
153
286
  "name": "ezChange",
@@ -163,6 +296,59 @@ export class EzCollapsibleBox {
163
296
  "resolved": "boolean",
164
297
  "references": {}
165
298
  }
299
+ }, {
300
+ "method": "ezRemove",
301
+ "name": "ezRemove",
302
+ "bubbles": true,
303
+ "cancelable": true,
304
+ "composed": true,
305
+ "docs": {
306
+ "tags": [],
307
+ "text": "Evento disparado ao remover o componente (onEzRemove)."
308
+ },
309
+ "complexType": {
310
+ "original": "EzCollapsibleBox",
311
+ "resolved": "EzCollapsibleBox",
312
+ "references": {
313
+ "EzCollapsibleBox": {
314
+ "location": "global"
315
+ }
316
+ }
317
+ }
318
+ }, {
319
+ "method": "ezSaveEditLabel",
320
+ "name": "ezSaveEditLabel",
321
+ "bubbles": true,
322
+ "cancelable": true,
323
+ "composed": true,
324
+ "docs": {
325
+ "tags": [],
326
+ "text": "Evento disparado ao concluir edi\u00E7\u00E3o da label (onEzSaveEditLabel)."
327
+ },
328
+ "complexType": {
329
+ "original": "CustomEvent",
330
+ "resolved": "CustomEvent<any>",
331
+ "references": {
332
+ "CustomEvent": {
333
+ "location": "global"
334
+ }
335
+ }
336
+ }
337
+ }, {
338
+ "method": "ezEditLabelMode",
339
+ "name": "ezEditLabelMode",
340
+ "bubbles": true,
341
+ "cancelable": true,
342
+ "composed": true,
343
+ "docs": {
344
+ "tags": [],
345
+ "text": "Evento disparado quando o modo de edi\u00E7\u00E3o da label for aberto e fechado (onEzEditLabelMode)."
346
+ },
347
+ "complexType": {
348
+ "original": "boolean",
349
+ "resolved": "boolean",
350
+ "references": {}
351
+ }
166
352
  }]; }
167
353
  static get methods() { return {
168
354
  "showHide": {
@@ -180,8 +366,41 @@ export class EzCollapsibleBox {
180
366
  "text": "Esconde ou revela o conte\u00FAdo do componente.",
181
367
  "tags": []
182
368
  }
369
+ },
370
+ "applyFocusTextEdit": {
371
+ "complexType": {
372
+ "signature": "() => Promise<void>",
373
+ "parameters": [],
374
+ "references": {
375
+ "Promise": {
376
+ "location": "global"
377
+ }
378
+ },
379
+ "return": "Promise<void>"
380
+ },
381
+ "docs": {
382
+ "text": "Aplica focus no campo de edi\u00E7\u00E3o de t\u00EDtulo.",
383
+ "tags": []
384
+ }
385
+ },
386
+ "cancelEdition": {
387
+ "complexType": {
388
+ "signature": "() => Promise<void>",
389
+ "parameters": [],
390
+ "references": {
391
+ "Promise": {
392
+ "location": "global"
393
+ }
394
+ },
395
+ "return": "Promise<void>"
396
+ },
397
+ "docs": {
398
+ "text": "Fecha a edi\u00E7\u00E3o de t\u00EDtulo.",
399
+ "tags": []
400
+ }
183
401
  }
184
402
  }; }
403
+ static get elementRef() { return "_hostElement"; }
185
404
  static get watchers() { return [{
186
405
  "propName": "value",
187
406
  "methodName": "observeCollapsedValue"
@@ -161,28 +161,6 @@ ez-icon {
161
161
  min-width: var(--ez-combo-box__list-scrollbar--width);
162
162
  }
163
163
 
164
- .list-options::-webkit-scrollbar-track {
165
- background-color: #f0f2f5;
166
-
167
- /*public*/
168
- border-radius: var(--ez-combo-box__list-scrollbar--border-radius);
169
- }
170
-
171
- .list-options::-webkit-scrollbar-thumb {
172
- /*public*/
173
- background-color: var(--ez-combo-box__list-scrollbar--background-color);
174
- border-radius: var(--ez-combo-box__list-scrollbar--border-radius);
175
- }
176
-
177
- .list-options::-webkit-scrollbar {
178
- background-color: #f0f2f5;
179
-
180
- /*public*/
181
- width: var(--ez-combo-box__list-scrollbar--width);
182
- max-width: var(--ez-combo-box__list-scrollbar--width);
183
- min-width: var(--ez-combo-box__list-scrollbar--width);
184
- }
185
-
186
164
  .item {
187
165
  display: flex;
188
166
  align-items: center;
@@ -222,6 +200,7 @@ ez-icon {
222
200
  .item__value--hidden {
223
201
  visibility: hidden;
224
202
  position: absolute;
203
+ white-space: nowrap;
225
204
  z-index: -1;
226
205
  top: 0;
227
206
  left: 0;
@@ -130,11 +130,11 @@ export class EzComboBox {
130
130
  return 0;
131
131
  }
132
132
  getWidthValue(value) {
133
- if (this._itemValueBasis) {
133
+ if (this._itemValueBasis != undefined) {
134
134
  const span = this._itemValueBasis;
135
- if (value) {
135
+ if (value != undefined) {
136
136
  span.innerHTML = value;
137
- return span.clientWidth > 0 ? (span.clientWidth + 1) : 0;
137
+ return span.clientWidth > 0 ? (span.clientWidth + 2) : 0;
138
138
  }
139
139
  else {
140
140
  span.innerHTML = "";
@@ -143,9 +143,10 @@ export class EzComboBox {
143
143
  return 0;
144
144
  }
145
145
  buildItem(opt, index) {
146
+ const widthValue = this.showOptionValue && this._maxWidthValue > 0 ? `${this._maxWidthValue}px` : '';
146
147
  return h("li", { class: index === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.selectOption(opt), onMouseOver: () => this._preSelection = undefined },
147
148
  this.showOptionValue
148
- ? h("span", { class: "item__value", title: opt.value, style: { width: this.showOptionValue && this._maxWidthValue > 0 ? `${this._maxWidthValue}px` : '' } }, opt.value)
149
+ ? h("span", { class: "item__value", title: opt.value, style: { width: widthValue, minWidth: widthValue, maxWidth: widthValue } }, opt.value)
149
150
  : undefined,
150
151
  h("span", { class: "item__label", title: opt.label }, opt.label));
151
152
  }
@@ -246,6 +247,7 @@ export class EzComboBox {
246
247
  }
247
248
  else {
248
249
  this.setInputValue();
250
+ this.hideOptions();
249
251
  }
250
252
  if (this.searchMode) {
251
253
  this._visibleOptions = [];
@@ -258,7 +260,8 @@ export class EzComboBox {
258
260
  this._criteria = argument;
259
261
  this._startLoading = true;
260
262
  if (this.optionLoader) {
261
- this.updateSource(this.optionLoader({ mode, argument }));
263
+ const searchArgument = { mode, argument };
264
+ this.updateSource(this.optionLoader(searchArgument));
262
265
  }
263
266
  else {
264
267
  this.updateSource(this.options);
@@ -327,7 +330,7 @@ export class EzComboBox {
327
330
  this.updateSource([]);
328
331
  }
329
332
  else {
330
- this.loadOptions("PRELOAD");
333
+ this.loadOptions(SearchMode.PRELOAD);
331
334
  }
332
335
  }
333
336
  componentDidRender() {
@@ -343,7 +346,7 @@ export class EzComboBox {
343
346
  // Event handlers
344
347
  //---------------------------------------------
345
348
  handlerIconClick() {
346
- this.searchMode ? this.loadOptions("ADVANCED") : this.showOptions();
349
+ this.searchMode ? this.loadOptions(SearchMode.ADVANCED) : this.showOptions();
347
350
  }
348
351
  onTextInputChangeHandler(event) {
349
352
  var _a;
@@ -365,7 +368,7 @@ export class EzComboBox {
365
368
  this._showLoading = true;
366
369
  this.clearSource();
367
370
  this._changeDeboucingTimeout = window.setTimeout(() => {
368
- this.loadOptions("PREDICTIVE", isNaN(argumentNumber) ? argument : argumentNumber.toString());
371
+ this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
369
372
  }, this._deboucingTime);
370
373
  }
371
374
  else {
@@ -390,6 +393,17 @@ export class EzComboBox {
390
393
  }
391
394
  keyDownHandler(event) {
392
395
  this._tabPressed = false;
396
+ if (event.ctrlKey) {
397
+ if (event.key === "f" || event.key === "F") {
398
+ this.loadOptions(SearchMode.ADVANCED);
399
+ //ATENÇÃO: Ctrl + F tem ação específica nos browsers
400
+ //nesse caso, como vamos abrir o popup de busca avançada,
401
+ //não é interessante deixar o evento propagar;
402
+ event.stopPropagation();
403
+ event.stopImmediatePropagation();
404
+ event.preventDefault();
405
+ }
406
+ }
393
407
  switch (event.key) {
394
408
  case "ArrowDown":
395
409
  this.nextOption();
@@ -408,7 +422,11 @@ export class EzComboBox {
408
422
  this.controlListWithOnlyOne();
409
423
  break;
410
424
  }
411
- event.stopPropagation();
425
+ //ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
426
+ //Por exemplo, quando o usuário dá um Enter, além de selecionar
427
+ //um valor, também significa que a ateração finalizou,
428
+ //e o contexto pode reagir (fechar um popup por exemplo).
429
+ //event.stopPropagation();
412
430
  }
413
431
  onTextInputFocusOutHandler() {
414
432
  this.cancelPreselection();
@@ -448,10 +466,10 @@ export class EzComboBox {
448
466
  "type": "string",
449
467
  "mutable": true,
450
468
  "complexType": {
451
- "original": "Option | string",
452
- "resolved": "Option | string",
469
+ "original": "IOption | string",
470
+ "resolved": "IOption | string",
453
471
  "references": {
454
- "Option": {
472
+ "IOption": {
455
473
  "location": "local"
456
474
  }
457
475
  }
@@ -504,13 +522,13 @@ export class EzComboBox {
504
522
  "type": "unknown",
505
523
  "mutable": true,
506
524
  "complexType": {
507
- "original": "Array<Option>",
508
- "resolved": "Option[]",
525
+ "original": "Array<IOption>",
526
+ "resolved": "IOption[]",
509
527
  "references": {
510
528
  "Array": {
511
529
  "location": "global"
512
530
  },
513
- "Option": {
531
+ "IOption": {
514
532
  "location": "local"
515
533
  }
516
534
  }
@@ -702,10 +720,10 @@ export class EzComboBox {
702
720
  "text": "Evento que \u00E9 disparado ao alterar o valor do componente"
703
721
  },
704
722
  "complexType": {
705
- "original": "Option",
706
- "resolved": "Option",
723
+ "original": "IOption",
724
+ "resolved": "IOption",
707
725
  "references": {
708
- "Option": {
726
+ "IOption": {
709
727
  "location": "local"
710
728
  }
711
729
  }
@@ -770,3 +788,9 @@ export class EzComboBox {
770
788
  "methodName": "observeValue"
771
789
  }]; }
772
790
  }
791
+ var SearchMode;
792
+ (function (SearchMode) {
793
+ SearchMode["ADVANCED"] = "ADVANCED";
794
+ SearchMode["PRELOAD"] = "PRELOAD";
795
+ SearchMode["PREDICTIVE"] = "PREDICTIVE";
796
+ })(SearchMode || (SearchMode = {}));
@@ -29,8 +29,8 @@ export class EzDateInput {
29
29
  }
30
30
  observeValue(newValue, oldValue) {
31
31
  if (this._textInput && newValue != oldValue) {
32
- const newValueValidated = this.validateValue(newValue);
33
- const oldValueValidated = this.validateValue(oldValue);
32
+ const newValueValidated = DateUtils.validateDate(newValue);
33
+ const oldValueValidated = DateUtils.validateDate(oldValue);
34
34
  if ((newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime()) !== (oldValueValidated === null || oldValueValidated === void 0 ? void 0 : oldValueValidated.getTime())) {
35
35
  const textValue = this.getTextValue(newValueValidated) || '';
36
36
  const parsedDate = DateUtils.strToDate(textValue);
@@ -63,8 +63,8 @@ export class EzDateInput {
63
63
  return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
64
64
  }
65
65
  changeValue(newValue) {
66
- const currentValue = this.validateValue(this.value);
67
- const newValueValidated = this.validateValue(newValue);
66
+ const currentValue = DateUtils.validateDate(this.value);
67
+ const newValueValidated = DateUtils.validateDate(newValue);
68
68
  if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.getTime()) !== (newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime())) {
69
69
  this.value = newValueValidated;
70
70
  }
@@ -87,8 +87,8 @@ export class EzDateInput {
87
87
  const newValue = DateUtils.strToDate(strValue);
88
88
  if (newValue || !strValue) {
89
89
  this.errorMessage = "";
90
- const currentValue = this.validateValue(this.value);
91
- const newValueValidated = this.validateValue(newValue);
90
+ const currentValue = DateUtils.validateDate(this.value);
91
+ const newValueValidated = DateUtils.validateDate(newValue);
92
92
  if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.getTime()) === (newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime())) {
93
93
  if (newValueValidated) {
94
94
  this._textInput.value = this.getTextValue(newValueValidated) || '';
@@ -112,8 +112,8 @@ export class EzDateInput {
112
112
  handleInput(event) {
113
113
  const strValue = this._textInput.value;
114
114
  const newValue = DateUtils.strToDate(strValue);
115
- const currentValue = this.validateValue(this.value);
116
- const newValueValidated = this.validateValue(newValue);
115
+ const currentValue = DateUtils.validateDate(this.value);
116
+ const newValueValidated = DateUtils.validateDate(newValue);
117
117
  if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.getTime()) !== (newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime())) {
118
118
  this._focused = true;
119
119
  this.ezStartChange.emit({ waitmessage: "", blocking: false });
@@ -122,11 +122,6 @@ export class EzDateInput {
122
122
  this.changeValue(new Date());
123
123
  }
124
124
  }
125
- validateValue(value) {
126
- return value instanceof Date && !isNaN(value.valueOf())
127
- ? DateUtils.clearTime(value)
128
- : undefined;
129
- }
130
125
  setInputValue() {
131
126
  const textValue = this.getTextValue(this.value) || '';
132
127
  if ((this._textInput.value || '') !== textValue) {
@@ -33,8 +33,8 @@ export class EzDateTimeInput {
33
33
  }
34
34
  observeValue(newValue, oldValue) {
35
35
  if (this._textInput && newValue != oldValue) {
36
- const newValueValidated = this.validateValue(newValue);
37
- const oldValueValidated = this.validateValue(oldValue);
36
+ const newValueValidated = DateUtils.validateDate(newValue, true);
37
+ const oldValueValidated = DateUtils.validateDate(oldValue, true);
38
38
  if ((newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime()) !== (oldValueValidated === null || oldValueValidated === void 0 ? void 0 : oldValueValidated.getTime())) {
39
39
  const textValue = this.getTextValue(newValueValidated) || '';
40
40
  const parsedDate = this.getParsedDateTime(textValue);
@@ -103,8 +103,8 @@ export class EzDateTimeInput {
103
103
  input.setSelectionRange(selectIni, selectFin);
104
104
  }
105
105
  changeValue(newValue) {
106
- const currentValue = this.validateValue(this.value);
107
- const newValueValidated = this.validateValue(newValue);
106
+ const currentValue = DateUtils.validateDate(this.value, true);
107
+ const newValueValidated = DateUtils.validateDate(newValue, true);
108
108
  if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.getTime()) !== (newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime())) {
109
109
  this.value = newValueValidated;
110
110
  }
@@ -133,8 +133,8 @@ export class EzDateTimeInput {
133
133
  const newValue = this.getParsedDateTime();
134
134
  if (newValue || !strValue) {
135
135
  this.errorMessage = "";
136
- const currentValue = this.validateValue(this.value);
137
- const newValueValidated = this.validateValue(newValue);
136
+ const currentValue = DateUtils.validateDate(this.value, true);
137
+ const newValueValidated = DateUtils.validateDate(newValue, true);
138
138
  if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.getTime()) === (newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime())) {
139
139
  if (newValueValidated) {
140
140
  this._textInput.value = this.getTextValue(newValueValidated) || '';
@@ -163,15 +163,10 @@ export class EzDateTimeInput {
163
163
  };
164
164
  return d ? (new Intl.DateTimeFormat('pt-BR', this.showSeconds ? optionsSecond : options).format(d)) : undefined;
165
165
  }
166
- validateValue(value) {
167
- return value instanceof Date && !isNaN(value.valueOf())
168
- ? value
169
- : undefined;
170
- }
171
166
  handleInput(event) {
172
167
  const newValue = this.getParsedDateTime();
173
- const currentValue = this.validateValue(this.value);
174
- const newValueValidated = this.validateValue(newValue);
168
+ const currentValue = DateUtils.validateDate(this.value, true);
169
+ const newValueValidated = DateUtils.validateDate(newValue, true);
175
170
  if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.getTime()) !== (newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime())) {
176
171
  this._focused = true;
177
172
  this.ezStartChange.emit({ waitmessage: "", blocking: false });
@@ -2,5 +2,6 @@ export var DialogType;
2
2
  (function (DialogType) {
3
3
  DialogType["WARN"] = "warn";
4
4
  DialogType["CRITICAL"] = "critical";
5
+ DialogType["SUCCESS"] = "success";
5
6
  DialogType["DEFAULT"] = "default";
6
7
  })(DialogType || (DialogType = {}));