Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
key: lock-${{ github.sha }}

- name: create package-lock.json
run: npm i --package-lock-only --ignore-scripts
run: npm i --package-lock-only --ignore-scripts --legacy-peer-deps

- name: hack for singe file
run: |
Expand All @@ -42,7 +42,7 @@ jobs:

- name: install
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm ci
run: npm ci --legacy-peer-deps

lint:
runs-on: ubuntu-latest
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# rc-overflow 🐾
# @rc-component/overflow 🐾

[![NPM version][npm-image]][npm-url]
[![npm download][download-image]][download-url]
Expand All @@ -7,8 +7,8 @@
[![bundle size][bundlephobia-image]][bundlephobia-url]
[![dumi][dumi-image]][dumi-url]

[npm-image]: http://img.shields.io/npm/v/rc-overflow.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-overflow
[npm-image]: http://img.shields.io/npm/v/@rc-component/overflow.svg?style=flat-square
[npm-url]: http://npmjs.org/package/@rc-component/overflow
[github-actions-image]: https://github.com/react-component/overflow/workflows/CI/badge.svg
[github-actions-url]: https://github.com/react-component/overflow/actions
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/overflow/master.svg?style=flat-square
Expand All @@ -17,10 +17,10 @@
[david-image]: https://david-dm.org/react-component/overflow/status.svg?style=flat-square
[david-dev-url]: https://david-dm.org/react-component/overflow?type=dev
[david-dev-image]: https://david-dm.org/react-component/overflow/dev-status.svg?style=flat-square
[download-image]: https://img.shields.io/npm/dm/rc-overflow.svg?style=flat-square
[download-url]: https://npmjs.org/package/rc-overflow
[bundlephobia-url]: https://bundlephobia.com/result?p=rc-overflow
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-overflow
[download-image]: https://img.shields.io/npm/dm/@rc-component/overflow.svg?style=flat-square
[download-url]: https://npmjs.org/package/@rc-component/overflow
[bundlephobia-url]: https://bundlephobia.com/result?p=@rc-component/overflow
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@rc-component/overflow
[dumi-url]: https://github.com/umijs/dumi
[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square

Expand All @@ -32,7 +32,7 @@ https://overflow-react-component.vercel.app/

## Install

[![rc-overflow](https://nodei.co/npm/rc-overflow.png)](https://npmjs.org/package/rc-overflow)
[![@rc-component/overflow](https://nodei.co/npm/@rc-component/overflow.png)](https://npmjs.org/package/@rc-component/overflow)

## Usage

Expand All @@ -54,4 +54,4 @@ npm start

## License

rc-overflow is released under the MIT license.
@rc-component/overflow is released under the MIT license.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
hero:
title: rc-overflow
title: @rc-component/overflow
description: React Overflow Component
---

Expand Down
2 changes: 1 addition & 1 deletion examples/fill-width.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import useLayoutEffect from "rc-util/lib/hooks/useLayoutEffect";
import useLayoutEffect from "@rc-component/util/lib/hooks/useLayoutEffect";
import Overflow from '../src';
import '../assets/index.less';
import './common.less';
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rc-overflow",
"version": "1.4.1",
"name": "@rc-component/overflow",
"version": "1.0.0",
"description": "Auto collapse box when overflow",
"keywords": [
"react",
Expand Down Expand Up @@ -38,22 +38,22 @@
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
"test": "rc-test",
"test:coverage": "rc-test --coverage",
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",
"prepublishOnly": "npm run compile && rc-np",
"lint": "eslint src/ --ext .tsx,.ts",
"lint:tsc": "tsc -p tsconfig.json --noEmit",
"now-build": "npm run docs:build"
},
"dependencies": {
"@babel/runtime": "^7.11.1",
"classnames": "^2.2.1",
"rc-resize-observer": "^1.0.0",
"rc-util": "^5.37.0"
"@rc-component/resize-observer": "^1.0.1",
"@rc-component/util": "^1.4.0",
"clsx": "^2.1.1"
},
"devDependencies": {
"@rc-component/father-plugin": "^1.0.0",
"@rc-component/father-plugin": "^2.0.0",
"@rc-component/np": "^1.0.4",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^12.0.0",
"@types/classnames": "^2.2.9",
"@types/enzyme": "^3.10.8",
"@types/jest": "^26.0.23",
"@types/node": "^24.8.1",
Expand Down Expand Up @@ -94,4 +94,4 @@
"tnpm": {
"mode": "npm"
}
}
}
6 changes: 3 additions & 3 deletions src/Item.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import classNames from 'classnames';
import ResizeObserver from 'rc-resize-observer';
import { clsx } from 'clsx';
import ResizeObserver from '@rc-component/resize-observer';
import type { ComponentType } from './RawItem';

// Use shared variable to save bundle size
Expand Down Expand Up @@ -89,7 +89,7 @@ function InternalItem<ItemType>(

let itemNode = (
<Component
className={classNames(!invalidate && prefixCls, className)}
className={clsx(!invalidate && prefixCls, className)}
style={{
...overflowStyle,
...style,
Expand Down
8 changes: 4 additions & 4 deletions src/Overflow.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react';
import { useState, useMemo, useCallback } from 'react';
import classNames from 'classnames';
import ResizeObserver from 'rc-resize-observer';
import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
import { clsx } from 'clsx';
import ResizeObserver from '@rc-component/resize-observer';
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
import Item from './Item';
import useEffectState, { useBatcher } from './hooks/useEffectState';
import type { ComponentType } from './RawItem';
Expand Down Expand Up @@ -394,7 +394,7 @@ function Overflow<ItemType = any>(

const overflowNode = (
<Component
className={classNames(!invalidate && prefixCls, className)}
className={clsx(!invalidate && prefixCls, className)}
style={style}
ref={ref}
{...restProps}
Expand Down
4 changes: 2 additions & 2 deletions src/RawItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import classNames from 'classnames';
import { clsx } from 'clsx';
import Item from './Item';
import { OverflowContext } from './context';

Expand Down Expand Up @@ -31,7 +31,7 @@ const InternalRawItem = (props: RawItemProps, ref: React.Ref<any>) => {
<OverflowContext.Provider value={null}>
<Item
ref={ref}
className={classNames(contextClassName, className)}
className={clsx(contextClassName, className)}
{...restContext}
{...restProps}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/channelUpdate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import raf from 'rc-util/lib/raf';
import raf from '@rc-component/util/lib/raf';

export default function channelUpdate(callback: VoidFunction) {
if (typeof MessageChannel === 'undefined') {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useEffectState.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import useEvent from 'rc-util/lib/hooks/useEvent';
import useEvent from '@rc-component/util/lib/hooks/useEvent';
import * as React from 'react';
import { unstable_batchedUpdates } from 'react-dom';
import channelUpdate from './channelUpdate';
Expand Down
4 changes: 2 additions & 2 deletions tests/github.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { render, act } from '@testing-library/react';
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
import Overflow from '../src';

import { _rs as onResize } from 'rc-resize-observer/lib/utils/observerUtil';
import { _rs as onResize } from '@rc-component/resize-observer/lib/utils/observerUtil';

interface ItemType {
label: React.ReactNode;
Expand Down