diff --git a/.dumirc.ts b/.dumirc.ts
index bd80941..d8e2b76 100644
--- a/.dumirc.ts
+++ b/.dumirc.ts
@@ -1,23 +1,12 @@
import { defineConfig } from 'dumi';
-import path from 'path';
export default defineConfig({
- alias: {
- 'rc-trigger$': path.resolve('src'),
- 'rc-trigger/es': path.resolve('src'),
- },
mfsu: false,
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
themeConfig: {
- name: 'Trigger',
+ name: 'cssinjs-util',
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
},
- styles: [
- `
- .dumi-default-previewer-demo {
- position: relative;
- min-height: 300px;
- }
- `,
- ]
});
+
+
diff --git a/.fatherrc.js b/.fatherrc.js
index 4ddbafd..96268ae 100644
--- a/.fatherrc.js
+++ b/.fatherrc.js
@@ -2,4 +2,4 @@ import { defineConfig } from 'father';
export default defineConfig({
plugins: ['@rc-component/father-plugin'],
-});
\ No newline at end of file
+});
diff --git a/.gitignore b/.gitignore
index 65899cf..009d7ba 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,8 @@
+~*
.storybook
*.iml
*.log
-.idea
+.idea/
.ipr
.iws
*~
@@ -13,28 +14,31 @@
Thumbs.db
.project
.*proj
-.svn
+.svn/
*.swp
*.swo
*.pyc
*.pyo
+.build
node_modules
.cache
-*.css
+assets/**/*.css
build
lib
es
-coverage
+dist
yarn.lock
package-lock.json
+coverage/
+.doc
-# dumi
+# umi
.umi
.umi-production
.umi-test
-.docs
-
+.env.local
# dumi
.dumi/tmp
-.dumi/tmp-production
\ No newline at end of file
+.dumi/tmp-production
+.dumi/tmp-test
diff --git a/HISTORY.md b/HISTORY.md
index 7ee63c8..ab24a71 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -1,58 +1,2 @@
# History
----
-
-## 4.1.0 / 2020-05-08
-
-- upgrade rc-animate to `3.x`
-
-## 2.5.0 / 2018-06-05
-
-- support `alignPoint`
-
-## 2.1.0 / 2017-10-16
-
-- add action `contextMenu`
-
-## 2.0.0 / 2017-09-25
-
-- support React 16
-
-## 1.11.0 / 2017-06-07
-
-- add es
-
-## 1.9.0 / 2017-02-27
-
-- add getDocument prop
-
-## 1.8.2 / 2017-02-24
-
-- change default container to absolute to fix scrollbar change problem
-
-## 1.7.0 / 2016-07-18
-
-- use getContainerRenderMixin from 'rc-util'
-
-## 1.6.0 / 2016-05-26
-
-- support popup as function
-
-## 1.5.0 / 2016-05-26
-
-- add forcePopupAlign method
-
-## 1.4.0 / 2016-04-06
-
-- support onPopupAlign
-
-## 1.3.0 / 2016-03-25
-
-- support mask/maskTransitionName/zIndex
-
-## 1.2.0 / 2016-03-01
-
-- add showAction/hideAction
-
-## 1.1.0 / 2016-01-06
-
-- add root trigger node as parameter of getPopupContainer
diff --git a/README.md b/README.md
index e479e56..26eeed6 100644
--- a/README.md
+++ b/README.md
@@ -1,258 +1,30 @@
-# @rc-component/trigger
-
-React Trigger Component
-
-[![NPM version][npm-image]][npm-url]
-[![npm download][download-image]][download-url]
-[![build status][github-actions-image]][github-actions-url]
-[![Test coverage][codecov-image]][codecov-url]
-[![bundle size][bundlephobia-image]][bundlephobia-url]
-[![dumi][dumi-image]][dumi-url]
-
-[npm-image]: http://img.shields.io/npm/v/rc-checkbox.svg?style=flat-square
-[npm-url]: http://npmjs.org/package/rc-checkbox
-[github-actions-image]: https://github.com/react-component/checkbox/workflows/CI/badge.svg
-[github-actions-url]: https://github.com/react-component/checkbox/actions
-[codecov-image]: https://img.shields.io/codecov/c/github/react-component/checkbox/master.svg?style=flat-square
-[codecov-url]: https://codecov.io/gh/react-component/checkbox/branch/master
-[david-url]: https://david-dm.org/react-component/checkbox
-[david-image]: https://david-dm.org/react-component/checkbox/status.svg?style=flat-square
-[david-dev-url]: https://david-dm.org/react-component/checkbox?type=dev
-[david-dev-image]: https://david-dm.org/react-component/checkbox/dev-status.svg?style=flat-square
-[download-image]: https://img.shields.io/npm/dm/rc-checkbox.svg?style=flat-square
-[download-url]: https://npmjs.org/package/rc-checkbox
-[bundlephobia-url]: https://bundlephobia.com/result?p=rc-checkbox
-[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-checkbox
-[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square
-[dumi-url]: https://github.com/umijs/dumi
+# @ant-design/cssinjs-util
+A cssinjs util library to support Ant Design (antd) and its ecosystem libraries.
## Install
-
-[![@rc-component/trigger](https://nodei.co/npm/@rc-component/trigger.png)](https://npmjs.org/package/@rc-component/trigger)
-
-## Usage
-
-Include the default [styling](https://github.com/react-component/trigger/blob/master/assets/index.less#L4:L11) and then:
-
-```js
-import React from 'react';
-import ReactDOM from 'react-dom';
-import Trigger from '@rc-component/trigger';
-
-ReactDOM.render((
-
IE / Edge | [](http://godban.github.io/browsers-support-badges/)
Firefox | [](http://godban.github.io/browsers-support-badges/)
Chrome | [](http://godban.github.io/browsers-support-badges/)
Safari | [](http://godban.github.io/browsers-support-badges/)
Electron |
-| --- | --- | --- | --- | --- |
-| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
+## Usage
## Example
-
-http://localhost:9001
+http://localhost:8000
## Development
-
-```
+``` bash
npm install
npm start
```
## API
-### props
-
-
name | -type | -default | -description | -
---|---|---|---|
alignPoint | -bool | -false | -Popup will align with mouse position (support action of 'click', 'hover' and 'contextMenu') | -
popupClassName | -string | -- | additional className added to popup | -
forceRender | -boolean | -false | -whether render popup before first show | -
destroyPopupOnHide | -boolean | -false | -whether destroy popup when hide | -
getPopupClassNameFromAlign | -getPopupClassNameFromAlign(align: Object):String | -- | additional className added to popup according to align | -
action | -string[] | -['hover'] | -which actions cause popup shown. enum of 'hover','click','focus','contextMenu' | -
mouseEnterDelay | -number | -0 | -delay time to show when mouse enter. unit: s. | -
mouseLeaveDelay | -number | -0.1 | -delay time to hide when mouse leave. unit: s. | -
popupStyle | -Object | -- | additional style of popup | -
prefixCls | -String | -rc-trigger-popup | -prefix class name | -
popupTransitionName | -String|Object | -- | https://github.com/react-component/animate | -
maskTransitionName | -String|Object | -- | https://github.com/react-component/animate | -
onPopupVisibleChange | -Function | -- | call when popup visible is changed | -
mask | -boolean | -false | -whether to support mask | -
maskClosable | -boolean | -true | -whether to support click mask to hide | -
popupVisible | -boolean | -- | whether popup is visible | -
zIndex | -number | -- | popup's zIndex | -
defaultPopupVisible | -boolean | -- | whether popup is visible initially | -
popupAlign | -Object: alignConfig of [dom-align](https://github.com/yiminghe/dom-align) | -- | popup 's align config | -
onPopupAlign | -function(popupDomNode, align) | -- | callback when popup node is aligned | -
popup | -React.Element | function() => React.Element | -- | popup content | -
getPopupContainer | -getPopupContainer(): HTMLElement | -- | function returning html node which will act as popup container | -
getDocument | -getDocument(): HTMLElement | -- | function returning document node which will be attached click event to close trigger | -
popupPlacement | -string | -- | use preset popup align config from builtinPlacements, can be merged by popupAlign prop | -
builtinPlacements | -object | -- | builtin placement align map. used by placement prop | -
stretch | -string | -- | Let popup div stretch with trigger element. enums of 'width', 'minWidth', 'height', 'minHeight'. (You can also mixed with 'height minWidth') | -
\ No newline at end of file
diff --git a/docs/demos/case.md b/docs/demos/case.md
deleted file mode 100644
index 053a1bc..0000000
--- a/docs/demos/case.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Case
-nav:
- title: Demo
- path: /demo
----
-
-
\ No newline at end of file
diff --git a/docs/demos/click-nested.md b/docs/demos/click-nested.md
deleted file mode 100644
index c67236d..0000000
--- a/docs/demos/click-nested.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Click Nested
-nav:
- title: Demo
- path: /demo
----
-
-
\ No newline at end of file
diff --git a/docs/demos/clip.md b/docs/demos/clip.md
deleted file mode 100644
index e2798ee..0000000
--- a/docs/demos/clip.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Clip
-nav:
- title: Demo
- path: /demo
----
-
-
\ No newline at end of file
diff --git a/docs/demos/container.md b/docs/demos/container.md
deleted file mode 100644
index a4860cb..0000000
--- a/docs/demos/container.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Container
-nav:
- title: Demo
- path: /demo
----
-
-
\ No newline at end of file
diff --git a/docs/demos/inside.md b/docs/demos/inside.md
deleted file mode 100644
index a9853c3..0000000
--- a/docs/demos/inside.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Inside
-nav:
- title: Demo
- path: /demo
----
-
-
\ No newline at end of file
diff --git a/docs/demos/large-popup.md b/docs/demos/large-popup.md
deleted file mode 100644
index 048c77a..0000000
--- a/docs/demos/large-popup.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Large Popup
-nav:
- title: Demo
- path: /demo
----
-
-
\ No newline at end of file
diff --git a/docs/demos/nested.md b/docs/demos/nested.md
deleted file mode 100644
index 5daf43b..0000000
--- a/docs/demos/nested.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Nested
-nav:
- title: Demo
- path: /demo
----
-
-
\ No newline at end of file
diff --git a/docs/demos/point.md b/docs/demos/point.md
deleted file mode 100644
index 073a89b..0000000
--- a/docs/demos/point.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Point
-nav:
- title: Demo
- path: /demo
----
-
-
\ No newline at end of file
diff --git a/docs/demos/shadow.md b/docs/demos/shadow.md
deleted file mode 100644
index 379812b..0000000
--- a/docs/demos/shadow.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Shadow
-nav:
- title: Demo
- path: /demo
----
-
-
\ No newline at end of file
diff --git a/docs/demos/simple.md b/docs/demos/simple.md
deleted file mode 100644
index dbb7c35..0000000
--- a/docs/demos/simple.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Simple
-nav:
- title: Demo
- path: /demo
----
-
-
\ No newline at end of file
diff --git a/docs/demos/static-scroll.md b/docs/demos/static-scroll.md
deleted file mode 100644
index 14a1846..0000000
--- a/docs/demos/static-scroll.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Static Scroll
-nav:
- title: Demo
- path: /demo
----
-
-
diff --git a/docs/demos/visible-fallback.md b/docs/demos/visible-fallback.md
deleted file mode 100644
index cb5a8f2..0000000
--- a/docs/demos/visible-fallback.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Visible Fallback
-nav:
- title: Demo
- path: /demo
----
-
-
\ No newline at end of file
diff --git a/docs/examples/.gitkeep b/docs/examples/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/docs/examples/body-overflow.tsx b/docs/examples/body-overflow.tsx
deleted file mode 100644
index 744e86a..0000000
--- a/docs/examples/body-overflow.tsx
+++ /dev/null
@@ -1,248 +0,0 @@
-/* eslint no-console:0 */
-import Trigger from 'rc-trigger';
-import React from 'react';
-import { createPortal } from 'react-dom';
-import '../../assets/index.less';
-
-const PortalDemo = () => {
- return createPortal(
- This is a example of trigger usage.
-You can adjust the value above
-which will also change the behaviour of popup.
-This is a example of trigger usage.
-You can adjust the value above
-which will also change the behaviour of popup.
-`visibleFirst` should not show in hidden region if still scrollable
- - - -