From fed2660c9661ccb20b6578654bd6f999bfe1e7bd Mon Sep 17 00:00:00 2001 From: anveshmekala Date: Tue, 13 Dec 2022 18:06:07 -0600 Subject: [PATCH] refactor(chip,combobox-item): remove deprecated event payload. --- src/components/chip/chip.e2e.ts | 8 -------- src/components/chip/chip.tsx | 7 +++---- src/components/combobox-item/combobox-item.tsx | 7 +++---- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/components/chip/chip.e2e.ts b/src/components/chip/chip.e2e.ts index d54d07bccc1..137bb8b5f4b 100644 --- a/src/components/chip/chip.e2e.ts +++ b/src/components/chip/chip.e2e.ts @@ -55,14 +55,6 @@ describe("calcite-chip", () => { expect(element).toEqualAttribute("scale", "l"); }); - it("renders a close button when requested (deprecated)", async () => { - const page = await newE2EPage(); - await page.setContent(`Chip content`); - - const close = await page.find("calcite-chip >>> button.close"); - expect(close).not.toBeNull(); - }); - it("renders a close button when requested", async () => { const page = await newE2EPage(); await page.setContent(`Chip content`); diff --git a/src/components/chip/chip.tsx b/src/components/chip/chip.tsx index bcad0424e0f..79db413bc2b 100644 --- a/src/components/chip/chip.tsx +++ b/src/components/chip/chip.tsx @@ -3,7 +3,7 @@ import { getSlotted } from "../../utils/dom"; import { guid } from "../../utils/guid"; import { CSS, TEXT, SLOTS, ICONS } from "./resources"; import { ChipColor } from "./interfaces"; -import { Appearance, DeprecatedEventPayload, Scale } from "../interfaces"; +import { Appearance, Scale } from "../interfaces"; import { ConditionalSlotComponent, connectConditionalSlotComponent, @@ -115,9 +115,8 @@ export class Chip implements ConditionalSlotComponent, LoadableComponent { /** * Fires when the dismiss button is clicked. * - * **Note:**: The `el` event payload props is deprecated, please use the event's `target`/`currentTarget` instead. */ - @Event({ cancelable: false }) calciteChipDismiss: EventEmitter; + @Event({ cancelable: false }) calciteChipDismiss: EventEmitter; // -------------------------------------------------------------------------- // @@ -127,7 +126,7 @@ export class Chip implements ConditionalSlotComponent, LoadableComponent { closeClickHandler = (event: MouseEvent): void => { event.preventDefault(); - this.calciteChipDismiss.emit(this.el); + this.calciteChipDismiss.emit(); this.closed = true; }; diff --git a/src/components/combobox-item/combobox-item.tsx b/src/components/combobox-item/combobox-item.tsx index 61494fac75c..cf14321c7cd 100644 --- a/src/components/combobox-item/combobox-item.tsx +++ b/src/components/combobox-item/combobox-item.tsx @@ -15,7 +15,7 @@ import { CSS } from "./resources"; import { guid } from "../../utils/guid"; import { ComboboxChildElement } from "../combobox/interfaces"; import { getAncestors, getDepth } from "../combobox/utils"; -import { DeprecatedEventPayload, Scale } from "../interfaces"; +import { Scale } from "../interfaces"; import { connectConditionalSlotComponent, disconnectConditionalSlotComponent, @@ -60,7 +60,7 @@ export class ComboboxItem implements ConditionalSlotComponent, InteractiveCompon @Watch("selected") selectedWatchHandler(): void { - this.calciteComboboxItemChange.emit(this.el); + this.calciteComboboxItemChange.emit(); } /** The component's text. */ @@ -115,9 +115,8 @@ export class ComboboxItem implements ConditionalSlotComponent, InteractiveCompon /** * Emits whenever the component is selected or unselected. * - * **Note:**: The event's payload is deprecated, please use the event's `target`/`currentTarget` instead */ - @Event({ cancelable: false }) calciteComboboxItemChange: EventEmitter; + @Event({ cancelable: false }) calciteComboboxItemChange: EventEmitter; // -------------------------------------------------------------------------- //