This is a NumberPicker custom control to be used at the PropertyPane
Usage:
- Install dependencies with the command npm install
- Import the numberPicker module on your SPFx project
import {NumberPicker} from 'path_to_numberPicker/numberPicker';
- Define a number type property
items:number;
- Create a new NumberPicker Instance on the PropertyPaneConfiguration
new NumberPicker("items", {
applyOnClick: false,
deferredValidationTime: 0,
label: "Picker",
description: "This is the number picker control",
max:100,
min:1,
properties: this.properties
})
a) After a .scss change, compile the .css with the command npm run scss
b) Recompile the module with the command tsc after any change
Parameter | type | Description | Default | Required |
---|---|---|---|---|
applyOnClick | boolean | Apply changes in a button click | false | No |
deferredValidationTime | number | Delay (milliseconds) before trigger changes | 0 | No |
label | string | The label of the control | Yes | |
description | string | A bottom description of the control | No | |
max | number | The maximum valid value | Yes | |
min | number | The minimum valid value | Yes | |
properties | any | The properties object | Yes |
GitHub: https://github.com/Barba76/SPFx-NumberPicker-Control