@instructure/ui-drilldown 8.26.3 → 8.26.4-snapshot-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/CHANGELOG.md +11 -0
- package/package.json +21 -21
- package/src/Drilldown/DrilldownOption/props.ts +9 -11
- package/src/Drilldown/DrilldownPage/props.ts +4 -3
- package/src/Drilldown/index.tsx +15 -11
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Drilldown/DrilldownOption/index.d.ts +10 -34
- package/types/Drilldown/DrilldownOption/index.d.ts.map +1 -1
- package/types/Drilldown/DrilldownOption/props.d.ts +6 -5
- package/types/Drilldown/DrilldownOption/props.d.ts.map +1 -1
- package/types/Drilldown/DrilldownPage/index.d.ts +2 -2
- package/types/Drilldown/DrilldownPage/props.d.ts +2 -1
- package/types/Drilldown/DrilldownPage/props.d.ts.map +1 -1
- package/types/Drilldown/index.d.ts.map +1 -1
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
|
+
## [8.26.4-snapshot-3](https://github.com/instructure/instructure-ui/compare/v8.26.3...v8.26.4-snapshot-3) (2022-07-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* support React 18 ([0a2bf0c](https://github.com/instructure/instructure-ui/commit/0a2bf0cdd4d8bcec6e42a7ccf28a787e4a35bc40))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [8.26.3](https://github.com/instructure/instructure-ui/compare/v8.26.2...v8.26.3) (2022-07-14)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @instructure/ui-drilldown
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-drilldown",
|
|
3
|
-
"version": "8.26.3",
|
|
3
|
+
"version": "8.26.4-snapshot-3",
|
|
4
4
|
"description": "A drilldown menu component",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,31 +24,31 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.13.10",
|
|
27
|
-
"@instructure/console": "8.26.3",
|
|
28
|
-
"@instructure/emotion": "8.26.3",
|
|
29
|
-
"@instructure/shared-types": "8.26.3",
|
|
30
|
-
"@instructure/ui-dom-utils": "8.26.3",
|
|
31
|
-
"@instructure/ui-icons": "8.26.3",
|
|
32
|
-
"@instructure/ui-options": "8.26.3",
|
|
33
|
-
"@instructure/ui-popover": "8.26.3",
|
|
34
|
-
"@instructure/ui-position": "8.26.3",
|
|
35
|
-
"@instructure/ui-prop-types": "8.26.3",
|
|
36
|
-
"@instructure/ui-react-utils": "8.26.3",
|
|
37
|
-
"@instructure/ui-selectable": "8.26.3",
|
|
38
|
-
"@instructure/ui-testable": "8.26.3",
|
|
39
|
-
"@instructure/ui-utils": "8.26.3",
|
|
40
|
-
"@instructure/ui-view": "8.26.3",
|
|
27
|
+
"@instructure/console": "8.26.4-snapshot-3",
|
|
28
|
+
"@instructure/emotion": "8.26.4-snapshot-3",
|
|
29
|
+
"@instructure/shared-types": "8.26.4-snapshot-3",
|
|
30
|
+
"@instructure/ui-dom-utils": "8.26.4-snapshot-3",
|
|
31
|
+
"@instructure/ui-icons": "8.26.4-snapshot-3",
|
|
32
|
+
"@instructure/ui-options": "8.26.4-snapshot-3",
|
|
33
|
+
"@instructure/ui-popover": "8.26.4-snapshot-3",
|
|
34
|
+
"@instructure/ui-position": "8.26.4-snapshot-3",
|
|
35
|
+
"@instructure/ui-prop-types": "8.26.4-snapshot-3",
|
|
36
|
+
"@instructure/ui-react-utils": "8.26.4-snapshot-3",
|
|
37
|
+
"@instructure/ui-selectable": "8.26.4-snapshot-3",
|
|
38
|
+
"@instructure/ui-testable": "8.26.4-snapshot-3",
|
|
39
|
+
"@instructure/ui-utils": "8.26.4-snapshot-3",
|
|
40
|
+
"@instructure/ui-view": "8.26.4-snapshot-3",
|
|
41
41
|
"prop-types": "^15"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@instructure/ui-babel-preset": "8.26.3",
|
|
45
|
-
"@instructure/ui-color-utils": "8.26.3",
|
|
46
|
-
"@instructure/ui-test-locator": "8.26.3",
|
|
47
|
-
"@instructure/ui-test-utils": "8.26.3",
|
|
48
|
-
"@instructure/ui-themes": "8.26.3"
|
|
44
|
+
"@instructure/ui-babel-preset": "8.26.4-snapshot-3",
|
|
45
|
+
"@instructure/ui-color-utils": "8.26.4-snapshot-3",
|
|
46
|
+
"@instructure/ui-test-locator": "8.26.4-snapshot-3",
|
|
47
|
+
"@instructure/ui-test-utils": "8.26.4-snapshot-3",
|
|
48
|
+
"@instructure/ui-themes": "8.26.4-snapshot-3"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"react": ">=16.8 <=
|
|
51
|
+
"react": ">=16.8 <=18"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
@@ -32,9 +32,13 @@ import type {
|
|
|
32
32
|
AsElementType
|
|
33
33
|
} from '@instructure/shared-types'
|
|
34
34
|
import type { WithStyleProps } from '@instructure/emotion'
|
|
35
|
-
import type {
|
|
35
|
+
import type {
|
|
36
|
+
OptionsItemRenderProps,
|
|
37
|
+
OptionsItemProps
|
|
38
|
+
} from '@instructure/ui-options'
|
|
36
39
|
|
|
37
40
|
import Drilldown from '../index'
|
|
41
|
+
import { Renderable } from '@instructure/shared-types'
|
|
38
42
|
|
|
39
43
|
type DrilldownOptionValue = string | number | undefined
|
|
40
44
|
|
|
@@ -46,7 +50,7 @@ type RenderContentProps = {
|
|
|
46
50
|
as: DrilldownOptionOwnProps['as']
|
|
47
51
|
role: DrilldownOptionOwnProps['role']
|
|
48
52
|
variant: DrilldownOptionVariant
|
|
49
|
-
vAlign
|
|
53
|
+
vAlign?: RenderContentVAlign
|
|
50
54
|
isSelected: boolean
|
|
51
55
|
}
|
|
52
56
|
|
|
@@ -99,27 +103,21 @@ type DrilldownOptionOwnProps = {
|
|
|
99
103
|
*
|
|
100
104
|
* If a function is provided, it has a `props` parameter.
|
|
101
105
|
*/
|
|
102
|
-
renderLabelInfo?:
|
|
103
|
-
| React.ReactNode
|
|
104
|
-
| ((props: RenderContentProps) => React.ReactNode)
|
|
106
|
+
renderLabelInfo?: Renderable<RenderContentProps>
|
|
105
107
|
|
|
106
108
|
/**
|
|
107
109
|
* Content to render before the label.
|
|
108
110
|
*
|
|
109
111
|
* If a function is provided, it has a `props` parameter.
|
|
110
112
|
*/
|
|
111
|
-
renderBeforeLabel?:
|
|
112
|
-
| React.ReactNode
|
|
113
|
-
| ((props: RenderContentProps) => React.ReactNode)
|
|
113
|
+
renderBeforeLabel?: Renderable<OptionsItemRenderProps>
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
116
|
* Content to render after the label.
|
|
117
117
|
*
|
|
118
118
|
* If a function is provided, it has a `props` parameter.
|
|
119
119
|
*/
|
|
120
|
-
renderAfterLabel?:
|
|
121
|
-
| React.ReactNode
|
|
122
|
-
| ((props: RenderContentProps) => React.ReactNode)
|
|
120
|
+
renderAfterLabel?: Renderable<OptionsItemRenderProps>
|
|
123
121
|
|
|
124
122
|
/**
|
|
125
123
|
* Sets the vAlign of renderBeforeLabel content
|
|
@@ -37,6 +37,7 @@ import DrilldownOption from '../DrilldownOption'
|
|
|
37
37
|
import DrilldownSeparator from '../DrilldownSeparator'
|
|
38
38
|
|
|
39
39
|
import type { OptionChild, SeparatorChild, GroupChild } from '../props'
|
|
40
|
+
import { Renderable } from '@instructure/shared-types'
|
|
40
41
|
|
|
41
42
|
type PageChildren = GroupChild | OptionChild | SeparatorChild
|
|
42
43
|
|
|
@@ -52,7 +53,7 @@ type DrilldownPageOwnProps = {
|
|
|
52
53
|
/**
|
|
53
54
|
* The title of the page displayed in the header
|
|
54
55
|
*/
|
|
55
|
-
renderTitle?:
|
|
56
|
+
renderTitle?: Renderable
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
59
|
* Label for the optional "action" option in the header (e.g.: "Select all")
|
|
@@ -66,8 +67,8 @@ type DrilldownPageOwnProps = {
|
|
|
66
67
|
* is the title of the previous page.
|
|
67
68
|
*/
|
|
68
69
|
renderBackButtonLabel?:
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
| React.ReactNode
|
|
71
|
+
| ((prevPageTitle?: React.ReactNode) => React.ReactNode)
|
|
71
72
|
|
|
72
73
|
/**
|
|
73
74
|
* Callback fired when the "action" option is clicked in the header
|
package/src/Drilldown/index.tsx
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
/** @jsx jsx */
|
|
26
26
|
/** @jsxFrag React.Fragment */
|
|
27
|
-
import React, { Component, ReactElement } from 'react'
|
|
27
|
+
import React, { Component, ReactElement, ReactNode } from 'react'
|
|
28
28
|
|
|
29
29
|
import { warn, error } from '@instructure/console'
|
|
30
30
|
import { testable } from '@instructure/ui-testable'
|
|
@@ -1129,7 +1129,10 @@ class Drilldown extends Component<DrilldownProps, DrilldownState> {
|
|
|
1129
1129
|
|
|
1130
1130
|
const optionLabel = callRenderProp(children, {
|
|
1131
1131
|
id,
|
|
1132
|
-
variant: optionProps.variant
|
|
1132
|
+
variant: optionProps.variant as Exclude<
|
|
1133
|
+
OptionsItemProps['variant'],
|
|
1134
|
+
'selected'
|
|
1135
|
+
>,
|
|
1133
1136
|
isSelected
|
|
1134
1137
|
})
|
|
1135
1138
|
|
|
@@ -1142,7 +1145,10 @@ class Drilldown extends Component<DrilldownProps, DrilldownState> {
|
|
|
1142
1145
|
}
|
|
1143
1146
|
|
|
1144
1147
|
const renderLabelProps = {
|
|
1145
|
-
variant: optionProps.variant
|
|
1148
|
+
variant: optionProps.variant as Exclude<
|
|
1149
|
+
OptionsItemProps['variant'],
|
|
1150
|
+
'selected'
|
|
1151
|
+
>,
|
|
1146
1152
|
vAlign: afterLabelContentVAlign,
|
|
1147
1153
|
as,
|
|
1148
1154
|
role: optionProps.role,
|
|
@@ -1154,19 +1160,17 @@ class Drilldown extends Component<DrilldownProps, DrilldownState> {
|
|
|
1154
1160
|
typeof optionProps.renderBeforeLabel === 'function' &&
|
|
1155
1161
|
!optionProps.renderBeforeLabel?.prototype?.isReactComponent
|
|
1156
1162
|
) {
|
|
1157
|
-
optionProps.renderBeforeLabel =
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
)
|
|
1163
|
+
optionProps.renderBeforeLabel = (
|
|
1164
|
+
optionProps.renderBeforeLabel as () => ReactNode
|
|
1165
|
+
).bind(null, renderLabelProps)
|
|
1161
1166
|
}
|
|
1162
1167
|
if (
|
|
1163
1168
|
typeof optionProps.renderAfterLabel === 'function' &&
|
|
1164
1169
|
!optionProps.renderAfterLabel?.prototype?.isReactComponent
|
|
1165
1170
|
) {
|
|
1166
|
-
optionProps.renderAfterLabel =
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
)
|
|
1171
|
+
optionProps.renderAfterLabel = (
|
|
1172
|
+
optionProps.renderAfterLabel as () => ReactNode
|
|
1173
|
+
).bind(null, renderLabelProps)
|
|
1170
1174
|
}
|
|
1171
1175
|
|
|
1172
1176
|
const labelInfo =
|