@patternfly/react-templates 1.1.0-prerelease.9 → 6.0.0-alpha.10
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 +12 -22
- package/README.md +17 -2
- package/components/package.json +1 -1
- package/dist/dynamic/components/Select/package.json +1 -1
- package/dist/esm/components/Select/index.d.ts +0 -1
- package/dist/esm/components/Select/index.d.ts.map +1 -1
- package/dist/esm/components/Select/index.js +0 -1
- package/dist/esm/components/Select/index.js.map +1 -1
- package/dist/esm/components/index.d.ts +0 -1
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +0 -1
- package/dist/esm/components/index.js.map +1 -1
- package/dist/js/components/Select/index.d.ts +0 -1
- package/dist/js/components/Select/index.d.ts.map +1 -1
- package/dist/js/components/Select/index.js +0 -1
- package/dist/js/components/Select/index.js.map +1 -1
- package/dist/js/components/index.d.ts +0 -1
- package/dist/js/components/index.d.ts.map +1 -1
- package/dist/js/components/index.js +0 -1
- package/dist/js/components/index.js.map +1 -1
- package/dist/umd/react-templates.min.js +1 -1
- package/package.json +7 -6
- package/src/components/Select/__snapshots__/CheckboxSelectSnapshots.test.tsx.snap +38 -38
- package/src/components/Select/examples/SelectTemplates.md +2 -9
- package/src/components/Select/index.ts +0 -1
- package/src/components/index.ts +0 -1
- package/dist/dynamic/components/Dropdown/package.json +0 -1
- package/dist/dynamic-modules.json +0 -15
- package/dist/esm/components/Dropdown/DropdownSimple.d.ts +0 -43
- package/dist/esm/components/Dropdown/DropdownSimple.d.ts.map +0 -1
- package/dist/esm/components/Dropdown/DropdownSimple.js +0 -27
- package/dist/esm/components/Dropdown/DropdownSimple.js.map +0 -1
- package/dist/esm/components/Dropdown/index.d.ts +0 -2
- package/dist/esm/components/Dropdown/index.d.ts.map +0 -1
- package/dist/esm/components/Dropdown/index.js +0 -2
- package/dist/esm/components/Dropdown/index.js.map +0 -1
- package/dist/esm/components/Select/SelectTypeahead.d.ts +0 -29
- package/dist/esm/components/Select/SelectTypeahead.d.ts.map +0 -1
- package/dist/esm/components/Select/SelectTypeahead.js +0 -179
- package/dist/esm/components/Select/SelectTypeahead.js.map +0 -1
- package/dist/js/components/Dropdown/DropdownSimple.d.ts +0 -43
- package/dist/js/components/Dropdown/DropdownSimple.d.ts.map +0 -1
- package/dist/js/components/Dropdown/DropdownSimple.js +0 -31
- package/dist/js/components/Dropdown/DropdownSimple.js.map +0 -1
- package/dist/js/components/Dropdown/index.d.ts +0 -2
- package/dist/js/components/Dropdown/index.d.ts.map +0 -1
- package/dist/js/components/Dropdown/index.js +0 -5
- package/dist/js/components/Dropdown/index.js.map +0 -1
- package/dist/js/components/Select/SelectTypeahead.d.ts +0 -29
- package/dist/js/components/Select/SelectTypeahead.d.ts.map +0 -1
- package/dist/js/components/Select/SelectTypeahead.js +0 -183
- package/dist/js/components/Select/SelectTypeahead.js.map +0 -1
- package/src/components/Dropdown/DropdownSimple.tsx +0 -122
- package/src/components/Dropdown/__tests__/DropdownSimple.test.tsx +0 -254
- package/src/components/Dropdown/__tests__/__snapshots__/DropdownSimple.test.tsx.snap +0 -147
- package/src/components/Dropdown/examples/DropdownSimpleExample.tsx +0 -53
- package/src/components/Dropdown/examples/DropdownTemplates.md +0 -36
- package/src/components/Dropdown/index.ts +0 -1
- package/src/components/Select/SelectTypeahead.tsx +0 -321
- package/src/components/Select/examples/SelectTypeaheadDemo.tsx +0 -21
|
@@ -4,24 +4,24 @@ exports[`checkbox select with no props snapshot 1`] = `
|
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<button
|
|
6
6
|
aria-expanded="false"
|
|
7
|
-
class="pf-
|
|
7
|
+
class="pf-v6-c-menu-toggle"
|
|
8
8
|
style="width: 200px;"
|
|
9
9
|
type="button"
|
|
10
10
|
>
|
|
11
11
|
<span
|
|
12
|
-
class="pf-
|
|
12
|
+
class="pf-v6-c-menu-toggle__text"
|
|
13
13
|
>
|
|
14
14
|
Filter by status
|
|
15
15
|
</span>
|
|
16
16
|
<span
|
|
17
|
-
class="pf-
|
|
17
|
+
class="pf-v6-c-menu-toggle__controls"
|
|
18
18
|
>
|
|
19
19
|
<span
|
|
20
|
-
class="pf-
|
|
20
|
+
class="pf-v6-c-menu-toggle__toggle-icon"
|
|
21
21
|
>
|
|
22
22
|
<svg
|
|
23
23
|
aria-hidden="true"
|
|
24
|
-
class="pf-
|
|
24
|
+
class="pf-v6-svg"
|
|
25
25
|
fill="currentColor"
|
|
26
26
|
height="1em"
|
|
27
27
|
role="img"
|
|
@@ -42,24 +42,24 @@ exports[`opened checkbox select snapshot 1`] = `
|
|
|
42
42
|
<DocumentFragment>
|
|
43
43
|
<button
|
|
44
44
|
aria-expanded="true"
|
|
45
|
-
class="pf-
|
|
45
|
+
class="pf-v6-c-menu-toggle pf-m-expanded"
|
|
46
46
|
style="width: 200px;"
|
|
47
47
|
type="button"
|
|
48
48
|
>
|
|
49
49
|
<span
|
|
50
|
-
class="pf-
|
|
50
|
+
class="pf-v6-c-menu-toggle__text"
|
|
51
51
|
>
|
|
52
52
|
Filter by status
|
|
53
53
|
</span>
|
|
54
54
|
<span
|
|
55
|
-
class="pf-
|
|
55
|
+
class="pf-v6-c-menu-toggle__controls"
|
|
56
56
|
>
|
|
57
57
|
<span
|
|
58
|
-
class="pf-
|
|
58
|
+
class="pf-v6-c-menu-toggle__toggle-icon"
|
|
59
59
|
>
|
|
60
60
|
<svg
|
|
61
61
|
aria-hidden="true"
|
|
62
|
-
class="pf-
|
|
62
|
+
class="pf-v6-svg"
|
|
63
63
|
fill="currentColor"
|
|
64
64
|
height="1em"
|
|
65
65
|
role="img"
|
|
@@ -74,9 +74,9 @@ exports[`opened checkbox select snapshot 1`] = `
|
|
|
74
74
|
</span>
|
|
75
75
|
</button>
|
|
76
76
|
<div
|
|
77
|
-
class="pf-
|
|
77
|
+
class="pf-v6-c-menu"
|
|
78
78
|
data-ouia-component-id="OUIA-Generated-Select-3"
|
|
79
|
-
data-ouia-component-type="
|
|
79
|
+
data-ouia-component-type="PF6/Select"
|
|
80
80
|
data-ouia-safe="true"
|
|
81
81
|
data-popper-escaped="true"
|
|
82
82
|
data-popper-placement="bottom-start"
|
|
@@ -85,36 +85,36 @@ exports[`opened checkbox select snapshot 1`] = `
|
|
|
85
85
|
style="position: absolute; left: 0px; top: 0px; z-index: 9999; opacity: 1; transition: opacity 0ms cubic-bezier(.54, 1.5, .38, 1.11); min-width: 0px; transform: translate(0px, 0px);"
|
|
86
86
|
>
|
|
87
87
|
<div
|
|
88
|
-
class="pf-
|
|
88
|
+
class="pf-v6-c-menu__content"
|
|
89
89
|
>
|
|
90
90
|
<ul
|
|
91
|
-
class="pf-
|
|
91
|
+
class="pf-v6-c-menu__list"
|
|
92
92
|
role="menu"
|
|
93
93
|
>
|
|
94
94
|
<li
|
|
95
|
-
class="pf-
|
|
95
|
+
class="pf-v6-c-menu__list-item"
|
|
96
96
|
role="menuitem"
|
|
97
97
|
>
|
|
98
98
|
<label
|
|
99
|
-
class="pf-
|
|
99
|
+
class="pf-v6-c-menu__item"
|
|
100
100
|
for="generated-id"
|
|
101
101
|
tabindex="-1"
|
|
102
102
|
>
|
|
103
103
|
<span
|
|
104
|
-
class="pf-
|
|
104
|
+
class="pf-v6-c-menu__item-main"
|
|
105
105
|
>
|
|
106
106
|
<span
|
|
107
|
-
class="pf-
|
|
107
|
+
class="pf-v6-c-menu__item-check"
|
|
108
108
|
>
|
|
109
109
|
<span
|
|
110
|
-
class="pf-
|
|
110
|
+
class="pf-v6-c-check pf-m-standalone"
|
|
111
111
|
>
|
|
112
112
|
<input
|
|
113
113
|
aria-disabled="false"
|
|
114
114
|
aria-invalid="false"
|
|
115
|
-
class="pf-
|
|
115
|
+
class="pf-v6-c-check__input"
|
|
116
116
|
data-ouia-component-id="OUIA-Generated-Checkbox-1"
|
|
117
|
-
data-ouia-component-type="
|
|
117
|
+
data-ouia-component-type="PF6/Checkbox"
|
|
118
118
|
data-ouia-safe="true"
|
|
119
119
|
id="generated-id"
|
|
120
120
|
type="checkbox"
|
|
@@ -122,7 +122,7 @@ exports[`opened checkbox select snapshot 1`] = `
|
|
|
122
122
|
</span>
|
|
123
123
|
</span>
|
|
124
124
|
<span
|
|
125
|
-
class="pf-
|
|
125
|
+
class="pf-v6-c-menu__item-text"
|
|
126
126
|
>
|
|
127
127
|
Option 1
|
|
128
128
|
</span>
|
|
@@ -130,29 +130,29 @@ exports[`opened checkbox select snapshot 1`] = `
|
|
|
130
130
|
</label>
|
|
131
131
|
</li>
|
|
132
132
|
<li
|
|
133
|
-
class="pf-
|
|
133
|
+
class="pf-v6-c-menu__list-item"
|
|
134
134
|
role="menuitem"
|
|
135
135
|
>
|
|
136
136
|
<label
|
|
137
|
-
class="pf-
|
|
137
|
+
class="pf-v6-c-menu__item"
|
|
138
138
|
for="generated-id"
|
|
139
139
|
tabindex="-1"
|
|
140
140
|
>
|
|
141
141
|
<span
|
|
142
|
-
class="pf-
|
|
142
|
+
class="pf-v6-c-menu__item-main"
|
|
143
143
|
>
|
|
144
144
|
<span
|
|
145
|
-
class="pf-
|
|
145
|
+
class="pf-v6-c-menu__item-check"
|
|
146
146
|
>
|
|
147
147
|
<span
|
|
148
|
-
class="pf-
|
|
148
|
+
class="pf-v6-c-check pf-m-standalone"
|
|
149
149
|
>
|
|
150
150
|
<input
|
|
151
151
|
aria-disabled="false"
|
|
152
152
|
aria-invalid="false"
|
|
153
|
-
class="pf-
|
|
153
|
+
class="pf-v6-c-check__input"
|
|
154
154
|
data-ouia-component-id="OUIA-Generated-Checkbox-2"
|
|
155
|
-
data-ouia-component-type="
|
|
155
|
+
data-ouia-component-type="PF6/Checkbox"
|
|
156
156
|
data-ouia-safe="true"
|
|
157
157
|
id="generated-id"
|
|
158
158
|
type="checkbox"
|
|
@@ -160,7 +160,7 @@ exports[`opened checkbox select snapshot 1`] = `
|
|
|
160
160
|
</span>
|
|
161
161
|
</span>
|
|
162
162
|
<span
|
|
163
|
-
class="pf-
|
|
163
|
+
class="pf-v6-c-menu__item-text"
|
|
164
164
|
>
|
|
165
165
|
Option 2
|
|
166
166
|
</span>
|
|
@@ -168,29 +168,29 @@ exports[`opened checkbox select snapshot 1`] = `
|
|
|
168
168
|
</label>
|
|
169
169
|
</li>
|
|
170
170
|
<li
|
|
171
|
-
class="pf-
|
|
171
|
+
class="pf-v6-c-menu__list-item"
|
|
172
172
|
role="menuitem"
|
|
173
173
|
>
|
|
174
174
|
<label
|
|
175
|
-
class="pf-
|
|
175
|
+
class="pf-v6-c-menu__item"
|
|
176
176
|
for="generated-id"
|
|
177
177
|
tabindex="-1"
|
|
178
178
|
>
|
|
179
179
|
<span
|
|
180
|
-
class="pf-
|
|
180
|
+
class="pf-v6-c-menu__item-main"
|
|
181
181
|
>
|
|
182
182
|
<span
|
|
183
|
-
class="pf-
|
|
183
|
+
class="pf-v6-c-menu__item-check"
|
|
184
184
|
>
|
|
185
185
|
<span
|
|
186
|
-
class="pf-
|
|
186
|
+
class="pf-v6-c-check pf-m-standalone"
|
|
187
187
|
>
|
|
188
188
|
<input
|
|
189
189
|
aria-disabled="false"
|
|
190
190
|
aria-invalid="false"
|
|
191
|
-
class="pf-
|
|
191
|
+
class="pf-v6-c-check__input"
|
|
192
192
|
data-ouia-component-id="OUIA-Generated-Checkbox-3"
|
|
193
|
-
data-ouia-component-type="
|
|
193
|
+
data-ouia-component-type="PF6/Checkbox"
|
|
194
194
|
data-ouia-safe="true"
|
|
195
195
|
id="generated-id"
|
|
196
196
|
type="checkbox"
|
|
@@ -198,7 +198,7 @@ exports[`opened checkbox select snapshot 1`] = `
|
|
|
198
198
|
</span>
|
|
199
199
|
</span>
|
|
200
200
|
<span
|
|
201
|
-
class="pf-
|
|
201
|
+
class="pf-v6-c-menu__item-text"
|
|
202
202
|
>
|
|
203
203
|
Option 3
|
|
204
204
|
</span>
|
|
@@ -4,7 +4,7 @@ section: components
|
|
|
4
4
|
subsection: menus
|
|
5
5
|
template: true
|
|
6
6
|
beta: true
|
|
7
|
-
propComponents: ['SelectSimple', 'CheckboxSelect'
|
|
7
|
+
propComponents: ['SelectSimple', 'CheckboxSelect']
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
Note: Templates live in their own package at [@patternfly/react-templates](https://www.npmjs.com/package/@patternfly/react-templates)!
|
|
@@ -12,7 +12,7 @@ Note: Templates live in their own package at [@patternfly/react-templates](https
|
|
|
12
12
|
For custom use cases, please see the select component suite from [@patternfly/react-core](https://www.npmjs.com/package/@patternfly/react-core).
|
|
13
13
|
|
|
14
14
|
import { SelectOption, Checkbox } from '@patternfly/react-core';
|
|
15
|
-
import { SelectSimple, CheckboxSelect
|
|
15
|
+
import { SelectSimple, CheckboxSelect } from '@patternfly/react-templates';
|
|
16
16
|
|
|
17
17
|
## Select template examples
|
|
18
18
|
|
|
@@ -25,11 +25,4 @@ import { SelectSimple, CheckboxSelect, SelectTypeahead } from '@patternfly/react
|
|
|
25
25
|
### Checkbox
|
|
26
26
|
|
|
27
27
|
```ts file="CheckboxSelectDemo.tsx"
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Typeahead
|
|
32
|
-
|
|
33
|
-
```ts file="SelectTypeaheadDemo.tsx"
|
|
34
|
-
|
|
35
28
|
```
|
package/src/components/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"@patternfly/react-templates-dropdown-dynamic","main":"../../../js/components/Dropdown/index.js","module":"../../../esm/components/Dropdown/index.js","typings":"../../../esm/components/Dropdown/index.d.ts","version":"1.1.0-prerelease.8","private":true}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"CheckboxSelect": "dist/dynamic/components/Select",
|
|
3
|
-
"CheckboxSelectOption": "dist/dynamic/components/Select",
|
|
4
|
-
"CheckboxSelectProps": "dist/dynamic/components/Select",
|
|
5
|
-
"DropdownSimple": "dist/dynamic/components/Dropdown",
|
|
6
|
-
"DropdownSimpleItem": "dist/dynamic/components/Dropdown",
|
|
7
|
-
"DropdownSimpleProps": "dist/dynamic/components/Dropdown",
|
|
8
|
-
"SelectSimple": "dist/dynamic/components/Select",
|
|
9
|
-
"SelectSimpleOption": "dist/dynamic/components/Select",
|
|
10
|
-
"SelectSimpleProps": "dist/dynamic/components/Select",
|
|
11
|
-
"SelectTypeahead": "dist/dynamic/components/Select",
|
|
12
|
-
"SelectTypeaheadBase": "dist/dynamic/components/Select",
|
|
13
|
-
"SelectTypeaheadOption": "dist/dynamic/components/Select",
|
|
14
|
-
"SelectTypeaheadProps": "dist/dynamic/components/Select"
|
|
15
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DropdownItemProps } from '@patternfly/react-core/dist/esm/components/Dropdown';
|
|
3
|
-
import { OUIAProps } from '@patternfly/react-core/dist/esm/helpers';
|
|
4
|
-
export interface DropdownSimpleItem extends Omit<DropdownItemProps, 'content'> {
|
|
5
|
-
/** Content of the dropdown item. If the isDivider prop is true, this prop will be ignored. */
|
|
6
|
-
content?: React.ReactNode;
|
|
7
|
-
/** Unique identifier for the dropdown item, which is used in the dropdown onSelect callback */
|
|
8
|
-
value: string | number;
|
|
9
|
-
/** Callback for when the dropdown item is clicked. */
|
|
10
|
-
onClick?: (event?: any) => void;
|
|
11
|
-
/** URL to redirect to when the dropdown item is clicked. */
|
|
12
|
-
to?: string;
|
|
13
|
-
/** Flag indicating whether the dropdown item should render as a divider. If true, the item will be rendered without
|
|
14
|
-
* the dropdown item wrapper.
|
|
15
|
-
*/
|
|
16
|
-
isDivider?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface DropdownSimpleProps extends OUIAProps {
|
|
19
|
-
/** Initial items of the dropdown. */
|
|
20
|
-
initialItems?: DropdownSimpleItem[];
|
|
21
|
-
/** @hide Forwarded ref */
|
|
22
|
-
innerRef?: React.Ref<any>;
|
|
23
|
-
/** Flag indicating the dropdown should be disabled. */
|
|
24
|
-
isDisabled?: boolean;
|
|
25
|
-
/** Flag indicated whether the dropdown toggle should take up the full width of its parent. */
|
|
26
|
-
isToggleFullWidth?: boolean;
|
|
27
|
-
/** Callback triggered when any dropdown item is clicked. */
|
|
28
|
-
onSelect?: (event?: React.MouseEvent<Element, MouseEvent>, value?: string | number) => void;
|
|
29
|
-
/** Callback triggered when the dropdown toggle opens or closes. */
|
|
30
|
-
onToggle?: (nextIsOpen: boolean) => void;
|
|
31
|
-
/** Flag indicating the dropdown toggle should be focused after a dropdown item is clicked. */
|
|
32
|
-
shouldFocusToggleOnSelect?: boolean;
|
|
33
|
-
/** Adds an accessible name to the dropdown toggle. Required when the dropdown toggle does not
|
|
34
|
-
* have any text content.
|
|
35
|
-
*/
|
|
36
|
-
toggleAriaLabel?: string;
|
|
37
|
-
/** Content of the toggle. */
|
|
38
|
-
toggleContent: React.ReactNode;
|
|
39
|
-
/** Variant style of the dropdown toggle. */
|
|
40
|
-
toggleVariant?: 'default' | 'plain' | 'plainText';
|
|
41
|
-
}
|
|
42
|
-
export declare const DropdownSimple: React.ForwardRefExoticComponent<DropdownSimpleProps & React.RefAttributes<any>>;
|
|
43
|
-
//# sourceMappingURL=DropdownSimple.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownSimple.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/DropdownSimple.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIL,iBAAiB,EAClB,MAAM,qDAAqD,CAAC;AAG7D,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,SAAS,CAAC;IAC5E,8FAA8F;IAC9F,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,+FAA+F;IAC/F,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,sDAAsD;IACtD,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,qCAAqC;IACrC,YAAY,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACpC,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,uDAAuD;IACvD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8FAA8F;IAC9F,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5F,mEAAmE;IACnE,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,8FAA8F;IAC9F,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6BAA6B;IAC7B,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,4CAA4C;IAC5C,aAAa,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;CACnD;AAoED,eAAO,MAAM,cAAc,iFAEzB,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Dropdown, DropdownItem, DropdownList } from '@patternfly/react-core/dist/esm/components/Dropdown';
|
|
4
|
-
import { MenuToggle } from '@patternfly/react-core/dist/esm/components/MenuToggle';
|
|
5
|
-
import { Divider } from '@patternfly/react-core/dist/esm/components/Divider';
|
|
6
|
-
const DropdownSimpleBase = (_a) => {
|
|
7
|
-
var { innerRef, initialItems, onSelect: onSelectProp, onToggle: onToggleProp, isDisabled, toggleAriaLabel, toggleContent, isToggleFullWidth, toggleVariant = 'default', shouldFocusToggleOnSelect } = _a, props = __rest(_a, ["innerRef", "initialItems", "onSelect", "onToggle", "isDisabled", "toggleAriaLabel", "toggleContent", "isToggleFullWidth", "toggleVariant", "shouldFocusToggleOnSelect"]);
|
|
8
|
-
const [isOpen, setIsOpen] = React.useState(false);
|
|
9
|
-
const onSelect = (event, value) => {
|
|
10
|
-
onSelectProp && onSelectProp(event, value);
|
|
11
|
-
setIsOpen(false);
|
|
12
|
-
};
|
|
13
|
-
const onToggle = () => {
|
|
14
|
-
onToggleProp && onToggleProp(!isOpen);
|
|
15
|
-
setIsOpen(!isOpen);
|
|
16
|
-
};
|
|
17
|
-
const dropdownToggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: onToggle, isExpanded: isOpen, isDisabled: isDisabled, variant: toggleVariant, "aria-label": toggleAriaLabel, isFullWidth: isToggleFullWidth }, toggleContent));
|
|
18
|
-
const dropdownSimpleItems = initialItems === null || initialItems === void 0 ? void 0 : initialItems.map((item) => {
|
|
19
|
-
const { content, onClick, to, value, isDivider } = item, itemProps = __rest(item, ["content", "onClick", "to", "value", "isDivider"]);
|
|
20
|
-
return isDivider ? (React.createElement(Divider, { component: "li", key: value })) : (React.createElement(DropdownItem, Object.assign({ onClick: onClick, to: to, key: value, value: value }, itemProps), content));
|
|
21
|
-
});
|
|
22
|
-
return (React.createElement(Dropdown, Object.assign({ toggle: dropdownToggle, isOpen: isOpen, onSelect: onSelect, shouldFocusToggleOnSelect: shouldFocusToggleOnSelect, onOpenChange: (isOpen) => setIsOpen(isOpen), ref: innerRef }, props),
|
|
23
|
-
React.createElement(DropdownList, null, dropdownSimpleItems)));
|
|
24
|
-
};
|
|
25
|
-
export const DropdownSimple = React.forwardRef((props, ref) => (React.createElement(DropdownSimpleBase, Object.assign({}, props, { innerRef: ref }))));
|
|
26
|
-
DropdownSimple.displayName = 'DropdownSimple';
|
|
27
|
-
//# sourceMappingURL=DropdownSimple.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownSimple.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/DropdownSimple.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,EAEb,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAqB,MAAM,uDAAuD,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,MAAM,oDAAoD,CAAC;AA2C7E,MAAM,kBAAkB,GAAiD,CAAC,EAYpD,EAAE,EAAE;QAZgD,EACxE,QAAQ,EACR,YAAY,EACZ,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,YAAY,EACtB,UAAU,EACV,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,aAAa,GAAG,SAAS,EACzB,yBAAyB,OAEL,EADjB,KAAK,cAXgE,yKAYzE,CADS;IAER,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,MAAM,QAAQ,GAAG,CAAC,KAA4C,EAAE,KAAsB,EAAE,EAAE;QACxF,YAAY,IAAI,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC3C,SAAS,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,GAAG,EAAE;QACpB,YAAY,IAAI,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;QACtC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,CAAC,SAAuC,EAAE,EAAE,CAAC,CAClE,oBAAC,UAAU,IACT,GAAG,EAAE,SAAS,EACd,OAAO,EAAE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WAAW,GAAG,gBAAgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SelectOptionProps } from '@patternfly/react-core';
|
|
3
|
-
export interface SelectTypeaheadOption extends Omit<SelectOptionProps, 'content'> {
|
|
4
|
-
/** Content of the select option. */
|
|
5
|
-
content: string | number;
|
|
6
|
-
/** Value of the select option. */
|
|
7
|
-
value: string | number;
|
|
8
|
-
}
|
|
9
|
-
export interface SelectTypeaheadProps {
|
|
10
|
-
/** @hide Forwarded ref */
|
|
11
|
-
innerRef?: React.Ref<any>;
|
|
12
|
-
/** Initial options of the select. */
|
|
13
|
-
initialOptions: SelectTypeaheadOption[];
|
|
14
|
-
/** Callback triggered on selection. */
|
|
15
|
-
onSelect?: (_event: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<HTMLInputElement>, selection: string | number) => void;
|
|
16
|
-
/** Callback triggered when the select opens or closes. */
|
|
17
|
-
onToggle?: (nextIsOpen: boolean) => void;
|
|
18
|
-
/** Callback triggered when the text in the input field changes. */
|
|
19
|
-
onInputChange?: (newValue: string) => void;
|
|
20
|
-
/** Placeholder text for the select input. */
|
|
21
|
-
placeholder?: string;
|
|
22
|
-
/** Message to display when no options match the filter. */
|
|
23
|
-
noOptionsFoundMessage?: string | ((filter: string) => string);
|
|
24
|
-
/** Flag indicating the select should be disabled. */
|
|
25
|
-
isDisabled?: boolean;
|
|
26
|
-
}
|
|
27
|
-
export declare const SelectTypeaheadBase: React.FunctionComponent<SelectTypeaheadProps>;
|
|
28
|
-
export declare const SelectTypeahead: React.ForwardRefExoticComponent<SelectTypeaheadProps & React.RefAttributes<any>>;
|
|
29
|
-
//# sourceMappingURL=SelectTypeahead.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectTypeahead.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/SelectTypeahead.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIL,iBAAiB,EAOlB,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,SAAS,CAAC;IAC/E,oCAAoC;IACpC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,kCAAkC;IAClC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,qCAAqC;IACrC,cAAc,EAAE,qBAAqB,EAAE,CAAC;IACxC,uCAAuC;IACvC,QAAQ,CAAC,EAAE,CACT,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,EACrF,SAAS,EAAE,MAAM,GAAG,MAAM,KACvB,IAAI,CAAC;IACV,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,mEAAmE;IACnE,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,qBAAqB,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IAC9D,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,iBAAiB,CAAC,oBAAoB,CA6Q7E,CAAC;AAGF,eAAO,MAAM,eAAe,kFAE1B,CAAC"}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Select, SelectOption, SelectList, MenuToggle, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, Button } from '@patternfly/react-core';
|
|
4
|
-
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
5
|
-
export const SelectTypeaheadBase = (_a) => {
|
|
6
|
-
var { innerRef, initialOptions, onSelect, onToggle, onInputChange, placeholder = 'Select an option', noOptionsFoundMessage = (filter) => `No results found for "${filter}"`, isDisabled } = _a, props = __rest(_a, ["innerRef", "initialOptions", "onSelect", "onToggle", "onInputChange", "placeholder", "noOptionsFoundMessage", "isDisabled"]);
|
|
7
|
-
const [isOpen, setIsOpen] = React.useState(false);
|
|
8
|
-
const [selected, setSelected] = React.useState('');
|
|
9
|
-
const [inputValue, setInputValue] = React.useState('');
|
|
10
|
-
const [filterValue, setFilterValue] = React.useState('');
|
|
11
|
-
const [selectOptions, setSelectOptions] = React.useState(initialOptions);
|
|
12
|
-
const [focusedItemIndex, setFocusedItemIndex] = React.useState(null);
|
|
13
|
-
const [activeItemId, setActiveItemId] = React.useState(null);
|
|
14
|
-
const textInputRef = React.useRef();
|
|
15
|
-
const NO_RESULTS = 'no results';
|
|
16
|
-
React.useEffect(() => {
|
|
17
|
-
let newSelectOptions = initialOptions;
|
|
18
|
-
// Filter menu items based on the text input value when one exists
|
|
19
|
-
if (filterValue) {
|
|
20
|
-
newSelectOptions = initialOptions.filter((option) => String(option.content).toLowerCase().includes(filterValue.toLowerCase()));
|
|
21
|
-
// When no options are found after filtering, display 'No results found'
|
|
22
|
-
if (!newSelectOptions.length) {
|
|
23
|
-
newSelectOptions = [
|
|
24
|
-
{
|
|
25
|
-
isAriaDisabled: true,
|
|
26
|
-
content: typeof noOptionsFoundMessage === 'string' ? noOptionsFoundMessage : noOptionsFoundMessage(filterValue),
|
|
27
|
-
value: NO_RESULTS
|
|
28
|
-
}
|
|
29
|
-
];
|
|
30
|
-
}
|
|
31
|
-
// Open the menu when the input value changes and the new value is not empty
|
|
32
|
-
if (!isOpen) {
|
|
33
|
-
openMenu();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
setSelectOptions(newSelectOptions);
|
|
37
|
-
}, [filterValue]);
|
|
38
|
-
const createItemId = (value) => `select-typeahead-${String(value).replace(' ', '-')}`;
|
|
39
|
-
const setActiveAndFocusedItem = (itemIndex) => {
|
|
40
|
-
setFocusedItemIndex(itemIndex);
|
|
41
|
-
const focusedItem = selectOptions[itemIndex];
|
|
42
|
-
setActiveItemId(createItemId(focusedItem.value));
|
|
43
|
-
};
|
|
44
|
-
const resetActiveAndFocusedItem = () => {
|
|
45
|
-
setFocusedItemIndex(null);
|
|
46
|
-
setActiveItemId(null);
|
|
47
|
-
};
|
|
48
|
-
const openMenu = () => {
|
|
49
|
-
onToggle && onToggle(true);
|
|
50
|
-
setIsOpen(true);
|
|
51
|
-
};
|
|
52
|
-
const closeMenu = () => {
|
|
53
|
-
onToggle && onToggle(false);
|
|
54
|
-
setIsOpen(false);
|
|
55
|
-
resetActiveAndFocusedItem();
|
|
56
|
-
};
|
|
57
|
-
const onInputClick = () => {
|
|
58
|
-
if (!isOpen) {
|
|
59
|
-
openMenu();
|
|
60
|
-
}
|
|
61
|
-
else if (!inputValue) {
|
|
62
|
-
closeMenu();
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const selectOption = (_event, option) => {
|
|
66
|
-
onSelect && onSelect(_event, option.value);
|
|
67
|
-
setInputValue(String(option.content));
|
|
68
|
-
setFilterValue('');
|
|
69
|
-
setSelected(String(option.value));
|
|
70
|
-
closeMenu();
|
|
71
|
-
};
|
|
72
|
-
const _onSelect = (_event, value) => {
|
|
73
|
-
if (value && value !== NO_RESULTS) {
|
|
74
|
-
const optionToSelect = selectOptions.find((option) => option.value === value);
|
|
75
|
-
selectOption(_event, optionToSelect);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
const onTextInputChange = (_event, value) => {
|
|
79
|
-
setInputValue(value);
|
|
80
|
-
onInputChange && onInputChange(value);
|
|
81
|
-
setFilterValue(value);
|
|
82
|
-
resetActiveAndFocusedItem();
|
|
83
|
-
if (value !== selected) {
|
|
84
|
-
setSelected('');
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
const handleMenuArrowKeys = (key) => {
|
|
88
|
-
let indexToFocus = 0;
|
|
89
|
-
if (!isOpen) {
|
|
90
|
-
openMenu();
|
|
91
|
-
}
|
|
92
|
-
if (selectOptions.every((option) => option.isDisabled)) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
if (key === 'ArrowUp') {
|
|
96
|
-
// When no index is set or at the first index, focus to the last, otherwise decrement focus index
|
|
97
|
-
if (focusedItemIndex === null || focusedItemIndex === 0) {
|
|
98
|
-
indexToFocus = selectOptions.length - 1;
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
indexToFocus = focusedItemIndex - 1;
|
|
102
|
-
}
|
|
103
|
-
// Skip disabled options
|
|
104
|
-
while (selectOptions[indexToFocus].isDisabled) {
|
|
105
|
-
indexToFocus--;
|
|
106
|
-
if (indexToFocus === -1) {
|
|
107
|
-
indexToFocus = selectOptions.length - 1;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (key === 'ArrowDown') {
|
|
112
|
-
// When no index is set or at the last index, focus to the first, otherwise increment focus index
|
|
113
|
-
if (focusedItemIndex === null || focusedItemIndex === selectOptions.length - 1) {
|
|
114
|
-
indexToFocus = 0;
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
indexToFocus = focusedItemIndex + 1;
|
|
118
|
-
}
|
|
119
|
-
// Skip disabled options
|
|
120
|
-
while (selectOptions[indexToFocus].isDisabled) {
|
|
121
|
-
indexToFocus++;
|
|
122
|
-
if (indexToFocus === selectOptions.length) {
|
|
123
|
-
indexToFocus = 0;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
setActiveAndFocusedItem(indexToFocus);
|
|
128
|
-
};
|
|
129
|
-
const onInputKeyDown = (event) => {
|
|
130
|
-
const focusedItem = focusedItemIndex !== null ? selectOptions[focusedItemIndex] : null;
|
|
131
|
-
switch (event.key) {
|
|
132
|
-
case 'Enter':
|
|
133
|
-
if (isOpen && focusedItem && focusedItem.value !== NO_RESULTS && !focusedItem.isAriaDisabled) {
|
|
134
|
-
selectOption(event, focusedItem);
|
|
135
|
-
}
|
|
136
|
-
if (!isOpen) {
|
|
137
|
-
setIsOpen(true);
|
|
138
|
-
}
|
|
139
|
-
break;
|
|
140
|
-
case 'ArrowUp':
|
|
141
|
-
case 'ArrowDown':
|
|
142
|
-
event.preventDefault();
|
|
143
|
-
handleMenuArrowKeys(event.key);
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
const onToggleClick = () => {
|
|
148
|
-
var _a;
|
|
149
|
-
onToggle && onToggle(!isOpen);
|
|
150
|
-
setIsOpen(!isOpen);
|
|
151
|
-
(_a = textInputRef === null || textInputRef === void 0 ? void 0 : textInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
152
|
-
};
|
|
153
|
-
const onClearButtonClick = () => {
|
|
154
|
-
var _a;
|
|
155
|
-
setSelected('');
|
|
156
|
-
setInputValue('');
|
|
157
|
-
onInputChange && onInputChange('');
|
|
158
|
-
setFilterValue('');
|
|
159
|
-
resetActiveAndFocusedItem();
|
|
160
|
-
(_a = textInputRef === null || textInputRef === void 0 ? void 0 : textInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
161
|
-
};
|
|
162
|
-
const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, variant: "typeahead", "aria-label": "Typeahead menu toggle", onClick: onToggleClick, isExpanded: isOpen, isDisabled: isDisabled, isFullWidth: true },
|
|
163
|
-
React.createElement(TextInputGroup, { isPlain: true },
|
|
164
|
-
React.createElement(TextInputGroupMain, Object.assign({ value: inputValue, onClick: onInputClick, onChange: onTextInputChange, onKeyDown: onInputKeyDown, id: "typeahead-select-input", autoComplete: "off", innerRef: textInputRef, placeholder: placeholder }, (activeItemId && { 'aria-activedescendant': activeItemId }), { role: "combobox", isExpanded: isOpen, "aria-controls": "select-typeahead-listbox" })),
|
|
165
|
-
React.createElement(TextInputGroupUtilities, Object.assign({}, (!inputValue ? { style: { display: 'none' } } : {})),
|
|
166
|
-
React.createElement(Button, { variant: "plain", onClick: onClearButtonClick, "aria-label": "Clear input value" },
|
|
167
|
-
React.createElement(TimesIcon, { "aria-hidden": true }))))));
|
|
168
|
-
return (React.createElement(Select, Object.assign({ id: "typeahead-select", isOpen: isOpen, selected: selected, onSelect: _onSelect, onOpenChange: (isOpen) => {
|
|
169
|
-
!isOpen && closeMenu();
|
|
170
|
-
}, toggle: toggle, shouldFocusFirstItemOnOpen: false, ref: innerRef }, props),
|
|
171
|
-
React.createElement(SelectList, { id: "select-typeahead-listbox" }, selectOptions.map((option, index) => {
|
|
172
|
-
const { content, value } = option, props = __rest(option, ["content", "value"]);
|
|
173
|
-
return (React.createElement(SelectOption, Object.assign({}, props, { key: value, value: value, isFocused: focusedItemIndex === index, id: createItemId(value) }), content));
|
|
174
|
-
}))));
|
|
175
|
-
};
|
|
176
|
-
SelectTypeaheadBase.displayName = 'SelectTypeaheadBase';
|
|
177
|
-
export const SelectTypeahead = React.forwardRef((props, ref) => (React.createElement(SelectTypeaheadBase, Object.assign({}, props, { innerRef: ref }))));
|
|
178
|
-
SelectTypeahead.displayName = 'SelectTypeahead';
|
|
179
|
-
//# sourceMappingURL=SelectTypeahead.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|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