@teselagen/ui 0.7.33-beta.6 → 0.7.33
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/AdvancedOptions.js +33 -0
- package/AssignDefaultsModeContext.js +22 -0
- package/CellDragHandle.js +132 -0
- package/ColumnFilterMenu.js +62 -0
- package/Columns.js +979 -0
- package/DataTable/utils/queryParams.d.ts +14 -7
- package/DisabledLoadingComponent.js +15 -0
- package/DisplayOptions.js +199 -0
- package/DropdownButton.js +36 -0
- package/DropdownCell.js +61 -0
- package/EditableCell.js +44 -0
- package/FillWindow.css +6 -0
- package/FillWindow.js +69 -0
- package/FilterAndSortMenu.js +391 -0
- package/FormSeparator.js +9 -0
- package/LoadingDots.js +14 -0
- package/MatchHeaders.js +234 -0
- package/PagingTool.js +225 -0
- package/RenderCell.js +191 -0
- package/SearchBar.js +69 -0
- package/SimpleStepViz.js +22 -0
- package/SortableColumns.js +100 -0
- package/TableFormTrackerContext.js +10 -0
- package/Tag.js +112 -0
- package/ThComponent.js +44 -0
- package/TimelineEvent.js +31 -0
- package/UploadCsvWizard.css +4 -0
- package/UploadCsvWizard.js +719 -0
- package/Uploader.js +1278 -0
- package/adHoc.js +10 -0
- package/autoTooltip.js +201 -0
- package/basicHandleActionsWithFullState.js +14 -0
- package/browserUtils.js +3 -0
- package/combineReducersWithFullState.js +14 -0
- package/commandControls.js +82 -0
- package/commandUtils.js +112 -0
- package/constants.js +1 -0
- package/convertSchema.js +69 -0
- package/customIcons.js +361 -0
- package/dataTableEnhancer.js +41 -0
- package/defaultFormatters.js +32 -0
- package/defaultValidators.js +40 -0
- package/determineBlackOrWhiteTextColor.js +4 -0
- package/editCellHelper.js +44 -0
- package/formatPasteData.js +16 -0
- package/getAllRows.js +11 -0
- package/getCellCopyText.js +7 -0
- package/getCellInfo.js +36 -0
- package/getCellVal.js +20 -0
- package/getDayjsFormatter.js +35 -0
- package/getFieldPathToField.js +7 -0
- package/getIdOrCodeOrIndex.js +9 -0
- package/getLastSelectedEntity.js +11 -0
- package/getNewEntToSelect.js +25 -0
- package/getNewName.js +31 -0
- package/getRowCopyText.js +28 -0
- package/getTableConfigFromStorage.js +5 -0
- package/getTextFromEl.js +28 -0
- package/getVals.js +8 -0
- package/handleCopyColumn.js +21 -0
- package/handleCopyHelper.js +15 -0
- package/handleCopyRows.js +23 -0
- package/handleCopyTable.js +16 -0
- package/handlerHelpers.js +24 -0
- package/hotkeyUtils.js +131 -0
- package/index.cjs.js +972 -837
- package/index.d.ts +0 -1
- package/index.es.js +972 -837
- package/index.js +196 -0
- package/isBeingCalledExcessively.js +31 -0
- package/isBottomRightCornerOfRectangle.js +20 -0
- package/isEntityClean.js +15 -0
- package/isTruthy.js +12 -0
- package/isValueEmpty.js +3 -0
- package/itemUpload.js +84 -0
- package/menuUtils.js +433 -0
- package/package.json +1 -2
- package/popoverOverflowModifiers.js +11 -0
- package/primarySelectedValue.js +1 -0
- package/pureNoFunc.js +31 -0
- package/queryParams.js +1058 -0
- package/removeCleanRows.js +22 -0
- package/renderOnDoc.js +32 -0
- package/rerenderOnWindowResize.js +26 -0
- package/rowClick.js +181 -0
- package/selection.js +8 -0
- package/showAppSpinner.js +12 -0
- package/showDialogOnDocBody.js +33 -0
- package/showProgressToast.js +22 -0
- package/sortify.js +73 -0
- package/style.css +29 -0
- package/tagUtils.js +45 -0
- package/tgFormValues.js +35 -0
- package/tg_modalState.js +47 -0
- package/throwFormError.js +16 -0
- package/toastr.js +148 -0
- package/tryToMatchSchemas.js +264 -0
- package/typeToCommonType.js +6 -0
- package/useDeepEqualMemo.js +15 -0
- package/useDialog.js +63 -0
- package/useStableReference.js +9 -0
- package/useTableEntities.js +38 -0
- package/useTraceUpdate.js +19 -0
- package/utils.js +37 -0
- package/validateTableWideErrors.js +160 -0
- package/viewColumn.js +97 -0
- package/withField.js +20 -0
- package/withFields.js +11 -0
- package/withLocalStorage.js +11 -0
- package/withSelectTableRecords.js +43 -0
- package/withSelectedEntities.js +65 -0
- package/withStore.js +10 -0
- package/withTableParams.js +301 -0
- package/wrapDialog.js +116 -0
package/Tag.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/* Copyright (C) 2018 TeselaGen Biotechnology, Inc. */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import "./style.css";
|
|
5
|
+
import { Tooltip } from "@blueprintjs/core";
|
|
6
|
+
import { getTagColorStyle } from "./utils/tagUtils";
|
|
7
|
+
import popoverOverflowModifiers from "./utils/popoverOverflowModifiers";
|
|
8
|
+
|
|
9
|
+
function Tag({
|
|
10
|
+
name,
|
|
11
|
+
color,
|
|
12
|
+
tooltip,
|
|
13
|
+
selected,
|
|
14
|
+
secondarySelected,
|
|
15
|
+
hasSelection,
|
|
16
|
+
onDelete,
|
|
17
|
+
onClick,
|
|
18
|
+
clickable,
|
|
19
|
+
doNotFillWidth,
|
|
20
|
+
style = {}
|
|
21
|
+
}) {
|
|
22
|
+
const sharedStyles = {
|
|
23
|
+
...getTagColorStyle(color).style,
|
|
24
|
+
padding: "2px 5px"
|
|
25
|
+
};
|
|
26
|
+
const deleteButton = onDelete && (
|
|
27
|
+
<span
|
|
28
|
+
style={{
|
|
29
|
+
...sharedStyles,
|
|
30
|
+
cursor: "pointer",
|
|
31
|
+
borderTopRightRadius: 3,
|
|
32
|
+
borderBottomRightRadius: 3
|
|
33
|
+
}}
|
|
34
|
+
className="delete-tag-button"
|
|
35
|
+
onClick={onDelete}
|
|
36
|
+
>
|
|
37
|
+
✕
|
|
38
|
+
</span>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
let nameToUse = name;
|
|
42
|
+
const nameTooLong = name.length > 40;
|
|
43
|
+
if (nameTooLong) {
|
|
44
|
+
nameToUse = name.slice(0, 40) + "...";
|
|
45
|
+
}
|
|
46
|
+
if (tooltip || nameTooLong) {
|
|
47
|
+
const content = (
|
|
48
|
+
<div>
|
|
49
|
+
{nameTooLong ? (
|
|
50
|
+
<div>
|
|
51
|
+
{name}
|
|
52
|
+
{tooltip ? ":" : null}
|
|
53
|
+
</div>
|
|
54
|
+
) : null}
|
|
55
|
+
{tooltip ? <div>{tooltip}</div> : null}
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
nameToUse = (
|
|
59
|
+
<Tooltip content={content} modifiers={popoverOverflowModifiers}>
|
|
60
|
+
{nameToUse}
|
|
61
|
+
</Tooltip>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const tag = (
|
|
66
|
+
<React.Fragment>
|
|
67
|
+
<span
|
|
68
|
+
onClick={onClick}
|
|
69
|
+
className="tg-tag"
|
|
70
|
+
style={{
|
|
71
|
+
...sharedStyles,
|
|
72
|
+
// will stop tags from growing tall
|
|
73
|
+
marginBottom: "auto",
|
|
74
|
+
borderRadius: 3,
|
|
75
|
+
whiteSpace: "nowrap",
|
|
76
|
+
wordBreak: "normal",
|
|
77
|
+
overflow: "hidden",
|
|
78
|
+
textOverflow: "ellipsis",
|
|
79
|
+
|
|
80
|
+
...(onClick && { cursor: "pointer" }),
|
|
81
|
+
...(onDelete && {
|
|
82
|
+
borderTopRightRadius: 0,
|
|
83
|
+
borderBottomRightRadius: 0
|
|
84
|
+
}),
|
|
85
|
+
...(doNotFillWidth && { width: "fit-content" }),
|
|
86
|
+
...(clickable && { cursor: "pointer" }),
|
|
87
|
+
...style
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
{nameToUse}
|
|
91
|
+
</span>
|
|
92
|
+
{deleteButton}
|
|
93
|
+
</React.Fragment>
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
if (hasSelection) {
|
|
97
|
+
return (
|
|
98
|
+
<div
|
|
99
|
+
className={classNames("tag-selection", {
|
|
100
|
+
selected,
|
|
101
|
+
"secondary-selected": secondarySelected
|
|
102
|
+
})}
|
|
103
|
+
>
|
|
104
|
+
{tag}
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
} else {
|
|
108
|
+
return tag;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export default Tag;
|
package/ThComponent.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useSortable } from "@dnd-kit/sortable";
|
|
3
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
|
|
6
|
+
export const ThComponent = ({
|
|
7
|
+
toggleSort,
|
|
8
|
+
immovable,
|
|
9
|
+
className,
|
|
10
|
+
children,
|
|
11
|
+
style,
|
|
12
|
+
columnindex,
|
|
13
|
+
...rest
|
|
14
|
+
}) => {
|
|
15
|
+
const index = columnindex ?? -1;
|
|
16
|
+
const { attributes, listeners, setNodeRef, transform, transition } =
|
|
17
|
+
useSortable({
|
|
18
|
+
id: `${index}`,
|
|
19
|
+
disabled: immovable === "true"
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const sortStyles = {
|
|
23
|
+
transform: CSS.Transform.toString(transform),
|
|
24
|
+
transition
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
style={{ ...sortStyles, ...style }}
|
|
30
|
+
ref={setNodeRef}
|
|
31
|
+
{...attributes}
|
|
32
|
+
{...listeners}
|
|
33
|
+
className={classNames("rt-th", className)}
|
|
34
|
+
onClick={e => toggleSort && toggleSort(e)}
|
|
35
|
+
role="columnheader"
|
|
36
|
+
tabIndex="-1" // Resolves eslint issues without implementing keyboard navigation incorrectly
|
|
37
|
+
columnindex={columnindex}
|
|
38
|
+
index={index}
|
|
39
|
+
{...rest}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
};
|
package/TimelineEvent.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import dayjs from "dayjs";
|
|
3
|
+
import { Classes } from "@blueprintjs/core";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import relativeTime from "dayjs/plugin/relativeTime";
|
|
6
|
+
|
|
7
|
+
dayjs.extend(relativeTime);
|
|
8
|
+
|
|
9
|
+
function TimelineEvent({ date, children }) {
|
|
10
|
+
return (
|
|
11
|
+
<div className="tg-timeline-event">
|
|
12
|
+
<div
|
|
13
|
+
style={{
|
|
14
|
+
display: "flex",
|
|
15
|
+
alignItems: "center"
|
|
16
|
+
}}
|
|
17
|
+
>
|
|
18
|
+
<div className="tg-timeline-circle" />
|
|
19
|
+
{children}
|
|
20
|
+
<div
|
|
21
|
+
style={{ marginLeft: 5 }}
|
|
22
|
+
className={classNames(Classes.TEXT_SMALL, Classes.TEXT_MUTED)}
|
|
23
|
+
>
|
|
24
|
+
({dayjs(date).fromNow()})
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default TimelineEvent;
|