@sankhyalabs/sankhyablocks 2.2.2-SKA-60656.4 → 2.3.0
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/snk-application.cjs.entry.js +2 -0
- package/dist/cjs/snk-configurator_3.cjs.entry.js +9 -1
- package/dist/cjs/snk-crud.cjs.entry.js +10 -2
- package/dist/cjs/snk-filter-bar_7.cjs.entry.js +28 -16
- package/dist/cjs/snk-filter-detail.cjs.entry.js +10 -0
- package/dist/cjs/snk-form.cjs.entry.js +11 -2
- package/dist/cjs/{taskbar-elements-997af1c9.js → taskbar-elements-b995b84d.js} +26 -26
- package/dist/collection/components/snk-application/snk-application.js +3 -1
- package/dist/collection/components/snk-crud/snk-crud.js +10 -2
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +11 -1
- package/dist/collection/components/snk-form/snk-form.js +12 -3
- package/dist/collection/components/snk-grid/snk-grid.js +10 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +26 -26
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +28 -16
- package/dist/components/snk-application2.js +3 -1
- package/dist/components/snk-crud.js +10 -2
- package/dist/components/snk-filter-detail2.js +11 -1
- package/dist/components/snk-form2.js +12 -3
- package/dist/components/snk-grid2.js +10 -1
- package/dist/components/snk-taskbar2.js +54 -42
- package/dist/esm/snk-application.entry.js +4 -2
- package/dist/esm/snk-configurator_3.entry.js +9 -1
- package/dist/esm/snk-crud.entry.js +11 -3
- package/dist/esm/snk-filter-bar_7.entry.js +28 -16
- package/dist/esm/snk-filter-detail.entry.js +11 -1
- package/dist/esm/snk-form.entry.js +12 -3
- package/dist/esm/taskbar-elements-a0a8c3ac.js +95 -0
- package/dist/sankhyablocks/p-00f6d216.entry.js +1 -0
- package/dist/sankhyablocks/{p-6340d992.entry.js → p-0e18f6e6.entry.js} +8 -8
- package/dist/sankhyablocks/p-4cbc4ae3.js +1 -0
- package/dist/sankhyablocks/p-6ca95ef3.entry.js +1 -0
- package/dist/sankhyablocks/{p-9b0f99fd.entry.js → p-975182f8.entry.js} +1 -1
- package/dist/sankhyablocks/p-c4e9394c.entry.js +1 -0
- package/dist/sankhyablocks/{p-7dcce5aa.entry.js → p-de0fe8a4.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +1 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +2 -0
- package/dist/types/components/snk-form/snk-form.d.ts +2 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +2 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +2 -2
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +6 -2
- package/package.json +2 -3
- package/dist/esm/taskbar-elements-a0a8b106.js +0 -95
- package/dist/sankhyablocks/p-09720dd1.js +0 -1
- package/dist/sankhyablocks/p-0ffee54f.entry.js +0 -1
- package/dist/sankhyablocks/p-133cf71d.entry.js +0 -1
- package/dist/sankhyablocks/p-bc41625b.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApplicationContext } from '@sankhyalabs/core';
|
|
1
|
+
import { ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
|
|
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';
|
|
@@ -108,26 +108,19 @@ export class SnkTaskbar {
|
|
|
108
108
|
className += "ez-padding-left--medium";
|
|
109
109
|
}
|
|
110
110
|
if (TaskbarElement[def.toString()]) {
|
|
111
|
-
return buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
|
|
111
|
+
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
|
|
112
112
|
}
|
|
113
113
|
else {
|
|
114
|
-
return buildCustomButton(def, className, elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
114
|
+
return buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if (this._application) {
|
|
121
|
-
this._application.getAllAccess().then(access => this._permissions = access);
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
this._permissions = {};
|
|
125
|
-
}
|
|
117
|
+
getIdElemBtnNative(taskbarElem) {
|
|
118
|
+
const elemIdTaskbar = this._element.getAttribute("data-element-id");
|
|
119
|
+
return `${elemIdTaskbar}_${StringUtils.toCamelCase(taskbarElem)}`;
|
|
126
120
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
121
|
+
getIdElemBtnCustom(btnCustom) {
|
|
122
|
+
const elemIdTaskbar = this._element.getAttribute("data-element-id");
|
|
123
|
+
return `${elemIdTaskbar}_${StringUtils.toCamelCase(btnCustom.name)}`;
|
|
131
124
|
}
|
|
132
125
|
isDivider(element) {
|
|
133
126
|
var _a;
|
|
@@ -149,6 +142,24 @@ export class SnkTaskbar {
|
|
|
149
142
|
return true;
|
|
150
143
|
});
|
|
151
144
|
}
|
|
145
|
+
componentWillLoad() {
|
|
146
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
147
|
+
if (this._application) {
|
|
148
|
+
this._application.getAllAccess().then(access => this._permissions = access);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
this._permissions = {};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
componentWillRender() {
|
|
155
|
+
if (this._definitions == undefined && this._permissions) {
|
|
156
|
+
this._definitions = this.elementsFromString(this.buttons);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
componentDidLoad() {
|
|
160
|
+
const dataInfo = { dataUnit: this.dataUnit };
|
|
161
|
+
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
162
|
+
}
|
|
152
163
|
render() {
|
|
153
164
|
if (this._definitions === undefined) {
|
|
154
165
|
return undefined;
|
|
@@ -358,6 +369,7 @@ export class SnkTaskbar {
|
|
|
358
369
|
}
|
|
359
370
|
}];
|
|
360
371
|
}
|
|
372
|
+
static get elementRef() { return "_element"; }
|
|
361
373
|
static get watchers() {
|
|
362
374
|
return [{
|
|
363
375
|
"propName": "buttons",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { WaitingChangeException, WarningException, ErrorException, ObjectUtils, DataType, DataUnit, StringUtils, ChangeOperation, DateUtils, DependencyType, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
|
|
2
|
+
import { WaitingChangeException, WarningException, ErrorException, ObjectUtils, DataType, DataUnit, StringUtils, ChangeOperation, DateUtils, DependencyType, ApplicationContext, ErrorTracking, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { d as dist, D as DataFetcher, R as ResourceFetcher, U as UrlUtils, F as FormConfigFetcher, G as GridConfigFetcher, C as ConfigStorage } from './ConfigStorage.js';
|
|
4
4
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
5
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
|
|
@@ -1242,10 +1242,12 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1242
1242
|
window.requestAnimationFrame(() => {
|
|
1243
1243
|
this.applicationLoaded.emit(true);
|
|
1244
1244
|
});
|
|
1245
|
+
ElementIDUtils.addIDInfo(this._element, `resource_${this._resourceID}`);
|
|
1245
1246
|
}
|
|
1246
1247
|
render() {
|
|
1247
1248
|
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
|
|
1248
1249
|
}
|
|
1250
|
+
get _element() { return this; }
|
|
1249
1251
|
static get style() { return snkApplicationCss; }
|
|
1250
1252
|
}, [2, "snk-application", {
|
|
1251
1253
|
"messagesBuilder": [1040],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { ApplicationContext } from '@sankhyalabs/core';
|
|
2
|
+
import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { V as VIEW_MODE } from './constants.js';
|
|
4
4
|
import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
|
|
5
5
|
import { d as defineCustomElement$g } from './snk-config-options2.js';
|
|
@@ -74,6 +74,10 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
74
74
|
this.setViewMode(GRID_MODE);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
+
getDataElementId(suffix) {
|
|
78
|
+
const elemIdSnkCrud = this._element.getAttribute("data-element-id");
|
|
79
|
+
return `${elemIdSnkCrud}_${suffix}`;
|
|
80
|
+
}
|
|
77
81
|
componentWillLoad() {
|
|
78
82
|
let parent = this._element.parentElement;
|
|
79
83
|
while (parent) {
|
|
@@ -100,8 +104,12 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
100
104
|
this.configName = application.configName;
|
|
101
105
|
}
|
|
102
106
|
}
|
|
107
|
+
componentDidLoad() {
|
|
108
|
+
const dataInfo = { dataUnit: this._dataUnit };
|
|
109
|
+
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
110
|
+
}
|
|
103
111
|
render() {
|
|
104
|
-
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, 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 }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-form", { ref: (ref) => this._snkForm = ref, 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) })));
|
|
112
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": this.getDataElementId("crud_ViewStack") }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": this.getDataElementId("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 }, 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": this.getDataElementId("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) })));
|
|
105
113
|
}
|
|
106
114
|
get _element() { return this; }
|
|
107
115
|
static get style() { return snkCrudCss; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
|
4
|
-
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
4
|
+
import { ElementIDUtils, DataType } from '@sankhyalabs/core';
|
|
5
5
|
|
|
6
6
|
const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
@@ -54,12 +54,22 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
54
54
|
buildIcon(title, iconName, action) {
|
|
55
55
|
return (h("button", { onClick: () => action(), class: "sc-snk-filter-bar snk-filter-item__editor-header-button" }, h("ez-icon", { title: title, iconName: iconName })));
|
|
56
56
|
}
|
|
57
|
+
getNormalizedValue(params, value) {
|
|
58
|
+
return params.reduce((arrayValues, currentParam, index) => {
|
|
59
|
+
if (currentParam.dataType === DataType.BOOLEAN && (arrayValues == undefined || arrayValues[index] == undefined)) {
|
|
60
|
+
arrayValues = arrayValues || [];
|
|
61
|
+
arrayValues[index] = false;
|
|
62
|
+
}
|
|
63
|
+
return arrayValues;
|
|
64
|
+
}, value);
|
|
65
|
+
}
|
|
57
66
|
apply() {
|
|
58
67
|
var _a;
|
|
59
68
|
let value = this._editor["value"];
|
|
60
69
|
let isValid = true;
|
|
61
70
|
if (this.config.type === FilterItemType.PERSONALIZED) {
|
|
62
71
|
const params = ((_a = this.config.props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || [];
|
|
72
|
+
value = this.getNormalizedValue(params, value);
|
|
63
73
|
const paramsCount = params.length;
|
|
64
74
|
if (paramsCount === 0) {
|
|
65
75
|
//Valor do filtro personalizado sem parametros deve ser um array vazio
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { DateUtils, ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
2
|
+
import { DateUtils, ObjectUtils, ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { T as TaskbarProcessor } from './taskbar-processor.js';
|
|
4
4
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
|
5
5
|
import { d as defineCustomElement$5 } from './snk-config-options2.js';
|
|
@@ -145,6 +145,15 @@ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
145
145
|
}
|
|
146
146
|
return disabled;
|
|
147
147
|
}
|
|
148
|
+
dataunitReady() {
|
|
149
|
+
this.loadInsertionConfig();
|
|
150
|
+
const dataInfo = { dataUnit: this._dataUnit };
|
|
151
|
+
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
152
|
+
}
|
|
153
|
+
getDataElementId(suffix) {
|
|
154
|
+
const elemIdSnkTaskBar = this._element.getAttribute("data-element-id");
|
|
155
|
+
return `${elemIdSnkTaskBar}_${suffix}`;
|
|
156
|
+
}
|
|
148
157
|
componentWillLoad() {
|
|
149
158
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
150
159
|
let parent = this._element.parentElement;
|
|
@@ -154,7 +163,7 @@ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
154
163
|
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
155
164
|
this._dataState = this._snkDataUnit.dataState;
|
|
156
165
|
if (this._dataUnit) {
|
|
157
|
-
this.
|
|
166
|
+
this.dataunitReady();
|
|
158
167
|
}
|
|
159
168
|
else {
|
|
160
169
|
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
@@ -188,7 +197,7 @@ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
188
197
|
if (!this._dataUnit || !this._dataState) {
|
|
189
198
|
return undefined;
|
|
190
199
|
}
|
|
191
|
-
return (h("section", { class: "snk-form" }, h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, 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() }), h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, h("snk-taskbar", { key: "formTaskbar", 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 }))), 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, dataUnit: this._dataUnit, config: this.getFormConfig(), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
|
|
200
|
+
return (h("section", { class: "snk-form" }, h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, 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() }), h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, h("snk-taskbar", { key: "formTaskbar", "data-element-id": this.getDataElementId("form_taskbar"), 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 }))), 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": this.getDataElementId("internal_form"), dataUnit: this._dataUnit, config: this.getFormConfig(), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
|
|
192
201
|
h("snk-form-config", { dataUnit: this._dataUnit, formConfig: this.getFormConfig(), "data-element-id": this._element.getAttribute("data-element-id"), configName: this.configName, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigClose: () => this.closeConfig() }))))));
|
|
193
202
|
}
|
|
194
203
|
get _element() { return this; }
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
2
3
|
import { T as TaskbarProcessor } from './taskbar-processor.js';
|
|
3
4
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
|
4
5
|
import { d as defineCustomElement$8 } from './snk-filter-bar2.js';
|
|
@@ -112,11 +113,19 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
112
113
|
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState);
|
|
113
114
|
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState);
|
|
114
115
|
}
|
|
116
|
+
componentDidLoad() {
|
|
117
|
+
const dataInfo = { dataUnit: this._dataUnit };
|
|
118
|
+
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
119
|
+
}
|
|
120
|
+
getDataElementId(suffix) {
|
|
121
|
+
const elemIdSnkGrid = this._element.getAttribute("data-element-id");
|
|
122
|
+
return `${elemIdSnkGrid}_${suffix}`;
|
|
123
|
+
}
|
|
115
124
|
render() {
|
|
116
125
|
if (!this._dataUnit) {
|
|
117
126
|
return undefined;
|
|
118
127
|
}
|
|
119
|
-
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-padding-bottom--medium ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, 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", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), 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(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection }, h("snk-taskbar", { dataUnit: this._dataUnit, 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("data-element-id"), selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
128
|
+
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-padding-bottom--medium ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": this.getDataElementId("internal_filter"), 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": this.getDataElementId("grid_top_taskbar"), key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), h("ez-grid", { ref: ref => this._grid = ref, "data-element-id": this.getDataElementId("internal_grid"), 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, "data-element-id": this.getDataElementId("grid_left_taskBar"), 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("data-element-id"), selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
120
129
|
}
|
|
121
130
|
get _element() { return this; }
|
|
122
131
|
static get style() { return snkGridCss; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, proxyCustomElement, HTMLElement, createEvent, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { ApplicationContext } from '@sankhyalabs/core';
|
|
2
|
+
import { StringUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { A as AuthorizationConfig } from './AuthorizationConfig.js';
|
|
4
4
|
|
|
5
5
|
var TaskbarElement;
|
|
@@ -31,66 +31,66 @@ var VisibleWhenForbidden;
|
|
|
31
31
|
(function (VisibleWhenForbidden) {
|
|
32
32
|
VisibleWhenForbidden["CONFIGURATOR"] = "CONFIGURATOR";
|
|
33
33
|
})(VisibleWhenForbidden || (VisibleWhenForbidden = {}));
|
|
34
|
-
const buildCustomButton = (def, className, action, isEnabled) => {
|
|
34
|
+
const buildCustomButton = (def, className, dataElementId, action, isEnabled) => {
|
|
35
35
|
const { hint, text, iconName } = def;
|
|
36
36
|
if (iconName) {
|
|
37
37
|
if (text) {
|
|
38
|
-
return iconTextButton(iconName, def.name, className, hint, text, action, isEnabled);
|
|
38
|
+
return iconTextButton(iconName, def.name, className, dataElementId, hint, text, action, isEnabled);
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
|
-
return iconButton(iconName, def.name, className, hint, action, isEnabled);
|
|
41
|
+
return iconButton(iconName, def.name, className, dataElementId, hint, action, isEnabled);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
|
-
return textButton(def.name, className, text, hint, action, isEnabled);
|
|
45
|
+
return textButton(def.name, className, dataElementId, text, hint, action, isEnabled);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
const buildElem = (element, className, getTitle, action, isEnabled, actions) => {
|
|
48
|
+
const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions) => {
|
|
49
49
|
const title = getTitle(element);
|
|
50
50
|
switch (element) {
|
|
51
51
|
case TaskbarElement.PREVIOUS:
|
|
52
|
-
return iconButton("chevron-left", element, className, title, action, isEnabled);
|
|
52
|
+
return iconButton("chevron-left", element, className, dataElementId, title, action, isEnabled);
|
|
53
53
|
case TaskbarElement.NEXT:
|
|
54
|
-
return iconButton("chevron-right", element, className, title, action, isEnabled);
|
|
54
|
+
return iconButton("chevron-right", element, className, dataElementId, title, action, isEnabled);
|
|
55
55
|
case TaskbarElement.REFRESH:
|
|
56
|
-
return iconButton("sync", element, className, title, action, isEnabled);
|
|
56
|
+
return iconButton("sync", element, className, dataElementId, title, action, isEnabled);
|
|
57
57
|
case TaskbarElement.UPDATE:
|
|
58
|
-
return iconButton("edit", element, className, title, action, isEnabled);
|
|
58
|
+
return iconButton("edit", element, className, dataElementId, title, action, isEnabled);
|
|
59
59
|
case TaskbarElement.CLONE:
|
|
60
|
-
return iconButton("copy", element, className, title, action, isEnabled);
|
|
60
|
+
return iconButton("copy", element, className, dataElementId, title, action, isEnabled);
|
|
61
61
|
case TaskbarElement.REMOVE:
|
|
62
|
-
return iconButton("delete", element, className, title, action, isEnabled);
|
|
62
|
+
return iconButton("delete", element, className, dataElementId, title, action, isEnabled);
|
|
63
63
|
case TaskbarElement.INSERT:
|
|
64
|
-
return iconTextButton("plus", element, className, title, title, action, isEnabled);
|
|
64
|
+
return iconTextButton("plus", element, className, dataElementId, title, title, action, isEnabled);
|
|
65
65
|
case TaskbarElement.CANCEL:
|
|
66
|
-
return textButton(element, className, title, title, action, isEnabled);
|
|
66
|
+
return textButton(element, className, dataElementId, title, title, action, isEnabled);
|
|
67
67
|
case TaskbarElement.SAVE:
|
|
68
|
-
return iconTextButton("save", element, className, title, title, action, isEnabled);
|
|
68
|
+
return iconTextButton("save", element, className, dataElementId, title, title, action, isEnabled);
|
|
69
69
|
case TaskbarElement.GRID_MODE:
|
|
70
|
-
return iconButton("table", element, className, title, action, isEnabled);
|
|
70
|
+
return iconButton("table", element, className, dataElementId, title, action, isEnabled);
|
|
71
71
|
case TaskbarElement.FORM_MODE:
|
|
72
|
-
return iconButton("list", element, className, title, action, isEnabled);
|
|
72
|
+
return iconButton("list", element, className, dataElementId, title, action, isEnabled);
|
|
73
73
|
case TaskbarElement.CONFIGURATOR:
|
|
74
|
-
return iconButton("settings-inverted", element, className, title, action, isEnabled);
|
|
74
|
+
return iconButton("settings-inverted", element, className, dataElementId, title, action, isEnabled);
|
|
75
75
|
case TaskbarElement.MORE_OPTIONS:
|
|
76
|
-
return actionButton(element, className, title, action, isEnabled, actions);
|
|
76
|
+
return actionButton(element, className, dataElementId, title, action, isEnabled, actions);
|
|
77
77
|
case TaskbarElement.DIVIDER:
|
|
78
78
|
return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
function textButton(name, className, text, title, action, isEnabled) {
|
|
82
|
-
return h("ez-button", { title: title, label: text, size: "small", class: className, enabled: isEnabled(name), onClick: () => action(name) });
|
|
81
|
+
function textButton(name, className, dataElementId, text, title, action, isEnabled) {
|
|
82
|
+
return h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
|
|
83
83
|
}
|
|
84
|
-
function iconButton(iconName, name, className, title, action, isEnabled) {
|
|
85
|
-
return h("ez-button", { name: iconName, title: title, mode: "icon", size: "small", class: className, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
|
84
|
+
function iconButton(iconName, name, className, dataElementId, title, action, isEnabled) {
|
|
85
|
+
return h("ez-button", { name: iconName, title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
|
86
86
|
}
|
|
87
|
-
function iconTextButton(iconName, name, className, text, title, action, isEnabled) {
|
|
88
|
-
return h("ez-button", { name: iconName, title: title, label: text, size: "small", class: className, enabled: isEnabled(name), onClick: () => action(name) },
|
|
87
|
+
function iconTextButton(iconName, name, className, dataElementId, text, title, action, isEnabled) {
|
|
88
|
+
return h("ez-button", { name: iconName, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
|
|
89
89
|
h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
|
|
90
90
|
}
|
|
91
|
-
function actionButton(element, className, title, action, isEnabled, actions) {
|
|
91
|
+
function actionButton(element, className, dataElementId, title, action, isEnabled, actions) {
|
|
92
92
|
return actions && actions.length > 0
|
|
93
|
-
? h("ez-actions-button", { title: title, size: "small", arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
|
|
93
|
+
? h("ez-actions-button", { title: title, size: "small", "data-element-id": dataElementId, arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
|
|
94
94
|
: undefined;
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -206,26 +206,19 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
206
206
|
className += "ez-padding-left--medium";
|
|
207
207
|
}
|
|
208
208
|
if (TaskbarElement[def.toString()]) {
|
|
209
|
-
return buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
|
|
209
|
+
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
|
|
210
210
|
}
|
|
211
211
|
else {
|
|
212
|
-
return buildCustomButton(def, className, elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
212
|
+
return buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
if (this._application) {
|
|
219
|
-
this._application.getAllAccess().then(access => this._permissions = access);
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
this._permissions = {};
|
|
223
|
-
}
|
|
215
|
+
getIdElemBtnNative(taskbarElem) {
|
|
216
|
+
const elemIdTaskbar = this._element.getAttribute("data-element-id");
|
|
217
|
+
return `${elemIdTaskbar}_${StringUtils.toCamelCase(taskbarElem)}`;
|
|
224
218
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
219
|
+
getIdElemBtnCustom(btnCustom) {
|
|
220
|
+
const elemIdTaskbar = this._element.getAttribute("data-element-id");
|
|
221
|
+
return `${elemIdTaskbar}_${StringUtils.toCamelCase(btnCustom.name)}`;
|
|
229
222
|
}
|
|
230
223
|
isDivider(element) {
|
|
231
224
|
var _a;
|
|
@@ -247,6 +240,24 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
247
240
|
return true;
|
|
248
241
|
});
|
|
249
242
|
}
|
|
243
|
+
componentWillLoad() {
|
|
244
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
245
|
+
if (this._application) {
|
|
246
|
+
this._application.getAllAccess().then(access => this._permissions = access);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
this._permissions = {};
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
componentWillRender() {
|
|
253
|
+
if (this._definitions == undefined && this._permissions) {
|
|
254
|
+
this._definitions = this.elementsFromString(this.buttons);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
componentDidLoad() {
|
|
258
|
+
const dataInfo = { dataUnit: this.dataUnit };
|
|
259
|
+
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
260
|
+
}
|
|
250
261
|
render() {
|
|
251
262
|
if (this._definitions === undefined) {
|
|
252
263
|
return undefined;
|
|
@@ -268,6 +279,7 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
268
279
|
return h("slot", { name: elem });
|
|
269
280
|
}))));
|
|
270
281
|
}
|
|
282
|
+
get _element() { return this; }
|
|
271
283
|
static get watchers() { return {
|
|
272
284
|
"buttons": ["observeButtons"]
|
|
273
285
|
}; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-e4121713.js';
|
|
2
|
-
import { WaitingChangeException, WarningException, ErrorException, ObjectUtils, DataType, DataUnit, StringUtils, ChangeOperation, DateUtils, DependencyType, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-e4121713.js';
|
|
2
|
+
import { WaitingChangeException, WarningException, ErrorException, ObjectUtils, DataType, DataUnit, StringUtils, ChangeOperation, DateUtils, DependencyType, ApplicationContext, ErrorTracking, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { d as dist, D as DataFetcher, R as ResourceFetcher, U as UrlUtils, F as FormConfigFetcher, G as GridConfigFetcher, C as ConfigStorage } from './ConfigStorage-99025655.js';
|
|
4
4
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
5
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-f5ef87df.js';
|
|
@@ -1241,10 +1241,12 @@ const SnkApplication = class {
|
|
|
1241
1241
|
window.requestAnimationFrame(() => {
|
|
1242
1242
|
this.applicationLoaded.emit(true);
|
|
1243
1243
|
});
|
|
1244
|
+
ElementIDUtils.addIDInfo(this._element, `resource_${this._resourceID}`);
|
|
1244
1245
|
}
|
|
1245
1246
|
render() {
|
|
1246
1247
|
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
|
|
1247
1248
|
}
|
|
1249
|
+
get _element() { return getElement(this); }
|
|
1248
1250
|
};
|
|
1249
1251
|
class RequestListenerLoadingBar {
|
|
1250
1252
|
constructor() {
|
|
@@ -246,11 +246,19 @@ const SnkGrid = class {
|
|
|
246
246
|
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState);
|
|
247
247
|
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState);
|
|
248
248
|
}
|
|
249
|
+
componentDidLoad() {
|
|
250
|
+
const dataInfo = { dataUnit: this._dataUnit };
|
|
251
|
+
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
252
|
+
}
|
|
253
|
+
getDataElementId(suffix) {
|
|
254
|
+
const elemIdSnkGrid = this._element.getAttribute("data-element-id");
|
|
255
|
+
return `${elemIdSnkGrid}_${suffix}`;
|
|
256
|
+
}
|
|
249
257
|
render() {
|
|
250
258
|
if (!this._dataUnit) {
|
|
251
259
|
return undefined;
|
|
252
260
|
}
|
|
253
|
-
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-padding-bottom--medium ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, 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", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), 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(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection }, h("snk-taskbar", { dataUnit: this._dataUnit, 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("data-element-id"), selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
261
|
+
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-padding-bottom--medium ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": this.getDataElementId("internal_filter"), 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": this.getDataElementId("grid_top_taskbar"), key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), h("ez-grid", { ref: ref => this._grid = ref, "data-element-id": this.getDataElementId("internal_grid"), 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, "data-element-id": this.getDataElementId("grid_left_taskBar"), 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("data-element-id"), selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
254
262
|
}
|
|
255
263
|
get _element() { return getElement(this); }
|
|
256
264
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-e4121713.js';
|
|
2
|
-
import { ApplicationContext } from '@sankhyalabs/core';
|
|
2
|
+
import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { c as VIEW_MODE } from './constants-babe1a08.js';
|
|
4
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
|
4
|
+
import { T as TaskbarElement } from './taskbar-elements-a0a8c3ac.js';
|
|
5
5
|
|
|
6
6
|
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
|
7
7
|
|
|
@@ -59,6 +59,10 @@ const SnkCrud = class {
|
|
|
59
59
|
this.setViewMode(GRID_MODE);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
+
getDataElementId(suffix) {
|
|
63
|
+
const elemIdSnkCrud = this._element.getAttribute("data-element-id");
|
|
64
|
+
return `${elemIdSnkCrud}_${suffix}`;
|
|
65
|
+
}
|
|
62
66
|
componentWillLoad() {
|
|
63
67
|
let parent = this._element.parentElement;
|
|
64
68
|
while (parent) {
|
|
@@ -85,8 +89,12 @@ const SnkCrud = class {
|
|
|
85
89
|
this.configName = application.configName;
|
|
86
90
|
}
|
|
87
91
|
}
|
|
92
|
+
componentDidLoad() {
|
|
93
|
+
const dataInfo = { dataUnit: this._dataUnit };
|
|
94
|
+
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
95
|
+
}
|
|
88
96
|
render() {
|
|
89
|
-
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, 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 }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-form", { ref: (ref) => this._snkForm = ref, 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) })));
|
|
97
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": this.getDataElementId("crud_ViewStack") }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": this.getDataElementId("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 }, 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": this.getDataElementId("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) })));
|
|
90
98
|
}
|
|
91
99
|
get _element() { return getElement(this); }
|
|
92
100
|
};
|
|
@@ -7,7 +7,7 @@ import { CheckMode, ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/
|
|
|
7
7
|
import { C as ConfigStorage } from './ConfigStorage-99025655.js';
|
|
8
8
|
import { O as ORDER_VALUES } from './constants-babe1a08.js';
|
|
9
9
|
import { A as AuthorizationConfig } from './AuthorizationConfig-dcbd207a.js';
|
|
10
|
-
import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-
|
|
10
|
+
import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-a0a8c3ac.js';
|
|
11
11
|
import './_commonjsHelpers-9943807e.js';
|
|
12
12
|
|
|
13
13
|
const buildFilter = (item) => {
|
|
@@ -1448,26 +1448,19 @@ const SnkTaskbar = class {
|
|
|
1448
1448
|
className += "ez-padding-left--medium";
|
|
1449
1449
|
}
|
|
1450
1450
|
if (TaskbarElement[def.toString()]) {
|
|
1451
|
-
return buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
|
|
1451
|
+
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
|
|
1452
1452
|
}
|
|
1453
1453
|
else {
|
|
1454
|
-
return buildCustomButton(def, className, elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
1454
|
+
return buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
1455
1455
|
}
|
|
1456
1456
|
}
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
if (this._application) {
|
|
1461
|
-
this._application.getAllAccess().then(access => this._permissions = access);
|
|
1462
|
-
}
|
|
1463
|
-
else {
|
|
1464
|
-
this._permissions = {};
|
|
1465
|
-
}
|
|
1457
|
+
getIdElemBtnNative(taskbarElem) {
|
|
1458
|
+
const elemIdTaskbar = this._element.getAttribute("data-element-id");
|
|
1459
|
+
return `${elemIdTaskbar}_${StringUtils.toCamelCase(taskbarElem)}`;
|
|
1466
1460
|
}
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
}
|
|
1461
|
+
getIdElemBtnCustom(btnCustom) {
|
|
1462
|
+
const elemIdTaskbar = this._element.getAttribute("data-element-id");
|
|
1463
|
+
return `${elemIdTaskbar}_${StringUtils.toCamelCase(btnCustom.name)}`;
|
|
1471
1464
|
}
|
|
1472
1465
|
isDivider(element) {
|
|
1473
1466
|
var _a;
|
|
@@ -1489,6 +1482,24 @@ const SnkTaskbar = class {
|
|
|
1489
1482
|
return true;
|
|
1490
1483
|
});
|
|
1491
1484
|
}
|
|
1485
|
+
componentWillLoad() {
|
|
1486
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
1487
|
+
if (this._application) {
|
|
1488
|
+
this._application.getAllAccess().then(access => this._permissions = access);
|
|
1489
|
+
}
|
|
1490
|
+
else {
|
|
1491
|
+
this._permissions = {};
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
componentWillRender() {
|
|
1495
|
+
if (this._definitions == undefined && this._permissions) {
|
|
1496
|
+
this._definitions = this.elementsFromString(this.buttons);
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
componentDidLoad() {
|
|
1500
|
+
const dataInfo = { dataUnit: this.dataUnit };
|
|
1501
|
+
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
1502
|
+
}
|
|
1492
1503
|
render() {
|
|
1493
1504
|
if (this._definitions === undefined) {
|
|
1494
1505
|
return undefined;
|
|
@@ -1510,6 +1521,7 @@ const SnkTaskbar = class {
|
|
|
1510
1521
|
return h("slot", { name: elem });
|
|
1511
1522
|
}))));
|
|
1512
1523
|
}
|
|
1524
|
+
get _element() { return getElement(this); }
|
|
1513
1525
|
static get watchers() { return {
|
|
1514
1526
|
"buttons": ["observeButtons"]
|
|
1515
1527
|
}; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-e4121713.js';
|
|
2
2
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-a79b2fa8.js';
|
|
4
|
-
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
4
|
+
import { ElementIDUtils, DataType } from '@sankhyalabs/core';
|
|
5
5
|
|
|
6
6
|
const SnkFilterDetail = class {
|
|
7
7
|
constructor(hostRef) {
|
|
@@ -53,12 +53,22 @@ const SnkFilterDetail = class {
|
|
|
53
53
|
buildIcon(title, iconName, action) {
|
|
54
54
|
return (h("button", { onClick: () => action(), class: "sc-snk-filter-bar snk-filter-item__editor-header-button" }, h("ez-icon", { title: title, iconName: iconName })));
|
|
55
55
|
}
|
|
56
|
+
getNormalizedValue(params, value) {
|
|
57
|
+
return params.reduce((arrayValues, currentParam, index) => {
|
|
58
|
+
if (currentParam.dataType === DataType.BOOLEAN && (arrayValues == undefined || arrayValues[index] == undefined)) {
|
|
59
|
+
arrayValues = arrayValues || [];
|
|
60
|
+
arrayValues[index] = false;
|
|
61
|
+
}
|
|
62
|
+
return arrayValues;
|
|
63
|
+
}, value);
|
|
64
|
+
}
|
|
56
65
|
apply() {
|
|
57
66
|
var _a;
|
|
58
67
|
let value = this._editor["value"];
|
|
59
68
|
let isValid = true;
|
|
60
69
|
if (this.config.type === FilterItemType.PERSONALIZED) {
|
|
61
70
|
const params = ((_a = this.config.props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || [];
|
|
71
|
+
value = this.getNormalizedValue(params, value);
|
|
62
72
|
const paramsCount = params.length;
|
|
63
73
|
if (paramsCount === 0) {
|
|
64
74
|
//Valor do filtro personalizado sem parametros deve ser um array vazio
|