@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-75065.0 → 0.0.0-bugfix-dev-KB-83282.0

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 (62) hide show
  1. package/dist/cjs/ez-badge.cjs.entry.js +2 -14
  2. package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +387 -0
  3. package/dist/cjs/ez-combo-box.cjs.entry.js +58 -184
  4. package/dist/cjs/ez-grid.cjs.entry.js +58 -0
  5. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +186 -0
  7. package/dist/cjs/{ez-multi-selection-list_2.cjs.entry.js → ez-popover-core_2.cjs.entry.js} +115 -196
  8. package/dist/cjs/ezui.cjs.js +1 -1
  9. package/dist/cjs/index-a7b0c73d.js +8 -4
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/collection/collection-manifest.json +2 -0
  12. package/dist/collection/components/ez-badge/ez-badge.css +1 -12
  13. package/dist/collection/components/ez-badge/ez-badge.js +1 -31
  14. package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css +205 -0
  15. package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js +426 -0
  16. package/dist/collection/components/ez-combo-box/ez-combo-box.css +0 -250
  17. package/dist/collection/components/ez-combo-box/ez-combo-box.js +61 -194
  18. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +3 -0
  19. package/dist/collection/components/ez-grid/ez-grid.js +56 -1
  20. package/dist/collection/components/ez-icon/ez-icon.css +4 -1
  21. package/dist/collection/components/ez-popover-plus/ez-popover-plus.css +0 -64
  22. package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +47 -127
  23. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +67 -0
  24. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +468 -0
  25. package/dist/custom-elements/index.d.ts +12 -0
  26. package/dist/custom-elements/index.js +395 -219
  27. package/dist/esm/ez-badge.entry.js +2 -14
  28. package/dist/esm/ez-combo-box-list_3.entry.js +381 -0
  29. package/dist/esm/ez-combo-box.entry.js +59 -185
  30. package/dist/esm/ez-grid.entry.js +59 -1
  31. package/dist/esm/ez-icon.entry.js +1 -1
  32. package/dist/esm/ez-multi-selection-list.entry.js +182 -0
  33. package/dist/esm/{ez-multi-selection-list_2.entry.js → ez-popover-core_2.entry.js} +116 -197
  34. package/dist/esm/ezui.js +1 -1
  35. package/dist/esm/index-baa5e267.js +8 -4
  36. package/dist/esm/loader.js +1 -1
  37. package/dist/ezui/ezui.esm.js +1 -1
  38. package/dist/ezui/p-3a009184.entry.js +1 -0
  39. package/dist/ezui/{p-a5950a0d.entry.js → p-53116373.entry.js} +46 -46
  40. package/dist/ezui/p-56fe5341.entry.js +1 -0
  41. package/dist/ezui/p-650e4b6d.entry.js +1 -0
  42. package/dist/ezui/p-7bd15498.entry.js +1 -0
  43. package/dist/ezui/p-dc73e1fe.entry.js +1 -0
  44. package/dist/ezui/p-f5931caa.entry.js +1 -0
  45. package/dist/types/components/ez-badge/ez-badge.d.ts +0 -5
  46. package/dist/types/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.d.ts +104 -0
  47. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +7 -16
  48. package/dist/types/components/ez-grid/ez-grid.d.ts +5 -0
  49. package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +6 -19
  50. package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +81 -0
  51. package/dist/types/components.d.ts +218 -11
  52. package/package.json +1 -1
  53. package/react/components.d.ts +2 -0
  54. package/react/components.js +2 -0
  55. package/react/components.js.map +1 -1
  56. package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +0 -236
  57. package/dist/esm/ez-custom-form-input_2.entry.js +0 -231
  58. package/dist/ezui/p-0ca05a2f.entry.js +0 -1
  59. package/dist/ezui/p-64b461b3.entry.js +0 -1
  60. package/dist/ezui/p-cdac80f1.entry.js +0 -1
  61. package/dist/ezui/p-dc8b36c3.entry.js +0 -1
  62. package/dist/ezui/p-e75c7a23.entry.js +0 -1
@@ -1,4 +1,4 @@
1
- import { ElementIDUtils, FloatingManager, ObjectUtils, StringUtils } from "@sankhyalabs/core";
1
+ import { ElementIDUtils, ObjectUtils } from "@sankhyalabs/core";
2
2
  import { h, Host } from "@stencil/core";
3
3
  import { CSSVarsUtils } from "../../utils";
4
4
  export class EzComboBox {
@@ -9,11 +9,13 @@ export class EzComboBox {
9
9
  this._tabPressed = false;
10
10
  this._textEmptyList = "Nenhum resultado encontrado";
11
11
  this._lookupMode = false;
12
+ this.isOpen = false;
12
13
  this._preSelection = undefined;
13
14
  this._visibleOptions = undefined;
14
15
  this._startLoading = false;
15
16
  this._showLoading = true;
16
17
  this._criteria = undefined;
18
+ this._textInputReady = undefined;
17
19
  this.limitCharsToSearch = 3;
18
20
  this.value = undefined;
19
21
  this.label = undefined;
@@ -119,63 +121,6 @@ export class EzComboBox {
119
121
  async clearValue() {
120
122
  this.clearSearch();
121
123
  }
122
- scrollListener() {
123
- var _a;
124
- if (this._floatingID == undefined) {
125
- return;
126
- }
127
- if ((_a = this.listOptionsPosition) === null || _a === void 0 ? void 0 : _a.hardPosition) {
128
- this.hideOptions();
129
- }
130
- else {
131
- window.requestAnimationFrame(() => {
132
- this.updateListPosition();
133
- });
134
- }
135
- }
136
- updateListPosition() {
137
- let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
138
- const elementRect = this._listWrapper.getBoundingClientRect();
139
- const containerRect = this._listContainer.getBoundingClientRect();
140
- const textInputRect = this._textInput.getBoundingClientRect();
141
- const limitHeight = bottomLimit || window.innerHeight;
142
- const neededHeight = containerRect.bottom + elementRect.height;
143
- if (!fromBottom && (elementRect.top < 0 || neededHeight > limitHeight)) {
144
- fromBottom = true;
145
- }
146
- if (!hardPosition) {
147
- verticalPosition = verticalPosition || 0;
148
- horizontalPosition = horizontalPosition || 0;
149
- if (fromBottom) {
150
- verticalPosition = window.innerHeight - textInputRect.top + verticalPosition;
151
- }
152
- else {
153
- verticalPosition += containerRect.top;
154
- }
155
- if (fromRight) {
156
- horizontalPosition = window.innerWidth - textInputRect.right + horizontalPosition;
157
- }
158
- else {
159
- horizontalPosition += containerRect.left;
160
- }
161
- }
162
- if (verticalPosition != undefined) {
163
- this._listWrapper.style[fromBottom ? "bottom" : "top"] = `${verticalPosition}px`;
164
- this._listWrapper.style[fromBottom ? "top" : "bottom"] = "";
165
- }
166
- if (horizontalPosition != undefined) {
167
- this._listWrapper.style[fromRight ? "right" : "left"] = `${horizontalPosition}px`;
168
- this._listWrapper.style[fromRight ? "left" : "right"] = "";
169
- }
170
- }
171
- getListPosition() {
172
- if (this.listOptionsPosition) {
173
- return this.listOptionsPosition;
174
- }
175
- return {
176
- verticalPosition: 6
177
- };
178
- }
179
124
  isDifferentValues(firstValue, secondValue) {
180
125
  return ObjectUtils.objectToString(firstValue || {}) !== ObjectUtils.objectToString(secondValue || {});
181
126
  }
@@ -248,85 +193,24 @@ export class EzComboBox {
248
193
  }
249
194
  return 0;
250
195
  }
251
- buildItem(opt, index) {
252
- const widthValue = this.showOptionValue && this._maxWidthValue > 0 ? `${this._maxWidthValue}px` : '';
253
- opt.label = opt.label || opt.value;
254
- return h("li", { class: index === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.selectOption(opt), onMouseOver: () => this._preSelection = index }, this.showOptionValue
255
- ? h("span", { class: "item__value", title: opt.value, style: { width: widthValue, minWidth: widthValue, maxWidth: widthValue } }, opt.value)
256
- : undefined, h("span", { class: "item__label " + (this.showOptionValue ? "item__label--bold" : ""), title: opt.label }, opt.label));
257
- }
258
196
  showOptions() {
259
197
  var _a, _b;
260
198
  if (!this.enabled)
261
199
  return;
262
- if (this.isOptionsVisible()) {
263
- return;
264
- }
200
+ this.openPopover();
265
201
  const valueString = (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : this.value;
266
202
  const indexValue = this._visibleOptions.findIndex(option => option.value === valueString);
267
203
  this._preSelection = indexValue === -1 ? 0 : indexValue;
268
204
  if (!!this._resizeObserver)
269
205
  this._resizeObserver.observe(this._textInput);
270
- this._floatingID = FloatingManager.float(this._listWrapper, this._listContainer, { autoClose: true, isFixed: true, backClickListener: () => this.hideOptions() });
271
206
  this.setFocus();
272
- window.requestAnimationFrame(() => {
273
- this.updateListPosition();
274
- if (!this.listOptionsPosition) {
275
- this._listWrapper.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
276
- }
277
- });
278
207
  }
279
208
  hideOptions() {
280
- if (this._floatingID !== undefined) {
281
- FloatingManager.close(this._floatingID);
282
- }
283
- this._floatingID = undefined;
209
+ var _a;
210
+ (_a = this._popover) === null || _a === void 0 ? void 0 : _a.hide();
284
211
  if (!!this._resizeObserver)
285
212
  this._resizeObserver.unobserve(this._textInput);
286
213
  }
287
- isOptionsVisible() {
288
- return this._floatingID !== undefined && FloatingManager.isFloating(this._floatingID);
289
- }
290
- nextOption() {
291
- if (!this.isOptionsVisible()) {
292
- return;
293
- }
294
- this.showOptions();
295
- this._preSelection = this._preSelection === undefined ? 0 : Math.min(this._preSelection + 1, this._visibleOptions.length - 1);
296
- this.scrollToOption(this._visibleOptions[this._preSelection]);
297
- }
298
- previousOption() {
299
- this._preSelection = this._preSelection === undefined ? 0 : Math.max(this._preSelection - 1, 0);
300
- this.scrollToOption(this._visibleOptions[this._preSelection]);
301
- }
302
- scrollToOption(opt) {
303
- window.requestAnimationFrame(() => {
304
- const liElem = (opt === null || opt === void 0 ? void 0 : opt.value) ? this._optionsList.querySelector(`li#item_${opt.value.replace(/[<>\[\]#=]/g, '\\$&').replace(/:/g, '\\:')}`) : undefined;
305
- if (liElem)
306
- liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
307
- });
308
- }
309
- selectCurrentOption(focusOnInput = true) {
310
- if (this._preSelection !== undefined) {
311
- this.selectOption(this._visibleOptions[this._preSelection], focusOnInput);
312
- this._preSelection = undefined;
313
- }
314
- else {
315
- this.controlListWithOnlyOne(focusOnInput);
316
- }
317
- }
318
- controlListWithOnlyOne(focusOnInput = true) {
319
- var _a;
320
- const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
321
- if ((source === null || source === void 0 ? void 0 : source.length) > 0) {
322
- let title = StringUtils.decodeHtmlEntities(source[0].label);
323
- const option = {
324
- value: source[0].value,
325
- label: title,
326
- };
327
- this.selectOption(option, focusOnInput);
328
- }
329
- }
330
214
  updateSource(source) {
331
215
  this._startLoading = false;
332
216
  if (source instanceof Promise) {
@@ -352,12 +236,13 @@ export class EzComboBox {
352
236
  }
353
237
  }
354
238
  selectOption(newOption, focusOnInput = true) {
355
- var _a, _b;
239
+ var _a, _b, _c;
356
240
  const currentValue = this.getSelectedOption(this.value);
357
241
  if ((((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOption === null || newOption === void 0 ? void 0 : newOption.value) === null || _b === void 0 ? void 0 : _b.toString()))
358
242
  || (currentValue == undefined && newOption != undefined && "value" in newOption)) {
359
243
  const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
360
244
  this.value = adjustedOpt;
245
+ (_c = this._popover) === null || _c === void 0 ? void 0 : _c.hide();
361
246
  }
362
247
  else {
363
248
  this.resetOptions();
@@ -410,6 +295,11 @@ export class EzComboBox {
410
295
  //---------------------------------------------
411
296
  // Lifecycle web component
412
297
  //---------------------------------------------
298
+ componentDidRender() {
299
+ if (this._textInput) {
300
+ this._textInputReady = true;
301
+ }
302
+ }
413
303
  componentWillLoad() {
414
304
  if (this.options === undefined) {
415
305
  this.options = [];
@@ -428,15 +318,6 @@ export class EzComboBox {
428
318
  }
429
319
  this.loadOptions(SearchMode.PRELOAD);
430
320
  }
431
- componentDidRender() {
432
- var _a;
433
- if (this._floatingID === undefined) {
434
- this._listWrapper.remove();
435
- }
436
- (_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
437
- ElementIDUtils.addIDInfoIfNotExists(elem, "itemComboBox");
438
- });
439
- }
440
321
  componentDidLoad() {
441
322
  CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
442
323
  this.setInputValue(false);
@@ -444,10 +325,12 @@ export class EzComboBox {
444
325
  window.requestAnimationFrame(() => {
445
326
  if (!Array.isArray(entries) || !entries.length)
446
327
  return;
447
- const { clientWidth } = this._listContainer;
448
- if (clientWidth > 0 && !!this._listWrapper) {
449
- this._listWrapper.style.width = `${clientWidth}px`;
450
- }
328
+ if (!this._textInput)
329
+ return;
330
+ if (!this._comboBoxList)
331
+ return;
332
+ const textInputWidth = this._textInput.clientWidth;
333
+ this._comboBoxList.width = textInputWidth;
451
334
  });
452
335
  });
453
336
  if (this.autoFocus) {
@@ -456,6 +339,13 @@ export class EzComboBox {
456
339
  });
457
340
  }
458
341
  }
342
+ disconnectedCallback() {
343
+ var _a;
344
+ (_a = this._popover) === null || _a === void 0 ? void 0 : _a.remove();
345
+ if (this._resizeObserver) {
346
+ this._resizeObserver.disconnect();
347
+ }
348
+ }
459
349
  //---------------------------------------------
460
350
  // Event handlers
461
351
  //---------------------------------------------
@@ -495,65 +385,48 @@ export class EzComboBox {
495
385
  this.showOptions();
496
386
  }
497
387
  keyDownHandler(event) {
498
- this._tabPressed = false;
499
- if (event.ctrlKey) {
500
- if (event.key === "f" || event.key === "F") {
501
- this.loadOptions(SearchMode.ADVANCED);
502
- //ATENÇÃO: Ctrl + F tem ação específica nos browsers
503
- //nesse caso, como vamos abrir o popup de busca avançada,
504
- //não é interessante deixar o evento propagar;
505
- event.stopPropagation();
506
- event.stopImmediatePropagation();
507
- event.preventDefault();
508
- }
388
+ var _a, _b, _c, _d, _e, _f;
389
+ if (event.ctrlKey && (event.key === "f" || event.key === "F")) {
390
+ this.loadOptions(SearchMode.ADVANCED);
391
+ event.preventDefault();
392
+ event.stopPropagation();
393
+ return;
509
394
  }
510
395
  switch (event.key) {
511
396
  case "ArrowDown":
512
- event.stopPropagation();
513
- if (this.canShowListOptions())
514
- event.preventDefault();
515
- this.showOptions();
516
- this.nextOption();
397
+ event.preventDefault();
398
+ if (this.canShowListOptions()) {
399
+ this.showOptions();
400
+ (_a = this._comboBoxList) === null || _a === void 0 ? void 0 : _a.nextOption();
401
+ }
517
402
  break;
518
403
  case "ArrowUp":
519
- event.stopPropagation();
520
- if (this.canShowListOptions())
521
- event.preventDefault();
522
- this.showOptions();
523
- this.previousOption();
404
+ event.preventDefault();
405
+ if (this.canShowListOptions()) {
406
+ this.showOptions();
407
+ (_b = this._comboBoxList) === null || _b === void 0 ? void 0 : _b.previousOption();
408
+ }
524
409
  break;
525
410
  case "Enter":
526
- this.handleEventPropagation(event);
527
- if (this.isOptionsVisible()) {
528
- this.selectCurrentOption();
411
+ if (this.isOpen) {
412
+ event.preventDefault();
413
+ (_c = this._comboBoxList) === null || _c === void 0 ? void 0 : _c.selectCurrentOption();
529
414
  }
530
415
  break;
531
416
  case "Escape":
532
- if (this.isOptionsVisible()) {
533
- event.stopPropagation();
417
+ if (this.isOpen) {
418
+ event.preventDefault();
419
+ (_d = this._popover) === null || _d === void 0 ? void 0 : _d.hide();
534
420
  }
535
- this.cancelPreselection();
536
- this.resetOptions();
537
421
  break;
538
422
  case "Tab":
539
423
  this._tabPressed = true;
540
- if (this.isOptionsVisible()) {
541
- this.selectCurrentOption(false);
424
+ if (this.isOpen) {
425
+ (_e = this._comboBoxList) === null || _e === void 0 ? void 0 : _e.selectCurrentOption();
426
+ (_f = this._popover) === null || _f === void 0 ? void 0 : _f.hide();
542
427
  }
543
- this.resetOptions();
544
428
  break;
545
429
  }
546
- //ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
547
- //Por exemplo, quando o usuário dá um Enter, além de selecionar
548
- //um valor, também significa que a ateração finalizou,
549
- //e o contexto pode reagir (fechar um popup por exemplo).
550
- //event.stopPropagation();
551
- }
552
- //O evento deve ter sua propagação interrompida, apenas se a lista de opções estiver sendo exibida.
553
- handleEventPropagation(event) {
554
- if (this._listContainer.hasChildNodes() && this.stopPropagateEnterKeyEvent) {
555
- event.stopPropagation();
556
- }
557
430
  }
558
431
  onTextInputFocusOutHandler() {
559
432
  if (this.hideErrorOnFocusOut)
@@ -562,14 +435,15 @@ export class EzComboBox {
562
435
  canShowListOptions() {
563
436
  return !this._showLoading && this._visibleOptions.length > 0;
564
437
  }
438
+ openPopover() {
439
+ var _a;
440
+ this.isOpen = true;
441
+ (_a = this._popover) === null || _a === void 0 ? void 0 : _a.show();
442
+ }
565
443
  render() {
444
+ var _a;
566
445
  ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
567
- return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: `text-input-slot-container ${this.suppressSearch ? "suppressed-search-input" : ""}`, ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, h("button", { class: "btn", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, h("ez-icon", { iconName: "chevron-down" }))), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this._showLoading
568
- && this._visibleOptions.length === 0
569
- && h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
570
- && h("div", { class: "message" }, h("div", { class: "message__loading" })), this.showOptionValue
571
- ? h("span", { class: "item__value item__value--hidden", ref: elem => this._itemValueBasis = elem })
572
- : undefined, this.canShowListOptions() && this._visibleOptions.map((opt, index) => this.buildItem(opt, index)))))));
446
+ return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: `text-input-slot-container ${this.suppressSearch ? "suppressed-search-input" : ""}`, ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, h("button", { class: "btn", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, h("ez-icon", { iconName: "chevron-down" }))), h("ez-popover-plus", { ref: elem => this._popover = elem, anchorElement: this._textInput, autoClose: true, boxWidth: 'fit-content', overlayType: 'none', onEzVisibilityChange: event => this.isOpen = event.detail }, h("ez-combo-box-list", { ref: ref => this._comboBoxList = ref, showLoading: this._showLoading, visibleOptions: this._visibleOptions, textEmptyList: this._textEmptyList, showOptionValue: this.showOptionValue, preSelection: this._preSelection, maxWidth: this._maxWidthValue, width: (_a = this._textInput) === null || _a === void 0 ? void 0 : _a.clientWidth, onOptionSelect: (opt) => this.selectOption(opt), onOptionHover: (index) => this._preSelection = index }))));
573
447
  }
574
448
  static get is() { return "ez-combo-box"; }
575
449
  static get encapsulation() { return "shadow"; }
@@ -929,11 +803,13 @@ export class EzComboBox {
929
803
  }
930
804
  static get states() {
931
805
  return {
806
+ "isOpen": {},
932
807
  "_preSelection": {},
933
808
  "_visibleOptions": {},
934
809
  "_startLoading": {},
935
810
  "_showLoading": {},
936
- "_criteria": {}
811
+ "_criteria": {},
812
+ "_textInputReady": {}
937
813
  };
938
814
  }
939
815
  static get events() {
@@ -1062,15 +938,6 @@ export class EzComboBox {
1062
938
  "methodName": "observeOptions"
1063
939
  }];
1064
940
  }
1065
- static get listeners() {
1066
- return [{
1067
- "name": "scroll",
1068
- "method": "scrollListener",
1069
- "target": "window",
1070
- "capture": true,
1071
- "passive": true
1072
- }];
1073
- }
1074
941
  }
1075
942
  var SearchMode;
1076
943
  (function (SearchMode) {
@@ -1106,6 +1106,9 @@ export default class AgGridController {
1106
1106
  if (cfgColumn.customWidth != undefined) {
1107
1107
  return cfgColumn.customWidth;
1108
1108
  }
1109
+ if (cfgColumn.width != undefined) {
1110
+ return cfgColumn.width;
1111
+ }
1109
1112
  const field = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(cfgColumn.name);
1110
1113
  if ((field === null || field === void 0 ? void 0 : field.userInterface) === UserInterface.SEARCH) {
1111
1114
  return this.DEFAULT_MAX_SIZE;
@@ -1,4 +1,4 @@
1
- import { ElementIDUtils, JSUtils, OverflowWatcher, OVERFLOWED_CLASS_NAME, StringUtils, ApplicationContext, } from '@sankhyalabs/core';
1
+ import { ElementIDUtils, JSUtils, OverflowWatcher, OVERFLOWED_CLASS_NAME, StringUtils, ApplicationContext, KeyboardManager, } from '@sankhyalabs/core';
2
2
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
3
3
  import { Host, h } from '@stencil/core';
4
4
  import { ApplicationUtils } from '../../utils';
@@ -362,6 +362,20 @@ export class EzGrid {
362
362
  .then(() => this.resetPaginationState());
363
363
  }
364
364
  }
365
+ nextRecord() {
366
+ if (this.dataUnit) {
367
+ if (this.dataUnit.getSelectionInfo().records.length === 0) {
368
+ this.dataUnit.selectFirst();
369
+ return;
370
+ }
371
+ this.dataUnit.nextRecord();
372
+ }
373
+ }
374
+ previousRecord() {
375
+ if (this.dataUnit) {
376
+ this.dataUnit.previousRecord();
377
+ }
378
+ }
365
379
  resetPaginationState() {
366
380
  var _a;
367
381
  this._paginationChangedByKeyboard = false;
@@ -444,6 +458,7 @@ export class EzGrid {
444
458
  this._gridController.configFilterColumn(this._filterColumn);
445
459
  if (this.paginationCounterMode === 'auto')
446
460
  this._initHeaderOverflowWatcher();
461
+ this.initKeyboardManager();
447
462
  }
448
463
  handlePaginationChange(selectFirstRecord, paginationInfo) {
449
464
  var _a;
@@ -510,6 +525,7 @@ export class EzGrid {
510
525
  var _a, _b;
511
526
  (_a = this._headerOverflowWatcher) === null || _a === void 0 ? void 0 : _a.destroy();
512
527
  (_b = this._gridController) === null || _b === void 0 ? void 0 : _b.destroy();
528
+ this.removeShortcuts();
513
529
  }
514
530
  connectedCallback() {
515
531
  var _a;
@@ -548,6 +564,45 @@ export class EzGrid {
548
564
  return "left__header-expanded";
549
565
  return "left__header-contracted";
550
566
  }
567
+ async initKeyboardManager() {
568
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
569
+ this._keyboardManager
570
+ .bind("ctrl + .", () => {
571
+ if (!this._paginationInfo)
572
+ return;
573
+ this.nextRecord();
574
+ }, { description: "Avança para o próximo registro.", element: this._element })
575
+ .bind("ctrl + ,", () => {
576
+ if (!this._paginationInfo)
577
+ return;
578
+ this.previousRecord();
579
+ }, { description: "Retorna ao registro anterior.", element: this._element })
580
+ .bind("ctrl + alt + ArrowLeft", () => {
581
+ if (!this._paginationInfo)
582
+ return;
583
+ const { currentPage } = this._paginationInfo;
584
+ if (currentPage > 0) {
585
+ this.previousPage();
586
+ }
587
+ }, { description: "Retorna a pagina anterior.", element: this._element })
588
+ .bind("ctrl + alt + ArrowRight", () => {
589
+ if (!this._paginationInfo)
590
+ return;
591
+ const { hasMore } = this._paginationInfo;
592
+ if (hasMore) {
593
+ this.nextPage();
594
+ }
595
+ }, { description: "Avança para a próxima página.", element: this._element });
596
+ }
597
+ async removeShortcuts() {
598
+ if (this._keyboardManager) {
599
+ this._keyboardManager
600
+ .unbind("ctrl + .")
601
+ .unbind("ctrl + ,")
602
+ .unbind("ctrl + alt + ArrowLeft")
603
+ .unbind("ctrl + alt + ArrowRight");
604
+ }
605
+ }
551
606
  render() {
552
607
  var _a;
553
608
  return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: {
@@ -38,6 +38,10 @@ svg {
38
38
  height: 30px;
39
39
  }
40
40
 
41
+ [class^="ez-icon-"], [class*=" ez-icon-"] {
42
+ color: var(--ez-icon--color);
43
+ }
44
+
41
45
  /*
42
46
  START CSS GENERATED BY EZ-DESIGN ICONS, SEE MORE AT ez-design\scripts\fontsGenerator.js.
43
47
  WHEN ADD NEW ICONS THIS CSS NEED TO BE UPDATED
@@ -46,7 +50,6 @@ svg {
46
50
  font-family: 'ez-icons' !important;
47
51
  font-size:16px;
48
52
  font-style:normal;
49
- color: var(--ez-icon--color);
50
53
  -webkit-font-smoothing: antialiased;
51
54
  -moz-osx-font-smoothing: grayscale;
52
55
  }
@@ -1,67 +1,3 @@
1
1
  :host {
2
-
3
- /* box */
4
- /*@doc Define o raio da borda do popover.*/
5
- --ez-popover__box--border-radius: var(--border--radius-medium, 12px);
6
- /*@doc Define a sombra do popover.*/
7
- --ez-popover__box--box-shadow: var(--shadow, 0px 0px 16px 0px #000);
8
- /*@doc Define a cor de fundo do popover.*/
9
- --ez-popover__box--background-color: var(--background--xlight, #fff);
10
- /*@doc Define a camada de visibilidade do popover.*/
11
- --ez-popover__box--z-index: var(--most-visible, 4);
12
-
13
- /***************
14
- host style
15
- ***************/
16
- /*private*/
17
- position: relative;
18
- display: flex;
19
- user-select: none;
20
- }
21
-
22
- .popover__overlay {
23
2
  display: none;
24
- position: fixed;
25
- padding: 0;
26
- top: 0px;
27
- left: 0px;
28
- width: 100%;
29
- height: 100vh;
30
- box-sizing: border-box;
31
- z-index: var(--more-visible--2x, 3);
32
- }
33
-
34
- .popover__overlay--light {
35
- background-color: rgba(var(--rgb-background--overlay), var(--opacity--bright));
36
- }
37
-
38
- .popover__overlay--medium {
39
- background-color: rgba(var(--rgb-background--overlay), var(--opacity--soft));
40
- backdrop-filter: blur(var(--background-blur--medium));
41
- }
42
-
43
- .popover__box {
44
- /*private*/
45
- display: none;
46
- position: fixed;
47
- top: 0;
48
- left: 0;
49
-
50
- z-index: var(--ez-popover__box--z-index);
51
- flex-direction: column;
52
-
53
- height: fit-content;
54
-
55
- /*public*/
56
- background-color: var(--ez-popover__box--background-color);
57
- border-radius: var(--ez-popover__box--border-radius);
58
- box-shadow: var(--ez-popover__box--box-shadow);
59
- }
60
-
61
- .popover__box--fit-content {
62
- width: fit-content;
63
- }
64
-
65
- .popover__box--full-width {
66
- width: calc(100% - 10px);
67
3
  }