@ebay/ui-core-react 6.2.1 → 6.3.0
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/common/component-utils/array.polyfill.flat.js +11 -13
- package/common/component-utils/forwardRef.js +4 -17
- package/common/component-utils/usePrevious.js +3 -3
- package/common/component-utils/utils.js +13 -26
- package/common/debounce.js +3 -7
- package/common/event-utils/index.js +8 -11
- package/common/event-utils/use-key-press.js +10 -12
- package/common/event-utils/use-roving-index.js +13 -24
- package/common/floating-label-utils/hooks.js +43 -53
- package/common/notice-utils/notice-content.js +5 -6
- package/common/notice-utils/notice-cta.js +5 -16
- package/common/notice-utils/notice-footer.js +5 -16
- package/common/notice-utils/notice-title.js +6 -17
- package/common/random-id.js +1 -1
- package/common/range.js +1 -4
- package/common/tooltip-utils/tooltip-close-button.js +1 -1
- package/common/tooltip-utils/tooltip-content.js +16 -28
- package/common/tooltip-utils/tooltip-footer.js +3 -6
- package/common/tooltip-utils/tooltip-host.js +5 -16
- package/common/tooltip-utils/tooltip.d.ts +1 -1
- package/common/tooltip-utils/tooltip.js +14 -26
- package/common/tooltip-utils/use-tooltip.js +8 -9
- package/ebay-alert-dialog/alert-dialog.js +11 -22
- package/ebay-badge/badge.js +6 -17
- package/ebay-breadcrumbs/breadcrumb-item.js +7 -18
- package/ebay-breadcrumbs/breadcrumbs.js +19 -30
- package/ebay-button/button-cell.js +5 -16
- package/ebay-button/button-expand.d.ts +4 -2
- package/ebay-button/button-expand.d.ts.map +1 -1
- package/ebay-button/button-expand.js +7 -10
- package/ebay-button/button-loading.js +5 -5
- package/ebay-button/button-text.js +3 -6
- package/ebay-button/button.d.ts +1 -1
- package/ebay-button/button.js +31 -43
- package/ebay-calendar/calendar.js +94 -111
- package/ebay-calendar/date-utils.js +9 -18
- package/ebay-carousel/carousel-control-button.js +9 -10
- package/ebay-carousel/carousel-item.d.ts +1 -1
- package/ebay-carousel/carousel-item.js +14 -25
- package/ebay-carousel/carousel-list.js +21 -22
- package/ebay-carousel/carousel.js +32 -44
- package/ebay-carousel/helpers.js +35 -47
- package/ebay-carousel/scroll-to-transition.js +15 -15
- package/ebay-checkbox/checkbox.js +21 -32
- package/ebay-confirm-dialog/confirm-dialog.js +11 -22
- package/ebay-cta-button/cta-button.d.ts +1 -1
- package/ebay-cta-button/cta-button.js +9 -20
- package/ebay-date-textbox/date-textbox.js +37 -53
- package/ebay-dialog-base/components/animation.d.ts +0 -1
- package/ebay-dialog-base/components/animation.d.ts.map +1 -1
- package/ebay-dialog-base/components/animation.js +25 -28
- package/ebay-dialog-base/components/dialog-actions.js +2 -5
- package/ebay-dialog-base/components/dialog-close-button.d.ts +5 -2
- package/ebay-dialog-base/components/dialog-close-button.d.ts.map +1 -1
- package/ebay-dialog-base/components/dialog-close-button.js +2 -5
- package/ebay-dialog-base/components/dialog-footer.js +2 -5
- package/ebay-dialog-base/components/dialog-header.js +4 -15
- package/ebay-dialog-base/components/dialog-previous-button.js +6 -17
- package/ebay-dialog-base/components/dialogBase.js +40 -51
- package/ebay-dialog-base/dialog-base-with-state.js +22 -35
- package/ebay-drawer-dialog/components/drawer.js +27 -50
- package/ebay-eek/eek-rating.js +8 -10
- package/ebay-eek/eek-util.d.ts +1 -1
- package/ebay-eek/eek-util.d.ts.map +1 -1
- package/ebay-eek/eek-util.js +7 -6
- package/ebay-fake-menu/menu-item-separator.js +5 -16
- package/ebay-fake-menu/menu-item.js +15 -26
- package/ebay-fake-menu/menu.js +11 -22
- package/ebay-fake-menu-button/menu-button-item.js +2 -2
- package/ebay-fake-menu-button/menu-button-label.d.ts +4 -2
- package/ebay-fake-menu-button/menu-button-label.d.ts.map +1 -1
- package/ebay-fake-menu-button/menu-button-label.js +2 -5
- package/ebay-fake-menu-button/menu-button-separator.js +5 -16
- package/ebay-fake-menu-button/menu-button.js +32 -45
- package/ebay-fake-tabs/fake-tabs.js +10 -23
- package/ebay-fake-tabs/tab.js +5 -16
- package/ebay-field/description.js +7 -19
- package/ebay-field/field.js +4 -5
- package/ebay-field/label.js +7 -18
- package/ebay-fullscreen-dialog/fullscreen-dialog.js +7 -18
- package/ebay-icon/icon.d.ts +1 -1
- package/ebay-icon/icon.js +17 -29
- package/ebay-icon-button/icon-button.d.ts +1 -1
- package/ebay-icon-button/icon-button.js +15 -27
- package/ebay-infotip/ebay-infotip-content.js +2 -5
- package/ebay-infotip/ebay-infotip-heading.js +5 -16
- package/ebay-infotip/ebay-infotip-host.d.ts +2 -2
- package/ebay-infotip/ebay-infotip-host.d.ts.map +1 -1
- package/ebay-infotip/ebay-infotip-host.js +10 -24
- package/ebay-infotip/ebay-infotip.d.ts.map +1 -1
- package/ebay-infotip/ebay-infotip.js +23 -34
- package/ebay-inline-notice/inline-notice.js +15 -27
- package/ebay-lightbox-dialog/lightbox-dialog.js +9 -21
- package/ebay-listbox-button/listbox-button-option.js +7 -18
- package/ebay-listbox-button/listbox-button.d.ts.map +1 -1
- package/ebay-listbox-button/listbox-button.js +79 -100
- package/ebay-menu/menu-item-separator.js +5 -16
- package/ebay-menu/menu-item.js +12 -23
- package/ebay-menu/menu.d.ts +1 -1
- package/ebay-menu/menu.js +37 -64
- package/ebay-menu-button/README.md +1 -1
- package/ebay-menu-button/menu-button-item.js +1 -1
- package/ebay-menu-button/menu-button-label.d.ts +4 -2
- package/ebay-menu-button/menu-button-label.d.ts.map +1 -1
- package/ebay-menu-button/menu-button-label.js +2 -5
- package/ebay-menu-button/menu-button-separator.js +5 -16
- package/ebay-menu-button/menu-button.js +46 -60
- package/ebay-notice-base/components/ebay-notice-content/notice-content.js +1 -1
- package/ebay-notice-base/components/ebay-notice-title/notice-title.d.ts +5 -2
- package/ebay-notice-base/components/ebay-notice-title/notice-title.d.ts.map +1 -1
- package/ebay-notice-base/components/ebay-notice-title/notice-title.js +2 -5
- package/ebay-page-notice/page-notice-cta.js +3 -6
- package/ebay-page-notice/page-notice-footer.js +3 -6
- package/ebay-page-notice/page-notice-title.js +5 -16
- package/ebay-page-notice/page-notice.js +16 -27
- package/ebay-pagination/helpers.js +21 -24
- package/ebay-pagination/pagination-item.d.ts +1 -1
- package/ebay-pagination/pagination-item.js +16 -27
- package/ebay-pagination/pagination.js +52 -81
- package/ebay-panel-dialog/panel-dialog.js +9 -21
- package/ebay-progress-bar/progress-bar.js +5 -16
- package/ebay-progress-spinner/progress-spinner.js +7 -18
- package/ebay-progress-stepper/ebay-progress-step.js +14 -25
- package/ebay-progress-stepper/ebay-progress-stepper.js +10 -21
- package/ebay-progress-stepper/ebay-progress-title.js +2 -5
- package/ebay-radio/radio.js +18 -29
- package/ebay-section-notice/section-notice-footer.js +3 -6
- package/ebay-section-notice/section-notice-title.js +5 -16
- package/ebay-section-notice/section-notice.js +24 -39
- package/ebay-section-title/cta.js +5 -16
- package/ebay-section-title/info.js +5 -16
- package/ebay-section-title/overflow.js +5 -16
- package/ebay-section-title/section-title.js +13 -24
- package/ebay-section-title/subtitle.js +5 -16
- package/ebay-section-title/title.js +5 -16
- package/ebay-select/ebay-select-option.js +4 -15
- package/ebay-select/ebay-select.d.ts +1 -1
- package/ebay-select/ebay-select.js +34 -45
- package/ebay-signal/signal.js +6 -17
- package/ebay-snackbar-dialog/components/ebay-snackbar-dialog-action.js +5 -16
- package/ebay-snackbar-dialog/components/ebay-snackbar-dialog.js +27 -38
- package/ebay-split-button/split-button.js +10 -21
- package/ebay-star-rating/star-rating.js +8 -19
- package/ebay-star-rating-select/star-rating-select.js +20 -31
- package/ebay-svg/svg.js +3 -3
- package/ebay-switch/ebay-switch.js +10 -21
- package/ebay-tabs/tab-panel.js +5 -16
- package/ebay-tabs/tab.js +5 -16
- package/ebay-tabs/tabs.js +26 -40
- package/ebay-textbox/postfix-icon.js +7 -18
- package/ebay-textbox/prefix-icon.js +5 -16
- package/ebay-textbox/textbox.d.ts +1 -1
- package/ebay-textbox/textbox.js +42 -53
- package/ebay-toast-dialog/components/toast.js +6 -17
- package/ebay-tooltip/ebay-tooltip-content.js +1 -1
- package/ebay-tooltip/ebay-tooltip-host.js +1 -1
- package/ebay-tooltip/ebay-tooltip.js +21 -32
- package/ebay-tourtip/ebay-tourtip-content.js +1 -1
- package/ebay-tourtip/ebay-tourtip-footer.js +4 -7
- package/ebay-tourtip/ebay-tourtip-heading.js +6 -17
- package/ebay-tourtip/ebay-tourtip-host.js +1 -1
- package/ebay-tourtip/ebay-tourtip.js +22 -33
- package/ebay-video/controls.d.ts.map +1 -1
- package/ebay-video/controls.js +23 -46
- package/ebay-video/reportButton.d.ts +7 -2
- package/ebay-video/reportButton.d.ts.map +1 -1
- package/ebay-video/reportButton.js +5 -8
- package/ebay-video/source.js +3 -14
- package/ebay-video/video.d.ts.map +1 -1
- package/ebay-video/video.js +54 -80
- package/package.json +23 -18
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -48,24 +37,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
48
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
38
|
};
|
|
50
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var toggleTooltip = function () {
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
42
|
+
const component_utils_1 = require("../common/component-utils");
|
|
43
|
+
const tooltip_utils_1 = require("../common/tooltip-utils");
|
|
44
|
+
const ebay_drawer_dialog_1 = require("../ebay-drawer-dialog");
|
|
45
|
+
const ebay_dialog_base_1 = require("../ebay-dialog-base");
|
|
46
|
+
const ebay_infotip_host_1 = __importDefault(require("./ebay-infotip-host"));
|
|
47
|
+
const index_1 = require("./index");
|
|
48
|
+
const EbayInfotip = ({ variant = 'default', pointer, overlayStyle, disabled, onExpand, onCollapse, children, initialExpanded, icon = 'information16', a11yCloseText, 'aria-label': ariaLabel, className, a11yMaximizeText, a11yMinimizeText }) => {
|
|
49
|
+
const buttonRef = (0, react_1.useRef)();
|
|
50
|
+
const { isExpanded, expandTooltip, collapseTooltip } = (0, tooltip_utils_1.useTooltip)({ onCollapse, onExpand, initialExpanded, hostRef: buttonRef });
|
|
51
|
+
const isModal = variant === 'modal';
|
|
52
|
+
const containerRef = (0, react_1.useRef)();
|
|
53
|
+
const heading = (0, component_utils_1.findComponent)(children, index_1.EbayInfotipHeading);
|
|
54
|
+
const content = (0, component_utils_1.findComponent)(children, index_1.EbayInfotipContent);
|
|
55
|
+
const button = (0, component_utils_1.findComponent)(children, ebay_infotip_host_1.default) || (0, react_1.createElement)(ebay_infotip_host_1.default);
|
|
56
|
+
const toggleTooltip = () => {
|
|
69
57
|
if (isExpanded) {
|
|
70
58
|
collapseTooltip();
|
|
71
59
|
}
|
|
@@ -74,16 +62,17 @@ var EbayInfotip = function (_a) {
|
|
|
74
62
|
}
|
|
75
63
|
};
|
|
76
64
|
if (!content) {
|
|
77
|
-
throw new Error(
|
|
65
|
+
throw new Error(`EbayInfotip: Please use a EbayInfotipContent that defines the content of the infotip`);
|
|
78
66
|
}
|
|
79
|
-
|
|
67
|
+
const _a = content.props, { children: contentChildren } = _a, contentProps = __rest(_a, ["children"]);
|
|
80
68
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
81
69
|
react_1.default.createElement(tooltip_utils_1.Tooltip, { type: "infotip", isExpanded: isExpanded, className: (0, classnames_1.default)(className, { 'dialog--mini': isModal }), ref: containerRef },
|
|
82
|
-
react_1.default.createElement(tooltip_utils_1.TooltipHost, null, (0, react_1.cloneElement)(button,
|
|
83
|
-
|
|
70
|
+
react_1.default.createElement(tooltip_utils_1.TooltipHost, null, (0, react_1.cloneElement)(button, Object.assign({ ref: buttonRef, onClick: toggleTooltip, disabled,
|
|
71
|
+
variant, 'aria-label': ariaLabel, 'aria-expanded': isExpanded, icon }, button.props))),
|
|
72
|
+
!isModal && (react_1.default.createElement(tooltip_utils_1.TooltipContent, Object.assign({}, contentProps, { type: "infotip", style: overlayStyle, pointer: pointer, showCloseButton: true, a11yCloseText: a11yCloseText, onClose: collapseTooltip }),
|
|
84
73
|
heading,
|
|
85
74
|
contentChildren))),
|
|
86
|
-
isModal && (react_1.default.createElement(ebay_drawer_dialog_1.EbayDrawerDialog,
|
|
75
|
+
isModal && (react_1.default.createElement(ebay_drawer_dialog_1.EbayDrawerDialog, Object.assign({}, contentProps, { open: isExpanded, onClose: collapseTooltip, a11yCloseText: a11yCloseText, className: "dialog--mini__overlay", a11yMaximizeText: a11yMaximizeText, a11yMinimizeText: a11yMinimizeText }),
|
|
87
76
|
react_1.default.createElement(ebay_dialog_base_1.EbayDialogHeader, null, heading),
|
|
88
77
|
contentChildren))));
|
|
89
78
|
};
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -48,16 +37,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
48
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
38
|
};
|
|
50
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
(0, react_1.useEffect)(function () {
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
42
|
+
const ebay_notice_content_1 = require("../ebay-notice-base/components/ebay-notice-content");
|
|
43
|
+
const notice_content_1 = __importDefault(require("../common/notice-utils/notice-content"));
|
|
44
|
+
const component_utils_1 = require("../common/component-utils");
|
|
45
|
+
const ebay_icon_1 = require("../ebay-icon");
|
|
46
|
+
const EbayInlineNotice = (_a) => {
|
|
47
|
+
var { className, status = 'general', children, hidden = false, 'aria-label': ariaLabel, onNoticeShow = () => { } } = _a, rest = __rest(_a, ["className", "status", "children", "hidden", 'aria-label', "onNoticeShow"]);
|
|
48
|
+
(0, react_1.useEffect)(() => {
|
|
61
49
|
if (!hidden) {
|
|
62
50
|
onNoticeShow();
|
|
63
51
|
}
|
|
@@ -65,14 +53,14 @@ var EbayInlineNotice = function (_a) {
|
|
|
65
53
|
if (hidden) {
|
|
66
54
|
return null;
|
|
67
55
|
}
|
|
68
|
-
|
|
56
|
+
const content = (0, component_utils_1.findComponent)(children, ebay_notice_content_1.EbayNoticeContent);
|
|
69
57
|
if (!content) {
|
|
70
|
-
throw new Error(
|
|
58
|
+
throw new Error(`EbayInlineNotice: Please use a EbayNoticeContent that defines the content of the notice`);
|
|
71
59
|
}
|
|
72
|
-
|
|
73
|
-
return (react_1.default.createElement("div",
|
|
60
|
+
const isGeneral = status === `general`;
|
|
61
|
+
return (react_1.default.createElement("div", Object.assign({}, rest, { className: (0, classnames_1.default)(className, 'inline-notice', { [`inline-notice--${status}`]: !isGeneral }) }),
|
|
74
62
|
!isGeneral ? (react_1.default.createElement("span", { className: "inline-notice__header" },
|
|
75
|
-
react_1.default.createElement(ebay_icon_1.EbayIcon, { name:
|
|
76
|
-
react_1.default.createElement(notice_content_1.default,
|
|
63
|
+
react_1.default.createElement(ebay_icon_1.EbayIcon, { name: `${status}Filled16`, a11yText: ariaLabel, a11yVariant: "label" }))) : null,
|
|
64
|
+
react_1.default.createElement(notice_content_1.default, Object.assign({}, content.props, { type: "inline" }))));
|
|
77
65
|
};
|
|
78
66
|
exports.default = EbayInlineNotice;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
3
|
var t = {};
|
|
15
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -25,15 +14,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
15
|
};
|
|
27
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
_b)), open: open })));
|
|
17
|
+
const react_1 = __importDefault(require("react"));
|
|
18
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
19
|
+
const ebay_dialog_base_1 = require("../ebay-dialog-base");
|
|
20
|
+
const classPrefix = 'lightbox-dialog';
|
|
21
|
+
const EbayLightboxDialog = (_a) => {
|
|
22
|
+
var { open, mode, size, onClose = () => { } } = _a, rest = __rest(_a, ["open", "mode", "size", "onClose"]);
|
|
23
|
+
return (react_1.default.createElement(ebay_dialog_base_1.DialogBaseWithState, Object.assign({ buttonPosition: "right" }, rest, { classPrefix: classPrefix, onCloseBtnClick: onClose, onBackgroundClick: onClose, className: (0, classnames_1.default)(rest.className, `${classPrefix}--mask-fade`, size && `${classPrefix}--${size}`), windowClass: (0, classnames_1.default)('lightbox-dialog__window--fade', {
|
|
24
|
+
[`${classPrefix}__window--mini`]: mode === 'mini'
|
|
25
|
+
}), open: open })));
|
|
38
26
|
};
|
|
39
27
|
exports.default = EbayLightboxDialog;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
3
|
var t = {};
|
|
15
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -25,13 +14,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
15
|
};
|
|
27
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
return (react_1.default.createElement("div",
|
|
17
|
+
const react_1 = __importDefault(require("react"));
|
|
18
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
19
|
+
const ebay_icon_1 = require("../ebay-icon");
|
|
20
|
+
const ListboxOption = (_a) => {
|
|
21
|
+
var { value, children, selected, onClick, index, innerRef, className, id } = _a, rest = __rest(_a, ["value", "children", "selected", "onClick", "index", "innerRef", "className", "id"]);
|
|
22
|
+
const wrapperClassName = (0, classnames_1.default)(`listbox-button__option`, className, { 'listbox-button__option--active': selected });
|
|
23
|
+
return (react_1.default.createElement("div", Object.assign({}, rest, { className: wrapperClassName, role: "option", id: id || `listbox_btn_${value}_${index}`, "aria-selected": selected, ref: innerRef, onClick: (e) => { onClick(e, value, index); } }),
|
|
35
24
|
react_1.default.createElement("span", { className: "listbox-button__value" }, children),
|
|
36
25
|
react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "tick16" })));
|
|
37
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbox-button.d.ts","sourceRoot":"","sources":["../../src/ebay-listbox-button/listbox-button.tsx"],"names":[],"mappings":"AAAA,OAAc,EAEV,cAAc,EAAE,EAAE,EACrB,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,sBAAsB,EAAO,MAAM,6BAA6B,CAAA;AAIzE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACvB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,GAAG;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,sBAAsB,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;IACvE,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"listbox-button.d.ts","sourceRoot":"","sources":["../../src/ebay-listbox-button/listbox-button.tsx"],"names":[],"mappings":"AAAA,OAAc,EAEV,cAAc,EAAE,EAAE,EACrB,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,sBAAsB,EAAO,MAAM,6BAA6B,CAAA;AAIzE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACvB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,GAAG;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,sBAAsB,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;IACvE,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,sBAAsB,CA+R7C,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -48,67 +37,60 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
48
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
38
|
};
|
|
50
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
42
|
+
const ebay_icon_1 = require("../ebay-icon");
|
|
43
|
+
const component_utils_1 = require("../common/component-utils");
|
|
44
|
+
const listbox_button_option_1 = __importDefault(require("./listbox-button-option"));
|
|
45
|
+
const ListboxButton = (_a) => {
|
|
46
|
+
var { children, name, value, selected, borderless, fluid, className, maxHeight, prefixId, prefixLabel, floatingLabel, unselectedText = '-', onChange = () => { }, onCollapse = () => { }, onExpand = () => { } } = _a, rest = __rest(_a, ["children", "name", "value", "selected", "borderless", "fluid", "className", "maxHeight", "prefixId", "prefixLabel", "floatingLabel", "unselectedText", "onChange", "onCollapse", "onExpand"]);
|
|
47
|
+
const optionsContainerRef = (0, react_1.useRef)(null);
|
|
48
|
+
const optionsParentContainerRef = (0, react_1.useRef)();
|
|
49
|
+
const optionsByIndexRef = (0, react_1.useRef)(new Map());
|
|
50
|
+
const buttonRef = (0, react_1.useRef)();
|
|
51
|
+
const listBoxButtonOptions = (0, component_utils_1.filterByType)(children, listbox_button_option_1.default);
|
|
63
52
|
if (!listBoxButtonOptions.length) {
|
|
64
|
-
throw new Error(
|
|
53
|
+
throw new Error(`EbayListboxButton: Please use a
|
|
54
|
+
EbayListboxButtonOption that defines the options of the listbox`);
|
|
65
55
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return value !== undefined && props.value === value;
|
|
70
|
-
});
|
|
71
|
-
var index = selectedIndex > -1 || floatingLabel ? selectedIndex : undefined;
|
|
56
|
+
const getInitialSelectedOption = () => {
|
|
57
|
+
const selectedIndex = selected !== undefined ? selected : listBoxButtonOptions.findIndex(({ props }) => value !== undefined && props.value === value);
|
|
58
|
+
const index = selectedIndex > -1 || floatingLabel ? selectedIndex : undefined;
|
|
72
59
|
return {
|
|
73
60
|
option: listBoxButtonOptions[index],
|
|
74
|
-
index
|
|
61
|
+
index
|
|
75
62
|
};
|
|
76
63
|
};
|
|
77
64
|
// Get the default Selected value and set it in the state
|
|
78
|
-
|
|
65
|
+
const { option: selectedOptionFromValue, index: initialSelectedOptionIndex } = getInitialSelectedOption();
|
|
79
66
|
// Update the selected option to the state
|
|
80
|
-
|
|
81
|
-
|
|
67
|
+
const [selectedOption, setSelectedOption] = (0, react_1.useState)(selectedOptionFromValue);
|
|
68
|
+
const [selectedIndex, setSelectedIndex] = (0, react_1.useState)(initialSelectedOptionIndex);
|
|
82
69
|
// Update the expanded status to the state
|
|
83
|
-
|
|
70
|
+
const [expanded, setExpanded] = (0, react_1.useState)();
|
|
84
71
|
// Additional flag to avoid multiple re-render when users tries to open and close
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
(0, react_1.useEffect)(
|
|
72
|
+
const [optionsOpened, setOptionsOpened] = (0, react_1.useState)(false);
|
|
73
|
+
const [wasClicked, setWasClicked] = (0, react_1.useState)();
|
|
74
|
+
(0, react_1.useEffect)(() => {
|
|
88
75
|
setSelectedOption(selectedOptionFromValue);
|
|
89
76
|
}, [value]);
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
var setActiveDescendant = function (index) {
|
|
100
|
-
var optionsContainerEle = optionsContainerRef.current;
|
|
101
|
-
optionsContainerEle === null || optionsContainerEle === void 0 ? void 0 : optionsContainerEle.setAttribute("aria-activedescendant", getSelectedOption(index).id);
|
|
102
|
-
};
|
|
103
|
-
var collapseListbox = function () {
|
|
77
|
+
const childrenArray = react_1.Children.toArray(children);
|
|
78
|
+
const getSelectedValueByIndex = (index) => childrenArray[index].props.value;
|
|
79
|
+
const getIndexByValue = (0, react_1.useCallback)((selectedValue) => childrenArray.findIndex(({ props }) => props.value === selectedValue), [childrenArray]);
|
|
80
|
+
const getSelectedOption = (currentIndex) => optionsByIndexRef.current.get(currentIndex);
|
|
81
|
+
const setActiveDescendant = (index) => {
|
|
82
|
+
const optionsContainerEle = optionsContainerRef.current;
|
|
83
|
+
optionsContainerEle === null || optionsContainerEle === void 0 ? void 0 : optionsContainerEle.setAttribute(`aria-activedescendant`, getSelectedOption(index).id);
|
|
84
|
+
};
|
|
85
|
+
const collapseListbox = () => {
|
|
104
86
|
setExpanded(false);
|
|
105
87
|
onCollapse();
|
|
106
88
|
};
|
|
107
|
-
|
|
89
|
+
const expandListbox = () => {
|
|
108
90
|
setExpanded(true);
|
|
109
91
|
onExpand();
|
|
110
92
|
};
|
|
111
|
-
|
|
93
|
+
const toggleListbox = () => {
|
|
112
94
|
if (expanded) {
|
|
113
95
|
collapseListbox();
|
|
114
96
|
}
|
|
@@ -116,38 +98,38 @@ var ListboxButton = function (_a) {
|
|
|
116
98
|
expandListbox();
|
|
117
99
|
}
|
|
118
100
|
};
|
|
119
|
-
|
|
101
|
+
const onOptionsSelect = (e, index) => {
|
|
120
102
|
// OnSelect set the selectedValue to the state and expanded to false to close the list box
|
|
121
103
|
setSelectedOption(childrenArray[index]);
|
|
122
104
|
setSelectedIndex(index);
|
|
123
105
|
collapseListbox();
|
|
124
106
|
setActiveDescendant(index);
|
|
125
107
|
buttonRef.current.focus();
|
|
126
|
-
onChange(e, { index
|
|
108
|
+
onChange(e, { index, selected: [getSelectedValueByIndex(index)], wasClicked });
|
|
127
109
|
setWasClicked(false);
|
|
128
110
|
};
|
|
129
|
-
|
|
111
|
+
const reset = () => {
|
|
130
112
|
collapseListbox();
|
|
131
113
|
setSelectedOption(childrenArray[initialSelectedOptionIndex]);
|
|
132
114
|
};
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
optionEle.setAttribute(
|
|
136
|
-
optionEle.classList.add(
|
|
115
|
+
const makeOptionActive = (index) => {
|
|
116
|
+
const optionEle = optionsContainerRef.current.children[index];
|
|
117
|
+
optionEle.setAttribute(`aria-selected`, 'true');
|
|
118
|
+
optionEle.classList.add(`listbox-button__option--active`);
|
|
137
119
|
};
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
optionEle.setAttribute(
|
|
141
|
-
optionEle.classList.remove(
|
|
120
|
+
const makeOptionInActive = (index) => {
|
|
121
|
+
const optionEle = optionsContainerRef.current.children[index];
|
|
122
|
+
optionEle.setAttribute(`aria-selected`, 'false');
|
|
123
|
+
optionEle.classList.remove(`listbox-button__option--active`);
|
|
142
124
|
};
|
|
143
125
|
// Followed the implementation from W3
|
|
144
126
|
// https://www.w3.org/TR/wai-aria-practices/examples/listbox/listbox-collapsible.html
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
127
|
+
const scrollOptions = (index) => {
|
|
128
|
+
const listboxOptionsContainerNode = optionsParentContainerRef.current;
|
|
129
|
+
const currentTarget = getSelectedOption(index);
|
|
148
130
|
if (listboxOptionsContainerNode.scrollHeight > listboxOptionsContainerNode.clientHeight) {
|
|
149
|
-
|
|
150
|
-
|
|
131
|
+
const scrollBottom = listboxOptionsContainerNode.clientHeight + listboxOptionsContainerNode.scrollTop;
|
|
132
|
+
const elementBottom = currentTarget.offsetTop + currentTarget.offsetHeight;
|
|
151
133
|
if (elementBottom > scrollBottom) {
|
|
152
134
|
listboxOptionsContainerNode.scrollTop = elementBottom - listboxOptionsContainerNode.clientHeight;
|
|
153
135
|
}
|
|
@@ -156,7 +138,7 @@ var ListboxButton = function (_a) {
|
|
|
156
138
|
}
|
|
157
139
|
}
|
|
158
140
|
};
|
|
159
|
-
|
|
141
|
+
const makeSelections = (updatedIndex) => {
|
|
160
142
|
makeOptionActive(selectedIndex === undefined || updatedIndex === -1 ? 0 : updatedIndex);
|
|
161
143
|
makeOptionInActive(selectedIndex === undefined || selectedIndex === -1 ? 0 : selectedIndex);
|
|
162
144
|
scrollOptions(updatedIndex);
|
|
@@ -164,15 +146,13 @@ var ListboxButton = function (_a) {
|
|
|
164
146
|
setSelectedIndex(updatedIndex);
|
|
165
147
|
setSelectedOption(childrenArray[updatedIndex]);
|
|
166
148
|
};
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
};
|
|
170
|
-
var onButtonClick = function () {
|
|
149
|
+
const focusOptionsContainer = (focusOptions) => setTimeout(() => { var _a; return (_a = optionsContainerRef === null || optionsContainerRef === void 0 ? void 0 : optionsContainerRef.current) === null || _a === void 0 ? void 0 : _a.focus(focusOptions); }, 0);
|
|
150
|
+
const onButtonClick = () => {
|
|
171
151
|
toggleListbox();
|
|
172
152
|
setOptionsOpened(true);
|
|
173
153
|
focusOptionsContainer({ preventScroll: true });
|
|
174
154
|
};
|
|
175
|
-
|
|
155
|
+
const onButtonKeyup = (e) => {
|
|
176
156
|
switch (e.key) {
|
|
177
157
|
case 'Escape':
|
|
178
158
|
collapseListbox();
|
|
@@ -184,7 +164,7 @@ var ListboxButton = function (_a) {
|
|
|
184
164
|
break;
|
|
185
165
|
}
|
|
186
166
|
};
|
|
187
|
-
|
|
167
|
+
const onOptionContainerKeydown = (e) => {
|
|
188
168
|
switch (e.key) {
|
|
189
169
|
case ' ':
|
|
190
170
|
case 'PageUp':
|
|
@@ -209,12 +189,12 @@ var ListboxButton = function (_a) {
|
|
|
209
189
|
break;
|
|
210
190
|
case 'Enter':
|
|
211
191
|
collapseListbox();
|
|
212
|
-
setTimeout(
|
|
213
|
-
setTimeout(
|
|
192
|
+
setTimeout(() => setSelectedOption(childrenArray[selectedIndex]));
|
|
193
|
+
setTimeout(() => buttonRef.current.focus(), 0);
|
|
214
194
|
onChange(e, {
|
|
215
195
|
index: selectedIndex,
|
|
216
196
|
selected: [getSelectedValueByIndex(selectedIndex)],
|
|
217
|
-
wasClicked
|
|
197
|
+
wasClicked
|
|
218
198
|
});
|
|
219
199
|
break;
|
|
220
200
|
case 'Esc':
|
|
@@ -227,47 +207,46 @@ var ListboxButton = function (_a) {
|
|
|
227
207
|
};
|
|
228
208
|
// We want to mimic the select box behavior, so we take the onSelect that passed
|
|
229
209
|
// at the parent level and use it for the OnClick on the list box since it is a fake dropdown
|
|
230
|
-
|
|
231
|
-
.map(
|
|
232
|
-
index
|
|
210
|
+
const updateListBoxButtonOptions = listBoxButtonOptions
|
|
211
|
+
.map((child, index) => (0, react_1.cloneElement)(child, {
|
|
212
|
+
index,
|
|
233
213
|
key: index,
|
|
234
214
|
selected: selectedOption && child.props.value === selectedOption.props.value,
|
|
235
|
-
onClick:
|
|
236
|
-
innerRef:
|
|
215
|
+
onClick: (e) => onOptionsSelect(e, index),
|
|
216
|
+
innerRef: optionNode => !optionNode
|
|
237
217
|
? optionsByIndexRef.current.delete(index)
|
|
238
|
-
: optionsByIndexRef.current.set(index, optionNode)
|
|
239
|
-
})
|
|
240
|
-
|
|
241
|
-
|
|
218
|
+
: optionsByIndexRef.current.set(index, optionNode)
|
|
219
|
+
}));
|
|
220
|
+
const wrapperClassName = (0, classnames_1.default)('listbox-button', className, { 'listbox-button--fluid': fluid });
|
|
221
|
+
const buttonClassName = (0, classnames_1.default)('btn', {
|
|
222
|
+
'btn--form': !borderless,
|
|
242
223
|
'btn--borderless': borderless,
|
|
243
224
|
'btn--floating-label': floatingLabel && selectedOption
|
|
244
225
|
});
|
|
245
|
-
|
|
246
|
-
|
|
226
|
+
const expandBtnTextId = prefixId && 'expand-btn-text';
|
|
227
|
+
const buttonLabel = (react_1.default.createElement(react_1.default.Fragment, null,
|
|
247
228
|
floatingLabel && react_1.default.createElement("span", { className: "btn__floating-label" }, floatingLabel),
|
|
248
229
|
prefixLabel && react_1.default.createElement("span", { className: "btn__label" }, prefixLabel),
|
|
249
230
|
react_1.default.createElement("span", { className: "btn__text", id: expandBtnTextId }, (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.props.children) || unselectedText)));
|
|
250
231
|
return (react_1.default.createElement("span", { className: wrapperClassName },
|
|
251
|
-
react_1.default.createElement("button",
|
|
232
|
+
react_1.default.createElement("button", Object.assign({}, rest, { type: "button", className: buttonClassName, "aria-expanded": !!expanded, "aria-haspopup": "listbox", "aria-labelledby": prefixId && `${prefixId} ${expandBtnTextId}`, onClick: onButtonClick,
|
|
252
233
|
// https://stackoverflow.com/questions/17769005/onclick-and-onblur-ordering-issue
|
|
253
|
-
onMouseDown:
|
|
234
|
+
onMouseDown: (e) => e.preventDefault(), onKeyUp: onButtonKeyup, ref: buttonRef }),
|
|
254
235
|
react_1.default.createElement("span", { className: "btn__cell" },
|
|
255
236
|
buttonLabel,
|
|
256
237
|
react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "chevronDown12" }))),
|
|
257
238
|
(expanded || optionsOpened) &&
|
|
258
239
|
react_1.default.createElement("div", { className: "listbox-button__listbox", ref: optionsParentContainerRef, style: { maxHeight: maxHeight } },
|
|
259
|
-
react_1.default.createElement("div", { className: "listbox-button__options", role: "listbox", tabIndex: expanded ? 0 : -1, ref: optionsContainerRef, onKeyDown:
|
|
240
|
+
react_1.default.createElement("div", { className: "listbox-button__options", role: "listbox", tabIndex: expanded ? 0 : -1, ref: optionsContainerRef, onKeyDown: (e) => onOptionContainerKeydown(e),
|
|
260
241
|
// adding onMouseDown preventDefault b/c on IE the onClick event is not being fired on each
|
|
261
242
|
// option https://stackoverflow.com/questions/17769005/onclick-and-onblur-ordering-issue
|
|
262
|
-
onMouseDown:
|
|
243
|
+
onMouseDown: (e) => {
|
|
263
244
|
e.preventDefault();
|
|
264
245
|
setWasClicked(true);
|
|
265
|
-
}, onBlur:
|
|
246
|
+
}, onBlur: () => {
|
|
266
247
|
collapseListbox();
|
|
267
|
-
setTimeout(
|
|
248
|
+
setTimeout(() => buttonRef.current.focus(), 0);
|
|
268
249
|
} }, updateListBoxButtonOptions)),
|
|
269
|
-
react_1.default.createElement("select", { hidden: true, className: "listbox-button__native", name: name, onChange:
|
|
270
|
-
return react_1.default.createElement("option", { value: option.props.value, key: i });
|
|
271
|
-
}))));
|
|
250
|
+
react_1.default.createElement("select", { hidden: true, className: "listbox-button__native", name: name, onChange: (e) => onOptionsSelect(e, getIndexByValue(e.target.value)), value: selectedOption ? selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.props.value : '' }, updateListBoxButtonOptions.map((option, i) => react_1.default.createElement("option", { value: option.props.value, key: i })))));
|
|
272
251
|
};
|
|
273
252
|
exports.default = ListboxButton;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
3
|
var t = {};
|
|
15
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -25,10 +14,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
15
|
};
|
|
27
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var className = _a
|
|
32
|
-
return (react_1.default.createElement("hr",
|
|
17
|
+
const react_1 = __importDefault(require("react"));
|
|
18
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
19
|
+
const EbayMenuItemSeparator = (_a) => {
|
|
20
|
+
var { className } = _a, rest = __rest(_a, ["className"]);
|
|
21
|
+
return (react_1.default.createElement("hr", Object.assign({}, rest, { className: (0, classnames_1.default)(className, 'menu__separator'), role: "separator" })));
|
|
33
22
|
};
|
|
34
23
|
exports.default = EbayMenuItemSeparator;
|