@elliemae/ds-tabs 2.0.0-next.0 → 2.0.0-next.13

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/cjs/Carousel.js CHANGED
@@ -1,9 +1,14 @@
1
1
  'use strict';
2
2
 
3
3
  var _jsx = require('@babel/runtime/helpers/jsx');
4
+ require('core-js/modules/web.dom-collections.iterator.js');
5
+ require('core-js/modules/esnext.async-iterator.reduce.js');
6
+ require('core-js/modules/esnext.iterator.constructor.js');
7
+ require('core-js/modules/esnext.iterator.reduce.js');
8
+ require('core-js/modules/esnext.async-iterator.map.js');
9
+ require('core-js/modules/esnext.iterator.map.js');
4
10
  var React = require('react');
5
- var ChevronRight = require('@elliemae/ds-icons/ChevronRight');
6
- var ChevronLeft = require('@elliemae/ds-icons/ChevronLeft');
11
+ var dsIcons = require('@elliemae/ds-icons');
7
12
  var styled = require('styled-components');
8
13
  var DSButton = require('@elliemae/ds-button');
9
14
  var useResize = require('./useResize.js');
@@ -13,16 +18,17 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
13
18
 
14
19
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
15
20
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
- var ChevronRight__default = /*#__PURE__*/_interopDefaultLegacy(ChevronRight);
17
- var ChevronLeft__default = /*#__PURE__*/_interopDefaultLegacy(ChevronLeft);
18
21
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
19
22
  var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
20
23
 
21
24
  const CarouselBtn = /*#__PURE__*/styled__default["default"](DSButton__default["default"]).withConfig({
22
25
  componentId: "sc-1317h31-0"
23
- })(["position:absolute;z-index:1;margin:0;&:focus{& span{background-color:", ";background-size:90%;border-radius:2px;border-color:transparent;}}&&{width:16px;height:calc(100% - 2px);@media (min-width:", "){height:calc(100% - 4px);&:focus{& span{background-color:unset;}}}}", " && .em-ds-icon{height:16px;width:16px;}"], props => props.theme.colors.brand[200], ({
24
- theme
25
- }) => theme.breakpoints.medium, props => props.right ? 'right: 0;' : 'left: 0;');
26
+ })(["position:absolute;z-index:1;margin:0;&:focus{& span{background-color:", ";background-size:90%;border-radius:2px;border-color:transparent;}}&&{width:16px;height:calc(100% - 2px);@media (min-width:", "){height:calc(100% - 4px);&:focus{& span{background-color:unset;}}}}", " && .em-ds-icon{height:16px;width:16px;}"], props => props.theme.colors.brand[200], _ref => {
27
+ let {
28
+ theme
29
+ } = _ref;
30
+ return theme.breakpoints.medium;
31
+ }, props => props.right ? 'right: 0;' : 'left: 0;');
26
32
  const CarouselWrapper = /*#__PURE__*/styled__default["default"].span.withConfig({
27
33
  componentId: "sc-1317h31-1"
28
34
  })(["position:relative;padding:0 16px;width:100%;"]);
@@ -40,10 +46,11 @@ function isVisibleElement(el, container) {
40
46
  return isVisible;
41
47
  }
42
48
 
43
- const Carousel = ({
44
- children,
45
- onScroll
46
- }) => {
49
+ const Carousel = _ref2 => {
50
+ let {
51
+ children,
52
+ onScroll
53
+ } = _ref2;
47
54
  const itemsRef = React.useRef([]);
48
55
  const wrapRef = React.useRef(null);
49
56
  const leftRef = React.useRef(null);
@@ -120,7 +127,8 @@ const Carousel = ({
120
127
  onScroll(e);
121
128
  };
122
129
 
123
- const handleClick = (e, onClick = () => {}) => {
130
+ const handleClick = function (e) {
131
+ let onClick = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : () => {};
124
132
  const tabListDomEl = wrapRef.current;
125
133
  const el = e.target;
126
134
  const rect = el.getBoundingClientRect();
@@ -151,7 +159,7 @@ const Carousel = ({
151
159
  buttonType: "link",
152
160
  innerRef: leftRef,
153
161
  size: "s",
154
- icon: /*#__PURE__*/_jsx__default["default"](ChevronLeft__default["default"], {
162
+ icon: /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronLeft, {
155
163
  size: "s",
156
164
  color: ['brand-primary', '600']
157
165
  }),
@@ -163,7 +171,7 @@ const Carousel = ({
163
171
  right: true,
164
172
  size: "s",
165
173
  buttonType: "link",
166
- icon: /*#__PURE__*/_jsx__default["default"](ChevronRight__default["default"], {
174
+ icon: /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronRight, {
167
175
  size: "s",
168
176
  color: ['brand-primary', '600']
169
177
  }),
package/cjs/DSTab.js CHANGED
@@ -10,16 +10,19 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
10
10
 
11
11
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
12
12
 
13
- const DSTab = ({
14
- tabId = '',
15
- title = '',
16
- required = false
17
- }) => /*#__PURE__*/_jsx__default["default"]("div", {
18
- "aria-labelledby": `${tabId}-label`,
19
- tabId: tabId,
20
- title: title,
21
- required: required
22
- });
13
+ const DSTab = _ref => {
14
+ let {
15
+ tabId = '',
16
+ title = '',
17
+ required = false
18
+ } = _ref;
19
+ return /*#__PURE__*/_jsx__default["default"]("div", {
20
+ "aria-labelledby": "".concat(tabId, "-label"),
21
+ tabId: tabId,
22
+ title: title,
23
+ required: required
24
+ });
25
+ };
23
26
 
24
27
  DSTab.displayName = 'DSTab';
25
28
  const props = {
package/cjs/DSTabs.js CHANGED
@@ -13,44 +13,47 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
13
13
 
14
14
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
15
15
 
16
- const DSTabs = ({
17
- containerProps = {},
18
- innerRef,
19
- animated = true,
20
- enableMouseEvents = false,
21
- allowTextSelection = false,
22
- onTabChange = () => null,
23
- tabsListAriaLabel = 'Tab list',
24
- type = TabTypes.TabTypes.NORMAL,
25
- tabBarExtraContent = undefined,
26
- children: tabs,
27
- onlyRenderActiveTab = false,
28
- activeTab,
29
- withCarousel = false,
30
- firstSubtabRef,
31
- lastTabRef,
32
- flexibleTabsHeaders,
33
- fixedTabsHeaders,
34
- isDSMobile = false
35
- }) => /*#__PURE__*/_jsx__default["default"](TabsImpl, {
36
- activeTab: activeTab,
37
- firstSubtabRef: firstSubtabRef,
38
- lastTabRef: lastTabRef,
39
- allowTextSelection: allowTextSelection,
40
- animated: animated,
41
- containerProps: containerProps,
42
- enableMouseEvents: enableMouseEvents,
43
- innerRef: innerRef,
44
- onlyRenderActiveTab: onlyRenderActiveTab,
45
- onTabChange: onTabChange,
46
- tabBarExtraContent: tabBarExtraContent,
47
- tabsListAriaLabel: tabsListAriaLabel,
48
- type: type,
49
- withCarousel: withCarousel,
50
- flexibleTabsHeaders: flexibleTabsHeaders,
51
- fixedTabsHeaders: fixedTabsHeaders,
52
- isDSMobile: isDSMobile
53
- }, void 0, tabs);
16
+ const DSTabs = _ref => {
17
+ let {
18
+ containerProps = {},
19
+ innerRef,
20
+ animated = true,
21
+ enableMouseEvents = false,
22
+ allowTextSelection = false,
23
+ onTabChange = () => null,
24
+ tabsListAriaLabel = 'Tab list',
25
+ type = TabTypes.TabTypes.NORMAL,
26
+ tabBarExtraContent = undefined,
27
+ children: tabs,
28
+ onlyRenderActiveTab = false,
29
+ activeTab,
30
+ withCarousel = false,
31
+ firstSubtabRef,
32
+ lastTabRef,
33
+ flexibleTabsHeaders,
34
+ fixedTabsHeaders,
35
+ isDSMobile = false
36
+ } = _ref;
37
+ return /*#__PURE__*/_jsx__default["default"](TabsImpl, {
38
+ activeTab: activeTab,
39
+ firstSubtabRef: firstSubtabRef,
40
+ lastTabRef: lastTabRef,
41
+ allowTextSelection: allowTextSelection,
42
+ animated: animated,
43
+ containerProps: containerProps,
44
+ enableMouseEvents: enableMouseEvents,
45
+ innerRef: innerRef,
46
+ onlyRenderActiveTab: onlyRenderActiveTab,
47
+ onTabChange: onTabChange,
48
+ tabBarExtraContent: tabBarExtraContent,
49
+ tabsListAriaLabel: tabsListAriaLabel,
50
+ type: type,
51
+ withCarousel: withCarousel,
52
+ flexibleTabsHeaders: flexibleTabsHeaders,
53
+ fixedTabsHeaders: fixedTabsHeaders,
54
+ isDSMobile: isDSMobile
55
+ }, void 0, tabs);
56
+ };
54
57
 
55
58
  const props = {
56
59
  /** Whether the tab transition should animate or not */
@@ -2,6 +2,13 @@
2
2
 
3
3
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
4
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
5
+ require('core-js/modules/esnext.async-iterator.map.js');
6
+ require('core-js/modules/esnext.iterator.map.js');
7
+ require('core-js/modules/esnext.async-iterator.filter.js');
8
+ require('core-js/modules/esnext.iterator.constructor.js');
9
+ require('core-js/modules/esnext.iterator.filter.js');
10
+ require('core-js/modules/esnext.async-iterator.for-each.js');
11
+ require('core-js/modules/esnext.iterator.for-each.js');
5
12
  var React = require('react');
6
13
  var dsClassnames = require('@elliemae/ds-classnames');
7
14
  var jsxRuntime = require('react/jsx-runtime');
package/cjs/SubTabBar.js CHANGED
@@ -11,35 +11,44 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
11
11
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
12
12
 
13
13
  const blockName = 'tabs-tab-bar';
14
- const SubTabList = dsClassnames.aggregatedClasses('div')(blockName, 'subtabs-list', ({
15
- withCarousel
16
- }) => ({
17
- carousel: withCarousel
18
- }));
19
-
20
- const SubTabBar = ({
21
- withCarousel,
22
- tabs = [],
23
- activeTab = '',
24
- onTabClick = () => null,
25
- firstSubtabRef,
26
- handleUpArrow
27
- }) => /*#__PURE__*/_jsx__default["default"](TabBar, {
28
- activeTab: activeTab,
29
- onTabClick: onTabClick,
30
- handleUpArrow: handleUpArrow,
31
- firstSubtabRef: firstSubtabRef,
32
- renderCustomTabBar: ({
33
- tabsComponents,
34
- innerRef
35
- }) => /*#__PURE__*/_jsx__default["default"](SubTabList, {
36
- withCarousel: withCarousel,
37
- innerRef: innerRef,
38
- "data-testid": "subtabs-list"
39
- }, void 0, withCarousel ? /*#__PURE__*/_jsx__default["default"](Carousel, {}, void 0, tabsComponents) : tabsComponents),
40
- showSelectionIndicator: false,
41
- showSeparator: true,
42
- tabs: tabs
14
+ const SubTabList = dsClassnames.aggregatedClasses('div')(blockName, 'subtabs-list', _ref => {
15
+ let {
16
+ withCarousel
17
+ } = _ref;
18
+ return {
19
+ carousel: withCarousel
20
+ };
43
21
  });
44
22
 
23
+ const SubTabBar = _ref2 => {
24
+ let {
25
+ withCarousel,
26
+ tabs = [],
27
+ activeTab = '',
28
+ onTabClick = () => null,
29
+ firstSubtabRef,
30
+ handleUpArrow
31
+ } = _ref2;
32
+ return /*#__PURE__*/_jsx__default["default"](TabBar, {
33
+ activeTab: activeTab,
34
+ onTabClick: onTabClick,
35
+ handleUpArrow: handleUpArrow,
36
+ firstSubtabRef: firstSubtabRef,
37
+ renderCustomTabBar: _ref3 => {
38
+ let {
39
+ tabsComponents,
40
+ innerRef
41
+ } = _ref3;
42
+ return /*#__PURE__*/_jsx__default["default"](SubTabList, {
43
+ withCarousel: withCarousel,
44
+ innerRef: innerRef,
45
+ "data-testid": "subtabs-list"
46
+ }, void 0, withCarousel ? /*#__PURE__*/_jsx__default["default"](Carousel, {}, void 0, tabsComponents) : tabsComponents);
47
+ },
48
+ showSelectionIndicator: false,
49
+ showSeparator: true,
50
+ tabs: tabs
51
+ });
52
+ };
53
+
45
54
  module.exports = SubTabBar;
package/cjs/TabBar.js CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  var _jsx = require('@babel/runtime/helpers/jsx');
4
4
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
5
+ require('core-js/modules/esnext.async-iterator.map.js');
6
+ require('core-js/modules/esnext.iterator.map.js');
5
7
  var React = require('react');
6
8
  var lodash = require('lodash');
7
9
  var dsClassnames = require('@elliemae/ds-classnames');
@@ -25,36 +27,45 @@ const blockName = 'tabs-tab-bar';
25
27
  const gradientWidth = 24;
26
28
  const StyledTabWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
27
29
  componentId: "sc-7sdovg-0"
28
- })(["display:flex;flex:1;flex-wrap:nowrap;", ";"], ({
29
- flexibleTabsHeaders
30
- }) => flexibleTabsHeaders ? '' : 'overflow-x: hidden');
31
- const StyledTabList = dsClassnames.aggregatedClasses('div')(blockName, 'list', ({
32
- withCarousel,
33
- flexibleTabsHeaders,
34
- fixedTabsHeaders,
35
- isDSMobile,
36
- withLeftGradients,
37
- withRightGradients
38
- }) => ({
39
- carousel: withCarousel,
40
- 'flexible-table-headers': isDSMobile && flexibleTabsHeaders,
41
- 'fixed-table-headers': isDSMobile && fixedTabsHeaders,
42
- 'left-gradients': isDSMobile && flexibleTabsHeaders && withLeftGradients,
43
- 'right-gradients': isDSMobile && flexibleTabsHeaders && withRightGradients
44
- }), {
30
+ })(["display:flex;flex:1;flex-wrap:nowrap;", ";"], _ref => {
31
+ let {
32
+ flexibleTabsHeaders
33
+ } = _ref;
34
+ return flexibleTabsHeaders ? '' : 'overflow-x: hidden';
35
+ });
36
+ const StyledTabList = dsClassnames.aggregatedClasses('div')(blockName, 'list', _ref2 => {
37
+ let {
38
+ withCarousel,
39
+ flexibleTabsHeaders,
40
+ fixedTabsHeaders,
41
+ isDSMobile,
42
+ withLeftGradients,
43
+ withRightGradients
44
+ } = _ref2;
45
+ return {
46
+ carousel: withCarousel,
47
+ 'flexible-table-headers': isDSMobile && flexibleTabsHeaders,
48
+ 'fixed-table-headers': isDSMobile && fixedTabsHeaders,
49
+ 'left-gradients': isDSMobile && flexibleTabsHeaders && withLeftGradients,
50
+ 'right-gradients': isDSMobile && flexibleTabsHeaders && withRightGradients
51
+ };
52
+ }, {
45
53
  propsToRemoveFromFinalElement: ['withCarousel', 'flexibleTabsHeaders', 'fixedTabsHeaders', 'withLeftGradients', 'withRightGradients', 'isDSMobile']
46
54
  });
47
55
  const TabContainer = dsClassnames.aggregatedClasses('button', {
48
56
  role: 'tab'
49
- })(blockName, 'tab', ({
50
- isActive,
51
- showSeparator,
52
- disabled
53
- }) => ({
54
- active: isActive,
55
- separator: showSeparator,
56
- disabled
57
- }));
57
+ })(blockName, 'tab', _ref3 => {
58
+ let {
59
+ isActive,
60
+ showSeparator,
61
+ disabled
62
+ } = _ref3;
63
+ return {
64
+ active: isActive,
65
+ separator: showSeparator,
66
+ disabled
67
+ };
68
+ });
58
69
  const SelectionIndicator = dsClassnames.aggregatedClasses('div')(blockName, 'selection-indicator');
59
70
 
60
71
  class TabBar extends React.Component {
@@ -198,7 +209,7 @@ class TabBar extends React.Component {
198
209
  disabled
199
210
  },
200
211
  "data-tab-id": tabId,
201
- id: `${tabId}-label`,
212
+ id: "".concat(tabId, "-label"),
202
213
  onClick: e => {
203
214
  if (!disabled) this.handleTabClick(tabId, e, index);
204
215
  },
@@ -295,7 +306,7 @@ class TabBar extends React.Component {
295
306
 
296
307
  getActiveTabElement(activeTab) {
297
308
  const tabListEl = this.tabListRef.current;
298
- const tabSelector = `[data-tab-id="${activeTab}"]`;
309
+ const tabSelector = "[data-tab-id=\"".concat(activeTab, "\"]");
299
310
  return tabListEl && tabListEl.querySelector(tabSelector);
300
311
  }
301
312
 
@@ -338,9 +349,9 @@ class TabBar extends React.Component {
338
349
  const width = withCarousel ? this.getVisibleDimensions(activeTabEl, tabListEl).width + 2 : clientWidth + 2;
339
350
  return {
340
351
  height: clientHeight,
341
- left: `${Math.floor(leftOff)}px`,
352
+ left: "".concat(Math.floor(leftOff), "px"),
342
353
  // using left and top for ie compatibility
343
- top: `${Math.floor(offsetTop)}px`,
354
+ top: "".concat(Math.floor(offsetTop), "px"),
344
355
  width
345
356
  };
346
357
  }
package/cjs/TabTypes.js CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ require('core-js/modules/esnext.async-iterator.map.js');
6
+ require('core-js/modules/esnext.iterator.map.js');
7
+
5
8
  const TabTypes = {
6
9
  NORMAL: 'normal',
7
10
  SUBTABS: 'subtabs'
package/cjs/TabsImpl.js CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
4
  var _jsx = require('@babel/runtime/helpers/jsx');
5
+ require('core-js/modules/web.dom-collections.iterator.js');
6
+ require('core-js/modules/esnext.async-iterator.filter.js');
7
+ require('core-js/modules/esnext.iterator.constructor.js');
8
+ require('core-js/modules/esnext.iterator.filter.js');
9
+ require('core-js/modules/esnext.async-iterator.for-each.js');
10
+ require('core-js/modules/esnext.iterator.for-each.js');
5
11
  var React = require('react');
6
12
  var dsClassnames = require('@elliemae/ds-classnames');
7
13
  var TabsPanels = require('./TabsPanels.js');
package/cjs/TabsPanels.js CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  var _jsx = require('@babel/runtime/helpers/jsx');
4
4
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
5
+ require('core-js/modules/web.dom-collections.iterator.js');
6
+ require('core-js/modules/esnext.async-iterator.map.js');
7
+ require('core-js/modules/esnext.iterator.map.js');
5
8
  var React = require('react');
6
9
  var memoizeOne = require('memoize-one');
7
10
  var dsClassnames = require('@elliemae/ds-classnames');
@@ -24,8 +27,8 @@ const getIndexById = (children, activeId) => children && children.findIndex(item
24
27
  const getIdByIndex = (children, index) => children && children[index].props.tabId;
25
28
 
26
29
  class TabsPanels extends React.Component {
27
- constructor(...args) {
28
- super(...args);
30
+ constructor() {
31
+ super(...arguments);
29
32
 
30
33
  _defineProperty__default["default"](this, "renderPanels", memoizeOne__default["default"]((activeTab, tabsComponents) => {
31
34
  const {
@@ -42,7 +45,7 @@ class TabsPanels extends React.Component {
42
45
  const isActive = activeTab === panelId;
43
46
  const shouldRender = !onlyRenderActiveTab || isActive;
44
47
  return /*#__PURE__*/_jsx__default["default"](PanelContainer, {
45
- "aria-labelledby": `${panelId}-label`,
48
+ "aria-labelledby": "".concat(panelId, "-label"),
46
49
  lastTabRef: this.props.lastTabRef,
47
50
  firstSubtabRef: this.props.firstTabRefByParent,
48
51
  classProps: {
package/esm/Carousel.js CHANGED
@@ -1,7 +1,12 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
3
+ import 'core-js/modules/esnext.async-iterator.reduce.js';
4
+ import 'core-js/modules/esnext.iterator.constructor.js';
5
+ import 'core-js/modules/esnext.iterator.reduce.js';
6
+ import 'core-js/modules/esnext.async-iterator.map.js';
7
+ import 'core-js/modules/esnext.iterator.map.js';
2
8
  import React, { useRef, useState, useEffect } from 'react';
3
- import ChevronRight from '@elliemae/ds-icons/ChevronRight';
4
- import ChevronLeft from '@elliemae/ds-icons/ChevronLeft';
9
+ import { ChevronLeft, ChevronRight } from '@elliemae/ds-icons';
5
10
  import styled from 'styled-components';
6
11
  import DSButton from '@elliemae/ds-button';
7
12
  import { useResize } from './useResize.js';
@@ -9,9 +14,12 @@ import { jsx } from 'react/jsx-runtime';
9
14
 
10
15
  const CarouselBtn = /*#__PURE__*/styled(DSButton).withConfig({
11
16
  componentId: "sc-1317h31-0"
12
- })(["position:absolute;z-index:1;margin:0;&:focus{& span{background-color:", ";background-size:90%;border-radius:2px;border-color:transparent;}}&&{width:16px;height:calc(100% - 2px);@media (min-width:", "){height:calc(100% - 4px);&:focus{& span{background-color:unset;}}}}", " && .em-ds-icon{height:16px;width:16px;}"], props => props.theme.colors.brand[200], ({
13
- theme
14
- }) => theme.breakpoints.medium, props => props.right ? 'right: 0;' : 'left: 0;');
17
+ })(["position:absolute;z-index:1;margin:0;&:focus{& span{background-color:", ";background-size:90%;border-radius:2px;border-color:transparent;}}&&{width:16px;height:calc(100% - 2px);@media (min-width:", "){height:calc(100% - 4px);&:focus{& span{background-color:unset;}}}}", " && .em-ds-icon{height:16px;width:16px;}"], props => props.theme.colors.brand[200], _ref => {
18
+ let {
19
+ theme
20
+ } = _ref;
21
+ return theme.breakpoints.medium;
22
+ }, props => props.right ? 'right: 0;' : 'left: 0;');
15
23
  const CarouselWrapper = /*#__PURE__*/styled.span.withConfig({
16
24
  componentId: "sc-1317h31-1"
17
25
  })(["position:relative;padding:0 16px;width:100%;"]);
@@ -29,10 +37,11 @@ function isVisibleElement(el, container) {
29
37
  return isVisible;
30
38
  }
31
39
 
32
- const Carousel = ({
33
- children,
34
- onScroll
35
- }) => {
40
+ const Carousel = _ref2 => {
41
+ let {
42
+ children,
43
+ onScroll
44
+ } = _ref2;
36
45
  const itemsRef = useRef([]);
37
46
  const wrapRef = useRef(null);
38
47
  const leftRef = useRef(null);
@@ -109,7 +118,8 @@ const Carousel = ({
109
118
  onScroll(e);
110
119
  };
111
120
 
112
- const handleClick = (e, onClick = () => {}) => {
121
+ const handleClick = function (e) {
122
+ let onClick = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : () => {};
113
123
  const tabListDomEl = wrapRef.current;
114
124
  const el = e.target;
115
125
  const rect = el.getBoundingClientRect();
package/esm/DSTab.js CHANGED
@@ -2,16 +2,19 @@ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import 'react';
3
3
  import { PropTypes, describe } from 'react-desc';
4
4
 
5
- const DSTab = ({
6
- tabId = '',
7
- title = '',
8
- required = false
9
- }) => /*#__PURE__*/_jsx("div", {
10
- "aria-labelledby": `${tabId}-label`,
11
- tabId: tabId,
12
- title: title,
13
- required: required
14
- });
5
+ const DSTab = _ref => {
6
+ let {
7
+ tabId = '',
8
+ title = '',
9
+ required = false
10
+ } = _ref;
11
+ return /*#__PURE__*/_jsx("div", {
12
+ "aria-labelledby": "".concat(tabId, "-label"),
13
+ tabId: tabId,
14
+ title: title,
15
+ required: required
16
+ });
17
+ };
15
18
 
16
19
  DSTab.displayName = 'DSTab';
17
20
  const props = {
package/esm/DSTabs.js CHANGED
@@ -5,44 +5,47 @@ import { TabTypes } from './TabTypes.js';
5
5
  import TabsImpl from './TabsImpl.js';
6
6
  import { DSTab } from './DSTab.js';
7
7
 
8
- const DSTabs = ({
9
- containerProps = {},
10
- innerRef,
11
- animated = true,
12
- enableMouseEvents = false,
13
- allowTextSelection = false,
14
- onTabChange = () => null,
15
- tabsListAriaLabel = 'Tab list',
16
- type = TabTypes.NORMAL,
17
- tabBarExtraContent = undefined,
18
- children: tabs,
19
- onlyRenderActiveTab = false,
20
- activeTab,
21
- withCarousel = false,
22
- firstSubtabRef,
23
- lastTabRef,
24
- flexibleTabsHeaders,
25
- fixedTabsHeaders,
26
- isDSMobile = false
27
- }) => /*#__PURE__*/_jsx(TabsImpl, {
28
- activeTab: activeTab,
29
- firstSubtabRef: firstSubtabRef,
30
- lastTabRef: lastTabRef,
31
- allowTextSelection: allowTextSelection,
32
- animated: animated,
33
- containerProps: containerProps,
34
- enableMouseEvents: enableMouseEvents,
35
- innerRef: innerRef,
36
- onlyRenderActiveTab: onlyRenderActiveTab,
37
- onTabChange: onTabChange,
38
- tabBarExtraContent: tabBarExtraContent,
39
- tabsListAriaLabel: tabsListAriaLabel,
40
- type: type,
41
- withCarousel: withCarousel,
42
- flexibleTabsHeaders: flexibleTabsHeaders,
43
- fixedTabsHeaders: fixedTabsHeaders,
44
- isDSMobile: isDSMobile
45
- }, void 0, tabs);
8
+ const DSTabs = _ref => {
9
+ let {
10
+ containerProps = {},
11
+ innerRef,
12
+ animated = true,
13
+ enableMouseEvents = false,
14
+ allowTextSelection = false,
15
+ onTabChange = () => null,
16
+ tabsListAriaLabel = 'Tab list',
17
+ type = TabTypes.NORMAL,
18
+ tabBarExtraContent = undefined,
19
+ children: tabs,
20
+ onlyRenderActiveTab = false,
21
+ activeTab,
22
+ withCarousel = false,
23
+ firstSubtabRef,
24
+ lastTabRef,
25
+ flexibleTabsHeaders,
26
+ fixedTabsHeaders,
27
+ isDSMobile = false
28
+ } = _ref;
29
+ return /*#__PURE__*/_jsx(TabsImpl, {
30
+ activeTab: activeTab,
31
+ firstSubtabRef: firstSubtabRef,
32
+ lastTabRef: lastTabRef,
33
+ allowTextSelection: allowTextSelection,
34
+ animated: animated,
35
+ containerProps: containerProps,
36
+ enableMouseEvents: enableMouseEvents,
37
+ innerRef: innerRef,
38
+ onlyRenderActiveTab: onlyRenderActiveTab,
39
+ onTabChange: onTabChange,
40
+ tabBarExtraContent: tabBarExtraContent,
41
+ tabsListAriaLabel: tabsListAriaLabel,
42
+ type: type,
43
+ withCarousel: withCarousel,
44
+ flexibleTabsHeaders: flexibleTabsHeaders,
45
+ fixedTabsHeaders: fixedTabsHeaders,
46
+ isDSMobile: isDSMobile
47
+ }, void 0, tabs);
48
+ };
46
49
 
47
50
  const props = {
48
51
  /** Whether the tab transition should animate or not */
@@ -1,5 +1,12 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
3
+ import 'core-js/modules/esnext.async-iterator.map.js';
4
+ import 'core-js/modules/esnext.iterator.map.js';
5
+ import 'core-js/modules/esnext.async-iterator.filter.js';
6
+ import 'core-js/modules/esnext.iterator.constructor.js';
7
+ import 'core-js/modules/esnext.iterator.filter.js';
8
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
9
+ import 'core-js/modules/esnext.iterator.for-each.js';
3
10
  import React from 'react';
4
11
  import { aggregatedClasses } from '@elliemae/ds-classnames';
5
12
  import { jsx } from 'react/jsx-runtime';
package/esm/SubTabBar.js CHANGED
@@ -5,35 +5,44 @@ import TabBar from './TabBar.js';
5
5
  import Carousel from './Carousel.js';
6
6
 
7
7
  const blockName = 'tabs-tab-bar';
8
- const SubTabList = aggregatedClasses('div')(blockName, 'subtabs-list', ({
9
- withCarousel
10
- }) => ({
11
- carousel: withCarousel
12
- }));
13
-
14
- const SubTabBar = ({
15
- withCarousel,
16
- tabs = [],
17
- activeTab = '',
18
- onTabClick = () => null,
19
- firstSubtabRef,
20
- handleUpArrow
21
- }) => /*#__PURE__*/_jsx(TabBar, {
22
- activeTab: activeTab,
23
- onTabClick: onTabClick,
24
- handleUpArrow: handleUpArrow,
25
- firstSubtabRef: firstSubtabRef,
26
- renderCustomTabBar: ({
27
- tabsComponents,
28
- innerRef
29
- }) => /*#__PURE__*/_jsx(SubTabList, {
30
- withCarousel: withCarousel,
31
- innerRef: innerRef,
32
- "data-testid": "subtabs-list"
33
- }, void 0, withCarousel ? /*#__PURE__*/_jsx(Carousel, {}, void 0, tabsComponents) : tabsComponents),
34
- showSelectionIndicator: false,
35
- showSeparator: true,
36
- tabs: tabs
8
+ const SubTabList = aggregatedClasses('div')(blockName, 'subtabs-list', _ref => {
9
+ let {
10
+ withCarousel
11
+ } = _ref;
12
+ return {
13
+ carousel: withCarousel
14
+ };
37
15
  });
38
16
 
17
+ const SubTabBar = _ref2 => {
18
+ let {
19
+ withCarousel,
20
+ tabs = [],
21
+ activeTab = '',
22
+ onTabClick = () => null,
23
+ firstSubtabRef,
24
+ handleUpArrow
25
+ } = _ref2;
26
+ return /*#__PURE__*/_jsx(TabBar, {
27
+ activeTab: activeTab,
28
+ onTabClick: onTabClick,
29
+ handleUpArrow: handleUpArrow,
30
+ firstSubtabRef: firstSubtabRef,
31
+ renderCustomTabBar: _ref3 => {
32
+ let {
33
+ tabsComponents,
34
+ innerRef
35
+ } = _ref3;
36
+ return /*#__PURE__*/_jsx(SubTabList, {
37
+ withCarousel: withCarousel,
38
+ innerRef: innerRef,
39
+ "data-testid": "subtabs-list"
40
+ }, void 0, withCarousel ? /*#__PURE__*/_jsx(Carousel, {}, void 0, tabsComponents) : tabsComponents);
41
+ },
42
+ showSelectionIndicator: false,
43
+ showSeparator: true,
44
+ tabs: tabs
45
+ });
46
+ };
47
+
39
48
  export { SubTabBar as default };
package/esm/TabBar.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
+ import 'core-js/modules/esnext.async-iterator.map.js';
4
+ import 'core-js/modules/esnext.iterator.map.js';
3
5
  import React, { Component } from 'react';
4
6
  import { debounce } from 'lodash';
5
7
  import { aggregatedClasses } from '@elliemae/ds-classnames';
@@ -14,36 +16,45 @@ const blockName = 'tabs-tab-bar';
14
16
  const gradientWidth = 24;
15
17
  const StyledTabWrapper = /*#__PURE__*/styled.div.withConfig({
16
18
  componentId: "sc-7sdovg-0"
17
- })(["display:flex;flex:1;flex-wrap:nowrap;", ";"], ({
18
- flexibleTabsHeaders
19
- }) => flexibleTabsHeaders ? '' : 'overflow-x: hidden');
20
- const StyledTabList = aggregatedClasses('div')(blockName, 'list', ({
21
- withCarousel,
22
- flexibleTabsHeaders,
23
- fixedTabsHeaders,
24
- isDSMobile,
25
- withLeftGradients,
26
- withRightGradients
27
- }) => ({
28
- carousel: withCarousel,
29
- 'flexible-table-headers': isDSMobile && flexibleTabsHeaders,
30
- 'fixed-table-headers': isDSMobile && fixedTabsHeaders,
31
- 'left-gradients': isDSMobile && flexibleTabsHeaders && withLeftGradients,
32
- 'right-gradients': isDSMobile && flexibleTabsHeaders && withRightGradients
33
- }), {
19
+ })(["display:flex;flex:1;flex-wrap:nowrap;", ";"], _ref => {
20
+ let {
21
+ flexibleTabsHeaders
22
+ } = _ref;
23
+ return flexibleTabsHeaders ? '' : 'overflow-x: hidden';
24
+ });
25
+ const StyledTabList = aggregatedClasses('div')(blockName, 'list', _ref2 => {
26
+ let {
27
+ withCarousel,
28
+ flexibleTabsHeaders,
29
+ fixedTabsHeaders,
30
+ isDSMobile,
31
+ withLeftGradients,
32
+ withRightGradients
33
+ } = _ref2;
34
+ return {
35
+ carousel: withCarousel,
36
+ 'flexible-table-headers': isDSMobile && flexibleTabsHeaders,
37
+ 'fixed-table-headers': isDSMobile && fixedTabsHeaders,
38
+ 'left-gradients': isDSMobile && flexibleTabsHeaders && withLeftGradients,
39
+ 'right-gradients': isDSMobile && flexibleTabsHeaders && withRightGradients
40
+ };
41
+ }, {
34
42
  propsToRemoveFromFinalElement: ['withCarousel', 'flexibleTabsHeaders', 'fixedTabsHeaders', 'withLeftGradients', 'withRightGradients', 'isDSMobile']
35
43
  });
36
44
  const TabContainer = aggregatedClasses('button', {
37
45
  role: 'tab'
38
- })(blockName, 'tab', ({
39
- isActive,
40
- showSeparator,
41
- disabled
42
- }) => ({
43
- active: isActive,
44
- separator: showSeparator,
45
- disabled
46
- }));
46
+ })(blockName, 'tab', _ref3 => {
47
+ let {
48
+ isActive,
49
+ showSeparator,
50
+ disabled
51
+ } = _ref3;
52
+ return {
53
+ active: isActive,
54
+ separator: showSeparator,
55
+ disabled
56
+ };
57
+ });
47
58
  const SelectionIndicator = aggregatedClasses('div')(blockName, 'selection-indicator');
48
59
 
49
60
  class TabBar extends Component {
@@ -187,7 +198,7 @@ class TabBar extends Component {
187
198
  disabled
188
199
  },
189
200
  "data-tab-id": tabId,
190
- id: `${tabId}-label`,
201
+ id: "".concat(tabId, "-label"),
191
202
  onClick: e => {
192
203
  if (!disabled) this.handleTabClick(tabId, e, index);
193
204
  },
@@ -284,7 +295,7 @@ class TabBar extends Component {
284
295
 
285
296
  getActiveTabElement(activeTab) {
286
297
  const tabListEl = this.tabListRef.current;
287
- const tabSelector = `[data-tab-id="${activeTab}"]`;
298
+ const tabSelector = "[data-tab-id=\"".concat(activeTab, "\"]");
288
299
  return tabListEl && tabListEl.querySelector(tabSelector);
289
300
  }
290
301
 
@@ -327,9 +338,9 @@ class TabBar extends Component {
327
338
  const width = withCarousel ? this.getVisibleDimensions(activeTabEl, tabListEl).width + 2 : clientWidth + 2;
328
339
  return {
329
340
  height: clientHeight,
330
- left: `${Math.floor(leftOff)}px`,
341
+ left: "".concat(Math.floor(leftOff), "px"),
331
342
  // using left and top for ie compatibility
332
- top: `${Math.floor(offsetTop)}px`,
343
+ top: "".concat(Math.floor(offsetTop), "px"),
333
344
  width
334
345
  };
335
346
  }
package/esm/TabTypes.js CHANGED
@@ -1,3 +1,6 @@
1
+ import 'core-js/modules/esnext.async-iterator.map.js';
2
+ import 'core-js/modules/esnext.iterator.map.js';
3
+
1
4
  const TabTypes = {
2
5
  NORMAL: 'normal',
3
6
  SUBTABS: 'subtabs'
package/esm/TabsImpl.js CHANGED
@@ -1,5 +1,11 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
7
  import _jsx from '@babel/runtime/helpers/esm/jsx';
8
+ import 'core-js/modules/web.dom-collections.iterator.js';
3
9
  import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
4
10
  import { aggregatedClasses } from '@elliemae/ds-classnames';
5
11
  import TabsPanels from './TabsPanels.js';
package/esm/TabsPanels.js CHANGED
@@ -1,5 +1,8 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
+ import 'core-js/modules/web.dom-collections.iterator.js';
4
+ import 'core-js/modules/esnext.async-iterator.map.js';
5
+ import 'core-js/modules/esnext.iterator.map.js';
3
6
  import React, { Component } from 'react';
4
7
  import memoizeOne from 'memoize-one';
5
8
  import { aggregatedClasses } from '@elliemae/ds-classnames';
@@ -14,8 +17,8 @@ const getIndexById = (children, activeId) => children && children.findIndex(item
14
17
  const getIdByIndex = (children, index) => children && children[index].props.tabId;
15
18
 
16
19
  class TabsPanels extends Component {
17
- constructor(...args) {
18
- super(...args);
20
+ constructor() {
21
+ super(...arguments);
19
22
 
20
23
  _defineProperty(this, "renderPanels", memoizeOne((activeTab, tabsComponents) => {
21
24
  const {
@@ -32,7 +35,7 @@ class TabsPanels extends Component {
32
35
  const isActive = activeTab === panelId;
33
36
  const shouldRender = !onlyRenderActiveTab || isActive;
34
37
  return /*#__PURE__*/_jsx(PanelContainer, {
35
- "aria-labelledby": `${panelId}-label`,
38
+ "aria-labelledby": "".concat(panelId, "-label"),
36
39
  lastTabRef: this.props.lastTabRef,
37
40
  firstSubtabRef: this.props.firstTabRefByParent,
38
41
  classProps: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-tabs",
3
- "version": "2.0.0-next.0",
3
+ "version": "2.0.0-next.13",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Tabs",
6
6
  "module": "./esm/index.js",
@@ -72,13 +72,13 @@
72
72
  "build": "node ../../scripts/build/build.js"
73
73
  },
74
74
  "dependencies": {
75
- "@elliemae/ds-button": "2.0.0-next.0",
76
- "@elliemae/ds-classnames": "2.0.0-next.0",
77
- "@elliemae/ds-form": "2.0.0-next.0",
78
- "@elliemae/ds-icons": "2.0.0-next.0",
75
+ "@elliemae/ds-button": "2.0.0-next.13",
76
+ "@elliemae/ds-classnames": "2.0.0-next.13",
77
+ "@elliemae/ds-form": "2.0.0-next.13",
78
+ "@elliemae/ds-icons": "2.0.0-next.13",
79
79
  "memoize-one": "~5.1.1",
80
80
  "prop-types": "~15.7.2",
81
- "react-desc": "^4.1.3",
81
+ "react-desc": "~4.1.3",
82
82
  "react-swipeable-views": "~0.13.9",
83
83
  "resize-observer": "~1.0.2"
84
84
  },
package/cjs/package.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "type": "commonjs",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ]
7
- }
package/esm/package.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "type": "module",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ]
7
- }