Skip to content

Commit 873aa00

Browse files
authored
Merge pull request pnp#1912 from pnp/dev
v3.20.0
2 parents a72229f + aff9a52 commit 873aa00

File tree

135 files changed

+32257
-34002
lines changed

Some content is hidden

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

135 files changed

+32257
-34002
lines changed

.eslintrc.js

+2-35
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,6 @@ module.exports = {
2727
'@rushstack/security/no-unsafe-regexp': 0,
2828
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
2929
'@typescript-eslint/adjacent-overload-signatures': 1,
30-
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
31-
//
32-
// CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol
33-
'@typescript-eslint/ban-types': [
34-
1,
35-
{
36-
'extendDefaults': false,
37-
'types': {
38-
'String': {
39-
'message': 'Use \'string\' instead',
40-
'fixWith': 'string'
41-
},
42-
'Boolean': {
43-
'message': 'Use \'boolean\' instead',
44-
'fixWith': 'boolean'
45-
},
46-
'Number': {
47-
'message': 'Use \'number\' instead',
48-
'fixWith': 'number'
49-
},
50-
'Object': {
51-
'message': 'Use \'object\' instead, or else define a proper TypeScript type:'
52-
},
53-
'Symbol': {
54-
'message': 'Use \'symbol\' instead',
55-
'fixWith': 'symbol'
56-
},
57-
'Function': {
58-
'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.'
59-
}
60-
}
61-
}
62-
],
6330
// RATIONALE: Code is more readable when the type of every variable is immediately obvious.
6431
// Even if the compiler may be able to infer a type, this inference will be unavailable
6532
// to a person who is reviewing a GitHub diff. This rule makes writing code harder,
@@ -125,7 +92,7 @@ module.exports = {
12592
//
12693
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
12794
// Set to 1 (warning) or 2 (error) to enable the rule
128-
'@typescript-eslint/no-parameter-properties': 0,
95+
'@typescript-eslint/parameter-properties': 0,
12996
// RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code
13097
// may impact performance.
13198
//
@@ -358,4 +325,4 @@ module.exports = {
358325
}
359326
}
360327
]
361-
};
328+
};

.hintrc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": [
3+
"development"
4+
],
5+
"hints": {
6+
"axe/aria": "off",
7+
"no-inline-styles": "off",
8+
"axe/text-alternatives": [
9+
"default",
10+
{
11+
"frame-title": "off"
12+
}
13+
]
14+
}
15+
}

.yo-rc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@microsoft/generator-sharepoint": {
3-
"version": "1.19.0",
3+
"version": "1.20.0",
44
"libraryName": "sp-dev-fx-controls-react",
55
"libraryId": "92b1e52c-a5fa-490a-bcf4-76080f39442c",
66
"environment": "spo",
@@ -11,7 +11,7 @@
1111
"nodeVersion": "18.17.1",
1212
"sdksVersions": {
1313
"@microsoft/microsoft-graph-client": "3.0.2",
14-
"@microsoft/teams-js": "2.12.0"
14+
"@microsoft/teams-js": "2.24.0"
1515
},
1616
"componentType": "extension",
1717
"extensionType": "ApplicationCustomizer"

CHANGELOG.json

+40
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
{
22
"versions": [
3+
{
4+
"version": "3.20.0",
5+
"changes": {
6+
"new": [],
7+
"enhancements": [
8+
"`Dashboard`: added new WidgetSize [#1845](https://github.com/pnp/sp-dev-fx-controls-react/pull/1845)",
9+
"`Dashboard`: IWidgetLink improvements [#1813](https://github.com/pnp/sp-dev-fx-controls-react/pull/1813)",
10+
"`DynamicForm`: custom sorting [#1802](https://github.com/pnp/sp-dev-fx-controls-react/pull/1802)",
11+
"`ImagePicker`: new Control ImagePicker [#1820](https://github.com/pnp/sp-dev-fx-controls-react/pull/1820)",
12+
"`UserPicker`: new Control UserPicker [#1675](https://github.com/pnp/sp-dev-fx-controls-react/pull/1675)",
13+
"`DynamicForm`: DynamicForm storeLastActiveTab option #1879 [#1879](https://github.com/pnp/sp-dev-fx-controls-react/pull/1879)",
14+
"`FilePicker`: Image picker enhancements [#1805](https://github.com/pnp/sp-dev-fx-controls-react/pull/1805)",
15+
"`DynamicForm`: Adds ability to create files/folders in subfolder using DynamicForm. [#1901](https://github.com/pnp/sp-dev-fx-controls-react/issues/1901)"
16+
],
17+
"fixes": [
18+
"Debug Controls in any language [#1882](https://github.com/pnp/sp-dev-fx-controls-react/pull/1882)",
19+
"`AdaptiveCardHost`: lock down adaptive-expression package version [#1876](https://github.com/pnp/sp-dev-fx-controls-react/issues/1876)",
20+
"`ListItemPicker`: PR fixes an issue with filtering when using calculated column as columnInternalName in ListItemPicker. [#1887](https://github.com/pnp/sp-dev-fx-controls-react/pull/1887)",
21+
"`ListItemAttachments`: Fix 1858 to correct Chinese localization files #1894 [#1894](https://github.com/pnp/sp-dev-fx-controls-react/pull/1894)",
22+
"`DynamicForm`: Fixing issue 1862 - Dynamic form should hide fields that are hidden on the List Content Type [#1872](https://github.com/pnp/sp-dev-fx-controls-react/pull/1872)",
23+
"`GridLayout`: A quick fix for #838. When compact mode the number of items rendered per page must match the number of all items. [1851](https://github.com/pnp/sp-dev-fx-controls-react/pull/1851)",
24+
"`DynamicForm`: Always Show Required Field Validation Error In FormDisplayMode.Edit Mode [#1775](https://github.com/pnp/sp-dev-fx-controls-react/issues/1775)",
25+
"`DynamicForm`: Required Field Validation won't work [#1760](https://github.com/pnp/sp-dev-fx-controls-react/issues/1760)",
26+
"`DynamicForm`: Adds ability to render file/folder name field in DynamicForm and Field. [#1906](https://github.com/pnp/sp-dev-fx-controls-react/pull/1906)"
27+
]
28+
},
29+
"contributions": [
30+
"[Alex Terentiev](https://github.com/AJIXuMuK)",
31+
"[Antanina Druzhkina](https://github.com/Ateina)",
32+
"[Guido Zambarda](https://github.com/GuidoZam)",
33+
"[IRRDC](https://github.com/IRRDC)",
34+
"[joaojmendes](https://github.com/joaojmendes)",
35+
"[Martin Lingstuyl](https://github.com/martinlingstuyl)",
36+
"[Michaël Maillot](https://github.com/michaelmaillot)",
37+
"[Nishkalank Bezawada](https://github.com/NishkalankBezawada)",
38+
"[srpmtt](https://github.com/srpmtt)",
39+
"[wilecoyotegenius](https://github.com/wilecoyotegenius)",
40+
"[wuxiaojun514](https://github.com/wuxiaojun514)"
41+
]
42+
},
343
{
444
"version": "3.19.0",
545
"changes": {

CHANGELOG.md

+29
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Releases
22

3+
## 3.20.0
4+
5+
### Enhancements
6+
7+
- `Dashboard`: added new WidgetSize [#1845](https://github.com/pnp/sp-dev-fx-controls-react/pull/1845)
8+
- `Dashboard`: IWidgetLink improvements [#1813](https://github.com/pnp/sp-dev-fx-controls-react/pull/1813)
9+
- `DynamicForm`: custom sorting [#1802](https://github.com/pnp/sp-dev-fx-controls-react/pull/1802)
10+
- `ImagePicker`: new Control ImagePicker [#1820](https://github.com/pnp/sp-dev-fx-controls-react/pull/1820)
11+
- `UserPicker`: new Control UserPicker [#1675](https://github.com/pnp/sp-dev-fx-controls-react/pull/1675)
12+
- `DynamicForm`: DynamicForm storeLastActiveTab option #1879 [#1879](https://github.com/pnp/sp-dev-fx-controls-react/pull/1879)
13+
- `FilePicker`: Image picker enhancements [#1805](https://github.com/pnp/sp-dev-fx-controls-react/pull/1805)
14+
- `DynamicForm`: Adds ability to create files/folders in subfolder using DynamicForm. [#1901](https://github.com/pnp/sp-dev-fx-controls-react/issues/1901)
15+
16+
### Fixes
17+
18+
- Debug Controls in any language [#1882](https://github.com/pnp/sp-dev-fx-controls-react/pull/1882)
19+
- `AdaptiveCardHost`: lock down adaptive-expression package version [#1876](https://github.com/pnp/sp-dev-fx-controls-react/issues/1876)
20+
- `ListItemPicker`: PR fixes an issue with filtering when using calculated column as columnInternalName in ListItemPicker. [#1887](https://github.com/pnp/sp-dev-fx-controls-react/pull/1887)
21+
- `ListItemAttachments`: Fix 1858 to correct Chinese localization files #1894 [#1894](https://github.com/pnp/sp-dev-fx-controls-react/pull/1894)
22+
- `DynamicForm`: Fixing issue 1862 - Dynamic form should hide fields that are hidden on the List Content Type [#1872](https://github.com/pnp/sp-dev-fx-controls-react/pull/1872)
23+
- `GridLayout`: A quick fix for #838. When compact mode the number of items rendered per page must match the number of all items. [1851](https://github.com/pnp/sp-dev-fx-controls-react/pull/1851)
24+
- `DynamicForm`: Always Show Required Field Validation Error In FormDisplayMode.Edit Mode [#1775](https://github.com/pnp/sp-dev-fx-controls-react/issues/1775)
25+
- `DynamicForm`: Required Field Validation won't work [#1760](https://github.com/pnp/sp-dev-fx-controls-react/issues/1760)
26+
- `DynamicForm`: Adds ability to render file/folder name field in DynamicForm and Field. [#1906](https://github.com/pnp/sp-dev-fx-controls-react/pull/1906)
27+
28+
### Contributors
29+
30+
Special thanks to our contributors (in alphabetical order): [Alex Terentiev](https://github.com/AJIXuMuK), [Antanina Druzhkina](https://github.com/Ateina), [Guido Zambarda](https://github.com/GuidoZam), [IRRDC](https://github.com/IRRDC), [joaojmendes](https://github.com/joaojmendes), [Martin Lingstuyl](https://github.com/martinlingstuyl), [Michaël Maillot](https://github.com/michaelmaillot), [Nishkalank Bezawada](https://github.com/NishkalankBezawada), [srpmtt](https://github.com/srpmtt), [wilecoyotegenius](https://github.com/wilecoyotegenius), [wuxiaojun514](https://github.com/wuxiaojun514).
31+
332
## 3.19.0
433

534
### Enhancements

config/config.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
},
3838
"externals": {},
3939
"localizedResources": {
40-
"ControlStrings": "lib/loc/{locale}.js",
41-
"ControlsTestWebPartStrings": "lib/webparts/controlsTest/loc/{locale}.js",
42-
"ControlsTestFormCustomizerStrings": "lib/extensions/testForm/loc/{locale}.js",
43-
"TestApplicationCustomizerStrings": "lib/extensions/testApp/loc/{locale}.js"
40+
"ControlStrings": "lib/loc/{locale}.js"
4441
}
4542
}

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

+29
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Releases
22

3+
## 3.20.0
4+
5+
### Enhancements
6+
7+
- `Dashboard`: added new WidgetSize [#1845](https://github.com/pnp/sp-dev-fx-controls-react/pull/1845)
8+
- `Dashboard`: IWidgetLink improvements [#1813](https://github.com/pnp/sp-dev-fx-controls-react/pull/1813)
9+
- `DynamicForm`: custom sorting [#1802](https://github.com/pnp/sp-dev-fx-controls-react/pull/1802)
10+
- `ImagePicker`: new Control ImagePicker [#1820](https://github.com/pnp/sp-dev-fx-controls-react/pull/1820)
11+
- `UserPicker`: new Control UserPicker [#1675](https://github.com/pnp/sp-dev-fx-controls-react/pull/1675)
12+
- `DynamicForm`: DynamicForm storeLastActiveTab option #1879 [#1879](https://github.com/pnp/sp-dev-fx-controls-react/pull/1879)
13+
- `FilePicker`: Image picker enhancements [#1805](https://github.com/pnp/sp-dev-fx-controls-react/pull/1805)
14+
- `DynamicForm`: Adds ability to create files/folders in subfolder using DynamicForm. [#1901](https://github.com/pnp/sp-dev-fx-controls-react/issues/1901)
15+
16+
### Fixes
17+
18+
- Debug Controls in any language [#1882](https://github.com/pnp/sp-dev-fx-controls-react/pull/1882)
19+
- `AdaptiveCardHost`: lock down adaptive-expression package version [#1876](https://github.com/pnp/sp-dev-fx-controls-react/issues/1876)
20+
- `ListItemPicker`: PR fixes an issue with filtering when using calculated column as columnInternalName in ListItemPicker. [#1887](https://github.com/pnp/sp-dev-fx-controls-react/pull/1887)
21+
- `ListItemAttachments`: Fix 1858 to correct Chinese localization files #1894 [#1894](https://github.com/pnp/sp-dev-fx-controls-react/pull/1894)
22+
- `DynamicForm`: Fixing issue 1862 - Dynamic form should hide fields that are hidden on the List Content Type [#1872](https://github.com/pnp/sp-dev-fx-controls-react/pull/1872)
23+
- `GridLayout`: A quick fix for #838. When compact mode the number of items rendered per page must match the number of all items. [1851](https://github.com/pnp/sp-dev-fx-controls-react/pull/1851)
24+
- `DynamicForm`: Always Show Required Field Validation Error In FormDisplayMode.Edit Mode [#1775](https://github.com/pnp/sp-dev-fx-controls-react/issues/1775)
25+
- `DynamicForm`: Required Field Validation won't work [#1760](https://github.com/pnp/sp-dev-fx-controls-react/issues/1760)
26+
- `DynamicForm`: Adds ability to render file/folder name field in DynamicForm and Field. [#1906](https://github.com/pnp/sp-dev-fx-controls-react/pull/1906)
27+
28+
### Contributors
29+
30+
Special thanks to our contributors (in alphabetical order): [Alex Terentiev](https://github.com/AJIXuMuK), [Antanina Druzhkina](https://github.com/Ateina), [Guido Zambarda](https://github.com/GuidoZam), [IRRDC](https://github.com/IRRDC), [joaojmendes](https://github.com/joaojmendes), [Martin Lingstuyl](https://github.com/martinlingstuyl), [Michaël Maillot](https://github.com/michaelmaillot), [Nishkalank Bezawada](https://github.com/NishkalankBezawada), [srpmtt](https://github.com/srpmtt), [wilecoyotegenius](https://github.com/wilecoyotegenius), [wuxiaojun514](https://github.com/wuxiaojun514).
31+
332
## 3.19.0
433

534
### Enhancements
80.7 KB
Loading
2.12 MB
Loading
Loading
1.03 MB
Loading
Loading
Loading
92.8 KB
Loading
Loading
47.9 KB
Loading

docs/documentation/docs/controls/Dashboard.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ import { WidgetSize, Dashboard } from '@pnp/spfx-controls-react/lib/Dashboard';
2222

2323
```TypeScript
2424
const linkExample = { href: "#" };
25+
const customizedLinkExample = {
26+
href: "#",
27+
title: "This is a customized link!",
28+
color: "red",
29+
target: "_top"
30+
};
2531
const calloutItemsExample = [
2632
{
2733
id: "action_1",
@@ -71,7 +77,7 @@ const calloutItemsExample = [
7177
{
7278
title: "Card 2",
7379
size: WidgetSize.Single,
74-
link: linkExample,
80+
link: customizedLinkExample,
7581
},
7682
{
7783
title: "Card 3",
@@ -142,6 +148,9 @@ Provides Widget link properties
142148
| Property | Type | Required | Description |
143149
| ---- | ---- | ---- | ---- |
144150
| href | string | yes | Link to be opened. |
151+
| title | string | no | The text to display for the link, if not provided, the default text will be used. |
152+
| color | string | no | The color of the link, if not provided, the "default" color will be used. The available colors can be found on the [official Fluent UI documentation of the Text control](https://fluentsite.z22.web.core.windows.net/0.66.2/components/text/definition#variations-color). |
153+
| target | string | no | The target property value for the generated anchor tag, if not provided, the default target will be *_blank*. |
145154

146155
Enum `WidgetSize`
147156

@@ -152,6 +161,7 @@ Provides size of the widget
152161
| Single | Single-sized grid item. |
153162
| Double | Double-width grid item. |
154163
| Triple | Triple width grid item. |
164+
| Quadruple | Quadruple width grid item. |
155165
| Box | Double-width, double-height grid item. |
156166

157167
![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/Dashboard)

docs/documentation/docs/controls/DynamicForm.md

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ The `DynamicForm` can be configured with the following properties:
5050
| disabled | boolean | no | Allows form to be disabled. Default value is `false`|
5151
| disabledFields | string[] | no | InternalName of fields that should be disabled. Default value is `false`|
5252
| enableFileSelection | boolean | no | Specify if the form should support the creation of a new list item in a document library attaching a file to it. This option is only available for document libraries and works only when the contentTypeId is specified and has a base type of type Document. Default value is `false`|
53+
| fieldOrder | string[] | no | List of fields internal names. Specifies fields custom sorting. |
5354
| hiddenFields | string[] | no | InternalName of fields that should be hidden. Default value is `false`|
5455
| onListItemLoaded | (listItemData: any) => Promise<void> | no | List item loaded handler. Allows to access list item information after it's loaded.|
5556
| onBeforeSubmit | (listItemData: any) => Promise<boolean> | no | Before submit handler. Allows to modify the object to be submitted or cancel the submission. To cancel, return `true`.|
@@ -64,6 +65,8 @@ The `DynamicForm` can be configured with the following properties:
6465
| saveDisabled | boolean | no | Specifies if save button is disabled. |
6566
| validationErrorDialogProps | IValidationErrorDialogProps | no | Specifies validation error dialog properties |
6667
| customIcons | { [ columnInternalName: string ]: string } | no | Specifies custom icons for the form. The key of this dictionary is the column internal name, the value is the Fluent UI icon name. |
68+
| storeLastActiveTab | boolean | no | When uploading files: Specifies if last active tab will be stored after the Upload panel has been closed. Note: the value of selected tab is stored in the queryString hash. Default - `true` |
69+
| folderPath | string | no | Server relative or library relative folder to create the item in. This option is only available for document libraries and works only when the contentTypeId is specified and has a base type of type Document or Folder. Defaults to the root folder of the library. |
6770

6871
## Validation Error Dialog Properties `IValidationErrorDialogProps`
6972
| Property | Type | Required | Description |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# HoverReactionsBar
2+
3+
This control allows you to select or Upload Image from SharePoint, Ondrive or Stock Images.
4+
5+
## ImagePicker
6+
7+
![imagepicker](../assets/ImagePicker00.png)
8+
9+
![imagepicker](../assets/ImagePicker01.png)
10+
11+
![imagepicker](../assets/ImagePicker02.png)
12+
13+
![imagepicker](../assets/ImagePicker03.png)
14+
15+
![imagepicker](../assets/ImagePicker04.png)
16+
17+
![imagepicker](../assets/ImagePicker05.png)
18+
19+
## How to use this control in your solutions
20+
21+
- 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.
22+
- Import the following modules to your component:
23+
24+
```TypeScript
25+
import { ImagePicker } from '@pnp/spfx-controls-react/lib/ImagePicker';
26+
```
27+
28+
- Use the `ImagePicker` control in your code as follows:
29+
30+
```Typescript
31+
32+
<ImagePicker
33+
onFileSelected={handleFileSelected}
34+
onDeleteFile={handleDeleteFile}
35+
selectedFileUrl={selectedImageUrl}
36+
context={appContext}
37+
>
38+
```
39+
40+
- With the `onFileSelect` property you can get the selected image:
41+
42+
```typescript
43+
const handleFileSelected = React.useCallback(async (file: IFilePickerResult) => {
44+
console.log("file", file);
45+
}, []);
46+
```
47+
48+
- With the `onDelete` property you can execute a callback after delete the image:
49+
50+
```typescript
51+
const onDeleteFile = React.useCallback(async () => {
52+
console.log("onDeleteFile");
53+
}, []);
54+
```
55+
56+
## Implementation
57+
58+
The HoverReactionsBar control can be configured with the following properties:
59+
60+
| Property | Type | Required | Description |
61+
| --------------- | ------------------------------------------------- | -------- | ----------------------- |
62+
| onFileSelected | onFileSelect: (file: IFilePickerResult ) => void; | yes | OnSelectedFile Callback |
63+
| onDeleteFile | onDeleteFile: () => void | no | onDeleteFile CallBack |
64+
| selectedFileUrl | string | no | Default Selected Image |
65+
| context | BaseComponentContext | yes | Context |
66+
67+
![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/ImagePicker)

0 commit comments

Comments
 (0)