@etsoo/materialui 1.0.30 → 1.0.32

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.
@@ -119,7 +119,7 @@ test('Prompt tests', async () => {
119
119
  // Add the notification
120
120
  notifier.prompt<boolean>('Prompt message', handleClick, undefined, {
121
121
  type: 'switch',
122
- required: false
122
+ inputProps: { required: false }
123
123
  });
124
124
  });
125
125
 
@@ -148,7 +148,7 @@ test('Prompt tests with form submit', async () => {
148
148
  // Add the notification
149
149
  notifier.prompt<boolean>('Prompt message', handleClick, undefined, {
150
150
  type: 'switch',
151
- required: false
151
+ inputProps: { required: false }
152
152
  });
153
153
  });
154
154
 
package/lib/NotifierMU.js CHANGED
@@ -119,7 +119,7 @@ export class NotificationMU extends NotificationReact {
119
119
  var _a, _b;
120
120
  const labels = Labels.NotificationMU;
121
121
  const title = (_a = this.title) !== null && _a !== void 0 ? _a : labels.promptTitle;
122
- const { cancelLabel = labels.promptCancel, okLabel = labels.promptOK, cancelButton = true, inputs, type, fullScreen, fullWidth = true, maxWidth, primaryButton, ...rest } = (_b = this.inputProps) !== null && _b !== void 0 ? _b : {};
122
+ const { cancelLabel = labels.promptCancel, okLabel = labels.promptOK, cancelButton = true, inputs, type, fullScreen, fullWidth = true, maxWidth, primaryButton, inputProps } = (_b = this.inputProps) !== null && _b !== void 0 ? _b : {};
123
123
  const inputRef = React.createRef();
124
124
  const errorRef = React.createRef();
125
125
  const setError = (error) => {
@@ -187,13 +187,13 @@ export class NotificationMU extends NotificationReact {
187
187
  let value = undefined;
188
188
  if (inputs == null) {
189
189
  if (type === 'switch') {
190
- localInputs = (React.createElement(Switch, { inputRef: inputRef, ...rest, value: "true", autoFocus: true, required: true }));
190
+ localInputs = (React.createElement(Switch, { inputRef: inputRef, ...inputProps, value: "true", autoFocus: true, required: true }));
191
191
  }
192
192
  else if (type === 'slider') {
193
193
  localInputs = React.createElement(Slider, { onChange: (_e, v) => (value = v) });
194
194
  }
195
195
  else {
196
- localInputs = (React.createElement(TextField, { inputRef: inputRef, onChange: () => setError(undefined), autoFocus: true, margin: "dense", fullWidth: true, type: type, required: true, ...rest }));
196
+ localInputs = (React.createElement(TextField, { inputRef: inputRef, onChange: () => setError(undefined), autoFocus: true, margin: "dense", fullWidth: true, type: type, required: true, ...inputProps }));
197
197
  }
198
198
  }
199
199
  else {
@@ -1,5 +1,5 @@
1
1
  import { CoreApp, IActionResult, IApp, IAppSettings, ICoreApp, IUser } from '@etsoo/appscript';
2
- import { NotificationRenderProps, NotificationReturn } from '@etsoo/notificationbase';
2
+ import { INotifier, NotificationReturn } from '@etsoo/notificationbase';
3
3
  import { DataTypes } from '@etsoo/shared';
4
4
  import React from 'react';
5
5
  import { CultureAction, CultureState, INotificationReact, InputDialogProps, IPageData, IStateProps, NotificationReactCallProps, PageAction, PageState, UserAction, UserState } from '@etsoo/react';
@@ -24,6 +24,10 @@ export declare function ReactAppStateDetector(props: IStateProps): React.Functio
24
24
  * React implemented base
25
25
  */
26
26
  export interface IReactAppBase {
27
+ /**
28
+ * Override Notifier as React specific
29
+ */
30
+ readonly notifier: INotifier<React.ReactNode, NotificationReactCallProps>;
27
31
  /**
28
32
  * User state
29
33
  */
@@ -90,7 +94,7 @@ export declare class ReactApp<S extends IAppSettings, D extends IUser, P extends
90
94
  /**
91
95
  * Get notifier provider
92
96
  */
93
- static get notifierProvider(): React.FunctionComponent<NotificationRenderProps>;
97
+ static get notifierProvider(): React.FunctionComponent<object>;
94
98
  private static createApi;
95
99
  private static createNotifier;
96
100
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -51,12 +51,12 @@
51
51
  "@emotion/css": "^11.10.0",
52
52
  "@emotion/react": "^11.10.4",
53
53
  "@emotion/styled": "^11.10.4",
54
- "@etsoo/appscript": "^1.2.97",
55
- "@etsoo/notificationbase": "^1.1.7",
56
- "@etsoo/react": "^1.6.3",
54
+ "@etsoo/appscript": "^1.2.99",
55
+ "@etsoo/notificationbase": "^1.1.10",
56
+ "@etsoo/react": "^1.6.5",
57
57
  "@etsoo/shared": "^1.1.58",
58
58
  "@mui/icons-material": "^5.10.6",
59
- "@mui/material": "^5.10.6",
59
+ "@mui/material": "^5.10.7",
60
60
  "@types/pica": "^9.0.1",
61
61
  "@types/pulltorefreshjs": "^0.1.5",
62
62
  "@types/react": "^18.0.21",
@@ -75,10 +75,10 @@
75
75
  "react-window": "^1.8.7"
76
76
  },
77
77
  "devDependencies": {
78
- "@babel/cli": "^7.18.10",
79
- "@babel/core": "^7.19.1",
78
+ "@babel/cli": "^7.19.3",
79
+ "@babel/core": "^7.19.3",
80
80
  "@babel/plugin-transform-runtime": "^7.19.1",
81
- "@babel/preset-env": "^7.19.1",
81
+ "@babel/preset-env": "^7.19.3",
82
82
  "@babel/runtime-corejs3": "^7.19.1",
83
83
  "@testing-library/jest-dom": "^5.16.5",
84
84
  "@testing-library/react": "^13.4.0",
@@ -92,6 +92,6 @@
92
92
  "jest": "^29.0.3",
93
93
  "jest-environment-jsdom": "^29.0.3",
94
94
  "ts-jest": "^29.0.2",
95
- "typescript": "^4.8.3"
95
+ "typescript": "^4.8.4"
96
96
  }
97
97
  }
@@ -240,7 +240,7 @@ export class NotificationMU extends NotificationReact {
240
240
  fullWidth = true,
241
241
  maxWidth,
242
242
  primaryButton,
243
- ...rest
243
+ inputProps
244
244
  } = this.inputProps ?? {};
245
245
 
246
246
  const inputRef = React.createRef<HTMLInputElement>();
@@ -322,7 +322,7 @@ export class NotificationMU extends NotificationReact {
322
322
  localInputs = (
323
323
  <Switch
324
324
  inputRef={inputRef}
325
- {...rest}
325
+ {...inputProps}
326
326
  value="true"
327
327
  autoFocus
328
328
  required
@@ -340,7 +340,7 @@ export class NotificationMU extends NotificationReact {
340
340
  fullWidth
341
341
  type={type}
342
342
  required
343
- {...rest}
343
+ {...inputProps}
344
344
  />
345
345
  );
346
346
  }
@@ -9,6 +9,7 @@ import {
9
9
  IUser
10
10
  } from '@etsoo/appscript';
11
11
  import {
12
+ INotifier,
12
13
  NotificationMessageType,
13
14
  NotificationRenderProps,
14
15
  NotificationReturn
@@ -87,6 +88,11 @@ export function ReactAppStateDetector(props: IStateProps) {
87
88
  * React implemented base
88
89
  */
89
90
  export interface IReactAppBase {
91
+ /**
92
+ * Override Notifier as React specific
93
+ */
94
+ readonly notifier: INotifier<React.ReactNode, NotificationReactCallProps>;
95
+
90
96
  /**
91
97
  * User state
92
98
  */