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,590 +1,744 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
|
|
26
|
-
import
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
type
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
const
|
|
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
|
-
const
|
|
192
|
-
|
|
193
|
-
if (
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
);
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
);
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
if (
|
|
307
|
-
if (
|
|
308
|
-
if (focusState.
|
|
309
|
-
if (focusState.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
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
|
-
|
|
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
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
<
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import {
|
|
3
|
+
reactive,
|
|
4
|
+
ref,
|
|
5
|
+
watch,
|
|
6
|
+
computed,
|
|
7
|
+
useId,
|
|
8
|
+
defineShortcuts,
|
|
9
|
+
nextTick,
|
|
10
|
+
onMounted,
|
|
11
|
+
useTemplateRef
|
|
12
|
+
} from "#imports";
|
|
13
|
+
import { ObjectCopy } from "../../utils/object";
|
|
14
|
+
import { InitModalControl, InitModals } from "../../utils/modal";
|
|
15
|
+
import { useHsFocus } from "../../composables/use-hs-focus";
|
|
16
|
+
import { useHsPinia } from "../../composables/use-pinia";
|
|
17
|
+
import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
|
|
18
|
+
import { useHsScrollLock } from "../../composables/use-hs-scroll-lock";
|
|
19
|
+
import { useHsMisc } from "../../composables/use-hs-misc";
|
|
20
|
+
import InputFrame from "./input-frame.vue";
|
|
21
|
+
import Btn from "../form/btn.vue";
|
|
22
|
+
import SelectHiddenItemToggle from "./_select/hidden-item-toggle.vue";
|
|
23
|
+
import { useHsIsMobile } from "../../composables/use-hs-is-mobile";
|
|
24
|
+
import TextBox from "../form/text-box.vue";
|
|
25
|
+
import SelectItemContainer from "./_select/item-container.vue";
|
|
26
|
+
import ViewSelectItemRow from "./_select/item-row.vue";
|
|
27
|
+
const props = defineProps({
|
|
28
|
+
list: { type: Array, required: true },
|
|
29
|
+
order: { type: Boolean, required: false, default: false },
|
|
30
|
+
loading: { type: Boolean, required: false, default: false },
|
|
31
|
+
nullText: { type: [String, Object], required: false, default: () => ({ ja: "\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044", en: "Select..." }) },
|
|
32
|
+
unknownText: { type: [String, Object], required: false, default: () => ({
|
|
33
|
+
ja: "\u7121\u52B9\u306A\u9078\u629E\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059",
|
|
34
|
+
en: "An invalid selection has been made"
|
|
35
|
+
}) },
|
|
36
|
+
img: { type: Boolean, required: false },
|
|
37
|
+
imgMode: { type: String, required: false, default: "contain" },
|
|
38
|
+
classImg: { type: [String, Object, Array], required: false, default: "" },
|
|
39
|
+
classImgTag: { type: [String, Object, Array], required: false, default: "" },
|
|
40
|
+
nullable: { type: Boolean, required: false, default: false },
|
|
41
|
+
searchable: { type: Boolean, required: false },
|
|
42
|
+
class: { type: [String, Object, Array], required: false, default: "" },
|
|
43
|
+
classHeader: { type: [String, Object, Array], required: false, default: "" },
|
|
44
|
+
classInput: { type: [String, Object, Array], required: false, default: "" },
|
|
45
|
+
data: { type: null, required: true },
|
|
46
|
+
diff: { type: null, required: false, default: void 0 },
|
|
47
|
+
tabindex: { type: null, required: false, default: void 0 },
|
|
48
|
+
focusColor: { type: String, required: false, default: "shadow-[inset_0px_0px_1px_2px_#0d8ee4]" },
|
|
49
|
+
changeColor: { type: String, required: false, default: "shadow-[inset_0px_0px_1px_2px_#fd9831be]" },
|
|
50
|
+
error: { type: Boolean, required: false, default: false },
|
|
51
|
+
errorColor: { type: String, required: false, default: "shadow-[inset_0px_0px_1px_2px_#d80000dc]" },
|
|
52
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
53
|
+
disabledColor: { type: String, required: false, default: "" },
|
|
54
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
55
|
+
headerless: { type: Boolean, required: false, default: false },
|
|
56
|
+
label: { type: [String, Object], required: false, default: "" },
|
|
57
|
+
require: { type: Boolean, required: false, default: false },
|
|
58
|
+
requireText: { type: [String, Object], required: false, default: () => ({ ja: "\u5FC5\u9808", en: "Required" }) },
|
|
59
|
+
warn: { type: String, required: false, default: "" },
|
|
60
|
+
warnTimeOut: { type: Number, required: false, default: 3e3 },
|
|
61
|
+
size: { type: String, required: false, default: "m" }
|
|
62
|
+
});
|
|
63
|
+
const emit = defineEmits(["update:data", "value-change", "focus", "blur"]);
|
|
64
|
+
const slots = defineSlots();
|
|
65
|
+
const multiLang = useHsMultiLang(useHsPinia());
|
|
66
|
+
const tx = multiLang.tx;
|
|
67
|
+
const gt = multiLang.gt;
|
|
68
|
+
const hsFocus = useHsFocus(useHsPinia());
|
|
69
|
+
const hsIsMobile = useHsIsMobile(useHsPinia());
|
|
70
|
+
const hsMisc = useHsMisc(useHsPinia());
|
|
71
|
+
onMounted(() => {
|
|
72
|
+
hsIsMobile.init();
|
|
73
|
+
});
|
|
74
|
+
const uid = useId();
|
|
75
|
+
const inputFrameElm = ref();
|
|
76
|
+
const searchWord = ref("");
|
|
77
|
+
const selectOpen = ref(false);
|
|
78
|
+
const openToggle = () => {
|
|
79
|
+
if (selectOpen.value || modal.sp.isShow) {
|
|
80
|
+
selectOpen.value = false;
|
|
81
|
+
modal.sp.close();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (props.disabled) return;
|
|
85
|
+
if (props.readonly) return;
|
|
86
|
+
if (props.searchable && hsIsMobile.isMobile) {
|
|
87
|
+
modal.sp.show();
|
|
88
|
+
} else {
|
|
89
|
+
selectOpen.value = true;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const lock = computed(() => {
|
|
93
|
+
return props.disabled || props.readonly;
|
|
94
|
+
});
|
|
95
|
+
const activeValue = ref(props.data);
|
|
96
|
+
watch(
|
|
97
|
+
() => props.data,
|
|
98
|
+
() => {
|
|
99
|
+
activeValue.value = props.data;
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
let versionCounter = 0;
|
|
103
|
+
const nullItem = computed(() => {
|
|
104
|
+
return { id: null, text: props.nullText };
|
|
105
|
+
});
|
|
106
|
+
const listBase = computed(() => {
|
|
107
|
+
versionCounter++;
|
|
108
|
+
const ret = ObjectCopy(
|
|
109
|
+
props.list.map((row) => {
|
|
110
|
+
return {
|
|
111
|
+
...row,
|
|
112
|
+
text: gt(row.text) || "",
|
|
113
|
+
_key: `${row.id}:${versionCounter ?? 0}`
|
|
114
|
+
};
|
|
115
|
+
})
|
|
116
|
+
);
|
|
117
|
+
if (props.nullable) {
|
|
118
|
+
ret.unshift(nullItem.value);
|
|
119
|
+
}
|
|
120
|
+
return ret;
|
|
121
|
+
});
|
|
122
|
+
const hasLabel = computed(() => {
|
|
123
|
+
return !!props.list.find((row) => !!row.groupId);
|
|
124
|
+
});
|
|
125
|
+
const activeRow = computed(() => {
|
|
126
|
+
return listBase.value.find((row) => row.id === activeValue.value) || null;
|
|
127
|
+
});
|
|
128
|
+
const diffDisplayText = computed(() => {
|
|
129
|
+
if (!props.diff) return "";
|
|
130
|
+
const data = listBase.value.find((row) => row.id === props.diff) || null;
|
|
131
|
+
if (!data) return props.nullText;
|
|
132
|
+
return tx(data.text).value;
|
|
133
|
+
});
|
|
134
|
+
const hiddenItemVisible = ref(false);
|
|
135
|
+
const hasHiddenItem = computed(() => {
|
|
136
|
+
return props.list.filter((row) => {
|
|
137
|
+
if (row.deleted) return false;
|
|
138
|
+
if (row.hidden) return true;
|
|
139
|
+
return false;
|
|
140
|
+
}).length !== 0;
|
|
141
|
+
});
|
|
142
|
+
const updateData = (value) => {
|
|
143
|
+
if (props.disabled === true) return false;
|
|
144
|
+
if (props.readonly === true) return false;
|
|
145
|
+
const before = props.data;
|
|
146
|
+
if (!value) {
|
|
147
|
+
if (!props.nullable) return;
|
|
148
|
+
emit("update:data", value);
|
|
149
|
+
emit("value-change", value, before);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
emit("update:data", value);
|
|
153
|
+
emit("value-change", value, before);
|
|
154
|
+
};
|
|
155
|
+
const displayList = computed(() => {
|
|
156
|
+
const ret = listBase.value.filter((row) => {
|
|
157
|
+
if (row.id === props.data) return true;
|
|
158
|
+
if (row.deleted) return false;
|
|
159
|
+
if (!hiddenItemVisible.value && row.hidden) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
return true;
|
|
163
|
+
}).sort((a, b) => {
|
|
164
|
+
if (a.order === void 0 || b.order === void 0) return 0;
|
|
165
|
+
if (a.order < b.order) return -1;
|
|
166
|
+
if (a.order > b.order) return 1;
|
|
167
|
+
return 0;
|
|
168
|
+
});
|
|
169
|
+
return ret;
|
|
170
|
+
});
|
|
171
|
+
const isChangeData = computed(() => {
|
|
172
|
+
if (props.diff === void 0) return false;
|
|
173
|
+
if (props.diff !== props.data) return true;
|
|
174
|
+
return false;
|
|
175
|
+
});
|
|
176
|
+
const focusState = reactive({
|
|
177
|
+
isActivate: false,
|
|
178
|
+
openActual: false
|
|
179
|
+
});
|
|
180
|
+
const onFocus = () => {
|
|
181
|
+
if (props.disabled === true) return;
|
|
182
|
+
if (props.readonly === true) return;
|
|
183
|
+
focusState.isActivate = true;
|
|
184
|
+
if (hsFocus.state.id !== uid) {
|
|
185
|
+
hsFocus.state.id = uid;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
const onBlur = () => {
|
|
189
|
+
focusState.isActivate = false;
|
|
190
|
+
};
|
|
191
|
+
const focusId = computed(() => hsFocus.state.id);
|
|
192
|
+
watch(focusId, () => {
|
|
193
|
+
if (hsFocus.state.id !== uid) {
|
|
194
|
+
focusState.openActual = false;
|
|
195
|
+
selectOpen.value = false;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
watch(selectOpen, (v) => {
|
|
199
|
+
if (!v) {
|
|
200
|
+
setTimeout(() => {
|
|
201
|
+
focusState.openActual = false;
|
|
202
|
+
}, 300);
|
|
203
|
+
} else {
|
|
204
|
+
focusState.openActual = true;
|
|
205
|
+
if (hsFocus.state.id !== uid) {
|
|
206
|
+
hsFocus.state.id = uid;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
defineShortcuts({
|
|
211
|
+
delete: {
|
|
212
|
+
// 入力フォーカス中でも発火させたいなら true(環境によっては省略でOK)
|
|
213
|
+
usingInput: false,
|
|
214
|
+
handler: (e) => {
|
|
215
|
+
if (selectOpen.value) return;
|
|
216
|
+
if (!focusState.isActivate) return;
|
|
217
|
+
e.preventDefault();
|
|
218
|
+
updateData(null);
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
backspace: {
|
|
222
|
+
usingInput: false,
|
|
223
|
+
handler: (e) => {
|
|
224
|
+
if (selectOpen.value) return;
|
|
225
|
+
if (!focusState.isActivate) return;
|
|
226
|
+
e.preventDefault();
|
|
227
|
+
updateData(null);
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
enter: {
|
|
231
|
+
usingInput: false,
|
|
232
|
+
handler: () => {
|
|
233
|
+
if (selectOpen.value) return;
|
|
234
|
+
if (!focusState.isActivate) return;
|
|
235
|
+
selectOpen.value = !selectOpen.value;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
const content = {
|
|
240
|
+
disableOutsidePointerEvents: true,
|
|
241
|
+
bodyLock: false
|
|
242
|
+
};
|
|
243
|
+
const uiBase = [
|
|
244
|
+
"bg-transparent",
|
|
245
|
+
"max-w-full text-left",
|
|
246
|
+
"focus-visible:outline-none focus:outline-none ring-0 focus:ring-0",
|
|
247
|
+
"py-0 pr-[10px]",
|
|
248
|
+
"focus-visible:ring-0 "
|
|
249
|
+
];
|
|
250
|
+
const modal = reactive({
|
|
251
|
+
sp: InitModalControl()
|
|
252
|
+
});
|
|
253
|
+
onMounted(() => InitModals(modal, nextTick));
|
|
254
|
+
const modalSpScrollTop = () => {
|
|
255
|
+
if (!modalSpScrollTopTarget.value) return;
|
|
256
|
+
modalSpScrollTopTarget.value?.scrollIntoView();
|
|
257
|
+
};
|
|
258
|
+
modal.sp.showBefore = async () => {
|
|
259
|
+
if (!activeValue.value) return modalSpScrollTop();
|
|
260
|
+
const target = spFilterList.value.find((row) => row.id === activeValue.value);
|
|
261
|
+
if (target === void 0 || !target.html) return modalSpScrollTop();
|
|
262
|
+
target.html.scrollIntoView();
|
|
263
|
+
};
|
|
264
|
+
const modalSpScrollTopTarget = useTemplateRef("modalSpScrollTopTarget");
|
|
265
|
+
const scrollLock = useHsScrollLock();
|
|
266
|
+
const modalElm = useTemplateRef("modalElm");
|
|
267
|
+
watch(modalElm, (elm) => {
|
|
268
|
+
if (elm !== null) scrollLock.init(elm);
|
|
269
|
+
});
|
|
270
|
+
watch(
|
|
271
|
+
() => modal.sp.isShow,
|
|
272
|
+
(v) => {
|
|
273
|
+
if (v) {
|
|
274
|
+
scrollLock.lock();
|
|
275
|
+
} else {
|
|
276
|
+
scrollLock.unlock();
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
);
|
|
280
|
+
const showSpModal = () => {
|
|
281
|
+
if (props.disabled) return;
|
|
282
|
+
if (props.readonly) return;
|
|
283
|
+
modal.sp.show();
|
|
284
|
+
};
|
|
285
|
+
const norm = (s) => {
|
|
286
|
+
return s.normalize("NFKC");
|
|
287
|
+
};
|
|
288
|
+
const spFilterList = computed(() => {
|
|
289
|
+
return displayList.value.filter((row) => {
|
|
290
|
+
if (!searchWord.value) return true;
|
|
291
|
+
if (norm(row.text).toLocaleLowerCase().includes(norm(searchWord.value).toLocaleLowerCase())) {
|
|
292
|
+
return true;
|
|
293
|
+
}
|
|
294
|
+
return false;
|
|
295
|
+
}).map((row) => {
|
|
296
|
+
return {
|
|
297
|
+
...row,
|
|
298
|
+
html: null
|
|
299
|
+
};
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
const computedActivate = computed(() => {
|
|
303
|
+
if (props.disabled === true) return false;
|
|
304
|
+
if (props.readonly === true) return false;
|
|
305
|
+
if (selectOpen.value) return true;
|
|
306
|
+
if (modal.sp.isShow) return true;
|
|
307
|
+
if (hsFocus.state.id !== uid) return false;
|
|
308
|
+
if (focusState.openActual) return true;
|
|
309
|
+
if (focusState.isActivate) return true;
|
|
310
|
+
return false;
|
|
311
|
+
});
|
|
312
|
+
watch(computedActivate, (value) => {
|
|
313
|
+
if (value === true) {
|
|
314
|
+
setTimeout(() => {
|
|
315
|
+
emit("focus");
|
|
316
|
+
}, 10);
|
|
317
|
+
} else {
|
|
318
|
+
emit("blur");
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
</script>
|
|
322
|
+
|
|
323
|
+
<template>
|
|
324
|
+
<InputFrame
|
|
325
|
+
:class="['HsSelect', props.class]"
|
|
326
|
+
:class-header="props.classHeader"
|
|
327
|
+
:class-input="[' px-0 flex items-center flex-1', props.classInput]"
|
|
328
|
+
:focus="computedActivate"
|
|
329
|
+
:focus-color="props.focusColor"
|
|
330
|
+
:change="isChangeData"
|
|
331
|
+
:change-color="props.changeColor"
|
|
332
|
+
:error="props.error"
|
|
333
|
+
:error-color="props.errorColor"
|
|
334
|
+
:disabled="props.disabled"
|
|
335
|
+
:disabled-color="props.disabledColor"
|
|
336
|
+
:readonly="props.readonly"
|
|
337
|
+
:label="props.label"
|
|
338
|
+
:require="props.require"
|
|
339
|
+
:require-text="tx(props.requireText).value"
|
|
340
|
+
:warn="props.warn"
|
|
341
|
+
:warn-time-out="props.warnTimeOut"
|
|
342
|
+
:size="props.size"
|
|
343
|
+
:headerless="props.headerless"
|
|
344
|
+
@focusin="onFocus"
|
|
345
|
+
@focusout="onBlur"
|
|
346
|
+
@ref="(e) => inputFrameElm = e"
|
|
347
|
+
@click="openToggle()"
|
|
348
|
+
>
|
|
349
|
+
<template #overlay="{ focus, change }">
|
|
350
|
+
<div
|
|
351
|
+
v-if="props.diff !== void 0 && change"
|
|
352
|
+
class="absolute inset-0 bg-red/30 transition-opacity flex items-center p-1 bg-dark/20"
|
|
353
|
+
:class="!focus && hsMisc.capsLockState ? 'opacity-100' : 'opacity-0 pointer-events-none select-none'"
|
|
354
|
+
>
|
|
355
|
+
<div class="flex" @mousedown.prevent @click.prevent>
|
|
356
|
+
<Btn
|
|
357
|
+
variant="outlined"
|
|
358
|
+
theme="error"
|
|
359
|
+
tabindex="-1"
|
|
360
|
+
size="xs"
|
|
361
|
+
class="bg-white flex-none"
|
|
362
|
+
@click.stop="updateData(props.diff)"
|
|
363
|
+
>
|
|
364
|
+
<i class="fa-solid fa-rotate-right"></i>
|
|
365
|
+
</Btn>
|
|
366
|
+
<div v-if="props.diff" class="px-1 truncate bg-white mx-1 flex items-center select-none" @click.stop>
|
|
367
|
+
{{ diffDisplayText }}
|
|
368
|
+
</div>
|
|
369
|
+
</div>
|
|
370
|
+
</div>
|
|
371
|
+
<template v-if="slots.overlay">
|
|
372
|
+
<slot name="overlay" :focus="focus" :change="change"></slot>
|
|
373
|
+
</template>
|
|
374
|
+
</template>
|
|
375
|
+
<template v-if="slots['left-icons']" #left-icons>
|
|
376
|
+
<slot name="left-icons" :disabled="disabled" />
|
|
377
|
+
</template>
|
|
378
|
+
<template #right-icons>
|
|
379
|
+
<Btn
|
|
380
|
+
v-if="!lock && props.nullable && props.data !== null"
|
|
381
|
+
variant="text"
|
|
382
|
+
theme="error"
|
|
383
|
+
tabindex="-1"
|
|
384
|
+
class="text-error w-[1.4em] hover:bg-accent1/10 mr-1"
|
|
385
|
+
@click.stop="updateData(null)"
|
|
386
|
+
>
|
|
387
|
+
<i class="fa-solid fa-xmark"></i>
|
|
388
|
+
</Btn>
|
|
389
|
+
<Btn
|
|
390
|
+
v-if="!lock"
|
|
391
|
+
variant="text"
|
|
392
|
+
theme="accent1"
|
|
393
|
+
tabindex="-1"
|
|
394
|
+
class="text-accent1 w-[1.4em] hover:bg-accent1/10 mr-1"
|
|
395
|
+
@click.stop="openToggle()"
|
|
396
|
+
>
|
|
397
|
+
<i class="fa-solid fa-chevron-down transition-all" :class="[selectOpen ? 'rotate-x-180' : '']"></i>
|
|
398
|
+
</Btn>
|
|
399
|
+
<slot name="right-icons" :disabled="disabled" />
|
|
400
|
+
</template>
|
|
401
|
+
<template v-if="slots['label-prepend']" #label-prepend>
|
|
402
|
+
<slot name="label-prepend" />
|
|
403
|
+
</template>
|
|
404
|
+
<template v-if="slots['label-append']" #label-append>
|
|
405
|
+
<slot name="label-append" />
|
|
406
|
+
</template>
|
|
407
|
+
<template v-if="slots['header-right']" #header-right>
|
|
408
|
+
<slot name="header-right" />
|
|
409
|
+
</template>
|
|
410
|
+
<template #default>
|
|
411
|
+
<template v-if="!props.searchable">
|
|
412
|
+
<USelect
|
|
413
|
+
v-model:open="selectOpen"
|
|
414
|
+
:model-value="activeValue"
|
|
415
|
+
:items="displayList"
|
|
416
|
+
value-key="id"
|
|
417
|
+
label-key="text"
|
|
418
|
+
class="w-full"
|
|
419
|
+
:trailing="false"
|
|
420
|
+
trailing-icon=""
|
|
421
|
+
:ui="{
|
|
422
|
+
base: uiBase,
|
|
423
|
+
item: ['!bg-white focus:bg-white active:bg-white p-0']
|
|
424
|
+
}"
|
|
425
|
+
:content="{
|
|
426
|
+
reference: inputFrameElm,
|
|
427
|
+
...content
|
|
428
|
+
}"
|
|
429
|
+
:disabled="lock"
|
|
430
|
+
:close-on-select="false"
|
|
431
|
+
@update:model-value="(v) => updateData(v)"
|
|
432
|
+
>
|
|
433
|
+
<template #default>
|
|
434
|
+
<div
|
|
435
|
+
class="flex items-center w-full"
|
|
436
|
+
:class="[
|
|
437
|
+
props.disabled ? 'cursor-not-allowed' : '',
|
|
438
|
+
//
|
|
439
|
+
props.readonly ? 'cursor-text' : '',
|
|
440
|
+
//
|
|
441
|
+
!lock ? 'cursor-pointer' : ''
|
|
442
|
+
//
|
|
443
|
+
]"
|
|
444
|
+
@click.stop="openToggle()"
|
|
445
|
+
>
|
|
446
|
+
<template v-if="activeRow">
|
|
447
|
+
<SelectItemContainer
|
|
448
|
+
:item="activeRow"
|
|
449
|
+
:value="activeValue"
|
|
450
|
+
:img="props.img"
|
|
451
|
+
:activated="props.img"
|
|
452
|
+
:class-img="props.classImg"
|
|
453
|
+
:class-img-tag="props.classImgTag"
|
|
454
|
+
:img-mode="props.imgMode"
|
|
455
|
+
:disabled="props.disabled"
|
|
456
|
+
:readonly="props.readonly"
|
|
457
|
+
type="display"
|
|
458
|
+
/>
|
|
459
|
+
</template>
|
|
460
|
+
<template v-else-if="!!props.data">
|
|
461
|
+
<div class="min-w-0 truncate flex-1 text-[1rem]" :class="[!props.disabled ? 'text-error' : '']">
|
|
462
|
+
{{ tx(props.unknownText) }}
|
|
463
|
+
</div>
|
|
464
|
+
</template>
|
|
465
|
+
<template v-else>
|
|
466
|
+
<div class="min-w-0 truncate flex-1 text-[1rem]" :class="[!props.disabled ? 'text-gray-700' : '']">
|
|
467
|
+
{{ tx(props.nullText) }}
|
|
468
|
+
</div>
|
|
469
|
+
</template>
|
|
470
|
+
</div>
|
|
471
|
+
</template>
|
|
472
|
+
<template #trailing>
|
|
473
|
+
<div></div>
|
|
474
|
+
</template>
|
|
475
|
+
<template #item="{ item, index }">
|
|
476
|
+
<ViewSelectItemRow
|
|
477
|
+
:list="displayList"
|
|
478
|
+
:item="item"
|
|
479
|
+
:index="index"
|
|
480
|
+
:active-id="activeValue"
|
|
481
|
+
:has-label="hasLabel"
|
|
482
|
+
:img="props.img"
|
|
483
|
+
:class-img="props.classImg"
|
|
484
|
+
:class-img-tag="props.classImgTag"
|
|
485
|
+
:img-mode="props.imgMode"
|
|
486
|
+
:disabled="props.disabled"
|
|
487
|
+
:readonly="props.readonly"
|
|
488
|
+
/>
|
|
489
|
+
</template>
|
|
490
|
+
<template v-if="hasHiddenItem" #content-bottom>
|
|
491
|
+
<div class="p-1">
|
|
492
|
+
<SelectHiddenItemToggle v-model:hidden-item-visible="hiddenItemVisible" />
|
|
493
|
+
</div>
|
|
494
|
+
</template>
|
|
495
|
+
</USelect>
|
|
496
|
+
</template>
|
|
497
|
+
<template v-else-if="props.searchable && !hsIsMobile.isMobile">
|
|
498
|
+
<USelectMenu
|
|
499
|
+
v-model:serach-term="searchWord"
|
|
500
|
+
v-model:open="selectOpen"
|
|
501
|
+
:model-value="activeValue"
|
|
502
|
+
:items="displayList"
|
|
503
|
+
value-key="id"
|
|
504
|
+
label-key="text"
|
|
505
|
+
class="w-full"
|
|
506
|
+
:trailing="false"
|
|
507
|
+
trailing-icon=""
|
|
508
|
+
:ui="{
|
|
509
|
+
base: uiBase,
|
|
510
|
+
item: ['!bg-white focus:bg-white active:bg-white p-0']
|
|
511
|
+
}"
|
|
512
|
+
:content="{
|
|
513
|
+
reference: inputFrameElm,
|
|
514
|
+
...content
|
|
515
|
+
}"
|
|
516
|
+
:disabled="lock"
|
|
517
|
+
:close-on-select="false"
|
|
518
|
+
@update:model-value="(v) => updateData(v)"
|
|
519
|
+
>
|
|
520
|
+
<template #default>
|
|
521
|
+
<div
|
|
522
|
+
:key="activeRow?._key || 'null-_base'"
|
|
523
|
+
class="flex items-center w-full"
|
|
524
|
+
:class="[
|
|
525
|
+
props.disabled ? 'cursor-not-allowed' : '',
|
|
526
|
+
//
|
|
527
|
+
props.readonly ? 'cursor-text' : '',
|
|
528
|
+
//
|
|
529
|
+
!lock ? 'cursor-pointer' : ''
|
|
530
|
+
//
|
|
531
|
+
]"
|
|
532
|
+
@click.stop="openToggle()"
|
|
533
|
+
>
|
|
534
|
+
<template v-if="activeRow">
|
|
535
|
+
<SelectItemContainer
|
|
536
|
+
:item="activeRow"
|
|
537
|
+
:value="activeValue"
|
|
538
|
+
:img="props.img"
|
|
539
|
+
:activated="props.img"
|
|
540
|
+
:class-img="props.classImg"
|
|
541
|
+
:class-img-tag="props.classImgTag"
|
|
542
|
+
:img-mode="props.imgMode"
|
|
543
|
+
:disabled="props.disabled"
|
|
544
|
+
:readonly="props.readonly"
|
|
545
|
+
type="display"
|
|
546
|
+
/>
|
|
547
|
+
</template>
|
|
548
|
+
<template v-else-if="!!props.data">
|
|
549
|
+
<div class="min-w-0 truncate flex-1 text-[1rem]" :class="[!props.disabled ? 'text-error' : '']">
|
|
550
|
+
{{ tx(props.unknownText) }}
|
|
551
|
+
</div>
|
|
552
|
+
</template>
|
|
553
|
+
<template v-else>
|
|
554
|
+
<div class="min-w-0 truncate flex-1" :class="[!props.disabled ? 'text-gray-700' : '']">
|
|
555
|
+
{{ tx(props.nullText) }}
|
|
556
|
+
</div>
|
|
557
|
+
</template>
|
|
558
|
+
</div>
|
|
559
|
+
</template>
|
|
560
|
+
<template #trailing>
|
|
561
|
+
<div></div>
|
|
562
|
+
</template>
|
|
563
|
+
<template #item="{ item, index }">
|
|
564
|
+
<ViewSelectItemRow
|
|
565
|
+
:key="item.id"
|
|
566
|
+
:list="displayList"
|
|
567
|
+
:item="item"
|
|
568
|
+
:index="index"
|
|
569
|
+
:active-id="activeValue"
|
|
570
|
+
:has-label="hasLabel"
|
|
571
|
+
:img="props.img"
|
|
572
|
+
:class-img="props.classImg"
|
|
573
|
+
:class-img-tag="props.classImgTag"
|
|
574
|
+
:img-mode="props.imgMode"
|
|
575
|
+
:disabled="props.disabled"
|
|
576
|
+
:readonly="props.readonly"
|
|
577
|
+
/>
|
|
578
|
+
</template>
|
|
579
|
+
<template v-if="hasHiddenItem" #content-bottom>
|
|
580
|
+
<div class="p-1">
|
|
581
|
+
<SelectHiddenItemToggle v-model:hidden-item-visible="hiddenItemVisible" />
|
|
582
|
+
</div>
|
|
583
|
+
</template>
|
|
584
|
+
</USelectMenu>
|
|
585
|
+
</template>
|
|
586
|
+
<template v-else>
|
|
587
|
+
<div
|
|
588
|
+
:key="activeRow?._key || 'null-_base'"
|
|
589
|
+
class="flex items-center w-full px-2.5 text-neutral-900"
|
|
590
|
+
:class="[
|
|
591
|
+
props.disabled ? 'cursor-not-allowed' : '',
|
|
592
|
+
//
|
|
593
|
+
props.readonly ? 'cursor-text' : '',
|
|
594
|
+
//
|
|
595
|
+
!lock ? 'cursor-pointer' : ''
|
|
596
|
+
//
|
|
597
|
+
]"
|
|
598
|
+
@click.stop="showSpModal()"
|
|
599
|
+
>
|
|
600
|
+
<template v-if="activeRow">
|
|
601
|
+
<SelectItemContainer
|
|
602
|
+
:item="activeRow"
|
|
603
|
+
:value="activeValue"
|
|
604
|
+
:img="props.img"
|
|
605
|
+
:activated="props.img"
|
|
606
|
+
:class-img="props.classImg"
|
|
607
|
+
:class-img-tag="props.classImgTag"
|
|
608
|
+
:img-mode="props.imgMode"
|
|
609
|
+
:disabled="props.disabled"
|
|
610
|
+
:readonly="props.readonly"
|
|
611
|
+
type="display"
|
|
612
|
+
/>
|
|
613
|
+
</template>
|
|
614
|
+
<template v-else-if="!!props.data">
|
|
615
|
+
<div class="min-w-0 truncate flex-1 text-[1rem]" :class="[!props.disabled ? 'text-error' : '']">
|
|
616
|
+
{{ tx(props.unknownText) }}
|
|
617
|
+
</div>
|
|
618
|
+
</template>
|
|
619
|
+
<template v-else>
|
|
620
|
+
<div class="min-w-0 truncate flex-1" :class="[!props.disabled ? 'text-gray-700' : '']">
|
|
621
|
+
{{ tx(props.nullText) }}
|
|
622
|
+
</div>
|
|
623
|
+
</template>
|
|
624
|
+
</div>
|
|
625
|
+
<Modal
|
|
626
|
+
:show="modal.sp.isShow"
|
|
627
|
+
closeable
|
|
628
|
+
@close="modal.sp.close();
|
|
629
|
+
selectOpen = false"
|
|
630
|
+
>
|
|
631
|
+
<Card ref="modalElm" class="HsSelectModal w-full max-w-125 max-h-full">
|
|
632
|
+
<CardItem variant="header" size="s" cross @update:open="modal.sp.close()">
|
|
633
|
+
<div>
|
|
634
|
+
{{ tx(props.label || { ja: "\u9078\u629E", en: "Please Select" }) }}
|
|
635
|
+
</div>
|
|
636
|
+
</CardItem>
|
|
637
|
+
<CardItem variant="body">
|
|
638
|
+
<div class="text-[14px] text-gray-600 leading-[1em] mb-1">{{ tx({ ja: "\u691C\u7D22", en: "Search" }) }}</div>
|
|
639
|
+
<TextBox v-model:data="searchWord" size="m" />
|
|
640
|
+
</CardItem>
|
|
641
|
+
<CardItem variant="body">
|
|
642
|
+
<div class="h-px w-full bg-main0/50"></div>
|
|
643
|
+
</CardItem>
|
|
644
|
+
<CardItem variant="body" scroll>
|
|
645
|
+
<div ref="modalSpScrollTopTarget" class="grid gap-1">
|
|
646
|
+
<template v-for="(row, index) in spFilterList" :key="index">
|
|
647
|
+
<div
|
|
648
|
+
v-if="
|
|
649
|
+
row.groupId !== void 0 && (index === 0 || spFilterList[index - 1]?.groupId !== row.groupId)
|
|
650
|
+
"
|
|
651
|
+
class="mt-1 py-1 px-2 font-semibold bg-dark/5 border-dark/40 border"
|
|
652
|
+
:class="index !== 0 ? 'mt-2' : ''"
|
|
653
|
+
>
|
|
654
|
+
{{ tx(row.groupLabel ?? "") }}
|
|
655
|
+
</div>
|
|
656
|
+
<div
|
|
657
|
+
:ref="(e) => row.html = e"
|
|
658
|
+
class="cursor-pointerw-full text-neutral-900 border rounded bg-white overflow-hidden"
|
|
659
|
+
:class="[
|
|
660
|
+
row.id === activeValue ? 'border-accent1' : 'border-black/20',
|
|
661
|
+
row.id !== null && hasLabel ? 'ml-2' : ''
|
|
662
|
+
]"
|
|
663
|
+
@click="updateData(row.id);
|
|
664
|
+
modal.sp.close()"
|
|
665
|
+
>
|
|
666
|
+
<div class="flex items-center active:bg-accent1/10 p-3">
|
|
667
|
+
<SelectItemContainer
|
|
668
|
+
:item="row"
|
|
669
|
+
:value="activeValue"
|
|
670
|
+
:img="props.img"
|
|
671
|
+
:activated="props.img"
|
|
672
|
+
:class-img="props.classImg"
|
|
673
|
+
:class-img-tag="props.classImgTag"
|
|
674
|
+
:img-mode="props.imgMode"
|
|
675
|
+
:disabled="props.disabled"
|
|
676
|
+
:readonly="props.readonly"
|
|
677
|
+
type="item"
|
|
678
|
+
/>
|
|
679
|
+
</div>
|
|
680
|
+
</div>
|
|
681
|
+
</template>
|
|
682
|
+
<div
|
|
683
|
+
v-if="listBase.length !== 0 && spFilterList.length === 0"
|
|
684
|
+
class="text-error whitespace-pre-line text-center"
|
|
685
|
+
>
|
|
686
|
+
{{
|
|
687
|
+
tx({
|
|
688
|
+
ja: "\u691C\u7D22\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u7D50\u679C\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\n\u4ED6\u306E\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",
|
|
689
|
+
en: "No results matched your search. \nPlease try different keywords."
|
|
690
|
+
})
|
|
691
|
+
}}
|
|
692
|
+
</div>
|
|
693
|
+
<div v-else-if="listBase.length === 0" class="text-error text-center">
|
|
694
|
+
{{
|
|
695
|
+
tx({
|
|
696
|
+
ja: "\u5229\u7528\u53EF\u80FD\u306A\u9078\u629E\u80A2\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
697
|
+
en: "No selectable options"
|
|
698
|
+
})
|
|
699
|
+
}}
|
|
700
|
+
</div>
|
|
701
|
+
</div>
|
|
702
|
+
</CardItem>
|
|
703
|
+
<CardItem variant="body" class="pt-1 bg-back">
|
|
704
|
+
<SelectHiddenItemToggle v-if="hasHiddenItem" v-model:hidden-item-visible="hiddenItemVisible" />
|
|
705
|
+
</CardItem>
|
|
706
|
+
</Card>
|
|
707
|
+
</Modal>
|
|
708
|
+
</template>
|
|
709
|
+
</template>
|
|
710
|
+
</InputFrame>
|
|
711
|
+
</template>
|
|
712
|
+
|
|
523
713
|
<style>
|
|
524
|
-
.
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
}
|
|
530
|
-
.v-select.vs--open.vs--single.vs--searchable .vs__selected {
|
|
531
|
-
width: calc(100% - 0.5em);
|
|
532
|
-
}
|
|
533
|
-
.v-select .vs__selected {
|
|
534
|
-
margin-top: 0 !important;
|
|
535
|
-
margin-bottom: 0 !important;
|
|
536
|
-
flex: 1 1 auto;
|
|
537
|
-
}
|
|
538
|
-
.v-select .vs__selected,
|
|
539
|
-
.v-select .vs__selected-options {
|
|
540
|
-
max-width: 100%;
|
|
714
|
+
.HsSelect .icons > * {
|
|
715
|
+
height: auto;
|
|
716
|
+
height: calc(100% - 6px);
|
|
717
|
+
max-height: calc(100% - 6px);
|
|
718
|
+
min-height: 0;
|
|
541
719
|
min-width: 0;
|
|
542
720
|
}
|
|
543
|
-
.
|
|
544
|
-
|
|
545
|
-
}
|
|
546
|
-
.v-select .vs__clear {
|
|
547
|
-
padding: 3px;
|
|
548
|
-
border: solid 1px transparent;
|
|
549
|
-
transition: border-color 300ms;
|
|
550
|
-
border-radius: 3px;
|
|
551
|
-
}
|
|
552
|
-
.v-select .vs__clear:focus {
|
|
553
|
-
box-shadow: inset 0px 0px 1px 2px #0d8ee4;
|
|
554
|
-
}
|
|
555
|
-
.v-select .vs__dropdown-toggle {
|
|
556
|
-
background-color: transparent;
|
|
557
|
-
}
|
|
558
|
-
.v-select.size-s .vs__dropdown-toggle {
|
|
559
|
-
padding-bottom: 0 !important;
|
|
560
|
-
height: 24px !important;
|
|
561
|
-
}
|
|
562
|
-
.v-select.size-s .vs__spinner {
|
|
563
|
-
width: 3.5em;
|
|
564
|
-
height: 3.5em;
|
|
565
|
-
}
|
|
566
|
-
.v-select.size-m .vs__dropdown-toggle {
|
|
567
|
-
padding-bottom: 0 !important;
|
|
568
|
-
height: 26px !important;
|
|
721
|
+
.HsSelect .icons > *:after {
|
|
722
|
+
display: none;
|
|
569
723
|
}
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
724
|
+
|
|
725
|
+
.HsSelectItem:not(.active):hover {
|
|
726
|
+
background-color: var(--color-bg);
|
|
573
727
|
}
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
background-color: transparent !important;
|
|
728
|
+
|
|
729
|
+
[data-highlighted] .HsSelectItem:hover {
|
|
730
|
+
background-color: var(--color-bg);
|
|
578
731
|
}
|
|
579
|
-
|
|
580
|
-
|
|
732
|
+
|
|
733
|
+
[data-highlighted] .HsSelectItem:not(:hover) {
|
|
734
|
+
background-color: var(--color-bg);
|
|
581
735
|
}
|
|
582
736
|
|
|
583
|
-
|
|
584
|
-
|
|
737
|
+
[data-reka-popper-content-wrapper] > [data-dismissable-layer] {
|
|
738
|
+
filter: drop-shadow(0px 0px 3px rgba(0, 0, 0, 0.58));
|
|
585
739
|
}
|
|
586
740
|
|
|
587
|
-
|
|
588
|
-
|
|
741
|
+
[data-reka-popper-content-wrapper] > [data-dismissable-layer] > span > svg {
|
|
742
|
+
fill: white;
|
|
589
743
|
}
|
|
590
|
-
</style>
|
|
744
|
+
</style>
|