@teselagen/ui 0.7.32 → 0.7.33-beta.2
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/DataTable/utils/filterLocalEntitiesToHasura.d.ts +5 -0
- package/DataTable/utils/initializeHasuraWhereAndFilter.d.ts +2 -0
- package/DataTable/utils/queryParams.d.ts +8 -12
- package/DataTable/utils/simplifyHasuraWhere.d.ts +1 -0
- package/DataTable/utils/tableQueryParamsToHasuraClauses.d.ts +14 -0
- package/DropdownButton.js +36 -0
- package/FillWindow.css +6 -0
- package/FillWindow.js +69 -0
- package/{src/DataTable/FilterAndSortMenu.js → FilterAndSortMenu.js} +27 -30
- package/MatchHeaders.js +234 -0
- package/SimpleStepViz.js +22 -0
- package/Tag.js +112 -0
- package/UploadCsvWizard.css +4 -0
- package/UploadCsvWizard.js +719 -0
- package/autoTooltip.js +201 -0
- package/constants.js +1 -0
- package/customIcons.js +361 -0
- package/filterLocalEntitiesToHasura.js +216 -0
- package/index.cjs.js +695 -967
- package/index.d.ts +1 -0
- package/index.es.js +695 -967
- package/initializeHasuraWhereAndFilter.js +27 -0
- package/{src/utils/isBeingCalledExcessively.js → isBeingCalledExcessively.js} +0 -1
- package/package.json +1 -1
- package/queryParams.js +336 -0
- package/rerenderOnWindowResize.js +26 -0
- package/showAppSpinner.js +12 -0
- package/showDialogOnDocBody.js +33 -0
- package/simplifyHasuraWhere.js +80 -0
- package/src/CellDragHandle.js +132 -0
- package/src/ColumnFilterMenu.js +62 -0
- package/src/Columns.js +979 -0
- package/src/DisabledLoadingComponent.js +15 -0
- package/src/DisplayOptions.js +199 -0
- package/src/DropdownCell.js +61 -0
- package/src/EditableCell.js +44 -0
- package/src/FilterAndSortMenu.js +388 -0
- package/src/FormSeparator.js +9 -0
- package/src/LoadingDots.js +14 -0
- package/src/PagingTool.js +225 -0
- package/src/RenderCell.js +191 -0
- package/src/SearchBar.js +69 -0
- package/src/SortableColumns.js +100 -0
- package/src/TableFormTrackerContext.js +10 -0
- package/src/ThComponent.js +44 -0
- package/src/TimelineEvent.js +31 -0
- package/src/Uploader.js +1278 -0
- package/src/adHoc.js +10 -0
- package/src/basicHandleActionsWithFullState.js +14 -0
- package/src/browserUtils.js +3 -0
- package/src/combineReducersWithFullState.js +14 -0
- package/src/commandControls.js +82 -0
- package/src/commandUtils.js +112 -0
- package/src/convertSchema.js +69 -0
- package/src/dataTableEnhancer.js +41 -0
- package/src/defaultFormatters.js +32 -0
- package/src/defaultValidators.js +40 -0
- package/src/determineBlackOrWhiteTextColor.js +4 -0
- package/src/editCellHelper.js +44 -0
- package/src/filterLocalEntitiesToHasura.js +216 -0
- package/src/formatPasteData.js +16 -0
- package/src/getAllRows.js +11 -0
- package/src/getCellCopyText.js +7 -0
- package/src/getCellInfo.js +36 -0
- package/src/getCellVal.js +20 -0
- package/src/getDayjsFormatter.js +35 -0
- package/src/getFieldPathToField.js +7 -0
- package/src/getIdOrCodeOrIndex.js +9 -0
- package/src/getLastSelectedEntity.js +11 -0
- package/src/getNewEntToSelect.js +25 -0
- package/src/getNewName.js +31 -0
- package/src/getRowCopyText.js +28 -0
- package/src/getTableConfigFromStorage.js +5 -0
- package/src/getTextFromEl.js +28 -0
- package/src/getVals.js +8 -0
- package/src/handleCopyColumn.js +21 -0
- package/src/handleCopyHelper.js +15 -0
- package/src/handleCopyRows.js +23 -0
- package/src/handleCopyTable.js +16 -0
- package/src/handlerHelpers.js +24 -0
- package/src/hotkeyUtils.js +131 -0
- package/src/index.js +1 -87
- package/src/initializeHasuraWhereAndFilter.js +27 -0
- package/src/isBeingCalledExcessively.js +24 -0
- package/src/isBottomRightCornerOfRectangle.js +20 -0
- package/src/isEntityClean.js +15 -0
- package/src/isTruthy.js +12 -0
- package/src/isValueEmpty.js +3 -0
- package/src/itemUpload.js +84 -0
- package/src/menuUtils.js +433 -0
- package/src/popoverOverflowModifiers.js +11 -0
- package/src/primarySelectedValue.js +1 -0
- package/src/pureNoFunc.js +31 -0
- package/src/queryParams.js +336 -0
- package/src/removeCleanRows.js +22 -0
- package/src/renderOnDoc.js +32 -0
- package/src/rowClick.js +181 -0
- package/src/selection.js +8 -0
- package/src/showProgressToast.js +22 -0
- package/src/simplifyHasuraWhere.js +80 -0
- package/src/sortify.js +73 -0
- package/src/style.css +24 -260
- package/src/tableQueryParamsToHasuraClauses.js +113 -0
- package/src/{DataTable/utils/withTableParams.js → withTableParams.js} +1 -14
- package/tableQueryParamsToHasuraClauses.js +113 -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 +288 -0
- package/wrapDialog.js +116 -0
- package/src/AdvancedOptions.spec.js +0 -26
- package/src/AsyncValidateFieldSpinner/index.js +0 -12
- package/src/BlueprintError/index.js +0 -14
- package/src/BounceLoader/index.js +0 -16
- package/src/BounceLoader/style.css +0 -45
- package/src/CollapsibleCard/index.js +0 -68
- package/src/CollapsibleCard/style.css +0 -23
- package/src/DNALoader/index.js +0 -20
- package/src/DNALoader/style.css +0 -251
- package/src/DataTable/index.js +0 -3213
- package/src/DataTable/style.css +0 -608
- package/src/DataTable/utils/index.js +0 -55
- package/src/DataTable/utils/queryParams.js +0 -1058
- package/src/DialogFooter/index.js +0 -86
- package/src/DialogFooter/style.css +0 -9
- package/src/FormComponents/index.js +0 -1266
- package/src/FormComponents/style.css +0 -275
- package/src/FormComponents/utils.js +0 -6
- package/src/HotkeysDialog/index.js +0 -79
- package/src/HotkeysDialog/style.css +0 -54
- package/src/InfoHelper/index.js +0 -78
- package/src/InfoHelper/style.css +0 -7
- package/src/IntentText/index.js +0 -18
- package/src/Loading/index.js +0 -70
- package/src/Loading/style.css +0 -4
- package/src/MenuBar/index.js +0 -423
- package/src/MenuBar/style.css +0 -45
- package/src/PromptUnsavedChanges/index.js +0 -38
- package/src/ResizableDraggableDialog/index.js +0 -141
- package/src/ResizableDraggableDialog/style.css +0 -42
- package/src/ScrollToTop/index.js +0 -72
- package/src/TagSelect/index.js +0 -69
- package/src/TagSelect/style.css +0 -13
- package/src/TgHtmlSelect/index.js +0 -20
- package/src/TgSelect/index.js +0 -537
- package/src/TgSelect/style.css +0 -61
- package/src/TgSuggest/index.js +0 -124
- package/src/Timeline/index.js +0 -15
- package/src/enhancers/withDialog/index.js +0 -196
- package/src/showConfirmationDialog/index.js +0 -148
- /package/{src/DataTable/CellDragHandle.js → CellDragHandle.js} +0 -0
- /package/{src/DataTable/ColumnFilterMenu.js → ColumnFilterMenu.js} +0 -0
- /package/{src/DataTable/Columns.js → Columns.js} +0 -0
- /package/{src/DataTable/DisabledLoadingComponent.js → DisabledLoadingComponent.js} +0 -0
- /package/{src/DataTable/DisplayOptions.js → DisplayOptions.js} +0 -0
- /package/{src/DataTable/DropdownCell.js → DropdownCell.js} +0 -0
- /package/{src/DataTable/EditableCell.js → EditableCell.js} +0 -0
- /package/{src/FormComponents/FormSeparator.js → FormSeparator.js} +0 -0
- /package/{src/FormComponents/LoadingDots.js → LoadingDots.js} +0 -0
- /package/{src/DataTable/PagingTool.js → PagingTool.js} +0 -0
- /package/{src/DataTable/RenderCell.js → RenderCell.js} +0 -0
- /package/{src/DataTable/SearchBar.js → SearchBar.js} +0 -0
- /package/{src/DataTable/SortableColumns.js → SortableColumns.js} +0 -0
- /package/{src/DataTable/TableFormTrackerContext.js → TableFormTrackerContext.js} +0 -0
- /package/{src/DataTable/ThComponent.js → ThComponent.js} +0 -0
- /package/{src/Timeline/TimelineEvent.js → TimelineEvent.js} +0 -0
- /package/{src/FormComponents/Uploader.js → Uploader.js} +0 -0
- /package/{src/utils/adHoc.js → adHoc.js} +0 -0
- /package/{src/utils/basicHandleActionsWithFullState.js → basicHandleActionsWithFullState.js} +0 -0
- /package/{src/utils/browserUtils.js → browserUtils.js} +0 -0
- /package/{src/utils/combineReducersWithFullState.js → combineReducersWithFullState.js} +0 -0
- /package/{src/utils/commandControls.js → commandControls.js} +0 -0
- /package/{src/utils/commandUtils.js → commandUtils.js} +0 -0
- /package/{src/DataTable/utils/convertSchema.js → convertSchema.js} +0 -0
- /package/{src/DataTable/dataTableEnhancer.js → dataTableEnhancer.js} +0 -0
- /package/{src/DataTable/defaultFormatters.js → defaultFormatters.js} +0 -0
- /package/{src/DataTable/defaultValidators.js → defaultValidators.js} +0 -0
- /package/{src/utils/determineBlackOrWhiteTextColor.js → determineBlackOrWhiteTextColor.js} +0 -0
- /package/{src/DataTable/editCellHelper.js → editCellHelper.js} +0 -0
- /package/{src/DataTable/utils/formatPasteData.js → formatPasteData.js} +0 -0
- /package/{src/DataTable/utils/getAllRows.js → getAllRows.js} +0 -0
- /package/{src/DataTable/utils/getCellCopyText.js → getCellCopyText.js} +0 -0
- /package/{src/DataTable/utils/getCellInfo.js → getCellInfo.js} +0 -0
- /package/{src/DataTable/getCellVal.js → getCellVal.js} +0 -0
- /package/{src/utils/getDayjsFormatter.js → getDayjsFormatter.js} +0 -0
- /package/{src/DataTable/utils/getFieldPathToField.js → getFieldPathToField.js} +0 -0
- /package/{src/DataTable/utils/getIdOrCodeOrIndex.js → getIdOrCodeOrIndex.js} +0 -0
- /package/{src/DataTable/utils/getLastSelectedEntity.js → getLastSelectedEntity.js} +0 -0
- /package/{src/DataTable/utils/getNewEntToSelect.js → getNewEntToSelect.js} +0 -0
- /package/{src/FormComponents/getNewName.js → getNewName.js} +0 -0
- /package/{src/DataTable/utils/getRowCopyText.js → getRowCopyText.js} +0 -0
- /package/{src/DataTable/utils/getTableConfigFromStorage.js → getTableConfigFromStorage.js} +0 -0
- /package/{src/utils/getTextFromEl.js → getTextFromEl.js} +0 -0
- /package/{src/DataTable/getVals.js → getVals.js} +0 -0
- /package/{src/DataTable/utils/handleCopyColumn.js → handleCopyColumn.js} +0 -0
- /package/{src/DataTable/utils/handleCopyHelper.js → handleCopyHelper.js} +0 -0
- /package/{src/DataTable/utils/handleCopyRows.js → handleCopyRows.js} +0 -0
- /package/{src/DataTable/utils/handleCopyTable.js → handleCopyTable.js} +0 -0
- /package/{src/utils/handlerHelpers.js → handlerHelpers.js} +0 -0
- /package/{src/utils/hotkeyUtils.js → hotkeyUtils.js} +0 -0
- /package/{src/utils/hooks/index.js → index.js} +0 -0
- /package/{src/DataTable/utils/isBottomRightCornerOfRectangle.js → isBottomRightCornerOfRectangle.js} +0 -0
- /package/{src/DataTable/utils/isEntityClean.js → isEntityClean.js} +0 -0
- /package/{src/DataTable/isTruthy.js → isTruthy.js} +0 -0
- /package/{src/DataTable/isValueEmpty.js → isValueEmpty.js} +0 -0
- /package/{src/FormComponents/itemUpload.js → itemUpload.js} +0 -0
- /package/{src/utils/menuUtils.js → menuUtils.js} +0 -0
- /package/{src/utils/popoverOverflowModifiers.js → popoverOverflowModifiers.js} +0 -0
- /package/{src/DataTable/utils/primarySelectedValue.js → primarySelectedValue.js} +0 -0
- /package/{src/utils/pureNoFunc.js → pureNoFunc.js} +0 -0
- /package/{src/DataTable/utils/removeCleanRows.js → removeCleanRows.js} +0 -0
- /package/{src/utils/renderOnDoc.js → renderOnDoc.js} +0 -0
- /package/{src/DataTable/utils/rowClick.js → rowClick.js} +0 -0
- /package/{src/DataTable/utils/selection.js → selection.js} +0 -0
- /package/{src/utils/showProgressToast.js → showProgressToast.js} +0 -0
- /package/{src/FormComponents/sortify.js → sortify.js} +0 -0
- /package/src/{utils/tagUtils.js → tagUtils.js} +0 -0
- /package/src/{utils/tgFormValues.js → tgFormValues.js} +0 -0
- /package/src/{enhancers/withDialog/tg_modalState.js → tg_modalState.js} +0 -0
- /package/src/{FormComponents/tryToMatchSchemas.js → tryToMatchSchemas.js} +0 -0
- /package/src/{utils/hooks/useDeepEqualMemo.js → useDeepEqualMemo.js} +0 -0
- /package/src/{utils/hooks/useStableReference.js → useStableReference.js} +0 -0
- /package/src/{DataTable/utils/useTableEntities.js → useTableEntities.js} +0 -0
- /package/src/{utils/useTraceUpdate.js → useTraceUpdate.js} +0 -0
- /package/src/{DataTable/utils/utils.js → utils.js} +0 -0
- /package/src/{DataTable/validateTableWideErrors.js → validateTableWideErrors.js} +0 -0
- /package/src/{DataTable/viewColumn.js → viewColumn.js} +0 -0
- /package/src/{enhancers/withField.js → withField.js} +0 -0
- /package/src/{enhancers/withFields.js → withFields.js} +0 -0
- /package/src/{enhancers/withLocalStorage.js → withLocalStorage.js} +0 -0
- /package/src/{utils/withSelectTableRecords.js → withSelectTableRecords.js} +0 -0
- /package/src/{DataTable/utils/withSelectedEntities.js → withSelectedEntities.js} +0 -0
- /package/src/{utils/withStore.js → withStore.js} +0 -0
- /package/{src/Timeline/style.css → style.css} +0 -0
package/src/TgSelect/style.css
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
.tg-select {
|
|
2
|
-
width: 100%;
|
|
3
|
-
min-width: 170px;
|
|
4
|
-
}
|
|
5
|
-
.tg-select.tg-select-as-tag {
|
|
6
|
-
/* background-color: red; */
|
|
7
|
-
border-radius: 4px;
|
|
8
|
-
width: fit-content;
|
|
9
|
-
color: white;
|
|
10
|
-
border: 2px solid white;
|
|
11
|
-
}
|
|
12
|
-
.tg-select.tg-select-as-tag .bp3-tag.bp3-minimal.bp3-intent-primary {
|
|
13
|
-
color: white !important;
|
|
14
|
-
}
|
|
15
|
-
.tg-select.do-not-fill-width {
|
|
16
|
-
width: auto;
|
|
17
|
-
min-width: 50px;
|
|
18
|
-
}
|
|
19
|
-
.tg-select.tg-small .bp3-input {
|
|
20
|
-
min-height: 25px;
|
|
21
|
-
height: 25px;
|
|
22
|
-
}
|
|
23
|
-
.tg-select.tg-small input {
|
|
24
|
-
line-height: 10.5px;
|
|
25
|
-
}
|
|
26
|
-
.tg-select.tg-small .bp3-tag-input .bp3-input-ghost {
|
|
27
|
-
line-height: 10.5px;
|
|
28
|
-
}
|
|
29
|
-
.tg-select.tg-small .bp3-tag-input .bp3-tag-input-values {
|
|
30
|
-
margin-top: 2px;
|
|
31
|
-
}
|
|
32
|
-
.tg-select input {
|
|
33
|
-
font-size: 14px;
|
|
34
|
-
}
|
|
35
|
-
.tg-select-option {
|
|
36
|
-
width: fit-content;
|
|
37
|
-
min-width: 100%;
|
|
38
|
-
}
|
|
39
|
-
/* Fix cutoff placeholder */
|
|
40
|
-
.tg-select .bp3-input-ghost[placeholder] {
|
|
41
|
-
width: 80%;
|
|
42
|
-
text-overflow: ellipsis;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.tg-single-select input {
|
|
46
|
-
position: absolute;
|
|
47
|
-
top: 5px;
|
|
48
|
-
}
|
|
49
|
-
.tg-single-select .bp3-tag {
|
|
50
|
-
background-color: initial !important;
|
|
51
|
-
font-size: 14px;
|
|
52
|
-
}
|
|
53
|
-
.tg-single-select .bp3-popover-open .bp3-tag {
|
|
54
|
-
opacity: 0.6;
|
|
55
|
-
}
|
|
56
|
-
.bp3-multi-select-popover .bp3-menu,
|
|
57
|
-
.bp3-select-popover .bp3-menu {
|
|
58
|
-
max-width: 400px;
|
|
59
|
-
max-height: 300px;
|
|
60
|
-
overflow: auto;
|
|
61
|
-
}
|
package/src/TgSuggest/index.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { Suggest } from "@blueprintjs/select";
|
|
2
|
-
import { Keys } from "@blueprintjs/core";
|
|
3
|
-
import React, { useCallback, useMemo, useRef } from "react";
|
|
4
|
-
import classNames from "classnames";
|
|
5
|
-
import { itemListPredicate } from "../TgSelect";
|
|
6
|
-
|
|
7
|
-
const itemRenderer = (i = "", { index, handleClick, modifiers }) => (
|
|
8
|
-
<div //we specifically don't use a BP MenuItem component here because the menu item is too slow when 100s are loaded and will cause the component to lag
|
|
9
|
-
onClick={handleClick}
|
|
10
|
-
key={index}
|
|
11
|
-
className={classNames(
|
|
12
|
-
"tg-select-option bp3-menu-item bp3-fill bp3-text-overflow-ellipsis",
|
|
13
|
-
{
|
|
14
|
-
"bp3-active": modifiers.active
|
|
15
|
-
}
|
|
16
|
-
)}
|
|
17
|
-
>
|
|
18
|
-
{i}
|
|
19
|
-
</div>
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
const TgSuggest = ({
|
|
23
|
-
disabled,
|
|
24
|
-
inputProps: _inputProps,
|
|
25
|
-
intent,
|
|
26
|
-
isLoading,
|
|
27
|
-
isSimpleSearch,
|
|
28
|
-
multi,
|
|
29
|
-
noResultsText,
|
|
30
|
-
notCreateable,
|
|
31
|
-
onBlur,
|
|
32
|
-
onChange,
|
|
33
|
-
optionRenderer, //pull this one out here so it doesn't get passsed along
|
|
34
|
-
options,
|
|
35
|
-
placeholder,
|
|
36
|
-
popoverProps: _popoverProps,
|
|
37
|
-
value,
|
|
38
|
-
...rest
|
|
39
|
-
}) => {
|
|
40
|
-
const inputRef = useRef(null);
|
|
41
|
-
|
|
42
|
-
const handleItemSelect = useCallback(
|
|
43
|
-
item => {
|
|
44
|
-
inputRef.current && inputRef.current.blur();
|
|
45
|
-
return onChange?.(item);
|
|
46
|
-
},
|
|
47
|
-
[onChange]
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
const _itemListPredicate = useCallback(
|
|
51
|
-
(queryString, item) => {
|
|
52
|
-
return itemListPredicate(queryString, item, isSimpleSearch);
|
|
53
|
-
},
|
|
54
|
-
[isSimpleSearch]
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
const popoverProps = useMemo(
|
|
58
|
-
() => ({
|
|
59
|
-
minimal: true,
|
|
60
|
-
className: classNames("tg-select", {
|
|
61
|
-
"tg-single-select": !multi
|
|
62
|
-
}),
|
|
63
|
-
wrapperTagName: "div",
|
|
64
|
-
usePortal: false,
|
|
65
|
-
canEscapeKeyClose: true,
|
|
66
|
-
..._popoverProps
|
|
67
|
-
}),
|
|
68
|
-
[multi, _popoverProps]
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
const onKeyDown = useCallback(e => {
|
|
72
|
-
const { which } = e;
|
|
73
|
-
if (which === Keys.ENTER) {
|
|
74
|
-
e.preventDefault();
|
|
75
|
-
e.stopPropagation(); //this prevents the dialog it is in from closing
|
|
76
|
-
}
|
|
77
|
-
if (which === Keys.ESCAPE || which === Keys.TAB) {
|
|
78
|
-
// By default the escape key will not trigger a blur on the
|
|
79
|
-
// input element. It must be done explicitly.
|
|
80
|
-
if (inputRef.current != null) {
|
|
81
|
-
inputRef.current.blur();
|
|
82
|
-
}
|
|
83
|
-
e.preventDefault();
|
|
84
|
-
e.stopPropagation(); //this prevents dialog's it is in from closing
|
|
85
|
-
}
|
|
86
|
-
}, []);
|
|
87
|
-
|
|
88
|
-
const inputProps = useMemo(
|
|
89
|
-
() => ({
|
|
90
|
-
inputRef: n => {
|
|
91
|
-
if (n) inputRef.current = n;
|
|
92
|
-
},
|
|
93
|
-
placeholder: placeholder || "Type here...",
|
|
94
|
-
disabled: disabled, // tg: adding isLoading will cause the input to be blurred when using generic select asReactSelect (don't do it),
|
|
95
|
-
intent: intent,
|
|
96
|
-
..._inputProps
|
|
97
|
-
}),
|
|
98
|
-
[disabled, _inputProps, intent, placeholder]
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<Suggest
|
|
103
|
-
closeOnSelect
|
|
104
|
-
items={options}
|
|
105
|
-
query={value}
|
|
106
|
-
popoverProps={popoverProps}
|
|
107
|
-
onKeyDown={onKeyDown}
|
|
108
|
-
onItemSelect={handleItemSelect}
|
|
109
|
-
noResults={null}
|
|
110
|
-
resetOnSelect={false}
|
|
111
|
-
onQueryChange={onChange}
|
|
112
|
-
itemRenderer={itemRenderer}
|
|
113
|
-
itemListPredicate={_itemListPredicate}
|
|
114
|
-
selectedItem={value}
|
|
115
|
-
inputValueRenderer={item => item}
|
|
116
|
-
inputProps={inputProps}
|
|
117
|
-
isSimpleSearch={isSimpleSearch}
|
|
118
|
-
onChange={onChange}
|
|
119
|
-
{...rest}
|
|
120
|
-
/>
|
|
121
|
-
);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
export default TgSuggest;
|
package/src/Timeline/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./style.css";
|
|
3
|
-
|
|
4
|
-
function Timeline(props) {
|
|
5
|
-
return (
|
|
6
|
-
<div className="tg-timeline">
|
|
7
|
-
{props.children.length > 1 && <div className="tg-timeline-line" />}
|
|
8
|
-
{props.children}
|
|
9
|
-
</div>
|
|
10
|
-
);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { default as TimelineEvent } from "./TimelineEvent";
|
|
14
|
-
|
|
15
|
-
export default Timeline;
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Dialog } from "@blueprintjs/core";
|
|
3
|
-
import { connect } from "react-redux";
|
|
4
|
-
import { lifecycle, compose } from "recompose";
|
|
5
|
-
import { camelCase } from "lodash-es";
|
|
6
|
-
import { nanoid } from "nanoid";
|
|
7
|
-
import ResizableDraggableDialog from "../../ResizableDraggableDialog";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* usage:
|
|
11
|
-
* in container:
|
|
12
|
-
* compose(
|
|
13
|
-
* withDialog({ title: "Select Aliquot(s) From", other bp dialog props here })
|
|
14
|
-
* )
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* in react component
|
|
18
|
-
* import MyDialogEnhancedComponent from "./MyDialogEnhancedComponent"
|
|
19
|
-
*
|
|
20
|
-
* render() {
|
|
21
|
-
* return <div>
|
|
22
|
-
* <MyDialogEnhancedComponent
|
|
23
|
-
* dialogProps={} //bp dialog overrides can go here
|
|
24
|
-
* target={<button>Open Dialog</button> } //target can also be passed as a child component
|
|
25
|
-
* myRandomProp={'yuppp'} //pass any other props like normal to the component
|
|
26
|
-
*
|
|
27
|
-
* />
|
|
28
|
-
* </div>
|
|
29
|
-
* }
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
// or programatically:
|
|
33
|
-
// const ProgramaticDialog = withDialog({
|
|
34
|
-
// dialogName: "programaticDialog", //giving it a unique dialogName means you can
|
|
35
|
-
// title: "Programatic Dialog Demo"
|
|
36
|
-
// })(DialogInner);
|
|
37
|
-
//
|
|
38
|
-
// add the no target dialog somewhere on the page
|
|
39
|
-
// <ProgramaticDialog></ProgramaticDialog> //this just renders without any target
|
|
40
|
-
//
|
|
41
|
-
// somewhere else on the page:
|
|
42
|
-
// <Button>Click To Open Dialog</Button>
|
|
43
|
-
|
|
44
|
-
export default function withDialog(topLevelDialogProps) {
|
|
45
|
-
function dialogHoc(WrappedComponent) {
|
|
46
|
-
return class DialogWrapper extends React.Component {
|
|
47
|
-
componentWillUnmount() {
|
|
48
|
-
const { dispatch, dialogName, uniqueName } = this.props;
|
|
49
|
-
if (dialogName) {
|
|
50
|
-
dispatch({
|
|
51
|
-
type: "TG_UNREGISTER_MODAL",
|
|
52
|
-
name: dialogName,
|
|
53
|
-
uniqueName
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
render() {
|
|
58
|
-
const {
|
|
59
|
-
target,
|
|
60
|
-
noTarget,
|
|
61
|
-
isDialogOpen,
|
|
62
|
-
showModal,
|
|
63
|
-
dialogName,
|
|
64
|
-
onClickRename,
|
|
65
|
-
hideModal,
|
|
66
|
-
fetchPolicy = "network-only",
|
|
67
|
-
children,
|
|
68
|
-
onCloseHook,
|
|
69
|
-
dialogProps,
|
|
70
|
-
title,
|
|
71
|
-
isDraggable,
|
|
72
|
-
alreadyRendering,
|
|
73
|
-
...rest
|
|
74
|
-
} = this.props;
|
|
75
|
-
const extraDialogProps = {
|
|
76
|
-
...topLevelDialogProps,
|
|
77
|
-
...dialogProps
|
|
78
|
-
};
|
|
79
|
-
const _onCloseHook = onCloseHook || extraDialogProps.onCloseHook;
|
|
80
|
-
const { noButtonClickPropagate } = {
|
|
81
|
-
...this.props,
|
|
82
|
-
...extraDialogProps
|
|
83
|
-
};
|
|
84
|
-
const isOpen = isDialogOpen || extraDialogProps.isOpen;
|
|
85
|
-
const targetEl = target || children;
|
|
86
|
-
// if (!targetEl && !dialogName)
|
|
87
|
-
// throw new Error(
|
|
88
|
-
// "withDialog error: Please provide a target or child element to the withDialog() enhanced component. If you really don't want a target, please pass a 'noTarget=true' prop"
|
|
89
|
-
// );
|
|
90
|
-
const DialogToUse =
|
|
91
|
-
isDraggable || extraDialogProps.isDraggable
|
|
92
|
-
? ResizableDraggableDialog
|
|
93
|
-
: Dialog;
|
|
94
|
-
return (
|
|
95
|
-
<React.Fragment>
|
|
96
|
-
{isOpen && (
|
|
97
|
-
<DialogToUse
|
|
98
|
-
onClose={function () {
|
|
99
|
-
hideModal();
|
|
100
|
-
_onCloseHook && _onCloseHook();
|
|
101
|
-
}}
|
|
102
|
-
className={dialogName || camelCase()}
|
|
103
|
-
title={title}
|
|
104
|
-
isOpen={isOpen}
|
|
105
|
-
canEscapeKeyClose={false}
|
|
106
|
-
canOutsideClickClose={false}
|
|
107
|
-
{...extraDialogProps}
|
|
108
|
-
>
|
|
109
|
-
<WrappedComponent
|
|
110
|
-
{...{
|
|
111
|
-
...rest,
|
|
112
|
-
fetchPolicy,
|
|
113
|
-
ssr: false,
|
|
114
|
-
hideModal
|
|
115
|
-
}}
|
|
116
|
-
/>
|
|
117
|
-
</DialogToUse>
|
|
118
|
-
)}
|
|
119
|
-
{targetEl &&
|
|
120
|
-
React.cloneElement(targetEl, {
|
|
121
|
-
[onClickRename || "onClick"]: e => {
|
|
122
|
-
showModal();
|
|
123
|
-
if (noButtonClickPropagate) {
|
|
124
|
-
e.preventDefault();
|
|
125
|
-
e.stopPropagation();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
})}
|
|
129
|
-
</React.Fragment>
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return compose(
|
|
136
|
-
connect(({ tg_modalState }) => {
|
|
137
|
-
return { ...topLevelDialogProps, tg_modalState };
|
|
138
|
-
}),
|
|
139
|
-
lifecycle({
|
|
140
|
-
componentWillMount: function () {
|
|
141
|
-
const { dispatch, dialogName } = this.props;
|
|
142
|
-
const uniqueName = nanoid();
|
|
143
|
-
const nameToUse = dialogName || uniqueName;
|
|
144
|
-
this.setState({
|
|
145
|
-
nameToUse,
|
|
146
|
-
uniqueName
|
|
147
|
-
});
|
|
148
|
-
if (dialogName) {
|
|
149
|
-
dispatch({
|
|
150
|
-
type: "TG_REGISTER_MODAL",
|
|
151
|
-
name: dialogName,
|
|
152
|
-
uniqueName
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}),
|
|
157
|
-
connect(
|
|
158
|
-
function ({ tg_modalState }, { nameToUse, uniqueName }) {
|
|
159
|
-
const dialogState = tg_modalState[nameToUse] || {};
|
|
160
|
-
const { open, __registeredAs, ...rest } = dialogState;
|
|
161
|
-
const newProps = {
|
|
162
|
-
...rest,
|
|
163
|
-
isDialogOpen:
|
|
164
|
-
open &&
|
|
165
|
-
(__registeredAs
|
|
166
|
-
? Object.keys(__registeredAs)[
|
|
167
|
-
Object.keys(__registeredAs).length - 1
|
|
168
|
-
] === uniqueName
|
|
169
|
-
: true)
|
|
170
|
-
};
|
|
171
|
-
return newProps;
|
|
172
|
-
},
|
|
173
|
-
function (dispatch, { nameToUse, hideModal, showModal }) {
|
|
174
|
-
return {
|
|
175
|
-
showModal:
|
|
176
|
-
showModal ||
|
|
177
|
-
function () {
|
|
178
|
-
dispatch({
|
|
179
|
-
type: "TG_SHOW_MODAL",
|
|
180
|
-
name: nameToUse
|
|
181
|
-
});
|
|
182
|
-
},
|
|
183
|
-
hideModal:
|
|
184
|
-
hideModal ||
|
|
185
|
-
function () {
|
|
186
|
-
dispatch({
|
|
187
|
-
type: "TG_HIDE_MODAL",
|
|
188
|
-
name: nameToUse
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
),
|
|
194
|
-
dialogHoc
|
|
195
|
-
);
|
|
196
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import React, { Component } from "react";
|
|
2
|
-
import { Button, Classes, Dialog, Intent } from "@blueprintjs/core";
|
|
3
|
-
import { renderOnDoc } from "../utils/renderOnDoc";
|
|
4
|
-
import DialogFooter from "../DialogFooter";
|
|
5
|
-
|
|
6
|
-
// usage
|
|
7
|
-
// const doAction = await showConfirmationDialog({
|
|
8
|
-
// text:
|
|
9
|
-
// "Are you sure you want to re-run this tool? Downstream tools with linked outputs will need to be re-run as well!",
|
|
10
|
-
// intent: Intent.DANGER, //applied to the right most confirm button
|
|
11
|
-
// confirmButtonText: "Yep!",
|
|
12
|
-
// cancelButtonText: "Nope",
|
|
13
|
-
// canEscapeKeyCancel: true //this is false by default
|
|
14
|
-
// });
|
|
15
|
-
// console.info("doAction:", doAction);
|
|
16
|
-
|
|
17
|
-
// const doAction = await showConfirmationDialog({
|
|
18
|
-
// thirdButtonText: 'Click me'
|
|
19
|
-
// thirdButtonIntent: 'primary'
|
|
20
|
-
// });
|
|
21
|
-
// console.info("doAction:", doAction); //logs thirdButtonClicked
|
|
22
|
-
//returns a promise that resolves with true or false depending on if the user cancels or not!
|
|
23
|
-
export default function showConfirmationDialog(opts) {
|
|
24
|
-
return new Promise(resolve => {
|
|
25
|
-
renderOnDoc(handleClose => {
|
|
26
|
-
return <AlertWrapper {...{ ...opts, handleClose, resolve }} />;
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export class AlertWrapper extends Component {
|
|
32
|
-
state = { isOpen: true };
|
|
33
|
-
render() {
|
|
34
|
-
const {
|
|
35
|
-
title,
|
|
36
|
-
handleClose,
|
|
37
|
-
text,
|
|
38
|
-
resolve,
|
|
39
|
-
noCancelButton,
|
|
40
|
-
content,
|
|
41
|
-
className,
|
|
42
|
-
thirdButtonNotMinimal,
|
|
43
|
-
thirdButtonClassName,
|
|
44
|
-
thirdButtonText,
|
|
45
|
-
thirdButtonIntent,
|
|
46
|
-
fourthButtonNotMinimal,
|
|
47
|
-
fourthButtonClassName,
|
|
48
|
-
fourthButtonText,
|
|
49
|
-
fourthButtonIntent,
|
|
50
|
-
handleSubmit,
|
|
51
|
-
canEscapeKeyCancel,
|
|
52
|
-
confirmButtonText = "OK",
|
|
53
|
-
cancelButtonText = "Cancel",
|
|
54
|
-
intent = Intent.PRIMARY,
|
|
55
|
-
...rest
|
|
56
|
-
} = this.props;
|
|
57
|
-
const doClose = confirm => {
|
|
58
|
-
handleClose();
|
|
59
|
-
this.setState({ isOpen: false });
|
|
60
|
-
resolve(confirm);
|
|
61
|
-
};
|
|
62
|
-
return (
|
|
63
|
-
<Dialog
|
|
64
|
-
title={title}
|
|
65
|
-
className={(title ? "" : "bp3-alert") + ` ${className || ""}`}
|
|
66
|
-
isOpen={this.state.isOpen}
|
|
67
|
-
intent={intent}
|
|
68
|
-
cancelButtonText={cancelButtonText}
|
|
69
|
-
onCancel={cancelButtonText ? () => doClose(false) : undefined}
|
|
70
|
-
onConfirm={
|
|
71
|
-
handleSubmit ? handleSubmit(v => doClose(v)) : () => doClose(true)
|
|
72
|
-
}
|
|
73
|
-
{...rest}
|
|
74
|
-
{...(noCancelButton && {
|
|
75
|
-
onCancel: undefined,
|
|
76
|
-
cancelButtonText: undefined
|
|
77
|
-
})}
|
|
78
|
-
>
|
|
79
|
-
<div
|
|
80
|
-
className={title ? "bp3-dialog-body" : "bp3-alert-contents"}
|
|
81
|
-
style={{ padding: 5 }}
|
|
82
|
-
>
|
|
83
|
-
{content}
|
|
84
|
-
{text && <div style={{ marginBottom: 10 }}>{text}</div>}
|
|
85
|
-
</div>
|
|
86
|
-
<DialogFooter
|
|
87
|
-
{...{
|
|
88
|
-
onBackClick:
|
|
89
|
-
cancelButtonText && !noCancelButton
|
|
90
|
-
? () => doClose(false)
|
|
91
|
-
: undefined,
|
|
92
|
-
onClick: handleSubmit
|
|
93
|
-
? handleSubmit(v => doClose(v))
|
|
94
|
-
: () => doClose(true),
|
|
95
|
-
noCancel: true,
|
|
96
|
-
additionalButtons:
|
|
97
|
-
thirdButtonText || fourthButtonText ? (
|
|
98
|
-
<React.Fragment>
|
|
99
|
-
{!!fourthButtonText && (
|
|
100
|
-
<Button
|
|
101
|
-
className={
|
|
102
|
-
(!fourthButtonNotMinimal ? Classes.MINIMAL : "") +
|
|
103
|
-
" " +
|
|
104
|
-
fourthButtonClassName
|
|
105
|
-
}
|
|
106
|
-
intent={fourthButtonIntent}
|
|
107
|
-
text={fourthButtonText}
|
|
108
|
-
onClick={
|
|
109
|
-
handleSubmit
|
|
110
|
-
? handleSubmit(v =>
|
|
111
|
-
doClose({ ...v, fourthButtonClicked: true })
|
|
112
|
-
)
|
|
113
|
-
: () => doClose("fourthButtonClicked")
|
|
114
|
-
}
|
|
115
|
-
></Button>
|
|
116
|
-
)}
|
|
117
|
-
{!!thirdButtonText && (
|
|
118
|
-
<Button
|
|
119
|
-
className={
|
|
120
|
-
(!thirdButtonNotMinimal ? Classes.MINIMAL : "") +
|
|
121
|
-
" " +
|
|
122
|
-
thirdButtonClassName
|
|
123
|
-
}
|
|
124
|
-
intent={thirdButtonIntent}
|
|
125
|
-
text={thirdButtonText}
|
|
126
|
-
onClick={
|
|
127
|
-
handleSubmit
|
|
128
|
-
? handleSubmit(v =>
|
|
129
|
-
doClose({ ...v, thirdButtonClicked: true })
|
|
130
|
-
)
|
|
131
|
-
: () => {
|
|
132
|
-
doClose("thirdButtonClicked");
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
></Button>
|
|
136
|
-
)}
|
|
137
|
-
</React.Fragment>
|
|
138
|
-
) : undefined,
|
|
139
|
-
containerClassname: title ? "" : "bp3-alert-footer",
|
|
140
|
-
backText: noCancelButton ? "" : cancelButtonText,
|
|
141
|
-
text: confirmButtonText,
|
|
142
|
-
intent
|
|
143
|
-
}}
|
|
144
|
-
></DialogFooter>
|
|
145
|
-
</Dialog>
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{src/utils/basicHandleActionsWithFullState.js → basicHandleActionsWithFullState.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{src/DataTable/utils/isBottomRightCornerOfRectangle.js → isBottomRightCornerOfRectangle.js}
RENAMED
|
File without changes
|
|
File without changes
|