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
|
@@ -1,408 +1,253 @@
|
|
|
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
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (
|
|
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
|
-
if (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
//
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
"
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
//
|
|
192
|
-
"grid",
|
|
193
|
-
"grid-cols-2",
|
|
194
|
-
"gap-2",
|
|
195
|
-
];
|
|
196
|
-
const btnStyle = [
|
|
197
|
-
//
|
|
198
|
-
"py-1",
|
|
199
|
-
"w-full",
|
|
200
|
-
];
|
|
201
|
-
const titleStyle = [
|
|
202
|
-
//
|
|
203
|
-
"text-[14px]",
|
|
204
|
-
"sm:text-[18px]",
|
|
205
|
-
"whitespace-pre-line",
|
|
206
|
-
"text-wrap",
|
|
207
|
-
];
|
|
208
|
-
const messageStyle = [
|
|
209
|
-
//
|
|
210
|
-
"text-[14px]",
|
|
211
|
-
"sm:text-[18px]",
|
|
212
|
-
"whitespace-pre-line",
|
|
213
|
-
"text-wrap",
|
|
214
|
-
"pb-2",
|
|
215
|
-
];
|
|
216
|
-
const cardStyle = [
|
|
217
|
-
//
|
|
218
|
-
"min-w-[300px]",
|
|
219
|
-
"mt-auto",
|
|
220
|
-
"mb-auto",
|
|
221
|
-
];
|
|
222
|
-
const closeBtnIcon = [
|
|
223
|
-
//
|
|
224
|
-
"mx-1",
|
|
225
|
-
];
|
|
226
|
-
const baseCardHeader = [
|
|
227
|
-
//
|
|
228
|
-
"py-1",
|
|
229
|
-
"pe-1",
|
|
230
|
-
];
|
|
231
|
-
|
|
232
|
-
const modalClosable = computed(() => {
|
|
233
|
-
if (activeItem.value?.data.option.btnCancel.isShow) return true;
|
|
234
|
-
if (activeItem.value?.data.option.bgClose !== undefined) {
|
|
235
|
-
return activeItem.value?.data.option.bgClose;
|
|
236
|
-
}
|
|
237
|
-
return false;
|
|
238
|
-
});
|
|
239
|
-
</script>
|
|
240
|
-
|
|
241
|
-
<template>
|
|
242
|
-
<ClientOnly>
|
|
243
|
-
<Modal
|
|
244
|
-
ref="targetElm"
|
|
245
|
-
:show="isShow"
|
|
246
|
-
:z-index="zindex"
|
|
247
|
-
focus-lock
|
|
248
|
-
:closeable="modalClosable"
|
|
249
|
-
@close="clickBg()"
|
|
250
|
-
>
|
|
251
|
-
<Card
|
|
252
|
-
v-if="activeItem !== null"
|
|
253
|
-
class="HsUiDialog"
|
|
254
|
-
:class="cardStyle"
|
|
255
|
-
@click.stop
|
|
256
|
-
>
|
|
257
|
-
<CardItem
|
|
258
|
-
:class="[`theme-${activeItem.data.option.theme}`, baseCardHeader]"
|
|
259
|
-
variant="header"
|
|
260
|
-
>
|
|
261
|
-
<div :class="titleStyle">
|
|
262
|
-
{{ tx(activeItem.data.title) }}
|
|
263
|
-
</div>
|
|
264
|
-
<Btn
|
|
265
|
-
v-if="activeItem.data.option.btnCancel.isShow"
|
|
266
|
-
:class="cancelBtnStyle"
|
|
267
|
-
:class-inner="cancelBtnStyleInner"
|
|
268
|
-
variant="outlined"
|
|
269
|
-
:theme="activeItem.data.option.btnCancel.theme"
|
|
270
|
-
@click="clickCancel()"
|
|
271
|
-
@ref="(e:any) => (cancelBtnElm = e)"
|
|
272
|
-
>
|
|
273
|
-
<i class="fas fa-times" :class="closeBtnIcon" />
|
|
274
|
-
{{ tx(activeItem.data.option.btnCancel.title) }}
|
|
275
|
-
</Btn>
|
|
276
|
-
</CardItem>
|
|
277
|
-
<CardItem variant="body">
|
|
278
|
-
<div :class="messageStyle">
|
|
279
|
-
{{ tx(activeItem.data.message) }}
|
|
280
|
-
</div>
|
|
281
|
-
<div :class="btnBaseStyle">
|
|
282
|
-
<div class="flex-cc">
|
|
283
|
-
<Btn
|
|
284
|
-
v-if="activeItem.data.option.btnLeft.isShow"
|
|
285
|
-
:class="[
|
|
286
|
-
btnStyle,
|
|
287
|
-
activeItem.data.option.btnLeft.variant === 'outlined'
|
|
288
|
-
? 'bg-white'
|
|
289
|
-
: '',
|
|
290
|
-
]"
|
|
291
|
-
:variant="activeItem.data.option.btnLeft.variant"
|
|
292
|
-
:theme="activeItem.data.option.btnLeft.theme"
|
|
293
|
-
@click="clickLeft()"
|
|
294
|
-
@ref="(e:any) => (leftBtnElm = e)"
|
|
295
|
-
@keydown="onKeyDownNoBtn"
|
|
296
|
-
>
|
|
297
|
-
{{ tx(activeItem.data.option.btnLeft.title) }}
|
|
298
|
-
</Btn>
|
|
299
|
-
</div>
|
|
300
|
-
<div class="flex-cc">
|
|
301
|
-
<Btn
|
|
302
|
-
v-if="activeItem.data.option.btnRight.isShow"
|
|
303
|
-
:class="[
|
|
304
|
-
btnStyle,
|
|
305
|
-
activeItem.data.option.btnRight.variant === 'outlined'
|
|
306
|
-
? 'bg-white'
|
|
307
|
-
: '',
|
|
308
|
-
]"
|
|
309
|
-
:variant="activeItem.data.option.btnRight.variant"
|
|
310
|
-
:theme="activeItem.data.option.btnRight.theme"
|
|
311
|
-
@click="clickRight()"
|
|
312
|
-
@ref="(e:any) => (rightBtnElm = e)"
|
|
313
|
-
@keydown="onKeyDownYesBtn"
|
|
314
|
-
>
|
|
315
|
-
{{ tx(activeItem.data.option.btnRight.title) }}
|
|
316
|
-
</Btn>
|
|
317
|
-
</div>
|
|
318
|
-
</div>
|
|
319
|
-
</CardItem>
|
|
320
|
-
</Card>
|
|
321
|
-
</Modal>
|
|
322
|
-
</ClientOnly>
|
|
323
|
-
</template>
|
|
324
|
-
|
|
325
|
-
<style scoped>
|
|
326
|
-
.theme-main0 {
|
|
327
|
-
background-color: theme("colors.main0");
|
|
328
|
-
color: theme("colors.white");
|
|
329
|
-
}
|
|
1
|
+
<script setup>
|
|
2
|
+
import { disableBodyScroll, enableBodyScroll } from "body-scroll-lock";
|
|
3
|
+
import { computed, ref, watch, nextTick } from "#imports";
|
|
4
|
+
import { DialogDefaultZIndex } from "../../types/dialog";
|
|
5
|
+
import { useHsDialog } from "../../composables/use-hs-dialog";
|
|
6
|
+
import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
|
|
7
|
+
import { useHsPinia } from "../../composables/use-pinia";
|
|
8
|
+
import Modal from "./modal.vue";
|
|
9
|
+
import Card from "../layout/card.vue";
|
|
10
|
+
import CardItem from "../layout/card-item.vue";
|
|
11
|
+
import Btn from "../form/btn.vue";
|
|
12
|
+
import { GetTextColor, GetColorCode } from "../../utils/theme";
|
|
13
|
+
const toast = useHsDialog(useHsPinia());
|
|
14
|
+
const state = toast.state;
|
|
15
|
+
const multiLang = useHsMultiLang(useHsPinia());
|
|
16
|
+
const tx = multiLang.tx;
|
|
17
|
+
const cancelBtnElm = ref(null);
|
|
18
|
+
const leftBtnElm = ref(null);
|
|
19
|
+
const rightBtnElm = ref(null);
|
|
20
|
+
const activeItem = computed(() => {
|
|
21
|
+
if (state.pendingList.length !== 0) {
|
|
22
|
+
return state.pendingList[0];
|
|
23
|
+
} else {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const activateTs = computed(() => {
|
|
28
|
+
if (activeItem.value) {
|
|
29
|
+
return activeItem.value.ts;
|
|
30
|
+
} else {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const isShow = computed(() => {
|
|
35
|
+
return activeItem.value !== null;
|
|
36
|
+
});
|
|
37
|
+
const clickLeft = () => {
|
|
38
|
+
if (!activeItem.value) return;
|
|
39
|
+
const item = activeItem.value;
|
|
40
|
+
if (item.data.option.btnLeft.isShow === false) return;
|
|
41
|
+
item.data.leftBtnClick();
|
|
42
|
+
};
|
|
43
|
+
const clickRight = () => {
|
|
44
|
+
if (!activeItem.value) return;
|
|
45
|
+
const item = activeItem.value;
|
|
46
|
+
if (item.data.option.btnRight.isShow === false) return;
|
|
47
|
+
item.data.rightBtnClick();
|
|
48
|
+
};
|
|
49
|
+
const clickCancel = () => {
|
|
50
|
+
if (!activeItem.value) return;
|
|
51
|
+
const item = activeItem.value;
|
|
52
|
+
if (item.data.option.btnCancel.isShow === false) return;
|
|
53
|
+
item.data.cancelBtnClick();
|
|
54
|
+
};
|
|
55
|
+
const clickBg = () => {
|
|
56
|
+
if (!activeItem.value) return;
|
|
57
|
+
const item = activeItem.value;
|
|
58
|
+
if (activeItem.value?.data.option.bgClose === true) {
|
|
59
|
+
item.data.cancelBtnClick();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (item.data.option.btnCancel.isShow === false) return;
|
|
63
|
+
item.data.cancelBtnClick();
|
|
64
|
+
};
|
|
65
|
+
watch(activateTs, async (ts) => {
|
|
66
|
+
await nextTick();
|
|
67
|
+
if (ts === null || !isShow.value) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (!activeItem.value) return;
|
|
71
|
+
if (isShow.value === true) {
|
|
72
|
+
if (activeItem.value.data.option.defaultBtn === "right" && rightBtnElm.value !== null) {
|
|
73
|
+
rightBtnElm.value.focus();
|
|
74
|
+
} else if (activeItem.value.data.option.defaultBtn === "left" && leftBtnElm.value !== null) {
|
|
75
|
+
leftBtnElm.value.focus();
|
|
76
|
+
} else if (activeItem.value.data.option.defaultBtn === "cancel" && cancelBtnElm.value !== null) {
|
|
77
|
+
cancelBtnElm.value.focus();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const keyMoveFlag = ref(false);
|
|
82
|
+
const onKeyDownNoBtn = (e) => {
|
|
83
|
+
if (!activeItem.value) return;
|
|
84
|
+
if (e.key === "Tab") return;
|
|
85
|
+
if (activeItem.value.data.option.btnRight.isShow === true && rightBtnElm.value !== null) {
|
|
86
|
+
keyMoveFlag.value = true;
|
|
87
|
+
rightBtnElm.value.focus();
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const onKeyDownYesBtn = (e) => {
|
|
91
|
+
if (!activeItem.value) return;
|
|
92
|
+
if (e.key === "Tab") return;
|
|
93
|
+
if (activeItem.value.data.option.btnLeft.isShow === true && leftBtnElm.value !== null) {
|
|
94
|
+
keyMoveFlag.value = true;
|
|
95
|
+
leftBtnElm.value.focus();
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const zindex = computed(() => {
|
|
99
|
+
if (!activeItem.value) return DialogDefaultZIndex;
|
|
100
|
+
return activeItem.value.data.option.zindex;
|
|
101
|
+
});
|
|
102
|
+
const targetElm = ref(null);
|
|
103
|
+
watch(isShow, (v) => {
|
|
104
|
+
if (!targetElm.value) return;
|
|
105
|
+
if (v) {
|
|
106
|
+
const options = {
|
|
107
|
+
reserveScrollBarGap: true
|
|
108
|
+
// bodyにスクロールバー分のpadding-rightを追加するかどうか(デフォルト値:false)
|
|
109
|
+
};
|
|
110
|
+
disableBodyScroll(targetElm.value, options);
|
|
111
|
+
} else {
|
|
112
|
+
enableBodyScroll(targetElm.value);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
const cancelBtnStyle = [
|
|
116
|
+
//
|
|
117
|
+
"px-2",
|
|
118
|
+
"py-1",
|
|
119
|
+
"border-[1px]",
|
|
120
|
+
"!bg-transparent",
|
|
121
|
+
"rounded-none",
|
|
122
|
+
"h-full"
|
|
123
|
+
];
|
|
124
|
+
const cancelBtnStyleInner = [
|
|
125
|
+
//
|
|
126
|
+
"flex",
|
|
127
|
+
"items-center"
|
|
128
|
+
];
|
|
129
|
+
const btnBaseStyle = [
|
|
130
|
+
//
|
|
131
|
+
"grid",
|
|
132
|
+
"grid-cols-2",
|
|
133
|
+
"gap-2"
|
|
134
|
+
];
|
|
135
|
+
const btnStyle = [
|
|
136
|
+
//
|
|
137
|
+
"py-1",
|
|
138
|
+
"w-full"
|
|
139
|
+
];
|
|
140
|
+
const titleStyle = [
|
|
141
|
+
//
|
|
142
|
+
"text-[14px]",
|
|
143
|
+
"sm:text-[18px]",
|
|
144
|
+
"whitespace-pre-line",
|
|
145
|
+
"text-wrap"
|
|
146
|
+
];
|
|
147
|
+
const messageStyle = [
|
|
148
|
+
//
|
|
149
|
+
"text-[14px]",
|
|
150
|
+
"sm:text-[18px]",
|
|
151
|
+
"whitespace-pre-line",
|
|
152
|
+
"text-wrap",
|
|
153
|
+
"pb-2"
|
|
154
|
+
];
|
|
155
|
+
const cardStyle = [
|
|
156
|
+
//
|
|
157
|
+
"min-w-[300px]",
|
|
158
|
+
"mt-auto",
|
|
159
|
+
"mb-auto"
|
|
160
|
+
];
|
|
161
|
+
const closeBtnIcon = [
|
|
162
|
+
//
|
|
163
|
+
"mx-1"
|
|
164
|
+
];
|
|
165
|
+
const baseCardHeader = [
|
|
166
|
+
//
|
|
167
|
+
"py-1",
|
|
168
|
+
"pe-1",
|
|
169
|
+
"bg-[var(--color-bg)]",
|
|
170
|
+
"text-[var(--color-text)]"
|
|
171
|
+
];
|
|
172
|
+
const modalClosable = computed(() => {
|
|
173
|
+
if (activeItem.value?.data.option.btnCancel.isShow) return true;
|
|
174
|
+
if (activeItem.value?.data.option.bgClose !== void 0) {
|
|
175
|
+
return activeItem.value?.data.option.bgClose;
|
|
176
|
+
}
|
|
177
|
+
return false;
|
|
178
|
+
});
|
|
179
|
+
const bgColorCode = computed(() => {
|
|
180
|
+
if (!activeItem.value) return "#000000";
|
|
181
|
+
return GetColorCode(activeItem.value.data.option.theme);
|
|
182
|
+
});
|
|
183
|
+
const textColorCode = computed(() => {
|
|
184
|
+
if (!activeItem.value) return "#FFFFFF";
|
|
185
|
+
return GetTextColor(bgColorCode.value);
|
|
186
|
+
});
|
|
187
|
+
const headerStyle = computed(() => {
|
|
188
|
+
return ["--color-bg:" + bgColorCode.value, "--color-text:" + textColorCode.value];
|
|
189
|
+
});
|
|
190
|
+
</script>
|
|
330
191
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
.theme
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
.
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
.theme
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
.
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
.
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
.theme-black {
|
|
395
|
-
background-color: theme("colors.black");
|
|
396
|
-
color: theme("colors.white");
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.theme-dark {
|
|
400
|
-
background-color: theme("colors.dark");
|
|
401
|
-
color: theme("colors.white");
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
.theme-back {
|
|
405
|
-
background-color: theme("colors.back");
|
|
406
|
-
color: theme("colors.main1");
|
|
407
|
-
}
|
|
408
|
-
</style>
|
|
192
|
+
<template>
|
|
193
|
+
<ClientOnly>
|
|
194
|
+
<Modal ref="targetElm" :show="isShow" :z-index="zindex" focus-lock :closeable="modalClosable" @close="clickBg()">
|
|
195
|
+
<Card v-if="activeItem" class="HsUiDialog" :class="cardStyle" @click.stop>
|
|
196
|
+
<CardItem
|
|
197
|
+
:class="[`theme-${activeItem.data.option.theme}`, baseCardHeader]"
|
|
198
|
+
variant="header"
|
|
199
|
+
:style="headerStyle"
|
|
200
|
+
>
|
|
201
|
+
<div :class="titleStyle">
|
|
202
|
+
{{ tx(activeItem.data.title) }}
|
|
203
|
+
</div>
|
|
204
|
+
<Btn
|
|
205
|
+
v-if="activeItem.data.option.btnCancel.isShow"
|
|
206
|
+
:class="cancelBtnStyle"
|
|
207
|
+
:class-inner="cancelBtnStyleInner"
|
|
208
|
+
variant="outlined"
|
|
209
|
+
:theme="activeItem.data.option.btnCancel.theme"
|
|
210
|
+
@click="clickCancel()"
|
|
211
|
+
@ref="(e) => cancelBtnElm = e"
|
|
212
|
+
>
|
|
213
|
+
<i class="fas fa-times" :class="closeBtnIcon" />
|
|
214
|
+
{{ tx(activeItem.data.option.btnCancel.title) }}
|
|
215
|
+
</Btn>
|
|
216
|
+
</CardItem>
|
|
217
|
+
<CardItem variant="body">
|
|
218
|
+
<div :class="messageStyle">
|
|
219
|
+
{{ tx(activeItem.data.message) }}
|
|
220
|
+
</div>
|
|
221
|
+
<div :class="btnBaseStyle">
|
|
222
|
+
<div class="flex items-center justify-center">
|
|
223
|
+
<Btn
|
|
224
|
+
v-if="activeItem.data.option.btnLeft.isShow"
|
|
225
|
+
:class="[btnStyle, activeItem.data.option.btnLeft.variant === 'outlined' ? 'bg-white' : '']"
|
|
226
|
+
:variant="activeItem.data.option.btnLeft.variant"
|
|
227
|
+
:theme="activeItem.data.option.btnLeft.theme"
|
|
228
|
+
@click="clickLeft()"
|
|
229
|
+
@ref="(e) => leftBtnElm = e"
|
|
230
|
+
@keydown="onKeyDownNoBtn"
|
|
231
|
+
>
|
|
232
|
+
{{ tx(activeItem.data.option.btnLeft.title) }}
|
|
233
|
+
</Btn>
|
|
234
|
+
</div>
|
|
235
|
+
<div class="flex items-center justify-center">
|
|
236
|
+
<Btn
|
|
237
|
+
v-if="activeItem.data.option.btnRight.isShow"
|
|
238
|
+
:class="[btnStyle, activeItem.data.option.btnRight.variant === 'outlined' ? 'bg-white' : '']"
|
|
239
|
+
:variant="activeItem.data.option.btnRight.variant"
|
|
240
|
+
:theme="activeItem.data.option.btnRight.theme"
|
|
241
|
+
@click="clickRight()"
|
|
242
|
+
@ref="(e) => rightBtnElm = e"
|
|
243
|
+
@keydown="onKeyDownYesBtn"
|
|
244
|
+
>
|
|
245
|
+
{{ tx(activeItem.data.option.btnRight.title) }}
|
|
246
|
+
</Btn>
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
</CardItem>
|
|
250
|
+
</Card>
|
|
251
|
+
</Modal>
|
|
252
|
+
</ClientOnly>
|
|
253
|
+
</template>
|