diff --git a/src/components/NePaginator.vue b/src/components/NePaginator.vue new file mode 100644 index 0000000..d445347 --- /dev/null +++ b/src/components/NePaginator.vue @@ -0,0 +1,159 @@ + + + + + diff --git a/src/main.ts b/src/main.ts index e6b66e3..d7297e5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -27,6 +27,8 @@ export { default as NeCard } from '@/components/NeCard.vue' export { default as NeLink } from '@/components/NeLink.vue' export { default as NeFormItemLabel } from '@/components/NeFormItemLabel.vue' export { default as NeRadioSelection } from '@/components/NeRadioSelection.vue' +export { default as NePaginator } from '@/components/NePaginator.vue' // types export type { NeComboboxOption } from '@/components/NeCombobox.vue' +export type { NePaginatorProps } from '@/components/NePaginator.vue' diff --git a/stories/NePaginator.stories.ts b/stories/NePaginator.stories.ts new file mode 100644 index 0000000..69a1bf7 --- /dev/null +++ b/stories/NePaginator.stories.ts @@ -0,0 +1,49 @@ +// Copyright (C) 2024 Nethesis S.r.l. +// SPDX-License-Identifier: GPL-3.0-or-later + +import { Meta, StoryObj } from '@storybook/vue3' +import { NePaginator } from '../src/main' + +const meta: Meta = { + title: 'Visual/NePaginator', + component: NePaginator, + tags: ['autodocs'], + args: {} +} + +export default meta +type Story = StoryObj + +const template = '' + +export const Default: Story = { + render: (args) => ({ + components: { NePaginator }, + setup() { + return { args } + }, + template: template + }), + args: { + currentPage: 1, + totalPages: 5, + previousLabel: 'Previous', + nextLabel: 'Next' + } +} + +export const WithManyPages: Story = { + render: (args) => ({ + components: { NePaginator }, + setup() { + return { args } + }, + template: template + }), + args: { + currentPage: 5, + totalPages: 12, + previousLabel: 'Previous', + nextLabel: 'Next' + } +}