@elliemae/ds-indeterminate-progress-indicator 2.2.0 → 2.3.0-alpha.3
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/DSIndeterminateProgressIndicator.js +95 -91
- package/cjs/DSIndeterminateProgressIndicator.js.map +7 -0
- package/cjs/index.js +36 -11
- package/cjs/index.js.map +7 -0
- package/esm/DSIndeterminateProgressIndicator.js +63 -76
- package/esm/DSIndeterminateProgressIndicator.js.map +7 -0
- package/esm/index.js +7 -1
- package/esm/index.js.map +7 -0
- package/package.json +3 -3
|
@@ -1,113 +1,117 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var DSIndeterminateProgressIndicator_exports = {};
|
|
29
|
+
__export(DSIndeterminateProgressIndicator_exports, {
|
|
30
|
+
DSIndeterminateProgressIndicator: () => DSIndeterminateProgressIndicator,
|
|
31
|
+
IndeterminateProgressIndicatorWithSchema: () => IndeterminateProgressIndicatorWithSchema,
|
|
32
|
+
default: () => DSIndeterminateProgressIndicator_default
|
|
33
|
+
});
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_react_desc = require("react-desc");
|
|
37
|
+
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
38
|
+
var import_ds_truncated_tooltip_text = __toESM(require("@elliemae/ds-truncated-tooltip-text"));
|
|
39
|
+
const { cssClassName, classNameBlock, classNameElement } = (0, import_ds_classnames.convertPropToCssClassName)("indeterminate-progress-indicator");
|
|
40
|
+
function DSIndeterminateProgressIndicator({
|
|
41
|
+
containerProps,
|
|
42
|
+
title,
|
|
43
|
+
complete,
|
|
44
|
+
failed,
|
|
45
|
+
processing,
|
|
46
|
+
processingComplete,
|
|
47
|
+
processingCompleteTitle,
|
|
48
|
+
processingFail,
|
|
49
|
+
processingFailTitle,
|
|
50
|
+
animated,
|
|
51
|
+
percent,
|
|
52
|
+
lineOnly
|
|
53
|
+
}) {
|
|
54
|
+
const [label, setLabel] = (0, import_react.useState)(title);
|
|
55
|
+
(0, import_react.useEffect)(() => {
|
|
53
56
|
if ((processingComplete || processingFail || processing) && (complete || failed)) {
|
|
54
57
|
setLabel(complete ? processingCompleteTitle : processingFailTitle);
|
|
55
58
|
}
|
|
56
59
|
}, [failed, complete, processingComplete, processingFail, processing]);
|
|
57
|
-
return
|
|
60
|
+
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
58
61
|
"aria-busy": processing,
|
|
59
62
|
"aria-label": label,
|
|
60
63
|
"aria-live": "polite",
|
|
61
|
-
className:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
64
|
+
className: `${cssClassName} ${!complete && !failed && !processing ? classNameBlock("default") : ""} ${complete ? classNameBlock("complete") : ""} ${failed ? classNameBlock("failed") : ""} ${processing ? classNameBlock("processing") : ""} ${animated && processing ? "animated" : ""}
|
|
65
|
+
${processingComplete ? classNameBlock("processing-complete") : ""}
|
|
66
|
+
${processingFail ? classNameBlock("processing-fail") : ""}
|
|
67
|
+
${lineOnly ? "line-only" : null}
|
|
68
|
+
`,
|
|
69
|
+
role: "alert",
|
|
70
|
+
...containerProps
|
|
71
|
+
}, !lineOnly ? /* @__PURE__ */ import_react.default.createElement(import_ds_truncated_tooltip_text.default, {
|
|
72
|
+
className: classNameBlock("tooltip-text"),
|
|
73
|
+
containerComponent: /* @__PURE__ */ import_react.default.createElement("div", null),
|
|
74
|
+
value: label
|
|
75
|
+
}) : null, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
76
|
+
className: `${classNameElement("bar")}`
|
|
77
|
+
}, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
78
|
+
className: `${classNameElement("bar-indicator")}`,
|
|
79
|
+
style: {
|
|
80
|
+
width: `${!complete && !failed && !animated && processing ? percent : 100}%`
|
|
81
|
+
}
|
|
82
|
+
})));
|
|
78
83
|
}
|
|
79
|
-
|
|
80
84
|
DSIndeterminateProgressIndicator.defaultProps = {
|
|
81
85
|
containerProps: {},
|
|
82
|
-
title:
|
|
86
|
+
title: "",
|
|
83
87
|
complete: false,
|
|
84
88
|
failed: false,
|
|
85
89
|
processing: false,
|
|
86
90
|
processingComplete: false,
|
|
87
|
-
processingCompleteTitle:
|
|
91
|
+
processingCompleteTitle: "Complete",
|
|
88
92
|
processingFail: false,
|
|
89
|
-
processingFailTitle:
|
|
93
|
+
processingFailTitle: "Fail",
|
|
90
94
|
animated: true,
|
|
91
95
|
percent: 50,
|
|
92
96
|
lineOnly: false
|
|
93
97
|
};
|
|
94
98
|
const indeterminateProgressIndicatorProps = {
|
|
95
|
-
containerProps:
|
|
96
|
-
title:
|
|
97
|
-
processingCompleteTitle:
|
|
98
|
-
processingFailTitle:
|
|
99
|
-
complete:
|
|
100
|
-
failed:
|
|
101
|
-
processing:
|
|
102
|
-
processingComplete:
|
|
103
|
-
processingFail:
|
|
104
|
-
animated:
|
|
105
|
-
percent:
|
|
106
|
-
lineOnly:
|
|
99
|
+
containerProps: import_react_desc.PropTypes.object.description("Set of Properties attached to the main container"),
|
|
100
|
+
title: import_react_desc.PropTypes.string.description("component s label"),
|
|
101
|
+
processingCompleteTitle: import_react_desc.PropTypes.string.description("label to display when the process is completed"),
|
|
102
|
+
processingFailTitle: import_react_desc.PropTypes.string.description("label to display when the process has failed"),
|
|
103
|
+
complete: import_react_desc.PropTypes.bool.description("Sets the process state to completed").defaultValue(false),
|
|
104
|
+
failed: import_react_desc.PropTypes.bool.description("Sets the process state to failed").defaultValue(false),
|
|
105
|
+
processing: import_react_desc.PropTypes.bool.description("Sets the process state to processing").defaultValue(false),
|
|
106
|
+
processingComplete: import_react_desc.PropTypes.bool.description("Sets the process state to processing and then completed").defaultValue(false),
|
|
107
|
+
processingFail: import_react_desc.PropTypes.bool.description("Sets the process state to processing and then failed").defaultValue(false),
|
|
108
|
+
animated: import_react_desc.PropTypes.bool.description("animate or not").defaultValue(true),
|
|
109
|
+
percent: import_react_desc.PropTypes.number.description("completion percentage").defaultValue(50),
|
|
110
|
+
lineOnly: import_react_desc.PropTypes.bool.description("hide the label from rendering")
|
|
107
111
|
};
|
|
108
|
-
|
|
112
|
+
DSIndeterminateProgressIndicator.propTypes = indeterminateProgressIndicatorProps;
|
|
113
|
+
const IndeterminateProgressIndicatorWithSchema = (0, import_react_desc.describe)(DSIndeterminateProgressIndicator);
|
|
109
114
|
IndeterminateProgressIndicatorWithSchema.propTypes = indeterminateProgressIndicatorProps;
|
|
110
|
-
|
|
111
|
-
exports
|
|
112
|
-
|
|
113
|
-
exports["default"] = DSIndeterminateProgressIndicator;
|
|
115
|
+
var DSIndeterminateProgressIndicator_default = DSIndeterminateProgressIndicator;
|
|
116
|
+
module.exports = __toCommonJS(DSIndeterminateProgressIndicator_exports);
|
|
117
|
+
//# sourceMappingURL=DSIndeterminateProgressIndicator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSIndeterminateProgressIndicator.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable react/require-default-props */\nimport React, { useEffect, useState } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport DSTruncatedTooltipText from '@elliemae/ds-truncated-tooltip-text';\n\nconst { cssClassName, classNameBlock, classNameElement } = convertPropToCssClassName(\n 'indeterminate-progress-indicator',\n);\n\nfunction DSIndeterminateProgressIndicator({\n containerProps,\n title,\n complete,\n failed,\n processing,\n processingComplete,\n processingCompleteTitle,\n processingFail,\n processingFailTitle,\n animated,\n percent,\n lineOnly,\n}) {\n const [label, setLabel] = useState(title);\n useEffect(() => {\n if ((processingComplete || processingFail || processing) && (complete || failed)) {\n setLabel(complete ? processingCompleteTitle : processingFailTitle);\n }\n }, [failed, complete, processingComplete, processingFail, processing]);\n return (\n <div\n aria-busy={processing}\n aria-label={label}\n aria-live=\"polite\"\n className={`${cssClassName} ${!complete && !failed && !processing ? classNameBlock('default') : ''} ${\n complete ? classNameBlock('complete') : ''\n } ${\n // eslint-disable-next-line max-len\n failed ? classNameBlock('failed') : ''\n } ${processing ? classNameBlock('processing') : ''} ${animated && processing ? 'animated' : ''} \n ${processingComplete ? classNameBlock('processing-complete') : ''} \n ${processingFail ? classNameBlock('processing-fail') : ''} \n ${lineOnly ? 'line-only' : null}\n `}\n role=\"alert\"\n {...containerProps}\n >\n {!lineOnly ? (\n <DSTruncatedTooltipText className={classNameBlock('tooltip-text')} containerComponent={<div />} value={label} />\n ) : null}\n <div className={`${classNameElement('bar')}`}>\n <div\n className={`${classNameElement('bar-indicator')}`}\n style={{\n width: `${!complete && !failed && !animated && processing ? percent : 100}%`,\n }}\n />\n </div>\n </div>\n );\n}\n\nDSIndeterminateProgressIndicator.defaultProps = {\n containerProps: {},\n title: '',\n complete: false,\n failed: false,\n processing: false,\n processingComplete: false,\n processingCompleteTitle: 'Complete',\n processingFail: false,\n processingFailTitle: 'Fail',\n animated: true,\n percent: 50,\n lineOnly: false,\n};\n\nconst indeterminateProgressIndicatorProps = {\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n title: PropTypes.string.description('component s label'),\n processingCompleteTitle: PropTypes.string.description('label to display when the process is completed'),\n processingFailTitle: PropTypes.string.description('label to display when the process has failed'),\n complete: PropTypes.bool.description('Sets the process state to completed').defaultValue(false),\n failed: PropTypes.bool.description('Sets the process state to failed').defaultValue(false),\n processing: PropTypes.bool.description('Sets the process state to processing').defaultValue(false),\n processingComplete: PropTypes.bool\n .description('Sets the process state to processing and then completed')\n .defaultValue(false),\n processingFail: PropTypes.bool\n .description('Sets the process state to processing and then failed')\n .defaultValue(false),\n animated: PropTypes.bool.description('animate or not').defaultValue(true),\n percent: PropTypes.number.description('completion percentage').defaultValue(50),\n lineOnly: PropTypes.bool.description('hide the label from rendering'),\n};\n\nDSIndeterminateProgressIndicator.propTypes = indeterminateProgressIndicatorProps;\n\nconst IndeterminateProgressIndicatorWithSchema = describe(DSIndeterminateProgressIndicator);\n\nIndeterminateProgressIndicatorWithSchema.propTypes = indeterminateProgressIndicatorProps;\n\nexport { DSIndeterminateProgressIndicator, IndeterminateProgressIndicatorWithSchema };\nexport default DSIndeterminateProgressIndicator;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAA2C;AAC3C,wBAAoC;AACpC,2BAA0C;AAC1C,uCAAmC;AAEnC,MAAM,EAAE,cAAc,gBAAgB,qBAAqB,oDACzD;AAGF,0CAA0C;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,G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AY;AAAA,EAC7C,OAAO,4BAAU,OAAO,YAAY;AAAA,EACpC,yBAAyB,4BAAU,OAAO,YAAY;AAAA,EACtD,qBAAqB,4BAAU,OAAO,YAAY;AAAA,EAClD,UAAU,4BAAU,KAAK,YAAY,uCAAuC,aAAa;AAAA,EACzF,QAAQ,4BAAU,KAAK,YAAY,oCAAoC,aAAa;AAAA,EACpF,YAAY,4BAAU,KAAK,YAAY,wCAAwC,aAAa;AAAA,EAC5F,oBAAoB,4BAAU,KAC3B,YAAY,2DACZ,aAAa;AAAA,EAChB,gBAAgB,4BAAU,KACvB,YAAY,wDACZ,aAAa;AAAA,EAChB,UAAU,4BAAU,KAAK,YAAY,kBAAkB,aAAa;AAAA,EACpE,SAAS,4BAAU,OAAO,YAAY,yBAAyB,aAAa;AAAA,EAC5E,UAAU,4BAAU,KAAK,YAAY;AAAA;AAGvC,iCAAiC,YAAY;AAE7C,MAAM,2CAA2C,gCAAS;AAE1D,yCAAyC,YAAY;AAGrD,IAAO,2CAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/index.js
CHANGED
|
@@ -1,11 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var src_exports = {};
|
|
29
|
+
__export(src_exports, {
|
|
30
|
+
default: () => import_DSIndeterminateProgressIndicator.default
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
__reExport(src_exports, require("./DSIndeterminateProgressIndicator"));
|
|
34
|
+
var import_DSIndeterminateProgressIndicator = __toESM(require("./DSIndeterminateProgressIndicator"));
|
|
35
|
+
module.exports = __toCommonJS(src_exports);
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export * from './DSIndeterminateProgressIndicator';\nexport { default } from './DSIndeterminateProgressIndicator';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc;AACd,8CAAwB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,101 +1,88 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
cssClassName,
|
|
22
|
-
classNameBlock,
|
|
23
|
-
classNameElement
|
|
24
|
-
} = convertPropToCssClassName('indeterminate-progress-indicator');
|
|
25
|
-
|
|
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;
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useEffect, useState } from "react";
|
|
3
|
+
import { describe, PropTypes } from "react-desc";
|
|
4
|
+
import { convertPropToCssClassName } from "@elliemae/ds-classnames";
|
|
5
|
+
import DSTruncatedTooltipText from "@elliemae/ds-truncated-tooltip-text";
|
|
6
|
+
const { cssClassName, classNameBlock, classNameElement } = convertPropToCssClassName("indeterminate-progress-indicator");
|
|
7
|
+
function DSIndeterminateProgressIndicator({
|
|
8
|
+
containerProps,
|
|
9
|
+
title,
|
|
10
|
+
complete,
|
|
11
|
+
failed,
|
|
12
|
+
processing,
|
|
13
|
+
processingComplete,
|
|
14
|
+
processingCompleteTitle,
|
|
15
|
+
processingFail,
|
|
16
|
+
processingFailTitle,
|
|
17
|
+
animated,
|
|
18
|
+
percent,
|
|
19
|
+
lineOnly
|
|
20
|
+
}) {
|
|
41
21
|
const [label, setLabel] = useState(title);
|
|
42
22
|
useEffect(() => {
|
|
43
23
|
if ((processingComplete || processingFail || processing) && (complete || failed)) {
|
|
44
24
|
setLabel(complete ? processingCompleteTitle : processingFailTitle);
|
|
45
25
|
}
|
|
46
26
|
}, [failed, complete, processingComplete, processingFail, processing]);
|
|
47
|
-
return
|
|
27
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
48
28
|
"aria-busy": processing,
|
|
49
29
|
"aria-label": label,
|
|
50
30
|
"aria-live": "polite",
|
|
51
|
-
className:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
31
|
+
className: `${cssClassName} ${!complete && !failed && !processing ? classNameBlock("default") : ""} ${complete ? classNameBlock("complete") : ""} ${failed ? classNameBlock("failed") : ""} ${processing ? classNameBlock("processing") : ""} ${animated && processing ? "animated" : ""}
|
|
32
|
+
${processingComplete ? classNameBlock("processing-complete") : ""}
|
|
33
|
+
${processingFail ? classNameBlock("processing-fail") : ""}
|
|
34
|
+
${lineOnly ? "line-only" : null}
|
|
35
|
+
`,
|
|
36
|
+
role: "alert",
|
|
37
|
+
...containerProps
|
|
38
|
+
}, !lineOnly ? /* @__PURE__ */ React2.createElement(DSTruncatedTooltipText, {
|
|
39
|
+
className: classNameBlock("tooltip-text"),
|
|
40
|
+
containerComponent: /* @__PURE__ */ React2.createElement("div", null),
|
|
41
|
+
value: label
|
|
42
|
+
}) : null, /* @__PURE__ */ React2.createElement("div", {
|
|
43
|
+
className: `${classNameElement("bar")}`
|
|
44
|
+
}, /* @__PURE__ */ React2.createElement("div", {
|
|
45
|
+
className: `${classNameElement("bar-indicator")}`,
|
|
46
|
+
style: {
|
|
47
|
+
width: `${!complete && !failed && !animated && processing ? percent : 100}%`
|
|
48
|
+
}
|
|
49
|
+
})));
|
|
68
50
|
}
|
|
69
|
-
|
|
70
51
|
DSIndeterminateProgressIndicator.defaultProps = {
|
|
71
52
|
containerProps: {},
|
|
72
|
-
title:
|
|
53
|
+
title: "",
|
|
73
54
|
complete: false,
|
|
74
55
|
failed: false,
|
|
75
56
|
processing: false,
|
|
76
57
|
processingComplete: false,
|
|
77
|
-
processingCompleteTitle:
|
|
58
|
+
processingCompleteTitle: "Complete",
|
|
78
59
|
processingFail: false,
|
|
79
|
-
processingFailTitle:
|
|
60
|
+
processingFailTitle: "Fail",
|
|
80
61
|
animated: true,
|
|
81
62
|
percent: 50,
|
|
82
63
|
lineOnly: false
|
|
83
64
|
};
|
|
84
65
|
const indeterminateProgressIndicatorProps = {
|
|
85
|
-
containerProps: PropTypes.object.description(
|
|
86
|
-
title: PropTypes.string.description(
|
|
87
|
-
processingCompleteTitle: PropTypes.string.description(
|
|
88
|
-
processingFailTitle: PropTypes.string.description(
|
|
89
|
-
complete: PropTypes.bool.description(
|
|
90
|
-
failed: PropTypes.bool.description(
|
|
91
|
-
processing: PropTypes.bool.description(
|
|
92
|
-
processingComplete: PropTypes.bool.description(
|
|
93
|
-
processingFail: PropTypes.bool.description(
|
|
94
|
-
animated: PropTypes.bool.description(
|
|
95
|
-
percent: PropTypes.number.description(
|
|
96
|
-
lineOnly: PropTypes.bool.description(
|
|
66
|
+
containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
|
|
67
|
+
title: PropTypes.string.description("component s label"),
|
|
68
|
+
processingCompleteTitle: PropTypes.string.description("label to display when the process is completed"),
|
|
69
|
+
processingFailTitle: PropTypes.string.description("label to display when the process has failed"),
|
|
70
|
+
complete: PropTypes.bool.description("Sets the process state to completed").defaultValue(false),
|
|
71
|
+
failed: PropTypes.bool.description("Sets the process state to failed").defaultValue(false),
|
|
72
|
+
processing: PropTypes.bool.description("Sets the process state to processing").defaultValue(false),
|
|
73
|
+
processingComplete: PropTypes.bool.description("Sets the process state to processing and then completed").defaultValue(false),
|
|
74
|
+
processingFail: PropTypes.bool.description("Sets the process state to processing and then failed").defaultValue(false),
|
|
75
|
+
animated: PropTypes.bool.description("animate or not").defaultValue(true),
|
|
76
|
+
percent: PropTypes.number.description("completion percentage").defaultValue(50),
|
|
77
|
+
lineOnly: PropTypes.bool.description("hide the label from rendering")
|
|
97
78
|
};
|
|
79
|
+
DSIndeterminateProgressIndicator.propTypes = indeterminateProgressIndicatorProps;
|
|
98
80
|
const IndeterminateProgressIndicatorWithSchema = describe(DSIndeterminateProgressIndicator);
|
|
99
81
|
IndeterminateProgressIndicatorWithSchema.propTypes = indeterminateProgressIndicatorProps;
|
|
100
|
-
|
|
101
|
-
export {
|
|
82
|
+
var DSIndeterminateProgressIndicator_default = DSIndeterminateProgressIndicator;
|
|
83
|
+
export {
|
|
84
|
+
DSIndeterminateProgressIndicator,
|
|
85
|
+
IndeterminateProgressIndicatorWithSchema,
|
|
86
|
+
DSIndeterminateProgressIndicator_default as default
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=DSIndeterminateProgressIndicator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSIndeterminateProgressIndicator.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable react/require-default-props */\nimport React, { useEffect, useState } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport DSTruncatedTooltipText from '@elliemae/ds-truncated-tooltip-text';\n\nconst { cssClassName, classNameBlock, classNameElement } = convertPropToCssClassName(\n 'indeterminate-progress-indicator',\n);\n\nfunction DSIndeterminateProgressIndicator({\n containerProps,\n title,\n complete,\n failed,\n processing,\n processingComplete,\n processingCompleteTitle,\n processingFail,\n processingFailTitle,\n animated,\n percent,\n lineOnly,\n}) {\n const [label, setLabel] = useState(title);\n useEffect(() => {\n if ((processingComplete || processingFail || processing) && (complete || failed)) {\n setLabel(complete ? processingCompleteTitle : processingFailTitle);\n }\n }, [failed, complete, processingComplete, processingFail, processing]);\n return (\n <div\n aria-busy={processing}\n aria-label={label}\n aria-live=\"polite\"\n className={`${cssClassName} ${!complete && !failed && !processing ? classNameBlock('default') : ''} ${\n complete ? classNameBlock('complete') : ''\n } ${\n // eslint-disable-next-line max-len\n failed ? classNameBlock('failed') : ''\n } ${processing ? classNameBlock('processing') : ''} ${animated && processing ? 'animated' : ''} \n ${processingComplete ? classNameBlock('processing-complete') : ''} \n ${processingFail ? classNameBlock('processing-fail') : ''} \n ${lineOnly ? 'line-only' : null}\n `}\n role=\"alert\"\n {...containerProps}\n >\n {!lineOnly ? (\n <DSTruncatedTooltipText className={classNameBlock('tooltip-text')} containerComponent={<div />} value={label} />\n ) : null}\n <div className={`${classNameElement('bar')}`}>\n <div\n className={`${classNameElement('bar-indicator')}`}\n style={{\n width: `${!complete && !failed && !animated && processing ? percent : 100}%`,\n }}\n />\n </div>\n </div>\n );\n}\n\nDSIndeterminateProgressIndicator.defaultProps = {\n containerProps: {},\n title: '',\n complete: false,\n failed: false,\n processing: false,\n processingComplete: false,\n processingCompleteTitle: 'Complete',\n processingFail: false,\n processingFailTitle: 'Fail',\n animated: true,\n percent: 50,\n lineOnly: false,\n};\n\nconst indeterminateProgressIndicatorProps = {\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n title: PropTypes.string.description('component s label'),\n processingCompleteTitle: PropTypes.string.description('label to display when the process is completed'),\n processingFailTitle: PropTypes.string.description('label to display when the process has failed'),\n complete: PropTypes.bool.description('Sets the process state to completed').defaultValue(false),\n failed: PropTypes.bool.description('Sets the process state to failed').defaultValue(false),\n processing: PropTypes.bool.description('Sets the process state to processing').defaultValue(false),\n processingComplete: PropTypes.bool\n .description('Sets the process state to processing and then completed')\n .defaultValue(false),\n processingFail: PropTypes.bool\n .description('Sets the process state to processing and then failed')\n .defaultValue(false),\n animated: PropTypes.bool.description('animate or not').defaultValue(true),\n percent: PropTypes.number.description('completion percentage').defaultValue(50),\n lineOnly: PropTypes.bool.description('hide the label from rendering'),\n};\n\nDSIndeterminateProgressIndicator.propTypes = indeterminateProgressIndicatorProps;\n\nconst IndeterminateProgressIndicatorWithSchema = describe(DSIndeterminateProgressIndicator);\n\nIndeterminateProgressIndicatorWithSchema.propTypes = indeterminateProgressIndicatorProps;\n\nexport { DSIndeterminateProgressIndicator, IndeterminateProgressIndicatorWithSchema };\nexport default DSIndeterminateProgressIndicator;\n"],
|
|
5
|
+
"mappings": "AAAA;ACGA;AACA;AACA;AACA;AAEA,MAAM,EAAE,cAAc,gBAAgB,qBAAqB,0BACzD;AAGF,0CAA0C;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,GACC;AACD,QAAM,CAAC,OAAO,YAAY,SAAS;AACnC,YAAU,MAAM;AACd,QAAK,uBAAsB,kBAAkB,eAAgB,aAAY,SAAS;AAChF,eAAS,WAAW,0BAA0B;AAAA;AAAA,KAE/C,CAAC,QAAQ,UAAU,oBAAoB,gBAAgB;AAC1D,SACE,qCAAC,OAAD;AAAA,IACE,aAAW;AAAA,IACX,cAAY;AAAA,IACZ,aAAU;AAAA,IACV,WAAW,GAAG,gBAAgB,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,eAAe,aAAa,MAC9F,WAAW,eAAe,cAAc,OAGxC,SAAS,eAA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,UAAU,UAAU,KAAK,YAAY,kBAAkB,aAAa;AAAA,EACpE,SAAS,UAAU,OAAO,YAAY,yBAAyB,aAAa;AAAA,EAC5E,UAAU,UAAU,KAAK,YAAY;AAAA;AAGvC,iCAAiC,YAAY;AAE7C,MAAM,2CAA2C,SAAS;AAE1D,yCAAyC,YAAY;AAGrD,IAAO,2CAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/index.js
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export * from "./DSIndeterminateProgressIndicator";
|
|
3
|
+
import { default as default2 } from "./DSIndeterminateProgressIndicator";
|
|
4
|
+
export {
|
|
5
|
+
default2 as default
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSIndeterminateProgressIndicator';\nexport { default } from './DSIndeterminateProgressIndicator';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-indeterminate-progress-indicator",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0-alpha.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Indeterminate Progress Indicator",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"build": "node ../../scripts/build/build.js"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@elliemae/ds-classnames": "2.
|
|
40
|
-
"@elliemae/ds-truncated-tooltip-text": "2.
|
|
39
|
+
"@elliemae/ds-classnames": "2.3.0-alpha.3",
|
|
40
|
+
"@elliemae/ds-truncated-tooltip-text": "2.3.0-alpha.3",
|
|
41
41
|
"react-desc": "~4.1.3"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|