@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.

Files changed (171) hide show
  1. package/common/component-utils/array.polyfill.flat.js +13 -11
  2. package/common/component-utils/forwardRef.js +17 -4
  3. package/common/component-utils/usePrevious.js +3 -3
  4. package/common/component-utils/utils.js +26 -13
  5. package/common/debounce.js +7 -3
  6. package/common/event-utils/index.js +11 -8
  7. package/common/event-utils/use-key-press.js +12 -10
  8. package/common/event-utils/use-roving-index.js +24 -13
  9. package/common/floating-label-utils/hooks.js +53 -43
  10. package/common/notice-utils/notice-content.js +6 -5
  11. package/common/notice-utils/notice-cta.js +16 -5
  12. package/common/notice-utils/notice-footer.js +16 -5
  13. package/common/notice-utils/notice-title.js +17 -6
  14. package/common/random-id.js +1 -1
  15. package/common/range.js +4 -1
  16. package/common/tooltip-utils/tooltip-close-button.js +1 -1
  17. package/common/tooltip-utils/tooltip-content.js +28 -16
  18. package/common/tooltip-utils/tooltip-footer.js +6 -3
  19. package/common/tooltip-utils/tooltip-host.js +16 -5
  20. package/common/tooltip-utils/tooltip.d.ts +1 -1
  21. package/common/tooltip-utils/tooltip.js +26 -14
  22. package/common/tooltip-utils/use-tooltip.js +9 -8
  23. package/ebay-alert-dialog/alert-dialog.js +22 -11
  24. package/ebay-badge/badge.js +17 -6
  25. package/ebay-breadcrumbs/breadcrumb-item.js +18 -7
  26. package/ebay-breadcrumbs/breadcrumbs.js +30 -19
  27. package/ebay-button/button-cell.js +16 -5
  28. package/ebay-button/button-expand.d.ts +2 -4
  29. package/ebay-button/button-expand.d.ts.map +1 -1
  30. package/ebay-button/button-expand.js +10 -7
  31. package/ebay-button/button-loading.js +5 -5
  32. package/ebay-button/button-text.js +6 -3
  33. package/ebay-button/button.d.ts +1 -1
  34. package/ebay-button/button.js +43 -31
  35. package/ebay-calendar/calendar.js +111 -94
  36. package/ebay-calendar/date-utils.js +18 -9
  37. package/ebay-carousel/carousel-control-button.js +10 -9
  38. package/ebay-carousel/carousel-item.d.ts +1 -1
  39. package/ebay-carousel/carousel-item.js +25 -14
  40. package/ebay-carousel/carousel-list.js +22 -21
  41. package/ebay-carousel/carousel.js +44 -32
  42. package/ebay-carousel/helpers.js +47 -35
  43. package/ebay-carousel/scroll-to-transition.js +15 -15
  44. package/ebay-checkbox/checkbox.js +32 -21
  45. package/ebay-confirm-dialog/confirm-dialog.js +22 -11
  46. package/ebay-cta-button/cta-button.d.ts +1 -1
  47. package/ebay-cta-button/cta-button.js +20 -9
  48. package/ebay-date-textbox/date-textbox.js +53 -37
  49. package/ebay-dialog-base/components/animation.d.ts +1 -0
  50. package/ebay-dialog-base/components/animation.d.ts.map +1 -1
  51. package/ebay-dialog-base/components/animation.js +28 -25
  52. package/ebay-dialog-base/components/dialog-actions.js +5 -2
  53. package/ebay-dialog-base/components/dialog-close-button.d.ts +2 -5
  54. package/ebay-dialog-base/components/dialog-close-button.d.ts.map +1 -1
  55. package/ebay-dialog-base/components/dialog-close-button.js +5 -2
  56. package/ebay-dialog-base/components/dialog-footer.js +5 -2
  57. package/ebay-dialog-base/components/dialog-header.js +15 -4
  58. package/ebay-dialog-base/components/dialog-previous-button.js +17 -6
  59. package/ebay-dialog-base/components/dialogBase.js +51 -40
  60. package/ebay-dialog-base/dialog-base-with-state.js +35 -22
  61. package/ebay-drawer-dialog/components/drawer.js +50 -27
  62. package/ebay-eek/eek-rating.js +10 -8
  63. package/ebay-eek/eek-util.d.ts +1 -1
  64. package/ebay-eek/eek-util.d.ts.map +1 -1
  65. package/ebay-eek/eek-util.js +6 -7
  66. package/ebay-fake-menu/menu-item-separator.js +16 -5
  67. package/ebay-fake-menu/menu-item.js +26 -15
  68. package/ebay-fake-menu/menu.js +22 -11
  69. package/ebay-fake-menu-button/menu-button-item.js +2 -2
  70. package/ebay-fake-menu-button/menu-button-label.d.ts +2 -4
  71. package/ebay-fake-menu-button/menu-button-label.d.ts.map +1 -1
  72. package/ebay-fake-menu-button/menu-button-label.js +5 -2
  73. package/ebay-fake-menu-button/menu-button-separator.js +16 -5
  74. package/ebay-fake-menu-button/menu-button.js +45 -32
  75. package/ebay-fake-tabs/fake-tabs.js +23 -10
  76. package/ebay-fake-tabs/tab.js +16 -5
  77. package/ebay-field/description.js +19 -7
  78. package/ebay-field/field.js +5 -4
  79. package/ebay-field/label.js +18 -7
  80. package/ebay-fullscreen-dialog/fullscreen-dialog.js +18 -7
  81. package/ebay-icon/icon.d.ts +1 -1
  82. package/ebay-icon/icon.js +29 -17
  83. package/ebay-icon-button/icon-button.d.ts +1 -1
  84. package/ebay-icon-button/icon-button.js +27 -15
  85. package/ebay-infotip/ebay-infotip-content.js +5 -2
  86. package/ebay-infotip/ebay-infotip-heading.js +16 -5
  87. package/ebay-infotip/ebay-infotip-host.d.ts +2 -2
  88. package/ebay-infotip/ebay-infotip-host.d.ts.map +1 -1
  89. package/ebay-infotip/ebay-infotip-host.js +24 -10
  90. package/ebay-infotip/ebay-infotip.d.ts.map +1 -1
  91. package/ebay-infotip/ebay-infotip.js +34 -23
  92. package/ebay-inline-notice/inline-notice.js +27 -15
  93. package/ebay-lightbox-dialog/lightbox-dialog.js +21 -9
  94. package/ebay-listbox-button/listbox-button-option.js +18 -7
  95. package/ebay-listbox-button/listbox-button.d.ts.map +1 -1
  96. package/ebay-listbox-button/listbox-button.js +100 -79
  97. package/ebay-menu/menu-item-separator.js +16 -5
  98. package/ebay-menu/menu-item.js +23 -12
  99. package/ebay-menu/menu.d.ts +1 -1
  100. package/ebay-menu/menu.js +64 -37
  101. package/ebay-menu-button/README.md +1 -1
  102. package/ebay-menu-button/menu-button-item.js +1 -1
  103. package/ebay-menu-button/menu-button-label.d.ts +2 -4
  104. package/ebay-menu-button/menu-button-label.d.ts.map +1 -1
  105. package/ebay-menu-button/menu-button-label.js +5 -2
  106. package/ebay-menu-button/menu-button-separator.js +16 -5
  107. package/ebay-menu-button/menu-button.js +60 -46
  108. package/ebay-notice-base/components/ebay-notice-content/notice-content.js +1 -1
  109. package/ebay-notice-base/components/ebay-notice-title/notice-title.d.ts +2 -5
  110. package/ebay-notice-base/components/ebay-notice-title/notice-title.d.ts.map +1 -1
  111. package/ebay-notice-base/components/ebay-notice-title/notice-title.js +5 -2
  112. package/ebay-page-notice/page-notice-cta.js +6 -3
  113. package/ebay-page-notice/page-notice-footer.js +6 -3
  114. package/ebay-page-notice/page-notice-title.js +16 -5
  115. package/ebay-page-notice/page-notice.js +27 -16
  116. package/ebay-pagination/helpers.js +24 -21
  117. package/ebay-pagination/pagination-item.d.ts +1 -1
  118. package/ebay-pagination/pagination-item.js +27 -16
  119. package/ebay-pagination/pagination.js +81 -52
  120. package/ebay-panel-dialog/panel-dialog.js +21 -9
  121. package/ebay-progress-bar/progress-bar.js +16 -5
  122. package/ebay-progress-spinner/progress-spinner.js +18 -7
  123. package/ebay-progress-stepper/ebay-progress-step.js +25 -14
  124. package/ebay-progress-stepper/ebay-progress-stepper.js +21 -10
  125. package/ebay-progress-stepper/ebay-progress-title.js +5 -2
  126. package/ebay-radio/radio.js +29 -18
  127. package/ebay-section-notice/section-notice-footer.js +6 -3
  128. package/ebay-section-notice/section-notice-title.js +16 -5
  129. package/ebay-section-notice/section-notice.js +39 -24
  130. package/ebay-section-title/cta.js +16 -5
  131. package/ebay-section-title/info.js +16 -5
  132. package/ebay-section-title/overflow.js +16 -5
  133. package/ebay-section-title/section-title.js +24 -13
  134. package/ebay-section-title/subtitle.js +16 -5
  135. package/ebay-section-title/title.js +16 -5
  136. package/ebay-select/ebay-select-option.js +15 -4
  137. package/ebay-select/ebay-select.d.ts +1 -1
  138. package/ebay-select/ebay-select.js +45 -34
  139. package/ebay-signal/signal.js +17 -6
  140. package/ebay-snackbar-dialog/components/ebay-snackbar-dialog-action.js +16 -5
  141. package/ebay-snackbar-dialog/components/ebay-snackbar-dialog.js +38 -27
  142. package/ebay-split-button/split-button.js +21 -10
  143. package/ebay-star-rating/star-rating.js +19 -8
  144. package/ebay-star-rating-select/star-rating-select.js +31 -20
  145. package/ebay-svg/svg.js +3 -3
  146. package/ebay-switch/ebay-switch.js +21 -10
  147. package/ebay-tabs/tab-panel.js +16 -5
  148. package/ebay-tabs/tab.js +16 -5
  149. package/ebay-tabs/tabs.js +40 -26
  150. package/ebay-textbox/postfix-icon.js +18 -7
  151. package/ebay-textbox/prefix-icon.js +16 -5
  152. package/ebay-textbox/textbox.d.ts +1 -1
  153. package/ebay-textbox/textbox.js +53 -42
  154. package/ebay-toast-dialog/components/toast.js +17 -6
  155. package/ebay-tooltip/ebay-tooltip-content.js +1 -1
  156. package/ebay-tooltip/ebay-tooltip-host.js +1 -1
  157. package/ebay-tooltip/ebay-tooltip.js +32 -21
  158. package/ebay-tourtip/ebay-tourtip-content.js +1 -1
  159. package/ebay-tourtip/ebay-tourtip-footer.js +7 -4
  160. package/ebay-tourtip/ebay-tourtip-heading.js +17 -6
  161. package/ebay-tourtip/ebay-tourtip-host.js +1 -1
  162. package/ebay-tourtip/ebay-tourtip.js +33 -22
  163. package/ebay-video/controls.d.ts.map +1 -1
  164. package/ebay-video/controls.js +46 -23
  165. package/ebay-video/reportButton.d.ts +2 -7
  166. package/ebay-video/reportButton.d.ts.map +1 -1
  167. package/ebay-video/reportButton.js +8 -5
  168. package/ebay-video/source.js +14 -3
  169. package/ebay-video/video.d.ts.map +1 -1
  170. package/ebay-video/video.js +80 -54
  171. 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
- const react_1 = __importStar(require("react"));
41
- const notice_content_1 = __importDefault(require("../common/notice-utils/notice-content"));
42
- const ebay_notice_content_1 = require("../ebay-notice-base/components/ebay-notice-content");
43
- const ebay_icon_1 = require("../ebay-icon");
44
- const index_1 = require("./index");
45
- const EbayPageNotice = (_a) => {
46
- var { id, status = 'general', children, a11yDismissText, 'aria-label': ariaLabel, onDismiss = () => { } } = _a, rest = __rest(_a, ["id", "status", "children", "a11yDismissText", 'aria-label', "onDismiss"]);
47
- const [dismissed, setDismissed] = (0, react_1.useState)(false);
48
- const childrenArray = react_1.default.Children.toArray(children);
49
- const content = childrenArray.find((child) => child.type === ebay_notice_content_1.EbayNoticeContent);
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(`EbayPageNotice: Please use a EbayNoticeContent that defines the content of the notice`);
62
+ throw new Error("EbayPageNotice: Please use a EbayNoticeContent that defines the content of the notice");
52
63
  }
53
- const handleDismissed = (event) => {
64
+ var handleDismissed = function (event) {
54
65
  setDismissed(true);
55
66
  onDismiss(event);
56
67
  };
57
- return dismissed ? null : (react_1.default.createElement("section", Object.assign({}, rest, { "aria-labelledby": id || `${status}-status`, className: `page-notice ${status !== `general` ? `page-notice--${status}` : ``}`, role: "region" }),
58
- status !== `general` ? (react_1.default.createElement("div", { className: "page-notice__header", id: id || `${status}-status` },
59
- react_1.default.createElement(ebay_icon_1.EbayIcon, { name: `${status}Filled16`, a11yText: ariaLabel, a11yVariant: "label" }))) : null,
60
- react_1.default.createElement(notice_content_1.default, Object.assign({}, content.props, { type: "page" })),
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
- const const_1 = require("./const");
5
- function pageNumbersAround(totalPages, selectedPage, maxVisiblePages = totalPages, variant = null) {
6
- const withDots = variant === 'show-last' || (variant === 'overflow' && totalPages > const_1.MAX_PAGES);
7
- const hasLeadingDots = variant === 'overflow' && totalPages > const_1.MAX_PAGES;
8
- const visibleItems = Math.min(maxVisiblePages, totalPages);
9
- const startIndexWithoutDots = Math.max(0, selectedPage - Math.ceil((visibleItems - 1) / 2));
10
- const startIndexWithDots = visibleItems < const_1.MIN_VISIBLE_ITEMS ? selectedPage :
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
- const endIndex = (withDots ? startIndexWithDots : startIndexWithoutDots) + visibleItems;
13
- const closeToEnd = endIndex >= totalPages;
14
- const closeToFront = selectedPage <= const_1.MIN_VISIBLE_ITEMS;
15
- const visibleRangeWithDots = (start, end) => {
16
- const items = visibleRange(totalPages, start, end);
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
- const visibleRangeWithOverflowDots = (start, end) => {
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
- const items = visibleRange(totalPages, totalPages - const_1.TRAILING_SPACE_WITH_DOT, totalPages);
36
- items[0] = 'visible';
37
- items[1] = 'dots';
38
- return items;
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
- const items = visibleRange(totalPages, selectedPage - const_1.LEADING_SPACE_WITH_DOT, selectedPage + const_1.LEADING_SPACE_WITH_DOT + 1);
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 = 'show-range') {
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
- const adjustedNumPages = variant === 'overflow' ? const_1.MAX_PAGES :
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
- const result = el.offsetWidth;
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<Omit<PaginationItemProps, "ref"> & React.RefAttributes<React.FC<PaginationItemProps>>>;
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
- const react_1 = __importDefault(require("react"));
18
- const ebay_icon_1 = require("../ebay-icon");
19
- const component_utils_1 = require("../common/component-utils");
20
- const classnames_1 = __importDefault(require("classnames"));
21
- const EbayPaginationItem = (_a) => {
22
- var { pageIndex = 0, key, current, disabled, type = 'page', href, hide, children, a11yPreviousText = 'Previous page', a11yNextText = 'Next page', onSelect, onNext, onPrevious, className, style, forwardedRef } = _a, rest = __rest(_a, ["pageIndex", "key", "current", "disabled", "type", "href", "hide", "children", "a11yPreviousText", "a11yNextText", "onSelect", "onNext", "onPrevious", "className", "style", "forwardedRef"]);
23
- const handlePageNumber = (e) => {
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
- const handleNextPage = (e) => {
38
+ var handleNextPage = function (e) {
28
39
  if (!e.currentTarget.getAttribute('aria-disabled')) {
29
40
  onNext(e);
30
41
  }
31
42
  };
32
- const handlePreviousPage = (e) => {
43
+ var handlePreviousPage = function (e) {
33
44
  if (!e.currentTarget.getAttribute('aria-disabled')) {
34
45
  onPrevious(e);
35
46
  }
36
47
  };
37
- const isAnchor = !!href;
38
- const ButtonOrAnchor = isAnchor ? 'a' : 'button';
39
- const iconClassName = isAnchor ? 'icon-link' : 'icon-btn';
40
- const arrowStyle = Object.assign(Object.assign({}, style), { minWidth: '40px' });
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, Object.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 }),
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, Object.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 }),
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", Object.assign({}, rest, { hidden: hide }),
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
- const react_1 = __importStar(require("react"));
41
- const ebay_fake_menu_button_1 = require("../ebay-fake-menu-button");
42
- const classnames_1 = __importDefault(require("classnames"));
43
- const debounce_1 = require("../common/debounce");
44
- const helpers_1 = require("./helpers");
45
- const component_utils_1 = require("../common/component-utils");
46
- const ebay_icon_1 = require("../ebay-icon");
47
- const EbayPagination = (_a) => {
48
- var { id = 'ebay-pagination', className, a11yCurrentText = 'Pagination - Current Page', a11yPreviousText = 'Previous page', a11yNextText = 'Next page', variant = 'show-range', fluid = false, onPrevious = () => { }, onNext = () => { }, onSelect = () => { }, children } = _a, rest = __rest(_a, ["id", "className", "a11yCurrentText", "a11yPreviousText", "a11yNextText", "variant", "fluid", "onPrevious", "onNext", "onSelect", "children"]);
49
- const paginationContainerRef = (0, react_1.useRef)(null);
50
- const childPageRefs = (0, react_1.useRef)([]);
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
- const totalPages = (0, component_utils_1.filterBy)(children, ({ props }) => props.type === undefined || props.type === 'page').length;
53
- const itemWidthRef = (0, react_1.useRef)(0);
54
- const arrowWidthRef = (0, react_1.useRef)(0);
55
- const getNumOfVisiblePageItems = () => {
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
- const pageArrowWidth = arrowWidthRef.current || ((_b = (_a = childPageRefs.current[0]) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.offsetWidth);
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
- const pageItemWidth = itemWidthRef.current || ((_d = (_c = childPageRefs.current[1]) === null || _c === void 0 ? void 0 : _c.current) === null || _d === void 0 ? void 0 : _d.offsetWidth);
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
- const [page, setPage] = (0, react_1.useState)([]);
66
- const [selectedIndex, setSelectedIndex] = (0, react_1.useState)(0);
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
- const updatePages = (selectedPageIndexFromDotMenu) => {
69
- const selectedPageIndex = selectedPageIndexFromDotMenu || childPageRefs.current.findIndex(pageRef => { var _a; return ((_a = pageRef.current) === null || _a === void 0 ? void 0 : _a.getAttribute('aria-current')) === 'page'; });
70
- const visiblePageItems = getNumOfVisiblePageItems();
71
- const pageState = (0, helpers_1.calcPageState)(selectedPageIndex, visiblePageItems, totalPages, variant);
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', ...pageState]);
96
+ setPage(__spreadArray(['hidden'], pageState, true));
74
97
  };
75
- (0, react_1.useEffect)(() => {
76
- const debouncedUpdate = (0, debounce_1.debounce)(updatePages, 16);
98
+ (0, react_1.useEffect)(function () {
99
+ var debouncedUpdate = (0, debounce_1.debounce)(updatePages, 16);
77
100
  updatePages();
78
- window.addEventListener('resize', () => debouncedUpdate());
79
- return () => {
80
- window.removeEventListener('resize', () => debouncedUpdate());
101
+ window.addEventListener('resize', function () { return debouncedUpdate(); });
102
+ return function () {
103
+ window.removeEventListener('resize', function () { return debouncedUpdate(); });
81
104
  };
82
105
  }, [children]);
83
- const createChildItems = (itemType) => {
84
- let pageIndex = 0;
85
- const firstDotItems = [];
86
- const secondDotItems = [];
87
- const allDotItems = [];
88
- const firstDot = page.indexOf('dots');
89
- const lastDot = page.lastIndexOf('dots');
90
- return react_1.Children.map(children, (item, index) => {
91
- const { type = 'page', current, disabled, href, children: text } = item.props;
92
- const isDot = page[index] === 'dots';
93
- const key = `${id}-item-${index}`;
94
- const hide = page[index] === 'hidden';
95
- const isSeparator = isDot && type === 'page';
96
- const newProps = {
97
- current, disabled, href,
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, onNext, onSelect, a11yPreviousText, a11yNextText,
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
- const itemComponent = (react_1.default.createElement(ebay_fake_menu_button_1.EbayFakeMenuButtonItem, { key: key, href: href, onClick: event => {
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
- const currentTarget = event.currentTarget;
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
- let childComponent = allDotItems;
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
- const headingId = `${id}-pagination-heading`;
139
- return (react_1.default.createElement("nav", Object.assign({}, rest, { role: "navigation", className: (0, classnames_1.default)(className, 'pagination', { 'pagination--fluid': fluid }), "aria-labelledby": headingId, ref: paginationContainerRef }),
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
- 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 = 'panel-dialog';
21
- const EbayPanelDialog = (_a) => {
22
- var { open, animated, position = 'start', onClose = () => { }, className } = _a, rest = __rest(_a, ["open", "animated", "position", "onClose", "className"]);
23
- return (react_1.default.createElement(ebay_dialog_base_1.DialogBaseWithState, Object.assign({}, rest, { "aria-label": "Infotip", classPrefix: classPrefix, buttonPosition: "right", onCloseBtnClick: onClose, onBackgroundClick: onClose, animated: animated, className: (0, classnames_1.default)(className, { [`${classPrefix}--mask-fade-slow`]: animated }), windowClass: (0, classnames_1.default)(`${classPrefix}__window--slide`, {
24
- [`${classPrefix}__window--end`]: position === 'end'
25
- }), open: open })));
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
- const react_1 = __importDefault(require("react"));
18
- const classnames_1 = __importDefault(require("classnames"));
19
- const EbayProgressBar = (_a) => {
20
- var { value = 0, max = 100, fluid, className } = _a, rest = __rest(_a, ["value", "max", "fluid", "className"]);
21
- return (react_1.default.createElement("progress", Object.assign({}, rest, { className: (0, classnames_1.default)('progress-bar', className, { 'progress-bar--fluid': fluid }), value: value, max: max })));
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
- const react_1 = __importDefault(require("react"));
18
- const classnames_1 = __importDefault(require("classnames"));
19
- const ebay_icon_1 = require("../ebay-icon");
20
- const sizeClass = {
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
- const EbayProgressSpinner = (_a) => {
26
- var { size = 'default', 'aria-label': ariaLabel = 'Busy', className } = _a, rest = __rest(_a, ["size", 'aria-label', "className"]);
27
- return (react_1.default.createElement("span", Object.assign({}, rest, { className: (0, classnames_1.default)('progress-spinner', sizeClass[size], className), "aria-label": ariaLabel, role: "img" }),
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;