@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.
Files changed (171) hide show
  1. package/__tests__/ResponsePage.tsx +12 -3
  2. package/lib/AddresSelector.d.ts +1 -1
  3. package/lib/AddresSelector.js +9 -18
  4. package/lib/AuditDisplay.d.ts +1 -1
  5. package/lib/AuditDisplay.js +12 -15
  6. package/lib/BackButton.d.ts +1 -2
  7. package/lib/BackButton.js +3 -4
  8. package/lib/BridgeCloseButton.d.ts +1 -2
  9. package/lib/BridgeCloseButton.js +3 -4
  10. package/lib/ButtonLink.d.ts +1 -2
  11. package/lib/ButtonLink.js +2 -2
  12. package/lib/ComboBox.d.ts +1 -2
  13. package/lib/ComboBox.js +12 -16
  14. package/lib/ComboBoxMultiple.d.ts +1 -2
  15. package/lib/ComboBoxMultiple.js +15 -19
  16. package/lib/ComboBoxPro.d.ts +1 -2
  17. package/lib/ComboBoxPro.js +3 -2
  18. package/lib/CountdownButton.js +4 -3
  19. package/lib/CountryList.d.ts +1 -2
  20. package/lib/CountryList.js +2 -1
  21. package/lib/CultureDataTable.d.ts +1 -2
  22. package/lib/CultureDataTable.js +2 -1
  23. package/lib/DataGridEx.d.ts +1 -1
  24. package/lib/DataGridEx.js +55 -58
  25. package/lib/DataGridRenderers.js +5 -5
  26. package/lib/DataSteps.d.ts +1 -2
  27. package/lib/DataSteps.js +20 -23
  28. package/lib/DataTable.d.ts +1 -1
  29. package/lib/DataTable.js +2 -1
  30. package/lib/DialogButton.d.ts +1 -1
  31. package/lib/DialogButton.js +6 -13
  32. package/lib/DnDList.d.ts +1 -1
  33. package/lib/DnDList.js +8 -8
  34. package/lib/DraggablePaperComponent.d.ts +1 -2
  35. package/lib/DraggablePaperComponent.js +2 -2
  36. package/lib/EmailInput.d.ts +1 -2
  37. package/lib/EmailInput.js +2 -2
  38. package/lib/FabBox.d.ts +1 -2
  39. package/lib/FabBox.js +4 -3
  40. package/lib/FieldSetEx.d.ts +1 -1
  41. package/lib/FieldSetEx.js +13 -16
  42. package/lib/FileUploadButton.d.ts +1 -1
  43. package/lib/FileUploadButton.js +27 -29
  44. package/lib/FlexBox.d.ts +2 -3
  45. package/lib/FlexBox.js +3 -3
  46. package/lib/GridDataFormat.js +2 -2
  47. package/lib/HiSelector.d.ts +1 -1
  48. package/lib/HiSelector.js +2 -12
  49. package/lib/HiSelectorTL.d.ts +1 -1
  50. package/lib/HiSelectorTL.js +2 -12
  51. package/lib/IconButtonLink.d.ts +1 -2
  52. package/lib/IconButtonLink.js +2 -2
  53. package/lib/InputField.js +2 -1
  54. package/lib/InputTipField.d.ts +1 -1
  55. package/lib/InputTipField.js +12 -14
  56. package/lib/IntInputField.js +28 -33
  57. package/lib/ItemList.d.ts +1 -1
  58. package/lib/ItemList.js +6 -11
  59. package/lib/LineChart.d.ts +1 -2
  60. package/lib/LineChart.js +2 -1
  61. package/lib/ListChooser.d.ts +1 -1
  62. package/lib/ListChooser.js +4 -7
  63. package/lib/ListMoreDisplay.d.ts +1 -1
  64. package/lib/ListMoreDisplay.js +5 -10
  65. package/lib/LoadingButton.d.ts +1 -2
  66. package/lib/LoadingButton.js +3 -2
  67. package/lib/MaskInput.d.ts +1 -2
  68. package/lib/MaskInput.js +2 -1
  69. package/lib/MenuButton.d.ts +1 -1
  70. package/lib/MenuButton.js +30 -31
  71. package/lib/MobileListItemRenderer.d.ts +1 -1
  72. package/lib/MobileListItemRenderer.js +15 -18
  73. package/lib/MoneyInputField.js +2 -1
  74. package/lib/MoreFab.d.ts +1 -1
  75. package/lib/MoreFab.js +21 -24
  76. package/lib/NotifierMU.d.ts +2 -2
  77. package/lib/NotifierMU.js +27 -67
  78. package/lib/NumberInputField.d.ts +1 -1
  79. package/lib/NumberInputField.js +4 -4
  80. package/lib/OptionBool.d.ts +1 -2
  81. package/lib/OptionBool.js +2 -2
  82. package/lib/OptionGroup.d.ts +1 -1
  83. package/lib/OptionGroup.js +17 -20
  84. package/lib/OptionGroupFlag.d.ts +1 -1
  85. package/lib/OptionGroupFlag.js +15 -18
  86. package/lib/PList.d.ts +1 -2
  87. package/lib/PList.js +5 -4
  88. package/lib/PercentCircularProgress.d.ts +1 -2
  89. package/lib/PercentCircularProgress.js +11 -14
  90. package/lib/PercentLinearProgress.d.ts +1 -2
  91. package/lib/PercentLinearProgress.js +2 -6
  92. package/lib/ProgressCount.d.ts +1 -2
  93. package/lib/ProgressCount.js +12 -18
  94. package/lib/PullToRefreshUI.d.ts +1 -2
  95. package/lib/PullToRefreshUI.js +2 -1
  96. package/lib/QuickList.d.ts +1 -1
  97. package/lib/QuickList.js +12 -14
  98. package/lib/ResponsibleContainer.d.ts +1 -1
  99. package/lib/ResponsibleContainer.js +11 -16
  100. package/lib/ScrollTopFab.d.ts +1 -2
  101. package/lib/ScrollTopFab.js +2 -3
  102. package/lib/ScrollerListEx.d.ts +1 -1
  103. package/lib/ScrollerListEx.js +3 -2
  104. package/lib/SearchBar.d.ts +1 -1
  105. package/lib/SearchBar.js +27 -35
  106. package/lib/SearchField.d.ts +1 -2
  107. package/lib/SearchField.js +2 -1
  108. package/lib/SearchOptionGroup.d.ts +1 -2
  109. package/lib/SearchOptionGroup.js +2 -2
  110. package/lib/SelectBool.d.ts +1 -2
  111. package/lib/SelectBool.js +2 -2
  112. package/lib/SelectEx.d.ts +1 -1
  113. package/lib/SelectEx.js +47 -55
  114. package/lib/ShowDataComparison.js +2 -11
  115. package/lib/Switch.d.ts +1 -2
  116. package/lib/Switch.js +3 -2
  117. package/lib/SwitchAnt.d.ts +1 -2
  118. package/lib/SwitchAnt.js +12 -14
  119. package/lib/SwitchField.d.ts +1 -1
  120. package/lib/SwitchField.js +13 -16
  121. package/lib/TabBox.d.ts +1 -1
  122. package/lib/TabBox.js +6 -9
  123. package/lib/TableEx.d.ts +1 -1
  124. package/lib/TableEx.js +79 -89
  125. package/lib/TagList.d.ts +1 -2
  126. package/lib/TagList.js +4 -5
  127. package/lib/TagListPro.d.ts +1 -2
  128. package/lib/TagListPro.js +4 -6
  129. package/lib/TextFieldEx.js +3 -6
  130. package/lib/Tiplist.d.ts +1 -2
  131. package/lib/Tiplist.js +39 -40
  132. package/lib/TiplistPro.d.ts +2 -2
  133. package/lib/TiplistPro.js +48 -49
  134. package/lib/TooltipClick.d.ts +1 -1
  135. package/lib/TooltipClick.js +3 -3
  136. package/lib/TwoFieldInput.d.ts +1 -2
  137. package/lib/TwoFieldInput.js +4 -5
  138. package/lib/UserAvatar.d.ts +1 -2
  139. package/lib/UserAvatar.js +3 -3
  140. package/lib/UserAvatarEditor.d.ts +1 -2
  141. package/lib/UserAvatarEditor.js +2 -19
  142. package/lib/messages/OperationMessageContainer.d.ts +1 -2
  143. package/lib/messages/OperationMessageContainer.js +2 -1
  144. package/lib/pages/CommonPage.d.ts +1 -2
  145. package/lib/pages/CommonPage.js +15 -24
  146. package/lib/pages/DataGridPage.d.ts +1 -2
  147. package/lib/pages/DataGridPage.js +5 -8
  148. package/lib/pages/EditPage.d.ts +1 -1
  149. package/lib/pages/EditPage.js +6 -15
  150. package/lib/pages/FixedListPage.d.ts +1 -2
  151. package/lib/pages/FixedListPage.js +5 -9
  152. package/lib/pages/LeftDrawer.d.ts +1 -1
  153. package/lib/pages/LeftDrawer.js +3 -10
  154. package/lib/pages/ListPage.d.ts +1 -2
  155. package/lib/pages/ListPage.js +4 -7
  156. package/lib/pages/ResponsivePage.d.ts +1 -2
  157. package/lib/pages/ResponsivePage.js +25 -26
  158. package/lib/pages/TablePage.d.ts +1 -2
  159. package/lib/pages/TablePage.js +5 -8
  160. package/lib/pages/UserMenu.d.ts +1 -1
  161. package/lib/pages/UserMenu.js +33 -35
  162. package/lib/pages/ViewPage.d.ts +2 -2
  163. package/lib/pages/ViewPage.js +29 -37
  164. package/lib/texts/DateText.d.ts +1 -2
  165. package/lib/texts/DateText.js +2 -2
  166. package/lib/texts/MoneyText.d.ts +1 -2
  167. package/lib/texts/MoneyText.js +4 -4
  168. package/lib/texts/NumberText.d.ts +1 -2
  169. package/lib/texts/NumberText.js +2 -2
  170. package/package.json +9 -9
  171. 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
- loadData={(_data) =>
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) =>
@@ -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): React.JSX.Element;
99
+ export declare function AddressSelector(props: AddressSelectorProps): import("react/jsx-runtime").JSX.Element;
100
100
  export {};
@@ -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 (React.createElement(React.Fragment, null,
126
- label && (React.createElement(Grid, { item: true, xs: 12 },
127
- React.createElement(FormLabel, { required: required, sx: { fontSize: (theme) => theme.typography.caption } }, label))),
128
- !hideRegion && (React.createElement(Grid, { item: true, ...breakPoints },
129
- React.createElement(Tiplist, { label: regionLabel, name: AddressField.Region, search: search, fullWidth: true, idValue: regionState, loadData: (keyword, id, items) => api.getRegions({
130
- keyword,
131
- id,
132
- items,
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
  }
@@ -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): React.JSX.Element;
31
+ export declare function AuditDisplay(props: AuditDisplayProps): import("react/jsx-runtime").JSX.Element;
@@ -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 (React.createElement(React.Fragment, null,
34
- changes != null && (React.createElement(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
- } }, title)),
39
- React.createElement(Typography, null, formatDate(data.creation) +
40
- ", [" +
41
- getLabel(data.action) +
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 (React.createElement(ListMoreDisplay, { headerTitle: headerTitle, ...rest }, (data, index) => (React.createElement("div", { key: data.id, style: getItemStyle(index, theme) }, itemRenderer(data, index)))));
45
+ return (_jsx(ListMoreDisplay, { headerTitle: headerTitle, ...rest, children: (data, index) => (_jsx("div", { style: getItemStyle(index, theme), children: itemRenderer(data, index) }, data.id)) }));
49
46
  }
@@ -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): React.JSX.Element;
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 (React.createElement(IconButton, { "aria-label": "Back", color: color, size: size, onClick: onClickLocal, sx: {
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): React.JSX.Element;
22
+ export declare function BridgeCloseButton(props: BridgeCloseButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -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 React.createElement(React.Fragment, null);
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 (React.createElement(Box, { ...boxProps },
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
  }
@@ -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): React.JSX.Element;
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 React.createElement(Button, { ...rest, onClick: onClick });
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>): React.JSX.Element;
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 (React.createElement("div", null,
116
- React.createElement("input", { ref: inputRef, "data-reset": inputReset ?? true, type: "text", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange }),
117
- React.createElement(Stack, { gap: 0.5, direction: "row", width: "100%" },
118
- React.createElement(Autocomplete, { value: stateValue, disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
119
- // Set value
120
- setInputValue(value);
121
- // Custom
122
- if (onChange != null)
123
- onChange(event, value, reason, details);
124
- if (onValueChange)
125
- onValueChange(value);
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>): React.JSX.Element;
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;
@@ -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 = React.createElement(CheckBoxOutlineBlankIcon, { fontSize: "small" });
12
- const checkedIcon = React.createElement(CheckBoxIcon, { fontSize: "small" });
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 }) => (React.createElement("li", { ...props },
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 (React.createElement("div", null,
118
- React.createElement("input", { ref: inputRef, "data-reset": inputReset ?? true, type: "text", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange }),
119
- React.createElement(Autocomplete, { value: stateValue == null
120
- ? []
121
- : Array.isArray(stateValue)
122
- ? stateValue
123
- : [stateValue], disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, multiple: true, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
124
- // Set value
125
- setInputValue(value.concat());
126
- // Custom
127
- if (onChange != null)
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
  }
@@ -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>): React.JSX.Element;
31
+ export declare function ComboBoxPro<D extends ListType2 = ListType2>(props: ComboBoxProProps<D>): import("react/jsx-runtime").JSX.Element;
@@ -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 (React.createElement(Autocomplete, { id: name, value: localValue == null ? "" : localValue, open: open, freeSolo: true, clearOnBlur: false, onOpen: () => {
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) => (React.createElement(InputField, { ...inputProps, ...params, label: label, name: name, onBlur: (event) => {
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)
@@ -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 = React.createElement(CircularProgress, { size: 12 });
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 = React.createElement("span", { style: { fontSize: 'smaller' } }, countdown);
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 (React.createElement(Button, { disabled: disabled, endIcon: endIcon, onClick: localClick, ref: ref, ...rest }));
81
+ return (_jsx(Button, { disabled: disabled, endIcon: endIcon, onClick: localClick, ref: ref, ...rest }));
81
82
  });
@@ -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): React.JSX.Element;
29
+ export declare function CountryList(props: CountryListProps): import("react/jsx-runtime").JSX.Element;
@@ -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 (React.createElement(Tiplist, { name: name, loadData: (keyword, id) => loadData({ id, keyword, favoredIds: favoredIds.current, items }), ...rest }));
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): React.JSX.Element;
19
+ export declare function CultureDataTable(props: CultureDataTableProps): import("react/jsx-runtime").JSX.Element;
@@ -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 (React.createElement(DataTable, { columns: [
14
+ return (_jsx(DataTable, { columns: [
14
15
  {
15
16
  field: "id",
16
17
  headerName: cultureLabel,
@@ -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>): React.JSX.Element;
101
+ export declare function DataGridEx<T extends object>(props: DataGridExProps<T>): import("react/jsx-runtime").JSX.Element;