nuxt-hs-ui 2.12.7 → 4.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +202 -14
- package/dist/module.d.mts +3 -4
- package/dist/module.json +9 -6
- package/dist/module.mjs +125 -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.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/number.js +1 -1
- 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 -118
- 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,641 +1,498 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
import
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
type
|
|
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
|
-
|
|
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
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
if (
|
|
226
|
-
if (
|
|
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
|
-
|
|
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
|
-
if (
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
if (props.
|
|
319
|
-
return
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if (props.
|
|
324
|
-
return
|
|
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
|
-
if (props.
|
|
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
|
-
try {
|
|
497
|
-
if (props.disabled === true) return;
|
|
498
|
-
if (props.readonly === true) return;
|
|
499
|
-
if (zeroFlag.value && state.value === "") {
|
|
500
|
-
state.value = "0";
|
|
501
|
-
}
|
|
502
|
-
focusState.isActivate = false;
|
|
503
|
-
focusState.isMmousedown = false;
|
|
504
|
-
// await Sleep(50);
|
|
505
|
-
checkValueByInput();
|
|
506
|
-
} catch (err) {
|
|
507
|
-
console.error(err);
|
|
508
|
-
} finally {
|
|
509
|
-
zeroFlag.value = true;
|
|
510
|
-
}
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
// ----------------------------------------------------------------------------
|
|
514
|
-
// 更新の有無判定
|
|
515
|
-
const isChangeData = computed(() => {
|
|
516
|
-
if (props.diff === undefined) return false;
|
|
517
|
-
if (props.diff !== props.data) return true;
|
|
518
|
-
return false;
|
|
519
|
-
});
|
|
520
|
-
|
|
521
|
-
// tabindex
|
|
522
|
-
const tabindex = computed(() => {
|
|
523
|
-
if (props.disabled === true) return -1;
|
|
524
|
-
return props.tabindex;
|
|
525
|
-
});
|
|
526
|
-
|
|
527
|
-
// [ locked ]
|
|
528
|
-
const locked = computed(() => {
|
|
529
|
-
if (props.disabled === true) return true;
|
|
530
|
-
if (props.readonly === true) return true;
|
|
531
|
-
return false;
|
|
532
|
-
});
|
|
533
|
-
// ----------------------------------------------------------------------------
|
|
534
|
-
|
|
535
|
-
onMounted(() => {
|
|
536
|
-
setValueByPropsData();
|
|
537
|
-
});
|
|
538
|
-
|
|
539
|
-
watch(
|
|
540
|
-
() => props.data,
|
|
541
|
-
() => {
|
|
542
|
-
setValueByPropsData();
|
|
543
|
-
}
|
|
544
|
-
);
|
|
545
|
-
// ----------------------------------------------------------------------------
|
|
546
|
-
</script>
|
|
547
|
-
|
|
548
|
-
<template>
|
|
549
|
-
<InputFrame
|
|
550
|
-
:class="props.class"
|
|
551
|
-
:class-header="props.classHeader"
|
|
552
|
-
:class-input="[props.classInput]"
|
|
553
|
-
:focus="computedActivate"
|
|
554
|
-
:focus-color="props.focusColor"
|
|
555
|
-
:change="isChangeData"
|
|
556
|
-
:change-color="props.changeColor"
|
|
557
|
-
:error="props.error"
|
|
558
|
-
:error-color="props.errorColor"
|
|
559
|
-
:disabled="props.disabled"
|
|
560
|
-
:disabled-color="props.disabledColor"
|
|
561
|
-
:readonly="props.readonly"
|
|
562
|
-
:label="props.label"
|
|
563
|
-
:require="props.require"
|
|
564
|
-
:require-text="props.requireText"
|
|
565
|
-
:warn="props.warn"
|
|
566
|
-
:warn-time-out="props.warnTimeOut"
|
|
567
|
-
:size="props.size"
|
|
568
|
-
:headerless="props.headerless"
|
|
569
|
-
@click="elmFocus"
|
|
570
|
-
>
|
|
571
|
-
<template v-if="slots['left-icons']" #left-icons>
|
|
572
|
-
<slot name="left-icons" :disabled="disabled" />
|
|
573
|
-
</template>
|
|
574
|
-
<template v-if="slots.overlay" #overlay>
|
|
575
|
-
<slot name="overlay"></slot>
|
|
576
|
-
</template>
|
|
577
|
-
<div class="flex items-end justify-end">
|
|
578
|
-
<div class="flex-1">
|
|
579
|
-
<input
|
|
580
|
-
:ref="(e) => setRef(e)"
|
|
581
|
-
v-model="state.value"
|
|
582
|
-
type="text"
|
|
583
|
-
:inputmode="hsMisc.state.isMobile ? 'numeric' : 'text'"
|
|
584
|
-
class="pe-[4px] w-full"
|
|
585
|
-
:class="[
|
|
586
|
-
//
|
|
587
|
-
computedActivate ? 'opacity-100' : 'opacity-0',
|
|
588
|
-
// { isShow: computedActivate },
|
|
589
|
-
]"
|
|
590
|
-
maxlength="20"
|
|
591
|
-
:enterkeyhint="props.enterkeyhint"
|
|
592
|
-
:disabled="props.disabled"
|
|
593
|
-
:readonly="props.readonly"
|
|
594
|
-
:tabindex="tabindex"
|
|
595
|
-
@wheel="onWheel"
|
|
596
|
-
@keydown="keydown"
|
|
597
|
-
@keyup="(e) => emit('keyup', e)"
|
|
598
|
-
@blur="onBlur()"
|
|
599
|
-
@focus="onFocus()"
|
|
600
|
-
/>
|
|
601
|
-
<input
|
|
602
|
-
type="text"
|
|
603
|
-
class="displayText pe-[4px] w-full"
|
|
604
|
-
:class="[
|
|
605
|
-
//
|
|
606
|
-
computedActivate ? 'opacity-0' : 'opacity-100',
|
|
607
|
-
{ readonly: props.readonly },
|
|
608
|
-
]"
|
|
609
|
-
:value="displayText"
|
|
610
|
-
:disabled="props.disabled"
|
|
611
|
-
:tabindex="-1"
|
|
612
|
-
readonly
|
|
613
|
-
/>
|
|
614
|
-
</div>
|
|
615
|
-
<div v-if="props.unit.length !== 0" class="flex-none unit">
|
|
616
|
-
{{ props.unit }}
|
|
617
|
-
</div>
|
|
618
|
-
</div>
|
|
619
|
-
<template #right-icons>
|
|
620
|
-
<div v-if="props.isShowBtnControl === true" class="u-d-icon" @click.stop>
|
|
621
|
-
<div
|
|
622
|
-
:class="[{ activate: isArrowUp && !locked }]"
|
|
623
|
-
@click="stepValue(true)"
|
|
624
|
-
>
|
|
625
|
-
<i class="fas fa-caret-up"></i>
|
|
626
|
-
</div>
|
|
627
|
-
<div
|
|
628
|
-
:class="[{ activate: isArrowDown && !locked }]"
|
|
629
|
-
@click="stepValue(false)"
|
|
630
|
-
>
|
|
631
|
-
<i class="fas fa-caret-down"></i>
|
|
632
|
-
</div>
|
|
633
|
-
</div>
|
|
634
|
-
<slot name="right-icons" :disabled="disabled" />
|
|
635
|
-
</template>
|
|
636
|
-
</InputFrame>
|
|
637
|
-
</template>
|
|
638
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import BigNumber from "bignumber.js";
|
|
3
|
+
import { reactive, ref, watch, computed, useId, onMounted, nextTick } from "#imports";
|
|
4
|
+
import { InsertComma } from "../../utils/number";
|
|
5
|
+
import { FloatNullable } from "../../utils/float";
|
|
6
|
+
import { useHsFocus } from "../../composables/use-hs-focus";
|
|
7
|
+
import { useHsToast } from "../../composables/use-hs-toast";
|
|
8
|
+
import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
|
|
9
|
+
import { useHsIsMobile } from "../../composables/use-hs-is-mobile";
|
|
10
|
+
import { useHsPinia } from "../../composables/use-pinia";
|
|
11
|
+
import { useHsMisc } from "../../composables/use-hs-misc";
|
|
12
|
+
import InputFrame from "./input-frame.vue";
|
|
13
|
+
const hsMisc = useHsMisc(useHsPinia());
|
|
14
|
+
const hsIsMobile = useHsIsMobile(useHsPinia());
|
|
15
|
+
const hsFocus = useHsFocus(useHsPinia());
|
|
16
|
+
const Toast = useHsToast(useHsPinia());
|
|
17
|
+
const multiLang = useHsMultiLang(useHsPinia());
|
|
18
|
+
const tx = multiLang.tx;
|
|
19
|
+
const gt = multiLang.gt;
|
|
20
|
+
const props = defineProps({
|
|
21
|
+
nullable: { type: Boolean, required: false, default: true },
|
|
22
|
+
unit: { type: String, required: false, default: "" },
|
|
23
|
+
step: { type: Number, required: false, default: 1 },
|
|
24
|
+
min: { type: Number, required: false, default: -9999999999 },
|
|
25
|
+
max: { type: Number, required: false, default: 9999999999 },
|
|
26
|
+
digits: { type: Number, required: false, default: 0 },
|
|
27
|
+
digitsAuto: { type: Boolean, required: false, default: false },
|
|
28
|
+
isShowBtnControl: { type: Boolean, required: false, default: false },
|
|
29
|
+
comma: { type: String, required: false, default: "," },
|
|
30
|
+
enterkeyhint: { type: null, required: false, default: void 0 },
|
|
31
|
+
inputSize: { type: [String, Number], required: false, default: 10 },
|
|
32
|
+
placeholder: { type: [String, Object], required: false, default: "" },
|
|
33
|
+
textAlign: { type: String, required: false, default: "right" },
|
|
34
|
+
digitsPointSmall: { type: Boolean, required: false, default: false },
|
|
35
|
+
data: { type: [Number, null], required: true },
|
|
36
|
+
diff: { type: null, required: false, default: void 0 },
|
|
37
|
+
tabindex: { type: null, required: false, default: void 0 },
|
|
38
|
+
class: { type: [String, Object, Array], required: false, default: "" },
|
|
39
|
+
classHeader: { type: [String, Object, Array], required: false, default: "" },
|
|
40
|
+
classInput: { type: [String, Object, Array], required: false, default: "" },
|
|
41
|
+
focusColor: { type: String, required: false, default: "shadow-[inset_0px_0px_1px_2px_#0d8ee4]" },
|
|
42
|
+
changeColor: { type: String, required: false, default: "shadow-[inset_0px_0px_1px_2px_#fd9831be]" },
|
|
43
|
+
error: { type: Boolean, required: false, default: false },
|
|
44
|
+
errorColor: { type: String, required: false, default: "shadow-[inset_0px_0px_1px_2px_#d80000dc]" },
|
|
45
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
46
|
+
disabledColor: { type: String, required: false, default: "" },
|
|
47
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
48
|
+
headerless: { type: Boolean, required: false, default: false },
|
|
49
|
+
label: { type: [String, Object], required: false, default: "" },
|
|
50
|
+
require: { type: Boolean, required: false, default: false },
|
|
51
|
+
requireText: { type: [String, Object], required: false, default: () => ({ ja: "\u5FC5\u9808", en: "Required" }) },
|
|
52
|
+
warn: { type: String, required: false, default: "" },
|
|
53
|
+
warnTimeOut: { type: Number, required: false, default: 3e3 },
|
|
54
|
+
size: { type: String, required: false, default: "m" },
|
|
55
|
+
uiText: { type: Object, required: false, default: () => {
|
|
56
|
+
return {
|
|
57
|
+
validError: {
|
|
58
|
+
title: { ja: "\u5165\u529B\u5024\u306E\u8B66\u544A", en: "Input Value Warning" },
|
|
59
|
+
nullValue: {
|
|
60
|
+
ja: "\u6570\u5024\u4EE5\u5916\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",
|
|
61
|
+
en: "Non-numeric values are not allowed."
|
|
62
|
+
},
|
|
63
|
+
minValue: {
|
|
64
|
+
ja: "[{value}]\u4EE5\u4E0B\u306E\u6570\u5024\u306F\u5165\u529B\u3067\u304D\u307E\u305B\u3093",
|
|
65
|
+
en: "You cannot enter a number below {value}."
|
|
66
|
+
},
|
|
67
|
+
maxValue: {
|
|
68
|
+
ja: "[{value}]\u4EE5\u4E0A\u306E\u6570\u5024\u306F\u5165\u529B\u3067\u304D\u307E\u305B\u3093",
|
|
69
|
+
en: "You cannot enter a number greater than {value}."
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
} }
|
|
74
|
+
});
|
|
75
|
+
const emit = defineEmits(["ref", "focus", "blur", "update:data", "value-change", "keydown", "keyup"]);
|
|
76
|
+
const slots = defineSlots();
|
|
77
|
+
const uid = useId();
|
|
78
|
+
const state = reactive({
|
|
79
|
+
value: "",
|
|
80
|
+
inputMode: "text"
|
|
81
|
+
});
|
|
82
|
+
onMounted(() => {
|
|
83
|
+
state.inputMode = hsIsMobile.isMobile === true ? "numeric" : "text";
|
|
84
|
+
});
|
|
85
|
+
watch(
|
|
86
|
+
() => hsIsMobile.isMobile,
|
|
87
|
+
() => {
|
|
88
|
+
state.inputMode = hsIsMobile.isMobile === true ? "numeric" : "text";
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
const convertText = (str) => {
|
|
92
|
+
if (props.digitsAuto) {
|
|
93
|
+
if (/\./.test(str)) {
|
|
94
|
+
return str.replace(/0*$/g, "").replace(/\.$/g, "");
|
|
95
|
+
}
|
|
96
|
+
return str;
|
|
97
|
+
} else {
|
|
98
|
+
return str;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const displayText = computed(() => {
|
|
102
|
+
if (props.data === null) return "";
|
|
103
|
+
const ret = InsertComma(props.data, props.digits, "0", props.comma);
|
|
104
|
+
return convertText(ret);
|
|
105
|
+
});
|
|
106
|
+
const displayDiffText = computed(() => {
|
|
107
|
+
if (!props.diff) return "";
|
|
108
|
+
const ret = InsertComma(props.diff, props.digits, "0", props.comma);
|
|
109
|
+
return convertText(ret);
|
|
110
|
+
});
|
|
111
|
+
const validCheck = (val) => {
|
|
112
|
+
if (val === null) {
|
|
113
|
+
if (props.nullable === false) {
|
|
114
|
+
return {
|
|
115
|
+
result: false,
|
|
116
|
+
value: 0,
|
|
117
|
+
message: gt(props.uiText.validError.nullValue)
|
|
118
|
+
};
|
|
119
|
+
} else {
|
|
120
|
+
return { result: true, value: null, message: "" };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (val < props.min) {
|
|
124
|
+
return {
|
|
125
|
+
result: false,
|
|
126
|
+
value: props.min,
|
|
127
|
+
message: gt(props.uiText.validError.minValue).replace(/\{value\}/g, String(props.min))
|
|
128
|
+
// `[${props.min}]以下の数値は入力できません`,
|
|
129
|
+
};
|
|
130
|
+
} else if (props.max < val) {
|
|
131
|
+
return {
|
|
132
|
+
result: false,
|
|
133
|
+
value: props.max,
|
|
134
|
+
message: gt(props.uiText.validError.maxValue).replace(/\{value\}/g, String(props.max))
|
|
135
|
+
// message: `[${props.max}]以上の数値は入力できません`,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
return { result: true, value: val, message: "" };
|
|
139
|
+
};
|
|
140
|
+
const updateData = async (val, f = true) => {
|
|
141
|
+
const before = props.data;
|
|
142
|
+
let updateValue = null;
|
|
143
|
+
if (val !== null) {
|
|
144
|
+
updateValue = val;
|
|
145
|
+
} else if (props.nullable === false) {
|
|
146
|
+
updateValue = 0;
|
|
147
|
+
} else {
|
|
148
|
+
updateValue = null;
|
|
149
|
+
}
|
|
150
|
+
emit("update:data", updateValue);
|
|
151
|
+
await nextTick();
|
|
152
|
+
if (f) emit("value-change", updateValue, before);
|
|
153
|
+
await nextTick();
|
|
154
|
+
if (props.data !== val) {
|
|
155
|
+
setValueByPropsData();
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const stepValue = (isUp) => {
|
|
159
|
+
if (props.disabled === true) return;
|
|
160
|
+
if (props.readonly === true) return;
|
|
161
|
+
let nextValue = 0;
|
|
162
|
+
const inputValue = FloatNullable(props.data, props.digits);
|
|
163
|
+
const step = isUp === true ? props.step : props.step * -1;
|
|
164
|
+
if (inputValue === null) {
|
|
165
|
+
nextValue = step;
|
|
166
|
+
if (isUp === true) {
|
|
167
|
+
if (nextValue < props.min || props.max < nextValue) {
|
|
168
|
+
nextValue = props.max;
|
|
169
|
+
}
|
|
170
|
+
} else if (nextValue < props.min || props.max < nextValue) {
|
|
171
|
+
nextValue = props.min;
|
|
172
|
+
}
|
|
173
|
+
} else if (props.digits > 0 || step < 1) {
|
|
174
|
+
if (isUp === true) {
|
|
175
|
+
nextValue = BigNumber(inputValue).plus(BigNumber(props.step)).toNumber();
|
|
176
|
+
} else {
|
|
177
|
+
nextValue = BigNumber(inputValue).minus(BigNumber(props.step)).toNumber();
|
|
178
|
+
}
|
|
179
|
+
} else {
|
|
180
|
+
nextValue = inputValue + step;
|
|
181
|
+
}
|
|
182
|
+
const validCheckResult = validCheck(nextValue);
|
|
183
|
+
if (validCheckResult.result === true) {
|
|
184
|
+
updateData(validCheckResult.value);
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
const isArrowUp = computed(() => {
|
|
188
|
+
if (props.data === null) return true;
|
|
189
|
+
if (props.data + props.step <= props.max) return true;
|
|
190
|
+
return false;
|
|
191
|
+
});
|
|
192
|
+
const isArrowDown = computed(() => {
|
|
193
|
+
if (props.data === null) return true;
|
|
194
|
+
if (props.min <= props.data - props.step) return true;
|
|
195
|
+
return false;
|
|
196
|
+
});
|
|
197
|
+
const hankakuToZenkaku = (str) => {
|
|
198
|
+
return (str + "").replace(/[0-9]/g, (s) => {
|
|
199
|
+
return String.fromCharCode(s.charCodeAt(0) - 65248);
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
const checkValueByInput = () => {
|
|
203
|
+
const inputText = hankakuToZenkaku(state.value).replace(/[ー―-–—]/g, "-").replace(/[^(0-9)|.\-+]+/g, "");
|
|
204
|
+
const inputValue = FloatNullable(inputText, props.digits);
|
|
205
|
+
const validCheckResult = validCheck(inputValue);
|
|
206
|
+
if (validCheckResult.value === null) {
|
|
207
|
+
state.value = "";
|
|
208
|
+
} else {
|
|
209
|
+
state.value = convertText(validCheckResult.value.toFixed(props.digits));
|
|
210
|
+
}
|
|
211
|
+
if (props.data !== validCheckResult.value) {
|
|
212
|
+
updateData(validCheckResult.value);
|
|
213
|
+
}
|
|
214
|
+
if (validCheckResult.result === false) {
|
|
215
|
+
Toast.Warning(validCheckResult.message, props.uiText.validError.title, props.warnTimeOut);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
const setValueByPropsData = () => {
|
|
219
|
+
const val = FloatNullable(props.data, props.digits);
|
|
220
|
+
if (props.data !== val) {
|
|
221
|
+
updateData(val, false);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
const validCheckResult = validCheck(val);
|
|
225
|
+
if (validCheckResult.result === true) {
|
|
226
|
+
if (validCheckResult.value === null) {
|
|
227
|
+
state.value = "";
|
|
228
|
+
} else {
|
|
229
|
+
state.value = convertText(validCheckResult.value.toFixed(props.digits));
|
|
230
|
+
}
|
|
231
|
+
} else {
|
|
232
|
+
updateData(validCheckResult.value, false);
|
|
233
|
+
Toast.Warning(validCheckResult.message, props.uiText.validError.title, props.warnTimeOut);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
const keydown = (e) => {
|
|
237
|
+
emit("keydown", e);
|
|
238
|
+
if (!props.isShowBtnControl && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
239
|
+
e.preventDefault();
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
if (e.key === "ArrowUp") {
|
|
243
|
+
stepValue(true);
|
|
244
|
+
} else if (e.key === "ArrowDown") {
|
|
245
|
+
stepValue(false);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
const onWheel = (e) => {
|
|
249
|
+
if (!props.isShowBtnControl) return;
|
|
250
|
+
if (props.disabled === true) return;
|
|
251
|
+
if (props.readonly === true) return;
|
|
252
|
+
if (e.deltaY < 0) {
|
|
253
|
+
stepValue(true);
|
|
254
|
+
} else if (e.deltaY > 0) {
|
|
255
|
+
stepValue(false);
|
|
256
|
+
}
|
|
257
|
+
e.preventDefault();
|
|
258
|
+
};
|
|
259
|
+
const inputElement = ref();
|
|
260
|
+
defineExpose({ el: inputElement });
|
|
261
|
+
const setRef = (elm) => {
|
|
262
|
+
inputElement.value = elm;
|
|
263
|
+
emit("ref", elm);
|
|
264
|
+
};
|
|
265
|
+
const focusState = reactive({
|
|
266
|
+
isActivate: false,
|
|
267
|
+
isMmousedown: false
|
|
268
|
+
});
|
|
269
|
+
const computedActivate = computed(() => {
|
|
270
|
+
if (hsFocus.state.id !== uid) return false;
|
|
271
|
+
if (props.disabled === true) return false;
|
|
272
|
+
if (props.readonly === true) return false;
|
|
273
|
+
if (focusState.isActivate) return true;
|
|
274
|
+
if (focusState.isMmousedown) return true;
|
|
275
|
+
return false;
|
|
276
|
+
});
|
|
277
|
+
watch(computedActivate, (value) => {
|
|
278
|
+
if (value === true) {
|
|
279
|
+
setTimeout(() => {
|
|
280
|
+
emit("focus", inputElement.value);
|
|
281
|
+
}, 10);
|
|
282
|
+
} else {
|
|
283
|
+
emit("blur", inputElement.value);
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
const zeroFlag = ref(false);
|
|
287
|
+
const onFocus = () => {
|
|
288
|
+
zeroFlag.value = false;
|
|
289
|
+
if (props.disabled === true) return;
|
|
290
|
+
if (props.readonly === true) return;
|
|
291
|
+
if (hsFocus.state.id !== uid) {
|
|
292
|
+
hsFocus.state.id = uid;
|
|
293
|
+
}
|
|
294
|
+
focusState.isActivate = true;
|
|
295
|
+
if (state.inputMode === "text") {
|
|
296
|
+
} else if (state.value === "0") {
|
|
297
|
+
zeroFlag.value = true;
|
|
298
|
+
state.value = "";
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
const onBlur = () => {
|
|
302
|
+
try {
|
|
303
|
+
if (props.disabled === true) return;
|
|
304
|
+
if (props.readonly === true) return;
|
|
305
|
+
if (zeroFlag.value && state.value === "") {
|
|
306
|
+
state.value = "0";
|
|
307
|
+
}
|
|
308
|
+
focusState.isActivate = false;
|
|
309
|
+
focusState.isMmousedown = false;
|
|
310
|
+
checkValueByInput();
|
|
311
|
+
} catch (err) {
|
|
312
|
+
console.error(err);
|
|
313
|
+
} finally {
|
|
314
|
+
zeroFlag.value = true;
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
const isChangeData = computed(() => {
|
|
318
|
+
if (props.diff === void 0) return false;
|
|
319
|
+
if (props.diff !== props.data) return true;
|
|
320
|
+
return false;
|
|
321
|
+
});
|
|
322
|
+
const tabindex = computed(() => {
|
|
323
|
+
if (props.disabled === true) return -1;
|
|
324
|
+
return props.tabindex;
|
|
325
|
+
});
|
|
326
|
+
const locked = computed(() => {
|
|
327
|
+
if (props.disabled === true) return true;
|
|
328
|
+
if (props.readonly === true) return true;
|
|
329
|
+
return false;
|
|
330
|
+
});
|
|
331
|
+
onMounted(() => {
|
|
332
|
+
setValueByPropsData();
|
|
333
|
+
});
|
|
334
|
+
watch(
|
|
335
|
+
() => props.data,
|
|
336
|
+
() => {
|
|
337
|
+
setValueByPropsData();
|
|
338
|
+
}
|
|
339
|
+
);
|
|
340
|
+
const placeholder = computed(() => tx(props.placeholder).value);
|
|
341
|
+
const displayTextArr = computed(() => {
|
|
342
|
+
const text = displayText.value;
|
|
343
|
+
if (props.digits === 0) return [text, ""];
|
|
344
|
+
if (!text) return [text, ""];
|
|
345
|
+
if (!/\./.test(text)) return [text, ""];
|
|
346
|
+
const top = text.replace(/(\.\d*)$/, "");
|
|
347
|
+
const bottom = text.replace(/.*(\.\d*)$/, "$1");
|
|
348
|
+
return [top ?? "", bottom ?? ""];
|
|
349
|
+
});
|
|
350
|
+
const pHolder = computed(() => {
|
|
351
|
+
const text = placeholder.value;
|
|
352
|
+
if (props.digits === 0) return [text, ""];
|
|
353
|
+
if (!text) return [text, ""];
|
|
354
|
+
if (!/\./.test(text)) return [text, ""];
|
|
355
|
+
const top = text.replace(/(\.\d*)$/, "");
|
|
356
|
+
const bottom = text.replace(/.*(\.\d*)$/, "$1");
|
|
357
|
+
return [top ?? "", bottom ?? ""];
|
|
358
|
+
});
|
|
359
|
+
</script>
|
|
360
|
+
|
|
361
|
+
<template>
|
|
362
|
+
<InputFrame
|
|
363
|
+
:class="props.class"
|
|
364
|
+
:class-header="props.classHeader"
|
|
365
|
+
:class-input="[props.classInput]"
|
|
366
|
+
:focus="computedActivate"
|
|
367
|
+
:focus-color="props.focusColor"
|
|
368
|
+
:change="isChangeData"
|
|
369
|
+
:change-color="props.changeColor"
|
|
370
|
+
:error="props.error"
|
|
371
|
+
:error-color="props.errorColor"
|
|
372
|
+
:disabled="props.disabled"
|
|
373
|
+
:disabled-color="props.disabledColor"
|
|
374
|
+
:readonly="props.readonly"
|
|
375
|
+
:label="props.label"
|
|
376
|
+
:require="props.require"
|
|
377
|
+
:require-text="props.requireText"
|
|
378
|
+
:warn="props.warn"
|
|
379
|
+
:warn-time-out="props.warnTimeOut"
|
|
380
|
+
:size="props.size"
|
|
381
|
+
:headerless="props.headerless"
|
|
382
|
+
>
|
|
383
|
+
<template #overlay="{ focus, change }">
|
|
384
|
+
<div
|
|
385
|
+
v-if="props.diff !== void 0 && change"
|
|
386
|
+
class="absolute inset-0 bg-red/30 transition-opacity flex items-center p-1 bg-dark/20"
|
|
387
|
+
:class="!focus && hsMisc.capsLockState ? 'opacity-100' : 'opacity-0 pointer-events-none select-none'"
|
|
388
|
+
>
|
|
389
|
+
<div class="flex">
|
|
390
|
+
<Btn
|
|
391
|
+
variant="outlined"
|
|
392
|
+
theme="error"
|
|
393
|
+
tabindex="-1"
|
|
394
|
+
size="xs"
|
|
395
|
+
class="bg-white flex-none"
|
|
396
|
+
@click="updateData(props.diff)"
|
|
397
|
+
>
|
|
398
|
+
<i class="fa-solid fa-rotate-right"></i>
|
|
399
|
+
</Btn>
|
|
400
|
+
<div v-if="props.diff" class="px-1 truncate bg-white mx-1 flex items-center">{{ displayDiffText }}</div>
|
|
401
|
+
</div>
|
|
402
|
+
</div>
|
|
403
|
+
<template v-if="slots.overlay">
|
|
404
|
+
<slot name="overlay" :focus="focus" :change="change"></slot>
|
|
405
|
+
</template>
|
|
406
|
+
</template>
|
|
407
|
+
<template v-if="slots['left-icons']" #left-icons>
|
|
408
|
+
<slot name="left-icons" :disabled="disabled" />
|
|
409
|
+
</template>
|
|
410
|
+
<template #right-icons>
|
|
411
|
+
<div v-if="props.isShowBtnControl === true" class="u-d-icon" @click.stop>
|
|
412
|
+
<div :class="[{ activate: isArrowUp && !locked }]" @click="stepValue(true)">
|
|
413
|
+
<i class="fas fa-caret-up"></i>
|
|
414
|
+
</div>
|
|
415
|
+
<div :class="[{ activate: isArrowDown && !locked }]" @click="stepValue(false)">
|
|
416
|
+
<i class="fas fa-caret-down"></i>
|
|
417
|
+
</div>
|
|
418
|
+
</div>
|
|
419
|
+
<slot name="right-icons" :disabled="disabled" />
|
|
420
|
+
</template>
|
|
421
|
+
<template v-if="slots['label-prepend']" #label-prepend>
|
|
422
|
+
<slot name="label-prepend" />
|
|
423
|
+
</template>
|
|
424
|
+
<template v-if="slots['label-append']" #label-append>
|
|
425
|
+
<slot name="label-append" />
|
|
426
|
+
</template>
|
|
427
|
+
<template v-if="slots['header-right']" #header-right>
|
|
428
|
+
<slot name="header-right" />
|
|
429
|
+
</template>
|
|
430
|
+
<template #default="{ focus }">
|
|
431
|
+
<div class="flex items-end justify-end w-full relative">
|
|
432
|
+
<div class="flex-1 relative">
|
|
433
|
+
<span
|
|
434
|
+
v-if="placeholder"
|
|
435
|
+
class="text-black/50 pointer-events-none select-none px-1 absolute inset-0 items-center transition-opacity truncate"
|
|
436
|
+
:class="focus || !!state.value || !!displayText ? 'opacity-0' : ''"
|
|
437
|
+
>
|
|
438
|
+
<div class="truncate w-full" :style="`text-align:${props.textAlign};`">
|
|
439
|
+
<div v-if="props.digitsPointSmall">
|
|
440
|
+
<span class="font-semibold">{{ pHolder[0] }}</span>
|
|
441
|
+
<span class="text-[0.8em] text-[#333] font-normal">{{ pHolder[1] }}</span>
|
|
442
|
+
</div>
|
|
443
|
+
<template v-else>
|
|
444
|
+
{{ placeholder }}
|
|
445
|
+
</template>
|
|
446
|
+
</div>
|
|
447
|
+
</span>
|
|
448
|
+
<input
|
|
449
|
+
:ref="(e) => setRef(e)"
|
|
450
|
+
v-model="state.value"
|
|
451
|
+
type="text"
|
|
452
|
+
:inputmode="hsIsMobile.isMobile ? 'numeric' : 'text'"
|
|
453
|
+
class="pe-1 w-full"
|
|
454
|
+
:class="[computedActivate ? 'opacity-100' : 'opacity-0']"
|
|
455
|
+
:style="`text-align:${props.textAlign};`"
|
|
456
|
+
maxlength="20"
|
|
457
|
+
:enterkeyhint="props.enterkeyhint"
|
|
458
|
+
:disabled="props.disabled"
|
|
459
|
+
:readonly="props.readonly"
|
|
460
|
+
:tabindex="tabindex"
|
|
461
|
+
:size="props.inputSize"
|
|
462
|
+
@wheel="onWheel"
|
|
463
|
+
@keydown="keydown"
|
|
464
|
+
@keyup="(e) => emit('keyup', e)"
|
|
465
|
+
@blur="onBlur()"
|
|
466
|
+
@focus="onFocus()"
|
|
467
|
+
/>
|
|
468
|
+
<div
|
|
469
|
+
v-if="props.data !== null"
|
|
470
|
+
class="displayText pe-1 w-full"
|
|
471
|
+
:class="[
|
|
472
|
+
//
|
|
473
|
+
focus || computedActivate ? 'opacity-0' : 'opacity-100',
|
|
474
|
+
{ readonly: props.readonly }
|
|
475
|
+
]"
|
|
476
|
+
:style="`justify-content:${props.textAlign === 'right' ? 'end' : props.textAlign === 'center' ? 'center' : 'start'};`"
|
|
477
|
+
readonly
|
|
478
|
+
>
|
|
479
|
+
<div v-if="props.digitsPointSmall" class=" ">
|
|
480
|
+
<span class="font-semibold">{{ displayTextArr[0] }}</span>
|
|
481
|
+
<span class="text-[0.8em] text-[#333] font-normal">{{ displayTextArr[1] }}</span>
|
|
482
|
+
</div>
|
|
483
|
+
<template v-else>
|
|
484
|
+
{{ displayText }}
|
|
485
|
+
</template>
|
|
486
|
+
</div>
|
|
487
|
+
</div>
|
|
488
|
+
<div v-if="props.unit.length !== 0" class="flex-none unit">
|
|
489
|
+
{{ props.unit }}
|
|
490
|
+
</div>
|
|
491
|
+
</div>
|
|
492
|
+
</template>
|
|
493
|
+
</InputFrame>
|
|
494
|
+
</template>
|
|
495
|
+
|
|
639
496
|
<style scoped>
|
|
640
497
|
input {
|
|
641
498
|
background-color: transparent;
|
|
@@ -644,7 +501,6 @@ input {
|
|
|
644
501
|
appearance: none;
|
|
645
502
|
border: 0px;
|
|
646
503
|
outline: none;
|
|
647
|
-
text-align: right;
|
|
648
504
|
color: inherit;
|
|
649
505
|
}
|
|
650
506
|
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button {
|
|
@@ -660,16 +516,31 @@ input.displayText {
|
|
|
660
516
|
margin-top: auto;
|
|
661
517
|
margin-bottom: auto;
|
|
662
518
|
pointer-events: none;
|
|
519
|
+
display: flex;
|
|
520
|
+
align-items: center;
|
|
663
521
|
}
|
|
664
522
|
input.displayText.readonly {
|
|
665
523
|
pointer-events: all;
|
|
666
524
|
}
|
|
667
525
|
|
|
526
|
+
.displayText {
|
|
527
|
+
position: absolute;
|
|
528
|
+
inset: 0 0 0 0;
|
|
529
|
+
margin-top: auto;
|
|
530
|
+
margin-bottom: auto;
|
|
531
|
+
pointer-events: none;
|
|
532
|
+
display: flex;
|
|
533
|
+
align-items: center;
|
|
534
|
+
}
|
|
535
|
+
.displayText.readonly {
|
|
536
|
+
pointer-events: all;
|
|
537
|
+
}
|
|
538
|
+
|
|
668
539
|
.unit {
|
|
669
540
|
color: #696969;
|
|
670
541
|
align-items: flex-end;
|
|
671
542
|
align-self: flex-end;
|
|
672
|
-
margin: 0px 0px
|
|
543
|
+
margin: 0px 0px 0px 4px;
|
|
673
544
|
font-size: min(0.8em, 1rem);
|
|
674
545
|
-moz-user-select: none;
|
|
675
546
|
-webkit-user-select: none;
|
|
@@ -709,4 +580,4 @@ input.displayText.readonly {
|
|
|
709
580
|
.u-d-icon > div:first-child {
|
|
710
581
|
border-bottom: solid 1px gray;
|
|
711
582
|
}
|
|
712
|
-
</style>
|
|
583
|
+
</style>
|