@onehat/ui 0.4.40 → 0.4.42
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/Components/Buttons/Button.js +6 -13
- package/src/Components/Buttons/ReloadButton.js +0 -1
- package/src/Components/Filter/DateRange.js +3 -1
- package/src/Components/Filter/NumberRange.js +4 -1
- package/src/Components/Form/Field/Checkbox/CheckboxGroup.js +11 -9
- package/src/Components/Form/Field/Combo/Combo.js +118 -83
- package/src/Components/Form/Field/Combo/PageSizeCombo.js +1 -0
- package/src/Components/Form/Field/Date.js +15 -2
- package/src/Components/Form/Field/Number.js +5 -6
- package/src/Components/Form/Field/RadioGroup/RadioGroup.js +11 -9
- package/src/Components/Form/Field/Select/PageSizeSelect.js +2 -1
- package/src/Components/Form/Field/Slider.js +186 -191
- package/src/Components/Form/Field/Tag/Tag.js +12 -10
- package/src/Components/Form/Field/TextArea.js +96 -98
- package/src/Components/Form/Form.js +12 -9
- package/src/Components/Grid/Grid.js +21 -22
- package/src/Components/Grid/GridRow.js +11 -12
- package/src/Components/Hoc/Secondary/withSecondarySelection.js +22 -7
- package/src/Components/Hoc/withEditor.js +60 -21
- package/src/Components/Hoc/withFilters.js +1 -1
- package/src/Components/Hoc/withMultiSelection.js +1 -2
- package/src/Components/Hoc/withPdfButtons.js +3 -0
- package/src/Components/Hoc/withSelection.js +63 -35
- package/src/Components/Hoc/withTooltip.js +7 -1
- package/src/Components/Toolbar/Pagination.js +56 -56
- package/src/Components/Toolbar/PaginationToolbar.js +18 -15
- package/src/Components/Toolbar/Toolbar.js +4 -7
- package/src/Components/Tooltip/Tooltip.js +13 -10
- package/src/Components/Tree/Tree.js +14 -10
- package/src/Components/Viewer/MeterTypeText.js +3 -3
- package/src/Constants/Styles.js +2 -0
package/package.json
CHANGED
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
ButtonSpinner,
|
|
6
6
|
ButtonIcon,
|
|
7
7
|
ButtonGroup,
|
|
8
|
-
Tooltip,
|
|
9
8
|
} from '@project-components/Gluestack';
|
|
10
9
|
import withComponent from '../Hoc/withComponent.js';
|
|
11
10
|
import withTooltip from '../Hoc/withTooltip.js';
|
|
@@ -22,7 +21,6 @@ const ButtonComponent = forwardRef((props, ref) => {
|
|
|
22
21
|
_icon, // props for icon
|
|
23
22
|
_rightIcon, // props for rightIcon
|
|
24
23
|
_text = {}, // props for ButtonText
|
|
25
|
-
tooltip,
|
|
26
24
|
...propsToPass
|
|
27
25
|
} = props;
|
|
28
26
|
|
|
@@ -61,17 +59,12 @@ const ButtonComponent = forwardRef((props, ref) => {
|
|
|
61
59
|
className += ' ' + propsToPass.className;
|
|
62
60
|
}
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (tooltip) {
|
|
71
|
-
button = <Tooltip text={tooltip}>{button}</Tooltip>;
|
|
72
|
-
}
|
|
73
|
-
return button;
|
|
74
|
-
|
|
62
|
+
return <Button {...propsToPass} className={className} ref={ref}>
|
|
63
|
+
{isLoading && <ButtonSpinner className="ButtonSpinner" {..._spinner} />}
|
|
64
|
+
{icon}
|
|
65
|
+
{text && <ButtonText className="ButtonText" {..._text}>{text}</ButtonText>}
|
|
66
|
+
{rightIcon}
|
|
67
|
+
</Button>;
|
|
75
68
|
});
|
|
76
69
|
|
|
77
70
|
export default withComponent(withTooltip(ButtonComponent));
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
} from '@project-components/Gluestack';
|
|
7
7
|
import Date from '../Form/Field/Date.js';
|
|
8
8
|
import testProps from '../../Functions/testProps.js';
|
|
9
|
-
import withTooltip from '../Hoc/withTooltip.js';
|
|
10
9
|
import withValue from '../Hoc/withValue.js';
|
|
11
10
|
import _ from 'lodash';
|
|
12
11
|
|
|
@@ -22,6 +21,7 @@ const
|
|
|
22
21
|
minValue,
|
|
23
22
|
maxValue,
|
|
24
23
|
tooltip,
|
|
24
|
+
tooltipPlacement,
|
|
25
25
|
|
|
26
26
|
// withComponent
|
|
27
27
|
self,
|
|
@@ -100,6 +100,7 @@ const
|
|
|
100
100
|
minValue={minValue}
|
|
101
101
|
maxValue={maxValue}
|
|
102
102
|
tooltip={(tooltip ? tooltip + ' ' : '') + 'Low'}
|
|
103
|
+
tooltipPlacement={tooltipPlacement}
|
|
103
104
|
limitWidth={true}
|
|
104
105
|
parent={self}
|
|
105
106
|
reference="low"
|
|
@@ -113,6 +114,7 @@ const
|
|
|
113
114
|
minValue={minValue}
|
|
114
115
|
maxValue={maxValue}
|
|
115
116
|
tooltip={(tooltip ? tooltip + ' ' : '') + 'High'}
|
|
117
|
+
tooltipPlacement={tooltipPlacement}
|
|
116
118
|
limitWidth={true}
|
|
117
119
|
parent={self}
|
|
118
120
|
reference="high"
|
|
@@ -17,7 +17,8 @@ const
|
|
|
17
17
|
high: null,
|
|
18
18
|
},
|
|
19
19
|
setValue,
|
|
20
|
-
tooltip
|
|
20
|
+
tooltip,
|
|
21
|
+
tooltipPlacement,
|
|
21
22
|
|
|
22
23
|
minValue = 0,
|
|
23
24
|
maxValue,
|
|
@@ -82,6 +83,7 @@ const
|
|
|
82
83
|
minValue={minValue}
|
|
83
84
|
maxValue={maxValue}
|
|
84
85
|
tooltip={(tooltip ? tooltip + ' ' : '') + 'Low'}
|
|
86
|
+
tooltipPlacement={tooltipPlacement}
|
|
85
87
|
className="max-w-[150px]"
|
|
86
88
|
/>
|
|
87
89
|
<Text className="px-2 select-none">to</Text>
|
|
@@ -93,6 +95,7 @@ const
|
|
|
93
95
|
minValue={minValue}
|
|
94
96
|
maxValue={maxValue}
|
|
95
97
|
tooltip={(tooltip ? tooltip + ' ' : '') + 'High'}
|
|
98
|
+
tooltipPlacement={tooltipPlacement}
|
|
96
99
|
className="max-w-[150px]"
|
|
97
100
|
/>
|
|
98
101
|
</HStack>;
|
|
@@ -28,15 +28,17 @@ const
|
|
|
28
28
|
const checkboxProps = {
|
|
29
29
|
};
|
|
30
30
|
if (Repository) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
if (!Repository.isDestroyed) {
|
|
32
|
+
const entities = Repository.getEntitiesOnPage();
|
|
33
|
+
checkboxes = _.map(entities, (entity, ix) => {
|
|
34
|
+
return <Checkbox
|
|
35
|
+
{...testProps('checkbox-' + entity.id)}
|
|
36
|
+
key={ix}
|
|
37
|
+
value={entity.id}
|
|
38
|
+
{...checkboxProps}
|
|
39
|
+
>{entity.displayValue}</Checkbox>;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
40
42
|
} else {
|
|
41
43
|
checkboxes = _.map(data, (datum, ix) => {
|
|
42
44
|
return <Checkbox
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef, useState, useEffect, useRef, } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Box,
|
|
4
4
|
HStack,
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
Pressable,
|
|
10
10
|
Text,
|
|
11
11
|
TextNative,
|
|
12
|
-
Tooltip,
|
|
13
12
|
VStackNative,
|
|
14
13
|
} from '@project-components/Gluestack';
|
|
15
14
|
import {
|
|
@@ -37,13 +36,26 @@ import _ from 'lodash';
|
|
|
37
36
|
|
|
38
37
|
const FILTER_NAME = 'q';
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
/**
|
|
40
|
+
* isEmptyValue
|
|
41
|
+
* _.isEmpty returns true for all integers, so we need this instead
|
|
42
|
+
* @param {*} value
|
|
43
|
+
* @returns boolean
|
|
44
|
+
*/
|
|
45
|
+
function isEmptyValue(value) {
|
|
46
|
+
//
|
|
47
|
+
return value === null ||
|
|
48
|
+
value === undefined ||
|
|
49
|
+
value === '' ||
|
|
50
|
+
value === 0 ||
|
|
51
|
+
(_.isObject(value) && _.isEmpty(value));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const ComboComponent = forwardRef((props, ref) => {
|
|
41
55
|
|
|
42
56
|
const {
|
|
43
57
|
additionalButtons,
|
|
44
58
|
autoFocus = false,
|
|
45
|
-
tooltipRef = null,
|
|
46
|
-
tooltip = null,
|
|
47
59
|
menuMinWidth,
|
|
48
60
|
disableDirectEntry = false,
|
|
49
61
|
hideMenuOnSelection = true,
|
|
@@ -58,7 +70,6 @@ export function ComboComponent(props) {
|
|
|
58
70
|
minimizeForRow = false,
|
|
59
71
|
reloadOnTrigger = false,
|
|
60
72
|
menuHeight,
|
|
61
|
-
tooltipPlacement = 'bottom',
|
|
62
73
|
placeholder,
|
|
63
74
|
onRowPress,
|
|
64
75
|
icon,
|
|
@@ -68,6 +79,8 @@ export function ComboComponent(props) {
|
|
|
68
79
|
onGridDelete, // to hook into when menu deletes (ComboEditor only)
|
|
69
80
|
onSubmit, // when Combo is used in a Tag, call this when the user submits the Combo value (i.e. presses Enter or clicks a row)
|
|
70
81
|
newEntityDisplayProperty,
|
|
82
|
+
tooltip = null,
|
|
83
|
+
tooltipPlacement = 'bottom',
|
|
71
84
|
testID,
|
|
72
85
|
|
|
73
86
|
// withComponent
|
|
@@ -172,19 +185,20 @@ export function ComboComponent(props) {
|
|
|
172
185
|
} else if (_.isArray(value)) {
|
|
173
186
|
displayValue = [];
|
|
174
187
|
if (Repository) {
|
|
175
|
-
if (!Repository.
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
if (Repository.isLoading) {
|
|
180
|
-
await Repository.waitUntilDoneLoading();
|
|
181
|
-
}
|
|
182
|
-
displayValue = _.each(value, (id) => {
|
|
183
|
-
const entity = Repository.getById(id);
|
|
184
|
-
if (entity) {
|
|
185
|
-
displayValue.push(entity.displayValue);
|
|
188
|
+
if (!Repository.isDestroyed) {
|
|
189
|
+
if (!Repository.isLoaded) {
|
|
190
|
+
throw Error('Not yet implemented'); // Would a Combo ever have multiple remote selections? Shouldn't that be a Tag field??
|
|
186
191
|
}
|
|
187
|
-
|
|
192
|
+
if (Repository.isLoading) {
|
|
193
|
+
await Repository.waitUntilDoneLoading();
|
|
194
|
+
}
|
|
195
|
+
displayValue = _.each(value, (id) => {
|
|
196
|
+
const entity = Repository.getById(id);
|
|
197
|
+
if (entity) {
|
|
198
|
+
displayValue.push(entity.displayValue);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
188
202
|
} else {
|
|
189
203
|
displayValue = _.each(value, (id) => {
|
|
190
204
|
const item = _.find(data, (datum) => datum[idIx] === id);
|
|
@@ -196,25 +210,33 @@ export function ComboComponent(props) {
|
|
|
196
210
|
displayValue = displayValue.join(', ');
|
|
197
211
|
} else {
|
|
198
212
|
if (Repository) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
213
|
+
if (!Repository.isDestroyed) {
|
|
214
|
+
let entity;
|
|
215
|
+
if (!isEmptyValue(value)) {
|
|
216
|
+
if (!Repository.isLoaded) {
|
|
217
|
+
entity = await Repository.getSingleEntityFromServer(value);
|
|
218
|
+
} else {
|
|
219
|
+
if (Repository.isLoading) {
|
|
220
|
+
await Repository.waitUntilDoneLoading();
|
|
221
|
+
}
|
|
222
|
+
entity = Repository.getById(value);
|
|
223
|
+
if (!entity) {
|
|
224
|
+
entity = await Repository.getSingleEntityFromServer(value);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
209
227
|
}
|
|
228
|
+
displayValue = entity?.displayValue || '';
|
|
210
229
|
}
|
|
211
|
-
displayValue = entity?.displayValue || '';
|
|
212
230
|
} else {
|
|
213
231
|
const item = _.find(data, (datum) => datum[idIx] === value);
|
|
214
232
|
displayValue = (item && item[displayIx]) || '';
|
|
215
233
|
}
|
|
216
234
|
}
|
|
217
235
|
|
|
236
|
+
if (isInTag) {
|
|
237
|
+
displayValue = '';
|
|
238
|
+
}
|
|
239
|
+
|
|
218
240
|
displayValueRef.current = displayValue;
|
|
219
241
|
resetTextInputValue();
|
|
220
242
|
},
|
|
@@ -401,14 +423,16 @@ export function ComboComponent(props) {
|
|
|
401
423
|
},
|
|
402
424
|
clearGridFilters = async () => {
|
|
403
425
|
if (Repository) {
|
|
404
|
-
if (Repository.
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
Repository.
|
|
410
|
-
|
|
411
|
-
|
|
426
|
+
if (!Repository.isDestroyed) {
|
|
427
|
+
if (Repository.isLoading) {
|
|
428
|
+
await Repository.waitUntilDoneLoading();
|
|
429
|
+
}
|
|
430
|
+
const filterName = getFilterName();
|
|
431
|
+
if (Repository.hasFilter(filterName)) {
|
|
432
|
+
Repository.clearFilters(filterName);
|
|
433
|
+
if (Repository.isRemote && !Repository.isAutoLoad) {
|
|
434
|
+
await Repository.reload();
|
|
435
|
+
}
|
|
412
436
|
}
|
|
413
437
|
}
|
|
414
438
|
} else {
|
|
@@ -423,42 +447,44 @@ export function ComboComponent(props) {
|
|
|
423
447
|
searchForMatches = async (value) => {
|
|
424
448
|
let found;
|
|
425
449
|
if (Repository) {
|
|
426
|
-
if (Repository.
|
|
427
|
-
|
|
428
|
-
|
|
450
|
+
if (!Repository.isDestroyed) {
|
|
451
|
+
if (Repository.isLoading) {
|
|
452
|
+
await Repository.waitUntilDoneLoading();
|
|
453
|
+
}
|
|
429
454
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
455
|
+
if (_.isEmpty(value)) {
|
|
456
|
+
clearGridFilters();
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
434
459
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
460
|
+
// Set filter
|
|
461
|
+
const
|
|
462
|
+
idRegex = /^id:(.*)$/,
|
|
463
|
+
isId = _.isString(value) && !!value.match(idRegex),
|
|
464
|
+
filterName = getFilterName(isId);
|
|
465
|
+
if (Repository.isRemote) {
|
|
466
|
+
// remote
|
|
467
|
+
const filterValue = _.isEmpty(value) ? null : (isId ? value.match(idRegex)[1] : value + '%');
|
|
468
|
+
await Repository.filter(filterName, filterValue);
|
|
469
|
+
if (!Repository.isAutoLoad) {
|
|
470
|
+
await Repository.reload();
|
|
471
|
+
}
|
|
472
|
+
} else {
|
|
473
|
+
// local
|
|
474
|
+
Repository.filter({
|
|
475
|
+
name: filterName,
|
|
476
|
+
fn: (entity) => {
|
|
477
|
+
const
|
|
478
|
+
displayValue = entity.displayValue,
|
|
479
|
+
regex = new RegExp('^' + value, 'i'); // case-insensitive
|
|
480
|
+
return displayValue.match(regex);
|
|
481
|
+
},
|
|
482
|
+
});
|
|
446
483
|
}
|
|
447
|
-
} else {
|
|
448
|
-
// local
|
|
449
|
-
Repository.filter({
|
|
450
|
-
name: filterName,
|
|
451
|
-
fn: (entity) => {
|
|
452
|
-
const
|
|
453
|
-
displayValue = entity.displayValue,
|
|
454
|
-
regex = new RegExp('^' + value, 'i'); // case-insensitive
|
|
455
|
-
return displayValue.match(regex);
|
|
456
|
-
},
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
484
|
|
|
460
|
-
|
|
461
|
-
|
|
485
|
+
if (!isId) {
|
|
486
|
+
setNewEntityDisplayValue(value); // capture the search query so we can tell Grid what to use for a new entity's displayValue
|
|
487
|
+
}
|
|
462
488
|
}
|
|
463
489
|
} else {
|
|
464
490
|
// Search through data
|
|
@@ -630,6 +656,14 @@ export function ComboComponent(props) {
|
|
|
630
656
|
InputLeftElement={inputIconElement}
|
|
631
657
|
autoSubmitDelay={500}
|
|
632
658
|
placeholder={placeholder}
|
|
659
|
+
tooltip={tooltip}
|
|
660
|
+
tooltipPlacement={tooltipPlacement}
|
|
661
|
+
tooltipClassName={`
|
|
662
|
+
grow
|
|
663
|
+
h-auto
|
|
664
|
+
self-stretch
|
|
665
|
+
flex-1
|
|
666
|
+
`}
|
|
633
667
|
className={`
|
|
634
668
|
Combo-Input
|
|
635
669
|
grow
|
|
@@ -858,6 +892,13 @@ export function ComboComponent(props) {
|
|
|
858
892
|
InputLeftElement={inputIconElement}
|
|
859
893
|
autoSubmitDelay={500}
|
|
860
894
|
placeholder={placeholder}
|
|
895
|
+
tooltip={tooltip}
|
|
896
|
+
tooltipPlacement={tooltipPlacement}
|
|
897
|
+
tooltipClassName={`
|
|
898
|
+
grow
|
|
899
|
+
h-full
|
|
900
|
+
flex-1
|
|
901
|
+
`}
|
|
861
902
|
className={`
|
|
862
903
|
Combo-inputClone-Input
|
|
863
904
|
grow
|
|
@@ -964,6 +1005,12 @@ export function ComboComponent(props) {
|
|
|
964
1005
|
InputLeftElement={inputIconElement}
|
|
965
1006
|
autoSubmitDelay={500}
|
|
966
1007
|
placeholder={placeholder}
|
|
1008
|
+
tooltip={tooltip}
|
|
1009
|
+
tooltipPlacement={tooltipPlacement}
|
|
1010
|
+
tooltipClassName={`
|
|
1011
|
+
h-full
|
|
1012
|
+
flex-1
|
|
1013
|
+
`}
|
|
967
1014
|
className={`
|
|
968
1015
|
h-full
|
|
969
1016
|
flex-1
|
|
@@ -1014,10 +1061,6 @@ export function ComboComponent(props) {
|
|
|
1014
1061
|
</Modal>;
|
|
1015
1062
|
}
|
|
1016
1063
|
}
|
|
1017
|
-
const refProps = {};
|
|
1018
|
-
if (tooltipRef) {
|
|
1019
|
-
refProps.ref = tooltipRef;
|
|
1020
|
-
}
|
|
1021
1064
|
|
|
1022
1065
|
let className = `
|
|
1023
1066
|
Combo-HStack
|
|
@@ -1043,7 +1086,6 @@ export function ComboComponent(props) {
|
|
|
1043
1086
|
className="Combo-VStack"
|
|
1044
1087
|
>
|
|
1045
1088
|
<HStack
|
|
1046
|
-
{...refProps}
|
|
1047
1089
|
className={className}
|
|
1048
1090
|
>
|
|
1049
1091
|
{xButton}
|
|
@@ -1059,7 +1101,6 @@ export function ComboComponent(props) {
|
|
|
1059
1101
|
} else {
|
|
1060
1102
|
assembledComponents =
|
|
1061
1103
|
<HStackNative
|
|
1062
|
-
{...refProps}
|
|
1063
1104
|
testID={testID}
|
|
1064
1105
|
onLayout={onLayout}
|
|
1065
1106
|
className={className}
|
|
@@ -1115,15 +1156,9 @@ export function ComboComponent(props) {
|
|
|
1115
1156
|
</>;
|
|
1116
1157
|
}
|
|
1117
1158
|
|
|
1118
|
-
if (tooltip) {
|
|
1119
|
-
// TODO: implement withTooltip for Combo
|
|
1120
|
-
// assembledComponents = <Tooltip label={tooltip} placement={tooltipPlacement} className="h-full">
|
|
1121
|
-
// {assembledComponents}
|
|
1122
|
-
// </Tooltip>;
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1125
1159
|
return assembledComponents;
|
|
1126
|
-
|
|
1160
|
+
|
|
1161
|
+
});
|
|
1127
1162
|
|
|
1128
1163
|
export const Combo = withComponent(
|
|
1129
1164
|
withAlert(
|
|
@@ -24,7 +24,6 @@ import Input from '../Field/Input.js';
|
|
|
24
24
|
import IconButton from '../../Buttons/IconButton.js';
|
|
25
25
|
import Xmark from '../../Icons/Xmark.js';
|
|
26
26
|
import withComponent from '../../Hoc/withComponent.js';
|
|
27
|
-
import withTooltip from '../../Hoc/withTooltip.js';
|
|
28
27
|
import withValue from '../../Hoc/withValue.js';
|
|
29
28
|
import emptyFn from '../../../Functions/emptyFn.js';
|
|
30
29
|
import testProps from '../../../Functions/testProps.js';
|
|
@@ -51,6 +50,8 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
51
50
|
minimizeForRow = false,
|
|
52
51
|
minValue,
|
|
53
52
|
maxValue,
|
|
53
|
+
tooltip = null,
|
|
54
|
+
tooltipPlacement = 'bottom',
|
|
54
55
|
testID,
|
|
55
56
|
|
|
56
57
|
// withComponent
|
|
@@ -359,6 +360,12 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
359
360
|
onFocus={onInputFocus}
|
|
360
361
|
autoSubmit={true}
|
|
361
362
|
isDisabled={isDisabled}
|
|
363
|
+
tooltip={tooltip}
|
|
364
|
+
tooltipPlacement={tooltipPlacement}
|
|
365
|
+
tooltipClassName={`
|
|
366
|
+
flex-1
|
|
367
|
+
h-full
|
|
368
|
+
`}
|
|
362
369
|
// onLayout={(e) => {
|
|
363
370
|
// const {
|
|
364
371
|
// height,
|
|
@@ -510,6 +517,12 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
510
517
|
onBlur={onInputBlur}
|
|
511
518
|
autoSubmitDelay={1000}
|
|
512
519
|
placeholder={placeholder}
|
|
520
|
+
tooltip={tooltip}
|
|
521
|
+
tooltipPlacement={tooltipPlacement}
|
|
522
|
+
tooltipClassName={`
|
|
523
|
+
flex-1
|
|
524
|
+
h-full
|
|
525
|
+
`}
|
|
513
526
|
className={`
|
|
514
527
|
flex-1
|
|
515
528
|
h-full
|
|
@@ -602,4 +615,4 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
602
615
|
|
|
603
616
|
});
|
|
604
617
|
|
|
605
|
-
export default withComponent(withValue(
|
|
618
|
+
export default withComponent(withValue(DateElement));
|
|
@@ -9,14 +9,11 @@ import IconButton from '../../Buttons/IconButton.js';
|
|
|
9
9
|
import Input from './Input.js';
|
|
10
10
|
import testProps from '../../../Functions/testProps.js';
|
|
11
11
|
import withComponent from '../../Hoc/withComponent.js';
|
|
12
|
-
import withTooltip from '../../Hoc/withTooltip.js';
|
|
13
12
|
import withValue from '../../Hoc/withValue.js';
|
|
14
13
|
import Plus from '../../Icons/Plus.js';
|
|
15
14
|
import Minus from '../../Icons/Minus.js';
|
|
16
15
|
import _ from 'lodash';
|
|
17
16
|
|
|
18
|
-
const InputWithTooltip = withTooltip(Input);
|
|
19
|
-
|
|
20
17
|
function NumberElement(props) {
|
|
21
18
|
let {
|
|
22
19
|
value,
|
|
@@ -24,7 +21,8 @@ function NumberElement(props) {
|
|
|
24
21
|
minValue,
|
|
25
22
|
maxValue,
|
|
26
23
|
autoSubmitDelay = UiGlobals.autoSubmitDelay,
|
|
27
|
-
tooltip
|
|
24
|
+
tooltip,
|
|
25
|
+
tooltipPlacement,
|
|
28
26
|
isDisabled = false,
|
|
29
27
|
testID,
|
|
30
28
|
} = props,
|
|
@@ -158,15 +156,16 @@ function NumberElement(props) {
|
|
|
158
156
|
width: 40,
|
|
159
157
|
}}
|
|
160
158
|
/>
|
|
161
|
-
<
|
|
159
|
+
<Input
|
|
162
160
|
testID={testID}
|
|
163
161
|
value={inputValue}
|
|
164
162
|
onChangeText={onChangeText}
|
|
165
163
|
onKeyPress={onInputKeyPress}
|
|
166
164
|
isDisabled={isDisabled}
|
|
167
165
|
tooltip={tooltip}
|
|
166
|
+
tooltipPlacement={tooltipPlacement}
|
|
167
|
+
tooltipClassName="flex-1"
|
|
168
168
|
className={`
|
|
169
|
-
InputWithTooltip
|
|
170
169
|
h-full
|
|
171
170
|
text-center
|
|
172
171
|
rounded-none
|
|
@@ -30,15 +30,17 @@ const
|
|
|
30
30
|
my: '2px',
|
|
31
31
|
};
|
|
32
32
|
if (Repository) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
if (!Repository.isDestroyed) {
|
|
34
|
+
const entities = Repository.getEntitiesOnPage();
|
|
35
|
+
radios = _.map(entities, (entity, ix) => {
|
|
36
|
+
return <Radio
|
|
37
|
+
{...testProps('radio-' + entity.id)}
|
|
38
|
+
key={ix}
|
|
39
|
+
value={entity.id}
|
|
40
|
+
{...radioProps}
|
|
41
|
+
>{entity.displayValue}</Radio>;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
42
44
|
} else {
|
|
43
45
|
radios = _.map(data, (datum, ix) => {
|
|
44
46
|
return <Radio
|
|
@@ -11,7 +11,7 @@ export default function PageSizeSelect(props) {
|
|
|
11
11
|
} = props;
|
|
12
12
|
|
|
13
13
|
return useMemo(() => {
|
|
14
|
-
return <HStack className="PageSizeSelect-HStack w-[70px]
|
|
14
|
+
return <HStack className="PageSizeSelect-HStack w-[70px]">
|
|
15
15
|
<Select
|
|
16
16
|
data={[
|
|
17
17
|
// [ 1, '1', ],
|
|
@@ -24,6 +24,7 @@ export default function PageSizeSelect(props) {
|
|
|
24
24
|
value={pageSize}
|
|
25
25
|
onChangeValue={(value) => Repository.setPageSize(value)}
|
|
26
26
|
tooltip="Page Size"
|
|
27
|
+
tooltipClassName="w-[70px]"
|
|
27
28
|
/>
|
|
28
29
|
</HStack>;
|
|
29
30
|
}, [
|