@dialpad/dialtone 9.111.0 → 9.111.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tokens/doc.json +14641 -14641
- package/dist/vue2/lib/checkbox/checkbox.cjs +1 -1
- package/dist/vue2/lib/checkbox/checkbox.cjs.map +1 -1
- package/dist/vue2/lib/checkbox/checkbox.js +7 -13
- package/dist/vue2/lib/checkbox/checkbox.js.map +1 -1
- package/dist/vue2/lib/radio/radio.cjs +1 -1
- package/dist/vue2/lib/radio/radio.cjs.map +1 -1
- package/dist/vue2/lib/radio/radio.js +5 -11
- package/dist/vue2/lib/radio/radio.js.map +1 -1
- package/dist/vue2/types/components/checkbox/checkbox.vue.d.ts +0 -2
- package/dist/vue2/types/components/radio/radio.vue.d.ts +0 -2
- package/dist/vue3/lib/checkbox/checkbox.cjs +1 -1
- package/dist/vue3/lib/checkbox/checkbox.cjs.map +1 -1
- package/dist/vue3/lib/checkbox/checkbox.js +25 -31
- package/dist/vue3/lib/checkbox/checkbox.js.map +1 -1
- package/dist/vue3/lib/radio/radio.cjs +1 -1
- package/dist/vue3/lib/radio/radio.cjs.map +1 -1
- package/dist/vue3/lib/radio/radio.js +24 -30
- package/dist/vue3/lib/radio/radio.js.map +1 -1
- package/dist/vue3/types/components/checkbox/checkbox.vue.d.ts +0 -2
- package/dist/vue3/types/components/checkbox/checkbox.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/radio/radio.vue.d.ts +0 -2
- package/dist/vue3/types/components/radio/radio.vue.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../common/mixins/input.cjs"),i=require("./checkbox-constants.cjs"),n=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),l=require("../validation-messages/validation-messages.cjs"),r={name:"DtCheckbox",components:{DtValidationMessages:l.default},mixins:[a.InputMixin,a.CheckableMixin,a.GroupableMixin,a.MessagesMixin],inheritAttrs:!1,emits:["input","focusin","focusout"],computed:{inputValidationClass(){return i.CHECKBOX_INPUT_VALIDATION_CLASSES[this.internalValidationState]},checkboxGroupValueChecked(){var t,e;return((e=(t=this.groupContext)==null?void 0:t.selectedValues)==null?void 0:e.includes(this.value))??!1},hasLabel(){return!!(this.$slots.default||this.label)},
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../common/mixins/input.cjs"),i=require("./checkbox-constants.cjs"),n=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),l=require("../validation-messages/validation-messages.cjs"),r={name:"DtCheckbox",components:{DtValidationMessages:l.default},mixins:[a.InputMixin,a.CheckableMixin,a.GroupableMixin,a.MessagesMixin],inheritAttrs:!1,emits:["input","focusin","focusout"],computed:{inputValidationClass(){return i.CHECKBOX_INPUT_VALIDATION_CLASSES[this.internalValidationState]},checkboxGroupValueChecked(){var t,e;return((e=(t=this.groupContext)==null?void 0:t.selectedValues)==null?void 0:e.includes(this.value))??!1},hasLabel(){return!!(this.$slots.default||this.label)},hasMessages(){return this.formattedMessages.length&&this.showMessages},inputListeners(){return{...this.$listeners,input:()=>{},change:t=>this.emitValue(t.target)}}},watch:{checkboxGroupValueChecked:{immediate:!0,handler(t){this.hasGroup&&(this.internalChecked=t)}}},mounted(){this.runValidations()},methods:{emitValue(t){let{value:e,checked:s}=t;this.internalIndeterminate&&(s=!1,this.internalIndeterminate=!1,t.checked=!1),this.setGroupValue(e,s),this.$emit("input",s)},runValidations(){this.validateInputLabels(this.hasLabel,this.$attrs["aria-label"])}}};var o=function(){var e=this,s=e._self._c;return s("div",[s("label",{class:["d-checkbox-group",{"d-checkbox-group--disabled":e.internalDisabled}]},[s("div",{staticClass:"d-checkbox__input"},[s("input",e._g(e._b({class:["d-checkbox",e.inputValidationClass,e.inputClass],attrs:{type:"checkbox",name:e.internalName,disabled:e.internalDisabled},domProps:{checked:e.internalChecked,value:e.value,indeterminate:e.internalIndeterminate}},"input",e.$attrs,!1),e.inputListeners))]),e.hasLabel?s("div",e._b({class:[e.labelClass,"d-checkbox__copy d-checkbox__label"],attrs:{"data-qa":"checkbox-label"}},"div",e.labelChildProps,!1),[e._t("default",function(){return[e._v(e._s(e.label))]})],2):e._e()]),e.$slots.description||e.description||e.hasMessages?s("div",{staticClass:"d-checkbox__messages",attrs:{"data-qa":"checkbox-description-messages"}},[e.$slots.description||e.description?s("div",e._b({class:["d-description",e.descriptionClass],attrs:{"data-qa":"checkbox-description"}},"div",e.descriptionChildProps,!1),[e._t("description",function(){return[e._v(" "+e._s(e.description)+" ")]})],2):e._e(),s("dt-validation-messages",e._b({class:e.messagesClass,attrs:{"validation-messages":e.formattedMessages,"show-messages":e.showMessages,"data-qa":"dt-checkbox-validation-messages"}},"dt-validation-messages",e.messagesChildProps,!1))],1):e._e()])},c=[],d=n.n(r,o,c);const u=d.exports;exports.default=u;
|
|
2
2
|
//# sourceMappingURL=checkbox.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.cjs","sources":["../../../components/checkbox/checkbox.vue"],"sourcesContent":["<template>\n <div>\n <label :class=\"['d-checkbox-group', { 'd-checkbox-group--disabled': internalDisabled }]\">\n <div class=\"d-checkbox__input\">\n <input\n type=\"checkbox\"\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n :class=\"['d-checkbox', inputValidationClass, inputClass]\"\n v-bind=\"$attrs\"\n :indeterminate.prop=\"internalIndeterminate\"\n v-on=\"inputListeners\"\n >\n </div>\n <div\n v-if=\"hasLabel\"\n :class=\"[labelClass, 'd-checkbox__copy d-checkbox__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"checkbox-label\"\n >\n <!-- @slot slot for Checkbox Label -->\n <slot>{{ label }}</slot>\n </div>\n </label>\n <div\n v-if=\"
|
|
1
|
+
{"version":3,"file":"checkbox.cjs","sources":["../../../components/checkbox/checkbox.vue"],"sourcesContent":["<template>\n <div>\n <label :class=\"['d-checkbox-group', { 'd-checkbox-group--disabled': internalDisabled }]\">\n <div class=\"d-checkbox__input\">\n <input\n type=\"checkbox\"\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n :class=\"['d-checkbox', inputValidationClass, inputClass]\"\n v-bind=\"$attrs\"\n :indeterminate.prop=\"internalIndeterminate\"\n v-on=\"inputListeners\"\n >\n </div>\n <div\n v-if=\"hasLabel\"\n :class=\"[labelClass, 'd-checkbox__copy d-checkbox__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"checkbox-label\"\n >\n <!-- @slot slot for Checkbox Label -->\n <slot>{{ label }}</slot>\n </div>\n </label>\n <div\n v-if=\"$slots.description || description || hasMessages\"\n class=\"d-checkbox__messages\"\n data-qa=\"checkbox-description-messages\"\n >\n <div\n v-if=\"$slots.description || description\"\n :class=\"['d-description', descriptionClass]\"\n v-bind=\"descriptionChildProps\"\n data-qa=\"checkbox-description\"\n >\n <!-- @slot slot for Checkbox Description -->\n <slot name=\"description\">\n {{ description }}\n </slot>\n </div>\n <dt-validation-messages\n :validation-messages=\"formattedMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n v-bind=\"messagesChildProps\"\n data-qa=\"dt-checkbox-validation-messages\"\n />\n </div>\n </div>\n</template>\n\n<script>\n// Imports\nimport {\n InputMixin,\n CheckableMixin,\n GroupableMixin,\n MessagesMixin,\n} from '@/common/mixins/input';\nimport { CHECKBOX_INPUT_VALIDATION_CLASSES } from './checkbox_constants';\nimport { DtValidationMessages } from '../validation_messages';\n\n/**\n * Checkboxes are control elements that allow the user to make a selection.They are typically used in a\n * Checkbox Group which allows the user to make one or more selections from a list of options.\n * @see https://dialtone.dialpad.com/components/checkbox.html\n */\nexport default {\n name: 'DtCheckbox',\n\n components: { DtValidationMessages },\n\n mixins: [InputMixin, CheckableMixin, GroupableMixin, MessagesMixin],\n\n inheritAttrs: false,\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {Boolean}\n */\n 'input',\n\n /**\n * Native input focusin event\n *\n * @event focusin\n * @type {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native input focusout event\n *\n * @event focusout\n * @type {FocusEvent}\n */\n 'focusout',\n ],\n\n computed: {\n inputValidationClass () {\n return CHECKBOX_INPUT_VALIDATION_CLASSES[this.internalValidationState];\n },\n\n checkboxGroupValueChecked () {\n return this.groupContext?.selectedValues?.includes(this.value) ?? false;\n },\n\n hasLabel () {\n return !!(this.$slots.default || this.label);\n },\n\n hasMessages () {\n return this.formattedMessages.length && this.showMessages;\n },\n\n inputListeners () {\n return {\n /* TODO\n Check if any usages of this component leverage $listeners and either remove if unused or scope the removal\n and migration prior to upgrading to Vue 3.x\n */\n ...this.$listeners,\n /*\n * Override input listener to as no-op. Prevents parent input listeners from being passed through\n * onto the input element which will result in the handler being called twice\n * (once on the input element and once by the emitted input event by the change listener).\n */\n input: () => {},\n change: event => this.emitValue(event.target),\n };\n },\n },\n\n watch: {\n checkboxGroupValueChecked: {\n immediate: true,\n handler (newCheckboxGroupValueChecked) {\n if (this.hasGroup) {\n // update internal value when the checkbox group value changes\n this.internalChecked = newCheckboxGroupValueChecked;\n }\n },\n },\n },\n\n mounted () {\n this.runValidations();\n },\n\n methods: {\n emitValue (target) {\n let { value, checked } = target;\n // Expected: Indeterminate -> unchecked. We need to manually set DOM property `checked` to false\n // and update this.internalIndeterminate.\n if (this.internalIndeterminate) {\n checked = false;\n this.internalIndeterminate = false;\n target.checked = false;\n }\n // update provided value if injected\n this.setGroupValue(value, checked);\n\n // emit the state of the checkbox\n this.$emit('input', checked);\n },\n\n runValidations () {\n this.validateInputLabels(this.hasLabel, this.$attrs['aria-label']);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtValidationMessages","InputMixin","CheckableMixin","GroupableMixin","MessagesMixin","CHECKBOX_INPUT_VALIDATION_CLASSES","_b","_a","event","newCheckboxGroupValueChecked","target","value","checked"],"mappings":"uTAqEAA,EAAA,CACA,KAAA,aAEA,WAAA,CAAAC,qBAAAA,EAAAA,OAAA,EAEA,OAAA,CAAAC,EAAA,WAAAC,iBAAAC,EAAAA,eAAAC,EAAAA,aAAA,EAEA,aAAA,GAEA,MAAA,CAOA,QAQA,UAQA,UACA,EAEA,SAAA,CACA,sBAAA,CACA,OAAAC,EAAA,kCAAA,KAAA,uBAAA,CACA,EAEA,2BAAA,SACA,QAAAC,GAAAC,EAAA,KAAA,eAAA,YAAAA,EAAA,iBAAA,YAAAD,EAAA,SAAA,KAAA,SAAA,EACA,EAEA,UAAA,CACA,MAAA,CAAA,EAAA,KAAA,OAAA,SAAA,KAAA,MACA,EAEA,aAAA,CACA,OAAA,KAAA,kBAAA,QAAA,KAAA,YACA,EAEA,gBAAA,CACA,MAAA,CAKA,GAAA,KAAA,WAMA,MAAA,IAAA,CAAA,EACA,OAAAE,GAAA,KAAA,UAAAA,EAAA,MAAA,CACA,CACA,CACA,EAEA,MAAA,CACA,0BAAA,CACA,UAAA,GACA,QAAAC,EAAA,CACA,KAAA,WAEA,KAAA,gBAAAA,EAEA,CACA,CACA,EAEA,SAAA,CACA,KAAA,eAAA,CACA,EAEA,QAAA,CACA,UAAAC,EAAA,CACA,GAAA,CAAA,MAAAC,EAAA,QAAAC,CAAA,EAAAF,EAGA,KAAA,wBACAE,EAAA,GACA,KAAA,sBAAA,GACAF,EAAA,QAAA,IAGA,KAAA,cAAAC,EAAAC,CAAA,EAGA,KAAA,MAAA,QAAAA,CAAA,CACA,EAEA,gBAAA,CACA,KAAA,oBAAA,KAAA,SAAA,KAAA,OAAA,YAAA,CAAA,CACA,CACA,CACA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { InputMixin as a, CheckableMixin as i, GroupableMixin as n, MessagesMixin as
|
|
2
|
-
import { CHECKBOX_INPUT_VALIDATION_CLASSES as
|
|
1
|
+
import { InputMixin as a, CheckableMixin as i, GroupableMixin as n, MessagesMixin as l } from "../../common/mixins/input.js";
|
|
2
|
+
import { CHECKBOX_INPUT_VALIDATION_CLASSES as r } from "./checkbox-constants.js";
|
|
3
3
|
import { n as o } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
4
4
|
import c from "../validation-messages/validation-messages.js";
|
|
5
5
|
const d = {
|
|
6
6
|
name: "DtCheckbox",
|
|
7
7
|
components: { DtValidationMessages: c },
|
|
8
|
-
mixins: [a, i, n,
|
|
8
|
+
mixins: [a, i, n, l],
|
|
9
9
|
inheritAttrs: !1,
|
|
10
10
|
emits: [
|
|
11
11
|
/**
|
|
@@ -32,7 +32,7 @@ const d = {
|
|
|
32
32
|
],
|
|
33
33
|
computed: {
|
|
34
34
|
inputValidationClass() {
|
|
35
|
-
return
|
|
35
|
+
return r[this.internalValidationState];
|
|
36
36
|
},
|
|
37
37
|
checkboxGroupValueChecked() {
|
|
38
38
|
var t, e;
|
|
@@ -41,12 +41,6 @@ const d = {
|
|
|
41
41
|
hasLabel() {
|
|
42
42
|
return !!(this.$slots.default || this.label);
|
|
43
43
|
},
|
|
44
|
-
hasDescription() {
|
|
45
|
-
return !!(this.$slots.description || this.description);
|
|
46
|
-
},
|
|
47
|
-
hasDescriptionOrMessages() {
|
|
48
|
-
return this.hasDescription || this.hasMessages;
|
|
49
|
-
},
|
|
50
44
|
hasMessages() {
|
|
51
45
|
return this.formattedMessages.length && this.showMessages;
|
|
52
46
|
},
|
|
@@ -93,7 +87,7 @@ var h = function() {
|
|
|
93
87
|
var e = this, s = e._self._c;
|
|
94
88
|
return s("div", [s("label", { class: ["d-checkbox-group", { "d-checkbox-group--disabled": e.internalDisabled }] }, [s("div", { staticClass: "d-checkbox__input" }, [s("input", e._g(e._b({ class: ["d-checkbox", e.inputValidationClass, e.inputClass], attrs: { type: "checkbox", name: e.internalName, disabled: e.internalDisabled }, domProps: { checked: e.internalChecked, value: e.value, indeterminate: e.internalIndeterminate } }, "input", e.$attrs, !1), e.inputListeners))]), e.hasLabel ? s("div", e._b({ class: [e.labelClass, "d-checkbox__copy d-checkbox__label"], attrs: { "data-qa": "checkbox-label" } }, "div", e.labelChildProps, !1), [e._t("default", function() {
|
|
95
89
|
return [e._v(e._s(e.label))];
|
|
96
|
-
})], 2) : e._e()]), e.
|
|
90
|
+
})], 2) : e._e()]), e.$slots.description || e.description || e.hasMessages ? s("div", { staticClass: "d-checkbox__messages", attrs: { "data-qa": "checkbox-description-messages" } }, [e.$slots.description || e.description ? s("div", e._b({ class: ["d-description", e.descriptionClass], attrs: { "data-qa": "checkbox-description" } }, "div", e.descriptionChildProps, !1), [e._t("description", function() {
|
|
97
91
|
return [e._v(" " + e._s(e.description) + " ")];
|
|
98
92
|
})], 2) : e._e(), s("dt-validation-messages", e._b({ class: e.messagesClass, attrs: { "validation-messages": e.formattedMessages, "show-messages": e.showMessages, "data-qa": "dt-checkbox-validation-messages" } }, "dt-validation-messages", e.messagesChildProps, !1))], 1) : e._e()]);
|
|
99
93
|
}, u = [], p = /* @__PURE__ */ o(
|
|
@@ -101,8 +95,8 @@ var h = function() {
|
|
|
101
95
|
h,
|
|
102
96
|
u
|
|
103
97
|
);
|
|
104
|
-
const
|
|
98
|
+
const k = p.exports;
|
|
105
99
|
export {
|
|
106
|
-
|
|
100
|
+
k as default
|
|
107
101
|
};
|
|
108
102
|
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sources":["../../../components/checkbox/checkbox.vue"],"sourcesContent":["<template>\n <div>\n <label :class=\"['d-checkbox-group', { 'd-checkbox-group--disabled': internalDisabled }]\">\n <div class=\"d-checkbox__input\">\n <input\n type=\"checkbox\"\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n :class=\"['d-checkbox', inputValidationClass, inputClass]\"\n v-bind=\"$attrs\"\n :indeterminate.prop=\"internalIndeterminate\"\n v-on=\"inputListeners\"\n >\n </div>\n <div\n v-if=\"hasLabel\"\n :class=\"[labelClass, 'd-checkbox__copy d-checkbox__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"checkbox-label\"\n >\n <!-- @slot slot for Checkbox Label -->\n <slot>{{ label }}</slot>\n </div>\n </label>\n <div\n v-if=\"
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../../../components/checkbox/checkbox.vue"],"sourcesContent":["<template>\n <div>\n <label :class=\"['d-checkbox-group', { 'd-checkbox-group--disabled': internalDisabled }]\">\n <div class=\"d-checkbox__input\">\n <input\n type=\"checkbox\"\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n :class=\"['d-checkbox', inputValidationClass, inputClass]\"\n v-bind=\"$attrs\"\n :indeterminate.prop=\"internalIndeterminate\"\n v-on=\"inputListeners\"\n >\n </div>\n <div\n v-if=\"hasLabel\"\n :class=\"[labelClass, 'd-checkbox__copy d-checkbox__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"checkbox-label\"\n >\n <!-- @slot slot for Checkbox Label -->\n <slot>{{ label }}</slot>\n </div>\n </label>\n <div\n v-if=\"$slots.description || description || hasMessages\"\n class=\"d-checkbox__messages\"\n data-qa=\"checkbox-description-messages\"\n >\n <div\n v-if=\"$slots.description || description\"\n :class=\"['d-description', descriptionClass]\"\n v-bind=\"descriptionChildProps\"\n data-qa=\"checkbox-description\"\n >\n <!-- @slot slot for Checkbox Description -->\n <slot name=\"description\">\n {{ description }}\n </slot>\n </div>\n <dt-validation-messages\n :validation-messages=\"formattedMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n v-bind=\"messagesChildProps\"\n data-qa=\"dt-checkbox-validation-messages\"\n />\n </div>\n </div>\n</template>\n\n<script>\n// Imports\nimport {\n InputMixin,\n CheckableMixin,\n GroupableMixin,\n MessagesMixin,\n} from '@/common/mixins/input';\nimport { CHECKBOX_INPUT_VALIDATION_CLASSES } from './checkbox_constants';\nimport { DtValidationMessages } from '../validation_messages';\n\n/**\n * Checkboxes are control elements that allow the user to make a selection.They are typically used in a\n * Checkbox Group which allows the user to make one or more selections from a list of options.\n * @see https://dialtone.dialpad.com/components/checkbox.html\n */\nexport default {\n name: 'DtCheckbox',\n\n components: { DtValidationMessages },\n\n mixins: [InputMixin, CheckableMixin, GroupableMixin, MessagesMixin],\n\n inheritAttrs: false,\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {Boolean}\n */\n 'input',\n\n /**\n * Native input focusin event\n *\n * @event focusin\n * @type {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native input focusout event\n *\n * @event focusout\n * @type {FocusEvent}\n */\n 'focusout',\n ],\n\n computed: {\n inputValidationClass () {\n return CHECKBOX_INPUT_VALIDATION_CLASSES[this.internalValidationState];\n },\n\n checkboxGroupValueChecked () {\n return this.groupContext?.selectedValues?.includes(this.value) ?? false;\n },\n\n hasLabel () {\n return !!(this.$slots.default || this.label);\n },\n\n hasMessages () {\n return this.formattedMessages.length && this.showMessages;\n },\n\n inputListeners () {\n return {\n /* TODO\n Check if any usages of this component leverage $listeners and either remove if unused or scope the removal\n and migration prior to upgrading to Vue 3.x\n */\n ...this.$listeners,\n /*\n * Override input listener to as no-op. Prevents parent input listeners from being passed through\n * onto the input element which will result in the handler being called twice\n * (once on the input element and once by the emitted input event by the change listener).\n */\n input: () => {},\n change: event => this.emitValue(event.target),\n };\n },\n },\n\n watch: {\n checkboxGroupValueChecked: {\n immediate: true,\n handler (newCheckboxGroupValueChecked) {\n if (this.hasGroup) {\n // update internal value when the checkbox group value changes\n this.internalChecked = newCheckboxGroupValueChecked;\n }\n },\n },\n },\n\n mounted () {\n this.runValidations();\n },\n\n methods: {\n emitValue (target) {\n let { value, checked } = target;\n // Expected: Indeterminate -> unchecked. We need to manually set DOM property `checked` to false\n // and update this.internalIndeterminate.\n if (this.internalIndeterminate) {\n checked = false;\n this.internalIndeterminate = false;\n target.checked = false;\n }\n // update provided value if injected\n this.setGroupValue(value, checked);\n\n // emit the state of the checkbox\n this.$emit('input', checked);\n },\n\n runValidations () {\n this.validateInputLabels(this.hasLabel, this.$attrs['aria-label']);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtValidationMessages","InputMixin","CheckableMixin","GroupableMixin","MessagesMixin","CHECKBOX_INPUT_VALIDATION_CLASSES","_b","_a","event","newCheckboxGroupValueChecked","target","value","checked"],"mappings":";;;;AAqEA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,sBAAAC,EAAA;AAAA,EAEA,QAAA,CAAAC,GAAAC,GAAAC,GAAAC,CAAA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,uBAAA;AACA,aAAAC,EAAA,KAAA,uBAAA;AAAA,IACA;AAAA,IAEA,4BAAA;;AACA,eAAAC,KAAAC,IAAA,KAAA,iBAAA,gBAAAA,EAAA,mBAAA,gBAAAD,EAAA,SAAA,KAAA,WAAA;AAAA,IACA;AAAA,IAEA,WAAA;AACA,aAAA,CAAA,EAAA,KAAA,OAAA,WAAA,KAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,aAAA,KAAA,kBAAA,UAAA,KAAA;AAAA,IACA;AAAA,IAEA,iBAAA;AACA,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAKA,GAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAMA,OAAA,MAAA;AAAA,QAAA;AAAA,QACA,QAAA,CAAAE,MAAA,KAAA,UAAAA,EAAA,MAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,2BAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAAC,GAAA;AACA,QAAA,KAAA,aAEA,KAAA,kBAAAA;AAAA,MAEA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AACA,SAAA,eAAA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,UAAAC,GAAA;AACA,UAAA,EAAA,OAAAC,GAAA,SAAAC,EAAA,IAAAF;AAGA,MAAA,KAAA,0BACAE,IAAA,IACA,KAAA,wBAAA,IACAF,EAAA,UAAA,KAGA,KAAA,cAAAC,GAAAC,CAAA,GAGA,KAAA,MAAA,SAAAA,CAAA;AAAA,IACA;AAAA,IAEA,iBAAA;AACA,WAAA,oBAAA,KAAA,UAAA,KAAA,OAAA,YAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../../common/mixins/input.cjs"),t=require("./radio-constants.cjs"),r=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),n=require("../validation-messages/validation-messages.cjs"),d={name:"DtRadio",components:{DtValidationMessages:n.default},mixins:[i.InputMixin,i.CheckableMixin,i.GroupableMixin,i.MessagesMixin],inheritAttrs:!1,props:{value:{type:[String,Number],default:""}},emits:["input","focusin","focusout"],computed:{inputValidationClass(){return t.RADIO_INPUT_VALIDATION_CLASSES[this.internalValidationState]},radioGroupValue(){var e;return(e=this.groupContext)==null?void 0:e.selectedValue},inputListeners(){return{...this.$listeners,input:()=>{},change:e=>this.emitValue(e.target.value)}},hasMessages(){return this.formattedMessages.length&&this.showMessages}},watch:{radioGroupValue:{immediate:!0,handler(e){this.hasGroup&&(this.internalChecked=e===this.value)}}},methods:{emitValue(e){e!==this.radioGroupValue&&(this.setGroupValue(e),this.$emit("input",e))}}};var o=function(){var s=this,a=s._self._c;return a("div",[a("label",{class:["d-radio-group",{"d-radio-group--disabled":s.internalDisabled}]},[a("div",{staticClass:"d-radio__input"},[a("input",s._g(s._b({class:["d-radio",s.inputValidationClass,s.inputClass],attrs:{name:s.internalName,disabled:s.internalDisabled,type:"radio"},domProps:{checked:s.internalChecked,value:s.value}},"input",s.$attrs,!1),s.inputListeners))]),a("div",s._b({class:[s.labelClass,"d-radio__copy d-radio__label"],attrs:{"data-qa":"radio-label"}},"div",s.labelChildProps,!1),[s._t("default",function(){return[s._v(s._s(s.label))]})],2)]),s.$slots.description||s.description||s.hasMessages?a("div",{staticClass:"d-radio__messages",attrs:{"data-qa":"radio-description-messages"}},[s.$slots.description||s.description?a("div",s._b({class:["d-description",s.descriptionClass],attrs:{"data-qa":"radio-description"}},"div",s.descriptionChildProps,!1),[s._t("description",function(){return[s._v(" "+s._s(s.description)+" ")]})],2):s._e(),a("dt-validation-messages",s._b({class:s.messagesClass,attrs:{"validation-messages":s.formattedMessages,"show-messages":s.showMessages,"data-qa":"dt-radio-validation-messages"}},"dt-validation-messages",s.messagesChildProps,!1))],1):s._e()])},l=[],u=r.n(d,o,l);const c=u.exports;exports.default=c;
|
|
2
2
|
//# sourceMappingURL=radio.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.cjs","sources":["../../../components/radio/radio.vue"],"sourcesContent":["<template>\n <div>\n <label :class=\"['d-radio-group', { 'd-radio-group--disabled': internalDisabled }]\">\n <div class=\"d-radio__input\">\n <input\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n type=\"radio\"\n :class=\"['d-radio', inputValidationClass, inputClass]\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n >\n </div>\n <div\n :class=\"[labelClass, 'd-radio__copy d-radio__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"radio-label\"\n >\n <!-- @slot slot for Radio Label -->\n <slot>{{ label }}</slot>\n </div>\n </label>\n <div\n v-if=\"
|
|
1
|
+
{"version":3,"file":"radio.cjs","sources":["../../../components/radio/radio.vue"],"sourcesContent":["<template>\n <div>\n <label :class=\"['d-radio-group', { 'd-radio-group--disabled': internalDisabled }]\">\n <div class=\"d-radio__input\">\n <input\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n type=\"radio\"\n :class=\"['d-radio', inputValidationClass, inputClass]\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n >\n </div>\n <div\n :class=\"[labelClass, 'd-radio__copy d-radio__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"radio-label\"\n >\n <!-- @slot slot for Radio Label -->\n <slot>{{ label }}</slot>\n </div>\n </label>\n <div\n v-if=\"$slots.description || description || hasMessages\"\n class=\"d-radio__messages\"\n data-qa=\"radio-description-messages\"\n >\n <div\n v-if=\"$slots.description || description\"\n :class=\"['d-description', descriptionClass]\"\n v-bind=\"descriptionChildProps\"\n data-qa=\"radio-description\"\n >\n <!-- @slot slot for Radio Description -->\n <slot name=\"description\">\n {{ description }}\n </slot>\n </div>\n <dt-validation-messages\n :validation-messages=\"formattedMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n v-bind=\"messagesChildProps\"\n data-qa=\"dt-radio-validation-messages\"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport {\n InputMixin,\n CheckableMixin,\n GroupableMixin,\n MessagesMixin,\n} from '@/common/mixins/input';\nimport { RADIO_INPUT_VALIDATION_CLASSES } from './radio_constants';\nimport { DtValidationMessages } from '../validation_messages';\n\n/**\n * Radios are control elements that allow the user to make a single selection.\n * They are typically used in a Radio Group which allows the user to make a selection from a list of options.\n * @see https://dialtone.dialpad.com/components/radio.html\n */\nexport default {\n name: 'DtRadio',\n\n components: { DtValidationMessages },\n\n mixins: [InputMixin, CheckableMixin, GroupableMixin, MessagesMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * A provided value for the radio\n */\n value: {\n type: [String, Number],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String | Number}\n */\n 'input',\n\n /**\n * Native input focusin event\n *\n * @event focusin\n * @property {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native input focusout event\n *\n * @event focusout\n * @property {FocusEvent}\n */\n 'focusout',\n ],\n\n computed: {\n inputValidationClass () {\n return RADIO_INPUT_VALIDATION_CLASSES[this.internalValidationState];\n },\n\n radioGroupValue () {\n return this.groupContext?.selectedValue;\n },\n\n inputListeners () {\n return {\n /* TODO\n Check if any usages of this component leverage $listeners and either remove if unused or scope the removal\n and migration prior to upgrading to Vue 3.x\n */\n ...this.$listeners,\n /*\n * Override input listener to as no-op. Prevents parent input listeners from being passed through onto the input\n * element which will result in the hander being called twice (once on the input element and once by the emitted\n * input event by the change listener).\n */\n input: () => {},\n change: event => this.emitValue(event.target.value),\n };\n },\n\n hasMessages () {\n return this.formattedMessages.length && this.showMessages;\n },\n },\n\n watch: {\n radioGroupValue: {\n immediate: true,\n handler (newRadioGroupValue) {\n if (this.hasGroup) {\n // update internal value when the radio group value changes\n this.internalChecked = newRadioGroupValue === this.value;\n }\n },\n },\n },\n\n methods: {\n emitValue (value) {\n if (value !== this.radioGroupValue) {\n // update provided value if injected\n this.setGroupValue(value);\n\n this.$emit('input', value);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtValidationMessages","InputMixin","CheckableMixin","GroupableMixin","MessagesMixin","RADIO_INPUT_VALIDATION_CLASSES","_a","event","newRadioGroupValue","value"],"mappings":"oTAkEAA,EAAA,CACA,KAAA,UAEA,WAAA,CAAAC,qBAAAA,EAAAA,OAAA,EAEA,OAAA,CAAAC,EAAA,WAAAC,iBAAAC,EAAAA,eAAAC,EAAAA,aAAA,EAEA,aAAA,GAEA,MAAA,CAIA,MAAA,CACA,KAAA,CAAA,OAAA,MAAA,EACA,QAAA,EACA,CACA,EAEA,MAAA,CAOA,QAQA,UAQA,UACA,EAEA,SAAA,CACA,sBAAA,CACA,OAAAC,EAAA,+BAAA,KAAA,uBAAA,CACA,EAEA,iBAAA,OACA,OAAAC,EAAA,KAAA,eAAA,YAAAA,EAAA,aACA,EAEA,gBAAA,CACA,MAAA,CAKA,GAAA,KAAA,WAMA,MAAA,IAAA,CAAA,EACA,OAAAC,GAAA,KAAA,UAAAA,EAAA,OAAA,KAAA,CACA,CACA,EAEA,aAAA,CACA,OAAA,KAAA,kBAAA,QAAA,KAAA,YACA,CACA,EAEA,MAAA,CACA,gBAAA,CACA,UAAA,GACA,QAAAC,EAAA,CACA,KAAA,WAEA,KAAA,gBAAAA,IAAA,KAAA,MAEA,CACA,CACA,EAEA,QAAA,CACA,UAAAC,EAAA,CACAA,IAAA,KAAA,kBAEA,KAAA,cAAAA,CAAA,EAEA,KAAA,MAAA,QAAAA,CAAA,EAEA,CACA,CACA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { InputMixin as
|
|
1
|
+
import { InputMixin as t, CheckableMixin as i, GroupableMixin as r, MessagesMixin as n } from "../../common/mixins/input.js";
|
|
2
2
|
import { RADIO_INPUT_VALIDATION_CLASSES as o } from "./radio-constants.js";
|
|
3
3
|
import { n as d } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
4
4
|
import l from "../validation-messages/validation-messages.js";
|
|
5
5
|
const p = {
|
|
6
6
|
name: "DtRadio",
|
|
7
7
|
components: { DtValidationMessages: l },
|
|
8
|
-
mixins: [
|
|
8
|
+
mixins: [t, i, r, n],
|
|
9
9
|
inheritAttrs: !1,
|
|
10
10
|
props: {
|
|
11
11
|
/**
|
|
@@ -64,12 +64,6 @@ const p = {
|
|
|
64
64
|
change: (e) => this.emitValue(e.target.value)
|
|
65
65
|
};
|
|
66
66
|
},
|
|
67
|
-
hasDescription() {
|
|
68
|
-
return !!(this.$slots.description || this.description);
|
|
69
|
-
},
|
|
70
|
-
hasDescriptionOrMessages() {
|
|
71
|
-
return this.hasDescription || this.hasMessages;
|
|
72
|
-
},
|
|
73
67
|
hasMessages() {
|
|
74
68
|
return this.formattedMessages.length && this.showMessages;
|
|
75
69
|
}
|
|
@@ -92,15 +86,15 @@ var u = function() {
|
|
|
92
86
|
var s = this, a = s._self._c;
|
|
93
87
|
return a("div", [a("label", { class: ["d-radio-group", { "d-radio-group--disabled": s.internalDisabled }] }, [a("div", { staticClass: "d-radio__input" }, [a("input", s._g(s._b({ class: ["d-radio", s.inputValidationClass, s.inputClass], attrs: { name: s.internalName, disabled: s.internalDisabled, type: "radio" }, domProps: { checked: s.internalChecked, value: s.value } }, "input", s.$attrs, !1), s.inputListeners))]), a("div", s._b({ class: [s.labelClass, "d-radio__copy d-radio__label"], attrs: { "data-qa": "radio-label" } }, "div", s.labelChildProps, !1), [s._t("default", function() {
|
|
94
88
|
return [s._v(s._s(s.label))];
|
|
95
|
-
})], 2)]), s.
|
|
89
|
+
})], 2)]), s.$slots.description || s.description || s.hasMessages ? a("div", { staticClass: "d-radio__messages", attrs: { "data-qa": "radio-description-messages" } }, [s.$slots.description || s.description ? a("div", s._b({ class: ["d-description", s.descriptionClass], attrs: { "data-qa": "radio-description" } }, "div", s.descriptionChildProps, !1), [s._t("description", function() {
|
|
96
90
|
return [s._v(" " + s._s(s.description) + " ")];
|
|
97
91
|
})], 2) : s._e(), a("dt-validation-messages", s._b({ class: s.messagesClass, attrs: { "validation-messages": s.formattedMessages, "show-messages": s.showMessages, "data-qa": "dt-radio-validation-messages" } }, "dt-validation-messages", s.messagesChildProps, !1))], 1) : s._e()]);
|
|
98
|
-
}, c = [],
|
|
92
|
+
}, c = [], m = /* @__PURE__ */ d(
|
|
99
93
|
p,
|
|
100
94
|
u,
|
|
101
95
|
c
|
|
102
96
|
);
|
|
103
|
-
const v =
|
|
97
|
+
const v = m.exports;
|
|
104
98
|
export {
|
|
105
99
|
v as default
|
|
106
100
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.js","sources":["../../../components/radio/radio.vue"],"sourcesContent":["<template>\n <div>\n <label :class=\"['d-radio-group', { 'd-radio-group--disabled': internalDisabled }]\">\n <div class=\"d-radio__input\">\n <input\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n type=\"radio\"\n :class=\"['d-radio', inputValidationClass, inputClass]\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n >\n </div>\n <div\n :class=\"[labelClass, 'd-radio__copy d-radio__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"radio-label\"\n >\n <!-- @slot slot for Radio Label -->\n <slot>{{ label }}</slot>\n </div>\n </label>\n <div\n v-if=\"
|
|
1
|
+
{"version":3,"file":"radio.js","sources":["../../../components/radio/radio.vue"],"sourcesContent":["<template>\n <div>\n <label :class=\"['d-radio-group', { 'd-radio-group--disabled': internalDisabled }]\">\n <div class=\"d-radio__input\">\n <input\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n type=\"radio\"\n :class=\"['d-radio', inputValidationClass, inputClass]\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n >\n </div>\n <div\n :class=\"[labelClass, 'd-radio__copy d-radio__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"radio-label\"\n >\n <!-- @slot slot for Radio Label -->\n <slot>{{ label }}</slot>\n </div>\n </label>\n <div\n v-if=\"$slots.description || description || hasMessages\"\n class=\"d-radio__messages\"\n data-qa=\"radio-description-messages\"\n >\n <div\n v-if=\"$slots.description || description\"\n :class=\"['d-description', descriptionClass]\"\n v-bind=\"descriptionChildProps\"\n data-qa=\"radio-description\"\n >\n <!-- @slot slot for Radio Description -->\n <slot name=\"description\">\n {{ description }}\n </slot>\n </div>\n <dt-validation-messages\n :validation-messages=\"formattedMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n v-bind=\"messagesChildProps\"\n data-qa=\"dt-radio-validation-messages\"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport {\n InputMixin,\n CheckableMixin,\n GroupableMixin,\n MessagesMixin,\n} from '@/common/mixins/input';\nimport { RADIO_INPUT_VALIDATION_CLASSES } from './radio_constants';\nimport { DtValidationMessages } from '../validation_messages';\n\n/**\n * Radios are control elements that allow the user to make a single selection.\n * They are typically used in a Radio Group which allows the user to make a selection from a list of options.\n * @see https://dialtone.dialpad.com/components/radio.html\n */\nexport default {\n name: 'DtRadio',\n\n components: { DtValidationMessages },\n\n mixins: [InputMixin, CheckableMixin, GroupableMixin, MessagesMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * A provided value for the radio\n */\n value: {\n type: [String, Number],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String | Number}\n */\n 'input',\n\n /**\n * Native input focusin event\n *\n * @event focusin\n * @property {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native input focusout event\n *\n * @event focusout\n * @property {FocusEvent}\n */\n 'focusout',\n ],\n\n computed: {\n inputValidationClass () {\n return RADIO_INPUT_VALIDATION_CLASSES[this.internalValidationState];\n },\n\n radioGroupValue () {\n return this.groupContext?.selectedValue;\n },\n\n inputListeners () {\n return {\n /* TODO\n Check if any usages of this component leverage $listeners and either remove if unused or scope the removal\n and migration prior to upgrading to Vue 3.x\n */\n ...this.$listeners,\n /*\n * Override input listener to as no-op. Prevents parent input listeners from being passed through onto the input\n * element which will result in the hander being called twice (once on the input element and once by the emitted\n * input event by the change listener).\n */\n input: () => {},\n change: event => this.emitValue(event.target.value),\n };\n },\n\n hasMessages () {\n return this.formattedMessages.length && this.showMessages;\n },\n },\n\n watch: {\n radioGroupValue: {\n immediate: true,\n handler (newRadioGroupValue) {\n if (this.hasGroup) {\n // update internal value when the radio group value changes\n this.internalChecked = newRadioGroupValue === this.value;\n }\n },\n },\n },\n\n methods: {\n emitValue (value) {\n if (value !== this.radioGroupValue) {\n // update provided value if injected\n this.setGroupValue(value);\n\n this.$emit('input', value);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtValidationMessages","InputMixin","CheckableMixin","GroupableMixin","MessagesMixin","RADIO_INPUT_VALIDATION_CLASSES","_a","event","newRadioGroupValue","value"],"mappings":";;;;AAkEA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,sBAAAC,EAAA;AAAA,EAEA,QAAA,CAAAC,GAAAC,GAAAC,GAAAC,CAAA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,uBAAA;AACA,aAAAC,EAAA,KAAA,uBAAA;AAAA,IACA;AAAA,IAEA,kBAAA;;AACA,cAAAC,IAAA,KAAA,iBAAA,gBAAAA,EAAA;AAAA,IACA;AAAA,IAEA,iBAAA;AACA,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAKA,GAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAMA,OAAA,MAAA;AAAA,QAAA;AAAA,QACA,QAAA,CAAAC,MAAA,KAAA,UAAAA,EAAA,OAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,aAAA,KAAA,kBAAA,UAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,iBAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAAC,GAAA;AACA,QAAA,KAAA,aAEA,KAAA,kBAAAA,MAAA,KAAA;AAAA,MAEA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,UAAAC,GAAA;AACA,MAAAA,MAAA,KAAA,oBAEA,KAAA,cAAAA,CAAA,GAEA,KAAA,MAAA,SAAAA,CAAA;AAAA,IAEA;AAAA,EACA;AACA;;;;;;;;;;;;;;"}
|
|
@@ -2,8 +2,6 @@ declare const _default: import('vue').DefineComponent<{}, any, {}, {
|
|
|
2
2
|
inputValidationClass(): any;
|
|
3
3
|
checkboxGroupValueChecked(): any;
|
|
4
4
|
hasLabel(): boolean;
|
|
5
|
-
hasDescription(): boolean;
|
|
6
|
-
hasDescriptionOrMessages(): any;
|
|
7
5
|
hasMessages(): any;
|
|
8
6
|
inputListeners(): any;
|
|
9
7
|
}, {
|
|
@@ -7,8 +7,6 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
7
7
|
inputValidationClass(): any;
|
|
8
8
|
radioGroupValue(): any;
|
|
9
9
|
inputListeners(): any;
|
|
10
|
-
hasDescription(): boolean;
|
|
11
|
-
hasDescriptionOrMessages(): any;
|
|
12
10
|
hasMessages(): any;
|
|
13
11
|
}, {
|
|
14
12
|
emitValue(value: any): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("../../common/mixins/input.cjs"),o=require("../../common/utils/index.cjs"),r=require("./checkbox-constants.cjs"),s=require("vue"),d=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),c=require("../validation-messages/validation-messages.cjs"),u={compatConfig:{MODE:3},name:"DtCheckbox",components:{DtValidationMessages:c.default},mixins:[l.InputMixin,l.CheckableMixin,l.GroupableMixin,l.MessagesMixin],inheritAttrs:!1,emits:["input","focusin","focusout"],computed:{inputValidationClass(){return r.CHECKBOX_INPUT_VALIDATION_CLASSES[this.internalValidationState]},checkboxGroupValueChecked(){var e,a;return((a=(e=this.groupContext)==null?void 0:e.selectedValues)==null?void 0:a.includes(this.value))??!1},hasLabel(){return!!(this.$slots.default||this.label)},hasMessages(){return this.formattedMessages.length&&this.showMessages},inputListeners(){return{input:()=>{},focusin:e=>this.$emit("focusin",e),focusout:e=>this.$emit("focusout",e),change:e=>this.emitValue(e.target)}}},watch:{checkboxGroupValueChecked:{immediate:!0,handler(e){this.hasGroup&&(this.internalChecked=e)}}},mounted(){this.runValidations()},methods:{removeClassStyleAttrs:o.removeClassStyleAttrs,addClassStyleAttrs:o.addClassStyleAttrs,emitValue(e){let{value:a,checked:i}=e;this.internalIndeterminate&&(i=!1,this.internalIndeterminate=!1,e.checked=!1),this.setGroupValue(a,i),this.$emit("input",i)},runValidations(){this.validateInputLabels(this.hasLabel,this.$attrs["aria-label"])}}},h={class:"d-checkbox__input"},m=["checked","name","value","disabled",".indeterminate"],p={key:0,class:"d-checkbox__messages","data-qa":"checkbox-description-messages"};function b(e,a,i,g,C,t){const n=s.resolveComponent("dt-validation-messages");return s.openBlock(),s.createElementBlock("div",s.normalizeProps(s.guardReactiveProps(t.addClassStyleAttrs(e.$attrs))),[s.createElementVNode("label",{class:s.normalizeClass(["d-checkbox-group",{"d-checkbox-group--disabled":e.internalDisabled}])},[s.createElementVNode("div",h,[s.createElementVNode("input",s.mergeProps({type:"checkbox",checked:e.internalChecked,name:e.internalName,value:e.value,disabled:e.internalDisabled,class:["d-checkbox",t.inputValidationClass,e.inputClass]},t.removeClassStyleAttrs(e.$attrs),{".indeterminate":e.internalIndeterminate},s.toHandlers(t.inputListeners,!0)),null,48,m)]),t.hasLabel?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,class:[e.labelClass,"d-checkbox__copy d-checkbox__label"]},e.labelChildProps,{"data-qa":"checkbox-label"}),[s.renderSlot(e.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(e.label),1)])],16)):s.createCommentVNode("",!0)],2),e.$slots.description||e.description||t.hasMessages?(s.openBlock(),s.createElementBlock("div",p,[e.$slots.description||e.description?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,class:["d-description",e.descriptionClass]},e.descriptionChildProps,{"data-qa":"checkbox-description"}),[s.renderSlot(e.$slots,"description",{},()=>[s.createTextVNode(s.toDisplayString(e.description),1)])],16)):s.createCommentVNode("",!0),s.createVNode(n,s.mergeProps({"validation-messages":e.formattedMessages,"show-messages":e.showMessages,class:e.messagesClass},e.messagesChildProps,{"data-qa":"dt-checkbox-validation-messages"}),null,16,["validation-messages","show-messages","class"])])):s.createCommentVNode("",!0)],16)}const k=d._(u,[["render",b]]);exports.default=k;
|
|
2
2
|
//# sourceMappingURL=checkbox.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.cjs","sources":["../../../components/checkbox/checkbox.vue"],"sourcesContent":["<template>\n <div\n v-bind=\"addClassStyleAttrs($attrs)\"\n >\n <label :class=\"['d-checkbox-group', { 'd-checkbox-group--disabled': internalDisabled }]\">\n <div class=\"d-checkbox__input\">\n <input\n type=\"checkbox\"\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n :class=\"['d-checkbox', inputValidationClass, inputClass]\"\n v-bind=\"removeClassStyleAttrs($attrs)\"\n :indeterminate.prop=\"internalIndeterminate\"\n v-on=\"inputListeners\"\n >\n </div>\n <div\n v-if=\"hasLabel\"\n :class=\"[labelClass, 'd-checkbox__copy d-checkbox__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"checkbox-label\"\n >\n <!-- @slot slot for Checkbox Label -->\n <slot>{{ label }}</slot>\n </div>\n </label>\n <div\n v-if=\"
|
|
1
|
+
{"version":3,"file":"checkbox.cjs","sources":["../../../components/checkbox/checkbox.vue"],"sourcesContent":["<template>\n <div\n v-bind=\"addClassStyleAttrs($attrs)\"\n >\n <label :class=\"['d-checkbox-group', { 'd-checkbox-group--disabled': internalDisabled }]\">\n <div class=\"d-checkbox__input\">\n <input\n type=\"checkbox\"\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n :class=\"['d-checkbox', inputValidationClass, inputClass]\"\n v-bind=\"removeClassStyleAttrs($attrs)\"\n :indeterminate.prop=\"internalIndeterminate\"\n v-on=\"inputListeners\"\n >\n </div>\n <div\n v-if=\"hasLabel\"\n :class=\"[labelClass, 'd-checkbox__copy d-checkbox__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"checkbox-label\"\n >\n <!-- @slot slot for Checkbox Label -->\n <slot>{{ label }}</slot>\n </div>\n </label>\n <div\n v-if=\"$slots.description || description || hasMessages\"\n class=\"d-checkbox__messages\"\n data-qa=\"checkbox-description-messages\"\n >\n <div\n v-if=\"$slots.description || description\"\n :class=\"['d-description', descriptionClass]\"\n v-bind=\"descriptionChildProps\"\n data-qa=\"checkbox-description\"\n >\n <!-- @slot slot for Checkbox Description -->\n <slot name=\"description\">\n {{ description }}\n </slot>\n </div>\n <dt-validation-messages\n :validation-messages=\"formattedMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n v-bind=\"messagesChildProps\"\n data-qa=\"dt-checkbox-validation-messages\"\n />\n </div>\n </div>\n</template>\n\n<script>\n// Imports\nimport {\n InputMixin,\n CheckableMixin,\n GroupableMixin,\n MessagesMixin,\n} from '@/common/mixins/input';\nimport { removeClassStyleAttrs, addClassStyleAttrs } from '@/common/utils';\nimport { CHECKBOX_INPUT_VALIDATION_CLASSES } from './checkbox_constants';\nimport { DtValidationMessages } from '../validation_messages';\n\n/**\n * Checkboxes are control elements that allow the user to make a selection.They are typically used in a\n * Checkbox Group which allows the user to make one or more selections from a list of options.\n * @see https://dialtone.dialpad.com/components/checkbox.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtCheckbox',\n\n components: { DtValidationMessages },\n\n mixins: [InputMixin, CheckableMixin, GroupableMixin, MessagesMixin],\n\n inheritAttrs: false,\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {Boolean}\n */\n 'input',\n\n /**\n * Native input focusin event\n *\n * @event focusin\n * @type {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native input focusout event\n *\n * @event focusout\n * @type {FocusEvent}\n */\n 'focusout',\n ],\n\n computed: {\n inputValidationClass () {\n return CHECKBOX_INPUT_VALIDATION_CLASSES[this.internalValidationState];\n },\n\n checkboxGroupValueChecked () {\n return this.groupContext?.selectedValues?.includes(this.value) ?? false;\n },\n\n hasLabel () {\n return !!(this.$slots.default || this.label);\n },\n\n hasMessages () {\n return this.formattedMessages.length && this.showMessages;\n },\n\n inputListeners () {\n return {\n /*\n * Override input listener to as no-op. Prevents parent input listeners from being passed through\n * onto the input element which will result in the handler being called twice\n * (once on the input element and once by the emitted input event by the change listener).\n */\n input: () => {},\n focusin: event => this.$emit('focusin', event),\n focusout: event => this.$emit('focusout', event),\n change: event => this.emitValue(event.target),\n };\n },\n },\n\n watch: {\n checkboxGroupValueChecked: {\n immediate: true,\n handler (newCheckboxGroupValueChecked) {\n if (this.hasGroup) {\n // update internal value when the checkbox group value changes\n this.internalChecked = newCheckboxGroupValueChecked;\n }\n },\n },\n },\n\n mounted () {\n this.runValidations();\n },\n\n methods: {\n removeClassStyleAttrs,\n addClassStyleAttrs,\n\n emitValue (target) {\n let { value, checked } = target;\n // Expected: Indeterminate -> unchecked. We need to manually set DOM property `checked` to false\n // and update this.internalIndeterminate.\n if (this.internalIndeterminate) {\n checked = false;\n this.internalIndeterminate = false;\n target.checked = false;\n }\n // update provided value if injected\n this.setGroupValue(value, checked);\n\n // emit the state of the checkbox\n this.$emit('input', checked);\n },\n\n runValidations () {\n this.validateInputLabels(this.hasLabel, this.$attrs['aria-label']);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtValidationMessages","InputMixin","CheckableMixin","GroupableMixin","MessagesMixin","CHECKBOX_INPUT_VALIDATION_CLASSES","_b","_a","event","newCheckboxGroupValueChecked","removeClassStyleAttrs","addClassStyleAttrs","target","value","checked","_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","$options","_ctx","_createElementVNode","_normalizeClass","_mergeProps","_toHandlers","_renderSlot","_createTextVNode","_toDisplayString","_createCommentVNode","_hoisted_3","_createVNode","_component_dt_validation_messages"],"mappings":"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"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { InputMixin as m, CheckableMixin as p, GroupableMixin as b, MessagesMixin as
|
|
2
|
-
import { removeClassStyleAttrs as
|
|
1
|
+
import { InputMixin as m, CheckableMixin as p, GroupableMixin as b, MessagesMixin as k } from "../../common/mixins/input.js";
|
|
2
|
+
import { removeClassStyleAttrs as f, addClassStyleAttrs as g } from "../../common/utils/index.js";
|
|
3
3
|
import { CHECKBOX_INPUT_VALIDATION_CLASSES as C } from "./checkbox-constants.js";
|
|
4
|
-
import { resolveComponent as v, openBlock as i, createElementBlock as
|
|
5
|
-
import { _ } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
-
import
|
|
4
|
+
import { resolveComponent as v, openBlock as i, createElementBlock as l, normalizeProps as V, guardReactiveProps as M, createElementVNode as n, normalizeClass as y, mergeProps as o, toHandlers as S, renderSlot as d, createTextVNode as c, toDisplayString as h, createCommentVNode as r, createVNode as $ } from "vue";
|
|
5
|
+
import { _ as A } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
import D from "../validation-messages/validation-messages.js";
|
|
7
7
|
const I = {
|
|
8
8
|
compatConfig: { MODE: 3 },
|
|
9
9
|
name: "DtCheckbox",
|
|
10
|
-
components: { DtValidationMessages:
|
|
11
|
-
mixins: [m, p, b,
|
|
10
|
+
components: { DtValidationMessages: D },
|
|
11
|
+
mixins: [m, p, b, k],
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
emits: [
|
|
14
14
|
/**
|
|
@@ -44,12 +44,6 @@ const I = {
|
|
|
44
44
|
hasLabel() {
|
|
45
45
|
return !!(this.$slots.default || this.label);
|
|
46
46
|
},
|
|
47
|
-
hasDescription() {
|
|
48
|
-
return !!(this.$slots.description || this.description);
|
|
49
|
-
},
|
|
50
|
-
hasDescriptionOrMessages() {
|
|
51
|
-
return this.hasDescription || this.hasMessages;
|
|
52
|
-
},
|
|
53
47
|
hasMessages() {
|
|
54
48
|
return this.formattedMessages.length && this.showMessages;
|
|
55
49
|
},
|
|
@@ -80,8 +74,8 @@ const I = {
|
|
|
80
74
|
this.runValidations();
|
|
81
75
|
},
|
|
82
76
|
methods: {
|
|
83
|
-
removeClassStyleAttrs:
|
|
84
|
-
addClassStyleAttrs:
|
|
77
|
+
removeClassStyleAttrs: f,
|
|
78
|
+
addClassStyleAttrs: g,
|
|
85
79
|
emitValue(e) {
|
|
86
80
|
let { value: a, checked: t } = e;
|
|
87
81
|
this.internalIndeterminate && (t = !1, this.internalIndeterminate = !1, e.checked = !1), this.setGroupValue(a, t), this.$emit("input", t);
|
|
@@ -95,50 +89,50 @@ const I = {
|
|
|
95
89
|
class: "d-checkbox__messages",
|
|
96
90
|
"data-qa": "checkbox-description-messages"
|
|
97
91
|
};
|
|
98
|
-
function
|
|
92
|
+
function w(e, a, t, E, G, s) {
|
|
99
93
|
const u = v("dt-validation-messages");
|
|
100
|
-
return i(),
|
|
101
|
-
|
|
102
|
-
class:
|
|
94
|
+
return i(), l("div", V(M(s.addClassStyleAttrs(e.$attrs))), [
|
|
95
|
+
n("label", {
|
|
96
|
+
class: y(["d-checkbox-group", { "d-checkbox-group--disabled": e.internalDisabled }])
|
|
103
97
|
}, [
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
n("div", L, [
|
|
99
|
+
n("input", o({
|
|
106
100
|
type: "checkbox",
|
|
107
101
|
checked: e.internalChecked,
|
|
108
102
|
name: e.internalName,
|
|
109
103
|
value: e.value,
|
|
110
104
|
disabled: e.internalDisabled,
|
|
111
105
|
class: ["d-checkbox", s.inputValidationClass, e.inputClass]
|
|
112
|
-
}, s.removeClassStyleAttrs(e.$attrs), { ".indeterminate": e.internalIndeterminate },
|
|
106
|
+
}, s.removeClassStyleAttrs(e.$attrs), { ".indeterminate": e.internalIndeterminate }, S(s.inputListeners, !0)), null, 48, N)
|
|
113
107
|
]),
|
|
114
|
-
s.hasLabel ? (i(),
|
|
108
|
+
s.hasLabel ? (i(), l("div", o({
|
|
115
109
|
key: 0,
|
|
116
110
|
class: [e.labelClass, "d-checkbox__copy d-checkbox__label"]
|
|
117
111
|
}, e.labelChildProps, { "data-qa": "checkbox-label" }), [
|
|
118
112
|
d(e.$slots, "default", {}, () => [
|
|
119
113
|
c(h(e.label), 1)
|
|
120
114
|
])
|
|
121
|
-
], 16)) :
|
|
115
|
+
], 16)) : r("", !0)
|
|
122
116
|
], 2),
|
|
123
|
-
s.
|
|
124
|
-
|
|
117
|
+
e.$slots.description || e.description || s.hasMessages ? (i(), l("div", P, [
|
|
118
|
+
e.$slots.description || e.description ? (i(), l("div", o({
|
|
125
119
|
key: 0,
|
|
126
120
|
class: ["d-description", e.descriptionClass]
|
|
127
121
|
}, e.descriptionChildProps, { "data-qa": "checkbox-description" }), [
|
|
128
122
|
d(e.$slots, "description", {}, () => [
|
|
129
123
|
c(h(e.description), 1)
|
|
130
124
|
])
|
|
131
|
-
], 16)) :
|
|
132
|
-
|
|
125
|
+
], 16)) : r("", !0),
|
|
126
|
+
$(u, o({
|
|
133
127
|
"validation-messages": e.formattedMessages,
|
|
134
128
|
"show-messages": e.showMessages,
|
|
135
129
|
class: e.messagesClass
|
|
136
130
|
}, e.messagesChildProps, { "data-qa": "dt-checkbox-validation-messages" }), null, 16, ["validation-messages", "show-messages", "class"])
|
|
137
|
-
])) :
|
|
131
|
+
])) : r("", !0)
|
|
138
132
|
], 16);
|
|
139
133
|
}
|
|
140
|
-
const
|
|
134
|
+
const H = /* @__PURE__ */ A(I, [["render", w]]);
|
|
141
135
|
export {
|
|
142
|
-
|
|
136
|
+
H as default
|
|
143
137
|
};
|
|
144
138
|
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sources":["../../../components/checkbox/checkbox.vue"],"sourcesContent":["<template>\n <div\n v-bind=\"addClassStyleAttrs($attrs)\"\n >\n <label :class=\"['d-checkbox-group', { 'd-checkbox-group--disabled': internalDisabled }]\">\n <div class=\"d-checkbox__input\">\n <input\n type=\"checkbox\"\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n :class=\"['d-checkbox', inputValidationClass, inputClass]\"\n v-bind=\"removeClassStyleAttrs($attrs)\"\n :indeterminate.prop=\"internalIndeterminate\"\n v-on=\"inputListeners\"\n >\n </div>\n <div\n v-if=\"hasLabel\"\n :class=\"[labelClass, 'd-checkbox__copy d-checkbox__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"checkbox-label\"\n >\n <!-- @slot slot for Checkbox Label -->\n <slot>{{ label }}</slot>\n </div>\n </label>\n <div\n v-if=\"
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../../../components/checkbox/checkbox.vue"],"sourcesContent":["<template>\n <div\n v-bind=\"addClassStyleAttrs($attrs)\"\n >\n <label :class=\"['d-checkbox-group', { 'd-checkbox-group--disabled': internalDisabled }]\">\n <div class=\"d-checkbox__input\">\n <input\n type=\"checkbox\"\n :checked=\"internalChecked\"\n :name=\"internalName\"\n :value=\"value\"\n :disabled=\"internalDisabled\"\n :class=\"['d-checkbox', inputValidationClass, inputClass]\"\n v-bind=\"removeClassStyleAttrs($attrs)\"\n :indeterminate.prop=\"internalIndeterminate\"\n v-on=\"inputListeners\"\n >\n </div>\n <div\n v-if=\"hasLabel\"\n :class=\"[labelClass, 'd-checkbox__copy d-checkbox__label']\"\n v-bind=\"labelChildProps\"\n data-qa=\"checkbox-label\"\n >\n <!-- @slot slot for Checkbox Label -->\n <slot>{{ label }}</slot>\n </div>\n </label>\n <div\n v-if=\"$slots.description || description || hasMessages\"\n class=\"d-checkbox__messages\"\n data-qa=\"checkbox-description-messages\"\n >\n <div\n v-if=\"$slots.description || description\"\n :class=\"['d-description', descriptionClass]\"\n v-bind=\"descriptionChildProps\"\n data-qa=\"checkbox-description\"\n >\n <!-- @slot slot for Checkbox Description -->\n <slot name=\"description\">\n {{ description }}\n </slot>\n </div>\n <dt-validation-messages\n :validation-messages=\"formattedMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n v-bind=\"messagesChildProps\"\n data-qa=\"dt-checkbox-validation-messages\"\n />\n </div>\n </div>\n</template>\n\n<script>\n// Imports\nimport {\n InputMixin,\n CheckableMixin,\n GroupableMixin,\n MessagesMixin,\n} from '@/common/mixins/input';\nimport { removeClassStyleAttrs, addClassStyleAttrs } from '@/common/utils';\nimport { CHECKBOX_INPUT_VALIDATION_CLASSES } from './checkbox_constants';\nimport { DtValidationMessages } from '../validation_messages';\n\n/**\n * Checkboxes are control elements that allow the user to make a selection.They are typically used in a\n * Checkbox Group which allows the user to make one or more selections from a list of options.\n * @see https://dialtone.dialpad.com/components/checkbox.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtCheckbox',\n\n components: { DtValidationMessages },\n\n mixins: [InputMixin, CheckableMixin, GroupableMixin, MessagesMixin],\n\n inheritAttrs: false,\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {Boolean}\n */\n 'input',\n\n /**\n * Native input focusin event\n *\n * @event focusin\n * @type {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native input focusout event\n *\n * @event focusout\n * @type {FocusEvent}\n */\n 'focusout',\n ],\n\n computed: {\n inputValidationClass () {\n return CHECKBOX_INPUT_VALIDATION_CLASSES[this.internalValidationState];\n },\n\n checkboxGroupValueChecked () {\n return this.groupContext?.selectedValues?.includes(this.value) ?? false;\n },\n\n hasLabel () {\n return !!(this.$slots.default || this.label);\n },\n\n hasMessages () {\n return this.formattedMessages.length && this.showMessages;\n },\n\n inputListeners () {\n return {\n /*\n * Override input listener to as no-op. Prevents parent input listeners from being passed through\n * onto the input element which will result in the handler being called twice\n * (once on the input element and once by the emitted input event by the change listener).\n */\n input: () => {},\n focusin: event => this.$emit('focusin', event),\n focusout: event => this.$emit('focusout', event),\n change: event => this.emitValue(event.target),\n };\n },\n },\n\n watch: {\n checkboxGroupValueChecked: {\n immediate: true,\n handler (newCheckboxGroupValueChecked) {\n if (this.hasGroup) {\n // update internal value when the checkbox group value changes\n this.internalChecked = newCheckboxGroupValueChecked;\n }\n },\n },\n },\n\n mounted () {\n this.runValidations();\n },\n\n methods: {\n removeClassStyleAttrs,\n addClassStyleAttrs,\n\n emitValue (target) {\n let { value, checked } = target;\n // Expected: Indeterminate -> unchecked. We need to manually set DOM property `checked` to false\n // and update this.internalIndeterminate.\n if (this.internalIndeterminate) {\n checked = false;\n this.internalIndeterminate = false;\n target.checked = false;\n }\n // update provided value if injected\n this.setGroupValue(value, checked);\n\n // emit the state of the checkbox\n this.$emit('input', checked);\n },\n\n runValidations () {\n this.validateInputLabels(this.hasLabel, this.$attrs['aria-label']);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtValidationMessages","InputMixin","CheckableMixin","GroupableMixin","MessagesMixin","CHECKBOX_INPUT_VALIDATION_CLASSES","_b","_a","event","newCheckboxGroupValueChecked","removeClassStyleAttrs","addClassStyleAttrs","target","value","checked","_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","$options","_ctx","_createElementVNode","_normalizeClass","_mergeProps","_toHandlers","_renderSlot","_createTextVNode","_toDisplayString","_createCommentVNode","_hoisted_3","_createVNode","_component_dt_validation_messages"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../common/mixins/input.cjs"),l=require("./radio-constants.cjs"),i=require("../../common/utils/index.cjs"),s=require("vue"),n=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),d=require("../validation-messages/validation-messages.cjs"),u={compatConfig:{MODE:3},name:"DtRadio",components:{DtValidationMessages:d.default},mixins:[t.InputMixin,t.CheckableMixin,t.GroupableMixin,t.MessagesMixin],inheritAttrs:!1,props:{value:{type:[String,Number],default:""}},emits:["input","focus","focusin","focusout","click"],data(){return{hasSlotContent:i.hasSlotContent}},computed:{inputValidationClass(){return l.RADIO_INPUT_VALIDATION_CLASSES[this.internalValidationState]},radioGroupValue(){var e;return(e=this.groupContext)==null?void 0:e.selectedValue},inputListeners(){return{input:()=>{},focusin:e=>this.$emit("focusin",e),focusout:e=>this.$emit("focusout",e),change:e=>this.emitValue(e.target.value)}},hasMessages(){return this.formattedMessages.length&&this.showMessages}},watch:{radioGroupValue:{immediate:!0,handler(e){this.hasGroup&&(this.internalChecked=e===this.value)}}},methods:{removeClassStyleAttrs:i.removeClassStyleAttrs,addClassStyleAttrs:i.addClassStyleAttrs,emitValue(e){e!==this.radioGroupValue&&(this.setGroupValue(e),this.$emit("input",e))}}},c={class:"d-radio__input"},m=["checked","name","value","disabled"],p={key:0,class:"d-radio__messages","data-qa":"radio-description-messages"};function h(e,C,o,v,V,a){const r=s.resolveComponent("dt-validation-messages");return s.openBlock(),s.createElementBlock("div",s.normalizeProps(s.guardReactiveProps(a.addClassStyleAttrs(e.$attrs))),[s.createElementVNode("label",{class:s.normalizeClass(["d-radio-group",{"d-radio-group--disabled":e.internalDisabled}])},[s.createElementVNode("div",c,[s.createElementVNode("input",s.mergeProps({checked:e.internalChecked,name:e.internalName,value:o.value,disabled:e.internalDisabled,type:"radio",class:["d-radio",a.inputValidationClass,e.inputClass]},a.removeClassStyleAttrs(e.$attrs),s.toHandlers(a.inputListeners,!0)),null,16,m)]),s.createElementVNode("div",s.mergeProps({class:[e.labelClass,"d-radio__copy d-radio__label"]},e.labelChildProps,{"data-qa":"radio-label"}),[s.renderSlot(e.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(e.label),1)])],16)],2),e.$slots.description||e.description||a.hasMessages?(s.openBlock(),s.createElementBlock("div",p,[e.$slots.description||e.description?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,class:["d-description",e.descriptionClass]},e.descriptionChildProps,{"data-qa":"radio-description"}),[s.renderSlot(e.$slots,"description",{},()=>[s.createTextVNode(s.toDisplayString(e.description),1)])],16)):s.createCommentVNode("",!0),s.createVNode(r,s.mergeProps({"validation-messages":e.formattedMessages,"show-messages":e.showMessages,class:e.messagesClass},e.messagesChildProps,{"data-qa":"dt-radio-validation-messages"}),null,16,["validation-messages","show-messages","class"])])):s.createCommentVNode("",!0)],16)}const g=n._(u,[["render",h]]);exports.default=g;
|
|
2
2
|
//# sourceMappingURL=radio.cjs.map
|