@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-52057.0 → 0.0.0-bugfix-dev-59880.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 (134) hide show
  1. package/dist/cjs/ICustomRender-6fafffce.js +13 -0
  2. package/dist/cjs/ez-actions-button.cjs.entry.js +1 -0
  3. package/dist/cjs/ez-alert-list.cjs.entry.js +6 -4
  4. package/dist/cjs/ez-button.cjs.entry.js +2 -2
  5. package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -0
  6. package/dist/cjs/ez-combo-box.cjs.entry.js +1 -0
  7. package/dist/cjs/{ez-text-edit.cjs.entry.js → ez-custom-form-input_2.cjs.entry.js} +86 -0
  8. package/dist/cjs/ez-date-input.cjs.entry.js +1 -0
  9. package/dist/cjs/ez-form-view.cjs.entry.js +36 -4
  10. package/dist/cjs/ez-form.cjs.entry.js +51 -2
  11. package/dist/cjs/ez-grid.cjs.entry.js +322 -19
  12. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  13. package/dist/cjs/ez-modal-container.cjs.entry.js +2 -2
  14. package/dist/cjs/ez-number-input.cjs.entry.js +9 -2
  15. package/dist/cjs/ez-search.cjs.entry.js +6 -2
  16. package/dist/cjs/ez-split-item.cjs.entry.js +2 -1
  17. package/dist/cjs/ezui.cjs.js +1 -1
  18. package/dist/cjs/index-a7b0c73d.js +4 -4
  19. package/dist/cjs/loader.cjs.js +1 -1
  20. package/dist/collection/collection-manifest.json +1 -0
  21. package/dist/collection/components/ez-alert-list/ez-alert-list.js +6 -4
  22. package/dist/collection/components/ez-button/ez-button.css +7 -0
  23. package/dist/collection/components/ez-button/ez-button.js +1 -1
  24. package/dist/collection/components/ez-date-input/ez-date-input.js +1 -0
  25. package/dist/collection/components/ez-form/ez-form.js +130 -4
  26. package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +245 -0
  27. package/dist/collection/components/ez-form-view/ez-form-view.js +92 -2
  28. package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +3 -2
  29. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +62 -4
  30. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +35 -1
  31. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +58 -0
  32. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js +40 -0
  33. package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js +11 -0
  34. package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js +11 -0
  35. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +6 -3
  36. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js +40 -0
  37. package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js +1 -0
  38. package/dist/collection/components/ez-grid/ez-grid.js +206 -2
  39. package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js +1 -0
  40. package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
  41. package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -11
  42. package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js +22 -0
  43. package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
  44. package/dist/collection/components/ez-list/ez-list.css +6 -2
  45. package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -0
  46. package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
  47. package/dist/collection/components/ez-number-input/ez-number-input.js +12 -1
  48. package/dist/collection/components/ez-search/ez-search.js +5 -2
  49. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +1 -1
  50. package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js +5 -0
  51. package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js +1 -0
  52. package/dist/collection/utils/customRender/interfaces/ICustomRender.js +5 -0
  53. package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js +1 -0
  54. package/dist/collection/utils/index.js +2 -0
  55. package/dist/custom-elements/index.d.ts +6 -0
  56. package/dist/custom-elements/index.js +539 -44
  57. package/dist/esm/ICustomRender-875b5a40.js +13 -0
  58. package/dist/esm/ez-actions-button.entry.js +1 -0
  59. package/dist/esm/ez-alert-list.entry.js +6 -4
  60. package/dist/esm/ez-button.entry.js +2 -2
  61. package/dist/esm/ez-collapsible-box.entry.js +1 -0
  62. package/dist/esm/ez-combo-box.entry.js +1 -0
  63. package/dist/esm/{ez-text-edit.entry.js → ez-custom-form-input_2.entry.js} +88 -3
  64. package/dist/esm/ez-date-input.entry.js +1 -0
  65. package/dist/esm/ez-form-view.entry.js +36 -4
  66. package/dist/esm/ez-form.entry.js +51 -2
  67. package/dist/esm/ez-grid.entry.js +322 -19
  68. package/dist/esm/ez-list.entry.js +1 -1
  69. package/dist/esm/ez-modal-container.entry.js +2 -2
  70. package/dist/esm/ez-number-input.entry.js +9 -2
  71. package/dist/esm/ez-search.entry.js +6 -2
  72. package/dist/esm/ez-split-item.entry.js +2 -1
  73. package/dist/esm/ezui.js +1 -1
  74. package/dist/esm/index-baa5e267.js +4 -4
  75. package/dist/esm/loader.js +1 -1
  76. package/dist/ezui/ezui.esm.js +1 -1
  77. package/dist/ezui/p-09de35a2.entry.js +1 -0
  78. package/dist/ezui/p-13d2fe2d.entry.js +1 -0
  79. package/dist/ezui/{p-384247cd.entry.js → p-1f96ba9a.entry.js} +2 -2
  80. package/dist/ezui/p-204b1439.entry.js +1 -0
  81. package/dist/ezui/p-2b8da3a4.entry.js +1 -0
  82. package/dist/ezui/p-30775e7f.entry.js +1 -0
  83. package/dist/ezui/p-4607fb89.js +1 -0
  84. package/dist/ezui/{p-2a1a0e04.entry.js → p-77362d3a.entry.js} +1 -1
  85. package/dist/ezui/{p-8defa6d3.entry.js → p-786559c5.entry.js} +1 -1
  86. package/dist/ezui/p-7922142b.entry.js +1 -0
  87. package/dist/ezui/p-84e439b9.entry.js +1 -0
  88. package/dist/ezui/p-922ac38b.entry.js +1 -0
  89. package/dist/ezui/p-bae4e180.entry.js +1 -0
  90. package/dist/ezui/p-bcb53f27.entry.js +1 -0
  91. package/dist/ezui/p-c942e4a7.entry.js +1 -0
  92. package/dist/ezui/p-e90dd4eb.entry.js +1 -0
  93. package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +2 -2
  94. package/dist/types/components/ez-form/ez-form.d.ts +20 -1
  95. package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +41 -0
  96. package/dist/types/components/ez-form-view/ez-form-view.d.ts +11 -0
  97. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +29 -0
  98. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +11 -0
  99. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -1
  100. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +19 -0
  101. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +14 -0
  102. package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.d.ts +11 -0
  103. package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.d.ts +11 -0
  104. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +3 -0
  105. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +15 -0
  106. package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellRender.d.ts +10 -0
  107. package/dist/types/components/ez-grid/ez-grid.d.ts +30 -1
  108. package/dist/types/components/ez-grid/interfaces/ICustomFormatter.d.ts +5 -0
  109. package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
  110. package/dist/types/components/ez-grid/subcomponents/utils/selectionCounterUtils.d.ts +4 -0
  111. package/dist/types/components/ez-grid/test/resources/gridDataUnit.d.ts +2 -0
  112. package/dist/types/components/ez-number-input/ez-number-input.d.ts +1 -0
  113. package/dist/types/components.d.ts +120 -4
  114. package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +29 -0
  115. package/dist/types/utils/customEditor/interfaces/ICustomEditorInfo.d.ts +5 -0
  116. package/dist/types/utils/customRender/interfaces/ICustomRender.d.ts +29 -0
  117. package/dist/types/utils/customRender/interfaces/ICustomRenderInfo.d.ts +5 -0
  118. package/dist/types/utils/index.d.ts +2 -0
  119. package/package.json +1 -1
  120. package/react/components.d.ts +1 -0
  121. package/react/components.js +1 -0
  122. package/react/components.js.map +1 -1
  123. package/dist/ezui/p-0447d17c.entry.js +0 -1
  124. package/dist/ezui/p-20ec22c0.entry.js +0 -1
  125. package/dist/ezui/p-44c5b6a5.entry.js +0 -1
  126. package/dist/ezui/p-5ef056ce.entry.js +0 -1
  127. package/dist/ezui/p-86ff298d.entry.js +0 -1
  128. package/dist/ezui/p-99ead599.entry.js +0 -1
  129. package/dist/ezui/p-9aefaa52.entry.js +0 -1
  130. package/dist/ezui/p-9f1e89c9.entry.js +0 -1
  131. package/dist/ezui/p-b041333c.entry.js +0 -1
  132. package/dist/ezui/p-b567fa8c.entry.js +0 -1
  133. package/dist/ezui/p-bae3d0aa.entry.js +0 -1
  134. package/dist/ezui/p-db77a984.entry.js +0 -1
@@ -0,0 +1,13 @@
1
+ var CustomEditorSource;
2
+ (function (CustomEditorSource) {
3
+ CustomEditorSource["GRID"] = "GRID";
4
+ CustomEditorSource["FORM"] = "FORM";
5
+ })(CustomEditorSource || (CustomEditorSource = {}));
6
+
7
+ var CustomRenderSource;
8
+ (function (CustomRenderSource) {
9
+ CustomRenderSource["GRID"] = "GRID";
10
+ CustomRenderSource["FORM"] = "FORM";
11
+ })(CustomRenderSource || (CustomRenderSource = {}));
12
+
13
+ export { CustomEditorSource as C, CustomRenderSource as a };
@@ -4,6 +4,7 @@ import './ApplicationUtils-eaf91331.js';
4
4
  import { C as CSSVarsUtils } from './CSSVarsUtils-71ce76be.js';
5
5
  import './DialogType-54a62731.js';
6
6
  import './CheckMode-bdb2ec19.js';
7
+ import './ICustomRender-875b5a40.js';
7
8
 
8
9
  const ezActionsButtonCss = ":host{--ez-actions-button__actions-list--border-radius:var(--border--radius-medium, 12px);--ez-actions-button__actions-list--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-actions-button__actions-list--background-color:var(--background--xlight, #fff);--ez-actions-button__actions-list--padding:var(--space--small, 6px);--ez-actions-button__actions-list--top-margin:var(--space-small, 6px);--ez-actions-button__actions-list--z-index:var(--ez-elevation--8, 8);--ez-actions-button__actions-max-height:415px;--ez-actions-button__btn-action--min-width:'auto';--ez-actions-button__btn-action--background-color:var(--background--xlight, #fff);display:flex;flex-direction:column;height:fit-content;user-select:none}.ez-actions-button__actions-list{display:flex;flex-direction:column;position:fixed;width:fit-content;height:fit-content;overflow-y:auto;scrollbar-width:thin;z-index:var(--ez-actions-button__actions-list--z-index);padding:var(--ez-actions-button__actions-list--padding);margin-top:var(--ez-actions-button__actions-list--top-margin);background-color:var(--ez-actions-button__actions-list--background-color);border-radius:var(--ez-actions-button__actions-list--border-radius);box-shadow:var(--ez-actions-button__actions-list--box-shadow)}.ez-actions-button__actions-list--max-height{max-height:var(--ez-actions-button__actions-max-height)}.ez-actions-button__actions-list--lowered{margin-top:calc(var(--ez-actions-button__actions-list--top-margin) + 6px)}.ez-actions-button__btn-action{--ez-button--justify-content:flex-start;--ez-button--width:100%;--ez-button--min-width:var(--ez-actions-button__btn-action--min-width);--ez-button--background-color:var(--ez-actions-button__btn-action--background-color);--ez-button--font-weight:var(--text-weight--medium, 400);--ez-button--padding-left:var(--space--medium, 12px);--ez-button--padding-right:var(--space--medium, 12px)}.ez-actions-button__btn-action--spaced{--ez-button--padding-left:calc(var(--space--medium, 12px) + 24px)}.ez-actions-button__icon-right{margin-left:var(--space--small, 6px)}.ez-actions-button__icon-check,.ez-actions-button__icon-item{position:absolute;left:var(--space--medium, 12px)}.ez-actions-button__icon-check{color:var(--ez-button--hover-color)}.ez-actions-button__arrow{position:absolute;border-left:10px solid transparent;border-right:10px solid transparent;width:0;height:0;z-index:calc(var(--ez-actions-button__actions-list--z-index) + 1);border-bottom:15px solid var(--ez-actions-button__btn-action--background-color)}.ez-actions-button__arrow--upped{margin-top:calc((var(--ez-actions-button__actions-list--top-margin) + 2px) * -1)}.ez-actions-button__arrow--small{margin-left:6px}.ez-actions-button__arrow--medium{margin-left:11px}.ez-actions-button__arrow--large{margin-left:13px}.ez-actions-button__arrow:only-child{display:none}.ez-actions-button__btn-transparent{--ez-button--background-color:transparent;--ez-button--hover--background-color:transparent;--ez-button--active--background-color:transparent;--ez-button--focus--border:none}.ez-actions-button__btn-label{--ez-button--padding-left:var(--space--medium, 12px);--ez-button--padding-right:var(--space--medium, 12px)}.ez-actions-button__list-container{position:relative}.ez-actions-button--bottom-padding{padding-bottom:var(--space--small, 6px)}";
9
10
 
@@ -36,10 +36,12 @@ const EzAlertList = class {
36
36
  /**
37
37
  * Retorna o link para o titulo do alerta a partir do id.
38
38
  */
39
- getLinkTitle(item) {
39
+ getLinkActionClick(item) {
40
40
  var _a;
41
- const link = (_a = this.alerts.find((alert, index) => this.alertId(alert.title, index) === item.id)) === null || _a === void 0 ? void 0 : _a.link;
42
- return link !== null && link !== void 0 ? link : "#";
41
+ const action = (_a = this.alerts.find((alert, index) => this.alertId(alert.title, index) === item.id)) === null || _a === void 0 ? void 0 : _a.onClickLink;
42
+ if (action)
43
+ return action;
44
+ return () => { };
43
45
  }
44
46
  /**
45
47
  * Retorna o texto do título do alerta.
@@ -131,7 +133,7 @@ const EzAlertList = class {
131
133
  (h("div", { ref: elem => (this._overlayRef = elem) }, h("div", { class: `alert-list__container ${this.expanded ? 'expanded' : ''}`, ref: elem => (this._container = elem) }, h("div", { class: "alert-list__content" }, h("div", { class: "alert-list__header" }, h("div", { class: "alert-list__title" }, `Avisos (${this.alerts.length})`), h("div", { class: "alert-list__header__buttons" }, this.enableExpand && (h("ez-button", { mode: "icon", size: "small", iconName: "expand", onClick: () => this.toggleExpandContainer(), "data-element-id": ElementIDUtils.getInternalIDInfo('expandButton'), title: this.expanded ? 'Resumir' : 'Expandir' })), h("ez-button", { mode: "icon", size: "small", iconName: "close", "data-element-id": ElementIDUtils.getInternalIDInfo('closeButton'), onClick: () => {
132
134
  this.opened = false;
133
135
  }, title: 'Fechar' }))), h("div", { class: "alert-list__expandable-content" }, h("ez-list", { itemSlotBuilder: this.itemRightSlotBuilder, hoverFeedback: true, itemLeftSlotBuilder: item => {
134
- return (h("a", { href: this.getLinkTitle(item), style: {
136
+ return (h("a", { onClick: this.getLinkActionClick(item), style: {
135
137
  fontFamily: "var(--font-pattern, 'Roboto')",
136
138
  fontSize: 'var(--text--medium, 14px)',
137
139
  fontWeight: 'var(--text-weight--medium, 400)',
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, h, g as getElement } from './index-baa5e267.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
 
4
- const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--width:'auto';--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:0px;--ez-button--padding-bottom:0px;--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--justify-content:center;--ez-button--hover-color:var(--color--primary-600);--ez-button--hover--background-color:var(--background--medium, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--xlarge, 4px solid) var(--color--primary-300);--ez-button--focus--box-shadow:none;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{position:relative;display:flex;align-items:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-button--min-width);width:var(--ez-button--width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border);justify-content:var(--ez-button--justify-content)}button:focus{outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}";
4
+ const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--width:'auto';--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:0px;--ez-button--padding-bottom:0px;--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--justify-content:center;--ez-button--hover-color:var(--color--primary-600);--ez-button--hover--background-color:var(--background--medium, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--xlarge, 4px solid) var(--color--primary-300);--ez-button--focus--box-shadow:none;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link-disabled-color:var(--color--disable-primary, '#e5eaf0');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{position:relative;display:flex;align-items:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-button--min-width);width:var(--ez-button--width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border);justify-content:var(--ez-button--justify-content)}button:focus{outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}a.disabled{color:var(--ez-button--link-disabled-color);cursor:not-allowed}";
5
5
 
6
6
  const EzButton = class {
7
7
  constructor(hostRef) {
@@ -70,7 +70,7 @@ const EzButton = class {
70
70
  return (h("div", { class: "label-icon" }, h("button", { class: "btn-icon " + ((this.getIconSize()) ? `btn-icon--${this.getIconSize()}` : ""), type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize() })), h("label", { title: this.label }, this.label)));
71
71
  }
72
72
  else if (this.mode == "link") {
73
- return (h("a", { class: this.getIconSize(), ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
73
+ return (h("a", { class: `${this.getIconSize()} ${!this.enabled ? "disabled" : ""}`, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
74
74
  }
75
75
  else {
76
76
  return (h("button", { class: this.getIconSize(""), type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
@@ -3,6 +3,7 @@ import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { A as ApplicationUtils } from './ApplicationUtils-eaf91331.js';
4
4
  import './DialogType-54a62731.js';
5
5
  import './CheckMode-bdb2ec19.js';
6
+ import './ICustomRender-875b5a40.js';
6
7
 
7
8
  const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box--subtitle--font-size:var(--text--medium, 14px);--ez-collapsible-box--subtitle--font-family:var(--font-pattern, 'Roboto');--ez-collapsible-box--subtitle--font-weight:var(--text-weight--medium, 400);--ez-collapsible-box--subtitle--color:var(--text--primary);--ez-collapsible-box--subtitle--margin-bottom:var(--space--medium, 12px);--ez-collapsible-box--focus--color:var(--color--primary-600);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}ez-icon{--ez-icon--color:inherit}.collapsible-box{display:flex;flex-direction:column;width:100%}.collapsable-box--bordered{border:var(--border--small);border-color:var(--color--strokes);border-radius:var(--border--radius-medium);padding:var(--space--xs)}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:auto;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;color:var(--ez-collapsible-box--color);--ez-icon--color:var(--ez-collapsible-box__icon--color);margin-bottom:var(--space--medium, 12px)}.collapsible-box__title:focus{color:var(--ez-collapsible-box--focus--color);--ez-icon--color:var(--ez-collapsible-box--focus--color)}.collapsible-box__label{display:flex;white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;gap:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)}.subtitle-box__label{display:flex;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;font-family:var(--ez-collapsible-box--subtitle--font-family);font-size:var(--ez-collapsible-box--subtitle--font-size);font-weight:var(--ez-collapsible-box--subtitle--font-weight);color:var(--ez-collapsible-box--subtitle--color);margin-bottom:var(--ez-collapsible-box--subtitle--margin-bottom)}.subtitle-box__content{width:100%}.collapsible-box__label ez-icon{visibility:hidden;transition:2s all ease-in-out}.collapsible-box__label:hover ez-icon{visibility:visible}.collapsible-box__text-edit{margin-left:6px}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--left{margin-right:auto}.collapsible-box__title--right{margin-left:auto}.collapsible-box__title--center{margin-left:auto;margin-right:auto}.collapsible-box__title--stretch{justify-content:space-between;width:100%}.collapsible-box__title--no-margin{margin-bottom:0}.collapsible-box__content{display:flex;flex-wrap:wrap;width:100%;height:0px;max-height:0px;opacity:0;overflow:hidden;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;overflow:visible;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";
8
9
 
@@ -4,6 +4,7 @@ import './ApplicationUtils-eaf91331.js';
4
4
  import { C as CSSVarsUtils } from './CSSVarsUtils-71ce76be.js';
5
5
  import './DialogType-54a62731.js';
6
6
  import './CheckMode-bdb2ec19.js';
7
+ import './ICustomRender-875b5a40.js';
7
8
 
8
9
  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__list-min-width:64px;--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{min-width:var(--ez-combo-box__list-min-width);position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;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%;padding:0;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)}}";
9
10
 
@@ -1,9 +1,94 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
2
- import { ElementIDUtils } from '@sankhyalabs/core';
1
+ import { r as registerInstance, h, H as Host, c as createEvent, g as getElement } from './index-baa5e267.js';
2
+ import { C as CustomEditorSource } from './ICustomRender-875b5a40.js';
3
+ import { HTMLBuilder, StringUtils, ElementIDUtils } from '@sankhyalabs/core';
3
4
  import { A as ApplicationUtils } from './ApplicationUtils-eaf91331.js';
4
5
  import './DialogType-54a62731.js';
5
6
  import './CheckMode-bdb2ec19.js';
6
7
 
8
+ const EzCustomFormInput = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.gui = undefined;
12
+ this.customEditor = undefined;
13
+ this.formViewField = undefined;
14
+ this.value = undefined;
15
+ this.detailContext = undefined;
16
+ this.builderFallback = undefined;
17
+ }
18
+ /**
19
+ * Aplica foco no campo.
20
+ */
21
+ async setFocus() {
22
+ var _a, _b;
23
+ (_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["setFocus"]) === null || _b === void 0 ? void 0 : _b.call(_a);
24
+ }
25
+ /**
26
+ * Remove o foco do campo.
27
+ */
28
+ async setBlur() {
29
+ var _a, _b;
30
+ (_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["setBlur"]) === null || _b === void 0 ? void 0 : _b.call(_a);
31
+ }
32
+ /**
33
+ * Retorna se o conteúdo é inválido.
34
+ */
35
+ async isInvalid() {
36
+ var _a, _b;
37
+ return ((_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["isInvalid"]) === null || _b === void 0 ? void 0 : _b.call(_a)) || false;
38
+ }
39
+ getContent() {
40
+ var _a, _b;
41
+ const fieldProps = new Map();
42
+ for (const prop in this.formViewField.props) {
43
+ fieldProps.set(prop, this.formViewField.props[prop]);
44
+ }
45
+ const params = {
46
+ value: this.value,
47
+ name: this.formViewField.name,
48
+ currentEditor: this.builderFallback(this.formViewField),
49
+ editorMetadata: {
50
+ label: this.formViewField.label,
51
+ hidden: ((_a = this.formViewField.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
52
+ userInterface: this.formViewField.userInterface,
53
+ options: (_b = this.formViewField.props) === null || _b === void 0 ? void 0 : _b.options,
54
+ props: this.formViewField.props ? fieldProps : undefined,
55
+ optionLoader: this.formViewField.optionLoader
56
+ },
57
+ source: CustomEditorSource.FORM,
58
+ detailContext: this.detailContext
59
+ };
60
+ let gui = this.customEditor.getEditorElement(params);
61
+ if (!gui) {
62
+ gui = this.builderFallback(this.formViewField);
63
+ this.handleValue(gui);
64
+ this.gui = gui;
65
+ return;
66
+ }
67
+ if (!(gui instanceof HTMLElement) && typeof gui !== 'string') {
68
+ this.handleValue(gui);
69
+ this.gui = gui;
70
+ return;
71
+ }
72
+ if (typeof gui === 'string') {
73
+ gui = HTMLBuilder.parseElement(gui);
74
+ }
75
+ gui.setAttribute('value', this.value);
76
+ this.gui = h("div", { key: StringUtils.generateUUID(), ref: el => el && el.appendChild(gui) });
77
+ }
78
+ handleValue(gui) {
79
+ //@ts-ignore
80
+ gui.$children$.forEach((child) => {
81
+ child.$attrs$.value = this.value;
82
+ });
83
+ }
84
+ componentWillRender() {
85
+ this.getContent();
86
+ }
87
+ render() {
88
+ return (h(Host, null, this.gui));
89
+ }
90
+ };
91
+
7
92
  const ezTextEditCss = ":host{display:flex;align-items:center;gap:5px}.text-edit__form-input{width:auto;--ez-text-input__input--padding:0px}.text-edit__hidden-value{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}";
8
93
 
9
94
  const EzTextEdit = class {
@@ -100,4 +185,4 @@ const EzTextEdit = class {
100
185
  };
101
186
  EzTextEdit.style = ezTextEditCss;
102
187
 
103
- export { EzTextEdit as ez_text_edit };
188
+ export { EzCustomFormInput as ez_custom_form_input, EzTextEdit as ez_text_edit };
@@ -125,6 +125,7 @@ const EzDateInput = class {
125
125
  this.ezCancelWaitingChange.emit();
126
126
  }
127
127
  else {
128
+ this._focused = false;
128
129
  this.changeValue(newValueValidated);
129
130
  }
130
131
  }
@@ -55,8 +55,9 @@ const buildFile = ({ name, label, readOnly, contextName, props }) => {
55
55
  };
56
56
 
57
57
  const buildDecimal = ({ name, label, readOnly, props, contextName, canShowError }) => {
58
- const precision = Number((props === null || props === void 0 ? void 0 : props.precision) || 2);
59
- const prettyPrecision = Number((props === null || props === void 0 ? void 0 : props.prettyPrecision) || precision);
58
+ var _a, _b;
59
+ const precision = Number((_a = props === null || props === void 0 ? void 0 : props.precision) !== null && _a !== void 0 ? _a : 2);
60
+ const prettyPrecision = Number((_b = props === null || props === void 0 ? void 0 : props.prettyPrecision) !== null && _b !== void 0 ? _b : precision);
60
61
  return buildNumeric(name, label, readOnly, precision, prettyPrecision, contextName, canShowError);
61
62
  };
62
63
  const buildInteger = ({ name, label, readOnly, contextName, canShowError }) => {
@@ -145,11 +146,35 @@ const EzFormView = class {
145
146
  registerInstance(this, hostRef);
146
147
  this.ezContentReady = createEvent(this, "ezContentReady", 7);
147
148
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
149
+ this._customEditors = new Map();
148
150
  this.fields = undefined;
149
151
  }
150
152
  async showUp() {
151
153
  this._element.scrollIntoView({ behavior: "smooth", block: "start" });
152
154
  }
155
+ /**
156
+ * Registra um editor customizado para campos da grade e formulário.
157
+ */
158
+ async addCustomEditor(fieldName, customEditor, detailContext) {
159
+ const newCustomEditors = new Map(this._customEditors);
160
+ newCustomEditors.set(fieldName, { customEditor, detailContext });
161
+ this._customEditors = newCustomEditors;
162
+ }
163
+ /**
164
+ * Altera/adiciona uma propriedade nos metados do campo.
165
+ */
166
+ async setFieldProp(fieldName, propName, value) {
167
+ const fields = this.fields.map(field => {
168
+ if (field.name === fieldName) {
169
+ field.props = field.props || {};
170
+ if (value || value === 0) {
171
+ field.props[propName] = value;
172
+ }
173
+ }
174
+ return field;
175
+ });
176
+ this.fields = [...fields];
177
+ }
153
178
  groupFields(fields) {
154
179
  const result = new Map();
155
180
  fields.forEach(item => {
@@ -169,8 +194,9 @@ const EzFormView = class {
169
194
  return result;
170
195
  }
171
196
  componentDidRender() {
172
- this.ezContentReady.emit(Array.from(this._element.querySelectorAll("[data-field-name]")));
173
- const formItems = new FormItems(Array.from(this._element.querySelectorAll("[data-form-item]")));
197
+ this._formElements = Array.from(this._element.querySelectorAll("[data-field-name]"));
198
+ this.ezContentReady.emit(this._formElements);
199
+ const formItems = new FormItems(this._formElements);
174
200
  this.formItemsReady.emit(formItems);
175
201
  }
176
202
  isItemFullWidth(userInterface) {
@@ -180,9 +206,15 @@ const EzFormView = class {
180
206
  ].includes(userInterface);
181
207
  }
182
208
  buildFormItemElement(item, classItem = "") {
209
+ var _a;
183
210
  if (this.isItemFullWidth(item.userInterface)) {
184
211
  classItem += " input-full_width";
185
212
  }
213
+ if (this._customEditors.has(item.name)) {
214
+ const value = (_a = this._formElements.map(el => ({ name: el.dataset.fieldName, value: el['value'] })).find(field => field.name === item.name)) === null || _a === void 0 ? void 0 : _a.value;
215
+ const customEditor = this._customEditors.get(item.name).customEditor;
216
+ return h("div", { class: classItem }, h("ez-custom-form-input", { "data-field-name": item.name, customEditor: customEditor, formViewField: item, builderFallback: fieldBuilder, value: value }));
217
+ }
186
218
  return h("div", { class: classItem }, fieldBuilder(item));
187
219
  }
188
220
  render() {
@@ -845,15 +845,18 @@ const EzForm = class {
845
845
  this.ezFormSetFields = createEvent(this, "ezFormSetFields", 7);
846
846
  this.ezReady = createEvent(this, "ezReady", 7);
847
847
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
848
+ this._customEditors = new Map();
848
849
  this.onDataUnitAction = (action) => {
849
850
  if (action.type === Action.METADATA_LOADED) {
850
851
  this.processMetadata();
851
852
  }
852
853
  };
854
+ this._fieldsProps = new Map();
853
855
  this.dataUnit = undefined;
854
856
  this.config = undefined;
855
857
  this.recordsValidator = undefined;
856
858
  this.fieldToFocus = undefined;
859
+ this.onlyStaticFields = false;
857
860
  }
858
861
  /**
859
862
  * Realiza validação no conteúdo de todos os campos.
@@ -861,9 +864,30 @@ const EzForm = class {
861
864
  validate() {
862
865
  return this._dataBinder.validate();
863
866
  }
867
+ /**
868
+ * Registra um editor customizado para campos da grade e formulário.
869
+ */
870
+ async addCustomEditor(fieldName, customEditor, detailContext) {
871
+ if (this._formView) {
872
+ this._formView.addCustomEditor(fieldName, customEditor, detailContext);
873
+ return;
874
+ }
875
+ const newCustomEditors = new Map(this._customEditors);
876
+ newCustomEditors.set(fieldName, { customEditor, detailContext });
877
+ this._customEditors = newCustomEditors;
878
+ }
864
879
  observeConfig() {
865
880
  this.processMetadata();
866
881
  }
882
+ /**
883
+ * Altera/adiciona uma propriedade nos metadados do campo.
884
+ */
885
+ async setFieldProp(fieldName, propName, value) {
886
+ const newCustomFieldProps = new Map(this._fieldsProps);
887
+ const currentProps = this._fieldsProps.get(fieldName);
888
+ newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
889
+ this._fieldsProps = newCustomFieldProps;
890
+ }
867
891
  getDynamicContent() {
868
892
  var _a;
869
893
  const formMD = selectFormMetadata(this._store.getState());
@@ -890,10 +914,10 @@ const EzForm = class {
890
914
  }
891
915
  this.ezFormSetFields.emit(fields);
892
916
  const idFormSheet = `${StringUtils.replaceAccentuatedChars(StringUtils.toCamelCase(currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.label), false)}_selectorContainer`;
893
- return (h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, h("ez-form-view", { class: "ez-row ez-padding-vertical--small", fields: fields })));
917
+ return (h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, h("ez-form-view", { ref: (element) => (this._formView = element), class: "ez-row ez-padding-vertical--small", fields: fields })));
894
918
  }
895
919
  processMetadata() {
896
- if (!this.isStatic() && this.dataUnit && this._store) {
920
+ if (this.bindFields() && this.dataUnit && this._store) {
897
921
  const metadata = buildFormMetadata(this.config, this.dataUnit);
898
922
  this._store.dispatch(loadMetadata(metadata));
899
923
  }
@@ -902,6 +926,9 @@ const EzForm = class {
902
926
  var _a;
903
927
  return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
904
928
  }
929
+ bindFields() {
930
+ return !this.isStatic() || this.onlyStaticFields === false;
931
+ }
905
932
  componentWillLoad() {
906
933
  if (this.dataUnit === undefined) {
907
934
  this.dataUnit = new DataUnit("ez-form");
@@ -921,6 +948,17 @@ const EzForm = class {
921
948
  this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")), this.dataUnit.dataUnitId, metadata, this.recordsValidator);
922
949
  this.ezReady.emit();
923
950
  this.handleFieldToFocus();
951
+ this.setCustomEditors();
952
+ this.setFieldsProps();
953
+ }
954
+ setCustomEditors() {
955
+ if (!this._formView) {
956
+ return;
957
+ }
958
+ for (const [fieldName, customEditorProps] of this._customEditors) {
959
+ this._formView.addCustomEditor(fieldName, customEditorProps.customEditor, customEditorProps.detailContext);
960
+ this._customEditors.delete(fieldName);
961
+ }
924
962
  }
925
963
  handleFieldToFocus() {
926
964
  var _a;
@@ -937,6 +975,17 @@ const EzForm = class {
937
975
  this.ezFormRequestClearFieldToFocus.emit();
938
976
  });
939
977
  }
978
+ setFieldsProps() {
979
+ if (!this._formView) {
980
+ return;
981
+ }
982
+ for (const [fieldName, props] of this._fieldsProps) {
983
+ for (const prop in props) {
984
+ this._formView.setFieldProp(fieldName, prop, props[prop]);
985
+ }
986
+ this._fieldsProps.delete(fieldName);
987
+ }
988
+ }
940
989
  disconnectedCallback() {
941
990
  this.dataUnit.unsubscribe(this.onDataUnitAction);
942
991
  this._dataBinder.onDisconnectedCallback();