@etsoo/materialui 1.3.57 → 1.3.59
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 +12 -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 +1 -2
- package/lib/ComboBox.js +12 -16
- package/lib/ComboBoxMultiple.d.ts +1 -2
- 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 +1 -2
- 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/messages/OperationMessageContainer.d.ts +1 -2
- package/lib/messages/OperationMessageContainer.js +2 -1
- package/lib/pages/CommonPage.d.ts +1 -2
- package/lib/pages/CommonPage.js +15 -24
- package/lib/pages/DataGridPage.d.ts +1 -2
- package/lib/pages/DataGridPage.js +5 -8
- package/lib/pages/EditPage.d.ts +1 -1
- package/lib/pages/EditPage.js +6 -15
- package/lib/pages/FixedListPage.d.ts +1 -2
- 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 +1 -2
- package/lib/pages/ListPage.js +4 -7
- package/lib/pages/ResponsivePage.d.ts +1 -2
- package/lib/pages/ResponsivePage.js +25 -26
- package/lib/pages/TablePage.d.ts +1 -2
- 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 +2 -2
- 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 +9 -9
- package/tsconfig.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { act, render } from "@testing-library/react";
|
|
2
2
|
import { MUGlobal, MobileListItemRenderer, ResponsivePage } from "../src";
|
|
3
3
|
import React from "react";
|
|
4
|
+
import { DataTypes } from "@etsoo/shared";
|
|
4
5
|
|
|
5
6
|
global.ResizeObserver = jest.fn().mockImplementation(() => ({
|
|
6
7
|
observe: jest.fn(),
|
|
@@ -14,20 +15,28 @@ type Data = { id: number; name: string };
|
|
|
14
15
|
// https://jestjs.io/docs/en/timer-mocks
|
|
15
16
|
jest.useFakeTimers();
|
|
16
17
|
|
|
18
|
+
// TypeScript const assertions
|
|
19
|
+
const fieldTemplate = {
|
|
20
|
+
id: "number",
|
|
21
|
+
name: "string"
|
|
22
|
+
} as const;
|
|
23
|
+
|
|
17
24
|
it("Render ResponsePage", async () => {
|
|
18
25
|
// Act
|
|
19
26
|
render(
|
|
20
|
-
<ResponsivePage<Data>
|
|
27
|
+
<ResponsivePage<Data, typeof fieldTemplate>
|
|
21
28
|
fields={[]}
|
|
22
29
|
columns={[
|
|
23
30
|
{ field: "id", header: "ID" },
|
|
24
31
|
{ field: "name", header: "Name" }
|
|
25
32
|
]}
|
|
26
33
|
itemSize={[118, MUGlobal.pagePaddings]}
|
|
27
|
-
|
|
34
|
+
fieldTemplate={fieldTemplate}
|
|
35
|
+
loadData={({ id }) =>
|
|
28
36
|
Promise.resolve([
|
|
29
37
|
{ id: 1, name: "Name 1" },
|
|
30
|
-
{ id: 2, name: "Name 2" }
|
|
38
|
+
{ id: 2, name: "Name 2" },
|
|
39
|
+
{ id: id ?? 0, name: "auto" }
|
|
31
40
|
])
|
|
32
41
|
}
|
|
33
42
|
innerItemRenderer={(props) =>
|
package/lib/AddresSelector.d.ts
CHANGED
|
@@ -96,5 +96,5 @@ export type AddressSelectorProps = {
|
|
|
96
96
|
* Address selector
|
|
97
97
|
* @param props Props
|
|
98
98
|
*/
|
|
99
|
-
export declare function AddressSelector(props: AddressSelectorProps):
|
|
99
|
+
export declare function AddressSelector(props: AddressSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
100
100
|
export {};
|
package/lib/AddresSelector.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 { globalApp } from "./app/ReactApp";
|
|
@@ -122,22 +123,12 @@ export function AddressSelector(props) {
|
|
|
122
123
|
}
|
|
123
124
|
};
|
|
124
125
|
// Layout
|
|
125
|
-
return (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
favoredIds: favoredIds == null
|
|
134
|
-
? undefined
|
|
135
|
-
: favoredIds(AddressField.Region)
|
|
136
|
-
}), inputRequired: required, inputError: error, inputHelperText: helperText, onChange: (_event, value) => handleChange([AddressField.Region, value]) }))),
|
|
137
|
-
React.createElement(Grid, { item: true, ...breakPoints },
|
|
138
|
-
React.createElement(ComboBox, { name: AddressField.State, label: stateLabel, search: search, fullWidth: true, idValue: stateState, options: states, inputRequired: required, inputError: hideRegion ? error : undefined, inputHelperText: hideRegion ? helperText : undefined, onChange: (_event, value) => handleChange([AddressField.State, value]) })),
|
|
139
|
-
React.createElement(Grid, { item: true, ...breakPoints },
|
|
140
|
-
React.createElement(ComboBox, { name: AddressField.City, label: cityLabel, search: search, fullWidth: true, idValue: cityState, options: cities, onChange: (_event, value) => handleChange([AddressField.City, value]) })),
|
|
141
|
-
React.createElement(Grid, { item: true, ...breakPoints },
|
|
142
|
-
React.createElement(ComboBox, { name: AddressField.District, label: districtLabel, search: search, fullWidth: true, idValue: districtState, options: districts, onChange: (_event, value) => handleChange([AddressField.District, value]) }))));
|
|
126
|
+
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 }) })), !hideRegion && (_jsx(Grid, { item: true, ...breakPoints, children: _jsx(Tiplist, { label: regionLabel, name: AddressField.Region, search: search, fullWidth: true, idValue: regionState, loadData: (keyword, id, items) => api.getRegions({
|
|
127
|
+
keyword,
|
|
128
|
+
id,
|
|
129
|
+
items,
|
|
130
|
+
favoredIds: favoredIds == null
|
|
131
|
+
? undefined
|
|
132
|
+
: favoredIds(AddressField.Region)
|
|
133
|
+
}), inputRequired: required, inputError: error, inputHelperText: helperText, onChange: (_event, value) => handleChange([AddressField.Region, value]) }) })), _jsx(Grid, { item: true, ...breakPoints, children: _jsx(ComboBox, { name: AddressField.State, label: stateLabel, search: search, fullWidth: true, idValue: stateState, options: states, inputRequired: required, inputError: hideRegion ? error : undefined, inputHelperText: hideRegion ? helperText : undefined, onChange: (_event, value) => handleChange([AddressField.State, value]) }) }), _jsx(Grid, { item: true, ...breakPoints, children: _jsx(ComboBox, { name: AddressField.City, label: cityLabel, search: search, fullWidth: true, idValue: cityState, options: cities, onChange: (_event, value) => handleChange([AddressField.City, value]) }) }), _jsx(Grid, { item: true, ...breakPoints, children: _jsx(ComboBox, { name: AddressField.District, label: districtLabel, search: search, fullWidth: true, idValue: districtState, options: districts, onChange: (_event, value) => handleChange([AddressField.District, value]) }) })] }));
|
|
143
134
|
}
|
package/lib/AuditDisplay.d.ts
CHANGED
|
@@ -28,4 +28,4 @@ export interface AuditDisplayProps extends Omit<ListMoreDisplayProps<AuditLineDt
|
|
|
28
28
|
* @param props Props
|
|
29
29
|
* @returns Component
|
|
30
30
|
*/
|
|
31
|
-
export declare function AuditDisplay(props: AuditDisplayProps):
|
|
31
|
+
export declare function AuditDisplay(props: AuditDisplayProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/AuditDisplay.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 { Button, Divider, Typography, useTheme } from "@mui/material";
|
|
3
4
|
import React from "react";
|
|
@@ -30,20 +31,16 @@ export function AuditDisplay(props) {
|
|
|
30
31
|
background: index % 2 === 0 ? theme.palette.grey[100] : theme.palette.grey[50]
|
|
31
32
|
}), getColumnLabel, equalCheck, itemRenderer = (data) => {
|
|
32
33
|
const { newData, oldData, changes = { newData: newData ?? {}, oldData: oldData ?? {} } } = data;
|
|
33
|
-
return (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
data.user)));
|
|
44
|
-
}, headerTitle = (React.createElement(React.Fragment, null,
|
|
45
|
-
React.createElement(Typography, null, getLabel("audits")),
|
|
46
|
-
React.createElement(Divider, null))), ...rest } = props;
|
|
34
|
+
return (_jsxs(React.Fragment, { children: [changes != null && (_jsx(Button, { variant: "outlined", size: "small", onClick: () => ShowDataComparison(changes, title, getColumnLabel, equalCheck), sx: {
|
|
35
|
+
marginLeft: theme.spacing(1),
|
|
36
|
+
marginTop: theme.spacing(-0.5),
|
|
37
|
+
float: "right"
|
|
38
|
+
}, children: title })), _jsx(Typography, { children: formatDate(data.creation) +
|
|
39
|
+
", [" +
|
|
40
|
+
getLabel(data.action) +
|
|
41
|
+
"], " +
|
|
42
|
+
data.user })] }));
|
|
43
|
+
}, headerTitle = (_jsxs(React.Fragment, { children: [_jsx(Typography, { children: getLabel("audits") }), _jsx(Divider, {})] })), ...rest } = props;
|
|
47
44
|
// Layout
|
|
48
|
-
return (
|
|
45
|
+
return (_jsx(ListMoreDisplay, { headerTitle: headerTitle, ...rest, children: (data, index) => (_jsx("div", { style: getItemStyle(index, theme), children: itemRenderer(data, index) }, data.id)) }));
|
|
49
46
|
}
|
package/lib/BackButton.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IconButtonProps } from '@mui/material';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
/**
|
|
4
3
|
* BackButton props
|
|
5
4
|
*/
|
|
@@ -10,4 +9,4 @@ export interface BackButtonProps extends IconButtonProps {
|
|
|
10
9
|
* @param props Props
|
|
11
10
|
* @returns Component
|
|
12
11
|
*/
|
|
13
|
-
export declare function BackButton(props: BackButtonProps):
|
|
12
|
+
export declare function BackButton(props: BackButtonProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/BackButton.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { IconButton, useTheme } from '@mui/material';
|
|
2
3
|
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
import { useNavigate } from 'react-router-dom';
|
|
5
5
|
/**
|
|
6
6
|
* BackButton
|
|
@@ -25,9 +25,8 @@ export function BackButton(props) {
|
|
|
25
25
|
// Navigate
|
|
26
26
|
navigate(-1);
|
|
27
27
|
};
|
|
28
|
-
return (
|
|
28
|
+
return (_jsx(IconButton, { "aria-label": "Back", color: color, size: size, onClick: onClickLocal, sx: {
|
|
29
29
|
backgroundColor: pColor.contrastText,
|
|
30
30
|
border: `1px solid ${pColor.light}`
|
|
31
|
-
}, ...rest }
|
|
32
|
-
React.createElement(ArrowBackIcon, null)));
|
|
31
|
+
}, ...rest, children: _jsx(ArrowBackIcon, {}) }));
|
|
33
32
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IBridgeHost } from "@etsoo/appscript";
|
|
2
2
|
import { BoxProps, IconButtonProps } from "@mui/material";
|
|
3
|
-
import React from "react";
|
|
4
3
|
/**
|
|
5
4
|
* Bridge close button props
|
|
6
5
|
*/
|
|
@@ -20,4 +19,4 @@ export interface BridgeCloseButtonProps extends IconButtonProps {
|
|
|
20
19
|
* @param props Props
|
|
21
20
|
* @returns Component
|
|
22
21
|
*/
|
|
23
|
-
export declare function BridgeCloseButton(props: BridgeCloseButtonProps):
|
|
22
|
+
export declare function BridgeCloseButton(props: BridgeCloseButtonProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/BridgeCloseButton.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { BridgeUtils } from "@etsoo/appscript";
|
|
2
3
|
import CloseIcon from "@mui/icons-material/Close";
|
|
3
4
|
import { Box, IconButton } from "@mui/material";
|
|
@@ -16,7 +17,7 @@ export function BridgeCloseButton(props) {
|
|
|
16
17
|
if (host == null ||
|
|
17
18
|
!host.closable() ||
|
|
18
19
|
(validate && validate(host) === false)) {
|
|
19
|
-
return
|
|
20
|
+
return _jsx(React.Fragment, {});
|
|
20
21
|
}
|
|
21
22
|
// Click handler
|
|
22
23
|
const onClickLocal = (event) => {
|
|
@@ -24,7 +25,5 @@ export function BridgeCloseButton(props) {
|
|
|
24
25
|
onClick(event);
|
|
25
26
|
host.exit();
|
|
26
27
|
};
|
|
27
|
-
return (
|
|
28
|
-
React.createElement(IconButton, { "aria-label": "close", onClick: onClickLocal, title: title, ...rest },
|
|
29
|
-
React.createElement(CloseIcon, null))));
|
|
28
|
+
return (_jsx(Box, { ...boxProps, children: _jsx(IconButton, { "aria-label": "close", onClick: onClickLocal, title: title, ...rest, children: _jsx(CloseIcon, {}) }) }));
|
|
30
29
|
}
|
package/lib/ButtonLink.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ButtonProps } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
2
|
/**
|
|
4
3
|
* ButtonLink props
|
|
5
4
|
*/
|
|
@@ -18,4 +17,4 @@ export type ButtonLinkProps = Omit<ButtonProps, "href" | "onClick"> & {
|
|
|
18
17
|
* @param props Props
|
|
19
18
|
* @returns Component
|
|
20
19
|
*/
|
|
21
|
-
export declare function ButtonLink(props: ButtonLinkProps):
|
|
20
|
+
export declare function ButtonLink(props: ButtonLinkProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/ButtonLink.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Button } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
3
|
import { useNavigate } from "react-router-dom";
|
|
4
4
|
/**
|
|
5
5
|
* ButtonLink
|
|
@@ -15,5 +15,5 @@ export function ButtonLink(props) {
|
|
|
15
15
|
? () => window.open(href, "_blank")
|
|
16
16
|
: () => navigate(href, { state });
|
|
17
17
|
// Layout
|
|
18
|
-
return
|
|
18
|
+
return _jsx(Button, { ...rest, onClick: onClick });
|
|
19
19
|
}
|
package/lib/ComboBox.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DataTypes, IdDefaultType, LabelDefaultType, ListType } from "@etsoo/shared";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import { AutocompleteExtendedProps } from "./AutocompleteExtendedProps";
|
|
4
3
|
/**
|
|
5
4
|
* ComboBox props
|
|
@@ -43,4 +42,4 @@ export type ComboBoxProps<T extends object = ListType, D extends DataTypes.Keys<
|
|
|
43
42
|
* @param props Props
|
|
44
43
|
* @returns Component
|
|
45
44
|
*/
|
|
46
|
-
export declare function ComboBox<T extends object = ListType, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>>(props: ComboBoxProps<T, D, L>):
|
|
45
|
+
export declare function ComboBox<T extends object = ListType, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>>(props: ComboBoxProps<T, D, L>): import("react/jsx-runtime").JSX.Element;
|
package/lib/ComboBox.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Keyboard } from "@etsoo/shared";
|
|
2
3
|
import { Autocomplete, IconButton, Stack } from "@mui/material";
|
|
3
4
|
import React from "react";
|
|
@@ -112,20 +113,15 @@ export function ComboBox(props) {
|
|
|
112
113
|
};
|
|
113
114
|
}, []);
|
|
114
115
|
// Layout
|
|
115
|
-
return (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}, openOnFocus: openOnFocus, sx: sx, renderInput: (params) => search ? (React.createElement(SearchField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })) : (React.createElement(InputField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })), options: localOptions, noOptionsText: noOptionsText, loadingText: loadingText, openText: openText, ...rest }),
|
|
127
|
-
onAdd && (React.createElement(IconButton, { size: "small", onClick: () => {
|
|
128
|
-
onAdd(doLoadData);
|
|
129
|
-
}, title: addLabel },
|
|
130
|
-
React.createElement(AddIcon, null))))));
|
|
116
|
+
return (_jsxs("div", { children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: "text", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange }), _jsxs(Stack, { gap: 0.5, direction: "row", width: "100%", children: [_jsx(Autocomplete, { value: stateValue, disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
|
|
117
|
+
// Set value
|
|
118
|
+
setInputValue(value);
|
|
119
|
+
// Custom
|
|
120
|
+
if (onChange != null)
|
|
121
|
+
onChange(event, value, reason, details);
|
|
122
|
+
if (onValueChange)
|
|
123
|
+
onValueChange(value);
|
|
124
|
+
}, openOnFocus: openOnFocus, sx: sx, renderInput: (params) => search ? (_jsx(SearchField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })) : (_jsx(InputField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })), options: localOptions, noOptionsText: noOptionsText, loadingText: loadingText, openText: openText, ...rest }), onAdd && (_jsx(IconButton, { size: "small", onClick: () => {
|
|
125
|
+
onAdd(doLoadData);
|
|
126
|
+
}, title: addLabel, children: _jsx(AddIcon, {}) }))] })] }));
|
|
131
127
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DataTypes, IdDefaultType, LabelDefaultType, ListType } from "@etsoo/shared";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import { AutocompleteExtendedProps } from "./AutocompleteExtendedProps";
|
|
4
3
|
/**
|
|
5
4
|
* ComboBox multiple props
|
|
@@ -39,4 +38,4 @@ export type ComboBoxMultipleProps<T extends object = ListType, D extends DataTyp
|
|
|
39
38
|
* @param props Props
|
|
40
39
|
* @returns Component
|
|
41
40
|
*/
|
|
42
|
-
export declare function ComboBoxMultiple<T extends object = ListType, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>>(props: ComboBoxMultipleProps<T, D, L>):
|
|
41
|
+
export declare function ComboBoxMultiple<T extends object = ListType, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>>(props: ComboBoxMultipleProps<T, D, L>): import("react/jsx-runtime").JSX.Element;
|
package/lib/ComboBoxMultiple.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Keyboard } from "@etsoo/shared";
|
|
2
3
|
import { Autocomplete, Checkbox } from "@mui/material";
|
|
3
4
|
import React from "react";
|
|
@@ -8,8 +9,8 @@ import CheckBoxIcon from "@mui/icons-material/CheckBox";
|
|
|
8
9
|
import { SearchField } from "./SearchField";
|
|
9
10
|
import { InputField } from "./InputField";
|
|
10
11
|
import { globalApp } from "./app/ReactApp";
|
|
11
|
-
const icon =
|
|
12
|
-
const checkedIcon =
|
|
12
|
+
const icon = _jsx(CheckBoxOutlineBlankIcon, { fontSize: "small" });
|
|
13
|
+
const checkedIcon = _jsx(CheckBoxIcon, { fontSize: "small" });
|
|
13
14
|
/**
|
|
14
15
|
* ComboBox multiple
|
|
15
16
|
* @param props Props
|
|
@@ -19,10 +20,7 @@ export function ComboBoxMultiple(props) {
|
|
|
19
20
|
// Labels
|
|
20
21
|
const labels = globalApp?.getLabels("noOptions", "loading");
|
|
21
22
|
// Destruct
|
|
22
|
-
const { search = false, autoAddBlankItem = search, idField = "id", idValue, idValues, inputError, inputHelperText, inputMargin, inputOnChange, inputRequired, inputReset, inputVariant, defaultValue, label, labelField = "label", loadData, onLoadData, name, inputAutoComplete = "off", options, dataReadonly = true, readOnly, onChange, openOnFocus = true, value, disableCloseOnSelect = true, renderOption = (props, option, { selected }) => (
|
|
23
|
-
React.createElement(React.Fragment, null,
|
|
24
|
-
React.createElement(Checkbox, { icon: icon, checkedIcon: checkedIcon, style: { marginRight: 8 }, checked: selected }),
|
|
25
|
-
option[labelField]))), getOptionLabel = (option) => `${option[labelField]}`, sx = { minWidth: "150px" }, noOptionsText = labels?.noOptions, loadingText = labels?.loading, ...rest } = props;
|
|
23
|
+
const { search = false, autoAddBlankItem = search, idField = "id", idValue, idValues, inputError, inputHelperText, inputMargin, inputOnChange, inputRequired, inputReset, inputVariant, defaultValue, label, labelField = "label", loadData, onLoadData, name, inputAutoComplete = "off", options, dataReadonly = true, readOnly, onChange, openOnFocus = true, value, disableCloseOnSelect = true, renderOption = (props, option, { selected }) => (_jsx("li", { ...props, children: _jsxs(_Fragment, { children: [_jsx(Checkbox, { icon: icon, checkedIcon: checkedIcon, style: { marginRight: 8 }, checked: selected }), option[labelField]] }) })), getOptionLabel = (option) => `${option[labelField]}`, sx = { minWidth: "150px" }, noOptionsText = labels?.noOptions, loadingText = labels?.loading, ...rest } = props;
|
|
26
24
|
// Value input ref
|
|
27
25
|
const inputRef = React.createRef();
|
|
28
26
|
// Options state
|
|
@@ -114,17 +112,15 @@ export function ComboBoxMultiple(props) {
|
|
|
114
112
|
};
|
|
115
113
|
}, []);
|
|
116
114
|
// Layout
|
|
117
|
-
return (
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
onChange(event, value, reason, details);
|
|
129
|
-
}, openOnFocus: openOnFocus, sx: sx, renderInput: (params) => search ? (React.createElement(SearchField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })) : (React.createElement(InputField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })), options: localOptions, renderOption: renderOption, noOptionsText: noOptionsText, loadingText: loadingText, ...rest })));
|
|
115
|
+
return (_jsxs("div", { children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: "text", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange }), _jsx(Autocomplete, { value: stateValue == null
|
|
116
|
+
? []
|
|
117
|
+
: Array.isArray(stateValue)
|
|
118
|
+
? stateValue
|
|
119
|
+
: [stateValue], disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, multiple: true, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
|
|
120
|
+
// Set value
|
|
121
|
+
setInputValue(value.concat());
|
|
122
|
+
// Custom
|
|
123
|
+
if (onChange != null)
|
|
124
|
+
onChange(event, value, reason, details);
|
|
125
|
+
}, openOnFocus: openOnFocus, sx: sx, renderInput: (params) => search ? (_jsx(SearchField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })) : (_jsx(InputField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })), options: localOptions, renderOption: renderOption, noOptionsText: noOptionsText, loadingText: loadingText, ...rest })] }));
|
|
130
126
|
}
|
package/lib/ComboBoxPro.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 ComboBoxProProps<D extends ListType2 = ListType2> = Omit<AutocompleteProps<D, false, false, true>, "open" | "multiple" | "options" | "renderInput"> & {
|
|
@@ -29,4 +28,4 @@ export type ComboBoxProProps<D extends ListType2 = ListType2> = Omit<Autocomplet
|
|
|
29
28
|
*/
|
|
30
29
|
onValueChange?: (value: D | null) => void;
|
|
31
30
|
};
|
|
32
|
-
export declare function ComboBoxPro<D extends ListType2 = ListType2>(props: ComboBoxProProps<D>):
|
|
31
|
+
export declare function ComboBoxPro<D extends ListType2 = ListType2>(props: ComboBoxProProps<D>): import("react/jsx-runtime").JSX.Element;
|
package/lib/ComboBoxPro.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Autocomplete } from "@mui/material";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { globalApp } from "./app/ReactApp";
|
|
@@ -42,11 +43,11 @@ export function ComboBoxPro(props) {
|
|
|
42
43
|
setOptions(options);
|
|
43
44
|
}
|
|
44
45
|
}, [options]);
|
|
45
|
-
return (
|
|
46
|
+
return (_jsx(Autocomplete, { id: name, value: localValue == null ? "" : localValue, open: open, freeSolo: true, clearOnBlur: false, onOpen: () => {
|
|
46
47
|
setOpen(true);
|
|
47
48
|
}, onClose: () => {
|
|
48
49
|
setOpen(false);
|
|
49
|
-
}, options: localOptions, loading: loading, openOnFocus: openOnFocus, renderInput: (params) => (
|
|
50
|
+
}, options: localOptions, loading: loading, openOnFocus: openOnFocus, renderInput: (params) => (_jsx(InputField, { ...inputProps, ...params, label: label, name: name, onBlur: (event) => {
|
|
50
51
|
if (onChange) {
|
|
51
52
|
const value = event.target.value;
|
|
52
53
|
if (!localValue && localValue != value)
|
package/lib/CountdownButton.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
|
/**
|
|
@@ -24,13 +25,13 @@ export const CountdownButton = React.forwardRef((props, ref) => {
|
|
|
24
25
|
endIcon = undefined;
|
|
25
26
|
}
|
|
26
27
|
else if (state === 1) {
|
|
27
|
-
endIcon =
|
|
28
|
+
endIcon = _jsx(CircularProgress, { size: 12 });
|
|
28
29
|
}
|
|
29
30
|
else {
|
|
30
31
|
const countdown = (state - seconds)
|
|
31
32
|
.toString()
|
|
32
33
|
.padStart(shared.maxLength, '0');
|
|
33
|
-
endIcon =
|
|
34
|
+
endIcon = _jsx("span", { style: { fontSize: 'smaller' }, children: countdown });
|
|
34
35
|
}
|
|
35
36
|
// Disabled?
|
|
36
37
|
const disabled = state > 0;
|
|
@@ -77,5 +78,5 @@ export const CountdownButton = React.forwardRef((props, ref) => {
|
|
|
77
78
|
isMounted.current = false;
|
|
78
79
|
};
|
|
79
80
|
}, []);
|
|
80
|
-
return (
|
|
81
|
+
return (_jsx(Button, { disabled: disabled, endIcon: endIcon, onClick: localClick, ref: ref, ...rest }));
|
|
81
82
|
});
|
package/lib/CountryList.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AddressRegionDb, RegionsRQ } from '@etsoo/appscript';
|
|
2
2
|
import { DataTypes } from '@etsoo/shared';
|
|
3
|
-
import React from 'react';
|
|
4
3
|
import { TiplistProps } from './Tiplist';
|
|
5
4
|
/**
|
|
6
5
|
* Country list props
|
|
@@ -27,4 +26,4 @@ export type CountryListProps = Omit<DataTypes.Optional<TiplistProps<AddressRegio
|
|
|
27
26
|
* @param props Props
|
|
28
27
|
* @returns Component
|
|
29
28
|
*/
|
|
30
|
-
export declare function CountryList(props: CountryListProps):
|
|
29
|
+
export declare function CountryList(props: CountryListProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/CountryList.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { Tiplist } from './Tiplist';
|
|
3
4
|
/**
|
|
@@ -18,5 +19,5 @@ export function CountryList(props) {
|
|
|
18
19
|
});
|
|
19
20
|
}, [loadFavoredIds]);
|
|
20
21
|
// Layout
|
|
21
|
-
return (
|
|
22
|
+
return (_jsx(Tiplist, { name: name, loadData: (keyword, id) => loadData({ id, keyword, favoredIds: favoredIds.current, items }), ...rest }));
|
|
22
23
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DataTableProps } from "./DataTable";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import { ListType1 } from "@etsoo/shared";
|
|
4
3
|
/**
|
|
5
4
|
* Culture table props
|
|
@@ -17,4 +16,4 @@ export type CultureDataTableProps = Omit<DataTableProps, "columns"> & {
|
|
|
17
16
|
* @param props Props
|
|
18
17
|
* @returns Component
|
|
19
18
|
*/
|
|
20
|
-
export declare function CultureDataTable(props: CultureDataTableProps):
|
|
19
|
+
export declare function CultureDataTable(props: CultureDataTableProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/CultureDataTable.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { DataTable } from "./DataTable";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { globalApp } from "./app/ReactApp";
|
|
@@ -10,7 +11,7 @@ export function CultureDataTable(props) {
|
|
|
10
11
|
// Destruct
|
|
11
12
|
const { cultures, cultureLabel = globalApp?.get("culture"), editable = true, titleLabel, hasDescription = false, descriptionLabel = globalApp?.get("description"), ...rest } = props;
|
|
12
13
|
const getCultureLabel = React.useCallback((value) => cultures.find((c) => c.id == value.id)?.label ?? `${value.value}`, [cultures]);
|
|
13
|
-
return (
|
|
14
|
+
return (_jsx(DataTable, { columns: [
|
|
14
15
|
{
|
|
15
16
|
field: "id",
|
|
16
17
|
headerName: cultureLabel,
|
package/lib/DataGridEx.d.ts
CHANGED
|
@@ -98,4 +98,4 @@ export declare function DataGridExCalColumns<T>(columns: GridColumn<T>[]): {
|
|
|
98
98
|
* @param props Props
|
|
99
99
|
* @returns Component
|
|
100
100
|
*/
|
|
101
|
-
export declare function DataGridEx<T extends object>(props: DataGridExProps<T>):
|
|
101
|
+
export declare function DataGridEx<T extends object>(props: DataGridExProps<T>): import("react/jsx-runtime").JSX.Element;
|