import e from "../input-group/input-group.js";
import { warn as t } from "vue";
//#region components/checkbox_group/checkbox_group.vue
var n = {
	compatConfig: { MODE: 3 },
	name: "DtCheckboxGroup",
	extends: e,
	props: {
		modelValue: {
			type: [],
			default: null,
			validator: (e) => e ? (t("Component uses selectedValues to initialize the model, modelValue is not supported by this component", void 0), !1) : !0
		},
		selectedValues: {
			type: Array,
			default() {
				return [];
			}
		},
		dataQaGroup: {
			type: String,
			default: "checkbox-group"
		},
		dataQaGroupLegend: {
			type: String,
			default: "checkbox-group-legend"
		},
		dataQaGroupMessages: {
			type: String,
			default: "checkbox-group-messages"
		}
	},
	emits: ["input", "update:selectedValues"],
	data() {
		return { internalValue: this.selectedValues };
	},
	watch: {
		selectedValues(e) {
			this.internalValue = e;
		},
		internalValue: {
			immediate: !0,
			handler(e) {
				this.provideObj.selectedValues = e;
			}
		}
	},
	methods: {
		setGroupValue(e, t) {
			t ? this.internalValue.includes(e) || this.internalValue.push(e) : this.internalValue = this.internalValue.filter((t) => t !== e), this.$emit("input", this.internalValue), this.$emit("update:selectedValues", this.internalValue);
		},
		getMessageKey(e, t) {
			return `checkbox-group-message-${e}-${t}-${this.id}`;
		}
	}
};
//#endregion
export { n as default };

//# sourceMappingURL=checkbox-group.js.map