Skip to content

Commit 0bd1ac6

Browse files
committed
update changelog and readme
1 parent b83e000 commit 0bd1ac6

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [1.5.2] - 2023-08-06
5+
### Added
6+
- Add config for disabled styles (#52)
7+
48
## [1.5.1] - 2023-04-28
59
### Change
610
- Add accessibility attributes to fix accessibility issue (#49)

README.md

+17-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33

44
[![npm version](https://img.shields.io/npm/v/ng-toggle-button.svg)][npm-url]
55
[![npm dlm](https://img.shields.io/npm/dm/ng-toggle-button)][npm-url]
6+
[![Netlify Status](https://api.netlify.com/api/v1/badges/a28b65dc-53df-41d9-a660-d2741f833233/deploy-status)][demo-url]
67

78
[npm-url]: https://www.npmjs.com/package/ng-toggle-button
9+
[demo-url]: https://ng-toggle-button.netlify.app
810

9-
This is a toggle switch button component, you can see the demo [here](https://ng-toggle-button.netlify.app) and test it in [StackBlitz](https://stackblitz.com/edit/ng-toggle-button).
11+
This is a toggle switch button component, you can see the demo [here][demo-url] and test it in [StackBlitz](https://stackblitz.com/edit/ng-toggle-button).
1012

1113
## Versions
1214

@@ -82,17 +84,27 @@ Use
8284
| value | `boolean` | `false` | Initial state of the toggle button |
8385
| speed | `number` | `300` | Transition time for the animation |
8486
| disabled | `boolean` | `false` | Button does not react on mouse events |
85-
| color | `string` | `#0099CC` | If `String` - color of the button when checked <br>If `Object` - colors for the button when checked/unchecked or disabled<br>Example: `{checked: '#00FF00', unchecked: '#FF0000', disabled: '#CCCCCC'}` |
86-
| labels | `boolean Object` | `false` | If `boolean` - shows/hides default labels <br>If `Object` - sets custom labels for both states. <br>Example: `{checked: 'Foo', unchecked: 'Bar'}` |
87-
| switchColor | `string Object` | `#fff` | If `string` - color or background property of the switch when checked <br>If `Object` - colors or background property for the switch when checked/uncheked <br>Example: `{checked: '#25EF02', unchecked: 'silver'}` |
87+
| color | `string` | `#0099CC` | If `String` - color of the button when checked <br>If `toggleConfig` - colors for the button when checked/unchecked or disabled<br>Example: `{checked: '#00FF00', unchecked: '#FF0000', disabled: '#CCCCCC'}` |
88+
| labels | `boolean | Object` | `false` | If `boolean` - shows/hides default labels <br>If `Object` - sets custom labels for both states. <br>Example: `{checked: 'Foo', unchecked: 'Bar'}` |
89+
| switchColor | `string | toggleConfig` | `#fff` | If `string` - color or background property of the switch when checked <br>If `toggleConfig` - colors or background property for the switch when checked/uncheked or disabled <br>Example: `{checked: '#25EF02', unchecked: 'silver', disabled: '#fff'}` |
8890
| width | `number` | `50` | Width of the button |
8991
| height | `number` | `22` | Height of the button |
9092
| margin | `number` | `3` | Space between the switch and background border |
9193
| name | `string` | `undefined` | Name to attach to the generated input field |
9294
| fontSize | `number` | `10` | Font size in pixels |
93-
| fontColor | `string Object` | `undefined` | If `string` - color when checked <br>If `Object` - colors for labels when checked/uncheked <br>Example: `{checked: '#25EF02', unchecked: '#35DB15'}` by default the text color is white.|
95+
| fontColor | `string | toggleConfig` | `undefined` | If `string` - color when checked <br>If `toggleConfig` - colors for labels when checked/uncheked <br>Example: `{checked: '#25EF02', unchecked: '#35DB15'}` by default the text color is white.|
9496
| values | `{checked: any, unchecked: any}` | `{checked: true, unchecked: false}` | Values for checked and unchecked states, by default checked value is `true` and unchecked value is `false` <br>Example: `{checked: 1, unchecked: 0}`.|
9597

98+
`toggleConfig` type is described below:
99+
100+
```ts
101+
toggleConfig = {
102+
checked: string;
103+
unchecked: string;
104+
disabled?: string;
105+
};
106+
```
107+
96108
### Outputs events
97109

98110
| Name | Payload | Description |

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "ng-toggle-button",
33
"description": "A toggle button component",
44
"author": "vicmans",
5-
"version": "1.5.1",
5+
"version": "1.5.2",
66
"homepage": "https://github.com/vicmans/ng-toggle-button#readme",
77
"repository": {
88
"type": "git",

projects/ng-toggle/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng-toggle-button",
3-
"version": "1.5.1",
3+
"version": "1.5.2",
44
"description": "Angular toggle button switch",
55
"author": "vicmans",
66
"license": "MIT",

0 commit comments

Comments
 (0)