Skip to content

Commit

Permalink
Added vertical config
Browse files Browse the repository at this point in the history
  • Loading branch information
wobba committed Apr 3, 2023
1 parent 0fb0ca7 commit a57a77d
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 73 deletions.
74 changes: 36 additions & 38 deletions bing-search-box-spfx/config/package-solution.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,38 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
"name": "bing-search-box-client-side-solution",
"id": "23b36870-5cc2-4c89-80d0-8790f0991995",
"version": "1.0.0.0",
"includeClientSideAssets": true,
"skipFeatureDeployment": true,
"isDomainIsolated": false,
"developer": {
"name": "",
"websiteUrl": "",
"privacyUrl": "",
"termsOfUseUrl": "",
"mpnId": "Undefined-1.15.2"
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
"name": "bing-search-box-client-side-solution",
"id": "23b36870-5cc2-4c89-80d0-8790f0991995",
"version": "1.1.0.0",
"includeClientSideAssets": true,
"skipFeatureDeployment": true,
"isDomainIsolated": false,
"developer": {
"name": "Microsoft Search",
"websiteUrl": "",
"privacyUrl": "",
"termsOfUseUrl": "",
"mpnId": "Undefined-1.15.2"
},
"metadata": {
"shortDescription": {
"default": "Bing Search Box launching Bing@Work"
},
"longDescription": {
"default": "Bing Search Box launching Bing@Work"
},
"screenshotPaths": [],
"videoUrl": "",
"categories": []
},
"features": [{
"title": "bing-search-box Feature",
"description": "The feature that activates elements of the bing-search-box solution.",
"id": "c78dc1ff-006d-4863-ac33-bded35c92359",
"version": "1.1.0.0"
}]
},
"metadata": {
"shortDescription": {
"default": "Bing Search Box description"
},
"longDescription": {
"default": "Bing Search Box description"
},
"screenshotPaths": [],
"videoUrl": "",
"categories": []
},
"features": [
{
"title": "bing-search-box Feature",
"description": "The feature that activates elements of the bing-search-box solution.",
"id": "c78dc1ff-006d-4863-ac33-bded35c92359",
"version": "1.0.0.0"
}
]
},
"paths": {
"zippedPackage": "solution/bing-search-box.sppkg"
}
}
"paths": {
"zippedPackage": "solution/bing-search-box.sppkg"
}
}
60 changes: 30 additions & 30 deletions bing-search-box-spfx/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"name": "bing-search-box",
"version": "0.0.1",
"private": true,
"main": "lib/index.js",
"scripts": {
"build": "gulp bundle",
"clean": "gulp clean",
"test": "gulp test"
},
"dependencies": {
"@microsoft/sp-core-library": "1.15.2",
"@microsoft/sp-lodash-subset": "1.15.2",
"@microsoft/sp-office-ui-fabric-core": "1.15.2",
"@microsoft/sp-property-pane": "1.15.2",
"@microsoft/sp-webpart-base": "1.15.2",
"@pnp/spfx-property-controls": "3.8.0",
"tslib": "2.3.1"
},
"devDependencies": {
"@microsoft/eslint-config-spfx": "1.15.2",
"@microsoft/eslint-plugin-spfx": "1.15.2",
"@microsoft/rush-stack-compiler-4.5": "0.2.2",
"@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.15.2",
"@rushstack/eslint-config": "2.5.1",
"@types/webpack-env": "~1.15.2",
"ajv": "^6.12.5",
"gulp": "4.0.2",
"typescript": "4.5.5"
}
"name": "bing-search-box",
"version": "1.1.0",
"private": true,
"main": "lib/index.js",
"scripts": {
"build": "gulp bundle",
"clean": "gulp clean",
"test": "gulp test"
},
"dependencies": {
"@microsoft/sp-core-library": "1.15.2",
"@microsoft/sp-office-ui-fabric-core": "1.15.2",
"@microsoft/sp-property-pane": "1.15.2",
"@microsoft/sp-webpart-base": "1.15.2",
"@pnp/spfx-property-controls": "^3.12.0",
"tslib": "2.3.1"
},
"devDependencies": {
"@microsoft/eslint-config-spfx": "1.15.2",
"@microsoft/eslint-plugin-spfx": "1.15.2",
"@microsoft/rush-stack-compiler-4.5": "0.2.2",
"@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-loader": "1.15.2",
"@microsoft/sp-module-interfaces": "1.15.2",
"@rushstack/eslint-config": "2.5.1",
"@types/webpack-env": "~1.15.2",
"ajv": "^6.12.5",
"gulp": "4.0.2",
"typescript": "4.5.5"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"version": "*",
"manifestVersion": 2,
"requiresCustomScript": false,
"supportedHosts": ["SharePointWebPart", "SharePointFullPage"],
"supportedHosts": ["SharePointWebPart", "SharePointFullPage", "TeamsTab", "TeamsPersonalApp"],
"supportsThemeVariants": true,

"preconfiguredEntries": [{
"groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Advanced
"groupId": "5c03119e-3074-46fd-976b-c60198311f70",
"group": { "default": "Advanced" },
"title": { "default": "Bing Search Box" },
"description": { "default": "Bing Search Box description" },
"description": { "default": "Bing Search Box launching Bing@Work" },
"officeFabricIconFontName": "WebSearch",
"properties": {
"width": 560,
Expand All @@ -22,7 +22,8 @@
"cornerRadius": 6,
"strokeOutline": true,
"dropShadow": true,
"ghostText": "Contoso"
"ghostText": "Contoso",
"verticalName": ""
}
}]
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import bfb from 'bfb';
import * as strings from 'BingSearchBoxWebPartStrings';

export interface IBingSearchBoxWebPartProps {
verticalName: string;
width: number;
height: number;
title: string;
Expand All @@ -34,14 +35,15 @@ export default class BingSearchBoxWebPart extends BaseClientSideWebPart<IBingSea

const bfbSearchBoxConfig = {
containerSelector: "bfb_searchbox",
vertical: this.properties.verticalName, // default: "All"
width: this.properties.width, // default: 560, min: 360, max: 650
height: this.properties.height, // default: 40, min: 40, max: 72
title: this.properties.title, // default: "Bing search box"
cornerRadius: this.properties.cornerRadius, // default: 6, min: 0, max: 25
strokeOutline: this.properties.strokeOutline, // default: true
dropShadow: this.properties.dropShadow, // default: true
iconColor: this._iconColor, // default: #067FA6
companyNameInGhostText: this.properties.ghostText // default: not specified
companyNameInGhostText: this.properties.ghostText, // default: not specified
// when absent, ghost text will be "Search work and the web"
// when specified, text will be "Search the web and [Contoso]"
};
Expand Down Expand Up @@ -103,6 +105,7 @@ export default class BingSearchBoxWebPart extends BaseClientSideWebPart<IBingSea
PropertyFieldNumber('width', { key:"width", label: "Width", minValue: 360, maxValue: 650, value:this.properties.width }),
PropertyFieldNumber('height', { key:"height", label: "Height", minValue: 40, maxValue: 72, value:this.properties.height }),
PropertyPaneTextField('title', { label: "Accessibility title" }),
PropertyPaneTextField('verticalName', { label: "Redirect to vertical", description: "Leave empty to search the All vertical. E.g. 'File-files' for the files vertical and 'Connectors-<id>' for a connector vertical." }),
PropertyFieldNumber('cornerRadius', { key:"cornerRadius", label: "Corner radius", minValue: 0, maxValue: 25, value:this.properties.cornerRadius }),
PropertyPaneToggle('strokeOutline', { label: "Stroke outline" }),
PropertyPaneToggle('dropShadow', { label: "Drop shadow" }),
Expand Down

0 comments on commit a57a77d

Please sign in to comment.