@etsoo/materialui 1.6.39 → 1.6.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/SwitchAnt.tsx +6 -7
- package/lib/cjs/ButtonPopupCheckbox.js +8 -3
- package/lib/cjs/ButtonPopupRadio.js +6 -2
- package/lib/cjs/ComboBox.js +7 -5
- package/lib/cjs/ComboBoxMultiple.js +5 -3
- package/lib/cjs/DataGridEx.js +25 -6
- package/lib/cjs/DataSteps.js +21 -11
- package/lib/cjs/FileUploadButton.js +5 -1
- package/lib/cjs/FlexBox.d.ts +2 -2
- package/lib/cjs/FlexBox.js +3 -2
- package/lib/cjs/InputField.js +3 -4
- package/lib/cjs/MoreFab.js +1 -1
- package/lib/cjs/NotifierMU.js +12 -5
- package/lib/cjs/OptionGroup.js +1 -1
- package/lib/cjs/OptionGroupFlag.js +1 -1
- package/lib/cjs/QuickList.js +3 -3
- package/lib/cjs/ResponsibleContainer.js +4 -1
- package/lib/cjs/SearchBar.js +9 -2
- package/lib/cjs/SearchField.js +8 -9
- package/lib/cjs/SwitchAnt.js +2 -2
- package/lib/cjs/SwitchField.js +1 -1
- package/lib/cjs/TextFieldEx.js +6 -11
- package/lib/cjs/Tiplist.js +2 -2
- package/lib/cjs/TiplistPro.js +1 -1
- package/lib/cjs/TwoFieldInput.d.ts +1 -1
- package/lib/cjs/TwoFieldInput.js +12 -7
- package/lib/cjs/UserAvatarEditor.js +8 -5
- package/lib/cjs/ViewContainer.js +2 -2
- package/lib/cjs/custom/CustomAttributeArea.js +2 -2
- package/lib/cjs/custom/CustomFieldViewer.js +3 -2
- package/lib/cjs/custom/CustomFieldWindow.js +2 -1
- package/lib/cjs/custom/FieldJson.js +1 -1
- package/lib/cjs/custom/FieldTexarea.js +1 -1
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/pages/EditPage.js +3 -1
- package/lib/cjs/pages/ViewPage.js +8 -2
- package/lib/mjs/ButtonPopupCheckbox.js +8 -3
- package/lib/mjs/ButtonPopupRadio.js +6 -2
- package/lib/mjs/ComboBox.js +7 -5
- package/lib/mjs/ComboBoxMultiple.js +5 -3
- package/lib/mjs/DataGridEx.js +25 -6
- package/lib/mjs/DataSteps.js +21 -11
- package/lib/mjs/FileUploadButton.js +5 -1
- package/lib/mjs/FlexBox.d.ts +2 -2
- package/lib/mjs/FlexBox.js +3 -2
- package/lib/mjs/InputField.js +3 -4
- package/lib/mjs/MoreFab.js +1 -1
- package/lib/mjs/NotifierMU.js +12 -5
- package/lib/mjs/OptionGroup.js +1 -1
- package/lib/mjs/OptionGroupFlag.js +1 -1
- package/lib/mjs/QuickList.js +3 -3
- package/lib/mjs/ResponsibleContainer.js +4 -1
- package/lib/mjs/SearchBar.js +9 -2
- package/lib/mjs/SearchField.js +8 -9
- package/lib/mjs/SwitchAnt.js +2 -2
- package/lib/mjs/SwitchField.js +1 -1
- package/lib/mjs/TextFieldEx.js +6 -11
- package/lib/mjs/Tiplist.js +2 -2
- package/lib/mjs/TiplistPro.js +1 -1
- package/lib/mjs/TwoFieldInput.d.ts +1 -1
- package/lib/mjs/TwoFieldInput.js +12 -7
- package/lib/mjs/UserAvatarEditor.js +8 -5
- package/lib/mjs/ViewContainer.js +2 -2
- package/lib/mjs/custom/CustomAttributeArea.js +2 -2
- package/lib/mjs/custom/CustomFieldViewer.js +3 -2
- package/lib/mjs/custom/CustomFieldWindow.js +2 -1
- package/lib/mjs/custom/FieldJson.js +1 -1
- package/lib/mjs/custom/FieldTexarea.js +1 -1
- package/lib/mjs/index.d.ts +1 -0
- package/lib/mjs/index.js +2 -0
- package/lib/mjs/pages/EditPage.js +3 -1
- package/lib/mjs/pages/ViewPage.js +8 -2
- package/package.json +14 -14
- package/src/ButtonPopupCheckbox.tsx +10 -8
- package/src/ButtonPopupRadio.tsx +8 -6
- package/src/ComboBox.tsx +7 -5
- package/src/ComboBoxMultiple.tsx +5 -3
- package/src/ComboBoxPro.tsx +1 -1
- package/src/CultureDataTable.tsx +1 -1
- package/src/DataGridEx.tsx +27 -20
- package/src/DataSteps.tsx +27 -22
- package/src/FileUploadButton.tsx +6 -5
- package/src/FlexBox.tsx +7 -7
- package/src/InputField.tsx +2 -5
- package/src/MoreFab.tsx +8 -8
- package/src/NotifierMU.tsx +12 -12
- package/src/NumberInputField.tsx +1 -0
- package/src/OptionGroup.tsx +3 -5
- package/src/OptionGroupFlag.tsx +3 -5
- package/src/QuickList.tsx +4 -4
- package/src/ResponsibleContainer.tsx +3 -3
- package/src/SearchBar.tsx +7 -7
- package/src/SearchField.tsx +8 -14
- package/src/SwitchAnt.tsx +2 -2
- package/src/SwitchField.tsx +1 -3
- package/src/TextFieldEx.tsx +32 -36
- package/src/Tiplist.tsx +2 -2
- package/src/TiplistPro.tsx +2 -2
- package/src/TwoFieldInput.tsx +33 -31
- package/src/UserAvatarEditor.tsx +15 -10
- package/src/ViewContainer.tsx +6 -2
- package/src/custom/CustomAttributeArea.tsx +3 -3
- package/src/custom/CustomFieldViewer.tsx +8 -3
- package/src/custom/CustomFieldWindow.tsx +4 -4
- package/src/custom/FieldJson.tsx +3 -3
- package/src/custom/FieldTexarea.tsx +1 -1
- package/src/index.ts +3 -0
- package/src/pages/EditPage.tsx +4 -5
- package/src/pages/ViewPage.tsx +11 -8
- package/tsconfig.cjs.json +1 -1
- package/tsconfig.json +2 -2
package/__tests__/SwitchAnt.tsx
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
2
|
+
import { act } from "react";
|
|
3
3
|
import { SwitchAnt } from "../src/SwitchAnt";
|
|
4
|
+
import { NumberFieldInput } from "@base-ui/react/number-field";
|
|
4
5
|
|
|
5
6
|
it("SwitchAnt Tests", () => {
|
|
6
|
-
const onChange = vi.fn(
|
|
7
|
-
expect(event.target.checked).toBeTruthy()
|
|
8
|
-
);
|
|
7
|
+
const onChange = vi.fn();
|
|
9
8
|
|
|
10
9
|
// Render component
|
|
11
10
|
act(() => {
|
|
12
11
|
render(<SwitchAnt startLabel="No" endLabel="Yes" onChange={onChange} />);
|
|
13
12
|
});
|
|
14
13
|
|
|
15
|
-
const
|
|
14
|
+
const control = screen.getByRole("switch");
|
|
16
15
|
|
|
17
16
|
act(() => {
|
|
18
|
-
|
|
17
|
+
fireEvent.click(control);
|
|
19
18
|
});
|
|
20
19
|
|
|
21
20
|
expect(onChange).toHaveBeenCalled();
|
|
@@ -40,19 +40,24 @@ function ButtonPopupList(props) {
|
|
|
40
40
|
// Set selected ids
|
|
41
41
|
setSelectedIdsHandler([...value]);
|
|
42
42
|
}, [value]);
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)(FlexBox_1.VBox, {
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)(FlexBox_1.VBox, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(DnDSortableList_1.DnDSortableList, { component: Grid_1.default, componentProps: { container: true, spacing: 0 }, items: items, labelField: labelField, onChange: (items) => {
|
|
44
44
|
const ids = items
|
|
45
45
|
.filter((item) => tempSelectedIds.current.includes(item.id))
|
|
46
46
|
.map((item) => item.id);
|
|
47
47
|
onValueChange(ids);
|
|
48
|
-
}, itemRenderer: (item, style, { sortable: { index }, ref, handleRef }) => ((0, jsx_runtime_1.jsxs)(Grid_1.default, { size: itemSize,
|
|
48
|
+
}, itemRenderer: (item, style, { sortable: { index }, ref, handleRef }) => ((0, jsx_runtime_1.jsxs)(Grid_1.default, { size: itemSize, spacing: 1, ref: ref, style: {
|
|
49
|
+
display: "flex",
|
|
50
|
+
alignItems: "center",
|
|
51
|
+
justifyContent: "flex-start",
|
|
52
|
+
...style
|
|
53
|
+
}, children: [(0, jsx_runtime_1.jsx)(IconButton_1.default, { style: { cursor: "move" }, size: "small", title: labels?.dragIndicator, ref: handleRef, children: (0, jsx_runtime_1.jsx)(DragIndicator_1.default, {}) }), (0, jsx_runtime_1.jsx)(FormControlLabel_1.default, { control: (0, jsx_runtime_1.jsx)(Checkbox_1.default, { name: "item", value: item.id, checked: selectedIds.includes(item.id), onChange: (e) => {
|
|
49
54
|
const checked = e.target.checked;
|
|
50
55
|
const newIds = [
|
|
51
56
|
...selectedIds.toggleItem(item.id, checked)
|
|
52
57
|
];
|
|
53
58
|
setSelectedIdsHandler(newIds);
|
|
54
59
|
onValueChange(newIds);
|
|
55
|
-
} }), label: `${index + 1}. ${labelFormatter(item)}` })] })), mRef: dndRef }), onAdd && ((0, jsx_runtime_1.jsxs)(FlexBox_1.HBox, {
|
|
60
|
+
} }), label: `${index + 1}. ${labelFormatter(item)}` })] })), mRef: dndRef }), onAdd && ((0, jsx_runtime_1.jsxs)(FlexBox_1.HBox, { spacing: 1, children: [(0, jsx_runtime_1.jsx)(TextField_1.default, { variant: "outlined", label: labels?.more, fullWidth: true, inputRef: inputRef }), (0, jsx_runtime_1.jsx)(Button_1.default, { sx: { width: "120px" }, variant: "contained", startIcon: (0, jsx_runtime_1.jsx)(Add_1.default, {}), size: "small", onClick: async () => {
|
|
56
61
|
if (inputRef.current == null)
|
|
57
62
|
return;
|
|
58
63
|
const input = inputRef.current.value.trim();
|
|
@@ -29,7 +29,7 @@ function ButtonPopupList(props) {
|
|
|
29
29
|
react_1.default.useEffect(() => {
|
|
30
30
|
setCurrentValue(value);
|
|
31
31
|
}, [value]);
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)(FlexBox_1.VBox, {
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(FlexBox_1.VBox, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(RadioGroup_1.default, { value: currentValue ?? "", name: "radio-buttons-group", onChange: (e, v) => {
|
|
33
33
|
const checked = e.target.checked;
|
|
34
34
|
const value = checked
|
|
35
35
|
? typeof items[0].id === "number"
|
|
@@ -38,7 +38,11 @@ function ButtonPopupList(props) {
|
|
|
38
38
|
: undefined;
|
|
39
39
|
setCurrentValue(value);
|
|
40
40
|
onValueChange(value);
|
|
41
|
-
}, children: (0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, spacing: 0, children: items.map((item) => ((0, jsx_runtime_1.jsx)(Grid_1.default, { size: itemSize,
|
|
41
|
+
}, children: (0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, spacing: 0, children: items.map((item) => ((0, jsx_runtime_1.jsx)(Grid_1.default, { size: itemSize, sx: {
|
|
42
|
+
display: "flex",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
justifyContent: "flex-start"
|
|
45
|
+
}, spacing: 1, children: (0, jsx_runtime_1.jsx)(FormControlLabel_1.default, { control: (0, jsx_runtime_1.jsx)(Radio_1.default, { value: item.id }), label: `${labelFormatter(item)}` }) }, item.id))) }) }), onAdd && ((0, jsx_runtime_1.jsxs)(FlexBox_1.HBox, { spacing: 1, children: [(0, jsx_runtime_1.jsx)(TextField_1.default, { variant: "outlined", label: labels?.more, fullWidth: true, inputRef: inputRef }), (0, jsx_runtime_1.jsx)(Button_1.default, { sx: { width: "120px" }, variant: "contained", startIcon: (0, jsx_runtime_1.jsx)(Add_1.default, {}), size: "small", onClick: async () => {
|
|
42
46
|
if (inputRef.current == null)
|
|
43
47
|
return;
|
|
44
48
|
const input = inputRef.current.value.trim();
|
package/lib/cjs/ComboBox.js
CHANGED
|
@@ -48,7 +48,7 @@ function ComboBox(props) {
|
|
|
48
48
|
// Local default value
|
|
49
49
|
const localValue = idValue != null
|
|
50
50
|
? localOptions.find((o) => o[idField] === idValue)
|
|
51
|
-
: defaultValue ?? value;
|
|
51
|
+
: (defaultValue ?? value);
|
|
52
52
|
// State
|
|
53
53
|
// null for controlled
|
|
54
54
|
const [stateValue, setStateValue] = react_1.default.useState(null);
|
|
@@ -65,9 +65,9 @@ function ComboBox(props) {
|
|
|
65
65
|
if (readOnly != null) {
|
|
66
66
|
Object.assign(params, { readOnly });
|
|
67
67
|
}
|
|
68
|
-
Object.assign(params.
|
|
68
|
+
Object.assign(params.slotProps.htmlInput, { "data-reset": inputReset });
|
|
69
69
|
if (dataReadonly) {
|
|
70
|
-
params.
|
|
70
|
+
params.slotProps.htmlInput.onKeyDown = (event) => {
|
|
71
71
|
if (shared_1.Keyboard.isTypingContent(event.key)) {
|
|
72
72
|
event.preventDefault();
|
|
73
73
|
}
|
|
@@ -75,7 +75,9 @@ function ComboBox(props) {
|
|
|
75
75
|
}
|
|
76
76
|
// https://stackoverflow.com/questions/15738259/disabling-chrome-autofill
|
|
77
77
|
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html
|
|
78
|
-
Object.assign(params.
|
|
78
|
+
Object.assign(params.slotProps.htmlInput, {
|
|
79
|
+
autoComplete: inputAutoComplete
|
|
80
|
+
});
|
|
79
81
|
return params;
|
|
80
82
|
};
|
|
81
83
|
const getValue = (value) => {
|
|
@@ -124,7 +126,7 @@ function ComboBox(props) {
|
|
|
124
126
|
};
|
|
125
127
|
}, []);
|
|
126
128
|
// Layout
|
|
127
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: { flex: 2 }, children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange, disabled: disabled }), (0, jsx_runtime_1.jsxs)(Stack_1.default, {
|
|
129
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { flex: 2 }, children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange, disabled: disabled }), (0, jsx_runtime_1.jsxs)(Stack_1.default, { spacing: 0.5, direction: "row", children: [(0, jsx_runtime_1.jsx)(Autocomplete_1.default, { value: stateValue, disabled: disabled, disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
|
|
128
130
|
// Set value
|
|
129
131
|
setInputValue(value);
|
|
130
132
|
// Custom
|
|
@@ -63,9 +63,9 @@ function ComboBoxMultiple(props) {
|
|
|
63
63
|
if (readOnly != null) {
|
|
64
64
|
Object.assign(params, { readOnly });
|
|
65
65
|
}
|
|
66
|
-
Object.assign(params.
|
|
66
|
+
Object.assign(params.slotProps.htmlInput, { "data-reset": inputReset });
|
|
67
67
|
if (dataReadonly) {
|
|
68
|
-
params.
|
|
68
|
+
params.slotProps.htmlInput.onKeyDown = (event) => {
|
|
69
69
|
if (shared_1.Keyboard.isTypingContent(event.key)) {
|
|
70
70
|
event.preventDefault();
|
|
71
71
|
}
|
|
@@ -73,7 +73,9 @@ function ComboBoxMultiple(props) {
|
|
|
73
73
|
}
|
|
74
74
|
// https://stackoverflow.com/questions/15738259/disabling-chrome-autofill
|
|
75
75
|
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html
|
|
76
|
-
Object.assign(params.
|
|
76
|
+
Object.assign(params.slotProps.htmlInput, {
|
|
77
|
+
autoComplete: inputAutoComplete
|
|
78
|
+
});
|
|
77
79
|
return params;
|
|
78
80
|
};
|
|
79
81
|
const getValue = (value) => {
|
package/lib/cjs/DataGridEx.js
CHANGED
|
@@ -88,7 +88,14 @@ function DataGridEx(props) {
|
|
|
88
88
|
const theme = (0, styles_1.useTheme)();
|
|
89
89
|
const defaultHeaderRenderer = (states) => {
|
|
90
90
|
const { orderBy } = states.queryPaging;
|
|
91
|
-
return ((0, jsx_runtime_1.jsx)(Box_1.default, { className: "DataGridEx-Header",
|
|
91
|
+
return ((0, jsx_runtime_1.jsx)(Box_1.default, { className: "DataGridEx-Header", sx: {
|
|
92
|
+
display: "flex",
|
|
93
|
+
alignItems: "center",
|
|
94
|
+
borderBottom: boldBorder,
|
|
95
|
+
fontWeight: 500,
|
|
96
|
+
minWidth: widthCalculator.total,
|
|
97
|
+
height: headerHeight
|
|
98
|
+
}, children: columns.map((column, index) => {
|
|
92
99
|
// Destruct
|
|
93
100
|
const { align, field, header, headerCellRenderer, sortable, sortAsc = true, type } = column;
|
|
94
101
|
// Header text
|
|
@@ -116,11 +123,21 @@ function DataGridEx(props) {
|
|
|
116
123
|
else {
|
|
117
124
|
sortLabel = headerText;
|
|
118
125
|
}
|
|
119
|
-
return ((0, jsx_runtime_1.jsx)(Box_1.default, {
|
|
126
|
+
return ((0, jsx_runtime_1.jsx)(Box_1.default, { sx: {
|
|
127
|
+
textAlign: (0, react_1.GridAlignGet)(align, type),
|
|
128
|
+
width: columnWidth(index)
|
|
129
|
+
}, children: (0, jsx_runtime_1.jsx)(Box_1.default, { className: "DataGridEx-Cell", onMouseEnter: handleMouseEnter, ...cellProps, children: sortLabel }) }, field ?? index.toString()));
|
|
120
130
|
}) }));
|
|
121
131
|
};
|
|
122
132
|
function defaultFooterRenderer(rows, states) {
|
|
123
|
-
return ((0, jsx_runtime_1.jsx)(Box_1.default, { className: "DataGridEx-Footer",
|
|
133
|
+
return ((0, jsx_runtime_1.jsx)(Box_1.default, { className: "DataGridEx-Footer", sx: {
|
|
134
|
+
display: "flex",
|
|
135
|
+
alignItems: "center",
|
|
136
|
+
borderTop: thinBorder,
|
|
137
|
+
marginTop: "1px",
|
|
138
|
+
minHeight: widthCalculator.total,
|
|
139
|
+
height: bottomHeight - 1
|
|
140
|
+
}, children: columns.map((column, index) => {
|
|
124
141
|
// Destruct
|
|
125
142
|
const { align, field, type } = column;
|
|
126
143
|
// Cell props
|
|
@@ -135,7 +152,10 @@ function DataGridEx(props) {
|
|
|
135
152
|
checkable
|
|
136
153
|
})
|
|
137
154
|
: undefined;
|
|
138
|
-
return ((0, jsx_runtime_1.jsx)(Box_1.default, {
|
|
155
|
+
return ((0, jsx_runtime_1.jsx)(Box_1.default, { sx: {
|
|
156
|
+
textAlign: (0, react_1.GridAlignGet)(align, type),
|
|
157
|
+
width: columnWidth(index)
|
|
158
|
+
}, children: (0, jsx_runtime_1.jsx)(Box_1.default, { className: "DataGridEx-Cell", onMouseEnter: handleMouseEnter, ...cellProps, children: cell }) }, "bottom-" + (field ?? index.toString())));
|
|
139
159
|
}) }));
|
|
140
160
|
}
|
|
141
161
|
// Destruct
|
|
@@ -294,8 +314,7 @@ function DataGridEx(props) {
|
|
|
294
314
|
: cellBoxStyle;
|
|
295
315
|
const cellProps = {
|
|
296
316
|
className: "DataGridEx-Cell",
|
|
297
|
-
textAlign: (0, react_1.GridAlignGet)(align, type),
|
|
298
|
-
sx: { ...boxStyle }
|
|
317
|
+
sx: { textAlign: (0, react_1.GridAlignGet)(align, type), ...boxStyle }
|
|
299
318
|
};
|
|
300
319
|
const child = cellRenderer({
|
|
301
320
|
data,
|
package/lib/cjs/DataSteps.js
CHANGED
|
@@ -29,9 +29,8 @@ function DataSteps(props) {
|
|
|
29
29
|
// Labels
|
|
30
30
|
const labels = app.getLabels("close", "nextStep", "previousStep", "submit");
|
|
31
31
|
// Destruct
|
|
32
|
-
const {
|
|
33
|
-
|
|
34
|
-
InputLabelProps.shrink ??= MUGlobal_1.MUGlobal.searchFieldShrink;
|
|
32
|
+
const { jsonValue, valueFormatter = (_data) => "...", onValueChange, steps, value = "", slotProps, ...rest } = props;
|
|
33
|
+
const { input, htmlInput, inputLabel, ...restSlotProps } = slotProps ?? {};
|
|
35
34
|
// Current index
|
|
36
35
|
const indexRef = react_1.default.useRef(-1);
|
|
37
36
|
// Current Json data
|
|
@@ -47,7 +46,12 @@ function DataSteps(props) {
|
|
|
47
46
|
const [{ callback, ...rest }, more] = steps(index, jsonRef.current);
|
|
48
47
|
app.showInputDialog({
|
|
49
48
|
...rest,
|
|
50
|
-
buttons: (n, callback) => ((0, jsx_runtime_1.jsxs)(FlexBox_1.HBox, {
|
|
49
|
+
buttons: (n, callback) => ((0, jsx_runtime_1.jsxs)(FlexBox_1.HBox, { spacing: 2, sx: {
|
|
50
|
+
justifyContent: "space-between",
|
|
51
|
+
paddingLeft: 2,
|
|
52
|
+
paddingRight: 2,
|
|
53
|
+
paddingBottom: 2
|
|
54
|
+
}, children: [index === 0 ? ((0, jsx_runtime_1.jsx)(Button_1.default, { variant: "outlined", startIcon: (0, jsx_runtime_1.jsx)(Close_1.default, {}), onClick: () => n.dismiss(), children: labels.close })) : ((0, jsx_runtime_1.jsx)(Button_1.default, { variant: "outlined", startIcon: (0, jsx_runtime_1.jsx)(NavigateBefore_1.default, {}), onClick: () => {
|
|
51
55
|
n.dismiss();
|
|
52
56
|
showStep(indexRef.current - 1);
|
|
53
57
|
}, children: labels.previousStep })), more ? ((0, jsx_runtime_1.jsx)(Button_1.default, { variant: "contained", startIcon: (0, jsx_runtime_1.jsx)(NavigateNext_1.default, {}), onClick: async (event) => {
|
|
@@ -81,13 +85,19 @@ function DataSteps(props) {
|
|
|
81
85
|
react_1.default.useEffect(() => {
|
|
82
86
|
setLocalValue(valueFormatter(jsonRef.current));
|
|
83
87
|
}, [valueFormatter]);
|
|
84
|
-
return ((0, jsx_runtime_1.jsx)(TextField_1.default, { autoComplete: "off",
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
return ((0, jsx_runtime_1.jsx)(TextField_1.default, { autoComplete: "off", slotProps: {
|
|
89
|
+
input: {
|
|
90
|
+
onKeyDown: (event) => {
|
|
91
|
+
if (event.key === "Tab")
|
|
92
|
+
return;
|
|
93
|
+
cancelInput(event);
|
|
94
|
+
},
|
|
95
|
+
onPaste: cancelInput,
|
|
96
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(InputAdornment_1.default, { position: "end", children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { edge: "end", size: "small", children: (0, jsx_runtime_1.jsx)(Start_1.default, {}) }) })),
|
|
97
|
+
...input
|
|
89
98
|
},
|
|
90
|
-
|
|
91
|
-
|
|
99
|
+
htmlInput: { style: { cursor: "pointer" }, ...htmlInput },
|
|
100
|
+
inputLabel: { shrink: MUGlobal_1.MUGlobal.searchFieldShrink, ...inputLabel },
|
|
101
|
+
...restSlotProps
|
|
92
102
|
}, onClick: () => showStep(0), value: localValue, ...rest }));
|
|
93
103
|
}
|
|
@@ -51,7 +51,11 @@ function FileUploadButton(props) {
|
|
|
51
51
|
onUploadFiles(files);
|
|
52
52
|
};
|
|
53
53
|
// Layout
|
|
54
|
-
return ((0, jsx_runtime_1.jsxs)(FlexBox_1.HBox, {
|
|
54
|
+
return ((0, jsx_runtime_1.jsxs)(FlexBox_1.HBox, { sx: {
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
flexWrap: "wrap",
|
|
57
|
+
border: (theme) => dragOver ? "1px dashed " + theme.palette.warning.main : undefined
|
|
58
|
+
}, spacing: 0.5, ...(dropFilesLabel == null
|
|
55
59
|
? undefined
|
|
56
60
|
: {
|
|
57
61
|
onDrop: handleDrop,
|
package/lib/cjs/FlexBox.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { StackProps } from "@mui/material/Stack";
|
|
|
4
4
|
* @param props Props
|
|
5
5
|
* @returns Component
|
|
6
6
|
*/
|
|
7
|
-
export declare function HBox(props: Omit<StackProps, "ref">): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function HBox(props: Omit<StackProps, "ref" | "direction">): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
/**
|
|
9
9
|
* Horizonal box with list items
|
|
10
10
|
* @param props Props
|
|
@@ -16,4 +16,4 @@ export declare function HBoxList(props: Omit<StackProps, "direction">): import("
|
|
|
16
16
|
* @param props Props
|
|
17
17
|
* @returns Component
|
|
18
18
|
*/
|
|
19
|
-
export declare function VBox(props: Omit<StackProps, "ref">): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function VBox(props: Omit<StackProps, "ref" | "direction">): import("react/jsx-runtime").JSX.Element;
|
package/lib/cjs/FlexBox.js
CHANGED
|
@@ -14,7 +14,7 @@ const Stack_1 = __importDefault(require("@mui/material/Stack"));
|
|
|
14
14
|
* @returns Component
|
|
15
15
|
*/
|
|
16
16
|
function HBox(props) {
|
|
17
|
-
return (0, jsx_runtime_1.jsx)(Stack_1.default, { direction: "row",
|
|
17
|
+
return (0, jsx_runtime_1.jsx)(Stack_1.default, { direction: "row", ...props });
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Horizonal box with list items
|
|
@@ -22,7 +22,8 @@ function HBox(props) {
|
|
|
22
22
|
* @returns Component
|
|
23
23
|
*/
|
|
24
24
|
function HBoxList(props) {
|
|
25
|
-
|
|
25
|
+
const { sx, ...rest } = props;
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(Stack_1.default, { spacing: 1, direction: "row", sx: { flexWrap: "wrap", ...sx }, ...rest }));
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
29
|
* Vertial box
|
package/lib/cjs/InputField.js
CHANGED
|
@@ -16,7 +16,7 @@ const TextField_1 = __importDefault(require("@mui/material/TextField"));
|
|
|
16
16
|
*/
|
|
17
17
|
function InputField(props) {
|
|
18
18
|
// Destruct
|
|
19
|
-
const {
|
|
19
|
+
const { slotProps, onChange, onChangeDelay, changeDelay = onChangeDelay ? [480] : undefined, readOnly, size = MUGlobal_1.MUGlobal.inputFieldSize, variant = 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);
|
|
@@ -50,10 +50,9 @@ function InputField(props) {
|
|
|
50
50
|
return ((0, jsx_runtime_1.jsx)(TextField_1.default, { slotProps: {
|
|
51
51
|
htmlInput: {
|
|
52
52
|
["data-min-chars"]: changeDelay?.[1],
|
|
53
|
-
...htmlInput
|
|
54
|
-
...inputProps
|
|
53
|
+
...htmlInput
|
|
55
54
|
},
|
|
56
|
-
input: { readOnly, ...input
|
|
55
|
+
input: { readOnly, ...input },
|
|
57
56
|
inputLabel: {
|
|
58
57
|
shrink: MUGlobal_1.MUGlobal.inputFieldShrink,
|
|
59
58
|
...inputLabel
|
package/lib/cjs/MoreFab.js
CHANGED
|
@@ -86,7 +86,7 @@ function MoreFab(props) {
|
|
|
86
86
|
const hasIcon = actionsLocal.some((action) => action.icon != null);
|
|
87
87
|
// Main
|
|
88
88
|
const main = iconButton ? ((0, jsx_runtime_1.jsx)(IconButton_1.default, { color: color, size: size, title: title, onClick: handleClick, children: icon })) : ((0, jsx_runtime_1.jsx)(Fab_1.default, { color: color, size: size, title: title, onClick: handleClick, children: icon }));
|
|
89
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [main, (0, jsx_runtime_1.jsx)(Menu_1.default, { disableScrollLock: true, anchorEl: anchorEl, anchorOrigin: anchorOrigin, keepMounted: true, transformOrigin: transformOrigin, open: open, onClose: handleClose,
|
|
89
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [main, (0, jsx_runtime_1.jsx)(Menu_1.default, { disableScrollLock: true, anchorEl: anchorEl, anchorOrigin: anchorOrigin, keepMounted: true, transformOrigin: transformOrigin, open: open, onClose: handleClose, slotProps: { paper: PaperProps }, children: actionsLocal.map(({ label, icon, action }, index) => label === "-" ? ((0, jsx_runtime_1.jsx)(Divider_1.default, {}, index)) : ((0, jsx_runtime_1.jsxs)(MenuItem_1.default, { ...(typeof action === "string"
|
|
90
90
|
? action.includes("://")
|
|
91
91
|
? {
|
|
92
92
|
component: "a",
|
package/lib/cjs/NotifierMU.js
CHANGED
|
@@ -183,7 +183,7 @@ class NotificationMU extends react_2.NotificationReact {
|
|
|
183
183
|
this.dismiss();
|
|
184
184
|
return true;
|
|
185
185
|
};
|
|
186
|
-
return ((0, jsx_runtime_1.jsxs)(Dialog_1.default, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent_1.DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: draggable ? "dialog-title draggable-dialog-title" : "dialog-title", children: [(0, jsx_runtime_1.jsx)(Info_1.default, { color: "primary" }), (0, jsx_runtime_1.jsx)("span", { className: "dialogTitle", children: title }), closable && ((0, jsx_runtime_1.jsx)(IconButton_1.default, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) }))] }), (0, jsx_runtime_1.jsxs)(DialogContent_1.default, { ...inputProps, children: [content, (0, jsx_runtime_1.jsx)(Typography_1.default, {
|
|
186
|
+
return ((0, jsx_runtime_1.jsxs)(Dialog_1.default, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent_1.DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: draggable ? "dialog-title draggable-dialog-title" : "dialog-title", children: [(0, jsx_runtime_1.jsx)(Info_1.default, { color: "primary" }), (0, jsx_runtime_1.jsx)("span", { className: "dialogTitle", children: title }), closable && ((0, jsx_runtime_1.jsx)(IconButton_1.default, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) }))] }), (0, jsx_runtime_1.jsxs)(DialogContent_1.default, { ...inputProps, children: [content, (0, jsx_runtime_1.jsx)(Typography_1.default, { component: "div", variant: "caption", ref: errorRef, color: "error" })] }), (0, jsx_runtime_1.jsx)(DialogActions_1.default, { children: buttons ? (buttons(this, handleSubmit)) : ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [cancelButton && ((0, jsx_runtime_1.jsx)(Button_1.default, { color: "secondary", onClick: () => {
|
|
187
187
|
if (this.onReturn)
|
|
188
188
|
this.onReturn(undefined);
|
|
189
189
|
this.dismiss();
|
|
@@ -269,7 +269,7 @@ class NotificationMU extends react_2.NotificationReact {
|
|
|
269
269
|
return false;
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
}, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: draggable ? "dialog-title draggable-dialog-title" : "dialog-title", children: [(0, jsx_runtime_1.jsx)(Info_1.default, { color: "primary" }), (0, jsx_runtime_1.jsx)("span", { className: "dialogTitle", children: title }), closable && ((0, jsx_runtime_1.jsx)(IconButton_1.default, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) }))] }), (0, jsx_runtime_1.jsxs)(DialogContent_1.default, { dividers: true, children: [typeof this.content === "string" ? ((0, jsx_runtime_1.jsx)(DialogContentText_1.default, { children: this.content })) : (this.content), localInputs, (0, jsx_runtime_1.jsx)(Typography_1.default, {
|
|
272
|
+
}, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: draggable ? "dialog-title draggable-dialog-title" : "dialog-title", children: [(0, jsx_runtime_1.jsx)(Info_1.default, { color: "primary" }), (0, jsx_runtime_1.jsx)("span", { className: "dialogTitle", children: title }), closable && ((0, jsx_runtime_1.jsx)(IconButton_1.default, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) }))] }), (0, jsx_runtime_1.jsxs)(DialogContent_1.default, { dividers: true, children: [typeof this.content === "string" ? ((0, jsx_runtime_1.jsx)(DialogContentText_1.default, { children: this.content })) : (this.content), localInputs, (0, jsx_runtime_1.jsx)(Typography_1.default, { component: "div", variant: "caption", ref: errorRef, color: "error" })] }), (0, jsx_runtime_1.jsx)(DialogActions_1.default, { children: buttons ? (buttons(this, handleSubmit)) : ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [cancelButton && ((0, jsx_runtime_1.jsx)(Button_1.default, { color: "secondary", onClick: () => {
|
|
273
273
|
if (this.onReturn)
|
|
274
274
|
this.onReturn(undefined);
|
|
275
275
|
this.dismiss();
|
|
@@ -299,11 +299,15 @@ class NotificationMU extends react_2.NotificationReact {
|
|
|
299
299
|
return ((0, jsx_runtime_1.jsx)(Backdrop_1.default, { className: className, sx: {
|
|
300
300
|
color: "#fff",
|
|
301
301
|
zIndex: (theme) => theme.zIndex.modal + 1
|
|
302
|
-
}, open: this.open, ...options, children: (0, jsx_runtime_1.jsxs)(Box_1.default, {
|
|
302
|
+
}, open: this.open, ...options, children: (0, jsx_runtime_1.jsxs)(Box_1.default, { sx: {
|
|
303
|
+
display: "flex",
|
|
304
|
+
flexDirection: "column",
|
|
305
|
+
flexWrap: "nowrap",
|
|
306
|
+
alignItems: "center",
|
|
303
307
|
"& > :not(style) + :not(style)": {
|
|
304
308
|
marginTop: (theme) => theme.spacing(1)
|
|
305
309
|
}
|
|
306
|
-
}, children: [(0, jsx_runtime_1.jsx)(CircularProgress_1.default, { ...setupProps }), content && ((0, jsx_runtime_1.jsx)(Box_1.default, { maxWidth: maxWidth === false ? undefined : maxWidth, children: content }))] }) }, this.id));
|
|
310
|
+
}, children: [(0, jsx_runtime_1.jsx)(CircularProgress_1.default, { ...setupProps }), content && ((0, jsx_runtime_1.jsx)(Box_1.default, { sx: { maxWidth: maxWidth === false ? undefined : maxWidth }, children: content }))] }) }, this.id));
|
|
307
311
|
}
|
|
308
312
|
/**
|
|
309
313
|
* Render method
|
|
@@ -421,7 +425,10 @@ class NotifierMU extends react_2.NotifierReact {
|
|
|
421
425
|
// Use SnackBar for layout
|
|
422
426
|
return ((0, jsx_runtime_1.jsx)(Snackbar_1.default, { anchorOrigin: NotifierMU.getOrigin(align), className: className, sx: align === notificationbase_1.NotificationAlign.Center
|
|
423
427
|
? { position: "fixed", top: "50%!important" }
|
|
424
|
-
: undefined, open: true, children: (0, jsx_runtime_1.jsx)(Box_1.default, {
|
|
428
|
+
: undefined, open: true, children: (0, jsx_runtime_1.jsx)(Box_1.default, { sx: {
|
|
429
|
+
display: "flex",
|
|
430
|
+
flexDirection: "column",
|
|
431
|
+
flexWrap: "nowrap",
|
|
425
432
|
"& > :not(style) + :not(style)": {
|
|
426
433
|
marginTop: (theme) => theme.spacing(1)
|
|
427
434
|
}
|
package/lib/cjs/OptionGroup.js
CHANGED
|
@@ -112,5 +112,5 @@ function OptionGroup(props) {
|
|
|
112
112
|
"& input": {
|
|
113
113
|
display: "none"
|
|
114
114
|
}
|
|
115
|
-
} })) : ((0, jsx_runtime_1.jsx)(Box_1.default, { paddingLeft: 2, paddingY: "7px", children: group }))] }), helperText && ((0, jsx_runtime_1.jsx)(FormHelperText_1.default, { sx: { marginLeft: 2, marginRight: 2 }, children: helperText }))] }));
|
|
115
|
+
} })) : ((0, jsx_runtime_1.jsx)(Box_1.default, { sx: { paddingLeft: 2, paddingY: "7px" }, children: group }))] }), helperText && ((0, jsx_runtime_1.jsx)(FormHelperText_1.default, { sx: { marginLeft: 2, marginRight: 2 }, children: helperText }))] }));
|
|
116
116
|
}
|
|
@@ -94,5 +94,5 @@ function OptionGroupFlag(props) {
|
|
|
94
94
|
"& input": {
|
|
95
95
|
display: "none"
|
|
96
96
|
}
|
|
97
|
-
} })) : ((0, jsx_runtime_1.jsx)(Box_1.default, { paddingLeft: 2, paddingY: "7px", children: group }))] }), helperText && ((0, jsx_runtime_1.jsx)(FormHelperText_1.default, { sx: { marginLeft: 2, marginRight: 2 }, children: helperText }))] }));
|
|
97
|
+
} })) : ((0, jsx_runtime_1.jsx)(Box_1.default, { sx: { paddingLeft: 2, paddingY: "7px" }, children: group }))] }), helperText && ((0, jsx_runtime_1.jsx)(FormHelperText_1.default, { sx: { marginLeft: 2, marginRight: 2 }, children: helperText }))] }));
|
|
98
98
|
}
|
package/lib/cjs/QuickList.js
CHANGED
|
@@ -24,7 +24,7 @@ function QuickList(props) {
|
|
|
24
24
|
// Global app
|
|
25
25
|
const app = (0, ReactApp_1.useAppContext)();
|
|
26
26
|
// Destruct
|
|
27
|
-
const { buttonProps = {}, label, inputProps, itemLabel = shared_1.DataTypes.getListItemLabel, itemRenderer = (item) => itemLabel(item), itemProps, loadData, noMatchesLabel = app?.get("noMatches"),
|
|
27
|
+
const { buttonProps = {}, label, inputProps, itemLabel = shared_1.DataTypes.getListItemLabel, itemRenderer = (item) => itemLabel(item), itemProps, loadData, noMatchesLabel = app?.get("noMatches"), spacing = 1, onItemClick, sx, ...rest } = props;
|
|
28
28
|
const { onClick, ...buttonRest } = buttonProps;
|
|
29
29
|
// States
|
|
30
30
|
const [loading, setLoading] = react_1.default.useState(false);
|
|
@@ -40,12 +40,12 @@ function QuickList(props) {
|
|
|
40
40
|
loadDataLocal();
|
|
41
41
|
}, []);
|
|
42
42
|
// Layout
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)(FlexBox_1.VBox, {
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)(FlexBox_1.VBox, { spacing: spacing, sx: { height: "480px", ...sx }, ...rest, children: [(0, jsx_runtime_1.jsx)(InputField_1.InputField, { label: label, onChangeDelay: (event) => {
|
|
44
44
|
// Stop bubble
|
|
45
45
|
event.preventDefault();
|
|
46
46
|
event.stopPropagation();
|
|
47
47
|
loadDataLocal(event.target.value);
|
|
48
|
-
}, fullWidth: true, ...inputProps }), loading ? ((0, jsx_runtime_1.jsx)(LinearProgress_1.default, {})) : items.length === 0 ? ((0, jsx_runtime_1.jsx)(Typography_1.default, {
|
|
48
|
+
}, fullWidth: true, ...inputProps }), loading ? ((0, jsx_runtime_1.jsx)(LinearProgress_1.default, {})) : items.length === 0 ? ((0, jsx_runtime_1.jsx)(Typography_1.default, { align: "center", children: noMatchesLabel })) : ((0, jsx_runtime_1.jsx)(List_1.default, { children: items.map((item) => ((0, jsx_runtime_1.jsx)(ListItem_1.default, { disablePadding: true, ...itemProps, children: (0, jsx_runtime_1.jsx)(ListItemButton_1.default, { onClick: (event) => {
|
|
49
49
|
if (onClick)
|
|
50
50
|
onClick(event);
|
|
51
51
|
if (!event.defaultPrevented && onItemClick)
|
|
@@ -147,8 +147,11 @@ function ResponsibleContainer(props) {
|
|
|
147
147
|
return ((0, jsx_runtime_1.jsxs)(Box_1.default, { sx: containerBoxSx == null
|
|
148
148
|
? undefined
|
|
149
149
|
: containerBoxSx(paddings, hasFields, showDataGrid), children: [(0, jsx_runtime_1.jsxs)(Stack_1.default, { children: [(0, jsx_runtime_1.jsx)(Box_1.default, { ref: dimensions[0][0], className: "SearchBox", sx: {
|
|
150
|
+
marginBottom: hasFields
|
|
151
|
+
? `${searchBarBottom}px!important`
|
|
152
|
+
: undefined,
|
|
150
153
|
height: hasFields ? searchBarHeight : 0
|
|
151
|
-
},
|
|
154
|
+
}, children: searchBar }), list] }), pullToRefresh && pullContainer && list != null && ((0, jsx_runtime_1.jsx)(PullToRefreshUI_1.PullToRefreshUI, { mainElement: pullContainer, triggerElement: pullContainer, instructionsPullToRefresh: labels.pullToRefresh, instructionsReleaseToRefresh: labels.releaseToRefresh, instructionsRefreshing: labels.refreshing, onRefresh: () => state.ref?.reset(), shouldPullToRefresh: () => {
|
|
152
155
|
const container = document.querySelector(pullContainer);
|
|
153
156
|
return !container?.scrollTop;
|
|
154
157
|
} }))] }));
|
package/lib/cjs/SearchBar.js
CHANGED
|
@@ -248,7 +248,12 @@ function SearchBar(props) {
|
|
|
248
248
|
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)("form", { id: "SearchBarForm", className: className, onChange: handleForm, ref: (form) => {
|
|
249
249
|
if (form)
|
|
250
250
|
state.form = form;
|
|
251
|
-
}, children: (0, jsx_runtime_1.jsxs)(Stack_1.default, { ref: dimensions[0][0], className: "SearchBarContainer",
|
|
251
|
+
}, children: (0, jsx_runtime_1.jsxs)(Stack_1.default, { ref: dimensions[0][0], className: "SearchBarContainer", direction: "row", spacing: `${itemGap}px`, sx: {
|
|
252
|
+
alignItems: "center",
|
|
253
|
+
justifyContent: "center",
|
|
254
|
+
width,
|
|
255
|
+
overflow: "hidden",
|
|
256
|
+
paddingTop: "6px",
|
|
252
257
|
"& > :not(style)": {
|
|
253
258
|
flexBasis: "auto",
|
|
254
259
|
flexGrow: 0,
|
|
@@ -271,7 +276,9 @@ function SearchBar(props) {
|
|
|
271
276
|
}, open: open, onClose: () => updateOpen(false), children: [top === true && (0, jsx_runtime_1.jsx)(Toolbar_1.default, {}), (0, jsx_runtime_1.jsx)("form", { onChange: moreFormChange, ref: (form) => {
|
|
272
277
|
if (form)
|
|
273
278
|
state.moreForm = form;
|
|
274
|
-
}, children: (0, jsx_runtime_1.jsx)(Stack_1.default, { direction: "column",
|
|
279
|
+
}, children: (0, jsx_runtime_1.jsx)(Stack_1.default, { direction: "column", spacing: 2, sx: {
|
|
280
|
+
padding: 2,
|
|
281
|
+
alignItems: "stretch",
|
|
275
282
|
"& > :not(style)": {
|
|
276
283
|
minWidth: "100px"
|
|
277
284
|
}
|
package/lib/cjs/SearchField.js
CHANGED
|
@@ -16,14 +16,8 @@ const TextField_1 = __importDefault(require("@mui/material/TextField"));
|
|
|
16
16
|
*/
|
|
17
17
|
function SearchField(props) {
|
|
18
18
|
// Destruct
|
|
19
|
-
const { changeDelay,
|
|
20
|
-
|
|
21
|
-
InputLabelProps.shrink ??= MUGlobal_1.MUGlobal.searchFieldShrink;
|
|
22
|
-
// Read only
|
|
23
|
-
if (readOnly != null)
|
|
24
|
-
InputProps.readOnly = readOnly;
|
|
25
|
-
// Min characters
|
|
26
|
-
inputProps["data-min-chars"] = minChars;
|
|
19
|
+
const { changeDelay, onChange, readOnly, size = MUGlobal_1.MUGlobal.searchFieldSize, variant = MUGlobal_1.MUGlobal.searchFieldVariant, minChars = 0, slotProps, ...rest } = props;
|
|
20
|
+
const { input, inputLabel, htmlInput, ...restSlotProps } = slotProps ?? {};
|
|
27
21
|
const isMounted = react_2.default.useRef(true);
|
|
28
22
|
const delayed = onChange != null && changeDelay != null && changeDelay >= 1
|
|
29
23
|
? (0, react_1.useDelayedExecutor)(onChange, changeDelay)
|
|
@@ -52,5 +46,10 @@ function SearchField(props) {
|
|
|
52
46
|
};
|
|
53
47
|
}, []);
|
|
54
48
|
// Layout
|
|
55
|
-
return ((0, jsx_runtime_1.jsx)(TextField_1.default, {
|
|
49
|
+
return ((0, jsx_runtime_1.jsx)(TextField_1.default, { onChange: onChangeEx, size: size, variant: variant, slotProps: {
|
|
50
|
+
input: { readOnly, ...input },
|
|
51
|
+
inputLabel: { shrink: MUGlobal_1.MUGlobal.searchFieldShrink, ...inputLabel },
|
|
52
|
+
htmlInput: { ["data-min-chars"]: minChars, ...htmlInput },
|
|
53
|
+
...restSlotProps
|
|
54
|
+
}, ...rest }));
|
|
56
55
|
}
|
package/lib/cjs/SwitchAnt.js
CHANGED
|
@@ -37,12 +37,12 @@ function SwitchAnt(props) {
|
|
|
37
37
|
setControlChecked(checked);
|
|
38
38
|
};
|
|
39
39
|
// Layout
|
|
40
|
-
return ((0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", spacing: 1, alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { onClick: () => controlChecked && ref.current?.click(), sx: {
|
|
40
|
+
return ((0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", spacing: 1, sx: { alignItems: "center" }, children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { onClick: () => controlChecked && ref.current?.click(), sx: {
|
|
41
41
|
cursor: "pointer",
|
|
42
42
|
color: controlChecked
|
|
43
43
|
? undefined
|
|
44
44
|
: (theme) => activeColor ?? theme.palette.warning.main
|
|
45
|
-
}, children: startLabel }), (0, jsx_runtime_1.jsx)(Switch_1.default, { checked: controlChecked,
|
|
45
|
+
}, children: startLabel }), (0, jsx_runtime_1.jsx)(Switch_1.default, { checked: controlChecked, ref: ref, value: value, onChange: onChangeLocal, ...rest }), (0, jsx_runtime_1.jsx)(Typography_1.default, { onClick: () => !controlChecked && ref.current?.click(), sx: {
|
|
46
46
|
cursor: "pointer",
|
|
47
47
|
color: controlChecked
|
|
48
48
|
? (theme) => activeColor ?? theme.palette.warning.main
|
package/lib/cjs/SwitchField.js
CHANGED
|
@@ -35,5 +35,5 @@ function SwitchField(props) {
|
|
|
35
35
|
"& input": {
|
|
36
36
|
display: "none"
|
|
37
37
|
}
|
|
38
|
-
} })) : ((0, jsx_runtime_1.jsx)(Box_1.default, { paddingLeft: 2, paddingY: "7px", children: group }))] }), helperText && (0, jsx_runtime_1.jsx)(FormHelperText_1.default, { children: helperText })] }));
|
|
38
|
+
} })) : ((0, jsx_runtime_1.jsx)(Box_1.default, { sx: { paddingLeft: 2, paddingY: "7px" }, children: group }))] }), helperText && (0, jsx_runtime_1.jsx)(FormHelperText_1.default, { children: helperText })] }));
|
|
39
39
|
}
|
package/lib/cjs/TextFieldEx.js
CHANGED
|
@@ -21,17 +21,12 @@ function TextFieldEx(props) {
|
|
|
21
21
|
// Labels
|
|
22
22
|
const { showIt, clearInput } = app?.getLabels("showIt", "clearInput") ?? {};
|
|
23
23
|
// Destructure
|
|
24
|
-
const { changeDelay, clearLabel = clearInput, error, fullWidth = true, helperText,
|
|
24
|
+
const { changeDelay, clearLabel = clearInput, error, fullWidth = true, helperText, slotProps, onChange, onClear, onKeyDown, onEnter, onVisibility, inputRef, readOnly, showClear, showPassword, type, variant = MUGlobal_1.MUGlobal.textFieldVariant, mRef, ...rest } = props;
|
|
25
25
|
// Slot props
|
|
26
26
|
const { input, inputLabel, ...restSlotProps } = slotProps ?? {};
|
|
27
|
-
// Shrink
|
|
28
|
-
InputLabelProps.shrink ??= MUGlobal_1.MUGlobal.searchFieldShrink;
|
|
29
27
|
// State
|
|
30
28
|
const [errorText, updateErrorText] = react_1.default.useState();
|
|
31
29
|
const [empty, updateEmpty] = react_1.default.useState(true);
|
|
32
|
-
// Read only
|
|
33
|
-
if (readOnly != null)
|
|
34
|
-
InputProps.readOnly = readOnly;
|
|
35
30
|
// Calculate
|
|
36
31
|
let errorEx = error;
|
|
37
32
|
let helperTextEx = helperText;
|
|
@@ -90,10 +85,6 @@ function TextFieldEx(props) {
|
|
|
90
85
|
}
|
|
91
86
|
preventDefault(e);
|
|
92
87
|
};
|
|
93
|
-
// Show password and/or clear button
|
|
94
|
-
if (!empty && (showPassword || showClear)) {
|
|
95
|
-
InputProps.endAdornment = ((0, jsx_runtime_1.jsxs)(InputAdornment_1.default, { position: "end", children: [showPassword && ((0, jsx_runtime_1.jsx)(IconButton_1.default, { tabIndex: -1, onContextMenu: (event) => event.preventDefault(), onMouseDown: touchStart, onMouseUp: touchEnd, onTouchStart: touchStart, onTouchCancel: touchEnd, onTouchEnd: touchEnd, title: showIt, children: (0, jsx_runtime_1.jsx)(Visibility_1.default, {}) })), showClear && ((0, jsx_runtime_1.jsx)(IconButton_1.default, { onClick: clearClick, tabIndex: -1, title: clearLabel, children: (0, jsx_runtime_1.jsx)(Clear_1.default, {}) }))] }));
|
|
96
|
-
}
|
|
97
88
|
// Extend key precess
|
|
98
89
|
const onKeyPressEx = onEnter == null
|
|
99
90
|
? onKeyDown
|
|
@@ -149,7 +140,11 @@ function TextFieldEx(props) {
|
|
|
149
140
|
}, []);
|
|
150
141
|
// Textfield
|
|
151
142
|
return ((0, jsx_runtime_1.jsx)(TextField_1.default, { error: errorEx, fullWidth: fullWidth, helperText: helperTextEx, inputRef: (0, react_2.useCombinedRefs)(inputRef, localRef), onChange: onChangeEx, onKeyDown: onKeyPressEx, slotProps: {
|
|
152
|
-
input: {
|
|
143
|
+
input: {
|
|
144
|
+
endAdornment: !empty && (showPassword || showClear) ? ((0, jsx_runtime_1.jsxs)(InputAdornment_1.default, { position: "end", children: [showPassword && ((0, jsx_runtime_1.jsx)(IconButton_1.default, { tabIndex: -1, onContextMenu: (event) => event.preventDefault(), onMouseDown: touchStart, onMouseUp: touchEnd, onTouchStart: touchStart, onTouchCancel: touchEnd, onTouchEnd: touchEnd, title: showIt, children: (0, jsx_runtime_1.jsx)(Visibility_1.default, {}) })), showClear && ((0, jsx_runtime_1.jsx)(IconButton_1.default, { onClick: clearClick, tabIndex: -1, title: clearLabel, children: (0, jsx_runtime_1.jsx)(Clear_1.default, {}) }))] })) : undefined,
|
|
145
|
+
readOnly,
|
|
146
|
+
...input
|
|
147
|
+
},
|
|
153
148
|
inputLabel: {
|
|
154
149
|
shrink: MUGlobal_1.MUGlobal.inputFieldShrink,
|
|
155
150
|
...inputLabel
|