From 16c3804b0aa805f8a8f61629aaec2aa191283cf0 Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Fri, 24 Apr 2020 12:14:01 -0400 Subject: [PATCH] Radios (#467) * Extract custom values logic into shared composition * Fix background layering * Add disabled prop to v-icon * Pass field width to interfaces * Move color var declaration to global scope * Remove unused imports * Handle null for items * Add radio buttons string * Add radio buttons interface * Finish radio buttons interface * Add tests * Fix icon test --- src/components/v-checkbox/v-checkbox.vue | 1 - src/components/v-form/v-form.vue | 1 + src/components/v-icon/readme.md | 23 +- src/components/v-icon/v-icon.vue | 15 +- src/components/v-radio/v-radio.vue | 9 +- src/components/v-select/v-select.vue | 121 ++-------- .../use-custom-selection/index.ts | 4 + .../use-custom-selection/readme.md | 11 + .../use-custom-selection.ts | 121 ++++++++++ src/interfaces/index.ts | 2 + src/interfaces/radio-buttons/index.ts | 46 ++++ .../radio-buttons/radio-buttons.story.ts | 72 ++++++ .../radio-buttons/radio-buttons.test.ts | 127 +++++++++++ .../radio-buttons/radio-buttons.vue | 211 ++++++++++++++++++ src/interfaces/radio-buttons/readme.md | 11 + src/lang/en-US/index.json | 2 + 16 files changed, 654 insertions(+), 123 deletions(-) create mode 100644 src/compositions/use-custom-selection/index.ts create mode 100644 src/compositions/use-custom-selection/readme.md create mode 100644 src/compositions/use-custom-selection/use-custom-selection.ts create mode 100644 src/interfaces/radio-buttons/index.ts create mode 100644 src/interfaces/radio-buttons/radio-buttons.story.ts create mode 100644 src/interfaces/radio-buttons/radio-buttons.test.ts create mode 100644 src/interfaces/radio-buttons/radio-buttons.vue create mode 100644 src/interfaces/radio-buttons/readme.md diff --git a/src/components/v-checkbox/v-checkbox.vue b/src/components/v-checkbox/v-checkbox.vue index bea6cd1e96..b232485802 100644 --- a/src/components/v-checkbox/v-checkbox.vue +++ b/src/components/v-checkbox/v-checkbox.vue @@ -151,7 +151,6 @@ export default defineComponent({ width: 100%; height: var(--input-height); padding: 10px; // 14 - 4 (border) - background-color: var(--page-background); border: 2px solid var(--background-subdued); border-radius: var(--border-radius); diff --git a/src/components/v-form/v-form.vue b/src/components/v-form/v-form.vue index 5f37b64cc5..31d385f48e 100644 --- a/src/components/v-form/v-form.vue +++ b/src/components/v-form/v-form.vue @@ -83,6 +83,7 @@ ? field.default_value : values[field.field] " + :width="field.width" @input="setValue(field, $event)" /> diff --git a/src/components/v-icon/readme.md b/src/components/v-icon/readme.md index 31d23e5ff6..c366a3eab6 100644 --- a/src/components/v-icon/readme.md +++ b/src/components/v-icon/readme.md @@ -47,17 +47,18 @@ Oftentimes, you'll use the icon next to some text, for example in a button. When ``` ## Props -| Name | Description | Default | -|-----------|-------------------------------------------------------------------|----------------| -| `name`* | Name of the icon | -- | -| `outline` | Use outline Material Icons. Note: only works for non-custom icons | `false` | -| `size` | Custom pixel size | `false` | -| `x-small` | Render the icon extra small | `false` | -| `small` | Render the icon small | `false` | -| `large` | Render the icon large | `false` | -| `x-large` | Render the icon extra large | `false` | -| `left` | Use when icon is left of text | `false` | -| `right` | Use when icon is right of text | `false` | +| Name | Description | Default | +|-------------|-------------------------------------------------------------------|---------| +| `name`* | Name of the icon | -- | +| `outline` | Use outline Material Icons. Note: only works for non-custom icons | `false` | +| `size` | Custom pixel size | `false` | +| `x-small` | Render the icon extra small | `false` | +| `small` | Render the icon small | `false` | +| `large` | Render the icon large | `false` | +| `x-large` | Render the icon extra large | `false` | +| `left` | Use when icon is left of text | `false` | +| `right` | Use when icon is right of text | `false` | +| `disabledd` | Prevent the click handler from firing | `false` | ## Events | Event | Description | Data | diff --git a/src/components/v-icon/v-icon.vue b/src/components/v-icon/v-icon.vue index 298d1ac96d..738f57cb64 100644 --- a/src/components/v-icon/v-icon.vue +++ b/src/components/v-icon/v-icon.vue @@ -1,7 +1,7 @@