UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

85 lines (84 loc) 1.96 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const input_group = require("../input_group/input_group.vue.cjs"); const _sfc_main = { compatConfig: { MODE: 3 }, name: "DtRadioGroup", extends: input_group.default, props: { /** * A provided value for the radio group * @model value */ value: { type: [String, Number], default: "" }, /** * A data qa tag for the radio group */ dataQaGroup: { type: String, default: "radio-group" }, /** * A data qa tag for the radio group legend */ dataQaGroupLegend: { type: String, default: "radio-group-legend" }, /** * A data qa tag for the radio group messages */ dataQaGroupMessages: { type: String, default: "radio-group-messages" } }, emits: [ /** * Native input event * * @event input * @type {String | Number} */ "input" ], data() { return { internalValue: this.value }; }, watch: { value(newValue) { this.internalValue = newValue; }, /* * watching value to support 2 way binding for slotted radios. * need this to pass value to slotted checkboxes if modified outside * radio group. */ internalValue: { immediate: true, handler(newInternalValue) { this.provideObj.selectedValue = newInternalValue; } } }, methods: { /* * provided value to support 2 way binding for slotted radios. * slotted radios will change this value and need to emit new value up. */ setGroupValue(newValue) { this.$emit("input", newValue); }, getMessageKey(type, index) { return `radio-group-message-${type}-${index}-${this.id}`; } } }; const _sfc_main$1 = _sfc_main; exports.default = _sfc_main$1; //# sourceMappingURL=radio_group.vue.cjs.map