nuxt-hs-ui 1.0.10 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -4
- package/dist/module.d.mts +10 -2
- package/dist/module.d.ts +10 -2
- package/dist/module.json +5 -2
- package/dist/module.mjs +90 -51
- package/dist/runtime/assets/flatpickr-dark.css +1 -0
- package/dist/runtime/assets/flatpickr-month-select-style.css +1 -0
- package/dist/runtime/assets/tabulator-custom.css +1 -0
- package/dist/runtime/assets/tabulator.css +1 -0
- package/dist/runtime/assets/vue-select.css +1 -0
- package/dist/runtime/components/{hs-fc/btn/line-loading.vue → form/btn-line-loading.vue} +28 -42
- package/dist/runtime/components/form/btn.vue +488 -0
- package/dist/runtime/components/form/check-box.vue +352 -0
- package/dist/runtime/components/form/check-list.vue +354 -0
- package/dist/runtime/components/form/datepicker copy.vue +770 -0
- package/dist/runtime/components/form/datepicker.vue +897 -0
- package/dist/runtime/components/form/input-frame.vue +272 -0
- package/dist/runtime/components/form/radio.vue +685 -0
- package/dist/runtime/components/form/select-img-icon.vue +53 -0
- package/dist/runtime/components/form/select.vue +438 -0
- package/dist/runtime/components/form/text-box.vue +375 -0
- package/dist/runtime/components/form/textarea.vue +466 -0
- package/dist/runtime/components/form/value-box.vue +681 -0
- package/dist/runtime/components/interactive/alert.vue +113 -0
- package/dist/runtime/components/{hs-ui → interactive}/block-loading.vue +42 -59
- package/dist/runtime/components/{hs-ui/dialog/index.vue → interactive/dialog.vue} +132 -127
- package/dist/runtime/components/interactive/modal-bg.vue +82 -0
- package/dist/runtime/components/interactive/modal.vue +143 -0
- package/dist/runtime/components/{hs-ui/toast/index.vue → interactive/toast.vue} +76 -109
- package/dist/runtime/components/{hs-ui → interactive}/window-loader.vue +12 -9
- package/dist/runtime/components/{hs-ui → layout}/accordion.vue +21 -30
- package/dist/runtime/components/layout/aspect-box.vue +71 -0
- package/dist/runtime/components/layout/card-item.vue +193 -0
- package/dist/runtime/components/layout/card.vue +42 -0
- package/dist/runtime/components/layout/container.vue +40 -0
- package/dist/runtime/components/misc/breadcrumb.vue +96 -0
- package/dist/runtime/components/misc/tabulator.vue +187 -0
- package/dist/runtime/components/misc/view-name-display-target.vue +39 -0
- package/dist/runtime/components/misc/view-name-display.vue +90 -0
- package/dist/runtime/composables/use-hs-dialog.d.ts +40 -0
- package/dist/runtime/composables/{use-hs-ui-dialog.js → use-hs-dialog.js} +15 -10
- package/dist/runtime/composables/{use-hs-form-focus.d.ts → use-hs-focus.d.ts} +1 -1
- package/dist/runtime/composables/{use-hs-form-focus.js → use-hs-focus.js} +2 -4
- package/dist/runtime/composables/use-hs-misc.d.ts +22 -0
- package/dist/runtime/composables/use-hs-misc.js +62 -0
- package/dist/runtime/composables/use-hs-modal.d.ts +31 -0
- package/dist/runtime/{components/hs-ui/modal/use-ui-modal.js → composables/use-hs-modal.js} +18 -16
- package/dist/runtime/composables/use-hs-multi-lang.d.ts +14 -6
- package/dist/runtime/composables/use-hs-multi-lang.js +44 -11
- package/dist/runtime/composables/{use-hs-ui-toast.d.ts → use-hs-toast.d.ts} +3 -3
- package/dist/runtime/composables/{use-hs-ui-toast.js → use-hs-toast.js} +4 -5
- package/dist/runtime/composables/{use-hs-ui-window-loader.d.ts → use-hs-window-loader.d.ts} +1 -1
- package/dist/runtime/composables/{use-hs-ui-window-loader.js → use-hs-window-loader.js} +1 -2
- package/dist/runtime/plugin/v-select.d.ts +2 -0
- package/dist/runtime/plugin/v-select.js +5 -0
- package/dist/runtime/style.css +22 -1
- package/dist/runtime/tailwind.css +78 -0
- package/dist/runtime/types/app.config.d.ts +5 -0
- package/dist/runtime/{components/hs-ui/dialog/index.type.d.ts → types/dialog.d.ts} +3 -3
- package/dist/runtime/{components/hs-ui/toast/index.type.d.ts → types/toast.d.ts} +1 -2
- package/dist/runtime/{components/hs-ui/toast/index.type.js → types/toast.js} +0 -1
- package/dist/runtime/utils/class-style.d.ts +6 -0
- package/dist/runtime/utils/class-style.js +27 -0
- package/dist/runtime/utils/com.d.ts +6 -0
- package/dist/runtime/{lib → utils}/com.js +1 -4
- package/dist/runtime/utils/dayjs.d.ts +53 -0
- package/dist/runtime/utils/dayjs.js +124 -0
- package/dist/runtime/utils/float.d.ts +2 -0
- package/dist/runtime/utils/float.js +35 -0
- package/dist/runtime/utils/multi-lang-object.d.ts +17 -0
- package/dist/runtime/utils/multi-lang-object.js +34 -0
- package/dist/runtime/{lib → utils}/multi-lang.d.ts +1 -1
- package/dist/runtime/{lib → utils}/multi-lang.js +31 -27
- package/dist/runtime/{lib → utils}/number.d.ts +2 -4
- package/dist/runtime/{lib → utils}/number.js +29 -69
- package/dist/runtime/utils/object.d.ts +46 -0
- package/dist/runtime/utils/object.js +107 -0
- package/dist/runtime/utils/select-item.d.ts +31 -0
- package/dist/runtime/utils/select.d.ts +14 -0
- package/dist/runtime/utils/select.js +36 -0
- package/dist/runtime/utils/string.d.ts +39 -0
- package/dist/runtime/utils/string.js +125 -0
- package/dist/runtime/utils/tabulator.d.ts +108 -0
- package/dist/runtime/utils/tabulator.js +296 -0
- package/dist/runtime/utils/theme.d.ts +21 -0
- package/dist/runtime/utils/theme.js +31 -0
- package/dist/runtime/utils/tv.d.ts +101 -0
- package/dist/runtime/utils/tv.js +26 -0
- package/dist/runtime/utils/wareki.d.ts +3 -0
- package/dist/runtime/utils/wareki.js +106 -0
- package/dist/types.d.mts +1 -17
- package/dist/types.d.ts +1 -17
- package/package.json +99 -37
- package/dist/runtime/components/hs-fc/btn/index.vue +0 -510
- package/dist/runtime/components/hs-ui/aspect-box.vue +0 -83
- package/dist/runtime/components/hs-ui/card-item.vue +0 -141
- package/dist/runtime/components/hs-ui/card.vue +0 -54
- package/dist/runtime/components/hs-ui/container.vue +0 -50
- package/dist/runtime/components/hs-ui/modal/bg.vue +0 -94
- package/dist/runtime/components/hs-ui/modal/index.vue +0 -206
- package/dist/runtime/components/hs-ui/modal/use-ui-modal.d.ts +0 -20
- package/dist/runtime/components/v-test.vue +0 -60
- package/dist/runtime/composables/use-hs-ui-dialog.d.ts +0 -22
- package/dist/runtime/lib/class-style.d.ts +0 -8
- package/dist/runtime/lib/class-style.js +0 -59
- package/dist/runtime/lib/com.d.ts +0 -14
- package/dist/runtime/lib/prefix.d.ts +0 -2
- package/dist/runtime/lib/prefix.js +0 -17
- package/dist/runtime/lib/theme.d.ts +0 -2
- package/dist/runtime/lib/theme.js +0 -21
- /package/dist/runtime/{components/hs-ui/dialog/index.type.js → types/dialog.js} +0 -0
- /package/dist/runtime/{components/hs-fc/hoge → utils/select-item.js} +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/* ----------------------------------------------------------------------------
|
|
3
|
+
// src\runtime\components\interactive\alert.vue
|
|
4
|
+
// ----------------------------------------------------------------------------
|
|
5
|
+
// Alert
|
|
6
|
+
// AlertAlert
|
|
7
|
+
----------------------------------------------------------------------------- */
|
|
8
|
+
|
|
9
|
+
// [ utils ]
|
|
10
|
+
import { tv } from "../../utils/tv";
|
|
11
|
+
import type { Theme } from "../../utils/theme";
|
|
12
|
+
const alertTv = tv({
|
|
13
|
+
slots: {
|
|
14
|
+
base: [
|
|
15
|
+
//
|
|
16
|
+
`p-2`,
|
|
17
|
+
"bg-white border-2 border-[var(--main-color)] text-[color-mix(in_srgb,_var(--main-color)_,_#000_30%)]",
|
|
18
|
+
"rounded-xl overflow-hidden",
|
|
19
|
+
],
|
|
20
|
+
bg: "absolute inset-0 bg-[var(--main-color)] opacity-10",
|
|
21
|
+
inner: "",
|
|
22
|
+
},
|
|
23
|
+
variants: {
|
|
24
|
+
variant: {
|
|
25
|
+
header: {
|
|
26
|
+
base: [`flex justify-between items-center`],
|
|
27
|
+
},
|
|
28
|
+
body: {
|
|
29
|
+
base: [``],
|
|
30
|
+
},
|
|
31
|
+
footer: {
|
|
32
|
+
base: [`flex justify-between items-center`],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
scroll: {
|
|
36
|
+
true: {
|
|
37
|
+
base: "overflow-y-auto overflow-x-hidden flex-1",
|
|
38
|
+
},
|
|
39
|
+
false: {
|
|
40
|
+
base: "flex-y-none",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
</script>
|
|
46
|
+
<script setup lang="ts">
|
|
47
|
+
/* ----------------------------------------------------------------------------
|
|
48
|
+
// src\runtime\components\interactive\alert.vue
|
|
49
|
+
// ----------------------------------------------------------------------------
|
|
50
|
+
// Alert
|
|
51
|
+
// AlertAlert
|
|
52
|
+
----------------------------------------------------------------------------- */
|
|
53
|
+
|
|
54
|
+
// ----------------------------------------------------------------------------
|
|
55
|
+
// [ NUXT ]
|
|
56
|
+
import { computed } from "#imports";
|
|
57
|
+
// [ utils ]
|
|
58
|
+
import { type ClassType, ClassTypeToString } from "../../utils/class-style";
|
|
59
|
+
import { GetGolorCode } from "../../utils/theme";
|
|
60
|
+
|
|
61
|
+
// ----------------------------------------------------------------------------
|
|
62
|
+
|
|
63
|
+
interface Props {
|
|
64
|
+
class?: ClassType;
|
|
65
|
+
classBg?: ClassType;
|
|
66
|
+
classInner?: ClassType;
|
|
67
|
+
theme?: Theme;
|
|
68
|
+
}
|
|
69
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
70
|
+
class: "",
|
|
71
|
+
classBg: "",
|
|
72
|
+
classInner: "",
|
|
73
|
+
theme: "info",
|
|
74
|
+
});
|
|
75
|
+
// ----------------------------------------------------------------------------
|
|
76
|
+
|
|
77
|
+
const styleMain = computed(() => {
|
|
78
|
+
return [
|
|
79
|
+
//
|
|
80
|
+
`--main-color:${GetGolorCode(props.theme)};`,
|
|
81
|
+
];
|
|
82
|
+
});
|
|
83
|
+
const classTv = computed(() => {
|
|
84
|
+
return alertTv({});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const classTvBase = computed(() => {
|
|
88
|
+
return classTv.value.base({
|
|
89
|
+
class: ClassTypeToString(props.class),
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const classTvBg = computed(() => {
|
|
94
|
+
return classTv.value.bg({
|
|
95
|
+
class: ClassTypeToString(props.classBg),
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const classTvInner = computed(() => {
|
|
100
|
+
return classTv.value.inner({
|
|
101
|
+
class: ClassTypeToString(props.classInner),
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<template>
|
|
107
|
+
<div :class="classTvBase" :style="styleMain">
|
|
108
|
+
<div :class="classTvBg"></div>
|
|
109
|
+
<div :class="classTvInner">
|
|
110
|
+
<slot />
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</template>
|
|
@@ -1,90 +1,72 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
/* ----------------------------------------------------------------------------
|
|
3
|
-
src\runtime\components\
|
|
3
|
+
// src\runtime\components\interactive\block-loading.vue
|
|
4
4
|
// ----------------------------------------------------------------------------
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
// BlockLoading
|
|
6
|
+
// BlockLoadingBlockLoading
|
|
7
7
|
----------------------------------------------------------------------------- */
|
|
8
8
|
|
|
9
|
-
// [ vue ]
|
|
10
|
-
import { computed } from 'vue';
|
|
11
9
|
// [ NUXT ]
|
|
12
|
-
import {
|
|
10
|
+
import { computed } from "#imports";
|
|
13
11
|
// [ tailwind ]
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
import {
|
|
12
|
+
import { twMerge } from "tailwind-merge";
|
|
13
|
+
// [ utils ]
|
|
14
|
+
import { type ClassType, ClassTypeToString } from "../../utils/class-style";
|
|
17
15
|
// ----------------------------------------------------------------------------
|
|
18
|
-
const runtimeConfig: any = useRuntimeConfig();
|
|
19
|
-
const prefix = GetPrefix(runtimeConfig);
|
|
20
|
-
// ----------------------------------------------------------------------------
|
|
21
|
-
const twMerge = extendTailwindMerge({
|
|
22
|
-
prefix: prefix,
|
|
23
|
-
});
|
|
24
16
|
// ----------------------------------------------------------------------------
|
|
25
17
|
type Props = {
|
|
26
|
-
class?: ClassType
|
|
18
|
+
class?: ClassType;
|
|
27
19
|
show: boolean;
|
|
28
20
|
message?: string;
|
|
29
21
|
};
|
|
30
22
|
const props = withDefaults(defineProps<Props>(), {
|
|
31
|
-
class:
|
|
23
|
+
class: "",
|
|
32
24
|
show: false,
|
|
33
|
-
message:
|
|
25
|
+
message: "Loading",
|
|
34
26
|
});
|
|
35
|
-
const baseClass =
|
|
27
|
+
const baseClass = [
|
|
28
|
+
//
|
|
36
29
|
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
'tw-overflow-hidden',
|
|
53
|
-
'bg-[#13175C]/[0.5]',
|
|
54
|
-
'tw-bg-[#43536E]/[0.5]',
|
|
55
|
-
'flex',
|
|
56
|
-
'tw-flex',
|
|
57
|
-
'items-center',
|
|
58
|
-
'tw-items-center',
|
|
59
|
-
'justify-center',
|
|
60
|
-
'tw-justify-center',
|
|
61
|
-
'transition-opacity',
|
|
62
|
-
'tw-transition-opacity',
|
|
63
|
-
]);
|
|
30
|
+
"z-100",
|
|
31
|
+
"px-2",
|
|
32
|
+
"pt-2",
|
|
33
|
+
"pb-1",
|
|
34
|
+
"absolute",
|
|
35
|
+
"inset-0",
|
|
36
|
+
"h-full",
|
|
37
|
+
"w-full",
|
|
38
|
+
"overflow-hidden",
|
|
39
|
+
"bg-[#13175C]/[0.5]",
|
|
40
|
+
"flex",
|
|
41
|
+
"items-center",
|
|
42
|
+
"justify-center",
|
|
43
|
+
"transition-opacity",
|
|
44
|
+
];
|
|
64
45
|
|
|
65
46
|
const variableStyle = computed(() => {
|
|
66
47
|
if (props.show) {
|
|
67
|
-
return
|
|
48
|
+
return [
|
|
68
49
|
//
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
'tw-opacity-100',
|
|
73
|
-
]);
|
|
50
|
+
"pointer-events-auto",
|
|
51
|
+
"opacity-100",
|
|
52
|
+
];
|
|
74
53
|
}
|
|
75
|
-
return
|
|
54
|
+
return [
|
|
76
55
|
//
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
'tw-opacity-0',
|
|
81
|
-
]);
|
|
56
|
+
"pointer-events-none",
|
|
57
|
+
"opacity-0",
|
|
58
|
+
];
|
|
82
59
|
});
|
|
83
60
|
|
|
84
61
|
const classStyle = computed(() => {
|
|
85
|
-
return twMerge(
|
|
62
|
+
return twMerge(
|
|
63
|
+
baseClass,
|
|
64
|
+
variableStyle.value,
|
|
65
|
+
ClassTypeToString(props.class)
|
|
66
|
+
);
|
|
86
67
|
});
|
|
87
68
|
</script>
|
|
69
|
+
|
|
88
70
|
<template>
|
|
89
71
|
<div class="HsUiBlockLoading" :class="[classStyle]">
|
|
90
72
|
<div class="loading-container">
|
|
@@ -97,6 +79,7 @@ const classStyle = computed(() => {
|
|
|
97
79
|
</div>
|
|
98
80
|
</div>
|
|
99
81
|
</template>
|
|
82
|
+
|
|
100
83
|
<style scoped>
|
|
101
84
|
.loading-container {
|
|
102
85
|
width: 50%;
|
|
@@ -1,40 +1,42 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
/* ----------------------------------------------------------------------------
|
|
3
|
-
src\runtime\components\
|
|
3
|
+
// src\runtime\components\interactive\dialog.vue
|
|
4
4
|
// ----------------------------------------------------------------------------
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
// Dialog
|
|
6
|
+
// DialogDialog
|
|
7
7
|
----------------------------------------------------------------------------- */
|
|
8
8
|
|
|
9
|
-
// [ vue ]
|
|
10
|
-
import { computed, watch, ref, nextTick } from 'vue';
|
|
11
|
-
// [ NUXT ]
|
|
12
|
-
import { useRuntimeConfig } from '#imports';
|
|
13
|
-
// ----------------------------------------------------------------------------
|
|
14
9
|
// [ tailwind ]
|
|
15
|
-
// import {
|
|
16
|
-
// import { type ClassType, ClassTypeToString } from '../../../lib/class-style';
|
|
17
|
-
import { GetPrefix, RemovePrefix } from '../../../lib/prefix';
|
|
10
|
+
// import { twMerge } from 'tailwind-merge';
|
|
18
11
|
|
|
19
12
|
// ----------------------------------------------------------------------------
|
|
20
|
-
|
|
21
|
-
import {
|
|
13
|
+
|
|
14
|
+
// import { type ClassType, ClassTypeToString } from '~/components/lib/class-style';
|
|
15
|
+
// import { TailwindPrefix } from '~/components/hs/setting';
|
|
22
16
|
// ----------------------------------------------------------------------------
|
|
23
|
-
|
|
24
|
-
import {
|
|
17
|
+
|
|
18
|
+
import { disableBodyScroll, enableBodyScroll } from "body-scroll-lock";
|
|
19
|
+
// [ NUXT ]
|
|
20
|
+
import { computed, ref, watch, nextTick } from "#imports";
|
|
21
|
+
// [ types ]
|
|
22
|
+
import { DialogDefaultZIndex } from "../../types/dialog";
|
|
23
|
+
// [ composables ]
|
|
24
|
+
import { useHsDialog } from "../../composables/use-hs-dialog";
|
|
25
|
+
import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
|
|
26
|
+
// [ Components ]
|
|
27
|
+
import Modal from "./modal.vue";
|
|
28
|
+
import Card from "../layout/card.vue";
|
|
29
|
+
import CardItem from "../layout/card-item.vue";
|
|
30
|
+
import Btn from "../form/btn.vue";
|
|
25
31
|
// ----------------------------------------------------------------------------
|
|
26
|
-
|
|
27
|
-
const prefix = GetPrefix(runtimeConfig);
|
|
28
|
-
// const twMerge = extendTailwindMerge({
|
|
29
|
-
// prefix: prefix,
|
|
30
|
-
// });
|
|
32
|
+
|
|
31
33
|
// ----------------------------------------------------------------------------
|
|
32
34
|
// [ nac-Stroe ]
|
|
33
|
-
const toast =
|
|
35
|
+
const toast = useHsDialog();
|
|
34
36
|
const state = toast.state;
|
|
35
37
|
// ----------------------------------------------------------------------------
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
+
const multiLang = useHsMultiLang();
|
|
39
|
+
const tx = multiLang.tx;
|
|
38
40
|
// ----------------------------------------------------------------------------
|
|
39
41
|
const cancelBtnElm = ref<HTMLElement | null>(null);
|
|
40
42
|
const leftBtnElm = ref<HTMLElement | null>(null);
|
|
@@ -88,11 +90,20 @@ watch(activateTs, async (ts) => {
|
|
|
88
90
|
}
|
|
89
91
|
if (activeItem.value === null) return;
|
|
90
92
|
if (isShow.value === true) {
|
|
91
|
-
if (
|
|
93
|
+
if (
|
|
94
|
+
activeItem.value.data.option.defaultBtn === "right" &&
|
|
95
|
+
rightBtnElm.value !== null
|
|
96
|
+
) {
|
|
92
97
|
rightBtnElm.value.focus();
|
|
93
|
-
} else if (
|
|
98
|
+
} else if (
|
|
99
|
+
activeItem.value.data.option.defaultBtn === "left" &&
|
|
100
|
+
leftBtnElm.value !== null
|
|
101
|
+
) {
|
|
94
102
|
leftBtnElm.value.focus();
|
|
95
|
-
} else if (
|
|
103
|
+
} else if (
|
|
104
|
+
activeItem.value.data.option.defaultBtn === "cancel" &&
|
|
105
|
+
cancelBtnElm.value !== null
|
|
106
|
+
) {
|
|
96
107
|
cancelBtnElm.value.focus();
|
|
97
108
|
}
|
|
98
109
|
}
|
|
@@ -100,18 +111,24 @@ watch(activateTs, async (ts) => {
|
|
|
100
111
|
|
|
101
112
|
const keyMoveFlag = ref(false);
|
|
102
113
|
const onKeyDownNoBtn = (e: KeyboardEvent) => {
|
|
103
|
-
if (activeItem.value === null) return
|
|
104
|
-
if (e.key ===
|
|
105
|
-
if (
|
|
114
|
+
if (activeItem.value === null) return "";
|
|
115
|
+
if (e.key === "Tab") return;
|
|
116
|
+
if (
|
|
117
|
+
activeItem.value.data.option.btnRight.isShow === true &&
|
|
118
|
+
rightBtnElm.value !== null
|
|
119
|
+
) {
|
|
106
120
|
keyMoveFlag.value = true;
|
|
107
121
|
rightBtnElm.value.focus();
|
|
108
122
|
}
|
|
109
123
|
};
|
|
110
124
|
|
|
111
125
|
const onKeyDownYesBtn = (e: KeyboardEvent) => {
|
|
112
|
-
if (activeItem.value === null) return
|
|
113
|
-
if (e.key ===
|
|
114
|
-
if (
|
|
126
|
+
if (activeItem.value === null) return "";
|
|
127
|
+
if (e.key === "Tab") return;
|
|
128
|
+
if (
|
|
129
|
+
activeItem.value.data.option.btnLeft.isShow === true &&
|
|
130
|
+
leftBtnElm.value !== null
|
|
131
|
+
) {
|
|
115
132
|
keyMoveFlag.value = true;
|
|
116
133
|
leftBtnElm.value.focus();
|
|
117
134
|
}
|
|
@@ -144,101 +161,88 @@ watch(isShow, (v) => {
|
|
|
144
161
|
}
|
|
145
162
|
});
|
|
146
163
|
|
|
147
|
-
const cancelBtnStyle =
|
|
164
|
+
const cancelBtnStyle = [
|
|
148
165
|
//
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
'!tw-bg-transparent',
|
|
157
|
-
'rounded-none',
|
|
158
|
-
'tw-rounded-none',
|
|
159
|
-
'h-full',
|
|
160
|
-
'tw-h-full',
|
|
161
|
-
]);
|
|
166
|
+
"px-2",
|
|
167
|
+
"py-1",
|
|
168
|
+
"border-[1px]",
|
|
169
|
+
"!bg-transparent",
|
|
170
|
+
"rounded-none",
|
|
171
|
+
"h-full",
|
|
172
|
+
];
|
|
162
173
|
|
|
163
|
-
const cancelBtnStyleInner =
|
|
164
|
-
//
|
|
165
|
-
'flex',
|
|
166
|
-
'tw-flex',
|
|
167
|
-
'items-center',
|
|
168
|
-
'tw-items-center',
|
|
169
|
-
]);
|
|
170
|
-
const btnBaseStyle = RemovePrefix(prefix, [
|
|
174
|
+
const cancelBtnStyleInner = [
|
|
171
175
|
//
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
'gap-2',
|
|
177
|
-
'tw-gap-2',
|
|
178
|
-
]);
|
|
179
|
-
const btnStyle = RemovePrefix(prefix, [
|
|
176
|
+
"flex",
|
|
177
|
+
"items-center",
|
|
178
|
+
];
|
|
179
|
+
const btnBaseStyle = [
|
|
180
180
|
//
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
const titleStyle = RemovePrefix(prefix, [
|
|
181
|
+
"grid",
|
|
182
|
+
"grid-cols-2",
|
|
183
|
+
"gap-2",
|
|
184
|
+
];
|
|
185
|
+
const btnStyle = [
|
|
187
186
|
//
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
'whitespace-pre-line',
|
|
193
|
-
'tw-whitespace-pre-line',
|
|
194
|
-
'text-wrap',
|
|
195
|
-
'tw-text-wrap',
|
|
196
|
-
]);
|
|
197
|
-
const messageStyle = RemovePrefix(prefix, [
|
|
187
|
+
"py-1",
|
|
188
|
+
"w-full",
|
|
189
|
+
];
|
|
190
|
+
const titleStyle = [
|
|
198
191
|
//
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
'text-wrap',
|
|
206
|
-
'tw-text-wrap',
|
|
192
|
+
"text-[14px]",
|
|
193
|
+
"sm:text-[18px]",
|
|
194
|
+
"whitespace-pre-line",
|
|
195
|
+
"text-wrap",
|
|
196
|
+
];
|
|
197
|
+
const messageStyle = [
|
|
207
198
|
//
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
199
|
+
"text-[14px]",
|
|
200
|
+
"sm:text-[18px]",
|
|
201
|
+
"whitespace-pre-line",
|
|
202
|
+
"text-wrap",
|
|
203
|
+
"pb-2",
|
|
204
|
+
];
|
|
205
|
+
const cardStyle = [
|
|
212
206
|
//
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
'tw-mb-auto',
|
|
219
|
-
]);
|
|
220
|
-
const closeBtnIcon = RemovePrefix(prefix, [
|
|
207
|
+
"min-w-[300px]",
|
|
208
|
+
"mt-auto",
|
|
209
|
+
"mb-auto",
|
|
210
|
+
];
|
|
211
|
+
const closeBtnIcon = [
|
|
221
212
|
//
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
const baseCardHeader = RemovePrefix(prefix, [
|
|
213
|
+
"mx-1",
|
|
214
|
+
];
|
|
215
|
+
const baseCardHeader = [
|
|
226
216
|
//
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
'tw-pe-1',
|
|
231
|
-
]);
|
|
217
|
+
"py-1",
|
|
218
|
+
"pe-1",
|
|
219
|
+
];
|
|
232
220
|
</script>
|
|
221
|
+
|
|
233
222
|
<template>
|
|
234
223
|
<ClientOnly>
|
|
235
|
-
<
|
|
236
|
-
|
|
237
|
-
|
|
224
|
+
<Modal
|
|
225
|
+
ref="targetElm"
|
|
226
|
+
:show="isShow"
|
|
227
|
+
:z-index="zindex"
|
|
228
|
+
focus-lock
|
|
229
|
+
:closeable="activeItem?.data.option.btnCancel.isShow || false"
|
|
230
|
+
@close="clickCancel()"
|
|
231
|
+
>
|
|
232
|
+
<Card
|
|
233
|
+
v-if="activeItem !== null"
|
|
234
|
+
class="HsUiDialog"
|
|
235
|
+
:class="cardStyle"
|
|
236
|
+
@click.stop
|
|
237
|
+
>
|
|
238
|
+
<CardItem
|
|
239
|
+
:class="[`theme-${activeItem.data.option.theme}`, baseCardHeader]"
|
|
240
|
+
variant="header"
|
|
241
|
+
>
|
|
238
242
|
<div :class="titleStyle">
|
|
239
|
-
{{
|
|
243
|
+
{{ tx(activeItem.data.title) }}
|
|
240
244
|
</div>
|
|
241
|
-
<
|
|
245
|
+
<Btn
|
|
242
246
|
v-if="activeItem.data.option.btnCancel.isShow"
|
|
243
247
|
:class="cancelBtnStyle"
|
|
244
248
|
:class-inner="cancelBtnStyleInner"
|
|
@@ -248,16 +252,16 @@ const baseCardHeader = RemovePrefix(prefix, [
|
|
|
248
252
|
@ref="(e:any) => (cancelBtnElm = e)"
|
|
249
253
|
>
|
|
250
254
|
<i class="fas fa-times" :class="closeBtnIcon" />
|
|
251
|
-
{{
|
|
252
|
-
</
|
|
253
|
-
</
|
|
254
|
-
<
|
|
255
|
+
{{ tx(activeItem.data.option.btnCancel.title) }}
|
|
256
|
+
</Btn>
|
|
257
|
+
</CardItem>
|
|
258
|
+
<CardItem variant="body">
|
|
255
259
|
<div :class="messageStyle">
|
|
256
|
-
{{
|
|
260
|
+
{{ tx(activeItem.data.message) }}
|
|
257
261
|
</div>
|
|
258
262
|
<div :class="btnBaseStyle">
|
|
259
263
|
<div>
|
|
260
|
-
<
|
|
264
|
+
<Btn
|
|
261
265
|
v-if="activeItem.data.option.btnLeft.isShow"
|
|
262
266
|
:class="btnStyle"
|
|
263
267
|
variant="flat"
|
|
@@ -266,11 +270,11 @@ const baseCardHeader = RemovePrefix(prefix, [
|
|
|
266
270
|
@ref="(e:any) => (leftBtnElm = e)"
|
|
267
271
|
@keydown="onKeyDownNoBtn"
|
|
268
272
|
>
|
|
269
|
-
{{
|
|
270
|
-
</
|
|
273
|
+
{{ tx(activeItem.data.option.btnLeft.title) }}
|
|
274
|
+
</Btn>
|
|
271
275
|
</div>
|
|
272
276
|
<div>
|
|
273
|
-
<
|
|
277
|
+
<Btn
|
|
274
278
|
v-if="activeItem.data.option.btnRight.isShow"
|
|
275
279
|
:class="btnStyle"
|
|
276
280
|
variant="flat"
|
|
@@ -279,15 +283,16 @@ const baseCardHeader = RemovePrefix(prefix, [
|
|
|
279
283
|
@ref="(e:any) => (rightBtnElm = e)"
|
|
280
284
|
@keydown="onKeyDownYesBtn"
|
|
281
285
|
>
|
|
282
|
-
{{
|
|
283
|
-
</
|
|
286
|
+
{{ tx(activeItem.data.option.btnRight.title) }}
|
|
287
|
+
</Btn>
|
|
284
288
|
</div>
|
|
285
289
|
</div>
|
|
286
|
-
</
|
|
287
|
-
</
|
|
288
|
-
</
|
|
290
|
+
</CardItem>
|
|
291
|
+
</Card>
|
|
292
|
+
</Modal>
|
|
289
293
|
</ClientOnly>
|
|
290
294
|
</template>
|
|
295
|
+
|
|
291
296
|
<style scoped>
|
|
292
297
|
.theme-main0 {
|
|
293
298
|
background-color: theme("colors.main0");
|
|
@@ -353,7 +358,7 @@ const baseCardHeader = RemovePrefix(prefix, [
|
|
|
353
358
|
background-color: theme("colors.white");
|
|
354
359
|
color: theme("colors.main1");
|
|
355
360
|
}
|
|
356
|
-
.theme-white .
|
|
361
|
+
.theme-white .Btn--border {
|
|
357
362
|
border-color: theme("colors.gray.600");
|
|
358
363
|
}
|
|
359
364
|
|