orc-shared 5.10.2 → 5.99.0-dev.10
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/dist/components/AppFrame/About.js +13 -13
- package/dist/components/AppFrame/Anchor.js +7 -7
- package/dist/components/AppFrame/AppFrame.js +3 -3
- package/dist/components/AppFrame/Help.js +4 -4
- package/dist/components/AppFrame/MenuItem.js +17 -26
- package/dist/components/AppFrame/Preferences.js +14 -14
- package/dist/components/AppFrame/Sidebar.js +6 -6
- package/dist/components/AppFrame/Topbar.js +6 -6
- package/dist/components/ApplicationModuleLoader.js +3 -2
- package/dist/components/Authenticate.js +29 -22
- package/dist/components/DropMenu/Menu.js +9 -9
- package/dist/components/ErrorPlaceholder.js +8 -24
- package/dist/components/Form/Field.js +4 -4
- package/dist/components/Form/Inputs/Button.js +2 -2
- package/dist/components/Form/Inputs/MultiSelector.js +137 -0
- package/dist/components/Form/Inputs/Selector.js +13 -10
- package/dist/components/Form/Inputs/index.js +1 -1
- package/dist/components/InternetExplorerWarningMessage.js +15 -15
- package/dist/components/LoadingIcon.js +38 -17
- package/dist/components/MaterialUI/DataDisplay/Modal.js +3 -3
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +6 -6
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/TableInfoBar.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/SelectionList.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/Table.js +2 -1
- package/dist/components/MaterialUI/DataDisplay/TableProps.js +3 -1
- package/dist/components/MaterialUI/DataDisplay/TransferList.js +1 -1
- package/dist/components/MaterialUI/Inputs/CheckboxGroup.js +1 -1
- package/dist/components/MaterialUI/Inputs/DatePicker.js +1 -1
- package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
- package/dist/components/MaterialUI/Inputs/Select.js +175 -109
- package/dist/components/MaterialUI/Inputs/SelectProps.js +11 -1
- package/dist/components/MaterialUI/Inputs/Switch.js +1 -1
- package/dist/components/MaterialUI/Navigation/DropDownMenu.js +2 -4
- package/dist/components/MaterialUI/ScopeSelector/ScopeSelector.js +1 -1
- package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +27 -42
- package/dist/components/MaterialUI/Surfaces/Paper.js +1 -1
- package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +3 -2
- package/dist/components/MaterialUI/muiThemes.js +3 -1
- package/dist/components/Provision.js +30 -13
- package/dist/components/Routing/SegmentPage.js +117 -56
- package/dist/components/Scope/ScopeNode.js +62 -57
- package/dist/components/Sidepanel.js +59 -23
- package/dist/components/Spritesheet.js +35 -17
- package/dist/components/Text.js +1 -60
- package/dist/components/ToastList.js +95 -64
- package/dist/components/Treeview/Branch.js +82 -20
- package/dist/components/Treeview/Label.js +108 -31
- package/dist/components/Treeview/Leaf.js +56 -12
- package/dist/components/Treeview/Node.js +22 -9
- package/dist/components/Treeview/index.js +7 -1
- package/dist/components/Treeview/settings.js +17 -6
- package/dist/{components/Modal/index.js → hooks/useWindowSize.js} +38 -36
- package/dist/sharedMessages.js +8 -0
- package/dist/utils/index.js +0 -4
- package/dist/utils/testUtils.js +1 -12
- package/dist/{components/Modal/Background.js → utils/toastHelper.js} +11 -14
- package/package.json +2 -2
- package/src/components/AppFrame/About.js +13 -13
- package/src/components/AppFrame/Anchor.js +7 -7
- package/src/components/AppFrame/AppFrame.js +3 -3
- package/src/components/AppFrame/Help.js +4 -4
- package/src/components/AppFrame/MenuItem.js +15 -23
- package/src/components/AppFrame/Preferences.js +14 -14
- package/src/components/AppFrame/Sidebar.js +6 -6
- package/src/components/AppFrame/Topbar.js +6 -6
- package/src/components/ApplicationModuleLoader.js +2 -2
- package/src/components/ApplicationModuleLoader.test.js +15 -28
- package/src/components/Authenticate.js +21 -23
- package/src/components/Authenticate.test.js +19 -27
- package/src/components/DropMenu/Menu.js +9 -9
- package/src/components/ErrorPlaceholder.js +4 -21
- package/src/components/ErrorPlaceholder.test.js +7 -14
- package/src/components/Form/Field.js +4 -4
- package/src/components/Form/InputField.test.js +2 -1
- package/src/components/Form/Inputs/Button.js +2 -2
- package/src/components/Form/Inputs/MultiSelector.js +73 -0
- package/src/components/Form/Inputs/MultiSelector.test.js +332 -0
- package/src/components/Form/Inputs/Selector.js +12 -4
- package/src/components/Form/Inputs/Selector.test.js +27 -12
- package/src/components/Form/Inputs/index.js +1 -1
- package/src/components/InternetExplorerWarningMessage.js +15 -15
- package/src/components/Loader.test.js +50 -59
- package/src/components/LoadingIcon.js +27 -14
- package/src/components/LoadingIcon.test.js +11 -15
- package/src/components/MaterialUI/DataDisplay/Modal.js +3 -3
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +6 -6
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +1 -1
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/TableInfoBar.js +1 -1
- package/src/components/MaterialUI/DataDisplay/SelectionList.js +1 -1
- package/src/components/MaterialUI/DataDisplay/Table.js +6 -1
- package/src/components/MaterialUI/DataDisplay/Table.test.js +21 -1
- package/src/components/MaterialUI/DataDisplay/TableProps.js +2 -0
- package/src/components/MaterialUI/DataDisplay/TableProps.test.js +20 -2
- package/src/components/MaterialUI/DataDisplay/TransferList.js +1 -1
- package/src/components/MaterialUI/Inputs/CheckboxGroup.js +1 -1
- package/src/components/MaterialUI/Inputs/DatePicker.js +1 -1
- package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
- package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.test.js +1 -1
- package/src/components/MaterialUI/Inputs/Select.js +143 -83
- package/src/components/MaterialUI/Inputs/Select.test.js +199 -14
- package/src/components/MaterialUI/Inputs/SelectProps.js +10 -0
- package/src/components/MaterialUI/Inputs/SelectProps.test.js +10 -0
- package/src/components/MaterialUI/Inputs/Switch.js +1 -1
- package/src/components/MaterialUI/Navigation/DropDownMenu.js +2 -2
- package/src/components/MaterialUI/Navigation/DropDownMenu.test.js +5 -6
- package/src/components/MaterialUI/ScopeSelector/ScopeSelector.js +1 -2
- package/src/components/MaterialUI/ScopeSelector/TreeItem.js +8 -31
- package/src/components/MaterialUI/Surfaces/Paper.js +1 -1
- package/src/components/MaterialUI/Surfaces/SectionExpansionPanel.js +2 -1
- package/src/components/MaterialUI/muiThemes.js +4 -1
- package/src/components/Navigation/Navigation.test.js +0 -5
- package/src/components/Navigation/useNavigationState.test.js +79 -222
- package/src/components/Provision.js +36 -42
- package/src/components/Provision.test.js +10 -26
- package/src/components/Routing/SegmentPage.js +68 -52
- package/src/components/Routing/SegmentPage.test.js +4 -12
- package/src/components/Scope/ScopeNode.js +44 -55
- package/src/components/Scope/ScopeNode.test.js +84 -163
- package/src/components/ScopeExtendedConfigurationLoader.test.js +1 -4
- package/src/components/Sidepanel.js +38 -32
- package/src/components/Sidepanel.test.js +54 -27
- package/src/components/Spritesheet.js +23 -21
- package/src/components/Spritesheet.test.js +10 -10
- package/src/components/Text.js +0 -49
- package/src/components/ToastList.js +79 -90
- package/src/components/ToastList.test.js +29 -103
- package/src/components/Treeview/Branch.js +65 -47
- package/src/components/Treeview/Branch.test.js +2 -43
- package/src/components/Treeview/Label.js +68 -54
- package/src/components/Treeview/Label.test.js +55 -63
- package/src/components/Treeview/Leaf.js +41 -22
- package/src/components/Treeview/Leaf.test.js +1 -15
- package/src/components/Treeview/Node.js +16 -9
- package/src/components/Treeview/Node.test.js +269 -200
- package/src/components/Treeview/Treeview.test.js +248 -248
- package/src/components/Treeview/index.js +6 -0
- package/src/components/Treeview/settings.js +10 -6
- package/src/hooks/useMultipleFieldEditState.test.js +0 -1
- package/src/hooks/useWindowSize.js +39 -0
- package/src/hooks/useWindowSize.test.js +68 -0
- package/src/sharedMessages.js +8 -0
- package/src/translations/en-US.json +2 -0
- package/src/translations/fr-CA.json +2 -0
- package/src/utils/index.js +0 -4
- package/src/utils/testUtils.js +0 -10
- package/src/utils/testUtils.test.js +0 -68
- package/src/utils/toastHelper.js +8 -0
- package/src/utils/toastHelper.test.js +41 -0
- package/dist/components/Button.js +0 -70
- package/dist/components/CategoryList.js +0 -197
- package/dist/components/Checkbox.js +0 -103
- package/dist/components/Icon.js +0 -69
- package/dist/components/IconButton.js +0 -80
- package/dist/components/Input.js +0 -101
- package/dist/components/List/DataCell.js +0 -129
- package/dist/components/List/HeadCell.js +0 -125
- package/dist/components/List/HeadRow.js +0 -73
- package/dist/components/List/List.js +0 -274
- package/dist/components/List/Row.js +0 -109
- package/dist/components/List/enhanceColumnDefs.js +0 -111
- package/dist/components/List/index.js +0 -59
- package/dist/components/Modal/Dialog.js +0 -75
- package/dist/components/Modal/Wrapper.js +0 -69
- package/dist/components/MultiSelector.js +0 -187
- package/dist/components/Navigation/Bar.js +0 -293
- package/dist/components/Navigation/Tab.js +0 -182
- package/dist/components/Placeholder.js +0 -114
- package/dist/components/Scope/Selector.js +0 -123
- package/dist/components/Selector.js +0 -185
- package/dist/components/Switch.js +0 -128
- package/dist/components/Toolbar.js +0 -227
- package/dist/components/Tooltip.js +0 -66
- package/dist/getTheme.js +0 -158
- package/dist/getThemeOverrides.js +0 -93
- package/dist/hocs/withAuthentication.js +0 -72
- package/dist/utils/styledPropFuncs.js +0 -88
- package/src/components/Button.js +0 -90
- package/src/components/Button.test.js +0 -49
- package/src/components/CategoryList.js +0 -140
- package/src/components/CategoryList.test.js +0 -667
- package/src/components/Checkbox.js +0 -63
- package/src/components/Checkbox.test.js +0 -122
- package/src/components/Icon.js +0 -18
- package/src/components/IconButton.js +0 -30
- package/src/components/IconButton.test.js +0 -61
- package/src/components/Input.js +0 -35
- package/src/components/Input.test.js +0 -34
- package/src/components/List/DataCell.js +0 -77
- package/src/components/List/DataCell.test.js +0 -357
- package/src/components/List/HeadCell.js +0 -105
- package/src/components/List/HeadCell.test.js +0 -331
- package/src/components/List/HeadRow.js +0 -21
- package/src/components/List/HeadRow.test.js +0 -27
- package/src/components/List/List.js +0 -162
- package/src/components/List/List.test.js +0 -705
- package/src/components/List/Row.js +0 -72
- package/src/components/List/Row.test.js +0 -194
- package/src/components/List/enhanceColumnDefs.js +0 -54
- package/src/components/List/enhanceColumnDefs.test.js +0 -179
- package/src/components/List/index.js +0 -6
- package/src/components/Modal/Background.js +0 -10
- package/src/components/Modal/Dialog.js +0 -27
- package/src/components/Modal/Dialog.test.js +0 -20
- package/src/components/Modal/Modal.test.js +0 -52
- package/src/components/Modal/Wrapper.js +0 -32
- package/src/components/Modal/Wrapper.test.js +0 -55
- package/src/components/Modal/index.js +0 -22
- package/src/components/MultiSelector.js +0 -104
- package/src/components/MultiSelector.test.js +0 -348
- package/src/components/Navigation/Bar.js +0 -212
- package/src/components/Navigation/Bar.test.js +0 -552
- package/src/components/Navigation/Tab.js +0 -156
- package/src/components/Navigation/Tab.test.js +0 -404
- package/src/components/Placeholder.js +0 -61
- package/src/components/Placeholder.test.js +0 -106
- package/src/components/Scope/Selector.js +0 -70
- package/src/components/Scope/Selector.test.js +0 -138
- package/src/components/Selector.js +0 -191
- package/src/components/Selector.test.js +0 -157
- package/src/components/Switch.js +0 -112
- package/src/components/Switch.test.js +0 -130
- package/src/components/Text.test.js +0 -132
- package/src/components/Toolbar.js +0 -178
- package/src/components/Toolbar.test.js +0 -478
- package/src/components/Tooltip.js +0 -51
- package/src/components/Tooltip.test.js +0 -21
- package/src/getTheme.js +0 -103
- package/src/getTheme.test.js +0 -92
- package/src/getThemeOverrides.js +0 -27
- package/src/hocs/withAuthentication.js +0 -18
- package/src/hocs/withAuthentication.test.js +0 -120
- package/src/utils/styledPropFuncs.js +0 -20
- package/src/utils/styledPropFuncs.test.js +0 -166
|
@@ -1,705 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Provider } from "react-redux";
|
|
3
|
-
import { Ignore } from "unexpected-reaction";
|
|
4
|
-
import { List, Table, Placeholder, PlaceholderCell, PlaceholderBox } from "./List";
|
|
5
|
-
import { TableRow } from "./Row";
|
|
6
|
-
import { HeadTableRow } from "./HeadRow";
|
|
7
|
-
import { TableHeader, HeadBox } from "./HeadCell";
|
|
8
|
-
|
|
9
|
-
const generateRows = count => {
|
|
10
|
-
const rows = [];
|
|
11
|
-
for (let i = 0; i < count; i += 1) {
|
|
12
|
-
rows.push({ key: (i + 1).toString() });
|
|
13
|
-
}
|
|
14
|
-
return rows;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
describe("List", () => {
|
|
18
|
-
let store, selection;
|
|
19
|
-
beforeEach(() => {
|
|
20
|
-
store = {
|
|
21
|
-
subscribe: () => {},
|
|
22
|
-
dispatch: () => {},
|
|
23
|
-
getState: () => ({ getIn: () => ({ selection }) }),
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it("renders nothing if no columnDefs", () =>
|
|
28
|
-
expect(
|
|
29
|
-
<Provider store={store}>
|
|
30
|
-
<List rows={[{}]} />
|
|
31
|
-
</Provider>,
|
|
32
|
-
"to satisfy",
|
|
33
|
-
null,
|
|
34
|
-
));
|
|
35
|
-
|
|
36
|
-
it("renders a table with no rows", () =>
|
|
37
|
-
expect(
|
|
38
|
-
<Provider store={store}>
|
|
39
|
-
<List columnDefs={[{ fieldName: "a" }]} />
|
|
40
|
-
</Provider>,
|
|
41
|
-
"when mounted",
|
|
42
|
-
"to satisfy",
|
|
43
|
-
<Table>
|
|
44
|
-
<thead>
|
|
45
|
-
<HeadTableRow>
|
|
46
|
-
<TableHeader>
|
|
47
|
-
<HeadBox></HeadBox>
|
|
48
|
-
</TableHeader>
|
|
49
|
-
</HeadTableRow>
|
|
50
|
-
</thead>
|
|
51
|
-
<tbody></tbody>
|
|
52
|
-
</Table>,
|
|
53
|
-
));
|
|
54
|
-
|
|
55
|
-
it("renders a placeholder if one given and no rows", () =>
|
|
56
|
-
expect(
|
|
57
|
-
<Provider store={store}>
|
|
58
|
-
<List
|
|
59
|
-
height={121}
|
|
60
|
-
columnDefs={[{ fieldName: "a" }, { fieldName: "b" }, { fieldName: "c" }]}
|
|
61
|
-
placeholder={<div />}
|
|
62
|
-
/>
|
|
63
|
-
</Provider>,
|
|
64
|
-
"when mounted",
|
|
65
|
-
"to satisfy",
|
|
66
|
-
<table>
|
|
67
|
-
<thead>
|
|
68
|
-
<tr>
|
|
69
|
-
<th>
|
|
70
|
-
<Ignore />
|
|
71
|
-
</th>
|
|
72
|
-
<th>
|
|
73
|
-
<Ignore />
|
|
74
|
-
</th>
|
|
75
|
-
<th>
|
|
76
|
-
<Ignore />
|
|
77
|
-
</th>
|
|
78
|
-
</tr>
|
|
79
|
-
</thead>
|
|
80
|
-
<tbody>
|
|
81
|
-
<Placeholder width={3} height={80}>
|
|
82
|
-
<div />
|
|
83
|
-
</Placeholder>
|
|
84
|
-
</tbody>
|
|
85
|
-
</table>,
|
|
86
|
-
));
|
|
87
|
-
|
|
88
|
-
it("renders a row for each row data object", () => {
|
|
89
|
-
const rows = [{ key: "a" }, { key: "b" }, { key: "c" }];
|
|
90
|
-
const columnDefs = [{ fieldName: "a" }];
|
|
91
|
-
return expect(
|
|
92
|
-
<Provider store={store}>
|
|
93
|
-
<List columnDefs={columnDefs} rows={rows} keyField={["key"]} />
|
|
94
|
-
</Provider>,
|
|
95
|
-
"when mounted",
|
|
96
|
-
"to satisfy",
|
|
97
|
-
<table>
|
|
98
|
-
<thead>
|
|
99
|
-
<tr>
|
|
100
|
-
<th>
|
|
101
|
-
<Ignore />
|
|
102
|
-
</th>
|
|
103
|
-
</tr>
|
|
104
|
-
</thead>
|
|
105
|
-
<tbody>
|
|
106
|
-
<TableRow>
|
|
107
|
-
<td />
|
|
108
|
-
</TableRow>
|
|
109
|
-
<TableRow>
|
|
110
|
-
<td />
|
|
111
|
-
</TableRow>
|
|
112
|
-
<TableRow>
|
|
113
|
-
<td />
|
|
114
|
-
</TableRow>
|
|
115
|
-
</tbody>
|
|
116
|
-
</table>,
|
|
117
|
-
);
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
it("renders rows with click handlers", () => {
|
|
121
|
-
const rows = [{ key: "a" }, { key: "b" }, { key: "c" }];
|
|
122
|
-
const columnDefs = [{ fieldName: "a" }];
|
|
123
|
-
return expect(
|
|
124
|
-
<Provider store={store}>
|
|
125
|
-
<List columnDefs={columnDefs} rows={rows} keyField={["key"]} rowOnClick={() => {}} />
|
|
126
|
-
</Provider>,
|
|
127
|
-
"when mounted",
|
|
128
|
-
"to satisfy",
|
|
129
|
-
<table>
|
|
130
|
-
<thead>
|
|
131
|
-
<tr>
|
|
132
|
-
<th>
|
|
133
|
-
<Ignore />
|
|
134
|
-
</th>
|
|
135
|
-
</tr>
|
|
136
|
-
</thead>
|
|
137
|
-
<tbody>
|
|
138
|
-
<TableRow onClick={() => {}}>
|
|
139
|
-
<td />
|
|
140
|
-
</TableRow>
|
|
141
|
-
<TableRow onClick={() => {}}>
|
|
142
|
-
<td />
|
|
143
|
-
</TableRow>
|
|
144
|
-
<TableRow onClick={() => {}}>
|
|
145
|
-
<td />
|
|
146
|
-
</TableRow>
|
|
147
|
-
</tbody>
|
|
148
|
-
</table>,
|
|
149
|
-
);
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
it("renders rows with data-based backgrounds", () => {
|
|
153
|
-
const rows = [{ key: "a" }, { key: "b" }, { key: "c" }];
|
|
154
|
-
const columnDefs = [{ fieldName: "a" }];
|
|
155
|
-
const colorMap = {
|
|
156
|
-
a: "#ff0000",
|
|
157
|
-
b: "#00ff00",
|
|
158
|
-
c: "#0000ff",
|
|
159
|
-
};
|
|
160
|
-
const colorGetter = row => colorMap[row.key];
|
|
161
|
-
return expect(
|
|
162
|
-
<Provider store={store}>
|
|
163
|
-
<List columnDefs={columnDefs} rows={rows} keyField={["key"]} rowBackgroundGetter={colorGetter} />
|
|
164
|
-
</Provider>,
|
|
165
|
-
"when mounted",
|
|
166
|
-
"to satisfy",
|
|
167
|
-
<table>
|
|
168
|
-
<thead>
|
|
169
|
-
<tr>
|
|
170
|
-
<th>
|
|
171
|
-
<Ignore />
|
|
172
|
-
</th>
|
|
173
|
-
</tr>
|
|
174
|
-
</thead>
|
|
175
|
-
<tbody>
|
|
176
|
-
<TableRow bgColor="#ff0000">
|
|
177
|
-
<td />
|
|
178
|
-
</TableRow>
|
|
179
|
-
<TableRow bgColor="#00ff00">
|
|
180
|
-
<td />
|
|
181
|
-
</TableRow>
|
|
182
|
-
<TableRow bgColor="#0000ff">
|
|
183
|
-
<td />
|
|
184
|
-
</TableRow>
|
|
185
|
-
</tbody>
|
|
186
|
-
</table>,
|
|
187
|
-
);
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
it("renders rows with index-based backgrounds", () => {
|
|
191
|
-
const rows = [{ key: "a" }, { key: "b" }, { key: "c" }];
|
|
192
|
-
const columnDefs = [{ fieldName: "a" }];
|
|
193
|
-
const colorGetter = (row, index) => (index % 2 ? "red" : "green");
|
|
194
|
-
return expect(
|
|
195
|
-
<Provider store={store}>
|
|
196
|
-
<List columnDefs={columnDefs} rows={rows} keyField={["key"]} rowBackgroundGetter={colorGetter} />
|
|
197
|
-
</Provider>,
|
|
198
|
-
"when mounted",
|
|
199
|
-
"to satisfy",
|
|
200
|
-
<table>
|
|
201
|
-
<thead>
|
|
202
|
-
<tr>
|
|
203
|
-
<th>
|
|
204
|
-
<Ignore />
|
|
205
|
-
</th>
|
|
206
|
-
</tr>
|
|
207
|
-
</thead>
|
|
208
|
-
<tbody>
|
|
209
|
-
<TableRow bgColor="green">
|
|
210
|
-
<td />
|
|
211
|
-
</TableRow>
|
|
212
|
-
<TableRow bgColor="red">
|
|
213
|
-
<td />
|
|
214
|
-
</TableRow>
|
|
215
|
-
<TableRow bgColor="green">
|
|
216
|
-
<td />
|
|
217
|
-
</TableRow>
|
|
218
|
-
</tbody>
|
|
219
|
-
</table>,
|
|
220
|
-
);
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
it("renders a header based on column definitions", () => {
|
|
224
|
-
const rows = [{ key: "a" }, { key: "b" }, { key: "c" }];
|
|
225
|
-
const columnDefs = [
|
|
226
|
-
{ type: "select", fieldName: "select" },
|
|
227
|
-
{ fieldName: "key", label: "Key" },
|
|
228
|
-
];
|
|
229
|
-
const selection = ["a"];
|
|
230
|
-
return expect(
|
|
231
|
-
<Provider store={store}>
|
|
232
|
-
<List columnDefs={columnDefs} rows={rows} keyField={["key"]} selection={selection} />
|
|
233
|
-
</Provider>,
|
|
234
|
-
"when mounted",
|
|
235
|
-
"to satisfy",
|
|
236
|
-
<table>
|
|
237
|
-
<thead>
|
|
238
|
-
<HeadTableRow>
|
|
239
|
-
<TableHeader select>
|
|
240
|
-
<HeadBox>
|
|
241
|
-
<label>
|
|
242
|
-
<input type="checkbox" value={false} />
|
|
243
|
-
<label></label>
|
|
244
|
-
</label>
|
|
245
|
-
</HeadBox>
|
|
246
|
-
</TableHeader>
|
|
247
|
-
<TableHeader>
|
|
248
|
-
<HeadBox>Key</HeadBox>
|
|
249
|
-
</TableHeader>
|
|
250
|
-
</HeadTableRow>
|
|
251
|
-
</thead>
|
|
252
|
-
<tbody>
|
|
253
|
-
<tr>
|
|
254
|
-
<td>
|
|
255
|
-
<Ignore />
|
|
256
|
-
</td>
|
|
257
|
-
<td>
|
|
258
|
-
<Ignore />
|
|
259
|
-
</td>
|
|
260
|
-
</tr>
|
|
261
|
-
<tr>
|
|
262
|
-
<td>
|
|
263
|
-
<Ignore />
|
|
264
|
-
</td>
|
|
265
|
-
<td>
|
|
266
|
-
<Ignore />
|
|
267
|
-
</td>
|
|
268
|
-
</tr>
|
|
269
|
-
<tr>
|
|
270
|
-
<td>
|
|
271
|
-
<Ignore />
|
|
272
|
-
</td>
|
|
273
|
-
<td>
|
|
274
|
-
<Ignore />
|
|
275
|
-
</td>
|
|
276
|
-
</tr>
|
|
277
|
-
</tbody>
|
|
278
|
-
</table>,
|
|
279
|
-
);
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
it("renders a header when all rows are selected", () => {
|
|
283
|
-
const rows = [{ key: "a" }, { key: "b" }, { key: "c" }];
|
|
284
|
-
const columnDefs = [{ type: "select", fieldName: "select" }];
|
|
285
|
-
selection = ["a", "b", "c"];
|
|
286
|
-
return expect(
|
|
287
|
-
<Provider store={store}>
|
|
288
|
-
<List columnDefs={columnDefs} rows={rows} keyField={["key"]} />
|
|
289
|
-
</Provider>,
|
|
290
|
-
"when mounted",
|
|
291
|
-
"to satisfy",
|
|
292
|
-
<table>
|
|
293
|
-
<thead>
|
|
294
|
-
<HeadTableRow>
|
|
295
|
-
<TableHeader select>
|
|
296
|
-
<HeadBox>
|
|
297
|
-
<label>
|
|
298
|
-
<input type="checkbox" value={true} />
|
|
299
|
-
<label></label>
|
|
300
|
-
</label>
|
|
301
|
-
</HeadBox>
|
|
302
|
-
</TableHeader>
|
|
303
|
-
</HeadTableRow>
|
|
304
|
-
</thead>
|
|
305
|
-
<tbody>
|
|
306
|
-
<tr>
|
|
307
|
-
<td>
|
|
308
|
-
<Ignore />
|
|
309
|
-
</td>
|
|
310
|
-
</tr>
|
|
311
|
-
<tr>
|
|
312
|
-
<td>
|
|
313
|
-
<Ignore />
|
|
314
|
-
</td>
|
|
315
|
-
</tr>
|
|
316
|
-
<tr>
|
|
317
|
-
<td>
|
|
318
|
-
<Ignore />
|
|
319
|
-
</td>
|
|
320
|
-
</tr>
|
|
321
|
-
</tbody>
|
|
322
|
-
</table>,
|
|
323
|
-
);
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
describe("virtual scrolling", () => {
|
|
327
|
-
let rows, columnDefs, colorGetter;
|
|
328
|
-
beforeEach(() => {
|
|
329
|
-
rows = generateRows(15);
|
|
330
|
-
columnDefs = [{ fieldName: "key", label: "Key" }];
|
|
331
|
-
colorGetter = (row, index) => `rgb(${row.key},${row.key},${row.key})`;
|
|
332
|
-
});
|
|
333
|
-
|
|
334
|
-
it("renders a header with all rows identified when virtual", () => {
|
|
335
|
-
const rows = generateRows(15);
|
|
336
|
-
const columnDefs = [{ type: "select", fieldName: "select" }];
|
|
337
|
-
selection = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"];
|
|
338
|
-
return expect(
|
|
339
|
-
<Provider store={store}>
|
|
340
|
-
<List
|
|
341
|
-
columnDefs={columnDefs}
|
|
342
|
-
rows={rows}
|
|
343
|
-
keyField={["key"]}
|
|
344
|
-
selection={selection}
|
|
345
|
-
virtual
|
|
346
|
-
scrollTop={350}
|
|
347
|
-
height={150}
|
|
348
|
-
scrollBuffer={1}
|
|
349
|
-
/>
|
|
350
|
-
</Provider>,
|
|
351
|
-
"when mounted",
|
|
352
|
-
"to satisfy",
|
|
353
|
-
<table>
|
|
354
|
-
<thead>
|
|
355
|
-
<HeadTableRow>
|
|
356
|
-
<TableHeader select>
|
|
357
|
-
<HeadBox>
|
|
358
|
-
<label>
|
|
359
|
-
<input type="checkbox" value={true} />
|
|
360
|
-
<label></label>
|
|
361
|
-
</label>
|
|
362
|
-
</HeadBox>
|
|
363
|
-
</TableHeader>
|
|
364
|
-
</HeadTableRow>
|
|
365
|
-
</thead>
|
|
366
|
-
<tbody>
|
|
367
|
-
<tr />
|
|
368
|
-
<tr>
|
|
369
|
-
<td>
|
|
370
|
-
<Ignore />
|
|
371
|
-
</td>
|
|
372
|
-
</tr>
|
|
373
|
-
<tr>
|
|
374
|
-
<td>
|
|
375
|
-
<Ignore />
|
|
376
|
-
</td>
|
|
377
|
-
</tr>
|
|
378
|
-
<tr>
|
|
379
|
-
<td>
|
|
380
|
-
<Ignore />
|
|
381
|
-
</td>
|
|
382
|
-
</tr>
|
|
383
|
-
<tr>
|
|
384
|
-
<td>
|
|
385
|
-
<Ignore />
|
|
386
|
-
</td>
|
|
387
|
-
</tr>
|
|
388
|
-
<tr>
|
|
389
|
-
<td>
|
|
390
|
-
<Ignore />
|
|
391
|
-
</td>
|
|
392
|
-
</tr>
|
|
393
|
-
<tr />
|
|
394
|
-
</tbody>
|
|
395
|
-
</table>,
|
|
396
|
-
);
|
|
397
|
-
});
|
|
398
|
-
|
|
399
|
-
it("renders at top", () =>
|
|
400
|
-
expect(
|
|
401
|
-
<Provider store={store}>
|
|
402
|
-
<List
|
|
403
|
-
virtual
|
|
404
|
-
scrollTop={0}
|
|
405
|
-
height={150}
|
|
406
|
-
scrollBuffer={1}
|
|
407
|
-
columnDefs={columnDefs}
|
|
408
|
-
rows={rows}
|
|
409
|
-
keyField={["key"]}
|
|
410
|
-
rowBackgroundGetter={colorGetter}
|
|
411
|
-
/>
|
|
412
|
-
</Provider>,
|
|
413
|
-
"when mounted",
|
|
414
|
-
"to satisfy",
|
|
415
|
-
<table>
|
|
416
|
-
<thead>
|
|
417
|
-
<tr>
|
|
418
|
-
<th>
|
|
419
|
-
<Ignore />
|
|
420
|
-
</th>
|
|
421
|
-
</tr>
|
|
422
|
-
</thead>
|
|
423
|
-
<tbody>
|
|
424
|
-
<TableRow bgColor="rgb(1,1,1)">
|
|
425
|
-
<td>
|
|
426
|
-
<Ignore />
|
|
427
|
-
</td>
|
|
428
|
-
</TableRow>
|
|
429
|
-
<TableRow bgColor="rgb(2,2,2)">
|
|
430
|
-
<td>
|
|
431
|
-
<Ignore />
|
|
432
|
-
</td>
|
|
433
|
-
</TableRow>
|
|
434
|
-
<TableRow bgColor="rgb(3,3,3)">
|
|
435
|
-
<td>
|
|
436
|
-
<Ignore />
|
|
437
|
-
</td>
|
|
438
|
-
</TableRow>
|
|
439
|
-
<TableRow bgColor="rgb(4,4,4)">
|
|
440
|
-
<td>
|
|
441
|
-
<Ignore />
|
|
442
|
-
</td>
|
|
443
|
-
</TableRow>
|
|
444
|
-
<tr style={{ height: 561 }} />
|
|
445
|
-
</tbody>
|
|
446
|
-
</table>,
|
|
447
|
-
));
|
|
448
|
-
|
|
449
|
-
it("renders near top", () =>
|
|
450
|
-
expect(
|
|
451
|
-
<Provider store={store}>
|
|
452
|
-
<List
|
|
453
|
-
virtual
|
|
454
|
-
scrollTop={150}
|
|
455
|
-
height={150}
|
|
456
|
-
scrollBuffer={1}
|
|
457
|
-
columnDefs={columnDefs}
|
|
458
|
-
rows={rows}
|
|
459
|
-
keyField={["key"]}
|
|
460
|
-
rowBackgroundGetter={colorGetter}
|
|
461
|
-
/>
|
|
462
|
-
</Provider>,
|
|
463
|
-
"when mounted",
|
|
464
|
-
"to satisfy",
|
|
465
|
-
<table>
|
|
466
|
-
<thead>
|
|
467
|
-
<tr>
|
|
468
|
-
<th>
|
|
469
|
-
<Ignore />
|
|
470
|
-
</th>
|
|
471
|
-
</tr>
|
|
472
|
-
</thead>
|
|
473
|
-
<tbody>
|
|
474
|
-
<tr style={{ height: 51 }} />
|
|
475
|
-
<TableRow bgColor="rgb(2,2,2)">
|
|
476
|
-
<td>
|
|
477
|
-
<Ignore />
|
|
478
|
-
</td>
|
|
479
|
-
</TableRow>
|
|
480
|
-
<TableRow bgColor="rgb(3,3,3)">
|
|
481
|
-
<td>
|
|
482
|
-
<Ignore />
|
|
483
|
-
</td>
|
|
484
|
-
</TableRow>
|
|
485
|
-
<TableRow bgColor="rgb(4,4,4)">
|
|
486
|
-
<td>
|
|
487
|
-
<Ignore />
|
|
488
|
-
</td>
|
|
489
|
-
</TableRow>
|
|
490
|
-
<TableRow bgColor="rgb(5,5,5)">
|
|
491
|
-
<td>
|
|
492
|
-
<Ignore />
|
|
493
|
-
</td>
|
|
494
|
-
</TableRow>
|
|
495
|
-
<TableRow bgColor="rgb(6,6,6)">
|
|
496
|
-
<td>
|
|
497
|
-
<Ignore />
|
|
498
|
-
</td>
|
|
499
|
-
</TableRow>
|
|
500
|
-
<TableRow bgColor="rgb(7,7,7)">
|
|
501
|
-
<td>
|
|
502
|
-
<Ignore />
|
|
503
|
-
</td>
|
|
504
|
-
</TableRow>
|
|
505
|
-
<tr style={{ height: 408 }} />
|
|
506
|
-
</tbody>
|
|
507
|
-
</table>,
|
|
508
|
-
));
|
|
509
|
-
|
|
510
|
-
it("renders in the middle", () =>
|
|
511
|
-
expect(
|
|
512
|
-
<Provider store={store}>
|
|
513
|
-
<List
|
|
514
|
-
virtual
|
|
515
|
-
scrollTop={350}
|
|
516
|
-
height={150}
|
|
517
|
-
scrollBuffer={1}
|
|
518
|
-
columnDefs={columnDefs}
|
|
519
|
-
rows={rows}
|
|
520
|
-
keyField={["key"]}
|
|
521
|
-
rowBackgroundGetter={colorGetter}
|
|
522
|
-
/>
|
|
523
|
-
</Provider>,
|
|
524
|
-
"when mounted",
|
|
525
|
-
"to satisfy",
|
|
526
|
-
<table>
|
|
527
|
-
<thead>
|
|
528
|
-
<tr>
|
|
529
|
-
<th>
|
|
530
|
-
<Ignore />
|
|
531
|
-
</th>
|
|
532
|
-
</tr>
|
|
533
|
-
</thead>
|
|
534
|
-
<tbody>
|
|
535
|
-
<tr style={{ height: 255 }} />
|
|
536
|
-
<TableRow bgColor="rgb(6,6,6)">
|
|
537
|
-
<td>
|
|
538
|
-
<Ignore />
|
|
539
|
-
</td>
|
|
540
|
-
</TableRow>
|
|
541
|
-
<TableRow bgColor="rgb(7,7,7)">
|
|
542
|
-
<td>
|
|
543
|
-
<Ignore />
|
|
544
|
-
</td>
|
|
545
|
-
</TableRow>
|
|
546
|
-
<TableRow bgColor="rgb(8,8,8)">
|
|
547
|
-
<td>
|
|
548
|
-
<Ignore />
|
|
549
|
-
</td>
|
|
550
|
-
</TableRow>
|
|
551
|
-
<TableRow bgColor="rgb(9,9,9)">
|
|
552
|
-
<td>
|
|
553
|
-
<Ignore />
|
|
554
|
-
</td>
|
|
555
|
-
</TableRow>
|
|
556
|
-
<TableRow bgColor="rgb(10,10,10)">
|
|
557
|
-
<td>
|
|
558
|
-
<Ignore />
|
|
559
|
-
</td>
|
|
560
|
-
</TableRow>
|
|
561
|
-
<tr style={{ height: 255 }} />
|
|
562
|
-
</tbody>
|
|
563
|
-
</table>,
|
|
564
|
-
));
|
|
565
|
-
|
|
566
|
-
it("renders near end", () =>
|
|
567
|
-
expect(
|
|
568
|
-
<Provider store={store}>
|
|
569
|
-
<List
|
|
570
|
-
virtual
|
|
571
|
-
scrollTop={550}
|
|
572
|
-
height={150}
|
|
573
|
-
scrollBuffer={1}
|
|
574
|
-
columnDefs={columnDefs}
|
|
575
|
-
rows={rows}
|
|
576
|
-
keyField={["key"]}
|
|
577
|
-
rowBackgroundGetter={colorGetter}
|
|
578
|
-
/>
|
|
579
|
-
</Provider>,
|
|
580
|
-
"when mounted",
|
|
581
|
-
"to satisfy",
|
|
582
|
-
<table>
|
|
583
|
-
<thead>
|
|
584
|
-
<tr>
|
|
585
|
-
<th>
|
|
586
|
-
<Ignore />
|
|
587
|
-
</th>
|
|
588
|
-
</tr>
|
|
589
|
-
</thead>
|
|
590
|
-
<tbody>
|
|
591
|
-
<tr style={{ height: 408 }} />
|
|
592
|
-
<TableRow bgColor="rgb(9,9,9)">
|
|
593
|
-
<td>
|
|
594
|
-
<Ignore />
|
|
595
|
-
</td>
|
|
596
|
-
</TableRow>
|
|
597
|
-
<TableRow bgColor="rgb(10,10,10)">
|
|
598
|
-
<td>
|
|
599
|
-
<Ignore />
|
|
600
|
-
</td>
|
|
601
|
-
</TableRow>
|
|
602
|
-
<TableRow bgColor="rgb(11,11,11)">
|
|
603
|
-
<td>
|
|
604
|
-
<Ignore />
|
|
605
|
-
</td>
|
|
606
|
-
</TableRow>
|
|
607
|
-
<TableRow bgColor="rgb(12,12,12)">
|
|
608
|
-
<td>
|
|
609
|
-
<Ignore />
|
|
610
|
-
</td>
|
|
611
|
-
</TableRow>
|
|
612
|
-
<TableRow bgColor="rgb(13,13,13)">
|
|
613
|
-
<td>
|
|
614
|
-
<Ignore />
|
|
615
|
-
</td>
|
|
616
|
-
</TableRow>
|
|
617
|
-
<TableRow bgColor="rgb(14,14,14)">
|
|
618
|
-
<td>
|
|
619
|
-
<Ignore />
|
|
620
|
-
</td>
|
|
621
|
-
</TableRow>
|
|
622
|
-
<tr style={{ height: 51 }} />
|
|
623
|
-
</tbody>
|
|
624
|
-
</table>,
|
|
625
|
-
));
|
|
626
|
-
|
|
627
|
-
it("renders at end", () =>
|
|
628
|
-
expect(
|
|
629
|
-
<Provider store={store}>
|
|
630
|
-
<List
|
|
631
|
-
virtual
|
|
632
|
-
scrollTop={656}
|
|
633
|
-
height={150}
|
|
634
|
-
scrollBuffer={1}
|
|
635
|
-
columnDefs={columnDefs}
|
|
636
|
-
rows={rows}
|
|
637
|
-
keyField={["key"]}
|
|
638
|
-
rowBackgroundGetter={colorGetter}
|
|
639
|
-
/>
|
|
640
|
-
</Provider>,
|
|
641
|
-
"when mounted",
|
|
642
|
-
"to satisfy",
|
|
643
|
-
<table>
|
|
644
|
-
<thead>
|
|
645
|
-
<tr>
|
|
646
|
-
<th>
|
|
647
|
-
<Ignore />
|
|
648
|
-
</th>
|
|
649
|
-
</tr>
|
|
650
|
-
</thead>
|
|
651
|
-
<tbody>
|
|
652
|
-
<tr style={{ height: 561 }} />
|
|
653
|
-
<TableRow bgColor="rgb(12,12,12)">
|
|
654
|
-
<td>
|
|
655
|
-
<Ignore />
|
|
656
|
-
</td>
|
|
657
|
-
</TableRow>
|
|
658
|
-
<TableRow bgColor="rgb(13,13,13)">
|
|
659
|
-
<td>
|
|
660
|
-
<Ignore />
|
|
661
|
-
</td>
|
|
662
|
-
</TableRow>
|
|
663
|
-
<TableRow bgColor="rgb(14,14,14)">
|
|
664
|
-
<td>
|
|
665
|
-
<Ignore />
|
|
666
|
-
</td>
|
|
667
|
-
</TableRow>
|
|
668
|
-
<TableRow bgColor="rgb(15,15,15)">
|
|
669
|
-
<td>
|
|
670
|
-
<Ignore />
|
|
671
|
-
</td>
|
|
672
|
-
</TableRow>
|
|
673
|
-
</tbody>
|
|
674
|
-
</table>,
|
|
675
|
-
));
|
|
676
|
-
});
|
|
677
|
-
});
|
|
678
|
-
|
|
679
|
-
describe("Placeholder", () => {
|
|
680
|
-
it("renders wrappers to center the placeholder in the table", () =>
|
|
681
|
-
expect(
|
|
682
|
-
<table>
|
|
683
|
-
<tbody>
|
|
684
|
-
<Placeholder width={4} height={450}>
|
|
685
|
-
<div id="child" />
|
|
686
|
-
</Placeholder>
|
|
687
|
-
</tbody>
|
|
688
|
-
</table>,
|
|
689
|
-
"when mounted",
|
|
690
|
-
"to satisfy",
|
|
691
|
-
<table>
|
|
692
|
-
<tbody>
|
|
693
|
-
<tr>
|
|
694
|
-
<td colSpan={4} style={{ padding: 0 }}>
|
|
695
|
-
<PlaceholderCell cssHeight={450}>
|
|
696
|
-
<PlaceholderBox>
|
|
697
|
-
<div id="child" />
|
|
698
|
-
</PlaceholderBox>
|
|
699
|
-
</PlaceholderCell>
|
|
700
|
-
</td>
|
|
701
|
-
</tr>
|
|
702
|
-
</tbody>
|
|
703
|
-
</table>,
|
|
704
|
-
));
|
|
705
|
-
});
|