@sankhyalabs/sankhyablocks 2.0.0 → 2.0.2
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-6c2f7bcd.js → SnkMessageBuilder-89482d28.js} +8 -4
- package/dist/cjs/snk-application.cjs.entry.js +13 -2
- package/dist/cjs/snk-config-options.cjs.entry.js +5 -1
- package/dist/cjs/snk-configurator_6.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +8 -2
- package/dist/cjs/snk-form-config.cjs.entry.js +4 -4
- package/dist/cjs/snk-pesquisa.cjs.entry.js +2 -2
- package/dist/cjs/{taskbar-elements-9a4b1e19.js → taskbar-elements-90350a55.js} +2 -2
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +7 -1
- package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.js +6 -2
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +4 -4
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +2 -2
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +12 -1
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +5 -1
- package/dist/collection/lib/message/resources/snk-form.msg.js +3 -3
- package/dist/components/SnkMessageBuilder.js +8 -4
- package/dist/components/snk-application2.js +12 -1
- package/dist/components/snk-config-options2.js +6 -2
- package/dist/components/snk-data-unit.js +7 -1
- package/dist/components/snk-form-config2.js +4 -4
- package/dist/components/snk-pesquisa2.js +2 -2
- package/dist/components/snk-taskbar2.js +2 -2
- package/dist/esm/{SnkMessageBuilder-5792c260.js → SnkMessageBuilder-a27fc561.js} +8 -4
- package/dist/esm/snk-application.entry.js +13 -2
- package/dist/esm/snk-config-options.entry.js +6 -2
- package/dist/esm/snk-configurator_6.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +1 -1
- package/dist/esm/snk-data-unit.entry.js +8 -2
- package/dist/esm/snk-form-config.entry.js +4 -4
- package/dist/esm/snk-pesquisa.entry.js +2 -2
- package/dist/esm/{taskbar-elements-e2ed0536.js → taskbar-elements-0f41cd77.js} +2 -2
- package/dist/sankhyablocks/p-2517529d.js +1 -0
- package/dist/sankhyablocks/{p-d690b6b5.entry.js → p-4c887c1f.entry.js} +5 -5
- package/dist/sankhyablocks/p-59d8c47a.js +1 -0
- package/dist/sankhyablocks/{p-4392f13f.entry.js → p-626cf022.entry.js} +1 -1
- package/dist/sankhyablocks/p-8706fe65.entry.js +1 -0
- package/dist/sankhyablocks/{p-400cc777.entry.js → p-92782503.entry.js} +1 -1
- package/dist/sankhyablocks/p-ac71ef38.entry.js +1 -0
- package/dist/sankhyablocks/{p-a17a4fca.entry.js → p-e128f747.entry.js} +1 -1
- package/dist/sankhyablocks/{p-521c96f0.entry.js → p-e8591491.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +3 -3
- package/package.json +1 -1
- package/dist/sankhyablocks/p-21c8929b.js +0 -1
- package/dist/sankhyablocks/p-6988f4a6.entry.js +0 -1
- package/dist/sankhyablocks/p-d9fbb26f.js +0 -1
- package/dist/sankhyablocks/p-e871aa92.entry.js +0 -1
|
@@ -31,10 +31,14 @@ const snkDataUnitMessages = {
|
|
|
31
31
|
insert: "A inclusão descartada!",
|
|
32
32
|
update: "A edição foi descartada!"
|
|
33
33
|
},
|
|
34
|
+
confirm: {
|
|
35
|
+
cancel: "Cancelar",
|
|
36
|
+
delete: "Excluir"
|
|
37
|
+
},
|
|
34
38
|
removeInfo: "Registro removido com sucesso!",
|
|
35
39
|
cancelConfirmationTitle: "Aviso",
|
|
36
40
|
cancelConfirmation: "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?",
|
|
37
|
-
removeConfirmationTitle: "
|
|
41
|
+
removeConfirmationTitle: "Aviso",
|
|
38
42
|
removeConfirmation: "Deseja realmente excluir o registro atual?",
|
|
39
43
|
forbidden: "Sem permissão",
|
|
40
44
|
forbiddenUpdate: "Não é possível fazer alterações. Verifique as permissões de acesso.",
|
|
@@ -136,13 +140,13 @@ const snkFormConfigMessages = {
|
|
|
136
140
|
},
|
|
137
141
|
confirm: {
|
|
138
142
|
title: "Aviso",
|
|
139
|
-
deleteTab: "
|
|
143
|
+
deleteTab: "Você realmente deseja excluir a aba",
|
|
140
144
|
cancel: "As alterações realizadas serão descartadas.<br/><br/><b>Gostaria de continuar?</b>",
|
|
141
145
|
exit: "Ao sair as alterações serão descartadas.<br/><br/><b>Você realmente gostaria de sair?</b>",
|
|
142
146
|
apply: "A <b>{0}</b> irá substituir a sua configuração {1}!<br/><br/><b>Deseja continuar?</b>",
|
|
143
147
|
group: "Não é possível salvar as configurações com um grupo vazio!",
|
|
144
|
-
|
|
145
|
-
|
|
148
|
+
labelCancel: "Cancelar",
|
|
149
|
+
labelDelete: "Excluir"
|
|
146
150
|
},
|
|
147
151
|
alert: {
|
|
148
152
|
titleGroupExists: "Já existe um grupo com título",
|
|
@@ -6,7 +6,7 @@ const index = require('./index-20e8b68a.js');
|
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const formConfigFetcher = require('./form-config-fetcher-2de7c16a.js');
|
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
9
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
|
9
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-89482d28.js');
|
|
10
10
|
require('./_commonjsHelpers-537d719a.js');
|
|
11
11
|
|
|
12
12
|
class SnkErrorHandler {
|
|
@@ -109,7 +109,18 @@ class PesquisaFetcher {
|
|
|
109
109
|
};
|
|
110
110
|
if ((criteria === null || criteria === void 0 ? void 0 : criteria.params.length) > 0) {
|
|
111
111
|
externalCriteria.params = {
|
|
112
|
-
param: criteria.params.map(
|
|
112
|
+
param: criteria.params.map(param => {
|
|
113
|
+
let value = param.value;
|
|
114
|
+
let type = param.dataType;
|
|
115
|
+
if (type === core.DataType.OBJECT) {
|
|
116
|
+
value = value.value;
|
|
117
|
+
type = "S";
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
type = convertParamType(param.dataType);
|
|
121
|
+
}
|
|
122
|
+
return { $: value, type };
|
|
123
|
+
})
|
|
113
124
|
};
|
|
114
125
|
}
|
|
115
126
|
const reqBody = {
|
|
@@ -185,8 +185,12 @@ const SnkConfigOptions = class {
|
|
|
185
185
|
const { config, descriptor } = field;
|
|
186
186
|
const { name, label, readOnly, required, defaultValue } = config;
|
|
187
187
|
const { userInterface, properties } = descriptor;
|
|
188
|
-
const
|
|
188
|
+
const allowDefault = properties === null || properties === void 0 ? void 0 : properties.allowDefault;
|
|
189
189
|
let value;
|
|
190
|
+
let enabled = core.StringUtils.getBooleanValue(allowDefault, !readOnly);
|
|
191
|
+
if (userInterface === core.UserInterface.FILE) {
|
|
192
|
+
enabled = false;
|
|
193
|
+
}
|
|
190
194
|
if (enabled) {
|
|
191
195
|
value = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value;
|
|
192
196
|
if (value != undefined) {
|
|
@@ -10,7 +10,7 @@ const configurableElementsStorage = require('./configurableElementsStorage-93459
|
|
|
10
10
|
const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
|
|
11
11
|
const ezModalContainer = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container');
|
|
12
12
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
|
13
|
-
const taskbarElements = require('./taskbar-elements-
|
|
13
|
+
const taskbarElements = require('./taskbar-elements-90350a55.js');
|
|
14
14
|
|
|
15
15
|
const GRID_MODE = constants.VIEW_MODE.grid;
|
|
16
16
|
const FORM_MODE = constants.VIEW_MODE.form;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-20e8b68a.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const constants = require('./constants-9056ca9e.js');
|
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
|
8
|
+
const taskbarElements = require('./taskbar-elements-90350a55.js');
|
|
9
9
|
|
|
10
10
|
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-20e8b68a.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
|
8
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-89482d28.js');
|
|
9
9
|
|
|
10
10
|
const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";
|
|
11
11
|
|
|
@@ -179,8 +179,14 @@ const SnkDataUnit = class {
|
|
|
179
179
|
resolve(action);
|
|
180
180
|
}
|
|
181
181
|
else {
|
|
182
|
+
const options = {
|
|
183
|
+
canClose: false,
|
|
184
|
+
labelCancel: this.getMessage("snkDataUnit.confirm.cancel"),
|
|
185
|
+
labelConfirm: this.getMessage("snkDataUnit.confirm.delete"),
|
|
186
|
+
btnConfirmDanger: false
|
|
187
|
+
};
|
|
182
188
|
const removeConfirmationTitle = this.getMessage("snkDataUnit.removeConfirmationTitle");
|
|
183
|
-
utils.ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation,
|
|
189
|
+
utils.ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, null, utils.DialogType.WARN, options)
|
|
184
190
|
.then((result) => resolve(result ? action : undefined));
|
|
185
191
|
}
|
|
186
192
|
}
|
|
@@ -881,13 +881,13 @@ const SnkFormConfig = class {
|
|
|
881
881
|
handleDeleteTab(tabSelected) {
|
|
882
882
|
let options = {
|
|
883
883
|
canClose: false,
|
|
884
|
-
labelCancel: this.getMessage("snkFormConfig.confirm.
|
|
885
|
-
labelConfirm: this.getMessage("snkFormConfig.confirm.
|
|
884
|
+
labelCancel: this.getMessage("snkFormConfig.confirm.labelCancel"),
|
|
885
|
+
labelConfirm: this.getMessage("snkFormConfig.confirm.labelDelete"),
|
|
886
886
|
btnConfirmDanger: false
|
|
887
887
|
};
|
|
888
888
|
const title = this.getMessage("snkFormConfig.confirm.title");
|
|
889
|
-
const deleteTab = this.getMessage("snkFormConfig.confirm.deleteTab")
|
|
890
|
-
utils.ApplicationUtils.confirm(title,
|
|
889
|
+
const deleteTab = this.getMessage("snkFormConfig.confirm.deleteTab") + ` <b>${tabSelected.detail.label}</b>?`;
|
|
890
|
+
utils.ApplicationUtils.confirm(title, deleteTab, null, utils.DialogType.WARN, options)
|
|
891
891
|
.then(response => {
|
|
892
892
|
var _a;
|
|
893
893
|
if (response) {
|
|
@@ -62,7 +62,7 @@ const SnkPesquisa = class {
|
|
|
62
62
|
resp = core.ObjectUtils.stringToObject(resp.json.$);
|
|
63
63
|
let descriptionField = resp.descriptionField;
|
|
64
64
|
let pkField = resp.pkField;
|
|
65
|
-
if (
|
|
65
|
+
if (pkField) {
|
|
66
66
|
let newItemList = [];
|
|
67
67
|
resp.data.forEach((item) => {
|
|
68
68
|
var _a;
|
|
@@ -70,7 +70,7 @@ const SnkPesquisa = class {
|
|
|
70
70
|
let fields = this.buildFirstFields(item['__matchFields'], fieldsMetadata);
|
|
71
71
|
let exibitionItem = {
|
|
72
72
|
key: this.highlightValue(item['__matchFields'], (_a = item[pkField]) === null || _a === void 0 ? void 0 : _a.toString(), fields, true),
|
|
73
|
-
title: this.highlightValue(item['__matchFields'], item[descriptionField], fields, true),
|
|
73
|
+
title: descriptionField ? this.highlightValue(item['__matchFields'], item[descriptionField], fields, true) : "",
|
|
74
74
|
details: this.buildDetails(fields, item)
|
|
75
75
|
};
|
|
76
76
|
newItemList.push(exibitionItem);
|
|
@@ -15,6 +15,7 @@ exports.TaskbarElement = void 0;
|
|
|
15
15
|
TaskbarElement["SAVE"] = "SAVE";
|
|
16
16
|
TaskbarElement["GRID_MODE"] = "GRID_MODE";
|
|
17
17
|
TaskbarElement["FORM_MODE"] = "FORM_MODE";
|
|
18
|
+
TaskbarElement["CONFIG_GRID"] = "CONFIG_GRID";
|
|
18
19
|
TaskbarElement["MORE_OPTIONS"] = "MORE_OPTIONS";
|
|
19
20
|
TaskbarElement["DIVIDER"] = "DIVIDER";
|
|
20
21
|
TaskbarElement["CONFIGURATOR"] = "CONFIGURATOR";
|
|
@@ -25,12 +26,11 @@ exports.AuthorizationElements = void 0;
|
|
|
25
26
|
AuthorizationElements["CLONE"] = "CLONE";
|
|
26
27
|
AuthorizationElements["REMOVE"] = "REMOVE";
|
|
27
28
|
AuthorizationElements["INSERT"] = "INSERT";
|
|
28
|
-
AuthorizationElements["
|
|
29
|
+
AuthorizationElements["CONFIG_GRID"] = "CONFIG_GRID";
|
|
29
30
|
})(exports.AuthorizationElements || (exports.AuthorizationElements = {}));
|
|
30
31
|
exports.VisibleWhenForbidden = void 0;
|
|
31
32
|
(function (VisibleWhenForbidden) {
|
|
32
33
|
VisibleWhenForbidden["CONFIG_GRID"] = "CONFIG_GRID";
|
|
33
|
-
VisibleWhenForbidden["CONFIGURATOR"] = "CONFIGURATOR";
|
|
34
34
|
})(exports.VisibleWhenForbidden || (exports.VisibleWhenForbidden = {}));
|
|
35
35
|
const buildCustomButton = (def, className, action, isEnabled) => {
|
|
36
36
|
const { hint, text, iconName } = def;
|
|
@@ -167,8 +167,14 @@ export class SnkDataUnit {
|
|
|
167
167
|
resolve(action);
|
|
168
168
|
}
|
|
169
169
|
else {
|
|
170
|
+
const options = {
|
|
171
|
+
canClose: false,
|
|
172
|
+
labelCancel: this.getMessage("snkDataUnit.confirm.cancel"),
|
|
173
|
+
labelConfirm: this.getMessage("snkDataUnit.confirm.delete"),
|
|
174
|
+
btnConfirmDanger: false
|
|
175
|
+
};
|
|
170
176
|
const removeConfirmationTitle = this.getMessage("snkDataUnit.removeConfirmationTitle");
|
|
171
|
-
ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation,
|
|
177
|
+
ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, null, DialogType.WARN, options)
|
|
172
178
|
.then((result) => resolve(result ? action : undefined));
|
|
173
179
|
}
|
|
174
180
|
}
|
package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { ApplicationContext, UserInterface, ObjectUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { ApplicationContext, UserInterface, ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { DataType, getConvertedValue } from "@sankhyalabs/core/dist/dataunit/metadata/DataType";
|
|
4
4
|
import { CheckMode } from "@sankhyalabs/ezui/dist/collection/utils";
|
|
5
5
|
import { DEFAULT_TYPE, TAGS_BY_TYPE, VARS_BY_TYPE } from "../../../../lib/utils/constants";
|
|
@@ -176,8 +176,12 @@ export class SnkConfigOptions {
|
|
|
176
176
|
const { config, descriptor } = field;
|
|
177
177
|
const { name, label, readOnly, required, defaultValue } = config;
|
|
178
178
|
const { userInterface, properties } = descriptor;
|
|
179
|
-
const
|
|
179
|
+
const allowDefault = properties === null || properties === void 0 ? void 0 : properties.allowDefault;
|
|
180
180
|
let value;
|
|
181
|
+
let enabled = StringUtils.getBooleanValue(allowDefault, !readOnly);
|
|
182
|
+
if (userInterface === UserInterface.FILE) {
|
|
183
|
+
enabled = false;
|
|
184
|
+
}
|
|
181
185
|
if (enabled) {
|
|
182
186
|
value = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value;
|
|
183
187
|
if (value != undefined) {
|
package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js
CHANGED
|
@@ -874,13 +874,13 @@ export class SnkFormConfig {
|
|
|
874
874
|
handleDeleteTab(tabSelected) {
|
|
875
875
|
let options = {
|
|
876
876
|
canClose: false,
|
|
877
|
-
labelCancel: this.getMessage("snkFormConfig.confirm.
|
|
878
|
-
labelConfirm: this.getMessage("snkFormConfig.confirm.
|
|
877
|
+
labelCancel: this.getMessage("snkFormConfig.confirm.labelCancel"),
|
|
878
|
+
labelConfirm: this.getMessage("snkFormConfig.confirm.labelDelete"),
|
|
879
879
|
btnConfirmDanger: false
|
|
880
880
|
};
|
|
881
881
|
const title = this.getMessage("snkFormConfig.confirm.title");
|
|
882
|
-
const deleteTab = this.getMessage("snkFormConfig.confirm.deleteTab")
|
|
883
|
-
ApplicationUtils.confirm(title,
|
|
882
|
+
const deleteTab = this.getMessage("snkFormConfig.confirm.deleteTab") + ` <b>${tabSelected.detail.label}</b>?`;
|
|
883
|
+
ApplicationUtils.confirm(title, deleteTab, null, DialogType.WARN, options)
|
|
884
884
|
.then(response => {
|
|
885
885
|
var _a;
|
|
886
886
|
if (response) {
|
|
@@ -54,7 +54,7 @@ export class SnkPesquisa {
|
|
|
54
54
|
resp = ObjectUtils.stringToObject(resp.json.$);
|
|
55
55
|
let descriptionField = resp.descriptionField;
|
|
56
56
|
let pkField = resp.pkField;
|
|
57
|
-
if (
|
|
57
|
+
if (pkField) {
|
|
58
58
|
let newItemList = [];
|
|
59
59
|
resp.data.forEach((item) => {
|
|
60
60
|
var _a;
|
|
@@ -62,7 +62,7 @@ export class SnkPesquisa {
|
|
|
62
62
|
let fields = this.buildFirstFields(item['__matchFields'], fieldsMetadata);
|
|
63
63
|
let exibitionItem = {
|
|
64
64
|
key: this.highlightValue(item['__matchFields'], (_a = item[pkField]) === null || _a === void 0 ? void 0 : _a.toString(), fields, true),
|
|
65
|
-
title: this.highlightValue(item['__matchFields'], item[descriptionField], fields, true),
|
|
65
|
+
title: descriptionField ? this.highlightValue(item['__matchFields'], item[descriptionField], fields, true) : "",
|
|
66
66
|
details: this.buildDetails(fields, item)
|
|
67
67
|
};
|
|
68
68
|
newItemList.push(exibitionItem);
|
|
@@ -12,6 +12,7 @@ export var TaskbarElement;
|
|
|
12
12
|
TaskbarElement["SAVE"] = "SAVE";
|
|
13
13
|
TaskbarElement["GRID_MODE"] = "GRID_MODE";
|
|
14
14
|
TaskbarElement["FORM_MODE"] = "FORM_MODE";
|
|
15
|
+
TaskbarElement["CONFIG_GRID"] = "CONFIG_GRID";
|
|
15
16
|
TaskbarElement["MORE_OPTIONS"] = "MORE_OPTIONS";
|
|
16
17
|
TaskbarElement["DIVIDER"] = "DIVIDER";
|
|
17
18
|
TaskbarElement["CONFIGURATOR"] = "CONFIGURATOR";
|
|
@@ -22,12 +23,11 @@ export var AuthorizationElements;
|
|
|
22
23
|
AuthorizationElements["CLONE"] = "CLONE";
|
|
23
24
|
AuthorizationElements["REMOVE"] = "REMOVE";
|
|
24
25
|
AuthorizationElements["INSERT"] = "INSERT";
|
|
25
|
-
AuthorizationElements["
|
|
26
|
+
AuthorizationElements["CONFIG_GRID"] = "CONFIG_GRID";
|
|
26
27
|
})(AuthorizationElements || (AuthorizationElements = {}));
|
|
27
28
|
export var VisibleWhenForbidden;
|
|
28
29
|
(function (VisibleWhenForbidden) {
|
|
29
30
|
VisibleWhenForbidden["CONFIG_GRID"] = "CONFIG_GRID";
|
|
30
|
-
VisibleWhenForbidden["CONFIGURATOR"] = "CONFIGURATOR";
|
|
31
31
|
})(VisibleWhenForbidden || (VisibleWhenForbidden = {}));
|
|
32
32
|
export const buildCustomButton = (def, className, action, isEnabled) => {
|
|
33
33
|
const { hint, text, iconName } = def;
|
|
@@ -41,7 +41,18 @@ export class PesquisaFetcher {
|
|
|
41
41
|
};
|
|
42
42
|
if ((criteria === null || criteria === void 0 ? void 0 : criteria.params.length) > 0) {
|
|
43
43
|
externalCriteria.params = {
|
|
44
|
-
param: criteria.params.map(
|
|
44
|
+
param: criteria.params.map(param => {
|
|
45
|
+
let value = param.value;
|
|
46
|
+
let type = param.dataType;
|
|
47
|
+
if (type === DataType.OBJECT) {
|
|
48
|
+
value = value.value;
|
|
49
|
+
type = "S";
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
type = convertParamType(param.dataType);
|
|
53
|
+
}
|
|
54
|
+
return { $: value, type };
|
|
55
|
+
})
|
|
45
56
|
};
|
|
46
57
|
}
|
|
47
58
|
const reqBody = {
|
|
@@ -9,10 +9,14 @@ const snkDataUnitMessages = {
|
|
|
9
9
|
insert: "A inclusão descartada!",
|
|
10
10
|
update: "A edição foi descartada!"
|
|
11
11
|
},
|
|
12
|
+
confirm: {
|
|
13
|
+
cancel: "Cancelar",
|
|
14
|
+
delete: "Excluir"
|
|
15
|
+
},
|
|
12
16
|
removeInfo: "Registro removido com sucesso!",
|
|
13
17
|
cancelConfirmationTitle: "Aviso",
|
|
14
18
|
cancelConfirmation: "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?",
|
|
15
|
-
removeConfirmationTitle: "
|
|
19
|
+
removeConfirmationTitle: "Aviso",
|
|
16
20
|
removeConfirmation: "Deseja realmente excluir o registro atual?",
|
|
17
21
|
forbidden: "Sem permissão",
|
|
18
22
|
forbiddenUpdate: "Não é possível fazer alterações. Verifique as permissões de acesso.",
|
|
@@ -40,13 +40,13 @@ export const snkFormConfigMessages = {
|
|
|
40
40
|
},
|
|
41
41
|
confirm: {
|
|
42
42
|
title: "Aviso",
|
|
43
|
-
deleteTab: "
|
|
43
|
+
deleteTab: "Você realmente deseja excluir a aba",
|
|
44
44
|
cancel: "As alterações realizadas serão descartadas.<br/><br/><b>Gostaria de continuar?</b>",
|
|
45
45
|
exit: "Ao sair as alterações serão descartadas.<br/><br/><b>Você realmente gostaria de sair?</b>",
|
|
46
46
|
apply: "A <b>{0}</b> irá substituir a sua configuração {1}!<br/><br/><b>Deseja continuar?</b>",
|
|
47
47
|
group: "Não é possível salvar as configurações com um grupo vazio!",
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
labelCancel: "Cancelar",
|
|
49
|
+
labelDelete: "Excluir"
|
|
50
50
|
},
|
|
51
51
|
alert: {
|
|
52
52
|
titleGroupExists: "Já existe um grupo com título",
|
|
@@ -9,10 +9,14 @@ const snkDataUnitMessages = {
|
|
|
9
9
|
insert: "A inclusão descartada!",
|
|
10
10
|
update: "A edição foi descartada!"
|
|
11
11
|
},
|
|
12
|
+
confirm: {
|
|
13
|
+
cancel: "Cancelar",
|
|
14
|
+
delete: "Excluir"
|
|
15
|
+
},
|
|
12
16
|
removeInfo: "Registro removido com sucesso!",
|
|
13
17
|
cancelConfirmationTitle: "Aviso",
|
|
14
18
|
cancelConfirmation: "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?",
|
|
15
|
-
removeConfirmationTitle: "
|
|
19
|
+
removeConfirmationTitle: "Aviso",
|
|
16
20
|
removeConfirmation: "Deseja realmente excluir o registro atual?",
|
|
17
21
|
forbidden: "Sem permissão",
|
|
18
22
|
forbiddenUpdate: "Não é possível fazer alterações. Verifique as permissões de acesso.",
|
|
@@ -114,13 +118,13 @@ const snkFormConfigMessages = {
|
|
|
114
118
|
},
|
|
115
119
|
confirm: {
|
|
116
120
|
title: "Aviso",
|
|
117
|
-
deleteTab: "
|
|
121
|
+
deleteTab: "Você realmente deseja excluir a aba",
|
|
118
122
|
cancel: "As alterações realizadas serão descartadas.<br/><br/><b>Gostaria de continuar?</b>",
|
|
119
123
|
exit: "Ao sair as alterações serão descartadas.<br/><br/><b>Você realmente gostaria de sair?</b>",
|
|
120
124
|
apply: "A <b>{0}</b> irá substituir a sua configuração {1}!<br/><br/><b>Deseja continuar?</b>",
|
|
121
125
|
group: "Não é possível salvar as configurações com um grupo vazio!",
|
|
122
|
-
|
|
123
|
-
|
|
126
|
+
labelCancel: "Cancelar",
|
|
127
|
+
labelDelete: "Excluir"
|
|
124
128
|
},
|
|
125
129
|
alert: {
|
|
126
130
|
titleGroupExists: "Já existe um grupo com título",
|
|
@@ -105,7 +105,18 @@ class PesquisaFetcher {
|
|
|
105
105
|
};
|
|
106
106
|
if ((criteria === null || criteria === void 0 ? void 0 : criteria.params.length) > 0) {
|
|
107
107
|
externalCriteria.params = {
|
|
108
|
-
param: criteria.params.map(
|
|
108
|
+
param: criteria.params.map(param => {
|
|
109
|
+
let value = param.value;
|
|
110
|
+
let type = param.dataType;
|
|
111
|
+
if (type === DataType.OBJECT) {
|
|
112
|
+
value = value.value;
|
|
113
|
+
type = "S";
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
type = convertParamType(param.dataType);
|
|
117
|
+
}
|
|
118
|
+
return { $: value, type };
|
|
119
|
+
})
|
|
109
120
|
};
|
|
110
121
|
}
|
|
111
122
|
const reqBody = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { UserInterface, ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
2
|
+
import { UserInterface, ObjectUtils, StringUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { DataType, getConvertedValue } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
4
4
|
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
5
|
import { a as VARS_BY_TYPE, D as DEFAULT_TYPE, T as TAGS_BY_TYPE } from './constants.js';
|
|
@@ -182,8 +182,12 @@ const SnkConfigOptions = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
182
182
|
const { config, descriptor } = field;
|
|
183
183
|
const { name, label, readOnly, required, defaultValue } = config;
|
|
184
184
|
const { userInterface, properties } = descriptor;
|
|
185
|
-
const
|
|
185
|
+
const allowDefault = properties === null || properties === void 0 ? void 0 : properties.allowDefault;
|
|
186
186
|
let value;
|
|
187
|
+
let enabled = StringUtils.getBooleanValue(allowDefault, !readOnly);
|
|
188
|
+
if (userInterface === UserInterface.FILE) {
|
|
189
|
+
enabled = false;
|
|
190
|
+
}
|
|
187
191
|
if (enabled) {
|
|
188
192
|
value = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value;
|
|
189
193
|
if (value != undefined) {
|
|
@@ -176,8 +176,14 @@ const SnkDataUnit$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
176
176
|
resolve(action);
|
|
177
177
|
}
|
|
178
178
|
else {
|
|
179
|
+
const options = {
|
|
180
|
+
canClose: false,
|
|
181
|
+
labelCancel: this.getMessage("snkDataUnit.confirm.cancel"),
|
|
182
|
+
labelConfirm: this.getMessage("snkDataUnit.confirm.delete"),
|
|
183
|
+
btnConfirmDanger: false
|
|
184
|
+
};
|
|
179
185
|
const removeConfirmationTitle = this.getMessage("snkDataUnit.removeConfirmationTitle");
|
|
180
|
-
ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation,
|
|
186
|
+
ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, null, DialogType.WARN, options)
|
|
181
187
|
.then((result) => resolve(result ? action : undefined));
|
|
182
188
|
}
|
|
183
189
|
}
|
|
@@ -879,13 +879,13 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
879
879
|
handleDeleteTab(tabSelected) {
|
|
880
880
|
let options = {
|
|
881
881
|
canClose: false,
|
|
882
|
-
labelCancel: this.getMessage("snkFormConfig.confirm.
|
|
883
|
-
labelConfirm: this.getMessage("snkFormConfig.confirm.
|
|
882
|
+
labelCancel: this.getMessage("snkFormConfig.confirm.labelCancel"),
|
|
883
|
+
labelConfirm: this.getMessage("snkFormConfig.confirm.labelDelete"),
|
|
884
884
|
btnConfirmDanger: false
|
|
885
885
|
};
|
|
886
886
|
const title = this.getMessage("snkFormConfig.confirm.title");
|
|
887
|
-
const deleteTab = this.getMessage("snkFormConfig.confirm.deleteTab")
|
|
888
|
-
ApplicationUtils.confirm(title,
|
|
887
|
+
const deleteTab = this.getMessage("snkFormConfig.confirm.deleteTab") + ` <b>${tabSelected.detail.label}</b>?`;
|
|
888
|
+
ApplicationUtils.confirm(title, deleteTab, null, DialogType.WARN, options)
|
|
889
889
|
.then(response => {
|
|
890
890
|
var _a;
|
|
891
891
|
if (response) {
|
|
@@ -59,7 +59,7 @@ const SnkPesquisa = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
59
59
|
resp = ObjectUtils.stringToObject(resp.json.$);
|
|
60
60
|
let descriptionField = resp.descriptionField;
|
|
61
61
|
let pkField = resp.pkField;
|
|
62
|
-
if (
|
|
62
|
+
if (pkField) {
|
|
63
63
|
let newItemList = [];
|
|
64
64
|
resp.data.forEach((item) => {
|
|
65
65
|
var _a;
|
|
@@ -67,7 +67,7 @@ const SnkPesquisa = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
67
67
|
let fields = this.buildFirstFields(item['__matchFields'], fieldsMetadata);
|
|
68
68
|
let exibitionItem = {
|
|
69
69
|
key: this.highlightValue(item['__matchFields'], (_a = item[pkField]) === null || _a === void 0 ? void 0 : _a.toString(), fields, true),
|
|
70
|
-
title: this.highlightValue(item['__matchFields'], item[descriptionField], fields, true),
|
|
70
|
+
title: descriptionField ? this.highlightValue(item['__matchFields'], item[descriptionField], fields, true) : "",
|
|
71
71
|
details: this.buildDetails(fields, item)
|
|
72
72
|
};
|
|
73
73
|
newItemList.push(exibitionItem);
|
|
@@ -16,6 +16,7 @@ var TaskbarElement;
|
|
|
16
16
|
TaskbarElement["SAVE"] = "SAVE";
|
|
17
17
|
TaskbarElement["GRID_MODE"] = "GRID_MODE";
|
|
18
18
|
TaskbarElement["FORM_MODE"] = "FORM_MODE";
|
|
19
|
+
TaskbarElement["CONFIG_GRID"] = "CONFIG_GRID";
|
|
19
20
|
TaskbarElement["MORE_OPTIONS"] = "MORE_OPTIONS";
|
|
20
21
|
TaskbarElement["DIVIDER"] = "DIVIDER";
|
|
21
22
|
TaskbarElement["CONFIGURATOR"] = "CONFIGURATOR";
|
|
@@ -26,12 +27,11 @@ var AuthorizationElements;
|
|
|
26
27
|
AuthorizationElements["CLONE"] = "CLONE";
|
|
27
28
|
AuthorizationElements["REMOVE"] = "REMOVE";
|
|
28
29
|
AuthorizationElements["INSERT"] = "INSERT";
|
|
29
|
-
AuthorizationElements["
|
|
30
|
+
AuthorizationElements["CONFIG_GRID"] = "CONFIG_GRID";
|
|
30
31
|
})(AuthorizationElements || (AuthorizationElements = {}));
|
|
31
32
|
var VisibleWhenForbidden;
|
|
32
33
|
(function (VisibleWhenForbidden) {
|
|
33
34
|
VisibleWhenForbidden["CONFIG_GRID"] = "CONFIG_GRID";
|
|
34
|
-
VisibleWhenForbidden["CONFIGURATOR"] = "CONFIGURATOR";
|
|
35
35
|
})(VisibleWhenForbidden || (VisibleWhenForbidden = {}));
|
|
36
36
|
const buildCustomButton = (def, className, action, isEnabled) => {
|
|
37
37
|
const { hint, text, iconName } = def;
|
|
@@ -9,10 +9,14 @@ const snkDataUnitMessages = {
|
|
|
9
9
|
insert: "A inclusão descartada!",
|
|
10
10
|
update: "A edição foi descartada!"
|
|
11
11
|
},
|
|
12
|
+
confirm: {
|
|
13
|
+
cancel: "Cancelar",
|
|
14
|
+
delete: "Excluir"
|
|
15
|
+
},
|
|
12
16
|
removeInfo: "Registro removido com sucesso!",
|
|
13
17
|
cancelConfirmationTitle: "Aviso",
|
|
14
18
|
cancelConfirmation: "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?",
|
|
15
|
-
removeConfirmationTitle: "
|
|
19
|
+
removeConfirmationTitle: "Aviso",
|
|
16
20
|
removeConfirmation: "Deseja realmente excluir o registro atual?",
|
|
17
21
|
forbidden: "Sem permissão",
|
|
18
22
|
forbiddenUpdate: "Não é possível fazer alterações. Verifique as permissões de acesso.",
|
|
@@ -114,13 +118,13 @@ const snkFormConfigMessages = {
|
|
|
114
118
|
},
|
|
115
119
|
confirm: {
|
|
116
120
|
title: "Aviso",
|
|
117
|
-
deleteTab: "
|
|
121
|
+
deleteTab: "Você realmente deseja excluir a aba",
|
|
118
122
|
cancel: "As alterações realizadas serão descartadas.<br/><br/><b>Gostaria de continuar?</b>",
|
|
119
123
|
exit: "Ao sair as alterações serão descartadas.<br/><br/><b>Você realmente gostaria de sair?</b>",
|
|
120
124
|
apply: "A <b>{0}</b> irá substituir a sua configuração {1}!<br/><br/><b>Deseja continuar?</b>",
|
|
121
125
|
group: "Não é possível salvar as configurações com um grupo vazio!",
|
|
122
|
-
|
|
123
|
-
|
|
126
|
+
labelCancel: "Cancelar",
|
|
127
|
+
labelDelete: "Excluir"
|
|
124
128
|
},
|
|
125
129
|
alert: {
|
|
126
130
|
titleGroupExists: "Já existe um grupo com título",
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h } from './index-e4121713.js'
|
|
|
2
2
|
import { WaitingChangeException, WarningException, ErrorException, ObjectUtils, DataType, DataUnit, StringUtils, ChangeOperation, DateUtils, DependencyType, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
|
|
3
3
|
import { d as dist, D as DataFetcher, R as ResourceFetcher, U as UrlUtils, F as FormConfigFetcher } from './form-config-fetcher-96c6c2dc.js';
|
|
4
4
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
|
-
import { S as SnkMessageBuilder } from './SnkMessageBuilder-
|
|
5
|
+
import { S as SnkMessageBuilder } from './SnkMessageBuilder-a27fc561.js';
|
|
6
6
|
import './_commonjsHelpers-9943807e.js';
|
|
7
7
|
|
|
8
8
|
class SnkErrorHandler {
|
|
@@ -105,7 +105,18 @@ class PesquisaFetcher {
|
|
|
105
105
|
};
|
|
106
106
|
if ((criteria === null || criteria === void 0 ? void 0 : criteria.params.length) > 0) {
|
|
107
107
|
externalCriteria.params = {
|
|
108
|
-
param: criteria.params.map(
|
|
108
|
+
param: criteria.params.map(param => {
|
|
109
|
+
let value = param.value;
|
|
110
|
+
let type = param.dataType;
|
|
111
|
+
if (type === DataType.OBJECT) {
|
|
112
|
+
value = value.value;
|
|
113
|
+
type = "S";
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
type = convertParamType(param.dataType);
|
|
117
|
+
}
|
|
118
|
+
return { $: value, type };
|
|
119
|
+
})
|
|
109
120
|
};
|
|
110
121
|
}
|
|
111
122
|
const reqBody = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-e4121713.js';
|
|
2
|
-
import { UserInterface, ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
2
|
+
import { UserInterface, ObjectUtils, StringUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { DataType, getConvertedValue } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
4
4
|
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
5
|
import { V as VARS_BY_TYPE, D as DEFAULT_TYPE, a as TAGS_BY_TYPE } from './constants-c6039d3d.js';
|
|
@@ -181,8 +181,12 @@ const SnkConfigOptions = class {
|
|
|
181
181
|
const { config, descriptor } = field;
|
|
182
182
|
const { name, label, readOnly, required, defaultValue } = config;
|
|
183
183
|
const { userInterface, properties } = descriptor;
|
|
184
|
-
const
|
|
184
|
+
const allowDefault = properties === null || properties === void 0 ? void 0 : properties.allowDefault;
|
|
185
185
|
let value;
|
|
186
|
+
let enabled = StringUtils.getBooleanValue(allowDefault, !readOnly);
|
|
187
|
+
if (userInterface === UserInterface.FILE) {
|
|
188
|
+
enabled = false;
|
|
189
|
+
}
|
|
186
190
|
if (enabled) {
|
|
187
191
|
value = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value;
|
|
188
192
|
if (value != undefined) {
|
|
@@ -6,7 +6,7 @@ import { C as ConfigurableElementsStorage } from './configurableElementsStorage-
|
|
|
6
6
|
import { F as FilterItemType } from './filter-item-type.enum-a79b2fa8.js';
|
|
7
7
|
import { ModalAction, ModalButtonStatus } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
|
8
8
|
import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
9
|
-
import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-
|
|
9
|
+
import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-0f41cd77.js';
|
|
10
10
|
|
|
11
11
|
const GRID_MODE = VIEW_MODE.grid;
|
|
12
12
|
const FORM_MODE = VIEW_MODE.form;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-e4121713.js';
|
|
2
2
|
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { c as VIEW_MODE } from './constants-c6039d3d.js';
|
|
4
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
|
4
|
+
import { T as TaskbarElement } from './taskbar-elements-0f41cd77.js';
|
|
5
5
|
|
|
6
6
|
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-e4121713.js';
|
|
2
2
|
import { Action, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
|
-
import { O as OperationMap } from './SnkMessageBuilder-
|
|
4
|
+
import { O as OperationMap } from './SnkMessageBuilder-a27fc561.js';
|
|
5
5
|
|
|
6
6
|
const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";
|
|
7
7
|
|
|
@@ -175,8 +175,14 @@ const SnkDataUnit = class {
|
|
|
175
175
|
resolve(action);
|
|
176
176
|
}
|
|
177
177
|
else {
|
|
178
|
+
const options = {
|
|
179
|
+
canClose: false,
|
|
180
|
+
labelCancel: this.getMessage("snkDataUnit.confirm.cancel"),
|
|
181
|
+
labelConfirm: this.getMessage("snkDataUnit.confirm.delete"),
|
|
182
|
+
btnConfirmDanger: false
|
|
183
|
+
};
|
|
178
184
|
const removeConfirmationTitle = this.getMessage("snkDataUnit.removeConfirmationTitle");
|
|
179
|
-
ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation,
|
|
185
|
+
ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, null, DialogType.WARN, options)
|
|
180
186
|
.then((result) => resolve(result ? action : undefined));
|
|
181
187
|
}
|
|
182
188
|
}
|