Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
[WINDOW]: switch package to native esm. (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
leebeydoun authored Feb 25, 2022
1 parent 1789f5f commit 42635d0
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 29 deletions.
5 changes: 5 additions & 0 deletions .changeset/yellow-pears-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@resembli/react-virtualized-window": minor
---

Make react-virtualized-window an esm module
1 change: 1 addition & 0 deletions packages/react-virtualized-window/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"version": "0.7.1",
"types": "src/index.ts",
"main": "src/index.ts",
"type": "module",
"publishConfig": {
"main": "dist/index.js",
"types": "dist/types/index.d.ts"
Expand Down
4 changes: 2 additions & 2 deletions packages/react-virtualized-window/src/PinnedColumn.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react"

import { RenderItem } from "./RenderItem"
import type { GridProps } from "./types"
import { RenderItem } from "./RenderItem.js"
import type { GridProps } from "./types.js"

interface PinnedColumnsProps<T> {
totalWidth: number
Expand Down
2 changes: 1 addition & 1 deletion packages/react-virtualized-window/src/RenderItem.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react"

import type { CellMeta, GridProps } from "./types"
import type { CellMeta, GridProps } from "./types.js"

type RenderItemsProps<T> = {
Component: GridProps<T>["children"]
Expand Down
28 changes: 14 additions & 14 deletions packages/react-virtualized-window/src/components/Grid.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import * as React from "react"

import { PinnedColumn } from "../PinnedColumn"
import { ScrollDiv } from "../ScrollDiv"
import { SizingDiv } from "../SizingDiv"
import { StickyDiv } from "../StickyDiv"
import { getScrollbarWidth } from "../getScrollbarWidth"
import type { GridProps } from "../types"
import { useDataDimension } from "../useDataDimension"
import { useIndicesForDimensions } from "../useDimensionIndices"
import { useScrollAdjustWindowDims } from "../useScrollAdjustedDim"
import { useScrollItems } from "../useScrollItems"
import { useSmartSticky } from "../useSmartSticky"
import { useWindowApi } from "../useWindowApi"
import { useWindowDimensions } from "../useWindowDimensions"
import { useWindowScroll } from "../useWindowScroll"
import { PinnedColumn } from "../PinnedColumn.js"
import { ScrollDiv } from "../ScrollDiv.js"
import { SizingDiv } from "../SizingDiv.js"
import { StickyDiv } from "../StickyDiv.js"
import { getScrollbarWidth } from "../getScrollbarWidth.js"
import type { GridProps } from "../types.js"
import { useDataDimension } from "../useDataDimension.js"
import { useIndicesForDimensions } from "../useDimensionIndices.js"
import { useScrollAdjustWindowDims } from "../useScrollAdjustedDim.js"
import { useScrollItems } from "../useScrollItems.js"
import { useSmartSticky } from "../useSmartSticky.js"
import { useWindowApi } from "../useWindowApi.js"
import { useWindowDimensions } from "../useWindowDimensions.js"
import { useWindowScroll } from "../useWindowScroll.js"

export function Grid<T, L = unknown, R = unknown>({
data,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-virtualized-window/src/components/List.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react"

import type { CellMeta, NumberOrPercent, VirtualWindowBaseProps } from "../types"
import { Grid } from "./Grid"
import type { CellMeta, NumberOrPercent, VirtualWindowBaseProps } from "../types.js"
import { Grid } from "./Grid.js"

export interface ListProps<T> extends VirtualWindowBaseProps<T> {
data: T[]
Expand Down
4 changes: 2 additions & 2 deletions packages/react-virtualized-window/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { List } from "./components/List"
export { Grid } from "./components/Grid"
export { List } from "./components/List.js"
export { Grid } from "./components/Grid.js"

export type { ListProps } from "./components/List"
export type { VirtualWindowApi } from "./useWindowApi"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-virtualized-window/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { VirtualWindowApi } from "./useWindowApi"
import type { VirtualWindowApi } from "./useWindowApi.js"

export type NumberOrPercent = number | `${number}%`

Expand Down
2 changes: 1 addition & 1 deletion packages/react-virtualized-window/src/useDataDimension.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react"

import type { NumberOrPercent } from "./types"
import type { NumberOrPercent } from "./types.js"

interface UseDataDimensionArgs {
count: number
Expand Down
6 changes: 3 additions & 3 deletions packages/react-virtualized-window/src/useScrollAdjustedDim.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from "react"

import { getScrollbarWidth } from "./getScrollbarWidth"
import type { NumberOrPercent } from "./types"
import { dimToNumber } from "./utils"
import { getScrollbarWidth } from "./getScrollbarWidth.js"
import type { NumberOrPercent } from "./types.js"
import { dimToNumber } from "./utils.js"

interface UseScrollAdjustedWindowDimsArgs {
height: number
Expand Down
4 changes: 2 additions & 2 deletions packages/react-virtualized-window/src/useScrollItems.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react"

import { RenderItem } from "./RenderItem"
import type { GridProps } from "./types"
import { RenderItem } from "./RenderItem.js"
import type { GridProps } from "./types.js"

interface ScrollItemArgs<T> {
vertStart: number
Expand Down
2 changes: 1 addition & 1 deletion packages/react-virtualized-window/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NumberOrPercent } from "./types"
import type { NumberOrPercent } from "./types.js"

export function percentToNumber(percent: string) {
return parseFloat(percent) / 100.0
Expand Down

0 comments on commit 42635d0

Please sign in to comment.