diff --git a/docs/angular/src/content/en/images/combo/single-select-combo-do-1.png b/docs/angular/src/content/en/images/combo/single-select-combo-do-1.png index 4df3ee9b7f..4e67d47a22 100644 Binary files a/docs/angular/src/content/en/images/combo/single-select-combo-do-1.png and b/docs/angular/src/content/en/images/combo/single-select-combo-do-1.png differ diff --git a/docs/angular/src/content/en/images/combo/single-select-combo-do-not-1.png b/docs/angular/src/content/en/images/combo/single-select-combo-do-not-1.png index f23840fdc6..19a3f8eb09 100644 Binary files a/docs/angular/src/content/en/images/combo/single-select-combo-do-not-1.png and b/docs/angular/src/content/en/images/combo/single-select-combo-do-not-1.png differ diff --git a/docs/xplat/src/assets/images/combo/single-select-combo-do-1.png b/docs/xplat/src/assets/images/combo/single-select-combo-do-1.png index 4df3ee9b7f..4e67d47a22 100644 Binary files a/docs/xplat/src/assets/images/combo/single-select-combo-do-1.png and b/docs/xplat/src/assets/images/combo/single-select-combo-do-1.png differ diff --git a/docs/xplat/src/assets/images/combo/single-select-combo-do-not-1.png b/docs/xplat/src/assets/images/combo/single-select-combo-do-not-1.png index f23840fdc6..19a3f8eb09 100644 Binary files a/docs/xplat/src/assets/images/combo/single-select-combo-do-not-1.png and b/docs/xplat/src/assets/images/combo/single-select-combo-do-not-1.png differ diff --git a/docs/xplat/src/content/en/components/inputs/combo/single-selection.mdx b/docs/xplat/src/content/en/components/inputs/combo/single-selection.mdx index 369b241c26..5537007e24 100644 --- a/docs/xplat/src/content/en/components/inputs/combo/single-selection.mdx +++ b/docs/xplat/src/content/en/components/inputs/combo/single-selection.mdx @@ -33,7 +33,7 @@ The Angular single selection Combo is the Simple Combo, the `igx-simple-combo` c -Set on the {Platform} Combo to switch it to single selection. The input field becomes editable and filters the list as users type, the search input of the dropdown is hidden, and the options show no checkboxes. +Set on the {Platform} Combo to switch it to single selection. The input field becomes editable and filters the list as users type, the search input of the dropdown is hidden, and the options show no checkboxes. @@ -111,7 +111,7 @@ igc-combo[single-select] │ │ └─ slot[name="empty"] │ └─ div[part="footer"] │ └─ slot[name="footer"] - └─ igc-validator[part="helper-text"] // the helper text and the validation messages + └─ igc-validator#combo-helper-text // the helper text and the validation messages, exported as the "helper-text" part ``` @@ -283,20 +283,23 @@ export class HomeComponent { Use the {Platform} Single Selection Combo when users pick exactly one option from a list that they need to search, such as a country or a city. -### Type +### Type (Material Theme) -The Simple Combo Input provides selection between a border type for a more structured perception on solid color backgrounds, and a boxed type that is most appropriate when placed on top of a vivid image to improve readability. +In the Material theme, the Simple Combo Input provides selection between a border type for a more structured perception on solid color backgrounds, and a boxed type that is most appropriate when placed on top of a vivid image to improve readability. The Bootstrap, Fluent, and Indigo themes draw both types the same way, so the other samples of this topic show the box type only in the Material theme. -The {Platform} Combo uses the box type by default. Set `outlined` for the border type. The box type is a style of the Material theme: in the Bootstrap, Fluent, and Indigo themes, both types look the same. +The {Platform} Combo uses the box type by default. Set `outlined` for the border type: ```html + + + ``` @@ -305,7 +308,10 @@ The {Platform} Combo uses the box type by default. Set `outlined` for the border ```tsx +{/* Border type */} + +{/* Box type */} ``` @@ -314,7 +320,10 @@ The {Platform} Combo uses the box type by default. Set `outlined` for the border ```razor +@* Border type *@ + +@* Box type *@ ``` @@ -322,14 +331,16 @@ The {Platform} Combo uses the box type by default. Set `outlined` for the border -The Angular Simple Combo uses the box type by default. Set the input to `border` for the border type. Add the label with the `igxLabel` directive and the left icon with an `igx-prefix`: +The Angular Simple Combo uses the box type by default. Set the input to `border` for the border type. Add the label with the `igxLabel` directive and the left icon with an `igx-prefix`. The `IGX_SIMPLE_COMBO_DIRECTIVES` token holds both, but not the icon, so add the `IgxIconComponent` to the `imports` of your component: ```html + language + @@ -345,13 +356,13 @@ Add the label with the `label` property, and the left icon in the `prefix` slot. - + - + @@ -393,13 +404,13 @@ Set `disabled` on the {Platform} Single Selection Combo to show the disabled sta - + - + @@ -425,13 +436,13 @@ The {Platform} Combo is medium by default. - + - + @@ -444,7 +455,7 @@ Clicking the input field or the toggle opens the dropdown, and typing in the inp ```ts -const combo = document.querySelector('igc-combo'); +const combo = document.getElementById('countries') as IgcComboComponent; await combo.show(); await combo.hide(); @@ -458,9 +469,11 @@ await combo.toggle(); ```tsx const comboRef = useRef(null); -comboRef.current.show(); -comboRef.current.hide(); -comboRef.current.toggle(); +const open = () => comboRef.current?.show(); +const close = () => comboRef.current?.hide(); +const toggle = () => comboRef.current?.toggle(); + +return ; ``` @@ -492,17 +505,17 @@ public openCombo(): void { -The following sample shows the states side by side. Because hover and focus come from the pointer and the keyboard, the sample styles the display-only combos for these states with CSS classes. +The following sample shows the states side by side. Hover and focus come from the pointer and the keyboard, so the sample turns on the hover and the focus styles of the theme for its display-only combos. - + - + @@ -512,7 +525,7 @@ Every experienced designer uses constraints wisely to limit the user input and a -The {Platform} Combo is form-associated. Set `required` to require a selected item, and `invalid` to show the error state. Put the guidance or the error message in the `helper-text` slot. In the single selection mode, the form value is the `valueKey` value of the selected item. The Combo has no built-in success or warn state, so the sample styles these two states with CSS classes. +The {Platform} Combo is form-associated. Set `required` to require a selected item, and `invalid` to show the error state. Put the guidance or the error message in the `helper-text` slot. In the single selection mode, the form value is the `valueKey` value of the selected item. The Combo has no built-in success or warn state. The sample shows the success and the warn states as invalid Combos that take the success or the warning color of the theme in place of the error color. @@ -548,7 +561,7 @@ The {Platform} Combo is form-associated. Set `required` to require a selected it -The Angular Simple Combo takes its validation state from the form control that it is bound to, through `ngModel` or a reactive form. Set the property to an `IgxInputState` value to set the state in code. Put the guidance or the error message in an `igx-hint`: +The Angular Simple Combo takes its validation state from the form control that it is bound to, through `ngModel` or a reactive form. Set the property to an `IgxInputState` value to set the state in code. The Angular Simple Combo has no warn state of its own, so the sample shows it with the warning style of its input group. Put the guidance or the error message in an `igx-hint`: ```html @@ -560,13 +573,13 @@ The Angular Simple Combo takes its validation state from the form control that i - + - + @@ -588,13 +601,13 @@ The following sample shows the dropdowns only, without their input fields. - + - + @@ -640,13 +653,13 @@ The following sample shows a header and an item in each size. - + - + @@ -654,17 +667,17 @@ The following sample shows a header and an item in each size. An item of the {Platform} Single Selection Combo dropdown is idle, hovered, or focused, and each of these states has a selected variant. The drop-down theme also has colors for a disabled item. -The following sample shows the states side by side. Because hover and focus come from the pointer and the keyboard, the sample styles the display-only items for these states with CSS classes. +The following sample shows the states side by side. Hover and focus come from the pointer and the keyboard, so the sample turns on the hover, the focus, and the disabled styles of the theme for its display-only items. - + - + @@ -706,12 +719,12 @@ console.log(combo.value); // ['BG'] while Bulgaria is selected, [] after the des ```tsx // select the item matching the 'BG' value of the value key field -comboRef.current.select('BG'); +comboRef.current?.select('BG'); // deselect it -comboRef.current.deselect('BG'); +comboRef.current?.deselect('BG'); -console.log(comboRef.current.value); // ['BG'] while Bulgaria is selected, [] after the deselection +console.log(comboRef.current?.value); // ['BG'] while Bulgaria is selected, [] after the deselection ``` @@ -846,7 +859,7 @@ Typing in the input field of the {Platform} Single Selection Combo opens the dro -Set `disableFiltering` to keep the whole list while users type. The `filteringOptions` object sets the key that the text filters by, and whether the filtering is case-sensitive and matches diacritics. When the text matches no option and the Combo loses the focus, the input field is cleared. +Set `disableFiltering` to keep the whole list while users type. The `filteringOptions` object sets the key that the text filters by, and whether the filtering is case-sensitive and matches diacritics. When the Combo loses the focus without a selected option, the input field is cleared. @@ -869,14 +882,14 @@ combo.filteringOptions = { filterKey: 'name', caseSensitive: false, matchDiacrit ```razor - + ``` -Set to keep the whole list while users type, and to show a button in the input field that toggles case-sensitive filtering. The input sets the key that the text filters by and whether the filtering is case-sensitive, and replaces the filtering with your own. When the text matches no option and the Simple Combo loses the focus, the input field is cleared: +Set to keep the whole list while users type, and to show a button in the input field that toggles case-sensitive filtering. The input sets the key that the text filters by and whether the filtering is case-sensitive, and replaces the filtering with your own. When the Simple Combo loses the focus without a selected option, the input field is cleared: ```html