nuxt-hs-ui 1.0.1
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 +4 -0
- package/dist/module.cjs +5 -0
- package/dist/module.d.mts +8 -0
- package/dist/module.d.ts +8 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +92 -0
- package/dist/runtime/components/hs-fc/btn/index.vue +508 -0
- package/dist/runtime/components/hs-fc/btn/line-loading.vue +125 -0
- package/dist/runtime/components/hs-fc/hoge +0 -0
- package/dist/runtime/components/hs-ui/accordion.vue +93 -0
- package/dist/runtime/components/hs-ui/aspect-box.vue +78 -0
- package/dist/runtime/components/hs-ui/block-loading.vue +210 -0
- package/dist/runtime/components/hs-ui/card-item.vue +136 -0
- package/dist/runtime/components/hs-ui/card.vue +48 -0
- package/dist/runtime/components/hs-ui/container.vue +46 -0
- package/dist/runtime/components/hs-ui/dialog/index.type.d.ts +48 -0
- package/dist/runtime/components/hs-ui/dialog/index.type.js +57 -0
- package/dist/runtime/components/hs-ui/dialog/index.vue +353 -0
- package/dist/runtime/components/hs-ui/modal/bg.vue +90 -0
- package/dist/runtime/components/hs-ui/modal/index.vue +203 -0
- package/dist/runtime/components/hs-ui/modal/use-ui-modal.d.ts +20 -0
- package/dist/runtime/components/hs-ui/modal/use-ui-modal.js +74 -0
- package/dist/runtime/components/hs-ui/toast/index.type.d.ts +24 -0
- package/dist/runtime/components/hs-ui/toast/index.type.js +7 -0
- package/dist/runtime/components/hs-ui/toast/index.vue +355 -0
- package/dist/runtime/components/hs-ui/window-loader.vue +185 -0
- package/dist/runtime/components/v-test.vue +57 -0
- package/dist/runtime/composables/use-hs-form-focus.d.ts +10 -0
- package/dist/runtime/composables/use-hs-form-focus.js +29 -0
- package/dist/runtime/composables/use-hs-multi-lang.d.ts +9 -0
- package/dist/runtime/composables/use-hs-multi-lang.js +21 -0
- package/dist/runtime/composables/use-hs-ui-dialog.d.ts +22 -0
- package/dist/runtime/composables/use-hs-ui-dialog.js +43 -0
- package/dist/runtime/composables/use-hs-ui-toast.d.ts +20 -0
- package/dist/runtime/composables/use-hs-ui-toast.js +55 -0
- package/dist/runtime/composables/use-hs-ui-window-loader.d.ts +11 -0
- package/dist/runtime/composables/use-hs-ui-window-loader.js +21 -0
- package/dist/runtime/lib/class-style.d.ts +8 -0
- package/dist/runtime/lib/class-style.js +59 -0
- package/dist/runtime/lib/com.d.ts +14 -0
- package/dist/runtime/lib/com.js +25 -0
- package/dist/runtime/lib/multi-lang.d.ts +9 -0
- package/dist/runtime/lib/multi-lang.js +75 -0
- package/dist/runtime/lib/number.d.ts +16 -0
- package/dist/runtime/lib/number.js +101 -0
- package/dist/runtime/lib/prefix.d.ts +2 -0
- package/dist/runtime/lib/prefix.js +19 -0
- package/dist/runtime/lib/theme.d.ts +2 -0
- package/dist/runtime/lib/theme.js +21 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/style.css +1 -0
- package/dist/types.d.mts +17 -0
- package/dist/types.d.ts +17 -0
- package/package.json +82 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/* ----------------------------------------------------------------------------
|
|
3
|
+
src\runtime\components\hs-ui\modal\index.vue
|
|
4
|
+
// ----------------------------------------------------------------------------
|
|
5
|
+
HsUiModal
|
|
6
|
+
HsUiModalHsUiModal
|
|
7
|
+
----------------------------------------------------------------------------- */
|
|
8
|
+
|
|
9
|
+
// [ vue ]
|
|
10
|
+
import { computed, ref, watch, nextTick, onUnmounted } from 'vue';
|
|
11
|
+
import { useId } from '#imports';
|
|
12
|
+
// [ tailwind ]
|
|
13
|
+
import { extendTailwindMerge } from 'tailwind-merge';
|
|
14
|
+
import { type ClassType, ClassTypeToString } from '../../../lib/class-style';
|
|
15
|
+
import { GetPrefix, RemovePrefix } from '../../../lib/prefix';
|
|
16
|
+
|
|
17
|
+
// [ vueuse ]
|
|
18
|
+
import { useFocusTrap } from '@vueuse/integrations/useFocusTrap';
|
|
19
|
+
// [ components > v-ui > modal > * ]
|
|
20
|
+
import { useStoreModal } from './use-ui-modal';
|
|
21
|
+
|
|
22
|
+
// ----------------------------------------------------------------------------
|
|
23
|
+
const twMerge = extendTailwindMerge({
|
|
24
|
+
prefix: GetPrefix(),
|
|
25
|
+
});
|
|
26
|
+
// ----------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
interface Props {
|
|
29
|
+
class?: ClassType | undefined;
|
|
30
|
+
classInner?: ClassType | undefined;
|
|
31
|
+
show: boolean;
|
|
32
|
+
mounted?: boolean;
|
|
33
|
+
zIndex?: number | undefined;
|
|
34
|
+
focusLock?: boolean;
|
|
35
|
+
}
|
|
36
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
37
|
+
class: '',
|
|
38
|
+
classInner: '',
|
|
39
|
+
show: false,
|
|
40
|
+
mounted: true,
|
|
41
|
+
zIndex: undefined,
|
|
42
|
+
focusLock: false,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
type Emits = {
|
|
46
|
+
close: [];
|
|
47
|
+
};
|
|
48
|
+
const emit = defineEmits<Emits>();
|
|
49
|
+
|
|
50
|
+
// ----------------------------------------------------------------------------
|
|
51
|
+
const vUiModal = useStoreModal();
|
|
52
|
+
vUiModal.watch();
|
|
53
|
+
const id = useId();
|
|
54
|
+
const active = computed(() => {
|
|
55
|
+
return vUiModal.activeId === id;
|
|
56
|
+
});
|
|
57
|
+
// ----------------------------------------------------------------------------
|
|
58
|
+
// [ focusTrap ]
|
|
59
|
+
const focusTargetElm = ref<HTMLElement | null>(null);
|
|
60
|
+
const { activate, deactivate } = useFocusTrap(focusTargetElm);
|
|
61
|
+
watch(
|
|
62
|
+
() => [props.show, active.value],
|
|
63
|
+
async () => {
|
|
64
|
+
await nextTick();
|
|
65
|
+
if (!props.focusLock || !active.value || !props.show) {
|
|
66
|
+
deactivate();
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
activate();
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
// ----------------------------------------------------------------------------
|
|
74
|
+
const zOrder = computed(() => {
|
|
75
|
+
if (props.zIndex !== undefined) return props.zIndex;
|
|
76
|
+
return vUiModal.myzIndex(id).value;
|
|
77
|
+
});
|
|
78
|
+
if (props.show) {
|
|
79
|
+
vUiModal.add(id);
|
|
80
|
+
}
|
|
81
|
+
watch(
|
|
82
|
+
() => props.show,
|
|
83
|
+
(v) => {
|
|
84
|
+
if (v) {
|
|
85
|
+
vUiModal.add(id);
|
|
86
|
+
} else {
|
|
87
|
+
vUiModal.remove(id);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
onUnmounted(() => {
|
|
92
|
+
vUiModal.remove(id);
|
|
93
|
+
});
|
|
94
|
+
const mounted = computed(() => {
|
|
95
|
+
if (props.show) return true;
|
|
96
|
+
if (props.mounted) return true;
|
|
97
|
+
return false;
|
|
98
|
+
});
|
|
99
|
+
// 背景色は[VUiModalBg]が担当します
|
|
100
|
+
const baseClass = RemovePrefix([
|
|
101
|
+
//
|
|
102
|
+
'p-2',
|
|
103
|
+
'tw-p-2',
|
|
104
|
+
'transition-opacity',
|
|
105
|
+
'tw-transition-opacity',
|
|
106
|
+
'fixed',
|
|
107
|
+
'tw-fixed',
|
|
108
|
+
'inset-0',
|
|
109
|
+
'tw-inset-0',
|
|
110
|
+
'flex',
|
|
111
|
+
'tw-flex',
|
|
112
|
+
'justify-center',
|
|
113
|
+
'tw-justify-center',
|
|
114
|
+
'pointer-events-none',
|
|
115
|
+
'tw-pointer-events-none',
|
|
116
|
+
]);
|
|
117
|
+
|
|
118
|
+
const classStyle = computed(() => {
|
|
119
|
+
return twMerge(baseClass, ClassTypeToString(props.class));
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const innerClass = RemovePrefix([
|
|
123
|
+
//
|
|
124
|
+
'w-full',
|
|
125
|
+
'tw-w-full',
|
|
126
|
+
'h-full',
|
|
127
|
+
'tw-h-full',
|
|
128
|
+
'p-0',
|
|
129
|
+
'tw-p-0',
|
|
130
|
+
'flex',
|
|
131
|
+
'tw-flex',
|
|
132
|
+
'flex-col',
|
|
133
|
+
'tw-flex-col',
|
|
134
|
+
'items-center',
|
|
135
|
+
'tw-items-center',
|
|
136
|
+
'overflow-auto',
|
|
137
|
+
'tw-overflow-auto',
|
|
138
|
+
'transition-opacity',
|
|
139
|
+
'tw-transition-opacity',
|
|
140
|
+
'aaaaaa',
|
|
141
|
+
'tw-aaaaaa',
|
|
142
|
+
'aaaaaa',
|
|
143
|
+
'tw-aaaaaa',
|
|
144
|
+
]);
|
|
145
|
+
const variableStyle = computed(() => {
|
|
146
|
+
if (props.show) {
|
|
147
|
+
return RemovePrefix([
|
|
148
|
+
//
|
|
149
|
+
'pointer-events-auto',
|
|
150
|
+
'tw-pointer-events-auto',
|
|
151
|
+
]);
|
|
152
|
+
}
|
|
153
|
+
return RemovePrefix([
|
|
154
|
+
//
|
|
155
|
+
'pointer-events-none',
|
|
156
|
+
'tw-pointer-events-none',
|
|
157
|
+
]);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
const classInner = computed(() => {
|
|
161
|
+
return twMerge(innerClass, variableStyle.value, ClassTypeToString(props.classInner));
|
|
162
|
+
});
|
|
163
|
+
const closeOnBackEvent = () => {
|
|
164
|
+
emit('close');
|
|
165
|
+
};
|
|
166
|
+
</script>
|
|
167
|
+
<template>
|
|
168
|
+
<div class="HsUiModal-Parent">
|
|
169
|
+
<ClientOnly>
|
|
170
|
+
<Teleport to="body">
|
|
171
|
+
<div
|
|
172
|
+
v-if="mounted"
|
|
173
|
+
:id="id"
|
|
174
|
+
class="HsUiModal"
|
|
175
|
+
data-show=""
|
|
176
|
+
:class="classStyle"
|
|
177
|
+
:style="{ zIndex: zOrder, opacity: props.show ? 1 : 0 }"
|
|
178
|
+
:aria-hidden="!props.show"
|
|
179
|
+
>
|
|
180
|
+
<div ref="focusTargetElm" :class="classInner" @click="closeOnBackEvent">
|
|
181
|
+
<slot />
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
</Teleport>
|
|
185
|
+
</ClientOnly>
|
|
186
|
+
</div>
|
|
187
|
+
</template>
|
|
188
|
+
|
|
189
|
+
<style>
|
|
190
|
+
.HsUiModal > * {
|
|
191
|
+
pointer-events: none;
|
|
192
|
+
}
|
|
193
|
+
.HsUiModal[aria-hidden=false] > * {
|
|
194
|
+
pointer-events: all;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.HsUiModal-Parent {
|
|
198
|
+
opacity: 0;
|
|
199
|
+
position: absolute;
|
|
200
|
+
width: 0;
|
|
201
|
+
height: 0;
|
|
202
|
+
}
|
|
203
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface State {
|
|
2
|
+
state: {
|
|
3
|
+
init: boolean;
|
|
4
|
+
baseIndex: number;
|
|
5
|
+
activeList: {
|
|
6
|
+
id: string;
|
|
7
|
+
zIndex: number;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare const useStoreModal: import("pinia").StoreDefinition<"HsUiStoreModal", State, {
|
|
12
|
+
activeId: (state: State & import("pinia").PiniaCustomStateProperties<State>) => string | null;
|
|
13
|
+
}, {
|
|
14
|
+
watch(): void;
|
|
15
|
+
myzIndex(id: string): import("vue").ComputedRef<number>;
|
|
16
|
+
add(id: string): number;
|
|
17
|
+
remove(id: string): void;
|
|
18
|
+
removeAll(): void;
|
|
19
|
+
}>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { computed, watch } from "vue";
|
|
2
|
+
import { useRoute } from "#imports";
|
|
3
|
+
import { defineStore } from "pinia";
|
|
4
|
+
import { clearAllBodyScrollLocks } from "body-scroll-lock";
|
|
5
|
+
export const useStoreModal = defineStore({
|
|
6
|
+
id: "HsUiStoreModal",
|
|
7
|
+
state: () => {
|
|
8
|
+
return {
|
|
9
|
+
state: {
|
|
10
|
+
init: false,
|
|
11
|
+
baseIndex: 5e3,
|
|
12
|
+
activeList: []
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
getters: {
|
|
17
|
+
activeId: (state) => {
|
|
18
|
+
const activeList = state.state.activeList;
|
|
19
|
+
if (activeList.length === 0)
|
|
20
|
+
return null;
|
|
21
|
+
const zIndex = Math.max(...activeList.map((row) => row.zIndex));
|
|
22
|
+
const data = activeList.find((row) => row.zIndex === zIndex);
|
|
23
|
+
if (!data)
|
|
24
|
+
return null;
|
|
25
|
+
return data.id;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
actions: {
|
|
29
|
+
watch() {
|
|
30
|
+
const state = this.state;
|
|
31
|
+
if (import.meta.server)
|
|
32
|
+
return;
|
|
33
|
+
if (state.init)
|
|
34
|
+
return;
|
|
35
|
+
state.init = true;
|
|
36
|
+
const route = useRoute();
|
|
37
|
+
watch(
|
|
38
|
+
() => route.path,
|
|
39
|
+
() => {
|
|
40
|
+
state.activeList = [];
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
myzIndex(id) {
|
|
45
|
+
const state = this.state;
|
|
46
|
+
return computed(() => {
|
|
47
|
+
const target = state.activeList.find((row) => row.id === id);
|
|
48
|
+
if (!target) {
|
|
49
|
+
return state.baseIndex;
|
|
50
|
+
}
|
|
51
|
+
return target.zIndex;
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
add(id) {
|
|
55
|
+
const zIndex = this.state.activeList.length === 0 ? this.state.baseIndex : Math.max(...this.state.activeList.map((row) => row.zIndex)) + 2;
|
|
56
|
+
this.state.activeList.push({
|
|
57
|
+
id,
|
|
58
|
+
zIndex
|
|
59
|
+
});
|
|
60
|
+
return zIndex;
|
|
61
|
+
},
|
|
62
|
+
remove(id) {
|
|
63
|
+
this.state.activeList = this.state.activeList.filter((row) => row.id !== id);
|
|
64
|
+
if (this.state.activeList.length === 0) {
|
|
65
|
+
clearAllBodyScrollLocks();
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
removeAll() {
|
|
69
|
+
this.state.activeList = [];
|
|
70
|
+
clearAllBodyScrollLocks();
|
|
71
|
+
}
|
|
72
|
+
// ---------------------------------------------------
|
|
73
|
+
}
|
|
74
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type MultiLang } from '../../../lib/multi-lang.js';
|
|
2
|
+
export declare const NamespaceName = "Toast";
|
|
3
|
+
export declare const Theme: {
|
|
4
|
+
readonly Success: "success";
|
|
5
|
+
readonly Info: "info";
|
|
6
|
+
readonly Warning: "warning";
|
|
7
|
+
readonly Error: "error";
|
|
8
|
+
};
|
|
9
|
+
export type Theme = (typeof Theme)[keyof typeof Theme];
|
|
10
|
+
export interface Message {
|
|
11
|
+
key: string;
|
|
12
|
+
title: MultiLang;
|
|
13
|
+
message: MultiLang;
|
|
14
|
+
isShow: boolean;
|
|
15
|
+
hideAfter: number;
|
|
16
|
+
barWidth: number;
|
|
17
|
+
theme: Theme;
|
|
18
|
+
}
|
|
19
|
+
export interface Controler {
|
|
20
|
+
Success: (message: MultiLang, title: MultiLang, hideAfter?: number) => void;
|
|
21
|
+
Info: (message: MultiLang, title: MultiLang, hideAfter?: number) => void;
|
|
22
|
+
Warning: (message: MultiLang, title: MultiLang, hideAfter?: number) => void;
|
|
23
|
+
E: (message: MultiLang, title: MultiLang, hideAfter?: number) => void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/* ----------------------------------------------------------------------------
|
|
3
|
+
src\runtime\components\hs-ui\toast\index.vue
|
|
4
|
+
// ----------------------------------------------------------------------------
|
|
5
|
+
HsUiToast
|
|
6
|
+
HsUiToastHsUiToast
|
|
7
|
+
----------------------------------------------------------------------------- */
|
|
8
|
+
|
|
9
|
+
// [ vue ]
|
|
10
|
+
import { computed, watch } from 'vue';
|
|
11
|
+
|
|
12
|
+
// [ vueuse ]
|
|
13
|
+
import { watchArray } from '@vueuse/core';
|
|
14
|
+
// [ tailwind ]
|
|
15
|
+
import { RemovePrefix } from '../../../lib/prefix';
|
|
16
|
+
|
|
17
|
+
// ----------------------------------------------------------------------------
|
|
18
|
+
// [ components > v-ui > toast > * ]
|
|
19
|
+
import { type Message } from './index.type';
|
|
20
|
+
// ----------------------------------------------------------------------------
|
|
21
|
+
// [ src > runtime > lib > * ]
|
|
22
|
+
import { Int } from '../../../lib/number';
|
|
23
|
+
// [ store ]
|
|
24
|
+
import { useHsUiToast } from '../../../composables/use-hs-ui-toast';
|
|
25
|
+
import { useHsMultiLang } from '../../../composables/use-hs-multi-lang';
|
|
26
|
+
// ----------------------------------------------------------------------------
|
|
27
|
+
// [ nac-Stroe ]
|
|
28
|
+
const toast = useHsUiToast();
|
|
29
|
+
const state = toast.state;
|
|
30
|
+
// ----------------------------------------------------------------------------
|
|
31
|
+
const storeMultiLang = useHsMultiLang();
|
|
32
|
+
const MultiLangText = storeMultiLang.MultiLangText;
|
|
33
|
+
// ----------------------------------------------------------------------------
|
|
34
|
+
// 要素を消し始めから完全に消すのにかかる時間(Accordionの動作時間)
|
|
35
|
+
const hideSpan = 300;
|
|
36
|
+
const showCount = computed(() => {
|
|
37
|
+
const list = state.pendingList.filter((row) => row.isShow);
|
|
38
|
+
return list.length;
|
|
39
|
+
});
|
|
40
|
+
// ----------------------------------------------------------------------------
|
|
41
|
+
watch(
|
|
42
|
+
() => showCount.value,
|
|
43
|
+
() => {
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
if (showCount.value === 0 && state.pendingList.length !== 0) {
|
|
46
|
+
state.pendingList.length = 0;
|
|
47
|
+
}
|
|
48
|
+
}, hideSpan);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
watchArray(state.pendingList, (newList, oldList, added, removed) => {
|
|
53
|
+
if (added.length === 0 && removed.length > 0) return;
|
|
54
|
+
// const keyMap = newList.map((row) => row.key);
|
|
55
|
+
newList.forEach((message) => {
|
|
56
|
+
if (message.hideAfter !== 0) {
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
if (message.isShow === false) return;
|
|
59
|
+
deleteMessage(message);
|
|
60
|
+
}, message.hideAfter);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const deleteMessage = (message: Message) => {
|
|
66
|
+
message.isShow = false;
|
|
67
|
+
};
|
|
68
|
+
const style = (message: Message) => {
|
|
69
|
+
let d = Int(message.hideAfter);
|
|
70
|
+
if (d < 0) d = 0;
|
|
71
|
+
return {
|
|
72
|
+
'animation-duration': d + 'ms',
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const closeBtnStyle = RemovePrefix([
|
|
77
|
+
//
|
|
78
|
+
'bg-transparent',
|
|
79
|
+
'tw-bg-transparent',
|
|
80
|
+
'border-[1px]',
|
|
81
|
+
'tw-border-[1px]',
|
|
82
|
+
'border-white',
|
|
83
|
+
'tw-border-white',
|
|
84
|
+
'rounded',
|
|
85
|
+
'tw-rounded',
|
|
86
|
+
'min-h-0',
|
|
87
|
+
'tw-min-h-0',
|
|
88
|
+
'w-[30px]',
|
|
89
|
+
'tw-w-[30px]',
|
|
90
|
+
'h-[30px]',
|
|
91
|
+
'tw-h-[30px]',
|
|
92
|
+
'p-0',
|
|
93
|
+
'tw-p-0',
|
|
94
|
+
'flex-none',
|
|
95
|
+
'tw-flex-none',
|
|
96
|
+
'self-start',
|
|
97
|
+
'tw-self-start',
|
|
98
|
+
]);
|
|
99
|
+
|
|
100
|
+
// ----------------------------------------------------------------------------
|
|
101
|
+
</script>
|
|
102
|
+
<template>
|
|
103
|
+
<div class="HsUiToast-base" :style="{ 'z-index': state.zindex }">
|
|
104
|
+
<div
|
|
105
|
+
v-show="state.pendingList.length != 0"
|
|
106
|
+
class="HsUiToast-container"
|
|
107
|
+
:class="RemovePrefix(['grid', 'tw-grid', 'gap-1', 'tw-gap-1'])"
|
|
108
|
+
>
|
|
109
|
+
<template v-for="(message, index) in state.pendingList" :key="index">
|
|
110
|
+
<HsUiAccordion :span="hideSpan" :open="message.isShow">
|
|
111
|
+
<HsUiCard
|
|
112
|
+
class="HsUiToast"
|
|
113
|
+
:class="
|
|
114
|
+
RemovePrefix(['drop-shadow-md', 'tw-drop-shadow-md', 'pointer-events-all', 'tw-pointer-events-all'])
|
|
115
|
+
"
|
|
116
|
+
@click.stop=""
|
|
117
|
+
@mousedown.stop=""
|
|
118
|
+
@mouseup.stop=""
|
|
119
|
+
>
|
|
120
|
+
<template v-if="MultiLangText(message.title).length > 0">
|
|
121
|
+
<HsUiCardItem
|
|
122
|
+
variant="header"
|
|
123
|
+
class="items-center"
|
|
124
|
+
:class="[`theme-${message.theme}`, RemovePrefix(['items-center', 'tw-items-center'])]"
|
|
125
|
+
>
|
|
126
|
+
<div class="HsUiToast-title">
|
|
127
|
+
{{ MultiLangText(message.title) }}
|
|
128
|
+
</div>
|
|
129
|
+
<HsFcBtn :class="closeBtnStyle" theme="white" type="outlined" @click="deleteMessage(message)">
|
|
130
|
+
<i class="fas fa-times"/>
|
|
131
|
+
</HsFcBtn>
|
|
132
|
+
</HsUiCardItem>
|
|
133
|
+
<HsUiCardItem
|
|
134
|
+
v-if="MultiLangText(message.message).length > 0"
|
|
135
|
+
:class="[`theme-${message.theme}`, RemovePrefix(['items-overflow-visible', 'tw-overflow-visible'])]"
|
|
136
|
+
>
|
|
137
|
+
<div class="HsUiToast-message">
|
|
138
|
+
{{ MultiLangText(message.message) }}
|
|
139
|
+
</div>
|
|
140
|
+
<!-- </div> -->
|
|
141
|
+
</HsUiCardItem>
|
|
142
|
+
<HsUiCardItem
|
|
143
|
+
v-if="message.hideAfter != 0"
|
|
144
|
+
:class="[
|
|
145
|
+
`theme-${message.theme}`,
|
|
146
|
+
RemovePrefix([
|
|
147
|
+
'overflow-visible',
|
|
148
|
+
'tw-overflow-visible',
|
|
149
|
+
'p-0',
|
|
150
|
+
'tw-p-0',
|
|
151
|
+
'min-h-[8px]',
|
|
152
|
+
'tw-min-h-[8px]',
|
|
153
|
+
]),
|
|
154
|
+
]"
|
|
155
|
+
>
|
|
156
|
+
<div class="HsUiToast-bar-body" :class="[`${message.theme}`]">
|
|
157
|
+
<div class="HsUiToast-bar" :style="style(message)"/>
|
|
158
|
+
</div>
|
|
159
|
+
</HsUiCardItem>
|
|
160
|
+
</template>
|
|
161
|
+
<template v-else>
|
|
162
|
+
<HsUiCardItem
|
|
163
|
+
variant="header"
|
|
164
|
+
:class="[`theme-${message.theme}`, RemovePrefix(['items-center', 'tw-items-center'])]"
|
|
165
|
+
>
|
|
166
|
+
<div class="HsUiToast-message">
|
|
167
|
+
{{ MultiLangText(message.message) }}
|
|
168
|
+
</div>
|
|
169
|
+
<HsFcBtn :class="closeBtnStyle" theme="white" variant="outlined" @click="deleteMessage(message)">
|
|
170
|
+
<i class="fas fa-times"/>
|
|
171
|
+
</HsFcBtn>
|
|
172
|
+
</HsUiCardItem>
|
|
173
|
+
<HsUiCardItem
|
|
174
|
+
v-if="message.hideAfter != 0"
|
|
175
|
+
:class="[
|
|
176
|
+
`theme-${message.theme}`,
|
|
177
|
+
RemovePrefix([
|
|
178
|
+
'overflow-visible',
|
|
179
|
+
'tw-overflow-visible',
|
|
180
|
+
'p-0',
|
|
181
|
+
'tw-p-0',
|
|
182
|
+
'min-h-[8px]',
|
|
183
|
+
'tw-min-h-[8px]',
|
|
184
|
+
]),
|
|
185
|
+
]"
|
|
186
|
+
>
|
|
187
|
+
<div class="HsUiToast-bar-body" :class="[`${message.theme}`]">
|
|
188
|
+
<div class="HsUiToast-bar" :style="style(message)"/>
|
|
189
|
+
</div>
|
|
190
|
+
</HsUiCardItem>
|
|
191
|
+
</template>
|
|
192
|
+
</HsUiCard>
|
|
193
|
+
</HsUiAccordion>
|
|
194
|
+
</template>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
</template>
|
|
198
|
+
|
|
199
|
+
<style scoped>
|
|
200
|
+
.theme-success {
|
|
201
|
+
background-color: #2bb60c !important;
|
|
202
|
+
color: white !important;
|
|
203
|
+
}
|
|
204
|
+
.theme-success .HsUiToast-bar {
|
|
205
|
+
background-color: #2bb60c !important;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.theme-info {
|
|
209
|
+
background-color: #2badd5 !important;
|
|
210
|
+
color: white !important;
|
|
211
|
+
}
|
|
212
|
+
.theme-info .HsUiToast-bar {
|
|
213
|
+
background-color: #2badd5 !important;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.theme-warning {
|
|
217
|
+
background-color: #d89400 !important;
|
|
218
|
+
color: #000000 !important;
|
|
219
|
+
}
|
|
220
|
+
.theme-warning .HsUiToast-bar {
|
|
221
|
+
background-color: #d89400 !important;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.theme-error {
|
|
225
|
+
background-color: #e82a4d !important;
|
|
226
|
+
color: white !important;
|
|
227
|
+
}
|
|
228
|
+
.theme-error .HsUiToast-bar {
|
|
229
|
+
background-color: #e82a4d !important;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.HsUiToast-base {
|
|
233
|
+
pointer-events: none;
|
|
234
|
+
position: fixed;
|
|
235
|
+
inset: 0 0 0 0;
|
|
236
|
+
overflow: hidden;
|
|
237
|
+
display: flex;
|
|
238
|
+
justify-content: center;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.HsUiToast-container {
|
|
242
|
+
pointer-events: none;
|
|
243
|
+
position: relative;
|
|
244
|
+
overflow-x: hidden;
|
|
245
|
+
overflow-y: auto;
|
|
246
|
+
height: 100%;
|
|
247
|
+
height: 100svh;
|
|
248
|
+
max-height: 100%;
|
|
249
|
+
max-height: 100svh;
|
|
250
|
+
display: flex;
|
|
251
|
+
flex-direction: column;
|
|
252
|
+
width: 800px;
|
|
253
|
+
padding: 10px 20px;
|
|
254
|
+
}
|
|
255
|
+
@media screen and (min-width: 0px) and (max-width: 399.9px) {
|
|
256
|
+
.HsUiToast-container {
|
|
257
|
+
width: 100%;
|
|
258
|
+
padding: 5px 5px;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
@media screen and (min-width: 400px) and (max-width: 599.9px) {
|
|
262
|
+
.HsUiToast-container {
|
|
263
|
+
width: 380px;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
@media screen and (min-width: 600px) and (max-width: 799.9px) {
|
|
267
|
+
.HsUiToast-container {
|
|
268
|
+
width: 550px;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
@media screen and (min-width: 800px) and (max-width: 1199.9px) {
|
|
272
|
+
.HsUiToast-container {
|
|
273
|
+
width: 600px;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.HsUiToast {
|
|
278
|
+
pointer-events: all;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.HsUiToast-title {
|
|
282
|
+
pointer-events: all;
|
|
283
|
+
font-size: 20px;
|
|
284
|
+
white-space: pre-line;
|
|
285
|
+
overflow-wrap: break-word;
|
|
286
|
+
word-break: break-all;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.HsUiToast-message {
|
|
290
|
+
pointer-events: all;
|
|
291
|
+
font-size: 16px;
|
|
292
|
+
white-space: pre-line;
|
|
293
|
+
overflow-wrap: break-word;
|
|
294
|
+
word-break: break-all;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.HsUiToast-icon {
|
|
298
|
+
width: 40px;
|
|
299
|
+
display: flex;
|
|
300
|
+
justify-content: center;
|
|
301
|
+
align-items: center;
|
|
302
|
+
}
|
|
303
|
+
.HsUiToast-icon::after {
|
|
304
|
+
font-family: "Font Awesome 5 Free";
|
|
305
|
+
font-weight: 900;
|
|
306
|
+
font-size: 30px;
|
|
307
|
+
}
|
|
308
|
+
@media screen and (min-width: 0px) and (max-width: 599.9px) {
|
|
309
|
+
.HsUiToast-icon::after {
|
|
310
|
+
font-size: 18px;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
.HsUiToast-icon[data-icon=success]::after {
|
|
314
|
+
content: "\f058";
|
|
315
|
+
}
|
|
316
|
+
.HsUiToast-icon[data-icon=info]::after {
|
|
317
|
+
content: "\f05a";
|
|
318
|
+
}
|
|
319
|
+
.HsUiToast-icon[data-icon=warning]::after {
|
|
320
|
+
content: "\f06a";
|
|
321
|
+
}
|
|
322
|
+
.HsUiToast-icon[data-icon=error]::after {
|
|
323
|
+
content: "\f071";
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.HsUiToast-bar-body {
|
|
327
|
+
height: 6px;
|
|
328
|
+
margin: 0px 2px 2px 2px;
|
|
329
|
+
border-radius: 4px;
|
|
330
|
+
background-color: rgb(255, 255, 255);
|
|
331
|
+
display: flex;
|
|
332
|
+
justify-content: flex-start;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.HsUiToast-bar {
|
|
336
|
+
margin: 1px 1px;
|
|
337
|
+
border-radius: 2px;
|
|
338
|
+
height: 4px;
|
|
339
|
+
transition: width 10ms;
|
|
340
|
+
animation-name: HsUiToast-bar-key-frame;
|
|
341
|
+
animation-timing-function: linear;
|
|
342
|
+
animation-fill-mode: forwards;
|
|
343
|
+
}
|
|
344
|
+
</style>
|
|
345
|
+
<style lang="scss">
|
|
346
|
+
@keyframes HsUiToast-bar-key-frame {
|
|
347
|
+
0% {
|
|
348
|
+
width: 0%;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
100% {
|
|
352
|
+
width: 100%;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
</style>
|