@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-75940.1 → 0.0.0-bugfix-dev-kb-84605.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.
- package/dist/cjs/ez-card-item_2.cjs.entry.js +8 -9
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +31 -59
- package/dist/cjs/ez-list.cjs.entry.js +2 -2
- package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover-plus_3.cjs.entry.js +16 -2
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/collection/components/ez-date-input/ez-date-input.js +1 -1
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +1 -1
- package/dist/collection/components/ez-grid/ez-grid.js +6 -3
- package/dist/collection/components/ez-grid/utils/ColumnFilterManager.js +7 -54
- package/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource.js +20 -4
- package/dist/collection/components/ez-list/ez-list.js +2 -2
- package/dist/collection/components/ez-modal/ez-modal.js +1 -1
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +16 -2
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +9 -10
- package/dist/collection/components/ez-popup/ez-popup.js +1 -1
- package/dist/collection/components/ez-search/ez-search.js +1 -1
- package/dist/custom-elements/index.js +64 -79
- package/dist/esm/ez-card-item_2.entry.js +8 -9
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +32 -60
- package/dist/esm/ez-list.entry.js +2 -2
- package/dist/esm/ez-modal-container.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-popover-plus_3.entry.js +16 -2
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-17eabf46.entry.js +1 -0
- package/dist/ezui/p-1ad6c61b.entry.js +1 -0
- package/dist/ezui/p-3195a7a7.entry.js +1 -0
- package/dist/ezui/p-af1a478e.entry.js +1 -0
- package/dist/ezui/{p-d2bc2f06.entry.js → p-bbdc3996.entry.js} +1 -1
- package/dist/ezui/p-cb1535f7.entry.js +1 -0
- package/dist/ezui/{p-664b91e8.entry.js → p-cb5cd243.entry.js} +46 -46
- package/dist/ezui/p-cd07f8be.entry.js +1 -0
- package/dist/ezui/p-e3544d23.entry.js +1 -0
- package/dist/ezui/p-f5a30e35.entry.js +1 -0
- package/dist/types/components/ez-grid/utils/ColumnFilterManager.d.ts +1 -1
- package/dist/types/components/ez-grid/utils/InMemoryFilterColumnDataSource.d.ts +3 -0
- package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +1 -0
- package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/package.json +1 -1
- package/dist/ezui/p-0bffeffc.entry.js +0 -1
- package/dist/ezui/p-23b6128c.entry.js +0 -1
- package/dist/ezui/p-248d4f54.entry.js +0 -1
- package/dist/ezui/p-4e0628a7.entry.js +0 -1
- package/dist/ezui/p-84b1c99e.entry.js +0 -1
- package/dist/ezui/p-b7706b43.entry.js +0 -1
- package/dist/ezui/p-dcf3c8e5.entry.js +0 -1
- package/dist/ezui/p-e5c3ed19.entry.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLElement as HTMLElement$1, createEvent, h, Host, forceUpdate, Fragment, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
2
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
3
|
-
import { UserInterface, DateUtils as DateUtils$1, Action, StringUtils as StringUtils$1, ApplicationContext, WaitingChangeException, DataUnitAction, FloatingManager, ElementIDUtils, ObjectUtils as ObjectUtils$1, JSUtils, HTMLBuilder, TimeFormatter, KeyboardManager, ArrayUtils as ArrayUtils$1, DataUnit, LockManager, LockManagerOperation, NumberUtils as NumberUtils$1, MaskFormatter, DataType, SortMode, FieldComparator, OverflowWatcher, OVERFLOWED_CLASS_NAME } from '@sankhyalabs/core';
|
|
3
|
+
import { UserInterface, DateUtils as DateUtils$1, Action, StringUtils as StringUtils$1, ApplicationContext, WaitingChangeException, DataUnitAction, FloatingManager, ElementIDUtils, ObjectUtils as ObjectUtils$1, JSUtils, HTMLBuilder, TimeFormatter, KeyboardManager, ArrayUtils as ArrayUtils$1, DataUnit, LockManager, LockManagerOperation, NumberUtils as NumberUtils$1, MaskFormatter, DataType, SortMode, ColumnFilterManager as ColumnFilterManager$1, FieldComparator, OverflowWatcher, OVERFLOWED_CLASS_NAME } from '@sankhyalabs/core';
|
|
4
4
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
5
5
|
|
|
6
6
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
@@ -3805,7 +3805,7 @@ const EzDateInput$1 = class extends HTMLElement$1 {
|
|
|
3805
3805
|
}
|
|
3806
3806
|
}
|
|
3807
3807
|
disconnectedCallback() {
|
|
3808
|
-
this.
|
|
3808
|
+
this._popover.hide();
|
|
3809
3809
|
}
|
|
3810
3810
|
componentDidLoad() {
|
|
3811
3811
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
@@ -4037,7 +4037,7 @@ const EzDateTimeInput$1 = class extends HTMLElement$1 {
|
|
|
4037
4037
|
}
|
|
4038
4038
|
}
|
|
4039
4039
|
disconnectedCallback() {
|
|
4040
|
-
this.
|
|
4040
|
+
this._popover.hide();
|
|
4041
4041
|
}
|
|
4042
4042
|
componentDidLoad() {
|
|
4043
4043
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
@@ -72050,82 +72050,51 @@ function getElementID(sufix) {
|
|
|
72050
72050
|
};
|
|
72051
72051
|
}
|
|
72052
72052
|
|
|
72053
|
-
const COLUMN_FILTER_PATTERN = /FILTRO_COLUNA_(.+)/;
|
|
72054
72053
|
class ColumnFilterManager {
|
|
72055
72054
|
static getColumnFilters(filters, fieldName) {
|
|
72056
|
-
|
|
72057
|
-
if (filters == undefined || filters.length == 0) {
|
|
72058
|
-
return columnFilters;
|
|
72059
|
-
}
|
|
72060
|
-
filters.forEach(filter => {
|
|
72061
|
-
const result = COLUMN_FILTER_PATTERN.exec(filter.name);
|
|
72062
|
-
if (result) {
|
|
72063
|
-
if (fieldName !== result[1]) {
|
|
72064
|
-
columnFilters.set(filter.name, Object.assign({ columnName: result[1] }, filter));
|
|
72065
|
-
}
|
|
72066
|
-
}
|
|
72067
|
-
});
|
|
72068
|
-
return columnFilters;
|
|
72055
|
+
return ColumnFilterManager$1.getColumnFilters(filters, fieldName);
|
|
72069
72056
|
}
|
|
72070
72057
|
static getFilterFunction(dataUnit, filters) {
|
|
72071
|
-
|
|
72072
|
-
return record => {
|
|
72073
|
-
for (const filter of filters) {
|
|
72074
|
-
if (!ColumnFilterManager.recordMatchesFilter(dataUnit, record, filter)) {
|
|
72075
|
-
return false;
|
|
72076
|
-
}
|
|
72077
|
-
}
|
|
72078
|
-
return true;
|
|
72079
|
-
};
|
|
72080
|
-
}
|
|
72081
|
-
return undefined;
|
|
72082
|
-
}
|
|
72083
|
-
static recordMatchesFilter(dataUnit, record, columnFilter) {
|
|
72084
|
-
const fieldValue = record[columnFilter.columnName];
|
|
72085
|
-
for (let param of columnFilter.params) {
|
|
72086
|
-
const paramValue = dataUnit.valueFromString(columnFilter.columnName, param.value);
|
|
72087
|
-
if (FieldComparator.compareValues(dataUnit.getField(columnFilter.columnName), fieldValue, paramValue) === 0) {
|
|
72088
|
-
return true;
|
|
72089
|
-
}
|
|
72090
|
-
}
|
|
72091
|
-
return false;
|
|
72058
|
+
return ColumnFilterManager$1.getFilterFunction(dataUnit, filters);
|
|
72092
72059
|
}
|
|
72093
72060
|
static compileDistinct(fieldName, dataUnit) {
|
|
72094
|
-
|
|
72095
|
-
|
|
72096
|
-
|
|
72097
|
-
|
|
72098
|
-
const filterFunciton = ColumnFilterManager.getFilterFunction(dataUnit, columnFilters);
|
|
72099
|
-
if (filterFunciton != undefined) {
|
|
72100
|
-
list = list.filter(filterFunciton);
|
|
72101
|
-
}
|
|
72102
|
-
}
|
|
72103
|
-
const distinct = new Map(list.map(record => {
|
|
72104
|
-
const fieldValue = record[fieldName];
|
|
72105
|
-
if (fieldValue == undefined) {
|
|
72106
|
-
return [null, { label: null, value: null, check: true }];
|
|
72107
|
-
}
|
|
72108
|
-
const item = { label: dataUnit.getFormattedValue(fieldName, fieldValue), value: fieldValue, check: true };
|
|
72109
|
-
return [item.label, item];
|
|
72110
|
-
}));
|
|
72111
|
-
return Array.from(distinct.values());
|
|
72061
|
+
return ColumnFilterManager$1.compileDistinct(fieldName, dataUnit);
|
|
72062
|
+
}
|
|
72063
|
+
static compileDistinctFromArray(fieldName, dataUnit, records) {
|
|
72064
|
+
return ColumnFilterManager$1.compileDistinctFromArray(fieldName, dataUnit, records);
|
|
72112
72065
|
}
|
|
72113
72066
|
}
|
|
72114
72067
|
|
|
72115
72068
|
class InMemoryFilterColumnDataSource {
|
|
72116
72069
|
constructor(dataUnit) {
|
|
72117
|
-
|
|
72070
|
+
this.lastAppliedFilters = [];
|
|
72071
|
+
this.FILTER_COLUMN_TERM = 'FILTRO_COLUNA_';
|
|
72118
72072
|
this.onDataUnitAction = (action) => {
|
|
72073
|
+
var _a, _b;
|
|
72119
72074
|
if (action.type === Action.DATA_SAVED || action.type === Action.RECORDS_REMOVED) {
|
|
72120
72075
|
this.originalRecords = this.dataUnit.records;
|
|
72076
|
+
return;
|
|
72121
72077
|
}
|
|
72078
|
+
if (action.type !== Action.DATA_LOADED)
|
|
72079
|
+
return;
|
|
72080
|
+
const appliedFilters = this.getAppliedFilterNames((_b = (_a = action.payload) === null || _a === void 0 ? void 0 : _a.filters) !== null && _b !== void 0 ? _b : []);
|
|
72081
|
+
if (this.originalRecords && ObjectUtils$1.equals(appliedFilters, this.lastAppliedFilters))
|
|
72082
|
+
return;
|
|
72083
|
+
this.originalRecords = action.payload.records;
|
|
72084
|
+
this.lastAppliedFilters = appliedFilters;
|
|
72122
72085
|
};
|
|
72123
72086
|
this.dataUnit = dataUnit;
|
|
72124
|
-
|
|
72087
|
+
if (this.dataUnit.records.length > 0) {
|
|
72088
|
+
this.originalRecords = this.dataUnit.records;
|
|
72089
|
+
}
|
|
72125
72090
|
this.dataUnit.subscribe(this.onDataUnitAction);
|
|
72126
72091
|
}
|
|
72092
|
+
getAppliedFilterNames(filters) {
|
|
72093
|
+
const appliedFilters = filters.map(filter => filter.name);
|
|
72094
|
+
return appliedFilters.filter(filterName => !filterName.includes(this.FILTER_COLUMN_TERM));
|
|
72095
|
+
}
|
|
72127
72096
|
getStaticOptions(fieldName) {
|
|
72128
|
-
return Promise.resolve(ColumnFilterManager.
|
|
72097
|
+
return Promise.resolve(ColumnFilterManager.compileDistinctFromArray(fieldName, this.dataUnit, this.originalRecords));
|
|
72129
72098
|
}
|
|
72130
72099
|
fetchData(filterTerm, fieldName) {
|
|
72131
72100
|
return new Promise(resolve => {
|
|
@@ -72691,7 +72660,8 @@ const EzGrid$1 = class extends HTMLElement$1 {
|
|
|
72691
72660
|
return `${total == undefined ? ` de ${count + 1} ou mais` : ` de ${total}`}`;
|
|
72692
72661
|
}
|
|
72693
72662
|
_hasToShowCancelPagination() {
|
|
72694
|
-
|
|
72663
|
+
var _a;
|
|
72664
|
+
const { total, count } = (_a = this._paginationInfo) !== null && _a !== void 0 ? _a : {};
|
|
72695
72665
|
const hasMore = (total === undefined);
|
|
72696
72666
|
return !this.dataUnit.cancelPagination && hasMore && count > this.dataUnit.pageSize;
|
|
72697
72667
|
}
|
|
@@ -72762,8 +72732,10 @@ const EzGrid$1 = class extends HTMLElement$1 {
|
|
|
72762
72732
|
}
|
|
72763
72733
|
}
|
|
72764
72734
|
getDataSource() {
|
|
72765
|
-
|
|
72766
|
-
|
|
72735
|
+
if (!this.columnfilterDataSource) {
|
|
72736
|
+
this.columnfilterDataSource = new InMemoryFilterColumnDataSource(this.dataUnit);
|
|
72737
|
+
}
|
|
72738
|
+
return this.columnfilterDataSource;
|
|
72767
72739
|
}
|
|
72768
72740
|
hideHeader() {
|
|
72769
72741
|
return !this._hasLeftButtons && !this._paginationInfo;
|
|
@@ -73555,7 +73527,7 @@ const EzList$1 = class extends HTMLElement$1 {
|
|
|
73555
73527
|
return { id: item.id, label: item.label, check: evt.detail };
|
|
73556
73528
|
}
|
|
73557
73529
|
renderListWithGroups() {
|
|
73558
|
-
return h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex:
|
|
73530
|
+
return h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => this.keyDownHandler(event) }, this._listGroupItems.map(group => {
|
|
73559
73531
|
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: {
|
|
73560
73532
|
'selectable-container': this.ezSelectable,
|
|
73561
73533
|
'hover-feedback': this.hoverFeedback,
|
|
@@ -73565,7 +73537,7 @@ const EzList$1 = class extends HTMLElement$1 {
|
|
|
73565
73537
|
}));
|
|
73566
73538
|
}
|
|
73567
73539
|
renderList() {
|
|
73568
|
-
return h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex:
|
|
73540
|
+
return h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex: 0, onKeyDown: event => {
|
|
73569
73541
|
this.keyDownHandler(event);
|
|
73570
73542
|
} }, h("div", { class: 'draggable-list' }, this._listItems.map((item, index) => (h("li", Object.assign({ id: 'item_' + item.id, class: {
|
|
73571
73543
|
'selectable-container': this.ezSelectable,
|
|
@@ -73638,7 +73610,7 @@ const EzModal$1 = class extends HTMLElement$1 {
|
|
|
73638
73610
|
}
|
|
73639
73611
|
componentDidLoad() {
|
|
73640
73612
|
this.observeOpened();
|
|
73641
|
-
new KeyboardManager({ propagate: false, element: this._element
|
|
73613
|
+
new KeyboardManager({ propagate: false, element: this._element })
|
|
73642
73614
|
.bind("Enter", this.ezModalAction.emit.bind("OK"))
|
|
73643
73615
|
.bind("Escape", () => this.closeModal())
|
|
73644
73616
|
.bind("Esc", () => this.closeModal());
|
|
@@ -73753,7 +73725,7 @@ const EzModalContainer$1 = class extends HTMLElement$1 {
|
|
|
73753
73725
|
this._closeButton.focus();
|
|
73754
73726
|
}
|
|
73755
73727
|
render() {
|
|
73756
|
-
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$1.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), h("div", {
|
|
73728
|
+
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$1.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$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (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) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
73757
73729
|
}
|
|
73758
73730
|
get _element() { return this; }
|
|
73759
73731
|
static get style() { return ezModalContainerCss; }
|
|
@@ -75601,6 +75573,7 @@ const EzPopoverCore$1 = class extends HTMLElement$1 {
|
|
|
75601
75573
|
return htmlElement;
|
|
75602
75574
|
}
|
|
75603
75575
|
}
|
|
75576
|
+
return this._host;
|
|
75604
75577
|
}
|
|
75605
75578
|
return this.getElement(this.anchorElement);
|
|
75606
75579
|
}
|
|
@@ -75636,17 +75609,15 @@ const EzPopoverCore$1 = class extends HTMLElement$1 {
|
|
|
75636
75609
|
this.ezVisibilityChange.emit(false);
|
|
75637
75610
|
}
|
|
75638
75611
|
async openPopover() {
|
|
75639
|
-
if (!this._box) {
|
|
75612
|
+
if (!this._box || !this.opened) {
|
|
75640
75613
|
return;
|
|
75641
75614
|
}
|
|
75642
|
-
|
|
75643
|
-
|
|
75644
|
-
|
|
75645
|
-
|
|
75646
|
-
|
|
75647
|
-
|
|
75648
|
-
this._box.style.visibility = 'visible';
|
|
75649
|
-
}
|
|
75615
|
+
this._box.style.display = 'flex';
|
|
75616
|
+
this._box.style.visibility = 'hidden';
|
|
75617
|
+
await this.updatePositionPopover();
|
|
75618
|
+
this.openOverlay();
|
|
75619
|
+
this.ezVisibilityChange.emit(true);
|
|
75620
|
+
this._box.style.visibility = 'visible';
|
|
75650
75621
|
}
|
|
75651
75622
|
openOverlay() {
|
|
75652
75623
|
if (!this._overlay || !this._overlayIsActive) {
|
|
@@ -75775,8 +75746,19 @@ const EzPopoverPlus$1 = class extends HTMLElement$1 {
|
|
|
75775
75746
|
async setAnchorElement(anchor) {
|
|
75776
75747
|
var _a;
|
|
75777
75748
|
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.setAnchorElement(anchor));
|
|
75749
|
+
this.anchorElement = anchor;
|
|
75750
|
+
}
|
|
75751
|
+
getFirstElement(collection) {
|
|
75752
|
+
if (Array.isArray(collection) && collection.length) {
|
|
75753
|
+
return collection[0];
|
|
75754
|
+
}
|
|
75755
|
+
if (!Array.isArray(collection) && collection.item) {
|
|
75756
|
+
return collection.item(0);
|
|
75757
|
+
}
|
|
75758
|
+
return null;
|
|
75778
75759
|
}
|
|
75779
75760
|
renderPopoverCore() {
|
|
75761
|
+
var _a;
|
|
75780
75762
|
this._popOverCore = document.createElement('ez-popover-core');
|
|
75781
75763
|
this._popOverCore.opened = this.opened;
|
|
75782
75764
|
this._popOverCore.anchorElement = this.anchorElement;
|
|
@@ -75790,14 +75772,17 @@ const EzPopoverPlus$1 = class extends HTMLElement$1 {
|
|
|
75790
75772
|
this.ezVisibilityChange.emit(detail);
|
|
75791
75773
|
this.opened = detail;
|
|
75792
75774
|
});
|
|
75793
|
-
const firstChild = this._host.children
|
|
75775
|
+
const firstChild = this.getFirstElement(this._host.children);
|
|
75794
75776
|
if (firstChild) {
|
|
75795
75777
|
this._popOverCore.appendChild(firstChild);
|
|
75796
75778
|
}
|
|
75797
75779
|
else {
|
|
75798
75780
|
console.warn('O slot do popover está vazio. Adicione conteúdo ao slot para exibição correta.');
|
|
75799
75781
|
}
|
|
75800
|
-
document.body.
|
|
75782
|
+
const root = document.body.querySelector("#root");
|
|
75783
|
+
const firstDiv = this.getFirstElement(document.body.getElementsByTagName("div"));
|
|
75784
|
+
const parentElement = (_a = root !== null && root !== void 0 ? root : firstDiv) !== null && _a !== void 0 ? _a : document.body;
|
|
75785
|
+
parentElement.appendChild(this._popOverCore);
|
|
75801
75786
|
}
|
|
75802
75787
|
render() {
|
|
75803
75788
|
return (h(Host, null, h("slot", null)));
|
|
@@ -75841,7 +75826,7 @@ const EzPopup$1 = class extends HTMLElement$1 {
|
|
|
75841
75826
|
if (this.opened && this._popupRef) {
|
|
75842
75827
|
this._popupRef.focus();
|
|
75843
75828
|
}
|
|
75844
|
-
new KeyboardManager({ propagate: false, element: this._element
|
|
75829
|
+
new KeyboardManager({ propagate: false, element: this._element })
|
|
75845
75830
|
.bind("Enter", this.ezPopupAction.emit.bind("OK"))
|
|
75846
75831
|
.bind("Escape", () => this.closePopup())
|
|
75847
75832
|
.bind("Esc", () => this.closePopup());
|
|
@@ -76454,7 +76439,7 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
76454
76439
|
}
|
|
76455
76440
|
}
|
|
76456
76441
|
cancelPreselection() {
|
|
76457
|
-
if (!this._textInput.value && this._currentValue) {
|
|
76442
|
+
if (!this._textInput.value && this._currentValue && this._source.length > 0) {
|
|
76458
76443
|
this.selectOption(undefined);
|
|
76459
76444
|
}
|
|
76460
76445
|
else {
|
|
@@ -1371,6 +1371,7 @@ const EzPopoverCore = class {
|
|
|
1371
1371
|
return htmlElement;
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
|
+
return this._host;
|
|
1374
1375
|
}
|
|
1375
1376
|
return this.getElement(this.anchorElement);
|
|
1376
1377
|
}
|
|
@@ -1406,17 +1407,15 @@ const EzPopoverCore = class {
|
|
|
1406
1407
|
this.ezVisibilityChange.emit(false);
|
|
1407
1408
|
}
|
|
1408
1409
|
async openPopover() {
|
|
1409
|
-
if (!this._box) {
|
|
1410
|
+
if (!this._box || !this.opened) {
|
|
1410
1411
|
return;
|
|
1411
1412
|
}
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
this._box.style.visibility = 'visible';
|
|
1419
|
-
}
|
|
1413
|
+
this._box.style.display = 'flex';
|
|
1414
|
+
this._box.style.visibility = 'hidden';
|
|
1415
|
+
await this.updatePositionPopover();
|
|
1416
|
+
this.openOverlay();
|
|
1417
|
+
this.ezVisibilityChange.emit(true);
|
|
1418
|
+
this._box.style.visibility = 'visible';
|
|
1420
1419
|
}
|
|
1421
1420
|
openOverlay() {
|
|
1422
1421
|
if (!this._overlay || !this._overlayIsActive) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-baa5e267.js';
|
|
2
|
-
import { Action, DataUnit, ObjectUtils as ObjectUtils$1, HTMLBuilder, ApplicationContext, StringUtils as StringUtils$1, UserInterface, LockManager, LockManagerOperation, NumberUtils as NumberUtils$1, MaskFormatter, DataType, SortMode, ElementIDUtils,
|
|
2
|
+
import { Action, DataUnit, ObjectUtils as ObjectUtils$1, HTMLBuilder, ApplicationContext, StringUtils as StringUtils$1, UserInterface, LockManager, LockManagerOperation, NumberUtils as NumberUtils$1, MaskFormatter, DataType, SortMode, ElementIDUtils, ColumnFilterManager as ColumnFilterManager$1, DateUtils as DateUtils$1, ArrayUtils as ArrayUtils$1, FieldComparator, JSUtils, OverflowWatcher, OVERFLOWED_CLASS_NAME, KeyboardManager } from '@sankhyalabs/core';
|
|
3
3
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
4
4
|
import { A as ApplicationUtils } from './ApplicationUtils-eaf91331.js';
|
|
5
5
|
import './DialogType-54a62731.js';
|
|
@@ -65893,82 +65893,51 @@ function getElementID(sufix) {
|
|
|
65893
65893
|
};
|
|
65894
65894
|
}
|
|
65895
65895
|
|
|
65896
|
-
const COLUMN_FILTER_PATTERN = /FILTRO_COLUNA_(.+)/;
|
|
65897
65896
|
class ColumnFilterManager {
|
|
65898
65897
|
static getColumnFilters(filters, fieldName) {
|
|
65899
|
-
|
|
65900
|
-
if (filters == undefined || filters.length == 0) {
|
|
65901
|
-
return columnFilters;
|
|
65902
|
-
}
|
|
65903
|
-
filters.forEach(filter => {
|
|
65904
|
-
const result = COLUMN_FILTER_PATTERN.exec(filter.name);
|
|
65905
|
-
if (result) {
|
|
65906
|
-
if (fieldName !== result[1]) {
|
|
65907
|
-
columnFilters.set(filter.name, Object.assign({ columnName: result[1] }, filter));
|
|
65908
|
-
}
|
|
65909
|
-
}
|
|
65910
|
-
});
|
|
65911
|
-
return columnFilters;
|
|
65898
|
+
return ColumnFilterManager$1.getColumnFilters(filters, fieldName);
|
|
65912
65899
|
}
|
|
65913
65900
|
static getFilterFunction(dataUnit, filters) {
|
|
65914
|
-
|
|
65915
|
-
return record => {
|
|
65916
|
-
for (const filter of filters) {
|
|
65917
|
-
if (!ColumnFilterManager.recordMatchesFilter(dataUnit, record, filter)) {
|
|
65918
|
-
return false;
|
|
65919
|
-
}
|
|
65920
|
-
}
|
|
65921
|
-
return true;
|
|
65922
|
-
};
|
|
65923
|
-
}
|
|
65924
|
-
return undefined;
|
|
65925
|
-
}
|
|
65926
|
-
static recordMatchesFilter(dataUnit, record, columnFilter) {
|
|
65927
|
-
const fieldValue = record[columnFilter.columnName];
|
|
65928
|
-
for (let param of columnFilter.params) {
|
|
65929
|
-
const paramValue = dataUnit.valueFromString(columnFilter.columnName, param.value);
|
|
65930
|
-
if (FieldComparator.compareValues(dataUnit.getField(columnFilter.columnName), fieldValue, paramValue) === 0) {
|
|
65931
|
-
return true;
|
|
65932
|
-
}
|
|
65933
|
-
}
|
|
65934
|
-
return false;
|
|
65901
|
+
return ColumnFilterManager$1.getFilterFunction(dataUnit, filters);
|
|
65935
65902
|
}
|
|
65936
65903
|
static compileDistinct(fieldName, dataUnit) {
|
|
65937
|
-
|
|
65938
|
-
|
|
65939
|
-
|
|
65940
|
-
|
|
65941
|
-
const filterFunciton = ColumnFilterManager.getFilterFunction(dataUnit, columnFilters);
|
|
65942
|
-
if (filterFunciton != undefined) {
|
|
65943
|
-
list = list.filter(filterFunciton);
|
|
65944
|
-
}
|
|
65945
|
-
}
|
|
65946
|
-
const distinct = new Map(list.map(record => {
|
|
65947
|
-
const fieldValue = record[fieldName];
|
|
65948
|
-
if (fieldValue == undefined) {
|
|
65949
|
-
return [null, { label: null, value: null, check: true }];
|
|
65950
|
-
}
|
|
65951
|
-
const item = { label: dataUnit.getFormattedValue(fieldName, fieldValue), value: fieldValue, check: true };
|
|
65952
|
-
return [item.label, item];
|
|
65953
|
-
}));
|
|
65954
|
-
return Array.from(distinct.values());
|
|
65904
|
+
return ColumnFilterManager$1.compileDistinct(fieldName, dataUnit);
|
|
65905
|
+
}
|
|
65906
|
+
static compileDistinctFromArray(fieldName, dataUnit, records) {
|
|
65907
|
+
return ColumnFilterManager$1.compileDistinctFromArray(fieldName, dataUnit, records);
|
|
65955
65908
|
}
|
|
65956
65909
|
}
|
|
65957
65910
|
|
|
65958
65911
|
class InMemoryFilterColumnDataSource {
|
|
65959
65912
|
constructor(dataUnit) {
|
|
65960
|
-
|
|
65913
|
+
this.lastAppliedFilters = [];
|
|
65914
|
+
this.FILTER_COLUMN_TERM = 'FILTRO_COLUNA_';
|
|
65961
65915
|
this.onDataUnitAction = (action) => {
|
|
65916
|
+
var _a, _b;
|
|
65962
65917
|
if (action.type === Action.DATA_SAVED || action.type === Action.RECORDS_REMOVED) {
|
|
65963
65918
|
this.originalRecords = this.dataUnit.records;
|
|
65919
|
+
return;
|
|
65964
65920
|
}
|
|
65921
|
+
if (action.type !== Action.DATA_LOADED)
|
|
65922
|
+
return;
|
|
65923
|
+
const appliedFilters = this.getAppliedFilterNames((_b = (_a = action.payload) === null || _a === void 0 ? void 0 : _a.filters) !== null && _b !== void 0 ? _b : []);
|
|
65924
|
+
if (this.originalRecords && ObjectUtils$1.equals(appliedFilters, this.lastAppliedFilters))
|
|
65925
|
+
return;
|
|
65926
|
+
this.originalRecords = action.payload.records;
|
|
65927
|
+
this.lastAppliedFilters = appliedFilters;
|
|
65965
65928
|
};
|
|
65966
65929
|
this.dataUnit = dataUnit;
|
|
65967
|
-
|
|
65930
|
+
if (this.dataUnit.records.length > 0) {
|
|
65931
|
+
this.originalRecords = this.dataUnit.records;
|
|
65932
|
+
}
|
|
65968
65933
|
this.dataUnit.subscribe(this.onDataUnitAction);
|
|
65969
65934
|
}
|
|
65935
|
+
getAppliedFilterNames(filters) {
|
|
65936
|
+
const appliedFilters = filters.map(filter => filter.name);
|
|
65937
|
+
return appliedFilters.filter(filterName => !filterName.includes(this.FILTER_COLUMN_TERM));
|
|
65938
|
+
}
|
|
65970
65939
|
getStaticOptions(fieldName) {
|
|
65971
|
-
return Promise.resolve(ColumnFilterManager.
|
|
65940
|
+
return Promise.resolve(ColumnFilterManager.compileDistinctFromArray(fieldName, this.dataUnit, this.originalRecords));
|
|
65972
65941
|
}
|
|
65973
65942
|
fetchData(filterTerm, fieldName) {
|
|
65974
65943
|
return new Promise(resolve => {
|
|
@@ -66533,7 +66502,8 @@ const EzGrid = class {
|
|
|
66533
66502
|
return `${total == undefined ? ` de ${count + 1} ou mais` : ` de ${total}`}`;
|
|
66534
66503
|
}
|
|
66535
66504
|
_hasToShowCancelPagination() {
|
|
66536
|
-
|
|
66505
|
+
var _a;
|
|
66506
|
+
const { total, count } = (_a = this._paginationInfo) !== null && _a !== void 0 ? _a : {};
|
|
66537
66507
|
const hasMore = (total === undefined);
|
|
66538
66508
|
return !this.dataUnit.cancelPagination && hasMore && count > this.dataUnit.pageSize;
|
|
66539
66509
|
}
|
|
@@ -66604,8 +66574,10 @@ const EzGrid = class {
|
|
|
66604
66574
|
}
|
|
66605
66575
|
}
|
|
66606
66576
|
getDataSource() {
|
|
66607
|
-
|
|
66608
|
-
|
|
66577
|
+
if (!this.columnfilterDataSource) {
|
|
66578
|
+
this.columnfilterDataSource = new InMemoryFilterColumnDataSource(this.dataUnit);
|
|
66579
|
+
}
|
|
66580
|
+
return this.columnfilterDataSource;
|
|
66609
66581
|
}
|
|
66610
66582
|
hideHeader() {
|
|
66611
66583
|
return !this._hasLeftButtons && !this._paginationInfo;
|
|
@@ -585,7 +585,7 @@ const EzList = class {
|
|
|
585
585
|
return { id: item.id, label: item.label, check: evt.detail };
|
|
586
586
|
}
|
|
587
587
|
renderListWithGroups() {
|
|
588
|
-
return h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex:
|
|
588
|
+
return h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => this.keyDownHandler(event) }, this._listGroupItems.map(group => {
|
|
589
589
|
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: {
|
|
590
590
|
'selectable-container': this.ezSelectable,
|
|
591
591
|
'hover-feedback': this.hoverFeedback,
|
|
@@ -595,7 +595,7 @@ const EzList = class {
|
|
|
595
595
|
}));
|
|
596
596
|
}
|
|
597
597
|
renderList() {
|
|
598
|
-
return h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex:
|
|
598
|
+
return h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex: 0, onKeyDown: event => {
|
|
599
599
|
this.keyDownHandler(event);
|
|
600
600
|
} }, h("div", { class: 'draggable-list' }, this._listItems.map((item, index) => (h("li", Object.assign({ id: 'item_' + item.id, class: {
|
|
601
601
|
'selectable-container': this.ezSelectable,
|
|
@@ -68,7 +68,7 @@ const EzModalContainer = class {
|
|
|
68
68
|
this._closeButton.focus();
|
|
69
69
|
}
|
|
70
70
|
render() {
|
|
71
|
-
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$1.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), h("div", {
|
|
71
|
+
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$1.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$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (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) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
72
72
|
}
|
|
73
73
|
get _element() { return getElement(this); }
|
|
74
74
|
};
|
|
@@ -32,7 +32,7 @@ const EzModal = class {
|
|
|
32
32
|
}
|
|
33
33
|
componentDidLoad() {
|
|
34
34
|
this.observeOpened();
|
|
35
|
-
new KeyboardManager({ propagate: false, element: this._element
|
|
35
|
+
new KeyboardManager({ propagate: false, element: this._element })
|
|
36
36
|
.bind("Enter", this.ezModalAction.emit.bind("OK"))
|
|
37
37
|
.bind("Escape", () => this.closeModal())
|
|
38
38
|
.bind("Esc", () => this.closeModal());
|
|
@@ -68,8 +68,19 @@ const EzPopoverPlus = class {
|
|
|
68
68
|
async setAnchorElement(anchor) {
|
|
69
69
|
var _a;
|
|
70
70
|
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.setAnchorElement(anchor));
|
|
71
|
+
this.anchorElement = anchor;
|
|
72
|
+
}
|
|
73
|
+
getFirstElement(collection) {
|
|
74
|
+
if (Array.isArray(collection) && collection.length) {
|
|
75
|
+
return collection[0];
|
|
76
|
+
}
|
|
77
|
+
if (!Array.isArray(collection) && collection.item) {
|
|
78
|
+
return collection.item(0);
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
71
81
|
}
|
|
72
82
|
renderPopoverCore() {
|
|
83
|
+
var _a;
|
|
73
84
|
this._popOverCore = document.createElement('ez-popover-core');
|
|
74
85
|
this._popOverCore.opened = this.opened;
|
|
75
86
|
this._popOverCore.anchorElement = this.anchorElement;
|
|
@@ -83,14 +94,17 @@ const EzPopoverPlus = class {
|
|
|
83
94
|
this.ezVisibilityChange.emit(detail);
|
|
84
95
|
this.opened = detail;
|
|
85
96
|
});
|
|
86
|
-
const firstChild = this._host.children
|
|
97
|
+
const firstChild = this.getFirstElement(this._host.children);
|
|
87
98
|
if (firstChild) {
|
|
88
99
|
this._popOverCore.appendChild(firstChild);
|
|
89
100
|
}
|
|
90
101
|
else {
|
|
91
102
|
console.warn('O slot do popover está vazio. Adicione conteúdo ao slot para exibição correta.');
|
|
92
103
|
}
|
|
93
|
-
document.body.
|
|
104
|
+
const root = document.body.querySelector("#root");
|
|
105
|
+
const firstDiv = this.getFirstElement(document.body.getElementsByTagName("div"));
|
|
106
|
+
const parentElement = (_a = root !== null && root !== void 0 ? root : firstDiv) !== null && _a !== void 0 ? _a : document.body;
|
|
107
|
+
parentElement.appendChild(this._popOverCore);
|
|
94
108
|
}
|
|
95
109
|
render() {
|
|
96
110
|
return (h(Host, null, h("slot", null)));
|
|
@@ -31,7 +31,7 @@ const EzPopup = class {
|
|
|
31
31
|
if (this.opened && this._popupRef) {
|
|
32
32
|
this._popupRef.focus();
|
|
33
33
|
}
|
|
34
|
-
new KeyboardManager({ propagate: false, element: this._element
|
|
34
|
+
new KeyboardManager({ propagate: false, element: this._element })
|
|
35
35
|
.bind("Enter", this.ezPopupAction.emit.bind("OK"))
|
|
36
36
|
.bind("Escape", () => this.closePopup())
|
|
37
37
|
.bind("Esc", () => this.closePopup());
|
|
@@ -304,7 +304,7 @@ const EzSearch = class {
|
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
cancelPreselection() {
|
|
307
|
-
if (!this._textInput.value && this._currentValue) {
|
|
307
|
+
if (!this._textInput.value && this._currentValue && this._source.length > 0) {
|
|
308
308
|
this.selectOption(undefined);
|
|
309
309
|
}
|
|
310
310
|
else {
|