@instructure/ui-popover 8.10.3-snapshot.2 → 8.10.3-snapshot.21
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/es/Popover/props.js +4 -1
- package/lib/Popover/props.js +4 -1
- package/package.json +20 -20
- package/src/Popover/README.md +269 -32
- package/src/Popover/props.ts +28 -1
- package/types/Popover/props.d.ts.map +1 -1
package/es/Popover/props.js
CHANGED
|
@@ -25,6 +25,9 @@ import PropTypes from 'prop-types';
|
|
|
25
25
|
import { element } from '@instructure/ui-prop-types';
|
|
26
26
|
import { ThemeablePropTypes } from '@instructure/emotion';
|
|
27
27
|
import { PositionPropTypes } from '@instructure/ui-position';
|
|
28
|
+
// Copied list from "PositionPropTypes.placement" so that it appears as options in the properties table.
|
|
29
|
+
// TODO: try to use "PositionPropTypes.placement" again once Popover is fully typed and uses @tsProps
|
|
30
|
+
const placementPropValues = ['top', 'bottom', 'start', 'end', 'top start', 'top center', 'top end', 'top stretch', 'bottom start', 'bottom center', 'bottom end', 'bottom stretch', 'start top', 'start center', 'start bottom', 'start stretch', 'end top', 'end center', 'end bottom', 'end stretch', 'center start', 'center end', 'offscreen'];
|
|
28
31
|
const propTypes = {
|
|
29
32
|
/**
|
|
30
33
|
* Whether or not the `<Popover />` content is shown
|
|
@@ -54,7 +57,7 @@ const propTypes = {
|
|
|
54
57
|
/**
|
|
55
58
|
* The placement of the content in relation to the trigger
|
|
56
59
|
*/
|
|
57
|
-
placement:
|
|
60
|
+
placement: PropTypes.oneOf(placementPropValues),
|
|
58
61
|
|
|
59
62
|
/**
|
|
60
63
|
* Controls the shadow depth for the `<Popover />`
|
package/lib/Popover/props.js
CHANGED
|
@@ -38,6 +38,9 @@ var _PositionPropTypes = require("@instructure/ui-position/lib/PositionPropTypes
|
|
|
38
38
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
39
39
|
* SOFTWARE.
|
|
40
40
|
*/
|
|
41
|
+
// Copied list from "PositionPropTypes.placement" so that it appears as options in the properties table.
|
|
42
|
+
// TODO: try to use "PositionPropTypes.placement" again once Popover is fully typed and uses @tsProps
|
|
43
|
+
const placementPropValues = ['top', 'bottom', 'start', 'end', 'top start', 'top center', 'top end', 'top stretch', 'bottom start', 'bottom center', 'bottom end', 'bottom stretch', 'start top', 'start center', 'start bottom', 'start stretch', 'end top', 'end center', 'end bottom', 'end stretch', 'center start', 'center end', 'offscreen'];
|
|
41
44
|
const propTypes = {
|
|
42
45
|
/**
|
|
43
46
|
* Whether or not the `<Popover />` content is shown
|
|
@@ -67,7 +70,7 @@ const propTypes = {
|
|
|
67
70
|
/**
|
|
68
71
|
* The placement of the content in relation to the trigger
|
|
69
72
|
*/
|
|
70
|
-
placement:
|
|
73
|
+
placement: _propTypes.default.oneOf(placementPropValues),
|
|
71
74
|
|
|
72
75
|
/**
|
|
73
76
|
* Controls the shadow depth for the `<Popover />`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-popover",
|
|
3
|
-
"version": "8.10.3-snapshot.
|
|
3
|
+
"version": "8.10.3-snapshot.21+875db2a7e",
|
|
4
4
|
"description": "A component for hiding or showing content based on user interaction.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -25,28 +25,28 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.13.10",
|
|
28
|
-
"@instructure/console": "8.10.3-snapshot.
|
|
29
|
-
"@instructure/emotion": "8.10.3-snapshot.
|
|
30
|
-
"@instructure/ui-a11y-utils": "8.10.3-snapshot.
|
|
31
|
-
"@instructure/ui-dialog": "8.10.3-snapshot.
|
|
32
|
-
"@instructure/ui-dom-utils": "8.10.3-snapshot.
|
|
33
|
-
"@instructure/ui-i18n": "8.10.3-snapshot.
|
|
34
|
-
"@instructure/ui-position": "8.10.3-snapshot.
|
|
35
|
-
"@instructure/ui-prop-types": "8.10.3-snapshot.
|
|
36
|
-
"@instructure/ui-react-utils": "8.10.3-snapshot.
|
|
37
|
-
"@instructure/ui-testable": "8.10.3-snapshot.
|
|
38
|
-
"@instructure/ui-utils": "8.10.3-snapshot.
|
|
39
|
-
"@instructure/ui-view": "8.10.3-snapshot.
|
|
40
|
-
"@instructure/uid": "8.10.3-snapshot.
|
|
28
|
+
"@instructure/console": "8.10.3-snapshot.21+875db2a7e",
|
|
29
|
+
"@instructure/emotion": "8.10.3-snapshot.21+875db2a7e",
|
|
30
|
+
"@instructure/ui-a11y-utils": "8.10.3-snapshot.21+875db2a7e",
|
|
31
|
+
"@instructure/ui-dialog": "8.10.3-snapshot.21+875db2a7e",
|
|
32
|
+
"@instructure/ui-dom-utils": "8.10.3-snapshot.21+875db2a7e",
|
|
33
|
+
"@instructure/ui-i18n": "8.10.3-snapshot.21+875db2a7e",
|
|
34
|
+
"@instructure/ui-position": "8.10.3-snapshot.21+875db2a7e",
|
|
35
|
+
"@instructure/ui-prop-types": "8.10.3-snapshot.21+875db2a7e",
|
|
36
|
+
"@instructure/ui-react-utils": "8.10.3-snapshot.21+875db2a7e",
|
|
37
|
+
"@instructure/ui-testable": "8.10.3-snapshot.21+875db2a7e",
|
|
38
|
+
"@instructure/ui-utils": "8.10.3-snapshot.21+875db2a7e",
|
|
39
|
+
"@instructure/ui-view": "8.10.3-snapshot.21+875db2a7e",
|
|
40
|
+
"@instructure/uid": "8.10.3-snapshot.21+875db2a7e",
|
|
41
41
|
"keycode": "^2",
|
|
42
42
|
"prop-types": "^15"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@instructure/ui-babel-preset": "8.10.3-snapshot.
|
|
46
|
-
"@instructure/ui-color-utils": "8.10.3-snapshot.
|
|
47
|
-
"@instructure/ui-test-locator": "8.10.3-snapshot.
|
|
48
|
-
"@instructure/ui-test-queries": "8.10.3-snapshot.
|
|
49
|
-
"@instructure/ui-test-utils": "8.10.3-snapshot.
|
|
45
|
+
"@instructure/ui-babel-preset": "8.10.3-snapshot.21+875db2a7e",
|
|
46
|
+
"@instructure/ui-color-utils": "8.10.3-snapshot.21+875db2a7e",
|
|
47
|
+
"@instructure/ui-test-locator": "8.10.3-snapshot.21+875db2a7e",
|
|
48
|
+
"@instructure/ui-test-queries": "8.10.3-snapshot.21+875db2a7e",
|
|
49
|
+
"@instructure/ui-test-utils": "8.10.3-snapshot.21+875db2a7e"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"react": ">=16.8 <=17"
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
57
|
"sideEffects": false,
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "875db2a7e509e9b8a2c29edfe6d23830b106d472"
|
|
59
59
|
}
|
package/src/Popover/README.md
CHANGED
|
@@ -9,25 +9,72 @@ Popovers hide or show content as a result of user interaction, such as clicking,
|
|
|
9
9
|
```js
|
|
10
10
|
---
|
|
11
11
|
example: true
|
|
12
|
+
render: false
|
|
12
13
|
---
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
class Example extends React.Component {
|
|
15
|
+
state = {
|
|
16
|
+
withArrow: true,
|
|
17
|
+
shouldAlignArrow: true,
|
|
18
|
+
color : "primary"
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
toggleWithArrow = (event) => this.setState({ withArrow: !this.state.withArrow })
|
|
21
|
+
toggleAlignArrow = (event) => this.setState({ shouldAlignArrow: !this.state.shouldAlignArrow })
|
|
22
|
+
changeColor = (event,color) => {this.setState({color})}
|
|
23
|
+
render() {
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<FormFieldGroup description="Uncontrolled Popover Example">
|
|
27
|
+
<Checkbox
|
|
28
|
+
checked={this.state.withArrow}
|
|
29
|
+
label="With Arrow"
|
|
30
|
+
onChange={this.toggleWithArrow}
|
|
31
|
+
/>
|
|
32
|
+
<Checkbox
|
|
33
|
+
checked={this.state.shouldAlignArrow}
|
|
34
|
+
label="Align Arrow"
|
|
35
|
+
onChange={this.toggleAlignArrow}
|
|
36
|
+
/>
|
|
37
|
+
</FormFieldGroup>
|
|
38
|
+
<View display="block" margin="small none">
|
|
39
|
+
<RadioInputGroup
|
|
40
|
+
name="color"
|
|
41
|
+
defaultValue="primary"
|
|
42
|
+
description="Color:"
|
|
43
|
+
variant="toggle"
|
|
44
|
+
size="small"
|
|
45
|
+
onChange={this.changeColor} >
|
|
46
|
+
<RadioInput label="Primary" value="primary"/>
|
|
47
|
+
<RadioInput label="Primary inverse" value="primary-inverse" />
|
|
48
|
+
</RadioInputGroup>
|
|
49
|
+
</View>
|
|
50
|
+
<View display="block" as="div" margin="small">
|
|
51
|
+
<Popover
|
|
52
|
+
renderTrigger={
|
|
53
|
+
<Link aria-describedby="tip">
|
|
54
|
+
Hover or focus me
|
|
55
|
+
</Link>
|
|
56
|
+
}
|
|
57
|
+
shouldRenderOffscreen
|
|
58
|
+
shouldReturnFocus={false}
|
|
59
|
+
withArrow={this.state.withArrow}
|
|
60
|
+
shouldAlignArrow={this.state.shouldAlignArrow}
|
|
61
|
+
color = {this.state.color}
|
|
62
|
+
placement = "top end"
|
|
63
|
+
mountNode={() => document.getElementById('main')}
|
|
64
|
+
onPositioned={() => console.log('positioned')}
|
|
65
|
+
onShowContent={() => console.log('showing')}
|
|
66
|
+
onHideContent={() => console.log('hidden')}
|
|
67
|
+
>
|
|
68
|
+
<View padding="x-small" display="block" as="div" id="tip">
|
|
69
|
+
Hello World
|
|
70
|
+
</View>
|
|
71
|
+
</Popover>
|
|
72
|
+
</View>
|
|
73
|
+
</>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
render(<Example />)
|
|
31
78
|
|
|
32
79
|
```
|
|
33
80
|
|
|
@@ -39,14 +86,12 @@ render: false
|
|
|
39
86
|
example: true
|
|
40
87
|
---
|
|
41
88
|
class Example extends React.Component {
|
|
42
|
-
constructor (props) {
|
|
43
|
-
super(props)
|
|
44
89
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
90
|
+
state = {
|
|
91
|
+
isShowingContent: false
|
|
48
92
|
}
|
|
49
93
|
|
|
94
|
+
|
|
50
95
|
renderCloseButton () {
|
|
51
96
|
return (
|
|
52
97
|
<CloseButton
|
|
@@ -105,21 +150,35 @@ render: false
|
|
|
105
150
|
example: true
|
|
106
151
|
---
|
|
107
152
|
class Example extends React.Component {
|
|
108
|
-
|
|
109
|
-
|
|
153
|
+
state={
|
|
154
|
+
shouldAlignArrow : true
|
|
155
|
+
}
|
|
156
|
+
toggleAlignArrow = (event) => this.setState({ shouldAlignArrow: !this.state.shouldAlignArrow })
|
|
157
|
+
|
|
158
|
+
render () {
|
|
159
|
+
return (
|
|
160
|
+
<>
|
|
161
|
+
<FormFieldGroup description="Align Arrow Example">
|
|
162
|
+
<Checkbox
|
|
163
|
+
checked={this.state.shouldAlignArrow}
|
|
164
|
+
label="Align Arrow"
|
|
165
|
+
onChange={this.toggleAlignArrow}
|
|
166
|
+
/>
|
|
167
|
+
</FormFieldGroup>
|
|
110
168
|
<div style={{ paddingBottom: 25, display: 'flex', justifyContent: 'center' }}>
|
|
111
169
|
<Popover
|
|
112
170
|
renderTrigger={<div style={{display: 'inline-block', height: '3px', width: '3px', background: 'blue'}}/>}
|
|
113
171
|
isShowingContent={true}
|
|
114
172
|
placement="end top"
|
|
115
|
-
shouldAlignArrow
|
|
173
|
+
shouldAlignArrow={this.state.shouldAlignArrow}
|
|
116
174
|
mountNode={() => document.getElementById('main')}
|
|
117
175
|
>
|
|
118
176
|
<Heading>Small<br/>Target</Heading>
|
|
119
177
|
</Popover>
|
|
120
178
|
</div>
|
|
121
|
-
|
|
122
|
-
|
|
179
|
+
</>
|
|
180
|
+
)
|
|
181
|
+
}
|
|
123
182
|
}
|
|
124
183
|
|
|
125
184
|
render(<Example />)
|
|
@@ -133,12 +192,9 @@ render: false
|
|
|
133
192
|
example: true
|
|
134
193
|
---
|
|
135
194
|
class Example extends React.Component {
|
|
136
|
-
constructor (props) {
|
|
137
|
-
super(props)
|
|
138
195
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
196
|
+
state = {
|
|
197
|
+
isShowingContent: false
|
|
142
198
|
}
|
|
143
199
|
|
|
144
200
|
render () {
|
|
@@ -170,6 +226,187 @@ class Example extends React.Component {
|
|
|
170
226
|
render(<Example />)
|
|
171
227
|
```
|
|
172
228
|
|
|
229
|
+
#### Custom elements as renderTrigger
|
|
230
|
+
|
|
231
|
+
Popover and Tooltip attach mouse and focus event listeners to their `renderTrigger` components via props. These need to be propagated to the component for the listeners to work:
|
|
232
|
+
|
|
233
|
+
```js
|
|
234
|
+
---
|
|
235
|
+
example: true
|
|
236
|
+
---
|
|
237
|
+
class MyComponent extends React.Component {
|
|
238
|
+
constructor(props) {
|
|
239
|
+
super(props)
|
|
240
|
+
this.ref = React.createRef()
|
|
241
|
+
}
|
|
242
|
+
render() {
|
|
243
|
+
// Spread the props to the underlying DOM element
|
|
244
|
+
return <div {...this.props} ref={this.ref} style={{width:"10rem"}}>My custom component</div>
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
<Popover renderTrigger={<MyComponent />} >
|
|
248
|
+
This text is wrapped by a Popover
|
|
249
|
+
</Popover>
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
#### Popover playground
|
|
253
|
+
|
|
254
|
+
```js
|
|
255
|
+
---
|
|
256
|
+
render: false
|
|
257
|
+
example: true
|
|
258
|
+
---
|
|
259
|
+
class Example extends React.Component {
|
|
260
|
+
|
|
261
|
+
state = {
|
|
262
|
+
shouldAlignArrow: true,
|
|
263
|
+
isShowingContent: true,
|
|
264
|
+
withArrow: true,
|
|
265
|
+
placement: 'top',
|
|
266
|
+
shadow: 'topmost',
|
|
267
|
+
color : 'primary'
|
|
268
|
+
}
|
|
269
|
+
static placementsValues = [
|
|
270
|
+
'top',
|
|
271
|
+
'end',
|
|
272
|
+
'bottom',
|
|
273
|
+
'start',
|
|
274
|
+
'top start',
|
|
275
|
+
'start top',
|
|
276
|
+
'start center',
|
|
277
|
+
'start bottom',
|
|
278
|
+
'bottom start',
|
|
279
|
+
'bottom center',
|
|
280
|
+
'bottom end',
|
|
281
|
+
'end bottom',
|
|
282
|
+
'end center',
|
|
283
|
+
'end top',
|
|
284
|
+
'top end',
|
|
285
|
+
'top center',
|
|
286
|
+
'center end',
|
|
287
|
+
'center start'
|
|
288
|
+
];
|
|
289
|
+
static shadowValues = [
|
|
290
|
+
'none',
|
|
291
|
+
'resting',
|
|
292
|
+
'above',
|
|
293
|
+
'topmost'
|
|
294
|
+
];
|
|
295
|
+
changePlacement = (e, { value }) => this.setState({ placement: value })
|
|
296
|
+
changeShadow = (e, { value }) => this.setState({ shadow: value})
|
|
297
|
+
toggleWithArrow = (event) => this.setState({ withArrow: !this.state.withArrow })
|
|
298
|
+
toggleAlignArrow = (event) => this.setState({ shouldAlignArrow: !this.state.shouldAlignArrow })
|
|
299
|
+
toggleShowContent = (event) => this.setState({ isShowingContent: !this.state.isShowingContent })
|
|
300
|
+
changeColor = (event,value) => this.setState({color:value})
|
|
301
|
+
render() {
|
|
302
|
+
return (
|
|
303
|
+
<View as="div" background="primary" padding="small">
|
|
304
|
+
<Flex margin="small small large" justifyItems="space-around">
|
|
305
|
+
<Flex.Item align="start">
|
|
306
|
+
<FormFieldGroup description="Popover Example">
|
|
307
|
+
<Checkbox
|
|
308
|
+
checked={this.state.isShowingContent}
|
|
309
|
+
label="Show Content"
|
|
310
|
+
onChange={this.toggleShowContent}
|
|
311
|
+
/>
|
|
312
|
+
<Checkbox
|
|
313
|
+
checked={this.state.withArrow}
|
|
314
|
+
label="With Arrow"
|
|
315
|
+
onChange={this.toggleWithArrow}
|
|
316
|
+
/>
|
|
317
|
+
<Checkbox
|
|
318
|
+
checked={this.state.shouldAlignArrow}
|
|
319
|
+
label="Align Arrow"
|
|
320
|
+
onChange={this.toggleAlignArrow}
|
|
321
|
+
/>
|
|
322
|
+
</FormFieldGroup>
|
|
323
|
+
</Flex.Item>
|
|
324
|
+
<Flex.Item>
|
|
325
|
+
<View
|
|
326
|
+
as="div"
|
|
327
|
+
margin="none"
|
|
328
|
+
maxWidth="15rem"
|
|
329
|
+
>
|
|
330
|
+
<SimpleSelect
|
|
331
|
+
renderLabel="Placement"
|
|
332
|
+
value={this.state.placement}
|
|
333
|
+
onChange={this.changePlacement}
|
|
334
|
+
>
|
|
335
|
+
{Example.placementsValues.map((placement, index) => (
|
|
336
|
+
<SimpleSelect.Option
|
|
337
|
+
key={index}
|
|
338
|
+
id={`${index}`}
|
|
339
|
+
value={placement}
|
|
340
|
+
>
|
|
341
|
+
{placement}
|
|
342
|
+
</SimpleSelect.Option>
|
|
343
|
+
))}
|
|
344
|
+
</SimpleSelect>
|
|
345
|
+
</View>
|
|
346
|
+
<View
|
|
347
|
+
as="div"
|
|
348
|
+
margin="medium none"
|
|
349
|
+
maxWidth="15rem"
|
|
350
|
+
>
|
|
351
|
+
<SimpleSelect value={this.state.shadow}
|
|
352
|
+
onChange={this.changeShadow}
|
|
353
|
+
renderLabel="Shadow"
|
|
354
|
+
>
|
|
355
|
+
{
|
|
356
|
+
Example.shadowValues.map((shadow, index) => (
|
|
357
|
+
<SimpleSelect.Option
|
|
358
|
+
key={index}
|
|
359
|
+
id={`${index}`}
|
|
360
|
+
value={shadow}
|
|
361
|
+
>
|
|
362
|
+
{shadow}
|
|
363
|
+
</SimpleSelect.Option>
|
|
364
|
+
))
|
|
365
|
+
}
|
|
366
|
+
</SimpleSelect>
|
|
367
|
+
</View>
|
|
368
|
+
</Flex.Item>
|
|
369
|
+
<Flex.Item align="start">
|
|
370
|
+
<View as="div" margin="none">
|
|
371
|
+
<RadioInputGroup
|
|
372
|
+
name="changeColor"
|
|
373
|
+
defaultValue="primary"
|
|
374
|
+
description="Color:"
|
|
375
|
+
variant="toggle"
|
|
376
|
+
size="small"
|
|
377
|
+
onChange={this.changeColor} >
|
|
378
|
+
<RadioInput label="Primary" value="primary"/>
|
|
379
|
+
<RadioInput label="Primary inverse" value="primary-inverse" />
|
|
380
|
+
</RadioInputGroup>
|
|
381
|
+
</View>
|
|
382
|
+
</Flex.Item>
|
|
383
|
+
</Flex>
|
|
384
|
+
<View
|
|
385
|
+
as="div"
|
|
386
|
+
display="block"
|
|
387
|
+
padding="large"
|
|
388
|
+
textAlign="center">
|
|
389
|
+
<Popover
|
|
390
|
+
renderTrigger={<div style={{ display: 'inline-block', height: '3px', width: '3px', background: 'blue' }}/>}
|
|
391
|
+
isShowingContent={this.state.isShowingContent}
|
|
392
|
+
placement={this.state.placement}
|
|
393
|
+
withArrow={this.state.withArrow}
|
|
394
|
+
shouldAlignArrow={this.state.shouldAlignArrow}
|
|
395
|
+
shadow={this.state.shadow}
|
|
396
|
+
color={this.state.color}
|
|
397
|
+
mountNode={() => document.getElementById('main')}
|
|
398
|
+
>
|
|
399
|
+
<Heading>Small<br />Target</Heading>
|
|
400
|
+
</Popover>
|
|
401
|
+
</View>
|
|
402
|
+
</View>
|
|
403
|
+
)
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
render(<Example />)
|
|
408
|
+
```
|
|
409
|
+
|
|
173
410
|
### Guidelines
|
|
174
411
|
|
|
175
412
|
```js
|
package/src/Popover/props.ts
CHANGED
|
@@ -37,6 +37,33 @@ import type {
|
|
|
37
37
|
} from '@instructure/ui-position'
|
|
38
38
|
import type { BidirectionalProps } from '@instructure/ui-i18n'
|
|
39
39
|
import type { PropValidators } from '@instructure/shared-types'
|
|
40
|
+
// Copied list from "PositionPropTypes.placement" so that it appears as options in the properties table.
|
|
41
|
+
// TODO: try to use "PositionPropTypes.placement" again once Popover is fully typed and uses @tsProps
|
|
42
|
+
const placementPropValues = [
|
|
43
|
+
'top',
|
|
44
|
+
'bottom',
|
|
45
|
+
'start',
|
|
46
|
+
'end',
|
|
47
|
+
'top start',
|
|
48
|
+
'top center',
|
|
49
|
+
'top end',
|
|
50
|
+
'top stretch',
|
|
51
|
+
'bottom start',
|
|
52
|
+
'bottom center',
|
|
53
|
+
'bottom end',
|
|
54
|
+
'bottom stretch',
|
|
55
|
+
'start top',
|
|
56
|
+
'start center',
|
|
57
|
+
'start bottom',
|
|
58
|
+
'start stretch',
|
|
59
|
+
'end top',
|
|
60
|
+
'end center',
|
|
61
|
+
'end bottom',
|
|
62
|
+
'end stretch',
|
|
63
|
+
'center start',
|
|
64
|
+
'center end',
|
|
65
|
+
'offscreen'
|
|
66
|
+
]
|
|
40
67
|
|
|
41
68
|
type PopoverOwnProps = {
|
|
42
69
|
isShowingContent?: boolean
|
|
@@ -118,7 +145,7 @@ const propTypes: PropValidators<PropKeys> = {
|
|
|
118
145
|
/**
|
|
119
146
|
* The placement of the content in relation to the trigger
|
|
120
147
|
*/
|
|
121
|
-
placement:
|
|
148
|
+
placement: PropTypes.oneOf(placementPropValues),
|
|
122
149
|
/**
|
|
123
150
|
* Controls the shadow depth for the `<Popover />`
|
|
124
151
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Popover/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC9D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