@linzjs/step-ag-grid 14.9.2 → 14.9.3
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/src/utils/util.d.ts +0 -6
- package/dist/step-ag-grid.esm.js +47 -147
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -2
- package/src/utils/util.test.ts +12 -2
- package/src/utils/util.ts +12 -9
package/dist/src/utils/util.d.ts
CHANGED
|
@@ -5,10 +5,4 @@ export declare const findParentWithClass: (className: string, child: Node) => HT
|
|
|
5
5
|
export declare const hasParentClass: (className: string, child: Node) => boolean;
|
|
6
6
|
export declare const stringByteLengthIsInvalid: (str: string, maxBytes: number) => boolean;
|
|
7
7
|
export declare const fnOrVar: (fn: any, param: any) => any;
|
|
8
|
-
/**
|
|
9
|
-
* Trim filename and replaces troublesome characters.
|
|
10
|
-
*
|
|
11
|
-
* e.g. " LT 1235/543 &%//*$ " => "LT_1235-543_&%-$"
|
|
12
|
-
* e.g. " @filename here!!!" => "@filename_here!!!"
|
|
13
|
-
*/
|
|
14
8
|
export declare const sanitiseFileName: (filename: string) => string;
|
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -223,146 +223,6 @@ const useIntervalHook = ({ callback, timeoutMs }) => {
|
|
|
223
223
|
}, [timeoutMs]);
|
|
224
224
|
};
|
|
225
225
|
|
|
226
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
227
|
-
|
|
228
|
-
function getDefaultExportFromCjs (x) {
|
|
229
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
function getAugmentedNamespace(n) {
|
|
233
|
-
if (n.__esModule) return n;
|
|
234
|
-
var f = n.default;
|
|
235
|
-
if (typeof f == "function") {
|
|
236
|
-
var a = function a () {
|
|
237
|
-
if (this instanceof a) {
|
|
238
|
-
var args = [null];
|
|
239
|
-
args.push.apply(args, arguments);
|
|
240
|
-
var Ctor = Function.bind.apply(f, args);
|
|
241
|
-
return new Ctor();
|
|
242
|
-
}
|
|
243
|
-
return f.apply(this, arguments);
|
|
244
|
-
};
|
|
245
|
-
a.prototype = f.prototype;
|
|
246
|
-
} else a = {};
|
|
247
|
-
Object.defineProperty(a, '__esModule', {value: true});
|
|
248
|
-
Object.keys(n).forEach(function (k) {
|
|
249
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
250
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
251
|
-
enumerable: true,
|
|
252
|
-
get: function () {
|
|
253
|
-
return n[k];
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
|
-
return a;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
function isHighSurrogate(codePoint) {
|
|
261
|
-
return codePoint >= 0xd800 && codePoint <= 0xdbff;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
function isLowSurrogate(codePoint) {
|
|
265
|
-
return codePoint >= 0xdc00 && codePoint <= 0xdfff;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// Truncate string by size in bytes
|
|
269
|
-
var truncate$2 = function truncate(getLength, string, byteLength) {
|
|
270
|
-
if (typeof string !== "string") {
|
|
271
|
-
throw new Error("Input must be string");
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
var charLength = string.length;
|
|
275
|
-
var curByteLength = 0;
|
|
276
|
-
var codePoint;
|
|
277
|
-
var segment;
|
|
278
|
-
|
|
279
|
-
for (var i = 0; i < charLength; i += 1) {
|
|
280
|
-
codePoint = string.charCodeAt(i);
|
|
281
|
-
segment = string[i];
|
|
282
|
-
|
|
283
|
-
if (isHighSurrogate(codePoint) && isLowSurrogate(string.charCodeAt(i + 1))) {
|
|
284
|
-
i += 1;
|
|
285
|
-
segment += string[i];
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
curByteLength += getLength(segment);
|
|
289
|
-
|
|
290
|
-
if (curByteLength === byteLength) {
|
|
291
|
-
return string.slice(0, i + 1);
|
|
292
|
-
}
|
|
293
|
-
else if (curByteLength > byteLength) {
|
|
294
|
-
return string.slice(0, i - segment.length + 1);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
return string;
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
var truncate$1 = truncate$2;
|
|
302
|
-
var getLength = Buffer.byteLength.bind(Buffer);
|
|
303
|
-
var truncateUtf8Bytes = truncate$1.bind(null, getLength);
|
|
304
|
-
|
|
305
|
-
/*jshint node:true*/
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Replaces characters in strings that are illegal/unsafe for filenames.
|
|
309
|
-
* Unsafe characters are either removed or replaced by a substitute set
|
|
310
|
-
* in the optional `options` object.
|
|
311
|
-
*
|
|
312
|
-
* Illegal Characters on Various Operating Systems
|
|
313
|
-
* / ? < > \ : * | "
|
|
314
|
-
* https://kb.acronis.com/content/39790
|
|
315
|
-
*
|
|
316
|
-
* Unicode Control codes
|
|
317
|
-
* C0 0x00-0x1f & C1 (0x80-0x9f)
|
|
318
|
-
* http://en.wikipedia.org/wiki/C0_and_C1_control_codes
|
|
319
|
-
*
|
|
320
|
-
* Reserved filenames on Unix-based systems (".", "..")
|
|
321
|
-
* Reserved filenames in Windows ("CON", "PRN", "AUX", "NUL", "COM1",
|
|
322
|
-
* "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",
|
|
323
|
-
* "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", and
|
|
324
|
-
* "LPT9") case-insesitively and with or without filename extensions.
|
|
325
|
-
*
|
|
326
|
-
* Capped at 255 characters in length.
|
|
327
|
-
* http://unix.stackexchange.com/questions/32795/what-is-the-maximum-allowed-filename-and-folder-size-with-ecryptfs
|
|
328
|
-
*
|
|
329
|
-
* @param {String} input Original filename
|
|
330
|
-
* @param {Object} options {replacement: String | Function }
|
|
331
|
-
* @return {String} Sanitized filename
|
|
332
|
-
*/
|
|
333
|
-
|
|
334
|
-
var truncate = truncateUtf8Bytes;
|
|
335
|
-
|
|
336
|
-
var illegalRe = /[\/\?<>\\:\*\|"]/g;
|
|
337
|
-
var controlRe = /[\x00-\x1f\x80-\x9f]/g;
|
|
338
|
-
var reservedRe = /^\.+$/;
|
|
339
|
-
var windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i;
|
|
340
|
-
var windowsTrailingRe = /[\. ]+$/;
|
|
341
|
-
|
|
342
|
-
function sanitize(input, replacement) {
|
|
343
|
-
if (typeof input !== 'string') {
|
|
344
|
-
throw new Error('Input must be string');
|
|
345
|
-
}
|
|
346
|
-
var sanitized = input
|
|
347
|
-
.replace(illegalRe, replacement)
|
|
348
|
-
.replace(controlRe, replacement)
|
|
349
|
-
.replace(reservedRe, replacement)
|
|
350
|
-
.replace(windowsReservedRe, replacement)
|
|
351
|
-
.replace(windowsTrailingRe, replacement);
|
|
352
|
-
return truncate(sanitized, 255);
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
var sanitizeFilename = function (input, options) {
|
|
356
|
-
var replacement = (options && options.replacement) || '';
|
|
357
|
-
var output = sanitize(input, replacement);
|
|
358
|
-
if (replacement === '') {
|
|
359
|
-
return output;
|
|
360
|
-
}
|
|
361
|
-
return sanitize(output, '');
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
var sanitize$1 = /*@__PURE__*/getDefaultExportFromCjs(sanitizeFilename);
|
|
365
|
-
|
|
366
226
|
const isNotEmpty = negate(isEmpty);
|
|
367
227
|
const wait$2 = (timeoutMs) => new Promise((resolve) => {
|
|
368
228
|
setTimeout(resolve, timeoutMs);
|
|
@@ -401,13 +261,19 @@ const hasParentClass = function (className, child) {
|
|
|
401
261
|
};
|
|
402
262
|
const stringByteLengthIsInvalid = (str, maxBytes) => new TextEncoder().encode(str).length > maxBytes;
|
|
403
263
|
const fnOrVar = (fn, param) => (typeof fn === "function" ? fn(param) : fn);
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
const
|
|
264
|
+
const sanitiseFileName = (filename) => {
|
|
265
|
+
const valid = filename
|
|
266
|
+
.trim()
|
|
267
|
+
.replaceAll(/(\/|\\)+/g, "-")
|
|
268
|
+
.replaceAll(/\s+/g, "_")
|
|
269
|
+
.replaceAll(/[^\w\-āēīōūĀĒĪŌŪ.]/g, "");
|
|
270
|
+
const parts = valid.split(".");
|
|
271
|
+
const fileExt = parts.length > 1 ? parts.pop() : undefined;
|
|
272
|
+
// Arbitrary max filename length of 64 chars + extension
|
|
273
|
+
if (!fileExt)
|
|
274
|
+
return valid.slice().slice(0, 64);
|
|
275
|
+
return valid.slice(0, -fileExt.length - 1).slice(0, 64) + "." + fileExt;
|
|
276
|
+
};
|
|
411
277
|
|
|
412
278
|
const GridNoRowsOverlay = (params) => (jsx("span", { children: isEmpty(params.rowData)
|
|
413
279
|
? params.noRowsOverlayText ?? "There are currently no rows"
|
|
@@ -3168,6 +3034,40 @@ const GridFilterDownloadCsvButton = (csvExportParams) => {
|
|
|
3168
3034
|
} })) : (jsx(GridFilterHeaderIconButton, { icon: "ic_csv_file", title: "Download CSV", onClick: handleDownloadClick, disabled: downloading }));
|
|
3169
3035
|
};
|
|
3170
3036
|
|
|
3037
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
3038
|
+
|
|
3039
|
+
function getDefaultExportFromCjs (x) {
|
|
3040
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3041
|
+
}
|
|
3042
|
+
|
|
3043
|
+
function getAugmentedNamespace(n) {
|
|
3044
|
+
if (n.__esModule) return n;
|
|
3045
|
+
var f = n.default;
|
|
3046
|
+
if (typeof f == "function") {
|
|
3047
|
+
var a = function a () {
|
|
3048
|
+
if (this instanceof a) {
|
|
3049
|
+
var args = [null];
|
|
3050
|
+
args.push.apply(args, arguments);
|
|
3051
|
+
var Ctor = Function.bind.apply(f, args);
|
|
3052
|
+
return new Ctor();
|
|
3053
|
+
}
|
|
3054
|
+
return f.apply(this, arguments);
|
|
3055
|
+
};
|
|
3056
|
+
a.prototype = f.prototype;
|
|
3057
|
+
} else a = {};
|
|
3058
|
+
Object.defineProperty(a, '__esModule', {value: true});
|
|
3059
|
+
Object.keys(n).forEach(function (k) {
|
|
3060
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
3061
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
3062
|
+
enumerable: true,
|
|
3063
|
+
get: function () {
|
|
3064
|
+
return n[k];
|
|
3065
|
+
}
|
|
3066
|
+
});
|
|
3067
|
+
});
|
|
3068
|
+
return a;
|
|
3069
|
+
}
|
|
3070
|
+
|
|
3171
3071
|
/* global setTimeout, clearTimeout */
|
|
3172
3072
|
|
|
3173
3073
|
var dist$1 = function debounce(fn) {
|