@etsoo/materialui 1.3.58 → 1.3.60
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/__tests__/ResponsePage.tsx +11 -3
- package/lib/AddresSelector.d.ts +1 -1
- package/lib/AddresSelector.js +9 -18
- package/lib/AuditDisplay.d.ts +1 -1
- package/lib/AuditDisplay.js +12 -15
- package/lib/BackButton.d.ts +1 -2
- package/lib/BackButton.js +3 -4
- package/lib/BridgeCloseButton.d.ts +1 -2
- package/lib/BridgeCloseButton.js +3 -4
- package/lib/ButtonLink.d.ts +1 -2
- package/lib/ButtonLink.js +2 -2
- package/lib/ComboBox.d.ts +2 -3
- package/lib/ComboBox.js +12 -16
- package/lib/ComboBoxMultiple.d.ts +2 -3
- package/lib/ComboBoxMultiple.js +15 -19
- package/lib/ComboBoxPro.d.ts +1 -2
- package/lib/ComboBoxPro.js +3 -2
- package/lib/CountdownButton.js +4 -3
- package/lib/CountryList.d.ts +1 -2
- package/lib/CountryList.js +2 -1
- package/lib/CultureDataTable.d.ts +1 -2
- package/lib/CultureDataTable.js +2 -1
- package/lib/DataGridEx.d.ts +1 -1
- package/lib/DataGridEx.js +55 -58
- package/lib/DataGridRenderers.js +5 -5
- package/lib/DataSteps.d.ts +1 -2
- package/lib/DataSteps.js +20 -23
- package/lib/DataTable.d.ts +1 -1
- package/lib/DataTable.js +2 -1
- package/lib/DialogButton.d.ts +1 -1
- package/lib/DialogButton.js +6 -13
- package/lib/DnDList.d.ts +1 -1
- package/lib/DnDList.js +8 -8
- package/lib/DraggablePaperComponent.d.ts +1 -2
- package/lib/DraggablePaperComponent.js +2 -2
- package/lib/EmailInput.d.ts +1 -2
- package/lib/EmailInput.js +2 -2
- package/lib/FabBox.d.ts +1 -2
- package/lib/FabBox.js +4 -3
- package/lib/FieldSetEx.d.ts +1 -1
- package/lib/FieldSetEx.js +13 -16
- package/lib/FileUploadButton.d.ts +1 -1
- package/lib/FileUploadButton.js +27 -29
- package/lib/FlexBox.d.ts +2 -3
- package/lib/FlexBox.js +3 -3
- package/lib/GridDataFormat.js +2 -2
- package/lib/HiSelector.d.ts +1 -1
- package/lib/HiSelector.js +2 -12
- package/lib/HiSelectorTL.d.ts +1 -1
- package/lib/HiSelectorTL.js +2 -12
- package/lib/IconButtonLink.d.ts +1 -2
- package/lib/IconButtonLink.js +2 -2
- package/lib/InputField.js +2 -1
- package/lib/InputTipField.d.ts +1 -1
- package/lib/InputTipField.js +12 -14
- package/lib/IntInputField.js +28 -33
- package/lib/ItemList.d.ts +1 -1
- package/lib/ItemList.js +6 -11
- package/lib/LineChart.d.ts +1 -2
- package/lib/LineChart.js +2 -1
- package/lib/ListChooser.d.ts +1 -1
- package/lib/ListChooser.js +4 -7
- package/lib/ListMoreDisplay.d.ts +1 -1
- package/lib/ListMoreDisplay.js +5 -10
- package/lib/LoadingButton.d.ts +1 -2
- package/lib/LoadingButton.js +3 -2
- package/lib/MaskInput.d.ts +1 -2
- package/lib/MaskInput.js +2 -1
- package/lib/MenuButton.d.ts +1 -1
- package/lib/MenuButton.js +30 -31
- package/lib/MobileListItemRenderer.d.ts +1 -1
- package/lib/MobileListItemRenderer.js +15 -18
- package/lib/MoneyInputField.js +2 -1
- package/lib/MoreFab.d.ts +1 -1
- package/lib/MoreFab.js +21 -24
- package/lib/NotifierMU.d.ts +2 -2
- package/lib/NotifierMU.js +27 -67
- package/lib/NumberInputField.d.ts +1 -1
- package/lib/NumberInputField.js +4 -4
- package/lib/OptionBool.d.ts +1 -2
- package/lib/OptionBool.js +2 -2
- package/lib/OptionGroup.d.ts +1 -1
- package/lib/OptionGroup.js +17 -20
- package/lib/OptionGroupFlag.d.ts +1 -1
- package/lib/OptionGroupFlag.js +15 -18
- package/lib/PList.d.ts +1 -2
- package/lib/PList.js +5 -4
- package/lib/PercentCircularProgress.d.ts +1 -2
- package/lib/PercentCircularProgress.js +11 -14
- package/lib/PercentLinearProgress.d.ts +1 -2
- package/lib/PercentLinearProgress.js +2 -6
- package/lib/ProgressCount.d.ts +1 -2
- package/lib/ProgressCount.js +12 -18
- package/lib/PullToRefreshUI.d.ts +1 -2
- package/lib/PullToRefreshUI.js +2 -1
- package/lib/QuickList.d.ts +1 -1
- package/lib/QuickList.js +12 -14
- package/lib/ResponsibleContainer.d.ts +1 -1
- package/lib/ResponsibleContainer.js +11 -16
- package/lib/ScrollTopFab.d.ts +1 -2
- package/lib/ScrollTopFab.js +2 -3
- package/lib/ScrollerListEx.d.ts +1 -1
- package/lib/ScrollerListEx.js +3 -2
- package/lib/SearchBar.d.ts +1 -1
- package/lib/SearchBar.js +27 -35
- package/lib/SearchField.d.ts +1 -2
- package/lib/SearchField.js +2 -1
- package/lib/SearchOptionGroup.d.ts +1 -2
- package/lib/SearchOptionGroup.js +2 -2
- package/lib/SelectBool.d.ts +1 -2
- package/lib/SelectBool.js +2 -2
- package/lib/SelectEx.d.ts +1 -1
- package/lib/SelectEx.js +47 -55
- package/lib/ShowDataComparison.js +2 -11
- package/lib/Switch.d.ts +1 -2
- package/lib/Switch.js +3 -2
- package/lib/SwitchAnt.d.ts +1 -2
- package/lib/SwitchAnt.js +12 -14
- package/lib/SwitchField.d.ts +1 -1
- package/lib/SwitchField.js +13 -16
- package/lib/TabBox.d.ts +1 -1
- package/lib/TabBox.js +6 -9
- package/lib/TableEx.d.ts +1 -1
- package/lib/TableEx.js +79 -89
- package/lib/TagList.d.ts +1 -2
- package/lib/TagList.js +4 -5
- package/lib/TagListPro.d.ts +1 -2
- package/lib/TagListPro.js +4 -6
- package/lib/TextFieldEx.js +3 -6
- package/lib/Tiplist.d.ts +2 -3
- package/lib/Tiplist.js +39 -40
- package/lib/TiplistPro.d.ts +2 -2
- package/lib/TiplistPro.js +48 -49
- package/lib/TooltipClick.d.ts +1 -1
- package/lib/TooltipClick.js +3 -3
- package/lib/TwoFieldInput.d.ts +1 -2
- package/lib/TwoFieldInput.js +4 -5
- package/lib/UserAvatar.d.ts +1 -2
- package/lib/UserAvatar.js +3 -3
- package/lib/UserAvatarEditor.d.ts +1 -2
- package/lib/UserAvatarEditor.js +2 -19
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -3
- package/lib/messages/OperationMessageContainer.d.ts +1 -2
- package/lib/messages/OperationMessageContainer.js +2 -1
- package/lib/pages/CommonPage.d.ts +67 -2
- package/lib/pages/CommonPage.js +15 -24
- package/lib/pages/DataGridPage.d.ts +2 -3
- package/lib/pages/DataGridPage.js +5 -8
- package/lib/pages/DataGridPageProps.d.ts +3 -3
- package/lib/pages/EditPage.d.ts +3 -3
- package/lib/pages/EditPage.js +6 -15
- package/lib/pages/FixedListPage.d.ts +2 -3
- package/lib/pages/FixedListPage.js +5 -9
- package/lib/pages/LeftDrawer.d.ts +1 -1
- package/lib/pages/LeftDrawer.js +3 -10
- package/lib/pages/ListPage.d.ts +7 -3
- package/lib/pages/ListPage.js +4 -7
- package/lib/pages/ResponsivePage.d.ts +50 -2
- package/lib/pages/ResponsivePage.js +25 -26
- package/lib/pages/SearchPageProps.d.ts +3 -3
- package/lib/pages/TablePage.d.ts +7 -3
- package/lib/pages/TablePage.js +5 -8
- package/lib/pages/UserMenu.d.ts +1 -1
- package/lib/pages/UserMenu.js +33 -35
- package/lib/pages/ViewPage.d.ts +4 -4
- package/lib/pages/ViewPage.js +29 -37
- package/lib/texts/DateText.d.ts +1 -2
- package/lib/texts/DateText.js +2 -2
- package/lib/texts/MoneyText.d.ts +1 -2
- package/lib/texts/MoneyText.js +4 -4
- package/lib/texts/NumberText.d.ts +1 -2
- package/lib/texts/NumberText.js +2 -2
- package/package.json +3 -3
- package/src/ComboBox.tsx +1 -1
- package/src/ComboBoxMultiple.tsx +1 -1
- package/src/Tiplist.tsx +1 -1
- package/src/index.ts +0 -3
- package/src/pages/CommonPage.tsx +80 -2
- package/src/pages/DataGridPage.tsx +1 -1
- package/src/pages/DataGridPageProps.ts +3 -3
- package/src/pages/EditPage.tsx +2 -3
- package/src/pages/FixedListPage.tsx +1 -1
- package/src/pages/ListPage.tsx +10 -2
- package/src/pages/ResponsivePage.tsx +70 -2
- package/src/pages/SearchPageProps.ts +3 -3
- package/src/pages/TablePage.tsx +16 -2
- package/src/pages/ViewPage.tsx +3 -4
- package/tsconfig.json +2 -2
- package/lib/pages/CommonPageProps.d.ts +0 -67
- package/lib/pages/CommonPageProps.js +0 -1
- package/lib/pages/ListPageProps.d.ts +0 -7
- package/lib/pages/ListPageProps.js +0 -1
- package/lib/pages/ResponsivePageProps.d.ts +0 -51
- package/lib/pages/ResponsivePageProps.js +0 -1
- package/lib/pages/TablePageProps.d.ts +0 -7
- package/lib/pages/TablePageProps.js +0 -1
- package/src/pages/CommonPageProps.ts +0 -80
- package/src/pages/ListPageProps.ts +0 -11
- package/src/pages/ResponsivePageProps.ts +0 -70
- package/src/pages/TablePageProps.ts +0 -12
package/lib/FlexBox.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Stack } from '@mui/material';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Horizonal box
|
|
5
5
|
* @param props Props
|
|
6
6
|
* @returns Component
|
|
7
7
|
*/
|
|
8
8
|
export function HBox(props) {
|
|
9
|
-
return
|
|
9
|
+
return _jsx(Stack, { direction: "row", width: "100%", ...props });
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Vertial box
|
|
@@ -14,5 +14,5 @@ export function HBox(props) {
|
|
|
14
14
|
* @returns Component
|
|
15
15
|
*/
|
|
16
16
|
export function VBox(props) {
|
|
17
|
-
return
|
|
17
|
+
return _jsx(Stack, { direction: "column", ...props });
|
|
18
18
|
}
|
package/lib/GridDataFormat.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { GridDataType } from '@etsoo/react';
|
|
2
3
|
import { DateUtils, NumberUtils } from '@etsoo/shared';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
import { DateText } from './texts/DateText';
|
|
5
5
|
/**
|
|
6
6
|
* Grid data format
|
|
@@ -26,7 +26,7 @@ export function GridDataFormat(data, type, renderProps) {
|
|
|
26
26
|
const option = type === GridDataType.DateTime ? 'ds' : 'd';
|
|
27
27
|
const nearDays = renderProps?.nearDays;
|
|
28
28
|
if (nearDays != null) {
|
|
29
|
-
return (
|
|
29
|
+
return (_jsx(DateText, { value: dateValue, locale: renderProps?.culture, timeZone: renderProps?.timeZone, options: option, nearDays: nearDays }));
|
|
30
30
|
}
|
|
31
31
|
return DateUtils.format(dateValue, renderProps?.culture, option, renderProps?.timeZone);
|
|
32
32
|
}
|
package/lib/HiSelector.d.ts
CHANGED
|
@@ -75,4 +75,4 @@ export type HiSelectorProps<T extends object, D extends DataTypes.Keys<T> = IdDe
|
|
|
75
75
|
* @param props Prop
|
|
76
76
|
* @returns Component
|
|
77
77
|
*/
|
|
78
|
-
export declare function HiSelector<T extends object, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>>(props: HiSelectorProps<T, D, L>):
|
|
78
|
+
export declare function HiSelector<T extends object, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>>(props: HiSelectorProps<T, D, L>): import("react/jsx-runtime").JSX.Element;
|
package/lib/HiSelector.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { FormLabel, Grid } from "@mui/material";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { SelectEx } from "./SelectEx";
|
|
@@ -38,16 +39,5 @@ export function HiSelector(props) {
|
|
|
38
39
|
React.useEffect(() => {
|
|
39
40
|
updateValue(currentValue);
|
|
40
41
|
}, [currentValue]);
|
|
41
|
-
return (
|
|
42
|
-
label && (React.createElement(Grid, { item: true, xs: 12 },
|
|
43
|
-
React.createElement(FormLabel, { required: required, sx: { fontSize: (theme) => theme.typography.caption } }, label))),
|
|
44
|
-
React.createElement("input", { type: "hidden", name: name, value: `${currentValue ?? ""}` }),
|
|
45
|
-
React.createElement(Grid, { item: true, ...breakPoints },
|
|
46
|
-
React.createElement(SelectEx, { idField: idField, label: labels[0], labelField: labelField, name: "tab1", search: search, fullWidth: true, loadData: () => loadData(), value: values[0], onChange: (event) => doChange(event, 0), onItemChange: doItemChange, required: required, error: error, helperText: helperText, variant: variant })),
|
|
47
|
-
localValues[0] != null && (React.createElement(Grid, { item: true, ...breakPoints },
|
|
48
|
-
React.createElement(SelectEx, { key: `${localValues[0]}`, idField: idField, label: labels[1], labelField: labelField, name: "tab2", search: search, fullWidth: true, loadData: () => loadData(localValues[0]), value: values[1], onChange: (event) => doChange(event, 1), onItemChange: doItemChange, variant: variant }))),
|
|
49
|
-
localValues[1] != null && (React.createElement(Grid, { item: true, ...breakPoints },
|
|
50
|
-
React.createElement(SelectEx, { key: `${localValues[1]}`, idField: idField, label: labels[2], labelField: labelField, name: "tab3", search: search, fullWidth: true, loadData: () => loadData(localValues[1]), value: values[2], onChange: (event) => doChange(event, 2), onItemChange: doItemChange, variant: variant }))),
|
|
51
|
-
localValues[2] != null && (React.createElement(Grid, { item: true, ...breakPoints },
|
|
52
|
-
React.createElement(SelectEx, { key: `${localValues[2]}`, idField: idField, label: labels[3], labelField: labelField, name: "tab4", search: search, fullWidth: true, loadData: () => loadData(localValues[2]), value: values[3], onChange: (event) => doChange(event, 3), onItemChange: doItemChange, variant: variant })))));
|
|
42
|
+
return (_jsxs(React.Fragment, { children: [label && (_jsx(Grid, { item: true, xs: 12, children: _jsx(FormLabel, { required: required, sx: { fontSize: (theme) => theme.typography.caption }, children: label }) })), _jsx("input", { type: "hidden", name: name, value: `${currentValue ?? ""}` }), _jsx(Grid, { item: true, ...breakPoints, children: _jsx(SelectEx, { idField: idField, label: labels[0], labelField: labelField, name: "tab1", search: search, fullWidth: true, loadData: () => loadData(), value: values[0], onChange: (event) => doChange(event, 0), onItemChange: doItemChange, required: required, error: error, helperText: helperText, variant: variant }) }), localValues[0] != null && (_jsx(Grid, { item: true, ...breakPoints, children: _jsx(SelectEx, { idField: idField, label: labels[1], labelField: labelField, name: "tab2", search: search, fullWidth: true, loadData: () => loadData(localValues[0]), value: values[1], onChange: (event) => doChange(event, 1), onItemChange: doItemChange, variant: variant }, `${localValues[0]}`) })), localValues[1] != null && (_jsx(Grid, { item: true, ...breakPoints, children: _jsx(SelectEx, { idField: idField, label: labels[2], labelField: labelField, name: "tab3", search: search, fullWidth: true, loadData: () => loadData(localValues[1]), value: values[2], onChange: (event) => doChange(event, 2), onItemChange: doItemChange, variant: variant }, `${localValues[1]}`) })), localValues[2] != null && (_jsx(Grid, { item: true, ...breakPoints, children: _jsx(SelectEx, { idField: idField, label: labels[3], labelField: labelField, name: "tab4", search: search, fullWidth: true, loadData: () => loadData(localValues[2]), value: values[3], onChange: (event) => doChange(event, 3), onItemChange: doItemChange, variant: variant }, `${localValues[2]}`) }))] }));
|
|
53
43
|
}
|
package/lib/HiSelectorTL.d.ts
CHANGED
|
@@ -63,4 +63,4 @@ export type HiSelectorTLProps<T extends object, D extends DataTypes.Keys<T> = Id
|
|
|
63
63
|
* @param props Prop
|
|
64
64
|
* @returns Component
|
|
65
65
|
*/
|
|
66
|
-
export declare function HiSelectorTL<T extends object, D extends DataTypes.Keys<T> = IdDefaultType<T>>(props: HiSelectorTLProps<T, D>):
|
|
66
|
+
export declare function HiSelectorTL<T extends object, D extends DataTypes.Keys<T> = IdDefaultType<T>>(props: HiSelectorTLProps<T, D>): import("react/jsx-runtime").JSX.Element;
|
package/lib/HiSelectorTL.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { FormLabel, Grid } from "@mui/material";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { Tiplist } from "./Tiplist";
|
|
@@ -32,16 +33,5 @@ export function HiSelectorTL(props) {
|
|
|
32
33
|
React.useEffect(() => {
|
|
33
34
|
updateValue(currentValue);
|
|
34
35
|
}, [currentValue]);
|
|
35
|
-
return (
|
|
36
|
-
label && (React.createElement(Grid, { item: true, xs: 12 },
|
|
37
|
-
React.createElement(FormLabel, { required: required, sx: { fontSize: (theme) => theme.typography.caption } }, label))),
|
|
38
|
-
React.createElement("input", { type: "hidden", name: name, value: `${currentValue ?? ""}` }),
|
|
39
|
-
React.createElement(Grid, { item: true, ...breakPoints },
|
|
40
|
-
React.createElement(Tiplist, { idField: idField, label: labels[0], name: "tab1", search: search, fullWidth: true, idValue: values[0], loadData: (keyword, id, items) => loadData(keyword, id, items), inputRequired: required, inputError: error, inputHelperText: helperText, onChange: (event, value, reason) => doChange(0, event, value, reason) })),
|
|
41
|
-
localValues[0] != null && (React.createElement(Grid, { item: true, ...breakPoints },
|
|
42
|
-
React.createElement(Tiplist, { key: `${localValues[0]}`, label: labels[1], idField: idField, name: "tab2", search: search, fullWidth: true, loadData: (keyword, id, items) => loadData(keyword, id, items, localValues[0]), idValue: values[1], onChange: (event, value, reason) => doChange(1, event, value, reason) }))),
|
|
43
|
-
localValues[1] != null && (React.createElement(Grid, { item: true, ...breakPoints },
|
|
44
|
-
React.createElement(Tiplist, { key: `${localValues[1]}`, label: labels[2], idField: idField, name: "tab3", search: search, fullWidth: true, loadData: (keyword, id, items) => loadData(keyword, id, items, localValues[1]), idValue: values[2], onChange: (event, value, reason) => doChange(2, event, value, reason) }))),
|
|
45
|
-
localValues[2] != null && (React.createElement(Grid, { item: true, ...breakPoints },
|
|
46
|
-
React.createElement(Tiplist, { key: `${localValues[2]}`, label: labels[3], idField: idField, name: "tab4", search: search, fullWidth: true, loadData: (keyword, id, items) => loadData(keyword, id, items, localValues[2]), idValue: values[3], onChange: (event, value, reason) => doChange(3, event, value, reason) })))));
|
|
36
|
+
return (_jsxs(React.Fragment, { children: [label && (_jsx(Grid, { item: true, xs: 12, children: _jsx(FormLabel, { required: required, sx: { fontSize: (theme) => theme.typography.caption }, children: label }) })), _jsx("input", { type: "hidden", name: name, value: `${currentValue ?? ""}` }), _jsx(Grid, { item: true, ...breakPoints, children: _jsx(Tiplist, { idField: idField, label: labels[0], name: "tab1", search: search, fullWidth: true, idValue: values[0], loadData: (keyword, id, items) => loadData(keyword, id, items), inputRequired: required, inputError: error, inputHelperText: helperText, onChange: (event, value, reason) => doChange(0, event, value, reason) }) }), localValues[0] != null && (_jsx(Grid, { item: true, ...breakPoints, children: _jsx(Tiplist, { label: labels[1], idField: idField, name: "tab2", search: search, fullWidth: true, loadData: (keyword, id, items) => loadData(keyword, id, items, localValues[0]), idValue: values[1], onChange: (event, value, reason) => doChange(1, event, value, reason) }, `${localValues[0]}`) })), localValues[1] != null && (_jsx(Grid, { item: true, ...breakPoints, children: _jsx(Tiplist, { label: labels[2], idField: idField, name: "tab3", search: search, fullWidth: true, loadData: (keyword, id, items) => loadData(keyword, id, items, localValues[1]), idValue: values[2], onChange: (event, value, reason) => doChange(2, event, value, reason) }, `${localValues[1]}`) })), localValues[2] != null && (_jsx(Grid, { item: true, ...breakPoints, children: _jsx(Tiplist, { label: labels[3], idField: idField, name: "tab4", search: search, fullWidth: true, loadData: (keyword, id, items) => loadData(keyword, id, items, localValues[2]), idValue: values[3], onChange: (event, value, reason) => doChange(3, event, value, reason) }, `${localValues[2]}`) }))] }));
|
|
47
37
|
}
|
package/lib/IconButtonLink.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IconButtonProps } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
2
|
/**
|
|
4
3
|
* IconButtonLink props
|
|
5
4
|
*/
|
|
@@ -18,4 +17,4 @@ export type IconButtonLinkProps = Omit<IconButtonProps, "href" | "onClick"> & {
|
|
|
18
17
|
* @param props Props
|
|
19
18
|
* @returns Component
|
|
20
19
|
*/
|
|
21
|
-
export declare function IconButtonLink(props: IconButtonLinkProps):
|
|
20
|
+
export declare function IconButtonLink(props: IconButtonLinkProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/IconButtonLink.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { IconButton } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
3
|
import { useNavigate } from "react-router-dom";
|
|
4
4
|
/**
|
|
5
5
|
* IconButtonLink
|
|
@@ -12,5 +12,5 @@ export function IconButtonLink(props) {
|
|
|
12
12
|
// Navigate
|
|
13
13
|
const navigate = useNavigate();
|
|
14
14
|
// Layout
|
|
15
|
-
return
|
|
15
|
+
return _jsx(IconButton, { ...rest, onClick: () => navigate(href, { state }) });
|
|
16
16
|
}
|
package/lib/InputField.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { useDelayedExecutor } from "@etsoo/react";
|
|
2
3
|
import { TextField } from "@mui/material";
|
|
3
4
|
import React from "react";
|
|
@@ -37,5 +38,5 @@ export const InputField = React.forwardRef((props, ref) => {
|
|
|
37
38
|
};
|
|
38
39
|
}, []);
|
|
39
40
|
// Layout
|
|
40
|
-
return (
|
|
41
|
+
return (_jsx(TextField, { ref: ref, InputLabelProps: InputLabelProps, InputProps: InputProps, onChange: onChangeEx, size: size, variant: variant, ...rest }));
|
|
41
42
|
});
|
package/lib/InputTipField.d.ts
CHANGED
|
@@ -34,5 +34,5 @@ export type InputTipFieldProps<T extends ItemType = ItemType> = InputFieldProps
|
|
|
34
34
|
* @param props Props
|
|
35
35
|
* @returns Component
|
|
36
36
|
*/
|
|
37
|
-
export declare function InputTipField<T extends ItemType = ItemType>(props: InputTipFieldProps<T>):
|
|
37
|
+
export declare function InputTipField<T extends ItemType = ItemType>(props: InputTipFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
38
38
|
export {};
|
package/lib/InputTipField.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { InputAdornment, List, ListItem, Popover } from "@mui/material";
|
|
2
3
|
import Typography from "@mui/material/Typography";
|
|
3
4
|
import React from "react";
|
|
@@ -18,11 +19,10 @@ export function InputTipField(props) {
|
|
|
18
19
|
title: globalApp?.get("clickForDetails"),
|
|
19
20
|
sx: { color: (theme) => theme.palette.error.main, cursor: "pointer" }
|
|
20
21
|
}, InputProps = {
|
|
21
|
-
endAdornment: title ? (
|
|
22
|
-
React.createElement(Typography, { onClick: (event) => {
|
|
22
|
+
endAdornment: title ? (_jsx(InputAdornment, { position: "end", children: _jsx(Typography, { onClick: (event) => {
|
|
23
23
|
setAnchorEl(event.currentTarget);
|
|
24
|
-
}, ...labelProps
|
|
25
|
-
}, changeDelay = 480, onChangeDelay, loadData, itemLabel = (item) => item.label, renderItem = (item) =>
|
|
24
|
+
}, ...labelProps, children: title }) })) : undefined
|
|
25
|
+
}, changeDelay = 480, onChangeDelay, loadData, itemLabel = (item) => item.label, renderItem = (item) => _jsx(ListItem, { children: itemLabel(item) }, item.id), ...rest } = props;
|
|
26
26
|
const load = (value) => {
|
|
27
27
|
if (value.length < 2) {
|
|
28
28
|
setTitle(undefined);
|
|
@@ -33,14 +33,12 @@ export function InputTipField(props) {
|
|
|
33
33
|
setTitle(title);
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
return (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
onChangeDelay(event);
|
|
45
|
-
}, InputProps: InputProps, ...rest })));
|
|
36
|
+
return (_jsxs(React.Fragment, { children: [_jsx(Popover, { open: anchorEl != null, anchorEl: anchorEl, onClose: () => setAnchorEl(undefined), anchorOrigin: {
|
|
37
|
+
vertical: "bottom",
|
|
38
|
+
horizontal: "left"
|
|
39
|
+
}, children: data && _jsx(List, { children: data.map((item) => renderItem(item)) }) }), _jsx(InputField, { changeDelay: changeDelay, onChangeDelay: (event) => {
|
|
40
|
+
load(event.target.value);
|
|
41
|
+
if (onChangeDelay)
|
|
42
|
+
onChangeDelay(event);
|
|
43
|
+
}, InputProps: InputProps, ...rest })] }));
|
|
46
44
|
}
|
package/lib/IntInputField.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Box, IconButton, InputAdornment } from "@mui/material";
|
|
2
3
|
import AddIcon from "@mui/icons-material/Add";
|
|
3
4
|
import RemoveIcon from "@mui/icons-material/Remove";
|
|
@@ -34,16 +35,15 @@ export const IntInputField = React.forwardRef((props, ref) => {
|
|
|
34
35
|
setValue(value, undefined, true);
|
|
35
36
|
}, [value]);
|
|
36
37
|
// Layout
|
|
37
|
-
const layout = (
|
|
38
|
+
const layout = (_jsx(InputField, { ref: ref, type: "number", value: localValue == null ? (required ? min : "") : localValue, inputProps: {
|
|
38
39
|
min,
|
|
39
40
|
step,
|
|
40
41
|
max,
|
|
41
42
|
style: inputStyle,
|
|
42
43
|
inputMode: "numeric"
|
|
43
44
|
}, InputProps: {
|
|
44
|
-
startAdornment: symbol ? (
|
|
45
|
-
|
|
46
|
-
endAdornment: endSymbol ? (React.createElement(InputAdornment, { position: "end" }, endSymbol)) : undefined
|
|
45
|
+
startAdornment: symbol ? (_jsx(React.Fragment, { children: _jsx(InputAdornment, { position: "start", children: symbol }) })) : undefined,
|
|
46
|
+
endAdornment: endSymbol ? (_jsx(InputAdornment, { position: "end", children: endSymbol })) : undefined
|
|
47
47
|
}, sx: buttons
|
|
48
48
|
? {
|
|
49
49
|
"& input[type=number]::-webkit-inner-spin-button": {
|
|
@@ -76,40 +76,35 @@ export const IntInputField = React.forwardRef((props, ref) => {
|
|
|
76
76
|
onChangeDelay(event);
|
|
77
77
|
}, onFocus: onFocus, required: required, ...rest }));
|
|
78
78
|
if (buttons)
|
|
79
|
-
return (
|
|
79
|
+
return (_jsxs(Box, { sx: {
|
|
80
80
|
display: "flex",
|
|
81
81
|
alignItems: "center",
|
|
82
82
|
width: "100%",
|
|
83
83
|
gap: 0.5,
|
|
84
84
|
...boxProps
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return;
|
|
109
|
-
else
|
|
110
|
-
setValue(value + step, "ADD");
|
|
111
|
-
} },
|
|
112
|
-
React.createElement(AddIcon, { color: localValue == null ? undefined : "primary" }))));
|
|
85
|
+
}, children: [_jsx(IconButton, { size: "small", onClick: () => {
|
|
86
|
+
if (localValue == null)
|
|
87
|
+
return;
|
|
88
|
+
const value = NumberUtils.parse(localValue);
|
|
89
|
+
if (value == null)
|
|
90
|
+
return;
|
|
91
|
+
if (value <= min)
|
|
92
|
+
setValue(undefined, "SUB");
|
|
93
|
+
else
|
|
94
|
+
setValue(value - step, "SUB");
|
|
95
|
+
}, children: _jsx(RemoveIcon, {}) }), layout, _jsx(IconButton, { size: "small", onClick: () => {
|
|
96
|
+
if (localValue == null) {
|
|
97
|
+
setValue(min, "ADD");
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const value = NumberUtils.parse(localValue);
|
|
101
|
+
if (value == null)
|
|
102
|
+
return;
|
|
103
|
+
if (value >= max)
|
|
104
|
+
return;
|
|
105
|
+
else
|
|
106
|
+
setValue(value + step, "ADD");
|
|
107
|
+
}, children: _jsx(AddIcon, { color: localValue == null ? undefined : "primary" }) })] }));
|
|
113
108
|
else
|
|
114
109
|
return layout;
|
|
115
110
|
});
|
package/lib/ItemList.d.ts
CHANGED
|
@@ -65,4 +65,4 @@ export interface ItemListProps<T extends object, D extends DataTypes.Keys<T>, L
|
|
|
65
65
|
* Item list component
|
|
66
66
|
* @param props Properties
|
|
67
67
|
*/
|
|
68
|
-
export declare function ItemList<T extends object = ListType, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>>(props: ItemListProps<T, D, L>):
|
|
68
|
+
export declare function ItemList<T extends object = ListType, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>>(props: ItemListProps<T, D, L>): import("react/jsx-runtime").JSX.Element;
|
package/lib/ItemList.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { Dialog, DialogTitle, List, ListItemText, DialogContent, Button, ListItemButton } from "@mui/material";
|
|
3
4
|
import { DataTypes } from "@etsoo/shared";
|
|
@@ -56,15 +57,9 @@ export function ItemList(props) {
|
|
|
56
57
|
onClose(item, true);
|
|
57
58
|
}
|
|
58
59
|
};
|
|
59
|
-
return (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
React.createElement(List, null, items.map((item) => {
|
|
65
|
-
const id = item[idField];
|
|
66
|
-
return (React.createElement(ListItemButton, { key: id, disabled: id === (currentItem ? currentItem[idField] : undefined) &&
|
|
67
|
-
!keepClick, onClick: () => closeItemHandler(item) },
|
|
68
|
-
React.createElement(ListItemText, null, getLabel(item))));
|
|
69
|
-
}))))));
|
|
60
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { className: className, variant: variant, startIcon: icon, color: color, size: size, onClick: clickHandler, children: buttonLabel ?? (currentItem ? getLabel(currentItem) : undefined) }), _jsxs(Dialog, { "aria-labelledby": "dialog-title", open: open, onClose: closeHandler, children: [title && _jsx(DialogTitle, { id: "dialog-title", children: title }), _jsx(DialogContent, { sx: { minWidth }, children: _jsx(List, { children: items.map((item) => {
|
|
61
|
+
const id = item[idField];
|
|
62
|
+
return (_jsx(ListItemButton, { disabled: id === (currentItem ? currentItem[idField] : undefined) &&
|
|
63
|
+
!keepClick, onClick: () => closeItemHandler(item), children: _jsx(ListItemText, { children: getLabel(item) }) }, id));
|
|
64
|
+
}) }) })] })] }));
|
|
70
65
|
}
|
package/lib/LineChart.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import type { ChartData, LineControllerChartOptions } from "chart.js";
|
|
3
2
|
/**
|
|
4
3
|
* Line chart
|
|
@@ -26,4 +25,4 @@ export type LineChartProps = {
|
|
|
26
25
|
* @param props Props
|
|
27
26
|
* @returns Component
|
|
28
27
|
*/
|
|
29
|
-
export declare function LineChart(props: LineChartProps):
|
|
28
|
+
export declare function LineChart(props: LineChartProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/LineChart.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { LinearProgress } from "@mui/material";
|
|
2
3
|
import React from "react";
|
|
3
4
|
/**
|
|
@@ -21,7 +22,7 @@ export function LineChart(props) {
|
|
|
21
22
|
setLineType(Line);
|
|
22
23
|
});
|
|
23
24
|
}, []);
|
|
24
|
-
return LineType == null ? (
|
|
25
|
+
return LineType == null ? (_jsx(LinearProgress, {})) : (_jsx(LineType, { options: {
|
|
25
26
|
scales: {
|
|
26
27
|
x: {
|
|
27
28
|
ticks: {
|
package/lib/ListChooser.d.ts
CHANGED
|
@@ -60,5 +60,5 @@ export type ListChooserProps<T extends object, D extends DataTypes.Keys<T>, Q ex
|
|
|
60
60
|
* @param props Props
|
|
61
61
|
* @returns Component
|
|
62
62
|
*/
|
|
63
|
-
export declare function ListChooser<T extends object, D extends DataTypes.Keys<T> = IdDefaultType<T>, Q extends object = QueryData>(props: ListChooserProps<T, D, Q>):
|
|
63
|
+
export declare function ListChooser<T extends object, D extends DataTypes.Keys<T> = IdDefaultType<T>, Q extends object = QueryData>(props: ListChooserProps<T, D, Q>): import("react/jsx-runtime").JSX.Element;
|
|
64
64
|
export {};
|
package/lib/ListChooser.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { useDelayedExecutor } from "@etsoo/react";
|
|
2
3
|
import { List, ListItem, ListItemButton, ListItemText, TextField } from "@mui/material";
|
|
3
4
|
import CheckBoxIcon from "@mui/icons-material/CheckBox";
|
|
@@ -28,7 +29,7 @@ export function ListChooser(props) {
|
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
31
|
// Destruct
|
|
31
|
-
const { conditionField = "title", conditionRenderer = (rq, delayed) => (
|
|
32
|
+
const { conditionField = "title", conditionRenderer = (rq, delayed) => (_jsx(TextField, { autoFocus: true, margin: "dense", name: conditionField, label: title, fullWidth: true, variant: "standard", inputProps: { maxLength: 128 }, onChange: (event) => {
|
|
32
33
|
Reflect.set(rq, "title", event.target.value);
|
|
33
34
|
delayed.call();
|
|
34
35
|
} })), itemRenderer = (item, selectProps) => {
|
|
@@ -37,9 +38,7 @@ export function ListChooser(props) {
|
|
|
37
38
|
const label = typeof labelField === "function"
|
|
38
39
|
? labelField(item)
|
|
39
40
|
: Reflect.get(item, labelField);
|
|
40
|
-
return (
|
|
41
|
-
React.createElement(ListItemButton, { ...sp },
|
|
42
|
-
React.createElement(ListItemText, { primary: label }))));
|
|
41
|
+
return (_jsx(ListItem, { disableGutters: true, secondaryAction: sp.selected ? _jsx(CheckBoxIcon, { fontSize: "small" }) : undefined, children: _jsx(ListItemButton, { ...sp, children: _jsx(ListItemText, { primary: label }) }) }, `${id}`));
|
|
43
42
|
}, idField = "id", labelField = "label", loadData, multiple = false, onItemChange, title, doubleClickEnabled = false, onDoubleClick, ...rest } = props;
|
|
44
43
|
// Default minimum height
|
|
45
44
|
rest.sx ?? (rest.sx = { minHeight: "220px" });
|
|
@@ -86,7 +85,5 @@ export function ListChooser(props) {
|
|
|
86
85
|
}
|
|
87
86
|
};
|
|
88
87
|
// Layout
|
|
89
|
-
return (
|
|
90
|
-
conditionRenderer(rq.current, delayed),
|
|
91
|
-
React.createElement(List, { onDoubleClick: onDoubleClickLocal, disablePadding: true, dense: true, ...rest }, items.map((item) => itemRenderer(item, selectProps)))));
|
|
88
|
+
return (_jsxs(VBox, { children: [conditionRenderer(rq.current, delayed), _jsx(List, { onDoubleClick: onDoubleClickLocal, disablePadding: true, dense: true, ...rest, children: items.map((item) => itemRenderer(item, selectProps)) })] }));
|
|
92
89
|
}
|
package/lib/ListMoreDisplay.d.ts
CHANGED
|
@@ -36,4 +36,4 @@ export interface ListMoreDisplayProps<T extends object, F extends DataTypes.Basi
|
|
|
36
36
|
* @param props Props
|
|
37
37
|
* @returns Component
|
|
38
38
|
*/
|
|
39
|
-
export declare function ListMoreDisplay<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate>(props: ListMoreDisplayProps<T, F>):
|
|
39
|
+
export declare function ListMoreDisplay<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate>(props: ListMoreDisplayProps<T, F>): import("react/jsx-runtime").JSX.Element;
|
package/lib/ListMoreDisplay.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Card, CardActions, CardContent, CardHeader, CircularProgress } from "@mui/material";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { GridDataGet } from "@etsoo/react";
|
|
@@ -87,14 +88,8 @@ export function ListMoreDisplay(props) {
|
|
|
87
88
|
ref.isMounted = false;
|
|
88
89
|
};
|
|
89
90
|
}, []);
|
|
90
|
-
return (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
React.createElement(CardContent, { sx: {
|
|
95
|
-
paddingTop: 0,
|
|
96
|
-
paddingBottom: states.completed ? 0 : "inherit"
|
|
97
|
-
} }, states.items == null ? (React.createElement(CircularProgress, { size: 20 })) : (states.items.map((item, index) => children(item, index)))),
|
|
98
|
-
!states.completed && (React.createElement(CardActions, { sx: { justifyContent: "flex-end" } },
|
|
99
|
-
React.createElement(LoadingButton, { onClick: async () => await loadDataLocal() }, moreLabel))))));
|
|
91
|
+
return (_jsxs(React.Fragment, { children: [headerRenderer && headerRenderer(reset), _jsxs(Card, { ...rest, children: [_jsx(CardHeader, { title: headerTitle }), _jsx(CardContent, { sx: {
|
|
92
|
+
paddingTop: 0,
|
|
93
|
+
paddingBottom: states.completed ? 0 : "inherit"
|
|
94
|
+
}, children: states.items == null ? (_jsx(CircularProgress, { size: 20 })) : (states.items.map((item, index) => children(item, index))) }), !states.completed && (_jsx(CardActions, { sx: { justifyContent: "flex-end" }, children: _jsx(LoadingButton, { onClick: async () => await loadDataLocal(), children: moreLabel }) }))] })] }));
|
|
100
95
|
}
|
package/lib/LoadingButton.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ButtonProps, CircularProgressProps } from '@mui/material';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
/**
|
|
4
3
|
* Loading button props
|
|
5
4
|
*/
|
|
@@ -13,4 +12,4 @@ export type LoadingButtonProps = ButtonProps & {
|
|
|
13
12
|
* Loading button
|
|
14
13
|
* @param props Props
|
|
15
14
|
*/
|
|
16
|
-
export declare function LoadingButton(props: LoadingButtonProps):
|
|
15
|
+
export declare function LoadingButton(props: LoadingButtonProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/LoadingButton.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Button, CircularProgress } from '@mui/material';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
/**
|
|
@@ -13,7 +14,7 @@ export function LoadingButton(props) {
|
|
|
13
14
|
// https://stackoverflow.com/questions/55265255/react-usestate-hook-event-handler-using-initial-state
|
|
14
15
|
const [loading, setLoading] = React.useState(false);
|
|
15
16
|
// Icon
|
|
16
|
-
const localEndIcon = loading ? (
|
|
17
|
+
const localEndIcon = loading ? (_jsx(CircularProgress, { ...loadingIconProps })) : (endIcon);
|
|
17
18
|
// Check if the component is mounted
|
|
18
19
|
const isMounted = React.useRef(true);
|
|
19
20
|
React.useEffect(() => {
|
|
@@ -22,7 +23,7 @@ export function LoadingButton(props) {
|
|
|
22
23
|
};
|
|
23
24
|
}, []);
|
|
24
25
|
// Layout
|
|
25
|
-
return (
|
|
26
|
+
return (_jsx(Button, { disabled: loading, endIcon: localEndIcon, onClick: async (event) => {
|
|
26
27
|
if (onClick) {
|
|
27
28
|
// Update state
|
|
28
29
|
setLoading(true);
|
package/lib/MaskInput.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TextFieldProps } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import { type InputMask, type FactoryOpts } from "imask";
|
|
4
3
|
/**
|
|
5
4
|
* Mask input props
|
|
@@ -32,4 +31,4 @@ export type MaskInputProps<T extends FactoryOpts> = TextFieldProps & {
|
|
|
32
31
|
* @param props Props
|
|
33
32
|
* @returns Component
|
|
34
33
|
*/
|
|
35
|
-
export declare function MaskInput<T extends FactoryOpts = FactoryOpts>(props: MaskInputProps<T>):
|
|
34
|
+
export declare function MaskInput<T extends FactoryOpts = FactoryOpts>(props: MaskInputProps<T>): import("react/jsx-runtime").JSX.Element;
|
package/lib/MaskInput.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { TextField } from "@mui/material";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { MUGlobal } from "./MUGlobal";
|
|
@@ -37,5 +38,5 @@ export function MaskInput(props) {
|
|
|
37
38
|
maskRef.current.updateValue();
|
|
38
39
|
}, [maskRef.current, localValue]);
|
|
39
40
|
// Layout
|
|
40
|
-
return (
|
|
41
|
+
return (_jsx(TextField, { InputLabelProps: InputLabelProps, InputProps: InputProps, size: size, variant: variant, ...rest }));
|
|
41
42
|
}
|
package/lib/MenuButton.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export type MenuButtonProps<T extends DataTypes.IdItem> = Omit<MenuProps, "open"
|
|
|
6
6
|
labelField: DataTypes.Keys<T, string> | ((data: T) => string);
|
|
7
7
|
button: ((clickHandler: React.MouseEventHandler<HTMLButtonElement>) => React.ReactNode) | ButtonProps;
|
|
8
8
|
};
|
|
9
|
-
export declare function MenuButton<T extends DataTypes.IdItem>(props: MenuButtonProps<T>):
|
|
9
|
+
export declare function MenuButton<T extends DataTypes.IdItem>(props: MenuButtonProps<T>): import("react/jsx-runtime").JSX.Element;
|
package/lib/MenuButton.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Button, Menu, MenuItem } from "@mui/material";
|
|
2
3
|
import React from "react";
|
|
3
4
|
export function MenuButton(props) {
|
|
@@ -28,36 +29,34 @@ export function MenuButton(props) {
|
|
|
28
29
|
const labelFormatter = typeof labelField === "function"
|
|
29
30
|
? labelField
|
|
30
31
|
: (item) => item[labelField];
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
...{ sx }
|
|
32
|
+
return (_jsxs(React.Fragment, { children: [typeof button === "function" ? (button(handleMenuOpen)) : (_jsx(Button, { onClick: handleMenuOpen, ...button })), _jsx(Menu, { slotProps: {
|
|
33
|
+
paper: {
|
|
34
|
+
elevation: 0,
|
|
35
|
+
sx: {
|
|
36
|
+
overflow: "visible",
|
|
37
|
+
filter: "drop-shadow(0px 2px 8px rgba(0,0,0,0.32))",
|
|
38
|
+
"& .MuiAvatar-root": {
|
|
39
|
+
width: 32,
|
|
40
|
+
height: 32
|
|
41
|
+
},
|
|
42
|
+
"&:before": {
|
|
43
|
+
content: '""',
|
|
44
|
+
display: "block",
|
|
45
|
+
position: "absolute",
|
|
46
|
+
top: isTop ? 0 : undefined,
|
|
47
|
+
bottom: isTop ? undefined : -10,
|
|
48
|
+
right: 14,
|
|
49
|
+
width: 10,
|
|
50
|
+
height: 10,
|
|
51
|
+
bgcolor: "background.paper",
|
|
52
|
+
transform: "translateY(-50%) rotate(45deg)",
|
|
53
|
+
zIndex: 0
|
|
54
|
+
},
|
|
55
|
+
...{ sx }
|
|
56
|
+
}
|
|
57
57
|
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}))));
|
|
58
|
+
}, disableScrollLock: true, anchorEl: anchorEl, anchorOrigin: anchorOrigin, keepMounted: true, transformOrigin: transformOrigin, open: isMenuOpen, transitionDuration: 0, onClose: handleMenuClose, ...rest, children: items.map((item) => {
|
|
59
|
+
const label = labelFormatter(item);
|
|
60
|
+
return (_jsx(MenuItem, { disabled: true, children: label }, item.id));
|
|
61
|
+
}) })] }));
|
|
63
62
|
}
|