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,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -1,82 +1,72 @@
|
|
|
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
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
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
|
-
<Teleport to="body">
|
|
74
|
-
<!-- -->
|
|
75
|
-
<div
|
|
76
|
-
class="ModalBg"
|
|
77
|
-
:class="classStyle"
|
|
78
|
-
:style="{ zIndex: zIndex }"
|
|
79
|
-
@click.stop="closeAll()"
|
|
80
|
-
/>
|
|
81
|
-
</Teleport>
|
|
82
|
-
</template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
import { computed, useHead } from "#imports";
|
|
4
|
+
import { ClassTypeToString } from "../../utils/class-style";
|
|
5
|
+
import { useHsModal } from "../../composables/use-hs-modal";
|
|
6
|
+
import { useHsPinia } from "../../composables/use-pinia";
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
class: { type: [String, Object, Array], required: false, default: "" },
|
|
9
|
+
target: { type: String, required: false, default: "body" }
|
|
10
|
+
});
|
|
11
|
+
const hsModal = useHsModal(useHsPinia());
|
|
12
|
+
const zIndex = computed(() => {
|
|
13
|
+
if (hsModal.state.activeList.length === 0) return -1;
|
|
14
|
+
return Math.max(...hsModal.state.activeList.map((row) => row.zIndex)) - 1;
|
|
15
|
+
});
|
|
16
|
+
const zIndexUiModal = computed(() => {
|
|
17
|
+
if (hsModal.state.activeList.length === 0) return 1;
|
|
18
|
+
return Math.max(...hsModal.state.activeList.map((row) => row.zIndex)) + 2;
|
|
19
|
+
});
|
|
20
|
+
useHead({
|
|
21
|
+
style: [
|
|
22
|
+
{
|
|
23
|
+
key: "ui-z-modal",
|
|
24
|
+
textContent: computed(() => `:root{--ui-z-modal:${zIndexUiModal.value}}`)
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
const activeData = computed(() => {
|
|
29
|
+
const len = hsModal.state.activeList.length;
|
|
30
|
+
if (len === 0) return null;
|
|
31
|
+
return hsModal.state.activeList[len - 1];
|
|
32
|
+
});
|
|
33
|
+
const bg = computed(() => {
|
|
34
|
+
if (!activeData.value) return "";
|
|
35
|
+
if (activeData.value.closeable) {
|
|
36
|
+
return "bg-slate-700/[0.6]";
|
|
37
|
+
}
|
|
38
|
+
return "bg-blue-800/[0.8]";
|
|
39
|
+
});
|
|
40
|
+
const isShow = computed(() => {
|
|
41
|
+
if (hsModal.state.activeList.length === 0) return false;
|
|
42
|
+
return true;
|
|
43
|
+
});
|
|
44
|
+
const classStyle = computed(() => {
|
|
45
|
+
return twMerge(
|
|
46
|
+
// 'transition-opacity',
|
|
47
|
+
"fixed",
|
|
48
|
+
"inset-0",
|
|
49
|
+
// 'transition-opacity',
|
|
50
|
+
bg.value,
|
|
51
|
+
// isShow.value ? 'pointer-events-auto' : 'pointer-events-none',
|
|
52
|
+
isShow.value ? "opacity-100" : "opacity-0",
|
|
53
|
+
ClassTypeToString(props.class)
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
const closeAll = () => {
|
|
57
|
+
hsModal.removeAll();
|
|
58
|
+
};
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<ClientOnly>
|
|
63
|
+
<Teleport :to="target">
|
|
64
|
+
<!-- -->
|
|
65
|
+
<div class="ModalBg" :class="classStyle" :style="{ zIndex }" @click.stop="closeAll()" />
|
|
66
|
+
</Teleport>
|
|
67
|
+
</ClientOnly>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<style>
|
|
71
|
+
[data-reka-popper-content-wrapper]{z-index:var(--ui-z-modal)!important}
|
|
72
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ClassType } from '../../utils/class-style.js';
|
|
2
|
+
type Props = {
|
|
3
|
+
class?: ClassType;
|
|
4
|
+
target?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
7
|
+
class: ClassType;
|
|
8
|
+
target: string;
|
|
9
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -1,172 +1,124 @@
|
|
|
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
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
props.closeable ? "cursor-pointer" : "",
|
|
121
|
-
props.show ? "pointer-events-all" : "pointer-events-none",
|
|
122
|
-
// "bg-red-600",
|
|
123
|
-
ClassTypeToString(props.classInner)
|
|
124
|
-
);
|
|
125
|
-
});
|
|
126
|
-
const closeOnBackEvent = () => {
|
|
127
|
-
if (props.closeable) {
|
|
128
|
-
emit("update:show", false);
|
|
129
|
-
emit("close");
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
const down = ref(false);
|
|
133
|
-
const downStop = () => {
|
|
134
|
-
// console.log("downStop", down.value);
|
|
135
|
-
if (down.value) {
|
|
136
|
-
down.value = false;
|
|
137
|
-
closeOnBackEvent();
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
</script>
|
|
141
|
-
|
|
142
|
-
<template>
|
|
143
|
-
<ClientOnly>
|
|
144
|
-
<Teleport to="body">
|
|
145
|
-
<div
|
|
146
|
-
v-if="mounted"
|
|
147
|
-
:id="id"
|
|
148
|
-
class="Modal"
|
|
149
|
-
data-show=""
|
|
150
|
-
:class="classStyle"
|
|
151
|
-
:style="{ zIndex: zOrder, opacity: props.show ? 1 : 0 }"
|
|
152
|
-
>
|
|
153
|
-
<div
|
|
154
|
-
:class="classInner"
|
|
155
|
-
@mousedown.self="down = true"
|
|
156
|
-
@mouseup.self="downStop"
|
|
157
|
-
@mousedown.stop
|
|
158
|
-
@mouseup.stop
|
|
159
|
-
@click.stop=""
|
|
160
|
-
>
|
|
161
|
-
<slot />
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
</Teleport>
|
|
165
|
-
</ClientOnly>
|
|
166
|
-
</template>
|
|
167
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
import { useId, computed, watch, onUnmounted, ref } from "#imports";
|
|
4
|
+
import { ClassTypeToString } from "../../utils/class-style";
|
|
5
|
+
import { useHsModal } from "../../composables/use-hs-modal";
|
|
6
|
+
import { useHsPinia } from "../../composables/use-pinia";
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
class: { type: [String, Object, Array], required: false, default: "" },
|
|
9
|
+
classInner: { type: [String, Object, Array], required: false, default: "" },
|
|
10
|
+
show: { type: Boolean, required: true },
|
|
11
|
+
mounted: { type: Boolean, required: false, default: true },
|
|
12
|
+
zIndex: { type: null, required: false, default: void 0 },
|
|
13
|
+
closeable: { type: Boolean, required: false, default: false },
|
|
14
|
+
target: { type: String, required: false, default: "body" }
|
|
15
|
+
});
|
|
16
|
+
const emit = defineEmits(["close", "update:show"]);
|
|
17
|
+
const hsModal = useHsModal(useHsPinia());
|
|
18
|
+
hsModal.watch();
|
|
19
|
+
const id = useId();
|
|
20
|
+
const zOrder = computed(() => {
|
|
21
|
+
if (props.zIndex !== void 0) return props.zIndex;
|
|
22
|
+
return hsModal.myzIndex(id).value;
|
|
23
|
+
});
|
|
24
|
+
if (props.show) {
|
|
25
|
+
if (props.zIndex !== void 0) {
|
|
26
|
+
hsModal.add(id, props.closeable, props.zIndex - 1);
|
|
27
|
+
} else {
|
|
28
|
+
hsModal.add(id, props.closeable);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
watch(
|
|
32
|
+
() => props.show,
|
|
33
|
+
(show) => {
|
|
34
|
+
if (show) {
|
|
35
|
+
if (props.zIndex !== void 0) {
|
|
36
|
+
hsModal.add(id, props.closeable, props.zIndex - 1);
|
|
37
|
+
} else {
|
|
38
|
+
hsModal.add(id, props.closeable);
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
hsModal.remove(id);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
onUnmounted(() => {
|
|
46
|
+
hsModal.remove(id);
|
|
47
|
+
});
|
|
48
|
+
const mounted = computed(() => {
|
|
49
|
+
if (props.show) return true;
|
|
50
|
+
if (props.mounted) return true;
|
|
51
|
+
return false;
|
|
52
|
+
});
|
|
53
|
+
const classStyle = computed(() => {
|
|
54
|
+
return twMerge(
|
|
55
|
+
[
|
|
56
|
+
//
|
|
57
|
+
"p-2",
|
|
58
|
+
"fixed",
|
|
59
|
+
"inset-0",
|
|
60
|
+
"flex",
|
|
61
|
+
"justify-center",
|
|
62
|
+
props.show ? "pointer-events-all" : "pointer-events-none"
|
|
63
|
+
],
|
|
64
|
+
ClassTypeToString(props.class)
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
const classInner = computed(() => {
|
|
68
|
+
return twMerge(
|
|
69
|
+
"w-full",
|
|
70
|
+
"h-full",
|
|
71
|
+
"p-0",
|
|
72
|
+
"flex",
|
|
73
|
+
"flex-col",
|
|
74
|
+
"items-center",
|
|
75
|
+
"overflow-auto",
|
|
76
|
+
// 'transition-opacity',
|
|
77
|
+
props.closeable ? "cursor-pointer" : "",
|
|
78
|
+
props.show ? "pointer-events-all" : "pointer-events-none",
|
|
79
|
+
// "bg-red-600",
|
|
80
|
+
ClassTypeToString(props.classInner)
|
|
81
|
+
);
|
|
82
|
+
});
|
|
83
|
+
const closeOnBackEvent = () => {
|
|
84
|
+
if (props.closeable) {
|
|
85
|
+
emit("update:show", false);
|
|
86
|
+
emit("close");
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const down = ref(false);
|
|
90
|
+
const downStop = () => {
|
|
91
|
+
if (down.value) {
|
|
92
|
+
down.value = false;
|
|
93
|
+
closeOnBackEvent();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<template>
|
|
99
|
+
<ClientOnly>
|
|
100
|
+
<Teleport :to="target">
|
|
101
|
+
<div
|
|
102
|
+
v-if="mounted"
|
|
103
|
+
:id="id"
|
|
104
|
+
class="Modal"
|
|
105
|
+
data-show=""
|
|
106
|
+
:class="classStyle"
|
|
107
|
+
:style="{ zIndex: zOrder, opacity: props.show ? 1 : 0 }"
|
|
108
|
+
>
|
|
109
|
+
<div :class="classInner" @mousedown.self="down = true" @mouseup.self="downStop">
|
|
110
|
+
<!-- @click.stop="" -->
|
|
111
|
+
<!-- @mousedown.stop @mouseup.stop -->
|
|
112
|
+
|
|
113
|
+
<slot />
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</Teleport>
|
|
117
|
+
</ClientOnly>
|
|
118
|
+
</template>
|
|
119
|
+
|
|
168
120
|
<style>
|
|
169
|
-
.Modal >
|
|
121
|
+
.Modal > div > * {
|
|
170
122
|
cursor: default;
|
|
171
123
|
}
|
|
172
|
-
</style>
|
|
124
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ClassType } from '../../utils/class-style.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
class?: ClassType;
|
|
4
|
+
classInner?: ClassType;
|
|
5
|
+
show: boolean;
|
|
6
|
+
mounted?: boolean;
|
|
7
|
+
zIndex?: number | undefined;
|
|
8
|
+
/** 背景クリックで閉じれる場合に背景色を切り替える機能
|
|
9
|
+
* - closeイベントとセットで使う */
|
|
10
|
+
closeable?: boolean;
|
|
11
|
+
target?: string;
|
|
12
|
+
}
|
|
13
|
+
declare var __VLS_14: {};
|
|
14
|
+
type __VLS_Slots = {} & {
|
|
15
|
+
default?: (props: typeof __VLS_14) => any;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
close: () => any;
|
|
19
|
+
"update:show": (bool: boolean) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
21
|
+
onClose?: (() => any) | undefined;
|
|
22
|
+
"onUpdate:show"?: ((bool: boolean) => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
zIndex: number;
|
|
25
|
+
closeable: boolean;
|
|
26
|
+
class: ClassType;
|
|
27
|
+
classInner: ClassType;
|
|
28
|
+
mounted: boolean;
|
|
29
|
+
target: 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
|
+
};
|