nuxt-hs-ui 2.12.7 → 4.0.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/README.md +202 -14
- package/dist/module.d.mts +3 -4
- package/dist/module.json +9 -6
- package/dist/module.mjs +109 -99
- package/dist/runtime/assets/flatpickr-dark.css +1 -1
- package/dist/runtime/assets/main.css +1 -0
- package/dist/runtime/assets/tabulator-custom.css +1 -1
- package/dist/runtime/components/form/_select/hidden-item-toggle.vue +28 -0
- package/dist/runtime/components/form/_select/hidden-item-toggle.vue.d.ts +10 -0
- package/dist/runtime/components/form/_select/item-container.vue +63 -0
- package/dist/runtime/components/form/_select/item-container.vue.d.ts +19 -0
- package/dist/runtime/components/form/_select/item-label.vue +31 -0
- package/dist/runtime/components/form/_select/item-label.vue.d.ts +13 -0
- package/dist/runtime/components/form/_select/item-row.vue +62 -0
- package/dist/runtime/components/form/_select/item-row.vue.d.ts +34 -0
- package/dist/runtime/components/form/btn-line-loading.vue +62 -81
- package/dist/runtime/components/form/btn-line-loading.vue.d.ts +14 -0
- package/dist/runtime/components/form/btn.vue +411 -494
- package/dist/runtime/components/form/btn.vue.d.ts +0 -0
- package/dist/runtime/components/form/check-box.vue +200 -315
- package/dist/runtime/components/form/check-box.vue.d.ts +71 -0
- package/dist/runtime/components/form/check-list.vue +234 -364
- package/dist/runtime/components/form/check-list.vue.d.ts +99 -0
- package/dist/runtime/components/form/combo-box.vue +340 -0
- package/dist/runtime/components/form/combo-box.vue.d.ts +69 -0
- package/dist/runtime/components/form/datepicker.vue +717 -883
- package/dist/runtime/components/form/datepicker.vue.d.ts +122 -0
- package/dist/runtime/components/form/input-frame.vue +174 -258
- package/dist/runtime/components/form/input-frame.vue.d.ts +88 -0
- package/dist/runtime/components/form/radio.vue +451 -614
- package/dist/runtime/components/form/radio.vue.d.ts +62 -0
- package/dist/runtime/components/form/select-img-icon.vue +38 -53
- package/dist/runtime/components/form/select-img-icon.vue.d.ts +15 -0
- package/dist/runtime/components/form/select.vue +733 -579
- package/dist/runtime/components/form/select.vue.d.ts +63 -0
- package/dist/runtime/components/form/text-box.vue +266 -365
- package/dist/runtime/components/form/text-box.vue.d.ts +105 -0
- package/dist/runtime/components/form/textarea.vue +338 -421
- package/dist/runtime/components/form/textarea.vue.d.ts +98 -0
- package/dist/runtime/components/form/value-box.vue +512 -641
- package/dist/runtime/components/form/value-box.vue.d.ts +128 -0
- package/dist/runtime/components/interactive/alert.vue +49 -113
- package/dist/runtime/components/interactive/alert.vue.d.ts +30 -0
- package/dist/runtime/components/interactive/block-loading.vue +91 -119
- package/dist/runtime/components/interactive/block-loading.vue.d.ts +22 -0
- package/dist/runtime/components/interactive/dialog.vue +252 -407
- package/dist/runtime/components/interactive/dialog.vue.d.ts +3 -0
- package/dist/runtime/components/interactive/modal-bg.vue +72 -82
- package/dist/runtime/components/interactive/modal-bg.vue.d.ts +11 -0
- package/dist/runtime/components/interactive/modal.vue +121 -169
- package/dist/runtime/components/interactive/modal.vue.d.ts +38 -0
- package/dist/runtime/components/interactive/toast.vue +164 -206
- package/dist/runtime/components/interactive/toast.vue.d.ts +3 -0
- package/dist/runtime/components/interactive/window-loader.vue +61 -84
- package/dist/runtime/components/interactive/window-loader.vue.d.ts +3 -0
- package/dist/runtime/components/layout/accordion-down.vue +72 -0
- package/dist/runtime/components/layout/accordion-down.vue.d.ts +26 -0
- package/dist/runtime/components/layout/accordion.vue +47 -78
- package/dist/runtime/components/layout/accordion.vue.d.ts +22 -0
- package/dist/runtime/components/layout/aspect-box.vue +29 -58
- package/dist/runtime/components/layout/aspect-box.vue.d.ts +29 -0
- package/dist/runtime/components/layout/card-item.vue +148 -193
- package/dist/runtime/components/layout/card-item.vue.d.ts +0 -0
- package/dist/runtime/components/layout/card.vue +27 -42
- package/dist/runtime/components/layout/card.vue.d.ts +23 -0
- package/dist/runtime/components/layout/container.vue +25 -40
- package/dist/runtime/components/layout/container.vue.d.ts +35 -0
- package/dist/runtime/components/layout/divider-h.vue +30 -50
- package/dist/runtime/components/layout/divider-h.vue.d.ts +18 -0
- package/dist/runtime/components/misc/breadcrumb.vue +47 -95
- package/dist/runtime/components/misc/breadcrumb.vue.d.ts +22 -0
- package/dist/runtime/components/misc/tabulator.vue +122 -190
- package/dist/runtime/components/misc/tabulator.vue.d.ts +28 -0
- package/dist/runtime/components/misc/view-name-display.vue +53 -68
- package/dist/runtime/components/misc/view-name-display.vue.d.ts +14 -0
- package/dist/runtime/components/test.vue +13 -0
- package/dist/runtime/components/test.vue.d.ts +3 -0
- package/dist/runtime/composables/test.d.ts +8 -0
- package/dist/runtime/composables/test.js +12 -0
- package/dist/runtime/composables/use-hs-dialog.d.ts +3 -20
- package/dist/runtime/composables/use-hs-dialog.js +3 -9
- package/dist/runtime/composables/use-hs-is-mobile.d.ts +8 -2
- package/dist/runtime/composables/use-hs-is-mobile.js +43 -25
- package/dist/runtime/composables/use-hs-misc.d.ts +8 -38
- package/dist/runtime/composables/use-hs-misc.js +9 -61
- package/dist/runtime/composables/use-hs-modal.js +1 -3
- package/dist/runtime/composables/use-hs-multi-lang.d.ts +23 -40
- package/dist/runtime/composables/use-hs-multi-lang.js +30 -74
- package/dist/runtime/composables/use-hs-scroll-lock.d.ts +1 -1
- package/dist/runtime/composables/use-hs-scroll-lock.js +2 -1
- package/dist/runtime/composables/use-hs-toast.d.ts +2 -2
- package/dist/runtime/composables/use-hs-toast.js +12 -4
- package/dist/runtime/composables/use-pinia.d.ts +1 -0
- package/dist/runtime/composables/use-pinia.js +2 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.js +4 -0
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/runtime/types/dialog.d.ts +11 -20
- package/dist/runtime/types/dialog.js +2 -1
- package/dist/runtime/types/flatpickr/default.js +2 -23
- package/dist/runtime/types/flatpickr/ja.js +3 -37
- package/dist/runtime/types/toast.d.ts +1 -1
- package/dist/runtime/utils/dayjs.d.ts +8 -6
- package/dist/runtime/utils/dayjs.js +12 -5
- package/dist/runtime/utils/modal.d.ts +9 -28
- package/dist/runtime/utils/modal.js +7 -36
- package/dist/runtime/utils/multi-lang-object.d.ts +2 -2
- package/dist/runtime/utils/multi-lang-object.js +1 -5
- package/dist/runtime/utils/multi-lang.js +12 -22
- package/dist/runtime/utils/object.js +1 -1
- package/dist/runtime/utils/select-item.d.ts +3 -1
- package/dist/runtime/utils/stop-watch.js +6 -4
- package/dist/runtime/utils/string.js +4 -4
- package/dist/runtime/utils/tabulator.d.ts +1 -42
- package/dist/runtime/utils/tabulator.js +2 -99
- package/dist/runtime/utils/theme.d.ts +20 -20
- package/dist/runtime/utils/theme.js +180 -30
- package/dist/runtime/utils/tv.d.ts +1 -101
- package/dist/runtime/utils/tv.js +0 -22
- package/dist/types.d.mts +3 -1
- package/package.json +61 -119
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -16
- package/dist/runtime/assets/vue-select.css +0 -1
- package/dist/runtime/components/misc/view-name-display-target.vue +0 -39
- package/dist/runtime/plugin/v-select.d.ts +0 -2
- package/dist/runtime/plugin/v-select.js +0 -5
- package/dist/runtime/style.css +0 -22
- package/dist/runtime/tailwind.css +0 -78
- package/dist/runtime/types/app.config.d.ts +0 -5
- package/dist/types.d.ts +0 -1
|
@@ -1,42 +1,27 @@
|
|
|
1
|
-
<script setup
|
|
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
|
-
"flex-col",
|
|
29
|
-
"border-[2px]",
|
|
30
|
-
"border-white",
|
|
31
|
-
"shadow-[0px_0px_4px_0px_#000]",
|
|
32
|
-
];
|
|
33
|
-
const classStyle = computed(() => {
|
|
34
|
-
return twMerge(baseClass, ClassTypeToString(props.class));
|
|
35
|
-
});
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<template>
|
|
39
|
-
<div :class="classStyle">
|
|
40
|
-
<slot />
|
|
41
|
-
</div>
|
|
42
|
-
</template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "#imports";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
import { ClassTypeToString } from "../../utils/class-style";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
class: { type: [String, Object, Array], required: false, default: "" }
|
|
7
|
+
});
|
|
8
|
+
const emit = defineEmits(["ref"]);
|
|
9
|
+
const baseClass = [
|
|
10
|
+
//
|
|
11
|
+
"relative",
|
|
12
|
+
"flex",
|
|
13
|
+
"flex-col",
|
|
14
|
+
"border-[2px]",
|
|
15
|
+
"border-white",
|
|
16
|
+
"shadow-[0px_0px_4px_0px_#000]"
|
|
17
|
+
];
|
|
18
|
+
const classStyle = computed(() => {
|
|
19
|
+
return twMerge(baseClass, ClassTypeToString(props.class));
|
|
20
|
+
});
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div :ref="(e) => emit('ref', e)" :class="classStyle">
|
|
25
|
+
<slot />
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ClassType } from '../../utils/class-style.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
class?: ClassType;
|
|
4
|
+
}
|
|
5
|
+
declare var __VLS_1: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_1) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
ref: (element: HTMLElement) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
12
|
+
onRef?: ((element: HTMLElement) => any) | undefined;
|
|
13
|
+
}>, {
|
|
14
|
+
class: ClassType;
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -1,40 +1,25 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return twMerge(
|
|
27
|
-
"mx-auto px-2",
|
|
28
|
-
props.fluid
|
|
29
|
-
? "w-full"
|
|
30
|
-
: "w-full xs:max-w-[600px] md:max-w-[700px] lg:max-w-[950px] xl:max-w-[1200px] 2xl:max-w-[1450px]",
|
|
31
|
-
ClassTypeToString(props.class)
|
|
32
|
-
);
|
|
33
|
-
});
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<template>
|
|
37
|
-
<div :class="classStyle">
|
|
38
|
-
<slot />
|
|
39
|
-
</div>
|
|
40
|
-
</template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "#imports";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
import { ClassTypeToString } from "../../utils/class-style";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
class: { type: [String, Object, Array], required: false, default: "" },
|
|
7
|
+
fluid: { type: Boolean, required: false, default: false },
|
|
8
|
+
brakePoint: { type: Array, required: false, default: () => [
|
|
9
|
+
"xs:max-w-[600px]",
|
|
10
|
+
"md:max-w-[700px]",
|
|
11
|
+
"lg:max-w-[950px]",
|
|
12
|
+
"xl:max-w-[1200px]",
|
|
13
|
+
"2xl:max-w-[1450px]"
|
|
14
|
+
] }
|
|
15
|
+
});
|
|
16
|
+
const classStyle = computed(() => {
|
|
17
|
+
return twMerge("mx-auto px-2 w-full", props.fluid ? "" : props.brakePoint, ClassTypeToString(props.class));
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div :class="classStyle">
|
|
23
|
+
<slot />
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ClassType } from '../../utils/class-style.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
class?: ClassType;
|
|
4
|
+
fluid?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* default
|
|
7
|
+
* ```javascript
|
|
8
|
+
* const brakePoint= [
|
|
9
|
+
* 'xs:max-w-[600px]',
|
|
10
|
+
* 'md:max-w-[700px]',
|
|
11
|
+
* 'lg:max-w-[950px]',
|
|
12
|
+
* 'xl:max-w-[1200px]',
|
|
13
|
+
* '2xl:max-w-[1450px]',
|
|
14
|
+
* ]
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
brakePoint?: string[];
|
|
18
|
+
}
|
|
19
|
+
declare var __VLS_1: {};
|
|
20
|
+
type __VLS_Slots = {} & {
|
|
21
|
+
default?: (props: typeof __VLS_1) => any;
|
|
22
|
+
};
|
|
23
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
24
|
+
class: ClassType;
|
|
25
|
+
fluid: boolean;
|
|
26
|
+
brakePoint: string[];
|
|
27
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
29
|
+
declare const _default: typeof __VLS_export;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -1,52 +1,32 @@
|
|
|
1
|
-
<script setup
|
|
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
|
-
class: "",
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const style = computed(() => {
|
|
34
|
-
return [
|
|
35
|
-
`--main-color:${GetGolorCode(props.theme)};`,
|
|
36
|
-
`--size:${props.size}px;`,
|
|
37
|
-
`--span1:${props.span1}px;`,
|
|
38
|
-
`--span2:${props.span2}px;`,
|
|
39
|
-
];
|
|
40
|
-
});
|
|
41
|
-
const classStyle = computed(() => {
|
|
42
|
-
return twMerge("h-[var(--size)] w-full", ClassTypeToString(props.class));
|
|
43
|
-
});
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<template>
|
|
47
|
-
<div class="divider" :class="classStyle" :style="style"></div>
|
|
48
|
-
</template>
|
|
49
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
import { computed } from "#imports";
|
|
4
|
+
import { ClassTypeToString } from "../../utils/class-style";
|
|
5
|
+
import { Theme, GetColorCode } from "../../utils/theme";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
theme: { type: null, required: false, default: Theme.main0 },
|
|
8
|
+
size: { type: Number, required: false, default: 2 },
|
|
9
|
+
span1: { type: Number, required: false, default: 4 },
|
|
10
|
+
span2: { type: Number, required: false, default: 8 },
|
|
11
|
+
class: { type: [String, Object, Array], required: false, default: "" }
|
|
12
|
+
});
|
|
13
|
+
const style = computed(() => {
|
|
14
|
+
return [
|
|
15
|
+
`--main-color:${GetColorCode(props.theme)};`,
|
|
16
|
+
`--size:${props.size}px;`,
|
|
17
|
+
`--span1:${props.span1}px;`,
|
|
18
|
+
`--span2:${props.span2}px;`
|
|
19
|
+
];
|
|
20
|
+
});
|
|
21
|
+
const classStyle = computed(() => {
|
|
22
|
+
return twMerge("h-[var(--size)] w-full", ClassTypeToString(props.class));
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<div class="divider" :class="classStyle" :style="style"></div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
50
30
|
<style scoped>
|
|
51
31
|
.divider {
|
|
52
32
|
background-image: linear-gradient(to right, var(--main-color), var(--main-color) var(--span1), transparent var(--span1), transparent var(--span2));
|
|
@@ -54,4 +34,4 @@ const classStyle = computed(() => {
|
|
|
54
34
|
background-repeat: repeat-x;
|
|
55
35
|
background-position: left bottom;
|
|
56
36
|
}
|
|
57
|
-
</style>
|
|
37
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ClassType } from '../../utils/class-style.js';
|
|
2
|
+
import { type ThemeColor } from '../../utils/theme.js';
|
|
3
|
+
interface Props {
|
|
4
|
+
theme?: ThemeColor;
|
|
5
|
+
size?: number;
|
|
6
|
+
span1?: number;
|
|
7
|
+
span2?: number;
|
|
8
|
+
class?: ClassType;
|
|
9
|
+
}
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
11
|
+
size: number;
|
|
12
|
+
theme: ThemeColor;
|
|
13
|
+
class: ClassType;
|
|
14
|
+
span1: number;
|
|
15
|
+
span2: number;
|
|
16
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -1,83 +1,49 @@
|
|
|
1
|
-
<script setup
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
</script>
|
|
48
|
-
|
|
49
|
-
<template>
|
|
50
|
-
<Card :class="classStyle">
|
|
51
|
-
<CardItem
|
|
52
|
-
class="px-1 py-1 sm:px-4 sm:py-1 min-w-0 h-full flex-c"
|
|
53
|
-
theme="back"
|
|
54
|
-
variant="body"
|
|
55
|
-
>
|
|
56
|
-
<div class="flex flex-wrap gap-[2px] sm:gap-[4px] max-w-full">
|
|
57
|
-
<template v-for="(item, index) in props.links" :key="index">
|
|
58
|
-
<div class="truncate min-w-0 w-full sm:w-auto">
|
|
59
|
-
<NuxtLink
|
|
60
|
-
v-if="item.to !== undefined"
|
|
61
|
-
:to="item.to"
|
|
62
|
-
:class="[classStyleLink, { hasBefore: index !== 0 }]"
|
|
63
|
-
>
|
|
64
|
-
<i v-if="item.icon" :class="item.icon"></i>
|
|
65
|
-
{{ tx(item.label) }}
|
|
66
|
-
</NuxtLink>
|
|
67
|
-
<span
|
|
68
|
-
v-else
|
|
69
|
-
:class="[classStyleUnlink, { hasBefore: index !== 0 }]"
|
|
70
|
-
>
|
|
71
|
-
<i v-if="item.icon" :class="item.icon"></i>
|
|
72
|
-
{{ tx(item.label) }}
|
|
73
|
-
</span>
|
|
74
|
-
</div>
|
|
75
|
-
</template>
|
|
76
|
-
</div>
|
|
77
|
-
</CardItem>
|
|
78
|
-
</Card>
|
|
79
|
-
</template>
|
|
80
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
import { computed } from "#imports";
|
|
4
|
+
import { ClassTypeToString } from "../../utils/class-style";
|
|
5
|
+
import Card from "../layout/card.vue";
|
|
6
|
+
import CardItem from "../layout/card-item.vue";
|
|
7
|
+
import { Theme } from "../../utils/theme";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
class: { type: [String, Object, Array], required: false, default: "" },
|
|
10
|
+
links: { type: Array, required: true },
|
|
11
|
+
classLink: { type: [String, Object, Array], required: false, default: "" },
|
|
12
|
+
classUnlink: { type: [String, Object, Array], required: false, default: "" },
|
|
13
|
+
theme: { type: null, required: false, default: Theme.back1 }
|
|
14
|
+
});
|
|
15
|
+
const classStyle = computed(() => {
|
|
16
|
+
return twMerge(`w-full min-w-0`, ClassTypeToString(props.class));
|
|
17
|
+
});
|
|
18
|
+
const classStyleLink = computed(() => {
|
|
19
|
+
return twMerge(`!text-link`, "relative", ClassTypeToString(props.classLink));
|
|
20
|
+
});
|
|
21
|
+
const classStyleUnlink = computed(() => {
|
|
22
|
+
return twMerge(`text-gray-600`, ClassTypeToString(props.classUnlink));
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<Card :class="classStyle">
|
|
28
|
+
<CardItem class="px-1 py-1 min-w-0 h-full" :theme="props.theme" variant="body">
|
|
29
|
+
<div class="flex flex-wrap gap-[2px] max-w-full relative items-center min-h-full">
|
|
30
|
+
<template v-for="(item, index) in props.links" :key="index">
|
|
31
|
+
<div class="truncate min-w-0 w-auto relative text-link">
|
|
32
|
+
<NuxtLink v-if="item.to !== void 0" :to="item.to" :class="[classStyleLink, { hasBefore: index !== 0 }]">
|
|
33
|
+
<i v-if="item.icon" :class="item.icon"></i>
|
|
34
|
+
{{ item.label }}
|
|
35
|
+
</NuxtLink>
|
|
36
|
+
<span v-else :class="[classStyleUnlink, { hasBefore: index !== 0 }]">
|
|
37
|
+
<i v-if="item.icon" :class="item.icon"></i>
|
|
38
|
+
{{ item.label }}
|
|
39
|
+
</span>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
</div>
|
|
43
|
+
</CardItem>
|
|
44
|
+
</Card>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
81
47
|
<style scoped>
|
|
82
48
|
.hasBefore {
|
|
83
49
|
padding-left: calc(1em + 4px);
|
|
@@ -95,18 +61,4 @@ const classStyleUnlink = computed(() => {
|
|
|
95
61
|
justify-content: center;
|
|
96
62
|
align-items: center;
|
|
97
63
|
}
|
|
98
|
-
|
|
99
|
-
.hov::before {
|
|
100
|
-
content: "";
|
|
101
|
-
position: absolute;
|
|
102
|
-
inset: auto auto 0 0;
|
|
103
|
-
width: 0;
|
|
104
|
-
height: 1px;
|
|
105
|
-
background-color: white;
|
|
106
|
-
transition: all 300ms ease;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.hov:hover::before {
|
|
110
|
-
width: 100%;
|
|
111
|
-
}
|
|
112
|
-
</style>
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ClassType } from '../../utils/class-style.js';
|
|
2
|
+
import type { MultiLang } from '../../utils/multi-lang.js';
|
|
3
|
+
import { type ThemeColor } from '../../utils/theme.js';
|
|
4
|
+
interface Props {
|
|
5
|
+
class?: ClassType;
|
|
6
|
+
links: {
|
|
7
|
+
label: MultiLang;
|
|
8
|
+
to?: string;
|
|
9
|
+
icon?: string;
|
|
10
|
+
}[];
|
|
11
|
+
classLink?: ClassType;
|
|
12
|
+
classUnlink?: ClassType;
|
|
13
|
+
theme?: ThemeColor;
|
|
14
|
+
}
|
|
15
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
16
|
+
theme: ThemeColor;
|
|
17
|
+
class: ClassType;
|
|
18
|
+
classLink: ClassType;
|
|
19
|
+
classUnlink: ClassType;
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|