@elliemae/ds-progress-indicator 1.60.0 → 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/DSProgressIndicator.js +55 -61
- package/cjs/ProgressBar.js +36 -46
- package/cjs/ProgressCounter.js +27 -24
- package/cjs/classedComponents.js +17 -17
- package/cjs/index.js +1 -13
- package/cjs/utils.js +0 -1
- package/esm/DSProgressIndicator.js +52 -58
- package/esm/ProgressBar.js +34 -43
- package/esm/ProgressCounter.js +26 -23
- package/esm/classedComponents.js +17 -13
- package/esm/index.js +0 -12
- package/esm/utils.js +0 -1
- package/package.json +47 -10
- package/types/DSProgressIndicator.d.ts +101 -0
- package/types/ProgressBar.d.ts +24 -0
- package/types/ProgressCounter.d.ts +12 -0
- package/types/classedComponents.d.ts +7 -0
- package/types/index.d.ts +2 -0
- package/types/utils.d.ts +1 -0
- package/DSProgressIndicator/package.json +0 -10
- package/ProgressBar/package.json +0 -10
- package/ProgressCounter/package.json +0 -10
- package/cjs/DSProgressIndicator.js.map +0 -1
- package/cjs/ProgressBar.js.map +0 -1
- package/cjs/ProgressCounter.js.map +0 -1
- package/cjs/classedComponents.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/utils.js.map +0 -1
- package/classedComponents/package.json +0 -10
- package/esm/DSProgressIndicator.js.map +0 -1
- package/esm/ProgressBar.js.map +0 -1
- package/esm/ProgressCounter.js.map +0 -1
- package/esm/classedComponents.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/utils.js.map +0 -1
- package/utils/package.json +0 -10
|
@@ -2,79 +2,75 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var _jsx2 = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.map.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');
|
|
14
|
+
var react = require('react');
|
|
7
15
|
var reactDesc = require('react-desc');
|
|
8
16
|
var DSTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
|
|
9
17
|
var ProgressCounter = require('./ProgressCounter.js');
|
|
10
18
|
var ProgressBar = require('./ProgressBar.js');
|
|
11
19
|
var classedComponents = require('./classedComponents.js');
|
|
12
|
-
require('
|
|
13
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
14
|
-
require('@elliemae/ds-classnames');
|
|
15
|
-
require('prop-types');
|
|
20
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
16
21
|
|
|
17
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
23
|
|
|
19
|
-
var
|
|
20
|
-
var
|
|
24
|
+
var _jsx2__default = /*#__PURE__*/_interopDefaultLegacy(_jsx2);
|
|
25
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
21
26
|
var DSTruncatedTooltipText__default = /*#__PURE__*/_interopDefaultLegacy(DSTruncatedTooltipText);
|
|
22
27
|
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return !(segmentProps.now < segmentProps.min) && /*#__PURE__*/React__default['default'].createElement(ProgressBar.Segment, _extends__default['default']({
|
|
49
|
-
key: i
|
|
50
|
-
}, segmentProps));
|
|
51
|
-
})) : /*#__PURE__*/React__default['default'].createElement(ProgressBar, {
|
|
52
|
-
max: max,
|
|
53
|
-
min: min,
|
|
54
|
-
now: now
|
|
55
|
-
});
|
|
56
|
-
}, [segments, min, max, now]);
|
|
57
|
-
return /*#__PURE__*/React__default['default'].createElement(classedComponents.Wrapper, _extends__default['default']({
|
|
28
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
const DSProgressIndicator = _ref => {
|
|
33
|
+
var _ProgressBar;
|
|
34
|
+
|
|
35
|
+
let {
|
|
36
|
+
containerProps = {},
|
|
37
|
+
innerRef = () => null,
|
|
38
|
+
title = '',
|
|
39
|
+
counterRenderer = undefined,
|
|
40
|
+
now = undefined,
|
|
41
|
+
min = 0,
|
|
42
|
+
max = undefined,
|
|
43
|
+
disabled = false,
|
|
44
|
+
segments = [],
|
|
45
|
+
style = {}
|
|
46
|
+
} = _ref;
|
|
47
|
+
const renderProgressBar = react.useMemo(() => segments.length ? /*#__PURE__*/_jsx2__default["default"](ProgressBar, {}, void 0, segments.map((segmentProps, i) => !(segmentProps.now < segmentProps.min) && /*#__PURE__*/jsxRuntime.jsx(ProgressBar.Segment, _objectSpread({}, segmentProps), i))) : _ProgressBar || (_ProgressBar = /*#__PURE__*/_jsx2__default["default"](ProgressBar, {
|
|
48
|
+
max: max,
|
|
49
|
+
min: min,
|
|
50
|
+
now: now
|
|
51
|
+
})), [segments, min, max, now]);
|
|
52
|
+
return /*#__PURE__*/jsxRuntime.jsxs(classedComponents.Wrapper, _objectSpread(_objectSpread({
|
|
58
53
|
ref: innerRef,
|
|
59
54
|
"aria-disabled": disabled,
|
|
60
55
|
classProps: {
|
|
61
|
-
disabled
|
|
56
|
+
disabled
|
|
62
57
|
}
|
|
63
|
-
}, containerProps, {
|
|
64
|
-
style: style
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
58
|
+
}, containerProps), {}, {
|
|
59
|
+
style: style,
|
|
60
|
+
children: [/*#__PURE__*/_jsx2__default["default"](DSTruncatedTooltipText__default["default"], {
|
|
61
|
+
containerComponent: classedComponents.Title,
|
|
62
|
+
value: title
|
|
63
|
+
}), /*#__PURE__*/_jsx2__default["default"](ProgressCounter, {
|
|
64
|
+
max: max,
|
|
65
|
+
min: min,
|
|
66
|
+
now: now,
|
|
67
|
+
renderer: counterRenderer
|
|
68
|
+
}), renderProgressBar]
|
|
69
|
+
}));
|
|
74
70
|
};
|
|
75
71
|
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
const variants = ['default', 'success', 'warning', 'info', 'error'];
|
|
73
|
+
const progressIndicatorProps = {
|
|
78
74
|
containerProps: reactDesc.PropTypes.object.description('Set of Properties attached to the main container'),
|
|
79
75
|
innerRef: reactDesc.PropTypes.object.description('ref to the components container'),
|
|
80
76
|
title: reactDesc.PropTypes.string.description('components title'),
|
|
@@ -87,12 +83,10 @@ var progressIndicatorProps = {
|
|
|
87
83
|
segments: reactDesc.PropTypes.array.description('An array of multiple progress objects'),
|
|
88
84
|
style: reactDesc.PropTypes.object.description('css inline style')
|
|
89
85
|
};
|
|
90
|
-
|
|
91
|
-
var ProgressIndicatorWithSchema = reactDesc.describe(DSProgressIndicator);
|
|
86
|
+
const ProgressIndicatorWithSchema = reactDesc.describe(DSProgressIndicator);
|
|
92
87
|
ProgressIndicatorWithSchema.propTypes = progressIndicatorProps;
|
|
93
88
|
DSProgressIndicator.ProgressBar = ProgressBar;
|
|
94
89
|
|
|
95
90
|
exports.DSProgressIndicator = DSProgressIndicator;
|
|
96
91
|
exports.ProgressIndicatorWithSchema = ProgressIndicatorWithSchema;
|
|
97
|
-
exports[
|
|
98
|
-
//# sourceMappingURL=DSProgressIndicator.js.map
|
|
92
|
+
exports["default"] = DSProgressIndicator;
|
package/cjs/ProgressBar.js
CHANGED
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
4
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
5
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
+
var _jsx2 = require('@babel/runtime/helpers/jsx');
|
|
9
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
10
|
+
require('react');
|
|
6
11
|
var utils = require('./utils.js');
|
|
7
12
|
var classedComponents = require('./classedComponents.js');
|
|
8
|
-
require('
|
|
9
|
-
require('@elliemae/ds-classnames');
|
|
13
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
14
|
|
|
11
15
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
16
|
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
|
|
17
|
+
var _jsx2__default = /*#__PURE__*/_interopDefaultLegacy(_jsx2);
|
|
18
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
19
|
+
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
16
23
|
|
|
17
24
|
function useProgressTrait(_ref) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
text = _ref$text === void 0 ? '' : _ref$text;
|
|
26
|
-
var percentage = utils.getPercentage(now, min, max);
|
|
25
|
+
let {
|
|
26
|
+
now = undefined,
|
|
27
|
+
min = undefined,
|
|
28
|
+
max = undefined,
|
|
29
|
+
text = ''
|
|
30
|
+
} = _ref;
|
|
31
|
+
const percentage = utils.getPercentage(now, min, max);
|
|
27
32
|
return {
|
|
28
33
|
role: 'progressbar',
|
|
29
34
|
'aria-valuenow': now,
|
|
@@ -37,27 +42,26 @@ function useProgressTrait(_ref) {
|
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
function Progress(props) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
const {
|
|
46
|
+
variant = 'default'
|
|
47
|
+
} = props;
|
|
48
|
+
const progressTraitProps = useProgressTrait(props);
|
|
49
|
+
return /*#__PURE__*/jsxRuntime.jsx(classedComponents.ProgressBarProgress, _objectSpread({
|
|
44
50
|
classProps: {
|
|
45
|
-
variant
|
|
51
|
+
variant
|
|
46
52
|
}
|
|
47
53
|
}, progressTraitProps));
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
function ProgressBar(_ref2) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
progressSegments = _ref2.children;
|
|
60
|
-
return /*#__PURE__*/React__default['default'].createElement(classedComponents.ProgressBarStatusBar, null, progressSegments || /*#__PURE__*/React__default['default'].createElement(Progress, {
|
|
57
|
+
let {
|
|
58
|
+
variant = 'default',
|
|
59
|
+
now = undefined,
|
|
60
|
+
min = undefined,
|
|
61
|
+
max = undefined,
|
|
62
|
+
children: progressSegments
|
|
63
|
+
} = _ref2;
|
|
64
|
+
return /*#__PURE__*/_jsx2__default["default"](classedComponents.ProgressBarStatusBar, {}, void 0, progressSegments || /*#__PURE__*/_jsx2__default["default"](Progress, {
|
|
61
65
|
max: max,
|
|
62
66
|
min: min,
|
|
63
67
|
now: now,
|
|
@@ -66,19 +70,5 @@ function ProgressBar(_ref2) {
|
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
ProgressBar.Segment = Progress;
|
|
69
|
-
ProgressBar.propTypes = {
|
|
70
|
-
/** Progress intent variation */
|
|
71
|
-
variant: PropTypes__default['default'].oneOf(['default', 'success', 'warning', 'info', 'error']),
|
|
72
|
-
|
|
73
|
-
/** Total current value */
|
|
74
|
-
now: PropTypes__default['default'].number,
|
|
75
|
-
|
|
76
|
-
/** Min value */
|
|
77
|
-
min: PropTypes__default['default'].number,
|
|
78
|
-
|
|
79
|
-
/** Total max */
|
|
80
|
-
max: PropTypes__default['default'].number
|
|
81
|
-
};
|
|
82
73
|
|
|
83
74
|
module.exports = ProgressBar;
|
|
84
|
-
//# sourceMappingURL=ProgressBar.js.map
|
package/cjs/ProgressCounter.js
CHANGED
|
@@ -1,47 +1,50 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _jsx2 = require('@babel/runtime/helpers/jsx');
|
|
4
|
+
require('react');
|
|
4
5
|
var utils = require('./utils.js');
|
|
5
6
|
var classedComponents = require('./classedComponents.js');
|
|
6
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
7
|
-
require('@elliemae/ds-classnames');
|
|
8
7
|
|
|
9
8
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
9
|
|
|
11
|
-
var
|
|
10
|
+
var _jsx2__default = /*#__PURE__*/_interopDefaultLegacy(_jsx2);
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
const defaultRenderer = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
now,
|
|
15
|
+
max,
|
|
16
|
+
min
|
|
17
|
+
} = _ref;
|
|
17
18
|
return "".concat(min || now, " of ").concat(max);
|
|
18
19
|
};
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const percentageRenderer = _ref2 => {
|
|
22
|
+
let {
|
|
23
|
+
now,
|
|
24
|
+
max,
|
|
25
|
+
min
|
|
26
|
+
} = _ref2;
|
|
27
|
+
const percentage = utils.getPercentage(now, min, max);
|
|
25
28
|
return "".concat(percentage, "%");
|
|
26
29
|
};
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
const renderers = {
|
|
29
32
|
default: defaultRenderer,
|
|
30
33
|
percentage: percentageRenderer
|
|
31
34
|
};
|
|
32
35
|
|
|
33
36
|
function ProgressCounter(_ref3) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
let {
|
|
38
|
+
now,
|
|
39
|
+
max,
|
|
40
|
+
min,
|
|
41
|
+
renderer = renderers.default
|
|
42
|
+
} = _ref3;
|
|
43
|
+
return /*#__PURE__*/_jsx2__default["default"](classedComponents.ProgressIndicatorCounter, {}, void 0, renderer({
|
|
44
|
+
now,
|
|
45
|
+
max,
|
|
46
|
+
min
|
|
43
47
|
}));
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
module.exports = ProgressCounter;
|
|
47
|
-
//# sourceMappingURL=ProgressCounter.js.map
|
package/cjs/classedComponents.js
CHANGED
|
@@ -2,27 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
5
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var Wrapper = dsClassnames.aggregatedClasses('div')(blockName, null, function (_ref) {
|
|
15
|
-
var disabled = _ref.disabled;
|
|
7
|
+
const blockName = 'determinate-progress-indicator';
|
|
8
|
+
const progressBlockName = 'progress-bar';
|
|
9
|
+
const Wrapper = dsClassnames.aggregatedClasses('div')(blockName, null, _ref => {
|
|
10
|
+
let {
|
|
11
|
+
disabled
|
|
12
|
+
} = _ref;
|
|
16
13
|
return {
|
|
17
|
-
disabled
|
|
14
|
+
disabled
|
|
18
15
|
};
|
|
19
16
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
const Title = dsClassnames.aggregatedClasses('div')(blockName, 'title');
|
|
18
|
+
const ProgressIndicatorCounter = dsClassnames.aggregatedClasses('span')(blockName, 'counter');
|
|
19
|
+
const ProgressBarStatusBar = dsClassnames.aggregatedClasses('div')(progressBlockName);
|
|
20
|
+
const ProgressBarProgress = dsClassnames.aggregatedClasses('div')(progressBlockName, 'progress', _ref2 => {
|
|
21
|
+
let {
|
|
22
|
+
variant
|
|
23
|
+
} = _ref2;
|
|
24
|
+
return {
|
|
25
|
+
[variant]: true
|
|
26
|
+
};
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
exports.ProgressBarProgress = ProgressBarProgress;
|
|
@@ -31,4 +32,3 @@ exports.ProgressIndicatorCounter = ProgressIndicatorCounter;
|
|
|
31
32
|
exports.Title = Title;
|
|
32
33
|
exports.Wrapper = Wrapper;
|
|
33
34
|
exports.blockName = blockName;
|
|
34
|
-
//# sourceMappingURL=classedComponents.js.map
|
package/cjs/index.js
CHANGED
|
@@ -3,21 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var DSProgressIndicator = require('./DSProgressIndicator.js');
|
|
6
|
-
require('@babel/runtime/helpers/extends');
|
|
7
|
-
require('react');
|
|
8
|
-
require('react-desc');
|
|
9
|
-
require('@elliemae/ds-truncated-tooltip-text');
|
|
10
|
-
require('./ProgressCounter.js');
|
|
11
|
-
require('./utils.js');
|
|
12
|
-
require('./classedComponents.js');
|
|
13
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
14
|
-
require('@elliemae/ds-classnames');
|
|
15
|
-
require('./ProgressBar.js');
|
|
16
|
-
require('prop-types');
|
|
17
6
|
|
|
18
7
|
|
|
19
8
|
|
|
20
9
|
exports.DSProgressIndicator = DSProgressIndicator.DSProgressIndicator;
|
|
21
10
|
exports.ProgressIndicatorWithSchema = DSProgressIndicator.ProgressIndicatorWithSchema;
|
|
22
|
-
exports
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
11
|
+
exports["default"] = DSProgressIndicator.DSProgressIndicator;
|
package/cjs/utils.js
CHANGED
|
@@ -1,70 +1,66 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import _jsx2 from '@babel/runtime/helpers/esm/jsx';
|
|
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';
|
|
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';
|
|
10
|
+
import { useMemo } from 'react';
|
|
3
11
|
import { PropTypes, describe } from 'react-desc';
|
|
4
12
|
import DSTruncatedTooltipText from '@elliemae/ds-truncated-tooltip-text';
|
|
5
13
|
import ProgressCounter from './ProgressCounter.js';
|
|
6
14
|
import ProgressBar from './ProgressBar.js';
|
|
7
15
|
import { Wrapper, Title } from './classedComponents.js';
|
|
8
|
-
import '
|
|
9
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
10
|
-
import '@elliemae/ds-classnames';
|
|
11
|
-
import 'prop-types';
|
|
16
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
17
|
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return !(segmentProps.now < segmentProps.min) && /*#__PURE__*/React.createElement(ProgressBar.Segment, _extends({
|
|
39
|
-
key: i
|
|
40
|
-
}, segmentProps));
|
|
41
|
-
})) : /*#__PURE__*/React.createElement(ProgressBar, {
|
|
42
|
-
max: max,
|
|
43
|
-
min: min,
|
|
44
|
-
now: now
|
|
45
|
-
});
|
|
46
|
-
}, [segments, min, max, now]);
|
|
47
|
-
return /*#__PURE__*/React.createElement(Wrapper, _extends({
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
|
|
20
|
+
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(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; }
|
|
21
|
+
|
|
22
|
+
const DSProgressIndicator = _ref => {
|
|
23
|
+
var _ProgressBar;
|
|
24
|
+
|
|
25
|
+
let {
|
|
26
|
+
containerProps = {},
|
|
27
|
+
innerRef = () => null,
|
|
28
|
+
title = '',
|
|
29
|
+
counterRenderer = undefined,
|
|
30
|
+
now = undefined,
|
|
31
|
+
min = 0,
|
|
32
|
+
max = undefined,
|
|
33
|
+
disabled = false,
|
|
34
|
+
segments = [],
|
|
35
|
+
style = {}
|
|
36
|
+
} = _ref;
|
|
37
|
+
const renderProgressBar = useMemo(() => segments.length ? /*#__PURE__*/_jsx2(ProgressBar, {}, void 0, segments.map((segmentProps, i) => !(segmentProps.now < segmentProps.min) && /*#__PURE__*/jsx(ProgressBar.Segment, _objectSpread({}, segmentProps), i))) : _ProgressBar || (_ProgressBar = /*#__PURE__*/_jsx2(ProgressBar, {
|
|
38
|
+
max: max,
|
|
39
|
+
min: min,
|
|
40
|
+
now: now
|
|
41
|
+
})), [segments, min, max, now]);
|
|
42
|
+
return /*#__PURE__*/jsxs(Wrapper, _objectSpread(_objectSpread({
|
|
48
43
|
ref: innerRef,
|
|
49
44
|
"aria-disabled": disabled,
|
|
50
45
|
classProps: {
|
|
51
|
-
disabled
|
|
46
|
+
disabled
|
|
52
47
|
}
|
|
53
|
-
}, containerProps, {
|
|
54
|
-
style: style
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
48
|
+
}, containerProps), {}, {
|
|
49
|
+
style: style,
|
|
50
|
+
children: [/*#__PURE__*/_jsx2(DSTruncatedTooltipText, {
|
|
51
|
+
containerComponent: Title,
|
|
52
|
+
value: title
|
|
53
|
+
}), /*#__PURE__*/_jsx2(ProgressCounter, {
|
|
54
|
+
max: max,
|
|
55
|
+
min: min,
|
|
56
|
+
now: now,
|
|
57
|
+
renderer: counterRenderer
|
|
58
|
+
}), renderProgressBar]
|
|
59
|
+
}));
|
|
64
60
|
};
|
|
65
61
|
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
const variants = ['default', 'success', 'warning', 'info', 'error'];
|
|
63
|
+
const progressIndicatorProps = {
|
|
68
64
|
containerProps: PropTypes.object.description('Set of Properties attached to the main container'),
|
|
69
65
|
innerRef: PropTypes.object.description('ref to the components container'),
|
|
70
66
|
title: PropTypes.string.description('components title'),
|
|
@@ -77,10 +73,8 @@ var progressIndicatorProps = {
|
|
|
77
73
|
segments: PropTypes.array.description('An array of multiple progress objects'),
|
|
78
74
|
style: PropTypes.object.description('css inline style')
|
|
79
75
|
};
|
|
80
|
-
|
|
81
|
-
var ProgressIndicatorWithSchema = describe(DSProgressIndicator);
|
|
76
|
+
const ProgressIndicatorWithSchema = describe(DSProgressIndicator);
|
|
82
77
|
ProgressIndicatorWithSchema.propTypes = progressIndicatorProps;
|
|
83
78
|
DSProgressIndicator.ProgressBar = ProgressBar;
|
|
84
79
|
|
|
85
80
|
export { DSProgressIndicator, ProgressIndicatorWithSchema, DSProgressIndicator as default };
|
|
86
|
-
//# sourceMappingURL=DSProgressIndicator.js.map
|
package/esm/ProgressBar.js
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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';
|
|
6
|
+
import _jsx2 from '@babel/runtime/helpers/esm/jsx';
|
|
7
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
8
|
+
import 'react';
|
|
4
9
|
import { getPercentage } from './utils.js';
|
|
5
10
|
import { ProgressBarStatusBar, ProgressBarProgress } from './classedComponents.js';
|
|
6
|
-
import '
|
|
7
|
-
|
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
|
|
15
|
+
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(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; }
|
|
8
16
|
|
|
9
17
|
function useProgressTrait(_ref) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
text = _ref$text === void 0 ? '' : _ref$text;
|
|
18
|
-
var percentage = getPercentage(now, min, max);
|
|
18
|
+
let {
|
|
19
|
+
now = undefined,
|
|
20
|
+
min = undefined,
|
|
21
|
+
max = undefined,
|
|
22
|
+
text = ''
|
|
23
|
+
} = _ref;
|
|
24
|
+
const percentage = getPercentage(now, min, max);
|
|
19
25
|
return {
|
|
20
26
|
role: 'progressbar',
|
|
21
27
|
'aria-valuenow': now,
|
|
@@ -29,27 +35,26 @@ function useProgressTrait(_ref) {
|
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
function Progress(props) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
const {
|
|
39
|
+
variant = 'default'
|
|
40
|
+
} = props;
|
|
41
|
+
const progressTraitProps = useProgressTrait(props);
|
|
42
|
+
return /*#__PURE__*/jsx(ProgressBarProgress, _objectSpread({
|
|
36
43
|
classProps: {
|
|
37
|
-
variant
|
|
44
|
+
variant
|
|
38
45
|
}
|
|
39
46
|
}, progressTraitProps));
|
|
40
47
|
}
|
|
41
48
|
|
|
42
49
|
function ProgressBar(_ref2) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
progressSegments = _ref2.children;
|
|
52
|
-
return /*#__PURE__*/React.createElement(ProgressBarStatusBar, null, progressSegments || /*#__PURE__*/React.createElement(Progress, {
|
|
50
|
+
let {
|
|
51
|
+
variant = 'default',
|
|
52
|
+
now = undefined,
|
|
53
|
+
min = undefined,
|
|
54
|
+
max = undefined,
|
|
55
|
+
children: progressSegments
|
|
56
|
+
} = _ref2;
|
|
57
|
+
return /*#__PURE__*/_jsx2(ProgressBarStatusBar, {}, void 0, progressSegments || /*#__PURE__*/_jsx2(Progress, {
|
|
53
58
|
max: max,
|
|
54
59
|
min: min,
|
|
55
60
|
now: now,
|
|
@@ -58,19 +63,5 @@ function ProgressBar(_ref2) {
|
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
ProgressBar.Segment = Progress;
|
|
61
|
-
ProgressBar.propTypes = {
|
|
62
|
-
/** Progress intent variation */
|
|
63
|
-
variant: PropTypes.oneOf(['default', 'success', 'warning', 'info', 'error']),
|
|
64
|
-
|
|
65
|
-
/** Total current value */
|
|
66
|
-
now: PropTypes.number,
|
|
67
|
-
|
|
68
|
-
/** Min value */
|
|
69
|
-
min: PropTypes.number,
|
|
70
|
-
|
|
71
|
-
/** Total max */
|
|
72
|
-
max: PropTypes.number
|
|
73
|
-
};
|
|
74
66
|
|
|
75
67
|
export { ProgressBar as default };
|
|
76
|
-
//# sourceMappingURL=ProgressBar.js.map
|
package/esm/ProgressCounter.js
CHANGED
|
@@ -1,41 +1,44 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx2 from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
2
3
|
import { getPercentage } from './utils.js';
|
|
3
4
|
import { ProgressIndicatorCounter } from './classedComponents.js';
|
|
4
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
5
|
-
import '@elliemae/ds-classnames';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const defaultRenderer = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
now,
|
|
9
|
+
max,
|
|
10
|
+
min
|
|
11
|
+
} = _ref;
|
|
11
12
|
return "".concat(min || now, " of ").concat(max);
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const percentageRenderer = _ref2 => {
|
|
16
|
+
let {
|
|
17
|
+
now,
|
|
18
|
+
max,
|
|
19
|
+
min
|
|
20
|
+
} = _ref2;
|
|
21
|
+
const percentage = getPercentage(now, min, max);
|
|
19
22
|
return "".concat(percentage, "%");
|
|
20
23
|
};
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
const renderers = {
|
|
23
26
|
default: defaultRenderer,
|
|
24
27
|
percentage: percentageRenderer
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
function ProgressCounter(_ref3) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
let {
|
|
32
|
+
now,
|
|
33
|
+
max,
|
|
34
|
+
min,
|
|
35
|
+
renderer = renderers.default
|
|
36
|
+
} = _ref3;
|
|
37
|
+
return /*#__PURE__*/_jsx2(ProgressIndicatorCounter, {}, void 0, renderer({
|
|
38
|
+
now,
|
|
39
|
+
max,
|
|
40
|
+
min
|
|
37
41
|
}));
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
export { ProgressCounter as default };
|
|
41
|
-
//# sourceMappingURL=ProgressCounter.js.map
|
package/esm/classedComponents.js
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
1
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const blockName = 'determinate-progress-indicator';
|
|
4
|
+
const progressBlockName = 'progress-bar';
|
|
5
|
+
const Wrapper = aggregatedClasses('div')(blockName, null, _ref => {
|
|
6
|
+
let {
|
|
7
|
+
disabled
|
|
8
|
+
} = _ref;
|
|
8
9
|
return {
|
|
9
|
-
disabled
|
|
10
|
+
disabled
|
|
10
11
|
};
|
|
11
12
|
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const Title = aggregatedClasses('div')(blockName, 'title');
|
|
14
|
+
const ProgressIndicatorCounter = aggregatedClasses('span')(blockName, 'counter');
|
|
15
|
+
const ProgressBarStatusBar = aggregatedClasses('div')(progressBlockName);
|
|
16
|
+
const ProgressBarProgress = aggregatedClasses('div')(progressBlockName, 'progress', _ref2 => {
|
|
17
|
+
let {
|
|
18
|
+
variant
|
|
19
|
+
} = _ref2;
|
|
20
|
+
return {
|
|
21
|
+
[variant]: true
|
|
22
|
+
};
|
|
18
23
|
});
|
|
19
24
|
|
|
20
25
|
export { ProgressBarProgress, ProgressBarStatusBar, ProgressIndicatorCounter, Title, Wrapper, blockName };
|
|
21
|
-
//# sourceMappingURL=classedComponents.js.map
|
package/esm/index.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
1
|
export { DSProgressIndicator, ProgressIndicatorWithSchema, DSProgressIndicator as default } from './DSProgressIndicator.js';
|
|
2
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
3
|
-
import 'react';
|
|
4
|
-
import 'react-desc';
|
|
5
|
-
import '@elliemae/ds-truncated-tooltip-text';
|
|
6
|
-
import './ProgressCounter.js';
|
|
7
|
-
import './utils.js';
|
|
8
|
-
import './classedComponents.js';
|
|
9
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
10
|
-
import '@elliemae/ds-classnames';
|
|
11
|
-
import './ProgressBar.js';
|
|
12
|
-
import 'prop-types';
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
package/esm/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-progress-indicator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.12",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "
|
|
6
|
-
"module": "esm/index.js",
|
|
7
|
-
"main": "cjs/index.js",
|
|
5
|
+
"description": "ICE MT - Dimsum - Progress Indicator",
|
|
6
|
+
"module": "./esm/index.js",
|
|
7
|
+
"main": "./cjs/index.js",
|
|
8
|
+
"types": "./types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./esm/index.js",
|
|
12
|
+
"require": "./cjs/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./utils": {
|
|
15
|
+
"import": "./esm/utils.js",
|
|
16
|
+
"require": "./cjs/utils.js"
|
|
17
|
+
},
|
|
18
|
+
"./ProgressCounter": {
|
|
19
|
+
"import": "./esm/ProgressCounter.js",
|
|
20
|
+
"require": "./cjs/ProgressCounter.js"
|
|
21
|
+
},
|
|
22
|
+
"./ProgressBar": {
|
|
23
|
+
"import": "./esm/ProgressBar.js",
|
|
24
|
+
"require": "./cjs/ProgressBar.js"
|
|
25
|
+
},
|
|
26
|
+
"./DSProgressIndicator": {
|
|
27
|
+
"import": "./esm/DSProgressIndicator.js",
|
|
28
|
+
"require": "./cjs/DSProgressIndicator.js"
|
|
29
|
+
},
|
|
30
|
+
"./classedComponents": {
|
|
31
|
+
"import": "./esm/classedComponents.js",
|
|
32
|
+
"require": "./cjs/classedComponents.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
8
35
|
"sideEffects": [
|
|
9
36
|
"*.css",
|
|
10
37
|
"*.scss"
|
|
11
38
|
],
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"npm": ">=7",
|
|
45
|
+
"node": ">=14"
|
|
46
|
+
},
|
|
47
|
+
"author": "ICE MT",
|
|
12
48
|
"scripts": {
|
|
13
49
|
"dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
|
|
14
50
|
"prebuild": "exit 0",
|
|
@@ -16,17 +52,18 @@
|
|
|
16
52
|
"build": "node ../../scripts/build/build.js"
|
|
17
53
|
},
|
|
18
54
|
"dependencies": {
|
|
19
|
-
"@elliemae/ds-classnames": "
|
|
20
|
-
"@elliemae/ds-truncated-tooltip-text": "
|
|
55
|
+
"@elliemae/ds-classnames": "2.0.0-alpha.12",
|
|
56
|
+
"@elliemae/ds-truncated-tooltip-text": "2.0.0-alpha.12",
|
|
21
57
|
"prop-types": "~15.7.2",
|
|
22
|
-
"react-desc": "
|
|
58
|
+
"react-desc": "~4.1.3"
|
|
23
59
|
},
|
|
24
60
|
"peerDependencies": {
|
|
25
|
-
"react": "^17.0.
|
|
26
|
-
"react-dom": "^17.0.
|
|
61
|
+
"react": "^17.0.2",
|
|
62
|
+
"react-dom": "^17.0.2"
|
|
27
63
|
},
|
|
28
64
|
"publishConfig": {
|
|
29
65
|
"access": "public",
|
|
30
|
-
"directory": "dist"
|
|
66
|
+
"directory": "dist",
|
|
67
|
+
"generateSubmodules": true
|
|
31
68
|
}
|
|
32
69
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
import ProgressBar from './ProgressBar';
|
|
4
|
+
declare const DSProgressIndicator: {
|
|
5
|
+
({ containerProps, innerRef, title, counterRenderer, now, min, max, disabled, segments, style, }: {
|
|
6
|
+
containerProps?: {} | undefined;
|
|
7
|
+
innerRef?: (() => null) | undefined;
|
|
8
|
+
title?: string | undefined;
|
|
9
|
+
counterRenderer?: undefined;
|
|
10
|
+
now?: undefined;
|
|
11
|
+
min?: number | undefined;
|
|
12
|
+
max?: undefined;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
segments?: never[] | undefined;
|
|
15
|
+
style?: {} | undefined;
|
|
16
|
+
}): JSX.Element;
|
|
17
|
+
propTypes: {
|
|
18
|
+
containerProps: {
|
|
19
|
+
defaultValue<T = unknown>(arg: T): {
|
|
20
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
21
|
+
};
|
|
22
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
23
|
+
};
|
|
24
|
+
innerRef: {
|
|
25
|
+
defaultValue<T = unknown>(arg: T): {
|
|
26
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
27
|
+
};
|
|
28
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
29
|
+
};
|
|
30
|
+
title: {
|
|
31
|
+
defaultValue<T = unknown>(arg: T): {
|
|
32
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
33
|
+
};
|
|
34
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
35
|
+
};
|
|
36
|
+
variant: {
|
|
37
|
+
defaultValue<T = unknown>(arg: T): {
|
|
38
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
39
|
+
};
|
|
40
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
41
|
+
};
|
|
42
|
+
now: {
|
|
43
|
+
defaultValue<T = unknown>(arg: T): {
|
|
44
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
45
|
+
};
|
|
46
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
47
|
+
};
|
|
48
|
+
min: {
|
|
49
|
+
defaultValue<T = unknown>(arg: T): {
|
|
50
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
51
|
+
};
|
|
52
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
53
|
+
};
|
|
54
|
+
max: {
|
|
55
|
+
defaultValue<T = unknown>(arg: T): {
|
|
56
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
57
|
+
};
|
|
58
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
59
|
+
};
|
|
60
|
+
disabled: {
|
|
61
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
62
|
+
};
|
|
63
|
+
counterRenderer: {
|
|
64
|
+
defaultValue<T = unknown>(arg: T): {
|
|
65
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
66
|
+
};
|
|
67
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
68
|
+
};
|
|
69
|
+
segments: {
|
|
70
|
+
defaultValue<T = unknown>(arg: T): {
|
|
71
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
72
|
+
};
|
|
73
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
74
|
+
};
|
|
75
|
+
style: {
|
|
76
|
+
defaultValue<T = unknown>(arg: T): {
|
|
77
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
78
|
+
};
|
|
79
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
ProgressBar: typeof ProgressBar;
|
|
83
|
+
};
|
|
84
|
+
declare const ProgressIndicatorWithSchema: {
|
|
85
|
+
(props?: {
|
|
86
|
+
containerProps?: {} | undefined;
|
|
87
|
+
innerRef?: (() => null) | undefined;
|
|
88
|
+
title?: string | undefined;
|
|
89
|
+
counterRenderer?: undefined;
|
|
90
|
+
now?: undefined;
|
|
91
|
+
min?: number | undefined;
|
|
92
|
+
max?: undefined;
|
|
93
|
+
disabled?: boolean | undefined;
|
|
94
|
+
segments?: never[] | undefined;
|
|
95
|
+
style?: {} | undefined;
|
|
96
|
+
} | undefined): JSX.Element;
|
|
97
|
+
propTypes: unknown;
|
|
98
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
99
|
+
};
|
|
100
|
+
export { DSProgressIndicator, ProgressIndicatorWithSchema };
|
|
101
|
+
export default DSProgressIndicator;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
declare function Progress(props: any): JSX.Element;
|
|
4
|
+
declare function ProgressBar({ variant, now, min, max, children: progressSegments, }: {
|
|
5
|
+
variant?: string | undefined;
|
|
6
|
+
now?: undefined;
|
|
7
|
+
min?: undefined;
|
|
8
|
+
max?: undefined;
|
|
9
|
+
children: any;
|
|
10
|
+
}): JSX.Element;
|
|
11
|
+
declare namespace ProgressBar {
|
|
12
|
+
var Segment: typeof Progress;
|
|
13
|
+
var propTypes: {
|
|
14
|
+
/** Progress intent variation */
|
|
15
|
+
variant: PropTypes.Requireable<string>;
|
|
16
|
+
/** Total current value */
|
|
17
|
+
now: PropTypes.Requireable<number>;
|
|
18
|
+
/** Min value */
|
|
19
|
+
min: PropTypes.Requireable<number>;
|
|
20
|
+
/** Total max */
|
|
21
|
+
max: PropTypes.Requireable<number>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export default ProgressBar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare function ProgressCounter({ now, max, min, renderer }: {
|
|
3
|
+
now: any;
|
|
4
|
+
max: any;
|
|
5
|
+
min: any;
|
|
6
|
+
renderer?: (({ now, max, min }: {
|
|
7
|
+
now: any;
|
|
8
|
+
max: any;
|
|
9
|
+
min: any;
|
|
10
|
+
}) => string) | undefined;
|
|
11
|
+
}): JSX.Element;
|
|
12
|
+
export default ProgressCounter;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const blockName = "determinate-progress-indicator";
|
|
3
|
+
export declare const Wrapper: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
|
|
4
|
+
export declare const Title: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
|
|
5
|
+
export declare const ProgressIndicatorCounter: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
|
|
6
|
+
export declare const ProgressBarStatusBar: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
|
|
7
|
+
export declare const ProgressBarProgress: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
|
package/types/index.d.ts
ADDED
package/types/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getPercentage(now: any, min: any, max: any): number;
|
package/ProgressBar/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DSProgressIndicator.js","sources":["../../src/DSProgressIndicator.tsx"],"sourcesContent":["/* eslint-disable react/no-array-index-key */\nimport React, { useMemo } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport DSTruncatedTooltipText from '@elliemae/ds-truncated-tooltip-text';\nimport Counter from './ProgressCounter';\nimport ProgressBar from './ProgressBar';\nimport { Title, Wrapper } from './classedComponents';\n\nconst DSProgressIndicator = ({\n containerProps = {},\n innerRef = () => null,\n title = '',\n counterRenderer = undefined,\n now = undefined,\n min = 0,\n max = undefined,\n disabled = false,\n segments = [],\n style = {},\n}) => {\n const renderProgressBar = useMemo(\n () =>\n segments.length ? (\n <ProgressBar>\n {segments.map(\n (segmentProps, i) =>\n !(segmentProps.now < segmentProps.min) && (\n <ProgressBar.Segment key={i} {...segmentProps} />\n ),\n )}\n </ProgressBar>\n ) : (\n <ProgressBar max={max} min={min} now={now} />\n ),\n [segments, min, max, now],\n );\n\n return (\n <Wrapper\n ref={innerRef}\n aria-disabled={disabled}\n classProps={{ disabled }}\n {...containerProps}\n style={style}\n >\n <DSTruncatedTooltipText containerComponent={Title} value={title} />\n <Counter max={max} min={min} now={now} renderer={counterRenderer} />\n {renderProgressBar}\n </Wrapper>\n );\n};\n\nconst variants = ['default', 'success', 'warning', 'info', 'error'];\n\nconst progressIndicatorProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n innerRef: PropTypes.object.description('ref to the components container'),\n title: PropTypes.string.description('components title'),\n variant: PropTypes.oneOf(variants).description('Progress intent variation'),\n now: PropTypes.number.description('Total current value'),\n min: PropTypes.number.description('min value'),\n max: PropTypes.number.description('max value'),\n disabled: PropTypes.bool\n .description('Whether the progress indicator disabled or not')\n .defaultValue(false),\n counterRenderer: PropTypes.func.description('Render a custom counter'),\n segments: PropTypes.array.description(\n 'An array of multiple progress objects',\n ),\n style: PropTypes.object.description('css inline style'),\n};\n\nDSProgressIndicator.propTypes = progressIndicatorProps;\n\nconst ProgressIndicatorWithSchema = describe(DSProgressIndicator);\nProgressIndicatorWithSchema.propTypes = progressIndicatorProps;\n\nDSProgressIndicator.ProgressBar = ProgressBar;\n\nexport { DSProgressIndicator, ProgressIndicatorWithSchema };\nexport default DSProgressIndicator;\n"],"names":["DSProgressIndicator","containerProps","innerRef","title","counterRenderer","undefined","now","min","max","disabled","segments","style","renderProgressBar","useMemo","length","React","map","segmentProps","i","Wrapper","DSTruncatedTooltipText","Title","Counter","variants","progressIndicatorProps","PropTypes","object","description","string","variant","oneOf","number","bool","defaultValue","func","array","propTypes","ProgressIndicatorWithSchema","describe","ProgressBar"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAQMA,mBAAmB,GAAG,SAAtBA,mBAAsB,OAWtB;AAAA,iCAVJC,cAUI;AAAA,MAVJA,cAUI,oCAVa,EAUb;AAAA,2BATJC,QASI;AAAA,MATJA,QASI,8BATO;AAAA,WAAM,IAAN;AAAA,GASP;AAAA,wBARJC,KAQI;AAAA,MARJA,KAQI,2BARI,EAQJ;AAAA,kCAPJC,eAOI;AAAA,MAPJA,eAOI,qCAPcC,SAOd;AAAA,sBANJC,GAMI;AAAA,MANJA,GAMI,yBANED,SAMF;AAAA,sBALJE,GAKI;AAAA,MALJA,GAKI,yBALE,CAKF;AAAA,sBAJJC,GAII;AAAA,MAJJA,GAII,yBAJEH,SAIF;AAAA,2BAHJI,QAGI;AAAA,MAHJA,QAGI,8BAHO,KAGP;AAAA,2BAFJC,QAEI;AAAA,MAFJA,QAEI,8BAFO,EAEP;AAAA,wBADJC,KACI;AAAA,MADJA,KACI,2BADI,EACJ;AACJ,MAAMC,iBAAiB,GAAGC,aAAO,CAC/B;AAAA,WACEH,QAAQ,CAACI,MAAT,gBACEC,wCAAC,WAAD,QACGL,QAAQ,CAACM,GAAT,CACC,UAACC,YAAD,EAAeC,CAAf;AAAA,aACE,EAAED,YAAY,CAACX,GAAb,GAAmBW,YAAY,CAACV,GAAlC,kBACEQ,wCAAC,WAAD,CAAa,OAAb;AAAqB,QAAA,GA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ANoB;AAO7BrB,EAAAA,GAAG,EAAEmB,mBAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,qBAA7B,CAPwB;AAQ7BpB,EAAAA,GAAG,EAAEkB,mBAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,WAA7B,CARwB;AAS7BnB,EAAAA,GAAG,EAAEiB,mBAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,WAA7B,CATwB;AAU7BlB,EAAAA,QAAQ,EAAEgB,mBAAS,CAACO,IAAV,CACPL,WADO,CACK,gDADL,EAEPM,YAFO,CAEM,KAFN,CAVmB;AAa7B7B,EAAAA,eAAe,EAAEqB,mBAAS,CAACS,IAAV,CAAeP,WAAf,CAA2B,yBAA3B,CAbY;AAc7BjB,EAAAA,QAAQ,EAAEe,mBAAS,CAACU,KAAV,CAAgBR,WAAhB,CACR,uCADQ,CAdmB;AAiB7BhB,EAAAA,KAAK,EAAEc,mBAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,kBAA7B;AAjBsB,CAA/B;AAoBA3B,mBAAmB,CAACoC,SAApB,GAAgCZ,sBAAhC;IAEMa,2BAA2B,GAAGC,kBAAQ,CAACtC,mBAAD;AAC5CqC,2BAA2B,CAACD,SAA5B,GAAwCZ,sBAAxC;AAEAxB,mBAAmB,CAACuC,WAApB,GAAkCA,WAAlC;;;;;;"}
|
package/cjs/ProgressBar.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","sources":["../../src/ProgressBar.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { getPercentage } from './utils';\nimport { ProgressBarProgress, ProgressBarStatusBar } from './classedComponents';\n\nfunction useProgressTrait({\n now = undefined,\n min = undefined,\n max = undefined,\n text = '',\n}) {\n const percentage = getPercentage(now, min, max);\n return {\n role: 'progressbar',\n 'aria-valuenow': now,\n 'aria-valuemin': min,\n 'aria-valuemax': max,\n 'aria-valuetext': text,\n style: {\n width: `${percentage}%`,\n },\n };\n}\n\nfunction Progress(props) {\n const { variant = 'default' } = props;\n\n const progressTraitProps = useProgressTrait(props);\n\n return (\n <ProgressBarProgress classProps={{ variant }} {...progressTraitProps} />\n );\n}\n\nfunction ProgressBar({\n variant = 'default',\n now = undefined,\n min = undefined,\n max = undefined,\n children: progressSegments,\n}) {\n return (\n <ProgressBarStatusBar>\n {progressSegments || (\n <Progress max={max} min={min} now={now} variant={variant} />\n )}\n </ProgressBarStatusBar>\n );\n}\n\nProgressBar.Segment = Progress;\n\nProgressBar.propTypes = {\n /** Progress intent variation */\n variant: PropTypes.oneOf(['default', 'success', 'warning', 'info', 'error']),\n /** Total current value */\n now: PropTypes.number,\n /** Min value */\n min: PropTypes.number,\n /** Total max */\n max: PropTypes.number,\n};\n\nexport default ProgressBar;\n"],"names":["useProgressTrait","now","undefined","min","max","text","percentage","getPercentage","role","style","width","Progress","props","variant","progressTraitProps","React","ProgressBarProgress","ProgressBar","progressSegments","children","ProgressBarStatusBar","Segment","propTypes","PropTypes","oneOf","number"],"mappings":";;;;;;;;;;;;;;;;AAKA,SAASA,gBAAT,OAKG;AAAA,sBAJDC,GAIC;AAAA,MAJDA,GAIC,yBAJKC,SAIL;AAAA,sBAHDC,GAGC;AAAA,MAHDA,GAGC,yBAHKD,SAGL;AAAA,sBAFDE,GAEC;AAAA,MAFDA,GAEC,yBAFKF,SAEL;AAAA,uBADDG,IACC;AAAA,MADDA,IACC,0BADM,EACN;AACD,MAAMC,UAAU,GAAGC,mBAAa,CAACN,GAAD,EAAME,GAAN,EAAWC,GAAX,CAAhC;AACA,SAAO;AACLI,IAAAA,IAAI,EAAE,aADD;AAEL,qBAAiBP,GAFZ;AAGL,qBAAiBE,GAHZ;AAIL,qBAAiBC,GAJZ;AAKL,sBAAkBC,IALb;AAMLI,IAAAA,KAAK,EAAE;AACLC,MAAAA,KAAK,YAAKJ,UAAL;AADA;AANF,GAAP;AAUD;;AAED,SAASK,QAAT,CAAkBC,KAAl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["import React from 'react';\nimport { getPercentage } from './utils';\nimport { ProgressIndicatorCounter } from './classedComponents';\n\nconst defaultRenderer = ({ now, max, min }) => `${min || now} of ${max}`;\nconst percentageRenderer = ({ now, max, min }) => {\n const percentage = getPercentage(now, min, max);\n return `${percentage}%`;\n};\n\nconst renderers = {\n default: defaultRenderer,\n percentage: percentageRenderer,\n};\n\nfunction ProgressCounter({ now, max, min, renderer = renderers.default }) {\n return (\n <ProgressIndicatorCounter>\n {renderer({ now, max, min })}\n </ProgressIndicatorCounter>\n );\n}\n\nexport default ProgressCounter;\n"],"names":["defaultRenderer","now","max","min","percentageRenderer","percentage","getPercentage","renderers","default","ProgressCounter","renderer","React","ProgressIndicatorCounter"],"mappings":";;;;;;;;;;;;AAIA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB;AAAA,MAAGC,GAAH,QAAGA,GAAH;AAAA,MAAQC,GAAR,QAAQA,GAAR;AAAA,MAAaC,GAAb,QAAaA,GAAb;AAAA,mBAA0BA,GAAG,IAAIF,GAAjC,iBAA2CC,GAA3C;AAAA,CAAxB;;AACA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB,QAAuB;AAAA,MAApBH,GAAoB,SAApBA,GAAoB;AAAA,MAAfC,GAAe,SAAfA,GAAe;AAAA,MAAVC,GAAU,SAAVA,GAAU;AAChD,MAAME,UAAU,GAAGC,mBAAa,CAACL,GAAD,EAAME,GAAN,EAAWD,GAAX,CAAhC;AACA,mBAAUG,UAAV;AACD,CAHD;;AAKA,IAAME,SAAS,GAAG;AAChBC,EAAAA,OAAO,EAAER,eADO;AAEhBK,EAAAA,UAAU,EAAED;AAFI,CAAlB;;AAKA,SAASK,eAAT,QAA0E;AAAA,MAA/CR,GAA+C,SAA/CA,GAA+C;AAAA,MAA1CC,GAA0C,SAA1CA,GAA0C;AAAA,MAArCC,GAAqC,SAArCA,GAAqC;AAAA,6BAAhCO,QAAgC;AAAA,MAAhCA,QAAgC,+BAArBH,SAAS,CAACC,OAAW;AACxE,sBACEG,wCAACC,0CAAD,QACGF,QAAQ,CAAC;AAAET,IAAAA,GAAG,EAAHA,GAAF;AAAOC,IAAAA,GAAG,EAAHA,GAAP;AAAYC,IAAAA,GAAG,EAAHA;AAAZ,GAAD,CADX,CADF;AAKD;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"classedComponents.js","sources":["../../src/classedComponents.tsx"],"sourcesContent":["import { aggregatedClasses } from '@elliemae/ds-classnames';\n\nexport const blockName = 'determinate-progress-indicator';\nconst progressBlockName = 'progress-bar';\n\nexport const Wrapper = aggregatedClasses('div')(\n blockName,\n null,\n ({ disabled }) => ({ disabled }),\n);\nexport const Title = aggregatedClasses('div')(blockName, 'title');\nexport const ProgressIndicatorCounter = aggregatedClasses('span')(\n blockName,\n 'counter',\n);\nexport const ProgressBarStatusBar = aggregatedClasses('div')(progressBlockName);\nexport const ProgressBarProgress = aggregatedClasses('div')(\n progressBlockName,\n 'progress',\n ({ variant }) => ({ [variant]: true }),\n);\n"],"names":["blockName","progressBlockName","Wrapper","aggregatedClasses","disabled","Title","ProgressIndicatorCounter","ProgressBarStatusBar","ProgressBarProgress","variant"],"mappings":";;;;;;;;;;;IAEaA,SAAS,GAAG;AACzB,IAAMC,iBAAiB,GAAG,cAA1B;IAEaC,OAAO,GAAGC,8BAAiB,CAAC,KAAD,CAAjB,CACrBH,SADqB,EAErB,IAFqB,EAGrB;AAAA,MAAGI,QAAH,QAAGA,QAAH;AAAA,SAAmB;AAAEA,IAAAA,QAAQ,EAARA;AAAF,GAAnB;AAAA,CAHqB;IAKVC,KAAK,GAAGF,8BAAiB,CAAC,KAAD,CAAjB,CAAyBH,SAAzB,EAAoC,OAApC;IACRM,wBAAwB,GAAGH,8BAAiB,CAAC,MAAD,CAAjB,CACtCH,SADsC,EAEtC,SAFsC;IAI3BO,oBAAoB,GAAGJ,8BAAiB,CAAC,KAAD,CAAjB,CAAyBF,iBAAzB;IACvBO,mBAAmB,GAAGL,8BAAiB,CAAC,KAAD,CAAjB,CACjCF,iBADiC,EAEjC,UAFiC,EAGjC;AAAA,MAAGQ,OAAH,SAAGA,OAAH;AAAA,iDAAqBA,OAArB,EAA+B,IAA/B;AAAA,CAHiC;;;;;;;;;"}
|
package/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
package/cjs/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/utils.tsx"],"sourcesContent":["export function getPercentage(now, min, max) {\n return ((now || min) / max) * 100;\n}\n"],"names":["getPercentage","now","min","max"],"mappings":";;;;AAAO,SAASA,aAAT,CAAuBC,GAAvB,EAA4BC,GAA5B,EAAiCC,GAAjC,EAAsC;AAC3C,SAAQ,CAACF,GAAG,IAAIC,GAAR,IAAeC,GAAhB,GAAuB,GAA9B;AACD;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DSProgressIndicator.js","sources":["../../src/DSProgressIndicator.tsx"],"sourcesContent":["/* eslint-disable react/no-array-index-key */\nimport React, { useMemo } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport DSTruncatedTooltipText from '@elliemae/ds-truncated-tooltip-text';\nimport Counter from './ProgressCounter';\nimport ProgressBar from './ProgressBar';\nimport { Title, Wrapper } from './classedComponents';\n\nconst DSProgressIndicator = ({\n containerProps = {},\n innerRef = () => null,\n title = '',\n counterRenderer = undefined,\n now = undefined,\n min = 0,\n max = undefined,\n disabled = false,\n segments = [],\n style = {},\n}) => {\n const renderProgressBar = useMemo(\n () =>\n segments.length ? (\n <ProgressBar>\n {segments.map(\n (segmentProps, i) =>\n !(segmentProps.now < segmentProps.min) && (\n <ProgressBar.Segment key={i} {...segmentProps} />\n ),\n )}\n </ProgressBar>\n ) : (\n <ProgressBar max={max} min={min} now={now} />\n ),\n [segments, min, max, now],\n );\n\n return (\n <Wrapper\n ref={innerRef}\n aria-disabled={disabled}\n classProps={{ disabled }}\n {...containerProps}\n style={style}\n >\n <DSTruncatedTooltipText containerComponent={Title} value={title} />\n <Counter max={max} min={min} now={now} renderer={counterRenderer} />\n {renderProgressBar}\n </Wrapper>\n );\n};\n\nconst variants = ['default', 'success', 'warning', 'info', 'error'];\n\nconst progressIndicatorProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n innerRef: PropTypes.object.description('ref to the components container'),\n title: PropTypes.string.description('components title'),\n variant: PropTypes.oneOf(variants).description('Progress intent variation'),\n now: PropTypes.number.description('Total current value'),\n min: PropTypes.number.description('min value'),\n max: PropTypes.number.description('max value'),\n disabled: PropTypes.bool\n .description('Whether the progress indicator disabled or not')\n .defaultValue(false),\n counterRenderer: PropTypes.func.description('Render a custom counter'),\n segments: PropTypes.array.description(\n 'An array of multiple progress objects',\n ),\n style: PropTypes.object.description('css inline style'),\n};\n\nDSProgressIndicator.propTypes = progressIndicatorProps;\n\nconst ProgressIndicatorWithSchema = describe(DSProgressIndicator);\nProgressIndicatorWithSchema.propTypes = progressIndicatorProps;\n\nDSProgressIndicator.ProgressBar = ProgressBar;\n\nexport { DSProgressIndicator, ProgressIndicatorWithSchema };\nexport default DSProgressIndicator;\n"],"names":["DSProgressIndicator","containerProps","innerRef","title","counterRenderer","undefined","now","min","max","disabled","segments","style","renderProgressBar","useMemo","length","map","segmentProps","i","Title","Counter","variants","progressIndicatorProps","PropTypes","object","description","string","variant","oneOf","number","bool","defaultValue","func","array","propTypes","ProgressIndicatorWithSchema","describe","ProgressBar"],"mappings":";;;;;;;;;;;;IAQMA,mBAAmB,GAAG,SAAtBA,mBAAsB,OAWtB;AAAA,iCAVJC,cAUI;AAAA,MAVJA,cAUI,oCAVa,EAUb;AAAA,2BATJC,QASI;AAAA,MATJA,QASI,8BATO;AAAA,WAAM,IAAN;AAAA,GASP;AAAA,wBARJC,KAQI;AAAA,MAR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CAA6B,kBAA7B;AAjBsB,CAA/B;AAoBAxB,mBAAmB,CAACiC,SAApB,GAAgCZ,sBAAhC;IAEMa,2BAA2B,GAAGC,QAAQ,CAACnC,mBAAD;AAC5CkC,2BAA2B,CAACD,SAA5B,GAAwCZ,sBAAxC;AAEArB,mBAAmB,CAACoC,WAApB,GAAkCA,WAAlC;;;;"}
|
package/esm/ProgressBar.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","sources":["../../src/ProgressBar.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { getPercentage } from './utils';\nimport { ProgressBarProgress, ProgressBarStatusBar } from './classedComponents';\n\nfunction useProgressTrait({\n now = undefined,\n min = undefined,\n max = undefined,\n text = '',\n}) {\n const percentage = getPercentage(now, min, max);\n return {\n role: 'progressbar',\n 'aria-valuenow': now,\n 'aria-valuemin': min,\n 'aria-valuemax': max,\n 'aria-valuetext': text,\n style: {\n width: `${percentage}%`,\n },\n };\n}\n\nfunction Progress(props) {\n const { variant = 'default' } = props;\n\n const progressTraitProps = useProgressTrait(props);\n\n return (\n <ProgressBarProgress classProps={{ variant }} {...progressTraitProps} />\n );\n}\n\nfunction ProgressBar({\n variant = 'default',\n now = undefined,\n min = undefined,\n max = undefined,\n children: progressSegments,\n}) {\n return (\n <ProgressBarStatusBar>\n {progressSegments || (\n <Progress max={max} min={min} now={now} variant={variant} />\n )}\n </ProgressBarStatusBar>\n );\n}\n\nProgressBar.Segment = Progress;\n\nProgressBar.propTypes = {\n /** Progress intent variation */\n variant: PropTypes.oneOf(['default', 'success', 'warning', 'info', 'error']),\n /** Total current value */\n now: PropTypes.number,\n /** Min value */\n min: PropTypes.number,\n /** Total max */\n max: PropTypes.number,\n};\n\nexport default ProgressBar;\n"],"names":["useProgressTrait","now","undefined","min","max","text","percentage","getPercentage","role","style","width","Progress","props","variant","progressTraitProps","ProgressBar","progressSegments","children","Segment","propTypes","PropTypes","oneOf","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GAAG,EAAEF,GAAnC;AAAwC,IAAA,OAAO,EAAEY;AAAjD,IAFJ,CADF;AAOD;;AAEDE,WAAW,CAACG,OAAZ,GAAsBP,QAAtB;AAEAI,WAAW,CAACI,SAAZ,GAAwB;AACtB;AACAN,EAAAA,OAAO,EAAEO,SAAS,CAACC,KAAV,CAAgB,CAAC,SAAD,EAAY,SAAZ,EAAuB,SAAvB,EAAkC,MAAlC,EAA0C,OAA1C,CAAhB,CAFa;;AAGtB;AACApB,EAAAA,GAAG,EAAEmB,SAAS,CAACE,MAJO;;AAKtB;AACAnB,EAAAA,GAAG,EAAEiB,SAAS,CAACE,MANO;;AAOtB;AACAlB,EAAAA,GAAG,EAAEgB,SAAS,CAACE;AARO,CAAxB;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressCounter.js","sources":["../../src/ProgressCounter.tsx"],"sourcesContent":["import React from 'react';\nimport { getPercentage } from './utils';\nimport { ProgressIndicatorCounter } from './classedComponents';\n\nconst defaultRenderer = ({ now, max, min }) => `${min || now} of ${max}`;\nconst percentageRenderer = ({ now, max, min }) => {\n const percentage = getPercentage(now, min, max);\n return `${percentage}%`;\n};\n\nconst renderers = {\n default: defaultRenderer,\n percentage: percentageRenderer,\n};\n\nfunction ProgressCounter({ now, max, min, renderer = renderers.default }) {\n return (\n <ProgressIndicatorCounter>\n {renderer({ now, max, min })}\n </ProgressIndicatorCounter>\n );\n}\n\nexport default ProgressCounter;\n"],"names":["defaultRenderer","now","max","min","percentageRenderer","percentage","getPercentage","renderers","default","ProgressCounter","renderer"],"mappings":";;;;;;AAIA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB;AAAA,MAAGC,GAAH,QAAGA,GAAH;AAAA,MAAQC,GAAR,QAAQA,GAAR;AAAA,MAAaC,GAAb,QAAaA,GAAb;AAAA,mBAA0BA,GAAG,IAAIF,GAAjC,iBAA2CC,GAA3C;AAAA,CAAxB;;AACA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB,QAAuB;AAAA,MAApBH,GAAoB,SAApBA,GAAoB;AAAA,MAAfC,GAAe,SAAfA,GAAe;AAAA,MAAVC,GAAU,SAAVA,GAAU;AAChD,MAAME,UAAU,GAAGC,aAAa,CAACL,GAAD,EAAME,GAAN,EAAWD,GAAX,CAAhC;AACA,mBAAUG,UAAV;AACD,CAHD;;AAKA,IAAME,SAAS,GAAG;AAChBC,EAAAA,OAAO,EAAER,eADO;AAEhBK,EAAAA,UAAU,EAAED;AAFI,CAAlB;;AAKA,SAASK,eAAT,QAA0E;AAAA,MAA/CR,GAA+C,SAA/CA,GAA+C;AAAA,MAA1CC,GAA0C,SAA1CA,GAA0C;AAAA,MAArCC,GAAqC,SAArCA,GAAqC;AAAA,6BAAhCO,QAAgC;AAAA,MAAhCA,QAAgC,+BAArBH,SAAS,CAACC,OAAW;AACxE,sBACE,oBAAC,wBAAD,QACGE,QAAQ,CAAC;AAAET,IAAAA,GAAG,EAAHA,GAAF;AAAOC,IAAAA,GAAG,EAAHA,GAAP;AAAYC,IAAAA,GAAG,EAAHA;AAAZ,GAAD,CADX,CADF;AAKD;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"classedComponents.js","sources":["../../src/classedComponents.tsx"],"sourcesContent":["import { aggregatedClasses } from '@elliemae/ds-classnames';\n\nexport const blockName = 'determinate-progress-indicator';\nconst progressBlockName = 'progress-bar';\n\nexport const Wrapper = aggregatedClasses('div')(\n blockName,\n null,\n ({ disabled }) => ({ disabled }),\n);\nexport const Title = aggregatedClasses('div')(blockName, 'title');\nexport const ProgressIndicatorCounter = aggregatedClasses('span')(\n blockName,\n 'counter',\n);\nexport const ProgressBarStatusBar = aggregatedClasses('div')(progressBlockName);\nexport const ProgressBarProgress = aggregatedClasses('div')(\n progressBlockName,\n 'progress',\n ({ variant }) => ({ [variant]: true }),\n);\n"],"names":["blockName","progressBlockName","Wrapper","aggregatedClasses","disabled","Title","ProgressIndicatorCounter","ProgressBarStatusBar","ProgressBarProgress","variant"],"mappings":";;;IAEaA,SAAS,GAAG;AACzB,IAAMC,iBAAiB,GAAG,cAA1B;IAEaC,OAAO,GAAGC,iBAAiB,CAAC,KAAD,CAAjB,CACrBH,SADqB,EAErB,IAFqB,EAGrB;AAAA,MAAGI,QAAH,QAAGA,QAAH;AAAA,SAAmB;AAAEA,IAAAA,QAAQ,EAARA;AAAF,GAAnB;AAAA,CAHqB;IAKVC,KAAK,GAAGF,iBAAiB,CAAC,KAAD,CAAjB,CAAyBH,SAAzB,EAAoC,OAApC;IACRM,wBAAwB,GAAGH,iBAAiB,CAAC,MAAD,CAAjB,CACtCH,SADsC,EAEtC,SAFsC;IAI3BO,oBAAoB,GAAGJ,iBAAiB,CAAC,KAAD,CAAjB,CAAyBF,iBAAzB;IACvBO,mBAAmB,GAAGL,iBAAiB,CAAC,KAAD,CAAjB,CACjCF,iBADiC,EAEjC,UAFiC,EAGjC;AAAA,MAAGQ,OAAH,SAAGA,OAAH;AAAA,6BAAqBA,OAArB,EAA+B,IAA/B;AAAA,CAHiC;;;;"}
|
package/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
package/esm/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/utils.tsx"],"sourcesContent":["export function getPercentage(now, min, max) {\n return ((now || min) / max) * 100;\n}\n"],"names":["getPercentage","now","min","max"],"mappings":"AAAO,SAASA,aAAT,CAAuBC,GAAvB,EAA4BC,GAA5B,EAAiCC,GAAjC,EAAsC;AAC3C,SAAQ,CAACF,GAAG,IAAIC,GAAR,IAAeC,GAAhB,GAAuB,GAA9B;AACD;;;;"}
|