Skip to content

Commit a8573c5

Browse files
Merge pull request #783 from interactivellama/private-components
Move internal sub-render components to private
2 parents 83af3e2 + a29c1a2 commit a8573c5

File tree

66 files changed

+978
-1102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+978
-1102
lines changed

RELEASENOTES.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,27 @@ These are changes that have backwards-compatible solutions present and that comp
1111
- `DataTable`'s' `collection`, `onSelect`, `onDeselect` are deprecated.
1212
- The prop `modal` in `DatePicker`, `Lookup`, `MenuDropdown`, `MenuPicklist`, `TimePicker` is deprecated
1313
- Remove `openByDefault` from `PopoverTooltip`.
14+
- Remove alias component files. Please update the following removed files to their new file name.
15+
- tabs/pane
16+
- SLDSSettings
17+
- lookup/menu/
18+
- lookup/menu/default-footer
19+
- lookup/menu/default-header
20+
- lookup/menu/default-section-divider
21+
- lookup/menu/item/
22+
- menu-list/list-item-label
23+
- menu-list/list-item
24+
- menu-list/list
1425

1526
---
1627

28+
## Release 0.5.2
29+
30+
**MINOR CHANGES**
31+
32+
- React components that are really just sub-renders and are not meant to be consumed by end-users of this project have been moved to `components/[COMPONENT_NAME]/private`. Feel free to continue using components that are still in `components/[COMPONENT_NAME]` folder and consider them part of the public API. Hopefully, this adds clarity to what components can and should be used.
33+
34+
1735
## Release 0.5.1
1836

1937
**DOCUMENTATION**

components/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Components
2+
3+
- This folder contains approved SLDS components and "lower order" components that get passed in (typically as children) to the approved SLDS components.
4+
- Components within folders labelled `private` are for internal usage only and are not intended to be a part of the public API of this project.
5+
- Components in `utilities` are shared components that are not part of the public API of this project.

components/card/empty/index.jsx renamed to components/card/empty.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import React from 'react';
1616
// Removes the need for `PropTypes`.
1717
const { PropTypes } = React;
1818

19-
import { CARD_EMPTY } from '../../../utilities/constants';
19+
import { CARD_EMPTY } from '../../utilities/constants';
2020

2121
/**
2222
* A default empty state for Cards.

components/card/filter/index.jsx renamed to components/card/filter.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1313
// React is an external dependency of the project.
1414
import React from 'react';
1515

16-
import Input from '../../forms/input';
17-
import InputIcon from '../../icon/input-icon';
16+
import Input from '../forms/input';
17+
import InputIcon from '../icon/input-icon';
1818

1919
// Removes the need for `PropTypes`.
2020
const { PropTypes } = React;
2121

22-
import { CARD_FILTER } from '../../../utilities/constants';
22+
import { CARD_FILTER } from '../../utilities/constants';
2323

2424
/**
2525
* A default filter or search input for Cards that contain items.

components/card/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import React from 'react';
2424
import classnames from 'classnames';
2525

2626
// ## Children
27-
import Header from './header';
28-
import Body from './body';
29-
import Footer from './footer';
27+
import Header from './private/header';
28+
import Body from './private/body';
29+
import Footer from './private/footer';
3030
import Empty from './empty';
3131

3232
// Removes the need for `PropTypes`.

components/card/body.jsx renamed to components/card/private/body.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1313
// React is an external dependency of the project.
1414
import React from 'react';
1515

16-
import { CARD_BODY } from '../../utilities/constants';
16+
import { CARD_BODY } from '../../../utilities/constants';
1717

1818
// ### classNames
1919
// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)

components/card/footer.jsx renamed to components/card/private/footer.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1313
// React is an external dependency of the project.
1414
import React from 'react';
1515

16-
import { CARD_FOOTER } from '../../utilities/constants';
16+
import { CARD_FOOTER } from '../../../utilities/constants';
1717

1818
const CardFooter = (props) => (
1919
<div className="slds-card__footer">

components/card/header.jsx renamed to components/card/private/header.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ import React from 'react';
2020
import classnames from 'classnames';
2121

2222
// ## Children
23-
import MediaObject from '../media-object';
23+
import MediaObject from '../../media-object';
2424

2525
// Removes the need for `PropTypes`.
2626
const { PropTypes } = React;
2727

28-
import { CARD_HEADER } from '../../utilities/constants';
28+
import { CARD_HEADER } from '../../../utilities/constants';
2929

3030
// Allow for predicatable DOM queries with `querySelectorAll(cssClasses.base)`
3131
const idSuffixes = {

components/data-table/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ import checkProps from './check-props';
4444
// ## Children
4545
import DataTableCell from './cell';
4646
import DataTableColumn from './column';
47-
import DataTableHead from './head';
48-
import DataTableRow from './row';
47+
import DataTableHead from './private/head';
48+
import DataTableRow from './private/row';
4949
import DataTableRowActions from './row-actions';
5050

5151
// ## Constants

components/data-table/head.jsx renamed to components/data-table/private/head.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1313
import React from 'react';
1414

1515
// ## Children
16-
import Checkbox from '../forms/checkbox';
16+
import Checkbox from '../../forms/checkbox';
1717
import HeaderCell from './header-cell';
1818

1919
// ## Constants
20-
import { DATA_TABLE_HEAD, DATA_TABLE_HEADER_CELL } from '../../utilities/constants';
20+
import { DATA_TABLE_HEAD, DATA_TABLE_HEADER_CELL } from '../../../utilities/constants';
2121

2222
// Removes the need for `PropTypes`.
2323
const { PropTypes } = React;

components/data-table/header-cell.jsx renamed to components/data-table/private/header-cell.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import classNames from 'classnames';
1919
import isFunction from 'lodash.isfunction';
2020

2121
// ## Children
22-
import Button from '../button';
22+
import Button from '../../button';
2323

2424
// ## Constants
25-
import { DATA_TABLE_HEADER_CELL } from '../../utilities/constants';
25+
import { DATA_TABLE_HEADER_CELL } from '../../../utilities/constants';
2626

2727
// Removes the need for `PropTypes`.
2828
const { PropTypes } = React;

components/data-table/row.jsx renamed to components/data-table/private/row.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import classNames from 'classnames';
1919
import find from 'lodash.find';
2020

2121
// ## Children
22-
import Checkbox from '../forms/checkbox';
22+
import Checkbox from '../../forms/checkbox';
2323

2424
// ## Constants
25-
import { DATA_TABLE_ROW, DATA_TABLE_ROW_ACTIONS, DATA_TABLE_CELL } from '../../utilities/constants';
25+
import { DATA_TABLE_ROW, DATA_TABLE_ROW_ACTIONS, DATA_TABLE_CELL } from '../../../utilities/constants';
2626

2727
// Removes the need for `PropTypes`.
2828
const { PropTypes } = React;

components/date-picker/index.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88
*/
99

10-
'use strict';
11-
1210
import React from 'react';
1311
import ReactDOM from 'react-dom';
1412
import Dialog from '../utilities/dialog';
15-
import DatePicker from './date-picker-base/index';
13+
import DatePicker from './private/date-picker-base/index';
1614
import InputIcon from '../icon/input-icon';
1715

1816
// This component's `checkProps` which issues warnings to developers about properties
@@ -48,8 +46,9 @@ const propTypes = {
4846
* Date
4947
*/
5048
value: React.PropTypes.instanceOf(Date),
51-
weekDayLabels: React.PropTypes.array,
49+
weekDayLabels: React.PropTypes.array
5250
};
51+
5352
const defaultProps = {
5453
abbrWeekDayLabels: ['S','M','T','W','T','F','S'],
5554
formatter (date) {

components/date-picker/calendar/calendar-day/index.jsx renamed to components/date-picker/private/calendar/calendar-day/index.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ Neither the name of salesforce.com, inc. nor the names of its contributors may b
77
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88
*/
99

10-
'use strict';
11-
1210
import React from 'react';
13-
import {KEYS,EventUtil,DateUtil} from '../../../../utilities';
11+
import { KEYS, EventUtil, DateUtil } from '../../../../../utilities';
1412

1513
module.exports = React.createClass({
1614

components/date-picker/calendar/calendar-week/index.jsx renamed to components/date-picker/private/calendar/calendar-week/index.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ Neither the name of salesforce.com, inc. nor the names of its contributors may b
77
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88
*/
99

10-
'use strict';
11-
1210
import React from 'react';
1311

1412
import Day from '../calendar-day/index';
15-
import {DateUtil} from '../../../../utilities';
13+
import { DateUtil } from '../../../../../utilities';
1614

1715

1816
module.exports = React.createClass({

components/date-picker/calendar/index.jsx renamed to components/date-picker/private/calendar/index.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ Redistributions in binary form must reproduce the above copyright notice, this l
66
Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
77
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88
*/
9-
'use strict';
109

1110
import React from 'react';
1211
import Week from './calendar-week/index';
13-
import {EventUtil, DateUtil, KEYS} from '../../../utilities';
12+
import { EventUtil, DateUtil, KEYS } from '../../../../utilities';
1413

1514
module.exports = React.createClass({
1615

components/date-picker/date-picker-base/date-picker-nav/index.jsx renamed to components/date-picker/private/date-picker-base/date-picker-nav/index.jsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ Neither the name of salesforce.com, inc. nor the names of its contributors may b
77
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88
*/
99

10-
'use strict';
11-
1210
import React from 'react';
1311
import SelectYear from '../../year-selector/index';
14-
import ButtonIcon from './../../../icon/button-icon';
15-
import {DateUtil, EventUtil, KEYS} from './../../../../utilities';
12+
import ButtonIcon from '.././../../../icon/button-icon';
13+
import { DateUtil, EventUtil, KEYS } from '.././../../../../utilities';
1614

17-
module.exports = React.createClass( {
15+
module.exports = React.createClass({
1816

1917
getDefaultProps (){
2018
return {

components/date-picker/date-picker-base/index.jsx renamed to components/date-picker/private/date-picker-base/index.jsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,12 @@ Neither the name of salesforce.com, inc. nor the names of its contributors may b
77
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88
*/
99

10-
'use strict';
11-
1210
import React from 'react';
1311
import Calendar from '../calendar/index';
1412
import DatePickerNav from './date-picker-nav/index';
15-
import {EventUtil} from './../../../utilities';
16-
17-
import {KEYS} from '../../../utilities';
18-
13+
import { EventUtil, KEYS } from '../../../../utilities';
1914

20-
module.exports = React.createClass( {
15+
module.exports = React.createClass({
2116

2217
getDefaultProps () {
2318
return {

components/date-picker/year-selector/index.jsx renamed to components/date-picker/private/year-selector/index.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ Neither the name of salesforce.com, inc. nor the names of its contributors may b
77
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88
*/
99

10-
'use strict';
11-
1210
import React from 'react';
13-
import MenuPicklist from '../../menu-picklist';
11+
import MenuPicklist from '../../../menu-picklist';
1412

15-
module.exports = React.createClass( {
13+
module.exports = React.createClass({
1614

1715
displayName: 'YearSelector',
1816

components/global-header/dropdown.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import React, { PropTypes } from 'react';
1818

1919
// ### Dropdown
2020
import MenuDropdown from '../menu-dropdown';
21-
import GlobalHeaderTrigger from './dropdown-trigger';
21+
import GlobalHeaderTrigger from './private/dropdown-trigger';
2222

2323
// ## Constants
2424
import { GLOBAL_HEADER_TOOL } from '../../utilities/constants';

components/global-header/index.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,14 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1717
// ## Dependencies
1818

1919
// ### React
20-
import React from 'react';
20+
import React, { PropTypes } from 'react';
2121

2222
// ### Event Helpers
2323
import { EventUtil } from '../../utilities';
2424

2525
// ## Constants
2626
import { GLOBAL_HEADER, GLOBAL_HEADER_PROFILE, GLOBAL_HEADER_SEARCH, GLOBAL_HEADER_TOOL } from '../../utilities/constants';
2727

28-
// Removes the need for `PropTypes`.
29-
const { PropTypes } = React;
30-
3128
/**
3229
* The global header is the anchor for the Salesforce platform and spans all other parts of the UI. It accepts children to define the items displayed within.
3330
*

components/global-header/dropdown-trigger.jsx renamed to components/global-header/private/dropdown-trigger.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import classnames from 'classnames';
2626
import Button from '../button';
2727

2828
// ### Children
29-
import { MENU_DROPDOWN_TRIGGER } from '../../utilities/constants';
29+
import { MENU_DROPDOWN_TRIGGER } from '../../../utilities/constants';
3030

3131
/**
3232
* The Dropdown Button Trigger renders the default trigger button for the dropdown menu. If this component has children, it does not render itself to the DOM. Instead, it renders its child element, `Button`, and all that child's properties. This component may be used as a template to create custom triggers that do not use `Button`.

components/global-header/profile.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import classnames from 'classnames';
2121

2222
// ### Dropdown
2323
import MenuDropdown from '../menu-dropdown';
24-
import GlobalHeaderTrigger from './dropdown-trigger';
24+
import GlobalHeaderTrigger from './private/dropdown-trigger';
2525

2626
// ## Constants
2727
import { GLOBAL_HEADER_PROFILE } from '../../utilities/constants';
@@ -70,7 +70,7 @@ GlobalHeaderProfile.propTypes = {
7070
*/
7171
align: PropTypes.oneOf(['left', 'right']),
7272
/**
73-
* By default, any children passed into this component will be rendered inside the dropdown menu. If you need custom content and a list, import 'design-system-react/components/menu-list/list' and pass in `<List>`.
73+
* By default, any children passed into this component will be rendered inside the dropdown menu. If you need custom content and a list, import 'design-system-react/components/utilities/menu-list/list' and pass in `<List>`.
7474
*
7575
* ```
7676
* <Dropdown>

components/lookup/footer.jsx

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
Copyright (c) 2015, salesforce.com, inc. All rights reserved.
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
5+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
6+
Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
7+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8+
*/
9+
10+
// Implements the [Lookup design pattern](https://latest-204.lightningdesignsystem.com/components/lookups) in React.
11+
// Based on SLDS v2.1.0-dev
12+
13+
import React from 'react';
14+
import Icon from '../icon';
15+
import { EventUtil } from '../../utilities';
16+
17+
const displayName = "LookupDefaultFooter";
18+
const propTypes = {};
19+
const defaultProps = {};
20+
21+
class DefaultFooter extends React.Component {
22+
constructor(props) {
23+
super(props);
24+
}
25+
26+
componentWillReceiveProps(nextProps){
27+
if(nextProps.isActive !== this.props.isActive && nextProps.isActive === true) {
28+
this.props.setFocus('newItem');
29+
}
30+
}
31+
32+
handleClick(){
33+
if(this.props.onClose){
34+
this.props.onClose();
35+
}
36+
}
37+
38+
handleMouseDown(event) {
39+
EventUtil.trapImmediate(event);
40+
}
41+
42+
render(){
43+
let className = 'slds-lookup__item-action slds-lookup__item-action--label';
44+
if(this.props.isActive) className += ' slds-theme--shade'
45+
46+
return (
47+
<div className="js-slds-lookup__item" onClick={this.handleClick.bind(this)} onMouseDown={this.handleMouseDown.bind(this)}>
48+
<a id="newItem" href="javascript:void(0);" className={className}>
49+
<span className="lookup__item-action-label">
50+
<Icon name='add' category="utility" size="x-small" className="slds-icon-text-default" />
51+
<span className="slds-truncate">
52+
{this.props.newItemLabel ? this.props.newItemLabel : "Add New Item" }
53+
</span>
54+
</span>
55+
</a>
56+
</div>
57+
)
58+
}
59+
}
60+
61+
DefaultFooter.displayName = displayName;
62+
DefaultFooter.propTypes = propTypes;
63+
DefaultFooter.defaultProps = defaultProps;
64+
65+
module.exports = DefaultFooter;

0 commit comments

Comments
 (0)