Skip to content

Commit 0c4c929

Browse files
committed
2 parents 4b43f5e + 6f7624c commit 0c4c929

File tree

9 files changed

+132
-38
lines changed

9 files changed

+132
-38
lines changed

CHANGELOG.md

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

3+
## [5.0.0-rc.1](https://github.com/primefaces/primereact/tree/5.0.0-rc.1) (2020-08-20)
4+
5+
[Full Changelog](https://github.com/primefaces/primereact/compare/4.2.2...5.0.0-rc.1)
6+
7+
**Breaking changes:**
8+
9+
- Change the values of position property on Dialog [\#1516](https://github.com/primefaces/primereact/issues/1516)
10+
- Rename iconsTemplate property to icons property on Dialog [\#1514](https://github.com/primefaces/primereact/issues/1514)
11+
- Rename iconsTemplate property to icons property on Sidebar [\#1513](https://github.com/primefaces/primereact/issues/1513)
12+
- Rename Growl component to Toast component [\#1512](https://github.com/primefaces/primereact/issues/1512)
13+
- Change some property names on Galleria [\#1503](https://github.com/primefaces/primereact/issues/1503)
14+
- Label Nova, Luna and Rhea as Legacy Themes [\#1501](https://github.com/primefaces/primereact/issues/1501)
15+
- Change the values of position property on Growl [\#1497](https://github.com/primefaces/primereact/issues/1497)
16+
- Remove responsive property from OrderList [\#1494](https://github.com/primefaces/primereact/issues/1494)
17+
- Remove responsive property from PickList [\#1493](https://github.com/primefaces/primereact/issues/1493)
18+
- Replace dotsContainerClassName with indicatorsContentClassName property on Carousel [\#1491](https://github.com/primefaces/primereact/issues/1491)
19+
- Remove Spinner Component [\#1488](https://github.com/primefaces/primereact/issues/1488)
20+
- Remove Lightbox component [\#1487](https://github.com/primefaces/primereact/issues/1487)
21+
- Migrate to PrimeOne Design Architecture [\#1484](https://github.com/primefaces/primereact/issues/1484)
22+
- Remove responsive attribute from DataTable [\#1250](https://github.com/primefaces/primereact/issues/1250)
23+
24+
**Implemented New Features and Enhancements:**
25+
26+
- Add emptyTemplate property to FileUpload [\#1508](https://github.com/primefaces/primereact/issues/1508)
27+
- New Component: Ripple [\#1507](https://github.com/primefaces/primereact/issues/1507)
28+
- Add index parameter to onRowEditInit and onRowSave callbacks on DataTable [\#1505](https://github.com/primefaces/primereact/issues/1505)
29+
- Add onEditorInit callback for cell editing mode to Column [\#1504](https://github.com/primefaces/primereact/issues/1504)
30+
- Add left and right properties to Toolbar [\#1502](https://github.com/primefaces/primereact/issues/1502)
31+
- Material Theme [\#1500](https://github.com/primefaces/primereact/issues/1500)
32+
- Bootstrap Theme [\#1499](https://github.com/primefaces/primereact/issues/1499)
33+
- Add start and end properties to Menubar [\#1498](https://github.com/primefaces/primereact/issues/1498)
34+
- Add valueTemplate property to Dropdown [\#1496](https://github.com/primefaces/primereact/issues/1496)
35+
- Add iconPos property to ToggleButton [\#1495](https://github.com/primefaces/primereact/issues/1495)
36+
- Add badge and badgeClassName properties to Button [\#1490](https://github.com/primefaces/primereact/issues/1490)
37+
- Add Badge styles to core css [\#1489](https://github.com/primefaces/primereact/issues/1489)
38+
- Improved Overlay Animations [\#1486](https://github.com/primefaces/primereact/issues/1486)
39+
- PrimeOne Themes [\#1485](https://github.com/primefaces/primereact/issues/1485)
40+
- Label Nova, Luna and Rhea as Legacy Themes [\#1483](https://github.com/primefaces/primereact/issues/1483)
41+
- Add contentClassName property to Dialog [\#1455](https://github.com/primefaces/primereact/issues/1455)
42+
- Add listClassName property to Listbox [\#1454](https://github.com/primefaces/primereact/issues/1454)
43+
- Change onSlideEnd callback param on Slider [\#1437](https://github.com/primefaces/primereact/issues/1437)
44+
- Improve Tooltip implementation [\#1436](https://github.com/primefaces/primereact/issues/1436)
45+
- Add onValueChange property to InputNumber [\#1418](https://github.com/primefaces/primereact/issues/1418)
46+
- It is impossible to type fractional digits on InputNumber [\#1380](https://github.com/primefaces/primereact/issues/1380)
47+
- Remove browserslist, leave processing and transpilation to applications [\#1312](https://github.com/primefaces/primereact/issues/1312)
48+
- Custom content support for Button [\#1258](https://github.com/primefaces/primereact/issues/1258)
49+
50+
**Fixed bugs:**
51+
52+
- Global filter is not working with invalid values on TreeTable [\#1517](https://github.com/primefaces/primereact/issues/1517)
53+
- Captcha throws a JS exception [\#1509](https://github.com/primefaces/primereact/issues/1509)
54+
- Calendar with appendTo property isn't working as expected [\#1506](https://github.com/primefaces/primereact/issues/1506)
55+
- Chart does not update when its options and type properties change [\#1492](https://github.com/primefaces/primereact/issues/1492)
56+
- Dynamic options breaks InputNumber [\#1470](https://github.com/primefaces/primereact/issues/1470)
57+
- DatePicker Milliseconds jumps from 000 to 199 [\#1456](https://github.com/primefaces/primereact/issues/1456)
58+
- Typing for selectedItemTemplate in AutoComplete is wrong [\#1428](https://github.com/primefaces/primereact/issues/1428)
59+
- Can't type - as first symbol into an Inputnumber [\#1427](https://github.com/primefaces/primereact/issues/1427)
60+
- If the invalid value is entered to Calendar with keepInvalid property, the onChange event returns null [\#1422](https://github.com/primefaces/primereact/issues/1422)
61+
- Calling clearTimeout is required before unmounting AutoComplete [\#1421](https://github.com/primefaces/primereact/issues/1421)
62+
- Clear button is not closing Calendar [\#1416](https://github.com/primefaces/primereact/issues/1416)
63+
- File selection does not work after validation fails [\#1415](https://github.com/primefaces/primereact/issues/1415)
64+
- InputNumber prevents min key number [\#1412](https://github.com/primefaces/primereact/issues/1412)
65+
- ListBox, Dropdown: Using non-unique key [\#1397](https://github.com/primefaces/primereact/issues/1397)
66+
367
## [4.2.2](https://github.com/primefaces/primereact/tree/4.2.2) (2020-06-09)
468

569
[Full Changelog](https://github.com/primefaces/primereact/compare/4.2.1...4.2.2)

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
22
[![npm version](https://badge.fury.io/js/primereact.svg)](https://badge.fury.io/js/primereact)
33

4-
[![PrimeReact Hero](https://www.primefaces.org/wp-content/uploads/2020/03/primereact-github-02032020-2.jpg "PrimeReact Hero")](https://www.primefaces.org/primereact)
4+
[![PrimeReact Hero](https://www.primefaces.org/wp-content/uploads/2020/08/primereact-promotion-21aug2020@2x.jpg)](https://www.primefaces.org/primereact)
55

66
# PrimeReact
77

8-
PrimeReact is a rich set of open source UI Components for React.
9-
10-
[![PrimeReact Logo](https://www.primefaces.org/wp-content/uploads/2017/09/primereact-transparent-250.png "PrimeReact")](https://www.primefaces.org/primereact)
11-
12-
See [PrimeReact homepage](https://www.primefaces.org/react) for live showcase and documentation.
8+
PrimeReact is a rich set of open source UI Components for React. See [PrimeReact homepage](https://www.primefaces.org/primereact) for live showcase and documentation.
139

1410
## Download
1511

@@ -48,15 +44,15 @@ dependencies: {
4844
The css dependencies are as follows, note that you may change the theme with another one of your choice.
4945

5046
```
51-
primereact/resources/themes/nova-light/theme.css
47+
primereact/resources/themes/saga-blue/theme.css
5248
primereact/resources/primereact.min.css
5349
primeicons/primeicons.css
5450
```
5551

5652
If you are using a bundler such as webpack with a css loader you may also import them to your main application component, an example from create-react-app would be.
5753

5854
```javascript
59-
import 'primereact/resources/themes/nova-light/theme.css';
55+
import 'primereact/resources/themes/saga-blue/theme.css';
6056
import 'primereact/resources/primereact.min.css';
6157
import 'primeicons/primeicons.css';
6258
```

src/components/message/Message.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ interface MessageProps {
55
className?: string;
66
style?: object;
77
text?: string;
8-
severity?: string
8+
severity?: string,
9+
content?: ((props: object) => any | any);
910
}
1011

11-
export class Message extends React.Component<MessageProps,any> {}
12+
export class Message extends React.Component<MessageProps,any> {}

src/components/message/Message.js

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, {Component} from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
4+
import ObjectUtils from '../utils/ObjectUtils';
45

56
export class Message extends Component {
67

@@ -9,37 +10,53 @@ export class Message extends Component {
910
className: null,
1011
style: null,
1112
text: null,
12-
severity: 'info'
13+
severity: 'info',
14+
content: null
1315
}
1416

1517
static propTypes = {
1618
id: PropTypes.string,
1719
className: PropTypes.string,
1820
style: PropTypes.object,
1921
text: PropTypes.string,
20-
severity: PropTypes.string
22+
severity: PropTypes.string,
23+
content: PropTypes.any
2124
};
2225

26+
getContent() {
27+
if (this.props.content) {
28+
return ObjectUtils.getJSXElement(this.props.content, this.props);
29+
}
30+
31+
const icon = classNames('p-inline-message-icon pi', {
32+
'pi-info-circle': this.props.severity === 'info',
33+
'pi-exclamation-triangle': this.props.severity === 'warn',
34+
'pi-times-circle': this.props.severity === 'error',
35+
'pi-check': this.props.severity === 'success',
36+
});
37+
38+
return (
39+
<>
40+
<span className={icon}></span>
41+
<span className="p-inline-message-text">{this.props.text}</span>
42+
</>
43+
);
44+
}
45+
2346
render() {
24-
let className = classNames('p-inline-message p-component', {
47+
const className = classNames('p-inline-message p-component', {
2548
'p-inline-message-info': this.props.severity === 'info',
2649
'p-inline-message-warn': this.props.severity === 'warn',
2750
'p-inline-message-error': this.props.severity === 'error',
2851
'p-inline-message-success': this.props.severity === 'success',
2952
'p-inline-message-icon-only': !this.props.text
3053
}, this.props.className);
3154

32-
let icon = classNames('p-inline-message-icon pi', {
33-
'pi-info-circle': this.props.severity === 'info',
34-
'pi-exclamation-triangle': this.props.severity === 'warn',
35-
'pi-times-circle': this.props.severity === 'error',
36-
'pi-check': this.props.severity === 'success',
37-
});
55+
const content = this.getContent();
3856

3957
return (
4058
<div id={this.props.id} aria-live="polite" className={className} style={this.props.style} role="alert">
41-
<span className={icon}></span>
42-
<span className="p-inline-message-text">{this.props.text}</span>
59+
{ content }
4360
</div>
4461
);
4562
}

src/showcase/liveeditor/LiveEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ ${extIndexCSS}
181181
_files[`src/demo/${name}${extension}`] = {
182182
content:
183183
`import 'primeicons/primeicons.css';
184-
import 'primereact/resources/themes/nova-light/theme.css';
184+
import 'primereact/resources/themes/saga-blue/theme.css';
185185
import 'primereact/resources/primereact.css';
186186
import 'primeflex/primeflex.css';
187187
import '../../index.css';

src/showcase/menubar/MenubarDoc.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,11 @@ const MenubarDemo = () => {
306306
307307
return (
308308
<div>
309-
<Menubar model={items}>
310-
<InputText placeholder="Search" type="text"/>
311-
<Button label="Logout" icon="pi pi-power-off" style={{marginLeft:4}}/>
312-
</Menubar>
309+
<Menubar
310+
model={items}
311+
start={<InputText placeholder="Search" type="text"/>}
312+
end={<Button label="Logout" icon="pi pi-power-off"/>}
313+
/>
313314
</div>
314315
);
315316
}
@@ -455,10 +456,11 @@ const MenubarDemo = () => {
455456
456457
return (
457458
<div>
458-
<Menubar model={items}>
459-
<InputText placeholder="Search" type="text"/>
460-
<Button label="Logout" icon="pi pi-power-off" style={{marginLeft:4}}/>
461-
</Menubar>
459+
<Menubar
460+
model={items}
461+
start={<InputText placeholder="Search" type="text"/>}
462+
end={<Button label="Logout" icon="pi pi-power-off"/>}
463+
/>
462464
</div>
463465
);
464466
}
@@ -628,13 +630,14 @@ const items:[
628630
</CodeHighlight>
629631

630632
<h5>Custom Content</h5>
631-
<p>Any content inside the menubar will be displayed on the right side by default. You may use ".ui-menubar-custom" style class to change the location of the content.</p>
633+
<p>The menubar can display custom content by using the "start" and "end" properties.</p>
632634
<CodeHighlight>
633635
{`
634-
<Menubar model={items}>
635-
<InputText placeholder="Search" type="text"/>
636-
<Button label="Logout" icon="pi pi-power-off" style={{marginLeft:4}}/>
637-
</Menubar>
636+
<Menubar
637+
model={items}
638+
start={<InputText placeholder="Search" type="text"/>}
639+
end={<Button label="Logout" icon="pi pi-power-off"/>}
640+
/>
638641
`}
639642
</CodeHighlight>
640643

src/showcase/messages/MessagesDoc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,12 @@ this.messages.show({ life: 5000, severity: 'error', summary: 'Error Message', de
577577
<td>null</td>
578578
<td>Message text.</td>
579579
</tr>
580+
<tr>
581+
<td>content</td>
582+
<td>element</td>
583+
<td>null</td>
584+
<td>Template of the message.</td>
585+
</tr>
580586
</tbody>
581587
</table>
582588
</div>

src/showcase/ripple/RippleDoc.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class RippleDoc extends Component {
1616
<h5>Import</h5>
1717
<CodeHighlight lang="js">
1818
{`
19-
import { PrimeReact } from 'primereact/utils';
19+
import PrimeReact from 'primereact/utils';
2020
import { Ripple } from 'primereact/ripple';
2121
`}
2222
</CodeHighlight>
@@ -96,11 +96,18 @@ import { Ripple } from 'primereact/ripple';
9696
<CodeHighlight lang="js">
9797
{`
9898
import React, { Component } from 'react';
99+
import PrimeReact from 'primereact/utils';
99100
import { Ripple } from 'primereact/ripple';
100101
import './RippleDemo.scss';
101102
102103
export class RippleDemo extends Component {
103104
105+
constructor(props) {
106+
super(props);
107+
108+
PrimeReact.ripple = true;
109+
}
110+
104111
render() {
105112
return (
106113
<div className="ripple-demo">

src/showcase/setup/SetupPage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ dependencies: {
9191

9292
<CodeHighlight lang="js">
9393
{`
94-
primereact/resources/themes/nova-light/theme.css
94+
primereact/resources/themes/saga-blue/theme.css
9595
primereact/resources/primereact.min.css
9696
primeicons/primeicons.css
9797
`}
@@ -100,7 +100,7 @@ primeicons/primeicons.css
100100
<p>If you are using a bundler such as webpack with a css loader you may also import them to your main application component, an example from create-react-app would be.</p>
101101
<CodeHighlight lang="js">
102102
{`
103-
import 'primereact/resources/themes/nova-light/theme.css';
103+
import 'primereact/resources/themes/saga-blue/theme.css';
104104
import 'primereact/resources/primereact.min.css';
105105
import 'primeicons/primeicons.css';
106106
`}

0 commit comments

Comments
 (0)