@etsoo/materialui 1.3.42 → 1.3.43

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 (82) hide show
  1. package/__tests__/tsconfig.json +17 -17
  2. package/lib/AddresSelector.js +1 -2
  3. package/lib/AuditDisplay.js +2 -3
  4. package/lib/BridgeCloseButton.js +1 -2
  5. package/lib/ComboBox.js +5 -5
  6. package/lib/ComboBoxMultiple.js +7 -8
  7. package/lib/ComboBoxPro.js +1 -2
  8. package/lib/CultureDataTable.js +2 -2
  9. package/lib/DataGridEx.d.ts +2 -3
  10. package/lib/DataGridEx.js +12 -14
  11. package/lib/DataGridRenderers.js +6 -6
  12. package/lib/DataSteps.js +1 -2
  13. package/lib/DataTable.js +1 -2
  14. package/lib/DialogButton.js +2 -3
  15. package/lib/DnDList.js +1 -1
  16. package/lib/EmailInput.js +1 -2
  17. package/lib/FileUploadButton.js +1 -1
  18. package/lib/GridDataFormat.js +5 -5
  19. package/lib/GridUtils.js +1 -2
  20. package/lib/HiSelector.js +1 -1
  21. package/lib/HiSelectorTL.js +1 -1
  22. package/lib/InputField.js +4 -5
  23. package/lib/InputTipField.js +1 -1
  24. package/lib/ItemList.js +2 -3
  25. package/lib/ListChooser.js +4 -5
  26. package/lib/LoadingButton.js +1 -2
  27. package/lib/MaskInput.js +2 -3
  28. package/lib/NotifierMU.js +14 -19
  29. package/lib/OptionBool.js +1 -2
  30. package/lib/OptionGroup.js +3 -4
  31. package/lib/OptionGroupFlag.js +1 -1
  32. package/lib/QuickList.js +2 -2
  33. package/lib/ResponsibleContainer.d.ts +3 -3
  34. package/lib/ResponsibleContainer.js +3 -3
  35. package/lib/ScrollerListEx.d.ts +6 -7
  36. package/lib/ScrollerListEx.js +30 -36
  37. package/lib/SearchField.js +3 -4
  38. package/lib/SelectBool.js +1 -2
  39. package/lib/SelectEx.js +6 -8
  40. package/lib/ShowDataComparison.js +3 -4
  41. package/lib/Switch.js +1 -2
  42. package/lib/SwitchAnt.js +6 -7
  43. package/lib/TableEx.js +5 -7
  44. package/lib/TagList.js +3 -5
  45. package/lib/TagListPro.js +3 -5
  46. package/lib/TextFieldEx.js +2 -2
  47. package/lib/Tiplist.js +6 -8
  48. package/lib/TiplistPro.js +9 -10
  49. package/lib/TooltipClick.js +2 -2
  50. package/lib/TwoFieldInput.js +1 -1
  51. package/lib/UserAvatar.js +1 -2
  52. package/lib/UserAvatarEditor.js +4 -6
  53. package/lib/app/CommonApp.js +1 -1
  54. package/lib/app/ReactApp.js +4 -6
  55. package/lib/app/ServiceApp.js +5 -7
  56. package/lib/pages/DataGridPage.d.ts +2 -2
  57. package/lib/pages/DataGridPage.js +2 -3
  58. package/lib/pages/DataGridPageProps.d.ts +2 -2
  59. package/lib/pages/FixedListPage.d.ts +2 -2
  60. package/lib/pages/FixedListPage.js +2 -3
  61. package/lib/pages/LeftDrawer.js +2 -3
  62. package/lib/pages/ListPage.d.ts +2 -2
  63. package/lib/pages/ListPage.js +2 -3
  64. package/lib/pages/ListPageProps.d.ts +1 -1
  65. package/lib/pages/ResponsivePage.d.ts +2 -2
  66. package/lib/pages/ResponsivePage.js +1 -2
  67. package/lib/pages/ResponsivePageProps.d.ts +2 -2
  68. package/lib/pages/TablePage.js +3 -5
  69. package/lib/pages/UserMenu.js +1 -2
  70. package/lib/pages/ViewPage.js +6 -7
  71. package/package.json +14 -12
  72. package/src/DataGridEx.tsx +6 -12
  73. package/src/ResponsibleContainer.tsx +7 -9
  74. package/src/ScrollerListEx.tsx +301 -311
  75. package/src/pages/DataGridPage.tsx +4 -5
  76. package/src/pages/DataGridPageProps.ts +3 -4
  77. package/src/pages/FixedListPage.tsx +4 -5
  78. package/src/pages/ListPage.tsx +4 -5
  79. package/src/pages/ListPageProps.ts +2 -3
  80. package/src/pages/ResponsivePage.tsx +4 -5
  81. package/src/pages/ResponsivePageProps.ts +2 -3
  82. package/tsconfig.json +3 -3
@@ -21,10 +21,10 @@ export function ViewPageGridItem(props) {
21
21
  // Default options
22
22
  let options = {};
23
23
  if (gridProps.xs == null && gridProps.md == null) {
24
- options = getResp(singleRow !== null && singleRow !== void 0 ? singleRow : "small");
24
+ options = getResp(singleRow ?? "small");
25
25
  }
26
26
  else if (singleRow != null) {
27
- options = getResp(singleRow !== null && singleRow !== void 0 ? singleRow : "small");
27
+ options = getResp(singleRow ?? "small");
28
28
  }
29
29
  // Layout
30
30
  return (React.createElement(Grid, { item: true, ...gridProps, ...options },
@@ -60,13 +60,12 @@ function getResp(singleRow) {
60
60
  };
61
61
  }
62
62
  function getItemField(field, data) {
63
- var _a, _b, _c;
64
63
  // Item data and label
65
64
  let itemData, itemLabel, gridProps = {};
66
65
  if (Array.isArray(field)) {
67
66
  const [fieldData, fieldType, renderProps, singleRow = "small"] = field;
68
67
  itemData = GridDataFormat(data[fieldData], fieldType, renderProps);
69
- itemLabel = (_a = globalApp === null || globalApp === void 0 ? void 0 : globalApp.get(fieldData)) !== null && _a !== void 0 ? _a : fieldData;
68
+ itemLabel = globalApp?.get(fieldData) ?? fieldData;
70
69
  gridProps = { ...getResp(singleRow) };
71
70
  }
72
71
  else if (typeof field === "object") {
@@ -88,12 +87,12 @@ function getItemField(field, data) {
88
87
  typeof fieldLabel === "function"
89
88
  ? fieldLabel(data)
90
89
  : fieldLabel != null
91
- ? (_b = globalApp === null || globalApp === void 0 ? void 0 : globalApp.get(fieldLabel)) !== null && _b !== void 0 ? _b : fieldLabel
90
+ ? globalApp?.get(fieldLabel) ?? fieldLabel
92
91
  : fieldLabel;
93
92
  }
94
93
  else {
95
94
  itemData = formatItemData(data[field]);
96
- itemLabel = (_c = globalApp === null || globalApp === void 0 ? void 0 : globalApp.get(field)) !== null && _c !== void 0 ? _c : field;
95
+ itemLabel = globalApp?.get(field) ?? field;
97
96
  }
98
97
  return [itemData, itemLabel, gridProps];
99
98
  }
@@ -155,7 +154,7 @@ export function ViewPage(props) {
155
154
  Utils.getResult(children, data, refresh),
156
155
  pullToRefresh && (React.createElement(PullToRefreshUI, { mainElement: pullContainer, triggerElement: pullContainer, instructionsPullToRefresh: labels.pullToRefresh, instructionsReleaseToRefresh: labels.releaseToRefresh, instructionsRefreshing: labels.refreshing, onRefresh: refresh, shouldPullToRefresh: () => {
157
156
  const container = document.querySelector(pullContainer);
158
- return !(container === null || container === void 0 ? void 0 : container.scrollTop);
157
+ return !container?.scrollTop;
159
158
  } })),
160
159
  React.createElement(ScrollRestoration, null)))));
161
160
  }
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.3.42",
3
+ "version": "1.3.43",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
+ "type": "module",
6
7
  "types": "lib/index.d.ts",
7
8
  "scripts": {
8
9
  "build": "tsc",
@@ -50,19 +51,13 @@
50
51
  "@emotion/css": "^11.11.2",
51
52
  "@emotion/react": "^11.11.4",
52
53
  "@emotion/styled": "^11.11.0",
53
- "@etsoo/appscript": "^1.4.77",
54
- "@etsoo/notificationbase": "^1.1.35",
55
- "@etsoo/react": "^1.7.27",
56
- "@etsoo/shared": "^1.2.26",
54
+ "@etsoo/appscript": "^1.4.79",
55
+ "@etsoo/notificationbase": "^1.1.40",
56
+ "@etsoo/react": "^1.7.31",
57
+ "@etsoo/shared": "^1.2.31",
57
58
  "@mui/icons-material": "^5.15.11",
58
59
  "@mui/material": "^5.15.11",
59
- "@mui/x-data-grid": "^6.19.5",
60
- "@types/pica": "^9.0.4",
61
- "@types/pulltorefreshjs": "^0.1.7",
62
- "@types/react": "^18.2.60",
63
- "@types/react-avatar-editor": "^13.0.2",
64
- "@types/react-dom": "^18.2.19",
65
- "@types/react-input-mask": "^3.0.5",
60
+ "@mui/x-data-grid": "^6.19.6",
66
61
  "chart.js": "^4.4.2",
67
62
  "chartjs-plugin-datalabels": "^2.2.0",
68
63
  "eventemitter3": "^5.0.1",
@@ -86,6 +81,13 @@
86
81
  "@testing-library/jest-dom": "^6.4.2",
87
82
  "@testing-library/react": "^14.2.1",
88
83
  "@types/jest": "^29.5.12",
84
+ "@types/pica": "^9.0.4",
85
+ "@types/pulltorefreshjs": "^0.1.7",
86
+ "@types/react": "^18.2.61",
87
+ "@types/react-avatar-editor": "^13.0.2",
88
+ "@types/react-dom": "^18.2.19",
89
+ "@types/react-input-mask": "^3.0.5",
90
+ "@types/react-window": "^1.8.8",
89
91
  "@typescript-eslint/eslint-plugin": "^7.1.0",
90
92
  "@typescript-eslint/parser": "^7.1.0",
91
93
  "jest": "^29.7.0",
@@ -12,7 +12,7 @@ import {
12
12
  ScrollerGridProps,
13
13
  useCombinedRefs
14
14
  } from "@etsoo/react";
15
- import { DataTypes, IdDefaultType, Utils } from "@etsoo/shared";
15
+ import { DataTypes, Utils } from "@etsoo/shared";
16
16
  import {
17
17
  Box,
18
18
  BoxProps,
@@ -39,11 +39,8 @@ export type DataGridExFooterItemRendererProps<T extends object> = {
39
39
  /**
40
40
  * Extended DataGrid with VariableSizeGrid props
41
41
  */
42
- export type DataGridExProps<
43
- T extends object,
44
- D extends DataTypes.Keys<T>
45
- > = Omit<
46
- ScrollerGridProps<T, D>,
42
+ export type DataGridExProps<T extends object> = Omit<
43
+ ScrollerGridProps<T>,
47
44
  "itemRenderer" | "columnCount" | "columnWidth" | "width"
48
45
  > & {
49
46
  /**
@@ -216,10 +213,7 @@ export function DataGridExCalColumns<T>(columns: GridColumn<T>[]) {
216
213
  * @param props Props
217
214
  * @returns Component
218
215
  */
219
- export function DataGridEx<
220
- T extends object,
221
- D extends DataTypes.Keys<T> = IdDefaultType<T>
222
- >(props: DataGridExProps<T, D>) {
216
+ export function DataGridEx<T extends object>(props: DataGridExProps<T>) {
223
217
  // Theme
224
218
  const theme = useTheme();
225
219
 
@@ -367,7 +361,7 @@ export function DataGridEx<
367
361
  footerItemRenderer = DataGridRenderers.defaultFooterItemRenderer,
368
362
  hideFooter = false,
369
363
  hoverColor = "#f6f9fb",
370
- idField = "id" as D,
364
+ idField = "id" as DataTypes.Keys<T>,
371
365
  mRef = React.createRef(),
372
366
  onClick,
373
367
  onDoubleClick,
@@ -636,7 +630,7 @@ export function DataGridEx<
636
630
  : undefined;
637
631
 
638
632
  return (
639
- <ScrollerGrid<T, D>
633
+ <ScrollerGrid<T>
640
634
  className={Utils.mergeClasses(
641
635
  "DataGridEx-Body",
642
636
  "DataGridEx-CustomBar",
@@ -1,4 +1,4 @@
1
- import { DataTypes, IdDefaultType } from "@etsoo/shared";
1
+ import { DataTypes } from "@etsoo/shared";
2
2
  import { Box, Stack, SxProps, Theme } from "@mui/material";
3
3
  import React from "react";
4
4
  import {
@@ -39,10 +39,9 @@ import { GridUtils } from "./GridUtils";
39
39
  */
40
40
  export type ResponsibleContainerProps<
41
41
  T extends object,
42
- F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate,
43
- D extends DataTypes.Keys<T> = IdDefaultType<T>
42
+ F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate
44
43
  > = Omit<
45
- DataGridExProps<T, D>,
44
+ DataGridExProps<T>,
46
45
  | "height"
47
46
  | "itemKey"
48
47
  | "loadData"
@@ -190,9 +189,8 @@ function defaultContainerBoxSx(
190
189
  */
191
190
  export function ResponsibleContainer<
192
191
  T extends object,
193
- F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate,
194
- D extends DataTypes.Keys<T> = IdDefaultType<T>
195
- >(props: ResponsibleContainerProps<T, F, D>) {
192
+ F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate
193
+ >(props: ResponsibleContainerProps<T, F>) {
196
194
  // Destruct
197
195
  const {
198
196
  adjustHeight,
@@ -371,7 +369,7 @@ export function ResponsibleContainer<
371
369
 
372
370
  return [
373
371
  <Box className="DataGridBox">
374
- <DataGridEx<T, D>
372
+ <DataGridEx<T>
375
373
  autoLoad={!hasFields}
376
374
  height={heightLocal}
377
375
  width={rect.width}
@@ -404,7 +402,7 @@ export function ResponsibleContainer<
404
402
 
405
403
  return [
406
404
  <Box className="ListBox" sx={{ height: heightLocal }}>
407
- <ScrollerListEx<T, D>
405
+ <ScrollerListEx<T>
408
406
  autoLoad={!hasFields}
409
407
  height={heightLocal}
410
408
  loadData={localLoadData}