@gpa-gemstone/react-table 1.2.56 → 1.2.58
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/lib/AdjustableTable/Column.d.ts +6 -45
- package/lib/AdjustableTable/Column.js +32 -53
- package/lib/AdjustableTable/Table.d.ts +2 -116
- package/lib/AdjustableTable/Table.js +329 -347
- package/lib/AdjustableTable/Types.d.ts +148 -0
- package/lib/AdjustableTable/Types.js +24 -0
- package/lib/ConfigurableTable/ConfigurableColumn.d.ts +11 -0
- package/lib/ConfigurableTable/ConfigurableColumn.js +31 -0
- package/lib/ConfigurableTable/ConfigurableTable.d.ts +25 -0
- package/lib/ConfigurableTable/ConfigurableTable.js +189 -0
- package/lib/FilterableTable/BooleanFilter.d.ts +26 -0
- package/lib/FilterableTable/BooleanFilter.js +68 -0
- package/lib/FilterableTable/DateTimeFilters.d.ts +10 -0
- package/lib/FilterableTable/DateTimeFilters.js +321 -0
- package/lib/FilterableTable/EnumFilter.d.ts +37 -0
- package/lib/FilterableTable/EnumFilter.js +89 -0
- package/lib/FilterableTable/FilterableColumn.d.ts +20 -0
- package/lib/FilterableTable/FilterableColumn.js +34 -0
- package/lib/FilterableTable/FilterableTable.d.ts +12 -0
- package/lib/FilterableTable/FilterableTable.js +95 -0
- package/lib/FilterableTable/NumberFilter.d.ts +19 -0
- package/lib/FilterableTable/NumberFilter.js +160 -0
- package/lib/FilterableTable/TextFilter.d.ts +14 -0
- package/lib/FilterableTable/TextFilter.js +78 -0
- package/lib/Filters/BooleanFilter.d.ts +26 -0
- package/lib/Filters/BooleanFilter.js +68 -0
- package/lib/Filters/DateTimeFilters.d.ts +10 -0
- package/lib/Filters/DateTimeFilters.js +321 -0
- package/lib/Filters/EnumFilter.d.ts +37 -0
- package/lib/Filters/EnumFilter.js +89 -0
- package/lib/Filters/NumberFilter.d.ts +19 -0
- package/lib/Filters/NumberFilter.js +160 -0
- package/lib/Filters/TextFilter.d.ts +14 -0
- package/lib/Filters/TextFilter.js +78 -0
- package/lib/Table/Column.d.ts +19 -0
- package/lib/Table/Column.js +73 -0
- package/lib/Table/FilterableColumn.d.ts +20 -0
- package/lib/Table/FilterableColumn.js +74 -0
- package/lib/Table/Table.d.ts +3 -0
- package/lib/Table/Table.js +498 -0
- package/lib/Table/Types.d.ts +185 -0
- package/lib/Table/Types.js +24 -0
- package/lib/index.d.ts +7 -14
- package/lib/index.js +13 -19
- package/package.json +56 -52
- package/lib/AdjustableTable/AdjustableColumn.d.ts +0 -18
- package/lib/AdjustableTable/AdjustableColumn.js +0 -187
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NumberFilter = NumberFilter;
|
|
4
|
+
// ******************************************************************************************************
|
|
5
|
+
// NumberFilter.tsx - Gbtc
|
|
6
|
+
//
|
|
7
|
+
// Copyright © 2022, Grid Protection Alliance. All Rights Reserved.
|
|
8
|
+
//
|
|
9
|
+
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
|
|
10
|
+
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
|
|
11
|
+
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
|
|
12
|
+
// file except in compliance with the License. You may obtain a copy of the License at:
|
|
13
|
+
//
|
|
14
|
+
// http://opensource.org/licenses/MIT
|
|
15
|
+
//
|
|
16
|
+
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
|
|
17
|
+
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
|
|
18
|
+
// License for the specific language governing permissions and limitations.
|
|
19
|
+
//
|
|
20
|
+
// Code Modification History:
|
|
21
|
+
// ----------------------------------------------------------------------------------------------------
|
|
22
|
+
// 03/02/2022 - C Lackner
|
|
23
|
+
// Generated original version of source code.
|
|
24
|
+
// ******************************************************************************************************
|
|
25
|
+
const React = require("react");
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param props
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
function NumberFilter(props) {
|
|
32
|
+
var _a, _b, _c, _d, _e;
|
|
33
|
+
const [value, setValue] = React.useState('');
|
|
34
|
+
const [secondValue, setSecondValue] = React.useState('');
|
|
35
|
+
const [operator, setOperator] = React.useState('less than');
|
|
36
|
+
const [unitIndex, setUnitIndex] = React.useState(0);
|
|
37
|
+
React.useEffect(() => {
|
|
38
|
+
if (props.Filter.length === 0) {
|
|
39
|
+
setValue('');
|
|
40
|
+
setSecondValue('');
|
|
41
|
+
}
|
|
42
|
+
if (props.Filter.length > 1) {
|
|
43
|
+
const f1 = props.Filter.find(f => f.Operator === '>' || f.Operator === '>=');
|
|
44
|
+
if (f1 == null)
|
|
45
|
+
setValue('');
|
|
46
|
+
else
|
|
47
|
+
setValue(f1.SearchText);
|
|
48
|
+
const f2 = props.Filter.find(f => f.Operator === '<' || f.Operator === '<=');
|
|
49
|
+
if (f2 == null)
|
|
50
|
+
setSecondValue('');
|
|
51
|
+
else
|
|
52
|
+
setSecondValue(f2.SearchText);
|
|
53
|
+
}
|
|
54
|
+
if (props.Filter.length === 1) {
|
|
55
|
+
setSecondValue('');
|
|
56
|
+
if (props.Filter[0].Operator === '>' || props.Filter[0].Operator === '>=')
|
|
57
|
+
setOperator('greater than');
|
|
58
|
+
else if (props.Filter[0].Operator === '=')
|
|
59
|
+
setOperator('equal to');
|
|
60
|
+
else
|
|
61
|
+
setOperator('less than');
|
|
62
|
+
setValue(props.Filter[0].SearchText);
|
|
63
|
+
}
|
|
64
|
+
}, [props.Filter]);
|
|
65
|
+
React.useEffect(() => {
|
|
66
|
+
let handle = null;
|
|
67
|
+
if (value === '' && secondValue === '' && props.Filter.length !== 0)
|
|
68
|
+
handle = setTimeout(() => props.SetFilter([]), 500);
|
|
69
|
+
if (value === '' && secondValue === '')
|
|
70
|
+
return () => { if (handle !== null)
|
|
71
|
+
clearTimeout(handle); };
|
|
72
|
+
if (operator === 'between')
|
|
73
|
+
handle = setTimeout(() => props.SetFilter([
|
|
74
|
+
{
|
|
75
|
+
FieldName: props.FieldName,
|
|
76
|
+
IsPivotColumn: false,
|
|
77
|
+
Operator: '>=',
|
|
78
|
+
Type: 'number',
|
|
79
|
+
SearchText: value
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
FieldName: props.FieldName,
|
|
83
|
+
IsPivotColumn: false,
|
|
84
|
+
Operator: '<=',
|
|
85
|
+
Type: 'number',
|
|
86
|
+
SearchText: secondValue
|
|
87
|
+
}
|
|
88
|
+
]), 500);
|
|
89
|
+
else
|
|
90
|
+
handle = setTimeout(() => props.SetFilter([{
|
|
91
|
+
FieldName: props.FieldName,
|
|
92
|
+
IsPivotColumn: false,
|
|
93
|
+
Operator: transformSymbol(operator),
|
|
94
|
+
Type: 'number',
|
|
95
|
+
SearchText: value
|
|
96
|
+
}]), 500);
|
|
97
|
+
return () => { if (handle !== null)
|
|
98
|
+
clearTimeout(handle); };
|
|
99
|
+
}, [operator, value, secondValue]);
|
|
100
|
+
function transformSymbol(s) {
|
|
101
|
+
if (s === 'less than')
|
|
102
|
+
return '<';
|
|
103
|
+
if (s === 'greater than')
|
|
104
|
+
return '>';
|
|
105
|
+
return '=';
|
|
106
|
+
}
|
|
107
|
+
const hasUnit = props.Unit !== undefined && unitIndex >= 0 && unitIndex < props.Unit.length;
|
|
108
|
+
return React.createElement(React.Fragment, null,
|
|
109
|
+
React.createElement("tr", { onClick: (evt) => { evt.preventDefault(); } },
|
|
110
|
+
React.createElement("td", null,
|
|
111
|
+
React.createElement("select", { className: 'form-control', value: operator, onChange: (evt) => {
|
|
112
|
+
const v = evt.target.value;
|
|
113
|
+
setOperator(v);
|
|
114
|
+
} },
|
|
115
|
+
React.createElement("option", { value: 'less than' },
|
|
116
|
+
"Less than (",
|
|
117
|
+
'<',
|
|
118
|
+
")"),
|
|
119
|
+
React.createElement("option", { value: 'equal to' }, "Equal to (=)"),
|
|
120
|
+
React.createElement("option", { value: 'greater than' },
|
|
121
|
+
"Greater than (",
|
|
122
|
+
'>',
|
|
123
|
+
")"),
|
|
124
|
+
React.createElement("option", { value: 'between' }, "In range")))),
|
|
125
|
+
React.createElement("tr", { onClick: (evt) => { evt.preventDefault(); } },
|
|
126
|
+
React.createElement("td", null,
|
|
127
|
+
React.createElement("input", { type: 'number', className: 'form-control', value: props.Unit !== undefined && hasUnit ? (_a = props.Unit[unitIndex].GetValue(parseFloat(value)).toString()) !== null && _a !== void 0 ? _a : '' : value, onChange: (evt) => {
|
|
128
|
+
let v = evt.target.value;
|
|
129
|
+
if (props.Unit !== undefined && unitIndex >= 0 && unitIndex < props.Unit.length) {
|
|
130
|
+
v = props.Unit[unitIndex].GetFilter(parseFloat(v)).toString();
|
|
131
|
+
}
|
|
132
|
+
setValue(v);
|
|
133
|
+
} })),
|
|
134
|
+
props.Unit !== undefined ?
|
|
135
|
+
React.createElement("td", null,
|
|
136
|
+
React.createElement("select", { className: 'form-control', value: (_c = (_b = props.Unit[unitIndex]) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : '', onChange: (evt) => {
|
|
137
|
+
var _a, _b;
|
|
138
|
+
const v = evt.target.value;
|
|
139
|
+
setUnitIndex((_b = (_a = props.Unit) === null || _a === void 0 ? void 0 : _a.findIndex(u => u.label === v)) !== null && _b !== void 0 ? _b : -1);
|
|
140
|
+
} }, props.Unit.map((u) => React.createElement("option", { value: u.label, key: u.label }, u.label)))) : null),
|
|
141
|
+
operator === 'between' ? React.createElement(React.Fragment, null,
|
|
142
|
+
React.createElement("tr", { onClick: (evt) => { evt.preventDefault(); } },
|
|
143
|
+
React.createElement("td", null, "and")),
|
|
144
|
+
React.createElement("tr", { onClick: (evt) => { evt.preventDefault(); } },
|
|
145
|
+
React.createElement("td", null,
|
|
146
|
+
React.createElement("input", { type: 'number', className: 'form-control', value: props.Unit !== undefined && hasUnit ? props.Unit[unitIndex].GetValue(parseFloat(secondValue)).toString() : secondValue, onChange: (evt) => {
|
|
147
|
+
let v = evt.target.value;
|
|
148
|
+
if (props.Unit !== undefined && unitIndex >= 0 && unitIndex < props.Unit.length) {
|
|
149
|
+
v = props.Unit[unitIndex].GetFilter(parseFloat(v)).toString();
|
|
150
|
+
}
|
|
151
|
+
setSecondValue(v);
|
|
152
|
+
} }))),
|
|
153
|
+
props.Unit !== undefined ?
|
|
154
|
+
React.createElement("td", null,
|
|
155
|
+
React.createElement("select", { className: 'form-control', value: (_e = (_d = props.Unit[unitIndex]) === null || _d === void 0 ? void 0 : _d.label) !== null && _e !== void 0 ? _e : '', onChange: (evt) => {
|
|
156
|
+
var _a, _b;
|
|
157
|
+
const v = evt.target.value;
|
|
158
|
+
setUnitIndex((_b = (_a = props.Unit) === null || _a === void 0 ? void 0 : _a.findIndex(u => u.label === v)) !== null && _b !== void 0 ? _b : -1);
|
|
159
|
+
} }, props.Unit.map((u) => React.createElement("option", { value: u.label, key: u.label }, u.label)))) : null) : null);
|
|
160
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Search } from '@gpa-gemstone/react-interactive';
|
|
2
|
+
interface IProps<T> {
|
|
3
|
+
SetFilter: (evt: Search.IFilter<T>[]) => void;
|
|
4
|
+
Filter: Search.IFilter<T>[];
|
|
5
|
+
FieldName: string;
|
|
6
|
+
ApproxMatches?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Component for rendering a text input filter.
|
|
10
|
+
* @param props - Props for configuring and managing the text filter.
|
|
11
|
+
* @returns JSX for rendering a text input filter with wildcard options.
|
|
12
|
+
*/
|
|
13
|
+
export declare function TextFilter<T>(props: IProps<T>): JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TextFilter = TextFilter;
|
|
4
|
+
// ******************************************************************************************************
|
|
5
|
+
// TextFilter.tsx - Gbtc
|
|
6
|
+
//
|
|
7
|
+
// Copyright © 2022, Grid Protection Alliance. All Rights Reserved.
|
|
8
|
+
//
|
|
9
|
+
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
|
|
10
|
+
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
|
|
11
|
+
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
|
|
12
|
+
// file except in compliance with the License. You may obtain a copy of the License at:
|
|
13
|
+
//
|
|
14
|
+
// http://opensource.org/licenses/MIT
|
|
15
|
+
//
|
|
16
|
+
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
|
|
17
|
+
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
|
|
18
|
+
// License for the specific language governing permissions and limitations.
|
|
19
|
+
//
|
|
20
|
+
// Code Modification History:
|
|
21
|
+
// ----------------------------------------------------------------------------------------------------
|
|
22
|
+
// 03/02/2022 - C Lackner
|
|
23
|
+
// Generated original version of source code.
|
|
24
|
+
// ******************************************************************************************************
|
|
25
|
+
const React = require("react");
|
|
26
|
+
/**
|
|
27
|
+
* Component for rendering a text input filter.
|
|
28
|
+
* @param props - Props for configuring and managing the text filter.
|
|
29
|
+
* @returns JSX for rendering a text input filter with wildcard options.
|
|
30
|
+
*/
|
|
31
|
+
function TextFilter(props) {
|
|
32
|
+
const [txt, setTxt] = React.useState('');
|
|
33
|
+
// Handles changes in the Filter prop.
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
var _a;
|
|
36
|
+
// Resets text input if there is no filter.
|
|
37
|
+
if (props.Filter.length === 0) {
|
|
38
|
+
setTxt('');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (((_a = props.ApproxMatches) !== null && _a !== void 0 ? _a : true))
|
|
42
|
+
setTxt(props.Filter[0].SearchText.substring(1, props.Filter[0].SearchText.length - 1));
|
|
43
|
+
else
|
|
44
|
+
setTxt(props.Filter[0].SearchText);
|
|
45
|
+
}, [props.Filter]);
|
|
46
|
+
// Handles text input chanages.
|
|
47
|
+
React.useEffect(() => {
|
|
48
|
+
let handle = null;
|
|
49
|
+
// Clears filter if txt is empty AND filter is not empty.
|
|
50
|
+
if ((txt == null || txt.trim().length === 0) && props.Filter.length !== 0)
|
|
51
|
+
handle = setTimeout(() => props.SetFilter([]), 500);
|
|
52
|
+
// Applies filter based on specifications.
|
|
53
|
+
if (txt != null && txt.trim().length > 0 && (props.Filter.length === 0 || props.Filter[0].SearchText !== txt.trim()))
|
|
54
|
+
handle = setTimeout(() => props.SetFilter([{
|
|
55
|
+
FieldName: props.FieldName,
|
|
56
|
+
IsPivotColumn: false,
|
|
57
|
+
SearchText: (props.ApproxMatches === undefined || props.ApproxMatches ? '%' + txt.trim() + '%' : txt.trim()),
|
|
58
|
+
Operator: 'LIKE',
|
|
59
|
+
Type: 'string'
|
|
60
|
+
}]), 500);
|
|
61
|
+
// Cleans function to clear timeout.
|
|
62
|
+
return () => { if (handle !== null)
|
|
63
|
+
clearTimeout(handle); };
|
|
64
|
+
}, [txt]);
|
|
65
|
+
// renders text input filter and addl information
|
|
66
|
+
return React.createElement(React.Fragment, null,
|
|
67
|
+
React.createElement("tr", { onClick: (evt) => { evt.preventDefault(); } },
|
|
68
|
+
React.createElement("td", null,
|
|
69
|
+
React.createElement("input", { className: 'form-control', value: txt.replace('$_', '_'), placeholder: "Search", onChange: (evt) => {
|
|
70
|
+
const value = evt.target.value;
|
|
71
|
+
setTxt(value.replace('_', '$_'));
|
|
72
|
+
} }))),
|
|
73
|
+
React.createElement("tr", null,
|
|
74
|
+
React.createElement("td", null,
|
|
75
|
+
" ",
|
|
76
|
+
React.createElement("label", null, "Wildcard (*) can be used"),
|
|
77
|
+
" ")));
|
|
78
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Search } from '@gpa-gemstone/react-interactive';
|
|
2
|
+
/**
|
|
3
|
+
* Interface defining the properties expected by the BooleanFilter component.
|
|
4
|
+
*/
|
|
5
|
+
interface IFilterProps<T> {
|
|
6
|
+
/**
|
|
7
|
+
* Function to set the filter based on Search.IFilter<T> array.
|
|
8
|
+
* @param evt - Event handler that updates the filter.
|
|
9
|
+
*/
|
|
10
|
+
SetFilter: (evt: Search.IFilter<T>[]) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Array of filters of type Search.IFilter<T>.
|
|
13
|
+
*/
|
|
14
|
+
Filter: Search.IFilter<T>[];
|
|
15
|
+
/**
|
|
16
|
+
* Name of the field for filtering.
|
|
17
|
+
*/
|
|
18
|
+
FieldName: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Component to handle boolean filtering based on provided filter props.
|
|
22
|
+
* @param {IFilterProps<T>} props - Props passed to the BooleanFilter component.
|
|
23
|
+
* @returns JSX element representing the BooleanFilter component.
|
|
24
|
+
*/
|
|
25
|
+
export declare function BooleanFilter<T>(props: IFilterProps<T>): JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BooleanFilter = BooleanFilter;
|
|
4
|
+
// ******************************************************************************************************
|
|
5
|
+
// BooleanFilter.tsx - Gbtc
|
|
6
|
+
//
|
|
7
|
+
// Copyright © 2022, Grid Protection Alliance. All Rights Reserved.
|
|
8
|
+
//
|
|
9
|
+
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
|
|
10
|
+
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
|
|
11
|
+
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
|
|
12
|
+
// file except in compliance with the License. You may obtain a copy of the License at:
|
|
13
|
+
//
|
|
14
|
+
// http://opensource.org/licenses/MIT
|
|
15
|
+
//
|
|
16
|
+
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
|
|
17
|
+
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
|
|
18
|
+
// License for the specific language governing permissions and limitations.
|
|
19
|
+
//
|
|
20
|
+
// Code Modification History:
|
|
21
|
+
// ----------------------------------------------------------------------------------------------------
|
|
22
|
+
// 03/02/2022 - C. Lackner
|
|
23
|
+
// Generated original version of source code.
|
|
24
|
+
// ******************************************************************************************************
|
|
25
|
+
const React = require("react");
|
|
26
|
+
/**
|
|
27
|
+
* Component to handle boolean filtering based on provided filter props.
|
|
28
|
+
* @param {IFilterProps<T>} props - Props passed to the BooleanFilter component.
|
|
29
|
+
* @returns JSX element representing the BooleanFilter component.
|
|
30
|
+
*/
|
|
31
|
+
function BooleanFilter(props) {
|
|
32
|
+
const [selected, setSelected] = React.useState(false);
|
|
33
|
+
const [notSelected, setNotSelected] = React.useState(false);
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
if (props.Filter.length === 0) {
|
|
36
|
+
setSelected(true);
|
|
37
|
+
setNotSelected(true);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
setSelected(props.Filter[0].SearchText === '1');
|
|
41
|
+
setNotSelected(props.Filter[0].SearchText !== '1');
|
|
42
|
+
}, [props.Filter]);
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
if (!selected && !notSelected) {
|
|
45
|
+
setSelected(true);
|
|
46
|
+
setNotSelected(true);
|
|
47
|
+
}
|
|
48
|
+
}, [selected, notSelected]);
|
|
49
|
+
React.useEffect(() => {
|
|
50
|
+
if (selected && !notSelected && (props.Filter.length === 0 || props.Filter[0].SearchText !== '1')) {
|
|
51
|
+
props.SetFilter([{ FieldName: props.FieldName, IsPivotColumn: false, SearchText: '1', Operator: '=', Type: 'boolean' }]);
|
|
52
|
+
}
|
|
53
|
+
if (!selected && notSelected && (props.Filter.length === 0 || props.Filter[0].SearchText !== '0')) {
|
|
54
|
+
props.SetFilter([{ FieldName: props.FieldName, IsPivotColumn: false, SearchText: '0', Operator: '=', Type: 'boolean' }]);
|
|
55
|
+
}
|
|
56
|
+
if (selected && notSelected && props.Filter.length > 0)
|
|
57
|
+
props.SetFilter([]);
|
|
58
|
+
}, [selected, notSelected]);
|
|
59
|
+
return React.createElement(React.Fragment, null,
|
|
60
|
+
React.createElement("tr", { onClick: (evt) => { evt.preventDefault(); setSelected((s) => !s); } },
|
|
61
|
+
React.createElement("td", null,
|
|
62
|
+
React.createElement("input", { type: "checkbox", checked: selected, onChange: () => null })),
|
|
63
|
+
React.createElement("td", null, "Selected")),
|
|
64
|
+
React.createElement("tr", { onClick: (evt) => { evt.preventDefault(); setNotSelected((v) => !v); } },
|
|
65
|
+
React.createElement("td", null,
|
|
66
|
+
React.createElement("input", { type: "checkbox", checked: notSelected, onChange: () => null })),
|
|
67
|
+
React.createElement("td", null, "Not Selected")));
|
|
68
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Search } from '@gpa-gemstone/react-interactive';
|
|
2
|
+
interface IProps<T> {
|
|
3
|
+
SetFilter: (evt: Search.IFilter<T>[]) => void;
|
|
4
|
+
Filter: Search.IFilter<T>[];
|
|
5
|
+
FieldName: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function DateFilter<T>(props: IProps<T>): JSX.Element;
|
|
8
|
+
export declare function TimeFilter<T>(props: IProps<T>): JSX.Element;
|
|
9
|
+
export declare function DateTimeFilter<T>(props: IProps<T>): JSX.Element;
|
|
10
|
+
export {};
|