Skip to content

Commit 1d3d6f4

Browse files
iveysaurjelbourn
authored andcommitted
chore(slider): add readme and package.json (#960)
* Add package.json to slider * Add readme to slider * Clean up readme * Update to 6.3 and fix heading * Add not yet implemented to readme * Remove the word defined
1 parent 23a61ab commit 1d3d6f4

File tree

4 files changed

+131
-14
lines changed

4 files changed

+131
-14
lines changed

src/components/button-toggle/README.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,13 @@ You can read more about button toggles in the
1111

1212
### Setup
1313

14-
Importing the symbols:
14+
Importing the module:
1515
```ts
16-
import { MdUniqueSelectionDispatcher } from '@angular2-material/core';
17-
import { MD_BUTTON_TOGGLE_DIRECTIVES } from '@angular2-material/button-toggle'
18-
```
19-
20-
Adding providers and directives:
21-
```ts
22-
@Component({
23-
...
24-
directives: [MD_BUTTON_TOGGLE_DIRECTIVES],
25-
providers: [MdUniqueSelectionDispatcher]
26-
})
16+
@NgModule({
17+
imports: [MdButtonToggleModule],
18+
...
19+
})
20+
export class MyAppModule { }
2721
```
2822

2923
### Basic Usage

src/components/button-toggle/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular2-material/button-toggle",
3-
"version": "2.0.0-alpha.6-2",
3+
"version": "2.0.0-alpha.6-3",
44
"description": "Angular 2 Material Button Toggle",
55
"main": "./button-toggle.js",
66
"typings": "./button-toggle.d.ts",
@@ -23,7 +23,7 @@
2323
},
2424
"homepage": "https://github.com/angular/material2#readme",
2525
"peerDependencies": {
26-
"@angular2-material/core": "2.0.0-alpha.6-2",
26+
"@angular2-material/core": "2.0.0-alpha.6-3",
2727
"@angular/forms": "^0.2.0"
2828
}
2929
}

src/components/slider/README.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# md-slider
2+
3+
`MdSlider` is a component that allows users to select from a range of values by moving the slider
4+
thumb.
5+
You can read more about the slider in the
6+
[Material Design spec](https://material.google.com/components/sliders.html).
7+
8+
## Not Yet Implemented
9+
10+
* Thumb Label
11+
* Color
12+
* Invert
13+
* NgModel
14+
* Keyboard Movement
15+
* Focus Ring
16+
* Smaller/grey thumb at minimum value
17+
18+
## Usage
19+
20+
### Setup
21+
22+
Importing the module:
23+
```ts
24+
@NgModule({
25+
imports: [MdSliderModule],
26+
...
27+
})
28+
export class MyAppModule { }
29+
```
30+
31+
### Basic Usage
32+
33+
`md-slider` can be used on its own as a slider with a min of `0`, a max of `100`, and a step of `1`.
34+
35+
```html
36+
<md-slider></md-slider>
37+
```
38+
39+
### Slider with Minimum and Maximum Values
40+
41+
The min and max on a `md-slider` can be set to give a different range of values.
42+
These can be set individually and do not need to both be set.
43+
44+
```html
45+
<md-slider min="1" max="5"></md-slider>
46+
```
47+
48+
### Disabled Slider
49+
50+
`md-slider` can be disabled so that the value cannot be changed and the thumb cannot be moved.
51+
52+
```html
53+
<md-slider disabled></md-slider>
54+
```
55+
56+
### Slider with Value
57+
58+
`md-slider` can have a value defined so that it starts at a specific value on the slider.
59+
60+
```html
61+
<md-slider value="24"></md-slider>
62+
```
63+
64+
### Slider with Step
65+
66+
`md-slider` can have the step defined which declares where the thumb can snap to.
67+
68+
```html
69+
<md-slider step="5"></md-slider>
70+
```
71+
72+
### Slider with Tick Interval
73+
74+
`md-slider` can have a tick interval set to a number or to `auto`.
75+
`auto` will automatically draw tick marks on steps that are at least 30px apart and will always draw
76+
tick marks at the beginning and end of the slider.
77+
Setting `tick-interval` to a number will draw a tick mark at every `tick-interval` steps. An example
78+
of this is a `tick-interval` of `3` with a `step` of `4` will draw tick marks at every `3` steps,
79+
which is the same as every `12` values.
80+
81+
```html
82+
<md-slider tick-interval="auto"></md-slider>
83+
<md-slider tick-interval="3" step="4"></md-slider>
84+
```
85+
86+
## `<md-slider>`
87+
88+
### Bound Properties
89+
90+
| Name | Type | Description |
91+
| --- | --- | --- |
92+
| `min` | number | Optional, the minimum number for the slider. Default = `0`. |
93+
| `max` | number | Optional, the maximum number for the slider. Default = `100`. |
94+
| `value` | number | Optional, the value to start the slider at. |
95+
| `tick-interval` | `"auto" | number` | Optional, how many steps between tick marks. |
96+
| `step` | number | Optional, declares where the thumb will snap to. Default = `1`. |
97+
| `disabled` | boolean | Optional, whether or not the slider is disabled. Default = `false`. |

src/components/slider/package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "@angular2-material/slider",
3+
"version": "2.0.0-alpha.6-3",
4+
"description": "Angular 2 Material Slider",
5+
"main": "./slider.js",
6+
"typings": "./slider.d.ts",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/angular/material2.git"
10+
},
11+
"keywords": [
12+
"angular",
13+
"material",
14+
"material design",
15+
"components",
16+
"slider"
17+
],
18+
"license": "MIT",
19+
"bugs": {
20+
"url": "https://github.com/angular/material2/issues"
21+
},
22+
"homepage": "https://github.com/angular/material2#readme",
23+
"peerDependencies": {
24+
"@angular2-material/core": "2.0.0-alpha.6-3"
25+
}
26+
}

0 commit comments

Comments
 (0)