@nmorph/nmorph-ui-kit 2.2.44 → 2.2.46

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.
@@ -1,23 +1,28 @@
1
1
  import './NmorphEmojiPicker.css';
2
- import { defineComponent as Le, ref as C, computed as i, watch as Q, openBlock as c, createElementBlock as u, normalizeStyle as xe, normalizeClass as ae, createElementVNode as y, Fragment as z, renderList as B, toDisplayString as E, createVNode as _, unref as k, withCtx as q, withDirectives as Ce, vModelText as Ee, createCommentVNode as J, nextTick as we } from "vue";
3
- import { useModifiers as Se } from "../../../utils/create-modifiers.js";
4
- import { createCssSizeVariables as Ae } from "../../../utils/common.js";
5
- import D from "../../basic/nmorph-icon/NmorphIcon.vue.js";
2
+ import { defineComponent as we, ref as S, computed as s, watch as Q, openBlock as c, createElementBlock as d, normalizeStyle as Se, normalizeClass as J, createBlock as le, unref as f, withModifiers as Ce, withCtx as v, createVNode as k, createElementVNode as L, toDisplayString as E, createCommentVNode as W, Fragment as O, renderList as $, nextTick as Ae } from "vue";
3
+ import { useModifiers as Ke } from "../../../utils/create-modifiers.js";
4
+ import { createCssSizeVariables as Me } from "../../../utils/common.js";
5
+ import Ne from "../../form/nmorph-checkbox/NmorphCheckbox.vue.js";
6
+ /* empty css */
7
+ import X from "../../basic/nmorph-icon/NmorphIcon.vue.js";
6
8
  /* empty css */
7
- import Ke from "../../../assets/icons/search.svg.js";
8
- import Ne from "../../../assets/icons/chevron-up.svg.js";
9
- import Me from "../../../assets/icons/smile.svg.js";
10
- import Ie from "../../../assets/icons/chevron-down.svg.js";
11
- const Oe = ["lang"], ze = ["aria-label"], Be = { class: "nmorph-emoji-picker__quick-list" }, qe = ["aria-label", "title", "disabled", "onClick"], De = ["aria-label", "title", "disabled"], Ve = {
12
- key: 1,
9
+ import ze from "../../../assets/icons/burger.svg.js";
10
+ import Y from "../../basic/nmorph-scroll/NmorphScroll.vue.js";
11
+ /* empty css */
12
+ import Be from "../../form/nmorph-text-input/NmorphTextInput.vue.js";
13
+ /* empty css */
14
+ import Ie from "../../../assets/icons/search.svg.js";
15
+ import Oe from "../../../assets/icons/smile.svg.js";
16
+ const $e = ["lang"], Ve = { class: "nmorph-emoji-picker__button-label" }, qe = ["aria-label"], De = ["aria-label", "title", "disabled", "onClick"], Te = {
17
+ key: 2,
13
18
  class: "nmorph-emoji-picker__panel"
14
- }, Te = { class: "nmorph-emoji-picker__toolbar" }, $e = ["aria-label"], Fe = ["placeholder", "aria-label", "disabled"], Re = ["aria-label", "title", "disabled"], He = ["aria-label"], Pe = ["aria-selected", "disabled", "onClick"], Ue = ["aria-label"], Qe = {
19
+ }, Fe = { class: "nmorph-emoji-picker__toolbar" }, Re = ["aria-selected", "disabled", "onClick"], He = ["aria-label"], Pe = {
15
20
  key: 0,
16
21
  class: "nmorph-emoji-picker__section-title"
17
- }, Je = { class: "nmorph-emoji-picker__grid" }, We = ["aria-label", "title", "disabled", "onFocus", "onClick"], Xe = { class: "nmorph-emoji-picker__emoji-symbol" }, Ye = {
22
+ }, Ue = { class: "nmorph-emoji-picker__grid" }, Qe = ["aria-label", "title", "disabled", "onFocus", "onClick"], Je = { class: "nmorph-emoji-picker__emoji-symbol" }, We = {
18
23
  key: 1,
19
24
  class: "nmorph-emoji-picker__empty"
20
- }, st = /* @__PURE__ */ Le({
25
+ }, uo = /* @__PURE__ */ we({
21
26
  __name: "NmorphEmojiPicker",
22
27
  props: {
23
28
  language: { default: "en" },
@@ -31,8 +36,8 @@ const Oe = ["lang"], ze = ["aria-label"], Be = { class: "nmorph-emoji-picker__qu
31
36
  disabled: { type: Boolean, default: !1 }
32
37
  },
33
38
  emits: ["select", "expand", "collapse"],
34
- setup(ne, { emit: le }) {
35
- const l = ne, V = le, T = C(""), L = C(l.initialExpanded), h = C(""), w = C(0), W = C(null), se = {
39
+ setup(ie, { emit: se }) {
40
+ const l = ie, V = se, q = S(""), b = S(l.initialExpanded), y = S(""), C = S(0), Z = S(null), ce = {
36
41
  searchPlaceholder: "Search emoji",
37
42
  searchLabel: "Search emoji",
38
43
  quickLabel: "Frequent emoji",
@@ -41,331 +46,360 @@ const Oe = ["lang"], ze = ["aria-label"], Be = { class: "nmorph-emoji-picker__qu
41
46
  noResults: "No emoji found",
42
47
  categoryLabel: "Emoji categories",
43
48
  resultsLabel: "Emoji results"
44
- }, g = (e) => !!e && typeof e == "object" && !Array.isArray(e), X = (e) => e.trim().toLocaleLowerCase(l.language || void 0), f = (e, t) => {
45
- for (const o of t) {
46
- const r = e[o];
47
- if (typeof r == "string" && r.trim()) return r.trim();
48
- if (typeof r == "number") return String(r);
49
+ }, _ = (e) => !!e && typeof e == "object" && !Array.isArray(e), G = (e) => e.trim().toLocaleLowerCase(l.language || void 0), g = (e, o) => {
50
+ for (const r of o) {
51
+ const t = e[r];
52
+ if (typeof t == "string" && t.trim()) return t.trim();
53
+ if (typeof t == "number") return String(t);
49
54
  }
50
55
  return "";
51
- }, S = (e) => Array.isArray(e) ? e.flatMap(S) : typeof e == "string" ? e.trim() ? [e.trim()] : [] : typeof e == "number" ? [String(e)] : g(e) ? Object.values(e).flatMap(S) : [], A = (e, t, o) => {
52
- for (const r of t) {
53
- const n = e[r], a = typeof n == "number" ? n : Number(n);
56
+ }, A = (e) => Array.isArray(e) ? e.flatMap(A) : typeof e == "string" ? e.trim() ? [e.trim()] : [] : typeof e == "number" ? [String(e)] : _(e) ? Object.values(e).flatMap(A) : [], K = (e, o, r) => {
57
+ for (const t of o) {
58
+ const n = e[t], a = typeof n == "number" ? n : Number(n);
54
59
  if (Number.isFinite(a)) return a;
55
60
  }
56
- return o;
57
- }, Y = (e, t) => {
58
- for (const o of t) {
59
- const r = e[o];
60
- if (Array.isArray(r)) return r;
61
+ return r;
62
+ }, ee = (e, o) => {
63
+ for (const r of o) {
64
+ const t = e[r];
65
+ if (Array.isArray(t)) return t;
61
66
  }
62
- }, K = (e) => {
67
+ }, M = (e) => {
63
68
  if (typeof e == "string") return e.trim();
64
- if (!g(e)) return "";
65
- const t = f(e, ["emoji", "native", "char", "unicode", "value"]);
66
- if (t) return t;
67
- const o = Y(e, ["skinToneVariants", "skins", "variants"])?.[0];
68
- return K(o);
69
- }, ie = (e) => !!K(e), ce = (e) => Array.isArray(e) ? e.map((t) => {
70
- const o = K(t);
71
- if (!o) return null;
72
- if (typeof t == "string") return { emoji: o };
73
- const r = g(t) ? t : {};
69
+ if (!_(e)) return "";
70
+ const o = g(e, ["emoji", "native", "char", "unicode", "value"]);
71
+ if (o) return o;
72
+ const r = ee(e, ["skinToneVariants", "skins", "variants"])?.[0];
73
+ return M(r);
74
+ }, ue = (e) => !!M(e), pe = (e) => Array.isArray(e) ? e.map((o) => {
75
+ const r = M(o);
76
+ if (!r) return null;
77
+ if (typeof o == "string") return { emoji: r };
78
+ const t = _(o) ? o : {};
74
79
  return {
75
- emoji: o,
76
- annotation: f(r, ["annotation", "label", "name", "description"]),
77
- tags: S(r.tags || r.keywords || r.aliases || r.shortcodes),
78
- tone: f(r, ["tone", "skinTone", "skin_tone"])
80
+ emoji: r,
81
+ annotation: g(t, ["annotation", "label", "name", "description"]),
82
+ tags: A(t.tags || t.keywords || t.aliases || t.shortcodes),
83
+ tone: g(t, ["tone", "skinTone", "skin_tone"])
79
84
  };
80
- }).filter((t) => !!t) : [], ue = (e, t, o) => {
81
- if (!g(e))
85
+ }).filter((o) => !!o) : [], de = (e, o, r) => {
86
+ if (!_(e))
82
87
  return {
83
- key: t,
84
- label: t,
85
- sort: o
88
+ key: o,
89
+ label: o,
90
+ sort: r
86
91
  };
87
- const r = f(e, ["group", "category", "groupName", "categoryName"]) || t, n = f(e, ["groupLabel", "categoryLabel"]) || r, a = A(e, ["groupOrder", "categoryOrder"], Number(r));
92
+ const t = g(e, ["group", "category", "groupName", "categoryName"]) || o, n = g(e, ["groupLabel", "categoryLabel"]) || t, a = K(e, ["groupOrder", "categoryOrder"], Number(t));
88
93
  return {
89
- key: r,
94
+ key: t,
90
95
  label: n,
91
- sort: Number.isFinite(a) ? a : o
96
+ sort: Number.isFinite(a) ? a : r
92
97
  };
93
- }, de = (e, t, o, r, n) => {
94
- const a = K(e);
98
+ }, me = (e, o, r, t, n) => {
99
+ const a = M(e);
95
100
  if (!a) return null;
96
- const s = g(e) ? e : {}, d = ue(s, t, r), m = f(s, ["annotation", "label", "name", "description"]) || a, b = S(s.tags || s.keywords || s.aliases || s.shortcodes), M = A(s, ["order", "sortOrder", "sort_order", "index"], n), U = s.skinToneVariants || s.skins || s.variants, I = ce(U).filter((O) => O.emoji !== a), x = d.key || t, re = d.label || o || x, je = X(
97
- [a, m, re, ...b, ...I.map((O) => O.annotation || O.emoji)].filter(Boolean).join(" ")
101
+ const i = _(e) ? e : {}, p = de(i, o, t), m = g(i, ["annotation", "label", "name", "description"]) || a, h = A(i.tags || i.keywords || i.aliases || i.shortcodes), z = K(i, ["order", "sortOrder", "sort_order", "index"], n), U = i.skinToneVariants || i.skins || i.variants, B = pe(U).filter((I) => I.emoji !== a), w = p.key || o, ne = p.label || r || w, Ee = G(
102
+ [a, m, ne, ...h, ...B.map((I) => I.annotation || I.emoji)].filter(Boolean).join(" ")
98
103
  );
99
104
  return {
100
- key: `${x}-${M}-${a}`,
105
+ key: `${w}-${z}-${a}`,
101
106
  emoji: a,
102
107
  annotation: m,
103
- tags: b,
104
- groupKey: x,
105
- groupLabel: re,
106
- groupSort: d.sort,
107
- order: M,
108
- skinToneVariants: I,
109
- searchText: je
108
+ tags: h,
109
+ groupKey: w,
110
+ groupLabel: ne,
111
+ groupSort: p.sort,
112
+ order: z,
113
+ skinToneVariants: B,
114
+ searchText: Ee
110
115
  };
111
- }, $ = (e) => {
112
- if (!(!g(e) || ie(e)))
113
- return Y(e, ["emojis", "items", "children", "data"]);
114
- }, pe = (e) => {
115
- const t = [], o = (n, a = "emoji", s = a, d = 0, m = t.length) => {
116
- const b = de(
116
+ }, D = (e) => {
117
+ if (!(!_(e) || ue(e)))
118
+ return ee(e, ["emojis", "items", "children", "data"]);
119
+ }, he = (e) => {
120
+ const o = [], r = (n, a = "emoji", i = a, p = 0, m = o.length) => {
121
+ const h = me(
117
122
  n,
118
123
  a,
119
- s,
120
- d,
124
+ i,
125
+ p,
121
126
  m
122
127
  );
123
- b && t.push(b);
124
- }, r = (n, a, s) => {
125
- const d = $(n);
126
- if (!d) {
127
- o(n, "emoji", "emoji", 0, s);
128
+ h && o.push(h);
129
+ }, t = (n, a, i) => {
130
+ const p = D(n);
131
+ if (!p) {
132
+ r(n, "emoji", "emoji", 0, i);
128
133
  return;
129
134
  }
130
- const m = g(n) ? n : {}, b = f(m, ["group", "category", "name", "label"]) || a, M = f(m, ["label", "name", "title", "groupLabel", "categoryLabel"]) || b, U = A(m, ["order", "groupOrder", "categoryOrder"], s);
131
- d.forEach((I, x) => o(I, b, M, U, x));
135
+ const m = _(n) ? n : {}, h = g(m, ["group", "category", "name", "label"]) || a, z = g(m, ["label", "name", "title", "groupLabel", "categoryLabel"]) || h, U = K(m, ["order", "groupOrder", "categoryOrder"], i);
136
+ p.forEach((B, w) => r(B, h, z, U, w));
132
137
  };
133
138
  if (Array.isArray(e))
134
139
  e.forEach((n, a) => {
135
- $(n) ? r(n, `group-${a + 1}`, a) : o(n, "emoji", "emoji", 0, a);
140
+ D(n) ? t(n, `group-${a + 1}`, a) : r(n, "emoji", "emoji", 0, a);
136
141
  });
137
- else if (g(e)) {
138
- const n = $(e);
142
+ else if (_(e)) {
143
+ const n = D(e);
139
144
  if (n) {
140
- const a = f(e, ["group", "category", "name", "label"]) || "emoji", s = f(e, ["label", "name", "title", "groupLabel", "categoryLabel"]) || a, d = A(e, ["order", "groupOrder", "categoryOrder"], 0);
141
- n.forEach((m, b) => o(m, a, s, d, b));
145
+ const a = g(e, ["group", "category", "name", "label"]) || "emoji", i = g(e, ["label", "name", "title", "groupLabel", "categoryLabel"]) || a, p = K(e, ["order", "groupOrder", "categoryOrder"], 0);
146
+ n.forEach((m, h) => r(m, a, i, p, h));
142
147
  } else
143
- Object.entries(e).forEach(([a, s], d) => {
144
- Array.isArray(s) ? s.forEach((m, b) => o(m, a, a, d, b)) : r(s, a, d);
148
+ Object.entries(e).forEach(([a, i], p) => {
149
+ Array.isArray(i) ? i.forEach((m, h) => r(m, a, a, p, h)) : t(i, a, p);
145
150
  });
146
151
  }
147
- return t.sort((n, a) => n.groupSort !== a.groupSort ? n.groupSort - a.groupSort : n.order - a.order);
148
- }, p = i(() => ({
149
- ...se,
152
+ return o.sort((n, a) => n.groupSort !== a.groupSort ? n.groupSort - a.groupSort : n.order - a.order);
153
+ }, u = s(() => ({
154
+ ...ce,
150
155
  ...l.i18n
151
- })), Z = i(() => ({
156
+ })), oe = s(() => ({
152
157
  ...l.i18n?.categories || {},
153
158
  ...l.i18n?.categoryLabels || {}
154
- })), v = i(() => pe(l.dataSource)), me = i(() => {
159
+ })), j = s(() => he(l.dataSource)), be = s(() => {
155
160
  const e = /* @__PURE__ */ new Map();
156
- return v.value.forEach((t) => e.set(t.emoji, t.annotation || t.emoji)), e;
157
- }), F = i(() => Array.from(new Set(l.quickList.map((e) => e.trim()).filter(Boolean)))), G = i(() => !L.value && F.value.length > 0), j = i(() => X(T.value)), N = i(() => {
161
+ return j.value.forEach((o) => e.set(o.emoji, o.annotation || o.emoji)), e;
162
+ }), T = s(() => Array.from(new Set(l.quickList.map((e) => e.trim()).filter(Boolean)))), re = s(() => !b.value && T.value.length > 0), x = s(() => G(q.value)), N = s(() => {
158
163
  const e = /* @__PURE__ */ new Map();
159
- return v.value.forEach((t) => {
160
- e.has(t.groupKey) || e.set(t.groupKey, {
161
- key: t.groupKey,
162
- label: Z.value[t.groupKey] || t.groupLabel,
163
- sort: t.groupSort
164
+ return j.value.forEach((o) => {
165
+ e.has(o.groupKey) || e.set(o.groupKey, {
166
+ key: o.groupKey,
167
+ label: oe.value[o.groupKey] || o.groupLabel,
168
+ sort: o.groupSort
164
169
  });
165
- }), Array.from(e.values()).sort((t, o) => t.sort - o.sort);
170
+ }), Array.from(e.values()).sort((o, r) => o.sort - r.sort);
166
171
  });
167
172
  Q(
168
173
  N,
169
174
  (e) => {
170
175
  if (!e.length) {
171
- h.value = "";
176
+ y.value = "";
172
177
  return;
173
178
  }
174
- e.some((t) => t.key === h.value) || (h.value = e[0].key);
179
+ e.some((o) => o.key === y.value) || (y.value = e[0].key);
175
180
  },
176
181
  { immediate: !0 }
177
182
  ), Q(
178
183
  () => l.initialExpanded,
179
184
  (e) => {
180
- L.value = e;
185
+ b.value = e;
181
186
  }
182
- ), Q([j, h], () => {
183
- w.value = 0;
187
+ ), Q([x, y], () => {
188
+ C.value = 0;
184
189
  });
185
- const be = i(() => j.value ? v.value.filter((e) => e.searchText.includes(j.value)) : h.value ? v.value.filter((e) => e.groupKey === h.value) : v.value), R = i(() => {
190
+ const fe = s(() => x.value ? j.value.filter((e) => e.searchText.includes(x.value)) : y.value ? j.value.filter((e) => e.groupKey === y.value) : j.value), F = s(() => {
186
191
  const e = /* @__PURE__ */ new Map();
187
- return be.value.forEach((t) => {
188
- const o = Z.value[t.groupKey] || t.groupLabel, r = e.get(t.groupKey) || {
189
- key: t.groupKey,
190
- label: o,
192
+ return fe.value.forEach((o) => {
193
+ const r = oe.value[o.groupKey] || o.groupLabel, t = e.get(o.groupKey) || {
194
+ key: o.groupKey,
195
+ label: r,
191
196
  items: []
192
197
  };
193
- r.items.push(t), e.set(t.groupKey, r);
198
+ t.items.push(o), e.set(o.groupKey, t);
194
199
  }), Array.from(e.values());
195
- }), H = i(() => R.value.flatMap((e) => e.items)), he = i(
196
- () => N.value.find((e) => e.key === h.value)?.label || p.value.resultsLabel
197
- ), fe = i(() => j.value ? p.value.resultsLabel : he.value), ee = i(() => !l.initialExpanded && F.value.length > 0), ye = i(
198
- () => Se({
200
+ }), R = s(() => F.value.flatMap((e) => e.items)), ye = s(
201
+ () => N.value.find((e) => e.key === y.value)?.label || u.value.resultsLabel
202
+ ), ge = s(() => x.value ? u.value.resultsLabel : ye.value), H = s(() => !l.initialExpanded && T.value.length > 0), ke = s(
203
+ () => Ke({
199
204
  "nmorph-emoji-picker": [
200
- G.value && "compact",
201
- L.value && "expanded",
205
+ re.value && "compact",
206
+ b.value && "expanded",
207
+ H.value && "collapsible",
202
208
  l.disabled && "disabled",
203
- !v.value.length && "empty"
209
+ !j.value.length && "empty"
204
210
  ]
205
211
  })
206
- ), ge = i(() => ({
207
- ...Ae({
212
+ ), _e = s(() => ({
213
+ ...Me({
208
214
  "--nmorph-emoji-picker-width": l.width,
209
215
  "--nmorph-emoji-picker-height": l.height
210
216
  }),
211
217
  "--nmorph-emoji-picker-columns": Math.max(1, Math.floor(l.columns))
212
- })), te = (e) => me.value.get(e) || e, oe = (e) => {
218
+ })), te = (e) => be.value.get(e) || e, ae = (e) => {
213
219
  l.disabled || V("select", e);
214
- }, _e = () => {
215
- l.disabled || (L.value = !0, V("expand"));
216
- }, ke = () => {
217
- l.disabled || !ee.value || (L.value = !1, V("collapse"));
220
+ }, ve = () => {
221
+ l.disabled || (b.value = !0, V("expand"));
222
+ }, je = () => {
223
+ l.disabled || !H.value || (b.value = !1, V("collapse"));
224
+ }, xe = (e) => {
225
+ if (e) {
226
+ ve();
227
+ return;
228
+ }
229
+ je();
218
230
  }, P = async (e) => {
219
- const t = W.value?.querySelectorAll(".nmorph-emoji-picker__emoji");
220
- if (!t?.length) return;
221
- const o = Math.min(Math.max(e, 0), t.length - 1);
222
- w.value = o, await we(), t[o]?.focus();
223
- }, ve = (e) => {
224
- if (l.disabled || !H.value.length || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;
225
- const t = Math.max(1, Math.floor(l.columns)), o = H.value.length - 1, r = {
231
+ const o = Z.value?.querySelectorAll(".nmorph-emoji-picker__emoji");
232
+ if (!o?.length) return;
233
+ const r = Math.min(Math.max(e, 0), o.length - 1);
234
+ C.value = r, await Ae(), o[r]?.focus();
235
+ }, Le = (e) => {
236
+ if (l.disabled || !R.value.length || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;
237
+ const o = Math.max(1, Math.floor(l.columns)), r = R.value.length - 1, t = {
226
238
  ArrowRight: 1,
227
239
  ArrowLeft: -1,
228
- ArrowDown: t,
229
- ArrowUp: -t
240
+ ArrowDown: o,
241
+ ArrowUp: -o
230
242
  };
231
- e.key in r && (e.preventDefault(), P(w.value + r[e.key])), e.key === "Home" && (e.preventDefault(), P(0)), e.key === "End" && (e.preventDefault(), P(o));
243
+ e.key in t && (e.preventDefault(), P(C.value + t[e.key])), e.key === "Home" && (e.preventDefault(), P(0)), e.key === "End" && (e.preventDefault(), P(r));
232
244
  };
233
- return (e, t) => (c(), u("div", {
234
- class: ae(ye.value),
235
- style: xe(ge.value),
245
+ return (e, o) => (c(), d("div", {
246
+ class: J(ke.value),
247
+ style: Se(_e.value),
236
248
  lang: l.language
237
249
  }, [
238
- G.value ? (c(), u("div", {
250
+ H.value ? (c(), le(f(Ne), {
239
251
  key: 0,
252
+ class: J(["nmorph-emoji-picker__toggle-button nmorph-emoji-picker__expand-button", { "nmorph-emoji-picker__collapse-button": b.value }]),
253
+ design: "button",
254
+ "model-value": b.value,
255
+ "aria-label": b.value ? u.value.collapseLabel : u.value.expandLabel,
256
+ title: b.value ? u.value.collapseLabel : u.value.expandLabel,
257
+ disabled: l.disabled,
258
+ onClick: o[0] || (o[0] = Ce((r) => xe(!b.value), ["prevent"]))
259
+ }, {
260
+ label: v(() => [
261
+ k(f(X), { size: "small" }, {
262
+ default: v(() => [
263
+ k(f(ze))
264
+ ]),
265
+ _: 1
266
+ }),
267
+ L("span", Ve, E(b.value ? u.value.collapseLabel : u.value.expandLabel), 1)
268
+ ]),
269
+ _: 1
270
+ }, 8, ["class", "model-value", "aria-label", "title", "disabled"])) : W("", !0),
271
+ re.value ? (c(), d("div", {
272
+ key: 1,
240
273
  class: "nmorph-emoji-picker__compact",
241
274
  role: "group",
242
- "aria-label": p.value.quickLabel
275
+ "aria-label": u.value.quickLabel
243
276
  }, [
244
- y("div", Be, [
245
- (c(!0), u(z, null, B(F.value, (o) => (c(), u("button", {
246
- key: o,
247
- type: "button",
248
- class: "nmorph-emoji-picker__quick-button",
249
- "aria-label": te(o),
250
- title: te(o),
277
+ k(f(Y), {
278
+ class: "nmorph-emoji-picker__quick-list",
279
+ height: "calc(var(--nmorph-emoji-picker-cell-size) + var(--nmorph-emoji-picker-scrollbar-size))",
280
+ "max-height": "calc(var(--nmorph-emoji-picker-cell-size) + var(--nmorph-emoji-picker-scrollbar-size))",
281
+ "scroll-y-prop": "hidden",
282
+ "scroll-x-prop": "auto",
283
+ "css-scroll-behavior": "auto",
284
+ "x-bar-width-in-px": 6
285
+ }, {
286
+ default: v(() => [
287
+ (c(!0), d(O, null, $(T.value, (r) => (c(), d("button", {
288
+ key: r,
289
+ type: "button",
290
+ class: "nmorph-emoji-picker__quick-button",
291
+ "aria-label": te(r),
292
+ title: te(r),
293
+ disabled: l.disabled,
294
+ onClick: (t) => ae(r)
295
+ }, E(r), 9, De))), 128))
296
+ ]),
297
+ _: 1
298
+ })
299
+ ], 8, qe)) : (c(), d("div", Te, [
300
+ L("div", Fe, [
301
+ k(f(Be), {
302
+ modelValue: q.value,
303
+ "onUpdate:modelValue": o[1] || (o[1] = (r) => q.value = r),
304
+ class: "nmorph-emoji-picker__search",
305
+ placeholder: u.value.searchPlaceholder,
251
306
  disabled: l.disabled,
252
- onClick: (r) => oe(o)
253
- }, E(o), 9, qe))), 128))
254
- ]),
255
- y("button", {
256
- type: "button",
257
- class: "nmorph-emoji-picker__expand-button",
258
- "aria-label": p.value.expandLabel,
259
- title: p.value.expandLabel,
260
- disabled: l.disabled,
261
- onClick: _e
262
- }, [
263
- _(k(D), { size: "small" }, {
264
- default: q(() => [
265
- _(k(Ie))
307
+ "input-attrs": {
308
+ class: "nmorph-emoji-picker__search-input",
309
+ role: "searchbox",
310
+ "aria-label": u.value.searchLabel
311
+ }
312
+ }, {
313
+ "prepend-icon": v(() => [
314
+ k(f(X), { size: "small" }, {
315
+ default: v(() => [
316
+ k(f(Ie))
317
+ ]),
318
+ _: 1
319
+ })
266
320
  ]),
267
321
  _: 1
268
- })
269
- ], 8, De)
270
- ], 8, ze)) : (c(), u("div", Ve, [
271
- y("div", Te, [
272
- y("label", {
273
- class: "nmorph-emoji-picker__search",
274
- "aria-label": p.value.searchLabel
275
- }, [
276
- _(k(D), {
277
- size: "small",
278
- class: "nmorph-emoji-picker__search-icon"
279
- }, {
280
- default: q(() => [
281
- _(k(Ke))
282
- ]),
283
- _: 1
284
- }),
285
- Ce(y("input", {
286
- "onUpdate:modelValue": t[0] || (t[0] = (o) => T.value = o),
287
- class: "nmorph-emoji-picker__search-input",
288
- type: "search",
289
- placeholder: p.value.searchPlaceholder,
290
- "aria-label": p.value.searchLabel,
291
- disabled: l.disabled
292
- }, null, 8, Fe), [
293
- [Ee, T.value]
294
- ])
295
- ], 8, $e),
296
- ee.value ? (c(), u("button", {
297
- key: 0,
298
- type: "button",
299
- class: "nmorph-emoji-picker__collapse-button",
300
- "aria-label": p.value.collapseLabel,
301
- title: p.value.collapseLabel,
302
- disabled: l.disabled,
303
- onClick: ke
304
- }, [
305
- _(k(D), { size: "small" }, {
306
- default: q(() => [
307
- _(k(Ne))
308
- ]),
309
- _: 1
310
- })
311
- ], 8, Re)) : J("", !0)
322
+ }, 8, ["modelValue", "placeholder", "disabled", "input-attrs"])
312
323
  ]),
313
- N.value.length && !j.value ? (c(), u("div", {
324
+ N.value.length && !x.value ? (c(), le(f(Y), {
314
325
  key: 0,
315
326
  class: "nmorph-emoji-picker__categories",
327
+ height: "40px",
328
+ "max-height": "40px",
329
+ "scroll-y-prop": "hidden",
330
+ "scroll-x-prop": "auto",
331
+ "css-scroll-behavior": "auto",
332
+ "x-bar-width-in-px": 6,
333
+ "x-gap-in-px": 6,
316
334
  role: "tablist",
317
- "aria-label": p.value.categoryLabel
318
- }, [
319
- (c(!0), u(z, null, B(N.value, (o) => (c(), u("button", {
320
- key: o.key,
321
- type: "button",
322
- class: ae(["nmorph-emoji-picker__category", { "nmorph-emoji-picker__category--active": o.key === h.value }]),
323
- role: "tab",
324
- "aria-selected": o.key === h.value,
325
- disabled: l.disabled,
326
- onClick: (r) => h.value = o.key
327
- }, E(o.label), 11, Pe))), 128))
328
- ], 8, He)) : J("", !0),
329
- y("div", {
330
- ref_key: "gridRef",
331
- ref: W,
335
+ "aria-label": u.value.categoryLabel
336
+ }, {
337
+ default: v(() => [
338
+ (c(!0), d(O, null, $(N.value, (r) => (c(), d("button", {
339
+ key: r.key,
340
+ type: "button",
341
+ class: J(["nmorph-emoji-picker__category", { "nmorph-emoji-picker__category--active": r.key === y.value }]),
342
+ role: "tab",
343
+ "aria-selected": r.key === y.value,
344
+ disabled: l.disabled,
345
+ onClick: (t) => y.value = r.key
346
+ }, E(r.label), 11, Re))), 128))
347
+ ]),
348
+ _: 1
349
+ }, 8, ["aria-label"])) : W("", !0),
350
+ k(f(Y), {
332
351
  class: "nmorph-emoji-picker__body",
333
- "aria-label": fe.value,
334
- onKeydown: ve
335
- }, [
336
- R.value.length ? (c(!0), u(z, { key: 0 }, B(R.value, (o) => (c(), u("section", {
337
- key: o.key,
338
- class: "nmorph-emoji-picker__section"
339
- }, [
340
- j.value ? (c(), u("div", Qe, E(o.label), 1)) : J("", !0),
341
- y("div", Je, [
342
- (c(!0), u(z, null, B(o.items, (r) => (c(), u("button", {
352
+ height: "100%",
353
+ "max-height": "100%",
354
+ "scroll-x-prop": "hidden",
355
+ "scroll-y-prop": "auto",
356
+ "css-scroll-behavior": "auto",
357
+ "y-bar-width-in-px": 8
358
+ }, {
359
+ default: v(() => [
360
+ L("div", {
361
+ ref_key: "gridRef",
362
+ ref: Z,
363
+ class: "nmorph-emoji-picker__body-content",
364
+ "aria-label": ge.value,
365
+ onKeydown: Le
366
+ }, [
367
+ F.value.length ? (c(!0), d(O, { key: 0 }, $(F.value, (r) => (c(), d("section", {
343
368
  key: r.key,
344
- type: "button",
345
- class: "nmorph-emoji-picker__emoji",
346
- "aria-label": r.annotation,
347
- title: r.annotation,
348
- disabled: l.disabled,
349
- onFocus: (n) => w.value = H.value.findIndex((a) => a.key === r.key),
350
- onClick: (n) => oe(r.emoji)
369
+ class: "nmorph-emoji-picker__section"
351
370
  }, [
352
- y("span", Xe, E(r.emoji), 1)
353
- ], 40, We))), 128))
354
- ])
355
- ]))), 128)) : (c(), u("div", Ye, [
356
- _(k(D), null, {
357
- default: q(() => [
358
- _(k(Me))
359
- ]),
360
- _: 1
361
- }),
362
- y("span", null, E(p.value.noResults), 1)
363
- ]))
364
- ], 40, Ue)
371
+ x.value ? (c(), d("div", Pe, E(r.label), 1)) : W("", !0),
372
+ L("div", Ue, [
373
+ (c(!0), d(O, null, $(r.items, (t) => (c(), d("button", {
374
+ key: t.key,
375
+ type: "button",
376
+ class: "nmorph-emoji-picker__emoji",
377
+ "aria-label": t.annotation,
378
+ title: t.annotation,
379
+ disabled: l.disabled,
380
+ onFocus: (n) => C.value = R.value.findIndex((a) => a.key === t.key),
381
+ onClick: (n) => ae(t.emoji)
382
+ }, [
383
+ L("span", Je, E(t.emoji), 1)
384
+ ], 40, Qe))), 128))
385
+ ])
386
+ ]))), 128)) : (c(), d("div", We, [
387
+ k(f(X), null, {
388
+ default: v(() => [
389
+ k(f(Oe))
390
+ ]),
391
+ _: 1
392
+ }),
393
+ L("span", null, E(u.value.noResults), 1)
394
+ ]))
395
+ ], 40, He)
396
+ ]),
397
+ _: 1
398
+ })
365
399
  ]))
366
- ], 14, Oe));
400
+ ], 14, $e));
367
401
  }
368
402
  });
369
403
  export {
370
- st as default
404
+ uo as default
371
405
  };