Skip to content

Commit

Permalink
remove mt popover deprecated (#281)
Browse files Browse the repository at this point in the history
* replace mt-popover-deprecated in mt-colorpicker

* update snapshots

---------

Co-authored-by: alastair-simon <[email protected]>
  • Loading branch information
Haberkamp and alastair-simon authored Sep 11, 2024
1 parent 016b511 commit 5a5e797
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-toys-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@shopware-ag/meteor-component-library": patch
---

Replace mt-popover-deprecated in mt-colorpicker
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const VisualTestOpenColorpicker: MtColorpickerStory = {
// todo: figure out what element this is
// Look inside the popover
const popover = within(
document.getElementsByClassName("mt-popover-deprecated__wrapper")[0] as HTMLElement,
document.getElementsByClassName("mt-floating-ui__content")[0] as HTMLElement,
);

const colorRange = popover.getByLabelText("colorpicker-color-range") as HTMLInputElement;
Expand Down Expand Up @@ -70,7 +70,7 @@ export const VisualTestChangeColorpickerColor: MtColorpickerStory = {

// Look inside the popover
const popover = within(
document.getElementsByClassName("mt-popover-deprecated__wrapper")[0] as HTMLElement,
document.getElementsByClassName("mt-floating-ui__content")[0] as HTMLElement,
);

const colorRange = popover.getByLabelText("colorpicker-color-range") as HTMLInputElement;
Expand Down Expand Up @@ -143,7 +143,7 @@ export const VisualTestChangeColorpickerOutputHex: MtColorpickerStory = {

// Look inside the popover
const popover = within(
document.getElementsByClassName("mt-popover-deprecated__wrapper")[0] as HTMLElement,
document.getElementsByClassName("mt-floating-ui__content")[0] as HTMLElement,
);

const hexInput = popover.getByLabelText("hex-value") as HTMLInputElement;
Expand Down Expand Up @@ -171,7 +171,7 @@ export const VisualTestChangeColorpickerOutputHsl: MtColorpickerStory = {

// Look inside the popover
const popover = within(
document.getElementsByClassName("mt-popover-deprecated__wrapper")[0] as HTMLElement,
document.getElementsByClassName("mt-floating-ui__content")[0] as HTMLElement,
);

const hexInput = popover.getByLabelText("hex-value") as HTMLInputElement;
Expand Down Expand Up @@ -199,7 +199,7 @@ export const VisualTestChangeColorpickerOutputRgb: MtColorpickerStory = {

// Look inside the popover
const popover = within(
document.getElementsByClassName("mt-popover-deprecated__wrapper")[0] as HTMLElement,
document.getElementsByClassName("mt-floating-ui__content")[0] as HTMLElement,
);

const hexInput = popover.getByLabelText("hex-value") as HTMLInputElement;
Expand Down Expand Up @@ -228,7 +228,7 @@ export const VisualTestChangeColorpickerOutputHexAlpha: MtColorpickerStory = {

// Look inside the popover
const popover = within(
document.getElementsByClassName("mt-popover-deprecated__wrapper")[0] as HTMLElement,
document.getElementsByClassName("mt-floating-ui__content")[0] as HTMLElement,
);

const hexInput = popover.getByLabelText("hex-value") as HTMLInputElement;
Expand Down Expand Up @@ -257,7 +257,7 @@ export const VisualTestChangeColorpickerOutputHslAlpha: MtColorpickerStory = {

// Look inside the popover
const popover = within(
document.getElementsByClassName("mt-popover-deprecated__wrapper")[0] as HTMLElement,
document.getElementsByClassName("mt-floating-ui__content")[0] as HTMLElement,
);

const hexInput = popover.getByLabelText("hex-value") as HTMLInputElement;
Expand Down Expand Up @@ -286,7 +286,7 @@ export const VisualTestChangeColorpickerOutputRgbAlpha: MtColorpickerStory = {

// Look inside the popover
const popover = within(
document.getElementsByClassName("mt-popover-deprecated__wrapper")[0] as HTMLElement,
document.getElementsByClassName("mt-floating-ui__content")[0] as HTMLElement,
);

const hexInput = popover.getByLabelText("hex-value") as HTMLInputElement;
Expand Down Expand Up @@ -314,7 +314,7 @@ export const VisualTestColorpickerWithoutAlpha: MtColorpickerStory = {

// Look inside the popover
const popover = within(
document.getElementsByClassName("mt-popover-deprecated__wrapper")[0] as HTMLElement,
document.getElementsByClassName("mt-floating-ui__content")[0] as HTMLElement,
);

const hexInput = popover.getByLabelText("hex-value") as HTMLInputElement;
Expand All @@ -340,7 +340,7 @@ export const VisualTestColorpickerDisabled: MtColorpickerStory = {
await userEvent.click(pickerToggle);

// Expect no popover
expect(document.getElementsByClassName("mt-popover-deprecated__wrapper").length).toEqual(0);
expect(document.getElementsByClassName("mt-floating-ui__content").length).toEqual(0);
},
};

Expand Down Expand Up @@ -391,7 +391,7 @@ export const VisualTestColorpickerDisabledColorLabels: MtColorpickerStory = {

// Look inside the popover
const popover = within(
document.getElementsByClassName("mt-popover-deprecated__wrapper")[0] as HTMLElement,
document.getElementsByClassName("mt-floating-ui__content")[0] as HTMLElement,
);

const hexInput = popover.getByLabelText("hex-value") as HTMLInputElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@
@click="onClickInput"
/>

<mt-popover-deprecated
v-if="visible"
<mt-floating-ui
:isOpened="visible"
class="mt-colorpicker__colorpicker-position"
:z-index="zIndex"
:offset="-12"
>
<div class="mt-colorpicker__colorpicker">
<div
Expand Down Expand Up @@ -197,7 +198,7 @@
</div>
</div>
</div>
</mt-popover-deprecated>
</mt-floating-ui>
</template>

<template #error>
Expand All @@ -212,16 +213,16 @@ import type { PropType } from "vue";
import { defineComponent } from "vue";
import { debounce } from "lodash-es";
import MtBaseField from "../_internal/mt-base-field/mt-base-field.vue";
import MtPopoverDeprecated from "../../_internal/mt-popover-deprecated/mt-popover-deprecated.vue";
import MtFloatingUi from "../../_internal/mt-floating-ui/mt-floating-ui.vue";
import MtText from "@/components/content/mt-text/mt-text.vue";
export default defineComponent({
name: "MtColorpicker",
components: {
"mt-popover-deprecated": MtPopoverDeprecated,
"mt-base-field": MtBaseField,
"mt-text": MtText,
"mt-floating-ui": MtFloatingUi,
},
props: {
Expand Down

0 comments on commit 5a5e797

Please sign in to comment.