@witchcraft/ui 0.3.1 → 0.3.3
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 +1 -1
- package/dist/runtime/assets/animations.css +1 -0
- package/dist/runtime/assets/base.css +1 -1
- package/dist/runtime/assets/tailwind.css +1 -1
- package/dist/runtime/components/LibButton/LibButton.d.vue.ts +1 -1
- package/dist/runtime/components/LibButton/LibButton.vue.d.ts +1 -1
- package/dist/runtime/components/LibCheckbox/LibCheckbox.d.vue.ts +1 -1
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +1 -1
- package/dist/runtime/components/LibColorInput/LibColorInput.d.vue.ts +2 -2
- package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +2 -2
- package/dist/runtime/components/LibColorPicker/LibColorPicker.d.vue.ts +2 -2
- package/dist/runtime/components/LibColorPicker/LibColorPicker.vue.d.ts +2 -2
- package/dist/runtime/components/LibColorPicker/utils/safeConvertToHsva.d.ts +1 -1
- package/dist/runtime/components/LibColorPicker/utils/safeConvertToRgba.d.ts +1 -1
- package/dist/runtime/components/LibColorPicker/utils/toLowPrecisionRgbaString.d.ts +1 -1
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.d.vue.ts +1 -1
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts +1 -1
- package/dist/runtime/components/LibDatePicker/LibDatePicker.d.vue.ts +1 -1
- package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +1 -1
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.d.vue.ts +1 -1
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +1 -1
- package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.d.vue.ts +1 -1
- package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue.d.ts +1 -1
- package/dist/runtime/components/LibFileInput/LibFileInput.d.vue.ts +2 -2
- package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +2 -2
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.d.vue.ts +1 -1
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +1 -1
- package/dist/runtime/components/LibLabel/LibLabel.d.vue.ts +1 -1
- package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +1 -1
- package/dist/runtime/components/LibMultiValues/LibMultiValues.d.vue.ts +1 -1
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +1 -1
- package/dist/runtime/components/LibNotifications/LibNotification.d.vue.ts +17 -4
- package/dist/runtime/components/LibNotifications/LibNotification.vue +84 -25
- package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +17 -4
- package/dist/runtime/components/LibNotifications/LibNotifications.d.vue.ts +2 -2
- package/dist/runtime/components/LibNotifications/LibNotifications.vue +110 -87
- package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +2 -2
- package/dist/runtime/components/LibPagination/LibPagination.d.vue.ts +1 -1
- package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +1 -1
- package/dist/runtime/components/LibPalette/LibPalette.d.vue.ts +1 -1
- package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +1 -1
- package/dist/runtime/components/LibPopup/LibPopup.d.vue.ts +4 -4
- package/dist/runtime/components/LibPopup/LibPopup.vue +2 -6
- package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +4 -4
- package/dist/runtime/components/LibProgressBar/LibProgressBar.d.vue.ts +2 -1
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +1 -1
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue.d.ts +2 -1
- package/dist/runtime/components/LibRecorder/LibRecorder.d.vue.ts +1 -1
- package/dist/runtime/components/LibRecorder/LibRecorder.vue +1 -1
- package/dist/runtime/components/LibRecorder/LibRecorder.vue.d.ts +1 -1
- package/dist/runtime/components/LibRoot/LibRoot.d.vue.ts +2 -2
- package/dist/runtime/components/LibRoot/LibRoot.vue.d.ts +2 -2
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.d.vue.ts +1 -1
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +1 -1
- package/dist/runtime/components/LibSuggestions/LibSuggestions.d.vue.ts +1 -1
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +1 -1
- package/dist/runtime/components/LibTable/LibTable.d.vue.ts +2 -2
- package/dist/runtime/components/LibTable/LibTable.vue.d.ts +2 -2
- package/dist/runtime/components/Template/TemplateStory.d.ts +1 -1
- package/dist/runtime/components/index.d.ts +20 -20
- package/dist/runtime/components/shared/props.d.ts +1 -1
- package/dist/runtime/composables/index.d.ts +17 -15
- package/dist/runtime/composables/index.js +2 -0
- package/dist/runtime/composables/useDragWithThreshold.d.ts +1 -1
- package/dist/runtime/composables/useInjectedDarkMode.d.ts +1 -1
- package/dist/runtime/composables/useInjectedI18n.d.ts +1 -1
- package/dist/runtime/composables/useInjectedLocale.d.ts +1 -1
- package/dist/runtime/composables/useNotificationHandler.d.ts +1 -1
- package/dist/runtime/composables/useScrollNearContainerEdges.d.ts +1 -1
- package/dist/runtime/composables/useSetupDarkMode.d.ts +1 -1
- package/dist/runtime/composables/useSlotVars.d.ts +32 -0
- package/dist/runtime/composables/useSlotVars.js +12 -0
- package/dist/runtime/composables/useSuggestions.d.ts +1 -1
- package/dist/runtime/directives/index.d.ts +4 -4
- package/dist/runtime/globalResizeObserver.d.ts +1 -1
- package/dist/runtime/helpers/NotificationHandler.d.ts +11 -4
- package/dist/runtime/helpers/NotificationHandler.js +34 -16
- package/dist/runtime/helpers/index.d.ts +10 -10
- package/dist/runtime/helpers/resizeObserverWrapper.d.ts +1 -1
- package/dist/runtime/injectionKeys.d.ts +2 -2
- package/dist/runtime/main.lib.d.ts +10 -10
- package/dist/runtime/tailwind/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/runtime/assets/animations.css +75 -0
- package/src/runtime/assets/base.css +0 -27
- package/src/runtime/assets/tailwind.css +1 -0
- package/src/runtime/components/LibColorPicker/LibColorPicker.stories.ts +1 -1
- package/src/runtime/components/LibNotifications/LibNotification.vue +86 -25
- package/src/runtime/components/LibNotifications/LibNotifications.stories.ts +4 -4
- package/src/runtime/components/LibNotifications/LibNotifications.vue +112 -90
- package/src/runtime/components/LibPopup/LibPopup.vue +2 -6
- package/src/runtime/components/LibProgressBar/LibProgressBar.vue +2 -1
- package/src/runtime/components/LibRecorder/LibRecorder.vue +1 -1
- package/src/runtime/composables/index.ts +2 -0
- package/src/runtime/composables/useSlotVars.ts +41 -0
- package/src/runtime/helpers/NotificationHandler.ts +44 -22
|
@@ -1,67 +1,129 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<!-- using custom toasts, reka-ui toasts still have issues, like like of control over pause, and I can't get the leave event to animate or transition with vue transitions to work -->
|
|
2
3
|
<TransitionGroup
|
|
3
4
|
name="list"
|
|
4
5
|
tag="div"
|
|
5
|
-
:class="twMerge(`
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
:class="twMerge(`
|
|
7
|
+
notifications
|
|
8
|
+
[--notification-width:300px]
|
|
9
|
+
fixed
|
|
10
|
+
top-0
|
|
11
|
+
z-50
|
|
12
|
+
right-[calc(var(--notification-width)*-1)]
|
|
13
|
+
py-2
|
|
14
|
+
w-[calc(var(--spacing)*2+var(--notification-width)*2)]
|
|
15
|
+
[&_.notification]:w-[var(--notification-width)]
|
|
16
|
+
max-h-[100dvh]
|
|
17
|
+
flex
|
|
18
|
+
flex-col
|
|
19
|
+
[&_.notification]:shrink-0
|
|
20
|
+
gap-1
|
|
21
|
+
list-none
|
|
22
|
+
outline-none
|
|
23
|
+
overflow-y-auto
|
|
24
|
+
overflow-x-clip
|
|
25
|
+
scrollbar-hidden
|
|
26
|
+
`, $attrs.class)"
|
|
15
27
|
v-bind="{ ...$attrs, class: void 0 }"
|
|
16
28
|
>
|
|
17
29
|
<lib-notification
|
|
18
|
-
class="pointer-events-auto"
|
|
19
30
|
:handler="handler"
|
|
20
31
|
tabindex="0"
|
|
21
32
|
:notification="notification"
|
|
33
|
+
class="overflow-hidden"
|
|
22
34
|
v-for="notification of notifications"
|
|
23
35
|
:key="notification.id"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<Transition>
|
|
27
|
-
<div
|
|
28
|
-
v-show="topNotifications.length > 0"
|
|
29
|
-
:class="twMerge(`notifications--none`, $attrs.class)"
|
|
30
|
-
/>
|
|
31
|
-
</Transition>
|
|
32
|
-
<Transition>
|
|
33
|
-
<dialog
|
|
34
|
-
v-show="topNotifications.length > 0"
|
|
35
|
-
:id="id"
|
|
36
|
-
:class="twMerge(`notifications-modal
|
|
37
|
-
bg-transparent
|
|
38
|
-
p-0
|
|
39
|
-
backdrop:bg-black/50
|
|
40
|
-
backdrop:p-5
|
|
41
|
-
`, $attrs.class)"
|
|
42
|
-
ref="dialogEl"
|
|
43
|
-
@click.self.prevent="topNotifications[0] && NotificationHandler.dismiss(topNotifications[0])"
|
|
36
|
+
@pointerenter="notification.timeout && !notification.isPaused && handler.pause(notification)"
|
|
37
|
+
@blur="notification.timeout && notification.isPaused && handler.resume(notification)"
|
|
44
38
|
>
|
|
45
|
-
<
|
|
39
|
+
<template #top>
|
|
40
|
+
<LibProgressBar
|
|
41
|
+
v-if="notification.timeout !== void 0"
|
|
42
|
+
class="
|
|
43
|
+
w-full
|
|
44
|
+
h-1
|
|
45
|
+
before:duration-[10ms]
|
|
46
|
+
-mt-1
|
|
47
|
+
-mx-[calc(var(--spacing)*2+2px)]
|
|
48
|
+
rounded-none
|
|
49
|
+
"
|
|
50
|
+
:progress="100 - (notification.isPaused ? notification._timer.elapsedBeforePause : notification._timer.elapsedBeforePause + (time - notification.startTime)) / notification.timeout * 100"
|
|
51
|
+
/>
|
|
52
|
+
</template>
|
|
53
|
+
</lib-notification>
|
|
54
|
+
</TransitionGroup>
|
|
55
|
+
<!-- we don't need to worry about the user accidentally closing a non-closable dialog as keeping open=true (which the handler handles when the component tries to close) is enough to keep it open without issues -->
|
|
56
|
+
<AlertDialogRoot
|
|
57
|
+
:open="topNotifications.length > 0 && topNotifications[0] !== void 0"
|
|
58
|
+
@update:open="topNotifications[0] && NotificationHandler.dismiss(topNotifications[0])"
|
|
59
|
+
>
|
|
60
|
+
<AlertDialogPortal :to="'#root'">
|
|
61
|
+
<AlertDialogOverlay
|
|
62
|
+
class="
|
|
63
|
+
fixed inset-0 z-30
|
|
64
|
+
bg-neutral-950/20
|
|
65
|
+
data-[state=open]:animate-overlayShow
|
|
66
|
+
"
|
|
67
|
+
/>
|
|
68
|
+
<AlertDialogContent
|
|
69
|
+
class="
|
|
70
|
+
data-[state=open]:animate-contentShow
|
|
71
|
+
fixed
|
|
72
|
+
top-[50%]
|
|
73
|
+
left-[50%]
|
|
74
|
+
translate-x-[-50%]
|
|
75
|
+
translate-y-[-50%]
|
|
76
|
+
max-h-[80dvh]
|
|
77
|
+
max-w-[700px]
|
|
78
|
+
z-100
|
|
79
|
+
"
|
|
80
|
+
>
|
|
46
81
|
<lib-notification
|
|
47
|
-
|
|
82
|
+
class="
|
|
83
|
+
top-notification
|
|
84
|
+
text-md
|
|
85
|
+
gap-2
|
|
86
|
+
p-2
|
|
87
|
+
[&_.notification--button]:p-2
|
|
88
|
+
[&_.notification--button]:py-1
|
|
89
|
+
[&_.notification--header]:text-lg
|
|
90
|
+
[&_.notification--message]:py-3
|
|
91
|
+
"
|
|
48
92
|
:handler="handler"
|
|
49
|
-
class="top-notification"
|
|
50
93
|
:notification="topNotifications[0]"
|
|
51
94
|
ref="topNotificationComp"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
95
|
+
>
|
|
96
|
+
<template #title="slotProps">
|
|
97
|
+
<AlertDialogTitle v-bind="slotProps">
|
|
98
|
+
{{ slotProps.title }}
|
|
99
|
+
</AlertDialogTitle>
|
|
100
|
+
</template>
|
|
101
|
+
<template #message="slotProps">
|
|
102
|
+
<AlertDialogDescription v-bind="slotProps">
|
|
103
|
+
{{ slotProps.message }}
|
|
104
|
+
</AlertDialogDescription>
|
|
105
|
+
</template>
|
|
106
|
+
</lib-notification>
|
|
107
|
+
</AlertDialogContent>
|
|
108
|
+
</AlertDialogPortal>
|
|
109
|
+
</AlertDialogRoot>
|
|
56
110
|
</template>
|
|
57
111
|
|
|
58
112
|
<script setup>
|
|
59
|
-
import {
|
|
60
|
-
|
|
113
|
+
import {
|
|
114
|
+
AlertDialogContent,
|
|
115
|
+
AlertDialogDescription,
|
|
116
|
+
AlertDialogOverlay,
|
|
117
|
+
AlertDialogPortal,
|
|
118
|
+
AlertDialogRoot,
|
|
119
|
+
AlertDialogTitle
|
|
120
|
+
} from "reka-ui";
|
|
121
|
+
import { computed, ref } from "vue";
|
|
61
122
|
import LibNotification from "./LibNotification.vue";
|
|
62
123
|
import { useNotificationHandler } from "../../composables/useNotificationHandler.js";
|
|
63
124
|
import { NotificationHandler } from "../../helpers/NotificationHandler.js";
|
|
64
125
|
import { twMerge } from "../../utils/twMerge.js";
|
|
126
|
+
import LibProgressBar from "../LibProgressBar/LibProgressBar.vue";
|
|
65
127
|
defineOptions({
|
|
66
128
|
name: "LibNotifications",
|
|
67
129
|
inheritAttrs: false
|
|
@@ -70,54 +132,15 @@ const props = defineProps({
|
|
|
70
132
|
id: { type: String, required: false },
|
|
71
133
|
handler: { type: Object, required: false }
|
|
72
134
|
});
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
isOpen.value = true;
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
const close = () => {
|
|
86
|
-
if (isOpen.value && topNotifications.length === 0) {
|
|
87
|
-
dialogEl.value.close();
|
|
88
|
-
isOpen.value = false;
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
const addNotification = (entry) => {
|
|
92
|
-
if (entry.resolution === void 0) {
|
|
93
|
-
if (entry.requiresAction) {
|
|
94
|
-
topNotifications.push(entry);
|
|
95
|
-
open();
|
|
96
|
-
entry.promise.then(() => {
|
|
97
|
-
removeIfIn(topNotifications, entry);
|
|
98
|
-
close();
|
|
99
|
-
});
|
|
100
|
-
} else {
|
|
101
|
-
notifications.splice(0, 0, entry);
|
|
102
|
-
entry.promise.then(() => {
|
|
103
|
-
removeIfIn(notifications, entry);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
const notificationListener = (entry, type) => {
|
|
109
|
-
if (type === "added") {
|
|
110
|
-
addNotification(entry);
|
|
111
|
-
}
|
|
112
|
-
};
|
|
135
|
+
const topNotifications = computed(() => handler.queue.filter((entry) => entry.requiresAction).reverse());
|
|
136
|
+
const notifications = computed(() => handler.queue.filter((entry) => !entry.requiresAction));
|
|
137
|
+
const time = ref(Date.now());
|
|
138
|
+
setInterval(() => {
|
|
139
|
+
requestAnimationFrame(() => {
|
|
140
|
+
time.value = Date.now();
|
|
141
|
+
});
|
|
142
|
+
}, 50);
|
|
113
143
|
const handler = props.handler ?? useNotificationHandler();
|
|
114
|
-
handler.addNotificationListener(notificationListener);
|
|
115
|
-
for (const entry of handler.queue) {
|
|
116
|
-
addNotification(entry);
|
|
117
|
-
}
|
|
118
|
-
onBeforeUnmount(() => {
|
|
119
|
-
handler.removeNotificationListener(notificationListener);
|
|
120
|
-
});
|
|
121
144
|
</script>
|
|
122
145
|
|
|
123
146
|
<script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NotificationHandler } from "../../helpers/NotificationHandler.js
|
|
2
|
-
import type { LinkableByIdProps, TailwindClassProp } from "../shared/props.js
|
|
1
|
+
import { NotificationHandler } from "../../helpers/NotificationHandler.js";
|
|
2
|
+
import type { LinkableByIdProps, TailwindClassProp } from "../shared/props.js";
|
|
3
3
|
import type { HTMLAttributes } from "vue";
|
|
4
4
|
type RealProps = LinkableByIdProps & {
|
|
5
5
|
/** If not provided, uses the global handler (this requires useNotificationHandler be called and configured). */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Theme } from "metamorphosis";
|
|
2
|
-
import type { BaseInteractiveProps, LinkableByIdProps } from "../shared/props.js
|
|
2
|
+
import type { BaseInteractiveProps, LinkableByIdProps } from "../shared/props.js";
|
|
3
3
|
declare const _default: import("vue").DefineComponent<LinkableByIdProps & BaseInteractiveProps & {
|
|
4
4
|
theme?: Theme;
|
|
5
5
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkableByIdProps & BaseInteractiveProps & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Theme } from "metamorphosis";
|
|
2
|
-
import type { BaseInteractiveProps, LinkableByIdProps } from "../shared/props.js
|
|
2
|
+
import type { BaseInteractiveProps, LinkableByIdProps } from "../shared/props.js";
|
|
3
3
|
declare const _default: import("vue").DefineComponent<LinkableByIdProps & BaseInteractiveProps & {
|
|
4
4
|
theme?: Theme;
|
|
5
5
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkableByIdProps & BaseInteractiveProps & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type HTMLAttributes } from "vue";
|
|
2
|
-
import { type LinkableByIdProps, type TailwindClassProp, type PopupProps } from "../shared/props.js
|
|
3
|
-
import type { IPopupReference } from "../../types/index.js
|
|
2
|
+
import { type LinkableByIdProps, type TailwindClassProp, type PopupProps } from "../shared/props.js";
|
|
3
|
+
import type { IPopupReference } from "../../types/index.js";
|
|
4
4
|
type RealProps = LinkableByIdProps & PopupProps;
|
|
5
5
|
interface Props extends
|
|
6
6
|
/** @vue-ignore */
|
|
@@ -25,8 +25,8 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props & {
|
|
|
25
25
|
canClose: boolean;
|
|
26
26
|
useDialogForBackdrop: false;
|
|
27
27
|
useBackdrop: boolean;
|
|
28
|
-
preferredHorizontal: ("center" | "right" | "left" | "either" | "center-screen" | "right-most" | "left-most" | "center-most")[] | import("../../main.lib.js
|
|
29
|
-
preferredVertical: ("top" | "bottom" | "center" | "either" | "center-screen" | "top-most" | "bottom-most" | "center-most")[] | import("../../main.lib.js
|
|
28
|
+
preferredHorizontal: ("center" | "right" | "left" | "either" | "center-screen" | "right-most" | "left-most" | "center-most")[] | import("../../main.lib.js").PopupPositioner;
|
|
29
|
+
preferredVertical: ("top" | "bottom" | "center" | "either" | "center-screen" | "top-most" | "bottom-most" | "center-most")[] | import("../../main.lib.js").PopupPositioner;
|
|
30
30
|
avoidRepositioning: boolean;
|
|
31
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
32
32
|
button?: (props: {
|
|
@@ -76,7 +76,7 @@ const buttonEl = ref(null);
|
|
|
76
76
|
const backgroundEl = ref(null);
|
|
77
77
|
const pos = ref({});
|
|
78
78
|
const modelValue = defineModel({ type: Boolean, ...{ default: false } });
|
|
79
|
-
let isOpen =
|
|
79
|
+
let isOpen = modelValue.value;
|
|
80
80
|
const getDialogBoundingRect = () => ({
|
|
81
81
|
x: 0,
|
|
82
82
|
y: 0,
|
|
@@ -324,10 +324,6 @@ const close = () => {
|
|
|
324
324
|
if (props.useBackdrop && props.useDialogForBackdrop) dialogEl.value?.close();
|
|
325
325
|
}
|
|
326
326
|
};
|
|
327
|
-
const toggle = () => {
|
|
328
|
-
if (!isOpen) show();
|
|
329
|
-
else close();
|
|
330
|
-
};
|
|
331
327
|
const recomputeListener = () => recompute();
|
|
332
328
|
const bindListeners = () => {
|
|
333
329
|
window.addEventListener("resize", recomputeListener);
|
|
@@ -348,7 +344,7 @@ watch([modelValue, popupEl], () => {
|
|
|
348
344
|
});
|
|
349
345
|
const handleMouseup = ($event) => {
|
|
350
346
|
$event.preventDefault();
|
|
351
|
-
|
|
347
|
+
close();
|
|
352
348
|
};
|
|
353
349
|
onMounted(() => {
|
|
354
350
|
recompute();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type HTMLAttributes } from "vue";
|
|
2
|
-
import { type LinkableByIdProps, type TailwindClassProp, type PopupProps } from "../shared/props.js
|
|
3
|
-
import type { IPopupReference } from "../../types/index.js
|
|
2
|
+
import { type LinkableByIdProps, type TailwindClassProp, type PopupProps } from "../shared/props.js";
|
|
3
|
+
import type { IPopupReference } from "../../types/index.js";
|
|
4
4
|
type RealProps = LinkableByIdProps & PopupProps;
|
|
5
5
|
interface Props extends
|
|
6
6
|
/** @vue-ignore */
|
|
@@ -25,8 +25,8 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props & {
|
|
|
25
25
|
canClose: boolean;
|
|
26
26
|
useDialogForBackdrop: false;
|
|
27
27
|
useBackdrop: boolean;
|
|
28
|
-
preferredHorizontal: ("center" | "right" | "left" | "either" | "center-screen" | "right-most" | "left-most" | "center-most")[] | import("../../main.lib.js
|
|
29
|
-
preferredVertical: ("top" | "bottom" | "center" | "either" | "center-screen" | "top-most" | "bottom-most" | "center-most")[] | import("../../main.lib.js
|
|
28
|
+
preferredHorizontal: ("center" | "right" | "left" | "either" | "center-screen" | "right-most" | "left-most" | "center-most")[] | import("../../main.lib.js").PopupPositioner;
|
|
29
|
+
preferredVertical: ("top" | "bottom" | "center" | "either" | "center-screen" | "top-most" | "bottom-most" | "center-most")[] | import("../../main.lib.js").PopupPositioner;
|
|
30
30
|
avoidRepositioning: boolean;
|
|
31
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
32
32
|
button?: (props: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js
|
|
1
|
+
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js";
|
|
2
2
|
import type { HTMLAttributes } from "vue";
|
|
3
3
|
type RealProps = LinkableByIdProps & BaseInteractiveProps & LabelProps & {
|
|
4
|
+
/** A number from 0-100. It is auto-clamped. */
|
|
4
5
|
progress: number;
|
|
5
6
|
/** Will auto hide after this given time if progress is 100% or more or less than 0% until progress is set to something else. Disabled (-1) by default. */
|
|
6
7
|
autohideOnComplete?: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js
|
|
1
|
+
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js";
|
|
2
2
|
import type { HTMLAttributes } from "vue";
|
|
3
3
|
type RealProps = LinkableByIdProps & BaseInteractiveProps & LabelProps & {
|
|
4
|
+
/** A number from 0-100. It is auto-clamped. */
|
|
4
5
|
progress: number;
|
|
5
6
|
/** Will auto hide after this given time if progress is 100% or more or less than 0% until progress is set to something else. Disabled (-1) by default. */
|
|
6
7
|
autohideOnComplete?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes } from "vue";
|
|
2
|
-
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js
|
|
2
|
+
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js";
|
|
3
3
|
type RealProps = LinkableByIdProps & BaseInteractiveProps & LabelProps & {
|
|
4
4
|
border?: boolean;
|
|
5
5
|
/** A value to display while recording, if none given the i18n `recorder.recording` key is used. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes } from "vue";
|
|
2
|
-
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js
|
|
2
|
+
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js";
|
|
3
3
|
type RealProps = LinkableByIdProps & BaseInteractiveProps & LabelProps & {
|
|
4
4
|
border?: boolean;
|
|
5
5
|
/** A value to display while recording, if none given the i18n `recorder.recording` key is used. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Theme } from "metamorphosis";
|
|
2
|
-
import { NotificationHandler } from "../../helpers/NotificationHandler.js
|
|
2
|
+
import { NotificationHandler } from "../../helpers/NotificationHandler.js";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
theme?: Theme;
|
|
5
5
|
outline?: boolean;
|
|
@@ -19,7 +19,7 @@ type __VLS_Slots = {} & {
|
|
|
19
19
|
default?: (props: typeof __VLS_9) => any;
|
|
20
20
|
};
|
|
21
21
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
22
|
-
darkMode: import("../../composables/useDarkMode.js
|
|
22
|
+
darkMode: import("../../composables/useDarkMode.js").DarkModeState & import("../../composables/useDarkMode.js").DarkModeCommands;
|
|
23
23
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
24
24
|
theme: Theme;
|
|
25
25
|
id: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Theme } from "metamorphosis";
|
|
2
|
-
import { NotificationHandler } from "../../helpers/NotificationHandler.js
|
|
2
|
+
import { NotificationHandler } from "../../helpers/NotificationHandler.js";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
theme?: Theme;
|
|
5
5
|
outline?: boolean;
|
|
@@ -19,7 +19,7 @@ type __VLS_Slots = {} & {
|
|
|
19
19
|
default?: (props: typeof __VLS_9) => any;
|
|
20
20
|
};
|
|
21
21
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
22
|
-
darkMode: import("../../composables/useDarkMode.js
|
|
22
|
+
darkMode: import("../../composables/useDarkMode.js").DarkModeState & import("../../composables/useDarkMode.js").DarkModeCommands;
|
|
23
23
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
24
24
|
theme: Theme;
|
|
25
25
|
id: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type InputHTMLAttributes } from "vue";
|
|
2
|
-
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js
|
|
2
|
+
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js";
|
|
3
3
|
type RealProps = LinkableByIdProps & LabelProps & BaseInteractiveProps & {
|
|
4
4
|
placeholder?: InputHTMLAttributes["placeholder"];
|
|
5
5
|
disabled?: InputHTMLAttributes["disabled"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type InputHTMLAttributes } from "vue";
|
|
2
|
-
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js
|
|
2
|
+
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js";
|
|
3
3
|
type RealProps = LinkableByIdProps & LabelProps & BaseInteractiveProps & {
|
|
4
4
|
placeholder?: InputHTMLAttributes["placeholder"];
|
|
5
5
|
disabled?: InputHTMLAttributes["disabled"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes } from "vue";
|
|
2
|
-
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type SuggestionsEmits, type SuggestionsProps, type WrapperProps } from "../shared/props.js
|
|
2
|
+
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type SuggestionsEmits, type SuggestionsProps, type WrapperProps } from "../shared/props.js";
|
|
3
3
|
type WrapperTypes = Partial<WrapperProps<"item", HTMLAttributes, {
|
|
4
4
|
/** Tailwind classes. */
|
|
5
5
|
class?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes } from "vue";
|
|
2
|
-
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type SuggestionsEmits, type SuggestionsProps, type WrapperProps } from "../shared/props.js
|
|
2
|
+
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type SuggestionsEmits, type SuggestionsProps, type WrapperProps } from "../shared/props.js";
|
|
3
3
|
type WrapperTypes = Partial<WrapperProps<"item", HTMLAttributes, {
|
|
4
4
|
/** Tailwind classes. */
|
|
5
5
|
class?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TableHTMLAttributes } from "vue";
|
|
2
|
-
import type { ResizableOptions, TableColConfig } from "../../types/index.js
|
|
3
|
-
import type { TailwindClassProp } from "../shared/props.js
|
|
2
|
+
import type { ResizableOptions, TableColConfig } from "../../types/index.js";
|
|
3
|
+
import type { TailwindClassProp } from "../shared/props.js";
|
|
4
4
|
type T = any;
|
|
5
5
|
type RealProps = {
|
|
6
6
|
resizable?: Partial<ResizableOptions>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TableHTMLAttributes } from "vue";
|
|
2
|
-
import type { ResizableOptions, TableColConfig } from "../../types/index.js
|
|
3
|
-
import type { TailwindClassProp } from "../shared/props.js
|
|
2
|
+
import type { ResizableOptions, TableColConfig } from "../../types/index.js";
|
|
3
|
+
import type { TailwindClassProp } from "../shared/props.js";
|
|
4
4
|
type T = any;
|
|
5
5
|
type RealProps = {
|
|
6
6
|
resizable?: Partial<ResizableOptions>;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export { default as aria } from "./Aria/Aria.vue
|
|
2
|
-
export { default as LibButton } from "./LibButton/LibButton.vue
|
|
3
|
-
export { default as LibCheckbox } from "./LibCheckbox/LibCheckbox.vue
|
|
4
|
-
export { default as LibColorInput } from "./LibColorInput/LibColorInput.vue
|
|
5
|
-
export { default as LibColorPicker } from "./LibColorPicker/LibColorPicker.vue
|
|
6
|
-
export { default as LibDarkModeSwitcher } from "./LibDarkModeSwitcher/LibDarkModeSwitcher.vue
|
|
7
|
-
export { default as LibDatePicker } from "./LibDatePicker/LibDatePicker.vue
|
|
8
|
-
export { default as LibDebug } from "./LibDebug/LibDebug.vue
|
|
9
|
-
export { default as LibFileInput } from "./LibFileInput/LibFileInput.vue
|
|
10
|
-
export { default as LibInputDeprecated } from "./LibInputDeprecated/LibInputDeprecated.vue
|
|
11
|
-
export { default as LibLabel } from "./LibLabel/LibLabel.vue
|
|
12
|
-
export { default as LibNotifications } from "./LibNotifications/LibNotifications.vue
|
|
13
|
-
export { default as LibPagination } from "./LibPagination/LibPagination.vue
|
|
14
|
-
export { default as LibPopup } from "./LibPopup/LibPopup.vue
|
|
15
|
-
export { default as LibProgressBar } from "./LibProgressBar/LibProgressBar.vue
|
|
16
|
-
export { default as LibRecorder } from "./LibRecorder/LibRecorder.vue
|
|
17
|
-
export { default as LibRoot } from "./LibRoot/LibRoot.vue
|
|
18
|
-
export { default as LibSimpleInput } from "./LibSimpleInput/LibSimpleInput.vue
|
|
19
|
-
export { default as LibTable } from "./LibTable/LibTable.vue
|
|
20
|
-
export { default as LibTimeZonePicker } from "./LibDatePicker/LibTimeZonePicker.vue
|
|
1
|
+
export { default as aria } from "./Aria/Aria.vue";
|
|
2
|
+
export { default as LibButton } from "./LibButton/LibButton.vue";
|
|
3
|
+
export { default as LibCheckbox } from "./LibCheckbox/LibCheckbox.vue";
|
|
4
|
+
export { default as LibColorInput } from "./LibColorInput/LibColorInput.vue";
|
|
5
|
+
export { default as LibColorPicker } from "./LibColorPicker/LibColorPicker.vue";
|
|
6
|
+
export { default as LibDarkModeSwitcher } from "./LibDarkModeSwitcher/LibDarkModeSwitcher.vue";
|
|
7
|
+
export { default as LibDatePicker } from "./LibDatePicker/LibDatePicker.vue";
|
|
8
|
+
export { default as LibDebug } from "./LibDebug/LibDebug.vue";
|
|
9
|
+
export { default as LibFileInput } from "./LibFileInput/LibFileInput.vue";
|
|
10
|
+
export { default as LibInputDeprecated } from "./LibInputDeprecated/LibInputDeprecated.vue";
|
|
11
|
+
export { default as LibLabel } from "./LibLabel/LibLabel.vue";
|
|
12
|
+
export { default as LibNotifications } from "./LibNotifications/LibNotifications.vue";
|
|
13
|
+
export { default as LibPagination } from "./LibPagination/LibPagination.vue";
|
|
14
|
+
export { default as LibPopup } from "./LibPopup/LibPopup.vue";
|
|
15
|
+
export { default as LibProgressBar } from "./LibProgressBar/LibProgressBar.vue";
|
|
16
|
+
export { default as LibRecorder } from "./LibRecorder/LibRecorder.vue";
|
|
17
|
+
export { default as LibRoot } from "./LibRoot/LibRoot.vue";
|
|
18
|
+
export { default as LibSimpleInput } from "./LibSimpleInput/LibSimpleInput.vue";
|
|
19
|
+
export { default as LibTable } from "./LibTable/LibTable.vue";
|
|
20
|
+
export { default as LibTimeZonePicker } from "./LibDatePicker/LibTimeZonePicker.vue";
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
export { useAccesibilityOutline } from "./useAccesibilityOutline.js
|
|
2
|
-
export { useAriaLabel } from "./useAriaLabel.js
|
|
3
|
-
export { useDarkMode } from "./useDarkMode.js
|
|
4
|
-
export { useDivideAttrs } from "./useDivideAttrs.js
|
|
5
|
-
export { useDragWithThreshold } from "./useDragWithThreshold.js
|
|
6
|
-
export { useGlobalResizeObserver } from "./useGlobalResizeObserver.js
|
|
7
|
-
export { useInjectedDarkMode } from "./useInjectedDarkMode.js
|
|
8
|
-
export { useInjectedI18n } from "./useInjectedI18n.js
|
|
9
|
-
export { useInjectedLocale } from "./useInjectedLocale.js
|
|
10
|
-
export { useNotificationHandler } from "./useNotificationHandler.js
|
|
11
|
-
export { usePreHydrationValue } from "./usePreHydrationValue.js
|
|
12
|
-
export { useScrollNearContainerEdges } from "./useScrollNearContainerEdges.js
|
|
13
|
-
export { useSetupDarkMode } from "./useSetupDarkMode.js
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
1
|
+
export { useAccesibilityOutline } from "./useAccesibilityOutline.js";
|
|
2
|
+
export { useAriaLabel } from "./useAriaLabel.js";
|
|
3
|
+
export { useDarkMode } from "./useDarkMode.js";
|
|
4
|
+
export { useDivideAttrs } from "./useDivideAttrs.js";
|
|
5
|
+
export { useDragWithThreshold } from "./useDragWithThreshold.js";
|
|
6
|
+
export { useGlobalResizeObserver } from "./useGlobalResizeObserver.js";
|
|
7
|
+
export { useInjectedDarkMode } from "./useInjectedDarkMode.js";
|
|
8
|
+
export { useInjectedI18n } from "./useInjectedI18n.js";
|
|
9
|
+
export { useInjectedLocale } from "./useInjectedLocale.js";
|
|
10
|
+
export { useNotificationHandler } from "./useNotificationHandler.js";
|
|
11
|
+
export { usePreHydrationValue } from "./usePreHydrationValue.js";
|
|
12
|
+
export { useScrollNearContainerEdges } from "./useScrollNearContainerEdges.js";
|
|
13
|
+
export { useSetupDarkMode } from "./useSetupDarkMode.js";
|
|
14
|
+
export { useSetupLocale } from "./useSetupLocale.js";
|
|
15
|
+
export { useShowDevOnlyKey } from "./useShowDevOnlyKey.js";
|
|
16
|
+
export { useSlotVars } from "./useSlotVars.js";
|
|
17
|
+
export { useSuggestions } from "./useSuggestions.js";
|
|
@@ -11,5 +11,7 @@ export { useNotificationHandler } from "./useNotificationHandler.js";
|
|
|
11
11
|
export { usePreHydrationValue } from "./usePreHydrationValue.js";
|
|
12
12
|
export { useScrollNearContainerEdges } from "./useScrollNearContainerEdges.js";
|
|
13
13
|
export { useSetupDarkMode } from "./useSetupDarkMode.js";
|
|
14
|
+
export { useSetupLocale } from "./useSetupLocale.js";
|
|
14
15
|
export { useShowDevOnlyKey } from "./useShowDevOnlyKey.js";
|
|
16
|
+
export { useSlotVars } from "./useSlotVars.js";
|
|
15
17
|
export { useSuggestions } from "./useSuggestions.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { DarkModeCommands, DarkModeState } from "./useDarkMode.js
|
|
1
|
+
import type { DarkModeCommands, DarkModeState } from "./useDarkMode.js";
|
|
2
2
|
export declare function useInjectedDarkMode(): DarkModeState & DarkModeCommands;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { TranslationFunction } from "./useSetupI18n.js
|
|
1
|
+
import type { TranslationFunction } from "./useSetupI18n.js";
|
|
2
2
|
export declare function useInjectedI18n(): TranslationFunction;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { useSetupLocale } from "./useSetupLocale.js
|
|
1
|
+
import type { useSetupLocale } from "./useSetupLocale.js";
|
|
2
2
|
export declare function useInjectedLocale(): ReturnType<typeof useSetupLocale>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NotificationHandler } from "../helpers/NotificationHandler.js
|
|
1
|
+
import type { NotificationHandler } from "../helpers/NotificationHandler.js";
|
|
2
2
|
export declare const useNotificationHandler: (handler?: NotificationHandler,
|
|
3
3
|
/** True by default, should be passed import.meta.client if using nuxt, or false when running server side. */
|
|
4
4
|
isClientSide?: boolean) => NotificationHandler;
|