@teselagen/ui 0.7.33-beta.6 → 0.7.34

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.
Files changed (114) hide show
  1. package/AdvancedOptions.js +33 -0
  2. package/AssignDefaultsModeContext.js +22 -0
  3. package/CellDragHandle.js +132 -0
  4. package/ColumnFilterMenu.js +62 -0
  5. package/Columns.js +979 -0
  6. package/DataTable/utils/queryParams.d.ts +14 -7
  7. package/DisabledLoadingComponent.js +15 -0
  8. package/DisplayOptions.js +199 -0
  9. package/DropdownButton.js +36 -0
  10. package/DropdownCell.js +61 -0
  11. package/EditableCell.js +44 -0
  12. package/FillWindow.css +6 -0
  13. package/FillWindow.js +69 -0
  14. package/FilterAndSortMenu.js +391 -0
  15. package/FormSeparator.js +9 -0
  16. package/LoadingDots.js +14 -0
  17. package/MatchHeaders.js +234 -0
  18. package/PagingTool.js +225 -0
  19. package/RenderCell.js +191 -0
  20. package/SearchBar.js +69 -0
  21. package/SimpleStepViz.js +22 -0
  22. package/SortableColumns.js +100 -0
  23. package/TableFormTrackerContext.js +10 -0
  24. package/Tag.js +112 -0
  25. package/ThComponent.js +44 -0
  26. package/TimelineEvent.js +31 -0
  27. package/UploadCsvWizard.css +4 -0
  28. package/UploadCsvWizard.js +719 -0
  29. package/Uploader.js +1278 -0
  30. package/adHoc.js +10 -0
  31. package/autoTooltip.js +201 -0
  32. package/basicHandleActionsWithFullState.js +14 -0
  33. package/browserUtils.js +3 -0
  34. package/combineReducersWithFullState.js +14 -0
  35. package/commandControls.js +82 -0
  36. package/commandUtils.js +112 -0
  37. package/constants.js +1 -0
  38. package/convertSchema.js +69 -0
  39. package/customIcons.js +361 -0
  40. package/dataTableEnhancer.js +41 -0
  41. package/defaultFormatters.js +32 -0
  42. package/defaultValidators.js +40 -0
  43. package/determineBlackOrWhiteTextColor.js +4 -0
  44. package/editCellHelper.js +44 -0
  45. package/formatPasteData.js +16 -0
  46. package/getAllRows.js +11 -0
  47. package/getCellCopyText.js +7 -0
  48. package/getCellInfo.js +36 -0
  49. package/getCellVal.js +20 -0
  50. package/getDayjsFormatter.js +35 -0
  51. package/getFieldPathToField.js +7 -0
  52. package/getIdOrCodeOrIndex.js +9 -0
  53. package/getLastSelectedEntity.js +11 -0
  54. package/getNewEntToSelect.js +25 -0
  55. package/getNewName.js +31 -0
  56. package/getRowCopyText.js +28 -0
  57. package/getTableConfigFromStorage.js +5 -0
  58. package/getTextFromEl.js +28 -0
  59. package/getVals.js +8 -0
  60. package/handleCopyColumn.js +21 -0
  61. package/handleCopyHelper.js +15 -0
  62. package/handleCopyRows.js +23 -0
  63. package/handleCopyTable.js +16 -0
  64. package/handlerHelpers.js +24 -0
  65. package/hotkeyUtils.js +131 -0
  66. package/index.cjs.js +972 -837
  67. package/index.d.ts +0 -1
  68. package/index.es.js +972 -837
  69. package/index.js +1 -0
  70. package/isBeingCalledExcessively.js +31 -0
  71. package/isBottomRightCornerOfRectangle.js +20 -0
  72. package/isEntityClean.js +15 -0
  73. package/isTruthy.js +12 -0
  74. package/isValueEmpty.js +3 -0
  75. package/itemUpload.js +84 -0
  76. package/menuUtils.js +433 -0
  77. package/package.json +1 -2
  78. package/popoverOverflowModifiers.js +11 -0
  79. package/primarySelectedValue.js +1 -0
  80. package/pureNoFunc.js +31 -0
  81. package/queryParams.js +1058 -0
  82. package/removeCleanRows.js +22 -0
  83. package/renderOnDoc.js +32 -0
  84. package/rerenderOnWindowResize.js +26 -0
  85. package/rowClick.js +181 -0
  86. package/selection.js +8 -0
  87. package/showAppSpinner.js +12 -0
  88. package/showDialogOnDocBody.js +33 -0
  89. package/showProgressToast.js +22 -0
  90. package/sortify.js +73 -0
  91. package/style.css +13 -0
  92. package/tagUtils.js +45 -0
  93. package/tgFormValues.js +35 -0
  94. package/tg_modalState.js +47 -0
  95. package/throwFormError.js +16 -0
  96. package/toastr.js +148 -0
  97. package/tryToMatchSchemas.js +264 -0
  98. package/typeToCommonType.js +6 -0
  99. package/useDeepEqualMemo.js +15 -0
  100. package/useDialog.js +63 -0
  101. package/useStableReference.js +9 -0
  102. package/useTableEntities.js +38 -0
  103. package/useTraceUpdate.js +19 -0
  104. package/utils.js +37 -0
  105. package/validateTableWideErrors.js +160 -0
  106. package/viewColumn.js +97 -0
  107. package/withField.js +20 -0
  108. package/withFields.js +11 -0
  109. package/withLocalStorage.js +11 -0
  110. package/withSelectTableRecords.js +43 -0
  111. package/withSelectedEntities.js +65 -0
  112. package/withStore.js +10 -0
  113. package/withTableParams.js +301 -0
  114. 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
+ &#10005;
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
+ };
@@ -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;
@@ -0,0 +1,4 @@
1
+ .rg-celleditor-input,
2
+ .rg-celleditor input {
3
+ border: none;
4
+ }