From a83d0fefffbdd05ce9f89a78508a544cd95e4fb5 Mon Sep 17 00:00:00 2001 From: paranoidjk Date: Fri, 9 Jun 2017 16:05:43 +0800 Subject: [PATCH] feat(Slider&Range): support custom style & aria --- .../__snapshots__/demo.test.web.js.snap | 10 +++ .../__snapshots__/demo.test.web.js.snap | 81 ++++++++++++++++++- components/range/demo/basic.md | 38 ++++++++- components/range/index.en-US.md | 3 + components/range/index.zh-CN.md | 3 + .../__snapshots__/demo.test.web.js.snap | 34 +++++++- components/slider/demo/basic.md | 4 +- components/slider/index.en-US.md | 7 +- components/slider/index.zh-CN.md | 8 +- package.json | 2 +- 10 files changed, 173 insertions(+), 17 deletions(-) diff --git a/components/list/__tests__/__snapshots__/demo.test.web.js.snap b/components/list/__tests__/__snapshots__/demo.test.web.js.snap index bc3331a0b8..afe417acb3 100644 --- a/components/list/__tests__/__snapshots__/demo.test.web.js.snap +++ b/components/list/__tests__/__snapshots__/demo.test.web.js.snap @@ -635,11 +635,21 @@ exports[`renders ./components/list/demo/form.md correctly 1`] = ` class="am-slider-step" />
+
+

+ Range, 自定义样式 +

+
+
+
+
+
+
+
+
+
+
+
`; diff --git a/components/range/demo/basic.md b/components/range/demo/basic.md index b77fbc5f2f..e78aa87b3b 100644 --- a/components/range/demo/basic.md +++ b/components/range/demo/basic.md @@ -26,17 +26,49 @@ const App = () => {

Range, 基础使用

- +

Range, 带 Tooltip

- +

Range, 禁用

- + +
+ +

Range, 自定义样式

+
); diff --git a/components/range/index.en-US.md b/components/range/index.en-US.md index f2cbe7e852..d6fa78f8b4 100644 --- a/components/range/index.en-US.md +++ b/components/range/index.en-US.md @@ -33,6 +33,9 @@ Properties | Descrition | Type | Default | count | number | `1` | Determine how many ranges to render, and multiple handles will be rendered (number + 1). | | allowCross | boolean | `true` | `allowCross` could be set as `true` to allow those handles to cross. | | pushable | boolean or number | `true` | `pushable` could be set as `true` to allow pushing of surrounding handles when moving an handle. When set to a number, the number will be the minimum ensured distance between handles. Example: ![](http://i.giphy.com/l46Cs36c9HrHMExoc.gif) | +| handleStyle(`web`) | Array[Object] | | style of handle,will be applied to mutli handle follow the array elemetns order | +| trackStyle(`web`) | Array[Object] | | style of track,will be applied to mutli track follow the array elemetns order | +| railStyle(`web`) | Object | | style of slider base style, which means the area that not been selected | ## ToolTip(Web Only) diff --git a/components/range/index.zh-CN.md b/components/range/index.zh-CN.md index fff02afb52..ea58ebd202 100644 --- a/components/range/index.zh-CN.md +++ b/components/range/index.zh-CN.md @@ -34,6 +34,9 @@ subtitle: 区域选择 | count | number | `1` | Determine how many ranges to render, and multiple handles will be rendered (number + 1). | | allowCross | boolean | `true` | `allowCross` could be set as `true` to allow those handles to cross. | | pushable | boolean or number | `true` | `pushable` could be set as `true` to allow pushing of surrounding handles when moving an handle. When set to a number, the number will be the minimum ensured distance between handles. Example: ![](http://i.giphy.com/l46Cs36c9HrHMExoc.gif) | +| handleStyle(`web`) | Array[Object] | | 滑块的样式,按数组顺序应用到多滑块 | +| trackStyle(`web`) | Array[Object] | | 选中部分滑动条的样式,按数组顺序应用到滑动条的多区间 | +| railStyle(`web`) | Object | | 未选中部分 | ## ToolTip(Web Only) diff --git a/components/slider/__tests__/__snapshots__/demo.test.web.js.snap b/components/slider/__tests__/__snapshots__/demo.test.web.js.snap index 860c43a23d..fb62192bcd 100644 --- a/components/slider/__tests__/__snapshots__/demo.test.web.js.snap +++ b/components/slider/__tests__/__snapshots__/demo.test.web.js.snap @@ -32,7 +32,12 @@ exports[`renders ./components/slider/demo/basic.md correctly 1`] = ` class="am-slider-step" />