Skip to content

Commit e082497

Browse files
authored
Merge pull request #1126 from pnp/dev
v3.6.0
2 parents 2f28397 + 4691ad6 commit e082497

File tree

80 files changed

+4914
-739
lines changed

Some content is hidden

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

80 files changed

+4914
-739
lines changed

.github/workflows/dev-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2
12-
- uses: actions/setup-node@v1
12+
- uses: actions/setup-node@v2
1313
with:
1414
node-version: 14
15-
registry-url: https://registry.npmjs.org/
15+
registry-url: 'https://registry.npmjs.org'
1616

1717
- name: Install npm dependencies
1818
run: npm i

.github/workflows/main-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- uses: actions/setup-node@v1
13+
- uses: actions/setup-node@v2
1414
with:
1515
node-version: 14
16-
registry-url: https://registry.npmjs.org/
16+
registry-url: 'https://registry.npmjs.org'
1717

1818
- name: Install npm dependencies
1919
run: npm i

CHANGELOG.JSON

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
11
{
22
"versions": [
3+
{
4+
"version": "3.6.0",
5+
"changes": {
6+
"new": [
7+
"`AdaptiveCardHost`: React control that allows you to render an Adaptive Card as a component [#1096](https://github.com/pnp/sp-dev-fx-controls-react/issues/1096)"
8+
],
9+
"enhancements": [
10+
"`ModernTaxonomyPicker`: ability to add action buttons to terms [#1058](https://github.com/pnp/sp-dev-fx-controls-react/pull/1058)",
11+
"`FilePicker`: allow to select files from other sites [#907](https://github.com/pnp/sp-dev-fx-controls-react/issues/907)",
12+
"`Localization`: Update Swedish translations [#1099](https://github.com/pnp/sp-dev-fx-controls-react/pull/1099)",
13+
"`FilePicker`: ability to allow external link and disable file existance chech [commit](https://github.com/pnp/sp-dev-fx-controls-react/commit/41ed4dd2277cf33050f9aeffe743dd684ed9d782)",
14+
"`FilePicker`: support for multi-select on additional sources [#1047](https://github.com/pnp/sp-dev-fx-controls-react/pull/1047)",
15+
"`DateTimePicker`: new property for allowTextInput [#1094](https://github.com/pnp/sp-dev-fx-controls-react/issues/1094)"
16+
17+
],
18+
"fixes": [
19+
"`LivePersona`: Cannot find module '@pnp/spfx-controls-react/lib/LivePersona'[#1069](https://github.com/pnp/sp-dev-fx-controls-react/issues/1069)",
20+
"`ListView`: documentation spelling mistake 'ColumndName' [#1063](https://github.com/pnp/sp-dev-fx-controls-react/issues/1063)",
21+
"Fixes for Norwegian localization [#1083](https://github.com/pnp/sp-dev-fx-controls-react/pull/1083)",
22+
"`DynamicForm`: doesn't load or save correctly when field name starts with a special character [#1077](https://github.com/pnp/sp-dev-fx-controls-react/issues/1077)",
23+
"`DynamicForm`: fields in DynamicForm do not honour regional settings [#1075](https://github.com/pnp/sp-dev-fx-controls-react/issues/1075)",
24+
"`DynamicForm`: Boolean fields do not honour the default value in list settings [#1073](https://github.com/pnp/sp-dev-fx-controls-react/issues/1073)",
25+
"`TaxonomyPicker`: table markdown fix in documentation [#1072](https://github.com/pnp/sp-dev-fx-controls-react/pull/1072)",
26+
"`WebPartTitle`: Fix for styling of WebPartTitle to better match the styling of the oob webpart titles. [#1088](https://github.com/pnp/sp-dev-fx-controls-react/pull/1088)",
27+
"`LivePersona`: fix for documentation typos [#1106](https://github.com/pnp/sp-dev-fx-controls-react/pull/1106)",
28+
"`LivePersona`: remove property for SPFx context [#1108](https://github.com/pnp/sp-dev-fx-controls-react/pull/1108)",
29+
"Documentation fix for swedish translations [#1100](https://github.com/pnp/sp-dev-fx-controls-react/pull/1100)"
30+
]
31+
},
32+
"contributions": [
33+
"[Alexander M](https://github.com/alexanmo)",
34+
"[Carlos Marins Jr](https://github.com/kadu-jr)",
35+
"[Fabio Franzini](https://github.com/fabiofranzini)",
36+
"[Henrik](https://github.com/Henke-visual)",
37+
"[Jasey Waegebaert](https://github.com/Jwaegebaert)",
38+
"[João Mendes](https://github.com/joaojmendes)",
39+
"[Milan Holemans](https://github.com/milanholemans)",
40+
"[MonalisaBaltatescu](https://github.com/MonalisaBaltatescu)",
41+
"[Patrik Hellgren](https://github.com/patrikhellgren)",
42+
"[Tom G](https://github.com/t0mgerman)"
43+
]
44+
},
345
{
446
"version": "3.5.0",
547
"changes": {

CHANGELOG.md

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

3+
## 3.6.0
4+
5+
### New control(s)
6+
7+
- `AdaptiveCardHost`: React control that allows you to render an Adaptive Card as a component [#1096](https://github.com/pnp/sp-dev-fx-controls-react/issues/1096)
8+
9+
### Enhancements
10+
11+
- `ModernTaxonomyPicker`: ability to add action buttons to terms [#1058](https://github.com/pnp/sp-dev-fx-controls-react/pull/1058)
12+
- `FilePicker`: allow to select files from other sites [#907](https://github.com/pnp/sp-dev-fx-controls-react/issues/907)
13+
- `Localization`: Update Swedish translations [#1099](https://github.com/pnp/sp-dev-fx-controls-react/pull/1099)
14+
- `FilePicker`: ability to allow external link and disable file existance chech [commit](https://github.com/pnp/sp-dev-fx-controls-react/commit/41ed4dd2277cf33050f9aeffe743dd684ed9d782)
15+
- `FilePicker`: support for multi-select on additional sources [#1047](https://github.com/pnp/sp-dev-fx-controls-react/pull/1047)
16+
- `DateTimePicker`: new property for allowTextInput [#1094](https://github.com/pnp/sp-dev-fx-controls-react/issues/1094)
17+
18+
### Fixes
19+
20+
- `LivePersona`: Cannot find module '@pnp/spfx-controls-react/lib/LivePersona'[#1069](https://github.com/pnp/sp-dev-fx-controls-react/issues/1069)
21+
- `ListView`: documentation spelling mistake 'ColumndName' [#1063](https://github.com/pnp/sp-dev-fx-controls-react/issues/1063)
22+
- Fixes for Norwegian localization [#1083](https://github.com/pnp/sp-dev-fx-controls-react/pull/1083)
23+
- `DynamicForm`: doesn't load or save correctly when field name starts with a special character [#1077](https://github.com/pnp/sp-dev-fx-controls-react/issues/1077)
24+
- `DynamicForm`: fields in DynamicForm do not honour regional settings [#1075](https://github.com/pnp/sp-dev-fx-controls-react/issues/1075)
25+
- `DynamicForm`: Boolean fields do not honour the default value in list settings [#1073](https://github.com/pnp/sp-dev-fx-controls-react/issues/1073)
26+
- `TaxonomyPicker`: table markdown fix in documentation [#1072](https://github.com/pnp/sp-dev-fx-controls-react/pull/1072)
27+
- `WebPartTitle`: Fix for styling of WebPartTitle to better match the styling of the oob webpart titles. [#1088](https://github.com/pnp/sp-dev-fx-controls-react/pull/1088)
28+
- `LivePersona`: fix for documentation typos [#1106](https://github.com/pnp/sp-dev-fx-controls-react/pull/1106)
29+
- `LivePersona`: remove property for SPFx context [#1108](https://github.com/pnp/sp-dev-fx-controls-react/pull/1108)
30+
- Documentation fix for swedish translations [#1100](https://github.com/pnp/sp-dev-fx-controls-react/pull/1100)
31+
32+
### Contributors
33+
34+
Special thanks to our contributors (in alphabetical order): [Alexander M](https://github.com/alexanmo), [Carlos Marins Jr](https://github.com/kadu-jr), [Fabio Franzini](https://github.com/fabiofranzini), [Henrik](https://github.com/Henke-visual), [Jasey Waegebaert](https://github.com/Jwaegebaert), [João Mendes](https://github.com/joaojmendes), [Milan Holemans](https://github.com/milanholemans), [MonalisaBaltatescu](https://github.com/MonalisaBaltatescu), [Patrik Hellgren](https://github.com/patrikhellgren), [Tom G](https://github.com/t0mgerman).
35+
336
## 3.5.0
437

538
### Enhancements

docs/documentation/docs/about/release-notes.md

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

3+
## 3.6.0
4+
5+
### New control(s)
6+
7+
- `AdaptiveCardHost`: React control that allows you to render an Adaptive Card as a component [#1096](https://github.com/pnp/sp-dev-fx-controls-react/issues/1096)
8+
9+
### Enhancements
10+
11+
- `ModernTaxonomyPicker`: ability to add action buttons to terms [#1058](https://github.com/pnp/sp-dev-fx-controls-react/pull/1058)
12+
- `FilePicker`: allow to select files from other sites [#907](https://github.com/pnp/sp-dev-fx-controls-react/issues/907)
13+
- `Localization`: Update Swedish translations [#1099](https://github.com/pnp/sp-dev-fx-controls-react/pull/1099)
14+
- `FilePicker`: ability to allow external link and disable file existance chech [commit](https://github.com/pnp/sp-dev-fx-controls-react/commit/41ed4dd2277cf33050f9aeffe743dd684ed9d782)
15+
- `FilePicker`: support for multi-select on additional sources [#1047](https://github.com/pnp/sp-dev-fx-controls-react/pull/1047)
16+
- `DateTimePicker`: new property for allowTextInput [#1094](https://github.com/pnp/sp-dev-fx-controls-react/issues/1094)
17+
18+
### Fixes
19+
20+
- `LivePersona`: Cannot find module '@pnp/spfx-controls-react/lib/LivePersona'[#1069](https://github.com/pnp/sp-dev-fx-controls-react/issues/1069)
21+
- `ListView`: documentation spelling mistake 'ColumndName' [#1063](https://github.com/pnp/sp-dev-fx-controls-react/issues/1063)
22+
- Fixes for Norwegian localization [#1083](https://github.com/pnp/sp-dev-fx-controls-react/pull/1083)
23+
- `DynamicForm`: doesn't load or save correctly when field name starts with a special character [#1077](https://github.com/pnp/sp-dev-fx-controls-react/issues/1077)
24+
- `DynamicForm`: fields in DynamicForm do not honour regional settings [#1075](https://github.com/pnp/sp-dev-fx-controls-react/issues/1075)
25+
- `DynamicForm`: Boolean fields do not honour the default value in list settings [#1073](https://github.com/pnp/sp-dev-fx-controls-react/issues/1073)
26+
- `TaxonomyPicker`: table markdown fix in documentation [#1072](https://github.com/pnp/sp-dev-fx-controls-react/pull/1072)
27+
- `WebPartTitle`: Fix for styling of WebPartTitle to better match the styling of the oob webpart titles. [#1088](https://github.com/pnp/sp-dev-fx-controls-react/pull/1088)
28+
- `LivePersona`: fix for documentation typos [#1106](https://github.com/pnp/sp-dev-fx-controls-react/pull/1106)
29+
- `LivePersona`: remove property for SPFx context [#1108](https://github.com/pnp/sp-dev-fx-controls-react/pull/1108)
30+
- Documentation fix for swedish translations [#1100](https://github.com/pnp/sp-dev-fx-controls-react/pull/1100)
31+
32+
### Contributors
33+
34+
Special thanks to our contributors (in alphabetical order): [Alexander M](https://github.com/alexanmo), [Carlos Marins Jr](https://github.com/kadu-jr), [Fabio Franzini](https://github.com/fabiofranzini), [Henrik](https://github.com/Henke-visual), [Jasey Waegebaert](https://github.com/Jwaegebaert), [João Mendes](https://github.com/joaojmendes), [Milan Holemans](https://github.com/milanholemans), [MonalisaBaltatescu](https://github.com/MonalisaBaltatescu), [Patrik Hellgren](https://github.com/patrikhellgren), [Tom G](https://github.com/t0mgerman).
35+
336
## 3.5.0
437

538
### Enhancements
5.23 MB
Loading
17.2 MB
Loading
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# Adaptive Card Host
2+
3+
The motivation behind this control is to have a React control that facilitates the use of Adaptive Cards in SPFx by adding some features such as:
4+
5+
- Graphic integration with SharePoint / Microsoft Teams themes, both as regards the color palette and the use of the Fluent UI React controls instead of the classic HTML controls.
6+
7+
- Automatic use of Adaptive Cards Templating if an object containing data is passed to the control.
8+
9+
For graphic integration, in the case of SharePoint the current theme (page or section theme) or a custom theme is used.
10+
Three custom themes have been created for Microsoft Teams to emulate the colors of the available themes: Default, Dark and Hight Contrast.
11+
12+
All Elements and Actions of Adaptive Cards have been redefined using Fluent UI React, both for SharePoint and Microsoft Teams (in this case the "Fluent UI Northstar" library is not used), adding and improving features that are not managed in Microsoft's implementation of the "adaptivecards-fluentui" library (Theme support for example).
13+
14+
The Adaptive Cards version supported is 1.5, by using the 'adaptivecards' npm package version 2.10.0.
15+
16+
Here is an example of the control in action inside a Web Part:
17+
18+
![Adaptive Card Host control](../assets/AdaptiveCardHost.gif)
19+
20+
Here is an example of the previous Web Part (using different Card), hosted as a Tab in Microsoft Teams:
21+
22+
![Adaptive Card Host control](../assets/AdaptiveCardHostTeams.gif)
23+
24+
## How to use this control in your solutions
25+
26+
- Check that you installed the `@pnp/spfx-controls-react` dependency. Check out the [getting started](../../#getting-started) page for more information about installing the dependency.
27+
- In your component file, import the `AdaptiveCardHost` control as follows:
28+
29+
```TypeScript
30+
import { AdaptiveCardHost, IAdaptiveCardHostActionResult, AdaptiveCardHostThemeType } from "@pnp/spfx-controls-react/lib/AdaptiveCardHost";
31+
```
32+
33+
- Example on use the `AdaptiveCardHost` control with only required properties:
34+
35+
```TSX
36+
<AdaptiveCardHost
37+
card={card}
38+
onInvokeAction={(action) => alert(JSON.stringify(action))}
39+
onError={(error) => alert(error.message)}
40+
/>
41+
```
42+
43+
- Example on use the `AdaptiveCardHost` control with all properties:
44+
45+
```TSX
46+
<AdaptiveCardHost
47+
card={card}
48+
data={data}
49+
style={null}
50+
className={null}
51+
theme={this.props.theme}
52+
themeType={themeType}
53+
hostConfig={null}
54+
onInvokeAction={(action) => alert(JSON.stringify(action))}
55+
onError={(error) => alert(error.message)}
56+
onSetCustomElements={(registry: CardObjectRegistry<CardElement>) => {
57+
registry.register("CustomElementName", CustomElement);
58+
}}
59+
onSetCustomActions={(registry: CardObjectRegistry<Action>) => {
60+
registry.register("CustomActionName", CustomAction);
61+
}}
62+
onUpdateHostCapabilities={(hostCapabilities: HostCapabilities) => {
63+
hostCapabilities.setCustomProperty("CustomPropertyName", Date.now);
64+
}}
65+
isUniqueControlInPage={true}
66+
/>
67+
```
68+
69+
- Example on use the `AdaptiveCardHost` control with SharePoint Theme:
70+
71+
```TSX
72+
<AdaptiveCardHost
73+
card={card}
74+
themeType={AdaptiveCardHostThemeType.SharePoint}
75+
onInvokeAction={(action) => alert(JSON.stringify(action))}
76+
onError={(error) => alert(error.message)}
77+
/>
78+
```
79+
80+
- Example on use the `AdaptiveCardHost` control with SharePoint Theme "Section Variation" ('this.props.theme' is the theme that come from the Web Part) */):
81+
82+
```TSX
83+
<AdaptiveCardHost
84+
card={card}
85+
theme={this.props.theme}
86+
themeType={AdaptiveCardHostThemeType.SharePoint}
87+
onInvokeAction={(action) => alert(JSON.stringify(action))}
88+
onError={(error) => alert(error.message)}
89+
/>
90+
```
91+
92+
- Example on use the `AdaptiveCardHost` control with Teams "Default" Theme:
93+
94+
```TSX
95+
<AdaptiveCardHost
96+
card={card}
97+
themeType={AdaptiveCardHostThemeType.Teams}
98+
onInvokeAction={(action) => alert(JSON.stringify(action))}
99+
onError={(error) => alert(error.message)}
100+
/>
101+
```
102+
103+
- Example on use the `AdaptiveCardHost` control with Teams "Dark" Theme:
104+
105+
```TSX
106+
<AdaptiveCardHost
107+
card={card}
108+
themeType={AdaptiveCardHostThemeType.TeamsDark}
109+
onInvokeAction={(action) => alert(JSON.stringify(action))}
110+
onError={(error) => alert(error.message)}
111+
/>
112+
```
113+
114+
- Example on use the `AdaptiveCardHost` control with Teams "High Contrast" Theme:
115+
116+
```TSX
117+
<AdaptiveCardHost
118+
card={card}
119+
themeType={AdaptiveCardHostThemeType.TeamsHighContrast}
120+
onInvokeAction={(action) => alert(JSON.stringify(action))}
121+
onError={(error) => alert(error.message)}
122+
/>
123+
```
124+
125+
## Implementation
126+
127+
The `AdaptiveCardHost` control can be configured with the following properties:
128+
129+
| Property | Type | Required | Description |
130+
| ---- | ---- | ---- | ---- |
131+
| card | object | yes | Set Adaptive Card payload. |
132+
| data | { "$root": object } | no | Set Data Source for template rendering. |
133+
| style | React.CSSProperties | no | Set CSS Style. |
134+
| className | string | no | Set CSS Class. |
135+
| theme | IPartialTheme or ITheme | no | Set Fluent UI Theme. Used only if the "themeType" property is set to 'ThemeType.SharePoint'. If not set or set to null or not defined, the theme passed through context will be searched, or the default theme of the page will be loaded. |
136+
| themeType | ThemeType | no | Select the Type of Theme you want to use. If it is not set or set to null or undefined, the 'ThemeType.SharePoint' value will be used and the "theme" property or the theme passed through the context or default page will be loaded. In other cases, the chosen Microsoft Teams theme will be applied. |
137+
| hostConfig | object | no | Set custom HostConfig. |
138+
| onInvokeAction | (action: IAdaptiveCardActionResult) => void | yes | Invoked every time an Action is performed. |
139+
| onError | (error: Error) => void | yes | Invoked every time an exception occurs in the rendering phase. |
140+
| onSetCustomElements | (registry: CardObjectRegistry<CardElement>) => void | no | Invoked to manage Elements to the current Adaptive Card instance. |
141+
| onSetCustomActions | (registry: CardObjectRegistry<Action>) => void | no | Invoked to manage Actions to the current Adaptive Card instance. |
142+
| onUpdateHostCapabilities | (hostCapabilities: HostCapabilities) => void | no | Invoked to manage the HostCapabilities object like add custom properties. |
143+
| isUniqueControlInPage | boolean | no | Set to true if you want to use only one instance of this control per page, false for multiple controls. This affects how CSS variables are set. |
144+
145+
Interface `IAdaptiveCardHostActionResult`
146+
147+
| Property | Type | Required | Description |
148+
| ---- | ---- | ---- | ---- |
149+
| type | string | yes | Type of the Action. |
150+
| title | string | no | Title of the Action. |
151+
| url | string | no | Url of the Action. |
152+
| data | object | no | Data of the Action. |
153+
| verb | string | no | Verb of the Action. |
154+
155+
Enum `AdaptiveCardHostThemeType`
156+
157+
| Type | Description |
158+
| ---- | ---- |
159+
| SharePoint | Use the SharePoint current Theme or Theme Variation |
160+
| Teams | Use the Fluent UI Teams default theme |
161+
| TeamsDark | Use the Fluent UI Teams dark theme |
162+
| TeamsHighContrast | Use the Fluent UI Teams high contrast theme |
163+
164+
![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/AdaptiveCardHost)

docs/documentation/docs/controls/DateTimePicker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ The `DateTimePicker` control can be configured with the following properties:
6262
| isMonthPickerVisible | boolean | no | Controls whether the month picker is shown beside the day picker or hidden. |
6363
| showMonthPickerAsOverlay | boolean | no | Show month picker on top of date picker when visible. |
6464
| showWeekNumbers | boolean | no | Controls whether the calendar should show the week number (weeks 1 to 53) before each week row |
65+
| allowTextInput | boolean | no | Whether the user is allowed to enter a date as text instead of picking one from the date picker. |
6566
| strings | IDatePickerStrings | no | Localized strings to use in the DateTimePicker |
6667
| value | Date | no | Default value of the DatePicker, if any |
6768
| onChange | function | no | Callback issued when date or time is changed |

docs/documentation/docs/controls/FilePicker.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ The FilePicker component can be configured with the following properties:
101101
| renderCustomMultipleUploadTabContent | (filePickerResult: IFilePickerResult[]) => JSX.Element \| null | no | Optional renderer to add custom user-defined fields to "Multi-Upload" tab |
102102
| renderCustomLinkTabContent | (filePickerResult: IFilePickerResult) => JSX.Element \| null | no | Optional renderer to add custom user-defined fields to "Link" tab |
103103
| includePageLibraries | boolean | no | Specifies if Site Pages library to be visible on Sites tab |
104+
| allowExternalLinks | boolean | no | Specifies if external links should be allowed. |
105+
| checkIfFileExists | boolean | no | When using file links, this property allows the user to choose if the control should check if the link point to a file that exists or not. |
104106

105107
interface `IFilePickerResult`
106108

0 commit comments

Comments
 (0)