{"version":3,"file":"select.mjs","sources":["../../../../../../packages/components/select/src/select.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType, ExtractPublicPropTypes } from 'vue'\nimport {\n  selectProps as elSelectProps,\n  selectEmits as elSelectEmits,\n  type SelectProps as ElSelectProps,\n} from 'element-plus'\nimport { apiProps } from '@el-plus/utils/props'\n\nexport type SelectOption = NonNullable<ElSelectProps['options']>[number]\nexport const inheritSelectProps = {\n  ...elSelectProps,\n  clearable: {\n    ...elSelectProps.clearable,\n    default: true,\n  },\n} as const\nconst expandSelectProps = {\n  ...apiProps,\n  // 回显文本:异步 value 到达时,用 desc 构造占位项(只读)\n  desc: {\n    type: String,\n    default: '',\n  },\n  disabledOption: {\n    type: Function as PropType<(item: SelectOption) => boolean>,\n    default: () => false,\n  },\n  labelKey: {\n    type: String,\n    default: 'label',\n  },\n  valueKey: {\n    type: String,\n    default: 'value',\n  },\n  formatLabel: {\n    type: Function as PropType<(item: SelectOption) => string>,\n  },\n  // api模式生效\n  lazy: Boolean,\n  // option是否同时展示code label, 默认值展示label, 传string展示指定字段\n  codeInLabel: {\n    type: [String, Boolean] as PropType<boolean | string>,\n  },\n}\nexport const selectProps = {\n  ...inheritSelectProps,\n  ...expandSelectProps,\n} as const\nexport const expandSelectPropsKeys = Object.keys(expandSelectProps)\n\nexport type SelectProps = ExtractPropTypes<typeof selectProps>\nexport type SelectPropsPublic = ExtractPublicPropTypes<typeof selectProps>\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nexport const selectEmits = {\n  ...elSelectEmits,\n  change: (\n    value: SelectProps['modelValue'],\n    item?: SelectOption | SelectOption[],\n  ) => true,\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\nexport type SelectEmits = typeof selectEmits\nexport const selectEmitsKeys = Object.keys(selectEmits)\n"],"names":["elSelectProps","elSelectEmits"],"mappings":";;;AASO,MAAM,kBAAA,GAAqB;AAAA,EAChC,GAAGA,aAAA;AAAA,EACH,SAAA,EAAW;AAAA,IACT,GAAGA,aAAA,CAAc,SAAA;AAAA,IACjB,OAAA,EAAS;AAAA;AAEb;AACA,MAAM,iBAAA,GAAoB;AAAA,EACxB,GAAG,QAAA;AAAA;AAAA,EAEH,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,QAAA;AAAA,IACN,SAAS,MAAM;AAAA,GACjB;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,WAAA,EAAa;AAAA,IACX,IAAA,EAAM;AAAA,GACR;AAAA;AAAA,EAEA,IAAA,EAAM,OAAA;AAAA;AAAA,EAEN,WAAA,EAAa;AAAA,IACX,IAAA,EAAM,CAAC,MAAA,EAAQ,OAAO;AAAA;AAE1B,CAAA;AACO,MAAM,WAAA,GAAc;AAAA,EACzB,GAAG,kBAAA;AAAA,EACH,GAAG;AACL;AACO,MAAM,qBAAA,GAAwB,MAAA,CAAO,IAAA,CAAK,iBAAiB;AAM3D,MAAM,WAAA,GAAc;AAAA,EACzB,GAAGC,aAAA;AAAA,EACH,MAAA,EAAQ,CACN,KAAA,EACA,IAAA,KACG;AACP;AAGO,MAAM,eAAA,GAAkB,MAAA,CAAO,IAAA,CAAK,WAAW;;;;"}