Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(chip,combobox-item)!: remove deprecated event payload. #6028

Merged
merged 8 commits into from
Dec 15, 2022
8 changes: 0 additions & 8 deletions src/components/chip/chip.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(`<calcite-chip closable>Chip content</calcite-chip>`);

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(`<calcite-chip closable>Chip content</calcite-chip>`);
Expand Down
8 changes: 3 additions & 5 deletions src/components/chip/chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getSlotted } from "../../utils/dom";
import { guid } from "../../utils/guid";
import { CSS, SLOTS, ICONS } from "./resources";
import { ChipColor } from "./interfaces";
import { Appearance, DeprecatedEventPayload, Scale } from "../interfaces";
import { Appearance, Scale } from "../interfaces";
import {
ConditionalSlotComponent,
connectConditionalSlotComponent,
Expand Down Expand Up @@ -161,10 +161,8 @@ export class Chip

/**
* Fires when the close button is clicked.
*
* **Note:**: The `el` event payload props is deprecated, please use the event's `target`/`currentTarget` instead.
*/
@Event({ cancelable: false }) calciteChipClose: EventEmitter<DeprecatedEventPayload>;
@Event({ cancelable: false }) calciteChipClose: EventEmitter<void>;

// --------------------------------------------------------------------------
//
Expand All @@ -174,7 +172,7 @@ export class Chip

closeClickHandler = (event: MouseEvent): void => {
event.preventDefault();
this.calciteChipClose.emit(this.el);
this.calciteChipClose.emit();
this.closed = true;
};

Expand Down
7 changes: 3 additions & 4 deletions src/components/combobox-item/combobox-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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<DeprecatedEventPayload>;
@Event({ cancelable: false }) calciteComboboxItemChange: EventEmitter<void>;

// --------------------------------------------------------------------------
//
Expand Down