@etsoo/materialui 1.6.43 → 1.6.45

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.
@@ -2,7 +2,7 @@ import { DataTypes, IdType } from "@etsoo/shared";
2
2
  import React from "react";
3
3
  import { CSSProperties, Theme } from "@mui/material/styles";
4
4
  import { useSortable } from "@dnd-kit/react/sortable";
5
- import { DragDropEvents } from "@dnd-kit/react";
5
+ import { DragDropEventHandlers } from "@dnd-kit/react";
6
6
  /**
7
7
  * DnD sortable item default style
8
8
  * @param index Item index
@@ -91,11 +91,11 @@ export type DnDSortableListProps<D extends object, E extends React.ElementType =
91
91
  /**
92
92
  * Drag start handler
93
93
  */
94
- onDragStart?: (items: D[], event: Parameters<DragDropEvents["dragstart"]>[0]) => void;
94
+ onDragStart?: (items: D[], event: Parameters<DragDropEventHandlers["onDragStart"]>[0]) => void;
95
95
  /**
96
96
  * Drag end handler
97
97
  */
98
- onDragEnd?: (items: D[], ...args: Parameters<DragDropEvents["dragend"]>) => void;
98
+ onDragEnd?: (items: D[], ...args: Parameters<DragDropEventHandlers["onDragEnd"]>) => void;
99
99
  };
100
100
  /**
101
101
  * DnD sortable list component
@@ -16,6 +16,10 @@ export type InputFieldProps = TextFieldProps & {
16
16
  * Is the field read only?
17
17
  */
18
18
  readOnly?: boolean;
19
+ /**
20
+ * Search case
21
+ */
22
+ search?: boolean;
19
23
  };
20
24
  /**
21
25
  * Input field
@@ -16,7 +16,7 @@ const TextField_1 = __importDefault(require("@mui/material/TextField"));
16
16
  */
17
17
  function InputField(props) {
18
18
  // Destruct
19
- const { slotProps, onChange, onChangeDelay, changeDelay = onChangeDelay ? [480] : undefined, readOnly, size = MUGlobal_1.MUGlobal.inputFieldSize, variant = MUGlobal_1.MUGlobal.inputFieldVariant, ...rest } = props;
19
+ const { slotProps, onChange, onChangeDelay, changeDelay = onChangeDelay ? [480] : undefined, readOnly, search = false, size = search ? MUGlobal_1.MUGlobal.searchFieldSize : MUGlobal_1.MUGlobal.inputFieldSize, variant = search ? MUGlobal_1.MUGlobal.searchFieldVariant : MUGlobal_1.MUGlobal.inputFieldVariant, ...rest } = props;
20
20
  // Slot props
21
21
  const { htmlInput, input, inputLabel, ...restSlotProps } = slotProps ?? {};
22
22
  const isMounted = react_2.default.useRef(true);
@@ -54,7 +54,9 @@ function InputField(props) {
54
54
  },
55
55
  input: { readOnly, ...input },
56
56
  inputLabel: {
57
- shrink: MUGlobal_1.MUGlobal.inputFieldShrink,
57
+ shrink: search
58
+ ? MUGlobal_1.MUGlobal.searchFieldShrink
59
+ : MUGlobal_1.MUGlobal.inputFieldShrink,
58
60
  ...inputLabel
59
61
  },
60
62
  ...restSlotProps
@@ -2,7 +2,7 @@ import { DataTypes, IdType } from "@etsoo/shared";
2
2
  import React from "react";
3
3
  import { CSSProperties, Theme } from "@mui/material/styles";
4
4
  import { useSortable } from "@dnd-kit/react/sortable";
5
- import { DragDropEvents } from "@dnd-kit/react";
5
+ import { DragDropEventHandlers } from "@dnd-kit/react";
6
6
  /**
7
7
  * DnD sortable item default style
8
8
  * @param index Item index
@@ -91,11 +91,11 @@ export type DnDSortableListProps<D extends object, E extends React.ElementType =
91
91
  /**
92
92
  * Drag start handler
93
93
  */
94
- onDragStart?: (items: D[], event: Parameters<DragDropEvents["dragstart"]>[0]) => void;
94
+ onDragStart?: (items: D[], event: Parameters<DragDropEventHandlers["onDragStart"]>[0]) => void;
95
95
  /**
96
96
  * Drag end handler
97
97
  */
98
- onDragEnd?: (items: D[], ...args: Parameters<DragDropEvents["dragend"]>) => void;
98
+ onDragEnd?: (items: D[], ...args: Parameters<DragDropEventHandlers["onDragEnd"]>) => void;
99
99
  };
100
100
  /**
101
101
  * DnD sortable list component
@@ -16,6 +16,10 @@ export type InputFieldProps = TextFieldProps & {
16
16
  * Is the field read only?
17
17
  */
18
18
  readOnly?: boolean;
19
+ /**
20
+ * Search case
21
+ */
22
+ search?: boolean;
19
23
  };
20
24
  /**
21
25
  * Input field
@@ -10,7 +10,7 @@ import TextField from "@mui/material/TextField";
10
10
  */
11
11
  export function InputField(props) {
12
12
  // Destruct
13
- const { slotProps, onChange, onChangeDelay, changeDelay = onChangeDelay ? [480] : undefined, readOnly, size = MUGlobal.inputFieldSize, variant = MUGlobal.inputFieldVariant, ...rest } = props;
13
+ const { slotProps, onChange, onChangeDelay, changeDelay = onChangeDelay ? [480] : undefined, readOnly, search = false, size = search ? MUGlobal.searchFieldSize : MUGlobal.inputFieldSize, variant = search ? MUGlobal.searchFieldVariant : MUGlobal.inputFieldVariant, ...rest } = props;
14
14
  // Slot props
15
15
  const { htmlInput, input, inputLabel, ...restSlotProps } = slotProps ?? {};
16
16
  const isMounted = React.useRef(true);
@@ -48,7 +48,9 @@ export function InputField(props) {
48
48
  },
49
49
  input: { readOnly, ...input },
50
50
  inputLabel: {
51
- shrink: MUGlobal.inputFieldShrink,
51
+ shrink: search
52
+ ? MUGlobal.searchFieldShrink
53
+ : MUGlobal.inputFieldShrink,
52
54
  ...inputLabel
53
55
  },
54
56
  ...restSlotProps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.6.43",
3
+ "version": "1.6.45",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -36,20 +36,20 @@
36
36
  },
37
37
  "homepage": "https://github.com/ETSOO/ReactMU#readme",
38
38
  "dependencies": {
39
- "@base-ui/react": "^1.3.0",
40
- "@dnd-kit/react": "^0.3.2",
39
+ "@base-ui/react": "^1.4.0",
40
+ "@dnd-kit/react": "^0.4.0",
41
41
  "@emotion/react": "^11.14.0",
42
42
  "@emotion/styled": "^11.14.1",
43
43
  "@etsoo/appscript": "^1.6.60",
44
44
  "@etsoo/notificationbase": "^1.1.69",
45
45
  "@etsoo/react": "^1.8.84",
46
- "@etsoo/shared": "^1.2.82",
46
+ "@etsoo/shared": "^1.2.83",
47
47
  "@mui/icons-material": "^9.0.0",
48
48
  "@mui/material": "^9.0.0",
49
49
  "@mui/x-data-grid": "^9.0.1",
50
50
  "chart.js": "^4.5.1",
51
51
  "chartjs-plugin-datalabels": "^2.2.0",
52
- "dompurify": "^3.3.3",
52
+ "dompurify": "^3.4.0",
53
53
  "eventemitter3": "^5.0.4",
54
54
  "pica": "^9.0.1",
55
55
  "pulltorefreshjs": "^0.1.22",
@@ -2,7 +2,7 @@ import { DataTypes, IdType } from "@etsoo/shared";
2
2
  import React from "react";
3
3
  import { CSSProperties, Theme, useTheme } from "@mui/material/styles";
4
4
  import { isSortableOperation, useSortable } from "@dnd-kit/react/sortable";
5
- import { DragDropEvents, DragDropProvider } from "@dnd-kit/react";
5
+ import { DragDropEventHandlers, DragDropProvider } from "@dnd-kit/react";
6
6
 
7
7
  /**
8
8
  * DnD sortable item default style
@@ -126,7 +126,7 @@ export type DnDSortableListProps<
126
126
  */
127
127
  onDragStart?: (
128
128
  items: D[],
129
- event: Parameters<DragDropEvents["dragstart"]>[0]
129
+ event: Parameters<DragDropEventHandlers["onDragStart"]>[0]
130
130
  ) => void;
131
131
 
132
132
  /**
@@ -134,7 +134,7 @@ export type DnDSortableListProps<
134
134
  */
135
135
  onDragEnd?: (
136
136
  items: D[],
137
- ...args: Parameters<DragDropEvents["dragend"]>
137
+ ...args: Parameters<DragDropEventHandlers["onDragEnd"]>
138
138
  ) => void;
139
139
  };
140
140
 
@@ -293,7 +293,9 @@ export function DnDSortableList<
293
293
  };
294
294
  }, [items, labelFn, changeItems]);
295
295
 
296
- function handleDragEnd(...args: Parameters<DragDropEvents["dragend"]>) {
296
+ function handleDragEnd(
297
+ ...args: Parameters<DragDropEventHandlers["onDragEnd"]>
298
+ ) {
297
299
  // Event
298
300
  const event = args[0];
299
301
 
@@ -23,6 +23,11 @@ export type InputFieldProps = TextFieldProps & {
23
23
  * Is the field read only?
24
24
  */
25
25
  readOnly?: boolean;
26
+
27
+ /**
28
+ * Search case
29
+ */
30
+ search?: boolean;
26
31
  };
27
32
 
28
33
  /**
@@ -38,8 +43,9 @@ export function InputField(props: InputFieldProps) {
38
43
  onChangeDelay,
39
44
  changeDelay = onChangeDelay ? [480] : undefined,
40
45
  readOnly,
41
- size = MUGlobal.inputFieldSize,
42
- variant = MUGlobal.inputFieldVariant,
46
+ search = false,
47
+ size = search ? MUGlobal.searchFieldSize : MUGlobal.inputFieldSize,
48
+ variant = search ? MUGlobal.searchFieldVariant : MUGlobal.inputFieldVariant,
43
49
  ...rest
44
50
  } = props;
45
51
 
@@ -90,7 +96,9 @@ export function InputField(props: InputFieldProps) {
90
96
  },
91
97
  input: { readOnly, ...input },
92
98
  inputLabel: {
93
- shrink: MUGlobal.inputFieldShrink,
99
+ shrink: search
100
+ ? MUGlobal.searchFieldShrink
101
+ : MUGlobal.inputFieldShrink,
94
102
  ...inputLabel
95
103
  },
96
104
  ...restSlotProps
@@ -3,7 +3,7 @@ import { InputField, InputFieldProps } from "./InputField";
3
3
  import { Currency } from "@etsoo/appscript";
4
4
  import { NumberUtils } from "@etsoo/shared";
5
5
  import InputAdornment from "@mui/material/InputAdornment";
6
- import { NumberFieldInput } from "@base-ui/react/number-field";
6
+ import { MUGlobal } from "./MUGlobal";
7
7
 
8
8
  /**
9
9
  * Number input field properties