@sankhyalabs/sankhyablocks 8.15.11 → 8.15.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-0a690675.js → ConfigStorage-317b99ee.js} +2 -2
- package/dist/cjs/{DataFetcher-77729a93.js → DataFetcher-b7b5d5cf.js} +188 -56
- package/dist/cjs/{SnkFormConfigManager-d6d5db6d.js → SnkFormConfigManager-073e1d5a.js} +2 -2
- package/dist/cjs/{SnkMultiSelectionListDataSource-f79d220c.js → SnkMultiSelectionListDataSource-9893d9ab.js} +3 -3
- package/dist/cjs/{auth-fetcher-29bb791c.js → auth-fetcher-4984b91c.js} +1 -1
- package/dist/cjs/{form-config-fetcher-feb08214.js → form-config-fetcher-a5750a79.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-cba1b3d0.js → pesquisa-fetcher-f238747e.js} +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +4 -4
- package/dist/cjs/snk-application.cjs.entry.js +5 -5
- package/dist/cjs/snk-attach.cjs.entry.js +4 -4
- package/dist/cjs/snk-crud.cjs.entry.js +4 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
- package/dist/cjs/{snk-data-unit-735a1ee5.js → snk-data-unit-e07390ed.js} +7 -6
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +6 -6
- package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid.cjs.entry.js +55 -20
- package/dist/cjs/{snk-guides-viewer-bfcad2d6.js → snk-guides-viewer-182f4ebf.js} +4 -4
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +6 -6
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +6 -6
- package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +1 -1
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +7 -6
- package/dist/collection/components/snk-grid/snk-grid.js +50 -15
- package/dist/components/DataFetcher.js +188 -56
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-data-unit2.js +7 -6
- package/dist/components/snk-grid2.js +50 -15
- package/dist/esm/{ConfigStorage-8c2ddac8.js → ConfigStorage-3f44568f.js} +2 -2
- package/dist/esm/{DataFetcher-773a3e4b.js → DataFetcher-69e38b94.js} +188 -56
- package/dist/esm/{SnkFormConfigManager-c01b9d9d.js → SnkFormConfigManager-b8e8be9c.js} +2 -2
- package/dist/esm/{SnkMultiSelectionListDataSource-a4805051.js → SnkMultiSelectionListDataSource-7f925c1b.js} +3 -3
- package/dist/esm/{auth-fetcher-a411f73c.js → auth-fetcher-1372e2d1.js} +1 -1
- package/dist/esm/{form-config-fetcher-e0382e5a.js → form-config-fetcher-f221fbdd.js} +1 -1
- package/dist/esm/{pesquisa-fetcher-34a8b8be.js → pesquisa-fetcher-6d045e06.js} +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +4 -4
- package/dist/esm/snk-application.entry.js +5 -5
- package/dist/esm/snk-attach.entry.js +4 -4
- package/dist/esm/snk-crud.entry.js +4 -4
- package/dist/esm/snk-data-exporter.entry.js +3 -3
- package/dist/esm/{snk-data-unit-e85c0088.js → snk-data-unit-a91c34aa.js} +7 -6
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +6 -6
- package/dist/esm/snk-filter-bar.entry.js +3 -3
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +2 -2
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid.entry.js +55 -20
- package/dist/esm/{snk-guides-viewer-edeac29f.js → snk-guides-viewer-5723ccec.js} +4 -4
- package/dist/esm/snk-guides-viewer.entry.js +6 -6
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +6 -6
- package/dist/sankhyablocks/{p-2f3b59b4.entry.js → p-13173088.entry.js} +1 -1
- package/dist/sankhyablocks/{p-41c2c191.entry.js → p-19e779bb.entry.js} +1 -1
- package/dist/sankhyablocks/{p-181975f1.js → p-1c73621e.js} +1 -1
- package/dist/sankhyablocks/{p-9fc8dc5c.entry.js → p-20dde3d5.entry.js} +1 -1
- package/dist/sankhyablocks/{p-5630574e.js → p-21f4ad7d.js} +1 -1
- package/dist/sankhyablocks/{p-b85027c6.entry.js → p-2579c3e4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f93c9444.entry.js → p-38d69666.entry.js} +1 -1
- package/dist/sankhyablocks/p-43cf9fa1.js +1 -0
- package/dist/sankhyablocks/{p-c5a9a5d9.entry.js → p-45c04048.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c2ae0fab.entry.js → p-4ad2b2f6.entry.js} +1 -1
- package/dist/sankhyablocks/{p-863351fd.entry.js → p-5577c6c8.entry.js} +1 -1
- package/dist/sankhyablocks/{p-37e5d563.js → p-57b4c3b7.js} +1 -1
- package/dist/sankhyablocks/{p-4a832d16.entry.js → p-601db900.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c5aa7d70.entry.js → p-619e1af7.entry.js} +2 -2
- package/dist/sankhyablocks/{p-96621231.js → p-62ceca72.js} +1 -1
- package/dist/sankhyablocks/{p-a97226f6.entry.js → p-76b77086.entry.js} +1 -1
- package/dist/sankhyablocks/p-884385be.js +1 -0
- package/dist/sankhyablocks/{p-46e55a95.entry.js → p-9100a669.entry.js} +1 -1
- package/dist/sankhyablocks/{p-80c64add.entry.js → p-97af2a3a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f0145e3b.js → p-a6a01b15.js} +1 -1
- package/dist/sankhyablocks/{p-f03e4199.entry.js → p-aff42158.entry.js} +1 -1
- package/dist/sankhyablocks/p-b1997082.entry.js +1 -0
- package/dist/sankhyablocks/{p-86af4cc2.js → p-b7dc87c3.js} +1 -1
- package/dist/sankhyablocks/p-f2dc8ba0.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +7 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-0cd3c0a9.js +0 -1
- package/dist/sankhyablocks/p-594bc21d.js +0 -1
- package/dist/sankhyablocks/p-7c4c841c.entry.js +0 -1
- package/dist/sankhyablocks/p-edb806ca.js +0 -1
@@ -19,25 +19,40 @@ function commonjsRequire () {
|
|
19
19
|
}
|
20
20
|
|
21
21
|
var browserPonyfill = createCommonjsModule(function (module, exports) {
|
22
|
-
|
23
|
-
var
|
22
|
+
// Save global object in a variable
|
23
|
+
var __global__ =
|
24
|
+
(typeof globalThis !== 'undefined' && globalThis) ||
|
25
|
+
(typeof self !== 'undefined' && self) ||
|
26
|
+
(typeof commonjsGlobal !== 'undefined' && commonjsGlobal);
|
27
|
+
// Create an object that extends from __global__ without the fetch function
|
28
|
+
var __globalThis__ = (function () {
|
24
29
|
function F() {
|
25
30
|
this.fetch = false;
|
26
|
-
this.DOMException =
|
31
|
+
this.DOMException = __global__.DOMException;
|
27
32
|
}
|
28
|
-
F.prototype =
|
33
|
+
F.prototype = __global__; // Needed for feature detection on whatwg-fetch's code
|
29
34
|
return new F();
|
30
35
|
})();
|
31
|
-
|
36
|
+
// Wraps whatwg-fetch with a function scope to hijack the global object
|
37
|
+
// "globalThis" that's going to be patched
|
38
|
+
(function(globalThis) {
|
32
39
|
|
33
40
|
((function (exports) {
|
34
41
|
|
42
|
+
/* eslint-disable no-prototype-builtins */
|
43
|
+
var g =
|
44
|
+
(typeof globalThis !== 'undefined' && globalThis) ||
|
45
|
+
(typeof self !== 'undefined' && self) ||
|
46
|
+
// eslint-disable-next-line no-undef
|
47
|
+
(typeof commonjsGlobal !== 'undefined' && commonjsGlobal) ||
|
48
|
+
{};
|
49
|
+
|
35
50
|
var support = {
|
36
|
-
searchParams: 'URLSearchParams' in
|
37
|
-
iterable: 'Symbol' in
|
51
|
+
searchParams: 'URLSearchParams' in g,
|
52
|
+
iterable: 'Symbol' in g && 'iterator' in Symbol,
|
38
53
|
blob:
|
39
|
-
'FileReader' in
|
40
|
-
'Blob' in
|
54
|
+
'FileReader' in g &&
|
55
|
+
'Blob' in g &&
|
41
56
|
(function() {
|
42
57
|
try {
|
43
58
|
new Blob();
|
@@ -46,8 +61,8 @@ return new F();
|
|
46
61
|
return false
|
47
62
|
}
|
48
63
|
})(),
|
49
|
-
formData: 'FormData' in
|
50
|
-
arrayBuffer: 'ArrayBuffer' in
|
64
|
+
formData: 'FormData' in g,
|
65
|
+
arrayBuffer: 'ArrayBuffer' in g
|
51
66
|
};
|
52
67
|
|
53
68
|
function isDataView(obj) {
|
@@ -78,8 +93,8 @@ return new F();
|
|
78
93
|
if (typeof name !== 'string') {
|
79
94
|
name = String(name);
|
80
95
|
}
|
81
|
-
if (/[^a-z0-9\-#$%&'*+.^_
|
82
|
-
throw new TypeError('Invalid character in header field name')
|
96
|
+
if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {
|
97
|
+
throw new TypeError('Invalid character in header field name: "' + name + '"')
|
83
98
|
}
|
84
99
|
return name.toLowerCase()
|
85
100
|
}
|
@@ -118,6 +133,9 @@ return new F();
|
|
118
133
|
}, this);
|
119
134
|
} else if (Array.isArray(headers)) {
|
120
135
|
headers.forEach(function(header) {
|
136
|
+
if (header.length != 2) {
|
137
|
+
throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length)
|
138
|
+
}
|
121
139
|
this.append(header[0], header[1]);
|
122
140
|
}, this);
|
123
141
|
} else if (headers) {
|
@@ -188,6 +206,7 @@ return new F();
|
|
188
206
|
}
|
189
207
|
|
190
208
|
function consumed(body) {
|
209
|
+
if (body._noBody) return
|
191
210
|
if (body.bodyUsed) {
|
192
211
|
return Promise.reject(new TypeError('Already read'))
|
193
212
|
}
|
@@ -215,7 +234,9 @@ return new F();
|
|
215
234
|
function readBlobAsText(blob) {
|
216
235
|
var reader = new FileReader();
|
217
236
|
var promise = fileReaderReady(reader);
|
218
|
-
|
237
|
+
var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
|
238
|
+
var encoding = match ? match[1] : 'utf-8';
|
239
|
+
reader.readAsText(blob, encoding);
|
219
240
|
return promise
|
220
241
|
}
|
221
242
|
|
@@ -243,8 +264,21 @@ return new F();
|
|
243
264
|
this.bodyUsed = false;
|
244
265
|
|
245
266
|
this._initBody = function(body) {
|
267
|
+
/*
|
268
|
+
fetch-mock wraps the Response object in an ES6 Proxy to
|
269
|
+
provide useful test harness features such as flush. However, on
|
270
|
+
ES5 browsers without fetch or Proxy support pollyfills must be used;
|
271
|
+
the proxy-pollyfill is unable to proxy an attribute unless it exists
|
272
|
+
on the object before the Proxy is created. This change ensures
|
273
|
+
Response.bodyUsed exists on the instance, while maintaining the
|
274
|
+
semantic of setting Request.bodyUsed in the constructor before
|
275
|
+
_initBody is called.
|
276
|
+
*/
|
277
|
+
// eslint-disable-next-line no-self-assign
|
278
|
+
this.bodyUsed = this.bodyUsed;
|
246
279
|
this._bodyInit = body;
|
247
280
|
if (!body) {
|
281
|
+
this._noBody = true;
|
248
282
|
this._bodyText = '';
|
249
283
|
} else if (typeof body === 'string') {
|
250
284
|
this._bodyText = body;
|
@@ -292,15 +326,29 @@ return new F();
|
|
292
326
|
return Promise.resolve(new Blob([this._bodyText]))
|
293
327
|
}
|
294
328
|
};
|
329
|
+
}
|
295
330
|
|
296
|
-
|
297
|
-
|
298
|
-
|
331
|
+
this.arrayBuffer = function() {
|
332
|
+
if (this._bodyArrayBuffer) {
|
333
|
+
var isConsumed = consumed(this);
|
334
|
+
if (isConsumed) {
|
335
|
+
return isConsumed
|
336
|
+
} else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
|
337
|
+
return Promise.resolve(
|
338
|
+
this._bodyArrayBuffer.buffer.slice(
|
339
|
+
this._bodyArrayBuffer.byteOffset,
|
340
|
+
this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
|
341
|
+
)
|
342
|
+
)
|
299
343
|
} else {
|
300
|
-
return
|
344
|
+
return Promise.resolve(this._bodyArrayBuffer)
|
301
345
|
}
|
302
|
-
}
|
303
|
-
|
346
|
+
} else if (support.blob) {
|
347
|
+
return this.blob().then(readBlobAsArrayBuffer)
|
348
|
+
} else {
|
349
|
+
throw new Error('could not read as ArrayBuffer')
|
350
|
+
}
|
351
|
+
};
|
304
352
|
|
305
353
|
this.text = function() {
|
306
354
|
var rejected = consumed(this);
|
@@ -333,7 +381,7 @@ return new F();
|
|
333
381
|
}
|
334
382
|
|
335
383
|
// HTTP methods whose capitalization should be normalized
|
336
|
-
var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
|
384
|
+
var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'];
|
337
385
|
|
338
386
|
function normalizeMethod(method) {
|
339
387
|
var upcased = method.toUpperCase();
|
@@ -341,6 +389,10 @@ return new F();
|
|
341
389
|
}
|
342
390
|
|
343
391
|
function Request(input, options) {
|
392
|
+
if (!(this instanceof Request)) {
|
393
|
+
throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
|
394
|
+
}
|
395
|
+
|
344
396
|
options = options || {};
|
345
397
|
var body = options.body;
|
346
398
|
|
@@ -370,13 +422,33 @@ return new F();
|
|
370
422
|
}
|
371
423
|
this.method = normalizeMethod(options.method || this.method || 'GET');
|
372
424
|
this.mode = options.mode || this.mode || null;
|
373
|
-
this.signal = options.signal || this.signal
|
425
|
+
this.signal = options.signal || this.signal || (function () {
|
426
|
+
if ('AbortController' in g) {
|
427
|
+
var ctrl = new AbortController();
|
428
|
+
return ctrl.signal;
|
429
|
+
}
|
430
|
+
}());
|
374
431
|
this.referrer = null;
|
375
432
|
|
376
433
|
if ((this.method === 'GET' || this.method === 'HEAD') && body) {
|
377
434
|
throw new TypeError('Body not allowed for GET or HEAD requests')
|
378
435
|
}
|
379
436
|
this._initBody(body);
|
437
|
+
|
438
|
+
if (this.method === 'GET' || this.method === 'HEAD') {
|
439
|
+
if (options.cache === 'no-store' || options.cache === 'no-cache') {
|
440
|
+
// Search for a '_' parameter in the query string
|
441
|
+
var reParamSearch = /([?&])_=[^&]*/;
|
442
|
+
if (reParamSearch.test(this.url)) {
|
443
|
+
// If it already exists then set the value with the current time
|
444
|
+
this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());
|
445
|
+
} else {
|
446
|
+
// Otherwise add a new '_' parameter to the end with the current time
|
447
|
+
var reQueryString = /\?/;
|
448
|
+
this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();
|
449
|
+
}
|
450
|
+
}
|
451
|
+
}
|
380
452
|
}
|
381
453
|
|
382
454
|
Request.prototype.clone = function() {
|
@@ -404,28 +476,46 @@ return new F();
|
|
404
476
|
// Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
|
405
477
|
// https://tools.ietf.org/html/rfc7230#section-3.2
|
406
478
|
var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
479
|
+
// Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill
|
480
|
+
// https://github.com/github/fetch/issues/748
|
481
|
+
// https://github.com/zloirock/core-js/issues/751
|
482
|
+
preProcessedHeaders
|
483
|
+
.split('\r')
|
484
|
+
.map(function(header) {
|
485
|
+
return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header
|
486
|
+
})
|
487
|
+
.forEach(function(line) {
|
488
|
+
var parts = line.split(':');
|
489
|
+
var key = parts.shift().trim();
|
490
|
+
if (key) {
|
491
|
+
var value = parts.join(':').trim();
|
492
|
+
try {
|
493
|
+
headers.append(key, value);
|
494
|
+
} catch (error) {
|
495
|
+
console.warn('Response ' + error.message);
|
496
|
+
}
|
497
|
+
}
|
498
|
+
});
|
415
499
|
return headers
|
416
500
|
}
|
417
501
|
|
418
502
|
Body.call(Request.prototype);
|
419
503
|
|
420
504
|
function Response(bodyInit, options) {
|
505
|
+
if (!(this instanceof Response)) {
|
506
|
+
throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
|
507
|
+
}
|
421
508
|
if (!options) {
|
422
509
|
options = {};
|
423
510
|
}
|
424
511
|
|
425
512
|
this.type = 'default';
|
426
513
|
this.status = options.status === undefined ? 200 : options.status;
|
514
|
+
if (this.status < 200 || this.status > 599) {
|
515
|
+
throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].")
|
516
|
+
}
|
427
517
|
this.ok = this.status >= 200 && this.status < 300;
|
428
|
-
this.statusText =
|
518
|
+
this.statusText = options.statusText === undefined ? '' : '' + options.statusText;
|
429
519
|
this.headers = new Headers(options.headers);
|
430
520
|
this.url = options.url || '';
|
431
521
|
this._initBody(bodyInit);
|
@@ -443,7 +533,9 @@ return new F();
|
|
443
533
|
};
|
444
534
|
|
445
535
|
Response.error = function() {
|
446
|
-
var response = new Response(null, {status:
|
536
|
+
var response = new Response(null, {status: 200, statusText: ''});
|
537
|
+
response.ok = false;
|
538
|
+
response.status = 0;
|
447
539
|
response.type = 'error';
|
448
540
|
return response
|
449
541
|
};
|
@@ -458,7 +550,7 @@ return new F();
|
|
458
550
|
return new Response(null, {status: status, headers: {location: url}})
|
459
551
|
};
|
460
552
|
|
461
|
-
exports.DOMException =
|
553
|
+
exports.DOMException = g.DOMException;
|
462
554
|
try {
|
463
555
|
new exports.DOMException();
|
464
556
|
} catch (err) {
|
@@ -488,28 +580,50 @@ return new F();
|
|
488
580
|
|
489
581
|
xhr.onload = function() {
|
490
582
|
var options = {
|
491
|
-
status: xhr.status,
|
492
583
|
statusText: xhr.statusText,
|
493
584
|
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
|
494
585
|
};
|
586
|
+
// This check if specifically for when a user fetches a file locally from the file system
|
587
|
+
// Only if the status is out of a normal range
|
588
|
+
if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) {
|
589
|
+
options.status = 200;
|
590
|
+
} else {
|
591
|
+
options.status = xhr.status;
|
592
|
+
}
|
495
593
|
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
|
496
594
|
var body = 'response' in xhr ? xhr.response : xhr.responseText;
|
497
|
-
|
595
|
+
setTimeout(function() {
|
596
|
+
resolve(new Response(body, options));
|
597
|
+
}, 0);
|
498
598
|
};
|
499
599
|
|
500
600
|
xhr.onerror = function() {
|
501
|
-
|
601
|
+
setTimeout(function() {
|
602
|
+
reject(new TypeError('Network request failed'));
|
603
|
+
}, 0);
|
502
604
|
};
|
503
605
|
|
504
606
|
xhr.ontimeout = function() {
|
505
|
-
|
607
|
+
setTimeout(function() {
|
608
|
+
reject(new TypeError('Network request timed out'));
|
609
|
+
}, 0);
|
506
610
|
};
|
507
611
|
|
508
612
|
xhr.onabort = function() {
|
509
|
-
|
613
|
+
setTimeout(function() {
|
614
|
+
reject(new exports.DOMException('Aborted', 'AbortError'));
|
615
|
+
}, 0);
|
510
616
|
};
|
511
617
|
|
512
|
-
|
618
|
+
function fixUrl(url) {
|
619
|
+
try {
|
620
|
+
return url === '' && g.location.href ? g.location.href : url
|
621
|
+
} catch (e) {
|
622
|
+
return url
|
623
|
+
}
|
624
|
+
}
|
625
|
+
|
626
|
+
xhr.open(request.method, fixUrl(request.url), true);
|
513
627
|
|
514
628
|
if (request.credentials === 'include') {
|
515
629
|
xhr.withCredentials = true;
|
@@ -517,13 +631,32 @@ return new F();
|
|
517
631
|
xhr.withCredentials = false;
|
518
632
|
}
|
519
633
|
|
520
|
-
if ('responseType' in xhr
|
521
|
-
|
634
|
+
if ('responseType' in xhr) {
|
635
|
+
if (support.blob) {
|
636
|
+
xhr.responseType = 'blob';
|
637
|
+
} else if (
|
638
|
+
support.arrayBuffer
|
639
|
+
) {
|
640
|
+
xhr.responseType = 'arraybuffer';
|
641
|
+
}
|
522
642
|
}
|
523
643
|
|
524
|
-
|
525
|
-
|
526
|
-
|
644
|
+
if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {
|
645
|
+
var names = [];
|
646
|
+
Object.getOwnPropertyNames(init.headers).forEach(function(name) {
|
647
|
+
names.push(normalizeName(name));
|
648
|
+
xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
|
649
|
+
});
|
650
|
+
request.headers.forEach(function(value, name) {
|
651
|
+
if (names.indexOf(name) === -1) {
|
652
|
+
xhr.setRequestHeader(name, value);
|
653
|
+
}
|
654
|
+
});
|
655
|
+
} else {
|
656
|
+
request.headers.forEach(function(value, name) {
|
657
|
+
xhr.setRequestHeader(name, value);
|
658
|
+
});
|
659
|
+
}
|
527
660
|
|
528
661
|
if (request.signal) {
|
529
662
|
request.signal.addEventListener('abort', abortXhr);
|
@@ -542,11 +675,11 @@ return new F();
|
|
542
675
|
|
543
676
|
fetch.polyfill = true;
|
544
677
|
|
545
|
-
if (!
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
678
|
+
if (!g.fetch) {
|
679
|
+
g.fetch = fetch;
|
680
|
+
g.Headers = Headers;
|
681
|
+
g.Request = Request;
|
682
|
+
g.Response = Response;
|
550
683
|
}
|
551
684
|
|
552
685
|
exports.Headers = Headers;
|
@@ -559,13 +692,12 @@ return new F();
|
|
559
692
|
return exports;
|
560
693
|
|
561
694
|
}))({});
|
562
|
-
})(
|
563
|
-
|
564
|
-
|
565
|
-
delete
|
566
|
-
// Choose between native implementation (
|
567
|
-
|
568
|
-
var ctx = __self__; // this line disable service worker support temporarily
|
695
|
+
})(__globalThis__);
|
696
|
+
// This is a ponyfill, so...
|
697
|
+
__globalThis__.fetch.ponyfill = true;
|
698
|
+
delete __globalThis__.fetch.polyfill;
|
699
|
+
// Choose between native implementation (__global__) or custom implementation (__globalThis__)
|
700
|
+
var ctx = __global__.fetch ? __global__ : __globalThis__;
|
569
701
|
exports = ctx.fetch; // To enable: import fetch from 'cross-fetch'
|
570
702
|
exports.default = ctx.fetch; // For TypeScript consumers without esModuleInterop.
|
571
703
|
exports.fetch = ctx.fetch; // To enable: import {fetch} from 'cross-fetch'
|
@@ -207,7 +207,7 @@ function getFormatResponse(result) {
|
|
207
207
|
return ObjectUtils.stringToObject(response);
|
208
208
|
}
|
209
209
|
|
210
|
-
const DOC_MAX_WIDTH =
|
210
|
+
const DOC_MAX_WIDTH = 860;
|
211
211
|
function getVisibleColumns(columns) {
|
212
212
|
const visibleColumns = [];
|
213
213
|
let totalWidth = 0;
|
@@ -134,7 +134,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
134
134
|
}
|
135
135
|
async interceptAction(action) {
|
136
136
|
return new Promise(resolve => {
|
137
|
-
var _a, _b, _c, _d, _e;
|
137
|
+
var _a, _b, _c, _d, _e, _f;
|
138
138
|
switch (action.type) {
|
139
139
|
case Action.RECORDS_ADDED:
|
140
140
|
if (this.isAllowed("INSERT")) {
|
@@ -163,7 +163,8 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
163
163
|
break;
|
164
164
|
case Action.DATA_CHANGED:
|
165
165
|
case Action.CHANGING_DATA:
|
166
|
-
|
166
|
+
const recordId = (_a = this.dataUnit.getSelectedRecord()) === null || _a === void 0 ? void 0 : _a.__record__id__;
|
167
|
+
if (this.isAllowed("UPDATE") || this.dataUnit.isNewRecord(recordId))
|
167
168
|
return resolve(action);
|
168
169
|
if (this._openedAlert)
|
169
170
|
return this.dataUnit.cancelEdition();
|
@@ -200,7 +201,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
200
201
|
return resolve(action);
|
201
202
|
if (this.dataState.hasDirtyRecords) {
|
202
203
|
const cancelConfirmation = this.getMessage("snkDataUnit.cancelConfirmation");
|
203
|
-
if (((
|
204
|
+
if (((_b = action.payload) === null || _b === void 0 ? void 0 : _b.fromParent) || ((_c = action.payload) === null || _c === void 0 ? void 0 : _c.silent)) {
|
204
205
|
resolve(action);
|
205
206
|
return;
|
206
207
|
}
|
@@ -224,9 +225,9 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
224
225
|
case Action.REMOVING_RECORDS:
|
225
226
|
if (this.isAllowed("REMOVE")) {
|
226
227
|
let multipleSelection = false;
|
227
|
-
let removeConfirmation = !((
|
228
|
-
const selection = (
|
229
|
-
if (!((
|
228
|
+
let removeConfirmation = !((_d = action.payload) === null || _d === void 0 ? void 0 : _d.silent) && this.getMessage("snkDataUnit.removeConfirmation");
|
229
|
+
const selection = (_e = this.dataUnit) === null || _e === void 0 ? void 0 : _e.getSelectionInfo();
|
230
|
+
if (!((_f = action.payload) === null || _f === void 0 ? void 0 : _f.silent) && (selection === null || selection === void 0 ? void 0 : selection.length) > 1) {
|
230
231
|
removeConfirmation = this.getMessage("snkDataUnit.removeAllConfirmation", { size: selection.length });
|
231
232
|
multipleSelection = true;
|
232
233
|
}
|
@@ -38,6 +38,9 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
38
38
|
this.__registerHost();
|
39
39
|
this.actionClick = createEvent(this, "actionClick", 7);
|
40
40
|
this.gridDoubleClick = createEvent(this, "gridDoubleClick", 7);
|
41
|
+
this.MAX_WIDTH_COD = 60;
|
42
|
+
this.MIN_WIDTH_COD = 10;
|
43
|
+
this.DEFAULT_FONT_SIZE = 13;
|
41
44
|
this._topTaskbarProcessor = new TaskbarProcessor({
|
42
45
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
43
46
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
@@ -190,7 +193,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
190
193
|
buildColumnsMetadata(gridColumns) {
|
191
194
|
const columnsMetadata = [];
|
192
195
|
gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
|
193
|
-
var _a, _b;
|
196
|
+
var _a, _b, _c;
|
194
197
|
/**
|
195
198
|
* TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
|
196
199
|
*/
|
@@ -198,29 +201,61 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
198
201
|
return;
|
199
202
|
}
|
200
203
|
const fieldData = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
|
201
|
-
const
|
202
|
-
|
204
|
+
const isUserInterfaceSEARCH = (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UserInterface.SEARCH;
|
205
|
+
const widthColumnDefault = 60;
|
206
|
+
const labelColumn = isUserInterfaceSEARCH ? "Cód. " : column.label;
|
207
|
+
let descriptionColumn = undefined;
|
208
|
+
let columnData = {
|
203
209
|
id: column.name,
|
204
|
-
|
210
|
+
label: labelColumn,
|
211
|
+
width: isUserInterfaceSEARCH ? ((labelColumn === null || labelColumn === void 0 ? void 0 : labelColumn.length) * this.DEFAULT_FONT_SIZE) : column.width,
|
205
212
|
type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
206
213
|
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
|
207
214
|
};
|
215
|
+
if (isUserInterfaceSEARCH) {
|
216
|
+
if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
|
217
|
+
const labelDescription = (_c = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _c === void 0 ? void 0 : _c.DESCRIPTIONENTITY;
|
218
|
+
const mergedFrom = fieldData.properties.mergedFrom;
|
219
|
+
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
220
|
+
descriptionColumn = {
|
221
|
+
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
222
|
+
label: labelDescription,
|
223
|
+
width: isUserInterfaceSEARCH && labelDescription ? ((labelDescription === null || labelDescription === void 0 ? void 0 : labelDescription.length) * this.DEFAULT_FONT_SIZE - widthColumnDefault) : column.width,
|
224
|
+
type: DataType.TEXT,
|
225
|
+
userInterface: UserInterface.LONGTEXT
|
226
|
+
};
|
227
|
+
}
|
228
|
+
if (descriptionColumn) {
|
229
|
+
const newWidth = this.getWidthByMetaData(column === null || column === void 0 ? void 0 : column.width, columnData === null || columnData === void 0 ? void 0 : columnData.width, descriptionColumn === null || descriptionColumn === void 0 ? void 0 : descriptionColumn.width);
|
230
|
+
columnData = Object.assign(Object.assign({}, columnData), { width: newWidth === null || newWidth === void 0 ? void 0 : newWidth.codWidth });
|
231
|
+
descriptionColumn = Object.assign(Object.assign({}, descriptionColumn), { width: newWidth === null || newWidth === void 0 ? void 0 : newWidth.descWidth, label: (descriptionColumn === null || descriptionColumn === void 0 ? void 0 : descriptionColumn.label) || (column === null || column === void 0 ? void 0 : column.label) });
|
232
|
+
}
|
233
|
+
}
|
208
234
|
columnsMetadata.push(columnData);
|
209
|
-
if (
|
210
|
-
const mergedFrom = fieldData.properties.mergedFrom;
|
211
|
-
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
212
|
-
const descriptionColumn = {
|
213
|
-
label: fieldData.properties.DESCRIPTIONENTITY,
|
214
|
-
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
215
|
-
width: column.width,
|
216
|
-
type: DataType.TEXT,
|
217
|
-
userInterface: UserInterface.LONGTEXT
|
218
|
-
};
|
235
|
+
if (descriptionColumn)
|
219
236
|
columnsMetadata.push(descriptionColumn);
|
220
|
-
}
|
221
237
|
});
|
222
238
|
return columnsMetadata || [];
|
223
239
|
}
|
240
|
+
getWidthByMetaData(maxWidth, widthCod, widthDescription) {
|
241
|
+
const totalCurrentWidth = widthCod + widthDescription;
|
242
|
+
const codPercentage = widthCod / totalCurrentWidth;
|
243
|
+
const descPercentage = widthDescription / totalCurrentWidth;
|
244
|
+
let newWidthCod = Math.round(maxWidth * codPercentage);
|
245
|
+
let newWidthDescription = Math.round(maxWidth * descPercentage);
|
246
|
+
if (newWidthCod > this.MAX_WIDTH_COD) {
|
247
|
+
newWidthCod = this.MAX_WIDTH_COD;
|
248
|
+
newWidthDescription = maxWidth - this.MAX_WIDTH_COD;
|
249
|
+
}
|
250
|
+
else if (newWidthCod < this.MIN_WIDTH_COD) {
|
251
|
+
newWidthCod = this.MIN_WIDTH_COD;
|
252
|
+
newWidthDescription = maxWidth - this.MIN_WIDTH_COD;
|
253
|
+
}
|
254
|
+
return {
|
255
|
+
codWidth: newWidthCod,
|
256
|
+
descWidth: newWidthDescription
|
257
|
+
};
|
258
|
+
}
|
224
259
|
getPaginationInfo() {
|
225
260
|
var _a;
|
226
261
|
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo();
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-
|
1
|
+
import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-f221fbdd.js';
|
2
2
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
3
3
|
import { ObjectUtils } from '@sankhyalabs/core';
|
4
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-
|
4
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-69e38b94.js';
|
5
5
|
|
6
6
|
class GridConfigFetcher extends ResourceFetcher {
|
7
7
|
constructor() {
|