@dialpad/dialtone-vue 3.96.0 → 3.96.2
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/CHANGELOG.json +1 -1
- package/CHANGELOG.md +19 -0
- package/README.md +3 -3
- package/dist/component-documentation.json +1 -1
- package/dist/dialtone-vue.cjs +5 -5
- package/dist/dialtone-vue.js +2503 -2601
- package/dist/directives.cjs +1 -1
- package/dist/directives.js +1 -1
- package/dist/{emoji-zsImd-qD.js → emoji-64scMQZS.js} +6280 -7196
- package/dist/emoji-zMlz3b9J.cjs +1 -0
- package/dist/emoji.cjs +1 -1
- package/dist/emoji.js +33 -113
- package/dist/emoji_picker-MrGLDXUn.js +921 -0
- package/dist/emoji_picker-gkXbSV3i.cjs +1 -0
- package/dist/emoji_text_wrapper-5mWcPQ4m.cjs +1 -0
- package/dist/emoji_text_wrapper-GCssca4o.js +86 -0
- package/dist/message_input.cjs +92 -1
- package/dist/message_input.js +13903 -5
- package/dist/stack-_FIkvuMY.cjs +2 -0
- package/dist/stack-q9VLdD1J.js +2722 -0
- package/dist/style.css +1 -1
- package/dist/tooltip-H27s49LR.js +2476 -0
- package/dist/tooltip-gZ2LW6l0.cjs +21 -0
- package/dist/types/common/constants.d.ts +31 -31
- package/dist/types/common/mixins/input.d.ts +38 -38
- package/dist/types/common/mixins/input_group.d.ts +19 -19
- package/dist/types/common/mixins/sr_only_close_button.d.ts +6 -6
- package/dist/types/components/avatar/avatar.vue.d.ts +1 -1
- package/dist/types/components/avatar/avatar_constants.d.ts +20 -20
- package/dist/types/components/badge/badge.vue.d.ts +9 -2
- package/dist/types/components/badge/badge.vue.d.ts.map +1 -1
- package/dist/types/components/badge/badge_constants.d.ts +9 -9
- package/dist/types/components/button/button.vue.d.ts +1 -1
- package/dist/types/components/button/button_constants.d.ts +21 -21
- package/dist/types/components/button/index.d.ts +1 -0
- package/dist/types/components/checkbox/checkbox.vue.d.ts +6 -1
- package/dist/types/components/checkbox/checkbox.vue.d.ts.map +1 -1
- package/dist/types/components/checkbox/checkbox_constants.d.ts +3 -3
- package/dist/types/components/checkbox_group/checkbox_group.vue.d.ts +9 -2
- package/dist/types/components/checkbox_group/checkbox_group.vue.d.ts.map +1 -1
- package/dist/types/components/chip/chip_constants.d.ts +10 -9
- package/dist/types/components/chip/index.d.ts +1 -1
- package/dist/types/components/combobox/combobox.vue.d.ts +16 -8
- package/dist/types/components/combobox/combobox.vue.d.ts.map +1 -1
- package/dist/types/components/combobox/combobox_constants.d.ts +9 -5
- package/dist/types/components/combobox/index.d.ts +1 -0
- package/dist/types/components/datepicker/{DtDatepicker.vue.d.ts → datepicker.vue.d.ts} +2 -2
- package/dist/types/components/datepicker/datepicker.vue.d.ts.map +1 -0
- package/dist/types/components/datepicker/formatUtils.d.ts +8 -0
- package/dist/types/components/datepicker/index.d.ts +1 -1
- package/dist/types/components/datepicker/modules/calendar.vue.d.ts +4 -1
- package/dist/types/components/datepicker/modules/month-year-picker.vue.d.ts +7 -1
- package/dist/types/components/dropdown/dropdown.vue.d.ts +27 -1
- package/dist/types/components/dropdown/dropdown.vue.d.ts.map +1 -1
- package/dist/types/components/dropdown/dropdown_constants.d.ts +7 -3
- package/dist/types/components/dropdown/index.d.ts +1 -0
- package/dist/types/components/emoji_picker/composables/useKeyboardNavigation.d.ts.map +1 -1
- package/dist/types/components/emoji_picker/{DtEmojiPicker.vue.d.ts → emoji_picker.vue.d.ts} +2 -2
- package/dist/types/components/emoji_picker/emoji_picker.vue.d.ts.map +1 -0
- package/dist/types/components/emoji_picker/emoji_picker_constants.d.ts +22 -17
- package/dist/types/components/emoji_picker/index.d.ts +1 -1
- package/dist/types/components/emoji_picker/modules/emoji_description.vue.d.ts +1 -0
- package/dist/types/components/emoji_picker/modules/emoji_search.vue.d.ts +3 -1
- package/dist/types/components/emoji_picker/modules/emoji_search.vue.d.ts.map +1 -1
- package/dist/types/components/emoji_picker/modules/emoji_selector.vue.d.ts +1 -1
- package/dist/types/components/emoji_picker/modules/emoji_selector.vue.d.ts.map +1 -1
- package/dist/types/components/emoji_picker/modules/emoji_skin_selector.vue.d.ts +1 -1
- package/dist/types/components/emoji_picker/modules/emoji_skin_selector.vue.d.ts.map +1 -1
- package/dist/types/components/emoji_picker/modules/emoji_tabset.vue.d.ts +1 -1
- package/dist/types/components/input/input.vue.d.ts +2 -2
- package/dist/types/components/input/input_constants.d.ts +13 -13
- package/dist/types/components/input_group/input_group.vue.d.ts +3 -1
- package/dist/types/components/input_group/input_group.vue.d.ts.map +1 -1
- package/dist/types/components/link/link_constants.d.ts +11 -6
- package/dist/types/components/list_item/index.d.ts +1 -0
- package/dist/types/components/list_item/list_item.vue.d.ts +1 -1
- package/dist/types/components/list_item/list_item_constants.d.ts +5 -5
- package/dist/types/components/modal/modal_constants.d.ts +9 -9
- package/dist/types/components/popover/index.d.ts +1 -1
- package/dist/types/components/popover/popover.vue.d.ts +1 -1
- package/dist/types/components/popover/popover_constants.d.ts +19 -8
- package/dist/types/components/presence/presence_constants.d.ts +4 -4
- package/dist/types/components/radio/index.d.ts +1 -0
- package/dist/types/components/radio/radio.vue.d.ts +3 -7
- package/dist/types/components/radio/radio.vue.d.ts.map +1 -1
- package/dist/types/components/radio/radio_constants.d.ts +3 -3
- package/dist/types/components/radio_group/radio_group.vue.d.ts +1 -3
- package/dist/types/components/radio_group/radio_group.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts +2 -2
- package/dist/types/components/rich_text_editor/extensions/link/utils.d.ts +5 -1
- package/dist/types/components/rich_text_editor/extensions/link/utils.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +2 -2
- package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts +1 -1
- package/dist/types/components/rich_text_editor/rich_text_editor_constants.d.ts +5 -0
- package/dist/types/components/root_layout/root_layout_constants.d.ts +2 -2
- package/dist/types/components/scroller/DtScroller.vue.d.ts +11 -1
- package/dist/types/components/scroller/DtScroller.vue.d.ts.map +1 -1
- package/dist/types/components/scroller/modules/core_scroller.vue.d.ts +13 -1
- package/dist/types/components/scroller/modules/core_scroller.vue.d.ts.map +1 -1
- package/dist/types/components/scroller/modules/scroller_item.vue.d.ts.map +1 -1
- package/dist/types/components/select_menu/select_menu.vue.d.ts +1 -1
- package/dist/types/components/select_menu/select_menu_constants.d.ts +8 -8
- package/dist/types/components/skeleton/skeleton_constants.d.ts +8 -8
- package/dist/types/components/stack/index.d.ts +1 -0
- package/dist/types/components/stack/stack_constants.d.ts +6 -0
- package/dist/types/components/tabs/tabs_constants.d.ts +4 -4
- package/dist/types/components/toast/toast.vue.d.ts +4 -1
- package/dist/types/components/toast/toast.vue.d.ts.map +1 -1
- package/dist/types/components/toggle/index.d.ts +1 -0
- package/dist/types/components/toggle/toggle_constants.d.ts +3 -2
- package/dist/types/components/tooltip/tooltip_constants.d.ts +4 -4
- package/dist/types/directives/tooltip/tooltip.d.ts +1 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/message_input.d.ts +1 -0
- package/dist/types/recipes/cards/ivr_node/ivr_node_constants.d.ts +22 -22
- package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +2 -2
- package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select_constants.d.ts +25 -0
- package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select_constants.d.ts.map +1 -0
- package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select_story_constants.d.ts +0 -18
- package/dist/types/recipes/comboboxes/combobox_multi_select/index.d.ts +1 -1
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +1 -1
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +13 -2
- package/dist/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/feed_item_row/feed_item_row_constants.d.ts +3 -3
- package/dist/types/recipes/conversation_view/feed_item_row/index.d.ts +1 -0
- package/dist/types/recipes/conversation_view/feed_pill/feed_item_pill_constants.d.ts +3 -3
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts +14 -62
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/callbox/callbox_constants.d.ts +4 -4
- package/dist/types/recipes/leftbar/general_row/general_row.vue.d.ts +1 -1
- package/dist/types/recipes/leftbar/general_row/general_row_constants.d.ts +12 -12
- package/dist/types/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts +1 -1
- package/dist/types/recipes/list_items/contact_info/contact_info.vue.d.ts +1 -1
- package/package.json +51 -51
- package/dist/emoji-5anz0QgY.cjs +0 -1
- package/dist/message_input-JdPf8pn2.js +0 -16500
- package/dist/message_input-s1pJ2P6G.cjs +0 -93
- package/dist/tooltip-3LC0ejIh.cjs +0 -25
- package/dist/tooltip-laZwfd56.js +0 -2574
- package/dist/types/components/datepicker/DtDatepicker.vue.d.ts.map +0 -1
- package/dist/types/components/emoji_picker/DtEmojiPicker.vue.d.ts.map +0 -1
- package/dist/types/components/list_section/index.d.ts +0 -2
- package/dist/types/components/list_section/index.d.ts.map +0 -1
- package/dist/types/components/list_section/list_section.vue.d.ts +0 -71
- package/dist/types/components/list_section/list_section.vue.d.ts.map +0 -1
- package/dist/types/components/tooltip/tooltip_variants.vue.d.ts +0 -7
- package/dist/types/components/tooltip/tooltip_variants.vue.d.ts.map +0 -1
|
@@ -0,0 +1,921 @@
|
|
|
1
|
+
import { ref as p, onMounted as se, openBlock as y, createElementBlock as j, createVNode as O, unref as T, withKeys as N, withModifiers as ne, createSlots as ge, withCtx as z, createElementVNode as w, computed as V, toRefs as ke, watch as P, Fragment as H, renderList as G, createBlock as ye, nextTick as W, onUnmounted as Se, toDisplayString as Y, withDirectives as X, createCommentVNode as Z, vShow as x, normalizeClass as ie, watchEffect as oe, createTextVNode as ae } from "vue";
|
|
2
|
+
import { t as je, w as ee, x as Te, y as _e, z as M } from "./emoji-64scMQZS.js";
|
|
3
|
+
import { D as $e } from "./tooltip-H27s49LR.js";
|
|
4
|
+
const Re = { class: "d-emoji-picker__search d-emoji-picker__alignment" }, we = ["onKeydown"], Ee = {
|
|
5
|
+
__name: "emoji_search",
|
|
6
|
+
props: {
|
|
7
|
+
searchPlaceholderLabel: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: !0
|
|
10
|
+
},
|
|
11
|
+
modelValue: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: ""
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
emits: ["update:modelValue", "focus-emoji-selector", "focus-tabset", "select-first-emoji"],
|
|
17
|
+
setup(i, { expose: k, emit: E }) {
|
|
18
|
+
const n = E, c = p(null);
|
|
19
|
+
function d() {
|
|
20
|
+
n("update:modelValue", ""), b();
|
|
21
|
+
}
|
|
22
|
+
function b() {
|
|
23
|
+
c.value.focus();
|
|
24
|
+
}
|
|
25
|
+
return se(() => {
|
|
26
|
+
b();
|
|
27
|
+
}), k({
|
|
28
|
+
focusSearchInput: b
|
|
29
|
+
}), (S, a) => (y(), j("div", Re, [
|
|
30
|
+
O(T(je), {
|
|
31
|
+
id: "searchInput",
|
|
32
|
+
ref_key: "searchInput",
|
|
33
|
+
ref: c,
|
|
34
|
+
placeholder: i.searchPlaceholderLabel,
|
|
35
|
+
"model-value": i.modelValue,
|
|
36
|
+
"onUpdate:modelValue": a[0] || (a[0] = ($) => S.$emit("update:modelValue", $)),
|
|
37
|
+
onKeydown: [
|
|
38
|
+
a[1] || (a[1] = N(($) => S.$emit("focus-tabset"), ["up"])),
|
|
39
|
+
a[2] || (a[2] = N(ne(($) => S.$emit("focus-emoji-selector"), ["prevent"]), ["down"])),
|
|
40
|
+
a[3] || (a[3] = N(($) => S.$emit("select-first-emoji"), ["enter"]))
|
|
41
|
+
]
|
|
42
|
+
}, ge({
|
|
43
|
+
leftIcon: z(() => [
|
|
44
|
+
O(T(ee), { name: "search" })
|
|
45
|
+
]),
|
|
46
|
+
_: 2
|
|
47
|
+
}, [
|
|
48
|
+
i.modelValue.length > 0 ? {
|
|
49
|
+
name: "rightIcon",
|
|
50
|
+
fn: z(() => [
|
|
51
|
+
w("button", {
|
|
52
|
+
class: "d-emoji-picker__search-button",
|
|
53
|
+
onClick: d,
|
|
54
|
+
onKeydown: N(d, ["enter"])
|
|
55
|
+
}, [
|
|
56
|
+
O(T(ee), { name: "close" })
|
|
57
|
+
], 40, we)
|
|
58
|
+
]),
|
|
59
|
+
key: "0"
|
|
60
|
+
} : void 0
|
|
61
|
+
]), 1032, ["placeholder", "model-value"])
|
|
62
|
+
]));
|
|
63
|
+
}
|
|
64
|
+
}, Le = { class: "d-emoji-picker__tabset" }, Ie = {
|
|
65
|
+
__name: "emoji_tabset",
|
|
66
|
+
props: {
|
|
67
|
+
/**
|
|
68
|
+
* Whether to show the recently used tab or not
|
|
69
|
+
* @type {Boolean}
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
showRecentlyUsedTab: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: !1
|
|
75
|
+
},
|
|
76
|
+
scrollIntoTab: {
|
|
77
|
+
type: Number,
|
|
78
|
+
required: !0
|
|
79
|
+
},
|
|
80
|
+
isScrolling: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: !1
|
|
83
|
+
},
|
|
84
|
+
emojiFilter: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: ""
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* The labels for the aria-label
|
|
90
|
+
* @type {Array}
|
|
91
|
+
* @required
|
|
92
|
+
*/
|
|
93
|
+
tabsetLabels: {
|
|
94
|
+
type: Array,
|
|
95
|
+
required: !0
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
emits: [
|
|
99
|
+
/**
|
|
100
|
+
* Emitted when a tab is selected
|
|
101
|
+
* @event selected-tabset
|
|
102
|
+
* @param {String} tabId - The name of the tab that was selected
|
|
103
|
+
*/
|
|
104
|
+
"selected-tabset",
|
|
105
|
+
"focus-search-input"
|
|
106
|
+
],
|
|
107
|
+
setup(i, { expose: k, emit: E }) {
|
|
108
|
+
const n = i, c = E, d = [
|
|
109
|
+
{ label: U.MOST_RECENTLY_USED, icon: "clock" },
|
|
110
|
+
{ label: U.SMILEYS_AND_PEOPLE, icon: "satisfied" },
|
|
111
|
+
{ label: U.NATURE, icon: "living-thing" },
|
|
112
|
+
{ label: U.FOOD, icon: "food" },
|
|
113
|
+
{ label: U.ACTIVITY, icon: "object" },
|
|
114
|
+
{ label: U.TRAVEL, icon: "transportation" },
|
|
115
|
+
{ label: U.OBJECTS, icon: "lightbulb" },
|
|
116
|
+
{ label: U.SYMBOLS, icon: "heart" },
|
|
117
|
+
{ label: U.FLAGS, icon: "flag" }
|
|
118
|
+
], b = V(() => (n.showRecentlyUsedTab ? d : d.slice(1)).map((l, h) => ({
|
|
119
|
+
...l,
|
|
120
|
+
label: n.tabsetLabels[h],
|
|
121
|
+
id: (h + 1).toString(),
|
|
122
|
+
panelId: (h + 1).toString()
|
|
123
|
+
}))), S = V(() => n.emojiFilter.length > 0), a = p("1"), { isScrolling: $ } = ke(n), R = p([]);
|
|
124
|
+
P(
|
|
125
|
+
() => n.scrollIntoTab,
|
|
126
|
+
() => {
|
|
127
|
+
!$.value && !S.value && (a.value = (n.scrollIntoTab + 1).toString());
|
|
128
|
+
}
|
|
129
|
+
), P(
|
|
130
|
+
S,
|
|
131
|
+
() => {
|
|
132
|
+
S.value && (a.value = null);
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
function F(e) {
|
|
136
|
+
$.value || (a.value = e), c("selected-tabset", e);
|
|
137
|
+
}
|
|
138
|
+
function f(e) {
|
|
139
|
+
R.value.push(e.$el);
|
|
140
|
+
}
|
|
141
|
+
function A() {
|
|
142
|
+
R.value[0].focus();
|
|
143
|
+
}
|
|
144
|
+
function o(e, l) {
|
|
145
|
+
e.key === "Enter" && (F(l), R.value[l - 1].blur()), e.key === "Tab" && (e.preventDefault(), c("focus-search-input")), e.key === "ArrowDown" && c("focus-search-input");
|
|
146
|
+
}
|
|
147
|
+
return k({
|
|
148
|
+
focusTabset: A
|
|
149
|
+
}), (e, l) => (y(), j("div", Le, [
|
|
150
|
+
O(T(Te), {
|
|
151
|
+
"tab-list-class": "d-emoji-picker__tabset-list",
|
|
152
|
+
selected: a.value
|
|
153
|
+
}, {
|
|
154
|
+
tabs: z(() => [
|
|
155
|
+
(y(!0), j(H, null, G(b.value, (h, v) => (y(), ye(T(_e), {
|
|
156
|
+
id: h.id,
|
|
157
|
+
ref_for: !0,
|
|
158
|
+
ref: (_) => {
|
|
159
|
+
_ && f(_);
|
|
160
|
+
},
|
|
161
|
+
key: h.id,
|
|
162
|
+
"panel-id": h.panelId,
|
|
163
|
+
label: h.label,
|
|
164
|
+
"aria-controls": "d-emoji-picker-list",
|
|
165
|
+
tabindex: v + 1,
|
|
166
|
+
onClickCapture: ne((_) => F(h.id), ["stop"]),
|
|
167
|
+
onKeydown: (_) => o(_, h.id)
|
|
168
|
+
}, {
|
|
169
|
+
default: z(() => [
|
|
170
|
+
O(T(ee), {
|
|
171
|
+
size: "400",
|
|
172
|
+
name: h.icon
|
|
173
|
+
}, null, 8, ["name"])
|
|
174
|
+
]),
|
|
175
|
+
_: 2
|
|
176
|
+
}, 1032, ["id", "panel-id", "label", "tabindex", "onClickCapture", "onKeydown"]))), 128))
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
}, 8, ["selected"])
|
|
180
|
+
]));
|
|
181
|
+
}
|
|
182
|
+
}, J = "https://static.dialpadcdn.com/joypixels/png/unicode/32/", I = 9, q = {
|
|
183
|
+
DEFAULT: "Default",
|
|
184
|
+
LIGHT: "Light",
|
|
185
|
+
MEDIUM_LIGHT: "MediumLight",
|
|
186
|
+
MEDIUM: "Medium",
|
|
187
|
+
MEDIUM_DARK: "MediumDark",
|
|
188
|
+
DARK: "Dark"
|
|
189
|
+
}, U = {
|
|
190
|
+
MOST_RECENTLY_USED: "Most recently used",
|
|
191
|
+
SMILEYS_AND_PEOPLE: "Smileys and people",
|
|
192
|
+
NATURE: "Nature",
|
|
193
|
+
FOOD: "Food",
|
|
194
|
+
ACTIVITY: "Activity",
|
|
195
|
+
TRAVEL: "Travel",
|
|
196
|
+
OBJECTS: "Objects",
|
|
197
|
+
SYMBOLS: "Symbols",
|
|
198
|
+
FLAGS: "Flags"
|
|
199
|
+
};
|
|
200
|
+
function Ae(i) {
|
|
201
|
+
const k = p([]), E = p([]), n = p(!1), c = p(!0);
|
|
202
|
+
function d(o, e = !1) {
|
|
203
|
+
c.value = e, i("highlighted-emoji", o);
|
|
204
|
+
}
|
|
205
|
+
function b(o, e, l) {
|
|
206
|
+
k.value[e] || (k.value[e] = []), k.value[e][l] = o;
|
|
207
|
+
}
|
|
208
|
+
function S(o, e) {
|
|
209
|
+
E.value[e] = o;
|
|
210
|
+
}
|
|
211
|
+
function a(o, e) {
|
|
212
|
+
var h, v, _;
|
|
213
|
+
const l = n.value ? (h = E.value) == null ? void 0 : h[e] : (_ = (v = k.value) == null ? void 0 : v[o]) == null ? void 0 : _[e];
|
|
214
|
+
return l ? (l.focus(), !0) : !1;
|
|
215
|
+
}
|
|
216
|
+
function $(o, e) {
|
|
217
|
+
a(o, e - 1) || (k.value[o - 1] ? a(o - 1, k.value[o - 1].length - 1) : a(k.value.length - 1, k.value[k.value.length - 1].length - 1));
|
|
218
|
+
}
|
|
219
|
+
function R(o, e) {
|
|
220
|
+
a(o, e + 1) || a(o + 1, 0) || a(0, 0);
|
|
221
|
+
}
|
|
222
|
+
function F(o, e) {
|
|
223
|
+
a(0, e - 1) || a(0, E.value.length - 1);
|
|
224
|
+
}
|
|
225
|
+
function f(o, e) {
|
|
226
|
+
a(0, e + 1) || a(0, 0);
|
|
227
|
+
}
|
|
228
|
+
function A(o, e, l) {
|
|
229
|
+
n.value ? o === "left" ? F(e, l) : o === "right" && f(e, l) : o === "left" ? $(e, l) : o === "right" && R(e, l);
|
|
230
|
+
}
|
|
231
|
+
return {
|
|
232
|
+
emojiRefs: k,
|
|
233
|
+
emojiFilteredRefs: E,
|
|
234
|
+
isFiltering: n,
|
|
235
|
+
hoverFirstEmoji: c,
|
|
236
|
+
setEmojiRef: b,
|
|
237
|
+
setFilteredRef: S,
|
|
238
|
+
hoverEmoji: d,
|
|
239
|
+
focusEmoji: a,
|
|
240
|
+
handleHorizontalNavigation: A
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
const De = { class: "d-emoji-picker__selector" }, Fe = {
|
|
244
|
+
key: 0,
|
|
245
|
+
class: "d-emoji-picker__search-label d-emoji-picker__alignment"
|
|
246
|
+
}, Ce = { key: 0 }, Me = { class: "d-emoji-picker__tab" }, Ke = ["aria-label", "onClick", "onFocusin", "onMouseover", "onKeydown"], Oe = ["alt", "aria-label", "title", "src"], Ue = {
|
|
247
|
+
key: 2,
|
|
248
|
+
class: "d-emoji-picker__alignment"
|
|
249
|
+
}, Ne = {
|
|
250
|
+
class: "d-emoji-picker__tab",
|
|
251
|
+
"data-qa": "filtered-emojis"
|
|
252
|
+
}, Be = ["aria-label", "onClick", "onFocusin", "onMouseover", "onKeydown"], Ve = ["alt", "aria-label", "title", "src"], qe = {
|
|
253
|
+
__name: "emoji_selector",
|
|
254
|
+
props: {
|
|
255
|
+
/**
|
|
256
|
+
* The filter to apply to the emoji list
|
|
257
|
+
* @type {String}
|
|
258
|
+
* @default ''
|
|
259
|
+
*/
|
|
260
|
+
emojiFilter: {
|
|
261
|
+
type: String,
|
|
262
|
+
default: ""
|
|
263
|
+
},
|
|
264
|
+
/**
|
|
265
|
+
* The skin tone to apply to the emoji list
|
|
266
|
+
* @type {String}
|
|
267
|
+
* @required
|
|
268
|
+
*/
|
|
269
|
+
skinTone: {
|
|
270
|
+
type: String,
|
|
271
|
+
required: !0
|
|
272
|
+
},
|
|
273
|
+
/**
|
|
274
|
+
* The labels for the tabset
|
|
275
|
+
* @type {Array}
|
|
276
|
+
* @required
|
|
277
|
+
*/
|
|
278
|
+
tabsetLabels: {
|
|
279
|
+
type: Array,
|
|
280
|
+
required: !0
|
|
281
|
+
},
|
|
282
|
+
selectedTabset: {
|
|
283
|
+
type: Object,
|
|
284
|
+
required: !0
|
|
285
|
+
},
|
|
286
|
+
/**
|
|
287
|
+
* The label for the search results tab
|
|
288
|
+
* @type {String}
|
|
289
|
+
* @required
|
|
290
|
+
*/
|
|
291
|
+
searchResultsLabel: {
|
|
292
|
+
type: String,
|
|
293
|
+
required: !0
|
|
294
|
+
},
|
|
295
|
+
searchNoResultsLabel: {
|
|
296
|
+
type: String,
|
|
297
|
+
required: !0
|
|
298
|
+
},
|
|
299
|
+
/**
|
|
300
|
+
* The list of recently used emojis
|
|
301
|
+
* @type {Array}
|
|
302
|
+
*/
|
|
303
|
+
recentlyUsedEmojis: {
|
|
304
|
+
type: Array,
|
|
305
|
+
default: () => []
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
emits: [
|
|
309
|
+
/**
|
|
310
|
+
* Emitted when the user hover over an emoji
|
|
311
|
+
* @event highlighted-emoji
|
|
312
|
+
* @param {Object} emoji - The emoji data that was hovered
|
|
313
|
+
*/
|
|
314
|
+
"highlighted-emoji",
|
|
315
|
+
/**
|
|
316
|
+
* Emitted when the user select an emoji
|
|
317
|
+
* @event selected-emoji
|
|
318
|
+
* @param {Object} emoji - The emoji data that was selected
|
|
319
|
+
*/
|
|
320
|
+
"selected-emoji",
|
|
321
|
+
/**
|
|
322
|
+
* Emitted when the user scroll into an emoji tab
|
|
323
|
+
* @event scroll-into-tab
|
|
324
|
+
* @param {Number} tab-index - The tab that was scrolled into
|
|
325
|
+
*/
|
|
326
|
+
"scroll-into-tab",
|
|
327
|
+
/**
|
|
328
|
+
* Emitted when the scrollTo function starts scrolling and stops scrolling
|
|
329
|
+
* @event is-scrolling
|
|
330
|
+
* @param {Boolean} is-scrolling - Whether the user is scrolling with the scroll-to
|
|
331
|
+
*/
|
|
332
|
+
"is-scrolling",
|
|
333
|
+
/**
|
|
334
|
+
* Emitted when the user reach the end of the emoji list
|
|
335
|
+
* @event focus-skin-selector
|
|
336
|
+
*/
|
|
337
|
+
"focus-skin-selector",
|
|
338
|
+
/**
|
|
339
|
+
* Emitted when the user shift tab in first tab of emoji selector
|
|
340
|
+
* @event focus-search-input
|
|
341
|
+
*/
|
|
342
|
+
"focus-search-input"
|
|
343
|
+
],
|
|
344
|
+
setup(i, { expose: k, emit: E }) {
|
|
345
|
+
const n = i, c = E, {
|
|
346
|
+
emojiRefs: d,
|
|
347
|
+
emojiFilteredRefs: b,
|
|
348
|
+
isFiltering: S,
|
|
349
|
+
hoverFirstEmoji: a,
|
|
350
|
+
setEmojiRef: $,
|
|
351
|
+
setFilteredRef: R,
|
|
352
|
+
hoverEmoji: F,
|
|
353
|
+
focusEmoji: f,
|
|
354
|
+
handleHorizontalNavigation: A
|
|
355
|
+
} = Ae(c), o = p(null), e = p(null), l = p(null), h = ["Recently used", "People", "Nature", "Food", "Activity", "Travel", "Objects", "Symbols", "Flags"], v = V(() => n.recentlyUsedEmojis.length ? n.tabsetLabels.map((t) => ({ label: t, ref: p(null) })) : n.tabsetLabels.slice(1).map((t) => ({ label: t, ref: p(null) }))), _ = p(v.value[0].label), C = V(() => n.recentlyUsedEmojis.length ? h : h.slice(1)), B = p([]), te = V(() => [
|
|
356
|
+
...M[`People${n.skinTone}`],
|
|
357
|
+
...M.Nature,
|
|
358
|
+
...M.Food,
|
|
359
|
+
...M[`Activity${n.skinTone}`],
|
|
360
|
+
...M.Travel,
|
|
361
|
+
...M[`Objects${n.skinTone}`],
|
|
362
|
+
...M.Symbols,
|
|
363
|
+
...M.Flags
|
|
364
|
+
]), re = ue(() => {
|
|
365
|
+
b.value = [], le();
|
|
366
|
+
});
|
|
367
|
+
P(te, () => {
|
|
368
|
+
le();
|
|
369
|
+
}, { immediate: !0 }), P(
|
|
370
|
+
() => n.recentlyUsedEmojis,
|
|
371
|
+
() => {
|
|
372
|
+
M["Recently used"] = n.recentlyUsedEmojis;
|
|
373
|
+
},
|
|
374
|
+
{ immediate: !0 }
|
|
375
|
+
), P(() => n.emojiFilter, () => {
|
|
376
|
+
de(), n.emojiFilter ? S.value = !0 : (S.value = !1, c("highlighted-emoji", null)), re();
|
|
377
|
+
}), P(
|
|
378
|
+
() => n.selectedTabset,
|
|
379
|
+
(t) => {
|
|
380
|
+
Q(t.tabId);
|
|
381
|
+
},
|
|
382
|
+
{ deep: !0 }
|
|
383
|
+
);
|
|
384
|
+
function le() {
|
|
385
|
+
const t = n.emojiFilter.toLowerCase();
|
|
386
|
+
B.value = te.value.filter((s) => {
|
|
387
|
+
const u = s.name.toLowerCase().includes(t), m = s.keywords.some((r) => r.toLowerCase().includes(t));
|
|
388
|
+
return u || m;
|
|
389
|
+
}), W(() => {
|
|
390
|
+
t && F(B.value[0], !0);
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
function ue(t, s = 300) {
|
|
394
|
+
let u;
|
|
395
|
+
return (...m) => {
|
|
396
|
+
clearTimeout(u), u = setTimeout(() => t(...m), s);
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
function ce(t) {
|
|
400
|
+
return `${J + t}.png`;
|
|
401
|
+
}
|
|
402
|
+
function fe(t) {
|
|
403
|
+
t.target.parentNode.style.display = "none";
|
|
404
|
+
}
|
|
405
|
+
function Q(t, s = !0) {
|
|
406
|
+
const m = v.value[t - 1].ref.value[0];
|
|
407
|
+
W(() => {
|
|
408
|
+
const r = e.value, L = t === "1" ? 0 : m.offsetTop - 20;
|
|
409
|
+
let g = !0, K = r.scrollTop;
|
|
410
|
+
c("is-scrolling", !0), r.addEventListener("scroll", () => {
|
|
411
|
+
if (g) {
|
|
412
|
+
const D = r.scrollTop;
|
|
413
|
+
(K < D && D >= L || K > D && D <= L) && (g = !1, c("is-scrolling", !1)), K = D;
|
|
414
|
+
}
|
|
415
|
+
}), r.scrollTop = L, s && f(t - 1, 0);
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
function de() {
|
|
419
|
+
const t = e.value;
|
|
420
|
+
t.scrollTop = 0;
|
|
421
|
+
}
|
|
422
|
+
function me() {
|
|
423
|
+
l.value = new IntersectionObserver((t) => {
|
|
424
|
+
t.forEach((s) => {
|
|
425
|
+
var r, L, g, K, D;
|
|
426
|
+
const { target: u } = s, m = parseInt(u.dataset.index);
|
|
427
|
+
s.isIntersecting && u.offsetTop <= o.value.offsetTop + 50 ? (_.value = ((r = v.value[m - 1]) == null ? void 0 : r.label) ?? ((L = v.value[0]) == null ? void 0 : L.label), c("scroll-into-tab", m - 1)) : s.boundingClientRect.bottom <= ((g = o.value) == null ? void 0 : g.getBoundingClientRect().bottom) ? (c("scroll-into-tab", m), _.value = (K = v.value[m]) == null ? void 0 : K.label) : m === 1 && (c("scroll-into-tab", m), _.value = (D = v.value[0]) == null ? void 0 : D.label);
|
|
428
|
+
});
|
|
429
|
+
}), l.value.observe(o.value), Array.from(e.value.children).forEach((t, s) => {
|
|
430
|
+
l.value.observe(t), t.dataset.index = s;
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
const ve = (t, s, u) => {
|
|
434
|
+
var m;
|
|
435
|
+
if (t.preventDefault(), a.value = !1, t.key === "ArrowUp") {
|
|
436
|
+
const r = s % I;
|
|
437
|
+
if (!f(0, s - I)) {
|
|
438
|
+
const L = b.value.length - b.value.length % I + r;
|
|
439
|
+
f(0, L), f(0, L) || f(0, b.value.length - 1);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
if (t.key === "ArrowDown" && !f(0, s + I)) {
|
|
443
|
+
const r = s % I;
|
|
444
|
+
(m = b.value) != null && m[s + (I - r)] ? f(0, b.value.length - 1) : f(0, r);
|
|
445
|
+
}
|
|
446
|
+
t.key === "ArrowLeft" && A("left", 0, s), t.key === "ArrowRight" && A("right", 0, s), t.key === "Tab" && c("focus-skin-selector"), t.key === "Enter" && c("selected-emoji", u);
|
|
447
|
+
}, be = (t, s, u, m) => {
|
|
448
|
+
var r, L;
|
|
449
|
+
if (t.preventDefault(), t.key === "ArrowUp") {
|
|
450
|
+
const g = u % I;
|
|
451
|
+
if (s === 0) {
|
|
452
|
+
const K = I - d.value[d.value.length - 1].length % I, D = d.value[d.value.length - 1].length + K - (I - g);
|
|
453
|
+
f(d.value.length - 1, D) || f(d.value.length - 1, d.value[d.value.length - 1].length - 1);
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
if (!f(s, u - I)) {
|
|
457
|
+
const K = s - 1 < 0 ? 0 : s - 1, D = d.value[K].length, pe = D - D % I + g;
|
|
458
|
+
f(K, pe) || f(s - 1, d.value[s - 1].length - 1);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
if (t.key === "ArrowDown" && !f(s, u + I)) {
|
|
462
|
+
const g = u % I;
|
|
463
|
+
(L = (r = d.value) == null ? void 0 : r[s]) != null && L[u + (I - g)] ? f(s, d.value[s].length - 1) : f(s + 1, g) || f(0, g) || f(0, d.value[0].length - 1);
|
|
464
|
+
}
|
|
465
|
+
t.key === "ArrowLeft" && A("left", s, u), t.key === "ArrowRight" && A("right", s, u), t.key === "Tab" && (f(s + 1, 0) ? Q(s + 1 + 1, !1) : c("focus-skin-selector")), t.key === "Tab" && t.shiftKey && (f(s, 0) && s > 0 ? Q(s, !0) : (Q(1, !1), c("focus-search-input"))), t.key === "Enter" && c("selected-emoji", m);
|
|
466
|
+
};
|
|
467
|
+
function he() {
|
|
468
|
+
f(0, 0);
|
|
469
|
+
}
|
|
470
|
+
return se(() => {
|
|
471
|
+
me();
|
|
472
|
+
}), Se(() => {
|
|
473
|
+
l.value.disconnect();
|
|
474
|
+
}), k({
|
|
475
|
+
focusEmojiSelector: he
|
|
476
|
+
}), (t, s) => (y(), j("div", De, [
|
|
477
|
+
w("div", {
|
|
478
|
+
id: "d-emoji-picker-list",
|
|
479
|
+
ref_key: "listRef",
|
|
480
|
+
ref: e,
|
|
481
|
+
class: "d-emoji-picker__list"
|
|
482
|
+
}, [
|
|
483
|
+
i.emojiFilter ? (y(), j("p", Fe, Y(B.value.length > 0 ? i.searchResultsLabel : i.searchNoResultsLabel), 1)) : (y(), j("div", {
|
|
484
|
+
key: 1,
|
|
485
|
+
ref_key: "tabCategoryRef",
|
|
486
|
+
ref: o,
|
|
487
|
+
class: "d-emoji-picker__category d-emoji-picker__alignment"
|
|
488
|
+
}, [
|
|
489
|
+
w("p", null, Y(_.value), 1)
|
|
490
|
+
], 512)),
|
|
491
|
+
(y(!0), j(H, null, G(v.value, (u, m) => X((y(), j("div", {
|
|
492
|
+
key: m,
|
|
493
|
+
ref_for: !0,
|
|
494
|
+
ref: u.ref,
|
|
495
|
+
class: "d-emoji-picker__alignment"
|
|
496
|
+
}, [
|
|
497
|
+
m ? (y(), j("p", Ce, Y(u.label), 1)) : Z("", !0),
|
|
498
|
+
w("div", Me, [
|
|
499
|
+
(y(!0), j(H, null, G(T(M)[C.value[m] + i.skinTone] ? T(M)[C.value[m] + i.skinTone] : T(M)[C.value[m]], (r, L) => (y(), j("button", {
|
|
500
|
+
key: r.shortname,
|
|
501
|
+
ref_for: !0,
|
|
502
|
+
ref: (g) => {
|
|
503
|
+
g && T($)(g, m, L);
|
|
504
|
+
},
|
|
505
|
+
type: "button",
|
|
506
|
+
"aria-label": r.name,
|
|
507
|
+
onClick: (g) => t.$emit("selected-emoji", r),
|
|
508
|
+
onFocusin: (g) => t.$emit("highlighted-emoji", r),
|
|
509
|
+
onFocusout: s[0] || (s[0] = (g) => t.$emit("highlighted-emoji", null)),
|
|
510
|
+
onMouseover: (g) => t.$emit("highlighted-emoji", r),
|
|
511
|
+
onMouseleave: s[1] || (s[1] = (g) => t.$emit("highlighted-emoji", null)),
|
|
512
|
+
onKeydown: (g) => be(g, m, L, r)
|
|
513
|
+
}, [
|
|
514
|
+
w("img", {
|
|
515
|
+
class: "d-icon d-icon--size-500",
|
|
516
|
+
alt: r.name,
|
|
517
|
+
"aria-label": r.name,
|
|
518
|
+
title: r.name,
|
|
519
|
+
src: ce(r.unicode_character),
|
|
520
|
+
onError: fe
|
|
521
|
+
}, null, 40, Oe)
|
|
522
|
+
], 40, Ke))), 128))
|
|
523
|
+
])
|
|
524
|
+
])), [
|
|
525
|
+
[x, !i.emojiFilter]
|
|
526
|
+
])), 128)),
|
|
527
|
+
i.emojiFilter ? (y(), j("div", Ue, [
|
|
528
|
+
w("div", Ne, [
|
|
529
|
+
(y(!0), j(H, null, G(B.value, (u, m) => (y(), j("button", {
|
|
530
|
+
key: u.shortname,
|
|
531
|
+
ref_for: !0,
|
|
532
|
+
ref: (r) => {
|
|
533
|
+
r && T(R)(r, m);
|
|
534
|
+
},
|
|
535
|
+
type: "button",
|
|
536
|
+
"aria-label": u.name,
|
|
537
|
+
class: ie({
|
|
538
|
+
"hover-emoji": m === 0 && T(a)
|
|
539
|
+
}),
|
|
540
|
+
onClick: (r) => t.$emit("selected-emoji", u),
|
|
541
|
+
onFocusin: (r) => t.$emit("highlighted-emoji", u),
|
|
542
|
+
onFocusout: s[2] || (s[2] = (r) => t.$emit("highlighted-emoji", null)),
|
|
543
|
+
onMouseover: (r) => T(F)(u),
|
|
544
|
+
onMouseleave: s[3] || (s[3] = (r) => T(F)(null)),
|
|
545
|
+
onKeydown: (r) => ve(r, m, u)
|
|
546
|
+
}, [
|
|
547
|
+
w("img", {
|
|
548
|
+
class: "d-icon d-icon--size-500",
|
|
549
|
+
alt: u.name,
|
|
550
|
+
"aria-label": u.name,
|
|
551
|
+
title: u.name,
|
|
552
|
+
src: `${T(J) + u.unicode_character}.png`
|
|
553
|
+
}, null, 8, Ve)
|
|
554
|
+
], 42, Be))), 128))
|
|
555
|
+
])
|
|
556
|
+
])) : Z("", !0)
|
|
557
|
+
], 512)
|
|
558
|
+
]));
|
|
559
|
+
}
|
|
560
|
+
}, Pe = { "data-qa": "skin-selector" }, ze = { class: "d-emoji-picker__skin-list" }, He = ["onKeydown", "onClick"], Ge = ["alt", "aria-label", "title", "src"], Ye = { class: "d-emoji-picker__skin-selected" }, Je = ["aria-label"], Qe = ["alt", "aria-label", "title", "src"], We = {
|
|
561
|
+
__name: "emoji_skin_selector",
|
|
562
|
+
props: {
|
|
563
|
+
/**
|
|
564
|
+
* The skin tone to apply to the emoji list
|
|
565
|
+
* @type {String}
|
|
566
|
+
* @required
|
|
567
|
+
*/
|
|
568
|
+
skinTone: {
|
|
569
|
+
type: String,
|
|
570
|
+
required: !0
|
|
571
|
+
},
|
|
572
|
+
isHovering: {
|
|
573
|
+
type: Boolean,
|
|
574
|
+
default: !1
|
|
575
|
+
},
|
|
576
|
+
skinSelectorButtonTooltipLabel: {
|
|
577
|
+
type: String,
|
|
578
|
+
required: !0
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
emits: [
|
|
582
|
+
/**
|
|
583
|
+
* The skin tone that was selected
|
|
584
|
+
* @event skin-tone
|
|
585
|
+
* @type {Number}
|
|
586
|
+
*/
|
|
587
|
+
"skin-tone",
|
|
588
|
+
"focus-tabset"
|
|
589
|
+
],
|
|
590
|
+
setup(i, { expose: k, emit: E }) {
|
|
591
|
+
const n = i, c = E, d = [
|
|
592
|
+
{
|
|
593
|
+
name: ":wave_tone1:",
|
|
594
|
+
unicode_output: "1f44b-1f3fb",
|
|
595
|
+
skinTone: q.LIGHT,
|
|
596
|
+
skinCode: "_tone1"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
name: ":wave_tone2:",
|
|
600
|
+
unicode_output: "1f44b-1f3fc",
|
|
601
|
+
skinTone: q.MEDIUM_LIGHT,
|
|
602
|
+
skinCode: "_tone2"
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
name: ":wave_tone3:",
|
|
606
|
+
unicode_output: "1f44b-1f3fd",
|
|
607
|
+
skinTone: q.MEDIUM,
|
|
608
|
+
skinCode: "_tone3"
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
name: ":wave_tone4:",
|
|
612
|
+
unicode_output: "1f44b-1f3fe",
|
|
613
|
+
skinTone: q.MEDIUM_DARK,
|
|
614
|
+
skinCode: "_tone4"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
name: ":wave_tone5:",
|
|
618
|
+
unicode_output: "1f44b-1f3ff",
|
|
619
|
+
skinTone: q.DARK,
|
|
620
|
+
skinCode: "_tone5"
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
name: ":wave:",
|
|
624
|
+
unicode_output: "1f44b",
|
|
625
|
+
skinTone: q.DEFAULT,
|
|
626
|
+
skinCode: ""
|
|
627
|
+
}
|
|
628
|
+
], b = p(!1), S = p(null), a = p([]);
|
|
629
|
+
oe(
|
|
630
|
+
() => n.isHovering && (b.value = !1)
|
|
631
|
+
);
|
|
632
|
+
const $ = V(() => d.find((l) => l.skinTone === n.skinTone)), R = p($.value);
|
|
633
|
+
oe(() => $.value && (R.value = $.value));
|
|
634
|
+
function F(l) {
|
|
635
|
+
a.value.push(l);
|
|
636
|
+
}
|
|
637
|
+
function f() {
|
|
638
|
+
S.value.focus();
|
|
639
|
+
}
|
|
640
|
+
function A(l) {
|
|
641
|
+
R.value = l, b.value = !1, c("skin-tone", l.skinTone), W(() => f());
|
|
642
|
+
}
|
|
643
|
+
const o = (l, h, v) => {
|
|
644
|
+
var _, C, B;
|
|
645
|
+
l.preventDefault(), l.key === "ArrowLeft" && (v === 0 && ((_ = a.value[a.value.length - 1]) == null || _.focus()), (C = a.value[v - 1]) == null || C.focus()), l.key === "ArrowRight" && ((B = a.value[v + 1]) == null || B.focus()), l.key === "Enter" && (h ? A(h) : e()), l.key === "Tab" && c("focus-tabset");
|
|
646
|
+
};
|
|
647
|
+
function e() {
|
|
648
|
+
b.value = !b.value, W(() => a.value[0].focus());
|
|
649
|
+
}
|
|
650
|
+
return k({
|
|
651
|
+
focusSkinSelector: f
|
|
652
|
+
}), (l, h) => (y(), j("div", Pe, [
|
|
653
|
+
X(w("div", ze, [
|
|
654
|
+
(y(), j(H, null, G(d, (v, _) => w("button", {
|
|
655
|
+
ref_for: !0,
|
|
656
|
+
ref: (C) => {
|
|
657
|
+
C && F(C);
|
|
658
|
+
},
|
|
659
|
+
key: v.name,
|
|
660
|
+
class: ie({
|
|
661
|
+
selected: R.value.skinCode === v.skinCode
|
|
662
|
+
}),
|
|
663
|
+
onKeydown: (C) => o(C, v, _),
|
|
664
|
+
onClick: (C) => A(v)
|
|
665
|
+
}, [
|
|
666
|
+
w("img", {
|
|
667
|
+
class: "d-icon d-icon--size-500",
|
|
668
|
+
alt: v.name,
|
|
669
|
+
"aria-label": v.name,
|
|
670
|
+
title: v.name,
|
|
671
|
+
src: `${T(J) + v.unicode_output}.png`
|
|
672
|
+
}, null, 8, Ge)
|
|
673
|
+
], 42, He)), 64))
|
|
674
|
+
], 512), [
|
|
675
|
+
[x, b.value]
|
|
676
|
+
]),
|
|
677
|
+
X(w("div", Ye, [
|
|
678
|
+
O(T($e), { placement: "top-end" }, {
|
|
679
|
+
anchor: z(() => [
|
|
680
|
+
w("button", {
|
|
681
|
+
ref_key: "skinSelectorRef",
|
|
682
|
+
ref: S,
|
|
683
|
+
"aria-label": i.skinSelectorButtonTooltipLabel,
|
|
684
|
+
tabindex: "-1",
|
|
685
|
+
onClick: e,
|
|
686
|
+
onKeydown: h[0] || (h[0] = (v) => o(v))
|
|
687
|
+
}, [
|
|
688
|
+
w("img", {
|
|
689
|
+
class: "d-icon d-icon--size-500",
|
|
690
|
+
alt: R.value.name,
|
|
691
|
+
"aria-label": R.value.name,
|
|
692
|
+
title: R.value.name,
|
|
693
|
+
src: `${T(J) + R.value.unicode_output}.png`
|
|
694
|
+
}, null, 8, Qe)
|
|
695
|
+
], 40, Je)
|
|
696
|
+
]),
|
|
697
|
+
default: z(() => [
|
|
698
|
+
ae(Y(i.skinSelectorButtonTooltipLabel) + " ", 1)
|
|
699
|
+
]),
|
|
700
|
+
_: 1
|
|
701
|
+
})
|
|
702
|
+
], 512), [
|
|
703
|
+
[x, !b.value]
|
|
704
|
+
])
|
|
705
|
+
]));
|
|
706
|
+
}
|
|
707
|
+
}, Xe = { class: "d-emoji-picker__data" }, Ze = ["alt", "aria-label", "title", "src"], xe = {
|
|
708
|
+
__name: "emoji_description",
|
|
709
|
+
props: {
|
|
710
|
+
/**
|
|
711
|
+
* Emoji data
|
|
712
|
+
* @type {Object}
|
|
713
|
+
* @default null
|
|
714
|
+
*/
|
|
715
|
+
emoji: {
|
|
716
|
+
type: Object,
|
|
717
|
+
default: null
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
setup(i) {
|
|
721
|
+
return (k, E) => {
|
|
722
|
+
var n;
|
|
723
|
+
return y(), j("div", Xe, [
|
|
724
|
+
i.emoji ? (y(), j("img", {
|
|
725
|
+
key: 0,
|
|
726
|
+
class: "d-icon d-icon--size-500",
|
|
727
|
+
alt: i.emoji.name,
|
|
728
|
+
"aria-label": i.emoji.name,
|
|
729
|
+
title: i.emoji.name,
|
|
730
|
+
src: `${T(J) + i.emoji.unicode_character}.png`
|
|
731
|
+
}, null, 8, Ze)) : Z("", !0),
|
|
732
|
+
ae(" " + Y((n = i.emoji) == null ? void 0 : n.name), 1)
|
|
733
|
+
]);
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
}, et = { class: "d-emoji-picker" }, tt = { class: "d-emoji-picker--header" }, lt = { class: "d-emoji-picker--body" }, ot = { class: "d-emoji-picker--footer" }, at = {
|
|
737
|
+
__name: "emoji_picker",
|
|
738
|
+
props: {
|
|
739
|
+
/**
|
|
740
|
+
* The array with recently used emoji object
|
|
741
|
+
* This list is necessary to fill the recently used tab
|
|
742
|
+
* @type {Array}
|
|
743
|
+
* @default []
|
|
744
|
+
* @example
|
|
745
|
+
* <dt-emoji-picker :recentlyUsedEmojis="[emojiObject, emojiObject]" />
|
|
746
|
+
*/
|
|
747
|
+
// TODO try to simplify this to achieve an array of unicode characters and not an entire emoji data object
|
|
748
|
+
recentlyUsedEmojis: {
|
|
749
|
+
type: Array,
|
|
750
|
+
default: () => []
|
|
751
|
+
},
|
|
752
|
+
/**
|
|
753
|
+
* The placeholder text for the search input
|
|
754
|
+
* @type {String}
|
|
755
|
+
* @required
|
|
756
|
+
* @example
|
|
757
|
+
* <dt-emoji-picker :searchPlaceholderLabel="'Search...'" />
|
|
758
|
+
*/
|
|
759
|
+
searchPlaceholderLabel: {
|
|
760
|
+
type: String,
|
|
761
|
+
required: !0
|
|
762
|
+
},
|
|
763
|
+
/**
|
|
764
|
+
* The label for the search results tab
|
|
765
|
+
* @type {String}
|
|
766
|
+
* @required
|
|
767
|
+
* @example
|
|
768
|
+
* <dt-emoji-picker :searchResultsLabel="'Search results'" />
|
|
769
|
+
*/
|
|
770
|
+
searchResultsLabel: {
|
|
771
|
+
type: String,
|
|
772
|
+
required: !0
|
|
773
|
+
},
|
|
774
|
+
/**
|
|
775
|
+
* The label for the search no results
|
|
776
|
+
* @type {String}
|
|
777
|
+
* @required
|
|
778
|
+
* @example
|
|
779
|
+
* <dt-emoji-picker :searchNoResultsLabel="'No results'" />
|
|
780
|
+
*/
|
|
781
|
+
searchNoResultsLabel: {
|
|
782
|
+
type: String,
|
|
783
|
+
required: !0
|
|
784
|
+
},
|
|
785
|
+
/**
|
|
786
|
+
* The list of tabsets to show, it is necessary to be updated with the correct language
|
|
787
|
+
* It must respect the provided order.
|
|
788
|
+
* @type {Array}
|
|
789
|
+
* @required
|
|
790
|
+
* @example
|
|
791
|
+
* <dt-emoji-picker
|
|
792
|
+
* :tabSetLabels="['Most recently used', 'Smileys and people', 'Nature',
|
|
793
|
+
* 'Food', 'Activity', 'Travel', 'Objects', 'Symbols', 'Flags']" />
|
|
794
|
+
*/
|
|
795
|
+
tabSetLabels: {
|
|
796
|
+
type: Array,
|
|
797
|
+
required: !0
|
|
798
|
+
},
|
|
799
|
+
/**
|
|
800
|
+
* The skin tone to show the emojis
|
|
801
|
+
* This prop gives the possibility to use the skin tone selected by the user previously
|
|
802
|
+
* @type {String}
|
|
803
|
+
* @default 'Default'
|
|
804
|
+
* @values 'Default', 'Light', 'MediumLight', 'Medium', 'MediumDark', 'Dark'
|
|
805
|
+
* @example
|
|
806
|
+
* <dt-emoji-picker :skinTone="'Default'" />
|
|
807
|
+
*/
|
|
808
|
+
skinTone: {
|
|
809
|
+
type: String,
|
|
810
|
+
default: "Default"
|
|
811
|
+
},
|
|
812
|
+
/**
|
|
813
|
+
* Tooltip shown when skin selector button is hovered.
|
|
814
|
+
* @type {String}
|
|
815
|
+
* @required
|
|
816
|
+
* @example
|
|
817
|
+
* <dt-emoji-picker :skin-selector-button-tooltip-label="'Change default skin tone'" />
|
|
818
|
+
*/
|
|
819
|
+
skinSelectorButtonTooltipLabel: {
|
|
820
|
+
type: String,
|
|
821
|
+
required: !0
|
|
822
|
+
}
|
|
823
|
+
},
|
|
824
|
+
emits: [
|
|
825
|
+
/**
|
|
826
|
+
* It will emit the selected emoji
|
|
827
|
+
* @event selected-emoji
|
|
828
|
+
* @param {Object} emoji - The selected emoji from the emoji selector
|
|
829
|
+
*/
|
|
830
|
+
"selected-emoji",
|
|
831
|
+
/**
|
|
832
|
+
* It will emit the selected skin tone
|
|
833
|
+
* @event skin-tone
|
|
834
|
+
* @param {String} skin - The selected skin tone from the skin selector
|
|
835
|
+
*/
|
|
836
|
+
"skin-tone",
|
|
837
|
+
/**
|
|
838
|
+
* Since the keyboard events are encapsulated, we emit this event to close the picker
|
|
839
|
+
* @event close
|
|
840
|
+
*/
|
|
841
|
+
"close"
|
|
842
|
+
],
|
|
843
|
+
setup(i, { emit: k }) {
|
|
844
|
+
const E = i, n = k, c = p(""), d = p(null), b = p({}), S = p(0), a = p(!1), $ = V(() => E.recentlyUsedEmojis.length > 0);
|
|
845
|
+
function R(o) {
|
|
846
|
+
c.value = "", b.value = o, b.value = { ...b.value, tabId: o };
|
|
847
|
+
}
|
|
848
|
+
function F(o) {
|
|
849
|
+
S.value = o;
|
|
850
|
+
}
|
|
851
|
+
function f(o) {
|
|
852
|
+
a.value = o;
|
|
853
|
+
}
|
|
854
|
+
function A(o) {
|
|
855
|
+
d.value = o;
|
|
856
|
+
}
|
|
857
|
+
return (o, e) => (y(), j("div", et, [
|
|
858
|
+
w("div", tt, [
|
|
859
|
+
O(Ie, {
|
|
860
|
+
ref: "tabsetRef",
|
|
861
|
+
"emoji-filter": c.value,
|
|
862
|
+
"show-recently-used-tab": $.value,
|
|
863
|
+
"scroll-into-tab": S.value,
|
|
864
|
+
"tabset-labels": i.tabSetLabels,
|
|
865
|
+
"is-scrolling": a.value,
|
|
866
|
+
onFocusSearchInput: e[0] || (e[0] = (l) => o.$refs.searchInputRef.focusSearchInput()),
|
|
867
|
+
onSelectedTabset: R,
|
|
868
|
+
onKeydown: e[1] || (e[1] = N((l) => n("close"), ["esc"]))
|
|
869
|
+
}, null, 8, ["emoji-filter", "show-recently-used-tab", "scroll-into-tab", "tabset-labels", "is-scrolling"])
|
|
870
|
+
]),
|
|
871
|
+
w("div", lt, [
|
|
872
|
+
O(Ee, {
|
|
873
|
+
ref: "searchInputRef",
|
|
874
|
+
modelValue: c.value,
|
|
875
|
+
"onUpdate:modelValue": e[2] || (e[2] = (l) => c.value = l),
|
|
876
|
+
"search-placeholder-label": i.searchPlaceholderLabel,
|
|
877
|
+
onSelectFirstEmoji: e[3] || (e[3] = (l) => n("selected-emoji", d.value)),
|
|
878
|
+
onFocusTabset: e[4] || (e[4] = (l) => o.$refs.tabsetRef.focusTabset()),
|
|
879
|
+
onFocusEmojiSelector: e[5] || (e[5] = (l) => o.$refs.emojiSelectorRef.focusEmojiSelector()),
|
|
880
|
+
onKeydown: e[6] || (e[6] = N((l) => n("close"), ["esc"]))
|
|
881
|
+
}, null, 8, ["modelValue", "search-placeholder-label"]),
|
|
882
|
+
O(qe, {
|
|
883
|
+
ref: "emojiSelectorRef",
|
|
884
|
+
"emoji-filter": c.value,
|
|
885
|
+
"skin-tone": i.skinTone,
|
|
886
|
+
"tabset-labels": i.tabSetLabels,
|
|
887
|
+
"search-results-label": i.searchResultsLabel,
|
|
888
|
+
"search-no-results-label": i.searchNoResultsLabel,
|
|
889
|
+
"recently-used-emojis": i.recentlyUsedEmojis,
|
|
890
|
+
"selected-tabset": b.value,
|
|
891
|
+
onScrollIntoTab: F,
|
|
892
|
+
onIsScrolling: f,
|
|
893
|
+
onHighlightedEmoji: A,
|
|
894
|
+
onSelectedEmoji: e[7] || (e[7] = (l) => n("selected-emoji", l)),
|
|
895
|
+
onFocusSkinSelector: e[8] || (e[8] = (l) => o.$refs.skinSelectorRef.focusSkinSelector()),
|
|
896
|
+
onFocusSearchInput: e[9] || (e[9] = (l) => o.$refs.searchInputRef.focusSearchInput()),
|
|
897
|
+
onKeydown: e[10] || (e[10] = N((l) => n("close"), ["esc"]))
|
|
898
|
+
}, null, 8, ["emoji-filter", "skin-tone", "tabset-labels", "search-results-label", "search-no-results-label", "recently-used-emojis", "selected-tabset"])
|
|
899
|
+
]),
|
|
900
|
+
w("div", ot, [
|
|
901
|
+
O(xe, { emoji: d.value }, null, 8, ["emoji"]),
|
|
902
|
+
O(We, {
|
|
903
|
+
ref: "skinSelectorRef",
|
|
904
|
+
"is-hovering": !!d.value,
|
|
905
|
+
"skin-selector-button-tooltip-label": i.skinSelectorButtonTooltipLabel,
|
|
906
|
+
"skin-tone": i.skinTone,
|
|
907
|
+
onSkinTone: e[11] || (e[11] = (l) => n("skin-tone", l)),
|
|
908
|
+
onFocusTabset: e[12] || (e[12] = (l) => o.$refs.tabsetRef.focusTabset()),
|
|
909
|
+
onKeydown: e[13] || (e[13] = N((l) => n("close"), ["esc"]))
|
|
910
|
+
}, null, 8, ["is-hovering", "skin-selector-button-tooltip-label", "skin-tone"])
|
|
911
|
+
])
|
|
912
|
+
]));
|
|
913
|
+
}
|
|
914
|
+
};
|
|
915
|
+
export {
|
|
916
|
+
J as C,
|
|
917
|
+
I as E,
|
|
918
|
+
at as _,
|
|
919
|
+
q as a,
|
|
920
|
+
U as b
|
|
921
|
+
};
|