@sankhyalabs/sankhyablocks 2.4.10 → 2.4.12
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/{ConfigStorage-c112de1d.js → ConfigStorage-91953f29.js} +6 -7
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator_3.cjs.entry.js +14 -9
- package/dist/cjs/snk-exporter-email-sender_8.cjs.entry.js +30 -11
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form.cjs.entry.js +14 -9
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +29 -9
- package/dist/collection/components/snk-form/snk-form.js +13 -8
- package/dist/collection/components/snk-grid/snk-grid.css +7 -5
- package/dist/collection/components/snk-grid/snk-grid.js +12 -7
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +0 -15
- package/dist/collection/lib/configs/ConfigStorage.js +6 -7
- package/dist/collection/lib/index.js +1 -0
- package/dist/components/ConfigStorage.js +6 -7
- package/dist/components/snk-filter-item2.js +29 -9
- package/dist/components/snk-form2.js +13 -8
- package/dist/components/snk-grid2.js +13 -8
- package/dist/components/snk-taskbar2.js +0 -1
- package/dist/esm/{ConfigStorage-99025655.js → ConfigStorage-b59461d8.js} +6 -7
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-configurator_3.entry.js +14 -9
- package/dist/esm/snk-exporter-email-sender_8.entry.js +30 -11
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +14 -9
- package/dist/sankhyablocks/{p-9010ac54.entry.js → p-00b3c5d8.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6ba8f415.js → p-395b45a7.js} +1 -1
- package/dist/sankhyablocks/p-48bbbd2c.entry.js +1 -0
- package/dist/sankhyablocks/{p-df53643b.entry.js → p-9e67cf79.entry.js} +1 -1
- package/dist/sankhyablocks/{p-1b7f87cf.entry.js → p-a3871147.entry.js} +1 -1
- package/dist/sankhyablocks/p-baa2b65f.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +5 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +0 -4
- package/dist/types/components.d.ts +0 -4
- package/dist/types/lib/configs/ConfigStorage.d.ts +1 -1
- package/dist/types/lib/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-2445b586.entry.js +0 -1
- package/dist/sankhyablocks/p-fb96840c.entry.js +0 -1
|
@@ -6927,17 +6927,16 @@ const CONFIG_SOURCE = {
|
|
|
6927
6927
|
grid: "grid"
|
|
6928
6928
|
};
|
|
6929
6929
|
class ConfigStorage {
|
|
6930
|
-
static get() {
|
|
6930
|
+
static async get() {
|
|
6931
6931
|
if (!ConfigStorage.instance) {
|
|
6932
6932
|
const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
6933
6933
|
if (application != undefined) {
|
|
6934
|
+
const configName = application.configName;
|
|
6935
|
+
const resourceID = await application.getResourceID();
|
|
6934
6936
|
ConfigStorage.instance = new ConfigStorage();
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
ConfigStorage.instance.loadFormConfig(configName);
|
|
6939
|
-
ConfigStorage.instance.loadGridConfig(configName);
|
|
6940
|
-
});
|
|
6937
|
+
ConfigStorage.resourceID = resourceID;
|
|
6938
|
+
ConfigStorage.instance.loadFormConfig(configName);
|
|
6939
|
+
ConfigStorage.instance.loadGridConfig(configName);
|
|
6941
6940
|
}
|
|
6942
6941
|
}
|
|
6943
6942
|
return this.instance;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-20e8b68a.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
7
|
+
const ConfigStorage = require('./ConfigStorage-91953f29.js');
|
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
9
9
|
const SnkMessageBuilder = require('./SnkMessageBuilder-370e23ae.js');
|
|
10
10
|
require('./_commonjsHelpers-537d719a.js');
|
|
@@ -7,7 +7,7 @@ const core = require('@sankhyalabs/core');
|
|
|
7
7
|
const constants = require('./constants-a47a5190.js');
|
|
8
8
|
const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
|
9
9
|
const taskbarProcessor = require('./taskbar-processor-6f3d2a75.js');
|
|
10
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
10
|
+
const ConfigStorage = require('./ConfigStorage-91953f29.js');
|
|
11
11
|
const taskbarElements = require('./taskbar-elements-3807c809.js');
|
|
12
12
|
require('./_commonjsHelpers-537d719a.js');
|
|
13
13
|
|
|
@@ -156,7 +156,7 @@ const SnkFieldConfig = class {
|
|
|
156
156
|
};
|
|
157
157
|
SnkFieldConfig.style = snkFieldConfigCss;
|
|
158
158
|
|
|
159
|
-
const snkGridCss = ".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--
|
|
159
|
+
const snkGridCss = ".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}";
|
|
160
160
|
|
|
161
161
|
const SnkGrid = class {
|
|
162
162
|
constructor(hostRef) {
|
|
@@ -246,13 +246,18 @@ const SnkGrid = class {
|
|
|
246
246
|
this._gridConfig = config;
|
|
247
247
|
}
|
|
248
248
|
loadConfig() {
|
|
249
|
+
if (this.configName == undefined) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
249
252
|
ConfigStorage.ConfigStorage.get()
|
|
250
|
-
.
|
|
251
|
-
.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
253
|
+
.then((instance) => {
|
|
254
|
+
instance.loadGridConfig(this.configName)
|
|
255
|
+
.then((config) => {
|
|
256
|
+
this.setGridConfig(config);
|
|
257
|
+
})
|
|
258
|
+
.catch((error) => {
|
|
259
|
+
console.warn(error);
|
|
260
|
+
});
|
|
256
261
|
});
|
|
257
262
|
}
|
|
258
263
|
saveConfig(config) {
|
|
@@ -304,7 +309,7 @@ const SnkGrid = class {
|
|
|
304
309
|
if (!this._dataUnit) {
|
|
305
310
|
return undefined;
|
|
306
311
|
}
|
|
307
|
-
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-
|
|
312
|
+
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, index.h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), index.h("ez-grid", { ref: ref => this._grid = ref, "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection }, index.h("snk-taskbar", { dataUnit: this._dataUnit, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("snk-exporter-email-sender", { ref: ref => this._snkEmailSender = ref, getMessage: (key, params) => this.getMessage(key, params) }), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
308
313
|
}
|
|
309
314
|
get _element() { return index.getElement(this); }
|
|
310
315
|
};
|
|
@@ -8,7 +8,7 @@ const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
|
|
|
8
8
|
const ezModalContainer = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container');
|
|
9
9
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
|
10
10
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
11
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
11
|
+
const ConfigStorage = require('./ConfigStorage-91953f29.js');
|
|
12
12
|
const constants = require('./constants-a47a5190.js');
|
|
13
13
|
const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
|
14
14
|
const taskbarElements = require('./taskbar-elements-3807c809.js');
|
|
@@ -632,23 +632,42 @@ const SnkFilterItem = class {
|
|
|
632
632
|
if (open) {
|
|
633
633
|
this._closeCallback = resolve;
|
|
634
634
|
window.requestAnimationFrame(() => {
|
|
635
|
-
this._floatingID = core.FloatingManager.float(this._popover, this._popoverContainer,
|
|
636
|
-
autoClose: true,
|
|
637
|
-
innerClickTest: this.innerClickCheck,
|
|
638
|
-
backClickListener: () => this.onDetailCloseCallback(),
|
|
639
|
-
left: this.getScrollOffset(),
|
|
640
|
-
useOverlay: true
|
|
641
|
-
});
|
|
635
|
+
this._floatingID = core.FloatingManager.float(this._popover, this._popoverContainer, this.getFloatOptions());
|
|
642
636
|
this._popover.show();
|
|
643
637
|
this.detailIsVisible = true;
|
|
644
638
|
});
|
|
645
639
|
}
|
|
646
640
|
});
|
|
647
641
|
}
|
|
648
|
-
|
|
642
|
+
updatePosition() {
|
|
643
|
+
if (this._floatingID == undefined) {
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
core.FloatingManager.updateFloatPosition(this._popover, this._popoverContainer, this.getFloatOptions());
|
|
647
|
+
}
|
|
648
|
+
getFloatOptions() {
|
|
649
|
+
return {
|
|
650
|
+
autoClose: true,
|
|
651
|
+
innerClickTest: this.innerClickCheck,
|
|
652
|
+
backClickListener: () => this.onDetailCloseCallback(),
|
|
653
|
+
left: this.getScrollOffsetLeft(),
|
|
654
|
+
top: this.getScrollOffsetTop(),
|
|
655
|
+
useOverlay: true,
|
|
656
|
+
isFixed: true
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
getScrollOffsetLeft() {
|
|
649
660
|
const padding = getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");
|
|
650
661
|
const rect = this._filterItemElement.getBoundingClientRect();
|
|
651
|
-
return `calc(${rect.
|
|
662
|
+
return `calc(${rect.x}px + ${padding})`;
|
|
663
|
+
}
|
|
664
|
+
getScrollOffsetTop() {
|
|
665
|
+
const rect = this._filterItemElement.getBoundingClientRect();
|
|
666
|
+
return (rect.y + rect.height) + "px";
|
|
667
|
+
}
|
|
668
|
+
controlScrollPage() {
|
|
669
|
+
window.removeEventListener("scroll", this.updatePosition.bind(this));
|
|
670
|
+
window.addEventListener("scroll", this.updatePosition.bind(this));
|
|
652
671
|
}
|
|
653
672
|
/**
|
|
654
673
|
* Oculta os detalhes de um item da lista.
|
|
@@ -753,6 +772,7 @@ const SnkFilterItem = class {
|
|
|
753
772
|
core.ElementIDUtils.addIDInfo(this._filterItemElement);
|
|
754
773
|
this._idSnkFilterDetail = `filterDetail_${this.config.id}`;
|
|
755
774
|
}
|
|
775
|
+
this.controlScrollPage();
|
|
756
776
|
}
|
|
757
777
|
componentDidRender() {
|
|
758
778
|
if (this._floatingID == undefined) {
|
|
@@ -1481,7 +1501,6 @@ const SnkTaskbar = class {
|
|
|
1481
1501
|
constructor(hostRef) {
|
|
1482
1502
|
index.registerInstance(this, hostRef);
|
|
1483
1503
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
|
1484
|
-
this.actionChange = index.createEvent(this, "actionChange", 7);
|
|
1485
1504
|
this._titleKeyByElement = {
|
|
1486
1505
|
[taskbarElements.TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
|
|
1487
1506
|
[taskbarElements.TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
|
|
@@ -7,7 +7,7 @@ const draggable_bundle = require('./draggable.bundle-82a25c06.js');
|
|
|
7
7
|
const core = require('@sankhyalabs/core');
|
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
9
9
|
const constants = require('./constants-a47a5190.js');
|
|
10
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
10
|
+
const ConfigStorage = require('./ConfigStorage-91953f29.js');
|
|
11
11
|
require('./_commonjsHelpers-537d719a.js');
|
|
12
12
|
|
|
13
13
|
const snkFormConfigCss = ".sc-snk-form-config-h{--snk-form-config__title--font-pattern:var(--font-pattern, \"Roboto\");--snk-form-config__title--weight--large:var(--text-weight--large, 600);display:flex;flex-direction:column;position:absolute;top:0;left:0;width:100%;height:100%;z-index:var(--more-visible, 2);background-color:var(--background--xlight)}.form-config__title.sc-snk-form-config{display:flex;margin:0;line-height:1.3;font-family:var(--snk-form-config__title--font-pattern);font-weight:var(--snk-form-config__title--weight--large)}.form-config__header-container.sc-snk-form-config{display:flex}.form-config__field-container.sc-snk-form-config{width:32%;padding:6px}.form-config__hide-content.sc-snk-form-config{display:none}ez-icon.sc-snk-form-config .left-icon.sc-snk-form-config{--ez-icon--color:var(--text--disable)}.ez-box__label-counter.sc-snk-form-config{font-weight:var(--text-weight--extra-small);margin-top:-7px}.form-config__btn-options.sc-snk-form-config{--ez-button--min-width:300px;--ez-button--background-color:#FFFFFF}[data-draggable-parent].sc-snk-form-config{position:relative}.form-config__field-config--selected.sc-snk-form-config{position:static}.form-config__field-config--dragged.sc-snk-form-config .draggable-mirror.sc-snk-form-config{z-index:var(--more-visible, 2)}.form-config__config-options.sc-snk-form-config{position:relative;margin-top:-3px;min-width:100%;z-index:1}.form-config__tab-container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config{position:relative;height:100%;max-height:calc(100vh - 92px)}.form-config__tab-container.sc-snk-form-config .ez-box__container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config .ez-box__container.sc-snk-form-config{align-content:flex-start;height:100%}.form-config__fields-available.sc-snk-form-config [data-draggable-parent].sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:100%;max-height:calc(100% - 122px)}.form-config__tab-content.sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:auto;max-height:calc(100% - 128px)}[data-draggable-element].sc-snk-form-config{cursor:grab}.form-config__actions-button.sc-snk-form-config{--ez-actions-button__btn-action--min-width:235px}.form-config__add-group.sc-snk-form-config{position:relative;min-height:120px;margin-bottom:10px}.form-config__add-group-container.sc-snk-form-config{position:absolute;display:flex;flex-wrap:wrap;width:100%;box-sizing:border-box;border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #d2dce9);padding:var(--space--small, 6px)}.form-config__add-group-content.sc-snk-form-config{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;box-sizing:border-box;border:2px dashed var(--color-strokes, #DCE0E8);border-radius:var(--border--radius-small, 6px)}.form-config__add-group-label.sc-snk-form-config{display:flex;justify-content:center;box-sizing:border-box;padding:var(--space--large, 24px)}.form-config__btn-add-group.sc-snk-form-config{position:relative;padding:var(--space--large, 24px) var(--space--medium, 12px) 0}.form-config__btn-add-group-container.sc-snk-form-config{padding:var(--space--medium, 12px);border-radius:var(--border--radius-medium, 12px);border:2px solid var(--color-strokes, #DCE0E8);background-color:var(--background--body, #fafcff)}.form-config__left-icon--eye-off.sc-snk-form-config{padding-top:var(--space--medium, 8px)}ez-collapsible-box.draggable-mirror.sc-snk-form-config{display:table;background-color:#FFFFFF}ez-collapsible-box.sc-snk-form-config{margin-bottom:10px}@media screen and (min-width: 480px){.form-config__field-config--selected.sc-snk-form-config .ez-flex.form-config__config-options.sc-snk-form-config{min-width:calc(300% + 12px)}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+2) .ez-flex.form-config__config-options.sc-snk-form-config{transform:translate(calc(100% / 3 * -1))}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+3) .ez-flex.form-config__config-options.sc-snk-form-config{transform:translate(calc(100% / 3 * -2))}}";
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-20e8b68a.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const taskbarProcessor = require('./taskbar-processor-6f3d2a75.js');
|
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
8
|
+
const ConfigStorage = require('./ConfigStorage-91953f29.js');
|
|
9
9
|
require('./_commonjsHelpers-537d719a.js');
|
|
10
10
|
|
|
11
11
|
const snkFormCss = ".sc-snk-form-h{display:block}.snk-form.sc-snk-form{position:relative;padding:var(--space--large);padding-top:var(--space--medium)}.snk-form__header.sc-snk-form{position:relative;padding-top:var(--space--medium);padding-bottom:var(--space--medium);margin-bottom:var(--space--medium)}.snk-form__header--fixed.sc-snk-form{position:sticky;top:0;background:var(--background--body);z-index:var(--more-visible, 2);padding-left:var(--space--large);padding-right:var(--space--large);margin-left:calc(var(--space--large) * -1);margin-right:calc(var(--space--large) * -1);width:calc(100% + (var(--space--large) * 2))}.snk-form__form--hidden.sc-snk-form{display:none}";
|
|
@@ -37,15 +37,20 @@ const SnkForm = class {
|
|
|
37
37
|
this._showFormConfig = false;
|
|
38
38
|
}
|
|
39
39
|
loadConfig() {
|
|
40
|
+
if (this.configName == undefined) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
40
43
|
ConfigStorage.ConfigStorage.get()
|
|
41
|
-
.
|
|
42
|
-
.
|
|
43
|
-
|
|
44
|
-
this.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
.then((instance) => {
|
|
45
|
+
instance.loadFormConfig(this.configName)
|
|
46
|
+
.then((config) => {
|
|
47
|
+
if (!this.setConfig(config)) {
|
|
48
|
+
this.loadInsertionConfig();
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
.catch((error) => {
|
|
52
|
+
console.warn(error);
|
|
53
|
+
});
|
|
49
54
|
});
|
|
50
55
|
}
|
|
51
56
|
setConfig(config) {
|
|
@@ -23,23 +23,42 @@ export class SnkFilterItem {
|
|
|
23
23
|
if (open) {
|
|
24
24
|
this._closeCallback = resolve;
|
|
25
25
|
window.requestAnimationFrame(() => {
|
|
26
|
-
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer,
|
|
27
|
-
autoClose: true,
|
|
28
|
-
innerClickTest: this.innerClickCheck,
|
|
29
|
-
backClickListener: () => this.onDetailCloseCallback(),
|
|
30
|
-
left: this.getScrollOffset(),
|
|
31
|
-
useOverlay: true
|
|
32
|
-
});
|
|
26
|
+
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, this.getFloatOptions());
|
|
33
27
|
this._popover.show();
|
|
34
28
|
this.detailIsVisible = true;
|
|
35
29
|
});
|
|
36
30
|
}
|
|
37
31
|
});
|
|
38
32
|
}
|
|
39
|
-
|
|
33
|
+
updatePosition() {
|
|
34
|
+
if (this._floatingID == undefined) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
FloatingManager.updateFloatPosition(this._popover, this._popoverContainer, this.getFloatOptions());
|
|
38
|
+
}
|
|
39
|
+
getFloatOptions() {
|
|
40
|
+
return {
|
|
41
|
+
autoClose: true,
|
|
42
|
+
innerClickTest: this.innerClickCheck,
|
|
43
|
+
backClickListener: () => this.onDetailCloseCallback(),
|
|
44
|
+
left: this.getScrollOffsetLeft(),
|
|
45
|
+
top: this.getScrollOffsetTop(),
|
|
46
|
+
useOverlay: true,
|
|
47
|
+
isFixed: true
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
getScrollOffsetLeft() {
|
|
40
51
|
const padding = getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");
|
|
41
52
|
const rect = this._filterItemElement.getBoundingClientRect();
|
|
42
|
-
return `calc(${rect.
|
|
53
|
+
return `calc(${rect.x}px + ${padding})`;
|
|
54
|
+
}
|
|
55
|
+
getScrollOffsetTop() {
|
|
56
|
+
const rect = this._filterItemElement.getBoundingClientRect();
|
|
57
|
+
return (rect.y + rect.height) + "px";
|
|
58
|
+
}
|
|
59
|
+
controlScrollPage() {
|
|
60
|
+
window.removeEventListener("scroll", this.updatePosition.bind(this));
|
|
61
|
+
window.addEventListener("scroll", this.updatePosition.bind(this));
|
|
43
62
|
}
|
|
44
63
|
/**
|
|
45
64
|
* Oculta os detalhes de um item da lista.
|
|
@@ -144,6 +163,7 @@ export class SnkFilterItem {
|
|
|
144
163
|
ElementIDUtils.addIDInfo(this._filterItemElement);
|
|
145
164
|
this._idSnkFilterDetail = `filterDetail_${this.config.id}`;
|
|
146
165
|
}
|
|
166
|
+
this.controlScrollPage();
|
|
147
167
|
}
|
|
148
168
|
componentDidRender() {
|
|
149
169
|
if (this._floatingID == undefined) {
|
|
@@ -26,15 +26,20 @@ export class SnkForm {
|
|
|
26
26
|
this._showFormConfig = false;
|
|
27
27
|
}
|
|
28
28
|
loadConfig() {
|
|
29
|
+
if (this.configName == undefined) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
29
32
|
ConfigStorage.get()
|
|
30
|
-
.
|
|
31
|
-
.
|
|
32
|
-
|
|
33
|
-
this.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
.then((instance) => {
|
|
34
|
+
instance.loadFormConfig(this.configName)
|
|
35
|
+
.then((config) => {
|
|
36
|
+
if (!this.setConfig(config)) {
|
|
37
|
+
this.loadInsertionConfig();
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
.catch((error) => {
|
|
41
|
+
console.warn(error);
|
|
42
|
+
});
|
|
38
43
|
});
|
|
39
44
|
}
|
|
40
45
|
setConfig(config) {
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
.snk-grid__container{
|
|
1
|
+
.snk-grid__container {
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.snk-grid__header{
|
|
7
|
+
.snk-grid__header {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-wrap: nowrap;
|
|
10
10
|
width: 100%;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.snk-grid__filter-bar{
|
|
13
|
+
.snk-grid__filter-bar {
|
|
14
14
|
width: 100%;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
|
|
17
|
+
.snk-grid__header-divider {
|
|
18
|
+
/*public*/
|
|
19
|
+
margin-bottom: var(--space--medium);
|
|
18
20
|
}
|
|
@@ -88,13 +88,18 @@ export class SnkGrid {
|
|
|
88
88
|
this._gridConfig = config;
|
|
89
89
|
}
|
|
90
90
|
loadConfig() {
|
|
91
|
+
if (this.configName == undefined) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
91
94
|
ConfigStorage.get()
|
|
92
|
-
.
|
|
93
|
-
.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
.then((instance) => {
|
|
96
|
+
instance.loadGridConfig(this.configName)
|
|
97
|
+
.then((config) => {
|
|
98
|
+
this.setGridConfig(config);
|
|
99
|
+
})
|
|
100
|
+
.catch((error) => {
|
|
101
|
+
console.warn(error);
|
|
102
|
+
});
|
|
98
103
|
});
|
|
99
104
|
}
|
|
100
105
|
saveConfig(config) {
|
|
@@ -146,7 +151,7 @@ export class SnkGrid {
|
|
|
146
151
|
if (!this._dataUnit) {
|
|
147
152
|
return undefined;
|
|
148
153
|
}
|
|
149
|
-
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-
|
|
154
|
+
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() }))));
|
|
150
155
|
}
|
|
151
156
|
static get is() { return "snk-grid"; }
|
|
152
157
|
static get encapsulation() { return "scoped"; }
|
|
@@ -351,21 +351,6 @@ export class SnkTaskbar {
|
|
|
351
351
|
"resolved": "string",
|
|
352
352
|
"references": {}
|
|
353
353
|
}
|
|
354
|
-
}, {
|
|
355
|
-
"method": "actionChange",
|
|
356
|
-
"name": "actionChange",
|
|
357
|
-
"bubbles": true,
|
|
358
|
-
"cancelable": true,
|
|
359
|
-
"composed": true,
|
|
360
|
-
"docs": {
|
|
361
|
-
"tags": [],
|
|
362
|
-
"text": "Emitido sempre que houver altera\u00E7\u00E3o em algum elemento aberto pelo bot\u00E3o de a\u00E7\u00E3o."
|
|
363
|
-
},
|
|
364
|
-
"complexType": {
|
|
365
|
-
"original": "any",
|
|
366
|
-
"resolved": "any",
|
|
367
|
-
"references": {}
|
|
368
|
-
}
|
|
369
354
|
}];
|
|
370
355
|
}
|
|
371
356
|
static get elementRef() { return "_element"; }
|
|
@@ -6,17 +6,16 @@ const CONFIG_SOURCE = {
|
|
|
6
6
|
grid: "grid"
|
|
7
7
|
};
|
|
8
8
|
export class ConfigStorage {
|
|
9
|
-
static get() {
|
|
9
|
+
static async get() {
|
|
10
10
|
if (!ConfigStorage.instance) {
|
|
11
11
|
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
12
12
|
if (application != undefined) {
|
|
13
|
+
const configName = application.configName;
|
|
14
|
+
const resourceID = await application.getResourceID();
|
|
13
15
|
ConfigStorage.instance = new ConfigStorage();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
ConfigStorage.instance.loadFormConfig(configName);
|
|
18
|
-
ConfigStorage.instance.loadGridConfig(configName);
|
|
19
|
-
});
|
|
16
|
+
ConfigStorage.resourceID = resourceID;
|
|
17
|
+
ConfigStorage.instance.loadFormConfig(configName);
|
|
18
|
+
ConfigStorage.instance.loadGridConfig(configName);
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
return this.instance;
|
|
@@ -6925,17 +6925,16 @@ const CONFIG_SOURCE = {
|
|
|
6925
6925
|
grid: "grid"
|
|
6926
6926
|
};
|
|
6927
6927
|
class ConfigStorage {
|
|
6928
|
-
static get() {
|
|
6928
|
+
static async get() {
|
|
6929
6929
|
if (!ConfigStorage.instance) {
|
|
6930
6930
|
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
6931
6931
|
if (application != undefined) {
|
|
6932
|
+
const configName = application.configName;
|
|
6933
|
+
const resourceID = await application.getResourceID();
|
|
6932
6934
|
ConfigStorage.instance = new ConfigStorage();
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
ConfigStorage.instance.loadFormConfig(configName);
|
|
6937
|
-
ConfigStorage.instance.loadGridConfig(configName);
|
|
6938
|
-
});
|
|
6935
|
+
ConfigStorage.resourceID = resourceID;
|
|
6936
|
+
ConfigStorage.instance.loadFormConfig(configName);
|
|
6937
|
+
ConfigStorage.instance.loadGridConfig(configName);
|
|
6939
6938
|
}
|
|
6940
6939
|
}
|
|
6941
6940
|
return this.instance;
|
|
@@ -29,23 +29,42 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
29
29
|
if (open) {
|
|
30
30
|
this._closeCallback = resolve;
|
|
31
31
|
window.requestAnimationFrame(() => {
|
|
32
|
-
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer,
|
|
33
|
-
autoClose: true,
|
|
34
|
-
innerClickTest: this.innerClickCheck,
|
|
35
|
-
backClickListener: () => this.onDetailCloseCallback(),
|
|
36
|
-
left: this.getScrollOffset(),
|
|
37
|
-
useOverlay: true
|
|
38
|
-
});
|
|
32
|
+
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, this.getFloatOptions());
|
|
39
33
|
this._popover.show();
|
|
40
34
|
this.detailIsVisible = true;
|
|
41
35
|
});
|
|
42
36
|
}
|
|
43
37
|
});
|
|
44
38
|
}
|
|
45
|
-
|
|
39
|
+
updatePosition() {
|
|
40
|
+
if (this._floatingID == undefined) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
FloatingManager.updateFloatPosition(this._popover, this._popoverContainer, this.getFloatOptions());
|
|
44
|
+
}
|
|
45
|
+
getFloatOptions() {
|
|
46
|
+
return {
|
|
47
|
+
autoClose: true,
|
|
48
|
+
innerClickTest: this.innerClickCheck,
|
|
49
|
+
backClickListener: () => this.onDetailCloseCallback(),
|
|
50
|
+
left: this.getScrollOffsetLeft(),
|
|
51
|
+
top: this.getScrollOffsetTop(),
|
|
52
|
+
useOverlay: true,
|
|
53
|
+
isFixed: true
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
getScrollOffsetLeft() {
|
|
46
57
|
const padding = getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");
|
|
47
58
|
const rect = this._filterItemElement.getBoundingClientRect();
|
|
48
|
-
return `calc(${rect.
|
|
59
|
+
return `calc(${rect.x}px + ${padding})`;
|
|
60
|
+
}
|
|
61
|
+
getScrollOffsetTop() {
|
|
62
|
+
const rect = this._filterItemElement.getBoundingClientRect();
|
|
63
|
+
return (rect.y + rect.height) + "px";
|
|
64
|
+
}
|
|
65
|
+
controlScrollPage() {
|
|
66
|
+
window.removeEventListener("scroll", this.updatePosition.bind(this));
|
|
67
|
+
window.addEventListener("scroll", this.updatePosition.bind(this));
|
|
49
68
|
}
|
|
50
69
|
/**
|
|
51
70
|
* Oculta os detalhes de um item da lista.
|
|
@@ -150,6 +169,7 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
150
169
|
ElementIDUtils.addIDInfo(this._filterItemElement);
|
|
151
170
|
this._idSnkFilterDetail = `filterDetail_${this.config.id}`;
|
|
152
171
|
}
|
|
172
|
+
this.controlScrollPage();
|
|
153
173
|
}
|
|
154
174
|
componentDidRender() {
|
|
155
175
|
if (this._floatingID == undefined) {
|
|
@@ -38,15 +38,20 @@ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
38
38
|
this._showFormConfig = false;
|
|
39
39
|
}
|
|
40
40
|
loadConfig() {
|
|
41
|
+
if (this.configName == undefined) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
41
44
|
ConfigStorage.get()
|
|
42
|
-
.
|
|
43
|
-
.
|
|
44
|
-
|
|
45
|
-
this.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
.then((instance) => {
|
|
46
|
+
instance.loadFormConfig(this.configName)
|
|
47
|
+
.then((config) => {
|
|
48
|
+
if (!this.setConfig(config)) {
|
|
49
|
+
this.loadInsertionConfig();
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
.catch((error) => {
|
|
53
|
+
console.warn(error);
|
|
54
|
+
});
|
|
50
55
|
});
|
|
51
56
|
}
|
|
52
57
|
setConfig(config) {
|
|
@@ -12,7 +12,7 @@ import { d as defineCustomElement$4 } from './snk-filter-modal2.js';
|
|
|
12
12
|
import { d as defineCustomElement$3 } from './snk-grid-config2.js';
|
|
13
13
|
import { d as defineCustomElement$2 } from './snk-select-box2.js';
|
|
14
14
|
|
|
15
|
-
const snkGridCss = ".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--
|
|
15
|
+
const snkGridCss = ".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}";
|
|
16
16
|
|
|
17
17
|
const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
18
18
|
constructor() {
|
|
@@ -103,13 +103,18 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
103
103
|
this._gridConfig = config;
|
|
104
104
|
}
|
|
105
105
|
loadConfig() {
|
|
106
|
+
if (this.configName == undefined) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
106
109
|
ConfigStorage.get()
|
|
107
|
-
.
|
|
108
|
-
.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
.then((instance) => {
|
|
111
|
+
instance.loadGridConfig(this.configName)
|
|
112
|
+
.then((config) => {
|
|
113
|
+
this.setGridConfig(config);
|
|
114
|
+
})
|
|
115
|
+
.catch((error) => {
|
|
116
|
+
console.warn(error);
|
|
117
|
+
});
|
|
113
118
|
});
|
|
114
119
|
}
|
|
115
120
|
saveConfig(config) {
|
|
@@ -161,7 +166,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
161
166
|
if (!this._dataUnit) {
|
|
162
167
|
return undefined;
|
|
163
168
|
}
|
|
164
|
-
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-
|
|
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() }))));
|
|
165
170
|
}
|
|
166
171
|
get _element() { return this; }
|
|
167
172
|
static get style() { return snkGridCss; }
|
|
@@ -104,7 +104,6 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
104
104
|
super();
|
|
105
105
|
this.__registerHost();
|
|
106
106
|
this.actionClick = createEvent(this, "actionClick", 7);
|
|
107
|
-
this.actionChange = createEvent(this, "actionChange", 7);
|
|
108
107
|
this._titleKeyByElement = {
|
|
109
108
|
[TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
|
|
110
109
|
[TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
|
|
@@ -6925,17 +6925,16 @@ const CONFIG_SOURCE = {
|
|
|
6925
6925
|
grid: "grid"
|
|
6926
6926
|
};
|
|
6927
6927
|
class ConfigStorage {
|
|
6928
|
-
static get() {
|
|
6928
|
+
static async get() {
|
|
6929
6929
|
if (!ConfigStorage.instance) {
|
|
6930
6930
|
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
6931
6931
|
if (application != undefined) {
|
|
6932
|
+
const configName = application.configName;
|
|
6933
|
+
const resourceID = await application.getResourceID();
|
|
6932
6934
|
ConfigStorage.instance = new ConfigStorage();
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
ConfigStorage.instance.loadFormConfig(configName);
|
|
6937
|
-
ConfigStorage.instance.loadGridConfig(configName);
|
|
6938
|
-
});
|
|
6935
|
+
ConfigStorage.resourceID = resourceID;
|
|
6936
|
+
ConfigStorage.instance.loadFormConfig(configName);
|
|
6937
|
+
ConfigStorage.instance.loadGridConfig(configName);
|
|
6939
6938
|
}
|
|
6940
6939
|
}
|
|
6941
6940
|
return this.instance;
|