@dvrd/dvr-controls 1.1.29 → 1.1.31

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/index.ts CHANGED
@@ -13,7 +13,7 @@ library.add(fab, far, fas);
13
13
 
14
14
  import ButtonController from './src/js/button/buttonController';
15
15
  import CheckboxController from './src/js/checkbox/checkboxController';
16
- import DialogController, {type DialogActionShape} from './src/js/dialog/dialogController';
16
+ import DialogController from './src/js/dialog/dialogController';
17
17
  import InlineDialog from './src/js/dialog/inlineDialog';
18
18
  import PasswordInput from './src/js/input/password/passwordInput';
19
19
  import PasswordRules from './src/js/input/password/passwordRules';
@@ -59,6 +59,7 @@ import FileUpload from './src/js/fileUpload/fileUpload';
59
59
  import DvrdRadioController from './src/js/radio/dvrdRadioController';
60
60
  import MobileNavigation from './src/js/navigation/mobileNavigation';
61
61
  import NumberString from './src/js/util/numberString';
62
+ import { DialogActionShape } from './src/js/util/interfaces';
62
63
 
63
64
  export {
64
65
  // Components
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvrd/dvr-controls",
3
- "version": "1.1.29",
3
+ "version": "1.1.31",
4
4
  "description": "Custom web controls",
5
5
  "main": "index.ts",
6
6
  "files": [
@@ -45,8 +45,7 @@
45
45
  "dompurify": "*",
46
46
  "js-cookie": "*",
47
47
  "react-rnd": "10.4.1",
48
- "swiper": "^11.1.4",
49
- "typescript": "*"
48
+ "swiper": "^11.1.4"
50
49
  },
51
50
  "peerDependencies": {
52
51
  "@dvrd/idate": "*",
@@ -63,6 +62,7 @@
63
62
  "react-color": "^2.19.3",
64
63
  "react-dom": "*",
65
64
  "react-router": "*",
66
- "uuid": "*"
65
+ "uuid": "*",
66
+ "typescript": "*"
67
67
  }
68
68
  }
@@ -4,204 +4,109 @@
4
4
 
5
5
  import './style/dialog.scss';
6
6
 
7
- import React, {MouseEventHandler} from 'react';
7
+ import React, {CSSProperties, useContext, useEffect, useMemo} from 'react';
8
8
  import classNames from 'classnames';
9
9
  import ButtonController from "../button/buttonController";
10
10
  import {ControlContext} from "../util/controlContext";
11
- import {enterPressed, generateUUID, hasHover} from "../util/controlUtil";
11
+ import {enterPressed} from "../util/controlUtil";
12
12
  import {colorIsWhite, convertColor} from "../util/colorUtil";
13
- import {ControlVariant} from "../util/interfaces";
14
- import {DialogActions, DialogActionShape} from "./dialogController";
13
+ import {ControlVariant, DialogActionShape, DialogDataShapeWithID} from "../util/interfaces";
14
+ import {DialogActions} from '../util/types';
15
15
 
16
16
  interface Props {
17
- onClose?: (id?: string) => void;
18
- className: string;
19
- open?: boolean;
20
- data?: DataShape;
21
- id?: string;
17
+ onClose: (id: string) => VoidFunction;
18
+ data: DialogDataShapeWithID;
19
+ className?: string;
20
+ backgroundClassName?: string;
21
+ zIndex?: number | string;
22
22
  }
23
23
 
24
- interface State {
25
- open: boolean;
26
- message: string | React.ReactElement;
27
- title: string;
28
- actions?: DialogActions;
29
- transparent: boolean;
30
- content: React.ReactElement | null;
31
- }
32
-
33
- interface DataShape {
34
- message: string | React.ReactElement;
35
- title?: string;
36
- actions?: DialogActions;
37
- transparent?: boolean;
38
- persistent?: boolean;
39
- buttonVariant?: ControlVariant;
40
- }
41
-
42
- export default class Dialog extends React.Component<Props, State> {
43
- declare context: React.ContextType<typeof ControlContext>;
44
- static contextType = ControlContext;
45
- static defaultProps = {
46
- className: '',
47
- };
48
- private buttonVariant: ControlVariant = ControlVariant.OUTLINED;
49
-
50
- onClose = () => {
51
- const {onClose, id} = this.props;
52
- this.removeKeyListener();
53
- this.setState({open: false}, () => {
54
- if (onClose) onClose(id);
55
- });
56
- };
57
-
58
- getDefaultAction = (): DialogActions => ['Oke'];
59
-
60
- state: State = {
61
- open: false,
62
- message: '',
63
- content: null,
64
- title: 'Bericht van het systeem',
65
- actions: this.getDefaultAction(),
66
- transparent: false,
67
- };
68
-
69
- dialog: HTMLElement | null = null;
70
- id = generateUUID();
71
- persistent = false;
72
-
73
- onClickBackground = () => {
74
- if (!this.persistent && this.dialog !== null && !hasHover(this.dialog))
75
- this.onClose();
76
- };
77
-
78
- // =============== NOTE Use function below to open the dialog
79
- onOpen = (data: DataShape) => {
80
- const message = data.message, title = data.title === undefined ? 'Bericht van het systeem' : data.title,
81
- actions = data.actions === undefined ? this.getDefaultAction() : data.actions,
82
- transparent = data.transparent === undefined ? false : data.transparent;
83
- this.persistent = data.persistent === undefined ? true : data.persistent;
84
- if (data.buttonVariant) this.buttonVariant = data.buttonVariant;
85
- this.setState({message, title, actions, transparent}, () => {
86
- this.setState({open: true});
87
- });
88
- this.addKeyListener();
89
- };
90
-
91
- onEnterPressed = (evt: KeyboardEvent) => {
92
- evt.stopPropagation();
93
- const {actions} = this.state;
94
- if (actions)
95
- for (const action of actions) {
96
- if (typeof (action) === 'string' || action.primary) {
97
- if (typeof action === 'string') this.onClose();
98
- else if (action.onClick) action.onClick(evt as any as React.MouseEvent);
99
- break;
100
- }
101
- }
24
+ export default function Dialog(props: Props) {
25
+ const {baseColor, contrastColor} = useContext(ControlContext);
26
+ const {onClose, data, className, backgroundClassName} = props;
27
+ const actions: DialogActions = useMemo(() => {
28
+ return data.actions ?? ['Oke'];
29
+ }, [data.actions]);
30
+ const colorStyle: CSSProperties = useMemo(() => ({
31
+ color: convertColor(colorIsWhite(baseColor) ? contrastColor : baseColor),
32
+ }), [baseColor, contrastColor])
33
+ const zIndex = useMemo(() => {
34
+ return data.zIndex ?? props.zIndex;
35
+ }, [props.zIndex, data.zIndex])
36
+
37
+ function onClickBackground(evt: React.MouseEvent) {
38
+ if (data.persistent) return;
39
+ if (evt.target !== evt.currentTarget) return;
40
+ onClose(data.id)();
102
41
  }
103
42
 
104
- keyListener = (evt: KeyboardEvent) => {
105
- if (enterPressed(evt)) {
106
- this.onEnterPressed(evt);
43
+ function extendOnClick(action: DialogActionShape) {
44
+ return function(evt: React.MouseEvent) {
45
+ if (!action.keepOpen) onClose(data.id)();
46
+ action.onClick?.(evt);
107
47
  }
108
- };
109
-
110
- addKeyListener = () => {
111
- document.addEventListener('keydown', this.keyListener);
112
- };
113
-
114
- removeKeyListener = () => {
115
- document.removeEventListener('keydown', this.keyListener);
116
- };
117
-
118
- getColorStyle = (): object => {
119
- const {baseColor, contrastColor} = this.context,
120
- color = colorIsWhite(baseColor) ? contrastColor : baseColor;
121
- return {color: convertColor(color)};
122
- };
123
-
124
- extendOnClick = (action: DialogActionShape): MouseEventHandler => (evt: any) => {
125
- if (!action.keepOpen)
126
- this.onClose();
127
- action.onClick?.(evt);
128
- };
129
-
130
- getActions = () => {
131
- const {actions} = this.state;
132
- if (actions === undefined || actions === null) return this.generateDefaultAction();
133
- if (Array.isArray(actions))
134
- return actions.map(this.renderAction);
135
- return this.renderAction(actions);
136
- };
48
+ }
137
49
 
138
- generateDefaultAction = (): React.ReactNode => (
139
- <ButtonController label={'Oke'} onClick={this.onClose} type='outlined' containerClass='dialogButton'/>
140
- );
50
+ function keyListener(evt: KeyboardEvent) {
51
+ if (!enterPressed(evt) || !actions) return;
52
+ const primaryAction = actions.find(action => typeof action === 'string' || action.primary);
53
+ if (!primaryAction) return;
141
54
 
142
- renderAction = (action: DialogActionShape | string, index?: number) => {
143
- const keyProp = index === undefined ? {} : {key: index};
144
- if (typeof action === 'string') return (
145
- <ButtonController {...keyProp} label={action} onClick={this.onClose}
146
- type={this.buttonVariant} containerClass='dialogButton'/>
147
- );
148
- return (
149
- <ButtonController {...keyProp} label={action.label} onClick={this.extendOnClick(action)}
150
- type={this.buttonVariant} containerClass='dialogButton' primary={action.primary}/>
151
- );
152
- };
55
+ if (typeof primaryAction === 'string') onClose(data.id)();
56
+ else if (primaryAction.onClick) primaryAction.onClick(evt);
57
+ }
153
58
 
154
- renderTitle = (): React.ReactNode => {
155
- const {title} = this.state;
59
+ function renderTitle() {
156
60
  return (
157
- <div className='dialogTitleContainer'>
158
- <label className='dialogTitle' style={this.getColorStyle()}>{title}</label>
61
+ <div className='dialog-title-container'>
62
+ <label className='dialog-title' style={colorStyle}>{data.title}</label>
159
63
  </div>
160
64
  )
161
- };
65
+ }
162
66
 
163
- renderMessage = (): React.ReactNode => {
164
- const {message} = this.state;
67
+ function renderMessage() {
68
+ const message = data.message;
165
69
  return (
166
- <div className='dialogMessageContainer'>
167
- {typeof message === 'string' ? <p className='dialogMessage'>{message}</p> : message}
70
+ <div className='dialog-message-container'>
71
+ {typeof message === 'string' ? <p className='dialog-message'>{message}</p> : message}
168
72
  </div>
169
73
  )
170
- };
74
+ }
171
75
 
172
- renderActions = (): React.ReactNode => {
173
- const actions = this.getActions();
76
+ function renderActions() {
174
77
  return (
175
- <div className='dialogActionsContainer'>
176
- {actions}
78
+ <div className='dialog-actions-container'>
79
+ {actions.map(renderAction)}
177
80
  </div>
178
81
  )
179
- };
180
-
181
- componentDidMount = () => {
182
- const {open, data} = this.props;
183
- if (open && data) this.onOpen(data);
184
- };
185
-
186
- componentWillUnmount = () => {
187
- this.removeKeyListener();
188
- };
82
+ }
189
83
 
190
- render = () => {
191
- const {open, transparent} = this.state, {className} = this.props;
192
- if (!open && !this.props.open) return null;
84
+ function renderAction(action: DialogActionShape | string, index: number) {
85
+ if (typeof action === 'string') return (
86
+ <ButtonController key={index} label={action} onClick={onClose(data.id)} type={ControlVariant.OUTLINED}
87
+ containerClass='dialog-button'/>
88
+ );
193
89
  return (
194
- <div className={classNames('dialogContainer', transparent && 'transparent')}
195
- onClick={this.onClickBackground}>
196
- <div className={classNames('dvr-dialog', className)} ref={ref => {
197
- this.dialog = ref
198
- }}>
199
- {this.renderTitle()}
200
- {this.renderMessage()}
201
- {this.renderActions()}
202
- </div>
203
- </div>
204
- // </WithEvents>
205
- )
90
+ <ButtonController key={index} label={action.label} onClick={extendOnClick(action)}
91
+ type={ControlVariant.OUTLINED} containerClass='dialog-button' primary={action.primary}/>
92
+ );
206
93
  }
94
+
95
+ useEffect(() => {
96
+ document.addEventListener('keydown', keyListener);
97
+ return () => {
98
+ document.removeEventListener('keydown', keyListener);
99
+ }
100
+ }, [keyListener]);
101
+
102
+ return (
103
+ <div className={classNames('dialog-container', backgroundClassName)} style={{zIndex}}
104
+ onClick={onClickBackground}>
105
+ <div className={classNames('dvr-dialog', className)}>
106
+ {renderTitle()}
107
+ {renderMessage()}
108
+ {renderActions()}
109
+ </div>
110
+ </div>
111
+ )
207
112
  }
@@ -1,71 +1,41 @@
1
1
  /*
2
- * Copyright (c) 2024. Dave van Rijn Development
2
+ * Copyright (c) 2024 - 2026. Dave van Rijn Development
3
3
  */
4
4
 
5
5
  import * as React from 'react';
6
- import {Fragment, MouseEventHandler, PureComponent, ReactElement} from 'react';
7
- import {ControlVariant, CustomAppEvent, IndexedObject} from '../util/interfaces';
6
+ import {useState} from 'react';
7
+ import {DialogDataShape, DialogDataShapeWithID} from '../util/interfaces';
8
+ import {generateComponentId, useEvent} from "../util/componentUtil";
8
9
  import Dialog from './dialog';
9
- import {generateComponentId} from "../util/componentUtil";
10
- import {WithEvents} from "../../../index";
11
-
12
- export interface DialogActionShape {
13
- label: string;
14
- onClick?: MouseEventHandler;
15
- primary?: boolean;
16
- keepOpen?: true;
17
- }
18
-
19
- export type DialogActions = (DialogActionShape | string)[];
20
10
 
21
11
  interface Props {
22
12
  className?: string;
13
+ backgroundClassName?: string;
14
+ zIndex?: number | string;
23
15
  }
24
16
 
25
- interface State {
26
- dialogs: IndexedObject<ReactElement>
27
- }
28
-
29
- interface DataShape {
30
- message: string | React.ReactElement;
31
- title?: string;
32
- actions?: DialogActions;
33
- transparent?: boolean;
34
- persistent?: boolean;
35
- buttonVariant?: ControlVariant;
36
- }
17
+ export default function DialogController(props: Props) {
18
+ const {className, backgroundClassName, zIndex} = props;
19
+ const [dialogs, setDialogs] = useState<Array<DialogDataShapeWithID>>([]);
20
+ useEvent('onOpenDialog', onOpen);
37
21
 
38
- export default class DialogController extends PureComponent<Props, State> {
39
- state: State = {
40
- dialogs: {},
41
- };
42
-
43
- onClose = (id?: string) => {
44
- if (id) {
45
- const dialogs = Object.assign({}, this.state.dialogs);
46
- delete dialogs[id];
47
- this.setState({dialogs});
22
+ function onClose(id: string) {
23
+ return function() {
24
+ setDialogs(dialogs.filter(dialog => dialog.id !== id));
48
25
  }
49
26
  }
50
27
 
51
- onOpen = (data: DataShape) => {
52
- const dialogs = Object.assign({}, this.state.dialogs), id = generateComponentId();
53
- dialogs[id] = <Dialog open data={data} id={id} onClose={this.onClose}/>;
54
- this.setState({dialogs});
55
- };
56
-
57
- getEvents = (): CustomAppEvent[] => [
58
- {eventName: 'onOpenDialog', handler: this.onOpen},
59
- ];
28
+ function onOpen(data: DialogDataShape) {
29
+ const id = generateComponentId();
30
+ setDialogs([...dialogs, {id, ...data}]);
31
+ }
60
32
 
61
- render = () => {
62
- const {className} = this.props;
63
- return <WithEvents events={this.getEvents()}>
64
- {Object.values(this.state.dialogs).map((element: ReactElement<any>, key: number) => (
65
- <Fragment key={key}>
66
- {React.cloneElement(element, {className})}
67
- </Fragment>
68
- ))}
69
- </WithEvents>
33
+ function renderDialog(data: DialogDataShapeWithID) {
34
+ return (
35
+ <Dialog onClose={onClose} data={data} zIndex={zIndex} className={className}
36
+ backgroundClassName={backgroundClassName} key={data.id}/>
37
+ )
70
38
  }
71
- }
39
+
40
+ return dialogs.map(renderDialog);
41
+ }
@@ -10,7 +10,7 @@ import ButtonController from "../button/buttonController";
10
10
  import {ControlContext} from "../util/controlContext";
11
11
  import {generateUUID, hasHover} from "../util/controlUtil";
12
12
  import {colorIsWhite, convertColor} from "../util/colorUtil";
13
- import {DialogActionShape} from "./dialogController";
13
+ import {DialogActionShape} from '../util/interfaces';
14
14
 
15
15
  interface DialogProps {
16
16
  onClose: Function,
@@ -29,7 +29,7 @@ export default class InlineDialog extends React.Component<DialogProps> {
29
29
  static contextType = ControlContext;
30
30
 
31
31
  static defaultProps = {
32
- title: 'Bericht van Klaverjassen',
32
+ title: 'Bericht van het systeem',
33
33
  actions: null,
34
34
  transparent: false,
35
35
  persistent: true,
@@ -72,19 +72,19 @@ export default class InlineDialog extends React.Component<DialogProps> {
72
72
  if (Array.isArray(actions))
73
73
  return actions.map((action: DialogActionShape, key: any) => (
74
74
  <ButtonController key={key} label={action.label} onClick={this.onClickAction(action.onClick)}
75
- type='outlined' containerClass='dialogButton'/>
75
+ type='outlined' containerClass='dialog-button'/>
76
76
  ));
77
77
  return <ButtonController label={actions.label} onClick={this.onClickAction(actions.onClick)} type='outlined'/>
78
78
  };
79
79
 
80
80
  generateDefaultAction = (): React.ReactNode => <ButtonController label={'Oke'} onClick={this.onClickDefault}
81
- type='outlined' containerClass='dialogButton'/>;
81
+ type='outlined' containerClass='dialog-button'/>;
82
82
 
83
83
  renderTitle = (): React.ReactNode => {
84
84
  const {title} = this.props;
85
85
  return (
86
- <div className='dialogTitleContainer'>
87
- <label className='dialogTitle' style={this.getColorStyle()}>{title}</label>
86
+ <div className='dialog-title-container'>
87
+ <label className='dialog-title' style={this.getColorStyle()}>{title}</label>
88
88
  </div>
89
89
  )
90
90
  };
@@ -92,8 +92,8 @@ export default class InlineDialog extends React.Component<DialogProps> {
92
92
  renderMessage = (): React.ReactNode => {
93
93
  const {message, content} = this.props;
94
94
  return (
95
- <div className='dialogMessageContainer'>
96
- <p className='dialogMessage'>{message}</p>
95
+ <div className='dialog-message-container'>
96
+ <p className='dialog-message'>{message}</p>
97
97
  {content !== undefined && content}
98
98
  </div>
99
99
  )
@@ -102,7 +102,7 @@ export default class InlineDialog extends React.Component<DialogProps> {
102
102
  renderActions = (): React.ReactNode => {
103
103
  const actions = this.getActions();
104
104
  return (
105
- <div className='dialogActionsContainer'>
105
+ <div className='dialog-actions-container'>
106
106
  {actions}
107
107
  </div>
108
108
  )
@@ -112,7 +112,7 @@ export default class InlineDialog extends React.Component<DialogProps> {
112
112
  const {open, transparent, containerClass} = this.props;
113
113
  if (!open) return null;
114
114
  return (
115
- <div className={classNames('dialogContainer', transparent && 'transparent', containerClass)}
115
+ <div className={classNames('dialog-container', transparent && 'transparent', containerClass)}
116
116
  onClick={this.onClickBackground}>
117
117
  <div className='dialog' ref={ref => {
118
118
  this.dialog = ref
@@ -6,7 +6,7 @@
6
6
  @use '../../../style/colors';
7
7
  @use '../../../style/display-breakpoints' as breakpoints;
8
8
 
9
- .dialogContainer {
9
+ .dialog-container {
10
10
  @include commons.popupContainer;
11
11
  z-index: commons.$z-index-dialog;
12
12
 
@@ -24,15 +24,15 @@
24
24
  padding: 1.5rem 2rem;
25
25
  }
26
26
 
27
- .dialogTitleContainer {
27
+ .dialog-title-container {
28
28
 
29
- .dialogTitle {
29
+ .dialog-title {
30
30
  font-size: 1.2rem;
31
31
  user-select: none;
32
32
  }
33
33
  }
34
34
 
35
- .dialogMessageContainer {
35
+ .dialog-message-container {
36
36
  padding: 1.5rem 0;
37
37
 
38
38
  .dialogMessage {
@@ -41,13 +41,13 @@
41
41
  }
42
42
  }
43
43
 
44
- .dialogActionsContainer {
44
+ .dialog-actions-container {
45
45
  display: flex;
46
46
  justify-content: flex-end;
47
47
  align-items: center;
48
48
  flex-wrap: wrap;
49
49
 
50
- .dialogButton {
50
+ .dialog-button {
51
51
  margin-right: .5rem;
52
52
 
53
53
  &:last-child {
@@ -3,8 +3,8 @@
3
3
  */
4
4
 
5
5
  import React from 'react';
6
- import {DialogActions} from "../dialog/dialogController";
7
6
  import {SnackConfig} from "./interfaces";
7
+ import {DialogActions} from './types';
8
8
 
9
9
  interface ListenerShape {
10
10
  component: string,
@@ -59,9 +59,9 @@ const listenerExists = (componentName: string, eventName: string) => {
59
59
  //==========================
60
60
 
61
61
  export const showDialog = (message: string | React.ReactElement, title: string = 'Bericht van het systeem',
62
- actions?: DialogActions | null,
63
- persistent?: boolean, transparent?: boolean) => {
64
- dispatchCustomEvent('onOpenDialog', {message, title, actions, transparent, persistent});
62
+ actions?: DialogActions | null, persistent?: boolean, transparent?: boolean,
63
+ zIndex?: string | number) => {
64
+ dispatchCustomEvent('onOpenDialog', {message, title, actions, transparent, persistent, zIndex});
65
65
  };
66
66
 
67
67
  export const showSnackbar = (text: string | React.ReactElement, config?: SnackConfig) => {
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import React, {CSSProperties, MouseEventHandler, ReactElement} from 'react';
6
+ import {DialogActions} from './types';
6
7
 
7
8
  // =========== INTERFACES
8
9
 
@@ -99,6 +100,27 @@ export interface HeaderItem {
99
100
  target?: '_blank';
100
101
  }
101
102
 
103
+ export interface DialogDataShape {
104
+ message: string | React.ReactElement;
105
+ title?: string;
106
+ actions?: DialogActions;
107
+ transparent?: boolean;
108
+ persistent?: boolean;
109
+ buttonVariant?: ControlVariant;
110
+ zIndex?: string | number;
111
+ }
112
+
113
+ export interface DialogDataShapeWithID extends DialogDataShape {
114
+ id: string;
115
+ }
116
+
117
+ export interface DialogActionShape {
118
+ label: string;
119
+ onClick?: ((evt: KeyboardEvent | React.MouseEvent) => void);
120
+ primary?: boolean;
121
+ keepOpen?: true;
122
+ }
123
+
102
124
  // =========== ENUMS
103
125
 
104
126
  export enum ModeEnum {DETAIL = 'detail', EDIT = 'edit', NEW = 'new'}
@@ -172,21 +194,21 @@ export type CustomAppEvent = {
172
194
  export type ChangeFunction<T = any> = (value: T, evt?: React.ChangeEvent) => void;
173
195
  export type ChangeKeyFunction<K = string, V = any> = (key: K) => ChangeFunction<V>;
174
196
  export type ModelResponse<T> = (obj: T, success: boolean | undefined, data: ResponseData) => void;
175
- export type StrengthGauge = { validator: (password: string) => boolean };
176
- export type PDFSetting = { key: string; label: string; type: PDFSettingType; value: any };
197
+ export type StrengthGauge = {validator: (password: string) => boolean};
198
+ export type PDFSetting = {key: string; label: string; type: PDFSettingType; value: any};
177
199
 
178
200
  export type PDFElementParams<T extends PDFElementType, O extends IndexedObject<any>> = {
179
201
  key: string;
180
202
  type: T;
181
203
  sub_type?: PDFElementSubType | null;
182
- dimensions: { left: number; top: number; width: number; height: number };
204
+ dimensions: {left: number; top: number; width: number; height: number};
183
205
  options: O;
184
206
  persistent?: PDFElementPersist;
185
207
  linkedID?: string;
186
208
  }
187
209
  export type DefaultPDFElementParams<T extends PDFElementType, O extends IndexedObject<any>> = Partial<{
188
210
  type: T;
189
- dimensions: Partial<{ left: number; top: number; width: number; height: number }>;
211
+ dimensions: Partial<{left: number; top: number; width: number; height: number}>;
190
212
  options: O;
191
213
  persistent?: PDFElementPersist;
192
214
  key: string;
@@ -222,14 +244,14 @@ export type PDFInvoiceTableParams = {
222
244
  alignment?: ElementPosition;
223
245
  persistent: PDFElementPersist;
224
246
  };
225
- export type PDFInvoiceWidths = { name: number; price: number; quantity: number; subtotal: number }
247
+ export type PDFInvoiceWidths = {name: number; price: number; quantity: number; subtotal: number}
226
248
  export type PDFTextVariables = {
227
249
  company: IndexedObject<string>;
228
250
  client: IndexedObject<string>;
229
251
  invoice: IndexedObject<string>;
230
252
  }
231
253
  export type PDFSubmitHandler = (items: PDFElementParams<any, any>[], callback?: VoidFunction) => void;
232
- export type PDFElementDimensions = { left: number; top: number; width: number; height: number };
254
+ export type PDFElementDimensions = {left: number; top: number; width: number; height: number};
233
255
 
234
256
  export type SidebarItem = {
235
257
  label: string; icon?: string | React.ReactElement<any, any>;
@@ -242,7 +264,7 @@ export type SidebarItem = {
242
264
  asNavLink?: true;
243
265
  }
244
266
  export type ResponseCallback = (data: ResponseData) => void;
245
- export type RNDDimensions = { x: number, y: number, height: number, width: number };
267
+ export type RNDDimensions = {x: number, y: number, height: number, width: number};
246
268
  export type HTMLVideoEvent = (evt: React.SyntheticEvent<HTMLVideoElement, Event>) => void;
247
269
  export type RenderFile = {
248
270
  filename: string;
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2026. Dave van Rijn Development
3
+ */
4
+
5
+ import {DialogActionShape} from './interfaces';
6
+
7
+ export type DialogActions = (DialogActionShape | string)[];