@nuxt/devtools-ui-kit 3.4.1 → 3.4.2
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.d.vue.ts +13 -5
- package/dist/components/NBadge.vue +5 -0
- package/dist/components/NBadgeHashed.d.vue.ts +16 -21
- package/dist/components/NBadgeHashed.vue +19 -0
- package/dist/components/NCard.d.vue.ts +13 -5
- package/dist/components/NCard.vue +5 -0
- package/dist/components/NCheckbox.d.vue.ts +24 -36
- package/dist/components/NCheckbox.vue +29 -0
- package/dist/components/NCodeBlock.d.vue.ts +18 -64
- package/dist/components/NCodeBlock.vue +38 -0
- package/dist/components/NDarkToggle.d.vue.ts +18 -74
- package/dist/components/NDarkToggle.vue +60 -0
- package/dist/components/NDialog.d.vue.ts +28 -80
- package/dist/components/NDialog.vue +63 -0
- package/dist/components/NDrawer.d.vue.ts +26 -77
- package/dist/components/NDrawer.vue +64 -0
- package/dist/components/NDropdown.d.vue.ts +28 -36
- package/dist/components/NDropdown.vue +31 -0
- package/dist/components/NIcon.d.vue.ts +6 -9
- package/dist/components/NIcon.vue +9 -0
- package/dist/components/NIconTitle.d.vue.ts +17 -15
- package/dist/components/NIconTitle.vue +15 -0
- package/dist/components/NLink.d.vue.ts +19 -29
- package/dist/components/NLink.vue +27 -0
- package/dist/components/NLoading.d.vue.ts +13 -10
- package/dist/components/NLoading.vue +10 -0
- package/dist/components/NMarkdown.d.vue.ts +7 -19
- package/dist/components/NMarkdown.vue +16 -0
- package/dist/components/NNavbar.d.vue.ts +25 -34
- package/dist/components/NNavbar.vue +30 -0
- package/dist/components/NNotification.d.vue.ts +3 -48
- package/dist/components/NNotification.vue +44 -0
- package/dist/components/NPanelGrids.d.vue.ts +13 -5
- package/dist/components/NPanelGrids.vue +5 -0
- package/dist/components/NRadio.d.vue.ts +26 -40
- package/dist/components/NRadio.vue +33 -0
- package/dist/components/NSectionBlock.d.vue.ts +38 -97
- package/dist/components/NSectionBlock.vue +67 -0
- package/dist/components/NSelect.d.vue.ts +30 -37
- package/dist/components/NSelect.vue +28 -0
- package/dist/components/NSelectTabs.d.vue.ts +18 -49
- package/dist/components/NSelectTabs.vue +42 -0
- package/dist/components/NSplitPane.d.vue.ts +28 -82
- package/dist/components/NSplitPane.vue +37 -0
- package/dist/components/NSwitch.d.vue.ts +27 -34
- package/dist/components/NSwitch.vue +29 -0
- package/dist/components/NTextInput.d.vue.ts +34 -40
- package/dist/components/NTextInput.vue +28 -0
- package/dist/components/NTip.d.vue.ts +18 -16
- package/dist/components/NTip.vue +16 -0
- package/dist/module.json +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
import { devtoolsUiProvideNotificationFn } from "../composables/notification";
|
|
4
|
+
const show = ref(false);
|
|
5
|
+
const icon = ref();
|
|
6
|
+
const text = ref();
|
|
7
|
+
const classes = ref();
|
|
8
|
+
const position = ref("top-center");
|
|
9
|
+
devtoolsUiProvideNotificationFn((data) => {
|
|
10
|
+
text.value = data.message;
|
|
11
|
+
icon.value = data.icon;
|
|
12
|
+
classes.value = data.classes ?? "text-primary border-primary";
|
|
13
|
+
icon.value = data.icon;
|
|
14
|
+
show.value = true;
|
|
15
|
+
position.value = data.position ?? "top-center";
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
show.value = false;
|
|
18
|
+
}, data.duration ?? 1500);
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<div
|
|
24
|
+
fixed left-0 right-0 z-999 text-center
|
|
25
|
+
:class="[
|
|
26
|
+
{ 'pointer-events-none overflow-hidden': !show },
|
|
27
|
+
{ 'top-0': position.startsWith('top') },
|
|
28
|
+
{ 'bottom-0': position.startsWith('bottom') }
|
|
29
|
+
]"
|
|
30
|
+
>
|
|
31
|
+
<div flex :style="{ justifyContent: position.includes('right') ? 'right' : position.includes('left') ? 'left' : 'center' }">
|
|
32
|
+
<div
|
|
33
|
+
border="~ base"
|
|
34
|
+
flex="~ inline gap2"
|
|
35
|
+
m-3 inline-block items-center rounded bg-base px-4 py-1 transition-all duration-300
|
|
36
|
+
:style="show ? {} : { transform: `translateY(${position.startsWith('top') ? '-' : ''}300%)` }"
|
|
37
|
+
:class="[show ? 'shadow' : 'shadow-none', classes]"
|
|
38
|
+
>
|
|
39
|
+
<div v-if="icon" :class="icon" />
|
|
40
|
+
<div>{{ text }}</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -1,40 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
v-model="model"
|
|
28
|
-
type="radio"
|
|
29
|
-
class="peer absolute op0"
|
|
30
|
-
:disabled="disabled"
|
|
31
|
-
:name="name"
|
|
32
|
-
:value="value"
|
|
33
|
-
@keypress.enter="model = value!"
|
|
34
|
-
>
|
|
35
|
-
<span class="n-radio-box n-transition n-checked:n-radio-box-checked peer-active:n-active-base peer-focus-visible:n-focus-base">
|
|
36
|
-
<div class="n-radio-inner n-transition n-checked:n-radio-inner-checked" />
|
|
37
|
-
</span>
|
|
38
|
-
<span><slot /></span>
|
|
39
|
-
</label>
|
|
40
|
-
</template>
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue?: string;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
name?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_1: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
default?: (props: typeof __VLS_1) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
|
+
[x: string]: never;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
[x: `on${Capitalize<any>}`]: ((...args: unknown[]) => any) | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
modelValue: string;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useVModel } from "@vueuse/core";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
modelValue: { type: String, required: false, default: "" },
|
|
5
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
6
|
+
name: { type: String, required: false },
|
|
7
|
+
value: { type: String, required: false }
|
|
8
|
+
});
|
|
9
|
+
const emit = defineEmits([]);
|
|
10
|
+
const model = useVModel(props, "modelValue", emit, { passive: true });
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<label
|
|
15
|
+
class="n-radio inline-flex select-none items-center hover:n-radio-hover n-disabled:n-disabled"
|
|
16
|
+
:checked="model === value || null"
|
|
17
|
+
:disabled="disabled || null"
|
|
18
|
+
>
|
|
19
|
+
<input
|
|
20
|
+
v-model="model"
|
|
21
|
+
type="radio"
|
|
22
|
+
class="peer absolute op0"
|
|
23
|
+
:disabled="disabled"
|
|
24
|
+
:name="name"
|
|
25
|
+
:value="value"
|
|
26
|
+
@keypress.enter="model = value"
|
|
27
|
+
>
|
|
28
|
+
<span class="n-radio-box n-transition n-checked:n-radio-box-checked peer-active:n-active-base peer-focus-visible:n-focus-base">
|
|
29
|
+
<div class="n-radio-inner n-transition n-checked:n-radio-inner-checked" />
|
|
30
|
+
</span>
|
|
31
|
+
<span><slot /></span>
|
|
32
|
+
</label>
|
|
33
|
+
</template>
|
|
@@ -1,97 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<div text-base>
|
|
40
|
-
<slot name="text">
|
|
41
|
-
{{ text }}
|
|
42
|
-
</slot>
|
|
43
|
-
</div>
|
|
44
|
-
<div v-if="description || $slots.description" text-sm op50>
|
|
45
|
-
<slot name="description">
|
|
46
|
-
{{ description }}
|
|
47
|
-
</slot>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
<div class="flex-auto" />
|
|
51
|
-
<slot name="actions" />
|
|
52
|
-
<NIcon
|
|
53
|
-
v-if="collapse"
|
|
54
|
-
icon="carbon-chevron-down"
|
|
55
|
-
class="chevron"
|
|
56
|
-
cursor-pointer place-self-start text-base op75 transition duration-500
|
|
57
|
-
/>
|
|
58
|
-
</NIconTitle>
|
|
59
|
-
</summary>
|
|
60
|
-
<div
|
|
61
|
-
v-lazy-show="open"
|
|
62
|
-
class="flex flex-col flex-gap2 pb6 pt2"
|
|
63
|
-
:class="typeof padding === 'string' ? padding : padding ? 'px4' : ''"
|
|
64
|
-
>
|
|
65
|
-
<slot name="details" />
|
|
66
|
-
<div :class="containerClass" class="mt1">
|
|
67
|
-
<slot />
|
|
68
|
-
</div>
|
|
69
|
-
<slot name="footer" />
|
|
70
|
-
</div>
|
|
71
|
-
</details>
|
|
72
|
-
<div class="x-divider" />
|
|
73
|
-
</template>
|
|
74
|
-
|
|
75
|
-
<style scoped>
|
|
76
|
-
details {
|
|
77
|
-
--at-apply: border-none;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
summary {
|
|
81
|
-
--at-apply: border-none;
|
|
82
|
-
list-style: none;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
details[open] summary {
|
|
86
|
-
--at-apply: border-none;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
details summary::-webkit-details-marker {
|
|
90
|
-
display: none;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
details[open] .chevron {
|
|
94
|
-
transform: rotate(180deg);
|
|
95
|
-
opacity: 0.75;
|
|
96
|
-
}
|
|
97
|
-
</style>
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
icon?: string;
|
|
3
|
+
text?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
containerClass?: string;
|
|
6
|
+
headerClass?: string;
|
|
7
|
+
collapse?: boolean;
|
|
8
|
+
open?: boolean;
|
|
9
|
+
padding?: boolean | string;
|
|
10
|
+
};
|
|
11
|
+
declare var __VLS_7: {}, __VLS_9: {}, __VLS_11: {}, __VLS_18: {}, __VLS_20: {}, __VLS_22: {};
|
|
12
|
+
type __VLS_Slots = {} & {
|
|
13
|
+
text?: (props: typeof __VLS_7) => any;
|
|
14
|
+
} & {
|
|
15
|
+
description?: (props: typeof __VLS_9) => any;
|
|
16
|
+
} & {
|
|
17
|
+
actions?: (props: typeof __VLS_11) => any;
|
|
18
|
+
} & {
|
|
19
|
+
details?: (props: typeof __VLS_18) => any;
|
|
20
|
+
} & {
|
|
21
|
+
default?: (props: typeof __VLS_20) => any;
|
|
22
|
+
} & {
|
|
23
|
+
footer?: (props: typeof __VLS_22) => any;
|
|
24
|
+
};
|
|
25
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
26
|
+
containerClass: string;
|
|
27
|
+
collapse: boolean;
|
|
28
|
+
open: boolean;
|
|
29
|
+
padding: boolean | string;
|
|
30
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useVModel } from "@vueuse/core";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
icon: { type: String, required: false },
|
|
5
|
+
text: { type: String, required: false },
|
|
6
|
+
description: { type: String, required: false },
|
|
7
|
+
containerClass: { type: String, required: false, default: "" },
|
|
8
|
+
headerClass: { type: String, required: false },
|
|
9
|
+
collapse: { type: Boolean, required: false, default: true },
|
|
10
|
+
open: { type: Boolean, required: false, default: true },
|
|
11
|
+
padding: { type: [Boolean, String], required: false, default: true }
|
|
12
|
+
});
|
|
13
|
+
const open = useVModel(props, "open", void 0, { passive: true });
|
|
14
|
+
function onToggle(e) {
|
|
15
|
+
open.value = e.target.open;
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<!-- TODO: Seems something wrong with the DOM type -->
|
|
21
|
+
<!-- @vue-ignore -->
|
|
22
|
+
<details :open="open" @toggle="onToggle">
|
|
23
|
+
<summary
|
|
24
|
+
class="cursor-pointer select-none p4 hover:bg-active"
|
|
25
|
+
:class="collapse ? '' : 'pointer-events-none'"
|
|
26
|
+
>
|
|
27
|
+
<NIconTitle :icon="icon" :text="text" text-xl transition :class="[open ? 'op100' : 'op60', headerClass]">
|
|
28
|
+
<div>
|
|
29
|
+
<div text-base>
|
|
30
|
+
<slot name="text">
|
|
31
|
+
{{ text }}
|
|
32
|
+
</slot>
|
|
33
|
+
</div>
|
|
34
|
+
<div v-if="description || $slots.description" text-sm op50>
|
|
35
|
+
<slot name="description">
|
|
36
|
+
{{ description }}
|
|
37
|
+
</slot>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="flex-auto" />
|
|
41
|
+
<slot name="actions" />
|
|
42
|
+
<NIcon
|
|
43
|
+
v-if="collapse"
|
|
44
|
+
icon="carbon-chevron-down"
|
|
45
|
+
class="chevron"
|
|
46
|
+
cursor-pointer place-self-start text-base op75 transition duration-500
|
|
47
|
+
/>
|
|
48
|
+
</NIconTitle>
|
|
49
|
+
</summary>
|
|
50
|
+
<div
|
|
51
|
+
v-lazy-show="open"
|
|
52
|
+
class="flex flex-col flex-gap2 pb6 pt2"
|
|
53
|
+
:class="typeof padding === 'string' ? padding : padding ? 'px4' : ''"
|
|
54
|
+
>
|
|
55
|
+
<slot name="details" />
|
|
56
|
+
<div :class="containerClass" class="mt1">
|
|
57
|
+
<slot />
|
|
58
|
+
</div>
|
|
59
|
+
<slot name="footer" />
|
|
60
|
+
</div>
|
|
61
|
+
</details>
|
|
62
|
+
<div class="x-divider" />
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<style scoped>
|
|
66
|
+
details,summary{--at-apply:border-none}summary{list-style:none}details[open] summary{--at-apply:border-none}details summary::-webkit-details-marker{display:none}details[open] .chevron{opacity:.75;transform:rotate(180deg)}
|
|
67
|
+
</style>
|
|
@@ -1,37 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<option v-if="placeholder" value="" disabled hidden>
|
|
32
|
-
{{ placeholder }}
|
|
33
|
-
</option>
|
|
34
|
-
<slot />
|
|
35
|
-
</select>
|
|
36
|
-
</div>
|
|
37
|
-
</template>
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue?: any;
|
|
3
|
+
placeholder?: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_1: {}, __VLS_8: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
icon?: (props: typeof __VLS_1) => any;
|
|
10
|
+
} & {
|
|
11
|
+
default?: (props: typeof __VLS_8) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
14
|
+
[x: string]: never;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
[x: `on${Capitalize<any>}`]: ((...args: unknown[]) => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
modelValue: any;
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
icon: string;
|
|
21
|
+
placeholder: string;
|
|
22
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useVModel } from "@vueuse/core";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
modelValue: { type: null, required: false, default: void 0 },
|
|
5
|
+
placeholder: { type: String, required: false, default: "" },
|
|
6
|
+
icon: { type: String, required: false, default: "" },
|
|
7
|
+
disabled: { type: Boolean, required: false, default: false }
|
|
8
|
+
});
|
|
9
|
+
const emit = defineEmits([]);
|
|
10
|
+
const input = useVModel(props, "modelValue", emit, { passive: true });
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div
|
|
15
|
+
class="n-select flex flex items-center border rounded n-bg-base px-2 py-1 focus-within:border-context focus-within:n-focus-base"
|
|
16
|
+
:class="disabled ? 'border-gray:10' : 'n-border-base'"
|
|
17
|
+
>
|
|
18
|
+
<slot name="icon">
|
|
19
|
+
<NIcon v-if="icon" :icon="icon" class="mr-0.4em text-1.1em op50" />
|
|
20
|
+
</slot>
|
|
21
|
+
<select v-model="input" :disabled="disabled" class="w-full flex-auto n-bg-base !outline-none" :class="disabled ? 'appearance-none' : ''">
|
|
22
|
+
<option v-if="placeholder" value="" disabled hidden>
|
|
23
|
+
{{ placeholder }}
|
|
24
|
+
</option>
|
|
25
|
+
<slot />
|
|
26
|
+
</select>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
@@ -1,49 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<template>
|
|
20
|
-
<fieldset
|
|
21
|
-
class="n-select-tabs flex flex-inline flex-wrap items-center border n-border-base rounded n-bg-base"
|
|
22
|
-
>
|
|
23
|
-
<label
|
|
24
|
-
v-for="i, idx of options"
|
|
25
|
-
:key="i.label"
|
|
26
|
-
:disabled="disabled"
|
|
27
|
-
class="relative n-border-base px-0.5em py-0.1em hover:n-bg-active"
|
|
28
|
-
:class="[
|
|
29
|
-
idx ? 'border-l n-border-base ml--1px' : '',
|
|
30
|
-
i.value === input ? 'n-bg-active' : '',
|
|
31
|
-
]"
|
|
32
|
-
:title="i.label"
|
|
33
|
-
>
|
|
34
|
-
<div
|
|
35
|
-
:class="[
|
|
36
|
-
i.value === input ? '' : 'op35',
|
|
37
|
-
]"
|
|
38
|
-
>{{ i.label }}</div>
|
|
39
|
-
<input
|
|
40
|
-
v-model="input"
|
|
41
|
-
type="radio"
|
|
42
|
-
:disabled="disabled"
|
|
43
|
-
:value="i.value"
|
|
44
|
-
:title="i.label"
|
|
45
|
-
class="absolute inset-0 op-0.1"
|
|
46
|
-
>
|
|
47
|
-
</label>
|
|
48
|
-
</fieldset>
|
|
49
|
-
</template>
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue?: any;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
options: {
|
|
5
|
+
value: any;
|
|
6
|
+
label: string;
|
|
7
|
+
}[];
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: 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: any;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useVModel } from "@vueuse/core";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
modelValue: { type: null, required: false, default: void 0 },
|
|
5
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
6
|
+
options: { type: Array, required: true }
|
|
7
|
+
});
|
|
8
|
+
const emit = defineEmits([]);
|
|
9
|
+
const input = useVModel(props, "modelValue", emit, { passive: true });
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<fieldset
|
|
14
|
+
class="n-select-tabs flex flex-inline flex-wrap items-center border n-border-base rounded n-bg-base"
|
|
15
|
+
>
|
|
16
|
+
<label
|
|
17
|
+
v-for="i, idx of options"
|
|
18
|
+
:key="i.label"
|
|
19
|
+
:disabled="disabled"
|
|
20
|
+
class="relative n-border-base px-0.5em py-0.1em hover:n-bg-active"
|
|
21
|
+
:class="[
|
|
22
|
+
idx ? 'border-l n-border-base ml--1px' : '',
|
|
23
|
+
i.value === input ? 'n-bg-active' : ''
|
|
24
|
+
]"
|
|
25
|
+
:title="i.label"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
:class="[
|
|
29
|
+
i.value === input ? '' : 'op35'
|
|
30
|
+
]"
|
|
31
|
+
>{{ i.label }}</div>
|
|
32
|
+
<input
|
|
33
|
+
v-model="input"
|
|
34
|
+
type="radio"
|
|
35
|
+
:disabled="disabled"
|
|
36
|
+
:value="i.value"
|
|
37
|
+
:title="i.label"
|
|
38
|
+
class="absolute inset-0 op-0.1"
|
|
39
|
+
>
|
|
40
|
+
</label>
|
|
41
|
+
</fieldset>
|
|
42
|
+
</template>
|