Squashed 'samples/react-enhanced-powerapps/' content from commit 7538cbce
git-subtree-dir: samples/react-enhanced-powerapps git-subtree-split: 7538cbce672763eafe5020af1898d15c2496dde3
This commit is contained in:
commit
ee0587c773
|
@ -0,0 +1,328 @@
|
|||
{
|
||||
"always-semicolon": true,
|
||||
"color-case": "lower",
|
||||
"block-indent": "\t",
|
||||
"color-shorthand": true,
|
||||
"element-case": "lower",
|
||||
"leading-zero": false,
|
||||
"quotes": "double",
|
||||
"sort-order-fallback": "abc",
|
||||
"space-before-colon": "",
|
||||
"space-after-colon": " ",
|
||||
"space-before-combinator": " ",
|
||||
"space-after-combinator": " ",
|
||||
"space-between-declarations": "\n",
|
||||
"space-before-opening-brace": "",
|
||||
"space-after-opening-brace": "\n",
|
||||
"space-after-selector-delimiter": "\n",
|
||||
"space-before-selector-delimiter": "",
|
||||
"space-before-closing-brace": "\n",
|
||||
"strip-spaces": true,
|
||||
"tab-size": true,
|
||||
"unitless-zero": true,
|
||||
"vendor-prefix-align": true,
|
||||
"sort-order": [
|
||||
[
|
||||
"$extend",
|
||||
"$include"
|
||||
],
|
||||
[
|
||||
"font",
|
||||
"font-family",
|
||||
"font-size",
|
||||
"font-weight",
|
||||
"font-style",
|
||||
"font-variant",
|
||||
"font-size-adjust",
|
||||
"font-stretch",
|
||||
"font-effect",
|
||||
"font-emphasize",
|
||||
"font-emphasize-position",
|
||||
"font-emphasize-style",
|
||||
"font-smooth",
|
||||
"line-height"
|
||||
],
|
||||
[
|
||||
"position",
|
||||
"z-index",
|
||||
"top",
|
||||
"right",
|
||||
"bottom",
|
||||
"left"
|
||||
],
|
||||
[
|
||||
"display",
|
||||
"visibility",
|
||||
"float",
|
||||
"clear",
|
||||
"overflow",
|
||||
"overflow-x",
|
||||
"overflow-y",
|
||||
"-ms-overflow-x",
|
||||
"-ms-overflow-y",
|
||||
"clip",
|
||||
"zoom",
|
||||
"flex-direction",
|
||||
"flex-order",
|
||||
"flex-pack",
|
||||
"flex-align"
|
||||
],
|
||||
[
|
||||
"-webkit-box-sizing",
|
||||
"-moz-box-sizing",
|
||||
"box-sizing",
|
||||
"width",
|
||||
"min-width",
|
||||
"max-width",
|
||||
"height",
|
||||
"min-height",
|
||||
"max-height",
|
||||
"margin",
|
||||
"margin-top",
|
||||
"margin-right",
|
||||
"margin-bottom",
|
||||
"margin-left",
|
||||
"padding",
|
||||
"padding-top",
|
||||
"padding-right",
|
||||
"padding-bottom",
|
||||
"padding-left"
|
||||
],
|
||||
[
|
||||
"table-layout",
|
||||
"empty-cells",
|
||||
"caption-side",
|
||||
"border-spacing",
|
||||
"border-collapse",
|
||||
"list-style",
|
||||
"list-style-position",
|
||||
"list-style-type",
|
||||
"list-style-image"
|
||||
],
|
||||
[
|
||||
"content",
|
||||
"quotes",
|
||||
"counter-reset",
|
||||
"counter-increment",
|
||||
"resize",
|
||||
"cursor",
|
||||
"-webkit-user-select",
|
||||
"-moz-user-select",
|
||||
"-ms-user-select",
|
||||
"user-select",
|
||||
"nav-index",
|
||||
"nav-up",
|
||||
"nav-right",
|
||||
"nav-down",
|
||||
"nav-left",
|
||||
"-webkit-transition",
|
||||
"-moz-transition",
|
||||
"-ms-transition",
|
||||
"-o-transition",
|
||||
"transition",
|
||||
"-webkit-transition-delay",
|
||||
"-moz-transition-delay",
|
||||
"-ms-transition-delay",
|
||||
"-o-transition-delay",
|
||||
"transition-delay",
|
||||
"-webkit-transition-timing-function",
|
||||
"-moz-transition-timing-function",
|
||||
"-ms-transition-timing-function",
|
||||
"-o-transition-timing-function",
|
||||
"transition-timing-function",
|
||||
"-webkit-transition-duration",
|
||||
"-moz-transition-duration",
|
||||
"-ms-transition-duration",
|
||||
"-o-transition-duration",
|
||||
"transition-duration",
|
||||
"-webkit-transition-property",
|
||||
"-moz-transition-property",
|
||||
"-ms-transition-property",
|
||||
"-o-transition-property",
|
||||
"transition-property",
|
||||
"-webkit-transform",
|
||||
"-moz-transform",
|
||||
"-ms-transform",
|
||||
"-o-transform",
|
||||
"transform",
|
||||
"-webkit-transform-origin",
|
||||
"-moz-transform-origin",
|
||||
"-ms-transform-origin",
|
||||
"-o-transform-origin",
|
||||
"transform-origin",
|
||||
"-webkit-animation",
|
||||
"-moz-animation",
|
||||
"-ms-animation",
|
||||
"-o-animation",
|
||||
"animation",
|
||||
"-webkit-animation-name",
|
||||
"-moz-animation-name",
|
||||
"-ms-animation-name",
|
||||
"-o-animation-name",
|
||||
"animation-name",
|
||||
"-webkit-animation-duration",
|
||||
"-moz-animation-duration",
|
||||
"-ms-animation-duration",
|
||||
"-o-animation-duration",
|
||||
"animation-duration",
|
||||
"-webkit-animation-play-state",
|
||||
"-moz-animation-play-state",
|
||||
"-ms-animation-play-state",
|
||||
"-o-animation-play-state",
|
||||
"animation-play-state",
|
||||
"-webkit-animation-timing-function",
|
||||
"-moz-animation-timing-function",
|
||||
"-ms-animation-timing-function",
|
||||
"-o-animation-timing-function",
|
||||
"animation-timing-function",
|
||||
"-webkit-animation-delay",
|
||||
"-moz-animation-delay",
|
||||
"-ms-animation-delay",
|
||||
"-o-animation-delay",
|
||||
"animation-delay",
|
||||
"-webkit-animation-iteration-count",
|
||||
"-moz-animation-iteration-count",
|
||||
"-ms-animation-iteration-count",
|
||||
"-o-animation-iteration-count",
|
||||
"animation-iteration-count",
|
||||
"-webkit-animation-direction",
|
||||
"-moz-animation-direction",
|
||||
"-ms-animation-direction",
|
||||
"-o-animation-direction",
|
||||
"animation-direction",
|
||||
"text-align",
|
||||
"-webkit-text-align-last",
|
||||
"-moz-text-align-last",
|
||||
"-ms-text-align-last",
|
||||
"text-align-last",
|
||||
"vertical-align",
|
||||
"white-space",
|
||||
"text-decoration",
|
||||
"text-emphasis",
|
||||
"text-emphasis-color",
|
||||
"text-emphasis-style",
|
||||
"text-emphasis-position",
|
||||
"text-indent",
|
||||
"-ms-text-justify",
|
||||
"text-justify",
|
||||
"letter-spacing",
|
||||
"word-spacing",
|
||||
"-ms-writing-mode",
|
||||
"text-outline",
|
||||
"text-transform",
|
||||
"text-wrap",
|
||||
"text-overflow",
|
||||
"-ms-text-overflow",
|
||||
"text-overflow-ellipsis",
|
||||
"text-overflow-mode",
|
||||
"-ms-word-wrap",
|
||||
"word-wrap",
|
||||
"word-break",
|
||||
"-ms-word-break",
|
||||
"-moz-tab-size",
|
||||
"-o-tab-size",
|
||||
"tab-size",
|
||||
"-webkit-hyphens",
|
||||
"-moz-hyphens",
|
||||
"hyphens",
|
||||
"pointer-events"
|
||||
],
|
||||
[
|
||||
"opacity",
|
||||
"filter:progid:DXImageTransform.Microsoft.Alpha(Opacity",
|
||||
"-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha",
|
||||
"-ms-interpolation-mode",
|
||||
"color",
|
||||
"border",
|
||||
"border-width",
|
||||
"border-style",
|
||||
"border-color",
|
||||
"border-top",
|
||||
"border-top-width",
|
||||
"border-top-style",
|
||||
"border-top-color",
|
||||
"border-right",
|
||||
"border-right-width",
|
||||
"border-right-style",
|
||||
"border-right-color",
|
||||
"border-bottom",
|
||||
"border-bottom-width",
|
||||
"border-bottom-style",
|
||||
"border-bottom-color",
|
||||
"border-left",
|
||||
"border-left-width",
|
||||
"border-left-style",
|
||||
"border-left-color",
|
||||
"-webkit-border-radius",
|
||||
"-moz-border-radius",
|
||||
"border-radius",
|
||||
"-webkit-border-top-left-radius",
|
||||
"-moz-border-radius-topleft",
|
||||
"border-top-left-radius",
|
||||
"-webkit-border-top-right-radius",
|
||||
"-moz-border-radius-topright",
|
||||
"border-top-right-radius",
|
||||
"-webkit-border-bottom-right-radius",
|
||||
"-moz-border-radius-bottomright",
|
||||
"border-bottom-right-radius",
|
||||
"-webkit-border-bottom-left-radius",
|
||||
"-moz-border-radius-bottomleft",
|
||||
"border-bottom-left-radius",
|
||||
"-webkit-border-image",
|
||||
"-moz-border-image",
|
||||
"-o-border-image",
|
||||
"border-image",
|
||||
"-webkit-border-image-source",
|
||||
"-moz-border-image-source",
|
||||
"-o-border-image-source",
|
||||
"border-image-source",
|
||||
"-webkit-border-image-slice",
|
||||
"-moz-border-image-slice",
|
||||
"-o-border-image-slice",
|
||||
"border-image-slice",
|
||||
"-webkit-border-image-width",
|
||||
"-moz-border-image-width",
|
||||
"-o-border-image-width",
|
||||
"border-image-width",
|
||||
"-webkit-border-image-outset",
|
||||
"-moz-border-image-outset",
|
||||
"-o-border-image-outset",
|
||||
"border-image-outset",
|
||||
"-webkit-border-image-repeat",
|
||||
"-moz-border-image-repeat",
|
||||
"-o-border-image-repeat",
|
||||
"border-image-repeat",
|
||||
"outline",
|
||||
"outline-width",
|
||||
"outline-style",
|
||||
"outline-color",
|
||||
"outline-offset",
|
||||
"background",
|
||||
"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader",
|
||||
"background-color",
|
||||
"background-image",
|
||||
"background-repeat",
|
||||
"background-attachment",
|
||||
"background-position",
|
||||
"background-position-x",
|
||||
"-ms-background-position-x",
|
||||
"background-position-y",
|
||||
"-ms-background-position-y",
|
||||
"-webkit-background-clip",
|
||||
"-moz-background-clip",
|
||||
"background-clip",
|
||||
"background-origin",
|
||||
"-webkit-background-size",
|
||||
"-moz-background-size",
|
||||
"-o-background-size",
|
||||
"background-size",
|
||||
"box-decoration-break",
|
||||
"-webkit-box-shadow",
|
||||
"-moz-box-shadow",
|
||||
"box-shadow",
|
||||
"filter:progid:DXImageTransform.Microsoft.gradient",
|
||||
"-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient",
|
||||
"text-shadow"
|
||||
]
|
||||
]
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
|
||||
[*]
|
||||
|
||||
# change these settings to your own preference
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# we recommend you to keep these unchanged
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[{package,bower}.json]
|
||||
indent_style = space
|
||||
indent_size = 2
|
|
@ -0,0 +1,104 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Microbundle cache
|
||||
.rpt2_cache/
|
||||
.rts2_cache_cjs/
|
||||
.rts2_cache_es/
|
||||
.rts2_cache_umd/
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
.env.test
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# Next.js build output
|
||||
.next
|
||||
|
||||
# Nuxt.js build / generate output
|
||||
.nuxt
|
||||
dist
|
||||
|
||||
# Gatsby files
|
||||
.cache/
|
||||
# Comment in the public line in if your project uses Gatsby and *not* Next.js
|
||||
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||
# public
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
|
||||
# TernJS port file
|
||||
.tern-port
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"extends": [
|
||||
"stylelint-config-standard",
|
||||
"stylelint-config-css-modules"
|
||||
],
|
||||
"plugins": [
|
||||
"stylelint-scss"
|
||||
],
|
||||
"rules": {
|
||||
"at-rule-no-unknown": null,
|
||||
"scss/at-rule-no-unknown": true
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"recommendations": [
|
||||
"msjsdiag.debugger-for-chrome"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
/**
|
||||
* Install Chrome Debugger Extension for Visual Studio Code to debug your components with the
|
||||
* Chrome browser: https://aka.ms/spfx-debugger-extensions
|
||||
*/
|
||||
"version": "0.2.0",
|
||||
"configurations": [{
|
||||
"name": "Local workbench",
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"url": "https://localhost:4321/temp/workbench.html",
|
||||
"webRoot": "${workspaceRoot}",
|
||||
"sourceMaps": true,
|
||||
"sourceMapPathOverrides": {
|
||||
"webpack:///.././src/*": "${webRoot}/src/*",
|
||||
"webpack:///../../../src/*": "${webRoot}/src/*",
|
||||
"webpack:///../../../../src/*": "${webRoot}/src/*",
|
||||
"webpack:///../../../../../src/*": "${webRoot}/src/*"
|
||||
},
|
||||
"runtimeArgs": [
|
||||
"--remote-debugging-port=9222"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Hosted workbench",
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx",
|
||||
"webRoot": "${workspaceRoot}",
|
||||
"sourceMaps": true,
|
||||
"sourceMapPathOverrides": {
|
||||
"webpack:///.././src/*": "${webRoot}/src/*",
|
||||
"webpack:///../../../src/*": "${webRoot}/src/*",
|
||||
"webpack:///../../../../src/*": "${webRoot}/src/*",
|
||||
"webpack:///../../../../../src/*": "${webRoot}/src/*"
|
||||
},
|
||||
"runtimeArgs": [
|
||||
"--remote-debugging-port=9222",
|
||||
"-incognito"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
// Place your settings in this file to overwrite default and user settings.
|
||||
{
|
||||
// Configure glob patterns for excluding files and folders in the file explorer.
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/bower_components": true,
|
||||
"**/coverage": true,
|
||||
"**/lib-amd": true,
|
||||
"src/**/*.scss.ts": true
|
||||
},
|
||||
"typescript.tsdk": ".\\node_modules\\typescript\\lib"
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"@pnp/generator-spfx": {
|
||||
"framework": "react",
|
||||
"pnpFramework": "reactjs.plus",
|
||||
"pnp-libraries": [
|
||||
"@pnp/spfx-property-controls",
|
||||
"@pnp/spfx-controls-react",
|
||||
"rush@3.3"
|
||||
],
|
||||
"pnp-ci": "no-devops",
|
||||
"pnp-vetting": [
|
||||
"webpack-analyzer",
|
||||
"stylelint",
|
||||
"csscomb"
|
||||
],
|
||||
"spfxenv": "spo",
|
||||
"pnp-testing": []
|
||||
},
|
||||
"@microsoft/generator-sharepoint": {
|
||||
"environment": "spo",
|
||||
"framework": "react",
|
||||
"isCreatingSolution": true,
|
||||
"version": "1.11.0",
|
||||
"libraryName": "react-enhanced-powerapps",
|
||||
"libraryId": "601b7688-1e9c-468c-b9a3-e4bb4e14edcd",
|
||||
"packageManager": "npm",
|
||||
"isDomainIsolated": false,
|
||||
"componentType": "webpart"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2020 Hugo Bernier
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -0,0 +1,113 @@
|
|||
|
||||
|
||||
# react-enhanced-powerapps
|
||||
|
||||
## Summary
|
||||
|
||||
Sample web part showing how to embed a Power App that resizes, adapts to themes, and supports dynamic properties
|
||||
|
||||
![Enhanced Power Apps in Action](./assets/enhanced-power-apps.gif)
|
||||
|
||||
## Used SharePoint Framework Version
|
||||
|
||||
![1.11.0](https://img.shields.io/badge/version-1.11.0-green.svg)
|
||||
|
||||
## Applies to
|
||||
|
||||
* [SharePoint Framework](https://docs.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
|
||||
* [Office 365 tenant](https://docs.microsoft.com/sharepoint/dev/spfx/set-up-your-development-environment)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
You'll need at least one application in Power Apps that you wish to embed in SharePoint.
|
||||
|
||||
## Solution
|
||||
|
||||
Solution|Author(s)
|
||||
--------|---------
|
||||
react-enhanced-powerapps | Hugo Bernier ([Tahoe Ninjas](http://tahoeninjas.blog/), [@bernierh](https://twitter.com/bernierh))
|
||||
|
||||
## Version history
|
||||
|
||||
Version|Date|Comments
|
||||
-------|----|--------
|
||||
1.0|July 27, 2020|Initial release
|
||||
|
||||
## Disclaimer
|
||||
|
||||
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
|
||||
|
||||
---
|
||||
|
||||
## Minimal Path to Awesome
|
||||
|
||||
* Clone this repository
|
||||
* in the command line run:
|
||||
* `npm install`
|
||||
* `gulp serve`
|
||||
|
||||
### To Use
|
||||
|
||||
* Create a Power App
|
||||
* In your app's **Settings** page (under **File | Settings** ), select the application size that suits your needs best
|
||||
![Application size](./assets/sizeoptions.png).
|
||||
* Make sure to keep **Scale to fit** on
|
||||
* Once your app is saved and published, go to make.powerapps.com and find the **App ID** by browsing to **Apps**, selecting the app you wish to embed (*select it*, don't *launch it*) and viewing **Details**
|
||||
* In the app details page, find the **Web link** or **App ID** and copy it.
|
||||
![Add web link or app id](./assets/step1-5.png).
|
||||
* Add the **Enhanced Power Apps** web part to a page.
|
||||
* In the web part's property pane, paste the value you copied in the **App web link or ID** field.
|
||||
* In the **Appearance** group, select **Maintain aspect** for the **Resize behavior** and select the **Aspect ratio** that matches the application size you selected earlier
|
||||
![Appearance](./assets/step2.png)
|
||||
|
||||
You can also use dynamic properties to pass values from another web part on the page (or page context information) to Power Apps and/or make your app change colors to match the SharePoint page theme and section color.
|
||||
|
||||
## Features
|
||||
|
||||
This web part was created because the out-of-the-box Power Apps web part was missing some features that were important to me.
|
||||
|
||||
This Web Part illustrates the following concepts on top of the SharePoint Framework:
|
||||
|
||||
* Theme awareness
|
||||
* Context awareness
|
||||
* Dynamic data
|
||||
* Property Pane HTML
|
||||
|
||||
### Theme Awareness
|
||||
|
||||
The sample demonstrates how to react to changing theme colors and section background colors. It can pass theme colors to the embedded Power Apps application.
|
||||
|
||||
If you want to use a color within Power Apps, simply use `Param()` to retrieve the value that is passed to Power Apps as a parameter, then use `ColorValue()` to convert the string value to a color Power Apps can use.
|
||||
|
||||
For example, if you select to pass the `bodyText` theme color, you can use the following expression within Power Apps to set the text color to match the SharePoint text color:
|
||||
|
||||
```
|
||||
ColorValue(Param('bodyText'))
|
||||
```
|
||||
|
||||
Remember that parameters are _case-sensitive_ in Power Apps. In the example above, make sure that you use `bodyText`, not `bodytext`.
|
||||
|
||||
### Dynamic Properties
|
||||
|
||||
This web part is a _dynamic property consumer_. For example, you can bind the Enhanced Power Apps web part to a list/document library web part on the page and make your Power App display information about the currently selected item in your list/document library.
|
||||
|
||||
To configure it, follow these steps:
|
||||
|
||||
* Add a **List** or **Document Library** web part on the page where your **Enhanced Power Apps** web part is located.
|
||||
* In your **Enhanced Power Apps** web part's property pane, expand the **Dynamic Properties** group
|
||||
![Select the Dynamic Properties group](./assets/dpstep1.png)
|
||||
* Turn on **Pass dynamic property as parameter?**
|
||||
* Under **Dynamic property source** configure the following properties:
|
||||
- For **Connect to Source** select your list/document library web part name
|
||||
- In the **[Your web part name]'s properties** select **Column containing the filter value**
|
||||
- In the **Column containing the filter value**, select the column that has the value you'd like to pass to Power Apps
|
||||
- In the **Parameter name** field, enter the parameter name that you'll want to use within Power Apps to retrieve this value. For example, if you selected the `ID` field, type `ID`.
|
||||
- Within Power Apps, use `Param()` and the parameter name you specified above. For example, if you specified `ID` above, you'll want to use `Param('ID')` within Power Apps to retrieve the value. Remember that parameter names are _case-sensitive_.
|
||||
|
||||
Note that the web part always sends the current page's locale to Power Apps via the `locale` parameter. You can use this value to create multi-language apps.
|
||||
|
||||
### Property Pane HTML
|
||||
|
||||
This sample includes a `PropertyPaneHTML` control that you can use to embed custom HTML in a property pane. I use it to highlight syntax using the `<pre>` tag and to make text bold.
|
||||
|
||||
<img src="https://telemetry.sharepointpnp.com/sp-dev-fx-webparts/samples/react-enhanced-powerapps" />
|
Binary file not shown.
After Width: | Height: | Size: 85 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.7 MiB |
Binary file not shown.
After Width: | Height: | Size: 258 KiB |
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
|
||||
"version": "2.0",
|
||||
"bundles": {
|
||||
"enhanced-power-apps-web-part": {
|
||||
"components": [
|
||||
{
|
||||
"entrypoint": "./lib/webparts/enhancedPowerApps/EnhancedPowerAppsWebPart.js",
|
||||
"manifest": "./src/webparts/enhancedPowerApps/EnhancedPowerAppsWebPart.manifest.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"externals": {},
|
||||
"localizedResources": {
|
||||
"EnhancedPowerAppsWebPartStrings": "lib/webparts/enhancedPowerApps/loc/{locale}.js",
|
||||
"ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js",
|
||||
"PropertyControlStrings": "node_modules/@pnp/spfx-property-controls/lib/loc/{locale}.js"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/copy-assets.schema.json",
|
||||
"deployCdnPath": "temp/deploy"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
|
||||
"workingDir": "./temp/deploy/",
|
||||
"account": "<!-- STORAGE ACCOUNT NAME -->",
|
||||
"container": "react-enhanced-powerapps",
|
||||
"accessKey": "<!-- ACCESS KEY -->"
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
|
||||
"solution": {
|
||||
"name": "react-enhanced-powerapps-client-side-solution",
|
||||
"id": "601b7688-1e9c-468c-b9a3-e4bb4e14edcd",
|
||||
"version": "1.0.0.0",
|
||||
"includeClientSideAssets": true,
|
||||
"isDomainIsolated": false,
|
||||
"developer": {
|
||||
"name": "",
|
||||
"websiteUrl": "",
|
||||
"privacyUrl": "",
|
||||
"termsOfUseUrl": "",
|
||||
"mpnId": ""
|
||||
}
|
||||
},
|
||||
"paths": {
|
||||
"zippedPackage": "solution/react-enhanced-powerapps.sppkg"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json",
|
||||
"port": 4321,
|
||||
"https": true,
|
||||
"initialPage": "https://localhost:5432/workbench",
|
||||
"api": {
|
||||
"port": 5432,
|
||||
"entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json",
|
||||
"cdnBasePath": "<!-- PATH TO CDN -->"
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
'use strict';
|
||||
|
||||
// check if gulp dist was called
|
||||
if (process.argv.indexOf('dist') !== -1) {
|
||||
// add ship options to command call
|
||||
process.argv.push('--ship');
|
||||
}
|
||||
|
||||
const path = require('path');
|
||||
const gulp = require('gulp');
|
||||
const build = require('@microsoft/sp-build-web');
|
||||
const gulpSequence = require('gulp-sequence');
|
||||
|
||||
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);
|
||||
|
||||
// Create clean distrubution package
|
||||
gulp.task('dist', gulpSequence('clean', 'bundle', 'package-solution'));
|
||||
// Create clean development package
|
||||
gulp.task('dev', gulpSequence('clean', 'bundle', 'package-solution'));
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Webpack Bundle Anlayzer
|
||||
* Reference and gulp task
|
||||
*/
|
||||
if (process.argv.indexOf('--analyze') !== -1 ||
|
||||
process.argv.indexOf('dist') !== -1 ||
|
||||
process.argv.indexOf('dev') !== -1) {
|
||||
|
||||
const bundleAnalyzer = require('webpack-bundle-analyzer');
|
||||
|
||||
build.configureWebpack.mergeConfig({
|
||||
|
||||
additionalConfiguration: (generatedConfiguration) => {
|
||||
const lastDirName = path.basename(__dirname);
|
||||
const dropPath = path.join(__dirname, 'temp', 'stats');
|
||||
generatedConfiguration.plugins.push(new bundleAnalyzer.BundleAnalyzerPlugin({
|
||||
openAnalyzer: false,
|
||||
analyzerMode: 'static',
|
||||
reportFilename: path.join(dropPath, `${lastDirName}.stats.html`),
|
||||
generateStatsFile: true,
|
||||
statsFilename: path.join(dropPath, `${lastDirName}.stats.json`),
|
||||
logLevel: 'error'
|
||||
}));
|
||||
|
||||
return generatedConfiguration;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* StyleLinter configuration
|
||||
* Reference and custom gulp task
|
||||
*/
|
||||
const stylelint = require('gulp-stylelint');
|
||||
|
||||
/* Stylelinter sub task */
|
||||
let styleLintSubTask = build.subTask('stylelint', (gulp) => {
|
||||
|
||||
|
||||
return gulp
|
||||
.src('src/**/*.scss')
|
||||
.pipe(stylelint({
|
||||
failAfterError: false,
|
||||
reporters: [{
|
||||
formatter: 'string',
|
||||
console: true
|
||||
}]
|
||||
}));
|
||||
});
|
||||
/* end sub task */
|
||||
|
||||
build.rig.addPreBuildTask(styleLintSubTask);
|
||||
|
||||
/**
|
||||
* Custom Framework Specific gulp tasks
|
||||
*/
|
||||
|
||||
|
||||
build.initialize(gulp);
|
|
@ -0,0 +1,4 @@
|
|||
export interface IPropertyPaneHTMLHostProps {
|
||||
html: string;
|
||||
}
|
||||
//# sourceMappingURL=IPropertyPaneHTMLHostProps.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"IPropertyPaneHTMLHostProps.d.ts","sourceRoot":"","sources":["../../../src/controls/PropertyPaneHTML/IPropertyPaneHTMLHostProps.tsx"],"names":[],"mappings":"AACA,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@ -0,0 +1 @@
|
|||
//# sourceMappingURL=IPropertyPaneHTMLHostProps.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"IPropertyPaneHTMLHostProps.js","sourceRoot":"","sources":["../../../src/controls/PropertyPaneHTML/IPropertyPaneHTMLHostProps.tsx"],"names":[],"mappings":""}
|
|
@ -0,0 +1,5 @@
|
|||
import { IPropertyPaneCustomFieldProps } from "@microsoft/sp-property-pane";
|
||||
import { IPropertyPaneHTMLProps } from "./IPropertyPaneHTMLProps";
|
||||
export interface IPropertyPaneHTMLInternalProps extends IPropertyPaneHTMLProps, IPropertyPaneCustomFieldProps {
|
||||
}
|
||||
//# sourceMappingURL=IPropertyPaneHTMLInternalProps.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"IPropertyPaneHTMLInternalProps.d.ts","sourceRoot":"","sources":["../../../src/controls/PropertyPaneHTML/IPropertyPaneHTMLInternalProps.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,MAAM,WAAW,8BAA+B,SAAQ,sBAAsB,EAAE,6BAA6B;CAC5G"}
|
|
@ -0,0 +1 @@
|
|||
//# sourceMappingURL=IPropertyPaneHTMLInternalProps.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"IPropertyPaneHTMLInternalProps.js","sourceRoot":"","sources":["../../../src/controls/PropertyPaneHTML/IPropertyPaneHTMLInternalProps.ts"],"names":[],"mappings":""}
|
|
@ -0,0 +1,5 @@
|
|||
export interface IPropertyPaneHTMLProps {
|
||||
key: string;
|
||||
html: string;
|
||||
}
|
||||
//# sourceMappingURL=IPropertyPaneHTMLProps.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"IPropertyPaneHTMLProps.d.ts","sourceRoot":"","sources":["../../../src/controls/PropertyPaneHTML/IPropertyPaneHTMLProps.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@ -0,0 +1 @@
|
|||
//# sourceMappingURL=IPropertyPaneHTMLProps.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"IPropertyPaneHTMLProps.js","sourceRoot":"","sources":["../../../src/controls/PropertyPaneHTML/IPropertyPaneHTMLProps.ts"],"names":[],"mappings":""}
|
|
@ -0,0 +1,16 @@
|
|||
import { IPropertyPaneField, PropertyPaneFieldType } from "@microsoft/sp-property-pane";
|
||||
import { IPropertyPaneHTMLProps } from './IPropertyPaneHTMLProps';
|
||||
import { IPropertyPaneHTMLInternalProps } from './IPropertyPaneHTMLInternalProps';
|
||||
export declare class PropertyPaneHTMLBuilder implements IPropertyPaneField<IPropertyPaneHTMLProps> {
|
||||
type: PropertyPaneFieldType;
|
||||
properties: IPropertyPaneHTMLInternalProps;
|
||||
private elem;
|
||||
targetProperty: string;
|
||||
shouldFocus?: boolean;
|
||||
constructor(properties: IPropertyPaneHTMLProps);
|
||||
render(): void;
|
||||
private onDispose;
|
||||
private onRender;
|
||||
}
|
||||
export declare function PropertyPaneHTML(properties: IPropertyPaneHTMLProps): IPropertyPaneField<IPropertyPaneHTMLProps>;
|
||||
//# sourceMappingURL=PropertyPaneHTML.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"PropertyPaneHTML.d.ts","sourceRoot":"","sources":["../../../src/controls/PropertyPaneHTML/PropertyPaneHTML.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAGlF,qBAAa,uBAAwB,YAAW,kBAAkB,CAAC,sBAAsB,CAAC;IACjF,IAAI,EAAE,qBAAqB,CAAgC;IAC3D,UAAU,EAAE,8BAA8B,CAAC;IAClD,OAAO,CAAC,IAAI,CAAc;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;gBAEjB,UAAU,EAAE,sBAAsB;IAUvC,MAAM,IAAI,IAAI;IAQrB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,QAAQ;CAcjB;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,sBAAsB,GAAG,kBAAkB,CAAC,sBAAsB,CAAC,CAE/G"}
|
|
@ -0,0 +1,42 @@
|
|||
import * as React from 'react';
|
||||
import * as ReactDom from 'react-dom';
|
||||
import { PropertyPaneFieldType } from "@microsoft/sp-property-pane";
|
||||
import PropertyPaneHTMLHost from './PropertyPaneHTMLHost';
|
||||
var PropertyPaneHTMLBuilder = /** @class */ (function () {
|
||||
function PropertyPaneHTMLBuilder(properties) {
|
||||
this.type = PropertyPaneFieldType.Custom;
|
||||
this.properties = {
|
||||
key: properties.key,
|
||||
html: properties.html,
|
||||
onRender: this.onRender.bind(this),
|
||||
onDispose: this.onDispose.bind(this)
|
||||
};
|
||||
}
|
||||
PropertyPaneHTMLBuilder.prototype.render = function () {
|
||||
if (!this.elem) {
|
||||
return;
|
||||
}
|
||||
this.onRender(this.elem);
|
||||
};
|
||||
PropertyPaneHTMLBuilder.prototype.onDispose = function (element) {
|
||||
ReactDom.unmountComponentAtNode(element);
|
||||
};
|
||||
PropertyPaneHTMLBuilder.prototype.onRender = function (elem) {
|
||||
if (!this.elem) {
|
||||
this.elem = elem;
|
||||
}
|
||||
var content = {
|
||||
__dangerousHTML: this.properties.html
|
||||
};
|
||||
var element = React.createElement(PropertyPaneHTMLHost, {
|
||||
html: this.properties.html
|
||||
});
|
||||
ReactDom.render(element, elem);
|
||||
};
|
||||
return PropertyPaneHTMLBuilder;
|
||||
}());
|
||||
export { PropertyPaneHTMLBuilder };
|
||||
export function PropertyPaneHTML(properties) {
|
||||
return new PropertyPaneHTMLBuilder(properties);
|
||||
}
|
||||
//# sourceMappingURL=PropertyPaneHTML.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"PropertyPaneHTML.js","sourceRoot":"","sources":["../../../src/controls/PropertyPaneHTML/PropertyPaneHTML.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,EAAsB,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGxF,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D;IAOE,iCAAY,UAAkC;QANvC,SAAI,GAA0B,qBAAqB,CAAC,MAAM,CAAC;QAOhE,IAAI,CAAC,UAAU,GAAG;YACd,GAAG,EAAE,UAAU,CAAC,GAAG;YACnB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;YAClC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;SACvC,CAAC;IACJ,CAAC;IAGM,wCAAM,GAAb;QACE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACd,OAAO;SACR;QAED,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAEO,2CAAS,GAAjB,UAAkB,OAAoB;QACpC,QAAQ,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAEO,0CAAQ,GAAhB,UAAiB,IAAiB;QAChC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;SAClB;QAED,IAAM,OAAO,GAAG;YACd,eAAe,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI;SACtC,CAAC;QAEF,IAAM,OAAO,GAAuB,KAAK,CAAC,aAAa,CAAC,oBAAoB,EAAC;YAC3E,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI;SAC3B,CAAC,CAAC;QACH,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IACH,8BAAC;AAAD,CAAC,AA3CD,IA2CC;;AAED,MAAM,UAAU,gBAAgB,CAAC,UAAkC;IAClE,OAAO,IAAI,uBAAuB,CAAC,UAAU,CAAC,CAAC;AAChD,CAAC"}
|
|
@ -0,0 +1,6 @@
|
|||
import * as React from 'react';
|
||||
import { IPropertyPaneHTMLHostProps } from './IPropertyPaneHTMLHostProps';
|
||||
export default class PropertyPaneHTMLHost extends React.Component<IPropertyPaneHTMLHostProps> {
|
||||
render(): JSX.Element;
|
||||
}
|
||||
//# sourceMappingURL=PropertyPaneHTMLHost.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"PropertyPaneHTMLHost.d.ts","sourceRoot":"","sources":["../../../src/controls/PropertyPaneHTML/PropertyPaneHTMLHost.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,KAAK,CAAC,SAAS,CAAC,0BAA0B,CAAC;IAEpF,MAAM,IAAI,GAAG,CAAC,OAAO;CAK7B"}
|
|
@ -0,0 +1,26 @@
|
|||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
import * as React from 'react';
|
||||
var PropertyPaneHTMLHost = /** @class */ (function (_super) {
|
||||
__extends(PropertyPaneHTMLHost, _super);
|
||||
function PropertyPaneHTMLHost() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PropertyPaneHTMLHost.prototype.render = function () {
|
||||
return (React.createElement("div", { dangerouslySetInnerHTML: { __html: this.props.html } }));
|
||||
};
|
||||
return PropertyPaneHTMLHost;
|
||||
}(React.Component));
|
||||
export default PropertyPaneHTMLHost;
|
||||
//# sourceMappingURL=PropertyPaneHTMLHost.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"PropertyPaneHTMLHost.js","sourceRoot":"","sources":["../../../src/controls/PropertyPaneHTML/PropertyPaneHTMLHost.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;IAAkD,wCAA2C;IAA7F;;IAOA,CAAC;IALQ,qCAAM,GAAb;QACE,OAAO,CACD,6BAAK,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,GAAQ,CACtE,CAAC;IACJ,CAAC;IACH,2BAAC;AAAD,CAAC,AAPD,CAAkD,KAAK,CAAC,SAAS,GAOhE"}
|
|
@ -0,0 +1 @@
|
|||
//# sourceMappingURL=index.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/controls/PropertyPaneHTML/index.ts"],"names":[],"mappings":""}
|
|
@ -0,0 +1 @@
|
|||
//# sourceMappingURL=index.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controls/PropertyPaneHTML/index.ts"],"names":[],"mappings":""}
|
|
@ -0,0 +1,29 @@
|
|||
import { IPropertyPaneCustomFieldProps } from "@microsoft/sp-property-pane";
|
||||
import { IMarkdownProps } from 'markdown-to-jsx';
|
||||
export interface IPropertyPaneMarkdownContentProps {
|
||||
/**
|
||||
* Property field label displayed on top
|
||||
*/
|
||||
label?: string;
|
||||
/**
|
||||
* Optional CSS style to apply to markdown
|
||||
*/
|
||||
className?: string;
|
||||
/**
|
||||
* An UNIQUE key indicates the identity of this control
|
||||
*/
|
||||
key: string;
|
||||
/**
|
||||
* The markdown text you wish to display
|
||||
*/
|
||||
markdown: string;
|
||||
/**
|
||||
* Allows you to override the markdown behavior,
|
||||
* such as overriding CSS styles and elements for
|
||||
* markdown elements.
|
||||
*/
|
||||
markdownProps?: IMarkdownProps;
|
||||
}
|
||||
export interface IPropertyPaneMarkdownContentPropsInternal extends IPropertyPaneMarkdownContentProps, IPropertyPaneCustomFieldProps {
|
||||
}
|
||||
//# sourceMappingURL=IPropertyPaneMarkdownContent.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"IPropertyPaneMarkdownContent.d.ts","sourceRoot":"","sources":["../../../src/controls/PropertyPaneMarkdownContent/IPropertyPaneMarkdownContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC;CAChC;AAED,MAAM,WAAW,yCAA0C,SAAQ,iCAAiC,EAAE,6BAA6B;CAClI"}
|
|
@ -0,0 +1 @@
|
|||
//# sourceMappingURL=IPropertyPaneMarkdownContent.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"IPropertyPaneMarkdownContent.js","sourceRoot":"","sources":["../../../src/controls/PropertyPaneMarkdownContent/IPropertyPaneMarkdownContent.ts"],"names":[],"mappings":""}
|
8
lib/controls/PropertyPaneMarkdownContent/IPropertyPaneMarkdownContentHost.d.ts
vendored
Normal file
8
lib/controls/PropertyPaneMarkdownContent/IPropertyPaneMarkdownContentHost.d.ts
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { IMarkdownProps } from 'markdown-to-jsx';
|
||||
export interface IPropertyPaneMarkdownContentHostProps {
|
||||
className?: string;
|
||||
description?: string;
|
||||
markdown: string;
|
||||
markdownProps: IMarkdownProps;
|
||||
}
|
||||
//# sourceMappingURL=IPropertyPaneMarkdownContentHost.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"IPropertyPaneMarkdownContentHost.d.ts","sourceRoot":"","sources":["../../../src/controls/PropertyPaneMarkdownContent/IPropertyPaneMarkdownContentHost.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,qCAAqC;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,cAAc,CAAC;CAE/B"}
|
|
@ -0,0 +1 @@
|
|||
//# sourceMappingURL=IPropertyPaneMarkdownContentHost.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"IPropertyPaneMarkdownContentHost.js","sourceRoot":"","sources":["../../../src/controls/PropertyPaneMarkdownContent/IPropertyPaneMarkdownContentHost.ts"],"names":[],"mappings":""}
|
|
@ -0,0 +1,11 @@
|
|||
import { IPropertyPaneMarkdownContentProps } from "./IPropertyPaneMarkdownContent";
|
||||
import { IPropertyPaneField } from "@microsoft/sp-property-pane";
|
||||
/**
|
||||
* Creates a property pane section that displays read-only markdown content.
|
||||
* Use this property pane control to display additional instructions, help
|
||||
* screens, etc.
|
||||
*
|
||||
* @param properties
|
||||
*/
|
||||
export declare function PropertyPaneMarkdownContent(properties: IPropertyPaneMarkdownContentProps): IPropertyPaneField<IPropertyPaneMarkdownContentProps>;
|
||||
//# sourceMappingURL=PropertyPaneMarkdownContent.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"PropertyPaneMarkdownContent.d.ts","sourceRoot":"","sources":["../../../src/controls/PropertyPaneMarkdownContent/PropertyPaneMarkdownContent.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iCAAiC,EAA6C,MAAM,gCAAgC,CAAC;AAG9H,OAAO,EAAE,kBAAkB,EAAyB,MAAM,6BAA6B,CAAC;AAyCxF;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,iCAAiC,GAAG,kBAAkB,CAAC,iCAAiC,CAAC,CAEhJ"}
|
|
@ -0,0 +1,45 @@
|
|||
import * as React from 'react';
|
||||
import * as ReactDom from 'react-dom';
|
||||
import PropertyPaneMarkdownContentHost from './PropertyPaneMarkdownContentHost';
|
||||
import { PropertyPaneFieldType } from "@microsoft/sp-property-pane";
|
||||
var PropertyPaneMarkdownContentBuilder = /** @class */ (function () {
|
||||
function PropertyPaneMarkdownContentBuilder(_properties) {
|
||||
this.type = PropertyPaneFieldType.Custom;
|
||||
this.properties = {
|
||||
key: _properties.key,
|
||||
label: _properties.label,
|
||||
markdown: _properties.markdown,
|
||||
markdownProps: _properties.markdownProps,
|
||||
onRender: this.onRender.bind(this),
|
||||
};
|
||||
}
|
||||
PropertyPaneMarkdownContentBuilder.prototype.render = function () {
|
||||
if (!this.elem) {
|
||||
return;
|
||||
}
|
||||
this.onRender(this.elem);
|
||||
};
|
||||
PropertyPaneMarkdownContentBuilder.prototype.onRender = function (elem, ctx, changeCallback) {
|
||||
if (!this.elem) {
|
||||
this.elem = elem;
|
||||
}
|
||||
var element = React.createElement(PropertyPaneMarkdownContentHost, {
|
||||
description: this.properties.label,
|
||||
markdown: this.properties.markdown,
|
||||
markdownProps: this.properties.markdownProps
|
||||
});
|
||||
ReactDom.render(element, elem);
|
||||
};
|
||||
return PropertyPaneMarkdownContentBuilder;
|
||||
}());
|
||||
/**
|
||||
* Creates a property pane section that displays read-only markdown content.
|
||||
* Use this property pane control to display additional instructions, help
|
||||
* screens, etc.
|
||||
*
|
||||
* @param properties
|
||||
*/
|
||||
export function PropertyPaneMarkdownContent(properties) {
|
||||
return new PropertyPaneMarkdownContentBuilder(properties);
|
||||
}
|
||||
//# sourceMappingURL=PropertyPaneMarkdownContent.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"PropertyPaneMarkdownContent.js","sourceRoot":"","sources":["../../../src/controls/PropertyPaneMarkdownContent/PropertyPaneMarkdownContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AAItC,OAAO,+BAA+B,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAsB,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAExF;IAQC,4CAAmB,WAA8C;QAL1D,SAAI,GAA0B,qBAAqB,CAAC,MAAM,CAAC;QAMjE,IAAI,CAAC,UAAU,GAAG;YACjB,GAAG,EAAE,WAAW,CAAC,GAAG;YACjB,KAAK,EAAE,WAAW,CAAC,KAAK;YACxB,QAAQ,EAAE,WAAW,CAAC,QAAQ;YAC9B,aAAa,EAAE,WAAW,CAAC,aAAa;YACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;SACrC,CAAC;IACH,CAAC;IAEM,mDAAM,GAAb;QACC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACf,OAAO;SACP;QACD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAEO,qDAAQ,GAAhB,UAAiB,IAAiB,EAAE,GAAS,EAAE,cAAkE;QAChH,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;SACjB;QAED,IAAM,OAAO,GAA8D,KAAK,CAAC,aAAa,CAAC,+BAA+B,EAAE;YAC5H,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK;YAClC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ;YAClC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,aAAa;SAC/C,CAAC,CAAC;QACH,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IACF,yCAAC;AAAD,CAAC,AArCD,IAqCC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CAAC,UAA6C;IACxF,OAAO,IAAI,kCAAkC,CAAC,UAAU,CAAC,CAAC;AAC3D,CAAC"}
|
6
lib/controls/PropertyPaneMarkdownContent/PropertyPaneMarkdownContentHost.d.ts
vendored
Normal file
6
lib/controls/PropertyPaneMarkdownContent/PropertyPaneMarkdownContentHost.d.ts
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
import * as React from 'react';
|
||||
import { IPropertyPaneMarkdownContentHostProps } from './IPropertyPaneMarkdownContentHost';
|
||||
export default class PropertyPaneMarkdownContentHost extends React.Component<IPropertyPaneMarkdownContentHostProps> {
|
||||
render(): JSX.Element;
|
||||
}
|
||||
//# sourceMappingURL=PropertyPaneMarkdownContentHost.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"PropertyPaneMarkdownContentHost.d.ts","sourceRoot":"","sources":["../../../src/controls/PropertyPaneMarkdownContent/PropertyPaneMarkdownContentHost.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qCAAqC,EAAE,MAAM,oCAAoC,CAAC;AAG3F,MAAM,CAAC,OAAO,OAAO,+BAAgC,SAAQ,KAAK,CAAC,SAAS,CAAC,qCAAqC,CAAC;IAE1G,MAAM,IAAI,GAAG,CAAC,OAAO;CAa7B"}
|
|
@ -0,0 +1,30 @@
|
|||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
import * as React from 'react';
|
||||
import Markdown from 'markdown-to-jsx';
|
||||
var PropertyPaneMarkdownContentHost = /** @class */ (function (_super) {
|
||||
__extends(PropertyPaneMarkdownContentHost, _super);
|
||||
function PropertyPaneMarkdownContentHost() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PropertyPaneMarkdownContentHost.prototype.render = function () {
|
||||
return (React.createElement("div", { className: this.props.className },
|
||||
this.props.description && this.props.description !== '' &&
|
||||
React.createElement("div", { dangerouslySetInnerHTML: { __html: this.props.description } }),
|
||||
React.createElement(Markdown, { options: this.props.markdownProps }, this.props.markdown)));
|
||||
};
|
||||
return PropertyPaneMarkdownContentHost;
|
||||
}(React.Component));
|
||||
export default PropertyPaneMarkdownContentHost;
|
||||
//# sourceMappingURL=PropertyPaneMarkdownContentHost.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"PropertyPaneMarkdownContentHost.js","sourceRoot":"","sources":["../../../src/controls/PropertyPaneMarkdownContent/PropertyPaneMarkdownContentHost.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAEvC;IAA6D,mDAAsD;IAAnH;;IAeA,CAAC;IAbQ,gDAAM,GAAb;QACE,OAAO,CACL,6BAAK,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS;YAChC,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,EAAE;gBACvD,6BAAK,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,GAAQ;YAG1E,oBAAC,QAAQ,IACP,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,IACjC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAY,CAC7B,CACP,CAAC;IACJ,CAAC;IACH,sCAAC;AAAD,CAAC,AAfD,CAA6D,KAAK,CAAC,SAAS,GAe3E"}
|
|
@ -0,0 +1,5 @@
|
|||
export * from './IPropertyPaneMarkdownContent';
|
||||
export * from './PropertyPaneMarkdownContent';
|
||||
export * from './IPropertyPaneMarkdownContentHost';
|
||||
export * from './PropertyPaneMarkdownContentHost';
|
||||
//# sourceMappingURL=index.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/controls/PropertyPaneMarkdownContent/index.ts"],"names":[],"mappings":"AACA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC"}
|
|
@ -0,0 +1,3 @@
|
|||
export * from './PropertyPaneMarkdownContent';
|
||||
export * from './PropertyPaneMarkdownContentHost';
|
||||
//# sourceMappingURL=index.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controls/PropertyPaneMarkdownContent/index.ts"],"names":[],"mappings":"AAEA,cAAc,+BAA+B,CAAC;AAE9C,cAAc,mCAAmC,CAAC"}
|
|
@ -0,0 +1 @@
|
|||
//# sourceMappingURL=index.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
@ -0,0 +1,2 @@
|
|||
// A file is required to be in the root of the /src directory by the TypeScript compiler
|
||||
//# sourceMappingURL=index.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wFAAwF"}
|
|
@ -0,0 +1,40 @@
|
|||
import { Version } from '@microsoft/sp-core-library';
|
||||
import { IPropertyPaneConfiguration } from '@microsoft/sp-property-pane';
|
||||
/**
|
||||
* Use this for dynamic properties
|
||||
*/
|
||||
import { DynamicProperty } from '@microsoft/sp-component-base';
|
||||
/**
|
||||
* Plain old boring web part thingies
|
||||
*/
|
||||
import { BaseClientSideWebPart, IWebPartPropertiesMetadata } from '@microsoft/sp-webpart-base';
|
||||
export interface IEnhancedPowerAppsWebPartProps {
|
||||
dynamicProp: DynamicProperty<string>;
|
||||
appWebLink: string;
|
||||
useDynamicProp: boolean;
|
||||
dynamicPropName: string;
|
||||
border: boolean;
|
||||
layout: 'FixedHeight' | 'AspectRatio';
|
||||
height: number;
|
||||
width: number;
|
||||
aspectratio: '16:9' | '3:2' | '16:10' | '4:3' | 'Custom';
|
||||
themeValues: string[];
|
||||
}
|
||||
export default class EnhancedPowerAppsWebPart extends BaseClientSideWebPart<IEnhancedPowerAppsWebPartProps> {
|
||||
private _themeProvider;
|
||||
private _themeVariant;
|
||||
protected onInit(): Promise<void>;
|
||||
render(): void;
|
||||
protected onDispose(): void;
|
||||
protected readonly dataVersion: Version;
|
||||
protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration;
|
||||
protected readonly propertiesMetadata: IWebPartPropertiesMetadata;
|
||||
private _onConfigure;
|
||||
/**
|
||||
* Update the current theme variant reference and re-render.
|
||||
*
|
||||
* @param args The new theme
|
||||
*/
|
||||
private _handleThemeChangedEvent;
|
||||
}
|
||||
//# sourceMappingURL=EnhancedPowerAppsWebPart.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"EnhancedPowerAppsWebPart.d.ts","sourceRoot":"","sources":["../../../src/webparts/enhancedPowerApps/EnhancedPowerAppsWebPart.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACL,0BAA0B,EAK3B,MAAM,6BAA6B,CAAC;AAMrC;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;GAEG;AACH,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAG3B,MAAM,4BAA4B,CAAC;AAuBpC,MAAM,WAAW,8BAA8B;IAC7C,WAAW,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,aAAa,GAAC,aAAa,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAC,KAAK,GAAC,OAAO,GAAC,KAAK,GAAC,QAAQ,CAAC;IACjD,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,qBAAqB,CAAC,8BAA8B,CAAC;IACzG,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,aAAa,CAA6B;IAElD,SAAS,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAa1B,MAAM,IAAI,IAAI;IAqDrB,SAAS,CAAC,SAAS,IAAI,IAAI;uBAIb,WAAW,EAAI,OAAO;IAIpC,SAAS,CAAC,4BAA4B,IAAI,0BAA0B;uBAwItD,kBAAkB,EAAI,0BAA0B;IAU9D,OAAO,CAAC,YAAY,CAEnB;IAED;;;;KAIC;IACD,OAAO,CAAC,wBAAwB;CAIjC"}
|
|
@ -0,0 +1,271 @@
|
|||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
import * as React from 'react';
|
||||
import * as ReactDom from 'react-dom';
|
||||
import { Version } from '@microsoft/sp-core-library';
|
||||
import { PropertyPaneTextField, PropertyPaneToggle, PropertyPaneLabel, PropertyPaneChoiceGroup } from '@microsoft/sp-property-pane';
|
||||
import * as strings from 'EnhancedPowerAppsWebPartStrings';
|
||||
import EnhancedPowerApps from './components/EnhancedPowerApps';
|
||||
/**
|
||||
* Plain old boring web part thingies
|
||||
*/
|
||||
import { BaseClientSideWebPart, PropertyPaneDynamicFieldSet, PropertyPaneDynamicField } from '@microsoft/sp-webpart-base';
|
||||
/**
|
||||
* Use this for theme awareness
|
||||
*/
|
||||
import { ThemeProvider } from '@microsoft/sp-component-base';
|
||||
/**
|
||||
* Use the multi-select for large checklists
|
||||
*/
|
||||
import { PropertyFieldMultiSelect } from '@pnp/spfx-property-controls/lib/PropertyFieldMultiSelect';
|
||||
import { ThemeVariantSlots } from './ThemeVariantSlots';
|
||||
import { PropertyPaneHTML } from '../../controls/PropertyPaneHTML/PropertyPaneHTML';
|
||||
/**
|
||||
* Super-cool text functions included in SPFx that people don't use often enough
|
||||
*/
|
||||
import { Text } from '@microsoft/sp-core-library';
|
||||
var EnhancedPowerAppsWebPart = /** @class */ (function (_super) {
|
||||
__extends(EnhancedPowerAppsWebPart, _super);
|
||||
function EnhancedPowerAppsWebPart() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this._onConfigure = function () {
|
||||
_this.context.propertyPane.open();
|
||||
};
|
||||
return _this;
|
||||
}
|
||||
EnhancedPowerAppsWebPart.prototype.onInit = function () {
|
||||
// Consume the new ThemeProvider service
|
||||
this._themeProvider = this.context.serviceScope.consume(ThemeProvider.serviceKey);
|
||||
// If it exists, get the theme variant
|
||||
this._themeVariant = this._themeProvider.tryGetTheme();
|
||||
// Register a handler to be notified if the theme variant changes
|
||||
this._themeProvider.themeChangedEvent.add(this, this._handleThemeChangedEvent);
|
||||
return _super.prototype.onInit.call(this);
|
||||
};
|
||||
EnhancedPowerAppsWebPart.prototype.render = function () {
|
||||
var clientWidth = this.domElement.clientWidth;
|
||||
var dynamicProp = this.properties.dynamicProp.tryGetValue();
|
||||
var locale = this.context.pageContext.cultureInfo.currentCultureName;
|
||||
var aspectWidth;
|
||||
var aspectHeight;
|
||||
switch (this.properties.aspectratio) {
|
||||
case "16:10":
|
||||
aspectWidth = 16;
|
||||
aspectHeight = 10;
|
||||
break;
|
||||
case "16:9":
|
||||
aspectWidth = 16;
|
||||
aspectHeight = 9;
|
||||
break;
|
||||
case "3:2":
|
||||
aspectWidth = 3;
|
||||
aspectHeight = 2;
|
||||
break;
|
||||
case "4:3":
|
||||
aspectWidth = 4;
|
||||
aspectHeight = 3;
|
||||
break;
|
||||
case "Custom":
|
||||
aspectWidth = this.properties.width;
|
||||
aspectHeight = this.properties.height;
|
||||
}
|
||||
var clientHeight = this.properties.layout === 'FixedHeight' ?
|
||||
this.properties.height :
|
||||
clientWidth * (aspectHeight / aspectWidth);
|
||||
var element = React.createElement(EnhancedPowerApps, {
|
||||
locale: locale,
|
||||
dynamicProp: dynamicProp,
|
||||
useDynamicProp: this.properties.useDynamicProp,
|
||||
dynamicPropName: this.properties.dynamicPropName,
|
||||
onConfigure: this._onConfigure,
|
||||
appWebLink: this.properties.appWebLink,
|
||||
width: clientWidth,
|
||||
height: clientHeight,
|
||||
themeVariant: this._themeVariant,
|
||||
border: this.properties.border,
|
||||
themeValues: this.properties.themeValues
|
||||
});
|
||||
ReactDom.render(element, this.domElement);
|
||||
};
|
||||
EnhancedPowerAppsWebPart.prototype.onDispose = function () {
|
||||
ReactDom.unmountComponentAtNode(this.domElement);
|
||||
};
|
||||
Object.defineProperty(EnhancedPowerAppsWebPart.prototype, "dataVersion", {
|
||||
get: function () {
|
||||
return Version.parse('1.0');
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
EnhancedPowerAppsWebPart.prototype.getPropertyPaneConfiguration = function () {
|
||||
return {
|
||||
pages: [
|
||||
{
|
||||
displayGroupsAsAccordion: true,
|
||||
header: {
|
||||
description: strings.PropertyPaneDescription
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
groupName: strings.BasicGroupName,
|
||||
isCollapsed: false,
|
||||
groupFields: [
|
||||
PropertyPaneTextField('appWebLink', {
|
||||
label: strings.AppWebLinkFieldLabel
|
||||
})
|
||||
]
|
||||
},
|
||||
{
|
||||
groupName: strings.AppearanceGroupName,
|
||||
isCollapsed: true,
|
||||
groupFields: [
|
||||
PropertyPaneToggle('border', {
|
||||
label: strings.BorderFieldLabel
|
||||
}),
|
||||
PropertyPaneChoiceGroup('layout', {
|
||||
label: strings.LayoutFieldLabel,
|
||||
options: [
|
||||
{
|
||||
key: 'FixedHeight',
|
||||
text: strings.LayoutFixedHeightOption,
|
||||
iconProps: {
|
||||
officeFabricIconFontName: 'FullWidth'
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'AspectRatio',
|
||||
text: strings.LayoutAspectRatioOption,
|
||||
iconProps: {
|
||||
officeFabricIconFontName: 'AspectRatio'
|
||||
}
|
||||
}
|
||||
]
|
||||
}),
|
||||
this.properties.layout === "FixedHeight" && PropertyPaneTextField('height', {
|
||||
label: strings.HeightFieldLabel
|
||||
}),
|
||||
this.properties.layout === "AspectRatio" && PropertyPaneChoiceGroup('aspectratio', {
|
||||
label: strings.AspectRatioFieldLabel,
|
||||
options: [
|
||||
{
|
||||
key: '16:9',
|
||||
text: '16:9',
|
||||
},
|
||||
{
|
||||
key: '3:2',
|
||||
text: '3:2',
|
||||
},
|
||||
{
|
||||
key: '16:10',
|
||||
text: '16:10',
|
||||
},
|
||||
{
|
||||
key: '4:3',
|
||||
text: '4:3',
|
||||
},
|
||||
{
|
||||
key: 'Custom',
|
||||
text: strings.AspectRatioCustomOption,
|
||||
}
|
||||
]
|
||||
}),
|
||||
this.properties.layout === "AspectRatio" && this.properties.aspectratio === "Custom" && PropertyPaneTextField('width', {
|
||||
label: strings.WidthFieldLabel,
|
||||
}),
|
||||
this.properties.layout === "AspectRatio" && this.properties.aspectratio === "Custom" && PropertyPaneTextField('height', {
|
||||
label: strings.HeightFieldLabel,
|
||||
}),
|
||||
]
|
||||
},
|
||||
{
|
||||
groupName: strings.DynamicPropertiesGroupLabel,
|
||||
isCollapsed: true,
|
||||
groupFields: [
|
||||
PropertyPaneHTML({
|
||||
key: 'useDynamicProp',
|
||||
html: Text.format(strings.DynamicsPropsGroupDescription1, this.properties.dynamicPropName !== undefined ? this.properties.dynamicPropName : 'parametername')
|
||||
}),
|
||||
PropertyPaneHTML({
|
||||
key: 'useDynamicProp',
|
||||
html: strings.DynamicsPropsGroupDescription2
|
||||
}),
|
||||
PropertyPaneToggle('useDynamicProp', {
|
||||
checked: this.properties.useDynamicProp === true,
|
||||
label: strings.UseDynamicPropsFieldLabel
|
||||
}),
|
||||
this.properties.useDynamicProp === true && PropertyPaneDynamicFieldSet({
|
||||
label: strings.SelectDynamicSource,
|
||||
fields: [
|
||||
PropertyPaneDynamicField('dynamicProp', {
|
||||
label: strings.DynamicPropFieldLabel
|
||||
})
|
||||
]
|
||||
}),
|
||||
this.properties.useDynamicProp === true && PropertyPaneTextField('dynamicPropName', {
|
||||
label: strings.DynamicPropsNameFieldLabel,
|
||||
description: strings.DynamicsPropNameDescriptionLabel,
|
||||
value: this.properties.dynamicPropName
|
||||
})
|
||||
]
|
||||
},
|
||||
{
|
||||
groupName: strings.ThemeGroupName,
|
||||
isCollapsed: true,
|
||||
groupFields: [
|
||||
PropertyPaneLabel('themeValuesPre', {
|
||||
text: strings.ThemeValuePreLabel
|
||||
}),
|
||||
PropertyFieldMultiSelect('themeValues', {
|
||||
key: 'multithemeValuesSelect',
|
||||
label: strings.ThemeValueFieldLabel,
|
||||
options: ThemeVariantSlots,
|
||||
selectedKeys: this.properties.themeValues
|
||||
}),
|
||||
PropertyPaneHTML({
|
||||
key: 'themeValuesPost',
|
||||
html: strings.ThemeValuePostLabel
|
||||
}),
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
};
|
||||
Object.defineProperty(EnhancedPowerAppsWebPart.prototype, "propertiesMetadata", {
|
||||
get: function () {
|
||||
return {
|
||||
// Specify the web part properties data type to allow the address
|
||||
// information to be serialized by the SharePoint Framework.
|
||||
'dynamicProp': {
|
||||
dynamicPropertyType: 'string'
|
||||
}
|
||||
};
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
/**
|
||||
* Update the current theme variant reference and re-render.
|
||||
*
|
||||
* @param args The new theme
|
||||
*/
|
||||
EnhancedPowerAppsWebPart.prototype._handleThemeChangedEvent = function (args) {
|
||||
this._themeVariant = args.theme;
|
||||
this.render();
|
||||
};
|
||||
return EnhancedPowerAppsWebPart;
|
||||
}(BaseClientSideWebPart));
|
||||
export default EnhancedPowerAppsWebPart;
|
||||
//# sourceMappingURL=EnhancedPowerAppsWebPart.js.map
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json",
|
||||
"id": "3d2f89fa-3b9e-4876-82c2-c15ff82190f1",
|
||||
"alias": "EnhancedPowerAppsWebPart",
|
||||
"componentType": "WebPart",
|
||||
|
||||
"version": "*",
|
||||
"manifestVersion": 2,
|
||||
|
||||
"requiresCustomScript": false,
|
||||
"supportsFullBleed": true,
|
||||
"supportsThemeVariants": true,
|
||||
"supportedHosts": ["SharePointWebPart"],
|
||||
|
||||
"preconfiguredEntries": [{
|
||||
"groupId": "5c03119e-3074-46fd-976b-c60198311f70",
|
||||
"group": { "default": "Other" },
|
||||
"title": { "default": "Enhanced PowerApps" },
|
||||
"description": { "default": "Embed Power Apps in a SharePoint page, and add theme supports and dynamic properties" },
|
||||
"officeFabricIconFontName": "PowerApps",
|
||||
"properties": {
|
||||
"layout": 'AspectRatio',
|
||||
"aspectratio": '16:9',
|
||||
}
|
||||
}]
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
import { IPropertyPaneDropdownOption } from '@microsoft/sp-property-pane';
|
||||
export declare const ThemeVariantSlots: IPropertyPaneDropdownOption[];
|
||||
//# sourceMappingURL=ThemeVariantSlots.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"ThemeVariantSlots.d.ts","sourceRoot":"","sources":["../../../src/webparts/enhancedPowerApps/ThemeVariantSlots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAE1E,eAAO,MAAM,iBAAiB,EAAE,2BAA2B,EAqGxD,CAAC"}
|
|
@ -0,0 +1,102 @@
|
|||
export var ThemeVariantSlots = [
|
||||
{ key: "accentButtonBackground", text: "accentButtonBackground" },
|
||||
{ key: "accentButtonText", text: "accentButtonText" },
|
||||
{ key: "actionLink", text: "actionLink" },
|
||||
{ key: "actionLinkHovered", text: "actionLinkHovered" },
|
||||
{ key: "blockingBackground", text: "blockingBackground" },
|
||||
{ key: "blockingIcon", text: "blockingIcon" },
|
||||
{ key: "bodyBackground", text: "bodyBackground" },
|
||||
{ key: "bodyBackgroundChecked", text: "bodyBackgroundChecked" },
|
||||
{ key: "bodyBackgroundHovered", text: "bodyBackgroundHovered" },
|
||||
{ key: "bodyDivider", text: "bodyDivider" },
|
||||
{ key: "bodyFrameBackground", text: "bodyFrameBackground" },
|
||||
{ key: "bodyFrameDivider", text: "bodyFrameDivider" },
|
||||
{ key: "bodyStandoutBackground", text: "bodyStandoutBackground" },
|
||||
{ key: "bodySubtext", text: "bodySubtext" },
|
||||
{ key: "bodyText", text: "bodyText" },
|
||||
{ key: "bodyTextChecked", text: "bodyTextChecked" },
|
||||
{ key: "buttonBackground", text: "buttonBackground" },
|
||||
{ key: "buttonBackgroundChecked", text: "buttonBackgroundChecked" },
|
||||
{ key: "buttonBackgroundCheckedHovered", text: "buttonBackgroundCheckedHovered" },
|
||||
{ key: "buttonBackgroundDisabled", text: "buttonBackgroundDisabled" },
|
||||
{ key: "buttonBackgroundHovered", text: "buttonBackgroundHovered" },
|
||||
{ key: "buttonBackgroundPressed", text: "buttonBackgroundPressed" },
|
||||
{ key: "buttonBorder", text: "buttonBorder" },
|
||||
{ key: "buttonBorderDisabled", text: "buttonBorderDisabled" }, { key: "primaryButtonBackground", text: "primaryButtonBackground" },
|
||||
{ key: "buttonText", text: "buttonText" },
|
||||
{ key: "buttonTextChecked", text: "buttonTextChecked" },
|
||||
{ key: "buttonTextCheckedHovered", text: "buttonTextCheckedHovered" },
|
||||
{ key: "buttonTextDisabled", text: "buttonTextDisabled" },
|
||||
{ key: "buttonTextHovered", text: "buttonTextHovered" },
|
||||
{ key: "buttonTextPressed", text: "buttonTextPressed" },
|
||||
{ key: "defaultStateBackground", text: "defaultStateBackground" },
|
||||
{ key: "disabledBackground", text: "disabledBackground" },
|
||||
{ key: "disabledBodySubtext", text: "disabledBodySubtext" },
|
||||
{ key: "disabledBodyText", text: "disabledBodyText" },
|
||||
{ key: "disabledBorder", text: "disabledBorder" },
|
||||
{ key: "disabledSubtext", text: "disabledSubtext" },
|
||||
{ key: "disabledText", text: "disabledText" },
|
||||
{ key: "errorBackground", text: "errorBackground" },
|
||||
{ key: "errorIcon", text: "errorIcon" },
|
||||
{ key: "errorText", text: "errorText" },
|
||||
{ key: "focusBorder", text: "focusBorder" },
|
||||
{ key: "infoBackground", text: "infoBackground" },
|
||||
{ key: "infoIcon", text: "infoIcon" },
|
||||
{ key: "inputBackground", text: "inputBackground" },
|
||||
{ key: "inputBackgroundChecked", text: "inputBackgroundChecked" },
|
||||
{ key: "inputBackgroundCheckedHovered", text: "inputBackgroundCheckedHovered" },
|
||||
{ key: "inputBorder", text: "inputBorder" },
|
||||
{ key: "inputBorderHovered", text: "inputBorderHovered" },
|
||||
{ key: "inputFocusBorderAlt", text: "inputFocusBorderAlt" },
|
||||
{ key: "inputForegroundChecked", text: "inputForegroundChecked" },
|
||||
{ key: "inputIcon", text: "inputIcon" },
|
||||
{ key: "inputIconDisabled", text: "inputIconDisabled" },
|
||||
{ key: "inputIconHovered", text: "inputIconHovered" },
|
||||
{ key: "inputPlaceholderBackgroundChecked", text: "inputPlaceholderBackgroundChecked" },
|
||||
{ key: "inputPlaceholderText", text: "inputPlaceholderText" },
|
||||
{ key: "inputText", text: "inputText" },
|
||||
{ key: "inputTextHovered", text: "inputTextHovered" },
|
||||
{ key: "link", text: "link" },
|
||||
{ key: "linkHovered", text: "linkHovered" },
|
||||
{ key: "listBackground", text: "listBackground" },
|
||||
{ key: "listHeaderBackgroundHovered", text: "listHeaderBackgroundHovered" },
|
||||
{ key: "listHeaderBackgroundPressed", text: "listHeaderBackgroundPressed" },
|
||||
{ key: "listItemBackgroundChecked", text: "listItemBackgroundChecked" },
|
||||
{ key: "listItemBackgroundCheckedHovered", text: "listItemBackgroundCheckedHovered" },
|
||||
{ key: "listItemBackgroundHovered", text: "listItemBackgroundHovered" },
|
||||
{ key: "listText", text: "listText" },
|
||||
{ key: "listTextColor", text: "listTextColor" },
|
||||
{ key: "menuBackground", text: "menuBackground" },
|
||||
{ key: "menuDivider", text: "menuDivider" },
|
||||
{ key: "menuHeader", text: "menuHeader" },
|
||||
{ key: "menuIcon", text: "menuIcon" },
|
||||
{ key: "menuItemBackgroundChecked", text: "menuItemBackgroundChecked" },
|
||||
{ key: "menuItemBackgroundHovered", text: "menuItemBackgroundHovered" },
|
||||
{ key: "menuItemBackgroundPressed", text: "menuItemBackgroundPressed" },
|
||||
{ key: "menuItemText", text: "menuItemText" },
|
||||
{ key: "menuItemTextHovered", text: "menuItemTextHovered" },
|
||||
{ key: "messageLink", text: "messageLink" },
|
||||
{ key: "messageLinkHovered", text: "messageLinkHovered" },
|
||||
{ key: "messageText", text: "messageText" },
|
||||
{ key: "primaryButtonBackgroundDisabled", text: "primaryButtonBackgroundDisabled" },
|
||||
{ key: "primaryButtonBackgroundHovered", text: "primaryButtonBackgroundHovered" },
|
||||
{ key: "primaryButtonBackgroundPressed", text: "primaryButtonBackgroundPressed" },
|
||||
{ key: "primaryButtonBorder", text: "primaryButtonBorder" },
|
||||
{ key: "primaryButtonText", text: "primaryButtonText" },
|
||||
{ key: "primaryButtonTextDisabled", text: "primaryButtonTextDisabled" },
|
||||
{ key: "primaryButtonTextHovered", text: "primaryButtonTextHovered" },
|
||||
{ key: "primaryButtonTextPressed", text: "primaryButtonTextPressed" },
|
||||
{ key: "severeWarningBackground", text: "severeWarningBackground" },
|
||||
{ key: "severeWarningIcon", text: "severeWarningIcon" },
|
||||
{ key: "smallInputBorder", text: "smallInputBorder" },
|
||||
{ key: "successBackground", text: "successBackground" },
|
||||
{ key: "successIcon", text: "successIcon" },
|
||||
{ key: "successText", text: "successText" },
|
||||
{ key: "variantBorder", text: "variantBorder" },
|
||||
{ key: "variantBorderHovered", text: "variantBorderHovered" },
|
||||
{ key: "warningBackground", text: "warningBackground" },
|
||||
{ key: "warningHighlight", text: "warningHighlight" },
|
||||
{ key: "warningIcon", text: "warningIcon" },
|
||||
{ key: "warningText", text: "warningText" }
|
||||
];
|
||||
//# sourceMappingURL=ThemeVariantSlots.js.map
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,7 @@
|
|||
import * as React from 'react';
|
||||
import { IEnhancedPowerAppsProps } from './IEnhancedPowerAppsProps';
|
||||
import { IEnhancedPowerAppsState } from './IEnhancedPowerAppsState';
|
||||
export default class EnhancedPowerApps extends React.Component<IEnhancedPowerAppsProps, IEnhancedPowerAppsState> {
|
||||
render(): React.ReactElement<IEnhancedPowerAppsProps>;
|
||||
}
|
||||
//# sourceMappingURL=EnhancedPowerApps.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"EnhancedPowerApps.d.ts","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/EnhancedPowerApps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAYpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,KAAK,CAAC,SAAS,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;IAEvG,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,uBAAuB,CAAC;CAkE7D"}
|
|
@ -0,0 +1,60 @@
|
|||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
import * as React from 'react';
|
||||
import styles from './EnhancedPowerApps.module.scss';
|
||||
import * as strings from 'EnhancedPowerAppsWebPartStrings';
|
||||
/**
|
||||
* We use the placeholder to tell people they haven't configured the web part yet
|
||||
* */
|
||||
import { Placeholder } from "@pnp/spfx-controls-react/lib/Placeholder";
|
||||
var EnhancedPowerApps = /** @class */ (function (_super) {
|
||||
__extends(EnhancedPowerApps, _super);
|
||||
function EnhancedPowerApps() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
EnhancedPowerApps.prototype.render = function () {
|
||||
var _a = this.props, dynamicProp = _a.dynamicProp, themeVariant = _a.themeVariant, themeValues = _a.themeValues, appWebLink = _a.appWebLink, useDynamicProp = _a.useDynamicProp, dynamicPropName = _a.dynamicPropName, locale = _a.locale, border = _a.border, height = _a.height, width = _a.width;
|
||||
var needConfiguration = !appWebLink;
|
||||
var semanticColors = themeVariant.semanticColors;
|
||||
var dynamicPropValue = useDynamicProp && dynamicProp !== undefined ? "&" + encodeURIComponent(dynamicPropName) + "=" + encodeURIComponent(dynamicProp) : '';
|
||||
// We can take an app id or a full link. We'll assume (for now) that people are passing a valid app URL
|
||||
// would LOVE to find an API to retrieve list of valid apps
|
||||
var appUrl = appWebLink && appWebLink.indexOf('https://') != 0 ? "https://apps.powerapps.com/play/" + appWebLink : appWebLink;
|
||||
// Build the portion of the URL where we're passing theme colors
|
||||
var themeParams = "";
|
||||
if (themeValues && themeValues.length > 0) {
|
||||
themeValues.forEach(function (themeValue) {
|
||||
try {
|
||||
var themeColor = semanticColors[themeValue];
|
||||
themeParams = themeParams + ("&" + themeValue + "=" + encodeURIComponent(themeColor));
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Build the frame url
|
||||
var frameUrl = appUrl + "?source=SPClient-EnhancedPowerAppsWebPart&locale=" + locale + "&enableOnBehalfOf=true&authMode=onbehalfof&hideNavBar=true&" + dynamicPropValue + themeParams + "&locale=" + locale;
|
||||
console.log("URL", frameUrl);
|
||||
return (React.createElement("div", { className: styles.enhancedPowerApps, style: { height: height + "px" } },
|
||||
needConfiguration &&
|
||||
React.createElement(Placeholder, { iconName: 'PowerApps', iconText: strings.PlaceholderIconText, description: strings.PlaceholderDescription, buttonLabel: strings.PlaceholderButtonLabel, onConfigure: this.props.onConfigure }),
|
||||
!needConfiguration &&
|
||||
React.createElement(React.Fragment, null, this.props.appWebLink &&
|
||||
React.createElement("iframe", { src: frameUrl, scrolling: "no", allow: "geolocation *; microphone *; camera *; fullscreen *;", sandbox: "allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-forms allow-orientation-lock allow-downloads", width: this.props.width, height: height, frameBorder: border ? "1" : "0" }))));
|
||||
};
|
||||
return EnhancedPowerApps;
|
||||
}(React.Component));
|
||||
export default EnhancedPowerApps;
|
||||
//# sourceMappingURL=EnhancedPowerApps.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"EnhancedPowerApps.js","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/EnhancedPowerApps.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,iCAAiC,CAAC;AAErD,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC;AAE3D;;KAEK;AACL,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAQvE;IAA+C,qCAAiE;IAAhH;;IAoEA,CAAC;IAlEQ,kCAAM,GAAb;QACQ,IAAA,eAWU,EAVd,4BAAW,EACX,8BAAY,EACZ,4BAAW,EACX,0BAAU,EACV,kCAAc,EACd,oCAAe,EACf,kBAAM,EACN,kBAAM,EACN,kBAAM,EACN,gBACc,CAAC;QACjB,IAAM,iBAAiB,GAAY,CAAC,UAAU,CAAC;QAEvC,IAAA,4CAAc,CAAkC;QAExD,IAAM,gBAAgB,GAAW,cAAc,IAAI,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,MAAI,kBAAkB,CAAC,eAAe,CAAC,SAAI,kBAAkB,CAAC,WAAW,CAAG,CAAA,CAAC,CAAA,EAAE,CAAC;QAE/J,uGAAuG;QACvG,2DAA2D;QAC3D,IAAM,MAAM,GAAW,UAAU,IAAI,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,qCAAmC,UAAY,CAAC,CAAC,CAAC,UAAU,CAAC;QAExI,gEAAgE;QAChE,IAAI,WAAW,GAAW,EAAE,CAAC;QAE7B,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3C,WAAW,CAAC,OAAO,CAAC,UAAC,UAAkB;gBACrC,IAAI;oBAEF,IAAM,UAAU,GAAW,cAAc,CAAC,UAAU,CAAC,CAAC;oBACtD,WAAW,GAAG,WAAW,IAAG,MAAI,UAAU,SAAI,kBAAkB,CAAC,UAAU,CAAG,CAAA,CAAC;iBAChF;gBAAC,OAAO,CAAC,EAAE;oBACV,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;iBAChB;YAEH,CAAC,CAAC,CAAC;SACF;QAGD,sBAAsB;QACtB,IAAM,QAAQ,GAAc,MAAM,6DAAwD,MAAM,mFAA8E,gBAAgB,GAAG,WAAW,gBAAW,MAAQ,CAAC;QAEhO,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAE7B,OAAO,CACL,6BAAK,SAAS,EAAG,MAAM,CAAC,iBAAiB,EAAG,KAAK,EAAE,EAAC,MAAM,EAAI,MAAM,OAAI,EAAC;YACtE,iBAAiB;gBACjB,oBAAC,WAAW,IACZ,QAAQ,EAAC,WAAW,EACpB,QAAQ,EAAE,OAAO,CAAC,mBAAmB,EACrC,WAAW,EAAE,OAAO,CAAC,sBAAsB,EAC3C,WAAW,EAAE,OAAO,CAAC,sBAAsB,EAC3C,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,GAAI;YACtC,CAAC,iBAAiB;gBACnB,0CACC,IAAI,CAAC,KAAK,CAAC,UAAU;oBACvB,gCAAQ,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,IAAI,EAAC,KAAK,EAAC,sDAAsD,EAAC,OAAO,EAAC,gIAAgI,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EACnR,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAA,CAAC,CAAC,GAAG,GACpB,CAEN,CAEA,CACP,CAAC;IACJ,CAAC;IACH,wBAAC;AAAD,CAAC,AApED,CAA+C,KAAK,CAAC,SAAS,GAoE7D"}
|
|
@ -0,0 +1,2 @@
|
|||
.enhancedPowerApps_e02a5fc2{color:inherit}.enhancedPowerApps_e02a5fc2 span[class^=placeholderText_]{font-size:20px!important;font-weight:600!important;color:#323130}.enhancedPowerApps_e02a5fc2 span[class^=placeholderDescriptionText_]{color:#605e5c!important;margin:20px 0 28px;line-height:23px;font-size:16px!important}
|
||||
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyY1xcd2VicGFydHNcXGVuaGFuY2VkUG93ZXJBcHBzXFxjb21wb25lbnRzXFxFbmhhbmNlZFBvd2VyQXBwcy5tb2R1bGUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSw0QkFDRSxNQUFBLFFBREYsMERBU0ksVUFBQSxlQUNBLFlBQUEsY0FDQSxNQUFBLFFBWEoscUVBZUksTUFBQSxrQkFDQSxPQUFBLEtBQUEsRUFBQSxLQUNBLFlBQUEsS0FDQSxVQUFBIn0= */
|
|
@ -0,0 +1,5 @@
|
|||
declare const styles: {
|
||||
enhancedPowerApps: string;
|
||||
};
|
||||
export default styles;
|
||||
//# sourceMappingURL=EnhancedPowerApps.module.scss.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"EnhancedPowerApps.module.scss.d.ts","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/EnhancedPowerApps.module.scss.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,MAAM;;CAEX,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@ -0,0 +1,8 @@
|
|||
/* tslint:disable */
|
||||
require("./EnhancedPowerApps.module.css");
|
||||
var styles = {
|
||||
enhancedPowerApps: 'enhancedPowerApps_e02a5fc2'
|
||||
};
|
||||
export default styles;
|
||||
/* tslint:enable */
|
||||
//# sourceMappingURL=EnhancedPowerApps.module.scss.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"EnhancedPowerApps.module.scss.js","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/EnhancedPowerApps.module.scss.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,CAAC,gCAAgC,CAAC,CAAC;AAC1C,IAAM,MAAM,GAAG;IACb,iBAAiB,EAAE,4BAA4B;CAChD,CAAC;AAEF,eAAe,MAAM,CAAC;AACtB,mBAAmB"}
|
|
@ -0,0 +1,49 @@
|
|||
import { IReadonlyTheme } from '@microsoft/sp-component-base';
|
||||
export interface IEnhancedPowerAppsProps {
|
||||
/**
|
||||
* The current web part culture
|
||||
*/
|
||||
locale: string;
|
||||
/**
|
||||
* Event handler for clicking the Configure button on the Placeholder
|
||||
*/
|
||||
onConfigure: () => void;
|
||||
/**
|
||||
* The selected dynamic property to pass
|
||||
*/
|
||||
dynamicProp: string;
|
||||
/**
|
||||
* The parameter name of the dynamic prop
|
||||
*
|
||||
*/
|
||||
dynamicPropName: string;
|
||||
/**
|
||||
* Whether we use dynamic props
|
||||
*/
|
||||
useDynamicProp: boolean;
|
||||
/**
|
||||
* Power Apps
|
||||
*/
|
||||
appWebLink: string;
|
||||
/**
|
||||
* Width
|
||||
*/
|
||||
width: number;
|
||||
/**
|
||||
* Height
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* Support theme variant
|
||||
*/
|
||||
themeVariant: IReadonlyTheme | undefined;
|
||||
/**
|
||||
* Whether we show border or not
|
||||
*/
|
||||
border: boolean;
|
||||
/**
|
||||
* Selected theme values to pass to Power Apps
|
||||
*/
|
||||
themeValues: string[];
|
||||
}
|
||||
//# sourceMappingURL=IEnhancedPowerAppsProps.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"IEnhancedPowerAppsProps.d.ts","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/IEnhancedPowerAppsProps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;IAExB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,EAAE,cAAc,GAAG,SAAS,CAAC;IAEzC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB"}
|
|
@ -0,0 +1 @@
|
|||
//# sourceMappingURL=IEnhancedPowerAppsProps.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"IEnhancedPowerAppsProps.js","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/IEnhancedPowerAppsProps.ts"],"names":[],"mappings":""}
|
|
@ -0,0 +1,3 @@
|
|||
export interface IEnhancedPowerAppsState {
|
||||
}
|
||||
//# sourceMappingURL=IEnhancedPowerAppsState.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"IEnhancedPowerAppsState.d.ts","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/IEnhancedPowerAppsState.tsx"],"names":[],"mappings":"AACA,MAAM,WAAW,uBAAuB;CAEvC"}
|
|
@ -0,0 +1 @@
|
|||
//# sourceMappingURL=IEnhancedPowerAppsState.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"IEnhancedPowerAppsState.js","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/IEnhancedPowerAppsState.tsx"],"names":[],"mappings":""}
|
|
@ -0,0 +1,31 @@
|
|||
define([], function() {
|
||||
return {
|
||||
ThemeValuePostLabel: "You can use <pre style='display:inline;font-weight:700;'>ColorValue(Param('themevaluename'))</pre> within your Power Apps to retrieve any of the theme color values you selected.",
|
||||
ThemeValueFieldLabel: "Theme variant properties",
|
||||
ThemeValuePreLabel: "Select the theme colors you wish to pass to your app. You can use this to make your app theme-aware.",
|
||||
ThemeGroupName: "Theme",
|
||||
DynamicsPropNameDescriptionLabel: "What name do you want to use when retrieving this parameter from Power Apps? E.g.: 'id'",
|
||||
DynamicPropsNameFieldLabel: "Parameter name",
|
||||
DynamicPropFieldLabel: "Dynamic property source",
|
||||
SelectDynamicSource: "Select dynamic property source",
|
||||
UseDynamicPropsFieldLabel: "Pass dynamic property as parameter?",
|
||||
DynamicsPropsGroupDescription2: "Note that we always pass the page's locale. Use <pre style='display:inline;font-weight:700;'>Param('locale')</pre> to retrieve the value within Power Apps.",
|
||||
DynamicsPropsGroupDescription1: "You can pass dynamic properties from the page environment or other web parts on the page as parameters to Power Apps. Within Power Apps, you can use <pre style='display:inline;font-weight:700;'>Param('{0}')</pre> to retrieve the value.",
|
||||
DynamicPropertiesGroupLabel: "Dynamic Properties",
|
||||
WidthFieldLabel: "Width",
|
||||
AspectRatioCustomOption: "Custom",
|
||||
AspectRatioFieldLabel: "Aspect ratio",
|
||||
HeightFieldLabel: "Height",
|
||||
LayoutAspectRatioOption: "Resize proportionally",
|
||||
LayoutFixedHeightOption: "Fixed height",
|
||||
LayoutFieldLabel: "Resize behavior",
|
||||
BorderFieldLabel: "Show border",
|
||||
AppearanceGroupName: "Appearance",
|
||||
PlaceholderButtonLabel: "Add an app",
|
||||
PlaceholderDescription: "Include a custom business app on your page.",
|
||||
PlaceholderIconText: "Enhanced Microsoft Power Apps",
|
||||
PropertyPaneDescription: "Add a custom business app by pasting its web link or ID below.",
|
||||
BasicGroupName: "Basic Configuration",
|
||||
AppWebLinkFieldLabel: "App web link or ID"
|
||||
}
|
||||
});
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
"name": "react-enhanced-powerapps",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"main": "lib/index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "gulp bundle",
|
||||
"clean": "gulp clean",
|
||||
"test": "gulp test",
|
||||
"preversion": "node ./tools/pre-version.js",
|
||||
"postversion": "gulp dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/sp-core-library": "1.11.0",
|
||||
"@microsoft/sp-lodash-subset": "1.11.0",
|
||||
"@microsoft/sp-office-ui-fabric-core": "1.11.0",
|
||||
"@microsoft/sp-property-pane": "1.11.0",
|
||||
"@microsoft/sp-webpart-base": "1.11.0",
|
||||
"@pnp/spfx-controls-react": "1.19.0",
|
||||
"@pnp/spfx-property-controls": "1.19.0",
|
||||
"office-ui-fabric-react": "6.214.0",
|
||||
"react": "16.8.5",
|
||||
"react-dom": "16.8.5",
|
||||
"lodash": ">=4.17.19",
|
||||
"serialize-javascript": ">=2.1.1",
|
||||
"lodash.template": ">=4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@microsoft/rush-stack-compiler-3.3": "0.3.5",
|
||||
"@microsoft/sp-build-web": "1.11.0",
|
||||
"@microsoft/sp-module-interfaces": "1.11.0",
|
||||
"@microsoft/sp-tslint-rules": "1.11.0",
|
||||
"@microsoft/sp-webpart-workbench": "1.11.0",
|
||||
"@types/chai": "3.4.34",
|
||||
"@types/es6-promise": "0.0.33",
|
||||
"@types/mocha": "2.2.38",
|
||||
"@types/react": "16.8.8",
|
||||
"@types/react-dom": "16.8.3",
|
||||
"@types/webpack-env": "1.13.1",
|
||||
"ajv": "~5.2.2",
|
||||
"gulp": "~3.9.1",
|
||||
"gulp-sequence": "1.0.0",
|
||||
"gulp-stylelint": "^13.0.0",
|
||||
"stylelint": "^13.6.1",
|
||||
"stylelint-config-css-modules": "^2.2.0",
|
||||
"stylelint-config-standard": "^20.0.0",
|
||||
"stylelint-scss": "^3.18.0",
|
||||
"webpack-bundle-analyzer": "^3.8.0"
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue