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,369 +1,239 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
type
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
);
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
label: props.label,
|
|
235
|
-
data: props.data.map((row) => row),
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
const onFocus = (row: ItemListRow) => {
|
|
241
|
-
row.focus = true;
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
const onBlur = (row: ItemListRow) => {
|
|
245
|
-
setTimeout(() => {
|
|
246
|
-
row.focus = false;
|
|
247
|
-
}, 10);
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
// 更新の有無判定
|
|
251
|
-
const isChangeData = computed(() => {
|
|
252
|
-
if (props.diff === undefined) return false;
|
|
253
|
-
return !ObjectCompare(
|
|
254
|
-
props.diff.map((row) => row).sort(),
|
|
255
|
-
props.data.map((row) => row)
|
|
256
|
-
);
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
const tabindex = computed(() => {
|
|
260
|
-
if (props.disabled === true) return -1;
|
|
261
|
-
return props.tabindex;
|
|
262
|
-
});
|
|
263
|
-
// ----------------------------------------------------------------------------
|
|
264
|
-
// Class
|
|
265
|
-
const baseClass = computed(() => {
|
|
266
|
-
return [
|
|
267
|
-
twMerge(
|
|
268
|
-
//
|
|
269
|
-
"h-auto",
|
|
270
|
-
props.size === "s" ? "min-h-[44px] " : "",
|
|
271
|
-
props.size === "m" ? "min-h-[48px]" : "",
|
|
272
|
-
props.size === "l" ? "min-h-[60px]" : "",
|
|
273
|
-
ClassTypeToString(props.class)
|
|
274
|
-
),
|
|
275
|
-
];
|
|
276
|
-
});
|
|
277
|
-
const rowClass = computed(() => {
|
|
278
|
-
return twMerge(
|
|
279
|
-
//
|
|
280
|
-
"flex items-center flex-wrap",
|
|
281
|
-
ClassTypeToString(props.classRow)
|
|
282
|
-
);
|
|
283
|
-
});
|
|
284
|
-
const colClass = computed(() => {
|
|
285
|
-
return twMerge(
|
|
286
|
-
//
|
|
287
|
-
"min-w-[0]",
|
|
288
|
-
ClassTypeToString(props.classCol)
|
|
289
|
-
);
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
const itemClass = computed(() => {
|
|
293
|
-
return twMerge(
|
|
294
|
-
//
|
|
295
|
-
"px-[6px] py-[1px] w-full",
|
|
296
|
-
ClassTypeToString(props.classItem)
|
|
297
|
-
);
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
// ----------------------------------------------------------------------------
|
|
301
|
-
</script>
|
|
302
|
-
|
|
303
|
-
<template>
|
|
304
|
-
<InputFrame
|
|
305
|
-
:class="baseClass"
|
|
306
|
-
:class-header="props.classHeader"
|
|
307
|
-
:class-input="props.classInput"
|
|
308
|
-
:focus="computedActivate"
|
|
309
|
-
:focus-color="props.focusColor"
|
|
310
|
-
:change="isChangeData"
|
|
311
|
-
:change-color="props.changeColor"
|
|
312
|
-
:error="props.error"
|
|
313
|
-
:error-color="props.errorColor"
|
|
314
|
-
:disabled="props.disabled"
|
|
315
|
-
:disabled-color="props.disabledColor"
|
|
316
|
-
:readonly="props.readonly"
|
|
317
|
-
:label="props.label"
|
|
318
|
-
:require="props.require"
|
|
319
|
-
:require-text="tx(props.requireText).value"
|
|
320
|
-
:warn="props.warn"
|
|
321
|
-
:warn-time-out="props.warnTimeOut"
|
|
322
|
-
:size="props.size"
|
|
323
|
-
:headerless="props.headerless"
|
|
324
|
-
>
|
|
325
|
-
<template v-if="slots['left-icons']" #left-icons>
|
|
326
|
-
<slot name="left-icons" :disabled="disabled" />
|
|
327
|
-
</template>
|
|
328
|
-
<template v-if="slots['right-icons']" #right-icons>
|
|
329
|
-
<slot name="right-icons" :disabled="disabled" />
|
|
330
|
-
</template>
|
|
331
|
-
<template v-if="slots.overlay" #overlay>
|
|
332
|
-
<slot name="overlay"></slot>
|
|
333
|
-
</template>
|
|
334
|
-
<div class="nac-input-box" @mousedown.stop="" @mouseup.stop="">
|
|
335
|
-
<div
|
|
336
|
-
class="w-full h-full"
|
|
337
|
-
:class="rowClass"
|
|
338
|
-
style="background-color: transparent"
|
|
339
|
-
>
|
|
340
|
-
<template v-for="(row, index) in itemList" :key="index">
|
|
341
|
-
<div :class="colClass">
|
|
342
|
-
<HsFcCheckBox
|
|
343
|
-
:data="props.data.includes(row.id) === true"
|
|
344
|
-
:label="tx(row.text).value"
|
|
345
|
-
:class="itemClass"
|
|
346
|
-
:class-img="props.classImg"
|
|
347
|
-
:class-img-tag="props.classImgTag"
|
|
348
|
-
:image="props.image"
|
|
349
|
-
:img-url="row.imgUrl"
|
|
350
|
-
:tabindex="tabindex"
|
|
351
|
-
:disabled="props.disabled"
|
|
352
|
-
@value-change="(value) => valueChange(row.id)"
|
|
353
|
-
@focus="() => onFocus(row)"
|
|
354
|
-
@blur="() => onBlur(row)"
|
|
355
|
-
@ref="(e) => setRef(e, index)"
|
|
356
|
-
/>
|
|
357
|
-
</div>
|
|
358
|
-
</template>
|
|
359
|
-
</div>
|
|
360
|
-
</div>
|
|
361
|
-
</InputFrame>
|
|
362
|
-
</template>
|
|
363
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
import { reactive, ref, watch, computed, nextTick } from "#imports";
|
|
4
|
+
import { ClassTypeToString } from "../../utils/class-style";
|
|
5
|
+
import { ObjectCompare, ListIdSort } from "../../utils/object";
|
|
6
|
+
import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
|
|
7
|
+
import { useHsPinia } from "../../composables/use-pinia";
|
|
8
|
+
import InputFrame from "./input-frame.vue";
|
|
9
|
+
import HsFcCheckBox from "./check-box.vue";
|
|
10
|
+
const multiLang = useHsMultiLang(useHsPinia());
|
|
11
|
+
const tx = multiLang.tx;
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
list: { type: Array, required: true },
|
|
14
|
+
image: { type: Boolean, required: false, default: false },
|
|
15
|
+
nullText: { type: [String, Object], required: false, default: () => ({ ja: "\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044", en: "" }) },
|
|
16
|
+
classRow: { type: [String, Object, Array], required: false, default: "" },
|
|
17
|
+
classCol: { type: [String, Object, Array], required: false, default: "" },
|
|
18
|
+
classItem: { type: [String, Object, Array], required: false, default: "" },
|
|
19
|
+
classImg: { type: [String, Object, Array], required: false, default: "" },
|
|
20
|
+
classImgTag: { type: [String, Object, Array], required: false, default: "" },
|
|
21
|
+
data: { type: Array, required: true },
|
|
22
|
+
diff: { type: null, required: false, default: void 0 },
|
|
23
|
+
tabindex: { type: null, required: false, default: void 0 },
|
|
24
|
+
class: { type: [String, Object, Array], required: false, default: "" },
|
|
25
|
+
classHeader: { type: [String, Object, Array], required: false, default: "" },
|
|
26
|
+
classInput: { type: [String, Object, Array], required: false, default: "" },
|
|
27
|
+
focusColor: { type: String, required: false, default: "shadow-[inset_0px_0px_1px_2px_#0d8ee4]" },
|
|
28
|
+
changeColor: { type: String, required: false, default: "shadow-[inset_0px_0px_1px_2px_#fd9831be]" },
|
|
29
|
+
error: { type: Boolean, required: false, default: false },
|
|
30
|
+
errorColor: { type: String, required: false, default: "shadow-[inset_0px_0px_1px_2px_#d80000dc]" },
|
|
31
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
32
|
+
disabledColor: { type: String, required: false, default: "" },
|
|
33
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
34
|
+
headerless: { type: Boolean, required: false, default: false },
|
|
35
|
+
label: { type: [String, Object], required: false, default: "" },
|
|
36
|
+
require: { type: Boolean, required: false, default: false },
|
|
37
|
+
requireText: { type: [String, Object], required: false, default: () => ({ ja: "\u5FC5\u9808", en: "" }) },
|
|
38
|
+
warn: { type: String, required: false, default: "" },
|
|
39
|
+
warnTimeOut: { type: Number, required: false, default: 3e3 },
|
|
40
|
+
size: { type: String, required: false, default: "m" }
|
|
41
|
+
});
|
|
42
|
+
const emit = defineEmits(["ref", "focus", "blur", "update:data", "value-change"]);
|
|
43
|
+
const slots = defineSlots();
|
|
44
|
+
const itemList = ref([]);
|
|
45
|
+
watch(
|
|
46
|
+
() => [...props.list],
|
|
47
|
+
() => {
|
|
48
|
+
setItemList();
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
const setItemList = () => {
|
|
52
|
+
itemList.value = props.list.map((row) => {
|
|
53
|
+
return {
|
|
54
|
+
id: row.id,
|
|
55
|
+
text: row.text,
|
|
56
|
+
imgUrl: row.imgUrl === void 0 ? null : row.imgUrl,
|
|
57
|
+
focus: false
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
setItemList();
|
|
62
|
+
const valueChange = async (id) => {
|
|
63
|
+
const before = props.data.map((row) => row);
|
|
64
|
+
let temp = props.data.map((row) => row);
|
|
65
|
+
if (props.data.includes(id)) {
|
|
66
|
+
temp = props.data.filter((row) => {
|
|
67
|
+
if (row === id) {
|
|
68
|
+
return false;
|
|
69
|
+
} else {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
} else {
|
|
74
|
+
temp.push(id);
|
|
75
|
+
}
|
|
76
|
+
const ret = ListIdSort([...props.list], temp);
|
|
77
|
+
emit("update:data", ret, id);
|
|
78
|
+
await nextTick();
|
|
79
|
+
emit("value-change", ret, before, id);
|
|
80
|
+
};
|
|
81
|
+
const inputElement = ref();
|
|
82
|
+
defineExpose({ el: inputElement });
|
|
83
|
+
const setRef = (elm, index) => {
|
|
84
|
+
if (index === 0) {
|
|
85
|
+
inputElement.value = elm;
|
|
86
|
+
emit("ref", inputElement.value);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const focusState = reactive({
|
|
90
|
+
isMmousedown: false
|
|
91
|
+
});
|
|
92
|
+
const computedActivate = computed(() => {
|
|
93
|
+
if (focusState.isMmousedown) return true;
|
|
94
|
+
if (itemList.value.filter((row) => row.focus === true).length !== 0) return true;
|
|
95
|
+
return false;
|
|
96
|
+
});
|
|
97
|
+
watch(computedActivate, (value) => {
|
|
98
|
+
if (value === true) {
|
|
99
|
+
setTimeout(() => {
|
|
100
|
+
emit("focus", {
|
|
101
|
+
elm: inputElement.value,
|
|
102
|
+
label: props.label,
|
|
103
|
+
data: props.data.map((row) => row)
|
|
104
|
+
});
|
|
105
|
+
}, 10);
|
|
106
|
+
} else {
|
|
107
|
+
emit("blur", {
|
|
108
|
+
elm: inputElement.value,
|
|
109
|
+
label: props.label,
|
|
110
|
+
data: props.data.map((row) => row)
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
const onFocus = (row) => {
|
|
115
|
+
row.focus = true;
|
|
116
|
+
};
|
|
117
|
+
const onBlur = (row) => {
|
|
118
|
+
setTimeout(() => {
|
|
119
|
+
row.focus = false;
|
|
120
|
+
}, 10);
|
|
121
|
+
};
|
|
122
|
+
const isChangeData = computed(() => {
|
|
123
|
+
if (props.diff === void 0) return false;
|
|
124
|
+
return !ObjectCompare(
|
|
125
|
+
props.diff.map((row) => row).sort(),
|
|
126
|
+
props.data.map((row) => row)
|
|
127
|
+
);
|
|
128
|
+
});
|
|
129
|
+
const tabindex = computed(() => {
|
|
130
|
+
if (props.disabled === true) return -1;
|
|
131
|
+
return props.tabindex;
|
|
132
|
+
});
|
|
133
|
+
const baseClass = computed(() => {
|
|
134
|
+
return [
|
|
135
|
+
twMerge(
|
|
136
|
+
//
|
|
137
|
+
"h-auto",
|
|
138
|
+
props.size === "s" ? "min-h-[44px] " : "",
|
|
139
|
+
props.size === "m" ? "min-h-[48px]" : "",
|
|
140
|
+
props.size === "l" ? "min-h-[60px]" : "",
|
|
141
|
+
ClassTypeToString(props.class)
|
|
142
|
+
)
|
|
143
|
+
];
|
|
144
|
+
});
|
|
145
|
+
const rowClass = computed(() => {
|
|
146
|
+
return twMerge(
|
|
147
|
+
//
|
|
148
|
+
"flex items-center flex-wrap",
|
|
149
|
+
ClassTypeToString(props.classRow)
|
|
150
|
+
);
|
|
151
|
+
});
|
|
152
|
+
const colClass = computed(() => {
|
|
153
|
+
return twMerge(
|
|
154
|
+
//
|
|
155
|
+
"min-w-[0]",
|
|
156
|
+
ClassTypeToString(props.classCol)
|
|
157
|
+
);
|
|
158
|
+
});
|
|
159
|
+
const itemClass = computed(() => {
|
|
160
|
+
return twMerge(
|
|
161
|
+
//
|
|
162
|
+
"px-[6px] py-[1px] w-full",
|
|
163
|
+
ClassTypeToString(props.classItem)
|
|
164
|
+
);
|
|
165
|
+
});
|
|
166
|
+
</script>
|
|
167
|
+
|
|
168
|
+
<template>
|
|
169
|
+
<InputFrame
|
|
170
|
+
:class="baseClass"
|
|
171
|
+
:class-header="props.classHeader"
|
|
172
|
+
:class-input="props.classInput"
|
|
173
|
+
:focus="computedActivate"
|
|
174
|
+
:focus-color="props.focusColor"
|
|
175
|
+
:change="isChangeData"
|
|
176
|
+
:change-color="props.changeColor"
|
|
177
|
+
:error="props.error"
|
|
178
|
+
:error-color="props.errorColor"
|
|
179
|
+
:disabled="props.disabled"
|
|
180
|
+
:disabled-color="props.disabledColor"
|
|
181
|
+
:readonly="props.readonly"
|
|
182
|
+
:label="props.label"
|
|
183
|
+
:require="props.require"
|
|
184
|
+
:require-text="tx(props.requireText).value"
|
|
185
|
+
:warn="props.warn"
|
|
186
|
+
:warn-time-out="props.warnTimeOut"
|
|
187
|
+
:size="props.size"
|
|
188
|
+
:headerless="props.headerless"
|
|
189
|
+
>
|
|
190
|
+
<template v-if="slots.overlay" #overlay="{ focus, change }">
|
|
191
|
+
<slot name="overlay" :focus="focus" :change="change"></slot>
|
|
192
|
+
</template>
|
|
193
|
+
<template v-if="slots['left-icons']" #left-icons>
|
|
194
|
+
<slot name="left-icons" :disabled="disabled" />
|
|
195
|
+
</template>
|
|
196
|
+
<template v-if="slots['right-icons']" #right-icons>
|
|
197
|
+
<slot name="right-icons" :disabled="disabled" />
|
|
198
|
+
</template>
|
|
199
|
+
<template v-if="slots['label-prepend']" #label-prepend>
|
|
200
|
+
<slot name="label-prepend" />
|
|
201
|
+
</template>
|
|
202
|
+
<template v-if="slots['label-append']" #label-append>
|
|
203
|
+
<slot name="label-append" />
|
|
204
|
+
</template>
|
|
205
|
+
<template v-if="slots['header-right']" #header-right>
|
|
206
|
+
<slot name="header-right" />
|
|
207
|
+
</template>
|
|
208
|
+
<div class="nac-input-box" @mousedown.stop="" @mouseup.stop="">
|
|
209
|
+
<div class="w-full h-full" :class="rowClass" style="background-color: transparent">
|
|
210
|
+
<template v-for="(row, index) in itemList" :key="index">
|
|
211
|
+
<div :class="colClass">
|
|
212
|
+
<HsFcCheckBox
|
|
213
|
+
:data="props.data.includes(row.id) === true"
|
|
214
|
+
:label="tx(row.text).value"
|
|
215
|
+
:class="itemClass"
|
|
216
|
+
:class-img="props.classImg"
|
|
217
|
+
:class-img-tag="props.classImgTag"
|
|
218
|
+
:image="props.image"
|
|
219
|
+
:img-url="row.imgUrl"
|
|
220
|
+
:tabindex="tabindex === void 0 ? void 0 : String(tabindex)"
|
|
221
|
+
:disabled="props.disabled"
|
|
222
|
+
@value-change="(value) => valueChange(row.id)"
|
|
223
|
+
@focus="() => onFocus(row)"
|
|
224
|
+
@blur="() => onBlur(row)"
|
|
225
|
+
@ref="(e) => setRef(e, index)"
|
|
226
|
+
/>
|
|
227
|
+
</div>
|
|
228
|
+
</template>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
</InputFrame>
|
|
232
|
+
</template>
|
|
233
|
+
|
|
364
234
|
<style scoped>
|
|
365
235
|
.nac-input-box {
|
|
366
236
|
width: 100%;
|
|
367
237
|
height: 100%;
|
|
368
238
|
}
|
|
369
|
-
</style>
|
|
239
|
+
</style>
|