UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 4.2 kB
{"version":3,"file":"radio.mjs","sources":["../../../../../../packages/components/radio/src/radio.ts"],"sourcesContent":["import { buildProps, isBoolean, isNumber, isString } from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useSizeProp } from '@element-plus/hooks'\n\nimport type { ExtractPublicPropTypes } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type Radio from './radio.vue'\n\nexport interface RadioPropsBase {\n /**\n * @description binding value\n */\n modelValue?: string | number | boolean\n /**\n * @description size of the Radio\n */\n size?: ComponentSize\n /**\n * @description whether Radio is disabled\n */\n disabled?: boolean\n /**\n * @description the label of Radio\n */\n label?: string | number | boolean\n /**\n * @description the value of Radio\n */\n value?: string | number | boolean\n /**\n * @description native `name` attribute\n */\n name?: string\n}\n\nexport interface RadioProps extends RadioPropsBase {\n /**\n * @description whether to add a border around Radio\n */\n border?: boolean\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `RadioPropsBase` instead.\n */\nexport const radioPropsBase = buildProps({\n /**\n * @description binding value\n */\n modelValue: {\n type: [String, Number, Boolean],\n default: undefined,\n },\n /**\n * @description size of the Radio\n */\n size: useSizeProp,\n /**\n * @description whether Radio is disabled\n */\n disabled: {\n type: Boolean,\n default: undefined,\n },\n /**\n * @description the label of Radio\n */\n label: {\n type: [String, Number, Boolean],\n default: undefined,\n },\n /**\n * @description the value of Radio\n */\n value: {\n type: [String, Number, Boolean],\n default: undefined,\n },\n /**\n * @description native `name` attribute\n */\n name: {\n type: String,\n default: undefined,\n },\n})\n\n/**\n * @deprecated Removed after 3.0.0, Use `RadioProps` instead.\n */\nexport const radioProps = buildProps({\n ...radioPropsBase,\n /**\n * @description whether to add a border around Radio\n */\n border: Boolean,\n} as const)\n\nexport const radioEmits = {\n [UPDATE_MODEL_EVENT]: (val: string | number | boolean | undefined) =>\n isString(val) || isNumber(val) || isBoolean(val),\n [CHANGE_EVENT]: (val: string | number | boolean | undefined) =>\n isString(val) || isNumber(val) || isBoolean(val),\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `RadioProps` instead.\n */\nexport type RadioPropsPublic = ExtractPublicPropTypes<typeof radioProps>\nexport type RadioEmits = typeof radioEmits\nexport type RadioInstance = InstanceType<typeof Radio> & unknown\n\n/**\n * @description default values for RadioProps\n */\nexport const radioPropsDefaults = {\n modelValue: undefined,\n disabled: undefined,\n label: undefined,\n value: undefined,\n name: undefined,\n border: false,\n} as const\n"],"names":[],"mappings":";;;;;;AA6CO,MAAM,iBAAiB,UAAA,CAAW;AAAA;AAAA;AAAA;AAAA,EAIvC,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,CAAC,MAAA,EAAQ,MAAA,EAAQ,OAAO,CAAA;AAAA,IAC9B,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,IAAA,EAAM,WAAA;AAAA;AAAA;AAAA;AAAA,EAIN,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,CAAC,MAAA,EAAQ,MAAA,EAAQ,OAAO,CAAA;AAAA,IAC9B,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,CAAC,MAAA,EAAQ,MAAA,EAAQ,OAAO,CAAA;AAAA,IAC9B,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA;AAEb,CAAC;AAKM,MAAM,aAAa,UAAA,CAAW;AAAA,EACnC,GAAG,cAAA;AAAA;AAAA;AAAA;AAAA,EAIH,MAAA,EAAQ;AACV,CAAU;AAEH,MAAM,UAAA,GAAa;AAAA,EACxB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