@elliemae/ds-pagination 2.4.2-rc.9 → 2.4.2

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.
@@ -2,7 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('core-js/modules/web.dom-collections.iterator.js');
6
5
  var react = require('react');
7
6
 
8
7
  const usePaginationSearch = (pageCount, actionRef) => {
@@ -1,7 +1,6 @@
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
4
  require('core-js/modules/esnext.async-iterator.map.js');
6
5
  require('core-js/modules/esnext.iterator.map.js');
7
6
  require('core-js/modules/esnext.async-iterator.reduce.js');
@@ -53,9 +52,9 @@ const Paginator = props => {
53
52
  type: 'single'
54
53
  };
55
54
 
56
- if (pageDetails !== null && pageDetails !== void 0 && pageDetails.length) {
55
+ if (pageDetails?.length) {
57
56
  option.render = () => /*#__PURE__*/_jsx__default["default"](Grid__default["default"], {
58
- cols: ['16px', "".concat(txtWidth + 16, "px"), 'auto'],
57
+ cols: ['16px', `${txtWidth + 16}px`, 'auto'],
59
58
  gutter: "xxs",
60
59
  alignItems: "center"
61
60
  }, void 0, pageIndex === index ? /*#__PURE__*/_jsx__default["default"](dsIcons.Checkmark, {
@@ -95,17 +94,13 @@ const Paginator = props => {
95
94
  [(pageIndex + 1).toString()]: true
96
95
  },
97
96
  onOptionClick: (_, clickedOption) => {
98
- var _btnRef$current;
99
-
100
97
  onPageChange(clickedOption.value);
101
98
  setIsOpened(false);
102
- (_btnRef$current = btnRef.current) === null || _btnRef$current === void 0 ? void 0 : _btnRef$current.focus();
99
+ btnRef.current?.focus();
103
100
  },
104
101
  onClickOutside: () => {
105
- var _btnRef$current2;
106
-
107
102
  setIsOpened(false);
108
- (_btnRef$current2 = btnRef.current) === null || _btnRef$current2 === void 0 ? void 0 : _btnRef$current2.focus();
103
+ btnRef.current?.focus();
109
104
  },
110
105
  customOffset: [-23, 2],
111
106
  startPlacementPreference: "top-start",
@@ -114,7 +109,7 @@ const Paginator = props => {
114
109
  minWidth: pageDetails.length !== 0 ? btnWidth + 23 : pageCount.toString().length * 6 + 90,
115
110
  maxHeight: 300,
116
111
  HeaderComp: () => pageDetailsTitle !== '' ? /*#__PURE__*/_jsx__default["default"](Grid__default["default"], {
117
- cols: ["".concat(txtWidth + 50, "px"), '8px', 'auto']
112
+ cols: [`${txtWidth + 50}px`, '8px', 'auto']
118
113
  }, void 0, /*#__PURE__*/_jsx__default["default"]("span", {
119
114
  style: {
120
115
  marginLeft: '8px'
@@ -3,7 +3,6 @@
3
3
  var _jsx = require('@babel/runtime/helpers/jsx');
4
4
  require('core-js/modules/esnext.async-iterator.map.js');
5
5
  require('core-js/modules/esnext.iterator.map.js');
6
- require('core-js/modules/web.dom-collections.iterator.js');
7
6
  require('core-js/modules/esnext.async-iterator.reduce.js');
8
7
  require('core-js/modules/esnext.iterator.constructor.js');
9
8
  require('core-js/modules/esnext.iterator.reduce.js');
@@ -61,11 +60,7 @@ const PerPageSelector = props => {
61
60
 
62
61
  }, [isOpened]);
63
62
  const width = react.useMemo(() => {
64
- const maxLength = options.reduce((acc, cur) => {
65
- var _length, _cur$label;
66
-
67
- return Math.max(acc, (_length = cur === null || cur === void 0 ? void 0 : (_cur$label = cur.label) === null || _cur$label === void 0 ? void 0 : _cur$label.length) !== null && _length !== void 0 ? _length : 0);
68
- }, 0);
63
+ const maxLength = options.reduce((acc, cur) => Math.max(acc, cur?.label?.length ?? 0), 0);
69
64
  return maxLength * 6 + 90;
70
65
  }, [options]);
71
66
  return /*#__PURE__*/_jsx__default["default"](dsDropdownmenu.DSDropdownMenuV2, {
@@ -75,17 +70,13 @@ const PerPageSelector = props => {
75
70
  [pageSize.toString()]: true
76
71
  },
77
72
  onOptionClick: (_, clickedOption) => {
78
- var _btnRef$current;
79
-
80
73
  onPageSizeChange(clickedOption.value);
81
74
  setIsOpened(false);
82
- (_btnRef$current = btnRef.current) === null || _btnRef$current === void 0 ? void 0 : _btnRef$current.focus();
75
+ btnRef.current?.focus();
83
76
  },
84
77
  onClickOutside: () => {
85
- var _btnRef$current2;
86
-
87
78
  setIsOpened(false);
88
- (_btnRef$current2 = btnRef.current) === null || _btnRef$current2 === void 0 ? void 0 : _btnRef$current2.focus();
79
+ btnRef.current?.focus();
89
80
  },
90
81
  customOffset: [10, 2],
91
82
  startPlacementPreference: "top-start",
package/cjs/styled.js CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
6
5
  var Grid = require('@elliemae/ds-grid');
7
6
  var dsButton = require('@elliemae/ds-button');
8
7
  var styled = require('styled-components');
@@ -11,17 +10,28 @@ var dsSystem = require('@elliemae/ds-system');
11
10
 
12
11
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
12
 
14
- var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
15
13
  var Grid__default = /*#__PURE__*/_interopDefaultLegacy(Grid);
16
14
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
17
15
 
18
- var _templateObject;
19
- const styledFocusCss = dsSystem.css(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ", ";\n pointer-events: none;\n z-index: 7;\n }\n"])), _ref => {
16
+ const styledFocusCss = dsSystem.css`
17
+ &:after {
18
+ display: block;
19
+ content: ' ';
20
+ position: absolute;
21
+ top: 0;
22
+ left: 0;
23
+ right: 0;
24
+ bottom: 0;
25
+ border: 2px solid ${_ref => {
20
26
  let {
21
27
  theme
22
28
  } = _ref;
23
29
  return theme.colors.brand[700];
24
- });
30
+ }};
31
+ pointer-events: none;
32
+ z-index: 7;
33
+ }
34
+ `;
25
35
  const PaginationContainer = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
26
36
  componentId: "sc-mxz59e-0"
27
37
  })(["height:42px;max-width:100%;align-items:center;box-shadow:0 -1px 3px 0 rgba(0,0,0,0.5);"]);
@@ -1,4 +1,3 @@
1
- import 'core-js/modules/web.dom-collections.iterator.js';
2
1
  import { useState, useRef, useEffect, useCallback } from 'react';
3
2
 
4
3
  const usePaginationSearch = (pageCount, actionRef) => {
@@ -1,5 +1,4 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
- import 'core-js/modules/web.dom-collections.iterator.js';
3
2
  import 'core-js/modules/esnext.async-iterator.map.js';
4
3
  import 'core-js/modules/esnext.iterator.map.js';
5
4
  import 'core-js/modules/esnext.async-iterator.reduce.js';
@@ -46,9 +45,9 @@ const Paginator = props => {
46
45
  type: 'single'
47
46
  };
48
47
 
49
- if (pageDetails !== null && pageDetails !== void 0 && pageDetails.length) {
48
+ if (pageDetails?.length) {
50
49
  option.render = () => /*#__PURE__*/_jsx(Grid, {
51
- cols: ['16px', "".concat(txtWidth + 16, "px"), 'auto'],
50
+ cols: ['16px', `${txtWidth + 16}px`, 'auto'],
52
51
  gutter: "xxs",
53
52
  alignItems: "center"
54
53
  }, void 0, pageIndex === index ? /*#__PURE__*/_jsx(Checkmark, {
@@ -88,17 +87,13 @@ const Paginator = props => {
88
87
  [(pageIndex + 1).toString()]: true
89
88
  },
90
89
  onOptionClick: (_, clickedOption) => {
91
- var _btnRef$current;
92
-
93
90
  onPageChange(clickedOption.value);
94
91
  setIsOpened(false);
95
- (_btnRef$current = btnRef.current) === null || _btnRef$current === void 0 ? void 0 : _btnRef$current.focus();
92
+ btnRef.current?.focus();
96
93
  },
97
94
  onClickOutside: () => {
98
- var _btnRef$current2;
99
-
100
95
  setIsOpened(false);
101
- (_btnRef$current2 = btnRef.current) === null || _btnRef$current2 === void 0 ? void 0 : _btnRef$current2.focus();
96
+ btnRef.current?.focus();
102
97
  },
103
98
  customOffset: [-23, 2],
104
99
  startPlacementPreference: "top-start",
@@ -107,7 +102,7 @@ const Paginator = props => {
107
102
  minWidth: pageDetails.length !== 0 ? btnWidth + 23 : pageCount.toString().length * 6 + 90,
108
103
  maxHeight: 300,
109
104
  HeaderComp: () => pageDetailsTitle !== '' ? /*#__PURE__*/_jsx(Grid, {
110
- cols: ["".concat(txtWidth + 50, "px"), '8px', 'auto']
105
+ cols: [`${txtWidth + 50}px`, '8px', 'auto']
111
106
  }, void 0, /*#__PURE__*/_jsx("span", {
112
107
  style: {
113
108
  marginLeft: '8px'
@@ -1,7 +1,6 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import 'core-js/modules/esnext.async-iterator.map.js';
3
3
  import 'core-js/modules/esnext.iterator.map.js';
4
- import 'core-js/modules/web.dom-collections.iterator.js';
5
4
  import 'core-js/modules/esnext.async-iterator.reduce.js';
6
5
  import 'core-js/modules/esnext.iterator.constructor.js';
7
6
  import 'core-js/modules/esnext.iterator.reduce.js';
@@ -54,11 +53,7 @@ const PerPageSelector = props => {
54
53
 
55
54
  }, [isOpened]);
56
55
  const width = useMemo(() => {
57
- const maxLength = options.reduce((acc, cur) => {
58
- var _length, _cur$label;
59
-
60
- return Math.max(acc, (_length = cur === null || cur === void 0 ? void 0 : (_cur$label = cur.label) === null || _cur$label === void 0 ? void 0 : _cur$label.length) !== null && _length !== void 0 ? _length : 0);
61
- }, 0);
56
+ const maxLength = options.reduce((acc, cur) => Math.max(acc, cur?.label?.length ?? 0), 0);
62
57
  return maxLength * 6 + 90;
63
58
  }, [options]);
64
59
  return /*#__PURE__*/_jsx(DSDropdownMenuV2, {
@@ -68,17 +63,13 @@ const PerPageSelector = props => {
68
63
  [pageSize.toString()]: true
69
64
  },
70
65
  onOptionClick: (_, clickedOption) => {
71
- var _btnRef$current;
72
-
73
66
  onPageSizeChange(clickedOption.value);
74
67
  setIsOpened(false);
75
- (_btnRef$current = btnRef.current) === null || _btnRef$current === void 0 ? void 0 : _btnRef$current.focus();
68
+ btnRef.current?.focus();
76
69
  },
77
70
  onClickOutside: () => {
78
- var _btnRef$current2;
79
-
80
71
  setIsOpened(false);
81
- (_btnRef$current2 = btnRef.current) === null || _btnRef$current2 === void 0 ? void 0 : _btnRef$current2.focus();
72
+ btnRef.current?.focus();
82
73
  },
83
74
  customOffset: [10, 2],
84
75
  startPlacementPreference: "top-start",
package/esm/styled.js CHANGED
@@ -1,17 +1,28 @@
1
- import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
2
1
  import Grid from '@elliemae/ds-grid';
3
2
  import { DSButtonV2 } from '@elliemae/ds-button';
4
3
  import styled from 'styled-components';
5
4
  import { typography, space, sizing, layout } from '@xstyled/styled-components';
6
5
  import { css } from '@elliemae/ds-system';
7
6
 
8
- var _templateObject;
9
- const styledFocusCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ", ";\n pointer-events: none;\n z-index: 7;\n }\n"])), _ref => {
7
+ const styledFocusCss = css`
8
+ &:after {
9
+ display: block;
10
+ content: ' ';
11
+ position: absolute;
12
+ top: 0;
13
+ left: 0;
14
+ right: 0;
15
+ bottom: 0;
16
+ border: 2px solid ${_ref => {
10
17
  let {
11
18
  theme
12
19
  } = _ref;
13
20
  return theme.colors.brand[700];
14
- });
21
+ }};
22
+ pointer-events: none;
23
+ z-index: 7;
24
+ }
25
+ `;
15
26
  const PaginationContainer = /*#__PURE__*/styled(Grid).withConfig({
16
27
  componentId: "sc-mxz59e-0"
17
28
  })(["height:42px;max-width:100%;align-items:center;box-shadow:0 -1px 3px 0 rgba(0,0,0,0.5);"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-pagination",
3
- "version": "2.4.2-rc.9",
3
+ "version": "2.4.2",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Pagination",
6
6
  "module": "./esm/index.js",
@@ -72,14 +72,14 @@
72
72
  "build": "node ../../scripts/build/build.js"
73
73
  },
74
74
  "dependencies": {
75
- "@elliemae/ds-button": "2.4.2-rc.9",
76
- "@elliemae/ds-dropdownmenu": "2.4.2-rc.9",
77
- "@elliemae/ds-grid": "2.4.2-rc.9",
78
- "@elliemae/ds-icons": "2.4.2-rc.9",
79
- "@elliemae/ds-props-helpers": "2.4.2-rc.9",
80
- "@elliemae/ds-system": "2.4.2-rc.9",
81
- "@elliemae/ds-truncated-tooltip-text": "2.4.2-rc.9",
82
- "@elliemae/ds-utilities": "2.4.2-rc.9",
75
+ "@elliemae/ds-button": "2.4.2",
76
+ "@elliemae/ds-dropdownmenu": "2.4.2",
77
+ "@elliemae/ds-grid": "2.4.2",
78
+ "@elliemae/ds-icons": "2.4.2",
79
+ "@elliemae/ds-props-helpers": "2.4.2",
80
+ "@elliemae/ds-system": "2.4.2",
81
+ "@elliemae/ds-truncated-tooltip-text": "2.4.2",
82
+ "@elliemae/ds-utilities": "2.4.2",
83
83
  "@xstyled/styled-components": "~3.1.1",
84
84
  "memoize-one": "~5.1.1"
85
85
  },