@etsoo/materialui 1.0.37 → 1.0.38

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/lib/NotifierMU.js CHANGED
@@ -55,6 +55,7 @@ export class NotificationMU extends NotificationReact {
55
55
  // Callback
56
56
  const callback = async (_event) => {
57
57
  await this.returnValue(undefined);
58
+ return true;
58
59
  };
59
60
  return (React.createElement(Dialog, { key: this.id, open: this.open, PaperComponent: DraggablePaperComponent, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen },
60
61
  React.createElement(IconDialogTitle, { className: "draggable-dialog-title" },
@@ -71,7 +72,10 @@ export class NotificationMU extends NotificationReact {
71
72
  const labels = Labels.NotificationMU;
72
73
  const title = (_a = this.title) !== null && _a !== void 0 ? _a : labels.confirmTitle;
73
74
  const { buttons, okLabel = labels.confirmYes, cancelLabel = labels.confirmNo, cancelButton = true, inputs, fullScreen, fullWidth = true, maxWidth, primaryButton } = (_b = this.inputProps) !== null && _b !== void 0 ? _b : {};
74
- const callback = async (_event, value) => await this.returnValue(value);
75
+ const callback = async (_event, value) => {
76
+ await this.returnValue(value);
77
+ return true;
78
+ };
75
79
  return (React.createElement(Dialog, { key: this.id, open: this.open, PaperComponent: DraggablePaperComponent, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen },
76
80
  React.createElement(IconDialogTitle, { className: "draggable-dialog-title" },
77
81
  React.createElement(Help, { color: "action" }),
@@ -134,7 +138,7 @@ export class NotificationMU extends NotificationReact {
134
138
  const dateValue = input.valueAsDate;
135
139
  if (dateValue == null && input.required) {
136
140
  input.focus();
137
- return;
141
+ return false;
138
142
  }
139
143
  result = this.onReturn(dateValue);
140
144
  }
@@ -142,7 +146,7 @@ export class NotificationMU extends NotificationReact {
142
146
  const numberValue = input.valueAsNumber;
143
147
  if (isNaN(numberValue) && input.required) {
144
148
  input.focus();
145
- return;
149
+ return false;
146
150
  }
147
151
  result = this.onReturn(numberValue);
148
152
  }
@@ -154,7 +158,7 @@ export class NotificationMU extends NotificationReact {
154
158
  const textValue = input.value.trim();
155
159
  if (textValue === '' && input.required) {
156
160
  input.focus();
157
- return;
161
+ return false;
158
162
  }
159
163
  result = this.onReturn(textValue);
160
164
  }
@@ -168,14 +172,15 @@ export class NotificationMU extends NotificationReact {
168
172
  const v = await result;
169
173
  if (v === false) {
170
174
  input === null || input === void 0 ? void 0 : input.focus();
171
- return;
175
+ return false;
172
176
  }
173
177
  if (typeof v === 'string') {
174
178
  setError(v);
175
179
  input === null || input === void 0 ? void 0 : input.focus();
176
- return;
180
+ return false;
177
181
  }
178
182
  this.dismiss();
183
+ return true;
179
184
  };
180
185
  let localInputs;
181
186
  let value = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.0.37",
3
+ "version": "1.0.38",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -53,7 +53,7 @@
53
53
  "@emotion/styled": "^11.10.4",
54
54
  "@etsoo/appscript": "^1.3.0",
55
55
  "@etsoo/notificationbase": "^1.1.11",
56
- "@etsoo/react": "^1.6.10",
56
+ "@etsoo/react": "^1.6.11",
57
57
  "@etsoo/shared": "^1.1.58",
58
58
  "@mui/icons-material": "^5.10.6",
59
59
  "@mui/material": "^5.10.7",
@@ -100,6 +100,7 @@ export class NotificationMU extends NotificationReact {
100
100
  _event: React.MouseEvent<HTMLButtonElement>
101
101
  ) => {
102
102
  await this.returnValue(undefined);
103
+ return true;
103
104
  };
104
105
 
105
106
  return (
@@ -158,7 +159,10 @@ export class NotificationMU extends NotificationReact {
158
159
  const callback = async (
159
160
  _event: React.MouseEvent<HTMLButtonElement>,
160
161
  value: boolean
161
- ) => await this.returnValue(value);
162
+ ) => {
163
+ await this.returnValue(value);
164
+ return true;
165
+ };
162
166
 
163
167
  return (
164
168
  <Dialog
@@ -291,14 +295,14 @@ export class NotificationMU extends NotificationReact {
291
295
  const dateValue = input.valueAsDate;
292
296
  if (dateValue == null && input.required) {
293
297
  input.focus();
294
- return;
298
+ return false;
295
299
  }
296
300
  result = this.onReturn(dateValue);
297
301
  } else if (type === 'number') {
298
302
  const numberValue = input.valueAsNumber;
299
303
  if (isNaN(numberValue) && input.required) {
300
304
  input.focus();
301
- return;
305
+ return false;
302
306
  }
303
307
  result = this.onReturn(numberValue);
304
308
  } else if (type === 'switch') {
@@ -308,7 +312,7 @@ export class NotificationMU extends NotificationReact {
308
312
  const textValue = input.value.trim();
309
313
  if (textValue === '' && input.required) {
310
314
  input.focus();
311
- return;
315
+ return false;
312
316
  }
313
317
  result = this.onReturn(textValue);
314
318
  }
@@ -322,15 +326,16 @@ export class NotificationMU extends NotificationReact {
322
326
  const v = await result;
323
327
  if (v === false) {
324
328
  input?.focus();
325
- return;
329
+ return false;
326
330
  }
327
331
  if (typeof v === 'string') {
328
332
  setError(v);
329
333
  input?.focus();
330
- return;
334
+ return false;
331
335
  }
332
336
 
333
337
  this.dismiss();
338
+ return true;
334
339
  };
335
340
 
336
341
  let localInputs: React.ReactNode;