forked from vexip-ui/vexip-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(video): add Video component (vexip-ui#426)
* chore: create component * wip: update * wip: update * wip: update * wip: update * wip: update * wip: update * wip: update * wip: update * wip: update * wip: update * revert: re-adjust outline-color to outline fix vexip-ui#433 * perf(tooltip): dynamically render popper element * feat(ellipsis): add tip-shift prop * chore(tooltip): effective unit tests * fix(auto-complete): correct behavior when directly input fix vexip-ui#434 * refactor(table): improve fixed columns implement and support column group (vexip-ui#435) * wip: update * feat: support column group * docs: update demos * docs: update apis * chore: transfer to setup script * wip: side padding * fix: side padding * chore: group no-ellipsis prop * chore: group text-align prop * chore: col resize * chore: update * chore(tooltip): effective unit tests * chore: update * chore: update * release(hooks): v2.1.1 * release: v2.2.12 * fix(table): ensure tree table work with virtual * feat(table): add formatter prop for column * fix(select): correct composition behavior for filter input * release: v2.2.13 * fix(table): incorrect treeExpanded initialization of rows * chore(toast): transfer to use setup script * feat(hooks): add watchPauseable util method * chore(hooks): create test config * fix(table): ensure correct row span for head cell when refresh * feat(table): add refreshData api method * feat(table): add data-filter prop * chore(tree): transfer to setup script * feat(tree): support only filter leaf nodes * fix: normalize component inherit class name * fix: normalize input-base components composition events * chore: compatible composition end process * feat(utils): flatTree add buildId option * feat(utils): walkTree callabck add parent parameter * refactor(tree): avoid invade data when parsing by tree structure * feat(utils): add isIterable and mapTree methods * feat(utils): add filterTree method * feat(tree): add getTreeData and getFlattedData api methods * release(utils): v2.6.0 * release(hooks): v2.2.0 * release: v2.2.14 * docs: update tree preset types * release(scripts): v1.1.2 * feat(table): add no-transition prop * feat(utils): async debounceMinor and debounceFrame * fix(tree): unexcepted expanding state changed * feat(native-scroll): async refresh and ensureInView methods * feat(scroll): async api methods * fix(native-scroll): no emit event when sync scroll position * perf(scrollbar): remove overused throttle for move process * fix(hooks): useVirtual support wrapper changed * chore(virtual-list): using renderSlot to create items * perf(table): improve table cell span computation * fix(confirm): ensure api method work * perf(table): improve performance of virtual scrolling (vexip-ui#436) * wip: update * wip: update * wip: update * wip: update * fix(table): correct flatted structure after drop * feat(table): support inherit provided config when using columns and summaries props * chore(table): make unit tests pass * feat(full-screen): provide inner place for transfer elements * fix(tree): rename empty-tip prop to empty-text * types: normalize transfer prop type for default config * types: normalize MaybeRef type * feat(message): add transferTo method * feat(notice): add transferTo method * feat(toast): add transferTo method * feat(loading): add transferTo method * feat(contextmenu): support target option * feat(confirm): add transferTo method * chore: ensure element be removed after destroy plugin * release(utils): v2.7.0 * release(hooks): v2.2.1 * release(config): v1.3.1 * release: v2.2.15 * docs(table): remove non-existent prop api * fix(table): correct tree render when using virtual (vexip-ui#437) * wip: update * fix: correct tree process * ci: deploy docs when publish * fix(table): rename helper methods by more accurate names * feat(table): add ellipsis prop * release: v2.2.16 * ci: extract deploy docs workflow * chore(utils): export BITree tree array * fix(table): correct compute and refresh cell height when using tree * chore: transfer some components to setup script * ci: adjust deploy docs workflow trigger * chore: update README.md * feat(tag): add disabled prop * fix: correct disabled and readonly of form control components fix vexip-ui#438 * fix(overflow): correct rest count when using suffix * fix(select): ensure selected slot work with filter fix vexip-ui#439 * chore: transfer some components to setup script * feat(wheel): add no-transition prop * release(utils): v2.7.1 * release: v2.2.17 * wip: control layout * feat: switch to lucide * docs: update * docs: update * chore: update * chore: update * wip: segments * wip: update * docs: update * feat: add shortcuts * docs: update * test: update * docs: update * test: update * chore: update lock file * chore: update lock file * chore: update
- Loading branch information
Showing
69 changed files
with
3,233 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import '@/components/preset/css' | ||
import '@/components/full-screen/css' | ||
import '@/components/option/css' | ||
import '@/css/video.css' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { doubleDigits, leaveNumber } from '@vexip-ui/utils' | ||
|
||
import type { IconOptions, IconValue } from '@vexip-ui/config' | ||
|
||
export function formatSeconds(seconds: number) { | ||
if (seconds <= 0) return '00:00' | ||
|
||
const remainders = leaveNumber(Math.ceil(seconds), 60, 2) | ||
|
||
if (remainders.length < 2) { | ||
remainders.unshift(0) | ||
} | ||
|
||
return remainders.length < 3 | ||
? remainders.map(doubleDigits).join(':') | ||
: remainders.map((r, i) => (i ? doubleDigits(r) : r)).join(':') | ||
} | ||
|
||
export function mergeIconScale(scale: number, icon: IconOptions & { icon: IconValue }) { | ||
return { | ||
...icon, | ||
scale: +(icon.scale || 1) * scale | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Video from './video' | ||
|
||
import type { ComponentPublicInstance } from 'vue' | ||
|
||
export { Video } | ||
export { videoProps } from './props' | ||
export { videoDefaultShortcuts, videoDefaultControlLayout } from './symbol' | ||
|
||
export type VideoExposed = ComponentPublicInstance & InstanceType<typeof Video> | ||
|
||
export type { VideoProps, VideoCProps } from './props' | ||
export type { | ||
VideoPresetControl, | ||
VideoControlName, | ||
VideoControlConfig, | ||
VideoControlLayout, | ||
VideoPlaybackRate, | ||
VideoControlType, | ||
VideoControlOption, | ||
VideoSegment | ||
} from './symbol' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { booleanProp, buildProps, eventProp } from '@vexip-ui/config' | ||
|
||
import type { ExtractPropTypes, PropType } from 'vue' | ||
import type { FullScreenType } from '@/components/full-screen' | ||
import type { IconEffect } from '@/components/icon' | ||
import type { ClassType, ConfigurableProps } from '@vexip-ui/config' | ||
import type { | ||
VideoControlLayout, | ||
VideoControlOption, | ||
VideoControlType, | ||
// VideoKernel, | ||
VideoPlaybackRate, | ||
VideoSegment, | ||
VideoShortcutOptions | ||
} from './symbol' | ||
|
||
export const videoProps = buildProps({ | ||
src: String, | ||
srcList: Array as PropType<string[]>, | ||
noControls: booleanProp, | ||
videoAttrs: Object, | ||
time: Number, | ||
volume: Number, | ||
playbackRate: Number, | ||
playbackRates: Array as PropType<(number | VideoPlaybackRate)[]>, | ||
// kernel: Object as PropType<VideoKernel>, | ||
controlLayout: Object as PropType<VideoControlLayout>, | ||
poster: String, | ||
video: Object as PropType<HTMLVideoElement>, | ||
segments: Array as PropType<(number | VideoSegment)[]>, | ||
loading: booleanProp, | ||
loadingIcon: Object, | ||
loadingEffect: String as PropType<IconEffect>, | ||
shortcuts: Object as PropType<VideoShortcutOptions>, | ||
onPlay: eventProp(), | ||
onPause: eventProp(), | ||
onEnded: eventProp(), | ||
onTimeChange: eventProp<(time: number) => void>(), | ||
onVolumeChange: eventProp<(volume: number) => void>(), | ||
onRateChange: eventProp<(rate: number) => void>(), | ||
onToggleFlip: eventProp<(flip: boolean) => void>(), | ||
onTogglePip: eventProp<(pip: boolean) => void>(), | ||
onToggleFull: eventProp<(full: false | FullScreenType) => void>(), | ||
onPrev: eventProp(), | ||
onNext: eventProp(), | ||
onRefresh: eventProp() | ||
}) | ||
|
||
export type VideoProps = ExtractPropTypes<typeof videoProps> | ||
export type VideoCProps = ConfigurableProps<ExtractPropTypes<typeof videoProps>> | ||
|
||
export const videoControlProps = buildProps({ | ||
type: String as PropType<VideoControlType>, | ||
label: String, | ||
tipClass: [String, Array, Object] as PropType<ClassType>, | ||
disabled: booleanProp, | ||
shortcut: String, | ||
focusable: booleanProp, | ||
value: [Number, String], | ||
options: Array as PropType<(string | VideoControlOption)[]>, | ||
onClick: eventProp(), | ||
onEnter: eventProp(), | ||
onLeave: eventProp(), | ||
onFocus: eventProp<(event: FocusEvent) => void>(), | ||
onBlur: eventProp<(event: FocusEvent) => void>(), | ||
onSelect: eventProp<(option: VideoControlOption) => void>() | ||
}) | ||
|
||
export type VideoControlProps = ExtractPropTypes<typeof videoControlProps> | ||
export type VideoControlCProps = ConfigurableProps<ExtractPropTypes<typeof videoControlProps>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import '@/components/preset/style' | ||
import '@/components/full-screen/style' | ||
import '@/components/option/style' | ||
import '@/style/video.scss' |
Oops, something went wrong.