@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,133 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-2003dec4.js');
6
- const index$1 = require('./index-a2266984.js');
7
- const DateUtils = require('./DateUtils-716769e0.js');
8
- const CSSVarsUtils = require('./CSSVarsUtils-66e86394.js');
9
-
10
- 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)}";
11
-
12
- let EzDateTimeInput = class {
13
- constructor(hostRef) {
14
- index.registerInstance(this, hostRef);
15
- this.ezChange = index.createEvent(this, "ezChange", 7);
16
- /**
17
- * Deixa o campo disponível ou não para uso.
18
- */
19
- this.enabled = true;
20
- /**
21
- * Exibe ou não os segundos no input
22
- */
23
- this.showSeconds = false;
24
- }
25
- setLabel() {
26
- this._textInput.label = this.label;
27
- }
28
- setErrorMessage() {
29
- this._textInput.errorMessage = this.errorMessage;
30
- }
31
- applyValueToInput() {
32
- if (this._textInput) {
33
- this._textInput.value = this.getTextValue(this.value);
34
- }
35
- }
36
- onChangeKeyDown(ev) {
37
- const input = this._textInput.shadowRoot.querySelector('input');
38
- if (ev.key === "H" || ev.key === "h") {
39
- this.changeValue(new Date());
40
- }
41
- else if (ev.shiftKey && ev.key === "Tab") {
42
- if (input.selectionStart > 0) {
43
- let selectIni = input.value.lastIndexOf(" ", input.selectionStart);
44
- if (selectIni !== -1) {
45
- input.setSelectionRange(0, selectIni);
46
- ev.preventDefault();
47
- }
48
- }
49
- }
50
- else if (ev.key === "Tab") {
51
- if (input.value.length !== input.selectionEnd) {
52
- let selectIni = input.value.indexOf(" ", input.selectionEnd);
53
- selectIni = selectIni === -1 ? input.selectionEnd : selectIni + 1;
54
- input.setSelectionRange(selectIni, input.value.length);
55
- ev.preventDefault();
56
- }
57
- }
58
- }
59
- onFocused() {
60
- const input = this._textInput.shadowRoot.querySelector('input');
61
- if (input.selectionStart !== input.selectionEnd) {
62
- let selectIni = input.value.indexOf(" ", input.selectionStart);
63
- selectIni = selectIni === -1 ? input.value.length : selectIni;
64
- input.setSelectionRange(0, selectIni);
65
- }
66
- }
67
- onClicked() {
68
- const input = this._textInput.shadowRoot.querySelector('input');
69
- let selectIni = input.value.lastIndexOf(" ", input.selectionEnd);
70
- selectIni = selectIni === -1 ? 0 : selectIni + 1;
71
- selectIni = selectIni > input.selectionEnd ? 0 : selectIni;
72
- let selectFin = selectIni === 0 ? input.value.indexOf(" ") : input.value.length;
73
- input.setSelectionRange(selectIni, selectFin);
74
- }
75
- changeValue(newValue) {
76
- this._textInput.errorMessage = "";
77
- if (newValue !== this.value) {
78
- this.value = newValue;
79
- this.ezChange.emit();
80
- }
81
- }
82
- showCalendar() {
83
- const top = this._textInput.errorMessage ? 0 : -17;
84
- this._calendar.fitVertical(top, this._elem.clientHeight);
85
- this._calendar.style.visibility = 'inherit';
86
- }
87
- parseDate() {
88
- const strValue = this._textInput.value;
89
- const partsDateTime = (strValue && strValue.length > 0) ? strValue.split(" ") : [];
90
- const onlyDate = partsDateTime.length > 0 ? partsDateTime[0] : strValue;
91
- const onlyTime = partsDateTime[1] ? partsDateTime[1] : "";
92
- const parsedTime = index$1.TimeFormatter.prepareValue(onlyTime, this.showSeconds);
93
- const strDateTime = onlyDate + (parsedTime && " " + parsedTime);
94
- const parsedDate = DateUtils.DateUtils.strToDate(strDateTime);
95
- if (parsedDate || !strValue) {
96
- if (this.value === parsedDate) {
97
- this.changeValue(this.value);
98
- }
99
- else {
100
- this.changeValue(parsedDate);
101
- }
102
- }
103
- else {
104
- this._textInput.errorMessage = "O valor digitado não é uma data válida";
105
- }
106
- }
107
- getTextValue(d) {
108
- const options = {
109
- year: 'numeric', month: 'numeric', day: 'numeric',
110
- hour: 'numeric', minute: 'numeric'
111
- };
112
- const optionsSecond = {
113
- year: 'numeric', month: 'numeric', day: 'numeric',
114
- hour: 'numeric', minute: 'numeric', second: 'numeric'
115
- };
116
- return d ? (new Intl.DateTimeFormat('pt-BR', this.showSeconds ? optionsSecond : options).format(d)) : null;
117
- }
118
- componentDidLoad() {
119
- CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
120
- }
121
- render() {
122
- return (index.h(index.Host, null, index.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() }, index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), index.h("ez-calendar", { onEzChange: (event) => { this.changeValue(this._calendar.value); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem, time: true, showSeconds: this.showSeconds })));
123
- }
124
- get _elem() { return index.getElement(this); }
125
- static get watchers() { return {
126
- "label": ["setLabel"],
127
- "errorMessage": ["setErrorMessage"],
128
- "value": ["applyValueToInput"]
129
- }; }
130
- };
131
- EzDateTimeInput.style = ezDateTimeInputCss;
132
-
133
- exports.ez_date_time_input = EzDateTimeInput;
@@ -1,30 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-2003dec4.js');
6
-
7
- 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}";
8
-
9
- let EzIcon = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- /**
13
- * Tamanho do ícone
14
- */
15
- this.size = 'medium';
16
- }
17
- isSprite() {
18
- return this.href && this.href.indexOf('#') > -1;
19
- }
20
- render() {
21
- return (index.h(index.Host, null, this.isSprite()
22
- ?
23
- index.h("svg", { class: this.size, role: "img" }, index.h("use", { xlinkHref: this.href }))
24
- :
25
- index.h("img", { class: this.size, src: this.href })));
26
- }
27
- };
28
- EzIcon.style = ezIconCss;
29
-
30
- exports.ez_icon = EzIcon;
@@ -1,370 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-2003dec4.js');
6
- const AssetsUtils = require('./AssetsUtils-02db4f46.js');
7
- require('./index-a2266984.js');
8
-
9
- /**
10
- * Classe com utiliários comuns para Strings.
11
- */
12
- class StringUtils {
13
- /**
14
- * Verifica se a string está vazia.
15
- * Valores null e undefined são considerados como vazio.
16
- *
17
- * @param value String para ser validada.
18
- */
19
- static isEmpty(value) {
20
- if (value == undefined || value === null) {
21
- return true;
22
- }
23
- value = value.toString();
24
- value = value.trim();
25
- if (value.length === 0) {
26
- return true;
27
- }
28
- return false;
29
- }
30
- /**
31
- * Remove acentos de vogais, substitui Ç por c e retorna a string em caixa alta.
32
- *
33
- * @param value String para ser transformada.
34
- */
35
- static replaceAccentuatedChars(text) {
36
- text = text.toUpperCase();
37
- text = text.replace(/[À]/, "A");
38
- text = text.replace(/[Á]/, "A");
39
- text = text.replace(/[Â]/, "A");
40
- text = text.replace(/[Ã]/, "A");
41
- text = text.replace(/[Ä]/, "A");
42
- text = text.replace(/[È]/, "E");
43
- text = text.replace(/[É]/, "E");
44
- text = text.replace(/[Ê]/, "E");
45
- text = text.replace(/[Ë]/, "E");
46
- text = text.replace(/[Ì]/, "I");
47
- text = text.replace(/[Í]/, "I");
48
- text = text.replace(/[Î]/, "I");
49
- text = text.replace(/[Ï]/, "I");
50
- text = text.replace(/[Ò]/, "O");
51
- text = text.replace(/[Ó]/, "O");
52
- text = text.replace(/[Ô]/, "O");
53
- text = text.replace(/[Ö]/, "O");
54
- text = text.replace(/[Ù]/, "U");
55
- text = text.replace(/[Ú]/, "U");
56
- text = text.replace(/[Û]/, "U");
57
- text = text.replace(/[Ü]/, "U");
58
- text = text.replace(/[Ç]/, "C");
59
- return text.replace(/[^a-z0-9]/gi, '');
60
- }
61
- }
62
-
63
- 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%}}";
64
-
65
- let EzModal = class {
66
- constructor(hostRef) {
67
- index.registerInstance(this, hostRef);
68
- this.ezCloseModal = index.createEvent(this, "ezCloseModal", 7);
69
- /**
70
- * Controle de exibição do Modal
71
- */
72
- this.opened = true;
73
- /**
74
- * Define se o modal será fechado ao clicar ESC
75
- */
76
- this.closeEsc = false;
77
- /**
78
- * Define se o modal será fechado ao clicar fora do conteúdo.
79
- */
80
- this.closeOutsideClick = false;
81
- this.handleKeyboardEvent = (ev) => {
82
- if ((ev === null || ev === void 0 ? void 0 : ev.key) === "Escape" && this.closeEsc) {
83
- this.closeModal();
84
- }
85
- };
86
- }
87
- handleopenedChange() {
88
- if (this.opened) {
89
- document.addEventListener("keydown", this.handleKeyboardEvent);
90
- }
91
- else {
92
- document.removeEventListener("keydown", this.handleKeyboardEvent);
93
- }
94
- }
95
- closeModal() {
96
- this.opened = false;
97
- this.ezCloseModal.emit(this.opened);
98
- }
99
- componentDidLoad() {
100
- this.handleopenedChange();
101
- }
102
- onMouseDownHandler(event) {
103
- if (this.closeOutsideClick && event.target === this._overlay) {
104
- this.closeModal();
105
- }
106
- }
107
- render() {
108
- const positionSufix = this.align === "left" ? "left" : "right";
109
- return (index.h(index.Host, null, this.opened
110
- ?
111
- 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))))
112
- :
113
- undefined));
114
- }
115
- static get watchers() { return {
116
- "opened": ["handleopenedChange"]
117
- }; }
118
- };
119
- EzModal.style = ezModalCss;
120
-
121
- 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)}";
122
-
123
- let GridConfig = class {
124
- constructor(hostRef) {
125
- index.registerInstance(this, hostRef);
126
- this.configFinish = index.createEvent(this, "configFinish", 7);
127
- this.configCancel = index.createEvent(this, "configCancel", 7);
128
- this._columnListHistory = [];
129
- this._orderListItems = [];
130
- this._columListItems = [];
131
- this.selectedTab = "Colunas";
132
- this._selectedIndex = -1;
133
- }
134
- /* Creation Methods */
135
- createOrderList() {
136
- var _a;
137
- let newList = [];
138
- if (((_a = this._columnListHistory) === null || _a === void 0 ? void 0 : _a.length) > 0) {
139
- this._columnListHistory.find(group => group.group === "Visíveis").items.forEach(column => {
140
- let item = { label: column.label };
141
- newList.push(item);
142
- });
143
- }
144
- else {
145
- this.columns.forEach(column => {
146
- let item = { name: column.name, label: column.label };
147
- if (!column.hidden) {
148
- newList.push(item);
149
- }
150
- });
151
- }
152
- this._orderListItems = newList;
153
- }
154
- createColumnList() {
155
- let visibleGroup = {
156
- group: 'Visíveis',
157
- items: [],
158
- };
159
- let hiddenGroup = {
160
- group: 'Ocultas',
161
- items: [],
162
- sort: 'ASC'
163
- };
164
- this.columns.forEach(column => {
165
- let item = { label: column.label };
166
- if (column.hidden) {
167
- hiddenGroup.items.push(item);
168
- }
169
- else {
170
- visibleGroup.items.push(item);
171
- }
172
- });
173
- if (this._columnListHistory.length <= 0) {
174
- this._columListItems = [visibleGroup, hiddenGroup];
175
- }
176
- }
177
- buildColumnListSlot(item, group) {
178
- 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); } })));
179
- }
180
- buildOrderListSlot(item) {
181
- let existingItem = this.columns.find(columnItem => columnItem.label === item.label);
182
- 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); } })));
183
- }
184
- updateOrder(sortOrder, updatedItem) {
185
- let newList = [...this.columns];
186
- let newItem = newList.find(item => item.label === updatedItem.label);
187
- if (newItem) {
188
- newItem.sort = sortOrder;
189
- }
190
- this.columns = newList;
191
- }
192
- /* Actions Methods */
193
- switchColumnGroup(ev, switchedItem) {
194
- ev.stopPropagation();
195
- let newList = [...this._columListItems];
196
- if (ev.detail === true) {
197
- let hiddenGroup = newList.find(group => group.group === "Ocultas");
198
- let index = hiddenGroup.items.findIndex(item => item.label === switchedItem.label);
199
- if (index >= 0) {
200
- hiddenGroup.items.splice(index, 1);
201
- }
202
- let visibleGroup = newList.find(group => group.group === "Visíveis");
203
- visibleGroup.items.push(switchedItem);
204
- this._columListItems = newList;
205
- this.createOrderList();
206
- }
207
- else if (ev.detail === false) {
208
- let visibleGroup = newList.find(group => group.group === "Visíveis");
209
- let index = visibleGroup.items.findIndex(item => item.label === switchedItem.label);
210
- if (index >= 0) {
211
- visibleGroup.items.splice(index, 1);
212
- }
213
- let hiddenGroup = newList.find(group => group.group === "Ocultas");
214
- hiddenGroup.items.push(switchedItem);
215
- this._columListItems = newList;
216
- this.createOrderList();
217
- }
218
- }
219
- finish() {
220
- let newColumnList = [];
221
- this._columListItems.forEach(group => {
222
- group.items.forEach(item => {
223
- const baseColumn = this.columns.find(column => column.label === item.label);
224
- let newColumnItem = Object.assign({}, baseColumn);
225
- if (group.group === "Ocultas") {
226
- newColumnItem.hidden = true;
227
- }
228
- else {
229
- newColumnItem.hidden = false;
230
- }
231
- newColumnList.push(newColumnItem);
232
- });
233
- });
234
- this._columnListHistory = [];
235
- this.columns = newColumnList;
236
- this.configFinish.emit(this.columns);
237
- }
238
- async locateColumn(evt, searchingText) {
239
- var _a;
240
- const hitEnter = evt.key === "Enter";
241
- if (!searchingText) {
242
- searchingText = (_a = evt.currentTarget) === null || _a === void 0 ? void 0 : _a.value;
243
- }
244
- let newSelected = -1;
245
- if (this.selectedTab === "Ordenação") {
246
- if (searchingText) {
247
- const matchedIndexes = [];
248
- let orderListDatasource;
249
- await this._orderList.getList().then(listGroup => {
250
- orderListDatasource = listGroup;
251
- orderListDatasource.forEach((column, index) => {
252
- if (this.compareWords(column, searchingText)) {
253
- matchedIndexes.push(index);
254
- }
255
- });
256
- });
257
- if (matchedIndexes.length > 0) {
258
- if (hitEnter) {
259
- for (let j = 0; j < matchedIndexes.length; j++) {
260
- if (matchedIndexes[j] > this._selectedIndex) {
261
- newSelected = matchedIndexes[j];
262
- break;
263
- }
264
- }
265
- }
266
- if (newSelected === -1) {
267
- newSelected = matchedIndexes[0];
268
- }
269
- }
270
- this._selectedIndex = newSelected;
271
- let selectedColumn;
272
- selectedColumn = orderListDatasource[newSelected];
273
- if (selectedColumn) {
274
- this._orderList.setSelection({ label: selectedColumn.label }, true);
275
- }
276
- else {
277
- this._orderList.setSelection(undefined);
278
- }
279
- }
280
- else {
281
- this._orderList.setSelection(undefined);
282
- }
283
- }
284
- else {
285
- if (searchingText) {
286
- const matchedIndexes = [];
287
- this.columns.forEach((column, index) => {
288
- if (this.compareWords(column, searchingText)) {
289
- matchedIndexes.push(index);
290
- }
291
- });
292
- if (matchedIndexes.length > 0) {
293
- if (hitEnter) {
294
- for (let j = 0; j < matchedIndexes.length; j++) {
295
- if (matchedIndexes[j] > this._selectedIndex) {
296
- newSelected = matchedIndexes[j];
297
- break;
298
- }
299
- }
300
- }
301
- if (newSelected === -1) {
302
- newSelected = matchedIndexes[0];
303
- }
304
- }
305
- this._selectedIndex = newSelected;
306
- let selectedColumn = this.columns[newSelected];
307
- if (selectedColumn) {
308
- this._columnList.setSelection({ label: selectedColumn.label }, true);
309
- }
310
- else {
311
- this._columnList.setSelection(undefined);
312
- }
313
- }
314
- else {
315
- this._columnList.setSelection(undefined);
316
- }
317
- }
318
- }
319
- compareWords(column, searchingText) {
320
- if (StringUtils.replaceAccentuatedChars(column.label).indexOf(StringUtils.replaceAccentuatedChars(searchingText)) > -1) {
321
- return true;
322
- }
323
- return false;
324
- }
325
- closeConfig() {
326
- this._columnListHistory = [];
327
- this.configCancel.emit();
328
- }
329
- /* Handlers */
330
- handleTabChange(ev) {
331
- var _a;
332
- if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.selectedTab) {
333
- if (ev.target.selectedTab === "Ordenação") {
334
- this._columnListHistory = this._columnList.dataSource;
335
- this.createOrderList();
336
- }
337
- this.selectedTab = ev.target.selectedTab;
338
- }
339
- }
340
- handleColumnListChange(ev) {
341
- var _a;
342
- if (ev.detail) {
343
- let visibleItems = (_a = ev.detail.find(group => group.group === "Visíveis")) === null || _a === void 0 ? void 0 : _a.items;
344
- if (visibleItems) {
345
- this._orderListItems = visibleItems;
346
- }
347
- }
348
- }
349
- componentWillRender() {
350
- var _a;
351
- if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
352
- this.createColumnList();
353
- this.createOrderList();
354
- }
355
- }
356
- componentDidRender() {
357
- var _a;
358
- if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
359
- this.locateColumn(new KeyboardEvent("arrow-right", { key: "ArrowRight" }), this._searchElement.value);
360
- }
361
- }
362
- render() {
363
- 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() }))));
364
- }
365
- static get assetsDirs() { return ["../assets"]; }
366
- };
367
- GridConfig.style = gridConfigCss;
368
-
369
- exports.ez_modal = EzModal;
370
- exports.grid_config = GridConfig;
@@ -1,44 +0,0 @@
1
- class DateUtils {
2
- static clearTime(date, adjustDayLightSavingTime = true) {
3
- const newDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0);
4
- return adjustDayLightSavingTime ? DateUtils.adjustDLST(newDate) : newDate;
5
- }
6
- static strToDate(strValue, adjustDayLightSavingTime = true, monthYearMode = false) {
7
- /** monthYearMode é um booleano para usar o formato MM/YYYY.
8
- * Quando ativado, é retornado o primeiro dia do mês apenas para construir a data.
9
- * Não há necessidade de verificar o horário de verão quando utilizado esse modo. */
10
- let parts;
11
- if (monthYearMode) {
12
- parts = /^(1[0-2]|0[1-9]|[1-9])[^\d]?(\d{2}|\d{4})(?:\s(\d{1,2}):(\d{1,2}):?(\d{0,2}))?$/.exec(strValue);
13
- }
14
- else {
15
- parts = /^(3[01]|[1-2]\d|0[1-9]|[1-9])[^\d]?(1[0-2]|0[1-9]|[1-9])[^\d]?(\d{2}|\d{4})(?:\s(\d{1,2}):(\d{1,2}):?(\d{0,2}))?$/.exec(strValue);
16
- }
17
- if (!parts) {
18
- return undefined;
19
- }
20
- var day = monthYearMode ? 1 : Number(parts[1]);
21
- var month = Number(parts[(monthYearMode ? 1 : 2)]);
22
- var year = Number(parts[(monthYearMode ? 2 : 3)]);
23
- var hour = Number(parts[(monthYearMode ? 3 : 4)] || 0);
24
- var min = Number(parts[(monthYearMode ? 4 : 5)] || 0);
25
- var sec = Number(parts[(monthYearMode ? 5 : 6)] || 0);
26
- if (year < 100) {
27
- year += year < 30 ? 2000 : 1900;
28
- }
29
- let date = new Date(year, month - 1, day, hour, min, sec, 0);
30
- if (adjustDayLightSavingTime === true && !monthYearMode && hour == 0) {
31
- date = DateUtils.adjustDLST(date);
32
- }
33
- return date;
34
- }
35
- static adjustDLST(date) {
36
- //Work around para corrigir o Bug do horário de verão.
37
- if (date.getHours() == 23) {
38
- return new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1, 1, 0, 0, 0);
39
- }
40
- return date;
41
- }
42
- }
43
-
44
- export { DateUtils as D };