@ebay/ui-core-react 2.1.2 → 2.1.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.
|
@@ -25,8 +25,8 @@ import '@ebay/skin/drawer-dialog.css'
|
|
|
25
25
|
|
|
26
26
|
Name | Type | Stateful | Required | Description
|
|
27
27
|
--- | --- | --- | --- | ---
|
|
28
|
-
`expanded` | Boolean | No | No | Whether the drawer is expanded to full height or max 50
|
|
29
|
-
`open` | Boolean | Yes | No | Whether drawer is open.
|
|
28
|
+
`expanded` | Boolean | No | No | Whether the drawer is expanded to full height or max 50%. Controlled.
|
|
29
|
+
`open` | Boolean | Yes | No | Whether drawer is open. Controlled.
|
|
30
30
|
`noHandle` | Boolean | Yes | No | Whether handle will be shown or not.
|
|
31
31
|
`focus` | String | No | No | An id for an element which will receive focus when the drawer opens (defaults to close button).
|
|
32
32
|
`a11yCloseText` | String | No | Yes | A11y text for close button and mask.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../src/ebay-drawer-dialog/components/drawer.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAY,EAAE,EAAgB,SAAS,
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../src/ebay-drawer-dialog/components/drawer.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAY,EAAE,EAAgB,SAAS,EAA0C,MAAM,OAAO,CAAA;AAE5G,OAAO,EAAE,eAAe,EAAyC,MAAM,wBAAwB,CAAA;AAK/F,MAAM,WAAW,eAAe,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,QAAA,MAAM,gBAAgB,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,CA+F9C,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -51,9 +51,12 @@ var THRESHOLD_TOUCH = 30;
|
|
|
51
51
|
var classPrefix = 'drawer-dialog';
|
|
52
52
|
var EbayDrawerDialog = function (_a) {
|
|
53
53
|
var _b;
|
|
54
|
-
var _c = _a.expanded,
|
|
54
|
+
var _c = _a.expanded, controlledExpanded = _c === void 0 ? false : _c, noHandle = _a.noHandle, _d = _a.onClose, onClose = _d === void 0 ? function () { } : _d, _e = _a.onCollapsed, onCollapsed = _e === void 0 ? function () { } : _e, _f = _a.onExpanded, onExpanded = _f === void 0 ? function () { } : _f, _g = _a.a11yMaximizeText, a11yMaximizeText = _g === void 0 ? 'Maximize Drawer' : _g, _h = _a.a11yMinimizeText, a11yMinimizeText = _h === void 0 ? 'Minimize Drawer' : _h, children = _a.children, rest = __rest(_a, ["expanded", "noHandle", "onClose", "onCollapsed", "onExpanded", "a11yMaximizeText", "a11yMinimizeText", "children"]);
|
|
55
55
|
var touches = [];
|
|
56
|
-
var _j = react_1.useState(
|
|
56
|
+
var _j = react_1.useState(controlledExpanded), expanded = _j[0], setExpanded = _j[1];
|
|
57
|
+
react_1.useEffect(function () {
|
|
58
|
+
setExpanded(controlledExpanded);
|
|
59
|
+
}, [controlledExpanded]);
|
|
57
60
|
var setExpandedState = function (expand) {
|
|
58
61
|
setExpanded(expand);
|
|
59
62
|
if (expand) {
|