@elliemae/ds-indeterminate-progress-indicator 2.0.0-alpha.1 → 2.0.0-alpha.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.
|
@@ -4,6 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
6
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
7
13
|
var react = require('react');
|
|
8
14
|
var reactDesc = require('react-desc');
|
|
9
15
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
@@ -20,27 +26,28 @@ var _div;
|
|
|
20
26
|
|
|
21
27
|
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; }
|
|
22
28
|
|
|
23
|
-
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[
|
|
29
|
+
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; }
|
|
24
30
|
const {
|
|
25
31
|
cssClassName,
|
|
26
32
|
classNameBlock,
|
|
27
33
|
classNameElement
|
|
28
34
|
} = dsClassnames.convertPropToCssClassName('indeterminate-progress-indicator');
|
|
29
35
|
|
|
30
|
-
function DSIndeterminateProgressIndicator({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
function DSIndeterminateProgressIndicator(_ref) {
|
|
37
|
+
let {
|
|
38
|
+
containerProps,
|
|
39
|
+
title,
|
|
40
|
+
complete,
|
|
41
|
+
failed,
|
|
42
|
+
processing,
|
|
43
|
+
processingComplete,
|
|
44
|
+
processingCompleteTitle,
|
|
45
|
+
processingFail,
|
|
46
|
+
processingFailTitle,
|
|
47
|
+
animated,
|
|
48
|
+
percent,
|
|
49
|
+
lineOnly
|
|
50
|
+
} = _ref;
|
|
44
51
|
const [label, setLabel] = react.useState(title);
|
|
45
52
|
react.useEffect(() => {
|
|
46
53
|
if ((processingComplete || processingFail || processing) && (complete || failed)) {
|
|
@@ -51,24 +58,20 @@ function DSIndeterminateProgressIndicator({
|
|
|
51
58
|
"aria-busy": processing,
|
|
52
59
|
"aria-label": label,
|
|
53
60
|
"aria-live": "polite",
|
|
54
|
-
className:
|
|
55
|
-
failed ? classNameBlock('failed') : ''
|
|
56
|
-
${processingComplete ? classNameBlock('processing-complete') : ''}
|
|
57
|
-
${processingFail ? classNameBlock('processing-fail') : ''}
|
|
58
|
-
${lineOnly ? 'line-only' : null}
|
|
59
|
-
`,
|
|
61
|
+
className: "".concat(cssClassName, " ").concat(!complete && !failed && !processing ? classNameBlock('default') : '', " ").concat(complete ? classNameBlock('complete') : '', " ").concat( // eslint-disable-next-line max-len
|
|
62
|
+
failed ? classNameBlock('failed') : '', " ").concat(processing ? classNameBlock('processing') : '', " ").concat(animated && processing ? 'animated' : '', " \n ").concat(processingComplete ? classNameBlock('processing-complete') : '', " \n ").concat(processingFail ? classNameBlock('processing-fail') : '', " \n ").concat(lineOnly ? 'line-only' : null, "\n "),
|
|
60
63
|
role: "alert"
|
|
61
64
|
}, containerProps), {}, {
|
|
62
|
-
children: [!lineOnly ? /*#__PURE__*/_jsx__default[
|
|
65
|
+
children: [!lineOnly ? /*#__PURE__*/_jsx__default["default"](DSTruncatedTooltipText__default["default"], {
|
|
63
66
|
className: classNameBlock('tooltip-text'),
|
|
64
|
-
containerComponent: _div || (_div = /*#__PURE__*/_jsx__default[
|
|
67
|
+
containerComponent: _div || (_div = /*#__PURE__*/_jsx__default["default"]("div", {})),
|
|
65
68
|
value: label
|
|
66
|
-
}) : null, /*#__PURE__*/_jsx__default[
|
|
67
|
-
className:
|
|
68
|
-
}, void 0, /*#__PURE__*/_jsx__default[
|
|
69
|
-
className:
|
|
69
|
+
}) : null, /*#__PURE__*/_jsx__default["default"]("div", {
|
|
70
|
+
className: "".concat(classNameElement('bar'))
|
|
71
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"]("div", {
|
|
72
|
+
className: "".concat(classNameElement('bar-indicator')),
|
|
70
73
|
style: {
|
|
71
|
-
width:
|
|
74
|
+
width: "".concat(!complete && !failed && !animated && processing ? percent : 100, "%")
|
|
72
75
|
}
|
|
73
76
|
}))]
|
|
74
77
|
}));
|
|
@@ -107,4 +110,4 @@ IndeterminateProgressIndicatorWithSchema.propTypes = indeterminateProgressIndica
|
|
|
107
110
|
|
|
108
111
|
exports.DSIndeterminateProgressIndicator = DSIndeterminateProgressIndicator;
|
|
109
112
|
exports.IndeterminateProgressIndicatorWithSchema = IndeterminateProgressIndicatorWithSchema;
|
|
110
|
-
exports[
|
|
113
|
+
exports["default"] = DSIndeterminateProgressIndicator;
|
package/cjs/index.js
CHANGED
|
@@ -8,4 +8,4 @@ var DSIndeterminateProgressIndicator = require('./DSIndeterminateProgressIndicat
|
|
|
8
8
|
|
|
9
9
|
exports.DSIndeterminateProgressIndicator = DSIndeterminateProgressIndicator.DSIndeterminateProgressIndicator;
|
|
10
10
|
exports.IndeterminateProgressIndicatorWithSchema = DSIndeterminateProgressIndicator.IndeterminateProgressIndicatorWithSchema;
|
|
11
|
-
exports
|
|
11
|
+
exports["default"] = DSIndeterminateProgressIndicator.DSIndeterminateProgressIndicator;
|
|
@@ -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, useEffect } from 'react';
|
|
4
10
|
import { PropTypes, describe } from 'react-desc';
|
|
5
11
|
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
@@ -17,20 +23,21 @@ const {
|
|
|
17
23
|
classNameElement
|
|
18
24
|
} = convertPropToCssClassName('indeterminate-progress-indicator');
|
|
19
25
|
|
|
20
|
-
function DSIndeterminateProgressIndicator({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
function DSIndeterminateProgressIndicator(_ref) {
|
|
27
|
+
let {
|
|
28
|
+
containerProps,
|
|
29
|
+
title,
|
|
30
|
+
complete,
|
|
31
|
+
failed,
|
|
32
|
+
processing,
|
|
33
|
+
processingComplete,
|
|
34
|
+
processingCompleteTitle,
|
|
35
|
+
processingFail,
|
|
36
|
+
processingFailTitle,
|
|
37
|
+
animated,
|
|
38
|
+
percent,
|
|
39
|
+
lineOnly
|
|
40
|
+
} = _ref;
|
|
34
41
|
const [label, setLabel] = useState(title);
|
|
35
42
|
useEffect(() => {
|
|
36
43
|
if ((processingComplete || processingFail || processing) && (complete || failed)) {
|
|
@@ -41,12 +48,8 @@ function DSIndeterminateProgressIndicator({
|
|
|
41
48
|
"aria-busy": processing,
|
|
42
49
|
"aria-label": label,
|
|
43
50
|
"aria-live": "polite",
|
|
44
|
-
className:
|
|
45
|
-
failed ? classNameBlock('failed') : ''
|
|
46
|
-
${processingComplete ? classNameBlock('processing-complete') : ''}
|
|
47
|
-
${processingFail ? classNameBlock('processing-fail') : ''}
|
|
48
|
-
${lineOnly ? 'line-only' : null}
|
|
49
|
-
`,
|
|
51
|
+
className: "".concat(cssClassName, " ").concat(!complete && !failed && !processing ? classNameBlock('default') : '', " ").concat(complete ? classNameBlock('complete') : '', " ").concat( // eslint-disable-next-line max-len
|
|
52
|
+
failed ? classNameBlock('failed') : '', " ").concat(processing ? classNameBlock('processing') : '', " ").concat(animated && processing ? 'animated' : '', " \n ").concat(processingComplete ? classNameBlock('processing-complete') : '', " \n ").concat(processingFail ? classNameBlock('processing-fail') : '', " \n ").concat(lineOnly ? 'line-only' : null, "\n "),
|
|
50
53
|
role: "alert"
|
|
51
54
|
}, containerProps), {}, {
|
|
52
55
|
children: [!lineOnly ? /*#__PURE__*/_jsx(DSTruncatedTooltipText, {
|
|
@@ -54,11 +57,11 @@ function DSIndeterminateProgressIndicator({
|
|
|
54
57
|
containerComponent: _div || (_div = /*#__PURE__*/_jsx("div", {})),
|
|
55
58
|
value: label
|
|
56
59
|
}) : null, /*#__PURE__*/_jsx("div", {
|
|
57
|
-
className:
|
|
60
|
+
className: "".concat(classNameElement('bar'))
|
|
58
61
|
}, void 0, /*#__PURE__*/_jsx("div", {
|
|
59
|
-
className:
|
|
62
|
+
className: "".concat(classNameElement('bar-indicator')),
|
|
60
63
|
style: {
|
|
61
|
-
width:
|
|
64
|
+
width: "".concat(!complete && !failed && !animated && processing ? percent : 100, "%")
|
|
62
65
|
}
|
|
63
66
|
}))]
|
|
64
67
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-indeterminate-progress-indicator",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Indeterminate Progress Indicator",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"build": "node ../../scripts/build/build.js"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@elliemae/ds-classnames": "2.0.0-alpha.
|
|
40
|
-
"@elliemae/ds-truncated-tooltip-text": "2.0.0-alpha.
|
|
41
|
-
"react-desc": "
|
|
39
|
+
"@elliemae/ds-classnames": "2.0.0-alpha.13",
|
|
40
|
+
"@elliemae/ds-truncated-tooltip-text": "2.0.0-alpha.13",
|
|
41
|
+
"react-desc": "~4.1.3"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": "^17.0.2",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
/// <reference types="react" />
|
|
2
3
|
declare function DSIndeterminateProgressIndicator({ containerProps, title, complete, failed, processing, processingComplete, processingCompleteTitle, processingFail, processingFailTitle, animated, percent, lineOnly, }: {
|
|
3
4
|
containerProps: any;
|
|
@@ -29,20 +30,76 @@ declare namespace DSIndeterminateProgressIndicator {
|
|
|
29
30
|
lineOnly: boolean;
|
|
30
31
|
};
|
|
31
32
|
var propTypes: {
|
|
33
|
+
containerProps: {
|
|
34
|
+
defaultValue<T = unknown>(arg: T): {
|
|
35
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
36
|
+
};
|
|
37
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
38
|
+
};
|
|
39
|
+
title: {
|
|
40
|
+
defaultValue<T = unknown>(arg: T): {
|
|
41
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
42
|
+
};
|
|
43
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
44
|
+
};
|
|
45
|
+
processingCompleteTitle: {
|
|
46
|
+
defaultValue<T = unknown>(arg: T): {
|
|
47
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
48
|
+
};
|
|
49
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
50
|
+
};
|
|
51
|
+
processingFailTitle: {
|
|
52
|
+
defaultValue<T = unknown>(arg: T): {
|
|
53
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
54
|
+
};
|
|
55
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
56
|
+
};
|
|
57
|
+
complete: {
|
|
58
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
59
|
+
};
|
|
60
|
+
failed: {
|
|
61
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
62
|
+
};
|
|
63
|
+
processing: {
|
|
64
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
65
|
+
};
|
|
66
|
+
processingComplete: {
|
|
67
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
68
|
+
};
|
|
69
|
+
processingFail: {
|
|
70
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
71
|
+
};
|
|
72
|
+
animated: {
|
|
73
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
74
|
+
};
|
|
75
|
+
percent: {
|
|
76
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
77
|
+
};
|
|
78
|
+
lineOnly: {
|
|
79
|
+
defaultValue<T = unknown>(arg: T): {
|
|
80
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
81
|
+
};
|
|
82
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
declare const IndeterminateProgressIndicatorWithSchema: {
|
|
87
|
+
(props?: {
|
|
32
88
|
containerProps: any;
|
|
33
89
|
title: any;
|
|
34
|
-
processingCompleteTitle: any;
|
|
35
|
-
processingFailTitle: any;
|
|
36
90
|
complete: any;
|
|
37
91
|
failed: any;
|
|
38
92
|
processing: any;
|
|
39
93
|
processingComplete: any;
|
|
94
|
+
processingCompleteTitle: any;
|
|
40
95
|
processingFail: any;
|
|
96
|
+
processingFailTitle: any;
|
|
41
97
|
animated: any;
|
|
42
98
|
percent: any;
|
|
43
99
|
lineOnly: any;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
|
|
100
|
+
} | undefined): JSX.Element;
|
|
101
|
+
propTypes: unknown;
|
|
102
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
103
|
+
};
|
|
47
104
|
export { DSIndeterminateProgressIndicator, IndeterminateProgressIndicatorWithSchema };
|
|
48
105
|
export default DSIndeterminateProgressIndicator;
|
package/cjs/package.json
DELETED