@sankhyalabs/ezui 5.20.0-dev.14 → 5.20.0-dev.15

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.
@@ -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-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
17
+ return (index.h("div", { class: "ez-col ez-col--sd-12 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-col--tb-3 ez-padding-horizontal--small" },
31
+ return (index.h("div", { class: "ez-col ez-col--sd-12 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-col--tb-3 ez-padding-horizontal--small" },
36
+ return (index.h("div", { class: "ez-col ez-col--sd-12 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-col--tb-3 ez-padding-horizontal--small" },
40
+ return (index.h("div", { class: "ez-col ez-col--sd-12 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-col--tb-3 ez-padding-horizontal--small" },
44
+ return (index.h("div", { class: "ez-col ez-col--sd-12 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-col--tb-3 ez-padding-horizontal--small" },
70
+ return (index.h("div", { class: "ez-col ez-col--sd-12 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-col--tb-3 ez-padding-horizontal--small" },
75
+ return (index.h("div", { class: "ez-col ez-col--sd-12 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-col--tb-3 ez-padding-horizontal--small" },
85
+ return (index.h("div", { class: "ez-col ez-col--sd-12 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-direction:row;flex-wrap:wrap;width:100%}";
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%}";
146
146
 
147
147
  const EzFormView = class {
148
148
  constructor(hostRef) {
@@ -177,19 +177,36 @@ 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
+ }
180
192
  render() {
181
193
  core.ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezFormView');
182
194
  if (this.fields == undefined) {
183
195
  return;
184
196
  }
185
- return (index.h(index.Host, null, Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
197
+ let nonArrayGrup = [];
198
+ let formContent = Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
186
199
  if (Array.isArray(value)) {
187
- return (index.h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, value.map(fi => fieldBuilder(fi))));
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))))));
188
201
  }
189
202
  else {
190
- return fieldBuilder(value);
203
+ nonArrayGrup.push(value);
191
204
  }
192
- })));
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));
193
210
  }
194
211
  get _element() { return index.getElement(this); }
195
212
  };
@@ -207,6 +207,7 @@ ez-icon {
207
207
  /*private*/
208
208
  display: flex;
209
209
  flex-wrap: wrap;
210
+
210
211
  width: 100%;
211
212
  height: 0px;
212
213
  max-height: 0px;
@@ -1,6 +1,22 @@
1
1
  :host {
2
2
  display: flex;
3
- flex-direction: row;
4
3
  flex-wrap: wrap;
5
4
  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%;
6
22
  }
@@ -1,6 +1,6 @@
1
1
  import { Host, h } from '@stencil/core';
2
2
  import { fieldBuilder } from './fieldbuilder/FieldBuilder';
3
- import { ElementIDUtils } from '@sankhyalabs/core';
3
+ import { ElementIDUtils, UserInterface } from '@sankhyalabs/core';
4
4
  import { FormItems } from './structure';
5
5
  export class EzFormView {
6
6
  constructor() {
@@ -32,19 +32,36 @@ 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
+ }
35
47
  render() {
36
48
  ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezFormView');
37
49
  if (this.fields == undefined) {
38
50
  return;
39
51
  }
40
- return (h(Host, null, Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
52
+ let nonArrayGrup = [];
53
+ let formContent = Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
41
54
  if (Array.isArray(value)) {
42
- return (h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, value.map(fi => fieldBuilder(fi))));
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))))));
43
56
  }
44
57
  else {
45
- return fieldBuilder(value);
58
+ nonArrayGrup.push(value);
46
59
  }
47
- })));
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));
48
65
  }
49
66
  static get is() { return "ez-form-view"; }
50
67
  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-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 })));
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 })));
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-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 })));
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 })));
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-col--tb-3 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-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-col--tb-3 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-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-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 })));
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 })));
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-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 })));
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 })));
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-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 })));
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 })));
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-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 })));
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 })));
4
4
  };
@@ -4710,7 +4710,7 @@ const buildCheckBox = (field) => {
4710
4710
  return buildField(field.name, field.label, field.readOnly, field.contextName, false);
4711
4711
  };
4712
4712
  function buildField(fieldName, fieldLabel, readOnly, contextName, switchMode) {
4713
- 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" },
4713
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
4714
4714
  h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName })));
4715
4715
  }
4716
4716
 
@@ -4724,20 +4724,20 @@ const buildComboBox$1 = ({ name, label, readOnly, required, props, contextName,
4724
4724
  else {
4725
4725
  options = prop;
4726
4726
  }
4727
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
4727
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
4728
4728
  h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, options: options, canShowError: canShowError })));
4729
4729
  };
4730
4730
 
4731
4731
  const buildDate$1 = ({ name, label, readOnly, canShowError }) => {
4732
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
4732
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
4733
4733
  h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
4734
4734
  };
4735
4735
  const buildTime$1 = ({ name, label, readOnly, canShowError }) => {
4736
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
4736
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
4737
4737
  h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
4738
4738
  };
4739
4739
  const buildDateTime$1 = ({ name, label, readOnly, contextName, canShowError }) => {
4740
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
4740
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
4741
4741
  h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError })));
4742
4742
  };
4743
4743
 
@@ -4763,12 +4763,12 @@ const buildInteger$1 = ({ name, label, readOnly, contextName, canShowError }) =>
4763
4763
  return buildNumeric$1(name, label, readOnly, 0, 0, contextName, canShowError);
4764
4764
  };
4765
4765
  function buildNumeric$1(fieldName, fieldLabel, readOnly, precision, prettyPrecision, contextName, canShowError) {
4766
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
4766
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
4767
4767
  h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName, canShowError: canShowError })));
4768
4768
  }
4769
4769
 
4770
4770
  const buildSearch$1 = ({ name, label, readOnly, required, contextName, canShowError, optionLoader }) => {
4771
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
4771
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
4772
4772
  h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError, optionLoader: optionLoader })));
4773
4773
  };
4774
4774
 
@@ -4778,7 +4778,7 @@ const buildTextArea = ({ name, label, readOnly, contextName, rows, canShowError
4778
4778
  };
4779
4779
 
4780
4780
  const buildTextInput$1 = ({ name, label, readOnly, contextName, canShowError }) => {
4781
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
4781
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
4782
4782
  h("ez-text-input", { label: label, "data-field-name": name, "data-context-name": contextName, key: name, enabled: !readOnly, canShowError: canShowError })));
4783
4783
  };
4784
4784
 
@@ -4838,7 +4838,7 @@ class FormItems {
4838
4838
  }
4839
4839
  }
4840
4840
 
4841
- const ezFormViewCss = ".sc-ez-form-view-h{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}";
4841
+ 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%}";
4842
4842
 
4843
4843
  const EzFormView$1 = class extends HTMLElement$1 {
4844
4844
  constructor() {
@@ -4874,19 +4874,36 @@ const EzFormView$1 = class extends HTMLElement$1 {
4874
4874
  const formItems = new FormItems(Array.from(this._element.querySelectorAll("[data-form-item]")));
4875
4875
  this.formItemsReady.emit(formItems);
4876
4876
  }
4877
+ isItemFullWidth(userInterface) {
4878
+ return [
4879
+ UserInterface.FILE,
4880
+ UserInterface.LONGTEXT
4881
+ ].includes(userInterface);
4882
+ }
4883
+ buildFormItemElement(item, classItem = "") {
4884
+ if (this.isItemFullWidth(item.userInterface)) {
4885
+ classItem += " input-full_width";
4886
+ }
4887
+ return h("div", { class: classItem }, fieldBuilder(item));
4888
+ }
4877
4889
  render() {
4878
4890
  ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezFormView');
4879
4891
  if (this.fields == undefined) {
4880
4892
  return;
4881
4893
  }
4882
- return (h(Host, null, Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
4894
+ let nonArrayGrup = [];
4895
+ let formContent = Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
4883
4896
  if (Array.isArray(value)) {
4884
- return (h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, value.map(fi => fieldBuilder(fi))));
4897
+ 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))))));
4885
4898
  }
4886
4899
  else {
4887
- return fieldBuilder(value);
4900
+ nonArrayGrup.push(value);
4888
4901
  }
4889
- })));
4902
+ });
4903
+ // Filtra os elementos que não são arrays e os coloca dentro de uma única div
4904
+ let nonArrayElements = nonArrayGrup.map((value) => this.buildFormItemElement(value));
4905
+ let groupedNonArrayElements = h("div", { class: "form-view__content" }, nonArrayElements);
4906
+ return (h(Host, null, groupedNonArrayElements, formContent));
4890
4907
  }
4891
4908
  get _element() { return this; }
4892
4909
  static get style() { return ezFormViewCss; }
@@ -1,4 +1,4 @@
1
- import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-baa5e267.js';
1
+ import { h, r as registerInstance, c as createEvent, g as getElement, H as Host } from './index-baa5e267.js';
2
2
  import { ObjectUtils, UserInterface, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { R as REQUIRED_INFO } from './constants-4e0d35b7.js';
4
4
  import { C as CheckMode } from './CheckMode-bdb2ec19.js';
@@ -10,7 +10,7 @@ const buildCheckBox = (field) => {
10
10
  return buildField(field.name, field.label, field.readOnly, field.contextName, false);
11
11
  };
12
12
  function buildField(fieldName, fieldLabel, readOnly, contextName, switchMode) {
13
- 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" },
13
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
14
14
  h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName })));
15
15
  }
16
16
 
@@ -24,20 +24,20 @@ const buildComboBox = ({ name, label, readOnly, required, props, contextName, ca
24
24
  else {
25
25
  options = prop;
26
26
  }
27
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
27
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
28
28
  h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, options: options, canShowError: canShowError })));
29
29
  };
30
30
 
31
31
  const buildDate = ({ name, label, readOnly, canShowError }) => {
32
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
32
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
33
33
  h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
34
34
  };
35
35
  const buildTime = ({ name, label, readOnly, canShowError }) => {
36
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
36
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
37
37
  h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
38
38
  };
39
39
  const buildDateTime = ({ name, label, readOnly, contextName, canShowError }) => {
40
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
40
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
41
41
  h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError })));
42
42
  };
43
43
 
@@ -63,12 +63,12 @@ const buildInteger = ({ name, label, readOnly, contextName, canShowError }) => {
63
63
  return buildNumeric(name, label, readOnly, 0, 0, contextName, canShowError);
64
64
  };
65
65
  function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision, contextName, canShowError) {
66
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
66
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
67
67
  h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName, canShowError: canShowError })));
68
68
  }
69
69
 
70
70
  const buildSearch = ({ name, label, readOnly, required, contextName, canShowError, optionLoader }) => {
71
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
71
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
72
72
  h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError, optionLoader: optionLoader })));
73
73
  };
74
74
 
@@ -78,7 +78,7 @@ const buildTextArea = ({ name, label, readOnly, contextName, rows, canShowError
78
78
  };
79
79
 
80
80
  const buildTextInput = ({ name, label, readOnly, contextName, canShowError }) => {
81
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
81
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
82
82
  h("ez-text-input", { label: label, "data-field-name": name, "data-context-name": contextName, key: name, enabled: !readOnly, canShowError: canShowError })));
83
83
  };
84
84
 
@@ -138,7 +138,7 @@ class FormItems {
138
138
  }
139
139
  }
140
140
 
141
- const ezFormViewCss = ".sc-ez-form-view-h{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}";
141
+ 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%}";
142
142
 
143
143
  const EzFormView = class {
144
144
  constructor(hostRef) {
@@ -173,19 +173,36 @@ const EzFormView = class {
173
173
  const formItems = new FormItems(Array.from(this._element.querySelectorAll("[data-form-item]")));
174
174
  this.formItemsReady.emit(formItems);
175
175
  }
176
+ isItemFullWidth(userInterface) {
177
+ return [
178
+ UserInterface.FILE,
179
+ UserInterface.LONGTEXT
180
+ ].includes(userInterface);
181
+ }
182
+ buildFormItemElement(item, classItem = "") {
183
+ if (this.isItemFullWidth(item.userInterface)) {
184
+ classItem += " input-full_width";
185
+ }
186
+ return h("div", { class: classItem }, fieldBuilder(item));
187
+ }
176
188
  render() {
177
189
  ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezFormView');
178
190
  if (this.fields == undefined) {
179
191
  return;
180
192
  }
181
- return (h(Host, null, Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
193
+ let nonArrayGrup = [];
194
+ let formContent = Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
182
195
  if (Array.isArray(value)) {
183
- return (h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, value.map(fi => fieldBuilder(fi))));
196
+ 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))))));
184
197
  }
185
198
  else {
186
- return fieldBuilder(value);
199
+ nonArrayGrup.push(value);
187
200
  }
188
- })));
201
+ });
202
+ // Filtra os elementos que não são arrays e os coloca dentro de uma única div
203
+ let nonArrayElements = nonArrayGrup.map((value) => this.buildFormItemElement(value));
204
+ let groupedNonArrayElements = h("div", { class: "form-view__content" }, nonArrayElements);
205
+ return (h(Host, null, groupedNonArrayElements, formContent));
189
206
  }
190
207
  get _element() { return getElement(this); }
191
208
  };
@@ -1 +1 @@
1
- import{p as e,b as o}from"./p-23a36bb6.js";export{s as setNonce}from"./p-23a36bb6.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o(JSON.parse('[["p-ac8c4e70",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"selectionToastConfig":[16],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"columnfilterDataSource":[16],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_showSelectionCounter":[32],"_isAllSelection":[32],"_currentPageSelected":[32],"_selectionCount":[32],"_hasLeftButtons":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64],"locateColumn":[64],"filterColumns":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-6e429cff",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"openGuideNavidator":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["p-940ed30b",[[1,"ez-alert-list",{"alerts":[1040],"enableDragAndDrop":[516,"enable-drag-and-drop"],"enableExpand":[516,"enable-expand"],"itemRightSlotBuilder":[16],"opened":[1540],"expanded":[1540]}]]],["p-eb36f072",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"showActions":[64],"isOpened":[64]}]]],["p-1e7a8633",[[1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]]],["p-49456b34",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"beforeClose":[1040],"show":[64]},[[8,"keydown","handleKeyDown"]]]]],["p-5d692ed1",[[6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]}]]],["p-b9fbf4e7",[[1,"ez-split-button",{"enabled":[516],"iconName":[513,"icon-name"],"image":[513],"items":[16],"label":[513],"leftTitle":[513,"left-title"],"rightTitle":[513,"right-title"],"mode":[513],"size":[513],"show":[32],"setBlur":[64],"setLeftButtonFocus":[64],"setRightButtonFocus":[64]},[[2,"click","clickListener"]]]]],["p-25ed09c6",[[4,"ez-split-item",{"label":[1],"enableExpand":[516,"enable-expand"],"size":[1],"_expanded":[32]}]]],["p-1f50fa05",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["p-650e4b6d",[[1,"ez-badge",{"size":[513],"label":[513],"iconLeft":[513,"icon-left"],"iconRight":[513,"icon-right"],"position":[1040],"hasSlot":[32]}]]],["p-17be134a",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"showNativeTooltip":[4,"show-native-tooltip"],"setFocus":[64],"setBlur":[64]}]]],["p-555c9018",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["p-bc2f844e",[[0,"ez-application"]]],["p-5ed81457",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["p-5e1d036e",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"heightMode":[1,"height-mode"],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"],"scrim":[1]}]]],["p-abc23d6f",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]}]]],["p-9f5fa3f9",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["p-85c8baae",[[0,"ez-skeleton",{"count":[2],"variant":[1],"width":[1],"height":[1],"marginBottom":[1,"margin-bottom"],"animation":[1]}]]],["p-07cbffce",[[0,"ez-split-panel",{"direction":[1],"anchorToExpand":[4,"anchor-to-expand"]}]]],["p-8becebf8",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["p-44caad9a",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["p-cc2dc4f4",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]]],["p-0447d17c",[[1,"ez-collapsible-box",{"value":[1540],"boxBordered":[4,"box-bordered"],"label":[513],"subtitle":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["p-c64f5363",[[1,"ez-combo-box",{"limitCharsToSearch":[2,"limit-chars-to-search"],"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-9cad9b6e",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-18e7870d",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"canShowError":[516,"can-show-error"],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-a80b1287",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"showUnder":[64],"hide":[64]}]]],["p-8defa6d3",[[1,"ez-list",{"dataSource":[1040],"listMode":[1,"list-mode"],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"itemLeftSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64],"removeSelection":[64]}]]],["p-0306dff7",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"fitHorizontal":[64],"hide":[64]},[[11,"scroll","scrollListener"]]]]],["p-5bd5e68f",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"password":[4],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-784fe207",[[2,"ez-multi-selection-list",{"columnName":[1,"column-name"],"dataSource":[16],"useOptions":[1028,"use-options"],"options":[1040],"isTextSearch":[4,"is-text-search"],"filteredOptions":[32],"displayOptions":[32],"viewScenario":[32],"displayOptionToCheckAllItems":[32],"clearFilteredOptions":[64]}]]],["p-baf80b13",[[0,"filter-column",{"opened":[4],"columnName":[1,"column-name"],"columnLabel":[1,"column-label"],"gridHeaderHidden":[4,"grid-header-hidden"],"noHeaderTaskBar":[1028,"no-header-task-bar"],"dataSource":[16],"dataUnit":[16],"options":[1040],"selectedItems":[32],"fieldDescriptor":[32],"useOptions":[32],"isTextSearch":[32],"hide":[64],"show":[64]}]]],["p-672dd122",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-50186acb",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-072e6347",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]},[[4,"click","handleClickOutside"]]]]],["p-9050d2cd",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"enableResize":[516,"enable-resize"],"appendTextToSelection":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-77a4bd35",[[1,"ez-upload",{"label":[1],"subtitle":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["p-20ec22c0",[[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}]]],["p-a08b309b",[[1,"ez-tree",{"items":[1040],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_tree":[32],"_waintingForLoad":[32],"selectItem":[64],"openItem":[64],"disableItem":[64],"enableItem":[64],"addChild":[64],"applyFilter":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["p-055fd02c",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"canShowError":[516,"can-show-error"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"],"options":[1040],"suppressSearch":[4,"suppress-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-5d86cca9",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"compact":[4],"getMode":[64],"setFocus":[64]}]]],["p-13dbad96",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["p-b041333c",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["p-e52cbcc7",[[0,"multi-selection-box-message",{"message":[1]}],[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}],[1,"ez-card-item",{"item":[16]}]]],["p-60848ef6",[[2,"ez-form-view",{"fields":[16],"showUp":[64]}]]],["p-2a1a0e04",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"validate":[64]}]]]]'),e)));
1
+ import{p as e,b as o}from"./p-23a36bb6.js";export{s as setNonce}from"./p-23a36bb6.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o(JSON.parse('[["p-ac8c4e70",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"selectionToastConfig":[16],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"columnfilterDataSource":[16],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_showSelectionCounter":[32],"_isAllSelection":[32],"_currentPageSelected":[32],"_selectionCount":[32],"_hasLeftButtons":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64],"locateColumn":[64],"filterColumns":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-6e429cff",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"openGuideNavidator":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["p-940ed30b",[[1,"ez-alert-list",{"alerts":[1040],"enableDragAndDrop":[516,"enable-drag-and-drop"],"enableExpand":[516,"enable-expand"],"itemRightSlotBuilder":[16],"opened":[1540],"expanded":[1540]}]]],["p-eb36f072",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"showActions":[64],"isOpened":[64]}]]],["p-1e7a8633",[[1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]]],["p-49456b34",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"beforeClose":[1040],"show":[64]},[[8,"keydown","handleKeyDown"]]]]],["p-5d692ed1",[[6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]}]]],["p-b9fbf4e7",[[1,"ez-split-button",{"enabled":[516],"iconName":[513,"icon-name"],"image":[513],"items":[16],"label":[513],"leftTitle":[513,"left-title"],"rightTitle":[513,"right-title"],"mode":[513],"size":[513],"show":[32],"setBlur":[64],"setLeftButtonFocus":[64],"setRightButtonFocus":[64]},[[2,"click","clickListener"]]]]],["p-25ed09c6",[[4,"ez-split-item",{"label":[1],"enableExpand":[516,"enable-expand"],"size":[1],"_expanded":[32]}]]],["p-1f50fa05",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["p-650e4b6d",[[1,"ez-badge",{"size":[513],"label":[513],"iconLeft":[513,"icon-left"],"iconRight":[513,"icon-right"],"position":[1040],"hasSlot":[32]}]]],["p-17be134a",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"showNativeTooltip":[4,"show-native-tooltip"],"setFocus":[64],"setBlur":[64]}]]],["p-555c9018",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["p-bc2f844e",[[0,"ez-application"]]],["p-5ed81457",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["p-5e1d036e",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"heightMode":[1,"height-mode"],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"],"scrim":[1]}]]],["p-abc23d6f",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]}]]],["p-9f5fa3f9",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["p-85c8baae",[[0,"ez-skeleton",{"count":[2],"variant":[1],"width":[1],"height":[1],"marginBottom":[1,"margin-bottom"],"animation":[1]}]]],["p-07cbffce",[[0,"ez-split-panel",{"direction":[1],"anchorToExpand":[4,"anchor-to-expand"]}]]],["p-8becebf8",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["p-44caad9a",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["p-cc2dc4f4",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]]],["p-0447d17c",[[1,"ez-collapsible-box",{"value":[1540],"boxBordered":[4,"box-bordered"],"label":[513],"subtitle":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["p-c64f5363",[[1,"ez-combo-box",{"limitCharsToSearch":[2,"limit-chars-to-search"],"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-9cad9b6e",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-18e7870d",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"canShowError":[516,"can-show-error"],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-a80b1287",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"showUnder":[64],"hide":[64]}]]],["p-8defa6d3",[[1,"ez-list",{"dataSource":[1040],"listMode":[1,"list-mode"],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"itemLeftSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64],"removeSelection":[64]}]]],["p-0306dff7",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"fitHorizontal":[64],"hide":[64]},[[11,"scroll","scrollListener"]]]]],["p-5bd5e68f",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"password":[4],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-784fe207",[[2,"ez-multi-selection-list",{"columnName":[1,"column-name"],"dataSource":[16],"useOptions":[1028,"use-options"],"options":[1040],"isTextSearch":[4,"is-text-search"],"filteredOptions":[32],"displayOptions":[32],"viewScenario":[32],"displayOptionToCheckAllItems":[32],"clearFilteredOptions":[64]}]]],["p-baf80b13",[[0,"filter-column",{"opened":[4],"columnName":[1,"column-name"],"columnLabel":[1,"column-label"],"gridHeaderHidden":[4,"grid-header-hidden"],"noHeaderTaskBar":[1028,"no-header-task-bar"],"dataSource":[16],"dataUnit":[16],"options":[1040],"selectedItems":[32],"fieldDescriptor":[32],"useOptions":[32],"isTextSearch":[32],"hide":[64],"show":[64]}]]],["p-672dd122",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-50186acb",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-072e6347",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]},[[4,"click","handleClickOutside"]]]]],["p-9050d2cd",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"enableResize":[516,"enable-resize"],"appendTextToSelection":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-77a4bd35",[[1,"ez-upload",{"label":[1],"subtitle":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["p-20ec22c0",[[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}]]],["p-a08b309b",[[1,"ez-tree",{"items":[1040],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_tree":[32],"_waintingForLoad":[32],"selectItem":[64],"openItem":[64],"disableItem":[64],"enableItem":[64],"addChild":[64],"applyFilter":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["p-055fd02c",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"canShowError":[516,"can-show-error"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"],"options":[1040],"suppressSearch":[4,"suppress-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-5d86cca9",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"compact":[4],"getMode":[64],"setFocus":[64]}]]],["p-13dbad96",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["p-b041333c",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["p-e52cbcc7",[[0,"multi-selection-box-message",{"message":[1]}],[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}],[1,"ez-card-item",{"item":[16]}]]],["p-db77a984",[[2,"ez-form-view",{"fields":[16],"showUp":[64]}]]],["p-2a1a0e04",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"validate":[64]}]]]]'),e)));
@@ -0,0 +1 @@
1
+ import{h as e,r as a,c as t,g as l,H as r}from"./p-23a36bb6.js";import{ObjectUtils as n,UserInterface as o,ElementIDUtils as i}from"@sankhyalabs/core";import{R as s}from"./p-05e1f4e7.js";import{C as d}from"./p-b853763b.js";function c(a,t,l,r,n){return e("div",{class:"ez-col ez-col--sd-12 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large"},e("ez-check",{enabled:!l,label:t,mode:n?d.SWITCH:d.REGULAR,"data-field-name":a,"data-context-name":r,key:a}))}function m(a,t,l,r,n,o,i){return e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-number-input",{enabled:!l,label:t,precision:r,prettyPrecision:n,"data-field-name":a,"data-context-name":o,key:a,canShowError:i}))}const h=({name:a,label:t,readOnly:l,contextName:r,canShowError:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-text-input",{label:t,"data-field-name":a,"data-context-name":r,key:a,enabled:!l,canShowError:n})),p=new Map;p.set(o.CHECKBOX,(e=>c(e.name,e.label,e.readOnly,e.contextName,!1))),p.set(o.SWITCH,(e=>c(e.name,e.label,e.readOnly,e.contextName,!0))),p.set(o.OPTIONSELECTOR,(({name:a,label:t,readOnly:l,required:r,props:n,contextName:o,canShowError:i})=>{const s=null==n?void 0:n.options;let d;if("string"==typeof s){const e=JSON.parse(s);d=Object.keys(e).map((a=>({value:a,label:e[a]})))}else d=s;return e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-combo-box",{enabled:!l,suppressEmptyOption:r,label:t,"data-field-name":a,"data-context-name":o,key:a,options:d,canShowError:i}))})),p.set(o.DATE,(({name:a,label:t,readOnly:l,canShowError:r})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-date-input",{enabled:!l,label:t,"data-field-name":a,key:a,canShowError:r})))),p.set(o.TIME,(({name:a,label:t,readOnly:l,canShowError:r})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-time-input",{enabled:!l,label:t,"data-field-name":a,key:a,canShowError:r})))),p.set(o.DATETIME,(({name:a,label:t,readOnly:l,contextName:r,canShowError:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-date-time-input",{enabled:!l,label:t,"data-field-name":a,"data-context-name":r,key:a,canShowError:n})))),p.set(o.FILE,(({name:a,label:t,readOnly:l,contextName:r,props:o})=>{const i=n.removeEmptyValues({subTitle:o.subTitle,requestHeaders:Object.assign(Object.assign({},o.STORAGESTRATEGY&&{STORAGESTRATEGY:o.STORAGESTRATEGY}),o.INTERNAL_FILENAME&&{INTERNAL_FILENAME:o.INTERNAL_FILENAME})});return e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-upload",Object.assign({enabled:!l,label:t,"data-field-name":a,"data-context-name":r,key:a},i)))})),p.set(o.DECIMALNUMBER,(({name:e,label:a,readOnly:t,props:l,contextName:r,canShowError:n})=>{const o=Number((null==l?void 0:l.precision)||2);return m(e,a,t,o,Number((null==l?void 0:l.prettyPrecision)||o),r,n)})),p.set(o.INTEGERNUMBER,(({name:e,label:a,readOnly:t,contextName:l,canShowError:r})=>m(e,a,t,0,0,l,r))),p.set(o.SEARCH,(({name:a,label:t,readOnly:l,required:r,contextName:n,canShowError:o,optionLoader:i})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-search",{enabled:!l,suppressEmptyOption:r,label:t,"data-field-name":a,"data-context-name":n,key:a,canShowError:o,optionLoader:i})))),p.set(o.LONGTEXT,(({name:a,label:t,readOnly:l,contextName:r,rows:n,canShowError:o})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small",key:a},e("ez-text-area",{enabled:!l,label:t,"data-field-name":a,"data-context-name":r,rows:n,canShowError:o}))));class z{constructor(e){this.elem=e}addRightElement(e){this.removeRightElement(),e.classList.add("ez-padding-left--small"),e.setAttribute("data-custom-item","true"),this.elem.classList.add("ez-col--nowrap"),this.elem.appendChild(e)}removeRightElement(){Array.from(this.elem.querySelectorAll('[data-custom-item="true"]')).forEach((e=>e.remove()))}get fieldName(){return this.elem.getAttribute("data-form-item")}}class u{constructor(e,a){this.items=new Map,this.formId=a,e.forEach((e=>{const a=new z(e);this.items.set(a.fieldName,a)}))}getItem(e){return this.items.get(e)}get formName(){return this.formId}}const b=class{constructor(e){a(this,e),this.ezContentReady=t(this,"ezContentReady",7),this.formItemsReady=t(this,"formItemsReady",7),this.fields=void 0}async showUp(){this._element.scrollIntoView({behavior:"smooth",block:"start"})}groupFields(e){const a=new Map;return e.forEach((e=>{const t=e.group;if(t){let l=a.get(t);null==l&&(l=[],a.set(t,l)),l.push(e)}else a.set(e.name,e)})),a}componentDidRender(){this.ezContentReady.emit(Array.from(this._element.querySelectorAll("[data-field-name]")));const e=new u(Array.from(this._element.querySelectorAll("[data-form-item]")));this.formItemsReady.emit(e)}isItemFullWidth(e){return[o.FILE,o.LONGTEXT].includes(e)}buildFormItemElement(a,t=""){return this.isItemFullWidth(a.userInterface)&&(t+=" input-full_width"),e("div",{class:t},(e=>{const a=p.get(e.userInterface)||h,t=e.required?`${e.label}${s}`:e.label,l=a(Object.assign(Object.assign({},e),{label:t}));return l.t["data-form-item"]=e.name,l})(a))}render(){if(i.addIDInfoIfNotExists(this._element,"ezFormView"),null==this.fields)return;let a=[],t=Array.from(this.groupFields(this.fields).entries()).map((([t,l])=>{if(Array.isArray(l))return e("ez-collapsible-box",{id:`group-${t}`,label:t,"header-size":"large",key:t},e("div",{class:"form-view__content"},l.map((e=>this.buildFormItemElement(e)))));a.push(l)})),l=a.map((e=>this.buildFormItemElement(e))),n=e("div",{class:"form-view__content"},l);return e(r,null,n,t)}get _element(){return l(this)}};b.style=".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%}";export{b as ez_form_view}
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
2
  import { IFormViewField } from './interfaces/IFormViewField';
3
+ import { UserInterface } from '@sankhyalabs/core';
3
4
  import { FormItems } from './structure';
4
5
  export declare class EzFormView {
5
6
  _element: HTMLEzFormViewElement;
@@ -18,5 +19,7 @@ export declare class EzFormView {
18
19
  showUp(): Promise<void>;
19
20
  private groupFields;
20
21
  componentDidRender(): void;
22
+ isItemFullWidth(userInterface: UserInterface): boolean;
23
+ buildFormItemElement(item: IFormViewField, classItem?: string): any;
21
24
  render(): any;
22
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/ezui",
3
- "version": "5.20.0-dev.14",
3
+ "version": "5.20.0-dev.15",
4
4
  "description": "Biblioteca de componentes Sankhya.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/custom-elements/index.js",
@@ -1 +0,0 @@
1
- import{h as e,r as a,c as t,H as l,g as o}from"./p-23a36bb6.js";import{ObjectUtils as n,UserInterface as r,ElementIDUtils as s}from"@sankhyalabs/core";import{R as d}from"./p-05e1f4e7.js";import{C as i}from"./p-b853763b.js";function c(a,t,l,o,n){return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large"},e("ez-check",{enabled:!l,label:t,mode:n?i.SWITCH:i.REGULAR,"data-field-name":a,"data-context-name":o,key:a}))}function m(a,t,l,o,n,r,s){return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-number-input",{enabled:!l,label:t,precision:o,prettyPrecision:n,"data-field-name":a,"data-context-name":r,key:a,canShowError:s}))}const z=({name:a,label:t,readOnly:l,contextName:o,canShowError:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-text-input",{label:t,"data-field-name":a,"data-context-name":o,key:a,enabled:!l,canShowError:n})),h=new Map;h.set(r.CHECKBOX,(e=>c(e.name,e.label,e.readOnly,e.contextName,!1))),h.set(r.SWITCH,(e=>c(e.name,e.label,e.readOnly,e.contextName,!0))),h.set(r.OPTIONSELECTOR,(({name:a,label:t,readOnly:l,required:o,props:n,contextName:r,canShowError:s})=>{const d=null==n?void 0:n.options;let i;if("string"==typeof d){const e=JSON.parse(d);i=Object.keys(e).map((a=>({value:a,label:e[a]})))}else i=d;return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-combo-box",{enabled:!l,suppressEmptyOption:o,label:t,"data-field-name":a,"data-context-name":r,key:a,options:i,canShowError:s}))})),h.set(r.DATE,(({name:a,label:t,readOnly:l,canShowError:o})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-date-input",{enabled:!l,label:t,"data-field-name":a,key:a,canShowError:o})))),h.set(r.TIME,(({name:a,label:t,readOnly:l,canShowError:o})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-time-input",{enabled:!l,label:t,"data-field-name":a,key:a,canShowError:o})))),h.set(r.DATETIME,(({name:a,label:t,readOnly:l,contextName:o,canShowError:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-date-time-input",{enabled:!l,label:t,"data-field-name":a,"data-context-name":o,key:a,canShowError:n})))),h.set(r.FILE,(({name:a,label:t,readOnly:l,contextName:o,props:r})=>{const s=n.removeEmptyValues({subTitle:r.subTitle,requestHeaders:Object.assign(Object.assign({},r.STORAGESTRATEGY&&{STORAGESTRATEGY:r.STORAGESTRATEGY}),r.INTERNAL_FILENAME&&{INTERNAL_FILENAME:r.INTERNAL_FILENAME})});return e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-upload",Object.assign({enabled:!l,label:t,"data-field-name":a,"data-context-name":o,key:a},s)))})),h.set(r.DECIMALNUMBER,(({name:e,label:a,readOnly:t,props:l,contextName:o,canShowError:n})=>{const r=Number((null==l?void 0:l.precision)||2);return m(e,a,t,r,Number((null==l?void 0:l.prettyPrecision)||r),o,n)})),h.set(r.INTEGERNUMBER,(({name:e,label:a,readOnly:t,contextName:l,canShowError:o})=>m(e,a,t,0,0,l,o))),h.set(r.SEARCH,(({name:a,label:t,readOnly:l,required:o,contextName:n,canShowError:r,optionLoader:s})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-search",{enabled:!l,suppressEmptyOption:o,label:t,"data-field-name":a,"data-context-name":n,key:a,canShowError:r,optionLoader:s})))),h.set(r.LONGTEXT,(({name:a,label:t,readOnly:l,contextName:o,rows:n,canShowError:r})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small",key:a},e("ez-text-area",{enabled:!l,label:t,"data-field-name":a,"data-context-name":o,rows:n,canShowError:r}))));const b=e=>{const a=h.get(e.userInterface)||z,t=e.required?`${e.label}${d}`:e.label,l=a(Object.assign(Object.assign({},e),{label:t}));return l.t["data-form-item"]=e.name,l};class p{constructor(e){this.elem=e}addRightElement(e){this.removeRightElement(),e.classList.add("ez-padding-left--small"),e.setAttribute("data-custom-item","true"),this.elem.classList.add("ez-col--nowrap"),this.elem.appendChild(e)}removeRightElement(){Array.from(this.elem.querySelectorAll('[data-custom-item="true"]')).forEach((e=>e.remove()))}get fieldName(){return this.elem.getAttribute("data-form-item")}}class u{constructor(e,a){this.items=new Map,this.formId=a,e.forEach((e=>{const a=new p(e);this.items.set(a.fieldName,a)}))}getItem(e){return this.items.get(e)}get formName(){return this.formId}}const y=class{constructor(e){a(this,e),this.ezContentReady=t(this,"ezContentReady",7),this.formItemsReady=t(this,"formItemsReady",7),this.fields=void 0}async showUp(){this._element.scrollIntoView({behavior:"smooth",block:"start"})}groupFields(e){const a=new Map;return e.forEach((e=>{const t=e.group;if(t){let l=a.get(t);null==l&&(l=[],a.set(t,l)),l.push(e)}else a.set(e.name,e)})),a}componentDidRender(){this.ezContentReady.emit(Array.from(this._element.querySelectorAll("[data-field-name]")));const e=new u(Array.from(this._element.querySelectorAll("[data-form-item]")));this.formItemsReady.emit(e)}render(){if(s.addIDInfoIfNotExists(this._element,"ezFormView"),null!=this.fields)return e(l,null,Array.from(this.groupFields(this.fields).entries()).map((([a,t])=>Array.isArray(t)?e("ez-collapsible-box",{id:`group-${a}`,label:a,"header-size":"large",key:a},t.map((e=>b(e)))):b(t))))}get _element(){return o(this)}};y.style=".sc-ez-form-view-h{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}";export{y as ez_form_view}