@vokril/ui-solid 0.27.1 → 0.29.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/CHANGELOG.md +37 -0
- package/README.md +36 -1
- package/dist/{AttributeGrid-XTVaiwLe.js → AttributeGrid-CASILa4u.js} +3 -3
- package/dist/{AttributeGrid-Qzt5LYnu.cjs → AttributeGrid-eND8YDby.cjs} +1 -1
- package/dist/{Button-U95Tz8F5.cjs → Button-Bb68ymNP.cjs} +1 -1
- package/dist/{Button-qtxB2SYf.js → Button-D-T0tyGF.js} +1 -1
- package/dist/CommandPalette-5FQRgPG9.cjs +2 -0
- package/dist/CommandPalette-Cj618AOz.js +4017 -0
- package/dist/{CopyButton-CsM8UeX5.cjs → CopyButton-B5gS2ft3.cjs} +1 -1
- package/dist/{CopyButton-NfxWzVHT.js → CopyButton-g-WSiBDZ.js} +1 -1
- package/dist/{DateRangePicker-C8IVJRT2.js → DateRangePicker-CJD9ADgB.js} +3 -3
- package/dist/{DateRangePicker-BKHxyHL4.cjs → DateRangePicker-Frc0HVxp.cjs} +1 -1
- package/dist/{GuidedTour-B61cbsdy.cjs → GuidedTour-B6q7lYhn.cjs} +1 -1
- package/dist/{GuidedTour-Dj41FCdE.js → GuidedTour-CFCvRJN4.js} +3 -3
- package/dist/{IconPicker-BZCQG8SO.cjs → IconPicker-CIbJb1ei.cjs} +1 -1
- package/dist/{IconPicker-DC9E35Ou.js → IconPicker-DYqNi5ud.js} +3 -3
- package/dist/{Modal-CaurOG_K.cjs → Modal-CY6ePolt.cjs} +1 -1
- package/dist/{Modal-DJpQqqTJ.js → Modal-NzZzHSwb.js} +2 -2
- package/dist/{PageSkeleton-DICmahMs.cjs → PageSkeleton-BPbb28-H.cjs} +1 -1
- package/dist/{PageSkeleton-C0eVQO20.js → PageSkeleton-CLnJO6uD.js} +3 -3
- package/dist/{SearchableSelect-DayP1Qs6.js → SearchableSelect-BvCm4enQ.js} +2 -2
- package/dist/{SearchableSelect-ClrAX2hK.cjs → SearchableSelect-CVqdVMOC.cjs} +1 -1
- package/dist/{StatusBarNotificationBell-BRnCKU72.js → StatusBarNotificationBell-7Izs_msz.js} +4936 -4585
- package/dist/StatusBarNotificationBell-BJiORN4s.cjs +50 -0
- package/dist/{Stepper-DTuchuOX.cjs → Stepper-Ci5JpLbS.cjs} +1 -1
- package/dist/{Stepper-aiuAdbkl.js → Stepper-D9i1Xclm.js} +1 -1
- package/dist/{TimeSeriesChart-SHx_cp8y.js → TimeSeriesChart-DOwi2lJs.js} +1 -1
- package/dist/{TimeSeriesChart-CvU0lxar.cjs → TimeSeriesChart-huvheefm.cjs} +1 -1
- package/dist/{ToggleButton-BcHNAGPy.cjs → ToggleButton-BFWh1_o5.cjs} +1 -1
- package/dist/{ToggleButton-BhP17bvW.js → ToggleButton-CFM8P3JY.js} +4 -4
- package/dist/_internal/contract/browser/workspace.d.cts +4 -0
- package/dist/_internal/contract/browser/workspace.d.ts +4 -0
- package/dist/_internal/contract/notification.d.cts +64 -4
- package/dist/_internal/contract/notification.d.ts +64 -4
- package/dist/_internal/contract/notificationCatalog.d.cts +7 -1
- package/dist/_internal/contract/notificationCatalog.d.ts +7 -1
- package/dist/charts/index.cjs +1 -1
- package/dist/charts/index.js +1 -1
- package/dist/{createDialogShellFocus-Vv3hhW-I.js → createDialogShellFocus-B4piXDU4.js} +1 -1
- package/dist/{createDialogShellFocus-CsrZ2GDZ.cjs → createDialogShellFocus-CJaw9-B9.cjs} +1 -1
- package/dist/{createResizableSidebar-DnHgvr7P.js → createResizableSidebar-BDUlX9-G.js} +3 -3
- package/dist/{createResizableSidebar-CeksJQ9Q.cjs → createResizableSidebar-BVJBU2kP.cjs} +1 -1
- package/dist/de-BqFZ0Ac8.cjs +1 -0
- package/dist/{server/de-CEltsqV5.js → de-q3NXnC0J.js} +27 -25
- package/dist/desktop/index.cjs +1 -1
- package/dist/desktop/index.js +1 -1
- package/dist/feedback/index.cjs +1 -1
- package/dist/feedback/index.js +2 -2
- package/dist/forms/index.cjs +1 -1
- package/dist/forms/index.js +7 -7
- package/dist/grid/index.cjs +1 -1
- package/dist/grid/index.js +1 -1
- package/dist/host/index.cjs +1 -1
- package/dist/host/index.js +1 -1
- package/dist/i18n/index.cjs +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/messageKeys.d.cts +1 -1
- package/dist/i18n/messageKeys.d.ts +1 -1
- package/dist/{i18n-DW9kcu0G.js → i18n-CBlUGOyu.js} +2 -2
- package/dist/{server/i18n-DZ0JlZal.cjs → i18n-D3s-a2a0.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +250 -246
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.js +2 -2
- package/dist/navigation/index.cjs +1 -1
- package/dist/navigation/index.js +1 -1
- package/dist/notifications/NotificationItem.d.cts +15 -1
- package/dist/notifications/NotificationItem.d.ts +15 -1
- package/dist/notifications/RunningProgressCards.d.cts +20 -0
- package/dist/notifications/RunningProgressCards.d.ts +20 -0
- package/dist/notifications/StatusBarNotificationBell.d.cts +29 -5
- package/dist/notifications/StatusBarNotificationBell.d.ts +29 -5
- package/dist/notifications/createNotificationPreviewRuntime.d.cts +2 -2
- package/dist/notifications/createNotificationPreviewRuntime.d.ts +2 -2
- package/dist/notifications/dismissableToastIds.d.cts +5 -1
- package/dist/notifications/dismissableToastIds.d.ts +5 -1
- package/dist/notifications/fireNotification.d.cts +33 -1
- package/dist/notifications/fireNotification.d.ts +33 -1
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.d.cts +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.js +49 -45
- package/dist/notifications/nativeEngine.d.cts +125 -5
- package/dist/notifications/nativeEngine.d.ts +125 -5
- package/dist/notifications/notificationCardServices.d.cts +5 -1
- package/dist/notifications/notificationCardServices.d.ts +5 -1
- package/dist/notifications/notificationCommands.d.cts +16 -4
- package/dist/notifications/notificationCommands.d.ts +16 -4
- package/dist/notifications/notificationOverlaySnapshot.d.cts +1 -0
- package/dist/notifications/notificationOverlaySnapshot.d.ts +1 -0
- package/dist/notifications/notificationService.d.cts +36 -1
- package/dist/notifications/notificationService.d.ts +36 -1
- package/dist/notifications/quietHours.d.cts +10 -0
- package/dist/notifications/quietHours.d.ts +10 -0
- package/dist/notifications/toast.d.cts +32 -1
- package/dist/notifications/toast.d.ts +32 -1
- package/dist/overlay/ConfirmDialog.d.cts +68 -2
- package/dist/overlay/ConfirmDialog.d.ts +68 -2
- package/dist/overlay/index.cjs +1 -1
- package/dist/overlay/index.js +4 -4
- package/dist/{rowSource-C43bEUD4.js → rowSource-D__7o4h0.js} +1 -1
- package/dist/{rowSource-Dg-jndEu.cjs → rowSource-DiwTu_r8.cjs} +1 -1
- package/dist/server/{AttributeGrid-C_CvCXpC.cjs → AttributeGrid-B7sb3btp.cjs} +1 -1
- package/dist/server/{AttributeGrid-D8QYVZDq.js → AttributeGrid-CMi-UtWb.js} +3 -3
- package/dist/server/{Button-VKl-_GaO.cjs → Button-0AXWRw9Q.cjs} +1 -1
- package/dist/server/{Button-BPNNFcHc.js → Button-3yNrnn4P.js} +1 -1
- package/dist/server/{CommandPalette-COVjWlx9.js → CommandPalette-CozogFlk.js} +980 -947
- package/dist/server/CommandPalette-DQK6N98N.cjs +1 -0
- package/dist/server/{CopyButton-HDffWzaN.js → CopyButton-B6xd9Z6j.js} +1 -1
- package/dist/server/{CopyButton-rWDnbTBF.cjs → CopyButton-D8IN6Vnd.cjs} +1 -1
- package/dist/server/{DateRangePicker-Dl3zr-PD.js → DateRangePicker-C35q8BTw.js} +2 -2
- package/dist/server/{DateRangePicker-Dq0HGz27.cjs → DateRangePicker-KLZzyuPJ.cjs} +1 -1
- package/dist/server/{GuidedTour-BoPGRyX5.cjs → GuidedTour-DfV0yzqh.cjs} +1 -1
- package/dist/server/{GuidedTour-CIlHyRcR.js → GuidedTour-DmLbBttx.js} +3 -3
- package/dist/server/{IconPicker-BDS92veL.cjs → IconPicker-B1soopAp.cjs} +1 -1
- package/dist/server/{IconPicker-CZxYKJOT.js → IconPicker-B4aXspLw.js} +4 -4
- package/dist/server/{Modal-j54-C2Md.js → Modal-BheFQLs1.js} +2 -2
- package/dist/server/{Modal-CtJFoR96.cjs → Modal-BswxV8Pn.cjs} +1 -1
- package/dist/server/{PageSkeleton-B0V43uDV.cjs → PageSkeleton-DBo7hQq-.cjs} +1 -1
- package/dist/server/{PageSkeleton-BfGfda9G.js → PageSkeleton-DoxlE_bD.js} +3 -3
- package/dist/server/{SearchableSelect-ClQzcYdL.cjs → SearchableSelect-09ECcDlB.cjs} +1 -1
- package/dist/server/{SearchableSelect-DtcMC7Xu.js → SearchableSelect-vjhS4c-H.js} +2 -2
- package/dist/server/{StatusBarNotificationBell-FFpOkyUk.js → StatusBarNotificationBell-D8Jt3PXI.js} +4869 -4515
- package/dist/server/StatusBarNotificationBell-LJHLMT9F.cjs +49 -0
- package/dist/server/{Stepper-CCEItuZb.cjs → Stepper-DxNrskdq.cjs} +1 -1
- package/dist/server/{Stepper-B7wf8h9G.js → Stepper-n5f9r-ye.js} +1 -1
- package/dist/server/{TimeSeriesChart-TsaZS7YU.cjs → TimeSeriesChart-BQVXUFoj.cjs} +1 -1
- package/dist/server/{TimeSeriesChart-DjNQiCn_.js → TimeSeriesChart-PAb95s6x.js} +1 -1
- package/dist/server/{ToggleButton-CHaIvApv.js → ToggleButton-FywO2CCI.js} +3 -3
- package/dist/server/{ToggleButton-D6Tux9wG.cjs → ToggleButton-TE3Xf2yD.cjs} +1 -1
- package/dist/server/charts/index.cjs +1 -1
- package/dist/server/charts/index.js +1 -1
- package/dist/server/{createResizableSidebar-Dn9UMUf_.js → createResizableSidebar-BImbKlLe.js} +3 -3
- package/dist/server/{createResizableSidebar-B0NDaq7D.cjs → createResizableSidebar-GFgZIj-5.cjs} +1 -1
- package/dist/server/de-BqFZ0Ac8.cjs +1 -0
- package/dist/{de-CEltsqV5.js → server/de-q3NXnC0J.js} +27 -25
- package/dist/server/desktop/index.cjs +1 -1
- package/dist/server/desktop/index.js +1 -1
- package/dist/server/feedback/index.cjs +1 -1
- package/dist/server/feedback/index.js +2 -2
- package/dist/server/forms/index.cjs +1 -1
- package/dist/server/forms/index.js +6 -6
- package/dist/server/grid/index.cjs +1 -1
- package/dist/server/grid/index.js +1 -1
- package/dist/server/host/index.cjs +1 -1
- package/dist/server/host/index.js +1 -1
- package/dist/server/i18n/index.cjs +1 -1
- package/dist/server/i18n/index.js +1 -1
- package/dist/server/{i18n-DW9kcu0G.js → i18n-CBlUGOyu.js} +2 -2
- package/dist/{i18n-DZ0JlZal.cjs → server/i18n-D3s-a2a0.cjs} +1 -1
- package/dist/server/{index-BfR3Xipt.cjs → index-2mQPVEDR.cjs} +1 -1
- package/dist/server/{index-Wv18Fcu8.js → index-UIjsx3oJ.js} +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.js +183 -179
- package/dist/server/layout/index.cjs +1 -1
- package/dist/server/layout/index.js +2 -2
- package/dist/server/navigation/index.cjs +1 -1
- package/dist/server/navigation/index.js +1 -1
- package/dist/server/notifications/index.cjs +1 -1
- package/dist/server/notifications/index.js +49 -45
- package/dist/server/overlay/index.cjs +1 -1
- package/dist/server/overlay/index.js +3 -3
- package/dist/server/{rowSource-CYYdnUFl.js → rowSource-D-wcDmFU.js} +1 -1
- package/dist/server/{rowSource-DoBeEg9N.cjs → rowSource-DltiY0o3.cjs} +1 -1
- package/dist/server/{tr-CxuAFkCi.js → tr-C_dUz00P.js} +32 -30
- package/dist/server/tr-D7bwe7tl.cjs +1 -0
- package/dist/server/tree/index.cjs +1 -1
- package/dist/server/tree/index.js +1 -1
- package/dist/solid/i18n/locales/de.json +2 -0
- package/dist/solid/i18n/locales/tr.json +2 -0
- package/dist/solid/notifications/NotificationHost.jsx +5 -14
- package/dist/solid/notifications/NotificationItem.jsx +40 -15
- package/dist/solid/notifications/NotificationPanel.jsx +8 -3
- package/dist/solid/notifications/NotificationsCenter.jsx +4 -1
- package/dist/solid/notifications/RunningProgressCards.jsx +29 -0
- package/dist/solid/notifications/StatusBarNotificationBell.jsx +42 -18
- package/dist/solid/notifications/StatusBarNotificationBell.module.css.js +1 -0
- package/dist/solid/notifications/catalogAdapter.js +2 -1
- package/dist/solid/notifications/createNotificationPreviewRuntime.js +49 -35
- package/dist/solid/notifications/fireNotification.js +53 -27
- package/dist/solid/notifications/index.js +1 -1
- package/dist/solid/notifications/nativeEngine.js +174 -31
- package/dist/solid/notifications/notificationCardServices.js +1 -1
- package/dist/solid/notifications/notificationOverlaySnapshot.js +2 -0
- package/dist/solid/notifications/notificationOverlaySync.js +1 -0
- package/dist/solid/notifications/notificationService.js +48 -0
- package/dist/solid/notifications/quietHours.js +18 -0
- package/dist/solid/notifications/toast.js +30 -11
- package/dist/solid/overlay/ConfirmDialog.jsx +57 -17
- package/dist/solid/overlay/ConfirmDialog.module.css.js +1 -0
- package/dist/style.css +1 -1
- package/dist/{tr-CxuAFkCi.js → tr-C_dUz00P.js} +32 -30
- package/dist/tr-D7bwe7tl.cjs +1 -0
- package/dist/tree/index.cjs +1 -1
- package/dist/tree/index.js +1 -1
- package/dist/ui.css +1 -1
- package/package.json +1 -1
- package/dist/CommandPalette-Bf8flX2t.cjs +0 -2
- package/dist/CommandPalette-CoIdCmZ0.js +0 -3977
- package/dist/StatusBarNotificationBell-B4v__j6s.cjs +0 -50
- package/dist/de-DRobPEJV.cjs +0 -1
- package/dist/server/CommandPalette-C_9Z8gVc.cjs +0 -1
- package/dist/server/StatusBarNotificationBell-D9oc6WVf.cjs +0 -49
- package/dist/server/de-DRobPEJV.cjs +0 -1
- package/dist/server/tr-BDbiY5YD.cjs +0 -1
- package/dist/tr-BDbiY5YD.cjs +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Show, createEffect, createSignal, createUniqueId, on, onCleanup, } from 'solid-js';
|
|
2
2
|
import { OverlayPortal } from './OverlayPortal';
|
|
3
3
|
import { Button } from '../forms/Button';
|
|
4
|
+
import { Checkbox } from '../forms/Checkbox';
|
|
4
5
|
import { Input } from '../forms/Input';
|
|
5
6
|
import { Textarea } from '../forms/Textarea';
|
|
6
7
|
import { createDialogFocusScope } from './dialogFocusScope';
|
|
@@ -18,6 +19,8 @@ const hostDocOf = (host) => (host?.() ?? getMainWindow().window).document;
|
|
|
18
19
|
export function ConfirmDialog(props) {
|
|
19
20
|
const titleId = createUniqueId();
|
|
20
21
|
const placeId = createUniqueId();
|
|
22
|
+
const messageId = createUniqueId();
|
|
23
|
+
const describedBy = () => props.place ? `${placeId} ${messageId}` : messageId;
|
|
21
24
|
const [remaining, setRemaining] = createSignal(0);
|
|
22
25
|
createEffect(() => {
|
|
23
26
|
if (!props.open()) {
|
|
@@ -34,6 +37,12 @@ export function ConfirmDialog(props) {
|
|
|
34
37
|
}, 1000);
|
|
35
38
|
onCleanup(() => host.clearInterval(id));
|
|
36
39
|
});
|
|
40
|
+
const [checked, setChecked] = createSignal(false);
|
|
41
|
+
createEffect(on(() => props.open(), (open) => {
|
|
42
|
+
if (open)
|
|
43
|
+
setChecked(props.checkbox?.checked ?? false);
|
|
44
|
+
}));
|
|
45
|
+
const answer = () => props.checkbox ? { checkboxChecked: checked() } : {};
|
|
37
46
|
const focusScope = createDialogFocusScope({
|
|
38
47
|
open: () => props.open(),
|
|
39
48
|
ownerDocument: () => hostDocOf(props.host),
|
|
@@ -41,12 +50,31 @@ export function ConfirmDialog(props) {
|
|
|
41
50
|
let dialogElement = null;
|
|
42
51
|
const overlayGuard = createOverlayCloseGuard();
|
|
43
52
|
const handleOverlayMouseDown = (event) => {
|
|
44
|
-
|
|
53
|
+
const onOverlay = event.target === event.currentTarget;
|
|
54
|
+
overlayGuard.noteMouseDown(onOverlay);
|
|
55
|
+
if (onOverlay && props.sticky)
|
|
56
|
+
event.preventDefault();
|
|
45
57
|
};
|
|
46
58
|
const handleOverlayClick = (event) => {
|
|
47
|
-
if (overlayGuard.shouldCloseOnClick(event.target === event.currentTarget)
|
|
48
|
-
props.
|
|
59
|
+
if (overlayGuard.shouldCloseOnClick(event.target === event.currentTarget) &&
|
|
60
|
+
!props.sticky) {
|
|
61
|
+
props.onCancel(answer());
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const handleOverlayKeyDown = (event) => {
|
|
65
|
+
if (event.target !== event.currentTarget)
|
|
66
|
+
return;
|
|
67
|
+
const intent = resolveDialogShellKeyIntent(event.key, {
|
|
68
|
+
confirmOnEnter: false,
|
|
69
|
+
});
|
|
70
|
+
if (intent === 'dismiss') {
|
|
71
|
+
event.stopPropagation();
|
|
72
|
+
if (!props.sticky)
|
|
73
|
+
props.onCancel(answer());
|
|
74
|
+
return;
|
|
49
75
|
}
|
|
76
|
+
if (intent === 'trap' && dialogElement)
|
|
77
|
+
trapTabFocusWithin(dialogElement, event);
|
|
50
78
|
};
|
|
51
79
|
const handleKeyDown = (event) => {
|
|
52
80
|
const intent = resolveDialogShellKeyIntent(event.key, {
|
|
@@ -54,7 +82,8 @@ export function ConfirmDialog(props) {
|
|
|
54
82
|
});
|
|
55
83
|
if (intent === 'dismiss') {
|
|
56
84
|
event.stopPropagation();
|
|
57
|
-
props.
|
|
85
|
+
if (!props.sticky)
|
|
86
|
+
props.onCancel(answer());
|
|
58
87
|
return;
|
|
59
88
|
}
|
|
60
89
|
if (intent === 'trap' && dialogElement)
|
|
@@ -69,18 +98,17 @@ export function ConfirmDialog(props) {
|
|
|
69
98
|
const buttons = Array.from(el.querySelectorAll('button:not([disabled])'));
|
|
70
99
|
const isDanger = (props.variant ?? 'default') === 'danger';
|
|
71
100
|
const targetBtn = isDanger
|
|
72
|
-
?
|
|
101
|
+
? props.sticky
|
|
102
|
+
? undefined
|
|
103
|
+
: (buttons.find((b) => b.textContent === (props.cancelLabel ?? t('Cancel'))) ?? buttons[0])
|
|
73
104
|
: (buttons[buttons.length - 1] ?? buttons[0]);
|
|
74
105
|
(targetBtn ?? el).focus();
|
|
75
106
|
});
|
|
76
107
|
};
|
|
77
108
|
return (<Show when={props.open()}>
|
|
78
109
|
<OverlayPortal modal mount={hostDocOf(props.host).body} idPrefix="confirm-dialog">
|
|
79
|
-
<div class={styles.overlay} tabIndex={-1} onMouseDown={handleOverlayMouseDown} onClick={handleOverlayClick} onKeyDown={
|
|
80
|
-
|
|
81
|
-
props.onCancel();
|
|
82
|
-
}}>
|
|
83
|
-
<div ref={captureAndFocus} class={styles.dialog} role="alertdialog" aria-modal="true" aria-labelledby={titleId} aria-describedby={props.place ? placeId : undefined} tabIndex={-1} onKeyDown={handleKeyDown}>
|
|
110
|
+
<div class={styles.overlay} tabIndex={-1} onMouseDown={handleOverlayMouseDown} onClick={handleOverlayClick} onKeyDown={handleOverlayKeyDown}>
|
|
111
|
+
<div ref={captureAndFocus} class={styles.dialog} role="alertdialog" aria-modal="true" aria-labelledby={titleId} aria-describedby={describedBy()} tabIndex={-1} onKeyDown={handleKeyDown}>
|
|
84
112
|
<div class={styles.header}>
|
|
85
113
|
<h3 id={titleId} class={styles.title}>
|
|
86
114
|
{props.title}
|
|
@@ -90,7 +118,9 @@ export function ConfirmDialog(props) {
|
|
|
90
118
|
<Show when={props.place}>
|
|
91
119
|
{(place) => <ActionPlaceRow id={placeId} place={place()}/>}
|
|
92
120
|
</Show>
|
|
93
|
-
<p class={styles.message}>
|
|
121
|
+
<p id={messageId} class={styles.message}>
|
|
122
|
+
{props.message}
|
|
123
|
+
</p>
|
|
94
124
|
<Show when={props.code}>
|
|
95
125
|
{(code) => (<OverlayScrollArea rootClass={styles.codeScroll} viewportClass={styles.code}>
|
|
96
126
|
<pre class={styles.codePre} aria-label={t('Statement')}>
|
|
@@ -98,14 +128,21 @@ export function ConfirmDialog(props) {
|
|
|
98
128
|
</pre>
|
|
99
129
|
</OverlayScrollArea>)}
|
|
100
130
|
</Show>
|
|
131
|
+
<Show when={props.checkbox}>
|
|
132
|
+
{(checkbox) => (<Checkbox class={styles.checkbox} checked={checked()} onChange={setChecked}>
|
|
133
|
+
{checkbox().label}
|
|
134
|
+
</Checkbox>)}
|
|
135
|
+
</Show>
|
|
101
136
|
</div>
|
|
102
137
|
<div class={styles.footer}>
|
|
103
|
-
<
|
|
104
|
-
{props.
|
|
105
|
-
|
|
138
|
+
<Show when={!props.sticky}>
|
|
139
|
+
<Button size="lg" variant="secondary" onClick={() => props.onCancel(answer())}>
|
|
140
|
+
{props.cancelLabel ?? t('Cancel')}
|
|
141
|
+
</Button>
|
|
142
|
+
</Show>
|
|
106
143
|
<Button size="lg" variant={(props.variant ?? 'default') === 'danger'
|
|
107
144
|
? 'dangerSolid'
|
|
108
|
-
: 'primary'} disabled={remaining() > 0} onClick={() => props.onConfirm()}>
|
|
145
|
+
: 'primary'} disabled={remaining() > 0} onClick={() => props.onConfirm(answer())}>
|
|
109
146
|
{remaining() > 0
|
|
110
147
|
? t('{label} ({seconds})', {
|
|
111
148
|
label: props.confirmLabel ?? t('Confirm'),
|
|
@@ -121,6 +158,7 @@ export function ConfirmDialog(props) {
|
|
|
121
158
|
}
|
|
122
159
|
export function SaveDiscardDialog(props) {
|
|
123
160
|
const titleId = createUniqueId();
|
|
161
|
+
const messageId = createUniqueId();
|
|
124
162
|
const focusScope = createDialogFocusScope({
|
|
125
163
|
open: () => props.open(),
|
|
126
164
|
ownerDocument: () => hostDocOf(props.host),
|
|
@@ -164,14 +202,16 @@ export function SaveDiscardDialog(props) {
|
|
|
164
202
|
if (isKey(e, 'Escape'))
|
|
165
203
|
props.onChoice('cancel');
|
|
166
204
|
}}>
|
|
167
|
-
<div ref={captureAndFocus} class={styles.dialog} role="alertdialog" aria-modal="true" aria-labelledby={titleId} tabIndex={-1} onKeyDown={handleKeyDown}>
|
|
205
|
+
<div ref={captureAndFocus} class={styles.dialog} role="alertdialog" aria-modal="true" aria-labelledby={titleId} aria-describedby={messageId} tabIndex={-1} onKeyDown={handleKeyDown}>
|
|
168
206
|
<div class={styles.header}>
|
|
169
207
|
<h3 id={titleId} class={styles.title}>
|
|
170
208
|
{props.title}
|
|
171
209
|
</h3>
|
|
172
210
|
</div>
|
|
173
211
|
<div class={styles.body}>
|
|
174
|
-
<p class={styles.message}>
|
|
212
|
+
<p id={messageId} class={styles.message}>
|
|
213
|
+
{props.message}
|
|
214
|
+
</p>
|
|
175
215
|
</div>
|
|
176
216
|
<div class={styles.footer}>
|
|
177
217
|
<Button size="lg" variant="secondary" onClick={() => props.onChoice('cancel')}>
|
|
@@ -8,6 +8,7 @@ export default {
|
|
|
8
8
|
"title": "vk_title_0fm8I vk_titleLg_Iswm3",
|
|
9
9
|
"body": "vk_body_U-3RF",
|
|
10
10
|
"message": "vk_message_UsUIn",
|
|
11
|
+
"checkbox": "vk_checkbox_P8FRX",
|
|
11
12
|
"promptField": "vk_promptField_jlrF3",
|
|
12
13
|
"footer": "vk_footer_orvoX",
|
|
13
14
|
"codeScroll": "vk_codeScroll_rzK59",
|