@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-75940.1 → 0.0.0-bugfix-dev-KB-84596.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 (39) hide show
  1. package/dist/cjs/ez-grid.cjs.entry.js +31 -59
  2. package/dist/cjs/ez-list.cjs.entry.js +2 -2
  3. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-popover-plus_3.cjs.entry.js +6 -1
  6. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  7. package/dist/collection/components/ez-grid/ez-grid.js +6 -3
  8. package/dist/collection/components/ez-grid/utils/ColumnFilterManager.js +7 -54
  9. package/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource.js +20 -4
  10. package/dist/collection/components/ez-list/ez-list.js +2 -2
  11. package/dist/collection/components/ez-modal/ez-modal.js +1 -1
  12. package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
  13. package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +6 -1
  14. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +1 -1
  15. package/dist/collection/components/ez-popup/ez-popup.js +1 -1
  16. package/dist/custom-elements/index.js +43 -66
  17. package/dist/esm/ez-grid.entry.js +32 -60
  18. package/dist/esm/ez-list.entry.js +2 -2
  19. package/dist/esm/ez-modal-container.entry.js +1 -1
  20. package/dist/esm/ez-modal.entry.js +1 -1
  21. package/dist/esm/ez-popover-plus_3.entry.js +6 -1
  22. package/dist/esm/ez-popup.entry.js +1 -1
  23. package/dist/ezui/ezui.esm.js +1 -1
  24. package/dist/ezui/p-17eabf46.entry.js +1 -0
  25. package/dist/ezui/p-1ad6c61b.entry.js +1 -0
  26. package/dist/ezui/p-3195a7a7.entry.js +1 -0
  27. package/dist/ezui/p-a69355eb.entry.js +1 -0
  28. package/dist/ezui/p-cb1535f7.entry.js +1 -0
  29. package/dist/ezui/{p-664b91e8.entry.js → p-cb5cd243.entry.js} +46 -46
  30. package/dist/types/components/ez-grid/utils/ColumnFilterManager.d.ts +1 -1
  31. package/dist/types/components/ez-grid/utils/InMemoryFilterColumnDataSource.d.ts +3 -0
  32. package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +1 -1
  33. package/dist/types/components.d.ts +2 -2
  34. package/package.json +1 -1
  35. package/dist/ezui/p-0bffeffc.entry.js +0 -1
  36. package/dist/ezui/p-248d4f54.entry.js +0 -1
  37. package/dist/ezui/p-4e0628a7.entry.js +0 -1
  38. package/dist/ezui/p-84b1c99e.entry.js +0 -1
  39. package/dist/ezui/p-e5c3ed19.entry.js +0 -1
@@ -65897,82 +65897,51 @@ function getElementID(sufix) {
65897
65897
  };
65898
65898
  }
65899
65899
 
65900
- const COLUMN_FILTER_PATTERN = /FILTRO_COLUNA_(.+)/;
65901
65900
  class ColumnFilterManager {
65902
65901
  static getColumnFilters(filters, fieldName) {
65903
- const columnFilters = new Map();
65904
- if (filters == undefined || filters.length == 0) {
65905
- return columnFilters;
65906
- }
65907
- filters.forEach(filter => {
65908
- const result = COLUMN_FILTER_PATTERN.exec(filter.name);
65909
- if (result) {
65910
- if (fieldName !== result[1]) {
65911
- columnFilters.set(filter.name, Object.assign({ columnName: result[1] }, filter));
65912
- }
65913
- }
65914
- });
65915
- return columnFilters;
65902
+ return core.ColumnFilterManager.getColumnFilters(filters, fieldName);
65916
65903
  }
65917
65904
  static getFilterFunction(dataUnit, filters) {
65918
- if (filters != undefined && filters.length > 0) {
65919
- return record => {
65920
- for (const filter of filters) {
65921
- if (!ColumnFilterManager.recordMatchesFilter(dataUnit, record, filter)) {
65922
- return false;
65923
- }
65924
- }
65925
- return true;
65926
- };
65927
- }
65928
- return undefined;
65929
- }
65930
- static recordMatchesFilter(dataUnit, record, columnFilter) {
65931
- const fieldValue = record[columnFilter.columnName];
65932
- for (let param of columnFilter.params) {
65933
- const paramValue = dataUnit.valueFromString(columnFilter.columnName, param.value);
65934
- if (core.FieldComparator.compareValues(dataUnit.getField(columnFilter.columnName), fieldValue, paramValue) === 0) {
65935
- return true;
65936
- }
65937
- }
65938
- return false;
65905
+ return core.ColumnFilterManager.getFilterFunction(dataUnit, filters);
65939
65906
  }
65940
65907
  static compileDistinct(fieldName, dataUnit) {
65941
- const request = dataUnit.getLastLoadRequest();
65942
- let list = dataUnit.records;
65943
- if (request != undefined) {
65944
- const columnFilters = Array.from(ColumnFilterManager.getColumnFilters(request.filters, fieldName).values());
65945
- const filterFunciton = ColumnFilterManager.getFilterFunction(dataUnit, columnFilters);
65946
- if (filterFunciton != undefined) {
65947
- list = list.filter(filterFunciton);
65948
- }
65949
- }
65950
- const distinct = new Map(list.map(record => {
65951
- const fieldValue = record[fieldName];
65952
- if (fieldValue == undefined) {
65953
- return [null, { label: null, value: null, check: true }];
65954
- }
65955
- const item = { label: dataUnit.getFormattedValue(fieldName, fieldValue), value: fieldValue, check: true };
65956
- return [item.label, item];
65957
- }));
65958
- return Array.from(distinct.values());
65908
+ return core.ColumnFilterManager.compileDistinct(fieldName, dataUnit);
65909
+ }
65910
+ static compileDistinctFromArray(fieldName, dataUnit, records) {
65911
+ return core.ColumnFilterManager.compileDistinctFromArray(fieldName, dataUnit, records);
65959
65912
  }
65960
65913
  }
65961
65914
 
65962
65915
  class InMemoryFilterColumnDataSource {
65963
65916
  constructor(dataUnit) {
65964
- var _a;
65917
+ this.lastAppliedFilters = [];
65918
+ this.FILTER_COLUMN_TERM = 'FILTRO_COLUNA_';
65965
65919
  this.onDataUnitAction = (action) => {
65920
+ var _a, _b;
65966
65921
  if (action.type === core.Action.DATA_SAVED || action.type === core.Action.RECORDS_REMOVED) {
65967
65922
  this.originalRecords = this.dataUnit.records;
65923
+ return;
65968
65924
  }
65925
+ if (action.type !== core.Action.DATA_LOADED)
65926
+ return;
65927
+ const appliedFilters = this.getAppliedFilterNames((_b = (_a = action.payload) === null || _a === void 0 ? void 0 : _a.filters) !== null && _b !== void 0 ? _b : []);
65928
+ if (this.originalRecords && core.ObjectUtils.equals(appliedFilters, this.lastAppliedFilters))
65929
+ return;
65930
+ this.originalRecords = action.payload.records;
65931
+ this.lastAppliedFilters = appliedFilters;
65969
65932
  };
65970
65933
  this.dataUnit = dataUnit;
65971
- this.originalRecords = (_a = this.dataUnit.records) !== null && _a !== void 0 ? _a : [];
65934
+ if (this.dataUnit.records.length > 0) {
65935
+ this.originalRecords = this.dataUnit.records;
65936
+ }
65972
65937
  this.dataUnit.subscribe(this.onDataUnitAction);
65973
65938
  }
65939
+ getAppliedFilterNames(filters) {
65940
+ const appliedFilters = filters.map(filter => filter.name);
65941
+ return appliedFilters.filter(filterName => !filterName.includes(this.FILTER_COLUMN_TERM));
65942
+ }
65974
65943
  getStaticOptions(fieldName) {
65975
- return Promise.resolve(ColumnFilterManager.compileDistinct(fieldName, this.dataUnit));
65944
+ return Promise.resolve(ColumnFilterManager.compileDistinctFromArray(fieldName, this.dataUnit, this.originalRecords));
65976
65945
  }
65977
65946
  fetchData(filterTerm, fieldName) {
65978
65947
  return new Promise(resolve => {
@@ -66537,7 +66506,8 @@ const EzGrid = class {
66537
66506
  return `${total == undefined ? ` de ${count + 1} ou mais` : ` de ${total}`}`;
66538
66507
  }
66539
66508
  _hasToShowCancelPagination() {
66540
- const { total, count } = this._paginationInfo;
66509
+ var _a;
66510
+ const { total, count } = (_a = this._paginationInfo) !== null && _a !== void 0 ? _a : {};
66541
66511
  const hasMore = (total === undefined);
66542
66512
  return !this.dataUnit.cancelPagination && hasMore && count > this.dataUnit.pageSize;
66543
66513
  }
@@ -66608,8 +66578,10 @@ const EzGrid = class {
66608
66578
  }
66609
66579
  }
66610
66580
  getDataSource() {
66611
- var _a;
66612
- return (_a = this.columnfilterDataSource) !== null && _a !== void 0 ? _a : new InMemoryFilterColumnDataSource(this.dataUnit);
66581
+ if (!this.columnfilterDataSource) {
66582
+ this.columnfilterDataSource = new InMemoryFilterColumnDataSource(this.dataUnit);
66583
+ }
66584
+ return this.columnfilterDataSource;
66613
66585
  }
66614
66586
  hideHeader() {
66615
66587
  return !this._hasLeftButtons && !this._paginationInfo;
@@ -589,7 +589,7 @@ const EzList = class {
589
589
  return { id: item.id, label: item.label, check: evt.detail };
590
590
  }
591
591
  renderListWithGroups() {
592
- return index.h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex: this.ezSelectable ? 0 : undefined, onKeyDown: event => this.keyDownHandler(event) }, this._listGroupItems.map(group => {
592
+ return index.h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => this.keyDownHandler(event) }, this._listGroupItems.map(group => {
593
593
  return (index.h("div", { id: this.getDivGroupId(group.group), class: 'group', key: group.group + group.items.length, onDrop: () => this.onDropGroup(group) }, index.h("label", { draggable: false, class: 'group-name', title: group.group }, group.group), index.h("section", { class: 'section-container', onDragOver: ev => ev.preventDefault() }, index.h("div", { class: 'group-items-container' }, index.h("div", { class: 'draggable-list' }, group.items.map((item, index$1) => (index.h("li", Object.assign({ id: 'item_' + item.id, class: {
594
594
  'selectable-container': this.ezSelectable,
595
595
  'hover-feedback': this.hoverFeedback,
@@ -599,7 +599,7 @@ const EzList = class {
599
599
  }));
600
600
  }
601
601
  renderList() {
602
- return index.h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex: this.ezSelectable ? 0 : undefined, onKeyDown: event => {
602
+ return index.h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex: 0, onKeyDown: event => {
603
603
  this.keyDownHandler(event);
604
604
  } }, index.h("div", { class: 'draggable-list' }, this._listItems.map((item, index$1) => (index.h("li", Object.assign({ id: 'item_' + item.id, class: {
605
605
  'selectable-container': this.ezSelectable,
@@ -72,7 +72,7 @@ const EzModalContainer = class {
72
72
  this._closeButton.focus();
73
73
  }
74
74
  render() {
75
- return (index.h(index.Host, null, index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), index.h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (index.h("div", { class: "ez-modal-container__header ez-margin-bottom--medium" }, index.h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, index.h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (index.h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), (this.showCloseButton && index.h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, index.h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), index.h("div", { tabIndex: -1, class: "ez-modal-container__content" }, index.h("slot", null)), index.h("div", { tabIndex: -1, class: "ez-modal-container__footer" }, this.cancelIsVisible() && (index.h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (index.h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.OK) }))), index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
75
+ return (index.h(index.Host, null, index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), index.h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (index.h("div", { class: "ez-modal-container__header ez-margin-bottom--medium" }, index.h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, index.h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (index.h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), (this.showCloseButton && index.h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, index.h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), index.h("div", { class: "ez-modal-container__content" }, index.h("slot", null)), index.h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (index.h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (index.h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.OK) }))), index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
76
76
  }
77
77
  get _element() { return index.getElement(this); }
78
78
  };
@@ -36,7 +36,7 @@ const EzModal = class {
36
36
  }
37
37
  componentDidLoad() {
38
38
  this.observeOpened();
39
- new core.KeyboardManager({ propagate: false, element: this._element, enableShadowDom: true })
39
+ new core.KeyboardManager({ propagate: false, element: this._element })
40
40
  .bind("Enter", this.ezModalAction.emit.bind("OK"))
41
41
  .bind("Escape", () => this.closeModal())
42
42
  .bind("Esc", () => this.closeModal());
@@ -72,8 +72,10 @@ const EzPopoverPlus = class {
72
72
  async setAnchorElement(anchor) {
73
73
  var _a;
74
74
  await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.setAnchorElement(anchor));
75
+ this.anchorElement = anchor;
75
76
  }
76
77
  renderPopoverCore() {
78
+ var _a;
77
79
  this._popOverCore = document.createElement('ez-popover-core');
78
80
  this._popOverCore.opened = this.opened;
79
81
  this._popOverCore.anchorElement = this.anchorElement;
@@ -94,7 +96,10 @@ const EzPopoverPlus = class {
94
96
  else {
95
97
  console.warn('O slot do popover está vazio. Adicione conteúdo ao slot para exibição correta.');
96
98
  }
97
- document.body.appendChild(this._popOverCore);
99
+ const root = document.body.querySelector("#root");
100
+ const firstDiv = document.body.getElementsByTagName("div").item(0);
101
+ const parentElement = (_a = root !== null && root !== void 0 ? root : firstDiv) !== null && _a !== void 0 ? _a : document.body;
102
+ parentElement.appendChild(this._popOverCore);
98
103
  }
99
104
  render() {
100
105
  return (index.h(index.Host, null, index.h("slot", null)));
@@ -35,7 +35,7 @@ const EzPopup = class {
35
35
  if (this.opened && this._popupRef) {
36
36
  this._popupRef.focus();
37
37
  }
38
- new core.KeyboardManager({ propagate: false, element: this._element, enableShadowDom: true })
38
+ new core.KeyboardManager({ propagate: false, element: this._element })
39
39
  .bind("Enter", this.ezPopupAction.emit.bind("OK"))
40
40
  .bind("Escape", () => this.closePopup())
41
41
  .bind("Esc", () => this.closePopup());
@@ -482,7 +482,8 @@ export class EzGrid {
482
482
  return `${total == undefined ? ` de ${count + 1} ou mais` : ` de ${total}`}`;
483
483
  }
484
484
  _hasToShowCancelPagination() {
485
- const { total, count } = this._paginationInfo;
485
+ var _a;
486
+ const { total, count } = (_a = this._paginationInfo) !== null && _a !== void 0 ? _a : {};
486
487
  const hasMore = (total === undefined);
487
488
  return !this.dataUnit.cancelPagination && hasMore && count > this.dataUnit.pageSize;
488
489
  }
@@ -553,8 +554,10 @@ export class EzGrid {
553
554
  }
554
555
  }
555
556
  getDataSource() {
556
- var _a;
557
- return (_a = this.columnfilterDataSource) !== null && _a !== void 0 ? _a : new InMemoryFilterColumnDataSource(this.dataUnit);
557
+ if (!this.columnfilterDataSource) {
558
+ this.columnfilterDataSource = new InMemoryFilterColumnDataSource(this.dataUnit);
559
+ }
560
+ return this.columnfilterDataSource;
558
561
  }
559
562
  hideHeader() {
560
563
  return !this._hasLeftButtons && !this._paginationInfo;
@@ -1,62 +1,15 @@
1
- import { FieldComparator } from "@sankhyalabs/core";
2
- const COLUMN_FILTER_PATTERN = /FILTRO_COLUNA_(.+)/;
1
+ import { ColumnFilterManager as CoreColumnFilterManager } from "@sankhyalabs/core";
3
2
  export class ColumnFilterManager {
4
3
  static getColumnFilters(filters, fieldName) {
5
- const columnFilters = new Map();
6
- if (filters == undefined || filters.length == 0) {
7
- return columnFilters;
8
- }
9
- filters.forEach(filter => {
10
- const result = COLUMN_FILTER_PATTERN.exec(filter.name);
11
- if (result) {
12
- if (fieldName !== result[1]) {
13
- columnFilters.set(filter.name, Object.assign({ columnName: result[1] }, filter));
14
- }
15
- }
16
- });
17
- return columnFilters;
4
+ return CoreColumnFilterManager.getColumnFilters(filters, fieldName);
18
5
  }
19
6
  static getFilterFunction(dataUnit, filters) {
20
- if (filters != undefined && filters.length > 0) {
21
- return record => {
22
- for (const filter of filters) {
23
- if (!ColumnFilterManager.recordMatchesFilter(dataUnit, record, filter)) {
24
- return false;
25
- }
26
- }
27
- return true;
28
- };
29
- }
30
- return undefined;
31
- }
32
- static recordMatchesFilter(dataUnit, record, columnFilter) {
33
- const fieldValue = record[columnFilter.columnName];
34
- for (let param of columnFilter.params) {
35
- const paramValue = dataUnit.valueFromString(columnFilter.columnName, param.value);
36
- if (FieldComparator.compareValues(dataUnit.getField(columnFilter.columnName), fieldValue, paramValue) === 0) {
37
- return true;
38
- }
39
- }
40
- return false;
7
+ return CoreColumnFilterManager.getFilterFunction(dataUnit, filters);
41
8
  }
42
9
  static compileDistinct(fieldName, dataUnit) {
43
- const request = dataUnit.getLastLoadRequest();
44
- let list = dataUnit.records;
45
- if (request != undefined) {
46
- const columnFilters = Array.from(ColumnFilterManager.getColumnFilters(request.filters, fieldName).values());
47
- const filterFunciton = ColumnFilterManager.getFilterFunction(dataUnit, columnFilters);
48
- if (filterFunciton != undefined) {
49
- list = list.filter(filterFunciton);
50
- }
51
- }
52
- const distinct = new Map(list.map(record => {
53
- const fieldValue = record[fieldName];
54
- if (fieldValue == undefined) {
55
- return [null, { label: null, value: null, check: true }];
56
- }
57
- const item = { label: dataUnit.getFormattedValue(fieldName, fieldValue), value: fieldValue, check: true };
58
- return [item.label, item];
59
- }));
60
- return Array.from(distinct.values());
10
+ return CoreColumnFilterManager.compileDistinct(fieldName, dataUnit);
11
+ }
12
+ static compileDistinctFromArray(fieldName, dataUnit, records) {
13
+ return CoreColumnFilterManager.compileDistinctFromArray(fieldName, dataUnit, records);
61
14
  }
62
15
  }
@@ -1,19 +1,35 @@
1
- import { Action, ArrayUtils, DataType, DateUtils, FieldComparator, UserInterface } from '@sankhyalabs/core';
1
+ import { Action, ArrayUtils, DataType, DateUtils, FieldComparator, ObjectUtils, UserInterface, } from '@sankhyalabs/core';
2
2
  import { ColumnFilterManager } from './ColumnFilterManager';
3
3
  export default class InMemoryFilterColumnDataSource {
4
4
  constructor(dataUnit) {
5
- var _a;
5
+ this.lastAppliedFilters = [];
6
+ this.FILTER_COLUMN_TERM = 'FILTRO_COLUNA_';
6
7
  this.onDataUnitAction = (action) => {
8
+ var _a, _b;
7
9
  if (action.type === Action.DATA_SAVED || action.type === Action.RECORDS_REMOVED) {
8
10
  this.originalRecords = this.dataUnit.records;
11
+ return;
9
12
  }
13
+ if (action.type !== Action.DATA_LOADED)
14
+ return;
15
+ const appliedFilters = this.getAppliedFilterNames((_b = (_a = action.payload) === null || _a === void 0 ? void 0 : _a.filters) !== null && _b !== void 0 ? _b : []);
16
+ if (this.originalRecords && ObjectUtils.equals(appliedFilters, this.lastAppliedFilters))
17
+ return;
18
+ this.originalRecords = action.payload.records;
19
+ this.lastAppliedFilters = appliedFilters;
10
20
  };
11
21
  this.dataUnit = dataUnit;
12
- this.originalRecords = (_a = this.dataUnit.records) !== null && _a !== void 0 ? _a : [];
22
+ if (this.dataUnit.records.length > 0) {
23
+ this.originalRecords = this.dataUnit.records;
24
+ }
13
25
  this.dataUnit.subscribe(this.onDataUnitAction);
14
26
  }
27
+ getAppliedFilterNames(filters) {
28
+ const appliedFilters = filters.map(filter => filter.name);
29
+ return appliedFilters.filter(filterName => !filterName.includes(this.FILTER_COLUMN_TERM));
30
+ }
15
31
  getStaticOptions(fieldName) {
16
- return Promise.resolve(ColumnFilterManager.compileDistinct(fieldName, this.dataUnit));
32
+ return Promise.resolve(ColumnFilterManager.compileDistinctFromArray(fieldName, this.dataUnit, this.originalRecords));
17
33
  }
18
34
  fetchData(filterTerm, fieldName) {
19
35
  return new Promise(resolve => {
@@ -576,7 +576,7 @@ export class EzList {
576
576
  return { id: item.id, label: item.label, check: evt.detail };
577
577
  }
578
578
  renderListWithGroups() {
579
- return h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex: this.ezSelectable ? 0 : undefined, onKeyDown: event => this.keyDownHandler(event) }, this._listGroupItems.map(group => {
579
+ return h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => this.keyDownHandler(event) }, this._listGroupItems.map(group => {
580
580
  return (h("div", { id: this.getDivGroupId(group.group), class: 'group', key: group.group + group.items.length, onDrop: () => this.onDropGroup(group) }, h("label", { draggable: false, class: 'group-name', title: group.group }, group.group), h("section", { class: 'section-container', onDragOver: ev => ev.preventDefault() }, h("div", { class: 'group-items-container' }, h("div", { class: 'draggable-list' }, group.items.map((item, index) => (h("li", Object.assign({ id: 'item_' + item.id, class: {
581
581
  'selectable-container': this.ezSelectable,
582
582
  'hover-feedback': this.hoverFeedback,
@@ -586,7 +586,7 @@ export class EzList {
586
586
  }));
587
587
  }
588
588
  renderList() {
589
- return h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex: this.ezSelectable ? 0 : undefined, onKeyDown: event => {
589
+ return h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex: 0, onKeyDown: event => {
590
590
  this.keyDownHandler(event);
591
591
  } }, h("div", { class: 'draggable-list' }, this._listItems.map((item, index) => (h("li", Object.assign({ id: 'item_' + item.id, class: {
592
592
  'selectable-container': this.ezSelectable,
@@ -25,7 +25,7 @@ export class EzModal {
25
25
  }
26
26
  componentDidLoad() {
27
27
  this.observeOpened();
28
- new KeyboardManager({ propagate: false, element: this._element, enableShadowDom: true })
28
+ new KeyboardManager({ propagate: false, element: this._element })
29
29
  .bind("Enter", this.ezModalAction.emit.bind("OK"))
30
30
  .bind("Escape", () => this.closeModal())
31
31
  .bind("Esc", () => this.closeModal());
@@ -48,7 +48,7 @@ export class EzModalContainer {
48
48
  this._closeButton.focus();
49
49
  }
50
50
  render() {
51
- return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--medium" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), (this.showCloseButton && h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), h("div", { tabIndex: -1, class: "ez-modal-container__content" }, h("slot", null)), h("div", { tabIndex: -1, class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
51
+ return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--medium" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), (this.showCloseButton && h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
52
52
  }
53
53
  static get is() { return "ez-modal-container"; }
54
54
  static get encapsulation() { return "scoped"; }
@@ -61,8 +61,10 @@ export class EzPopoverPlus {
61
61
  async setAnchorElement(anchor) {
62
62
  var _a;
63
63
  await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.setAnchorElement(anchor));
64
+ this.anchorElement = anchor;
64
65
  }
65
66
  renderPopoverCore() {
67
+ var _a;
66
68
  this._popOverCore = document.createElement('ez-popover-core');
67
69
  this._popOverCore.opened = this.opened;
68
70
  this._popOverCore.anchorElement = this.anchorElement;
@@ -83,7 +85,10 @@ export class EzPopoverPlus {
83
85
  else {
84
86
  console.warn('O slot do popover está vazio. Adicione conteúdo ao slot para exibição correta.');
85
87
  }
86
- document.body.appendChild(this._popOverCore);
88
+ const root = document.body.querySelector("#root");
89
+ const firstDiv = document.body.getElementsByTagName("div").item(0);
90
+ const parentElement = (_a = root !== null && root !== void 0 ? root : firstDiv) !== null && _a !== void 0 ? _a : document.body;
91
+ parentElement.appendChild(this._popOverCore);
87
92
  }
88
93
  render() {
89
94
  return (h(Host, null, h("slot", null)));
@@ -222,7 +222,7 @@ export class EzPopoverCore {
222
222
  "optional": false,
223
223
  "docs": {
224
224
  "tags": [],
225
- "text": "Define que ser\u00E1 fechado automaticamente quando o usu\u00E1rio clicar fora do conte\u00FAdo."
225
+ "text": "Define se ser\u00E1 fechado automaticamente quando o usu\u00E1rio clicar fora do conte\u00FAdo."
226
226
  },
227
227
  "attribute": "auto-close",
228
228
  "reflect": true,
@@ -25,7 +25,7 @@ export class EzPopup {
25
25
  if (this.opened && this._popupRef) {
26
26
  this._popupRef.focus();
27
27
  }
28
- new KeyboardManager({ propagate: false, element: this._element, enableShadowDom: true })
28
+ new KeyboardManager({ propagate: false, element: this._element })
29
29
  .bind("Enter", this.ezPopupAction.emit.bind("OK"))
30
30
  .bind("Escape", () => this.closePopup())
31
31
  .bind("Esc", () => this.closePopup());