@sankhyalabs/ezui 1.1.92 → 1.1.95

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 (98) hide show
  1. package/dist/cjs/{CSSVarsUtils-66e86394.js → CSSVarsUtils-8fbdf2e0.js} +1 -0
  2. package/dist/cjs/StringUtils-0ba09df4.js +57 -0
  3. package/dist/cjs/ez-button_3.cjs.entry.js +578 -0
  4. package/dist/cjs/ez-calendar_14.cjs.entry.js +2625 -0
  5. package/dist/cjs/ez-dialog.cjs.entry.js +3 -3
  6. package/dist/cjs/{ez-button_11.cjs.entry.js → ez-grid.cjs.entry.js} +32 -1439
  7. package/dist/cjs/ez-icon.cjs.entry.js +42 -0
  8. package/dist/cjs/ez-modal_2.cjs.entry.js +317 -0
  9. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-time-input.cjs.entry.js +2 -2
  11. package/dist/cjs/ezui.cjs.js +1 -1
  12. package/dist/cjs/{index-a92e6d04.js → index-6164b259.js} +18 -18
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/collection/components/ez-check/ez-check.css +3 -3
  15. package/dist/collection/components/ez-combo-box/ez-combo-box.js +52 -3
  16. package/dist/collection/components/ez-dialog/ez-dialog.css +14 -2
  17. package/dist/collection/components/ez-dialog/ez-dialog.js +3 -5
  18. package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +4 -1
  19. package/dist/collection/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.js +4 -4
  20. package/dist/collection/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.js +2 -2
  21. package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +2 -2
  22. package/dist/collection/components/ez-form/fieldbuilder/tpl/FileInput.tpl.js +2 -2
  23. package/dist/collection/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.js +6 -6
  24. package/dist/collection/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.js +2 -2
  25. package/dist/collection/components/ez-form/fieldbuilder/tpl/TextArea.tpl.js +2 -2
  26. package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +10 -7
  27. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +19 -2
  28. package/dist/collection/components/ez-grid/ez-grid.css +8 -0
  29. package/dist/collection/components/ez-grid/ez-grid.js +3 -3
  30. package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +28 -4
  31. package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +6 -5
  32. package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +10 -7
  33. package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.js +12 -17
  34. package/dist/collection/components/ez-list/ez-list.css +23 -2
  35. package/dist/collection/components/ez-list/ez-list.js +138 -68
  36. package/dist/collection/components/ez-text-input/ez-text-input.css +2 -2
  37. package/dist/collection/components/ez-text-input/ez-text-input.js +24 -1
  38. package/dist/collection/components/test-du/test-du.js +1 -1
  39. package/dist/collection/utils/CSSVarsUtils.js +1 -0
  40. package/dist/collection/utils/index.js +2 -0
  41. package/dist/custom-elements/index.js +217 -120
  42. package/dist/esm/{CSSVarsUtils-aeee9825.js → CSSVarsUtils-667e0016.js} +1 -0
  43. package/dist/esm/StringUtils-cbf10229.js +55 -0
  44. package/dist/esm/ez-button_3.entry.js +572 -0
  45. package/dist/esm/ez-calendar_14.entry.js +2608 -0
  46. package/dist/esm/ez-dialog.entry.js +3 -3
  47. package/dist/esm/{ez-button_11.entry.js → ez-grid.entry.js} +24 -1421
  48. package/dist/esm/ez-icon.entry.js +38 -0
  49. package/dist/esm/ez-modal_2.entry.js +312 -0
  50. package/dist/esm/ez-popover.entry.js +1 -1
  51. package/dist/esm/ez-time-input.entry.js +2 -2
  52. package/dist/esm/ezui.js +1 -1
  53. package/dist/esm/{index-4fb1605f.js → index-74a9c220.js} +17 -17
  54. package/dist/esm/loader.js +1 -1
  55. package/dist/ezui/ezui.esm.js +1 -1
  56. package/dist/ezui/p-0a8018c2.entry.js +1 -0
  57. package/dist/ezui/{p-552a0b2e.entry.js → p-2617733e.entry.js} +1 -1
  58. package/dist/ezui/p-2f84ba72.js +1 -0
  59. package/dist/ezui/{p-d4386e30.entry.js → p-6714a1b2.entry.js} +46 -46
  60. package/dist/ezui/p-90f6d8a0.entry.js +1 -0
  61. package/dist/ezui/p-a943d501.entry.js +1 -0
  62. package/dist/ezui/p-b139372f.entry.js +1 -0
  63. package/dist/ezui/{p-f0137439.js → p-c6762896.js} +1 -1
  64. package/dist/ezui/p-d54c157f.js +1 -0
  65. package/dist/ezui/p-e06e47f1.entry.js +1 -0
  66. package/dist/ezui/{p-7e0281cd.entry.js → p-ef393d36.entry.js} +1 -1
  67. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +8 -0
  68. package/dist/types/components/ez-form/ez-form.d.ts +6 -1
  69. package/dist/types/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.d.ts +2 -1
  70. package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +2 -1
  71. package/dist/types/components/ez-form/fieldbuilder/tpl/FileInput.tpl.d.ts +2 -1
  72. package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +4 -2
  73. package/dist/types/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.d.ts +2 -1
  74. package/dist/types/components/ez-form/fieldbuilder/tpl/TextArea.tpl.d.ts +2 -1
  75. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +4 -1
  76. package/dist/types/components/ez-grid/subcomponents/select-box/select-box.d.ts +6 -4
  77. package/dist/types/components/ez-list/ez-list.d.ts +11 -6
  78. package/dist/types/components/ez-text-input/ez-text-input.d.ts +4 -0
  79. package/dist/types/components.d.ts +28 -4
  80. package/dist/types/utils/index.d.ts +2 -0
  81. package/package.json +1 -1
  82. package/dist/cjs/ApplicationUtils-d1c1db56.js +0 -35
  83. package/dist/cjs/ez-calendar.cjs.entry.js +0 -224
  84. package/dist/cjs/ez-collapsible-box_7.cjs.entry.js +0 -853
  85. package/dist/cjs/ez-combo-box.cjs.entry.js +0 -254
  86. package/dist/cjs/ez-form.cjs.entry.js +0 -753
  87. package/dist/esm/ApplicationUtils-01280a9d.js +0 -33
  88. package/dist/esm/ez-calendar.entry.js +0 -220
  89. package/dist/esm/ez-collapsible-box_7.entry.js +0 -843
  90. package/dist/esm/ez-combo-box.entry.js +0 -250
  91. package/dist/esm/ez-form.entry.js +0 -749
  92. package/dist/ezui/p-0094463f.entry.js +0 -1
  93. package/dist/ezui/p-020f1285.entry.js +0 -1
  94. package/dist/ezui/p-038fd0cb.entry.js +0 -1
  95. package/dist/ezui/p-60469339.entry.js +0 -1
  96. package/dist/ezui/p-7107d7ef.js +0 -1
  97. package/dist/ezui/p-8b099482.js +0 -1
  98. package/dist/ezui/p-d22db59d.entry.js +0 -1
@@ -15,6 +15,14 @@ export class EzComboBox {
15
15
  * Ajusta a opção de mostrar o "value" para cada opção. Por padrão não mostra
16
16
  */
17
17
  this.showOptionValue = false;
18
+ /**
19
+ * Remove a opção vazia da lista de opções
20
+ */
21
+ this.suppressEmptyOption = false;
22
+ /**
23
+ * Permite exibir a mensagem de erro.
24
+ */
25
+ this.canShowError = true;
18
26
  }
19
27
  internalUpdate() {
20
28
  if (this._inputElement) {
@@ -45,7 +53,12 @@ export class EzComboBox {
45
53
  const upperCriteria = this._criteria.toUpperCase();
46
54
  opts = opts.filter(opt => opt.label.toLocaleUpperCase().indexOf(upperCriteria) > -1);
47
55
  }
48
- this._visibleOptions = [{ value: undefined, label: "" }].concat(opts);
56
+ if (this.suppressEmptyOption) {
57
+ this._visibleOptions = opts;
58
+ }
59
+ else {
60
+ this._visibleOptions = [{ value: undefined, label: "" }].concat(opts);
61
+ }
49
62
  }
50
63
  buildItem(opt, index) {
51
64
  return h("li", { class: index === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.selectOption(opt), onMouseOver: () => this._preSelection = undefined },
@@ -59,7 +72,7 @@ export class EzComboBox {
59
72
  //FIXME: Provavelmente isso fará com que o popup abra em uma
60
73
  //posição errada no futuro. Preferi fazer simples no começo,
61
74
  //porque não quis onerar o text input com essa funcionalidade...
62
- const top = this.errorMessage ? "0px" : "-17px";
75
+ const top = (this.errorMessage || !this.canShowError) ? "0px" : "-17px";
63
76
  this._floatingID = FloatingManager.float(this._optionsList, this._listContainer, { autoClose: true, top });
64
77
  window.requestAnimationFrame(() => {
65
78
  this._optionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
@@ -232,7 +245,7 @@ export class EzComboBox {
232
245
  }
233
246
  render() {
234
247
  return (h(Host, null,
235
- h("ez-text-input", { ref: elem => this._inputElement = elem, enabled: this.enabled, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onEzChange: event => event.stopPropagation(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(), errorMessage: this.errorMessage }, this.searchMode ?
248
+ h("ez-text-input", { ref: elem => this._inputElement = elem, enabled: this.enabled, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onEzChange: event => event.stopPropagation(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(), canShowError: this.canShowError, errorMessage: this.errorMessage }, this.searchMode ?
236
249
  h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-search", onClick: () => { this.loadOptions("ADVANCED"); }, slot: "leftIcon" })
237
250
  :
238
251
  h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-options", slot: "rightIcon", onClick: () => this.showOptions() })),
@@ -414,6 +427,42 @@ export class EzComboBox {
414
427
  "tags": [],
415
428
  "text": "Fun\u00E7\u00E3o respons\u00E1vel por carregar as op\u00E7\u00F5es dinamicamente"
416
429
  }
430
+ },
431
+ "suppressEmptyOption": {
432
+ "type": "boolean",
433
+ "mutable": false,
434
+ "complexType": {
435
+ "original": "boolean",
436
+ "resolved": "boolean",
437
+ "references": {}
438
+ },
439
+ "required": false,
440
+ "optional": false,
441
+ "docs": {
442
+ "tags": [],
443
+ "text": "Remove a op\u00E7\u00E3o vazia da lista de op\u00E7\u00F5es"
444
+ },
445
+ "attribute": "suppress-empty-option",
446
+ "reflect": false,
447
+ "defaultValue": "false"
448
+ },
449
+ "canShowError": {
450
+ "type": "boolean",
451
+ "mutable": false,
452
+ "complexType": {
453
+ "original": "boolean",
454
+ "resolved": "boolean",
455
+ "references": {}
456
+ },
457
+ "required": false,
458
+ "optional": false,
459
+ "docs": {
460
+ "tags": [],
461
+ "text": "Permite exibir a mensagem de erro."
462
+ },
463
+ "attribute": "can-show-error",
464
+ "reflect": true,
465
+ "defaultValue": "true"
417
466
  }
418
467
  }; }
419
468
  static get states() { return {
@@ -37,6 +37,9 @@
37
37
  /*@doc Define a cor do texto da mensagem.*/
38
38
  --dialog__body--color: var(--text--primary, #626e82);
39
39
 
40
+ /* Ícones */
41
+ /*@doc Define a cor dos ícones dos indicadores de modo.*/
42
+ --dialog__icon--color: var(--text--inverted, #fff);
40
43
  /*@doc Define a cor de fundo dos indicadores do modo crítico.*/
41
44
  --dialog__critical--background-color: var(--color--alert-error-800, #BD0025);
42
45
  /*@doc Define a cor de fundo da lista de opções.*/
@@ -130,8 +133,17 @@ h2 {
130
133
  }
131
134
 
132
135
  .changeable__icon {
133
- width: 15px;
134
- height: 15px;
136
+ background: var(--dialog__warning--background-color);
137
+ color: var(--dialog__icon--color);
138
+ display: grid;
139
+ place-items: center;
140
+ width: 26px;
141
+ height: 26px;
142
+ border-radius: 50%;
143
+ }
144
+
145
+ .changeable__icon.critical{
146
+ background: var(--dialog__critical--background-color);
135
147
  }
136
148
 
137
149
  .title {
@@ -69,14 +69,12 @@ export class EzDialog {
69
69
  h("div", { class: "title__container" },
70
70
  h("div", { class: "title__box" },
71
71
  this._currentMessage.icon ?
72
- h("svg", { class: "changeable__icon", role: "img" },
73
- h("use", { xlinkHref: this._currentMessage.icon }))
72
+ h("ez-icon", { class: this._currentMessage.critical ? "changeable__icon critical" : "changeable__icon", size: "small", iconName: this._currentMessage.icon })
74
73
  :
75
74
  h("div", { class: this._currentMessage.critical ? "title-icon title-icon--critical" : "title-icon" }),
76
- h("div", { class: "title title--label" },
77
- h("h2", null, this._currentMessage.title))),
75
+ h("div", { class: "title title--label", innerHTML: this._currentMessage.title })),
78
76
  h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false) })),
79
- h("div", { class: "message" }, this._currentMessage.message),
77
+ h("div", { class: "message", innerHTML: this._currentMessage.message }),
80
78
  this._currentMessage.confirm ?
81
79
  h("div", { class: "button-yes-no__container" },
82
80
  h("ez-button", { class: "button__no", mode: "link", label: "N\u00E3o", onClick: () => this.handleButtonClick(false) }),
@@ -24,7 +24,6 @@ export const buildField = (field) => {
24
24
  let builder;
25
25
  let props;
26
26
  if (descriptor) {
27
- builder = uiBuilders.get(descriptor.userInterface);
28
27
  if (!config.label) {
29
28
  config.label = descriptor.label;
30
29
  }
@@ -34,7 +33,11 @@ export const buildField = (field) => {
34
33
  if (config.required === undefined) {
35
34
  config.required = descriptor.required;
36
35
  }
36
+ if (config.readOnly === undefined) {
37
+ config.readOnly = descriptor.readOnly;
38
+ }
37
39
  props = descriptor.properties;
40
+ builder = uiBuilders.get(descriptor.userInterface);
38
41
  }
39
42
  if (config.required) {
40
43
  config.label = `* ${config.label} (obrigatório)`;
@@ -1,11 +1,11 @@
1
1
  import { h } from "@stencil/core";
2
2
  export const buildSwitch = (fieldConfig) => {
3
- return buildField(fieldConfig.name, fieldConfig.label, true);
3
+ return buildField(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, true);
4
4
  };
5
5
  export const buildCheckBox = (fieldConfig) => {
6
- return buildField(fieldConfig.name, fieldConfig.label, false);
6
+ return buildField(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, false);
7
7
  };
8
- function buildField(fieldName, fieldLabel, switchMode = false) {
8
+ function buildField(fieldName, fieldLabel, readOnly, switchMode = false) {
9
9
  return (h("div", { class: "col col--sd-12 col--tb-3 padding--small align--middle padding-bottom--large" },
10
- h("ez-check", { label: fieldLabel, mode: switchMode ? "switch" : "regular", "data-field-name": fieldName, key: fieldName })));
10
+ h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? "switch" : "regular", "data-field-name": fieldName, key: fieldName })));
11
11
  }
@@ -1,5 +1,5 @@
1
1
  import { h } from "@stencil/core";
2
- export const buildComboBox = ({ name, label }, properties) => {
2
+ export const buildComboBox = ({ name, label, readOnly }, properties) => {
3
3
  const prop = properties === null || properties === void 0 ? void 0 : properties.options;
4
4
  let options;
5
5
  if (typeof prop === "string") {
@@ -10,5 +10,5 @@ export const buildComboBox = ({ name, label }, properties) => {
10
10
  options = prop;
11
11
  }
12
12
  return (h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
13
- h("ez-combo-box", { label: label, "data-field-name": name, key: name, options: options })));
13
+ h("ez-combo-box", { enabled: !readOnly, label: label, "data-field-name": name, key: name, options: options })));
14
14
  };
@@ -1,7 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
- export const buildDate = ({ name, label }) => {
2
+ export const buildDate = ({ name, label, readOnly }) => {
3
3
  return (h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
4
- h("ez-date-input", { label: label, "data-field-name": name, key: name })));
4
+ h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
5
5
  };
6
6
  export const buildTimeDate = ({ name, label }) => {
7
7
  return (h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
@@ -1,5 +1,5 @@
1
1
  import { h } from "@stencil/core";
2
- export const buildFile = ({ name, label }) => {
2
+ export const buildFile = ({ name, label, readOnly }) => {
3
3
  return (h("div", { class: "col col--sd-12 padding--small" },
4
- h("ez-upload", { label: label, urlUpload: "", requestHeaders: "", maxFiles: 10, "data-field-name": name, key: name })));
4
+ h("ez-upload", { enabled: !readOnly, label: label, urlUpload: "", requestHeaders: "", maxFiles: 10, "data-field-name": name, key: name })));
5
5
  };
@@ -1,13 +1,13 @@
1
1
  import { h } from "@stencil/core";
2
- export const buildDecimal = ({ name, label }, properties) => {
2
+ export const buildDecimal = ({ name, label, readOnly }, properties) => {
3
3
  const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
4
4
  const prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
5
- return buildNumeric(name, label, precision, prettyPrecision);
5
+ return buildNumeric(name, label, readOnly, precision, prettyPrecision);
6
6
  };
7
- export const buildInteger = ({ name, label }) => {
8
- return buildNumeric(name, label, 0, 0);
7
+ export const buildInteger = ({ name, label, readOnly }) => {
8
+ return buildNumeric(name, label, readOnly, 0, 0);
9
9
  };
10
- function buildNumeric(fieldName, fieldLabel, precision, prettyPrecision) {
10
+ function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision) {
11
11
  return (h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
12
- h("ez-number-input", { label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
12
+ h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
13
13
  }
@@ -1,5 +1,5 @@
1
1
  import { h } from "@stencil/core";
2
- export const buildSearch = ({ name, label }) => {
2
+ export const buildSearch = ({ name, label, readOnly }) => {
3
3
  return (h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
4
- h("ez-search", { label: label, optionLoader: (_argument) => { }, "data-field-name": name, key: name })));
4
+ h("ez-search", { enabled: !readOnly, label: label, optionLoader: (_argument) => { }, "data-field-name": name, key: name })));
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { h } from "@stencil/core";
2
- export const buildTextArea = ({ name, label }) => {
2
+ export const buildTextArea = ({ name, label, readOnly }) => {
3
3
  return (h("div", { class: "col col--sd-12 padding--small", key: name },
4
- h("ez-text-area", { label: label, "data-field-name": name })));
4
+ h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
5
5
  };
@@ -50,10 +50,11 @@ export const buildFromConfig = (fields, dataUnit) => {
50
50
  var _a;
51
51
  if (config.visible !== false) {
52
52
  const tab = config.tab || "Geral";
53
+ const tabConfig = (typeof tab === "string" ? { label: tab, visible: true } : tab);
53
54
  const descriptor = dataUnit.getField(config.name);
54
- if (descriptor) {
55
- if (!sheets.has(tab)) {
56
- sheets.set(tab, new Map());
55
+ if (descriptor && tabConfig.visible) {
56
+ if (!sheets.has(tabConfig)) {
57
+ sheets.set(tabConfig, new Map());
57
58
  }
58
59
  const isRequired = config.required === undefined ? descriptor.required : config.required;
59
60
  if (isRequired) {
@@ -63,7 +64,7 @@ export const buildFromConfig = (fields, dataUnit) => {
63
64
  if (clearOnCopy) {
64
65
  cleanOnCopyFields.push(config.name);
65
66
  }
66
- const tabItens = sheets.get(tab);
67
+ const tabItens = sheets.get(tabConfig);
67
68
  const fieldMD = { config, descriptor };
68
69
  const group = config.group;
69
70
  if (group) {
@@ -82,10 +83,12 @@ export const buildFromConfig = (fields, dataUnit) => {
82
83
  }
83
84
  });
84
85
  const metadata = new FormMetadata();
85
- sheets.forEach((value, key) => {
86
+ Array.from(sheets.entries())
87
+ .sort((a, b) => (a[0].order || 10000) - (b[0].order || 10000))
88
+ .forEach(([key, value]) => {
86
89
  metadata.addSheet({
87
- label: key,
88
- name: key,
90
+ label: key.label,
91
+ name: key.label,
89
92
  items: Array.from(value.values()),
90
93
  requiredFields,
91
94
  cleanOnCopyFields
@@ -3,11 +3,26 @@ import { Grid } from "ag-grid-community";
3
3
  import gridTerms from "./i18n/pt-BR.js";
4
4
  import HeaderColumnTemplate from "./template/HeaderColumnTemplate.js";
5
5
  import DataSource from "./DataSource";
6
+ import { DataType } from "@sankhyalabs/core";
7
+ import { SortMode } from "@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";
6
8
  export default class AgGridController {
7
9
  constructor(enterprise) {
8
10
  this._menuItems = [];
9
11
  this._enterprise = enterprise;
10
12
  }
13
+ getSort() {
14
+ const sortedColumns = [];
15
+ this._gridOptions.api.getSortModel().forEach(({ colId, sort }) => {
16
+ if (sort) {
17
+ const field = this._dataUnit.getField(colId);
18
+ const mode = sort === "asc" ? SortMode.ASC : SortMode.DESC;
19
+ const sortField = field ? { field: field.name, dataType: field.dataType, mode } : { field: colId, dataType: DataType.TEXT, mode };
20
+ sortedColumns.push(sortField);
21
+ }
22
+ });
23
+ return sortedColumns;
24
+ }
25
+ ;
11
26
  initDatagrid(container, options) {
12
27
  if (this._grid === undefined) {
13
28
  this._columnStateChangeCallback = options.onColumnStateChange;
@@ -18,6 +33,7 @@ export default class AgGridController {
18
33
  this._pageSize = options.pageSize;
19
34
  this._serverURL = options.serverURL;
20
35
  this._dataUnit = options.dataUnit;
36
+ this._dataUnit.sortingProvider = this;
21
37
  this._gridOptions = {
22
38
  localeText: gridTerms,
23
39
  rowModelType: "serverSide",
@@ -81,8 +97,9 @@ export default class AgGridController {
81
97
  headerName: "",
82
98
  checkboxSelection: true,
83
99
  headerCheckboxSelection: false,
84
- width: 100,
85
- suppressMovable: true
100
+ width: 24,
101
+ suppressMovable: true,
102
+ suppressMenu: true
86
103
  });
87
104
  }
88
105
  cols.forEach(c => {
@@ -14,6 +14,14 @@
14
14
  align-items: center;
15
15
 
16
16
  /*public*/
17
+ background-color: var(--ezgrid__header--background-color, #FFF);
18
+ z-index: var(--visible);
19
+ }
20
+
21
+ .grid__container{
22
+ box-shadow: 0 0 16px 0 rgb(0 38 111 / 12%);
23
+ padding-top: 15px;
24
+ margin-top: -12px;
17
25
  background-color: var(--ezgrid__header--background-color);
18
26
  }
19
27
 
@@ -91,8 +91,8 @@ export class EzGrid {
91
91
  h("div", { class: "text text--primary text--medium margin-right--medium" },
92
92
  h("strong", { class: "text text--primary text--medium" }, `${this._navigationFirstRow}-${this._navigationLastRow}`),
93
93
  ` de ${this._navigationTotalRows}`),
94
- h("ez-button", { size: "small", iconName: "chevron-left", class: "button--secondary margin-right--medium", mode: "icon", enabled: this._navigationHasPrevious, onClick: () => this._gridController.previousPage(), label: "P\u00E1gina anterior" }),
95
- h("ez-button", { size: "small", iconName: "chevron-right", class: "button--secondary margin-right--medium", mode: "icon", enabled: this._navigationHasNext, onClick: () => this._gridController.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })
94
+ h("ez-button", { size: "small", iconName: "chevron-left", class: "margin-right--medium", mode: "icon", enabled: this._navigationHasPrevious, onClick: () => this._gridController.previousPage(), label: "P\u00E1gina anterior" }),
95
+ h("ez-button", { size: "small", iconName: "chevron-right", class: "margin-right--medium", mode: "icon", enabled: this._navigationHasNext, onClick: () => this._gridController.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })
96
96
  ];
97
97
  }
98
98
  applyConfig(cols) {
@@ -109,7 +109,7 @@ export class EzGrid {
109
109
  }
110
110
  render() {
111
111
  return (h(Host, null,
112
- h("div", { class: "box box--shadow padding--medium grid-header margin-bottom--small" },
112
+ h("div", { class: "box box--shadow padding--medium grid-header" },
113
113
  h("div", { class: "grid-header__container" },
114
114
  h("slot", { name: "leftButtons" })),
115
115
  h("div", { class: "grid-header__container" },
@@ -17,7 +17,7 @@
17
17
 
18
18
  --ez-grid-config__title--font-family: var(--font-pattern, "Sora");
19
19
 
20
- --ez-grid-config__title--font-weight: var(--text-weight--large, 14px);
20
+ --ez-grid-config__title--font-weight: var(--text-weight--large, 700);
21
21
 
22
22
  /*@doc Define o tamanho da fonte utilizada para o subtitulo do componente.*/
23
23
  --ez-grid-config__subtitle--font-size: var(--text--medium, 14px);
@@ -31,6 +31,15 @@
31
31
  /*@doc Define o raio da borda da barra de rolagem do componente.*/
32
32
  --ez-grid-config__main__scrollbar--border-radius: var(--border--radius-medium, 12px);
33
33
 
34
+ /* @doc Define o estilo do texto do grupo da lista. */
35
+ --ez-grid__group--font-family: var(--font-pattern, "Sora");
36
+ /* @doc Define o tamanho do texto do grupo da lista. */
37
+ --ez-grid__group--font-size: var(--text--medium, 14px);
38
+ /* @doc Define o peso do texto do grupo da lista. */
39
+ --ez-grid__group--font-weight: var(--text-weight--large, 600);
40
+ /* @doc Define o espaçamento inferior do grupo da lista. */
41
+ --ez-grid__group--padding-bottom: var(--space-small, 6px);
42
+
34
43
  display: grid;
35
44
  grid-template-rows: auto 1fr auto;
36
45
  max-height: 100%;
@@ -44,6 +53,9 @@
44
53
  ez-list {
45
54
  height: 100%;
46
55
  }
56
+ .heigth-calc{
57
+ max-height: calc(100% - 24px);
58
+ }
47
59
 
48
60
  .grid-config__footer {
49
61
  padding-top: var(--ez-grid-config__footer--padding-top);
@@ -71,21 +83,27 @@ ez-list {
71
83
 
72
84
  .title-container {
73
85
  display: flex;
74
- justify-content: center;
86
+ justify-content: space-between;
75
87
  align-items: center;
88
+ width: 359px;
76
89
  }
77
90
 
78
91
  .subtitle {
79
92
  font-family: var(--ez-grid-config__subtitle--font-family);
80
93
  font-size: var(--ez-grid-config__subtitle--font-size);
94
+ color: var(--text--primary);
81
95
  }
82
96
 
83
97
  .title {
84
98
  display: flex;
85
- font-family: var(--ez-grid-config__title--font-family);
86
99
  margin: 0;
100
+ font-family: var(--ez-grid-config__title--font-family);
101
+ font-size: var(--title--large);
87
102
  font-weight: var(--ez-grid-config__title--font-weight);
88
- line-height: 1.3;
103
+ line-height: normal;
104
+ letter-spacing: 0em;
105
+ text-align: left;
106
+ color: var(--title--primary);
89
107
  }
90
108
 
91
109
  .grid-config__main::-webkit-scrollbar-track {
@@ -102,4 +120,10 @@ ez-list {
102
120
  width: var(--ez-grid-config__scrollbar--width);
103
121
  max-width: var(--ez-grid-config__scrollbar--width);
104
122
  min-width: var(--ez-grid-config__scrollbar--width);
123
+ }
124
+ .group-name {
125
+ font-family: var(--ez-grid__group--font-family);
126
+ font-size: var(--ez-grid__group--font-size);
127
+ font-weight: var(--ez-grid__group--font-weight);
128
+ padding-bottom: var(--ez-grid__group--padding-bottom);
105
129
  }
@@ -65,7 +65,7 @@ export class GridConfig {
65
65
  let newList = [...this.columns];
66
66
  let newItem = newList.find(item => item.label === updatedItem.label);
67
67
  if (newItem) {
68
- newItem.sort = sortOrder;
68
+ newItem.sort = sortOrder.value;
69
69
  }
70
70
  this.columns = newList;
71
71
  }
@@ -122,7 +122,7 @@ export class GridConfig {
122
122
  searchingText = (_a = evt.currentTarget) === null || _a === void 0 ? void 0 : _a.value;
123
123
  }
124
124
  let newSelected = -1;
125
- if (this.selectedTab === "Ordenação") {
125
+ if (this.selectedTab === "Ordenação das linhas") {
126
126
  if (searchingText) {
127
127
  const matchedIndexes = [];
128
128
  let orderListDatasource;
@@ -210,7 +210,7 @@ export class GridConfig {
210
210
  handleTabChange(ev) {
211
211
  var _a;
212
212
  if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.selectedTab) {
213
- if (ev.target.selectedTab === "Ordenação") {
213
+ if (ev.target.selectedTab === "Ordenação das linhas") {
214
214
  this._columnListHistory = this._columnList.dataSource;
215
215
  this.createOrderList();
216
216
  }
@@ -249,13 +249,14 @@ export class GridConfig {
249
249
  h("div", { class: "button-close" },
250
250
  h("ez-button", { mode: 'icon', image: getSpritePath("close"), size: 'medium', onClick: () => this.closeConfig() }))),
251
251
  h("div", { class: "tabselector-container" },
252
- h("ez-tabselector", { selectedTab: this.selectedTab, selectedIndex: 0, onEzChange: (ev) => { this.handleTabChange(ev); }, tabs: 'Colunas, Ordena\u00E7\u00E3o' })),
252
+ h("ez-tabselector", { selectedTab: this.selectedTab, selectedIndex: 0, onEzChange: (ev) => { this.handleTabChange(ev); }, tabs: 'Colunas, Ordena\u00E7\u00E3o das linhas' })),
253
253
  h("div", null,
254
254
  h("ez-text-input", { ref: (el) => this._searchElement = el, label: "Localizar coluna", onKeyUp: evt => this.locateColumn(evt) },
255
255
  h("ez-icon", { slot: "leftIcon", size: "medium", href: getSpritePath("search") })))),
256
256
  h("div", { class: "grid-config__main" },
257
257
  h("ez-list", { ref: (el) => this._columnList = el, class: this.selectedTab === "Colunas" ? "" : "hidden", dataSource: this._columListItems, onEzChange: ev => this.handleColumnListChange(ev), ezDraggable: true, ezSelectable: true, itemSlotBuilder: (item, group) => this.buildColumnListSlot(item, group), useGroups: true }),
258
- h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedTab === "Ordenação" ? "" : "hidden", dataSource: this._orderListItems, ezSelectable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item) })),
258
+ h("div", { class: this.selectedTab === "Ordenação das linhas" ? "group-name" : "hidden" }, "Sequ\u00EAncia da ordena\u00E7\u00E3o"),
259
+ h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedTab === "Ordenação das linhas" ? "heigth-calc" : "hidden", dataSource: this._orderListItems, ezSelectable: true, ezDraggable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item) })),
259
260
  h("div", { class: "grid-config__footer" },
260
261
  h("ez-button", { class: "padding-right--medium", label: "Cancelar", onClick: () => this.closeConfig() }),
261
262
  h("ez-button", { label: "Concluir", class: "button--primary", onClick: () => this.finish() }))));
@@ -1,7 +1,10 @@
1
- select {
2
- border: 1px solid #DCE0E8;
3
- font-family: 'Sora';
4
- border-radius: 3px;
5
- outline: none;
6
- cursor: pointer;
7
- }
1
+
2
+ ez-combo-box{
3
+ width: 100px;
4
+ }
5
+
6
+ .grid-config-combo{
7
+ --ez-text-input--height: 28px;
8
+ --ez-text-input__input--background-color: #fff;
9
+ --ez-text-input__input--border-color: #dce0e8;
10
+ }
@@ -1,20 +1,10 @@
1
1
  import { Component, Event, h, Prop } from '@stencil/core';
2
2
  export class SelectBox {
3
- changeSelection() {
4
- this.ezChange.emit(this._selectElem.value);
5
- }
6
- componentDidRender() {
7
- if (this._selectElem) {
8
- if (this.selectedOption) {
9
- this._selectElem.value = this.selectedOption;
10
- }
11
- else {
12
- this._selectElem.value = "na";
13
- }
14
- }
3
+ constructor() {
4
+ this.selectedOption = { value: "na", label: "N/A" };
15
5
  }
16
6
  render() {
17
- return (h("select", { ref: (el) => this._selectElem = el, onChange: () => { this.changeSelection(); } },
7
+ return (h("ez-combo-box", { class: "grid-config-combo inverted", label: "", value: this.selectedOption, enabled: true, canShowError: false, suppressEmptyOption: true },
18
8
  h("option", { value: "na" }, "N/A"),
19
9
  h("option", { value: "asc" }, "A-Z"),
20
10
  h("option", { value: "desc" }, "Z-A")));
@@ -33,9 +23,13 @@ export class SelectBox {
33
23
  "type": "string",
34
24
  "mutable": false,
35
25
  "complexType": {
36
- "original": "string",
37
- "resolved": "string",
38
- "references": {}
26
+ "original": "Option|string",
27
+ "resolved": "Option | string",
28
+ "references": {
29
+ "Option": {
30
+ "location": "global"
31
+ }
32
+ }
39
33
  },
40
34
  "required": false,
41
35
  "optional": false,
@@ -44,7 +38,8 @@ export class SelectBox {
44
38
  "text": ""
45
39
  },
46
40
  "attribute": "selected-option",
47
- "reflect": false
41
+ "reflect": false,
42
+ "defaultValue": "{value: \"na\", label: \"N/A\"}"
48
43
  }
49
44
  }; }
50
45
  static get events() { return [{
@@ -59,6 +59,12 @@
59
59
  /* @doc Define a cor da borda pontilhada sobre os elementos da lista. */
60
60
  --ez-list__over--border--color: var(--color--primary, #008561);
61
61
 
62
+ /*@doc Define o espaçamento do container de itens arrastáveis .*/
63
+ --ez-list__draggable__list--padding-bottom: var(--space--small, 6px);
64
+
65
+ /*@doc Define a altura do container para arrasto para última posição .*/
66
+ --ez-list__last-droppable-space--height: var(--space--small, 6px);
67
+
62
68
  /*@doc Define o raio da borda da barra de rolagem do componente.*/
63
69
  --ez-list__draggable__scrollbar--border-radius: var(--border--radius-large, 24px);
64
70
  /*@doc Define a largura da barra de rolagem do componente.*/
@@ -75,9 +81,14 @@
75
81
  z-index: var(--ez-list__host--z-index);
76
82
  }
77
83
 
84
+ p {
85
+ margin: 0;
86
+ }
87
+
78
88
  .draggable {
79
89
  display: flex;
80
90
  align-items: center;
91
+ border-top: 1px dashed #fff;
81
92
  justify-content: space-between;
82
93
  background-color: #fff;
83
94
  font-family: var(--ez-list__item--font-family);
@@ -117,8 +128,6 @@
117
128
  margin: 0;
118
129
  width: 100%;
119
130
  max-height: 100%;
120
- /* height: 100%; */
121
- padding-bottom: var(--space--small);
122
131
  }
123
132
 
124
133
  .draggable-list li {
@@ -135,6 +144,10 @@
135
144
  border-top: 1px dashed var(--ez-list__over--border--color);
136
145
  }
137
146
 
147
+ .last-droppable-space {
148
+ height: var(--ez-list__last-droppable-space--height);
149
+ }
150
+
138
151
  .draggable-selected {
139
152
  background-color: var(--background--strong) !important;
140
153
  }
@@ -207,6 +220,10 @@
207
220
  font-size: var(--ez-list__group--font-size);
208
221
  font-weight: var(--ez-list__group--font-weight);
209
222
  padding-bottom: var(--ez-list__group--padding-bottom);
223
+ -webkit-user-select: none;
224
+ -moz-user-select: -moz-none;
225
+ -ms-user-select: none;
226
+ user-select: none;
210
227
  }
211
228
 
212
229
  .group {
@@ -286,6 +303,10 @@
286
303
  cursor: pointer;
287
304
  }
288
305
 
306
+ .presetedHeight {
307
+ min-height: 100px;
308
+ }
309
+
289
310
  .overlay-text {
290
311
  position: absolute;
291
312
  top: 50%;