@bagelink/vue 1.15.289 → 1.15.293

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -68,6 +68,7 @@ export interface OptionObject {
68
68
  label: string
69
69
  value: string | number | boolean
70
70
  icon?: IconType
71
+ subtitle?: string
71
72
  [key: string]: any
72
73
  }
73
74
 
@@ -251,7 +251,7 @@ export function normalizeDimension(value: string | number | undefined, defaultMe
251
251
  }
252
252
 
253
253
  export type { NormalizedOption } from './options'
254
- export { getOptionIcon, getOptionLabel, getOptionValue, normalizeOption } from './options'
254
+ export { getOptionIcon, getOptionLabel, getOptionSubtitle, getOptionValue, normalizeOption } from './options'
255
255
 
256
256
  export type { ComparisonOperator, FilterCondition, LogicalOperator, QueryConditions, QueryFilter } from './queryFilter'
257
257
  export { anyOf, buildQuery, evaluateQuery, parseQuery, queryFilter, range, search } from './queryFilter'
@@ -24,6 +24,12 @@ export function getOptionValue(option?: Option): string | number | boolean | und
24
24
  return option as string | number
25
25
  }
26
26
 
27
+ /** Extract the subtitle from an option, if present. */
28
+ export function getOptionSubtitle(option?: Option): string | undefined {
29
+ if (option == null || typeof option !== 'object') { return }
30
+ const subtitle = (option as OptionObject).subtitle
31
+ return typeof subtitle === 'string' && subtitle ? subtitle : undefined
32
+ }
27
33
  /** Extract the icon from an option, if present. */
28
34
  export function getOptionIcon(option?: Option): IconType | undefined {
29
35
  if (option == null || typeof option !== 'object') { return }