pukaad-ui-lib 1.429.1 → 1.430.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/dist/module.json +1 -1
- package/dist/runtime/components/input/input-chat.vue +16 -11
- package/dist/runtime/components/input/input-file.d.vue.ts +2 -0
- package/dist/runtime/components/input/input-file.vue +7 -5
- package/dist/runtime/components/input/input-file.vue.d.ts +2 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="['flex items-end gap-[16px] w-full', props.class]">
|
|
3
|
-
<div
|
|
3
|
+
<div
|
|
4
|
+
v-if="!hasMedia"
|
|
5
|
+
:class="['flex items-center gap-[8px] h-[36px] shrink-0', props.disabled && 'opacity-50']"
|
|
6
|
+
>
|
|
4
7
|
<slot name="actions" :open-image-picker="openImagePicker" :open-video-picker="openVideoPicker">
|
|
5
8
|
<Button
|
|
6
9
|
variant="text"
|
|
7
|
-
class="w-[32px] h-[32px]"
|
|
10
|
+
class="w-[32px] h-[32px] disabled:opacity-100"
|
|
8
11
|
:disabled="props.disabled || props.disabledMedia"
|
|
9
12
|
@click="openImagePicker"
|
|
10
13
|
>
|
|
11
|
-
<Icon name="lucide:image" class="size-[20px] text-
|
|
14
|
+
<Icon name="lucide:image" class="size-[20px] text-black" />
|
|
12
15
|
</Button>
|
|
13
16
|
<Button
|
|
14
17
|
variant="text"
|
|
15
|
-
class="w-[32px] h-[32px]"
|
|
18
|
+
class="w-[32px] h-[32px] disabled:opacity-100"
|
|
16
19
|
:disabled="props.disabled || props.disabledMedia"
|
|
17
20
|
@click="openVideoPicker"
|
|
18
21
|
>
|
|
19
|
-
<Icon name="lucide:video" class="size-[20px] text-
|
|
22
|
+
<Icon name="lucide:video" class="size-[20px] text-black" />
|
|
20
23
|
</Button>
|
|
21
|
-
<Button variant="text" class="w-[32px] h-[32px]" disabled>
|
|
22
|
-
<Icon name="lucide:megaphone" class="size-[20px] text-
|
|
24
|
+
<Button variant="text" class="w-[32px] h-[32px] disabled:opacity-100" disabled>
|
|
25
|
+
<Icon name="lucide:megaphone" class="size-[20px] text-black" />
|
|
23
26
|
</Button>
|
|
24
|
-
<Button variant="text" class="w-[32px] h-[32px]" disabled>
|
|
25
|
-
<Icon name="lucide:package" class="size-[20px] text-
|
|
27
|
+
<Button variant="text" class="w-[32px] h-[32px] disabled:opacity-100" disabled>
|
|
28
|
+
<Icon name="lucide:package" class="size-[20px] text-black" />
|
|
26
29
|
</Button>
|
|
27
30
|
</slot>
|
|
28
31
|
</div>
|
|
@@ -43,6 +46,8 @@
|
|
|
43
46
|
:accept="mediaAccept"
|
|
44
47
|
:limit="mediaLimit"
|
|
45
48
|
:preview-size="66"
|
|
49
|
+
:min-video-seconds="1"
|
|
50
|
+
:max-video-seconds="0"
|
|
46
51
|
:width="66"
|
|
47
52
|
:height="66"
|
|
48
53
|
disabled-drop
|
|
@@ -65,7 +70,7 @@
|
|
|
65
70
|
:placeholder="props.placeholder"
|
|
66
71
|
:disabled="props.disabled"
|
|
67
72
|
:style="{ maxHeight: `${props.maxHeight}px` }"
|
|
68
|
-
class="block w-full min-h-[34px] resize-none overflow-y-auto bg-transparent px-[12px] py-[4px] font-body-large text-black placeholder:text-
|
|
73
|
+
class="block w-full min-h-[34px] resize-none overflow-y-auto bg-transparent px-[12px] py-[4px] font-body-large text-black placeholder:text-muted-foreground outline-none"
|
|
69
74
|
@keydown.enter="onEnter"
|
|
70
75
|
@paste="onPaste"
|
|
71
76
|
/>
|
|
@@ -75,7 +80,7 @@
|
|
|
75
80
|
<Button variant="text" :disabled="!canSend" @click="submit">
|
|
76
81
|
<Icon
|
|
77
82
|
name="fluent:send-24-filled"
|
|
78
|
-
:class="['size-[20px]', canSend ? 'text-primary' : 'text-
|
|
83
|
+
:class="['size-[20px]', canSend ? 'text-primary' : 'text-cloud']"
|
|
79
84
|
/>
|
|
80
85
|
</Button>
|
|
81
86
|
</div>
|
|
@@ -45,6 +45,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
45
45
|
showCover: boolean;
|
|
46
46
|
previewFullSize: boolean;
|
|
47
47
|
previewSize: number;
|
|
48
|
+
minVideoSeconds: number;
|
|
49
|
+
maxVideoSeconds: number;
|
|
48
50
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
49
51
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
50
52
|
declare const _default: typeof __VLS_export;
|
|
@@ -186,7 +186,9 @@ const props = defineProps({
|
|
|
186
186
|
column: { type: Boolean, required: false, default: false },
|
|
187
187
|
showCover: { type: Boolean, required: false, default: false },
|
|
188
188
|
previewFullSize: { type: Boolean, required: false, default: false },
|
|
189
|
-
previewSize: { type: Number, required: false, default: 98 }
|
|
189
|
+
previewSize: { type: Number, required: false, default: 98 },
|
|
190
|
+
minVideoSeconds: { type: Number, required: false, default: 10 },
|
|
191
|
+
maxVideoSeconds: { type: Number, required: false, default: 60 }
|
|
190
192
|
});
|
|
191
193
|
const isDrag = ref(false);
|
|
192
194
|
const { errorMessage, setErrors } = useField(props.name);
|
|
@@ -231,19 +233,19 @@ const createFileItem = async (file) => {
|
|
|
231
233
|
return null;
|
|
232
234
|
}
|
|
233
235
|
const duration = await getVideoDuration(file);
|
|
234
|
-
if (duration <
|
|
236
|
+
if (props.minVideoSeconds > 0 && duration < props.minVideoSeconds) {
|
|
235
237
|
$alert.show({
|
|
236
238
|
type: "error",
|
|
237
239
|
title: "\u0E40\u0E01\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14 !",
|
|
238
|
-
description:
|
|
240
|
+
description: `\u0E40\u0E19\u0E37\u0E48\u0E2D\u0E07\u0E08\u0E32\u0E01\u0E27\u0E34\u0E14\u0E35\u0E42\u0E2D\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13 \u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 ${props.minVideoSeconds} \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35`
|
|
239
241
|
});
|
|
240
242
|
return null;
|
|
241
243
|
}
|
|
242
|
-
if (duration >
|
|
244
|
+
if (props.maxVideoSeconds > 0 && duration > props.maxVideoSeconds) {
|
|
243
245
|
$alert.show({
|
|
244
246
|
type: "error",
|
|
245
247
|
title: "\u0E40\u0E01\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14 !",
|
|
246
|
-
description:
|
|
248
|
+
description: `\u0E40\u0E19\u0E37\u0E48\u0E2D\u0E07\u0E08\u0E32\u0E01\u0E27\u0E34\u0E14\u0E35\u0E42\u0E2D\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13 \u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27\u0E40\u0E01\u0E34\u0E19 ${props.maxVideoSeconds} \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35`
|
|
247
249
|
});
|
|
248
250
|
return null;
|
|
249
251
|
}
|
|
@@ -45,6 +45,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
45
45
|
showCover: boolean;
|
|
46
46
|
previewFullSize: boolean;
|
|
47
47
|
previewSize: number;
|
|
48
|
+
minVideoSeconds: number;
|
|
49
|
+
maxVideoSeconds: number;
|
|
48
50
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
49
51
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
50
52
|
declare const _default: typeof __VLS_export;
|