@patternfly/react-table 4.38.0 → 4.38.1
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/CHANGELOG.md +11 -0
- package/dist/umd/react-table.css +1263 -1263
- package/dist/umd/react-table.js +88 -88
- package/package.json +6 -6
package/dist/umd/react-table.js
CHANGED
|
@@ -3243,6 +3243,94 @@
|
|
|
3243
3243
|
noSpaceHandling: false
|
|
3244
3244
|
};
|
|
3245
3245
|
|
|
3246
|
+
/**
|
|
3247
|
+
* This function creates a ResizeObserver used to handle resize events for the given containerRef. If ResizeObserver
|
|
3248
|
+
* or the given containerRef are not available, a window resize event listener is used by default.
|
|
3249
|
+
*
|
|
3250
|
+
* Example 1:
|
|
3251
|
+
*
|
|
3252
|
+
* private containerRef = React.createRef<HTMLDivElement>();
|
|
3253
|
+
* private observer: any = () => {};
|
|
3254
|
+
*
|
|
3255
|
+
* public componentDidMount() {
|
|
3256
|
+
* this.observer = getResizeObserver(this.containerRef.current, this.handleResize);
|
|
3257
|
+
* }
|
|
3258
|
+
*
|
|
3259
|
+
* public componentWillUnmount() {
|
|
3260
|
+
* this.observer();
|
|
3261
|
+
* }
|
|
3262
|
+
*
|
|
3263
|
+
* private handleResize = () => {
|
|
3264
|
+
* if (this.containerRef.current && this.containerRef.current.clientWidth) {
|
|
3265
|
+
* this.setState({ width: this.containerRef.current.clientWidth });
|
|
3266
|
+
* }
|
|
3267
|
+
* };
|
|
3268
|
+
*
|
|
3269
|
+
* public render() {
|
|
3270
|
+
* return (
|
|
3271
|
+
* <div ref={this.containerRef} >
|
|
3272
|
+
* <Chart width={this.state.width} ... />
|
|
3273
|
+
* </div>
|
|
3274
|
+
* );
|
|
3275
|
+
* }
|
|
3276
|
+
*
|
|
3277
|
+
* Example 2:
|
|
3278
|
+
*
|
|
3279
|
+
* private inputRef = React.createRef<HTMLInputElement>();
|
|
3280
|
+
* private observer: any = () => {};
|
|
3281
|
+
*
|
|
3282
|
+
* public componentDidMount() {
|
|
3283
|
+
* this.observer = getResizeObserver(this.inputRef.current, this.handleResize);
|
|
3284
|
+
* }
|
|
3285
|
+
*
|
|
3286
|
+
* public componentWillUnmount() {
|
|
3287
|
+
* this.observer();
|
|
3288
|
+
* }
|
|
3289
|
+
*
|
|
3290
|
+
* private handleResize = () => {
|
|
3291
|
+
* if (this.inputRef.current) {
|
|
3292
|
+
* trimLeft(inputRef.current, String(this.props.value));
|
|
3293
|
+
* }
|
|
3294
|
+
* };
|
|
3295
|
+
*
|
|
3296
|
+
* public render() {
|
|
3297
|
+
* return (
|
|
3298
|
+
* <input ref={this.inputRef} ... />
|
|
3299
|
+
* );
|
|
3300
|
+
* }
|
|
3301
|
+
*
|
|
3302
|
+
* @param {Element} containerRefElement The container reference to observe
|
|
3303
|
+
* @param {Function} handleResize The function to call for resize events
|
|
3304
|
+
* @return {Function} The function used to unobserve resize events
|
|
3305
|
+
*/
|
|
3306
|
+
const getResizeObserver = (containerRefElement, handleResize) => {
|
|
3307
|
+
let unobserve;
|
|
3308
|
+
if (canUseDOM) {
|
|
3309
|
+
const { ResizeObserver } = window;
|
|
3310
|
+
if (containerRefElement && ResizeObserver) {
|
|
3311
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
3312
|
+
// Wrap resize function in requestAnimationFrame to avoid "ResizeObserver loop limit exceeded" errors
|
|
3313
|
+
window.requestAnimationFrame(() => {
|
|
3314
|
+
if (Array.isArray(entries) && entries.length > 0) {
|
|
3315
|
+
handleResize();
|
|
3316
|
+
}
|
|
3317
|
+
});
|
|
3318
|
+
});
|
|
3319
|
+
resizeObserver.observe(containerRefElement);
|
|
3320
|
+
unobserve = () => resizeObserver.unobserve(containerRefElement);
|
|
3321
|
+
}
|
|
3322
|
+
else {
|
|
3323
|
+
window.addEventListener('resize', handleResize);
|
|
3324
|
+
unobserve = () => window.removeEventListener('resize', handleResize);
|
|
3325
|
+
}
|
|
3326
|
+
}
|
|
3327
|
+
return () => {
|
|
3328
|
+
if (unobserve) {
|
|
3329
|
+
unobserve();
|
|
3330
|
+
}
|
|
3331
|
+
};
|
|
3332
|
+
};
|
|
3333
|
+
|
|
3246
3334
|
var _default$j = {
|
|
3247
3335
|
"bullseye": "pf-l-bullseye"
|
|
3248
3336
|
};
|
|
@@ -4441,94 +4529,6 @@
|
|
|
4441
4529
|
}));
|
|
4442
4530
|
};
|
|
4443
4531
|
|
|
4444
|
-
/**
|
|
4445
|
-
* This function creates a ResizeObserver used to handle resize events for the given containerRef. If ResizeObserver
|
|
4446
|
-
* or the given containerRef are not available, a window resize event listener is used by default.
|
|
4447
|
-
*
|
|
4448
|
-
* Example 1:
|
|
4449
|
-
*
|
|
4450
|
-
* private containerRef = React.createRef<HTMLDivElement>();
|
|
4451
|
-
* private observer: any = () => {};
|
|
4452
|
-
*
|
|
4453
|
-
* public componentDidMount() {
|
|
4454
|
-
* this.observer = getResizeObserver(this.containerRef.current, this.handleResize);
|
|
4455
|
-
* }
|
|
4456
|
-
*
|
|
4457
|
-
* public componentWillUnmount() {
|
|
4458
|
-
* this.observer();
|
|
4459
|
-
* }
|
|
4460
|
-
*
|
|
4461
|
-
* private handleResize = () => {
|
|
4462
|
-
* if (this.containerRef.current && this.containerRef.current.clientWidth) {
|
|
4463
|
-
* this.setState({ width: this.containerRef.current.clientWidth });
|
|
4464
|
-
* }
|
|
4465
|
-
* };
|
|
4466
|
-
*
|
|
4467
|
-
* public render() {
|
|
4468
|
-
* return (
|
|
4469
|
-
* <div ref={this.containerRef} >
|
|
4470
|
-
* <Chart width={this.state.width} ... />
|
|
4471
|
-
* </div>
|
|
4472
|
-
* );
|
|
4473
|
-
* }
|
|
4474
|
-
*
|
|
4475
|
-
* Example 2:
|
|
4476
|
-
*
|
|
4477
|
-
* private inputRef = React.createRef<HTMLInputElement>();
|
|
4478
|
-
* private observer: any = () => {};
|
|
4479
|
-
*
|
|
4480
|
-
* public componentDidMount() {
|
|
4481
|
-
* this.observer = getResizeObserver(this.inputRef.current, this.handleResize);
|
|
4482
|
-
* }
|
|
4483
|
-
*
|
|
4484
|
-
* public componentWillUnmount() {
|
|
4485
|
-
* this.observer();
|
|
4486
|
-
* }
|
|
4487
|
-
*
|
|
4488
|
-
* private handleResize = () => {
|
|
4489
|
-
* if (this.inputRef.current) {
|
|
4490
|
-
* trimLeft(inputRef.current, String(this.props.value));
|
|
4491
|
-
* }
|
|
4492
|
-
* };
|
|
4493
|
-
*
|
|
4494
|
-
* public render() {
|
|
4495
|
-
* return (
|
|
4496
|
-
* <input ref={this.inputRef} ... />
|
|
4497
|
-
* );
|
|
4498
|
-
* }
|
|
4499
|
-
*
|
|
4500
|
-
* @param {React.RefObject} containerRef The container reference to observe
|
|
4501
|
-
* @param {Function} handleResize The function to call for resize events
|
|
4502
|
-
* @return {Function} The function used to unobserve resize events
|
|
4503
|
-
*/
|
|
4504
|
-
const getResizeObserver = (containerRef, handleResize) => {
|
|
4505
|
-
let unobserve;
|
|
4506
|
-
if (canUseDOM) {
|
|
4507
|
-
const { ResizeObserver } = window;
|
|
4508
|
-
if (containerRef && ResizeObserver) {
|
|
4509
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
4510
|
-
// Wrap resize function in requestAnimationFrame to avoid "ResizeObserver loop limit exceeded" errors
|
|
4511
|
-
window.requestAnimationFrame(() => {
|
|
4512
|
-
if (Array.isArray(entries) && entries.length > 0) {
|
|
4513
|
-
handleResize();
|
|
4514
|
-
}
|
|
4515
|
-
});
|
|
4516
|
-
});
|
|
4517
|
-
resizeObserver.observe(containerRef);
|
|
4518
|
-
unobserve = () => resizeObserver.unobserve(containerRef);
|
|
4519
|
-
}
|
|
4520
|
-
else {
|
|
4521
|
-
window.addEventListener('resize', handleResize);
|
|
4522
|
-
unobserve = () => window.removeEventListener('resize', handleResize);
|
|
4523
|
-
}
|
|
4524
|
-
}
|
|
4525
|
-
return () => {
|
|
4526
|
-
if (unobserve) {
|
|
4527
|
-
unobserve();
|
|
4528
|
-
}
|
|
4529
|
-
};
|
|
4530
|
-
};
|
|
4531
|
-
|
|
4532
4532
|
var TextInputTypes;
|
|
4533
4533
|
(function (TextInputTypes) {
|
|
4534
4534
|
TextInputTypes["text"] = "text";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-table",
|
|
3
|
-
"version": "4.38.
|
|
3
|
+
"version": "4.38.1",
|
|
4
4
|
"description": "This library provides a set of React table components for use with the PatternFly 4",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"clean": "rimraf dist"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@patternfly/react-core": "^4.169.
|
|
35
|
-
"@patternfly/react-icons": "^4.20.
|
|
36
|
-
"@patternfly/react-styles": "^4.19.
|
|
37
|
-
"@patternfly/react-tokens": "^4.21.
|
|
34
|
+
"@patternfly/react-core": "^4.169.1",
|
|
35
|
+
"@patternfly/react-icons": "^4.20.1",
|
|
36
|
+
"@patternfly/react-styles": "^4.19.1",
|
|
37
|
+
"@patternfly/react-tokens": "^4.21.1",
|
|
38
38
|
"lodash": "^4.17.19",
|
|
39
39
|
"tslib": "^2.0.0"
|
|
40
40
|
},
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"react": "^16.8.0 || ^17.0.0",
|
|
47
47
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "ee4fbe6fc666c104911264204b14215dd6aefc08"
|
|
50
50
|
}
|