@sankhyalabs/sankhyablocks 5.17.0 → 5.18.1
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/ParamType-90b440a0.js +13 -0
- package/dist/cjs/{SnkMessageBuilder-cf80308c.js → SnkMessageBuilder-3b5b5614.js} +30 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +704 -0
- package/dist/cjs/snk-actions-form.cjs.entry.js +200 -0
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-attach.cjs.entry.js +1 -1
- package/dist/cjs/snk-client-confirm.cjs.entry.js +52 -0
- package/dist/cjs/snk-crud.cjs.entry.js +1 -1
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-bd271acd.js → snk-data-unit-e9c20097.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +4 -4
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +4 -4
- package/dist/cjs/{snk-guides-viewer-0ab3746e.js → snk-guides-viewer-c8843478.js} +2 -2
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-bar_2.cjs.entry.js +2 -2
- package/dist/cjs/snk-taskbar.cjs.entry.js +1 -1
- package/dist/cjs/{taskbar-elements-bc2598f9.js → taskbar-elements-3be287d6.js} +3 -0
- package/dist/cjs/{taskbar-processor-e1e3bbf7.js → taskbar-processor-02f0fc84.js} +1 -1
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/snk-actions-button/actions/enum/ActionsType.js +8 -0
- package/dist/collection/components/snk-actions-button/actions/enum/ParamType.js +11 -0
- package/dist/collection/components/snk-actions-button/actions/enum/RefreshType.js +7 -0
- package/dist/collection/components/snk-actions-button/actions/executor/java.executor.js +22 -0
- package/dist/collection/components/snk-actions-button/actions/executor/javascript.executor.js +20 -0
- package/dist/collection/components/snk-actions-button/actions/executor/launch-screen.executor.js +42 -0
- package/dist/collection/components/snk-actions-button/actions/executor/procedure.executor.js +26 -0
- package/dist/collection/components/snk-actions-button/actions/factory/executor.factory.js +26 -0
- package/dist/collection/components/snk-actions-button/actions/index.js +343 -0
- package/dist/collection/components/snk-actions-button/actions/interfaces/IAction.js +7 -0
- package/dist/collection/components/snk-actions-button/actions/interfaces/IExecSource.js +1 -0
- package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActions.js +1 -0
- package/dist/collection/components/snk-actions-button/actions/interfaces/IExecuteActionsProps.js +1 -0
- package/dist/collection/components/snk-actions-button/actions/interfaces/IResultParam.js +1 -0
- package/dist/collection/components/snk-actions-button/clientEvent/index.js +87 -0
- package/dist/collection/components/snk-actions-button/clientEvent/interfaces/IClientEventConfirm.js +1 -0
- package/dist/collection/components/snk-actions-button/snk-actions-button.css +38 -0
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +139 -0
- package/dist/collection/components/snk-actions-button/subcomponents/snk-actions-form.js +263 -0
- package/dist/collection/components/snk-actions-button/subcomponents/snk-client-confirm.js +134 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +1 -1
- package/dist/collection/components/snk-grid/snk-grid.js +2 -2
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +3 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
- package/dist/collection/lib/message/resources/snk-actions-button.msg.js +27 -0
- package/dist/components/ParamType.js +13 -0
- package/dist/components/SnkMessageBuilder.js +30 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +3 -0
- package/dist/components/snk-actions-button.d.ts +11 -0
- package/dist/components/snk-actions-button.js +6 -0
- package/dist/components/snk-actions-button2.js +718 -0
- package/dist/components/snk-actions-form.d.ts +11 -0
- package/dist/components/snk-actions-form.js +218 -0
- package/dist/components/snk-attach2.js +7 -1
- package/dist/components/snk-client-confirm.d.ts +11 -0
- package/dist/components/snk-client-confirm.js +71 -0
- package/dist/components/snk-crud.js +7 -1
- package/dist/components/snk-detail-view2.js +13 -2
- package/dist/components/snk-filter-binary-select.js +1 -1
- package/dist/components/snk-grid2.js +9 -3
- package/dist/components/snk-simple-crud2.js +7 -1
- package/dist/components/snk-taskbar2.js +10 -1
- package/dist/esm/ParamType-d5152b06.js +13 -0
- package/dist/esm/{SnkMessageBuilder-1a169545.js → SnkMessageBuilder-188a38bb.js} +30 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +700 -0
- package/dist/esm/snk-actions-form.entry.js +196 -0
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-attach.entry.js +1 -1
- package/dist/esm/snk-client-confirm.entry.js +48 -0
- package/dist/esm/snk-crud.entry.js +1 -1
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-476024e9.js → snk-data-unit-79b1583a.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +4 -4
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +4 -4
- package/dist/esm/{snk-guides-viewer-767f5a74.js → snk-guides-viewer-59d3a78c.js} +2 -2
- package/dist/esm/snk-guides-viewer.entry.js +3 -3
- package/dist/esm/snk-simple-bar_2.entry.js +2 -2
- package/dist/esm/snk-taskbar.entry.js +1 -1
- package/dist/esm/{taskbar-elements-e6af3e93.js → taskbar-elements-8ff33c26.js} +3 -0
- package/dist/esm/{taskbar-processor-a40798b8.js → taskbar-processor-20de6616.js} +1 -1
- package/dist/sankhyablocks/{p-3e17b147.js → p-0b40c655.js} +1 -1
- package/dist/sankhyablocks/{p-de9caf1e.entry.js → p-0b6ddb67.entry.js} +1 -1
- package/dist/sankhyablocks/p-19692f92.js +1 -0
- package/dist/sankhyablocks/{p-6df8c88b.entry.js → p-257c71a7.entry.js} +1 -1
- package/dist/sankhyablocks/{p-551165d8.js → p-28c12f65.js} +1 -1
- package/dist/sankhyablocks/{p-78de64fb.entry.js → p-2d0fc912.entry.js} +1 -1
- package/dist/sankhyablocks/p-384c4a6b.js +1 -0
- package/dist/sankhyablocks/{p-f43629f3.entry.js → p-44c2ed16.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ec1c64be.entry.js → p-8ce9ea9f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e0c04667.entry.js → p-9c7f7214.entry.js} +1 -1
- package/dist/sankhyablocks/p-9f66bc54.entry.js +1 -0
- package/dist/sankhyablocks/{p-c74fca58.js → p-b34d23fa.js} +1 -1
- package/dist/sankhyablocks/p-b680fa7a.entry.js +1 -0
- package/dist/sankhyablocks/p-b75ce8b8.entry.js +1 -0
- package/dist/sankhyablocks/{p-9e92ed74.entry.js → p-cbe93a18.entry.js} +2 -2
- package/dist/sankhyablocks/p-eaad0aa8.js +1 -0
- package/dist/sankhyablocks/{p-7956b9dd.entry.js → p-eb07d0eb.entry.js} +1 -1
- package/dist/sankhyablocks/p-f27dc5e9.entry.js +1 -0
- package/dist/sankhyablocks/p-fa2d0376.entry.js +1 -0
- package/dist/sankhyablocks/p-ff398057.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/actions/enum/ActionsType.d.ts +7 -0
- package/dist/types/components/snk-actions-button/actions/enum/ParamType.d.ts +10 -0
- package/dist/types/components/snk-actions-button/actions/enum/RefreshType.d.ts +6 -0
- package/dist/types/components/snk-actions-button/actions/executor/java.executor.d.ts +6 -0
- package/dist/types/components/snk-actions-button/actions/executor/javascript.executor.d.ts +6 -0
- package/dist/types/components/snk-actions-button/actions/executor/launch-screen.executor.d.ts +10 -0
- package/dist/types/components/snk-actions-button/actions/executor/procedure.executor.d.ts +6 -0
- package/dist/types/components/snk-actions-button/actions/factory/executor.factory.d.ts +7 -0
- package/dist/types/components/snk-actions-button/actions/index.d.ts +27 -0
- package/dist/types/components/snk-actions-button/actions/interfaces/IAction.d.ts +55 -0
- package/dist/types/components/snk-actions-button/actions/interfaces/IExecSource.d.ts +17 -0
- package/dist/types/components/snk-actions-button/actions/interfaces/IExecuteActions.d.ts +4 -0
- package/dist/types/components/snk-actions-button/actions/interfaces/IExecuteActionsProps.d.ts +4 -0
- package/dist/types/components/snk-actions-button/actions/interfaces/IResultParam.d.ts +14 -0
- package/dist/types/components/snk-actions-button/clientEvent/index.d.ts +4 -0
- package/dist/types/components/snk-actions-button/clientEvent/interfaces/IClientEventConfirm.d.ts +35 -0
- package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +27 -0
- package/dist/types/components/snk-actions-button/subcomponents/snk-actions-form.d.ts +41 -0
- package/dist/types/components/snk-actions-button/subcomponents/snk-client-confirm.d.ts +31 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +2 -1
- package/dist/types/components.d.ts +96 -0
- package/dist/types/lib/message/resources/snk-actions-button.msg.d.ts +1 -0
- package/package.json +1 -1
- package/react/components.d.ts +3 -0
- package/react/components.js +3 -0
- package/react/components.js.map +1 -1
- package/dist/sankhyablocks/p-1c5d5e5c.entry.js +0 -1
- package/dist/sankhyablocks/p-39082fc3.js +0 -1
- package/dist/sankhyablocks/p-8d40909d.entry.js +0 -1
- package/dist/sankhyablocks/p-9cbc3925.entry.js +0 -1
- package/dist/sankhyablocks/p-d410f45a.js +0 -1
@@ -0,0 +1,200 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index = require('./index-21bd01e1.js');
|
6
|
+
const core = require('@sankhyalabs/core');
|
7
|
+
const ParamType = require('./ParamType-90b440a0.js');
|
8
|
+
|
9
|
+
const SnkActionsForm = class {
|
10
|
+
constructor(hostRef) {
|
11
|
+
index.registerInstance(this, hostRef);
|
12
|
+
this.APPLY = 'OK';
|
13
|
+
this.CANCEL = 'CANCEL';
|
14
|
+
this.CLOSE = 'CLOSE';
|
15
|
+
this.action = undefined;
|
16
|
+
this.applyParameters = undefined;
|
17
|
+
this.dataUnit = new core.DataUnit();
|
18
|
+
}
|
19
|
+
/**
|
20
|
+
* Responsável por abrir a popup.
|
21
|
+
*/
|
22
|
+
async openPopup() {
|
23
|
+
this._ezPopup.opened = true;
|
24
|
+
}
|
25
|
+
;
|
26
|
+
exitPopup() {
|
27
|
+
this._ezPopup.opened = false;
|
28
|
+
}
|
29
|
+
async handleApply() {
|
30
|
+
try {
|
31
|
+
await this._ezForm.validate();
|
32
|
+
let row = this.dataUnit.getSelectedRecord();
|
33
|
+
if (row) {
|
34
|
+
this._params.forEach((param, index) => {
|
35
|
+
if (row.hasOwnProperty(param.name)) {
|
36
|
+
if (param.paramType == ParamType.ParamType.ENTITY) {
|
37
|
+
let searchValue = row[param.name];
|
38
|
+
if (!searchValue) {
|
39
|
+
param.value = null;
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
param.value = typeof searchValue === 'object' ? searchValue.value : searchValue;
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
this._params[index].value = row[param.name];
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
this._params[index].value = undefined;
|
49
|
+
}
|
50
|
+
});
|
51
|
+
this.action.actionConfig.params.promptParam = this._params;
|
52
|
+
}
|
53
|
+
this.exitPopup();
|
54
|
+
this.applyParameters(this.action);
|
55
|
+
}
|
56
|
+
catch (e) {
|
57
|
+
// exceção ignorada, quando o validate() falha.
|
58
|
+
}
|
59
|
+
}
|
60
|
+
searchLoader(evt, param) {
|
61
|
+
const options = {
|
62
|
+
entity: param.entityName,
|
63
|
+
entityDescription: param.label
|
64
|
+
};
|
65
|
+
return this._application.executePreparedSearch(evt.mode, evt.argument, options);
|
66
|
+
}
|
67
|
+
;
|
68
|
+
getUserInterface(paramType) {
|
69
|
+
switch (paramType) {
|
70
|
+
case ParamType.ParamType.TEXT:
|
71
|
+
return core.UserInterface.SHORTTEXT;
|
72
|
+
case ParamType.ParamType.INTEGER:
|
73
|
+
return core.UserInterface.INTEGERNUMBER;
|
74
|
+
case ParamType.ParamType.DECIMAL:
|
75
|
+
return core.UserInterface.DECIMALNUMBER;
|
76
|
+
case ParamType.ParamType.DATE:
|
77
|
+
return core.UserInterface.DATE;
|
78
|
+
case ParamType.ParamType.DATETIME:
|
79
|
+
return core.UserInterface.DATETIME;
|
80
|
+
case ParamType.ParamType.BOOLEAN:
|
81
|
+
return core.UserInterface.CHECKBOX;
|
82
|
+
case ParamType.ParamType.ENTITY:
|
83
|
+
return core.UserInterface.SEARCH;
|
84
|
+
case ParamType.ParamType.OPTIONS:
|
85
|
+
return core.UserInterface.OPTIONSELECTOR;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
getDataType(paramType) {
|
89
|
+
switch (paramType) {
|
90
|
+
case ParamType.ParamType.TEXT:
|
91
|
+
case ParamType.ParamType.OPTIONS:
|
92
|
+
return core.DataType.TEXT;
|
93
|
+
case ParamType.ParamType.INTEGER:
|
94
|
+
case ParamType.ParamType.DECIMAL:
|
95
|
+
return core.DataType.NUMBER;
|
96
|
+
case ParamType.ParamType.DATE:
|
97
|
+
case ParamType.ParamType.DATETIME:
|
98
|
+
return core.DataType.DATE;
|
99
|
+
case ParamType.ParamType.BOOLEAN:
|
100
|
+
return core.DataType.BOOLEAN;
|
101
|
+
case ParamType.ParamType.ENTITY:
|
102
|
+
return core.DataType.OBJECT;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
getProps(param) {
|
106
|
+
switch (param.paramType) {
|
107
|
+
case ParamType.ParamType.DECIMAL:
|
108
|
+
return param.precision ? { precision: Number(param.precision) } : undefined;
|
109
|
+
case ParamType.ParamType.ENTITY:
|
110
|
+
return { ENTITYNAME: param.entityName };
|
111
|
+
case ParamType.ParamType.OPTIONS:
|
112
|
+
return { options: this.prepareOptions(param.options) };
|
113
|
+
default:
|
114
|
+
return undefined;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
buildFields() {
|
118
|
+
let fields = [];
|
119
|
+
this._params.forEach((param, index) => {
|
120
|
+
const hasName = !!param.name;
|
121
|
+
let paramName = hasName ? param.name : `param_${index}`;
|
122
|
+
fields.push({
|
123
|
+
name: paramName,
|
124
|
+
label: param.label,
|
125
|
+
dataType: this.getDataType(param.paramType),
|
126
|
+
userInterface: this.getUserInterface(param.paramType),
|
127
|
+
readOnly: false,
|
128
|
+
required: param.paramType == 'B' ? false : param.required === "true",
|
129
|
+
properties: this.getProps(param)
|
130
|
+
});
|
131
|
+
this._params[index].name = paramName;
|
132
|
+
this._params[index].isGeneratedName = !hasName;
|
133
|
+
});
|
134
|
+
const metadata = {
|
135
|
+
name: 'params',
|
136
|
+
label: 'params',
|
137
|
+
fields: fields
|
138
|
+
};
|
139
|
+
this._metadata = metadata;
|
140
|
+
}
|
141
|
+
fillFields() {
|
142
|
+
this._params.forEach((param) => {
|
143
|
+
if (param.saveLast == 'true') {
|
144
|
+
this.dataUnit.setFieldValue(param.name, param.value);
|
145
|
+
}
|
146
|
+
});
|
147
|
+
}
|
148
|
+
prepareOptions(options) {
|
149
|
+
const optionsArray = options.split(";");
|
150
|
+
let optionsList = optionsArray.map(function (opc, index) {
|
151
|
+
let value;
|
152
|
+
let label;
|
153
|
+
if (opc.indexOf('=') > -1) {
|
154
|
+
let opcArr = opc.split('=');
|
155
|
+
value = opcArr[0];
|
156
|
+
label = opcArr[1];
|
157
|
+
}
|
158
|
+
else {
|
159
|
+
value = (index + 1).toString();
|
160
|
+
label = opc;
|
161
|
+
}
|
162
|
+
return {
|
163
|
+
value: value,
|
164
|
+
label: label
|
165
|
+
};
|
166
|
+
});
|
167
|
+
return optionsList;
|
168
|
+
}
|
169
|
+
componentWillLoad() {
|
170
|
+
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
171
|
+
this._params = [...this.action.actionConfig.params.promptParam];
|
172
|
+
this.dataUnit.metadataLoader = this.metadataLoader.bind(this);
|
173
|
+
this.dataUnit.loadMetadata().then(() => {
|
174
|
+
this.fillFields();
|
175
|
+
});
|
176
|
+
this.dataUnit.addRecord();
|
177
|
+
}
|
178
|
+
async metadataLoader() {
|
179
|
+
return new Promise((resolve) => {
|
180
|
+
this.buildFields();
|
181
|
+
resolve(this._metadata);
|
182
|
+
});
|
183
|
+
}
|
184
|
+
handleModalAction(evt) {
|
185
|
+
switch (evt) {
|
186
|
+
case this.APPLY:
|
187
|
+
this.handleApply();
|
188
|
+
break;
|
189
|
+
case this.CANCEL:
|
190
|
+
case this.CLOSE:
|
191
|
+
this.exitPopup();
|
192
|
+
break;
|
193
|
+
}
|
194
|
+
}
|
195
|
+
render() {
|
196
|
+
return (index.h("ez-popup", { size: "medium", heightMode: "auto", useHeader: false, ref: (ref) => this._ezPopup = ref }, index.h("ez-modal-container", { modalTitle: this._application.messagesBuilder.getMessage("snkActionsButton.form.fillParams", undefined), okButtonLabel: this._application.messagesBuilder.getMessage("snkActionsButton.buttons.apply", undefined), cancelButtonLabel: this._application.messagesBuilder.getMessage("snkActionsButton.buttons.cancel", undefined), onEzModalAction: (evt) => this.handleModalAction(evt.detail) }, index.h("div", { class: "ez-margin-vertical--medium" }, index.h("ez-form", { ref: (ref) => this._ezForm = ref, dataUnit: this.dataUnit })))));
|
197
|
+
}
|
198
|
+
};
|
199
|
+
|
200
|
+
exports.snk_actions_form = SnkActionsForm;
|
@@ -10,7 +10,7 @@ const pesquisaFetcher = require('./pesquisa-fetcher-954b74c3.js');
|
|
10
10
|
const ConfigStorage = require('./ConfigStorage-f68c3607.js');
|
11
11
|
const dataunitFetcher = require('./dataunit-fetcher-8f5ade55.js');
|
12
12
|
const resourceFetcher = require('./resource-fetcher-2979b54b.js');
|
13
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
13
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-3b5b5614.js');
|
14
14
|
require('./_commonjsHelpers-537d719a.js');
|
15
15
|
require('./form-config-fetcher-92bc8fe7.js');
|
16
16
|
require('./filter-bar-config-fetcher-a14536bf.js');
|
@@ -7,7 +7,7 @@ const core = require('@sankhyalabs/core');
|
|
7
7
|
const DataFetcher = require('./DataFetcher-a9d0228f.js');
|
8
8
|
const constants = require('./constants-3787fa32.js');
|
9
9
|
const dataunitFetcher = require('./dataunit-fetcher-8f5ade55.js');
|
10
|
-
const taskbarElements = require('./taskbar-elements-
|
10
|
+
const taskbarElements = require('./taskbar-elements-3be287d6.js');
|
11
11
|
require('./_commonjsHelpers-537d719a.js');
|
12
12
|
require('./index-f400b1d6.js');
|
13
13
|
require('./index-de79181a.js');
|
@@ -0,0 +1,52 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index = require('./index-21bd01e1.js');
|
6
|
+
const core = require('@sankhyalabs/core');
|
7
|
+
|
8
|
+
const SnkActionsForm = class {
|
9
|
+
constructor(hostRef) {
|
10
|
+
index.registerInstance(this, hostRef);
|
11
|
+
this.APLICAR = 'OK';
|
12
|
+
this.CANCELAR = 'CANCEL';
|
13
|
+
this.FECHAR = 'CLOSE';
|
14
|
+
this.titleMessage = undefined;
|
15
|
+
this.message = undefined;
|
16
|
+
this.accept = undefined;
|
17
|
+
this.cancel = undefined;
|
18
|
+
}
|
19
|
+
/**
|
20
|
+
* Responsável por abrir a popup.
|
21
|
+
*/
|
22
|
+
async openPopup() {
|
23
|
+
this._ezPopup.opened = true;
|
24
|
+
}
|
25
|
+
;
|
26
|
+
exitPopup() {
|
27
|
+
this._ezPopup.opened = false;
|
28
|
+
}
|
29
|
+
handleModalAction(evt) {
|
30
|
+
switch (evt) {
|
31
|
+
case this.APLICAR:
|
32
|
+
this.exitPopup();
|
33
|
+
this.accept();
|
34
|
+
break;
|
35
|
+
case this.CANCELAR:
|
36
|
+
this.exitPopup();
|
37
|
+
this.cancel();
|
38
|
+
break;
|
39
|
+
case this.FECHAR:
|
40
|
+
this.exitPopup();
|
41
|
+
break;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
componentWillLoad() {
|
45
|
+
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
46
|
+
}
|
47
|
+
render() {
|
48
|
+
return (index.h("ez-popup", { size: "small", heightMode: "auto", useHeader: false, ref: (ref) => this._ezPopup = ref }, index.h("ez-modal-container", { modalTitle: this.titleMessage, okButtonLabel: this._application.messagesBuilder.getMessage("snkActionsButton.buttons.yes", undefined), cancelButtonLabel: this._application.messagesBuilder.getMessage("snkActionsButton.buttons.no", undefined), onEzModalAction: (evt) => this.handleModalAction(evt.detail) }, index.h("div", { class: "ez-margin-bottom--large ez-flex ez-flex--column" }, index.h("label", { class: "ez-text ez-text--large ez-text--primary" }, this.message), index.h("label", { class: "ez-text ez-text--large ez-text--primary" }, index.h("br", null), this._application.messagesBuilder.getMessage("snkActionsButton.clientEvent.cancelMessage", undefined))))));
|
49
|
+
}
|
50
|
+
};
|
51
|
+
|
52
|
+
exports.snk_client_confirm = SnkActionsForm;
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const taskbarElements = require('./taskbar-elements-
|
7
|
+
const taskbarElements = require('./taskbar-elements-3be287d6.js');
|
8
8
|
require('./DataFetcher-a9d0228f.js');
|
9
9
|
require('./pesquisa-fetcher-954b74c3.js');
|
10
10
|
const index$1 = require('./index-f400b1d6.js');
|
@@ -8,9 +8,9 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
8
|
const index = require('./index-f400b1d6.js');
|
9
9
|
const constants = require('./constants-3787fa32.js');
|
10
10
|
const DataFetcher = require('./DataFetcher-a9d0228f.js');
|
11
|
-
const snkDataUnit = require('./snk-data-unit-
|
11
|
+
const snkDataUnit = require('./snk-data-unit-e9c20097.js');
|
12
12
|
require('./_commonjsHelpers-537d719a.js');
|
13
|
-
require('./SnkMessageBuilder-
|
13
|
+
require('./SnkMessageBuilder-3b5b5614.js');
|
14
14
|
|
15
15
|
class ItemBuilder {
|
16
16
|
constructor(getMessage, selectedNumber) {
|
@@ -3,7 +3,7 @@
|
|
3
3
|
const index = require('./index-21bd01e1.js');
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
5
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
6
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
6
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-3b5b5614.js');
|
7
7
|
|
8
8
|
const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
9
9
|
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkDataUnit = require('./snk-data-unit-
|
5
|
+
const snkDataUnit = require('./snk-data-unit-e9c20097.js');
|
6
6
|
require('./index-21bd01e1.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
8
|
require('@sankhyalabs/ezui/dist/collection/utils');
|
9
|
-
require('./SnkMessageBuilder-
|
9
|
+
require('./SnkMessageBuilder-3b5b5614.js');
|
10
10
|
|
11
11
|
|
12
12
|
|
@@ -9,10 +9,10 @@ require('./DataFetcher-a9d0228f.js');
|
|
9
9
|
require('./pesquisa-fetcher-954b74c3.js');
|
10
10
|
require('@sankhyalabs/core');
|
11
11
|
const index$1 = require('./index-f400b1d6.js');
|
12
|
-
const taskbarElements = require('./taskbar-elements-
|
12
|
+
const taskbarElements = require('./taskbar-elements-3be287d6.js');
|
13
13
|
const constants = require('./constants-3787fa32.js');
|
14
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
15
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
14
|
+
const snkGuidesViewer = require('./snk-guides-viewer-c8843478.js');
|
15
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-3b5b5614.js');
|
16
16
|
require('./ConfigStorage-f68c3607.js');
|
17
17
|
require('./form-config-fetcher-92bc8fe7.js');
|
18
18
|
require('./resource-fetcher-2979b54b.js');
|
@@ -20,7 +20,7 @@ require('./filter-bar-config-fetcher-a14536bf.js');
|
|
20
20
|
require('./filter-item-type.enum-aa823a00.js');
|
21
21
|
require('./_commonjsHelpers-537d719a.js');
|
22
22
|
require('./index-de79181a.js');
|
23
|
-
require('./taskbar-processor-
|
23
|
+
require('./taskbar-processor-02f0fc84.js');
|
24
24
|
|
25
25
|
class GuideBuilder {
|
26
26
|
constructor(parentGuide, formMetadata, dataUnit) {
|
@@ -66,7 +66,7 @@ const SnkFilterBinarySelect = class {
|
|
66
66
|
}
|
67
67
|
const [optOne, optTwo] = this.config.props.options;
|
68
68
|
if (this.presentationMode === presentationMode.EPresentationMode.MODAL) {
|
69
|
-
return (index.h(index.Host, null, index.h("div", { class: "ez-
|
69
|
+
return (index.h(index.Host, null, index.h("div", { class: "ez-row ez-size-height--full" }, index.h("label", { class: "ez-text ez-title--small ez-title--primary ez-size-height--full ez-flex ez-flex--row ez-flex--align-items-center ez-col ez-col--sd-4" }, this.config.detailModal), index.h("div", { class: "ez-col ez-col--sd-4" }, index.h("ez-check", { ref: (ref) => this._checkOne = ref, id: `${this.config.id}_${optOne.name || "option1"}`, class: "sc-snk-filter-bar editor__ez-check", label: optOne.label, value: this.isSelected(optOne.name), compact: true })), index.h("div", { class: "ez-col ez-col--sd-4" }, index.h("ez-check", { ref: (ref) => this._checkTwo = ref, id: `${this.config.id}_${optTwo.name || "option2"}`, class: "sc-snk-filter-bar editor__ez-check", label: optTwo.label, value: this.isSelected(optTwo.name), compact: true })))));
|
70
70
|
}
|
71
71
|
return (index.h(index.Host, null, index.h("ez-radio-button", { value: this._radioButtonValue }, index.h("ez-radio-button-option", { id: `${this.config.id}_${optOne.name || "option1"}`, class: "sc-snk-filter-bar editor__ez-check", label: optOne.label, value: optOne.name }), index.h("ez-radio-button-option", { id: `${this.config.id}_${optTwo.name || "option2"}`, class: "sc-snk-filter-bar editor__ez-check", label: optTwo.label, value: optTwo.name }), index.h("ez-radio-button-option", { id: `${this.config.id}_option3`, class: "sc-snk-filter-bar editor__ez-check", label: `${optOne.label} + ${optTwo.label}`, value: this._noOptionValue }))));
|
72
72
|
}
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
8
|
+
const taskbarElements = require('./taskbar-elements-3be287d6.js');
|
9
9
|
const ConfigStorage = require('./ConfigStorage-f68c3607.js');
|
10
10
|
const index$1 = require('./index-f400b1d6.js');
|
11
|
-
const taskbarProcessor = require('./taskbar-processor-
|
11
|
+
const taskbarProcessor = require('./taskbar-processor-02f0fc84.js');
|
12
12
|
const index$2 = require('./index-de79181a.js');
|
13
13
|
require('./form-config-fetcher-92bc8fe7.js');
|
14
14
|
require('./DataFetcher-a9d0228f.js');
|
@@ -31,8 +31,8 @@ const SnkGrid = class {
|
|
31
31
|
"snkGridTopTaskbar.finish_edition.secondary": []
|
32
32
|
});
|
33
33
|
this._headerTaskbarProcessor = new taskbarProcessor.TaskbarProcessor({
|
34
|
-
"snkGridHeaderTaskbar.unselected": ["REFRESH", "DATA_EXPORTER"],
|
35
|
-
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "ATTACH", "REFRESH", "DATA_EXPORTER"],
|
34
|
+
"snkGridHeaderTaskbar.unselected": ["REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON"],
|
35
|
+
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "ATTACH", "REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON"],
|
36
36
|
"snkGridHeaderTaskbar.detail.unselected": ["REFRESH"],
|
37
37
|
"snkGridHeaderTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
|
38
38
|
});
|
@@ -4,8 +4,8 @@ const index = require('./index-21bd01e1.js');
|
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
5
|
const SnkFormConfigManager = require('./SnkFormConfigManager-69df3f74.js');
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
7
|
-
const taskbarProcessor = require('./taskbar-processor-
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
7
|
+
const taskbarProcessor = require('./taskbar-processor-02f0fc84.js');
|
8
|
+
const taskbarElements = require('./taskbar-elements-3be287d6.js');
|
9
9
|
const constants = require('./constants-3787fa32.js');
|
10
10
|
require('./DataFetcher-a9d0228f.js');
|
11
11
|
require('./pesquisa-fetcher-954b74c3.js');
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-c8843478.js');
|
6
6
|
require('./index-21bd01e1.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
8
|
require('./SnkFormConfigManager-69df3f74.js');
|
@@ -14,8 +14,8 @@ require('./resource-fetcher-2979b54b.js');
|
|
14
14
|
require('./filter-bar-config-fetcher-a14536bf.js');
|
15
15
|
require('./filter-item-type.enum-aa823a00.js');
|
16
16
|
require('@sankhyalabs/ezui/dist/collection/utils/form');
|
17
|
-
require('./taskbar-processor-
|
18
|
-
require('./taskbar-elements-
|
17
|
+
require('./taskbar-processor-02f0fc84.js');
|
18
|
+
require('./taskbar-elements-3be287d6.js');
|
19
19
|
require('./index-f400b1d6.js');
|
20
20
|
require('./index-de79181a.js');
|
21
21
|
require('./constants-3787fa32.js');
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const constants = require('./constants-3787fa32.js');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
8
|
+
const taskbarElements = require('./taskbar-elements-3be287d6.js');
|
9
9
|
require('./DataFetcher-a9d0228f.js');
|
10
10
|
require('./pesquisa-fetcher-954b74c3.js');
|
11
11
|
const index$1 = require('./index-f400b1d6.js');
|
12
|
-
const taskbarProcessor = require('./taskbar-processor-
|
12
|
+
const taskbarProcessor = require('./taskbar-processor-02f0fc84.js');
|
13
13
|
require('./index-de79181a.js');
|
14
14
|
require('./_commonjsHelpers-537d719a.js');
|
15
15
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
8
|
+
const taskbarElements = require('./taskbar-elements-3be287d6.js');
|
9
9
|
const index$1 = require('./index-f400b1d6.js');
|
10
10
|
require('./index-de79181a.js');
|
11
11
|
|
@@ -22,6 +22,7 @@ exports.TaskbarElement = void 0;
|
|
22
22
|
TaskbarElement["CONFIGURATOR"] = "CONFIGURATOR";
|
23
23
|
TaskbarElement["DATA_EXPORTER"] = "DATA_EXPORTER";
|
24
24
|
TaskbarElement["ATTACH"] = "ATTACH";
|
25
|
+
TaskbarElement["ACTIONS_BUTTON"] = "ACTIONS_BUTTON";
|
25
26
|
})(exports.TaskbarElement || (exports.TaskbarElement = {}));
|
26
27
|
exports.AuthorizationElements = void 0;
|
27
28
|
(function (AuthorizationElements) {
|
@@ -96,6 +97,8 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
|
|
96
97
|
return index.h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId });
|
97
98
|
case exports.TaskbarElement.ATTACH:
|
98
99
|
return iconButton("anexo", element, className, dataElementId, title, action, isEnabled);
|
100
|
+
case exports.TaskbarElement.ACTIONS_BUTTON:
|
101
|
+
return index.h("snk-actions-button", { "data-element-id": dataElementId });
|
99
102
|
}
|
100
103
|
};
|
101
104
|
function textButton(name, className, dataElementId, text, title, action, isEnabled) {
|
@@ -6,6 +6,9 @@
|
|
6
6
|
"./components/snk-taskbar/snk-taskbar.js",
|
7
7
|
"./components/snk-filter-bar/filter-list/snk-filter-list.js",
|
8
8
|
"./components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js",
|
9
|
+
"./components/snk-actions-button/snk-actions-button.js",
|
10
|
+
"./components/snk-actions-button/subcomponents/snk-actions-form.js",
|
11
|
+
"./components/snk-actions-button/subcomponents/snk-client-confirm.js",
|
9
12
|
"./components/snk-attach/snk-attach.js",
|
10
13
|
"./components/snk-configurator/snk-configurator.js",
|
11
14
|
"./components/snk-crud/snk-crud.js",
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export var ActionsType;
|
2
|
+
(function (ActionsType) {
|
3
|
+
ActionsType["LAUNCH_SCREEN"] = "LC";
|
4
|
+
ActionsType["JAVASCRIPT"] = "SC";
|
5
|
+
ActionsType["JAVA"] = "RJ";
|
6
|
+
ActionsType["PROCEDURE"] = "SP";
|
7
|
+
ActionsType["EMBEDDED"] = "EB";
|
8
|
+
})(ActionsType || (ActionsType = {}));
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export var ParamType;
|
2
|
+
(function (ParamType) {
|
3
|
+
ParamType["TEXT"] = "S";
|
4
|
+
ParamType["INTEGER"] = "I";
|
5
|
+
ParamType["DECIMAL"] = "D";
|
6
|
+
ParamType["DATE"] = "DT";
|
7
|
+
ParamType["DATETIME"] = "DH";
|
8
|
+
ParamType["BOOLEAN"] = "B";
|
9
|
+
ParamType["ENTITY"] = "ENTITY";
|
10
|
+
ParamType["OPTIONS"] = "SO";
|
11
|
+
})(ParamType || (ParamType = {}));
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { DataFetcher } from "../../../../lib/http/data-fetcher/DataFetcher";
|
2
|
+
const SERVICE_ACTION_EXECUTE_JAVA = 'ActionButtonsSP.executeJava';
|
3
|
+
export default class JavaExecutor {
|
4
|
+
execute(action) {
|
5
|
+
var _a;
|
6
|
+
const execSource = {
|
7
|
+
actionID: action.actionID,
|
8
|
+
refreshType: (_a = action.actionConfig.javaCall) === null || _a === void 0 ? void 0 : _a.refreshType
|
9
|
+
};
|
10
|
+
return new Promise((resolve) => {
|
11
|
+
resolve({ execSource, callback: this.callExecJava });
|
12
|
+
});
|
13
|
+
}
|
14
|
+
callExecJava(execSource) {
|
15
|
+
const request = {
|
16
|
+
requestBody: {
|
17
|
+
javaCall: execSource
|
18
|
+
}
|
19
|
+
};
|
20
|
+
DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_JAVA, JSON.stringify(request));
|
21
|
+
}
|
22
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { DataFetcher } from "../../../../lib/http/data-fetcher/DataFetcher";
|
2
|
+
const SERVICE_ACTION_EXECUTE_SCRIPT = 'ActionButtonsSP.executeScript';
|
3
|
+
export default class JavascriptExecutor {
|
4
|
+
execute(action) {
|
5
|
+
var _a;
|
6
|
+
const execSource = {
|
7
|
+
actionID: action.actionID,
|
8
|
+
refreshType: (_a = action.actionConfig.runScript) === null || _a === void 0 ? void 0 : _a.refreshType
|
9
|
+
};
|
10
|
+
return new Promise((resolve) => {
|
11
|
+
resolve({ execSource, callback: this.callExecScript });
|
12
|
+
});
|
13
|
+
}
|
14
|
+
callExecScript(execSource) {
|
15
|
+
const request = {
|
16
|
+
runScript: execSource
|
17
|
+
};
|
18
|
+
DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_SCRIPT, request);
|
19
|
+
}
|
20
|
+
}
|
package/dist/collection/components/snk-actions-button/actions/executor/launch-screen.executor.js
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
import { ApplicationContext, ErrorException, StringUtils } from "@sankhyalabs/core";
|
2
|
+
export default class LaunchScreenExecutor {
|
3
|
+
constructor() {
|
4
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
5
|
+
}
|
6
|
+
async execute(action, dataUnit) {
|
7
|
+
const resourceID = action.resourceID;
|
8
|
+
if (!resourceID)
|
9
|
+
return;
|
10
|
+
let launchObject = await this.buildLaunchObject(action, dataUnit);
|
11
|
+
this._application.openApp(resourceID, launchObject);
|
12
|
+
return null;
|
13
|
+
}
|
14
|
+
buildLaunchObject(action, dataUnit) {
|
15
|
+
return new Promise((resolve) => {
|
16
|
+
let params = action.actionConfig.params.param;
|
17
|
+
if (params && params.length > 0) {
|
18
|
+
let launchObject = {};
|
19
|
+
let processedParams = [];
|
20
|
+
params.forEach(param => {
|
21
|
+
const localField = param.localField;
|
22
|
+
let value = dataUnit.getFieldValue(localField);
|
23
|
+
if (!value) {
|
24
|
+
let localFieldLabel = dataUnit.getField(localField).label;
|
25
|
+
localFieldLabel = StringUtils.isEmpty(dataUnit.getField(localField).label) ? localField : localFieldLabel;
|
26
|
+
throw new ErrorException(this._application.messagesBuilder.getMessage("snkActionsButton.title.error", undefined), this._application.messagesBuilder.getMessage("snkActionsButton.launchScreen.emptyField", { description: action.description, localFieldLabel: localFieldLabel }));
|
27
|
+
}
|
28
|
+
value = StringUtils.isEmpty(value.toString()) ? undefined : value.toString();
|
29
|
+
launchObject[param.targetField] = value;
|
30
|
+
processedParams.push({
|
31
|
+
fieldName: param.targetField,
|
32
|
+
value: value
|
33
|
+
});
|
34
|
+
});
|
35
|
+
launchObject.ACTION_PARAMETERS = processedParams;
|
36
|
+
launchObject.call_time = Date.now();
|
37
|
+
resolve(launchObject);
|
38
|
+
}
|
39
|
+
resolve(null);
|
40
|
+
});
|
41
|
+
}
|
42
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { DataFetcher } from "../../../../lib/http/data-fetcher/DataFetcher";
|
2
|
+
const SERVICE_ACTION_EXECUTE_STP = 'ActionButtonsSP.executeSTP';
|
3
|
+
export default class ProcedureExecutor {
|
4
|
+
execute(action) {
|
5
|
+
var _a, _b, _c;
|
6
|
+
const procName = (_a = action.actionConfig.dbCall) === null || _a === void 0 ? void 0 : _a.name;
|
7
|
+
const rootEntity = (_b = action.actionConfig.dbCall) === null || _b === void 0 ? void 0 : _b.rootEntity;
|
8
|
+
const execSource = {
|
9
|
+
actionID: action.actionID,
|
10
|
+
refreshType: (_c = action.actionConfig.dbCall) === null || _c === void 0 ? void 0 : _c.refreshType,
|
11
|
+
procName: procName,
|
12
|
+
rootEntity: rootEntity
|
13
|
+
};
|
14
|
+
return new Promise((resolve) => {
|
15
|
+
resolve({ execSource, callback: this.callExecProcedure });
|
16
|
+
});
|
17
|
+
}
|
18
|
+
callExecProcedure(execSource) {
|
19
|
+
const request = {
|
20
|
+
requestBody: {
|
21
|
+
stpCall: execSource
|
22
|
+
}
|
23
|
+
};
|
24
|
+
DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_STP, JSON.stringify(request));
|
25
|
+
}
|
26
|
+
}
|