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(action-bar, action-group, action-pad, shell, shell-panel): remove conditional slot component where not necessary #10464

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ import {
Watch,
} from "@stencil/core";
import { debounce } from "lodash-es";
import {
ConditionalSlotComponent,
connectConditionalSlotComponent,
disconnectConditionalSlotComponent,
} from "../../utils/conditionalSlot";
import {
focusFirstTabbable,
slotChangeGetAssignedElements,
Expand Down Expand Up @@ -57,9 +52,7 @@ import { geActionDimensions, getOverflowCount, overflowActions, queryActions } f
shadow: true,
assetsDirs: ["assets"],
})
export class ActionBar
implements ConditionalSlotComponent, LoadableComponent, LocalizedComponent, T9nComponent
{
export class ActionBar implements LoadableComponent, LocalizedComponent, T9nComponent {
// --------------------------------------------------------------------------
//
// Properties
Expand Down Expand Up @@ -228,7 +221,6 @@ export class ActionBar
}

this.overflowActions();
connectConditionalSlotComponent(this);
}

async componentWillLoad(): Promise<void> {
Expand All @@ -239,7 +231,6 @@ export class ActionBar
disconnectedCallback(): void {
this.mutationObserver?.disconnect();
this.resizeObserver?.disconnect();
disconnectConditionalSlotComponent(this);
disconnectLocalized(this);
disconnectMessages(this);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { Component, Element, h, Method, Prop, State, VNode, Watch } from "@stencil/core";
import { CalciteActionMenuCustomEvent } from "../../components";
import {
ConditionalSlotComponent,
connectConditionalSlotComponent,
disconnectConditionalSlotComponent,
} from "../../utils/conditionalSlot";
import {
componentFocusable,
LoadableComponent,
Expand Down Expand Up @@ -40,9 +35,7 @@ import { ICONS, SLOTS, CSS } from "./resources";
},
assetsDirs: ["assets"],
})
export class ActionGroup
implements ConditionalSlotComponent, LoadableComponent, LocalizedComponent, T9nComponent
{
export class ActionGroup implements LoadableComponent, LocalizedComponent, T9nComponent {
// --------------------------------------------------------------------------
//
// Properties
Expand Down Expand Up @@ -163,13 +156,11 @@ export class ActionGroup
connectedCallback(): void {
connectLocalized(this);
connectMessages(this);
connectConditionalSlotComponent(this);
}

disconnectedCallback(): void {
disconnectLocalized(this);
disconnectMessages(this);
disconnectConditionalSlotComponent(this);
}

async componentWillLoad(): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ import {
VNode,
Watch,
} from "@stencil/core";
import {
ConditionalSlotComponent,
connectConditionalSlotComponent,
disconnectConditionalSlotComponent,
} from "../../utils/conditionalSlot";
import { slotChangeGetAssignedElements } from "../../utils/dom";
import {
componentFocusable,
Expand Down Expand Up @@ -50,9 +45,7 @@ import { CSS, SLOTS } from "./resources";
},
assetsDirs: ["assets"],
})
export class ActionPad
implements ConditionalSlotComponent, LoadableComponent, LocalizedComponent, T9nComponent
{
export class ActionPad implements LoadableComponent, LocalizedComponent, T9nComponent {
// --------------------------------------------------------------------------
//
// Properties
Expand Down Expand Up @@ -169,7 +162,6 @@ export class ActionPad
// --------------------------------------------------------------------------

connectedCallback(): void {
connectConditionalSlotComponent(this);
connectLocalized(this);
connectMessages(this);
this.mutationObserver?.observe(this.el, { childList: true, subtree: true });
Expand All @@ -178,7 +170,6 @@ export class ActionPad
disconnectedCallback(): void {
disconnectLocalized(this);
disconnectMessages(this);
disconnectConditionalSlotComponent(this);
this.mutationObserver?.disconnect();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ import {
VNode,
Watch,
} from "@stencil/core";
import {
ConditionalSlotComponent,
connectConditionalSlotComponent,
disconnectConditionalSlotComponent,
} from "../../utils/conditionalSlot";
import {
getElementDir,
isPrimaryPointerButton,
Expand Down Expand Up @@ -46,7 +41,7 @@ import { DisplayMode } from "./interfaces";
shadow: true,
assetsDirs: ["assets"],
})
export class ShellPanel implements ConditionalSlotComponent, LocalizedComponent, T9nComponent {
export class ShellPanel implements LocalizedComponent, T9nComponent {
// --------------------------------------------------------------------------
//
// Properties
Expand Down Expand Up @@ -167,7 +162,6 @@ export class ShellPanel implements ConditionalSlotComponent, LocalizedComponent,
//--------------------------------------------------------------------------

connectedCallback(): void {
connectConditionalSlotComponent(this);
connectLocalized(this);
connectMessages(this);
}
Expand All @@ -177,7 +171,6 @@ export class ShellPanel implements ConditionalSlotComponent, LocalizedComponent,
}

disconnectedCallback(): void {
disconnectConditionalSlotComponent(this);
this.disconnectSeparator();
disconnectLocalized(this);
disconnectMessages(this);
Expand Down
21 changes: 1 addition & 20 deletions packages/calcite-components/src/components/shell/shell.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import { Component, Element, Fragment, h, Listen, Prop, State, VNode, Watch } from "@stencil/core";
import {
ConditionalSlotComponent,
connectConditionalSlotComponent,
disconnectConditionalSlotComponent,
} from "../../utils/conditionalSlot";
import { slotChangeGetAssignedElements, slotChangeHasAssignedElement } from "../../utils/dom";
import { CSS, SLOTS } from "./resources";

Expand All @@ -27,7 +22,7 @@ import { CSS, SLOTS } from "./resources";
styleUrl: "shell.scss",
shadow: true,
})
export class Shell implements ConditionalSlotComponent {
export class Shell {
// --------------------------------------------------------------------------
//
// Properties
Expand Down Expand Up @@ -91,20 +86,6 @@ export class Shell implements ConditionalSlotComponent {
this.hasOnlyPanelBottom = !this.hasPanelTop && this.hasPanelBottom;
}

// --------------------------------------------------------------------------
//
// Lifecycle
//
// --------------------------------------------------------------------------

connectedCallback(): void {
connectConditionalSlotComponent(this);
}

disconnectedCallback(): void {
disconnectConditionalSlotComponent(this);
}

// --------------------------------------------------------------------------
//
// Private Methods
Expand Down
Loading