| 1298 | }; |
| 1299 | |
| 1300 | const generateText = ( |
| 1301 | opts: HTMLIonSelectOptionElement[], |
| 1302 | value: any | any[], |
| 1303 | compareWith?: string | SelectCompareFn | null |
| 1304 | ) => { |
| 1305 | if (value === undefined) { |
| 1306 | return ''; |
| 1307 | } |
| 1308 | if (Array.isArray(value)) { |
| 1309 | return value |
| 1310 | .map((v) => textForValue(opts, v, compareWith)) |
| 1311 | .filter((opt) => opt !== null) |
| 1312 | .join(', '); |
| 1313 | } else { |
| 1314 | return textForValue(opts, value, compareWith) || ''; |
| 1315 | } |
| 1316 | }; |
| 1317 | |
| 1318 | const textForValue = ( |
| 1319 | opts: HTMLIonSelectOptionElement[], |