Skip to content

Commit 21e36ee

Browse files
committed
Add support for node.label and deprecate node.title
Resolves #20
1 parent f54fe2c commit 21e36ee

File tree

10 files changed

+90
-84
lines changed

10 files changed

+90
-84
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELOG
22

3+
## [v0.4.1](https://github.com/jakezatecky/react-dual-listbox/compare/v0.4.0...v0.4.1) (2017-02-15)
4+
5+
### Deprecations
6+
7+
* [#20]: Add support for `label` in `nodes` property and deprecate `title`
8+
39
## [v0.4.0](https://github.com/jakezatecky/react-dual-listbox/compare/v0.3.0...v0.4.0) (2016-01-27)
410

511
### Bug Fixes

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ import CheckboxTree from 'react-checkbox-tree';
3030

3131
const nodes = [{
3232
value: 'mars',
33-
title: 'Mars',
33+
label: 'Mars',
3434
children: [
35-
{ value: 'phobos', title: 'Phobos' },
36-
{ value: 'deimos', title: 'Deimos' },
35+
{ value: 'phobos', label: 'Phobos' },
36+
{ value: 'deimos', label: 'Deimos' },
3737
],
3838
}];
3939

examples/dist/index.js

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6913,9 +6913,9 @@ var Tree = function (_React$Component) {
69136913
key: key,
69146914
checked: checked,
69156915
expanded: node.expanded,
6916+
label: node.label || node.title,
69166917
optimisticToggle: _this6.props.optimisticToggle,
69176918
rawChildren: node.children,
6918-
title: node.title,
69196919
treeId: _this6.id,
69206920
value: node.value,
69216921
onCheck: _this6.onCheck,
@@ -9777,62 +9777,62 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
97779777

97789778
var nodes = [{
97799779
value: '/app',
9780-
title: 'app',
9780+
label: 'app',
97819781
children: [{
97829782
value: '/app/Http',
9783-
title: 'Http',
9783+
label: 'Http',
97849784
children: [{
97859785
value: '/app/Http/Controllers',
9786-
title: 'Controllers',
9786+
label: 'Controllers',
97879787
children: [{
97889788
value: '/app/Http/Controllers/WelcomeController.js',
9789-
title: 'WelcomeController.js'
9789+
label: 'WelcomeController.js'
97909790
}]
97919791
}, {
97929792
value: '/app/Http/routes.js',
9793-
title: 'routes.js'
9793+
label: 'routes.js'
97949794
}]
97959795
}, {
97969796
value: '/app/Providers',
9797-
title: 'Providers',
9797+
label: 'Providers',
97989798
children: [{
97999799
value: '/app/Http/Providers/EventServiceProvider.js',
9800-
title: 'EventServiceProvider.js'
9800+
label: 'EventServiceProvider.js'
98019801
}]
98029802
}]
98039803
}, {
98049804
value: '/config',
9805-
title: 'config',
9805+
label: 'config',
98069806
children: [{
98079807
value: '/config/app.js',
9808-
title: 'app.js'
9808+
label: 'app.js'
98099809
}, {
98109810
value: '/config/database.js',
9811-
title: 'database.js'
9811+
label: 'database.js'
98129812
}]
98139813
}, {
98149814
value: '/public',
9815-
title: 'public',
9815+
label: 'public',
98169816
children: [{
98179817
value: '/public/assets/',
9818-
title: 'assets',
9818+
label: 'assets',
98199819
children: [{
98209820
value: '/public/assets/style.css',
9821-
title: 'style.css'
9821+
label: 'style.css'
98229822
}]
98239823
}, {
98249824
value: '/public/index.html',
9825-
title: 'index.html'
9825+
label: 'index.html'
98269826
}]
98279827
}, {
98289828
value: '/.env',
9829-
title: '.env'
9829+
label: '.env'
98309830
}, {
98319831
value: '/.gitignore',
9832-
title: '.gitignore'
9832+
label: '.gitignore'
98339833
}, {
98349834
value: '/README.md',
9835-
title: 'README.md'
9835+
label: 'README.md'
98369836
}];
98379837

98389838
var BasicExample = function (_React$Component) {
@@ -9918,62 +9918,62 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
99189918

99199919
var nodes = [{
99209920
value: '/app',
9921-
title: 'app',
9921+
label: 'app',
99229922
children: [{
99239923
value: '/app/Http',
9924-
title: 'Http',
9924+
label: 'Http',
99259925
children: [{
99269926
value: '/app/Http/Controllers',
9927-
title: 'Controllers',
9927+
label: 'Controllers',
99289928
children: [{
99299929
value: '/app/Http/Controllers/WelcomeController.js',
9930-
title: 'WelcomeController.js'
9930+
label: 'WelcomeController.js'
99319931
}]
99329932
}, {
99339933
value: '/app/Http/routes.js',
9934-
title: 'routes.js'
9934+
label: 'routes.js'
99359935
}]
99369936
}, {
99379937
value: '/app/Providers',
9938-
title: 'Providers',
9938+
label: 'Providers',
99399939
children: [{
99409940
value: '/app/Http/Providers/EventServiceProvider.js',
9941-
title: 'EventServiceProvider.js'
9941+
label: 'EventServiceProvider.js'
99429942
}]
99439943
}]
99449944
}, {
99459945
value: '/config',
9946-
title: 'config',
9946+
label: 'config',
99479947
children: [{
99489948
value: '/config/app.js',
9949-
title: 'app.js'
9949+
label: 'app.js'
99509950
}, {
99519951
value: '/config/database.js',
9952-
title: 'database.js'
9952+
label: 'database.js'
99539953
}]
99549954
}, {
99559955
value: '/public',
9956-
title: 'public',
9956+
label: 'public',
99579957
children: [{
99589958
value: '/public/assets/',
9959-
title: 'assets',
9959+
label: 'assets',
99609960
children: [{
99619961
value: '/public/assets/style.css',
9962-
title: 'style.css'
9962+
label: 'style.css'
99639963
}]
99649964
}, {
99659965
value: '/public/index.html',
9966-
title: 'index.html'
9966+
label: 'index.html'
99679967
}]
99689968
}, {
99699969
value: '/.env',
9970-
title: '.env'
9970+
label: '.env'
99719971
}, {
99729972
value: '/.gitignore',
9973-
title: '.gitignore'
9973+
label: '.gitignore'
99749974
}, {
99759975
value: '/README.md',
9976-
title: 'README.md'
9976+
label: 'README.md'
99779977
}];
99789978

99799979
var PessimisticToggleExample = function (_React$Component) {
@@ -10164,7 +10164,7 @@ var TreeNode = function (_React$Component) {
1016410164
var _props = this.props;
1016510165
var checked = _props.checked;
1016610166
var treeId = _props.treeId;
10167-
var title = _props.title;
10167+
var label = _props.label;
1016810168
var value = _props.value;
1016910169

1017010170
var inputId = treeId + '-' + value;
@@ -10196,8 +10196,8 @@ var TreeNode = function (_React$Component) {
1019610196
),
1019710197
_react2.default.createElement(
1019810198
'span',
10199-
{ className: 'rct-title' },
10200-
title
10199+
{ className: 'rct-label' },
10200+
label
1020110201
)
1020210202
)
1020310203
),
@@ -10212,8 +10212,8 @@ var TreeNode = function (_React$Component) {
1021210212
TreeNode.propTypes = {
1021310213
checked: _react2.default.PropTypes.number.isRequired,
1021410214
expanded: _react2.default.PropTypes.bool.isRequired,
10215+
label: _react2.default.PropTypes.string.isRequired,
1021510216
optimisticToggle: _react2.default.PropTypes.bool.isRequired,
10216-
title: _react2.default.PropTypes.string.isRequired,
1021710217
treeId: _react2.default.PropTypes.string.isRequired,
1021810218
value: _react2.default.PropTypes.string.isRequired,
1021910219
onCheck: _react2.default.PropTypes.func.isRequired,

examples/dist/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
opacity: .5;
8080
}
8181

82-
.rct-title {
82+
.rct-label {
8383
margin-right: 5px;
8484
}
8585

examples/src/js/BasicExample.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,79 +5,79 @@ import Tree from '../../../src/js/Tree';
55
const nodes = [
66
{
77
value: '/app',
8-
title: 'app',
8+
label: 'app',
99
children: [
1010
{
1111
value: '/app/Http',
12-
title: 'Http',
12+
label: 'Http',
1313
children: [
1414
{
1515
value: '/app/Http/Controllers',
16-
title: 'Controllers',
16+
label: 'Controllers',
1717
children: [{
1818
value: '/app/Http/Controllers/WelcomeController.js',
19-
title: 'WelcomeController.js',
19+
label: 'WelcomeController.js',
2020
}],
2121
},
2222
{
2323
value: '/app/Http/routes.js',
24-
title: 'routes.js',
24+
label: 'routes.js',
2525
},
2626
],
2727
},
2828
{
2929
value: '/app/Providers',
30-
title: 'Providers',
30+
label: 'Providers',
3131
children: [{
3232
value: '/app/Http/Providers/EventServiceProvider.js',
33-
title: 'EventServiceProvider.js',
33+
label: 'EventServiceProvider.js',
3434
}],
3535
},
3636
],
3737
},
3838
{
3939
value: '/config',
40-
title: 'config',
40+
label: 'config',
4141
children: [
4242
{
4343
value: '/config/app.js',
44-
title: 'app.js',
44+
label: 'app.js',
4545
},
4646
{
4747
value: '/config/database.js',
48-
title: 'database.js',
48+
label: 'database.js',
4949
},
5050
],
5151
},
5252
{
5353
value: '/public',
54-
title: 'public',
54+
label: 'public',
5555
children: [
5656
{
5757
value: '/public/assets/',
58-
title: 'assets',
58+
label: 'assets',
5959
children: [{
6060
value: '/public/assets/style.css',
61-
title: 'style.css',
61+
label: 'style.css',
6262
}],
6363
},
6464
{
6565
value: '/public/index.html',
66-
title: 'index.html',
66+
label: 'index.html',
6767
},
6868
],
6969
},
7070
{
7171
value: '/.env',
72-
title: '.env',
72+
label: '.env',
7373
},
7474
{
7575
value: '/.gitignore',
76-
title: '.gitignore',
76+
label: '.gitignore',
7777
},
7878
{
7979
value: '/README.md',
80-
title: 'README.md',
80+
label: 'README.md',
8181
},
8282
];
8383

0 commit comments

Comments
 (0)