@sankhyalabs/ezui 1.1.92 → 1.1.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/cjs/{CSSVarsUtils-66e86394.js → CSSVarsUtils-8fbdf2e0.js} +1 -0
  2. package/dist/cjs/StringUtils-0ba09df4.js +57 -0
  3. package/dist/cjs/ez-button_3.cjs.entry.js +578 -0
  4. package/dist/cjs/ez-calendar_14.cjs.entry.js +2625 -0
  5. package/dist/cjs/ez-dialog.cjs.entry.js +3 -3
  6. package/dist/cjs/{ez-button_11.cjs.entry.js → ez-grid.cjs.entry.js} +32 -1439
  7. package/dist/cjs/ez-icon.cjs.entry.js +42 -0
  8. package/dist/cjs/ez-modal_2.cjs.entry.js +317 -0
  9. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-time-input.cjs.entry.js +2 -2
  11. package/dist/cjs/ezui.cjs.js +1 -1
  12. package/dist/cjs/{index-a92e6d04.js → index-6164b259.js} +18 -18
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/collection/components/ez-check/ez-check.css +3 -3
  15. package/dist/collection/components/ez-combo-box/ez-combo-box.js +52 -3
  16. package/dist/collection/components/ez-dialog/ez-dialog.css +14 -2
  17. package/dist/collection/components/ez-dialog/ez-dialog.js +3 -5
  18. package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +4 -1
  19. package/dist/collection/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.js +4 -4
  20. package/dist/collection/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.js +2 -2
  21. package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +2 -2
  22. package/dist/collection/components/ez-form/fieldbuilder/tpl/FileInput.tpl.js +2 -2
  23. package/dist/collection/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.js +6 -6
  24. package/dist/collection/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.js +2 -2
  25. package/dist/collection/components/ez-form/fieldbuilder/tpl/TextArea.tpl.js +2 -2
  26. package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +10 -7
  27. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +19 -2
  28. package/dist/collection/components/ez-grid/ez-grid.css +8 -0
  29. package/dist/collection/components/ez-grid/ez-grid.js +3 -3
  30. package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +28 -4
  31. package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +6 -5
  32. package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +10 -7
  33. package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.js +12 -17
  34. package/dist/collection/components/ez-list/ez-list.css +23 -2
  35. package/dist/collection/components/ez-list/ez-list.js +138 -68
  36. package/dist/collection/components/ez-text-input/ez-text-input.css +2 -2
  37. package/dist/collection/components/ez-text-input/ez-text-input.js +24 -1
  38. package/dist/collection/components/test-du/test-du.js +1 -1
  39. package/dist/collection/utils/CSSVarsUtils.js +1 -0
  40. package/dist/collection/utils/index.js +2 -0
  41. package/dist/custom-elements/index.js +217 -120
  42. package/dist/esm/{CSSVarsUtils-aeee9825.js → CSSVarsUtils-667e0016.js} +1 -0
  43. package/dist/esm/StringUtils-cbf10229.js +55 -0
  44. package/dist/esm/ez-button_3.entry.js +572 -0
  45. package/dist/esm/ez-calendar_14.entry.js +2608 -0
  46. package/dist/esm/ez-dialog.entry.js +3 -3
  47. package/dist/esm/{ez-button_11.entry.js → ez-grid.entry.js} +24 -1421
  48. package/dist/esm/ez-icon.entry.js +38 -0
  49. package/dist/esm/ez-modal_2.entry.js +312 -0
  50. package/dist/esm/ez-popover.entry.js +1 -1
  51. package/dist/esm/ez-time-input.entry.js +2 -2
  52. package/dist/esm/ezui.js +1 -1
  53. package/dist/esm/{index-4fb1605f.js → index-74a9c220.js} +17 -17
  54. package/dist/esm/loader.js +1 -1
  55. package/dist/ezui/ezui.esm.js +1 -1
  56. package/dist/ezui/p-0a8018c2.entry.js +1 -0
  57. package/dist/ezui/{p-552a0b2e.entry.js → p-2617733e.entry.js} +1 -1
  58. package/dist/ezui/p-2f84ba72.js +1 -0
  59. package/dist/ezui/{p-d4386e30.entry.js → p-6714a1b2.entry.js} +46 -46
  60. package/dist/ezui/p-90f6d8a0.entry.js +1 -0
  61. package/dist/ezui/p-a943d501.entry.js +1 -0
  62. package/dist/ezui/p-b139372f.entry.js +1 -0
  63. package/dist/ezui/{p-f0137439.js → p-c6762896.js} +1 -1
  64. package/dist/ezui/p-d54c157f.js +1 -0
  65. package/dist/ezui/p-e06e47f1.entry.js +1 -0
  66. package/dist/ezui/{p-7e0281cd.entry.js → p-ef393d36.entry.js} +1 -1
  67. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +8 -0
  68. package/dist/types/components/ez-form/ez-form.d.ts +6 -1
  69. package/dist/types/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.d.ts +2 -1
  70. package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +2 -1
  71. package/dist/types/components/ez-form/fieldbuilder/tpl/FileInput.tpl.d.ts +2 -1
  72. package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +4 -2
  73. package/dist/types/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.d.ts +2 -1
  74. package/dist/types/components/ez-form/fieldbuilder/tpl/TextArea.tpl.d.ts +2 -1
  75. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +4 -1
  76. package/dist/types/components/ez-grid/subcomponents/select-box/select-box.d.ts +6 -4
  77. package/dist/types/components/ez-list/ez-list.d.ts +11 -6
  78. package/dist/types/components/ez-text-input/ez-text-input.d.ts +4 -0
  79. package/dist/types/components.d.ts +28 -4
  80. package/dist/types/utils/index.d.ts +2 -0
  81. package/package.json +1 -1
  82. package/dist/cjs/ApplicationUtils-d1c1db56.js +0 -35
  83. package/dist/cjs/ez-calendar.cjs.entry.js +0 -224
  84. package/dist/cjs/ez-collapsible-box_7.cjs.entry.js +0 -853
  85. package/dist/cjs/ez-combo-box.cjs.entry.js +0 -254
  86. package/dist/cjs/ez-form.cjs.entry.js +0 -753
  87. package/dist/esm/ApplicationUtils-01280a9d.js +0 -33
  88. package/dist/esm/ez-calendar.entry.js +0 -220
  89. package/dist/esm/ez-collapsible-box_7.entry.js +0 -843
  90. package/dist/esm/ez-combo-box.entry.js +0 -250
  91. package/dist/esm/ez-form.entry.js +0 -749
  92. package/dist/ezui/p-0094463f.entry.js +0 -1
  93. package/dist/ezui/p-020f1285.entry.js +0 -1
  94. package/dist/ezui/p-038fd0cb.entry.js +0 -1
  95. package/dist/ezui/p-60469339.entry.js +0 -1
  96. package/dist/ezui/p-7107d7ef.js +0 -1
  97. package/dist/ezui/p-8b099482.js +0 -1
  98. package/dist/ezui/p-d22db59d.entry.js +0 -1
@@ -1,254 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-88286449.js');
6
- require('./index-a92e6d04.js');
7
- const FloatingManager = require('./FloatingManager-6cfeb947.js');
8
- const CSSVarsUtils = require('./CSSVarsUtils-66e86394.js');
9
-
10
- const ezComboBoxCss = ":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn-search--background-color:var(--text--primary, #626e82);--ez-combo-box__btn-search-disabled--background-color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-search-hover--background-color:var(--color--primary, #4e4e4e);--ez-combo-box__btn-options--background-color:var(--text--primary, #626e82);--ez-combo-box__btn-options-disabled--background-color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-options-hover--background-color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #919191);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium));--ez-combo-box__drop-down-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"16px\"><path d=\"M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z\"/></svg>');--ez-combo-box__search-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"22px\" width=\"22px\"><path d=\"m 9.4,2.3 c 4.1,0 7.4,3.2 7.4,7.2 0,1.8 -0.7,3.4 -1.8,4.7 l 0.3,0.3 h 0.9 l 5.7,5.6 -1.7,1.7 -5.7,-5.6 V 15.3 L 14.3,15 C 13,16.1 11.3,16.7 9.5,16.7 5.3,16.7 2,13.5 2,9.5 2,5.5 5.3,2.3 9.4,2.3 m 0,2.2 c -2.9,0 -5.1,2.2 -5.1,5 0,2.8 2.3,5 5.1,5 2.8,0 5.1,-2.2 5.1,-5 0,-2.8 -2.2,-5 -5.1,-5 z\"/></svg>');--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}.list-container{position:relative;width:100%}.options-list{box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--ez-combo-box--background-color--xlight);padding:var(--ez-combo-box--space--small);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);scroll-behavior:smooth;max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small));overflow:auto}.item{text-align:left;display:flex;justify-content:space-between;align-items:center;border-radius:var(--ez-combo-box--border-radius-small);padding:0 var(--ez-combo-box--space--small);list-style-type:none;min-height:var(--ez-combo-box__list-height)}.item--label{text-align:left;flex-basis:85%;flex-grow:1;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item--value{text-align:right;flex-basis:15%;flex-grow:0;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn-open-options{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-options:disabled{cursor:unset}.btn-open-options::after{content:'';display:flex;background-color:var(--ez-combo-box__btn-options--background-color);width:16px;height:16px;-webkit-mask-image:var(--ez-combo-box__drop-down-image);mask-image:var(--ez-combo-box__drop-down-image)}.btn-open-options:disabled:after{background-color:var(--ez-combo-box__btn-options-disabled--background-color)}.btn-open-options:enabled:hover::after{background-color:var(--ez-combo-box__btn-options-hover--background-color)}.btn-open-search{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-search:disabled{cursor:unset}.btn-open-search::after{content:'';display:flex;background-color:var(--ez-combo-box__btn-search--background-color);width:22px;height:22px;-webkit-mask-image:var(--ez-combo-box__search-image);mask-image:var(--ez-combo-box__search-image)}.btn-open-search:disabled:after{background-color:var(--ez-combo-box__btn-search-disabled--background-color)}.btn-open-search:enabled:hover::after{background-color:var(--ez-combo-box__btn-search-hover--background-color)}";
11
-
12
- let EzComboBox = 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 interação com usuário.
18
- */
19
- this.enabled = true;
20
- /**
21
- * Ajusta a opção de mostrar o "value" ao selecionar uma opção. Por padrão não mostra.
22
- */
23
- this.showSelectedValue = false;
24
- /**
25
- * Ajusta a opção de mostrar o "value" para cada opção. Por padrão não mostra
26
- */
27
- this.showOptionValue = false;
28
- }
29
- internalUpdate() {
30
- if (this._inputElement) {
31
- this._inputElement.value = this.getText();
32
- }
33
- this.hideOptions();
34
- this._criteria = undefined;
35
- this._preSelection = undefined;
36
- this.updateVisibleOptions();
37
- }
38
- getText() {
39
- let text = "";
40
- const selected = this.getSelectedOption();
41
- if (selected) {
42
- text = this.showSelectedValue ? `${selected.value} - ${selected.label}` : selected.label;
43
- }
44
- return text;
45
- }
46
- getSelectedOption() {
47
- if (typeof this.value === "string" || this.value instanceof String) {
48
- return this._visibleOptions.find(o => o.value === this.value);
49
- }
50
- return this.value;
51
- }
52
- updateVisibleOptions() {
53
- let opts = this._source || [];
54
- if (!this.searchMode && this._criteria) {
55
- const upperCriteria = this._criteria.toUpperCase();
56
- opts = opts.filter(opt => opt.label.toLocaleUpperCase().indexOf(upperCriteria) > -1);
57
- }
58
- this._visibleOptions = [{ value: undefined, label: "" }].concat(opts);
59
- }
60
- buildItem(opt, index$1) {
61
- return index.h("li", { class: index$1 === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.selectOption(opt), onMouseOver: () => this._preSelection = undefined }, index.h("span", { class: "item--label", title: opt.label }, opt.label), this.showOptionValue ? index.h("span", { class: "item--value", title: opt.value }, opt.value) : undefined);
62
- }
63
- showOptions() {
64
- if (!this.enabled) {
65
- return;
66
- }
67
- //FIXME: Provavelmente isso fará com que o popup abra em uma
68
- //posição errada no futuro. Preferi fazer simples no começo,
69
- //porque não quis onerar o text input com essa funcionalidade...
70
- const top = this.errorMessage ? "0px" : "-17px";
71
- this._floatingID = FloatingManager.FloatingManager.float(this._optionsList, this._listContainer, { autoClose: true, top });
72
- window.requestAnimationFrame(() => {
73
- this._optionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
74
- });
75
- }
76
- hideOptions() {
77
- if (this._floatingID !== undefined) {
78
- FloatingManager.FloatingManager.close(this._floatingID);
79
- }
80
- this._floatingID = undefined;
81
- }
82
- isOptionsVisible() {
83
- return this._floatingID !== undefined && FloatingManager.FloatingManager.isFloating(this._floatingID);
84
- }
85
- nextOption() {
86
- if (this.searchMode && !this.isOptionsVisible()) {
87
- return;
88
- }
89
- this.showOptions();
90
- this._preSelection = this._preSelection === undefined ? 0 : Math.min(this._preSelection + 1, this._visibleOptions.length - 1);
91
- this.scrollToOption(this._visibleOptions[this._preSelection], true);
92
- }
93
- previousOption() {
94
- this._preSelection = this._preSelection === undefined ? 0 : Math.max(this._preSelection - 1, 0);
95
- this.scrollToOption(this._visibleOptions[this._preSelection], false);
96
- }
97
- scrollToOption(opt, down) {
98
- window.requestAnimationFrame(() => {
99
- const liElem = this._optionsList.querySelector(`li#item_${opt.value}`);
100
- if (liElem) {
101
- const parent = liElem.parentElement;
102
- const parentRect = parent.getBoundingClientRect();
103
- const itemRect = liElem.getBoundingClientRect();
104
- if (down && itemRect.bottom > parentRect.bottom) {
105
- parent.scrollTop = itemRect.top;
106
- }
107
- else if (!down && itemRect.top < parentRect.top) {
108
- parent.scrollTop = 0;
109
- }
110
- }
111
- });
112
- }
113
- selectCurrentOption() {
114
- if (this._preSelection !== undefined) {
115
- this.selectOption(this._visibleOptions[this._preSelection]);
116
- this._preSelection = undefined;
117
- }
118
- }
119
- selectOption(opt) {
120
- const currentOpt = this.getSelectedOption();
121
- if (currentOpt !== opt) {
122
- const adjustedOpt = !(opt === null || opt === void 0 ? void 0 : opt.value) ? undefined : opt;
123
- this.value = adjustedOpt;
124
- this.errorMessage = "";
125
- this.ezChange.emit(adjustedOpt);
126
- }
127
- else {
128
- this.internalUpdate();
129
- }
130
- }
131
- updateSource(source) {
132
- if (source instanceof Promise) {
133
- source.then(result => this.updateSource(result));
134
- this.updateVisibleOptions();
135
- }
136
- else {
137
- this._source = source;
138
- this.updateVisibleOptions();
139
- }
140
- }
141
- loadOptions(mode, argument = "") {
142
- this._criteria = argument;
143
- if (this.optionLoader) {
144
- this.updateSource(this.optionLoader({ mode, argument }));
145
- }
146
- else {
147
- this.updateSource(this.options);
148
- }
149
- }
150
- cancelPreselection() {
151
- if (!this._inputElement.value && this.value) {
152
- this.selectOption(undefined);
153
- }
154
- else {
155
- this.internalUpdate();
156
- }
157
- }
158
- //---------------------------------------------
159
- // Lifecycle web component
160
- //---------------------------------------------
161
- componentWillLoad() {
162
- if (this.options === undefined) {
163
- this.options = [];
164
- const optionsTags = this.el.querySelectorAll("option");
165
- if (optionsTags) {
166
- optionsTags.forEach(e => {
167
- let label = e.innerText;
168
- let value = e.getAttribute("value");
169
- if (!value) {
170
- value = label;
171
- }
172
- this.options.push({ label, value });
173
- e.hidden = true;
174
- });
175
- }
176
- }
177
- if (this.searchMode) {
178
- this.updateSource([]);
179
- }
180
- else {
181
- this.loadOptions("PRELOAD");
182
- }
183
- }
184
- componentDidRender() {
185
- if (this._floatingID === undefined) {
186
- this._optionsList.remove();
187
- }
188
- }
189
- componentDidLoad() {
190
- CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this.el, this._inputElement);
191
- }
192
- //---------------------------------------------
193
- // Event handlers
194
- //---------------------------------------------
195
- onTextInputChangeHandler(event) {
196
- if (!this._criteria) {
197
- this._inputElement.value = event.data;
198
- }
199
- const argument = event.target.value;
200
- this._criteria = argument;
201
- if (this._criteria) {
202
- if (this.searchMode) {
203
- if (this._changeDeboucingTimeout) {
204
- window.clearTimeout(this._changeDeboucingTimeout);
205
- }
206
- this._changeDeboucingTimeout = window.setTimeout(() => {
207
- this.loadOptions("PREDICTIVE", argument);
208
- }, 200);
209
- }
210
- else {
211
- this.updateVisibleOptions();
212
- }
213
- this.showOptions();
214
- }
215
- }
216
- onTextInputClickHandler() {
217
- if (!this.searchMode) {
218
- this.showOptions();
219
- }
220
- }
221
- keyDownHandler(event) {
222
- switch (event.key) {
223
- case "ArrowDown":
224
- this.nextOption();
225
- break;
226
- case "ArrowUp":
227
- this.previousOption();
228
- break;
229
- case "Enter":
230
- this.selectCurrentOption();
231
- break;
232
- case "Escape":
233
- this.cancelPreselection();
234
- break;
235
- }
236
- event.stopPropagation();
237
- }
238
- onTextInputFocusOutHandler() {
239
- this.cancelPreselection();
240
- }
241
- render() {
242
- return (index.h(index.Host, null, index.h("ez-text-input", { ref: elem => this._inputElement = elem, enabled: this.enabled, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onEzChange: event => event.stopPropagation(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(), errorMessage: this.errorMessage }, this.searchMode ?
243
- index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-search", onClick: () => { this.loadOptions("ADVANCED"); }, slot: "leftIcon" })
244
- :
245
- index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-options", slot: "rightIcon", onClick: () => this.showOptions() })), index.h("section", { class: "list-container", ref: elem => this._listContainer = elem }, index.h("div", { class: "options-list", ref: elem => this._optionsList = elem }, this._visibleOptions.map((opt, index) => this.buildItem(opt, index))))));
246
- }
247
- get el() { return index.getElement(this); }
248
- static get watchers() { return {
249
- "value": ["internalUpdate"]
250
- }; }
251
- };
252
- EzComboBox.style = ezComboBoxCss;
253
-
254
- exports.ez_combo_box = EzComboBox;