@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-38407.0 → 0.0.0-bugfix-dev-KB-39469.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/{ConfigStorage-302bbbd4.js → ConfigStorage-d4c99a5e.js} +2 -2
- package/dist/cjs/{DataFetcher-ba94ed5b.js → DataFetcher-99f0f6ed.js} +5 -3
- package/dist/cjs/{SnkFormConfigManager-71c4768e.js → SnkFormConfigManager-3621bfc4.js} +2 -2
- package/dist/cjs/{auth-fetcher-c8467c07.js → auth-fetcher-5161d082.js} +1 -1
- package/dist/cjs/{form-config-fetcher-df043d3d.js → form-config-fetcher-9f1a13ca.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-977c90b1.js → pesquisa-fetcher-c416a6b7.js} +22 -8
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_2.cjs.entry.js +6 -4
- package/dist/cjs/snk-application.cjs.entry.js +26 -5
- package/dist/cjs/snk-attach.cjs.entry.js +4 -4
- package/dist/cjs/snk-crud.cjs.entry.js +10 -7
- package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +6 -6
- package/dist/cjs/snk-entity-list.cjs.entry.js +5 -3
- package/dist/cjs/snk-filter-bar.cjs.entry.js +28 -6
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal.cjs.entry.js +2 -1
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +5 -4
- package/dist/cjs/{snk-guides-viewer-5803fe92.js → snk-guides-viewer-3ab9623e.js} +7 -7
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +6 -6
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +16 -4
- package/dist/cjs/snk-taskbar.cjs.entry.js +51 -3
- package/dist/collection/components/snk-application/__mocks__/snk-application.js +7 -0
- package/dist/collection/components/snk-crud/snk-crud.js +23 -3
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +11 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +2 -2
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +5 -3
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +2 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +19 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +39 -2
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
- package/dist/collection/components/snk-grid/snk-grid.js +19 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +53 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +3 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +17 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +88 -3
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +1 -1
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +5 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +17 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +21 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +3 -3
- package/dist/components/DataFetcher.js +5 -3
- package/dist/components/dataunit-fetcher.js +21 -7
- package/dist/components/snk-application2.js +21 -0
- package/dist/components/snk-crud.js +7 -3
- package/dist/components/snk-detail-view2.js +3 -3
- package/dist/components/snk-entity-list.js +5 -3
- package/dist/components/snk-filter-bar2.js +26 -3
- package/dist/components/snk-filter-modal.js +4 -2
- package/dist/components/snk-filter-multi-select.js +2 -1
- package/dist/components/snk-grid2.js +3 -1
- package/dist/components/snk-simple-crud2.js +15 -1
- package/dist/components/snk-taskbar2.js +55 -4
- package/dist/components/taskbar-actions-button2.js +3 -1
- package/dist/esm/{ConfigStorage-4151acc8.js → ConfigStorage-39ed8aeb.js} +2 -2
- package/dist/esm/{DataFetcher-aa159c5a.js → DataFetcher-a650ae58.js} +5 -3
- package/dist/esm/{SnkFormConfigManager-5c7d3771.js → SnkFormConfigManager-692e20c7.js} +2 -2
- package/dist/esm/{auth-fetcher-c05dc474.js → auth-fetcher-17dc5b5e.js} +1 -1
- package/dist/esm/{form-config-fetcher-36219cd3.js → form-config-fetcher-f121f880.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-5e228b5a.js → pesquisa-fetcher-ab16a2e8.js} +22 -8
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_2.entry.js +6 -4
- package/dist/esm/snk-application.entry.js +26 -5
- package/dist/esm/snk-attach.entry.js +4 -4
- package/dist/esm/snk-crud.entry.js +10 -7
- package/dist/esm/snk-data-exporter.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +6 -6
- package/dist/esm/snk-entity-list.entry.js +5 -3
- package/dist/esm/snk-filter-bar.entry.js +28 -6
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-filter-modal.entry.js +2 -1
- package/dist/esm/snk-filter-multi-select.entry.js +2 -1
- package/dist/esm/snk-form-config.entry.js +2 -2
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid-config.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +5 -4
- package/dist/esm/{snk-guides-viewer-c77e1c8f.js → snk-guides-viewer-462b4c9e.js} +7 -7
- package/dist/esm/snk-guides-viewer.entry.js +6 -6
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +16 -4
- package/dist/esm/snk-taskbar.entry.js +52 -4
- package/dist/sankhyablocks/p-007f1026.entry.js +1 -0
- package/dist/sankhyablocks/p-0264dba5.entry.js +1 -0
- package/dist/sankhyablocks/{p-2dd38000.entry.js → p-0ae89faa.entry.js} +1 -1
- package/dist/sankhyablocks/{p-cb7419e0.entry.js → p-0b0b36ac.entry.js} +1 -1
- package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
- package/dist/sankhyablocks/{p-59ce706a.entry.js → p-33bc44a6.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3efca291.entry.js → p-48afb1d3.entry.js} +1 -1
- package/dist/sankhyablocks/p-50783a8b.js +1 -0
- package/dist/sankhyablocks/{p-aa95fb2c.js → p-67aedbe0.js} +1 -1
- package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
- package/dist/sankhyablocks/{p-573a07c5.js → p-725d04ba.js} +1 -1
- package/dist/sankhyablocks/{p-e0fd9555.entry.js → p-827e4b01.entry.js} +1 -1
- package/dist/sankhyablocks/p-88c7dd9a.entry.js +1 -0
- package/dist/sankhyablocks/p-93d7e848.entry.js +1 -0
- package/dist/sankhyablocks/{p-7f3c7b09.entry.js → p-9d608b62.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0d7863ed.js → p-a13ccb86.js} +1 -1
- package/dist/sankhyablocks/{p-ce4bca21.js → p-a3a9d37d.js} +1 -1
- package/dist/sankhyablocks/{p-9695f78b.js → p-be75153c.js} +1 -1
- package/dist/sankhyablocks/p-bf2acf72.entry.js +1 -0
- package/dist/sankhyablocks/{p-34156b41.entry.js → p-c093edc7.entry.js} +1 -1
- package/dist/sankhyablocks/p-c6247955.js +65 -0
- package/dist/sankhyablocks/{p-761ed32f.entry.js → p-e3bd000e.entry.js} +1 -1
- package/dist/sankhyablocks/p-ed2dce4b.entry.js +1 -0
- package/dist/sankhyablocks/{p-1d75d9f9.entry.js → p-fcdcb0e2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-86164061.entry.js → p-fd0a8d68.entry.js} +3 -3
- package/dist/sankhyablocks/{p-40915359.entry.js → p-fdc4cb9b.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/__mocks__/snk-application.d.ts +3 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +5 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +5 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +3 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +5 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +10 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +20 -1
- package/dist/types/components.d.ts +64 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
- package/package.json +9 -2
- package/dist/sankhyablocks/p-20726710.entry.js +0 -1
- package/dist/sankhyablocks/p-25c77ddb.js +0 -65
- package/dist/sankhyablocks/p-69efa80d.entry.js +0 -1
- package/dist/sankhyablocks/p-7d8d7fe9.entry.js +0 -1
- package/dist/sankhyablocks/p-a9e5b094.entry.js +0 -1
- package/dist/sankhyablocks/p-ab568a2e.entry.js +0 -1
- package/dist/sankhyablocks/p-b05ab13d.entry.js +0 -1
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
- package/dist/sankhyablocks/p-e6380c60.js +0 -1
- package/dist/sankhyablocks/p-f39f48c2.entry.js +0 -1
|
@@ -25,7 +25,7 @@ snk-form-view {
|
|
|
25
25
|
position: relative;
|
|
26
26
|
padding-left: 0px;
|
|
27
27
|
padding-top: 0px;
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
/*public*/
|
|
30
30
|
padding-right: var(--snk-guides-viewer--space-large);
|
|
31
31
|
padding-bottom: var(--snk-guides-viewer--space-large);
|
|
@@ -57,6 +57,15 @@ snk-form-view {
|
|
|
57
57
|
margin-bottom: var(--snk-guides-viewer--space-medium);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
.snk-guides-viewer__header-breadcrumb{
|
|
61
|
+
width: 25%;
|
|
62
|
+
display: flex;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.snk-guides-viewer__header-taskbar{
|
|
66
|
+
width: 75%;
|
|
67
|
+
}
|
|
68
|
+
|
|
60
69
|
.snk-guides-viewer__container {
|
|
61
70
|
/*private*/
|
|
62
71
|
display: grid;
|
|
@@ -88,4 +97,4 @@ snk-form-view {
|
|
|
88
97
|
min-height: 100%;
|
|
89
98
|
align-items: flex-start;
|
|
90
99
|
align-content: flex-start;
|
|
91
|
-
}
|
|
100
|
+
}
|
|
@@ -383,7 +383,7 @@ export class SnkGuidesViewer {
|
|
|
383
383
|
}
|
|
384
384
|
buildTaskBar() {
|
|
385
385
|
var _a;
|
|
386
|
-
return h("div", { class: `
|
|
386
|
+
return h("div", { class: `snk-guides-viewer__header-taskbar ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.getActionsList(), messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS", alignRigth: true }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
|
|
387
387
|
}
|
|
388
388
|
async dataUnitActionHandler(action) {
|
|
389
389
|
var _a;
|
|
@@ -442,7 +442,7 @@ export class SnkGuidesViewer {
|
|
|
442
442
|
}
|
|
443
443
|
this.loadTaskbarProcessor();
|
|
444
444
|
const showGuides = this._guides && (this._guides.length > 1);
|
|
445
|
-
return (h("section", { class: "snk-guides-viewer" }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "
|
|
445
|
+
return (h("section", { class: "snk-guides-viewer" }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.getMessage("snkCrud.title")), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
|
|
446
446
|
h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
|
|
447
447
|
h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
|
|
448
448
|
:
|
|
@@ -56,16 +56,18 @@ export class SnkEntityList {
|
|
|
56
56
|
this.loadListSource();
|
|
57
57
|
}
|
|
58
58
|
optionLoader(searchArgument) {
|
|
59
|
-
var _a, _b, _c, _d;
|
|
59
|
+
var _a, _b, _c, _d, _e, _f;
|
|
60
60
|
const { mode, argument } = searchArgument;
|
|
61
61
|
if (this._application === undefined) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
const searchOptions = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.searchContext) === null || _c === void 0 ? void 0 : _c.searchOptions;
|
|
65
|
+
const criteria = (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e.criteria;
|
|
65
66
|
const options = {
|
|
66
|
-
entityDescription: (
|
|
67
|
+
entityDescription: (_f = this.config) === null || _f === void 0 ? void 0 : _f.label,
|
|
67
68
|
entity: this._entityName,
|
|
68
|
-
searchOptions: searchOptions
|
|
69
|
+
searchOptions: searchOptions,
|
|
70
|
+
criteria,
|
|
69
71
|
};
|
|
70
72
|
return this._application.executePreparedSearch(mode, argument, options);
|
|
71
73
|
}
|
package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js
CHANGED
|
@@ -10,7 +10,8 @@ export class SnkFilterMultiSelect {
|
|
|
10
10
|
* Emitido quando acontece a alteração de valor do componente snk-filter-multi-select
|
|
11
11
|
*/
|
|
12
12
|
ezChangeListener(evt) {
|
|
13
|
-
|
|
13
|
+
var _a;
|
|
14
|
+
this.value = (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value;
|
|
14
15
|
this.valueChanged.emit(this.value);
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
@@ -17,6 +17,7 @@ export class SnkFilterModal {
|
|
|
17
17
|
this.editPersonalizedFilter = undefined;
|
|
18
18
|
this.deletePersonalizedFilter = undefined;
|
|
19
19
|
this.filtersToDelete = [];
|
|
20
|
+
this.disablePersonalizedFilter = undefined;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Emitido quando um filtro personalizado é deletado.
|
|
@@ -233,7 +234,7 @@ export class SnkFilterModal {
|
|
|
233
234
|
const customFilters = this.filters.filter(filter => filter.filterType === FilterType.CUSTOM_FILTER);
|
|
234
235
|
const quickFilters = this.filters.filter(filter => filter.filterType === FilterType.QUICK_FILTER);
|
|
235
236
|
const otherFilters = this.filters.filter(filter => filter.filterType === FilterType.OTHER_FILTERS);
|
|
236
|
-
return (h("ez-modal-container", { class: "snk-filter-modal__container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, h("div", { class: "snk-filter-modal__content ez-col--sd-12" }, this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters, false, false), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters, false), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter], true)))));
|
|
237
|
+
return (h("ez-modal-container", { class: "snk-filter-modal__container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, h("div", { class: "snk-filter-modal__content ez-col--sd-12" }, !this.disablePersonalizedFilter && this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters, false, false), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters, false), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter], true)))));
|
|
237
238
|
}
|
|
238
239
|
static get is() { return "snk-filter-modal"; }
|
|
239
240
|
static get originalStyleUrls() {
|
|
@@ -411,6 +412,23 @@ export class SnkFilterModal {
|
|
|
411
412
|
"text": "Guarda filtros a serem deletados no Apply do modal"
|
|
412
413
|
},
|
|
413
414
|
"defaultValue": "[]"
|
|
415
|
+
},
|
|
416
|
+
"disablePersonalizedFilter": {
|
|
417
|
+
"type": "boolean",
|
|
418
|
+
"mutable": false,
|
|
419
|
+
"complexType": {
|
|
420
|
+
"original": "boolean",
|
|
421
|
+
"resolved": "boolean",
|
|
422
|
+
"references": {}
|
|
423
|
+
},
|
|
424
|
+
"required": false,
|
|
425
|
+
"optional": false,
|
|
426
|
+
"docs": {
|
|
427
|
+
"tags": [],
|
|
428
|
+
"text": "Desabilita a apresenta\u00E7\u00E3o da op\u00E7\u00E3o de filtros personalizados na filter bar (chip de filtros) \ne no modal lateral de filtros (container de filtros personalizados)."
|
|
429
|
+
},
|
|
430
|
+
"attribute": "disable-personalized-filter",
|
|
431
|
+
"reflect": false
|
|
414
432
|
}
|
|
415
433
|
};
|
|
416
434
|
}
|
|
@@ -11,6 +11,7 @@ export class SnkFilterBar {
|
|
|
11
11
|
this._updateSequence = [];
|
|
12
12
|
this._loadingPending = false;
|
|
13
13
|
this._configUpdated = false;
|
|
14
|
+
this._firstLoad = true;
|
|
14
15
|
this._pendingVariables = false;
|
|
15
16
|
this._customfiltersToBeUpdated = [];
|
|
16
17
|
this._calculateSortIndex = (item) => {
|
|
@@ -31,6 +32,7 @@ export class SnkFilterBar {
|
|
|
31
32
|
this.resourceID = undefined;
|
|
32
33
|
this.filterConfig = undefined;
|
|
33
34
|
this.messagesBuilder = undefined;
|
|
35
|
+
this.disablePersonalizedFilter = undefined;
|
|
34
36
|
this.allowDefault = undefined;
|
|
35
37
|
this.scrollerLocked = false;
|
|
36
38
|
this.showPersonalizedFilter = false;
|
|
@@ -164,13 +166,27 @@ export class SnkFilterBar {
|
|
|
164
166
|
return;
|
|
165
167
|
}
|
|
166
168
|
this._loadingPending = false;
|
|
167
|
-
this.dataUnit.
|
|
169
|
+
this.doLoadData(this.dataUnit.getLastLoadRequest() != undefined);
|
|
168
170
|
}
|
|
169
171
|
if (this._configUpdated) {
|
|
170
172
|
this._configUpdated = false;
|
|
171
173
|
ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
|
|
172
174
|
}
|
|
173
175
|
}
|
|
176
|
+
async doLoadData(forceReload = false) {
|
|
177
|
+
try {
|
|
178
|
+
if (this._firstLoad && !forceReload) {
|
|
179
|
+
let autoLoad = await this._application.getBooleanParam("global.carregar.registros.iniciar.tela");
|
|
180
|
+
if (!autoLoad) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
this.dataUnit.loadData(undefined, undefined, true);
|
|
185
|
+
}
|
|
186
|
+
finally {
|
|
187
|
+
this._firstLoad = false;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
174
190
|
/**
|
|
175
191
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
176
192
|
* através de um pequeno modulo na estrutura da aplicação:
|
|
@@ -179,6 +195,9 @@ export class SnkFilterBar {
|
|
|
179
195
|
*/
|
|
180
196
|
getMessage(key, params, defaultValue) {
|
|
181
197
|
var _a;
|
|
198
|
+
if (this.messagesBuilder == undefined && this._application) {
|
|
199
|
+
this.messagesBuilder = this._application.messagesBuilder;
|
|
200
|
+
}
|
|
182
201
|
return ((_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params)) || defaultValue;
|
|
183
202
|
}
|
|
184
203
|
getFilter(_dataUnit) {
|
|
@@ -205,7 +224,7 @@ export class SnkFilterBar {
|
|
|
205
224
|
registryFilterProvider() {
|
|
206
225
|
this.dataUnit.addFilterProvider(this);
|
|
207
226
|
if (this.filterConfig) {
|
|
208
|
-
this.
|
|
227
|
+
this.doLoadData();
|
|
209
228
|
}
|
|
210
229
|
}
|
|
211
230
|
itemFocused(selectedItem) {
|
|
@@ -340,6 +359,7 @@ export class SnkFilterBar {
|
|
|
340
359
|
filterConfig: filtersConfigCopy,
|
|
341
360
|
configName: this.configName,
|
|
342
361
|
onComplete: callbackOnApplyFilter,
|
|
362
|
+
disablePersonalizedFilter: this.disablePersonalizedFilter,
|
|
343
363
|
getMessage: (key, props) => this.getMessage(key, props),
|
|
344
364
|
onAddPersonalizedFilter: () => this.addPersonalizedFilter(),
|
|
345
365
|
onEditPersonalizedFilter: (id) => this.editPersonalizedFilter(id),
|
|
@@ -510,6 +530,23 @@ export class SnkFilterBar {
|
|
|
510
530
|
"tags": [],
|
|
511
531
|
"text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
|
|
512
532
|
}
|
|
533
|
+
},
|
|
534
|
+
"disablePersonalizedFilter": {
|
|
535
|
+
"type": "boolean",
|
|
536
|
+
"mutable": false,
|
|
537
|
+
"complexType": {
|
|
538
|
+
"original": "boolean",
|
|
539
|
+
"resolved": "boolean",
|
|
540
|
+
"references": {}
|
|
541
|
+
},
|
|
542
|
+
"required": false,
|
|
543
|
+
"optional": false,
|
|
544
|
+
"docs": {
|
|
545
|
+
"tags": [],
|
|
546
|
+
"text": "Desabilita a apresenta\u00E7\u00E3o da op\u00E7\u00E3o de filtros personalizados na filter bar (chip de filtros) \ne no modal lateral de filtros (container de filtros personalizados)."
|
|
547
|
+
},
|
|
548
|
+
"attribute": "disable-personalized-filter",
|
|
549
|
+
"reflect": false
|
|
513
550
|
}
|
|
514
551
|
};
|
|
515
552
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
|
|
2
2
|
class SnkFilterModalFactory {
|
|
3
|
-
constructor({ filterConfig, configName, onComplete, getMessage, onAddPersonalizedFilter, onEditPersonalizedFilter, onDeletePersonalizedFilter }) {
|
|
3
|
+
constructor({ filterConfig, configName, onComplete, getMessage, disablePersonalizedFilter, onAddPersonalizedFilter, onEditPersonalizedFilter, onDeletePersonalizedFilter }) {
|
|
4
4
|
this._filterConfig = filterConfig;
|
|
5
5
|
this._configName = configName;
|
|
6
6
|
this._onComplete = onComplete;
|
|
7
7
|
this._getMessage = getMessage;
|
|
8
|
+
this._disablePersonalizedFilter = disablePersonalizedFilter;
|
|
8
9
|
this._addPersonalizedFilterFn = onAddPersonalizedFilter;
|
|
9
10
|
this._editPersonalizedFilterFn = onEditPersonalizedFilter;
|
|
10
11
|
this._onDeletePersonalizedFilter = onDeletePersonalizedFilter;
|
|
@@ -18,6 +19,7 @@ class SnkFilterModalFactory {
|
|
|
18
19
|
filterModal.className = "ez-size-height--full";
|
|
19
20
|
filterModal.filters = this._filterConfig;
|
|
20
21
|
filterModal.configName = this._configName;
|
|
22
|
+
filterModal.disablePersonalizedFilter = this._disablePersonalizedFilter;
|
|
21
23
|
filterModal.getMessage = this._getMessage.bind(this);
|
|
22
24
|
filterModal.applyFilters = this.applyFilters.bind(this);
|
|
23
25
|
filterModal.closeModal = () => this._closeModal();
|
|
@@ -52,6 +52,7 @@ export class SnkGrid {
|
|
|
52
52
|
this.taskbarCustomContainerId = undefined;
|
|
53
53
|
this.gridHeaderCustomSlotId = 'GRID_HEADER_CUSTOM_ELEMENTS';
|
|
54
54
|
this.topTaskbarCustomSlotId = 'GRID_TASKBAR_CUSTOM_ELEMENTS';
|
|
55
|
+
this.disablePersonalizedFilter = undefined;
|
|
55
56
|
}
|
|
56
57
|
/**
|
|
57
58
|
* Exibe a janela de configurações da grade.
|
|
@@ -399,7 +400,7 @@ export class SnkGrid {
|
|
|
399
400
|
return undefined;
|
|
400
401
|
}
|
|
401
402
|
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
|
402
|
-
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail) }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
403
|
+
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
403
404
|
}
|
|
404
405
|
static get is() { return "snk-grid"; }
|
|
405
406
|
static get encapsulation() { return "scoped"; }
|
|
@@ -742,6 +743,23 @@ export class SnkGrid {
|
|
|
742
743
|
"attribute": "top-taskbar-custom-slot-id",
|
|
743
744
|
"reflect": false,
|
|
744
745
|
"defaultValue": "'GRID_TASKBAR_CUSTOM_ELEMENTS'"
|
|
746
|
+
},
|
|
747
|
+
"disablePersonalizedFilter": {
|
|
748
|
+
"type": "boolean",
|
|
749
|
+
"mutable": false,
|
|
750
|
+
"complexType": {
|
|
751
|
+
"original": "boolean",
|
|
752
|
+
"resolved": "boolean",
|
|
753
|
+
"references": {}
|
|
754
|
+
},
|
|
755
|
+
"required": false,
|
|
756
|
+
"optional": false,
|
|
757
|
+
"docs": {
|
|
758
|
+
"tags": [],
|
|
759
|
+
"text": "Desabilita a apresenta\u00E7\u00E3o da op\u00E7\u00E3o de filtros personalizados na filter bar (chip de filtros) \ne no modal lateral de filtros (container de filtros personalizados)."
|
|
760
|
+
},
|
|
761
|
+
"attribute": "disable-personalized-filter",
|
|
762
|
+
"reflect": false
|
|
745
763
|
}
|
|
746
764
|
};
|
|
747
765
|
}
|
|
@@ -34,6 +34,8 @@ export class SnkSimpleCrud {
|
|
|
34
34
|
this.taskbarManager = undefined;
|
|
35
35
|
this.messagesBuilder = undefined;
|
|
36
36
|
this.useEnterLikeTab = false;
|
|
37
|
+
this.actionsList = undefined;
|
|
38
|
+
this.configName = undefined;
|
|
37
39
|
}
|
|
38
40
|
resolveInMemoryBtns(taskbarButtons) {
|
|
39
41
|
const newTaskBarConfig = [...taskbarButtons];
|
|
@@ -232,7 +234,7 @@ export class SnkSimpleCrud {
|
|
|
232
234
|
}
|
|
233
235
|
getActionsList() {
|
|
234
236
|
var _a, _b;
|
|
235
|
-
|
|
237
|
+
const hardList = [{
|
|
236
238
|
value: StringUtils.generateUUID(),
|
|
237
239
|
label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.findColumn", undefined)) !== null && _b !== void 0 ? _b : "Buscar",
|
|
238
240
|
disableCloseOnSelect: true,
|
|
@@ -241,6 +243,16 @@ export class SnkSimpleCrud {
|
|
|
241
243
|
? this.getColumnSearch(actionButton, item)
|
|
242
244
|
: this.getFieldSearch(actionButton, item)
|
|
243
245
|
}];
|
|
246
|
+
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
|
247
|
+
const taskbarID = this.getTopTaskBarId();
|
|
248
|
+
return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
|
|
249
|
+
}
|
|
250
|
+
return hardList.concat(this.actionsList);
|
|
251
|
+
}
|
|
252
|
+
getTopTaskBarId() {
|
|
253
|
+
var _a;
|
|
254
|
+
return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${PresentationMode.PRIMARY}` :
|
|
255
|
+
`snkGridTopTaskbar.regular${PresentationMode.PRIMARY}`;
|
|
244
256
|
}
|
|
245
257
|
async keyDownListener(event) {
|
|
246
258
|
if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
|
|
@@ -494,6 +506,46 @@ export class SnkSimpleCrud {
|
|
|
494
506
|
"attribute": "use-enter-like-tab",
|
|
495
507
|
"reflect": false,
|
|
496
508
|
"defaultValue": "false"
|
|
509
|
+
},
|
|
510
|
+
"actionsList": {
|
|
511
|
+
"type": "unknown",
|
|
512
|
+
"mutable": false,
|
|
513
|
+
"complexType": {
|
|
514
|
+
"original": "Array<Action>",
|
|
515
|
+
"resolved": "Action[]",
|
|
516
|
+
"references": {
|
|
517
|
+
"Array": {
|
|
518
|
+
"location": "global"
|
|
519
|
+
},
|
|
520
|
+
"Action": {
|
|
521
|
+
"location": "import",
|
|
522
|
+
"path": "../snk-taskbar/snk-taskbar"
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
"required": false,
|
|
527
|
+
"optional": false,
|
|
528
|
+
"docs": {
|
|
529
|
+
"tags": [],
|
|
530
|
+
"text": "A\u00E7\u00F5es a serem colocadas no bot\u00E3o \"Mais op\u00E7\u00F5es\" do componente snk-taskbar."
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
"configName": {
|
|
534
|
+
"type": "string",
|
|
535
|
+
"mutable": true,
|
|
536
|
+
"complexType": {
|
|
537
|
+
"original": "string",
|
|
538
|
+
"resolved": "string",
|
|
539
|
+
"references": {}
|
|
540
|
+
},
|
|
541
|
+
"required": false,
|
|
542
|
+
"optional": false,
|
|
543
|
+
"docs": {
|
|
544
|
+
"tags": [],
|
|
545
|
+
"text": "Usado para salvar as configura\u00E7\u00F5es dos blocos de constru\u00E7\u00E3o."
|
|
546
|
+
},
|
|
547
|
+
"attribute": "config-name",
|
|
548
|
+
"reflect": false
|
|
497
549
|
}
|
|
498
550
|
};
|
|
499
551
|
}
|
|
@@ -67,7 +67,7 @@ export class TaskbarActionsButton {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
getSelectedAction(id, actions) {
|
|
70
|
-
let selectedItem;
|
|
70
|
+
let selectedItem = null;
|
|
71
71
|
for (const item of actions) {
|
|
72
72
|
if (item.id === id) {
|
|
73
73
|
selectedItem = item;
|
|
@@ -76,6 +76,8 @@ export class TaskbarActionsButton {
|
|
|
76
76
|
if (!(item === null || item === void 0 ? void 0 : item.children))
|
|
77
77
|
continue;
|
|
78
78
|
selectedItem = this.getSelectedAction(id, item.children);
|
|
79
|
+
if (selectedItem)
|
|
80
|
+
break;
|
|
79
81
|
}
|
|
80
82
|
return selectedItem;
|
|
81
83
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
|
|
1
|
+
import { ApplicationContext, ElementIDUtils, OverflowDirection, OverflowWatcher, StringUtils, OVERFLOWED_CLASS_NAME } from '@sankhyalabs/core';
|
|
2
2
|
import { h, Host } from '@stencil/core';
|
|
3
3
|
import { AuthorizationConfig } from '../snk-configurator/AuthorizationConfig';
|
|
4
4
|
import { AuthorizationElements, buildCustomButton, buildElem, TaskbarElement, VisibleWhenForbidden, } from './elements/taskbar-elements';
|
|
@@ -6,6 +6,8 @@ import { PresentationMode } from '../../lib/@types';
|
|
|
6
6
|
export class SnkTaskbar {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
|
|
9
|
+
this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME = 'taskbar-custom-elements-container';
|
|
10
|
+
this.ACTIONS_BUTTON_TAG = 'TASKBAR-ACTIONS-BUTTON';
|
|
9
11
|
this._titleKeyByElement = {
|
|
10
12
|
[TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
|
|
11
13
|
[TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
|
|
@@ -23,11 +25,14 @@ export class SnkTaskbar {
|
|
|
23
25
|
[TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
|
|
24
26
|
};
|
|
25
27
|
this._permissions = undefined;
|
|
28
|
+
this._overFlowedElements = [];
|
|
26
29
|
this._customElements = undefined;
|
|
27
30
|
this._customElementsId = undefined;
|
|
28
31
|
this._slotContainer = undefined;
|
|
32
|
+
this.alignRigth = false;
|
|
29
33
|
this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
|
|
30
34
|
this.customContainerId = undefined;
|
|
35
|
+
this.overflowStrategy = 'hiddenItems';
|
|
31
36
|
this.configName = undefined;
|
|
32
37
|
this.resourceID = undefined;
|
|
33
38
|
this.buttons = undefined;
|
|
@@ -41,6 +46,7 @@ export class SnkTaskbar {
|
|
|
41
46
|
}
|
|
42
47
|
observeButtons() {
|
|
43
48
|
this._definitions = undefined;
|
|
49
|
+
requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
|
|
44
50
|
}
|
|
45
51
|
// Internal methods
|
|
46
52
|
elementsFromString(strButtons) {
|
|
@@ -221,15 +227,52 @@ export class SnkTaskbar {
|
|
|
221
227
|
}
|
|
222
228
|
this.validatePresentationMode();
|
|
223
229
|
}
|
|
230
|
+
handleOverFlow(overFlowingElements) {
|
|
231
|
+
const elementsToHandle = overFlowingElements.filter(element => !this.hasToIgnoreOverFlow(element));
|
|
232
|
+
this.resetOverFlowedElements();
|
|
233
|
+
this.doOverFlowElements(elementsToHandle);
|
|
234
|
+
}
|
|
235
|
+
resetOverFlowedElements() {
|
|
236
|
+
this._overFlowedElements.forEach(element => {
|
|
237
|
+
element.classList.remove(OVERFLOWED_CLASS_NAME);
|
|
238
|
+
});
|
|
239
|
+
this._overFlowedElements = [];
|
|
240
|
+
}
|
|
241
|
+
doOverFlowElements(overFlowedElements) {
|
|
242
|
+
overFlowedElements.forEach(element => {
|
|
243
|
+
element.classList.add(OVERFLOWED_CLASS_NAME);
|
|
244
|
+
this._overFlowedElements.push(element);
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
hasToIgnoreOverFlow(element) {
|
|
248
|
+
return element.classList.contains(this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME);
|
|
249
|
+
}
|
|
250
|
+
handleOverFlowStrategy() {
|
|
251
|
+
if (this.overflowStrategy === 'hiddenItems') {
|
|
252
|
+
this._overFlowWatcher = new OverflowWatcher(this.buildOverFlowWatcherParams());
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
buildOverFlowWatcherParams() {
|
|
256
|
+
return {
|
|
257
|
+
element: this._element,
|
|
258
|
+
callback: this.handleOverFlow.bind(this),
|
|
259
|
+
overFlowDirection: OverflowDirection.HORIZONTAL,
|
|
260
|
+
deltaSize: 1,
|
|
261
|
+
notOverFlow: ["moreOptions"]
|
|
262
|
+
};
|
|
263
|
+
}
|
|
224
264
|
componentDidLoad() {
|
|
225
265
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
226
266
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
267
|
+
this.handleOverFlowStrategy();
|
|
227
268
|
}
|
|
228
269
|
componentDidRender() {
|
|
229
270
|
this.appendCustomElementsInTaskbar();
|
|
230
271
|
}
|
|
231
272
|
disconnectedCallback() {
|
|
273
|
+
var _a;
|
|
232
274
|
this.unlinkAllCustomElements();
|
|
275
|
+
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
233
276
|
}
|
|
234
277
|
unlinkAllCustomElements() {
|
|
235
278
|
var _a;
|
|
@@ -247,7 +290,7 @@ export class SnkTaskbar {
|
|
|
247
290
|
return undefined;
|
|
248
291
|
}
|
|
249
292
|
let index = 0;
|
|
250
|
-
return (h(Host,
|
|
293
|
+
return (h(Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
|
|
251
294
|
var _a;
|
|
252
295
|
if (elem === TaskbarElement.DIVIDER) {
|
|
253
296
|
index = 0;
|
|
@@ -265,7 +308,12 @@ export class SnkTaskbar {
|
|
|
265
308
|
return this.addCustomElementContainer(elem);
|
|
266
309
|
}
|
|
267
310
|
return h("slot", { name: elem });
|
|
268
|
-
})), h("div", { class:
|
|
311
|
+
})), h("div", { class: this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME }, h("slot", { name: this.customSlotId }))));
|
|
312
|
+
}
|
|
313
|
+
getHostClasses() {
|
|
314
|
+
if (this.overflowStrategy !== 'hiddenItems')
|
|
315
|
+
return 'no-wrap';
|
|
316
|
+
return `full-width ${this.alignRigth ? 'align-right' : ""}`;
|
|
269
317
|
}
|
|
270
318
|
static get is() { return "snk-taskbar"; }
|
|
271
319
|
static get encapsulation() { return "scoped"; }
|
|
@@ -281,6 +329,24 @@ export class SnkTaskbar {
|
|
|
281
329
|
}
|
|
282
330
|
static get properties() {
|
|
283
331
|
return {
|
|
332
|
+
"alignRigth": {
|
|
333
|
+
"type": "boolean",
|
|
334
|
+
"mutable": false,
|
|
335
|
+
"complexType": {
|
|
336
|
+
"original": "boolean",
|
|
337
|
+
"resolved": "boolean",
|
|
338
|
+
"references": {}
|
|
339
|
+
},
|
|
340
|
+
"required": false,
|
|
341
|
+
"optional": false,
|
|
342
|
+
"docs": {
|
|
343
|
+
"tags": [],
|
|
344
|
+
"text": "Usado para determinar O alinhamento dos items na taskbar."
|
|
345
|
+
},
|
|
346
|
+
"attribute": "align-rigth",
|
|
347
|
+
"reflect": false,
|
|
348
|
+
"defaultValue": "false"
|
|
349
|
+
},
|
|
284
350
|
"customSlotId": {
|
|
285
351
|
"type": "string",
|
|
286
352
|
"mutable": false,
|
|
@@ -316,6 +382,24 @@ export class SnkTaskbar {
|
|
|
316
382
|
"attribute": "custom-container-id",
|
|
317
383
|
"reflect": false
|
|
318
384
|
},
|
|
385
|
+
"overflowStrategy": {
|
|
386
|
+
"type": "string",
|
|
387
|
+
"mutable": false,
|
|
388
|
+
"complexType": {
|
|
389
|
+
"original": "'hiddenItems' | 'none'",
|
|
390
|
+
"resolved": "\"hiddenItems\" | \"none\"",
|
|
391
|
+
"references": {}
|
|
392
|
+
},
|
|
393
|
+
"required": false,
|
|
394
|
+
"optional": false,
|
|
395
|
+
"docs": {
|
|
396
|
+
"tags": [],
|
|
397
|
+
"text": "Define como ser\u00E1 o comportamento da taskbar quando ocorrer overflow"
|
|
398
|
+
},
|
|
399
|
+
"attribute": "overflow-strategy",
|
|
400
|
+
"reflect": false,
|
|
401
|
+
"defaultValue": "'hiddenItems'"
|
|
402
|
+
},
|
|
319
403
|
"configName": {
|
|
320
404
|
"type": "string",
|
|
321
405
|
"mutable": false,
|
|
@@ -515,6 +599,7 @@ export class SnkTaskbar {
|
|
|
515
599
|
static get states() {
|
|
516
600
|
return {
|
|
517
601
|
"_permissions": {},
|
|
602
|
+
"_overFlowedElements": {},
|
|
518
603
|
"_customElements": {},
|
|
519
604
|
"_customElementsId": {},
|
|
520
605
|
"_slotContainer": {}
|
|
@@ -13,7 +13,7 @@ export default class InMemoryLoader {
|
|
|
13
13
|
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
|
14
14
|
}
|
|
15
15
|
getRecordsToLoad() {
|
|
16
|
-
if (this._initialRecords == undefined
|
|
16
|
+
if (this._initialRecords == undefined || this.dataUnit.records.length > 0) {
|
|
17
17
|
this._initialRecords = this.dataUnit.records;
|
|
18
18
|
}
|
|
19
19
|
return this._initialRecords;
|
|
@@ -275,7 +275,6 @@ export class DataFetcher {
|
|
|
275
275
|
if (http.readyState == 4 && http.status == 200) {
|
|
276
276
|
try {
|
|
277
277
|
const jsonResp = JSON.parse(http.responseText);
|
|
278
|
-
await this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
|
279
278
|
/**
|
|
280
279
|
* Este trecho difere do projeto HTML5 devido à decisão de adotar uma abordagem síncrona para esta chamada. Isso é justificado pelo fato de que, no cenário em questão, a abordagem assíncrona teria impactos negativos.
|
|
281
280
|
*
|
|
@@ -286,8 +285,10 @@ export class DataFetcher {
|
|
|
286
285
|
if (this.isServiceBrokerError(jsonResp)) {
|
|
287
286
|
reject(this.processServiceBrokerErrorInfo(jsonResp));
|
|
288
287
|
}
|
|
289
|
-
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED
|
|
290
|
-
|
|
288
|
+
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED) {
|
|
289
|
+
if (jsonResp.statusMessage) {
|
|
290
|
+
console.debug(`[DataFetcher] ${jsonResp.statusMessage}`);
|
|
291
|
+
}
|
|
291
292
|
}
|
|
292
293
|
else {
|
|
293
294
|
accept(jsonResp.responseBody);
|
|
@@ -295,6 +296,7 @@ export class DataFetcher {
|
|
|
295
296
|
(_a = this.application) === null || _a === void 0 ? void 0 : _a.info(jsonResp.statusMessage);
|
|
296
297
|
}
|
|
297
298
|
}
|
|
299
|
+
this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
|
298
300
|
}
|
|
299
301
|
catch (err) {
|
|
300
302
|
console.warn(`Erro ao executar serviço: ${err}`);
|
|
@@ -184,15 +184,29 @@ export default class DataUnitFetcher {
|
|
|
184
184
|
});
|
|
185
185
|
return updatingFields;
|
|
186
186
|
}
|
|
187
|
+
getUpdatingFields(dataUnit, originalUpdatingFields) {
|
|
188
|
+
if (originalUpdatingFields == undefined) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const updatingFields = Object.assign({}, originalUpdatingFields);
|
|
192
|
+
Object.keys(updatingFields).forEach(key => {
|
|
193
|
+
const descriptor = dataUnit.getField(key);
|
|
194
|
+
if (descriptor != undefined && descriptor.standAlone) {
|
|
195
|
+
delete updatingFields[key];
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
return this.addTransientProperties(dataUnit, updatingFields);
|
|
199
|
+
}
|
|
187
200
|
saveData(dataUnit, duChanges) {
|
|
188
201
|
const updatedRecordsIds = [];
|
|
189
202
|
const addedRecordsIds = [];
|
|
190
203
|
const changes = duChanges.map((change) => {
|
|
191
|
-
const { dataUnit: changeDU, record,
|
|
204
|
+
const { dataUnit: changeDU, record, operation } = change;
|
|
192
205
|
const dataUnitInstance = DataUnitStorage.get(changeDU);
|
|
206
|
+
const updatingFields = this.getUpdatingFields(dataUnitInstance, change.updatingFields);
|
|
193
207
|
let parsedUpdatingFields;
|
|
194
|
-
if (updatingFields) {
|
|
195
|
-
parsedUpdatingFields = Object.entries(
|
|
208
|
+
if (updatingFields != undefined) {
|
|
209
|
+
parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
|
196
210
|
const descriptor = dataUnitInstance.getField(fieldName);
|
|
197
211
|
const dataType = descriptor ? descriptor.dataType : DataType.TEXT;
|
|
198
212
|
return { fieldName, dataType, value: dataUnitInstance.valueToString(fieldName, value) };
|