@shwfed/nuxt 0.11.3 → 0.11.4
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/module.json
CHANGED
|
@@ -28,17 +28,6 @@ function handleOpenUpdate(sessionId, open) {
|
|
|
28
28
|
reason: "dismiss"
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
function patchFooter(sessionId, definitionId, nextProps) {
|
|
32
|
-
if (!definitionId) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
overlay.patchSync(sessionId, {
|
|
36
|
-
footer: {
|
|
37
|
-
id: definitionId,
|
|
38
|
-
props: nextProps
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
31
|
const renderedSessions = computed(() => {
|
|
43
32
|
const nextSessions = [];
|
|
44
33
|
for (const session of overlay.sessions) {
|
|
@@ -46,7 +35,6 @@ const renderedSessions = computed(() => {
|
|
|
46
35
|
if (!definition) {
|
|
47
36
|
continue;
|
|
48
37
|
}
|
|
49
|
-
const footerDefinition = session.footer ? overlay.definitions[session.footer.id] : void 0;
|
|
50
38
|
nextSessions.push({
|
|
51
39
|
sessionId: session.sessionId,
|
|
52
40
|
definitionId: session.definitionId,
|
|
@@ -59,11 +47,6 @@ const renderedSessions = computed(() => {
|
|
|
59
47
|
},
|
|
60
48
|
descriptionSrOnly: session.shell.descriptionSrOnly,
|
|
61
49
|
props: session.props,
|
|
62
|
-
footer: session.footer && footerDefinition ? {
|
|
63
|
-
definitionId: session.footer.id,
|
|
64
|
-
props: session.footer.props,
|
|
65
|
-
definition: footerDefinition
|
|
66
|
-
} : void 0,
|
|
67
50
|
definition
|
|
68
51
|
});
|
|
69
52
|
}
|
|
@@ -115,23 +98,6 @@ const renderedSessions = computed(() => {
|
|
|
115
98
|
close: (value) => overlay.closeSync(session.sessionId, value),
|
|
116
99
|
patch: (nextProps) => overlay.patchSync(session.sessionId, { props: nextProps }),
|
|
117
100
|
isDesktop: modalSlotProps.isDesktop
|
|
118
|
-
}"
|
|
119
|
-
/>
|
|
120
|
-
</template>
|
|
121
|
-
|
|
122
|
-
<template
|
|
123
|
-
v-if="session.footer"
|
|
124
|
-
#footer="modalSlotProps"
|
|
125
|
-
>
|
|
126
|
-
<OverlayBody
|
|
127
|
-
:render="session.footer.definition.render"
|
|
128
|
-
:slot-props="{
|
|
129
|
-
props: session.footer.props,
|
|
130
|
-
shell: session.shell,
|
|
131
|
-
sessionId: session.sessionId,
|
|
132
|
-
close: (value) => overlay.closeSync(session.sessionId, value),
|
|
133
|
-
patch: (nextProps) => patchFooter(session.sessionId, session.footer?.definitionId, nextProps),
|
|
134
|
-
isDesktop: modalSlotProps.isDesktop
|
|
135
101
|
}"
|
|
136
102
|
/>
|
|
137
103
|
</template>
|
|
@@ -54,16 +54,32 @@ watch(currentConfig, (value) => {
|
|
|
54
54
|
}, { immediate: true });
|
|
55
55
|
const modalDefinitions = computed(() => {
|
|
56
56
|
const nextDefinitions = [];
|
|
57
|
-
for (const
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
for (const group of displayConfig.value.groups) {
|
|
58
|
+
for (const item of group.items) {
|
|
59
|
+
if (isDropdownItem(item)) {
|
|
60
|
+
for (const child of item.items) {
|
|
61
|
+
const render2 = slots[child.id];
|
|
62
|
+
if (render2) {
|
|
63
|
+
nextDefinitions.push({
|
|
64
|
+
definitionId: child.id,
|
|
65
|
+
ownerId: overlayOwnerId,
|
|
66
|
+
render: render2,
|
|
67
|
+
shell: getModalShell(child.modal)
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
const render = slots[item.id];
|
|
74
|
+
if (render) {
|
|
75
|
+
nextDefinitions.push({
|
|
76
|
+
definitionId: item.id,
|
|
77
|
+
ownerId: overlayOwnerId,
|
|
78
|
+
render,
|
|
79
|
+
shell: getModalShell(item.modal)
|
|
80
|
+
});
|
|
81
|
+
}
|
|
60
82
|
}
|
|
61
|
-
nextDefinitions.push({
|
|
62
|
-
definitionId: slotName,
|
|
63
|
-
ownerId: overlayOwnerId,
|
|
64
|
-
render,
|
|
65
|
-
shell: getModalShell(findButtonAction(slotName)?.modal)
|
|
66
|
-
});
|
|
67
83
|
}
|
|
68
84
|
return nextDefinitions;
|
|
69
85
|
});
|
|
@@ -14,19 +14,13 @@ export type OverlayShellProps = Readonly<{
|
|
|
14
14
|
dismissible?: boolean;
|
|
15
15
|
}>;
|
|
16
16
|
export type OverlayBodyProps = Readonly<Record<string, unknown>>;
|
|
17
|
-
export type OverlaySectionReferenceInput = Readonly<{
|
|
18
|
-
id: string;
|
|
19
|
-
props?: Record<string, unknown>;
|
|
20
|
-
}>;
|
|
21
17
|
export type OverlaySessionInput = Readonly<{
|
|
22
18
|
shell?: Partial<OverlayShellProps>;
|
|
23
19
|
props?: Record<string, unknown>;
|
|
24
|
-
footer?: OverlaySectionReferenceInput;
|
|
25
20
|
}>;
|
|
26
21
|
export type OverlaySessionPatch = Readonly<{
|
|
27
22
|
shell?: Partial<OverlayShellProps>;
|
|
28
23
|
props?: Record<string, unknown>;
|
|
29
|
-
footer?: OverlaySectionReferenceInput | null;
|
|
30
24
|
}>;
|
|
31
25
|
export type OverlaySlotProps = Readonly<{
|
|
32
26
|
props: OverlayBodyProps;
|
|
@@ -51,10 +45,6 @@ type OverlaySession = {
|
|
|
51
45
|
definitionId: string;
|
|
52
46
|
shell: OverlayShellState;
|
|
53
47
|
props: Record<string, unknown>;
|
|
54
|
-
footer?: {
|
|
55
|
-
id: string;
|
|
56
|
-
props: Record<string, unknown>;
|
|
57
|
-
};
|
|
58
48
|
deferred: Deferred.Deferred<OverlayResult, never>;
|
|
59
49
|
};
|
|
60
50
|
export type OverlayHandle = Readonly<{
|
|
@@ -112,18 +112,6 @@ function createOverlayRuntime() {
|
|
|
112
112
|
...patch.props
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
-
if (Reflect.has(patch, "footer")) {
|
|
116
|
-
if (patch.footer === null || patch.footer === void 0) {
|
|
117
|
-
session.footer = void 0;
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
session.footer = {
|
|
121
|
-
id: patch.footer.id,
|
|
122
|
-
props: {
|
|
123
|
-
...patch.footer.props
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
115
|
}
|
|
128
116
|
function closeSync(sessionId, value) {
|
|
129
117
|
void Effect.runPromise(closeInternal(sessionId, value));
|
|
@@ -175,9 +163,6 @@ function createOverlayRuntime() {
|
|
|
175
163
|
if (!definition) {
|
|
176
164
|
return yield* Effect.fail(createDefinitionNotFoundError(definitionId));
|
|
177
165
|
}
|
|
178
|
-
if (options?.footer && !getDefinition(options.footer.id)) {
|
|
179
|
-
return yield* Effect.fail(createDefinitionNotFoundError(options.footer.id));
|
|
180
|
-
}
|
|
181
166
|
const buttonActionOption = yield* Effect.serviceOption(ButtonActionService);
|
|
182
167
|
const buttonAction = Option.match(buttonActionOption, {
|
|
183
168
|
onNone: () => void 0,
|
|
@@ -206,12 +191,6 @@ function createOverlayRuntime() {
|
|
|
206
191
|
props: {
|
|
207
192
|
...options?.props
|
|
208
193
|
},
|
|
209
|
-
footer: options?.footer ? {
|
|
210
|
-
id: options.footer.id,
|
|
211
|
-
props: {
|
|
212
|
-
...options.footer.props
|
|
213
|
-
}
|
|
214
|
-
} : void 0,
|
|
215
194
|
deferred
|
|
216
195
|
};
|
|
217
196
|
sessions.value.push(session);
|