@sankhyalabs/sankhyablocks 1.3.30 → 1.3.31-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-1133bc2a.js → index-c6671817.js} +416 -9
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +280 -107
- package/dist/cjs/snk-crud.cjs.entry.js +64 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +218 -0
- package/dist/cjs/snk-form_2.cjs.entry.js +170 -0
- package/dist/cjs/snk-pesquisa.cjs.entry.js +6 -3
- package/dist/cjs/snk-taskbar.cjs.entry.js +140 -0
- package/dist/cjs/taskbar-elements-7f99f0c9.js +70 -0
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +5 -0
- package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +2 -2
- package/dist/collection/components/snk-application/snk-application.js +237 -62
- package/dist/collection/components/snk-crud/snk-crud.css +5 -0
- package/dist/collection/components/snk-crud/snk-crud.js +149 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.css +6 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +492 -0
- package/dist/collection/components/snk-form/snk-form.css +34 -0
- package/dist/collection/components/snk-form/snk-form.js +230 -0
- package/dist/collection/components/snk-grid/snk-grid.css +5 -0
- package/dist/collection/components/snk-grid/snk-grid.js +148 -0
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +56 -13
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +5 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +65 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +3 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +252 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +52 -21
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +4 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +2 -0
- package/dist/components/snk-application2.js +280 -106
- package/dist/components/snk-crud.d.ts +11 -0
- package/dist/components/snk-crud.js +102 -0
- package/dist/components/snk-data-unit.d.ts +11 -0
- package/dist/components/snk-data-unit.js +242 -0
- package/dist/components/snk-form.d.ts +11 -0
- package/dist/components/snk-form.js +6 -0
- package/dist/components/snk-form2.js +134 -0
- package/dist/components/snk-grid.d.ts +11 -0
- package/dist/components/snk-grid.js +6 -0
- package/dist/components/snk-grid2.js +91 -0
- package/dist/components/snk-pesquisa2.js +5 -2
- package/dist/components/snk-taskbar.d.ts +11 -0
- package/dist/components/snk-taskbar.js +6 -0
- package/dist/components/snk-taskbar2.js +221 -0
- package/dist/esm/{index-ffda6382.js → index-6a83ac96.js} +416 -10
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sankhyablocks.js +2 -2
- package/dist/esm/snk-application.entry.js +280 -107
- package/dist/esm/snk-crud.entry.js +60 -0
- package/dist/esm/snk-data-unit.entry.js +214 -0
- package/dist/esm/snk-form_2.entry.js +165 -0
- package/dist/esm/snk-pesquisa.entry.js +6 -3
- package/dist/esm/snk-taskbar.entry.js +136 -0
- package/dist/esm/taskbar-elements-e0b8a285.js +68 -0
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/p-18fe0469.entry.js +69 -0
- package/dist/sankhyablocks/p-4c7b32d6.entry.js +1 -0
- package/dist/sankhyablocks/p-5b5afdbe.entry.js +1 -0
- package/dist/sankhyablocks/p-7fe9e5c2.entry.js +1 -0
- package/dist/sankhyablocks/p-8650ae26.entry.js +1 -0
- package/dist/sankhyablocks/p-a5439706.js +1 -0
- package/dist/sankhyablocks/p-c3d20542.entry.js +1 -0
- package/dist/sankhyablocks/p-cd1dc099.js +2 -0
- package/dist/sankhyablocks/{p-2a7b4cb3.entry.js → p-d25637c9.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +103 -15
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +25 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +45 -0
- package/dist/types/components.d.ts +381 -6
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +2 -0
- package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +3 -3
- package/package.json +5 -5
- package/react/components.d.ts +5 -0
- package/react/components.js +5 -0
- package/react/components.js.map +1 -1
- package/dist/sankhyablocks/p-d62412bb.entry.js +0 -1
- package/dist/sankhyablocks/p-e6e91d5f.entry.js +0 -69
- package/dist/sankhyablocks/p-edcb9d8e.js +0 -2
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { ApplicationContext } from '@sankhyalabs/core';
|
|
2
|
+
import { Component, Element, Event, h, Prop, State } from '@stencil/core';
|
|
3
|
+
export class SnkForm {
|
|
4
|
+
getFormConfig() {
|
|
5
|
+
return (this._dataState && this._dataState.insertionMode ? this._insertionFormConfig : this._editionFormConfig);
|
|
6
|
+
}
|
|
7
|
+
getInsertionHiddenFields(formConfig) {
|
|
8
|
+
const hiddenFields = [];
|
|
9
|
+
formConfig === null || formConfig === void 0 ? void 0 : formConfig.forEach(cfg => {
|
|
10
|
+
const def = this._dataUnit.getField(cfg.name);
|
|
11
|
+
if (def === null || def === void 0 ? void 0 : def.readOnly) {
|
|
12
|
+
hiddenFields.push(cfg.name);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return hiddenFields;
|
|
16
|
+
}
|
|
17
|
+
exitForm() {
|
|
18
|
+
if (this._dataUnit.isDirty()) {
|
|
19
|
+
this._dataUnit.cancelEdition({ after: () => this.exit.emit() });
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
this.exit.emit();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
getDisabledButtons() {
|
|
26
|
+
const disabled = [];
|
|
27
|
+
if (!this._dataState.hasPrevious) {
|
|
28
|
+
disabled.push("PREVIOUS");
|
|
29
|
+
}
|
|
30
|
+
if (!this._dataState.hasNext) {
|
|
31
|
+
disabled.push("NEXT");
|
|
32
|
+
}
|
|
33
|
+
return disabled;
|
|
34
|
+
}
|
|
35
|
+
loadInsertionConfig() {
|
|
36
|
+
if (this._dataUnit && this._configLoaded) {
|
|
37
|
+
this._insertionFormConfig = this._editionFormConfig.filter(fieldCfg => {
|
|
38
|
+
const def = this._dataUnit.getField(fieldCfg.name);
|
|
39
|
+
if (def === null || def === void 0 ? void 0 : def.readOnly) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return true;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
i18n(key) {
|
|
47
|
+
const pt_br = {
|
|
48
|
+
"components.back": "Voltar"
|
|
49
|
+
};
|
|
50
|
+
return pt_br[key];
|
|
51
|
+
}
|
|
52
|
+
componentWillLoad() {
|
|
53
|
+
const snkApplication = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
54
|
+
if (snkApplication) {
|
|
55
|
+
snkApplication.loadFormConfig(this.configName).then(cfg => {
|
|
56
|
+
this._configLoaded = true;
|
|
57
|
+
this._editionFormConfig = cfg;
|
|
58
|
+
this.loadInsertionConfig();
|
|
59
|
+
});
|
|
60
|
+
//Forçamos a carga dos acessos pra aproveitar a request inicial.
|
|
61
|
+
snkApplication.getAllAccess();
|
|
62
|
+
}
|
|
63
|
+
let parent = this._element.parentElement;
|
|
64
|
+
while (parent) {
|
|
65
|
+
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
66
|
+
this._snkDataUnit = parent;
|
|
67
|
+
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
68
|
+
this._dataState = this._snkDataUnit.dataState;
|
|
69
|
+
if (this._dataUnit) {
|
|
70
|
+
this.loadInsertionConfig();
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
74
|
+
this._dataUnit = evt.detail;
|
|
75
|
+
this.loadInsertionConfig();
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
|
|
79
|
+
this._dataState = evt.detail;
|
|
80
|
+
});
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
parent = parent.parentElement;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
render() {
|
|
87
|
+
if (!this._configLoaded || !this._dataUnit || !this._dataState) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
return (h("section", { class: "snk-form" },
|
|
91
|
+
h("div", { class: "snk-form__header snk-form__header--fixed ez-row" },
|
|
92
|
+
h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" },
|
|
93
|
+
h("ez-button", { title: this.i18n("components.back"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small", onClick: () => this.exitForm() }),
|
|
94
|
+
h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.formTitle)),
|
|
95
|
+
h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" },
|
|
96
|
+
h("snk-taskbar", { key: "formTaskbar", buttons: this._dataState.isDirty ? "CANCEL,SAVE" : "PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,INSERT", primaryButton: this._dataState.isDirty ? "SAVE" : "INSERT", disabledButtons: this.getDisabledButtons(), actionsList: this.actionsList, dataUnit: this._dataUnit }))),
|
|
97
|
+
h("section", null,
|
|
98
|
+
h("div", { class: "ez-row" },
|
|
99
|
+
h("div", { class: "ez-col ez-col--sd-12" },
|
|
100
|
+
h("ez-form", { key: "ezForm" + this._snkDataUnit.entityName, dataUnit: this._dataUnit, config: this.getFormConfig(), recordsValidator: this.recordsValidator }))))));
|
|
101
|
+
}
|
|
102
|
+
static get is() { return "snk-form"; }
|
|
103
|
+
static get encapsulation() { return "scoped"; }
|
|
104
|
+
static get originalStyleUrls() { return {
|
|
105
|
+
"$": ["snk-form.css"]
|
|
106
|
+
}; }
|
|
107
|
+
static get styleUrls() { return {
|
|
108
|
+
"$": ["snk-form.css"]
|
|
109
|
+
}; }
|
|
110
|
+
static get properties() { return {
|
|
111
|
+
"formTitle": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"mutable": false,
|
|
114
|
+
"complexType": {
|
|
115
|
+
"original": "string",
|
|
116
|
+
"resolved": "string",
|
|
117
|
+
"references": {}
|
|
118
|
+
},
|
|
119
|
+
"required": false,
|
|
120
|
+
"optional": false,
|
|
121
|
+
"docs": {
|
|
122
|
+
"tags": [],
|
|
123
|
+
"text": "Texto que aparece de forma descritiva no cabe\u00E7alho do form"
|
|
124
|
+
},
|
|
125
|
+
"attribute": "form-title",
|
|
126
|
+
"reflect": false
|
|
127
|
+
},
|
|
128
|
+
"configName": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"mutable": false,
|
|
131
|
+
"complexType": {
|
|
132
|
+
"original": "string",
|
|
133
|
+
"resolved": "string",
|
|
134
|
+
"references": {}
|
|
135
|
+
},
|
|
136
|
+
"required": false,
|
|
137
|
+
"optional": false,
|
|
138
|
+
"docs": {
|
|
139
|
+
"tags": [],
|
|
140
|
+
"text": "Nome usado para guardar/recuperar as configura\u00E7\u00F5es do formul\u00E1rio"
|
|
141
|
+
},
|
|
142
|
+
"attribute": "config-name",
|
|
143
|
+
"reflect": false
|
|
144
|
+
},
|
|
145
|
+
"recordsValidator": {
|
|
146
|
+
"type": "any",
|
|
147
|
+
"mutable": false,
|
|
148
|
+
"complexType": {
|
|
149
|
+
"original": "RecordValidator",
|
|
150
|
+
"resolved": "RecordValidator",
|
|
151
|
+
"references": {
|
|
152
|
+
"RecordValidator": {
|
|
153
|
+
"location": "import",
|
|
154
|
+
"path": "@sankhyalabs/ezui/dist/types/components/ez-form/ez-form"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"required": false,
|
|
159
|
+
"optional": false,
|
|
160
|
+
"docs": {
|
|
161
|
+
"tags": [],
|
|
162
|
+
"text": "Validador respons\u00E1vel por checar a integridade das informa\u00E7\u00F5es do registro"
|
|
163
|
+
},
|
|
164
|
+
"attribute": "records-validator",
|
|
165
|
+
"reflect": false
|
|
166
|
+
},
|
|
167
|
+
"actionsList": {
|
|
168
|
+
"type": "unknown",
|
|
169
|
+
"mutable": false,
|
|
170
|
+
"complexType": {
|
|
171
|
+
"original": "Array<Action>",
|
|
172
|
+
"resolved": "Action[]",
|
|
173
|
+
"references": {
|
|
174
|
+
"Array": {
|
|
175
|
+
"location": "global"
|
|
176
|
+
},
|
|
177
|
+
"Action": {
|
|
178
|
+
"location": "import",
|
|
179
|
+
"path": "../snk-taskbar/snk-taskbar"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"required": false,
|
|
184
|
+
"optional": false,
|
|
185
|
+
"docs": {
|
|
186
|
+
"tags": [],
|
|
187
|
+
"text": "Lista de a\u00E7\u00F5es que devem ser usadas no bot\u00E3o \"Mais op\u00E7\u00F5es\""
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}; }
|
|
191
|
+
static get states() { return {
|
|
192
|
+
"_dataUnit": {},
|
|
193
|
+
"_configLoaded": {},
|
|
194
|
+
"_dataState": {},
|
|
195
|
+
"_editionFormConfig": {},
|
|
196
|
+
"_insertionFormConfig": {}
|
|
197
|
+
}; }
|
|
198
|
+
static get events() { return [{
|
|
199
|
+
"method": "exit",
|
|
200
|
+
"name": "exit",
|
|
201
|
+
"bubbles": true,
|
|
202
|
+
"cancelable": true,
|
|
203
|
+
"composed": true,
|
|
204
|
+
"docs": {
|
|
205
|
+
"tags": [],
|
|
206
|
+
"text": "Emitido quando o bot\u00E3o de voltar \u00E9 acionado"
|
|
207
|
+
},
|
|
208
|
+
"complexType": {
|
|
209
|
+
"original": "void",
|
|
210
|
+
"resolved": "void",
|
|
211
|
+
"references": {}
|
|
212
|
+
}
|
|
213
|
+
}, {
|
|
214
|
+
"method": "actionClick",
|
|
215
|
+
"name": "actionClick",
|
|
216
|
+
"bubbles": true,
|
|
217
|
+
"cancelable": true,
|
|
218
|
+
"composed": true,
|
|
219
|
+
"docs": {
|
|
220
|
+
"tags": [],
|
|
221
|
+
"text": "Emitido sempre que houver click de bot\u00E3o ou a\u00E7\u00E3o"
|
|
222
|
+
},
|
|
223
|
+
"complexType": {
|
|
224
|
+
"original": "string",
|
|
225
|
+
"resolved": "string",
|
|
226
|
+
"references": {}
|
|
227
|
+
}
|
|
228
|
+
}]; }
|
|
229
|
+
static get elementRef() { return "_element"; }
|
|
230
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { ApplicationContext } from '@sankhyalabs/core';
|
|
2
|
+
import { Component, Element, h, Prop, State, Event } from '@stencil/core';
|
|
3
|
+
import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
|
|
4
|
+
export class SnkGrid {
|
|
5
|
+
getHeaderButtons() {
|
|
6
|
+
return this._dataState && this._dataState.selectedRecords.length > 0 ? "UPDATE,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,REFRESH" : "REFRESH";
|
|
7
|
+
}
|
|
8
|
+
actionClickHandler(evt) {
|
|
9
|
+
if (evt.detail === TaskbarElement.CONFIG_GRID && this._grid) {
|
|
10
|
+
this._grid.openGridConfig();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
saveConfig(config) {
|
|
14
|
+
const snkApplication = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
15
|
+
if (snkApplication) {
|
|
16
|
+
snkApplication.saveGridConfig(config);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
componentWillLoad() {
|
|
20
|
+
const snkApplication = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
21
|
+
if (snkApplication) {
|
|
22
|
+
snkApplication.loadGridConfig(this.configName).then(cfg => {
|
|
23
|
+
this._gridConfig = cfg;
|
|
24
|
+
this._configLoaded = true;
|
|
25
|
+
});
|
|
26
|
+
//Forçamos a carga dos acessos pra aproveitar a request inicial.
|
|
27
|
+
snkApplication.getAllAccess();
|
|
28
|
+
}
|
|
29
|
+
let parent = this._element.parentElement;
|
|
30
|
+
while (parent) {
|
|
31
|
+
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
32
|
+
this._snkDataUnit = parent;
|
|
33
|
+
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
34
|
+
if (!this._dataUnit) {
|
|
35
|
+
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
36
|
+
this._dataUnit = evt.detail;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
|
|
40
|
+
this._dataState = evt.detail;
|
|
41
|
+
});
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
parent = parent.parentElement;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
render() {
|
|
48
|
+
if (!this._configLoaded || !this._dataUnit) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
return (h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" },
|
|
52
|
+
h("div", { class: "ez-row ez-padding-bottom--medium ez-margin-bottom--medium" },
|
|
53
|
+
h("div", { class: "ez-col ez-col--sd-9 ez-col--tb-9 ez-align--bottom" },
|
|
54
|
+
h("slot", null)),
|
|
55
|
+
h("div", { class: "ez-col ez-col--sd-3 ez-col--tb-3 ez-align--right" },
|
|
56
|
+
h("snk-taskbar", { onActionClick: evt => this.actionClickHandler(evt), key: "topTaskbar", dataUnit: this._dataUnit, buttons: "FORM_MODE,CONFIG_GRID,INSERT", primaryButton: "INSERT" }))),
|
|
57
|
+
h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: evt => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit() },
|
|
58
|
+
h("snk-taskbar", { dataUnit: this._dataUnit, buttons: this.getHeaderButtons(), slot: "leftButtons", actionsList: this.actionsList }))));
|
|
59
|
+
}
|
|
60
|
+
static get is() { return "snk-grid"; }
|
|
61
|
+
static get encapsulation() { return "scoped"; }
|
|
62
|
+
static get originalStyleUrls() { return {
|
|
63
|
+
"$": ["snk-grid.css"]
|
|
64
|
+
}; }
|
|
65
|
+
static get styleUrls() { return {
|
|
66
|
+
"$": ["snk-grid.css"]
|
|
67
|
+
}; }
|
|
68
|
+
static get properties() { return {
|
|
69
|
+
"configName": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"mutable": false,
|
|
72
|
+
"complexType": {
|
|
73
|
+
"original": "string",
|
|
74
|
+
"resolved": "string",
|
|
75
|
+
"references": {}
|
|
76
|
+
},
|
|
77
|
+
"required": false,
|
|
78
|
+
"optional": false,
|
|
79
|
+
"docs": {
|
|
80
|
+
"tags": [],
|
|
81
|
+
"text": "Nome usado para salvar/recuperar a configura\u00E7\u00E3o"
|
|
82
|
+
},
|
|
83
|
+
"attribute": "config-name",
|
|
84
|
+
"reflect": false
|
|
85
|
+
},
|
|
86
|
+
"actionsList": {
|
|
87
|
+
"type": "unknown",
|
|
88
|
+
"mutable": false,
|
|
89
|
+
"complexType": {
|
|
90
|
+
"original": "Array<Action>",
|
|
91
|
+
"resolved": "Action[]",
|
|
92
|
+
"references": {
|
|
93
|
+
"Array": {
|
|
94
|
+
"location": "global"
|
|
95
|
+
},
|
|
96
|
+
"Action": {
|
|
97
|
+
"location": "import",
|
|
98
|
+
"path": "../snk-taskbar/snk-taskbar"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"required": false,
|
|
103
|
+
"optional": false,
|
|
104
|
+
"docs": {
|
|
105
|
+
"tags": [],
|
|
106
|
+
"text": "Lista de a\u00E7\u00F5es que devem ser usadas no bot\u00E3o \"Mais op\u00E7\u00F5es\""
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}; }
|
|
110
|
+
static get states() { return {
|
|
111
|
+
"_dataUnit": {},
|
|
112
|
+
"_configLoaded": {},
|
|
113
|
+
"_dataState": {},
|
|
114
|
+
"_gridConfig": {}
|
|
115
|
+
}; }
|
|
116
|
+
static get events() { return [{
|
|
117
|
+
"method": "actionClick",
|
|
118
|
+
"name": "actionClick",
|
|
119
|
+
"bubbles": true,
|
|
120
|
+
"cancelable": true,
|
|
121
|
+
"composed": true,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": "Emitido sempre que houver click de bot\u00E3o ou a\u00E7\u00E3o"
|
|
125
|
+
},
|
|
126
|
+
"complexType": {
|
|
127
|
+
"original": "string",
|
|
128
|
+
"resolved": "string",
|
|
129
|
+
"references": {}
|
|
130
|
+
}
|
|
131
|
+
}, {
|
|
132
|
+
"method": "gridDoubleClick",
|
|
133
|
+
"name": "gridDoubleClick",
|
|
134
|
+
"bubbles": true,
|
|
135
|
+
"cancelable": true,
|
|
136
|
+
"composed": true,
|
|
137
|
+
"docs": {
|
|
138
|
+
"tags": [],
|
|
139
|
+
"text": "Emitido sempre que houver duplo click na grade"
|
|
140
|
+
},
|
|
141
|
+
"complexType": {
|
|
142
|
+
"original": "void",
|
|
143
|
+
"resolved": "void",
|
|
144
|
+
"references": {}
|
|
145
|
+
}
|
|
146
|
+
}]; }
|
|
147
|
+
static get elementRef() { return "_element"; }
|
|
148
|
+
}
|
|
@@ -1,30 +1,39 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
/* general */
|
|
2
3
|
/*@doc Define o tamanho da fonte do componente.*/
|
|
3
4
|
--snk-pesquisa--font-size: var(--text--medium, 14px);
|
|
4
|
-
|
|
5
5
|
/*@doc Define a família da fonte do componente.*/
|
|
6
6
|
--snk-pesquisa--font-family: var(--font-pattern, Arial);
|
|
7
|
-
|
|
8
7
|
/*@doc Define o peso da fonte do componente.*/
|
|
9
8
|
--snk-pesquisa--font-weight: var(--text-weight--medium, 400);
|
|
10
9
|
|
|
10
|
+
/* records */
|
|
11
11
|
/*@doc Define a cor da fonte do indicador de registros do componente.*/
|
|
12
12
|
--snk-pesquisa__records--color: var(--text--primary, #626e82);
|
|
13
|
-
|
|
14
13
|
/*@doc Define o espaçamento vertical do indicador de registros do componente.*/
|
|
15
14
|
--snk-pesquisa__records--padding-vertical: var(--space--medium, 12px);
|
|
16
15
|
|
|
16
|
+
/* content */
|
|
17
17
|
/*@doc Define o espaçamento da direita no conteúdo do componente.*/
|
|
18
18
|
--snk-pesquisa__content--padding-right: var(--space--small, 6px);
|
|
19
19
|
|
|
20
|
+
/* scrollbar */
|
|
20
21
|
/*@doc Define a cor da barra de rolagem do componente.*/
|
|
21
|
-
--snk-pesquisa__content-scrollbar--background-color: var(--
|
|
22
|
-
|
|
22
|
+
--snk-pesquisa__content-scrollbar--background-color-primary: var(--scrollbar--primary, #2B3A54);
|
|
23
|
+
/*@doc Define a cor de fundo da barra de rolagem do componente.*/
|
|
24
|
+
--snk-pesquisa__content-scrollbar--background-color-secondary: var(--scrollbar--secondary, #E5EAF0);
|
|
23
25
|
/*@doc Define o raio da borda da barra de rolagem do componente.*/
|
|
24
|
-
--snk-pesquisa__content-scrollbar--border-radius: var(--border--radius-
|
|
25
|
-
|
|
26
|
+
--snk-pesquisa__content-scrollbar--border-radius: var(--border--radius-small, 6px);
|
|
26
27
|
/*@doc Define a largura da barra de rolagem do componente.*/
|
|
27
|
-
--snk-pesquisa__content-scrollbar--width: var(--space--medium, 12px)
|
|
28
|
+
--snk-pesquisa__content-scrollbar--width: var(--space--medium, 12px);
|
|
29
|
+
|
|
30
|
+
/* buttons */
|
|
31
|
+
/*@doc Define a cor do botão de pesquisa do componente.*/
|
|
32
|
+
--snk-pesquisa__btn--color: var(--title--primary, #2B3A54);
|
|
33
|
+
/*@doc Define a cor do botão de pesquisa do componente quando desabilitado.*/
|
|
34
|
+
--snk-pesquisa__btn-disabled--color: var(--text--disable, #AFB6C0);
|
|
35
|
+
/*@doc Define a cor do botão de pesquisa do componente quando o mouse está sobre ele.*/
|
|
36
|
+
--snk-pesquisa__btn-hover--color: var(--color--primary, #4e4e4e);
|
|
28
37
|
|
|
29
38
|
max-height: 100%;
|
|
30
39
|
height: 100%;
|
|
@@ -47,8 +56,11 @@
|
|
|
47
56
|
padding-right: 4px;
|
|
48
57
|
}
|
|
49
58
|
|
|
50
|
-
.snk-pesquisa__input-
|
|
51
|
-
|
|
59
|
+
.snk-pesquisa__input ez-icon {
|
|
60
|
+
--ez-icon--color: inherit;
|
|
61
|
+
|
|
62
|
+
/*public*/
|
|
63
|
+
font-weight: var(--text-weight--large, 600);
|
|
52
64
|
}
|
|
53
65
|
|
|
54
66
|
.snk-pesquisa__content {
|
|
@@ -56,13 +68,15 @@
|
|
|
56
68
|
flex-direction: column;
|
|
57
69
|
height: 100%;
|
|
58
70
|
overflow-y: auto;
|
|
71
|
+
scrollbar-width: thin;
|
|
59
72
|
|
|
60
73
|
/*public*/
|
|
74
|
+
scrollbar-color: var(--snk-pesquisa__content-scrollbar--background-color-primary) var(--snk-pesquisa__content-scrollbar--background-color-secondary);
|
|
61
75
|
padding-right: var(--snk-pesquisa__content--padding-right);
|
|
62
76
|
}
|
|
63
77
|
|
|
64
78
|
.snk-pesquisa__content::-webkit-scrollbar-track {
|
|
65
|
-
background-color:
|
|
79
|
+
background-color: var(--snk-pesquisa__content-scrollbar--background-color-secondary);
|
|
66
80
|
|
|
67
81
|
/*public*/
|
|
68
82
|
border-radius: var(--snk-pesquisa__content-scrollbar--border-radius);
|
|
@@ -70,12 +84,12 @@
|
|
|
70
84
|
|
|
71
85
|
.snk-pesquisa__content::-webkit-scrollbar-thumb {
|
|
72
86
|
/*public*/
|
|
73
|
-
background-color: var(--snk-pesquisa__content-scrollbar--background-color);
|
|
87
|
+
background-color: var(--snk-pesquisa__content-scrollbar--background-color-primary);
|
|
74
88
|
border-radius: var(--snk-pesquisa__content-scrollbar--border-radius);
|
|
75
89
|
}
|
|
76
90
|
|
|
77
91
|
.snk-pesquisa__content::-webkit-scrollbar {
|
|
78
|
-
background-color:
|
|
92
|
+
background-color: var(--snk-pesquisa__content-scrollbar--background-color-secondary);
|
|
79
93
|
|
|
80
94
|
/*public*/
|
|
81
95
|
width: var(--snk-pesquisa__content-scrollbar--width);
|
|
@@ -91,4 +105,33 @@
|
|
|
91
105
|
color: var(--snk-pesquisa__records--color);
|
|
92
106
|
padding-bottom: var(--snk-pesquisa__records--padding-vertical);
|
|
93
107
|
padding-top: var(--snk-pesquisa__records--padding-vertical);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.snk-pesquisa__btn {
|
|
111
|
+
outline: none;
|
|
112
|
+
border: none;
|
|
113
|
+
background: none;
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
|
|
116
|
+
/*public*/
|
|
117
|
+
color: var(--snk-pesquisa__btn--color);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.snk-pesquisa__btn:disabled {
|
|
121
|
+
cursor: unset;
|
|
122
|
+
|
|
123
|
+
/*public*/
|
|
124
|
+
color: var(--snk-pesquisa__btn-disabled--color);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.snk-pesquisa__btn:disabled:hover {
|
|
128
|
+
cursor: unset;
|
|
129
|
+
|
|
130
|
+
/*public*/
|
|
131
|
+
color: var(--snk-pesquisa__btn-disabled--color);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.snk-pesquisa__btn:hover {
|
|
135
|
+
/*public*/
|
|
136
|
+
color: var(--snk-pesquisa__btn-hover--color);
|
|
94
137
|
}
|
|
@@ -291,12 +291,16 @@ export class SnkPesquisa {
|
|
|
291
291
|
: 'Os resultados de sua pesquisa aparecerão aqui...';
|
|
292
292
|
}
|
|
293
293
|
render() {
|
|
294
|
+
var _a;
|
|
294
295
|
return (h(Host, null,
|
|
295
296
|
h("div", { class: "snk-pesquisa" },
|
|
296
297
|
h("div", { class: "snk-pesquisa__input" },
|
|
297
298
|
h("ez-text-input", { label: "Buscar", class: "ez-margin-right--medium", canShowError: false, ref: (ref) => this._textInput = ref, onEzChange: (event) => this.onChangeValue(event), value: this.argument },
|
|
298
299
|
h("ez-icon", { slot: "leftIcon", iconName: "search" }),
|
|
299
|
-
|
|
300
|
+
this.argument && ((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value)
|
|
301
|
+
? h("button", { slot: "rightIcon", class: "snk-pesquisa__btn", onClick: () => this.clearSearch() },
|
|
302
|
+
h("ez-icon", { iconName: "close" }))
|
|
303
|
+
: undefined),
|
|
300
304
|
h("ez-button", { class: "ez-button--primary", label: "Pesquisar", onClick: () => this.onClickSearch() })),
|
|
301
305
|
h("label", { class: "snk-pesquisa__records" }, this.getMessageView()),
|
|
302
306
|
h("div", { class: "snk-pesquisa__content" }, this._itemList && this._itemList.map((item) => {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export var TaskbarElement;
|
|
3
|
+
(function (TaskbarElement) {
|
|
4
|
+
TaskbarElement["PREVIOUS"] = "PREVIOUS";
|
|
5
|
+
TaskbarElement["NEXT"] = "NEXT";
|
|
6
|
+
TaskbarElement["REFRESH"] = "REFRESH";
|
|
7
|
+
TaskbarElement["UPDATE"] = "UPDATE";
|
|
8
|
+
TaskbarElement["CLONE"] = "CLONE";
|
|
9
|
+
TaskbarElement["REMOVE"] = "REMOVE";
|
|
10
|
+
TaskbarElement["INSERT"] = "INSERT";
|
|
11
|
+
TaskbarElement["CANCEL"] = "CANCEL";
|
|
12
|
+
TaskbarElement["SAVE"] = "SAVE";
|
|
13
|
+
TaskbarElement["GRID_MODE"] = "GRID_MODE";
|
|
14
|
+
TaskbarElement["FORM_MODE"] = "FORM_MODE";
|
|
15
|
+
TaskbarElement["CONFIG_GRID"] = "CONFIG_GRID";
|
|
16
|
+
TaskbarElement["MORE_OPTIONS"] = "MORE_OPTIONS";
|
|
17
|
+
TaskbarElement["DIVIDER"] = "DIVIDER";
|
|
18
|
+
})(TaskbarElement || (TaskbarElement = {}));
|
|
19
|
+
export var AuthorizationElements;
|
|
20
|
+
(function (AuthorizationElements) {
|
|
21
|
+
AuthorizationElements["UPDATE"] = "UPDATE";
|
|
22
|
+
AuthorizationElements["CLONE"] = "CLONE";
|
|
23
|
+
AuthorizationElements["REMOVE"] = "REMOVE";
|
|
24
|
+
AuthorizationElements["INSERT"] = "INSERT";
|
|
25
|
+
AuthorizationElements["CONFIG_GRID"] = "CONFIG_GRID";
|
|
26
|
+
})(AuthorizationElements || (AuthorizationElements = {}));
|
|
27
|
+
export const buildElem = (element, className, getTitle, action, isEnabled, actions) => {
|
|
28
|
+
switch (element) {
|
|
29
|
+
case TaskbarElement.PREVIOUS:
|
|
30
|
+
return iconButton("chevron-left", element, className, getTitle, action, isEnabled);
|
|
31
|
+
case TaskbarElement.NEXT:
|
|
32
|
+
return iconButton("chevron-right", element, className, getTitle, action, isEnabled);
|
|
33
|
+
case TaskbarElement.REFRESH:
|
|
34
|
+
return iconButton("sync", element, className, getTitle, action, isEnabled);
|
|
35
|
+
case TaskbarElement.UPDATE:
|
|
36
|
+
return iconButton("edit", element, className, getTitle, action, isEnabled);
|
|
37
|
+
case TaskbarElement.CLONE:
|
|
38
|
+
return iconButton("copy", element, className, getTitle, action, isEnabled);
|
|
39
|
+
case TaskbarElement.REMOVE:
|
|
40
|
+
return iconButton("delete", element, className, getTitle, action, isEnabled);
|
|
41
|
+
case TaskbarElement.INSERT:
|
|
42
|
+
return iconTextButton("plus", element, className, getTitle, action, isEnabled);
|
|
43
|
+
case TaskbarElement.CANCEL:
|
|
44
|
+
return h("ez-button", { label: getTitle(element), size: "small", enabled: isEnabled(element), onClick: () => action(element) });
|
|
45
|
+
case TaskbarElement.SAVE:
|
|
46
|
+
return iconTextButton("save", element, className, getTitle, action, isEnabled);
|
|
47
|
+
case TaskbarElement.GRID_MODE:
|
|
48
|
+
return iconButton("table", element, className, getTitle, action, isEnabled);
|
|
49
|
+
case TaskbarElement.FORM_MODE:
|
|
50
|
+
return iconButton("list", element, className, getTitle, action, isEnabled);
|
|
51
|
+
case TaskbarElement.CONFIG_GRID:
|
|
52
|
+
return iconButton("settings-inverted", element, className, getTitle, action, isEnabled);
|
|
53
|
+
case TaskbarElement.MORE_OPTIONS:
|
|
54
|
+
return actions && actions.length > 0 ? h("ez-actions-button", { title: getTitle(element), size: "small", class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions }) : undefined;
|
|
55
|
+
case TaskbarElement.DIVIDER:
|
|
56
|
+
return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium" });
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
function iconButton(iconName, element, className, getTitle, action, isEnabled) {
|
|
60
|
+
return h("ez-button", { key: iconName, title: getTitle(element), mode: "icon", size: "small", class: className, iconName: iconName, enabled: isEnabled(element), onClick: () => action(element) });
|
|
61
|
+
}
|
|
62
|
+
function iconTextButton(iconName, element, className, getTitle, action, isEnabled) {
|
|
63
|
+
return h("ez-button", { key: iconName, title: getTitle(element), label: getTitle(element), size: "small", class: className, enabled: isEnabled(element), onClick: () => action(element) },
|
|
64
|
+
h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
|
|
65
|
+
}
|