@etsoo/materialui 1.4.22 → 1.4.23
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/README.md +2 -1
- package/babel.config.json +12 -12
- package/lib/AddresSelector.d.ts +8 -2
- package/lib/AddresSelector.js +1 -1
- package/lib/AuditDisplay.d.ts +1 -1
- package/lib/BackButton.d.ts +1 -1
- package/lib/BackButton.js +5 -5
- package/lib/CountryList.d.ts +5 -4
- package/lib/CountryList.js +3 -3
- package/lib/CustomFabProps.d.ts +3 -3
- package/lib/DataGridEx.js +3 -6
- package/lib/DataGridRenderers.d.ts +3 -3
- package/lib/DataGridRenderers.js +17 -17
- package/lib/DataTable.d.ts +1 -7
- package/lib/DataTable.js +3 -13
- package/lib/DialogButton.d.ts +2 -2
- package/lib/DialogButton.js +4 -4
- package/lib/EmailInput.d.ts +2 -2
- package/lib/EmailInput.js +2 -2
- package/lib/FlexBox.d.ts +3 -3
- package/lib/FlexBox.js +1 -1
- package/lib/GridDataFormat.d.ts +2 -2
- package/lib/GridDataFormat.js +7 -7
- package/lib/GridUtils.js +2 -1
- package/lib/ListItemRightIcon.d.ts +1 -1
- package/lib/ListItemRightIcon.js +2 -2
- package/lib/LoadingButton.d.ts +1 -1
- package/lib/LoadingButton.js +2 -2
- package/lib/MUGlobal.d.ts +6 -6
- package/lib/MUGlobal.js +20 -22
- package/lib/MobileListItemRenderer.d.ts +3 -3
- package/lib/MobileListItemRenderer.js +8 -10
- package/lib/PList.js +1 -1
- package/lib/ProgressCount.js +12 -12
- package/lib/RegionsRQ.d.ts +22 -0
- package/lib/RegionsRQ.js +1 -0
- package/lib/SearchField.d.ts +1 -1
- package/lib/SearchField.js +4 -4
- package/lib/SearchOptionGroup.d.ts +2 -2
- package/lib/SearchOptionGroup.js +3 -3
- package/lib/Switch.d.ts +3 -3
- package/lib/Switch.js +5 -5
- package/lib/TabBox.d.ts +5 -5
- package/lib/TabBox.js +5 -5
- package/lib/TableEx.js +4 -7
- package/lib/TooltipClick.d.ts +3 -3
- package/lib/TooltipClick.js +3 -3
- package/lib/TwoFieldInput.d.ts +2 -2
- package/lib/TwoFieldInput.js +13 -13
- package/lib/app/IServicePage.d.ts +1 -1
- package/lib/app/Labels.d.ts +1 -1
- package/lib/app/Labels.js +31 -31
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/texts/MoneyText.d.ts +1 -1
- package/lib/texts/MoneyText.js +3 -3
- package/lib/texts/NumberText.d.ts +1 -1
- package/lib/texts/NumberText.js +3 -3
- package/package.json +20 -20
- package/src/AddresSelector.tsx +31 -4
- package/src/AuditDisplay.tsx +1 -1
- package/src/BackButton.tsx +39 -39
- package/src/CountryList.tsx +49 -48
- package/src/CustomFabProps.ts +19 -19
- package/src/DataGridEx.tsx +2 -7
- package/src/DataGridRenderers.tsx +119 -119
- package/src/DataTable.tsx +2 -31
- package/src/DialogButton.tsx +149 -151
- package/src/EmailInput.tsx +9 -11
- package/src/FlexBox.tsx +6 -6
- package/src/GridDataFormat.tsx +58 -58
- package/src/GridUtils.ts +2 -1
- package/src/ListItemRightIcon.tsx +3 -3
- package/src/LoadingButton.tsx +53 -53
- package/src/MUGlobal.ts +196 -203
- package/src/MobileListItemRenderer.tsx +63 -65
- package/src/NotifierPromptProps.ts +16 -16
- package/src/PList.tsx +14 -14
- package/src/ProgressCount.tsx +144 -148
- package/src/RegionsRQ.ts +26 -0
- package/src/SearchField.tsx +59 -59
- package/src/SearchOptionGroup.tsx +20 -20
- package/src/Switch.tsx +72 -72
- package/src/TabBox.tsx +87 -89
- package/src/TableEx.tsx +5 -8
- package/src/TooltipClick.tsx +62 -64
- package/src/TwoFieldInput.tsx +104 -104
- package/src/app/IServicePage.ts +1 -1
- package/src/app/Labels.ts +67 -67
- package/src/index.ts +1 -0
- package/src/texts/MoneyText.tsx +29 -35
- package/src/texts/NumberText.tsx +23 -23
package/src/Switch.tsx
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { FormControlLabel, FormControlLabelProps } from
|
|
3
|
-
import MuiCheckbox from
|
|
4
|
-
import MuiSwitch from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FormControlLabel, FormControlLabelProps } from "@mui/material";
|
|
3
|
+
import MuiCheckbox from "@mui/material/Checkbox";
|
|
4
|
+
import MuiSwitch from "@mui/material/Switch";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Switch props
|
|
8
8
|
*/
|
|
9
|
-
export interface SwitchProps extends Omit<FormControlLabelProps,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
export interface SwitchProps extends Omit<FormControlLabelProps, "control"> {
|
|
10
|
+
/**
|
|
11
|
+
* Value, default 'on'
|
|
12
|
+
*/
|
|
13
|
+
value?: string;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Is the field read only?
|
|
17
|
+
*/
|
|
18
|
+
readOnly?: boolean;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Size
|
|
22
|
+
*/
|
|
23
|
+
size?: "small" | "medium";
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Display as Checkbox
|
|
27
|
+
*/
|
|
28
|
+
checkbox?: boolean;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -34,61 +34,61 @@ export interface SwitchProps extends Omit<FormControlLabelProps, 'control'> {
|
|
|
34
34
|
* @returns Component
|
|
35
35
|
*/
|
|
36
36
|
export function Switch(props: SwitchProps) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
// Destruct
|
|
38
|
+
const {
|
|
39
|
+
checked,
|
|
40
|
+
defaultChecked,
|
|
41
|
+
defaultValue,
|
|
42
|
+
onChange,
|
|
43
|
+
readOnly,
|
|
44
|
+
size,
|
|
45
|
+
checkbox = false,
|
|
46
|
+
value = "true",
|
|
47
|
+
...rest
|
|
48
|
+
} = props;
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
// Checked state
|
|
51
|
+
const [controlChecked, setControlChecked] = React.useState(
|
|
52
|
+
checked ?? defaultChecked ?? defaultValue == value
|
|
53
|
+
);
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
if (checked) setControlChecked(checked);
|
|
57
|
+
}, [checked]);
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
// Handle change
|
|
60
|
+
const handleChange = (
|
|
61
|
+
event: React.ChangeEvent<HTMLInputElement>,
|
|
62
|
+
checked: boolean
|
|
63
|
+
) => {
|
|
64
|
+
if (onChange) onChange(event, checked);
|
|
65
|
+
setControlChecked(checked);
|
|
66
|
+
};
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
68
|
+
// Control
|
|
69
|
+
const control = checkbox ? (
|
|
70
|
+
<MuiCheckbox
|
|
71
|
+
readOnly={readOnly}
|
|
72
|
+
checked={controlChecked}
|
|
73
|
+
onChange={handleChange}
|
|
74
|
+
size={size}
|
|
75
|
+
value={value}
|
|
76
|
+
/>
|
|
77
|
+
) : (
|
|
78
|
+
<MuiSwitch
|
|
79
|
+
readOnly={readOnly}
|
|
80
|
+
checked={controlChecked}
|
|
81
|
+
onChange={handleChange}
|
|
82
|
+
size={size}
|
|
83
|
+
value={value}
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
// Default state
|
|
88
|
+
React.useEffect(() => {
|
|
89
|
+
setControlChecked(controlChecked);
|
|
90
|
+
}, [controlChecked]);
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
// Layout
|
|
93
|
+
return <FormControlLabel control={control} {...rest} />;
|
|
94
94
|
}
|
package/src/TabBox.tsx
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { Utils } from
|
|
2
|
-
import { Box, BoxProps, Tab, TabProps, Tabs, TabsProps } from
|
|
3
|
-
import React from
|
|
4
|
-
import { Link } from
|
|
1
|
+
import { Utils } from "@etsoo/shared";
|
|
2
|
+
import { Box, BoxProps, Tab, TabProps, Tabs, TabsProps } from "@mui/material";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Link } from "react-router-dom";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Tab with box panel props
|
|
8
8
|
*/
|
|
9
|
-
export interface TabBoxPanel extends Omit<TabProps,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
export interface TabBoxPanel extends Omit<TabProps, "value" | "children"> {
|
|
10
|
+
/**
|
|
11
|
+
* Children
|
|
12
|
+
*/
|
|
13
|
+
children?: ((visible: boolean) => React.ReactNode) | React.ReactNode;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Panel box props
|
|
17
|
+
*/
|
|
18
|
+
panel?: Omit<BoxProps, "hidden">;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
/**
|
|
21
|
+
* To URL
|
|
22
|
+
*/
|
|
23
|
+
to?: string;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Tabs with box props
|
|
28
28
|
*/
|
|
29
29
|
export interface TabBoxPros extends BoxProps {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Container props
|
|
32
|
+
*/
|
|
33
|
+
container?: Omit<TabsProps, "value">;
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Default selected index
|
|
37
|
+
*/
|
|
38
|
+
defaultIndex?: number;
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Current index
|
|
42
|
+
*/
|
|
43
|
+
index?: number;
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Add a hidden input and its name
|
|
47
|
+
*/
|
|
48
|
+
inputName?: string;
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Root props
|
|
52
|
+
*/
|
|
53
|
+
root?: BoxProps;
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Tabs
|
|
57
|
+
*/
|
|
58
|
+
tabs: TabBoxPanel[];
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
@@ -64,55 +64,53 @@ export interface TabBoxPros extends BoxProps {
|
|
|
64
64
|
* @returns Component
|
|
65
65
|
*/
|
|
66
66
|
export function TabBox(props: TabBoxPros) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
// Destruct
|
|
68
|
+
const {
|
|
69
|
+
index,
|
|
70
|
+
inputName,
|
|
71
|
+
root,
|
|
72
|
+
container = {},
|
|
73
|
+
defaultIndex = 0,
|
|
74
|
+
tabs
|
|
75
|
+
} = props;
|
|
76
|
+
const { onChange, ...rest } = container;
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
// State
|
|
79
|
+
const [value, setValue] = React.useState(defaultIndex);
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
React.useEffect(() => {
|
|
82
|
+
if (index == null) return;
|
|
83
|
+
setValue(index);
|
|
84
|
+
}, [index]);
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
</React.Fragment>
|
|
117
|
-
);
|
|
86
|
+
// Layout
|
|
87
|
+
return (
|
|
88
|
+
<React.Fragment>
|
|
89
|
+
{inputName && <input type="hidden" name={inputName} value={value} />}
|
|
90
|
+
<Box {...root}>
|
|
91
|
+
<Tabs
|
|
92
|
+
value={value}
|
|
93
|
+
onChange={(event, newValue) => {
|
|
94
|
+
setValue(newValue);
|
|
95
|
+
if (onChange) onChange(event, newValue);
|
|
96
|
+
}}
|
|
97
|
+
{...rest}
|
|
98
|
+
>
|
|
99
|
+
{tabs.map(({ children, panel, ...tabRest }, index) => (
|
|
100
|
+
<Tab
|
|
101
|
+
key={index}
|
|
102
|
+
value={index}
|
|
103
|
+
LinkComponent={tabRest.to ? Link : undefined}
|
|
104
|
+
{...tabRest}
|
|
105
|
+
/>
|
|
106
|
+
))}
|
|
107
|
+
</Tabs>
|
|
108
|
+
</Box>
|
|
109
|
+
{tabs.map(({ children, panel }, index) => (
|
|
110
|
+
<Box key={index} hidden={value !== index} {...panel}>
|
|
111
|
+
{Utils.getResult(children, value === index)}
|
|
112
|
+
</Box>
|
|
113
|
+
))}
|
|
114
|
+
</React.Fragment>
|
|
115
|
+
);
|
|
118
116
|
}
|
package/src/TableEx.tsx
CHANGED
|
@@ -149,16 +149,11 @@ export function TableEx<
|
|
|
149
149
|
updateRows(rows);
|
|
150
150
|
};
|
|
151
151
|
|
|
152
|
-
var orderByAsc = defaultOrderBy
|
|
153
|
-
? columns.find((column) => column.field === defaultOrderBy)?.sortAsc
|
|
154
|
-
: undefined;
|
|
155
|
-
|
|
156
152
|
// States
|
|
157
153
|
const stateRefs = React.useRef<GridLoaderStates<T>>({
|
|
158
154
|
queryPaging: {
|
|
159
155
|
currentPage: 0,
|
|
160
156
|
orderBy: defaultOrderBy,
|
|
161
|
-
orderByAsc,
|
|
162
157
|
batchSize: rowsPerPageLocal
|
|
163
158
|
},
|
|
164
159
|
autoLoad,
|
|
@@ -311,7 +306,7 @@ export function TableEx<
|
|
|
311
306
|
|
|
312
307
|
// New sort
|
|
313
308
|
const handleSort = (field: string, asc?: boolean) => {
|
|
314
|
-
reset({ queryPaging: { orderBy: field
|
|
309
|
+
reset({ queryPaging: { orderBy: { [field]: asc ?? true } } });
|
|
315
310
|
};
|
|
316
311
|
|
|
317
312
|
// Set items for rerenderer
|
|
@@ -330,7 +325,7 @@ export function TableEx<
|
|
|
330
325
|
selectedItems
|
|
331
326
|
} = state;
|
|
332
327
|
|
|
333
|
-
const currentPage = queryPaging.currentPage;
|
|
328
|
+
const currentPage = queryPaging.currentPage ?? 0;
|
|
334
329
|
const batchSize = queryPaging.batchSize;
|
|
335
330
|
|
|
336
331
|
// Current page selected items
|
|
@@ -405,7 +400,9 @@ export function TableEx<
|
|
|
405
400
|
// Sortable
|
|
406
401
|
let sortLabel: React.ReactNode;
|
|
407
402
|
if (sortable && field != null) {
|
|
408
|
-
const active =
|
|
403
|
+
const active =
|
|
404
|
+
queryPaging.orderBy != null &&
|
|
405
|
+
queryPaging.orderBy[field] != null;
|
|
409
406
|
|
|
410
407
|
sortLabel = (
|
|
411
408
|
<TableSortLabel
|
package/src/TooltipClick.tsx
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { useDelayedExecutor } from
|
|
2
|
-
import { ClickAwayListener, Tooltip, TooltipProps } from
|
|
3
|
-
import React from
|
|
1
|
+
import { useDelayedExecutor } from "@etsoo/react";
|
|
2
|
+
import { ClickAwayListener, Tooltip, TooltipProps } from "@mui/material";
|
|
3
|
+
import React from "react";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Tooltip with click visibility props
|
|
7
7
|
*/
|
|
8
8
|
export interface TooltipClickProps
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
extends Omit<
|
|
10
|
+
TooltipProps,
|
|
11
|
+
"children" | "open" | "disableFocusListener" | "disableTouchListener"
|
|
12
|
+
> {
|
|
13
|
+
children: (
|
|
14
|
+
openTooltip: (newTitle?: string) => void
|
|
15
|
+
) => React.ReactElement<any, any>;
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
disableHoverListener?: boolean;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -23,62 +23,60 @@ export interface TooltipClickProps
|
|
|
23
23
|
* @returns Component
|
|
24
24
|
*/
|
|
25
25
|
export function TooltipClick(props: TooltipClickProps) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
// Destruct
|
|
27
|
+
// leaveDelay set to 5 seconds to hide the tooltip automatically
|
|
28
|
+
const {
|
|
29
|
+
children,
|
|
30
|
+
disableHoverListener = true,
|
|
31
|
+
leaveDelay = 5000,
|
|
32
|
+
onClose,
|
|
33
|
+
title,
|
|
34
|
+
...rest
|
|
35
|
+
} = props;
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
// State
|
|
38
|
+
const [localTitle, setTitle] = React.useState(title);
|
|
39
|
+
const [open, setOpen] = React.useState(false);
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const delayed =
|
|
42
|
+
leaveDelay > 0
|
|
43
|
+
? useDelayedExecutor(() => setOpen(false), leaveDelay)
|
|
44
|
+
: undefined;
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
// Callback for open the tooltip
|
|
47
|
+
const openTooltip = (newTitle?: string) => {
|
|
48
|
+
setOpen(true);
|
|
49
|
+
if (newTitle) setTitle(newTitle);
|
|
50
|
+
delayed?.call();
|
|
51
|
+
};
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
React.useEffect(() => {
|
|
54
|
+
return () => {
|
|
55
|
+
delayed?.clear();
|
|
56
|
+
};
|
|
57
|
+
}, []);
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
</ClickAwayListener>
|
|
83
|
-
);
|
|
59
|
+
// Layout
|
|
60
|
+
return (
|
|
61
|
+
<ClickAwayListener onClickAway={() => setOpen(false)}>
|
|
62
|
+
<Tooltip
|
|
63
|
+
PopperProps={{
|
|
64
|
+
disablePortal: true
|
|
65
|
+
}}
|
|
66
|
+
onClose={(event) => {
|
|
67
|
+
setOpen(false);
|
|
68
|
+
if (onClose) onClose(event);
|
|
69
|
+
}}
|
|
70
|
+
title={localTitle}
|
|
71
|
+
open={open}
|
|
72
|
+
disableFocusListener
|
|
73
|
+
disableTouchListener
|
|
74
|
+
disableHoverListener={disableHoverListener}
|
|
75
|
+
onMouseOver={disableHoverListener ? undefined : () => setOpen(true)}
|
|
76
|
+
{...rest}
|
|
77
|
+
>
|
|
78
|
+
{children(openTooltip)}
|
|
79
|
+
</Tooltip>
|
|
80
|
+
</ClickAwayListener>
|
|
81
|
+
);
|
|
84
82
|
}
|