@sankhyalabs/sankhyablocks 10.1.0-dev.43 → 10.1.0-dev.45
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/{ImageUtils-c46f2d11.js → ImageUtils-d6139911.js} +4 -2
- package/dist/cjs/snk-crud.cjs.entry.js +2 -2
- package/dist/cjs/snk-form-view.cjs.entry.js +1 -1
- package/dist/cjs/snk-image-input.cjs.entry.js +16 -4
- package/dist/collection/components/snk-crud/snk-crud.css +4 -0
- package/dist/collection/components/snk-crud/snk-crud.js +1 -1
- package/dist/collection/components/snk-image-input/snk-image-input.js +15 -3
- package/dist/collection/components/snk-image-input/utils/ImageUtils.js +4 -2
- package/dist/components/snk-crud.js +2 -2
- package/dist/components/snk-image-input2.js +19 -5
- package/dist/esm/{ImageUtils-7f3a4149.js → ImageUtils-efbea0e4.js} +4 -2
- package/dist/esm/snk-crud.entry.js +2 -2
- package/dist/esm/snk-form-view.entry.js +1 -1
- package/dist/esm/snk-image-input.entry.js +16 -4
- package/dist/sankhyablocks/{p-2af815bb.entry.js → p-1086fb0c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-420b39b5.js → p-af673291.js} +1 -1
- package/dist/sankhyablocks/{p-8a8900a9.entry.js → p-ca3728c0.entry.js} +1 -1
- package/dist/sankhyablocks/p-d9ec8c4b.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-image-input/snk-image-input.d.ts +1 -0
- package/dist/types/components/snk-image-input/utils/ImageUtils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/sankhyablocks/p-98241c21.entry.js +0 -1
|
@@ -118,19 +118,21 @@ async function imageBlobToBase64(blob) {
|
|
|
118
118
|
reader.readAsDataURL(blob);
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
-
async function downloadImage(pks, fieldName, entityName) {
|
|
121
|
+
async function downloadImage(pks, fieldName, entityName, signal) {
|
|
122
122
|
const uploadUrl = getBaseUrl(pks, entityName, fieldName);
|
|
123
123
|
if (!uploadUrl) {
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
126
|
try {
|
|
127
|
-
const response = await fetch(uploadUrl);
|
|
127
|
+
const response = await fetch(uploadUrl, { signal });
|
|
128
128
|
if (response.ok) {
|
|
129
129
|
const blob = await response.blob();
|
|
130
130
|
return await imageBlobToBase64(blob);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
catch (error) {
|
|
134
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted)
|
|
135
|
+
return;
|
|
134
136
|
console.error('Error downloading image:', error);
|
|
135
137
|
}
|
|
136
138
|
}
|
|
@@ -224,7 +224,7 @@ function getTopTaskBarId(dataState, presentationMode) {
|
|
|
224
224
|
return `snkGridTopTaskbar.regular${sufix}`;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%;overflow-y:auto;scrollbar-gutter:stable both-edges}snk-grid.sc-snk-crud{--snk-grid-padding:0 var(--space--6, 6px) var(--space--6, 6px) var(--space--6, 6px)}stack-item.sc-snk-crud.sc-snk-crud{display:grid;min-height:100%}.snk-crud__grid-stack-item.sc-snk-crud{display:flex;flex-direction:column;height:100%;width:100%;padding:0 var(--space--2, 2px)}.snk-crud__header-top.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:var(--space--8, 8px);padding-top:var(--space--12, 12px)}.snk-crud__header-bottom.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:0 var(--space--8, 8px) 0 var(--space--6, 6px)}.snk-crud__header-bottom.sc-snk-crud>snk-taskbar.sc-snk-crud{padding-bottom:var(--space--8, 8px);margin-left:var(--space--12, 12px)}.snk-crud--hidden.sc-snk-crud{display:none !important}ez-record-navigation.sc-snk-crud,ez-grid-pagination.sc-snk-crud{margin-bottom:var(--space--8, 8px)}";
|
|
227
|
+
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%;overflow-y:auto;scrollbar-gutter:stable both-edges}snk-grid.sc-snk-crud{--snk-grid-padding:0 var(--space--6, 6px) var(--space--6, 6px) var(--space--6, 6px)}stack-item.sc-snk-crud.sc-snk-crud{display:grid;min-height:100%}.snk-crud__header.sc-snk-crud{margin-bottom:var(--space--10, 10px)}.snk-crud__grid-stack-item.sc-snk-crud{display:flex;flex-direction:column;height:100%;width:100%;padding:0 var(--space--2, 2px)}.snk-crud__header-top.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:var(--space--8, 8px);padding-top:var(--space--12, 12px)}.snk-crud__header-bottom.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:0 var(--space--8, 8px) 0 var(--space--6, 6px)}.snk-crud__header-bottom.sc-snk-crud>snk-taskbar.sc-snk-crud{padding-bottom:var(--space--8, 8px);margin-left:var(--space--12, 12px)}.snk-crud--hidden.sc-snk-crud{display:none !important}ez-record-navigation.sc-snk-crud,ez-grid-pagination.sc-snk-crud{margin-bottom:var(--space--8, 8px)}";
|
|
228
228
|
|
|
229
229
|
const SnkCrud = class {
|
|
230
230
|
constructor(hostRef) {
|
|
@@ -813,7 +813,7 @@ const SnkCrud = class {
|
|
|
813
813
|
return;
|
|
814
814
|
}
|
|
815
815
|
this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === constants.VIEW_MODE.GRID && !this.enableGridInsert);
|
|
816
|
-
return (index$1.h(index$1.Host, null, index$1.h("header", { class: { 'snk-crud--hidden': !this._headerVisible } }, index$1.h("div", { class: "snk-crud__header-top" }, index$1.h("snk-taskbar", { "data-element-id": "grid_top", key: "snkGridTopTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, resourceID: this._resourceID, primaryButton: "INSERT", overflowStrategy: "hiddenItems", alignRigth: true, actionsList: this.getActionsList(), customActionsList: this.buildTaskbarCustomActionsList(), sizeButtons: 'medium' })), index$1.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this._resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, mode: this._filterMode, hideFilterButton: true, sizeChips: 'default' })), index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index$1.h("stack-item", { class: 'snk-crud__grid-stack-item' }, index$1.h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode, hideHeader: true, hideGridTaskbar: true }, index$1.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index$1.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index$1.h("slot", { name: "SnkGridHeader" }), index$1.h("slot", { name: "SnkGridFooter" }), index$1.h("slot", { name: "SnkGridTaskBar" }))), index$1.h("stack-item", null, index$1.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, customGuidesConfig: this.customGuidesConfig, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields, onFormConfigVisibilityChanged: evt => this._headerVisible = !evt.detail }, index$1.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderCustomGuideSlots(), index$1.h("slot", { name: "SnkFormTaskBar" })))), index$1.h("snk-attach", { ref: (ref) => this._snkAttach = ref, registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName }), index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId, layoutFormConfig: this.layoutFormConfig }), this.renderDynamicSearch(), index$1.h("div", { id: `${this.customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }), index$1.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index$1.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index$1.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
|
816
|
+
return (index$1.h(index$1.Host, null, index$1.h("header", { class: { 'snk-crud--hidden': !this._headerVisible, 'snk-crud__header': true } }, index$1.h("div", { class: "snk-crud__header-top" }, index$1.h("snk-taskbar", { "data-element-id": "grid_top", key: "snkGridTopTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, resourceID: this._resourceID, primaryButton: "INSERT", overflowStrategy: "hiddenItems", alignRigth: true, actionsList: this.getActionsList(), customActionsList: this.buildTaskbarCustomActionsList(), sizeButtons: 'medium' })), index$1.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this._resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, mode: this._filterMode, hideFilterButton: true, sizeChips: 'default' })), index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index$1.h("stack-item", { class: 'snk-crud__grid-stack-item' }, index$1.h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode, hideHeader: true, hideGridTaskbar: true }, index$1.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index$1.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index$1.h("slot", { name: "SnkGridHeader" }), index$1.h("slot", { name: "SnkGridFooter" }), index$1.h("slot", { name: "SnkGridTaskBar" }))), index$1.h("stack-item", null, index$1.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, customGuidesConfig: this.customGuidesConfig, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields, onFormConfigVisibilityChanged: evt => this._headerVisible = !evt.detail }, index$1.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderCustomGuideSlots(), index$1.h("slot", { name: "SnkFormTaskBar" })))), index$1.h("snk-attach", { ref: (ref) => this._snkAttach = ref, registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName }), index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId, layoutFormConfig: this.layoutFormConfig }), this.renderDynamicSearch(), index$1.h("div", { id: `${this.customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }), index$1.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index$1.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index$1.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
|
817
817
|
}
|
|
818
818
|
get _element() { return index$1.getElement(this); }
|
|
819
819
|
static get watchers() { return {
|
|
@@ -6,7 +6,7 @@ const index = require('./index-1894343a.js');
|
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
9
|
-
const ImageUtils = require('./ImageUtils-
|
|
9
|
+
const ImageUtils = require('./ImageUtils-d6139911.js');
|
|
10
10
|
|
|
11
11
|
const snkFormViewCss = ".sc-snk-form-view-h{display:flex;width:100%;--ez-form-card-summary-field-content-weight:700}.level-path.sc-snk-form-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.summary-wrapper.sc-snk-form-view{display:flex;overflow:hidden}.summary-header.sc-snk-form-view{border-bottom:1px solid var(--color--strokes);margin-bottom:var(--space--medium);padding-bottom:var(--space--medium)}.summary-container.sc-snk-form-view{display:flex;flex-direction:column}.summary-container.sc-snk-form-view{padding-right:calc(var(--space--extra-large) / 1.5)}.summary-field.sc-snk-form-view{min-width:30px;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.summary-field__title.sc-snk-form-view{color:var(--text--primary, #626e82);font-size:var(--title--small);white-space:nowrap;font-weight:var(--text-weight--medium)}.summary-field__content.sc-snk-form-view{color:var(--title--primary, #2b3a54);font-size:var(--text--large);font-weight:var(--ez-form-card-summary-field-content-weight)}";
|
|
12
12
|
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-1894343a.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const SnkMessageBuilder = require('./SnkMessageBuilder-a9300ebe.js');
|
|
8
|
-
const ImageUtils = require('./ImageUtils-
|
|
8
|
+
const ImageUtils = require('./ImageUtils-d6139911.js');
|
|
9
9
|
|
|
10
10
|
const snkImageInputCss = ":host{display:block}";
|
|
11
11
|
|
|
@@ -29,6 +29,10 @@ const SnkImageInput = class {
|
|
|
29
29
|
await this.clearImage();
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
+
if (action.type === core.Action.EDITION_CANCELED) {
|
|
33
|
+
await this.loadImage();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
32
36
|
};
|
|
33
37
|
this.dataUnit = undefined;
|
|
34
38
|
this.fieldName = undefined;
|
|
@@ -53,6 +57,8 @@ const SnkImageInput = class {
|
|
|
53
57
|
return this.messagesBuilder.getMessage(key, params);
|
|
54
58
|
}
|
|
55
59
|
async clearImage() {
|
|
60
|
+
var _a;
|
|
61
|
+
(_a = this._loadAbortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
56
62
|
this.imageValue = undefined;
|
|
57
63
|
}
|
|
58
64
|
async handleImageChange(event) {
|
|
@@ -114,11 +120,17 @@ const SnkImageInput = class {
|
|
|
114
120
|
}
|
|
115
121
|
}
|
|
116
122
|
async loadImage(pks) {
|
|
117
|
-
var _a;
|
|
123
|
+
var _a, _b;
|
|
124
|
+
(_a = this._loadAbortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
125
|
+
const controller = new AbortController();
|
|
126
|
+
this._loadAbortController = controller;
|
|
118
127
|
this.loading = true;
|
|
119
128
|
if (this.dataUnit && this.entityName) {
|
|
120
|
-
pks = (
|
|
121
|
-
|
|
129
|
+
pks = (_b = pks !== null && pks !== void 0 ? pks : this.getPksFromDataUnit()) !== null && _b !== void 0 ? _b : ImageUtils.getPKs(this.dataUnit);
|
|
130
|
+
const image = await ImageUtils.downloadImage(pks, this.fieldName, this.entityName, controller.signal);
|
|
131
|
+
if (controller.signal.aborted)
|
|
132
|
+
return;
|
|
133
|
+
this.imageValue = image;
|
|
122
134
|
}
|
|
123
135
|
this.loading = false;
|
|
124
136
|
}
|
|
@@ -596,7 +596,7 @@ export class SnkCrud {
|
|
|
596
596
|
return;
|
|
597
597
|
}
|
|
598
598
|
this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
|
|
599
|
-
return (h(Host, null, h("header", { class: { 'snk-crud--hidden': !this._headerVisible } }, h("div", { class: "snk-crud__header-top" }, h("snk-taskbar", { "data-element-id": "grid_top", key: "snkGridTopTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, resourceID: this._resourceID, primaryButton: "INSERT", overflowStrategy: "hiddenItems", alignRigth: true, actionsList: this.getActionsList(), customActionsList: this.buildTaskbarCustomActionsList(), sizeButtons: 'medium' })), h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this._resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, mode: this._filterMode, hideFilterButton: true, sizeChips: 'default' })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'snk-crud__grid-stack-item' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode, hideHeader: true, hideGridTaskbar: true }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, customGuidesConfig: this.customGuidesConfig, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields, onFormConfigVisibilityChanged: evt => this._headerVisible = !evt.detail }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderCustomGuideSlots(), h("slot", { name: "SnkFormTaskBar" })))), h("snk-attach", { ref: (ref) => this._snkAttach = ref, registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName }), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId, layoutFormConfig: this.layoutFormConfig }), this.renderDynamicSearch(), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
|
599
|
+
return (h(Host, null, h("header", { class: { 'snk-crud--hidden': !this._headerVisible, 'snk-crud__header': true } }, h("div", { class: "snk-crud__header-top" }, h("snk-taskbar", { "data-element-id": "grid_top", key: "snkGridTopTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, resourceID: this._resourceID, primaryButton: "INSERT", overflowStrategy: "hiddenItems", alignRigth: true, actionsList: this.getActionsList(), customActionsList: this.buildTaskbarCustomActionsList(), sizeButtons: 'medium' })), h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this._resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, mode: this._filterMode, hideFilterButton: true, sizeChips: 'default' })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'snk-crud__grid-stack-item' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode, hideHeader: true, hideGridTaskbar: true }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, customGuidesConfig: this.customGuidesConfig, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields, onFormConfigVisibilityChanged: evt => this._headerVisible = !evt.detail }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderCustomGuideSlots(), h("slot", { name: "SnkFormTaskBar" })))), h("snk-attach", { ref: (ref) => this._snkAttach = ref, registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName }), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId, layoutFormConfig: this.layoutFormConfig }), this.renderDynamicSearch(), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
|
600
600
|
}
|
|
601
601
|
static get is() { return "snk-crud"; }
|
|
602
602
|
static get encapsulation() { return "scoped"; }
|
|
@@ -21,6 +21,10 @@ export class SnkImageInput {
|
|
|
21
21
|
await this.clearImage();
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
+
if (action.type === Action.EDITION_CANCELED) {
|
|
25
|
+
await this.loadImage();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
24
28
|
};
|
|
25
29
|
this.dataUnit = undefined;
|
|
26
30
|
this.fieldName = undefined;
|
|
@@ -45,6 +49,8 @@ export class SnkImageInput {
|
|
|
45
49
|
return this.messagesBuilder.getMessage(key, params);
|
|
46
50
|
}
|
|
47
51
|
async clearImage() {
|
|
52
|
+
var _a;
|
|
53
|
+
(_a = this._loadAbortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
48
54
|
this.imageValue = undefined;
|
|
49
55
|
}
|
|
50
56
|
async handleImageChange(event) {
|
|
@@ -106,11 +112,17 @@ export class SnkImageInput {
|
|
|
106
112
|
}
|
|
107
113
|
}
|
|
108
114
|
async loadImage(pks) {
|
|
109
|
-
var _a;
|
|
115
|
+
var _a, _b;
|
|
116
|
+
(_a = this._loadAbortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
117
|
+
const controller = new AbortController();
|
|
118
|
+
this._loadAbortController = controller;
|
|
110
119
|
this.loading = true;
|
|
111
120
|
if (this.dataUnit && this.entityName) {
|
|
112
|
-
pks = (
|
|
113
|
-
|
|
121
|
+
pks = (_b = pks !== null && pks !== void 0 ? pks : this.getPksFromDataUnit()) !== null && _b !== void 0 ? _b : getPKs(this.dataUnit);
|
|
122
|
+
const image = await downloadImage(pks, this.fieldName, this.entityName, controller.signal);
|
|
123
|
+
if (controller.signal.aborted)
|
|
124
|
+
return;
|
|
125
|
+
this.imageValue = image;
|
|
114
126
|
}
|
|
115
127
|
this.loading = false;
|
|
116
128
|
}
|
|
@@ -115,19 +115,21 @@ export async function imageBlobToBase64(blob) {
|
|
|
115
115
|
reader.readAsDataURL(blob);
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
-
export async function downloadImage(pks, fieldName, entityName) {
|
|
118
|
+
export async function downloadImage(pks, fieldName, entityName, signal) {
|
|
119
119
|
const uploadUrl = getBaseUrl(pks, entityName, fieldName);
|
|
120
120
|
if (!uploadUrl) {
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
123
|
try {
|
|
124
|
-
const response = await fetch(uploadUrl);
|
|
124
|
+
const response = await fetch(uploadUrl, { signal });
|
|
125
125
|
if (response.ok) {
|
|
126
126
|
const blob = await response.blob();
|
|
127
127
|
return await imageBlobToBase64(blob);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
catch (error) {
|
|
131
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted)
|
|
132
|
+
return;
|
|
131
133
|
console.error('Error downloading image:', error);
|
|
132
134
|
}
|
|
133
135
|
}
|
|
@@ -255,7 +255,7 @@ function getTopTaskBarId(dataState, presentationMode) {
|
|
|
255
255
|
return `snkGridTopTaskbar.regular${sufix}`;
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%;overflow-y:auto;scrollbar-gutter:stable both-edges}snk-grid.sc-snk-crud{--snk-grid-padding:0 var(--space--6, 6px) var(--space--6, 6px) var(--space--6, 6px)}stack-item.sc-snk-crud.sc-snk-crud{display:grid;min-height:100%}.snk-crud__grid-stack-item.sc-snk-crud{display:flex;flex-direction:column;height:100%;width:100%;padding:0 var(--space--2, 2px)}.snk-crud__header-top.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:var(--space--8, 8px);padding-top:var(--space--12, 12px)}.snk-crud__header-bottom.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:0 var(--space--8, 8px) 0 var(--space--6, 6px)}.snk-crud__header-bottom.sc-snk-crud>snk-taskbar.sc-snk-crud{padding-bottom:var(--space--8, 8px);margin-left:var(--space--12, 12px)}.snk-crud--hidden.sc-snk-crud{display:none !important}ez-record-navigation.sc-snk-crud,ez-grid-pagination.sc-snk-crud{margin-bottom:var(--space--8, 8px)}";
|
|
258
|
+
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%;overflow-y:auto;scrollbar-gutter:stable both-edges}snk-grid.sc-snk-crud{--snk-grid-padding:0 var(--space--6, 6px) var(--space--6, 6px) var(--space--6, 6px)}stack-item.sc-snk-crud.sc-snk-crud{display:grid;min-height:100%}.snk-crud__header.sc-snk-crud{margin-bottom:var(--space--10, 10px)}.snk-crud__grid-stack-item.sc-snk-crud{display:flex;flex-direction:column;height:100%;width:100%;padding:0 var(--space--2, 2px)}.snk-crud__header-top.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:var(--space--8, 8px);padding-top:var(--space--12, 12px)}.snk-crud__header-bottom.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:0 var(--space--8, 8px) 0 var(--space--6, 6px)}.snk-crud__header-bottom.sc-snk-crud>snk-taskbar.sc-snk-crud{padding-bottom:var(--space--8, 8px);margin-left:var(--space--12, 12px)}.snk-crud--hidden.sc-snk-crud{display:none !important}ez-record-navigation.sc-snk-crud,ez-grid-pagination.sc-snk-crud{margin-bottom:var(--space--8, 8px)}";
|
|
259
259
|
|
|
260
260
|
const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
261
261
|
constructor() {
|
|
@@ -845,7 +845,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
845
845
|
return;
|
|
846
846
|
}
|
|
847
847
|
this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
|
|
848
|
-
return (h(Host, null, h("header", { class: { 'snk-crud--hidden': !this._headerVisible } }, h("div", { class: "snk-crud__header-top" }, h("snk-taskbar", { "data-element-id": "grid_top", key: "snkGridTopTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, resourceID: this._resourceID, primaryButton: "INSERT", overflowStrategy: "hiddenItems", alignRigth: true, actionsList: this.getActionsList(), customActionsList: this.buildTaskbarCustomActionsList(), sizeButtons: 'medium' })), h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this._resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, mode: this._filterMode, hideFilterButton: true, sizeChips: 'default' })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'snk-crud__grid-stack-item' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode, hideHeader: true, hideGridTaskbar: true }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, customGuidesConfig: this.customGuidesConfig, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields, onFormConfigVisibilityChanged: evt => this._headerVisible = !evt.detail }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderCustomGuideSlots(), h("slot", { name: "SnkFormTaskBar" })))), h("snk-attach", { ref: (ref) => this._snkAttach = ref, registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName }), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId, layoutFormConfig: this.layoutFormConfig }), this.renderDynamicSearch(), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
|
848
|
+
return (h(Host, null, h("header", { class: { 'snk-crud--hidden': !this._headerVisible, 'snk-crud__header': true } }, h("div", { class: "snk-crud__header-top" }, h("snk-taskbar", { "data-element-id": "grid_top", key: "snkGridTopTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, resourceID: this._resourceID, primaryButton: "INSERT", overflowStrategy: "hiddenItems", alignRigth: true, actionsList: this.getActionsList(), customActionsList: this.buildTaskbarCustomActionsList(), sizeButtons: 'medium' })), h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this._resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, mode: this._filterMode, hideFilterButton: true, sizeChips: 'default' })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'snk-crud__grid-stack-item' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode, hideHeader: true, hideGridTaskbar: true }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, customGuidesConfig: this.customGuidesConfig, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields, onFormConfigVisibilityChanged: evt => this._headerVisible = !evt.detail }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderCustomGuideSlots(), h("slot", { name: "SnkFormTaskBar" })))), h("snk-attach", { ref: (ref) => this._snkAttach = ref, registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName }), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId, layoutFormConfig: this.layoutFormConfig }), this.renderDynamicSearch(), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
|
849
849
|
}
|
|
850
850
|
get _element() { return this; }
|
|
851
851
|
static get watchers() { return {
|
|
@@ -118,19 +118,21 @@ async function imageBlobToBase64(blob) {
|
|
|
118
118
|
reader.readAsDataURL(blob);
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
-
async function downloadImage(pks, fieldName, entityName) {
|
|
121
|
+
async function downloadImage(pks, fieldName, entityName, signal) {
|
|
122
122
|
const uploadUrl = getBaseUrl(pks, entityName, fieldName);
|
|
123
123
|
if (!uploadUrl) {
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
126
|
try {
|
|
127
|
-
const response = await fetch(uploadUrl);
|
|
127
|
+
const response = await fetch(uploadUrl, { signal });
|
|
128
128
|
if (response.ok) {
|
|
129
129
|
const blob = await response.blob();
|
|
130
130
|
return await imageBlobToBase64(blob);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
catch (error) {
|
|
134
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted)
|
|
135
|
+
return;
|
|
134
136
|
console.error('Error downloading image:', error);
|
|
135
137
|
}
|
|
136
138
|
}
|
|
@@ -159,6 +161,10 @@ const SnkImageInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
159
161
|
await this.clearImage();
|
|
160
162
|
return;
|
|
161
163
|
}
|
|
164
|
+
if (action.type === Action.EDITION_CANCELED) {
|
|
165
|
+
await this.loadImage();
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
162
168
|
};
|
|
163
169
|
this.dataUnit = undefined;
|
|
164
170
|
this.fieldName = undefined;
|
|
@@ -183,6 +189,8 @@ const SnkImageInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
183
189
|
return this.messagesBuilder.getMessage(key, params);
|
|
184
190
|
}
|
|
185
191
|
async clearImage() {
|
|
192
|
+
var _a;
|
|
193
|
+
(_a = this._loadAbortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
186
194
|
this.imageValue = undefined;
|
|
187
195
|
}
|
|
188
196
|
async handleImageChange(event) {
|
|
@@ -244,11 +252,17 @@ const SnkImageInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
244
252
|
}
|
|
245
253
|
}
|
|
246
254
|
async loadImage(pks) {
|
|
247
|
-
var _a;
|
|
255
|
+
var _a, _b;
|
|
256
|
+
(_a = this._loadAbortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
257
|
+
const controller = new AbortController();
|
|
258
|
+
this._loadAbortController = controller;
|
|
248
259
|
this.loading = true;
|
|
249
260
|
if (this.dataUnit && this.entityName) {
|
|
250
|
-
pks = (
|
|
251
|
-
|
|
261
|
+
pks = (_b = pks !== null && pks !== void 0 ? pks : this.getPksFromDataUnit()) !== null && _b !== void 0 ? _b : getPKs(this.dataUnit);
|
|
262
|
+
const image = await downloadImage(pks, this.fieldName, this.entityName, controller.signal);
|
|
263
|
+
if (controller.signal.aborted)
|
|
264
|
+
return;
|
|
265
|
+
this.imageValue = image;
|
|
252
266
|
}
|
|
253
267
|
this.loading = false;
|
|
254
268
|
}
|
|
@@ -116,19 +116,21 @@ async function imageBlobToBase64(blob) {
|
|
|
116
116
|
reader.readAsDataURL(blob);
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
async function downloadImage(pks, fieldName, entityName) {
|
|
119
|
+
async function downloadImage(pks, fieldName, entityName, signal) {
|
|
120
120
|
const uploadUrl = getBaseUrl(pks, entityName, fieldName);
|
|
121
121
|
if (!uploadUrl) {
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
try {
|
|
125
|
-
const response = await fetch(uploadUrl);
|
|
125
|
+
const response = await fetch(uploadUrl, { signal });
|
|
126
126
|
if (response.ok) {
|
|
127
127
|
const blob = await response.blob();
|
|
128
128
|
return await imageBlobToBase64(blob);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
catch (error) {
|
|
132
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted)
|
|
133
|
+
return;
|
|
132
134
|
console.error('Error downloading image:', error);
|
|
133
135
|
}
|
|
134
136
|
}
|
|
@@ -220,7 +220,7 @@ function getTopTaskBarId(dataState, presentationMode) {
|
|
|
220
220
|
return `snkGridTopTaskbar.regular${sufix}`;
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%;overflow-y:auto;scrollbar-gutter:stable both-edges}snk-grid.sc-snk-crud{--snk-grid-padding:0 var(--space--6, 6px) var(--space--6, 6px) var(--space--6, 6px)}stack-item.sc-snk-crud.sc-snk-crud{display:grid;min-height:100%}.snk-crud__grid-stack-item.sc-snk-crud{display:flex;flex-direction:column;height:100%;width:100%;padding:0 var(--space--2, 2px)}.snk-crud__header-top.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:var(--space--8, 8px);padding-top:var(--space--12, 12px)}.snk-crud__header-bottom.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:0 var(--space--8, 8px) 0 var(--space--6, 6px)}.snk-crud__header-bottom.sc-snk-crud>snk-taskbar.sc-snk-crud{padding-bottom:var(--space--8, 8px);margin-left:var(--space--12, 12px)}.snk-crud--hidden.sc-snk-crud{display:none !important}ez-record-navigation.sc-snk-crud,ez-grid-pagination.sc-snk-crud{margin-bottom:var(--space--8, 8px)}";
|
|
223
|
+
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%;overflow-y:auto;scrollbar-gutter:stable both-edges}snk-grid.sc-snk-crud{--snk-grid-padding:0 var(--space--6, 6px) var(--space--6, 6px) var(--space--6, 6px)}stack-item.sc-snk-crud.sc-snk-crud{display:grid;min-height:100%}.snk-crud__header.sc-snk-crud{margin-bottom:var(--space--10, 10px)}.snk-crud__grid-stack-item.sc-snk-crud{display:flex;flex-direction:column;height:100%;width:100%;padding:0 var(--space--2, 2px)}.snk-crud__header-top.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:var(--space--8, 8px);padding-top:var(--space--12, 12px)}.snk-crud__header-bottom.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:0 var(--space--8, 8px) 0 var(--space--6, 6px)}.snk-crud__header-bottom.sc-snk-crud>snk-taskbar.sc-snk-crud{padding-bottom:var(--space--8, 8px);margin-left:var(--space--12, 12px)}.snk-crud--hidden.sc-snk-crud{display:none !important}ez-record-navigation.sc-snk-crud,ez-grid-pagination.sc-snk-crud{margin-bottom:var(--space--8, 8px)}";
|
|
224
224
|
|
|
225
225
|
const SnkCrud = class {
|
|
226
226
|
constructor(hostRef) {
|
|
@@ -809,7 +809,7 @@ const SnkCrud = class {
|
|
|
809
809
|
return;
|
|
810
810
|
}
|
|
811
811
|
this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
|
|
812
|
-
return (h(Host, null, h("header", { class: { 'snk-crud--hidden': !this._headerVisible } }, h("div", { class: "snk-crud__header-top" }, h("snk-taskbar", { "data-element-id": "grid_top", key: "snkGridTopTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, resourceID: this._resourceID, primaryButton: "INSERT", overflowStrategy: "hiddenItems", alignRigth: true, actionsList: this.getActionsList(), customActionsList: this.buildTaskbarCustomActionsList(), sizeButtons: 'medium' })), h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this._resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, mode: this._filterMode, hideFilterButton: true, sizeChips: 'default' })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'snk-crud__grid-stack-item' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode, hideHeader: true, hideGridTaskbar: true }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, customGuidesConfig: this.customGuidesConfig, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields, onFormConfigVisibilityChanged: evt => this._headerVisible = !evt.detail }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderCustomGuideSlots(), h("slot", { name: "SnkFormTaskBar" })))), h("snk-attach", { ref: (ref) => this._snkAttach = ref, registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName }), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId, layoutFormConfig: this.layoutFormConfig }), this.renderDynamicSearch(), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
|
812
|
+
return (h(Host, null, h("header", { class: { 'snk-crud--hidden': !this._headerVisible, 'snk-crud__header': true } }, h("div", { class: "snk-crud__header-top" }, h("snk-taskbar", { "data-element-id": "grid_top", key: "snkGridTopTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, resourceID: this._resourceID, primaryButton: "INSERT", overflowStrategy: "hiddenItems", alignRigth: true, actionsList: this.getActionsList(), customActionsList: this.buildTaskbarCustomActionsList(), sizeButtons: 'medium' })), h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this._resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, mode: this._filterMode, hideFilterButton: true, sizeChips: 'default' })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'snk-crud__grid-stack-item' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode, hideHeader: true, hideGridTaskbar: true }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, customGuidesConfig: this.customGuidesConfig, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields, onFormConfigVisibilityChanged: evt => this._headerVisible = !evt.detail }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderCustomGuideSlots(), h("slot", { name: "SnkFormTaskBar" })))), h("snk-attach", { ref: (ref) => this._snkAttach = ref, registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName }), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId, layoutFormConfig: this.layoutFormConfig }), this.renderDynamicSearch(), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
|
813
813
|
}
|
|
814
814
|
get _element() { return getElement(this); }
|
|
815
815
|
static get watchers() { return {
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, e as createEvent, h, f as Host } from './index-0
|
|
|
2
2
|
import { Action, UserInterface, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { DataBinder } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
|
4
4
|
import { focusOnFieldSerch, SEARCH_FIELD_FULL_WIDTH, FormLayout } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
|
-
import { g as getPKs } from './ImageUtils-
|
|
5
|
+
import { g as getPKs } from './ImageUtils-efbea0e4.js';
|
|
6
6
|
|
|
7
7
|
const snkFormViewCss = ".sc-snk-form-view-h{display:flex;width:100%;--ez-form-card-summary-field-content-weight:700}.level-path.sc-snk-form-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.summary-wrapper.sc-snk-form-view{display:flex;overflow:hidden}.summary-header.sc-snk-form-view{border-bottom:1px solid var(--color--strokes);margin-bottom:var(--space--medium);padding-bottom:var(--space--medium)}.summary-container.sc-snk-form-view{display:flex;flex-direction:column}.summary-container.sc-snk-form-view{padding-right:calc(var(--space--extra-large) / 1.5)}.summary-field.sc-snk-form-view{min-width:30px;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.summary-field__title.sc-snk-form-view{color:var(--text--primary, #626e82);font-size:var(--title--small);white-space:nowrap;font-weight:var(--text-weight--medium)}.summary-field__content.sc-snk-form-view{color:var(--title--primary, #2b3a54);font-size:var(--text--large);font-weight:var(--ez-form-card-summary-field-content-weight)}";
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, e as createEvent, h, f as Host } from './index-04f73a26.js';
|
|
2
2
|
import { Action, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-1eb7a1af.js';
|
|
4
|
-
import { b as base64ToBlob, s as sessionFileUpload, a as buildFileKey, g as getPKs, d as downloadImage } from './ImageUtils-
|
|
4
|
+
import { b as base64ToBlob, s as sessionFileUpload, a as buildFileKey, g as getPKs, d as downloadImage } from './ImageUtils-efbea0e4.js';
|
|
5
5
|
|
|
6
6
|
const snkImageInputCss = ":host{display:block}";
|
|
7
7
|
|
|
@@ -25,6 +25,10 @@ const SnkImageInput = class {
|
|
|
25
25
|
await this.clearImage();
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
+
if (action.type === Action.EDITION_CANCELED) {
|
|
29
|
+
await this.loadImage();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
28
32
|
};
|
|
29
33
|
this.dataUnit = undefined;
|
|
30
34
|
this.fieldName = undefined;
|
|
@@ -49,6 +53,8 @@ const SnkImageInput = class {
|
|
|
49
53
|
return this.messagesBuilder.getMessage(key, params);
|
|
50
54
|
}
|
|
51
55
|
async clearImage() {
|
|
56
|
+
var _a;
|
|
57
|
+
(_a = this._loadAbortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
52
58
|
this.imageValue = undefined;
|
|
53
59
|
}
|
|
54
60
|
async handleImageChange(event) {
|
|
@@ -110,11 +116,17 @@ const SnkImageInput = class {
|
|
|
110
116
|
}
|
|
111
117
|
}
|
|
112
118
|
async loadImage(pks) {
|
|
113
|
-
var _a;
|
|
119
|
+
var _a, _b;
|
|
120
|
+
(_a = this._loadAbortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
121
|
+
const controller = new AbortController();
|
|
122
|
+
this._loadAbortController = controller;
|
|
114
123
|
this.loading = true;
|
|
115
124
|
if (this.dataUnit && this.entityName) {
|
|
116
|
-
pks = (
|
|
117
|
-
|
|
125
|
+
pks = (_b = pks !== null && pks !== void 0 ? pks : this.getPksFromDataUnit()) !== null && _b !== void 0 ? _b : getPKs(this.dataUnit);
|
|
126
|
+
const image = await downloadImage(pks, this.fieldName, this.entityName, controller.signal);
|
|
127
|
+
if (controller.signal.aborted)
|
|
128
|
+
return;
|
|
129
|
+
this.imageValue = image;
|
|
118
130
|
}
|
|
119
131
|
this.loading = false;
|
|
120
132
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,e as i,h as s,f as e,g as n}from"./p-2c9d0870.js";import{Action as a,StringUtils as r,ElementIDUtils as h,ApplicationContext as o,KeyboardManager as d}from"@sankhyalabs/core";import"./p-2af8aca3.js";import"./p-4f7adf97.js";import{P as c,E as l}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-d972a9c1.js";import"./p-ff1990ad.js";import"./p-3870748a.js";import{V as u}from"./p-9019a32f.js";import{A as m}from"./p-3704bf1b.js";import{S as g}from"./p-cad964b5.js";import{T as p}from"./p-3072136e.js";import{v as f}from"./p-76e66fd9.js";import{buildFieldSearch as v}from"@sankhyalabs/ezui/dist/collection/utils";import{C as k}from"./p-e5a3711f.js";import"./p-8d884fab.js";import"./p-554c0e54.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-a73b6b00.js";class C{constructor(t){this._defaultButtons=[],this._defaultButtons=[...t]}process(t,i,s,e=[],n=[]){var a;this.taskbarID=t,this.customButtons=new Map,this.buttonsArray=[],this.disabledButtons=[...e],null===(a=this.getButtonsArray(i,s))||void 0===a||a.forEach((t=>{let a;"string"==typeof t?a=t:(this.customButtons.set(t.name,t),a=t.name),n.includes(a)||(this.isEnabled(i,a,s,e)||this.disabledButtons.push(a),this.buttonsArray.push(a))})),this.buttons=this.buttonsArray.join(",")}getButtonsArray(t,i){return t?t.getButtons(this.taskbarID,i,[...this._defaultButtons]):this._defaultButtons}isEnabled(t,i,s,e){const n=!e.includes(i);return t&&t.isEnabled?t.isEnabled(this.taskbarID,s,i,n):n}}const b=[p.FORM_MODE,p.PREVIOUS,p.NEXT,p.REFRESH,p.SPACER,p.ACTIONS_BUTTON,p.DATA_EXPORTER,p.ATTACH,p.CLONE,p.UPDATE,p.REMOVE,p.INSERT,p.CONFIGURATOR,p.MORE_OPTIONS];var y;function T(t,i){const s={primary:"",secondary:".secondary",singleTaskbar:".singleTaskbar"}[i];return(null==t?void 0:t.isDirty)?`snkGridTopTaskbar.finish_edition${s}`:`snkGridTopTaskbar.regular${s}`}!function(t){t.FILTER="FILTER",t.ENTITY_SEARCH="ENTITY_SEARCH"}(y||(y={}));const E=class{constructor(s){t(this,s),this.snkShowGuide=i(this,"snkShowGuide",7),this.actionClick=i(this,"actionClick",7),this.configuratorSave=i(this,"configuratorSave",7),this.configuratorCancel=i(this,"configuratorCancel",7),this.formItemsReady=i(this,"formItemsReady",7),this.viewModeChanged=i(this,"viewModeChanged",7),this.numberingConfigChanged=i(this,"numberingConfigChanged",7),this._viewHistory=[],this._customEditors=new Map,this._customRenders=new Map,this._taskbarProcessor=new C(b),this._taskbarCustomProcessor=new C([]),this.dataUnitInterceptor={interceptAction:async t=>{switch(t.type){case a.DATA_SAVED:return this.interceptDataSaved(t);case a.LOADING_DATA:return await this.interceptLoadData(t);default:return t}}},this._dataUnit=void 0,this._dataState=void 0,this.attachmentRegisterKey=void 0,this._currentViewMode=u.GRID,this._canEdit=void 0,this._resourceID=void 0,this.customContainerId=`SNK-CRUD-CUSTOM-CONTAINER-${r.generateUUID()}`,this.numberingConfig=void 0,this._filterMode="regular",this._enableContinuousInsert=!1,this._headerVisible=!0,this.enableLockManagerLoadingComp=!1,this.enableLockManagerTaskbarClick=!1,this.configName=void 0,this.filterBarTitle=void 0,this.selectionToastConfig=void 0,this.showActionButtons=!0,this.actionsList=void 0,this.taskbarManager=void 0,this.recordsValidator=void 0,this.statusResolver=void 0,this.multipleSelection=!0,this.presentationMode=c.PRIMARY,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.gridLegacyConfigName=void 0,this.filterBarLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.disablePersonalizedFilter=void 0,this.autoLoad=void 0,this.autoFocus=!0,this.enableGridInsert=!1,this.domainMessagesBuilder=void 0,this.ignoreReadOnlyFormFields=void 0,this.setCustomFormTitle=void 0,this.strategyExporter=l.SERVER_SIDE,this.layoutFormConfig=!0,this.multipleEditionEnabled=!0,this.paginationCounterMode="auto",this.customGuidesConfig=[],this.showEntitySearch=!0,this.disableNumberingConfig=!1}handleActionClick(t){this.executeAction(t.detail)}async goToView(t){this.executeAction(t)}async openConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.open()}async closeConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.close()}async reloadFilterBar(){var t;null===(t=this._snkGrid)||void 0===t||t.reloadFilterBar()}async getFilterBar(){return await this._snkGrid.getFilterBar()}async addCustomEditor(t,i){if(this._guidesViewer&&this._snkGrid)return this._guidesViewer.addCustomEditor(t,i),void this._snkGrid.addCustomEditor(t,i);const s=new Map(this._customEditors);s.set(t,i),this._customEditors=s}async addGridCustomRender(t,i){if(this._snkGrid)return void this._snkGrid.addGridCustomRender(t,i);const s=new Map(this._customRenders);s.set(t,i),this._customRenders=s}async addCustomValueFormatter(t,i){this._snkGrid.addCustomValueFormatter(t,i)}async removeCustomValueFormatter(t){this._snkGrid.removeCustomValueFormatter(t)}async setFieldProp(t,i,s){await this._guidesViewer.setFieldProp(t,i,s)}async getNumberingConfig(){return this.numberingConfig}async updateNumberingConfig(t){this.numberingConfig=t,this.applyNumberingConfigToFields()}currentViewModeWatcher(t){this._viewHistory=[...this._viewHistory.slice(-1),t]}async gridToForm(t=!1){this._backToGrid=!t&&await this._viewStack.getSelectedIndex()===u.GRID,this.setViewMode(u.FORM)}async executeAction(t){var i;switch(t){case p.GRID_MODE:return this.setViewMode(u.GRID);case p.FORM_MODE:case p.UPDATE:return this.gridToForm(t!==p.UPDATE);case p.UPDATE_MULTIPLE:return this._dataUnit.isMultipleEdition=!0,this.setViewMode(u.FORM);case p.CONFIGURATOR:return this._snkConfigurator.open();case p.ATTACH:return this._snkAttach.open();case y.FILTER:return null===(i=this._snkFilterBar)||void 0===i?void 0:i.showFilterModal();case y.ENTITY_SEARCH:return this.openSearchPopover()}}setViewMode(t){this._viewStack.show(t),this._currentViewMode=t,t===u.GRID?(this._dataUnit.isMultipleEdition=!1,this._snkGrid.setFocus()):t===u.FORM&&this._guidesViewer.setFocus(),this.viewModeChanged.emit(t)}openConfig(t){this._snkConfigurator.close(),t===u.GRID?this._snkGrid.showConfig():t===u.FORM&&this._guidesViewer.showFormConfig()}addDataElementID(){h.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}insertionModeHandler(){this.enableGridInsert||this.gridToForm()}cancelHandler(){this._backToGrid&&this.setViewMode(u.GRID)}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:t})=>t)).join("_")}setCustomRenders(){if(this._snkGrid)for(const[t,i]of this._customRenders)this._snkGrid.addGridCustomRender(t,i),this._customRenders.delete(t)}setCustomEditors(){if(this._snkGrid&&this._guidesViewer)for(const[t,i]of this._customEditors)this._guidesViewer.addCustomEditor(t,i),this._snkGrid.addCustomEditor(t,i),this._customEditors.delete(t)}initializeTaskbarProcessor(){const t=function(t,i,s){var e,n;const a=[{name:y.FILTER,hint:null!==(e=null==s?void 0:s.getMessage("snkCrud.customButtons.filter"))&&void 0!==e?e:"Abre o painel de filtros",iconName:"filter"},{name:y.ENTITY_SEARCH,hint:null!==(n=null==s?void 0:s.getMessage("snkCrud.customButtons.entitySearch"))&&void 0!==n?n:"Busca na entidade",iconName:"search"}],r=[p.CANCEL,p.SAVE];return{getButtons:(s,e,n)=>{var h,o;if(!s)return console.warn("taskbarID não fornecido"),[];if((null==e?void 0:e.insertionMode)||(null==e?void 0:e.isDirty))return r;if(t===u.FORM){const t=n.indexOf(p.FORM_MODE);t>-1&&(n=[...n.slice(0,t),p.GRID_MODE,...n.slice(t+1)])}if((null===(o=null===(h=null==e?void 0:e.selectionInfo)||void 0===h?void 0:h.records)||void 0===o?void 0:o.length)>1){const t=n.indexOf(p.UPDATE);t>-1&&(n=[...n.slice(0,t),p.UPDATE_MULTIPLE,...n.slice(t+1)])}const d=function(t,i){const s=t.findIndex((t=>t===p.SPACER||"string"==typeof t&&"SPACER"===t));return s>-1?[...t.slice(0,s),...i,...t.slice(s)]:[...i,...t]}(n,a);return(null==i?void 0:i.getButtons)?i.getButtons(s,e,d):d},isEnabled:(t,s,e,n)=>{var a;return s?!(void 0===s.selectedRecord&&[p.UPDATE,p.REMOVE,p.ATTACH,p.CLONE].includes(e))&&(null!==(a=null==i?void 0:i.isEnabled(t,s,e,n))&&void 0!==a?a:n):n},getMoreOptions(t,s,e,n){var a;return null===(a=null==i?void 0:i.getMoreOptions)||void 0===a?void 0:a.call(i,t,s,e,n)}}}(this._currentViewMode,this.taskbarManager,this.messagesBuilder),i=T(this._dataState,this.presentationMode);this._taskbarProcessor.process(i,t,this._dataState,void 0,[]);const s=function(t,i){var s;const e=t&&!!(null===(s=t.selectionInfo)||void 0===s?void 0:s.length),n={primary:"snkGridHeaderTaskbar",secondary:"snkGridHeaderTaskbar",singleTaskbar:"snkGridHeaderTaskbar.singleTaskbar"}[i];let a=e?`${n}.selected`:`${n}.unselected`;return(null==t?void 0:t.isDirty)&&i===c.SINGLE_TASKBAR&&(a="snkGridHeaderTaskbar.singleTaskbar.finish_edition"),a}(this._dataState,this.presentationMode);this._taskbarCustomProcessor.process(s,this.taskbarManager,this._dataState,void 0,[])}componentWillRender(){this.initializeTaskbarProcessor()}componentDidRender(){this.setCustomRenders(),this.setCustomEditors()}componentWillLoad(){this._application=o.getContextValue("__SNK__APPLICATION__");let t=this._element.parentElement;for(this._application.hasAccess(m.UPDATE,this._resourceID).then((t=>this._canEdit=t));t;){if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){this._snkDataUnit=t,this._snkDataUnit.addEventListener("insertionMode",(()=>this.insertionModeHandler())),this._snkDataUnit.addEventListener("cancelEdition",(()=>this.cancelHandler())),this._snkDataUnit.domainMessagesBuilder=this.domainMessagesBuilder,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.initDataUnit():this._snkDataUnit.addEventListener("dataUnitReady",(t=>{this._dataUnit=t.detail,this.initDataUnit()})),this._snkDataUnit.addEventListener("dataStateChange",this.handleDataStateChange.bind(this));break}t=t.parentElement}this.configName||(this.configName=this._application.configName),this.initContinuousInsertUtils()}componentDidLoad(){this.initKeyboardManager()}disconnectedCallback(){var t;this.removeShortcuts(),null===(t=this._dataUnit)||void 0===t||t.removeInterceptor(this.dataUnitInterceptor)}async handleDataStateChange(t){var i;this._dataState=t.detail,void 0!==this._dataState.selectedRecord&&(this.attachmentRegisterKey=await this.getAttachmentRegisterKey());const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const t of s||[]){if(!t)continue;const s=null===(i=this._dataState.rowMetadata)||void 0===i?void 0:i.getProp("rm_precision",t);(s||0===s)&&(await this.setFieldProp(t,"precision",s),await this.setFieldProp(t,"prettyPrecision",s))}}async initKeyboardManager(){this._keyboardManager=new d({propagate:!1,element:this._element});const t=this._dataUnit||await this._snkDataUnit.getDataUnit();async function i(){const i=document.activeElement,s=i==document.body;s||i.blur(),await t.saveData(),s||null==i.setFocus?s||i.focus():i.setFocus()}this._keyboardManager&&this._keyboardManager.bind("F6",this.toggleView.bind(this),{description:this.getMessage("snkCrud.shortcuts.toggleView"),element:this._element}).bind("F7",i.bind(this),{description:this.getMessage("snkCrud.shortcuts.saveData"),element:this._element}).bind("ctrl + \\",i.bind(this),{description:this.getMessage("snkCrud.shortcuts.addRecord"),element:this._element}).bind("F8",async function(){t.hasNewRecord()||t.addRecord()}.bind(this),{description:this.getMessage("snkCrud.shortcuts.addRecord"),element:this._element}).bind("F9",t.removeSelectedRecords.bind(t),{description:this.getMessage("snkCrud.shortcuts.removeRecord"),element:this._element}).bind("ctrl + F9",t.removeSelectedRecords.bind(t),{description:this.getMessage("snkCrud.shortcuts.removeRecord"),element:this._element}).bind("F5",(async()=>{const i=await this._viewStack.getSelectedIndex();u.GRID===i&&t.loadData()}),{description:this.getMessage("snkCrud.shortcuts.refreshData"),element:this._element}).bind("Escape",(()=>{t.isDirty()&&t.cancelEdition()}),{debounceTime:1e3,description:this.getMessage("snkCrud.shortcuts.cancelAction"),element:this._element})}getMessage(t,i){if(this.messagesBuilder)return this.messagesBuilder.getMessage(t,i)}async removeShortcuts(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}async toggleView(){const t=await this._viewStack.getSelectedIndex();this.setViewMode(u.GRID===t?u.FORM:u.GRID)}getLastRecordSaved(t){var i;return(null===(i=t.payload)||void 0===i?void 0:i.records.length)?t.payload.records[t.payload.records.length-1]:null}async saveNumberingConfig(){const t={entityName:this._snkDataUnit.entityName,isAutoNum:this.numberingConfig.isAutoNumbering,numInicial:this.numberingConfig.initialNumber};await this._servicesNumberingConfig.saveConfig(t)}updateNumberingConfigAfterInsert(t){var i,s;if(!(null===(i=t.payload)||void 0===i?void 0:i.changes.length)||this.disableNumberingConfig||!(null===(s=this.numberingConfig)||void 0===s?void 0:s.isAutoNumbering)||!this._fieldAutoNum)return t;if(!t.payload.changes.some((t=>"INSERT"===t.operation||"COPY"===t.operation)))return t;const e=this.getLastRecordSaved(t);if(e&&e.hasOwnProperty(this._fieldAutoNum)){const t=Number(e[this._fieldAutoNum]);this.numberingConfig.initialNumber=t,this.saveNumberingConfig()}else this.numberingConfig.initialNumber=this.numberingConfig.initialNumber+1;return this.numberingConfigChanged.emit(this.numberingConfig),t}interceptDataSaved(t){return this.updateNumberingConfigAfterInsert(t),t}async interceptLoadData(t){var i;if(f(null===(i=this._snkFilterBar)||void 0===i?void 0:i.filterConfig))return t;{const t=this.messagesBuilder.getMessage("snkGrid.requiredFiltersNotFilled.title",{}),i=this.messagesBuilder.getMessage("snkGrid.requiredFiltersNotFilled.message",{});await this._application.error(t,i)}}onDataUnitReady(){var t;null===(t=this._dataUnit)||void 0===t||t.addInterceptor(this.dataUnitInterceptor),this.loadNumberingConfig()}async initDataUnit(){this.addDataElementID(),this.messagesBuilder||(this.messagesBuilder=this._snkDataUnit.messagesBuilder),null==this._resourceID&&(this._resourceID=this._snkDataUnit.resourceID,null==this._resourceID&&(this._resourceID=await this._application.getResourceID())),this.onDataUnitReady()}initContinuousInsertUtils(){this._continuousInsertUtils=new k(this._application,this._resourceID,this.configName),this.enableGridInsert&&this._continuousInsertUtils.getConfig().then((t=>this._enableContinuousInsert=t))}async loadNumberingConfig(){if(!this.numberingConfig&&this._snkDataUnit&&this._snkDataUnit.entityName&&!this.disableNumberingConfig){this._servicesNumberingConfig||(this._servicesNumberingConfig=new g(this._application,this._resourceID));try{this.numberingConfig=await this._servicesNumberingConfig.getConfig(this._snkDataUnit.entityName),this.getFieldAutoNum(),this.applyNumberingConfigToFields()}catch(t){console.error("Error loading numbering config in snk-crud:",t),this.numberingConfig={isAutoNumbering:!1,initialNumber:null}}}}getFieldAutoNum(){if(this._fieldAutoNum)return;const t=this._dataUnit.metadata.fields.find((t=>{var i;return"true"===(null===(i=t.properties)||void 0===i?void 0:i.isAutoNumField)}));this._fieldAutoNum=(null==t?void 0:t.name)||null}async applyNumberingConfigToFields(){if(!this.numberingConfig||!this._snkDataUnit||!this._fieldAutoNum)return;const t=this._dataUnit.getField(this._fieldAutoNum);t.readOnly=this.numberingConfig.isAutoNumbering,t.required=!this.numberingConfig.isAutoNumbering}handleConfiguratorEvent(t,i){if(t.stopImmediatePropagation(),"SAVE"===i)return this._guidesViewer.reloadGuides(),void this.configuratorSave.emit();this.configuratorCancel.emit()}renderCustomGuideSlots(){if(this.customGuidesConfig)return this.customGuidesConfig.map((t=>s("slot",{name:t.id})))}getColumnSearch(t){return null!=this._columnSearch||(this._columnSearch=v(t,(({argument:t})=>new Promise((i=>{this._snkGrid.filterColumns(t).then((t=>{i(t.filter((t=>!t.hidden)).map((t=>({label:t.label,value:t.name}))))}))}))),(t=>{null!=t&&this._snkGrid.locateColumn(t.value)}))),this._columnSearch}buildTaskbarCustomActionsList(){return[this.buildSearchColumnTaskbarAction()]}buildSearchColumnTaskbarAction(){return{value:r.generateUUID(),label:this.messagesBuilder.getMessage("snkGrid.findColumn",{}),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(t,i)=>this.getColumnSearch(i)}}isGridInsertActive(){return this.enableGridInsert&&this._dataUnit.hasNewRecord()}getActionsList(){const t=[];if(this.enableGridInsert&&t.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert,(()=>{this._enableContinuousInsert=!this._enableContinuousInsert,this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert)}))),this.isGridInsertActive())return t;if(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions){const i=T(this._dataState,this.presentationMode);return t.concat(this.taskbarManager.getMoreOptions(i,this.configName,this._dataState,this.actionsList))}return t.concat(this.actionsList)}async openSearchPopover(){if(!this._popoverSearchEntity)return;const t=this._element.querySelector(`[data-taskbar-element="${y.ENTITY_SEARCH}"]`);await this._popoverSearchEntity.showUnder(t)}handleLoadedSearch(t){1===t.detail.length&&(this._dataUnit.selectFirst(),this.gridToForm(!0))}renderDynamicSearch(){var t;if(this.showEntitySearch)return s("snk-entity-search",{ref:t=>this._popoverSearchEntity=t,dataUnit:this._dataUnit,entityName:null===(t=this._snkDataUnit)||void 0===t?void 0:t.entityName,messagesBuilder:this.messagesBuilder,onLoaded:t=>this.handleLoadedSearch(t)})}handleFilterConfigUpdated(t){t.length&&(1!==t.length||"PERSONALIZED_FILTER_GROUP"!==t[0].id||(this._filterMode=t[0].groupedItems.length>0?"regular":"button"))}render(){if(null!=this._resourceID)return this._snkDataUnit.ignoreSaveMessage=this._currentViewMode===u.GRID&&!this.enableGridInsert,s(e,null,s("header",{class:{"snk-crud--hidden":!this._headerVisible}},s("div",{class:"snk-crud__header-top"},s("snk-taskbar",{"data-element-id":"grid_top",key:"snkGridTopTaskbar",configName:this.configName,dataUnit:this._dataUnit,messagesBuilder:this.messagesBuilder,buttons:this._taskbarProcessor.buttons,disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,resourceID:this._resourceID,primaryButton:"INSERT",overflowStrategy:"hiddenItems",alignRigth:!0,actionsList:this.getActionsList(),customActionsList:this.buildTaskbarCustomActionsList(),sizeButtons:"medium"})),s("snk-filter-bar",{ref:t=>this._snkFilterBar=t,title:this.filterBarTitle,dataUnit:this._dataUnit,"data-element-id":"gridFilter",class:"snk-grid__filter-bar ez-align--top",configName:this.configName,messagesBuilder:this.messagesBuilder,resourceID:this._resourceID,onConfigUpdated:t=>this.handleFilterConfigUpdated(t.detail),disablePersonalizedFilter:this.disablePersonalizedFilter,filterBarLegacyConfigName:this.filterBarLegacyConfigName,autoLoad:this.autoLoad,enableLockManagerLoadingComp:this.enableLockManagerLoadingComp,mode:this._filterMode,hideFilterButton:!0,sizeChips:"default"})),s("ez-view-stack",{ref:t=>this._viewStack=t,"data-element-id":"crud"},s("stack-item",{class:"snk-crud__grid-stack-item"},s("snk-grid",{ref:t=>this._snkGrid=t,class:"ez-flex ez-flex--column ez-size-height--full ez-size-width--full",filterBarTitle:this.filterBarTitle,"data-element-id":"crud_grid",configName:this.configName,onGridDoubleClick:()=>this.gridToForm(!0),taskbarManager:this.taskbarManager,onActionClick:t=>this.executeAction(t.detail),messagesBuilder:this.messagesBuilder,actionsList:this.actionsList,statusResolver:this.statusResolver,multipleSelection:this.multipleSelection,presentationMode:this.presentationMode,recordsValidator:this.recordsValidator,selectionToastConfig:this.selectionToastConfig,useEnterLikeTab:this.useEnterLikeTab,canEdit:this._canEdit,resourceID:this._resourceID,disablePersonalizedFilter:this.disablePersonalizedFilter,gridLegacyConfigName:this.gridLegacyConfigName,filterBarLegacyConfigName:this.filterBarLegacyConfigName,autoLoad:this.autoLoad,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert,enableLockManagerTaskbarClick:this.enableLockManagerTaskbarClick,enableLockManagerLoadingComp:this.enableLockManagerLoadingComp,strategyExporter:this.strategyExporter,multipleEditionEnabled:this.multipleEditionEnabled,paginationCounterMode:this.paginationCounterMode,hideHeader:!0,hideGridTaskbar:!0},s("slot",{name:"GRID_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"GRID_HEADER_CUSTOM_ELEMENTS"}),s("slot",{name:"SnkGridHeader"}),s("slot",{name:"SnkGridFooter"}),s("slot",{name:"SnkGridTaskBar"}))),s("stack-item",null,s("snk-guides-viewer",{ref:t=>this._guidesViewer=t,customGuidesConfig:this.customGuidesConfig,entityPath:this._snkDataUnit.entityName,messagesBuilder:this.messagesBuilder,onExit:()=>this.setViewMode(u.GRID),dataState:this._dataState,dataUnit:this._dataUnit,actionsList:this.actionsList,taskbarManager:this.taskbarManager,configName:this.configName,onActionClick:t=>this.executeAction(t.detail),presentationMode:this.presentationMode,"data-element-id":"crud_form",canEdit:this._canEdit,recordsValidator:this.recordsValidator,resourceID:this._resourceID,detailTaskbarCustomContainerId:this.customContainerId,formLegacyConfigName:this.formLegacyConfigName,enableGridInsert:this.enableGridInsert,getCustomTitle:this.setCustomFormTitle,ignoreReadOnlyFormFields:this.ignoreReadOnlyFormFields,onFormConfigVisibilityChanged:t=>this._headerVisible=!t.detail},s("slot",{name:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"}),this.renderCustomGuideSlots(),s("slot",{name:"SnkFormTaskBar"})))),s("snk-attach",{ref:t=>this._snkAttach=t,registerKey:this.attachmentRegisterKey,messagesBuilder:this.messagesBuilder,entityName:this._snkDataUnit.entityName}),s("snk-configurator",{ref:t=>this._snkConfigurator=t,entityName:this._snkDataUnit.entityName,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:t=>this.setViewMode(t.detail),onOpenConfig:t=>this.openConfig(t.detail),showActionButtons:this.showActionButtons,onSave:t=>this.handleConfiguratorEvent(t,"SAVE"),onCancel:t=>this.handleConfiguratorEvent(t,"CANCEL"),resourceID:this._resourceID,customContainerId:this.customContainerId,layoutFormConfig:this.layoutFormConfig}),this.renderDynamicSearch(),s("div",{id:`${this.customContainerId}`},s("slot",{name:"SnkConfigContainerSlot"}),s("slot",{name:"DETAIL_GRID_HEADER_CUSTOM_ELEMENTS"}),s("slot",{name:"DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"})))}get _element(){return n(this)}static get watchers(){return{_currentViewMode:["currentViewModeWatcher"]}}};E.style=".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%;overflow-y:auto;scrollbar-gutter:stable both-edges}snk-grid.sc-snk-crud{--snk-grid-padding:0 var(--space--6, 6px) var(--space--6, 6px) var(--space--6, 6px)}stack-item.sc-snk-crud.sc-snk-crud{display:grid;min-height:100%}.snk-crud__grid-stack-item.sc-snk-crud{display:flex;flex-direction:column;height:100%;width:100%;padding:0 var(--space--2, 2px)}.snk-crud__header-top.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:var(--space--8, 8px);padding-top:var(--space--12, 12px)}.snk-crud__header-bottom.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:0 var(--space--8, 8px) 0 var(--space--6, 6px)}.snk-crud__header-bottom.sc-snk-crud>snk-taskbar.sc-snk-crud{padding-bottom:var(--space--8, 8px);margin-left:var(--space--12, 12px)}.snk-crud--hidden.sc-snk-crud{display:none !important}ez-record-navigation.sc-snk-crud,ez-grid-pagination.sc-snk-crud{margin-bottom:var(--space--8, 8px)}";export{E as snk_crud}
|
|
1
|
+
import{r as t,e as i,h as s,f as e,g as n}from"./p-2c9d0870.js";import{Action as a,StringUtils as r,ElementIDUtils as h,ApplicationContext as o,KeyboardManager as d}from"@sankhyalabs/core";import"./p-2af8aca3.js";import"./p-4f7adf97.js";import{P as c,E as l}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-d972a9c1.js";import"./p-ff1990ad.js";import"./p-3870748a.js";import{V as u}from"./p-9019a32f.js";import{A as m}from"./p-3704bf1b.js";import{S as g}from"./p-cad964b5.js";import{T as p}from"./p-3072136e.js";import{v as f}from"./p-76e66fd9.js";import{buildFieldSearch as v}from"@sankhyalabs/ezui/dist/collection/utils";import{C as k}from"./p-e5a3711f.js";import"./p-8d884fab.js";import"./p-554c0e54.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-a73b6b00.js";class b{constructor(t){this._defaultButtons=[],this._defaultButtons=[...t]}process(t,i,s,e=[],n=[]){var a;this.taskbarID=t,this.customButtons=new Map,this.buttonsArray=[],this.disabledButtons=[...e],null===(a=this.getButtonsArray(i,s))||void 0===a||a.forEach((t=>{let a;"string"==typeof t?a=t:(this.customButtons.set(t.name,t),a=t.name),n.includes(a)||(this.isEnabled(i,a,s,e)||this.disabledButtons.push(a),this.buttonsArray.push(a))})),this.buttons=this.buttonsArray.join(",")}getButtonsArray(t,i){return t?t.getButtons(this.taskbarID,i,[...this._defaultButtons]):this._defaultButtons}isEnabled(t,i,s,e){const n=!e.includes(i);return t&&t.isEnabled?t.isEnabled(this.taskbarID,s,i,n):n}}const C=[p.FORM_MODE,p.PREVIOUS,p.NEXT,p.REFRESH,p.SPACER,p.ACTIONS_BUTTON,p.DATA_EXPORTER,p.ATTACH,p.CLONE,p.UPDATE,p.REMOVE,p.INSERT,p.CONFIGURATOR,p.MORE_OPTIONS];var y;function T(t,i){const s={primary:"",secondary:".secondary",singleTaskbar:".singleTaskbar"}[i];return(null==t?void 0:t.isDirty)?`snkGridTopTaskbar.finish_edition${s}`:`snkGridTopTaskbar.regular${s}`}!function(t){t.FILTER="FILTER",t.ENTITY_SEARCH="ENTITY_SEARCH"}(y||(y={}));const E=class{constructor(s){t(this,s),this.snkShowGuide=i(this,"snkShowGuide",7),this.actionClick=i(this,"actionClick",7),this.configuratorSave=i(this,"configuratorSave",7),this.configuratorCancel=i(this,"configuratorCancel",7),this.formItemsReady=i(this,"formItemsReady",7),this.viewModeChanged=i(this,"viewModeChanged",7),this.numberingConfigChanged=i(this,"numberingConfigChanged",7),this._viewHistory=[],this._customEditors=new Map,this._customRenders=new Map,this._taskbarProcessor=new b(C),this._taskbarCustomProcessor=new b([]),this.dataUnitInterceptor={interceptAction:async t=>{switch(t.type){case a.DATA_SAVED:return this.interceptDataSaved(t);case a.LOADING_DATA:return await this.interceptLoadData(t);default:return t}}},this._dataUnit=void 0,this._dataState=void 0,this.attachmentRegisterKey=void 0,this._currentViewMode=u.GRID,this._canEdit=void 0,this._resourceID=void 0,this.customContainerId=`SNK-CRUD-CUSTOM-CONTAINER-${r.generateUUID()}`,this.numberingConfig=void 0,this._filterMode="regular",this._enableContinuousInsert=!1,this._headerVisible=!0,this.enableLockManagerLoadingComp=!1,this.enableLockManagerTaskbarClick=!1,this.configName=void 0,this.filterBarTitle=void 0,this.selectionToastConfig=void 0,this.showActionButtons=!0,this.actionsList=void 0,this.taskbarManager=void 0,this.recordsValidator=void 0,this.statusResolver=void 0,this.multipleSelection=!0,this.presentationMode=c.PRIMARY,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.gridLegacyConfigName=void 0,this.filterBarLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.disablePersonalizedFilter=void 0,this.autoLoad=void 0,this.autoFocus=!0,this.enableGridInsert=!1,this.domainMessagesBuilder=void 0,this.ignoreReadOnlyFormFields=void 0,this.setCustomFormTitle=void 0,this.strategyExporter=l.SERVER_SIDE,this.layoutFormConfig=!0,this.multipleEditionEnabled=!0,this.paginationCounterMode="auto",this.customGuidesConfig=[],this.showEntitySearch=!0,this.disableNumberingConfig=!1}handleActionClick(t){this.executeAction(t.detail)}async goToView(t){this.executeAction(t)}async openConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.open()}async closeConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.close()}async reloadFilterBar(){var t;null===(t=this._snkGrid)||void 0===t||t.reloadFilterBar()}async getFilterBar(){return await this._snkGrid.getFilterBar()}async addCustomEditor(t,i){if(this._guidesViewer&&this._snkGrid)return this._guidesViewer.addCustomEditor(t,i),void this._snkGrid.addCustomEditor(t,i);const s=new Map(this._customEditors);s.set(t,i),this._customEditors=s}async addGridCustomRender(t,i){if(this._snkGrid)return void this._snkGrid.addGridCustomRender(t,i);const s=new Map(this._customRenders);s.set(t,i),this._customRenders=s}async addCustomValueFormatter(t,i){this._snkGrid.addCustomValueFormatter(t,i)}async removeCustomValueFormatter(t){this._snkGrid.removeCustomValueFormatter(t)}async setFieldProp(t,i,s){await this._guidesViewer.setFieldProp(t,i,s)}async getNumberingConfig(){return this.numberingConfig}async updateNumberingConfig(t){this.numberingConfig=t,this.applyNumberingConfigToFields()}currentViewModeWatcher(t){this._viewHistory=[...this._viewHistory.slice(-1),t]}async gridToForm(t=!1){this._backToGrid=!t&&await this._viewStack.getSelectedIndex()===u.GRID,this.setViewMode(u.FORM)}async executeAction(t){var i;switch(t){case p.GRID_MODE:return this.setViewMode(u.GRID);case p.FORM_MODE:case p.UPDATE:return this.gridToForm(t!==p.UPDATE);case p.UPDATE_MULTIPLE:return this._dataUnit.isMultipleEdition=!0,this.setViewMode(u.FORM);case p.CONFIGURATOR:return this._snkConfigurator.open();case p.ATTACH:return this._snkAttach.open();case y.FILTER:return null===(i=this._snkFilterBar)||void 0===i?void 0:i.showFilterModal();case y.ENTITY_SEARCH:return this.openSearchPopover()}}setViewMode(t){this._viewStack.show(t),this._currentViewMode=t,t===u.GRID?(this._dataUnit.isMultipleEdition=!1,this._snkGrid.setFocus()):t===u.FORM&&this._guidesViewer.setFocus(),this.viewModeChanged.emit(t)}openConfig(t){this._snkConfigurator.close(),t===u.GRID?this._snkGrid.showConfig():t===u.FORM&&this._guidesViewer.showFormConfig()}addDataElementID(){h.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}insertionModeHandler(){this.enableGridInsert||this.gridToForm()}cancelHandler(){this._backToGrid&&this.setViewMode(u.GRID)}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:t})=>t)).join("_")}setCustomRenders(){if(this._snkGrid)for(const[t,i]of this._customRenders)this._snkGrid.addGridCustomRender(t,i),this._customRenders.delete(t)}setCustomEditors(){if(this._snkGrid&&this._guidesViewer)for(const[t,i]of this._customEditors)this._guidesViewer.addCustomEditor(t,i),this._snkGrid.addCustomEditor(t,i),this._customEditors.delete(t)}initializeTaskbarProcessor(){const t=function(t,i,s){var e,n;const a=[{name:y.FILTER,hint:null!==(e=null==s?void 0:s.getMessage("snkCrud.customButtons.filter"))&&void 0!==e?e:"Abre o painel de filtros",iconName:"filter"},{name:y.ENTITY_SEARCH,hint:null!==(n=null==s?void 0:s.getMessage("snkCrud.customButtons.entitySearch"))&&void 0!==n?n:"Busca na entidade",iconName:"search"}],r=[p.CANCEL,p.SAVE];return{getButtons:(s,e,n)=>{var h,o;if(!s)return console.warn("taskbarID não fornecido"),[];if((null==e?void 0:e.insertionMode)||(null==e?void 0:e.isDirty))return r;if(t===u.FORM){const t=n.indexOf(p.FORM_MODE);t>-1&&(n=[...n.slice(0,t),p.GRID_MODE,...n.slice(t+1)])}if((null===(o=null===(h=null==e?void 0:e.selectionInfo)||void 0===h?void 0:h.records)||void 0===o?void 0:o.length)>1){const t=n.indexOf(p.UPDATE);t>-1&&(n=[...n.slice(0,t),p.UPDATE_MULTIPLE,...n.slice(t+1)])}const d=function(t,i){const s=t.findIndex((t=>t===p.SPACER||"string"==typeof t&&"SPACER"===t));return s>-1?[...t.slice(0,s),...i,...t.slice(s)]:[...i,...t]}(n,a);return(null==i?void 0:i.getButtons)?i.getButtons(s,e,d):d},isEnabled:(t,s,e,n)=>{var a;return s?!(void 0===s.selectedRecord&&[p.UPDATE,p.REMOVE,p.ATTACH,p.CLONE].includes(e))&&(null!==(a=null==i?void 0:i.isEnabled(t,s,e,n))&&void 0!==a?a:n):n},getMoreOptions(t,s,e,n){var a;return null===(a=null==i?void 0:i.getMoreOptions)||void 0===a?void 0:a.call(i,t,s,e,n)}}}(this._currentViewMode,this.taskbarManager,this.messagesBuilder),i=T(this._dataState,this.presentationMode);this._taskbarProcessor.process(i,t,this._dataState,void 0,[]);const s=function(t,i){var s;const e=t&&!!(null===(s=t.selectionInfo)||void 0===s?void 0:s.length),n={primary:"snkGridHeaderTaskbar",secondary:"snkGridHeaderTaskbar",singleTaskbar:"snkGridHeaderTaskbar.singleTaskbar"}[i];let a=e?`${n}.selected`:`${n}.unselected`;return(null==t?void 0:t.isDirty)&&i===c.SINGLE_TASKBAR&&(a="snkGridHeaderTaskbar.singleTaskbar.finish_edition"),a}(this._dataState,this.presentationMode);this._taskbarCustomProcessor.process(s,this.taskbarManager,this._dataState,void 0,[])}componentWillRender(){this.initializeTaskbarProcessor()}componentDidRender(){this.setCustomRenders(),this.setCustomEditors()}componentWillLoad(){this._application=o.getContextValue("__SNK__APPLICATION__");let t=this._element.parentElement;for(this._application.hasAccess(m.UPDATE,this._resourceID).then((t=>this._canEdit=t));t;){if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){this._snkDataUnit=t,this._snkDataUnit.addEventListener("insertionMode",(()=>this.insertionModeHandler())),this._snkDataUnit.addEventListener("cancelEdition",(()=>this.cancelHandler())),this._snkDataUnit.domainMessagesBuilder=this.domainMessagesBuilder,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.initDataUnit():this._snkDataUnit.addEventListener("dataUnitReady",(t=>{this._dataUnit=t.detail,this.initDataUnit()})),this._snkDataUnit.addEventListener("dataStateChange",this.handleDataStateChange.bind(this));break}t=t.parentElement}this.configName||(this.configName=this._application.configName),this.initContinuousInsertUtils()}componentDidLoad(){this.initKeyboardManager()}disconnectedCallback(){var t;this.removeShortcuts(),null===(t=this._dataUnit)||void 0===t||t.removeInterceptor(this.dataUnitInterceptor)}async handleDataStateChange(t){var i;this._dataState=t.detail,void 0!==this._dataState.selectedRecord&&(this.attachmentRegisterKey=await this.getAttachmentRegisterKey());const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const t of s||[]){if(!t)continue;const s=null===(i=this._dataState.rowMetadata)||void 0===i?void 0:i.getProp("rm_precision",t);(s||0===s)&&(await this.setFieldProp(t,"precision",s),await this.setFieldProp(t,"prettyPrecision",s))}}async initKeyboardManager(){this._keyboardManager=new d({propagate:!1,element:this._element});const t=this._dataUnit||await this._snkDataUnit.getDataUnit();async function i(){const i=document.activeElement,s=i==document.body;s||i.blur(),await t.saveData(),s||null==i.setFocus?s||i.focus():i.setFocus()}this._keyboardManager&&this._keyboardManager.bind("F6",this.toggleView.bind(this),{description:this.getMessage("snkCrud.shortcuts.toggleView"),element:this._element}).bind("F7",i.bind(this),{description:this.getMessage("snkCrud.shortcuts.saveData"),element:this._element}).bind("ctrl + \\",i.bind(this),{description:this.getMessage("snkCrud.shortcuts.addRecord"),element:this._element}).bind("F8",async function(){t.hasNewRecord()||t.addRecord()}.bind(this),{description:this.getMessage("snkCrud.shortcuts.addRecord"),element:this._element}).bind("F9",t.removeSelectedRecords.bind(t),{description:this.getMessage("snkCrud.shortcuts.removeRecord"),element:this._element}).bind("ctrl + F9",t.removeSelectedRecords.bind(t),{description:this.getMessage("snkCrud.shortcuts.removeRecord"),element:this._element}).bind("F5",(async()=>{const i=await this._viewStack.getSelectedIndex();u.GRID===i&&t.loadData()}),{description:this.getMessage("snkCrud.shortcuts.refreshData"),element:this._element}).bind("Escape",(()=>{t.isDirty()&&t.cancelEdition()}),{debounceTime:1e3,description:this.getMessage("snkCrud.shortcuts.cancelAction"),element:this._element})}getMessage(t,i){if(this.messagesBuilder)return this.messagesBuilder.getMessage(t,i)}async removeShortcuts(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}async toggleView(){const t=await this._viewStack.getSelectedIndex();this.setViewMode(u.GRID===t?u.FORM:u.GRID)}getLastRecordSaved(t){var i;return(null===(i=t.payload)||void 0===i?void 0:i.records.length)?t.payload.records[t.payload.records.length-1]:null}async saveNumberingConfig(){const t={entityName:this._snkDataUnit.entityName,isAutoNum:this.numberingConfig.isAutoNumbering,numInicial:this.numberingConfig.initialNumber};await this._servicesNumberingConfig.saveConfig(t)}updateNumberingConfigAfterInsert(t){var i,s;if(!(null===(i=t.payload)||void 0===i?void 0:i.changes.length)||this.disableNumberingConfig||!(null===(s=this.numberingConfig)||void 0===s?void 0:s.isAutoNumbering)||!this._fieldAutoNum)return t;if(!t.payload.changes.some((t=>"INSERT"===t.operation||"COPY"===t.operation)))return t;const e=this.getLastRecordSaved(t);if(e&&e.hasOwnProperty(this._fieldAutoNum)){const t=Number(e[this._fieldAutoNum]);this.numberingConfig.initialNumber=t,this.saveNumberingConfig()}else this.numberingConfig.initialNumber=this.numberingConfig.initialNumber+1;return this.numberingConfigChanged.emit(this.numberingConfig),t}interceptDataSaved(t){return this.updateNumberingConfigAfterInsert(t),t}async interceptLoadData(t){var i;if(f(null===(i=this._snkFilterBar)||void 0===i?void 0:i.filterConfig))return t;{const t=this.messagesBuilder.getMessage("snkGrid.requiredFiltersNotFilled.title",{}),i=this.messagesBuilder.getMessage("snkGrid.requiredFiltersNotFilled.message",{});await this._application.error(t,i)}}onDataUnitReady(){var t;null===(t=this._dataUnit)||void 0===t||t.addInterceptor(this.dataUnitInterceptor),this.loadNumberingConfig()}async initDataUnit(){this.addDataElementID(),this.messagesBuilder||(this.messagesBuilder=this._snkDataUnit.messagesBuilder),null==this._resourceID&&(this._resourceID=this._snkDataUnit.resourceID,null==this._resourceID&&(this._resourceID=await this._application.getResourceID())),this.onDataUnitReady()}initContinuousInsertUtils(){this._continuousInsertUtils=new k(this._application,this._resourceID,this.configName),this.enableGridInsert&&this._continuousInsertUtils.getConfig().then((t=>this._enableContinuousInsert=t))}async loadNumberingConfig(){if(!this.numberingConfig&&this._snkDataUnit&&this._snkDataUnit.entityName&&!this.disableNumberingConfig){this._servicesNumberingConfig||(this._servicesNumberingConfig=new g(this._application,this._resourceID));try{this.numberingConfig=await this._servicesNumberingConfig.getConfig(this._snkDataUnit.entityName),this.getFieldAutoNum(),this.applyNumberingConfigToFields()}catch(t){console.error("Error loading numbering config in snk-crud:",t),this.numberingConfig={isAutoNumbering:!1,initialNumber:null}}}}getFieldAutoNum(){if(this._fieldAutoNum)return;const t=this._dataUnit.metadata.fields.find((t=>{var i;return"true"===(null===(i=t.properties)||void 0===i?void 0:i.isAutoNumField)}));this._fieldAutoNum=(null==t?void 0:t.name)||null}async applyNumberingConfigToFields(){if(!this.numberingConfig||!this._snkDataUnit||!this._fieldAutoNum)return;const t=this._dataUnit.getField(this._fieldAutoNum);t.readOnly=this.numberingConfig.isAutoNumbering,t.required=!this.numberingConfig.isAutoNumbering}handleConfiguratorEvent(t,i){if(t.stopImmediatePropagation(),"SAVE"===i)return this._guidesViewer.reloadGuides(),void this.configuratorSave.emit();this.configuratorCancel.emit()}renderCustomGuideSlots(){if(this.customGuidesConfig)return this.customGuidesConfig.map((t=>s("slot",{name:t.id})))}getColumnSearch(t){return null!=this._columnSearch||(this._columnSearch=v(t,(({argument:t})=>new Promise((i=>{this._snkGrid.filterColumns(t).then((t=>{i(t.filter((t=>!t.hidden)).map((t=>({label:t.label,value:t.name}))))}))}))),(t=>{null!=t&&this._snkGrid.locateColumn(t.value)}))),this._columnSearch}buildTaskbarCustomActionsList(){return[this.buildSearchColumnTaskbarAction()]}buildSearchColumnTaskbarAction(){return{value:r.generateUUID(),label:this.messagesBuilder.getMessage("snkGrid.findColumn",{}),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(t,i)=>this.getColumnSearch(i)}}isGridInsertActive(){return this.enableGridInsert&&this._dataUnit.hasNewRecord()}getActionsList(){const t=[];if(this.enableGridInsert&&t.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert,(()=>{this._enableContinuousInsert=!this._enableContinuousInsert,this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert)}))),this.isGridInsertActive())return t;if(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions){const i=T(this._dataState,this.presentationMode);return t.concat(this.taskbarManager.getMoreOptions(i,this.configName,this._dataState,this.actionsList))}return t.concat(this.actionsList)}async openSearchPopover(){if(!this._popoverSearchEntity)return;const t=this._element.querySelector(`[data-taskbar-element="${y.ENTITY_SEARCH}"]`);await this._popoverSearchEntity.showUnder(t)}handleLoadedSearch(t){1===t.detail.length&&(this._dataUnit.selectFirst(),this.gridToForm(!0))}renderDynamicSearch(){var t;if(this.showEntitySearch)return s("snk-entity-search",{ref:t=>this._popoverSearchEntity=t,dataUnit:this._dataUnit,entityName:null===(t=this._snkDataUnit)||void 0===t?void 0:t.entityName,messagesBuilder:this.messagesBuilder,onLoaded:t=>this.handleLoadedSearch(t)})}handleFilterConfigUpdated(t){t.length&&(1!==t.length||"PERSONALIZED_FILTER_GROUP"!==t[0].id||(this._filterMode=t[0].groupedItems.length>0?"regular":"button"))}render(){if(null!=this._resourceID)return this._snkDataUnit.ignoreSaveMessage=this._currentViewMode===u.GRID&&!this.enableGridInsert,s(e,null,s("header",{class:{"snk-crud--hidden":!this._headerVisible,"snk-crud__header":!0}},s("div",{class:"snk-crud__header-top"},s("snk-taskbar",{"data-element-id":"grid_top",key:"snkGridTopTaskbar",configName:this.configName,dataUnit:this._dataUnit,messagesBuilder:this.messagesBuilder,buttons:this._taskbarProcessor.buttons,disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,resourceID:this._resourceID,primaryButton:"INSERT",overflowStrategy:"hiddenItems",alignRigth:!0,actionsList:this.getActionsList(),customActionsList:this.buildTaskbarCustomActionsList(),sizeButtons:"medium"})),s("snk-filter-bar",{ref:t=>this._snkFilterBar=t,title:this.filterBarTitle,dataUnit:this._dataUnit,"data-element-id":"gridFilter",class:"snk-grid__filter-bar ez-align--top",configName:this.configName,messagesBuilder:this.messagesBuilder,resourceID:this._resourceID,onConfigUpdated:t=>this.handleFilterConfigUpdated(t.detail),disablePersonalizedFilter:this.disablePersonalizedFilter,filterBarLegacyConfigName:this.filterBarLegacyConfigName,autoLoad:this.autoLoad,enableLockManagerLoadingComp:this.enableLockManagerLoadingComp,mode:this._filterMode,hideFilterButton:!0,sizeChips:"default"})),s("ez-view-stack",{ref:t=>this._viewStack=t,"data-element-id":"crud"},s("stack-item",{class:"snk-crud__grid-stack-item"},s("snk-grid",{ref:t=>this._snkGrid=t,class:"ez-flex ez-flex--column ez-size-height--full ez-size-width--full",filterBarTitle:this.filterBarTitle,"data-element-id":"crud_grid",configName:this.configName,onGridDoubleClick:()=>this.gridToForm(!0),taskbarManager:this.taskbarManager,onActionClick:t=>this.executeAction(t.detail),messagesBuilder:this.messagesBuilder,actionsList:this.actionsList,statusResolver:this.statusResolver,multipleSelection:this.multipleSelection,presentationMode:this.presentationMode,recordsValidator:this.recordsValidator,selectionToastConfig:this.selectionToastConfig,useEnterLikeTab:this.useEnterLikeTab,canEdit:this._canEdit,resourceID:this._resourceID,disablePersonalizedFilter:this.disablePersonalizedFilter,gridLegacyConfigName:this.gridLegacyConfigName,filterBarLegacyConfigName:this.filterBarLegacyConfigName,autoLoad:this.autoLoad,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert,enableLockManagerTaskbarClick:this.enableLockManagerTaskbarClick,enableLockManagerLoadingComp:this.enableLockManagerLoadingComp,strategyExporter:this.strategyExporter,multipleEditionEnabled:this.multipleEditionEnabled,paginationCounterMode:this.paginationCounterMode,hideHeader:!0,hideGridTaskbar:!0},s("slot",{name:"GRID_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"GRID_HEADER_CUSTOM_ELEMENTS"}),s("slot",{name:"SnkGridHeader"}),s("slot",{name:"SnkGridFooter"}),s("slot",{name:"SnkGridTaskBar"}))),s("stack-item",null,s("snk-guides-viewer",{ref:t=>this._guidesViewer=t,customGuidesConfig:this.customGuidesConfig,entityPath:this._snkDataUnit.entityName,messagesBuilder:this.messagesBuilder,onExit:()=>this.setViewMode(u.GRID),dataState:this._dataState,dataUnit:this._dataUnit,actionsList:this.actionsList,taskbarManager:this.taskbarManager,configName:this.configName,onActionClick:t=>this.executeAction(t.detail),presentationMode:this.presentationMode,"data-element-id":"crud_form",canEdit:this._canEdit,recordsValidator:this.recordsValidator,resourceID:this._resourceID,detailTaskbarCustomContainerId:this.customContainerId,formLegacyConfigName:this.formLegacyConfigName,enableGridInsert:this.enableGridInsert,getCustomTitle:this.setCustomFormTitle,ignoreReadOnlyFormFields:this.ignoreReadOnlyFormFields,onFormConfigVisibilityChanged:t=>this._headerVisible=!t.detail},s("slot",{name:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"}),this.renderCustomGuideSlots(),s("slot",{name:"SnkFormTaskBar"})))),s("snk-attach",{ref:t=>this._snkAttach=t,registerKey:this.attachmentRegisterKey,messagesBuilder:this.messagesBuilder,entityName:this._snkDataUnit.entityName}),s("snk-configurator",{ref:t=>this._snkConfigurator=t,entityName:this._snkDataUnit.entityName,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:t=>this.setViewMode(t.detail),onOpenConfig:t=>this.openConfig(t.detail),showActionButtons:this.showActionButtons,onSave:t=>this.handleConfiguratorEvent(t,"SAVE"),onCancel:t=>this.handleConfiguratorEvent(t,"CANCEL"),resourceID:this._resourceID,customContainerId:this.customContainerId,layoutFormConfig:this.layoutFormConfig}),this.renderDynamicSearch(),s("div",{id:`${this.customContainerId}`},s("slot",{name:"SnkConfigContainerSlot"}),s("slot",{name:"DETAIL_GRID_HEADER_CUSTOM_ELEMENTS"}),s("slot",{name:"DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"})))}get _element(){return n(this)}static get watchers(){return{_currentViewMode:["currentViewModeWatcher"]}}};E.style=".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%;overflow-y:auto;scrollbar-gutter:stable both-edges}snk-grid.sc-snk-crud{--snk-grid-padding:0 var(--space--6, 6px) var(--space--6, 6px) var(--space--6, 6px)}stack-item.sc-snk-crud.sc-snk-crud{display:grid;min-height:100%}.snk-crud__header.sc-snk-crud{margin-bottom:var(--space--10, 10px)}.snk-crud__grid-stack-item.sc-snk-crud{display:flex;flex-direction:column;height:100%;width:100%;padding:0 var(--space--2, 2px)}.snk-crud__header-top.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:var(--space--8, 8px);padding-top:var(--space--12, 12px)}.snk-crud__header-bottom.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:0 var(--space--8, 8px) 0 var(--space--6, 6px)}.snk-crud__header-bottom.sc-snk-crud>snk-taskbar.sc-snk-crud{padding-bottom:var(--space--8, 8px);margin-left:var(--space--12, 12px)}.snk-crud--hidden.sc-snk-crud{display:none !important}ez-record-navigation.sc-snk-crud,ez-grid-pagination.sc-snk-crud{margin-bottom:var(--space--8, 8px)}";export{E as snk_crud}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ApplicationContext as n}from"@sankhyalabs/core";async function e(n){const e=await fetch(n);return await e.blob()}function r(n,e){return n?`${n}_${e}`:e}async function t(e,t,o,a){const i=r(t,o),s=function(e){let r=function(e,r="mge"){let t=`/${r}/sessionUpload.${r}?sessionkey=${e}`;return async function(e){var r;const t=n.getContextValue("__SNK__APPLICATION__");if(!t)return!1;const o=await(null===(r=t.getResourceID)||void 0===r?void 0:r.call(t))||"";return"mge"===e&&o.startsWith("br.com.sankhya.menu.adicional")}(r)&&/[ !@#$%^&*()+\-=\[\]{};':"\\|,.<>\/?]/.test(e)&&(t+=`&encodedKey=${btoa(encodeURI(e))}`),t}(e);return r+="&fitem=S&salvar=S&useCache=N",r}(i);return new Promise(((n,r)=>{const t=new FormData;t.append("arquivo",e);const o=new XMLHttpRequest;o.addEventListener("load",(()=>{o.status>=200&&o.status<300?n(`/mge/UPLOADING_${i}.dbimage`):r(new Error(`Upload failed: ${o.statusText}`))})),o.addEventListener("error",(()=>{r(new Error("Upload error"))})),a&&o.upload.addEventListener("progress",a),o.open("POST",s),o.send(t)}))}function o(n){if(!n)return;const e={},r=n.metadata.fields,t=n.getSelectedRecord();return r.forEach((n=>{n.properties.isPrimaryKey&&t&&(e[n.name]=t[n.name])})),e}async function a(n,e,r){const
|
|
1
|
+
import{ApplicationContext as n}from"@sankhyalabs/core";async function e(n){const e=await fetch(n);return await e.blob()}function r(n,e){return n?`${n}_${e}`:e}async function t(e,t,o,a){const i=r(t,o),s=function(e){let r=function(e,r="mge"){let t=`/${r}/sessionUpload.${r}?sessionkey=${e}`;return async function(e){var r;const t=n.getContextValue("__SNK__APPLICATION__");if(!t)return!1;const o=await(null===(r=t.getResourceID)||void 0===r?void 0:r.call(t))||"";return"mge"===e&&o.startsWith("br.com.sankhya.menu.adicional")}(r)&&/[ !@#$%^&*()+\-=\[\]{};':"\\|,.<>\/?]/.test(e)&&(t+=`&encodedKey=${btoa(encodeURI(e))}`),t}(e);return r+="&fitem=S&salvar=S&useCache=N",r}(i);return new Promise(((n,r)=>{const t=new FormData;t.append("arquivo",e);const o=new XMLHttpRequest;o.addEventListener("load",(()=>{o.status>=200&&o.status<300?n(`/mge/UPLOADING_${i}.dbimage`):r(new Error(`Upload failed: ${o.statusText}`))})),o.addEventListener("error",(()=>{r(new Error("Upload error"))})),a&&o.upload.addEventListener("progress",a),o.open("POST",s),o.send(t)}))}function o(n){if(!n)return;const e={},r=n.metadata.fields,t=n.getSelectedRecord();return r.forEach((n=>{n.properties.isPrimaryKey&&t&&(e[n.name]=t[n.name])})),e}async function a(n,e,r,t){const o=function(n,e,r){if(!n)return;let t=`${window.location.origin}/mge/${e}@${r}`;for(const e in n)t+=`@${e}=${n[e]}`;return t+=".dbimage",t}(n,r,e);if(o)try{const n=await fetch(o,{signal:t});if(n.ok){const e=await n.blob();return await async function(n){return new Promise(((e,r)=>{const t=new FileReader;t.onloadend=()=>{e(t.result)},t.onerror=r,t.readAsDataURL(n)}))}(e)}}catch(n){if(null==t?void 0:t.aborted)return;console.error("Error downloading image:",n)}}export{r as a,e as b,a as d,o as g,t as s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,e as i,h as s,f as e}from"./p-2c9d0870.js";import{Action as o,UserInterface as r,ApplicationContext as n,ElementIDUtils as a}from"@sankhyalabs/core";import{DataBinder as h}from"@sankhyalabs/ezui/dist/collection/utils/form";import{focusOnFieldSerch as l,SEARCH_FIELD_FULL_WIDTH as d,FormLayout as m}from"@sankhyalabs/ezui/dist/collection/utils";import{g as c}from"./p-
|
|
1
|
+
import{r as t,e as i,h as s,f as e}from"./p-2c9d0870.js";import{Action as o,UserInterface as r,ApplicationContext as n,ElementIDUtils as a}from"@sankhyalabs/core";import{DataBinder as h}from"@sankhyalabs/ezui/dist/collection/utils/form";import{focusOnFieldSerch as l,SEARCH_FIELD_FULL_WIDTH as d,FormLayout as m}from"@sankhyalabs/ezui/dist/collection/utils";import{g as c}from"./p-af673291.js";const f=class{constructor(e){t(this,e),this.snkContentCardChanged=i(this,"snkContentCardChanged",7),this.snkRequestClearFieldToFocus=i(this,"snkRequestClearFieldToFocus",7),this.formItemsReady=i(this,"formItemsReady",7),this._customEditors=new Map,this._fieldProps=new Map,this.dataUnitObserver=async t=>{if(t.type===o.RECORDS_COPIED){const i=this.buildSourceRecordPK(t);this.getImageField().forEach((async t=>{this.dataUnit.setFieldValue(t.name,JSON.stringify(i))}))}},this.customUiBuilders=new Map([[r.IMAGE,t=>{var{name:i}=t,e=function(t,i){var s={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(s[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(e=Object.getOwnPropertySymbols(t);o<e.length;o++)i.indexOf(e[o])<0&&Object.prototype.propertyIsEnumerable.call(t,e[o])&&(s[e[o]]=t[e[o]])}return s}(t,["name"]);return s("snk-image-input",Object.assign({dataUnit:this.dataUnit,maxSize:1/0,fieldName:i,entityName:this.entityPath},e))}]]),this._singleColumn=!1,this._currentFormLayout=void 0,this.levelPath=void 0,this.fieldSearch=void 0,this.label=void 0,this.name=void 0,this.fields=void 0,this.formMetadata=void 0,this.dataUnit=void 0,this.contracted=void 0,this.fixed=!1,this.summaryFields=void 0,this.canExpand=!0,this.canFix=!0,this.recordsValidator=void 0,this.fieldToFocus=void 0,this.customEditors=void 0,this.fieldsProps=void 0,this.entityPath=void 0}async showUp(){this._formView&&this._formView.showUp()}async addCustomEditor(t,i,s){if(this._formView)return void this._formView.addCustomEditor(t,i,s);const e=new Map(this._customEditors);e.set(t,{customEditor:i,detailContext:s}),this._customEditors=e}async setFieldProp(t,i,s){const e=this._fieldProps.get(t)||[];this._fieldProps.set(t,[...e,{propName:i,value:s}])}async showSearchField(){if(!this._headerContainer||!this._ezPopoverFieldColumn)return;const t=this._headerContainer.getBoundingClientRect();await l(this.fieldSearch),this._ezPopoverFieldColumn.showUnder(this._headerContainer,{horizontalGap:t.width-d,verticalGap:-1*t.height})}observePropsCustomEditor(t){for(const i in t)this.addCustomEditor(i,t[i])}async observeFieldsProps(t){for(const i in t){const s=t[i],e=Object.keys(s);for(const t of e)await this.setFieldProp(i,t,s[t])}}async observeDataUnit(t,i){t!==i&&t&&t.subscribe(this.dataUnitObserver)}changeFix(){this.fixed=!this.fixed,this.emitEvent("fixed")}changeContracted(){this.contracted=!this.contracted,this.emitEvent("presentation")}emitEvent(t){this.snkContentCardChanged.emit({formName:this.name,cardConfig:{fixed:this.fixed,presentation:this.contracted?"CONTRACTED":"EXPANDED"},propertyChanged:t})}getCardSummary(){const t={};return this.getSummaryFields().forEach((({field:i,label:s})=>{var e;const o=this.dataUnit.getFormattedValue(i);""!==o&&(null==s&&(s=null===(e=this.dataUnit.getField(i))||void 0===e?void 0:e.label),t[s]=o)})),t}getSummaryFields(){return null==this.summaryFields?this.fields.map((t=>{const i=this.dataUnit.getField(t.name);return{field:t.name,label:t.label||(null==i?void 0:i.label)}})):this.summaryFields}bindFields(t){null==this._dataBinder&&null!=this.dataUnit&&(this._dataBinder=new h(this.dataUnit)),this._dataBinder&&this._dataBinder.bind(t,this.dataUnit.dataUnitId,this.formMetadata,this.recordsValidator)}handleFormItemsReady(t){t.stopPropagation(),this.formItemsReady.emit(Object.assign(Object.assign({},t.detail),{formId:this.name}))}disconnectedCallback(){null!=this._dataBinder&&this._dataBinder.onDisconnectedCallback(),this.dataUnit&&this.dataUnit.unsubscribe(this.dataUnitObserver)}async componentWillLoad(){await this.initLayoutFormConfig()}componentDidLoad(){this.observePropsCustomEditor(this.customEditors),this.observeFieldsProps(this.fieldsProps)}async initLayoutFormConfig(){var t;this._application||(this._application=n.getContextValue("__SNK__APPLICATION__"));const i=await(null===(t=this._application)||void 0===t?void 0:t.getLayoutFormConfig());i&&(this.setSingleColumn(i),this.registerNotifyListeners(i))}setSingleColumn(t){this._singleColumn=(null==t?void 0:t.config)===m.CASCADE||(null==t?void 0:t.config)===m.CLASSIC_CASCADE,this._currentFormLayout=null==t?void 0:t.config}registerNotifyListeners(t){t&&t.onConfigChange((t=>{this._singleColumn=t===m.CASCADE||t===m.CLASSIC_CASCADE,this._currentFormLayout=t}))}componentDidRender(){this.setCustomEditors(),this.setFieldProps(),null!=this.fieldToFocus&&this.fields.some((t=>t.name===this.fieldToFocus))&&requestAnimationFrame((()=>{this._dataBinder.setFocus(this.fieldToFocus),this.snkRequestClearFieldToFocus.emit()}))}setCustomEditors(){if(this._formView)for(const[t,i]of this._customEditors)this._formView.addCustomEditor(t,i.customEditor,i.detailContext),this._customEditors.delete(t)}setFieldProps(){if(this._formView)for(const[t,i]of this._fieldProps)i.forEach((i=>{this._formView.setFieldProp(t,i.propName,i.value),this._fieldProps.delete(t)}))}buildSourceRecordPK(t){var i,s;const e=(null===(i=t.payload)||void 0===i?void 0:i[0])||{},o=JSON.parse(atob(e.__record__source__id__||""));delete o.__DATA_UNIT_NAME__;const r=Object.keys(c(this.dataUnit)),n={};for(const t of r)n[t]=null===(s=o[t])||void 0===s?void 0:s.value;return n}getImageField(){return this.dataUnit.metadata.fields.filter((t=>t.userInterface===r.IMAGE))}render(){return s(e,{class:"ez-box__container"},s("div",{class:"summary-header ez-flex ez-size-width--full",ref:t=>this._headerContainer=t},s("div",{class:"ez-flex ez-text ez-title--primary ez-text--bold ez-flex--justify-start ez-flex--align-items-center ez-col--sd-9"},this.levelPath?s("span",{class:"level-path"},this.levelPath+" /"):void 0,this.label),s("div",{class:"ez-flex ez-flex--justify-end ez-col--sd-3"},this.canFix&&s("ez-button",{class:"ez-padding-left--medium",mode:"icon",size:"small",iconName:this.fixed?"un-pin":"push-pin","data-element-id":a.getInternalIDInfo("toggleFixed_ezFormCard"),onClick:()=>this.changeFix(),title:this.fixed?"Desafixar":"Fixar"}),this.canExpand&&s("ez-button",{class:"ez-padding-left--medium",mode:"icon",size:"small",iconName:this.contracted?"chevron-down":"chevron-up","data-element-id":a.getInternalIDInfo("toggleExpand_ezFormCard"),onClick:()=>this.changeContracted(),title:this.contracted?"Expandir":"Resumir"}))),s("slot",null),this.contracted?s("snk-form-summary",{summary:this.getCardSummary()}):s("ez-form-view",{ref:t=>this._formView=t,fields:this.fields,onEzContentReady:t=>this.bindFields(t.detail),onFormItemsReady:t=>this.handleFormItemsReady(t),singleColumn:this._singleColumn,customUiBuilders:this.customUiBuilders,formLayout:this._currentFormLayout}),this.fieldSearch&&s("ez-popover",{ref:t=>this._ezPopoverFieldColumn=t,overlayType:"none"},this.fieldSearch))}static get watchers(){return{customEditors:["observePropsCustomEditor"],fieldsProps:["observeFieldsProps"],dataUnit:["observeDataUnit"]}}};f.style=".sc-snk-form-view-h{display:flex;width:100%;--ez-form-card-summary-field-content-weight:700}.level-path.sc-snk-form-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.summary-wrapper.sc-snk-form-view{display:flex;overflow:hidden}.summary-header.sc-snk-form-view{border-bottom:1px solid var(--color--strokes);margin-bottom:var(--space--medium);padding-bottom:var(--space--medium)}.summary-container.sc-snk-form-view{display:flex;flex-direction:column}.summary-container.sc-snk-form-view{padding-right:calc(var(--space--extra-large) / 1.5)}.summary-field.sc-snk-form-view{min-width:30px;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.summary-field__title.sc-snk-form-view{color:var(--text--primary, #626e82);font-size:var(--title--small);white-space:nowrap;font-weight:var(--text-weight--medium)}.summary-field__content.sc-snk-form-view{color:var(--title--primary, #2b3a54);font-size:var(--text--large);font-weight:var(--ez-form-card-summary-field-content-weight)}";export{f as snk_form_view}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,e as t,h as s,f as a}from"./p-2c9d0870.js";import{Action as h,ApplicationContext as e}from"@sankhyalabs/core";import{S as n}from"./p-554c0e54.js";import{b as o,s as r,a as d,g as l,d as c}from"./p-af673291.js";const m=class{constructor(s){i(this,s),this.imageError=t(this,"imageError",7),this.dataUnitObserver=async i=>{var t;if([h.NEXT_SELECTED,h.PREVIOUS_SELECTED].includes(i.type))return void await this.loadImage();const s=(null===(t=i.payload)||void 0===t?void 0:t.selection)||[];i.type===h.SELECTION_CHANGED&&s.length>0?await this.loadImage():i.type!==h.RECORDS_ADDED?i.type!==h.EDITION_CANCELED||await this.loadImage():await this.clearImage()},this.dataUnit=void 0,this.fieldName=void 0,this.entityName=void 0,this.enabled=!0,this.acceptType=void 0,this.maxSize=void 0,this.label=void 0,this.imageValue=void 0,this.loading=!0}async reloadImage(i){await this.loadImage(i)}getMessage(i,t){return this.messagesBuilder||(this.messagesBuilder=new n),this.messagesBuilder.getMessage(i,t)}async clearImage(){var i;null===(i=this._loadAbortController)||void 0===i||i.abort(),this.imageValue=void 0}async handleImageChange(i){const t=i.detail;if(!t)return await this.clearImage(),void await this.updatedataUnitField(!0);const s=await o(t);if(this.maxSize&&s.size>1024*this.maxSize){const i=this.getMessage("snkImageInput.errorImageSize")+this.maxSize+"(KB)";return this.imageError.emit(i),void(this.application&&await this.application.error(this.getMessage("snkImageInput.errorTitle"),i))}this.imageValue=t,await r(s,this.entityName,this.fieldName),await this.updatedataUnitField()}async updatedataUnitField(i=!1){this.dataUnit&&this.dataUnit.getSelectedRecord()&&(i?await this.dataUnit.setFieldValue(this.fieldName,"deletado"):await this.dataUnit.setFieldValue(this.fieldName,`$file.session.key{${d(this.entityName,this.fieldName)}}`))}async handleImageError(i){this.imageError.emit(i.detail),this.application&&await this.application.error(this.getMessage("snkImageInput.errorTitle"),i.detail)}getPksFromDataUnit(){if(!this.dataUnit)return;const i=this.dataUnit.getSelectedRecord();if(!i)return;const t=i[this.fieldName];if(t)try{return JSON.parse(t)}catch(i){return void console.error("Error parsing PK from data unit field:",i)}}async loadImage(i){var t,s;null===(t=this._loadAbortController)||void 0===t||t.abort();const a=new AbortController;if(this._loadAbortController=a,this.loading=!0,this.dataUnit&&this.entityName){i=null!==(s=null!=i?i:this.getPksFromDataUnit())&&void 0!==s?s:l(this.dataUnit);const t=await c(i,this.fieldName,this.entityName,a.signal);if(a.signal.aborted)return;this.imageValue=t}this.loading=!1}async componentWillLoad(){this.application=e.getContextValue("__SNK__APPLICATION__"),this.messagesBuilder||(this.messagesBuilder=new n),this.dataUnit&&this.dataUnit.subscribe(this.dataUnitObserver)}disconnectedCallback(){this.dataUnit&&this.dataUnit.unsubscribe(this.dataUnitObserver)}async componentDidLoad(){await this.loadImage()}render(){return s(a,null,s("ez-image-input",{enabled:this.enabled,label:this.label,name:this.fieldName,value:this.imageValue,maxFileSize:this.maxSize?1024*this.maxSize:void 0,accept:this.acceptType||"image/png,image/jpeg,image/gif",onEzChange:i=>this.handleImageChange(i),onEzError:i=>this.handleImageError(i),loading:this.loading}))}};m.style=":host{display:block}";export{m as snk_image_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,B as a,c as i,a as t,w as o,d as n,N as r,H as l,b as d}from"./p-2c9d0870.js";export{s as setNonce}from"./p-2c9d0870.js";const c=e=>{const a=e.cloneNode;e.cloneNode=function(e){if("TEMPLATE"===this.nodeName)return a.call(this,e);const i=a.call(this,!1),t=this.childNodes;if(e)for(let e=0;e<t.length;e++)2!==t[e].nodeType&&i.appendChild(t[e].cloneNode(!0));return i}};(()=>{a.isDev&&!a.isTesting&&i("Running in development mode."),a.cssVarShim&&(t.i=o.__cssshim),a.cloneNodeFix&&c(l.prototype),a.profile&&!performance.mark&&(performance.mark=performance.measure=()=>{},performance.getEntriesByName=()=>[]);const s=a.scriptDataOpts||a.safari10||a.dynamicImportShim?Array.from(n.querySelectorAll("script")).find((e=>new RegExp(`/${r}(\\.esm)?\\.js($|\\?|#)`).test(e.src)||e.getAttribute("data-stencil-namespace")===r)):null,d=import.meta.url,g=a.scriptDataOpts&&s["data-opts"]||{};if(a.safari10&&"onbeforeload"in s&&!history.scrollRestoration)return{then(){}};if(a.safari10||""===d){if((a.dynamicImportShim||a.safari10)&&(g.resourcesUrl=new URL(".",new URL(s.getAttribute("data-resources-url")||s.src,o.location.href)).href,a.dynamicImportShim&&((e,a)=>{const i=`__sc_import_${r.replace(/\s|-/g,"_")}`;try{o[i]=new Function("w",`return import(w);//${Math.random()}`)}catch(s){const r=new Map;o[i]=s=>{var l;const d=new URL(s,e).href;let c=r.get(d);if(!c){const e=n.createElement("script");e.type="module",e.crossOrigin=a.crossOrigin,e.src=URL.createObjectURL(new Blob([`import * as m from '${d}'; window.${i}.m = m;`],{type:"application/javascript"}));const s=null!==(l=t.t)&&void 0!==l?l:function(e){var a,i,t;return null!==(t=null===(i=null===(a=e.head)||void 0===a?void 0:a.querySelector('meta[name="csp-nonce"]'))||void 0===i?void 0:i.getAttribute("content"))&&void 0!==t?t:void 0}(n);null!=s&&e.setAttribute("nonce",s),c=new Promise((a=>{e.onload=()=>{a(o[i].m),e.remove()}})),r.set(d,c),n.head.appendChild(e)}return c}}})(g.resourcesUrl,s),a.dynamicImportShim&&!o.customElements))return import("./p-c3ec6642.js").then((()=>g))}else g.resourcesUrl=new URL(".",d).href;return e(g)})().then((e=>d(JSON.parse('[["p-f921270b",[[2,"snk-actions-form",{"action":[16],"applyParameters":[16],"dataUnit":[32],"openPopup":[64]}]]],["p-ae326d06",[[2,"snk-client-confirm",{"titleMessage":[1,"title-message"],"message":[1],"accept":[16],"cancel":[16],"openPopup":[64]}]]],["p-f152ef98",[[6,"snk-custom-slot-elements",{"slotName":[1,"slot-name"]}]]],["p-3a35917e",[[6,"snk-custom-slot-guide",{"slotName":[1,"slot-name"]},[[8,"snkShowGuide","onGuideChange"],[8,"formConfigVisibilityChanged","onFormConfigVisibilityChange"]]]]],["p-752c57f4",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"value":[1040],"errorMessage":[1537,"error-message"],"_ezListSource":[32],"reloadList":[64]}]]],["p-90ae6c2e",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"],"errorMessage":[1537,"error-message"],"resetValues":[64],"clearValue":[64],"setFocus":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-0a160fb5",[[0,"snk-filter-checkbox-list",{"config":[1040],"errorMessage":[1537,"error-message"],"optionsList":[32],"setFocus":[64],"clearValue":[64]}]]],["p-76729994",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-a2a9f520",[[0,"snk-filter-number",{"config":[16],"getMessage":[16],"value":[1026],"presentationMode":[2,"presentation-mode"],"errorMessage":[1537,"error-message"],"show":[64],"setFocus":[64],"clearValue":[64]},[[0,"ezInput","ezInputListener"]]]]],["p-ee56dda6",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[1040],"presentationMode":[2,"presentation-mode"],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64],"show":[64]}]]],["p-2cc2526e",[[0,"snk-filter-search",{"config":[16],"value":[16],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-d657f71f",[[0,"snk-filter-text",{"config":[16],"value":[1],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-175c9576",[[2,"snk-personalized-filter-editor",{"messagesBuilder":[1040],"presentationMode":[2,"presentation-mode"],"config":[16],"value":[1040],"items":[32],"show":[64]}]]],["p-8d946600",[[2,"snk-print-selector",{"_printServerActive":[32],"_selectedPrinter":[32],"_remotePrintersDataSource":[32],"_localPrintersDataSource":[32],"_printJobData":[32],"openPrintSelector":[64]}]]],["p-20af4b6a",[[2,"pesquisa-grid",{"metadata":[16],"dataSource":[16],"pkField":[1,"pk-field"],"descriptionField":[1,"description-field"],"entityName":[1,"entity-name"],"shouldLoadConfig":[4,"should-load-config"],"_gridConfig":[32],"_inMemoryLoader":[32],"_dataunit":[32]}],[2,"pesquisa-tree",{"treeLoader":[16],"argument":[1025],"allowsNonAnalytic":[4,"allows-non-analytic"],"shouldLoadTree":[4,"should-load-tree"],"messagesBuilder":[1040],"items":[32],"applyFilter":[64]}]]],["p-35317d9a",[[2,"snk-pesquisa",{"searchLoader":[16],"treeLoader":[16],"selectItem":[16],"entityName":[1,"entity-name"],"argument":[1025],"isHierarchyEntity":[4,"is-hierarchy-entity"],"allowsNonAnalytic":[4,"allows-non-analytic"],"_itemList":[32],"_startLoading":[32],"_presentationMode":[32],"_currentView":[32],"_valideDataSource":[32],"executeSearch":[64]}]]],["p-251aee41",[[2,"snk-application",{"enableLockManagerLoadingApp":[4,"enable-lock-manager-loading-app"],"messagesBuilder":[1040],"configName":[1,"config-name"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"loadByPK":[16],"_applicationReady":[32],"_templateSkeleton":[32],"_activeScrimWindow":[32],"getKeyboardManager":[64],"getLayoutFormConfig":[64],"isUserSup":[64],"addPendingAction":[64],"callServiceBroker":[64],"initOnboarding":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"showAlerts":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"isFeatureActive":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadTotals":[64],"isLoadedByPk":[64],"preloadMangerRemoveRecord":[64],"executeSearch":[64],"executePreparedSearchPlus":[64],"executePreparedSearch":[64],"executePreparedSearchWithFullResponse":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64],"importScript":[64],"getApplicationPath":[64],"executeSelectDistinct":[64],"getDataFetcher":[64],"whenApplicationReady":[64],"setSearchFilterContext":[64],"clearPopUpTitle":[64],"setPopUpTitle":[64],"showScrimApp":[64],"markToReload":[64],"addLoadingLock":[64]}]]],["p-5aae5c74",[[1,"teste-pesquisa"]]],["p-ce8ccd72",[[0,"snk-entity-search",{"entityName":[1,"entity-name"],"dataUnit":[16],"messagesBuilder":[16],"_searchInputValue":[32],"_showMoreOnSearch":[32],"visibleOptions":[32],"value":[32],"showLoading":[32],"showUnder":[64]}]]],["p-aff2d081",[[2,"snk-personalized-filter",{"messagesBuilder":[1040],"entityUri":[1025,"entity-uri"],"filterId":[1025,"filter-id"],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"],"isDefaultFilter":[4,"is-default-filter"],"_filterAssistentMode":[32],"_filterAssistent":[32],"createPersonalizedFilter":[64]}]]],["p-ac384a1e",[[6,"snk-grid",{"columnFilterDataSource":[1040],"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"enableLockManagerTaskbarClick":[4,"enable-lock-manager-taskbar-click"],"configName":[1,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"resourceID":[1,"resource-i-d"],"selectionToastConfig":[16],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"gridHeaderCustomSlotId":[1,"grid-header-custom-slot-id"],"gridHeaderDynamicSearchSlotId":[1,"grid-header-dynamic-search-slot-id"],"topTaskbarCustomSlotId":[1,"top-taskbar-custom-slot-id"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"enableGridInsert":[4,"enable-grid-insert"],"outlineMode":[4,"outline-mode"],"suppressHorizontalScroll":[4,"suppress-horizontal-scroll"],"strategyExporter":[1025,"strategy-exporter"],"useSearchColumn":[4,"use-search-column"],"multipleEditionEnabled":[4,"multiple-edition-enabled"],"paginationCounterMode":[1,"pagination-counter-mode"],"suppressCheckboxColumn":[4,"suppress-checkbox-column"],"suppressFilterColumn":[1028,"suppress-filter-column"],"compact":[4],"filterCustomConfig":[16],"filterCustomConfigInterceptor":[16],"hidePagination":[516,"hide-pagination"],"hideHeader":[516,"hide-header"],"hideGridTaskbar":[516,"hide-grid-taskbar"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"_showSnkFilterBar":[32],"_enableContinuousInsert":[32],"_filterMode":[32],"refreshColumnFilterDataSource":[64],"reloadConfig":[64],"showConfig":[64],"hideConfig":[64],"setConfig":[64],"reloadFilterBar":[64],"getFilterBar":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFocus":[64],"handlePageChange":[64],"locateColumn":[64],"filterColumns":[64]},[[2,"click","handleClick"]]]]],["p-f7170e10",[[2,"configs-button",{"configOptions":[16],"selectedConfig":[16],"hasChanges":[4,"has-changes"],"messagesBuilder":[1040]}]]],["p-95af0bb1",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"formLegacyConfigName":[1,"form-legacy-config-name"],"resourceID":[1,"resource-i-d"],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64],"addCustomEditor":[64],"setFieldProp":[64],"validate":[64]}],[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"messagesBuilder":[1040],"customGuidesConfig":[16],"availableFields":[32],"guidesList":[32],"groupsList":[32],"selectedGuide":[32],"_formConfig":[32],"configOptions":[32],"originalConfigSelected":[32],"configSelected":[32],"hasChanges":[32],"optionConfigChanged":[32]},[[16,"fieldConfigChanged","handleFieldConfigChanged"],[16,"formConfigOptionSelected","handleFormConfigOptionSelected"],[16,"addFieldToGuide","handleAddFieldToGuide"],[16,"setFieldAsAvailable","handleSetFieldAsAvailable"],[16,"removeFieldFromAvailable","handleRemoveFieldFromAvailable"]]]]],["p-9e109f5e",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["p-8a8900a9",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"fieldSearch":[16],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"customEditors":[16],"fieldsProps":[16],"entityPath":[1,"entity-path"],"_singleColumn":[32],"_currentFormLayout":[32],"showUp":[64],"addCustomEditor":[64],"setFieldProp":[64],"showSearchField":[64]}]]],["p-9742ea0e",[[2,"fields-layout",{"selectedGuide":[16],"groupsList":[16],"guideNames":[16],"dataUnit":[16],"messagesBuilder":[1040],"isEditGuideNameActive":[32],"addFieldToLayout":[64]},[[16,"fieldConfigChanged","handleFieldConfigChanged"]]]]],["p-855ccf64",[[2,"fields-selector",{"availableFields":[16],"dataUnit":[16],"messagesBuilder":[1040],"filterTerm":[32]}]]],["p-2ebda226",[[2,"config-header",{"configOptions":[16],"selectedConfig":[16],"messagesBuilder":[1040],"hasChanges":[4,"has-changes"],"optionConfigChanged":[4,"option-config-changed"],"isEditingGuide":[32],"isEditingGroup":[32]},[[16,"isEditingGuideName","handleIsEditingGuideName"],[16,"isEditingGroupName","handleIsEditingGroupName"]]]]],["p-9e7dc97d",[[2,"guides-configurator",{"guidesList":[16],"selectedGuide":[16],"messagesBuilder":[1040],"mainGuide":[32],"filterTerm":[32],"visibleGuides":[32],"hiddenGuides":[32]}]]],["p-98241c21",[[1,"snk-image-input",{"dataUnit":[16],"fieldName":[1,"field-name"],"entityName":[1,"entity-name"],"enabled":[4],"acceptType":[1,"accept-type"],"maxSize":[2,"max-size"],"label":[1],"imageValue":[32],"loading":[32],"reloadImage":[64]}]]],["p-ab12f544",[[2,"snk-layout-form-config",{"messagesBuilder":[16],"layoutType":[32],"save":[64]}]]],["p-27e0cd68",[[2,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"viewMode":[2,"view-mode"],"customContainerId":[1,"custom-container-id"],"layoutFormConfig":[4,"layout-form-config"],"entityName":[1,"entity-name"],"disableNumberingConfig":[4,"disable-numbering-config"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["p-46f75667",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"ignoreSaveMessage":[4,"ignore-save-message"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"domainMessagesBuilder":[1,"domain-messages-builder"],"fieldsToLink":[32],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64],"getFieldsWithRmp":[64],"getFieldsWithRmPrecision":[64],"getRowMetadata":[64]},[[0,"snkMasterFormConfigChange","onMasterFormConfigChange"]]]]],["p-ef9343c3",[[2,"snk-default-filter",{"getMessage":[16],"hasDefaultFilter":[4,"has-default-filter"],"_opened":[32]}]]],["p-438a225f",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"showHardFixed":[4,"show-hard-fixed"],"removalBlocked":[4,"removal-blocked"],"setFocusField":[64],"clearValue":[64]}]]],["p-bab4cde4",[[0,"snk-filter-modal-item",{"filterItem":[1040],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-e737fd5a",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["p-7c8bf699",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"size":[1],"_items":[32],"_showDropdown":[32]}]]],["p-2b3c284c",[[0,"snk-simple-form-config",{"dataUnit":[16],"configName":[1,"config-name"],"messagesBuilder":[16],"avaliableFields":[32],"selectedFields":[32],"show":[64]}],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"columns":[1040],"originalColumns":[1040],"config":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"metadata":[16],"_collapsibleBoxListOrder":[32],"_collapsibleBoxListSelect":[32]}],[2,"snk-numbering-config",{"messagesBuilder":[16],"entityName":[1,"entity-name"],"resourceID":[1,"resource-i-d"],"autoNumbering":[32],"initialNumber":[32],"save":[64]}],[2,"snk-actions-button",{"size":[1],"_items":[32],"_showDropdown":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"],"preventAutoFocus":[4,"prevent-auto-focus"]}],[2,"snk-taskbar-skeleton"],[2,"snk-view-representation",{"mode":[8]}],[2,"taskbar-actions-button",{"title":[1],"enabled":[4],"actions":[16],"size":[1],"_showDropdown":[32],"_openToLeft":[32],"showActions":[64],"hideActions":[64],"isOpened":[64]},[[8,"keydown","handleKeyDown"],[8,"ezOpenModal","handleClose"]]],[2,"taskbar-split-button",{"iconName":[1,"icon-name"],"action":[16],"name":[1],"className":[1,"class-name"],"dataElementId":[1,"data-element-id"],"title":[1],"enabled":[4],"actions":[16],"size":[1],"_showDropdown":[32]}]]],["p-77f608bc",[[6,"snk-taskbar",{"alignRigth":[4,"align-rigth"],"customSlotId":[1,"custom-slot-id"],"additionalSlotId":[1,"additional-slot-id"],"customContainerId":[1,"custom-container-id"],"overflowStrategy":[1,"overflow-strategy"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"buttons":[1],"customButtons":[16],"actionsList":[16],"actionsSettingsList":[16],"customActionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"disableSkeleton":[4,"disable-skeleton"],"sizeButtons":[1,"size-buttons"],"_hiddenActionsList":[32],"_isWaitingForSave":[32],"_isLoading":[32]},[[8,"snkCustomSlotElementsLoaded","handleCustomSlotElementsLoaded"],[8,"taskbarSaveLocker","handleTaskbarSaveLocker"],[8,"taskbarSaveUnlocker","handleTaskbarSaveUnlocker"]]]]],["p-ce3b284c",[[6,"snk-simple-crud",{"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"enableLockManagerTaskbarClick":[4,"enable-lock-manager-taskbar-click"],"dataState":[1040],"dataUnit":[16],"entityName":[1,"entity-name"],"mode":[2],"gridConfig":[1040],"formConfig":[1040],"enableContinuousInsert":[1028,"enable-continuous-insert"],"multipleSelection":[4,"multiple-selection"],"useCancelConfirm":[4,"use-cancel-confirm"],"pageSize":[2,"page-size"],"resourceID":[1,"resource-i-d"],"enableGridInsert":[4,"enable-grid-insert"],"paginationCounterMode":[1,"pagination-counter-mode"],"taskbarManager":[16],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"actionsList":[16],"configName":[1025,"config-name"],"showConfiguratorButtons":[4,"show-configurator-buttons"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"autoFocus":[4,"auto-focus"],"domainMessagesBuilder":[1,"domain-messages-builder"],"multipleEditionEnabled":[4,"multiple-edition-enabled"],"layoutFormConfig":[4,"layout-form-config"],"disableGridEdition":[4,"disable-grid-edition"],"autoLoad":[4,"auto-load"],"outlineMode":[4,"outline-mode"],"_container":[32],"_showPopUpGridConfig":[32],"_currentViewMode":[32],"_config":[32],"_fieldToGetFocus":[32],"_customContainerId":[32],"_formFields":[32],"_fieldsProps":[32],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64],"openConfigurator":[64],"closeConfigurator":[64],"updateConfig":[64]},[[0,"actionClick","actionClickListener"]]]]],["p-b3b51693",[[2,"snk-attach",{"gridLegacyConfigName":[1,"grid-legacy-config-name"],"fetcherType":[1025,"fetcher-type"],"fetcher":[16],"dataUnit":[16],"dataUnitBuilder":[16],"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"_isOpen":[32],"_currentFetcher":[32],"_currentDataUnit":[32],"crudConfig":[32],"open":[64],"close":[64]}]]],["p-cd00a3d1",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"searchEmpty":[32],"groupEmpty":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["p-cc64239c",[[2,"snk-expression-group",{"parentTop":[1026,"parent-top"],"group":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityURI":[1025,"entity-u-r-i"],"isDefaultFilter":[4,"is-default-filter"],"_conditionOperator":[32],"_group":[32],"_selfTop":[32],"canAddExpression":[32],"_showDashes":[32],"getExpressionGroup":[64]},[[8,"ezExpressionLayoutChanged","todoCompletedHandler"]]],[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"isDefaultFilter":[4,"is-default-filter"],"entityURI":[1025,"entity-u-r-i"],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["p-6ae7543b",[[2,"snk-filter-assistent-mode",{"filterAssistent":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityUri":[1025,"entity-uri"],"application":[1040],"isDefaultFilter":[4,"is-default-filter"]}],[2,"snk-filter-advanced-mode",{"filterAssistent":[1040],"application":[1040]}],[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]],["p-10f27dc6",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]],[2,"snk-filter-bar",{"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"customFilterBarConfig":[16],"dataUnit":[1040],"title":[1],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"mode":[1],"filterConfig":[1040],"messagesBuilder":[1040],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"afterApplyConfig":[16],"filterCustomConfig":[16],"filterCustomConfigInterceptor":[16],"hideFilterButton":[4,"hide-filter-button"],"sizeChips":[1,"size-chips"],"allowDefault":[32],"scrollerLocked":[32],"showPersonalizedFilter":[32],"personalizedFilterId":[32],"isFilterModalOpen":[32],"reload":[64],"getFilterItem":[64],"updateFilterItem":[64],"addFilterItem":[64],"removeFilterItem":[64],"getFilters":[64],"showFilterModal":[64]},[[0,"filterChange","filterChangeListener"],[8,"ezEmptySearch","emptySearchListener"]]],[0,"snk-filter-modal",{"getMessage":[16],"configName":[1025,"config-name"],"filterConfig":[1040],"opened":[4],"applyFilters":[16],"closeModal":[16],"addPersonalizedFilter":[16],"editPersonalizedFilter":[16],"deletePersonalizedFilter":[16],"filtersToDelete":[1040],"filterDefaultToDelete":[1040],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"filterCustomConfigInterceptor":[16],"filtersWithError":[32]},[[0,"deleteFilter","deletePersonalizedFilterListener"]]],[2,"snk-filter-item",{"config":[1040],"getMessage":[16],"showChips":[4,"show-chips"],"sizeChips":[1,"size-chips"],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[0,"filterChange","filterChangeListener"]]]]],["p-efd18bc2",[[6,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"resourceID":[1,"resource-i-d"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[1040],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"customEditors":[16],"customRenders":[16],"presentationMode":[1,"presentation-mode"],"_disabledButtons":[32],"_currentView":[32],"attachmentRegisterKey":[32],"_fieldToGetFocus":[32],"_hasToCreateFieldSearch":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64],"addCustomEditor":[64],"addGridCustomRender":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-b555ce38",[[2,"field-item",{"fieldConfig":[8,"field-config"],"onLayoutConfig":[4,"on-layout-config"],"dataUnit":[16],"messagesBuilder":[1040],"fieldDescriptor":[32]}],[2,"field-config",{"dataUnit":[16],"fieldConfig":[1544,"field-config"],"fieldDescriptor":[16],"messagesBuilder":[1040],"fieldLabel":[32],"fieldLabelErrorMessage":[32],"fieldDefaultValue":[32],"fieldCleanOnCopy":[32],"fieldRequired":[32],"fieldReadOnly":[32],"_defaultType":[32],"show":[64]}]]],["p-33492640",[[6,"snk-guides-viewer",{"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[1040],"taskbarManager":[16],"messagesBuilder":[1040],"canEdit":[4,"can-edit"],"presentationMode":[1,"presentation-mode"],"resourceID":[1,"resource-i-d"],"detailTaskbarCustomContainerId":[1,"detail-taskbar-custom-container-id"],"formLegacyConfigName":[1,"form-legacy-config-name"],"enableGridInsert":[4,"enable-grid-insert"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"getCustomTitle":[16],"customGuidesConfig":[16],"_hasToCreateFieldSearch":[32],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"_fieldToGetFocus":[32],"_customEditors":[32],"_customRenders":[32],"_fieldsProps":[32],"_mainForm":[32],"showFormConfig":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"setFieldProp":[64],"setFocus":[64],"reloadGuides":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-2af815bb",[[6,"snk-crud",{"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"enableLockManagerTaskbarClick":[4,"enable-lock-manager-taskbar-click"],"configName":[1025,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"selectionToastConfig":[16],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"enableGridInsert":[4,"enable-grid-insert"],"domainMessagesBuilder":[1,"domain-messages-builder"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"setCustomFormTitle":[16],"strategyExporter":[1025,"strategy-exporter"],"layoutFormConfig":[4,"layout-form-config"],"multipleEditionEnabled":[4,"multiple-edition-enabled"],"paginationCounterMode":[1,"pagination-counter-mode"],"customGuidesConfig":[16],"showEntitySearch":[4,"show-entity-search"],"disableNumberingConfig":[4,"disable-numbering-config"],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"_canEdit":[32],"_resourceID":[32],"customContainerId":[32],"numberingConfig":[32],"_filterMode":[32],"_enableContinuousInsert":[32],"_headerVisible":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64],"reloadFilterBar":[64],"getFilterBar":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64],"getNumberingConfig":[64],"updateNumberingConfig":[64]},[[0,"actionClick","handleActionClick"]]]]]]'),e)));
|
|
1
|
+
import{p as e,B as a,c as i,a as t,w as o,d as n,N as r,H as l,b as d}from"./p-2c9d0870.js";export{s as setNonce}from"./p-2c9d0870.js";const c=e=>{const a=e.cloneNode;e.cloneNode=function(e){if("TEMPLATE"===this.nodeName)return a.call(this,e);const i=a.call(this,!1),t=this.childNodes;if(e)for(let e=0;e<t.length;e++)2!==t[e].nodeType&&i.appendChild(t[e].cloneNode(!0));return i}};(()=>{a.isDev&&!a.isTesting&&i("Running in development mode."),a.cssVarShim&&(t.i=o.__cssshim),a.cloneNodeFix&&c(l.prototype),a.profile&&!performance.mark&&(performance.mark=performance.measure=()=>{},performance.getEntriesByName=()=>[]);const s=a.scriptDataOpts||a.safari10||a.dynamicImportShim?Array.from(n.querySelectorAll("script")).find((e=>new RegExp(`/${r}(\\.esm)?\\.js($|\\?|#)`).test(e.src)||e.getAttribute("data-stencil-namespace")===r)):null,d=import.meta.url,g=a.scriptDataOpts&&s["data-opts"]||{};if(a.safari10&&"onbeforeload"in s&&!history.scrollRestoration)return{then(){}};if(a.safari10||""===d){if((a.dynamicImportShim||a.safari10)&&(g.resourcesUrl=new URL(".",new URL(s.getAttribute("data-resources-url")||s.src,o.location.href)).href,a.dynamicImportShim&&((e,a)=>{const i=`__sc_import_${r.replace(/\s|-/g,"_")}`;try{o[i]=new Function("w",`return import(w);//${Math.random()}`)}catch(s){const r=new Map;o[i]=s=>{var l;const d=new URL(s,e).href;let c=r.get(d);if(!c){const e=n.createElement("script");e.type="module",e.crossOrigin=a.crossOrigin,e.src=URL.createObjectURL(new Blob([`import * as m from '${d}'; window.${i}.m = m;`],{type:"application/javascript"}));const s=null!==(l=t.t)&&void 0!==l?l:function(e){var a,i,t;return null!==(t=null===(i=null===(a=e.head)||void 0===a?void 0:a.querySelector('meta[name="csp-nonce"]'))||void 0===i?void 0:i.getAttribute("content"))&&void 0!==t?t:void 0}(n);null!=s&&e.setAttribute("nonce",s),c=new Promise((a=>{e.onload=()=>{a(o[i].m),e.remove()}})),r.set(d,c),n.head.appendChild(e)}return c}}})(g.resourcesUrl,s),a.dynamicImportShim&&!o.customElements))return import("./p-c3ec6642.js").then((()=>g))}else g.resourcesUrl=new URL(".",d).href;return e(g)})().then((e=>d(JSON.parse('[["p-f921270b",[[2,"snk-actions-form",{"action":[16],"applyParameters":[16],"dataUnit":[32],"openPopup":[64]}]]],["p-ae326d06",[[2,"snk-client-confirm",{"titleMessage":[1,"title-message"],"message":[1],"accept":[16],"cancel":[16],"openPopup":[64]}]]],["p-f152ef98",[[6,"snk-custom-slot-elements",{"slotName":[1,"slot-name"]}]]],["p-3a35917e",[[6,"snk-custom-slot-guide",{"slotName":[1,"slot-name"]},[[8,"snkShowGuide","onGuideChange"],[8,"formConfigVisibilityChanged","onFormConfigVisibilityChange"]]]]],["p-752c57f4",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"value":[1040],"errorMessage":[1537,"error-message"],"_ezListSource":[32],"reloadList":[64]}]]],["p-90ae6c2e",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"],"errorMessage":[1537,"error-message"],"resetValues":[64],"clearValue":[64],"setFocus":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-0a160fb5",[[0,"snk-filter-checkbox-list",{"config":[1040],"errorMessage":[1537,"error-message"],"optionsList":[32],"setFocus":[64],"clearValue":[64]}]]],["p-76729994",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-a2a9f520",[[0,"snk-filter-number",{"config":[16],"getMessage":[16],"value":[1026],"presentationMode":[2,"presentation-mode"],"errorMessage":[1537,"error-message"],"show":[64],"setFocus":[64],"clearValue":[64]},[[0,"ezInput","ezInputListener"]]]]],["p-ee56dda6",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[1040],"presentationMode":[2,"presentation-mode"],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64],"show":[64]}]]],["p-2cc2526e",[[0,"snk-filter-search",{"config":[16],"value":[16],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-d657f71f",[[0,"snk-filter-text",{"config":[16],"value":[1],"errorMessage":[1537,"error-message"],"setFocus":[64],"clearValue":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-175c9576",[[2,"snk-personalized-filter-editor",{"messagesBuilder":[1040],"presentationMode":[2,"presentation-mode"],"config":[16],"value":[1040],"items":[32],"show":[64]}]]],["p-8d946600",[[2,"snk-print-selector",{"_printServerActive":[32],"_selectedPrinter":[32],"_remotePrintersDataSource":[32],"_localPrintersDataSource":[32],"_printJobData":[32],"openPrintSelector":[64]}]]],["p-20af4b6a",[[2,"pesquisa-grid",{"metadata":[16],"dataSource":[16],"pkField":[1,"pk-field"],"descriptionField":[1,"description-field"],"entityName":[1,"entity-name"],"shouldLoadConfig":[4,"should-load-config"],"_gridConfig":[32],"_inMemoryLoader":[32],"_dataunit":[32]}],[2,"pesquisa-tree",{"treeLoader":[16],"argument":[1025],"allowsNonAnalytic":[4,"allows-non-analytic"],"shouldLoadTree":[4,"should-load-tree"],"messagesBuilder":[1040],"items":[32],"applyFilter":[64]}]]],["p-35317d9a",[[2,"snk-pesquisa",{"searchLoader":[16],"treeLoader":[16],"selectItem":[16],"entityName":[1,"entity-name"],"argument":[1025],"isHierarchyEntity":[4,"is-hierarchy-entity"],"allowsNonAnalytic":[4,"allows-non-analytic"],"_itemList":[32],"_startLoading":[32],"_presentationMode":[32],"_currentView":[32],"_valideDataSource":[32],"executeSearch":[64]}]]],["p-251aee41",[[2,"snk-application",{"enableLockManagerLoadingApp":[4,"enable-lock-manager-loading-app"],"messagesBuilder":[1040],"configName":[1,"config-name"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"loadByPK":[16],"_applicationReady":[32],"_templateSkeleton":[32],"_activeScrimWindow":[32],"getKeyboardManager":[64],"getLayoutFormConfig":[64],"isUserSup":[64],"addPendingAction":[64],"callServiceBroker":[64],"initOnboarding":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"showAlerts":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"isFeatureActive":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadTotals":[64],"isLoadedByPk":[64],"preloadMangerRemoveRecord":[64],"executeSearch":[64],"executePreparedSearchPlus":[64],"executePreparedSearch":[64],"executePreparedSearchWithFullResponse":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64],"importScript":[64],"getApplicationPath":[64],"executeSelectDistinct":[64],"getDataFetcher":[64],"whenApplicationReady":[64],"setSearchFilterContext":[64],"clearPopUpTitle":[64],"setPopUpTitle":[64],"showScrimApp":[64],"markToReload":[64],"addLoadingLock":[64]}]]],["p-5aae5c74",[[1,"teste-pesquisa"]]],["p-ce8ccd72",[[0,"snk-entity-search",{"entityName":[1,"entity-name"],"dataUnit":[16],"messagesBuilder":[16],"_searchInputValue":[32],"_showMoreOnSearch":[32],"visibleOptions":[32],"value":[32],"showLoading":[32],"showUnder":[64]}]]],["p-aff2d081",[[2,"snk-personalized-filter",{"messagesBuilder":[1040],"entityUri":[1025,"entity-uri"],"filterId":[1025,"filter-id"],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"],"isDefaultFilter":[4,"is-default-filter"],"_filterAssistentMode":[32],"_filterAssistent":[32],"createPersonalizedFilter":[64]}]]],["p-ac384a1e",[[6,"snk-grid",{"columnFilterDataSource":[1040],"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"enableLockManagerTaskbarClick":[4,"enable-lock-manager-taskbar-click"],"configName":[1,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"resourceID":[1,"resource-i-d"],"selectionToastConfig":[16],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"gridHeaderCustomSlotId":[1,"grid-header-custom-slot-id"],"gridHeaderDynamicSearchSlotId":[1,"grid-header-dynamic-search-slot-id"],"topTaskbarCustomSlotId":[1,"top-taskbar-custom-slot-id"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"enableGridInsert":[4,"enable-grid-insert"],"outlineMode":[4,"outline-mode"],"suppressHorizontalScroll":[4,"suppress-horizontal-scroll"],"strategyExporter":[1025,"strategy-exporter"],"useSearchColumn":[4,"use-search-column"],"multipleEditionEnabled":[4,"multiple-edition-enabled"],"paginationCounterMode":[1,"pagination-counter-mode"],"suppressCheckboxColumn":[4,"suppress-checkbox-column"],"suppressFilterColumn":[1028,"suppress-filter-column"],"compact":[4],"filterCustomConfig":[16],"filterCustomConfigInterceptor":[16],"hidePagination":[516,"hide-pagination"],"hideHeader":[516,"hide-header"],"hideGridTaskbar":[516,"hide-grid-taskbar"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"_showSnkFilterBar":[32],"_enableContinuousInsert":[32],"_filterMode":[32],"refreshColumnFilterDataSource":[64],"reloadConfig":[64],"showConfig":[64],"hideConfig":[64],"setConfig":[64],"reloadFilterBar":[64],"getFilterBar":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFocus":[64],"handlePageChange":[64],"locateColumn":[64],"filterColumns":[64]},[[2,"click","handleClick"]]]]],["p-f7170e10",[[2,"configs-button",{"configOptions":[16],"selectedConfig":[16],"hasChanges":[4,"has-changes"],"messagesBuilder":[1040]}]]],["p-95af0bb1",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"formLegacyConfigName":[1,"form-legacy-config-name"],"resourceID":[1,"resource-i-d"],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64],"addCustomEditor":[64],"setFieldProp":[64],"validate":[64]}],[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"messagesBuilder":[1040],"customGuidesConfig":[16],"availableFields":[32],"guidesList":[32],"groupsList":[32],"selectedGuide":[32],"_formConfig":[32],"configOptions":[32],"originalConfigSelected":[32],"configSelected":[32],"hasChanges":[32],"optionConfigChanged":[32]},[[16,"fieldConfigChanged","handleFieldConfigChanged"],[16,"formConfigOptionSelected","handleFormConfigOptionSelected"],[16,"addFieldToGuide","handleAddFieldToGuide"],[16,"setFieldAsAvailable","handleSetFieldAsAvailable"],[16,"removeFieldFromAvailable","handleRemoveFieldFromAvailable"]]]]],["p-9e109f5e",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["p-ca3728c0",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"fieldSearch":[16],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"customEditors":[16],"fieldsProps":[16],"entityPath":[1,"entity-path"],"_singleColumn":[32],"_currentFormLayout":[32],"showUp":[64],"addCustomEditor":[64],"setFieldProp":[64],"showSearchField":[64]}]]],["p-9742ea0e",[[2,"fields-layout",{"selectedGuide":[16],"groupsList":[16],"guideNames":[16],"dataUnit":[16],"messagesBuilder":[1040],"isEditGuideNameActive":[32],"addFieldToLayout":[64]},[[16,"fieldConfigChanged","handleFieldConfigChanged"]]]]],["p-855ccf64",[[2,"fields-selector",{"availableFields":[16],"dataUnit":[16],"messagesBuilder":[1040],"filterTerm":[32]}]]],["p-2ebda226",[[2,"config-header",{"configOptions":[16],"selectedConfig":[16],"messagesBuilder":[1040],"hasChanges":[4,"has-changes"],"optionConfigChanged":[4,"option-config-changed"],"isEditingGuide":[32],"isEditingGroup":[32]},[[16,"isEditingGuideName","handleIsEditingGuideName"],[16,"isEditingGroupName","handleIsEditingGroupName"]]]]],["p-9e7dc97d",[[2,"guides-configurator",{"guidesList":[16],"selectedGuide":[16],"messagesBuilder":[1040],"mainGuide":[32],"filterTerm":[32],"visibleGuides":[32],"hiddenGuides":[32]}]]],["p-d9ec8c4b",[[1,"snk-image-input",{"dataUnit":[16],"fieldName":[1,"field-name"],"entityName":[1,"entity-name"],"enabled":[4],"acceptType":[1,"accept-type"],"maxSize":[2,"max-size"],"label":[1],"imageValue":[32],"loading":[32],"reloadImage":[64]}]]],["p-ab12f544",[[2,"snk-layout-form-config",{"messagesBuilder":[16],"layoutType":[32],"save":[64]}]]],["p-27e0cd68",[[2,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"viewMode":[2,"view-mode"],"customContainerId":[1,"custom-container-id"],"layoutFormConfig":[4,"layout-form-config"],"entityName":[1,"entity-name"],"disableNumberingConfig":[4,"disable-numbering-config"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["p-46f75667",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"ignoreSaveMessage":[4,"ignore-save-message"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"domainMessagesBuilder":[1,"domain-messages-builder"],"fieldsToLink":[32],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64],"getFieldsWithRmp":[64],"getFieldsWithRmPrecision":[64],"getRowMetadata":[64]},[[0,"snkMasterFormConfigChange","onMasterFormConfigChange"]]]]],["p-ef9343c3",[[2,"snk-default-filter",{"getMessage":[16],"hasDefaultFilter":[4,"has-default-filter"],"_opened":[32]}]]],["p-438a225f",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"showHardFixed":[4,"show-hard-fixed"],"removalBlocked":[4,"removal-blocked"],"setFocusField":[64],"clearValue":[64]}]]],["p-bab4cde4",[[0,"snk-filter-modal-item",{"filterItem":[1040],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-e737fd5a",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["p-7c8bf699",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"size":[1],"_items":[32],"_showDropdown":[32]}]]],["p-2b3c284c",[[0,"snk-simple-form-config",{"dataUnit":[16],"configName":[1,"config-name"],"messagesBuilder":[16],"avaliableFields":[32],"selectedFields":[32],"show":[64]}],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"columns":[1040],"originalColumns":[1040],"config":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"metadata":[16],"_collapsibleBoxListOrder":[32],"_collapsibleBoxListSelect":[32]}],[2,"snk-numbering-config",{"messagesBuilder":[16],"entityName":[1,"entity-name"],"resourceID":[1,"resource-i-d"],"autoNumbering":[32],"initialNumber":[32],"save":[64]}],[2,"snk-actions-button",{"size":[1],"_items":[32],"_showDropdown":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"],"preventAutoFocus":[4,"prevent-auto-focus"]}],[2,"snk-taskbar-skeleton"],[2,"snk-view-representation",{"mode":[8]}],[2,"taskbar-actions-button",{"title":[1],"enabled":[4],"actions":[16],"size":[1],"_showDropdown":[32],"_openToLeft":[32],"showActions":[64],"hideActions":[64],"isOpened":[64]},[[8,"keydown","handleKeyDown"],[8,"ezOpenModal","handleClose"]]],[2,"taskbar-split-button",{"iconName":[1,"icon-name"],"action":[16],"name":[1],"className":[1,"class-name"],"dataElementId":[1,"data-element-id"],"title":[1],"enabled":[4],"actions":[16],"size":[1],"_showDropdown":[32]}]]],["p-77f608bc",[[6,"snk-taskbar",{"alignRigth":[4,"align-rigth"],"customSlotId":[1,"custom-slot-id"],"additionalSlotId":[1,"additional-slot-id"],"customContainerId":[1,"custom-container-id"],"overflowStrategy":[1,"overflow-strategy"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"buttons":[1],"customButtons":[16],"actionsList":[16],"actionsSettingsList":[16],"customActionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"disableSkeleton":[4,"disable-skeleton"],"sizeButtons":[1,"size-buttons"],"_hiddenActionsList":[32],"_isWaitingForSave":[32],"_isLoading":[32]},[[8,"snkCustomSlotElementsLoaded","handleCustomSlotElementsLoaded"],[8,"taskbarSaveLocker","handleTaskbarSaveLocker"],[8,"taskbarSaveUnlocker","handleTaskbarSaveUnlocker"]]]]],["p-ce3b284c",[[6,"snk-simple-crud",{"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"enableLockManagerTaskbarClick":[4,"enable-lock-manager-taskbar-click"],"dataState":[1040],"dataUnit":[16],"entityName":[1,"entity-name"],"mode":[2],"gridConfig":[1040],"formConfig":[1040],"enableContinuousInsert":[1028,"enable-continuous-insert"],"multipleSelection":[4,"multiple-selection"],"useCancelConfirm":[4,"use-cancel-confirm"],"pageSize":[2,"page-size"],"resourceID":[1,"resource-i-d"],"enableGridInsert":[4,"enable-grid-insert"],"paginationCounterMode":[1,"pagination-counter-mode"],"taskbarManager":[16],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"actionsList":[16],"configName":[1025,"config-name"],"showConfiguratorButtons":[4,"show-configurator-buttons"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"autoFocus":[4,"auto-focus"],"domainMessagesBuilder":[1,"domain-messages-builder"],"multipleEditionEnabled":[4,"multiple-edition-enabled"],"layoutFormConfig":[4,"layout-form-config"],"disableGridEdition":[4,"disable-grid-edition"],"autoLoad":[4,"auto-load"],"outlineMode":[4,"outline-mode"],"_container":[32],"_showPopUpGridConfig":[32],"_currentViewMode":[32],"_config":[32],"_fieldToGetFocus":[32],"_customContainerId":[32],"_formFields":[32],"_fieldsProps":[32],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64],"openConfigurator":[64],"closeConfigurator":[64],"updateConfig":[64]},[[0,"actionClick","actionClickListener"]]]]],["p-b3b51693",[[2,"snk-attach",{"gridLegacyConfigName":[1,"grid-legacy-config-name"],"fetcherType":[1025,"fetcher-type"],"fetcher":[16],"dataUnit":[16],"dataUnitBuilder":[16],"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"_isOpen":[32],"_currentFetcher":[32],"_currentDataUnit":[32],"crudConfig":[32],"open":[64],"close":[64]}]]],["p-cd00a3d1",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"searchEmpty":[32],"groupEmpty":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["p-cc64239c",[[2,"snk-expression-group",{"parentTop":[1026,"parent-top"],"group":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityURI":[1025,"entity-u-r-i"],"isDefaultFilter":[4,"is-default-filter"],"_conditionOperator":[32],"_group":[32],"_selfTop":[32],"canAddExpression":[32],"_showDashes":[32],"getExpressionGroup":[64]},[[8,"ezExpressionLayoutChanged","todoCompletedHandler"]]],[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"isDefaultFilter":[4,"is-default-filter"],"entityURI":[1025,"entity-u-r-i"],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["p-6ae7543b",[[2,"snk-filter-assistent-mode",{"filterAssistent":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityUri":[1025,"entity-uri"],"application":[1040],"isDefaultFilter":[4,"is-default-filter"]}],[2,"snk-filter-advanced-mode",{"filterAssistent":[1040],"application":[1040]}],[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]],["p-10f27dc6",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]],[2,"snk-filter-bar",{"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"customFilterBarConfig":[16],"dataUnit":[1040],"title":[1],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"mode":[1],"filterConfig":[1040],"messagesBuilder":[1040],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"afterApplyConfig":[16],"filterCustomConfig":[16],"filterCustomConfigInterceptor":[16],"hideFilterButton":[4,"hide-filter-button"],"sizeChips":[1,"size-chips"],"allowDefault":[32],"scrollerLocked":[32],"showPersonalizedFilter":[32],"personalizedFilterId":[32],"isFilterModalOpen":[32],"reload":[64],"getFilterItem":[64],"updateFilterItem":[64],"addFilterItem":[64],"removeFilterItem":[64],"getFilters":[64],"showFilterModal":[64]},[[0,"filterChange","filterChangeListener"],[8,"ezEmptySearch","emptySearchListener"]]],[0,"snk-filter-modal",{"getMessage":[16],"configName":[1025,"config-name"],"filterConfig":[1040],"opened":[4],"applyFilters":[16],"closeModal":[16],"addPersonalizedFilter":[16],"editPersonalizedFilter":[16],"deletePersonalizedFilter":[16],"filtersToDelete":[1040],"filterDefaultToDelete":[1040],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"filterCustomConfigInterceptor":[16],"filtersWithError":[32]},[[0,"deleteFilter","deletePersonalizedFilterListener"]]],[2,"snk-filter-item",{"config":[1040],"getMessage":[16],"showChips":[4,"show-chips"],"sizeChips":[1,"size-chips"],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[0,"filterChange","filterChangeListener"]]]]],["p-efd18bc2",[[6,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"resourceID":[1,"resource-i-d"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[1040],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"customEditors":[16],"customRenders":[16],"presentationMode":[1,"presentation-mode"],"_disabledButtons":[32],"_currentView":[32],"attachmentRegisterKey":[32],"_fieldToGetFocus":[32],"_hasToCreateFieldSearch":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64],"addCustomEditor":[64],"addGridCustomRender":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-b555ce38",[[2,"field-item",{"fieldConfig":[8,"field-config"],"onLayoutConfig":[4,"on-layout-config"],"dataUnit":[16],"messagesBuilder":[1040],"fieldDescriptor":[32]}],[2,"field-config",{"dataUnit":[16],"fieldConfig":[1544,"field-config"],"fieldDescriptor":[16],"messagesBuilder":[1040],"fieldLabel":[32],"fieldLabelErrorMessage":[32],"fieldDefaultValue":[32],"fieldCleanOnCopy":[32],"fieldRequired":[32],"fieldReadOnly":[32],"_defaultType":[32],"show":[64]}]]],["p-33492640",[[6,"snk-guides-viewer",{"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[1040],"taskbarManager":[16],"messagesBuilder":[1040],"canEdit":[4,"can-edit"],"presentationMode":[1,"presentation-mode"],"resourceID":[1,"resource-i-d"],"detailTaskbarCustomContainerId":[1,"detail-taskbar-custom-container-id"],"formLegacyConfigName":[1,"form-legacy-config-name"],"enableGridInsert":[4,"enable-grid-insert"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"getCustomTitle":[16],"customGuidesConfig":[16],"_hasToCreateFieldSearch":[32],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"_fieldToGetFocus":[32],"_customEditors":[32],"_customRenders":[32],"_fieldsProps":[32],"_mainForm":[32],"showFormConfig":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"setFieldProp":[64],"setFocus":[64],"reloadGuides":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-1086fb0c",[[6,"snk-crud",{"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"enableLockManagerTaskbarClick":[4,"enable-lock-manager-taskbar-click"],"configName":[1025,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"selectionToastConfig":[16],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"enableGridInsert":[4,"enable-grid-insert"],"domainMessagesBuilder":[1,"domain-messages-builder"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"setCustomFormTitle":[16],"strategyExporter":[1025,"strategy-exporter"],"layoutFormConfig":[4,"layout-form-config"],"multipleEditionEnabled":[4,"multiple-edition-enabled"],"paginationCounterMode":[1,"pagination-counter-mode"],"customGuidesConfig":[16],"showEntitySearch":[4,"show-entity-search"],"disableNumberingConfig":[4,"disable-numbering-config"],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"_canEdit":[32],"_resourceID":[32],"customContainerId":[32],"numberingConfig":[32],"_filterMode":[32],"_enableContinuousInsert":[32],"_headerVisible":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64],"reloadFilterBar":[64],"getFilterBar":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64],"getNumberingConfig":[64],"updateNumberingConfig":[64]},[[0,"actionClick","handleActionClick"]]]]]]'),e)));
|
|
@@ -12,4 +12,4 @@ export declare function getBaseUrl(pk: {
|
|
|
12
12
|
}, entityName: string, fieldName: string): string | undefined;
|
|
13
13
|
export declare function getPKs(dataUnit: DataUnit): Record<string, any> | undefined;
|
|
14
14
|
export declare function imageBlobToBase64(blob: Blob): Promise<string>;
|
|
15
|
-
export declare function downloadImage(pks: Record<string, any>, fieldName: string, entityName: string): Promise<string>;
|
|
15
|
+
export declare function downloadImage(pks: Record<string, any>, fieldName: string, entityName: string, signal?: AbortSignal): Promise<string>;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,e as t,h as s,f as a}from"./p-2c9d0870.js";import{Action as h,ApplicationContext as e}from"@sankhyalabs/core";import{S as n}from"./p-554c0e54.js";import{b as o,s as r,a as d,g as c,d as l}from"./p-420b39b5.js";const m=class{constructor(s){i(this,s),this.imageError=t(this,"imageError",7),this.dataUnitObserver=async i=>{var t;if([h.NEXT_SELECTED,h.PREVIOUS_SELECTED].includes(i.type))return void await this.loadImage();const s=(null===(t=i.payload)||void 0===t?void 0:t.selection)||[];i.type===h.SELECTION_CHANGED&&s.length>0?await this.loadImage():i.type!==h.RECORDS_ADDED||await this.clearImage()},this.dataUnit=void 0,this.fieldName=void 0,this.entityName=void 0,this.enabled=!0,this.acceptType=void 0,this.maxSize=void 0,this.label=void 0,this.imageValue=void 0,this.loading=!0}async reloadImage(i){await this.loadImage(i)}getMessage(i,t){return this.messagesBuilder||(this.messagesBuilder=new n),this.messagesBuilder.getMessage(i,t)}async clearImage(){this.imageValue=void 0}async handleImageChange(i){const t=i.detail;if(!t)return await this.clearImage(),void await this.updatedataUnitField(!0);const s=await o(t);if(this.maxSize&&s.size>1024*this.maxSize){const i=this.getMessage("snkImageInput.errorImageSize")+this.maxSize+"(KB)";return this.imageError.emit(i),void(this.application&&await this.application.error(this.getMessage("snkImageInput.errorTitle"),i))}this.imageValue=t,await r(s,this.entityName,this.fieldName),await this.updatedataUnitField()}async updatedataUnitField(i=!1){this.dataUnit&&this.dataUnit.getSelectedRecord()&&(i?await this.dataUnit.setFieldValue(this.fieldName,"deletado"):await this.dataUnit.setFieldValue(this.fieldName,`$file.session.key{${d(this.entityName,this.fieldName)}}`))}async handleImageError(i){this.imageError.emit(i.detail),this.application&&await this.application.error(this.getMessage("snkImageInput.errorTitle"),i.detail)}getPksFromDataUnit(){if(!this.dataUnit)return;const i=this.dataUnit.getSelectedRecord();if(!i)return;const t=i[this.fieldName];if(t)try{return JSON.parse(t)}catch(i){return void console.error("Error parsing PK from data unit field:",i)}}async loadImage(i){var t;this.loading=!0,this.dataUnit&&this.entityName&&(i=null!==(t=null!=i?i:this.getPksFromDataUnit())&&void 0!==t?t:c(this.dataUnit),this.imageValue=await l(i,this.fieldName,this.entityName)),this.loading=!1}async componentWillLoad(){this.application=e.getContextValue("__SNK__APPLICATION__"),this.messagesBuilder||(this.messagesBuilder=new n),this.dataUnit&&this.dataUnit.subscribe(this.dataUnitObserver)}disconnectedCallback(){this.dataUnit&&this.dataUnit.unsubscribe(this.dataUnitObserver)}async componentDidLoad(){await this.loadImage()}render(){return s(a,null,s("ez-image-input",{enabled:this.enabled,label:this.label,name:this.fieldName,value:this.imageValue,maxFileSize:this.maxSize?1024*this.maxSize:void 0,accept:this.acceptType||"image/png,image/jpeg,image/gif",onEzChange:i=>this.handleImageChange(i),onEzError:i=>this.handleImageError(i),loading:this.loading}))}};m.style=":host{display:block}";export{m as snk_image_input}
|