@nuxt/devtools-ui-kit-nightly 2.4.0-29091142.bbfd37e → 2.4.1-29150090.ad8f305
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/components/NBadge.vue.d.ts +12 -0
- package/dist/components/NBadgeHashed.vue +11 -13
- package/dist/components/NBadgeHashed.vue.d.ts +15 -0
- package/dist/components/NCard.vue.d.ts +12 -0
- package/dist/components/NCheckbox.vue +8 -15
- package/dist/components/NCheckbox.vue.d.ts +23 -0
- package/dist/components/NCodeBlock.vue +20 -33
- package/dist/components/NCodeBlock.vue.d.ts +13 -0
- package/dist/components/NDarkToggle.vue +31 -49
- package/dist/components/NDarkToggle.vue.d.ts +12 -0
- package/dist/components/NDialog.vue +30 -47
- package/dist/components/NDialog.vue.d.ts +27 -0
- package/dist/components/NDrawer.vue +28 -41
- package/dist/components/NDrawer.vue.d.ts +25 -0
- package/dist/components/NDropdown.vue +12 -17
- package/dist/components/NDropdown.vue.d.ts +27 -0
- package/dist/components/NIcon.vue +4 -4
- package/dist/components/NIcon.vue.d.ts +5 -0
- package/dist/components/NIconTitle.vue +5 -5
- package/dist/components/NIconTitle.vue.d.ts +16 -0
- package/dist/components/NLink.vue +13 -15
- package/dist/components/NLink.vue.d.ts +18 -0
- package/dist/components/NLoading.vue.d.ts +12 -0
- package/dist/components/NMarkdown.vue +6 -9
- package/dist/components/NMarkdown.vue.d.ts +6 -0
- package/dist/components/NNavbar.vue +9 -13
- package/dist/components/NNavbar.vue.d.ts +24 -0
- package/dist/components/NNotification.vue +21 -25
- package/dist/components/NNotification.vue.d.ts +2 -0
- package/dist/components/NPanelGrids.vue.d.ts +12 -0
- package/dist/components/NRadio.vue +11 -18
- package/dist/components/NRadio.vue.d.ts +25 -0
- package/dist/components/NSectionBlock.vue +16 -26
- package/dist/components/NSectionBlock.vue.d.ts +37 -0
- package/dist/components/NSelect.vue +10 -19
- package/dist/components/NSelect.vue.d.ts +29 -0
- package/dist/components/NSelectTabs.vue +14 -21
- package/dist/components/NSelectTabs.vue.d.ts +17 -0
- package/dist/components/NSplitPane.vue +22 -32
- package/dist/components/NSplitPane.vue.d.ts +27 -0
- package/dist/components/NSwitch.vue +7 -12
- package/dist/components/NSwitch.vue.d.ts +25 -0
- package/dist/components/NTextInput.vue +15 -27
- package/dist/components/NTextInput.vue.d.ts +33 -0
- package/dist/components/NTip.vue +4 -4
- package/dist/components/NTip.vue.d.ts +17 -0
- package/dist/module.json +2 -2
- package/dist/runtime/client.d.ts +3 -0
- package/dist/types.d.mts +3 -1
- package/dist/unocss.mjs +1 -1
- package/package.json +18 -18
- package/dist/module.cjs +0 -5
- package/dist/types.d.ts +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { computed } from
|
|
3
|
-
import { getHslColorFromStringHash } from
|
|
4
|
-
import NBadge from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}>()
|
|
9
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { getHslColorFromStringHash } from "../composables/color";
|
|
4
|
+
import NBadge from "./NBadge.vue";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
text: { type: String, required: true }
|
|
7
|
+
});
|
|
10
8
|
const color = computed(() => {
|
|
11
|
-
const foreground = getHslColorFromStringHash(props.text, 50, 60)
|
|
12
|
-
const background = getHslColorFromStringHash(props.text, 50, 60, 0.05)
|
|
13
|
-
return { color: foreground, background }
|
|
14
|
-
})
|
|
9
|
+
const foreground = getHslColorFromStringHash(props.text, 50, 60);
|
|
10
|
+
const background = getHslColorFromStringHash(props.text, 50, 60, 0.05);
|
|
11
|
+
return { color: foreground, background };
|
|
12
|
+
});
|
|
15
13
|
</script>
|
|
16
14
|
|
|
17
15
|
<template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
text: string;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_5: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_5) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { useVModel } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
{
|
|
10
|
-
modelValue: false,
|
|
11
|
-
disabled: false,
|
|
12
|
-
},
|
|
13
|
-
)
|
|
14
|
-
const emit = defineEmits<{ (...args: any): void }>()
|
|
15
|
-
const checked = useVModel(props, 'modelValue', emit, { passive: true })
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useVModel } from "@vueuse/core";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
modelValue: { type: [Boolean, null], required: false, default: false },
|
|
5
|
+
disabled: { type: Boolean, required: false, default: false }
|
|
6
|
+
});
|
|
7
|
+
const emit = defineEmits([]);
|
|
8
|
+
const checked = useVModel(props, "modelValue", emit, { passive: true });
|
|
16
9
|
</script>
|
|
17
10
|
|
|
18
11
|
<template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue?: boolean | null;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_5: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_5) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
[x: `on${Capitalize<any>}`]: ((...args: unknown[]) => any) | undefined;
|
|
13
|
+
}>, {
|
|
14
|
+
modelValue: boolean | null;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -1,40 +1,27 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
grammarContextCode?: string
|
|
14
|
-
transformRendered?: (code: string) => string
|
|
15
|
-
}>(),
|
|
16
|
-
{
|
|
17
|
-
lines: true,
|
|
18
|
-
},
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
const emit = defineEmits(['loaded'])
|
|
22
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, nextTick } from "vue";
|
|
3
|
+
import { devToolsClient } from "../runtime/client";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
code: { type: String, required: true },
|
|
6
|
+
lang: { type: null, required: false },
|
|
7
|
+
lines: { type: Boolean, required: false, default: true },
|
|
8
|
+
inline: { type: Boolean, required: false },
|
|
9
|
+
grammarContextCode: { type: String, required: false },
|
|
10
|
+
transformRendered: { type: Function, required: false }
|
|
11
|
+
});
|
|
12
|
+
const emit = defineEmits(["loaded"]);
|
|
23
13
|
const rendered = computed(() => {
|
|
24
|
-
const result = props.lang ===
|
|
25
|
-
? { code: props.code, supported: false }
|
|
26
|
-
: devToolsClient.value?.devtools.renderCodeHighlight(props.code, props.lang, { grammarContextCode: props.grammarContextCode }) || { code: props.code, supported: false }
|
|
14
|
+
const result = props.lang === "text" ? { code: props.code, supported: false } : devToolsClient.value?.devtools.renderCodeHighlight(props.code, props.lang, { grammarContextCode: props.grammarContextCode }) || { code: props.code, supported: false };
|
|
27
15
|
if (result.supported && props.transformRendered)
|
|
28
|
-
result.code = props.transformRendered(result.code)
|
|
16
|
+
result.code = props.transformRendered(result.code);
|
|
29
17
|
if (result.supported)
|
|
30
|
-
nextTick(() => emit(
|
|
31
|
-
return result
|
|
32
|
-
})
|
|
33
|
-
|
|
18
|
+
nextTick(() => emit("loaded"));
|
|
19
|
+
return result;
|
|
20
|
+
});
|
|
34
21
|
const classes = computed(() => [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
])
|
|
22
|
+
"n-code-block shiki",
|
|
23
|
+
props.lines && !props.inline ? "n-code-block-lines" : ""
|
|
24
|
+
]);
|
|
38
25
|
</script>
|
|
39
26
|
|
|
40
27
|
<template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BuiltinLanguage } from 'shiki';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
code: string;
|
|
4
|
+
lang?: BuiltinLanguage | 'text';
|
|
5
|
+
lines?: boolean;
|
|
6
|
+
inline?: boolean;
|
|
7
|
+
grammarContextCode?: string;
|
|
8
|
+
transformRendered?: (code: string) => string;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
|
|
11
|
+
lines: boolean;
|
|
12
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
export default _default;
|
|
@@ -1,73 +1,55 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { useColorMode } from
|
|
3
|
-
|
|
4
|
-
import { computed, nextTick } from 'vue'
|
|
5
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useColorMode } from "@vueuse/core";
|
|
3
|
+
import { computed, nextTick } from "vue";
|
|
6
4
|
const mode = useColorMode({
|
|
7
|
-
storageKey:
|
|
8
|
-
})
|
|
9
|
-
const isDark = computed
|
|
5
|
+
storageKey: "nuxt-devtools-color-mode"
|
|
6
|
+
});
|
|
7
|
+
const isDark = computed({
|
|
10
8
|
get() {
|
|
11
|
-
return mode.value ===
|
|
9
|
+
return mode.value === "dark";
|
|
12
10
|
},
|
|
13
11
|
set() {
|
|
14
|
-
mode.value = isDark.value ?
|
|
15
|
-
}
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// @ts-expect-error document.startViewTransition can be undefined
|
|
20
|
-
&& document.startViewTransition
|
|
21
|
-
&& !window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Credit to [@hooray](https://github.com/hooray)
|
|
25
|
-
* @see https://github.com/vuejs/vitepress/pull/2347
|
|
26
|
-
*/
|
|
27
|
-
function toggle(event?: MouseEvent) {
|
|
12
|
+
mode.value = isDark.value ? "light" : "dark";
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const isAppearanceTransition = typeof document !== "undefined" && document.startViewTransition && !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
16
|
+
function toggle(event) {
|
|
28
17
|
if (!isAppearanceTransition || !event) {
|
|
29
|
-
isDark.value = !isDark.value
|
|
30
|
-
return
|
|
18
|
+
isDark.value = !isDark.value;
|
|
19
|
+
return;
|
|
31
20
|
}
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
const y = event.clientY
|
|
21
|
+
const x = event.clientX;
|
|
22
|
+
const y = event.clientY;
|
|
35
23
|
const endRadius = Math.hypot(
|
|
36
24
|
Math.max(x, innerWidth - x),
|
|
37
|
-
Math.max(y, innerHeight - y)
|
|
38
|
-
)
|
|
25
|
+
Math.max(y, innerHeight - y)
|
|
26
|
+
);
|
|
39
27
|
const transition = document.startViewTransition(async () => {
|
|
40
|
-
isDark.value = !isDark.value
|
|
41
|
-
await nextTick()
|
|
42
|
-
})
|
|
43
|
-
|
|
28
|
+
isDark.value = !isDark.value;
|
|
29
|
+
await nextTick();
|
|
30
|
+
});
|
|
44
31
|
transition.ready.then(() => {
|
|
45
32
|
const clipPath = [
|
|
46
33
|
`circle(0px at ${x}px ${y}px)`,
|
|
47
|
-
`circle(${endRadius}px at ${x}px ${y}px)
|
|
48
|
-
]
|
|
34
|
+
`circle(${endRadius}px at ${x}px ${y}px)`
|
|
35
|
+
];
|
|
49
36
|
document.documentElement.animate(
|
|
50
37
|
{
|
|
51
|
-
clipPath: isDark.value
|
|
52
|
-
? [...clipPath].reverse()
|
|
53
|
-
: clipPath,
|
|
38
|
+
clipPath: isDark.value ? [...clipPath].reverse() : clipPath
|
|
54
39
|
},
|
|
55
40
|
{
|
|
56
41
|
duration: 400,
|
|
57
|
-
easing:
|
|
58
|
-
pseudoElement: isDark.value
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
)
|
|
63
|
-
})
|
|
42
|
+
easing: "ease-in",
|
|
43
|
+
pseudoElement: isDark.value ? "::view-transition-old(root)" : "::view-transition-new(root)"
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
});
|
|
64
47
|
}
|
|
65
|
-
|
|
66
48
|
const context = {
|
|
67
49
|
mode,
|
|
68
50
|
isDark,
|
|
69
|
-
toggle
|
|
70
|
-
}
|
|
51
|
+
toggle
|
|
52
|
+
};
|
|
71
53
|
</script>
|
|
72
54
|
|
|
73
55
|
<template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_6: any;
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_6) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -1,58 +1,41 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { onClickOutside, useVModel } from
|
|
3
|
-
import { useFocusTrap } from
|
|
4
|
-
import { computed, nextTick, ref, watchEffect } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
autoClose: true,
|
|
16
|
-
},
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
const emit = defineEmits<{
|
|
20
|
-
(event: 'close'): void
|
|
21
|
-
(event: 'update:modelValue', value: boolean): void
|
|
22
|
-
}>()
|
|
23
|
-
|
|
24
|
-
const show = useVModel(props, 'modelValue', emit, { passive: true })
|
|
25
|
-
const card = ref(null)
|
|
26
|
-
const shown = ref(false)
|
|
27
|
-
|
|
28
|
-
const { activate, deactivate } = useFocusTrap(computed(() => card.value || document.body), { immediate: false })
|
|
29
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onClickOutside, useVModel } from "@vueuse/core";
|
|
3
|
+
import { useFocusTrap } from "@vueuse/integrations/useFocusTrap";
|
|
4
|
+
import { computed, nextTick, ref, watchEffect } from "vue";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
modelValue: { type: Boolean, required: false, default: false },
|
|
7
|
+
dim: { type: Boolean, required: false, default: true },
|
|
8
|
+
autoClose: { type: Boolean, required: false, default: true }
|
|
9
|
+
});
|
|
10
|
+
const emit = defineEmits(["close", "update:modelValue"]);
|
|
11
|
+
const show = useVModel(props, "modelValue", emit, { passive: true });
|
|
12
|
+
const card = ref(null);
|
|
13
|
+
const shown = ref(false);
|
|
14
|
+
const { activate, deactivate } = useFocusTrap(computed(() => card.value || document.body), { immediate: false });
|
|
30
15
|
watchEffect(
|
|
31
16
|
() => {
|
|
32
17
|
if (!shown.value && show.value)
|
|
33
|
-
shown.value = true
|
|
34
|
-
|
|
18
|
+
shown.value = true;
|
|
35
19
|
if (show.value && card.value)
|
|
36
|
-
nextTick(activate)
|
|
20
|
+
nextTick(activate);
|
|
37
21
|
else
|
|
38
|
-
deactivate()
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
|
|
22
|
+
deactivate();
|
|
23
|
+
}
|
|
24
|
+
);
|
|
42
25
|
onClickOutside(card, () => {
|
|
43
26
|
if (props.modelValue && props.autoClose) {
|
|
44
|
-
show.value = false
|
|
45
|
-
emit(
|
|
27
|
+
show.value = false;
|
|
28
|
+
emit("close");
|
|
46
29
|
}
|
|
47
30
|
}, {
|
|
48
|
-
ignore: [
|
|
49
|
-
})
|
|
31
|
+
ignore: ["a", "button", "summary"]
|
|
32
|
+
});
|
|
50
33
|
</script>
|
|
51
34
|
|
|
52
|
-
<script
|
|
35
|
+
<script>
|
|
53
36
|
export default {
|
|
54
|
-
inheritAttrs: false
|
|
55
|
-
}
|
|
37
|
+
inheritAttrs: false
|
|
38
|
+
};
|
|
56
39
|
</script>
|
|
57
40
|
|
|
58
41
|
<template>
|
|
@@ -63,14 +46,14 @@ export default {
|
|
|
63
46
|
role="dialog"
|
|
64
47
|
aria-modal="true"
|
|
65
48
|
:class="[
|
|
66
|
-
|
|
67
|
-
|
|
49
|
+
show ? '' : 'op0 pointer-events-none visibility-none'
|
|
50
|
+
]"
|
|
68
51
|
>
|
|
69
52
|
<div
|
|
70
53
|
class="absolute inset-0 -z-1"
|
|
71
54
|
:class="[
|
|
72
|
-
|
|
73
|
-
|
|
55
|
+
dim ? 'glass-effect' : ''
|
|
56
|
+
]"
|
|
74
57
|
/>
|
|
75
58
|
<NCard v-bind="$attrs" ref="card" class="max-h-screen of-auto">
|
|
76
59
|
<slot />
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
2
|
+
modelValue?: boolean;
|
|
3
|
+
dim?: boolean;
|
|
4
|
+
autoClose?: boolean;
|
|
5
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
6
|
+
close: () => any;
|
|
7
|
+
"update:modelValue": (value: boolean) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
9
|
+
modelValue?: boolean;
|
|
10
|
+
dim?: boolean;
|
|
11
|
+
autoClose?: boolean;
|
|
12
|
+
}> & Readonly<{
|
|
13
|
+
onClose?: (() => any) | undefined;
|
|
14
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
modelValue: boolean;
|
|
17
|
+
dim: boolean;
|
|
18
|
+
autoClose: boolean;
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
20
|
+
default?: (props: {}) => any;
|
|
21
|
+
}>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -1,50 +1,37 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { onClickOutside, useElementSize } from
|
|
3
|
-
import { ref } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
const emit = defineEmits<{
|
|
16
|
-
(e: 'close'): void
|
|
17
|
-
}>()
|
|
18
|
-
|
|
19
|
-
const el = ref<HTMLElement>()
|
|
20
|
-
|
|
21
|
-
const { height } = useElementSize(() => props.top as HTMLElement, undefined, { box: 'border-box' })
|
|
22
|
-
|
|
23
|
-
const width = typeof props.left === 'string' && props.left.startsWith('#')
|
|
24
|
-
? document.querySelector(props.left)?.getBoundingClientRect().width
|
|
25
|
-
: useElementSize(() => props.left as HTMLElement, undefined, { box: 'border-box' }).width
|
|
26
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onClickOutside, useElementSize } from "@vueuse/core";
|
|
3
|
+
import { ref } from "vue";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
modelValue: { type: Boolean, required: false },
|
|
6
|
+
top: { type: null, required: false },
|
|
7
|
+
left: { type: null, required: false },
|
|
8
|
+
autoClose: { type: Boolean, required: false },
|
|
9
|
+
transition: { type: String, required: false, default: "right" }
|
|
10
|
+
});
|
|
11
|
+
const emit = defineEmits(["close"]);
|
|
12
|
+
const el = ref();
|
|
13
|
+
const { height } = useElementSize(() => props.top, void 0, { box: "border-box" });
|
|
14
|
+
const width = typeof props.left === "string" && props.left.startsWith("#") ? document.querySelector(props.left)?.getBoundingClientRect().width : useElementSize(() => props.left, void 0, { box: "border-box" }).width;
|
|
27
15
|
onClickOutside(el, () => {
|
|
28
16
|
if (props.modelValue && props.autoClose)
|
|
29
|
-
emit(
|
|
17
|
+
emit("close");
|
|
30
18
|
}, {
|
|
31
|
-
ignore: [
|
|
32
|
-
})
|
|
33
|
-
|
|
19
|
+
ignore: ["a", "button", "summary", '[role="dialog"]']
|
|
20
|
+
});
|
|
34
21
|
const transitionType = {
|
|
35
22
|
right: {
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
"enter-from-class": "transform translate-x-1/1",
|
|
24
|
+
"leave-to-class": "transform translate-x-1/1"
|
|
38
25
|
},
|
|
39
26
|
top: {
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
"enter-from-class": "transform translate-y--1/1",
|
|
28
|
+
"leave-to-class": "transform translate-y--1/1"
|
|
42
29
|
},
|
|
43
30
|
bottom: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
}
|
|
31
|
+
"enter-from-class": "transform translate-y-1/1",
|
|
32
|
+
"leave-to-class": "transform translate-y-1/1"
|
|
33
|
+
}
|
|
34
|
+
};
|
|
48
35
|
</script>
|
|
49
36
|
|
|
50
37
|
<template>
|
|
@@ -63,9 +50,9 @@ const transitionType = {
|
|
|
63
50
|
:class="{ 'right-0': transition === 'right' || transition === 'bottom' }"
|
|
64
51
|
absolute bottom-0 z-10 z-20 of-auto text-sm n-glass-effect
|
|
65
52
|
:style="{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
53
|
+
top: transition === 'bottom' ? 'auto' : `${height}px`,
|
|
54
|
+
left: transition === 'right' && !width ? 'auto' : `${width}px`
|
|
55
|
+
}"
|
|
69
56
|
v-bind="$attrs"
|
|
70
57
|
>
|
|
71
58
|
<NButton absolute right-2 top-2 z-20 text-xl icon="carbon-close" :border="false" @click="$emit('close')" />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue?: boolean;
|
|
3
|
+
top?: HTMLElement | string;
|
|
4
|
+
left?: HTMLElement | string;
|
|
5
|
+
autoClose?: boolean;
|
|
6
|
+
transition?: 'right' | 'bottom' | 'top';
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_13: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_13) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
13
|
+
close: () => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
onClose?: (() => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
transition: "right" | "bottom" | "top";
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { onClickOutside, useVModel } from
|
|
3
|
-
import { ref } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const emit = defineEmits<{ (...args: any): void }>()
|
|
12
|
-
|
|
13
|
-
const enabled = useVModel(props, 'modelValue', emit, { passive: true })
|
|
14
|
-
const el = ref<HTMLDivElement>()
|
|
15
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onClickOutside, useVModel } from "@vueuse/core";
|
|
3
|
+
import { ref } from "vue";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
modelValue: { type: Boolean, required: false },
|
|
6
|
+
direction: { type: String, required: false, default: "start" }
|
|
7
|
+
});
|
|
8
|
+
const emit = defineEmits([]);
|
|
9
|
+
const enabled = useVModel(props, "modelValue", emit, { passive: true });
|
|
10
|
+
const el = ref();
|
|
16
11
|
onClickOutside(el, () => {
|
|
17
|
-
enabled.value = false
|
|
18
|
-
})
|
|
12
|
+
enabled.value = false;
|
|
13
|
+
});
|
|
19
14
|
</script>
|
|
20
15
|
|
|
21
16
|
<template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue?: boolean;
|
|
3
|
+
direction?: 'start' | 'end';
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_1: {
|
|
6
|
+
enabled: any;
|
|
7
|
+
click: () => boolean;
|
|
8
|
+
}, __VLS_11: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
trigger?: (props: typeof __VLS_1) => any;
|
|
11
|
+
} & {
|
|
12
|
+
default?: (props: typeof __VLS_11) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
15
|
+
[x: string]: never;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
[x: `on${Capitalize<any>}`]: ((...args: unknown[]) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
direction: "start" | "end";
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
icon?: string;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|