@sankhyalabs/ezui 0.0.0-feat-dev-KB-35645.2 → 0.0.0-feat-dev-KB-35654.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 (23) hide show
  1. package/dist/cjs/ez-form-view.cjs.entry.js +13 -30
  2. package/dist/cjs/ez-grid.cjs.entry.js +9 -58
  3. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +0 -1
  4. package/dist/collection/components/ez-form-view/ez-form-view.css +1 -17
  5. package/dist/collection/components/ez-form-view/ez-form-view.js +5 -22
  6. package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
  7. package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +1 -1
  8. package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +3 -3
  9. package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +1 -1
  10. package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +1 -1
  11. package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +1 -1
  12. package/dist/collection/components/ez-grid/ez-grid.css +3 -8
  13. package/dist/collection/components/ez-grid/ez-grid.js +8 -59
  14. package/dist/custom-elements/index.js +21 -87
  15. package/dist/esm/ez-form-view.entry.js +14 -31
  16. package/dist/esm/ez-grid.entry.js +10 -59
  17. package/dist/ezui/ezui.esm.js +1 -1
  18. package/dist/ezui/{p-79bbf86d.entry.js → p-3c13d1e2.entry.js} +2 -2
  19. package/dist/ezui/p-60848ef6.entry.js +1 -0
  20. package/dist/types/components/ez-form-view/ez-form-view.d.ts +0 -3
  21. package/dist/types/components/ez-grid/ez-grid.d.ts +2 -14
  22. package/package.json +2 -2
  23. package/dist/ezui/p-db77a984.entry.js +0 -1
@@ -14,7 +14,7 @@ const buildCheckBox = (field) => {
14
14
  return buildField(field.name, field.label, field.readOnly, field.contextName, false);
15
15
  };
16
16
  function buildField(fieldName, fieldLabel, readOnly, contextName, switchMode) {
17
- return (index.h("div", { class: "ez-col ez-col--sd-12 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
17
+ return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
18
18
  index.h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.CheckMode.SWITCH : CheckMode.CheckMode.REGULAR, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName })));
19
19
  }
20
20
 
@@ -28,20 +28,20 @@ const buildComboBox = ({ name, label, readOnly, required, props, contextName, ca
28
28
  else {
29
29
  options = prop;
30
30
  }
31
- return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
31
+ return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
32
32
  index.h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, options: options, canShowError: canShowError })));
33
33
  };
34
34
 
35
35
  const buildDate = ({ name, label, readOnly, canShowError }) => {
36
- return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
36
+ return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
37
37
  index.h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
38
38
  };
39
39
  const buildTime = ({ name, label, readOnly, canShowError }) => {
40
- return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
40
+ return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
41
41
  index.h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
42
42
  };
43
43
  const buildDateTime = ({ name, label, readOnly, contextName, canShowError }) => {
44
- return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
44
+ return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
45
45
  index.h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError })));
46
46
  };
47
47
 
@@ -67,12 +67,12 @@ const buildInteger = ({ name, label, readOnly, contextName, canShowError }) => {
67
67
  return buildNumeric(name, label, readOnly, 0, 0, contextName, canShowError);
68
68
  };
69
69
  function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision, contextName, canShowError) {
70
- return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
70
+ return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
71
71
  index.h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName, canShowError: canShowError })));
72
72
  }
73
73
 
74
74
  const buildSearch = ({ name, label, readOnly, required, contextName, canShowError, optionLoader }) => {
75
- return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
75
+ return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
76
76
  index.h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError, optionLoader: optionLoader })));
77
77
  };
78
78
 
@@ -82,7 +82,7 @@ const buildTextArea = ({ name, label, readOnly, contextName, rows, canShowError
82
82
  };
83
83
 
84
84
  const buildTextInput = ({ name, label, readOnly, contextName, canShowError }) => {
85
- return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
85
+ return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
86
86
  index.h("ez-text-input", { label: label, "data-field-name": name, "data-context-name": contextName, key: name, enabled: !readOnly, canShowError: canShowError })));
87
87
  };
88
88
 
@@ -142,7 +142,7 @@ class FormItems {
142
142
  }
143
143
  }
144
144
 
145
- const ezFormViewCss = ".sc-ez-form-view-h{display:flex;flex-wrap:wrap;width:100%;--ez-form-view__item--min-width:220px;--ez-form-view__item--sapce-width:5px}.form-view__content.sc-ez-form-view{display:grid;grid-template-columns:repeat(auto-fill, minmax(var(--ez-form-view__item--min-width), 1fr));gap:var(--ez-form-view__item--sapce-width);width:100%}.input-full_width.sc-ez-form-view{grid-column:1 / -1;width:100%}";
145
+ const ezFormViewCss = ".sc-ez-form-view-h{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}";
146
146
 
147
147
  const EzFormView = class {
148
148
  constructor(hostRef) {
@@ -177,36 +177,19 @@ const EzFormView = class {
177
177
  const formItems = new FormItems(Array.from(this._element.querySelectorAll("[data-form-item]")));
178
178
  this.formItemsReady.emit(formItems);
179
179
  }
180
- isItemFullWidth(userInterface) {
181
- return [
182
- core.UserInterface.FILE,
183
- core.UserInterface.LONGTEXT
184
- ].includes(userInterface);
185
- }
186
- buildFormItemElement(item, classItem = "") {
187
- if (this.isItemFullWidth(item.userInterface)) {
188
- classItem += " input-full_width";
189
- }
190
- return index.h("div", { class: classItem }, fieldBuilder(item));
191
- }
192
180
  render() {
193
181
  core.ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezFormView');
194
182
  if (this.fields == undefined) {
195
183
  return;
196
184
  }
197
- let nonArrayGrup = [];
198
- let formContent = Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
185
+ return (index.h(index.Host, null, Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
199
186
  if (Array.isArray(value)) {
200
- return (index.h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, index.h("div", { class: "form-view__content" }, value.map(fi => (this.buildFormItemElement(fi))))));
187
+ return (index.h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, value.map(fi => fieldBuilder(fi))));
201
188
  }
202
189
  else {
203
- nonArrayGrup.push(value);
190
+ return fieldBuilder(value);
204
191
  }
205
- });
206
- // Filtra os elementos que não são arrays e os coloca dentro de uma única div
207
- let nonArrayElements = nonArrayGrup.map((value) => this.buildFormItemElement(value));
208
- let groupedNonArrayElements = index.h("div", { class: "form-view__content" }, nonArrayElements);
209
- return (index.h(index.Host, null, groupedNonArrayElements, formContent));
192
+ })));
210
193
  }
211
194
  get _element() { return index.getElement(this); }
212
195
  };
@@ -5,11 +5,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-a7b0c73d.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
8
+ const constants = require('./constants-2714478b.js');
9
+ const RecordValidationProcessor = require('./RecordValidationProcessor-4c893e04.js');
8
10
  const ApplicationUtils = require('./ApplicationUtils-c9d1205c.js');
9
11
  require('./DialogType-2114c337.js');
10
12
  require('./CheckMode-ecb90b87.js');
11
- const constants = require('./constants-2714478b.js');
12
- const RecordValidationProcessor = require('./RecordValidationProcessor-4c893e04.js');
13
13
 
14
14
  /**
15
15
  * @ag-grid-community/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.2.1
@@ -120637,7 +120637,7 @@ class InMemoryFilterColumnDataSource {
120637
120637
  }
120638
120638
  }
120639
120639
 
120640
- const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:0 0 16px 0 rgb(0 38 111 / 12%);--ez-grid--min-height:300px;min-height:var(--ez-grid--min-height)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid__container.sc-ez-grid{padding-top:15px;margin-top:-12px;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color)}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}.grid-header__pagination-label.sc-ez-grid{width:100%;white-space:nowrap}";
120640
+ const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:0 0 16px 0 rgb(0 38 111 / 12%);--ez-grid--min-height:300px;min-height:var(--ez-grid--min-height)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid__container.sc-ez-grid{padding-top:15px;margin-top:-12px;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color)}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}";
120641
120641
 
120642
120642
  const windowInstace = window;
120643
120643
  const matches = (text, filter) => {
@@ -120891,10 +120891,11 @@ const EzGrid = class {
120891
120891
  }
120892
120892
  getPaginationControl() {
120893
120893
  if (this._paginationInfo) {
120894
- const { currentPage, hasMore } = this._paginationInfo;
120894
+ const { firstRecord, lastRecord, total, count, currentPage, hasMore } = this._paginationInfo;
120895
120895
  return [
120896
- index.h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, index.h("span", { class: "grid-header__pagination-label" }, index.h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())),
120897
- index.h("div", { ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, index.h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), index.h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })),
120896
+ index.h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium" }, index.h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, `${firstRecord}-${lastRecord}`), total == undefined ? ` de ${count + 1} ou mais` : ` de ${total}`),
120897
+ index.h("ez-button", { size: "small", iconName: "chevron-left", class: "ez-margin-right--medium", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }),
120898
+ index.h("ez-button", { size: "small", iconName: "chevron-right", class: "ez-margin-right--medium", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" }),
120898
120899
  ];
120899
120900
  }
120900
120901
  return null;
@@ -120938,55 +120939,6 @@ const EzGrid = class {
120938
120939
  this.setEvents();
120939
120940
  this.componentReady.emit();
120940
120941
  this._gridController.configFilterColumn(this._filterColumn);
120941
- this._initHeaderOverflowWatcher();
120942
- }
120943
- _getActualPageLabel() {
120944
- const { firstRecord, lastRecord } = this._paginationInfo;
120945
- return `${firstRecord}-${lastRecord}`;
120946
- }
120947
- _getRemainingPageLabel() {
120948
- const { total, count } = this._paginationInfo;
120949
- return `${total == undefined ? ` de ${count + 1} ou mais` : ` de ${total}`}`;
120950
- }
120951
- _getPaginationTooltip() {
120952
- return this._getActualPageLabel() + this._getRemainingPageLabel();
120953
- }
120954
- _updatePaginationTooltip() {
120955
- if (!this._refPaginationLabelTooltip) {
120956
- return;
120957
- }
120958
- const alreadyDefined = this._refPaginationLabelTooltip.getAttribute('data-tooltip');
120959
- if (alreadyDefined) {
120960
- this._refPaginationLabelTooltip
120961
- .setAttribute('data-tooltip', this._getPaginationTooltip());
120962
- }
120963
- }
120964
- _initHeaderOverflowWatcher() {
120965
- this._headerOverflowWatcher = new core.OverflowWatcher(this._refHeader, (elementsOverflow) => {
120966
- if (!this._refPaginationLabel) {
120967
- return;
120968
- }
120969
- if (elementsOverflow.length > 0) {
120970
- this._hidePaginationDescription();
120971
- }
120972
- else {
120973
- this._showPaginationDescription();
120974
- }
120975
- }, core.OverflowDirection.HORIZONTAL, 20);
120976
- }
120977
- _hidePaginationDescription() {
120978
- this._refPaginationLabel.hidden = true;
120979
- this._refPaginationLabelTooltip.setAttribute('data-flow', 'bottom');
120980
- this._refPaginationLabelTooltip.setAttribute('data-tooltip', this._getPaginationTooltip());
120981
- }
120982
- ;
120983
- _showPaginationDescription() {
120984
- this._refPaginationLabel.hidden = false;
120985
- this._refPaginationLabelTooltip.removeAttribute('data-flow');
120986
- this._refPaginationLabelTooltip.removeAttribute('data-tooltip');
120987
- }
120988
- disconnectedCallback() {
120989
- this._headerOverflowWatcher.destroy();
120990
120942
  }
120991
120943
  componentWillRender() {
120992
120944
  this.configSelectionCounter();
@@ -121010,15 +120962,14 @@ const EzGrid = class {
121010
120962
  }
121011
120963
  render() {
121012
120964
  var _a;
121013
- return (index.h(index.Host, { "no-header": this.hideHeader() }, index.h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), index.h("div", { class: "grid-header__position", ref: ref => (this._refHeader = ref) }, index.h("div", { class: "grid-header__container" }, index.h("slot", { name: "leftButtons" })), index.h("div", { class: "grid-header__container", ref: ref => (this._refPaginationControl = ref) }, this.getPaginationControl()))), index.h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
120965
+ return (index.h(index.Host, { "no-header": this.hideHeader() }, index.h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), index.h("div", { class: "grid-header__position" }, index.h("div", { class: "grid-header__container" }, index.h("slot", { name: "leftButtons" })), index.h("div", { class: "grid-header__container", ref: ref => (this._refPaginationControl = ref) }, this.getPaginationControl()))), index.h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
121014
120966
  ${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
121015
120967
  ` }, index.h(SelectionCounter, { selectionCount: this._selectionCount, currentPageSelected: this._currentPageSelected, paginationInfo: this._paginationInfo, canSelectAll: (_a = this.selectionToastConfig) === null || _a === void 0 ? void 0 : _a.canSelectAll, allRecordSelected: this._isAllSelection, onSelectAll: () => this.onSelectAllRecords(), onSelectPage: () => this.onSelectPageRecords(), onClearAll: () => this.onClearSelectedRecords(), onClose: () => (this._showSelectionCounter = false) })), index.h("div", { class: "grid__footer" }, index.h("slot", { name: "footer" }))));
121016
120968
  }
121017
120969
  static get assetsDirs() { return ["../assets"]; }
121018
120970
  get _element() { return index.getElement(this); }
121019
120971
  static get watchers() { return {
121020
- "config": ["observeConfig"],
121021
- "_paginationInfo": ["_updatePaginationTooltip"]
120972
+ "config": ["observeConfig"]
121022
120973
  }; }
121023
120974
  };
121024
120975
  EzGrid.style = ezGridCss;
@@ -207,7 +207,6 @@ ez-icon {
207
207
  /*private*/
208
208
  display: flex;
209
209
  flex-wrap: wrap;
210
-
211
210
  width: 100%;
212
211
  height: 0px;
213
212
  max-height: 0px;
@@ -1,22 +1,6 @@
1
1
  :host {
2
2
  display: flex;
3
+ flex-direction: row;
3
4
  flex-wrap: wrap;
4
5
  width: 100%;
5
-
6
- /*@doc Define o tamanho mínimo dos itens do formulário.*/
7
- --ez-form-view__item--min-width: 220px;
8
- /*@doc Define o espaçamento entre itens do formulário.*/
9
- --ez-form-view__item--sapce-width: 5px;
10
- }
11
-
12
- .form-view__content{
13
- display: grid;
14
- grid-template-columns: repeat(auto-fill, minmax(var(--ez-form-view__item--min-width), 1fr));
15
- gap: var(--ez-form-view__item--sapce-width);
16
- width: 100%;
17
- }
18
-
19
- .input-full_width {
20
- grid-column: 1 / -1;
21
- width: 100%;
22
6
  }
@@ -1,6 +1,6 @@
1
1
  import { Host, h } from '@stencil/core';
2
2
  import { fieldBuilder } from './fieldbuilder/FieldBuilder';
3
- import { ElementIDUtils, UserInterface } from '@sankhyalabs/core';
3
+ import { ElementIDUtils } from '@sankhyalabs/core';
4
4
  import { FormItems } from './structure';
5
5
  export class EzFormView {
6
6
  constructor() {
@@ -32,36 +32,19 @@ export class EzFormView {
32
32
  const formItems = new FormItems(Array.from(this._element.querySelectorAll("[data-form-item]")));
33
33
  this.formItemsReady.emit(formItems);
34
34
  }
35
- isItemFullWidth(userInterface) {
36
- return [
37
- UserInterface.FILE,
38
- UserInterface.LONGTEXT
39
- ].includes(userInterface);
40
- }
41
- buildFormItemElement(item, classItem = "") {
42
- if (this.isItemFullWidth(item.userInterface)) {
43
- classItem += " input-full_width";
44
- }
45
- return h("div", { class: classItem }, fieldBuilder(item));
46
- }
47
35
  render() {
48
36
  ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezFormView');
49
37
  if (this.fields == undefined) {
50
38
  return;
51
39
  }
52
- let nonArrayGrup = [];
53
- let formContent = Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
40
+ return (h(Host, null, Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
54
41
  if (Array.isArray(value)) {
55
- return (h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, h("div", { class: "form-view__content" }, value.map(fi => (this.buildFormItemElement(fi))))));
42
+ return (h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, value.map(fi => fieldBuilder(fi))));
56
43
  }
57
44
  else {
58
- nonArrayGrup.push(value);
45
+ return fieldBuilder(value);
59
46
  }
60
- });
61
- // Filtra os elementos que não são arrays e os coloca dentro de uma única div
62
- let nonArrayElements = nonArrayGrup.map((value) => this.buildFormItemElement(value));
63
- let groupedNonArrayElements = h("div", { class: "form-view__content" }, nonArrayElements);
64
- return (h(Host, null, groupedNonArrayElements, formContent));
47
+ })));
65
48
  }
66
49
  static get is() { return "ez-form-view"; }
67
50
  static get encapsulation() { return "scoped"; }
@@ -7,5 +7,5 @@ export const buildCheckBox = (field) => {
7
7
  return buildField(field.name, field.label, field.readOnly, field.contextName, false);
8
8
  };
9
9
  function buildField(fieldName, fieldLabel, readOnly, contextName, switchMode) {
10
- return (h("div", { class: "ez-col ez-col--sd-12 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" }, h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName })));
10
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" }, h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName })));
11
11
  }
@@ -9,5 +9,5 @@ export const buildComboBox = ({ name, label, readOnly, required, props, contextN
9
9
  else {
10
10
  options = prop;
11
11
  }
12
- return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, options: options, canShowError: canShowError })));
12
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, options: options, canShowError: canShowError })));
13
13
  };
@@ -1,10 +1,10 @@
1
1
  import { h } from "@stencil/core";
2
2
  export const buildDate = ({ name, label, readOnly, canShowError }) => {
3
- return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
3
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
4
4
  };
5
5
  export const buildTime = ({ name, label, readOnly, canShowError }) => {
6
- return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
6
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
7
7
  };
8
8
  export const buildDateTime = ({ name, label, readOnly, contextName, canShowError }) => {
9
- return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError })));
9
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError })));
10
10
  };
@@ -8,5 +8,5 @@ export const buildInteger = ({ name, label, readOnly, contextName, canShowError
8
8
  return buildNumeric(name, label, readOnly, 0, 0, contextName, canShowError);
9
9
  };
10
10
  function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision, contextName, canShowError) {
11
- return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName, canShowError: canShowError })));
11
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName, canShowError: canShowError })));
12
12
  }
@@ -1,4 +1,4 @@
1
1
  import { h } from "@stencil/core";
2
2
  export const buildSearch = ({ name, label, readOnly, required, contextName, canShowError, optionLoader }) => {
3
- return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError, optionLoader: optionLoader })));
3
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError, optionLoader: optionLoader })));
4
4
  };
@@ -1,4 +1,4 @@
1
1
  import { h } from "@stencil/core";
2
2
  export const buildTextInput = ({ name, label, readOnly, contextName, canShowError }) => {
3
- return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-text-input", { label: label, "data-field-name": name, "data-context-name": contextName, key: name, enabled: !readOnly, canShowError: canShowError })));
3
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-text-input", { label: label, "data-field-name": name, "data-context-name": contextName, key: name, enabled: !readOnly, canShowError: canShowError })));
4
4
  };
@@ -4,7 +4,7 @@
4
4
  grid-template-rows: auto 1fr auto;
5
5
  height: 100%;
6
6
  width: 100%;
7
-
7
+
8
8
  /*public*/
9
9
  /*@doc Define a cor de fundo do header do componente.*/
10
10
  --ez-grid__header--background-color: var(--background--xlight, #FFF);
@@ -14,8 +14,8 @@
14
14
  --ez-grid__container--shadow: 0 0 16px 0 rgb(0 38 111 / 12%);
15
15
  /*@doc Define altura mínima da grid */
16
16
  --ez-grid--min-height: 300px;
17
-
18
- min-height: var(--ez-grid--min-height);
17
+
18
+ min-height: var(--ez-grid--min-height);
19
19
  }
20
20
 
21
21
  .grid-header {
@@ -96,8 +96,3 @@
96
96
  height: 0;
97
97
  padding: 0;
98
98
  }
99
-
100
- .grid-header__pagination-label {
101
- width: 100%;
102
- white-space: nowrap
103
- }
@@ -1,9 +1,9 @@
1
- import { ElementIDUtils, JSUtils, OverflowDirection, OverflowWatcher, StringUtils } from '@sankhyalabs/core';
1
+ import { ElementIDUtils, JSUtils, StringUtils, } from '@sankhyalabs/core';
2
2
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
3
- import { Host, h } from '@stencil/core';
4
- import { ApplicationUtils } from '../../utils';
3
+ import { h, Host } from '@stencil/core';
5
4
  import AgGridController from './controller/ag-grid/AgGridController';
6
5
  import { SelectionCounter } from './subcomponents/selection-counter';
6
+ import { ApplicationUtils } from '../../utils';
7
7
  import InMemoryFilterColumnDataSource from './utils/InMemoryFilterColumnDataSource';
8
8
  const windowInstace = window;
9
9
  const matches = (text, filter) => {
@@ -251,10 +251,11 @@ export class EzGrid {
251
251
  }
252
252
  getPaginationControl() {
253
253
  if (this._paginationInfo) {
254
- const { currentPage, hasMore } = this._paginationInfo;
254
+ const { firstRecord, lastRecord, total, count, currentPage, hasMore } = this._paginationInfo;
255
255
  return [
256
- h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, h("span", { class: "grid-header__pagination-label" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())),
257
- h("div", { ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })),
256
+ h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, `${firstRecord}-${lastRecord}`), total == undefined ? ` de ${count + 1} ou mais` : ` de ${total}`),
257
+ h("ez-button", { size: "small", iconName: "chevron-left", class: "ez-margin-right--medium", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }),
258
+ h("ez-button", { size: "small", iconName: "chevron-right", class: "ez-margin-right--medium", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" }),
258
259
  ];
259
260
  }
260
261
  return null;
@@ -298,55 +299,6 @@ export class EzGrid {
298
299
  this.setEvents();
299
300
  this.componentReady.emit();
300
301
  this._gridController.configFilterColumn(this._filterColumn);
301
- this._initHeaderOverflowWatcher();
302
- }
303
- _getActualPageLabel() {
304
- const { firstRecord, lastRecord } = this._paginationInfo;
305
- return `${firstRecord}-${lastRecord}`;
306
- }
307
- _getRemainingPageLabel() {
308
- const { total, count } = this._paginationInfo;
309
- return `${total == undefined ? ` de ${count + 1} ou mais` : ` de ${total}`}`;
310
- }
311
- _getPaginationTooltip() {
312
- return this._getActualPageLabel() + this._getRemainingPageLabel();
313
- }
314
- _updatePaginationTooltip() {
315
- if (!this._refPaginationLabelTooltip) {
316
- return;
317
- }
318
- const alreadyDefined = this._refPaginationLabelTooltip.getAttribute('data-tooltip');
319
- if (alreadyDefined) {
320
- this._refPaginationLabelTooltip
321
- .setAttribute('data-tooltip', this._getPaginationTooltip());
322
- }
323
- }
324
- _initHeaderOverflowWatcher() {
325
- this._headerOverflowWatcher = new OverflowWatcher(this._refHeader, (elementsOverflow) => {
326
- if (!this._refPaginationLabel) {
327
- return;
328
- }
329
- if (elementsOverflow.length > 0) {
330
- this._hidePaginationDescription();
331
- }
332
- else {
333
- this._showPaginationDescription();
334
- }
335
- }, OverflowDirection.HORIZONTAL, 20);
336
- }
337
- _hidePaginationDescription() {
338
- this._refPaginationLabel.hidden = true;
339
- this._refPaginationLabelTooltip.setAttribute('data-flow', 'bottom');
340
- this._refPaginationLabelTooltip.setAttribute('data-tooltip', this._getPaginationTooltip());
341
- }
342
- ;
343
- _showPaginationDescription() {
344
- this._refPaginationLabel.hidden = false;
345
- this._refPaginationLabelTooltip.removeAttribute('data-flow');
346
- this._refPaginationLabelTooltip.removeAttribute('data-tooltip');
347
- }
348
- disconnectedCallback() {
349
- this._headerOverflowWatcher.destroy();
350
302
  }
351
303
  componentWillRender() {
352
304
  this.configSelectionCounter();
@@ -370,7 +322,7 @@ export class EzGrid {
370
322
  }
371
323
  render() {
372
324
  var _a;
373
- return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position", ref: ref => (this._refHeader = ref) }, h("div", { class: "grid-header__container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container", ref: ref => (this._refPaginationControl = ref) }, this.getPaginationControl()))), h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
325
+ return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position" }, h("div", { class: "grid-header__container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container", ref: ref => (this._refPaginationControl = ref) }, this.getPaginationControl()))), h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
374
326
  ${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
375
327
  ` }, h(SelectionCounter, { selectionCount: this._selectionCount, currentPageSelected: this._currentPageSelected, paginationInfo: this._paginationInfo, canSelectAll: (_a = this.selectionToastConfig) === null || _a === void 0 ? void 0 : _a.canSelectAll, allRecordSelected: this._isAllSelection, onSelectAll: () => this.onSelectAllRecords(), onSelectPage: () => this.onSelectPageRecords(), onClearAll: () => this.onClearSelectedRecords(), onClose: () => (this._showSelectionCounter = false) })), h("div", { class: "grid__footer" }, h("slot", { name: "footer" }))));
376
328
  }
@@ -935,9 +887,6 @@ export class EzGrid {
935
887
  return [{
936
888
  "propName": "config",
937
889
  "methodName": "observeConfig"
938
- }, {
939
- "propName": "_paginationInfo",
940
- "methodName": "_updatePaginationTooltip"
941
890
  }];
942
891
  }
943
892
  static get listeners() {