@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-83020.0 → 0.0.0-bugfix-dev-KB-81596.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/{ClientSideExporterProvider-6b781452.js → ClientSideExporterProvider-2f5f350c.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-8291ac21.js → dataunit-fetcher-449d51a3.js} +11 -161
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +1 -1
- package/dist/cjs/snk-actions-button_5.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-attach.cjs.entry.js +2 -2
- 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-d75e6220.js → snk-data-unit-bbd384bf.js} +4 -2
- 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 +3 -2
- package/dist/cjs/snk-grid.cjs.entry.js +2 -2
- package/dist/cjs/{snk-guides-viewer-a029ff50.js → snk-guides-viewer-5396062f.js} +1 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +2 -2
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +2 -2
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +2 -3
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +3 -1
- 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 +1 -5
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +1 -1
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +12 -101
- package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +7 -53
- package/dist/components/dataunit-fetcher.js +30 -179
- package/dist/components/snk-attach2.js +3 -3
- package/dist/components/snk-data-unit2.js +3 -1
- package/dist/components/snk-filter-bar2.js +2 -2
- package/dist/components/snk-filter-item2.js +1 -0
- package/dist/esm/{ClientSideExporterProvider-ff89c7e9.js → ClientSideExporterProvider-3537805a.js} +1 -1
- package/dist/esm/{dataunit-fetcher-5247a708.js → dataunit-fetcher-91b094f2.js} +13 -162
- package/dist/esm/pesquisa-grid_2.entry.js +1 -1
- package/dist/esm/snk-actions-button_5.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-attach.entry.js +3 -3
- 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-bfd10c71.js → snk-data-unit-b03bb5cf.js} +4 -2
- 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 +3 -2
- package/dist/esm/snk-grid.entry.js +2 -2
- package/dist/esm/{snk-guides-viewer-fa45714d.js → snk-guides-viewer-749d027c.js} +1 -1
- package/dist/esm/snk-guides-viewer.entry.js +2 -2
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +2 -2
- package/dist/sankhyablocks/p-0ce56d43.entry.js +1 -0
- package/dist/sankhyablocks/{p-b0ff53b7.entry.js → p-13391b3d.entry.js} +1 -1
- package/dist/sankhyablocks/p-23b47a92.js +1 -0
- package/dist/sankhyablocks/p-3653374d.js +60 -0
- package/dist/sankhyablocks/{p-c82deea7.entry.js → p-389ba782.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f8db6795.entry.js → p-44efbeed.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0b00d69c.entry.js → p-4be6e0e7.entry.js} +1 -1
- package/dist/sankhyablocks/p-4d87cd45.entry.js +1 -0
- package/dist/sankhyablocks/{p-e36f89d1.entry.js → p-4fa79d68.entry.js} +1 -1
- package/dist/sankhyablocks/{p-40e323f9.js → p-5dd7f4c7.js} +1 -1
- package/dist/sankhyablocks/{p-aa1a0f3e.entry.js → p-6234bda8.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e10faff0.entry.js → p-647f9830.entry.js} +1 -1
- package/dist/sankhyablocks/{p-de9da2f2.js → p-7b87d1a8.js} +1 -1
- package/dist/sankhyablocks/{p-d2d0535f.entry.js → p-ad5e4f9d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-172848d4.entry.js → p-b2de1bcc.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e718fb81.entry.js → p-ca316523.entry.js} +1 -1
- package/dist/sankhyablocks/{p-700a4cc3.entry.js → p-ee53b000.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +4 -11
- package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +3 -6
- package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +2 -2
- package/package.json +1 -1
- package/dist/sankhyablocks/p-198c48c5.entry.js +0 -1
- package/dist/sankhyablocks/p-38179225.js +0 -60
- package/dist/sankhyablocks/p-655bdd60.js +0 -1
- package/dist/sankhyablocks/p-b02e58fd.entry.js +0 -1
package/dist/cjs/{ClientSideExporterProvider-6b781452.js → ClientSideExporterProvider-2f5f350c.js}
RENAMED
|
@@ -7,7 +7,7 @@ const index$1 = require('./index-e3e39724.js');
|
|
|
7
7
|
require('./ISave-e91b70a7.js');
|
|
8
8
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
9
9
|
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
10
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
|
10
|
+
const dataunitFetcher = require('./dataunit-fetcher-449d51a3.js');
|
|
11
11
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
12
12
|
require('./form-config-fetcher-90126e4c.js');
|
|
13
13
|
require('./constants-241934b3.js');
|
|
@@ -244,182 +244,33 @@ class PreloadManager {
|
|
|
244
244
|
PreloadManager._repositories = new Map();
|
|
245
245
|
PreloadManager._loadingStatus = new Map();
|
|
246
246
|
|
|
247
|
-
function applyFilter(records, dataUnit, filters) {
|
|
248
|
-
const columnFilters = utils.ColumnFilterManager.getColumnFilters(filters, "");
|
|
249
|
-
if (!(columnFilters === null || columnFilters === void 0 ? void 0 : columnFilters.size)) {
|
|
250
|
-
return records;
|
|
251
|
-
}
|
|
252
|
-
const filterFunction = utils.ColumnFilterManager.getFilterFunction(dataUnit, Array.from(columnFilters.values()));
|
|
253
|
-
if (filterFunction == undefined) {
|
|
254
|
-
return records;
|
|
255
|
-
}
|
|
256
|
-
return records.filter(filterFunction);
|
|
257
|
-
}
|
|
258
|
-
function buildLoadDataResponse(recordsIn, dataUnit, request) {
|
|
259
|
-
let records = recordsIn ? [...recordsIn] : [];
|
|
260
|
-
records = applyFilter(records, dataUnit, request.filters);
|
|
261
|
-
records = applySorting(records, dataUnit, request.sort);
|
|
262
|
-
const { offset, limit } = request;
|
|
263
|
-
const paginationInfoBuilderParams = {
|
|
264
|
-
recordsLength: records.length,
|
|
265
|
-
offset,
|
|
266
|
-
recordsPerPage: limit,
|
|
267
|
-
};
|
|
268
|
-
return Promise.resolve({
|
|
269
|
-
records: getPagesByRecords(records, offset, limit),
|
|
270
|
-
paginationInfo: dataUnit.pageSize ? buildPaginationInfo(paginationInfoBuilderParams) : undefined,
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
function applySorting(records, dataUnit, sorting) {
|
|
274
|
-
if (sorting == undefined || sorting.length == 0) {
|
|
275
|
-
return records;
|
|
276
|
-
}
|
|
277
|
-
const sortingFunction = PreloadManager.getSortingFunction(dataUnit, sorting);
|
|
278
|
-
if (sortingFunction == undefined) {
|
|
279
|
-
return records;
|
|
280
|
-
}
|
|
281
|
-
return records.sort(sortingFunction);
|
|
282
|
-
}
|
|
283
|
-
function hasValidLimitAndOffset(offset, limit) {
|
|
284
|
-
return offset >= 0 && limit >= 0;
|
|
285
|
-
}
|
|
286
|
-
function getPagesByRecords(records, offset = 0, limit = 0) {
|
|
287
|
-
if (!records || !records.length || !hasValidLimitAndOffset(offset, limit))
|
|
288
|
-
return [];
|
|
289
|
-
if (limit === 0 && offset === 0)
|
|
290
|
-
return records;
|
|
291
|
-
return records.slice(offset, offset + limit);
|
|
292
|
-
}
|
|
293
|
-
function buildPaginationInfo({ recordsLength = 0, offset = 0, recordsPerPage = 0 }) {
|
|
294
|
-
if (!recordsLength) {
|
|
295
|
-
return { currentPage: 0, firstRecord: 0, lastRecord: 0, total: 0, hasMore: false };
|
|
296
|
-
}
|
|
297
|
-
const lastRecordIndex = offset + recordsPerPage;
|
|
298
|
-
const lastRecord = lastRecordIndex ? Math.min(lastRecordIndex, recordsLength) : recordsLength;
|
|
299
|
-
return {
|
|
300
|
-
currentPage: recordsPerPage === 0 ? 0 : Math.ceil(offset / recordsPerPage),
|
|
301
|
-
firstRecord: offset + 1,
|
|
302
|
-
lastRecord: lastRecord,
|
|
303
|
-
total: recordsLength,
|
|
304
|
-
hasMore: lastRecord < recordsLength,
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
|
|
308
247
|
class InMemoryLoader {
|
|
309
248
|
constructor(metadata, records, config) {
|
|
310
|
-
this.
|
|
311
|
-
this.records = records;
|
|
312
|
-
this._dataUnit = new core.DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
|
313
|
-
this._dataUnit.pageSize = 150;
|
|
314
|
-
this._dataUnit.metadataLoader = () => this.metadaLoader();
|
|
315
|
-
this._dataUnit.dataLoader = (dataUnit, request) => this.inMemoryLoader(dataUnit, request, this.getRecordsToLoad());
|
|
316
|
-
this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
|
|
317
|
-
this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
|
|
318
|
-
this.dataUnit.loadMetadata().then(() => {
|
|
319
|
-
if ((config === null || config === void 0 ? void 0 : config.autoLoad) !== false) {
|
|
320
|
-
this.dataUnit.loadData();
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
getRecordsToLoad() {
|
|
325
|
-
if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
|
|
326
|
-
this._initialRecords = this.dataUnit.records;
|
|
327
|
-
}
|
|
328
|
-
const addedRecords = this.dataUnit.getAddedRecords();
|
|
329
|
-
if (addedRecords) {
|
|
330
|
-
return [...this._initialRecords, ...addedRecords];
|
|
331
|
-
}
|
|
332
|
-
return this._initialRecords;
|
|
249
|
+
this._dataUnitInMemoryLoader = new core.DataUnitInMemoryLoader(metadata, records, config);
|
|
333
250
|
}
|
|
334
251
|
get dataUnit() {
|
|
335
|
-
return this.
|
|
252
|
+
return this._dataUnitInMemoryLoader.dataUnit;
|
|
336
253
|
}
|
|
337
254
|
get records() {
|
|
338
|
-
return this.
|
|
339
|
-
}
|
|
340
|
-
static getConvertedValue(descriptor, strValue) {
|
|
341
|
-
if (descriptor.dataType === core.DataType.BOOLEAN) {
|
|
342
|
-
return strValue === "S";
|
|
343
|
-
}
|
|
344
|
-
if (descriptor.dataType === core.DataType.NUMBER) {
|
|
345
|
-
return Number(strValue);
|
|
346
|
-
}
|
|
347
|
-
if (descriptor.dataType === core.DataType.DATE) {
|
|
348
|
-
return core.DateUtils.strToDate(strValue, true);
|
|
349
|
-
}
|
|
350
|
-
if (descriptor.dataType === core.DataType.OBJECT) {
|
|
351
|
-
return JSON.parse(strValue);
|
|
352
|
-
}
|
|
353
|
-
return strValue;
|
|
255
|
+
return this._dataUnitInMemoryLoader.records;
|
|
354
256
|
}
|
|
355
257
|
set records(records) {
|
|
356
|
-
|
|
357
|
-
const newRecords = records === null || records === void 0 ? void 0 : records.map(record => {
|
|
358
|
-
if (!record["__record__id__"]) {
|
|
359
|
-
record["__record__id__"] = this.generateUniqueId();
|
|
360
|
-
}
|
|
361
|
-
if (columns != undefined) {
|
|
362
|
-
for (const name in record) {
|
|
363
|
-
const value = record[name];
|
|
364
|
-
if (typeof value === "string" && columns.has(name)) {
|
|
365
|
-
record[name] = InMemoryLoader.getConvertedValue(columns.get(name), value);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
return record;
|
|
370
|
-
});
|
|
371
|
-
this._initialRecords = newRecords;
|
|
372
|
-
if (this._dataUnit) {
|
|
373
|
-
//Isso força o refresh internamente no datunit
|
|
374
|
-
this._dataUnit.loadData();
|
|
375
|
-
}
|
|
258
|
+
this._dataUnitInMemoryLoader.records = records;
|
|
376
259
|
}
|
|
377
260
|
get metadata() {
|
|
378
|
-
return this.
|
|
261
|
+
return this._dataUnitInMemoryLoader.metadata;
|
|
379
262
|
}
|
|
380
263
|
set metadata(metadata) {
|
|
381
|
-
this.
|
|
382
|
-
if (this._dataUnit) {
|
|
383
|
-
this._dataUnit.metadata = this._metadata;
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
generateUniqueId() {
|
|
387
|
-
return core.StringUtils.generateUUID();
|
|
388
|
-
}
|
|
389
|
-
inMemoryLoader(dataUnit, request, recordsIn) {
|
|
390
|
-
return buildLoadDataResponse(recordsIn, dataUnit, request);
|
|
391
|
-
}
|
|
392
|
-
metadaLoader() {
|
|
393
|
-
return Promise.resolve(this._metadata);
|
|
394
|
-
}
|
|
395
|
-
saveLoader(_dataUnit, changes) {
|
|
396
|
-
return new Promise((resolve) => {
|
|
397
|
-
let dataUnitRecords = [];
|
|
398
|
-
changes.forEach(change => {
|
|
399
|
-
let { record, updatingFields, operation } = change;
|
|
400
|
-
const changedRecord = Object.assign(Object.assign({}, record), updatingFields);
|
|
401
|
-
if (operation === core.ChangeOperation.INSERT ||
|
|
402
|
-
operation === core.ChangeOperation.COPY) {
|
|
403
|
-
changedRecord["__old__id__"] = record["__record__id__"];
|
|
404
|
-
changedRecord["__record__id__"] = this.generateUniqueId();
|
|
405
|
-
this.records.push(changedRecord);
|
|
406
|
-
}
|
|
407
|
-
else {
|
|
408
|
-
const recordIndex = this.records.findIndex(r => r["__record__id__"] == changedRecord["__record__id__"]);
|
|
409
|
-
this.records[recordIndex] = changedRecord;
|
|
410
|
-
}
|
|
411
|
-
dataUnitRecords.push(changedRecord);
|
|
412
|
-
});
|
|
413
|
-
resolve(dataUnitRecords);
|
|
414
|
-
});
|
|
264
|
+
this._dataUnitInMemoryLoader.metadata = metadata;
|
|
415
265
|
}
|
|
416
266
|
removeLoader(_dataUnit, recordIds) {
|
|
417
|
-
return
|
|
418
|
-
|
|
419
|
-
|
|
267
|
+
return this._dataUnitInMemoryLoader.removeLoader(_dataUnit, recordIds);
|
|
268
|
+
}
|
|
269
|
+
static getConvertedValue(descriptor, strValue, dateFormat) {
|
|
270
|
+
return core.DataUnitInMemoryLoader.getConvertedValue(descriptor, strValue, dateFormat);
|
|
420
271
|
}
|
|
421
272
|
}
|
|
422
|
-
InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME =
|
|
273
|
+
InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME = core.DataUnitInMemoryLoader.IN_MEMORY_DATA_UNIT_NAME;
|
|
423
274
|
|
|
424
275
|
function getRecordValue(record, fieldName) {
|
|
425
276
|
var _a, _b;
|
|
@@ -1260,5 +1111,4 @@ exports.DataUnitFetcher = DataUnitFetcher;
|
|
|
1260
1111
|
exports.DatasetStrategy = DatasetStrategy;
|
|
1261
1112
|
exports.InMemoryLoader = InMemoryLoader;
|
|
1262
1113
|
exports.PreloadManager = PreloadManager;
|
|
1263
|
-
exports.buildLoadDataResponse = buildLoadDataResponse;
|
|
1264
1114
|
exports.getRecordValue = getRecordValue;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
|
6
|
+
const dataunitFetcher = require('./dataunit-fetcher-449d51a3.js');
|
|
7
7
|
require('./DataFetcher-65879b2c.js');
|
|
8
8
|
const pesquisaFetcher = require('./pesquisa-fetcher-5c583c93.js');
|
|
9
9
|
require('@sankhyalabs/core');
|
|
@@ -11,7 +11,7 @@ require('./index-e3e39724.js');
|
|
|
11
11
|
require('./ISave-e91b70a7.js');
|
|
12
12
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
14
|
-
require('./dataunit-fetcher-
|
|
14
|
+
require('./dataunit-fetcher-449d51a3.js');
|
|
15
15
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
16
16
|
const formConfigFetcher = require('./form-config-fetcher-90126e4c.js');
|
|
17
17
|
const constants = require('./constants-241934b3.js');
|
|
@@ -8,7 +8,7 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
|
8
8
|
const ConfigStorage = require('./ConfigStorage-d024aec8.js');
|
|
9
9
|
const DataFetcher = require('./DataFetcher-65879b2c.js');
|
|
10
10
|
const authFetcher = require('./auth-fetcher-8480751c.js');
|
|
11
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
|
11
|
+
const dataunitFetcher = require('./dataunit-fetcher-449d51a3.js');
|
|
12
12
|
const pesquisaFetcher = require('./pesquisa-fetcher-5c583c93.js');
|
|
13
13
|
const SnkMessageBuilder = require('./SnkMessageBuilder-bae64d0d.js');
|
|
14
14
|
const constants = require('./constants-241934b3.js');
|
|
@@ -8,7 +8,7 @@ const DataFetcher = require('./DataFetcher-65879b2c.js');
|
|
|
8
8
|
require('./pesquisa-fetcher-5c583c93.js');
|
|
9
9
|
require('./index-e3e39724.js');
|
|
10
10
|
const ISave = require('./ISave-e91b70a7.js');
|
|
11
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
|
11
|
+
const dataunitFetcher = require('./dataunit-fetcher-449d51a3.js');
|
|
12
12
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
13
13
|
require('./form-config-fetcher-90126e4c.js');
|
|
14
14
|
const constants = require('./constants-241934b3.js');
|
|
@@ -464,7 +464,7 @@ class AttachFetcherDataUnitFactory {
|
|
|
464
464
|
});
|
|
465
465
|
this._records = records;
|
|
466
466
|
}
|
|
467
|
-
return
|
|
467
|
+
return core.DataUnitLoaderUtils.buildLoadDataResponse(this._records, dataUnit, request);
|
|
468
468
|
}
|
|
469
469
|
saveLoader(changes, fetcher) {
|
|
470
470
|
return new Promise((resolve) => {
|
|
@@ -11,7 +11,7 @@ const index$1 = require('./index-e3e39724.js');
|
|
|
11
11
|
require('./ISave-e91b70a7.js');
|
|
12
12
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
14
|
-
require('./dataunit-fetcher-
|
|
14
|
+
require('./dataunit-fetcher-449d51a3.js');
|
|
15
15
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
16
16
|
require('./form-config-fetcher-90126e4c.js');
|
|
17
17
|
const constants = require('./constants-241934b3.js');
|
|
@@ -9,12 +9,12 @@ const IFetchDataExporterParams = require('./IFetchDataExporterParams-e78ec415.js
|
|
|
9
9
|
const index = require('./index-e3e39724.js');
|
|
10
10
|
const constants = require('./constants-241934b3.js');
|
|
11
11
|
const DataFetcher = require('./DataFetcher-65879b2c.js');
|
|
12
|
-
const snkDataUnit = require('./snk-data-unit-
|
|
12
|
+
const snkDataUnit = require('./snk-data-unit-bbd384bf.js');
|
|
13
13
|
require('./pesquisa-fetcher-5c583c93.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
|
-
require('./dataunit-fetcher-
|
|
17
|
+
require('./dataunit-fetcher-449d51a3.js');
|
|
18
18
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
19
19
|
require('./form-config-fetcher-90126e4c.js');
|
|
20
20
|
require('./PrintUtils-bcaeb82f.js');
|
|
@@ -4,7 +4,7 @@ const index = require('./index-f9e81701.js');
|
|
|
4
4
|
const core = require('@sankhyalabs/core');
|
|
5
5
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
6
6
|
const SnkMessageBuilder = require('./SnkMessageBuilder-bae64d0d.js');
|
|
7
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
|
7
|
+
const dataunitFetcher = require('./dataunit-fetcher-449d51a3.js');
|
|
8
8
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
|
9
9
|
const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
|
10
10
|
|
|
@@ -258,7 +258,9 @@ const SnkDataUnit = class {
|
|
|
258
258
|
return new core.DataUnitAction(core.Action.RECORDS_COPIED, this.handleRecordsCopied(action.payload));
|
|
259
259
|
}
|
|
260
260
|
async interceptDataChange(action) {
|
|
261
|
-
|
|
261
|
+
var _a;
|
|
262
|
+
const recordId = (_a = this.dataUnit.getSelectedRecord()) === null || _a === void 0 ? void 0 : _a.__record__id__;
|
|
263
|
+
if (this.isAllowed("UPDATE") || this.dataUnit.isNewRecord(recordId)) {
|
|
262
264
|
return action;
|
|
263
265
|
}
|
|
264
266
|
if (this._openedAlert) {
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const snkDataUnit = require('./snk-data-unit-
|
|
5
|
+
const snkDataUnit = require('./snk-data-unit-bbd384bf.js');
|
|
6
6
|
require('./index-f9e81701.js');
|
|
7
7
|
require('@sankhyalabs/core');
|
|
8
8
|
require('@sankhyalabs/ezui/dist/collection/utils');
|
|
9
9
|
require('./SnkMessageBuilder-bae64d0d.js');
|
|
10
|
-
require('./dataunit-fetcher-
|
|
10
|
+
require('./dataunit-fetcher-449d51a3.js');
|
|
11
11
|
require('./DataFetcher-65879b2c.js');
|
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
@@ -12,12 +12,12 @@ const index$1 = require('./index-e3e39724.js');
|
|
|
12
12
|
require('./ISave-e91b70a7.js');
|
|
13
13
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
14
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
15
|
-
require('./dataunit-fetcher-
|
|
15
|
+
require('./dataunit-fetcher-449d51a3.js');
|
|
16
16
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
17
17
|
require('./form-config-fetcher-90126e4c.js');
|
|
18
18
|
const constants = require('./constants-241934b3.js');
|
|
19
19
|
const taskbarElements = require('./taskbar-elements-7e19882d.js');
|
|
20
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
|
20
|
+
const snkGuidesViewer = require('./snk-guides-viewer-5396062f.js');
|
|
21
21
|
const SnkMessageBuilder = require('./SnkMessageBuilder-bae64d0d.js');
|
|
22
22
|
require('./ConfigStorage-d024aec8.js');
|
|
23
23
|
require('./PrintUtils-bcaeb82f.js');
|
|
@@ -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__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();
|
|
@@ -9,14 +9,14 @@ const ConfigStorage = require('./ConfigStorage-d024aec8.js');
|
|
|
9
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 ClientSideExporterProvider = require('./ClientSideExporterProvider-
|
|
12
|
+
const ClientSideExporterProvider = require('./ClientSideExporterProvider-2f5f350c.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-449d51a3.js');
|
|
20
20
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
21
21
|
require('./form-config-fetcher-90126e4c.js');
|
|
22
22
|
require('./constants-241934b3.js');
|
|
@@ -13,7 +13,7 @@ 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');
|
|
16
|
-
require('./dataunit-fetcher-
|
|
16
|
+
require('./dataunit-fetcher-449d51a3.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-5396062f.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-449d51a3.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-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');
|
|
13
|
-
require('./dataunit-fetcher-
|
|
13
|
+
require('./dataunit-fetcher-449d51a3.js');
|
|
14
14
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
15
15
|
require('./form-config-fetcher-90126e4c.js');
|
|
16
16
|
require('./constants-241934b3.js');
|
|
@@ -9,12 +9,12 @@ const constants = require('./constants-241934b3.js');
|
|
|
9
9
|
const taskbarElements = require('./taskbar-elements-7e19882d.js');
|
|
10
10
|
require('./DataFetcher-65879b2c.js');
|
|
11
11
|
require('./pesquisa-fetcher-5c583c93.js');
|
|
12
|
-
const ClientSideExporterProvider = require('./ClientSideExporterProvider-
|
|
12
|
+
const ClientSideExporterProvider = require('./ClientSideExporterProvider-2f5f350c.js');
|
|
13
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');
|
|
17
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
|
17
|
+
const dataunitFetcher = require('./dataunit-fetcher-449d51a3.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');
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Action, ApplicationContext, StringUtils, } from '@sankhyalabs/core';
|
|
1
|
+
import { Action, ApplicationContext, DataUnitLoaderUtils, StringUtils, } from '@sankhyalabs/core';
|
|
2
2
|
import { SaveErrorsEnum } from '../../../../../lib/http/data-fetcher/fetchers/AttachFetcher/interfaces';
|
|
3
3
|
import { AutorizationType } from '../../../../../lib/http/data-fetcher/fetchers/auth-fetcher';
|
|
4
4
|
import { attachFetcherMetadataBuilder } from '../../builder/attach-crud-config.builder';
|
|
5
5
|
import { VIEW_MODE } from '../../../../../lib/utils/constants';
|
|
6
|
-
import { buildLoadDataResponse } from '../../../../../lib/dataUnit/dataUnitInMemoryUtils';
|
|
7
6
|
const SERVICE_LOAD = "Attach.load";
|
|
8
7
|
export class AttachFetcherDataUnitFactory {
|
|
9
8
|
constructor(getMessage) {
|
|
@@ -49,7 +48,7 @@ export class AttachFetcherDataUnitFactory {
|
|
|
49
48
|
});
|
|
50
49
|
this._records = records;
|
|
51
50
|
}
|
|
52
|
-
return buildLoadDataResponse(this._records, dataUnit, request);
|
|
51
|
+
return DataUnitLoaderUtils.buildLoadDataResponse(this._records, dataUnit, request);
|
|
53
52
|
}
|
|
54
53
|
saveLoader(changes, fetcher) {
|
|
55
54
|
return new Promise((resolve) => {
|
|
@@ -251,7 +251,9 @@ export class SnkDataUnit {
|
|
|
251
251
|
return new DataUnitAction(Action.RECORDS_COPIED, this.handleRecordsCopied(action.payload));
|
|
252
252
|
}
|
|
253
253
|
async interceptDataChange(action) {
|
|
254
|
-
|
|
254
|
+
var _a;
|
|
255
|
+
const recordId = (_a = this.dataUnit.getSelectedRecord()) === null || _a === void 0 ? void 0 : _a.__record__id__;
|
|
256
|
+
if (this.isAllowed("UPDATE") || this.dataUnit.isNewRecord(recordId)) {
|
|
255
257
|
return action;
|
|
256
258
|
}
|
|
257
259
|
if (this._openedAlert) {
|
|
@@ -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"]) {
|
|
@@ -99,10 +99,6 @@
|
|
|
99
99
|
margin-bottom: var(--space--small);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
.snk-filter-bar__scroller {
|
|
103
|
-
height: calc(100% + var(--space-extra-small, 3px));
|
|
104
|
-
}
|
|
105
|
-
|
|
106
102
|
.snk-filter-bar__filter-item-container {
|
|
107
103
|
display: flex;
|
|
108
104
|
align-items: start;
|
|
@@ -484,7 +484,7 @@ export class SnkFilterBar {
|
|
|
484
484
|
if (this.mode !== "regular") {
|
|
485
485
|
return (h(Host, { "data-mode": this.mode }, this.getPersonalizedFilterVariableItems(), this.mode === 'button' && (h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }))));
|
|
486
486
|
}
|
|
487
|
-
return (h(Host, null, h("div", null, h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
|
|
487
|
+
return (h(Host, null, h("div", null, h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), 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) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
|
|
488
488
|
}
|
|
489
489
|
static get is() { return "snk-filter-bar"; }
|
|
490
490
|
static get encapsulation() { return "scoped"; }
|