@dialpad/dialtone-vue 2.124.0 → 2.125.1-alpha.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/chunks/_plugin-vue2_normalizer-u6G_3nkj.js +33 -0
- package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js.map +1 -0
- package/dist/chunks/dropdown-SMWaTWyF.js +357 -0
- package/dist/chunks/dropdown-SMWaTWyF.js.map +1 -0
- package/dist/chunks/dropdown_constants-EUcDxBrX.js +9 -0
- package/dist/chunks/dropdown_constants-EUcDxBrX.js.map +1 -0
- package/dist/chunks/icon_constants-OpYAAKwF.js +16 -0
- package/dist/chunks/icon_constants-OpYAAKwF.js.map +1 -0
- package/dist/chunks/index-nIyl_PL6.js +372 -0
- package/dist/chunks/index-nIyl_PL6.js.map +1 -0
- package/dist/chunks/index-o4OMWMuv.js +244 -0
- package/dist/chunks/index-o4OMWMuv.js.map +1 -0
- package/dist/chunks/input-1tm09l_-.js +273 -0
- package/dist/chunks/input-1tm09l_-.js.map +1 -0
- package/dist/chunks/input_group-zcAq3DQl.js +141 -0
- package/dist/chunks/input_group-zcAq3DQl.js.map +1 -0
- package/dist/chunks/keyboard_list_navigation-F0O8nht0.js +197 -0
- package/dist/chunks/keyboard_list_navigation-F0O8nht0.js.map +1 -0
- package/dist/chunks/link_constants-vIUB92L4.js +16 -0
- package/dist/chunks/link_constants-vIUB92L4.js.map +1 -0
- package/dist/chunks/list_item_constants-LTUc74pD.js +13 -0
- package/dist/chunks/list_item_constants-LTUc74pD.js.map +1 -0
- package/dist/chunks/modal-VuMFkZFH.js +82 -0
- package/dist/chunks/modal-VuMFkZFH.js.map +1 -0
- package/dist/chunks/notice_action-9NmtQRai.js +182 -0
- package/dist/chunks/notice_action-9NmtQRai.js.map +1 -0
- package/dist/chunks/notice_constants-c--hBFQw.js +6 -0
- package/dist/chunks/notice_constants-c--hBFQw.js.map +1 -0
- package/dist/chunks/popover_constants-qjlEkroB.js +114 -0
- package/dist/chunks/popover_constants-qjlEkroB.js.map +1 -0
- package/dist/chunks/sr_only_close_button-JGole5Xi.js +86 -0
- package/dist/chunks/sr_only_close_button-JGole5Xi.js.map +1 -0
- package/dist/chunks/stack_constants-u7tNqGtc.js +13 -0
- package/dist/chunks/stack_constants-u7tNqGtc.js.map +1 -0
- package/dist/chunks/tab-Qm9LVkYj.js +346 -0
- package/dist/chunks/tab-Qm9LVkYj.js.map +1 -0
- package/dist/component-documentation.json +1 -1
- package/dist/dialtone-vue.js +356 -10364
- package/dist/dialtone-vue.js.map +1 -0
- package/dist/lib/attachment-carousel.js +250 -0
- package/dist/lib/attachment-carousel.js.map +1 -0
- package/dist/lib/avatar.js +369 -0
- package/dist/lib/avatar.js.map +1 -0
- package/dist/lib/badge.js +169 -0
- package/dist/lib/badge.js.map +1 -0
- package/dist/lib/banner.js +200 -0
- package/dist/lib/banner.js.map +1 -0
- package/dist/lib/breadcrumbs.js +138 -0
- package/dist/lib/breadcrumbs.js.map +1 -0
- package/dist/lib/button-group.js +45 -0
- package/dist/lib/button-group.js.map +1 -0
- package/dist/lib/button.js +328 -0
- package/dist/lib/button.js.map +1 -0
- package/dist/lib/callbar-button-with-popover.js +235 -0
- package/dist/lib/callbar-button-with-popover.js.map +1 -0
- package/dist/lib/callbar-button.js +175 -0
- package/dist/lib/callbar-button.js.map +1 -0
- package/dist/lib/callbox.js +142 -0
- package/dist/lib/callbox.js.map +1 -0
- package/dist/lib/card.js +72 -0
- package/dist/lib/card.js.map +1 -0
- package/dist/lib/checkbox-group.js +117 -0
- package/dist/lib/checkbox-group.js.map +1 -0
- package/dist/lib/checkbox.js +117 -0
- package/dist/lib/checkbox.js.map +1 -0
- package/dist/lib/chip.js +186 -0
- package/dist/lib/chip.js.map +1 -0
- package/dist/lib/codeblock.js +29 -0
- package/dist/lib/codeblock.js.map +1 -0
- package/dist/lib/collapsible.js +313 -0
- package/dist/lib/collapsible.js.map +1 -0
- package/dist/lib/combobox-multi-select.js +433 -0
- package/dist/lib/combobox-multi-select.js.map +1 -0
- package/dist/lib/combobox-with-popover.js +341 -0
- package/dist/lib/combobox-with-popover.js.map +1 -0
- package/dist/lib/combobox.js +19 -0
- package/dist/lib/combobox.js.map +1 -0
- package/dist/lib/constants.js +53 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/contact-info.js +145 -0
- package/dist/lib/contact-info.js.map +1 -0
- package/dist/lib/contact-row.js +203 -0
- package/dist/lib/contact-row.js.map +1 -0
- package/dist/lib/datepicker.js +552 -0
- package/dist/lib/datepicker.js.map +1 -0
- package/dist/lib/dates.js +57 -0
- package/dist/lib/dates.js.map +1 -0
- package/dist/lib/description-list.js +83 -0
- package/dist/lib/description-list.js.map +1 -0
- package/dist/lib/dropdown.js +45 -0
- package/dist/lib/dropdown.js.map +1 -0
- package/dist/lib/editor.js +527 -0
- package/dist/lib/editor.js.map +1 -0
- package/dist/{emoji_picker-kiTOKaq8.js → lib/emoji-picker.js} +30 -11
- package/dist/lib/emoji-picker.js.map +1 -0
- package/dist/lib/emoji-row.js +83 -0
- package/dist/lib/emoji-row.js.map +1 -0
- package/dist/{emoji_text_wrapper-48ClwKvf.js → lib/emoji-text-wrapper.js} +19 -13
- package/dist/lib/emoji-text-wrapper.js.map +1 -0
- package/dist/lib/emoji.js +11 -0
- package/dist/lib/emoji.js.map +1 -0
- package/dist/lib/feed-item-row.js +207 -0
- package/dist/lib/feed-item-row.js.map +1 -0
- package/dist/lib/feed-pill.js +142 -0
- package/dist/lib/feed-pill.js.map +1 -0
- package/dist/lib/general-row.js +379 -0
- package/dist/lib/general-row.js.map +1 -0
- package/dist/lib/group-row.js +115 -0
- package/dist/lib/group-row.js.map +1 -0
- package/dist/lib/grouped-chip.js +45 -0
- package/dist/lib/grouped-chip.js.map +1 -0
- package/dist/lib/hovercard.js +194 -0
- package/dist/lib/hovercard.js.map +1 -0
- package/dist/lib/icon.js +82 -0
- package/dist/lib/icon.js.map +1 -0
- package/dist/lib/image-viewer.js +171 -0
- package/dist/lib/image-viewer.js.map +1 -0
- package/dist/lib/input-group.js +90 -0
- package/dist/lib/input-group.js.map +1 -0
- package/dist/lib/input.js +455 -0
- package/dist/lib/input.js.map +1 -0
- package/dist/lib/item-layout.js +39 -0
- package/dist/lib/item-layout.js.map +1 -0
- package/dist/lib/ivr-node.js +195 -0
- package/dist/lib/ivr-node.js.map +1 -0
- package/dist/lib/keyboard-shortcut.js +100 -0
- package/dist/lib/keyboard-shortcut.js.map +1 -0
- package/dist/lib/lazy-show.js +77 -0
- package/dist/lib/lazy-show.js.map +1 -0
- package/dist/lib/link.js +69 -0
- package/dist/lib/link.js.map +1 -0
- package/dist/lib/list-item-group.js +59 -0
- package/dist/lib/list-item-group.js.map +1 -0
- package/dist/lib/list-item.js +195 -0
- package/dist/lib/list-item.js.map +1 -0
- package/dist/{message_input.js → lib/message-input.js} +107 -55
- package/dist/lib/message-input.js.map +1 -0
- package/dist/lib/mixins.js +17 -0
- package/dist/lib/mixins.js.map +1 -0
- package/dist/lib/modal.js +324 -0
- package/dist/lib/modal.js.map +1 -0
- package/dist/lib/notice.js +158 -0
- package/dist/lib/notice.js.map +1 -0
- package/dist/lib/pagination.js +142 -0
- package/dist/lib/pagination.js.map +1 -0
- package/dist/lib/popover.js +779 -0
- package/dist/lib/popover.js.map +1 -0
- package/dist/lib/presence.js +60 -0
- package/dist/lib/presence.js.map +1 -0
- package/dist/lib/radio-group.js +97 -0
- package/dist/lib/radio-group.js.map +1 -0
- package/dist/lib/radio.js +111 -0
- package/dist/lib/radio.js.map +1 -0
- package/dist/lib/rich-text-editor.js +920 -0
- package/dist/lib/rich-text-editor.js.map +1 -0
- package/dist/lib/root-layout.js +127 -0
- package/dist/lib/root-layout.js.map +1 -0
- package/dist/lib/select-menu.js +243 -0
- package/dist/lib/select-menu.js.map +1 -0
- package/dist/lib/settings-menu-button.js +65 -0
- package/dist/lib/settings-menu-button.js.map +1 -0
- package/dist/lib/skeleton.js +574 -0
- package/dist/lib/skeleton.js.map +1 -0
- package/dist/lib/stack.js +118 -0
- package/dist/lib/stack.js.map +1 -0
- package/dist/lib/tabs.js +93 -0
- package/dist/lib/tabs.js.map +1 -0
- package/dist/lib/time-pill.js +43 -0
- package/dist/lib/time-pill.js.map +1 -0
- package/dist/lib/toast.js +226 -0
- package/dist/lib/toast.js.map +1 -0
- package/dist/lib/toggle.js +169 -0
- package/dist/lib/toggle.js.map +1 -0
- package/dist/{directives.js → lib/tooltip-directive.js} +24 -17
- package/dist/lib/tooltip-directive.js.map +1 -0
- package/dist/lib/tooltip.js +376 -0
- package/dist/lib/tooltip.js.map +1 -0
- package/dist/lib/top-banner-info.js +60 -0
- package/dist/lib/top-banner-info.js.map +1 -0
- package/dist/lib/unread-pill.js +61 -0
- package/dist/lib/unread-pill.js.map +1 -0
- package/dist/lib/utils.js +175 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/validation-messages.js +83 -0
- package/dist/lib/validation-messages.js.map +1 -0
- package/dist/lib/validators.js +12 -0
- package/dist/lib/validators.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/types/common/{constants.d.ts → constants/index.d.ts} +1 -1
- package/dist/types/common/constants/index.d.ts.map +1 -0
- package/dist/types/common/{dates.d.ts → dates/index.d.ts} +1 -1
- package/dist/types/common/dates/index.d.ts.map +1 -0
- package/dist/types/common/{emoji.d.ts → emoji/index.d.ts} +1 -1
- package/dist/types/common/{emoji.d.ts.map → emoji/index.d.ts.map} +1 -1
- package/dist/types/common/{utils.d.ts → utils/index.d.ts} +1 -1
- package/dist/types/common/utils/index.d.ts.map +1 -0
- package/dist/types/common/{validators.d.ts → validators/index.d.ts} +1 -1
- package/dist/types/common/validators/index.d.ts.map +1 -0
- package/dist/types/components/avatar/avatar.vue.d.ts +1 -1
- package/dist/types/components/button/button.vue.d.ts +2 -2
- package/dist/types/components/card/card.vue.d.ts +1 -1
- package/dist/types/components/checkbox/checkbox.vue.d.ts +7 -7
- package/dist/types/components/checkbox/checkbox.vue.d.ts.map +1 -1
- package/dist/types/components/chip/chip.vue.d.ts +2 -2
- package/dist/types/components/collapsible/collapsible.vue.d.ts +3 -3
- package/dist/types/components/combobox/combobox.vue.d.ts +7 -8
- package/dist/types/components/combobox/combobox.vue.d.ts.map +1 -1
- package/dist/types/components/dropdown/dropdown.vue.d.ts +1 -1
- package/dist/types/components/emoji/emoji.vue.d.ts +1 -1
- package/dist/types/components/emoji_picker/modules/emoji_selector.vue.d.ts +1 -219
- package/dist/types/components/icon/icon.vue.d.ts +20 -16
- package/dist/types/components/icon/icon.vue.d.ts.map +1 -1
- package/dist/types/components/icon/icon_constants.d.ts +2 -0
- package/dist/types/components/icon/icon_constants.d.ts.map +1 -1
- package/dist/types/components/icon/index.d.ts +1 -1
- package/dist/types/components/input_group/input_group.vue.d.ts +15 -6
- package/dist/types/components/input_group/input_group.vue.d.ts.map +1 -1
- package/dist/types/components/list_item_group/list_item_group.vue.d.ts +1 -1
- package/dist/types/components/modal/modal.vue.d.ts +7 -2
- package/dist/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/types/components/notice/notice_action.vue.d.ts +3 -1
- package/dist/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/types/components/popover/popover_header_footer.vue.d.ts +1 -1
- package/dist/types/components/radio/radio.vue.d.ts +2 -12
- package/dist/types/components/radio/radio.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.d.ts +1 -1
- package/dist/types/components/skeleton/skeleton-list-item.vue.d.ts +1 -1
- package/dist/types/components/skeleton/skeleton-paragraph.vue.d.ts +3 -3
- package/dist/types/components/skeleton/skeleton-shape.vue.d.ts +2 -2
- package/dist/types/components/skeleton/skeleton-text.vue.d.ts +8 -3
- package/dist/types/components/skeleton/skeleton-text.vue.d.ts.map +1 -1
- package/dist/types/components/skeleton/skeleton.vue.d.ts +1 -1
- package/dist/types/components/toggle/toggle.vue.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.vue.d.ts +2 -2
- package/dist/types/index.d.ts +36 -29
- package/dist/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +1 -1
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +2 -2
- package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +1 -1
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +2 -2
- package/dist/types/recipes/conversation_view/editor/editor.vue.d.ts +9 -0
- package/dist/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/package.json +19 -59
- package/CHANGELOG.json +0 -1
- package/CHANGELOG.md +0 -2890
- package/dist/dialtone-vue.cjs +0 -5
- package/dist/directives.cjs +0 -1
- package/dist/emoji.cjs +0 -1
- package/dist/emoji.js +0 -35
- package/dist/emoji_picker-njWWAm6V.cjs +0 -1
- package/dist/emoji_text_wrapper-ZlynvHnd.cjs +0 -1
- package/dist/index-OF94C6nQ.js +0 -142833
- package/dist/index-Wx7Jagcr.cjs +0 -1
- package/dist/message_input.cjs +0 -1
- package/dist/rich_text_editor-9sMob7ck.js +0 -16478
- package/dist/rich_text_editor-Eh5kYokw.cjs +0 -97
- package/dist/tooltip-88U5vFMA.js +0 -2516
- package/dist/tooltip-i2wxFIIi.cjs +0 -21
- package/dist/types/common/constants.d.ts.map +0 -1
- package/dist/types/common/dates.d.ts.map +0 -1
- package/dist/types/common/utils.d.ts.map +0 -1
- package/dist/types/common/validators.d.ts.map +0 -1
- package/dist/types/components/emoji_picker/emojis/index.d.ts +0 -50
- package/dist/types/components/emoji_picker/emojis/index.d.ts.map +0 -1
- package/dist/types/directives.d.ts +0 -2
- package/dist/types/directives.d.ts.map +0 -1
- package/dist/types/emoji.d.ts +0 -5
- package/dist/types/emoji.d.ts.map +0 -1
- package/dist/types/message_input.d.ts +0 -3
- package/dist/types/message_input.d.ts.map +0 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { I as a, C as i, G as n, M as r } from "../chunks/input-1tm09l_-.js";
|
|
2
|
+
import { n as l } from "../chunks/_plugin-vue2_normalizer-u6G_3nkj.js";
|
|
3
|
+
import { DtValidationMessages as o } from "./validation-messages.js";
|
|
4
|
+
import "vue";
|
|
5
|
+
import "./constants.js";
|
|
6
|
+
import "./validators.js";
|
|
7
|
+
import "./utils.js";
|
|
8
|
+
const c = {
|
|
9
|
+
error: "d-checkbox--error",
|
|
10
|
+
warning: "d-checkbox--warning",
|
|
11
|
+
success: "d-checkbox--success"
|
|
12
|
+
}, d = {
|
|
13
|
+
name: "DtCheckbox",
|
|
14
|
+
components: { DtValidationMessages: o },
|
|
15
|
+
mixins: [a, i, n, r],
|
|
16
|
+
inheritAttrs: !1,
|
|
17
|
+
emits: [
|
|
18
|
+
/**
|
|
19
|
+
* Native input event
|
|
20
|
+
*
|
|
21
|
+
* @event input
|
|
22
|
+
* @type {Boolean}
|
|
23
|
+
*/
|
|
24
|
+
"input",
|
|
25
|
+
/**
|
|
26
|
+
* Native input focusin event
|
|
27
|
+
*
|
|
28
|
+
* @event focusin
|
|
29
|
+
* @type {FocusEvent}
|
|
30
|
+
*/
|
|
31
|
+
"focusin",
|
|
32
|
+
/**
|
|
33
|
+
* Native input focusout event
|
|
34
|
+
*
|
|
35
|
+
* @event focusout
|
|
36
|
+
* @type {FocusEvent}
|
|
37
|
+
*/
|
|
38
|
+
"focusout"
|
|
39
|
+
],
|
|
40
|
+
computed: {
|
|
41
|
+
inputValidationClass() {
|
|
42
|
+
return c[this.internalValidationState];
|
|
43
|
+
},
|
|
44
|
+
checkboxGroupValueChecked() {
|
|
45
|
+
var t, e;
|
|
46
|
+
return ((e = (t = this.groupContext) == null ? void 0 : t.selectedValues) == null ? void 0 : e.includes(this.value)) ?? !1;
|
|
47
|
+
},
|
|
48
|
+
hasLabel() {
|
|
49
|
+
return !!(this.$slots.default || this.label);
|
|
50
|
+
},
|
|
51
|
+
hasDescription() {
|
|
52
|
+
return !!(this.$slots.description || this.description);
|
|
53
|
+
},
|
|
54
|
+
hasLabelOrDescription() {
|
|
55
|
+
return this.hasLabel || this.hasDescription;
|
|
56
|
+
},
|
|
57
|
+
inputListeners() {
|
|
58
|
+
return {
|
|
59
|
+
/* TODO
|
|
60
|
+
Check if any usages of this component leverage $listeners and either remove if unused or scope the removal
|
|
61
|
+
and migration prior to upgrading to Vue 3.x
|
|
62
|
+
*/
|
|
63
|
+
...this.$listeners,
|
|
64
|
+
/*
|
|
65
|
+
* Override input listener to as no-op. Prevents parent input listeners from being passed through
|
|
66
|
+
* onto the input element which will result in the handler being called twice
|
|
67
|
+
* (once on the input element and once by the emitted input event by the change listener).
|
|
68
|
+
*/
|
|
69
|
+
input: () => {
|
|
70
|
+
},
|
|
71
|
+
change: (t) => this.emitValue(t.target)
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
watch: {
|
|
76
|
+
checkboxGroupValueChecked: {
|
|
77
|
+
immediate: !0,
|
|
78
|
+
handler(t) {
|
|
79
|
+
this.hasGroup && (this.internalChecked = t);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
mounted() {
|
|
84
|
+
this.runValidations();
|
|
85
|
+
},
|
|
86
|
+
methods: {
|
|
87
|
+
emitValue(t) {
|
|
88
|
+
let { value: e, checked: s } = t;
|
|
89
|
+
this.internalIndeterminate && (s = !1, this.internalIndeterminate = !1, t.checked = !1), this.setGroupValue(e, s), this.$emit("input", s);
|
|
90
|
+
},
|
|
91
|
+
runValidations() {
|
|
92
|
+
this.validateInputLabels(this.hasLabel, this.$attrs["aria-label"]);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
var h = function() {
|
|
97
|
+
var e = this, s = e._self._c;
|
|
98
|
+
return s("div", [s("label", [s("div", { 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.hasLabelOrDescription ? s("div", { staticClass: "d-checkbox__copy d-checkbox__label", attrs: { "data-qa": "checkbox-label-description-container" } }, [e.hasLabel ? s("div", e._b({ class: e.labelClass, attrs: { "data-qa": "checkbox-label" } }, "div", e.labelChildProps, !1), [e._t("default", function() {
|
|
99
|
+
return [e._v(e._s(e.label))];
|
|
100
|
+
})], 2) : e._e(), e.hasDescription ? s("div", e._b({ class: ["d-description", e.descriptionClass], attrs: { "data-qa": "checkbox-description" } }, "div", e.descriptionChildProps, !1), [e._t("description", function() {
|
|
101
|
+
return [e._v(e._s(e.description))];
|
|
102
|
+
})], 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()])])]);
|
|
103
|
+
}, u = [], p = /* @__PURE__ */ l(
|
|
104
|
+
d,
|
|
105
|
+
h,
|
|
106
|
+
u,
|
|
107
|
+
!1,
|
|
108
|
+
null,
|
|
109
|
+
null,
|
|
110
|
+
null,
|
|
111
|
+
null
|
|
112
|
+
);
|
|
113
|
+
const C = p.exports;
|
|
114
|
+
export {
|
|
115
|
+
C as DtCheckbox
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../../components/checkbox/checkbox_constants.js","../../components/checkbox/checkbox.vue"],"sourcesContent":["export const CHECKBOX_INPUT_VALIDATION_CLASSES = {\n error: 'd-checkbox--error',\n warning: 'd-checkbox--warning',\n success: 'd-checkbox--success',\n};\n\nexport default {\n CHECKBOX_INPUT_VALIDATION_CLASSES,\n};\n","<template>\n <div>\n <label>\n <div :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=\"hasLabelOrDescription\"\n class=\"d-checkbox__copy d-checkbox__label\"\n data-qa=\"checkbox-label-description-container\"\n >\n <div\n v-if=\"hasLabel\"\n :class=\"labelClass\"\n v-bind=\"labelChildProps\"\n data-qa=\"checkbox-label\"\n >\n <!-- @slot slot for Checkbox Label -->\n <slot>{{ label }}</slot>\n </div>\n <div\n v-if=\"hasDescription\"\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\">{{ description }}</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 </label>\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 hasDescription () {\n return !!(this.$slots.description || this.description);\n },\n\n hasLabelOrDescription () {\n return this.hasLabel || this.hasDescription;\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":["CHECKBOX_INPUT_VALIDATION_CLASSES","_sfc_main","DtValidationMessages","InputMixin","CheckableMixin","GroupableMixin","MessagesMixin","_b","_a","event","newCheckboxGroupValueChecked","target","value","checked"],"mappings":";;;;;;;AAAO,MAAMA,IAAoC;AAAA,EAC/C,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AACX,GCiEAC,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,aAAAN,EAAA,KAAA,uBAAA;AAAA,IACA;AAAA,IAEA,4BAAA;;AACA,eAAAO,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,iBAAA;AACA,aAAA,CAAA,EAAA,KAAA,OAAA,eAAA,KAAA;AAAA,IACA;AAAA,IAEA,wBAAA;AACA,aAAA,KAAA,YAAA,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;;;;;;;;;;;;;;;;;;;"}
|
package/dist/lib/chip.js
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { getUniqueString as i } from "./utils.js";
|
|
2
|
+
import { n as o } from "../chunks/_plugin-vue2_normalizer-u6G_3nkj.js";
|
|
3
|
+
import { DtButton as n } from "./button.js";
|
|
4
|
+
import { DtIcon as l } from "./icon.js";
|
|
5
|
+
import "./constants.js";
|
|
6
|
+
import "vue";
|
|
7
|
+
import "../chunks/link_constants-vIUB92L4.js";
|
|
8
|
+
import "@dialpad/dialtone-icons/vue2";
|
|
9
|
+
import "../chunks/icon_constants-OpYAAKwF.js";
|
|
10
|
+
import "@dialpad/dialtone-icons/icons.json";
|
|
11
|
+
import "./skeleton.js";
|
|
12
|
+
const a = {
|
|
13
|
+
xs: "d-chip__label--xs",
|
|
14
|
+
sm: "d-chip__label--sm",
|
|
15
|
+
md: ""
|
|
16
|
+
}, r = {
|
|
17
|
+
xs: "d-chip__close--xs",
|
|
18
|
+
sm: "d-chip__close--sm",
|
|
19
|
+
md: ""
|
|
20
|
+
}, c = {
|
|
21
|
+
xs: "200",
|
|
22
|
+
sm: "200",
|
|
23
|
+
md: "200"
|
|
24
|
+
}, p = {
|
|
25
|
+
name: "DtChip",
|
|
26
|
+
components: {
|
|
27
|
+
DtButton: n,
|
|
28
|
+
DtIcon: l
|
|
29
|
+
},
|
|
30
|
+
props: {
|
|
31
|
+
/**
|
|
32
|
+
* A set of props to be passed into the modal's close button. Requires an 'ariaLabel' property.
|
|
33
|
+
*/
|
|
34
|
+
closeButtonProps: {
|
|
35
|
+
type: Object,
|
|
36
|
+
default: function() {
|
|
37
|
+
return { ariaLabel: "close" };
|
|
38
|
+
},
|
|
39
|
+
validator: (e) => !!e.ariaLabel
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* Hides the close button on the chip
|
|
43
|
+
* @values true, false
|
|
44
|
+
*/
|
|
45
|
+
hideClose: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !1
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* The size of the chip.
|
|
51
|
+
* @values xs, sm, md
|
|
52
|
+
*/
|
|
53
|
+
size: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "md",
|
|
56
|
+
validator: (e) => Object.keys(a).includes(e)
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* The interactivity of the chip.
|
|
60
|
+
* Makes chip clickable, apply hover/focus/active style, emit keyboard events etc.
|
|
61
|
+
* @values true, false
|
|
62
|
+
*/
|
|
63
|
+
interactive: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: !0
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* Id to use for the dialog's aria-labelledby.
|
|
69
|
+
*/
|
|
70
|
+
id: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: function() {
|
|
73
|
+
return i();
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* Descriptive label for the chip content.
|
|
78
|
+
* If this prop is unset the content in the default slot will be used as an aria-label.
|
|
79
|
+
*/
|
|
80
|
+
ariaLabel: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: ""
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* Additional class name for the chip element.
|
|
86
|
+
*/
|
|
87
|
+
contentClass: {
|
|
88
|
+
type: [String, Array, Object],
|
|
89
|
+
default: ""
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* Additional class name for the span element.
|
|
93
|
+
*/
|
|
94
|
+
labelClass: {
|
|
95
|
+
type: [String, Array, Object],
|
|
96
|
+
default: ""
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
emits: [
|
|
100
|
+
/**
|
|
101
|
+
* Native chip click event
|
|
102
|
+
*
|
|
103
|
+
* @event click
|
|
104
|
+
* @type {PointerEvent | KeyboardEvent}
|
|
105
|
+
*/
|
|
106
|
+
"click",
|
|
107
|
+
/**
|
|
108
|
+
* Close button click event
|
|
109
|
+
*
|
|
110
|
+
* @event close
|
|
111
|
+
*/
|
|
112
|
+
"close",
|
|
113
|
+
/**
|
|
114
|
+
* Native chip key up event
|
|
115
|
+
*
|
|
116
|
+
* @event keyup
|
|
117
|
+
* @type {KeyboardEvent}
|
|
118
|
+
*/
|
|
119
|
+
"keyup"
|
|
120
|
+
],
|
|
121
|
+
data() {
|
|
122
|
+
return {
|
|
123
|
+
isActive: !1
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
computed: {
|
|
127
|
+
chipListeners() {
|
|
128
|
+
return {
|
|
129
|
+
...this.$listeners,
|
|
130
|
+
click: (e) => {
|
|
131
|
+
this.interactive && this.$emit("click", e);
|
|
132
|
+
},
|
|
133
|
+
keyup: (e) => {
|
|
134
|
+
var t;
|
|
135
|
+
((t = e.code) == null ? void 0 : t.toLowerCase()) === "delete" ? this.onClose() : this.$emit("keyup", e);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
},
|
|
139
|
+
closeButtonIconSize() {
|
|
140
|
+
return c[this.size];
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
methods: {
|
|
144
|
+
chipClasses() {
|
|
145
|
+
return [
|
|
146
|
+
this.$attrs["grouped-chip"] ? "d-chip" : "d-chip__label",
|
|
147
|
+
a[this.size],
|
|
148
|
+
this.labelClass
|
|
149
|
+
];
|
|
150
|
+
},
|
|
151
|
+
chipCloseButtonClasses() {
|
|
152
|
+
return [
|
|
153
|
+
"d-chip__close",
|
|
154
|
+
r[this.size]
|
|
155
|
+
];
|
|
156
|
+
},
|
|
157
|
+
onClose() {
|
|
158
|
+
this.hideClose || this.$emit("close");
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
var d = function() {
|
|
163
|
+
var t = this, s = t._self._c;
|
|
164
|
+
return s("span", { staticClass: "d-chip" }, [s(t.interactive ? "button" : "span", t._g({ tag: "component", class: t.chipClasses(), attrs: { id: t.id, type: t.interactive && "button", "data-qa": "dt-chip", "aria-labelledby": t.ariaLabel ? void 0 : `${t.id}-content`, "aria-label": t.ariaLabel } }, t.chipListeners), [t.$slots.icon ? s("span", { staticClass: "d-chip__icon", attrs: { "data-qa": "dt-chip-icon" } }, [t._t("icon")], 2) : t.$slots.avatar ? s("span", { attrs: { "data-qa": "dt-chip-avatar" } }, [t._t("avatar")], 2) : t._e(), t.$slots.default ? s("span", { class: ["d-chip__text", t.contentClass], attrs: { id: `${t.id}-content`, "data-qa": "dt-chip-label" } }, [t._t("default")], 2) : t._e()]), t.hideClose ? t._e() : s("dt-button", t._b({ class: t.chipCloseButtonClasses(), attrs: { "data-qa": "dt-chip-close", "aria-label": t.closeButtonProps.ariaLabel }, on: { click: function(h) {
|
|
165
|
+
return t.$emit("close");
|
|
166
|
+
} }, scopedSlots: t._u([{ key: "icon", fn: function() {
|
|
167
|
+
return [s("dt-icon", { attrs: { name: "close", size: t.closeButtonIconSize } })];
|
|
168
|
+
}, proxy: !0 }], null, !1, 1192647893) }, "dt-button", t.closeButtonProps, !1))], 1);
|
|
169
|
+
}, u = [], _ = /* @__PURE__ */ o(
|
|
170
|
+
p,
|
|
171
|
+
d,
|
|
172
|
+
u,
|
|
173
|
+
!1,
|
|
174
|
+
null,
|
|
175
|
+
null,
|
|
176
|
+
null,
|
|
177
|
+
null
|
|
178
|
+
);
|
|
179
|
+
const L = _.exports;
|
|
180
|
+
export {
|
|
181
|
+
r as CHIP_CLOSE_BUTTON_SIZE_MODIFIERS,
|
|
182
|
+
c as CHIP_ICON_SIZES,
|
|
183
|
+
a as CHIP_SIZE_MODIFIERS,
|
|
184
|
+
L as DtChip
|
|
185
|
+
};
|
|
186
|
+
//# sourceMappingURL=chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip.js","sources":["../../components/chip/chip_constants.js","../../components/chip/chip.vue"],"sourcesContent":["export const CHIP_SIZE_MODIFIERS = {\n xs: 'd-chip__label--xs',\n sm: 'd-chip__label--sm',\n md: '',\n};\n\nexport const CHIP_CLOSE_BUTTON_SIZE_MODIFIERS = {\n xs: 'd-chip__close--xs',\n sm: 'd-chip__close--sm',\n md: '',\n};\n\nexport const CHIP_ICON_SIZES = {\n xs: '200',\n sm: '200',\n md: '200',\n};\n\nexport default {\n CHIP_SIZE_MODIFIERS,\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS,\n CHIP_ICON_SIZES,\n};\n","<template>\n <span class=\"d-chip\">\n <component\n :is=\"interactive ? 'button' : 'span'\"\n :id=\"id\"\n :type=\"interactive && 'button'\"\n :class=\"chipClasses()\"\n data-qa=\"dt-chip\"\n :aria-labelledby=\"ariaLabel ? undefined : `${id}-content`\"\n :aria-label=\"ariaLabel\"\n v-on=\"chipListeners\"\n >\n <span\n v-if=\"$slots.icon\"\n data-qa=\"dt-chip-icon\"\n class=\"d-chip__icon\"\n >\n <!-- @slot slot for Chip icon -->\n <slot name=\"icon\" />\n </span>\n <span\n v-else-if=\"$slots.avatar\"\n data-qa=\"dt-chip-avatar\"\n >\n <!-- @slot slot for Chip avatar -->\n <slot name=\"avatar\" />\n </span>\n <span\n v-if=\"$slots.default\"\n :id=\"`${id}-content`\"\n data-qa=\"dt-chip-label\"\n :class=\"['d-chip__text', contentClass]\"\n >\n <!-- @slot slot for Content within chip -->\n <slot />\n </span>\n </component>\n <dt-button\n v-if=\"!hideClose\"\n v-bind=\"closeButtonProps\"\n :class=\"chipCloseButtonClasses()\"\n data-qa=\"dt-chip-close\"\n :aria-label=\"closeButtonProps.ariaLabel\"\n @click=\"$emit('close')\"\n >\n <template #icon>\n <dt-icon\n name=\"close\"\n :size=\"closeButtonIconSize\"\n />\n </template>\n </dt-button>\n </span>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\nimport {\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS,\n CHIP_SIZE_MODIFIERS,\n CHIP_ICON_SIZES,\n} from './chip_constants';\nimport { getUniqueString } from '@/common/utils';\n\n/**\n * A chip is a compact UI element that provides brief, descriptive information about an element.\n * It is terse, ideally one word. It is important a button is identifiable, consistent, and\n * communicates its actions clearly, and is appropriately sized to its action.\n * @see https://dialtone.dialpad.com/components/chip.html\n */\nexport default {\n name: 'DtChip',\n\n components: {\n DtButton,\n DtIcon,\n },\n\n props: {\n /**\n * A set of props to be passed into the modal's close button. Requires an 'ariaLabel' property.\n */\n closeButtonProps: {\n type: Object,\n default: function () { return { ariaLabel: 'close' }; },\n validator: (props) => {\n return !!props.ariaLabel;\n },\n },\n\n /**\n * Hides the close button on the chip\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The size of the chip.\n * @values xs, sm, md\n */\n size: {\n type: String,\n default: 'md',\n validator: (s) => Object.keys(CHIP_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * The interactivity of the chip.\n * Makes chip clickable, apply hover/focus/active style, emit keyboard events etc.\n * @values true, false\n */\n interactive: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n id: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Descriptive label for the chip content.\n * If this prop is unset the content in the default slot will be used as an aria-label.\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the chip element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the span element.\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native chip click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Close button click event\n *\n * @event close\n */\n 'close',\n\n /**\n * Native chip key up event\n *\n * @event keyup\n * @type {KeyboardEvent}\n */\n 'keyup',\n ],\n\n data () {\n return {\n isActive: false,\n };\n },\n\n computed: {\n chipListeners () {\n return {\n ...this.$listeners,\n click: event => {\n if (this.interactive) this.$emit('click', event);\n },\n\n keyup: event => {\n if (event.code?.toLowerCase() === 'delete') {\n this.onClose();\n } else {\n this.$emit('keyup', event);\n }\n },\n };\n },\n\n closeButtonIconSize () {\n return CHIP_ICON_SIZES[this.size];\n },\n },\n\n methods: {\n chipClasses () {\n return [\n this.$attrs['grouped-chip'] ? 'd-chip' : 'd-chip__label',\n CHIP_SIZE_MODIFIERS[this.size],\n this.labelClass,\n ];\n },\n\n chipCloseButtonClasses () {\n return [\n 'd-chip__close',\n CHIP_CLOSE_BUTTON_SIZE_MODIFIERS[this.size],\n ];\n },\n\n onClose () {\n if (!this.hideClose) {\n this.$emit('close');\n }\n },\n },\n};\n</script>\n"],"names":["CHIP_SIZE_MODIFIERS","CHIP_CLOSE_BUTTON_SIZE_MODIFIERS","CHIP_ICON_SIZES","_sfc_main","DtButton","DtIcon","props","s","getUniqueString","event","_a"],"mappings":";;;;;;;;;;;AAAY,MAACA,IAAsB;AAAA,EACjC,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEaC,IAAmC;AAAA,EAC9C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEaC,IAAkB;AAAA,EAC7B,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GCuDAC,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,kBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,WAAA;AAAA,eAAA,EAAA,WAAA,QAAA;AAAA,MAAA;AAAA,MACA,WAAA,CAAAC,MACA,CAAA,CAAAA,EAAA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,OAAA,KAAAP,CAAA,EAAA,SAAAO,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,WAAA;AAAA,eAAAC,EAAA;AAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,cAAA;AAAA,MACA,MAAA,CAAA,QAAA,OAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AAAA,MACA,MAAA,CAAA,QAAA,OAAA,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,IAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,gBAAA;AACA,aAAA;AAAA,QACA,GAAA,KAAA;AAAA,QACA,OAAA,CAAAC,MAAA;AACA,UAAA,KAAA,eAAA,KAAA,MAAA,SAAAA,CAAA;AAAA,QACA;AAAA,QAEA,OAAA,CAAAA,MAAA;;AACA,YAAAC,IAAAD,EAAA,SAAA,gBAAAC,EAAA,mBAAA,WACA,KAAA,QAAA,IAEA,KAAA,MAAA,SAAAD,CAAA;AAAA,QAEA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,sBAAA;AACA,aAAAP,EAAA,KAAA,IAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,cAAA;AACA,aAAA;AAAA,QACA,KAAA,OAAA,cAAA,IAAA,WAAA;AAAA,QACAF,EAAA,KAAA,IAAA;AAAA,QACA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,yBAAA;AACA,aAAA;AAAA,QACA;AAAA,QACAC,EAAA,KAAA,IAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,UAAA;AACA,MAAA,KAAA,aACA,KAAA,MAAA,OAAA;AAAA,IAEA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { n as t } from "../chunks/_plugin-vue2_normalizer-u6G_3nkj.js";
|
|
2
|
+
const o = {
|
|
3
|
+
name: "DtCodeblock",
|
|
4
|
+
props: {
|
|
5
|
+
text: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: !0
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
var r = function() {
|
|
12
|
+
var e = this, n = e._self._c;
|
|
13
|
+
return n("pre", [e._v(" "), n("code", { staticClass: "d-codeblock" }, [e._v(e._s(e.text))]), e._v(`
|
|
14
|
+
`)]);
|
|
15
|
+
}, c = [], s = /* @__PURE__ */ t(
|
|
16
|
+
o,
|
|
17
|
+
r,
|
|
18
|
+
c,
|
|
19
|
+
!1,
|
|
20
|
+
null,
|
|
21
|
+
null,
|
|
22
|
+
null,
|
|
23
|
+
null
|
|
24
|
+
);
|
|
25
|
+
const a = s.exports;
|
|
26
|
+
export {
|
|
27
|
+
a as DtCodeblock
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=codeblock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeblock.js","sources":["../../components/codeblock/codeblock.vue"],"sourcesContent":["<template>\n <pre>\n <code\n class=\"d-codeblock\"\n >{{ text }}</code>\n </pre>\n</template>\n\n<script>\nexport default {\n name: 'DtCodeblock',\n\n props: {\n text: {\n type: String,\n required: true,\n },\n },\n};\n</script>\n"],"names":["_sfc_main"],"mappings":";AASA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { getUniqueString as a } from "./utils.js";
|
|
2
|
+
import { n as i } from "../chunks/_plugin-vue2_normalizer-u6G_3nkj.js";
|
|
3
|
+
import { DtButton as r } from "./button.js";
|
|
4
|
+
import { DtLazyShow as l } from "./lazy-show.js";
|
|
5
|
+
import { DtIcon as o } from "./icon.js";
|
|
6
|
+
import "./constants.js";
|
|
7
|
+
import "vue";
|
|
8
|
+
import "../chunks/link_constants-vIUB92L4.js";
|
|
9
|
+
import "@dialpad/dialtone-icons/vue2";
|
|
10
|
+
import "../chunks/icon_constants-OpYAAKwF.js";
|
|
11
|
+
import "@dialpad/dialtone-icons/icons.json";
|
|
12
|
+
import "./skeleton.js";
|
|
13
|
+
const s = {
|
|
14
|
+
name: "DtCollapsibleLazyShow",
|
|
15
|
+
/******************
|
|
16
|
+
* PROPS *
|
|
17
|
+
******************/
|
|
18
|
+
props: {
|
|
19
|
+
/**
|
|
20
|
+
* Whether the child slot is shown.
|
|
21
|
+
*/
|
|
22
|
+
show: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: null
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* Enable/Disable transition animation
|
|
28
|
+
*/
|
|
29
|
+
appear: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: !1
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* HTML element type (tag name) of the content wrapper element.
|
|
35
|
+
*/
|
|
36
|
+
elementType: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: "div"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
/******************
|
|
42
|
+
* DATA *
|
|
43
|
+
******************/
|
|
44
|
+
data() {
|
|
45
|
+
return {
|
|
46
|
+
initialized: !!this.show
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
/******************
|
|
50
|
+
* COMPUTED *
|
|
51
|
+
******************/
|
|
52
|
+
computed: {
|
|
53
|
+
/**
|
|
54
|
+
* Set the css property to false when running tests only.
|
|
55
|
+
* Refer to: https://vuejs.org/guide/built-ins/transition.html#javascript-hooks for details about
|
|
56
|
+
* transition `css` property
|
|
57
|
+
* @returns {boolean}
|
|
58
|
+
*/
|
|
59
|
+
isCSSEnabled() {
|
|
60
|
+
return process.env.NODE_ENV !== "test";
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
/******************
|
|
64
|
+
* WATCH *
|
|
65
|
+
******************/
|
|
66
|
+
watch: {
|
|
67
|
+
show: function(t) {
|
|
68
|
+
!t || this.initialized || (this.initialized = !0);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
methods: {
|
|
72
|
+
/**
|
|
73
|
+
* @param {HTMLElement} element
|
|
74
|
+
*/
|
|
75
|
+
beforeEnter(t) {
|
|
76
|
+
requestAnimationFrame(() => {
|
|
77
|
+
t.style.height || (t.style.height = "0px");
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* @param {HTMLElement} element
|
|
82
|
+
*/
|
|
83
|
+
enter(t) {
|
|
84
|
+
requestAnimationFrame(() => {
|
|
85
|
+
requestAnimationFrame(() => {
|
|
86
|
+
t.style.height = `${t.scrollHeight}px`;
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
/**
|
|
91
|
+
* @param {HTMLElement} element
|
|
92
|
+
*/
|
|
93
|
+
afterEnter(t) {
|
|
94
|
+
t.style.height = null;
|
|
95
|
+
},
|
|
96
|
+
/**
|
|
97
|
+
* @param {HTMLElement} element
|
|
98
|
+
*/
|
|
99
|
+
beforeLeave(t) {
|
|
100
|
+
requestAnimationFrame(() => {
|
|
101
|
+
t.style.height || (t.style.height = `${t.offsetHeight}px`);
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* @param {HTMLElement} element
|
|
106
|
+
*/
|
|
107
|
+
leave(t) {
|
|
108
|
+
requestAnimationFrame(() => {
|
|
109
|
+
requestAnimationFrame(() => {
|
|
110
|
+
t.style.height = "0px";
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* @param {HTMLElement} element
|
|
116
|
+
*/
|
|
117
|
+
afterLeave(t) {
|
|
118
|
+
t.style.height = null;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
var p = function() {
|
|
123
|
+
var e = this, n = e._self._c;
|
|
124
|
+
return n("transition", e._g({ attrs: { appear: e.appear, "enter-active-class": "enter-active", "leave-active-class": "leave-active", css: e.isCSSEnabled }, on: { "before-enter": e.beforeEnter, enter: e.enter, "after-enter": e.afterEnter, "before-leave": e.beforeLeave, leave: e.leave, "after-leave": e.afterLeave } }, e.$listeners), [n(e.elementType, e._g({ directives: [{ name: "show", rawName: "v-show", value: e.show, expression: "show" }], tag: "component" }, e.$listeners), [e.initialized ? e._t("default") : e._e()], 2)], 1);
|
|
125
|
+
}, c = [], d = /* @__PURE__ */ i(
|
|
126
|
+
s,
|
|
127
|
+
p,
|
|
128
|
+
c,
|
|
129
|
+
!1,
|
|
130
|
+
null,
|
|
131
|
+
null,
|
|
132
|
+
null,
|
|
133
|
+
null
|
|
134
|
+
);
|
|
135
|
+
const h = d.exports, u = {
|
|
136
|
+
name: "DtCollapsible",
|
|
137
|
+
components: {
|
|
138
|
+
DtButton: r,
|
|
139
|
+
DtCollapsibleLazyShow: h,
|
|
140
|
+
DtLazyShow: l,
|
|
141
|
+
DtIcon: o
|
|
142
|
+
},
|
|
143
|
+
props: {
|
|
144
|
+
/**
|
|
145
|
+
* Text that is displayed on the anchor if nothing is passed in the slot.
|
|
146
|
+
* Ignored if the anchor slot is used.
|
|
147
|
+
*/
|
|
148
|
+
anchorText: {
|
|
149
|
+
type: String,
|
|
150
|
+
default: null
|
|
151
|
+
},
|
|
152
|
+
/**
|
|
153
|
+
* Controls whether the collapsible is shown. Leaving this null will have the collapsible start
|
|
154
|
+
* expanded and trigger on click by default. If you set this value, the default trigger
|
|
155
|
+
* behavior will be disabled, and you can control it as you need.
|
|
156
|
+
* Supports .sync modifier
|
|
157
|
+
* @values null, true, false
|
|
158
|
+
*/
|
|
159
|
+
open: {
|
|
160
|
+
type: Boolean,
|
|
161
|
+
default: null
|
|
162
|
+
},
|
|
163
|
+
/**
|
|
164
|
+
* The id of the content wrapper.
|
|
165
|
+
*/
|
|
166
|
+
id: {
|
|
167
|
+
type: String,
|
|
168
|
+
default() {
|
|
169
|
+
return a();
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
/**
|
|
173
|
+
* HTML element type (tag name) of the root element of the component.
|
|
174
|
+
*/
|
|
175
|
+
elementType: {
|
|
176
|
+
type: String,
|
|
177
|
+
default: "div"
|
|
178
|
+
},
|
|
179
|
+
/**
|
|
180
|
+
* HTML element type (tag name) of the content wrapper element.
|
|
181
|
+
*/
|
|
182
|
+
contentElementType: {
|
|
183
|
+
type: String,
|
|
184
|
+
default: "div"
|
|
185
|
+
},
|
|
186
|
+
/**
|
|
187
|
+
* Additional class name for the anchor wrapper element.
|
|
188
|
+
*/
|
|
189
|
+
anchorClass: {
|
|
190
|
+
type: [String, Array, Object],
|
|
191
|
+
default: null
|
|
192
|
+
},
|
|
193
|
+
/**
|
|
194
|
+
* Additional class name for the content wrapper element.
|
|
195
|
+
*/
|
|
196
|
+
contentClass: {
|
|
197
|
+
type: [String, Array, Object],
|
|
198
|
+
default: null
|
|
199
|
+
},
|
|
200
|
+
/**
|
|
201
|
+
* The maximum width of the anchor and collapsible element.
|
|
202
|
+
* Possible units rem|px|%|em
|
|
203
|
+
*/
|
|
204
|
+
maxWidth: {
|
|
205
|
+
type: String,
|
|
206
|
+
default: null
|
|
207
|
+
},
|
|
208
|
+
/**
|
|
209
|
+
* The maximum height of the collapsible element.
|
|
210
|
+
* Possible units rem|px|%|em
|
|
211
|
+
*/
|
|
212
|
+
maxHeight: {
|
|
213
|
+
type: String,
|
|
214
|
+
default: null
|
|
215
|
+
},
|
|
216
|
+
/**
|
|
217
|
+
* Label on the collapsible content. Should provide this or ariaLabelledBy but not both.
|
|
218
|
+
*/
|
|
219
|
+
ariaLabel: {
|
|
220
|
+
type: String,
|
|
221
|
+
default: null
|
|
222
|
+
},
|
|
223
|
+
/**
|
|
224
|
+
* Id of the element that labels the collapsible content. Defaults to the anchor element.
|
|
225
|
+
* Should provide this or ariaLabel but not both.
|
|
226
|
+
*/
|
|
227
|
+
ariaLabelledBy: {
|
|
228
|
+
type: String,
|
|
229
|
+
default: null
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
emits: [
|
|
233
|
+
/**
|
|
234
|
+
* Event fired to sync the open prop with the parent component
|
|
235
|
+
* @event update:open
|
|
236
|
+
*/
|
|
237
|
+
"update:open",
|
|
238
|
+
/**
|
|
239
|
+
* Event fired when the content is shown or hidden
|
|
240
|
+
*
|
|
241
|
+
* @event opened
|
|
242
|
+
* @type {Boolean}
|
|
243
|
+
*/
|
|
244
|
+
"opened"
|
|
245
|
+
],
|
|
246
|
+
data() {
|
|
247
|
+
return {
|
|
248
|
+
isOpen: !0
|
|
249
|
+
};
|
|
250
|
+
},
|
|
251
|
+
computed: {
|
|
252
|
+
labelledBy() {
|
|
253
|
+
return this.ariaLabelledBy || !this.ariaLabel && a("DtCollapsible__anchor");
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
watch: {
|
|
257
|
+
open: {
|
|
258
|
+
handler: function(t) {
|
|
259
|
+
t !== null && (this.isOpen = t);
|
|
260
|
+
},
|
|
261
|
+
immediate: !0
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
mounted() {
|
|
265
|
+
this.validateProperAnchor();
|
|
266
|
+
},
|
|
267
|
+
methods: {
|
|
268
|
+
onLeaveTransitionComplete() {
|
|
269
|
+
this.$emit("opened", !1), this.open !== null && this.$emit("update:open", !1);
|
|
270
|
+
},
|
|
271
|
+
onEnterTransitionComplete() {
|
|
272
|
+
this.$emit("opened", !0, this.$refs.content), this.open !== null && this.$emit("update:open", !0);
|
|
273
|
+
},
|
|
274
|
+
defaultToggleOpen() {
|
|
275
|
+
this.open === null && this.toggleOpen();
|
|
276
|
+
},
|
|
277
|
+
toggleOpen() {
|
|
278
|
+
this.isOpen = !this.isOpen;
|
|
279
|
+
},
|
|
280
|
+
validateProperAnchor() {
|
|
281
|
+
!this.anchorText && !this.$scopedSlots.anchor && console.error("anchor text and anchor slot content cannot both be falsy");
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
var m = function() {
|
|
286
|
+
var e = this, n = e._self._c;
|
|
287
|
+
return n(e.elementType, e._g({ ref: "collapsible", tag: "component" }, e.$listeners), [n("div", { ref: "anchor", class: e.anchorClass, attrs: { id: !e.ariaLabelledBy && e.labelledBy } }, [e._t("anchor", function() {
|
|
288
|
+
return [n("dt-button", { style: {
|
|
289
|
+
width: e.maxWidth
|
|
290
|
+
}, attrs: { importance: "clear", kind: "muted", "aria-controls": e.id, "aria-expanded": `${e.isOpen}` }, on: { click: e.defaultToggleOpen } }, [n("dt-icon", { staticClass: "d-collapsible__icon", attrs: { name: e.isOpen ? "chevron-down" : "chevron-right", size: "300" } }), n("span", { staticClass: "d-collapsible__anchor-text", attrs: { title: e.anchorText } }, [e._v(" " + e._s(e.anchorText) + " ")])], 1)];
|
|
291
|
+
}, { attrs: {
|
|
292
|
+
"aria-controls": e.id,
|
|
293
|
+
"aria-expanded": e.isOpen.toString(),
|
|
294
|
+
role: "button"
|
|
295
|
+
} })], 2), n("dt-collapsible-lazy-show", e._g({ ref: "contentWrapper", class: e.contentClass, style: {
|
|
296
|
+
"max-height": e.maxHeight,
|
|
297
|
+
"max-width": e.maxWidth
|
|
298
|
+
}, attrs: { id: e.id, "aria-hidden": `${!e.isOpen}`, "aria-labelledby": e.labelledBy, "aria-label": e.ariaLabel, show: e.isOpen, "element-type": e.contentElementType, "data-qa": "dt-collapsible--content", tabindex: "-1", appear: "" }, on: { "after-leave": e.onLeaveTransitionComplete, "after-enter": e.onEnterTransitionComplete } }, e.$listeners), [e._t("content")], 2)], 1);
|
|
299
|
+
}, f = [], y = /* @__PURE__ */ i(
|
|
300
|
+
u,
|
|
301
|
+
m,
|
|
302
|
+
f,
|
|
303
|
+
!1,
|
|
304
|
+
null,
|
|
305
|
+
null,
|
|
306
|
+
null,
|
|
307
|
+
null
|
|
308
|
+
);
|
|
309
|
+
const E = y.exports;
|
|
310
|
+
export {
|
|
311
|
+
E as DtCollapsible
|
|
312
|
+
};
|
|
313
|
+
//# sourceMappingURL=collapsible.js.map
|