@opentiny/tiny-robot 0.2.0-alpha.3 → 0.2.0-alpha.5

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,52 +1,52 @@
1
- import { ref as v, computed as D, watch as T, defineComponent as R, onMounted as F, onBeforeUnmount as U, createElementBlock as u, openBlock as l, normalizeClass as V, createCommentVNode as S, Fragment as M, renderList as W, createElementVNode as n, createTextVNode as A, createVNode as $, unref as h, toDisplayString as Q, nextTick as H, withModifiers as j, normalizeStyle as G, renderSlot as E, withCtx as O, createBlock as N } from "vue";
2
- import { Y, Q as I, I as P, D as J, x as K } from "../tiny-robot-svgs.js";
3
- import { i as X } from "../close.js";
4
- import { B as Z } from "../index3.js";
5
- function ee(c = v([])) {
6
- const k = v(""), p = v(!1), i = v(!1), d = v("light"), r = D(() => {
7
- if (!k.value && c.value.length > 0)
8
- return c.value[0].questions;
9
- const e = c.value.find((s) => s.id === k.value);
10
- return e ? e.questions : [];
11
- }), g = (e) => {
12
- k.value = e;
13
- }, f = () => {
14
- i.value = !0;
15
- }, y = () => {
16
- i.value = !1;
17
- }, w = () => {
18
- p.value = !p.value;
19
- }, C = (e) => {
20
- const s = document.body;
21
- if (e) {
22
- const m = window.scrollY || document.documentElement.scrollTop;
23
- s.style.position = "fixed", s.style.width = "100%", s.style.top = `-${m}px`, s.style.overflowY = "scroll", s.classList.add("tr-modal-open");
1
+ import { ref as m, computed as H, watch as D, defineComponent as K, onMounted as Z, onBeforeUnmount as ne, createElementBlock as d, openBlock as i, normalizeClass as V, createElementVNode as t, withDirectives as le, Fragment as L, renderList as R, createVNode as T, unref as q, toDisplayString as O, vShow as ie, nextTick as ae, createCommentVNode as Y, withModifiers as ce, normalizeStyle as ue, renderSlot as B, createTextVNode as ee, createBlock as J, withCtx as N } from "vue";
2
+ import { A as X, a as te, O as se, K as de, U as re } from "../tiny-robot-svgs.js";
3
+ import { i as me } from "../close.js";
4
+ import { B as ve } from "../index5.js";
5
+ function he(v = m([])) {
6
+ const w = m(""), y = m(!1), a = m(!1), r = m("light"), k = H(() => {
7
+ if (!w.value && v.value.length > 0)
8
+ return v.value[0].questions;
9
+ const s = v.value.find((l) => l.id === w.value);
10
+ return s ? s.questions : [];
11
+ }), x = (s) => {
12
+ w.value = s;
13
+ }, p = () => {
14
+ a.value = !0;
15
+ }, _ = () => {
16
+ a.value = !1;
17
+ }, c = () => {
18
+ y.value = !y.value;
19
+ }, b = (s) => {
20
+ const l = document.body;
21
+ if (s) {
22
+ const Q = window.scrollY || document.documentElement.scrollTop;
23
+ l.style.position = "fixed", l.style.width = "100%", l.style.top = `-${Q}px`, l.style.overflowY = "scroll", l.classList.add("tr-modal-open");
24
24
  } else
25
- s.style.position = "", s.style.width = "", s.style.top = "", s.style.overflowY = "", s.classList.remove("tr-modal-open");
25
+ l.style.position = "", l.style.width = "", l.style.top = "", l.style.overflowY = "", l.classList.remove("tr-modal-open");
26
26
  };
27
- return T(i, (e) => {
28
- C(e);
27
+ return D(a, (s) => {
28
+ b(s);
29
29
  }), {
30
- activeCategory: k,
31
- isFloatingExpanded: p,
32
- modalVisible: i,
33
- currentTheme: d,
34
- activeQuestions: r,
35
- setActiveCategory: g,
36
- openModal: f,
37
- closeModal: y,
38
- toggleFloating: w,
30
+ activeCategory: w,
31
+ isFloatingExpanded: y,
32
+ modalVisible: a,
33
+ currentTheme: r,
34
+ activeQuestions: k,
35
+ setActiveCategory: x,
36
+ openModal: p,
37
+ closeModal: _,
38
+ toggleFloating: c,
39
39
  toggleTheme: () => {
40
- d.value = d.value === "light" ? "dark" : "light", document.documentElement.setAttribute("data-theme", d.value);
40
+ r.value = r.value === "light" ? "dark" : "light", document.documentElement.setAttribute("data-theme", r.value);
41
41
  },
42
- setTheme: (e) => {
43
- d.value = e, document.documentElement.setAttribute("data-theme", e);
42
+ setTheme: (s) => {
43
+ r.value = s, document.documentElement.setAttribute("data-theme", s);
44
44
  },
45
45
  refreshData: async () => Promise.resolve(),
46
- toggleBodyScroll: C
46
+ toggleBodyScroll: b
47
47
  };
48
48
  }
49
- const te = ["onClick"], se = { style: { display: "flex", "align-items": "center" } }, oe = { key: 0 }, ne = ["onClick"], le = /* @__PURE__ */ R({
49
+ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-questions_expanded-wrapper" }, ge = { class: "tr-common-questions_expanded-area" }, ye = ["onClick"], ke = { class: "tr-common-questions_item_icon" }, _e = { class: "tr-common-questions_item_text" }, Ce = { class: "tr-common-questions_container" }, qe = ["onClick"], $e = { class: "tr-common-questions_item_icon" }, we = { class: "tr-common-questions_item_text" }, xe = /* @__PURE__ */ K({
50
50
  __name: "CommonQuestions",
51
51
  props: {
52
52
  questions: {
@@ -58,87 +58,139 @@ const te = ["onClick"], se = { style: { display: "flex", "align-items": "center"
58
58
  default: !1
59
59
  }
60
60
  },
61
- emits: ["question-click", "show-expand-button"],
62
- setup(c, { emit: k }) {
63
- const p = c, i = k, d = v(null), r = v(!1), g = v(!1), f = v([]), y = v([]);
64
- T(
65
- () => p.isExpanded,
66
- (t) => {
67
- g.value = t;
61
+ emits: ["question-click", "toggle-expand", "hover-change"],
62
+ setup(v, { emit: w }) {
63
+ const y = v, a = w, r = m(null), k = m(!1), x = m(!1), p = m(!1), _ = m([]), c = m([]), b = m(0), f = m(null), o = H(() => c.value.length > 0), u = H(() => {
64
+ if (b.value <= 0 || c.value.length === 0) return [];
65
+ const e = [], h = [...c.value];
66
+ for (; h.length > 0; )
67
+ e.push(h.splice(0, b.value));
68
+ return e.reverse();
69
+ }), s = (e, h, $ = 40) => {
70
+ if (h.length === 0) return 0;
71
+ const E = e.clientWidth, W = 8, g = document.createElement("div");
72
+ g.className = "tr-common-questions_item", g.style.visibility = "hidden", g.style.position = "absolute", e.appendChild(g);
73
+ let S = 0;
74
+ const z = Math.min(3, h.length);
75
+ for (let A = 0; A < z; A++) {
76
+ g.innerHTML = `<span class="icon-placeholder"></span>${h[A].text}`;
77
+ const j = g.offsetWidth + W + 24;
78
+ S += j;
79
+ }
80
+ const M = S / z;
81
+ return e.removeChild(g), {
82
+ maxItemsCount: Math.max(1, Math.floor((E - $) / M))
83
+ };
84
+ }, l = (e, h, $, E = 40) => {
85
+ const g = [], S = [];
86
+ let z = 0;
87
+ if (h.length === 0)
88
+ return { visible: g, hidden: S };
89
+ const M = document.createElement("div");
90
+ M.className = "tr-common-questions_item", M.style.visibility = "hidden", M.style.position = "absolute", e.appendChild(M);
91
+ for (let A = 0; A < h.length; A++) {
92
+ const I = h[A];
93
+ M.innerHTML = `<span class="icon-placeholder"></span>${I.text}`;
94
+ const G = M.offsetWidth + 8 + 24, oe = $ - E;
95
+ z + G <= oe ? (z += G, g.push(I)) : S.push(I);
96
+ }
97
+ return e.removeChild(M), { visible: g, hidden: S };
98
+ };
99
+ D(
100
+ () => y.isExpanded,
101
+ (e) => {
102
+ p.value = e, e ? _.value.pop() : _.value.push(c.value[0]);
68
103
  }
69
104
  );
70
- const w = async () => {
71
- if (await H(), d.value) {
72
- const t = d.value, a = t.clientWidth;
73
- if (f.value = [], y.value = [], p.questions.length === 0) {
74
- r.value = !1;
105
+ const Q = async () => {
106
+ if (await ae(), r.value) {
107
+ const e = r.value, h = e.clientWidth, $ = 40;
108
+ if (_.value = [], c.value = [], y.questions.length === 0) {
109
+ x.value = !1;
75
110
  return;
76
111
  }
77
- let e = 0;
78
- const s = 8, m = document.createElement("div");
79
- m.className = "tr-common-questions_item", m.style.visibility = "hidden", m.style.position = "absolute", t.appendChild(m);
80
- for (let B = 0; B < p.questions.length; B++) {
81
- const _ = p.questions[B];
82
- m.textContent = _.text;
83
- const o = m.offsetWidth + s;
84
- e + o <= a ? (e += o, f.value.push(_)) : y.value.push(_);
85
- }
86
- t.removeChild(m), r.value = y.value.length > 0, g.value = !1, i("show-expand-button", r.value);
112
+ const { maxItemsCount: E } = s(e, y.questions, $);
113
+ b.value = E;
114
+ const { visible: W, hidden: g } = l(e, y.questions, h, $);
115
+ _.value = W, c.value = g, c.value.length > 0 && _.value.push(c.value[0]), x.value = c.value.length > 0, y.isExpanded || (p.value = !1);
87
116
  }
88
- }, C = (t) => {
89
- i("question-click", t);
117
+ }, P = () => {
118
+ f.value && (clearTimeout(f.value), f.value = null), k.value = !0, a("hover-change", !0);
119
+ }, U = () => {
120
+ f.value = setTimeout(() => {
121
+ k.value = !1, a("hover-change", !1), f.value = null;
122
+ }, 500);
123
+ }, n = (e) => {
124
+ a("question-click", e);
90
125
  };
91
- T(
92
- () => p.questions,
126
+ D(
127
+ () => y.questions,
93
128
  () => {
94
- w();
129
+ Q();
95
130
  },
96
131
  { deep: !0 }
97
132
  );
98
- const q = () => {
99
- w();
133
+ const C = () => {
134
+ Q();
100
135
  };
101
- return F(() => {
102
- w(), window.addEventListener("resize", q);
103
- }), U(() => {
104
- window.removeEventListener("resize", q);
105
- }), (t, a) => (l(), u("div", {
106
- class: V(["tr-common-questions", { expanded: g.value }]),
136
+ return Z(() => {
137
+ Q(), window.addEventListener("resize", C);
138
+ }), ne(() => {
139
+ window.removeEventListener("resize", C), f.value && (window.clearTimeout(f.value), f.value = null);
140
+ }), (e, h) => (i(), d("div", {
141
+ class: V(["tr-common-questions", { expanded: p.value }]),
107
142
  ref_key: "commonQuestionsRef",
108
- ref: d
143
+ ref: r,
144
+ onMouseenter: P,
145
+ onMouseleave: U
109
146
  }, [
110
- (l(!0), u(M, null, W(f.value, (e, s) => (l(), u("div", {
111
- key: `visible-${e.id}-${s}`,
112
- class: "tr-common-questions_item",
113
- onClick: (m) => C(e)
114
- }, [
115
- n("div", se, [
116
- $(h(Y))
147
+ t("div", pe, [
148
+ t("div", fe, [
149
+ le(t("div", ge, [
150
+ (i(!0), d(L, null, R(u.value, ($, E) => (i(), d("div", {
151
+ key: `row-${E}`,
152
+ class: "tr-common-questions_row"
153
+ }, [
154
+ (i(!0), d(L, null, R($, (W, g) => (i(), d("div", {
155
+ key: `hidden-${W.id}-${g}`,
156
+ class: "tr-common-questions_item",
157
+ onClick: (S) => n(W)
158
+ }, [
159
+ t("div", ke, [
160
+ T(q(X))
161
+ ]),
162
+ t("div", _e, O(W.text), 1)
163
+ ], 8, ye))), 128))
164
+ ]))), 128))
165
+ ], 512), [
166
+ [ie, p.value && c.value.length > 0]
167
+ ])
117
168
  ]),
118
- A(" " + Q(e.text), 1)
119
- ], 8, te))), 128)),
120
- g.value ? (l(), u("div", oe, [
121
- (l(!0), u(M, null, W(y.value, (e, s) => (l(), u("div", {
122
- key: `hidden-${e.id}-${s}`,
123
- class: "tr-common-questions_item",
124
- onClick: (m) => C(e)
125
- }, [
126
- $(h(Y)),
127
- A(" " + Q(e.text), 1)
128
- ], 8, ne))), 128))
129
- ])) : S("", !0)
130
- ], 2));
169
+ t("div", Ce, [
170
+ (i(!0), d(L, null, R(_.value, ($, E) => (i(), d("div", {
171
+ key: `visible-${$.id}-${E}`,
172
+ class: V(["tr-common-questions_item", { "last-item": !p.value && E === _.value.length - 1 && o.value }]),
173
+ onClick: (W) => n($)
174
+ }, [
175
+ t("div", $e, [
176
+ T(q(X))
177
+ ]),
178
+ t("div", we, O($.text), 1)
179
+ ], 10, qe))), 128))
180
+ ])
181
+ ])
182
+ ], 34));
131
183
  }
132
- }), ie = { class: "tr-question-header" }, ae = { style: { display: "flex", "align-items": "center", gap: "12px", "font-size": "36px" } }, de = {
184
+ }), be = { class: "tr-question-header" }, Ee = { style: { display: "flex", "align-items": "center", gap: "12px", "font-size": "36px" } }, Qe = {
133
185
  key: 0,
134
186
  class: "tr-question-categories"
135
- }, ue = ["onClick"], ce = { class: "category-icon" }, re = { class: "tr-question-content" }, me = {
187
+ }, We = ["onClick"], Me = { class: "category-icon" }, Te = { class: "tr-question-content" }, Be = {
136
188
  key: 0,
137
189
  class: "tr-question-loading"
138
- }, ve = { key: 1 }, pe = ["onClick"], fe = {
190
+ }, Oe = { key: 1 }, Se = ["onClick"], Ae = {
139
191
  key: 2,
140
192
  class: "tr-question-empty"
141
- }, he = /* @__PURE__ */ R({
193
+ }, ze = /* @__PURE__ */ K({
142
194
  __name: "HotQuestions",
143
195
  props: {
144
196
  visible: {
@@ -163,105 +215,105 @@ const te = ["onClick"], se = { style: { display: "flex", "align-items": "center"
163
215
  }
164
216
  },
165
217
  emits: ["update:visible", "close", "select-category", "question-click"],
166
- setup(c, { emit: k }) {
167
- const p = X(), i = c, d = k, r = v(""), g = D(() => {
168
- if (!r.value && i.categories.length > 0)
169
- return i.categories[0].questions || [];
170
- const t = i.categories.find((a) => a.id === r.value);
171
- return t ? t.questions : [];
218
+ setup(v, { emit: w }) {
219
+ const y = me(), a = v, r = w, k = m(""), x = H(() => {
220
+ if (!k.value && a.categories.length > 0)
221
+ return a.categories[0].questions || [];
222
+ const o = a.categories.find((u) => u.id === k.value);
223
+ return o ? o.questions : [];
172
224
  });
173
- T(
174
- () => i.categories,
175
- (t) => {
176
- t.length > 0 && !r.value && (r.value = t[0].id);
225
+ D(
226
+ () => a.categories,
227
+ (o) => {
228
+ o.length > 0 && !k.value && (k.value = o[0].id);
177
229
  },
178
230
  { immediate: !0 }
179
231
  );
180
- const f = () => {
181
- d("update:visible", !1), d("close");
182
- }, y = (t) => {
183
- r.value = t, d(
232
+ const p = () => {
233
+ r("update:visible", !1), r("close");
234
+ }, _ = (o) => {
235
+ k.value = o, r(
184
236
  "select-category",
185
- i.categories.find((a) => a.id === t)
237
+ a.categories.find((u) => u.id === o)
186
238
  );
187
- }, w = (t) => {
188
- d("question-click", t);
189
- }, C = (t) => {
190
- i.closeOnClickOutside && !t.composedPath().includes(q.value) && f();
191
- }, q = v(null);
192
- return (t, a) => c.visible ? (l(), u("div", {
239
+ }, c = (o) => {
240
+ r("question-click", o);
241
+ }, b = (o) => {
242
+ a.closeOnClickOutside && !o.composedPath().includes(f.value) && p();
243
+ }, f = m(null);
244
+ return (o, u) => v.visible ? (i(), d("div", {
193
245
  key: 0,
194
246
  class: "tr-question-modal-backdrop",
195
- onMousedown: C
247
+ onMousedown: b
196
248
  }, [
197
- n("div", {
249
+ t("div", {
198
250
  ref_key: "modalRef",
199
- ref: q,
251
+ ref: f,
200
252
  class: "tr-question-panel",
201
- style: G({ width: c.modalWidth }),
202
- onMousedown: a[0] || (a[0] = j(() => {
253
+ style: ue({ width: v.modalWidth }),
254
+ onMousedown: u[0] || (u[0] = ce(() => {
203
255
  }, ["stop"]))
204
256
  }, [
205
- n("div", ie, [
206
- n("div", ae, [
207
- n("div", null, [
208
- $(h(I))
257
+ t("div", be, [
258
+ t("div", Ee, [
259
+ t("div", null, [
260
+ T(q(te), { style: { color: "#1476ff", "font-size": "24px" } })
209
261
  ]),
210
- a[1] || (a[1] = n("div", { class: "tr-question-header-title" }, "热门问题", -1))
262
+ u[1] || (u[1] = t("div", { class: "tr-question-header-title" }, "热门问题", -1))
211
263
  ]),
212
- n("span", {
264
+ t("span", {
213
265
  class: "tr-question-close-btn",
214
- onClick: f
266
+ onClick: p
215
267
  }, [
216
- $(h(Z), {
217
- icon: h(p),
268
+ T(q(ve), {
269
+ icon: q(y),
218
270
  type: "text"
219
271
  }, null, 8, ["icon"])
220
272
  ])
221
273
  ]),
222
- c.categories.length > 0 ? (l(), u("div", de, [
223
- (l(!0), u(M, null, W(c.categories, (e) => (l(), u("div", {
224
- key: e.id,
225
- class: V(["tr-question-categories-item", { active: r.value === e.id }]),
226
- onClick: (s) => y(e.id)
274
+ v.categories.length > 0 ? (i(), d("div", Qe, [
275
+ (i(!0), d(L, null, R(v.categories, (s) => (i(), d("div", {
276
+ key: s.id,
277
+ class: V(["tr-question-categories-item", { active: k.value === s.id }]),
278
+ onClick: (l) => _(s.id)
227
279
  }, [
228
- E(t.$slots, "category-label", { category: e }, () => [
229
- n("div", ce, [
230
- $(h(P))
280
+ B(o.$slots, "category-label", { category: s }, () => [
281
+ t("div", Me, [
282
+ T(q(se))
231
283
  ]),
232
- n("span", null, Q(e.label), 1)
284
+ t("span", null, O(s.label), 1)
233
285
  ])
234
- ], 10, ue))), 128))
235
- ])) : S("", !0),
236
- n("div", re, [
237
- c.loading ? (l(), u("div", me, [
238
- E(t.$slots, "loading-indicator", {}, () => [
239
- a[2] || (a[2] = n("div", { class: "tr-question-loading-spinner" }, null, -1))
286
+ ], 10, We))), 128))
287
+ ])) : Y("", !0),
288
+ t("div", Te, [
289
+ v.loading ? (i(), d("div", Be, [
290
+ B(o.$slots, "loading-indicator", {}, () => [
291
+ u[2] || (u[2] = t("div", { class: "tr-question-loading-spinner" }, null, -1))
240
292
  ])
241
- ])) : g.value.length > 0 ? (l(), u("ul", ve, [
242
- (l(!0), u(M, null, W(g.value, (e, s) => (l(), u("li", {
243
- key: e.id,
293
+ ])) : x.value.length > 0 ? (i(), d("ul", Oe, [
294
+ (i(!0), d(L, null, R(x.value, (s, l) => (i(), d("li", {
295
+ key: s.id,
244
296
  class: "tr-question-list-item",
245
- onClick: (m) => w(e)
297
+ onClick: (Q) => c(s)
246
298
  }, [
247
- E(t.$slots, "question-item", {
248
- question: e,
249
- index: s
299
+ B(o.$slots, "question-item", {
300
+ question: s,
301
+ index: l
250
302
  }, () => [
251
- n("span", null, Q(s + 1) + ".", 1),
252
- A(" " + Q(e.text), 1)
303
+ t("span", null, O(l + 1) + ".", 1),
304
+ ee(" " + O(s.text), 1)
253
305
  ])
254
- ], 8, pe))), 128))
255
- ])) : (l(), u("div", fe, [
256
- E(t.$slots, "empty-state", {}, () => [
257
- a[3] || (a[3] = n("p", null, "暂无相关问题", -1))
306
+ ], 8, Se))), 128))
307
+ ])) : (i(), d("div", Ae, [
308
+ B(o.$slots, "empty-state", {}, () => [
309
+ u[3] || (u[3] = t("p", null, "暂无相关问题", -1))
258
310
  ])
259
311
  ]))
260
312
  ])
261
313
  ], 36)
262
- ], 32)) : S("", !0);
314
+ ], 32)) : Y("", !0);
263
315
  }
264
- }), ge = ["data-theme"], ye = { class: "category-icon" }, z = /* @__PURE__ */ R({
316
+ }), Le = ["data-theme"], Re = { class: "tr-question__header" }, He = { class: "category-icon" }, F = /* @__PURE__ */ K({
265
317
  __name: "index",
266
318
  props: {
267
319
  categories: { default: () => [] },
@@ -273,103 +325,105 @@ const te = ["onClick"], se = { style: { display: "flex", "align-items": "center"
273
325
  loading: { type: Boolean, default: !1 }
274
326
  },
275
327
  emits: ["question-click", "select-category"],
276
- setup(c, { expose: k, emit: p }) {
277
- const i = c, d = () => {
278
- f.value = !f.value;
279
- }, r = p, g = D(() => i.categories), f = v(i.initialExpanded), { modalVisible: y, currentTheme: w, setActiveCategory: C, openModal: q, closeModal: t, setTheme: a, refreshData: e } = ee(g);
280
- T(
281
- () => i.theme,
282
- (o) => {
283
- a(o);
328
+ setup(v, { expose: w, emit: y }) {
329
+ const a = v, r = () => {
330
+ p.value = !p.value;
331
+ }, k = y, x = H(() => a.categories), p = m(a.initialExpanded), _ = m(!1), { modalVisible: c, currentTheme: b, setActiveCategory: f, openModal: o, closeModal: u, setTheme: s, refreshData: l } = he(x);
332
+ D(
333
+ () => a.theme,
334
+ (n) => {
335
+ s(n);
284
336
  }
285
337
  );
286
- const s = (o) => {
287
- t(), r("question-click", o);
288
- }, m = (o) => {
289
- o && (C(o.id), r("select-category", o));
290
- }, B = v(!1), _ = (o) => {
291
- B.value = o;
338
+ const Q = (n) => {
339
+ u(), k("question-click", n);
340
+ }, P = (n) => {
341
+ _.value = n;
342
+ }, U = (n) => {
343
+ n && (f(n.id), k("select-category", n));
292
344
  };
293
- return F(() => {
294
- document.documentElement.setAttribute("data-theme", w.value);
295
- }), k({
296
- openModal: q,
297
- closeModal: t,
298
- toggleFloating: d,
299
- setActiveCategory: C,
300
- refreshData: e
301
- }), (o, x) => (l(), u("div", {
302
- class: V(["tr-question-container", [`theme-${o.theme}`]]),
303
- "data-theme": o.theme
345
+ return Z(() => {
346
+ document.documentElement.setAttribute("data-theme", b.value);
347
+ }), w({
348
+ openModal: o,
349
+ closeModal: u,
350
+ toggleFloating: r,
351
+ setActiveCategory: f,
352
+ refreshData: l
353
+ }), (n, C) => (i(), d("div", {
354
+ class: V(["tr-question-container", [`theme-${n.theme}`]]),
355
+ "data-theme": n.theme
304
356
  }, [
305
- n("div", {
306
- class: "tr-question-trigger",
307
- onClick: x[0] || (x[0] = //@ts-ignore
308
- (...b) => h(q) && h(q)(...b))
309
- }, [
310
- $(h(I))
357
+ t("div", Re, [
358
+ t("div", {
359
+ class: "tr-question__trigger",
360
+ onClick: C[0] || (C[0] = //@ts-ignore
361
+ (...e) => q(o) && q(o)(...e))
362
+ }, [
363
+ T(q(te), { style: { color: "#1476ff" } })
364
+ ]),
365
+ T(xe, {
366
+ questions: n.commonQuestions,
367
+ isExpanded: p.value,
368
+ onQuestionClick: Q,
369
+ onHoverChange: P
370
+ }, null, 8, ["questions", "isExpanded"]),
371
+ _.value ? (i(), d("div", {
372
+ key: 0,
373
+ class: "tr-question__expand-button",
374
+ onClick: r
375
+ }, [
376
+ p.value ? (i(), J(q(re), { key: 1 })) : (i(), J(q(de), { key: 0 }))
377
+ ])) : Y("", !0)
311
378
  ]),
312
- $(he, {
313
- visible: h(y),
314
- categories: g.value,
315
- "modal-width": o.modalWidth,
316
- loading: o.loading,
317
- "close-on-click-outside": o.closeOnClickOutside,
318
- "onUpdate:visible": x[1] || (x[1] = (b) => y.value = b),
319
- onClose: x[2] || (x[2] = (b) => y.value = !1),
320
- onQuestionClick: s,
321
- onSelectCategory: m
379
+ T(ze, {
380
+ visible: q(c),
381
+ categories: x.value,
382
+ "modal-width": n.modalWidth,
383
+ loading: n.loading,
384
+ "close-on-click-outside": n.closeOnClickOutside,
385
+ "onUpdate:visible": C[1] || (C[1] = (e) => c.value = e),
386
+ onClose: C[2] || (C[2] = (e) => c.value = !1),
387
+ onQuestionClick: Q,
388
+ onSelectCategory: U
322
389
  }, {
323
- "category-label": O(({ category: b }) => [
324
- E(o.$slots, "category-label", { category: b }, () => [
325
- n("div", ye, [
326
- $(h(P))
390
+ "category-label": N(({ category: e }) => [
391
+ B(n.$slots, "category-label", { category: e }, () => [
392
+ t("div", He, [
393
+ T(q(se))
327
394
  ]),
328
- n("span", null, Q(b.label), 1)
395
+ t("span", null, O(e.label), 1)
329
396
  ])
330
397
  ]),
331
- "question-item": O(({ question: b, index: L }) => [
332
- E(o.$slots, "question-item", {
333
- question: b,
334
- index: L
398
+ "question-item": N(({ question: e, index: h }) => [
399
+ B(n.$slots, "question-item", {
400
+ question: e,
401
+ index: h
335
402
  }, () => [
336
- n("span", null, Q(L + 1) + ".", 1),
337
- A(" " + Q(b.text), 1)
403
+ t("span", null, O(h + 1) + ".", 1),
404
+ ee(" " + O(e.text), 1)
338
405
  ])
339
406
  ]),
340
- "loading-indicator": O(() => [
341
- E(o.$slots, "loading-indicator", {}, () => [
342
- x[3] || (x[3] = n("div", { class: "tr-question-loading-spinner" }, null, -1))
407
+ "loading-indicator": N(() => [
408
+ B(n.$slots, "loading-indicator", {}, () => [
409
+ C[3] || (C[3] = t("div", { class: "tr-question-loading-spinner" }, null, -1))
343
410
  ])
344
411
  ]),
345
- "empty-state": O(() => [
346
- E(o.$slots, "empty-state", {}, () => [
347
- x[4] || (x[4] = n("p", null, "暂无相关问题", -1))
412
+ "empty-state": N(() => [
413
+ B(n.$slots, "empty-state", {}, () => [
414
+ C[4] || (C[4] = t("p", null, "暂无相关问题", -1))
348
415
  ])
349
416
  ]),
350
417
  _: 3
351
- }, 8, ["visible", "categories", "modal-width", "loading", "close-on-click-outside"]),
352
- $(le, {
353
- isExpanded: f.value,
354
- questions: o.commonQuestions,
355
- onShowExpandButton: _,
356
- onQuestionClick: s
357
- }, null, 8, ["isExpanded", "questions"]),
358
- B.value ? (l(), u("div", {
359
- key: 0,
360
- class: "tr-question-wrap-trigger",
361
- onClick: d
362
- }, [
363
- f.value ? (l(), N(h(K), { key: 1 })) : (l(), N(h(J), { key: 0 }))
364
- ])) : S("", !0)
365
- ], 10, ge));
418
+ }, 8, ["visible", "categories", "modal-width", "loading", "close-on-click-outside"])
419
+ ], 10, Le));
366
420
  }
367
421
  });
368
- z.name = "TrQuestion";
369
- const ke = function(c) {
370
- c.component(z.name, z);
422
+ F.name = "TrQuestion";
423
+ const De = function(v) {
424
+ v.component(F.name, F);
371
425
  };
372
- z.install = ke;
426
+ F.install = De;
373
427
  export {
374
- z as default
428
+ F as default
375
429
  };