@sankhyalabs/ezui 1.1.80 → 1.1.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/cjs/ApplicationUtils-d1c1db56.js +35 -0
  2. package/dist/cjs/{AssetsUtils-02db4f46.js → AssetsUtils-caf95dab.js} +1 -1
  3. package/dist/cjs/ez-action-chip.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-application.cjs.entry.js +1 -1
  5. package/dist/cjs/{ez-grid.cjs.entry.js → ez-button_11.cjs.entry.js} +1448 -22
  6. package/dist/cjs/ez-calendar.cjs.entry.js +217 -0
  7. package/dist/cjs/ez-collapsible-box_7.cjs.entry.js +853 -0
  8. package/dist/cjs/ez-combo-box.cjs.entry.js +254 -0
  9. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-form.cjs.entry.js +722 -0
  11. package/dist/cjs/ez-label-chip.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-popover.cjs.entry.js +2 -2
  13. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-time-input.cjs.entry.js +3 -3
  15. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  16. package/dist/cjs/ezui.cjs.js +2 -2
  17. package/dist/cjs/{index-2003dec4.js → index-0bce1636.js} +3 -0
  18. package/dist/cjs/{index-a2266984.js → index-2fc1b5fa.js} +115 -72
  19. package/dist/cjs/loader.cjs.js +2 -2
  20. package/dist/collection/components/ez-form/DataBinder.js +7 -1
  21. package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +2 -1
  22. package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +4 -0
  23. package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +19 -25
  24. package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +10 -7
  25. package/dist/collection/components/ez-grid/ez-grid.css +4 -1
  26. package/dist/collection/components/ez-grid/ez-grid.js +4 -0
  27. package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +1 -1
  28. package/dist/collection/components/test-du/test-du.js +3 -27
  29. package/dist/custom-elements/index.js +150 -116
  30. package/dist/esm/ApplicationUtils-01280a9d.js +33 -0
  31. package/dist/esm/{AssetsUtils-76ca41e1.js → AssetsUtils-9b1d9c38.js} +1 -1
  32. package/dist/esm/ez-action-chip.entry.js +1 -1
  33. package/dist/esm/ez-application.entry.js +1 -1
  34. package/dist/esm/{ez-grid.entry.js → ez-button_11.entry.js} +1428 -12
  35. package/dist/esm/ez-calendar.entry.js +213 -0
  36. package/dist/esm/ez-collapsible-box_7.entry.js +843 -0
  37. package/dist/esm/ez-combo-box.entry.js +250 -0
  38. package/dist/esm/ez-dialog.entry.js +1 -1
  39. package/dist/esm/ez-form.entry.js +718 -0
  40. package/dist/esm/ez-label-chip.entry.js +1 -1
  41. package/dist/esm/ez-popover.entry.js +2 -2
  42. package/dist/esm/ez-popup.entry.js +1 -1
  43. package/dist/esm/ez-time-input.entry.js +3 -3
  44. package/dist/esm/ez-toast.entry.js +1 -1
  45. package/dist/esm/ezui.js +2 -2
  46. package/dist/esm/{index-afe19542.js → index-015d8d70.js} +116 -73
  47. package/dist/esm/{index-077c7fcf.js → index-d80a8d1f.js} +3 -0
  48. package/dist/esm/loader.js +2 -2
  49. package/dist/ezui/ezui.esm.js +1 -1
  50. package/dist/ezui/{p-5509ee41.entry.js → p-058b8138.entry.js} +46 -46
  51. package/dist/ezui/{p-7a1f2e0e.entry.js → p-07d2c50f.entry.js} +1 -1
  52. package/dist/ezui/{p-57ea4b84.entry.js → p-091b27f2.entry.js} +1 -1
  53. package/dist/ezui/{p-6d157776.entry.js → p-19d8a928.entry.js} +1 -1
  54. package/dist/ezui/{p-a4a39579.entry.js → p-39218c31.entry.js} +1 -1
  55. package/dist/ezui/{p-da31cd21.entry.js → p-6206515e.entry.js} +1 -1
  56. package/dist/ezui/p-62ee7026.entry.js +1 -0
  57. package/dist/ezui/p-7107d7ef.js +1 -0
  58. package/dist/ezui/{p-7de3c95d.js → p-7c101b34.js} +1 -1
  59. package/dist/ezui/{p-857ead8e.entry.js → p-8592635e.entry.js} +1 -1
  60. package/dist/ezui/p-93ce25bc.entry.js +1 -0
  61. package/dist/ezui/p-96c336db.js +1 -0
  62. package/dist/ezui/p-a06aa43a.entry.js +1 -0
  63. package/dist/ezui/{p-920bb8c9.entry.js → p-a52b3368.entry.js} +1 -1
  64. package/dist/ezui/{p-0a2056d9.entry.js → p-b678dc80.entry.js} +1 -1
  65. package/dist/ezui/p-ca3dac07.entry.js +1 -0
  66. package/dist/ezui/p-f87c7082.js +1 -0
  67. package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +4 -0
  68. package/dist/types/components/ez-grid/controller/DataUnitBridge.d.ts +2 -1
  69. package/dist/types/components/test-du/test-du.d.ts +0 -6
  70. package/package.json +2 -2
  71. package/react/{readme.md → .keepfolder} +0 -0
  72. package/dist/cjs/DateUtils-716769e0.js +0 -46
  73. package/dist/cjs/ez-button_3.cjs.entry.js +0 -520
  74. package/dist/cjs/ez-calendar_13.cjs.entry.js +0 -2421
  75. package/dist/cjs/ez-date-time-input.cjs.entry.js +0 -133
  76. package/dist/cjs/ez-icon.cjs.entry.js +0 -30
  77. package/dist/cjs/ez-modal_2.cjs.entry.js +0 -370
  78. package/dist/esm/DateUtils-0a1bbd7a.js +0 -44
  79. package/dist/esm/ez-button_3.entry.js +0 -514
  80. package/dist/esm/ez-calendar_13.entry.js +0 -2405
  81. package/dist/esm/ez-date-time-input.entry.js +0 -129
  82. package/dist/esm/ez-icon.entry.js +0 -26
  83. package/dist/esm/ez-modal_2.entry.js +0 -365
  84. package/dist/ezui/p-00b837e2.js +0 -1
  85. package/dist/ezui/p-0d8368fc.entry.js +0 -1
  86. package/dist/ezui/p-1e36e3ff.entry.js +0 -1
  87. package/dist/ezui/p-446ec85b.js +0 -1
  88. package/dist/ezui/p-49f3432a.entry.js +0 -1
  89. package/dist/ezui/p-c89629eb.js +0 -1
  90. package/dist/ezui/p-d5699f29.entry.js +0 -1
  91. package/dist/ezui/p-d64a3939.entry.js +0 -1
@@ -1,129 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-077c7fcf.js';
2
- import { T as TimeFormatter } from './index-afe19542.js';
3
- import { D as DateUtils } from './DateUtils-0a1bbd7a.js';
4
- import { C as CSSVarsUtils } from './CSSVarsUtils-aeee9825.js';
5
-
6
- const ezDateTimeInputCss = ":host{display:block;width:100%;--ez-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-date-input__input--border-color:var(--ez-date-input__input--background-color);--ez-date-input__calendar-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"15px\"><path d=\"M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z\"/></svg>')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:unset}.btn-open-cal::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-date-input__calendar-image);mask-image:var(--ez-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-text-input{--text-input__input--background-color:var(--ez-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-date-input__input--border-color, #DCE0E8)}";
7
-
8
- let EzDateTimeInput = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.ezChange = createEvent(this, "ezChange", 7);
12
- /**
13
- * Deixa o campo disponível ou não para uso.
14
- */
15
- this.enabled = true;
16
- /**
17
- * Exibe ou não os segundos no input
18
- */
19
- this.showSeconds = false;
20
- }
21
- setLabel() {
22
- this._textInput.label = this.label;
23
- }
24
- setErrorMessage() {
25
- this._textInput.errorMessage = this.errorMessage;
26
- }
27
- applyValueToInput() {
28
- if (this._textInput) {
29
- this._textInput.value = this.getTextValue(this.value);
30
- }
31
- }
32
- onChangeKeyDown(ev) {
33
- const input = this._textInput.shadowRoot.querySelector('input');
34
- if (ev.key === "H" || ev.key === "h") {
35
- this.changeValue(new Date());
36
- }
37
- else if (ev.shiftKey && ev.key === "Tab") {
38
- if (input.selectionStart > 0) {
39
- let selectIni = input.value.lastIndexOf(" ", input.selectionStart);
40
- if (selectIni !== -1) {
41
- input.setSelectionRange(0, selectIni);
42
- ev.preventDefault();
43
- }
44
- }
45
- }
46
- else if (ev.key === "Tab") {
47
- if (input.value.length !== input.selectionEnd) {
48
- let selectIni = input.value.indexOf(" ", input.selectionEnd);
49
- selectIni = selectIni === -1 ? input.selectionEnd : selectIni + 1;
50
- input.setSelectionRange(selectIni, input.value.length);
51
- ev.preventDefault();
52
- }
53
- }
54
- }
55
- onFocused() {
56
- const input = this._textInput.shadowRoot.querySelector('input');
57
- if (input.selectionStart !== input.selectionEnd) {
58
- let selectIni = input.value.indexOf(" ", input.selectionStart);
59
- selectIni = selectIni === -1 ? input.value.length : selectIni;
60
- input.setSelectionRange(0, selectIni);
61
- }
62
- }
63
- onClicked() {
64
- const input = this._textInput.shadowRoot.querySelector('input');
65
- let selectIni = input.value.lastIndexOf(" ", input.selectionEnd);
66
- selectIni = selectIni === -1 ? 0 : selectIni + 1;
67
- selectIni = selectIni > input.selectionEnd ? 0 : selectIni;
68
- let selectFin = selectIni === 0 ? input.value.indexOf(" ") : input.value.length;
69
- input.setSelectionRange(selectIni, selectFin);
70
- }
71
- changeValue(newValue) {
72
- this._textInput.errorMessage = "";
73
- if (newValue !== this.value) {
74
- this.value = newValue;
75
- this.ezChange.emit();
76
- }
77
- }
78
- showCalendar() {
79
- const top = this._textInput.errorMessage ? 0 : -17;
80
- this._calendar.fitVertical(top, this._elem.clientHeight);
81
- this._calendar.style.visibility = 'inherit';
82
- }
83
- parseDate() {
84
- const strValue = this._textInput.value;
85
- const partsDateTime = (strValue && strValue.length > 0) ? strValue.split(" ") : [];
86
- const onlyDate = partsDateTime.length > 0 ? partsDateTime[0] : strValue;
87
- const onlyTime = partsDateTime[1] ? partsDateTime[1] : "";
88
- const parsedTime = TimeFormatter.prepareValue(onlyTime, this.showSeconds);
89
- const strDateTime = onlyDate + (parsedTime && " " + parsedTime);
90
- const parsedDate = DateUtils.strToDate(strDateTime);
91
- if (parsedDate || !strValue) {
92
- if (this.value === parsedDate) {
93
- this.changeValue(this.value);
94
- }
95
- else {
96
- this.changeValue(parsedDate);
97
- }
98
- }
99
- else {
100
- this._textInput.errorMessage = "O valor digitado não é uma data válida";
101
- }
102
- }
103
- getTextValue(d) {
104
- const options = {
105
- year: 'numeric', month: 'numeric', day: 'numeric',
106
- hour: 'numeric', minute: 'numeric'
107
- };
108
- const optionsSecond = {
109
- year: 'numeric', month: 'numeric', day: 'numeric',
110
- hour: 'numeric', minute: 'numeric', second: 'numeric'
111
- };
112
- return d ? (new Intl.DateTimeFormat('pt-BR', this.showSeconds ? optionsSecond : options).format(d)) : null;
113
- }
114
- componentDidLoad() {
115
- CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
116
- }
117
- render() {
118
- return (h(Host, null, h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => { this.onChangeKeyDown(event); }, label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, onFocus: () => this.onFocused(), onClick: () => this.onClicked() }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), h("ez-calendar", { onEzChange: (event) => { this.changeValue(this._calendar.value); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem, time: true, showSeconds: this.showSeconds })));
119
- }
120
- get _elem() { return getElement(this); }
121
- static get watchers() { return {
122
- "label": ["setLabel"],
123
- "errorMessage": ["setErrorMessage"],
124
- "value": ["applyValueToInput"]
125
- }; }
126
- };
127
- EzDateTimeInput.style = ezDateTimeInputCss;
128
-
129
- export { EzDateTimeInput as ez_date_time_input };
@@ -1,26 +0,0 @@
1
- import { r as registerInstance, h, H as Host } from './index-077c7fcf.js';
2
-
3
- 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}";
4
-
5
- let EzIcon = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- /**
9
- * Tamanho do ícone
10
- */
11
- this.size = 'medium';
12
- }
13
- isSprite() {
14
- return this.href && this.href.indexOf('#') > -1;
15
- }
16
- render() {
17
- return (h(Host, null, this.isSprite()
18
- ?
19
- h("svg", { class: this.size, role: "img" }, h("use", { xlinkHref: this.href }))
20
- :
21
- h("img", { class: this.size, src: this.href })));
22
- }
23
- };
24
- EzIcon.style = ezIconCss;
25
-
26
- export { EzIcon as ez_icon };
@@ -1,365 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-077c7fcf.js';
2
- import { g as getSpritePath } from './AssetsUtils-76ca41e1.js';
3
- import './index-afe19542.js';
4
-
5
- /**
6
- * Classe com utiliários comuns para Strings.
7
- */
8
- class StringUtils {
9
- /**
10
- * Verifica se a string está vazia.
11
- * Valores null e undefined são considerados como vazio.
12
- *
13
- * @param value String para ser validada.
14
- */
15
- static isEmpty(value) {
16
- if (value == undefined || value === null) {
17
- return true;
18
- }
19
- value = value.toString();
20
- value = value.trim();
21
- if (value.length === 0) {
22
- return true;
23
- }
24
- return false;
25
- }
26
- /**
27
- * Remove acentos de vogais, substitui Ç por c e retorna a string em caixa alta.
28
- *
29
- * @param value String para ser transformada.
30
- */
31
- static replaceAccentuatedChars(text) {
32
- text = text.toUpperCase();
33
- text = text.replace(/[À]/, "A");
34
- text = text.replace(/[Á]/, "A");
35
- text = text.replace(/[Â]/, "A");
36
- text = text.replace(/[Ã]/, "A");
37
- text = text.replace(/[Ä]/, "A");
38
- text = text.replace(/[È]/, "E");
39
- text = text.replace(/[É]/, "E");
40
- text = text.replace(/[Ê]/, "E");
41
- text = text.replace(/[Ë]/, "E");
42
- text = text.replace(/[Ì]/, "I");
43
- text = text.replace(/[Í]/, "I");
44
- text = text.replace(/[Î]/, "I");
45
- text = text.replace(/[Ï]/, "I");
46
- text = text.replace(/[Ò]/, "O");
47
- text = text.replace(/[Ó]/, "O");
48
- text = text.replace(/[Ô]/, "O");
49
- text = text.replace(/[Ö]/, "O");
50
- text = text.replace(/[Ù]/, "U");
51
- text = text.replace(/[Ú]/, "U");
52
- text = text.replace(/[Û]/, "U");
53
- text = text.replace(/[Ü]/, "U");
54
- text = text.replace(/[Ç]/, "C");
55
- return text.replace(/[^a-z0-9]/gi, '');
56
- }
57
- }
58
-
59
- 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%}}";
60
-
61
- let EzModal = class {
62
- constructor(hostRef) {
63
- registerInstance(this, hostRef);
64
- this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
65
- /**
66
- * Controle de exibição do Modal
67
- */
68
- this.opened = true;
69
- /**
70
- * Define se o modal será fechado ao clicar ESC
71
- */
72
- this.closeEsc = false;
73
- /**
74
- * Define se o modal será fechado ao clicar fora do conteúdo.
75
- */
76
- this.closeOutsideClick = false;
77
- this.handleKeyboardEvent = (ev) => {
78
- if ((ev === null || ev === void 0 ? void 0 : ev.key) === "Escape" && this.closeEsc) {
79
- this.closeModal();
80
- }
81
- };
82
- }
83
- handleopenedChange() {
84
- if (this.opened) {
85
- document.addEventListener("keydown", this.handleKeyboardEvent);
86
- }
87
- else {
88
- document.removeEventListener("keydown", this.handleKeyboardEvent);
89
- }
90
- }
91
- closeModal() {
92
- this.opened = false;
93
- this.ezCloseModal.emit(this.opened);
94
- }
95
- componentDidLoad() {
96
- this.handleopenedChange();
97
- }
98
- onMouseDownHandler(event) {
99
- if (this.closeOutsideClick && event.target === this._overlay) {
100
- this.closeModal();
101
- }
102
- }
103
- render() {
104
- const positionSufix = this.align === "left" ? "left" : "right";
105
- return (h(Host, null, this.opened
106
- ?
107
- h("div", { class: "modal", onMouseDown: evt => this.onMouseDownHandler(evt) }, h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, h("div", { class: `modal__content modal__content--${positionSufix} ${this.modalSize}` }, h("slot", null))))
108
- :
109
- undefined));
110
- }
111
- static get watchers() { return {
112
- "opened": ["handleopenedChange"]
113
- }; }
114
- };
115
- EzModal.style = ezModalCss;
116
-
117
- const gridConfigCss = ":host{--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{padding-right:var(--space--medium)}ez-list{height:100%}.grid-config__footer{padding-top:var(--ez-grid-config__footer--padding-top);display:flex;justify-content:flex-end;width:100%}.hidden{display:none}.grid-config__main{padding-right:var(--ez-grid-config__main--padding-right);overflow-y:auto}.tabselector-container{padding:var(--ez-grid-config__tabselector-container--padding) 0}.button-close{padding-left:var(--ez-grid-config__button-close--padding-left)}.title-container{display:flex;justify-content:center;align-items:center}.subtitle{font-family:var(--ez-grid-config__subtitle--font-family);font-size:var(--ez-grid-config__subtitle--font-size)}.title{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::-webkit-scrollbar-track{background-color:#f0f2f5}.grid-config__main::-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::-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)}";
118
-
119
- let GridConfig = class {
120
- constructor(hostRef) {
121
- registerInstance(this, hostRef);
122
- this.configFinish = createEvent(this, "configFinish", 7);
123
- this.configCancel = createEvent(this, "configCancel", 7);
124
- this._columnListHistory = [];
125
- this._orderListItems = [];
126
- this._columListItems = [];
127
- this.selectedTab = "Colunas";
128
- this._selectedIndex = -1;
129
- }
130
- /* Creation Methods */
131
- createOrderList() {
132
- var _a;
133
- let newList = [];
134
- if (((_a = this._columnListHistory) === null || _a === void 0 ? void 0 : _a.length) > 0) {
135
- this._columnListHistory.find(group => group.group === "Visíveis").items.forEach(column => {
136
- let item = { label: column.label };
137
- newList.push(item);
138
- });
139
- }
140
- else {
141
- this.columns.forEach(column => {
142
- let item = { name: column.name, label: column.label };
143
- if (!column.hidden) {
144
- newList.push(item);
145
- }
146
- });
147
- }
148
- this._orderListItems = newList;
149
- }
150
- createColumnList() {
151
- let visibleGroup = {
152
- group: 'Visíveis',
153
- items: [],
154
- };
155
- let hiddenGroup = {
156
- group: 'Ocultas',
157
- items: [],
158
- sort: 'ASC'
159
- };
160
- this.columns.forEach(column => {
161
- let item = { label: column.label };
162
- if (column.hidden) {
163
- hiddenGroup.items.push(item);
164
- }
165
- else {
166
- visibleGroup.items.push(item);
167
- }
168
- });
169
- if (this._columnListHistory.length <= 0) {
170
- this._columListItems = [visibleGroup, hiddenGroup];
171
- }
172
- }
173
- buildColumnListSlot(item, group) {
174
- return (h("div", null, h("ez-check", { mode: 'switch', id: 'switch' + item + group, value: group.group === "Visíveis", onEzChange: (ev) => { this.switchColumnGroup(ev, item); } })));
175
- }
176
- buildOrderListSlot(item) {
177
- let existingItem = this.columns.find(columnItem => columnItem.label === item.label);
178
- return (h("div", null, h("select-box", { selectedOption: existingItem === null || existingItem === void 0 ? void 0 : existingItem.sort, key: 'select-box' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item); } })));
179
- }
180
- updateOrder(sortOrder, updatedItem) {
181
- let newList = [...this.columns];
182
- let newItem = newList.find(item => item.label === updatedItem.label);
183
- if (newItem) {
184
- newItem.sort = sortOrder;
185
- }
186
- this.columns = newList;
187
- }
188
- /* Actions Methods */
189
- switchColumnGroup(ev, switchedItem) {
190
- ev.stopPropagation();
191
- let newList = [...this._columListItems];
192
- if (ev.detail === true) {
193
- let hiddenGroup = newList.find(group => group.group === "Ocultas");
194
- let index = hiddenGroup.items.findIndex(item => item.label === switchedItem.label);
195
- if (index >= 0) {
196
- hiddenGroup.items.splice(index, 1);
197
- }
198
- let visibleGroup = newList.find(group => group.group === "Visíveis");
199
- visibleGroup.items.push(switchedItem);
200
- this._columListItems = newList;
201
- this.createOrderList();
202
- }
203
- else if (ev.detail === false) {
204
- let visibleGroup = newList.find(group => group.group === "Visíveis");
205
- let index = visibleGroup.items.findIndex(item => item.label === switchedItem.label);
206
- if (index >= 0) {
207
- visibleGroup.items.splice(index, 1);
208
- }
209
- let hiddenGroup = newList.find(group => group.group === "Ocultas");
210
- hiddenGroup.items.push(switchedItem);
211
- this._columListItems = newList;
212
- this.createOrderList();
213
- }
214
- }
215
- finish() {
216
- let newColumnList = [];
217
- this._columListItems.forEach(group => {
218
- group.items.forEach(item => {
219
- const baseColumn = this.columns.find(column => column.label === item.label);
220
- let newColumnItem = Object.assign({}, baseColumn);
221
- if (group.group === "Ocultas") {
222
- newColumnItem.hidden = true;
223
- }
224
- else {
225
- newColumnItem.hidden = false;
226
- }
227
- newColumnList.push(newColumnItem);
228
- });
229
- });
230
- this._columnListHistory = [];
231
- this.columns = newColumnList;
232
- this.configFinish.emit(this.columns);
233
- }
234
- async locateColumn(evt, searchingText) {
235
- var _a;
236
- const hitEnter = evt.key === "Enter";
237
- if (!searchingText) {
238
- searchingText = (_a = evt.currentTarget) === null || _a === void 0 ? void 0 : _a.value;
239
- }
240
- let newSelected = -1;
241
- if (this.selectedTab === "Ordenação") {
242
- if (searchingText) {
243
- const matchedIndexes = [];
244
- let orderListDatasource;
245
- await this._orderList.getList().then(listGroup => {
246
- orderListDatasource = listGroup;
247
- orderListDatasource.forEach((column, index) => {
248
- if (this.compareWords(column, searchingText)) {
249
- matchedIndexes.push(index);
250
- }
251
- });
252
- });
253
- if (matchedIndexes.length > 0) {
254
- if (hitEnter) {
255
- for (let j = 0; j < matchedIndexes.length; j++) {
256
- if (matchedIndexes[j] > this._selectedIndex) {
257
- newSelected = matchedIndexes[j];
258
- break;
259
- }
260
- }
261
- }
262
- if (newSelected === -1) {
263
- newSelected = matchedIndexes[0];
264
- }
265
- }
266
- this._selectedIndex = newSelected;
267
- let selectedColumn;
268
- selectedColumn = orderListDatasource[newSelected];
269
- if (selectedColumn) {
270
- this._orderList.setSelection({ label: selectedColumn.label }, true);
271
- }
272
- else {
273
- this._orderList.setSelection(undefined);
274
- }
275
- }
276
- else {
277
- this._orderList.setSelection(undefined);
278
- }
279
- }
280
- else {
281
- if (searchingText) {
282
- const matchedIndexes = [];
283
- this.columns.forEach((column, index) => {
284
- if (this.compareWords(column, searchingText)) {
285
- matchedIndexes.push(index);
286
- }
287
- });
288
- if (matchedIndexes.length > 0) {
289
- if (hitEnter) {
290
- for (let j = 0; j < matchedIndexes.length; j++) {
291
- if (matchedIndexes[j] > this._selectedIndex) {
292
- newSelected = matchedIndexes[j];
293
- break;
294
- }
295
- }
296
- }
297
- if (newSelected === -1) {
298
- newSelected = matchedIndexes[0];
299
- }
300
- }
301
- this._selectedIndex = newSelected;
302
- let selectedColumn = this.columns[newSelected];
303
- if (selectedColumn) {
304
- this._columnList.setSelection({ label: selectedColumn.label }, true);
305
- }
306
- else {
307
- this._columnList.setSelection(undefined);
308
- }
309
- }
310
- else {
311
- this._columnList.setSelection(undefined);
312
- }
313
- }
314
- }
315
- compareWords(column, searchingText) {
316
- if (StringUtils.replaceAccentuatedChars(column.label).indexOf(StringUtils.replaceAccentuatedChars(searchingText)) > -1) {
317
- return true;
318
- }
319
- return false;
320
- }
321
- closeConfig() {
322
- this._columnListHistory = [];
323
- this.configCancel.emit();
324
- }
325
- /* Handlers */
326
- handleTabChange(ev) {
327
- var _a;
328
- if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.selectedTab) {
329
- if (ev.target.selectedTab === "Ordenação") {
330
- this._columnListHistory = this._columnList.dataSource;
331
- this.createOrderList();
332
- }
333
- this.selectedTab = ev.target.selectedTab;
334
- }
335
- }
336
- handleColumnListChange(ev) {
337
- var _a;
338
- if (ev.detail) {
339
- let visibleItems = (_a = ev.detail.find(group => group.group === "Visíveis")) === null || _a === void 0 ? void 0 : _a.items;
340
- if (visibleItems) {
341
- this._orderListItems = visibleItems;
342
- }
343
- }
344
- }
345
- componentWillRender() {
346
- var _a;
347
- if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
348
- this.createColumnList();
349
- this.createOrderList();
350
- }
351
- }
352
- componentDidRender() {
353
- var _a;
354
- if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
355
- this.locateColumn(new KeyboardEvent("arrow-right", { key: "ArrowRight" }), this._searchElement.value);
356
- }
357
- }
358
- render() {
359
- return (h(Host, null, h("div", { class: "grid-config__header" }, h("div", { class: "title-container" }, h("div", { class: "" }, h("label", { class: "title" }, "Configura\u00E7\u00E3o da Grade"), h("label", { class: "subtitle" }, "Defina visibilidade e ordem das colunas.")), h("div", { class: "button-close" }, h("ez-button", { mode: 'icon', image: getSpritePath("close"), size: 'medium', onClick: () => this.closeConfig() }))), h("div", { class: "tabselector-container" }, h("ez-tabselector", { selectedTab: this.selectedTab, selectedIndex: '0', onEzChange: (ev) => { this.handleTabChange(ev); }, tabs: 'Colunas, Ordena\u00E7\u00E3o' })), h("div", null, h("ez-text-input", { ref: (el) => this._searchElement = el, label: "Localizar coluna", onKeyUp: evt => this.locateColumn(evt) }, h("ez-icon", { slot: "leftIcon", size: "medium", href: getSpritePath("search") })))), h("div", { class: "grid-config__main" }, h("ez-list", { ref: (el) => this._columnList = el, class: this.selectedTab === "Colunas" ? "" : "hidden", dataSource: this._columListItems, onEzChange: ev => this.handleColumnListChange(ev), ezDraggable: true, ezSelectable: true, itemSlotBuilder: (item, group) => this.buildColumnListSlot(item, group), useGroups: true }), h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedTab === "Ordenação" ? "" : "hidden", dataSource: this._orderListItems, ezSelectable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item) })), h("div", { class: "grid-config__footer" }, h("ez-button", { class: "padding-right--medium", label: "Cancelar", onClick: () => this.closeConfig() }), h("ez-button", { label: "Concluir", class: "button--primary", onClick: () => this.finish() }))));
360
- }
361
- static get assetsDirs() { return ["../assets"]; }
362
- };
363
- GridConfig.style = gridConfigCss;
364
-
365
- export { EzModal as ez_modal, GridConfig as grid_config };