@teselagen/ui 0.0.11 → 0.0.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.
- package/README.md +7 -0
- package/cypress.config.ts +6 -0
- package/index.html +12 -0
- package/package.json +5 -11
- package/project.json +74 -0
- package/src/AdvancedOptions.js +33 -0
- package/src/AdvancedOptions.spec.js +24 -0
- package/src/AssignDefaultsModeContext.js +21 -0
- package/src/AsyncValidateFieldSpinner/index.js +12 -0
- package/src/BlueprintError/index.js +14 -0
- package/src/BounceLoader/index.js +16 -0
- package/src/BounceLoader/style.css +45 -0
- package/src/CollapsibleCard/index.js +92 -0
- package/src/CollapsibleCard/style.css +21 -0
- package/src/DNALoader/index.js +20 -0
- package/src/DNALoader/style.css +251 -0
- package/src/DataTable/CellDragHandle.js +130 -0
- package/src/DataTable/DisabledLoadingComponent.js +15 -0
- package/src/DataTable/DisplayOptions.js +218 -0
- package/src/DataTable/FilterAndSortMenu.js +397 -0
- package/src/DataTable/PagingTool.js +232 -0
- package/src/DataTable/SearchBar.js +57 -0
- package/src/DataTable/SortableColumns.js +53 -0
- package/src/DataTable/TableFormTrackerContext.js +10 -0
- package/src/DataTable/dataTableEnhancer.js +291 -0
- package/src/DataTable/defaultFormatters.js +32 -0
- package/src/DataTable/defaultProps.js +45 -0
- package/src/DataTable/defaultValidators.js +40 -0
- package/src/DataTable/editCellHelper.js +44 -0
- package/src/DataTable/getCellVal.js +20 -0
- package/src/DataTable/getVals.js +8 -0
- package/src/DataTable/index.js +3537 -0
- package/src/DataTable/isTruthy.js +12 -0
- package/src/DataTable/isValueEmpty.js +3 -0
- package/src/DataTable/style.css +600 -0
- package/src/DataTable/utils/computePresets.js +42 -0
- package/src/DataTable/utils/convertSchema.js +69 -0
- package/src/DataTable/utils/getIdOrCodeOrIndex.js +9 -0
- package/src/DataTable/utils/getTableConfigFromStorage.js +5 -0
- package/src/DataTable/utils/queryParams.js +1032 -0
- package/src/DataTable/utils/rowClick.js +156 -0
- package/src/DataTable/utils/selection.js +8 -0
- package/src/DataTable/utils/withSelectedEntities.js +65 -0
- package/src/DataTable/utils/withTableParams.js +328 -0
- package/src/DataTable/validateTableWideErrors.js +135 -0
- package/src/DataTable/viewColumn.js +37 -0
- package/src/DialogFooter/index.js +79 -0
- package/src/DialogFooter/style.css +9 -0
- package/src/DropdownButton.js +36 -0
- package/src/FillWindow.css +6 -0
- package/src/FillWindow.js +69 -0
- package/src/FormComponents/Uploader.js +1197 -0
- package/src/FormComponents/getNewName.js +31 -0
- package/src/FormComponents/index.js +1384 -0
- package/src/FormComponents/itemUpload.js +84 -0
- package/src/FormComponents/sortify.js +73 -0
- package/src/FormComponents/style.css +247 -0
- package/src/FormComponents/tryToMatchSchemas.js +222 -0
- package/src/FormComponents/utils.js +6 -0
- package/src/HotkeysDialog/index.js +79 -0
- package/src/HotkeysDialog/style.css +54 -0
- package/src/InfoHelper/index.js +83 -0
- package/src/InfoHelper/style.css +7 -0
- package/src/IntentText/index.js +18 -0
- package/src/Loading/index.js +74 -0
- package/src/Loading/style.css +4 -0
- package/src/MatchHeaders.js +223 -0
- package/src/MenuBar/index.js +416 -0
- package/src/MenuBar/style.css +45 -0
- package/src/PromptUnsavedChanges/index.js +40 -0
- package/src/ResizableDraggableDialog/index.js +138 -0
- package/src/ResizableDraggableDialog/style.css +42 -0
- package/src/ScrollToTop/index.js +72 -0
- package/src/SimpleStepViz.js +26 -0
- package/src/TgSelect/index.js +465 -0
- package/src/TgSelect/style.css +34 -0
- package/src/TgSuggest/index.js +121 -0
- package/src/Timeline/TimelineEvent.js +31 -0
- package/src/Timeline/index.js +22 -0
- package/src/Timeline/style.css +29 -0
- package/src/UploadCsvWizard.css +4 -0
- package/src/UploadCsvWizard.js +731 -0
- package/src/autoTooltip.js +89 -0
- package/src/constants.js +1 -0
- package/src/customIcons.js +361 -0
- package/src/enhancers/withDialog/index.js +196 -0
- package/src/enhancers/withDialog/tg_modalState.js +46 -0
- package/src/enhancers/withField.js +20 -0
- package/src/enhancers/withFields.js +11 -0
- package/src/enhancers/withLocalStorage.js +11 -0
- package/src/index.js +76 -0
- package/src/rerenderOnWindowResize.js +27 -0
- package/src/showAppSpinner.js +12 -0
- package/src/showConfirmationDialog/index.js +116 -0
- package/src/showDialogOnDocBody.js +37 -0
- package/src/style.css +214 -0
- package/src/toastr.js +92 -0
- package/src/typeToCommonType.js +6 -0
- package/src/useDialog.js +64 -0
- package/src/utils/S3Download.js +14 -0
- package/src/utils/adHoc.js +10 -0
- package/src/utils/basicHandleActionsWithFullState.js +14 -0
- package/src/utils/combineReducersWithFullState.js +14 -0
- package/src/utils/commandControls.js +83 -0
- package/src/utils/commandUtils.js +112 -0
- package/src/utils/determineBlackOrWhiteTextColor.js +4 -0
- package/src/utils/getDayjsFormatter.js +35 -0
- package/src/utils/getTextFromEl.js +28 -0
- package/src/utils/handlerHelpers.js +30 -0
- package/src/utils/hotkeyUtils.js +129 -0
- package/src/utils/menuUtils.js +402 -0
- package/src/utils/popoverOverflowModifiers.js +11 -0
- package/src/utils/pureNoFunc.js +31 -0
- package/src/utils/renderOnDoc.js +29 -0
- package/src/utils/showProgressToast.js +22 -0
- package/src/utils/tagUtils.js +45 -0
- package/src/utils/tgFormValues.js +32 -0
- package/src/utils/withSelectTableRecords.js +38 -0
- package/src/utils/withStore.js +10 -0
- package/src/wrapDialog.js +112 -0
- package/tsconfig.json +4 -0
- package/vite.config.ts +7 -0
- package/index.mjs +0 -109378
- package/index.umd.js +0 -109381
- package/style.css +0 -10421
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Icon, Button, Tooltip } from "@blueprintjs/core";
|
|
3
|
+
|
|
4
|
+
export const viewColumn = {
|
|
5
|
+
width: 35,
|
|
6
|
+
noEllipsis: true,
|
|
7
|
+
hideInMenu: true,
|
|
8
|
+
immovable: true,
|
|
9
|
+
type: "action",
|
|
10
|
+
render: () => {
|
|
11
|
+
return <Icon className="dt-eyeIcon" icon="eye-open" />;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export const openColumn = {
|
|
15
|
+
...viewColumn,
|
|
16
|
+
render: (val, record, rowInfo, props) => {
|
|
17
|
+
return (
|
|
18
|
+
<Tooltip content="Open">
|
|
19
|
+
<Button
|
|
20
|
+
onClick={e => {
|
|
21
|
+
e.stopPropagation();
|
|
22
|
+
props.onDoubleClick &&
|
|
23
|
+
props.onDoubleClick(
|
|
24
|
+
rowInfo.original,
|
|
25
|
+
rowInfo.index,
|
|
26
|
+
props.history
|
|
27
|
+
);
|
|
28
|
+
}}
|
|
29
|
+
minimal
|
|
30
|
+
small
|
|
31
|
+
className="dt-eyeIcon"
|
|
32
|
+
icon="document-open"
|
|
33
|
+
/>
|
|
34
|
+
</Tooltip>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* Copyright (C) 2018 TeselaGen Biotechnology, Inc. */
|
|
2
|
+
|
|
3
|
+
import React, { useRef } from "react";
|
|
4
|
+
import { Intent, Button, Classes } from "@blueprintjs/core";
|
|
5
|
+
import { noop } from "lodash";
|
|
6
|
+
import classNames from "classnames";
|
|
7
|
+
|
|
8
|
+
function DialogFooter({
|
|
9
|
+
hideModal,
|
|
10
|
+
loading,
|
|
11
|
+
submitting,
|
|
12
|
+
onBackClick,
|
|
13
|
+
style,
|
|
14
|
+
onClick = noop,
|
|
15
|
+
secondaryAction,
|
|
16
|
+
intent = Intent.PRIMARY,
|
|
17
|
+
secondaryIntent,
|
|
18
|
+
backText = "Back",
|
|
19
|
+
secondaryText = "Cancel",
|
|
20
|
+
additionalButtons,
|
|
21
|
+
className,
|
|
22
|
+
secondaryClassName = "",
|
|
23
|
+
text = "Submit",
|
|
24
|
+
disabled,
|
|
25
|
+
containerClassname,
|
|
26
|
+
noCancel
|
|
27
|
+
}) {
|
|
28
|
+
const r = useRef();
|
|
29
|
+
return (
|
|
30
|
+
<div
|
|
31
|
+
style={style}
|
|
32
|
+
ref={r}
|
|
33
|
+
className={classNames(Classes.DIALOG_FOOTER, containerClassname)}
|
|
34
|
+
>
|
|
35
|
+
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
|
|
36
|
+
{onBackClick && (
|
|
37
|
+
<Button
|
|
38
|
+
className={Classes.MINIMAL + " " + secondaryClassName}
|
|
39
|
+
text={backText}
|
|
40
|
+
onClick={onBackClick}
|
|
41
|
+
/>
|
|
42
|
+
)}
|
|
43
|
+
{!noCancel && (
|
|
44
|
+
<Button
|
|
45
|
+
intent={secondaryIntent}
|
|
46
|
+
className={Classes.MINIMAL + " " + secondaryClassName}
|
|
47
|
+
text={secondaryText}
|
|
48
|
+
onClick={
|
|
49
|
+
secondaryAction ||
|
|
50
|
+
hideModal ||
|
|
51
|
+
function() {
|
|
52
|
+
try {
|
|
53
|
+
r.current
|
|
54
|
+
.closest(".bp3-dialog")
|
|
55
|
+
.querySelector(".bp3-dialog-close-button")
|
|
56
|
+
.click();
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.error(`error closing dialog:`, error);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/>
|
|
63
|
+
)}
|
|
64
|
+
{additionalButtons}
|
|
65
|
+
<Button
|
|
66
|
+
text={text}
|
|
67
|
+
intent={intent}
|
|
68
|
+
type="submit"
|
|
69
|
+
className={className}
|
|
70
|
+
onClick={onClick}
|
|
71
|
+
disabled={disabled}
|
|
72
|
+
loading={loading || submitting}
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default DialogFooter;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* Copyright (C) 2018 TeselaGen Biotechnology, Inc. */
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Button, Popover, Position } from "@blueprintjs/core";
|
|
5
|
+
import classnames from "classnames";
|
|
6
|
+
import popoverOverflowModifiers from "./utils/popoverOverflowModifiers";
|
|
7
|
+
|
|
8
|
+
function DropdownButton({
|
|
9
|
+
disabled,
|
|
10
|
+
menu,
|
|
11
|
+
noRightIcon,
|
|
12
|
+
popoverProps,
|
|
13
|
+
className,
|
|
14
|
+
...rest
|
|
15
|
+
}) {
|
|
16
|
+
return (
|
|
17
|
+
<Popover
|
|
18
|
+
minimal
|
|
19
|
+
modifiers={popoverOverflowModifiers}
|
|
20
|
+
disabled={disabled}
|
|
21
|
+
autoFocus={false}
|
|
22
|
+
content={menu}
|
|
23
|
+
position={Position.BOTTOM_LEFT}
|
|
24
|
+
{...popoverProps}
|
|
25
|
+
>
|
|
26
|
+
<Button
|
|
27
|
+
disabled={disabled}
|
|
28
|
+
className={classnames(className, "dropdown-button")}
|
|
29
|
+
rightIcon={noRightIcon ? undefined : "caret-down"}
|
|
30
|
+
{...rest}
|
|
31
|
+
/>
|
|
32
|
+
</Popover>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default DropdownButton;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { isFunction } from "lodash";
|
|
3
|
+
import reactDom from "react-dom";
|
|
4
|
+
import rerenderOnWindowResize from "./rerenderOnWindowResize";
|
|
5
|
+
import "./FillWindow.css";
|
|
6
|
+
|
|
7
|
+
// use like:
|
|
8
|
+
// <FillWindow>
|
|
9
|
+
// {({ width, height }) => {
|
|
10
|
+
// return <div style={{width, height}}></div>
|
|
11
|
+
// }
|
|
12
|
+
// <FillWindow/>
|
|
13
|
+
|
|
14
|
+
export default class FillWindow extends React.Component {
|
|
15
|
+
constructor(props) {
|
|
16
|
+
super(props);
|
|
17
|
+
rerenderOnWindowResize(this);
|
|
18
|
+
}
|
|
19
|
+
// this is left here for posterity. componentDidMount didn't work before commit ee1853a5ae2e6e27b720dd225650cc2154076db5 "fixing rerenderOnWindowResize to bind this keyword correctly"
|
|
20
|
+
// componentDidMount(){
|
|
21
|
+
// this.setState({thomas: "realCool"})
|
|
22
|
+
// }
|
|
23
|
+
|
|
24
|
+
render() {
|
|
25
|
+
const w = window,
|
|
26
|
+
d = document,
|
|
27
|
+
e = d.documentElement,
|
|
28
|
+
g = d.getElementsByTagName("body")[0],
|
|
29
|
+
width = w.innerWidth || e.clientWidth || g.clientWidth,
|
|
30
|
+
height = w.innerHeight || e.clientHeight || g.clientHeight;
|
|
31
|
+
const windowDimensions = {
|
|
32
|
+
width,
|
|
33
|
+
height
|
|
34
|
+
};
|
|
35
|
+
const {
|
|
36
|
+
containerStyle = {},
|
|
37
|
+
style,
|
|
38
|
+
styleOverrides,
|
|
39
|
+
className,
|
|
40
|
+
asPortal,
|
|
41
|
+
...rest
|
|
42
|
+
} = this.props;
|
|
43
|
+
if (this.props.disabled) return this.props.children(windowDimensions);
|
|
44
|
+
const inner = (
|
|
45
|
+
<div
|
|
46
|
+
className={
|
|
47
|
+
"tg-fillWindow " + (asPortal ? "bp3-portal " : "") + (className || "")
|
|
48
|
+
}
|
|
49
|
+
style={{
|
|
50
|
+
...style,
|
|
51
|
+
width,
|
|
52
|
+
height,
|
|
53
|
+
position: "fixed",
|
|
54
|
+
top: 0,
|
|
55
|
+
left: 0,
|
|
56
|
+
...containerStyle,
|
|
57
|
+
...styleOverrides
|
|
58
|
+
}}
|
|
59
|
+
{...rest}
|
|
60
|
+
>
|
|
61
|
+
{this.props.children && isFunction(this.props.children)
|
|
62
|
+
? this.props.children(windowDimensions)
|
|
63
|
+
: this.props.children}
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
if (asPortal) return reactDom.createPortal(inner, window.document.body);
|
|
67
|
+
return inner;
|
|
68
|
+
}
|
|
69
|
+
}
|