@deephaven/components 1.15.2-alpha-fetch-variable-def.0 → 1.17.0
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/dist/ErrorView.d.ts +3 -1
- package/dist/ErrorView.d.ts.map +1 -1
- package/dist/ErrorView.js +9 -2
- package/dist/ErrorView.js.map +1 -1
- package/package.json +8 -8
package/dist/ErrorView.d.ts
CHANGED
|
@@ -6,10 +6,12 @@ export type ErrorViewerProps = {
|
|
|
6
6
|
isExpanded?: boolean;
|
|
7
7
|
/** The type of error message to display in the header. Defaults to Error. */
|
|
8
8
|
type?: string;
|
|
9
|
+
/** Optional callback to dismiss the error. If provided, a Dismiss button will be displayed. It is up to the parent to implement the logic to dismiss the error. */
|
|
10
|
+
onDismiss?: () => void;
|
|
9
11
|
};
|
|
10
12
|
/**
|
|
11
13
|
* Component that displays an error message in a textarea so user can scroll and a copy button.
|
|
12
14
|
*/
|
|
13
|
-
declare function ErrorView({ message, isExpanded: isExpandedProp, type, }: ErrorViewerProps): JSX.Element;
|
|
15
|
+
declare function ErrorView({ message, isExpanded: isExpandedProp, type, onDismiss, }: ErrorViewerProps): JSX.Element;
|
|
14
16
|
export default ErrorView;
|
|
15
17
|
//# sourceMappingURL=ErrorView.d.ts.map
|
package/dist/ErrorView.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorView.d.ts","sourceRoot":"","sources":["../src/ErrorView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorView.d.ts","sourceRoot":"","sources":["../src/ErrorView.tsx"],"names":[],"mappings":"AAeA,OAAO,kBAAkB,CAAC;AAE1B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;IAEhB,uIAAuI;IACvI,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,mKAAmK;IACnK,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,iBAAS,SAAS,CAAC,EACjB,OAAO,EACP,UAAU,EAAE,cAAsB,EAClC,IAAc,EACd,SAAS,GACV,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAoEhC;AAED,eAAe,SAAS,CAAC"}
|
package/dist/ErrorView.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
-
import { vsDiffAdded, vsDiffRemoved, vsWarning } from '@deephaven/icons';
|
|
4
|
+
import { vsClose, vsDiffAdded, vsDiffRemoved, vsWarning } from '@deephaven/icons';
|
|
5
5
|
import { useDebouncedCallback, useResizeObserver } from '@deephaven/react-hooks';
|
|
6
6
|
import CopyButton from "./CopyButton.js";
|
|
7
7
|
import Button from "./Button.js";
|
|
@@ -14,7 +14,8 @@ function ErrorView(_ref) {
|
|
|
14
14
|
var {
|
|
15
15
|
message,
|
|
16
16
|
isExpanded: isExpandedProp = false,
|
|
17
|
-
type = 'Error'
|
|
17
|
+
type = 'Error',
|
|
18
|
+
onDismiss
|
|
18
19
|
} = _ref;
|
|
19
20
|
var [isExpandable, setIsExpandable] = useState(false);
|
|
20
21
|
var [isExpanded, setIsExpanded] = useState(false);
|
|
@@ -58,6 +59,12 @@ function ErrorView(_ref) {
|
|
|
58
59
|
},
|
|
59
60
|
icon: isExpanded ? vsDiffRemoved : vsDiffAdded,
|
|
60
61
|
children: isExpanded ? 'Show Less' : 'Show More'
|
|
62
|
+
}), onDismiss != null && /*#__PURE__*/_jsx(Button, {
|
|
63
|
+
kind: "danger",
|
|
64
|
+
className: "error-view-dismiss-button",
|
|
65
|
+
onClick: onDismiss,
|
|
66
|
+
icon: vsClose,
|
|
67
|
+
children: "Dismiss"
|
|
61
68
|
})]
|
|
62
69
|
})]
|
|
63
70
|
}), /*#__PURE__*/_jsx("pre", {
|
package/dist/ErrorView.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorView.js","names":["React","useCallback","useLayoutEffect","useRef","useState","classNames","FontAwesomeIcon","vsDiffAdded","vsDiffRemoved","vsWarning","useDebouncedCallback","useResizeObserver","CopyButton","Button","jsx","_jsx","jsxs","_jsxs","ErrorView","_ref","message","isExpanded","isExpandedProp","type","isExpandable","setIsExpandable","setIsExpanded","viewRef","textRef","handleResize","current","newIsExpandable","scrollHeight","clientHeight","debouncedHandleResize","className","expanded","ref","children","icon","UNSAFE_className","tooltip","copy","concat","trim","kind","onClick"],"sources":["../src/ErrorView.tsx"],"sourcesContent":["import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport classNames from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport {
|
|
1
|
+
{"version":3,"file":"ErrorView.js","names":["React","useCallback","useLayoutEffect","useRef","useState","classNames","FontAwesomeIcon","vsClose","vsDiffAdded","vsDiffRemoved","vsWarning","useDebouncedCallback","useResizeObserver","CopyButton","Button","jsx","_jsx","jsxs","_jsxs","ErrorView","_ref","message","isExpanded","isExpandedProp","type","onDismiss","isExpandable","setIsExpandable","setIsExpanded","viewRef","textRef","handleResize","current","newIsExpandable","scrollHeight","clientHeight","debouncedHandleResize","className","expanded","ref","children","icon","UNSAFE_className","tooltip","copy","concat","trim","kind","onClick"],"sources":["../src/ErrorView.tsx"],"sourcesContent":["import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport classNames from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport {\n vsClose,\n vsDiffAdded,\n vsDiffRemoved,\n vsWarning,\n} from '@deephaven/icons';\nimport {\n useDebouncedCallback,\n useResizeObserver,\n} from '@deephaven/react-hooks';\nimport CopyButton from './CopyButton';\nimport Button from './Button';\nimport './ErrorView.scss';\n\nexport type ErrorViewerProps = {\n /** The message to display in the error view */\n message: string;\n\n /** Set to true if you want the error view to display expanded. Will not show the Show More/Less buttons if true. Defaults to false. */\n isExpanded?: boolean;\n\n /** The type of error message to display in the header. Defaults to Error. */\n type?: string;\n\n /** Optional callback to dismiss the error. If provided, a Dismiss button will be displayed. It is up to the parent to implement the logic to dismiss the error. */\n onDismiss?: () => void;\n};\n\n/**\n * Component that displays an error message in a textarea so user can scroll and a copy button.\n */\nfunction ErrorView({\n message,\n isExpanded: isExpandedProp = false,\n type = 'Error',\n onDismiss,\n}: ErrorViewerProps): JSX.Element {\n const [isExpandable, setIsExpandable] = useState(false);\n const [isExpanded, setIsExpanded] = useState(false);\n const viewRef = useRef<HTMLDivElement>(null);\n const textRef = useRef<HTMLPreElement>(null);\n\n const handleResize = useCallback(() => {\n if (isExpanded || isExpandedProp || textRef.current == null) {\n return;\n }\n const newIsExpandable =\n textRef.current.scrollHeight > textRef.current.clientHeight;\n setIsExpandable(newIsExpandable);\n }, [isExpanded, isExpandedProp]);\n\n const debouncedHandleResize = useDebouncedCallback(handleResize, 100);\n\n useResizeObserver(viewRef.current, debouncedHandleResize);\n\n useLayoutEffect(debouncedHandleResize, [debouncedHandleResize]);\n\n return (\n <div\n className={classNames('error-view', {\n expanded: isExpanded || isExpandedProp,\n })}\n ref={viewRef}\n >\n <div className=\"error-view-header\">\n <div className=\"error-view-header-text\">\n <FontAwesomeIcon icon={vsWarning} />\n <span>{type}</span>\n </div>\n <div className=\"error-view-buttons\">\n <CopyButton\n UNSAFE_className=\"error-view-copy-button\"\n tooltip=\"Copy error contents\"\n copy={`${type}: ${message}`.trim()}\n />\n {(isExpandable || isExpanded) && !isExpandedProp && (\n <Button\n kind=\"danger\"\n className=\"error-view-expand-button\"\n onClick={() => {\n setIsExpanded(!isExpanded);\n }}\n icon={isExpanded ? vsDiffRemoved : vsDiffAdded}\n >\n {isExpanded ? 'Show Less' : 'Show More'}\n </Button>\n )}\n {onDismiss != null && (\n <Button\n kind=\"danger\"\n className=\"error-view-dismiss-button\"\n onClick={onDismiss}\n icon={vsClose}\n >\n Dismiss\n </Button>\n )}\n </div>\n </div>\n <pre className=\"error-view-text\" ref={textRef}>\n {message}\n </pre>\n </div>\n );\n}\n\nexport default ErrorView;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC7E,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,eAAe,QAAQ,gCAAgC;AAChE,SACEC,OAAO,EACPC,WAAW,EACXC,aAAa,EACbC,SAAS,QACJ,kBAAkB;AACzB,SACEC,oBAAoB,EACpBC,iBAAiB,QACZ,wBAAwB;AAAC,OACzBC,UAAU;AAAA,OACVC,MAAM;AAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAiBb;AACA;AACA;AACA,SAASC,SAASA,CAAAC,IAAA,EAKgB;EAAA,IALf;IACjBC,OAAO;IACPC,UAAU,EAAEC,cAAc,GAAG,KAAK;IAClCC,IAAI,GAAG,OAAO;IACdC;EACgB,CAAC,GAAAL,IAAA;EACjB,IAAM,CAACM,YAAY,EAAEC,eAAe,CAAC,GAAGvB,QAAQ,CAAC,KAAK,CAAC;EACvD,IAAM,CAACkB,UAAU,EAAEM,aAAa,CAAC,GAAGxB,QAAQ,CAAC,KAAK,CAAC;EACnD,IAAMyB,OAAO,GAAG1B,MAAM,CAAiB,IAAI,CAAC;EAC5C,IAAM2B,OAAO,GAAG3B,MAAM,CAAiB,IAAI,CAAC;EAE5C,IAAM4B,YAAY,GAAG9B,WAAW,CAAC,MAAM;IACrC,IAAIqB,UAAU,IAAIC,cAAc,IAAIO,OAAO,CAACE,OAAO,IAAI,IAAI,EAAE;MAC3D;IACF;IACA,IAAMC,eAAe,GACnBH,OAAO,CAACE,OAAO,CAACE,YAAY,GAAGJ,OAAO,CAACE,OAAO,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D,WAAY;UAAAgC,QAAA,EAE9ClB,UAAU,GAAG,WAAW,GAAG;QAAW,CACjC,CACT,EACAG,SAAS,IAAI,IAAI,iBAChBT,IAAA,CAACF,MAAM;UACLiC,IAAI,EAAC,QAAQ;UACbV,SAAS,EAAC,2BAA2B;UACrCW,OAAO,EAAEvB,SAAU;UACnBgB,IAAI,EAAElC,OAAQ;UAAAiC,QAAA,EACf;QAED,CAAQ,CACT;MAAA,CACE,CAAC;IAAA,CACH,CAAC,eACNxB,IAAA;MAAKqB,SAAS,EAAC,iBAAiB;MAACE,GAAG,EAAET,OAAQ;MAAAU,QAAA,EAC3CnB;IAAO,CACL,CAAC;EAAA,CACH,CAAC;AAEV;AAEA,eAAeF,SAAS","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "Deephaven React component library",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@adobe/react-spectrum": "3.38.0",
|
|
28
|
-
"@deephaven/icons": "^1.
|
|
29
|
-
"@deephaven/log": "^1.
|
|
30
|
-
"@deephaven/react-hooks": "^1.
|
|
31
|
-
"@deephaven/utils": "^1.
|
|
28
|
+
"@deephaven/icons": "^1.2.0",
|
|
29
|
+
"@deephaven/log": "^1.8.0",
|
|
30
|
+
"@deephaven/react-hooks": "^1.14.0",
|
|
31
|
+
"@deephaven/utils": "^1.10.0",
|
|
32
32
|
"@fontsource/fira-mono": "5.0.13",
|
|
33
33
|
"@fontsource/fira-sans": "5.0.20",
|
|
34
34
|
"@fortawesome/fontawesome-svg-core": "^6.2.1",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"react-is": ">=16.8.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@deephaven/mocks": "^1.
|
|
66
|
-
"@deephaven/test-utils": "^1.
|
|
65
|
+
"@deephaven/mocks": "^1.1.0",
|
|
66
|
+
"@deephaven/test-utils": "^1.8.0",
|
|
67
67
|
"react-redux": "^7.2.7"
|
|
68
68
|
},
|
|
69
69
|
"files": [
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "a0ef312b2294f1452952cf7a9c95636dd9f65a59"
|
|
82
82
|
}
|