@sankhyalabs/ezui 1.1.80 → 1.1.83

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 (91) hide show
  1. package/dist/cjs/ApplicationUtils-d1c1db56.js +35 -0
  2. package/dist/cjs/{AssetsUtils-02db4f46.js → AssetsUtils-caf95dab.js} +1 -1
  3. package/dist/cjs/ez-action-chip.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-application.cjs.entry.js +1 -1
  5. package/dist/cjs/{ez-grid.cjs.entry.js → ez-button_11.cjs.entry.js} +1448 -22
  6. package/dist/cjs/ez-calendar.cjs.entry.js +217 -0
  7. package/dist/cjs/ez-collapsible-box_7.cjs.entry.js +853 -0
  8. package/dist/cjs/ez-combo-box.cjs.entry.js +254 -0
  9. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-form.cjs.entry.js +722 -0
  11. package/dist/cjs/ez-label-chip.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-popover.cjs.entry.js +2 -2
  13. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-time-input.cjs.entry.js +3 -3
  15. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  16. package/dist/cjs/ezui.cjs.js +2 -2
  17. package/dist/cjs/{index-2003dec4.js → index-0bce1636.js} +3 -0
  18. package/dist/cjs/{index-a2266984.js → index-2fc1b5fa.js} +115 -72
  19. package/dist/cjs/loader.cjs.js +2 -2
  20. package/dist/collection/components/ez-form/DataBinder.js +7 -1
  21. package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +2 -1
  22. package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +4 -0
  23. package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +19 -25
  24. package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +10 -7
  25. package/dist/collection/components/ez-grid/ez-grid.css +4 -1
  26. package/dist/collection/components/ez-grid/ez-grid.js +4 -0
  27. package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +1 -1
  28. package/dist/collection/components/test-du/test-du.js +3 -27
  29. package/dist/custom-elements/index.js +150 -116
  30. package/dist/esm/ApplicationUtils-01280a9d.js +33 -0
  31. package/dist/esm/{AssetsUtils-76ca41e1.js → AssetsUtils-9b1d9c38.js} +1 -1
  32. package/dist/esm/ez-action-chip.entry.js +1 -1
  33. package/dist/esm/ez-application.entry.js +1 -1
  34. package/dist/esm/{ez-grid.entry.js → ez-button_11.entry.js} +1428 -12
  35. package/dist/esm/ez-calendar.entry.js +213 -0
  36. package/dist/esm/ez-collapsible-box_7.entry.js +843 -0
  37. package/dist/esm/ez-combo-box.entry.js +250 -0
  38. package/dist/esm/ez-dialog.entry.js +1 -1
  39. package/dist/esm/ez-form.entry.js +718 -0
  40. package/dist/esm/ez-label-chip.entry.js +1 -1
  41. package/dist/esm/ez-popover.entry.js +2 -2
  42. package/dist/esm/ez-popup.entry.js +1 -1
  43. package/dist/esm/ez-time-input.entry.js +3 -3
  44. package/dist/esm/ez-toast.entry.js +1 -1
  45. package/dist/esm/ezui.js +2 -2
  46. package/dist/esm/{index-afe19542.js → index-015d8d70.js} +116 -73
  47. package/dist/esm/{index-077c7fcf.js → index-d80a8d1f.js} +3 -0
  48. package/dist/esm/loader.js +2 -2
  49. package/dist/ezui/ezui.esm.js +1 -1
  50. package/dist/ezui/{p-5509ee41.entry.js → p-058b8138.entry.js} +46 -46
  51. package/dist/ezui/{p-7a1f2e0e.entry.js → p-07d2c50f.entry.js} +1 -1
  52. package/dist/ezui/{p-57ea4b84.entry.js → p-091b27f2.entry.js} +1 -1
  53. package/dist/ezui/{p-6d157776.entry.js → p-19d8a928.entry.js} +1 -1
  54. package/dist/ezui/{p-a4a39579.entry.js → p-39218c31.entry.js} +1 -1
  55. package/dist/ezui/{p-da31cd21.entry.js → p-6206515e.entry.js} +1 -1
  56. package/dist/ezui/p-62ee7026.entry.js +1 -0
  57. package/dist/ezui/p-7107d7ef.js +1 -0
  58. package/dist/ezui/{p-7de3c95d.js → p-7c101b34.js} +1 -1
  59. package/dist/ezui/{p-857ead8e.entry.js → p-8592635e.entry.js} +1 -1
  60. package/dist/ezui/p-93ce25bc.entry.js +1 -0
  61. package/dist/ezui/p-96c336db.js +1 -0
  62. package/dist/ezui/p-a06aa43a.entry.js +1 -0
  63. package/dist/ezui/{p-920bb8c9.entry.js → p-a52b3368.entry.js} +1 -1
  64. package/dist/ezui/{p-0a2056d9.entry.js → p-b678dc80.entry.js} +1 -1
  65. package/dist/ezui/p-ca3dac07.entry.js +1 -0
  66. package/dist/ezui/p-f87c7082.js +1 -0
  67. package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +4 -0
  68. package/dist/types/components/ez-grid/controller/DataUnitBridge.d.ts +2 -1
  69. package/dist/types/components/test-du/test-du.d.ts +0 -6
  70. package/package.json +2 -2
  71. package/react/{readme.md → .keepfolder} +0 -0
  72. package/dist/cjs/DateUtils-716769e0.js +0 -46
  73. package/dist/cjs/ez-button_3.cjs.entry.js +0 -520
  74. package/dist/cjs/ez-calendar_13.cjs.entry.js +0 -2421
  75. package/dist/cjs/ez-date-time-input.cjs.entry.js +0 -133
  76. package/dist/cjs/ez-icon.cjs.entry.js +0 -30
  77. package/dist/cjs/ez-modal_2.cjs.entry.js +0 -370
  78. package/dist/esm/DateUtils-0a1bbd7a.js +0 -44
  79. package/dist/esm/ez-button_3.entry.js +0 -514
  80. package/dist/esm/ez-calendar_13.entry.js +0 -2405
  81. package/dist/esm/ez-date-time-input.entry.js +0 -129
  82. package/dist/esm/ez-icon.entry.js +0 -26
  83. package/dist/esm/ez-modal_2.entry.js +0 -365
  84. package/dist/ezui/p-00b837e2.js +0 -1
  85. package/dist/ezui/p-0d8368fc.entry.js +0 -1
  86. package/dist/ezui/p-1e36e3ff.entry.js +0 -1
  87. package/dist/ezui/p-446ec85b.js +0 -1
  88. package/dist/ezui/p-49f3432a.entry.js +0 -1
  89. package/dist/ezui/p-c89629eb.js +0 -1
  90. package/dist/ezui/p-d5699f29.entry.js +0 -1
  91. package/dist/ezui/p-d64a3939.entry.js +0 -1
@@ -1,6 +1,132 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-077c7fcf.js';
2
- import { c as createCommonjsModule, b as commonjsGlobal, A as Action } from './index-afe19542.js';
3
- import { g as getSpritePath } from './AssetsUtils-76ca41e1.js';
1
+ import { r as registerInstance, h, c as createEvent, H as Host, g as getElement } from './index-d80a8d1f.js';
2
+ import { c as createCommonjsModule, a as commonjsGlobal, A as Action, M as MaskFormatter, D as DataUnit, b as DataType, U as UserInterface } from './index-015d8d70.js';
3
+ import { g as getSpritePath } from './AssetsUtils-9b1d9c38.js';
4
+
5
+ const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--text--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover--background-color:var(--background--strong, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--ez-button--border);--ez-button--focus--box-shadow:none;--ez-button--link-color:var(--title--primary, '#C0C0C0')}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:hover{background-color:var(--ez-button--hover--background-color)}button:focus{outline:none;border:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;cursor:no-drop}button.icon{padding:0px}button.small{width:32px;min-width:32px;height:32px}button.medium{width:42px;min-width:42px;height:42px}button.large{width:52px;min-width:52px;height:52px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight)}a{font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}";
6
+
7
+ let EzButton = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ /**
11
+ * Deixa o botão disponível ou não para interação com o usuário.
12
+ */
13
+ this.enabled = true;
14
+ /**
15
+ * Define o modo de uso do botão; opções: icon, link e regular
16
+ */
17
+ this.mode = "regular";
18
+ /**
19
+ * Quando em modo "icon" pode-se escolher entre [small,medium,large] (somente para o modo "icon")
20
+ */
21
+ this.size = "medium";
22
+ }
23
+ getIconSize() {
24
+ return this.size;
25
+ }
26
+ handleSlotChange(ev) {
27
+ const slot = ev.target;
28
+ const content = slot.assignedElements()[0];
29
+ if (this.mode == "link") {
30
+ content.style.display = "inline";
31
+ if (slot.name == "leftIcon") {
32
+ content.style.paddingRight = "var(--ez-button__inline__icon--padding)";
33
+ }
34
+ else if (slot.name == "rightIcon") {
35
+ content.style.paddingLeft = "var(--ez-button__inline__icon--padding)";
36
+ }
37
+ }
38
+ else {
39
+ content.style.setProperty('--ez-icon--color', 'var(--ez-icon--color)');
40
+ }
41
+ }
42
+ render() {
43
+ if (this.mode == "icon") {
44
+ return (h("button", { class: "icon " + this.size, type: "button", disabled: !this.enabled }, h("ez-icon", { class: "icon", href: this.image, size: this.getIconSize(), onClick: evt => {
45
+ if (!this.enabled)
46
+ evt.stopPropagation();
47
+ } })));
48
+ }
49
+ else if (this.mode == "label-icon") {
50
+ return (h("div", { class: "label-icon" }, h("button", { class: "icon", type: "button", disabled: !this.enabled }, h("ez-icon", { class: "icon", href: this.image, size: "large", onClick: evt => {
51
+ if (!this.enabled)
52
+ evt.stopPropagation();
53
+ } })), h("label", { title: this.label }, this.label)));
54
+ }
55
+ else if (this.mode == "link") {
56
+ return (h("a", null, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
57
+ }
58
+ else {
59
+ return (h("button", { type: "button", disabled: !this.enabled }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
60
+ }
61
+ }
62
+ };
63
+ EzButton.style = ezButtonCss;
64
+
65
+ const ezCheckCss = ":host{--ez-check--box--width:18px;--ez-check--box--height:18px;--ez-check--width:calc(var(--ez-check--box--width) + 14px);--ez-check--height:calc(var(--ez-check--box--width) + 14px);--ez-check--border-radius:var(--border--radius-small);--ez-check--checked--background-color:var(--color--primary-200);--ez-check--focus--background-color:var(--color--strokes, #FFFFFF);--ez-check--hover--background-color:var(--background--medium);--ez-check--checked--disabled--background-color:var(--color--disable-secondary);--ez-check--border:var(--border--medium) var(--title--primary);--ez-check--disabled--border:var(--border--medium) var(--color--strokes);--ez-check--checked--border:var(--border--medium) var(--color--primary);--ez-check--checked--hover--background-color:var(--color--primary-200);--ez-check--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--ez-check--check--image:url('data:image/svg+xml;utf8,<svg width=\"8\" height=\"7\" viewBox=\"0 0 8 7\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z\"/></svg>');--ez-check--check--background-color:var(--color--primary);--ez-check--check--disabled--background-color:var(--color--strokes);--ez-switch--slider--width:34px;--ez-switch--slider--height:14px;--ez-switch--pin--width:20px;--ez-switch--pin--height:20px;--ez-switch--focus--width:32px;--ez-switch--focus--height:32px;--ez-switch--background-color:var(--color--strokes);--ez-switch--disabled--background-color:var(--color--disable-secondary);--ez-switch--checked--background-color:var(--color--primary-300);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-secondary);--ez-switch--pin--checked--background-color:var(--color--primary);--ez-switch--pin--checked--disabled--background-color:#E8F7F4;--ez-switch--pin--focus--background-color:var(--text--disable);--ez-switch--pin--checked--focus--background-color:var(--color--primary);--ez-check--label--font-size:var(--text--medium, 14px);--ez-check--label--font-family:var(--font-pattern, Arial);--ez-check--label--color:var(--title--primary, #000);--ez-check--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;width:100%;align-items:center;margin:0}input.regularMode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative;width:var(--ez-check--width);height:var(--ez-check--height)}input.regularMode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regularMode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regularMode:disabled{cursor:auto;background:none}input.regularMode::before{box-sizing:border-box;content:\"\";display:block;width:var(--ez-check--box--width);height:var(--ez-check--box--height);border-radius:var(--ez-check--border-radius);border:var(--ez-check--border)}input.regularMode:disabled::before{border:var(--ez-check--disabled--border)}input.regularMode:checked:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regularMode:checked:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regularMode:checked::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regularMode:checked:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regularMode:checked::after{display:flex;position:absolute;content:\"\";background-color:var(--ez-check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--ez-check--check--image);mask-image:var(--ez-check--check--image)}input.regularMode:checked:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switchMode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:none;transition:background-color var(--transition);width:var(--ez-switch--slider--width);height:var(--ez-switch--slider--height);background-color:var(--ez-switch--background-color)}input.switchMode:disabled{background-color:var(--ez-switch--disabled--background-color)}input.switchMode::after{content:\"\";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transform:translateY(-3px);border-radius:50%;width:var(--ez-switch--pin--width);height:var(--ez-switch--pin--height);background-color:var(--ez-switch--pin--background-color)}input.switchMode:disabled::after{background-color:var(--ez-switch--pin--disabled--background-color)}input.switchMode:checked{transition:background-color var(--transition);background-color:var(--ez-switch--checked--background-color)}input.switchMode::before{display:block;content:\"\";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--ez-switch--focus--width);height:var(--ez-switch--focus--height);top:calc((var(--ez-switch--slider--height) - var(--ez-switch--focus--height)) / 2);left:calc((var(--ez-switch--pin--width) - var(--ez-switch--focus--width))/2);background-color:var(--ez-switch--pin--focus--background-color)}input.switchMode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switchMode:checked:focus::before{background-color:var(--ez-switch--pin--checked--focus--background-color);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width)))}input.switchMode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width))) translateY(-3px);box-shadow:var(--shadow);background-color:var(--ez-switch--pin--checked--background-color)}input.switchMode:checked:disabled::after{background-color:var(--ez-switch--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-check--label--color);text-shadow:var(--text-shadow);font-size:var(--ez-check--label--font-size);font-family:var(--ez-check--label--font-family);cursor:default;padding-left:var(--space--small)}.label--disabled{color:var(--ez-check--label--disabled--color)}";
66
+
67
+ let EzCheck = class {
68
+ constructor(hostRef) {
69
+ registerInstance(this, hostRef);
70
+ this.ezChange = createEvent(this, "ezChange", 7);
71
+ /**
72
+ * Deixa o campo disponível ou não para interação com o usuário.
73
+ */
74
+ this.enabled = true;
75
+ /**
76
+ * Existem dois modos de visualização: regular e switch.
77
+ * Se esta propriedade for omitida, o componete assume o formato "regular".
78
+ * No modo "regular" a visualização é a tradicional de uma caixinha marcada/desmarcada.
79
+ * No modo "switch" o campo tem uma interface em formato de um pino liga/desliga.
80
+ */
81
+ this.mode = "regular";
82
+ }
83
+ adjustMode() {
84
+ if (this.mode === "switch") {
85
+ this._inputElem.classList.remove("regularMode");
86
+ this._inputElem.classList.add("switchMode");
87
+ }
88
+ else {
89
+ this._inputElem.classList.remove("switchMode");
90
+ this._inputElem.classList.add("regularMode");
91
+ }
92
+ }
93
+ //---------------------------------------------
94
+ // Public methods
95
+ //---------------------------------------------
96
+ /**
97
+ * Devolve o modo escolhido para o componente
98
+ */
99
+ async getMode() {
100
+ return this.mode;
101
+ }
102
+ /**
103
+ * Faz o foco no componente de input
104
+ */
105
+ async setFocus() {
106
+ this._inputElem.focus();
107
+ }
108
+ componentDidLoad() {
109
+ this.adjustMode();
110
+ }
111
+ changeValue() {
112
+ this.value = !this.value;
113
+ this.ezChange.emit(this.value);
114
+ }
115
+ getLabelClasses() {
116
+ let classes = "label";
117
+ if (!this.enabled) {
118
+ classes += " label--disabled";
119
+ }
120
+ return classes;
121
+ }
122
+ render() {
123
+ return (h(Host, null, h("input", { type: "checkbox", class: "regularMode", checked: this.value === true, onChange: () => { this.changeValue(); }, disabled: !this.enabled, ref: (el) => this._inputElem = el }), this.label ? h("label", { class: this.getLabelClasses(), onClick: () => { this.changeValue(); }, title: this.label }, this.label) : undefined));
124
+ }
125
+ static get watchers() { return {
126
+ "mode": ["adjustMode"]
127
+ }; }
128
+ };
129
+ EzCheck.style = ezCheckCss;
4
130
 
5
131
  var agGridCommunity_cjs = createCommonjsModule(function (module, exports) {
6
132
 
@@ -110237,6 +110363,60 @@ class AgGridController {
110237
110363
  }
110238
110364
  }
110239
110365
 
110366
+ /**
110367
+ * Classe com utiliários comuns para Strings.
110368
+ */
110369
+ class StringUtils {
110370
+ /**
110371
+ * Verifica se a string está vazia.
110372
+ * Valores null e undefined são considerados como vazio.
110373
+ *
110374
+ * @param value String para ser validada.
110375
+ */
110376
+ static isEmpty(value) {
110377
+ if (value == undefined || value === null) {
110378
+ return true;
110379
+ }
110380
+ value = value.toString();
110381
+ value = value.trim();
110382
+ if (value.length === 0) {
110383
+ return true;
110384
+ }
110385
+ return false;
110386
+ }
110387
+ /**
110388
+ * Remove acentos de vogais, substitui Ç por c e retorna a string em caixa alta.
110389
+ *
110390
+ * @param value String para ser transformada.
110391
+ */
110392
+ static replaceAccentuatedChars(text) {
110393
+ text = text.toUpperCase();
110394
+ text = text.replace(/[À]/, "A");
110395
+ text = text.replace(/[Á]/, "A");
110396
+ text = text.replace(/[Â]/, "A");
110397
+ text = text.replace(/[Ã]/, "A");
110398
+ text = text.replace(/[Ä]/, "A");
110399
+ text = text.replace(/[È]/, "E");
110400
+ text = text.replace(/[É]/, "E");
110401
+ text = text.replace(/[Ê]/, "E");
110402
+ text = text.replace(/[Ë]/, "E");
110403
+ text = text.replace(/[Ì]/, "I");
110404
+ text = text.replace(/[Í]/, "I");
110405
+ text = text.replace(/[Î]/, "I");
110406
+ text = text.replace(/[Ï]/, "I");
110407
+ text = text.replace(/[Ò]/, "O");
110408
+ text = text.replace(/[Ó]/, "O");
110409
+ text = text.replace(/[Ô]/, "O");
110410
+ text = text.replace(/[Ö]/, "O");
110411
+ text = text.replace(/[Ù]/, "U");
110412
+ text = text.replace(/[Ú]/, "U");
110413
+ text = text.replace(/[Û]/, "U");
110414
+ text = text.replace(/[Ü]/, "U");
110415
+ text = text.replace(/[Ç]/, "C");
110416
+ return text.replace(/[^a-z0-9]/gi, '');
110417
+ }
110418
+ }
110419
+
110240
110420
  class DataUnitBridge {
110241
110421
  constructor(gridController, dataUnit) {
110242
110422
  this._gridController = gridController;
@@ -110246,19 +110426,22 @@ class DataUnitBridge {
110246
110426
  processAction(action) {
110247
110427
  switch (action.type) {
110248
110428
  case Action.METADATA_LOADED:
110249
- const columnDefs = [];
110250
- this._dataUnit.metadata.fields.forEach(f => {
110251
- if (f.visible !== false) {
110252
- columnDefs.push({ label: f.label, name: f.name });
110253
- }
110254
- });
110255
- this._gridController.setColumnsDef(columnDefs, true);
110429
+ this._gridController.setColumnsDef(this.buildColumnDefs(), true);
110256
110430
  break;
110257
110431
  }
110258
110432
  }
110433
+ buildColumnDefs() {
110434
+ const columnDefs = [];
110435
+ this._dataUnit.metadata.fields.forEach(f => {
110436
+ if (f.visible !== false) {
110437
+ columnDefs.push({ label: f.label, name: f.name });
110438
+ }
110439
+ });
110440
+ return columnDefs;
110441
+ }
110259
110442
  }
110260
110443
 
110261
- const ezGridCss = ":host{--ezgrid__header--background-color:var(--background--xlight, #FFF)}.grid__header{display:flex;justify-content:flex-end;align-items:center;background-color:var(--ezgrid__header--background-color)}";
110444
+ const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ezgrid__header--background-color:var(--background--xlight, #FFF)}.grid__header.sc-ez-grid{display:flex;justify-content:flex-end;align-items:center;background-color:var(--ezgrid__header--background-color)}";
110262
110445
 
110263
110446
  let EzGrid = class {
110264
110447
  constructor(hostRef) {
@@ -110338,6 +110521,9 @@ let EzGrid = class {
110338
110521
  serverURL: this.serverUrl,
110339
110522
  dataUnit: this.dataUnit
110340
110523
  });
110524
+ if (this._dataUnitBridge) {
110525
+ this._gridController.setColumnsDef(this._dataUnitBridge.buildColumnDefs(), true);
110526
+ }
110341
110527
  }
110342
110528
  getPaginationControl() {
110343
110529
  if (this.pageSize === -1) {
@@ -110368,4 +110554,1234 @@ let EzGrid = class {
110368
110554
  };
110369
110555
  EzGrid.style = ezGridCss;
110370
110556
 
110371
- export { EzGrid as ez_grid };
110557
+ const ezIconCss = ":host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}";
110558
+
110559
+ let EzIcon = class {
110560
+ constructor(hostRef) {
110561
+ registerInstance(this, hostRef);
110562
+ /**
110563
+ * Tamanho do ícone
110564
+ */
110565
+ this.size = 'medium';
110566
+ }
110567
+ isSprite() {
110568
+ return this.href && this.href.indexOf('#') > -1;
110569
+ }
110570
+ render() {
110571
+ return (h(Host, null, this.isSprite()
110572
+ ?
110573
+ h("svg", { class: this.size, role: "img" }, h("use", { xlinkHref: this.href }))
110574
+ :
110575
+ h("img", { class: this.size, src: this.href })));
110576
+ }
110577
+ };
110578
+ EzIcon.style = ezIconCss;
110579
+
110580
+ const ezListCss = ":host{--ez-list__host--z-index:var(--visible, 1);--ez-list__host--border-radius:var(--border--radius-medium, 12px);--ez-list__host--padding:var(--space--medium, 12px);--ez-list__icon__padding:var(--space--small, 6px);--ez-list__icon--color:#AFB6C0;--ez-list__item__margin:0 var(--space--small, 6px);--ez-list__item--color:var(--title--primary, #2b3a54);--ez-list__item--border-bottom:var(--border--small, 1px solid);--ez-list__item--border-color:var(--title--primary, #2b3a54);--ez-list__item--font-family:var(--font-pattern, \"Sora\");--ez-list__item--font-size:var(--text--medium, 14px);--ez-list__selectable--padding-right:var(--space--small, 6px);--ez-list__selectable--padding-left:var(--space--small, 6px);--ez-list__selected-item__border-radius:var(--border--radius-small, 6px);--ez-list__selected-item__background:var(--color--primary-300, #E2F4EF);--ez-list__group--font-family:var(--font-pattern, \"Sora\");--ez-list__group--font-size:var(--text--medium, 14px);--ez-list__group--font-weight:var(--text-weight--large, 600);--ez-list__group--padding-bottom:var(--space-small, 6px);--ez-list__group__overlay--font-family:var(--font-pattern, \"Sora\");--ez-list__group__overlay--font-size:var(--text--medium, 14px);--ez-list__group-container__scrollbar--border-radius:var(--border--radius-large, 24px);--ez-list__group-container__scrollbar--width:var(--space--medium, 12px);--ez-list__group-container__scrollbar--background-color:var(--text--primary, #626e82);--ez-list__over--border--color:var(--color--primary, #008561);--ez-list__draggable__scrollbar--border-radius:var(--border--radius-large, 24px);--ez-list__draggable__scrollbar--width:var(--space--medium, 12px);--ez-list__draggable__scrollbar--background-color:var(--text--primary, #626e82);--ez-list__draggable__icon--image:url('data:image/svg+xml;utf8,<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m 6.75,2.25 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z\"/></svg>');max-height:100%;width:100%;background-color:#fff;display:flex;z-index:var(--ez-list__host--z-index)}.draggable{display:flex;align-items:center;justify-content:space-between;background-color:#fff;font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);flex:1}.dragging{background:#FFFFFF;border:1px solid #008561;box-sizing:border-box;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);border-radius:6px}.selectable{cursor:pointer;padding-right:var(--ez-list__selectable--padding-right);padding-left:var(--ez-list__selectable--padding-left)}.selectable-container{margin:0px !important}.item-content{display:flex;justify-content:center;align-items:center}.draggable-list{color:var(--text-color);padding:0;margin:0;width:100%;max-height:100%;padding-bottom:var(--space--small)}.draggable-list li{background-color:#fff;display:flex;margin:var(--ez-list__item__margin);font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);color:var(--ez-list__item--color);height:32px}.over{border-top:1px dashed var(--ez-list__over--border--color)}.draggable-selected{background-color:var(--background--strong) !important}.draggable-selected div:hover{background-color:var(--background--strong) !important}.draggable-list::-webkit-scrollbar-track{background-color:#f0f2f5}.draggable-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__draggable__scrollbar--background-color);border-radius:var(--ez-list__draggable__scrollbar--border-radius)}.draggable-list::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__draggable__scrollbar--width);max-width:var(--ez-list__draggable__scrollbar--width);min-width:var(--ez-list__draggable__scrollbar--width)}.draggable-icon{align-items:flex-start;display:flex;outline:none;border:none;background-color:unset}.draggable-icon::after{content:'';display:flex;background-color:var(--ez-list__icon--color);width:18px;height:18px;-webkit-mask-image:var(--ez-list__draggable__icon--image);mask-image:var(--ez-list__draggable__icon--image)}*{box-sizing:border-box}.checkbox{width:fit-content}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.group-container{display:flex;flex-direction:column;max-height:100%;overflow-y:auto;outline:none;width:100%}.group-name{font-family:var(--ez-list__group--font-family);font-size:var(--ez-list__group--font-size);font-weight:var(--ez-list__group--font-weight);padding-bottom:var(--ez-list__group--padding-bottom)}.group{display:flex;flex-direction:column}.group-container::-webkit-scrollbar-track{background-color:#f0f2f5}.group-container::-webkit-scrollbar-thumb{background-color:var(--ez-list__group-container__scrollbar--background-color);border-radius:var(--ez-list__group-container__scrollbar--border-radius)}.group-container::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__group-container__scrollbar--width);max-width:var(--ez-list__group-container__scrollbar--width);min-width:var(--ez-list__group-container__scrollbar--width)}.section-container{display:flex;position:relative;height:100%}.items-container{width:100%;max-height:100%;overflow-y:auto;outline:none}.group-items-container{width:100%;max-height:100%;height:100%;outline:none}.items-container::-webkit-scrollbar-track{background-color:#f0f2f5}.items-container::-webkit-scrollbar-thumb{background-color:var(--ez-list__draggable__scrollbar--background-color);border-radius:var(--ez-list__draggable__scrollbar--border-radius)}.items-container::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__draggable__scrollbar--width);max-width:var(--ez-list__draggable__scrollbar--width);min-width:var(--ez-list__draggable__scrollbar--width)}.group-overlay{font-family:var(--ez-list__group__overlay--font-family);font-size:var(--ez-list__group__overlay--font-size);background:rgba(226, 244, 239, 0.8);border:1px solid #008561;border-radius:8px;position:absolute;display:none;place-items:center;top:0;bottom:0;left:0;right:0;z-index:2;margin:0;cursor:pointer}.overlay-text{position:absolute;top:50%;left:50%;font-size:50px;color:white;transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%)}.selected-item{background:var(--ez-list__selected-item__background);border-radius:var(--ez-list__selected-item__border-radius)}.slot-item{align-items:flex-end}.overGroup{background:rgba(226, 244, 239, 0.8);border:1px solid #008561;box-sizing:border-box;border-radius:8px;padding-top:6px}";
110581
+
110582
+ let EzList = class {
110583
+ constructor(hostRef) {
110584
+ registerInstance(this, hostRef);
110585
+ this.ezChange = createEvent(this, "ezChange", 7);
110586
+ this._listItems = [];
110587
+ this._listGroupItems = [];
110588
+ this._listItemsHistory = [];
110589
+ /**
110590
+ * Define a lista inicial do componente.
110591
+ */
110592
+ this.dataSource = [];
110593
+ /**
110594
+ * Define se o componente renderizará os itens separados em grupos..
110595
+ */
110596
+ this.useGroups = false;
110597
+ /**
110598
+ * Define se o componente terá o comportamento de arrasto de linhas.
110599
+ */
110600
+ this.ezDraggable = false;
110601
+ /**
110602
+ * Define se os items da lista serão selecionáveis.
110603
+ */
110604
+ this.ezSelectable = false;
110605
+ }
110606
+ createList() {
110607
+ if (this.useGroups) {
110608
+ let list = [...this.dataSource];
110609
+ list.forEach(itemGroup => {
110610
+ this.sortGroup(itemGroup);
110611
+ });
110612
+ this._listGroupItems = list;
110613
+ }
110614
+ else {
110615
+ this._listItems = this._listItemsHistory.length > 0 ? this._listItemsHistory : [...this.dataSource];
110616
+ }
110617
+ }
110618
+ sortGroup(itemGroup) {
110619
+ if (itemGroup.sort) {
110620
+ itemGroup.items.sort(function (a, b) {
110621
+ return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
110622
+ });
110623
+ if (itemGroup.sort === "DSC") {
110624
+ itemGroup.items.reverse();
110625
+ }
110626
+ }
110627
+ }
110628
+ /**
110629
+ * Recebe como argumento um ListItem {label: string} e um booleano que define se o componente deve fazer scroll para exibir o item específico (opcional).
110630
+ */
110631
+ async setSelection(selectedItem, scrollToOption) {
110632
+ if (selectedItem && this.ezSelectable) {
110633
+ if (this.useGroups) {
110634
+ let newList = [...this._listGroupItems];
110635
+ newList.forEach(groupItem => {
110636
+ groupItem.items.forEach(item => {
110637
+ if (item.label == selectedItem.label) {
110638
+ item.selected = !item.selected;
110639
+ }
110640
+ else {
110641
+ item.selected = false;
110642
+ }
110643
+ });
110644
+ });
110645
+ this._listGroupItems = newList;
110646
+ }
110647
+ else {
110648
+ let newList = [...this._listItems];
110649
+ newList.forEach(item => {
110650
+ if (item.label === selectedItem.label) {
110651
+ item.selected = !item.selected;
110652
+ }
110653
+ else {
110654
+ item.selected = false;
110655
+ }
110656
+ });
110657
+ this._listItems = newList;
110658
+ }
110659
+ if (scrollToOption) {
110660
+ let liElem = this.useGroups ?
110661
+ this._groupContainer.querySelector('li#item_' + this.getItemId(selectedItem.label))
110662
+ : this._itemContainer.querySelector('li#item_' + this.getItemId(selectedItem.label));
110663
+ if (liElem) {
110664
+ liElem.scrollIntoView();
110665
+ }
110666
+ }
110667
+ }
110668
+ else {
110669
+ this.removeSelection();
110670
+ }
110671
+ }
110672
+ removeSelection() {
110673
+ if (this.useGroups) {
110674
+ let newList = [...this._listGroupItems];
110675
+ newList.forEach(groupItem => {
110676
+ groupItem.items.forEach(item => {
110677
+ item.selected = false;
110678
+ });
110679
+ });
110680
+ this._listGroupItems = newList;
110681
+ }
110682
+ else {
110683
+ let newList = [...this._listItems];
110684
+ newList.forEach(item => {
110685
+ item.selected = false;
110686
+ });
110687
+ this._listItems = newList;
110688
+ }
110689
+ }
110690
+ /**
110691
+ * Retorna o item selecionado.
110692
+ */
110693
+ async getSelection() {
110694
+ let selectedItem;
110695
+ if (this.useGroups) {
110696
+ this._listGroupItems.every(group => {
110697
+ let item = group.items.find((item) => item.selected == true);
110698
+ if (item) {
110699
+ selectedItem = item;
110700
+ return false;
110701
+ }
110702
+ return true;
110703
+ });
110704
+ }
110705
+ else {
110706
+ selectedItem = this._listItems.find((item) => item.selected == true);
110707
+ }
110708
+ return selectedItem;
110709
+ }
110710
+ /**
110711
+ * Retorna a lista de items conforme o modo de uso.
110712
+ */
110713
+ async getList() {
110714
+ if (this.useGroups) {
110715
+ return this._listGroupItems;
110716
+ }
110717
+ return this._listItems;
110718
+ }
110719
+ componentWillLoad() {
110720
+ this._listItemsHistory = [];
110721
+ }
110722
+ componentWillRender() {
110723
+ this.createList();
110724
+ }
110725
+ onDrop(ev, dragEndItem) {
110726
+ this.removeOverClass(ev);
110727
+ this.setSelection(undefined);
110728
+ if (this._dragStartItem) {
110729
+ if (this.useGroups) {
110730
+ let newList = [...this._listGroupItems];
110731
+ let groupEnd = this._listGroupItems.find(group => dragEndItem.groupName == group.group);
110732
+ //Remove item arrastado
110733
+ newList.find(group => group.group == this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
110734
+ //Adiciona item arrastado
110735
+ if (groupEnd.sort) {
110736
+ newList.find(group => group.group == dragEndItem.groupName).items.push(this._dragStartItem.item);
110737
+ newList.find(group => group.group == dragEndItem.groupName).items.sort(function (a, b) {
110738
+ return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
110739
+ });
110740
+ if (groupEnd.sort === "DSC") {
110741
+ newList.find(group => group.group == dragEndItem.groupName).items.reverse();
110742
+ }
110743
+ }
110744
+ else {
110745
+ newList.find(group => group.group == dragEndItem.groupName).items.splice(dragEndItem.index, 0, this._dragStartItem.item);
110746
+ }
110747
+ this._listGroupItems = newList;
110748
+ this.ezChange.emit(this._listGroupItems);
110749
+ }
110750
+ else {
110751
+ let newList = [...this._listItems];
110752
+ newList.splice(this._dragStartItem.index, 1);
110753
+ newList.splice(dragEndItem.index, 0, this._dragStartItem.item);
110754
+ this._listItems = newList;
110755
+ this._listItemsHistory = newList;
110756
+ this.ezChange.emit(this._listItems);
110757
+ }
110758
+ }
110759
+ ev.stopPropagation();
110760
+ }
110761
+ onDropGroup(groupSelected) {
110762
+ var _a;
110763
+ let newList = [...this._listGroupItems];
110764
+ this.setSelection(undefined);
110765
+ let newGroup = newList.find(group => group.group === groupSelected.group);
110766
+ if (newGroup) {
110767
+ if (((_a = newGroup.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
110768
+ let newItem;
110769
+ newGroup.items.forEach((item, index) => {
110770
+ if (item.label === this._dragStartItem.item.label) {
110771
+ newItem = { item: item, index: index };
110772
+ }
110773
+ });
110774
+ if (newItem) {
110775
+ newGroup.items.splice(newItem.index, 1);
110776
+ newGroup.items.unshift(newItem.item);
110777
+ this.sortGroup(newGroup);
110778
+ }
110779
+ else {
110780
+ newGroup.items.unshift(this._dragStartItem.item);
110781
+ this.sortGroup(newGroup);
110782
+ newList.find(group => group.group === this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
110783
+ }
110784
+ }
110785
+ else {
110786
+ newList.find(group => group.group === this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
110787
+ newGroup.items = [this._dragStartItem.item];
110788
+ }
110789
+ this._listGroupItems = newList;
110790
+ }
110791
+ }
110792
+ onDragEnd() {
110793
+ this._dragStartItem = undefined;
110794
+ if (this._draggingElement) {
110795
+ try {
110796
+ this._element.shadowRoot.removeChild(this._draggingElement);
110797
+ }
110798
+ catch (err) { }
110799
+ this._draggingElement = undefined;
110800
+ }
110801
+ }
110802
+ addOverClass(ev) {
110803
+ if (ev.target.__proto__ == HTMLDivElement.prototype && ev.target.classList.contains("draggable")) {
110804
+ ev.target.classList.add('over');
110805
+ }
110806
+ }
110807
+ addOverGroupClass(ev, group) {
110808
+ if (ev.target) {
110809
+ let groupContainer = this._groupContainer.querySelector("div#" + this.getDivGroupId(group.group));
110810
+ if (group.items.length > 0) {
110811
+ let groupOverlay = groupContainer.getElementsByClassName("group-overlay")[0];
110812
+ groupOverlay.setAttribute("style", "display:grid");
110813
+ }
110814
+ else {
110815
+ groupContainer === null || groupContainer === void 0 ? void 0 : groupContainer.classList.add('overGroup');
110816
+ }
110817
+ }
110818
+ }
110819
+ removeOverClass(ev) {
110820
+ ev.target.classList.remove('over');
110821
+ }
110822
+ removeOverGroupClass(ev, group) {
110823
+ if (ev.target) {
110824
+ let groupContainer = this._groupContainer.querySelector("div#" + this.getDivGroupId(group.group));
110825
+ if (group.items.length > 0) {
110826
+ let groupOverlay = groupContainer.getElementsByClassName("group-overlay")[0];
110827
+ groupOverlay.setAttribute("style", "display:none");
110828
+ }
110829
+ else {
110830
+ groupContainer === null || groupContainer === void 0 ? void 0 : groupContainer.classList.remove('overGroup');
110831
+ }
110832
+ }
110833
+ }
110834
+ onDragStart(event, item, group, index) {
110835
+ if (this.useGroups) {
110836
+ this._dragStartItem = { groupName: group.group, item: item, index: index };
110837
+ }
110838
+ else {
110839
+ this._dragStartItem = { item: item.item, index: item.index };
110840
+ }
110841
+ let sourceElement = event.srcElement.cloneNode(true);
110842
+ this._draggingElement = event.srcElement.cloneNode(true);
110843
+ this._draggingElement.style.position = "absolute";
110844
+ this._draggingElement.style.top = (event.clientY + 5) + 'px';
110845
+ this._draggingElement.style.left = (event.clientX + 5) + 'px';
110846
+ this._draggingElement.style.height = event.srcElement.clientHeight + 'px';
110847
+ this._draggingElement.style.width = event.srcElement.clientWidth + 'px';
110848
+ this._draggingElement.style.background = "#FFFFFF";
110849
+ this._draggingElement.style.border = "1px solid #008561";
110850
+ this._draggingElement.style["box-sizing"] = "border-box";
110851
+ this._draggingElement.style["box-shadow"] = "0px 0px 16px rgba(0, 38, 111, 0.122)";
110852
+ this._draggingElement.style["border-radius"] = "6px";
110853
+ this._element.shadowRoot.appendChild(this._draggingElement);
110854
+ event.dataTransfer.setDragImage(sourceElement, -10000, -10000);
110855
+ }
110856
+ onDrag(event) {
110857
+ if (this._draggingElement) {
110858
+ this._draggingElement.style.top = (event.clientY + 5) + 'px';
110859
+ this._draggingElement.style.left = (event.clientX + 5) + 'px';
110860
+ }
110861
+ }
110862
+ selectFirstItem() {
110863
+ if (this.useGroups) {
110864
+ this.setSelection(this._listGroupItems[0].items[0]);
110865
+ }
110866
+ {
110867
+ this.setSelection(this._listItems[0]);
110868
+ }
110869
+ }
110870
+ nextOption(selectedItem) {
110871
+ let nextItem = undefined;
110872
+ if (this.useGroups) {
110873
+ this._listGroupItems.every((group, groupIndex, listGroupItems) => {
110874
+ let item = undefined;
110875
+ let itemIndex = group.items.findIndex(item => item.label == selectedItem.label);
110876
+ if (itemIndex != undefined && itemIndex != -1) {
110877
+ if (itemIndex === group.items.length - 1) {
110878
+ if (groupIndex + 1 <= listGroupItems.length - 1) {
110879
+ item = { label: listGroupItems[groupIndex + 1].items[0].label };
110880
+ }
110881
+ }
110882
+ else {
110883
+ item = { label: group.items[itemIndex + 1].label };
110884
+ }
110885
+ }
110886
+ if (item != undefined) {
110887
+ nextItem = item;
110888
+ return false;
110889
+ }
110890
+ return true;
110891
+ });
110892
+ }
110893
+ else {
110894
+ let itemIndex = this._listItems.findIndex(item => item.label === selectedItem.label);
110895
+ if (itemIndex >= 0 && itemIndex < this._listItems.length) {
110896
+ nextItem = this._listItems[itemIndex + 1];
110897
+ }
110898
+ }
110899
+ this.setSelection(nextItem, true);
110900
+ }
110901
+ previousOption(selectedItem) {
110902
+ let previousItem = undefined;
110903
+ if (this.useGroups) {
110904
+ this._listGroupItems.every((group, groupIndex, listGroupItems) => {
110905
+ let item = undefined;
110906
+ let itemIndex = group.items.findIndex(item => item.label == selectedItem.label);
110907
+ if (itemIndex != undefined && itemIndex != -1) {
110908
+ if (itemIndex === 0) {
110909
+ if ((groupIndex - 1 >= 0)) {
110910
+ item = { label: listGroupItems[groupIndex - 1].items[listGroupItems[groupIndex - 1].items.length - 1].label };
110911
+ }
110912
+ }
110913
+ else {
110914
+ item = { label: group.items[itemIndex - 1].label };
110915
+ }
110916
+ }
110917
+ if (item != undefined) {
110918
+ previousItem = item;
110919
+ return false;
110920
+ }
110921
+ return true;
110922
+ });
110923
+ }
110924
+ else {
110925
+ let itemIndex = this._listItems.findIndex(item => item.label === selectedItem.label);
110926
+ if (itemIndex > 0 && itemIndex < this._listItems.length) {
110927
+ previousItem = this._listItems[itemIndex - 1];
110928
+ }
110929
+ }
110930
+ this.setSelection(previousItem, true);
110931
+ }
110932
+ keyDownHandler(event) {
110933
+ event.preventDefault();
110934
+ this.getSelection().then(selectedItem => {
110935
+ if (selectedItem) {
110936
+ switch (event.key) {
110937
+ case "ArrowDown":
110938
+ this.nextOption(selectedItem);
110939
+ break;
110940
+ case "ArrowUp":
110941
+ this.previousOption(selectedItem);
110942
+ break;
110943
+ }
110944
+ }
110945
+ else {
110946
+ this.selectFirstItem();
110947
+ }
110948
+ });
110949
+ event.stopPropagation();
110950
+ }
110951
+ getItemId(itemLabel) {
110952
+ if (itemLabel) {
110953
+ return itemLabel.replace(/[^a-z0-9_]/gi, "_");
110954
+ }
110955
+ return undefined;
110956
+ }
110957
+ getDivGroupId(groupName) {
110958
+ if (groupName) {
110959
+ return "group-" + groupName.replace(/[^a-z0-9_]/gi, "_");
110960
+ }
110961
+ return undefined;
110962
+ }
110963
+ onDragOverGroup(event, group) {
110964
+ if (this._dragStartItem && this._dragStartItem.groupName !== group.group) {
110965
+ event.preventDefault();
110966
+ this.addOverGroupClass(event, group);
110967
+ }
110968
+ }
110969
+ onDragOverItem(event, group) {
110970
+ if (this._dragStartItem) {
110971
+ event.preventDefault();
110972
+ if (group) {
110973
+ group.sort ?
110974
+ () => {
110975
+ this.addOverGroupClass(event, group);
110976
+ }
110977
+ : this.addOverClass(event);
110978
+ }
110979
+ else {
110980
+ this.addOverClass(event);
110981
+ }
110982
+ event.stopPropagation();
110983
+ }
110984
+ }
110985
+ render() {
110986
+ return (h(Host, { ref: (el) => this._element = el }, this.useGroups ?
110987
+ h("div", { class: "group-container", ref: (el) => this._groupContainer = el, tabIndex: 0, onKeyDown: (event) => { this.keyDownHandler(event); } }, this._listGroupItems.map(group => {
110988
+ return h("div", { id: this.getDivGroupId(group.group), class: "group", key: group.group + group.items.length, onDragLeave: (event) => { this.removeOverGroupClass(event, group); }, onDragEnd: (event) => { this.onDragEnd(); this.removeOverGroupClass(event, group); }, onDragOver: (event) => { this.onDragOverGroup(event, group); }, onDrop: () => this.onDropGroup(group) }, h("label", { class: "group-name", onDragLeave: (event) => { this.removeOverGroupClass(event, group); }, onDragOver: (event) => { this.onDragOverGroup(event, group); }, onDragEnd: (event) => { this.onDragEnd(); this.removeOverGroupClass(event, group); }, onDrop: () => this.onDropGroup(group) }, group.group), h("section", { class: "section-container", onDragOver: (ev) => ev.preventDefault() }, h("div", { class: "group-items-container" }, h("div", { class: "draggable-list" }, group.items.map((item, index) => {
110989
+ return h("li", { id: 'item_' + this.getItemId(item.label), class: this.ezSelectable ? "selectable-container" : "", key: 'item_' + this.getItemId(item.label) }, h("div", { class: "draggable" + (item.selected == true ? " selected-item " : "") + (this.ezSelectable == true ? " selectable " : ""), onClick: () => { this.setSelection(item); }, onDragLeave: (event) => { group.sort ? undefined : this.removeOverClass(event); }, onDragEnd: () => this.onDragEnd(), onDragStart: (event) => this.onDragStart(event, item, group, index), onDragOver: (event) => this.onDragOverItem(event, group), onDrop: (event) => this.onDrop(event, { groupName: group.group, item: item, index: index }), onDrag: (event) => this.onDrag(event), draggable: this.ezDraggable }, h("div", { class: "item-content" }, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label)), this.itemSlotBuilder ?
110990
+ h("div", { class: "slot-item" }, this.itemSlotBuilder(item, group))
110991
+ : undefined));
110992
+ }))), h("div", { class: "group-overlay" }, h("div", { id: "overlay-text" }, h("b", null, "Mover"), " para ", group.group))));
110993
+ }))
110994
+ :
110995
+ h("div", { class: "items-container", ref: (el) => this._itemContainer = el, tabIndex: 0, onKeyDown: (event) => { this.keyDownHandler(event); } }, h("div", { class: "draggable-list" }, this._listItems.map((item, index) => {
110996
+ return h("li", { id: 'item_' + this.getItemId(item.label), class: this.ezSelectable ? "selectable-container" : "", key: 'item_' + this.getItemId(item.label) }, h("div", { class: "draggable" + (item.selected == true ? " selected-item " : "") + (this.ezSelectable == true ? " selectable " : ""), onDragStart: (event) => this.onDragStart(event, { item: item, index: index }), onClick: () => { this.setSelection(item); }, onDragLeave: event => this.removeOverClass(event), onDragOver: (event) => this.onDragOverItem(event), onDragEnd: () => this.onDragEnd(), onDrop: (event) => this.onDrop(event, { item: item, index: index }), onDrag: (event) => this.onDrag(event), draggable: this.ezDraggable }, h("div", { class: "item-content" }, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label)), this.itemSlotBuilder ?
110997
+ h("div", null, this.itemSlotBuilder(item))
110998
+ : undefined));
110999
+ })))));
111000
+ }
111001
+ };
111002
+ EzList.style = ezListCss;
111003
+
111004
+ const ezModalCss = ":host{--ez-modal-z-index:var(--most-visible, 3);--ez-modal-vertical-padding:var(--space--large, 24px);display:block}.modal{position:fixed;padding:var(--ez-modal-vertical-padding) 0;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;max-height:calc(100% - 48px);height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:24px;border-radius:12px 0px 0px 12px;box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
111005
+
111006
+ let EzModal = class {
111007
+ constructor(hostRef) {
111008
+ registerInstance(this, hostRef);
111009
+ this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
111010
+ /**
111011
+ * Controle de exibição do Modal
111012
+ */
111013
+ this.opened = true;
111014
+ /**
111015
+ * Define se o modal será fechado ao clicar ESC
111016
+ */
111017
+ this.closeEsc = false;
111018
+ /**
111019
+ * Define se o modal será fechado ao clicar fora do conteúdo.
111020
+ */
111021
+ this.closeOutsideClick = false;
111022
+ this.handleKeyboardEvent = (ev) => {
111023
+ if ((ev === null || ev === void 0 ? void 0 : ev.key) === "Escape" && this.closeEsc) {
111024
+ this.closeModal();
111025
+ }
111026
+ };
111027
+ }
111028
+ handleopenedChange() {
111029
+ if (this.opened) {
111030
+ document.addEventListener("keydown", this.handleKeyboardEvent);
111031
+ }
111032
+ else {
111033
+ document.removeEventListener("keydown", this.handleKeyboardEvent);
111034
+ }
111035
+ }
111036
+ closeModal() {
111037
+ this.opened = false;
111038
+ this.ezCloseModal.emit(this.opened);
111039
+ }
111040
+ componentDidLoad() {
111041
+ this.handleopenedChange();
111042
+ }
111043
+ onMouseDownHandler(event) {
111044
+ if (this.closeOutsideClick && event.target === this._overlay) {
111045
+ this.closeModal();
111046
+ }
111047
+ }
111048
+ render() {
111049
+ const positionSufix = this.align === "left" ? "left" : "right";
111050
+ return (h(Host, null, this.opened
111051
+ ?
111052
+ h("div", { class: "modal", onMouseDown: evt => this.onMouseDownHandler(evt) }, h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, h("div", { class: `modal__content modal__content--${positionSufix} ${this.modalSize}` }, h("slot", null))))
111053
+ :
111054
+ undefined));
111055
+ }
111056
+ static get watchers() { return {
111057
+ "opened": ["handleopenedChange"]
111058
+ }; }
111059
+ };
111060
+ EzModal.style = ezModalCss;
111061
+
111062
+ const ezTabselectorCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}:host{display:flex;position:relative;width:100%;overflow:hidden;--tabselector--backward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--tabselector--forward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>')}.scroll{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.scroll.startHidden{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.scroll.midle{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.scroll.endHidden{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab{display:flex;border:none;min-width:100px;background-color:unset;cursor:pointer;padding:6px 12px;align-items:center;justify-content:center;color:var(--text--primary, #626e82);font-family:var(--font-pattern, \"Sora, Algerian\");font-size:var(--title--small, 14px)}.tab:focus,.forward-button,.backward-button{outline:none}.is-active{position:relative;color:var(--color--primary, #008561)}.is-active::after{content:\"\";position:absolute;width:100%;height:100%;background-color:var(--color--primary, #008561);clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out}.is-focused{border:1px dashed var(--color--primary, #000000c5)}.tab-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--text-shadow);margin-bottom:var(--space--extra-small, 3px)}.forward-button,.backward-button{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.backward-button{left:0px}.forward-button::after,.backward-button::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:10px;height:16px}.forward-button::after{-webkit-mask-image:var(--tabselector--forward-icon);mask-image:var(--tabselector--forward-icon)}.backward-button::after{-webkit-mask-image:var(--tabselector--backward-icon);mask-image:var(--tabselector--backward-icon)}.forward-button:hover::after,.backward-button:hover::after{background-color:var(--color--primary, #4e4e4e)}.hidden{display:none}.scroll::-webkit-scrollbar{display:none}";
111063
+
111064
+ let EzTabselector = class {
111065
+ constructor(hostRef) {
111066
+ registerInstance(this, hostRef);
111067
+ this.ezChange = createEvent(this, "ezChange", 7);
111068
+ this.setFocusedParam = (ev) => {
111069
+ if (ev.key === "Enter") {
111070
+ this.selectedIndex = this.focusedIndex;
111071
+ this.focusedIndex = undefined;
111072
+ this.selectedTab = this._processedTabs[this.selectedIndex]["tabKey"];
111073
+ this.handleTabClick(this.selectedTab, parseInt(this.selectedIndex));
111074
+ ev.preventDefault();
111075
+ this.setFocusedTab(this.selectedIndex);
111076
+ }
111077
+ else if (ev.key === "ArrowLeft" || ev.key === "ArrowRight") {
111078
+ let operator = undefined;
111079
+ if (ev.key === "ArrowLeft") {
111080
+ operator = false;
111081
+ }
111082
+ else if (ev.key === "ArrowRight") {
111083
+ operator = true;
111084
+ }
111085
+ else {
111086
+ return;
111087
+ }
111088
+ if (this.focusedIndex === undefined) {
111089
+ if (operator === false) {
111090
+ this.focusedIndex = this.selectedIndex !== undefined ? (parseInt(this.selectedIndex) - 1).toString() : undefined;
111091
+ }
111092
+ else {
111093
+ this.focusedIndex = this.selectedIndex !== undefined ? (parseInt(this.selectedIndex) + 1).toString() : undefined;
111094
+ }
111095
+ }
111096
+ else {
111097
+ if (operator === false) {
111098
+ this.focusedIndex = (parseInt(this.focusedIndex) - 1).toString();
111099
+ }
111100
+ else {
111101
+ this.focusedIndex = (parseInt(this.focusedIndex) + 1).toString();
111102
+ }
111103
+ }
111104
+ if (parseInt(this.focusedIndex) < 0) {
111105
+ this.focusedIndex = "0";
111106
+ }
111107
+ else if (parseInt(this.focusedIndex) > this._processedTabs.length - 1) {
111108
+ this.focusedIndex = (this._processedTabs.length - 1).toString();
111109
+ }
111110
+ this.setFocusedBtn(true, this.focusedIndex);
111111
+ this.setFocusedTab(this.focusedIndex);
111112
+ this.ezChange.emit(this.selectedTab);
111113
+ }
111114
+ else if (ev.key === "Tab" || ev.key === "Escape") {
111115
+ this.focusedIndex = undefined;
111116
+ this.selectedTab = this._processedTabs[this.selectedIndex]["tabKey"];
111117
+ this.handleTabClick(this.selectedTab, parseInt(this.selectedIndex));
111118
+ ev.preventDefault();
111119
+ this.setFocusedTab(this.selectedIndex);
111120
+ }
111121
+ // this.setFocusedTab();
111122
+ };
111123
+ }
111124
+ handleTabClick(tab, index) {
111125
+ this.selectedIndex = index.toString();
111126
+ this.focusedIndex = undefined;
111127
+ this.selectedTab = tab;
111128
+ this.ezChange.emit(this.selectedTab);
111129
+ this.setFocusedBtn(false, this.selectedIndex);
111130
+ }
111131
+ componentWillRender() {
111132
+ if (!this._processedTabs) {
111133
+ this._processedTabs = [];
111134
+ if (this.tabs) {
111135
+ this.tabs.split(",").forEach((label) => {
111136
+ label = label.trim();
111137
+ this._processedTabs.push(new Tab(label, label));
111138
+ });
111139
+ }
111140
+ this._hostElem.querySelectorAll("ez-tab").forEach((elem) => {
111141
+ const tabKey = elem.getAttribute("tabKey");
111142
+ const label = elem.getAttribute("label");
111143
+ const t = new Tab(label, tabKey);
111144
+ const content = elem.firstChild;
111145
+ if (content) {
111146
+ content.setAttribute("slot", "tab" + this._processedTabs.length);
111147
+ this._hostElem.appendChild(content);
111148
+ }
111149
+ this._processedTabs.push(t);
111150
+ });
111151
+ }
111152
+ }
111153
+ handleSlotChange(ev) {
111154
+ const slot = ev.target;
111155
+ const content = slot.assignedElements()[0];
111156
+ if (content) {
111157
+ content.style.marginLeft = "6px";
111158
+ }
111159
+ }
111160
+ scrollBackward() {
111161
+ const container = this._scrollContainer;
111162
+ if (container) {
111163
+ container.scrollLeft -= container.clientWidth;
111164
+ }
111165
+ }
111166
+ scrollFoward() {
111167
+ const container = this._scrollContainer;
111168
+ if (container) {
111169
+ let lastTab = null;
111170
+ container.querySelectorAll(".tab").forEach((tab) => {
111171
+ if (tab.getBoundingClientRect().right < container.clientWidth) {
111172
+ lastTab = tab;
111173
+ }
111174
+ });
111175
+ container.scrollLeft = lastTab.offsetLeft + lastTab.offsetWidth;
111176
+ }
111177
+ }
111178
+ componentDidRender() {
111179
+ this.updateScroll();
111180
+ }
111181
+ updateScroll() {
111182
+ const container = this._scrollContainer;
111183
+ if (container) {
111184
+ const { scrollWidth, clientWidth, scrollLeft } = container;
111185
+ const remainingScroll = scrollWidth - clientWidth - Math.ceil(scrollLeft);
111186
+ this._startHidden = container.scrollLeft > 0;
111187
+ this._endHidden = remainingScroll > 0;
111188
+ if (this._startHidden) {
111189
+ this._backwardButton.classList.remove("hidden");
111190
+ }
111191
+ else {
111192
+ this._backwardButton.classList.add("hidden");
111193
+ }
111194
+ if (this._endHidden) {
111195
+ this._forwardButton.classList.remove("hidden");
111196
+ }
111197
+ else {
111198
+ this._forwardButton.classList.add("hidden");
111199
+ }
111200
+ const classNames = ["", "startHidden", "endHidden", "midle"];
111201
+ const currentClass = classNames[Number(this._startHidden) | Number(this._endHidden) << 1];
111202
+ classNames.forEach((name) => {
111203
+ if (name !== currentClass && container.classList.contains(name)) {
111204
+ container.classList.remove(name);
111205
+ }
111206
+ });
111207
+ if (currentClass && !container.classList.contains(currentClass)) {
111208
+ container.classList.add(currentClass);
111209
+ }
111210
+ }
111211
+ }
111212
+ domScrollHandler() {
111213
+ window.clearTimeout(this._scrollCallBack);
111214
+ this._scrollCallBack = window.setTimeout(() => { this.updateScroll(); }, 200);
111215
+ }
111216
+ setFocusedTab(index) {
111217
+ window.clearTimeout(this._scrollCallBackTest);
111218
+ this._scrollCallBackTest = window.setTimeout(() => {
111219
+ const tabtoscroll = this._scrollContainer.querySelector(`#tab${index}`);
111220
+ tabtoscroll.scrollIntoView();
111221
+ }, 200);
111222
+ }
111223
+ getTextWidth(text) {
111224
+ if (this._textMesurement === undefined) {
111225
+ this._textMesurement = this._hostElem.shadowRoot.ownerDocument.createElement("canvas");
111226
+ }
111227
+ const context = this._textMesurement.getContext("2d");
111228
+ context.font = "14px Sora, Algerian";
111229
+ return Math.min(220, 24 + context.measureText(text).width) + "px";
111230
+ }
111231
+ ;
111232
+ setFocusedBtn(visible, parameter) {
111233
+ const tabsButtons = this._scrollContainer.querySelectorAll(".tab");
111234
+ tabsButtons.forEach((el) => {
111235
+ el.classList.remove("is-focused");
111236
+ if (el.id === "tab" + parameter && visible) {
111237
+ el.classList.add("is-focused");
111238
+ }
111239
+ });
111240
+ }
111241
+ render() {
111242
+ return (h(Host, null, h("button", { class: "backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }), h("div", { class: "scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev) }, this._processedTabs.map((tab, index) => {
111243
+ const labelStyle = { "min-width": this.getTextWidth(tab.label) };
111244
+ const tabId = "tab" + index;
111245
+ const isSelected = index === parseInt(this.selectedIndex) || (this.selectedTab && tab.tabKey === this.selectedTab);
111246
+ if (isSelected) {
111247
+ this.selectedTab = tab.tabKey;
111248
+ this.selectedIndex = index.toString();
111249
+ }
111250
+ return h("button", { id: tabId, class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab.tabKey, index), style: labelStyle }, h("span", { class: "tab-label", title: tab.label }, tab.label), h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } }));
111251
+ })), h("button", { class: "forward-button", ref: (el) => this._forwardButton = el, onClick: () => this.scrollFoward() })));
111252
+ }
111253
+ get _hostElem() { return getElement(this); }
111254
+ };
111255
+ class Tab {
111256
+ constructor(label, tabKey) {
111257
+ this.label = label;
111258
+ this.tabKey = tabKey;
111259
+ }
111260
+ }
111261
+ EzTabselector.style = ezTabselectorCss;
111262
+
111263
+ const ezTextInputCss = ":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--large, 500);--ez-text-input--color:var(--title--primary, #000);--ez-text-input__input--background-color:var(--background--medium, #e0e0e0);--ez-text-input__input--border:var(--border--medium, 2px solid);--ez-text-input__input--border-color:var(--ez-text-input__input--background-color);--ez-text-input__input--focus--border-color:var(--color--alert-cold-800, #042EFF);--ez-text-input__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-text-input__input--disabled--color:var(--text--disable, #AFB6C0);--ez-text-input__input--error--border-color:#CC2936;--ez-text-input__message_box--font-size:var(--text--small, 12px);--ez-text-input__message_box--info--color:var(--color--success, #22085d);--ez-text-input__message_box--error--color:var(--color--error, #FF0000);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width)}input{width:100%;box-sizing:border-box;padding:var(--space--medium, 6px);font-weight:var(--text-weight--large, 600);height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color)}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color)}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color)}input.text--right{text-align:right}.message-box{display:flex;min-height:16px;min-width:100%;margin-top:2px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input__message_box--font-size);color:var(--ez-text-input__message_box--info--color)}.hasError{color:var(--ez-text-input__message_box--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}";
111264
+
111265
+ let EzTextInput = class {
111266
+ constructor(hostRef) {
111267
+ registerInstance(this, hostRef);
111268
+ this.ezChange = createEvent(this, "ezChange", 7);
111269
+ /**
111270
+ * Deixa o campo disponível ou não para digitação.
111271
+ */
111272
+ this.enabled = true;
111273
+ }
111274
+ showError() {
111275
+ const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
111276
+ if (hasError) {
111277
+ this._inputElem.classList.add("hasError");
111278
+ this._messageBoxElem.classList.add("hasError");
111279
+ }
111280
+ else {
111281
+ this._inputElem.classList.remove("hasError");
111282
+ this._messageBoxElem.classList.remove("hasError");
111283
+ }
111284
+ }
111285
+ prepareMask() {
111286
+ if (this.mask) {
111287
+ if (this._maskFormatter == undefined) {
111288
+ this._maskFormatter = new MaskFormatter(this.mask);
111289
+ }
111290
+ else {
111291
+ this._maskFormatter.mask = this.mask;
111292
+ }
111293
+ }
111294
+ }
111295
+ updateInputValue() {
111296
+ if (this._inputElem) {
111297
+ this._inputElem.value = this.value;
111298
+ }
111299
+ this.handleChange();
111300
+ this.errorMessage = "";
111301
+ this.ezChange.emit(this.value);
111302
+ this.adjustFloatingLabel();
111303
+ }
111304
+ adjustFloatingLabel() {
111305
+ if (this.label && this._labelElem) {
111306
+ if (this._inputElem && !this._inputElem.classList.contains("input--with--label")) {
111307
+ this._inputElem.classList.add("input--with--label");
111308
+ }
111309
+ const hasValue = this.value && this.value.toString().length > 0;
111310
+ const containsFloatedClass = this._labelElem.classList.contains("input__label--floated");
111311
+ if (hasValue || this.isFocused()) {
111312
+ if (!containsFloatedClass) {
111313
+ this._labelElem.classList.add("input__label--floated");
111314
+ }
111315
+ }
111316
+ else {
111317
+ if (containsFloatedClass) {
111318
+ this._labelElem.classList.remove("input__label--floated");
111319
+ }
111320
+ }
111321
+ }
111322
+ }
111323
+ isFocused() {
111324
+ return this._hostElement.shadowRoot.activeElement !== null;
111325
+ }
111326
+ //---------------------------------------------
111327
+ // Public methods
111328
+ //---------------------------------------------
111329
+ /**
111330
+ * Faz o foco no componente de input
111331
+ */
111332
+ async setFocus() {
111333
+ this._inputElem.focus();
111334
+ }
111335
+ /**
111336
+ * Remove o foco no componente de input
111337
+ */
111338
+ async setBlur() {
111339
+ this._inputElem.blur();
111340
+ }
111341
+ //---------------------------------------------
111342
+ // Event handlers
111343
+ //---------------------------------------------
111344
+ handleFocusout() {
111345
+ const value = this._inputElem.value;
111346
+ if (value && this._maskFormatter) {
111347
+ try {
111348
+ this._inputElem.value = this._maskFormatter.format(value);
111349
+ }
111350
+ catch (e) {
111351
+ this.errorMessage = e.message;
111352
+ }
111353
+ }
111354
+ this.value = this._inputElem.value;
111355
+ this.adjustFloatingLabel();
111356
+ }
111357
+ isValidValue(value) {
111358
+ if (this.restrict) {
111359
+ return Array.from(value).reduce((valid, c) => valid && this.restrict.indexOf(c) > -1, true);
111360
+ }
111361
+ return true;
111362
+ }
111363
+ handleChange() {
111364
+ if (!this._inputElem) {
111365
+ return;
111366
+ }
111367
+ const value = this._inputElem.value;
111368
+ if (this.isValidValue(value)) {
111369
+ this._lastValidValue = value;
111370
+ }
111371
+ else {
111372
+ this._inputElem.value = this._lastValidValue === undefined ? "" : this._lastValidValue;
111373
+ }
111374
+ this.value = this._inputElem.value;
111375
+ }
111376
+ handleSlotChange(ev) {
111377
+ const slot = ev.target;
111378
+ const content = slot.assignedElements()[0];
111379
+ if (content) {
111380
+ content.style.position = "absolute";
111381
+ content.style.display = "flex";
111382
+ content.style.alignItems = "center";
111383
+ content.style.justifyContent = "center";
111384
+ content.style.overflow = "hidden";
111385
+ content.style.top = "0px";
111386
+ content.style.width = "var(--ez-text-input__icon--width)";
111387
+ content.style.height = "var(--ez-text-input--height)";
111388
+ if (slot.name == "leftIcon") {
111389
+ content.style.left = "0px";
111390
+ content.style.borderRadius = "var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)";
111391
+ this._inputElem.classList.add("icon--left");
111392
+ if (this._labelElem) {
111393
+ this._labelElem.classList.add("input__label--left");
111394
+ }
111395
+ }
111396
+ else if (slot.name == "rightIcon") {
111397
+ content.style.right = "0px";
111398
+ content.style.borderRadius = "0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0";
111399
+ this._inputElem.classList.add("icon--right");
111400
+ if (this._labelElem) {
111401
+ this._labelElem.classList.add("input__label--right");
111402
+ }
111403
+ }
111404
+ }
111405
+ this.showError();
111406
+ }
111407
+ doFocus() {
111408
+ if (this.label && this._labelElem && !this._labelElem.classList.contains("input__label--floated")) {
111409
+ this._labelElem.classList.add("input__label--floated");
111410
+ }
111411
+ }
111412
+ //---------------------------------------------
111413
+ // Lifecycle web component
111414
+ //---------------------------------------------
111415
+ componentDidLoad() {
111416
+ this.showError();
111417
+ this.prepareMask();
111418
+ this.adjustFloatingLabel();
111419
+ }
111420
+ componentWillLoad() {
111421
+ this.prepareMask();
111422
+ if (this.value) {
111423
+ if (this._maskFormatter) {
111424
+ try {
111425
+ this.value = this._maskFormatter.format(this.value);
111426
+ }
111427
+ catch (e) {
111428
+ this.errorMessage = e.message;
111429
+ }
111430
+ }
111431
+ if (!this.isValidValue(this.value)) {
111432
+ this._lastValidValue = "";
111433
+ this.value = "";
111434
+ }
111435
+ }
111436
+ }
111437
+ render() {
111438
+ return (h(Host, null, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label ?
111439
+ h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "input__label" : "input__label input__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
111440
+ : null, h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
111441
+ }
111442
+ get _hostElement() { return getElement(this); }
111443
+ static get watchers() { return {
111444
+ "errorMessage": ["showError"],
111445
+ "mask": ["prepareMask"],
111446
+ "value": ["updateInputValue"]
111447
+ }; }
111448
+ };
111449
+ EzTextInput.style = ezTextInputCss;
111450
+
111451
+ const gridConfigCss = ".sc-grid-config-h{--ez-grid-config__footer--padding-top:var(--space--medium, 12px);--ez-grid-config__main--padding-right:var(--space--medium, 12px);--ez-grid-config__tabselector-container--padding:var(--space--medium, 12px);--ez-grid-config__button-close--padding-left:var(--space--medium, 12px);--ez-grid-config__subtitle--font-family:var(--font-pattern, \"Sora\");--ez-grid-config__title--font-family:var(--font-pattern, \"Sora\");--ez-grid-config__title--font-weight:var(--text-weight--large, 14px);--ez-grid-config__subtitle--font-size:var(--text--medium, 14px);--ez-grid-config__scrollbar--width:var(--space--medium, 12px);--ez-grid-config__main__scrollbar--background-color:var(--text--primary, #626e82);--ez-grid-config__main__scrollbar--border-radius:var(--border--radius-medium, 12px);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}.padding-right--medium.sc-grid-config{padding-right:var(--space--medium)}ez-list.sc-grid-config{height:100%}.grid-config__footer.sc-grid-config{padding-top:var(--ez-grid-config__footer--padding-top);display:flex;justify-content:flex-end;width:100%}.hidden.sc-grid-config{display:none}.grid-config__main.sc-grid-config{padding-right:var(--ez-grid-config__main--padding-right);overflow-y:auto}.tabselector-container.sc-grid-config{padding:var(--ez-grid-config__tabselector-container--padding) 0}.button-close.sc-grid-config{padding-left:var(--ez-grid-config__button-close--padding-left)}.title-container.sc-grid-config{display:flex;justify-content:center;align-items:center}.subtitle.sc-grid-config{font-family:var(--ez-grid-config__subtitle--font-family);font-size:var(--ez-grid-config__subtitle--font-size)}.title.sc-grid-config{display:flex;font-family:var(--ez-grid-config__title--font-family);margin:0;font-weight:var(--ez-grid-config__title--font-weight);line-height:1.3}.grid-config__main.sc-grid-config::-webkit-scrollbar-track{background-color:#f0f2f5}.grid-config__main.sc-grid-config::-webkit-scrollbar-thumb{background-color:var(--ez-grid-config__main__scrollbar--background-color);border-radius:var(--ez-grid-config__main__scrollbar--border-radius)}.grid-config__main.sc-grid-config::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-grid-config__scrollbar--width);max-width:var(--ez-grid-config__scrollbar--width);min-width:var(--ez-grid-config__scrollbar--width)}";
111452
+
111453
+ let GridConfig = class {
111454
+ constructor(hostRef) {
111455
+ registerInstance(this, hostRef);
111456
+ this.configFinish = createEvent(this, "configFinish", 7);
111457
+ this.configCancel = createEvent(this, "configCancel", 7);
111458
+ this._columnListHistory = [];
111459
+ this._orderListItems = [];
111460
+ this._columListItems = [];
111461
+ this.selectedTab = "Colunas";
111462
+ this._selectedIndex = -1;
111463
+ }
111464
+ /* Creation Methods */
111465
+ createOrderList() {
111466
+ var _a;
111467
+ let newList = [];
111468
+ if (((_a = this._columnListHistory) === null || _a === void 0 ? void 0 : _a.length) > 0) {
111469
+ this._columnListHistory.find(group => group.group === "Visíveis").items.forEach(column => {
111470
+ let item = { label: column.label };
111471
+ newList.push(item);
111472
+ });
111473
+ }
111474
+ else {
111475
+ this.columns.forEach(column => {
111476
+ let item = { name: column.name, label: column.label };
111477
+ if (!column.hidden) {
111478
+ newList.push(item);
111479
+ }
111480
+ });
111481
+ }
111482
+ this._orderListItems = newList;
111483
+ }
111484
+ createColumnList() {
111485
+ let visibleGroup = {
111486
+ group: 'Visíveis',
111487
+ items: [],
111488
+ };
111489
+ let hiddenGroup = {
111490
+ group: 'Ocultas',
111491
+ items: [],
111492
+ sort: 'ASC'
111493
+ };
111494
+ this.columns.forEach(column => {
111495
+ let item = { label: column.label };
111496
+ if (column.hidden) {
111497
+ hiddenGroup.items.push(item);
111498
+ }
111499
+ else {
111500
+ visibleGroup.items.push(item);
111501
+ }
111502
+ });
111503
+ if (this._columnListHistory.length <= 0) {
111504
+ this._columListItems = [visibleGroup, hiddenGroup];
111505
+ }
111506
+ }
111507
+ buildColumnListSlot(item, group) {
111508
+ return (h("div", null, h("ez-check", { mode: 'switch', id: 'switch' + item + group, value: group.group === "Visíveis", onEzChange: (ev) => { this.switchColumnGroup(ev, item); } })));
111509
+ }
111510
+ buildOrderListSlot(item) {
111511
+ let existingItem = this.columns.find(columnItem => columnItem.label === item.label);
111512
+ return (h("div", null, h("select-box", { selectedOption: existingItem === null || existingItem === void 0 ? void 0 : existingItem.sort, key: 'select-box' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item); } })));
111513
+ }
111514
+ updateOrder(sortOrder, updatedItem) {
111515
+ let newList = [...this.columns];
111516
+ let newItem = newList.find(item => item.label === updatedItem.label);
111517
+ if (newItem) {
111518
+ newItem.sort = sortOrder;
111519
+ }
111520
+ this.columns = newList;
111521
+ }
111522
+ /* Actions Methods */
111523
+ switchColumnGroup(ev, switchedItem) {
111524
+ ev.stopPropagation();
111525
+ let newList = [...this._columListItems];
111526
+ if (ev.detail === true) {
111527
+ let hiddenGroup = newList.find(group => group.group === "Ocultas");
111528
+ let index = hiddenGroup.items.findIndex(item => item.label === switchedItem.label);
111529
+ if (index >= 0) {
111530
+ hiddenGroup.items.splice(index, 1);
111531
+ }
111532
+ let visibleGroup = newList.find(group => group.group === "Visíveis");
111533
+ visibleGroup.items.push(switchedItem);
111534
+ this._columListItems = newList;
111535
+ this.createOrderList();
111536
+ }
111537
+ else if (ev.detail === false) {
111538
+ let visibleGroup = newList.find(group => group.group === "Visíveis");
111539
+ let index = visibleGroup.items.findIndex(item => item.label === switchedItem.label);
111540
+ if (index >= 0) {
111541
+ visibleGroup.items.splice(index, 1);
111542
+ }
111543
+ let hiddenGroup = newList.find(group => group.group === "Ocultas");
111544
+ hiddenGroup.items.push(switchedItem);
111545
+ this._columListItems = newList;
111546
+ this.createOrderList();
111547
+ }
111548
+ }
111549
+ finish() {
111550
+ let newColumnList = [];
111551
+ this._columListItems.forEach(group => {
111552
+ group.items.forEach(item => {
111553
+ const baseColumn = this.columns.find(column => column.label === item.label);
111554
+ let newColumnItem = Object.assign({}, baseColumn);
111555
+ if (group.group === "Ocultas") {
111556
+ newColumnItem.hidden = true;
111557
+ }
111558
+ else {
111559
+ newColumnItem.hidden = false;
111560
+ }
111561
+ newColumnList.push(newColumnItem);
111562
+ });
111563
+ });
111564
+ this._columnListHistory = [];
111565
+ this.columns = newColumnList;
111566
+ this.configFinish.emit(this.columns);
111567
+ }
111568
+ async locateColumn(evt, searchingText) {
111569
+ var _a;
111570
+ const hitEnter = evt.key === "Enter";
111571
+ if (!searchingText) {
111572
+ searchingText = (_a = evt.currentTarget) === null || _a === void 0 ? void 0 : _a.value;
111573
+ }
111574
+ let newSelected = -1;
111575
+ if (this.selectedTab === "Ordenação") {
111576
+ if (searchingText) {
111577
+ const matchedIndexes = [];
111578
+ let orderListDatasource;
111579
+ await this._orderList.getList().then(listGroup => {
111580
+ orderListDatasource = listGroup;
111581
+ orderListDatasource.forEach((column, index) => {
111582
+ if (this.compareWords(column, searchingText)) {
111583
+ matchedIndexes.push(index);
111584
+ }
111585
+ });
111586
+ });
111587
+ if (matchedIndexes.length > 0) {
111588
+ if (hitEnter) {
111589
+ for (let j = 0; j < matchedIndexes.length; j++) {
111590
+ if (matchedIndexes[j] > this._selectedIndex) {
111591
+ newSelected = matchedIndexes[j];
111592
+ break;
111593
+ }
111594
+ }
111595
+ }
111596
+ if (newSelected === -1) {
111597
+ newSelected = matchedIndexes[0];
111598
+ }
111599
+ }
111600
+ this._selectedIndex = newSelected;
111601
+ let selectedColumn;
111602
+ selectedColumn = orderListDatasource[newSelected];
111603
+ if (selectedColumn) {
111604
+ this._orderList.setSelection({ label: selectedColumn.label }, true);
111605
+ }
111606
+ else {
111607
+ this._orderList.setSelection(undefined);
111608
+ }
111609
+ }
111610
+ else {
111611
+ this._orderList.setSelection(undefined);
111612
+ }
111613
+ }
111614
+ else {
111615
+ if (searchingText) {
111616
+ const matchedIndexes = [];
111617
+ this.columns.forEach((column, index) => {
111618
+ if (this.compareWords(column, searchingText)) {
111619
+ matchedIndexes.push(index);
111620
+ }
111621
+ });
111622
+ if (matchedIndexes.length > 0) {
111623
+ if (hitEnter) {
111624
+ for (let j = 0; j < matchedIndexes.length; j++) {
111625
+ if (matchedIndexes[j] > this._selectedIndex) {
111626
+ newSelected = matchedIndexes[j];
111627
+ break;
111628
+ }
111629
+ }
111630
+ }
111631
+ if (newSelected === -1) {
111632
+ newSelected = matchedIndexes[0];
111633
+ }
111634
+ }
111635
+ this._selectedIndex = newSelected;
111636
+ let selectedColumn = this.columns[newSelected];
111637
+ if (selectedColumn) {
111638
+ this._columnList.setSelection({ label: selectedColumn.label }, true);
111639
+ }
111640
+ else {
111641
+ this._columnList.setSelection(undefined);
111642
+ }
111643
+ }
111644
+ else {
111645
+ this._columnList.setSelection(undefined);
111646
+ }
111647
+ }
111648
+ }
111649
+ compareWords(column, searchingText) {
111650
+ if (StringUtils.replaceAccentuatedChars(column.label).indexOf(StringUtils.replaceAccentuatedChars(searchingText)) > -1) {
111651
+ return true;
111652
+ }
111653
+ return false;
111654
+ }
111655
+ closeConfig() {
111656
+ this._columnListHistory = [];
111657
+ this.configCancel.emit();
111658
+ }
111659
+ /* Handlers */
111660
+ handleTabChange(ev) {
111661
+ var _a;
111662
+ if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.selectedTab) {
111663
+ if (ev.target.selectedTab === "Ordenação") {
111664
+ this._columnListHistory = this._columnList.dataSource;
111665
+ this.createOrderList();
111666
+ }
111667
+ this.selectedTab = ev.target.selectedTab;
111668
+ }
111669
+ }
111670
+ handleColumnListChange(ev) {
111671
+ var _a;
111672
+ if (ev.detail) {
111673
+ let visibleItems = (_a = ev.detail.find(group => group.group === "Visíveis")) === null || _a === void 0 ? void 0 : _a.items;
111674
+ if (visibleItems) {
111675
+ this._orderListItems = visibleItems;
111676
+ }
111677
+ }
111678
+ }
111679
+ componentWillRender() {
111680
+ var _a;
111681
+ if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
111682
+ this.createColumnList();
111683
+ this.createOrderList();
111684
+ }
111685
+ }
111686
+ componentDidRender() {
111687
+ var _a;
111688
+ if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
111689
+ this.locateColumn(new KeyboardEvent("arrow-right", { key: "ArrowRight" }), this._searchElement.value);
111690
+ }
111691
+ }
111692
+ render() {
111693
+ return (h(Host, null, h("div", { class: "grid-config__header" }, h("div", { class: "title-container" }, h("div", { class: "" }, h("label", { class: "title" }, "Configura\u00E7\u00E3o da Grade"), h("label", { class: "subtitle" }, "Defina visibilidade e ordem das colunas.")), h("div", { class: "button-close" }, h("ez-button", { mode: 'icon', image: getSpritePath("close"), size: 'medium', onClick: () => this.closeConfig() }))), h("div", { class: "tabselector-container" }, h("ez-tabselector", { selectedTab: this.selectedTab, selectedIndex: '0', onEzChange: (ev) => { this.handleTabChange(ev); }, tabs: 'Colunas, Ordena\u00E7\u00E3o' })), h("div", null, h("ez-text-input", { ref: (el) => this._searchElement = el, label: "Localizar coluna", onKeyUp: evt => this.locateColumn(evt) }, h("ez-icon", { slot: "leftIcon", size: "medium", href: getSpritePath("search") })))), h("div", { class: "grid-config__main" }, 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 }), h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedTab === "Ordenação" ? "" : "hidden", dataSource: this._orderListItems, ezSelectable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item) })), h("div", { class: "grid-config__footer" }, h("ez-button", { class: "padding-right--medium", label: "Cancelar", onClick: () => this.closeConfig() }), h("ez-button", { label: "Concluir", class: "button--primary", onClick: () => this.finish() }))));
111694
+ }
111695
+ static get assetsDirs() { return ["../assets"]; }
111696
+ };
111697
+ GridConfig.style = gridConfigCss;
111698
+
111699
+ const selectBoxCss = "select{border:1px solid #DCE0E8;font-family:'Sora';border-radius:3px;outline:none;cursor:pointer}";
111700
+
111701
+ let SelectBox = class {
111702
+ constructor(hostRef) {
111703
+ registerInstance(this, hostRef);
111704
+ this.ezChange = createEvent(this, "ezChange", 7);
111705
+ }
111706
+ changeSelection() {
111707
+ this.ezChange.emit(this._selectElem.value);
111708
+ }
111709
+ componentDidRender() {
111710
+ if (this._selectElem) {
111711
+ if (this.selectedOption) {
111712
+ this._selectElem.value = this.selectedOption;
111713
+ }
111714
+ else {
111715
+ this._selectElem.value = "na";
111716
+ }
111717
+ }
111718
+ }
111719
+ render() {
111720
+ return (h("select", { ref: (el) => this._selectElem = el, onChange: () => { this.changeSelection(); } }, h("option", { value: "na" }, "N/A"), h("option", { value: "asc" }, "A-Z"), h("option", { value: "desc" }, "Z-A")));
111721
+ }
111722
+ static get assetsDirs() { return ["../assets"]; }
111723
+ };
111724
+ SelectBox.style = selectBoxCss;
111725
+
111726
+ const testDuCss = ":host{display:block}";
111727
+
111728
+ let TestDu = class {
111729
+ constructor(hostRef) {
111730
+ registerInstance(this, hostRef);
111731
+ }
111732
+ componentWillLoad() {
111733
+ this.dataUnit = new DataUnit("testes_com_formulario");
111734
+ this.dataUnit.metadata = {
111735
+ name: "dd://br.com.sankhya.fin.cad.movimentacaoFinanceira/Financeiro",
111736
+ label: "Parceiro",
111737
+ fields: [
111738
+ {
111739
+ name: "CODPARC",
111740
+ label: "Parceiro",
111741
+ dataType: DataType.NUMBER,
111742
+ userInterface: UserInterface.SEARCH,
111743
+ required: true,
111744
+ properties: {}
111745
+ },
111746
+ {
111747
+ name: "RECDESP",
111748
+ label: "Receita/Despesa",
111749
+ dataType: DataType.TEXT,
111750
+ userInterface: UserInterface.OPTIONSELECTOR,
111751
+ required: true,
111752
+ properties: { options: `{"-1": "Despesa", "1": "Receita"}` }
111753
+ },
111754
+ {
111755
+ name: "P",
111756
+ label: "pera",
111757
+ dataType: DataType.TEXT,
111758
+ userInterface: UserInterface.OPTIONSELECTOR,
111759
+ properties: { options: `{"M": "Madura", "V": "Verde", "P": "Passada"}` }
111760
+ },
111761
+ {
111762
+ name: "ME",
111763
+ label: "ME",
111764
+ dataType: DataType.NUMBER,
111765
+ userInterface: UserInterface.DECIMALNUMBER,
111766
+ properties: { precision: 4, prettyPrecision: 1 }
111767
+ }
111768
+ ]
111769
+ };
111770
+ this.dataUnit.dataLoader = () => new Promise(accept => accept([
111771
+ {
111772
+ __record__id__: "1321321321321321",
111773
+ CODPARC: 10,
111774
+ NOMEPARC: "Parceiro 10",
111775
+ P: "M",
111776
+ L: "Bagaço",
111777
+ LI: "Azedo"
111778
+ }
111779
+ ]));
111780
+ }
111781
+ render() {
111782
+ return (h("ez-grid", { dataUnit: this.dataUnit }));
111783
+ }
111784
+ };
111785
+ TestDu.style = testDuCss;
111786
+
111787
+ export { EzButton as ez_button, EzCheck as ez_check, EzGrid as ez_grid, EzIcon as ez_icon, EzList as ez_list, EzModal as ez_modal, EzTabselector as ez_tabselector, EzTextInput as ez_text_input, GridConfig as grid_config, SelectBox as select_box, TestDu as test_du };