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
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ClassType } from '../../utils/class-style.js';
|
|
2
|
+
type Props = {
|
|
3
|
+
class?: ClassType;
|
|
4
|
+
open: boolean;
|
|
5
|
+
span?: number;
|
|
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<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
closed: () => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
14
|
+
onClosed?: (() => any) | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
class: ClassType;
|
|
17
|
+
span: number;
|
|
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
|
+
};
|
|
@@ -1,86 +1,55 @@
|
|
|
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
|
-
const baseClass = [
|
|
48
|
-
//
|
|
49
|
-
"w-full",
|
|
50
|
-
];
|
|
51
|
-
|
|
52
|
-
const classStyle = computed(() => {
|
|
53
|
-
return twMerge(baseClass, ClassTypeToString(props.class));
|
|
54
|
-
});
|
|
55
|
-
const classOverflow = [
|
|
56
|
-
//
|
|
57
|
-
"overflow-y-hidden",
|
|
58
|
-
];
|
|
59
|
-
const overflowClass = computed(() => {
|
|
60
|
-
if (innerHidden.value) return classOverflow;
|
|
61
|
-
return "";
|
|
62
|
-
});
|
|
63
|
-
// ----------------------------------------------------------------------------
|
|
64
|
-
</script>
|
|
65
|
-
|
|
66
|
-
<template>
|
|
67
|
-
<div
|
|
68
|
-
class="Accordion"
|
|
69
|
-
:class="[{ open: open }, classStyle]"
|
|
70
|
-
:style="`--hsui-accordion-span:${props.span}ms`"
|
|
71
|
-
>
|
|
72
|
-
<!-- :aria-hidden="!props.open" -->
|
|
73
|
-
<div :class="overflowClass"><slot /></div>
|
|
74
|
-
</div>
|
|
75
|
-
</template>
|
|
76
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref, watch, nextTick } 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
|
+
open: { type: Boolean, required: true },
|
|
8
|
+
span: { type: Number, required: false, default: 300 }
|
|
9
|
+
});
|
|
10
|
+
const innerHidden = ref(!props.open);
|
|
11
|
+
watch(
|
|
12
|
+
() => props.open,
|
|
13
|
+
(v) => {
|
|
14
|
+
if (v) {
|
|
15
|
+
setTimeout(() => {
|
|
16
|
+
if (props.open) {
|
|
17
|
+
innerHidden.value = !v;
|
|
18
|
+
}
|
|
19
|
+
}, props.span);
|
|
20
|
+
} else {
|
|
21
|
+
nextTick(() => {
|
|
22
|
+
innerHidden.value = !v;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
const classStyle = computed(() => {
|
|
28
|
+
return twMerge([props.open ? "open" : ""], ClassTypeToString(props.class));
|
|
29
|
+
});
|
|
30
|
+
const overflowClass = computed(() => {
|
|
31
|
+
return [innerHidden.value ? "overflow-y-hidden" : ""];
|
|
32
|
+
});
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<div
|
|
37
|
+
class="Accordion"
|
|
38
|
+
:class="classStyle"
|
|
39
|
+
:style="`--hsui-accordion-span:${props.span}ms`"
|
|
40
|
+
:inert="!props.open"
|
|
41
|
+
>
|
|
42
|
+
<div :class="overflowClass" class="overflow-y-hidden"><slot /></div>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
77
46
|
<style scoped>
|
|
78
47
|
.Accordion {
|
|
79
48
|
display: grid;
|
|
80
49
|
grid-template-rows: 0fr;
|
|
81
|
-
transition: grid-template-rows var(--hsui-accordion-span);
|
|
50
|
+
transition: grid-template-rows var(--hsui-accordion-span) ease-in-out;
|
|
82
51
|
}
|
|
83
52
|
.Accordion.open {
|
|
84
53
|
grid-template-rows: 1fr;
|
|
85
54
|
}
|
|
86
|
-
</style>
|
|
55
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ClassType } from '../../utils/class-style.js';
|
|
2
|
+
type Props = {
|
|
3
|
+
class?: ClassType;
|
|
4
|
+
open: boolean;
|
|
5
|
+
span?: number;
|
|
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<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
12
|
+
class: ClassType;
|
|
13
|
+
span: number;
|
|
14
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -1,60 +1,31 @@
|
|
|
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
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
31
|
-
class: "",
|
|
32
|
-
rate: "3:2",
|
|
33
|
-
});
|
|
34
|
-
const aspectRate = computed(() => {
|
|
35
|
-
const left = Int(props.rate.replace(/^(\d*):(\d*)$/, "$1"));
|
|
36
|
-
const right = Int(props.rate.replace(/^(\d*):(\d*)$/, "$2"));
|
|
37
|
-
if (left === 0 || right === 0) return "100";
|
|
38
|
-
return ((right / left) * 100).toFixed(3);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
const classStyle = computed(() => {
|
|
42
|
-
return twMerge(`relative block`, ClassTypeToString(props.class));
|
|
43
|
-
});
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<template>
|
|
47
|
-
<div
|
|
48
|
-
class="UiAspectContainer"
|
|
49
|
-
:class="classStyle"
|
|
50
|
-
:style="` --aspect-rate: ${aspectRate}%;`"
|
|
51
|
-
>
|
|
52
|
-
<div>
|
|
53
|
-
<slot />
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</template>
|
|
57
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
import { computed } from "#imports";
|
|
4
|
+
import { ClassTypeToString } from "../../utils/class-style";
|
|
5
|
+
import { Int } from "../../utils/number";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
class: { type: [String, Object, Array], required: false, default: "" },
|
|
8
|
+
rate: { type: String, required: false, default: "3:2" }
|
|
9
|
+
});
|
|
10
|
+
const aspectRate = computed(() => {
|
|
11
|
+
const left = Int(props.rate.replace(/^(\d*):(\d*)$/, "$1"));
|
|
12
|
+
const right = Int(props.rate.replace(/^(\d*):(\d*)$/, "$2"));
|
|
13
|
+
if (left === 0 || right === 0) return "100";
|
|
14
|
+
return (right / left * 100).toFixed(3);
|
|
15
|
+
});
|
|
16
|
+
const classStyle = computed(() => {
|
|
17
|
+
return twMerge(`relative block`, ClassTypeToString(props.class));
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div class="UiAspectContainer" :class="classStyle" :style="` --aspect-rate: ${aspectRate}%;`">
|
|
23
|
+
<div>
|
|
24
|
+
<slot />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
58
29
|
<style scoped>
|
|
59
30
|
.UiAspectContainer {
|
|
60
31
|
--aspect-rate: 66.66%;
|
|
@@ -68,4 +39,4 @@ const classStyle = computed(() => {
|
|
|
68
39
|
position: absolute;
|
|
69
40
|
inset: 0 0 0 0;
|
|
70
41
|
}
|
|
71
|
-
</style>
|
|
42
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ClassType } from '../../utils/class-style.js';
|
|
2
|
+
type Props = {
|
|
3
|
+
class?: ClassType;
|
|
4
|
+
/**
|
|
5
|
+
* Aspect ratio
|
|
6
|
+
* - Example:
|
|
7
|
+
* - 1:1
|
|
8
|
+
* - 3:2 <- Default
|
|
9
|
+
* - 4:3
|
|
10
|
+
* - 16:9
|
|
11
|
+
*/
|
|
12
|
+
rate?: string;
|
|
13
|
+
};
|
|
14
|
+
declare var __VLS_1: {};
|
|
15
|
+
type __VLS_Slots = {} & {
|
|
16
|
+
default?: (props: typeof __VLS_1) => any;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
19
|
+
class: ClassType;
|
|
20
|
+
rate: string;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -1,193 +1,148 @@
|
|
|
1
|
-
<script
|
|
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
|
-
base:
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
base:
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
base:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
return classTv.value.btn();
|
|
150
|
-
});
|
|
151
|
-
</script>
|
|
152
|
-
|
|
153
|
-
<template>
|
|
154
|
-
<template v-if="props.accordion === undefined">
|
|
155
|
-
<div
|
|
156
|
-
:ref="(e:any) => emit('ref', e)"
|
|
157
|
-
:style="styleMain"
|
|
158
|
-
:class="classTvBase"
|
|
159
|
-
@click.stop="emit('bg-click')"
|
|
160
|
-
>
|
|
161
|
-
<slot />
|
|
162
|
-
<Btn
|
|
163
|
-
v-if="props.open !== undefined || props.cross"
|
|
164
|
-
theme="white"
|
|
165
|
-
variant="outlined"
|
|
166
|
-
:class="classTvBtn"
|
|
167
|
-
:size="props.size"
|
|
168
|
-
@click.stop="
|
|
169
|
-
emit('update:open', !props.open);
|
|
170
|
-
emit('toggle');
|
|
171
|
-
"
|
|
172
|
-
>
|
|
173
|
-
<i
|
|
174
|
-
v-if="props.open !== undefined && !props.cross"
|
|
175
|
-
class="fa-solid fa-chevron-down"
|
|
176
|
-
:class="{ 'rotate-180': props.open }"
|
|
177
|
-
/>
|
|
178
|
-
<i v-else-if="props.cross" class="fa-solid fa-xmark" />
|
|
179
|
-
</Btn>
|
|
180
|
-
</div>
|
|
181
|
-
</template>
|
|
182
|
-
<template v-else>
|
|
183
|
-
<Accordion :open="props.accordion">
|
|
184
|
-
<div
|
|
185
|
-
:ref="(e:any) => emit('ref', e)"
|
|
186
|
-
:style="styleMain"
|
|
187
|
-
:class="classTvBase"
|
|
188
|
-
>
|
|
189
|
-
<slot />
|
|
190
|
-
</div>
|
|
191
|
-
</Accordion>
|
|
192
|
-
</template>
|
|
193
|
-
</template>
|
|
1
|
+
<script>
|
|
2
|
+
import { tv } from "../../utils/tv";
|
|
3
|
+
import { Theme } from "../../utils/theme";
|
|
4
|
+
import { ObjectKeyToMap } from "../../utils/object";
|
|
5
|
+
const cardItemTv = tv({
|
|
6
|
+
slots: {
|
|
7
|
+
base: [
|
|
8
|
+
//
|
|
9
|
+
`p-2 relative`,
|
|
10
|
+
"bg-[var(--main-color)]"
|
|
11
|
+
],
|
|
12
|
+
btn: [`border-[1px]`]
|
|
13
|
+
},
|
|
14
|
+
variants: {
|
|
15
|
+
variant: {
|
|
16
|
+
header: {
|
|
17
|
+
base: [`flex justify-between items-center`]
|
|
18
|
+
},
|
|
19
|
+
body: {
|
|
20
|
+
base: [``]
|
|
21
|
+
},
|
|
22
|
+
footer: {
|
|
23
|
+
base: [`flex justify-between items-center`]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
scroll: {
|
|
27
|
+
true: {
|
|
28
|
+
base: "overflow-y-auto overflow-x-hidden flex-1"
|
|
29
|
+
},
|
|
30
|
+
false: {
|
|
31
|
+
base: "flex-y-none"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
size: {
|
|
35
|
+
xs: {
|
|
36
|
+
base: [`p-1`],
|
|
37
|
+
btn: ["text-sm h-[30px] w-[30px]"]
|
|
38
|
+
},
|
|
39
|
+
s: {
|
|
40
|
+
base: [`p-1 ps-2`],
|
|
41
|
+
btn: ["text-sm h-[36px] w-[36px]"]
|
|
42
|
+
},
|
|
43
|
+
m: { btn: ["text-base h-[44px] w-[44px]"] },
|
|
44
|
+
l: { btn: ["text-base h-[48px] w-[48px]"] },
|
|
45
|
+
xl: { btn: ["text-lg h-[60px] w-[60px]"] }
|
|
46
|
+
},
|
|
47
|
+
theme: ObjectKeyToMap(Theme, "")
|
|
48
|
+
},
|
|
49
|
+
compoundVariants: [
|
|
50
|
+
...Object.keys(Theme).map((theme) => {
|
|
51
|
+
return {
|
|
52
|
+
theme,
|
|
53
|
+
class: {
|
|
54
|
+
base: [["back1", "white", "warn"].includes(theme) ? `` : "text-white "]
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<script setup>
|
|
63
|
+
import { computed, useId } from "#imports";
|
|
64
|
+
import { ClassTypeToString } from "../../utils/class-style";
|
|
65
|
+
import { GetColorCode } from "../../utils/theme";
|
|
66
|
+
import { useHsFocus } from "../../composables/use-hs-focus";
|
|
67
|
+
import { useHsPinia } from "../../composables/use-pinia";
|
|
68
|
+
import Btn from "../form/btn.vue";
|
|
69
|
+
import Accordion from "./accordion.vue";
|
|
70
|
+
const props = defineProps({
|
|
71
|
+
class: { type: [String, Object, Array], required: false, default: "" },
|
|
72
|
+
variant: { type: String, required: false, default: "body" },
|
|
73
|
+
size: { type: String, required: false, default: "m" },
|
|
74
|
+
accordion: { type: Boolean, required: false, skipCheck: true, default: void 0 },
|
|
75
|
+
theme: { type: null, required: false, default: void 0 },
|
|
76
|
+
scroll: { type: Boolean, required: false, default: false },
|
|
77
|
+
open: { type: Boolean, required: false, skipCheck: true, default: void 0 },
|
|
78
|
+
cross: { type: Boolean, required: false, default: false }
|
|
79
|
+
});
|
|
80
|
+
const emit = defineEmits(["ref", "update:open", "toggle"]);
|
|
81
|
+
const uid = useId();
|
|
82
|
+
const hsFocus = useHsFocus(useHsPinia());
|
|
83
|
+
const bgTheme = computed(() => {
|
|
84
|
+
if (props.theme !== void 0) return props.theme;
|
|
85
|
+
if (props.variant == "header") return Theme.main1;
|
|
86
|
+
if (props.variant == "footer") return Theme.main2;
|
|
87
|
+
return Theme.back1;
|
|
88
|
+
});
|
|
89
|
+
const styleMain = computed(() => {
|
|
90
|
+
return [
|
|
91
|
+
//
|
|
92
|
+
`--main-color:${GetColorCode(bgTheme.value)};`
|
|
93
|
+
];
|
|
94
|
+
});
|
|
95
|
+
const classTv = computed(() => {
|
|
96
|
+
return cardItemTv({
|
|
97
|
+
variant: props.variant,
|
|
98
|
+
scroll: props.scroll,
|
|
99
|
+
theme: bgTheme.value,
|
|
100
|
+
size: props.size
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
const classTvBase = computed(() => {
|
|
104
|
+
return classTv.value.base({
|
|
105
|
+
class: ClassTypeToString(props.class)
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
const classTvBtn = computed(() => {
|
|
109
|
+
return classTv.value.btn();
|
|
110
|
+
});
|
|
111
|
+
const toggleOpen = () => {
|
|
112
|
+
if (hsFocus.state.id !== uid) {
|
|
113
|
+
hsFocus.state.id = uid;
|
|
114
|
+
}
|
|
115
|
+
emit("update:open", !props.open);
|
|
116
|
+
emit("toggle");
|
|
117
|
+
};
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<template>
|
|
121
|
+
<template v-if="props.accordion === void 0">
|
|
122
|
+
<div :ref="(e) => emit('ref', e)" :style="styleMain" :class="classTvBase">
|
|
123
|
+
<slot />
|
|
124
|
+
<Btn
|
|
125
|
+
v-if="props.open !== void 0 || props.cross"
|
|
126
|
+
theme="white"
|
|
127
|
+
variant="outlined"
|
|
128
|
+
:class="classTvBtn"
|
|
129
|
+
:size="props.size"
|
|
130
|
+
@click.stop="toggleOpen"
|
|
131
|
+
>
|
|
132
|
+
<i
|
|
133
|
+
v-if="props.open !== void 0 && !props.cross"
|
|
134
|
+
class="fa-solid fa-chevron-down"
|
|
135
|
+
:class="{ 'rotate-180': props.open }"
|
|
136
|
+
/>
|
|
137
|
+
<i v-else-if="props.cross" class="fa-solid fa-xmark" />
|
|
138
|
+
</Btn>
|
|
139
|
+
</div>
|
|
140
|
+
</template>
|
|
141
|
+
<template v-else>
|
|
142
|
+
<Accordion :open="props.accordion">
|
|
143
|
+
<div :ref="(e) => emit('ref', e)" :style="styleMain" :class="classTvBase">
|
|
144
|
+
<slot />
|
|
145
|
+
</div>
|
|
146
|
+
</Accordion>
|
|
147
|
+
</template>
|
|
148
|
+
</template>
|
|
File without changes
|