@sankhyalabs/sankhyablocks 9.1.0-dev.7 → 9.1.0-dev.9
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/{ClientSideExporterProvider-b4f112f5.js → ClientSideExporterProvider-6a4108c9.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-05ed9547.js → dataunit-fetcher-c34a8217.js} +3 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_8.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-attach.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +2 -1
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-8336edac.js → snk-data-unit-a4f9287b.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +2 -2
- package/dist/cjs/snk-entity-list.cjs.entry.js +4 -2
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +41 -109
- package/dist/cjs/snk-filter-detail.cjs.entry.js +3 -1
- package/dist/cjs/snk-grid.cjs.entry.js +2 -2
- package/dist/cjs/{snk-guides-viewer-eb62127a.js → snk-guides-viewer-29298823.js} +1 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +2 -2
- package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +6 -4
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +2 -2
- package/dist/collection/components/snk-crud/snk-crud.js +19 -0
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +4 -2
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +6 -4
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +3 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css +4 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +49 -121
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +3 -0
- package/dist/components/dataunit-fetcher.js +3 -0
- package/dist/components/snk-crud.js +1 -0
- package/dist/components/snk-entity-list.js +4 -2
- package/dist/components/snk-filter-detail2.js +3 -1
- package/dist/components/snk-filter-item2.js +43 -111
- package/dist/components/snk-personalized-filter-editor.js +6 -4
- package/dist/esm/{ClientSideExporterProvider-c56c2549.js → ClientSideExporterProvider-09dee1a3.js} +1 -1
- package/dist/esm/{dataunit-fetcher-41609933.js → dataunit-fetcher-1b78797a.js} +3 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-grid_2.entry.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_8.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-attach.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +2 -1
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-a44c4cfd.js → snk-data-unit-330db397.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +2 -2
- package/dist/esm/snk-entity-list.entry.js +4 -2
- package/dist/esm/snk-filter-bar_4.entry.js +42 -110
- package/dist/esm/snk-filter-detail.entry.js +3 -1
- package/dist/esm/snk-grid.entry.js +2 -2
- package/dist/esm/{snk-guides-viewer-68c32d00.js → snk-guides-viewer-9335318d.js} +1 -1
- package/dist/esm/snk-guides-viewer.entry.js +2 -2
- package/dist/esm/snk-personalized-filter-editor.entry.js +6 -4
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +2 -2
- package/dist/sankhyablocks/{p-e9411bba.entry.js → p-02480593.entry.js} +1 -1
- package/dist/sankhyablocks/{p-117c76f4.entry.js → p-1079e61b.entry.js} +1 -1
- package/dist/sankhyablocks/p-162bddae.entry.js +1 -0
- package/dist/sankhyablocks/{p-4eafedb7.entry.js → p-1c69a957.entry.js} +1 -1
- package/dist/sankhyablocks/p-25209340.entry.js +1 -0
- package/dist/sankhyablocks/{p-a35114d4.js → p-37b4f642.js} +1 -1
- package/dist/sankhyablocks/{p-6e3b40fa.js → p-3b1d73f9.js} +1 -1
- package/dist/sankhyablocks/{p-ded76667.entry.js → p-5126b34e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0bc54da7.entry.js → p-5b31b239.entry.js} +1 -1
- package/dist/sankhyablocks/{p-48633f79.entry.js → p-60d3abf6.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b5d46d99.entry.js → p-7c9815ea.entry.js} +1 -1
- package/dist/sankhyablocks/{p-67fe0ff3.entry.js → p-9a6fbf3d.entry.js} +1 -1
- package/dist/sankhyablocks/p-a2c6944d.entry.js +1 -0
- package/dist/sankhyablocks/p-cb2a4613.entry.js +1 -0
- package/dist/sankhyablocks/{p-726563f9.entry.js → p-e56eb36b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0ea9dc32.entry.js → p-f442c8f6.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e824d565.entry.js → p-f8b4cd80.entry.js} +1 -1
- package/dist/sankhyablocks/{p-344ee730.js → p-fa591f6f.js} +1 -1
- package/dist/sankhyablocks/{p-cfb29ae5.js → p-fc87708a.js} +1 -1
- package/dist/sankhyablocks/{p-6c53f977.entry.js → p-fd571197.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +10 -20
- package/package.json +1 -1
- package/dist/sankhyablocks/p-83c100f2.entry.js +0 -1
- package/dist/sankhyablocks/p-8d61022c.entry.js +0 -1
- package/dist/sankhyablocks/p-90805683.entry.js +0 -1
- package/dist/sankhyablocks/p-fe8c0d02.entry.js +0 -1
@@ -1,16 +1,9 @@
|
|
1
|
-
import { ElementIDUtils,
|
1
|
+
import { ElementIDUtils, DateUtils, MaskFormatter } from '@sankhyalabs/core';
|
2
2
|
import { h, Host } from '@stencil/core';
|
3
3
|
import FilterItemType from './filter-item-type.enum';
|
4
4
|
import { FilterNumberVariation } from './editors/enum/filterNumberVariation';
|
5
5
|
export class SnkFilterItem {
|
6
6
|
constructor() {
|
7
|
-
this.innerClickCheck = (_floatingContainer, node) => {
|
8
|
-
if (node.id != FloatingManager.MODAL_ELEMENT_ID) {
|
9
|
-
return true;
|
10
|
-
}
|
11
|
-
this.detailIsVisible = false;
|
12
|
-
return false;
|
13
|
-
};
|
14
7
|
this.detailIsVisible = undefined;
|
15
8
|
this.config = undefined;
|
16
9
|
this.getMessage = undefined;
|
@@ -19,57 +12,28 @@ export class SnkFilterItem {
|
|
19
12
|
observeDetailIsVisible(value) {
|
20
13
|
this.visibleChanged.emit(value);
|
21
14
|
}
|
15
|
+
/**
|
16
|
+
* Emitido quando o estado do filtro é alterado.
|
17
|
+
*/
|
18
|
+
filterChangeListener() {
|
19
|
+
this.hideDetail();
|
20
|
+
}
|
22
21
|
/**
|
23
22
|
* Exibe os detalhes de um item da lista.
|
24
23
|
*/
|
25
24
|
async showUp(open = false) {
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
(_a = this._chipElement) === null || _a === void 0 ? void 0 : _a.blur();
|
32
|
-
window.requestAnimationFrame(() => {
|
33
|
-
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, this.getFloatOptions());
|
34
|
-
this._popover.show();
|
35
|
-
this.detailIsVisible = true;
|
36
|
-
});
|
37
|
-
}
|
38
|
-
});
|
39
|
-
}
|
40
|
-
updatePosition() {
|
41
|
-
if (this._floatingID == undefined) {
|
42
|
-
return;
|
25
|
+
var _a;
|
26
|
+
this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
|
27
|
+
if (open) {
|
28
|
+
await ((_a = this._chipElement) === null || _a === void 0 ? void 0 : _a.setBlur());
|
29
|
+
await this._popover.showUnder(this._chipElement);
|
43
30
|
}
|
44
|
-
FloatingManager.updateFloatPosition(this._popover, this._popoverContainer, this.getFloatOptions());
|
45
|
-
}
|
46
|
-
getFloatOptions() {
|
47
|
-
return {
|
48
|
-
autoClose: true,
|
49
|
-
innerClickTest: this.innerClickCheck,
|
50
|
-
backClickListener: () => this.onDetailCloseCallback(),
|
51
|
-
left: this.getOffsetLeft(),
|
52
|
-
top: this.getOffsetTop(),
|
53
|
-
useOverlay: true,
|
54
|
-
overlayClassName: 'ez-scrim ez-scrim--light',
|
55
|
-
isFixed: true
|
56
|
-
};
|
57
|
-
}
|
58
|
-
getOffsetLeft() {
|
59
|
-
const padding = getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");
|
60
|
-
const rect = this._filterItemElement.getBoundingClientRect();
|
61
|
-
// Width baseado no conteudo do snk-filter-detail. Nesse momento ele retorna 0px pois ainda não foi criado em tela.
|
62
|
-
const filterDetailWidth = 430;
|
63
|
-
const adjustRightPosition = filterDetailWidth - (document.body.clientWidth - rect.left);
|
64
|
-
return `calc(${rect.x}px + ${padding} - ${adjustRightPosition > 0 ? adjustRightPosition : 0}px)`;
|
65
31
|
}
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
window.removeEventListener("scroll", this.updatePosition.bind(this));
|
72
|
-
window.addEventListener("scroll", this.updatePosition.bind(this));
|
32
|
+
/**
|
33
|
+
* Oculta os detalhes de um item da lista.
|
34
|
+
*/
|
35
|
+
async hideDetail() {
|
36
|
+
await this._popover.hide();
|
73
37
|
}
|
74
38
|
getConfigChanges() {
|
75
39
|
var _a;
|
@@ -82,51 +46,24 @@ export class SnkFilterItem {
|
|
82
46
|
const newValue = hasMultiValues ? configToBeCleared.value.map((valueItem) => (Object.assign(Object.assign({}, valueItem), { check: false }))) : undefined;
|
83
47
|
return Object.assign(Object.assign({}, configToBeCleared), { value: newValue });
|
84
48
|
}
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
if (this._floatingID != undefined) {
|
91
|
-
FloatingManager.close(this._floatingID);
|
92
|
-
}
|
49
|
+
clearFilter(event) {
|
50
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
51
|
+
if (this.canClearFilter()) {
|
52
|
+
const configChanged = this.getConfigChanges();
|
53
|
+
this.filterChange.emit(configChanged);
|
93
54
|
}
|
94
|
-
|
95
|
-
|
96
|
-
this._floatingID = undefined;
|
97
|
-
this.detailIsVisible = false;
|
98
|
-
if (this._closeCallback) {
|
99
|
-
this._closeCallback();
|
100
|
-
this._closeCallback = undefined;
|
55
|
+
else {
|
56
|
+
this.togglePopover();
|
101
57
|
}
|
102
58
|
}
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
if (evt.target === this._rightIconElement && this.canClearFilter()) {
|
109
|
-
const configChanged = this.getConfigChanges();
|
110
|
-
this.filterChange.emit(configChanged);
|
111
|
-
}
|
112
|
-
else {
|
113
|
-
if (this.detailIsVisible) {
|
114
|
-
this.hideDetail();
|
115
|
-
}
|
116
|
-
else {
|
117
|
-
this.showUp(true);
|
118
|
-
}
|
119
|
-
}
|
120
|
-
evt.preventDefault();
|
121
|
-
evt.stopImmediatePropagation();
|
122
|
-
evt.stopPropagation();
|
59
|
+
async togglePopover(event) {
|
60
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
61
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
62
|
+
if (this.detailIsVisible) {
|
63
|
+
await this.hideDetail();
|
123
64
|
}
|
124
|
-
|
125
|
-
|
126
|
-
if (this.detailIsVisible && [this._chipElement, this._leftIconElement, this._rightIconElement].includes(evt.target)) {
|
127
|
-
evt.preventDefault();
|
128
|
-
evt.stopImmediatePropagation();
|
129
|
-
evt.stopPropagation();
|
65
|
+
else {
|
66
|
+
await this.showUp(true);
|
130
67
|
}
|
131
68
|
}
|
132
69
|
getLabel(isTooltipLabel = false) {
|
@@ -247,20 +184,6 @@ export class SnkFilterItem {
|
|
247
184
|
ElementIDUtils.addIDInfo(this._filterItemElement);
|
248
185
|
this._idSnkFilterDetail = `filterDetail_${this.config.id}`;
|
249
186
|
}
|
250
|
-
this.controlScrollPage();
|
251
|
-
}
|
252
|
-
componentDidRender() {
|
253
|
-
if (this._floatingID == undefined) {
|
254
|
-
if (this._popover) {
|
255
|
-
this._popover.remove();
|
256
|
-
}
|
257
|
-
}
|
258
|
-
}
|
259
|
-
/**
|
260
|
-
* Emitido quando o estado do filtro é alterado.
|
261
|
-
*/
|
262
|
-
filterChangeListener() {
|
263
|
-
this.hideDetail();
|
264
187
|
}
|
265
188
|
canClearFilter() {
|
266
189
|
const { value, groupedItems = [] } = this.config;
|
@@ -291,17 +214,34 @@ export class SnkFilterItem {
|
|
291
214
|
return (config.type !== FilterItemType.MULTI_LIST && config.value !== undefined) || this.hasActiveElements(config.value);
|
292
215
|
}
|
293
216
|
getEnabledChip() {
|
217
|
+
if (this.detailIsVisible) {
|
218
|
+
return true;
|
219
|
+
}
|
294
220
|
if (this.config.type === FilterItemType.PERSONALIZED) {
|
295
221
|
const { groupedItems = [] } = this.config;
|
296
222
|
return groupedItems.some(item => item.visible);
|
297
223
|
}
|
298
224
|
return this.hasActiveValue(this.config);
|
299
225
|
}
|
226
|
+
handleVisibilityPopover(event) {
|
227
|
+
this.detailIsVisible = event.detail;
|
228
|
+
}
|
300
229
|
render() {
|
301
230
|
const leftIcon = this.getLeftIconName();
|
302
|
-
return (h(Host, null, this.showChips && (h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon && (h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" })), h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" }))), h("
|
231
|
+
return (h(Host, null, this.showChips && (h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip(), onClick: (event) => this.togglePopover(event), disableAutoUpdateValue: true }, leftIcon && (h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" })), h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter", onClick: (event) => this.clearFilter(event) }))), h("ez-popover-core", { ref: elem => this._popover = elem, onEzVisibilityChange: (event) => this.handleVisibilityPopover(event) }, h("snk-filter-detail", { key: this.config.id, config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", "data-element-id": this._idSnkFilterDetail, showHardFixed: this.showChips }))));
|
303
232
|
}
|
304
233
|
static get is() { return "snk-filter-item"; }
|
234
|
+
static get encapsulation() { return "scoped"; }
|
235
|
+
static get originalStyleUrls() {
|
236
|
+
return {
|
237
|
+
"$": ["snk-filter-item.css"]
|
238
|
+
};
|
239
|
+
}
|
240
|
+
static get styleUrls() {
|
241
|
+
return {
|
242
|
+
"$": ["snk-filter-item.css"]
|
243
|
+
};
|
244
|
+
}
|
305
245
|
static get properties() {
|
306
246
|
return {
|
307
247
|
"config": {
|
@@ -448,18 +388,6 @@ export class SnkFilterItem {
|
|
448
388
|
}
|
449
389
|
static get listeners() {
|
450
390
|
return [{
|
451
|
-
"name": "click",
|
452
|
-
"method": "clickListener",
|
453
|
-
"target": undefined,
|
454
|
-
"capture": true,
|
455
|
-
"passive": false
|
456
|
-
}, {
|
457
|
-
"name": "mousedown",
|
458
|
-
"method": "mouseDownListener",
|
459
|
-
"target": undefined,
|
460
|
-
"capture": true,
|
461
|
-
"passive": false
|
462
|
-
}, {
|
463
391
|
"name": "filterChange",
|
464
392
|
"method": "filterChangeListener",
|
465
393
|
"target": undefined,
|
package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js
CHANGED
@@ -230,6 +230,9 @@ export class DatasetStrategy {
|
|
230
230
|
if (![UserInterface.SEARCH, UserInterface.SEARCHPLUS].includes(descriptor.userInterface)) {
|
231
231
|
return undefined;
|
232
232
|
}
|
233
|
+
if (!descriptor.properties) {
|
234
|
+
return undefined;
|
235
|
+
}
|
233
236
|
const { ENTITYNAME, mergedFrom, DESCRIPTIONFIELD } = descriptor.properties;
|
234
237
|
if (!StringUtils.isEmpty(DESCRIPTIONFIELD)) {
|
235
238
|
return mergedFrom != undefined ? `${mergedFrom}.${ENTITYNAME}.${DESCRIPTIONFIELD}` : `${ENTITYNAME}.${DESCRIPTIONFIELD}`;
|
@@ -501,6 +501,9 @@ class DatasetStrategy {
|
|
501
501
|
if (![UserInterface.SEARCH, UserInterface.SEARCHPLUS].includes(descriptor.userInterface)) {
|
502
502
|
return undefined;
|
503
503
|
}
|
504
|
+
if (!descriptor.properties) {
|
505
|
+
return undefined;
|
506
|
+
}
|
504
507
|
const { ENTITYNAME, mergedFrom, DESCRIPTIONFIELD } = descriptor.properties;
|
505
508
|
if (!StringUtils.isEmpty(DESCRIPTIONFIELD)) {
|
506
509
|
return mergedFrom != undefined ? `${mergedFrom}.${ENTITYNAME}.${DESCRIPTIONFIELD}` : `${ENTITYNAME}.${DESCRIPTIONFIELD}`;
|
@@ -96,6 +96,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
96
96
|
this.layoutFormConfig = false;
|
97
97
|
this.multipleEditionEnabled = true;
|
98
98
|
this.paginationCounterMode = 'auto';
|
99
|
+
this.layoutFormConfig = false;
|
99
100
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
100
101
|
}
|
101
102
|
/**
|
@@ -96,8 +96,10 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
96
96
|
return (_d = (_b = (_a = config.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : (_c = config === null || config === void 0 ? void 0 : config.value) === null || _c === void 0 ? void 0 : _c.members) !== null && _d !== void 0 ? _d : config === null || config === void 0 ? void 0 : config.value;
|
97
97
|
}
|
98
98
|
render() {
|
99
|
-
var _a, _b;
|
100
|
-
|
99
|
+
var _a, _b, _c;
|
100
|
+
const isSearchPlus = ((_a = this.config.props) === null || _a === void 0 ? void 0 : _a["useSearchPlus"]) == true;
|
101
|
+
const TagName = isSearchPlus ? "ez-search-plus" : "ez-search";
|
102
|
+
return (h(Host, null, h(TagName, { ref: elem => this._searchElement = elem, optionLoader: argument => this.optionLoader(argument), value: this._searchValue, label: (_b = this.config) === null || _b === void 0 ? void 0 : _b.label, onEzChange: evt => this.onEzSearchChange(evt), suppressEmptyOption: true }), ((_c = this._ezListSource) === null || _c === void 0 ? void 0 : _c.length) > 0 && (h("label", { class: "label" }, this.getMessage("snkEntityList.selected"))), h("div", { style: this.maxHeightList ? { 'max-height': this.maxHeightList } : {}, class: { "snk-entity-list--overflow": !!this.maxHeightList } }, h("ez-list", { ref: (el) => this._ezList = el, id: "snkEntityList", listMode: "check", dataSource: this._ezListSource, hoverFeedback: true, itemSlotBuilder: this.rightListSlotBuilder, onEzCheckChange: evt => this.ezListChangeListener(evt) }))));
|
101
103
|
}
|
102
104
|
static get watchers() { return {
|
103
105
|
"config": ["observeConfig"]
|
@@ -25,6 +25,7 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
25
25
|
var _a, _b;
|
26
26
|
this._editor && (this._editor["config"] = newValue);
|
27
27
|
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["reloadList"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
28
|
+
this._customElementObject = this.getContentEditor();
|
28
29
|
}
|
29
30
|
componentDidLoad() {
|
30
31
|
if (this._element) {
|
@@ -161,9 +162,10 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
161
162
|
}
|
162
163
|
componentWillLoad() {
|
163
164
|
this.originalConfig = ObjectUtils.copy(this.config);
|
165
|
+
this._customElementObject = this.getContentEditor();
|
164
166
|
}
|
165
167
|
render() {
|
166
|
-
const { tag: CustomElement, props } = this.
|
168
|
+
const { tag: CustomElement, props } = this._customElementObject;
|
167
169
|
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(CustomElement, Object.assign({ maxHeightList: '240px', ref: ref => this._editor = ref, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt), "data-element-id": this._idContentEditor, getMessage: this.getMessage, rightListSlotBuilder: item => this.buildRightSlot(item) }, props)), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, this.filterCanBeCleared() && (h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.clear(), size: "small" })), h("ez-button", { ref: ref => this._applyButton = ref, label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
|
168
170
|
}
|
169
171
|
get _element() { return this; }
|
@@ -1,22 +1,17 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
|
-
import {
|
2
|
+
import { DateUtils, MaskFormatter, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
4
4
|
import { F as FilterNumberVariation } from './filterNumberVariation.js';
|
5
5
|
import { d as defineCustomElement$1 } from './snk-filter-detail2.js';
|
6
6
|
|
7
|
+
const snkFilterItemCss = "ez-popover-core.sc-snk-filter-item{--ez-popover__box--z-index:var(--elevation--20, 20);--ez-popover__box--overlay-z-index:var(--elevation--16, 16)}";
|
8
|
+
|
7
9
|
const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
8
10
|
constructor() {
|
9
11
|
super();
|
10
12
|
this.__registerHost();
|
11
13
|
this.visibleChanged = createEvent(this, "visibleChanged", 7);
|
12
14
|
this.filterChange = createEvent(this, "filterChange", 3);
|
13
|
-
this.innerClickCheck = (_floatingContainer, node) => {
|
14
|
-
if (node.id != FloatingManager.MODAL_ELEMENT_ID) {
|
15
|
-
return true;
|
16
|
-
}
|
17
|
-
this.detailIsVisible = false;
|
18
|
-
return false;
|
19
|
-
};
|
20
15
|
this.detailIsVisible = undefined;
|
21
16
|
this.config = undefined;
|
22
17
|
this.getMessage = undefined;
|
@@ -25,57 +20,28 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
25
20
|
observeDetailIsVisible(value) {
|
26
21
|
this.visibleChanged.emit(value);
|
27
22
|
}
|
23
|
+
/**
|
24
|
+
* Emitido quando o estado do filtro é alterado.
|
25
|
+
*/
|
26
|
+
filterChangeListener() {
|
27
|
+
this.hideDetail();
|
28
|
+
}
|
28
29
|
/**
|
29
30
|
* Exibe os detalhes de um item da lista.
|
30
31
|
*/
|
31
32
|
async showUp(open = false) {
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
(_a = this._chipElement) === null || _a === void 0 ? void 0 : _a.blur();
|
38
|
-
window.requestAnimationFrame(() => {
|
39
|
-
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, this.getFloatOptions());
|
40
|
-
this._popover.show();
|
41
|
-
this.detailIsVisible = true;
|
42
|
-
});
|
43
|
-
}
|
44
|
-
});
|
45
|
-
}
|
46
|
-
updatePosition() {
|
47
|
-
if (this._floatingID == undefined) {
|
48
|
-
return;
|
33
|
+
var _a;
|
34
|
+
this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
|
35
|
+
if (open) {
|
36
|
+
await ((_a = this._chipElement) === null || _a === void 0 ? void 0 : _a.setBlur());
|
37
|
+
await this._popover.showUnder(this._chipElement);
|
49
38
|
}
|
50
|
-
FloatingManager.updateFloatPosition(this._popover, this._popoverContainer, this.getFloatOptions());
|
51
39
|
}
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
left: this.getOffsetLeft(),
|
58
|
-
top: this.getOffsetTop(),
|
59
|
-
useOverlay: true,
|
60
|
-
overlayClassName: 'ez-scrim ez-scrim--light',
|
61
|
-
isFixed: true
|
62
|
-
};
|
63
|
-
}
|
64
|
-
getOffsetLeft() {
|
65
|
-
const padding = getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");
|
66
|
-
const rect = this._filterItemElement.getBoundingClientRect();
|
67
|
-
// Width baseado no conteudo do snk-filter-detail. Nesse momento ele retorna 0px pois ainda não foi criado em tela.
|
68
|
-
const filterDetailWidth = 430;
|
69
|
-
const adjustRightPosition = filterDetailWidth - (document.body.clientWidth - rect.left);
|
70
|
-
return `calc(${rect.x}px + ${padding} - ${adjustRightPosition > 0 ? adjustRightPosition : 0}px)`;
|
71
|
-
}
|
72
|
-
getOffsetTop() {
|
73
|
-
const rect = this._filterItemElement.getBoundingClientRect();
|
74
|
-
return (rect.y + rect.height) + "px";
|
75
|
-
}
|
76
|
-
controlScrollPage() {
|
77
|
-
window.removeEventListener("scroll", this.updatePosition.bind(this));
|
78
|
-
window.addEventListener("scroll", this.updatePosition.bind(this));
|
40
|
+
/**
|
41
|
+
* Oculta os detalhes de um item da lista.
|
42
|
+
*/
|
43
|
+
async hideDetail() {
|
44
|
+
await this._popover.hide();
|
79
45
|
}
|
80
46
|
getConfigChanges() {
|
81
47
|
var _a;
|
@@ -88,51 +54,24 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
88
54
|
const newValue = hasMultiValues ? configToBeCleared.value.map((valueItem) => (Object.assign(Object.assign({}, valueItem), { check: false }))) : undefined;
|
89
55
|
return Object.assign(Object.assign({}, configToBeCleared), { value: newValue });
|
90
56
|
}
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
if (this._floatingID != undefined) {
|
97
|
-
FloatingManager.close(this._floatingID);
|
98
|
-
}
|
57
|
+
clearFilter(event) {
|
58
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
59
|
+
if (this.canClearFilter()) {
|
60
|
+
const configChanged = this.getConfigChanges();
|
61
|
+
this.filterChange.emit(configChanged);
|
99
62
|
}
|
100
|
-
|
101
|
-
|
102
|
-
this._floatingID = undefined;
|
103
|
-
this.detailIsVisible = false;
|
104
|
-
if (this._closeCallback) {
|
105
|
-
this._closeCallback();
|
106
|
-
this._closeCallback = undefined;
|
63
|
+
else {
|
64
|
+
this.togglePopover();
|
107
65
|
}
|
108
66
|
}
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
if (evt.target === this._rightIconElement && this.canClearFilter()) {
|
115
|
-
const configChanged = this.getConfigChanges();
|
116
|
-
this.filterChange.emit(configChanged);
|
117
|
-
}
|
118
|
-
else {
|
119
|
-
if (this.detailIsVisible) {
|
120
|
-
this.hideDetail();
|
121
|
-
}
|
122
|
-
else {
|
123
|
-
this.showUp(true);
|
124
|
-
}
|
125
|
-
}
|
126
|
-
evt.preventDefault();
|
127
|
-
evt.stopImmediatePropagation();
|
128
|
-
evt.stopPropagation();
|
67
|
+
async togglePopover(event) {
|
68
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
69
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
70
|
+
if (this.detailIsVisible) {
|
71
|
+
await this.hideDetail();
|
129
72
|
}
|
130
|
-
|
131
|
-
|
132
|
-
if (this.detailIsVisible && [this._chipElement, this._leftIconElement, this._rightIconElement].includes(evt.target)) {
|
133
|
-
evt.preventDefault();
|
134
|
-
evt.stopImmediatePropagation();
|
135
|
-
evt.stopPropagation();
|
73
|
+
else {
|
74
|
+
await this.showUp(true);
|
136
75
|
}
|
137
76
|
}
|
138
77
|
getLabel(isTooltipLabel = false) {
|
@@ -253,20 +192,6 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
253
192
|
ElementIDUtils.addIDInfo(this._filterItemElement);
|
254
193
|
this._idSnkFilterDetail = `filterDetail_${this.config.id}`;
|
255
194
|
}
|
256
|
-
this.controlScrollPage();
|
257
|
-
}
|
258
|
-
componentDidRender() {
|
259
|
-
if (this._floatingID == undefined) {
|
260
|
-
if (this._popover) {
|
261
|
-
this._popover.remove();
|
262
|
-
}
|
263
|
-
}
|
264
|
-
}
|
265
|
-
/**
|
266
|
-
* Emitido quando o estado do filtro é alterado.
|
267
|
-
*/
|
268
|
-
filterChangeListener() {
|
269
|
-
this.hideDetail();
|
270
195
|
}
|
271
196
|
canClearFilter() {
|
272
197
|
const { value, groupedItems = [] } = this.config;
|
@@ -297,28 +222,35 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
297
222
|
return (config.type !== FilterItemType.MULTI_LIST && config.value !== undefined) || this.hasActiveElements(config.value);
|
298
223
|
}
|
299
224
|
getEnabledChip() {
|
225
|
+
if (this.detailIsVisible) {
|
226
|
+
return true;
|
227
|
+
}
|
300
228
|
if (this.config.type === FilterItemType.PERSONALIZED) {
|
301
229
|
const { groupedItems = [] } = this.config;
|
302
230
|
return groupedItems.some(item => item.visible);
|
303
231
|
}
|
304
232
|
return this.hasActiveValue(this.config);
|
305
233
|
}
|
234
|
+
handleVisibilityPopover(event) {
|
235
|
+
this.detailIsVisible = event.detail;
|
236
|
+
}
|
306
237
|
render() {
|
307
238
|
const leftIcon = this.getLeftIconName();
|
308
|
-
return (h(Host, null, this.showChips && (h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon && (h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" })), h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" }))), h("
|
239
|
+
return (h(Host, null, this.showChips && (h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip(), onClick: (event) => this.togglePopover(event), disableAutoUpdateValue: true }, leftIcon && (h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" })), h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter", onClick: (event) => this.clearFilter(event) }))), h("ez-popover-core", { ref: elem => this._popover = elem, onEzVisibilityChange: (event) => this.handleVisibilityPopover(event) }, h("snk-filter-detail", { key: this.config.id, config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", "data-element-id": this._idSnkFilterDetail, showHardFixed: this.showChips }))));
|
309
240
|
}
|
310
241
|
get _filterItemElement() { return this; }
|
311
242
|
static get watchers() { return {
|
312
243
|
"detailIsVisible": ["observeDetailIsVisible"]
|
313
244
|
}; }
|
314
|
-
|
245
|
+
static get style() { return snkFilterItemCss; }
|
246
|
+
}, [2, "snk-filter-item", {
|
315
247
|
"config": [1040],
|
316
248
|
"getMessage": [16],
|
317
249
|
"showChips": [4, "show-chips"],
|
318
250
|
"detailIsVisible": [32],
|
319
251
|
"showUp": [64],
|
320
252
|
"hideDetail": [64]
|
321
|
-
}, [[
|
253
|
+
}, [[0, "filterChange", "filterChangeListener"]]]);
|
322
254
|
function defineCustomElement() {
|
323
255
|
if (typeof customElements === "undefined") {
|
324
256
|
return;
|
@@ -79,21 +79,23 @@ const SnkFilterPersonalized = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
79
79
|
var _a, _b;
|
80
80
|
const params = (_b = (_a = parentItem === null || parentItem === void 0 ? void 0 : parentItem.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters;
|
81
81
|
return params.map((param, index) => {
|
82
|
-
var _a, _b, _c;
|
82
|
+
var _a, _b, _c, _d;
|
83
83
|
const formProp = Object.assign(Object.assign({}, param), { id: parentItem.id });
|
84
84
|
const value = (_a = parentItem.value) === null || _a === void 0 ? void 0 : _a[index];
|
85
85
|
const elemId = 'param_' + index;
|
86
86
|
switch (param.userInterface) {
|
87
87
|
case UserInterface.SEARCH:
|
88
|
-
|
88
|
+
const isSearchPlus = ((_b = this.config.props) === null || _b === void 0 ? void 0 : _b["useSearchPlus"]) == true;
|
89
|
+
const TagName = isSearchPlus ? "ez-search-plus" : "ez-search";
|
90
|
+
return h(TagName, { id: elemId, suppressEmptyOption: true, value: value, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp), label: param.label, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, param) });
|
89
91
|
case UserInterface.SWITCH:
|
90
92
|
case UserInterface.CHECKBOX:
|
91
93
|
const mode = UserInterface.SWITCH === param.userInterface ? CheckMode.SWITCH : CheckMode.REGULAR;
|
92
94
|
return h("ez-check", { id: elemId, class: "ez-padding-bottom--medium", mode: mode, value: value, label: param.label, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
|
93
95
|
case UserInterface.DECIMALNUMBER:
|
94
|
-
return h("ez-number-input", { id: elemId, label: param.label, value: value, precision: ((
|
96
|
+
return h("ez-number-input", { id: elemId, label: param.label, value: value, precision: ((_c = param.props) === null || _c === void 0 ? void 0 : _c.precision) || 2, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
|
95
97
|
case UserInterface.INTEGERNUMBER:
|
96
|
-
return h("ez-number-input", { id: elemId, label: param.label, value: value, precision: (
|
98
|
+
return h("ez-number-input", { id: elemId, label: param.label, value: value, precision: (_d = param.props) === null || _d === void 0 ? void 0 : _d.precision, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
|
97
99
|
case UserInterface.OPTIONSELECTOR:
|
98
100
|
return h("ez-combo-box", { id: elemId, label: param.label, value: value, options: param.options, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
|
99
101
|
case UserInterface.DATE:
|
package/dist/esm/{ClientSideExporterProvider-c56c2549.js → ClientSideExporterProvider-09dee1a3.js}
RENAMED
@@ -4,7 +4,7 @@ import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, St
|
|
4
4
|
import { D as DataExporterOption } from './index-b40568ff.js';
|
5
5
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
6
6
|
import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
7
|
-
import { P as PreloadManager } from './dataunit-fetcher-
|
7
|
+
import { P as PreloadManager } from './dataunit-fetcher-1b78797a.js';
|
8
8
|
import './filter-item-type.enum-d45e026f.js';
|
9
9
|
import './form-config-fetcher-e623539b.js';
|
10
10
|
import './constants-7b422de0.js';
|
@@ -501,6 +501,9 @@ class DatasetStrategy {
|
|
501
501
|
if (![UserInterface.SEARCH, UserInterface.SEARCHPLUS].includes(descriptor.userInterface)) {
|
502
502
|
return undefined;
|
503
503
|
}
|
504
|
+
if (!descriptor.properties) {
|
505
|
+
return undefined;
|
506
|
+
}
|
504
507
|
const { ENTITYNAME, mergedFrom, DESCRIPTIONFIELD } = descriptor.properties;
|
505
508
|
if (!StringUtils.isEmpty(DESCRIPTIONFIELD)) {
|
506
509
|
return mergedFrom != undefined ? `${mergedFrom}.${ENTITYNAME}.${DESCRIPTIONFIELD}` : `${ENTITYNAME}.${DESCRIPTIONFIELD}`;
|