pukaad-ui-lib 1.398.0 → 1.400.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
3
  "configKey": "pukaadUI",
4
- "version": "1.398.0",
4
+ "version": "1.400.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -39,7 +39,6 @@ export interface DisplayVideoProps {
39
39
  playButtonAutoHide?: boolean;
40
40
  playButtonHideDelay?: number;
41
41
  clickToPlay?: boolean;
42
- controlsHeight?: number;
43
42
  navButton?: boolean;
44
43
  }
45
44
  type DisplayVideoAction = {
@@ -113,7 +112,6 @@ declare const __VLS_base: import("vue").DefineComponent<DisplayVideoProps, {
113
112
  playButtonAutoHide: boolean;
114
113
  playButtonHideDelay: number;
115
114
  clickToPlay: boolean;
116
- controlsHeight: number;
117
115
  navButton: boolean;
118
116
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
119
117
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -68,12 +68,7 @@
68
68
  </slot>
69
69
 
70
70
  <!-- ปุ่มเลื่อนขึ้นลงวีดีโอ -->
71
- <slot
72
- v-if="props.navButton"
73
- name="nav"
74
- :prev="onPrev"
75
- :next="onNext"
76
- >
71
+ <slot v-if="props.navButton" name="nav" :prev="onPrev" :next="onNext">
77
72
  <div class="absolute top-1/2 right-[16px] -translate-y-1/2 z-10">
78
73
  <div class="flex flex-col gap-[32px] items-center">
79
74
  <Button circle color="dark" class="w-[50px] h-[50px]" @click="onPrev">
@@ -89,7 +84,10 @@
89
84
  <video
90
85
  ref="videoRef"
91
86
  v-bind="$attrs"
92
- :class="props.clickToPlay && 'cursor-pointer'"
87
+ :class="[
88
+ surfaceClickable && 'cursor-pointer',
89
+ props.playButton && 'display-video-no-native-overlay'
90
+ ]"
93
91
  :src="props.src || void 0"
94
92
  :poster="props.poster || void 0"
95
93
  :preload="props.preload"
@@ -99,7 +97,7 @@
99
97
  :muted="props.muted"
100
98
  :playsinline="props.playsinline"
101
99
  :crossorigin="props.crossorigin || void 0"
102
- :controlslist="controlsList || void 0"
100
+ :controlslist="props.controlsList || void 0"
103
101
  :disablepictureinpicture="props.disablePictureInPicture"
104
102
  :disableremoteplayback="props.disableRemotePlayback"
105
103
  :style="{
@@ -166,7 +164,6 @@ const props = defineProps({
166
164
  playButtonAutoHide: { type: Boolean, required: false, default: true },
167
165
  playButtonHideDelay: { type: Number, required: false, default: 600 },
168
166
  clickToPlay: { type: Boolean, required: false, default: false },
169
- controlsHeight: { type: Number, required: false, default: 56 },
170
167
  navButton: { type: Boolean, required: false, default: false }
171
168
  });
172
169
  const videoRef = ref(null);
@@ -177,13 +174,7 @@ const clearHideTimer = () => {
177
174
  if (hideTimer) clearTimeout(hideTimer);
178
175
  hideTimer = void 0;
179
176
  };
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
- });
177
+ const surfaceClickable = computed(() => props.clickToPlay && !props.controls);
187
178
  const toSize = (value) => {
188
179
  if (value === void 0 || value === null || value === "") return void 0;
189
180
  return typeof value === "number" || /^\d+(\.\d+)?$/.test(String(value)) ? `${value}px` : String(value);
@@ -221,13 +212,8 @@ const onPaused = (value) => {
221
212
  showPlayButton.value = false;
222
213
  }, props.playButtonHideDelay);
223
214
  };
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
- }
215
+ const onSurfaceClick = () => {
216
+ if (!surfaceClickable.value) return;
231
217
  onPlayClick();
232
218
  };
233
219
  const onPlayClick = () => {
@@ -248,3 +234,7 @@ const load = () => videoRef.value?.load();
248
234
  const toggle = () => onPlayClick();
249
235
  defineExpose({ videoRef, paused, play, pause, load, toggle });
250
236
  </script>
237
+
238
+ <style scoped>
239
+ .display-video-no-native-overlay::-webkit-media-controls-overlay-play-button{display:none}
240
+ </style>
@@ -39,7 +39,6 @@ export interface DisplayVideoProps {
39
39
  playButtonAutoHide?: boolean;
40
40
  playButtonHideDelay?: number;
41
41
  clickToPlay?: boolean;
42
- controlsHeight?: number;
43
42
  navButton?: boolean;
44
43
  }
45
44
  type DisplayVideoAction = {
@@ -113,7 +112,6 @@ declare const __VLS_base: import("vue").DefineComponent<DisplayVideoProps, {
113
112
  playButtonAutoHide: boolean;
114
113
  playButtonHideDelay: number;
115
114
  clickToPlay: boolean;
116
- controlsHeight: number;
117
115
  navButton: boolean;
118
116
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
119
117
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -59,8 +59,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
59
59
  id: string;
60
60
  name: string;
61
61
  required: boolean;
62
- readonly: boolean;
63
62
  limit: number;
63
+ readonly: boolean;
64
64
  disabledErrorMessage: boolean;
65
65
  disabledBorder: boolean;
66
66
  showCounter: boolean;
@@ -59,8 +59,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
59
59
  id: string;
60
60
  name: string;
61
61
  required: boolean;
62
- readonly: boolean;
63
62
  limit: number;
63
+ readonly: boolean;
64
64
  disabledErrorMessage: boolean;
65
65
  disabledBorder: boolean;
66
66
  showCounter: boolean;
@@ -47,8 +47,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
47
47
  fullHeight: boolean;
48
48
  fullWidth: boolean;
49
49
  rows: number;
50
- readonly: boolean;
51
50
  limit: number;
51
+ readonly: boolean;
52
52
  disabledErrorMessage: boolean;
53
53
  disabledBorder: boolean;
54
54
  showCounter: boolean;
@@ -47,8 +47,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
47
47
  fullHeight: boolean;
48
48
  fullWidth: boolean;
49
49
  rows: number;
50
- readonly: boolean;
51
50
  limit: number;
51
+ readonly: boolean;
52
52
  disabledErrorMessage: boolean;
53
53
  disabledBorder: boolean;
54
54
  showCounter: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.398.0",
3
+ "version": "1.400.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",