flarej

0.6.0 • Public • Published

FlareJ

   ___      __
 /\  __\   /\_\
 \_\ \_/_  \/\ \
/\___  __\  \ \ \
\/__/\ \_/  _\ \ \
    \_\ \  /\ \_\ \ (Component, {
   /\___/  \ \____/   ...responsiveSettings
   \/__/    \/___/  });

FlareJ是一个基于ReactNornJ模板引擎的UI组件库。

FlareJ的前身是一个基于jQuery的UI组件库,在2011-2015年曾服务于jd.com内部多个PC及移动端系统中。

NPM Version Travis CI Status Codecov NPM Downloads

组件

目前已有的组件(点击查看示例或文档):

原创组件

可以使用babel-plugin-import按需引入以上组件,.babelrc配置:

{
  "plugins": [
    ["import", {
      "libraryName": "flarej",
      "libraryDirectory": "lib/components",
      "style": true
    }]
  ]
}

引入组件:

import { Row, Col, Pagination } from 'flarej';

高阶组件

使用Responsive高阶组件,可创建各属性值支持按响应式条件变化的组件。使用方法如下,可以用fj变量作为Responsive的别名:

import fj from 'flarej/lib/higherOrders/responsive';
//或 import fj from 'flarej';
import EChart from 'flarej/lib/components/ECharts';
 
//创建响应式组件
const FjEChart = fj(EChart, {
  responsive: false,          //是否开启响应式
  responsiveDelay: 70,        //响应式执行后修改组件属性值延迟时间
  responsiveOnlyWidth: true,  //只在页面宽度改变时执行响应式
  defaultResponsiveParam: {   //默认响应式参数
    '(max-width: 1350px)': {  //响应式条件,与css媒体查询语法一致
      state: {                //组件各属性值
        width: 200
      }
    },
    '(min-width: 1351px)': {
      state: {
        width: 'auto'
      }
    }
  }
});
 
ReactDOM.render(
  <FjEChart autoResize={false}
            responsive={true}
            responsiveParam={{  //可在使用组件时继续传入其他响应式参数,会在defaultResponsiveParam后面执行
              '(max-width: 1350px)': {
                state: {
                  width: 200
                }
              }
            }}
  />,
document.body);

使用Responsive高阶组件创建的组件

第三方组件

依赖的项目

安装

使用npm安装:

npm install flarej

浏览器支持

所有现代浏览器以及Internet Explorer 9+。

License

MIT

Package Sidebar

Install

npm i flarej

Weekly Downloads

5

Version

0.6.0

License

MIT

Unpacked Size

12.4 MB

Total Files

997

Last publish

Collaborators

  • joe_sky