@teammodlr/ui-kit 1.0.2 → 1.0.5
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/package.json +1 -3
- package/src/components/avatar/examples/basic.vue +6 -0
- package/src/components/avatar/examples/custom-size.vue +7 -0
- package/src/components/avatar/examples/index.stories.ts +28 -0
- package/src/components/avatar/examples/index.ts +5 -0
- package/src/components/avatar/examples/sizes.vue +33 -0
- package/src/components/avatar/examples/slots.vue +7 -0
- package/src/components/avatar/examples/variants.vue +18 -0
- package/src/components/avatargroup/examples/basic.vue +11 -0
- package/src/components/avatargroup/examples/index.stories.ts +28 -0
- package/src/components/avatargroup/examples/index.ts +1 -0
- package/src/components/breadcrumb/examples/basic.vue +9 -0
- package/src/components/breadcrumb/examples/index.stories.ts +20 -0
- package/src/components/breadcrumb/examples/index.ts +1 -0
- package/src/components/button/examples/basic.vue +3 -0
- package/src/components/button/examples/colors-secondary.vue +8 -0
- package/src/components/button/examples/colors.vue +8 -0
- package/src/components/button/examples/disabled.vue +3 -0
- package/src/components/button/examples/icon.vue +10 -0
- package/src/components/button/examples/index.stories.ts +33 -0
- package/src/components/button/examples/index.ts +7 -0
- package/src/components/button/examples/rounded.vue +7 -0
- package/src/components/button/examples/size.vue +7 -0
- package/src/components/buttongroup/examples/basic.vue +9 -0
- package/src/components/buttongroup/examples/index.stories.ts +21 -0
- package/src/components/buttongroup/examples/index.ts +1 -0
- package/src/components/checkbox/examples/basic.vue +9 -0
- package/src/components/checkbox/examples/index.stories.ts +21 -0
- package/src/components/checkbox/examples/index.ts +3 -0
- package/src/components/checkbox/examples/slot.vue +11 -0
- package/src/components/dropdown/examples/basic.vue +73 -0
- package/src/components/dropdown/examples/context.vue +71 -0
- package/src/components/dropdown/examples/index.stories.ts +23 -0
- package/src/components/dropdown/examples/index.ts +2 -0
- package/src/components/form/examples/basic.vue +73 -0
- package/src/components/form/examples/index.stories.ts +23 -0
- package/src/components/form/examples/index.ts +1 -0
- package/src/components/image/examples/basic.vue +5 -0
- package/src/components/image/examples/index.stories.ts +12 -0
- package/src/components/image/examples/index.ts +1 -0
- package/src/components/input/examples/basic.vue +7 -0
- package/src/components/input/examples/index.stories.ts +24 -0
- package/src/components/input/examples/index.ts +4 -0
- package/src/components/input/examples/prefix.vue +7 -0
- package/src/components/input/examples/sizes.vue +9 -0
- package/src/components/input/examples/suffix.vue +7 -0
- package/src/components/link/examples/basic.vue +3 -0
- package/src/components/link/examples/index.stories.ts +20 -0
- package/src/components/link/examples/index.ts +1 -0
- package/src/components/messageprovider/examples/basic.vue +19 -0
- package/src/components/messageprovider/examples/index.stories.ts +30 -0
- package/src/components/messageprovider/examples/index.ts +1 -0
- package/src/components/messageprovider/examples/wrapper.vue +9 -0
- package/src/components/select/examples/basic.vue +20 -0
- package/src/components/select/examples/index.stories.ts +22 -0
- package/src/components/select/examples/index.ts +3 -0
- package/src/components/select/examples/multiple.vue +22 -0
- package/src/components/select/examples/searchable.vue +20 -0
- package/src/components/skeleton/examples/basic.vue +3 -0
- package/src/components/skeleton/examples/index.stories.ts +24 -0
- package/src/components/skeleton/examples/index.ts +2 -0
- package/src/components/skeleton/examples/post.vue +8 -0
- package/src/components/tab/examples/basic.vue +19 -0
- package/src/components/tab/examples/index.stories.ts +25 -0
- package/src/components/tab/examples/index.ts +2 -0
- package/src/components/tab/examples/vertical.vue +19 -0
- package/src/components/table/examples/basic.vue +46 -0
- package/src/components/table/examples/index.stories.ts +19 -0
- package/src/components/table/examples/index.ts +1 -0
- package/src/components/tooltip/examples/basic.vue +8 -0
- package/src/components/tooltip/examples/index.stories.ts +21 -0
- package/src/components/tooltip/examples/index.ts +1 -0
- package/src/components/virtualscroll/examples/basic.vue +37 -0
- package/src/components/virtualscroll/examples/index.stories.ts +31 -0
- package/src/components/virtualscroll/examples/index.ts +1 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import MForm from '../Form.vue';
|
|
2
|
+
import MInput from '../../input/Input.vue';
|
|
3
|
+
import MButton from '../../button/Button.vue';
|
|
4
|
+
import MSelect from '../../select/Select.vue';
|
|
5
|
+
import MCheckbox from '../../checkbox/Checkbox.vue';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
MFormBasic
|
|
9
|
+
} from './index';
|
|
10
|
+
import { createStory } from '@/__storybook__';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
component: MForm,
|
|
14
|
+
subcomponents: {
|
|
15
|
+
MInput,
|
|
16
|
+
MButton,
|
|
17
|
+
MSelect,
|
|
18
|
+
MCheckbox
|
|
19
|
+
},
|
|
20
|
+
title: 'Components/Form'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const Basic = createStory(MFormBasic);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MFormBasic } from './basic.vue';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createStory } from "@/__storybook__";
|
|
2
|
+
import MImage from "../Image.vue";
|
|
3
|
+
import {
|
|
4
|
+
MImageBasic,
|
|
5
|
+
} from "./index";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
component: MImage,
|
|
9
|
+
title: 'Components/Image',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Basic = createStory(MImageBasic);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MImageBasic } from './basic.vue';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import MInput from "../Input.vue";
|
|
2
|
+
import {
|
|
3
|
+
MInputBasic,
|
|
4
|
+
MInputSuffix,
|
|
5
|
+
MInputPrefix,
|
|
6
|
+
MInputSizes
|
|
7
|
+
} from "./index";
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
createStory, sizeArgType
|
|
11
|
+
} from "@/__storybook__";
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
component: MInput,
|
|
15
|
+
title: 'Components/Input',
|
|
16
|
+
argTypes: {
|
|
17
|
+
...sizeArgType()
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Basic = createStory(MInputBasic);
|
|
22
|
+
export const Suffix = createStory(MInputSuffix);
|
|
23
|
+
export const Prefix = createStory(MInputPrefix);
|
|
24
|
+
export const Sizes = createStory(MInputSizes);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<MInput clearable name="field_one" size="xs" /><br /><br />
|
|
4
|
+
<MInput clearable name="field_two" size="sm" /><br /><br />
|
|
5
|
+
<MInput clearable name="field_three" /><br /><br />
|
|
6
|
+
<MInput clearable name="field_four" size="lg" /><br /><br />
|
|
7
|
+
<MInput clearable name="field_five" size="xl" /><br /><br />
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import MLink from "../Link.vue";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
MLinkBasic
|
|
5
|
+
} from "./index";
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
createStory,
|
|
9
|
+
colorArgType
|
|
10
|
+
} from "@/__storybook__";
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
component: MLink,
|
|
14
|
+
title: 'Components/Link',
|
|
15
|
+
argTypes: {
|
|
16
|
+
...colorArgType()
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Basic = createStory(MLinkBasic);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MLinkBasic } from './basic.vue';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button @click="showMessage">Show</button>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" setup>
|
|
6
|
+
import { useMessage } from '../useMessage';
|
|
7
|
+
|
|
8
|
+
const message = useMessage();
|
|
9
|
+
|
|
10
|
+
const showMessage = () => {
|
|
11
|
+
|
|
12
|
+
const timeout = Math.floor(Math.random() * 10) + 1;
|
|
13
|
+
|
|
14
|
+
message.create(`Hello World - ${timeout}s`, {
|
|
15
|
+
timeout: timeout * 1000
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
};
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import MMessageProvider from "../MessageProvider.vue";
|
|
2
|
+
import {
|
|
3
|
+
MMessageProviderBasic,
|
|
4
|
+
|
|
5
|
+
} from "./index";
|
|
6
|
+
|
|
7
|
+
const Template = (args: any) => ({
|
|
8
|
+
components: {
|
|
9
|
+
MMessageProvider,
|
|
10
|
+
MMessageProviderBasic
|
|
11
|
+
},
|
|
12
|
+
setup() {
|
|
13
|
+
|
|
14
|
+
return {
|
|
15
|
+
args,
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
template: `
|
|
19
|
+
<m-message-provider v-bind="args">
|
|
20
|
+
<MMessageProviderBasic />
|
|
21
|
+
</m-message-provider>
|
|
22
|
+
`
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
component: MMessageProvider,
|
|
27
|
+
title: 'Components/MessageProvider'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const Primary = Template.bind({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MMessageProviderBasic } from './basic.vue';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<MSelect
|
|
3
|
+
v-model="value"
|
|
4
|
+
:options="options"
|
|
5
|
+
:option-value="'id'"
|
|
6
|
+
:option-label="'name'"
|
|
7
|
+
/>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts" setup>
|
|
11
|
+
import { ref } from "vue";
|
|
12
|
+
|
|
13
|
+
// make list of options with 1000 items
|
|
14
|
+
const options = Array.from({ length: 50 }, (_, i) => ({
|
|
15
|
+
id: i,
|
|
16
|
+
name: `Option ${i+1}`
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
const value = ref();
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import MSelect from "../Select.vue";
|
|
2
|
+
import {
|
|
3
|
+
MSelectBasic,
|
|
4
|
+
MSelectSearchable,
|
|
5
|
+
MSelectMultiple,
|
|
6
|
+
} from "./index";
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
createStory, sizeArgType
|
|
10
|
+
} from "@/__storybook__";
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
component: MSelect,
|
|
14
|
+
title: 'Components/Select',
|
|
15
|
+
argTypes: {
|
|
16
|
+
...sizeArgType()
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Basic = createStory(MSelectBasic);
|
|
21
|
+
export const Searchable = createStory(MSelectSearchable);
|
|
22
|
+
export const Multiple = createStory(MSelectMultiple);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<MSelect
|
|
3
|
+
v-model="value"
|
|
4
|
+
:options="options"
|
|
5
|
+
:option-value="'id'"
|
|
6
|
+
:option-label="'name'"
|
|
7
|
+
multiple
|
|
8
|
+
searchable
|
|
9
|
+
/>
|
|
10
|
+
{{ value }}
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts" setup>
|
|
14
|
+
import { ref } from "vue";
|
|
15
|
+
|
|
16
|
+
const options = Array.from({ length: 50 }, (_, i) => ({
|
|
17
|
+
id: i,
|
|
18
|
+
name: `Option ${i+1}`
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
const value = ref([]);
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<MSelect
|
|
3
|
+
v-model="value"
|
|
4
|
+
:options="options"
|
|
5
|
+
:option-value="'id'"
|
|
6
|
+
:option-label="'name'"
|
|
7
|
+
searchable
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts" setup>
|
|
12
|
+
import { ref } from "vue";
|
|
13
|
+
|
|
14
|
+
const options = Array.from({ length: 50 }, (_, i) => ({
|
|
15
|
+
id: i,
|
|
16
|
+
name: `Option ${i+1}`
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
const value = ref();
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createStory } from "@/__storybook__";
|
|
2
|
+
import MSkeleton from "../Skeleton.vue";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
MSkeletonBasic,
|
|
6
|
+
MSkeletonPost
|
|
7
|
+
} from "./index";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
component: MSkeleton,
|
|
11
|
+
title: 'Components/Skeleton',
|
|
12
|
+
argTypes: {
|
|
13
|
+
variant: {
|
|
14
|
+
options: ['thumb', 'line', 'circle', 'block'],
|
|
15
|
+
control: {
|
|
16
|
+
type: 'select',
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const Basic = createStory(MSkeletonBasic);
|
|
24
|
+
export const Post = createStory(MSkeletonPost);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<MSkeleton variant="thumb" style="margin-bottom: 10px;" />
|
|
4
|
+
<MSkeleton variant="heading" style="margin-bottom: 10px; width: 340px;" />
|
|
5
|
+
<MSkeleton variant="line" style="margin-bottom: 6px;" />
|
|
6
|
+
<MSkeleton variant="line" />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<MTabGroup v-model="active">
|
|
3
|
+
<MTab value="one" label="One">
|
|
4
|
+
Hello Worlddsd
|
|
5
|
+
</MTab>
|
|
6
|
+
<MTab value="two" label="Two" disabled>
|
|
7
|
+
Hello World Two
|
|
8
|
+
</MTab>
|
|
9
|
+
<MTab value="three" label="Third">
|
|
10
|
+
Hello World Two dfndjfn
|
|
11
|
+
</MTab>
|
|
12
|
+
</MTabGroup>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts" setup>
|
|
16
|
+
import { ref } from "vue";
|
|
17
|
+
|
|
18
|
+
const active = ref("one");
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import MTabGroup from "../TabGroup.vue";
|
|
2
|
+
import MTab from "../Tab.vue";
|
|
3
|
+
import {
|
|
4
|
+
MTabsBasic,
|
|
5
|
+
MTabsVertical
|
|
6
|
+
} from "./index";
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
createStory,
|
|
10
|
+
sizeArgType
|
|
11
|
+
} from "@/__storybook__";
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
component: MTabGroup,
|
|
15
|
+
subcomponents: {
|
|
16
|
+
MTab
|
|
17
|
+
},
|
|
18
|
+
title: 'Components/Tabs',
|
|
19
|
+
argTypes: {
|
|
20
|
+
...sizeArgType()
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const Basic = createStory(MTabsBasic);
|
|
25
|
+
export const Vertical = createStory(MTabsVertical);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<MTabGroup v-model="active" vertical>
|
|
3
|
+
<MTab value="one" label="One">
|
|
4
|
+
Hello Worlddsd
|
|
5
|
+
</MTab>
|
|
6
|
+
<MTab value="two" label="Two" disabled>
|
|
7
|
+
Hello World Two
|
|
8
|
+
</MTab>
|
|
9
|
+
<MTab value="three" label="Third">
|
|
10
|
+
Hello World Two dfndjfn
|
|
11
|
+
</MTab>
|
|
12
|
+
</MTabGroup>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts" setup>
|
|
16
|
+
import { ref } from "vue";
|
|
17
|
+
|
|
18
|
+
const active = ref("one");
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<MTable
|
|
3
|
+
:headers="headers"
|
|
4
|
+
:items="items"
|
|
5
|
+
striped
|
|
6
|
+
>
|
|
7
|
+
<template #actions="{ item }">
|
|
8
|
+
<MButton
|
|
9
|
+
color="blue"
|
|
10
|
+
secondary
|
|
11
|
+
size="sm"
|
|
12
|
+
>
|
|
13
|
+
Edit - {{ item.name }}
|
|
14
|
+
</MButton>
|
|
15
|
+
</template>
|
|
16
|
+
</MTable>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { ref } from "vue";
|
|
21
|
+
import type { TableHeadItem } from "../types";
|
|
22
|
+
|
|
23
|
+
let headers = ref<TableHeadItem[]>([
|
|
24
|
+
{
|
|
25
|
+
name: "Name",
|
|
26
|
+
key: "name",
|
|
27
|
+
width: 200
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "Age",
|
|
31
|
+
key: "age",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Actions",
|
|
35
|
+
key: "actions"
|
|
36
|
+
}
|
|
37
|
+
]);
|
|
38
|
+
|
|
39
|
+
let items = ref([
|
|
40
|
+
...Array.from({ length: 30 }, () => ({
|
|
41
|
+
name: "John Doe",
|
|
42
|
+
age: 4
|
|
43
|
+
}))
|
|
44
|
+
|
|
45
|
+
]);
|
|
46
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import MTable from "../Table.vue";
|
|
2
|
+
import MButton from "../../button/Button.vue";
|
|
3
|
+
import {
|
|
4
|
+
MTableBasic
|
|
5
|
+
} from "./index";
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
createStory
|
|
9
|
+
} from "@/__storybook__";
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
component: MTable,
|
|
13
|
+
subcomponents: {
|
|
14
|
+
MButton
|
|
15
|
+
},
|
|
16
|
+
title: 'Components/Table',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const Basic = createStory(MTableBasic);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MTableBasic } from './basic.vue';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import MTooltip from "../Tooltip.vue";
|
|
2
|
+
import MButton from "@/components/button/Button.vue";
|
|
3
|
+
import {
|
|
4
|
+
MTooltipBasic
|
|
5
|
+
} from "./index";
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
createStory,
|
|
9
|
+
popperPositionArgType
|
|
10
|
+
} from "@/__storybook__";
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
component: MTooltip,
|
|
14
|
+
subcomponents: { MButton },
|
|
15
|
+
title: 'Components/Tooltip',
|
|
16
|
+
argTypes: {
|
|
17
|
+
...popperPositionArgType()
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Basic = createStory(MTooltipBasic);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MTooltipBasic } from "./basic.vue";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
items: {
|
|
4
|
+
type: Array,
|
|
5
|
+
default: () => []
|
|
6
|
+
},
|
|
7
|
+
itemHeight: {
|
|
8
|
+
type: Number,
|
|
9
|
+
default: 50
|
|
10
|
+
},
|
|
11
|
+
buffer: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: 3
|
|
14
|
+
},
|
|
15
|
+
pageHeight: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 400
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<div>
|
|
24
|
+
<MVirtualScroll
|
|
25
|
+
v-slot="{ item, height }"
|
|
26
|
+
v-bind="props"
|
|
27
|
+
:style="{
|
|
28
|
+
height: `${props.pageHeight}px`,
|
|
29
|
+
overflow: 'auto'
|
|
30
|
+
}"
|
|
31
|
+
>
|
|
32
|
+
<div :key="item.id" :style="{height: `${height}px`}">
|
|
33
|
+
{{ item.name }}
|
|
34
|
+
</div>
|
|
35
|
+
</MVirtualScroll>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import MVirtualScroll from "../VirtualScroll.vue";
|
|
2
|
+
import {
|
|
3
|
+
MVirtualScrollBasic
|
|
4
|
+
} from "./index";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
createStory
|
|
8
|
+
} from "@/__storybook__";
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
component: MVirtualScroll,
|
|
12
|
+
title: 'Components/VirtualScroll'
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const items = [] as any[];
|
|
16
|
+
|
|
17
|
+
for (let i = 0; i < 1000; i++) {
|
|
18
|
+
items.push({
|
|
19
|
+
id: i + 1,
|
|
20
|
+
name: 'Some name here ' + (i + 1),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const Basic = createStory(MVirtualScrollBasic).bind({});
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
Basic.args = {
|
|
27
|
+
items: items,
|
|
28
|
+
itemHeight: 50,
|
|
29
|
+
buffer: 3,
|
|
30
|
+
pageHeight: 500,
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MVirtualScrollBasic } from './basic.vue';
|