@elliemae/ds-page-number 2.0.0-alpha.11 → 2.0.0-alpha.12
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/DSPageNumber.js +11 -12
- package/esm/DSPageNumber.js +7 -4
- package/package.json +9 -7
- package/types/DSPageNumber.d.ts +55 -9
package/cjs/DSPageNumber.js
CHANGED
|
@@ -6,14 +6,17 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
6
6
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
7
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
8
8
|
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
9
14
|
var react = require('react');
|
|
10
15
|
var reactDesc = require('react-desc');
|
|
11
16
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
12
|
-
var
|
|
13
|
-
var ChevronSmallUp = require('@elliemae/ds-icons/ChevronSmallUp');
|
|
17
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
14
18
|
var DSButton = require('@elliemae/ds-button');
|
|
15
|
-
var
|
|
16
|
-
var DSInput = require('@elliemae/ds-form/Input');
|
|
19
|
+
var dsForm = require('@elliemae/ds-form');
|
|
17
20
|
var utils = require('./components/utils.js');
|
|
18
21
|
var jsxRuntime = require('react/jsx-runtime');
|
|
19
22
|
|
|
@@ -22,11 +25,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
22
25
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
23
26
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
24
27
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
25
|
-
var ChevronSmallDown__default = /*#__PURE__*/_interopDefaultLegacy(ChevronSmallDown);
|
|
26
|
-
var ChevronSmallUp__default = /*#__PURE__*/_interopDefaultLegacy(ChevronSmallUp);
|
|
27
28
|
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
28
|
-
var DSInputGroup__default = /*#__PURE__*/_interopDefaultLegacy(DSInputGroup);
|
|
29
|
-
var DSInput__default = /*#__PURE__*/_interopDefaultLegacy(DSInput);
|
|
30
29
|
|
|
31
30
|
var _ChevronSmallUp, _ChevronSmallDown;
|
|
32
31
|
|
|
@@ -36,7 +35,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
36
35
|
|
|
37
36
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
38
37
|
const blockName = 'page-number-block';
|
|
39
|
-
const PageNumberInputContainer = dsClassnames.aggregatedClasses(
|
|
38
|
+
const PageNumberInputContainer = dsClassnames.aggregatedClasses(dsForm.DSInputGroup)(blockName);
|
|
40
39
|
|
|
41
40
|
const DSPageNumber = _ref => {
|
|
42
41
|
let {
|
|
@@ -96,7 +95,7 @@ const DSPageNumber = _ref => {
|
|
|
96
95
|
}, containerProps), otherProps), {}, {
|
|
97
96
|
children: /*#__PURE__*/_jsx__default["default"](PageNumberInputContainer, {}, void 0, /*#__PURE__*/_jsx__default["default"]("div", {
|
|
98
97
|
className: "".concat(classNameElement('pages'))
|
|
99
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](
|
|
98
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](dsForm.DSInput, {
|
|
100
99
|
className: "".concat(classNameElement('input')),
|
|
101
100
|
"data-testid": "page-number__current-page",
|
|
102
101
|
onChange: handleUpdateInput,
|
|
@@ -119,14 +118,14 @@ const DSPageNumber = _ref => {
|
|
|
119
118
|
buttonType: "text",
|
|
120
119
|
className: "dropdown-indicator",
|
|
121
120
|
"data-testid": "page-number__increase",
|
|
122
|
-
icon: _ChevronSmallUp || (_ChevronSmallUp = /*#__PURE__*/_jsx__default["default"](
|
|
121
|
+
icon: _ChevronSmallUp || (_ChevronSmallUp = /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronSmallUp, {})),
|
|
123
122
|
onClick: handleIncrease
|
|
124
123
|
}), /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
|
|
125
124
|
"aria-label": "dropdown-indicator",
|
|
126
125
|
buttonType: "text",
|
|
127
126
|
className: "dropdown-indicator",
|
|
128
127
|
"data-testid": "page-number__decrease",
|
|
129
|
-
icon: _ChevronSmallDown || (_ChevronSmallDown = /*#__PURE__*/_jsx__default["default"](
|
|
128
|
+
icon: _ChevronSmallDown || (_ChevronSmallDown = /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronSmallDown, {})),
|
|
130
129
|
onClick: handleDecrease
|
|
131
130
|
}))
|
|
132
131
|
}));
|
package/esm/DSPageNumber.js
CHANGED
|
@@ -2,14 +2,17 @@ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
|
2
2
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
4
|
import 'core-js/modules/web.dom-collections.iterator.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';
|
|
5
10
|
import { useRef, useState, useEffect } from 'react';
|
|
6
11
|
import { PropTypes, describe } from 'react-desc';
|
|
7
12
|
import { aggregatedClasses, convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
8
|
-
import ChevronSmallDown from '@elliemae/ds-icons
|
|
9
|
-
import ChevronSmallUp from '@elliemae/ds-icons/ChevronSmallUp';
|
|
13
|
+
import { ChevronSmallUp, ChevronSmallDown } from '@elliemae/ds-icons';
|
|
10
14
|
import DSButton from '@elliemae/ds-button';
|
|
11
|
-
import DSInputGroup from '@elliemae/ds-form
|
|
12
|
-
import DSInput from '@elliemae/ds-form/Input';
|
|
15
|
+
import { DSInputGroup, DSInput } from '@elliemae/ds-form';
|
|
13
16
|
import { cleanPage, lengthToSize } from './components/utils.js';
|
|
14
17
|
import { jsx } from 'react/jsx-runtime';
|
|
15
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-page-number",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Page Number",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -40,20 +40,22 @@
|
|
|
40
40
|
"build": "node ../../scripts/build/build.js"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elliemae/ds-button": "2.0.0-alpha.
|
|
44
|
-
"@elliemae/ds-classnames": "2.0.0-alpha.
|
|
45
|
-
"@elliemae/ds-form": "2.0.0-alpha.
|
|
46
|
-
"@elliemae/ds-icons": "2.0.0-alpha.
|
|
43
|
+
"@elliemae/ds-button": "2.0.0-alpha.12",
|
|
44
|
+
"@elliemae/ds-classnames": "2.0.0-alpha.12",
|
|
45
|
+
"@elliemae/ds-form": "2.0.0-alpha.12",
|
|
46
|
+
"@elliemae/ds-icons": "2.0.0-alpha.12",
|
|
47
47
|
"react-desc": "~4.1.3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"
|
|
50
|
+
"@testing-library/jest-dom": "~5.15.0",
|
|
51
|
+
"@testing-library/react": "~12.1.2",
|
|
52
|
+
"styled-components": "~5.3.3"
|
|
51
53
|
},
|
|
52
54
|
"peerDependencies": {
|
|
53
55
|
"lodash": "^4.17.21",
|
|
54
56
|
"react": "^17.0.2",
|
|
55
57
|
"react-dom": "^17.0.2",
|
|
56
|
-
"styled-components": "^5.3.
|
|
58
|
+
"styled-components": "^5.3.3"
|
|
57
59
|
},
|
|
58
60
|
"publishConfig": {
|
|
59
61
|
"access": "public",
|
package/types/DSPageNumber.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
/// <reference types="react" />
|
|
2
3
|
declare const DSPageNumber: {
|
|
3
4
|
({ className, disabled, value, onChange, containerProps, currentPage, totalPages, separator, ...otherProps }: {
|
|
@@ -12,14 +13,45 @@ declare const DSPageNumber: {
|
|
|
12
13
|
separator: any;
|
|
13
14
|
}): JSX.Element;
|
|
14
15
|
propTypes: {
|
|
15
|
-
className:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
className: {
|
|
17
|
+
defaultValue<T = unknown>(arg: T): {
|
|
18
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
19
|
+
};
|
|
20
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
21
|
+
};
|
|
22
|
+
containerProps: {
|
|
23
|
+
defaultValue<T = unknown>(arg: T): {
|
|
24
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
25
|
+
};
|
|
26
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
27
|
+
};
|
|
28
|
+
disabled: {
|
|
29
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
30
|
+
};
|
|
31
|
+
value: {
|
|
32
|
+
defaultValue<T = unknown>(arg: T): {
|
|
33
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
34
|
+
};
|
|
35
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
36
|
+
};
|
|
37
|
+
onChange: {
|
|
38
|
+
defaultValue<T = unknown>(arg: T): {
|
|
39
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
40
|
+
};
|
|
41
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
42
|
+
};
|
|
43
|
+
currentPage: {
|
|
44
|
+
defaultValue<T = unknown>(arg: T): {
|
|
45
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
46
|
+
};
|
|
47
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
48
|
+
};
|
|
49
|
+
totalPages: {
|
|
50
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
51
|
+
};
|
|
52
|
+
separator: {
|
|
53
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
54
|
+
};
|
|
23
55
|
};
|
|
24
56
|
defaultProps: {
|
|
25
57
|
className: string;
|
|
@@ -32,6 +64,20 @@ declare const DSPageNumber: {
|
|
|
32
64
|
separator: string;
|
|
33
65
|
};
|
|
34
66
|
};
|
|
35
|
-
declare const PageNumberWithSchema:
|
|
67
|
+
declare const PageNumberWithSchema: {
|
|
68
|
+
(props?: {
|
|
69
|
+
[x: string]: any;
|
|
70
|
+
className: any;
|
|
71
|
+
disabled: any;
|
|
72
|
+
value: any;
|
|
73
|
+
onChange: any;
|
|
74
|
+
containerProps: any;
|
|
75
|
+
currentPage: any;
|
|
76
|
+
totalPages: any;
|
|
77
|
+
separator: any;
|
|
78
|
+
} | undefined): JSX.Element;
|
|
79
|
+
propTypes: unknown;
|
|
80
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
81
|
+
};
|
|
36
82
|
export { DSPageNumber, PageNumberWithSchema };
|
|
37
83
|
export default DSPageNumber;
|