@instructure/ui-drilldown 8.51.1-snapshot-8 → 8.51.1-snapshot-11
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 +5 -2
- package/es/Drilldown/DrilldownOption/index.js +2 -1
- package/es/Drilldown/DrilldownOption/props.js +3 -2
- package/lib/Drilldown/DrilldownOption/index.js +2 -1
- package/lib/Drilldown/DrilldownOption/props.js +3 -2
- package/package.json +20 -20
- package/src/Drilldown/DrilldownOption/index.tsx +2 -1
- package/src/Drilldown/DrilldownOption/props.ts +11 -2
- package/src/Drilldown/props.ts +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Drilldown/DrilldownOption/index.d.ts +3 -0
- package/types/Drilldown/DrilldownOption/index.d.ts.map +1 -1
- package/types/Drilldown/DrilldownOption/props.d.ts +5 -0
- package/types/Drilldown/DrilldownOption/props.d.ts.map +1 -1
- package/types/Drilldown/props.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
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.51.1-snapshot-
|
|
6
|
+
## [8.51.1-snapshot-11](https://github.com/instructure/instructure-ui/compare/v8.51.0...v8.51.1-snapshot-11) (2024-02-02)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **ui-drilldown,ui-top-nav-bar:** add shouldCloseOnClick ([c3df722](https://github.com/instructure/instructure-ui/commit/c3df7221b185996713a05d06ef585020bfa67c6b))
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
|
@@ -48,7 +48,8 @@ let DrilldownOption = (_dec = withStyle(null, optionsItemThemeGenerator), _dec(_
|
|
|
48
48
|
beforeLabelContentVAlign: 'start',
|
|
49
49
|
afterLabelContentVAlign: 'start',
|
|
50
50
|
as: 'li',
|
|
51
|
-
role: 'menuitem'
|
|
51
|
+
role: 'menuitem',
|
|
52
|
+
shouldCloseOnClick: 'auto'
|
|
52
53
|
}, _class2)) || _class);
|
|
53
54
|
export default DrilldownOption;
|
|
54
55
|
export { DrilldownOption };
|
|
@@ -42,7 +42,8 @@ const propTypes = {
|
|
|
42
42
|
descriptionRole: PropTypes.string,
|
|
43
43
|
onOptionClick: PropTypes.func,
|
|
44
44
|
defaultSelected: PropTypes.bool,
|
|
45
|
-
elementRef: PropTypes.func
|
|
45
|
+
elementRef: PropTypes.func,
|
|
46
|
+
shouldCloseOnClick: PropTypes.oneOf(['auto', 'always', 'never'])
|
|
46
47
|
};
|
|
47
|
-
const allowedProps = ['id', 'children', 'subPageId', 'disabled', 'selected', 'value', 'href', 'as', 'role', 'renderLabelInfo', 'renderBeforeLabel', 'renderAfterLabel', 'beforeLabelContentVAlign', 'afterLabelContentVAlign', 'description', 'descriptionRole', 'onOptionClick', 'defaultSelected', 'elementRef'];
|
|
48
|
+
const allowedProps = ['id', 'children', 'subPageId', 'disabled', 'selected', 'value', 'href', 'as', 'role', 'renderLabelInfo', 'renderBeforeLabel', 'renderAfterLabel', 'beforeLabelContentVAlign', 'afterLabelContentVAlign', 'description', 'descriptionRole', 'onOptionClick', 'defaultSelected', 'elementRef', 'shouldCloseOnClick'];
|
|
48
49
|
export { propTypes, allowedProps };
|
|
@@ -53,6 +53,7 @@ let DrilldownOption = exports.DrilldownOption = (_dec = (0, _emotion.withStyle)(
|
|
|
53
53
|
beforeLabelContentVAlign: 'start',
|
|
54
54
|
afterLabelContentVAlign: 'start',
|
|
55
55
|
as: 'li',
|
|
56
|
-
role: 'menuitem'
|
|
56
|
+
role: 'menuitem',
|
|
57
|
+
shouldCloseOnClick: 'auto'
|
|
57
58
|
}, _class2)) || _class);
|
|
58
59
|
var _default = exports.default = DrilldownOption;
|
|
@@ -49,6 +49,7 @@ const propTypes = exports.propTypes = {
|
|
|
49
49
|
descriptionRole: _propTypes.default.string,
|
|
50
50
|
onOptionClick: _propTypes.default.func,
|
|
51
51
|
defaultSelected: _propTypes.default.bool,
|
|
52
|
-
elementRef: _propTypes.default.func
|
|
52
|
+
elementRef: _propTypes.default.func,
|
|
53
|
+
shouldCloseOnClick: _propTypes.default.oneOf(['auto', 'always', 'never'])
|
|
53
54
|
};
|
|
54
|
-
const allowedProps = exports.allowedProps = ['id', 'children', 'subPageId', 'disabled', 'selected', 'value', 'href', 'as', 'role', 'renderLabelInfo', 'renderBeforeLabel', 'renderAfterLabel', 'beforeLabelContentVAlign', 'afterLabelContentVAlign', 'description', 'descriptionRole', 'onOptionClick', 'defaultSelected', 'elementRef'];
|
|
55
|
+
const allowedProps = exports.allowedProps = ['id', 'children', 'subPageId', 'disabled', 'selected', 'value', 'href', 'as', 'role', 'renderLabelInfo', 'renderBeforeLabel', 'renderAfterLabel', 'beforeLabelContentVAlign', 'afterLabelContentVAlign', 'description', 'descriptionRole', 'onOptionClick', 'defaultSelected', 'elementRef', 'shouldCloseOnClick'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-drilldown",
|
|
3
|
-
"version": "8.51.1-snapshot-
|
|
3
|
+
"version": "8.51.1-snapshot-11",
|
|
4
4
|
"description": "A drilldown menu component",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,28 +24,28 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.23.2",
|
|
27
|
-
"@instructure/console": "8.51.1-snapshot-
|
|
28
|
-
"@instructure/emotion": "8.51.1-snapshot-
|
|
29
|
-
"@instructure/shared-types": "8.51.1-snapshot-
|
|
30
|
-
"@instructure/ui-dom-utils": "8.51.1-snapshot-
|
|
31
|
-
"@instructure/ui-icons": "8.51.1-snapshot-
|
|
32
|
-
"@instructure/ui-options": "8.51.1-snapshot-
|
|
33
|
-
"@instructure/ui-popover": "8.51.1-snapshot-
|
|
34
|
-
"@instructure/ui-position": "8.51.1-snapshot-
|
|
35
|
-
"@instructure/ui-prop-types": "8.51.1-snapshot-
|
|
36
|
-
"@instructure/ui-react-utils": "8.51.1-snapshot-
|
|
37
|
-
"@instructure/ui-selectable": "8.51.1-snapshot-
|
|
38
|
-
"@instructure/ui-testable": "8.51.1-snapshot-
|
|
39
|
-
"@instructure/ui-utils": "8.51.1-snapshot-
|
|
40
|
-
"@instructure/ui-view": "8.51.1-snapshot-
|
|
27
|
+
"@instructure/console": "8.51.1-snapshot-11",
|
|
28
|
+
"@instructure/emotion": "8.51.1-snapshot-11",
|
|
29
|
+
"@instructure/shared-types": "8.51.1-snapshot-11",
|
|
30
|
+
"@instructure/ui-dom-utils": "8.51.1-snapshot-11",
|
|
31
|
+
"@instructure/ui-icons": "8.51.1-snapshot-11",
|
|
32
|
+
"@instructure/ui-options": "8.51.1-snapshot-11",
|
|
33
|
+
"@instructure/ui-popover": "8.51.1-snapshot-11",
|
|
34
|
+
"@instructure/ui-position": "8.51.1-snapshot-11",
|
|
35
|
+
"@instructure/ui-prop-types": "8.51.1-snapshot-11",
|
|
36
|
+
"@instructure/ui-react-utils": "8.51.1-snapshot-11",
|
|
37
|
+
"@instructure/ui-selectable": "8.51.1-snapshot-11",
|
|
38
|
+
"@instructure/ui-testable": "8.51.1-snapshot-11",
|
|
39
|
+
"@instructure/ui-utils": "8.51.1-snapshot-11",
|
|
40
|
+
"@instructure/ui-view": "8.51.1-snapshot-11",
|
|
41
41
|
"prop-types": "^15.8.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@instructure/ui-babel-preset": "8.51.1-snapshot-
|
|
45
|
-
"@instructure/ui-color-utils": "8.51.1-snapshot-
|
|
46
|
-
"@instructure/ui-test-locator": "8.51.1-snapshot-
|
|
47
|
-
"@instructure/ui-test-utils": "8.51.1-snapshot-
|
|
48
|
-
"@instructure/ui-themes": "8.51.1-snapshot-
|
|
44
|
+
"@instructure/ui-babel-preset": "8.51.1-snapshot-11",
|
|
45
|
+
"@instructure/ui-color-utils": "8.51.1-snapshot-11",
|
|
46
|
+
"@instructure/ui-test-locator": "8.51.1-snapshot-11",
|
|
47
|
+
"@instructure/ui-test-utils": "8.51.1-snapshot-11",
|
|
48
|
+
"@instructure/ui-themes": "8.51.1-snapshot-11"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"react": ">=16.8 <=18"
|
|
@@ -44,6 +44,8 @@ type DrilldownOptionValue = string | number | undefined
|
|
|
44
44
|
|
|
45
45
|
type RenderContentVAlign = 'start' | 'center' | 'end'
|
|
46
46
|
|
|
47
|
+
type ShouldCloseOnClick = 'auto' | 'always' | 'never'
|
|
48
|
+
|
|
47
49
|
type DrilldownOptionVariant = Exclude<OptionsItemProps['variant'], 'selected'>
|
|
48
50
|
|
|
49
51
|
type RenderContentProps = {
|
|
@@ -171,6 +173,11 @@ type DrilldownOptionOwnProps = {
|
|
|
171
173
|
* Provides a reference to the underlying html root element
|
|
172
174
|
*/
|
|
173
175
|
elementRef?: (element: Element | null) => void
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Should close the container menu component, if clicked on the option marked with this prop
|
|
179
|
+
*/
|
|
180
|
+
shouldCloseOnClick?: ShouldCloseOnClick
|
|
174
181
|
}
|
|
175
182
|
|
|
176
183
|
type PropKeys = keyof DrilldownOptionOwnProps
|
|
@@ -200,7 +207,8 @@ const propTypes: PropValidators<PropKeys> = {
|
|
|
200
207
|
descriptionRole: PropTypes.string,
|
|
201
208
|
onOptionClick: PropTypes.func,
|
|
202
209
|
defaultSelected: PropTypes.bool,
|
|
203
|
-
elementRef: PropTypes.func
|
|
210
|
+
elementRef: PropTypes.func,
|
|
211
|
+
shouldCloseOnClick: PropTypes.oneOf(['auto', 'always', 'never'])
|
|
204
212
|
}
|
|
205
213
|
|
|
206
214
|
const allowedProps: AllowedPropKeys = [
|
|
@@ -222,7 +230,8 @@ const allowedProps: AllowedPropKeys = [
|
|
|
222
230
|
'descriptionRole',
|
|
223
231
|
'onOptionClick',
|
|
224
232
|
'defaultSelected',
|
|
225
|
-
'elementRef'
|
|
233
|
+
'elementRef',
|
|
234
|
+
'shouldCloseOnClick'
|
|
226
235
|
]
|
|
227
236
|
|
|
228
237
|
export type { DrilldownOptionProps, DrilldownOptionValue }
|
package/src/Drilldown/props.ts
CHANGED
|
@@ -146,7 +146,7 @@ type DrilldownOwnProps = {
|
|
|
146
146
|
defaultShow?: boolean
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
|
-
* Is the `<Drilldown />` open (should be accompanied by `onToggle`)
|
|
149
|
+
* Is the `<Drilldown />` open (should be accompanied by `onToggle` and `trigger`)
|
|
150
150
|
*/
|
|
151
151
|
show?: boolean // TODO: type controllable(PropTypes.bool, 'onToggle', 'defaultShow')
|
|
152
152
|
|