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,63 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "#imports";
|
|
3
|
+
import SelectItemLabel from "./item-label.vue";
|
|
4
|
+
import SelectImgIcon from "../select-img-icon.vue";
|
|
5
|
+
import { useHsPinia } from "../../../composables/use-pinia";
|
|
6
|
+
import { useHsMultiLang } from "../../../composables/use-hs-multi-lang";
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
item: { type: Object, required: true },
|
|
9
|
+
value: { type: [String, Number, null], required: false },
|
|
10
|
+
img: { type: Boolean, required: false },
|
|
11
|
+
activated: { type: Boolean, required: true },
|
|
12
|
+
classImg: { type: [String, Object, Array], required: false },
|
|
13
|
+
classImgTag: { type: [String, Object, Array], required: false },
|
|
14
|
+
imgMode: { type: String, required: false },
|
|
15
|
+
disabled: { type: Boolean, required: false },
|
|
16
|
+
readonly: { type: Boolean, required: false },
|
|
17
|
+
type: { type: String, required: true }
|
|
18
|
+
});
|
|
19
|
+
const multiLang = useHsMultiLang(useHsPinia());
|
|
20
|
+
const tx = multiLang.tx;
|
|
21
|
+
const labels = computed(() => {
|
|
22
|
+
return {
|
|
23
|
+
deleted: tx({ ja: "\u524A\u9664\u6E08", en: "Deleted" }).value,
|
|
24
|
+
hidden: tx({ ja: "\u975E\u8868\u793A", en: "Hidden" }).value
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<!-- item.imgUrl && -->
|
|
31
|
+
<SelectImgIcon
|
|
32
|
+
v-if="props.img"
|
|
33
|
+
:key="item._key + 'img'"
|
|
34
|
+
class="flex-none"
|
|
35
|
+
:img-url="item.imgUrl"
|
|
36
|
+
:class-img="props.classImg"
|
|
37
|
+
:class-img-tag="props.classImgTag"
|
|
38
|
+
:img-mode="props.imgMode"
|
|
39
|
+
/>
|
|
40
|
+
<SelectItemLabel
|
|
41
|
+
v-if="props.type === 'display'"
|
|
42
|
+
:key="item._key + 'label'"
|
|
43
|
+
:item="item"
|
|
44
|
+
overflow
|
|
45
|
+
:disabled="props.disabled"
|
|
46
|
+
:readonly="props.readonly"
|
|
47
|
+
/>
|
|
48
|
+
<SelectItemLabel v-if="props.type === 'item'" :key="item._key + 'label'" :item="item" overflow />
|
|
49
|
+
<div :key="item._key + 'state'" class="flex items-center gap-1 ml-auto">
|
|
50
|
+
<div v-if="props.item.deleted" class="text-error text-[0.7em] leading-[1em] p-1 mr-1 border border-error rounded">
|
|
51
|
+
{{ labels.deleted }}
|
|
52
|
+
</div>
|
|
53
|
+
<div v-if="props.item.hidden" class="text-error text-[0.7em] leading-[1em] p-1 mr-1 border border-error rounded">
|
|
54
|
+
{{ labels.hidden }}
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<div v-if="item.appendIcon" :key="item._key + 'appendIcon'" class="mr-1">
|
|
58
|
+
<i :class="item.appendIcon"></i>
|
|
59
|
+
</div>
|
|
60
|
+
<div v-if="props.type === 'item'" class="text-accent1 text-[1em] leading-[1em] w-5 ml-auto text-center">
|
|
61
|
+
<i v-if="props.item.id === value" class="fa-solid fa-check"></i>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ClassType } from '../../../utils/class-style.js';
|
|
2
|
+
import type { SelectItem } from '../../../utils/select-item.js';
|
|
3
|
+
type Props = {
|
|
4
|
+
item: SelectItem<string | number> & {
|
|
5
|
+
_key: string;
|
|
6
|
+
};
|
|
7
|
+
value?: string | number | null;
|
|
8
|
+
img?: boolean;
|
|
9
|
+
activated: boolean;
|
|
10
|
+
classImg?: ClassType;
|
|
11
|
+
classImgTag?: ClassType;
|
|
12
|
+
imgMode?: 'cover' | 'contain';
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
readonly?: boolean;
|
|
15
|
+
type: 'display' | 'item';
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
import { computed, useId } from "#imports";
|
|
4
|
+
import { useHsMultiLang } from "../../../composables/use-hs-multi-lang";
|
|
5
|
+
import { useHsPinia } from "../../../composables/use-pinia";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
item: { type: Object, required: true },
|
|
8
|
+
overflow: { type: Boolean, required: false },
|
|
9
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
10
|
+
disabled: { type: Boolean, required: false, default: false }
|
|
11
|
+
});
|
|
12
|
+
const multiLang = useHsMultiLang(useHsPinia());
|
|
13
|
+
const tx = multiLang.tx;
|
|
14
|
+
const text = props.item.text || "";
|
|
15
|
+
const uid = useId();
|
|
16
|
+
const baseClass = computed(() => {
|
|
17
|
+
return [
|
|
18
|
+
twMerge(
|
|
19
|
+
props.overflow ? "whitespace-pre-line break-all" : "truncate",
|
|
20
|
+
props.disabled ? "text-gray-600 " : "",
|
|
21
|
+
!props.disabled && props.readonly ? "text-black" : ""
|
|
22
|
+
)
|
|
23
|
+
];
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div :key="uid + text" class="min-w-0 flex-1 text-[1rem]" :class="baseClass" :title="String(props.item.text)">
|
|
29
|
+
{{ tx(props.item.text) }}
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SelectItem } from '../../../utils/select-item.js';
|
|
2
|
+
type Props = {
|
|
3
|
+
item: SelectItem<string | number>;
|
|
4
|
+
overflow?: boolean;
|
|
5
|
+
readonly?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
readonly: boolean;
|
|
11
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { Theme, GetColorCode } from "../../../utils/theme";
|
|
3
|
+
import { useHsPinia } from "../../../composables/use-pinia";
|
|
4
|
+
import { useHsMultiLang } from "../../../composables/use-hs-multi-lang";
|
|
5
|
+
import SelectItemContainer from "./item-container.vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
list: { type: Array, required: true },
|
|
8
|
+
item: { type: Object, required: true },
|
|
9
|
+
index: { type: Number, required: true },
|
|
10
|
+
activeId: { type: null, required: true },
|
|
11
|
+
hasLabel: { type: Boolean, required: true },
|
|
12
|
+
img: { type: Boolean, required: false },
|
|
13
|
+
classImg: { type: [String, Object, Array], required: true },
|
|
14
|
+
classImgTag: { type: [String, Object, Array], required: true },
|
|
15
|
+
imgMode: { type: String, required: true },
|
|
16
|
+
disabled: { type: Boolean, required: false },
|
|
17
|
+
readonly: { type: Boolean, required: false }
|
|
18
|
+
});
|
|
19
|
+
const emit = defineEmits(["update:selectOpen", "value-change", "focus", "blur"]);
|
|
20
|
+
const multiLang = useHsMultiLang(useHsPinia());
|
|
21
|
+
const tx = multiLang.tx;
|
|
22
|
+
const activeColorCode = GetColorCode(Theme.accent1);
|
|
23
|
+
const groupLabel = tx(props.item.groupLabel ?? "");
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<div class="w-full px-1">
|
|
28
|
+
<div
|
|
29
|
+
v-if="
|
|
30
|
+
props.item.groupId !== void 0 && (props.index === 0 || props.list[index - 1]?.groupId !== props.item.groupId)
|
|
31
|
+
"
|
|
32
|
+
class="my-1 py-1 px-2 font-semibold bg-dark/5 border-dark/40 border"
|
|
33
|
+
>
|
|
34
|
+
{{ groupLabel }}
|
|
35
|
+
</div>
|
|
36
|
+
<div :class="[props.item.id !== null && props.hasLabel ? 'pl-2' : '']">
|
|
37
|
+
<div
|
|
38
|
+
:key="props.item.id"
|
|
39
|
+
class="HsSelectItem cursor-pointer flex items-center w-full p-2 rounded border mb-px"
|
|
40
|
+
:class="[
|
|
41
|
+
props.item.id === props.activeId ? ' border-accent1' : 'border-transparent'
|
|
42
|
+
// props.item.id !== null && props.hasLabel ? \'ml-2\' : \'\',
|
|
43
|
+
]"
|
|
44
|
+
:style="`--color-bg: ${activeColorCode}10;`"
|
|
45
|
+
@click="emit('update:selectOpen', false)"
|
|
46
|
+
>
|
|
47
|
+
<SelectItemContainer
|
|
48
|
+
:item="props.item"
|
|
49
|
+
:value="props.activeId"
|
|
50
|
+
:img="props.img"
|
|
51
|
+
:activated="props.img"
|
|
52
|
+
:class-img="props.classImg"
|
|
53
|
+
:class-img-tag="props.classImgTag"
|
|
54
|
+
:img-mode="props.imgMode"
|
|
55
|
+
:disabled="props.disabled"
|
|
56
|
+
:readonly="props.readonly"
|
|
57
|
+
type="item"
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ClassType } from '../../../utils/class-style.js';
|
|
2
|
+
import type { SelectItem } from '../../../utils/select-item.js';
|
|
3
|
+
declare const __VLS_export: <IdType extends string | number>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: __VLS_PrettifyLocal<{
|
|
5
|
+
list: SelectItem<IdType>[];
|
|
6
|
+
item: SelectItem<IdType> & {
|
|
7
|
+
_key: string;
|
|
8
|
+
};
|
|
9
|
+
index: number;
|
|
10
|
+
activeId: IdType | null;
|
|
11
|
+
hasLabel: boolean;
|
|
12
|
+
img?: boolean;
|
|
13
|
+
classImg: ClassType;
|
|
14
|
+
classImgTag: ClassType;
|
|
15
|
+
imgMode: "cover" | "contain";
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
readonly?: boolean;
|
|
18
|
+
} & __VLS_EmitsToProps<__VLS_NormalizeEmits<((evt: "blur") => void) & ((evt: "focus") => void) & ((evt: "value-change", after: IdType | null, before: IdType | null) => void) & ((evt: "update:selectOpen", isOpen: boolean) => void)>>> & import("vue").PublicProps & (typeof globalThis extends {
|
|
19
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
20
|
+
} ? P : {});
|
|
21
|
+
expose: (exposed: {}) => void;
|
|
22
|
+
attrs: any;
|
|
23
|
+
slots: {};
|
|
24
|
+
emit: ((evt: "blur") => void) & ((evt: "focus") => void) & ((evt: "value-change", after: IdType | null, before: IdType | null) => void) & ((evt: "update:selectOpen", isOpen: boolean) => void);
|
|
25
|
+
}>) => import("vue").VNode & {
|
|
26
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
27
|
+
};
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
31
|
+
[K in keyof T]: T[K];
|
|
32
|
+
} : {
|
|
33
|
+
[K in keyof T as K]: T[K];
|
|
34
|
+
}) & {};
|
|
@@ -1,56 +1,37 @@
|
|
|
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
|
-
"justify-center",
|
|
36
|
-
"items-center",
|
|
37
|
-
"transition-opacity",
|
|
38
|
-
];
|
|
39
|
-
const classStyle = computed(() => {
|
|
40
|
-
return twMerge(baseClass, ClassTypeToString(props.class));
|
|
41
|
-
});
|
|
42
|
-
// ----------------------------------------------------------------------------
|
|
43
|
-
</script>
|
|
44
|
-
|
|
45
|
-
<template>
|
|
46
|
-
<div class="BtnLineLoading" :class="[classStyle, { show: props.show }]">
|
|
47
|
-
<span
|
|
48
|
-
class="loader"
|
|
49
|
-
:style="`--BtnLineLoading-height:${props.height}px;--BtnLineLoading-speed:${props.speed}ms`"
|
|
50
|
-
/>
|
|
51
|
-
</div>
|
|
52
|
-
</template>
|
|
53
|
-
|
|
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
|
+
show: { type: Boolean, required: true },
|
|
8
|
+
height: { type: null, required: false, default: 5 },
|
|
9
|
+
speed: { type: null, required: false, default: 1e3 }
|
|
10
|
+
});
|
|
11
|
+
const baseClass = [
|
|
12
|
+
//
|
|
13
|
+
"absolute",
|
|
14
|
+
"inset-0",
|
|
15
|
+
"bg-slate-600/[0.6]",
|
|
16
|
+
"flex",
|
|
17
|
+
"justify-center",
|
|
18
|
+
"items-center",
|
|
19
|
+
"transition-opacity"
|
|
20
|
+
];
|
|
21
|
+
const classStyle = computed(() => {
|
|
22
|
+
return twMerge(baseClass, ClassTypeToString(props.class));
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<div class="BtnLineLoading" :class="[classStyle, { show: props.show }]">
|
|
28
|
+
<span
|
|
29
|
+
class="loader"
|
|
30
|
+
:style="`--BtnLineLoading-height:${props.height}px;--BtnLineLoading-speed:${props.speed}ms`"
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
54
35
|
<style scoped>
|
|
55
36
|
.BtnLineLoading {
|
|
56
37
|
opacity: 0;
|
|
@@ -84,31 +65,31 @@ const classStyle = computed(() => {
|
|
|
84
65
|
box-sizing: border-box;
|
|
85
66
|
animation: BtnLineLoading-anime var(--BtnLineLoading-speed) linear infinite;
|
|
86
67
|
}
|
|
87
|
-
</style>
|
|
88
|
-
|
|
89
|
-
<style
|
|
90
|
-
@keyframes BtnLineLoading-anime {
|
|
91
|
-
0% {
|
|
92
|
-
opacity: 0;
|
|
93
|
-
left: 0;
|
|
94
|
-
transform: translateX(-200%);
|
|
95
|
-
}
|
|
96
|
-
20% {
|
|
97
|
-
opacity: 1;
|
|
98
|
-
left: 0;
|
|
99
|
-
transform: translateX(-200%);
|
|
100
|
-
}
|
|
101
|
-
80% {
|
|
102
|
-
opacity: 1;
|
|
103
|
-
left: 100%;
|
|
104
|
-
left: 0;
|
|
105
|
-
transform: translateX(200%);
|
|
106
|
-
}
|
|
107
|
-
100% {
|
|
108
|
-
left: 100%;
|
|
109
|
-
left: 0;
|
|
110
|
-
transform: translateX(200%);
|
|
111
|
-
opacity: 0;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
</style>
|
|
68
|
+
</style>
|
|
69
|
+
|
|
70
|
+
<style>
|
|
71
|
+
@keyframes BtnLineLoading-anime {
|
|
72
|
+
0% {
|
|
73
|
+
opacity: 0;
|
|
74
|
+
left: 0;
|
|
75
|
+
transform: translateX(-200%);
|
|
76
|
+
}
|
|
77
|
+
20% {
|
|
78
|
+
opacity: 1;
|
|
79
|
+
left: 0;
|
|
80
|
+
transform: translateX(-200%);
|
|
81
|
+
}
|
|
82
|
+
80% {
|
|
83
|
+
opacity: 1;
|
|
84
|
+
left: 100%;
|
|
85
|
+
left: 0;
|
|
86
|
+
transform: translateX(200%);
|
|
87
|
+
}
|
|
88
|
+
100% {
|
|
89
|
+
left: 100%;
|
|
90
|
+
left: 0;
|
|
91
|
+
transform: translateX(200%);
|
|
92
|
+
opacity: 0;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ClassType } from "../../utils/class-style.js";
|
|
2
|
+
interface Props {
|
|
3
|
+
class?: ClassType;
|
|
4
|
+
show: boolean;
|
|
5
|
+
height?: number | undefined;
|
|
6
|
+
speed?: number | undefined;
|
|
7
|
+
}
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
9
|
+
class: ClassType;
|
|
10
|
+
height: number;
|
|
11
|
+
speed: number;
|
|
12
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|