@ebay/ui-core-react 6.2.2-rc.1 → 6.2.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.
Potentially problematic release.
This version of @ebay/ui-core-react might be problematic. Click here for more details.
- package/common/component-utils/array.polyfill.flat.js +13 -11
- package/common/component-utils/forwardRef.js +17 -4
- package/common/component-utils/usePrevious.js +3 -3
- package/common/component-utils/utils.js +26 -13
- package/common/debounce.js +7 -3
- package/common/event-utils/index.js +11 -8
- package/common/event-utils/use-key-press.js +12 -10
- package/common/event-utils/use-roving-index.js +24 -13
- package/common/floating-label-utils/hooks.js +53 -43
- package/common/notice-utils/notice-content.js +6 -5
- package/common/notice-utils/notice-cta.js +16 -5
- package/common/notice-utils/notice-footer.js +16 -5
- package/common/notice-utils/notice-title.js +17 -6
- package/common/random-id.js +1 -1
- package/common/range.js +4 -1
- package/common/tooltip-utils/tooltip-close-button.js +1 -1
- package/common/tooltip-utils/tooltip-content.js +28 -16
- package/common/tooltip-utils/tooltip-footer.js +6 -3
- package/common/tooltip-utils/tooltip-host.js +16 -5
- package/common/tooltip-utils/tooltip.d.ts +1 -1
- package/common/tooltip-utils/tooltip.js +26 -14
- package/common/tooltip-utils/use-tooltip.js +9 -8
- package/ebay-alert-dialog/alert-dialog.js +22 -11
- package/ebay-badge/badge.js +17 -6
- package/ebay-breadcrumbs/breadcrumb-item.js +18 -7
- package/ebay-breadcrumbs/breadcrumbs.js +30 -19
- package/ebay-button/button-cell.js +16 -5
- package/ebay-button/button-expand.d.ts +2 -4
- package/ebay-button/button-expand.d.ts.map +1 -1
- package/ebay-button/button-expand.js +10 -7
- package/ebay-button/button-loading.js +5 -5
- package/ebay-button/button-text.js +6 -3
- package/ebay-button/button.d.ts +1 -1
- package/ebay-button/button.js +43 -31
- package/ebay-calendar/calendar.js +111 -94
- package/ebay-calendar/date-utils.js +18 -9
- package/ebay-carousel/carousel-control-button.js +10 -9
- package/ebay-carousel/carousel-item.d.ts +1 -1
- package/ebay-carousel/carousel-item.js +25 -14
- package/ebay-carousel/carousel-list.js +22 -21
- package/ebay-carousel/carousel.js +44 -32
- package/ebay-carousel/helpers.js +47 -35
- package/ebay-carousel/scroll-to-transition.js +15 -15
- package/ebay-checkbox/checkbox.js +32 -21
- package/ebay-confirm-dialog/confirm-dialog.js +22 -11
- package/ebay-cta-button/cta-button.d.ts +1 -1
- package/ebay-cta-button/cta-button.js +20 -9
- package/ebay-date-textbox/date-textbox.js +53 -37
- package/ebay-dialog-base/components/animation.d.ts +1 -0
- package/ebay-dialog-base/components/animation.d.ts.map +1 -1
- package/ebay-dialog-base/components/animation.js +28 -25
- package/ebay-dialog-base/components/dialog-actions.js +5 -2
- package/ebay-dialog-base/components/dialog-close-button.d.ts +2 -5
- package/ebay-dialog-base/components/dialog-close-button.d.ts.map +1 -1
- package/ebay-dialog-base/components/dialog-close-button.js +5 -2
- package/ebay-dialog-base/components/dialog-footer.js +5 -2
- package/ebay-dialog-base/components/dialog-header.js +15 -4
- package/ebay-dialog-base/components/dialog-previous-button.js +17 -6
- package/ebay-dialog-base/components/dialogBase.js +51 -40
- package/ebay-dialog-base/dialog-base-with-state.js +35 -22
- package/ebay-drawer-dialog/components/drawer.js +50 -27
- package/ebay-eek/eek-rating.js +10 -8
- 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 +6 -7
- package/ebay-fake-menu/menu-item-separator.js +16 -5
- package/ebay-fake-menu/menu-item.js +26 -15
- package/ebay-fake-menu/menu.js +22 -11
- package/ebay-fake-menu-button/menu-button-item.js +2 -2
- package/ebay-fake-menu-button/menu-button-label.d.ts +2 -4
- package/ebay-fake-menu-button/menu-button-label.d.ts.map +1 -1
- package/ebay-fake-menu-button/menu-button-label.js +5 -2
- package/ebay-fake-menu-button/menu-button-separator.js +16 -5
- package/ebay-fake-menu-button/menu-button.js +45 -32
- package/ebay-fake-tabs/fake-tabs.js +23 -10
- package/ebay-fake-tabs/tab.js +16 -5
- package/ebay-field/description.js +19 -7
- package/ebay-field/field.js +5 -4
- package/ebay-field/label.js +18 -7
- package/ebay-fullscreen-dialog/fullscreen-dialog.js +18 -7
- package/ebay-icon/icon.d.ts +1 -1
- package/ebay-icon/icon.js +29 -17
- package/ebay-icon-button/icon-button.d.ts +1 -1
- package/ebay-icon-button/icon-button.js +27 -15
- package/ebay-infotip/ebay-infotip-content.js +5 -2
- package/ebay-infotip/ebay-infotip-heading.js +16 -5
- 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 +24 -10
- package/ebay-infotip/ebay-infotip.d.ts.map +1 -1
- package/ebay-infotip/ebay-infotip.js +34 -23
- package/ebay-inline-notice/inline-notice.js +27 -15
- package/ebay-lightbox-dialog/lightbox-dialog.js +21 -9
- package/ebay-listbox-button/listbox-button-option.js +18 -7
- package/ebay-listbox-button/listbox-button.d.ts.map +1 -1
- package/ebay-listbox-button/listbox-button.js +100 -79
- package/ebay-menu/menu-item-separator.js +16 -5
- package/ebay-menu/menu-item.js +23 -12
- package/ebay-menu/menu.d.ts +1 -1
- package/ebay-menu/menu.js +64 -37
- 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 +2 -4
- package/ebay-menu-button/menu-button-label.d.ts.map +1 -1
- package/ebay-menu-button/menu-button-label.js +5 -2
- package/ebay-menu-button/menu-button-separator.js +16 -5
- package/ebay-menu-button/menu-button.js +60 -46
- 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 +2 -5
- 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 +5 -2
- package/ebay-page-notice/page-notice-cta.js +6 -3
- package/ebay-page-notice/page-notice-footer.js +6 -3
- package/ebay-page-notice/page-notice-title.js +16 -5
- package/ebay-page-notice/page-notice.js +27 -16
- package/ebay-pagination/helpers.js +24 -21
- package/ebay-pagination/pagination-item.d.ts +1 -1
- package/ebay-pagination/pagination-item.js +27 -16
- package/ebay-pagination/pagination.js +81 -52
- package/ebay-panel-dialog/panel-dialog.js +21 -9
- package/ebay-progress-bar/progress-bar.js +16 -5
- package/ebay-progress-spinner/progress-spinner.js +18 -7
- package/ebay-progress-stepper/ebay-progress-step.js +25 -14
- package/ebay-progress-stepper/ebay-progress-stepper.js +21 -10
- package/ebay-progress-stepper/ebay-progress-title.js +5 -2
- package/ebay-radio/radio.js +29 -18
- package/ebay-section-notice/section-notice-footer.js +6 -3
- package/ebay-section-notice/section-notice-title.js +16 -5
- package/ebay-section-notice/section-notice.js +39 -24
- package/ebay-section-title/cta.js +16 -5
- package/ebay-section-title/info.js +16 -5
- package/ebay-section-title/overflow.js +16 -5
- package/ebay-section-title/section-title.js +24 -13
- package/ebay-section-title/subtitle.js +16 -5
- package/ebay-section-title/title.js +16 -5
- package/ebay-select/ebay-select-option.js +15 -4
- package/ebay-select/ebay-select.d.ts +1 -1
- package/ebay-select/ebay-select.js +45 -34
- package/ebay-signal/signal.js +17 -6
- package/ebay-snackbar-dialog/components/ebay-snackbar-dialog-action.js +16 -5
- package/ebay-snackbar-dialog/components/ebay-snackbar-dialog.js +38 -27
- package/ebay-split-button/split-button.js +21 -10
- package/ebay-star-rating/star-rating.js +19 -8
- package/ebay-star-rating-select/star-rating-select.js +31 -20
- package/ebay-svg/svg.js +3 -3
- package/ebay-switch/ebay-switch.js +21 -10
- package/ebay-tabs/tab-panel.js +16 -5
- package/ebay-tabs/tab.js +16 -5
- package/ebay-tabs/tabs.js +40 -26
- package/ebay-textbox/postfix-icon.js +18 -7
- package/ebay-textbox/prefix-icon.js +16 -5
- package/ebay-textbox/textbox.d.ts +1 -1
- package/ebay-textbox/textbox.js +53 -42
- package/ebay-toast-dialog/components/toast.js +17 -6
- package/ebay-tooltip/ebay-tooltip-content.js +1 -1
- package/ebay-tooltip/ebay-tooltip-host.js +1 -1
- package/ebay-tooltip/ebay-tooltip.js +32 -21
- package/ebay-tourtip/ebay-tourtip-content.js +1 -1
- package/ebay-tourtip/ebay-tourtip-footer.js +7 -4
- package/ebay-tourtip/ebay-tourtip-heading.js +17 -6
- package/ebay-tourtip/ebay-tourtip-host.js +1 -1
- package/ebay-tourtip/ebay-tourtip.js +33 -22
- package/ebay-video/controls.d.ts.map +1 -1
- package/ebay-video/controls.js +46 -23
- package/ebay-video/reportButton.d.ts +2 -7
- package/ebay-video/reportButton.d.ts.map +1 -1
- package/ebay-video/reportButton.js +8 -5
- package/ebay-video/source.js +14 -3
- package/ebay-video/video.d.ts.map +1 -1
- package/ebay-video/video.js +80 -54
- package/package.json +19 -23
|
@@ -1,4 +1,15 @@
|
|
|
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
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -37,27 +48,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
49
|
};
|
|
39
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
var react_1 = __importStar(require("react"));
|
|
52
|
+
var notice_content_1 = __importDefault(require("../common/notice-utils/notice-content"));
|
|
53
|
+
var ebay_notice_content_1 = require("../ebay-notice-base/components/ebay-notice-content");
|
|
54
|
+
var ebay_icon_1 = require("../ebay-icon");
|
|
55
|
+
var index_1 = require("./index");
|
|
56
|
+
var EbayPageNotice = function (_a) {
|
|
57
|
+
var id = _a.id, _b = _a.status, status = _b === void 0 ? 'general' : _b, children = _a.children, a11yDismissText = _a.a11yDismissText, ariaLabel = _a["aria-label"], _c = _a.onDismiss, onDismiss = _c === void 0 ? function () { } : _c, rest = __rest(_a, ["id", "status", "children", "a11yDismissText", 'aria-label', "onDismiss"]);
|
|
58
|
+
var _d = (0, react_1.useState)(false), dismissed = _d[0], setDismissed = _d[1];
|
|
59
|
+
var childrenArray = react_1.default.Children.toArray(children);
|
|
60
|
+
var content = childrenArray.find(function (child) { return child.type === ebay_notice_content_1.EbayNoticeContent; });
|
|
50
61
|
if (!content) {
|
|
51
|
-
throw new Error(
|
|
62
|
+
throw new Error("EbayPageNotice: Please use a EbayNoticeContent that defines the content of the notice");
|
|
52
63
|
}
|
|
53
|
-
|
|
64
|
+
var handleDismissed = function (event) {
|
|
54
65
|
setDismissed(true);
|
|
55
66
|
onDismiss(event);
|
|
56
67
|
};
|
|
57
|
-
return dismissed ? null : (react_1.default.createElement("section",
|
|
58
|
-
status !==
|
|
59
|
-
react_1.default.createElement(ebay_icon_1.EbayIcon, { name:
|
|
60
|
-
react_1.default.createElement(notice_content_1.default,
|
|
68
|
+
return dismissed ? null : (react_1.default.createElement("section", __assign({}, rest, { "aria-labelledby": id || "".concat(status, "-status"), className: "page-notice ".concat(status !== "general" ? "page-notice--".concat(status) : ""), role: "region" }),
|
|
69
|
+
status !== "general" ? (react_1.default.createElement("div", { className: "page-notice__header", id: id || "".concat(status, "-status") },
|
|
70
|
+
react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "".concat(status, "Filled16"), a11yText: ariaLabel, a11yVariant: "label" }))) : null,
|
|
71
|
+
react_1.default.createElement(notice_content_1.default, __assign({}, content.props, { type: "page" })),
|
|
61
72
|
children,
|
|
62
73
|
a11yDismissText && (react_1.default.createElement(index_1.EbayPageNoticeFooter, null,
|
|
63
74
|
react_1.default.createElement("button", { "aria-label": a11yDismissText, className: "fake-link page-notice__dismiss", onClick: handleDismissed },
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getMaxWidth = exports.calcPageState = exports.pageNumbersAround = void 0;
|
|
4
|
-
|
|
5
|
-
function pageNumbersAround(totalPages, selectedPage, maxVisiblePages
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
var const_1 = require("./const");
|
|
5
|
+
function pageNumbersAround(totalPages, selectedPage, maxVisiblePages, variant) {
|
|
6
|
+
if (maxVisiblePages === void 0) { maxVisiblePages = totalPages; }
|
|
7
|
+
if (variant === void 0) { variant = null; }
|
|
8
|
+
var withDots = variant === 'show-last' || (variant === 'overflow' && totalPages > const_1.MAX_PAGES);
|
|
9
|
+
var hasLeadingDots = variant === 'overflow' && totalPages > const_1.MAX_PAGES;
|
|
10
|
+
var visibleItems = Math.min(maxVisiblePages, totalPages);
|
|
11
|
+
var startIndexWithoutDots = Math.max(0, selectedPage - Math.ceil((visibleItems - 1) / 2));
|
|
12
|
+
var startIndexWithDots = visibleItems < const_1.MIN_VISIBLE_ITEMS ? selectedPage :
|
|
11
13
|
Math.max(0, selectedPage - Math.floor((visibleItems - 1) / 2));
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
var endIndex = (withDots ? startIndexWithDots : startIndexWithoutDots) + visibleItems;
|
|
15
|
+
var closeToEnd = endIndex >= totalPages;
|
|
16
|
+
var closeToFront = selectedPage <= const_1.MIN_VISIBLE_ITEMS;
|
|
17
|
+
var visibleRangeWithDots = function (start, end) {
|
|
18
|
+
var items = visibleRange(totalPages, start, end);
|
|
17
19
|
if (visibleItems > 2) {
|
|
18
20
|
items[end - 2] = 'dots';
|
|
19
21
|
items[end - 1] = 'hidden';
|
|
@@ -25,20 +27,20 @@ function pageNumbersAround(totalPages, selectedPage, maxVisiblePages = totalPage
|
|
|
25
27
|
return items;
|
|
26
28
|
};
|
|
27
29
|
// middle show item[1] (...) and item[item.length - 1] (...)
|
|
28
|
-
|
|
30
|
+
var visibleRangeWithOverflowDots = function (start, end) {
|
|
29
31
|
// Following Dot
|
|
30
32
|
if (closeToFront) {
|
|
31
33
|
return visibleRangeWithDots(0, end);
|
|
32
34
|
// Leading Dot
|
|
33
35
|
}
|
|
34
36
|
else if (closeToEnd) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return
|
|
37
|
+
var items_1 = visibleRange(totalPages, totalPages - const_1.TRAILING_SPACE_WITH_DOT, totalPages);
|
|
38
|
+
items_1[0] = 'visible';
|
|
39
|
+
items_1[1] = 'dots';
|
|
40
|
+
return items_1;
|
|
39
41
|
}
|
|
40
42
|
// Middle case with Leading & Following Dots
|
|
41
|
-
|
|
43
|
+
var items = visibleRange(totalPages, selectedPage - const_1.LEADING_SPACE_WITH_DOT, selectedPage + const_1.LEADING_SPACE_WITH_DOT + 1);
|
|
42
44
|
items[0] = 'visible';
|
|
43
45
|
items[1] = closeToFront ? 'visible' : 'dots';
|
|
44
46
|
items[totalPages - 2] = 'dots';
|
|
@@ -56,11 +58,12 @@ function pageNumbersAround(totalPages, selectedPage, maxVisiblePages = totalPage
|
|
|
56
58
|
return visibleRange(totalPages, startIndexWithoutDots, endIndex);
|
|
57
59
|
}
|
|
58
60
|
exports.pageNumbersAround = pageNumbersAround;
|
|
59
|
-
function calcPageState(selectedPage, visiblePages, totalPages, variant
|
|
61
|
+
function calcPageState(selectedPage, visiblePages, totalPages, variant) {
|
|
62
|
+
if (variant === void 0) { variant = 'show-range'; }
|
|
60
63
|
if (selectedPage === -1) {
|
|
61
64
|
return [];
|
|
62
65
|
}
|
|
63
|
-
|
|
66
|
+
var adjustedNumPages = variant === 'overflow' ? const_1.MAX_PAGES :
|
|
64
67
|
clamp(Math.min(totalPages, visiblePages), const_1.MIN_PAGES, const_1.MAX_PAGES);
|
|
65
68
|
return pageNumbersAround(totalPages, selectedPage - 1, adjustedNumPages, variant);
|
|
66
69
|
}
|
|
@@ -85,7 +88,7 @@ function getMaxWidth(el) {
|
|
|
85
88
|
return 0;
|
|
86
89
|
}
|
|
87
90
|
el.style.width = '100vw';
|
|
88
|
-
|
|
91
|
+
var result = el.offsetWidth;
|
|
89
92
|
el.style.width = null;
|
|
90
93
|
return result;
|
|
91
94
|
}
|
|
@@ -22,6 +22,6 @@ export type PaginationItemProps = HtmlProps & {
|
|
|
22
22
|
forwardedRef?: RefObject<HTMLAnchorElement & HTMLButtonElement>;
|
|
23
23
|
children?: ReactNode;
|
|
24
24
|
};
|
|
25
|
-
declare const _default: React.ForwardRefExoticComponent<
|
|
25
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<PaginationItemProps, "form" | "slot" | "style" | "title" | "forwardedRef" | "type" | "key" | "value" | "className" | "disabled" | "placeholder" | "children" | "name" | "current" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "download" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "hrefLang" | "media" | "rel" | "target" | "ping" | "referrerPolicy" | "a11yPreviousText" | "a11yNextText" | "onNext" | "onPrevious" | "hide" | "pageIndex"> & React.RefAttributes<React.FC<PaginationItemProps>>>;
|
|
26
26
|
export default _default;
|
|
27
27
|
//# sourceMappingURL=pagination-item.d.ts.map
|
|
@@ -1,4 +1,15 @@
|
|
|
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
|
+
};
|
|
2
13
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
14
|
var t = {};
|
|
4
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -14,41 +25,41 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
16
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
28
|
+
var react_1 = __importDefault(require("react"));
|
|
29
|
+
var ebay_icon_1 = require("../ebay-icon");
|
|
30
|
+
var component_utils_1 = require("../common/component-utils");
|
|
31
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
32
|
+
var EbayPaginationItem = function (_a) {
|
|
33
|
+
var _b = _a.pageIndex, pageIndex = _b === void 0 ? 0 : _b, key = _a.key, current = _a.current, disabled = _a.disabled, _c = _a.type, type = _c === void 0 ? 'page' : _c, href = _a.href, hide = _a.hide, children = _a.children, _d = _a.a11yPreviousText, a11yPreviousText = _d === void 0 ? 'Previous page' : _d, _e = _a.a11yNextText, a11yNextText = _e === void 0 ? 'Next page' : _e, onSelect = _a.onSelect, onNext = _a.onNext, onPrevious = _a.onPrevious, className = _a.className, style = _a.style, forwardedRef = _a.forwardedRef, rest = __rest(_a, ["pageIndex", "key", "current", "disabled", "type", "href", "hide", "children", "a11yPreviousText", "a11yNextText", "onSelect", "onNext", "onPrevious", "className", "style", "forwardedRef"]);
|
|
34
|
+
var handlePageNumber = function (e) {
|
|
24
35
|
var _a;
|
|
25
36
|
onSelect(e, { value: ((_a = e.currentTarget) === null || _a === void 0 ? void 0 : _a.innerText) || '', index: pageIndex });
|
|
26
37
|
};
|
|
27
|
-
|
|
38
|
+
var handleNextPage = function (e) {
|
|
28
39
|
if (!e.currentTarget.getAttribute('aria-disabled')) {
|
|
29
40
|
onNext(e);
|
|
30
41
|
}
|
|
31
42
|
};
|
|
32
|
-
|
|
43
|
+
var handlePreviousPage = function (e) {
|
|
33
44
|
if (!e.currentTarget.getAttribute('aria-disabled')) {
|
|
34
45
|
onPrevious(e);
|
|
35
46
|
}
|
|
36
47
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
var isAnchor = !!href;
|
|
49
|
+
var ButtonOrAnchor = isAnchor ? 'a' : 'button';
|
|
50
|
+
var iconClassName = isAnchor ? 'icon-link' : 'icon-btn';
|
|
51
|
+
var arrowStyle = __assign(__assign({}, style), { minWidth: '40px' });
|
|
41
52
|
switch (type) {
|
|
42
53
|
case 'previous':
|
|
43
|
-
return (react_1.default.createElement(ButtonOrAnchor,
|
|
54
|
+
return (react_1.default.createElement(ButtonOrAnchor, __assign({}, rest, { ref: forwardedRef, "aria-disabled": disabled ? 'true' : undefined, "aria-label": a11yPreviousText, href: disabled ? undefined : href, className: (0, classnames_1.default)(iconClassName, 'pagination__previous'), style: arrowStyle, onClick: handlePreviousPage }),
|
|
44
55
|
react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "arrowLeft16" })));
|
|
45
56
|
case 'next':
|
|
46
|
-
return (react_1.default.createElement(ButtonOrAnchor,
|
|
57
|
+
return (react_1.default.createElement(ButtonOrAnchor, __assign({}, rest, { ref: forwardedRef, "aria-disabled": disabled ? 'true' : undefined, "aria-label": a11yNextText, href: disabled ? undefined : href, className: (0, classnames_1.default)(iconClassName, 'pagination__next'), style: arrowStyle, onClick: handleNextPage }),
|
|
47
58
|
react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "arrowRight16" })));
|
|
48
59
|
case 'separator':
|
|
49
60
|
return (react_1.default.createElement("span", { key: key, style: style, className: "pagination__item", ref: forwardedRef, role: "separator" }, children));
|
|
50
61
|
default:
|
|
51
|
-
return (react_1.default.createElement("li",
|
|
62
|
+
return (react_1.default.createElement("li", __assign({}, rest, { hidden: hide }),
|
|
52
63
|
react_1.default.createElement(ButtonOrAnchor, { ref: forwardedRef, "aria-current": current ? 'page' : undefined, href: href, className: "pagination__item", style: style, key: key, onClick: handlePageNumber }, children)));
|
|
53
64
|
}
|
|
54
65
|
};
|
|
@@ -1,4 +1,15 @@
|
|
|
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
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -33,83 +44,101 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
33
44
|
}
|
|
34
45
|
return t;
|
|
35
46
|
};
|
|
47
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
48
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
49
|
+
if (ar || !(i in from)) {
|
|
50
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
51
|
+
ar[i] = from[i];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
55
|
+
};
|
|
36
56
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
57
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
58
|
};
|
|
39
59
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
var react_1 = __importStar(require("react"));
|
|
61
|
+
var ebay_fake_menu_button_1 = require("../ebay-fake-menu-button");
|
|
62
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
63
|
+
var debounce_1 = require("../common/debounce");
|
|
64
|
+
var helpers_1 = require("./helpers");
|
|
65
|
+
var component_utils_1 = require("../common/component-utils");
|
|
66
|
+
var ebay_icon_1 = require("../ebay-icon");
|
|
67
|
+
var EbayPagination = function (_a) {
|
|
68
|
+
var _b = _a.id, id = _b === void 0 ? 'ebay-pagination' : _b, className = _a.className, _c = _a.a11yCurrentText, a11yCurrentText = _c === void 0 ? 'Pagination - Current Page' : _c, _d = _a.a11yPreviousText, a11yPreviousText = _d === void 0 ? 'Previous page' : _d, _e = _a.a11yNextText, a11yNextText = _e === void 0 ? 'Next page' : _e, _f = _a.variant, variant = _f === void 0 ? 'show-range' : _f, _g = _a.fluid, fluid = _g === void 0 ? false : _g, _h = _a.onPrevious, onPrevious = _h === void 0 ? function () { } : _h, _j = _a.onNext, onNext = _j === void 0 ? function () { } : _j, _k = _a.onSelect, onSelect = _k === void 0 ? function () { } : _k, children = _a.children, rest = __rest(_a, ["id", "className", "a11yCurrentText", "a11yPreviousText", "a11yNextText", "variant", "fluid", "onPrevious", "onNext", "onSelect", "children"]);
|
|
69
|
+
var paginationContainerRef = (0, react_1.useRef)(null);
|
|
70
|
+
var childPageRefs = (0, react_1.useRef)([]);
|
|
51
71
|
childPageRefs.current = react_1.Children.map(children, react_1.createRef);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
72
|
+
var totalPages = (0, component_utils_1.filterBy)(children, function (_a) {
|
|
73
|
+
var props = _a.props;
|
|
74
|
+
return props.type === undefined || props.type === 'page';
|
|
75
|
+
}).length;
|
|
76
|
+
var itemWidthRef = (0, react_1.useRef)(0);
|
|
77
|
+
var arrowWidthRef = (0, react_1.useRef)(0);
|
|
78
|
+
var getNumOfVisiblePageItems = function () {
|
|
56
79
|
var _a, _b, _c, _d;
|
|
57
|
-
|
|
80
|
+
var pageArrowWidth = arrowWidthRef.current || ((_b = (_a = childPageRefs.current[0]) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.offsetWidth);
|
|
58
81
|
arrowWidthRef.current = pageArrowWidth; // cache arrow width since it should be static
|
|
59
|
-
|
|
82
|
+
var pageItemWidth = itemWidthRef.current || ((_d = (_c = childPageRefs.current[1]) === null || _c === void 0 ? void 0 : _c.current) === null || _d === void 0 ? void 0 : _d.offsetWidth);
|
|
60
83
|
itemWidthRef.current = pageItemWidth; // cache item width since it should be static
|
|
61
84
|
return pageItemWidth ?
|
|
62
85
|
Math.floor(((0, helpers_1.getMaxWidth)(paginationContainerRef.current) - pageArrowWidth * 2) / pageItemWidth) :
|
|
63
86
|
0;
|
|
64
87
|
};
|
|
65
|
-
|
|
66
|
-
|
|
88
|
+
var _l = (0, react_1.useState)([]), page = _l[0], setPage = _l[1];
|
|
89
|
+
var _m = (0, react_1.useState)(0), selectedIndex = _m[0], setSelectedIndex = _m[1];
|
|
67
90
|
// selectedPageIndexFromDotMenu: override pageIndex on pagination with dot menu value
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
91
|
+
var updatePages = function (selectedPageIndexFromDotMenu) {
|
|
92
|
+
var selectedPageIndex = selectedPageIndexFromDotMenu || childPageRefs.current.findIndex(function (pageRef) { var _a; return ((_a = pageRef.current) === null || _a === void 0 ? void 0 : _a.getAttribute('aria-current')) === 'page'; });
|
|
93
|
+
var visiblePageItems = getNumOfVisiblePageItems();
|
|
94
|
+
var pageState = (0, helpers_1.calcPageState)(selectedPageIndex, visiblePageItems, totalPages, variant);
|
|
72
95
|
setSelectedIndex(selectedPageIndex);
|
|
73
|
-
setPage(['hidden',
|
|
96
|
+
setPage(__spreadArray(['hidden'], pageState, true));
|
|
74
97
|
};
|
|
75
|
-
(0, react_1.useEffect)(()
|
|
76
|
-
|
|
98
|
+
(0, react_1.useEffect)(function () {
|
|
99
|
+
var debouncedUpdate = (0, debounce_1.debounce)(updatePages, 16);
|
|
77
100
|
updatePages();
|
|
78
|
-
window.addEventListener('resize', ()
|
|
79
|
-
return ()
|
|
80
|
-
window.removeEventListener('resize', ()
|
|
101
|
+
window.addEventListener('resize', function () { return debouncedUpdate(); });
|
|
102
|
+
return function () {
|
|
103
|
+
window.removeEventListener('resize', function () { return debouncedUpdate(); });
|
|
81
104
|
};
|
|
82
105
|
}, [children]);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return react_1.Children.map(children, (item, index)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
current
|
|
106
|
+
var createChildItems = function (itemType) {
|
|
107
|
+
var pageIndex = 0;
|
|
108
|
+
var firstDotItems = [];
|
|
109
|
+
var secondDotItems = [];
|
|
110
|
+
var allDotItems = [];
|
|
111
|
+
var firstDot = page.indexOf('dots');
|
|
112
|
+
var lastDot = page.lastIndexOf('dots');
|
|
113
|
+
return react_1.Children.map(children, function (item, index) {
|
|
114
|
+
var _a = item.props, _b = _a.type, type = _b === void 0 ? 'page' : _b, current = _a.current, disabled = _a.disabled, href = _a.href, text = _a.children;
|
|
115
|
+
var isDot = page[index] === 'dots';
|
|
116
|
+
var key = "".concat(id, "-item-").concat(index);
|
|
117
|
+
var hide = page[index] === 'hidden';
|
|
118
|
+
var isSeparator = isDot && type === 'page';
|
|
119
|
+
var newProps = {
|
|
120
|
+
current: current,
|
|
121
|
+
disabled: disabled,
|
|
122
|
+
href: href,
|
|
98
123
|
type: isSeparator ? 'separator' : type,
|
|
99
124
|
children: isDot ? react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "overflowHorizontal24", focusable: false }) : text,
|
|
100
125
|
pageIndex: type === 'page' ? pageIndex++ : undefined,
|
|
101
|
-
key,
|
|
102
|
-
hide,
|
|
103
|
-
onPrevious
|
|
126
|
+
key: key,
|
|
127
|
+
hide: hide,
|
|
128
|
+
onPrevious: onPrevious,
|
|
129
|
+
onNext: onNext,
|
|
130
|
+
onSelect: onSelect,
|
|
131
|
+
a11yPreviousText: a11yPreviousText,
|
|
132
|
+
a11yNextText: a11yNextText,
|
|
104
133
|
ref: childPageRefs.current[index]
|
|
105
134
|
};
|
|
106
135
|
// include hidden numbers & number of (...)itself
|
|
107
136
|
if ((hide || isDot) && type === 'page') {
|
|
108
|
-
|
|
137
|
+
var itemComponent = (react_1.default.createElement(ebay_fake_menu_button_1.EbayFakeMenuButtonItem, { key: key, href: href, onClick: function (event) {
|
|
109
138
|
if (!href) {
|
|
110
139
|
event.preventDefault();
|
|
111
140
|
}
|
|
112
|
-
|
|
141
|
+
var currentTarget = event.currentTarget;
|
|
113
142
|
onSelect(event, { value: (currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.innerText) || '', index: pageIndex });
|
|
114
143
|
updatePages(Number(currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.innerText));
|
|
115
144
|
} }, text));
|
|
@@ -124,7 +153,7 @@ const EbayPagination = (_a) => {
|
|
|
124
153
|
}
|
|
125
154
|
}
|
|
126
155
|
if (itemType === 'page' && isDot && variant === 'overflow') {
|
|
127
|
-
|
|
156
|
+
var childComponent = allDotItems;
|
|
128
157
|
if (firstDot !== lastDot) {
|
|
129
158
|
childComponent = index === 2 ? firstDotItems : secondDotItems;
|
|
130
159
|
}
|
|
@@ -135,8 +164,8 @@ const EbayPagination = (_a) => {
|
|
|
135
164
|
return itemType === type ? (0, react_1.cloneElement)(item, newProps) : null;
|
|
136
165
|
});
|
|
137
166
|
};
|
|
138
|
-
|
|
139
|
-
return (react_1.default.createElement("nav",
|
|
167
|
+
var headingId = "".concat(id, "-pagination-heading");
|
|
168
|
+
return (react_1.default.createElement("nav", __assign({}, rest, { role: "navigation", className: (0, classnames_1.default)(className, 'pagination', { 'pagination--fluid': fluid }), "aria-labelledby": headingId, ref: paginationContainerRef }),
|
|
140
169
|
react_1.default.createElement("span", { "aria-live": "polite", role: "status" },
|
|
141
170
|
react_1.default.createElement("h2", { className: "clipped", id: headingId }, a11yCurrentText)),
|
|
142
171
|
createChildItems('previous'),
|
|
@@ -1,4 +1,15 @@
|
|
|
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
|
+
};
|
|
2
13
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
14
|
var t = {};
|
|
4
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -14,14 +25,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
16
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
var react_1 = __importDefault(require("react"));
|
|
29
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
30
|
+
var ebay_dialog_base_1 = require("../ebay-dialog-base");
|
|
31
|
+
var classPrefix = 'panel-dialog';
|
|
32
|
+
var EbayPanelDialog = function (_a) {
|
|
33
|
+
var _b, _c;
|
|
34
|
+
var open = _a.open, animated = _a.animated, _d = _a.position, position = _d === void 0 ? 'start' : _d, _e = _a.onClose, onClose = _e === void 0 ? function () { } : _e, className = _a.className, rest = __rest(_a, ["open", "animated", "position", "onClose", "className"]);
|
|
35
|
+
return (react_1.default.createElement(ebay_dialog_base_1.DialogBaseWithState, __assign({}, rest, { "aria-label": "Infotip", classPrefix: classPrefix, buttonPosition: "right", onCloseBtnClick: onClose, onBackgroundClick: onClose, animated: animated, className: (0, classnames_1.default)(className, (_b = {}, _b["".concat(classPrefix, "--mask-fade-slow")] = animated, _b)), windowClass: (0, classnames_1.default)("".concat(classPrefix, "__window--slide"), (_c = {},
|
|
36
|
+
_c["".concat(classPrefix, "__window--end")] = position === 'end',
|
|
37
|
+
_c)), open: open })));
|
|
26
38
|
};
|
|
27
39
|
exports.default = EbayPanelDialog;
|
|
@@ -1,4 +1,15 @@
|
|
|
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
|
+
};
|
|
2
13
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
14
|
var t = {};
|
|
4
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -14,10 +25,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
16
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
return (react_1.default.createElement("progress",
|
|
28
|
+
var react_1 = __importDefault(require("react"));
|
|
29
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
30
|
+
var EbayProgressBar = function (_a) {
|
|
31
|
+
var _b = _a.value, value = _b === void 0 ? 0 : _b, _c = _a.max, max = _c === void 0 ? 100 : _c, fluid = _a.fluid, className = _a.className, rest = __rest(_a, ["value", "max", "fluid", "className"]);
|
|
32
|
+
return (react_1.default.createElement("progress", __assign({}, rest, { className: (0, classnames_1.default)('progress-bar', className, { 'progress-bar--fluid': fluid }), value: value, max: max })));
|
|
22
33
|
};
|
|
23
34
|
exports.default = EbayProgressBar;
|
|
@@ -1,4 +1,15 @@
|
|
|
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
|
+
};
|
|
2
13
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
14
|
var t = {};
|
|
4
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -14,17 +25,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
16
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
var react_1 = __importDefault(require("react"));
|
|
29
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
30
|
+
var ebay_icon_1 = require("../ebay-icon");
|
|
31
|
+
var sizeClass = {
|
|
21
32
|
'default': '',
|
|
22
33
|
'small': 'progress-spinner--small',
|
|
23
34
|
'large': 'progress-spinner--large'
|
|
24
35
|
};
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
return (react_1.default.createElement("span",
|
|
36
|
+
var EbayProgressSpinner = function (_a) {
|
|
37
|
+
var _b = _a.size, size = _b === void 0 ? 'default' : _b, _c = _a["aria-label"], ariaLabel = _c === void 0 ? 'Busy' : _c, className = _a.className, rest = __rest(_a, ["size", 'aria-label', "className"]);
|
|
38
|
+
return (react_1.default.createElement("span", __assign({}, rest, { className: (0, classnames_1.default)('progress-spinner', sizeClass[size], className), "aria-label": ariaLabel, role: "img" }),
|
|
28
39
|
react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "spinner24" })));
|
|
29
40
|
};
|
|
30
41
|
exports.default = EbayProgressSpinner;
|