@@ -27,6 +27,7 @@ import { getIonMode, getIonTheme } from '../../global/ionic-global';
2727import type { AnimationBuilder , CssClassMap , OverlayInterface , FrameworkDelegate } from '../../interface' ;
2828import type { OverlayEventDetail } from '../../utils/overlays-interface' ;
2929import type { IonicSafeString } from '../../utils/sanitization' ;
30+ import type { SelectAlertInput } from '../select/select-interface' ;
3031
3132import type { AlertButton , AlertInput } from './alert-interface' ;
3233import { iosEnterAnimation } from './animations/ios.enter' ;
@@ -330,28 +331,20 @@ export class Alert implements ComponentInterface, OverlayInterface {
330331 }
331332
332333 this . inputType = inputTypes . values ( ) . next ( ) . value ;
333- this . processedInputs = inputs . map (
334- ( i , index ) =>
335- ( {
336- type : i . type || 'text' ,
337- name : i . name || `${ index } ` ,
338- placeholder : i . placeholder || '' ,
339- value : i . value ,
340- label : i . label ,
341- checked : ! ! i . checked ,
342- disabled : ! ! i . disabled ,
343- id : i . id || `alert-input-${ this . overlayIndex } -${ index } ` ,
344- handler : i . handler ,
345- min : i . min ,
346- max : i . max ,
347- cssClass : i . cssClass ?? '' ,
348- attributes : i . attributes || { } ,
349- tabindex : i . type === 'radio' && i !== focusable ? - 1 : 0 ,
350- startContent : i . startContent ,
351- endContent : i . endContent ,
352- description : i . description ,
353- } as AlertInput )
354- ) ;
334+ this . processedInputs = inputs . map ( ( i , index ) => {
335+ return {
336+ ...i ,
337+ type : i . type || 'text' ,
338+ name : i . name || `${ index } ` ,
339+ placeholder : i . placeholder || '' ,
340+ checked : ! ! i . checked ,
341+ disabled : ! ! i . disabled ,
342+ id : i . id || `alert-input-${ this . overlayIndex } -${ index } ` ,
343+ cssClass : i . cssClass ?? '' ,
344+ attributes : i . attributes || { } ,
345+ tabindex : i . type === 'radio' && i !== focusable ? - 1 : 0 ,
346+ } as AlertInput ;
347+ } ) ;
355348 }
356349
357350 connectedCallback ( ) {
@@ -574,12 +567,19 @@ export class Alert implements ComponentInterface, OverlayInterface {
574567 return (
575568 < div class = "alert-checkbox-group" >
576569 { inputs . map ( ( i ) => {
570+ /**
571+ * Cast to `SelectAlertInput` to access rich content
572+ * fields (`startContent`, `endContent`, `description`)
573+ * that are passed through from `ion-select` but not
574+ * part of the public `AlertInput` interface.
575+ */
576+ const richInput = i as SelectAlertInput ;
577577 const optionLabelOptions = {
578- id : i . id ! ,
579- label : i . label ,
580- startContent : i . startContent ,
581- endContent : i . endContent ,
582- description : i . description ,
578+ id : richInput . id ! ,
579+ label : richInput . label ,
580+ startContent : richInput . startContent ,
581+ endContent : richInput . endContent ,
582+ description : richInput . description ,
583583 } ;
584584
585585 return (
@@ -624,12 +624,19 @@ export class Alert implements ComponentInterface, OverlayInterface {
624624 return (
625625 < div class = "alert-radio-group" role = "radiogroup" aria-activedescendant = { this . activeId } >
626626 { inputs . map ( ( i ) => {
627+ /**
628+ * Cast to `SelectAlertInput` to access rich content
629+ * fields (`startContent`, `endContent`, `description`)
630+ * that are passed through from `ion-select` but not
631+ * part of the public `AlertInput` interface.
632+ */
633+ const richInput = i as SelectAlertInput ;
627634 const optionLabelOptions = {
628- id : i . id ! ,
629- label : i . label ,
630- startContent : i . startContent ,
631- endContent : i . endContent ,
632- description : i . description ,
635+ id : richInput . id ! ,
636+ label : richInput . label ,
637+ startContent : richInput . startContent ,
638+ endContent : richInput . endContent ,
639+ description : richInput . description ,
633640 } ;
634641
635642 return (
0 commit comments