@sankhyalabs/sankhyablocks 8.14.11 → 8.15.0-dev.10
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-8009ecb2.js → ConfigStorage-302bbbd4.js} +24 -14
- package/dist/cjs/{ISave-d68ce3cd.js → ISave-e91b70a7.js} +1 -0
- package/dist/cjs/{SnkFormConfigManager-7d850fbc.js → SnkFormConfigManager-71c4768e.js} +1 -1
- package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-e7dcf408.js} +13 -0
- package/dist/cjs/{field-search-ca27041a.js → field-search-f56aa7d6.js} +29 -1
- package/dist/cjs/{index-0e663819.js → index-0922807b.js} +1 -0
- package/dist/cjs/index-f9e81701.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-d839c5d7.js → pesquisa-fetcher-7a08d110.js} +173 -6
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/{snk-actions-button.cjs.entry.js → snk-actions-button_2.cjs.entry.js} +133 -4
- package/dist/cjs/snk-application.cjs.entry.js +65 -6
- package/dist/cjs/snk-attach.cjs.entry.js +389 -58
- package/dist/cjs/snk-crud.cjs.entry.js +8 -9
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
- package/dist/cjs/{snk-data-unit-1bc69073.js → snk-data-unit-82c08a8c.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +9 -10
- package/dist/cjs/snk-filter-bar.cjs.entry.js +6 -3
- package/dist/cjs/snk-filter-item.cjs.entry.js +47 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-form.cjs.entry.js +2 -2
- package/dist/cjs/snk-grid-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +51 -42
- package/dist/cjs/{snk-guides-viewer-88a7f880.js → snk-guides-viewer-546509df.js} +10 -21
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +20 -42
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
- package/dist/cjs/{taskbar-elements-39949c7a.js → taskbar-elements-01b85b99.js} +4 -4
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/snk-application/snk-application.js +65 -5
- package/dist/collection/components/snk-attach/snk-attach.js +188 -39
- package/dist/collection/components/snk-attach/structure/{crud-config-builder.js → builder/anexo-sistema-crud-config.builder.js} +1 -1
- package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +62 -0
- package/dist/collection/components/snk-attach/structure/{taskbar-builder.js → builder/taskbar-builder.js} +1 -1
- package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js +1 -0
- package/dist/collection/components/snk-attach/structure/{data-unit-builder.js → fetcher/factory/anexo-sistema-data-unit.factory.js} +14 -11
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +111 -0
- package/dist/collection/components/snk-attach/structure/index.js +6 -3
- package/dist/collection/components/snk-crud/snk-crud.js +5 -5
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +6 -19
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +47 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +5 -2
- package/dist/collection/components/snk-grid/snk-grid.js +59 -53
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +15 -36
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css +6 -0
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +324 -0
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +3 -3
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -2
- package/dist/collection/components/snk-taskbar/subcomponents/field-search.js +28 -1
- package/dist/collection/lib/@types/index.js +1 -0
- package/dist/collection/lib/configs/ConfigStorage.js +24 -14
- package/dist/collection/lib/http/data-fetcher/fetchers/{attach-fetcher.js → AttachFetcher/anexo-sistema-fetcher.js} +16 -15
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js +90 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js +2 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +11 -6
- package/dist/collection/lib/index.js +1 -1
- package/dist/collection/lib/message/resources/snk-attach.msg.js +13 -0
- package/dist/components/ConfigStorage.js +24 -14
- package/dist/components/SnkMessageBuilder.js +13 -0
- package/dist/components/dataunit-fetcher.js +11 -6
- package/dist/components/field-search.js +29 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +1 -0
- package/dist/components/snk-actions-button2.js +1 -0
- package/dist/components/snk-application2.js +62 -2
- package/dist/components/snk-attach2.js +414 -71
- package/dist/components/snk-crud.js +69 -63
- package/dist/components/snk-detail-view2.js +95 -94
- package/dist/components/snk-filter-bar2.js +5 -2
- package/dist/components/snk-filter-item2.js +47 -1
- package/dist/components/snk-grid2.js +91 -76
- package/dist/components/snk-simple-crud2.js +31 -46
- package/dist/components/snk-taskbar2.js +15 -9
- package/dist/components/taskbar-actions-button.d.ts +11 -0
- package/dist/components/taskbar-actions-button.js +6 -0
- package/dist/components/taskbar-actions-button2.js +154 -0
- package/dist/esm/{ConfigStorage-1244b8b0.js → ConfigStorage-4151acc8.js} +24 -14
- package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
- package/dist/esm/{SnkFormConfigManager-9be0e7d4.js → SnkFormConfigManager-5c7d3771.js} +1 -1
- package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-0fb796b9.js} +13 -0
- package/dist/esm/{field-search-c6938ee4.js → field-search-efbe307f.js} +29 -2
- package/dist/esm/{index-1564817d.js → index-0ece87a6.js} +1 -0
- package/dist/esm/index-a7d3d3f1.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-cf01a8f4.js → pesquisa-fetcher-d6ff9386.js} +173 -7
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button.entry.js → snk-actions-button_2.entry.js} +134 -6
- package/dist/esm/snk-application.entry.js +65 -6
- package/dist/esm/snk-attach.entry.js +390 -59
- package/dist/esm/snk-crud.entry.js +8 -9
- package/dist/esm/snk-data-exporter.entry.js +3 -3
- package/dist/esm/{snk-data-unit-6208ebf0.js → snk-data-unit-5d201fb3.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +9 -10
- package/dist/esm/snk-filter-bar.entry.js +6 -3
- package/dist/esm/snk-filter-item.entry.js +47 -1
- package/dist/esm/snk-filter-modal-item.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +2 -2
- package/dist/esm/snk-grid-config.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +52 -43
- package/dist/esm/{snk-guides-viewer-fde509bf.js → snk-guides-viewer-4e56a2e0.js} +10 -21
- package/dist/esm/snk-guides-viewer.entry.js +8 -9
- package/dist/esm/snk-personalized-filter.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +19 -41
- package/dist/esm/snk-taskbar.entry.js +2 -2
- package/dist/esm/{taskbar-elements-0a6b8b95.js → taskbar-elements-d4d0b424.js} +4 -4
- package/dist/sankhyablocks/{p-ff6064e7.js → p-05243555.js} +1 -1
- package/dist/sankhyablocks/{p-fd8814b9.entry.js → p-1d75d9f9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
- package/dist/sankhyablocks/p-32460e98.entry.js +11 -0
- package/dist/sankhyablocks/p-374d03f6.js +1 -0
- package/dist/sankhyablocks/p-38289a55.js +1 -0
- package/dist/sankhyablocks/{p-35fe6e61.entry.js → p-3963b9c1.entry.js} +1 -1
- package/dist/sankhyablocks/p-42af1bbf.js +65 -0
- package/dist/sankhyablocks/{p-776ee8e3.js → p-573a07c5.js} +1 -1
- package/dist/sankhyablocks/{p-d4fb9642.entry.js → p-69efa80d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6977a26c.entry.js → p-71439fd9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-11081798.entry.js → p-761ed32f.entry.js} +1 -1
- package/dist/sankhyablocks/p-7d8d7fe9.entry.js +1 -0
- package/dist/sankhyablocks/{p-f514913b.entry.js → p-7f3c7b09.entry.js} +1 -1
- package/dist/sankhyablocks/p-8c74258e.entry.js +1 -0
- package/dist/sankhyablocks/p-8f0488b8.entry.js +1 -0
- package/dist/sankhyablocks/p-9ebcfeb6.entry.js +1 -0
- package/dist/sankhyablocks/p-aa95fb2c.js +56 -0
- package/dist/sankhyablocks/p-b05ab13d.entry.js +1 -0
- package/dist/sankhyablocks/p-c2137023.entry.js +1 -0
- package/dist/sankhyablocks/p-c2495304.js +1 -0
- package/dist/sankhyablocks/p-c4874327.entry.js +1 -0
- package/dist/sankhyablocks/p-d82f6eda.entry.js +1 -0
- package/dist/sankhyablocks/p-dcb6aad1.entry.js +1 -0
- package/dist/sankhyablocks/{p-3520c088.entry.js → p-e0fd9555.entry.js} +1 -1
- package/dist/sankhyablocks/p-e8812d8a.js +1 -0
- package/dist/sankhyablocks/{p-32f0935f.js → p-f3d1c48e.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/subcomponents/snk-actions-form.d.ts +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +4 -1
- package/dist/types/components/snk-attach/{structure/crud-config-builder.d.ts → interfaces/ICrudConfig.d.ts} +1 -2
- package/dist/types/components/snk-attach/interfaces/TFetcherType.d.ts +1 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +27 -6
- package/dist/types/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.d.ts +2 -0
- package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +31 -0
- package/dist/types/components/snk-attach/structure/{taskbar-builder.d.ts → builder/taskbar-builder.d.ts} +1 -1
- package/dist/types/components/snk-attach/structure/fetcher/facade/fetcher.facade.d.ts +11 -0
- package/dist/types/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.d.ts +17 -0
- package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +15 -0
- package/dist/types/components/snk-attach/structure/index.d.ts +6 -3
- package/dist/types/components/snk-crud/snk-crud.d.ts +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +1 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +5 -4
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +6 -5
- package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +60 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +16 -0
- package/dist/types/components/snk-taskbar/subcomponents/field-search.d.ts +2 -0
- package/dist/types/components.d.ts +111 -11
- package/dist/types/lib/@types/index.d.ts +2 -1
- package/dist/types/lib/configs/ConfigStorage.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/{attach-fetcher.d.ts → AttachFetcher/anexo-sistema-fetcher.d.ts} +3 -2
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.d.ts +11 -0
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.d.ts +8 -0
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/index.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +1 -0
- package/dist/types/lib/index.d.ts +1 -1
- package/package.json +8 -6
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/pesquisa-fetcher-ef050a47.js +0 -167
- package/dist/esm/pesquisa-fetcher-dd3ca0a5.js +0 -165
- package/dist/sankhyablocks/p-08ced1fd.entry.js +0 -1
- package/dist/sankhyablocks/p-3160fa64.js +0 -60
- package/dist/sankhyablocks/p-34774923.entry.js +0 -1
- package/dist/sankhyablocks/p-38ab8a3b.entry.js +0 -1
- package/dist/sankhyablocks/p-3ab540cc.entry.js +0 -11
- package/dist/sankhyablocks/p-3ecd72a4.js +0 -1
- package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
- package/dist/sankhyablocks/p-5534e08c.js +0 -1
- package/dist/sankhyablocks/p-585294ee.js +0 -56
- package/dist/sankhyablocks/p-6ea96bb1.entry.js +0 -1
- package/dist/sankhyablocks/p-936addf1.js +0 -1
- package/dist/sankhyablocks/p-c53926eb.entry.js +0 -1
- package/dist/sankhyablocks/p-c9841939.js +0 -1
- package/dist/sankhyablocks/p-cfbebb49.entry.js +0 -1
- package/dist/sankhyablocks/p-d2923a2a.entry.js +0 -1
- package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
- package/dist/sankhyablocks/p-f2056f66.entry.js +0 -1
- package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +0 -15
- /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js → components/snk-attach/interfaces/ICrudConfig.js} +0 -0
- /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js → components/snk-attach/interfaces/TFetcherType.js} +0 -0
- /package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.js +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDelete.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDownloadKey.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.d.ts +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import { h, Fragment } from '@stencil/core';
|
2
|
-
import { ApplicationContext, DataType, ElementIDUtils } from '@sankhyalabs/core';
|
2
|
+
import { ApplicationContext, DataType, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
|
3
3
|
import { SortMode, UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
4
4
|
import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
|
5
5
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
@@ -8,20 +8,27 @@ import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
|
|
8
8
|
import store from "../../lib/store";
|
9
9
|
import SnkMultiSelectionListDataSource from './filtercolumn/SnkMultiSelectionListDataSource';
|
10
10
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
11
|
-
import { buildFieldSearch } from '../snk-taskbar/subcomponents/field-search';
|
11
|
+
import { buildFieldSearch, openFieldSearch } from '../snk-taskbar/subcomponents/field-search';
|
12
12
|
export class SnkGrid {
|
13
13
|
constructor() {
|
14
14
|
this._topTaskbarProcessor = new TaskbarProcessor({
|
15
15
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
16
16
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
17
|
+
"snkGridTopTaskbar.regular.singleTaskbar": [],
|
17
18
|
"snkGridTopTaskbar.finish_edition": ["CANCEL", "SAVE"],
|
18
|
-
"snkGridTopTaskbar.finish_edition.secondary": []
|
19
|
+
"snkGridTopTaskbar.finish_edition.secondary": [],
|
20
|
+
"snkGridTopTaskbar.finish_edition.singleTaskbar": [],
|
19
21
|
});
|
20
22
|
this._headerTaskbarProcessor = new TaskbarProcessor({
|
21
23
|
"snkGridHeaderTaskbar.unselected": ["REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON", "MORE_OPTIONS"],
|
22
24
|
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "ATTACH", "REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON"],
|
23
25
|
"snkGridHeaderTaskbar.detail.unselected": ["REFRESH", "MORE_OPTIONS"],
|
24
|
-
"snkGridHeaderTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
|
26
|
+
"snkGridHeaderTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"],
|
27
|
+
"snkGridHeaderTaskbar.singleTaskbar.unselected": ["INSERT", "FORM_MODE", "CONFIGURATOR", "REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON", "MORE_OPTIONS"],
|
28
|
+
"snkGridHeaderTaskbar.singleTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "ATTACH", "FORM_MODE", "CONFIGURATOR", "REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON"],
|
29
|
+
"snkGridHeaderTaskbar.singleTaskbar.detail.unselected": ["INSERT", "FORM_MODE", "CONFIGURATOR", "REFRESH", "MORE_OPTIONS"],
|
30
|
+
"snkGridHeaderTaskbar.singleTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "FORM_MODE", "CONFIGURATOR", "REFRESH"],
|
31
|
+
"snkGridHeaderTaskbar.singleTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
25
32
|
});
|
26
33
|
this._dataUnit = undefined;
|
27
34
|
this._dataState = undefined;
|
@@ -77,28 +84,18 @@ export class SnkGrid {
|
|
77
84
|
var _a;
|
78
85
|
(_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.reload();
|
79
86
|
}
|
80
|
-
/**
|
81
|
-
* Abre o localizador de colunas
|
82
|
-
*/
|
83
|
-
async findColumn() {
|
84
|
-
if (!this._moreOptions) {
|
85
|
-
return;
|
86
|
-
}
|
87
|
-
if (!(await this._moreOptions.isOpened())) {
|
88
|
-
this._moreOptions.showActions();
|
89
|
-
}
|
90
|
-
if (this._columnSearch) {
|
91
|
-
const realElement = this._columnSearch["$elm$"];
|
92
|
-
realElement.value = null;
|
93
|
-
requestAnimationFrame(() => realElement.setFocus());
|
94
|
-
}
|
95
|
-
}
|
96
87
|
/**
|
97
88
|
* Retorna o elemento da filter-bar da grade.
|
98
89
|
*/
|
99
90
|
async getFilterBar() {
|
100
91
|
return this._snkFilterBar;
|
101
92
|
}
|
93
|
+
/**
|
94
|
+
* Abre o localizador de colunas
|
95
|
+
*/
|
96
|
+
async findColumn() {
|
97
|
+
await openFieldSearch(this._moreOptions, this._columnSearch);
|
98
|
+
}
|
102
99
|
openGridConfig() {
|
103
100
|
this._grid.getColumnsState()
|
104
101
|
.then((gridColumns) => {
|
@@ -312,41 +309,51 @@ export class SnkGrid {
|
|
312
309
|
return invisibleButtons;
|
313
310
|
}
|
314
311
|
componentWillRender() {
|
315
|
-
var _a;
|
316
312
|
const invisibleButtons = this.getInvisibleButtons();
|
317
|
-
|
318
|
-
let headerTaskbarId;
|
319
|
-
if (hasSelectedRecord) {
|
320
|
-
headerTaskbarId = this.isDetail ? "snkGridHeaderTaskbar.detail.selected" : "snkGridHeaderTaskbar.selected";
|
321
|
-
}
|
322
|
-
else {
|
323
|
-
headerTaskbarId = this.isDetail ? "snkGridHeaderTaskbar.detail.unselected" : "snkGridHeaderTaskbar.unselected";
|
324
|
-
}
|
325
|
-
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState, this.getHeaderDisabledButtons(), invisibleButtons);
|
313
|
+
this._headerTaskbarProcessor.process(this.getHeaderTaskbarId(), this.taskbarManager, this._dataState, this.getHeaderDisabledButtons(), invisibleButtons);
|
326
314
|
this._topTaskbarProcessor.process(this.getTopTaskBarId(), this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
327
315
|
this.dataExporterProviderStore();
|
328
316
|
}
|
317
|
+
getHeaderTaskbarId() {
|
318
|
+
var _a, _b;
|
319
|
+
const hasSelectedRecord = this._dataState && !!((_a = this._dataState.selectionInfo) === null || _a === void 0 ? void 0 : _a.length);
|
320
|
+
const taskbarIdPrefixLookup = {
|
321
|
+
primary: this.isDetail ? "snkGridHeaderTaskbar.detail" : "snkGridHeaderTaskbar",
|
322
|
+
secondary: this.isDetail ? "snkGridHeaderTaskbar.detail" : "snkGridHeaderTaskbar",
|
323
|
+
singleTaskbar: this.isDetail ? "snkGridHeaderTaskbar.singleTaskbar.detail" : "snkGridHeaderTaskbar.singleTaskbar"
|
324
|
+
};
|
325
|
+
const taskbarIdPrefix = taskbarIdPrefixLookup[this.presentationMode];
|
326
|
+
let headerTaskbarId = hasSelectedRecord ? `${taskbarIdPrefix}.selected` : `${taskbarIdPrefix}.unselected`;
|
327
|
+
if (((_b = this._dataState) === null || _b === void 0 ? void 0 : _b.isDirty) && this.presentationMode === PresentationMode.SINGLE_TASKBAR) {
|
328
|
+
headerTaskbarId = "snkGridHeaderTaskbar.singleTaskbar.finish_edition";
|
329
|
+
}
|
330
|
+
return headerTaskbarId;
|
331
|
+
}
|
329
332
|
getTopTaskBarId() {
|
330
333
|
var _a;
|
331
|
-
const
|
334
|
+
const suffixLookup = {
|
335
|
+
primary: "",
|
336
|
+
secondary: ".secondary",
|
337
|
+
singleTaskbar: ".singleTaskbar"
|
338
|
+
};
|
339
|
+
const sufix = suffixLookup[this.presentationMode];
|
332
340
|
if ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
|
333
341
|
return `snkGridTopTaskbar.finish_edition${sufix}`;
|
334
342
|
}
|
335
343
|
return `snkGridTopTaskbar.regular${sufix}`;
|
336
344
|
}
|
337
345
|
getPrimaryButton() {
|
338
|
-
|
346
|
+
const primaryButtonLookup = {
|
347
|
+
primary: "INSERT",
|
348
|
+
secondary: "",
|
349
|
+
singleTaskbar: "INSERT"
|
350
|
+
};
|
351
|
+
return primaryButtonLookup[this.presentationMode];
|
339
352
|
}
|
340
353
|
getColumnSearch(actionButton, item) {
|
341
354
|
if (this._columnSearch != undefined) {
|
342
355
|
return this._columnSearch;
|
343
356
|
}
|
344
|
-
actionButton.addEventListener("ezPopoverOpen", () => {
|
345
|
-
if (this._columnSearch) {
|
346
|
-
const realElement = this._columnSearch["$elm$"];
|
347
|
-
realElement.value = null;
|
348
|
-
}
|
349
|
-
});
|
350
357
|
this._moreOptions = actionButton;
|
351
358
|
this._columnSearch = buildFieldSearch(item, ({ argument }) => new Promise(accept => {
|
352
359
|
this._grid.filterColumns(argument).then((columns) => {
|
@@ -364,8 +371,10 @@ export class SnkGrid {
|
|
364
371
|
}
|
365
372
|
getActionsList() {
|
366
373
|
const hardList = [{
|
367
|
-
value:
|
374
|
+
value: StringUtils.generateUUID(),
|
368
375
|
label: this.messagesBuilder.getMessage("snkGrid.findColumn", {}),
|
376
|
+
disableCloseOnSelect: true,
|
377
|
+
eagerInitialize: true,
|
369
378
|
itemBuilder: (actionButton, item) => this.getColumnSearch(actionButton, item)
|
370
379
|
}];
|
371
380
|
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
@@ -390,7 +399,7 @@ export class SnkGrid {
|
|
390
399
|
return undefined;
|
391
400
|
}
|
392
401
|
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 &&
|
393
|
-
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, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), 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 }))));
|
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 }))));
|
394
403
|
}
|
395
404
|
static get is() { return "snk-grid"; }
|
396
405
|
static get encapsulation() { return "scoped"; }
|
@@ -587,7 +596,7 @@ export class SnkGrid {
|
|
587
596
|
"mutable": false,
|
588
597
|
"complexType": {
|
589
598
|
"original": "PresentationMode",
|
590
|
-
"resolved": "PresentationMode.PRIMARY | PresentationMode.SECONDARY",
|
599
|
+
"resolved": "PresentationMode.PRIMARY | PresentationMode.SECONDARY | PresentationMode.SINGLE_TASKBAR",
|
591
600
|
"references": {
|
592
601
|
"PresentationMode": {
|
593
602
|
"location": "import",
|
@@ -851,41 +860,38 @@ export class SnkGrid {
|
|
851
860
|
"tags": []
|
852
861
|
}
|
853
862
|
},
|
854
|
-
"
|
863
|
+
"getFilterBar": {
|
855
864
|
"complexType": {
|
856
|
-
"signature": "() => Promise<
|
865
|
+
"signature": "() => Promise<HTMLSnkFilterBarElement>",
|
857
866
|
"parameters": [],
|
858
867
|
"references": {
|
859
868
|
"Promise": {
|
860
869
|
"location": "global"
|
861
870
|
},
|
862
|
-
"
|
871
|
+
"HTMLSnkFilterBarElement": {
|
863
872
|
"location": "global"
|
864
873
|
}
|
865
874
|
},
|
866
|
-
"return": "Promise<
|
875
|
+
"return": "Promise<HTMLSnkFilterBarElement>"
|
867
876
|
},
|
868
877
|
"docs": {
|
869
|
-
"text": "
|
878
|
+
"text": "Retorna o elemento da filter-bar da grade.",
|
870
879
|
"tags": []
|
871
880
|
}
|
872
881
|
},
|
873
|
-
"
|
882
|
+
"findColumn": {
|
874
883
|
"complexType": {
|
875
|
-
"signature": "() => Promise<
|
884
|
+
"signature": "() => Promise<void>",
|
876
885
|
"parameters": [],
|
877
886
|
"references": {
|
878
887
|
"Promise": {
|
879
888
|
"location": "global"
|
880
|
-
},
|
881
|
-
"HTMLSnkFilterBarElement": {
|
882
|
-
"location": "global"
|
883
889
|
}
|
884
890
|
},
|
885
|
-
"return": "Promise<
|
891
|
+
"return": "Promise<void>"
|
886
892
|
},
|
887
893
|
"docs": {
|
888
|
-
"text": "
|
894
|
+
"text": "Abre o localizador de colunas",
|
889
895
|
"tags": []
|
890
896
|
}
|
891
897
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ApplicationContext, DataType, FloatingManager, ObjectUtils, UserInterface,
|
1
|
+
import { ApplicationContext, DataType, FloatingManager, JSUtils, ObjectUtils, StringUtils, UserInterface, } from '@sankhyalabs/core';
|
2
2
|
import { h } from '@stencil/core';
|
3
3
|
import { SIMPLE_CRUD_MODE, VIEW_MODE } from '../../lib/utils/constants';
|
4
4
|
import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
|
@@ -6,7 +6,7 @@ import { PresentationMode } from '../../lib';
|
|
6
6
|
import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
|
7
7
|
import InMemoryLoader from '../../lib/dataUnit/InMemoryLoader';
|
8
8
|
import SnkMultiSelectionListDataSource from '../snk-grid/filtercolumn/SnkMultiSelectionListDataSource';
|
9
|
-
import { buildFieldSearch } from '../snk-taskbar/subcomponents/field-search';
|
9
|
+
import { buildFieldSearch, openFieldSearch } from '../snk-taskbar/subcomponents/field-search';
|
10
10
|
export class SnkSimpleCrud {
|
11
11
|
constructor() {
|
12
12
|
this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
|
@@ -180,12 +180,6 @@ export class SnkSimpleCrud {
|
|
180
180
|
if (this._columnSearch != undefined) {
|
181
181
|
return this._columnSearch;
|
182
182
|
}
|
183
|
-
actionButton.addEventListener("ezPopoverOpen", () => {
|
184
|
-
if (this._columnSearch) {
|
185
|
-
const realElement = this._columnSearch["$elm$"];
|
186
|
-
realElement.value = null;
|
187
|
-
}
|
188
|
-
});
|
189
183
|
this._moreOptions = actionButton;
|
190
184
|
this._columnSearch = buildFieldSearch(item, ({ argument }) => new Promise(accept => {
|
191
185
|
this._grid.filterColumns(argument).then((columns) => {
|
@@ -194,9 +188,10 @@ export class SnkSimpleCrud {
|
|
194
188
|
.map(column => ({ label: column.label, value: column.name })));
|
195
189
|
});
|
196
190
|
}), (option) => {
|
191
|
+
var _a;
|
197
192
|
if (option != undefined) {
|
198
193
|
this._grid.locateColumn(option.value);
|
199
|
-
actionButton.
|
194
|
+
(_a = actionButton["hideActions"]) === null || _a === void 0 ? void 0 : _a.call(actionButton);
|
200
195
|
}
|
201
196
|
});
|
202
197
|
return this._columnSearch;
|
@@ -238,14 +233,16 @@ export class SnkSimpleCrud {
|
|
238
233
|
getActionsList() {
|
239
234
|
var _a, _b;
|
240
235
|
return [{
|
241
|
-
value:
|
236
|
+
value: StringUtils.generateUUID(),
|
242
237
|
label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.findColumn", undefined)) !== null && _b !== void 0 ? _b : "Buscar",
|
238
|
+
disableCloseOnSelect: true,
|
239
|
+
eagerInitialize: true,
|
243
240
|
itemBuilder: (actionButton, item) => (this._currentViewMode === VIEW_MODE.GRID)
|
244
241
|
? this.getColumnSearch(actionButton, item)
|
245
242
|
: this.getFieldSearch(actionButton, item)
|
246
243
|
}];
|
247
244
|
}
|
248
|
-
keyDownListener(event) {
|
245
|
+
async keyDownListener(event) {
|
249
246
|
if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
|
250
247
|
return;
|
251
248
|
}
|
@@ -257,39 +254,21 @@ export class SnkSimpleCrud {
|
|
257
254
|
}
|
258
255
|
FloatingManager.closeAll();
|
259
256
|
if (this._currentViewMode === VIEW_MODE.GRID) {
|
260
|
-
this.findColumn();
|
257
|
+
await this.findColumn();
|
261
258
|
}
|
262
259
|
else {
|
263
|
-
this.findField();
|
260
|
+
await this.findField();
|
264
261
|
}
|
265
262
|
event.preventDefault();
|
266
263
|
}
|
267
264
|
async findField() {
|
268
|
-
|
269
|
-
return;
|
270
|
-
}
|
271
|
-
if (!(await this._moreOptions.isOpened())) {
|
272
|
-
this._moreOptions.showActions();
|
273
|
-
return;
|
274
|
-
}
|
275
|
-
if (this._fieldSearch) {
|
276
|
-
const realElement = this._fieldSearch["$elm$"];
|
277
|
-
realElement.value = null;
|
278
|
-
requestAnimationFrame(() => realElement.setFocus());
|
279
|
-
}
|
265
|
+
await this.openSeach(this._fieldSearch);
|
280
266
|
}
|
281
267
|
async findColumn() {
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
this._moreOptions.showActions();
|
287
|
-
}
|
288
|
-
if (this._columnSearch) {
|
289
|
-
const realElement = this._columnSearch["$elm$"];
|
290
|
-
realElement.value = null;
|
291
|
-
requestAnimationFrame(() => realElement.setFocus());
|
292
|
-
}
|
268
|
+
await this.openSeach(this._columnSearch);
|
269
|
+
}
|
270
|
+
async openSeach(fieldSearch) {
|
271
|
+
await openFieldSearch(this._moreOptions, fieldSearch);
|
293
272
|
}
|
294
273
|
clearFieldToFocusHandler() {
|
295
274
|
this._fieldToGetFocus = undefined;
|
@@ -0,0 +1,324 @@
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
2
|
+
export class TaskbarActionsButton {
|
3
|
+
constructor() {
|
4
|
+
this._showDropdown = false;
|
5
|
+
this.title = undefined;
|
6
|
+
this.enabled = undefined;
|
7
|
+
this.actions = undefined;
|
8
|
+
}
|
9
|
+
async handleKeyDown(event) {
|
10
|
+
if (event.key === 'Escape' || event.key === 'Esc') {
|
11
|
+
await this.hideActions();
|
12
|
+
}
|
13
|
+
}
|
14
|
+
async handleClose() {
|
15
|
+
await this.hideActions();
|
16
|
+
}
|
17
|
+
/**
|
18
|
+
* Exibe a lista de ações.
|
19
|
+
*/
|
20
|
+
async showActions() {
|
21
|
+
this._showDropdown = true;
|
22
|
+
requestAnimationFrame(() => {
|
23
|
+
this._element.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' });
|
24
|
+
});
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* Esaconde a lista de ações.
|
28
|
+
*/
|
29
|
+
async hideActions() {
|
30
|
+
this._showDropdown = false;
|
31
|
+
}
|
32
|
+
/**
|
33
|
+
* Informa se a lista de ações está aberta.
|
34
|
+
*/
|
35
|
+
async isOpened() {
|
36
|
+
return this._showDropdown;
|
37
|
+
}
|
38
|
+
controlDropdown() {
|
39
|
+
this._showDropdown = !this._showDropdown;
|
40
|
+
}
|
41
|
+
loadItems() {
|
42
|
+
return this.actions.filter(action => action !== undefined).map(action => {
|
43
|
+
var _a;
|
44
|
+
return {
|
45
|
+
id: action.value,
|
46
|
+
label: action.label,
|
47
|
+
value: action.value,
|
48
|
+
type: (_a = action.type) !== null && _a !== void 0 ? _a : 'item',
|
49
|
+
children: action.children,
|
50
|
+
iconName: action.iconName,
|
51
|
+
subAction: action.subAction,
|
52
|
+
group: action.group,
|
53
|
+
disableCloseOnSelect: action.disableCloseOnSelect,
|
54
|
+
};
|
55
|
+
});
|
56
|
+
}
|
57
|
+
canShowDropdown() {
|
58
|
+
var _a;
|
59
|
+
return this._showDropdown && ((_a = this.actions) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
60
|
+
}
|
61
|
+
onSelectAction(iAction) {
|
62
|
+
const actions = this.actions.map(action => (Object.assign(Object.assign({}, action), { id: action.value })));
|
63
|
+
const selectedAction = this.getSelectedAction(iAction.id, actions);
|
64
|
+
this.taskbarActionSelected.emit(selectedAction);
|
65
|
+
if (!selectedAction.disableCloseOnSelect) {
|
66
|
+
this._showDropdown = false;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
getSelectedAction(id, actions) {
|
70
|
+
let selectedItem;
|
71
|
+
for (const item of actions) {
|
72
|
+
if (item.id === id) {
|
73
|
+
selectedItem = item;
|
74
|
+
break;
|
75
|
+
}
|
76
|
+
if (!(item === null || item === void 0 ? void 0 : item.children))
|
77
|
+
continue;
|
78
|
+
selectedItem = this.getSelectedAction(id, item.children);
|
79
|
+
}
|
80
|
+
return selectedItem;
|
81
|
+
}
|
82
|
+
dropdownItemBuilder(item, _level) {
|
83
|
+
const itemAction = this.actions.find(action => action.value === item.id);
|
84
|
+
if (!itemAction || !itemAction.itemBuilder) {
|
85
|
+
return undefined;
|
86
|
+
}
|
87
|
+
const customContent = itemAction.itemBuilder(this._element, itemAction);
|
88
|
+
if (typeof customContent === 'string') {
|
89
|
+
return h("div", { innerHTML: customContent });
|
90
|
+
}
|
91
|
+
return customContent;
|
92
|
+
}
|
93
|
+
/**
|
94
|
+
* Existem algumas actions que precisam ser inicializadas assim que o componente é carregado,
|
95
|
+
* pois necessitam de algumas informações, como por exemplo a referência do elemento taskbar-actions-button na tela.
|
96
|
+
* É o caso do searchColumn/searhField
|
97
|
+
*/
|
98
|
+
initializeEagerItems() {
|
99
|
+
var _a;
|
100
|
+
(_a = this.actions) === null || _a === void 0 ? void 0 : _a.forEach(action => {
|
101
|
+
var _a;
|
102
|
+
if (action && action.eagerInitialize && action.itemBuilder) {
|
103
|
+
(_a = action.itemBuilder) === null || _a === void 0 ? void 0 : _a.call(action, this._element, action);
|
104
|
+
}
|
105
|
+
});
|
106
|
+
}
|
107
|
+
componentDidLoad() {
|
108
|
+
this.initializeEagerItems();
|
109
|
+
}
|
110
|
+
componentDidRender() {
|
111
|
+
if (this._showDropdown) {
|
112
|
+
this.taskbarActionsOpened.emit(this._element);
|
113
|
+
}
|
114
|
+
}
|
115
|
+
disconnectedCallback() {
|
116
|
+
this.taskbarActionsButtonDisconnected.emit();
|
117
|
+
}
|
118
|
+
render() {
|
119
|
+
return (h(Host, null, h("div", { class: `ez-padding-left--medium ${this.canShowDropdown() ? ' ez-elevation--16' : ''}` }, h("ez-button", { title: this.title, mode: 'icon', iconName: 'dots-vertical', size: 'small', enabled: this.enabled, onClick: () => this.controlDropdown() }), this.canShowDropdown() && h("ez-dropdown", { items: this.loadItems(), onEzClick: (evt) => this.onSelectAction(evt.detail), onEzOutsideClick: () => this._showDropdown = false, itemBuilder: (item, level) => this.dropdownItemBuilder(item, level) }))));
|
120
|
+
}
|
121
|
+
static get is() { return "taskbar-actions-button"; }
|
122
|
+
static get encapsulation() { return "scoped"; }
|
123
|
+
static get originalStyleUrls() {
|
124
|
+
return {
|
125
|
+
"$": ["taskbar-actions-button.css"]
|
126
|
+
};
|
127
|
+
}
|
128
|
+
static get styleUrls() {
|
129
|
+
return {
|
130
|
+
"$": ["taskbar-actions-button.css"]
|
131
|
+
};
|
132
|
+
}
|
133
|
+
static get properties() {
|
134
|
+
return {
|
135
|
+
"title": {
|
136
|
+
"type": "string",
|
137
|
+
"mutable": false,
|
138
|
+
"complexType": {
|
139
|
+
"original": "string",
|
140
|
+
"resolved": "string",
|
141
|
+
"references": {}
|
142
|
+
},
|
143
|
+
"required": false,
|
144
|
+
"optional": false,
|
145
|
+
"docs": {
|
146
|
+
"tags": [],
|
147
|
+
"text": "Texto que ser\u00E1 exibido no bot\u00E3o"
|
148
|
+
},
|
149
|
+
"attribute": "title",
|
150
|
+
"reflect": false
|
151
|
+
},
|
152
|
+
"enabled": {
|
153
|
+
"type": "boolean",
|
154
|
+
"mutable": false,
|
155
|
+
"complexType": {
|
156
|
+
"original": "boolean",
|
157
|
+
"resolved": "boolean",
|
158
|
+
"references": {}
|
159
|
+
},
|
160
|
+
"required": false,
|
161
|
+
"optional": false,
|
162
|
+
"docs": {
|
163
|
+
"tags": [],
|
164
|
+
"text": "Se false o usu\u00E1rio n\u00E3o pode interagir com o componente."
|
165
|
+
},
|
166
|
+
"attribute": "enabled",
|
167
|
+
"reflect": false
|
168
|
+
},
|
169
|
+
"actions": {
|
170
|
+
"type": "unknown",
|
171
|
+
"mutable": false,
|
172
|
+
"complexType": {
|
173
|
+
"original": "Array<Action>",
|
174
|
+
"resolved": "Action[]",
|
175
|
+
"references": {
|
176
|
+
"Array": {
|
177
|
+
"location": "global"
|
178
|
+
},
|
179
|
+
"Action": {
|
180
|
+
"location": "import",
|
181
|
+
"path": "../../snk-taskbar"
|
182
|
+
}
|
183
|
+
}
|
184
|
+
},
|
185
|
+
"required": false,
|
186
|
+
"optional": false,
|
187
|
+
"docs": {
|
188
|
+
"tags": [],
|
189
|
+
"text": "Define a lista de a\u00E7\u00F5es."
|
190
|
+
}
|
191
|
+
}
|
192
|
+
};
|
193
|
+
}
|
194
|
+
static get states() {
|
195
|
+
return {
|
196
|
+
"_showDropdown": {}
|
197
|
+
};
|
198
|
+
}
|
199
|
+
static get events() {
|
200
|
+
return [{
|
201
|
+
"method": "taskbarActionSelected",
|
202
|
+
"name": "taskbarActionSelected",
|
203
|
+
"bubbles": true,
|
204
|
+
"cancelable": true,
|
205
|
+
"composed": true,
|
206
|
+
"docs": {
|
207
|
+
"tags": [],
|
208
|
+
"text": "Emitido ao selecionar uma a\u00E7\u00E3o"
|
209
|
+
},
|
210
|
+
"complexType": {
|
211
|
+
"original": "Action",
|
212
|
+
"resolved": "Action",
|
213
|
+
"references": {
|
214
|
+
"Action": {
|
215
|
+
"location": "import",
|
216
|
+
"path": "../../snk-taskbar"
|
217
|
+
}
|
218
|
+
}
|
219
|
+
}
|
220
|
+
}, {
|
221
|
+
"method": "taskbarActionsOpened",
|
222
|
+
"name": "taskbarActionsOpened",
|
223
|
+
"bubbles": true,
|
224
|
+
"cancelable": true,
|
225
|
+
"composed": true,
|
226
|
+
"docs": {
|
227
|
+
"tags": [],
|
228
|
+
"text": "Emitido ao mostrar a lista de a\u00E7\u00F5es"
|
229
|
+
},
|
230
|
+
"complexType": {
|
231
|
+
"original": "HTMLElement",
|
232
|
+
"resolved": "HTMLElement",
|
233
|
+
"references": {
|
234
|
+
"HTMLElement": {
|
235
|
+
"location": "global"
|
236
|
+
}
|
237
|
+
}
|
238
|
+
}
|
239
|
+
}, {
|
240
|
+
"method": "taskbarActionsButtonDisconnected",
|
241
|
+
"name": "taskbarActionsButtonDisconnected",
|
242
|
+
"bubbles": true,
|
243
|
+
"cancelable": true,
|
244
|
+
"composed": true,
|
245
|
+
"docs": {
|
246
|
+
"tags": [],
|
247
|
+
"text": "Emitido quando componente \u00E9 desconectado da DOM"
|
248
|
+
},
|
249
|
+
"complexType": {
|
250
|
+
"original": "void",
|
251
|
+
"resolved": "void",
|
252
|
+
"references": {}
|
253
|
+
}
|
254
|
+
}];
|
255
|
+
}
|
256
|
+
static get methods() {
|
257
|
+
return {
|
258
|
+
"showActions": {
|
259
|
+
"complexType": {
|
260
|
+
"signature": "() => Promise<void>",
|
261
|
+
"parameters": [],
|
262
|
+
"references": {
|
263
|
+
"Promise": {
|
264
|
+
"location": "global"
|
265
|
+
}
|
266
|
+
},
|
267
|
+
"return": "Promise<void>"
|
268
|
+
},
|
269
|
+
"docs": {
|
270
|
+
"text": "Exibe a lista de a\u00E7\u00F5es.",
|
271
|
+
"tags": []
|
272
|
+
}
|
273
|
+
},
|
274
|
+
"hideActions": {
|
275
|
+
"complexType": {
|
276
|
+
"signature": "() => Promise<void>",
|
277
|
+
"parameters": [],
|
278
|
+
"references": {
|
279
|
+
"Promise": {
|
280
|
+
"location": "global"
|
281
|
+
}
|
282
|
+
},
|
283
|
+
"return": "Promise<void>"
|
284
|
+
},
|
285
|
+
"docs": {
|
286
|
+
"text": "Esaconde a lista de a\u00E7\u00F5es.",
|
287
|
+
"tags": []
|
288
|
+
}
|
289
|
+
},
|
290
|
+
"isOpened": {
|
291
|
+
"complexType": {
|
292
|
+
"signature": "() => Promise<boolean>",
|
293
|
+
"parameters": [],
|
294
|
+
"references": {
|
295
|
+
"Promise": {
|
296
|
+
"location": "global"
|
297
|
+
}
|
298
|
+
},
|
299
|
+
"return": "Promise<boolean>"
|
300
|
+
},
|
301
|
+
"docs": {
|
302
|
+
"text": "Informa se a lista de a\u00E7\u00F5es est\u00E1 aberta.",
|
303
|
+
"tags": []
|
304
|
+
}
|
305
|
+
}
|
306
|
+
};
|
307
|
+
}
|
308
|
+
static get elementRef() { return "_element"; }
|
309
|
+
static get listeners() {
|
310
|
+
return [{
|
311
|
+
"name": "keydown",
|
312
|
+
"method": "handleKeyDown",
|
313
|
+
"target": "window",
|
314
|
+
"capture": false,
|
315
|
+
"passive": false
|
316
|
+
}, {
|
317
|
+
"name": "ezOpenModal",
|
318
|
+
"method": "handleClose",
|
319
|
+
"target": "window",
|
320
|
+
"capture": false,
|
321
|
+
"passive": false
|
322
|
+
}];
|
323
|
+
}
|
324
|
+
}
|