Component JSON options update and related changes

This commit is contained in:
Conor_Mack 2020-02-21 15:00:42 +00:00
parent eaf9283f0f
commit 88ed3830cc
2 changed files with 38 additions and 11 deletions

View File

@ -28,9 +28,21 @@
"description": "A Material Design button with different variations. It renders as an anchor if href is passed to it.", "description": "A Material Design button with different variations. It renders as an anchor if href is passed to it.",
"props": { "props": {
"onClick": "event", "onClick": "event",
"variant": "string", "variant": {
"colour": "string", "type": "options",
"size": "string", "options": ["text", "raised", "unelevated", "outlined"],
"default": "text"
},
"colour": {
"type": "options",
"options": ["primary", "secondary"],
"default": "primary"
},
"size": {
"type": "options",
"options": ["small", "medium", "large"],
"default": "medium"
},
"href": "string", "href": "string",
"icon": "string", "icon": "string",
"trailingIcon": "bool", "trailingIcon": "bool",
@ -159,7 +171,6 @@
"onClick": "event", "onClick": "event",
"id": "string", "id": "string",
"label": "string", "label": "string",
"names": "string",
"name": "string", "name": "string",
"checked": "bool", "checked": "bool",
"disabled": "bool", "disabled": "bool",
@ -189,12 +200,28 @@
"props": { "props": {
"onChange": "event", "onChange": "event",
"label": "string", "label": "string",
"variant": "string", "variant": {
"type": "options",
"options": ["standard", "outlined", "filled"],
"default": "standard"
},
"disabled": "bool", "disabled": "bool",
"fullwidth": "bool", "fullwidth": "bool",
"colour":"string", "colour": {
"size":"string", "type": "options",
"type": "string", "options": ["primary", "secondary"],
"default": "primary"
},
"size":{
"type": "options",
"options": ["small", "medium", "large"],
"default": "medium"
},
"type": {
"type": "options",
"options": ["text", "password"],
"default": "text"
},
"required": "bool", "required": "bool",
"minLength": "number", "minLength": "number",
"maxLength": "number", "maxLength": "number",

View File

@ -4,11 +4,11 @@
import ripple from "../Common/Ripple.js" import ripple from "../Common/Ripple.js"
import ClassBuilder from "../ClassBuilder.js" import ClassBuilder from "../ClassBuilder.js"
const cb = new ClassBuilder("button", ["primary", "medium"]) const cb = new ClassBuilder("button", ["primary", "medium", "text"])
export let onClick = () => {} export let onClick = () => {}
export let variant = "raised" export let variant = "text"
export let colour = "primary" export let colour = "primary"
export let size = "medium" export let size = "medium"