{"version":3,"file":"radio-group.cjs","names":[],"sources":["../../../components/radio_group/radio_group.vue"],"sourcesContent":["<script>\nimport { DtInputGroup } from '../input_group';\n\n/**\n * Radio Groups are control elements that allow the user to make a single selection from a list of options.\n * @see https://dialtone.dialpad.com/components/radio_group.html\n */\nexport default {\n  compatConfig: { MODE: 3 },\n  name: 'DtRadioGroup',\n\n  extends: DtInputGroup,\n\n  props: {\n    /**\n     * A provided value for the radio group\n     * @model value\n     */\n    modelValue: {\n      type: [String, Number],\n      default: '',\n    },\n\n    /**\n     * A data qa tag for the radio group\n     */\n    dataQaGroup: {\n      type: String,\n      default: 'radio-group',\n    },\n\n    /**\n     * A data qa tag for the radio group legend\n     */\n    dataQaGroupLegend: {\n      type: String,\n      default: 'radio-group-legend',\n    },\n\n    /**\n     * A data qa tag for the radio group messages\n     */\n    dataQaGroupMessages: {\n      type: String,\n      default: 'radio-group-messages',\n    },\n  },\n\n  emits: [\n    /**\n     * Native input event\n     *\n     * @event input\n     * @type {String | Number}\n     */\n    'input',\n    /**\n     * Native input event\n     *\n     * @event input\n     * @type {String | Number}\n     */\n    'update:modelValue',\n  ],\n\n  data () {\n    return {\n      internalValue: this.modelValue,\n    };\n  },\n\n  watch: {\n    modelValue (newValue) {\n      this.internalValue = newValue;\n    },\n\n    /*\n    * watching value to support 2 way binding for slotted radios.\n    * need this to pass value to slotted checkboxes if modified outside\n    * radio group.\n    */\n    internalValue: {\n      immediate: true,\n      handler (newInternalValue) {\n        this.provideObj.selectedValue = newInternalValue;\n      },\n    },\n  },\n\n  methods: {\n    /*\n     * provided value to support 2 way binding for slotted radios.\n     * slotted radios will change this value and need to emit new value up.\n     */\n    setGroupValue (newValue) {\n      this.$emit('input', newValue);\n      this.$emit('update:modelValue', newValue);\n    },\n\n    getMessageKey (type, index) {\n      return `radio-group-message-${type}-${index}-${this.id}`;\n    },\n  },\n};\n</script>\n"],"mappings":"+FAOA,IAAK,EAAU,CACb,aAAc,CAAE,KAAM,EAAG,CACzB,KAAM,eAEN,kDAAS,QAET,MAAO,CAKL,WAAY,CACV,KAAM,CAAC,OAAQ,OAAO,CACtB,QAAS,GACV,CAKD,YAAa,CACX,KAAM,OACN,QAAS,cACV,CAKD,kBAAmB,CACjB,KAAM,OACN,QAAS,qBACV,CAKD,oBAAqB,CACnB,KAAM,OACN,QAAS,uBACV,CACF,CAED,MAAO,CAOL,QAOA,oBACD,CAED,MAAQ,CACN,MAAO,CACL,cAAe,KAAK,WACrB,EAGH,MAAO,CACL,WAAY,EAAU,CACpB,KAAK,cAAgB,GAQvB,cAAe,CACb,UAAW,GACX,QAAS,EAAkB,CACzB,KAAK,WAAW,cAAgB,GAEnC,CACF,CAED,QAAS,CAKP,cAAe,EAAU,CACvB,KAAK,MAAM,QAAS,EAAS,CAC7B,KAAK,MAAM,oBAAqB,EAAS,EAG3C,cAAe,EAAM,EAAO,CAC1B,MAAO,uBAAuB,EAAK,GAAG,EAAM,GAAG,KAAK,MAEvD,CACF"}