Skip to content

Commit b5ffcae

Browse files
committed
Merge remote-tracking branch 'origin/main' into JasonHQX-patch-4
2 parents 594d9d3 + 4c559e0 commit b5ffcae

File tree

785 files changed

+2819
-1975
lines changed

Some content is hidden

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

785 files changed

+2819
-1975
lines changed

powerapps-docs/developer/component-framework/implementing-controls-using-typescript.md

Lines changed: 78 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ To create a new project:
7676
> [!NOTE]
7777
> If you receive the error `The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program.`, make sure you have installed [node.js](https://nodejs.org/en/download/) (LTS version is recommended) and all other prerequisites.
7878
79-
1. After npm install, you will need to generate ManifestDesignTypes.d.ts file in this directory using the below command."
80-
```
81-
npm run refreshTypes
82-
```
8379

8480

8581
## Implementing manifest
@@ -98,56 +94,100 @@ Make changes to the predefined manifest file, as shown here:
9894
- **control-type**: The code component type. Only *standard* types of code components are supported.
9995

10096
```XML
101-
<?xml version="1.0" encoding="utf-8" ?>
102-
<manifest>
103-
<control namespace="SampleNamespace" constructor="LinearInputControl" version="1.1.0" display-name-key="LinearInputControl_Display_Key" description-key="LinearInputControl_Desc_Key" control-type="standard">
97+
<?xml version="1.0" encoding="utf-8" ?>
98+
<manifest>
99+
<control namespace="SampleNamespace"
100+
constructor="LinearInputControl"
101+
version="1.1.0"
102+
display-name-key="LinearInputControl_Display_Key"
103+
description-key="LinearInputControl_Desc_Key"
104+
control-type="standard">
105+
<!-- TODO: Add type-group, property, and resources elements here -->
106+
</control>
107+
</manifest>
108+
```
109+
110+
1. Add the definition of a [type-group](manifest-schema-reference/type-group.md) element named `numbers` in the `control` element. This element specifies the component value and can contain whole, currency, floating point, or decimal values.
111+
112+
```XML
113+
<type-group name="numbers">
114+
<type>Whole.None</type>
115+
<type>Currency</type>
116+
<type>FP</type>
117+
<type>Decimal</type>
118+
</type-group>
104119
```
105120

106-
2. The [property](manifest-schema-reference/property.md) node defines the properties of the code component like defining the data type of the column. The property node is specified as the child element under the `control` element. Define the [property](manifest-schema-reference/property.md) node as shown here:
121+
1. Add the [property](manifest-schema-reference/property.md) element within the `control` element. This element defines the properties of the code component like defining the data type of the column. Define the [property](manifest-schema-reference/property.md) node as shown here:
107122

108123
- **name**: Name of the property.
109124
- **display-name-key**: Display name of the property that is displayed on the UI.
110-
- **description-name-key**: Description of the property that is displayed on the UI.
111-
- **of-type-group**: The [of-type-group](manifest-schema-reference/type-group.md) is used when you want to have more than two data type columns. Add the [of-type-group](manifest-schema-reference/type-group.md) element as a sibling to the `property` element in the manifest. The `of-type-group` specifies the component value and can contain whole, currency, floating point, or decimal values.
125+
- **description-name-key**: Description of the property that is displayed on the UI.
126+
- **of-type-group**: Use the `of-type-group` attribute when you want refer to the name of a specific type group. Here, we are referring to the `type-group` named `numbers` created in the previous step.
112127
- **usage**: Has two properties, *bound* and *input*. Bound properties are bound only to the value of the column. Input properties are either bound to a column or allow a static value.
113128
- **required**: Defines whether the property is required.
114129

115130
```XML
116-
<property name="controlValue" display-name-key="controlValue_Display_Key" description-key="controlValue_Desc_Key" of-type-group="numbers" usage="bound" required="true" />
131+
<property name="controlValue"
132+
display-name-key="controlValue_Display_Key"
133+
description-key="controlValue_Desc_Key"
134+
of-type-group="numbers"
135+
usage="bound"
136+
required="true" />
117137
```
118138

119-
3. The [resources](manifest-schema-reference/resources.md) node defines the visualization of the code component. It contains all the resources that build the visualization and styling of the code component. The [code](manifest-schema-reference/code.md) is specified as a child element under the resources element. Define the [resources](manifest-schema-reference/resources.md) as shown here:
139+
1. The [resources](manifest-schema-reference/resources.md) node defines the visualization of the code component. It contains all the resources that build the visualization and styling of the code component. The [code](manifest-schema-reference/code.md) is specified as a child element under the resources element. Define the [resources](manifest-schema-reference/resources.md) as shown here:
120140

121141
- **code**: Refers to the path where all the resource files are located.
122142

123143
```XML
124144
<resources>
125-
<code path="index.ts" order="1" />
126-
<css path="css/LinearInputControl.css" order="1" />
145+
<code path="index.ts"
146+
order="1" />
147+
<css path="css/LinearInputControl.css"
148+
order="1" />
127149
</resources>
128150
```
129-
The overall manifest file should look something like this:
151+
152+
The completed manifest file should look like this:
130153

131154
```XML
132-
<?xml version="1.0" encoding="utf-8" ?>
133-
<manifest>
134-
<control namespace="SampleNamespace" constructor="LinearInputControl" version="1.1.0" display-name-key="LinearInputControl_Display_Key" description-key="LinearInputControl_Desc_Key" control-type="standard">
135-
<type-group name="numbers">
136-
<type>Whole.None</type>
137-
<type>Currency</type>
138-
<type>FP</type>
139-
<type>Decimal</type>
140-
</type-group>
141-
<property name="controlValue" display-name-key="controlValue_Display_Key" description-key="controlValue_Desc_Key" of-type-group="numbers" usage="bound" required="true" />
142-
<resources>
143-
<code path="index.ts" order="1" />
144-
<css path="css/LinearInputControl.css" order="1" />
145-
</resources>
146-
</control>
147-
</manifest>
155+
<?xml version="1.0" encoding="utf-8" ?>
156+
<manifest>
157+
<control namespace="SampleNamespace"
158+
constructor="LinearInputControl"
159+
version="1.1.0"
160+
display-name-key="LinearInputControl_Display_Key"
161+
description-key="LinearInputControl_Desc_Key"
162+
control-type="standard">
163+
<type-group name="numbers">
164+
<type>Whole.None</type>
165+
<type>Currency</type>
166+
<type>FP</type>
167+
<type>Decimal</type>
168+
</type-group>
169+
<property name="controlValue"
170+
display-name-key="controlValue_Display_Key"
171+
description-key="controlValue_Desc_Key"
172+
of-type-group="numbers"
173+
usage="bound"
174+
required="true" />
175+
<resources>
176+
<code path="index.ts"
177+
order="1" />
178+
<css path="css/LinearInputControl.css"
179+
order="1" />
180+
</resources>
181+
</control>
182+
</manifest>
148183
```
149184

150-
4. Save the changes to the `ControlManifest.Input.xml` file.
185+
1. Save the changes to the `ControlManifest.Input.xml` file.
186+
1. After making changes to the manifest, you will need to generate ManifestDesignTypes.d.ts file in this directory using the below command."
187+
188+
```
189+
npm run refreshTypes
190+
```
151191
152192
## Implementing component logic
153193
@@ -341,7 +381,12 @@ npm start watch
341381

342382
Follow these steps to create and import a [solution](../../maker/data-platform/solutions-overview.md) file:
343383

344-
1. Create a new folder **Solutions** inside the **LinearInputControl** folder and navigate into the folder.
384+
1. Create a new folder named **Solutions** inside the **LinearInputControl** folder and navigate into the folder.
385+
386+
```CLI
387+
mkdir Solutions
388+
cd Solutions
389+
```
345390

346391
2. Create a new solution project in the **LinearInputControl** folder using the [pac solution init](/power-platform/developer/cli/reference/solution#pac-solution-init) command:
347392

powerapps-docs/developer/component-framework/manifest-schema-reference/includes/type-table.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
|Value |Description |
22
|--|--|
3-
|Currency|Monetary values between -922,337,203,685,477 and 922,337,203,685,477 can be in this column. You can set a level of precision or choose to base the precision on a specific currency or a single standard precision used by the organization.|
3+
|Currency|Monetary values between -922,337,203,685,477 and 922,337,203,685,477 can be in this column.|
44
|DateAndTime.DateAndTime|Displays date and time.|
55
|DateAndTime.DateOnly|Displays date only.|
6-
|Decimal|Up to 10 decimal points of precision can be used for values between -100,000,000,000 and -100,000,000,000 can be in this column. You can specify the level of precision and the maximum and minimum values.|
6+
|Decimal|Up to 10 decimal points of precision can be used for values between -100,000,000,000 and -100,000,000,000 can be in this column.|
77
|Enum|Enumerated data type.|
8-
|FP|Up to 5 decimal points of precision can be used for values between -100,000,000,000 and -100,000,000,000 can be in this column. You can specify the level of precision and the maximum and minimum values. |
8+
|FP|Up to 5 decimal points of precision can be used for values between -100,000,000,000 and -100,000,000,000 can be in this column.|
99
|Lookup.Simple|Allows for a single reference to a specific table. All custom lookups are this type.|
10-
|Multiple|This column can contain up to 1,048,576 text characters. You can set the maximum length to be less than this. When you add this column to a form, you can specify the size of the column.|
10+
|Multiple|This column can contain up to 1,048,576 text characters.|
1111
|MultiSelectOptionSet|You can customize forms (main, quick create, and quick view) and email templates by adding choices columns. When you add choices column, you can specify multiple values that will be available for users to select. When users fill out the form they can select one, multiple, or all the values displayed in a drop-down list.|
1212
|Object|Object data type. Can only be used with output properties. |
1313
|OptionSet|This column provides a set of options. Each option has a number value and label. When added to a form, this column displays a control for users to select only one option. |
@@ -16,7 +16,7 @@
1616
|SingleLine.Text|This option simply displays text.|
1717
|SingleLine.TextArea|This format option can be used to display multiple lines of text. But with a limit of 4000 characters, the Multiple Lines of Text column is a better choice if large amounts of text are expected.|
1818
|SingleLine.Ticker|This stores the string time in the format valid for Ticker. Out-of-the-box Unified Interface controls automatically make them clickable links.|
19-
|SingleLine.___URL|The text expected to provides a hyperlink to open the page specified. Out-of-the-box Unified Interface controls automatically prepend https:// to input values that does not begin with a valid protocol . Only HTTP, HTTPS, FTP , FTPS, OneNote and TEL protocols are expected in this column. |
19+
|SingleLine.___URL|The text expected to provides a hyperlink to open the page specified. Out-of-the-box Unified Interface controls automatically prepend "https://" to input values that does not begin with a valid protocol . Only HTTP, HTTPS, FTP , FTPS, OneNote and TEL protocols are expected in this column. |
2020
|TwoOptions|This column provides two options. Each option has a number value of 0 or 1 corresponding to a false or true value. Each option also has a label so that true or false values can be represented as "Yes" and "No", "Hot" and "Cold", "On" and "Off" or any pair of labels you want to display.|
2121
|Whole.None|This option simply displays a number.|
2222

@@ -38,3 +38,6 @@ Following `of-type` property values are not supported currently:
3838
|Lookup.Regarding|Allows for a single reference to multiple tables. These lookups are found in the regarding column used in activities.|
3939
|Status|A system column that has options that generally correspond to active and inactive status. Some system columns have additional options, but all custom columns have only Active and Inactive status options.|
4040
|Status Reason|A system column that has options that provide additional detail about the Status column. Each option is associated with one of the available Status options. You can add and edit the options.|
41+
42+
> [!NOTE]
43+
> At this time File columns are not supported. More information: [File columns](../../../../maker/data-platform/types-of-fields.md#file-columns)

powerapps-docs/developer/component-framework/reference/webapi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ contributors:
1818

1919
## Available for
2020

21-
Model-driven apps, canvas apps, & portals.
21+
Model-driven apps & portals.
2222

2323
## Methods
2424

@@ -40,4 +40,4 @@ To learn more about how to implement the web API methods, see [Web API component
4040
[Power Apps component framework overview](../overview.md)
4141

4242

43-
[!INCLUDE[footer-include](../../../includes/footer-banner.md)]
43+
[!INCLUDE[footer-include](../../../includes/footer-banner.md)]

powerapps-docs/developer/component-framework/tutorial-create-canvas-dataset-component.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,19 +142,19 @@ After the component is built, you'll see that:
142142
When the code component uses React, there must be a single root component that's rendered within the `updateView` method. Inside the `CanvasGrid` folder, add a new TypeScript file named `Grid.tsx`, and add the following content:
143143

144144
```react
145-
import { DetailsList } from '@fluentui/react/lib/components/DetailsList/DetailsList';
145+
import { DetailsList } from '@fluentui/react/lib/DetailsList';
146146
import {
147147
ConstrainMode,
148148
DetailsListLayoutMode,
149149
IColumn,
150150
IDetailsHeaderProps,
151-
} from '@fluentui/react/lib/components/DetailsList/DetailsList.types';
152-
import { Overlay } from '@fluentui/react/lib/components/Overlay/Overlay';
153-
import { ScrollablePane } from '@fluentui/react/lib/components/ScrollablePane/ScrollablePane';
154-
import { ScrollbarVisibility } from '@fluentui/react/lib/components/ScrollablePane/ScrollablePane.types';
155-
import { Stack } from '@fluentui/react/lib/components/Stack/Stack';
156-
import { Sticky } from '@fluentui/react/lib/components/Sticky/Sticky';
157-
import { StickyPositionType } from '@fluentui/react/lib/components/Sticky/Sticky.types';
151+
} from '@fluentui/react/lib/DetailsList';
152+
import { Overlay } from '@fluentui/react/lib/Overlay';
153+
import { ScrollablePane } from '@fluentui/react/lib/ScrollablePane';
154+
import { ScrollbarVisibility } from '@fluentui/react/lib/ScrollablePane';
155+
import { Stack } from '@fluentui/react/lib/Stack';
156+
import { Sticky } from '@fluentui/react/lib/Sticky';
157+
import { StickyPositionType } from '@fluentui/react/lib/Sticky';
158158
import { IObjectWithKey } from '@fluentui/react/lib/Selection';
159159
import { IRenderFunction } from '@fluentui/react/lib/Utilities';
160160
import * as React from 'react';

powerapps-docs/developer/component-framework/tutorial-create-model-driven-field-component.md

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ title: "Create a model-driven app field component in Microsoft Dataverse | Micro
33
description: "In this tutorial, learn how to create a model-driven app field component, and deploy, configure, and test the component on a form using Visual Studio Code."
44
ms.author: noazarur
55
author: noazarur-microsoft
6-
manager: lwelicki
7-
ms.date: 05/27/2022
6+
ms.date: 12/21/2022
87
ms.reviewer: jdaly
98
ms.topic: tutorial
109
ms.subservice: pcf
1110
contributors:
1211
- JimDaly
1312
- v-scottdurow
13+
- kaushikkaul
1414
---
1515

1616

@@ -30,7 +30,7 @@ In addition to these, you'll also ensure the code component follows best practic
3030
3131
Before you start, make sure you've installed all the [prerequisite components](implementing-controls-using-typescript.md#prerequisites).
3232

33-
## Code
33+
## Code
3434

3535
You can download the complete sample from [here](https://github.com/microsoft/PowerApps-Samples/tree/master/component-framework/ChoicesPickerControl).
3636

@@ -42,16 +42,16 @@ To create a new `pcfproj`:
4242

4343
1. Open Visual Studio Code and navigate to **File** > **Open Folder** and then select the `ChoicesPicker` folder created in the previous step. If you've added the Windows Explorer extensions during the installation of Visual Studio Code, you can also use the **Open with Code** context menu option inside the folder. You can also add any folder into Visual Studio Code using `code .` in the command prompt when the current directory is set to that ___location.
4444

45-
1. Inside the new Visual Studio Code PowerShell terminal (**Terminal** > **New Terminal**), use the following command to create a new code component project:
45+
1. Inside the new Visual Studio Code PowerShell terminal (**Terminal** > **New Terminal**), use the [pac pcf init](/power-platform/developer/cli/reference/pcf#pac-pcf-init) command to create a new code component project:
4646

4747
```CLI
48-
pac pcf init --namespace SampleNamespace --name ChoicesPicker --template field
48+
pac pcf init --namespace SampleNamespace --name ChoicesPicker --template field --run-npm-install
4949
```
5050

5151
or using the short form:
5252

5353
```CLI
54-
pac pcf init -ns SampleNamespace -n ChoicesPicker -t field
54+
pac pcf init -ns SampleNamespace -n ChoicesPicker -t field -npm
5555
```
5656

5757
This adds a new `pcfproj` and related files to the current folder, including a `packages.json` that defines the required modules. The above command will also run `npm install` command for you to install the necessary modules.
@@ -95,8 +95,18 @@ The `ChoicesPicker\ControlManifest.Input.xml` file defines the metadata that des
9595
Open the `ChoicesPicker\ControlManifest.Input.xml` and paste the following inside the control element (replacing the existing **`sampleProperty`**):
9696

9797
```xml
98-
<property name="value" display-name-key="Value" description-key="Value of the Choices Control" of-type="OptionSet" usage="bound" required="true"/>
99-
<property name="configuration" display-name-key="Icon Mapping" description-key="Configuration that maps the choice value to a fluent ui icon." of-type="Multiple" usage="input" required="true"/>
98+
<property name="value"
99+
display-name-key="Value"
100+
description-key="Value of the Choices Control"
101+
of-type="OptionSet"
102+
usage="bound"
103+
required="true"/>
104+
<property name="configuration"
105+
display-name-key="Icon Mapping"
106+
description-key="Configuration that maps the choice value to a fluent ui icon."
107+
of-type="Multiple"
108+
usage="input"
109+
required="true"/>
100110
```
101111

102112
Save the changes and then use the following command to build the component:
@@ -671,14 +681,31 @@ If you want to support multiple languages, your code component can hold a resour
671681
```xml
672682
<?xml version="1.0" encoding="utf-8" ?>
673683
<manifest>
674-
<control namespace="SampleNamespace" constructor="ChoicesPicker" version="0.0.1" display-name-key="ChoicesPicker_Name" description-key="ChoicesPicker_Desc" control-type="standard" >
675-
<property name="value" display-name-key="Value_Name" description-key="Value_Desc" of-type="OptionSet" usage="bound" required="true"/>
676-
<property name="configuration" display-name-key="Configuration_Name" description-key="Configuration_Desc" of-type="Multiple" usage="input" required="true"/>
677-
<resources>
678-
<code path="index.ts" order="1"/>
679-
<resx path="strings/ChoicesPicker.1033.resx" version="1.0.0" />
680-
</resources>
681-
</control>
684+
<control namespace="SampleNamespace"
685+
constructor="ChoicesPicker"
686+
version="0.0.1"
687+
display-name-key="ChoicesPicker_Name"
688+
description-key="ChoicesPicker_Desc"
689+
control-type="standard">
690+
<property name="value"
691+
display-name-key="Value_Name"
692+
description-key="Value_Desc"
693+
of-type="OptionSet"
694+
usage="bound"
695+
required="true"/>
696+
<property name="configuration"
697+
display-name-key="Configuration_Name"
698+
description-key="Configuration_Desc"
699+
of-type="Multiple"
700+
usage="input"
701+
required="true"/>
702+
<resources>
703+
<code path="index.ts"
704+
order="1"/>
705+
<resx path="strings/ChoicesPicker.1033.resx"
706+
version="1.0.0" />
707+
</resources>
708+
</control>
682709
</manifest>
683710
```
684711

0 commit comments

Comments
 (0)