@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
@@ -2,11 +2,137 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index$1 = require('./index-2003dec4.js');
6
- const index = require('./index-a2266984.js');
7
- const AssetsUtils = require('./AssetsUtils-02db4f46.js');
5
+ const index = require('./index-0bce1636.js');
6
+ const index$1 = require('./index-2fc1b5fa.js');
7
+ const AssetsUtils = require('./AssetsUtils-caf95dab.js');
8
8
 
9
- var agGridCommunity_cjs = index.createCommonjsModule(function (module, exports) {
9
+ 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;}";
10
+
11
+ let EzButton = class {
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ /**
15
+ * Deixa o botão disponível ou não para interação com o usuário.
16
+ */
17
+ this.enabled = true;
18
+ /**
19
+ * Define o modo de uso do botão; opções: icon, link e regular
20
+ */
21
+ this.mode = "regular";
22
+ /**
23
+ * Quando em modo "icon" pode-se escolher entre [small,medium,large] (somente para o modo "icon")
24
+ */
25
+ this.size = "medium";
26
+ }
27
+ getIconSize() {
28
+ return this.size;
29
+ }
30
+ handleSlotChange(ev) {
31
+ const slot = ev.target;
32
+ const content = slot.assignedElements()[0];
33
+ if (this.mode == "link") {
34
+ content.style.display = "inline";
35
+ if (slot.name == "leftIcon") {
36
+ content.style.paddingRight = "var(--ez-button__inline__icon--padding)";
37
+ }
38
+ else if (slot.name == "rightIcon") {
39
+ content.style.paddingLeft = "var(--ez-button__inline__icon--padding)";
40
+ }
41
+ }
42
+ else {
43
+ content.style.setProperty('--ez-icon--color', 'var(--ez-icon--color)');
44
+ }
45
+ }
46
+ render() {
47
+ if (this.mode == "icon") {
48
+ return (index.h("button", { class: "icon " + this.size, type: "button", disabled: !this.enabled }, index.h("ez-icon", { class: "icon", href: this.image, size: this.getIconSize(), onClick: evt => {
49
+ if (!this.enabled)
50
+ evt.stopPropagation();
51
+ } })));
52
+ }
53
+ else if (this.mode == "label-icon") {
54
+ return (index.h("div", { class: "label-icon" }, index.h("button", { class: "icon", type: "button", disabled: !this.enabled }, index.h("ez-icon", { class: "icon", href: this.image, size: "large", onClick: evt => {
55
+ if (!this.enabled)
56
+ evt.stopPropagation();
57
+ } })), index.h("label", { title: this.label }, this.label)));
58
+ }
59
+ else if (this.mode == "link") {
60
+ return (index.h("a", null, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
61
+ }
62
+ else {
63
+ return (index.h("button", { type: "button", disabled: !this.enabled }, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
64
+ }
65
+ }
66
+ };
67
+ EzButton.style = ezButtonCss;
68
+
69
+ 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)}";
70
+
71
+ let EzCheck = class {
72
+ constructor(hostRef) {
73
+ index.registerInstance(this, hostRef);
74
+ this.ezChange = index.createEvent(this, "ezChange", 7);
75
+ /**
76
+ * Deixa o campo disponível ou não para interação com o usuário.
77
+ */
78
+ this.enabled = true;
79
+ /**
80
+ * Existem dois modos de visualização: regular e switch.
81
+ * Se esta propriedade for omitida, o componete assume o formato "regular".
82
+ * No modo "regular" a visualização é a tradicional de uma caixinha marcada/desmarcada.
83
+ * No modo "switch" o campo tem uma interface em formato de um pino liga/desliga.
84
+ */
85
+ this.mode = "regular";
86
+ }
87
+ adjustMode() {
88
+ if (this.mode === "switch") {
89
+ this._inputElem.classList.remove("regularMode");
90
+ this._inputElem.classList.add("switchMode");
91
+ }
92
+ else {
93
+ this._inputElem.classList.remove("switchMode");
94
+ this._inputElem.classList.add("regularMode");
95
+ }
96
+ }
97
+ //---------------------------------------------
98
+ // Public methods
99
+ //---------------------------------------------
100
+ /**
101
+ * Devolve o modo escolhido para o componente
102
+ */
103
+ async getMode() {
104
+ return this.mode;
105
+ }
106
+ /**
107
+ * Faz o foco no componente de input
108
+ */
109
+ async setFocus() {
110
+ this._inputElem.focus();
111
+ }
112
+ componentDidLoad() {
113
+ this.adjustMode();
114
+ }
115
+ changeValue() {
116
+ this.value = !this.value;
117
+ this.ezChange.emit(this.value);
118
+ }
119
+ getLabelClasses() {
120
+ let classes = "label";
121
+ if (!this.enabled) {
122
+ classes += " label--disabled";
123
+ }
124
+ return classes;
125
+ }
126
+ render() {
127
+ return (index.h(index.Host, null, index.h("input", { type: "checkbox", class: "regularMode", checked: this.value === true, onChange: () => { this.changeValue(); }, disabled: !this.enabled, ref: (el) => this._inputElem = el }), this.label ? index.h("label", { class: this.getLabelClasses(), onClick: () => { this.changeValue(); }, title: this.label }, this.label) : undefined));
128
+ }
129
+ static get watchers() { return {
130
+ "mode": ["adjustMode"]
131
+ }; }
132
+ };
133
+ EzCheck.style = ezCheckCss;
134
+
135
+ var agGridCommunity_cjs = index$1.createCommonjsModule(function (module, exports) {
10
136
 
11
137
  Object.defineProperty(exports, '__esModule', { value: true });
12
138
 
@@ -46308,7 +46434,7 @@ var BaseComponentWrapper = /** @class */ (function () {
46308
46434
  * @link http://www.ag-grid.com/
46309
46435
  * @license MIT
46310
46436
  */
46311
- var globalObj = typeof index.commonjsGlobal === 'undefined' ? {} : index.commonjsGlobal;
46437
+ var globalObj = typeof index$1.commonjsGlobal === 'undefined' ? {} : index$1.commonjsGlobal;
46312
46438
  globalObj.HTMLElement = typeof HTMLElement === 'undefined' ? {} : HTMLElement;
46313
46439
  globalObj.HTMLButtonElement = typeof HTMLButtonElement === 'undefined' ? {} : HTMLButtonElement;
46314
46440
  globalObj.HTMLSelectElement = typeof HTMLSelectElement === 'undefined' ? {} : HTMLSelectElement;
@@ -50013,7 +50139,7 @@ exports.simpleHttpRequest = simpleHttpRequest;
50013
50139
  exports.stringToArray = stringToArray;
50014
50140
  });
50015
50141
 
50016
- var agGridEnterprise_cjs = index.createCommonjsModule(function (module, exports) {
50142
+ var agGridEnterprise_cjs = index$1.createCommonjsModule(function (module, exports) {
50017
50143
 
50018
50144
  Object.defineProperty(exports, '__esModule', { value: true });
50019
50145
 
@@ -110241,6 +110367,60 @@ class AgGridController {
110241
110367
  }
110242
110368
  }
110243
110369
 
110370
+ /**
110371
+ * Classe com utiliários comuns para Strings.
110372
+ */
110373
+ class StringUtils {
110374
+ /**
110375
+ * Verifica se a string está vazia.
110376
+ * Valores null e undefined são considerados como vazio.
110377
+ *
110378
+ * @param value String para ser validada.
110379
+ */
110380
+ static isEmpty(value) {
110381
+ if (value == undefined || value === null) {
110382
+ return true;
110383
+ }
110384
+ value = value.toString();
110385
+ value = value.trim();
110386
+ if (value.length === 0) {
110387
+ return true;
110388
+ }
110389
+ return false;
110390
+ }
110391
+ /**
110392
+ * Remove acentos de vogais, substitui Ç por c e retorna a string em caixa alta.
110393
+ *
110394
+ * @param value String para ser transformada.
110395
+ */
110396
+ static replaceAccentuatedChars(text) {
110397
+ text = text.toUpperCase();
110398
+ text = text.replace(/[À]/, "A");
110399
+ text = text.replace(/[Á]/, "A");
110400
+ text = text.replace(/[Â]/, "A");
110401
+ text = text.replace(/[Ã]/, "A");
110402
+ text = text.replace(/[Ä]/, "A");
110403
+ text = text.replace(/[È]/, "E");
110404
+ text = text.replace(/[É]/, "E");
110405
+ text = text.replace(/[Ê]/, "E");
110406
+ text = text.replace(/[Ë]/, "E");
110407
+ text = text.replace(/[Ì]/, "I");
110408
+ text = text.replace(/[Í]/, "I");
110409
+ text = text.replace(/[Î]/, "I");
110410
+ text = text.replace(/[Ï]/, "I");
110411
+ text = text.replace(/[Ò]/, "O");
110412
+ text = text.replace(/[Ó]/, "O");
110413
+ text = text.replace(/[Ô]/, "O");
110414
+ text = text.replace(/[Ö]/, "O");
110415
+ text = text.replace(/[Ù]/, "U");
110416
+ text = text.replace(/[Ú]/, "U");
110417
+ text = text.replace(/[Û]/, "U");
110418
+ text = text.replace(/[Ü]/, "U");
110419
+ text = text.replace(/[Ç]/, "C");
110420
+ return text.replace(/[^a-z0-9]/gi, '');
110421
+ }
110422
+ }
110423
+
110244
110424
  class DataUnitBridge {
110245
110425
  constructor(gridController, dataUnit) {
110246
110426
  this._gridController = gridController;
@@ -110249,26 +110429,29 @@ class DataUnitBridge {
110249
110429
  }
110250
110430
  processAction(action) {
110251
110431
  switch (action.type) {
110252
- case index.Action.METADATA_LOADED:
110253
- const columnDefs = [];
110254
- this._dataUnit.metadata.fields.forEach(f => {
110255
- if (f.visible !== false) {
110256
- columnDefs.push({ label: f.label, name: f.name });
110257
- }
110258
- });
110259
- this._gridController.setColumnsDef(columnDefs, true);
110432
+ case index$1.Action.METADATA_LOADED:
110433
+ this._gridController.setColumnsDef(this.buildColumnDefs(), true);
110260
110434
  break;
110261
110435
  }
110262
110436
  }
110437
+ buildColumnDefs() {
110438
+ const columnDefs = [];
110439
+ this._dataUnit.metadata.fields.forEach(f => {
110440
+ if (f.visible !== false) {
110441
+ columnDefs.push({ label: f.label, name: f.name });
110442
+ }
110443
+ });
110444
+ return columnDefs;
110445
+ }
110263
110446
  }
110264
110447
 
110265
- 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)}";
110448
+ 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)}";
110266
110449
 
110267
110450
  let EzGrid = class {
110268
110451
  constructor(hostRef) {
110269
- index$1.registerInstance(this, hostRef);
110270
- this.ezColumnStateChange = index$1.createEvent(this, "ezColumnStateChange", 7);
110271
- this.ezSelectionChange = index$1.createEvent(this, "ezSelectionChange", 7);
110452
+ index.registerInstance(this, hostRef);
110453
+ this.ezColumnStateChange = index.createEvent(this, "ezColumnStateChange", 7);
110454
+ this.ezSelectionChange = index.createEvent(this, "ezSelectionChange", 7);
110272
110455
  this._gridController = new AgGridController(false);
110273
110456
  this._popUpVisible = false;
110274
110457
  /**
@@ -110342,15 +110525,18 @@ let EzGrid = class {
110342
110525
  serverURL: this.serverUrl,
110343
110526
  dataUnit: this.dataUnit
110344
110527
  });
110528
+ if (this._dataUnitBridge) {
110529
+ this._gridController.setColumnsDef(this._dataUnitBridge.buildColumnDefs(), true);
110530
+ }
110345
110531
  }
110346
110532
  getPaginationControl() {
110347
110533
  if (this.pageSize === -1) {
110348
110534
  return null;
110349
110535
  }
110350
110536
  return [
110351
- index$1.h("div", { class: "text text--primary text--medium margin-right--medium" }, index$1.h("strong", { class: "text text--primary text--medium" }, `${this._navigationFirstRow}-${this._navigationLastRow}`), ` de ${this._navigationTotalRows}`),
110352
- index$1.h("ez-button", { size: "small", image: AssetsUtils.getSpritePath("chevron-left"), class: "button--secondary margin-right--medium", mode: "icon", enabled: this._navigationHasPrevious, onClick: () => this._gridController.previousPage(), label: "P\u00E1gina anterior" }),
110353
- index$1.h("ez-button", { size: "small", image: AssetsUtils.getSpritePath("chevron-right"), class: "button--secondary margin-right--medium", mode: "icon", enabled: this._navigationHasNext, onClick: () => this._gridController.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })
110537
+ index.h("div", { class: "text text--primary text--medium margin-right--medium" }, index.h("strong", { class: "text text--primary text--medium" }, `${this._navigationFirstRow}-${this._navigationLastRow}`), ` de ${this._navigationTotalRows}`),
110538
+ index.h("ez-button", { size: "small", image: AssetsUtils.getSpritePath("chevron-left"), class: "button--secondary margin-right--medium", mode: "icon", enabled: this._navigationHasPrevious, onClick: () => this._gridController.previousPage(), label: "P\u00E1gina anterior" }),
110539
+ index.h("ez-button", { size: "small", image: AssetsUtils.getSpritePath("chevron-right"), class: "button--secondary margin-right--medium", mode: "icon", enabled: this._navigationHasNext, onClick: () => this._gridController.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })
110354
110540
  ];
110355
110541
  }
110356
110542
  applyConfig(cols) {
@@ -110366,10 +110552,1250 @@ let EzGrid = class {
110366
110552
  this._popUpVisible = true;
110367
110553
  }
110368
110554
  render() {
110369
- return (index$1.h(index$1.Host, null, index$1.h("div", { class: "box box--shadow padding--medium grid__header margin-bottom--small" }, this.getPaginationControl(), index$1.h("ez-button", { size: "small", image: AssetsUtils.getSpritePath("settings"), class: "button--secondary", mode: "icon", onClick: () => { this.openConfig(); } })), index$1.h("div", { class: "grid__container ag-sankhya-theme", ref: elem => this._container = elem }), index$1.h("div", { class: "grid__footer" }), index$1.h("ez-modal", { modalSize: "small", closeEsc: true, closeOutsideClick: true, opened: this._popUpVisible, onEzCloseModal: () => this._popUpVisible = false }, index$1.h("grid-config", { ref: ref => this._gridConfig = ref, selectedTab: "Colunas", onConfigFinish: evt => this.applyConfig(evt.detail), onConfigCancel: _evt => this.closeConfig() }))));
110555
+ return (index.h(index.Host, null, index.h("div", { class: "box box--shadow padding--medium grid__header margin-bottom--small" }, this.getPaginationControl(), index.h("ez-button", { size: "small", image: AssetsUtils.getSpritePath("settings"), class: "button--secondary", mode: "icon", onClick: () => { this.openConfig(); } })), index.h("div", { class: "grid__container ag-sankhya-theme", ref: elem => this._container = elem }), index.h("div", { class: "grid__footer" }), index.h("ez-modal", { modalSize: "small", closeEsc: true, closeOutsideClick: true, opened: this._popUpVisible, onEzCloseModal: () => this._popUpVisible = false }, index.h("grid-config", { ref: ref => this._gridConfig = ref, selectedTab: "Colunas", onConfigFinish: evt => this.applyConfig(evt.detail), onConfigCancel: _evt => this.closeConfig() }))));
110370
110556
  }
110371
110557
  static get assetsDirs() { return ["../assets"]; }
110372
110558
  };
110373
110559
  EzGrid.style = ezGridCss;
110374
110560
 
110561
+ 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}";
110562
+
110563
+ let EzIcon = class {
110564
+ constructor(hostRef) {
110565
+ index.registerInstance(this, hostRef);
110566
+ /**
110567
+ * Tamanho do ícone
110568
+ */
110569
+ this.size = 'medium';
110570
+ }
110571
+ isSprite() {
110572
+ return this.href && this.href.indexOf('#') > -1;
110573
+ }
110574
+ render() {
110575
+ return (index.h(index.Host, null, this.isSprite()
110576
+ ?
110577
+ index.h("svg", { class: this.size, role: "img" }, index.h("use", { xlinkHref: this.href }))
110578
+ :
110579
+ index.h("img", { class: this.size, src: this.href })));
110580
+ }
110581
+ };
110582
+ EzIcon.style = ezIconCss;
110583
+
110584
+ 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}";
110585
+
110586
+ let EzList = class {
110587
+ constructor(hostRef) {
110588
+ index.registerInstance(this, hostRef);
110589
+ this.ezChange = index.createEvent(this, "ezChange", 7);
110590
+ this._listItems = [];
110591
+ this._listGroupItems = [];
110592
+ this._listItemsHistory = [];
110593
+ /**
110594
+ * Define a lista inicial do componente.
110595
+ */
110596
+ this.dataSource = [];
110597
+ /**
110598
+ * Define se o componente renderizará os itens separados em grupos..
110599
+ */
110600
+ this.useGroups = false;
110601
+ /**
110602
+ * Define se o componente terá o comportamento de arrasto de linhas.
110603
+ */
110604
+ this.ezDraggable = false;
110605
+ /**
110606
+ * Define se os items da lista serão selecionáveis.
110607
+ */
110608
+ this.ezSelectable = false;
110609
+ }
110610
+ createList() {
110611
+ if (this.useGroups) {
110612
+ let list = [...this.dataSource];
110613
+ list.forEach(itemGroup => {
110614
+ this.sortGroup(itemGroup);
110615
+ });
110616
+ this._listGroupItems = list;
110617
+ }
110618
+ else {
110619
+ this._listItems = this._listItemsHistory.length > 0 ? this._listItemsHistory : [...this.dataSource];
110620
+ }
110621
+ }
110622
+ sortGroup(itemGroup) {
110623
+ if (itemGroup.sort) {
110624
+ itemGroup.items.sort(function (a, b) {
110625
+ return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
110626
+ });
110627
+ if (itemGroup.sort === "DSC") {
110628
+ itemGroup.items.reverse();
110629
+ }
110630
+ }
110631
+ }
110632
+ /**
110633
+ * 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).
110634
+ */
110635
+ async setSelection(selectedItem, scrollToOption) {
110636
+ if (selectedItem && this.ezSelectable) {
110637
+ if (this.useGroups) {
110638
+ let newList = [...this._listGroupItems];
110639
+ newList.forEach(groupItem => {
110640
+ groupItem.items.forEach(item => {
110641
+ if (item.label == selectedItem.label) {
110642
+ item.selected = !item.selected;
110643
+ }
110644
+ else {
110645
+ item.selected = false;
110646
+ }
110647
+ });
110648
+ });
110649
+ this._listGroupItems = newList;
110650
+ }
110651
+ else {
110652
+ let newList = [...this._listItems];
110653
+ newList.forEach(item => {
110654
+ if (item.label === selectedItem.label) {
110655
+ item.selected = !item.selected;
110656
+ }
110657
+ else {
110658
+ item.selected = false;
110659
+ }
110660
+ });
110661
+ this._listItems = newList;
110662
+ }
110663
+ if (scrollToOption) {
110664
+ let liElem = this.useGroups ?
110665
+ this._groupContainer.querySelector('li#item_' + this.getItemId(selectedItem.label))
110666
+ : this._itemContainer.querySelector('li#item_' + this.getItemId(selectedItem.label));
110667
+ if (liElem) {
110668
+ liElem.scrollIntoView();
110669
+ }
110670
+ }
110671
+ }
110672
+ else {
110673
+ this.removeSelection();
110674
+ }
110675
+ }
110676
+ removeSelection() {
110677
+ if (this.useGroups) {
110678
+ let newList = [...this._listGroupItems];
110679
+ newList.forEach(groupItem => {
110680
+ groupItem.items.forEach(item => {
110681
+ item.selected = false;
110682
+ });
110683
+ });
110684
+ this._listGroupItems = newList;
110685
+ }
110686
+ else {
110687
+ let newList = [...this._listItems];
110688
+ newList.forEach(item => {
110689
+ item.selected = false;
110690
+ });
110691
+ this._listItems = newList;
110692
+ }
110693
+ }
110694
+ /**
110695
+ * Retorna o item selecionado.
110696
+ */
110697
+ async getSelection() {
110698
+ let selectedItem;
110699
+ if (this.useGroups) {
110700
+ this._listGroupItems.every(group => {
110701
+ let item = group.items.find((item) => item.selected == true);
110702
+ if (item) {
110703
+ selectedItem = item;
110704
+ return false;
110705
+ }
110706
+ return true;
110707
+ });
110708
+ }
110709
+ else {
110710
+ selectedItem = this._listItems.find((item) => item.selected == true);
110711
+ }
110712
+ return selectedItem;
110713
+ }
110714
+ /**
110715
+ * Retorna a lista de items conforme o modo de uso.
110716
+ */
110717
+ async getList() {
110718
+ if (this.useGroups) {
110719
+ return this._listGroupItems;
110720
+ }
110721
+ return this._listItems;
110722
+ }
110723
+ componentWillLoad() {
110724
+ this._listItemsHistory = [];
110725
+ }
110726
+ componentWillRender() {
110727
+ this.createList();
110728
+ }
110729
+ onDrop(ev, dragEndItem) {
110730
+ this.removeOverClass(ev);
110731
+ this.setSelection(undefined);
110732
+ if (this._dragStartItem) {
110733
+ if (this.useGroups) {
110734
+ let newList = [...this._listGroupItems];
110735
+ let groupEnd = this._listGroupItems.find(group => dragEndItem.groupName == group.group);
110736
+ //Remove item arrastado
110737
+ newList.find(group => group.group == this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
110738
+ //Adiciona item arrastado
110739
+ if (groupEnd.sort) {
110740
+ newList.find(group => group.group == dragEndItem.groupName).items.push(this._dragStartItem.item);
110741
+ newList.find(group => group.group == dragEndItem.groupName).items.sort(function (a, b) {
110742
+ return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
110743
+ });
110744
+ if (groupEnd.sort === "DSC") {
110745
+ newList.find(group => group.group == dragEndItem.groupName).items.reverse();
110746
+ }
110747
+ }
110748
+ else {
110749
+ newList.find(group => group.group == dragEndItem.groupName).items.splice(dragEndItem.index, 0, this._dragStartItem.item);
110750
+ }
110751
+ this._listGroupItems = newList;
110752
+ this.ezChange.emit(this._listGroupItems);
110753
+ }
110754
+ else {
110755
+ let newList = [...this._listItems];
110756
+ newList.splice(this._dragStartItem.index, 1);
110757
+ newList.splice(dragEndItem.index, 0, this._dragStartItem.item);
110758
+ this._listItems = newList;
110759
+ this._listItemsHistory = newList;
110760
+ this.ezChange.emit(this._listItems);
110761
+ }
110762
+ }
110763
+ ev.stopPropagation();
110764
+ }
110765
+ onDropGroup(groupSelected) {
110766
+ var _a;
110767
+ let newList = [...this._listGroupItems];
110768
+ this.setSelection(undefined);
110769
+ let newGroup = newList.find(group => group.group === groupSelected.group);
110770
+ if (newGroup) {
110771
+ if (((_a = newGroup.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
110772
+ let newItem;
110773
+ newGroup.items.forEach((item, index) => {
110774
+ if (item.label === this._dragStartItem.item.label) {
110775
+ newItem = { item: item, index: index };
110776
+ }
110777
+ });
110778
+ if (newItem) {
110779
+ newGroup.items.splice(newItem.index, 1);
110780
+ newGroup.items.unshift(newItem.item);
110781
+ this.sortGroup(newGroup);
110782
+ }
110783
+ else {
110784
+ newGroup.items.unshift(this._dragStartItem.item);
110785
+ this.sortGroup(newGroup);
110786
+ newList.find(group => group.group === this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
110787
+ }
110788
+ }
110789
+ else {
110790
+ newList.find(group => group.group === this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
110791
+ newGroup.items = [this._dragStartItem.item];
110792
+ }
110793
+ this._listGroupItems = newList;
110794
+ }
110795
+ }
110796
+ onDragEnd() {
110797
+ this._dragStartItem = undefined;
110798
+ if (this._draggingElement) {
110799
+ try {
110800
+ this._element.shadowRoot.removeChild(this._draggingElement);
110801
+ }
110802
+ catch (err) { }
110803
+ this._draggingElement = undefined;
110804
+ }
110805
+ }
110806
+ addOverClass(ev) {
110807
+ if (ev.target.__proto__ == HTMLDivElement.prototype && ev.target.classList.contains("draggable")) {
110808
+ ev.target.classList.add('over');
110809
+ }
110810
+ }
110811
+ addOverGroupClass(ev, group) {
110812
+ if (ev.target) {
110813
+ let groupContainer = this._groupContainer.querySelector("div#" + this.getDivGroupId(group.group));
110814
+ if (group.items.length > 0) {
110815
+ let groupOverlay = groupContainer.getElementsByClassName("group-overlay")[0];
110816
+ groupOverlay.setAttribute("style", "display:grid");
110817
+ }
110818
+ else {
110819
+ groupContainer === null || groupContainer === void 0 ? void 0 : groupContainer.classList.add('overGroup');
110820
+ }
110821
+ }
110822
+ }
110823
+ removeOverClass(ev) {
110824
+ ev.target.classList.remove('over');
110825
+ }
110826
+ removeOverGroupClass(ev, group) {
110827
+ if (ev.target) {
110828
+ let groupContainer = this._groupContainer.querySelector("div#" + this.getDivGroupId(group.group));
110829
+ if (group.items.length > 0) {
110830
+ let groupOverlay = groupContainer.getElementsByClassName("group-overlay")[0];
110831
+ groupOverlay.setAttribute("style", "display:none");
110832
+ }
110833
+ else {
110834
+ groupContainer === null || groupContainer === void 0 ? void 0 : groupContainer.classList.remove('overGroup');
110835
+ }
110836
+ }
110837
+ }
110838
+ onDragStart(event, item, group, index) {
110839
+ if (this.useGroups) {
110840
+ this._dragStartItem = { groupName: group.group, item: item, index: index };
110841
+ }
110842
+ else {
110843
+ this._dragStartItem = { item: item.item, index: item.index };
110844
+ }
110845
+ let sourceElement = event.srcElement.cloneNode(true);
110846
+ this._draggingElement = event.srcElement.cloneNode(true);
110847
+ this._draggingElement.style.position = "absolute";
110848
+ this._draggingElement.style.top = (event.clientY + 5) + 'px';
110849
+ this._draggingElement.style.left = (event.clientX + 5) + 'px';
110850
+ this._draggingElement.style.height = event.srcElement.clientHeight + 'px';
110851
+ this._draggingElement.style.width = event.srcElement.clientWidth + 'px';
110852
+ this._draggingElement.style.background = "#FFFFFF";
110853
+ this._draggingElement.style.border = "1px solid #008561";
110854
+ this._draggingElement.style["box-sizing"] = "border-box";
110855
+ this._draggingElement.style["box-shadow"] = "0px 0px 16px rgba(0, 38, 111, 0.122)";
110856
+ this._draggingElement.style["border-radius"] = "6px";
110857
+ this._element.shadowRoot.appendChild(this._draggingElement);
110858
+ event.dataTransfer.setDragImage(sourceElement, -10000, -10000);
110859
+ }
110860
+ onDrag(event) {
110861
+ if (this._draggingElement) {
110862
+ this._draggingElement.style.top = (event.clientY + 5) + 'px';
110863
+ this._draggingElement.style.left = (event.clientX + 5) + 'px';
110864
+ }
110865
+ }
110866
+ selectFirstItem() {
110867
+ if (this.useGroups) {
110868
+ this.setSelection(this._listGroupItems[0].items[0]);
110869
+ }
110870
+ {
110871
+ this.setSelection(this._listItems[0]);
110872
+ }
110873
+ }
110874
+ nextOption(selectedItem) {
110875
+ let nextItem = undefined;
110876
+ if (this.useGroups) {
110877
+ this._listGroupItems.every((group, groupIndex, listGroupItems) => {
110878
+ let item = undefined;
110879
+ let itemIndex = group.items.findIndex(item => item.label == selectedItem.label);
110880
+ if (itemIndex != undefined && itemIndex != -1) {
110881
+ if (itemIndex === group.items.length - 1) {
110882
+ if (groupIndex + 1 <= listGroupItems.length - 1) {
110883
+ item = { label: listGroupItems[groupIndex + 1].items[0].label };
110884
+ }
110885
+ }
110886
+ else {
110887
+ item = { label: group.items[itemIndex + 1].label };
110888
+ }
110889
+ }
110890
+ if (item != undefined) {
110891
+ nextItem = item;
110892
+ return false;
110893
+ }
110894
+ return true;
110895
+ });
110896
+ }
110897
+ else {
110898
+ let itemIndex = this._listItems.findIndex(item => item.label === selectedItem.label);
110899
+ if (itemIndex >= 0 && itemIndex < this._listItems.length) {
110900
+ nextItem = this._listItems[itemIndex + 1];
110901
+ }
110902
+ }
110903
+ this.setSelection(nextItem, true);
110904
+ }
110905
+ previousOption(selectedItem) {
110906
+ let previousItem = undefined;
110907
+ if (this.useGroups) {
110908
+ this._listGroupItems.every((group, groupIndex, listGroupItems) => {
110909
+ let item = undefined;
110910
+ let itemIndex = group.items.findIndex(item => item.label == selectedItem.label);
110911
+ if (itemIndex != undefined && itemIndex != -1) {
110912
+ if (itemIndex === 0) {
110913
+ if ((groupIndex - 1 >= 0)) {
110914
+ item = { label: listGroupItems[groupIndex - 1].items[listGroupItems[groupIndex - 1].items.length - 1].label };
110915
+ }
110916
+ }
110917
+ else {
110918
+ item = { label: group.items[itemIndex - 1].label };
110919
+ }
110920
+ }
110921
+ if (item != undefined) {
110922
+ previousItem = item;
110923
+ return false;
110924
+ }
110925
+ return true;
110926
+ });
110927
+ }
110928
+ else {
110929
+ let itemIndex = this._listItems.findIndex(item => item.label === selectedItem.label);
110930
+ if (itemIndex > 0 && itemIndex < this._listItems.length) {
110931
+ previousItem = this._listItems[itemIndex - 1];
110932
+ }
110933
+ }
110934
+ this.setSelection(previousItem, true);
110935
+ }
110936
+ keyDownHandler(event) {
110937
+ event.preventDefault();
110938
+ this.getSelection().then(selectedItem => {
110939
+ if (selectedItem) {
110940
+ switch (event.key) {
110941
+ case "ArrowDown":
110942
+ this.nextOption(selectedItem);
110943
+ break;
110944
+ case "ArrowUp":
110945
+ this.previousOption(selectedItem);
110946
+ break;
110947
+ }
110948
+ }
110949
+ else {
110950
+ this.selectFirstItem();
110951
+ }
110952
+ });
110953
+ event.stopPropagation();
110954
+ }
110955
+ getItemId(itemLabel) {
110956
+ if (itemLabel) {
110957
+ return itemLabel.replace(/[^a-z0-9_]/gi, "_");
110958
+ }
110959
+ return undefined;
110960
+ }
110961
+ getDivGroupId(groupName) {
110962
+ if (groupName) {
110963
+ return "group-" + groupName.replace(/[^a-z0-9_]/gi, "_");
110964
+ }
110965
+ return undefined;
110966
+ }
110967
+ onDragOverGroup(event, group) {
110968
+ if (this._dragStartItem && this._dragStartItem.groupName !== group.group) {
110969
+ event.preventDefault();
110970
+ this.addOverGroupClass(event, group);
110971
+ }
110972
+ }
110973
+ onDragOverItem(event, group) {
110974
+ if (this._dragStartItem) {
110975
+ event.preventDefault();
110976
+ if (group) {
110977
+ group.sort ?
110978
+ () => {
110979
+ this.addOverGroupClass(event, group);
110980
+ }
110981
+ : this.addOverClass(event);
110982
+ }
110983
+ else {
110984
+ this.addOverClass(event);
110985
+ }
110986
+ event.stopPropagation();
110987
+ }
110988
+ }
110989
+ render() {
110990
+ return (index.h(index.Host, { ref: (el) => this._element = el }, this.useGroups ?
110991
+ index.h("div", { class: "group-container", ref: (el) => this._groupContainer = el, tabIndex: 0, onKeyDown: (event) => { this.keyDownHandler(event); } }, this._listGroupItems.map(group => {
110992
+ return index.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) }, index.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), index.h("section", { class: "section-container", onDragOver: (ev) => ev.preventDefault() }, index.h("div", { class: "group-items-container" }, index.h("div", { class: "draggable-list" }, group.items.map((item, index$1) => {
110993
+ return index.h("li", { id: 'item_' + this.getItemId(item.label), class: this.ezSelectable ? "selectable-container" : "", key: 'item_' + this.getItemId(item.label) }, index.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$1), onDragOver: (event) => this.onDragOverItem(event, group), onDrop: (event) => this.onDrop(event, { groupName: group.group, item: item, index: index$1 }), onDrag: (event) => this.onDrag(event), draggable: this.ezDraggable }, index.h("div", { class: "item-content" }, this.ezDraggable ? index.h("span", { class: "draggable-icon" }) : undefined, index.h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label)), this.itemSlotBuilder ?
110994
+ index.h("div", { class: "slot-item" }, this.itemSlotBuilder(item, group))
110995
+ : undefined));
110996
+ }))), index.h("div", { class: "group-overlay" }, index.h("div", { id: "overlay-text" }, index.h("b", null, "Mover"), " para ", group.group))));
110997
+ }))
110998
+ :
110999
+ index.h("div", { class: "items-container", ref: (el) => this._itemContainer = el, tabIndex: 0, onKeyDown: (event) => { this.keyDownHandler(event); } }, index.h("div", { class: "draggable-list" }, this._listItems.map((item, index$1) => {
111000
+ return index.h("li", { id: 'item_' + this.getItemId(item.label), class: this.ezSelectable ? "selectable-container" : "", key: 'item_' + this.getItemId(item.label) }, index.h("div", { class: "draggable" + (item.selected == true ? " selected-item " : "") + (this.ezSelectable == true ? " selectable " : ""), onDragStart: (event) => this.onDragStart(event, { item: item, index: index$1 }), 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$1 }), onDrag: (event) => this.onDrag(event), draggable: this.ezDraggable }, index.h("div", { class: "item-content" }, this.ezDraggable ? index.h("span", { class: "draggable-icon" }) : undefined, index.h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label)), this.itemSlotBuilder ?
111001
+ index.h("div", null, this.itemSlotBuilder(item))
111002
+ : undefined));
111003
+ })))));
111004
+ }
111005
+ };
111006
+ EzList.style = ezListCss;
111007
+
111008
+ 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%}}";
111009
+
111010
+ let EzModal = class {
111011
+ constructor(hostRef) {
111012
+ index.registerInstance(this, hostRef);
111013
+ this.ezCloseModal = index.createEvent(this, "ezCloseModal", 7);
111014
+ /**
111015
+ * Controle de exibição do Modal
111016
+ */
111017
+ this.opened = true;
111018
+ /**
111019
+ * Define se o modal será fechado ao clicar ESC
111020
+ */
111021
+ this.closeEsc = false;
111022
+ /**
111023
+ * Define se o modal será fechado ao clicar fora do conteúdo.
111024
+ */
111025
+ this.closeOutsideClick = false;
111026
+ this.handleKeyboardEvent = (ev) => {
111027
+ if ((ev === null || ev === void 0 ? void 0 : ev.key) === "Escape" && this.closeEsc) {
111028
+ this.closeModal();
111029
+ }
111030
+ };
111031
+ }
111032
+ handleopenedChange() {
111033
+ if (this.opened) {
111034
+ document.addEventListener("keydown", this.handleKeyboardEvent);
111035
+ }
111036
+ else {
111037
+ document.removeEventListener("keydown", this.handleKeyboardEvent);
111038
+ }
111039
+ }
111040
+ closeModal() {
111041
+ this.opened = false;
111042
+ this.ezCloseModal.emit(this.opened);
111043
+ }
111044
+ componentDidLoad() {
111045
+ this.handleopenedChange();
111046
+ }
111047
+ onMouseDownHandler(event) {
111048
+ if (this.closeOutsideClick && event.target === this._overlay) {
111049
+ this.closeModal();
111050
+ }
111051
+ }
111052
+ render() {
111053
+ const positionSufix = this.align === "left" ? "left" : "right";
111054
+ return (index.h(index.Host, null, this.opened
111055
+ ?
111056
+ index.h("div", { class: "modal", onMouseDown: evt => this.onMouseDownHandler(evt) }, index.h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, index.h("div", { class: `modal__content modal__content--${positionSufix} ${this.modalSize}` }, index.h("slot", null))))
111057
+ :
111058
+ undefined));
111059
+ }
111060
+ static get watchers() { return {
111061
+ "opened": ["handleopenedChange"]
111062
+ }; }
111063
+ };
111064
+ EzModal.style = ezModalCss;
111065
+
111066
+ 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}";
111067
+
111068
+ let EzTabselector = class {
111069
+ constructor(hostRef) {
111070
+ index.registerInstance(this, hostRef);
111071
+ this.ezChange = index.createEvent(this, "ezChange", 7);
111072
+ this.setFocusedParam = (ev) => {
111073
+ if (ev.key === "Enter") {
111074
+ this.selectedIndex = this.focusedIndex;
111075
+ this.focusedIndex = undefined;
111076
+ this.selectedTab = this._processedTabs[this.selectedIndex]["tabKey"];
111077
+ this.handleTabClick(this.selectedTab, parseInt(this.selectedIndex));
111078
+ ev.preventDefault();
111079
+ this.setFocusedTab(this.selectedIndex);
111080
+ }
111081
+ else if (ev.key === "ArrowLeft" || ev.key === "ArrowRight") {
111082
+ let operator = undefined;
111083
+ if (ev.key === "ArrowLeft") {
111084
+ operator = false;
111085
+ }
111086
+ else if (ev.key === "ArrowRight") {
111087
+ operator = true;
111088
+ }
111089
+ else {
111090
+ return;
111091
+ }
111092
+ if (this.focusedIndex === undefined) {
111093
+ if (operator === false) {
111094
+ this.focusedIndex = this.selectedIndex !== undefined ? (parseInt(this.selectedIndex) - 1).toString() : undefined;
111095
+ }
111096
+ else {
111097
+ this.focusedIndex = this.selectedIndex !== undefined ? (parseInt(this.selectedIndex) + 1).toString() : undefined;
111098
+ }
111099
+ }
111100
+ else {
111101
+ if (operator === false) {
111102
+ this.focusedIndex = (parseInt(this.focusedIndex) - 1).toString();
111103
+ }
111104
+ else {
111105
+ this.focusedIndex = (parseInt(this.focusedIndex) + 1).toString();
111106
+ }
111107
+ }
111108
+ if (parseInt(this.focusedIndex) < 0) {
111109
+ this.focusedIndex = "0";
111110
+ }
111111
+ else if (parseInt(this.focusedIndex) > this._processedTabs.length - 1) {
111112
+ this.focusedIndex = (this._processedTabs.length - 1).toString();
111113
+ }
111114
+ this.setFocusedBtn(true, this.focusedIndex);
111115
+ this.setFocusedTab(this.focusedIndex);
111116
+ this.ezChange.emit(this.selectedTab);
111117
+ }
111118
+ else if (ev.key === "Tab" || ev.key === "Escape") {
111119
+ this.focusedIndex = undefined;
111120
+ this.selectedTab = this._processedTabs[this.selectedIndex]["tabKey"];
111121
+ this.handleTabClick(this.selectedTab, parseInt(this.selectedIndex));
111122
+ ev.preventDefault();
111123
+ this.setFocusedTab(this.selectedIndex);
111124
+ }
111125
+ // this.setFocusedTab();
111126
+ };
111127
+ }
111128
+ handleTabClick(tab, index) {
111129
+ this.selectedIndex = index.toString();
111130
+ this.focusedIndex = undefined;
111131
+ this.selectedTab = tab;
111132
+ this.ezChange.emit(this.selectedTab);
111133
+ this.setFocusedBtn(false, this.selectedIndex);
111134
+ }
111135
+ componentWillRender() {
111136
+ if (!this._processedTabs) {
111137
+ this._processedTabs = [];
111138
+ if (this.tabs) {
111139
+ this.tabs.split(",").forEach((label) => {
111140
+ label = label.trim();
111141
+ this._processedTabs.push(new Tab(label, label));
111142
+ });
111143
+ }
111144
+ this._hostElem.querySelectorAll("ez-tab").forEach((elem) => {
111145
+ const tabKey = elem.getAttribute("tabKey");
111146
+ const label = elem.getAttribute("label");
111147
+ const t = new Tab(label, tabKey);
111148
+ const content = elem.firstChild;
111149
+ if (content) {
111150
+ content.setAttribute("slot", "tab" + this._processedTabs.length);
111151
+ this._hostElem.appendChild(content);
111152
+ }
111153
+ this._processedTabs.push(t);
111154
+ });
111155
+ }
111156
+ }
111157
+ handleSlotChange(ev) {
111158
+ const slot = ev.target;
111159
+ const content = slot.assignedElements()[0];
111160
+ if (content) {
111161
+ content.style.marginLeft = "6px";
111162
+ }
111163
+ }
111164
+ scrollBackward() {
111165
+ const container = this._scrollContainer;
111166
+ if (container) {
111167
+ container.scrollLeft -= container.clientWidth;
111168
+ }
111169
+ }
111170
+ scrollFoward() {
111171
+ const container = this._scrollContainer;
111172
+ if (container) {
111173
+ let lastTab = null;
111174
+ container.querySelectorAll(".tab").forEach((tab) => {
111175
+ if (tab.getBoundingClientRect().right < container.clientWidth) {
111176
+ lastTab = tab;
111177
+ }
111178
+ });
111179
+ container.scrollLeft = lastTab.offsetLeft + lastTab.offsetWidth;
111180
+ }
111181
+ }
111182
+ componentDidRender() {
111183
+ this.updateScroll();
111184
+ }
111185
+ updateScroll() {
111186
+ const container = this._scrollContainer;
111187
+ if (container) {
111188
+ const { scrollWidth, clientWidth, scrollLeft } = container;
111189
+ const remainingScroll = scrollWidth - clientWidth - Math.ceil(scrollLeft);
111190
+ this._startHidden = container.scrollLeft > 0;
111191
+ this._endHidden = remainingScroll > 0;
111192
+ if (this._startHidden) {
111193
+ this._backwardButton.classList.remove("hidden");
111194
+ }
111195
+ else {
111196
+ this._backwardButton.classList.add("hidden");
111197
+ }
111198
+ if (this._endHidden) {
111199
+ this._forwardButton.classList.remove("hidden");
111200
+ }
111201
+ else {
111202
+ this._forwardButton.classList.add("hidden");
111203
+ }
111204
+ const classNames = ["", "startHidden", "endHidden", "midle"];
111205
+ const currentClass = classNames[Number(this._startHidden) | Number(this._endHidden) << 1];
111206
+ classNames.forEach((name) => {
111207
+ if (name !== currentClass && container.classList.contains(name)) {
111208
+ container.classList.remove(name);
111209
+ }
111210
+ });
111211
+ if (currentClass && !container.classList.contains(currentClass)) {
111212
+ container.classList.add(currentClass);
111213
+ }
111214
+ }
111215
+ }
111216
+ domScrollHandler() {
111217
+ window.clearTimeout(this._scrollCallBack);
111218
+ this._scrollCallBack = window.setTimeout(() => { this.updateScroll(); }, 200);
111219
+ }
111220
+ setFocusedTab(index) {
111221
+ window.clearTimeout(this._scrollCallBackTest);
111222
+ this._scrollCallBackTest = window.setTimeout(() => {
111223
+ const tabtoscroll = this._scrollContainer.querySelector(`#tab${index}`);
111224
+ tabtoscroll.scrollIntoView();
111225
+ }, 200);
111226
+ }
111227
+ getTextWidth(text) {
111228
+ if (this._textMesurement === undefined) {
111229
+ this._textMesurement = this._hostElem.shadowRoot.ownerDocument.createElement("canvas");
111230
+ }
111231
+ const context = this._textMesurement.getContext("2d");
111232
+ context.font = "14px Sora, Algerian";
111233
+ return Math.min(220, 24 + context.measureText(text).width) + "px";
111234
+ }
111235
+ ;
111236
+ setFocusedBtn(visible, parameter) {
111237
+ const tabsButtons = this._scrollContainer.querySelectorAll(".tab");
111238
+ tabsButtons.forEach((el) => {
111239
+ el.classList.remove("is-focused");
111240
+ if (el.id === "tab" + parameter && visible) {
111241
+ el.classList.add("is-focused");
111242
+ }
111243
+ });
111244
+ }
111245
+ render() {
111246
+ return (index.h(index.Host, null, index.h("button", { class: "backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }), index.h("div", { class: "scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev) }, this._processedTabs.map((tab, index$1) => {
111247
+ const labelStyle = { "min-width": this.getTextWidth(tab.label) };
111248
+ const tabId = "tab" + index$1;
111249
+ const isSelected = index$1 === parseInt(this.selectedIndex) || (this.selectedTab && tab.tabKey === this.selectedTab);
111250
+ if (isSelected) {
111251
+ this.selectedTab = tab.tabKey;
111252
+ this.selectedIndex = index$1.toString();
111253
+ }
111254
+ return index.h("button", { id: tabId, class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab.tabKey, index$1), style: labelStyle }, index.h("span", { class: "tab-label", title: tab.label }, tab.label), index.h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } }));
111255
+ })), index.h("button", { class: "forward-button", ref: (el) => this._forwardButton = el, onClick: () => this.scrollFoward() })));
111256
+ }
111257
+ get _hostElem() { return index.getElement(this); }
111258
+ };
111259
+ class Tab {
111260
+ constructor(label, tabKey) {
111261
+ this.label = label;
111262
+ this.tabKey = tabKey;
111263
+ }
111264
+ }
111265
+ EzTabselector.style = ezTabselectorCss;
111266
+
111267
+ 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}";
111268
+
111269
+ let EzTextInput = class {
111270
+ constructor(hostRef) {
111271
+ index.registerInstance(this, hostRef);
111272
+ this.ezChange = index.createEvent(this, "ezChange", 7);
111273
+ /**
111274
+ * Deixa o campo disponível ou não para digitação.
111275
+ */
111276
+ this.enabled = true;
111277
+ }
111278
+ showError() {
111279
+ const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
111280
+ if (hasError) {
111281
+ this._inputElem.classList.add("hasError");
111282
+ this._messageBoxElem.classList.add("hasError");
111283
+ }
111284
+ else {
111285
+ this._inputElem.classList.remove("hasError");
111286
+ this._messageBoxElem.classList.remove("hasError");
111287
+ }
111288
+ }
111289
+ prepareMask() {
111290
+ if (this.mask) {
111291
+ if (this._maskFormatter == undefined) {
111292
+ this._maskFormatter = new index$1.MaskFormatter(this.mask);
111293
+ }
111294
+ else {
111295
+ this._maskFormatter.mask = this.mask;
111296
+ }
111297
+ }
111298
+ }
111299
+ updateInputValue() {
111300
+ if (this._inputElem) {
111301
+ this._inputElem.value = this.value;
111302
+ }
111303
+ this.handleChange();
111304
+ this.errorMessage = "";
111305
+ this.ezChange.emit(this.value);
111306
+ this.adjustFloatingLabel();
111307
+ }
111308
+ adjustFloatingLabel() {
111309
+ if (this.label && this._labelElem) {
111310
+ if (this._inputElem && !this._inputElem.classList.contains("input--with--label")) {
111311
+ this._inputElem.classList.add("input--with--label");
111312
+ }
111313
+ const hasValue = this.value && this.value.toString().length > 0;
111314
+ const containsFloatedClass = this._labelElem.classList.contains("input__label--floated");
111315
+ if (hasValue || this.isFocused()) {
111316
+ if (!containsFloatedClass) {
111317
+ this._labelElem.classList.add("input__label--floated");
111318
+ }
111319
+ }
111320
+ else {
111321
+ if (containsFloatedClass) {
111322
+ this._labelElem.classList.remove("input__label--floated");
111323
+ }
111324
+ }
111325
+ }
111326
+ }
111327
+ isFocused() {
111328
+ return this._hostElement.shadowRoot.activeElement !== null;
111329
+ }
111330
+ //---------------------------------------------
111331
+ // Public methods
111332
+ //---------------------------------------------
111333
+ /**
111334
+ * Faz o foco no componente de input
111335
+ */
111336
+ async setFocus() {
111337
+ this._inputElem.focus();
111338
+ }
111339
+ /**
111340
+ * Remove o foco no componente de input
111341
+ */
111342
+ async setBlur() {
111343
+ this._inputElem.blur();
111344
+ }
111345
+ //---------------------------------------------
111346
+ // Event handlers
111347
+ //---------------------------------------------
111348
+ handleFocusout() {
111349
+ const value = this._inputElem.value;
111350
+ if (value && this._maskFormatter) {
111351
+ try {
111352
+ this._inputElem.value = this._maskFormatter.format(value);
111353
+ }
111354
+ catch (e) {
111355
+ this.errorMessage = e.message;
111356
+ }
111357
+ }
111358
+ this.value = this._inputElem.value;
111359
+ this.adjustFloatingLabel();
111360
+ }
111361
+ isValidValue(value) {
111362
+ if (this.restrict) {
111363
+ return Array.from(value).reduce((valid, c) => valid && this.restrict.indexOf(c) > -1, true);
111364
+ }
111365
+ return true;
111366
+ }
111367
+ handleChange() {
111368
+ if (!this._inputElem) {
111369
+ return;
111370
+ }
111371
+ const value = this._inputElem.value;
111372
+ if (this.isValidValue(value)) {
111373
+ this._lastValidValue = value;
111374
+ }
111375
+ else {
111376
+ this._inputElem.value = this._lastValidValue === undefined ? "" : this._lastValidValue;
111377
+ }
111378
+ this.value = this._inputElem.value;
111379
+ }
111380
+ handleSlotChange(ev) {
111381
+ const slot = ev.target;
111382
+ const content = slot.assignedElements()[0];
111383
+ if (content) {
111384
+ content.style.position = "absolute";
111385
+ content.style.display = "flex";
111386
+ content.style.alignItems = "center";
111387
+ content.style.justifyContent = "center";
111388
+ content.style.overflow = "hidden";
111389
+ content.style.top = "0px";
111390
+ content.style.width = "var(--ez-text-input__icon--width)";
111391
+ content.style.height = "var(--ez-text-input--height)";
111392
+ if (slot.name == "leftIcon") {
111393
+ content.style.left = "0px";
111394
+ content.style.borderRadius = "var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)";
111395
+ this._inputElem.classList.add("icon--left");
111396
+ if (this._labelElem) {
111397
+ this._labelElem.classList.add("input__label--left");
111398
+ }
111399
+ }
111400
+ else if (slot.name == "rightIcon") {
111401
+ content.style.right = "0px";
111402
+ content.style.borderRadius = "0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0";
111403
+ this._inputElem.classList.add("icon--right");
111404
+ if (this._labelElem) {
111405
+ this._labelElem.classList.add("input__label--right");
111406
+ }
111407
+ }
111408
+ }
111409
+ this.showError();
111410
+ }
111411
+ doFocus() {
111412
+ if (this.label && this._labelElem && !this._labelElem.classList.contains("input__label--floated")) {
111413
+ this._labelElem.classList.add("input__label--floated");
111414
+ }
111415
+ }
111416
+ //---------------------------------------------
111417
+ // Lifecycle web component
111418
+ //---------------------------------------------
111419
+ componentDidLoad() {
111420
+ this.showError();
111421
+ this.prepareMask();
111422
+ this.adjustFloatingLabel();
111423
+ }
111424
+ componentWillLoad() {
111425
+ this.prepareMask();
111426
+ if (this.value) {
111427
+ if (this._maskFormatter) {
111428
+ try {
111429
+ this.value = this._maskFormatter.format(this.value);
111430
+ }
111431
+ catch (e) {
111432
+ this.errorMessage = e.message;
111433
+ }
111434
+ }
111435
+ if (!this.isValidValue(this.value)) {
111436
+ this._lastValidValue = "";
111437
+ this.value = "";
111438
+ }
111439
+ }
111440
+ }
111441
+ render() {
111442
+ return (index.h(index.Host, null, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label ?
111443
+ index.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)
111444
+ : null, index.h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), index.h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
111445
+ }
111446
+ get _hostElement() { return index.getElement(this); }
111447
+ static get watchers() { return {
111448
+ "errorMessage": ["showError"],
111449
+ "mask": ["prepareMask"],
111450
+ "value": ["updateInputValue"]
111451
+ }; }
111452
+ };
111453
+ EzTextInput.style = ezTextInputCss;
111454
+
111455
+ 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)}";
111456
+
111457
+ let GridConfig = class {
111458
+ constructor(hostRef) {
111459
+ index.registerInstance(this, hostRef);
111460
+ this.configFinish = index.createEvent(this, "configFinish", 7);
111461
+ this.configCancel = index.createEvent(this, "configCancel", 7);
111462
+ this._columnListHistory = [];
111463
+ this._orderListItems = [];
111464
+ this._columListItems = [];
111465
+ this.selectedTab = "Colunas";
111466
+ this._selectedIndex = -1;
111467
+ }
111468
+ /* Creation Methods */
111469
+ createOrderList() {
111470
+ var _a;
111471
+ let newList = [];
111472
+ if (((_a = this._columnListHistory) === null || _a === void 0 ? void 0 : _a.length) > 0) {
111473
+ this._columnListHistory.find(group => group.group === "Visíveis").items.forEach(column => {
111474
+ let item = { label: column.label };
111475
+ newList.push(item);
111476
+ });
111477
+ }
111478
+ else {
111479
+ this.columns.forEach(column => {
111480
+ let item = { name: column.name, label: column.label };
111481
+ if (!column.hidden) {
111482
+ newList.push(item);
111483
+ }
111484
+ });
111485
+ }
111486
+ this._orderListItems = newList;
111487
+ }
111488
+ createColumnList() {
111489
+ let visibleGroup = {
111490
+ group: 'Visíveis',
111491
+ items: [],
111492
+ };
111493
+ let hiddenGroup = {
111494
+ group: 'Ocultas',
111495
+ items: [],
111496
+ sort: 'ASC'
111497
+ };
111498
+ this.columns.forEach(column => {
111499
+ let item = { label: column.label };
111500
+ if (column.hidden) {
111501
+ hiddenGroup.items.push(item);
111502
+ }
111503
+ else {
111504
+ visibleGroup.items.push(item);
111505
+ }
111506
+ });
111507
+ if (this._columnListHistory.length <= 0) {
111508
+ this._columListItems = [visibleGroup, hiddenGroup];
111509
+ }
111510
+ }
111511
+ buildColumnListSlot(item, group) {
111512
+ return (index.h("div", null, index.h("ez-check", { mode: 'switch', id: 'switch' + item + group, value: group.group === "Visíveis", onEzChange: (ev) => { this.switchColumnGroup(ev, item); } })));
111513
+ }
111514
+ buildOrderListSlot(item) {
111515
+ let existingItem = this.columns.find(columnItem => columnItem.label === item.label);
111516
+ return (index.h("div", null, index.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); } })));
111517
+ }
111518
+ updateOrder(sortOrder, updatedItem) {
111519
+ let newList = [...this.columns];
111520
+ let newItem = newList.find(item => item.label === updatedItem.label);
111521
+ if (newItem) {
111522
+ newItem.sort = sortOrder;
111523
+ }
111524
+ this.columns = newList;
111525
+ }
111526
+ /* Actions Methods */
111527
+ switchColumnGroup(ev, switchedItem) {
111528
+ ev.stopPropagation();
111529
+ let newList = [...this._columListItems];
111530
+ if (ev.detail === true) {
111531
+ let hiddenGroup = newList.find(group => group.group === "Ocultas");
111532
+ let index = hiddenGroup.items.findIndex(item => item.label === switchedItem.label);
111533
+ if (index >= 0) {
111534
+ hiddenGroup.items.splice(index, 1);
111535
+ }
111536
+ let visibleGroup = newList.find(group => group.group === "Visíveis");
111537
+ visibleGroup.items.push(switchedItem);
111538
+ this._columListItems = newList;
111539
+ this.createOrderList();
111540
+ }
111541
+ else if (ev.detail === false) {
111542
+ let visibleGroup = newList.find(group => group.group === "Visíveis");
111543
+ let index = visibleGroup.items.findIndex(item => item.label === switchedItem.label);
111544
+ if (index >= 0) {
111545
+ visibleGroup.items.splice(index, 1);
111546
+ }
111547
+ let hiddenGroup = newList.find(group => group.group === "Ocultas");
111548
+ hiddenGroup.items.push(switchedItem);
111549
+ this._columListItems = newList;
111550
+ this.createOrderList();
111551
+ }
111552
+ }
111553
+ finish() {
111554
+ let newColumnList = [];
111555
+ this._columListItems.forEach(group => {
111556
+ group.items.forEach(item => {
111557
+ const baseColumn = this.columns.find(column => column.label === item.label);
111558
+ let newColumnItem = Object.assign({}, baseColumn);
111559
+ if (group.group === "Ocultas") {
111560
+ newColumnItem.hidden = true;
111561
+ }
111562
+ else {
111563
+ newColumnItem.hidden = false;
111564
+ }
111565
+ newColumnList.push(newColumnItem);
111566
+ });
111567
+ });
111568
+ this._columnListHistory = [];
111569
+ this.columns = newColumnList;
111570
+ this.configFinish.emit(this.columns);
111571
+ }
111572
+ async locateColumn(evt, searchingText) {
111573
+ var _a;
111574
+ const hitEnter = evt.key === "Enter";
111575
+ if (!searchingText) {
111576
+ searchingText = (_a = evt.currentTarget) === null || _a === void 0 ? void 0 : _a.value;
111577
+ }
111578
+ let newSelected = -1;
111579
+ if (this.selectedTab === "Ordenação") {
111580
+ if (searchingText) {
111581
+ const matchedIndexes = [];
111582
+ let orderListDatasource;
111583
+ await this._orderList.getList().then(listGroup => {
111584
+ orderListDatasource = listGroup;
111585
+ orderListDatasource.forEach((column, index) => {
111586
+ if (this.compareWords(column, searchingText)) {
111587
+ matchedIndexes.push(index);
111588
+ }
111589
+ });
111590
+ });
111591
+ if (matchedIndexes.length > 0) {
111592
+ if (hitEnter) {
111593
+ for (let j = 0; j < matchedIndexes.length; j++) {
111594
+ if (matchedIndexes[j] > this._selectedIndex) {
111595
+ newSelected = matchedIndexes[j];
111596
+ break;
111597
+ }
111598
+ }
111599
+ }
111600
+ if (newSelected === -1) {
111601
+ newSelected = matchedIndexes[0];
111602
+ }
111603
+ }
111604
+ this._selectedIndex = newSelected;
111605
+ let selectedColumn;
111606
+ selectedColumn = orderListDatasource[newSelected];
111607
+ if (selectedColumn) {
111608
+ this._orderList.setSelection({ label: selectedColumn.label }, true);
111609
+ }
111610
+ else {
111611
+ this._orderList.setSelection(undefined);
111612
+ }
111613
+ }
111614
+ else {
111615
+ this._orderList.setSelection(undefined);
111616
+ }
111617
+ }
111618
+ else {
111619
+ if (searchingText) {
111620
+ const matchedIndexes = [];
111621
+ this.columns.forEach((column, index) => {
111622
+ if (this.compareWords(column, searchingText)) {
111623
+ matchedIndexes.push(index);
111624
+ }
111625
+ });
111626
+ if (matchedIndexes.length > 0) {
111627
+ if (hitEnter) {
111628
+ for (let j = 0; j < matchedIndexes.length; j++) {
111629
+ if (matchedIndexes[j] > this._selectedIndex) {
111630
+ newSelected = matchedIndexes[j];
111631
+ break;
111632
+ }
111633
+ }
111634
+ }
111635
+ if (newSelected === -1) {
111636
+ newSelected = matchedIndexes[0];
111637
+ }
111638
+ }
111639
+ this._selectedIndex = newSelected;
111640
+ let selectedColumn = this.columns[newSelected];
111641
+ if (selectedColumn) {
111642
+ this._columnList.setSelection({ label: selectedColumn.label }, true);
111643
+ }
111644
+ else {
111645
+ this._columnList.setSelection(undefined);
111646
+ }
111647
+ }
111648
+ else {
111649
+ this._columnList.setSelection(undefined);
111650
+ }
111651
+ }
111652
+ }
111653
+ compareWords(column, searchingText) {
111654
+ if (StringUtils.replaceAccentuatedChars(column.label).indexOf(StringUtils.replaceAccentuatedChars(searchingText)) > -1) {
111655
+ return true;
111656
+ }
111657
+ return false;
111658
+ }
111659
+ closeConfig() {
111660
+ this._columnListHistory = [];
111661
+ this.configCancel.emit();
111662
+ }
111663
+ /* Handlers */
111664
+ handleTabChange(ev) {
111665
+ var _a;
111666
+ if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.selectedTab) {
111667
+ if (ev.target.selectedTab === "Ordenação") {
111668
+ this._columnListHistory = this._columnList.dataSource;
111669
+ this.createOrderList();
111670
+ }
111671
+ this.selectedTab = ev.target.selectedTab;
111672
+ }
111673
+ }
111674
+ handleColumnListChange(ev) {
111675
+ var _a;
111676
+ if (ev.detail) {
111677
+ let visibleItems = (_a = ev.detail.find(group => group.group === "Visíveis")) === null || _a === void 0 ? void 0 : _a.items;
111678
+ if (visibleItems) {
111679
+ this._orderListItems = visibleItems;
111680
+ }
111681
+ }
111682
+ }
111683
+ componentWillRender() {
111684
+ var _a;
111685
+ if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
111686
+ this.createColumnList();
111687
+ this.createOrderList();
111688
+ }
111689
+ }
111690
+ componentDidRender() {
111691
+ var _a;
111692
+ if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
111693
+ this.locateColumn(new KeyboardEvent("arrow-right", { key: "ArrowRight" }), this._searchElement.value);
111694
+ }
111695
+ }
111696
+ render() {
111697
+ return (index.h(index.Host, null, index.h("div", { class: "grid-config__header" }, index.h("div", { class: "title-container" }, index.h("div", { class: "" }, index.h("label", { class: "title" }, "Configura\u00E7\u00E3o da Grade"), index.h("label", { class: "subtitle" }, "Defina visibilidade e ordem das colunas.")), index.h("div", { class: "button-close" }, index.h("ez-button", { mode: 'icon', image: AssetsUtils.getSpritePath("close"), size: 'medium', onClick: () => this.closeConfig() }))), index.h("div", { class: "tabselector-container" }, index.h("ez-tabselector", { selectedTab: this.selectedTab, selectedIndex: '0', onEzChange: (ev) => { this.handleTabChange(ev); }, tabs: 'Colunas, Ordena\u00E7\u00E3o' })), index.h("div", null, index.h("ez-text-input", { ref: (el) => this._searchElement = el, label: "Localizar coluna", onKeyUp: evt => this.locateColumn(evt) }, index.h("ez-icon", { slot: "leftIcon", size: "medium", href: AssetsUtils.getSpritePath("search") })))), index.h("div", { class: "grid-config__main" }, index.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 }), index.h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedTab === "Ordenação" ? "" : "hidden", dataSource: this._orderListItems, ezSelectable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item) })), index.h("div", { class: "grid-config__footer" }, index.h("ez-button", { class: "padding-right--medium", label: "Cancelar", onClick: () => this.closeConfig() }), index.h("ez-button", { label: "Concluir", class: "button--primary", onClick: () => this.finish() }))));
111698
+ }
111699
+ static get assetsDirs() { return ["../assets"]; }
111700
+ };
111701
+ GridConfig.style = gridConfigCss;
111702
+
111703
+ const selectBoxCss = "select{border:1px solid #DCE0E8;font-family:'Sora';border-radius:3px;outline:none;cursor:pointer}";
111704
+
111705
+ let SelectBox = class {
111706
+ constructor(hostRef) {
111707
+ index.registerInstance(this, hostRef);
111708
+ this.ezChange = index.createEvent(this, "ezChange", 7);
111709
+ }
111710
+ changeSelection() {
111711
+ this.ezChange.emit(this._selectElem.value);
111712
+ }
111713
+ componentDidRender() {
111714
+ if (this._selectElem) {
111715
+ if (this.selectedOption) {
111716
+ this._selectElem.value = this.selectedOption;
111717
+ }
111718
+ else {
111719
+ this._selectElem.value = "na";
111720
+ }
111721
+ }
111722
+ }
111723
+ render() {
111724
+ return (index.h("select", { ref: (el) => this._selectElem = el, onChange: () => { this.changeSelection(); } }, index.h("option", { value: "na" }, "N/A"), index.h("option", { value: "asc" }, "A-Z"), index.h("option", { value: "desc" }, "Z-A")));
111725
+ }
111726
+ static get assetsDirs() { return ["../assets"]; }
111727
+ };
111728
+ SelectBox.style = selectBoxCss;
111729
+
111730
+ const testDuCss = ":host{display:block}";
111731
+
111732
+ let TestDu = class {
111733
+ constructor(hostRef) {
111734
+ index.registerInstance(this, hostRef);
111735
+ }
111736
+ componentWillLoad() {
111737
+ this.dataUnit = new index$1.DataUnit("testes_com_formulario");
111738
+ this.dataUnit.metadata = {
111739
+ name: "dd://br.com.sankhya.fin.cad.movimentacaoFinanceira/Financeiro",
111740
+ label: "Parceiro",
111741
+ fields: [
111742
+ {
111743
+ name: "CODPARC",
111744
+ label: "Parceiro",
111745
+ dataType: index$1.DataType.NUMBER,
111746
+ userInterface: index$1.UserInterface.SEARCH,
111747
+ required: true,
111748
+ properties: {}
111749
+ },
111750
+ {
111751
+ name: "RECDESP",
111752
+ label: "Receita/Despesa",
111753
+ dataType: index$1.DataType.TEXT,
111754
+ userInterface: index$1.UserInterface.OPTIONSELECTOR,
111755
+ required: true,
111756
+ properties: { options: `{"-1": "Despesa", "1": "Receita"}` }
111757
+ },
111758
+ {
111759
+ name: "P",
111760
+ label: "pera",
111761
+ dataType: index$1.DataType.TEXT,
111762
+ userInterface: index$1.UserInterface.OPTIONSELECTOR,
111763
+ properties: { options: `{"M": "Madura", "V": "Verde", "P": "Passada"}` }
111764
+ },
111765
+ {
111766
+ name: "ME",
111767
+ label: "ME",
111768
+ dataType: index$1.DataType.NUMBER,
111769
+ userInterface: index$1.UserInterface.DECIMALNUMBER,
111770
+ properties: { precision: 4, prettyPrecision: 1 }
111771
+ }
111772
+ ]
111773
+ };
111774
+ this.dataUnit.dataLoader = () => new Promise(accept => accept([
111775
+ {
111776
+ __record__id__: "1321321321321321",
111777
+ CODPARC: 10,
111778
+ NOMEPARC: "Parceiro 10",
111779
+ P: "M",
111780
+ L: "Bagaço",
111781
+ LI: "Azedo"
111782
+ }
111783
+ ]));
111784
+ }
111785
+ render() {
111786
+ return (index.h("ez-grid", { dataUnit: this.dataUnit }));
111787
+ }
111788
+ };
111789
+ TestDu.style = testDuCss;
111790
+
111791
+ exports.ez_button = EzButton;
111792
+ exports.ez_check = EzCheck;
110375
111793
  exports.ez_grid = EzGrid;
111794
+ exports.ez_icon = EzIcon;
111795
+ exports.ez_list = EzList;
111796
+ exports.ez_modal = EzModal;
111797
+ exports.ez_tabselector = EzTabselector;
111798
+ exports.ez_text_input = EzTextInput;
111799
+ exports.grid_config = GridConfig;
111800
+ exports.select_box = SelectBox;
111801
+ exports.test_du = TestDu;