@dvrd/dvr-controls 1.0.48 → 1.0.49

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvrd/dvr-controls",
3
- "version": "1.0.48",
3
+ "version": "1.0.49",
4
4
  "description": "Custom web controls",
5
5
  "main": "index.ts",
6
6
  "files": [
@@ -121,10 +121,10 @@ export default class Dialog extends React.Component<Props, State> {
121
121
  return {color: convertColor(color)};
122
122
  };
123
123
 
124
- extendOnClick = (onClick?: Function): MouseEventHandler => (evt: any) => {
125
- this.onClose();
126
- if (onClick !== undefined && onClick !== null)
127
- onClick(evt);
124
+ extendOnClick = (action: DialogActionShape): MouseEventHandler => (evt: any) => {
125
+ if (!action.keepOpen)
126
+ this.onClose();
127
+ action.onClick?.(evt);
128
128
  };
129
129
 
130
130
  getActions = () => {
@@ -146,7 +146,7 @@ export default class Dialog extends React.Component<Props, State> {
146
146
  type={this.buttonVariant} containerClass='dialogButton'/>
147
147
  );
148
148
  return (
149
- <ButtonController {...keyProp} label={action.label} onClick={this.extendOnClick(action.onClick)}
149
+ <ButtonController {...keyProp} label={action.label} onClick={this.extendOnClick(action)}
150
150
  type={this.buttonVariant} containerClass='dialogButton' primary={action.primary}/>
151
151
  );
152
152
  };
@@ -13,6 +13,7 @@ export interface DialogActionShape {
13
13
  label: string;
14
14
  onClick?: MouseEventHandler;
15
15
  primary?: boolean;
16
+ keepOpen?: true;
16
17
  }
17
18
 
18
19
  export type DialogActions = (DialogActionShape | string)[];