@sankhyalabs/sankhyablocks 1.3.31-beta.16 → 1.3.31-beta.18
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-79cf15c5.js → SnkMessageBuilder-02c2ca02.js} +137 -1
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/css-shim-b8158822.js +6 -0
- package/dist/cjs/dom-36862b77.js +75 -0
- package/dist/cjs/filter-item-type.enum-e2e1bc5b.js +14 -0
- package/dist/cjs/index-02201bc9.js +2397 -0
- package/dist/cjs/{index-5575fe3d.js → index-b0b676c5.js} +1598 -145
- package/dist/cjs/loader.cjs.js +18 -2
- package/dist/cjs/sankhyablocks.cjs.js +116 -4
- package/dist/cjs/shadow-css-346c0795.js +389 -0
- package/dist/cjs/snk-application.cjs.entry.js +662 -66
- package/dist/cjs/snk-crud.cjs.entry.js +3 -2
- package/dist/cjs/snk-data-unit.cjs.entry.js +23 -24
- package/dist/cjs/snk-filter-bar.cjs.entry.js +247 -0
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +47 -0
- package/dist/cjs/snk-filter-detail.cjs.entry.js +49 -0
- package/dist/cjs/snk-filter-item.cjs.entry.js +143 -0
- package/dist/cjs/snk-filter-list.cjs.entry.js +91 -0
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +23 -0
- package/dist/cjs/snk-filter-number.cjs.entry.js +24 -0
- package/dist/cjs/snk-filter-period.cjs.entry.js +26 -0
- package/dist/cjs/snk-filter-search.cjs.entry.js +44 -0
- package/dist/cjs/snk-filter-text.cjs.entry.js +22 -0
- package/dist/cjs/{snk-form_2.cjs.entry.js → snk-form.cjs.entry.js} +21 -65
- package/dist/cjs/snk-grid.cjs.entry.js +79 -0
- package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
- package/dist/cjs/snk-taskbar.cjs.entry.js +17 -13
- package/dist/cjs/{taskbar-elements-2ae0d005.js → taskbar-elements-283c737e.js} +37 -18
- package/dist/cjs/taskbar-processor-6bd0d35c.js +47 -0
- package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
- package/dist/collection/collection-manifest.json +10 -0
- package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +7 -0
- package/dist/collection/components/snk-application/snk-application.js +89 -17
- package/dist/collection/components/snk-crud/snk-crud.js +41 -3
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +88 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +64 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +65 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +69 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +118 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +63 -0
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +10 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +118 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +244 -0
- package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +233 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +114 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +305 -0
- package/dist/collection/components/snk-form/snk-form.js +41 -1
- package/dist/collection/components/snk-grid/snk-grid.css +14 -1
- package/dist/collection/components/snk-grid/snk-grid.js +35 -3
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +35 -17
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +43 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +36 -11
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +24 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +1 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +388 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +18 -0
- package/dist/components/SnkMessageBuilder.js +137 -2
- package/dist/components/filter-item-type.enum.js +12 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +14 -0
- package/dist/components/index2.js +2384 -0
- package/dist/components/snk-application2.js +628 -30
- package/dist/components/snk-crud.js +29 -3
- package/dist/components/snk-data-unit.js +2 -3
- package/dist/components/snk-filter-bar.d.ts +11 -0
- package/dist/components/snk-filter-bar.js +6 -0
- package/dist/components/snk-filter-bar2.js +278 -0
- package/dist/components/snk-filter-binary-select.d.ts +11 -0
- package/dist/components/snk-filter-binary-select.js +63 -0
- package/dist/components/snk-filter-detail.d.ts +11 -0
- package/dist/components/snk-filter-detail.js +6 -0
- package/dist/components/snk-filter-detail2.js +63 -0
- package/dist/components/snk-filter-item.d.ts +11 -0
- package/dist/components/snk-filter-item.js +6 -0
- package/dist/components/snk-filter-item2.js +164 -0
- package/dist/components/snk-filter-list.d.ts +11 -0
- package/dist/components/snk-filter-list.js +6 -0
- package/dist/components/snk-filter-list2.js +111 -0
- package/dist/components/snk-filter-multi-select.d.ts +11 -0
- package/dist/components/snk-filter-multi-select.js +39 -0
- package/dist/components/snk-filter-number.d.ts +11 -0
- package/dist/components/snk-filter-number.js +40 -0
- package/dist/components/snk-filter-period.d.ts +11 -0
- package/dist/components/snk-filter-period.js +42 -0
- package/dist/components/snk-filter-search.d.ts +11 -0
- package/dist/components/snk-filter-search.js +62 -0
- package/dist/components/snk-filter-text.d.ts +11 -0
- package/dist/components/snk-filter-text.js +38 -0
- package/dist/components/snk-form2.js +21 -2
- package/dist/components/snk-grid2.js +42 -7
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/snk-taskbar2.js +50 -27
- package/dist/components/taskbar-processor.js +45 -0
- package/dist/components/teste-pesquisa.js +1 -1
- package/dist/esm/{SnkMessageBuilder-3cdde541.js → SnkMessageBuilder-65d431bd.js} +137 -2
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/css-shim-b3f2ee8d.js +4 -0
- package/dist/esm/dom-665d6011.js +73 -0
- package/dist/esm/filter-item-type.enum-61fbf80a.js +12 -0
- package/dist/esm/index-2b4d2d14.js +3262 -0
- package/dist/esm/index-e5b61043.js +2384 -0
- package/dist/esm/loader.js +18 -2
- package/dist/esm/sankhyablocks.js +116 -4
- package/dist/esm/shadow-css-b18e99d7.js +387 -0
- package/dist/esm/snk-application.entry.js +627 -31
- package/dist/esm/snk-crud.entry.js +3 -2
- package/dist/esm/snk-data-unit.entry.js +3 -4
- package/dist/esm/snk-filter-bar.entry.js +243 -0
- package/dist/esm/snk-filter-binary-select.entry.js +43 -0
- package/dist/esm/snk-filter-detail.entry.js +45 -0
- package/dist/esm/snk-filter-item.entry.js +139 -0
- package/dist/esm/snk-filter-list.entry.js +87 -0
- package/dist/esm/snk-filter-multi-select.entry.js +19 -0
- package/dist/esm/snk-filter-number.entry.js +20 -0
- package/dist/esm/snk-filter-period.entry.js +22 -0
- package/dist/esm/snk-filter-search.entry.js +40 -0
- package/dist/esm/snk-filter-text.entry.js +18 -0
- package/dist/esm/{snk-form_2.entry.js → snk-form.entry.js} +21 -64
- package/dist/esm/snk-grid.entry.js +75 -0
- package/dist/esm/snk-pesquisa.entry.js +2 -2
- package/dist/esm/snk-taskbar.entry.js +16 -12
- package/dist/esm/taskbar-elements-35d64ff9.js +90 -0
- package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
- package/dist/esm/teste-pesquisa.entry.js +2 -2
- package/dist/sankhyablocks/SnkMessageBuilder-65d431bd.js +303 -0
- package/dist/sankhyablocks/app-globals-0f993ce5.js +3 -0
- package/dist/sankhyablocks/css-shim-b3f2ee8d.js +4 -0
- package/dist/sankhyablocks/dom-665d6011.js +73 -0
- package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +12 -0
- package/dist/sankhyablocks/index-2b4d2d14.js +3262 -0
- package/dist/sankhyablocks/index-e5b61043.js +2384 -0
- package/dist/sankhyablocks/index.esm.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +129 -1
- package/dist/sankhyablocks/shadow-css-b18e99d7.js +387 -0
- package/dist/sankhyablocks/snk-application.entry.js +8426 -0
- package/dist/sankhyablocks/snk-crud.entry.js +61 -0
- package/dist/sankhyablocks/snk-data-unit.entry.js +272 -0
- package/dist/sankhyablocks/snk-filter-bar.entry.js +243 -0
- package/dist/sankhyablocks/snk-filter-binary-select.entry.js +43 -0
- package/dist/sankhyablocks/snk-filter-detail.entry.js +45 -0
- package/dist/sankhyablocks/snk-filter-item.entry.js +139 -0
- package/dist/sankhyablocks/snk-filter-list.entry.js +87 -0
- package/dist/sankhyablocks/snk-filter-multi-select.entry.js +19 -0
- package/dist/sankhyablocks/snk-filter-number.entry.js +20 -0
- package/dist/sankhyablocks/snk-filter-period.entry.js +22 -0
- package/dist/sankhyablocks/snk-filter-search.entry.js +40 -0
- package/dist/sankhyablocks/snk-filter-text.entry.js +18 -0
- package/dist/sankhyablocks/snk-form.entry.js +129 -0
- package/dist/sankhyablocks/snk-grid.entry.js +75 -0
- package/dist/sankhyablocks/snk-pesquisa.entry.js +311 -0
- package/dist/sankhyablocks/snk-taskbar.entry.js +156 -0
- package/dist/sankhyablocks/taskbar-elements-35d64ff9.js +90 -0
- package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +45 -0
- package/dist/sankhyablocks/teste-pesquisa.entry.js +33 -0
- package/dist/types/components/snk-application/errorhandler/snk-error-handler.d.ts +1 -0
- package/dist/types/components/snk-application/snk-application.d.ts +9 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +13 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +12 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +9 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +14 -0
- package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +40 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +45 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +3 -2
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +12 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +17 -1
- package/dist/types/components.d.ts +277 -2
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +5 -0
- package/dist/types/lib/message/resources/snk-filter-bar.msg.d.ts +2 -0
- package/package.json +2 -2
- package/react/components.d.ts +0 -7
- package/react/components.js +0 -7
- package/react/components.js.map +1 -1
- package/dist/esm/index-cf91f542.js +0 -1817
- package/dist/esm/taskbar-elements-bcccc0ff.js +0 -72
- package/dist/sankhyablocks/p-1ba29824.entry.js +0 -74
- package/dist/sankhyablocks/p-2266555e.entry.js +0 -1
- package/dist/sankhyablocks/p-23c4c94f.js +0 -2
- package/dist/sankhyablocks/p-2454be94.js +0 -1
- package/dist/sankhyablocks/p-49743bc5.js +0 -1
- package/dist/sankhyablocks/p-4fa389bd.entry.js +0 -1
- package/dist/sankhyablocks/p-5327ba05.entry.js +0 -1
- package/dist/sankhyablocks/p-7a922fb4.entry.js +0 -1
- package/dist/sankhyablocks/p-92d6f826.entry.js +0 -1
- package/dist/sankhyablocks/p-bdeef7f2.entry.js +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
class TaskbarProcessor {
|
|
4
|
+
constructor(defaultButtons) {
|
|
5
|
+
this._defaultButtons = defaultButtons;
|
|
6
|
+
}
|
|
7
|
+
process(taskbarId, taskbarManager, dataState, disabledButtons = []) {
|
|
8
|
+
var _a;
|
|
9
|
+
this.customButtons = new Map();
|
|
10
|
+
this.buttons = "";
|
|
11
|
+
this.disabledButtons = [];
|
|
12
|
+
(_a = this.getButtonsArray(taskbarId, taskbarManager, dataState)) === null || _a === void 0 ? void 0 : _a.forEach(btnDef => {
|
|
13
|
+
let buttonName;
|
|
14
|
+
if (typeof btnDef === "string") {
|
|
15
|
+
buttonName = btnDef;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
const customBtn = btnDef;
|
|
19
|
+
this.customButtons.set(customBtn.name, customBtn);
|
|
20
|
+
buttonName = customBtn.name;
|
|
21
|
+
}
|
|
22
|
+
if (!this.isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabledButtons)) {
|
|
23
|
+
this.disabledButtons.push(buttonName);
|
|
24
|
+
}
|
|
25
|
+
if (this.buttons.length > 0) {
|
|
26
|
+
this.buttons += ",";
|
|
27
|
+
}
|
|
28
|
+
this.buttons += buttonName;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
getButtonsArray(taskbarId, taskbarManager, dataState) {
|
|
32
|
+
const defaults = this._defaultButtons[taskbarId];
|
|
33
|
+
if (taskbarManager) {
|
|
34
|
+
return taskbarManager.getButtons(taskbarId, dataState, [...defaults]);
|
|
35
|
+
}
|
|
36
|
+
return defaults;
|
|
37
|
+
}
|
|
38
|
+
isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabled) {
|
|
39
|
+
const originalValue = disabled.includes(buttonName) ? false : true;
|
|
40
|
+
if (taskbarManager && taskbarManager.isEnabled) {
|
|
41
|
+
return taskbarManager.isEnabled(taskbarId, dataState, buttonName, originalValue);
|
|
42
|
+
}
|
|
43
|
+
return originalValue;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
exports.TaskbarProcessor = TaskbarProcessor;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const
|
|
5
|
+
const index = require('./index-b0b676c5.js');
|
|
6
|
+
const index$1 = require('./index-02201bc9.js');
|
|
7
7
|
|
|
8
8
|
const testePesquisaCss = ":host{display:block}";
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ const TestePesquisa = class {
|
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
13
|
}
|
|
14
14
|
componentWillLoad() {
|
|
15
|
-
this.dataUnit = new
|
|
15
|
+
this.dataUnit = new index$1.DataUnit("testes_com_formulario");
|
|
16
16
|
this.dataUnit.metadata = {
|
|
17
17
|
name: "dd://br.com.sankhya.fin.cad.movimentacaoFinanceira/Financeiro",
|
|
18
18
|
label: "Parceiro",
|
|
@@ -20,8 +20,8 @@ const TestePesquisa = class {
|
|
|
20
20
|
{
|
|
21
21
|
name: "CODPARC",
|
|
22
22
|
label: "Parceiro",
|
|
23
|
-
dataType:
|
|
24
|
-
userInterface:
|
|
23
|
+
dataType: index$1.DataType.NUMBER,
|
|
24
|
+
userInterface: index$1.UserInterface.SEARCH,
|
|
25
25
|
required: true,
|
|
26
26
|
properties: { ENTITYNAME: "Parceiro" }
|
|
27
27
|
}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
+
"./components/snk-filter-bar/filter-item/editors/snk-filter-period.js",
|
|
4
|
+
"./components/snk-filter-bar/filter-item/snk-filter-item.js",
|
|
3
5
|
"./components/snk-application/snk-application.js",
|
|
4
6
|
"./components/snk-data-unit/snk-data-unit.js",
|
|
5
7
|
"./components/snk-taskbar/snk-taskbar.js",
|
|
6
8
|
"./components/snk-crud/snk-crud.js",
|
|
9
|
+
"./components/snk-filter-bar/filter-list/snk-filter-list.js",
|
|
10
|
+
"./components/snk-filter-bar/snk-filter-bar.js",
|
|
11
|
+
"./components/snk-filter-bar/filter-item/snk-filter-detail.js",
|
|
12
|
+
"./components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js",
|
|
13
|
+
"./components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js",
|
|
14
|
+
"./components/snk-filter-bar/filter-item/editors/snk-filter-number.js",
|
|
15
|
+
"./components/snk-filter-bar/filter-item/editors/snk-filter-search.js",
|
|
16
|
+
"./components/snk-filter-bar/filter-item/editors/snk-filter-text.js",
|
|
7
17
|
"./components/snk-form/snk-form.js",
|
|
8
18
|
"./components/snk-grid/snk-grid.js",
|
|
9
19
|
"./components/snk-pesquisa/snk-pesquisa.js",
|
|
@@ -25,7 +25,14 @@ export class SnkErrorHandler {
|
|
|
25
25
|
errorHandler(evt) {
|
|
26
26
|
this.processException(evt.error);
|
|
27
27
|
}
|
|
28
|
+
buildErrorCodeHTML(exception) {
|
|
29
|
+
const onclick = 'try{window.workspace.openHelp(\'_tbcode:' + exception.errorCode + '\')} catch(e){alert(\'Não é possível abrir a ajuda fora do workspace Sankhya\');}';
|
|
30
|
+
return '<br><a href="#" onclick="' + onclick + '">Código: ' + exception.errorCode + '</a>';
|
|
31
|
+
}
|
|
28
32
|
processException(exception) {
|
|
33
|
+
if (exception.errorCode != "") {
|
|
34
|
+
exception.message += this.buildErrorCodeHTML(exception);
|
|
35
|
+
}
|
|
29
36
|
if (exception instanceof WaitingChangeException) {
|
|
30
37
|
this._app.alert(exception.title, exception.message);
|
|
31
38
|
}
|
|
@@ -17,6 +17,7 @@ import { SnkErrorHandler } from "./errorhandler/snk-error-handler";
|
|
|
17
17
|
import { agGridLicense } from '../../lib/licenses/sankhyalicense.module';
|
|
18
18
|
import { TotalsFetcher } from "../../lib/http/data-fetcher/fetchers/totals-fetcher";
|
|
19
19
|
import { SnkMessageBuilder } from "../../lib/message/SnkMessageBuilder";
|
|
20
|
+
import FilterBarConfigFetcher from "../../lib/http/data-fetcher/fetchers/filter-bar-config-fetcher";
|
|
20
21
|
/**
|
|
21
22
|
* É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
|
|
22
23
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
@@ -346,6 +347,12 @@ export class SnkApplication {
|
|
|
346
347
|
async saveGridConfig(config) {
|
|
347
348
|
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
348
349
|
}
|
|
350
|
+
/**
|
|
351
|
+
* Obtém as configurações da barra de filtros
|
|
352
|
+
*/
|
|
353
|
+
async getFilterBarConfig() {
|
|
354
|
+
return this.filterBarConfigFetcher.getConfig(this.resourceID);
|
|
355
|
+
}
|
|
349
356
|
async getAuthList(_auth) {
|
|
350
357
|
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
|
351
358
|
}
|
|
@@ -391,6 +398,12 @@ export class SnkApplication {
|
|
|
391
398
|
}
|
|
392
399
|
return this._authFetcher;
|
|
393
400
|
}
|
|
401
|
+
get filterBarConfigFetcher() {
|
|
402
|
+
if (!this._filterBarConfigFetcher) {
|
|
403
|
+
this._filterBarConfigFetcher = new FilterBarConfigFetcher();
|
|
404
|
+
}
|
|
405
|
+
return this._filterBarConfigFetcher;
|
|
406
|
+
}
|
|
394
407
|
async executeSearch(searchArgument, fieldName, dataUnit) {
|
|
395
408
|
const descriptor = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(fieldName);
|
|
396
409
|
if (!descriptor) {
|
|
@@ -427,23 +440,27 @@ export class SnkApplication {
|
|
|
427
440
|
}
|
|
428
441
|
}
|
|
429
442
|
});
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
443
|
+
return this.executePreparedSearch(mode, argument, { entity: ENTITYNAME, entityDescription: DESCRIPTIONENTITY, criteria, searchOptions });
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
async executePreparedSearch(mode, argument, options) {
|
|
447
|
+
const { entity, entityDescription, criteria, searchOptions } = options;
|
|
448
|
+
if (mode === "ADVANCED") {
|
|
449
|
+
return new Promise(accept => {
|
|
450
|
+
const pesquisaContent = document.createElement("snk-pesquisa");
|
|
451
|
+
pesquisaContent.argument = argument;
|
|
452
|
+
pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
|
|
453
|
+
pesquisaContent.selectItem = (option) => {
|
|
454
|
+
accept(option);
|
|
455
|
+
this.clearPopUpTitle();
|
|
456
|
+
this.closePopUp();
|
|
457
|
+
};
|
|
458
|
+
this.setPopUpTitle(entityDescription);
|
|
459
|
+
this.showPopUp(pesquisaContent);
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
return this.pesquisaFetcher.loadSearchOptions(entity, argument, criteria, searchOptions);
|
|
447
464
|
}
|
|
448
465
|
}
|
|
449
466
|
async isDebugMode() {
|
|
@@ -1195,6 +1212,29 @@ export class SnkApplication {
|
|
|
1195
1212
|
"tags": []
|
|
1196
1213
|
}
|
|
1197
1214
|
},
|
|
1215
|
+
"getFilterBarConfig": {
|
|
1216
|
+
"complexType": {
|
|
1217
|
+
"signature": "() => Promise<Array<SnkFilterItemConfig>>",
|
|
1218
|
+
"parameters": [],
|
|
1219
|
+
"references": {
|
|
1220
|
+
"Promise": {
|
|
1221
|
+
"location": "global"
|
|
1222
|
+
},
|
|
1223
|
+
"SnkFilterItemConfig": {
|
|
1224
|
+
"location": "import",
|
|
1225
|
+
"path": "../snk-filter-bar/filter-item/snk-filter-item"
|
|
1226
|
+
},
|
|
1227
|
+
"Array": {
|
|
1228
|
+
"location": "global"
|
|
1229
|
+
}
|
|
1230
|
+
},
|
|
1231
|
+
"return": "Promise<SnkFilterItemConfig[]>"
|
|
1232
|
+
},
|
|
1233
|
+
"docs": {
|
|
1234
|
+
"text": "Obt\u00E9m as configura\u00E7\u00F5es da barra de filtros",
|
|
1235
|
+
"tags": []
|
|
1236
|
+
}
|
|
1237
|
+
},
|
|
1198
1238
|
"executeSearch": {
|
|
1199
1239
|
"complexType": {
|
|
1200
1240
|
"signature": "(searchArgument: any, fieldName: string, dataUnit: DataUnit) => Promise<Array<Option> | Option>",
|
|
@@ -1226,6 +1266,38 @@ export class SnkApplication {
|
|
|
1226
1266
|
"SearchCriteria": {
|
|
1227
1267
|
"location": "import",
|
|
1228
1268
|
"path": "../../lib/http/data-fetcher/fetchers/pesquisa-fetcher"
|
|
1269
|
+
}
|
|
1270
|
+
},
|
|
1271
|
+
"return": "Promise<Option | Option[]>"
|
|
1272
|
+
},
|
|
1273
|
+
"docs": {
|
|
1274
|
+
"text": "",
|
|
1275
|
+
"tags": []
|
|
1276
|
+
}
|
|
1277
|
+
},
|
|
1278
|
+
"executePreparedSearch": {
|
|
1279
|
+
"complexType": {
|
|
1280
|
+
"signature": "(mode: string, argument: string, options: any) => Promise<Array<Option> | Option>",
|
|
1281
|
+
"parameters": [{
|
|
1282
|
+
"tags": [],
|
|
1283
|
+
"text": ""
|
|
1284
|
+
}, {
|
|
1285
|
+
"tags": [],
|
|
1286
|
+
"text": ""
|
|
1287
|
+
}, {
|
|
1288
|
+
"tags": [],
|
|
1289
|
+
"text": ""
|
|
1290
|
+
}],
|
|
1291
|
+
"references": {
|
|
1292
|
+
"Promise": {
|
|
1293
|
+
"location": "global"
|
|
1294
|
+
},
|
|
1295
|
+
"Option": {
|
|
1296
|
+
"location": "import",
|
|
1297
|
+
"path": "@sankhyalabs/ezui/dist/types/components/ez-combo-box/ez-combo-box"
|
|
1298
|
+
},
|
|
1299
|
+
"Array": {
|
|
1300
|
+
"location": "global"
|
|
1229
1301
|
},
|
|
1230
1302
|
"HTMLSnkPesquisaElement": {
|
|
1231
1303
|
"location": "global"
|
|
@@ -50,7 +50,7 @@ export class SnkCrud {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
render() {
|
|
53
|
-
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, h("stack-item", null, h("snk-grid", { configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }))), h("stack-item", null, h("snk-form", { configName: this.configName, actionsList: this.actionsList, onExit: () => this._viewStack.show(GRID_MODE), recordsValidator: this.recordsValidator, onActionClick: evt => this.executeAction(evt.detail) }))));
|
|
53
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, h("stack-item", null, h("snk-grid", { configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-form", { configName: this.configName, actionsList: this.actionsList, onExit: () => this._viewStack.show(GRID_MODE), recordsValidator: this.recordsValidator, taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail) }, h("slot", { name: "SnkFormTaskBar" })))));
|
|
54
54
|
}
|
|
55
55
|
static get is() { return "snk-crud"; }
|
|
56
56
|
static get encapsulation() { return "scoped"; }
|
|
@@ -78,7 +78,7 @@ export class SnkCrud {
|
|
|
78
78
|
"optional": false,
|
|
79
79
|
"docs": {
|
|
80
80
|
"tags": [],
|
|
81
|
-
"text": ""
|
|
81
|
+
"text": "Usado para salvar as configura\u00E7\u00F5es dos blocos de constru\u00E7\u00E3o."
|
|
82
82
|
},
|
|
83
83
|
"attribute": "config-name",
|
|
84
84
|
"reflect": false
|
|
@@ -103,7 +103,27 @@ export class SnkCrud {
|
|
|
103
103
|
"optional": false,
|
|
104
104
|
"docs": {
|
|
105
105
|
"tags": [],
|
|
106
|
-
"text": ""
|
|
106
|
+
"text": "A\u00E7\u00F5es a serem colocadas no bot\u00E3o \"Mais op\u00E7\u00F5es\"."
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"taskbarManager": {
|
|
110
|
+
"type": "unknown",
|
|
111
|
+
"mutable": false,
|
|
112
|
+
"complexType": {
|
|
113
|
+
"original": "TaskbarManager",
|
|
114
|
+
"resolved": "TaskbarManager",
|
|
115
|
+
"references": {
|
|
116
|
+
"TaskbarManager": {
|
|
117
|
+
"location": "import",
|
|
118
|
+
"path": "../snk-taskbar/snk-taskbar"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"required": false,
|
|
123
|
+
"optional": false,
|
|
124
|
+
"docs": {
|
|
125
|
+
"tags": [],
|
|
126
|
+
"text": "Gerenciador das barras de tarefas. \u00C9 poss\u00EDvel determinar bot\u00F5es espec\u00EDficos\nou mesmo gerenciar o estado dos bot\u00F5es."
|
|
107
127
|
}
|
|
108
128
|
},
|
|
109
129
|
"recordsValidator": {
|
|
@@ -134,5 +154,23 @@ export class SnkCrud {
|
|
|
134
154
|
"_dataState": {}
|
|
135
155
|
};
|
|
136
156
|
}
|
|
157
|
+
static get events() {
|
|
158
|
+
return [{
|
|
159
|
+
"method": "actionClick",
|
|
160
|
+
"name": "actionClick",
|
|
161
|
+
"bubbles": true,
|
|
162
|
+
"cancelable": true,
|
|
163
|
+
"composed": true,
|
|
164
|
+
"docs": {
|
|
165
|
+
"tags": [],
|
|
166
|
+
"text": "Emitido pela taskbar sempre que houver click de bot\u00E3o ou a\u00E7\u00E3o"
|
|
167
|
+
},
|
|
168
|
+
"complexType": {
|
|
169
|
+
"original": "string",
|
|
170
|
+
"resolved": "string",
|
|
171
|
+
"references": {}
|
|
172
|
+
}
|
|
173
|
+
}];
|
|
174
|
+
}
|
|
137
175
|
static get elementRef() { return "_element"; }
|
|
138
176
|
}
|
package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
|
2
|
+
import FilterItemType from '../filter-item-type.enum';
|
|
3
|
+
export class SnkFilterBinarySelect {
|
|
4
|
+
isSelected(option) {
|
|
5
|
+
return this.config.value == undefined || this.config.value === option;
|
|
6
|
+
}
|
|
7
|
+
ezChangeListener(evt) {
|
|
8
|
+
if (!evt.detail) {
|
|
9
|
+
this.assertCheckedOption(evt.target);
|
|
10
|
+
}
|
|
11
|
+
this.updateValue();
|
|
12
|
+
}
|
|
13
|
+
assertCheckedOption(updatingCheck) {
|
|
14
|
+
if (updatingCheck === this._checkOne) {
|
|
15
|
+
this._checkTwo.value = true;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this._checkOne.value = true;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
updateValue() {
|
|
22
|
+
if (!this._checkOne.value || !this._checkTwo.value) {
|
|
23
|
+
const [optOne, optTwo] = this.config.props.options;
|
|
24
|
+
this.value = this._checkOne.value ? optOne.name : optTwo.name;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
this.value = undefined;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
if (!this.config || this.config.type !== FilterItemType.BINARY_SELECT) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
const [optOne, optTwo] = this.config.props.options;
|
|
35
|
+
return (h(Host, null, h("ez-check", { label: optOne.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkOne = ref, value: this.isSelected(optOne.name) }), h("ez-check", { label: optTwo.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkTwo = ref, value: this.isSelected(optTwo.name) })));
|
|
36
|
+
}
|
|
37
|
+
static get is() { return "snk-filter-binary-select"; }
|
|
38
|
+
static get properties() {
|
|
39
|
+
return {
|
|
40
|
+
"value": {
|
|
41
|
+
"type": "any",
|
|
42
|
+
"mutable": true,
|
|
43
|
+
"complexType": {
|
|
44
|
+
"original": "any",
|
|
45
|
+
"resolved": "any",
|
|
46
|
+
"references": {}
|
|
47
|
+
},
|
|
48
|
+
"required": false,
|
|
49
|
+
"optional": false,
|
|
50
|
+
"docs": {
|
|
51
|
+
"tags": [],
|
|
52
|
+
"text": ""
|
|
53
|
+
},
|
|
54
|
+
"attribute": "value",
|
|
55
|
+
"reflect": true
|
|
56
|
+
},
|
|
57
|
+
"config": {
|
|
58
|
+
"type": "unknown",
|
|
59
|
+
"mutable": false,
|
|
60
|
+
"complexType": {
|
|
61
|
+
"original": "SnkFilterItemConfig",
|
|
62
|
+
"resolved": "SnkFilterItemConfig",
|
|
63
|
+
"references": {
|
|
64
|
+
"SnkFilterItemConfig": {
|
|
65
|
+
"location": "import",
|
|
66
|
+
"path": "../snk-filter-item"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": false,
|
|
71
|
+
"optional": false,
|
|
72
|
+
"docs": {
|
|
73
|
+
"tags": [],
|
|
74
|
+
"text": ""
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
static get listeners() {
|
|
80
|
+
return [{
|
|
81
|
+
"name": "ezChange",
|
|
82
|
+
"method": "ezChangeListener",
|
|
83
|
+
"target": undefined,
|
|
84
|
+
"capture": false,
|
|
85
|
+
"passive": false
|
|
86
|
+
}];
|
|
87
|
+
}
|
|
88
|
+
}
|
package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import FilterItemType from '../filter-item-type.enum';
|
|
3
|
+
export class SnkFilterMultiSelect {
|
|
4
|
+
ezChangeListener(evt) {
|
|
5
|
+
this.value = evt.detail.value;
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
if (!this.config || this.config.type !== FilterItemType.MULTI_SELECT) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
return (h("ez-combo-box", { label: this.config.label, value: this.config.value, options: this.config.props.options }));
|
|
12
|
+
}
|
|
13
|
+
static get is() { return "snk-filter-multi-select"; }
|
|
14
|
+
static get properties() {
|
|
15
|
+
return {
|
|
16
|
+
"value": {
|
|
17
|
+
"type": "any",
|
|
18
|
+
"mutable": true,
|
|
19
|
+
"complexType": {
|
|
20
|
+
"original": "any",
|
|
21
|
+
"resolved": "any",
|
|
22
|
+
"references": {}
|
|
23
|
+
},
|
|
24
|
+
"required": false,
|
|
25
|
+
"optional": false,
|
|
26
|
+
"docs": {
|
|
27
|
+
"tags": [],
|
|
28
|
+
"text": ""
|
|
29
|
+
},
|
|
30
|
+
"attribute": "value",
|
|
31
|
+
"reflect": true
|
|
32
|
+
},
|
|
33
|
+
"config": {
|
|
34
|
+
"type": "unknown",
|
|
35
|
+
"mutable": false,
|
|
36
|
+
"complexType": {
|
|
37
|
+
"original": "SnkFilterItemConfig",
|
|
38
|
+
"resolved": "SnkFilterItemConfig",
|
|
39
|
+
"references": {
|
|
40
|
+
"SnkFilterItemConfig": {
|
|
41
|
+
"location": "import",
|
|
42
|
+
"path": "../snk-filter-item"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"required": false,
|
|
47
|
+
"optional": false,
|
|
48
|
+
"docs": {
|
|
49
|
+
"tags": [],
|
|
50
|
+
"text": ""
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
static get listeners() {
|
|
56
|
+
return [{
|
|
57
|
+
"name": "ezChange",
|
|
58
|
+
"method": "ezChangeListener",
|
|
59
|
+
"target": undefined,
|
|
60
|
+
"capture": false,
|
|
61
|
+
"passive": false
|
|
62
|
+
}];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import FilterItemType from '../filter-item-type.enum';
|
|
3
|
+
export class SnkFilterPeriod {
|
|
4
|
+
ezChangeListener(evt) {
|
|
5
|
+
this.value = evt.detail;
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
var _a;
|
|
9
|
+
if (!this.config || this.config.type !== FilterItemType.NUMBER) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
return (h("ez-number-input", { label: this.config.label, value: this.config.value, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision }));
|
|
13
|
+
}
|
|
14
|
+
static get is() { return "snk-filter-number"; }
|
|
15
|
+
static get properties() {
|
|
16
|
+
return {
|
|
17
|
+
"config": {
|
|
18
|
+
"type": "unknown",
|
|
19
|
+
"mutable": false,
|
|
20
|
+
"complexType": {
|
|
21
|
+
"original": "SnkFilterItemConfig",
|
|
22
|
+
"resolved": "SnkFilterItemConfig",
|
|
23
|
+
"references": {
|
|
24
|
+
"SnkFilterItemConfig": {
|
|
25
|
+
"location": "import",
|
|
26
|
+
"path": "../snk-filter-item"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"required": false,
|
|
31
|
+
"optional": false,
|
|
32
|
+
"docs": {
|
|
33
|
+
"tags": [],
|
|
34
|
+
"text": ""
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"value": {
|
|
38
|
+
"type": "number",
|
|
39
|
+
"mutable": false,
|
|
40
|
+
"complexType": {
|
|
41
|
+
"original": "number",
|
|
42
|
+
"resolved": "number",
|
|
43
|
+
"references": {}
|
|
44
|
+
},
|
|
45
|
+
"required": false,
|
|
46
|
+
"optional": false,
|
|
47
|
+
"docs": {
|
|
48
|
+
"tags": [],
|
|
49
|
+
"text": ""
|
|
50
|
+
},
|
|
51
|
+
"attribute": "value",
|
|
52
|
+
"reflect": false
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
static get listeners() {
|
|
57
|
+
return [{
|
|
58
|
+
"name": "ezChange",
|
|
59
|
+
"method": "ezChangeListener",
|
|
60
|
+
"target": undefined,
|
|
61
|
+
"capture": false,
|
|
62
|
+
"passive": false
|
|
63
|
+
}];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import FilterItemType from '../filter-item-type.enum';
|
|
3
|
+
export class SnkFilterPeriod {
|
|
4
|
+
ezChangeListener() {
|
|
5
|
+
const start = this._startDate.value;
|
|
6
|
+
const end = this._endDate.value;
|
|
7
|
+
this.value = (start || end ? { start, end } : undefined);
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
if (!this.config || this.config.type !== FilterItemType.PERIOD) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
return (h("div", { class: "ez-col ez-col--nowrap" }, h("ez-date-input", { label: this.config.label, ref: ref => this._startDate = ref, value: (_a = this.config.value) === null || _a === void 0 ? void 0 : _a.start }), h("label", { class: "ez-text ez-text--medium ez-text--primary ez-margin--medium" }, "at\u00E9"), h("ez-date-input", { label: this.config.label, ref: ref => this._endDate = ref, value: (_b = this.config.value) === null || _b === void 0 ? void 0 : _b.end })));
|
|
15
|
+
}
|
|
16
|
+
static get is() { return "snk-filter-period"; }
|
|
17
|
+
static get properties() {
|
|
18
|
+
return {
|
|
19
|
+
"config": {
|
|
20
|
+
"type": "unknown",
|
|
21
|
+
"mutable": false,
|
|
22
|
+
"complexType": {
|
|
23
|
+
"original": "SnkFilterItemConfig",
|
|
24
|
+
"resolved": "SnkFilterItemConfig",
|
|
25
|
+
"references": {
|
|
26
|
+
"SnkFilterItemConfig": {
|
|
27
|
+
"location": "import",
|
|
28
|
+
"path": "../snk-filter-item"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"required": false,
|
|
33
|
+
"optional": false,
|
|
34
|
+
"docs": {
|
|
35
|
+
"tags": [],
|
|
36
|
+
"text": ""
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"value": {
|
|
40
|
+
"type": "unknown",
|
|
41
|
+
"mutable": false,
|
|
42
|
+
"complexType": {
|
|
43
|
+
"original": "Period",
|
|
44
|
+
"resolved": "Period",
|
|
45
|
+
"references": {
|
|
46
|
+
"Period": {
|
|
47
|
+
"location": "local"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"required": false,
|
|
52
|
+
"optional": false,
|
|
53
|
+
"docs": {
|
|
54
|
+
"tags": [],
|
|
55
|
+
"text": ""
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
static get listeners() {
|
|
61
|
+
return [{
|
|
62
|
+
"name": "ezChange",
|
|
63
|
+
"method": "ezChangeListener",
|
|
64
|
+
"target": undefined,
|
|
65
|
+
"capture": false,
|
|
66
|
+
"passive": false
|
|
67
|
+
}];
|
|
68
|
+
}
|
|
69
|
+
}
|