@sankhyalabs/sankhyablocks 2.10.0 → 2.11.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/index-9c584423.js +7 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +0 -7
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator_3.cjs.entry.js +24 -9
- package/dist/cjs/snk-crud.cjs.entry.js +19 -5
- package/dist/cjs/snk-data-exporter_8.cjs.entry.js +21 -7
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form.cjs.entry.js +58 -22
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/cjs/{taskbar-elements-bbb89cdb.js → taskbar-elements-89bf9399.js} +14 -3
- package/dist/collection/components/snk-crud/snk-crud.js +41 -4
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.css +3 -1
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +4 -2
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
- package/dist/collection/components/snk-form/snk-form.css +1 -1
- package/dist/collection/components/snk-form/snk-form.js +80 -21
- package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.css +8 -1
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.css +42 -19
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.css +92 -40
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.css +96 -45
- package/dist/collection/components/snk-grid/snk-grid.js +44 -6
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +14 -3
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +37 -2
- package/dist/collection/lib/@types/index.js +5 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +0 -7
- package/dist/components/snk-application2.js +0 -7
- package/dist/components/snk-config-options2.js +1 -1
- package/dist/components/snk-crud.js +20 -6
- package/dist/components/snk-data-exporter2.js +5 -3
- package/dist/components/snk-field-config2.js +1 -1
- package/dist/components/snk-filter-bar2.js +1 -1
- package/dist/components/snk-filter-item2.js +1 -1
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-form2.js +59 -23
- package/dist/components/snk-grid2.js +23 -8
- package/dist/components/snk-tab-config2.js +1 -1
- package/dist/components/snk-taskbar2.js +33 -5
- package/dist/esm/index-de5f37a6.js +7 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +0 -7
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator_3.entry.js +22 -7
- package/dist/esm/snk-crud.entry.js +20 -6
- package/dist/esm/snk-data-exporter_8.entry.js +21 -7
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +58 -22
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/{taskbar-elements-beec3b27.js → taskbar-elements-c8966343.js} +14 -3
- package/dist/sankhyablocks/{p-b84c7c61.entry.js → p-014615a3.entry.js} +1 -8
- package/dist/sankhyablocks/p-01c361bb.entry.js +1 -0
- package/dist/sankhyablocks/p-05fadb77.js +1 -0
- package/dist/sankhyablocks/p-3ee68d78.entry.js +1 -0
- package/dist/sankhyablocks/p-420d07c4.js +1 -0
- package/dist/sankhyablocks/p-4a5c1d36.entry.js +1 -0
- package/dist/sankhyablocks/{p-3cb9f3ad.entry.js → p-4c759619.entry.js} +1 -1
- package/dist/sankhyablocks/p-9b858e3a.entry.js +1 -0
- package/dist/sankhyablocks/p-a65d6ba3.entry.js +1 -0
- package/dist/sankhyablocks/p-cd19bd29.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +8 -1
- package/dist/types/components/snk-form/snk-form.d.ts +10 -1
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +2 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +6 -0
- package/dist/types/components.d.ts +35 -2
- package/dist/types/lib/@types/index.d.ts +4 -0
- package/dist/types/lib/store/index.d.ts +4 -3
- package/package.json +1 -1
- package/dist/sankhyablocks/p-13116d05.entry.js +0 -1
- package/dist/sankhyablocks/p-4ca32c86.entry.js +0 -1
- package/dist/sankhyablocks/p-6617d349.entry.js +0 -1
- package/dist/sankhyablocks/p-82e20fc0.entry.js +0 -1
- package/dist/sankhyablocks/p-9d474bc0.entry.js +0 -1
- package/dist/sankhyablocks/p-c8327a5c.js +0 -1
- package/dist/sankhyablocks/p-fc77347c.entry.js +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
2
|
import { ApplicationContext, DataType, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
4
|
-
import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
|
|
5
4
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
|
5
|
+
import { PresentationMode } from '../../lib/@types';
|
|
6
|
+
import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
|
|
6
7
|
import store from "../../lib/store";
|
|
7
8
|
export class SnkGrid {
|
|
8
9
|
constructor() {
|
|
@@ -18,6 +19,10 @@ export class SnkGrid {
|
|
|
18
19
|
* Determina se haverá exportação de dados
|
|
19
20
|
*/
|
|
20
21
|
this.enableDataExporter = false;
|
|
22
|
+
/**
|
|
23
|
+
* Altera o modo de apresentação dos botões do snk-taskbar.
|
|
24
|
+
*/
|
|
25
|
+
this.presentationMode = PresentationMode.PRIMARY;
|
|
21
26
|
}
|
|
22
27
|
/**
|
|
23
28
|
* Exibe a janela de configurações da grade.
|
|
@@ -137,6 +142,19 @@ export class SnkGrid {
|
|
|
137
142
|
};
|
|
138
143
|
store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
|
|
139
144
|
}
|
|
145
|
+
getPrimaryButton() {
|
|
146
|
+
return this.presentationMode === PresentationMode.PRIMARY ? "INSERT" : "";
|
|
147
|
+
}
|
|
148
|
+
validatePresentationMode() {
|
|
149
|
+
if (Object.values(PresentationMode).includes(this.presentationMode)) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
this.presentationMode = PresentationMode.PRIMARY;
|
|
153
|
+
}
|
|
154
|
+
addElementID() {
|
|
155
|
+
const dataInfo = { dataUnit: this._dataUnit };
|
|
156
|
+
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
157
|
+
}
|
|
140
158
|
componentWillLoad() {
|
|
141
159
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
142
160
|
let parent = this._element.parentElement;
|
|
@@ -168,16 +186,13 @@ export class SnkGrid {
|
|
|
168
186
|
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
|
169
187
|
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
|
170
188
|
this.dataExporterProviderStore();
|
|
171
|
-
|
|
172
|
-
addElementID() {
|
|
173
|
-
const dataInfo = { dataUnit: this._dataUnit };
|
|
174
|
-
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
189
|
+
this.validatePresentationMode();
|
|
175
190
|
}
|
|
176
191
|
render() {
|
|
177
192
|
if (!this._dataUnit) {
|
|
178
193
|
return undefined;
|
|
179
194
|
}
|
|
180
|
-
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton:
|
|
195
|
+
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton() })), h("ez-grid", { ref: ref => this._grid = ref, "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
181
196
|
}
|
|
182
197
|
static get is() { return "snk-grid"; }
|
|
183
198
|
static get encapsulation() { return "scoped"; }
|
|
@@ -307,6 +322,29 @@ export class SnkGrid {
|
|
|
307
322
|
"attribute": "enable-data-exporter",
|
|
308
323
|
"reflect": false,
|
|
309
324
|
"defaultValue": "false"
|
|
325
|
+
},
|
|
326
|
+
"presentationMode": {
|
|
327
|
+
"type": "string",
|
|
328
|
+
"mutable": false,
|
|
329
|
+
"complexType": {
|
|
330
|
+
"original": "PresentationMode",
|
|
331
|
+
"resolved": "PresentationMode.PRIMARY | PresentationMode.SECONDARY",
|
|
332
|
+
"references": {
|
|
333
|
+
"PresentationMode": {
|
|
334
|
+
"location": "import",
|
|
335
|
+
"path": "../../lib/@types"
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
"required": false,
|
|
340
|
+
"optional": false,
|
|
341
|
+
"docs": {
|
|
342
|
+
"tags": [],
|
|
343
|
+
"text": "Altera o modo de apresenta\u00E7\u00E3o dos bot\u00F5es do snk-taskbar."
|
|
344
|
+
},
|
|
345
|
+
"attribute": "presentation-mode",
|
|
346
|
+
"reflect": false,
|
|
347
|
+
"defaultValue": "PresentationMode.PRIMARY"
|
|
310
348
|
}
|
|
311
349
|
};
|
|
312
350
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import { PresentationMode } from "../../../lib/@types";
|
|
2
3
|
import store from "../../../lib/store";
|
|
3
4
|
export var TaskbarElement;
|
|
4
5
|
(function (TaskbarElement) {
|
|
@@ -44,7 +45,7 @@ export const buildCustomButton = (def, className, dataElementId, action, isEnabl
|
|
|
44
45
|
return textButton(def.name, className, dataElementId, text, hint, action, isEnabled);
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
|
-
export const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions, configName) => {
|
|
48
|
+
export const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions, configName, presentationMode) => {
|
|
48
49
|
var _a;
|
|
49
50
|
const title = getTitle(element);
|
|
50
51
|
switch (element) {
|
|
@@ -61,11 +62,21 @@ export const buildElem = (element, className, dataElementId, getTitle, action, i
|
|
|
61
62
|
case TaskbarElement.REMOVE:
|
|
62
63
|
return iconButton("delete", element, className, dataElementId, title, action, isEnabled);
|
|
63
64
|
case TaskbarElement.INSERT:
|
|
64
|
-
|
|
65
|
+
if (presentationMode === PresentationMode.PRIMARY) {
|
|
66
|
+
return iconTextButton("plus", element, className, dataElementId, title, title, action, isEnabled);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
return iconButton("plus", element, className, dataElementId, title, action, isEnabled);
|
|
70
|
+
}
|
|
65
71
|
case TaskbarElement.CANCEL:
|
|
66
72
|
return textButton(element, className, dataElementId, title, title, action, isEnabled);
|
|
67
73
|
case TaskbarElement.SAVE:
|
|
68
|
-
|
|
74
|
+
if (presentationMode === PresentationMode.PRIMARY) {
|
|
75
|
+
return iconTextButton("save", element, className, dataElementId, title, title, action, isEnabled);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
return iconButton("save", element, className, dataElementId, title, action, isEnabled);
|
|
79
|
+
}
|
|
69
80
|
case TaskbarElement.GRID_MODE:
|
|
70
81
|
return iconButton("table", element, className, dataElementId, title, action, isEnabled);
|
|
71
82
|
case TaskbarElement.FORM_MODE:
|
|
@@ -2,8 +2,13 @@ import { ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/co
|
|
|
2
2
|
import { h, Host } from '@stencil/core';
|
|
3
3
|
import { AuthorizationConfig } from '../snk-configurator/AuthorizationConfig';
|
|
4
4
|
import { TaskbarElement, buildElem, AuthorizationElements, buildCustomButton, VisibleWhenForbidden } from './elements/taskbar-elements';
|
|
5
|
+
import { PresentationMode } from '../../lib/@types';
|
|
5
6
|
export class SnkTaskbar {
|
|
6
7
|
constructor() {
|
|
8
|
+
/**
|
|
9
|
+
* Altera o modo de apresentação dos botões do snk-taskbar.
|
|
10
|
+
*/
|
|
11
|
+
this.presentationMode = PresentationMode.PRIMARY;
|
|
7
12
|
this._titleKeyByElement = {
|
|
8
13
|
[TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
|
|
9
14
|
[TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
|
|
@@ -103,13 +108,19 @@ export class SnkTaskbar {
|
|
|
103
108
|
}
|
|
104
109
|
return !(this.disabledButtons && this.disabledButtons.includes(elem));
|
|
105
110
|
}
|
|
111
|
+
validatePresentationMode() {
|
|
112
|
+
if (Object.values(PresentationMode).includes(this.presentationMode)) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
this.presentationMode = PresentationMode.PRIMARY;
|
|
116
|
+
}
|
|
106
117
|
getElement(index, def) {
|
|
107
118
|
let className = def === this.primaryButton ? "ez-button--primary " : "";
|
|
108
119
|
if (index > 1) {
|
|
109
120
|
className += "ez-padding-left--medium";
|
|
110
121
|
}
|
|
111
122
|
if (TaskbarElement[def.toString()]) {
|
|
112
|
-
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList, this.configName);
|
|
123
|
+
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList, this.configName, this.presentationMode);
|
|
113
124
|
}
|
|
114
125
|
else {
|
|
115
126
|
return buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
@@ -154,6 +165,7 @@ export class SnkTaskbar {
|
|
|
154
165
|
if (this._definitions == undefined && this._permissions) {
|
|
155
166
|
this._definitions = this.elementsFromString(this.buttons);
|
|
156
167
|
}
|
|
168
|
+
this.validatePresentationMode();
|
|
157
169
|
}
|
|
158
170
|
componentDidLoad() {
|
|
159
171
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
@@ -247,7 +259,7 @@ export class SnkTaskbar {
|
|
|
247
259
|
"optional": false,
|
|
248
260
|
"docs": {
|
|
249
261
|
"tags": [],
|
|
250
|
-
"text": "Mapa com defini\u00E7\u00E3o de bot\u00F5es personalizados. A chave do mapa deve ser
|
|
262
|
+
"text": "Mapa com defini\u00E7\u00E3o de bot\u00F5es personalizados. A chave do mapa deve ser\npassada na lista \"buttons\" no lugar onde o bot\u00E3o ir\u00E1 aparecer."
|
|
251
263
|
}
|
|
252
264
|
},
|
|
253
265
|
"actionsList": {
|
|
@@ -327,6 +339,29 @@ export class SnkTaskbar {
|
|
|
327
339
|
"tags": [],
|
|
328
340
|
"text": "Inst\u00E2ncia do DataUnit."
|
|
329
341
|
}
|
|
342
|
+
},
|
|
343
|
+
"presentationMode": {
|
|
344
|
+
"type": "string",
|
|
345
|
+
"mutable": true,
|
|
346
|
+
"complexType": {
|
|
347
|
+
"original": "PresentationMode",
|
|
348
|
+
"resolved": "PresentationMode.PRIMARY | PresentationMode.SECONDARY",
|
|
349
|
+
"references": {
|
|
350
|
+
"PresentationMode": {
|
|
351
|
+
"location": "import",
|
|
352
|
+
"path": "../../lib/@types"
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
"required": false,
|
|
357
|
+
"optional": false,
|
|
358
|
+
"docs": {
|
|
359
|
+
"tags": [],
|
|
360
|
+
"text": "Altera o modo de apresenta\u00E7\u00E3o dos bot\u00F5es do snk-taskbar."
|
|
361
|
+
},
|
|
362
|
+
"attribute": "presentation-mode",
|
|
363
|
+
"reflect": true,
|
|
364
|
+
"defaultValue": "PresentationMode.PRIMARY"
|
|
330
365
|
}
|
|
331
366
|
};
|
|
332
367
|
}
|
|
@@ -4,7 +4,7 @@ import { DataType, getConvertedValue } from '@sankhyalabs/core/dist/dataunit/met
|
|
|
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';
|
|
6
6
|
|
|
7
|
-
const snkConfigOptionsCss = ".sc-snk-config-options-h{
|
|
7
|
+
const snkConfigOptionsCss = ".sc-snk-config-options-h{--snk-config-options--border:2px solid var(--color--secondary-200, #D2D3DA);width:100%;border-radius:15px;border:var(--snk-config-options--border)}.config-options__switch-row.sc-snk-config-options{margin-top:-30px}";
|
|
8
8
|
|
|
9
9
|
const SnkConfigOptions = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
10
10
|
constructor() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { V as VIEW_MODE } from './constants.js';
|
|
4
|
-
import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
|
|
4
|
+
import { P as PresentationMode, T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
|
|
5
5
|
import { d as defineCustomElement$i } from './snk-config-options2.js';
|
|
6
6
|
import { d as defineCustomElement$h } from './snk-configurator2.js';
|
|
7
7
|
import { d as defineCustomElement$g } from './snk-data-exporter2.js';
|
|
@@ -37,6 +37,10 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
37
37
|
* Determina se haverá exportação de dados
|
|
38
38
|
*/
|
|
39
39
|
this.enableDataExporter = false;
|
|
40
|
+
/**
|
|
41
|
+
* Altera o modo de apresentação dos botões do snk-taskbar.
|
|
42
|
+
*/
|
|
43
|
+
this.presentationMode = PresentationMode.PRIMARY;
|
|
40
44
|
}
|
|
41
45
|
/**
|
|
42
46
|
* Usado para alternar a visão entre GRID e FORM externamente.
|
|
@@ -72,6 +76,16 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
72
76
|
this._snkForm.showConfig();
|
|
73
77
|
}
|
|
74
78
|
}
|
|
79
|
+
validatePresentationMode() {
|
|
80
|
+
if (Object.values(PresentationMode).includes(this.presentationMode)) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
this.presentationMode = PresentationMode.PRIMARY;
|
|
84
|
+
}
|
|
85
|
+
addDataElementID() {
|
|
86
|
+
const dataInfo = { dataUnit: this._dataUnit };
|
|
87
|
+
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
88
|
+
}
|
|
75
89
|
insertionModeHandler() {
|
|
76
90
|
this.gridToForm();
|
|
77
91
|
}
|
|
@@ -110,12 +124,11 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
110
124
|
this.configName = application.configName;
|
|
111
125
|
}
|
|
112
126
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
127
|
+
componentWillRender() {
|
|
128
|
+
this.validatePresentationMode();
|
|
116
129
|
}
|
|
117
130
|
render() {
|
|
118
|
-
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, enableDataExporter: this.enableDataExporter }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-form", { ref: (ref) => this._snkForm = ref, "data-element-id": "crud_form", configName: this.configName, actionsList: this.actionsList, onExit: () => this.setViewMode(GRID_MODE), recordsValidator: this.recordsValidator, taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail) }, h("slot", { name: "SnkFormTaskBar" }))), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._viewMode, onConfigSelected: (evt) => this.executeAction(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail) })));
|
|
131
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, enableDataExporter: this.enableDataExporter, presentationMode: this.presentationMode }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-form", { ref: (ref) => this._snkForm = ref, "data-element-id": "crud_form", configName: this.configName, actionsList: this.actionsList, onExit: () => this.setViewMode(GRID_MODE), recordsValidator: this.recordsValidator, taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode }, h("slot", { name: "SnkFormTaskBar" }))), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._viewMode, onConfigSelected: (evt) => this.executeAction(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail) })));
|
|
119
132
|
}
|
|
120
133
|
get _element() { return this; }
|
|
121
134
|
static get style() { return snkCrudCss; }
|
|
@@ -127,6 +140,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
127
140
|
"statusResolver": [16],
|
|
128
141
|
"multipleSelection": [4, "multiple-selection"],
|
|
129
142
|
"enableDataExporter": [4, "enable-data-exporter"],
|
|
143
|
+
"presentationMode": [1, "presentation-mode"],
|
|
130
144
|
"_dataUnit": [32],
|
|
131
145
|
"_dataState": [32],
|
|
132
146
|
"_viewMode": [32],
|
|
@@ -191,7 +191,7 @@ class ItemBuilder {
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
const snkDataExporterCss = ".sc-snk-data-exporter-h{--snk-data-exporter--z-index:var(--
|
|
194
|
+
const snkDataExporterCss = ".sc-snk-data-exporter-h{--snk-data-exporter--z-index:var(--most-visible, 3);display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter--overlap.sc-snk-data-exporter{z-index:var(--snk-data-exporter--z-index)}";
|
|
195
195
|
|
|
196
196
|
const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
197
197
|
constructor() {
|
|
@@ -338,9 +338,11 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
render() {
|
|
341
|
-
return (h(Host, null, h("div", { class:
|
|
341
|
+
return (h(Host, null, h("div", { class: `snk-data-exporter
|
|
342
|
+
${this._showDropdown ? " snk-data-exporter--overlap" : ""}
|
|
343
|
+
` }, h("ez-button", Object.assign({ ref: (ref) => this._ezButton = ref, iconName: "file-download", size: "small", mode: "icon", onClick: () => this.controlDropdown() }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("button")}` })), this._showDropdown &&
|
|
342
344
|
h("ez-dropdown", Object.assign({ ref: (ref) => this._ezDropdown = ref, items: this._items, onEzClick: (evt) => this.processExporter(evt) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("dropdown")}` }))), this._showDropdown &&
|
|
343
|
-
h("div", Object.assign({ class: "ez-scrim ez-scrim
|
|
345
|
+
h("div", Object.assign({ class: "ez-scrim ez-scrim--light" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("ezScrim")}` })), h("snk-exporter-email-sender", { ref: ref => this._snkEmailSender = ref, getMessage: (key, params) => this.getMessage(key, params) })));
|
|
344
346
|
}
|
|
345
347
|
get _element() { return this; }
|
|
346
348
|
static get style() { return snkDataExporterCss; }
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { A as ACTION_CONFIG } from './constants.js';
|
|
4
4
|
|
|
5
|
-
const snkFieldConfigCss = ".sc-snk-field-config-h{--snk-field-config--height:42px;--snk-field-config--width:100%;--snk-field-config__icon--width:48px;--snk-field-config--height
|
|
5
|
+
const snkFieldConfigCss = ".sc-snk-field-config-h{--snk-field-config--height:42px;--snk-field-config--width:100%;--snk-field-config__icon--width:48px;--snk-field-config-slim--height:32px;--snk-field-config--border-radius:var(--border--radius-medium, 12px);--snk-field-config--font-size:var(--text--medium, 14px);--snk-field-config--font-family:var(--font-pattern, Arial);--snk-field-config--font-weight:var(--text-weight--medium, 400);--snk-field-config--color:var(--title--primary, #000);--snk-field-config--padding-left:var(--space--medium, 6px);--snk-field-config__input--background-color:var(--background--medium, #e0e0e0);--snk-field-config__input--border:var(--border--medium, 2px solid);--snk-field-config__input--border-color:var(--background--xlight, #fff);--snk-field-config__required--color:var(--color--error, #FF0000);--snk-field-config__required--padding-left:var(--space--extra-small, 3px);--snk-field-config__transition--visibility:var(--transition, 0.2s linear);--snk-field-config__transition--opacity:var(--transition, 0.15s linear);--snk-field-config__config-popover--z-index:var(--more-visible, 2);--snk-field-config__config-outer-arrow--background-color:var(--color--secondary-200, #D2D3DA);--snk-field-config__draggable--padding-right:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--snk-field-config--width)}.field-config.sc-snk-field-config{width:100%;box-sizing:border-box;display:flex;align-items:center;padding-left:var(--snk-field-config--padding-left);font-weight:var(--snk-field-config--font-weight);height:var(--snk-field-config--height);border-radius:var(--snk-field-config--border-radius);font-family:var(--snk-field-config--font-family);font-size:var(--snk-field-config--font-size);border:var(--snk-field-config__input--border);border-color:var(--snk-field-config__input--border-color);background-color:var(--snk-field-config__input--background-color);color:var(--snk-field-config--color)}.field-config__config-popover.sc-snk-field-config{width:40px;margin-left:auto;z-index:var(--snk-field-config__config-popover--z-index)}.field-config__required-label.sc-snk-field-config{color:var(--snk-field-config__required--color);padding-left:var(--snk-field-config__required--padding-left)}.field-config__add.sc-snk-field-config{display:flex;margin-left:auto;visibility:hidden;opacity:0;transition:visibility var(--snk-field-config__transition--visibility), opacity var(--snk-field-config__transition--opacity)}.field-config__options.sc-snk-field-config{display:flex;margin-left:auto;visibility:hidden;opacity:0;transition:visibility var(--snk-field-config__transition--visibility), opacity var(--snk-field-config__transition--opacity)}.field-config__options--is-active.sc-snk-field-config{display:flex;visibility:visible;opacity:1}.field-config__remove-icon.sc-snk-field-config{margin-right:-15px}.field-config.sc-snk-field-config:hover .field-config__options.sc-snk-field-config{display:flex;visibility:visible;opacity:1}.field-config.sc-snk-field-config:hover .field-config__add.sc-snk-field-config{visibility:visible;opacity:1}.field-config__draggable.sc-snk-field-config{padding-right:var(--snk-field-config__draggable--padding-right)}.field-config__config-outer-arrow.sc-snk-field-config{clip-path:polygon(50% 0, 90% 100%, 10% 100%);border-radius:0.25em 0 0 0;width:30px;height:15px;padding-top:3px;border-bottom:1px solid #FFFFFF;background-color:var(--snk-field-config__config-outer-arrow--background-color)}.field-config__config-inner-arrow.sc-snk-field-config{background-color:#FFFFFF;clip-path:polygon(50% 0, 90% 100%, 10% 100%);border-radius:0.25em 0 0 0;width:30px;height:15px}.ez-box__container.sc-snk-field-config ez-collapsible-box.sc-snk-field-config{--snk-collapsible-box__header--padding-left:6px}ez-icon.sc-snk-field-config{--snk-icon--color:var(--snk-field-config--color)}ez-popover.sc-snk-field-config{--snk-popover__box--background-color:transparent;--snk-popover__box--box-shadow:none}.field-config__options.sc-snk-field-config ez-button.sc-snk-field-config{--snk-button--background-color:transparent;--snk-button--focus--border:none;--snk-button--focus--box-shadow:none}";
|
|
6
6
|
|
|
7
7
|
const SnkFieldConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
8
|
constructor() {
|
|
@@ -105,7 +105,7 @@ function buildPersonalized(item) {
|
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--
|
|
108
|
+
const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--most-visible, 3);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}";
|
|
109
109
|
|
|
110
110
|
const PERSONALIZED_FILTER = "PERSONALIZED_FILTER";
|
|
111
111
|
const DEFAULT_FILTER = "DEFAULT_FILTER";
|
|
@@ -50,7 +50,7 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
50
50
|
left: this.getScrollOffsetLeft(),
|
|
51
51
|
top: this.getScrollOffsetTop(),
|
|
52
52
|
useOverlay: true,
|
|
53
|
-
overlayClassName: 'ez-scrim ez-scrim
|
|
53
|
+
overlayClassName: 'ez-scrim ez-scrim--light',
|
|
54
54
|
isFixed: true
|
|
55
55
|
};
|
|
56
56
|
}
|
|
@@ -7,7 +7,7 @@ import { U as UserConfigType, C as ConfigStorage } from './ConfigStorage.js';
|
|
|
7
7
|
import { d as defineCustomElement$3 } from './snk-config-options2.js';
|
|
8
8
|
import { d as defineCustomElement$2 } from './snk-field-config2.js';
|
|
9
9
|
|
|
10
|
-
const snkFormConfigCss = ".sc-snk-form-config-h{--snk-form-
|
|
10
|
+
const snkFormConfigCss = ".sc-snk-form-config-h{--snk-form-config--z-index:var(--more-visible, 2);--snk-form-config--background-color:var(--background--xlight, #fff);--snk-form-config__icon--color:var(--text--disable, #AFB6C0);--snk-form-config__label-counter--font-weight:var(--text-weight--extra-small, 200);--snk-form-config__add-group-container--border-radius:var(--border--radius-medium, 12px);--snk-form-config__add-group-container--background-color:var(--background--medium, #d2dce9);--snk-form-config__add-group-container--padding:var(--space--small, 6px);--snk-form-config__add-group-content--border:2px dashed var(--color-strokes, #DCE0E8);--snk-form-config__add-group-content--border-radius:var(--border--radius-small, 6px);--snk-form-config__add-group-label--padding:var(--space--large, 24px);--snk-form-config__btn-add-group--padding:var(--space--large, 24px) var(--space--medium, 12px) 0;--snk-form-config__btn-add-group-container--padding:var(--space--medium, 12px);--snk-form-config__btn-add-group-container--border-radius:var(--border--radius-medium, 12px);--snk-form-config__btn-add-group-container--border:2px solid var(--color-strokes, #DCE0E8);--snk-form-config__btn-add-group-container--background-color:var(--background--body, #fafcff);display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;z-index:var(--snk-form-config--z-index);background-color:var(--snk-form-config--background-color)}.form-config__header-container.sc-snk-form-config{display:flex}.form-config__field-container.sc-snk-form-config{width:32%;padding:6px}.form-config__hide-content.sc-snk-form-config{display:none}ez-icon.sc-snk-form-config .left-icon.sc-snk-form-config{--ez-icon--color:var(--snk-form-config__icon--color)}.ez-box__label-counter.sc-snk-form-config{margin-top:-7px;font-weight:var(--snk-form-config__label-counter--font-weight)}.form-config__btn-options.sc-snk-form-config{--ez-button--min-width:300px;--ez-button--background-color:var(--snk-form-config--background-color)}[data-draggable-parent].sc-snk-form-config{position:relative}.form-config__field-config--selected.sc-snk-form-config{position:static}.form-config__field-config--dragged.sc-snk-form-config .draggable-mirror.sc-snk-form-config{z-index:var(--snk-form-config--z-index)}.form-config__config-options.sc-snk-form-config{position:relative;margin-top:-3px;min-width:100%;z-index:1}.form-config__tab-container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config{position:relative;height:100%;max-height:calc(100vh - 92px)}.form-config__tab-container.sc-snk-form-config .ez-box__container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config .ez-box__container.sc-snk-form-config{align-content:flex-start;height:100%}.form-config__fields-available.sc-snk-form-config [data-draggable-parent].sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:100%;max-height:calc(100% - 122px)}.form-config__tab-content.sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:auto;max-height:calc(100% - 128px)}[data-draggable-element].sc-snk-form-config{cursor:grab}.form-config__actions-button.sc-snk-form-config{--ez-actions-button__btn-action--min-width:235px}.form-config__add-group.sc-snk-form-config{position:relative;min-height:120px;margin-bottom:10px}.form-config__add-group-container.sc-snk-form-config{position:absolute;display:flex;flex-wrap:wrap;width:100%;box-sizing:border-box;border-radius:var(--snk-form-config__add-group-container--border-radius);background-color:var(--snk-form-config__add-group-container--background-color);padding:var(--snk-form-config__add-group-container--padding)}.form-config__add-group-content.sc-snk-form-config{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;box-sizing:border-box;border:var(--snk-form-config__add-group-content--border);border-radius:var(--snk-form-config__add-group-content--border-radius)}.form-config__add-group-label.sc-snk-form-config{display:flex;justify-content:center;box-sizing:border-box;padding:var(--snk-form-config__add-group-label--padding)}.form-config__btn-add-group.sc-snk-form-config{position:relative;padding:var(--snk-form-config__btn-add-group--padding)}.form-config__btn-add-group-container.sc-snk-form-config{padding:var(--snk-form-config__btn-add-group-container--padding);border-radius:var(--snk-form-config__btn-add-group-container--border-radius);border:var(--snk-form-config__btn-add-group-container--border);background-color:var(--snk-form-config__btn-add-group-container--background-color)}ez-collapsible-box.draggable-mirror.sc-snk-form-config{display:table;background-color:var(--snk-form-config--background-color)}ez-collapsible-box.sc-snk-form-config{margin-bottom:10px}@media screen and (min-width: 480px){.form-config__field-config--selected.sc-snk-form-config .ez-flex.form-config__config-options.sc-snk-form-config{min-width:calc(300% + 12px)}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+2) .ez-flex.form-config__config-options.sc-snk-form-config{transform:translate(calc(100% / 3 * -1))}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+3) .ez-flex.form-config__config-options.sc-snk-form-config{transform:translate(calc(100% / 3 * -2))}}";
|
|
11
11
|
|
|
12
12
|
const CONTAINER_ID = {
|
|
13
13
|
collapsibleBox: "EZ-COLLAPSIBLE-BOX",
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { DateUtils, ObjectUtils, ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
-
import { T as TaskbarProcessor } from './taskbar-processor.js';
|
|
4
3
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
|
4
|
+
import { P as PresentationMode, d as defineCustomElement$1 } from './snk-taskbar2.js';
|
|
5
|
+
import { T as TaskbarProcessor } from './taskbar-processor.js';
|
|
5
6
|
import { d as defineCustomElement$7 } from './snk-config-options2.js';
|
|
6
7
|
import { d as defineCustomElement$6 } from './snk-data-exporter2.js';
|
|
7
8
|
import { d as defineCustomElement$5 } from './snk-exporter-email-sender2.js';
|
|
8
9
|
import { d as defineCustomElement$4 } from './snk-field-config2.js';
|
|
9
10
|
import { d as defineCustomElement$3 } from './snk-form-config2.js';
|
|
10
11
|
import { d as defineCustomElement$2 } from './snk-tab-config2.js';
|
|
11
|
-
import { d as defineCustomElement$1 } from './snk-taskbar2.js';
|
|
12
12
|
|
|
13
|
-
const snkFormCss = ".sc-snk-form-h{display:block}.snk-form.sc-snk-form{position:relative;padding:var(--space--large);padding-top:var(--space--medium)}.snk-form__header.sc-snk-form{position:relative;padding-top:var(--space--medium);padding-bottom:var(--space--medium);margin-bottom:var(--space--medium)}.snk-form__header--fixed.sc-snk-form{position:sticky;top:0;background:var(--background--body);z-index:var(--
|
|
13
|
+
const snkFormCss = ".sc-snk-form-h{display:block}.snk-form.sc-snk-form{position:relative;padding:var(--space--large);padding-top:var(--space--medium)}.snk-form__header.sc-snk-form{position:relative;padding-top:var(--space--medium);padding-bottom:var(--space--medium);margin-bottom:var(--space--medium)}.snk-form__header--fixed.sc-snk-form{position:sticky;top:0;background:var(--background--body);z-index:var(--visible);padding-left:var(--space--large);padding-right:var(--space--large);margin-left:calc(var(--space--large) * -1);margin-right:calc(var(--space--large) * -1);width:calc(100% + (var(--space--large) * 2))}.snk-form__form--hidden.sc-snk-form{display:none}";
|
|
14
14
|
|
|
15
15
|
const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
16
16
|
constructor() {
|
|
@@ -19,13 +19,13 @@ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
19
19
|
this.exit = createEvent(this, "exit", 7);
|
|
20
20
|
this.actionClick = createEvent(this, "actionClick", 7);
|
|
21
21
|
this._renderTimer = 500;
|
|
22
|
-
this._taskbarProcessor = new TaskbarProcessor({
|
|
23
|
-
"snkForm.regular": ["PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "GRID_MODE", "CONFIGURATOR", "INSERT"],
|
|
24
|
-
"snkForm.finish_edition": ["CANCEL", "SAVE"]
|
|
25
|
-
});
|
|
26
22
|
this._editionFormConfig = {};
|
|
27
23
|
this._insertionFormConfig = {};
|
|
28
24
|
this._showFormConfig = false;
|
|
25
|
+
/**
|
|
26
|
+
* Altera o modo de apresentação dos botões do snk-taskbar.
|
|
27
|
+
*/
|
|
28
|
+
this.presentationMode = PresentationMode.PRIMARY;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* Exibe a janela de configurações do formulário.
|
|
@@ -39,6 +39,22 @@ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
39
39
|
async hideConfig() {
|
|
40
40
|
this._showFormConfig = false;
|
|
41
41
|
}
|
|
42
|
+
getFinishEditionTaskbarButtons() {
|
|
43
|
+
if (this.presentationMode === PresentationMode.PRIMARY) {
|
|
44
|
+
return ["CANCEL", "SAVE"];
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return ["SAVE", "CANCEL"];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
getRegularTaskbarButtons() {
|
|
51
|
+
if (this.presentationMode === PresentationMode.PRIMARY) {
|
|
52
|
+
return ["PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "GRID_MODE", "CONFIGURATOR", "INSERT"];
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return ["INSERT", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "GRID_MODE", "CONFIGURATOR"];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
42
58
|
loadConfig() {
|
|
43
59
|
if (this.configName == undefined) {
|
|
44
60
|
return;
|
|
@@ -142,6 +158,33 @@ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
142
158
|
closeConfig() {
|
|
143
159
|
this.hideConfig();
|
|
144
160
|
}
|
|
161
|
+
validatePresentationMode() {
|
|
162
|
+
if (Object.values(PresentationMode).includes(this.presentationMode)) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
this.presentationMode = PresentationMode.PRIMARY;
|
|
166
|
+
}
|
|
167
|
+
dataunitReady() {
|
|
168
|
+
this.loadInsertionConfig();
|
|
169
|
+
const dataInfo = { dataUnit: this._dataUnit };
|
|
170
|
+
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
171
|
+
}
|
|
172
|
+
loadTaskbarProcessor() {
|
|
173
|
+
var _a;
|
|
174
|
+
const taskbarId = ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "snkForm.finish_edition" : "snkForm.regular";
|
|
175
|
+
const disabledButtons = [];
|
|
176
|
+
if (!this._dataState || !this._dataState.hasPrevious) {
|
|
177
|
+
disabledButtons.push("PREVIOUS");
|
|
178
|
+
}
|
|
179
|
+
if (!this._dataState || !this._dataState.hasNext) {
|
|
180
|
+
disabledButtons.push("NEXT");
|
|
181
|
+
}
|
|
182
|
+
this._taskbarProcessor = new TaskbarProcessor({
|
|
183
|
+
"snkForm.regular": this.getRegularTaskbarButtons(),
|
|
184
|
+
"snkForm.finish_edition": this.getFinishEditionTaskbarButtons(),
|
|
185
|
+
});
|
|
186
|
+
this._taskbarProcessor.process(taskbarId, this.taskbarManager, this._dataState, disabledButtons);
|
|
187
|
+
}
|
|
145
188
|
getDisabledButtons() {
|
|
146
189
|
const disabled = [];
|
|
147
190
|
if (!this._dataState.hasPrevious) {
|
|
@@ -152,11 +195,6 @@ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
152
195
|
}
|
|
153
196
|
return disabled;
|
|
154
197
|
}
|
|
155
|
-
dataunitReady() {
|
|
156
|
-
this.loadInsertionConfig();
|
|
157
|
-
const dataInfo = { dataUnit: this._dataUnit };
|
|
158
|
-
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
159
|
-
}
|
|
160
198
|
componentWillLoad() {
|
|
161
199
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
162
200
|
let parent = this._element.parentElement;
|
|
@@ -184,23 +222,20 @@ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
184
222
|
this.loadConfig();
|
|
185
223
|
}
|
|
186
224
|
componentWillRender() {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
const disabledButtons = [];
|
|
190
|
-
if (!this._dataState || !this._dataState.hasPrevious) {
|
|
191
|
-
disabledButtons.push("PREVIOUS");
|
|
192
|
-
}
|
|
193
|
-
if (!this._dataState || !this._dataState.hasNext) {
|
|
194
|
-
disabledButtons.push("NEXT");
|
|
195
|
-
}
|
|
196
|
-
this._taskbarProcessor.process(taskbarId, this.taskbarManager, this._dataState, disabledButtons);
|
|
225
|
+
this.validatePresentationMode();
|
|
226
|
+
this.loadTaskbarProcessor();
|
|
197
227
|
}
|
|
198
228
|
render() {
|
|
199
229
|
var _a;
|
|
200
230
|
if (!this._dataUnit || !this._dataState) {
|
|
201
231
|
return undefined;
|
|
202
232
|
}
|
|
203
|
-
return (h("section", { class: "snk-form" }, h("div", { class:
|
|
233
|
+
return (h("section", { class: "snk-form" }, h("div", { class: `snk-form__header ez-row
|
|
234
|
+
${this.presentationMode === PresentationMode.PRIMARY ? 'snk-form__header--fixed' : ''}
|
|
235
|
+
` }, this.presentationMode === PresentationMode.PRIMARY &&
|
|
236
|
+
h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, h("ez-button", { title: this.getMessage("snkForm.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small", onClick: () => this.exitForm(), "data-element-id": "formToBack" }), h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), h("div", { class: `ez-col
|
|
237
|
+
${this.presentationMode === PresentationMode.PRIMARY ? "ez-col--sd-6 ez-col--tb-6 ez-align--right" : ""}
|
|
238
|
+
` }, h("snk-taskbar", { key: "formTaskbar", "data-element-id": "form", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, primaryButton: ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", dataUnit: this._dataUnit, presentationMode: this.presentationMode }))), h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this.getFormConfig(), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
|
|
204
239
|
h("snk-form-config", { dataUnit: this._dataUnit, formConfig: this.getFormConfig(), configName: this.configName, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigClose: () => this.closeConfig() }))))));
|
|
205
240
|
}
|
|
206
241
|
get _element() { return this; }
|
|
@@ -210,6 +245,7 @@ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
210
245
|
"recordsValidator": [16],
|
|
211
246
|
"actionsList": [16],
|
|
212
247
|
"taskbarManager": [16],
|
|
248
|
+
"presentationMode": [1, "presentation-mode"],
|
|
213
249
|
"_dataUnit": [32],
|
|
214
250
|
"_dataState": [32],
|
|
215
251
|
"_editionFormConfig": [32],
|