@signal24/vue-foundation 4.25.8 → 4.26.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@signal24/vue-foundation",
3
3
  "type": "module",
4
- "version": "4.25.8",
4
+ "version": "4.26.0",
5
5
  "description": "Common components, directives, and helpers for Vue 3 apps",
6
6
  "module": "./dist/vue-foundation.es.js",
7
7
  "exports": {
@@ -1,4 +1,4 @@
1
- import { createOverlayInjection, presentOverlay, removeOverlayInjection } from './overlay-container';
1
+ import { createOverlayInjection, presentOverlay, removeOverlayInjection, updateOverlayProps } from './overlay-container';
2
2
  import AlertModal from './vf-alert-modal.vue';
3
3
 
4
4
  interface IAlertOptions {
@@ -64,3 +64,26 @@ export function showWait(arg0: string | IAlertOptions, arg1?: string): () => voi
64
64
  });
65
65
  return () => removeOverlayInjection(injection);
66
66
  }
67
+
68
+ interface IMutableWait {
69
+ update: (message: string) => void;
70
+ dismiss: () => void;
71
+ }
72
+ export function showMutableWait(title: string, message: string): IMutableWait;
73
+ export function showMutableWait(message: string): IMutableWait;
74
+ export function showMutableWait(options: IAlertOptions): IMutableWait;
75
+ export function showMutableWait(arg0: string | IAlertOptions, arg1?: string): IMutableWait {
76
+ const params = resolveAlertParams(arg0, arg1);
77
+ const injection = createOverlayInjection(AlertModal, {
78
+ ...params,
79
+ isBare: true,
80
+ classes: ['wait', ...params.classes],
81
+ callback: () => {}
82
+ });
83
+ return {
84
+ update: (message: string) => {
85
+ updateOverlayProps(injection, { message });
86
+ },
87
+ dismiss: () => removeOverlayInjection(injection)
88
+ };
89
+ }
@@ -189,3 +189,13 @@ export async function presentOverlay<C extends OverlayComponent, R extends Compo
189
189
  overlayInjection = createOverlayInjection(component, resolvedProps, options);
190
190
  });
191
191
  }
192
+
193
+ export async function updateOverlayProps<C extends OverlayComponent>(
194
+ injection: OverlayInjection<C, any>,
195
+ props: Partial<Omit<OverlayComponentProps<C>, 'callback'>>
196
+ ) {
197
+ const targetProps = injection.vnode.component!.props;
198
+ for (const key in props) {
199
+ targetProps[key] = props[key];
200
+ }
201
+ }