@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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { NotificationMessageType } from "@etsoo/notificationbase";
|
|
2
3
|
import { Utils } from "@etsoo/shared";
|
|
3
4
|
import { Table, TableBody, TableCell, TableHead, TableRow } from "@mui/material";
|
|
4
|
-
import React from "react";
|
|
5
5
|
import { globalApp } from "./app/ReactApp";
|
|
6
6
|
/**
|
|
7
7
|
* Check obj is instance of AuditLineChangesDto
|
|
@@ -53,15 +53,6 @@ export const ShowDataComparison = (data, modelTitle, getLabel, equalCheck = true
|
|
|
53
53
|
}));
|
|
54
54
|
if (equalCheck)
|
|
55
55
|
rows = rows.filter((item) => !Utils.equals(item.oldValue, item.newValue));
|
|
56
|
-
const inputs = (
|
|
57
|
-
React.createElement(TableHead, null,
|
|
58
|
-
React.createElement(TableRow, null,
|
|
59
|
-
React.createElement(TableCell, { width: "18%" }, field),
|
|
60
|
-
React.createElement(TableCell, { width: "41%", align: "right" }, oldValue),
|
|
61
|
-
React.createElement(TableCell, { width: "41%", align: "right" }, newValue))),
|
|
62
|
-
React.createElement(TableBody, null, rows.map((row) => (React.createElement(TableRow, { key: row.field },
|
|
63
|
-
React.createElement(TableCell, null, getLabel(row.field)),
|
|
64
|
-
React.createElement(TableCell, { align: "right" }, formatValue(row.oldValue, app)),
|
|
65
|
-
React.createElement(TableCell, { align: "right" }, formatValue(row.newValue, app))))))));
|
|
56
|
+
const inputs = (_jsxs(Table, { children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { width: "18%", children: field }), _jsx(TableCell, { width: "41%", align: "right", children: oldValue }), _jsx(TableCell, { width: "41%", align: "right", children: newValue })] }) }), _jsx(TableBody, { children: rows.map((row) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: getLabel(row.field) }), _jsx(TableCell, { align: "right", children: formatValue(row.oldValue, app) }), _jsx(TableCell, { align: "right", children: formatValue(row.newValue, app) })] }, row.field))) })] }));
|
|
66
57
|
app.notifier.alert([undefined, modelTitle], undefined, NotificationMessageType.Info, { fullScreen: app.smDown, inputs });
|
|
67
58
|
};
|
package/lib/Switch.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { FormControlLabelProps } from '@mui/material';
|
|
3
2
|
/**
|
|
4
3
|
* Switch props
|
|
@@ -26,4 +25,4 @@ export interface SwitchProps extends Omit<FormControlLabelProps, 'control'> {
|
|
|
26
25
|
* @param props Props
|
|
27
26
|
* @returns Component
|
|
28
27
|
*/
|
|
29
|
-
export declare function Switch(props: SwitchProps):
|
|
28
|
+
export declare function Switch(props: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/Switch.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { FormControlLabel } from '@mui/material';
|
|
3
4
|
import MuiCheckbox from '@mui/material/Checkbox';
|
|
@@ -23,11 +24,11 @@ export function Switch(props) {
|
|
|
23
24
|
setControlChecked(checked);
|
|
24
25
|
};
|
|
25
26
|
// Control
|
|
26
|
-
const control = checkbox ? (
|
|
27
|
+
const control = checkbox ? (_jsx(MuiCheckbox, { readOnly: readOnly, checked: controlChecked, onChange: handleChange, size: size, value: value })) : (_jsx(MuiSwitch, { readOnly: readOnly, checked: controlChecked, onChange: handleChange, size: size, value: value }));
|
|
27
28
|
// Default state
|
|
28
29
|
React.useEffect(() => {
|
|
29
30
|
setControlChecked(controlChecked);
|
|
30
31
|
}, [controlChecked]);
|
|
31
32
|
// Layout
|
|
32
|
-
return
|
|
33
|
+
return _jsx(FormControlLabel, { control: control, ...rest });
|
|
33
34
|
}
|
package/lib/SwitchAnt.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SwitchProps } from "@mui/material/Switch";
|
|
2
|
-
import React from "react";
|
|
3
2
|
/**
|
|
4
3
|
* Ant style switch props
|
|
5
4
|
*/
|
|
@@ -22,4 +21,4 @@ export interface SwitchAntProps extends SwitchProps {
|
|
|
22
21
|
* @param props Props
|
|
23
22
|
* @returns Component
|
|
24
23
|
*/
|
|
25
|
-
export declare function SwitchAnt(props: SwitchAntProps):
|
|
24
|
+
export declare function SwitchAnt(props: SwitchAntProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/SwitchAnt.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Stack, Typography } from "@mui/material";
|
|
2
3
|
import Switch from "@mui/material/Switch";
|
|
3
4
|
import React from "react";
|
|
@@ -27,18 +28,15 @@ export function SwitchAnt(props) {
|
|
|
27
28
|
setControlChecked(checked);
|
|
28
29
|
};
|
|
29
30
|
// Layout
|
|
30
|
-
return (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
? (theme) => activeColor ?? theme.palette.warning.main
|
|
42
|
-
: undefined
|
|
43
|
-
} }, endLabel)));
|
|
31
|
+
return (_jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [_jsx(Typography, { onClick: () => controlChecked && ref.current?.click(), sx: {
|
|
32
|
+
cursor: "pointer",
|
|
33
|
+
color: controlChecked
|
|
34
|
+
? undefined
|
|
35
|
+
: (theme) => activeColor ?? theme.palette.warning.main
|
|
36
|
+
}, children: startLabel }), _jsx(Switch, { checked: controlChecked, inputRef: ref, value: value, onChange: onChangeLocal, ...rest }), _jsx(Typography, { onClick: () => !controlChecked && ref.current?.click(), sx: {
|
|
37
|
+
cursor: "pointer",
|
|
38
|
+
color: controlChecked
|
|
39
|
+
? (theme) => activeColor ?? theme.palette.warning.main
|
|
40
|
+
: undefined
|
|
41
|
+
}, children: endLabel })] }));
|
|
44
42
|
}
|
package/lib/SwitchField.d.ts
CHANGED
|
@@ -42,4 +42,4 @@ export type SwitchFieldProps = Omit<FormControlProps, "defaultValue"> & {
|
|
|
42
42
|
* @param props Props
|
|
43
43
|
* @returns Component
|
|
44
44
|
*/
|
|
45
|
-
export declare function SwitchField(props: SwitchFieldProps):
|
|
45
|
+
export declare function SwitchField(props: SwitchFieldProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/SwitchField.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Box, FormControl, FormHelperText, InputLabel } from "@mui/material";
|
|
2
3
|
import NotchedOutline from "@mui/material/OutlinedInput";
|
|
3
4
|
import React from "react";
|
|
@@ -13,21 +14,17 @@ export function SwitchField(props) {
|
|
|
13
14
|
// Outlined
|
|
14
15
|
const outlined = variant === "outlined";
|
|
15
16
|
// Group
|
|
16
|
-
const group = (
|
|
17
|
+
const group = (_jsx(SwitchAnt, { activeColor: activeColor, name: name, startLabel: startLabel, endLabel: endLabel, value: value, checked: checked }));
|
|
17
18
|
// Layout
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
display: "none"
|
|
30
|
-
}
|
|
31
|
-
} })) : (React.createElement(Box, { paddingLeft: 2, paddingY: "7px" }, group))),
|
|
32
|
-
helperText && React.createElement(FormHelperText, null, helperText)));
|
|
19
|
+
return (_jsxs(React.Fragment, { children: [_jsxs(FormControl, { fullWidth: fullWidth, ...rest, children: [label && (_jsx(InputLabel, { required: required, variant: variant, shrink: true, children: label })), outlined ? (_jsx(NotchedOutline, { label: label && required ? label + " *" : label, notched: true, endAdornment: group, sx: {
|
|
20
|
+
cursor: "default",
|
|
21
|
+
display: "flex",
|
|
22
|
+
gap: 1,
|
|
23
|
+
paddingX: 2,
|
|
24
|
+
paddingY: "7px",
|
|
25
|
+
width: fullWidth ? "100%" : "auto",
|
|
26
|
+
"& input": {
|
|
27
|
+
display: "none"
|
|
28
|
+
}
|
|
29
|
+
} })) : (_jsx(Box, { paddingLeft: 2, paddingY: "7px", children: group }))] }), helperText && _jsx(FormHelperText, { children: helperText })] }));
|
|
33
30
|
}
|
package/lib/TabBox.d.ts
CHANGED
package/lib/TabBox.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Utils } from '@etsoo/shared';
|
|
2
3
|
import { Box, Tab, Tabs } from '@mui/material';
|
|
3
4
|
import React from 'react';
|
|
@@ -19,13 +20,9 @@ export function TabBox(props) {
|
|
|
19
20
|
setValue(index);
|
|
20
21
|
}, [index]);
|
|
21
22
|
// Layout
|
|
22
|
-
return (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (onChange)
|
|
28
|
-
onChange(event, newValue);
|
|
29
|
-
}, ...rest }, tabs.map(({ children, panel, ...tabRest }, index) => (React.createElement(Tab, { key: index, value: index, LinkComponent: tabRest.to ? Link : undefined, ...tabRest }))))),
|
|
30
|
-
tabs.map(({ children, panel }, index) => (React.createElement(Box, { key: index, hidden: value !== index, ...panel }, Utils.getResult(children, value === index))))));
|
|
23
|
+
return (_jsxs(React.Fragment, { children: [inputName && (_jsx("input", { type: "hidden", name: inputName, value: value })), _jsx(Box, { ...root, children: _jsx(Tabs, { value: value, onChange: (event, newValue) => {
|
|
24
|
+
setValue(newValue);
|
|
25
|
+
if (onChange)
|
|
26
|
+
onChange(event, newValue);
|
|
27
|
+
}, ...rest, children: tabs.map(({ children, panel, ...tabRest }, index) => (_jsx(Tab, { value: index, LinkComponent: tabRest.to ? Link : undefined, ...tabRest }, index))) }) }), tabs.map(({ children, panel }, index) => (_jsx(Box, { hidden: value !== index, ...panel, children: Utils.getResult(children, value === index) }, index)))] }));
|
|
31
28
|
}
|
package/lib/TableEx.d.ts
CHANGED
|
@@ -62,4 +62,4 @@ export type TableExProps<T extends object, D extends DataTypes.Keys<T>> = TableP
|
|
|
62
62
|
* @param props Props
|
|
63
63
|
* @returns Component
|
|
64
64
|
*/
|
|
65
|
-
export declare function TableEx<T extends object, D extends DataTypes.Keys<T> = IdDefaultType<T>>(props: TableExProps<T, D>):
|
|
65
|
+
export declare function TableEx<T extends object, D extends DataTypes.Keys<T> = IdDefaultType<T>>(props: TableExProps<T, D>): import("react/jsx-runtime").JSX.Element;
|
package/lib/TableEx.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { GridAlignGet, GridSizeGet } from "@etsoo/react";
|
|
2
3
|
import { DataTypes } from "@etsoo/shared";
|
|
3
4
|
import { Checkbox, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TablePagination, TableRow, TableSortLabel, useTheme } from "@mui/material";
|
|
@@ -208,93 +209,82 @@ export function TableEx(props) {
|
|
|
208
209
|
};
|
|
209
210
|
}, []);
|
|
210
211
|
// Layout
|
|
211
|
-
return (
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
setItems
|
|
290
|
-
})) : (React.createElement(React.Fragment, null, "\u00A0"));
|
|
291
|
-
return (React.createElement(TableCell, { key: `${rowId}${columnIndex}`, ...cellProps }, child));
|
|
292
|
-
})));
|
|
293
|
-
})))),
|
|
294
|
-
React.createElement(TablePagination, { component: "div", showFirstButton: true, count: totalRows, rowsPerPage: batchSize, page: currentPage, onPageChange: handleChangePage, onRowsPerPageChange: handleChangeRowsPerPage, rowsPerPageOptions: [
|
|
295
|
-
batchSize,
|
|
296
|
-
2 * batchSize,
|
|
297
|
-
5 * batchSize,
|
|
298
|
-
10 * batchSize
|
|
299
|
-
] })));
|
|
212
|
+
return (_jsxs(Paper, { children: [_jsx(TableContainer, { sx: { maxHeight }, children: _jsxs(Table, { ...rest, children: [_jsx(TableHead, { children: _jsxs(TableRow, { sx: {
|
|
213
|
+
"& th": {
|
|
214
|
+
backgroundColor: headerColors[0],
|
|
215
|
+
color: headerColors[1]
|
|
216
|
+
}
|
|
217
|
+
}, children: [selectable && (_jsx(TableCell, { padding: "checkbox", children: _jsx(Checkbox, { color: "primary", indeterminate: pageSelectedItems > 0 && pageSelectedItems < rows.length, checked: pageSelectedItems > 0, onChange: (_event, checked) => handleSelectAll(checked) }) })), columns.map((column, index) => {
|
|
218
|
+
// Destruct
|
|
219
|
+
const { align, field, header, minWidth, sortable, sortAsc = true, type, width } = column;
|
|
220
|
+
// Header text
|
|
221
|
+
const headerText = header ?? field;
|
|
222
|
+
// Sortable
|
|
223
|
+
let sortLabel;
|
|
224
|
+
if (sortable && field != null) {
|
|
225
|
+
const active = queryPaging.orderBy === field;
|
|
226
|
+
sortLabel = (_jsx(TableSortLabel, { active: active, direction: sortAsc ? "asc" : "desc", onClick: (_event) => {
|
|
227
|
+
if (active)
|
|
228
|
+
column.sortAsc = !sortAsc;
|
|
229
|
+
handleSort(field, column.sortAsc);
|
|
230
|
+
}, children: headerText }));
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
sortLabel = headerText;
|
|
234
|
+
}
|
|
235
|
+
return (_jsx(TableCell, { align: GridAlignGet(align, type), width: width, sx: {
|
|
236
|
+
minWidth: minWidth == null
|
|
237
|
+
? width == null
|
|
238
|
+
? TableExMinWidth
|
|
239
|
+
: undefined
|
|
240
|
+
: minWidth
|
|
241
|
+
}, children: sortLabel }, field ?? index.toString()));
|
|
242
|
+
})] }) }), _jsx(TableBody, { sx: {
|
|
243
|
+
"& tr:nth-of-type(odd):not(.Mui-selected)": {
|
|
244
|
+
backgroundColor: alternatingColors[0]
|
|
245
|
+
},
|
|
246
|
+
"& tr:nth-of-type(even):not(.Mui-selected)": {
|
|
247
|
+
backgroundColor: alternatingColors[1]
|
|
248
|
+
}
|
|
249
|
+
}, children: [...Array(queryPaging.batchSize)].map((_item, rowIndex) => {
|
|
250
|
+
// Row
|
|
251
|
+
const row = rowIndex < rows.length ? rows[rowIndex] : undefined;
|
|
252
|
+
// Row id field value
|
|
253
|
+
const rowId = DataTypes.getValue(row, idField) ?? rowIndex;
|
|
254
|
+
// Selected or not
|
|
255
|
+
const isItemSelected = selectable
|
|
256
|
+
? selectedItems.some((item) => item[idField] === rowId)
|
|
257
|
+
: false;
|
|
258
|
+
return (_jsxs(TableRow, { selected: isItemSelected, children: [selectable && (_jsx(TableCell, { padding: "checkbox", children: row && (_jsx(Checkbox, { color: "primary", checked: isItemSelected, onChange: (_event, checked) => handleSelect(row, checked) })) })), columns.map(({ align, cellRenderer = DataGridRenderers.defaultCellRenderer, field, type, valueFormatter }, columnIndex) => {
|
|
259
|
+
const formatProps = {
|
|
260
|
+
data: row,
|
|
261
|
+
field,
|
|
262
|
+
rowIndex,
|
|
263
|
+
columnIndex
|
|
264
|
+
};
|
|
265
|
+
const cellProps = {
|
|
266
|
+
align: GridAlignGet(align, type),
|
|
267
|
+
valign: "middle"
|
|
268
|
+
};
|
|
269
|
+
const child = row ? (cellRenderer({
|
|
270
|
+
data: row,
|
|
271
|
+
field,
|
|
272
|
+
formattedValue: valueFormatter
|
|
273
|
+
? valueFormatter(formatProps)
|
|
274
|
+
: undefined,
|
|
275
|
+
selected: isItemSelected,
|
|
276
|
+
type,
|
|
277
|
+
rowIndex,
|
|
278
|
+
columnIndex,
|
|
279
|
+
cellProps,
|
|
280
|
+
setItems
|
|
281
|
+
})) : (_jsx(React.Fragment, { children: "\u00A0" }));
|
|
282
|
+
return (_jsx(TableCell, { ...cellProps, children: child }, `${rowId}${columnIndex}`));
|
|
283
|
+
})] }, rowId));
|
|
284
|
+
}) })] }) }), _jsx(TablePagination, { component: "div", showFirstButton: true, count: totalRows, rowsPerPage: batchSize, page: currentPage, onPageChange: handleChangePage, onRowsPerPageChange: handleChangeRowsPerPage, rowsPerPageOptions: [
|
|
285
|
+
batchSize,
|
|
286
|
+
2 * batchSize,
|
|
287
|
+
5 * batchSize,
|
|
288
|
+
10 * batchSize
|
|
289
|
+
] })] }));
|
|
300
290
|
}
|
package/lib/TagList.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AutocompleteProps } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import { InputFieldProps } from "./InputField";
|
|
4
3
|
export type TagListProps = Omit<AutocompleteProps<string, true, false, true>, "open" | "multiple" | "freeSolo" | "options" | "renderInput"> & {
|
|
5
4
|
/**
|
|
@@ -19,4 +18,4 @@ export type TagListProps = Omit<AutocompleteProps<string, true, false, true>, "o
|
|
|
19
18
|
*/
|
|
20
19
|
maxItems?: number;
|
|
21
20
|
};
|
|
22
|
-
export declare function TagList(props: TagListProps):
|
|
21
|
+
export declare function TagList(props: TagListProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/TagList.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Autocomplete, Checkbox, Chip } from "@mui/material";
|
|
2
3
|
import CheckBoxOutlineBlankIcon from "@mui/icons-material/CheckBoxOutlineBlank";
|
|
3
4
|
import CheckBoxIcon from "@mui/icons-material/CheckBox";
|
|
@@ -9,9 +10,7 @@ export function TagList(props) {
|
|
|
9
10
|
const { noOptions, loading: loadingLabel, more = "More", open: openDefault } = globalApp?.getLabels("noOptions", "loading", "more", "open") ?? {};
|
|
10
11
|
const moreLabel = more + "...";
|
|
11
12
|
// Destruct
|
|
12
|
-
const { renderOption = (props, option, { selected }) => (
|
|
13
|
-
React.createElement(Checkbox, { icon: React.createElement(CheckBoxOutlineBlankIcon, { fontSize: "small" }), checkedIcon: React.createElement(CheckBoxIcon, { fontSize: "small" }), style: { marginRight: 8 }, checked: selected }),
|
|
14
|
-
option)), renderTags = (value, getTagProps) => value.map((option, index) => (React.createElement(Chip, { variant: "outlined", label: option, ...getTagProps({ index }) }))), noOptionsText = noOptions, loadingText = loadingLabel, openText = openDefault, loadData, maxItems = 16, disableCloseOnSelect = true, openOnFocus = true, label, inputProps, onChange, value, ...rest } = props;
|
|
13
|
+
const { renderOption = (props, option, { selected }) => (_jsxs("li", { ...props, children: [_jsx(Checkbox, { icon: _jsx(CheckBoxOutlineBlankIcon, { fontSize: "small" }), checkedIcon: _jsx(CheckBoxIcon, { fontSize: "small" }), style: { marginRight: 8 }, checked: selected }), option] })), renderTags = (value, getTagProps) => value.map((option, index) => (_jsx(Chip, { variant: "outlined", label: option, ...getTagProps({ index }) }))), noOptionsText = noOptions, loadingText = loadingLabel, openText = openDefault, loadData, maxItems = 16, disableCloseOnSelect = true, openOnFocus = true, label, inputProps, onChange, value, ...rest } = props;
|
|
15
14
|
const [open, setOpen] = React.useState(false);
|
|
16
15
|
const [options, setOptions] = React.useState([]);
|
|
17
16
|
const [loading, setLoading] = React.useState(false);
|
|
@@ -35,14 +34,14 @@ export function TagList(props) {
|
|
|
35
34
|
setOptions(result);
|
|
36
35
|
setLoading(false);
|
|
37
36
|
};
|
|
38
|
-
return (
|
|
37
|
+
return (_jsx(Autocomplete, { multiple: true, freeSolo: true, filterOptions: (options, _state) => options, open: open, onOpen: () => {
|
|
39
38
|
setOpen(true);
|
|
40
39
|
if (options.length === 0) {
|
|
41
40
|
loadDataLocal();
|
|
42
41
|
}
|
|
43
42
|
}, onClose: () => {
|
|
44
43
|
setOpen(false);
|
|
45
|
-
}, options: options, loading: loading, disableCloseOnSelect: disableCloseOnSelect, clearOnBlur: true, openOnFocus: openOnFocus, renderOption: renderOption, renderTags: renderTags, renderInput: (params) => (
|
|
44
|
+
}, options: options, loading: loading, disableCloseOnSelect: disableCloseOnSelect, clearOnBlur: true, openOnFocus: openOnFocus, renderOption: renderOption, renderTags: renderTags, renderInput: (params) => (_jsx(InputField, { label: label, changeDelay: 480, onChange: async (event) => {
|
|
46
45
|
// Stop bubble
|
|
47
46
|
event.preventDefault();
|
|
48
47
|
event.stopPropagation();
|
package/lib/TagListPro.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AutocompleteProps } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import { InputFieldProps } from "./InputField";
|
|
4
3
|
import { ListType2 } from "@etsoo/shared";
|
|
5
4
|
export type TagListProProps<D extends ListType2 = ListType2> = Omit<AutocompleteProps<D, true, false, false>, "open" | "multiple" | "options" | "renderInput"> & {
|
|
@@ -20,4 +19,4 @@ export type TagListProProps<D extends ListType2 = ListType2> = Omit<Autocomplete
|
|
|
20
19
|
*/
|
|
21
20
|
maxItems?: number;
|
|
22
21
|
};
|
|
23
|
-
export declare function TagListPro<D extends ListType2 = ListType2>(props: TagListProProps<D>):
|
|
22
|
+
export declare function TagListPro<D extends ListType2 = ListType2>(props: TagListProProps<D>): import("react/jsx-runtime").JSX.Element;
|
package/lib/TagListPro.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Autocomplete, Checkbox, Chip } from "@mui/material";
|
|
2
3
|
import CheckBoxOutlineBlankIcon from "@mui/icons-material/CheckBoxOutlineBlank";
|
|
3
4
|
import CheckBoxIcon from "@mui/icons-material/CheckBox";
|
|
@@ -11,10 +12,7 @@ export function TagListPro(props) {
|
|
|
11
12
|
const moreLabel = more + "...";
|
|
12
13
|
const getLabel = (item) => DataTypes.getListItemLabel(item);
|
|
13
14
|
// Destruct
|
|
14
|
-
const { renderOption = (props, option, { selected }) => (
|
|
15
|
-
React.createElement(React.Fragment, null,
|
|
16
|
-
React.createElement(Checkbox, { icon: React.createElement(CheckBoxOutlineBlankIcon, { fontSize: "small" }), checkedIcon: React.createElement(CheckBoxIcon, { fontSize: "small" }), style: { marginRight: 8 }, checked: selected }),
|
|
17
|
-
getLabel(option)))), renderTags = (value, getTagProps) => value.map((option, index) => (React.createElement(Chip, { variant: "outlined", label: getLabel(option), ...getTagProps({ index }) }))), noOptionsText = noOptions, loadingText = loadingLabel, openText = openDefault, loadData, maxItems = 16, disableCloseOnSelect = true, openOnFocus = true, label, inputProps, onChange, value, ...rest } = props;
|
|
15
|
+
const { renderOption = (props, option, { selected }) => (_jsx("li", { ...props, children: _jsxs(_Fragment, { children: [_jsx(Checkbox, { icon: _jsx(CheckBoxOutlineBlankIcon, { fontSize: "small" }), checkedIcon: _jsx(CheckBoxIcon, { fontSize: "small" }), style: { marginRight: 8 }, checked: selected }), getLabel(option)] }) })), renderTags = (value, getTagProps) => value.map((option, index) => (_jsx(Chip, { variant: "outlined", label: getLabel(option), ...getTagProps({ index }) }))), noOptionsText = noOptions, loadingText = loadingLabel, openText = openDefault, loadData, maxItems = 16, disableCloseOnSelect = true, openOnFocus = true, label, inputProps, onChange, value, ...rest } = props;
|
|
18
16
|
const [open, setOpen] = React.useState(false);
|
|
19
17
|
const [options, setOptions] = React.useState([]);
|
|
20
18
|
const [loading, setLoading] = React.useState(false);
|
|
@@ -38,14 +36,14 @@ export function TagListPro(props) {
|
|
|
38
36
|
setOptions(result);
|
|
39
37
|
setLoading(false);
|
|
40
38
|
};
|
|
41
|
-
return (
|
|
39
|
+
return (_jsx(Autocomplete, { multiple: true, filterOptions: (options, _state) => options, open: open, onOpen: () => {
|
|
42
40
|
setOpen(true);
|
|
43
41
|
if (options.length === 0) {
|
|
44
42
|
loadDataLocal();
|
|
45
43
|
}
|
|
46
44
|
}, onClose: () => {
|
|
47
45
|
setOpen(false);
|
|
48
|
-
}, options: options, loading: loading, disableCloseOnSelect: disableCloseOnSelect, openOnFocus: openOnFocus, renderOption: renderOption, renderTags: renderTags, renderInput: (params) => (
|
|
46
|
+
}, options: options, loading: loading, disableCloseOnSelect: disableCloseOnSelect, openOnFocus: openOnFocus, renderOption: renderOption, renderTags: renderTags, renderInput: (params) => (_jsx(InputField, { label: label, changeDelay: 480, onChange: async (event) => {
|
|
49
47
|
// Stop bubble
|
|
50
48
|
event.preventDefault();
|
|
51
49
|
event.stopPropagation();
|
package/lib/TextFieldEx.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { IconButton, InputAdornment, TextField } from "@mui/material";
|
|
3
4
|
import { MUGlobal } from "./MUGlobal";
|
|
@@ -72,11 +73,7 @@ export const TextFieldEx = React.forwardRef((props, ref) => {
|
|
|
72
73
|
};
|
|
73
74
|
// Show password and/or clear button
|
|
74
75
|
if (!empty && (showPassword || showClear)) {
|
|
75
|
-
InputProps.endAdornment = (
|
|
76
|
-
showPassword && (React.createElement(IconButton, { tabIndex: -1, onContextMenu: (event) => event.preventDefault(), onMouseDown: touchStart, onMouseUp: touchEnd, onTouchStart: touchStart, onTouchCancel: touchEnd, onTouchEnd: touchEnd },
|
|
77
|
-
React.createElement(Visibility, null))),
|
|
78
|
-
showClear && (React.createElement(IconButton, { onClick: clearClick, tabIndex: -1 },
|
|
79
|
-
React.createElement(Clear, null)))));
|
|
76
|
+
InputProps.endAdornment = (_jsxs(InputAdornment, { position: "end", children: [showPassword && (_jsx(IconButton, { tabIndex: -1, onContextMenu: (event) => event.preventDefault(), onMouseDown: touchStart, onMouseUp: touchEnd, onTouchStart: touchStart, onTouchCancel: touchEnd, onTouchEnd: touchEnd, children: _jsx(Visibility, {}) })), showClear && (_jsx(IconButton, { onClick: clearClick, tabIndex: -1, children: _jsx(Clear, {}) }))] }));
|
|
80
77
|
}
|
|
81
78
|
// Extend key precess
|
|
82
79
|
const onKeyPressEx = onEnter == null
|
|
@@ -132,5 +129,5 @@ export const TextFieldEx = React.forwardRef((props, ref) => {
|
|
|
132
129
|
};
|
|
133
130
|
}, []);
|
|
134
131
|
// Textfield
|
|
135
|
-
return (
|
|
132
|
+
return (_jsx(TextField, { error: errorEx, fullWidth: fullWidth, helperText: helperTextEx, inputRef: useCombinedRefs(inputRef, localRef), InputProps: InputProps, InputLabelProps: InputLabelProps, onChange: onChangeEx, onKeyDown: onKeyPressEx, type: typeEx, variant: variant, ...rest }));
|
|
136
133
|
});
|
package/lib/Tiplist.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DataTypes, IdDefaultType, ListType2 } from "@etsoo/shared";
|
|
2
|
-
import
|
|
3
|
-
import { AutocompleteExtendedProps } from "./AutocompleteExtendedProps";
|
|
2
|
+
import type { AutocompleteExtendedProps } from "./AutocompleteExtendedProps";
|
|
4
3
|
/**
|
|
5
4
|
* Tiplist props
|
|
6
5
|
*/
|
|
@@ -23,4 +22,4 @@ export type TiplistProps<T extends object, D extends DataTypes.Keys<T>> = Omit<A
|
|
|
23
22
|
* @param props Props
|
|
24
23
|
* @returns Component
|
|
25
24
|
*/
|
|
26
|
-
export declare function Tiplist<T extends object = ListType2, D extends DataTypes.Keys<T> = IdDefaultType<T>>(props: TiplistProps<T, D>):
|
|
25
|
+
export declare function Tiplist<T extends object = ListType2, D extends DataTypes.Keys<T> = IdDefaultType<T>>(props: TiplistProps<T, D>): import("react/jsx-runtime").JSX.Element;
|
package/lib/Tiplist.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { ReactUtils, useDelayedExecutor } from "@etsoo/react";
|
|
2
3
|
import { DataTypes } from "@etsoo/shared";
|
|
3
4
|
import { Autocomplete } from "@mui/material";
|
|
@@ -163,44 +164,42 @@ export function Tiplist(props) {
|
|
|
163
164
|
};
|
|
164
165
|
}, []);
|
|
165
166
|
// Layout
|
|
166
|
-
return (
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
: DataTypes.getObjectItemLabel(item);
|
|
205
|
-
}, ...rest })));
|
|
167
|
+
return (_jsxs("div", { children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: "text", style: { display: "none" }, name: name, value: `${inputValue ?? (state.current.idSet ? "" : localIdValue ?? "")}`, readOnly: true, onChange: inputOnChange }), _jsx(Autocomplete, { filterOptions: (options, _state) => options, value: states.value, options: states.options, onChange: (event, value, reason, details) => {
|
|
168
|
+
// Set value
|
|
169
|
+
setInputValue(value);
|
|
170
|
+
// Custom
|
|
171
|
+
if (onChange != null)
|
|
172
|
+
onChange(event, value, reason, details);
|
|
173
|
+
if (onValueChange)
|
|
174
|
+
onValueChange(value);
|
|
175
|
+
// For clear case
|
|
176
|
+
if (reason === "clear") {
|
|
177
|
+
stateUpdate({ options: [], open: event.type === "click" });
|
|
178
|
+
loadDataDirect();
|
|
179
|
+
}
|
|
180
|
+
}, open: states.open, openOnFocus: openOnFocus, onOpen: () => {
|
|
181
|
+
// Should load
|
|
182
|
+
const loading = states.loading ? true : states.options.length === 0;
|
|
183
|
+
stateUpdate({ open: true, loading });
|
|
184
|
+
// If not loading
|
|
185
|
+
if (loading)
|
|
186
|
+
loadDataDirect(undefined, states.value == null ? undefined : states.value[idField]);
|
|
187
|
+
}, onClose: () => {
|
|
188
|
+
stateUpdate({
|
|
189
|
+
open: false,
|
|
190
|
+
...(!states.value && { options: [] })
|
|
191
|
+
});
|
|
192
|
+
}, loading: states.loading, renderInput: (params) => search ? (_jsx(SearchField, { onChange: changeHandle, ...addReadOnly(params), readOnly: readOnly, label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, autoComplete: inputAutoComplete, error: inputError, helperText: inputHelperText })) : (_jsx(InputField, { onChange: changeHandle, ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, autoComplete: inputAutoComplete, error: inputError, helperText: inputHelperText })), isOptionEqualToValue: (option, value) => option[idField] === value[idField], sx: sx, noOptionsText: noOptionsText, loadingText: loadingText, openText: openText, getOptionDisabled: (item) => {
|
|
193
|
+
if (item[idField] === "n/a")
|
|
194
|
+
return true;
|
|
195
|
+
return getOptionDisabled ? getOptionDisabled(item) : false;
|
|
196
|
+
}, getOptionLabel: (item) => {
|
|
197
|
+
if (typeof item !== "object")
|
|
198
|
+
return `${item}`;
|
|
199
|
+
if (item[idField] === "n/a")
|
|
200
|
+
return (more ?? "More") + "...";
|
|
201
|
+
return getOptionLabel
|
|
202
|
+
? getOptionLabel(item)
|
|
203
|
+
: DataTypes.getObjectItemLabel(item);
|
|
204
|
+
}, ...rest })] }));
|
|
206
205
|
}
|