@instructure/ui-drawer-layout 11.7.3-snapshot-25 → 11.7.3-snapshot-27
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/DrawerLayout/v1/DrawerContent/index.js +35 -37
- package/es/DrawerLayout/v1/DrawerContent/styles.js +3 -1
- package/es/DrawerLayout/v1/DrawerContent/theme.js +4 -2
- package/es/DrawerLayout/v1/DrawerTray/index.js +90 -85
- package/es/DrawerLayout/v1/DrawerTray/styles.js +6 -2
- package/es/DrawerLayout/v1/DrawerTray/theme.js +12 -11
- package/es/DrawerLayout/v1/__fixtures__/DrawerLayout.fixture.js +18 -18
- package/es/DrawerLayout/v1/index.js +74 -66
- package/es/DrawerLayout/v2/DrawerContent/index.js +35 -37
- package/es/DrawerLayout/v2/DrawerContent/styles.js +3 -1
- package/es/DrawerLayout/v2/DrawerTray/index.js +90 -85
- package/es/DrawerLayout/v2/DrawerTray/styles.js +6 -2
- package/es/DrawerLayout/v2/__fixtures__/DrawerLayout.fixture.js +18 -18
- package/es/DrawerLayout/v2/index.js +74 -66
- package/lib/DrawerLayout/v1/DrawerContent/index.js +35 -37
- package/lib/DrawerLayout/v1/DrawerContent/styles.js +3 -1
- package/lib/DrawerLayout/v1/DrawerContent/theme.js +4 -2
- package/lib/DrawerLayout/v1/DrawerTray/index.js +90 -85
- package/lib/DrawerLayout/v1/DrawerTray/styles.js +6 -2
- package/lib/DrawerLayout/v1/DrawerTray/theme.js +12 -11
- package/lib/DrawerLayout/v1/__fixtures__/DrawerLayout.fixture.js +19 -18
- package/lib/DrawerLayout/v1/index.js +75 -67
- package/lib/DrawerLayout/v2/DrawerContent/index.js +35 -37
- package/lib/DrawerLayout/v2/DrawerContent/styles.js +3 -1
- package/lib/DrawerLayout/v2/DrawerTray/index.js +90 -85
- package/lib/DrawerLayout/v2/DrawerTray/styles.js +6 -2
- package/lib/DrawerLayout/v2/__fixtures__/DrawerLayout.fixture.js +19 -18
- package/lib/DrawerLayout/v2/index.js +75 -67
- package/package.json +19 -19
- package/tsconfig.build.tsbuildinfo +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
|
-
## [11.7.3-snapshot-
|
|
6
|
+
## [11.7.3-snapshot-27](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-27) (2026-05-05)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **many:** update dependencies, remove lots of Babel plugins, remove Webpack 4 support ([f916fca](https://github.com/instructure/instructure-ui/commit/f916fcafdddcb2d7de401f93e8ff92cfdfa47bba))
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _class
|
|
1
|
+
var _dec, _class;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -38,29 +38,21 @@ parent: DrawerLayout
|
|
|
38
38
|
id: DrawerLayout.Content
|
|
39
39
|
---
|
|
40
40
|
**/
|
|
41
|
-
let DrawerContent = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
this.handleContentRef = node => {
|
|
53
|
-
this.ref = node;
|
|
54
|
-
if (typeof this.props.contentRef === 'function') {
|
|
55
|
-
this.props.contentRef(node);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
}
|
|
41
|
+
let DrawerContent = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class DrawerContent extends Component {
|
|
42
|
+
static displayName = "DrawerContent";
|
|
43
|
+
static componentId = 'DrawerLayout.Content';
|
|
44
|
+
static locatorAttribute = 'data-drawer-content';
|
|
45
|
+
static allowedProps = allowedProps;
|
|
46
|
+
static defaultProps = {
|
|
47
|
+
role: 'region'
|
|
48
|
+
};
|
|
49
|
+
ref = null;
|
|
59
50
|
get _content() {
|
|
60
51
|
return this.ref;
|
|
61
52
|
}
|
|
53
|
+
_resizeListener;
|
|
54
|
+
_debounced;
|
|
62
55
|
componentDidMount() {
|
|
63
|
-
var _this$props$makeStyle, _this$props;
|
|
64
56
|
const rect = getBoundingClientRect(this.ref);
|
|
65
57
|
const origSize = {
|
|
66
58
|
width: rect.width
|
|
@@ -84,42 +76,48 @@ let DrawerContent = (_dec = withStyle(generateStyle, generateComponentTheme), _d
|
|
|
84
76
|
width: entry.contentRect.width
|
|
85
77
|
};
|
|
86
78
|
if (size.width !== origSize.width) {
|
|
87
|
-
|
|
88
|
-
(_this$_debounced = this._debounced) === null || _this$_debounced === void 0 ? void 0 : _this$_debounced.call(this, size);
|
|
79
|
+
this._debounced?.(size);
|
|
89
80
|
}
|
|
90
81
|
}
|
|
91
82
|
});
|
|
92
83
|
this._resizeListener.observe(this.ref);
|
|
93
|
-
|
|
84
|
+
this.props.makeStyles?.(this.makeStyleProps(false));
|
|
94
85
|
}
|
|
95
86
|
componentDidUpdate() {
|
|
96
|
-
|
|
97
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStyleProps(true));
|
|
87
|
+
this.props.makeStyles?.(this.makeStyleProps(true));
|
|
98
88
|
}
|
|
99
89
|
componentWillUnmount() {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
(_this$_debounced2 = this._debounced) === null || _this$_debounced2 === void 0 ? void 0 : _this$_debounced2.cancel();
|
|
90
|
+
this._resizeListener?.disconnect();
|
|
91
|
+
this._debounced?.cancel();
|
|
103
92
|
}
|
|
93
|
+
makeStyleProps = shouldTransition => {
|
|
94
|
+
return {
|
|
95
|
+
shouldTransition
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
handleContentRef = node => {
|
|
99
|
+
this.ref = node;
|
|
100
|
+
if (typeof this.props.contentRef === 'function') {
|
|
101
|
+
this.props.contentRef(node);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
104
|
render() {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
const {
|
|
106
|
+
style,
|
|
107
|
+
label,
|
|
108
|
+
role
|
|
109
|
+
} = this.props;
|
|
110
110
|
return _jsx("div", {
|
|
111
111
|
...omitProps(this.props, DrawerContent.allowedProps),
|
|
112
112
|
role: role,
|
|
113
113
|
style: style,
|
|
114
114
|
ref: this.handleContentRef,
|
|
115
115
|
"aria-label": label,
|
|
116
|
-
css:
|
|
116
|
+
css: this.props.styles?.drawerContent,
|
|
117
117
|
"data-cid": "DrawerContent",
|
|
118
118
|
children: this.props.children
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
-
}
|
|
122
|
-
role: 'region'
|
|
123
|
-
}, _DrawerContent)) || _class);
|
|
121
|
+
}) || _class);
|
|
124
122
|
export default DrawerContent;
|
|
125
123
|
export { DrawerContent };
|
|
@@ -33,7 +33,9 @@
|
|
|
33
33
|
* @return {Object} The final style object, which will be used in the component
|
|
34
34
|
*/
|
|
35
35
|
const generateStyle = (componentTheme, _props, state) => {
|
|
36
|
-
const
|
|
36
|
+
const {
|
|
37
|
+
shouldTransition
|
|
38
|
+
} = state;
|
|
37
39
|
const transitionState = shouldTransition ? {
|
|
38
40
|
transition: `margin ${componentTheme.duration}`
|
|
39
41
|
} : {};
|
|
@@ -28,9 +28,11 @@
|
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
|
29
29
|
*/
|
|
30
30
|
const generateComponentTheme = theme => {
|
|
31
|
-
const
|
|
31
|
+
const {
|
|
32
|
+
transitions
|
|
33
|
+
} = theme;
|
|
32
34
|
return {
|
|
33
|
-
duration: transitions
|
|
35
|
+
duration: transitions?.duration,
|
|
34
36
|
overflowY: 'auto'
|
|
35
37
|
};
|
|
36
38
|
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const _excluded = ["label", "children", "render", "placement", "open", "onOpen", "onClose", "border", "shadow", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "contentRef", "mountNode", "defaultFocusElement", "liveRegion", "onDismiss", "onTransition", "shouldReturnFocus", "shouldCloseOnEscape", "shouldCloseOnDocumentClick", "shouldContainFocus", "styles"];
|
|
3
|
-
var _dec, _dec2, _class, _DrawerTray;
|
|
1
|
+
var _dec, _dec2, _class;
|
|
4
2
|
/*
|
|
5
3
|
* The MIT License (MIT)
|
|
6
4
|
*
|
|
@@ -45,69 +43,82 @@ parent: DrawerLayout
|
|
|
45
43
|
id: DrawerLayout.Tray
|
|
46
44
|
---
|
|
47
45
|
**/
|
|
48
|
-
let DrawerTray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = textDirectionContextConsumer(), _dec(_class = _dec2(_class =
|
|
46
|
+
let DrawerTray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = textDirectionContextConsumer(), _dec(_class = _dec2(_class = class DrawerTray extends Component {
|
|
47
|
+
static displayName = "DrawerTray";
|
|
48
|
+
static componentId = 'DrawerLayout.Tray';
|
|
49
|
+
static locatorAttribute = 'data-drawer-tray';
|
|
50
|
+
static allowedProps = allowedProps;
|
|
51
|
+
static defaultProps = {
|
|
52
|
+
shouldContainFocus: true,
|
|
53
|
+
shouldCloseOnEscape: true,
|
|
54
|
+
shouldCloseOnDocumentClick: true,
|
|
55
|
+
shouldReturnFocus: true,
|
|
56
|
+
open: false,
|
|
57
|
+
shadow: true,
|
|
58
|
+
border: true,
|
|
59
|
+
placement: 'start'
|
|
60
|
+
};
|
|
61
|
+
ref = null;
|
|
62
|
+
_DOMNode = null;
|
|
49
63
|
get _content() {
|
|
50
64
|
return this.ref;
|
|
51
65
|
}
|
|
52
66
|
constructor(props) {
|
|
53
67
|
super(props);
|
|
54
|
-
this.ref = null;
|
|
55
|
-
this._DOMNode = null;
|
|
56
|
-
this.makeStyleProps = () => {
|
|
57
|
-
return {
|
|
58
|
-
placement: this.placement
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
this.handleContentRef = node => {
|
|
62
|
-
this.ref = node;
|
|
63
|
-
if (typeof this.props.contentRef === 'function') {
|
|
64
|
-
this.props.contentRef(node);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
this.handleTransitionEntered = _transitionType => {
|
|
68
|
-
this.setState({
|
|
69
|
-
transitioning: false
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
this.handleTransitionExited = _transitionType => {
|
|
73
|
-
this.setState({
|
|
74
|
-
transitioning: false
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
this.handlePortalOpen = DOMNode => {
|
|
78
|
-
this.DOMNode = DOMNode;
|
|
79
|
-
this.setState({
|
|
80
|
-
portalOpen: true
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
68
|
this.state = {
|
|
84
69
|
transitioning: false,
|
|
85
70
|
portalOpen: false
|
|
86
71
|
};
|
|
87
72
|
}
|
|
88
73
|
componentDidMount() {
|
|
89
|
-
|
|
90
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, this.makeStyleProps());
|
|
74
|
+
this.props.makeStyles?.(this.makeStyleProps());
|
|
91
75
|
}
|
|
92
76
|
componentDidUpdate(prevProps) {
|
|
93
|
-
var _this$props$makeStyle2, _this$props2;
|
|
94
77
|
if (this.props.open !== prevProps.open) {
|
|
95
78
|
this.setState({
|
|
96
79
|
transitioning: true
|
|
97
80
|
});
|
|
98
81
|
}
|
|
99
|
-
|
|
82
|
+
this.props.makeStyles?.(this.makeStyleProps());
|
|
100
83
|
}
|
|
84
|
+
makeStyleProps = () => {
|
|
85
|
+
return {
|
|
86
|
+
placement: this.placement
|
|
87
|
+
};
|
|
88
|
+
};
|
|
101
89
|
get placement() {
|
|
102
|
-
const
|
|
103
|
-
placement
|
|
104
|
-
dir
|
|
90
|
+
const {
|
|
91
|
+
placement,
|
|
92
|
+
dir
|
|
93
|
+
} = this.props;
|
|
105
94
|
const isRtl = dir === textDirectionContextConsumer.DIRECTION.rtl;
|
|
106
95
|
return isRtl ? mirrorHorizontalPlacement(placement, ' ') : placement;
|
|
107
96
|
}
|
|
108
97
|
get transition() {
|
|
109
98
|
return this.placement === 'end' ? 'fade' : 'slide-left';
|
|
110
99
|
}
|
|
100
|
+
handleContentRef = node => {
|
|
101
|
+
this.ref = node;
|
|
102
|
+
if (typeof this.props.contentRef === 'function') {
|
|
103
|
+
this.props.contentRef(node);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
handleTransitionEntered = _transitionType => {
|
|
107
|
+
this.setState({
|
|
108
|
+
transitioning: false
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
handleTransitionExited = _transitionType => {
|
|
112
|
+
this.setState({
|
|
113
|
+
transitioning: false
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
handlePortalOpen = DOMNode => {
|
|
117
|
+
this.DOMNode = DOMNode;
|
|
118
|
+
this.setState({
|
|
119
|
+
portalOpen: true
|
|
120
|
+
});
|
|
121
|
+
};
|
|
111
122
|
get DOMNode() {
|
|
112
123
|
return this._DOMNode;
|
|
113
124
|
}
|
|
@@ -115,9 +126,10 @@ let DrawerTray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
115
126
|
this._DOMNode = el;
|
|
116
127
|
}
|
|
117
128
|
renderContent() {
|
|
118
|
-
const
|
|
119
|
-
children
|
|
120
|
-
render
|
|
129
|
+
const {
|
|
130
|
+
children,
|
|
131
|
+
render
|
|
132
|
+
} = this.props;
|
|
121
133
|
if (typeof render === 'function') {
|
|
122
134
|
return render();
|
|
123
135
|
} else if (typeof children === 'function') {
|
|
@@ -127,43 +139,45 @@ let DrawerTray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
127
139
|
}
|
|
128
140
|
}
|
|
129
141
|
render() {
|
|
130
|
-
const
|
|
131
|
-
label
|
|
132
|
-
children
|
|
133
|
-
render
|
|
134
|
-
placement
|
|
135
|
-
open
|
|
136
|
-
onOpen
|
|
137
|
-
onClose
|
|
138
|
-
border
|
|
139
|
-
shadow
|
|
140
|
-
onEnter
|
|
141
|
-
onEntering
|
|
142
|
-
onEntered
|
|
143
|
-
onExit
|
|
144
|
-
onExiting
|
|
145
|
-
onExited
|
|
146
|
-
contentRef
|
|
147
|
-
mountNode
|
|
148
|
-
defaultFocusElement
|
|
149
|
-
liveRegion
|
|
150
|
-
onDismiss
|
|
151
|
-
onTransition
|
|
152
|
-
shouldReturnFocus
|
|
153
|
-
shouldCloseOnEscape
|
|
154
|
-
shouldCloseOnDocumentClick
|
|
155
|
-
shouldContainFocus
|
|
156
|
-
styles
|
|
157
|
-
props
|
|
142
|
+
const {
|
|
143
|
+
label,
|
|
144
|
+
children,
|
|
145
|
+
render,
|
|
146
|
+
placement,
|
|
147
|
+
open,
|
|
148
|
+
onOpen,
|
|
149
|
+
onClose,
|
|
150
|
+
border,
|
|
151
|
+
shadow,
|
|
152
|
+
onEnter,
|
|
153
|
+
onEntering,
|
|
154
|
+
onEntered,
|
|
155
|
+
onExit,
|
|
156
|
+
onExiting,
|
|
157
|
+
onExited,
|
|
158
|
+
contentRef,
|
|
159
|
+
mountNode,
|
|
160
|
+
defaultFocusElement,
|
|
161
|
+
liveRegion,
|
|
162
|
+
onDismiss,
|
|
163
|
+
onTransition,
|
|
164
|
+
shouldReturnFocus,
|
|
165
|
+
shouldCloseOnEscape,
|
|
166
|
+
shouldCloseOnDocumentClick,
|
|
167
|
+
shouldContainFocus,
|
|
168
|
+
styles,
|
|
169
|
+
...props
|
|
170
|
+
} = this.props;
|
|
158
171
|
return _jsx(DrawerLayoutContext.Consumer, {
|
|
159
172
|
children: shouldOverlayTray => {
|
|
160
|
-
|
|
161
|
-
|
|
173
|
+
const {
|
|
174
|
+
portalOpen
|
|
175
|
+
} = this.state;
|
|
162
176
|
const needsPortal = shouldOverlayTray && !!mountNode;
|
|
163
177
|
// we have to handle the shadow version here,
|
|
164
178
|
// because passing and handling it in styles.js makes it
|
|
165
179
|
// rerender the component during the transition, breaking it
|
|
166
|
-
const trayStyles = shadow && shouldOverlayTray ? styles
|
|
180
|
+
const trayStyles = shadow && shouldOverlayTray ? styles?.drawerTrayWithShadow : styles?.drawerTray;
|
|
167
181
|
let transitionIn = open;
|
|
168
182
|
if (needsPortal && !portalOpen) {
|
|
169
183
|
transitionIn = false;
|
|
@@ -196,7 +210,7 @@ let DrawerTray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
196
210
|
liveRegion: liveRegion,
|
|
197
211
|
onDismiss: onDismiss,
|
|
198
212
|
as: "div",
|
|
199
|
-
css:
|
|
213
|
+
css: this.props.styles?.drawerTrayContent,
|
|
200
214
|
children: this.renderContent()
|
|
201
215
|
})
|
|
202
216
|
})
|
|
@@ -214,15 +228,6 @@ let DrawerTray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
214
228
|
}
|
|
215
229
|
});
|
|
216
230
|
}
|
|
217
|
-
}
|
|
218
|
-
shouldContainFocus: true,
|
|
219
|
-
shouldCloseOnEscape: true,
|
|
220
|
-
shouldCloseOnDocumentClick: true,
|
|
221
|
-
shouldReturnFocus: true,
|
|
222
|
-
open: false,
|
|
223
|
-
shadow: true,
|
|
224
|
-
border: true,
|
|
225
|
-
placement: 'start'
|
|
226
|
-
}, _DrawerTray)) || _class) || _class);
|
|
231
|
+
}) || _class) || _class);
|
|
227
232
|
export default DrawerTray;
|
|
228
233
|
export { DrawerTray };
|
|
@@ -33,8 +33,12 @@
|
|
|
33
33
|
* @return {Object} The final style object, which will be used in the component
|
|
34
34
|
*/
|
|
35
35
|
const generateStyle = (componentTheme, props, state) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
36
|
+
const {
|
|
37
|
+
border
|
|
38
|
+
} = props;
|
|
39
|
+
const {
|
|
40
|
+
placement
|
|
41
|
+
} = state;
|
|
38
42
|
const borderPlacementStyle = {
|
|
39
43
|
start: {
|
|
40
44
|
borderRightWidth: componentTheme.borderWidth
|
|
@@ -28,18 +28,19 @@
|
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
|
29
29
|
*/
|
|
30
30
|
const generateComponentTheme = theme => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
borders
|
|
34
|
-
stacking
|
|
35
|
-
shadows
|
|
31
|
+
const {
|
|
32
|
+
colors,
|
|
33
|
+
borders,
|
|
34
|
+
stacking,
|
|
35
|
+
shadows
|
|
36
|
+
} = theme;
|
|
36
37
|
const componentVariables = {
|
|
37
|
-
background: colors
|
|
38
|
-
borderColor: colors
|
|
39
|
-
borderWidth: borders
|
|
40
|
-
borderStyle: borders
|
|
41
|
-
zIndex: stacking
|
|
42
|
-
boxShadow: shadows
|
|
38
|
+
background: colors?.contrasts?.white1010,
|
|
39
|
+
borderColor: colors?.contrasts?.grey3045,
|
|
40
|
+
borderWidth: borders?.widthSmall,
|
|
41
|
+
borderStyle: borders?.style,
|
|
42
|
+
zIndex: stacking?.topmost,
|
|
43
|
+
boxShadow: shadows?.depth3,
|
|
43
44
|
overflowX: 'hidden',
|
|
44
45
|
overflowY: 'auto',
|
|
45
46
|
contentOverflowY: 'auto'
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var _DrawerLayout$Content;
|
|
2
1
|
/*
|
|
3
2
|
* The MIT License (MIT)
|
|
4
3
|
*
|
|
@@ -27,13 +26,22 @@ import { Component } from 'react';
|
|
|
27
26
|
import { DrawerLayout } from "../index.js";
|
|
28
27
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
29
28
|
export default class DrawerLayoutFixture extends Component {
|
|
29
|
+
static displayName = "DrawerLayoutFixture";
|
|
30
|
+
static defaultProps = {
|
|
31
|
+
layoutWidth: '600px',
|
|
32
|
+
trayWidth: '200px',
|
|
33
|
+
open: false,
|
|
34
|
+
placement: 'start',
|
|
35
|
+
onOverlayTrayChange: () => {}
|
|
36
|
+
};
|
|
30
37
|
render() {
|
|
31
|
-
const
|
|
32
|
-
layoutWidth
|
|
33
|
-
trayWidth
|
|
34
|
-
open
|
|
35
|
-
placement
|
|
36
|
-
onOverlayTrayChange
|
|
38
|
+
const {
|
|
39
|
+
layoutWidth,
|
|
40
|
+
trayWidth,
|
|
41
|
+
open,
|
|
42
|
+
placement,
|
|
43
|
+
onOverlayTrayChange
|
|
44
|
+
} = this.props;
|
|
37
45
|
return _jsx("div", {
|
|
38
46
|
style: {
|
|
39
47
|
width: layoutWidth
|
|
@@ -51,23 +59,15 @@ export default class DrawerLayoutFixture extends Component {
|
|
|
51
59
|
},
|
|
52
60
|
children: "Hello from tray"
|
|
53
61
|
})
|
|
54
|
-
}),
|
|
62
|
+
}), _jsx(DrawerLayout.Content, {
|
|
55
63
|
label: "Test DrawerContent",
|
|
56
64
|
children: _jsxs("div", {
|
|
57
65
|
children: ["Hello from content", _jsx("button", {
|
|
58
66
|
children: "Expand"
|
|
59
67
|
})]
|
|
60
68
|
})
|
|
61
|
-
})
|
|
69
|
+
})]
|
|
62
70
|
})
|
|
63
71
|
});
|
|
64
72
|
}
|
|
65
|
-
}
|
|
66
|
-
DrawerLayoutFixture.displayName = "DrawerLayoutFixture";
|
|
67
|
-
DrawerLayoutFixture.defaultProps = {
|
|
68
|
-
layoutWidth: '600px',
|
|
69
|
-
trayWidth: '200px',
|
|
70
|
-
open: false,
|
|
71
|
-
placement: 'start',
|
|
72
|
-
onOverlayTrayChange: () => {}
|
|
73
|
-
};
|
|
73
|
+
}
|