Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: port CvRadioButton to Vue3 #1488

Merged
merged 2 commits into from
Jul 31, 2023
Merged

feat: port CvRadioButton to Vue3 #1488

merged 2 commits into from
Jul 31, 2023

Conversation

OlkaB
Copy link
Contributor

@OlkaB OlkaB commented Jul 24, 2023

Contributes to #1482

## What did you do?
ported CvRadioButton to Vue3

How have you tested it?

please see CvRadioButton.spec.js (tests from Vue2 adapted)
image

Were docs updated if needed?

  • Yes

Copy link
Collaborator

@davidnixon davidnixon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The story book controls checked, label, hideLabel, & labelLeft do not affect the story.

I suggest tweaking like this:

diff --git a/src/components/CvRadioButton/CvRadioButton.stories.js b/src/components/CvRadioButton/CvRadioButton.stories.js
index e1d52faa..56156243 100644
--- a/src/components/CvRadioButton/CvRadioButton.stories.js
+++ b/src/components/CvRadioButton/CvRadioButton.stories.js
@@ -12,12 +12,13 @@ export default {
   argTypes: {
     checked: {
       type: 'boolean',
+      control: false,
       table: {
         type: { summary: 'boolean' },
         category: 'props',
       },
     },
-    label: { description: 'radio-button label' },
+    label: { description: 'radio-button label', control: false },
     hideLabel: {
       description:
         'makes the label visually hidden but still labels the radio input',
@@ -69,6 +70,8 @@ const defaultTemplate = `
       :value="id"
       :checked="checked"
       :disabled="disabled"
+      :hide-label="hideLabel"
+      :label-left='labelLeft'
     />
   </cv-radio-group>
 `;
@@ -81,6 +84,8 @@ const Template = (args, { argTypes }) => {
     setup() {
       return {
         args,
+        hideLabel: args.hideLabel,
+        labelLeft: args.labelLeft,
         onChange: action('change'),
         DefaultRadioItems,
       };
@@ -93,7 +98,11 @@ Default.args = {
   vertical: false,
 };
 Default.parameters = storyParametersObject(
-  Default.parameters,
+  {
+    controls: {
+      exclude: ['change', 'update:modelValue', 'modelValue'],
+    },
+  },
   defaultTemplate,
   Default.args
 );

@OlkaB
Copy link
Contributor Author

OlkaB commented Jul 31, 2023

Thanks for this tip @davidnixon , change implemented

@davidnixon davidnixon merged commit 79b4361 into carbon-design-system:vNext Jul 31, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants