@mittwald/flow-remote-vue-components 1.5.42 → 1.5.43
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/dist/js/components-base/src/overlay/OverlayState.mjs +22 -4
- package/dist/js/components-base/src/overlay/OverlayState.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/version.mjs +1 -1
- package/dist/types/_bundled/flow-components-base/overlay/OverlayState.d.ts +5 -1
- package/package.json +14 -14
|
@@ -69,11 +69,20 @@ var OverlayState = class {
|
|
|
69
69
|
* @internal Bindings call it from their lifecycle.
|
|
70
70
|
*/
|
|
71
71
|
setConfirmOnCloseSource(source, confirmOnClose) {
|
|
72
|
-
runInAction(() =>
|
|
72
|
+
runInAction(() => {
|
|
73
|
+
this.confirmOnCloseSources.set(source, confirmOnClose);
|
|
74
|
+
this.withdrawUnneededConfirmation();
|
|
75
|
+
});
|
|
73
76
|
}
|
|
74
77
|
/** @internal Bindings call it from their lifecycle. */
|
|
75
78
|
removeConfirmOnCloseSource(source) {
|
|
76
|
-
runInAction(() =>
|
|
79
|
+
runInAction(() => {
|
|
80
|
+
this.confirmOnCloseSources.delete(source);
|
|
81
|
+
this.withdrawUnneededConfirmation();
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
withdrawUnneededConfirmation() {
|
|
85
|
+
if (!this.confirmOnCloseEnabled) this.showConfirmationModal = false;
|
|
77
86
|
}
|
|
78
87
|
addOpenStateHandler(handler, handlersSet) {
|
|
79
88
|
handlersSet.add(handler);
|
|
@@ -123,10 +132,19 @@ var OverlayState = class {
|
|
|
123
132
|
/**
|
|
124
133
|
* Sets the open state without running any handler. Use it to mirror a
|
|
125
134
|
* controlled `isOpen` prop, whose change comes from the consumer – notifying
|
|
126
|
-
* them of their own state would echo it back.
|
|
135
|
+
* them of their own state would echo it back. Closing this way drops a
|
|
136
|
+
* pending close confirmation as well.
|
|
127
137
|
*/
|
|
128
138
|
syncOpen(toOpen) {
|
|
139
|
+
this.assignOpenState(toOpen);
|
|
140
|
+
}
|
|
141
|
+
/** A closed overlay has no close left to confirm. */
|
|
142
|
+
assignOpenState(toOpen) {
|
|
129
143
|
this.isOpen = toOpen;
|
|
144
|
+
if (!toOpen) {
|
|
145
|
+
this.showConfirmationModal = false;
|
|
146
|
+
this.closeIsConfirmed = false;
|
|
147
|
+
}
|
|
130
148
|
}
|
|
131
149
|
applyOpenState(toOpen, options) {
|
|
132
150
|
const { bypassConfirmation = false } = options ?? {};
|
|
@@ -142,7 +160,7 @@ var OverlayState = class {
|
|
|
142
160
|
if (toOpen) aborted = this.executeOnOpen();
|
|
143
161
|
else aborted = this.executeOnClose();
|
|
144
162
|
if (!aborted) aborted = this.executeOnOpenChange(toOpen);
|
|
145
|
-
if (!aborted) this.
|
|
163
|
+
if (!aborted) this.assignOpenState(toOpen);
|
|
146
164
|
}
|
|
147
165
|
setIsContentSuspended(to) {
|
|
148
166
|
this.isContentSuspended = to;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayState.mjs","names":[],"sources":["../../../../../../components-base/src/overlay/OverlayState.ts"],"sourcesContent":["import {\n action,\n computed,\n makeObservable,\n observable,\n runInAction,\n} from \"mobx\";\n\nexport type OverlayOpenHandler = () => unknown;\nexport type OverlayCloseHandler = () => unknown;\nexport type OverlayOpenStateHandler = (isOpen: boolean) => unknown;\nexport type AnyOverlayOpenStateHandler =\n OverlayOpenHandler | OverlayCloseHandler | OverlayOpenStateHandler;\n\nexport type DisposerFn = () => void;\n\nexport interface OverlayCloseOptions {\n /** Close without asking, even when the overlay requires confirmation. */\n bypassConfirmation?: boolean;\n}\n\nexport interface OverlayStateOptions {\n isDefaultOpen?: boolean;\n /**\n * Whether closing the overlay must be confirmed while no source has an\n * opinion (`setConfirmOnCloseSource`).\n */\n confirmOnClose?: boolean;\n}\n\n/**\n * Whether an overlay is open, and whether closing it has to be confirmed first.\n * Each binding adds its subscription and its lifecycle: React's\n * `OverlayController` subclasses it, Vue's adapter wraps it in refs.\n *\n * `TCloseOptions` lets a binding pass more on a close than the state reads —\n * React's `overlay`, resolved by `Action` before the close arrives here.\n */\nexport class OverlayState<\n TCloseOptions extends OverlayCloseOptions = OverlayCloseOptions,\n> {\n public isOpen = false;\n public isContentSuspended = false;\n private onOpenHandlers = new Set<OverlayOpenHandler>();\n private onCloseHandlers = new Set<OverlayCloseHandler>();\n private onOpenChangeHandlers = new Set<OverlayOpenStateHandler>();\n\n public showConfirmationModal = false;\n public closeIsConfirmed = false;\n private readonly confirmOnCloseFromOptions: boolean;\n /**\n * Every mounted component that has an opinion on close confirmation\n * contributes one entry here – e.g. a `Modal` with a `confirmOnClose` prop\n * and a `Form` tracking its dirty state. Combining them instead of assigning\n * a single flag keeps them from overwriting each other.\n */\n private confirmOnCloseSources = observable.map<object, boolean>();\n /**\n * Active grants that allow closing without a confirmation. Each entry is\n * scoped to an ongoing operation that legitimately closes the overlay – e.g.\n * a `Form` submit – and is dropped again when that operation has finished, so\n * an operation that does _not_ close the overlay leaves the confirmation\n * armed.\n */\n private closeWithoutConfirmationGrants = new Set<object>();\n /**\n * The open state a `setOpen` call is currently applying. Handlers run before\n * `isOpen` is assigned, so a handler that calls `setOpen` again would not be\n * caught by the equality check at the top and would recurse.\n */\n private openStateInFlight: boolean | undefined;\n\n public constructor(options: OverlayStateOptions = {}) {\n makeObservable(this, {\n isOpen: observable,\n isContentSuspended: observable,\n showConfirmationModal: observable,\n confirmOnCloseEnabled: computed,\n open: action.bound,\n close: action.bound,\n toggle: action.bound,\n setOpen: action.bound,\n syncOpen: action.bound,\n setIsContentSuspended: action.bound,\n confirmClose: action.bound,\n cancelConfirmation: action.bound,\n });\n const { isDefaultOpen = false, confirmOnClose = false } = options;\n this.isOpen = isDefaultOpen;\n this.confirmOnCloseFromOptions = confirmOnClose;\n }\n\n /** Whether closing this overlay currently requires a confirmation. */\n public get confirmOnCloseEnabled(): boolean {\n if (this.confirmOnCloseSources.size === 0) {\n return this.confirmOnCloseFromOptions;\n }\n return Array.from(this.confirmOnCloseSources.values()).some(Boolean);\n }\n\n /**\n * Sets the opinion of one source – any object the caller keeps – on close\n * confirmation. Remove the source again when its owner goes away.\n *\n * @internal Bindings call it from their lifecycle.\n */\n public setConfirmOnCloseSource(source: object, confirmOnClose: boolean) {\n runInAction(() => this.confirmOnCloseSources.set(source, confirmOnClose));\n }\n\n /** @internal Bindings call it from their lifecycle. */\n public removeConfirmOnCloseSource(source: object) {\n runInAction(() => this.confirmOnCloseSources.delete(source));\n }\n\n private addOpenStateHandler<T extends AnyOverlayOpenStateHandler>(\n handler: T,\n handlersSet: Set<T>,\n ): DisposerFn {\n handlersSet.add(handler);\n return () => {\n handlersSet.delete(handler);\n };\n }\n\n private executeHandlers(\n isOpen: boolean,\n handlers: Set<\n OverlayOpenHandler | OverlayCloseHandler | OverlayOpenStateHandler\n >,\n ): boolean {\n const handlerResult = Array.from(handlers).map((handler) =>\n handler(isOpen),\n );\n return handlerResult.some((result) => result === false);\n }\n\n private executeOnClose(): boolean {\n return this.executeHandlers(false, this.onCloseHandlers);\n }\n\n private executeOnOpen(): boolean {\n return this.executeHandlers(true, this.onOpenHandlers);\n }\n\n private executeOnOpenChange(isOpen: boolean): boolean {\n return this.executeHandlers(isOpen, this.onOpenChangeHandlers);\n }\n\n public addOnClose(handler: OverlayCloseHandler) {\n return this.addOpenStateHandler(handler, this.onCloseHandlers);\n }\n\n public addOnOpen(handler: OverlayOpenHandler) {\n return this.addOpenStateHandler(handler, this.onOpenHandlers);\n }\n\n public addOnOpenChange(handler: OverlayOpenStateHandler) {\n return this.addOpenStateHandler(handler, this.onOpenChangeHandlers);\n }\n\n public open(): void {\n this.setOpen(true);\n }\n\n public close(options?: TCloseOptions): void {\n this.setOpen(false, options);\n }\n\n public toggle(): void {\n this.setOpen(!this.isOpen);\n }\n\n public setOpen(toOpen: boolean, options?: TCloseOptions): void {\n if (this.isOpen === toOpen || this.openStateInFlight === toOpen) {\n return;\n }\n\n this.openStateInFlight = toOpen;\n try {\n this.applyOpenState(toOpen, options);\n } finally {\n this.openStateInFlight = undefined;\n }\n }\n\n /**\n * Sets the open state without running any handler. Use it to mirror a\n * controlled `isOpen` prop, whose change comes from the consumer – notifying\n * them of their own state would echo it back.\n */\n public syncOpen(toOpen: boolean): void {\n this.isOpen = toOpen;\n }\n\n private applyOpenState(toOpen: boolean, options?: TCloseOptions): void {\n const { bypassConfirmation = false } = options ?? {};\n\n if (toOpen === false) {\n // The confirmation is a one-shot permission for exactly this close\n // attempt – consume it here instead of only when a close succeeds, so it\n // cannot survive an aborted close and disarm later attempts.\n const closeIsConfirmed = this.closeIsConfirmed;\n this.closeIsConfirmed = false;\n\n if (\n this.confirmOnCloseEnabled &&\n !closeIsConfirmed &&\n this.closeWithoutConfirmationGrants.size === 0 &&\n !bypassConfirmation\n ) {\n this.showConfirmationModal = true;\n return;\n }\n }\n\n let aborted: boolean;\n if (toOpen) {\n aborted = this.executeOnOpen();\n } else {\n aborted = this.executeOnClose();\n }\n if (!aborted) {\n aborted = this.executeOnOpenChange(toOpen);\n }\n\n if (!aborted) {\n this.isOpen = toOpen;\n }\n }\n\n public setIsContentSuspended(to: boolean): void {\n this.isContentSuspended = to;\n }\n\n /**\n * Allows closing this overlay without a confirmation until the returned\n * disposer is called. Use it around an operation that may legitimately close\n * the overlay – e.g. a `Form` submit, where a \"discard unsaved changes?\"\n * prompt would be nonsense – and dispose it as soon as that operation has\n * finished. An operation that ends without closing the overlay therefore\n * leaves the confirmation armed (#2775).\n */\n public grantCloseWithoutConfirmation(): DisposerFn {\n const grant = {};\n this.closeWithoutConfirmationGrants.add(grant);\n return () => {\n this.closeWithoutConfirmationGrants.delete(grant);\n };\n }\n\n public confirmClose(): void {\n this.closeIsConfirmed = true;\n this.showConfirmationModal = false;\n }\n\n public cancelConfirmation(): void {\n this.showConfirmationModal = false;\n }\n}\n"],"mappings":";;;;;;;;;;AAsCA,IAAa,eAAb,MAEE;CACA,SAAgB;CAChB,qBAA4B;C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M,QAAQ,CAAC;EACf,KAAK,+BAA+B,IAAI,KAAK;EAC7C,aAAa;GACX,KAAK,+BAA+B,OAAO,KAAK;EAClD;CACF;CAEA,eAA4B;EAC1B,KAAK,mBAAmB;EACxB,KAAK,wBAAwB;CAC/B;CAEA,qBAAkC;EAChC,KAAK,wBAAwB;CAC/B;AACF"}
|
|
1
|
+
{"version":3,"file":"OverlayState.mjs","names":[],"sources":["../../../../../../components-base/src/overlay/OverlayState.ts"],"sourcesContent":["import {\n action,\n computed,\n makeObservable,\n observable,\n runInAction,\n} from \"mobx\";\n\nexport type OverlayOpenHandler = () => unknown;\nexport type OverlayCloseHandler = () => unknown;\nexport type OverlayOpenStateHandler = (isOpen: boolean) => unknown;\nexport type AnyOverlayOpenStateHandler =\n OverlayOpenHandler | OverlayCloseHandler | OverlayOpenStateHandler;\n\nexport type DisposerFn = () => void;\n\nexport interface OverlayCloseOptions {\n /** Close without asking, even when the overlay requires confirmation. */\n bypassConfirmation?: boolean;\n}\n\nexport interface OverlayStateOptions {\n isDefaultOpen?: boolean;\n /**\n * Whether closing the overlay must be confirmed while no source has an\n * opinion (`setConfirmOnCloseSource`).\n */\n confirmOnClose?: boolean;\n}\n\n/**\n * Whether an overlay is open, and whether closing it has to be confirmed first.\n * Each binding adds its subscription and its lifecycle: React's\n * `OverlayController` subclasses it, Vue's adapter wraps it in refs.\n *\n * `TCloseOptions` lets a binding pass more on a close than the state reads —\n * React's `overlay`, resolved by `Action` before the close arrives here.\n */\nexport class OverlayState<\n TCloseOptions extends OverlayCloseOptions = OverlayCloseOptions,\n> {\n public isOpen = false;\n public isContentSuspended = false;\n private onOpenHandlers = new Set<OverlayOpenHandler>();\n private onCloseHandlers = new Set<OverlayCloseHandler>();\n private onOpenChangeHandlers = new Set<OverlayOpenStateHandler>();\n\n public showConfirmationModal = false;\n public closeIsConfirmed = false;\n private readonly confirmOnCloseFromOptions: boolean;\n /**\n * Every mounted component that has an opinion on close confirmation\n * contributes one entry here – e.g. a `Modal` with a `confirmOnClose` prop\n * and a `Form` tracking its dirty state. Combining them instead of assigning\n * a single flag keeps them from overwriting each other.\n */\n private confirmOnCloseSources = observable.map<object, boolean>();\n /**\n * Active grants that allow closing without a confirmation. Each entry is\n * scoped to an ongoing operation that legitimately closes the overlay – e.g.\n * a `Form` submit – and is dropped again when that operation has finished, so\n * an operation that does _not_ close the overlay leaves the confirmation\n * armed.\n */\n private closeWithoutConfirmationGrants = new Set<object>();\n /**\n * The open state a `setOpen` call is currently applying. Handlers run before\n * `isOpen` is assigned, so a handler that calls `setOpen` again would not be\n * caught by the equality check at the top and would recurse.\n */\n private openStateInFlight: boolean | undefined;\n\n public constructor(options: OverlayStateOptions = {}) {\n makeObservable(this, {\n isOpen: observable,\n isContentSuspended: observable,\n showConfirmationModal: observable,\n confirmOnCloseEnabled: computed,\n open: action.bound,\n close: action.bound,\n toggle: action.bound,\n setOpen: action.bound,\n syncOpen: action.bound,\n setIsContentSuspended: action.bound,\n confirmClose: action.bound,\n cancelConfirmation: action.bound,\n });\n const { isDefaultOpen = false, confirmOnClose = false } = options;\n this.isOpen = isDefaultOpen;\n this.confirmOnCloseFromOptions = confirmOnClose;\n }\n\n /** Whether closing this overlay currently requires a confirmation. */\n public get confirmOnCloseEnabled(): boolean {\n if (this.confirmOnCloseSources.size === 0) {\n return this.confirmOnCloseFromOptions;\n }\n return Array.from(this.confirmOnCloseSources.values()).some(Boolean);\n }\n\n /**\n * Sets the opinion of one source – any object the caller keeps – on close\n * confirmation. Remove the source again when its owner goes away.\n *\n * @internal Bindings call it from their lifecycle.\n */\n public setConfirmOnCloseSource(source: object, confirmOnClose: boolean) {\n runInAction(() => {\n this.confirmOnCloseSources.set(source, confirmOnClose);\n this.withdrawUnneededConfirmation();\n });\n }\n\n /** @internal Bindings call it from their lifecycle. */\n public removeConfirmOnCloseSource(source: object) {\n runInAction(() => {\n this.confirmOnCloseSources.delete(source);\n this.withdrawUnneededConfirmation();\n });\n }\n\n private withdrawUnneededConfirmation() {\n if (!this.confirmOnCloseEnabled) {\n this.showConfirmationModal = false;\n }\n }\n\n private addOpenStateHandler<T extends AnyOverlayOpenStateHandler>(\n handler: T,\n handlersSet: Set<T>,\n ): DisposerFn {\n handlersSet.add(handler);\n return () => {\n handlersSet.delete(handler);\n };\n }\n\n private executeHandlers(\n isOpen: boolean,\n handlers: Set<\n OverlayOpenHandler | OverlayCloseHandler | OverlayOpenStateHandler\n >,\n ): boolean {\n const handlerResult = Array.from(handlers).map((handler) =>\n handler(isOpen),\n );\n return handlerResult.some((result) => result === false);\n }\n\n private executeOnClose(): boolean {\n return this.executeHandlers(false, this.onCloseHandlers);\n }\n\n private executeOnOpen(): boolean {\n return this.executeHandlers(true, this.onOpenHandlers);\n }\n\n private executeOnOpenChange(isOpen: boolean): boolean {\n return this.executeHandlers(isOpen, this.onOpenChangeHandlers);\n }\n\n public addOnClose(handler: OverlayCloseHandler) {\n return this.addOpenStateHandler(handler, this.onCloseHandlers);\n }\n\n public addOnOpen(handler: OverlayOpenHandler) {\n return this.addOpenStateHandler(handler, this.onOpenHandlers);\n }\n\n public addOnOpenChange(handler: OverlayOpenStateHandler) {\n return this.addOpenStateHandler(handler, this.onOpenChangeHandlers);\n }\n\n public open(): void {\n this.setOpen(true);\n }\n\n public close(options?: TCloseOptions): void {\n this.setOpen(false, options);\n }\n\n public toggle(): void {\n this.setOpen(!this.isOpen);\n }\n\n public setOpen(toOpen: boolean, options?: TCloseOptions): void {\n if (this.isOpen === toOpen || this.openStateInFlight === toOpen) {\n return;\n }\n\n this.openStateInFlight = toOpen;\n try {\n this.applyOpenState(toOpen, options);\n } finally {\n this.openStateInFlight = undefined;\n }\n }\n\n /**\n * Sets the open state without running any handler. Use it to mirror a\n * controlled `isOpen` prop, whose change comes from the consumer – notifying\n * them of their own state would echo it back. Closing this way drops a\n * pending close confirmation as well.\n */\n public syncOpen(toOpen: boolean): void {\n this.assignOpenState(toOpen);\n }\n\n /** A closed overlay has no close left to confirm. */\n private assignOpenState(toOpen: boolean): void {\n this.isOpen = toOpen;\n if (!toOpen) {\n this.showConfirmationModal = false;\n this.closeIsConfirmed = false;\n }\n }\n\n private applyOpenState(toOpen: boolean, options?: TCloseOptions): void {\n const { bypassConfirmation = false } = options ?? {};\n\n if (toOpen === false) {\n // The confirmation is a one-shot permission for exactly this close\n // attempt – consume it here instead of only when a close succeeds, so it\n // cannot survive an aborted close and disarm later attempts.\n const closeIsConfirmed = this.closeIsConfirmed;\n this.closeIsConfirmed = false;\n\n if (\n this.confirmOnCloseEnabled &&\n !closeIsConfirmed &&\n this.closeWithoutConfirmationGrants.size === 0 &&\n !bypassConfirmation\n ) {\n this.showConfirmationModal = true;\n return;\n }\n }\n\n let aborted: boolean;\n if (toOpen) {\n aborted = this.executeOnOpen();\n } else {\n aborted = this.executeOnClose();\n }\n if (!aborted) {\n aborted = this.executeOnOpenChange(toOpen);\n }\n\n if (!aborted) {\n this.assignOpenState(toOpen);\n }\n }\n\n public setIsContentSuspended(to: boolean): void {\n this.isContentSuspended = to;\n }\n\n /**\n * Allows closing this overlay without a confirmation until the returned\n * disposer is called. Use it around an operation that may legitimately close\n * the overlay – e.g. a `Form` submit, where a \"discard unsaved changes?\"\n * prompt would be nonsense – and dispose it as soon as that operation has\n * finished. An operation that ends without closing the overlay therefore\n * leaves the confirmation armed (#2775).\n */\n public grantCloseWithoutConfirmation(): DisposerFn {\n const grant = {};\n this.closeWithoutConfirmationGrants.add(grant);\n return () => {\n this.closeWithoutConfirmationGrants.delete(grant);\n };\n }\n\n public confirmClose(): void {\n this.closeIsConfirmed = true;\n this.showConfirmationModal = false;\n }\n\n public cancelConfirmation(): void {\n this.showConfirmationModal = false;\n }\n}\n"],"mappings":";;;;;;;;;;AAsCA,IAAa,eAAb,MAEE;CACA,SAAgB;CAChB,qBAA4B;CAC5B,iCAAyB,IAAI,IAAwB;CACrD,kCAA0B,IAAI,IAAyB;CACvD,uCAA+B,IAAI,IAA6B;CAEhE,wBAA+B;CAC/B,mBAA0B;C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oBAAoB,MAAM;EAG3C,IAAI,CAAC,SACH,KAAK,gBAAgB,MAAM;CAE/B;CAEA,sBAA6B,IAAmB;EAC9C,KAAK,qBAAqB;CAC5B;;;;;;;;;CAUA,gCAAmD;EACjD,MAAM,QAAQ,CAAC;EACf,KAAK,+BAA+B,IAAI,KAAK;EAC7C,aAAa;GACX,KAAK,+BAA+B,OAAO,KAAK;EAClD;CACF;CAEA,eAA4B;EAC1B,KAAK,mBAAmB;EACxB,KAAK,wBAAwB;CAC/B;CAEA,qBAAkC;EAChC,KAAK,wBAAwB;CAC/B;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Version } from "@mittwald/flow-remote-core";
|
|
2
2
|
//#region src/version.ts
|
|
3
3
|
var communicationVersion = Version.v5;
|
|
4
|
-
var packageVersion = "1.5.
|
|
4
|
+
var packageVersion = "1.5.43";
|
|
5
5
|
var version = communicationVersion;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { communicationVersion, packageVersion, version };
|
|
@@ -56,6 +56,7 @@ export declare class OverlayState<TCloseOptions extends OverlayCloseOptions = Ov
|
|
|
56
56
|
constructor(options?: OverlayStateOptions);
|
|
57
57
|
/** Whether closing this overlay currently requires a confirmation. */
|
|
58
58
|
get confirmOnCloseEnabled(): boolean;
|
|
59
|
+
private withdrawUnneededConfirmation;
|
|
59
60
|
private addOpenStateHandler;
|
|
60
61
|
private executeHandlers;
|
|
61
62
|
private executeOnClose;
|
|
@@ -71,9 +72,12 @@ export declare class OverlayState<TCloseOptions extends OverlayCloseOptions = Ov
|
|
|
71
72
|
/**
|
|
72
73
|
* Sets the open state without running any handler. Use it to mirror a
|
|
73
74
|
* controlled `isOpen` prop, whose change comes from the consumer – notifying
|
|
74
|
-
* them of their own state would echo it back.
|
|
75
|
+
* them of their own state would echo it back. Closing this way drops a
|
|
76
|
+
* pending close confirmation as well.
|
|
75
77
|
*/
|
|
76
78
|
syncOpen(toOpen: boolean): void;
|
|
79
|
+
/** A closed overlay has no close left to confirm. */
|
|
80
|
+
private assignOpenState;
|
|
77
81
|
private applyOpenState;
|
|
78
82
|
setIsContentSuspended(to: boolean): void;
|
|
79
83
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-remote-vue-components",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.43",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Vue components that can be used in a remote environment",
|
|
6
6
|
"homepage": "https://flow.mittwald.de",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@internationalized/date": "^3.12.3",
|
|
44
|
-
"@mittwald/flow-remote-core": "1.5.
|
|
45
|
-
"@mittwald/flow-remote-elements": "1.5.
|
|
44
|
+
"@mittwald/flow-remote-core": "1.5.43",
|
|
45
|
+
"@mittwald/flow-remote-elements": "1.5.43",
|
|
46
46
|
"@tanstack/table-core": "^8.21.3",
|
|
47
47
|
"country-codes-list": "^2.0.0",
|
|
48
48
|
"dot-prop": "^10.2.0",
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
"remeda": "^2.43.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@mittwald/ext-bridge": "1.5.
|
|
56
|
-
"@mittwald/flow-components-base": "1.5.
|
|
57
|
-
"@mittwald/flow-core": "1.5.
|
|
58
|
-
"@mittwald/flow-icons-base": "1.5.
|
|
59
|
-
"@mittwald/flow-react-components": "1.5.
|
|
60
|
-
"@mittwald/flow-remote-react-components": "1.5.
|
|
61
|
-
"@mittwald/flow-remote-react-renderer": "1.5.
|
|
62
|
-
"@mittwald/typescript-config": "1.5.
|
|
55
|
+
"@mittwald/ext-bridge": "1.5.43",
|
|
56
|
+
"@mittwald/flow-components-base": "1.5.43",
|
|
57
|
+
"@mittwald/flow-core": "1.5.43",
|
|
58
|
+
"@mittwald/flow-icons-base": "1.5.43",
|
|
59
|
+
"@mittwald/flow-react-components": "1.5.43",
|
|
60
|
+
"@mittwald/flow-remote-react-components": "1.5.43",
|
|
61
|
+
"@mittwald/flow-remote-react-renderer": "1.5.43",
|
|
62
|
+
"@mittwald/typescript-config": "1.5.43",
|
|
63
63
|
"@quilted/threads": "^3.3.1",
|
|
64
64
|
"@types/node": "^25.9.3",
|
|
65
65
|
"@types/react": "^19.2",
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
"vue": "~3.5.38"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
|
-
"@mittwald/ext-bridge": "1.5.
|
|
83
|
-
"@mittwald/flow-react-components": "1.5.
|
|
82
|
+
"@mittwald/ext-bridge": "1.5.43",
|
|
83
|
+
"@mittwald/flow-react-components": "1.5.43",
|
|
84
84
|
"vue": "^3.5.0"
|
|
85
85
|
},
|
|
86
86
|
"flowStatus": "beta",
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "1674f81f415a6800a14dd2e535a76c1442c1347b"
|
|
88
88
|
}
|