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.
Files changed (131) hide show
  1. package/README.md +202 -14
  2. package/dist/module.d.mts +3 -4
  3. package/dist/module.json +9 -6
  4. package/dist/module.mjs +109 -99
  5. package/dist/runtime/assets/flatpickr-dark.css +1 -1
  6. package/dist/runtime/assets/main.css +1 -0
  7. package/dist/runtime/assets/tabulator-custom.css +1 -1
  8. package/dist/runtime/components/form/_select/hidden-item-toggle.vue +28 -0
  9. package/dist/runtime/components/form/_select/hidden-item-toggle.vue.d.ts +10 -0
  10. package/dist/runtime/components/form/_select/item-container.vue +63 -0
  11. package/dist/runtime/components/form/_select/item-container.vue.d.ts +19 -0
  12. package/dist/runtime/components/form/_select/item-label.vue +31 -0
  13. package/dist/runtime/components/form/_select/item-label.vue.d.ts +13 -0
  14. package/dist/runtime/components/form/_select/item-row.vue +62 -0
  15. package/dist/runtime/components/form/_select/item-row.vue.d.ts +34 -0
  16. package/dist/runtime/components/form/btn-line-loading.vue +62 -81
  17. package/dist/runtime/components/form/btn-line-loading.vue.d.ts +14 -0
  18. package/dist/runtime/components/form/btn.vue +411 -494
  19. package/dist/runtime/components/form/btn.vue.d.ts +0 -0
  20. package/dist/runtime/components/form/check-box.vue +200 -315
  21. package/dist/runtime/components/form/check-box.vue.d.ts +71 -0
  22. package/dist/runtime/components/form/check-list.vue +234 -364
  23. package/dist/runtime/components/form/check-list.vue.d.ts +99 -0
  24. package/dist/runtime/components/form/combo-box.vue +340 -0
  25. package/dist/runtime/components/form/combo-box.vue.d.ts +69 -0
  26. package/dist/runtime/components/form/datepicker.vue +717 -883
  27. package/dist/runtime/components/form/datepicker.vue.d.ts +122 -0
  28. package/dist/runtime/components/form/input-frame.vue +174 -258
  29. package/dist/runtime/components/form/input-frame.vue.d.ts +88 -0
  30. package/dist/runtime/components/form/radio.vue +451 -614
  31. package/dist/runtime/components/form/radio.vue.d.ts +62 -0
  32. package/dist/runtime/components/form/select-img-icon.vue +38 -53
  33. package/dist/runtime/components/form/select-img-icon.vue.d.ts +15 -0
  34. package/dist/runtime/components/form/select.vue +733 -579
  35. package/dist/runtime/components/form/select.vue.d.ts +63 -0
  36. package/dist/runtime/components/form/text-box.vue +266 -365
  37. package/dist/runtime/components/form/text-box.vue.d.ts +105 -0
  38. package/dist/runtime/components/form/textarea.vue +338 -421
  39. package/dist/runtime/components/form/textarea.vue.d.ts +98 -0
  40. package/dist/runtime/components/form/value-box.vue +512 -641
  41. package/dist/runtime/components/form/value-box.vue.d.ts +128 -0
  42. package/dist/runtime/components/interactive/alert.vue +49 -113
  43. package/dist/runtime/components/interactive/alert.vue.d.ts +30 -0
  44. package/dist/runtime/components/interactive/block-loading.vue +91 -119
  45. package/dist/runtime/components/interactive/block-loading.vue.d.ts +22 -0
  46. package/dist/runtime/components/interactive/dialog.vue +252 -407
  47. package/dist/runtime/components/interactive/dialog.vue.d.ts +3 -0
  48. package/dist/runtime/components/interactive/modal-bg.vue +72 -82
  49. package/dist/runtime/components/interactive/modal-bg.vue.d.ts +11 -0
  50. package/dist/runtime/components/interactive/modal.vue +121 -169
  51. package/dist/runtime/components/interactive/modal.vue.d.ts +38 -0
  52. package/dist/runtime/components/interactive/toast.vue +164 -206
  53. package/dist/runtime/components/interactive/toast.vue.d.ts +3 -0
  54. package/dist/runtime/components/interactive/window-loader.vue +61 -84
  55. package/dist/runtime/components/interactive/window-loader.vue.d.ts +3 -0
  56. package/dist/runtime/components/layout/accordion-down.vue +72 -0
  57. package/dist/runtime/components/layout/accordion-down.vue.d.ts +26 -0
  58. package/dist/runtime/components/layout/accordion.vue +47 -78
  59. package/dist/runtime/components/layout/accordion.vue.d.ts +22 -0
  60. package/dist/runtime/components/layout/aspect-box.vue +29 -58
  61. package/dist/runtime/components/layout/aspect-box.vue.d.ts +29 -0
  62. package/dist/runtime/components/layout/card-item.vue +148 -193
  63. package/dist/runtime/components/layout/card-item.vue.d.ts +0 -0
  64. package/dist/runtime/components/layout/card.vue +27 -42
  65. package/dist/runtime/components/layout/card.vue.d.ts +23 -0
  66. package/dist/runtime/components/layout/container.vue +25 -40
  67. package/dist/runtime/components/layout/container.vue.d.ts +35 -0
  68. package/dist/runtime/components/layout/divider-h.vue +30 -50
  69. package/dist/runtime/components/layout/divider-h.vue.d.ts +18 -0
  70. package/dist/runtime/components/misc/breadcrumb.vue +47 -95
  71. package/dist/runtime/components/misc/breadcrumb.vue.d.ts +22 -0
  72. package/dist/runtime/components/misc/tabulator.vue +122 -190
  73. package/dist/runtime/components/misc/tabulator.vue.d.ts +28 -0
  74. package/dist/runtime/components/misc/view-name-display.vue +53 -68
  75. package/dist/runtime/components/misc/view-name-display.vue.d.ts +14 -0
  76. package/dist/runtime/components/test.vue +13 -0
  77. package/dist/runtime/components/test.vue.d.ts +3 -0
  78. package/dist/runtime/composables/test.d.ts +8 -0
  79. package/dist/runtime/composables/test.js +12 -0
  80. package/dist/runtime/composables/use-hs-dialog.d.ts +3 -20
  81. package/dist/runtime/composables/use-hs-dialog.js +3 -9
  82. package/dist/runtime/composables/use-hs-is-mobile.d.ts +8 -2
  83. package/dist/runtime/composables/use-hs-is-mobile.js +43 -25
  84. package/dist/runtime/composables/use-hs-misc.d.ts +8 -38
  85. package/dist/runtime/composables/use-hs-misc.js +9 -61
  86. package/dist/runtime/composables/use-hs-modal.js +1 -3
  87. package/dist/runtime/composables/use-hs-multi-lang.d.ts +23 -40
  88. package/dist/runtime/composables/use-hs-multi-lang.js +30 -74
  89. package/dist/runtime/composables/use-hs-scroll-lock.d.ts +1 -1
  90. package/dist/runtime/composables/use-hs-scroll-lock.js +2 -1
  91. package/dist/runtime/composables/use-hs-toast.d.ts +2 -2
  92. package/dist/runtime/composables/use-hs-toast.js +12 -4
  93. package/dist/runtime/composables/use-pinia.d.ts +1 -0
  94. package/dist/runtime/composables/use-pinia.js +2 -0
  95. package/dist/runtime/plugin.d.ts +2 -0
  96. package/dist/runtime/plugin.js +4 -0
  97. package/dist/runtime/server/tsconfig.json +3 -3
  98. package/dist/runtime/types/dialog.d.ts +11 -20
  99. package/dist/runtime/types/dialog.js +2 -1
  100. package/dist/runtime/types/flatpickr/default.js +2 -23
  101. package/dist/runtime/types/flatpickr/ja.js +3 -37
  102. package/dist/runtime/types/toast.d.ts +1 -1
  103. package/dist/runtime/utils/dayjs.d.ts +8 -6
  104. package/dist/runtime/utils/dayjs.js +12 -5
  105. package/dist/runtime/utils/modal.d.ts +9 -28
  106. package/dist/runtime/utils/modal.js +7 -36
  107. package/dist/runtime/utils/multi-lang-object.d.ts +2 -2
  108. package/dist/runtime/utils/multi-lang-object.js +1 -5
  109. package/dist/runtime/utils/multi-lang.js +12 -22
  110. package/dist/runtime/utils/object.js +1 -1
  111. package/dist/runtime/utils/select-item.d.ts +3 -1
  112. package/dist/runtime/utils/stop-watch.js +6 -4
  113. package/dist/runtime/utils/string.js +4 -4
  114. package/dist/runtime/utils/tabulator.d.ts +1 -42
  115. package/dist/runtime/utils/tabulator.js +2 -99
  116. package/dist/runtime/utils/theme.d.ts +20 -20
  117. package/dist/runtime/utils/theme.js +180 -30
  118. package/dist/runtime/utils/tv.d.ts +1 -101
  119. package/dist/runtime/utils/tv.js +0 -22
  120. package/dist/types.d.mts +3 -1
  121. package/package.json +61 -119
  122. package/dist/module.cjs +0 -5
  123. package/dist/module.d.ts +0 -16
  124. package/dist/runtime/assets/vue-select.css +0 -1
  125. package/dist/runtime/components/misc/view-name-display-target.vue +0 -39
  126. package/dist/runtime/plugin/v-select.d.ts +0 -2
  127. package/dist/runtime/plugin/v-select.js +0 -5
  128. package/dist/runtime/style.css +0 -22
  129. package/dist/runtime/tailwind.css +0 -78
  130. package/dist/runtime/types/app.config.d.ts +0 -5
  131. package/dist/types.d.ts +0 -1
@@ -1,185 +1,142 @@
1
- <script setup lang="ts">
2
- /* ----------------------------------------------------------------------------
3
- // src\runtime\components\interactive\toast.vue
4
- // ----------------------------------------------------------------------------
5
- // Toast
6
- // ToastToast
7
- ----------------------------------------------------------------------------- */
8
-
9
- // [ vue ]
10
- import { computed, watch } from "vue";
11
- // [ vueuse ]
12
- import { watchArray } from "@vueuse/core";
13
- // ----------------------------------------------------------------------------
14
- // [ types ]
15
- import type { Message } from "../../types/toast";
16
- // [ utils ]
17
- import { Int } from "../../utils/number";
18
- // [ composables ]
19
- import { useHsToast } from "../../composables/use-hs-toast";
20
- import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
21
- // [ Components ]
22
- import Accordion from "../layout/accordion.vue";
23
- import Card from "../layout/card.vue";
24
- import CardItem from "../layout/card-item.vue";
25
- import Btn from "../form/btn.vue";
26
- // ----------------------------------------------------------------------------
27
- // [ nac-Stroe ]
28
- const toast = useHsToast();
29
- const state = toast.state;
30
- // ----------------------------------------------------------------------------
31
- const multiLang = useHsMultiLang();
32
- const tx = multiLang.tx;
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 = [
77
- //
78
- "bg-transparent",
79
- "border-[1px]",
80
- "border-white",
81
- "rounded",
82
- "min-h-0",
83
- "w-[30px]",
84
- "h-[30px]",
85
- "p-0",
86
- "flex-none",
87
- "self-start",
88
- ];
89
-
90
- // ----------------------------------------------------------------------------
91
- </script>
92
-
93
- <template>
94
- <div class="HsUiToast-base" :style="{ 'z-index': state.zindex }">
95
- <div
96
- v-show="state.pendingList.length !== 0"
97
- class="HsUiToast-container grid gap-1"
98
- >
99
- <template v-for="(message, index) in state.pendingList" :key="index">
100
- <Accordion :span="hideSpan" :open="message.isShow">
101
- <Card
102
- class="HsUiToast"
103
- :class="['drop-shadow-md', 'pointer-events-all']"
104
- @click.stop=""
105
- @mousedown.stop=""
106
- @mouseup.stop=""
107
- >
108
- <template v-if="tx(message.title).value.length > 0">
109
- <CardItem
110
- variant="header"
111
- class="items-center"
112
- :class="[`theme-${message.theme}`]"
113
- >
114
- <div class="HsUiToast-title">
115
- {{ tx(message.title) }}
116
- </div>
117
- <Btn
118
- :class="closeBtnStyle"
119
- theme="white"
120
- type="outlined"
121
- @click="deleteMessage(message)"
122
- >
123
- <i class="fas fa-times" />
124
- </Btn>
125
- </CardItem>
126
- <CardItem
127
- v-if="tx(message.message).value.length > 0"
128
- :class="[`theme-${message.theme}`, ['items-overflow-visible']]"
129
- >
130
- <div class="HsUiToast-message">
131
- {{ tx(message.message) }}
132
- </div>
133
- </CardItem>
134
- <CardItem
135
- v-if="message.hideAfter != 0"
136
- :class="[
137
- `theme-${message.theme}`,
138
- ['overflow-visible', 'p-0', 'min-h-[8px]'],
139
- ]"
140
- >
141
- <div class="HsUiToast-bar-body" :class="[`${message.theme}`]">
142
- <div class="HsUiToast-bar" :style="style(message)" />
143
- </div>
144
- </CardItem>
145
- </template>
146
- <template v-else>
147
- <CardItem
148
- variant="header"
149
- :class="[`theme-${message.theme}`, ['items-center']]"
150
- >
151
- <div class="HsUiToast-message">
152
- {{ tx(message.message) }}
153
- </div>
154
- <Btn
155
- :class="closeBtnStyle"
156
- theme="white"
157
- variant="outlined"
158
- @click="deleteMessage(message)"
159
- >
160
- <i class="fas fa-times" />
161
- </Btn>
162
- </CardItem>
163
- <CardItem
164
- v-if="message.hideAfter != 0"
165
- :class="[
166
- `theme-${message.theme}`,
167
- ['overflow-visible', 'p-0', 'min-h-[8px]'],
168
- ]"
169
- >
170
- <div class="HsUiToast-bar-body" :class="[`${message.theme}`]">
171
- <div class="HsUiToast-bar" :style="style(message)" />
172
- </div>
173
- </CardItem>
174
- </template>
175
- </Card>
176
- </Accordion>
177
- </template>
178
- </div>
179
- </div>
180
- </template>
181
-
1
+ <script setup>
2
+ import { Int } from "../../utils/number";
3
+ import { useHsToast } from "../../composables/use-hs-toast";
4
+ import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
5
+ import { useHsPinia } from "../../composables/use-pinia";
6
+ import Card from "../layout/card.vue";
7
+ import CardItem from "../layout/card-item.vue";
8
+ import Btn from "../form/btn.vue";
9
+ const toast = useHsToast(useHsPinia());
10
+ const state = toast.state;
11
+ const multiLang = useHsMultiLang(useHsPinia());
12
+ const tx = multiLang.tx;
13
+ const style = (message) => {
14
+ let d = Int(message.hideAfter);
15
+ if (d < 0) d = 0;
16
+ return {
17
+ "animation-duration": d + "ms"
18
+ };
19
+ };
20
+ const closeBtnStyle = [
21
+ //
22
+ "bg-transparent",
23
+ "border-[1px]",
24
+ "border-white",
25
+ "rounded",
26
+ "min-h-0",
27
+ "w-[30px]",
28
+ "h-[30px]",
29
+ "p-0",
30
+ "flex-none",
31
+ "self-start"
32
+ ];
33
+ const removeMessage = (key) => {
34
+ state.pendingList = state.pendingList.filter((row) => {
35
+ return row.key !== key;
36
+ });
37
+ };
38
+ </script>
39
+
40
+ <template>
41
+ <div class="HsUiToast-base" :style="{ 'z-index': state.zindex }">
42
+ <div v-show="state.pendingList.length !== 0" class="HsUiToast-container">
43
+ <TransitionGroup name="list" tag="div" class="flex flex-col-reverse items-end gap-1">
44
+ <div v-for="message in state.pendingList" :key="message.key" class="z-[1]">
45
+ <Card
46
+ class="HsUiToast"
47
+ :class="['drop-shadow-md', 'pointer-events-all']"
48
+ @click.stop=""
49
+ @mousedown.stop=""
50
+ @mouseup.stop=""
51
+ >
52
+ <template v-if="!!tx(message.title).value">
53
+ <CardItem variant="header" :class="[`theme-${message.theme}`, 'items-center', 'gap-1']">
54
+ <div class="HsUiToast-title">
55
+ {{ tx(message.title) }}
56
+ </div>
57
+ <Btn :class="closeBtnStyle" theme="white" variant="outlined" @click="removeMessage(message.key)">
58
+ <i class="fas fa-times" />
59
+ </Btn>
60
+ </CardItem>
61
+ <CardItem
62
+ v-if="!!tx(message.message).value"
63
+ :class="[`theme-${message.theme}`, ['items-overflow-visible']]"
64
+ >
65
+ <div class="HsUiToast-message">
66
+ {{ tx(message.message) }}
67
+ </div>
68
+ </CardItem>
69
+ <CardItem
70
+ v-if="message.hideAfter != 0"
71
+ :class="[`theme-${message.theme}`, ['overflow-visible', 'p-0', 'min-h-[8px]']]"
72
+ >
73
+ <div class="HsUiToast-bar-body" :class="[`${message.theme}`]">
74
+ <div class="HsUiToast-bar" :style="style(message)" />
75
+ </div>
76
+ </CardItem>
77
+ </template>
78
+ <template v-else>
79
+ <CardItem variant="header" :class="[`theme-${message.theme}`, 'items-center', 'gap-1']">
80
+ <div class="HsUiToast-message">
81
+ {{ tx(message.message) }}
82
+ </div>
83
+ <Btn :class="closeBtnStyle" theme="white" variant="outlined" @click="removeMessage(message.key)">
84
+ <i class="fas fa-times" />
85
+ </Btn>
86
+ </CardItem>
87
+ <CardItem
88
+ v-if="message.hideAfter != 0"
89
+ :class="[`theme-${message.theme}`, ['overflow-visible', 'p-0', 'min-h-[8px]']]"
90
+ >
91
+ <div class="HsUiToast-bar-body" :class="[`${message.theme}`]">
92
+ <div class="HsUiToast-bar" :style="style(message)" />
93
+ </div>
94
+ </CardItem>
95
+ </template>
96
+ </Card>
97
+ </div>
98
+ </TransitionGroup>
99
+ <div
100
+ v-if="state.pendingList.length > 5"
101
+ class="absolute right-[-50px] bottom-[-50px] z-10 pt-[10px] pr-[55px] pb-[55px] pl-[10px]"
102
+ >
103
+ <div class="absolute inset-0 blur-sm bg-white/60"></div>
104
+ <Btn
105
+ theme="accent1"
106
+ variant="outlined"
107
+ size="xs"
108
+ class="bg-white mb-1 w-[80px] blur-none pointer-events-auto"
109
+ @click="state.pendingList.length = 0"
110
+ >
111
+ Clear
112
+ </Btn>
113
+ </div>
114
+ </div>
115
+ </div>
116
+ </template>
117
+
182
118
  <style scoped>
119
+ @charset "UTF-8";
120
+ .list-move,
121
+ .list-enter-active,
122
+ .list-leave-active {
123
+ transition: all 0.5s ease;
124
+ }
125
+
126
+ .list-enter-from,
127
+ .list-leave-to {
128
+ opacity: 0;
129
+ transform: translateX(100%);
130
+ }
131
+
132
+ /* leave する項目をレイアウトフローから外すことで
133
+ アニメーションが正しく計算されるようになる */
134
+ .list-leave-active {
135
+ position: absolute;
136
+ z-index: -1;
137
+ transform: translateX(400%);
138
+ }
139
+
183
140
  .theme-success {
184
141
  background-color: #2bb60c !important;
185
142
  color: white !important;
@@ -218,47 +175,49 @@ const closeBtnStyle = [
218
175
  inset: 0 0 0 0;
219
176
  overflow: hidden;
220
177
  display: flex;
221
- justify-content: center;
178
+ justify-content: end;
179
+ align-items: end;
222
180
  }
223
181
 
224
182
  .HsUiToast-container {
225
183
  pointer-events: none;
226
184
  position: relative;
227
- overflow-x: hidden;
228
- overflow-y: auto;
229
- height: 100%;
230
- height: 100svh;
231
185
  max-height: 100%;
186
+ max-height: 100vh;
187
+ max-height: 100dvh;
232
188
  max-height: 100svh;
233
189
  display: flex;
234
190
  flex-direction: column;
235
- width: 800px;
236
- padding: 10px 20px;
191
+ max-width: 800px;
192
+ padding: 10px;
237
193
  }
238
194
  @media screen and (min-width: 0px) and (max-width: 399.9px) {
239
195
  .HsUiToast-container {
240
- width: 100%;
241
- padding: 5px 5px;
196
+ max-width: 100%;
197
+ max-width: 100vh;
198
+ max-width: 100dvh;
199
+ max-width: 100svh;
242
200
  }
243
201
  }
244
202
  @media screen and (min-width: 400px) and (max-width: 599.9px) {
245
203
  .HsUiToast-container {
246
- width: 380px;
204
+ max-width: 380px;
247
205
  }
248
206
  }
249
207
  @media screen and (min-width: 600px) and (max-width: 799.9px) {
250
208
  .HsUiToast-container {
251
- width: 550px;
209
+ max-width: 550px;
252
210
  }
253
211
  }
254
212
  @media screen and (min-width: 800px) and (max-width: 1199.9px) {
255
213
  .HsUiToast-container {
256
- width: 600px;
214
+ max-width: 600px;
257
215
  }
258
216
  }
259
217
 
260
218
  .HsUiToast {
261
219
  pointer-events: all;
220
+ min-width: 120px;
262
221
  }
263
222
 
264
223
  .HsUiToast-title {
@@ -324,16 +283,15 @@ const closeBtnStyle = [
324
283
  animation-timing-function: linear;
325
284
  animation-fill-mode: forwards;
326
285
  }
327
- </style>
328
-
329
- <style lang="scss">
330
- @keyframes HsUiToast-bar-key-frame {
331
- 0% {
332
- width: 0%;
333
- }
334
-
335
- 100% {
336
- width: 100%;
337
- }
338
- }
339
- </style>
286
+ </style>
287
+
288
+ <style>
289
+ @keyframes HsUiToast-bar-key-frame {
290
+ 0% {
291
+ width: 0%;
292
+ }
293
+ 100% {
294
+ width: 100%;
295
+ }
296
+ }
297
+ </style>
@@ -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,70 +1,50 @@
1
- <script setup lang="ts">
2
- /* ----------------------------------------------------------------------------
3
- // src\runtime\components\interactive\window-loader.vue
4
- // ----------------------------------------------------------------------------
5
- // WindowLoader
6
- // WindowLoaderWindowLoader
7
- ----------------------------------------------------------------------------- */
8
-
9
- /* ----------------------------------------------------------------------------
10
- const WindowLoader = useHsWindowLoader();
11
- WindowLoader.Show()
12
- WindowLoader.zindex=10000
13
- ----------------------------------------------------------------------------- */
14
-
15
- // [ vueuse ]
16
- import { useFocusTrap } from "@vueuse/integrations/useFocusTrap";
17
-
18
- // [ NUXT ]
19
- import { ref, watch } from "#imports";
20
- // [ composables ]
21
- import { useHsWindowLoader } from "../../composables/use-hs-window-loader";
22
- // ----------------------------------------------------------------------------
23
- const WindowLoader = useHsWindowLoader();
24
- // ----------------------------------------------------------------------------
25
- // [ focusTrap ]
26
- const focusTargetElm = ref<HTMLElement | null>(null);
27
- const { activate, deactivate } = useFocusTrap(focusTargetElm);
28
- watch(
29
- () => WindowLoader.state.show,
30
- (show) => {
31
- if (show) {
32
- activate();
33
- } else {
34
- deactivate();
35
- }
36
- }
37
- );
38
- // ----------------------------------------------------------------------------
39
- </script>
40
-
41
- <template>
42
- <div
43
- ref="focusTargetElm"
44
- class="HsUiWindowLoader"
45
- :class="{ show: WindowLoader.state.show }"
46
- :style="{ 'z-index': WindowLoader.state.zindex }"
47
- >
48
- <!-- -->
49
- <!-- -->
50
- <div class="HsUiWindowLoader-body">
51
- <div class="sk-cube-grid">
52
- <div class="sk-cube sk-cube1" />
53
- <div class="sk-cube sk-cube2" />
54
- <div class="sk-cube sk-cube3" />
55
- <div class="sk-cube sk-cube4" />
56
- <div class="sk-cube sk-cube5" />
57
- <div class="sk-cube sk-cube6" />
58
- <div class="sk-cube sk-cube7" />
59
- <div class="sk-cube sk-cube8" />
60
- <div class="sk-cube sk-cube9" />
61
- </div>
62
- <div class="HsUiWindowLoader-text">Please wait...</div>
63
- <input type="checkbox" class="dummy" />
64
- </div>
65
- </div>
66
- </template>
67
-
1
+ <script setup>
2
+ import { useFocusTrap } from "@vueuse/integrations/useFocusTrap";
3
+ import { ref, watch } from "#imports";
4
+ import { useHsWindowLoader } from "../../composables/use-hs-window-loader";
5
+ import { useHsPinia } from "../../composables/use-pinia";
6
+ const WindowLoader = useHsWindowLoader(useHsPinia());
7
+ const focusTargetElm = ref(null);
8
+ const { activate, deactivate } = useFocusTrap(focusTargetElm);
9
+ watch(
10
+ () => WindowLoader.state.show,
11
+ (show) => {
12
+ if (show) {
13
+ activate();
14
+ } else {
15
+ deactivate();
16
+ }
17
+ }
18
+ );
19
+ </script>
20
+
21
+ <template>
22
+ <div
23
+ ref="focusTargetElm"
24
+ class="HsUiWindowLoader"
25
+ :class="{ show: WindowLoader.state.show }"
26
+ :style="{ 'z-index': WindowLoader.state.zindex }"
27
+ >
28
+ <!-- -->
29
+ <!-- -->
30
+ <div class="HsUiWindowLoader-body">
31
+ <div class="sk-cube-grid">
32
+ <div class="sk-cube sk-cube1" />
33
+ <div class="sk-cube sk-cube2" />
34
+ <div class="sk-cube sk-cube3" />
35
+ <div class="sk-cube sk-cube4" />
36
+ <div class="sk-cube sk-cube5" />
37
+ <div class="sk-cube sk-cube6" />
38
+ <div class="sk-cube sk-cube7" />
39
+ <div class="sk-cube sk-cube8" />
40
+ <div class="sk-cube sk-cube9" />
41
+ </div>
42
+ <div class="HsUiWindowLoader-text">Please wait...</div>
43
+ <input type="checkbox" class="dummy" />
44
+ </div>
45
+ </div>
46
+ </template>
47
+
68
48
  <style scoped>
69
49
  .dummy {
70
50
  opacity: 0;
@@ -169,20 +149,17 @@ watch(
169
149
  -webkit-animation-delay: 0.2s;
170
150
  animation-delay: 0.2s;
171
151
  }
172
- </style>
173
-
174
- <style lang="scss">
175
- @keyframes HsUiWindowLoader-anime {
176
- 0%,
177
- 70%,
178
- 100% {
179
- -webkit-transform: scale3D(1, 1, 1);
180
- transform: scale3D(1, 1, 1);
181
- }
182
-
183
- 35% {
184
- -webkit-transform: scale3D(0, 0, 1);
185
- transform: scale3D(0, 0, 1);
186
- }
187
- }
188
- </style>
152
+ </style>
153
+
154
+ <style>
155
+ @keyframes HsUiWindowLoader-anime {
156
+ 0%, 70%, 100% {
157
+ -webkit-transform: scale3D(1, 1, 1);
158
+ transform: scale3D(1, 1, 1);
159
+ }
160
+ 35% {
161
+ -webkit-transform: scale3D(0, 0, 1);
162
+ transform: scale3D(0, 0, 1);
163
+ }
164
+ }
165
+ </style>
@@ -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;
@@ -0,0 +1,72 @@
1
+ <script setup>
2
+ import { computed, ref, watch, nextTick } from "#imports";
3
+ import { twMerge } from "tailwind-merge";
4
+ import { ClassTypeToString } from "../../utils/class-style";
5
+ const props = defineProps({
6
+ class: { type: [String, Object, Array], required: false, default: "" },
7
+ open: { type: Boolean, required: true },
8
+ span: { type: Number, required: false, default: 300 }
9
+ });
10
+ const emit = defineEmits(["closed"]);
11
+ const innerHidden = ref(!props.open);
12
+ watch(
13
+ () => props.open,
14
+ async () => {
15
+ if (props.open) {
16
+ innerHidden.value = false;
17
+ } else {
18
+ await nextTick();
19
+ setTimeout(() => {
20
+ if (props.open) {
21
+ innerHidden.value = false;
22
+ } else {
23
+ innerHidden.value = true;
24
+ emit("closed");
25
+ }
26
+ }, props.span);
27
+ }
28
+ }
29
+ );
30
+ const classStyle = computed(() => {
31
+ return twMerge([props.open ? "open" : ""], ClassTypeToString(props.class));
32
+ });
33
+ </script>
34
+
35
+ <template>
36
+ <div
37
+ v-if="!innerHidden"
38
+ class="Accordion"
39
+ :class="[props.open ? 'open' : '', classStyle]"
40
+ :style="`--hsui-accordion-span:${props.span}ms`"
41
+ :inert="!props.open"
42
+ >
43
+ <div class="Accordion__inner" :class="{ hidden: innerHidden }">
44
+ <slot />
45
+ </div>
46
+ </div>
47
+ </template>
48
+
49
+ <style scoped>
50
+ .Accordion {
51
+ overflow: hidden;
52
+ display: flex;
53
+ flex-direction: column;
54
+ }
55
+
56
+ .Accordion__inner {
57
+ transform-origin: bottom;
58
+ transition: transform var(--hsui-accordion-span) ease, opacity var(--hsui-accordion-span) ease;
59
+ transform: scaleY(0);
60
+ opacity: 0;
61
+ will-change: transform, opacity;
62
+ }
63
+ .Accordion__inner.hidden {
64
+ display: none;
65
+ }
66
+
67
+ .Accordion.open .Accordion__inner {
68
+ transform: scaleY(1);
69
+ opacity: 1;
70
+ display: block;
71
+ }
72
+ </style>