@sankhyalabs/sankhyablocks 5.6.0 → 5.7.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/{SnkMessageBuilder-e64dce7f.js → SnkMessageBuilder-056d1c24.js} +9 -1
- package/dist/cjs/{filter-item-type.enum-3daf58d3.js → filter-item-type.enum-aa823a00.js} +1 -0
- package/dist/cjs/filter-type.enum-b14ce507.js +11 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/presentationMode-52ec3bdd.js +7 -0
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-85d6565e.js → snk-data-unit-289081c4.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +52 -140
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +8 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +66 -0
- package/dist/cjs/snk-filter-modal.cjs.entry.js +72 -49
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +11 -2
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-search.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +2 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/presentationMode.js +5 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +47 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +50 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +1 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +31 -2
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +116 -156
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.css +4 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +115 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +19 -142
- package/dist/collection/components/snk-filter-bar/types/filter-type.enum.js +7 -0
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +36 -0
- package/dist/collection/components/snk-filter-bar/utils/filters-mock.js +315 -0
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +9 -1
- package/dist/components/SnkMessageBuilder.js +9 -1
- package/dist/components/filter-item-type.enum.js +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/presentationMode.js +7 -0
- package/dist/components/snk-crud.js +22 -34
- package/dist/components/snk-detail-view2.js +24 -46
- package/dist/components/snk-filter-bar2.js +57 -157
- package/dist/components/snk-filter-binary-select.js +9 -1
- package/dist/components/snk-filter-list.js +171 -1
- package/dist/components/snk-filter-modal-item.d.ts +11 -0
- package/dist/components/snk-filter-modal-item.js +6 -0
- package/dist/components/snk-filter-modal-item2.js +85 -0
- package/dist/components/snk-filter-modal.js +118 -1
- package/dist/components/snk-filter-multi-select.js +3 -1
- package/dist/components/snk-filter-number.js +3 -1
- package/dist/components/snk-filter-period.js +12 -2
- package/dist/components/snk-filter-personalized.js +3 -1
- package/dist/components/snk-filter-search.js +3 -1
- package/dist/components/snk-filter-text.js +3 -1
- package/dist/components/snk-grid2.js +10 -22
- package/dist/esm/{SnkMessageBuilder-f3590f65.js → SnkMessageBuilder-23272e07.js} +9 -1
- package/dist/esm/{filter-item-type.enum-a79b2fa8.js → filter-item-type.enum-5028ed3f.js} +1 -0
- package/dist/esm/filter-type.enum-a80c1b6b.js +9 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/presentationMode-783bbf9d.js +7 -0
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-50b1660c.js → snk-data-unit-34dc5371.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +53 -141
- package/dist/esm/snk-filter-binary-select.entry.js +9 -2
- package/dist/esm/snk-filter-detail.entry.js +1 -1
- package/dist/esm/snk-filter-item.entry.js +1 -1
- package/dist/esm/snk-filter-modal-item.entry.js +62 -0
- package/dist/esm/snk-filter-modal.entry.js +73 -50
- package/dist/esm/snk-filter-multi-select.entry.js +4 -2
- package/dist/esm/snk-filter-number.entry.js +4 -2
- package/dist/esm/snk-filter-period.entry.js +12 -3
- package/dist/esm/snk-filter-personalized.entry.js +4 -2
- package/dist/esm/snk-filter-search.entry.js +4 -2
- package/dist/esm/snk-filter-text.entry.js +3 -1
- package/dist/sankhyablocks/{p-f344b811.entry.js → p-0110b7da.entry.js} +1 -1
- package/dist/sankhyablocks/p-1a68fb59.js +1 -0
- package/dist/sankhyablocks/{p-3d3263b4.js → p-3db1d3de.js} +1 -1
- package/dist/sankhyablocks/p-45ee8b22.entry.js +1 -0
- package/dist/sankhyablocks/p-4ce96831.entry.js +1 -0
- package/dist/sankhyablocks/{p-9dd2b8cb.js → p-584d7212.js} +1 -1
- package/dist/sankhyablocks/{p-c4417efb.entry.js → p-64b03506.entry.js} +1 -1
- package/dist/sankhyablocks/p-7695c404.entry.js +1 -0
- package/dist/sankhyablocks/p-786ae316.entry.js +1 -0
- package/dist/sankhyablocks/p-82bc97da.entry.js +1 -0
- package/dist/sankhyablocks/p-8efb0f47.entry.js +1 -0
- package/dist/sankhyablocks/p-9af04fc7.entry.js +1 -0
- package/dist/sankhyablocks/{p-3a2ce158.entry.js → p-a1c58536.entry.js} +1 -1
- package/dist/sankhyablocks/{p-afba9bbe.entry.js → p-bdbb2672.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3fbe2d69.entry.js → p-c1ab16d0.entry.js} +2 -2
- package/dist/sankhyablocks/p-d9804798.js +1 -0
- package/dist/sankhyablocks/p-e2bb9c9a.entry.js +1 -0
- package/dist/sankhyablocks/p-ed3d6ab4.entry.js +1 -0
- package/dist/sankhyablocks/p-ee1381f4.entry.js +1 -0
- package/dist/sankhyablocks/p-f5f36fbb.js +1 -0
- package/dist/sankhyablocks/p-ffac37d5.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/editors/enum/presentationMode.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +5 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +2 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +3 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +37 -0
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +17 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +2 -11
- package/dist/types/components/snk-filter-bar/types/filter-type.enum.d.ts +6 -0
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +20 -0
- package/dist/types/components/snk-filter-bar/utils/filters-mock.d.ts +186 -0
- package/dist/types/components.d.ts +113 -54
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/components/snk-filter-list2.js +0 -173
- package/dist/components/snk-filter-modal2.js +0 -97
- package/dist/sankhyablocks/p-1dcfd32a.entry.js +0 -1
- package/dist/sankhyablocks/p-5e62a17b.entry.js +0 -1
- package/dist/sankhyablocks/p-5fc55684.entry.js +0 -1
- package/dist/sankhyablocks/p-73e830cf.entry.js +0 -1
- package/dist/sankhyablocks/p-86d29b6f.entry.js +0 -1
- package/dist/sankhyablocks/p-ad51bf1c.entry.js +0 -1
- package/dist/sankhyablocks/p-c336170d.entry.js +0 -1
- package/dist/sankhyablocks/p-c9477950.js +0 -1
- package/dist/sankhyablocks/p-d5c9c1f8.entry.js +0 -1
- package/dist/sankhyablocks/p-ee82c157.entry.js +0 -1
- package/dist/sankhyablocks/p-fac37198.entry.js +0 -1
@@ -1,15 +1,10 @@
|
|
1
|
-
import {
|
2
|
-
import { ApplicationContext, ElementIDUtils, ErrorException, ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
1
|
+
import { ApplicationContext, ElementIDUtils, ErrorException, ObjectUtils } from '@sankhyalabs/core';
|
3
2
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
4
|
-
import
|
5
|
-
import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
6
|
-
import buildFilter from './filter-item/dataunitfilter/data-unit-filter-builder';
|
3
|
+
import { h, Host } from '@stencil/core';
|
7
4
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
const ADD_FILTER = "ADD_FILTER";
|
12
|
-
const APPLIED_FILTERS = "APPLIED_FILTERS";
|
5
|
+
import buildFilter from './filter-item/dataunitfilter/data-unit-filter-builder';
|
6
|
+
import FilterItemType from './filter-item/filter-item-type.enum';
|
7
|
+
import SnkFilterModalFactory from './utils/SnkFilterModalFactory';
|
13
8
|
export class SnkFilterBar {
|
14
9
|
constructor() {
|
15
10
|
this._updateSequence = [];
|
@@ -96,9 +91,9 @@ export class SnkFilterBar {
|
|
96
91
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
97
92
|
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-filter-bar.msg.ts"
|
98
93
|
*/
|
99
|
-
getMessage(key, params) {
|
94
|
+
getMessage(key, params, defaultValue) {
|
100
95
|
var _a;
|
101
|
-
return (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
|
96
|
+
return ((_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params)) || defaultValue;
|
102
97
|
}
|
103
98
|
getFilter(_dataUnit) {
|
104
99
|
var _a;
|
@@ -187,110 +182,6 @@ export class SnkFilterBar {
|
|
187
182
|
return item;
|
188
183
|
}).sort((a, b) => this._filtersComparator(a, b));
|
189
184
|
}
|
190
|
-
getAddListItems() {
|
191
|
-
const hiddenItems = this.filterConfig
|
192
|
-
.filter(item => !item.visible && this.isListable(item));
|
193
|
-
const footerItems = [{ name: PERSONALIZED_FILTER, label: this.getMessage("snkFilterBar.customFilter"), iconName: "tune", kind: "FOOTER" }];
|
194
|
-
if (this.allowDefault) {
|
195
|
-
footerItems.push({ name: DEFAULT_FILTER, label: this.getMessage("snkFilterBar.defaultFilter"), iconName: "configuration", kind: "FOOTER" });
|
196
|
-
}
|
197
|
-
return hiddenItems.map(filter => { return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null }; })
|
198
|
-
.concat(footerItems);
|
199
|
-
}
|
200
|
-
getActiveClass() {
|
201
|
-
const filterApplied = this.filterConfig.filter(item => item.value != undefined).length > 0;
|
202
|
-
return filterApplied ? "sc-snk-filter-bar snk-filter-bar__filter-list-items-button--active" : "";
|
203
|
-
}
|
204
|
-
isListable(item, allowPersonalized = false) {
|
205
|
-
return item.type !== FilterItemType.DEFAULT_FILTER && (allowPersonalized || item.type !== FilterItemType.PERSONALIZED);
|
206
|
-
}
|
207
|
-
getAppliedListItems() {
|
208
|
-
const appliedItems = this.filterConfig
|
209
|
-
.filter(item => this.isActiveFilter(item) && this.isListable(item, true));
|
210
|
-
return appliedItems.map(filter => {
|
211
|
-
return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null };
|
212
|
-
}).concat([
|
213
|
-
{ name: CLEAR_ALL_FILTERS, label: this.getMessage("snkFilterBar.clearAllFilters"), iconName: "cleaning", kind: "FOOTER" }
|
214
|
-
]);
|
215
|
-
}
|
216
|
-
addPersonalizedFilters(personalizedItems) {
|
217
|
-
const activeFilters = {};
|
218
|
-
personalizedItems.forEach(item => {
|
219
|
-
if (item.active) {
|
220
|
-
activeFilters[item.id] = true;
|
221
|
-
}
|
222
|
-
});
|
223
|
-
this.filterConfig = this.filterConfig.map(item => {
|
224
|
-
var _a, _b;
|
225
|
-
if (item.type === FilterItemType.PERSONALIZED) {
|
226
|
-
const visible = activeFilters[item.id];
|
227
|
-
if (!item.visible && visible) {
|
228
|
-
this.calculateUpdateSequence(item);
|
229
|
-
if (((_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters) != undefined) {
|
230
|
-
this._pendingFilters.push(item.id);
|
231
|
-
}
|
232
|
-
}
|
233
|
-
return this.normalizeItem(visible ? Object.assign(Object.assign({}, item), { visible }) : Object.assign(Object.assign({}, item), { visible, value: undefined, fixed: undefined }));
|
234
|
-
}
|
235
|
-
return item;
|
236
|
-
}).sort((a, b) => this._filtersComparator(a, b));
|
237
|
-
}
|
238
|
-
openDefaultFilterModal() {
|
239
|
-
const filterModal = document.createElement("snk-filter-modal");
|
240
|
-
const defaultFilter = this.filterConfig.filter(item => item.type === FilterItemType.DEFAULT_FILTER);
|
241
|
-
filterModal.getMessage = (key, props) => this.getMessage(key, props);
|
242
|
-
filterModal.modalTitle = this.getMessage("snkFilterBar.modalDefaultFilterTitle");
|
243
|
-
filterModal.infoText = this.getMessage(defaultFilter.length == 0 ? "snkFilterBar.modalInfoTextCreateDefault" : "snkFilterBar.modalInfoTextEditDefault");
|
244
|
-
filterModal.items = defaultFilter.map(item => {
|
245
|
-
return { id: item.id, active: true, enabled: false, label: item.label };
|
246
|
-
});
|
247
|
-
filterModal.processModalAction = (_action) => {
|
248
|
-
this._application.closeModal();
|
249
|
-
};
|
250
|
-
this._application.showModal(filterModal);
|
251
|
-
}
|
252
|
-
openPersonalizedModal() {
|
253
|
-
const filterModal = document.createElement("snk-filter-modal");
|
254
|
-
const personalizedFilter = this.filterConfig
|
255
|
-
.filter(item => item.type === FilterItemType.PERSONALIZED)
|
256
|
-
.sort((itemA, itemB) => StringUtils.compare(itemA.label, itemB.label));
|
257
|
-
filterModal.getMessage = (key, props) => this.getMessage(key, props);
|
258
|
-
filterModal.modalTitle = this.getMessage("snkFilterBar.modalPersonalizedFilterTitle");
|
259
|
-
filterModal.modalSubTitle = this.getMessage("snkFilterBar.modalPersonalizedFilterSubTitle");
|
260
|
-
filterModal.okButtonLabel = this.getMessage("snkFilterBar.modalOkButtonLabel");
|
261
|
-
filterModal.cancelButtonLabel = this.getMessage("snkFilterBar.modalCancelButtonLabel");
|
262
|
-
filterModal.infoText = this.getMessage("snkFilterBar.modalInfoTextCreateEditPersonalized");
|
263
|
-
filterModal.useSearch = true;
|
264
|
-
filterModal.items = personalizedFilter.map(item => {
|
265
|
-
return { id: item.id, active: item.visible, enabled: true, label: item.label };
|
266
|
-
});
|
267
|
-
filterModal.processModalAction = (action) => {
|
268
|
-
if (action === ModalAction.CANCEL) {
|
269
|
-
// O Botão de cancelar, tem efeito específico:
|
270
|
-
// - Desmarcar todos os filtros personalizados.
|
271
|
-
filterModal.items = filterModal.items.map(item => {
|
272
|
-
return Object.assign(Object.assign({}, item), { active: false });
|
273
|
-
});
|
274
|
-
}
|
275
|
-
else {
|
276
|
-
if (action === ModalAction.OK) {
|
277
|
-
this.addPersonalizedFilters(filterModal.items);
|
278
|
-
}
|
279
|
-
this._application.closeModal();
|
280
|
-
}
|
281
|
-
};
|
282
|
-
this._application.showModal(filterModal);
|
283
|
-
}
|
284
|
-
clearFilters() {
|
285
|
-
let changed = false;
|
286
|
-
this.filterConfig = this.filterConfig.map(item => {
|
287
|
-
if (item.value != undefined) {
|
288
|
-
changed = true;
|
289
|
-
}
|
290
|
-
return Object.assign(Object.assign({}, item), { value: undefined });
|
291
|
-
}).sort((a, b) => this._filtersComparator(a, b));
|
292
|
-
return changed;
|
293
|
-
}
|
294
185
|
loadPermitions() {
|
295
186
|
this._application.isUserSup().then(value => this.allowDefault = value);
|
296
187
|
}
|
@@ -339,31 +230,17 @@ export class SnkFilterBar {
|
|
339
230
|
filterChangeListener(evt) {
|
340
231
|
this.updateFilter(evt.detail);
|
341
232
|
}
|
342
|
-
|
343
|
-
const
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
}
|
354
|
-
}
|
355
|
-
appliedFilterHandler(itemName) {
|
356
|
-
if (itemName === CLEAR_ALL_FILTERS) {
|
357
|
-
if (this.clearFilters()) {
|
358
|
-
this._application.info(this.getMessage("snkFilterBar.successfullyCleaned"), { iconName: "check" });
|
359
|
-
}
|
360
|
-
}
|
361
|
-
else {
|
362
|
-
const filterItemElement = this._element.querySelector("#filter-" + itemName);
|
363
|
-
if (filterItemElement) {
|
364
|
-
filterItemElement.showUp(true);
|
365
|
-
}
|
366
|
-
}
|
233
|
+
async showFilterModal() {
|
234
|
+
const callbackOnApplyFilter = (filters) => {
|
235
|
+
this.filterConfig = filters.map(this.normalizeItem);
|
236
|
+
};
|
237
|
+
const factoryParams = {
|
238
|
+
filterConfig: this.filterConfig,
|
239
|
+
onComplete: callbackOnApplyFilter,
|
240
|
+
getMessage: (key, props) => this.getMessage(key, props)
|
241
|
+
};
|
242
|
+
const factory = new SnkFilterModalFactory(factoryParams);
|
243
|
+
await factory.showModal();
|
367
244
|
}
|
368
245
|
componentWillLoad() {
|
369
246
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
@@ -380,7 +257,7 @@ export class SnkFilterBar {
|
|
380
257
|
if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
|
381
258
|
return undefined;
|
382
259
|
}
|
383
|
-
return (h(Host, null, h("ez-scroller", { direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, this.getFilterItems()), h("
|
260
|
+
return (h(Host, null, h("ez-scroller", { direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, this.getFilterItems()), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
|
384
261
|
}
|
385
262
|
static get is() { return "snk-filter-bar"; }
|
386
263
|
static get encapsulation() { return "scoped"; }
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
|
2
|
+
class SnkFilterModalFactory {
|
3
|
+
constructor({ filterConfig, onComplete, getMessage }) {
|
4
|
+
this._filterConfig = filterConfig;
|
5
|
+
this._onComplete = onComplete;
|
6
|
+
this._getMessage = getMessage;
|
7
|
+
}
|
8
|
+
applyFilters(newFilterConfig) {
|
9
|
+
this._onComplete(newFilterConfig);
|
10
|
+
this._closeModal();
|
11
|
+
}
|
12
|
+
clearAll(filterConfigSnapshot) {
|
13
|
+
return filterConfigSnapshot.map(filterItem => (Object.assign(Object.assign({}, filterItem), { value: undefined })));
|
14
|
+
}
|
15
|
+
buildFilterModal() {
|
16
|
+
const filterModal = document.createElement("snk-filter-modal");
|
17
|
+
filterModal.filters = this._filterConfig;
|
18
|
+
filterModal.getMessage = this._getMessage.bind(this);
|
19
|
+
filterModal.applyFilters = this.applyFilters.bind(this);
|
20
|
+
filterModal.clearAll = this.clearAll.bind(this);
|
21
|
+
filterModal.closeModal = () => this._closeModal();
|
22
|
+
return filterModal;
|
23
|
+
}
|
24
|
+
async showModal() {
|
25
|
+
const filterModal = this.buildFilterModal();
|
26
|
+
const modalProps = {
|
27
|
+
content: filterModal,
|
28
|
+
position: 'left',
|
29
|
+
heightMode: 'full',
|
30
|
+
closeOutsideClick: false,
|
31
|
+
useScrimLight: true
|
32
|
+
};
|
33
|
+
this._closeModal = await ApplicationUtils.showModal(modalProps);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
export default SnkFilterModalFactory;
|
@@ -0,0 +1,315 @@
|
|
1
|
+
export const filtersMock = [
|
2
|
+
{
|
3
|
+
"id": "RECDESP",
|
4
|
+
"label": "Receitas + Despesas",
|
5
|
+
"detailTitle": "Selecione o que deseja ver",
|
6
|
+
"type": "BINARY_SELECT",
|
7
|
+
"props": {
|
8
|
+
"options": [
|
9
|
+
{
|
10
|
+
"name": "RECEITA",
|
11
|
+
"expression": "this.RECDESP = 1",
|
12
|
+
"label": "Receitas"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "DESPESA",
|
16
|
+
"expression": "this.RECDESP = -1",
|
17
|
+
"label": "Despesas"
|
18
|
+
}
|
19
|
+
]
|
20
|
+
},
|
21
|
+
"value": "DESPESA",
|
22
|
+
"hardFixed": true,
|
23
|
+
"visible": true,
|
24
|
+
"filterType": "QUICK_FILTERS",
|
25
|
+
"detailModal": "Movimento"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"id": "PROVISAO",
|
29
|
+
"label": "Real + Provisão",
|
30
|
+
"detailTitle": "Selecione o que deseja ver",
|
31
|
+
"type": "BINARY_SELECT",
|
32
|
+
"props": {
|
33
|
+
"options": [
|
34
|
+
{
|
35
|
+
"name": "REAL",
|
36
|
+
"expression": "nullvalue(this.PROVISAO, 'N') = 'N'",
|
37
|
+
"label": "Real"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"name": "PROVISAO",
|
41
|
+
"expression": "nullvalue(this.PROVISAO, 'N') = 'S'",
|
42
|
+
"label": "Provisão"
|
43
|
+
}
|
44
|
+
]
|
45
|
+
},
|
46
|
+
"value": "REAL",
|
47
|
+
"hardFixed": true,
|
48
|
+
"visible": true,
|
49
|
+
"filterType": "QUICK_FILTERS",
|
50
|
+
"detailModal": "Lançamento"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"id": "BAIXADO",
|
54
|
+
"label": "Pendentes + Baixados",
|
55
|
+
"detailTitle": "Selecione o que deseja ver",
|
56
|
+
"type": "BINARY_SELECT",
|
57
|
+
"props": {
|
58
|
+
"options": [
|
59
|
+
{
|
60
|
+
"name": "PENDENTE",
|
61
|
+
"expression": "this.DHBAIXA IS NULL",
|
62
|
+
"label": "Pendentes"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"name": "BAIXADO",
|
66
|
+
"expression": "this.DHBAIXA IS NOT NULL AND NOT nullvalue(this.PROVISAO, 'N') = 'S'",
|
67
|
+
"label": "Baixados"
|
68
|
+
}
|
69
|
+
]
|
70
|
+
},
|
71
|
+
"value": "PENDENTE",
|
72
|
+
"hardFixed": true,
|
73
|
+
"visible": true,
|
74
|
+
"filterType": "QUICK_FILTERS",
|
75
|
+
"detailModal": "Status"
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"id": "NUMNOTA",
|
79
|
+
"label": "Nr. Nota",
|
80
|
+
"detailTitle": "Informe o número da nota",
|
81
|
+
"type": "NUMBER",
|
82
|
+
"props": {
|
83
|
+
"expression": "this.NUMNOTA = :NUMNOTA"
|
84
|
+
},
|
85
|
+
"visible": true,
|
86
|
+
"filterType": "QUICK_FILTERS"
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"id": "NUFIN",
|
90
|
+
"label": "Nr. único",
|
91
|
+
"detailTitle": "Informe o número único",
|
92
|
+
"type": "NUMBER",
|
93
|
+
"props": {
|
94
|
+
"expression": "this.NUFIN = :NUFIN AND NOT (this.PROVISAO = 'S' AND this.DHBAIXA IS NOT NULL AND this.ORIGEM = 'E')"
|
95
|
+
},
|
96
|
+
"visible": true,
|
97
|
+
"filterType": "QUICK_FILTERS"
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"id": "DTVENC",
|
101
|
+
"label": "Dt. Vencimento",
|
102
|
+
"detailTitle": "Informe a data ou período",
|
103
|
+
"type": "PERIOD",
|
104
|
+
"props": {
|
105
|
+
"expression": {
|
106
|
+
"fullfill": "onlydate(this.DTVENC) >= :DTVENC.START AND onlydate(this.DTVENC) <= :DTVENC.END",
|
107
|
+
"onlystart": "onlydate(this.DTVENC) >= :DTVENC",
|
108
|
+
"onlyend": "onlydate(this.DTVENC) <= :DTVENC"
|
109
|
+
}
|
110
|
+
},
|
111
|
+
"visible": true,
|
112
|
+
"filterType": "QUICK_FILTERS"
|
113
|
+
},
|
114
|
+
{
|
115
|
+
"id": "0",
|
116
|
+
"label": "cartao",
|
117
|
+
"detailTitle": "cartao",
|
118
|
+
"type": "PERSONALIZED",
|
119
|
+
"props": {
|
120
|
+
"expression": "Financeiro.CODTIPTIT = 17",
|
121
|
+
"personalizedFilter": {
|
122
|
+
"parameters": []
|
123
|
+
}
|
124
|
+
},
|
125
|
+
"filterType": "OTHER_FILTERS"
|
126
|
+
},
|
127
|
+
{
|
128
|
+
"id": "1",
|
129
|
+
"label": "Origem Estoque",
|
130
|
+
"detailTitle": "Origem Estoque",
|
131
|
+
"type": "PERSONALIZED",
|
132
|
+
"props": {
|
133
|
+
"expression": "Financeiro.ORIGEM = 'E'",
|
134
|
+
"personalizedFilter": {
|
135
|
+
"parameters": []
|
136
|
+
}
|
137
|
+
},
|
138
|
+
"filterType": "CUSTOM_FILTERS"
|
139
|
+
},
|
140
|
+
{
|
141
|
+
"id": "CODPARC",
|
142
|
+
"label": "Parceiro",
|
143
|
+
"detailTitle": "Informe o parceiro",
|
144
|
+
"type": "SEARCH",
|
145
|
+
"props": {
|
146
|
+
"expression": "this.CODPARC = :CODPARC",
|
147
|
+
"searchContext": {
|
148
|
+
"entity": "Parceiro",
|
149
|
+
"entityDescription": "Parceiro",
|
150
|
+
"searchOptions": {
|
151
|
+
"rootEntity": "Financeiro",
|
152
|
+
"descriptionFieldName": "NOMEPARC",
|
153
|
+
"codeFieldName": "CODPARC",
|
154
|
+
"showInactives": false
|
155
|
+
}
|
156
|
+
}
|
157
|
+
},
|
158
|
+
"visible": true,
|
159
|
+
"filterType": "QUICK_FILTERS",
|
160
|
+
"detailModal": "Título"
|
161
|
+
},
|
162
|
+
{
|
163
|
+
"id": "DHBAIXA",
|
164
|
+
"label": "Data da Baixa",
|
165
|
+
"detailTitle": "Informe a data ou período",
|
166
|
+
"type": "PERIOD",
|
167
|
+
"props": {
|
168
|
+
"expression": {
|
169
|
+
"fullfill": "onlydate(this.DHBAIXA) >= :DHBAIXA.START AND onlydate(this.DHBAIXA) <= :DHBAIXA.END",
|
170
|
+
"onlystart": "onlydate(this.DHBAIXA) >= :DHBAIXA",
|
171
|
+
"onlyend": "onlydate(this.DHBAIXA) <= :DHBAIXA"
|
172
|
+
}
|
173
|
+
},
|
174
|
+
"visible": true,
|
175
|
+
"filterType": "OTHER_FILTERS"
|
176
|
+
},
|
177
|
+
{
|
178
|
+
"id": "CODEMP",
|
179
|
+
"label": "Empresa",
|
180
|
+
"detailTitle": "Informe a empresa",
|
181
|
+
"type": "SEARCH",
|
182
|
+
"props": {
|
183
|
+
"expression": "this.CODEMP = :CODEMP",
|
184
|
+
"searchContext": {
|
185
|
+
"entity": "Empresa",
|
186
|
+
"entityDescription": "Empresa",
|
187
|
+
"searchOptions": {
|
188
|
+
"rootEntity": "Financeiro",
|
189
|
+
"descriptionFieldName": "NOMEFANTASIA",
|
190
|
+
"codeFieldName": "CODEMP",
|
191
|
+
"showInactives": false
|
192
|
+
}
|
193
|
+
}
|
194
|
+
},
|
195
|
+
"filterType": "OTHER_FILTERS"
|
196
|
+
},
|
197
|
+
{
|
198
|
+
"id": "CODNAT",
|
199
|
+
"label": "Natureza",
|
200
|
+
"detailTitle": "Informe a natureza",
|
201
|
+
"type": "SEARCH",
|
202
|
+
"props": {
|
203
|
+
"expression": "this.CODNAT = :CODNAT",
|
204
|
+
"searchContext": {
|
205
|
+
"entity": "Natureza",
|
206
|
+
"entityDescription": "Natureza",
|
207
|
+
"searchOptions": {
|
208
|
+
"rootEntity": "Financeiro",
|
209
|
+
"descriptionFieldName": "DESCRNAT",
|
210
|
+
"codeFieldName": "CODNAT",
|
211
|
+
"showInactives": false
|
212
|
+
}
|
213
|
+
}
|
214
|
+
},
|
215
|
+
"filterType": "OTHER_FILTERS"
|
216
|
+
},
|
217
|
+
{
|
218
|
+
"id": "DTNEG",
|
219
|
+
"label": "Dt. Negociação",
|
220
|
+
"detailTitle": "Informe a data ou período",
|
221
|
+
"type": "PERIOD",
|
222
|
+
"props": {
|
223
|
+
"expression": {
|
224
|
+
"fullfill": "onlydate(this.DTNEG) >= :DTNEG.START AND onlydate(this.DTNEG) <= :DTNEG.END",
|
225
|
+
"onlystart": "onlydate(this.DTNEG) >= :DTNEG",
|
226
|
+
"onlyend": "onlydate(this.DTNEG) <= :DTNEG"
|
227
|
+
}
|
228
|
+
}
|
229
|
+
},
|
230
|
+
{
|
231
|
+
"id": "NUNOTA",
|
232
|
+
"label": "Nro Único do Pedido",
|
233
|
+
"detailTitle": "Informe o número único do pedido",
|
234
|
+
"type": "NUMBER",
|
235
|
+
"props": {
|
236
|
+
"expression": "(this.NUPED = :NUNOTA OR EXISTS(SELECT 1 FROM TGFVAR V INNER JOIN TGFCAB C ON(C.NUNOTA = V.NUNOTAORIG) WHERE V.NUNOTA = this.NUNOTA AND C.NUNOTA = :NUNOTA))"
|
237
|
+
}
|
238
|
+
},
|
239
|
+
{
|
240
|
+
"id": "CODCENCUS",
|
241
|
+
"label": "Centro de resultado",
|
242
|
+
"detailTitle": "Informe o centro de resultado",
|
243
|
+
"type": "SEARCH",
|
244
|
+
"props": {
|
245
|
+
"expression": "this.CODCENCUS = :CODCENCUS",
|
246
|
+
"searchContext": {
|
247
|
+
"entity": "CentroResultado",
|
248
|
+
"entityDescription": "Centro de resultado",
|
249
|
+
"searchOptions": {
|
250
|
+
"rootEntity": "Financeiro",
|
251
|
+
"descriptionFieldName": "DESCRCENCUS",
|
252
|
+
"codeFieldName": "CODCENCUS",
|
253
|
+
"showInactives": false
|
254
|
+
}
|
255
|
+
}
|
256
|
+
}
|
257
|
+
},
|
258
|
+
{
|
259
|
+
"id": "CODCTABCOINT",
|
260
|
+
"label": "Conta bancária",
|
261
|
+
"detailTitle": "Informe a conta bancária",
|
262
|
+
"type": "SEARCH",
|
263
|
+
"props": {
|
264
|
+
"expression": "this.CODCTABCOINT = :CODCTABCOINT",
|
265
|
+
"searchContext": {
|
266
|
+
"entity": "ContaBancaria",
|
267
|
+
"entityDescription": "Conta bancária",
|
268
|
+
"searchOptions": {
|
269
|
+
"rootEntity": "Financeiro",
|
270
|
+
"descriptionFieldName": "DESCRICAO",
|
271
|
+
"codeFieldName": "CODCTABCOINT",
|
272
|
+
"showInactives": false
|
273
|
+
}
|
274
|
+
}
|
275
|
+
}
|
276
|
+
},
|
277
|
+
{
|
278
|
+
"id": "CODBCO",
|
279
|
+
"label": "Banco",
|
280
|
+
"detailTitle": "Informe o banco",
|
281
|
+
"type": "SEARCH",
|
282
|
+
"props": {
|
283
|
+
"expression": "this.CODBCO = :CODBCO",
|
284
|
+
"searchContext": {
|
285
|
+
"entity": "Banco",
|
286
|
+
"entityDescription": "Banco",
|
287
|
+
"searchOptions": {
|
288
|
+
"rootEntity": "Financeiro",
|
289
|
+
"descriptionFieldName": "NOMEBCO",
|
290
|
+
"codeFieldName": "CODBCO",
|
291
|
+
"showInactives": false
|
292
|
+
}
|
293
|
+
}
|
294
|
+
}
|
295
|
+
},
|
296
|
+
{
|
297
|
+
"id": "CODPROJ",
|
298
|
+
"label": "Projeto",
|
299
|
+
"detailTitle": "Informe o projeto",
|
300
|
+
"type": "SEARCH",
|
301
|
+
"props": {
|
302
|
+
"expression": "this.CODPROJ = :CODPROJ",
|
303
|
+
"searchContext": {
|
304
|
+
"entity": "Projeto",
|
305
|
+
"entityDescription": "Projeto",
|
306
|
+
"searchOptions": {
|
307
|
+
"rootEntity": "Financeiro",
|
308
|
+
"descriptionFieldName": "IDENTIFICACAO",
|
309
|
+
"codeFieldName": "CODPROJ",
|
310
|
+
"showInactives": false
|
311
|
+
}
|
312
|
+
}
|
313
|
+
}
|
314
|
+
}
|
315
|
+
];
|
@@ -25,6 +25,14 @@ const snkFilterBarMessages = {
|
|
25
25
|
"modalPersonalizedFilterSubTitle": "Gerencie seus filtros",
|
26
26
|
"modalInfoTextCreateEditPersonalized": "Use o layout antigo para criar ou editar filtros, em breve traremos uma nova experiência",
|
27
27
|
"modalOkButtonLabel": "Aplicar",
|
28
|
-
"modalCancelButtonLabel": "Limpar"
|
28
|
+
"modalCancelButtonLabel": "Limpar",
|
29
|
+
"filters": "Filtros",
|
30
|
+
"filterModal": {
|
31
|
+
"title": "Filtros",
|
32
|
+
"okButtonLabel": "Aplicar",
|
33
|
+
"cancelButtonLabel": "Limpar tudo",
|
34
|
+
"customFilters": "Filtros personalizados",
|
35
|
+
"quickFilters": "Filtros rápidos"
|
36
|
+
}
|
29
37
|
};
|
30
38
|
export default snkFilterBarMessages;
|
@@ -56,7 +56,15 @@ const snkFilterBarMessages = {
|
|
56
56
|
"modalPersonalizedFilterSubTitle": "Gerencie seus filtros",
|
57
57
|
"modalInfoTextCreateEditPersonalized": "Use o layout antigo para criar ou editar filtros, em breve traremos uma nova experiência",
|
58
58
|
"modalOkButtonLabel": "Aplicar",
|
59
|
-
"modalCancelButtonLabel": "Limpar"
|
59
|
+
"modalCancelButtonLabel": "Limpar",
|
60
|
+
"filters": "Filtros",
|
61
|
+
"filterModal": {
|
62
|
+
"title": "Filtros",
|
63
|
+
"okButtonLabel": "Aplicar",
|
64
|
+
"cancelButtonLabel": "Limpar tudo",
|
65
|
+
"customFilters": "Filtros personalizados",
|
66
|
+
"quickFilters": "Filtros rápidos"
|
67
|
+
}
|
60
68
|
};
|
61
69
|
|
62
70
|
const snkTaskbarMessages = {
|
@@ -8,6 +8,7 @@ var FilterItemType;
|
|
8
8
|
FilterItemType["NUMBER"] = "NUMBER";
|
9
9
|
FilterItemType["DEFAULT_FILTER"] = "DEFAULT_FILTER";
|
10
10
|
FilterItemType["PERSONALIZED"] = "PERSONALIZED";
|
11
|
+
FilterItemType["MULTI_LIST"] = "MULTI_LIST";
|
11
12
|
})(FilterItemType || (FilterItemType = {}));
|
12
13
|
const FilterItemType$1 = FilterItemType;
|
13
14
|
|
@@ -17,6 +17,7 @@ export { SnkFilterFieldSearch as SnkFilterFieldSearch } from '../types/component
|
|
17
17
|
export { SnkFilterItem as SnkFilterItem } from '../types/components/snk-filter-bar/filter-item/snk-filter-item';
|
18
18
|
export { SnkFilterList as SnkFilterList } from '../types/components/snk-filter-bar/filter-list/snk-filter-list';
|
19
19
|
export { SnkFilterModal as SnkFilterModal } from '../types/components/snk-filter-bar/filter-modal/snk-filter-modal';
|
20
|
+
export { SnkFilterModalItem as SnkFilterModalItem } from '../types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item';
|
20
21
|
export { SnkFilterMultiSelect as SnkFilterMultiSelect } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select';
|
21
22
|
export { SnkFilterPeriod as SnkFilterNumber } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-number';
|
22
23
|
export { SnkFilterParamConfig as SnkFilterParamConfig } from '../types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config';
|
package/dist/components/index.js
CHANGED
@@ -17,6 +17,7 @@ export { SnkFilterFieldSearch, defineCustomElement as defineCustomElementSnkFilt
|
|
17
17
|
export { SnkFilterItem, defineCustomElement as defineCustomElementSnkFilterItem } from './snk-filter-item.js';
|
18
18
|
export { SnkFilterList, defineCustomElement as defineCustomElementSnkFilterList } from './snk-filter-list.js';
|
19
19
|
export { SnkFilterModal, defineCustomElement as defineCustomElementSnkFilterModal } from './snk-filter-modal.js';
|
20
|
+
export { SnkFilterModalItem, defineCustomElement as defineCustomElementSnkFilterModalItem } from './snk-filter-modal-item.js';
|
20
21
|
export { SnkFilterMultiSelect, defineCustomElement as defineCustomElementSnkFilterMultiSelect } from './snk-filter-multi-select.js';
|
21
22
|
export { SnkFilterNumber, defineCustomElement as defineCustomElementSnkFilterNumber } from './snk-filter-number.js';
|
22
23
|
export { SnkFilterParamConfig, defineCustomElement as defineCustomElementSnkFilterParamConfig } from './snk-filter-param-config.js';
|
@@ -0,0 +1,7 @@
|
|
1
|
+
var EPresentationMode;
|
2
|
+
(function (EPresentationMode) {
|
3
|
+
EPresentationMode[EPresentationMode["CHIP"] = 0] = "CHIP";
|
4
|
+
EPresentationMode[EPresentationMode["MODAL"] = 1] = "MODAL";
|
5
|
+
})(EPresentationMode || (EPresentationMode = {}));
|
6
|
+
|
7
|
+
export { EPresentationMode as E };
|