@sankhyalabs/sankhyablocks 2.4.5 → 2.4.6
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-configurator_3.cjs.entry.js +8 -8
- package/dist/cjs/snk-crud.cjs.entry.js +6 -6
- package/dist/cjs/snk-filter-bar_7.cjs.entry.js +14 -19
- package/dist/cjs/snk-form-config.cjs.entry.js +4 -4
- package/dist/cjs/snk-form.cjs.entry.js +2 -6
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-tab-config.cjs.entry.js +7 -0
- package/dist/collection/components/snk-configurator/snk-configurator.js +1 -1
- package/dist/collection/components/snk-crud/snk-crud.js +6 -6
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +2 -4
- package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +7 -5
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +1 -4
- package/dist/collection/components/snk-form/snk-form.js +2 -6
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js +1 -1
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +4 -4
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +8 -1
- package/dist/collection/components/snk-grid/snk-grid.js +6 -6
- package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +2 -2
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +1 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -4
- package/dist/components/snk-configurator2.js +1 -1
- package/dist/components/snk-crud.js +7 -7
- package/dist/components/snk-field-config2.js +1 -1
- package/dist/components/snk-filter-bar2.js +1 -4
- package/dist/components/snk-filter-item2.js +2 -4
- package/dist/components/snk-filter-list2.js +7 -5
- package/dist/components/snk-form-config2.js +4 -4
- package/dist/components/snk-form2.js +2 -6
- package/dist/components/snk-grid-config2.js +2 -2
- package/dist/components/snk-grid2.js +6 -6
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/snk-tab-config2.js +8 -1
- package/dist/components/snk-taskbar2.js +3 -5
- package/dist/esm/snk-configurator_3.entry.js +8 -8
- package/dist/esm/snk-crud.entry.js +7 -7
- package/dist/esm/snk-filter-bar_7.entry.js +14 -19
- package/dist/esm/snk-form-config.entry.js +4 -4
- package/dist/esm/snk-form.entry.js +2 -6
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-tab-config.entry.js +8 -1
- package/dist/sankhyablocks/p-1bc8f32f.entry.js +1 -0
- package/dist/sankhyablocks/{p-56db1231.entry.js → p-60038252.entry.js} +1 -1
- package/dist/sankhyablocks/p-71997e4c.entry.js +1 -0
- package/dist/sankhyablocks/p-9010ac54.entry.js +1 -0
- package/dist/sankhyablocks/p-b05638d2.entry.js +1 -0
- package/dist/sankhyablocks/p-c30d0966.entry.js +1 -0
- package/dist/sankhyablocks/p-e6e0efe7.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +1 -2
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +0 -1
- package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +0 -1
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -2
- package/dist/types/components/snk-form/snk-form.d.ts +0 -1
- package/dist/types/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.d.ts +1 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +1 -2
- package/package.json +1 -1
- package/dist/sankhyablocks/p-2e0747f9.entry.js +0 -1
- package/dist/sankhyablocks/p-67c1700b.entry.js +0 -1
- package/dist/sankhyablocks/p-825c8975.entry.js +0 -1
- package/dist/sankhyablocks/p-cd03ea9e.entry.js +0 -1
- package/dist/sankhyablocks/p-d2b0f1fc.entry.js +0 -1
- package/dist/sankhyablocks/p-d61f2170.entry.js +0 -1
|
@@ -94,7 +94,7 @@ const SnkConfigurator = class {
|
|
|
94
94
|
render() {
|
|
95
95
|
return (index.h("ez-modal", { opened: this._opened, "close-esc": false, "close-outside-click": false, "modal-size": "small" }, index.h("div", { class: "snk-configurator" }, index.h("div", { class: "snk-configurator__header" }, index.h("label", { class: "snk-configurator__title" }, this.getMessage("snkConfigurator.titleConfigurations")), index.h("div", { class: "snk-configurator__button-close" }, index.h("ez-button", { mode: 'icon', iconName: "close", size: 'medium', onClick: () => this.closeConfig() }))), index.h("div", { class: "snk-configurator__main" }, index.h("ez-radio-button", { class: "ez-margin-top--medium", label: this.getMessage("snkConfigurator.subTitleModeConfig"), value: this.getViewModeValue(), onEzChange: (evt) => this.onViewModeChanged(evt), enabled: this.enableModeConfig() }, index.h("ez-radio-button-option", { label: this.getMessage("snkConfigurator.labelGrid"), value: GRID_MODE.name }), index.h("ez-radio-button-option", { label: this.getMessage("snkConfigurator.labelForm"), value: FORM_MODE.name })), index.h("ez-button", { mode: "slim", label: this.viewMode === GRID_MODE.name
|
|
96
96
|
? this.getMessage("snkConfigurator.labelConfigGrid")
|
|
97
|
-
: this.getMessage("snkConfigurator.labelConfigForm"), class: "snk-configurator__button-config ez-button--primary", onClick: () => this.onClickOpenConfig() }), index.h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" })))));
|
|
97
|
+
: this.getMessage("snkConfigurator.labelConfigForm"), class: "snk-configurator__button-config ez-button--primary", onClick: () => this.onClickOpenConfig(), id: "openConfigurator" }), index.h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" })))));
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
SnkConfigurator.style = snkConfiguratorCss;
|
|
@@ -141,7 +141,7 @@ const SnkFieldConfig = class {
|
|
|
141
141
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
142
142
|
}
|
|
143
143
|
componentDidLoad() {
|
|
144
|
-
core.ElementIDUtils.addIDInfo(this._element
|
|
144
|
+
core.ElementIDUtils.addIDInfo(this._element);
|
|
145
145
|
}
|
|
146
146
|
render() {
|
|
147
147
|
if (this.fieldConfig == undefined) {
|
|
@@ -238,8 +238,12 @@ const SnkGrid = class {
|
|
|
238
238
|
if (!this._dataUnit) {
|
|
239
239
|
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
240
240
|
this._dataUnit = evt.detail;
|
|
241
|
+
this.addElementID();
|
|
241
242
|
});
|
|
242
243
|
}
|
|
244
|
+
else {
|
|
245
|
+
this.addElementID();
|
|
246
|
+
}
|
|
243
247
|
this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
|
|
244
248
|
this._dataState = evt.detail;
|
|
245
249
|
});
|
|
@@ -254,19 +258,15 @@ const SnkGrid = class {
|
|
|
254
258
|
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState);
|
|
255
259
|
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState);
|
|
256
260
|
}
|
|
257
|
-
|
|
261
|
+
addElementID() {
|
|
258
262
|
const dataInfo = { dataUnit: this._dataUnit };
|
|
259
263
|
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
260
264
|
}
|
|
261
|
-
getDataElementId(suffix) {
|
|
262
|
-
const elemIdSnkGrid = this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
|
263
|
-
return `${elemIdSnkGrid}_${suffix}`;
|
|
264
|
-
}
|
|
265
265
|
render() {
|
|
266
266
|
if (!this._dataUnit) {
|
|
267
267
|
return undefined;
|
|
268
268
|
}
|
|
269
|
-
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-padding-bottom--medium ez-margin-bottom--medium" }, index.h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id":
|
|
269
|
+
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-padding-bottom--medium ez-margin-bottom--medium" }, index.h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), index.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: "INSERT" })), index.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 }, index.h("snk-taskbar", { dataUnit: this._dataUnit, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
270
270
|
}
|
|
271
271
|
get _element() { return index.getElement(this); }
|
|
272
272
|
};
|
|
@@ -63,10 +63,6 @@ const SnkCrud = class {
|
|
|
63
63
|
this.setViewMode(GRID_MODE);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
getDataElementId(suffix) {
|
|
67
|
-
const elemIdSnkCrud = this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
|
68
|
-
return `${elemIdSnkCrud}_${suffix}`;
|
|
69
|
-
}
|
|
70
66
|
componentWillLoad() {
|
|
71
67
|
let parent = this._element.parentElement;
|
|
72
68
|
while (parent) {
|
|
@@ -79,8 +75,12 @@ const SnkCrud = class {
|
|
|
79
75
|
if (!this._dataUnit) {
|
|
80
76
|
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
81
77
|
this._dataUnit = evt.detail;
|
|
78
|
+
this.addDataElementID();
|
|
82
79
|
});
|
|
83
80
|
}
|
|
81
|
+
else {
|
|
82
|
+
this.addDataElementID();
|
|
83
|
+
}
|
|
84
84
|
this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
|
|
85
85
|
this._dataState = evt.detail;
|
|
86
86
|
});
|
|
@@ -93,12 +93,12 @@ const SnkCrud = class {
|
|
|
93
93
|
this.configName = application.configName;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
addDataElementID() {
|
|
97
97
|
const dataInfo = { dataUnit: this._dataUnit };
|
|
98
98
|
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
99
99
|
}
|
|
100
100
|
render() {
|
|
101
|
-
return (index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id":
|
|
101
|
+
return (index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.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 }, index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.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) }, index.h("slot", { name: "SnkFormTaskBar" }))), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._viewMode, onConfigSelected: (evt) => this.executeAction(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail) })));
|
|
102
102
|
}
|
|
103
103
|
get _element() { return index.getElement(this); }
|
|
104
104
|
};
|
|
@@ -165,9 +165,6 @@ const SnkFilterBar = class {
|
|
|
165
165
|
if (this._element) {
|
|
166
166
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
167
167
|
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
168
|
-
const dataElementIdFilterBar = this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
|
169
|
-
this._idSnkFilterItem = dataElementIdFilterBar;
|
|
170
|
-
this._idSnkFilterList = dataElementIdFilterBar;
|
|
171
168
|
}
|
|
172
169
|
}
|
|
173
170
|
processPendingFilter() {
|
|
@@ -484,7 +481,7 @@ const SnkFilterBar = class {
|
|
|
484
481
|
if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
|
|
485
482
|
return undefined;
|
|
486
483
|
}
|
|
487
|
-
return (index.h(index.Host, null, index.h("ez-scroller", { direction: "horizontal", activeShadow: true, locked: this.scrollerLocked }, this.getFilterItems()), index.h("snk-filter-list", { id: APPLIED_FILTERS, onFocusin: () => this.itemFocused(APPLIED_FILTERS), items: this.getAppliedListItems(), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyAppliedFiltersList"), findFilterText: this.getMessage("snkFilterBar.findFilter"), iconName: "filter", class: "ez-padding-left--medium", buttonClass: this.getActiveClass(), onSnkItemSelected: evt => this.appliedFilterHandler(evt.detail), "data-element-id":
|
|
484
|
+
return (index.h(index.Host, null, index.h("ez-scroller", { direction: "horizontal", activeShadow: true, locked: this.scrollerLocked }, this.getFilterItems()), index.h("snk-filter-list", { id: APPLIED_FILTERS, onFocusin: () => this.itemFocused(APPLIED_FILTERS), items: this.getAppliedListItems(), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyAppliedFiltersList"), findFilterText: this.getMessage("snkFilterBar.findFilter"), iconName: "filter", class: "ez-padding-left--medium", buttonClass: this.getActiveClass(), onSnkItemSelected: evt => this.appliedFilterHandler(evt.detail), "data-element-id": "apppliedFilters" }), index.h("snk-filter-list", { id: ADD_FILTER, onFocusin: () => this.itemFocused(ADD_FILTER), items: this.getAddListItems(), label: this.getMessage("snkFilterBar.addFilter"), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyFiltersList"), findFilterText: this.getMessage("snkFilterBar.findField"), class: "ez-padding-left--medium", onSnkItemSelected: evt => this.addFilterHandler(evt.detail), "data-element-id": "addFilters" }, index.h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
|
|
488
485
|
}
|
|
489
486
|
get _element() { return index.getElement(this); }
|
|
490
487
|
static get watchers() { return {
|
|
@@ -637,9 +634,7 @@ const SnkFilterItem = class {
|
|
|
637
634
|
componentDidLoad() {
|
|
638
635
|
if (this._filterItemElement) {
|
|
639
636
|
core.ElementIDUtils.addIDInfo(this._filterItemElement);
|
|
640
|
-
|
|
641
|
-
this._idSnkFilterDetail = `${dataElementIdDoFilterItem}_${this.config.id}`;
|
|
642
|
-
this._idEzChip = `${dataElementIdDoFilterItem}_${this.config.id}`;
|
|
637
|
+
this._idSnkFilterDetail = `filterDetail_${this.config.id}`;
|
|
643
638
|
}
|
|
644
639
|
}
|
|
645
640
|
componentDidRender() {
|
|
@@ -672,7 +667,7 @@ const SnkFilterItem = class {
|
|
|
672
667
|
}
|
|
673
668
|
render() {
|
|
674
669
|
const leftIcon = this.getLeftIconName();
|
|
675
|
-
return (index.h(index.Host, null, index.h("ez-chip", { ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.config.value != undefined,
|
|
670
|
+
return (index.h(index.Host, null, index.h("ez-chip", { ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.config.value != undefined, id: this.config.id }, leftIcon ? index.h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, index.h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), index.h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, index.h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
|
|
676
671
|
}
|
|
677
672
|
get _filterItemElement() { return index.getElement(this); }
|
|
678
673
|
static get watchers() { return {
|
|
@@ -739,13 +734,15 @@ const SnkFilterList = class {
|
|
|
739
734
|
this._popover.remove();
|
|
740
735
|
}
|
|
741
736
|
}
|
|
737
|
+
this._element.querySelectorAll("button.sc-snk-filter-bar").forEach((itemListElement) => {
|
|
738
|
+
const dataElement = { id: itemListElement.getAttribute("name") };
|
|
739
|
+
itemListElement === null || itemListElement === void 0 ? void 0 : itemListElement.removeAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
|
740
|
+
core.ElementIDUtils.addIDInfoIfNotExists(itemListElement, "filterItemList", dataElement);
|
|
741
|
+
});
|
|
742
742
|
}
|
|
743
743
|
buildItemElement(item) {
|
|
744
744
|
const itemId = ++this._selectableItemsCount;
|
|
745
|
-
|
|
746
|
-
core.ElementIDUtils.addIDInfo(this._buttonElement);
|
|
747
|
-
}
|
|
748
|
-
return (index.h("button", { id: `filter-item${itemId}`, onFocusin: () => this._preselection = itemId, class: `ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item`, onClick: () => this.itemSelected(item.name), ref: (el) => this._buttonElement = el }, item.iconName ? index.h("ez-icon", { iconName: item.iconName, size: "small", class: `ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${item.iconClass || ""}` }) : undefined, index.h("div", { class: `ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${item.labelClass || ""}` }, item.label)));
|
|
745
|
+
return (index.h("button", { id: `filter-item${itemId}`, onFocusin: () => this._preselection = itemId, class: `ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item`, onClick: () => this.itemSelected(item.name), name: item.label, key: itemId }, item.iconName ? index.h("ez-icon", { iconName: item.iconName, size: "small", class: `ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${item.iconClass || ""}` }) : undefined, index.h("div", { class: `ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${item.labelClass || ""}` }, item.label)));
|
|
749
746
|
}
|
|
750
747
|
itemSelected(itemName) {
|
|
751
748
|
if (itemName === SHOW_MORE_ITEM_NAME) {
|
|
@@ -806,7 +803,7 @@ const SnkFilterList = class {
|
|
|
806
803
|
}
|
|
807
804
|
}
|
|
808
805
|
render() {
|
|
809
|
-
return (index.h(index.Host, { class: "ez-flex ez-flex--column" }, index.h("ez-button", { class: this.buttonClass, label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, index.h("slot", { name: "leftIcon" })), index.h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, index.h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem }, index.h("ez-filter-input", { ref: ref => this._filterInput = ref, mode: "slim", label: this.findFilterText, value: this._filterArgument, onEzChange: (evt) => this._filterArgument = evt.detail, onFocus: () => this._preselection = 0 }), this.getFilterItems(), index.h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
|
|
806
|
+
return (index.h(index.Host, { class: "ez-flex ez-flex--column" }, index.h("ez-button", { class: this.buttonClass, label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, index.h("slot", { name: "leftIcon" })), index.h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, index.h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem }, index.h("ez-filter-input", { ref: ref => this._filterInput = ref, "data-element-id": "serachFilters", mode: "slim", label: this.findFilterText, value: this._filterArgument, onEzChange: (evt) => this._filterArgument = evt.detail, onFocus: () => this._preselection = 0 }), this.getFilterItems(), index.h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
|
|
810
807
|
}
|
|
811
808
|
get _element() { return index.getElement(this); }
|
|
812
809
|
};
|
|
@@ -972,7 +969,7 @@ const EzGridConfig = class {
|
|
|
972
969
|
this._columListItems = [visibleGroup, hiddenGroup];
|
|
973
970
|
}
|
|
974
971
|
buildColumnListSlot(item, group) {
|
|
975
|
-
const dataElementId =
|
|
972
|
+
const dataElementId = `configItem_${core.StringUtils.replaceAccentuatedChars(core.StringUtils.toCamelCase(item.label))}`;
|
|
976
973
|
return (index.h("div", null, index.h("ez-check", { mode: 'switch', id: 'switch' + ((item === null || item === void 0 ? void 0 : item.label) || '') + ((group === null || group === void 0 ? void 0 : group.group) || ''), value: group.group === this.getMessage("snkGridConfig.group.visible"), "data-element-id": dataElementId, onEzChange: (evt) => { this.switchColumnGroup(evt, item); } })));
|
|
977
974
|
}
|
|
978
975
|
buildOrderListSlot(item) {
|
|
@@ -1335,7 +1332,7 @@ const EzGridConfig = class {
|
|
|
1335
1332
|
core.ElementIDUtils.addIDInfo(this._element);
|
|
1336
1333
|
}
|
|
1337
1334
|
render() {
|
|
1338
|
-
return (index.h(index.Host, null, index.h("div", { class: "grid-config__header" }, index.h("div", { class: "title-container" }, index.h("div", { class: "" }, index.h("label", { class: "title" }, this.getMessage("snkGridConfig.gridConfiguration")), index.h("label", { class: "subtitle" }, this.getMessage("snkGridConfig.columnVisibilityOrder"))), index.h("div", { class: "button-close" }, index.h("ez-button", { mode: 'icon', iconName: "close", size: 'medium', onClick: () => this.closeConfig() }))), index.h("div", { class: "tabselector-container" }, index.h("ez-tabselector", { selectedIndex: this.selectedIndex, onEzChange: (evt) => { this.handleTabChange(evt.detail); }, tabs: this.getColumnNames() })), index.h("div", null, index.h("ez-text-input", { ref: (el) => this._searchElement = el, label: this.getMessage("snkGridConfig.findColumn"), onKeyUp: (evt) => this.locateColumn(evt) }, index.h("ez-icon", { slot: "leftIcon", size: "medium", iconName: "search" })))), index.h("div", { class: "grid-config__main" }, index.h("ez-list", { ref: (el) => this._columnList = el, class: this.selectedIndex === 0 ? "" : "hidden", dataSource: this._columListItems, onEzChange: (evt) => this.handleColumnListChange(evt), ezDraggable: true, ezSelectable: true, itemSlotBuilder: (item, group) => this.buildColumnListSlot(item, group), useGroups: true }), index.h("div", { class: this.selectedIndex === 1 ? "group-name" : "hidden" }, this.getMessage("snkGridConfig.info.sortingSequence")), index.h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedIndex === 1 ? "height-calc" : "hidden", dataSource: this._orderListItems, ezSelectable: true, onEzChange: (evt) => this.handleOrderListChange(evt), ezDraggable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item) })), index.h("div", { class: "grid-config__footer" }, index.h("ez-button", { class: "padding-right--medium", label: this.getMessage("snkGridConfig.cancel"), onClick: () => this.closeConfig() }), index.h("ez-button", { label: this.getMessage("snkGridConfig.complete"), class: "ez-button--primary", onClick: () => this.finish() }))));
|
|
1335
|
+
return (index.h(index.Host, null, index.h("div", { class: "grid-config__header" }, index.h("div", { class: "title-container" }, index.h("div", { class: "" }, index.h("label", { class: "title" }, this.getMessage("snkGridConfig.gridConfiguration")), index.h("label", { class: "subtitle" }, this.getMessage("snkGridConfig.columnVisibilityOrder"))), index.h("div", { class: "button-close" }, index.h("ez-button", { mode: 'icon', iconName: "close", size: 'medium', onClick: () => this.closeConfig() }))), index.h("div", { class: "tabselector-container" }, index.h("ez-tabselector", { selectedIndex: this.selectedIndex, onEzChange: (evt) => { this.handleTabChange(evt.detail); }, tabs: this.getColumnNames() })), index.h("div", null, index.h("ez-text-input", { "data-element-id": "searchColums", ref: (el) => this._searchElement = el, label: this.getMessage("snkGridConfig.findColumn"), onKeyUp: (evt) => this.locateColumn(evt) }, index.h("ez-icon", { slot: "leftIcon", size: "medium", iconName: "search" })))), index.h("div", { class: "grid-config__main" }, index.h("ez-list", { ref: (el) => this._columnList = el, class: this.selectedIndex === 0 ? "" : "hidden", dataSource: this._columListItems, onEzChange: (evt) => this.handleColumnListChange(evt), ezDraggable: true, ezSelectable: true, itemSlotBuilder: (item, group) => this.buildColumnListSlot(item, group), useGroups: true, "data-element-id": "configCols" }), index.h("div", { class: this.selectedIndex === 1 ? "group-name" : "hidden" }, this.getMessage("snkGridConfig.info.sortingSequence")), index.h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedIndex === 1 ? "height-calc" : "hidden", dataSource: this._orderListItems, ezSelectable: true, onEzChange: (evt) => this.handleOrderListChange(evt), ezDraggable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item), "data-element-id": "configDataOrder" })), index.h("div", { class: "grid-config__footer" }, index.h("ez-button", { class: "padding-right--medium", label: this.getMessage("snkGridConfig.cancel"), onClick: () => this.closeConfig() }), index.h("ez-button", { label: this.getMessage("snkGridConfig.complete"), class: "ez-button--primary", onClick: () => this.finish() }))));
|
|
1339
1336
|
}
|
|
1340
1337
|
static get assetsDirs() { return ["../assets"]; }
|
|
1341
1338
|
get _element() { return index.getElement(this); }
|
|
@@ -1480,12 +1477,10 @@ const SnkTaskbar = class {
|
|
|
1480
1477
|
}
|
|
1481
1478
|
}
|
|
1482
1479
|
getIdElemBtnNative(taskbarElem) {
|
|
1483
|
-
|
|
1484
|
-
return `${elemIdTaskbar}_${core.StringUtils.toCamelCase(taskbarElem)}`;
|
|
1480
|
+
return core.StringUtils.toCamelCase(taskbarElem);
|
|
1485
1481
|
}
|
|
1486
1482
|
getIdElemBtnCustom(btnCustom) {
|
|
1487
|
-
|
|
1488
|
-
return `${elemIdTaskbar}_${core.StringUtils.toCamelCase(btnCustom.name)}`;
|
|
1483
|
+
return core.StringUtils.toCamelCase(btnCustom.name);
|
|
1489
1484
|
}
|
|
1490
1485
|
isDivider(element) {
|
|
1491
1486
|
var _a;
|
|
@@ -242,7 +242,7 @@ const SnkFormConfig = class {
|
|
|
242
242
|
var _a;
|
|
243
243
|
return ((_a = group.fields) === null || _a === void 0 ? void 0 : _a.length) ? group.fields.map((field) => {
|
|
244
244
|
var _a, _b;
|
|
245
|
-
return index.h("div", { key: field.name, class: this.getFieldConfigStyle(field), "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, index.h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, modeInsertion: false, fieldConfig: field,
|
|
245
|
+
return index.h("div", { key: field.name, class: this.getFieldConfigStyle(field), "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, index.h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, modeInsertion: false, fieldConfig: field, dataUnit: this.dataUnit, isConfigActive: ((_a = this._fieldConfigSelected) === null || _a === void 0 ? void 0 : _a.name) === field.name, id: field.name }), ((_b = this._fieldConfigSelected) === null || _b === void 0 ? void 0 : _b.name) === field.name &&
|
|
246
246
|
index.h("div", { class: "ez-flex form-config__config-options" }, index.h("snk-config-options", { idConfig: field.name, dataUnit: this.dataUnit, fieldConfig: this._fieldConfigSelected, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), onConfigOptionsChanged: (evt) => this.handleconfigOptionsChanged(evt.detail) })));
|
|
247
247
|
}) : index.h("div", { class: "form-config__add-group-container" }, index.h("div", { class: "form-config__add-group-content" }, index.h("div", { class: "form-config__add-group-label" }, index.h("label", { class: "ez-text ez-text--center ez-text--medium ez-text--primary ez-text--bold" }, this.getMessage("snkFormConfig.form.labelDropField")))));
|
|
248
248
|
}
|
|
@@ -955,7 +955,7 @@ const SnkFormConfig = class {
|
|
|
955
955
|
const configOptions = this._formConfigOptions.map((option) => {
|
|
956
956
|
return { value: option.origin, label: option.name };
|
|
957
957
|
});
|
|
958
|
-
return (index.h(index.Host, null, index.h("div", { class: "ez-row ez-padding--medium" }, index.h("div", { class: "ez-col ez-col--sd-7 ez-col--tb-9 ez-align--middle" }, index.h("ez-button", { mode: "icon", iconName: "arrow_back", class: "ez-padding--small", size: "small", onClick: () => this.closeFormConfig() }), index.h("h1", { class: "ez-title ez-title--extra-large ez-padding--small" }, this.getMessage("snkFormConfig.title")), index.h("ez-actions-button", { class: "form-config__actions-button ez-margin-left--medium", value: (_a = this._optionFormConfigSelected) === null || _a === void 0 ? void 0 : _a.origin, showLabel: true, displayIcon: "chevron-down", checkOption: true, size: "small", actions: configOptions, onEzAction: (evt) => this.controlSelectFormConfig(evt) })), index.h("div", { class: "ez-col ez-col--sd-5 ez-col--tb-3 ez-align--middle ez-align--right" }, this._formConfigChanged === true && this._optionFormConfigChanged === false &&
|
|
958
|
+
return (index.h(index.Host, null, index.h("div", { class: "ez-row ez-padding--medium" }, index.h("div", { class: "ez-col ez-col--sd-7 ez-col--tb-9 ez-align--middle" }, index.h("ez-button", { mode: "icon", iconName: "arrow_back", class: "ez-padding--small", size: "small", onClick: () => this.closeFormConfig(), id: "formConfigToBack" }), index.h("h1", { class: "ez-title ez-title--extra-large ez-padding--small" }, this.getMessage("snkFormConfig.title")), index.h("ez-actions-button", { class: "form-config__actions-button ez-margin-left--medium", value: (_a = this._optionFormConfigSelected) === null || _a === void 0 ? void 0 : _a.origin, showLabel: true, displayIcon: "chevron-down", checkOption: true, size: "small", actions: configOptions, onEzAction: (evt) => this.controlSelectFormConfig(evt), id: "selectConfig" })), index.h("div", { class: "ez-col ez-col--sd-5 ez-col--tb-3 ez-align--middle ez-align--right" }, this._formConfigChanged === true && this._optionFormConfigChanged === false &&
|
|
959
959
|
index.h("div", { class: "ez-row ez-align--middle ez-align--right" }, index.h("ez-button", { label: "Cancelar", class: "ez-padding-left--medium", size: "small", onClick: () => this.cancelChangeConfig() }), index.h("ez-button", { label: "Salvar", class: "ez-button--primary ez-padding-left--medium", size: "small", onClick: () => this.saveConfig() }, index.h("ez-icon", { class: "ez-margin-right--small", slot: "leftIcon", iconName: "save" }))), this._optionFormConfigChanged === true &&
|
|
960
960
|
index.h("div", { class: "ez-row ez-align--middle ez-align--right" }, index.h("ez-button", { label: "Cancelar", class: "ez-padding-left--medium", size: "small", onClick: () => this.cancelChangeOptionConfig() }), index.h("ez-button", { label: this.getMessage("snkFormConfig.applyConfig"), class: "ez-button--primary ez-padding-left--medium", size: "small", onClick: () => this.applyOptionConfig() })))), index.h("div", { class: "ez-row ez-padding--medium", ref: ref => this._sortableContainer = ref }, index.h("div", { class: "form-config__tab-container ez-col ez-col--sd-9 ez-col--tb-9 ez-padding-right--medium" }, ((_b = this._layoutFormConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
|
961
961
|
index.h("section", { class: "ez-box__container", ref: ref => this._formContainer = ref }, index.h("snk-tab-config", { ref: ref => this._tabConfig = ref, selectedIndex: this._tabSelected, onEzTabChange: (ev) => this.changeTabSelected(ev.detail), onEzOrderChange: (ev) => this.changeTabOrder(ev.detail), onEditionTitleTab: (ev) => this.changeTabLabel(ev), onDeleteTab: (ev) => this.handleDeleteTab(ev), onHideTab: (ev) => this.changeHideTab(ev), onCanStartDrag: () => this.handleCanStartDragTab() }, this._layoutFormConfig.map((tab) => index.h("snk-tab", { tabKey: tab.tab, label: tab.tab, visible: tab.visible }))), this._layoutFormConfig.map((tab, indexTab) => index.h("div", { id: "tab" + indexTab, "data-draggable-parent": "group", class: this._tabSelected === indexTab
|
|
@@ -970,8 +970,8 @@ const SnkFormConfig = class {
|
|
|
970
970
|
else {
|
|
971
971
|
return index.h("div", { class: "ez-flex ez-flex--column ez-size-width--full" }, index.h("label", { class: "ez-text ez-text--secondary ez-margin-vertical--small" }, this.getMessage("snkFormConfig.form.subTitleInfo")), index.h("div", { id: CONTAINER_ID.withoutGroup, class: "ez-row", "data-draggable-parent": "field" }, this.getFieldsByGroup(group)), index.h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" }));
|
|
972
972
|
}
|
|
973
|
-
}), this.renderTempGroupByTab(tab.tab))), index.h("div", { class: "form-config__btn-add-group ez-row" }, index.h("div", { class: "form-config__btn-add-group-container ez-col ez-col--sd-12 ez-col--tb-12 ez-align--center" }, index.h("ez-button", { label: this.getMessage("snkFormConfig.form.labelNewGroup"), class: "ez-padding-horizontal--small ez-button--primary", size: "small", onClick: () => this.addNewGroup() }, index.h("ez-icon", { class: "ez-margin-right--small", slot: "leftIcon", iconName: "plus" })))))), index.h("div", { class: "form-config__fields-available ez-col ez-col--sd-3 ez-col--tb-3" }, index.h("section", { class: "ez-box__container ez-col ez-col--pn-12" }, index.h("h1", { class: "ez-title ez-title--large ez-title--primary ez-padding-bottom--medium" }, this.getMessage("snkFormConfig.availableFields.title")), index.h("ez-filter-input", { ref: ref => this._filterFieldsAvailable = ref, label: this.getMessage("snkFormConfig.availableFields.labelSearchField"), onEzChange: evt => this.onFilterChange(evt.detail) }), index.h("span", { class: "ez-box__label-counter ez-text ez-text--medium ez-text--primary ez-margin-bottom--medium" }, this.handleLabelCounter((_c = this._fieldsAvailable) === null || _c === void 0 ? void 0 : _c.length)), ((_d = this._layoutFormConfig) === null || _d === void 0 ? void 0 : _d.length) > 0 &&
|
|
974
|
-
index.h("div", { id: CONTAINER_ID.fieldsAvailable, class: "ez-row", "data-draggable-parent": "field" }, this.orderFieldsAvailable(this._fieldsAvailable).map((field) => index.h("div", { key: field.name, class: this._fieldsAvailableStyle, "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, index.h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, dataUnit: this.dataUnit, fieldConfig: field })))))))));
|
|
973
|
+
}), this.renderTempGroupByTab(tab.tab))), index.h("div", { class: "form-config__btn-add-group ez-row" }, index.h("div", { class: "form-config__btn-add-group-container ez-col ez-col--sd-12 ez-col--tb-12 ez-align--center" }, index.h("ez-button", { label: this.getMessage("snkFormConfig.form.labelNewGroup"), class: "ez-padding-horizontal--small ez-button--primary", size: "small", onClick: () => this.addNewGroup() }, index.h("ez-icon", { class: "ez-margin-right--small", slot: "leftIcon", iconName: "plus" })))))), index.h("div", { class: "form-config__fields-available ez-col ez-col--sd-3 ez-col--tb-3" }, index.h("section", { class: "ez-box__container ez-col ez-col--pn-12" }, index.h("h1", { class: "ez-title ez-title--large ez-title--primary ez-padding-bottom--medium" }, this.getMessage("snkFormConfig.availableFields.title")), index.h("ez-filter-input", { id: "searchFields", ref: ref => this._filterFieldsAvailable = ref, label: this.getMessage("snkFormConfig.availableFields.labelSearchField"), onEzChange: evt => this.onFilterChange(evt.detail) }), index.h("span", { class: "ez-box__label-counter ez-text ez-text--medium ez-text--primary ez-margin-bottom--medium" }, this.handleLabelCounter((_c = this._fieldsAvailable) === null || _c === void 0 ? void 0 : _c.length)), ((_d = this._layoutFormConfig) === null || _d === void 0 ? void 0 : _d.length) > 0 &&
|
|
974
|
+
index.h("div", { id: CONTAINER_ID.fieldsAvailable, class: "ez-row", "data-draggable-parent": "field" }, this.orderFieldsAvailable(this._fieldsAvailable).map((field) => index.h("div", { key: field.name, class: this._fieldsAvailableStyle, "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, index.h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, dataUnit: this.dataUnit, fieldConfig: field, id: field.name })))))))));
|
|
975
975
|
}
|
|
976
976
|
get _element() { return index.getElement(this); }
|
|
977
977
|
static get watchers() { return {
|
|
@@ -149,10 +149,6 @@ const SnkForm = class {
|
|
|
149
149
|
const dataInfo = { dataUnit: this._dataUnit };
|
|
150
150
|
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
151
151
|
}
|
|
152
|
-
getDataElementId(suffix) {
|
|
153
|
-
const elemIdSnkTaskBar = this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
|
154
|
-
return `${elemIdSnkTaskBar}_${suffix}`;
|
|
155
|
-
}
|
|
156
152
|
componentWillLoad() {
|
|
157
153
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
158
154
|
let parent = this._element.parentElement;
|
|
@@ -196,8 +192,8 @@ const SnkForm = class {
|
|
|
196
192
|
if (!this._dataUnit || !this._dataState) {
|
|
197
193
|
return undefined;
|
|
198
194
|
}
|
|
199
|
-
return (index.h("section", { class: "snk-form" }, index.h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, index.h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, index.h("ez-button", { title: this.getMessage("snkForm.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small", onClick: () => this.exitForm() }), index.h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), index.h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, index.h("snk-taskbar", { key: "formTaskbar", "data-element-id":
|
|
200
|
-
index.h("snk-form-config", { dataUnit: this._dataUnit, formConfig: this.getFormConfig(),
|
|
195
|
+
return (index.h("section", { class: "snk-form" }, index.h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, index.h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, index.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" }), index.h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), index.h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, index.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 }))), index.h("section", null, index.h("div", { class: "ez-row" }, index.h("div", { class: "ez-col ez-col--sd-12" }, index.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 &&
|
|
196
|
+
index.h("snk-form-config", { dataUnit: this._dataUnit, formConfig: this.getFormConfig(), configName: this.configName, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigClose: () => this.closeConfig() }))))));
|
|
201
197
|
}
|
|
202
198
|
get _element() { return index.getElement(this); }
|
|
203
199
|
};
|
|
@@ -304,7 +304,7 @@ const SnkPesquisa = class {
|
|
|
304
304
|
}
|
|
305
305
|
render() {
|
|
306
306
|
var _a;
|
|
307
|
-
return (index.h(index.Host, null, index.h("div", { class: "snk-pesquisa" }, index.h("div", { class: "snk-pesquisa__input" }, index.h("ez-text-input", { label: "Buscar", class: "ez-margin-right--medium", canShowError: false, ref: (ref) => this._textInput = ref, onEzChange: (event) => this.onChangeValue(event), value: this.argument }, index.h("ez-icon", { slot: "leftIcon", iconName: "search" }), this.argument && ((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value)
|
|
307
|
+
return (index.h(index.Host, null, index.h("div", { class: "snk-pesquisa" }, index.h("div", { class: "snk-pesquisa__input" }, index.h("ez-text-input", { label: "Buscar", class: "ez-margin-right--medium", canShowError: false, ref: (ref) => this._textInput = ref, onEzChange: (event) => this.onChangeValue(event), value: this.argument, "data-element-id": "searchInput" }, index.h("ez-icon", { slot: "leftIcon", iconName: "search" }), this.argument && ((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value)
|
|
308
308
|
? index.h("button", { slot: "rightIcon", class: "snk-pesquisa__btn", onClick: () => this.clearSearch() }, index.h("ez-icon", { iconName: "close" }))
|
|
309
309
|
: undefined), index.h("ez-button", { class: "ez-button--primary", label: "Pesquisar", onClick: () => this.onClickSearch() })), index.h("label", { class: "snk-pesquisa__records" }, this.getMessageView()), index.h("div", { class: "snk-pesquisa__content" }, this._itemList && this._itemList.map((item) => {
|
|
310
310
|
return (index.h("ez-card-item", { onEzClick: (event) => this.createOption(event.detail), item: item }));
|
|
@@ -300,6 +300,13 @@ const SnkTabConfig = class {
|
|
|
300
300
|
this.updateScroll();
|
|
301
301
|
this.controlSortableTab();
|
|
302
302
|
}
|
|
303
|
+
componentDidLoad() {
|
|
304
|
+
core.ElementIDUtils.addIDInfo(this._hostElem, "itemConfig");
|
|
305
|
+
this._processedTabs.forEach((tab, index) => {
|
|
306
|
+
const dataID = { id: tab.label };
|
|
307
|
+
core.ElementIDUtils.addIDInfo(this._hostElem.querySelector(`#tab${index}`), "itemConfig", dataID);
|
|
308
|
+
});
|
|
309
|
+
}
|
|
303
310
|
render() {
|
|
304
311
|
return (index.h(index.Host, null, index.h("button", { class: "tab-config__backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }), index.h("div", { class: "tab-config__lower-bar" }), index.h("div", { class: "tab-config__scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev), "data-draggable-parent": "tab" }, this._processedTabs.map((tab, index$1) => {
|
|
305
312
|
const tabId = "tab" + index$1;
|
|
@@ -81,7 +81,7 @@ export class SnkConfigurator {
|
|
|
81
81
|
render() {
|
|
82
82
|
return (h("ez-modal", { opened: this._opened, "close-esc": false, "close-outside-click": false, "modal-size": "small" }, h("div", { class: "snk-configurator" }, h("div", { class: "snk-configurator__header" }, h("label", { class: "snk-configurator__title" }, this.getMessage("snkConfigurator.titleConfigurations")), h("div", { class: "snk-configurator__button-close" }, h("ez-button", { mode: 'icon', iconName: "close", size: 'medium', onClick: () => this.closeConfig() }))), h("div", { class: "snk-configurator__main" }, h("ez-radio-button", { class: "ez-margin-top--medium", label: this.getMessage("snkConfigurator.subTitleModeConfig"), value: this.getViewModeValue(), onEzChange: (evt) => this.onViewModeChanged(evt), enabled: this.enableModeConfig() }, h("ez-radio-button-option", { label: this.getMessage("snkConfigurator.labelGrid"), value: GRID_MODE.name }), h("ez-radio-button-option", { label: this.getMessage("snkConfigurator.labelForm"), value: FORM_MODE.name })), h("ez-button", { mode: "slim", label: this.viewMode === GRID_MODE.name
|
|
83
83
|
? this.getMessage("snkConfigurator.labelConfigGrid")
|
|
84
|
-
: this.getMessage("snkConfigurator.labelConfigForm"), class: "snk-configurator__button-config ez-button--primary", onClick: () => this.onClickOpenConfig() }), h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" })))));
|
|
84
|
+
: this.getMessage("snkConfigurator.labelConfigForm"), class: "snk-configurator__button-config ez-button--primary", onClick: () => this.onClickOpenConfig(), id: "openConfigurator" }), h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" })))));
|
|
85
85
|
}
|
|
86
86
|
static get is() { return "snk-configurator"; }
|
|
87
87
|
static get encapsulation() { return "scoped"; }
|
|
@@ -59,10 +59,6 @@ export class SnkCrud {
|
|
|
59
59
|
this.setViewMode(GRID_MODE);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
getDataElementId(suffix) {
|
|
63
|
-
const elemIdSnkCrud = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
|
64
|
-
return `${elemIdSnkCrud}_${suffix}`;
|
|
65
|
-
}
|
|
66
62
|
componentWillLoad() {
|
|
67
63
|
let parent = this._element.parentElement;
|
|
68
64
|
while (parent) {
|
|
@@ -75,8 +71,12 @@ export class SnkCrud {
|
|
|
75
71
|
if (!this._dataUnit) {
|
|
76
72
|
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
77
73
|
this._dataUnit = evt.detail;
|
|
74
|
+
this.addDataElementID();
|
|
78
75
|
});
|
|
79
76
|
}
|
|
77
|
+
else {
|
|
78
|
+
this.addDataElementID();
|
|
79
|
+
}
|
|
80
80
|
this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
|
|
81
81
|
this._dataState = evt.detail;
|
|
82
82
|
});
|
|
@@ -89,12 +89,12 @@ export class SnkCrud {
|
|
|
89
89
|
this.configName = application.configName;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
addDataElementID() {
|
|
93
93
|
const dataInfo = { dataUnit: this._dataUnit };
|
|
94
94
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
95
95
|
}
|
|
96
96
|
render() {
|
|
97
|
-
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id":
|
|
97
|
+
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 }, 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) })));
|
|
98
98
|
}
|
|
99
99
|
static get is() { return "snk-crud"; }
|
|
100
100
|
static get encapsulation() { return "scoped"; }
|
|
@@ -142,9 +142,7 @@ export class SnkFilterItem {
|
|
|
142
142
|
componentDidLoad() {
|
|
143
143
|
if (this._filterItemElement) {
|
|
144
144
|
ElementIDUtils.addIDInfo(this._filterItemElement);
|
|
145
|
-
|
|
146
|
-
this._idSnkFilterDetail = `${dataElementIdDoFilterItem}_${this.config.id}`;
|
|
147
|
-
this._idEzChip = `${dataElementIdDoFilterItem}_${this.config.id}`;
|
|
145
|
+
this._idSnkFilterDetail = `filterDetail_${this.config.id}`;
|
|
148
146
|
}
|
|
149
147
|
}
|
|
150
148
|
componentDidRender() {
|
|
@@ -177,7 +175,7 @@ export class SnkFilterItem {
|
|
|
177
175
|
}
|
|
178
176
|
render() {
|
|
179
177
|
const leftIcon = this.getLeftIconName();
|
|
180
|
-
return (h(Host, null, h("ez-chip", { ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.config.value != undefined,
|
|
178
|
+
return (h(Host, null, h("ez-chip", { ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.config.value != undefined, id: this.config.id }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
|
|
181
179
|
}
|
|
182
180
|
static get is() { return "snk-filter-item"; }
|
|
183
181
|
static get properties() {
|
|
@@ -57,13 +57,15 @@ export class SnkFilterList {
|
|
|
57
57
|
this._popover.remove();
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
this._element.querySelectorAll("button.sc-snk-filter-bar").forEach((itemListElement) => {
|
|
61
|
+
const dataElement = { id: itemListElement.getAttribute("name") };
|
|
62
|
+
itemListElement === null || itemListElement === void 0 ? void 0 : itemListElement.removeAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
|
63
|
+
ElementIDUtils.addIDInfoIfNotExists(itemListElement, "filterItemList", dataElement);
|
|
64
|
+
});
|
|
60
65
|
}
|
|
61
66
|
buildItemElement(item) {
|
|
62
67
|
const itemId = ++this._selectableItemsCount;
|
|
63
|
-
|
|
64
|
-
ElementIDUtils.addIDInfo(this._buttonElement);
|
|
65
|
-
}
|
|
66
|
-
return (h("button", { id: `filter-item${itemId}`, onFocusin: () => this._preselection = itemId, class: `ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item`, onClick: () => this.itemSelected(item.name), ref: (el) => this._buttonElement = el }, item.iconName ? h("ez-icon", { iconName: item.iconName, size: "small", class: `ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${item.iconClass || ""}` }) : undefined, h("div", { class: `ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${item.labelClass || ""}` }, item.label)));
|
|
68
|
+
return (h("button", { id: `filter-item${itemId}`, onFocusin: () => this._preselection = itemId, class: `ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item`, onClick: () => this.itemSelected(item.name), name: item.label, key: itemId }, item.iconName ? h("ez-icon", { iconName: item.iconName, size: "small", class: `ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${item.iconClass || ""}` }) : undefined, h("div", { class: `ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${item.labelClass || ""}` }, item.label)));
|
|
67
69
|
}
|
|
68
70
|
itemSelected(itemName) {
|
|
69
71
|
if (itemName === SHOW_MORE_ITEM_NAME) {
|
|
@@ -124,7 +126,7 @@ export class SnkFilterList {
|
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
128
|
render() {
|
|
127
|
-
return (h(Host, { class: "ez-flex ez-flex--column" }, h("ez-button", { class: this.buttonClass, label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, h("slot", { name: "leftIcon" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem }, h("ez-filter-input", { ref: ref => this._filterInput = ref, mode: "slim", label: this.findFilterText, value: this._filterArgument, onEzChange: (evt) => this._filterArgument = evt.detail, onFocus: () => this._preselection = 0 }), this.getFilterItems(), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
|
|
129
|
+
return (h(Host, { class: "ez-flex ez-flex--column" }, h("ez-button", { class: this.buttonClass, label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, h("slot", { name: "leftIcon" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem }, h("ez-filter-input", { ref: ref => this._filterInput = ref, "data-element-id": "serachFilters", mode: "slim", label: this.findFilterText, value: this._filterArgument, onEzChange: (evt) => this._filterArgument = evt.detail, onFocus: () => this._preselection = 0 }), this.getFilterItems(), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
|
|
128
130
|
}
|
|
129
131
|
static get is() { return "snk-filter-list"; }
|
|
130
132
|
static get properties() {
|
|
@@ -54,9 +54,6 @@ export class SnkFilterBar {
|
|
|
54
54
|
if (this._element) {
|
|
55
55
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
56
56
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
57
|
-
const dataElementIdFilterBar = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
|
58
|
-
this._idSnkFilterItem = dataElementIdFilterBar;
|
|
59
|
-
this._idSnkFilterList = dataElementIdFilterBar;
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
59
|
processPendingFilter() {
|
|
@@ -373,7 +370,7 @@ export class SnkFilterBar {
|
|
|
373
370
|
if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
|
|
374
371
|
return undefined;
|
|
375
372
|
}
|
|
376
|
-
return (h(Host, null, h("ez-scroller", { direction: "horizontal", activeShadow: true, locked: this.scrollerLocked }, this.getFilterItems()), h("snk-filter-list", { id: APPLIED_FILTERS, onFocusin: () => this.itemFocused(APPLIED_FILTERS), items: this.getAppliedListItems(), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyAppliedFiltersList"), findFilterText: this.getMessage("snkFilterBar.findFilter"), iconName: "filter", class: "ez-padding-left--medium", buttonClass: this.getActiveClass(), onSnkItemSelected: evt => this.appliedFilterHandler(evt.detail), "data-element-id":
|
|
373
|
+
return (h(Host, null, h("ez-scroller", { direction: "horizontal", activeShadow: true, locked: this.scrollerLocked }, this.getFilterItems()), h("snk-filter-list", { id: APPLIED_FILTERS, onFocusin: () => this.itemFocused(APPLIED_FILTERS), items: this.getAppliedListItems(), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyAppliedFiltersList"), findFilterText: this.getMessage("snkFilterBar.findFilter"), iconName: "filter", class: "ez-padding-left--medium", buttonClass: this.getActiveClass(), onSnkItemSelected: evt => this.appliedFilterHandler(evt.detail), "data-element-id": "apppliedFilters" }), h("snk-filter-list", { id: ADD_FILTER, onFocusin: () => this.itemFocused(ADD_FILTER), items: this.getAddListItems(), label: this.getMessage("snkFilterBar.addFilter"), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyFiltersList"), findFilterText: this.getMessage("snkFilterBar.findField"), class: "ez-padding-left--medium", onSnkItemSelected: evt => this.addFilterHandler(evt.detail), "data-element-id": "addFilters" }, h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
|
|
377
374
|
}
|
|
378
375
|
static get is() { return "snk-filter-bar"; }
|
|
379
376
|
static get encapsulation() { return "scoped"; }
|
|
@@ -138,10 +138,6 @@ export class SnkForm {
|
|
|
138
138
|
const dataInfo = { dataUnit: this._dataUnit };
|
|
139
139
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
140
140
|
}
|
|
141
|
-
getDataElementId(suffix) {
|
|
142
|
-
const elemIdSnkTaskBar = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
|
143
|
-
return `${elemIdSnkTaskBar}_${suffix}`;
|
|
144
|
-
}
|
|
145
141
|
componentWillLoad() {
|
|
146
142
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
147
143
|
let parent = this._element.parentElement;
|
|
@@ -185,8 +181,8 @@ export class SnkForm {
|
|
|
185
181
|
if (!this._dataUnit || !this._dataState) {
|
|
186
182
|
return undefined;
|
|
187
183
|
}
|
|
188
|
-
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":
|
|
189
|
-
h("snk-form-config", { dataUnit: this._dataUnit, formConfig: this.getFormConfig(),
|
|
184
|
+
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(), "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 ez-col--sd-6 ez-col--tb-6 ez-align--right" }, 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 }))), 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 &&
|
|
185
|
+
h("snk-form-config", { dataUnit: this._dataUnit, formConfig: this.getFormConfig(), configName: this.configName, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigClose: () => this.closeConfig() }))))));
|
|
190
186
|
}
|
|
191
187
|
static get is() { return "snk-form"; }
|
|
192
188
|
static get encapsulation() { return "scoped"; }
|
package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js
CHANGED
|
@@ -39,7 +39,7 @@ export class SnkFieldConfig {
|
|
|
39
39
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
40
40
|
}
|
|
41
41
|
componentDidLoad() {
|
|
42
|
-
ElementIDUtils.addIDInfo(this._element
|
|
42
|
+
ElementIDUtils.addIDInfo(this._element);
|
|
43
43
|
}
|
|
44
44
|
render() {
|
|
45
45
|
if (this.fieldConfig == undefined) {
|
package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js
CHANGED
|
@@ -232,7 +232,7 @@ export class SnkFormConfig {
|
|
|
232
232
|
var _a;
|
|
233
233
|
return ((_a = group.fields) === null || _a === void 0 ? void 0 : _a.length) ? group.fields.map((field) => {
|
|
234
234
|
var _a, _b;
|
|
235
|
-
return h("div", { key: field.name, class: this.getFieldConfigStyle(field), "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, modeInsertion: false, fieldConfig: field,
|
|
235
|
+
return h("div", { key: field.name, class: this.getFieldConfigStyle(field), "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, modeInsertion: false, fieldConfig: field, dataUnit: this.dataUnit, isConfigActive: ((_a = this._fieldConfigSelected) === null || _a === void 0 ? void 0 : _a.name) === field.name, id: field.name }), ((_b = this._fieldConfigSelected) === null || _b === void 0 ? void 0 : _b.name) === field.name &&
|
|
236
236
|
h("div", { class: "ez-flex form-config__config-options" }, h("snk-config-options", { idConfig: field.name, dataUnit: this.dataUnit, fieldConfig: this._fieldConfigSelected, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), onConfigOptionsChanged: (evt) => this.handleconfigOptionsChanged(evt.detail) })));
|
|
237
237
|
}) : h("div", { class: "form-config__add-group-container" }, h("div", { class: "form-config__add-group-content" }, h("div", { class: "form-config__add-group-label" }, h("label", { class: "ez-text ez-text--center ez-text--medium ez-text--primary ez-text--bold" }, this.getMessage("snkFormConfig.form.labelDropField")))));
|
|
238
238
|
}
|
|
@@ -948,7 +948,7 @@ export class SnkFormConfig {
|
|
|
948
948
|
const configOptions = this._formConfigOptions.map((option) => {
|
|
949
949
|
return { value: option.origin, label: option.name };
|
|
950
950
|
});
|
|
951
|
-
return (h(Host, null, h("div", { class: "ez-row ez-padding--medium" }, h("div", { class: "ez-col ez-col--sd-7 ez-col--tb-9 ez-align--middle" }, h("ez-button", { mode: "icon", iconName: "arrow_back", class: "ez-padding--small", size: "small", onClick: () => this.closeFormConfig() }), h("h1", { class: "ez-title ez-title--extra-large ez-padding--small" }, this.getMessage("snkFormConfig.title")), h("ez-actions-button", { class: "form-config__actions-button ez-margin-left--medium", value: (_a = this._optionFormConfigSelected) === null || _a === void 0 ? void 0 : _a.origin, showLabel: true, displayIcon: "chevron-down", checkOption: true, size: "small", actions: configOptions, onEzAction: (evt) => this.controlSelectFormConfig(evt) })), h("div", { class: "ez-col ez-col--sd-5 ez-col--tb-3 ez-align--middle ez-align--right" }, this._formConfigChanged === true && this._optionFormConfigChanged === false &&
|
|
951
|
+
return (h(Host, null, h("div", { class: "ez-row ez-padding--medium" }, h("div", { class: "ez-col ez-col--sd-7 ez-col--tb-9 ez-align--middle" }, h("ez-button", { mode: "icon", iconName: "arrow_back", class: "ez-padding--small", size: "small", onClick: () => this.closeFormConfig(), id: "formConfigToBack" }), h("h1", { class: "ez-title ez-title--extra-large ez-padding--small" }, this.getMessage("snkFormConfig.title")), h("ez-actions-button", { class: "form-config__actions-button ez-margin-left--medium", value: (_a = this._optionFormConfigSelected) === null || _a === void 0 ? void 0 : _a.origin, showLabel: true, displayIcon: "chevron-down", checkOption: true, size: "small", actions: configOptions, onEzAction: (evt) => this.controlSelectFormConfig(evt), id: "selectConfig" })), h("div", { class: "ez-col ez-col--sd-5 ez-col--tb-3 ez-align--middle ez-align--right" }, this._formConfigChanged === true && this._optionFormConfigChanged === false &&
|
|
952
952
|
h("div", { class: "ez-row ez-align--middle ez-align--right" }, h("ez-button", { label: "Cancelar", class: "ez-padding-left--medium", size: "small", onClick: () => this.cancelChangeConfig() }), h("ez-button", { label: "Salvar", class: "ez-button--primary ez-padding-left--medium", size: "small", onClick: () => this.saveConfig() }, h("ez-icon", { class: "ez-margin-right--small", slot: "leftIcon", iconName: "save" }))), this._optionFormConfigChanged === true &&
|
|
953
953
|
h("div", { class: "ez-row ez-align--middle ez-align--right" }, h("ez-button", { label: "Cancelar", class: "ez-padding-left--medium", size: "small", onClick: () => this.cancelChangeOptionConfig() }), h("ez-button", { label: this.getMessage("snkFormConfig.applyConfig"), class: "ez-button--primary ez-padding-left--medium", size: "small", onClick: () => this.applyOptionConfig() })))), h("div", { class: "ez-row ez-padding--medium", ref: ref => this._sortableContainer = ref }, h("div", { class: "form-config__tab-container ez-col ez-col--sd-9 ez-col--tb-9 ez-padding-right--medium" }, ((_b = this._layoutFormConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
|
954
954
|
h("section", { class: "ez-box__container", ref: ref => this._formContainer = ref }, h("snk-tab-config", { ref: ref => this._tabConfig = ref, selectedIndex: this._tabSelected, onEzTabChange: (ev) => this.changeTabSelected(ev.detail), onEzOrderChange: (ev) => this.changeTabOrder(ev.detail), onEditionTitleTab: (ev) => this.changeTabLabel(ev), onDeleteTab: (ev) => this.handleDeleteTab(ev), onHideTab: (ev) => this.changeHideTab(ev), onCanStartDrag: () => this.handleCanStartDragTab() }, this._layoutFormConfig.map((tab) => h("snk-tab", { tabKey: tab.tab, label: tab.tab, visible: tab.visible }))), this._layoutFormConfig.map((tab, indexTab) => h("div", { id: "tab" + indexTab, "data-draggable-parent": "group", class: this._tabSelected === indexTab
|
|
@@ -963,8 +963,8 @@ export class SnkFormConfig {
|
|
|
963
963
|
else {
|
|
964
964
|
return h("div", { class: "ez-flex ez-flex--column ez-size-width--full" }, h("label", { class: "ez-text ez-text--secondary ez-margin-vertical--small" }, this.getMessage("snkFormConfig.form.subTitleInfo")), h("div", { id: CONTAINER_ID.withoutGroup, class: "ez-row", "data-draggable-parent": "field" }, this.getFieldsByGroup(group)), h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" }));
|
|
965
965
|
}
|
|
966
|
-
}), this.renderTempGroupByTab(tab.tab))), h("div", { class: "form-config__btn-add-group ez-row" }, h("div", { class: "form-config__btn-add-group-container ez-col ez-col--sd-12 ez-col--tb-12 ez-align--center" }, h("ez-button", { label: this.getMessage("snkFormConfig.form.labelNewGroup"), class: "ez-padding-horizontal--small ez-button--primary", size: "small", onClick: () => this.addNewGroup() }, h("ez-icon", { class: "ez-margin-right--small", slot: "leftIcon", iconName: "plus" })))))), h("div", { class: "form-config__fields-available ez-col ez-col--sd-3 ez-col--tb-3" }, h("section", { class: "ez-box__container ez-col ez-col--pn-12" }, h("h1", { class: "ez-title ez-title--large ez-title--primary ez-padding-bottom--medium" }, this.getMessage("snkFormConfig.availableFields.title")), h("ez-filter-input", { ref: ref => this._filterFieldsAvailable = ref, label: this.getMessage("snkFormConfig.availableFields.labelSearchField"), onEzChange: evt => this.onFilterChange(evt.detail) }), h("span", { class: "ez-box__label-counter ez-text ez-text--medium ez-text--primary ez-margin-bottom--medium" }, this.handleLabelCounter((_c = this._fieldsAvailable) === null || _c === void 0 ? void 0 : _c.length)), ((_d = this._layoutFormConfig) === null || _d === void 0 ? void 0 : _d.length) > 0 &&
|
|
967
|
-
h("div", { id: CONTAINER_ID.fieldsAvailable, class: "ez-row", "data-draggable-parent": "field" }, this.orderFieldsAvailable(this._fieldsAvailable).map((field) => h("div", { key: field.name, class: this._fieldsAvailableStyle, "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, dataUnit: this.dataUnit, fieldConfig: field })))))))));
|
|
966
|
+
}), this.renderTempGroupByTab(tab.tab))), h("div", { class: "form-config__btn-add-group ez-row" }, h("div", { class: "form-config__btn-add-group-container ez-col ez-col--sd-12 ez-col--tb-12 ez-align--center" }, h("ez-button", { label: this.getMessage("snkFormConfig.form.labelNewGroup"), class: "ez-padding-horizontal--small ez-button--primary", size: "small", onClick: () => this.addNewGroup() }, h("ez-icon", { class: "ez-margin-right--small", slot: "leftIcon", iconName: "plus" })))))), h("div", { class: "form-config__fields-available ez-col ez-col--sd-3 ez-col--tb-3" }, h("section", { class: "ez-box__container ez-col ez-col--pn-12" }, h("h1", { class: "ez-title ez-title--large ez-title--primary ez-padding-bottom--medium" }, this.getMessage("snkFormConfig.availableFields.title")), h("ez-filter-input", { id: "searchFields", ref: ref => this._filterFieldsAvailable = ref, label: this.getMessage("snkFormConfig.availableFields.labelSearchField"), onEzChange: evt => this.onFilterChange(evt.detail) }), h("span", { class: "ez-box__label-counter ez-text ez-text--medium ez-text--primary ez-margin-bottom--medium" }, this.handleLabelCounter((_c = this._fieldsAvailable) === null || _c === void 0 ? void 0 : _c.length)), ((_d = this._layoutFormConfig) === null || _d === void 0 ? void 0 : _d.length) > 0 &&
|
|
967
|
+
h("div", { id: CONTAINER_ID.fieldsAvailable, class: "ez-row", "data-draggable-parent": "field" }, this.orderFieldsAvailable(this._fieldsAvailable).map((field) => h("div", { key: field.name, class: this._fieldsAvailableStyle, "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, dataUnit: this.dataUnit, fieldConfig: field, id: field.name })))))))));
|
|
968
968
|
}
|
|
969
969
|
static get is() { return "snk-form-config"; }
|
|
970
970
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, Host, Fragment } from "@stencil/core";
|
|
2
2
|
import { Sortable } from '@shopify/draggable';
|
|
3
|
-
import { ApplicationContext } from "@sankhyalabs/core";
|
|
3
|
+
import { ApplicationContext, ElementIDUtils } from "@sankhyalabs/core";
|
|
4
4
|
import { CONFIG_EVENTS, KEY_EVENTS, TAB_NAMES, TYPE_ACTIONS } from "../../../../lib/utils/constants";
|
|
5
5
|
export class SnkTabConfig {
|
|
6
6
|
constructor() {
|
|
@@ -285,6 +285,13 @@ export class SnkTabConfig {
|
|
|
285
285
|
this.updateScroll();
|
|
286
286
|
this.controlSortableTab();
|
|
287
287
|
}
|
|
288
|
+
componentDidLoad() {
|
|
289
|
+
ElementIDUtils.addIDInfo(this._hostElem, "itemConfig");
|
|
290
|
+
this._processedTabs.forEach((tab, index) => {
|
|
291
|
+
const dataID = { id: tab.label };
|
|
292
|
+
ElementIDUtils.addIDInfo(this._hostElem.querySelector(`#tab${index}`), "itemConfig", dataID);
|
|
293
|
+
});
|
|
294
|
+
}
|
|
288
295
|
render() {
|
|
289
296
|
return (h(Host, null, h("button", { class: "tab-config__backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }), h("div", { class: "tab-config__lower-bar" }), h("div", { class: "tab-config__scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev), "data-draggable-parent": "tab" }, this._processedTabs.map((tab, index) => {
|
|
290
297
|
const tabId = "tab" + index;
|