vanilla-vue-ui 0.0.15 → 0.0.17
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.
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
</a>
|
|
10
10
|
</div>
|
|
11
11
|
</li>
|
|
12
|
-
<li v-for="(page, index) in
|
|
13
|
-
<div
|
|
12
|
+
<li v-for="(page, index) in filteredPages" :key="page.name">
|
|
13
|
+
<div class="flex items-center">
|
|
14
14
|
<ChevronRightIcon
|
|
15
15
|
:class="mergedClasses.icon?.base"
|
|
16
|
-
v-if="index <
|
|
16
|
+
v-if="index < filteredPages.length - 1"
|
|
17
17
|
aria-hidden="true"
|
|
18
18
|
/>
|
|
19
19
|
<a
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
import { ChevronRightIcon, HomeIcon } from '@heroicons/vue/20/solid'
|
|
34
34
|
import { useRouter, useRoute } from 'vue-router'
|
|
35
35
|
import type { RouteMeta } from 'vue-router';
|
|
36
|
-
import { ref, onMounted, watch, type PropType } from 'vue';
|
|
36
|
+
import { ref, onMounted, watch, type PropType, computed } from 'vue';
|
|
37
37
|
import type { ClassObject } from '../../types/ClassObject';
|
|
38
38
|
import { deepMergeClassObject } from '../../util';
|
|
39
39
|
import { withTrailingSlash } from 'ufo'
|
|
@@ -68,6 +68,8 @@ type Page = {
|
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
const pages = ref<Page[]>([]);
|
|
71
|
+
// 表示対象だけに絞る(<li> ごと消えるので余白が生まれない)
|
|
72
|
+
const filteredPages = computed(() => pages.value.filter(p => p.name.length > 1))
|
|
71
73
|
|
|
72
74
|
const router = useRouter();
|
|
73
75
|
const route = useRoute();
|
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Replace vue3 with vue if you are using Storybook for Vue 2
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
3
|
+
|
|
4
|
+
import WOptionsArea from './WOptionsArea.vue';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof WOptionsArea> = {
|
|
7
|
+
component: WOptionsArea,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof WOptionsArea>;
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
|
|
15
|
+
* See https://storybook.js.org/docs/api/csf
|
|
16
|
+
* to learn how to use render functions.
|
|
17
|
+
*/
|
|
18
|
+
export const Primary: Story = {
|
|
19
|
+
render: (args: any) => ({
|
|
20
|
+
setup() {
|
|
21
|
+
return {
|
|
22
|
+
...args
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
components: { WOptionsArea },
|
|
26
|
+
template: `
|
|
27
|
+
<WOptionsArea>
|
|
28
|
+
<label class="mr-2">
|
|
29
|
+
数字
|
|
30
|
+
<input id="p-generator-numbers-checkbox" type="checkbox">
|
|
31
|
+
</label>
|
|
32
|
+
|
|
33
|
+
<label>
|
|
34
|
+
記号
|
|
35
|
+
<input id="p-generator-symbols-checkbox" type="checkbox">
|
|
36
|
+
</label>
|
|
37
|
+
</WOptionsArea>`,
|
|
38
|
+
}),
|
|
39
|
+
args: {
|
|
40
|
+
}
|
|
41
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineProps, withDefaults } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = withDefaults(
|
|
5
|
+
defineProps<{
|
|
6
|
+
/** fieldset のタイトル */
|
|
7
|
+
title?: string
|
|
8
|
+
}>(),
|
|
9
|
+
{
|
|
10
|
+
title: 'オプション', // デフォルト値
|
|
11
|
+
}
|
|
12
|
+
)
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<div>
|
|
17
|
+
<fieldset class="border-dashed border-2 border-gray-300 rounded-lg p-4">
|
|
18
|
+
|
|
19
|
+
<legend class="px-1 text-onSurface dark:text-onSurface-dark">{{ props.title }}</legend>
|
|
20
|
+
|
|
21
|
+
<slot />
|
|
22
|
+
</fieldset>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|