@zairakai/vue-components 1.1.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 +113 -0
- package/dist/Content/index.d.ts +11 -0
- package/dist/Content/index.d.ts.map +1 -0
- package/dist/Content/index.js +11 -0
- package/dist/Content/index.js.map +1 -0
- package/dist/Form/index.d.ts +37 -0
- package/dist/Form/index.d.ts.map +1 -0
- package/dist/Form/index.js +37 -0
- package/dist/Form/index.js.map +1 -0
- package/dist/Layout/index.d.ts +21 -0
- package/dist/Layout/index.d.ts.map +1 -0
- package/dist/Layout/index.js +21 -0
- package/dist/Layout/index.js.map +1 -0
- package/dist/Medias/index.d.ts +15 -0
- package/dist/Medias/index.d.ts.map +1 -0
- package/dist/Medias/index.js +15 -0
- package/dist/Medias/index.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/package.json +129 -0
- package/src/Content/Blockquote.vue +23 -0
- package/src/Content/Heading.vue +33 -0
- package/src/Content/Link.vue +204 -0
- package/src/Content/List.vue +121 -0
- package/src/Content/Msr.vue +24 -0
- package/src/Content/Paragraph.vue +35 -0
- package/src/Content/index.ts +11 -0
- package/src/Form/Additional.vue +23 -0
- package/src/Form/Button.vue +55 -0
- package/src/Form/Checkbox.vue +60 -0
- package/src/Form/Color.vue +33 -0
- package/src/Form/Datalist.vue +28 -0
- package/src/Form/Date.vue +33 -0
- package/src/Form/Datetime.vue +33 -0
- package/src/Form/Email.vue +38 -0
- package/src/Form/Field.vue +32 -0
- package/src/Form/Fieldset.vue +34 -0
- package/src/Form/File.vue +33 -0
- package/src/Form/Form.vue +22 -0
- package/src/Form/Group.vue +32 -0
- package/src/Form/Hidden.vue +34 -0
- package/src/Form/Input.vue +211 -0
- package/src/Form/Label.vue +68 -0
- package/src/Form/Month.vue +38 -0
- package/src/Form/Number.vue +33 -0
- package/src/Form/Password.vue +38 -0
- package/src/Form/Radio.vue +33 -0
- package/src/Form/Range.vue +33 -0
- package/src/Form/Reset.vue +17 -0
- package/src/Form/Search.vue +33 -0
- package/src/Form/Select.vue +156 -0
- package/src/Form/Submit.vue +17 -0
- package/src/Form/Switch.vue +47 -0
- package/src/Form/Tel.vue +33 -0
- package/src/Form/Textarea.vue +163 -0
- package/src/Form/Time.vue +38 -0
- package/src/Form/Toggle.vue +43 -0
- package/src/Form/Url.vue +33 -0
- package/src/Form/Week.vue +38 -0
- package/src/Form/index.ts +37 -0
- package/src/Layout/Article.vue +27 -0
- package/src/Layout/Aside.vue +25 -0
- package/src/Layout/Column.vue +27 -0
- package/src/Layout/Container.vue +25 -0
- package/src/Layout/Flex.vue +30 -0
- package/src/Layout/FlexItem.vue +23 -0
- package/src/Layout/Footer.vue +25 -0
- package/src/Layout/Grid.vue +35 -0
- package/src/Layout/GridItem.vue +23 -0
- package/src/Layout/Header.vue +25 -0
- package/src/Layout/Loader.vue +29 -0
- package/src/Layout/Main.vue +25 -0
- package/src/Layout/Nav.vue +25 -0
- package/src/Layout/Row.vue +27 -0
- package/src/Layout/Section.vue +31 -0
- package/src/Layout/Wrapper.vue +23 -0
- package/src/Layout/index.ts +21 -0
- package/src/Medias/Audio.vue +69 -0
- package/src/Medias/Canvas.vue +27 -0
- package/src/Medias/Figcaption.vue +11 -0
- package/src/Medias/Figure.vue +23 -0
- package/src/Medias/Iframe.vue +51 -0
- package/src/Medias/Image.vue +63 -0
- package/src/Medias/Object.vue +38 -0
- package/src/Medias/Source.vue +33 -0
- package/src/Medias/Track.vue +33 -0
- package/src/Medias/Video.vue +75 -0
- package/src/Medias/index.ts +15 -0
- package/src/index.ts +41 -0
- package/src/vue-shims.d.ts +17 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
defineOptions({
|
|
5
|
+
name: 'MediaSource',
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
src: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
type: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
sizes: String,
|
|
18
|
+
media: String,
|
|
19
|
+
srcset: String,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const sourceProps = computed(() => ({
|
|
23
|
+
src: props.src,
|
|
24
|
+
type: props.type,
|
|
25
|
+
sizes: props.sizes,
|
|
26
|
+
media: props.media,
|
|
27
|
+
srcset: props.srcset,
|
|
28
|
+
}))
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<source v-bind="sourceProps" />
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
defineOptions({
|
|
5
|
+
name: 'MediaTrack',
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
src: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
label: String,
|
|
14
|
+
default: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false,
|
|
17
|
+
},
|
|
18
|
+
kind: String,
|
|
19
|
+
srclang: String,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const trackProps = computed(() => ({
|
|
23
|
+
src: props.src,
|
|
24
|
+
label: props.label,
|
|
25
|
+
default: props.default,
|
|
26
|
+
kind: props.kind,
|
|
27
|
+
srclang: props.srclang,
|
|
28
|
+
}))
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<track v-bind="trackProps" />
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
import MediaSource from '@medias/Source.vue'
|
|
5
|
+
import MediaTrack from '@medias/Track.vue'
|
|
6
|
+
|
|
7
|
+
defineOptions({
|
|
8
|
+
name: 'MediaVideo',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
id: String,
|
|
13
|
+
class: String,
|
|
14
|
+
controls: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: true,
|
|
17
|
+
},
|
|
18
|
+
autoplay: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
21
|
+
},
|
|
22
|
+
loop: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false,
|
|
25
|
+
},
|
|
26
|
+
muted: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
width: String,
|
|
31
|
+
height: String,
|
|
32
|
+
poster: String,
|
|
33
|
+
preload: String,
|
|
34
|
+
sources: {
|
|
35
|
+
type: Array,
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
tracks: {
|
|
39
|
+
type: Array,
|
|
40
|
+
default: () => [],
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const videoProps = computed(() => ({
|
|
45
|
+
id: props.id,
|
|
46
|
+
class: props.class,
|
|
47
|
+
controls: props.controls,
|
|
48
|
+
autoplay: props.autoplay,
|
|
49
|
+
loop: props.loop,
|
|
50
|
+
muted: props.muted,
|
|
51
|
+
width: props.width,
|
|
52
|
+
height: props.height,
|
|
53
|
+
poster: props.poster,
|
|
54
|
+
preload: props.preload,
|
|
55
|
+
}))
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<template>
|
|
59
|
+
<video v-bind="videoProps">
|
|
60
|
+
<MediaSource
|
|
61
|
+
v-for="(source, index) in sources"
|
|
62
|
+
:key="index"
|
|
63
|
+
v-bind="source"
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
<template v-if="tracks.length">
|
|
67
|
+
<MediaTrack
|
|
68
|
+
v-for="(track, index) in tracks"
|
|
69
|
+
:key="index"
|
|
70
|
+
v-bind="track"
|
|
71
|
+
/>
|
|
72
|
+
</template>
|
|
73
|
+
Your browser does not support the video tag.
|
|
74
|
+
</video>
|
|
75
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Media Components
|
|
3
|
+
* Components for media content (images, videos, audio, etc.)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export { default as MediaAudio } from './Audio.vue'
|
|
7
|
+
export { default as MediaCanvas } from './Canvas.vue'
|
|
8
|
+
export { default as MediaFigcaption } from './Figcaption.vue'
|
|
9
|
+
export { default as MediaFigure } from './Figure.vue'
|
|
10
|
+
export { default as MediaIframe } from './Iframe.vue'
|
|
11
|
+
export { default as MediaImage } from './Image.vue'
|
|
12
|
+
export { default as MediaObject } from './Object.vue'
|
|
13
|
+
export { default as MediaSource } from './Source.vue'
|
|
14
|
+
export { default as MediaTrack } from './Track.vue'
|
|
15
|
+
export { default as MediaVideo } from './Video.vue'
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zairakai/npm-vue-components
|
|
3
|
+
* Collection of reusable Vue 3 components
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { App, Plugin } from 'vue'
|
|
7
|
+
|
|
8
|
+
// Export all components by category
|
|
9
|
+
export * from './Content/index.js'
|
|
10
|
+
export * from './Form/index.js'
|
|
11
|
+
export * from './Layout/index.js'
|
|
12
|
+
export * from './Medias/index.js'
|
|
13
|
+
|
|
14
|
+
// Plugin installation options
|
|
15
|
+
export interface VueComponentsOptions {
|
|
16
|
+
prefix?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Vue plugin for easy installation
|
|
20
|
+
const VueComponentsPlugin: Plugin = {
|
|
21
|
+
install(app: App, options: VueComponentsOptions = {}) {
|
|
22
|
+
// Import all components dynamically
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
+
const components = import.meta.glob<{ default: any }>('./**/*.vue', {
|
|
25
|
+
eager: true,
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
for (const path in components) {
|
|
29
|
+
const component = components[path]
|
|
30
|
+
const name = (component.default.name ?? path.split('/').pop()?.replace('.vue', '') ?? '') as string
|
|
31
|
+
|
|
32
|
+
if (options.prefix) {
|
|
33
|
+
app.component(`${options.prefix}${name}`, component.default)
|
|
34
|
+
} else {
|
|
35
|
+
app.component(name, component.default)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default VueComponentsPlugin
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare module '*.vue' {
|
|
2
|
+
import type { DefineComponent } from 'vue'
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
+
const component: DefineComponent<{}, {}, any>
|
|
5
|
+
export default component
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// Vite module declarations
|
|
9
|
+
interface ImportMetaEnv {
|
|
10
|
+
readonly NODE_ENV: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface ImportMeta {
|
|
14
|
+
readonly env: ImportMetaEnv
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
+
glob<T = any>(pattern: string, options?: { eager?: boolean }): Record<string, T>
|
|
17
|
+
}
|