@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-81085.0 → 0.0.0-bugfix-dev-kb-80398.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-aa63f0a9.js → ContinuousInsertUtils-c27b439e.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-c32fdff7.js → dataunit-fetcher-8291ac21.js} +21 -7
- 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 +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-attach.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +1 -1
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-2c7c1964.js → snk-data-unit-d75e6220.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +6 -6
- package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +19 -5
- package/dist/cjs/{snk-guides-viewer-c1c56eca.js → snk-guides-viewer-bff0d27d.js} +1 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +2 -2
- package/dist/cjs/snk-pesquisa.cjs.entry.js +2 -2
- package/dist/cjs/snk-simple-crud.cjs.entry.js +8 -8
- package/dist/collection/components/snk-configurator/snk-configurator.css +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +3 -3
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +3 -3
- package/dist/collection/components/snk-grid/snk-grid.js +17 -3
- package/dist/collection/components/snk-grid-config/snk-grid-config.css +1 -1
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +1 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +8 -25
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +21 -7
- package/dist/components/dataunit-fetcher.js +21 -7
- package/dist/components/snk-configurator2.js +1 -1
- package/dist/components/snk-filter-bar2.js +3 -3
- package/dist/components/snk-filter-item2.js +3 -3
- package/dist/components/snk-filter-number.js +1 -1
- package/dist/components/snk-grid-config2.js +1 -1
- package/dist/components/snk-grid2.js +17 -3
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/snk-simple-crud2.js +7 -7
- package/dist/esm/{ContinuousInsertUtils-af683684.js → ContinuousInsertUtils-6bf78c5e.js} +1 -1
- package/dist/esm/{dataunit-fetcher-26c2bed4.js → dataunit-fetcher-5247a708.js} +21 -7
- 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 +2 -2
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-attach.entry.js +1 -1
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +1 -1
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-a36df23f.js → snk-data-unit-bfd10c71.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +2 -2
- package/dist/esm/snk-filter-bar_4.entry.js +6 -6
- package/dist/esm/snk-filter-number.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +19 -5
- package/dist/esm/{snk-guides-viewer-2b96b7f7.js → snk-guides-viewer-454ebc07.js} +1 -1
- package/dist/esm/snk-guides-viewer.entry.js +2 -2
- package/dist/esm/snk-pesquisa.entry.js +2 -2
- package/dist/esm/snk-simple-crud.entry.js +8 -8
- package/dist/sankhyablocks/{p-15f5f702.js → p-03e6825e.js} +1 -1
- package/dist/sankhyablocks/{p-edbe8e15.entry.js → p-198c48c5.entry.js} +1 -1
- package/dist/sankhyablocks/p-38179225.js +60 -0
- package/dist/sankhyablocks/{p-c6aefba8.js → p-478ab2b6.js} +1 -1
- package/dist/sankhyablocks/{p-f4ceb72c.entry.js → p-4c9adf1c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-d5687306.entry.js → p-50bf8dbc.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7d0627f4.entry.js → p-643b2aaa.entry.js} +1 -1
- package/dist/sankhyablocks/{p-70ae0779.js → p-655bdd60.js} +1 -1
- package/dist/sankhyablocks/p-6fc8bfa2.entry.js +1 -0
- package/dist/sankhyablocks/{p-80dd8976.entry.js → p-73b037a8.entry.js} +1 -1
- package/dist/sankhyablocks/p-79f823f3.entry.js +1 -0
- package/dist/sankhyablocks/p-8ad7c8bc.entry.js +1 -0
- package/dist/sankhyablocks/{p-538b3174.entry.js → p-91e34755.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c4d87e71.entry.js → p-9a99c67b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-43d58b74.entry.js → p-a04f38aa.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c9eb2bf5.entry.js → p-ae26e8d0.entry.js} +1 -1
- package/dist/sankhyablocks/{p-31c3c9d0.entry.js → p-bd234604.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0c50ba37.entry.js → p-d9bb48c4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-045398fb.entry.js → p-f8db6795.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +2 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +1 -1
- package/dist/types/components.d.ts +0 -2
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +4 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-01ba23cd.entry.js +0 -1
- package/dist/sankhyablocks/p-78d49c74.js +0 -60
- package/dist/sankhyablocks/p-bf6bc973.entry.js +0 -1
- package/dist/sankhyablocks/p-d434bb9a.entry.js +0 -1
|
@@ -9,14 +9,14 @@ const ConfigStorage = require('./ConfigStorage-d024aec8.js');
|
|
|
9
9
|
const index$1 = require('./index-1dfc7a6e.js');
|
|
10
10
|
const fieldSearch = require('./field-search-68e34bf4.js');
|
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
|
12
|
-
const ContinuousInsertUtils = require('./ContinuousInsertUtils-
|
|
12
|
+
const ContinuousInsertUtils = require('./ContinuousInsertUtils-c27b439e.js');
|
|
13
13
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
|
14
14
|
require('./DataFetcher-65879b2c.js');
|
|
15
15
|
require('./pesquisa-fetcher-5c583c93.js');
|
|
16
16
|
require('./ISave-e91b70a7.js');
|
|
17
17
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
18
18
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
19
|
-
require('./dataunit-fetcher-
|
|
19
|
+
require('./dataunit-fetcher-8291ac21.js');
|
|
20
20
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
21
21
|
require('./form-config-fetcher-90126e4c.js');
|
|
22
22
|
require('./constants-241934b3.js');
|
|
@@ -285,10 +285,24 @@ const SnkGrid = class {
|
|
|
285
285
|
this._gridConfig = config;
|
|
286
286
|
ContinuousInsertUtils.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
|
287
287
|
}
|
|
288
|
+
fixColumNameCharset(columnName) {
|
|
289
|
+
try {
|
|
290
|
+
return decodeURIComponent(escape(columnName));
|
|
291
|
+
}
|
|
292
|
+
catch (e) {
|
|
293
|
+
return columnName;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
normalizeGridConfig(config) {
|
|
297
|
+
if (!config)
|
|
298
|
+
return config;
|
|
299
|
+
const columnsMapped = config.columns.map(column => (Object.assign(Object.assign({}, column), { name: this.fixColumNameCharset(column.name) })));
|
|
300
|
+
return Object.assign(Object.assign({}, config), { columns: columnsMapped });
|
|
301
|
+
}
|
|
288
302
|
loadConfig() {
|
|
289
303
|
ConfigStorage.ConfigStorage.loadGridConfig(this.configName, this.resourceID)
|
|
290
304
|
.then((config) => {
|
|
291
|
-
this.setGridConfig(config);
|
|
305
|
+
this.setGridConfig(this.normalizeGridConfig(config));
|
|
292
306
|
})
|
|
293
307
|
.catch((error) => {
|
|
294
308
|
console.warn(error);
|
|
@@ -300,12 +314,12 @@ const SnkGrid = class {
|
|
|
300
314
|
}
|
|
301
315
|
}
|
|
302
316
|
gridConfigChangeHandler(evt) {
|
|
303
|
-
const config = evt.detail;
|
|
317
|
+
const config = this.normalizeGridConfig(evt.detail);
|
|
304
318
|
ConfigStorage.ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
|
|
305
319
|
evt.stopPropagation();
|
|
306
320
|
}
|
|
307
321
|
modalConfigChangeHandler(evt) {
|
|
308
|
-
const config = evt.detail;
|
|
322
|
+
const config = this.normalizeGridConfig(evt.detail);
|
|
309
323
|
this._grid.setColumnsState(config.columns)
|
|
310
324
|
.then(() => {
|
|
311
325
|
this.setGridConfig(config);
|
|
@@ -13,7 +13,7 @@ const index$1 = require('./index-1dfc7a6e.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');
|
|
16
|
-
require('./dataunit-fetcher-
|
|
16
|
+
require('./dataunit-fetcher-8291ac21.js');
|
|
17
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
18
18
|
require('./form-config-fetcher-90126e4c.js');
|
|
19
19
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
|
@@ -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-bff0d27d.js');
|
|
6
6
|
require('./index-f9e81701.js');
|
|
7
7
|
require('@sankhyalabs/core');
|
|
8
8
|
require('./SnkFormConfigManager-c11d8468.js');
|
|
@@ -21,7 +21,7 @@ require('./index-102ba62d.js');
|
|
|
21
21
|
require('./pesquisa-fetcher-5c583c93.js');
|
|
22
22
|
require('./ISave-e91b70a7.js');
|
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
24
|
-
require('./dataunit-fetcher-
|
|
24
|
+
require('./dataunit-fetcher-8291ac21.js');
|
|
25
25
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
26
26
|
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
|
27
27
|
require('./ResourceIDUtils-5ff86aa7.js');
|
|
@@ -10,7 +10,7 @@ require('./index-1dfc7a6e.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');
|
|
13
|
-
require('./dataunit-fetcher-
|
|
13
|
+
require('./dataunit-fetcher-8291ac21.js');
|
|
14
14
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
15
15
|
require('./form-config-fetcher-90126e4c.js');
|
|
16
16
|
require('./constants-241934b3.js');
|
|
@@ -19,7 +19,7 @@ require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
|
19
19
|
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
|
20
20
|
require('./ResourceIDUtils-5ff86aa7.js');
|
|
21
21
|
|
|
22
|
-
const snkPesquisaCss = ".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--color-secondary:var(--text--secondary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);--snk-pesquisa__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-pesquisa__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-pesquisa__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-pesquisa__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-pesquisa__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__scrollbar--width:var(--space--
|
|
22
|
+
const snkPesquisaCss = ".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--color-secondary:var(--text--secondary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);--snk-pesquisa__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-pesquisa__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-pesquisa__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-pesquisa__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-pesquisa__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__scrollbar--width:var(--space--small, 6px);height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__scrollbar--color-clicked) var(--snk-pesquisa__scrollbar--color-background);padding-right:var(--snk-pesquisa__content--padding-right);height:100vh}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__scrollbar--color-background);width:var(--snk-pesquisa__scrollbar--width);max-width:var(--snk-pesquisa__scrollbar--width);min-width:var(--snk-pesquisa__scrollbar--width)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__scrollbar--color-background);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__scrollbar--color-default);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:hover,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-pesquisa__scrollbar--color-hover)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:active,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-pesquisa__scrollbar--color-clicked)}.snk-pesquisa__records-label.sc-snk-pesquisa{display:flex;flex-direction:row;justify-content:space-between;font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__records-label.hidden.sc-snk-pesquisa{display:none}.snk-pesquisa__records.sc-snk-pesquisa{color:var(--snk-pesquisa__records--color)}.snk-pesquisa__records-limit.sc-snk-pesquisa{color:var(--snk-pesquisa__records--color-secondary)}.snk-pesquisa__records-limit.hidden.sc-snk-pesquisa,.snk-pesquisa__records.hidden.sc-snk-pesquisa{visibility:hidden}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}.snk-pesquisa__cards-container.sc-snk-pesquisa{height:100%;overflow-y:auto}";
|
|
23
23
|
|
|
24
24
|
const SnkPesquisa = class {
|
|
25
25
|
constructor(hostRef) {
|
|
@@ -9,12 +9,12 @@ const constants = require('./constants-241934b3.js');
|
|
|
9
9
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
|
10
10
|
require('./DataFetcher-65879b2c.js');
|
|
11
11
|
require('./pesquisa-fetcher-5c583c93.js');
|
|
12
|
-
const ContinuousInsertUtils = require('./ContinuousInsertUtils-
|
|
12
|
+
const ContinuousInsertUtils = require('./ContinuousInsertUtils-c27b439e.js');
|
|
13
13
|
const index = require('./index-1dfc7a6e.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');
|
|
17
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
|
17
|
+
const dataunitFetcher = require('./dataunit-fetcher-8291ac21.js');
|
|
18
18
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
19
19
|
const formConfigFetcher = require('./form-config-fetcher-90126e4c.js');
|
|
20
20
|
const fieldSearch = require('./field-search-68e34bf4.js');
|
|
@@ -124,7 +124,7 @@ const SnkSimpleCrud = class {
|
|
|
124
124
|
this.formConfig = undefined;
|
|
125
125
|
this._formFields = [];
|
|
126
126
|
this._fieldsProps = new Map();
|
|
127
|
-
this.
|
|
127
|
+
this._enableContinuousInsert = true;
|
|
128
128
|
this.multipleSelection = undefined;
|
|
129
129
|
this.useCancelConfirm = true;
|
|
130
130
|
this.pageSize = 150;
|
|
@@ -411,7 +411,7 @@ const SnkSimpleCrud = class {
|
|
|
411
411
|
this._rmPrecisionCustomValueFormatter = new ContinuousInsertUtils.RmPrecisionCustomValueFormatter();
|
|
412
412
|
this._continuousInsertUtils = new ContinuousInsertUtils.ContinuousInsertUtils(this.application, this.resolveResourceID(), this.configName);
|
|
413
413
|
if (this.enableGridInsert) {
|
|
414
|
-
this._continuousInsertUtils.getConfig().then(value => this.
|
|
414
|
+
this._continuousInsertUtils.getConfig().then(value => this._enableContinuousInsert = value);
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
componentDidLoad() {
|
|
@@ -663,9 +663,9 @@ const SnkSimpleCrud = class {
|
|
|
663
663
|
: this.getFieldSearch(actionButton, item)
|
|
664
664
|
}];
|
|
665
665
|
if (this.enableGridInsert) {
|
|
666
|
-
hardList.push(this._continuousInsertUtils.actionContinuousInsert(this.
|
|
667
|
-
this.
|
|
668
|
-
this._continuousInsertUtils.handleSaveConfig(this.
|
|
666
|
+
hardList.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert, () => {
|
|
667
|
+
this._enableContinuousInsert = !this._enableContinuousInsert;
|
|
668
|
+
this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert);
|
|
669
669
|
}));
|
|
670
670
|
}
|
|
671
671
|
if (this.isGridInsertActive())
|
|
@@ -833,7 +833,7 @@ const SnkSimpleCrud = class {
|
|
|
833
833
|
}
|
|
834
834
|
return (index$1.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$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow'} simple-crud__container-section` }, index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.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
835
|
? undefined
|
|
836
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this.
|
|
836
|
+
: 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$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, this.renderTaskbarContent(), index$1.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$1.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$1.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$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.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
837
|
}
|
|
838
838
|
get _element() { return index$1.getElement(this); }
|
|
839
839
|
static get watchers() { return {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
/*@doc Define o raio da borda da barra de rolagem do componente.*/
|
|
39
39
|
--snk-configurator__scrollbar--border-radius: var(--border--radius-small, 6px);
|
|
40
40
|
/*@doc Define a largura da barra de rolagem do componente.*/
|
|
41
|
-
--snk-configurator__scrollbar--width: var(--space--
|
|
41
|
+
--snk-configurator__scrollbar--width: var(--space--small, 6px);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.snk-configurator {
|
|
@@ -125,7 +125,7 @@ function buildNumber(item) {
|
|
|
125
125
|
const variation = props.variation;
|
|
126
126
|
if (variation === FilterNumberVariation.INTERVAL) {
|
|
127
127
|
const { start, end } = value !== null && value !== void 0 ? value : { start: 0, end: 0 };
|
|
128
|
-
if (start && end) {
|
|
128
|
+
if (!isNaN(start) && !isNaN(end)) {
|
|
129
129
|
return {
|
|
130
130
|
name: id,
|
|
131
131
|
expression: props.intervalExpression.fullfill,
|
|
@@ -135,7 +135,7 @@ function buildNumber(item) {
|
|
|
135
135
|
]
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
if (start) {
|
|
138
|
+
if (!isNaN(start)) {
|
|
139
139
|
return {
|
|
140
140
|
name: id,
|
|
141
141
|
expression: props.intervalExpression.onlystart,
|
|
@@ -144,7 +144,7 @@ function buildNumber(item) {
|
|
|
144
144
|
]
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
|
-
if (end) {
|
|
147
|
+
if (!isNaN(end)) {
|
|
148
148
|
return {
|
|
149
149
|
name: id,
|
|
150
150
|
expression: props.intervalExpression.onlyend,
|
|
@@ -19,7 +19,7 @@ export class SnkFilterPeriod {
|
|
|
19
19
|
if (this.getVariation() === FilterNumberVariation.INTERVAL) {
|
|
20
20
|
const start = this._startInterval.value;
|
|
21
21
|
const end = this._endInterval.value;
|
|
22
|
-
this.value = (start || end ? { start, end } : undefined);
|
|
22
|
+
this.value = (!isNaN(start) || !isNaN(end) ? { start, end } : undefined);
|
|
23
23
|
this.valueChanged.emit(this.value);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -201,13 +201,13 @@ export class SnkFilterItem {
|
|
|
201
201
|
}
|
|
202
202
|
if (type === FilterItemType.NUMBER && props.variation === FilterNumberVariation.INTERVAL) {
|
|
203
203
|
const { start, end } = value;
|
|
204
|
-
if (start && end) {
|
|
204
|
+
if (!isNaN(start) && !isNaN(end)) {
|
|
205
205
|
return this.getMessage('snkFilterBar.fullIntervalTooltip', { LABEL: label, START_LABEL: start, END_LABEL: end });
|
|
206
206
|
}
|
|
207
|
-
if (start) {
|
|
207
|
+
if (!isNaN(start)) {
|
|
208
208
|
return `${label}: ${this.getMessage('snkFilterBar.onlyStartToltip')} ${Number(start)}`;
|
|
209
209
|
}
|
|
210
|
-
if (end) {
|
|
210
|
+
if (!isNaN(end)) {
|
|
211
211
|
return `${label}: ${this.getMessage('snkFilterBar.onlyEndToltip')} ${Number(end)}`;
|
|
212
212
|
}
|
|
213
213
|
}
|
|
@@ -211,10 +211,24 @@ export class SnkGrid {
|
|
|
211
211
|
this._gridConfig = config;
|
|
212
212
|
CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
|
213
213
|
}
|
|
214
|
+
fixColumNameCharset(columnName) {
|
|
215
|
+
try {
|
|
216
|
+
return decodeURIComponent(escape(columnName));
|
|
217
|
+
}
|
|
218
|
+
catch (e) {
|
|
219
|
+
return columnName;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
normalizeGridConfig(config) {
|
|
223
|
+
if (!config)
|
|
224
|
+
return config;
|
|
225
|
+
const columnsMapped = config.columns.map(column => (Object.assign(Object.assign({}, column), { name: this.fixColumNameCharset(column.name) })));
|
|
226
|
+
return Object.assign(Object.assign({}, config), { columns: columnsMapped });
|
|
227
|
+
}
|
|
214
228
|
loadConfig() {
|
|
215
229
|
ConfigStorage.loadGridConfig(this.configName, this.resourceID)
|
|
216
230
|
.then((config) => {
|
|
217
|
-
this.setGridConfig(config);
|
|
231
|
+
this.setGridConfig(this.normalizeGridConfig(config));
|
|
218
232
|
})
|
|
219
233
|
.catch((error) => {
|
|
220
234
|
console.warn(error);
|
|
@@ -226,12 +240,12 @@ export class SnkGrid {
|
|
|
226
240
|
}
|
|
227
241
|
}
|
|
228
242
|
gridConfigChangeHandler(evt) {
|
|
229
|
-
const config = evt.detail;
|
|
243
|
+
const config = this.normalizeGridConfig(evt.detail);
|
|
230
244
|
ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
|
|
231
245
|
evt.stopPropagation();
|
|
232
246
|
}
|
|
233
247
|
modalConfigChangeHandler(evt) {
|
|
234
|
-
const config = evt.detail;
|
|
248
|
+
const config = this.normalizeGridConfig(evt.detail);
|
|
235
249
|
this._grid.setColumnsState(config.columns)
|
|
236
250
|
.then(() => {
|
|
237
251
|
this.setGridConfig(config);
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
/*@doc Define o raio da borda da barra de rolagem do componente.*/
|
|
54
54
|
--snk-grid-config__scrollbar--border-radius: var(--border--radius-small, 6px);
|
|
55
55
|
/*@doc Define a largura da barra de rolagem do componente.*/
|
|
56
|
-
--snk-grid-config__scrollbar--width: var(--space--
|
|
56
|
+
--snk-grid-config__scrollbar--width: var(--space--small, 6px);
|
|
57
57
|
|
|
58
58
|
display: grid;
|
|
59
59
|
grid-template-rows: auto 1fr auto;
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
/*@doc Define o raio da borda da barra de rolagem do componente.*/
|
|
42
42
|
--snk-pesquisa__scrollbar--border-radius: var(--border--radius-small, 6px);
|
|
43
43
|
/*@doc Define a largura da barra de rolagem do componente.*/
|
|
44
|
-
--snk-pesquisa__scrollbar--width: var(--space--
|
|
44
|
+
--snk-pesquisa__scrollbar--width: var(--space--small, 6px);
|
|
45
45
|
|
|
46
46
|
height: 100%;
|
|
47
47
|
display: flex;
|
|
@@ -44,7 +44,7 @@ export class SnkSimpleCrud {
|
|
|
44
44
|
this.formConfig = undefined;
|
|
45
45
|
this._formFields = [];
|
|
46
46
|
this._fieldsProps = new Map();
|
|
47
|
-
this.
|
|
47
|
+
this._enableContinuousInsert = true;
|
|
48
48
|
this.multipleSelection = undefined;
|
|
49
49
|
this.useCancelConfirm = true;
|
|
50
50
|
this.pageSize = 150;
|
|
@@ -331,7 +331,7 @@ export class SnkSimpleCrud {
|
|
|
331
331
|
this._rmPrecisionCustomValueFormatter = new RmPrecisionCustomValueFormatter();
|
|
332
332
|
this._continuousInsertUtils = new ContinuousInsertUtils(this.application, this.resolveResourceID(), this.configName);
|
|
333
333
|
if (this.enableGridInsert) {
|
|
334
|
-
this._continuousInsertUtils.getConfig().then(value => this.
|
|
334
|
+
this._continuousInsertUtils.getConfig().then(value => this._enableContinuousInsert = value);
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
componentDidLoad() {
|
|
@@ -583,9 +583,9 @@ export class SnkSimpleCrud {
|
|
|
583
583
|
: this.getFieldSearch(actionButton, item)
|
|
584
584
|
}];
|
|
585
585
|
if (this.enableGridInsert) {
|
|
586
|
-
hardList.push(this._continuousInsertUtils.actionContinuousInsert(this.
|
|
587
|
-
this.
|
|
588
|
-
this._continuousInsertUtils.handleSaveConfig(this.
|
|
586
|
+
hardList.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert, () => {
|
|
587
|
+
this._enableContinuousInsert = !this._enableContinuousInsert;
|
|
588
|
+
this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert);
|
|
589
589
|
}));
|
|
590
590
|
}
|
|
591
591
|
if (this.isGridInsertActive())
|
|
@@ -753,7 +753,7 @@ export class SnkSimpleCrud {
|
|
|
753
753
|
}
|
|
754
754
|
return (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 === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow'} simple-crud__container-section` }, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, 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(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
755
755
|
? undefined
|
|
756
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this.
|
|
756
|
+
: 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(), h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, this.renderTaskbarContent(), 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) }), 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 && 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 })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, 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), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
|
757
757
|
}
|
|
758
758
|
static get is() { return "snk-simple-crud"; }
|
|
759
759
|
static get encapsulation() { return "scoped"; }
|
|
@@ -925,24 +925,6 @@ export class SnkSimpleCrud {
|
|
|
925
925
|
"text": ""
|
|
926
926
|
}
|
|
927
927
|
},
|
|
928
|
-
"enableContinuousInsert": {
|
|
929
|
-
"type": "boolean",
|
|
930
|
-
"mutable": true,
|
|
931
|
-
"complexType": {
|
|
932
|
-
"original": "boolean",
|
|
933
|
-
"resolved": "boolean",
|
|
934
|
-
"references": {}
|
|
935
|
-
},
|
|
936
|
-
"required": false,
|
|
937
|
-
"optional": false,
|
|
938
|
-
"docs": {
|
|
939
|
-
"tags": [],
|
|
940
|
-
"text": ""
|
|
941
|
-
},
|
|
942
|
-
"attribute": "enable-continuous-insert",
|
|
943
|
-
"reflect": false,
|
|
944
|
-
"defaultValue": "false"
|
|
945
|
-
},
|
|
946
928
|
"multipleSelection": {
|
|
947
929
|
"type": "boolean",
|
|
948
930
|
"mutable": false,
|
|
@@ -1278,7 +1260,8 @@ export class SnkSimpleCrud {
|
|
|
1278
1260
|
"_fieldToGetFocus": {},
|
|
1279
1261
|
"_customContainerId": {},
|
|
1280
1262
|
"_formFields": {},
|
|
1281
|
-
"_fieldsProps": {}
|
|
1263
|
+
"_fieldsProps": {},
|
|
1264
|
+
"_enableContinuousInsert": {}
|
|
1282
1265
|
};
|
|
1283
1266
|
}
|
|
1284
1267
|
static get events() {
|
|
@@ -2,6 +2,9 @@ import { ObjectUtils } from "@sankhyalabs/core";
|
|
|
2
2
|
export class ArrayRepository {
|
|
3
3
|
constructor(equalsFunction) {
|
|
4
4
|
this._list = [];
|
|
5
|
+
this._listCopy = [];
|
|
6
|
+
this._listLastUpdate = 0;
|
|
7
|
+
this._listCopyLastUpdate = 0;
|
|
5
8
|
this._equalsFunction = equalsFunction;
|
|
6
9
|
}
|
|
7
10
|
async load(filterFunction, sortingFunction, offset, limit) {
|
|
@@ -40,13 +43,13 @@ export class ArrayRepository {
|
|
|
40
43
|
return Promise.resolve(new Map(processedItems.map(item => [item.key, item.value])));
|
|
41
44
|
}
|
|
42
45
|
async push(items) {
|
|
43
|
-
this.
|
|
46
|
+
this.updateList([...this._list, ...items]);
|
|
44
47
|
}
|
|
45
48
|
async clear() {
|
|
46
|
-
this.
|
|
49
|
+
this.updateList([]);
|
|
47
50
|
}
|
|
48
51
|
async delete(items) {
|
|
49
|
-
|
|
52
|
+
const list = this._list.filter(item => {
|
|
50
53
|
for (const removed of items) {
|
|
51
54
|
if (this._equalsFunction(item, removed)) {
|
|
52
55
|
return false;
|
|
@@ -54,20 +57,23 @@ export class ArrayRepository {
|
|
|
54
57
|
}
|
|
55
58
|
return true;
|
|
56
59
|
});
|
|
60
|
+
this.updateList(list);
|
|
57
61
|
}
|
|
58
62
|
async update(items) {
|
|
59
|
-
|
|
63
|
+
const list = this._list.map(existingItem => {
|
|
60
64
|
const newItem = items.find(newItem => this._equalsFunction(existingItem, newItem));
|
|
61
65
|
return newItem == undefined ? existingItem : newItem;
|
|
62
66
|
});
|
|
67
|
+
this.updateList(list);
|
|
63
68
|
}
|
|
64
69
|
async insert(itemReference, items) {
|
|
65
70
|
const itemPosition = this._list.indexOf(itemReference);
|
|
66
71
|
if (itemPosition == -1) {
|
|
67
|
-
this.
|
|
72
|
+
this.push(items);
|
|
68
73
|
return;
|
|
69
74
|
}
|
|
70
|
-
|
|
75
|
+
const list = this._list.slice(0, itemPosition).concat(items).concat(this._list.slice(itemPosition));
|
|
76
|
+
this.updateList(list);
|
|
71
77
|
}
|
|
72
78
|
isOperating() {
|
|
73
79
|
return true;
|
|
@@ -79,6 +85,14 @@ export class ArrayRepository {
|
|
|
79
85
|
return Promise.resolve(this._list.length);
|
|
80
86
|
}
|
|
81
87
|
getFromCache() {
|
|
82
|
-
|
|
88
|
+
if (this._listLastUpdate > this._listCopyLastUpdate) {
|
|
89
|
+
this._listCopyLastUpdate = this._listLastUpdate;
|
|
90
|
+
this._listCopy = ObjectUtils.copy(this._list);
|
|
91
|
+
}
|
|
92
|
+
return this._listCopy;
|
|
93
|
+
}
|
|
94
|
+
updateList(newList) {
|
|
95
|
+
this._list = newList;
|
|
96
|
+
this._listLastUpdate = Date.now();
|
|
83
97
|
}
|
|
84
98
|
}
|
|
@@ -9,6 +9,9 @@ import { R as ResourceIDUtils } from './ResourceIDUtils.js';
|
|
|
9
9
|
class ArrayRepository {
|
|
10
10
|
constructor(equalsFunction) {
|
|
11
11
|
this._list = [];
|
|
12
|
+
this._listCopy = [];
|
|
13
|
+
this._listLastUpdate = 0;
|
|
14
|
+
this._listCopyLastUpdate = 0;
|
|
12
15
|
this._equalsFunction = equalsFunction;
|
|
13
16
|
}
|
|
14
17
|
async load(filterFunction, sortingFunction, offset, limit) {
|
|
@@ -47,13 +50,13 @@ class ArrayRepository {
|
|
|
47
50
|
return Promise.resolve(new Map(processedItems.map(item => [item.key, item.value])));
|
|
48
51
|
}
|
|
49
52
|
async push(items) {
|
|
50
|
-
this.
|
|
53
|
+
this.updateList([...this._list, ...items]);
|
|
51
54
|
}
|
|
52
55
|
async clear() {
|
|
53
|
-
this.
|
|
56
|
+
this.updateList([]);
|
|
54
57
|
}
|
|
55
58
|
async delete(items) {
|
|
56
|
-
|
|
59
|
+
const list = this._list.filter(item => {
|
|
57
60
|
for (const removed of items) {
|
|
58
61
|
if (this._equalsFunction(item, removed)) {
|
|
59
62
|
return false;
|
|
@@ -61,20 +64,23 @@ class ArrayRepository {
|
|
|
61
64
|
}
|
|
62
65
|
return true;
|
|
63
66
|
});
|
|
67
|
+
this.updateList(list);
|
|
64
68
|
}
|
|
65
69
|
async update(items) {
|
|
66
|
-
|
|
70
|
+
const list = this._list.map(existingItem => {
|
|
67
71
|
const newItem = items.find(newItem => this._equalsFunction(existingItem, newItem));
|
|
68
72
|
return newItem == undefined ? existingItem : newItem;
|
|
69
73
|
});
|
|
74
|
+
this.updateList(list);
|
|
70
75
|
}
|
|
71
76
|
async insert(itemReference, items) {
|
|
72
77
|
const itemPosition = this._list.indexOf(itemReference);
|
|
73
78
|
if (itemPosition == -1) {
|
|
74
|
-
this.
|
|
79
|
+
this.push(items);
|
|
75
80
|
return;
|
|
76
81
|
}
|
|
77
|
-
|
|
82
|
+
const list = this._list.slice(0, itemPosition).concat(items).concat(this._list.slice(itemPosition));
|
|
83
|
+
this.updateList(list);
|
|
78
84
|
}
|
|
79
85
|
isOperating() {
|
|
80
86
|
return true;
|
|
@@ -86,7 +92,15 @@ class ArrayRepository {
|
|
|
86
92
|
return Promise.resolve(this._list.length);
|
|
87
93
|
}
|
|
88
94
|
getFromCache() {
|
|
89
|
-
|
|
95
|
+
if (this._listLastUpdate > this._listCopyLastUpdate) {
|
|
96
|
+
this._listCopyLastUpdate = this._listLastUpdate;
|
|
97
|
+
this._listCopy = ObjectUtils.copy(this._list);
|
|
98
|
+
}
|
|
99
|
+
return this._listCopy;
|
|
100
|
+
}
|
|
101
|
+
updateList(newList) {
|
|
102
|
+
this._list = newList;
|
|
103
|
+
this._listLastUpdate = Date.now();
|
|
90
104
|
}
|
|
91
105
|
}
|
|
92
106
|
|
|
@@ -3,7 +3,7 @@ import { ApplicationContext } from '@sankhyalabs/core';
|
|
|
3
3
|
import { V as VIEW_MODE } from './constants.js';
|
|
4
4
|
import { A as AuthorizationConfig } from './AuthorizationConfig.js';
|
|
5
5
|
|
|
6
|
-
const snkConfiguratorCss = ".sc-snk-configurator-h{--snk-configurator__button-close--padding-left:var(--space--medium, 12px);--snk-configurator__title--color:var(--title--primary, #2B3A54);--snk-configurator__title--font-family:var(--font-pattern, \"Roboto\");--snk-configurator__title--font-size:var(--title--large, 20px);--snk-configurator__title--font-weight:var(--text-weight--extra-large, 700);--snk-configurator__subtitle--color:var(--title--primary, #2B3A54);--snk-configurator__subtitle--font-family:var(--font-pattern, \"Roboto\");--snk-configurator__subtitle--font-size:var(--text--medium, 14px);--snk-configurator__subtitle--font-weight:var(--text-weight--large, 600);--snk-configurator__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-configurator__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-configurator__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-configurator__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-configurator__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-configurator__scrollbar--width:var(--space--
|
|
6
|
+
const snkConfiguratorCss = ".sc-snk-configurator-h{--snk-configurator__button-close--padding-left:var(--space--medium, 12px);--snk-configurator__title--color:var(--title--primary, #2B3A54);--snk-configurator__title--font-family:var(--font-pattern, \"Roboto\");--snk-configurator__title--font-size:var(--title--large, 20px);--snk-configurator__title--font-weight:var(--text-weight--extra-large, 700);--snk-configurator__subtitle--color:var(--title--primary, #2B3A54);--snk-configurator__subtitle--font-family:var(--font-pattern, \"Roboto\");--snk-configurator__subtitle--font-size:var(--text--medium, 14px);--snk-configurator__subtitle--font-weight:var(--text-weight--large, 600);--snk-configurator__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-configurator__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-configurator__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-configurator__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-configurator__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-configurator__scrollbar--width:var(--space--small, 6px)}.snk-configurator.sc-snk-configurator{display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}.snk-configurator__collsable-box-action.sc-snk-configurator{width:100%}.snk-configurator__action-buttons.sc-snk-configurator{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium)}.snk-configurator__outline.sc-snk-configurator{display:flex;flex-direction:column;gap:var(--space--small);margin-top:var(--space--small);margin-bottom:var(--space--large)}@media screen and (min-width: 480px){.snk-configurator.sc-snk-configurator{width:359px;max-width:359px}}.snk-configurator__button-config.sc-snk-configurator{--ez-button--min-width:100%}.snk-configurator__header.sc-snk-configurator{display:flex;justify-content:space-between;align-items:center;width:100%}.snk-configurator__title.sc-snk-configurator{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-configurator__title--color);font-size:var(--snk-configurator__title--font-size);font-family:var(--snk-configurator__title--font-family);font-weight:var(--snk-configurator__title--font-weight)}.snk-configurator__subtitle.sc-snk-configurator{display:flex;margin:0;padding-top:var(--space--medium);padding-bottom:var(--space--small);color:var(--snk-configurator__subtitle--color);font-size:var(--snk-configurator__subtitle--font-size);font-family:var(--snk-configurator__subtitle--font-family);font-weight:var(--snk-configurator__subtitle--font-weight)}.snk-configurator__button-close.sc-snk-configurator{padding-left:var(--snk-configurator__button-close--padding-left)}.snk-configurator__main.sc-snk-configurator{overflow-y:auto;scrollbar-width:thin;margin:var(--space--medium) 0;scrollbar-color:var(--snk-configurator__scrollbar--color-clicked) var(--snk-configurator__scrollbar--color-background)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar{background-color:var(--snk-configurator__scrollbar--color-background);width:var(--snk-configurator__scrollbar--width);max-width:var(--snk-configurator__scrollbar--width);min-width:var(--snk-configurator__scrollbar--width)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-track{background-color:var(--snk-configurator__scrollbar--color-background);border-radius:var(--snk-configurator__scrollbar--border-radius)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb{background-color:var(--snk-configurator__scrollbar--color-default);border-radius:var(--snk-configurator__scrollbar--border-radius)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:vertical:hover,.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-configurator__scrollbar--color-hover)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:vertical:active,.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-configurator__scrollbar--color-clicked)}";
|
|
7
7
|
|
|
8
8
|
const SnkConfigurator = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
9
9
|
constructor() {
|
|
@@ -139,7 +139,7 @@ function buildNumber(item) {
|
|
|
139
139
|
const variation = props.variation;
|
|
140
140
|
if (variation === FilterNumberVariation.INTERVAL) {
|
|
141
141
|
const { start, end } = value !== null && value !== void 0 ? value : { start: 0, end: 0 };
|
|
142
|
-
if (start && end) {
|
|
142
|
+
if (!isNaN(start) && !isNaN(end)) {
|
|
143
143
|
return {
|
|
144
144
|
name: id,
|
|
145
145
|
expression: props.intervalExpression.fullfill,
|
|
@@ -149,7 +149,7 @@ function buildNumber(item) {
|
|
|
149
149
|
]
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
if (start) {
|
|
152
|
+
if (!isNaN(start)) {
|
|
153
153
|
return {
|
|
154
154
|
name: id,
|
|
155
155
|
expression: props.intervalExpression.onlystart,
|
|
@@ -158,7 +158,7 @@ function buildNumber(item) {
|
|
|
158
158
|
]
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
|
-
if (end) {
|
|
161
|
+
if (!isNaN(end)) {
|
|
162
162
|
return {
|
|
163
163
|
name: id,
|
|
164
164
|
expression: props.intervalExpression.onlyend,
|
|
@@ -207,13 +207,13 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
207
207
|
}
|
|
208
208
|
if (type === FilterItemType.NUMBER && props.variation === FilterNumberVariation.INTERVAL) {
|
|
209
209
|
const { start, end } = value;
|
|
210
|
-
if (start && end) {
|
|
210
|
+
if (!isNaN(start) && !isNaN(end)) {
|
|
211
211
|
return this.getMessage('snkFilterBar.fullIntervalTooltip', { LABEL: label, START_LABEL: start, END_LABEL: end });
|
|
212
212
|
}
|
|
213
|
-
if (start) {
|
|
213
|
+
if (!isNaN(start)) {
|
|
214
214
|
return `${label}: ${this.getMessage('snkFilterBar.onlyStartToltip')} ${Number(start)}`;
|
|
215
215
|
}
|
|
216
|
-
if (end) {
|
|
216
|
+
if (!isNaN(end)) {
|
|
217
217
|
return `${label}: ${this.getMessage('snkFilterBar.onlyEndToltip')} ${Number(end)}`;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
@@ -23,7 +23,7 @@ const SnkFilterPeriod = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
23
23
|
if (this.getVariation() === FilterNumberVariation.INTERVAL) {
|
|
24
24
|
const start = this._startInterval.value;
|
|
25
25
|
const end = this._endInterval.value;
|
|
26
|
-
this.value = (start || end ? { start, end } : undefined);
|
|
26
|
+
this.value = (!isNaN(start) || !isNaN(end) ? { start, end } : undefined);
|
|
27
27
|
this.valueChanged.emit(this.value);
|
|
28
28
|
return;
|
|
29
29
|
}
|