pukaad-ui-lib 1.396.0 → 1.398.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/button.d.vue.ts +1 -1
- package/dist/runtime/components/button.vue.d.ts +1 -1
- package/dist/runtime/components/display/display-video.d.vue.ts +126 -0
- package/dist/runtime/components/display/display-video.vue +250 -0
- package/dist/runtime/components/display/display-video.vue.d.ts +126 -0
- package/dist/runtime/components/image/image-cropper.d.vue.ts +3 -3
- package/dist/runtime/components/image/image-cropper.vue.d.ts +3 -3
- package/dist/runtime/components/input/input-autocomplete.d.vue.ts +33 -5
- package/dist/runtime/components/input/input-autocomplete.vue +47 -21
- package/dist/runtime/components/input/input-autocomplete.vue.d.ts +33 -5
- package/dist/runtime/components/input/input-file.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-file.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-link.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-link.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-localized-name.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-localized-name.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-search.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-search.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-suggest.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-suggest.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-text-field.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-text-field.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-textarea.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-textarea.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-typed-field.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-typed-field.vue.d.ts +1 -1
- package/dist/runtime/components/modal/suggest-edit-place/place-Adddateopening.vue +12 -12
- package/dist/runtime/components/modal/suggest-edit-place/place-Adddescription.vue +18 -18
- package/dist/runtime/components/ui/button/index.d.ts +1 -1
- package/dist/runtime/components/ui/button/index.js +37 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -2,7 +2,7 @@ import type { HTMLAttributes } from "vue";
|
|
|
2
2
|
import type { ButtonVariants } from "./ui/button/index.js";
|
|
3
3
|
export type ButtonType = "button" | "submit" | "reset";
|
|
4
4
|
export type ButtonVariant = "default" | "outline" | "ghost" | "link" | "text" | "icon" | "glass";
|
|
5
|
-
export type ButtonColor = "default" | "primary" | "secondary" | "destructive" | "info" | "warning" | "success";
|
|
5
|
+
export type ButtonColor = "default" | "primary" | "secondary" | "destructive" | "info" | "warning" | "success" | "dark";
|
|
6
6
|
export type ButtonSize = ButtonVariants["size"];
|
|
7
7
|
export interface ButtonProps {
|
|
8
8
|
type?: ButtonType;
|
|
@@ -2,7 +2,7 @@ import type { HTMLAttributes } from "vue";
|
|
|
2
2
|
import type { ButtonVariants } from "./ui/button/index.js";
|
|
3
3
|
export type ButtonType = "button" | "submit" | "reset";
|
|
4
4
|
export type ButtonVariant = "default" | "outline" | "ghost" | "link" | "text" | "icon" | "glass";
|
|
5
|
-
export type ButtonColor = "default" | "primary" | "secondary" | "destructive" | "info" | "warning" | "success";
|
|
5
|
+
export type ButtonColor = "default" | "primary" | "secondary" | "destructive" | "info" | "warning" | "success" | "dark";
|
|
6
6
|
export type ButtonSize = ButtonVariants["size"];
|
|
7
7
|
export interface ButtonProps {
|
|
8
8
|
type?: ButtonType;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
export interface DisplayVideoSource {
|
|
2
|
+
src: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
media?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DisplayVideoTrack {
|
|
7
|
+
src: string;
|
|
8
|
+
kind?: "subtitles" | "captions" | "descriptions" | "chapters" | "metadata";
|
|
9
|
+
srclang?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
default?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface DisplayVideoProps {
|
|
14
|
+
src?: string;
|
|
15
|
+
sources?: DisplayVideoSource[];
|
|
16
|
+
tracks?: DisplayVideoTrack[];
|
|
17
|
+
poster?: string;
|
|
18
|
+
width?: string | number;
|
|
19
|
+
height?: string | number;
|
|
20
|
+
fullWidth?: boolean;
|
|
21
|
+
fullHeight?: boolean;
|
|
22
|
+
fit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
23
|
+
controls?: boolean;
|
|
24
|
+
autoplay?: boolean;
|
|
25
|
+
loop?: boolean;
|
|
26
|
+
muted?: boolean;
|
|
27
|
+
playsinline?: boolean;
|
|
28
|
+
preload?: "none" | "metadata" | "auto";
|
|
29
|
+
crossorigin?: "anonymous" | "use-credentials";
|
|
30
|
+
controlsList?: string;
|
|
31
|
+
disablePictureInPicture?: boolean;
|
|
32
|
+
disableRemotePlayback?: boolean;
|
|
33
|
+
volume?: number;
|
|
34
|
+
playbackRate?: number;
|
|
35
|
+
startTime?: number;
|
|
36
|
+
fullscreenButton?: boolean;
|
|
37
|
+
closeButton?: boolean;
|
|
38
|
+
playButton?: boolean;
|
|
39
|
+
playButtonAutoHide?: boolean;
|
|
40
|
+
playButtonHideDelay?: number;
|
|
41
|
+
clickToPlay?: boolean;
|
|
42
|
+
controlsHeight?: number;
|
|
43
|
+
navButton?: boolean;
|
|
44
|
+
}
|
|
45
|
+
type DisplayVideoAction = {
|
|
46
|
+
video: HTMLVideoElement | null;
|
|
47
|
+
currentTime: number;
|
|
48
|
+
paused: boolean;
|
|
49
|
+
};
|
|
50
|
+
declare var __VLS_1: {
|
|
51
|
+
click: () => void;
|
|
52
|
+
}, __VLS_16: {
|
|
53
|
+
click: () => void;
|
|
54
|
+
paused: boolean;
|
|
55
|
+
}, __VLS_43: {
|
|
56
|
+
click: () => void;
|
|
57
|
+
}, __VLS_58: {
|
|
58
|
+
prev: () => void;
|
|
59
|
+
next: () => void;
|
|
60
|
+
}, __VLS_86: {};
|
|
61
|
+
type __VLS_Slots = {} & {
|
|
62
|
+
close?: (props: typeof __VLS_1) => any;
|
|
63
|
+
} & {
|
|
64
|
+
play?: (props: typeof __VLS_16) => any;
|
|
65
|
+
} & {
|
|
66
|
+
fullscreen?: (props: typeof __VLS_43) => any;
|
|
67
|
+
} & {
|
|
68
|
+
nav?: (props: typeof __VLS_58) => any;
|
|
69
|
+
} & {
|
|
70
|
+
default?: (props: typeof __VLS_86) => any;
|
|
71
|
+
};
|
|
72
|
+
declare const __VLS_base: import("vue").DefineComponent<DisplayVideoProps, {
|
|
73
|
+
videoRef: import("vue").Ref<HTMLVideoElement | null, HTMLVideoElement | null>;
|
|
74
|
+
paused: import("vue").Ref<boolean, boolean>;
|
|
75
|
+
play: () => Promise<void> | undefined;
|
|
76
|
+
pause: () => void | undefined;
|
|
77
|
+
load: () => void | undefined;
|
|
78
|
+
toggle: () => void;
|
|
79
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
80
|
+
close: (payload: DisplayVideoAction) => any;
|
|
81
|
+
prev: (payload: DisplayVideoAction) => any;
|
|
82
|
+
next: (payload: DisplayVideoAction) => any;
|
|
83
|
+
fullscreen: (payload: DisplayVideoAction) => any;
|
|
84
|
+
"play-click": (payload: DisplayVideoAction) => any;
|
|
85
|
+
}, string, import("vue").PublicProps, Readonly<DisplayVideoProps> & Readonly<{
|
|
86
|
+
onClose?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
87
|
+
onPrev?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
88
|
+
onNext?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
89
|
+
onFullscreen?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
90
|
+
"onPlay-click"?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
91
|
+
}>, {
|
|
92
|
+
src: string;
|
|
93
|
+
fullHeight: boolean;
|
|
94
|
+
fullWidth: boolean;
|
|
95
|
+
fit: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
96
|
+
poster: string;
|
|
97
|
+
autoplay: boolean;
|
|
98
|
+
muted: boolean;
|
|
99
|
+
loop: boolean;
|
|
100
|
+
controls: boolean;
|
|
101
|
+
preload: "none" | "metadata" | "auto";
|
|
102
|
+
sources: DisplayVideoSource[];
|
|
103
|
+
tracks: DisplayVideoTrack[];
|
|
104
|
+
playsinline: boolean;
|
|
105
|
+
disablePictureInPicture: boolean;
|
|
106
|
+
disableRemotePlayback: boolean;
|
|
107
|
+
volume: number;
|
|
108
|
+
playbackRate: number;
|
|
109
|
+
startTime: number;
|
|
110
|
+
fullscreenButton: boolean;
|
|
111
|
+
closeButton: boolean;
|
|
112
|
+
playButton: boolean;
|
|
113
|
+
playButtonAutoHide: boolean;
|
|
114
|
+
playButtonHideDelay: number;
|
|
115
|
+
clickToPlay: boolean;
|
|
116
|
+
controlsHeight: number;
|
|
117
|
+
navButton: boolean;
|
|
118
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
119
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
120
|
+
declare const _default: typeof __VLS_export;
|
|
121
|
+
export default _default;
|
|
122
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
123
|
+
new (): {
|
|
124
|
+
$slots: S;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="relative inline-flex"
|
|
4
|
+
:class="[props.fullWidth && 'w-full', props.fullHeight && 'h-full']"
|
|
5
|
+
>
|
|
6
|
+
<!-- ปุ่มปิด -->
|
|
7
|
+
<slot v-if="props.closeButton" name="close" :click="onClose">
|
|
8
|
+
<div class="absolute top-[24px] left-[24px] z-10">
|
|
9
|
+
<Button circle color="dark" @click="onClose">
|
|
10
|
+
<Icon name="lucide:x" />
|
|
11
|
+
</Button>
|
|
12
|
+
</div>
|
|
13
|
+
</slot>
|
|
14
|
+
|
|
15
|
+
<!-- ปุ่มเล่น / หยุด -->
|
|
16
|
+
<slot
|
|
17
|
+
v-if="props.playButton"
|
|
18
|
+
name="play"
|
|
19
|
+
:click="onPlayClick"
|
|
20
|
+
:paused="paused"
|
|
21
|
+
>
|
|
22
|
+
<Transition
|
|
23
|
+
enter-active-class="transition duration-200 ease-out"
|
|
24
|
+
enter-from-class="opacity-0 scale-75"
|
|
25
|
+
enter-to-class="opacity-100 scale-100"
|
|
26
|
+
leave-active-class="transition duration-300 ease-out"
|
|
27
|
+
leave-from-class="opacity-100 scale-100"
|
|
28
|
+
leave-to-class="opacity-0 scale-150"
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
v-show="showPlayButton"
|
|
32
|
+
class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-10"
|
|
33
|
+
>
|
|
34
|
+
<Button
|
|
35
|
+
circle
|
|
36
|
+
color="dark"
|
|
37
|
+
class="w-[80px] h-[80px]"
|
|
38
|
+
:aria-label="paused ? '\u0E40\u0E25\u0E48\u0E19' : '\u0E2B\u0E22\u0E38\u0E14'"
|
|
39
|
+
@click="onPlayClick"
|
|
40
|
+
>
|
|
41
|
+
<Transition
|
|
42
|
+
mode="out-in"
|
|
43
|
+
enter-active-class="transition duration-150 ease-out"
|
|
44
|
+
enter-from-class="opacity-0 scale-75"
|
|
45
|
+
enter-to-class="opacity-100 scale-100"
|
|
46
|
+
leave-active-class="transition duration-100 ease-in"
|
|
47
|
+
leave-from-class="opacity-100 scale-100"
|
|
48
|
+
leave-to-class="opacity-0 scale-125"
|
|
49
|
+
>
|
|
50
|
+
<Icon
|
|
51
|
+
:key="paused ? 'play' : 'pause'"
|
|
52
|
+
:name="paused ? 'lucide:play' : 'lucide:pause'"
|
|
53
|
+
class="w-[56px] h-[56px]"
|
|
54
|
+
/>
|
|
55
|
+
</Transition>
|
|
56
|
+
</Button>
|
|
57
|
+
</div>
|
|
58
|
+
</Transition>
|
|
59
|
+
</slot>
|
|
60
|
+
|
|
61
|
+
<!-- ปุ่มขยายเต็มจอ -->
|
|
62
|
+
<slot v-if="props.fullscreenButton" name="fullscreen" :click="onFullscreen">
|
|
63
|
+
<div class="absolute top-[16px] right-[16px] z-10">
|
|
64
|
+
<Button circle color="dark" @click="onFullscreen">
|
|
65
|
+
<Icon name="lucide:maximize" />
|
|
66
|
+
</Button>
|
|
67
|
+
</div>
|
|
68
|
+
</slot>
|
|
69
|
+
|
|
70
|
+
<!-- ปุ่มเลื่อนขึ้นลงวีดีโอ -->
|
|
71
|
+
<slot
|
|
72
|
+
v-if="props.navButton"
|
|
73
|
+
name="nav"
|
|
74
|
+
:prev="onPrev"
|
|
75
|
+
:next="onNext"
|
|
76
|
+
>
|
|
77
|
+
<div class="absolute top-1/2 right-[16px] -translate-y-1/2 z-10">
|
|
78
|
+
<div class="flex flex-col gap-[32px] items-center">
|
|
79
|
+
<Button circle color="dark" class="w-[50px] h-[50px]" @click="onPrev">
|
|
80
|
+
<Icon name="lucide:chevron-up" class="w-[32px] h-[32px]" />
|
|
81
|
+
</Button>
|
|
82
|
+
<Button circle color="dark" class="w-[50px] h-[50px]" @click="onNext">
|
|
83
|
+
<Icon name="lucide:chevron-down" class="w-[32px] h-[32px]" />
|
|
84
|
+
</Button>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</slot>
|
|
88
|
+
|
|
89
|
+
<video
|
|
90
|
+
ref="videoRef"
|
|
91
|
+
v-bind="$attrs"
|
|
92
|
+
:class="props.clickToPlay && 'cursor-pointer'"
|
|
93
|
+
:src="props.src || void 0"
|
|
94
|
+
:poster="props.poster || void 0"
|
|
95
|
+
:preload="props.preload"
|
|
96
|
+
:controls="props.controls"
|
|
97
|
+
:autoplay="props.autoplay"
|
|
98
|
+
:loop="props.loop"
|
|
99
|
+
:muted="props.muted"
|
|
100
|
+
:playsinline="props.playsinline"
|
|
101
|
+
:crossorigin="props.crossorigin || void 0"
|
|
102
|
+
:controlslist="controlsList || void 0"
|
|
103
|
+
:disablepictureinpicture="props.disablePictureInPicture"
|
|
104
|
+
:disableremoteplayback="props.disableRemotePlayback"
|
|
105
|
+
:style="{
|
|
106
|
+
width: props.fullWidth ? '100%' : toSize(props.width),
|
|
107
|
+
height: props.fullHeight ? '100%' : toSize(props.height),
|
|
108
|
+
objectFit: props.fit
|
|
109
|
+
}"
|
|
110
|
+
@click="onSurfaceClick"
|
|
111
|
+
@play="onPaused(false)"
|
|
112
|
+
@pause="onPaused(true)"
|
|
113
|
+
@ended="onPaused(true)"
|
|
114
|
+
>
|
|
115
|
+
<source
|
|
116
|
+
v-for="(source, i_source) in props.sources"
|
|
117
|
+
:key="i_source"
|
|
118
|
+
:src="source.src"
|
|
119
|
+
:type="source.type"
|
|
120
|
+
:media="source.media"
|
|
121
|
+
/>
|
|
122
|
+
<track
|
|
123
|
+
v-for="(track, i_track) in props.tracks"
|
|
124
|
+
:key="i_track"
|
|
125
|
+
:src="track.src"
|
|
126
|
+
:kind="track.kind"
|
|
127
|
+
:srclang="track.srclang"
|
|
128
|
+
:label="track.label"
|
|
129
|
+
:default="track.default"
|
|
130
|
+
/>
|
|
131
|
+
<slot />
|
|
132
|
+
</video>
|
|
133
|
+
</div>
|
|
134
|
+
</template>
|
|
135
|
+
|
|
136
|
+
<script setup>
|
|
137
|
+
import { computed, onBeforeUnmount, onMounted, ref, watch } from "vue";
|
|
138
|
+
defineOptions({ inheritAttrs: false });
|
|
139
|
+
const emit = defineEmits(["fullscreen", "close", "play-click", "prev", "next"]);
|
|
140
|
+
const props = defineProps({
|
|
141
|
+
src: { type: String, required: false, default: "" },
|
|
142
|
+
sources: { type: Array, required: false, default: () => [] },
|
|
143
|
+
tracks: { type: Array, required: false, default: () => [] },
|
|
144
|
+
poster: { type: String, required: false, default: "" },
|
|
145
|
+
width: { type: [String, Number], required: false },
|
|
146
|
+
height: { type: [String, Number], required: false },
|
|
147
|
+
fullWidth: { type: Boolean, required: false, default: false },
|
|
148
|
+
fullHeight: { type: Boolean, required: false, default: false },
|
|
149
|
+
fit: { type: String, required: false, default: "contain" },
|
|
150
|
+
controls: { type: Boolean, required: false, default: true },
|
|
151
|
+
autoplay: { type: Boolean, required: false, default: false },
|
|
152
|
+
loop: { type: Boolean, required: false, default: false },
|
|
153
|
+
muted: { type: Boolean, required: false, default: false },
|
|
154
|
+
playsinline: { type: Boolean, required: false, default: true },
|
|
155
|
+
preload: { type: String, required: false, default: "metadata" },
|
|
156
|
+
crossorigin: { type: String, required: false },
|
|
157
|
+
controlsList: { type: String, required: false },
|
|
158
|
+
disablePictureInPicture: { type: Boolean, required: false, default: false },
|
|
159
|
+
disableRemotePlayback: { type: Boolean, required: false, default: false },
|
|
160
|
+
volume: { type: Number, required: false, default: 1 },
|
|
161
|
+
playbackRate: { type: Number, required: false, default: 1 },
|
|
162
|
+
startTime: { type: Number, required: false, default: 0 },
|
|
163
|
+
fullscreenButton: { type: Boolean, required: false, default: false },
|
|
164
|
+
closeButton: { type: Boolean, required: false, default: false },
|
|
165
|
+
playButton: { type: Boolean, required: false, default: false },
|
|
166
|
+
playButtonAutoHide: { type: Boolean, required: false, default: true },
|
|
167
|
+
playButtonHideDelay: { type: Number, required: false, default: 600 },
|
|
168
|
+
clickToPlay: { type: Boolean, required: false, default: false },
|
|
169
|
+
controlsHeight: { type: Number, required: false, default: 56 },
|
|
170
|
+
navButton: { type: Boolean, required: false, default: false }
|
|
171
|
+
});
|
|
172
|
+
const videoRef = ref(null);
|
|
173
|
+
const paused = ref(true);
|
|
174
|
+
const showPlayButton = ref(true);
|
|
175
|
+
let hideTimer;
|
|
176
|
+
const clearHideTimer = () => {
|
|
177
|
+
if (hideTimer) clearTimeout(hideTimer);
|
|
178
|
+
hideTimer = void 0;
|
|
179
|
+
};
|
|
180
|
+
const controlsList = computed(() => {
|
|
181
|
+
const list = (props.controlsList ?? "").split(" ").filter(Boolean);
|
|
182
|
+
if (props.fullscreenButton && !list.includes("nofullscreen")) {
|
|
183
|
+
list.push("nofullscreen");
|
|
184
|
+
}
|
|
185
|
+
return list.join(" ");
|
|
186
|
+
});
|
|
187
|
+
const toSize = (value) => {
|
|
188
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
189
|
+
return typeof value === "number" || /^\d+(\.\d+)?$/.test(String(value)) ? `${value}px` : String(value);
|
|
190
|
+
};
|
|
191
|
+
const syncPlayback = () => {
|
|
192
|
+
const el = videoRef.value;
|
|
193
|
+
if (!el) return;
|
|
194
|
+
el.muted = props.muted;
|
|
195
|
+
el.volume = props.volume;
|
|
196
|
+
el.playbackRate = props.playbackRate;
|
|
197
|
+
};
|
|
198
|
+
onMounted(() => {
|
|
199
|
+
syncPlayback();
|
|
200
|
+
const el = videoRef.value;
|
|
201
|
+
if (!el) return;
|
|
202
|
+
if (props.startTime) el.currentTime = props.startTime;
|
|
203
|
+
onPaused(el.paused);
|
|
204
|
+
});
|
|
205
|
+
onBeforeUnmount(clearHideTimer);
|
|
206
|
+
watch(() => [props.muted, props.volume, props.playbackRate], syncPlayback);
|
|
207
|
+
const actionPayload = () => ({
|
|
208
|
+
video: videoRef.value,
|
|
209
|
+
currentTime: videoRef.value?.currentTime ?? 0,
|
|
210
|
+
paused: paused.value
|
|
211
|
+
});
|
|
212
|
+
const onPaused = (value) => {
|
|
213
|
+
paused.value = value;
|
|
214
|
+
clearHideTimer();
|
|
215
|
+
if (value || !props.playButtonAutoHide) {
|
|
216
|
+
showPlayButton.value = true;
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
showPlayButton.value = true;
|
|
220
|
+
hideTimer = setTimeout(() => {
|
|
221
|
+
showPlayButton.value = false;
|
|
222
|
+
}, props.playButtonHideDelay);
|
|
223
|
+
};
|
|
224
|
+
const onSurfaceClick = (event) => {
|
|
225
|
+
if (!props.clickToPlay) return;
|
|
226
|
+
const el = videoRef.value;
|
|
227
|
+
if (props.controls && el) {
|
|
228
|
+
const rect = el.getBoundingClientRect();
|
|
229
|
+
if (event.clientY > rect.bottom - props.controlsHeight) return;
|
|
230
|
+
}
|
|
231
|
+
onPlayClick();
|
|
232
|
+
};
|
|
233
|
+
const onPlayClick = () => {
|
|
234
|
+
const el = videoRef.value;
|
|
235
|
+
if (el) {
|
|
236
|
+
if (el.paused) el.play();
|
|
237
|
+
else el.pause();
|
|
238
|
+
}
|
|
239
|
+
emit("play-click", actionPayload());
|
|
240
|
+
};
|
|
241
|
+
const onFullscreen = () => emit("fullscreen", actionPayload());
|
|
242
|
+
const onClose = () => emit("close", actionPayload());
|
|
243
|
+
const onPrev = () => emit("prev", actionPayload());
|
|
244
|
+
const onNext = () => emit("next", actionPayload());
|
|
245
|
+
const play = () => videoRef.value?.play();
|
|
246
|
+
const pause = () => videoRef.value?.pause();
|
|
247
|
+
const load = () => videoRef.value?.load();
|
|
248
|
+
const toggle = () => onPlayClick();
|
|
249
|
+
defineExpose({ videoRef, paused, play, pause, load, toggle });
|
|
250
|
+
</script>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
export interface DisplayVideoSource {
|
|
2
|
+
src: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
media?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DisplayVideoTrack {
|
|
7
|
+
src: string;
|
|
8
|
+
kind?: "subtitles" | "captions" | "descriptions" | "chapters" | "metadata";
|
|
9
|
+
srclang?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
default?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface DisplayVideoProps {
|
|
14
|
+
src?: string;
|
|
15
|
+
sources?: DisplayVideoSource[];
|
|
16
|
+
tracks?: DisplayVideoTrack[];
|
|
17
|
+
poster?: string;
|
|
18
|
+
width?: string | number;
|
|
19
|
+
height?: string | number;
|
|
20
|
+
fullWidth?: boolean;
|
|
21
|
+
fullHeight?: boolean;
|
|
22
|
+
fit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
23
|
+
controls?: boolean;
|
|
24
|
+
autoplay?: boolean;
|
|
25
|
+
loop?: boolean;
|
|
26
|
+
muted?: boolean;
|
|
27
|
+
playsinline?: boolean;
|
|
28
|
+
preload?: "none" | "metadata" | "auto";
|
|
29
|
+
crossorigin?: "anonymous" | "use-credentials";
|
|
30
|
+
controlsList?: string;
|
|
31
|
+
disablePictureInPicture?: boolean;
|
|
32
|
+
disableRemotePlayback?: boolean;
|
|
33
|
+
volume?: number;
|
|
34
|
+
playbackRate?: number;
|
|
35
|
+
startTime?: number;
|
|
36
|
+
fullscreenButton?: boolean;
|
|
37
|
+
closeButton?: boolean;
|
|
38
|
+
playButton?: boolean;
|
|
39
|
+
playButtonAutoHide?: boolean;
|
|
40
|
+
playButtonHideDelay?: number;
|
|
41
|
+
clickToPlay?: boolean;
|
|
42
|
+
controlsHeight?: number;
|
|
43
|
+
navButton?: boolean;
|
|
44
|
+
}
|
|
45
|
+
type DisplayVideoAction = {
|
|
46
|
+
video: HTMLVideoElement | null;
|
|
47
|
+
currentTime: number;
|
|
48
|
+
paused: boolean;
|
|
49
|
+
};
|
|
50
|
+
declare var __VLS_1: {
|
|
51
|
+
click: () => void;
|
|
52
|
+
}, __VLS_16: {
|
|
53
|
+
click: () => void;
|
|
54
|
+
paused: boolean;
|
|
55
|
+
}, __VLS_43: {
|
|
56
|
+
click: () => void;
|
|
57
|
+
}, __VLS_58: {
|
|
58
|
+
prev: () => void;
|
|
59
|
+
next: () => void;
|
|
60
|
+
}, __VLS_86: {};
|
|
61
|
+
type __VLS_Slots = {} & {
|
|
62
|
+
close?: (props: typeof __VLS_1) => any;
|
|
63
|
+
} & {
|
|
64
|
+
play?: (props: typeof __VLS_16) => any;
|
|
65
|
+
} & {
|
|
66
|
+
fullscreen?: (props: typeof __VLS_43) => any;
|
|
67
|
+
} & {
|
|
68
|
+
nav?: (props: typeof __VLS_58) => any;
|
|
69
|
+
} & {
|
|
70
|
+
default?: (props: typeof __VLS_86) => any;
|
|
71
|
+
};
|
|
72
|
+
declare const __VLS_base: import("vue").DefineComponent<DisplayVideoProps, {
|
|
73
|
+
videoRef: import("vue").Ref<HTMLVideoElement | null, HTMLVideoElement | null>;
|
|
74
|
+
paused: import("vue").Ref<boolean, boolean>;
|
|
75
|
+
play: () => Promise<void> | undefined;
|
|
76
|
+
pause: () => void | undefined;
|
|
77
|
+
load: () => void | undefined;
|
|
78
|
+
toggle: () => void;
|
|
79
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
80
|
+
close: (payload: DisplayVideoAction) => any;
|
|
81
|
+
prev: (payload: DisplayVideoAction) => any;
|
|
82
|
+
next: (payload: DisplayVideoAction) => any;
|
|
83
|
+
fullscreen: (payload: DisplayVideoAction) => any;
|
|
84
|
+
"play-click": (payload: DisplayVideoAction) => any;
|
|
85
|
+
}, string, import("vue").PublicProps, Readonly<DisplayVideoProps> & Readonly<{
|
|
86
|
+
onClose?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
87
|
+
onPrev?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
88
|
+
onNext?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
89
|
+
onFullscreen?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
90
|
+
"onPlay-click"?: ((payload: DisplayVideoAction) => any) | undefined;
|
|
91
|
+
}>, {
|
|
92
|
+
src: string;
|
|
93
|
+
fullHeight: boolean;
|
|
94
|
+
fullWidth: boolean;
|
|
95
|
+
fit: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
96
|
+
poster: string;
|
|
97
|
+
autoplay: boolean;
|
|
98
|
+
muted: boolean;
|
|
99
|
+
loop: boolean;
|
|
100
|
+
controls: boolean;
|
|
101
|
+
preload: "none" | "metadata" | "auto";
|
|
102
|
+
sources: DisplayVideoSource[];
|
|
103
|
+
tracks: DisplayVideoTrack[];
|
|
104
|
+
playsinline: boolean;
|
|
105
|
+
disablePictureInPicture: boolean;
|
|
106
|
+
disableRemotePlayback: boolean;
|
|
107
|
+
volume: number;
|
|
108
|
+
playbackRate: number;
|
|
109
|
+
startTime: number;
|
|
110
|
+
fullscreenButton: boolean;
|
|
111
|
+
closeButton: boolean;
|
|
112
|
+
playButton: boolean;
|
|
113
|
+
playButtonAutoHide: boolean;
|
|
114
|
+
playButtonHideDelay: number;
|
|
115
|
+
clickToPlay: boolean;
|
|
116
|
+
controlsHeight: number;
|
|
117
|
+
navButton: boolean;
|
|
118
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
119
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
120
|
+
declare const _default: typeof __VLS_export;
|
|
121
|
+
export default _default;
|
|
122
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
123
|
+
new (): {
|
|
124
|
+
$slots: S;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
|
|
|
64
64
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
|
|
65
65
|
src: string;
|
|
66
66
|
center: boolean;
|
|
67
|
-
|
|
68
|
-
modal: boolean;
|
|
67
|
+
crossorigin: "" | "anonymous" | "use-credentials";
|
|
69
68
|
responsive: boolean;
|
|
70
69
|
restore: boolean;
|
|
71
70
|
checkCrossOrigin: boolean;
|
|
72
71
|
checkOrientation: boolean;
|
|
73
|
-
|
|
72
|
+
modal: boolean;
|
|
74
73
|
guides: boolean;
|
|
75
74
|
highlight: boolean;
|
|
75
|
+
background: boolean;
|
|
76
76
|
autoCrop: boolean;
|
|
77
77
|
movable: boolean;
|
|
78
78
|
rotatable: boolean;
|
|
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
|
|
|
64
64
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
|
|
65
65
|
src: string;
|
|
66
66
|
center: boolean;
|
|
67
|
-
|
|
68
|
-
modal: boolean;
|
|
67
|
+
crossorigin: "" | "anonymous" | "use-credentials";
|
|
69
68
|
responsive: boolean;
|
|
70
69
|
restore: boolean;
|
|
71
70
|
checkCrossOrigin: boolean;
|
|
72
71
|
checkOrientation: boolean;
|
|
73
|
-
|
|
72
|
+
modal: boolean;
|
|
74
73
|
guides: boolean;
|
|
75
74
|
highlight: boolean;
|
|
75
|
+
background: boolean;
|
|
76
76
|
autoCrop: boolean;
|
|
77
77
|
movable: boolean;
|
|
78
78
|
rotatable: boolean;
|
|
@@ -3,6 +3,7 @@ interface AutocompleteOption {
|
|
|
3
3
|
label: string;
|
|
4
4
|
description?: string;
|
|
5
5
|
value: string | number;
|
|
6
|
+
[key: string]: any;
|
|
6
7
|
}
|
|
7
8
|
interface FetchFnResult {
|
|
8
9
|
data: Record<string, any>[];
|
|
@@ -31,19 +32,38 @@ interface InputAutocompleteProps {
|
|
|
31
32
|
valueKey?: string;
|
|
32
33
|
labelKey?: string;
|
|
33
34
|
pageSize?: number;
|
|
35
|
+
iconPosition?: "left" | "right";
|
|
36
|
+
icon?: string;
|
|
37
|
+
disabledIcon?: boolean;
|
|
34
38
|
}
|
|
35
39
|
type __VLS_Props = InputAutocompleteProps;
|
|
36
40
|
type __VLS_ModelProps = {
|
|
37
|
-
modelValue?:
|
|
41
|
+
modelValue?: any;
|
|
38
42
|
};
|
|
39
43
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
40
|
-
declare
|
|
44
|
+
declare var __VLS_27: {}, __VLS_37: {}, __VLS_63: {
|
|
45
|
+
option: AutocompleteOption;
|
|
46
|
+
};
|
|
47
|
+
type __VLS_Slots = {} & {
|
|
48
|
+
prepend?: (props: typeof __VLS_27) => any;
|
|
49
|
+
} & {
|
|
50
|
+
append?: (props: typeof __VLS_37) => any;
|
|
51
|
+
} & {
|
|
52
|
+
option?: (props: typeof __VLS_63) => any;
|
|
53
|
+
};
|
|
54
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
41
55
|
setErrors: (errMsg: string[]) => void;
|
|
42
56
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
|
-
"update:modelValue": (value:
|
|
57
|
+
"update:modelValue": (value: any) => any;
|
|
58
|
+
} & {
|
|
59
|
+
select: (option: AutocompleteOption) => any;
|
|
60
|
+
clear: () => any;
|
|
44
61
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
45
|
-
|
|
62
|
+
onSelect?: ((option: AutocompleteOption) => any) | undefined;
|
|
63
|
+
onClear?: (() => any) | undefined;
|
|
64
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
46
65
|
}>, {
|
|
66
|
+
icon: string;
|
|
47
67
|
pageSize: number;
|
|
48
68
|
id: string;
|
|
49
69
|
name: string;
|
|
@@ -52,13 +72,21 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
52
72
|
options: AutocompleteOption[] | string[] | number[];
|
|
53
73
|
labelKey: string;
|
|
54
74
|
placeholder: string;
|
|
75
|
+
limit: number;
|
|
55
76
|
disabledErrorMessage: boolean;
|
|
56
77
|
disabledBorder: boolean;
|
|
57
78
|
showCounter: boolean;
|
|
58
|
-
limit: number;
|
|
59
79
|
returnObject: boolean;
|
|
60
80
|
freeText: boolean;
|
|
61
81
|
valueKey: string;
|
|
82
|
+
iconPosition: "left" | "right";
|
|
83
|
+
disabledIcon: boolean;
|
|
62
84
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
85
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
63
86
|
declare const _default: typeof __VLS_export;
|
|
64
87
|
export default _default;
|
|
88
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
89
|
+
new (): {
|
|
90
|
+
$slots: S;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
@@ -19,13 +19,32 @@
|
|
|
19
19
|
:show-counter="props.showCounter"
|
|
20
20
|
:limit="props.limit"
|
|
21
21
|
>
|
|
22
|
-
<template
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
<template
|
|
23
|
+
v-if="$slots.prepend || props.iconPosition === 'left' && !props.disabledIcon"
|
|
24
|
+
#prepend
|
|
25
|
+
>
|
|
26
|
+
<slot name="prepend">
|
|
27
|
+
<Icon
|
|
28
|
+
:name="props.icon"
|
|
29
|
+
size="16"
|
|
30
|
+
class="cursor-pointer text-black"
|
|
31
|
+
@mousedown.stop.prevent="open = true"
|
|
32
|
+
/>
|
|
33
|
+
</slot>
|
|
34
|
+
</template>
|
|
35
|
+
<template
|
|
36
|
+
v-if="$slots.append || modelValue || props.iconPosition === 'right' && !props.disabledIcon"
|
|
37
|
+
#append
|
|
38
|
+
>
|
|
39
|
+
<slot name="append">
|
|
40
|
+
<Icon
|
|
41
|
+
v-if="modelValue || props.iconPosition === 'right' && !props.disabledIcon"
|
|
42
|
+
@mousedown.stop.prevent="handleIconMouseDown"
|
|
43
|
+
:name="modelValue ? 'lucide:x' : props.icon"
|
|
44
|
+
size="16"
|
|
45
|
+
class="cursor-pointer text-black"
|
|
46
|
+
/>
|
|
47
|
+
</slot>
|
|
29
48
|
</template>
|
|
30
49
|
</InputTextField>
|
|
31
50
|
</ShadPopoverAnchor>
|
|
@@ -53,19 +72,21 @@
|
|
|
53
72
|
class="cursor-pointer hover:bg-smoke flex items-center gap-[8px] px-[8px] py-[6px]"
|
|
54
73
|
@mousedown.prevent="selectOption(option)"
|
|
55
74
|
>
|
|
56
|
-
<
|
|
57
|
-
<div class="
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
75
|
+
<slot name="option" :option="option">
|
|
76
|
+
<div class="flex flex-col gap-[4px] w-full">
|
|
77
|
+
<div class="font-body-medium">
|
|
78
|
+
{{ option.label }}
|
|
79
|
+
</div>
|
|
80
|
+
<div v-if="option.description" class="font-body-small text-gray">
|
|
81
|
+
{{ option.description }}
|
|
82
|
+
</div>
|
|
62
83
|
</div>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
84
|
+
<Icon
|
|
85
|
+
v-if="modelValue === option.value"
|
|
86
|
+
name="lucide:check"
|
|
87
|
+
size="16"
|
|
88
|
+
/>
|
|
89
|
+
</slot>
|
|
69
90
|
</div>
|
|
70
91
|
|
|
71
92
|
<!-- Loading Indicator -->
|
|
@@ -105,9 +126,13 @@ const props = defineProps({
|
|
|
105
126
|
fetchFn: { type: Function, required: false },
|
|
106
127
|
valueKey: { type: String, required: false, default: "value" },
|
|
107
128
|
labelKey: { type: String, required: false, default: "label" },
|
|
108
|
-
pageSize: { type: Number, required: false, default: 10 }
|
|
129
|
+
pageSize: { type: Number, required: false, default: 10 },
|
|
130
|
+
iconPosition: { type: String, required: false, default: "right" },
|
|
131
|
+
icon: { type: String, required: false, default: "lucide:search" },
|
|
132
|
+
disabledIcon: { type: Boolean, required: false, default: false }
|
|
109
133
|
});
|
|
110
|
-
const
|
|
134
|
+
const emit = defineEmits(["select", "clear"]);
|
|
135
|
+
const modelValue = defineModel({ type: null, ...{
|
|
111
136
|
default: ""
|
|
112
137
|
} });
|
|
113
138
|
const open = ref(false);
|
|
@@ -138,6 +163,7 @@ const fetchData = async (reset = false) => {
|
|
|
138
163
|
);
|
|
139
164
|
if (res && res.data) {
|
|
140
165
|
const mapped = res.data.map((item) => ({
|
|
166
|
+
...item,
|
|
141
167
|
value: typeof item[props.valueKey] === "number" ? item[props.valueKey] : String(item[props.valueKey]),
|
|
142
168
|
label: String(item[props.labelKey]),
|
|
143
169
|
description: item.description ? String(item.description) : void 0
|
|
@@ -3,6 +3,7 @@ interface AutocompleteOption {
|
|
|
3
3
|
label: string;
|
|
4
4
|
description?: string;
|
|
5
5
|
value: string | number;
|
|
6
|
+
[key: string]: any;
|
|
6
7
|
}
|
|
7
8
|
interface FetchFnResult {
|
|
8
9
|
data: Record<string, any>[];
|
|
@@ -31,19 +32,38 @@ interface InputAutocompleteProps {
|
|
|
31
32
|
valueKey?: string;
|
|
32
33
|
labelKey?: string;
|
|
33
34
|
pageSize?: number;
|
|
35
|
+
iconPosition?: "left" | "right";
|
|
36
|
+
icon?: string;
|
|
37
|
+
disabledIcon?: boolean;
|
|
34
38
|
}
|
|
35
39
|
type __VLS_Props = InputAutocompleteProps;
|
|
36
40
|
type __VLS_ModelProps = {
|
|
37
|
-
modelValue?:
|
|
41
|
+
modelValue?: any;
|
|
38
42
|
};
|
|
39
43
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
40
|
-
declare
|
|
44
|
+
declare var __VLS_27: {}, __VLS_37: {}, __VLS_63: {
|
|
45
|
+
option: AutocompleteOption;
|
|
46
|
+
};
|
|
47
|
+
type __VLS_Slots = {} & {
|
|
48
|
+
prepend?: (props: typeof __VLS_27) => any;
|
|
49
|
+
} & {
|
|
50
|
+
append?: (props: typeof __VLS_37) => any;
|
|
51
|
+
} & {
|
|
52
|
+
option?: (props: typeof __VLS_63) => any;
|
|
53
|
+
};
|
|
54
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
41
55
|
setErrors: (errMsg: string[]) => void;
|
|
42
56
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
|
-
"update:modelValue": (value:
|
|
57
|
+
"update:modelValue": (value: any) => any;
|
|
58
|
+
} & {
|
|
59
|
+
select: (option: AutocompleteOption) => any;
|
|
60
|
+
clear: () => any;
|
|
44
61
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
45
|
-
|
|
62
|
+
onSelect?: ((option: AutocompleteOption) => any) | undefined;
|
|
63
|
+
onClear?: (() => any) | undefined;
|
|
64
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
46
65
|
}>, {
|
|
66
|
+
icon: string;
|
|
47
67
|
pageSize: number;
|
|
48
68
|
id: string;
|
|
49
69
|
name: string;
|
|
@@ -52,13 +72,21 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
52
72
|
options: AutocompleteOption[] | string[] | number[];
|
|
53
73
|
labelKey: string;
|
|
54
74
|
placeholder: string;
|
|
75
|
+
limit: number;
|
|
55
76
|
disabledErrorMessage: boolean;
|
|
56
77
|
disabledBorder: boolean;
|
|
57
78
|
showCounter: boolean;
|
|
58
|
-
limit: number;
|
|
59
79
|
returnObject: boolean;
|
|
60
80
|
freeText: boolean;
|
|
61
81
|
valueKey: string;
|
|
82
|
+
iconPosition: "left" | "right";
|
|
83
|
+
disabledIcon: boolean;
|
|
62
84
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
85
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
63
86
|
declare const _default: typeof __VLS_export;
|
|
64
87
|
export default _default;
|
|
88
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
89
|
+
new (): {
|
|
90
|
+
$slots: S;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
@@ -34,8 +34,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
34
34
|
name: string;
|
|
35
35
|
fullHeight: boolean;
|
|
36
36
|
fullWidth: boolean;
|
|
37
|
-
disabledErrorMessage: boolean;
|
|
38
37
|
limit: number;
|
|
38
|
+
disabledErrorMessage: boolean;
|
|
39
39
|
accept: string;
|
|
40
40
|
labelIcon: string;
|
|
41
41
|
disabledDrop: boolean;
|
|
@@ -34,8 +34,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
34
34
|
name: string;
|
|
35
35
|
fullHeight: boolean;
|
|
36
36
|
fullWidth: boolean;
|
|
37
|
-
disabledErrorMessage: boolean;
|
|
38
37
|
limit: number;
|
|
38
|
+
disabledErrorMessage: boolean;
|
|
39
39
|
accept: string;
|
|
40
40
|
labelIcon: string;
|
|
41
41
|
disabledDrop: boolean;
|
|
@@ -17,8 +17,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
17
17
|
label: string;
|
|
18
18
|
name: string;
|
|
19
19
|
modelValue: InputLinkItem[] | ContactChannel[];
|
|
20
|
-
showCounter: boolean;
|
|
21
20
|
limit: number;
|
|
21
|
+
showCounter: boolean;
|
|
22
22
|
format: "legacy" | "contact_channel";
|
|
23
23
|
hideType: boolean;
|
|
24
24
|
hideAddButton: boolean;
|
|
@@ -17,8 +17,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
17
17
|
label: string;
|
|
18
18
|
name: string;
|
|
19
19
|
modelValue: InputLinkItem[] | ContactChannel[];
|
|
20
|
-
showCounter: boolean;
|
|
21
20
|
limit: number;
|
|
21
|
+
showCounter: boolean;
|
|
22
22
|
format: "legacy" | "contact_channel";
|
|
23
23
|
hideType: boolean;
|
|
24
24
|
hideAddButton: boolean;
|
|
@@ -13,8 +13,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
13
13
|
modelValue: LocalizedNameItem[];
|
|
14
14
|
options: InputSelectItem[];
|
|
15
15
|
placeholder: string;
|
|
16
|
-
showCounter: boolean;
|
|
17
16
|
limit: number;
|
|
17
|
+
showCounter: boolean;
|
|
18
18
|
addLabel: string;
|
|
19
19
|
removable: boolean;
|
|
20
20
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -13,8 +13,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
13
13
|
modelValue: LocalizedNameItem[];
|
|
14
14
|
options: InputSelectItem[];
|
|
15
15
|
placeholder: string;
|
|
16
|
-
showCounter: boolean;
|
|
17
16
|
limit: number;
|
|
17
|
+
showCounter: boolean;
|
|
18
18
|
addLabel: string;
|
|
19
19
|
removable: boolean;
|
|
20
20
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -39,8 +39,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
39
39
|
placeholder: string;
|
|
40
40
|
readonly: boolean;
|
|
41
41
|
disabledErrorMessage: boolean;
|
|
42
|
-
disabledIcon: boolean;
|
|
43
42
|
iconPosition: import("#pukaad-ui/types/components/input/input-search").InputSearchIconPosition;
|
|
43
|
+
disabledIcon: boolean;
|
|
44
44
|
roundedFull: boolean;
|
|
45
45
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
46
46
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -39,8 +39,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
39
39
|
placeholder: string;
|
|
40
40
|
readonly: boolean;
|
|
41
41
|
disabledErrorMessage: boolean;
|
|
42
|
-
disabledIcon: boolean;
|
|
43
42
|
iconPosition: import("#pukaad-ui/types/components/input/input-search").InputSearchIconPosition;
|
|
43
|
+
disabledIcon: boolean;
|
|
44
44
|
roundedFull: boolean;
|
|
45
45
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
46
46
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -22,10 +22,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
22
22
|
description: string;
|
|
23
23
|
labelKey: string;
|
|
24
24
|
placeholder: string;
|
|
25
|
+
limit: number;
|
|
25
26
|
disabledErrorMessage: boolean;
|
|
26
27
|
disabledBorder: boolean;
|
|
27
28
|
showCounter: boolean;
|
|
28
|
-
limit: number;
|
|
29
29
|
descriptionKey: string;
|
|
30
30
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
31
|
declare const _default: typeof __VLS_export;
|
|
@@ -22,10 +22,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
22
22
|
description: string;
|
|
23
23
|
labelKey: string;
|
|
24
24
|
placeholder: string;
|
|
25
|
+
limit: number;
|
|
25
26
|
disabledErrorMessage: boolean;
|
|
26
27
|
disabledBorder: boolean;
|
|
27
28
|
showCounter: boolean;
|
|
28
|
-
limit: number;
|
|
29
29
|
descriptionKey: string;
|
|
30
30
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
31
|
declare const _default: typeof __VLS_export;
|
|
@@ -60,10 +60,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
60
60
|
name: string;
|
|
61
61
|
required: boolean;
|
|
62
62
|
readonly: boolean;
|
|
63
|
+
limit: number;
|
|
63
64
|
disabledErrorMessage: boolean;
|
|
64
65
|
disabledBorder: boolean;
|
|
65
66
|
showCounter: boolean;
|
|
66
|
-
limit: number;
|
|
67
67
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
68
68
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
69
69
|
declare const _default: typeof __VLS_export;
|
|
@@ -60,10 +60,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
60
60
|
name: string;
|
|
61
61
|
required: boolean;
|
|
62
62
|
readonly: boolean;
|
|
63
|
+
limit: number;
|
|
63
64
|
disabledErrorMessage: boolean;
|
|
64
65
|
disabledBorder: boolean;
|
|
65
66
|
showCounter: boolean;
|
|
66
|
-
limit: number;
|
|
67
67
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
68
68
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
69
69
|
declare const _default: typeof __VLS_export;
|
|
@@ -48,10 +48,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
48
48
|
fullWidth: boolean;
|
|
49
49
|
rows: number;
|
|
50
50
|
readonly: boolean;
|
|
51
|
+
limit: number;
|
|
51
52
|
disabledErrorMessage: boolean;
|
|
52
53
|
disabledBorder: boolean;
|
|
53
54
|
showCounter: boolean;
|
|
54
|
-
limit: number;
|
|
55
55
|
heightScroll: boolean;
|
|
56
56
|
spaceToComma: boolean;
|
|
57
57
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -48,10 +48,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
48
48
|
fullWidth: boolean;
|
|
49
49
|
rows: number;
|
|
50
50
|
readonly: boolean;
|
|
51
|
+
limit: number;
|
|
51
52
|
disabledErrorMessage: boolean;
|
|
52
53
|
disabledBorder: boolean;
|
|
53
54
|
showCounter: boolean;
|
|
54
|
-
limit: number;
|
|
55
55
|
heightScroll: boolean;
|
|
56
56
|
spaceToComma: boolean;
|
|
57
57
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
22
22
|
name: string;
|
|
23
23
|
required: boolean;
|
|
24
24
|
options: import("../../../types/components/input/input-select.js").InputSelectItem[];
|
|
25
|
-
showCounter: boolean;
|
|
26
25
|
limit: number;
|
|
26
|
+
showCounter: boolean;
|
|
27
27
|
removable: boolean;
|
|
28
28
|
selectClass: import("vue").HTMLAttributes["class"];
|
|
29
29
|
resetOnTypeChange: boolean;
|
|
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
22
22
|
name: string;
|
|
23
23
|
required: boolean;
|
|
24
24
|
options: import("../../../types/components/input/input-select.js").InputSelectItem[];
|
|
25
|
-
showCounter: boolean;
|
|
26
25
|
limit: number;
|
|
26
|
+
showCounter: boolean;
|
|
27
27
|
removable: boolean;
|
|
28
28
|
selectClass: import("vue").HTMLAttributes["class"];
|
|
29
29
|
resetOnTypeChange: boolean;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="flex flex-col gap-[16px]">
|
|
3
|
-
<div class="flex gap-[8px] items-center">
|
|
4
|
-
<Icon name="lucide:clock" :size="20" class="text-primary shrink-0" />
|
|
5
|
-
<div class="font-body-large-prominent">เพิ่มวัน เวลาทำการ</div>
|
|
6
|
-
</div>
|
|
7
|
-
<InputDateOpening name="new_opening_hours" v-model="newOpeningHours" />
|
|
8
|
-
<InputDateOpeningSpecial
|
|
9
|
-
v-if="isNewOpeningHoursCompleted"
|
|
10
|
-
name="new_special_days"
|
|
11
|
-
v-model="newSpecialDays"
|
|
12
|
-
/>
|
|
13
|
-
</div>
|
|
2
|
+
<div class="flex flex-col gap-[16px]">
|
|
3
|
+
<div class="flex gap-[8px] items-center">
|
|
4
|
+
<Icon name="lucide:clock" :size="20" class="text-primary shrink-0" />
|
|
5
|
+
<div class="font-body-large-prominent">เพิ่มวัน เวลาทำการ</div>
|
|
6
|
+
</div>
|
|
7
|
+
<InputDateOpening name="new_opening_hours" v-model="newOpeningHours" />
|
|
8
|
+
<InputDateOpeningSpecial
|
|
9
|
+
v-if="isNewOpeningHoursCompleted"
|
|
10
|
+
name="new_special_days"
|
|
11
|
+
v-model="newSpecialDays"
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script setup>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="flex flex-col gap-[16px]">
|
|
3
|
-
<div class="flex gap-[8px] items-center">
|
|
4
|
-
<Icon
|
|
5
|
-
name="lucide:circle-alert"
|
|
6
|
-
:size="20"
|
|
7
|
-
class="text-primary shrink-0"
|
|
8
|
-
/>
|
|
9
|
-
<div class="font-body-large-prominent">เพิ่มคำอธิบาย</div>
|
|
10
|
-
</div>
|
|
11
|
-
<InputTextarea
|
|
12
|
-
name="new_description"
|
|
13
|
-
v-model="descriptionValue"
|
|
14
|
-
label="คำอธิบาย"
|
|
15
|
-
placeholder="คำอธิบายเกี่ยวกับสถานที่ (สูงสุด 220 ตัวอักษร)"
|
|
16
|
-
:limit="220"
|
|
17
|
-
show-counter
|
|
18
|
-
/>
|
|
19
|
-
</div>
|
|
2
|
+
<div class="flex flex-col gap-[16px]">
|
|
3
|
+
<div class="flex gap-[8px] items-center">
|
|
4
|
+
<Icon
|
|
5
|
+
name="lucide:circle-alert"
|
|
6
|
+
:size="20"
|
|
7
|
+
class="text-primary shrink-0"
|
|
8
|
+
/>
|
|
9
|
+
<div class="font-body-large-prominent">เพิ่มคำอธิบาย</div>
|
|
10
|
+
</div>
|
|
11
|
+
<InputTextarea
|
|
12
|
+
name="new_description"
|
|
13
|
+
v-model="descriptionValue"
|
|
14
|
+
label="คำอธิบาย"
|
|
15
|
+
placeholder="คำอธิบายเกี่ยวกับสถานที่ (สูงสุด 220 ตัวอักษร)"
|
|
16
|
+
:limit="220"
|
|
17
|
+
show-counter
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script setup>
|
|
@@ -2,7 +2,7 @@ import type { VariantProps } from "class-variance-authority";
|
|
|
2
2
|
export { default as Button } from "./Button.vue.js";
|
|
3
3
|
export declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "link" | "text" | "default" | "outline" | "ghost" | "icon" | "glass" | null | undefined;
|
|
5
|
-
color?: "default" | "primary" | "secondary" | "destructive" | "info" | "warning" | "success" | null | undefined;
|
|
5
|
+
color?: "default" | "primary" | "secondary" | "destructive" | "info" | "warning" | "success" | "dark" | null | undefined;
|
|
6
6
|
size?: "default" | "icon" | "sm" | "lg" | "icon-sm" | "icon-xs" | "icon-lg" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
export type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
@@ -20,7 +20,8 @@ export const buttonVariants = cva(
|
|
|
20
20
|
destructive: "text-destructive",
|
|
21
21
|
info: "text-info-foreground",
|
|
22
22
|
warning: "text-warning",
|
|
23
|
-
success: "text-success"
|
|
23
|
+
success: "text-success",
|
|
24
|
+
dark: "text-dark"
|
|
24
25
|
},
|
|
25
26
|
size: {
|
|
26
27
|
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
@@ -68,6 +69,11 @@ export const buttonVariants = cva(
|
|
|
68
69
|
color: "success",
|
|
69
70
|
class: "bg-success text-white hover:bg-success/90"
|
|
70
71
|
},
|
|
72
|
+
{
|
|
73
|
+
variant: "default",
|
|
74
|
+
color: "dark",
|
|
75
|
+
class: "bg-dark text-white hover:bg-dark/90"
|
|
76
|
+
},
|
|
71
77
|
{
|
|
72
78
|
variant: "outline",
|
|
73
79
|
color: "default",
|
|
@@ -103,6 +109,11 @@ export const buttonVariants = cva(
|
|
|
103
109
|
color: "success",
|
|
104
110
|
class: "border border-success text-success hover:text-success/90 bg-white"
|
|
105
111
|
},
|
|
112
|
+
{
|
|
113
|
+
variant: "outline",
|
|
114
|
+
color: "dark",
|
|
115
|
+
class: "border border-dark text-dark hover:text-dark/80 bg-white"
|
|
116
|
+
},
|
|
106
117
|
{
|
|
107
118
|
variant: "ghost",
|
|
108
119
|
color: "default",
|
|
@@ -138,6 +149,11 @@ export const buttonVariants = cva(
|
|
|
138
149
|
color: "success",
|
|
139
150
|
class: "text-success hover:bg-success/90 hover:text-white"
|
|
140
151
|
},
|
|
152
|
+
{
|
|
153
|
+
variant: "ghost",
|
|
154
|
+
color: "dark",
|
|
155
|
+
class: "text-dark hover:bg-dark hover:text-white"
|
|
156
|
+
},
|
|
141
157
|
{
|
|
142
158
|
variant: "icon",
|
|
143
159
|
color: "default",
|
|
@@ -173,12 +189,22 @@ export const buttonVariants = cva(
|
|
|
173
189
|
color: "success",
|
|
174
190
|
class: "text-success hover:bg-success/90 hover:text-white"
|
|
175
191
|
},
|
|
192
|
+
{
|
|
193
|
+
variant: "icon",
|
|
194
|
+
color: "dark",
|
|
195
|
+
class: "text-dark hover:bg-dark hover:text-white"
|
|
196
|
+
},
|
|
176
197
|
// glass variant - โปร่งบนพื้นรูป ไอคอนขาวตลอด hover ถึงเป็นสีเต็ม
|
|
177
198
|
{
|
|
178
199
|
variant: "glass",
|
|
179
200
|
color: "primary",
|
|
180
201
|
class: "bg-black/30 text-white hover:bg-primary"
|
|
181
202
|
},
|
|
203
|
+
{
|
|
204
|
+
variant: "glass",
|
|
205
|
+
color: "dark",
|
|
206
|
+
class: "bg-black/30 text-white hover:bg-dark"
|
|
207
|
+
},
|
|
182
208
|
// text variant - just plain text with color, no background or hover effects
|
|
183
209
|
{
|
|
184
210
|
variant: "text",
|
|
@@ -215,6 +241,11 @@ export const buttonVariants = cva(
|
|
|
215
241
|
color: "success",
|
|
216
242
|
class: "text-success hover:opacity-80"
|
|
217
243
|
},
|
|
244
|
+
{
|
|
245
|
+
variant: "text",
|
|
246
|
+
color: "dark",
|
|
247
|
+
class: "text-dark hover:opacity-80"
|
|
248
|
+
},
|
|
218
249
|
// link variant - inline link style, primary blue by default, no padding
|
|
219
250
|
{
|
|
220
251
|
variant: "link",
|
|
@@ -250,6 +281,11 @@ export const buttonVariants = cva(
|
|
|
250
281
|
variant: "link",
|
|
251
282
|
color: "success",
|
|
252
283
|
class: "text-success hover:opacity-80"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
variant: "link",
|
|
287
|
+
color: "dark",
|
|
288
|
+
class: "text-dark hover:opacity-80"
|
|
253
289
|
}
|
|
254
290
|
],
|
|
255
291
|
defaultVariants: {
|