@etsoo/react 1.4.99 → 1.5.0

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.
@@ -138,6 +138,11 @@ export declare class ReactApp<S extends IAppSettings, D extends IUser, P extends
138
138
  * @param callback Callback
139
139
  */
140
140
  freshCountdownUI(callback?: () => PromiseLike<unknown>): void;
141
+ /**
142
+ * Redirect to the Url
143
+ * @param url Url
144
+ */
145
+ redirectTo(url: string): void;
141
146
  /**
142
147
  * Set page data
143
148
  * @param data Page data
@@ -1,5 +1,6 @@
1
1
  import { ActionResultError, BridgeUtils, CoreApp, createClient } from '@etsoo/appscript';
2
2
  import { WindowStorage } from '@etsoo/shared';
3
+ import { redirectTo } from '@reach/router';
3
4
  import React from 'react';
4
5
  import { NotifierMU } from '../mu/NotifierMU';
5
6
  import { ProgressCount } from '../mu/ProgressCount';
@@ -188,6 +189,13 @@ export class ReactApp extends CoreApp {
188
189
  inputs: progress
189
190
  });
190
191
  }
192
+ /**
193
+ * Redirect to the Url
194
+ * @param url Url
195
+ */
196
+ redirectTo(url) {
197
+ redirectTo(url);
198
+ }
191
199
  /**
192
200
  * Set page data
193
201
  * @param data Page data
@@ -24,8 +24,9 @@ export function BridgeCloseButton(props) {
24
24
  onClick(event);
25
25
  host.exit();
26
26
  };
27
- return (React.createElement(IconButton, { "aria-label": "close", color: "primary", onClick: onClickLocal, sx: {
27
+ return (React.createElement(IconButton, { "aria-label": "close", color: "secondary", onClick: onClickLocal, title: title, sx: {
28
28
  position: 'absolute',
29
+ zIndex: (theme) => theme.zIndex.appBar + 1,
29
30
  top: (theme) => theme.spacing(0.5),
30
31
  right: (theme) => theme.spacing(0.5)
31
32
  }, ...rest },
@@ -116,7 +116,9 @@ export function SelectEx(props) {
116
116
  React.createElement(InputLabel, { id: labelId, shrink: search
117
117
  ? MUGlobal.searchFieldShrink
118
118
  : MUGlobal.inputFieldShrink }, label),
119
- React.createElement(Select, { ref: divRef, value: localOptions.length > 0 ? valueState !== null && valueState !== void 0 ? valueState : '' : '', input: React.createElement(OutlinedInput, { notched: true, label: label }), labelId: labelId, name: name, multiple: multiple, onChange: (event, child) => {
119
+ React.createElement(Select, { ref: divRef, value: localOptions.some((option) => itemChecked(getId(option)))
120
+ ? valueState !== null && valueState !== void 0 ? valueState : ''
121
+ : '', input: React.createElement(OutlinedInput, { notched: true, label: label }), labelId: labelId, name: name, multiple: multiple, onChange: (event, child) => {
120
122
  if (onChange)
121
123
  onChange(event, child);
122
124
  if (multiple)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.4.99",
3
+ "version": "1.5.0",
4
4
  "description": "TypeScript ReactJs framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,7 +50,7 @@
50
50
  "@emotion/react": "^11.7.1",
51
51
  "@emotion/style": "^0.8.0",
52
52
  "@emotion/styled": "^11.6.0",
53
- "@etsoo/appscript": "^1.2.42",
53
+ "@etsoo/appscript": "^1.2.43",
54
54
  "@etsoo/notificationbase": "^1.1.1",
55
55
  "@etsoo/shared": "^1.1.11",
56
56
  "@mui/icons-material": "^5.4.1",
@@ -14,6 +14,7 @@ import {
14
14
  NotificationReturn
15
15
  } from '@etsoo/notificationbase';
16
16
  import { DataTypes, WindowStorage } from '@etsoo/shared';
17
+ import { redirectTo } from '@reach/router';
17
18
  import React from 'react';
18
19
  import { NotifierMU } from '../mu/NotifierMU';
19
20
  import { ProgressCount } from '../mu/ProgressCount';
@@ -349,6 +350,14 @@ export class ReactApp<
349
350
  );
350
351
  }
351
352
 
353
+ /**
354
+ * Redirect to the Url
355
+ * @param url Url
356
+ */
357
+ override redirectTo(url: string) {
358
+ redirectTo(url);
359
+ }
360
+
352
361
  /**
353
362
  * Set page data
354
363
  * @param data Page data
@@ -47,10 +47,12 @@ export function BridgeCloseButton(props: BridgeCloseButtonProps) {
47
47
  return (
48
48
  <IconButton
49
49
  aria-label="close"
50
- color="primary"
50
+ color="secondary"
51
51
  onClick={onClickLocal}
52
+ title={title}
52
53
  sx={{
53
54
  position: 'absolute',
55
+ zIndex: (theme) => theme.zIndex.appBar + 1,
54
56
  top: (theme) => theme.spacing(0.5),
55
57
  right: (theme) => theme.spacing(0.5)
56
58
  }}
@@ -211,7 +211,11 @@ export function SelectEx<T extends {} = IdLabelDto>(props: SelectExProps<T>) {
211
211
  </InputLabel>
212
212
  <Select
213
213
  ref={divRef}
214
- value={localOptions.length > 0 ? valueState ?? '' : ''}
214
+ value={
215
+ localOptions.some((option) => itemChecked(getId(option)))
216
+ ? valueState ?? ''
217
+ : ''
218
+ }
215
219
  input={<OutlinedInput notched label={label} />}
216
220
  labelId={labelId}
217
221
  name={name}