Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
benelan committed Feb 1, 2023
1 parent a9e7a75 commit 60d39ea
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 117 deletions.
24 changes: 12 additions & 12 deletions src/components/action-group/action-group.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { Component, Element, Fragment, h, Method, Prop, State, VNode, Watch } from "@stencil/core";
import { CalciteActionMenuCustomEvent } from "../../components";
import {
ConditionalSlotComponent,
connectConditionalSlotComponent,
disconnectConditionalSlotComponent
ConditionalSlotComponent,
connectConditionalSlotComponent,
disconnectConditionalSlotComponent
} from "../../utils/conditionalSlot";
import { getSlotted } from "../../utils/dom";
import {
componentLoaded,
LoadableComponent,
setComponentLoaded,
setUpLoadableComponent
componentLoaded,
LoadableComponent,
setComponentLoaded,
setUpLoadableComponent
} from "../../utils/loadable";
import { connectLocalized, disconnectLocalized, LocalizedComponent } from "../../utils/locale";
import {
connectMessages,
disconnectMessages,
setUpMessages,
T9nComponent,
updateMessages
connectMessages,
disconnectMessages,
setUpMessages,
T9nComponent,
updateMessages
} from "../../utils/t9n";
import { SLOTS as ACTION_MENU_SLOTS } from "../action-menu/resources";
import { Columns, Layout, Scale } from "../interfaces";
Expand Down
10 changes: 5 additions & 5 deletions src/components/date-picker/date-picker.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { E2EPage, newE2EPage } from "@stencil/core/testing";
import { html } from "../../../support/formatting";
import { focusable, defaults, hidden, renders, t9n } from "../../tests/commonTests";
import { defaults, focusable, hidden, renders, t9n } from "../../tests/commonTests";
import { skipAnimations } from "../../tests/utils";
import { formatTimePart } from "../../utils/time";

Expand All @@ -17,10 +17,10 @@ describe("calcite-date-picker", () => {
}
]));

it("focusable", async () =>
focusable("<calcite-date-picker></calcite-date-picker>", {
shadowFocusTargetSelector: 'calcite-date-picker-month-header'
}));
it("focusable", async () =>
focusable("<calcite-date-picker></calcite-date-picker>", {
shadowFocusTargetSelector: "calcite-date-picker-month-header"
}));

const animationDurationInMs = 200;

Expand Down
61 changes: 32 additions & 29 deletions src/components/date-picker/date-picker.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@
import {
Build,
Component,
Element,
Event,
EventEmitter, h,
Host, Method, Prop,
State,
VNode,
Watch
Build,
Component,
Element,
Event,
EventEmitter,
h,
Host,
Method,
Prop,
State,
VNode,
Watch
} from "@stencil/core";
import {
dateFromISO,
dateFromRange,
dateToISO,
getDaysDiff,
HoverRange,
setEndOfDay
dateFromISO,
dateFromRange,
dateToISO,
getDaysDiff,
HoverRange,
setEndOfDay
} from "../../utils/date";
import {
componentLoaded,
LoadableComponent,
setComponentLoaded,
setUpLoadableComponent
componentLoaded,
LoadableComponent,
setComponentLoaded,
setUpLoadableComponent
} from "../../utils/loadable";
import {
connectLocalized,
disconnectLocalized,
LocalizedComponent,
NumberingSystem,
numberStringFormatter
connectLocalized,
disconnectLocalized,
LocalizedComponent,
NumberingSystem,
numberStringFormatter
} from "../../utils/locale";
import {
connectMessages,
disconnectMessages,
setUpMessages,
T9nComponent,
updateMessages
connectMessages,
disconnectMessages,
setUpMessages,
T9nComponent,
updateMessages
} from "../../utils/t9n";
import { HeadingLevel } from "../functional/Heading";
import { DatePickerMessages } from "./assets/date-picker/t9n";
Expand Down
66 changes: 33 additions & 33 deletions src/components/dropdown/dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
import {
Component,
Element,
Event,
EventEmitter,
h,
Host,
Listen,
Method,
Prop,
VNode,
Watch
Component,
Element,
Event,
EventEmitter,
h,
Host,
Listen,
Method,
Prop,
VNode,
Watch
} from "@stencil/core";
import { ItemKeyboardEvent } from "./interfaces";

import {
focusElement,
focusElementInGroup,
isPrimaryPointerButton,
toAriaBoolean
focusElement,
focusElementInGroup,
isPrimaryPointerButton,
toAriaBoolean
} from "../../utils/dom";
import {
connectFloatingUI,
defaultMenuPlacement,
disconnectFloatingUI,
EffectivePlacement,
filterComputedPlacements,
FloatingCSS,
FloatingUIComponent,
MenuPlacement,
OverlayPositioning,
reposition,
updateAfterClose
connectFloatingUI,
defaultMenuPlacement,
disconnectFloatingUI,
EffectivePlacement,
filterComputedPlacements,
FloatingCSS,
FloatingUIComponent,
MenuPlacement,
OverlayPositioning,
reposition,
updateAfterClose
} from "../../utils/floating-ui";
import { guid } from "../../utils/guid";
import { InteractiveComponent, updateHostInteraction } from "../../utils/interactive";
import { isActivationKey } from "../../utils/key";
import {
componentLoaded,
LoadableComponent,
setComponentLoaded,
setUpLoadableComponent
componentLoaded,
LoadableComponent,
setComponentLoaded,
setUpLoadableComponent
} from "../../utils/loadable";
import { createObserver } from "../../utils/observers";
import {
connectOpenCloseComponent,
disconnectOpenCloseComponent,
OpenCloseComponent
connectOpenCloseComponent,
disconnectOpenCloseComponent,
OpenCloseComponent
} from "../../utils/openCloseComponent";
import { RequestedItem } from "../dropdown-group/interfaces";
import { Scale } from "../interfaces";
Expand Down
6 changes: 3 additions & 3 deletions src/components/pagination/pagination.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { newE2EPage, E2EElement, E2EPage } from "@stencil/core/testing";
import { focusable, accessible, hidden, renders, t9n } from "../../tests/commonTests";
import { CSS } from "./resources";
import { E2EElement, E2EPage, newE2EPage } from "@stencil/core/testing";
import { html } from "../../../support/formatting";
import { accessible, focusable, hidden, renders, t9n } from "../../tests/commonTests";
import { CSS } from "./resources";

describe("calcite-pagination", () => {
it("renders", async () => renders("calcite-pagination", { display: "flex" }));
Expand Down
50 changes: 25 additions & 25 deletions src/components/pagination/pagination.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import {
Component,
Element,
Event,
EventEmitter,
Fragment,
h,
Method,
Prop,
State,
VNode,
Watch
Component,
Element,
Event,
EventEmitter,
Fragment,
h,
Method,
Prop,
State,
VNode,
Watch
} from "@stencil/core";
import {
componentLoaded,
LoadableComponent,
setComponentLoaded,
setUpLoadableComponent
componentLoaded,
LoadableComponent,
setComponentLoaded,
setUpLoadableComponent
} from "../../utils/loadable";
import {
connectLocalized,
disconnectLocalized,
LocalizedComponent,
NumberingSystem,
numberStringFormatter
connectLocalized,
disconnectLocalized,
LocalizedComponent,
NumberingSystem,
numberStringFormatter
} from "../../utils/locale";
import {
connectMessages,
disconnectMessages,
setUpMessages,
T9nComponent,
updateMessages
connectMessages,
disconnectMessages,
setUpMessages,
T9nComponent,
updateMessages
} from "../../utils/t9n";
import { Scale } from "../interfaces";
import { PaginationMessages } from "./assets/pagination/t9n";
Expand Down
20 changes: 15 additions & 5 deletions src/components/split-button/split-button.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import { Component, Element, Event, EventEmitter, h, Method, Prop, VNode, Watch } from "@stencil/core";
import {
Component,
Element,
Event,
EventEmitter,
h,
Method,
Prop,
VNode,
Watch
} from "@stencil/core";
import { OverlayPositioning } from "../../utils/floating-ui";
import { InteractiveComponent, updateHostInteraction } from "../../utils/interactive";
import {
componentLoaded,
LoadableComponent,
setComponentLoaded,
setUpLoadableComponent
componentLoaded,
LoadableComponent,
setComponentLoaded,
setUpLoadableComponent
} from "../../utils/loadable";
import { DropdownIconType } from "../button/interfaces";
import { Appearance, FlipContext, Kind, Scale, Width } from "../interfaces";
Expand Down
10 changes: 5 additions & 5 deletions src/tests/commonTests.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { E2EElement, E2EPage, newE2EPage } from "@stencil/core/testing";
import { JSX } from "../components";
import { toHaveNoViolations } from "jest-axe";
import axe from "axe-core";
import { toHaveNoViolations } from "jest-axe";
import { config } from "../../stencil.config";
import { GlobalTestProps, skipAnimations } from "./utils";
import { hiddenFormInputSlotName } from "../utils/form";
import { html } from "../../support/formatting";
import { JSX } from "../components";
import { hiddenFormInputSlotName } from "../utils/form";
import { MessageBundle } from "../utils/t9n";
import { GlobalTestProps, skipAnimations } from "./utils";

expect.extend(toHaveNoViolations);

Expand Down Expand Up @@ -212,8 +212,8 @@ export async function focusable(componentTagOrHTML: TagOrHTML, options?: Focusab
const page = await simplePageSetup(componentTagOrHTML);
const tag = getTag(componentTagOrHTML);
const element = await page.find(tag);
await element.callMethod("componentOnReady");
const focusTargetSelector = options?.focusTargetSelector || tag;
await element.callMethod("componentOnReady");
await element.callMethod("setFocus", options?.focusId); // assumes element is FocusableElement

if (options?.shadowFocusTargetSelector) {
Expand Down

0 comments on commit 60d39ea

Please sign in to comment.