@etsoo/materialui 1.4.22 → 1.4.23
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/README.md +2 -1
- package/babel.config.json +12 -12
- package/lib/AddresSelector.d.ts +8 -2
- package/lib/AddresSelector.js +1 -1
- package/lib/AuditDisplay.d.ts +1 -1
- package/lib/BackButton.d.ts +1 -1
- package/lib/BackButton.js +5 -5
- package/lib/CountryList.d.ts +5 -4
- package/lib/CountryList.js +3 -3
- package/lib/CustomFabProps.d.ts +3 -3
- package/lib/DataGridEx.js +3 -6
- package/lib/DataGridRenderers.d.ts +3 -3
- package/lib/DataGridRenderers.js +17 -17
- package/lib/DataTable.d.ts +1 -7
- package/lib/DataTable.js +3 -13
- package/lib/DialogButton.d.ts +2 -2
- package/lib/DialogButton.js +4 -4
- package/lib/EmailInput.d.ts +2 -2
- package/lib/EmailInput.js +2 -2
- package/lib/FlexBox.d.ts +3 -3
- package/lib/FlexBox.js +1 -1
- package/lib/GridDataFormat.d.ts +2 -2
- package/lib/GridDataFormat.js +7 -7
- package/lib/GridUtils.js +2 -1
- package/lib/ListItemRightIcon.d.ts +1 -1
- package/lib/ListItemRightIcon.js +2 -2
- package/lib/LoadingButton.d.ts +1 -1
- package/lib/LoadingButton.js +2 -2
- package/lib/MUGlobal.d.ts +6 -6
- package/lib/MUGlobal.js +20 -22
- package/lib/MobileListItemRenderer.d.ts +3 -3
- package/lib/MobileListItemRenderer.js +8 -10
- package/lib/PList.js +1 -1
- package/lib/ProgressCount.js +12 -12
- package/lib/RegionsRQ.d.ts +22 -0
- package/lib/RegionsRQ.js +1 -0
- package/lib/SearchField.d.ts +1 -1
- package/lib/SearchField.js +4 -4
- package/lib/SearchOptionGroup.d.ts +2 -2
- package/lib/SearchOptionGroup.js +3 -3
- package/lib/Switch.d.ts +3 -3
- package/lib/Switch.js +5 -5
- package/lib/TabBox.d.ts +5 -5
- package/lib/TabBox.js +5 -5
- package/lib/TableEx.js +4 -7
- package/lib/TooltipClick.d.ts +3 -3
- package/lib/TooltipClick.js +3 -3
- package/lib/TwoFieldInput.d.ts +2 -2
- package/lib/TwoFieldInput.js +13 -13
- package/lib/app/IServicePage.d.ts +1 -1
- package/lib/app/Labels.d.ts +1 -1
- package/lib/app/Labels.js +31 -31
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/texts/MoneyText.d.ts +1 -1
- package/lib/texts/MoneyText.js +3 -3
- package/lib/texts/NumberText.d.ts +1 -1
- package/lib/texts/NumberText.js +3 -3
- package/package.json +20 -20
- package/src/AddresSelector.tsx +31 -4
- package/src/AuditDisplay.tsx +1 -1
- package/src/BackButton.tsx +39 -39
- package/src/CountryList.tsx +49 -48
- package/src/CustomFabProps.ts +19 -19
- package/src/DataGridEx.tsx +2 -7
- package/src/DataGridRenderers.tsx +119 -119
- package/src/DataTable.tsx +2 -31
- package/src/DialogButton.tsx +149 -151
- package/src/EmailInput.tsx +9 -11
- package/src/FlexBox.tsx +6 -6
- package/src/GridDataFormat.tsx +58 -58
- package/src/GridUtils.ts +2 -1
- package/src/ListItemRightIcon.tsx +3 -3
- package/src/LoadingButton.tsx +53 -53
- package/src/MUGlobal.ts +196 -203
- package/src/MobileListItemRenderer.tsx +63 -65
- package/src/NotifierPromptProps.ts +16 -16
- package/src/PList.tsx +14 -14
- package/src/ProgressCount.tsx +144 -148
- package/src/RegionsRQ.ts +26 -0
- package/src/SearchField.tsx +59 -59
- package/src/SearchOptionGroup.tsx +20 -20
- package/src/Switch.tsx +72 -72
- package/src/TabBox.tsx +87 -89
- package/src/TableEx.tsx +5 -8
- package/src/TooltipClick.tsx +62 -64
- package/src/TwoFieldInput.tsx +104 -104
- package/src/app/IServicePage.ts +1 -1
- package/src/app/Labels.ts +67 -67
- package/src/index.ts +1 -0
- package/src/texts/MoneyText.tsx +29 -35
- package/src/texts/NumberText.tsx +23 -23
package/src/MUGlobal.ts
CHANGED
|
@@ -1,220 +1,213 @@
|
|
|
1
|
-
import { NumberUtils } from
|
|
2
|
-
import { Breakpoint, ListItemButtonProps, Theme } from
|
|
3
|
-
import { Link } from
|
|
1
|
+
import { NumberUtils } from "@etsoo/shared";
|
|
2
|
+
import { Breakpoint, ListItemButtonProps, Theme } from "@mui/material";
|
|
3
|
+
import { Link } from "react-router-dom";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Mouse event handler with data
|
|
7
7
|
*/
|
|
8
8
|
export type MouseEventWithDataHandler<T> = (
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
event: React.MouseEvent<HTMLDivElement>,
|
|
10
|
+
data: T
|
|
11
11
|
) => void;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* MUGlobal for global configurations
|
|
15
15
|
*/
|
|
16
16
|
export class MUGlobal {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return {
|
|
77
|
-
component: Link,
|
|
78
|
-
selected,
|
|
79
|
-
to: href,
|
|
80
|
-
sx: {
|
|
81
|
-
...(selected && {
|
|
82
|
-
'.MuiListItemIcon-root': {
|
|
83
|
-
color: (theme) => theme.palette.primary.main
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
}
|
|
87
|
-
} as ListItemButtonProps;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Update object number properties with half of it
|
|
92
|
-
* @param input Input object
|
|
93
|
-
* @returns Updated object
|
|
94
|
-
*/
|
|
95
|
-
static half(input: object) {
|
|
96
|
-
const newObj = { ...input };
|
|
97
|
-
Object.entries(newObj).forEach(([key, value]) => {
|
|
98
|
-
if (typeof value === 'number') {
|
|
99
|
-
Reflect.set(newObj, key, value / 2.0);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
return newObj;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Reverse object number properties, like 5 to -5
|
|
107
|
-
* @param input Input object
|
|
108
|
-
* @returns Updated object
|
|
109
|
-
*/
|
|
110
|
-
static reverse(input: object) {
|
|
111
|
-
const newObj = { ...input };
|
|
112
|
-
Object.entries(newObj).forEach(([key, value]) => {
|
|
113
|
-
if (typeof value === 'number') {
|
|
114
|
-
Reflect.set(newObj, key, -value);
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
return newObj;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Update object number properties with adjustment
|
|
122
|
-
* @param input Input object
|
|
123
|
-
* @param adjust Adjust value or new size object
|
|
124
|
-
* @param field Specific field
|
|
125
|
-
* @returns Updated object
|
|
126
|
-
*/
|
|
127
|
-
static increase(input: object, adjust: number | object, field?: string) {
|
|
128
|
-
const newObj = { ...input };
|
|
129
|
-
Object.entries(newObj).forEach(([key, value]) => {
|
|
130
|
-
if (typeof value === 'number') {
|
|
131
|
-
if (field == null || field === key) {
|
|
132
|
-
const adjustValue =
|
|
133
|
-
typeof adjust === 'number'
|
|
134
|
-
? adjust
|
|
135
|
-
: Reflect.get(adjust, key);
|
|
136
|
-
if (adjustValue == null || typeof adjustValue !== 'number')
|
|
137
|
-
return;
|
|
138
|
-
|
|
139
|
-
Reflect.set(newObj, key, value + adjustValue);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
return newObj;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Adjust size with theme update
|
|
148
|
-
* @param size Base size
|
|
149
|
-
* @param adjust Adjustment
|
|
150
|
-
* @param updateFunc Theme update function
|
|
151
|
-
* @returns Updated object
|
|
152
|
-
*/
|
|
153
|
-
static adjustWithTheme(
|
|
154
|
-
size: number,
|
|
155
|
-
adjust: object,
|
|
156
|
-
updateFunc: (value: number) => string
|
|
157
|
-
) {
|
|
158
|
-
const newObj = { ...adjust };
|
|
159
|
-
Object.entries(newObj).forEach(([key, value]) => {
|
|
160
|
-
if (typeof value === 'number') {
|
|
161
|
-
const newValue = NumberUtils.parseWithUnit(updateFunc(value));
|
|
162
|
-
if (newValue != null) {
|
|
163
|
-
Reflect.set(
|
|
164
|
-
newObj,
|
|
165
|
-
key,
|
|
166
|
-
`${size - newValue[0]}${newValue[1]}`
|
|
167
|
-
);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
return newObj;
|
|
17
|
+
/**
|
|
18
|
+
* Search field shrink
|
|
19
|
+
*/
|
|
20
|
+
static searchFieldShrink: boolean = true;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Search field size
|
|
24
|
+
*/
|
|
25
|
+
static searchFieldSize: "small" | "medium" = "small";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Search field variant
|
|
29
|
+
*/
|
|
30
|
+
static searchFieldVariant: "standard" | "filled" | "outlined" = "outlined";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Input field shrink
|
|
34
|
+
*/
|
|
35
|
+
static inputFieldShrink: boolean = true;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Input field size
|
|
39
|
+
*/
|
|
40
|
+
static inputFieldSize: "small" | "medium" = "medium";
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Input field variant
|
|
44
|
+
*/
|
|
45
|
+
static inputFieldVariant: "standard" | "filled" | "outlined" = "outlined";
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* TextField variant
|
|
49
|
+
*/
|
|
50
|
+
static textFieldVariant: "standard" | "filled" | "outlined" = "filled";
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Page default paddings
|
|
54
|
+
*/
|
|
55
|
+
static pagePaddings = { xs: 2, sm: 3 };
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Get menu item props
|
|
59
|
+
* @param path Current path
|
|
60
|
+
* @param href Item's href
|
|
61
|
+
* @returns Props
|
|
62
|
+
*/
|
|
63
|
+
static getMenuItem(path: string, href: string) {
|
|
64
|
+
let selected = false;
|
|
65
|
+
|
|
66
|
+
if (path === href) {
|
|
67
|
+
// Exact match, most common case
|
|
68
|
+
selected = true;
|
|
69
|
+
} else if (href.endsWith("*")) {
|
|
70
|
+
href = href.slice(0, -1);
|
|
71
|
+
selected = path.startsWith(href);
|
|
72
|
+
} else if (href.endsWith("/all")) {
|
|
73
|
+
selected = path.startsWith(href.slice(0, -3));
|
|
172
74
|
}
|
|
173
75
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
76
|
+
return {
|
|
77
|
+
component: Link,
|
|
78
|
+
selected,
|
|
79
|
+
to: href,
|
|
80
|
+
sx: {
|
|
81
|
+
...(selected && {
|
|
82
|
+
".MuiListItemIcon-root": {
|
|
83
|
+
color: (theme) => theme.palette.primary.main
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
} as ListItemButtonProps;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Update object number properties with half of it
|
|
92
|
+
* @param input Input object
|
|
93
|
+
* @returns Updated object
|
|
94
|
+
*/
|
|
95
|
+
static half(input: object) {
|
|
96
|
+
const newObj = { ...input };
|
|
97
|
+
Object.entries(newObj).forEach(([key, value]) => {
|
|
98
|
+
if (typeof value === "number") {
|
|
99
|
+
Reflect.set(newObj, key, value / 2.0);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
return newObj;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Reverse object number properties, like 5 to -5
|
|
107
|
+
* @param input Input object
|
|
108
|
+
* @returns Updated object
|
|
109
|
+
*/
|
|
110
|
+
static reverse(input: object) {
|
|
111
|
+
const newObj = { ...input };
|
|
112
|
+
Object.entries(newObj).forEach(([key, value]) => {
|
|
113
|
+
if (typeof value === "number") {
|
|
114
|
+
Reflect.set(newObj, key, -value);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
return newObj;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Update object number properties with adjustment
|
|
122
|
+
* @param input Input object
|
|
123
|
+
* @param adjust Adjust value or new size object
|
|
124
|
+
* @param field Specific field
|
|
125
|
+
* @returns Updated object
|
|
126
|
+
*/
|
|
127
|
+
static increase(input: object, adjust: number | object, field?: string) {
|
|
128
|
+
const newObj = { ...input };
|
|
129
|
+
Object.entries(newObj).forEach(([key, value]) => {
|
|
130
|
+
if (typeof value === "number") {
|
|
131
|
+
if (field == null || field === key) {
|
|
132
|
+
const adjustValue =
|
|
133
|
+
typeof adjust === "number" ? adjust : Reflect.get(adjust, key);
|
|
134
|
+
if (adjustValue == null || typeof adjustValue !== "number") return;
|
|
135
|
+
|
|
136
|
+
Reflect.set(newObj, key, value + adjustValue);
|
|
200
137
|
}
|
|
201
|
-
|
|
202
|
-
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
return newObj;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Adjust size with theme update
|
|
145
|
+
* @param size Base size
|
|
146
|
+
* @param adjust Adjustment
|
|
147
|
+
* @param updateFunc Theme update function
|
|
148
|
+
* @returns Updated object
|
|
149
|
+
*/
|
|
150
|
+
static adjustWithTheme(
|
|
151
|
+
size: number,
|
|
152
|
+
adjust: object,
|
|
153
|
+
updateFunc: (value: number) => string
|
|
154
|
+
) {
|
|
155
|
+
const newObj = { ...adjust };
|
|
156
|
+
Object.entries(newObj).forEach(([key, value]) => {
|
|
157
|
+
if (typeof value === "number") {
|
|
158
|
+
const newValue = NumberUtils.parseWithUnit(updateFunc(value));
|
|
159
|
+
if (newValue != null) {
|
|
160
|
+
Reflect.set(newObj, key, `${size - newValue[0]}${newValue[1]}`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
return newObj;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Break points defined
|
|
169
|
+
*/
|
|
170
|
+
static breakpoints = ["xs", "sm", "md", "lg", "xl"] as const;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Get multple medias theme space
|
|
174
|
+
* Responsive values and Breakpoints as an object
|
|
175
|
+
* xs = theme.breakpoints.up('xs')
|
|
176
|
+
* https://mui.com/system/basics/
|
|
177
|
+
* @param spaces Spaces
|
|
178
|
+
* @param theme Theme
|
|
179
|
+
* @returns Result
|
|
180
|
+
*/
|
|
181
|
+
static getSpace(spaces: object, theme: Theme) {
|
|
182
|
+
const start = this.breakpoints.length - 1;
|
|
183
|
+
for (let i = start; i >= 0; i--) {
|
|
184
|
+
const key = this.breakpoints[i];
|
|
185
|
+
const value = Reflect.get(spaces, key);
|
|
186
|
+
if (typeof value === "number") {
|
|
187
|
+
const mediaRaw = theme.breakpoints.up(key as Breakpoint);
|
|
188
|
+
const mediaQuery = mediaRaw.substring(mediaRaw.indexOf("("));
|
|
189
|
+
if (window.matchMedia(mediaQuery).matches) {
|
|
190
|
+
return parseInt(theme.spacing(value), 10);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
203
193
|
}
|
|
204
194
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
195
|
+
return 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Update object number properties with theme
|
|
200
|
+
* @param input Input object
|
|
201
|
+
* @param updateFunc Theme update function
|
|
202
|
+
* @returns Updated object
|
|
203
|
+
*/
|
|
204
|
+
static updateWithTheme(input: {}, updateFunc: (value: number) => string) {
|
|
205
|
+
const newObj = { ...input };
|
|
206
|
+
Object.entries(newObj).forEach(([key, value]) => {
|
|
207
|
+
if (typeof value === "number") {
|
|
208
|
+
Reflect.set(newObj, key, updateFunc(value));
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
return newObj;
|
|
212
|
+
}
|
|
220
213
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ListItemReact } from
|
|
2
|
-
import { Card, CardContent, CardHeader, LinearProgress } from
|
|
3
|
-
import React from
|
|
4
|
-
import { MoreFab } from
|
|
5
|
-
import { ScrollerListExInnerItemRendererProps } from
|
|
1
|
+
import { ListItemReact } from "@etsoo/react";
|
|
2
|
+
import { Card, CardContent, CardHeader, LinearProgress } from "@mui/material";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { MoreFab } from "./MoreFab";
|
|
5
|
+
import { ScrollerListExInnerItemRendererProps } from "./ScrollerListEx";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Default mobile list item renderer
|
|
@@ -12,68 +12,66 @@ import { ScrollerListExInnerItemRendererProps } from './ScrollerListEx';
|
|
|
12
12
|
* @returns Component
|
|
13
13
|
*/
|
|
14
14
|
export function MobileListItemRenderer<T>(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
{ data, itemHeight, margins }: ScrollerListExInnerItemRendererProps<T>,
|
|
16
|
+
renderer: (
|
|
17
|
+
data: T
|
|
18
|
+
) => [
|
|
19
|
+
string,
|
|
20
|
+
string | undefined,
|
|
21
|
+
React.ReactNode | (ListItemReact | boolean)[],
|
|
22
|
+
React.ReactNode,
|
|
23
|
+
React.ReactNode?
|
|
24
|
+
]
|
|
25
25
|
) {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
// Loading
|
|
27
|
+
if (data == null) return <LinearProgress />;
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
// Elements
|
|
30
|
+
const [title, subheader, actions, children, cardActions] = renderer(data);
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
/>
|
|
56
|
-
) : (
|
|
57
|
-
actions
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
title={title}
|
|
61
|
-
titleTypographyProps={{ variant: 'body2' }}
|
|
62
|
-
subheader={subheader}
|
|
63
|
-
subheaderTypographyProps={{ variant: 'caption' }}
|
|
32
|
+
return (
|
|
33
|
+
<Card
|
|
34
|
+
sx={{
|
|
35
|
+
height: itemHeight,
|
|
36
|
+
...margins
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<CardHeader
|
|
40
|
+
sx={{ paddingBottom: 0.5 }}
|
|
41
|
+
action={
|
|
42
|
+
Array.isArray(actions) ? (
|
|
43
|
+
<MoreFab
|
|
44
|
+
iconButton
|
|
45
|
+
size="small"
|
|
46
|
+
anchorOrigin={{
|
|
47
|
+
vertical: "bottom",
|
|
48
|
+
horizontal: "right"
|
|
49
|
+
}}
|
|
50
|
+
transformOrigin={{
|
|
51
|
+
vertical: "top",
|
|
52
|
+
horizontal: "right"
|
|
53
|
+
}}
|
|
54
|
+
actions={actions}
|
|
64
55
|
/>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
56
|
+
) : (
|
|
57
|
+
actions
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
title={title}
|
|
61
|
+
titleTypographyProps={{ variant: "body2" }}
|
|
62
|
+
subheader={subheader}
|
|
63
|
+
subheaderTypographyProps={{ variant: "caption" }}
|
|
64
|
+
/>
|
|
65
|
+
<CardContent
|
|
66
|
+
sx={{
|
|
67
|
+
paddingTop: 0,
|
|
68
|
+
paddingBottom:
|
|
69
|
+
cardActions == null ? Reflect.get(margins, "marginBottom") : 0
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
{children}
|
|
73
|
+
</CardContent>
|
|
74
|
+
{cardActions}
|
|
75
|
+
</Card>
|
|
76
|
+
);
|
|
79
77
|
}
|
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
* Notifier prompt props
|
|
3
3
|
*/
|
|
4
4
|
export type NotifierPromptProps = Record<string, any> & {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Cancel label
|
|
7
|
+
*/
|
|
8
|
+
cancelLabel?: string;
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
/**
|
|
11
|
+
* OK label
|
|
12
|
+
*/
|
|
13
|
+
okLabel?: string;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Multiple inputs
|
|
17
|
+
*/
|
|
18
|
+
inputs: React.ReactNode;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Single type
|
|
22
|
+
*/
|
|
23
|
+
type?: string;
|
|
24
24
|
};
|
package/src/PList.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Paragraph items list props
|
|
5
5
|
*/
|
|
6
6
|
export interface PListProps {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
/**
|
|
8
|
+
* List items
|
|
9
|
+
*/
|
|
10
|
+
items?: string[];
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -15,13 +15,13 @@ export interface PListProps {
|
|
|
15
15
|
* @param items Items
|
|
16
16
|
*/
|
|
17
17
|
export function PList(props: PListProps) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
const { items } = props;
|
|
19
|
+
return (
|
|
20
|
+
<React.Fragment>
|
|
21
|
+
{items != null &&
|
|
22
|
+
items.map((item, index) => {
|
|
23
|
+
return <p key={index}>{item}</p>;
|
|
24
|
+
})}
|
|
25
|
+
</React.Fragment>
|
|
26
|
+
);
|
|
27
27
|
}
|