From bb5c3262c0cee215db4f1e81896d856617912c43 Mon Sep 17 00:00:00 2001 From: Nils Date: Thu, 19 Sep 2024 16:59:43 +0200 Subject: [PATCH 1/3] move mt-link to composition api --- .../mt-link/mt-link.interactive.stories.ts | 9 +- .../navigation/mt-link/mt-link.stories.ts | 4 +- .../components/navigation/mt-link/mt-link.vue | 98 +++++-------------- 3 files changed, 31 insertions(+), 80 deletions(-) diff --git a/packages/component-library/src/components/navigation/mt-link/mt-link.interactive.stories.ts b/packages/component-library/src/components/navigation/mt-link/mt-link.interactive.stories.ts index 374602f5d..d1d9dbf38 100644 --- a/packages/component-library/src/components/navigation/mt-link/mt-link.interactive.stories.ts +++ b/packages/component-library/src/components/navigation/mt-link/mt-link.interactive.stories.ts @@ -1,5 +1,4 @@ -import { within } from "@storybook/test"; -import { expect } from "@storybook/test"; +import { expect, userEvent, within } from "@storybook/test"; import meta, { type MtLinkMeta, type MtLinkStory } from "./mt-link.stories"; @@ -27,11 +26,11 @@ export const VisualTestRenderExternalLinkDisabled: MtLinkStory = { args: { disabled: true, }, - play: async ({ canvasElement }) => { + play: async ({ canvasElement, args }) => { const canvas = within(canvasElement); - const link = canvas.getByText("Link"); + await userEvent.click(canvas.getByRole("link")); - expect(getComputedStyle(link).pointerEvents).toEqual("none"); + expect(args.click).not.toHaveBeenCalled(); }, }; diff --git a/packages/component-library/src/components/navigation/mt-link/mt-link.stories.ts b/packages/component-library/src/components/navigation/mt-link/mt-link.stories.ts index 548cf4d38..0352588ac 100644 --- a/packages/component-library/src/components/navigation/mt-link/mt-link.stories.ts +++ b/packages/component-library/src/components/navigation/mt-link/mt-link.stories.ts @@ -4,13 +4,13 @@ import { fn } from "@storybook/test"; import MtLink from "./mt-link.vue"; import type { SlottedMeta } from "@/_internal/story-helper"; -export type MtLinkMeta = SlottedMeta; +export type MtLinkMeta = SlottedMeta; export default { title: "Components/Navigation/mt-link", component: MtLink, args: { - as: "router-link", + as: "a", default: "Link", to: "/", variant: "primary", diff --git a/packages/component-library/src/components/navigation/mt-link/mt-link.vue b/packages/component-library/src/components/navigation/mt-link/mt-link.vue index 02db535f9..9b2e8bde0 100644 --- a/packages/component-library/src/components/navigation/mt-link/mt-link.vue +++ b/packages/component-library/src/components/navigation/mt-link/mt-link.vue @@ -1,88 +1,41 @@ - From dd42b3b9d0ea9f7554d512979606de105f201c03 Mon Sep 17 00:00:00 2001 From: Nils Date: Wed, 25 Sep 2024 09:49:39 +0200 Subject: [PATCH 3/3] migrate pagination over to plain CSS --- .../mt-pagination/mt-pagination.vue | 142 ++++++++---------- 1 file changed, 61 insertions(+), 81 deletions(-) diff --git a/packages/component-library/src/components/table-and-list/mt-pagination/mt-pagination.vue b/packages/component-library/src/components/table-and-list/mt-pagination/mt-pagination.vue index 59f45370d..f84d906b7 100644 --- a/packages/component-library/src/components/table-and-list/mt-pagination/mt-pagination.vue +++ b/packages/component-library/src/components/table-and-list/mt-pagination/mt-pagination.vue @@ -19,7 +19,7 @@ > {{ $t("mt-pagination.firstPage") }} -