@sankhyalabs/sankhyablocks 2.5.2 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{SnkMessageBuilder-370e23ae.js → SnkMessageBuilder-09b25b0a.js} +20 -1
- package/dist/cjs/data-exporter-option-417da37a.js +19 -0
- package/dist/cjs/{index-20e8b68a.js → index-2cd6f753.js} +26 -0
- package/dist/cjs/index-696b5c3b.js +200 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +11 -3
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator_3.cjs.entry.js +71 -13
- package/dist/cjs/snk-crud.cjs.entry.js +3 -2
- package/dist/cjs/{snk-exporter-email-sender_8.cjs.entry.js → snk-data-exporter_9.cjs.entry.js} +305 -8
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form.cjs.entry.js +1 -1
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/cjs/{taskbar-elements-3807c809.js → taskbar-elements-bbb89cdb.js} +8 -5
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/snk-data-exporter/enum/data-exporter-option.js +11 -0
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +4 -4
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +1 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.css +19 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +181 -0
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +140 -0
- package/dist/collection/components/snk-grid/snk-grid.js +69 -10
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +7 -4
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +9 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +33 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterResponse.js +1 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +16 -0
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -0
- package/dist/collection/lib/store/index.js +5 -0
- package/dist/collection/lib/utils/fileViewer/index.js +3 -0
- package/dist/collection/lib/utils/fileViewer/interfaces/IFileViewerParams.js +1 -0
- package/dist/components/ConfigStorage.js +3 -6694
- package/dist/components/DataFetcher.js +6695 -0
- package/dist/components/SnkMessageBuilder.js +20 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/snk-application2.js +11 -2
- package/dist/components/snk-crud.js +10 -4
- package/dist/components/snk-data-exporter.d.ts +11 -0
- package/dist/components/snk-data-exporter.js +6 -0
- package/dist/components/snk-data-exporter2.js +330 -0
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-form2.js +8 -2
- package/dist/components/snk-grid2.js +74 -10
- package/dist/components/snk-taskbar2.js +212 -9
- package/dist/esm/{SnkMessageBuilder-7d583c9a.js → SnkMessageBuilder-47db5d75.js} +20 -1
- package/dist/esm/data-exporter-option-006307dd.js +19 -0
- package/dist/esm/{index-e4121713.js → index-a77b6f35.js} +25 -1
- package/dist/esm/index-d89e384f.js +198 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sankhyablocks.js +2 -2
- package/dist/esm/snk-application.entry.js +11 -3
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator_3.entry.js +68 -10
- package/dist/esm/snk-crud.entry.js +3 -2
- package/dist/esm/{snk-exporter-email-sender_8.entry.js → snk-data-exporter_9.entry.js} +304 -8
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-filter-detail.entry.js +1 -1
- package/dist/esm/snk-filter-multi-select.entry.js +1 -1
- package/dist/esm/snk-filter-number.entry.js +1 -1
- package/dist/esm/snk-filter-period.entry.js +1 -1
- package/dist/esm/snk-filter-personalized.entry.js +1 -1
- package/dist/esm/snk-filter-search.entry.js +1 -1
- package/dist/esm/snk-filter-text.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +1 -1
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/{taskbar-elements-b2bbe275.js → taskbar-elements-beec3b27.js} +8 -5
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/p-04581d0c.entry.js +1 -0
- package/dist/sankhyablocks/p-112bb324.js +1 -0
- package/dist/sankhyablocks/{p-c17be74f.entry.js → p-12ebe36a.entry.js} +1 -1
- package/dist/sankhyablocks/p-13116d05.entry.js +1 -0
- package/dist/sankhyablocks/{p-14af45cc.entry.js → p-187b0d06.entry.js} +1 -1
- package/dist/sankhyablocks/{p-570cc474.entry.js → p-1a2533d0.entry.js} +1 -1
- package/dist/sankhyablocks/{p-fd3b562d.entry.js → p-1ccaea51.entry.js} +1 -1
- package/dist/sankhyablocks/p-1d7a0daf.js +1 -0
- package/dist/sankhyablocks/p-50c8bcb7.entry.js +1 -0
- package/dist/sankhyablocks/{p-44ce5b90.entry.js → p-57895452.entry.js} +1 -1
- package/dist/sankhyablocks/{p-48bbbd2c.entry.js → p-68fcc226.entry.js} +1 -1
- package/dist/sankhyablocks/p-719e570a.js +1 -0
- package/dist/sankhyablocks/{p-00b3c5d8.entry.js → p-772f1c44.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c30d0966.entry.js → p-82e20fc0.entry.js} +1 -1
- package/dist/sankhyablocks/{p-eff899b0.entry.js → p-91c23d20.entry.js} +1 -1
- package/dist/sankhyablocks/p-a77dd79a.js +2 -0
- package/dist/sankhyablocks/{p-f50c6ef6.entry.js → p-ab4ff312.entry.js} +1 -1
- package/dist/sankhyablocks/p-c8327a5c.js +1 -0
- package/dist/sankhyablocks/{p-2664ae24.entry.js → p-d3e402d3.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9593c937.entry.js → p-d7ae56ce.entry.js} +1 -1
- package/dist/sankhyablocks/{p-70e52fee.entry.js → p-d96bf6a7.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b0a0222f.entry.js → p-df5d94c6.entry.js} +1 -1
- package/dist/sankhyablocks/{p-db111acd.entry.js → p-e075dba7.entry.js} +1 -1
- package/dist/sankhyablocks/{p-a3871147.entry.js → p-f8fdd16c.entry.js} +11 -4
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-data-exporter/data/attachment.d.ts +1 -1
- package/dist/types/components/snk-data-exporter/data/email.d.ts +3 -3
- package/dist/types/components/snk-data-exporter/data/export-config.d.ts +5 -5
- package/dist/types/components/snk-data-exporter/data/export-result.d.ts +5 -5
- package/dist/types/components/snk-data-exporter/data/report.d.ts +1 -1
- package/dist/types/components/snk-data-exporter/enum/data-exporter-option.d.ts +10 -0
- package/dist/types/components/snk-data-exporter/exporter-email-sender/email-info-step.d.ts +4 -4
- package/dist/types/components/snk-data-exporter/exporter-email-sender/options-step.d.ts +4 -4
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +9 -0
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +40 -0
- package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +61 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +2 -2
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +1 -1
- package/dist/types/components.d.ts +33 -3
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +9 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +14 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterResponse.d.ts +7 -0
- package/dist/types/lib/message/resources/snk-data-exporter.msg.d.ts +1 -0
- package/dist/types/lib/store/index.d.ts +4 -0
- package/dist/types/lib/utils/fileViewer/index.d.ts +2 -0
- package/dist/types/lib/utils/fileViewer/interfaces/IFileViewerParams.d.ts +4 -0
- package/package.json +2 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/AuthorizationConfig-79ffae4b.js +0 -7
- package/dist/esm/AuthorizationConfig-dcbd207a.js +0 -7
- package/dist/sankhyablocks/p-8a872a35.entry.js +0 -1
- package/dist/sankhyablocks/p-9ba3df4c.js +0 -2
- package/dist/sankhyablocks/p-9e67cf79.entry.js +0 -1
- package/dist/sankhyablocks/p-c118ef2a.entry.js +0 -1
- package/dist/sankhyablocks/p-dbaad88c.js +0 -1
- package/dist/sankhyablocks/p-dc36cfbf.js +0 -1
- package/dist/sankhyablocks/p-e7f772ed.js +0 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { ApplicationContext, ElementIDUtils, DataType } from '@sankhyalabs/core';
|
|
3
|
+
import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
3
4
|
import { T as TaskbarProcessor } from './taskbar-processor.js';
|
|
4
5
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
|
5
|
-
import {
|
|
6
|
+
import { D as DataExporterOption, d as defineCustomElement$a } from './snk-data-exporter2.js';
|
|
7
|
+
import { s as store, d as defineCustomElement$1 } from './snk-taskbar2.js';
|
|
6
8
|
import { d as defineCustomElement$9 } from './snk-exporter-email-sender2.js';
|
|
7
9
|
import { d as defineCustomElement$8 } from './snk-filter-bar2.js';
|
|
8
10
|
import { d as defineCustomElement$7 } from './snk-filter-detail2.js';
|
|
@@ -24,8 +26,8 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
24
26
|
"snkGridTopTaskbar": ["FORM_MODE", "CONFIGURATOR", "INSERT"]
|
|
25
27
|
});
|
|
26
28
|
this._headerTaskbarProcessor = new TaskbarProcessor({
|
|
27
|
-
"snkGridHeaderTaskbar.unselected": ["REFRESH", "
|
|
28
|
-
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH", "
|
|
29
|
+
"snkGridHeaderTaskbar.unselected": ["REFRESH", "DATA_EXPORTER"],
|
|
30
|
+
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH", "DATA_EXPORTER"]
|
|
29
31
|
});
|
|
30
32
|
this._popUpGridConfig = false;
|
|
31
33
|
/**
|
|
@@ -57,8 +59,9 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
57
59
|
async setConfig(config) {
|
|
58
60
|
this.setGridConfig(config);
|
|
59
61
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
ezClickDataExporterHandler(event) {
|
|
63
|
+
var _a;
|
|
64
|
+
if (((_a = event === null || event === void 0 ? void 0 : event.detail) === null || _a === void 0 ? void 0 : _a.id) === DataExporterOption.EXPORT_BY_EMAIL) {
|
|
62
65
|
// TODO: Quando o exportador de grades for implementado, essa ação
|
|
63
66
|
// vai fazer mostrar as opções disponíveis. Enviar por email será
|
|
64
67
|
// apenas mais uma
|
|
@@ -127,6 +130,61 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
127
130
|
this.closeGridConfig();
|
|
128
131
|
});
|
|
129
132
|
}
|
|
133
|
+
buildColumnsMetadata(columnsMetadata, gridColumns) {
|
|
134
|
+
gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
|
|
135
|
+
var _a, _b, _c, _d, _e;
|
|
136
|
+
if (column.hidden) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const fieldData = (_d = (_c = (_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.fields) === null || _c === void 0 ? void 0 : _c.filter((field) => field.name === column.name)) === null || _d === void 0 ? void 0 : _d[0];
|
|
140
|
+
const columnData = {
|
|
141
|
+
label: column.label,
|
|
142
|
+
id: column.name,
|
|
143
|
+
width: column.width,
|
|
144
|
+
dataType: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
|
145
|
+
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
|
|
146
|
+
};
|
|
147
|
+
columnsMetadata.push(columnData);
|
|
148
|
+
if (((_e = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _e === void 0 ? void 0 : _e.DESCRIPTIONFIELD) != undefined) {
|
|
149
|
+
const descriptionColumn = {
|
|
150
|
+
label: fieldData.properties.DESCRIPTIONENTITY,
|
|
151
|
+
id: fieldData.properties.ENTITYNAME + "." + fieldData.properties.DESCRIPTIONFIELD,
|
|
152
|
+
width: 200,
|
|
153
|
+
dataType: DataType.TEXT,
|
|
154
|
+
userInterface: UserInterface.LONGTEXT
|
|
155
|
+
};
|
|
156
|
+
columnsMetadata.push(descriptionColumn);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
return columnsMetadata || [];
|
|
160
|
+
}
|
|
161
|
+
async dataExporterProviderStore() {
|
|
162
|
+
var _a;
|
|
163
|
+
const columnsMetadata = [];
|
|
164
|
+
await ((_a = this._grid) === null || _a === void 0 ? void 0 : _a.getColumnsState().then(this.buildColumnsMetadata.bind(this, columnsMetadata)));
|
|
165
|
+
const dataExporterProvider = {
|
|
166
|
+
getFilters: () => {
|
|
167
|
+
var _a;
|
|
168
|
+
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getFilters();
|
|
169
|
+
},
|
|
170
|
+
getColumnsMetadata: () => {
|
|
171
|
+
return columnsMetadata;
|
|
172
|
+
},
|
|
173
|
+
getOrders: () => {
|
|
174
|
+
var _a;
|
|
175
|
+
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSort();
|
|
176
|
+
},
|
|
177
|
+
getResourceURI: () => {
|
|
178
|
+
var _a;
|
|
179
|
+
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.name;
|
|
180
|
+
},
|
|
181
|
+
getSelectedNumber: () => {
|
|
182
|
+
var _a, _b;
|
|
183
|
+
return (_b = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectedRecords) === null || _b === void 0 ? void 0 : _b.length;
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
|
|
187
|
+
}
|
|
130
188
|
componentWillLoad() {
|
|
131
189
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
132
190
|
let parent = this._element.parentElement;
|
|
@@ -153,10 +211,11 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
153
211
|
this.loadConfig();
|
|
154
212
|
}
|
|
155
213
|
componentWillRender() {
|
|
156
|
-
const invisibleButtons = this.enableDataExporter ? [] : ["
|
|
214
|
+
const invisibleButtons = this.enableDataExporter && this._dataUnit && this._dataUnit.records.length > 0 ? [] : ["DATA_EXPORTER"];
|
|
157
215
|
const headerTaskbarId = this._dataState && this._dataState.selectedRecords.length > 0 ? "snkGridHeaderTaskbar.selected" : "snkGridHeaderTaskbar.unselected";
|
|
158
216
|
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
|
159
217
|
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
|
218
|
+
this.dataExporterProviderStore();
|
|
160
219
|
}
|
|
161
220
|
addElementID() {
|
|
162
221
|
const dataInfo = { dataUnit: this._dataUnit };
|
|
@@ -166,7 +225,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
166
225
|
if (!this._dataUnit) {
|
|
167
226
|
return undefined;
|
|
168
227
|
}
|
|
169
|
-
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), h("ez-grid", { ref: ref => this._grid = ref, "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection }, h("snk-taskbar", { dataUnit: this._dataUnit, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("snk-exporter-email-sender", { ref: ref => this._snkEmailSender = ref, getMessage: (key, params) => this.getMessage(key, params) }), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
228
|
+
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), h("ez-grid", { ref: ref => this._grid = ref, "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("snk-exporter-email-sender", { ref: ref => this._snkEmailSender = ref, getMessage: (key, params) => this.getMessage(key, params) }), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
170
229
|
}
|
|
171
230
|
get _element() { return this; }
|
|
172
231
|
static get style() { return snkGridCss; }
|
|
@@ -184,18 +243,23 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
184
243
|
"showConfig": [64],
|
|
185
244
|
"hideConfig": [64],
|
|
186
245
|
"setConfig": [64]
|
|
187
|
-
}, [[0, "
|
|
246
|
+
}, [[0, "ezClickDataExporter", "ezClickDataExporterHandler"]]]);
|
|
188
247
|
function defineCustomElement() {
|
|
189
248
|
if (typeof customElements === "undefined") {
|
|
190
249
|
return;
|
|
191
250
|
}
|
|
192
|
-
const components = ["snk-grid", "snk-exporter-email-sender", "snk-filter-bar", "snk-filter-detail", "snk-filter-item", "snk-filter-list", "snk-filter-modal", "snk-grid-config", "snk-select-box", "snk-taskbar"];
|
|
251
|
+
const components = ["snk-grid", "snk-data-exporter", "snk-exporter-email-sender", "snk-filter-bar", "snk-filter-detail", "snk-filter-item", "snk-filter-list", "snk-filter-modal", "snk-grid-config", "snk-select-box", "snk-taskbar"];
|
|
193
252
|
components.forEach(tagName => { switch (tagName) {
|
|
194
253
|
case "snk-grid":
|
|
195
254
|
if (!customElements.get(tagName)) {
|
|
196
255
|
customElements.define(tagName, SnkGrid);
|
|
197
256
|
}
|
|
198
257
|
break;
|
|
258
|
+
case "snk-data-exporter":
|
|
259
|
+
if (!customElements.get(tagName)) {
|
|
260
|
+
defineCustomElement$a();
|
|
261
|
+
}
|
|
262
|
+
break;
|
|
199
263
|
case "snk-exporter-email-sender":
|
|
200
264
|
if (!customElements.get(tagName)) {
|
|
201
265
|
defineCustomElement$9();
|
|
@@ -1,6 +1,202 @@
|
|
|
1
|
-
import { h, proxyCustomElement, HTMLElement, createEvent, Host } from '@stencil/core/internal/client';
|
|
1
|
+
import { getRenderingRef, forceUpdate, h, proxyCustomElement, HTMLElement, createEvent, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { StringUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { A as AuthorizationConfig } from './AuthorizationConfig.js';
|
|
4
|
+
import { d as defineCustomElement$1 } from './snk-data-exporter2.js';
|
|
5
|
+
|
|
6
|
+
const appendToMap = (map, propName, value) => {
|
|
7
|
+
const items = map.get(propName);
|
|
8
|
+
if (!items) {
|
|
9
|
+
map.set(propName, [value]);
|
|
10
|
+
}
|
|
11
|
+
else if (!items.includes(value)) {
|
|
12
|
+
items.push(value);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const debounce = (fn, ms) => {
|
|
16
|
+
let timeoutId;
|
|
17
|
+
return (...args) => {
|
|
18
|
+
if (timeoutId) {
|
|
19
|
+
clearTimeout(timeoutId);
|
|
20
|
+
}
|
|
21
|
+
timeoutId = setTimeout(() => {
|
|
22
|
+
timeoutId = 0;
|
|
23
|
+
fn(...args);
|
|
24
|
+
}, ms);
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Check if a possible element isConnected.
|
|
30
|
+
* The property might not be there, so we check for it.
|
|
31
|
+
*
|
|
32
|
+
* We want it to return true if isConnected is not a property,
|
|
33
|
+
* otherwise we would remove these elements and would not update.
|
|
34
|
+
*
|
|
35
|
+
* Better leak in Edge than to be useless.
|
|
36
|
+
*/
|
|
37
|
+
const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
|
|
38
|
+
const cleanupElements = debounce((map) => {
|
|
39
|
+
for (let key of map.keys()) {
|
|
40
|
+
map.set(key, map.get(key).filter(isConnected));
|
|
41
|
+
}
|
|
42
|
+
}, 2000);
|
|
43
|
+
const stencilSubscription = () => {
|
|
44
|
+
if (typeof getRenderingRef !== 'function') {
|
|
45
|
+
// If we are not in a stencil project, we do nothing.
|
|
46
|
+
// This function is not really exported by @stencil/core.
|
|
47
|
+
return {};
|
|
48
|
+
}
|
|
49
|
+
const elmsToUpdate = new Map();
|
|
50
|
+
return {
|
|
51
|
+
dispose: () => elmsToUpdate.clear(),
|
|
52
|
+
get: (propName) => {
|
|
53
|
+
const elm = getRenderingRef();
|
|
54
|
+
if (elm) {
|
|
55
|
+
appendToMap(elmsToUpdate, propName, elm);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
set: (propName) => {
|
|
59
|
+
const elements = elmsToUpdate.get(propName);
|
|
60
|
+
if (elements) {
|
|
61
|
+
elmsToUpdate.set(propName, elements.filter(forceUpdate));
|
|
62
|
+
}
|
|
63
|
+
cleanupElements(elmsToUpdate);
|
|
64
|
+
},
|
|
65
|
+
reset: () => {
|
|
66
|
+
elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
|
|
67
|
+
cleanupElements(elmsToUpdate);
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const unwrap = (val) => (typeof val === 'function' ? val() : val);
|
|
73
|
+
const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
|
|
74
|
+
const unwrappedState = unwrap(defaultState);
|
|
75
|
+
let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
|
|
76
|
+
const handlers = {
|
|
77
|
+
dispose: [],
|
|
78
|
+
get: [],
|
|
79
|
+
set: [],
|
|
80
|
+
reset: [],
|
|
81
|
+
};
|
|
82
|
+
const reset = () => {
|
|
83
|
+
var _a;
|
|
84
|
+
// When resetting the state, the default state may be a function - unwrap it to invoke it.
|
|
85
|
+
// otherwise, the state won't be properly reset
|
|
86
|
+
states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
|
|
87
|
+
handlers.reset.forEach((cb) => cb());
|
|
88
|
+
};
|
|
89
|
+
const dispose = () => {
|
|
90
|
+
// Call first dispose as resetting the state would
|
|
91
|
+
// cause less updates ;)
|
|
92
|
+
handlers.dispose.forEach((cb) => cb());
|
|
93
|
+
reset();
|
|
94
|
+
};
|
|
95
|
+
const get = (propName) => {
|
|
96
|
+
handlers.get.forEach((cb) => cb(propName));
|
|
97
|
+
return states.get(propName);
|
|
98
|
+
};
|
|
99
|
+
const set = (propName, value) => {
|
|
100
|
+
const oldValue = states.get(propName);
|
|
101
|
+
if (shouldUpdate(value, oldValue, propName)) {
|
|
102
|
+
states.set(propName, value);
|
|
103
|
+
handlers.set.forEach((cb) => cb(propName, value, oldValue));
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const state = (typeof Proxy === 'undefined'
|
|
107
|
+
? {}
|
|
108
|
+
: new Proxy(unwrappedState, {
|
|
109
|
+
get(_, propName) {
|
|
110
|
+
return get(propName);
|
|
111
|
+
},
|
|
112
|
+
ownKeys(_) {
|
|
113
|
+
return Array.from(states.keys());
|
|
114
|
+
},
|
|
115
|
+
getOwnPropertyDescriptor() {
|
|
116
|
+
return {
|
|
117
|
+
enumerable: true,
|
|
118
|
+
configurable: true,
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
has(_, propName) {
|
|
122
|
+
return states.has(propName);
|
|
123
|
+
},
|
|
124
|
+
set(_, propName, value) {
|
|
125
|
+
set(propName, value);
|
|
126
|
+
return true;
|
|
127
|
+
},
|
|
128
|
+
}));
|
|
129
|
+
const on = (eventName, callback) => {
|
|
130
|
+
handlers[eventName].push(callback);
|
|
131
|
+
return () => {
|
|
132
|
+
removeFromArray(handlers[eventName], callback);
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
const onChange = (propName, cb) => {
|
|
136
|
+
const unSet = on('set', (key, newValue) => {
|
|
137
|
+
if (key === propName) {
|
|
138
|
+
cb(newValue);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
// We need to unwrap the defaultState because it might be a function.
|
|
142
|
+
// Otherwise we might not be sending the right reset value.
|
|
143
|
+
const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
|
|
144
|
+
return () => {
|
|
145
|
+
unSet();
|
|
146
|
+
unReset();
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
const use = (...subscriptions) => {
|
|
150
|
+
const unsubs = subscriptions.reduce((unsubs, subscription) => {
|
|
151
|
+
if (subscription.set) {
|
|
152
|
+
unsubs.push(on('set', subscription.set));
|
|
153
|
+
}
|
|
154
|
+
if (subscription.get) {
|
|
155
|
+
unsubs.push(on('get', subscription.get));
|
|
156
|
+
}
|
|
157
|
+
if (subscription.reset) {
|
|
158
|
+
unsubs.push(on('reset', subscription.reset));
|
|
159
|
+
}
|
|
160
|
+
if (subscription.dispose) {
|
|
161
|
+
unsubs.push(on('dispose', subscription.dispose));
|
|
162
|
+
}
|
|
163
|
+
return unsubs;
|
|
164
|
+
}, []);
|
|
165
|
+
return () => unsubs.forEach((unsub) => unsub());
|
|
166
|
+
};
|
|
167
|
+
const forceUpdate = (key) => {
|
|
168
|
+
const oldValue = states.get(key);
|
|
169
|
+
handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
|
|
170
|
+
};
|
|
171
|
+
return {
|
|
172
|
+
state,
|
|
173
|
+
get,
|
|
174
|
+
set,
|
|
175
|
+
on,
|
|
176
|
+
onChange,
|
|
177
|
+
use,
|
|
178
|
+
dispose,
|
|
179
|
+
reset,
|
|
180
|
+
forceUpdate,
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
const removeFromArray = (array, item) => {
|
|
184
|
+
const index = array.indexOf(item);
|
|
185
|
+
if (index >= 0) {
|
|
186
|
+
array[index] = array[array.length - 1];
|
|
187
|
+
array.length--;
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
const createStore = (defaultState, shouldUpdate) => {
|
|
192
|
+
const map = createObservableMap(defaultState, shouldUpdate);
|
|
193
|
+
map.use(stencilSubscription());
|
|
194
|
+
return map;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const store = createStore({
|
|
198
|
+
exporterProviders: {}
|
|
199
|
+
});
|
|
4
200
|
|
|
5
201
|
var TaskbarElement;
|
|
6
202
|
(function (TaskbarElement) {
|
|
@@ -18,7 +214,7 @@ var TaskbarElement;
|
|
|
18
214
|
TaskbarElement["MORE_OPTIONS"] = "MORE_OPTIONS";
|
|
19
215
|
TaskbarElement["DIVIDER"] = "DIVIDER";
|
|
20
216
|
TaskbarElement["CONFIGURATOR"] = "CONFIGURATOR";
|
|
21
|
-
TaskbarElement["
|
|
217
|
+
TaskbarElement["DATA_EXPORTER"] = "DATA_EXPORTER";
|
|
22
218
|
})(TaskbarElement || (TaskbarElement = {}));
|
|
23
219
|
var AuthorizationElements;
|
|
24
220
|
(function (AuthorizationElements) {
|
|
@@ -46,7 +242,8 @@ const buildCustomButton = (def, className, dataElementId, action, isEnabled) =>
|
|
|
46
242
|
return textButton(def.name, className, dataElementId, text, hint, action, isEnabled);
|
|
47
243
|
}
|
|
48
244
|
};
|
|
49
|
-
const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions) => {
|
|
245
|
+
const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions, configName) => {
|
|
246
|
+
var _a;
|
|
50
247
|
const title = getTitle(element);
|
|
51
248
|
switch (element) {
|
|
52
249
|
case TaskbarElement.PREVIOUS:
|
|
@@ -73,12 +270,13 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
|
|
|
73
270
|
return iconButton("list", element, className, dataElementId, title, action, isEnabled);
|
|
74
271
|
case TaskbarElement.CONFIGURATOR:
|
|
75
272
|
return iconButton("settings-inverted", element, className, dataElementId, title, action, isEnabled);
|
|
76
|
-
case TaskbarElement.EXPORT:
|
|
77
|
-
return iconButton("file-download", element, className, dataElementId, title, action, isEnabled);
|
|
78
273
|
case TaskbarElement.MORE_OPTIONS:
|
|
79
274
|
return actionButton(element, className, dataElementId, title, action, isEnabled, actions);
|
|
80
275
|
case TaskbarElement.DIVIDER:
|
|
81
276
|
return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
|
|
277
|
+
case TaskbarElement.DATA_EXPORTER:
|
|
278
|
+
const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
|
|
279
|
+
return h("snk-data-exporter", { class: className, title: title, provider: provider, "data-element-id": dataElementId });
|
|
82
280
|
}
|
|
83
281
|
};
|
|
84
282
|
function textButton(name, className, dataElementId, text, title, action, isEnabled) {
|
|
@@ -118,7 +316,7 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
118
316
|
[TaskbarElement.GRID_MODE]: "snkTaskbar.titleGridMode",
|
|
119
317
|
[TaskbarElement.FORM_MODE]: "snkTaskbar.titleFormMode",
|
|
120
318
|
[TaskbarElement.CONFIGURATOR]: "snkTaskbar.titleConfigurator",
|
|
121
|
-
[TaskbarElement.
|
|
319
|
+
[TaskbarElement.DATA_EXPORTER]: "snkTaskbar.titleDataExporter"
|
|
122
320
|
};
|
|
123
321
|
}
|
|
124
322
|
observeButtons() {
|
|
@@ -209,7 +407,7 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
209
407
|
className += "ez-padding-left--medium";
|
|
210
408
|
}
|
|
211
409
|
if (TaskbarElement[def.toString()]) {
|
|
212
|
-
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
|
|
410
|
+
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList, this.configName);
|
|
213
411
|
}
|
|
214
412
|
else {
|
|
215
413
|
return buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
@@ -299,14 +497,19 @@ function defineCustomElement() {
|
|
|
299
497
|
if (typeof customElements === "undefined") {
|
|
300
498
|
return;
|
|
301
499
|
}
|
|
302
|
-
const components = ["snk-taskbar"];
|
|
500
|
+
const components = ["snk-taskbar", "snk-data-exporter"];
|
|
303
501
|
components.forEach(tagName => { switch (tagName) {
|
|
304
502
|
case "snk-taskbar":
|
|
305
503
|
if (!customElements.get(tagName)) {
|
|
306
504
|
customElements.define(tagName, SnkTaskbar);
|
|
307
505
|
}
|
|
308
506
|
break;
|
|
507
|
+
case "snk-data-exporter":
|
|
508
|
+
if (!customElements.get(tagName)) {
|
|
509
|
+
defineCustomElement$1();
|
|
510
|
+
}
|
|
511
|
+
break;
|
|
309
512
|
} });
|
|
310
513
|
}
|
|
311
514
|
|
|
312
|
-
export { SnkTaskbar as S, TaskbarElement as T, defineCustomElement as d };
|
|
515
|
+
export { SnkTaskbar as S, TaskbarElement as T, defineCustomElement as d, store as s };
|
|
@@ -60,6 +60,7 @@ const snkTaskbarMessages = {
|
|
|
60
60
|
titlePrevious: "Anterior",
|
|
61
61
|
titleNext: "Próximo",
|
|
62
62
|
titleRefresh: "Atualizar",
|
|
63
|
+
titleDataExporter: "Exportar",
|
|
63
64
|
titleClone: "Duplicar",
|
|
64
65
|
titleRemove: "Excluir",
|
|
65
66
|
titleMoreOptions: "Mais Opções",
|
|
@@ -205,6 +206,23 @@ const snkGridConfigMessages = {
|
|
|
205
206
|
}
|
|
206
207
|
};
|
|
207
208
|
|
|
209
|
+
const snkDataExporterMessages = {
|
|
210
|
+
group: {
|
|
211
|
+
export: {
|
|
212
|
+
default: "Exportar para",
|
|
213
|
+
multiSelected: "Exportar {0} linhas selecionadas",
|
|
214
|
+
selectedLine: "Exportar somente 1 linha selecionada",
|
|
215
|
+
},
|
|
216
|
+
custom: "Personalizado"
|
|
217
|
+
},
|
|
218
|
+
label: {
|
|
219
|
+
currentPage: "Somente a página atual",
|
|
220
|
+
spreadsheet: "Planilha",
|
|
221
|
+
cube: "Cubo",
|
|
222
|
+
sendByEmail: "Enviar por email",
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
|
|
208
226
|
class SnkMessageBuilder {
|
|
209
227
|
constructor() {
|
|
210
228
|
this._defaults = {
|
|
@@ -220,7 +238,8 @@ class SnkMessageBuilder {
|
|
|
220
238
|
crudUtils: crudUtilsMessages,
|
|
221
239
|
snkGrid: snkGridMessages,
|
|
222
240
|
snkGridConfig: snkGridConfigMessages,
|
|
223
|
-
snkExporter: snkExporterMessages
|
|
241
|
+
snkExporter: snkExporterMessages,
|
|
242
|
+
snkDataExporter: snkDataExporterMessages
|
|
224
243
|
};
|
|
225
244
|
this._currentOperation = OperationMap.CLEAN;
|
|
226
245
|
this.loadAppMessages().then((msgs) => {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var AuthorizationConfig;
|
|
2
|
+
(function (AuthorizationConfig) {
|
|
3
|
+
AuthorizationConfig["CONFIG_GRID"] = "CONFIG_GRID";
|
|
4
|
+
AuthorizationConfig["CONFIG"] = "CONFIG";
|
|
5
|
+
})(AuthorizationConfig || (AuthorizationConfig = {}));
|
|
6
|
+
|
|
7
|
+
var DataExporterOption;
|
|
8
|
+
(function (DataExporterOption) {
|
|
9
|
+
DataExporterOption["EXPORT_TO_PDF"] = "exportToPDF";
|
|
10
|
+
DataExporterOption["EXPORT_TO_XLS"] = "exportToXLS";
|
|
11
|
+
DataExporterOption["EXPORT_CURRENT_PAGE"] = "exportCurrentPage";
|
|
12
|
+
DataExporterOption["EXPORT_PAGE_TO_PDF"] = "exportPageToPDF";
|
|
13
|
+
DataExporterOption["EXPORT_PAGE_TO_XLS"] = "exportPageToXLS";
|
|
14
|
+
DataExporterOption["EXPORT_BY_EMAIL"] = "exportToEmail";
|
|
15
|
+
DataExporterOption["EXPORT_PDF_TO_EMAIL"] = "exportPDFToEmail";
|
|
16
|
+
DataExporterOption["EXPORT_XLS_TO_EMAIL"] = "exportXLSToEmail";
|
|
17
|
+
})(DataExporterOption || (DataExporterOption = {}));
|
|
18
|
+
|
|
19
|
+
export { AuthorizationConfig as A, DataExporterOption as D };
|
|
@@ -15,6 +15,7 @@ let useNativeShadowDom = false;
|
|
|
15
15
|
let checkSlotFallbackVisibility = false;
|
|
16
16
|
let checkSlotRelocate = false;
|
|
17
17
|
let isSvgMode = false;
|
|
18
|
+
let renderingRef = null;
|
|
18
19
|
let queuePending = false;
|
|
19
20
|
const createTime = (fnName, tagName = '') => {
|
|
20
21
|
{
|
|
@@ -1256,6 +1257,11 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1256
1257
|
promise = safeCall(instance, 'componentWillLoad');
|
|
1257
1258
|
}
|
|
1258
1259
|
}
|
|
1260
|
+
else {
|
|
1261
|
+
{
|
|
1262
|
+
promise = safeCall(instance, 'componentWillUpdate');
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1259
1265
|
{
|
|
1260
1266
|
promise = then(promise, () => safeCall(instance, 'componentWillRender'));
|
|
1261
1267
|
}
|
|
@@ -1299,6 +1305,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1299
1305
|
};
|
|
1300
1306
|
const callRender = (hostRef, instance, elm) => {
|
|
1301
1307
|
try {
|
|
1308
|
+
renderingRef = instance;
|
|
1302
1309
|
instance = instance.render() ;
|
|
1303
1310
|
{
|
|
1304
1311
|
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
@@ -1320,8 +1327,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
1320
1327
|
catch (e) {
|
|
1321
1328
|
consoleError(e, hostRef.$hostElement$);
|
|
1322
1329
|
}
|
|
1330
|
+
renderingRef = null;
|
|
1323
1331
|
return null;
|
|
1324
1332
|
};
|
|
1333
|
+
const getRenderingRef = () => renderingRef;
|
|
1325
1334
|
const postUpdateComponent = (hostRef) => {
|
|
1326
1335
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1327
1336
|
const elm = hostRef.$hostElement$;
|
|
@@ -1349,6 +1358,9 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1349
1358
|
}
|
|
1350
1359
|
}
|
|
1351
1360
|
else {
|
|
1361
|
+
{
|
|
1362
|
+
safeCall(instance, 'componentDidUpdate');
|
|
1363
|
+
}
|
|
1352
1364
|
endPostUpdate();
|
|
1353
1365
|
}
|
|
1354
1366
|
{
|
|
@@ -1370,6 +1382,18 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1370
1382
|
// ( •_•)>⌐■-■
|
|
1371
1383
|
// (⌐■_■)
|
|
1372
1384
|
};
|
|
1385
|
+
const forceUpdate = (ref) => {
|
|
1386
|
+
{
|
|
1387
|
+
const hostRef = getHostRef(ref);
|
|
1388
|
+
const isConnected = hostRef.$hostElement$.isConnected;
|
|
1389
|
+
if (isConnected &&
|
|
1390
|
+
(hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1391
|
+
scheduleUpdate(hostRef, false);
|
|
1392
|
+
}
|
|
1393
|
+
// Returns "true" when the forced update was successfully scheduled
|
|
1394
|
+
return isConnected;
|
|
1395
|
+
}
|
|
1396
|
+
};
|
|
1373
1397
|
const appDidLoad = (who) => {
|
|
1374
1398
|
// on appload
|
|
1375
1399
|
// we have finish the first big initial render
|
|
@@ -1958,4 +1982,4 @@ const flush = () => {
|
|
|
1958
1982
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
1959
1983
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1960
1984
|
|
|
1961
|
-
export { Fragment as F, Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r };
|
|
1985
|
+
export { Fragment as F, Host as H, getRenderingRef as a, bootstrapLazy as b, createEvent as c, forceUpdate as f, getElement as g, h, promiseResolve as p, registerInstance as r };
|