From 10e65337a46eda88c165c0bb977dce23f7143431 Mon Sep 17 00:00:00 2001 From: Maksym Portianoi Date: Thu, 25 Apr 2024 16:22:46 -0400 Subject: [PATCH] fix(kradio, kcheckbox): required field indicator [KHCP-11503] (#2159) * fix(kradio, kcheckbox): required field indicator [KHCP-11503] * fix(kexternallink): outline offset [KHCP-11517] * docs(radio, checkbox): add required examples [KHCP-11503] * docs(*): minor fixes [KHCP-11503] * fix(kradio, kcheckbox): minor fix [KHCP-11503] * docs(kradio): remove example [KHCP-11503] --- docs/components/checkbox.md | 18 +++++++++--- docs/components/file-upload.md | 2 +- docs/components/input.md | 2 +- docs/components/radio.md | 4 +-- docs/components/textarea.md | 2 +- sandbox/pages/SandboxCheckbox.vue | 17 +++++++---- sandbox/pages/SandboxRadio.vue | 28 ++++++++++++------- src/components/KCheckbox/KCheckbox.vue | 6 +++- .../KExternalLink/KExternalLink.vue | 2 +- src/components/KRadio/KRadio.vue | 6 +++- 10 files changed, 60 insertions(+), 27 deletions(-) diff --git a/docs/components/checkbox.md b/docs/components/checkbox.md index 27225f3c3f..6092baf255 100644 --- a/docs/components/checkbox.md +++ b/docs/components/checkbox.md @@ -45,14 +45,23 @@ Will place label text to the right of the checkbox. Can also be [slotted](#slots KCheckbox has an instance of KLabel for supporting tooltip text. Use the `labelAttributes` prop to configure the KLabel's [props](/components/label). This example shows using the `labelAttributes` to set up a tooltip, see the [slot](#slots) section if you want to slot HTML into the tooltip rather than use plain text. - +
+ + +
```html + + ``` ### description @@ -266,7 +275,8 @@ const vModelCheckbox = ref(false) const descriptionPropCheckbox = ref(false) const errorCheckbox = ref(false) const labelCheckbox = ref(false) -const labelAttributesCheckbox = ref(false) +const labelAttributesCheckbox1 = ref(false) +const labelAttributesCheckbox2 = ref(false) const disabledCheckbox = ref(false) const disabledCheckedCheckbox = ref(true) const themeChecked = ref(true) diff --git a/docs/components/file-upload.md b/docs/components/file-upload.md index 13db91e972..2264ef9b28 100644 --- a/docs/components/file-upload.md +++ b/docs/components/file-upload.md @@ -150,7 +150,7 @@ Slot for an icon in front of the input field. ``` -### labelTooltip +### label-tooltip Use this slot if you want to utilize HTML in the input label's tooltip. diff --git a/docs/components/input.md b/docs/components/input.md index 40531d3b33..642f6ae5b2 100644 --- a/docs/components/input.md +++ b/docs/components/input.md @@ -251,7 +251,7 @@ Should you decide to use your own custom icons, you can use design tokens export We also recommend setting the icon style `color` property to a value of `currentColor` to utilize default KInput styling for slotted content. ::: -### labelTooltip +### label-tooltip If you want to utilize HTML in the input label's tooltip, use the slot. diff --git a/docs/components/radio.md b/docs/components/radio.md index d1b23d2cb3..8df3e3932f 100644 --- a/docs/components/radio.md +++ b/docs/components/radio.md @@ -55,12 +55,12 @@ Will place label text to the right of the radio. Can also be [slotted](#slots). KRadio has an instance of KLabel for supporting tooltip text. Use the `labelAttributes` prop to configure the KLabel's [props](/components/label). This example shows using the `labelAttributes` to set up a tooltip. Tooltip content can also be [slotted](#slots). - + ```html diff --git a/docs/components/textarea.md b/docs/components/textarea.md index 109976c50c..d0c21f7d0d 100644 --- a/docs/components/textarea.md +++ b/docs/components/textarea.md @@ -136,7 +136,7 @@ KTextArea works with `v-model` for two-way data binding: ## Slots -### labelTooltip +### label-tooltip Slot for tooltip content if textarea has a label and label has tooltip (note: this slot overrides `info` content specified in `labelAttributes`) diff --git a/sandbox/pages/SandboxCheckbox.vue b/sandbox/pages/SandboxCheckbox.vue index 8952b3e03c..891cc4cbd6 100644 --- a/sandbox/pages/SandboxCheckbox.vue +++ b/sandbox/pages/SandboxCheckbox.vue @@ -155,11 +155,18 @@ - +
+ + +
diff --git a/sandbox/pages/SandboxRadio.vue b/sandbox/pages/SandboxRadio.vue index ae16d37c22..0352aee01b 100644 --- a/sandbox/pages/SandboxRadio.vue +++ b/sandbox/pages/SandboxRadio.vue @@ -197,12 +197,20 @@ - +
+ + +
@@ -213,7 +221,7 @@ Label @@ -222,7 +230,7 @@