diff --git a/README.md b/README.md index 7786ac6..6067807 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# NumberSpinner +# budibase-component-number-spinner A Budibase **number field form input wrapper** for https://github.com/bohnacker/svelte-number-spinner @@ -6,19 +6,9 @@ A Budibase **number field form input wrapper** for https://github.com/bohnacker/ # Description -A number input that can be controlled with the mouse and keyboard +A number input that can be controlled with the mouse and keyboard. -Find out more about [Budibase](https://github.com/Budibase/budibase). +Adjust the mininum and maximum values, as well as the speed, decimals and step of the spinner. -## Instructions - -To build your new plugin run the following in your Budibase CLI: -``` -budi plugins --build -``` - -You can also re-build everytime you make a change to your plugin with the command: -``` -budi plugins --watch -``` +You can check the circular checkbox to loop the max into the min value and vice-versa diff --git a/package.json b/package.json index d71389f..9ae2791 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "NumberSpinner", - "version": "1.0.0", + "name": "budibase-component-number-spinner", + "version": "1.1.0", "description": "A number input that can be controlled with the mouse and keyboard", "license": "MIT", "svelte": "index.js", diff --git a/schema.json b/schema.json index 98c8e53..9d40148 100644 --- a/schema.json +++ b/schema.json @@ -2,7 +2,7 @@ "type": "component", "metadata": {}, "schema": { - "name": "NumberSpinner", + "name": "budibase-component-number-spinner", "friendlyName": "Number Spinner", "description": "A number input that can be controlled with the mouse and keyboard", "icon": "MoveLeftRight", @@ -13,6 +13,11 @@ "label": "Field", "required": true }, + { + "type": "text", + "label": "Label", + "key": "label" + }, { "type": "select", "label": "Alignment", @@ -78,6 +83,42 @@ "value": "XXXL" } ] + }, + { + "type": "number", + "label": "Min", + "key": "min", + "defaultValue": -1000 + }, + { + "type": "number", + "label": "Max", + "key": "max", + "defaultValue": 1000 + }, + { + "type": "number", + "label": "Speed", + "key": "speed", + "defaultValue": 1 + }, + { + "type": "number", + "label": "Decimals", + "key": "decimals", + "defaultValue": 0 + }, + { + "type": "text", + "label": "Step", + "key": "step", + "defaultValue": 1 + }, + { + "type": "boolean", + "label": "Circular", + "key": "circular", + "defaultValue": false } ] } diff --git a/src/Component.svelte b/src/Component.svelte index fe2784b..2e89cab 100644 --- a/src/Component.svelte +++ b/src/Component.svelte @@ -1,10 +1,18 @@
{#if !formContext}
Form components need to be wrapped in a form.
{:else} + + import "@spectrum-css/fieldlabel/dist/index-vars.css" + + export let size = "M" + export let muted + + + + + \ No newline at end of file