Merge pull request #2243 from PathToSharePoint/main
New sample: Property Pane Wrapper for HTML Controls
|
@ -0,0 +1,39 @@
|
|||
// For more information on how to run this SPFx project in a VS Code Remote Container, please visit https://aka.ms/spfx-devcontainer
|
||||
{
|
||||
"name": "SPFx 1.14",
|
||||
"image": "docker.io/m365pnp/spfx:latest",
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {},
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"editorconfig.editorconfig",
|
||||
"dbaeumer.vscode-eslint"
|
||||
],
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
"forwardPorts": [
|
||||
4321,
|
||||
35729
|
||||
],
|
||||
"portsAttributes": {
|
||||
"4321": {
|
||||
"protocol": "https",
|
||||
"label": "Manifest",
|
||||
"onAutoForward": "silent",
|
||||
"requireLocalPort": true
|
||||
},
|
||||
// Not needed for SPFx>= 1.12.1
|
||||
// "5432": {
|
||||
// "protocol": "https",
|
||||
// "label": "Workbench",
|
||||
// "onAutoForward": "silent"
|
||||
// },
|
||||
"35729": {
|
||||
"protocol": "https",
|
||||
"label": "LiveReload",
|
||||
"onAutoForward": "silent",
|
||||
"requireLocalPort": true
|
||||
}
|
||||
},
|
||||
"postCreateCommand": "bash .devcontainer/spfx-startup.sh",
|
||||
"remoteUser": "node"
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
echo
|
||||
echo -e "\e[1;94mInstalling Node dependencies\e[0m"
|
||||
npm install
|
||||
|
||||
## commands to create dev certificate and copy it to the root folder of the project
|
||||
echo
|
||||
echo -e "\e[1;94mGenerating dev certificate\e[0m"
|
||||
gulp trust-dev-cert
|
||||
|
||||
# Convert the generated PEM certificate to a CER certificate
|
||||
openssl x509 -inform PEM -in ~/.rushstack/rushstack-serve.pem -outform DER -out ./spfx-dev-cert.cer
|
||||
|
||||
# Copy the PEM ecrtificate for non-Windows hosts
|
||||
cp ~/.rushstack/rushstack-serve.pem ./spfx-dev-cert.pem
|
||||
|
||||
## add *.cer to .gitignore to prevent certificates from being saved in repo
|
||||
if ! grep -Fxq '*.cer' ./.gitignore
|
||||
then
|
||||
echo "# .CER Certificates" >> .gitignore
|
||||
echo "*.cer" >> .gitignore
|
||||
fi
|
||||
|
||||
## add *.pem to .gitignore to prevent certificates from being saved in repo
|
||||
if ! grep -Fxq '*.pem' ./.gitignore
|
||||
then
|
||||
echo "# .PEM Certificates" >> .gitignore
|
||||
echo "*.pem" >> .gitignore
|
||||
fi
|
||||
|
||||
echo
|
||||
echo -e "\e[1;92mReady!\e[0m"
|
||||
|
||||
echo -e "\n\e[1;94m**********\nOptional: if you plan on using gulp serve, don't forget to add the container certificate to your local machine. Please visit https://aka.ms/spfx-devcontainer for more information\n**********"
|
|
@ -0,0 +1,37 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
|
||||
# Dependency directories
|
||||
node_modules
|
||||
|
||||
# Build generated files
|
||||
dist
|
||||
lib
|
||||
release
|
||||
solution
|
||||
temp
|
||||
*.sppkg
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# OSX
|
||||
.DS_Store
|
||||
|
||||
# Visual Studio files
|
||||
.ntvs_analysis.dat
|
||||
.vs
|
||||
bin
|
||||
obj
|
||||
|
||||
# Resx Generated Code
|
||||
*.resx.ts
|
||||
|
||||
# Styles Generated Code
|
||||
*.scss.ts
|
||||
# .CER Certificates
|
||||
*.cer
|
||||
# .PEM Certificates
|
||||
*.pem
|
|
@ -0,0 +1,16 @@
|
|||
!dist
|
||||
config
|
||||
|
||||
gulpfile.js
|
||||
|
||||
release
|
||||
src
|
||||
temp
|
||||
|
||||
tsconfig.json
|
||||
tslint.json
|
||||
|
||||
*.log
|
||||
|
||||
.yo-rc.json
|
||||
.vscode
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Hosted workbench",
|
||||
"type": "pwa-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,16 @@
|
|||
{
|
||||
"@microsoft/generator-sharepoint": {
|
||||
"plusBeta": true,
|
||||
"isCreatingSolution": true,
|
||||
"version": "1.14.0-beta.5",
|
||||
"libraryName": "react-ppw-html",
|
||||
"libraryId": "32f04ff0-07c9-4fee-ab26-b488c8f651fa",
|
||||
"environment": "spo",
|
||||
"packageManager": "npm",
|
||||
"solutionName": "react-ppw-html",
|
||||
"solutionShortDescription": "react-ppw-html description",
|
||||
"skipFeatureDeployment": true,
|
||||
"isDomainIsolated": false,
|
||||
"componentType": "webpart"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
# Property Pane Wrapper for HTML Controls
|
||||
|
||||
## Applies to
|
||||
|
||||
- [SharePoint Framework](https://aka.ms/spfx)
|
||||
- [Microsoft 365 tenant](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-developer-tenant)
|
||||
|
||||
> Get your own free development tenant by subscribing to [Microsoft 365 developer program](http://aka.ms/o365devprogram)
|
||||
|
||||
## Summary
|
||||
|
||||
The React-PPW-HTML sample showcases the use of the [Property Pane Wrap](https://www.npmjs.com/package/property-pane-wrap) to embed HTML controls in the SPFx Property Pane.
|
||||
|
||||
![React PPW HTML Sample](./assets/React-PPW-HTML-Sample.png)
|
||||
|
||||
|
||||
## Compatibility
|
||||
|
||||
![SPFx 1.14](https://img.shields.io/badge/SPFx-1.14-green.svg)
|
||||
![Node.js v14 | v12](https://img.shields.io/badge/Node.js-v14%20%7C%20v12-green.svg)
|
||||
![Compatible with SharePoint Online](https://img.shields.io/badge/SharePoint%20Online-Compatible-green.svg)
|
||||
![Does not work with SharePoint 2019](https://img.shields.io/badge/SharePoint%20Server%202019-Incompatible-red.svg "SharePoint Server 2019 requires SPFx 1.4.1 or lower")
|
||||
![Does not work with SharePoint 2016 (Feature Pack 2)](https://img.shields.io/badge/SharePoint%20Server%202016%20(Feature%20Pack%202)-Incompatible-red.svg "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
|
||||
![Local Workbench Unsupported](https://img.shields.io/badge/Local%20Workbench-Unsupported-red.svg "Local workbench is no longer available as of SPFx 1.13 and above")
|
||||
![Hosted Workbench Compatible](https://img.shields.io/badge/Hosted%20Workbench-Compatible-green.svg)
|
||||
![Compatible with Remote Containers](https://img.shields.io/badge/Remote%20Containers-Compatible-green.svg)
|
||||
|
||||
## Solution
|
||||
|
||||
Solution|Author(s)
|
||||
--------|---------
|
||||
React-PPW-HTML | [Christophe Humbert](https://github.com/PathToSharePoint)
|
||||
|
||||
## Version history
|
||||
|
||||
Version|Date|Comments
|
||||
-------|----|--------
|
||||
0.1.0|February 8, 2022|Initial release
|
||||
|
||||
|
||||
## Prerequisites
|
||||
|
||||
N/A
|
||||
|
||||
## Minimal Path to Awesome
|
||||
|
||||
* Clone this repository (or [download this solution as a .ZIP file](https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-ppw-html) then unzip it)
|
||||
* From your command line, change your current directory to the directory containing this sample (`react-ppw-html`, located under `samples`)
|
||||
* in the command line run:
|
||||
* `npm install`
|
||||
* `gulp serve`
|
||||
|
||||
|
||||
> This sample can also be opened with [VS Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview). Visit https://aka.ms/spfx-devcontainer for further instructions.
|
||||
## Features
|
||||
|
||||
The sample web part illustrates the following concepts on top of the SharePoint Framework:
|
||||
- [Property Pane Wrap](https://www.npmjs.com/package/property-pane-wrap) for insertion of components in the Property Pane
|
||||
- HTML controlled and uncontrolled components in the Property Pane
|
||||
- HTML5 validity check
|
||||
- Control interdependencies (End Date >= Start Date)
|
||||
|
||||
## References
|
||||
|
||||
- [Getting started with SharePoint Framework](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-developer-tenant)
|
||||
- [Building for Microsoft teams](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/build-for-teams-overview)
|
||||
- [Use Microsoft Graph in your solution](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/using-microsoft-graph-apis)
|
||||
- [Publish SharePoint Framework applications to the Marketplace](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/publish-to-marketplace-overview)
|
||||
- [Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) - Guidance, tooling, samples and open-source controls for your Microsoft 365 development
|
||||
|
||||
|
||||
## Help
|
||||
|
||||
We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.
|
||||
|
||||
If you're having issues building the solution, please run [spfx doctor](https://pnp.github.io/cli-microsoft365/cmd/spfx/spfx-doctor/) from within the solution folder to diagnose incompatibility issues with your environment.
|
||||
|
||||
You can try looking at [issues related to this sample](https://github.com/pnp/sp-dev-fx-webparts/issues?q=label%3A%22sample%3A%20react-ppw-html%22) to see if anybody else is having the same issues.
|
||||
|
||||
You can also try looking at [discussions related to this sample](https://github.com/pnp/sp-dev-fx-webparts/discussions?discussions_q=react-ppw-html) and see what the community is saying.
|
||||
|
||||
If you encounter any issues while using this sample, [create a new issue](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected%2Csample%3A%20react-ppw-html&template=bug-report.yml&sample=react-ppw-html&authors=@PathToSharePoint&title=react-ppw-html%20-%20).
|
||||
|
||||
For questions regarding this sample, [create a new question](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aquestion%2Csample%3A%20react-ppw-html&template=question.yml&sample=react-ppw-html&authors=@PathToSharePoint&title=react-ppw-html%20-%20).
|
||||
|
||||
Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aenhancement%2Csample%3A%20react-ppw-html&template=suggestion.yml&sample=react-ppw-html&authors=@PathToSharePoint&title=react-ppw-html%20-%20).
|
||||
|
||||
|
||||
## 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.**
|
||||
|
||||
|
||||
<img src="https://pnptelemetry.azurewebsites.net/sp-dev-fx-webparts/samples/react-ppw-html" />
|
After Width: | Height: | Size: 227 KiB |
|
@ -0,0 +1,49 @@
|
|||
[
|
||||
{
|
||||
"name": "pnp-sp-dev-spfx-web-parts-react-ppw-html",
|
||||
"source": "pnp",
|
||||
"title": "Property Pane Wrapper for HTML Controls",
|
||||
"shortDescription": "Showcases the use of the Property Pane Wrap to embed HTML controls in the SPFx Property Pane",
|
||||
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-ppw-html",
|
||||
"longDescription": [
|
||||
"Showcases the use of the Property Pane Wrap to embed HTML controls in the SPFx Property Pane"
|
||||
],
|
||||
"creationDateTime": "2022-02-10",
|
||||
"updateDateTime": "2022-02-10",
|
||||
"products": [
|
||||
"SharePoint"
|
||||
],
|
||||
"metadata": [
|
||||
{
|
||||
"key": "CLIENT-SIDE-DEV",
|
||||
"value": "React"
|
||||
},
|
||||
{
|
||||
"key": "SPFX-VERSION",
|
||||
"value": "1.14"
|
||||
}
|
||||
],
|
||||
"thumbnails": [
|
||||
{
|
||||
"type": "image",
|
||||
"order": 100,
|
||||
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-ppw-html/assets/React-PPW-HTML-Sample.png",
|
||||
"alt": "Web Part Preview"
|
||||
}
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"gitHubAccount": "PathToSharePoint",
|
||||
"pictureUrl": "https://github.com/PathToSharePoint.png",
|
||||
"name": "Christophe Humbert"
|
||||
}
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"name": "Build your first SharePoint client-side web part",
|
||||
"description": "Client-side web parts are client-side components that run in the context of a SharePoint page. Client-side web parts can be deployed to SharePoint environments that support the SharePoint Framework. You can also use modern JavaScript web frameworks, tools, and libraries to build them.",
|
||||
"url": "https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
|
||||
"version": "2.0",
|
||||
"bundles": {
|
||||
"hello-world-web-part": {
|
||||
"components": [
|
||||
{
|
||||
"entrypoint": "./lib/webparts/helloWorld/HelloWorldWebPart.js",
|
||||
"manifest": "./src/webparts/helloWorld/HelloWorldWebPart.manifest.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"externals": {},
|
||||
"localizedResources": {
|
||||
"HelloWorldWebPartStrings": "lib/webparts/helloWorld/loc/{locale}.js"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
|
||||
"workingDir": "./release/assets/",
|
||||
"account": "<!-- STORAGE ACCOUNT NAME -->",
|
||||
"container": "react-ppw-html",
|
||||
"accessKey": "<!-- ACCESS KEY -->"
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
|
||||
"solution": {
|
||||
"name": "react-ppw-html-client-side-solution",
|
||||
"id": "32f04ff0-07c9-4fee-ab26-b488c8f651fa",
|
||||
"version": "1.0.0.0",
|
||||
"includeClientSideAssets": true,
|
||||
"skipFeatureDeployment": true,
|
||||
"isDomainIsolated": false,
|
||||
"developer": {
|
||||
"name": "Christophe Humbert",
|
||||
"websiteUrl": "",
|
||||
"privacyUrl": "",
|
||||
"termsOfUseUrl": "",
|
||||
"mpnId": "Undefined-1.14.0-beta.5"
|
||||
},
|
||||
"metadata": {
|
||||
"shortDescription": {
|
||||
"default": "react-ppw-html description"
|
||||
},
|
||||
"longDescription": {
|
||||
"default": "react-ppw-html description"
|
||||
},
|
||||
"screenshotPaths": [],
|
||||
"videoUrl": "",
|
||||
"categories": []
|
||||
},
|
||||
"features": [
|
||||
{
|
||||
"title": "react-ppw-html Feature",
|
||||
"description": "The feature that activates elements of the react-ppw-html solution.",
|
||||
"id": "183a5d23-8799-4cd2-a67c-576fd323270b",
|
||||
"version": "1.0.0.0"
|
||||
}
|
||||
]
|
||||
},
|
||||
"paths": {
|
||||
"zippedPackage": "solution/react-ppw-html.sppkg"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json",
|
||||
"port": 4321,
|
||||
"https": true,
|
||||
"initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json",
|
||||
"cdnBasePath": "<!-- PATH TO CDN -->"
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
'use strict';
|
||||
|
||||
const build = require('@microsoft/sp-build-web');
|
||||
|
||||
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);
|
||||
|
||||
var getTasks = build.rig.getTasks;
|
||||
build.rig.getTasks = function () {
|
||||
var result = getTasks.call(build.rig);
|
||||
|
||||
result.set('serve', result.get('serve-deprecated'));
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
build.initialize(require('gulp'));
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"name": "react-ppw-html",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
"build": "gulp bundle",
|
||||
"clean": "gulp clean",
|
||||
"test": "gulp test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/sp-core-library": "1.14.0-beta.5",
|
||||
"@microsoft/sp-lodash-subset": "1.14.0-beta.5",
|
||||
"@microsoft/sp-office-ui-fabric-core": "1.14.0-beta.5",
|
||||
"@microsoft/sp-property-pane": "1.14.0-beta.5",
|
||||
"@microsoft/sp-webpart-base": "1.14.0-beta.5",
|
||||
"office-ui-fabric-react": "7.174.1",
|
||||
"property-pane-wrap": "^0.3.0",
|
||||
"react": "16.13.1",
|
||||
"react-dom": "16.13.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "16.9.51",
|
||||
"@types/react-dom": "16.9.8",
|
||||
"@microsoft/sp-build-web": "1.14.0-beta.5",
|
||||
"@microsoft/sp-tslint-rules": "1.14.0-beta.5",
|
||||
"@microsoft/sp-module-interfaces": "1.14.0-beta.5",
|
||||
"@microsoft/rush-stack-compiler-3.9": "0.4.47",
|
||||
"gulp": "~4.0.2",
|
||||
"ajv": "~5.2.2",
|
||||
"@types/webpack-env": "1.13.1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
// A file is required to be in the root of the /src directory by the TypeScript compiler
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json",
|
||||
"id": "6cb508f6-527c-4b6d-82d5-5337e28b2b63",
|
||||
"alias": "HelloWorldWebPart",
|
||||
"componentType": "WebPart",
|
||||
|
||||
// The "*" signifies that the version should be taken from the package.json
|
||||
"version": "*",
|
||||
"manifestVersion": 2,
|
||||
|
||||
// If true, the component can only be installed on sites where Custom Script is allowed.
|
||||
// Components that allow authors to embed arbitrary script code should set this to true.
|
||||
// https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f
|
||||
"requiresCustomScript": false,
|
||||
"supportedHosts": ["SharePointWebPart", "TeamsPersonalApp", "TeamsTab", "SharePointFullPage"],
|
||||
"supportsThemeVariants": true,
|
||||
|
||||
"preconfiguredEntries": [{
|
||||
"groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other
|
||||
"group": { "default": "Other" },
|
||||
"title": { "default": "Property Pane HTML Controls" },
|
||||
"description": { "default": "Use of the Property Pane Wrap (PPW) to insert HTML controls in the Property Pane." },
|
||||
"officeFabricIconFontName": "PageHeaderEdit",
|
||||
"properties": {
|
||||
"description": "Property Pane Wrap",
|
||||
"fieldsetDatesInput": ["", ""],
|
||||
"fieldsetColorInput": "#008080",
|
||||
"fieldsetCheckbox": true,
|
||||
"fieldsetCascadingSelect": ["", ""]
|
||||
}
|
||||
}]
|
||||
}
|
|
@ -0,0 +1,170 @@
|
|||
.urlInput {
|
||||
width: 100%;
|
||||
font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
box-shadow: none;
|
||||
margin: 0px;
|
||||
padding: 0px 8px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 0px;
|
||||
border: none;
|
||||
background: none transparent;
|
||||
color: rgb(255, 255, 255);
|
||||
width: 100%;
|
||||
min-width: 0px;
|
||||
text-overflow: ellipsis;
|
||||
outline: 0px;
|
||||
box-shadow: none;
|
||||
margin: 0px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid rgb(208, 208, 208);
|
||||
border-radius: 2px;
|
||||
background: rgb(24, 37, 52);
|
||||
height: 32px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
&:invalid {
|
||||
border: 1px solid red;
|
||||
}
|
||||
}
|
||||
|
||||
.fieldset {
|
||||
border: none;
|
||||
padding: 0!important;
|
||||
width: 100%;
|
||||
input {
|
||||
font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
box-shadow: none;
|
||||
margin: 0px;
|
||||
padding: 0px 8px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 0px;
|
||||
border: none;
|
||||
background: none transparent;
|
||||
color: rgb(255, 255, 255);
|
||||
width: 100%;
|
||||
min-width: 0px;
|
||||
text-overflow: ellipsis;
|
||||
outline: 0px;
|
||||
box-shadow: none;
|
||||
margin: 0px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid rgb(208, 208, 208);
|
||||
border-radius: 2px;
|
||||
background: rgb(24, 37, 52);
|
||||
height: 32px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
&:invalid {
|
||||
border: 1px solid red;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fieldsetDatesInput {
|
||||
display: flex!important;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
input[type=date] {
|
||||
width: 139px!important;
|
||||
padding: 4px!important;
|
||||
&::-webkit-datetime-edit-text {
|
||||
font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
&::-webkit-calendar-picker-indicator {
|
||||
background: teal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fieldsetColorInput {
|
||||
input {
|
||||
width:100%;
|
||||
}
|
||||
}
|
||||
|
||||
.fieldsetCheckbox {
|
||||
width: 100%;
|
||||
display: flex!important;
|
||||
align-items: center;
|
||||
input {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
.fieldsetCheckboxDarkLight {
|
||||
--black: #333333;
|
||||
--white: #f5f5f5;
|
||||
--backround: var(--white);
|
||||
--foreground: var(--black);
|
||||
--transition: 0.5s ease;
|
||||
width: 100%;
|
||||
display: flex!important;
|
||||
align-items: center;
|
||||
label {
|
||||
display: block;
|
||||
}
|
||||
input[type="checkbox"] + div {
|
||||
height: 37px;
|
||||
width: 80px;
|
||||
background: var(--black);
|
||||
border-radius: 30px;
|
||||
padding: 2px;
|
||||
position: relative;
|
||||
transition: background var(--transition);
|
||||
cursor: pointer;
|
||||
border: 1px solid var(--white);
|
||||
}
|
||||
input[type="checkbox"]:checked + div {
|
||||
background: var(--white);
|
||||
}
|
||||
input[type="checkbox"] + div span::before {
|
||||
content: "";
|
||||
display: block;
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
border-radius: 30px;
|
||||
padding: 2px;
|
||||
background: var(--white);
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
transform: translate(0);
|
||||
transition: transform var(--transition), background var(--transition);
|
||||
}
|
||||
input[type="checkbox"]:checked + div span::before {
|
||||
background: var(--black);
|
||||
}
|
||||
input[type="checkbox"]:checked + div span::before {
|
||||
transform: translateX(44px);
|
||||
}
|
||||
input[type="checkbox"] {
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
}
|
||||
div div {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
input[type="checkbox"] + div div svg {
|
||||
padding: 6px;
|
||||
fill: var(--white);
|
||||
z-index: 0;
|
||||
}
|
||||
input[type="checkbox"]:checked + div div svg {
|
||||
fill: var(--black);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,257 @@
|
|||
import * as React from 'react';
|
||||
import * as ReactDom from 'react-dom';
|
||||
import { Version } from '@microsoft/sp-core-library';
|
||||
import {
|
||||
IPropertyPaneConfiguration,
|
||||
PropertyPaneHorizontalRule,
|
||||
PropertyPaneLabel,
|
||||
PropertyPaneSlider,
|
||||
PropertyPaneTextField
|
||||
} from '@microsoft/sp-property-pane';
|
||||
import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base';
|
||||
import { IReadonlyTheme } from '@microsoft/sp-component-base';
|
||||
|
||||
import * as strings from 'HelloWorldWebPartStrings';
|
||||
import HelloWorld from './components/HelloWorld';
|
||||
import { IHelloWorldProps } from './components/IHelloWorldProps';
|
||||
import { PropertyPaneWrap } from 'property-pane-wrap';
|
||||
import { update } from '@microsoft/sp-lodash-subset';
|
||||
|
||||
import styles from './HelloWorldWebPart.module.scss';
|
||||
import { MoonIcon, SunIcon } from './components/SVGIcons';
|
||||
|
||||
export interface IHelloWorldWebPartProps {
|
||||
description: string;
|
||||
fieldsetColorInput: string;
|
||||
fieldsetDatesInput: string[];
|
||||
fieldsetRangeInput: string;
|
||||
fieldsetURLInput: string;
|
||||
fieldsetCheckboxDarkLight: boolean;
|
||||
fieldsetCheckbox: boolean;
|
||||
fieldsetCascadingSelect: string[];
|
||||
}
|
||||
|
||||
export default class HelloWorldWebPart extends BaseClientSideWebPart<IHelloWorldWebPartProps> {
|
||||
|
||||
private _isDarkTheme: boolean = false;
|
||||
private _environmentMessage: string = '';
|
||||
|
||||
protected onInit(): Promise<void> {
|
||||
this._environmentMessage = this._getEnvironmentMessage();
|
||||
|
||||
return super.onInit();
|
||||
}
|
||||
|
||||
public render(): void {
|
||||
const element: React.ReactElement<IHelloWorldProps> = React.createElement(
|
||||
HelloWorld,
|
||||
{
|
||||
properties: this.properties,
|
||||
isDarkTheme: this._isDarkTheme,
|
||||
environmentMessage: this._environmentMessage,
|
||||
hasTeamsContext: !!this.context.sdks.microsoftTeams,
|
||||
userDisplayName: this.context.pageContext.user.displayName
|
||||
}
|
||||
);
|
||||
|
||||
ReactDom.render(element, this.domElement);
|
||||
}
|
||||
|
||||
private _getEnvironmentMessage(): string {
|
||||
if (!!this.context.sdks.microsoftTeams) { // running in Teams
|
||||
return this.context.isServedFromLocalhost ? strings.AppLocalEnvironmentTeams : strings.AppTeamsTabEnvironment;
|
||||
}
|
||||
|
||||
return this.context.isServedFromLocalhost ? strings.AppLocalEnvironmentSharePoint : strings.AppSharePointEnvironment;
|
||||
}
|
||||
|
||||
protected onThemeChanged(currentTheme: IReadonlyTheme | undefined): void {
|
||||
if (!currentTheme) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._isDarkTheme = !!currentTheme.isInverted;
|
||||
const {
|
||||
semanticColors
|
||||
} = currentTheme;
|
||||
this.domElement.style.setProperty('--bodyText', semanticColors.bodyText);
|
||||
this.domElement.style.setProperty('--link', semanticColors.link);
|
||||
this.domElement.style.setProperty('--linkHovered', semanticColors.linkHovered);
|
||||
|
||||
}
|
||||
|
||||
protected onDispose(): void {
|
||||
ReactDom.unmountComponentAtNode(this.domElement);
|
||||
}
|
||||
|
||||
protected get dataVersion(): Version {
|
||||
return Version.parse('1.0');
|
||||
}
|
||||
|
||||
public updateWebPartProperty(property, value, refreshWebPart = true, refreshPropertyPane = true) {
|
||||
|
||||
update(this.properties, property, () => value);
|
||||
if (refreshWebPart) this.render();
|
||||
if (refreshPropertyPane) this.context.propertyPane.refresh();
|
||||
|
||||
}
|
||||
|
||||
protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
|
||||
return {
|
||||
pages: [
|
||||
{
|
||||
header: {
|
||||
description: strings.PropertyPaneDescription
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
groupName: "HTML Controls",
|
||||
groupFields: [
|
||||
PropertyPaneHorizontalRule(),
|
||||
PropertyPaneLabel('fieldsetColorInput', { text: 'Color Input' }),
|
||||
PropertyPaneWrap('fieldsetColorInput', {
|
||||
component: () =>
|
||||
<fieldset className={`${styles.fieldset} ${styles.fieldsetColorInput}`}>
|
||||
<input
|
||||
type="color"
|
||||
defaultValue={this.properties["fieldsetColorInput"]}
|
||||
onChange={(e: any) => this.updateWebPartProperty("fieldsetColorInput", e.target.value, true, false)}
|
||||
></input>
|
||||
</fieldset>
|
||||
}),
|
||||
PropertyPaneHorizontalRule(),
|
||||
PropertyPaneLabel('fieldsetDatesInput', { text: 'Date Input (Start, End)' }),
|
||||
PropertyPaneWrap('fieldsetDatesInput', {
|
||||
component: () =>
|
||||
<fieldset className={`${styles.fieldset} ${styles.fieldsetDatesInput}`}>
|
||||
<input
|
||||
type="date"
|
||||
defaultValue={this.properties["fieldsetDatesInput"][0]}
|
||||
max={this.properties["fieldsetDatesInput"][1]}
|
||||
onChange={(e: any) => e.target.checkValidity() && this.updateWebPartProperty("fieldsetDatesInput", [e.target.value, this.properties["fieldsetDatesInput"][1]], true)}
|
||||
></input>
|
||||
<input
|
||||
type="date"
|
||||
defaultValue={this.properties["fieldsetDatesInput"][1]}
|
||||
min={this.properties["fieldsetDatesInput"][0]}
|
||||
onChange={(e: any) => e.target.checkValidity() && this.updateWebPartProperty("fieldsetDatesInput", [this.properties["fieldsetDatesInput"][0], e.target.value], true)}
|
||||
></input>
|
||||
</fieldset>
|
||||
}),
|
||||
PropertyPaneHorizontalRule(),
|
||||
PropertyPaneLabel('fieldsetRangeInput', { text: 'Range Input' }),
|
||||
PropertyPaneWrap('fieldsetRangeInput', {
|
||||
component: () =>
|
||||
<fieldset className={`${styles.fieldset}`}>
|
||||
<input
|
||||
type="range"
|
||||
list={`tickmarks-fieldsetRangeInput-${this.instanceId}`}
|
||||
defaultValue={this.properties["fieldsetRangeInput"]}
|
||||
onChange={(e: any) => this.updateWebPartProperty("fieldsetRangeInput", e.target.value)}
|
||||
></input>
|
||||
<datalist id={`tickmarks-fieldsetRangeInput-${this.instanceId}`}>
|
||||
<option value="0" label="0"></option>
|
||||
<option value="25" label="25"></option>
|
||||
<option value="50" label="50"></option>
|
||||
<option value="75" label="75"></option>
|
||||
<option value="100" label="100"></option>
|
||||
</datalist>
|
||||
</fieldset>
|
||||
}),
|
||||
PropertyPaneHorizontalRule(),
|
||||
PropertyPaneLabel('fieldsetURLInput', { text: 'SharePoint Online Site URL' }),
|
||||
PropertyPaneWrap('fieldsetURLInput', {
|
||||
component: (props) => <input {...props} />,
|
||||
props: {
|
||||
className: styles.urlInput,
|
||||
type: "url",
|
||||
defaultValue: this.properties["fieldsetURLInput"],
|
||||
placeholder: "https://tenant.sharepoint.com/sites/name",
|
||||
pattern: "https://.*\.sharepoint.com/sites/.+",
|
||||
onChange: (e: any) => {
|
||||
e.target.checkValidity() && this.updateWebPartProperty("fieldsetURLInput", e.target.value, true, false);
|
||||
}
|
||||
}
|
||||
}),
|
||||
PropertyPaneHorizontalRule(),
|
||||
PropertyPaneLabel('fieldsetCheckboxDarkLight', { text: 'Checkbox as Toggle Button' }),
|
||||
PropertyPaneWrap('fieldsetCheckboxDarkLight', {
|
||||
component: () =>
|
||||
<label className={`${styles.fieldset} ${styles.fieldsetCheckboxDarkLight}`}>
|
||||
<input
|
||||
type="checkbox"
|
||||
defaultChecked={this.properties["fieldsetCheckboxDarkLight"]}
|
||||
onChange={(e: any) => this.updateWebPartProperty("fieldsetCheckboxDarkLight", e.target.checked, true, false)}
|
||||
></input>
|
||||
<div>
|
||||
<span>
|
||||
</span>
|
||||
<div>
|
||||
<SunIcon />
|
||||
<MoonIcon />
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
}),
|
||||
PropertyPaneHorizontalRule(),
|
||||
PropertyPaneLabel('fieldsetCheckbox', { text: 'Checkbox' }),
|
||||
PropertyPaneWrap('fieldsetCheckbox', {
|
||||
component: (props) =>
|
||||
<div className={styles.fieldsetCheckbox}>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={this.properties["fieldsetCheckbox"]}
|
||||
onChange={(e: any) => this.updateWebPartProperty("fieldsetCheckbox", e.target.checked)}
|
||||
></input>
|
||||
<span>
|
||||
 {(this.properties["fieldsetCheckbox"]) ? "Checked" : "Unchecked"}
|
||||
</span>
|
||||
</div>
|
||||
}),
|
||||
]
|
||||
},
|
||||
{
|
||||
groupName: strings.BasicGroupName,
|
||||
groupFields: [
|
||||
PropertyPaneHorizontalRule(),
|
||||
PropertyPaneTextField('description', {
|
||||
label: strings.PropertyPaneTextFieldLabel
|
||||
})
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// <fieldset data-property="fieldsetCascadingSelect" >
|
||||
// <label>Cascading Select</label>
|
||||
// <div className="flexControl">
|
||||
// <select
|
||||
// className='select-css'
|
||||
// value={this.properties["fieldsetCascadingSelect"][0]}
|
||||
// onChange={(e: any) => {
|
||||
// this.updateWebPartProperty("fieldsetCascadingSelect", [e.target.value, ""]);
|
||||
// }
|
||||
// }
|
||||
// >
|
||||
// <option value="">Select Family...</option>
|
||||
// {familiesList
|
||||
// .map(item => <option value={item.value}>{item.name}</option>)}
|
||||
// </select>
|
||||
// <select
|
||||
// className='select-css'
|
||||
// value={this.properties["fieldsetCascadingSelect"][1]}
|
||||
// onChange={(e: any) => this.updateWebPartProperty("fieldsetCascadingSelect", [this.properties["fieldsetCascadingSelect"][0], e.target.value])}
|
||||
// >
|
||||
// <option value="">Select App...</option>
|
||||
// {(this.properties["fieldsetCascadingSelect"]) && appsList
|
||||
// .filter(i => i.parent == this.properties["fieldsetCascadingSelect"][0])
|
||||
// .map(item => <option value={item.value}>{item.name}</option>)}
|
||||
// </select>
|
||||
// </div>
|
||||
// </fieldset>
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 11.807C10.7418 10.5483 9.88488 8.94484 9.53762 7.1993C9.19037 5.45375 9.36832 3.64444 10.049 2C8.10826 2.38205 6.3256 3.33431 4.92899 4.735C1.02399 8.64 1.02399 14.972 4.92899 18.877C8.83499 22.783 15.166 22.782 19.072 18.877C20.4723 17.4805 21.4245 15.6983 21.807 13.758C20.1625 14.4385 18.3533 14.6164 16.6077 14.2692C14.8622 13.9219 13.2588 13.0651 12 11.807V11.807Z" />
|
||||
</svg>
|
After Width: | Height: | Size: 489 B |
|
@ -0,0 +1,7 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M6.995 12C6.995 14.761 9.241 17.007 12.002 17.007C14.763 17.007 17.009 14.761 17.009 12C17.009 9.239 14.763 6.993 12.002 6.993C9.241 6.993 6.995 9.239 6.995 12ZM11 19H13V22H11V19ZM11 2H13V5H11V2ZM2 11H5V13H2V11ZM19 11H22V13H19V11Z" />
|
||||
<path d="M5.63702 19.778L4.22302 18.364L6.34402 16.243L7.75802 17.657L5.63702 19.778Z" />
|
||||
<path d="M16.242 6.34405L18.364 4.22205L19.778 5.63605L17.656 7.75805L16.242 6.34405Z" />
|
||||
<path d="M6.34402 7.75902L4.22302 5.63702L5.63802 4.22302L7.75802 6.34502L6.34402 7.75902Z" />
|
||||
<path d="M19.778 18.3639L18.364 19.7779L16.242 17.6559L17.656 16.2419L19.778 18.3639Z" />
|
||||
</svg>
|
After Width: | Height: | Size: 711 B |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 12 KiB |
|
@ -0,0 +1,46 @@
|
|||
@import '~office-ui-fabric-react/dist/sass/References.scss';
|
||||
|
||||
.helloWorld {
|
||||
overflow: hidden;
|
||||
padding: 1em;
|
||||
color: "[theme:bodyText, default: #323130]";
|
||||
color: var(--bodyText);
|
||||
&.teams {
|
||||
font-family: $ms-font-family-fallbacks;
|
||||
}
|
||||
}
|
||||
|
||||
.welcome {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.welcomeImage {
|
||||
width: 100%;
|
||||
max-width: 420px;
|
||||
}
|
||||
|
||||
.links {
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: "[theme:link, default:#03787c]";
|
||||
color: var(--link); // note: CSS Custom Properties support is limited to modern browsers only
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
color: "[theme:linkHovered, default: #014446]";
|
||||
color: var(--linkHovered); // note: CSS Custom Properties support is limited to modern browsers only
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.propertyTable {
|
||||
border-collapse: collapse;
|
||||
th {
|
||||
padding: 10px;
|
||||
}
|
||||
td {
|
||||
text-align: left;
|
||||
border: 1px solid teal;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
import * as React from 'react';
|
||||
import styles from './HelloWorld.module.scss';
|
||||
import { IHelloWorldProps } from './IHelloWorldProps';
|
||||
import { escape } from '@microsoft/sp-lodash-subset';
|
||||
|
||||
export default class HelloWorld extends React.Component<IHelloWorldProps, {}> {
|
||||
public render(): React.ReactElement<IHelloWorldProps> {
|
||||
const {
|
||||
properties,
|
||||
isDarkTheme,
|
||||
environmentMessage,
|
||||
hasTeamsContext,
|
||||
userDisplayName
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<section className={`${styles.helloWorld} ${hasTeamsContext ? styles.teams : ''}`}>
|
||||
<div className={styles.welcome}>
|
||||
<h2>Select the Edit button to open the Property Pane.</h2>
|
||||
<img alt="" src={isDarkTheme ? require('../assets/welcome-dark.png') : require('../assets/welcome-light.png')} className={styles.welcomeImage} />
|
||||
<h2>Well done, {escape(userDisplayName)}!</h2>
|
||||
<div>{environmentMessage}</div>
|
||||
<table className={styles.propertyTable}>
|
||||
<tr>
|
||||
<th>Property</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
{Object.keys(properties).map(key => {
|
||||
return (
|
||||
<tr key={key}>
|
||||
<td>{key}</td>
|
||||
<td><strong>{escape(properties[key])}</strong></td>
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Welcome to SharePoint Framework!</h3>
|
||||
<p>
|
||||
The SharePoint Framework (SPFx) is a extensibility model for Microsoft Viva, Microsoft Teams and SharePoint. It's the easiest way to extend Microsoft 365 with automatic Single Sign On, automatic hosting and industry standard tooling.
|
||||
</p>
|
||||
<h4>Learn more about SPFx development:</h4>
|
||||
<ul className={styles.links}>
|
||||
<li><a href="https://aka.ms/spfx" target="_blank">SharePoint Framework Overview</a></li>
|
||||
<li><a href="https://aka.ms/spfx-yeoman-graph" target="_blank">Use Microsoft Graph in your solution</a></li>
|
||||
<li><a href="https://aka.ms/spfx-yeoman-teams" target="_blank">Build for Microsoft Teams using SharePoint Framework</a></li>
|
||||
<li><a href="https://aka.ms/spfx-yeoman-viva" target="_blank">Build for Microsoft Viva Connections using SharePoint Framework</a></li>
|
||||
<li><a href="https://aka.ms/spfx-yeoman-store" target="_blank">Publish SharePoint Framework applications to the marketplace</a></li>
|
||||
<li><a href="https://aka.ms/spfx-yeoman-api" target="_blank">SharePoint Framework API reference</a></li>
|
||||
<li><a href="https://aka.ms/m365pnp" target="_blank">Microsoft 365 Developer Community</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
export interface IHelloWorldProps {
|
||||
properties: object;
|
||||
isDarkTheme: boolean;
|
||||
environmentMessage: string;
|
||||
hasTeamsContext: boolean;
|
||||
userDisplayName: string;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
import * as React from 'react';
|
||||
|
||||
const SunIcon: React.FunctionComponent = () => {
|
||||
return (
|
||||
<>
|
||||
{/* sgv sun icon */}
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M6.995 12C6.995 14.761 9.241 17.007 12.002 17.007C14.763 17.007 17.009 14.761 17.009 12C17.009 9.239 14.763 6.993 12.002 6.993C9.241 6.993 6.995 9.239 6.995 12ZM11 19H13V22H11V19ZM11 2H13V5H11V2ZM2 11H5V13H2V11ZM19 11H22V13H19V11Z" />
|
||||
<path d="M5.63702 19.778L4.22302 18.364L6.34402 16.243L7.75802 17.657L5.63702 19.778Z" />
|
||||
<path d="M16.242 6.34405L18.364 4.22205L19.778 5.63605L17.656 7.75805L16.242 6.34405Z" />
|
||||
<path d="M6.34402 7.75902L4.22302 5.63702L5.63802 4.22302L7.75802 6.34502L6.34402 7.75902Z" />
|
||||
<path d="M19.778 18.3639L18.364 19.7779L16.242 17.6559L17.656 16.2419L19.778 18.3639Z" />
|
||||
</svg>
|
||||
</>
|
||||
);
|
||||
};
|
||||
const MoonIcon: React.FunctionComponent = () => {
|
||||
return (
|
||||
<>
|
||||
{/* svg moon icon */}
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 11.807C10.7418 10.5483 9.88488 8.94484 9.53762 7.1993C9.19037 5.45375 9.36832 3.64444 10.049 2C8.10826 2.38205 6.3256 3.33431 4.92899 4.735C1.02399 8.64 1.02399 14.972 4.92899 18.877C8.83499 22.783 15.166 22.782 19.072 18.877C20.4723 17.4805 21.4245 15.6983 21.807 13.758C20.1625 14.4385 18.3533 14.6164 16.6077 14.2692C14.8622 13.9219 13.2588 13.0651 12 11.807V11.807Z" />
|
||||
</svg>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export { SunIcon, MoonIcon };
|
|
@ -0,0 +1,11 @@
|
|||
define([], function() {
|
||||
return {
|
||||
"PropertyPaneDescription": "Property Pane Wrap for HTML Controls",
|
||||
"BasicGroupName": "Standard Field",
|
||||
"PropertyPaneTextFieldLabel": "PropertyPaneTextField",
|
||||
"AppLocalEnvironmentSharePoint": "The app is running on your local environment as SharePoint web part",
|
||||
"AppLocalEnvironmentTeams": "The app is running on your local environment as Microsoft Teams app",
|
||||
"AppSharePointEnvironment": "The app is running on SharePoint page",
|
||||
"AppTeamsTabEnvironment": "The app is running in Microsoft Teams"
|
||||
}
|
||||
});
|
|
@ -0,0 +1,14 @@
|
|||
declare interface IHelloWorldWebPartStrings {
|
||||
PropertyPaneDescription: string;
|
||||
BasicGroupName: string;
|
||||
PropertyPaneTextFieldLabel: string;
|
||||
AppLocalEnvironmentSharePoint: string;
|
||||
AppLocalEnvironmentTeams: string;
|
||||
AppSharePointEnvironment: string;
|
||||
AppTeamsTabEnvironment: string;
|
||||
}
|
||||
|
||||
declare module 'HelloWorldWebPartStrings' {
|
||||
const strings: IHelloWorldWebPartStrings;
|
||||
export = strings;
|
||||
}
|
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 542 B |
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"extends": "./node_modules/@microsoft/rush-stack-compiler-3.9/includes/tsconfig-web.json",
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"jsx": "react",
|
||||
"declaration": true,
|
||||
"sourceMap": true,
|
||||
"experimentalDecorators": true,
|
||||
"skipLibCheck": true,
|
||||
"outDir": "lib",
|
||||
"inlineSources": false,
|
||||
"strictNullChecks": false,
|
||||
"noUnusedLocals": false,
|
||||
"typeRoots": [
|
||||
"./node_modules/@types",
|
||||
"./node_modules/@microsoft"
|
||||
],
|
||||
"types": [
|
||||
"webpack-env"
|
||||
],
|
||||
"lib": [
|
||||
"es5",
|
||||
"dom",
|
||||
"es2015.collection",
|
||||
"es2015.promise"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"extends": "./node_modules/@microsoft/sp-tslint-rules/base-tslint.json",
|
||||
"rules": {
|
||||
"class-name": false,
|
||||
"export-name": false,
|
||||
"forin": false,
|
||||
"label-position": false,
|
||||
"member-access": true,
|
||||
"no-arg": false,
|
||||
"no-console": false,
|
||||
"no-construct": false,
|
||||
"no-duplicate-variable": true,
|
||||
"no-eval": false,
|
||||
"no-function-expression": true,
|
||||
"no-internal-module": true,
|
||||
"no-shadowed-variable": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-unnecessary-semicolons": true,
|
||||
"no-unused-expression": true,
|
||||
"no-with-statement": true,
|
||||
"semicolon": true,
|
||||
"trailing-comma": false,
|
||||
"typedef": false,
|
||||
"typedef-whitespace": false,
|
||||
"use-named-parameter": true,
|
||||
"variable-name": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|