@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-kb-80398.0 → 0.0.0-bugfix-dev-KB-74406.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/{ContinuousInsertUtils-c27b439e.js → ClientSideExporterProvider-6b781452.js} +70 -1
- package/dist/cjs/IFetchDataExporterParams-e78ec415.js +8 -0
- package/dist/cjs/{index-1dfc7a6e.js → index-e3e39724.js} +5 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_5.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +8 -1
- package/dist/cjs/snk-attach.cjs.entry.js +2 -2
- package/dist/cjs/snk-crud.cjs.entry.js +2 -13
- package/dist/cjs/snk-data-exporter.cjs.entry.js +11 -14
- package/dist/cjs/snk-detail-view.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +3 -2
- package/dist/cjs/snk-grid.cjs.entry.js +16 -12
- package/dist/cjs/{snk-guides-viewer-bff0d27d.js → snk-guides-viewer-a029ff50.js} +2 -2
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +29 -83
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
- package/dist/cjs/{taskbar-elements-9ad1f9c0.js → taskbar-elements-7e19882d.js} +1 -1
- package/dist/collection/components/snk-application/snk-application.js +8 -1
- package/dist/collection/components/snk-crud/snk-crud.js +0 -11
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +3 -9
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +17 -5
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +7 -4
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +1 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +2 -2
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +1 -1
- package/dist/collection/components/snk-grid/snk-grid.css +6 -0
- package/dist/collection/components/snk-grid/snk-grid.js +30 -3
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +25 -8
- package/dist/collection/lib/@types/index.js +5 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.js +6 -1
- package/dist/components/ContinuousInsertUtils.js +70 -2
- package/dist/components/ISave.js +6 -1
- package/dist/components/snk-application2.js +8 -1
- package/dist/components/snk-crud.js +0 -11
- package/dist/components/snk-data-exporter2.js +17 -14
- package/dist/components/snk-filter-bar2.js +2 -2
- package/dist/components/snk-filter-item2.js +1 -0
- package/dist/components/snk-grid2.js +9 -5
- package/dist/components/snk-simple-crud2.js +10 -66
- package/dist/esm/{ContinuousInsertUtils-6bf78c5e.js → ClientSideExporterProvider-ff89c7e9.js} +70 -2
- package/dist/esm/IFetchDataExporterParams-d73bed3d.js +8 -0
- package/dist/esm/{index-3aa4977a.js → index-b40568ff.js} +6 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-grid_2.entry.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_5.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +8 -1
- package/dist/esm/snk-attach.entry.js +2 -2
- package/dist/esm/snk-crud.entry.js +2 -13
- package/dist/esm/snk-data-exporter.entry.js +11 -14
- package/dist/esm/snk-detail-view.entry.js +3 -3
- package/dist/esm/snk-filter-bar_4.entry.js +3 -2
- package/dist/esm/snk-grid.entry.js +10 -6
- package/dist/esm/{snk-guides-viewer-454ebc07.js → snk-guides-viewer-fa45714d.js} +2 -2
- package/dist/esm/snk-guides-viewer.entry.js +3 -3
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +12 -66
- package/dist/esm/snk-taskbar.entry.js +2 -2
- package/dist/esm/{taskbar-elements-d59867f1.js → taskbar-elements-d2353c64.js} +1 -1
- package/dist/sankhyablocks/{p-643b2aaa.entry.js → p-0b00d69c.entry.js} +1 -1
- package/dist/sankhyablocks/p-0f3698af.js +1 -0
- package/dist/sankhyablocks/{p-9a99c67b.entry.js → p-172848d4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ae26e8d0.entry.js → p-29d08446.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7e7a7473.js → p-3fc82614.js} +1 -1
- package/dist/sankhyablocks/p-40e323f9.js +1 -0
- package/dist/sankhyablocks/p-700a4cc3.entry.js +1 -0
- package/dist/sankhyablocks/p-8f3f2306.js +1 -0
- package/dist/sankhyablocks/{p-28ca3908.entry.js → p-a962a3e4.entry.js} +1 -1
- package/dist/sankhyablocks/p-aa1a0f3e.entry.js +1 -0
- package/dist/sankhyablocks/{p-73b037a8.entry.js → p-b02e58fd.entry.js} +1 -1
- package/dist/sankhyablocks/{p-50bf8dbc.entry.js → p-b0ff53b7.entry.js} +1 -1
- package/dist/sankhyablocks/{p-91e34755.entry.js → p-c82deea7.entry.js} +1 -1
- package/dist/sankhyablocks/{p-bd234604.entry.js → p-d2d0535f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-478ab2b6.js → p-de9da2f2.js} +1 -1
- package/dist/sankhyablocks/p-e10faff0.entry.js +11 -0
- package/dist/sankhyablocks/p-e36f89d1.entry.js +1 -0
- package/dist/sankhyablocks/p-fa0cf19c.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-data-exporter/data/export-result.d.ts +2 -1
- package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +0 -1
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +2 -1
- package/dist/types/components/snk-data-exporter/interfaces/IRecordID.d.ts +1 -0
- package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +3 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +5 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +1 -1
- package/dist/types/components.d.ts +11 -1
- package/dist/types/lib/@types/index.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +5 -1
- package/package.json +1 -1
- package/dist/sankhyablocks/p-03e6825e.js +0 -1
- package/dist/sankhyablocks/p-198c48c5.entry.js +0 -1
- package/dist/sankhyablocks/p-30cf616e.js +0 -1
- package/dist/sankhyablocks/p-6fc8bfa2.entry.js +0 -1
- package/dist/sankhyablocks/p-8ad7c8bc.entry.js +0 -1
- package/dist/sankhyablocks/p-a04f38aa.entry.js +0 -1
- package/dist/sankhyablocks/p-d9bb48c4.entry.js +0 -11
|
@@ -254,7 +254,7 @@ class SnkFilterModalFactory {
|
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:1fr minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--elevation--20, 20);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter-bar__title.sc-snk-filter-bar{max-width:260px;display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:16px;font-family:var(--font-pattern, Arial);font-weight:var(--text-weight--large, 600);color:var(--color--title-primary, #2B3A54);margin-top:
|
|
257
|
+
const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:1fr minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--elevation--20, 20);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter-bar__title.sc-snk-filter-bar{max-width:260px;display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:16px;font-family:var(--font-pattern, Arial);font-weight:var(--text-weight--large, 600);color:var(--color--title-primary, #2B3A54);margin-top:12px}[data-mode=\"hidden\"].sc-snk-filter-bar-h{width:0px;height:0px}[data-mode=\"button\"].sc-snk-filter-bar-h{grid-template-columns:1fr;width:fit-content}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.filter-bar__personalized-filter.sc-snk-filter-bar{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;z-index:var(--snk-personalized-filter--z-index);background-color:var(--snk-personalized-filter--background-color)}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__scroller.sc-snk-filter-bar{height:calc(100% + var(--space-extra-small, 0px))}.snk-filter-bar__filter-item-container.sc-snk-filter-bar{display:flex;align-items:start}.snk-filter-bar__scroller.sc-snk-filter-bar .sc-snk-filter-bar:first-child{margin-left:var(--space-extra-small, 3px)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}";
|
|
258
258
|
|
|
259
259
|
const SnkFilterBar = class {
|
|
260
260
|
constructor(hostRef) {
|
|
@@ -735,7 +735,7 @@ const SnkFilterBar = class {
|
|
|
735
735
|
if (this.mode !== "regular") {
|
|
736
736
|
return (index$1.h(index$1.Host, { "data-mode": this.mode }, this.getPersonalizedFilterVariableItems(), this.mode === 'button' && (index$1.h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }))));
|
|
737
737
|
}
|
|
738
|
-
return (index$1.h(index$1.Host, null, index$1.h("div", null, index$1.h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), index$1.h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, index$1.h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), index$1.h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, index$1.h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
|
|
738
|
+
return (index$1.h(index$1.Host, null, index$1.h("div", null, index$1.h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), index$1.h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, index$1.h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), index$1.h("ez-button", { class: "ez-padding-left--medium ez-margin-top--extra-small", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, index$1.h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
|
|
739
739
|
}
|
|
740
740
|
get _element() { return index$1.getElement(this); }
|
|
741
741
|
static get watchers() { return {
|
|
@@ -772,6 +772,7 @@ const SnkFilterItem = class {
|
|
|
772
772
|
this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
|
|
773
773
|
if (open) {
|
|
774
774
|
this._closeCallback = resolve;
|
|
775
|
+
this._chipElement.blur();
|
|
775
776
|
window.requestAnimationFrame(() => {
|
|
776
777
|
this._floatingID = core.FloatingManager.float(this._popover, this._popoverContainer, this.getFloatOptions());
|
|
777
778
|
this._popover.show();
|
|
@@ -4,12 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const taskbarElements = require('./taskbar-elements-
|
|
7
|
+
const taskbarElements = require('./taskbar-elements-7e19882d.js');
|
|
8
8
|
const ConfigStorage = require('./ConfigStorage-d024aec8.js');
|
|
9
|
-
const index$1 = require('./index-
|
|
9
|
+
const index$1 = require('./index-e3e39724.js');
|
|
10
10
|
const fieldSearch = require('./field-search-68e34bf4.js');
|
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
|
12
|
-
const
|
|
12
|
+
const ClientSideExporterProvider = require('./ClientSideExporterProvider-6b781452.js');
|
|
13
13
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
|
14
14
|
require('./DataFetcher-65879b2c.js');
|
|
15
15
|
require('./pesquisa-fetcher-5c583c93.js');
|
|
@@ -22,12 +22,13 @@ require('./form-config-fetcher-90126e4c.js');
|
|
|
22
22
|
require('./constants-241934b3.js');
|
|
23
23
|
const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
|
24
24
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
|
25
|
+
require('./IFetchDataExporterParams-e78ec415.js');
|
|
25
26
|
require('./PrintUtils-bcaeb82f.js');
|
|
26
27
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
27
28
|
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
|
28
29
|
require('./ResourceIDUtils-5ff86aa7.js');
|
|
29
30
|
|
|
30
|
-
class ServerSideExporterProvider extends
|
|
31
|
+
class ServerSideExporterProvider extends ClientSideExporterProvider.CommonsExporter {
|
|
31
32
|
getFilters() {
|
|
32
33
|
var _a;
|
|
33
34
|
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getAppliedFilters();
|
|
@@ -81,7 +82,7 @@ class ServerSideExporterProvider extends ContinuousInsertUtils.CommonsExporter {
|
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
|
|
84
|
-
const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px;--snk-grid-padding:var(--space--small)}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%;padding:var(--snk-grid-padding)}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:var(--snk-grid-min-height)}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
|
|
85
|
+
const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px;--snk-grid-padding:var(--space--small)}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%;padding:var(--snk-grid-padding)}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:var(--snk-grid-min-height)}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}.snk-grid-container__footer.sc-snk-grid{background-color:var(--background--xlight, #FFF);border-radius:0 0 var(--border--radius-medium) var(--border--radius-medium);box-shadow:var(--shadow--small)}";
|
|
85
86
|
|
|
86
87
|
const SnkGrid = class {
|
|
87
88
|
constructor(hostRef) {
|
|
@@ -123,7 +124,7 @@ const SnkGrid = class {
|
|
|
123
124
|
this._popUpGridConfig = false;
|
|
124
125
|
this._showSnkFilterBar = true;
|
|
125
126
|
this._enableContinuousInsert = false;
|
|
126
|
-
this.columnFilterDataSource = new
|
|
127
|
+
this.columnFilterDataSource = new ClientSideExporterProvider.SnkMultiSelectionListDataSource();
|
|
127
128
|
this.enableLockManagerLoadingComp = false;
|
|
128
129
|
this.enableLockManagerTaskbarClick = false;
|
|
129
130
|
this.configName = undefined;
|
|
@@ -150,6 +151,7 @@ const SnkGrid = class {
|
|
|
150
151
|
this.autoFocus = true;
|
|
151
152
|
this.enableGridInsert = false;
|
|
152
153
|
this.outlineMode = false;
|
|
154
|
+
this.strategyExporter = index$1.ExporterStrategy.SERVER_SIDE;
|
|
153
155
|
}
|
|
154
156
|
reloadConfig() {
|
|
155
157
|
this.loadConfig();
|
|
@@ -283,7 +285,7 @@ const SnkGrid = class {
|
|
|
283
285
|
}
|
|
284
286
|
setGridConfig(config) {
|
|
285
287
|
this._gridConfig = config;
|
|
286
|
-
|
|
288
|
+
ClientSideExporterProvider.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
|
287
289
|
}
|
|
288
290
|
fixColumNameCharset(columnName) {
|
|
289
291
|
try {
|
|
@@ -329,7 +331,9 @@ const SnkGrid = class {
|
|
|
329
331
|
evt.stopPropagation();
|
|
330
332
|
}
|
|
331
333
|
async dataExporterProviderStore() {
|
|
332
|
-
const dataExporterProvider =
|
|
334
|
+
const dataExporterProvider = this.strategyExporter === index$1.ExporterStrategy.SERVER_SIDE
|
|
335
|
+
? new ServerSideExporterProvider(this._dataUnit, this._grid)
|
|
336
|
+
: new ClientSideExporterProvider.ClientSideExporterProvider(this._dataUnit, this._grid);
|
|
333
337
|
index$2.store.set("exporterProviders", Object.assign(Object.assign({}, index$2.store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
|
|
334
338
|
}
|
|
335
339
|
addElementID() {
|
|
@@ -353,7 +357,7 @@ const SnkGrid = class {
|
|
|
353
357
|
}
|
|
354
358
|
finishLoading() {
|
|
355
359
|
this._dataUnit.addInterceptor(this.dataUnitInterceptor);
|
|
356
|
-
|
|
360
|
+
ClientSideExporterProvider.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
|
357
361
|
this.addElementID();
|
|
358
362
|
if (this.columnFilterDataSource != undefined) {
|
|
359
363
|
this.columnFilterDataSource.setApplication(this._application);
|
|
@@ -408,10 +412,10 @@ const SnkGrid = class {
|
|
|
408
412
|
}
|
|
409
413
|
parent = parent.parentElement;
|
|
410
414
|
}
|
|
411
|
-
this._rmPrecisionCustomValueFormatter = new
|
|
415
|
+
this._rmPrecisionCustomValueFormatter = new ClientSideExporterProvider.RmPrecisionCustomValueFormatter();
|
|
412
416
|
this.addGridLegacyConfigName();
|
|
413
417
|
this.loadConfig();
|
|
414
|
-
this._continuousInsertUtils = new
|
|
418
|
+
this._continuousInsertUtils = new ClientSideExporterProvider.ContinuousInsertUtils(this._application, this.resourceID, this.configName);
|
|
415
419
|
if (this.enableGridInsert) {
|
|
416
420
|
this._continuousInsertUtils.getConfig().then(value => this._enableContinuousInsert = value);
|
|
417
421
|
}
|
|
@@ -555,7 +559,7 @@ const SnkGrid = class {
|
|
|
555
559
|
return undefined;
|
|
556
560
|
}
|
|
557
561
|
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--extra-small" }, this._showSnkFilterBar &&
|
|
558
|
-
index.h(index.Fragment, null, index.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 }), 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, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
562
|
+
index.h(index.Fragment, null, index.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 }), 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, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
559
563
|
}
|
|
560
564
|
get _element() { return index.getElement(this); }
|
|
561
565
|
static get watchers() { return {
|
|
@@ -5,11 +5,11 @@ const core = require('@sankhyalabs/core');
|
|
|
5
5
|
const SnkFormConfigManager = require('./SnkFormConfigManager-c11d8468.js');
|
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
7
7
|
const fieldSearch = require('./field-search-68e34bf4.js');
|
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
|
8
|
+
const taskbarElements = require('./taskbar-elements-7e19882d.js');
|
|
9
9
|
const constants = require('./constants-241934b3.js');
|
|
10
10
|
require('./DataFetcher-65879b2c.js');
|
|
11
11
|
require('./pesquisa-fetcher-5c583c93.js');
|
|
12
|
-
const index$1 = require('./index-
|
|
12
|
+
const index$1 = require('./index-e3e39724.js');
|
|
13
13
|
require('./ISave-e91b70a7.js');
|
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
15
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-a029ff50.js');
|
|
6
6
|
require('./index-f9e81701.js');
|
|
7
7
|
require('@sankhyalabs/core');
|
|
8
8
|
require('./SnkFormConfigManager-c11d8468.js');
|
|
@@ -15,8 +15,8 @@ require('./filter-item-type.enum-a7ffdaa6.js');
|
|
|
15
15
|
require('./constants-241934b3.js');
|
|
16
16
|
require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
17
17
|
require('./field-search-68e34bf4.js');
|
|
18
|
-
require('./taskbar-elements-
|
|
19
|
-
require('./index-
|
|
18
|
+
require('./taskbar-elements-7e19882d.js');
|
|
19
|
+
require('./index-e3e39724.js');
|
|
20
20
|
require('./index-102ba62d.js');
|
|
21
21
|
require('./pesquisa-fetcher-5c583c93.js');
|
|
22
22
|
require('./ISave-e91b70a7.js');
|
|
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
|
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const pesquisaFetcher = require('./pesquisa-fetcher-5c583c93.js');
|
|
8
8
|
require('./DataFetcher-65879b2c.js');
|
|
9
|
-
require('./index-
|
|
9
|
+
require('./index-e3e39724.js');
|
|
10
10
|
require('./ISave-e91b70a7.js');
|
|
11
11
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
12
12
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index
|
|
5
|
+
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
8
|
const constants = require('./constants-241934b3.js');
|
|
9
|
-
const taskbarElements = require('./taskbar-elements-
|
|
9
|
+
const taskbarElements = require('./taskbar-elements-7e19882d.js');
|
|
10
10
|
require('./DataFetcher-65879b2c.js');
|
|
11
11
|
require('./pesquisa-fetcher-5c583c93.js');
|
|
12
|
-
const
|
|
13
|
-
const index = require('./index-
|
|
12
|
+
const ClientSideExporterProvider = require('./ClientSideExporterProvider-6b781452.js');
|
|
13
|
+
const index$1 = require('./index-e3e39724.js');
|
|
14
14
|
require('./ISave-e91b70a7.js');
|
|
15
15
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
16
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
@@ -20,10 +20,11 @@ const formConfigFetcher = require('./form-config-fetcher-90126e4c.js');
|
|
|
20
20
|
const fieldSearch = require('./field-search-68e34bf4.js');
|
|
21
21
|
const ConfigStorage = require('./ConfigStorage-d024aec8.js');
|
|
22
22
|
const SnkFormConfigManager = require('./SnkFormConfigManager-c11d8468.js');
|
|
23
|
-
const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
|
24
23
|
const index$2 = require('./index-102ba62d.js');
|
|
25
24
|
require('./PrintUtils-bcaeb82f.js');
|
|
26
25
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
|
26
|
+
require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
|
27
|
+
require('./IFetchDataExporterParams-e78ec415.js');
|
|
27
28
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
28
29
|
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
|
29
30
|
require('./ResourceIDUtils-5ff86aa7.js');
|
|
@@ -31,73 +32,18 @@ require('./ResourceIDUtils-5ff86aa7.js');
|
|
|
31
32
|
const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
|
|
32
33
|
const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
|
|
33
34
|
|
|
34
|
-
class ClientSideExporterProvider extends ContinuousInsertUtils.CommonsExporter {
|
|
35
|
-
getSelectedNumber() {
|
|
36
|
-
return this.dataUnit.getSelectionInfo().length;
|
|
37
|
-
}
|
|
38
|
-
getTotalRecords() {
|
|
39
|
-
var _a, _b, _c;
|
|
40
|
-
const { total } = ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
|
|
41
|
-
return total !== null && total !== void 0 ? total : (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
|
|
42
|
-
}
|
|
43
|
-
getSelectedIDs() {
|
|
44
|
-
return GetSelectedRecordsIDsInfo.getSelectedRecordsIDsInfo(this.dataUnit);
|
|
45
|
-
}
|
|
46
|
-
getRecordID() {
|
|
47
|
-
var _a, _b, _c;
|
|
48
|
-
return (_c = (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
|
49
|
-
}
|
|
50
|
-
async getRecords() {
|
|
51
|
-
if (this.dataUnit.records.length === 0) {
|
|
52
|
-
return Promise.resolve([]);
|
|
53
|
-
}
|
|
54
|
-
const selectionInfo = this.dataUnit.getSelectionInfo();
|
|
55
|
-
const records = selectionInfo.isEmpty() || selectionInfo.isAllRecords() ? await selectionInfo.getAllRecords() : selectionInfo.records;
|
|
56
|
-
return Promise.resolve(records == undefined ? [] : records);
|
|
57
|
-
}
|
|
58
|
-
getHiddenOptions() {
|
|
59
|
-
return [
|
|
60
|
-
index.DataExporterOption.EXPORT_BY_EMAIL,
|
|
61
|
-
index.DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
|
62
|
-
index.DataExporterOption.EXPORT_XLS_TO_EMAIL,
|
|
63
|
-
index.DataExporterOption.EXPORT_PAGE_TO_PDF,
|
|
64
|
-
index.DataExporterOption.EXPORT_PAGE_TO_XLS
|
|
65
|
-
];
|
|
66
|
-
}
|
|
67
|
-
formatValue(record, column) {
|
|
68
|
-
const { id, descriptionFrom } = column;
|
|
69
|
-
const value = record[descriptionFrom || id];
|
|
70
|
-
if (value == undefined) {
|
|
71
|
-
return "";
|
|
72
|
-
}
|
|
73
|
-
if (descriptionFrom != undefined) {
|
|
74
|
-
return value.label;
|
|
75
|
-
}
|
|
76
|
-
const fieldDescriptor = this.dataUnit.getField(id);
|
|
77
|
-
if (fieldDescriptor.userInterface === core.UserInterface.SEARCH) {
|
|
78
|
-
return value.value;
|
|
79
|
-
}
|
|
80
|
-
if (column.customFormatter) {
|
|
81
|
-
const ezGridColumn = this.getColumnsState().find(columnState => column.id === columnState.name);
|
|
82
|
-
const formattedValue = column.customFormatter.format(value, ezGridColumn, record.__record__id__);
|
|
83
|
-
return formattedValue;
|
|
84
|
-
}
|
|
85
|
-
return this.dataUnit.getFormattedValue(id, value);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
35
|
const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid__container--shadow--outline:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
|
|
90
36
|
|
|
91
37
|
const SnkSimpleCrud = class {
|
|
92
38
|
constructor(hostRef) {
|
|
93
|
-
index
|
|
94
|
-
this.dataStateChange = index
|
|
95
|
-
this.dataUnitReady = index
|
|
96
|
-
this.actionClick = index
|
|
97
|
-
this.formItemsReady = index
|
|
98
|
-
this.configuratorSave = index
|
|
99
|
-
this.configuratorCancel = index
|
|
100
|
-
this._multiSelectionListDataSource = new
|
|
39
|
+
index.registerInstance(this, hostRef);
|
|
40
|
+
this.dataStateChange = index.createEvent(this, "dataStateChange", 3);
|
|
41
|
+
this.dataUnitReady = index.createEvent(this, "dataUnitReady", 3);
|
|
42
|
+
this.actionClick = index.createEvent(this, "actionClick", 7);
|
|
43
|
+
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
|
44
|
+
this.configuratorSave = index.createEvent(this, "configuratorSave", 7);
|
|
45
|
+
this.configuratorCancel = index.createEvent(this, "configuratorCancel", 7);
|
|
46
|
+
this._multiSelectionListDataSource = new ClientSideExporterProvider.SnkMultiSelectionListDataSource();
|
|
101
47
|
this._keyDownHandler = (event) => this.keyDownListener(event);
|
|
102
48
|
this._formConfigFetcher = new formConfigFetcher.FormConfigFetcher();
|
|
103
49
|
this._customEditors = new Map();
|
|
@@ -124,7 +70,7 @@ const SnkSimpleCrud = class {
|
|
|
124
70
|
this.formConfig = undefined;
|
|
125
71
|
this._formFields = [];
|
|
126
72
|
this._fieldsProps = new Map();
|
|
127
|
-
this.
|
|
73
|
+
this.enableContinuousInsert = false;
|
|
128
74
|
this.multipleSelection = undefined;
|
|
129
75
|
this.useCancelConfirm = true;
|
|
130
76
|
this.pageSize = 150;
|
|
@@ -408,10 +354,10 @@ const SnkSimpleCrud = class {
|
|
|
408
354
|
this.processMetadata();
|
|
409
355
|
this.onModeChange();
|
|
410
356
|
this.configDatasource();
|
|
411
|
-
this._rmPrecisionCustomValueFormatter = new
|
|
412
|
-
this._continuousInsertUtils = new
|
|
357
|
+
this._rmPrecisionCustomValueFormatter = new ClientSideExporterProvider.RmPrecisionCustomValueFormatter();
|
|
358
|
+
this._continuousInsertUtils = new ClientSideExporterProvider.ContinuousInsertUtils(this.application, this.resolveResourceID(), this.configName);
|
|
413
359
|
if (this.enableGridInsert) {
|
|
414
|
-
this._continuousInsertUtils.getConfig().then(value => this.
|
|
360
|
+
this._continuousInsertUtils.getConfig().then(value => this.enableContinuousInsert = value);
|
|
415
361
|
}
|
|
416
362
|
}
|
|
417
363
|
componentDidLoad() {
|
|
@@ -663,9 +609,9 @@ const SnkSimpleCrud = class {
|
|
|
663
609
|
: this.getFieldSearch(actionButton, item)
|
|
664
610
|
}];
|
|
665
611
|
if (this.enableGridInsert) {
|
|
666
|
-
hardList.push(this._continuousInsertUtils.actionContinuousInsert(this.
|
|
667
|
-
this.
|
|
668
|
-
this._continuousInsertUtils.handleSaveConfig(this.
|
|
612
|
+
hardList.push(this._continuousInsertUtils.actionContinuousInsert(this.enableContinuousInsert, () => {
|
|
613
|
+
this.enableContinuousInsert = !this.enableContinuousInsert;
|
|
614
|
+
this._continuousInsertUtils.handleSaveConfig(this.enableContinuousInsert);
|
|
669
615
|
}));
|
|
670
616
|
}
|
|
671
617
|
if (this.isGridInsertActive())
|
|
@@ -680,8 +626,8 @@ const SnkSimpleCrud = class {
|
|
|
680
626
|
}
|
|
681
627
|
getTopTaskBarId() {
|
|
682
628
|
var _a;
|
|
683
|
-
return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${index.PresentationMode.PRIMARY}` :
|
|
684
|
-
`snkGridTopTaskbar.regular${index.PresentationMode.PRIMARY}`;
|
|
629
|
+
return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${index$1.PresentationMode.PRIMARY}` :
|
|
630
|
+
`snkGridTopTaskbar.regular${index$1.PresentationMode.PRIMARY}`;
|
|
685
631
|
}
|
|
686
632
|
async keyDownListener(event) {
|
|
687
633
|
if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
|
|
@@ -744,7 +690,7 @@ const SnkSimpleCrud = class {
|
|
|
744
690
|
if (this._grid == undefined) {
|
|
745
691
|
return;
|
|
746
692
|
}
|
|
747
|
-
const dataExporterProvider = new ClientSideExporterProvider(this.dataUnit, this._grid);
|
|
693
|
+
const dataExporterProvider = new ClientSideExporterProvider.ClientSideExporterProvider(this.dataUnit, this._grid);
|
|
748
694
|
index$2.store.set("exporterProviders", Object.assign(Object.assign({}, index$2.store.get("exporterProviders")), { [this.getDataExporterStoreKey()]: dataExporterProvider }));
|
|
749
695
|
}
|
|
750
696
|
getDataExporterStoreKey() {
|
|
@@ -752,7 +698,7 @@ const SnkSimpleCrud = class {
|
|
|
752
698
|
}
|
|
753
699
|
setGridConfig(config) {
|
|
754
700
|
this.gridConfig = config;
|
|
755
|
-
|
|
701
|
+
ClientSideExporterProvider.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
|
|
756
702
|
}
|
|
757
703
|
setFormConfig(config, forceUpdate) {
|
|
758
704
|
if (this.formConfig && !forceUpdate)
|
|
@@ -823,7 +769,7 @@ const SnkSimpleCrud = class {
|
|
|
823
769
|
}
|
|
824
770
|
renderTaskbarContent() {
|
|
825
771
|
var _a;
|
|
826
|
-
return (index
|
|
772
|
+
return (index.h("snk-taskbar", { class: this._currentViewMode === constants.VIEW_MODE.FORM && `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow-xsmall'} ez-padding--small`, dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
|
|
827
773
|
}
|
|
828
774
|
/* istanbul ignore next */
|
|
829
775
|
render() {
|
|
@@ -831,11 +777,11 @@ const SnkSimpleCrud = class {
|
|
|
831
777
|
if (this.dataUnit == undefined) {
|
|
832
778
|
return;
|
|
833
779
|
}
|
|
834
|
-
return (index
|
|
780
|
+
return (index.h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow'} simple-crud__container-section` }, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
835
781
|
? undefined
|
|
836
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this.
|
|
782
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this.enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, this.renderTaskbarContent(), index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, this.renderTaskbarContent(), index.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), index.h("snk-simple-form-config", { ref: (ref) => this._snkSimpleFormConfig = ref, dataUnit: this.dataUnit, onSnkConfigSaved: this.handleFormConfigSaved.bind(this), configName: (_a = this.formLegacyConfigName) !== null && _a !== void 0 ? _a : this.configName })), this.messagesBuilder && index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index.h("div", { id: `${this._customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }))), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
|
837
783
|
}
|
|
838
|
-
get _element() { return index
|
|
784
|
+
get _element() { return index.getElement(this); }
|
|
839
785
|
static get watchers() { return {
|
|
840
786
|
"resourceID": ["handleResourceIDChanged"],
|
|
841
787
|
"entityName": ["onChangeEntityName"],
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
|
9
|
-
const index$1 = require('./index-
|
|
8
|
+
const taskbarElements = require('./taskbar-elements-7e19882d.js');
|
|
9
|
+
const index$1 = require('./index-e3e39724.js');
|
|
10
10
|
require('./index-102ba62d.js');
|
|
11
11
|
|
|
12
12
|
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex;flex-wrap:wrap}.no-wrap.sc-snk-taskbar-h{flex-wrap:nowrap}.full-width.sc-snk-taskbar-h{width:100%}.align-right.sc-snk-taskbar-h{justify-content:flex-end}.overflowed.sc-snk-taskbar{display:none}";
|
|
@@ -176,7 +176,14 @@ export class SnkApplication {
|
|
|
176
176
|
const allAccess = {};
|
|
177
177
|
allAccess['isSup'] = auths.isSup;
|
|
178
178
|
Object.entries(AutorizationType).forEach((data) => {
|
|
179
|
-
|
|
179
|
+
if (data[1] === AutorizationType.CLONE) {
|
|
180
|
+
const insertPermission = auths.actions[AutorizationType.INSERT] || false;
|
|
181
|
+
const clonePermission = auths.actions[AutorizationType.CLONE] || false;
|
|
182
|
+
allAccess[data[0]] = insertPermission && clonePermission;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
allAccess[data[0]] = auths.actions[data[1]] || false;
|
|
186
|
+
}
|
|
180
187
|
});
|
|
181
188
|
resolve(allAccess);
|
|
182
189
|
}).catch(error => reject(error));
|
|
@@ -297,15 +297,6 @@ export class SnkCrud {
|
|
|
297
297
|
.bind("F8", handleAddRecord.bind(this), { description: "Adiciona um novo registro.", element: this._element })
|
|
298
298
|
.bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
|
|
299
299
|
.bind("ctrl + F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
|
|
300
|
-
.bind("ctrl + .", () => {
|
|
301
|
-
if (dataUnit.getSelectionInfo().records.length === 0) {
|
|
302
|
-
return dataUnit.selectFirst();
|
|
303
|
-
}
|
|
304
|
-
return dataUnit.nextRecord();
|
|
305
|
-
}, {
|
|
306
|
-
description: "Avança para o próximo registro.", element: this._element
|
|
307
|
-
})
|
|
308
|
-
.bind("ctrl + ,", dataUnit.previousRecord.bind(dataUnit), { description: "Retorna ao registro anterior.", element: this._element })
|
|
309
300
|
.bind("F5", async () => {
|
|
310
301
|
const currentView = await this._viewStack.getSelectedIndex();
|
|
311
302
|
if (VIEW_MODE.GRID === currentView) {
|
|
@@ -333,8 +324,6 @@ export class SnkCrud {
|
|
|
333
324
|
.unbind("F8")
|
|
334
325
|
.unbind("F9")
|
|
335
326
|
.unbind("ctrl + F9")
|
|
336
|
-
.unbind("ctrl + .")
|
|
337
|
-
.unbind("ctrl + ,")
|
|
338
327
|
.unbind("F5")
|
|
339
328
|
.unbind("Escape");
|
|
340
329
|
}
|
package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js
CHANGED
|
@@ -10,17 +10,11 @@ export default class ClientSideExporterStrategy {
|
|
|
10
10
|
const visibleColumns = getVisibleColumns(columns);
|
|
11
11
|
return visibleColumns;
|
|
12
12
|
}
|
|
13
|
-
async getColumns(resolveProps) {
|
|
14
|
-
var _a;
|
|
15
|
-
if ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) {
|
|
16
|
-
return await this.getParsedColumns();
|
|
17
|
-
}
|
|
18
|
-
return await this._provider.getColumnsMetadata();
|
|
19
|
-
}
|
|
20
13
|
async executeExport(resolveProps) {
|
|
14
|
+
var _a;
|
|
21
15
|
const { methodName, gridTitle } = resolveProps;
|
|
22
|
-
const records = await this._provider.getRecords();
|
|
23
|
-
const columns = await this.
|
|
16
|
+
const records = await this._provider.getRecords(resolveProps.type);
|
|
17
|
+
const columns = ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
|
24
18
|
const [serviceName, processor] = this.getExecutor(methodName);
|
|
25
19
|
const payload = {
|
|
26
20
|
serviceName,
|
package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js
CHANGED
|
@@ -2,6 +2,7 @@ import { CommonsExporter } from "../interfaces/IExporterProvider";
|
|
|
2
2
|
import { UserInterface } from "@sankhyalabs/core";
|
|
3
3
|
import { getSelectedRecordsIDsInfo as getSelectedIDs } from '../../../lib/utils/GetSelectedRecordsIDsInfo';
|
|
4
4
|
import { DataExporterOption } from "../../../lib/@types";
|
|
5
|
+
import { IExportType } from "../../../lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams";
|
|
5
6
|
export default class ClientSideExporterProvider extends CommonsExporter {
|
|
6
7
|
getSelectedNumber() {
|
|
7
8
|
return this.dataUnit.getSelectionInfo().length;
|
|
@@ -18,13 +19,24 @@ export default class ClientSideExporterProvider extends CommonsExporter {
|
|
|
18
19
|
var _a, _b, _c;
|
|
19
20
|
return (_c = (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
|
20
21
|
}
|
|
21
|
-
async getRecords() {
|
|
22
|
-
if (this.dataUnit.records.length === 0)
|
|
23
|
-
return
|
|
22
|
+
async getRecords(exportType) {
|
|
23
|
+
if (this.dataUnit.records.length === 0)
|
|
24
|
+
return [];
|
|
25
|
+
switch (exportType) {
|
|
26
|
+
case IExportType.ALL:
|
|
27
|
+
return this.dataUnit.getSelectionInfo().getAllRecords();
|
|
28
|
+
case IExportType.SELECTION:
|
|
29
|
+
return this.resolveRecordsFromSelection();
|
|
30
|
+
case IExportType.PAGE:
|
|
31
|
+
return this.dataUnit.records;
|
|
32
|
+
default:
|
|
33
|
+
return this.resolveRecordsFromSelection();
|
|
24
34
|
}
|
|
35
|
+
}
|
|
36
|
+
resolveRecordsFromSelection() {
|
|
25
37
|
const selectionInfo = this.dataUnit.getSelectionInfo();
|
|
26
|
-
const
|
|
27
|
-
return
|
|
38
|
+
const selectionRecords = selectionInfo.isEmpty() || selectionInfo.isAllRecords() ? selectionInfo.getAllRecords() : selectionInfo.records;
|
|
39
|
+
return selectionRecords.length ? selectionRecords : this.dataUnit.records;
|
|
28
40
|
}
|
|
29
41
|
getHiddenOptions() {
|
|
30
42
|
return [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ApplicationContext, DataType, ElementIDUtils } from '@sankhyalabs/core';
|
|
2
2
|
import { h, Host } from '@stencil/core';
|
|
3
3
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
|
+
import { IExportType } from '../../lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams';
|
|
4
5
|
import { ItemBuilder } from './structure/ItemBuilder';
|
|
5
6
|
import { DataExporterFormat, DataExporterOption, DataExporterType } from '../../lib/@types';
|
|
6
7
|
import { REPORT_LAUNCHER_RESOURCE_ID } from '../../lib/utils/constants';
|
|
@@ -105,7 +106,9 @@ export class SnkDataExporter {
|
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
108
|
getExporterStrategy() {
|
|
108
|
-
return this.provider.getRecords == undefined
|
|
109
|
+
return this.provider.getRecords == undefined
|
|
110
|
+
? new ServerSideExporterStrategy(this.provider)
|
|
111
|
+
: new ClientSideExporterStrategy(this.provider);
|
|
109
112
|
}
|
|
110
113
|
getOptionKey(option) {
|
|
111
114
|
return Object.keys(DataExporterOption)
|
|
@@ -115,12 +118,12 @@ export class SnkDataExporter {
|
|
|
115
118
|
}
|
|
116
119
|
getExportType(option) {
|
|
117
120
|
if (option === DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF || option === DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS) {
|
|
118
|
-
return
|
|
121
|
+
return IExportType.ALL;
|
|
119
122
|
}
|
|
120
123
|
if (option === DataExporterOption.EXPORT_PAGE_TO_PDF || option === DataExporterOption.EXPORT_PAGE_TO_XLS) {
|
|
121
|
-
return
|
|
124
|
+
return IExportType.PAGE;
|
|
122
125
|
}
|
|
123
|
-
return
|
|
126
|
+
return IExportType.SELECTION;
|
|
124
127
|
}
|
|
125
128
|
async dispatchExporter(option) {
|
|
126
129
|
var _a, _b, _c;
|
|
@@ -27,6 +27,7 @@ export class SnkFilterItem {
|
|
|
27
27
|
this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
|
|
28
28
|
if (open) {
|
|
29
29
|
this._closeCallback = resolve;
|
|
30
|
+
this._chipElement.blur();
|
|
30
31
|
window.requestAnimationFrame(() => {
|
|
31
32
|
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, this.getFloatOptions());
|
|
32
33
|
this._popover.show();
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
font-family: var(--font-pattern, Arial);
|
|
19
19
|
font-weight: var(--text-weight--large, 600);
|
|
20
20
|
color: var(--color--title-primary, #2B3A54);
|
|
21
|
-
margin-top:
|
|
21
|
+
margin-top: 12px;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
:host([data-mode="hidden"]) {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
.snk-filter-bar__scroller {
|
|
103
|
-
height: calc(100% + var(--space-extra-small,
|
|
103
|
+
height: calc(100% + var(--space-extra-small, 0px));
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
.snk-filter-bar__filter-item-container {
|