@teselagen/ui 0.7.33-beta.1 → 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/package.json +1 -1
- package/src/AdvancedOptions.js +33 -0
- package/src/AssignDefaultsModeContext.js +22 -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/DropdownButton.js +36 -0
- package/src/DropdownCell.js +61 -0
- package/src/EditableCell.js +44 -0
- package/src/FillWindow.css +6 -0
- package/src/FillWindow.js +69 -0
- package/src/FilterAndSortMenu.js +388 -0
- package/src/FormSeparator.js +9 -0
- package/src/LoadingDots.js +14 -0
- package/src/MatchHeaders.js +234 -0
- package/src/PagingTool.js +225 -0
- package/src/RenderCell.js +191 -0
- package/src/SearchBar.js +69 -0
- package/src/SimpleStepViz.js +22 -0
- package/src/SortableColumns.js +100 -0
- package/src/TableFormTrackerContext.js +10 -0
- package/src/Tag.js +112 -0
- package/src/ThComponent.js +44 -0
- package/src/TimelineEvent.js +31 -0
- package/src/UploadCsvWizard.css +4 -0
- package/src/UploadCsvWizard.js +719 -0
- package/src/Uploader.js +1278 -0
- package/src/adHoc.js +10 -0
- package/src/autoTooltip.js +201 -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/constants.js +1 -0
- package/src/convertSchema.js +69 -0
- package/src/customIcons.js +361 -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 -0
- 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/rerenderOnWindowResize.js +26 -0
- package/src/rowClick.js +181 -0
- package/src/selection.js +8 -0
- package/src/showAppSpinner.js +12 -0
- package/src/showDialogOnDocBody.js +33 -0
- package/src/showProgressToast.js +22 -0
- package/src/simplifyHasuraWhere.js +80 -0
- package/src/sortify.js +73 -0
- package/src/style.css +29 -0
- package/src/tableQueryParamsToHasuraClauses.js +113 -0
- package/src/tagUtils.js +45 -0
- package/src/tgFormValues.js +35 -0
- package/src/tg_modalState.js +47 -0
- package/src/throwFormError.js +16 -0
- package/src/toastr.js +148 -0
- package/src/tryToMatchSchemas.js +264 -0
- package/src/typeToCommonType.js +6 -0
- package/src/useDeepEqualMemo.js +15 -0
- package/src/useDialog.js +63 -0
- package/src/useStableReference.js +9 -0
- package/src/useTableEntities.js +38 -0
- package/src/useTraceUpdate.js +19 -0
- package/src/utils.js +37 -0
- package/src/validateTableWideErrors.js +160 -0
- package/src/viewColumn.js +97 -0
- package/src/withField.js +20 -0
- package/src/withFields.js +11 -0
- package/src/withLocalStorage.js +11 -0
- package/src/withSelectTableRecords.js +43 -0
- package/src/withSelectedEntities.js +65 -0
- package/src/withStore.js +10 -0
- package/src/withTableParams.js +288 -0
- package/src/wrapDialog.js +116 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ReactTableDefaults } from "@teselagen/react-table";
|
|
3
|
+
const { LoadingComponent } = ReactTableDefaults;
|
|
4
|
+
|
|
5
|
+
function DisabledLoadingComponent({ disabled, loading, loadingText }) {
|
|
6
|
+
return (
|
|
7
|
+
<LoadingComponent
|
|
8
|
+
className={disabled ? "disabled" : ""}
|
|
9
|
+
loading={loading}
|
|
10
|
+
loadingText={disabled ? "" : loadingText}
|
|
11
|
+
/>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default DisabledLoadingComponent;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { map, isEmpty, noop, startCase } from "lodash-es";
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
Checkbox,
|
|
6
|
+
Menu,
|
|
7
|
+
MenuItem,
|
|
8
|
+
Classes,
|
|
9
|
+
InputGroup,
|
|
10
|
+
Popover,
|
|
11
|
+
Switch
|
|
12
|
+
} from "@blueprintjs/core";
|
|
13
|
+
import { getCCDisplayName } from "./utils/queryParams";
|
|
14
|
+
|
|
15
|
+
const DisplayOptions = ({
|
|
16
|
+
compact,
|
|
17
|
+
extraCompact,
|
|
18
|
+
disabled,
|
|
19
|
+
hideDisplayOptionsIcon,
|
|
20
|
+
resetDefaultVisibility = noop,
|
|
21
|
+
updateColumnVisibility = noop,
|
|
22
|
+
updateTableDisplayDensity,
|
|
23
|
+
showForcedHiddenColumns,
|
|
24
|
+
setShowForcedHidden,
|
|
25
|
+
hasOptionForForcedHidden,
|
|
26
|
+
schema
|
|
27
|
+
}) => {
|
|
28
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
29
|
+
const [searchTerms, setSearchTerms] = useState({});
|
|
30
|
+
|
|
31
|
+
const changeTableDensity = e => {
|
|
32
|
+
updateTableDisplayDensity(e.target.value);
|
|
33
|
+
setIsOpen(false);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const toggleForcedHidden = e => setShowForcedHidden(e.target.checked);
|
|
37
|
+
|
|
38
|
+
if (hideDisplayOptionsIcon) {
|
|
39
|
+
return null; //don't show antyhing!
|
|
40
|
+
}
|
|
41
|
+
const { fields } = schema;
|
|
42
|
+
const fieldGroups = {};
|
|
43
|
+
const mainFields = [];
|
|
44
|
+
|
|
45
|
+
fields.forEach(field => {
|
|
46
|
+
if (field.hideInMenu) return;
|
|
47
|
+
if (!field.fieldGroup) return mainFields.push(field);
|
|
48
|
+
if (!fieldGroups[field.fieldGroup]) fieldGroups[field.fieldGroup] = [];
|
|
49
|
+
fieldGroups[field.fieldGroup].push(field);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
let numVisible = 0;
|
|
53
|
+
|
|
54
|
+
const getFieldCheckbox = (field, i) => {
|
|
55
|
+
const { displayName, isHidden, isForcedHidden, path } = field;
|
|
56
|
+
if (isForcedHidden) return;
|
|
57
|
+
if (!isHidden) numVisible++;
|
|
58
|
+
return (
|
|
59
|
+
<Checkbox
|
|
60
|
+
name={`${path}-${i}`}
|
|
61
|
+
key={path || i}
|
|
62
|
+
onChange={() => {
|
|
63
|
+
if (numVisible <= 1 && !isHidden) {
|
|
64
|
+
return window.toastr.warning(
|
|
65
|
+
"We have to display at least one column :)"
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
updateColumnVisibility({ shouldShow: isHidden, path });
|
|
69
|
+
}}
|
|
70
|
+
checked={!isHidden}
|
|
71
|
+
label={displayName}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
let fieldGroupMenu;
|
|
77
|
+
if (!isEmpty(fieldGroups)) {
|
|
78
|
+
fieldGroupMenu = map(fieldGroups, (groupFields, groupName) => {
|
|
79
|
+
const searchTerm = searchTerms[groupName] || "";
|
|
80
|
+
const anyVisible = groupFields.some(
|
|
81
|
+
field => !field.isHidden && !field.isForcedHidden
|
|
82
|
+
);
|
|
83
|
+
const anyNotForcedHidden = groupFields.some(
|
|
84
|
+
field => !field.isForcedHidden
|
|
85
|
+
);
|
|
86
|
+
if (!anyNotForcedHidden) return;
|
|
87
|
+
return (
|
|
88
|
+
<MenuItem key={groupName} text={groupName}>
|
|
89
|
+
<InputGroup
|
|
90
|
+
leftIcon="search"
|
|
91
|
+
value={searchTerm}
|
|
92
|
+
onChange={e => {
|
|
93
|
+
setSearchTerms(prev => ({
|
|
94
|
+
...prev,
|
|
95
|
+
[groupName]: e.target.value
|
|
96
|
+
}));
|
|
97
|
+
}}
|
|
98
|
+
/>
|
|
99
|
+
<Button
|
|
100
|
+
className={Classes.MINIMAL}
|
|
101
|
+
text={(anyVisible ? "Hide" : "Show") + " All"}
|
|
102
|
+
style={{ margin: "10px 0" }}
|
|
103
|
+
onClick={() => {
|
|
104
|
+
updateColumnVisibility({
|
|
105
|
+
shouldShow: !anyVisible,
|
|
106
|
+
paths: groupFields.map(field => field.path)
|
|
107
|
+
});
|
|
108
|
+
}}
|
|
109
|
+
/>
|
|
110
|
+
{groupFields
|
|
111
|
+
.filter(
|
|
112
|
+
field =>
|
|
113
|
+
startCase(getCCDisplayName(field)) // We have to use startCase with the camelCase here because the displayName is not always a string
|
|
114
|
+
.toLowerCase()
|
|
115
|
+
.indexOf(searchTerm.toLowerCase()) > -1
|
|
116
|
+
)
|
|
117
|
+
.map(getFieldCheckbox)}
|
|
118
|
+
</MenuItem>
|
|
119
|
+
);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<Popover
|
|
125
|
+
isOpen={isOpen}
|
|
126
|
+
onClose={() => setIsOpen(false)}
|
|
127
|
+
content={
|
|
128
|
+
<Menu>
|
|
129
|
+
<div style={{ padding: 10, paddingLeft: 20, paddingRight: 20 }}>
|
|
130
|
+
<h5 style={{ marginBottom: 10 }}>Display Density:</h5>
|
|
131
|
+
<div className={Classes.SELECT + " tg-table-display-density"}>
|
|
132
|
+
<select
|
|
133
|
+
onChange={changeTableDensity}
|
|
134
|
+
value={
|
|
135
|
+
extraCompact ? "extraCompact" : compact ? "compact" : "normal"
|
|
136
|
+
}
|
|
137
|
+
>
|
|
138
|
+
<option className={Classes.POPOVER_DISMISS} value="normal">
|
|
139
|
+
Comfortable
|
|
140
|
+
</option>
|
|
141
|
+
{/* tnr: as you can see we're calling what was "compact" Normal now in response to https://github.com/TeselaGen/lims/issues/4713 */}
|
|
142
|
+
<option className={Classes.POPOVER_DISMISS} value="compact">
|
|
143
|
+
Normal
|
|
144
|
+
</option>
|
|
145
|
+
<option
|
|
146
|
+
className={Classes.POPOVER_DISMISS}
|
|
147
|
+
value="extraCompact"
|
|
148
|
+
>
|
|
149
|
+
Compact
|
|
150
|
+
</option>
|
|
151
|
+
</select>
|
|
152
|
+
</div>
|
|
153
|
+
<h5 style={{ marginBottom: 10, marginTop: 10 }}>
|
|
154
|
+
Displayed Columns:
|
|
155
|
+
</h5>
|
|
156
|
+
<div style={{ maxHeight: 260, overflowY: "auto", padding: 2 }}>
|
|
157
|
+
{mainFields.map(getFieldCheckbox)}
|
|
158
|
+
</div>
|
|
159
|
+
<div>{fieldGroupMenu}</div>
|
|
160
|
+
{hasOptionForForcedHidden && (
|
|
161
|
+
<div style={{ marginTop: 15 }}>
|
|
162
|
+
<Switch
|
|
163
|
+
label="Show Empty Columns"
|
|
164
|
+
checked={showForcedHiddenColumns}
|
|
165
|
+
onChange={toggleForcedHidden}
|
|
166
|
+
/>
|
|
167
|
+
</div>
|
|
168
|
+
)}
|
|
169
|
+
<div
|
|
170
|
+
style={{
|
|
171
|
+
width: "100%",
|
|
172
|
+
display: "flex",
|
|
173
|
+
justifyContent: "flex-end"
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
<Button
|
|
177
|
+
onClick={resetDefaultVisibility}
|
|
178
|
+
title="Display Options"
|
|
179
|
+
minimal
|
|
180
|
+
>
|
|
181
|
+
Reset
|
|
182
|
+
</Button>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
</Menu>
|
|
186
|
+
}
|
|
187
|
+
>
|
|
188
|
+
<Button
|
|
189
|
+
className="tg-table-display-options"
|
|
190
|
+
onClick={() => setIsOpen(true)}
|
|
191
|
+
disabled={disabled}
|
|
192
|
+
minimal
|
|
193
|
+
icon="cog"
|
|
194
|
+
/>
|
|
195
|
+
</Popover>
|
|
196
|
+
);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export default DisplayOptions;
|
|
@@ -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,61 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import TgSelect from "../TgSelect";
|
|
4
|
+
|
|
5
|
+
export const DropdownCell = ({
|
|
6
|
+
options,
|
|
7
|
+
isMulti,
|
|
8
|
+
initialValue,
|
|
9
|
+
finishEdit,
|
|
10
|
+
cancelEdit,
|
|
11
|
+
dataTest
|
|
12
|
+
}) => {
|
|
13
|
+
const [v, setV] = useState(
|
|
14
|
+
isMulti
|
|
15
|
+
? initialValue.split(",").map(v => ({ value: v, label: v }))
|
|
16
|
+
: initialValue
|
|
17
|
+
);
|
|
18
|
+
return (
|
|
19
|
+
<div
|
|
20
|
+
className={classNames("tg-dropdown-cell-edit-container", {
|
|
21
|
+
"tg-dropdown-cell-edit-container-multi": isMulti
|
|
22
|
+
})}
|
|
23
|
+
>
|
|
24
|
+
<TgSelect
|
|
25
|
+
small
|
|
26
|
+
multi={isMulti}
|
|
27
|
+
autoOpen
|
|
28
|
+
value={v}
|
|
29
|
+
onChange={val => {
|
|
30
|
+
if (isMulti) {
|
|
31
|
+
setV(val);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
finishEdit(val ? val.value : null);
|
|
35
|
+
}}
|
|
36
|
+
{...dataTest}
|
|
37
|
+
popoverProps={{
|
|
38
|
+
onClose: e => {
|
|
39
|
+
if (isMulti) {
|
|
40
|
+
if (e && e.key === "Escape") {
|
|
41
|
+
cancelEdit();
|
|
42
|
+
} else {
|
|
43
|
+
finishEdit(
|
|
44
|
+
v && v.map
|
|
45
|
+
? v
|
|
46
|
+
.map(v => v.value)
|
|
47
|
+
.filter(v => v)
|
|
48
|
+
.join(",")
|
|
49
|
+
: v
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
cancelEdit();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}}
|
|
57
|
+
options={options.map(value => ({ label: value, value }))}
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
export const EditableCell = ({
|
|
4
|
+
cancelEdit,
|
|
5
|
+
dataTest,
|
|
6
|
+
finishEdit,
|
|
7
|
+
isNumeric,
|
|
8
|
+
initialValue
|
|
9
|
+
}) => {
|
|
10
|
+
const [value, setValue] = useState(initialValue);
|
|
11
|
+
const inputRef = useRef(null);
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (inputRef.current) {
|
|
15
|
+
inputRef.current.focus();
|
|
16
|
+
}
|
|
17
|
+
}, [isNumeric]);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<input
|
|
21
|
+
style={{
|
|
22
|
+
border: 0,
|
|
23
|
+
width: "95%",
|
|
24
|
+
fontSize: 12,
|
|
25
|
+
background: "none"
|
|
26
|
+
}}
|
|
27
|
+
ref={inputRef}
|
|
28
|
+
{...dataTest}
|
|
29
|
+
autoFocus
|
|
30
|
+
onKeyDown={e => {
|
|
31
|
+
e.stopPropagation();
|
|
32
|
+
if (e.key === "Enter") {
|
|
33
|
+
e.target.blur();
|
|
34
|
+
} else if (e.key === "Escape") {
|
|
35
|
+
cancelEdit();
|
|
36
|
+
}
|
|
37
|
+
}}
|
|
38
|
+
onBlur={() => finishEdit(value)}
|
|
39
|
+
onChange={e => setValue(e.target.value)}
|
|
40
|
+
type={isNumeric ? "number" : undefined}
|
|
41
|
+
value={value}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
import { isFunction } from "lodash-es";
|
|
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 createPortal(inner, window.document.body);
|
|
67
|
+
return inner;
|
|
68
|
+
}
|
|
69
|
+
}
|