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

week numbers #53

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix warnings
  • Loading branch information
WickyNilliams committed Jun 14, 2024
commit 87602236e76dad43850b2078fe9f66e0e1df144c
9 changes: 1 addition & 8 deletions src/calendar-base/useCalendarBase.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import {
useState,
useEvent,
useHost,
useEffect,
useMemo,
useRef,
} from "atomico";
import { useState, useEvent, useHost, useEffect, useMemo } from "atomico";
import { PlainDate, PlainYearMonth } from "../utils/temporal.js";
import { useDateProp, useDateFormatter } from "../utils/hooks.js";
import { clamp, toDate, today } from "../utils/date.js";
Expand Down
2 changes: 1 addition & 1 deletion src/calendar-date/calendar-date.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, nextFrame } from "@open-wc/testing";
import { sendKeys } from "@web/test-runner-commands";
import type { VNodeAny } from "atomico/types/vnode.js";
import type { VNodeAny } from "atomico/types/vnode";
import {
click,
clickDay,
Expand Down
2 changes: 1 addition & 1 deletion src/calendar-month/calendar-month.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, nextFrame } from "@open-wc/testing";
import { sendKeys } from "@web/test-runner-commands";
import type { VNodeAny } from "atomico/types/vnode.js";
import type { VNodeAny } from "atomico/types/vnode";
import {
clickDay,
createSpy,
Expand Down
2 changes: 1 addition & 1 deletion src/calendar-multi/calendar-multi.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from "@open-wc/testing";
import { sendKeys } from "@web/test-runner-commands";
import type { VNodeAny } from "atomico/types/vnode.js";
import type { VNodeAny } from "atomico/types/vnode";
import {
click,
clickDay,
Expand Down
4 changes: 2 additions & 2 deletions src/calendar-range/calendar-range.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from "@open-wc/testing";
import { sendKeys } from "@web/test-runner-commands";
import type { VNodeAny } from "atomico/types/vnode.js";
import type { VNodeAny } from "atomico/types/vnode";
import {
click,
clickDay,
Expand Down Expand Up @@ -255,7 +255,7 @@ describe("CalendarRange", () => {
expect(before[1]!.part.contains("selected")).to.eq(true);
expect(before[1]!.part.contains("range-end")).to.eq(true);

calendar.tentative = undefined;
calendar.tentative = "";
await calendar.updated;

const after = getSelectedDays(month);
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CalendarMulti } from "./calendar-multi/calendar-multi";

export { CalendarMonth, CalendarDate, CalendarRange, CalendarMulti };

import type { AtomicoThis } from "atomico/types/dom.js";
import type { AtomicoThis } from "atomico/types/dom";

type Simplify<T> = {
[K in keyof T]: T[K];
Expand Down
12 changes: 4 additions & 8 deletions src/utils/test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import {
sendKeys,
sendMouse,
type SendKeysPayload,
} from "@web/test-runner-commands";
import { sendKeys, sendMouse } from "@web/test-runner-commands";
import { fixture } from "atomico/test-dom";
import type { VNodeAny } from "atomico/types/vnode.js";
import type { VNodeAny } from "atomico/types/vnode";
import type { CalendarDate } from "../calendar-date/calendar-date.js";
import type { CalendarMonth } from "../calendar-month/calendar-month.js";
import type { CalendarRange } from "../calendar-range/calendar-range.js";
Expand Down Expand Up @@ -71,8 +67,8 @@ export async function click(element: Element) {
const { x, y, width, height } = element.getBoundingClientRect();

const position: [number, number] = [
Math.floor(x + window.pageXOffset + width / 2),
Math.floor(y + window.pageYOffset + height / 2),
Math.floor(x + window.scrollX + width / 2),
Math.floor(y + window.scrollY + height / 2),
];

await sendMouse({ type: "click", position });
Expand Down