@patternfly/react-core 4.175.14 → 4.175.15
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/package.json +5 -5
- package/src/components/Card/examples/Card.md +0 -16
- package/src/demos/TileDemo.md +91 -116
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 4.175.15 (2021-12-02)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **Tile:** fix selecting tile in tile demo ([#6653](https://github.com/patternfly/patternfly-react/issues/6653)) ([e12e44d](https://github.com/patternfly/patternfly-react/commit/e12e44d4b623de305b7df04174144a9496d282a7))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 4.175.14 (2021-12-01)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @patternfly/react-core
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.175.
|
|
3
|
+
"version": "4.175.15",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.26.
|
|
38
|
-
"@patternfly/react-styles": "^4.25.
|
|
39
|
-
"@patternfly/react-tokens": "^4.27.
|
|
37
|
+
"@patternfly/react-icons": "^4.26.15",
|
|
38
|
+
"@patternfly/react-styles": "^4.25.15",
|
|
39
|
+
"@patternfly/react-tokens": "^4.27.15",
|
|
40
40
|
"focus-trap": "6.2.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.8.0 || ^17.0.0",
|
|
61
61
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "e8ce0597b63fb37e57678fe8f90f16ec37bc6cb3"
|
|
64
64
|
}
|
|
@@ -77,7 +77,6 @@ import {
|
|
|
77
77
|
CardFooter,
|
|
78
78
|
Checkbox,
|
|
79
79
|
Dropdown,
|
|
80
|
-
DropdownToggle,
|
|
81
80
|
DropdownItem,
|
|
82
81
|
DropdownSeparator,
|
|
83
82
|
KebabToggle
|
|
@@ -192,7 +191,6 @@ import {
|
|
|
192
191
|
CardFooter,
|
|
193
192
|
Checkbox,
|
|
194
193
|
Dropdown,
|
|
195
|
-
DropdownToggle,
|
|
196
194
|
DropdownItem,
|
|
197
195
|
DropdownSeparator,
|
|
198
196
|
KebabToggle
|
|
@@ -281,14 +279,12 @@ import React from 'react';
|
|
|
281
279
|
import {
|
|
282
280
|
Checkbox,
|
|
283
281
|
Dropdown,
|
|
284
|
-
DropdownToggle,
|
|
285
282
|
DropdownItem,
|
|
286
283
|
DropdownSeparator,
|
|
287
284
|
KebabToggle,
|
|
288
285
|
Card,
|
|
289
286
|
CardHeader,
|
|
290
287
|
CardActions,
|
|
291
|
-
CardTitle,
|
|
292
288
|
CardBody
|
|
293
289
|
} from '@patternfly/react-core';
|
|
294
290
|
|
|
@@ -458,7 +454,6 @@ import {
|
|
|
458
454
|
CardTitle,
|
|
459
455
|
CardBody,
|
|
460
456
|
Dropdown,
|
|
461
|
-
DropdownToggle,
|
|
462
457
|
DropdownItem,
|
|
463
458
|
DropdownSeparator,
|
|
464
459
|
KebabToggle
|
|
@@ -589,14 +584,10 @@ import {
|
|
|
589
584
|
CardExpandableContent,
|
|
590
585
|
Checkbox,
|
|
591
586
|
Dropdown,
|
|
592
|
-
DropdownToggle,
|
|
593
587
|
DropdownItem,
|
|
594
588
|
DropdownSeparator,
|
|
595
|
-
DropdownPosition,
|
|
596
|
-
DropdownDirection,
|
|
597
589
|
KebabToggle
|
|
598
590
|
} from '@patternfly/react-core';
|
|
599
|
-
import pfLogo from './pfLogo.svg';
|
|
600
591
|
|
|
601
592
|
class ExpandableCard extends React.Component {
|
|
602
593
|
constructor(props) {
|
|
@@ -712,25 +703,19 @@ class ExpandableCard extends React.Component {
|
|
|
712
703
|
```js
|
|
713
704
|
import React from 'react';
|
|
714
705
|
import {
|
|
715
|
-
Brand,
|
|
716
706
|
Card,
|
|
717
707
|
CardHeader,
|
|
718
708
|
CardActions,
|
|
719
|
-
CardTitle,
|
|
720
709
|
CardBody,
|
|
721
710
|
CardFooter,
|
|
722
711
|
CardExpandableContent,
|
|
723
712
|
Checkbox,
|
|
724
713
|
Dropdown,
|
|
725
|
-
DropdownToggle,
|
|
726
714
|
DropdownItem,
|
|
727
715
|
DropdownSeparator,
|
|
728
|
-
DropdownPosition,
|
|
729
|
-
DropdownDirection,
|
|
730
716
|
KebabToggle
|
|
731
717
|
} from '@patternfly/react-core';
|
|
732
718
|
import pfLogoSmall from './pf-logo-small.svg';
|
|
733
|
-
import pfLogo from './pfLogo.svg';
|
|
734
719
|
|
|
735
720
|
class ExpandableIconCard extends React.Component {
|
|
736
721
|
constructor(props) {
|
|
@@ -833,7 +818,6 @@ import {
|
|
|
833
818
|
CardTitle,
|
|
834
819
|
CardBody,
|
|
835
820
|
Dropdown,
|
|
836
|
-
DropdownToggle,
|
|
837
821
|
DropdownItem,
|
|
838
822
|
DropdownSeparator,
|
|
839
823
|
KebabToggle
|
package/src/demos/TileDemo.md
CHANGED
|
@@ -5,133 +5,108 @@ section: components
|
|
|
5
5
|
|
|
6
6
|
## Demos
|
|
7
7
|
|
|
8
|
-
### Tiles with single selection
|
|
8
|
+
### Tiles with single selection
|
|
9
9
|
|
|
10
|
-
```
|
|
10
|
+
```ts
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import { Tile } from '@patternfly/react-core';
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
const TileSingleSelect: React.FunctionComponent = () => {
|
|
15
|
+
const [selectedId, setSelectedId] = React.useState<string>('');
|
|
16
|
+
|
|
17
|
+
const onSelect = (event: React.MouseEvent) => {``
|
|
18
|
+
setSelectedId(event.currentTarget.id);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const onKeyDown = (event: React.KeyboardEvent) => {
|
|
22
|
+
if (event.key === ' ' || event.key === 'Enter') {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
setSelectedId(event.currentTarget.id);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
20
27
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<Tile
|
|
48
|
-
title="Tile 2"
|
|
49
|
-
id="tile-2"
|
|
50
|
-
onClick={this.onSelect}
|
|
51
|
-
onKeyDown={this.onKeyDown}
|
|
52
|
-
isSelected={selectedId === 'tile-2'}
|
|
53
|
-
/>
|
|
54
|
-
<Tile title="Tile 3" id="tile-3" isDisabled />
|
|
55
|
-
<Tile
|
|
56
|
-
title="Tile 4"
|
|
57
|
-
id="tile-4"
|
|
58
|
-
onClick={this.onSelect}
|
|
59
|
-
onKeyDown={this.onKeyDown}
|
|
60
|
-
isSelected={selectedId === 'tile-4'}
|
|
61
|
-
/>
|
|
62
|
-
</div>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
28
|
+
return (
|
|
29
|
+
<div>
|
|
30
|
+
<Tile
|
|
31
|
+
title="Tile 1"
|
|
32
|
+
id="tile-1"
|
|
33
|
+
onClick={onSelect}
|
|
34
|
+
onKeyDown={onKeyDown}
|
|
35
|
+
isSelected={selectedId === 'tile-1'}
|
|
36
|
+
/>
|
|
37
|
+
<Tile
|
|
38
|
+
title="Tile 2"
|
|
39
|
+
id="tile-2"
|
|
40
|
+
onClick={onSelect}
|
|
41
|
+
onKeyDown={onKeyDown}
|
|
42
|
+
isSelected={selectedId === 'tile-2'}
|
|
43
|
+
/>
|
|
44
|
+
<Tile title="Tile 3" id="tile-3" isDisabled />
|
|
45
|
+
<Tile
|
|
46
|
+
title="Tile 4"
|
|
47
|
+
id="tile-4"
|
|
48
|
+
onClick={onSelect}
|
|
49
|
+
onKeyDown={onKeyDown}
|
|
50
|
+
isSelected={selectedId === 'tile-4'}
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
65
54
|
}
|
|
66
55
|
```
|
|
67
56
|
|
|
68
|
-
### Tiles with multiple selection
|
|
57
|
+
### Tiles with multiple selection
|
|
69
58
|
|
|
70
|
-
```
|
|
59
|
+
```ts
|
|
71
60
|
import React from 'react';
|
|
72
61
|
import { Tile } from '@patternfly/react-core';
|
|
73
62
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
onKeyDown={this.onKeyDown}
|
|
123
|
-
isSelected={selectedIds.includes('tile-2')}
|
|
124
|
-
/>
|
|
125
|
-
<Tile title="Tile 3" id="tile-3" isDisabled />
|
|
126
|
-
<Tile
|
|
127
|
-
title="Tile 4"
|
|
128
|
-
id="tile-4"
|
|
129
|
-
onClick={this.onSelect}
|
|
130
|
-
onKeyDown={this.onKeyDown}
|
|
131
|
-
isSelected={selectedIds.includes('tile-4')}
|
|
132
|
-
/>
|
|
133
|
-
</div>
|
|
134
|
-
);
|
|
135
|
-
}
|
|
63
|
+
const TileMultiSelect: React.FunctionComponent = () => {
|
|
64
|
+
const [selectedIds, setSelectedIds] = React.useState<string[]>([]);
|
|
65
|
+
|
|
66
|
+
const onSelect = (event: React.MouseEvent | React.KeyboardEvent) => {
|
|
67
|
+
const targetId = event.currentTarget.id;
|
|
68
|
+
setSelectedIds(prevSelectedIds => {
|
|
69
|
+
const newSelectedIds = prevSelectedIds.includes(targetId) ?
|
|
70
|
+
prevSelectedIds.filter(id => id !== targetId) :
|
|
71
|
+
[...prevSelectedIds, targetId]
|
|
72
|
+
console.log('tile selections: ', newSelectedIds);
|
|
73
|
+
return newSelectedIds;
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const onKeyDown = (event: React.KeyboardEvent) => {
|
|
78
|
+
console.log(event.key);
|
|
79
|
+
if (event.key === ' ' || event.key === 'Enter') {
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
onSelect(event);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<div>
|
|
87
|
+
<Tile
|
|
88
|
+
title="Tile 1"
|
|
89
|
+
id="tile-1"
|
|
90
|
+
onClick={onSelect}
|
|
91
|
+
onKeyDown={onKeyDown}
|
|
92
|
+
isSelected={selectedIds.includes('tile-1')}
|
|
93
|
+
/>
|
|
94
|
+
<Tile
|
|
95
|
+
title="Tile 2"
|
|
96
|
+
id="tile-2"
|
|
97
|
+
onClick={onSelect}
|
|
98
|
+
onKeyDown={onKeyDown}
|
|
99
|
+
isSelected={selectedIds.includes('tile-2')}
|
|
100
|
+
/>
|
|
101
|
+
<Tile title="Tile 3" id="tile-3" isDisabled />
|
|
102
|
+
<Tile
|
|
103
|
+
title="Tile 4"
|
|
104
|
+
id="tile-4"
|
|
105
|
+
onClick={onSelect}
|
|
106
|
+
onKeyDown={onKeyDown}
|
|
107
|
+
isSelected={selectedIds.includes('tile-4')}
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
136
111
|
}
|
|
137
112
|
```
|