@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.
Files changed (201) hide show
  1. package/__tests__/ResponsePage.tsx +11 -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 +2 -3
  13. package/lib/ComboBox.js +12 -16
  14. package/lib/ComboBoxMultiple.d.ts +2 -3
  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 +2 -3
  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/index.d.ts +0 -3
  143. package/lib/index.js +0 -3
  144. package/lib/messages/OperationMessageContainer.d.ts +1 -2
  145. package/lib/messages/OperationMessageContainer.js +2 -1
  146. package/lib/pages/CommonPage.d.ts +67 -2
  147. package/lib/pages/CommonPage.js +15 -24
  148. package/lib/pages/DataGridPage.d.ts +2 -3
  149. package/lib/pages/DataGridPage.js +5 -8
  150. package/lib/pages/DataGridPageProps.d.ts +3 -3
  151. package/lib/pages/EditPage.d.ts +3 -3
  152. package/lib/pages/EditPage.js +6 -15
  153. package/lib/pages/FixedListPage.d.ts +2 -3
  154. package/lib/pages/FixedListPage.js +5 -9
  155. package/lib/pages/LeftDrawer.d.ts +1 -1
  156. package/lib/pages/LeftDrawer.js +3 -10
  157. package/lib/pages/ListPage.d.ts +7 -3
  158. package/lib/pages/ListPage.js +4 -7
  159. package/lib/pages/ResponsivePage.d.ts +50 -2
  160. package/lib/pages/ResponsivePage.js +25 -26
  161. package/lib/pages/SearchPageProps.d.ts +3 -3
  162. package/lib/pages/TablePage.d.ts +7 -3
  163. package/lib/pages/TablePage.js +5 -8
  164. package/lib/pages/UserMenu.d.ts +1 -1
  165. package/lib/pages/UserMenu.js +33 -35
  166. package/lib/pages/ViewPage.d.ts +4 -4
  167. package/lib/pages/ViewPage.js +29 -37
  168. package/lib/texts/DateText.d.ts +1 -2
  169. package/lib/texts/DateText.js +2 -2
  170. package/lib/texts/MoneyText.d.ts +1 -2
  171. package/lib/texts/MoneyText.js +4 -4
  172. package/lib/texts/NumberText.d.ts +1 -2
  173. package/lib/texts/NumberText.js +2 -2
  174. package/package.json +3 -3
  175. package/src/ComboBox.tsx +1 -1
  176. package/src/ComboBoxMultiple.tsx +1 -1
  177. package/src/Tiplist.tsx +1 -1
  178. package/src/index.ts +0 -3
  179. package/src/pages/CommonPage.tsx +80 -2
  180. package/src/pages/DataGridPage.tsx +1 -1
  181. package/src/pages/DataGridPageProps.ts +3 -3
  182. package/src/pages/EditPage.tsx +2 -3
  183. package/src/pages/FixedListPage.tsx +1 -1
  184. package/src/pages/ListPage.tsx +10 -2
  185. package/src/pages/ResponsivePage.tsx +70 -2
  186. package/src/pages/SearchPageProps.ts +3 -3
  187. package/src/pages/TablePage.tsx +16 -2
  188. package/src/pages/ViewPage.tsx +3 -4
  189. package/tsconfig.json +2 -2
  190. package/lib/pages/CommonPageProps.d.ts +0 -67
  191. package/lib/pages/CommonPageProps.js +0 -1
  192. package/lib/pages/ListPageProps.d.ts +0 -7
  193. package/lib/pages/ListPageProps.js +0 -1
  194. package/lib/pages/ResponsivePageProps.d.ts +0 -51
  195. package/lib/pages/ResponsivePageProps.js +0 -1
  196. package/lib/pages/TablePageProps.d.ts +0 -7
  197. package/lib/pages/TablePageProps.js +0 -1
  198. package/src/pages/CommonPageProps.ts +0 -80
  199. package/src/pages/ListPageProps.ts +0 -11
  200. package/src/pages/ResponsivePageProps.ts +0 -70
  201. package/src/pages/TablePageProps.ts +0 -12
package/lib/DataGridEx.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { css } from "@emotion/css";
2
3
  import { GridAlignGet, ScrollerGrid, useCombinedRefs } from "@etsoo/react";
3
4
  import { Utils } from "@etsoo/shared";
@@ -72,57 +73,55 @@ export function DataGridEx(props) {
72
73
  const theme = useTheme();
73
74
  const defaultHeaderRenderer = (states) => {
74
75
  const { orderBy } = states.queryPaging;
75
- return (React.createElement(Box, { className: "DataGridEx-Header", display: "flex", alignItems: "center", borderBottom: boldBorder, fontWeight: 500, minWidth: widthCalculator.total, height: headerHeight }, columns.map((column, index) => {
76
- // Destruct
77
- const { align, field, header, headerCellRenderer, sortable, sortAsc = true, type } = column;
78
- // Header text
79
- const headerText = header ?? field;
80
- // Cell props
81
- const cellProps = {};
82
- // Sortable
83
- let sortLabel;
84
- if (headerCellRenderer) {
85
- sortLabel = headerCellRenderer({
86
- cellProps,
87
- column,
88
- columnIndex: checkable ? index - 1 : index, // Ignore the checkbox case,
89
- states
90
- });
91
- }
92
- else if (sortable && field != null) {
93
- const active = orderBy === field;
94
- sortLabel = (React.createElement(TableSortLabel, { active: active, direction: sortAsc ? "asc" : "desc", onClick: (_event) => {
95
- if (active)
96
- column.sortAsc = !sortAsc;
97
- handleSort(field, column.sortAsc);
98
- } }, headerText));
99
- }
100
- else {
101
- sortLabel = headerText;
102
- }
103
- return (React.createElement(Box, { key: field ?? index.toString(), textAlign: GridAlignGet(align, type), width: columnWidth(index) },
104
- React.createElement(Box, { className: "DataGridEx-Cell", onMouseEnter: handleMouseEnter, ...cellProps }, sortLabel)));
105
- })));
76
+ return (_jsx(Box, { className: "DataGridEx-Header", display: "flex", alignItems: "center", borderBottom: boldBorder, fontWeight: 500, minWidth: widthCalculator.total, height: headerHeight, children: columns.map((column, index) => {
77
+ // Destruct
78
+ const { align, field, header, headerCellRenderer, sortable, sortAsc = true, type } = column;
79
+ // Header text
80
+ const headerText = header ?? field;
81
+ // Cell props
82
+ const cellProps = {};
83
+ // Sortable
84
+ let sortLabel;
85
+ if (headerCellRenderer) {
86
+ sortLabel = headerCellRenderer({
87
+ cellProps,
88
+ column,
89
+ columnIndex: checkable ? index - 1 : index, // Ignore the checkbox case,
90
+ states
91
+ });
92
+ }
93
+ else if (sortable && field != null) {
94
+ const active = orderBy === field;
95
+ sortLabel = (_jsx(TableSortLabel, { active: active, direction: sortAsc ? "asc" : "desc", onClick: (_event) => {
96
+ if (active)
97
+ column.sortAsc = !sortAsc;
98
+ handleSort(field, column.sortAsc);
99
+ }, children: headerText }));
100
+ }
101
+ else {
102
+ sortLabel = headerText;
103
+ }
104
+ return (_jsx(Box, { textAlign: GridAlignGet(align, type), width: columnWidth(index), children: _jsx(Box, { className: "DataGridEx-Cell", onMouseEnter: handleMouseEnter, ...cellProps, children: sortLabel }) }, field ?? index.toString()));
105
+ }) }));
106
106
  };
107
107
  function defaultFooterRenderer(rows, states) {
108
- return (React.createElement(Box, { className: "DataGridEx-Footer", display: "flex", alignItems: "center", borderTop: thinBorder, marginTop: "1px", minWidth: widthCalculator.total, height: bottomHeight - 1 }, columns.map((column, index) => {
109
- // Destruct
110
- const { align, field, type } = column;
111
- // Cell props
112
- const cellProps = {};
113
- // Cell
114
- const cell = footerItemRenderer
115
- ? footerItemRenderer(rows, {
116
- column,
117
- index: checkable ? index - 1 : index, // Ignore the checkbox case
118
- states,
119
- cellProps,
120
- checkable
121
- })
122
- : undefined;
123
- return (React.createElement(Box, { key: "bottom-" + (field ?? index.toString()), textAlign: GridAlignGet(align, type), width: columnWidth(index) },
124
- React.createElement(Box, { className: "DataGridEx-Cell", onMouseEnter: handleMouseEnter, ...cellProps }, cell)));
125
- })));
108
+ return (_jsx(Box, { className: "DataGridEx-Footer", display: "flex", alignItems: "center", borderTop: thinBorder, marginTop: "1px", minWidth: widthCalculator.total, height: bottomHeight - 1, children: columns.map((column, index) => {
109
+ // Destruct
110
+ const { align, field, type } = column;
111
+ // Cell props
112
+ const cellProps = {};
113
+ // Cell
114
+ const cell = footerItemRenderer
115
+ ? footerItemRenderer(rows, {
116
+ column,
117
+ index: checkable ? index - 1 : index, // Ignore the checkbox case
118
+ states,
119
+ cellProps,
120
+ checkable
121
+ })
122
+ : undefined;
123
+ return (_jsx(Box, { textAlign: GridAlignGet(align, type), width: columnWidth(index), children: _jsx(Box, { className: "DataGridEx-Cell", onMouseEnter: handleMouseEnter, ...cellProps, children: cell }) }, "bottom-" + (field ?? index.toString())));
124
+ }) }));
126
125
  }
127
126
  // Destruct
128
127
  const { alternatingColors = [theme.palette.grey[100], undefined], borderRowsCount, bottomHeight = 53, checkable = false, className, columns, defaultOrderBy, height, headerHeight = 56, headerRenderer = defaultHeaderRenderer, footerRenderer = defaultFooterRenderer, footerItemRenderer = DataGridRenderers.defaultFooterItemRenderer, hideFooter = false, hoverColor = "#f6f9fb", idField = "id", mRef = React.createRef(), onClick, onDoubleClick, selectable = true, selectedColor = "#edf4fb", width, ...rest } = props;
@@ -136,7 +135,7 @@ export function DataGridEx(props) {
136
135
  cellProps.sx = {
137
136
  padding: "4px!important"
138
137
  };
139
- return (React.createElement(Checkbox, { color: "primary", checked: selected, onChange: (_event, checked) => {
138
+ return (_jsx(Checkbox, { color: "primary", checked: selected, onChange: (_event, checked) => {
140
139
  refs.current.ref?.selectItem(data, checked);
141
140
  } }));
142
141
  },
@@ -146,7 +145,7 @@ export function DataGridEx(props) {
146
145
  cellProps.sx = {
147
146
  padding: `${hpad}px 4px ${hpad - 1}px 4px!important`
148
147
  };
149
- return (React.createElement(Checkbox, { color: "primary", indeterminate: states.selectedItems.length > 0 &&
148
+ return (_jsx(Checkbox, { color: "primary", indeterminate: states.selectedItems.length > 0 &&
150
149
  states.selectedItems.length < states.loadedItems, checked: states.selectedItems.length > 0, onChange: (_event, checked) => refs.current.ref?.selectAll(checked) }));
151
150
  }
152
151
  };
@@ -263,8 +262,7 @@ export function DataGridEx(props) {
263
262
  renderProps: typeof renderProps === "function" ? renderProps(data) : renderProps,
264
263
  setItems
265
264
  });
266
- return (React.createElement("div", { className: rowClass, style: style, "data-row": rowIndex, "data-column": columnIndex, onMouseDown: selectable && !checkable ? handleMouseDown : undefined, onMouseOver: selectable ? handleMouseOver : undefined, onMouseOut: selectable ? handleMouseOut : undefined, onClick: (event) => onClick && data != null && onClick(event, data), onDoubleClick: (event) => onDoubleClick && data != null && onDoubleClick(event, data) },
267
- React.createElement(Box, { ...cellProps, onMouseEnter: handleMouseEnter }, child)));
265
+ return (_jsx("div", { className: rowClass, style: style, "data-row": rowIndex, "data-column": columnIndex, onMouseDown: selectable && !checkable ? handleMouseDown : undefined, onMouseOver: selectable ? handleMouseOver : undefined, onMouseOut: selectable ? handleMouseOut : undefined, onClick: (event) => onClick && data != null && onClick(event, data), onDoubleClick: (event) => onDoubleClick && data != null && onDoubleClick(event, data), children: _jsx(Box, { ...cellProps, onMouseEnter: handleMouseEnter, children: child }) }));
268
266
  };
269
267
  // Column width calculator
270
268
  const widthCalculator = React.useMemo(() => DataGridExCalColumns(columns), [columns]);
@@ -288,12 +286,12 @@ export function DataGridEx(props) {
288
286
  const defaultOrderByAsc = defaultOrderBy
289
287
  ? columns.find((column) => column.field === defaultOrderBy)?.sortAsc
290
288
  : undefined;
291
- return (React.createElement(ScrollerGrid, { className: Utils.mergeClasses("DataGridEx-Body", "DataGridEx-CustomBar", className, createGridStyle(alternatingColors, selectedColor, hoverColor)), columnCount: columns.length, columnWidth: columnWidth, defaultOrderBy: defaultOrderBy, defaultOrderByAsc: defaultOrderByAsc, height: height -
289
+ return (_jsx(ScrollerGrid, { className: Utils.mergeClasses("DataGridEx-Body", "DataGridEx-CustomBar", className, createGridStyle(alternatingColors, selectedColor, hoverColor)), columnCount: columns.length, columnWidth: columnWidth, defaultOrderBy: defaultOrderBy, defaultOrderByAsc: defaultOrderByAsc, height: height -
292
290
  headerHeight -
293
291
  (hideFooter ? 0 : bottomHeight + 1) -
294
292
  scrollbarSize, headerRenderer: headerRenderer, idField: idField, itemRenderer: itemRenderer, footerRenderer: hideFooter ? undefined : footerRenderer, width: Math.max(width ?? 0, widthCalculator.total), mRef: mRefLocal, ...rest }));
295
293
  }, [width]);
296
- return (React.createElement(Paper, { sx: {
294
+ return (_jsx(Paper, { sx: {
297
295
  fontSize: "0.875rem",
298
296
  height,
299
297
  "& .DataGridEx-Cell": {
@@ -321,10 +319,9 @@ export function DataGridEx(props) {
321
319
  }
322
320
  }
323
321
  }
324
- } },
325
- React.createElement("div", { className: "DataGridEx-CustomBar", style: {
322
+ }, children: _jsx("div", { className: "DataGridEx-CustomBar", style: {
326
323
  width,
327
324
  overflowX: "auto",
328
325
  overflowY: "hidden"
329
- } }, table)));
326
+ }, children: table }) }));
330
327
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { CircularProgress } from '@mui/material';
3
3
  import { DateUtils, NumberUtils } from '@etsoo/shared';
4
4
  import CheckIcon from '@mui/icons-material/Check';
@@ -20,7 +20,7 @@ export var DataGridRenderers;
20
20
  if (data == null) {
21
21
  // First column, show loading indicator
22
22
  if (columnIndex === 0)
23
- return React.createElement(CircularProgress, { size: 15 });
23
+ return _jsx(CircularProgress, { size: 15 });
24
24
  // Others return undefined
25
25
  return undefined;
26
26
  }
@@ -38,7 +38,7 @@ export var DataGridRenderers;
38
38
  const option = type === GridDataType.DateTime ? 'ds' : 'd';
39
39
  const nearDays = renderProps?.nearDays;
40
40
  if (nearDays != null) {
41
- return (React.createElement(DateText, { value: dateValue, locale: renderProps?.culture, timeZone: renderProps?.timeZone, options: option, nearDays: nearDays }));
41
+ return (_jsx(DateText, { value: dateValue, locale: renderProps?.culture, timeZone: renderProps?.timeZone, options: option, nearDays: nearDays }));
42
42
  }
43
43
  return DateUtils.format(dateValue, renderProps?.culture, option, renderProps?.timeZone);
44
44
  }
@@ -65,9 +65,9 @@ export var DataGridRenderers;
65
65
  };
66
66
  }
67
67
  if (value)
68
- return React.createElement(CheckIcon, { fontSize: "small" });
68
+ return _jsx(CheckIcon, { fontSize: "small" });
69
69
  else
70
- return React.createElement(ClearIcon, { fontSize: "small", color: "warning" });
70
+ return _jsx(ClearIcon, { fontSize: "small", color: "warning" });
71
71
  }
72
72
  // To string
73
73
  return new String(value);
@@ -1,6 +1,5 @@
1
1
  import { TextFieldProps } from "@mui/material";
2
2
  import { InputDialogProps } from "@etsoo/react";
3
- import React from "react";
4
3
  /**
5
4
  * Data step
6
5
  */
@@ -36,4 +35,4 @@ export type DataStepsProps<T extends object> = Omit<TextFieldProps, "InputProps"
36
35
  * @param props Props
37
36
  * @returns Component
38
37
  */
39
- export declare function DataSteps<T extends object>(props: DataStepsProps<T>): React.JSX.Element;
38
+ export declare function DataSteps<T extends object>(props: DataStepsProps<T>): import("react/jsx-runtime").JSX.Element;
package/lib/DataSteps.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { Button, IconButton, InputAdornment, TextField } from "@mui/material";
2
3
  import CloseIcon from "@mui/icons-material/Close";
3
4
  import NavigateNextIcon from "@mui/icons-material/NavigateNext";
@@ -40,25 +41,23 @@ export function DataSteps(props) {
40
41
  const [{ callback, ...rest }, more] = steps(index, jsonRef.current);
41
42
  app.showInputDialog({
42
43
  ...rest,
43
- buttons: (n, callback) => (React.createElement(HBox, { paddingLeft: 2, paddingRight: 2, paddingBottom: 2, gap: 2, justifyContent: "space-between" },
44
- index === 0 ? (React.createElement(Button, { variant: "outlined", startIcon: React.createElement(CloseIcon, null), onClick: () => n.dismiss() }, labels.close)) : (React.createElement(Button, { variant: "outlined", startIcon: React.createElement(NavigateBeforeIcon, null), onClick: () => {
45
- n.dismiss();
46
- showStep(indexRef.current - 1);
47
- } }, labels.previousStep)),
48
- more ? (React.createElement(Button, { variant: "contained", startIcon: React.createElement(NavigateNextIcon, null), onClick: async (event) => {
49
- const result = await callback(event);
50
- if (!result)
51
- return;
52
- showStep(indexRef.current + 1);
53
- } }, labels.nextStep)) : (React.createElement(Button, { variant: "contained", startIcon: React.createElement(CheckIcon, null), onClick: async (event) => {
54
- const result = await callback(event);
55
- if (!result)
56
- return;
57
- const value = jsonRef.current;
58
- setLocalValue(valueFormatter(value));
59
- if (onValueChange)
60
- onValueChange(value);
61
- } }, labels.submit)))),
44
+ buttons: (n, callback) => (_jsxs(HBox, { paddingLeft: 2, paddingRight: 2, paddingBottom: 2, gap: 2, justifyContent: "space-between", children: [index === 0 ? (_jsx(Button, { variant: "outlined", startIcon: _jsx(CloseIcon, {}), onClick: () => n.dismiss(), children: labels.close })) : (_jsx(Button, { variant: "outlined", startIcon: _jsx(NavigateBeforeIcon, {}), onClick: () => {
45
+ n.dismiss();
46
+ showStep(indexRef.current - 1);
47
+ }, children: labels.previousStep })), more ? (_jsx(Button, { variant: "contained", startIcon: _jsx(NavigateNextIcon, {}), onClick: async (event) => {
48
+ const result = await callback(event);
49
+ if (!result)
50
+ return;
51
+ showStep(indexRef.current + 1);
52
+ }, children: labels.nextStep })) : (_jsx(Button, { variant: "contained", startIcon: _jsx(CheckIcon, {}), onClick: async (event) => {
53
+ const result = await callback(event);
54
+ if (!result)
55
+ return;
56
+ const value = jsonRef.current;
57
+ setLocalValue(valueFormatter(value));
58
+ if (onValueChange)
59
+ onValueChange(value);
60
+ }, children: labels.submit }))] })),
62
61
  callback: (form) => {
63
62
  if (form == null)
64
63
  return;
@@ -76,15 +75,13 @@ export function DataSteps(props) {
76
75
  React.useEffect(() => {
77
76
  setLocalValue(valueFormatter(jsonRef.current));
78
77
  }, [valueFormatter]);
79
- return (React.createElement(TextField, { autoComplete: "off", InputLabelProps: InputLabelProps, inputProps: { style: { cursor: "pointer" } }, InputProps: {
78
+ return (_jsx(TextField, { autoComplete: "off", InputLabelProps: InputLabelProps, inputProps: { style: { cursor: "pointer" } }, InputProps: {
80
79
  onKeyDown: (event) => {
81
80
  if (event.key === "Tab")
82
81
  return;
83
82
  cancelInput(event);
84
83
  },
85
84
  onPaste: cancelInput,
86
- endAdornment: (React.createElement(InputAdornment, { position: "end" },
87
- React.createElement(IconButton, { edge: "end", size: "small" },
88
- React.createElement(StartIcon, null))))
85
+ endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { edge: "end", size: "small", children: _jsx(StartIcon, {}) }) }))
89
86
  }, onClick: () => showStep(0), value: localValue, ...rest }));
90
87
  }
@@ -30,4 +30,4 @@ export type DataTableProps<R extends GridValidRowModel = any> = Omit<DataGridPro
30
30
  * @param props Props
31
31
  * @returns Component
32
32
  */
33
- export declare function DataTable<R extends GridValidRowModel = any>(props: DataTableProps<R>): React.JSX.Element;
33
+ export declare function DataTable<R extends GridValidRowModel = any>(props: DataTableProps<R>): import("react/jsx-runtime").JSX.Element;
package/lib/DataTable.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { DataGrid } from "@mui/x-data-grid";
2
3
  import React from "react";
3
4
  import { globalApp } from "./app/ReactApp";
@@ -38,7 +39,7 @@ export function DataTable(props) {
38
39
  }
39
40
  setSelectedCellParams(params);
40
41
  }, []);
41
- return (React.createElement(DataGrid, { disableColumnMenu: true, hideFooter: true, localeText: localeText, cellModesModel: cellModesModel, onCellModesModelChange: (model) => setCellModesModel(model), onProcessRowUpdateError: onProcessRowUpdateError, slots: {
42
+ return (_jsx(DataGrid, { disableColumnMenu: true, hideFooter: true, localeText: localeText, cellModesModel: cellModesModel, onCellModesModelChange: (model) => setCellModesModel(model), onProcessRowUpdateError: onProcessRowUpdateError, slots: {
42
43
  toolbar: toolbarCreator
43
44
  ? ({ selectedCellParams, setCellModesModel, cellModesModel }) => toolbarCreator(selectedCellParams, setCellModesModel, cellModesModel)
44
45
  : undefined
@@ -51,4 +51,4 @@ export interface DialogButtonProps extends ButtonProps {
51
51
  * @param props Props
52
52
  * @returns Component
53
53
  */
54
- export declare function DialogButton(props: DialogButtonProps): React.JSX.Element;
54
+ export declare function DialogButton(props: DialogButtonProps): 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 { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, IconButton } from '@mui/material';
2
3
  import React from 'react';
3
4
  import { Labels } from './app/Labels';
@@ -28,17 +29,9 @@ export function DialogButton(props) {
28
29
  onClick(event);
29
30
  };
30
31
  // Layout
31
- return (React.createElement(React.Fragment, null,
32
- icon == null ? (React.createElement(Button, { ...rest, title: title, onClick: onClickLocal }, children)) : (React.createElement(IconButton, { ...rest, onClick: onClickLocal, title: title ?? children?.toString() }, icon)),
33
- React.createElement(Dialog, { disableScrollLock: disableScrollLock, fullScreen: fullScreen, fullWidth: fullWidth, maxWidth: maxWidth, open: open, onClose: () => setOpen(false), onClick: (event) => {
34
- // The dialog will be embeded and the click event will bubble up
35
- // Stop propatation but will also cancel onClose and onBackdropClick event
36
- event.stopPropagation();
37
- } },
38
- React.createElement(DialogTitle, null, dialogTitle ?? title ?? children),
39
- React.createElement(DialogContent, null,
40
- React.createElement(DialogContentText, { component: contentPre ? 'pre' : 'span' }, content),
41
- inputs),
42
- React.createElement(DialogActions, null,
43
- React.createElement(Button, { onClick: () => setOpen(false) }, buttonLabel)))));
32
+ return (_jsxs(React.Fragment, { children: [icon == null ? (_jsx(Button, { ...rest, title: title, onClick: onClickLocal, children: children })) : (_jsx(IconButton, { ...rest, onClick: onClickLocal, title: title ?? children?.toString(), children: icon })), _jsxs(Dialog, { disableScrollLock: disableScrollLock, fullScreen: fullScreen, fullWidth: fullWidth, maxWidth: maxWidth, open: open, onClose: () => setOpen(false), onClick: (event) => {
33
+ // The dialog will be embeded and the click event will bubble up
34
+ // Stop propatation but will also cancel onClose and onBackdropClick event
35
+ event.stopPropagation();
36
+ }, children: [_jsx(DialogTitle, { children: dialogTitle ?? title ?? children }), _jsxs(DialogContent, { children: [_jsx(DialogContentText, { component: contentPre ? 'pre' : 'span', children: content }), inputs] }), _jsx(DialogActions, { children: _jsx(Button, { onClick: () => setOpen(false), children: buttonLabel }) })] })] }));
44
37
  }
package/lib/DnDList.d.ts CHANGED
@@ -101,4 +101,4 @@ export interface DnDListPros<D extends object, K extends DataTypes.Keys<D>> {
101
101
  */
102
102
  export declare function DnDList<D extends {
103
103
  id: UniqueIdentifier;
104
- }, K extends DataTypes.Keys<D, UniqueIdentifier> = DataTypes.Keys<D, UniqueIdentifier>>(props: DnDListPros<D, K>): React.JSX.Element;
104
+ }, K extends DataTypes.Keys<D, UniqueIdentifier> = DataTypes.Keys<D, UniqueIdentifier>>(props: DnDListPros<D, K>): import("react/jsx-runtime").JSX.Element;
package/lib/DnDList.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { Skeleton, useTheme } from "@mui/material";
2
3
  import React from "react";
3
4
  function SortableItem(props) {
@@ -143,7 +144,7 @@ export function DnDList(props) {
143
144
  });
144
145
  }, []);
145
146
  if (dnd == null) {
146
- return React.createElement(Skeleton, { variant: "rectangular", width: "100%", height: height });
147
+ return _jsx(Skeleton, { variant: "rectangular", width: "100%", height: height });
147
148
  }
148
149
  const [DndContextType, SortableContextType, useSortableType, rectSortingStrategyType, rectSwappingStrategyType, horizontalListSortingStrategyType, verticalListSortingStrategyType, CSSType] = dnd;
149
150
  const strategy = typeof sortingStrategy === "function"
@@ -199,16 +200,15 @@ export function DnDList(props) {
199
200
  .querySelectorAll("select")
200
201
  .forEach((input) => input.addEventListener("change", () => doFormChange()));
201
202
  };
202
- const children = (React.createElement(DndContextType, { onDragStart: handleDragStart, onDragEnd: handleDragEnd },
203
- React.createElement(SortableContextType, { items: items, strategy: strategy }, items.map((item, index) => {
204
- const id = item[keyField];
205
- return (React.createElement(SortableItem, { id: id, useSortableType: useSortableType, CSSType: CSSType, key: id, style: getItemStyle(index, id === activeId), itemRenderer: (nodeRef, actionNodeRef) => itemRenderer(item, index, nodeRef, actionNodeRef) }));
206
- }))));
203
+ const children = (_jsx(DndContextType, { onDragStart: handleDragStart, onDragEnd: handleDragEnd, children: _jsx(SortableContextType, { items: items, strategy: strategy, children: items.map((item, index) => {
204
+ const id = item[keyField];
205
+ return (_jsx(SortableItem, { id: id, useSortableType: useSortableType, CSSType: CSSType, style: getItemStyle(index, id === activeId), itemRenderer: (nodeRef, actionNodeRef) => itemRenderer(item, index, nodeRef, actionNodeRef) }, id));
206
+ }) }) }));
207
207
  if (onFormChange) {
208
- return (React.createElement("div", { style: { width: "100%" }, ref: (div) => {
208
+ return (_jsx("div", { style: { width: "100%" }, ref: (div) => {
209
209
  if (div)
210
210
  setupDiv(div);
211
- } }, children));
211
+ }, children: children }));
212
212
  }
213
213
  return children;
214
214
  }
@@ -1,8 +1,7 @@
1
1
  import { PaperProps } from "@mui/material";
2
- import React from "react";
3
2
  /**
4
3
  * Draggable paper component
5
4
  * @param props Props
6
5
  * @returns Component
7
6
  */
8
- export declare function DraggablePaperComponent(props: PaperProps): React.JSX.Element;
7
+ export declare function DraggablePaperComponent(props: PaperProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { Paper } from "@mui/material";
2
3
  import React from "react";
3
4
  import Draggable from "react-draggable";
@@ -8,6 +9,5 @@ import Draggable from "react-draggable";
8
9
  */
9
10
  export function DraggablePaperComponent(props) {
10
11
  const nodeRef = React.useRef(null);
11
- return (React.createElement(Draggable, { handle: ".draggable-dialog-title", cancel: '[class*="MuiDialogContent-root"]', nodeRef: nodeRef },
12
- React.createElement(Paper, { ref: nodeRef, ...props })));
12
+ return (_jsx(Draggable, { handle: ".draggable-dialog-title", cancel: '[class*="MuiDialogContent-root"]', nodeRef: nodeRef, children: _jsx(Paper, { ref: nodeRef, ...props }) }));
13
13
  }
@@ -1,5 +1,4 @@
1
1
  import { TextFieldProps } from '@mui/material';
2
- import React from 'react';
3
2
  /**
4
3
  * Email input props
5
4
  */
@@ -8,4 +7,4 @@ export type EmailInputProps = Omit<TextFieldProps, 'type'> & {};
8
7
  * Email input
9
8
  * @param props Props
10
9
  */
11
- export declare function EmailInput(props: EmailInputProps): React.JSX.Element;
10
+ export declare function EmailInput(props: EmailInputProps): import("react/jsx-runtime").JSX.Element;
package/lib/EmailInput.js CHANGED
@@ -1,5 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { TextField } from '@mui/material';
2
- import React from 'react';
3
3
  /**
4
4
  * Email input
5
5
  * @param props Props
@@ -10,5 +10,5 @@ export function EmailInput(props) {
10
10
  // Default max length
11
11
  inputProps.maxLength ?? (inputProps.maxLength = 128);
12
12
  // Layout
13
- return (React.createElement(TextField, { type: "email", fullWidth: true, inputProps: inputProps, ...rest }));
13
+ return (_jsx(TextField, { type: "email", fullWidth: true, inputProps: inputProps, ...rest }));
14
14
  }
package/lib/FabBox.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { BoxProps, PaperProps } from "@mui/material";
2
- import React from "react";
3
2
  type SharedProps = keyof BoxProps & keyof PaperProps;
4
3
  /**
5
4
  * Fabs container box props
@@ -23,5 +22,5 @@ export type FabBoxProps = Pick<BoxProps, SharedProps> & Pick<PaperProps, SharedP
23
22
  * @param props Props
24
23
  * @returns Component
25
24
  */
26
- export declare function FabBox(props: FabBoxProps): React.JSX.Element;
25
+ export declare function FabBox(props: FabBoxProps): import("react/jsx-runtime").JSX.Element;
27
26
  export {};
package/lib/FabBox.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { Box, Paper, useTheme } from "@mui/material";
2
3
  import React from "react";
3
4
  const initOpactiy = 0.15;
@@ -14,8 +15,8 @@ export function FabBox(props) {
14
15
  const spaceGap = theme.spacing(itemGap);
15
16
  const [opacity, setOpacity] = React.useState(initOpactiy);
16
17
  if (columnDirection == null)
17
- return React.createElement(React.Fragment, null);
18
- return fabPanel ? (React.createElement(Paper, { sx: {
18
+ return _jsx(React.Fragment, {});
19
+ return fabPanel ? (_jsx(Paper, { sx: {
19
20
  position: "fixed",
20
21
  display: "flex",
21
22
  alignItems: "center",
@@ -24,7 +25,7 @@ export function FabBox(props) {
24
25
  gap: spaceGap,
25
26
  opacity: opacity,
26
27
  ...sx
27
- }, onMouseEnter: () => setOpacity(1), onMouseLeave: () => setOpacity(initOpactiy), ...rest })) : (React.createElement(Box, { sx: {
28
+ }, onMouseEnter: () => setOpacity(1), onMouseLeave: () => setOpacity(initOpactiy), ...rest })) : (_jsx(Box, { sx: {
28
29
  position: "fixed",
29
30
  display: "flex",
30
31
  alignItems: "center",
@@ -18,4 +18,4 @@ export type FieldSetExProps = Omit<FormControlProps, "defaultValue" | "variant">
18
18
  * @param props Props
19
19
  * @returns Component
20
20
  */
21
- export declare function FieldSetEx(props: FieldSetExProps): React.JSX.Element;
21
+ export declare function FieldSetEx(props: FieldSetExProps): import("react/jsx-runtime").JSX.Element;
package/lib/FieldSetEx.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { FormControl, FormHelperText, InputLabel } from "@mui/material";
2
3
  import NotchedOutline from "@mui/material/OutlinedInput";
3
4
  import React from "react";
@@ -10,20 +11,16 @@ export function FieldSetEx(props) {
10
11
  // Destruct
11
12
  const { label, helperText, required, fullWidth, children, ...rest } = props;
12
13
  // Layout
13
- return (React.createElement(React.Fragment, null,
14
- React.createElement(FormControl, { fullWidth: fullWidth, ...rest },
15
- label && (React.createElement(InputLabel, { required: required, variant: "outlined", shrink: true }, label)),
16
- React.createElement(NotchedOutline, { label: label && required ? label + " *" : label, notched: true, endAdornment: children, sx: {
17
- cursor: "default",
18
- display: "flex",
19
- flexWrap: "wrap",
20
- gap: 1,
21
- paddingX: 2,
22
- paddingY: "7px",
23
- width: fullWidth ? "100%" : "auto",
24
- "& input": {
25
- display: "none"
26
- }
27
- } })),
28
- helperText && (React.createElement(FormHelperText, { sx: { marginLeft: 2, marginRight: 2 } }, helperText))));
14
+ return (_jsxs(React.Fragment, { children: [_jsxs(FormControl, { fullWidth: fullWidth, ...rest, children: [label && (_jsx(InputLabel, { required: required, variant: "outlined", shrink: true, children: label })), _jsx(NotchedOutline, { label: label && required ? label + " *" : label, notched: true, endAdornment: children, sx: {
15
+ cursor: "default",
16
+ display: "flex",
17
+ flexWrap: "wrap",
18
+ gap: 1,
19
+ paddingX: 2,
20
+ paddingY: "7px",
21
+ width: fullWidth ? "100%" : "auto",
22
+ "& input": {
23
+ display: "none"
24
+ }
25
+ } })] }), helperText && (_jsx(FormHelperText, { sx: { marginLeft: 2, marginRight: 2 }, children: helperText }))] }));
29
26
  }
@@ -33,4 +33,4 @@ export type FileUploadButtonProps = ButtonProps<"label"> & {
33
33
  * @param props Props
34
34
  * @returns Component
35
35
  */
36
- export declare function FileUploadButton(props: FileUploadButtonProps): React.JSX.Element;
36
+ export declare function FileUploadButton(props: FileUploadButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { Button } from "@mui/material";
2
- import React from "react";
3
3
  /**
4
4
  * File upload button
5
5
  * @param props Props
@@ -10,36 +10,34 @@ export function FileUploadButton(props) {
10
10
  const { maxFiles, maxFileSize, inputProps, onFileInvalid, onUploadFiles, children, ...rest } = props;
11
11
  const { onChange } = inputProps ?? {};
12
12
  // Layout
13
- return (React.createElement(Button, { component: "label", ...rest },
14
- children,
15
- React.createElement("input", { type: "file", hidden: true, onChange: (event) => {
16
- if (onChange)
17
- onChange(event);
18
- if (event.isDefaultPrevented())
19
- return;
20
- if (onUploadFiles) {
21
- const files = event.target.files;
22
- if (files == null)
13
+ return (_jsxs(Button, { component: "label", ...rest, children: [children, _jsx("input", { type: "file", hidden: true, onChange: (event) => {
14
+ if (onChange)
15
+ onChange(event);
16
+ if (event.isDefaultPrevented())
23
17
  return;
24
- const fl = files.length;
25
- if (fl === 0)
26
- return;
27
- if (maxFiles && maxFiles > 0 && fl > maxFiles) {
28
- if (onFileInvalid)
29
- onFileInvalid([maxFiles, fl]);
30
- return;
31
- }
32
- if (maxFileSize && maxFileSize > 0) {
33
- for (let f = 0; f < fl; f++) {
34
- const file = files[f];
35
- if (file.size > maxFileSize) {
36
- if (onFileInvalid)
37
- onFileInvalid([maxFileSize, file.size], file);
38
- return;
18
+ if (onUploadFiles) {
19
+ const files = event.target.files;
20
+ if (files == null)
21
+ return;
22
+ const fl = files.length;
23
+ if (fl === 0)
24
+ return;
25
+ if (maxFiles && maxFiles > 0 && fl > maxFiles) {
26
+ if (onFileInvalid)
27
+ onFileInvalid([maxFiles, fl]);
28
+ return;
29
+ }
30
+ if (maxFileSize && maxFileSize > 0) {
31
+ for (let f = 0; f < fl; f++) {
32
+ const file = files[f];
33
+ if (file.size > maxFileSize) {
34
+ if (onFileInvalid)
35
+ onFileInvalid([maxFileSize, file.size], file);
36
+ return;
37
+ }
39
38
  }
40
39
  }
40
+ onUploadFiles(files);
41
41
  }
42
- onUploadFiles(files);
43
- }
44
- }, ...inputProps })));
42
+ }, ...inputProps })] }));
45
43
  }
package/lib/FlexBox.d.ts CHANGED
@@ -1,14 +1,13 @@
1
1
  import { StackProps } from '@mui/material';
2
- import React from 'react';
3
2
  /**
4
3
  * Horizonal box
5
4
  * @param props Props
6
5
  * @returns Component
7
6
  */
8
- export declare function HBox(props: Omit<StackProps, 'ref'>): React.JSX.Element;
7
+ export declare function HBox(props: Omit<StackProps, 'ref'>): import("react/jsx-runtime").JSX.Element;
9
8
  /**
10
9
  * Vertial box
11
10
  * @param props Props
12
11
  * @returns Component
13
12
  */
14
- export declare function VBox(props: Omit<StackProps, 'ref'>): React.JSX.Element;
13
+ export declare function VBox(props: Omit<StackProps, 'ref'>): import("react/jsx-runtime").JSX.Element;