@oneb/ui-vue 0.2.29 → 0.3.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.
@@ -1,172 +1,173 @@
1
- import { d as we, e as le, o as oe, f as ne, s as re, g as ge, h as be, _ as ke, r as xe, i as Ce } from "./OneHelpMenu-9a2f42f5.js";
2
- import { defineComponent as N, ref as C, watch as ce, onBeforeUnmount as pe, provide as _e, computed as j, openBlock as s, createElementBlock as o, createElementVNode as t, renderSlot as _, normalizeProps as P, guardReactiveProps as F, createBlock as T, Teleport as $e, createCommentVNode as f, withDirectives as J, normalizeClass as x, toDisplayString as h, vShow as Me, withCtx as D, createVNode as G, unref as I, normalizeStyle as U, Fragment as B, renderList as E, onMounted as ve, onUnmounted as Ve, vModelText as ae, mergeProps as W, createTextVNode as ie, nextTick as H } from "vue";
3
- import { _ as me } from "./_plugin-vue_export-helper-dad06003.js";
4
- import { _ as ue } from "./OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
5
- const Ke = ["data-opened"], Le = {
1
+ import { d as ge, e as oe, o as ne, f as re, s as ae, g as be, h as ke, _ as xe, r as Ce, i as _e } from "./OneHelpMenu-9a2f42f5.js";
2
+ import { defineComponent as q, ref as _, watch as pe, onBeforeUnmount as ve, provide as $e, computed as A, openBlock as s, createElementBlock as l, createElementVNode as t, renderSlot as M, normalizeProps as P, guardReactiveProps as T, createBlock as U, Teleport as Me, createCommentVNode as y, withDirectives as X, normalizeClass as b, toDisplayString as p, vShow as Ve, withCtx as R, createVNode as H, unref as C, normalizeStyle as N, Fragment as B, renderList as D, onMounted as me, onUnmounted as Ke, vModelText as ie, mergeProps as W, createTextVNode as ue, nextTick as J } from "vue";
3
+ import { _ as fe } from "./_plugin-vue_export-helper-dad06003.js";
4
+ import { _ as de } from "./OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
5
+ import { u as Oe } from "./useI18n-2103b39e.js";
6
+ const Le = ["data-opened"], je = {
6
7
  key: 0,
7
8
  class: "text-sm text-secondary-content px-3 py-2 text-left"
8
- }, Oe = /* @__PURE__ */ N({
9
+ }, Ae = /* @__PURE__ */ q({
9
10
  __name: "OneDropdownAuto",
10
- props: we,
11
+ props: ge,
11
12
  emits: ["open", "close"],
12
- setup(V, { emit: p }) {
13
- const n = V, a = C(!1), y = C(null), b = C(null);
14
- let w = null;
15
- ce(a, (d) => {
16
- d && b.value && y.value ? (le(b.value, y.value, {
13
+ setup(K, { emit: f }) {
14
+ const n = K, a = _(!1), m = _(null), k = _(null);
15
+ let g = null;
16
+ pe(a, (v) => {
17
+ v && k.value && m.value ? (oe(k.value, m.value, {
17
18
  placement: n.stick ? n.stick : "bottom-start",
18
19
  strategy: "fixed",
19
- middleware: [oe(5), ne(), re({ padding: 8 })]
20
- }).then(({ x: K, y: $ }) => {
21
- Object.assign(y.value.style, {
22
- left: `${K}px`,
20
+ middleware: [ne(5), re(), ae({ padding: 8 })]
21
+ }).then(({ x: c, y: $ }) => {
22
+ Object.assign(m.value.style, {
23
+ left: `${c}px`,
23
24
  top: `${$}px`
24
25
  });
25
- }), w = ge(b.value, y.value, () => {
26
- le(b.value, y.value, {
26
+ }), g = be(k.value, m.value, () => {
27
+ oe(k.value, m.value, {
27
28
  placement: n.stick ? n.stick : "bottom-start",
28
29
  strategy: "fixed",
29
- middleware: [oe(4), ne(), re({ padding: 8 })]
30
- }).then(({ x: K, y: $ }) => {
31
- Object.assign(y.value.style, {
32
- left: `${K}px`,
30
+ middleware: [ne(4), re(), ae({ padding: 8 })]
31
+ }).then(({ x: c, y: $ }) => {
32
+ Object.assign(m.value.style, {
33
+ left: `${c}px`,
33
34
  top: `${$}px`
34
35
  });
35
36
  });
36
- })) : w && (w(), w = null);
37
- }), pe(() => {
38
- w && w();
37
+ })) : g && (g(), g = null);
38
+ }), ve(() => {
39
+ g && g();
39
40
  });
40
- const c = p, m = () => {
41
- a.value = !a.value, a.value ? c("open") : c("close");
41
+ const d = f, h = () => {
42
+ a.value = !a.value, a.value ? d("open") : d("close");
42
43
  };
43
- _e("OneDropdown", {
44
- onToggle: m
44
+ $e("OneDropdown", {
45
+ onToggle: h
45
46
  });
46
- const v = j(() => [
47
+ const V = A(() => [
47
48
  "fixed z-[10000] w-fit rounded-md bg-white",
48
49
  "py-1 shadow-lg ring-black ring-opacity-5 focus:outline-none",
49
50
  "overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"
50
51
  ]);
51
- return (d, K) => (s(), o("div", {
52
+ return (v, c) => (s(), l("div", {
52
53
  class: "relative inline-block",
53
54
  "data-opened": a.value
54
55
  }, [
55
56
  t("div", {
56
57
  ref_key: "buttonRef",
57
- ref: b
58
+ ref: k
58
59
  }, [
59
- _(d.$slots, "button", P(F({ onToggle: m, isExpanded: a.value })))
60
+ M(v.$slots, "button", P(T({ onToggle: h, isExpanded: a.value })))
60
61
  ], 512),
61
- (s(), T($e, { to: "body" }, [
62
- a.value ? (s(), o("div", {
62
+ (s(), U(Me, { to: "body" }, [
63
+ a.value ? (s(), l("div", {
63
64
  key: 0,
64
65
  class: "fixed top-0 left-0 w-screen h-screen z-[9999]",
65
- onClick: m
66
- })) : f("", !0),
67
- J(t("div", {
66
+ onClick: h
67
+ })) : y("", !0),
68
+ X(t("div", {
68
69
  ref_key: "menuRef",
69
- ref: y,
70
- class: x(["menu", v.value]),
70
+ ref: m,
71
+ class: b(["menu", V.value]),
71
72
  role: "menu",
72
73
  "aria-orientation": "vertical",
73
74
  tabindex: "-1",
74
75
  style: { display: "none" }
75
76
  }, [
76
- d.title ? (s(), o("div", Le, h(d.title), 1)) : f("", !0),
77
- _(d.$slots, "menu", P(F({ onToggle: m })))
77
+ v.title ? (s(), l("div", je, p(v.title), 1)) : y("", !0),
78
+ M(v.$slots, "menu", P(T({ onToggle: h })))
78
79
  ], 2), [
79
- [Me, a.value]
80
+ [Ve, a.value]
80
81
  ])
81
82
  ]))
82
- ], 8, Ke));
83
+ ], 8, Le));
83
84
  }
84
- }), je = {}, Se = { class: "border-t border-secondary-stroke my-1" };
85
- function Ae(V, p) {
86
- return s(), o("div", Se);
85
+ }), Se = {}, Be = { class: "border-t border-secondary-stroke my-1" };
86
+ function Ie(K, f) {
87
+ return s(), l("div", Be);
87
88
  }
88
- const Nt = /* @__PURE__ */ me(je, [["render", Ae]]), Be = ["onClick"], Ie = { class: "grid" }, ze = { class: "font-semibold px-3" }, Ee = { class: "rounded-lg m-3 border" }, De = {
89
+ const Ht = /* @__PURE__ */ fe(Se, [["render", Ie]]), ze = ["onClick"], Ee = { class: "grid" }, De = { class: "font-semibold px-3" }, Re = { class: "rounded-lg m-3 border" }, Fe = {
89
90
  class: "space-x-2 flex items-center px-3 py-2",
90
91
  style: { width: "300px" }
91
- }, Re = { class: "flex-shrink-0" }, We = { class: "w-full text-left" }, Pe = { class: "flex-shrink-0" }, Fe = { class: "px-3 py-2" }, Te = { class: "text-secondary-content text-left pb-1 text-sm uppercase" }, Ue = {
92
+ }, We = { class: "flex-shrink-0" }, Pe = { class: "w-full text-left" }, Te = { class: "flex-shrink-0" }, Ue = { class: "px-3 py-2" }, Ne = { class: "text-secondary-content text-left pb-1 text-sm uppercase" }, qe = {
92
93
  key: 0,
93
94
  class: "space-y-2"
94
- }, Ne = ["onClick"], qe = { class: "pl-2" }, Ge = { class: "text-sm mt-1" }, He = { class: "text-xs mt-1" }, de = 3, qt = /* @__PURE__ */ N({
95
+ }, Ge = ["onClick"], He = { class: "pl-2" }, Je = { class: "text-sm mt-1" }, Xe = { class: "text-xs mt-1" }, ce = 3, Jt = /* @__PURE__ */ q({
95
96
  __name: "OneBrowserMenuGrid",
96
- props: be,
97
- setup(V) {
98
- const p = V, n = () => {
99
- typeof p.onChange == "function" && p.onChange();
100
- }, a = C(!1), y = j(() => p.apps ? a.value ? p.apps : p.apps.slice(0, de) : []), b = () => {
97
+ props: ke,
98
+ setup(K) {
99
+ const f = K, n = () => {
100
+ typeof f.onChange == "function" && f.onChange();
101
+ }, a = _(!1), m = A(() => f.apps ? a.value ? f.apps : f.apps.slice(0, ce) : []), k = () => {
101
102
  a.value = !a.value;
102
- }, w = (c) => {
103
- typeof p.onApp == "function" && p.onApp(c);
103
+ }, g = (d) => {
104
+ typeof f.onApp == "function" && f.onApp(d);
104
105
  };
105
- return (c, m) => (s(), T(ke, { stick: "right" }, {
106
- button: D(({ onToggle: v, isExpanded: d }) => [
106
+ return (d, h) => (s(), U(xe, { stick: "right" }, {
107
+ button: R(({ onToggle: V, isExpanded: v }) => [
107
108
  t("button", {
108
- onClick: v,
109
- class: x(["p-1 rounded-md hover:bg-secondary-10", [d ? "bg-secondary-25" : ""]])
109
+ onClick: V,
110
+ class: b(["p-1 rounded-md hover:bg-secondary-10", [v ? "bg-secondary-25" : ""]])
110
111
  }, [
111
- G(I(xe), {
112
+ H(C(Ce), {
112
113
  class: "text-secondary-base",
113
- style: U(`width: ${c.iconSize}px; height: ${c.iconSize}px`)
114
+ style: N(`width: ${d.iconSize}px; height: ${d.iconSize}px`)
114
115
  }, null, 8, ["style"])
115
- ], 10, Be)
116
+ ], 10, ze)
116
117
  ]),
117
- menu: D(() => {
118
- var v, d, K, $;
118
+ menu: R(() => {
119
+ var V, v, c, $;
119
120
  return [
120
- t("div", Ie, [
121
- t("div", ze, h((v = c.workspace) == null ? void 0 : v.title), 1),
122
- t("div", Ee, [
123
- t("div", De, [
124
- t("div", Re, [
125
- G(ue, {
126
- text: ((d = c.workspace) == null ? void 0 : d.name) || "",
127
- src: (K = c.workspace) == null ? void 0 : K.photo_url,
121
+ t("div", Ee, [
122
+ t("div", De, p((V = d.workspace) == null ? void 0 : V.title), 1),
123
+ t("div", Re, [
124
+ t("div", Fe, [
125
+ t("div", We, [
126
+ H(de, {
127
+ text: ((v = d.workspace) == null ? void 0 : v.name) || "",
128
+ src: (c = d.workspace) == null ? void 0 : c.photo_url,
128
129
  size: 44,
129
130
  rounded: !1,
130
131
  class: "mx-auto"
131
132
  }, null, 8, ["text", "src"])
132
133
  ]),
133
- t("div", We, h(($ = c.workspace) == null ? void 0 : $.name), 1),
134
- t("div", Pe, [
134
+ t("div", Pe, p(($ = d.workspace) == null ? void 0 : $.name), 1),
135
+ t("div", Te, [
135
136
  t("button", {
136
137
  class: "text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",
137
138
  onClick: n
138
- }, h(c.changeLabel), 1)
139
+ }, p(d.changeLabel), 1)
139
140
  ])
140
141
  ]),
141
- m[0] || (m[0] = t("hr", null, null, -1))
142
+ h[0] || (h[0] = t("hr", null, null, -1))
142
143
  ])
143
144
  ]),
144
- t("div", Fe, [
145
- t("div", Te, h(c.appsTitle), 1),
145
+ t("div", Ue, [
146
+ t("div", Ne, p(d.appsTitle), 1),
146
147
  t("div", null, [
147
- c.apps && c.apps.length ? (s(), o("div", Ue, [
148
- (s(!0), o(B, null, E(y.value, (S) => (s(), o("div", {
149
- key: S.id,
150
- onClick: (i) => w(S),
148
+ d.apps && d.apps.length ? (s(), l("div", qe, [
149
+ (s(!0), l(B, null, D(m.value, (I) => (s(), l("div", {
150
+ key: I.id,
151
+ onClick: (i) => g(I),
151
152
  class: "flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"
152
153
  }, [
153
- G(ue, {
154
- text: S.name,
155
- src: S.photo_url,
154
+ H(de, {
155
+ text: I.name,
156
+ src: I.photo_url,
156
157
  size: 44,
157
158
  rounded: !1
158
159
  }, null, 8, ["text", "src"]),
159
- t("div", qe, [
160
- t("p", Ge, h(S.name), 1),
161
- t("p", He, h(S.short), 1)
160
+ t("div", He, [
161
+ t("p", Je, p(I.name), 1),
162
+ t("p", Xe, p(I.short), 1)
162
163
  ])
163
- ], 8, Ne))), 128))
164
- ])) : f("", !0),
165
- c.apps && c.apps.length > de ? (s(), o("button", {
164
+ ], 8, Ge))), 128))
165
+ ])) : y("", !0),
166
+ d.apps && d.apps.length > ce ? (s(), l("button", {
166
167
  key: 1,
167
- onClick: b,
168
+ onClick: k,
168
169
  class: "mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs"
169
- }, h(a.value ? "Приховати" : "Дивитися всі"), 1)) : f("", !0)
170
+ }, p(a.value ? "Приховати" : "Дивитися всі"), 1)) : y("", !0)
170
171
  ])
171
172
  ])
172
173
  ];
@@ -174,7 +175,7 @@ const Nt = /* @__PURE__ */ me(je, [["render", Ae]]), Be = ["onClick"], Ie = { cl
174
175
  _: 1
175
176
  }));
176
177
  }
177
- }), Je = {
178
+ }), Ye = {
178
179
  useModal: {
179
180
  required: !0,
180
181
  type: Object
@@ -210,7 +211,7 @@ const Nt = /* @__PURE__ */ me(je, [["render", Ae]]), Be = ["onClick"], Ie = { cl
210
211
  type: String,
211
212
  default: ""
212
213
  }
213
- }, Xe = {
214
+ }, Ze = {
214
215
  "3xs": ["max-w-xs"],
215
216
  xs: ["max-w-sm"],
216
217
  sm: ["max-w-md"],
@@ -224,73 +225,73 @@ const Nt = /* @__PURE__ */ me(je, [["render", Ae]]), Be = ["onClick"], Ie = { cl
224
225
  "4xl": ["max-w-5xl"],
225
226
  "5xl": ["max-w-5xl"],
226
227
  "7xl": ["max-w-7xl"]
227
- }, Ye = (V = "medium") => {
228
- const p = [];
229
- return p.push(...Xe[V] ?? []), p;
230
- }, Ze = { class: "relative bg-white rounded-lg shadow h-full" }, Qe = /* @__PURE__ */ N({
228
+ }, Qe = (K = "medium") => {
229
+ const f = [];
230
+ return f.push(...Ze[K] ?? []), f;
231
+ }, et = { class: "relative bg-white rounded-lg shadow h-full" }, tt = /* @__PURE__ */ q({
231
232
  __name: "OneModal",
232
- props: Je,
233
+ props: Ye,
233
234
  emits: ["isOpen", "closed"],
234
- setup(V, { expose: p, emit: n }) {
235
- const a = V, y = n, b = j(() => {
236
- var k, M;
235
+ setup(K, { expose: f, emit: n }) {
236
+ const a = K, m = n, k = A(() => {
237
+ var x, O;
237
238
  const i = a.useModal;
238
- return ((k = i == null ? void 0 : i.isOpened) == null ? void 0 : k.value) ?? ((M = i == null ? void 0 : i.isOpen) == null ? void 0 : M.value) ?? !1;
239
- }), w = j(() => Ye(a.size)), c = j(() => a.customWidth ? { width: a.customWidth } : {}), m = C(null), v = C(!1);
240
- function d(i) {
241
- v.value = !1, m.value && !m.value.contains(i.target) && (v.value = !0);
239
+ return ((x = i == null ? void 0 : i.isOpened) == null ? void 0 : x.value) ?? ((O = i == null ? void 0 : i.isOpen) == null ? void 0 : O.value) ?? !1;
240
+ }), g = A(() => Qe(a.size)), d = A(() => a.customWidth ? { width: a.customWidth } : {}), h = _(null), V = _(!1);
241
+ function v(i) {
242
+ V.value = !1, h.value && !h.value.contains(i.target) && (V.value = !0);
242
243
  }
243
- function K(i) {
244
- v.value && m.value && !m.value.contains(i.target) && $();
244
+ function c(i) {
245
+ V.value && h.value && !h.value.contains(i.target) && $();
245
246
  }
246
247
  const $ = () => {
247
- var k, M;
248
+ var x, O;
248
249
  if (a.canClose && !a.canClose())
249
250
  return;
250
251
  const i = a.useModal;
251
- (k = i == null ? void 0 : i.close) == null || k.call(i), (M = a.onClose) == null || M.call(a), y("closed"), y("isOpen");
252
+ (x = i == null ? void 0 : i.close) == null || x.call(i), (O = a.onClose) == null || O.call(a), m("closed"), m("isOpen");
252
253
  };
253
- return p({
254
+ return f({
254
255
  open: () => {
255
- var k;
256
+ var x;
256
257
  const i = a.useModal;
257
- (k = i == null ? void 0 : i.open) == null || k.call(i), y("isOpen");
258
+ (x = i == null ? void 0 : i.open) == null || x.call(i), m("isOpen");
258
259
  },
259
260
  close: $
260
- }), (i, k) => b.value ? (s(), o("div", {
261
+ }), (i, x) => k.value ? (s(), l("div", {
261
262
  key: 0,
262
263
  tabindex: "-1",
263
- onMousedown: d,
264
- onMouseup: K,
265
- class: x(["modal backdrop !m-0", { "modal-mobile": i.classModal }])
264
+ onMousedown: v,
265
+ onMouseup: c,
266
+ class: b(["modal backdrop !m-0", { "modal-mobile": i.classModal }])
266
267
  }, [
267
268
  t("div", {
268
- class: x([
269
+ class: b([
269
270
  "relative w-full max-h-full",
270
- w.value,
271
+ g.value,
271
272
  { "fixed bottom-0 left-0 right-0 w-full bg-white rounded-t-xl mobile-modal": i.classModal }
272
273
  ]),
273
- style: U(c.value),
274
+ style: N(d.value),
274
275
  ref_key: "modalContent",
275
- ref: m
276
+ ref: h
276
277
  }, [
277
- t("div", Ze, [
278
- i.title ? (s(), o("div", {
278
+ t("div", et, [
279
+ i.title ? (s(), l("div", {
279
280
  key: 0,
280
- class: x([
281
+ class: b([
281
282
  i.titleCenter ? "grid grid-cols-4" : "flex items-start justify-between",
282
283
  "p-3 border-b rounded-t",
283
284
  i.classTitle
284
285
  ])
285
286
  }, [
286
287
  t("h3", {
287
- class: x(["text-xl font-semibold text-gray-900 whitespace-nowrap overflow-hidden text-ellipsis", i.titleCenter ? "col-span-2 text-center col-start-2" : ""])
288
- }, h(i.title), 3),
288
+ class: b(["text-xl font-semibold text-gray-900 whitespace-nowrap overflow-hidden text-ellipsis", i.titleCenter ? "col-span-2 text-center col-start-2" : ""])
289
+ }, p(i.title), 3),
289
290
  t("button", {
290
291
  type: "button",
291
292
  class: "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center",
292
293
  onClick: $
293
- }, [...k[0] || (k[0] = [
294
+ }, [...x[0] || (x[0] = [
294
295
  t("svg", {
295
296
  xmlns: "http://www.w3.org/2000/svg",
296
297
  fill: "none",
@@ -307,59 +308,59 @@ const Nt = /* @__PURE__ */ me(je, [["render", Ae]]), Be = ["onClick"], Ie = { cl
307
308
  })
308
309
  ], -1)
309
310
  ])])
310
- ], 2)) : f("", !0),
311
- _(i.$slots, "header", {}, void 0, !0),
312
- _(i.$slots, "body", {}, void 0, !0),
313
- _(i.$slots, "default", {}, void 0, !0),
314
- _(i.$slots, "footer", { close: $ }, void 0, !0)
311
+ ], 2)) : y("", !0),
312
+ M(i.$slots, "header", {}, void 0, !0),
313
+ M(i.$slots, "body", {}, void 0, !0),
314
+ M(i.$slots, "default", {}, void 0, !0),
315
+ M(i.$slots, "footer", { close: $ }, void 0, !0)
315
316
  ])
316
317
  ], 6)
317
- ], 34)) : f("", !0);
318
+ ], 34)) : y("", !0);
318
319
  }
319
320
  });
320
- const et = /* @__PURE__ */ me(Qe, [["__scopeId", "data-v-3560b61e"]]);
321
- function tt(V = !1) {
322
- const p = C(V), n = C(void 0);
321
+ const st = /* @__PURE__ */ fe(tt, [["__scopeId", "data-v-3560b61e"]]);
322
+ function lt(K = !1) {
323
+ const f = _(K), n = _(void 0);
323
324
  let a = null;
324
- const y = () => {
325
- a && (clearTimeout(a), a = null), p.value = !1, n.value = void 0;
326
- }, b = (m) => {
327
- n.value = m, p.value = !0;
328
- }, w = (m) => {
329
- a && clearTimeout(a), a = setTimeout(y, m * 1e3);
330
- }, c = (m) => {
331
- m.key === "Escape" && p.value && y();
325
+ const m = () => {
326
+ a && (clearTimeout(a), a = null), f.value = !1, n.value = void 0;
327
+ }, k = (h) => {
328
+ n.value = h, f.value = !0;
329
+ }, g = (h) => {
330
+ a && clearTimeout(a), a = setTimeout(m, h * 1e3);
331
+ }, d = (h) => {
332
+ h.key === "Escape" && f.value && m();
332
333
  };
333
- return ve(() => {
334
- document.addEventListener("keydown", c);
335
- }), pe(() => {
336
- document.removeEventListener("keydown", c), a && clearTimeout(a);
334
+ return me(() => {
335
+ document.addEventListener("keydown", d);
336
+ }), ve(() => {
337
+ document.removeEventListener("keydown", d), a && clearTimeout(a);
337
338
  }), {
338
- isOpened: p,
339
- isOpen: p,
339
+ isOpened: f,
340
+ isOpen: f,
340
341
  // alias for backward compatibility
341
342
  data: n,
342
- open: b,
343
- close: y,
344
- closeWithDelay: w
343
+ open: k,
344
+ close: m,
345
+ closeWithDelay: g
345
346
  };
346
347
  }
347
- const st = ["onClick"], lt = ["onKeydown"], ot = {
348
+ const ot = ["onClick"], nt = ["onKeydown"], rt = {
348
349
  key: 0,
349
350
  class: "text-sm font-medium text-gray-700 px-3 pt-2.5 pb-1.5"
350
- }, nt = {
351
+ }, at = {
351
352
  key: 1,
352
353
  class: "px-3 py-2"
353
- }, rt = { class: "relative" }, at = ["placeholder"], it = {
354
+ }, it = { class: "relative" }, ut = ["placeholder"], dt = {
354
355
  key: 2,
355
356
  class: "border-b border-gray-100"
356
- }, ut = ["onClick"], dt = {
357
+ }, ct = ["onClick"], pt = {
357
358
  key: 3,
358
359
  class: "flex items-center justify-between px-3 py-1.5 border-b border-gray-100"
359
- }, ct = {
360
+ }, vt = {
360
361
  key: 4,
361
362
  class: "flex justify-center py-4"
362
- }, pt = ["aria-selected", "onClick"], vt = {
363
+ }, mt = ["aria-selected", "onClick"], ft = {
363
364
  key: 0,
364
365
  xmlns: "http://www.w3.org/2000/svg",
365
366
  fill: "none",
@@ -367,10 +368,10 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
367
368
  "stroke-width": "1.5",
368
369
  stroke: "currentColor",
369
370
  class: "w-4 h-4 text-blue-600 shrink-0"
370
- }, mt = {
371
+ }, ht = {
371
372
  key: 1,
372
373
  class: "w-4 h-4 shrink-0"
373
- }, ft = ["aria-selected", "onClick", "onMouseenter"], ht = {
374
+ }, yt = ["aria-selected", "onClick", "onMouseenter"], wt = {
374
375
  key: 0,
375
376
  xmlns: "http://www.w3.org/2000/svg",
376
377
  fill: "none",
@@ -378,10 +379,10 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
378
379
  "stroke-width": "1.5",
379
380
  stroke: "currentColor",
380
381
  class: "w-4 h-4 text-blue-600 shrink-0"
381
- }, yt = {
382
+ }, gt = {
382
383
  key: 1,
383
384
  class: "w-4 h-4 shrink-0"
384
- }, wt = ["aria-selected", "onClick", "onMouseenter"], gt = {
385
+ }, bt = ["aria-selected", "onClick", "onMouseenter"], kt = {
385
386
  key: 0,
386
387
  xmlns: "http://www.w3.org/2000/svg",
387
388
  fill: "none",
@@ -389,29 +390,29 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
389
390
  "stroke-width": "1.5",
390
391
  stroke: "currentColor",
391
392
  class: "w-4 h-4 text-blue-600 shrink-0"
392
- }, bt = {
393
+ }, xt = {
393
394
  key: 1,
394
395
  class: "w-4 h-4 shrink-0"
395
- }, kt = {
396
+ }, Ct = {
396
397
  key: 3,
397
398
  class: "px-3 py-4 text-sm text-gray-500 text-center"
398
- }, xt = { class: "pb-6" }, Ct = {
399
+ }, _t = { class: "pb-6" }, $t = {
399
400
  key: 0,
400
401
  class: "relative px-3 py-3"
401
- }, _t = { class: "relative" }, $t = ["placeholder"], Mt = {
402
+ }, Mt = { class: "relative" }, Vt = ["placeholder"], Kt = {
402
403
  key: 1,
403
404
  class: "px-3 py-2"
404
- }, Vt = {
405
+ }, Ot = {
405
406
  key: 2,
406
407
  class: "flex items-center justify-between px-3 py-2 border-b border-gray-100"
407
- }, Kt = {
408
+ }, Lt = {
408
409
  key: 3,
409
410
  class: "flex justify-center py-8"
410
- }, Lt = {
411
+ }, jt = {
411
412
  key: 4,
412
413
  class: "overflow-auto h-[60dvh] divide-y",
413
414
  role: "listbox"
414
- }, Ot = ["aria-selected"], jt = {
415
+ }, At = ["aria-selected"], St = {
415
416
  key: 0,
416
417
  xmlns: "http://www.w3.org/2000/svg",
417
418
  fill: "none",
@@ -419,13 +420,13 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
419
420
  "stroke-width": "1.5",
420
421
  stroke: "currentColor",
421
422
  class: "w-5 h-5 text-blue-600 shrink-0"
422
- }, St = {
423
+ }, Bt = {
423
424
  key: 1,
424
425
  class: "w-5 h-5 shrink-0"
425
- }, At = {
426
+ }, It = {
426
427
  key: 0,
427
428
  class: "px-3 pt-3 pb-2 text-xs font-semibold text-gray-400 uppercase tracking-wide"
428
- }, Bt = ["aria-selected", "onClick"], It = {
429
+ }, zt = ["aria-selected", "onClick"], Et = {
429
430
  key: 0,
430
431
  xmlns: "http://www.w3.org/2000/svg",
431
432
  fill: "none",
@@ -433,10 +434,10 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
433
434
  "stroke-width": "1.5",
434
435
  stroke: "currentColor",
435
436
  class: "w-5 h-5 text-blue-600 shrink-0"
436
- }, zt = {
437
+ }, Dt = {
437
438
  key: 1,
438
439
  class: "w-5 h-5 shrink-0"
439
- }, Et = ["aria-selected", "onClick"], Dt = {
440
+ }, Rt = ["aria-selected", "onClick"], Ft = {
440
441
  key: 0,
441
442
  xmlns: "http://www.w3.org/2000/svg",
442
443
  fill: "none",
@@ -444,128 +445,128 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
444
445
  "stroke-width": "1.5",
445
446
  stroke: "currentColor",
446
447
  class: "w-5 h-5 text-blue-600 shrink-0"
447
- }, Rt = {
448
+ }, Wt = {
448
449
  key: 1,
449
450
  class: "w-5 h-5 shrink-0"
450
- }, Wt = {
451
+ }, Pt = {
451
452
  key: 3,
452
453
  class: "px-3 py-8 text-sm text-gray-500 text-center"
453
- }, Gt = /* @__PURE__ */ N({
454
+ }, Xt = /* @__PURE__ */ q({
454
455
  __name: "OneDropdownSelect",
455
- props: Ce,
456
+ props: _e,
456
457
  emits: ["update:modelValue", "search", "create"],
457
- setup(V, { emit: p }) {
458
- const n = V, a = p, y = C(!1);
459
- let b = null;
460
- ve(() => {
461
- b = window.matchMedia("(max-width: 767px)"), y.value = b.matches;
462
- const e = (l) => {
463
- y.value = l.matches;
458
+ setup(K, { emit: f }) {
459
+ const n = K, a = Oe(), m = f, k = _(!1);
460
+ let g = null;
461
+ me(() => {
462
+ g = window.matchMedia("(max-width: 767px)"), k.value = g.matches;
463
+ const e = (o) => {
464
+ k.value = o.matches;
464
465
  };
465
- b.addEventListener("change", e), Ve(() => {
466
- b == null || b.removeEventListener("change", e);
466
+ g.addEventListener("change", e), Ke(() => {
467
+ g == null || g.removeEventListener("change", e);
467
468
  });
468
469
  });
469
- const w = tt(), c = C(null), m = () => {
470
- v.value = "", d.value = -1, w.open(), H(() => {
470
+ const d = lt(), h = _(null), V = () => {
471
+ v.value = "", c.value = -1, d.open(), J(() => {
471
472
  var e;
472
- (e = c.value) == null || e.focus();
473
+ (e = h.value) == null || e.focus();
473
474
  });
474
- }, v = C(""), d = C(-1), K = C(null), $ = C(null), S = C({}), i = (e, l) => {
475
- e && (S.value[l] = e);
476
- }, k = j(() => n.allowEmpty ? 1 : 0), M = j(() => {
475
+ }, v = _(""), c = _(-1), $ = _(null), I = _(null), i = _({}), x = (e, o) => {
476
+ e && (i.value[o] = e);
477
+ }, O = A(() => n.allowEmpty ? 1 : 0), E = A(() => {
477
478
  if (!v.value.trim())
478
479
  return n.items;
479
480
  const e = v.value.toLowerCase();
480
481
  return n.items.filter(
481
- (l) => String(l[n.labelKey] ?? "").toLowerCase().includes(e)
482
+ (o) => String(o[n.labelKey] ?? "").toLowerCase().includes(e)
482
483
  );
483
- }), X = j(() => {
484
+ }), Y = A(() => {
484
485
  if (!n.groupKey)
485
486
  return [];
486
- const e = [], l = /* @__PURE__ */ new Map();
487
- let u = k.value;
488
- for (const r of M.value) {
489
- const O = String(r[n.groupKey] ?? "");
490
- let g = l.get(O);
491
- g || (g = { label: O, entries: [] }, l.set(O, g), e.push(g)), g.entries.push({ item: r, flatIndex: u }), u++;
487
+ const e = [], o = /* @__PURE__ */ new Map();
488
+ let u = O.value;
489
+ for (const r of E.value) {
490
+ const j = String(r[n.groupKey] ?? "");
491
+ let w = o.get(j);
492
+ w || (w = { label: j, entries: [] }, o.set(j, w), e.push(w)), w.entries.push({ item: r, flatIndex: u }), u++;
492
493
  }
493
494
  return e;
494
- }), A = j(() => n.multiple ? (n.modelValue ?? []).length > 0 : n.modelValue !== null && n.modelValue !== void 0), R = j(() => {
495
+ }), S = A(() => n.multiple ? (n.modelValue ?? []).length > 0 : n.modelValue !== null && n.modelValue !== void 0), F = A(() => {
495
496
  if (n.multiple) {
496
497
  const e = n.modelValue ?? [];
497
498
  return e.length === 0 ? n.placeholder : e.length === 1 ? e[0][n.labelKey] ?? n.placeholder : `${e[0][n.labelKey]} +${e.length - 1}`;
498
499
  }
499
500
  return n.modelValue === null || n.modelValue === void 0 ? n.placeholder : n.modelValue[n.labelKey] ?? n.placeholder;
500
- }), L = (e) => n.modelValue ? n.multiple ? n.modelValue.some((u) => u[n.valueKey] === e[n.valueKey]) : n.modelValue[n.valueKey] === e[n.valueKey] : !1, Y = j(() => M.value.length + k.value), z = (e, l) => {
501
+ }), L = (e) => n.modelValue ? n.multiple ? n.modelValue.some((u) => u[n.valueKey] === e[n.valueKey]) : n.modelValue[n.valueKey] === e[n.valueKey] : !1, Z = A(() => E.value.length + O.value), z = (e, o) => {
501
502
  if (n.multiple) {
502
503
  const u = (n.modelValue ?? []).slice();
503
504
  if (e === null) {
504
- a("update:modelValue", []);
505
+ m("update:modelValue", []);
505
506
  return;
506
507
  }
507
- const r = u.findIndex((O) => O[n.valueKey] === e[n.valueKey]);
508
- r >= 0 ? u.splice(r, 1) : u.push(e), a("update:modelValue", u);
508
+ const r = u.findIndex((j) => j[n.valueKey] === e[n.valueKey]);
509
+ r >= 0 ? u.splice(r, 1) : u.push(e), m("update:modelValue", u);
509
510
  return;
510
511
  }
511
- a("update:modelValue", e), l();
512
- }, Z = () => {
513
- a("update:modelValue", [...n.items]);
512
+ m("update:modelValue", e), o();
514
513
  }, Q = () => {
515
- a("update:modelValue", []);
516
- }, ee = (e) => {
517
- a("create", v.value), e();
518
- }, fe = () => {
519
- v.value = "", d.value = -1, H(() => {
514
+ m("update:modelValue", [...n.items]);
515
+ }, ee = () => {
516
+ m("update:modelValue", []);
517
+ }, te = (e) => {
518
+ m("create", v.value), e();
519
+ }, he = () => {
520
+ v.value = "", c.value = -1, J(() => {
520
521
  var e;
521
- (e = K.value) == null || e.focus();
522
+ (e = $.value) == null || e.focus();
522
523
  });
523
- }, he = () => {
524
- v.value = "", d.value = -1;
525
- }, te = () => {
526
- d.value = 0, a("search", v.value);
524
+ }, ye = () => {
525
+ v.value = "", c.value = -1;
527
526
  }, se = () => {
528
- H(() => {
529
- const e = S.value[d.value];
527
+ c.value = 0, m("search", v.value);
528
+ }, le = () => {
529
+ J(() => {
530
+ const e = i.value[c.value];
530
531
  e && e.scrollIntoView({ block: "nearest" });
531
532
  });
532
- }, ye = (e, l) => {
533
+ }, we = (e, o) => {
533
534
  switch (e.key) {
534
535
  case "ArrowDown":
535
- e.preventDefault(), d.value < Y.value - 1 ? d.value++ : d.value = 0, se();
536
+ e.preventDefault(), c.value < Z.value - 1 ? c.value++ : c.value = 0, le();
536
537
  break;
537
538
  case "ArrowUp":
538
- e.preventDefault(), d.value > 0 ? d.value-- : d.value = Y.value - 1, se();
539
+ e.preventDefault(), c.value > 0 ? c.value-- : c.value = Z.value - 1, le();
539
540
  break;
540
541
  case "Enter":
541
- if (e.preventDefault(), d.value >= 0)
542
- if (n.allowEmpty && d.value === 0)
543
- z(null, l);
542
+ if (e.preventDefault(), c.value >= 0)
543
+ if (n.allowEmpty && c.value === 0)
544
+ z(null, o);
544
545
  else {
545
- const u = d.value - k.value, r = M.value[u];
546
- r && z(r, l);
546
+ const u = c.value - O.value, r = E.value[u];
547
+ r && z(r, o);
547
548
  }
548
549
  break;
549
550
  case "Escape":
550
- e.preventDefault(), l();
551
+ e.preventDefault(), o();
551
552
  break;
552
553
  }
553
554
  };
554
- return ce(v, () => {
555
- d.value = 0;
556
- }), (e, l) => y.value ? (s(), o(B, { key: 1 }, [
557
- _(e.$slots, "button", P(F({ onToggle: m, isExpanded: I(w).isOpened.value, selectedLabel: R.value })), () => [
555
+ return pe(v, () => {
556
+ c.value = 0;
557
+ }), (e, o) => k.value ? (s(), l(B, { key: 1 }, [
558
+ M(e.$slots, "button", P(T({ onToggle: V, isExpanded: C(d).isOpened.value, selectedLabel: F.value })), () => [
558
559
  t("button", {
559
- class: x(["inline-flex items-center justify-between gap-2 text-sm transition-colors", [
560
+ class: b(["inline-flex items-center justify-between gap-2 text-sm transition-colors", [
560
561
  e.view === "pill" ? "rounded-full bg-gray-100 px-3.5 py-1.5 hover:bg-gray-200 text-gray-700" : "rounded-lg border border-gray-300 bg-white px-3 py-2 hover:bg-gray-50 min-w-[180px]"
561
562
  ]]),
562
- style: U(e.maxWidth ? { maxWidth: e.maxWidth } : void 0),
563
- onClick: m
563
+ style: N(e.maxWidth ? { maxWidth: e.maxWidth } : void 0),
564
+ onClick: V
564
565
  }, [
565
566
  t("span", {
566
- class: x(["truncate", e.view === "pill" ? "" : A.value ? "text-gray-900" : "text-gray-500"])
567
- }, h(R.value), 3),
568
- l[13] || (l[13] = t("svg", {
567
+ class: b(["truncate", e.view === "pill" ? "" : S.value ? "text-gray-900" : "text-gray-500"])
568
+ }, p(F.value), 3),
569
+ o[12] || (o[12] = t("svg", {
569
570
  xmlns: "http://www.w3.org/2000/svg",
570
571
  fill: "none",
571
572
  viewBox: "0 0 24 24",
@@ -581,19 +582,19 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
581
582
  ], -1))
582
583
  ], 6)
583
584
  ]),
584
- I(w).isOpened.value ? (s(), T(I(et), {
585
+ C(d).isOpened.value ? (s(), U(C(st), {
585
586
  key: 0,
586
- useModal: I(w),
587
+ useModal: C(d),
587
588
  title: e.title || e.placeholder,
588
589
  size: "sm",
589
590
  classModal: !0,
590
591
  titleCenter: !0
591
592
  }, {
592
- default: D(() => [
593
- t("div", xt, [
594
- e.searchable ? (s(), o("div", Ct, [
595
- t("div", _t, [
596
- l[14] || (l[14] = t("svg", {
593
+ default: R(() => [
594
+ t("div", _t, [
595
+ e.searchable ? (s(), l("div", $t, [
596
+ t("div", Mt, [
597
+ o[13] || (o[13] = t("svg", {
597
598
  xmlns: "http://www.w3.org/2000/svg",
598
599
  fill: "none",
599
600
  viewBox: "0 0 24 24",
@@ -607,25 +608,25 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
607
608
  d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
608
609
  })
609
610
  ], -1)),
610
- J(t("input", {
611
+ X(t("input", {
611
612
  ref_key: "mobileSearchInputRef",
612
- ref: c,
613
- "onUpdate:modelValue": l[2] || (l[2] = (u) => v.value = u),
613
+ ref: h,
614
+ "onUpdate:modelValue": o[2] || (o[2] = (u) => v.value = u),
614
615
  type: "text",
615
616
  placeholder: e.searchPlaceholder,
616
617
  class: "w-full rounded-md border border-gray-300 py-2 pl-8 pr-3 text-sm outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",
617
- onInput: te
618
- }, null, 40, $t), [
619
- [ae, v.value]
618
+ onInput: se
619
+ }, null, 40, Vt), [
620
+ [ie, v.value]
620
621
  ])
621
622
  ])
622
- ])) : f("", !0),
623
- e.createLabel ? (s(), o("div", Mt, [
623
+ ])) : y("", !0),
624
+ e.createLabel ? (s(), l("div", Kt, [
624
625
  t("button", {
625
626
  class: "w-full flex items-center justify-center gap-2 py-2 text-sm text-blue-700 hover:text-blue-500",
626
- onClick: l[3] || (l[3] = (u) => ee(() => I(w).close()))
627
+ onClick: o[3] || (o[3] = (u) => te(() => C(d).close()))
627
628
  }, [
628
- l[15] || (l[15] = t("svg", {
629
+ o[14] || (o[14] = t("svg", {
629
630
  xmlns: "http://www.w3.org/2000/svg",
630
631
  fill: "none",
631
632
  viewBox: "0 0 24 24",
@@ -639,134 +640,134 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
639
640
  d: "M12 4.5v15m7.5-7.5h-15"
640
641
  })
641
642
  ], -1)),
642
- t("span", null, h(e.createLabel), 1)
643
+ t("span", null, p(e.createLabel), 1)
643
644
  ])
644
- ])) : f("", !0),
645
- e.multiple ? (s(), o("div", Vt, [
645
+ ])) : y("", !0),
646
+ e.multiple ? (s(), l("div", Ot, [
646
647
  t("button", {
647
648
  class: "text-sm text-blue-600 hover:text-blue-800 transition-colors",
648
- onClick: Z
649
- }, " Обрати все "),
650
- A.value ? (s(), o("button", {
649
+ onClick: Q
650
+ }, p(C(a)("ui.dropdown.selectAll")), 1),
651
+ S.value ? (s(), l("button", {
651
652
  key: 0,
652
653
  class: "text-sm text-gray-500 hover:text-gray-700 transition-colors",
653
- onClick: Q
654
- }, " Очистити ")) : f("", !0)
655
- ])) : f("", !0),
656
- e.isLoading ? (s(), o("div", Kt, [...l[16] || (l[16] = [
654
+ onClick: ee
655
+ }, p(C(a)("ui.dropdown.clear")), 1)) : y("", !0)
656
+ ])) : y("", !0),
657
+ e.isLoading ? (s(), l("div", Lt, [...o[15] || (o[15] = [
657
658
  t("div", { class: "animate-spin w-6 h-6 border-2 border-blue-500 border-t-transparent rounded-full" }, null, -1)
658
- ])])) : (s(), o("div", Lt, [
659
- e.allowEmpty ? (s(), o("button", {
659
+ ])])) : (s(), l("div", jt, [
660
+ e.allowEmpty ? (s(), l("button", {
660
661
  key: 0,
661
- class: x(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors", A.value ? "" : "bg-gray-50 font-medium"]),
662
+ class: b(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors", S.value ? "" : "bg-gray-50 font-medium"]),
662
663
  role: "option",
663
- "aria-selected": !A.value,
664
- onClick: l[4] || (l[4] = (u) => z(null, () => I(w).close()))
664
+ "aria-selected": !S.value,
665
+ onClick: o[4] || (o[4] = (u) => z(null, () => C(d).close()))
665
666
  }, [
666
- A.value ? (s(), o("span", St)) : (s(), o("svg", jt, [...l[17] || (l[17] = [
667
+ S.value ? (s(), l("span", Bt)) : (s(), l("svg", St, [...o[16] || (o[16] = [
667
668
  t("path", {
668
669
  "stroke-linecap": "round",
669
670
  "stroke-linejoin": "round",
670
671
  d: "M4.5 12.75l6 6 9-13.5"
671
672
  }, null, -1)
672
673
  ])])),
673
- t("span", null, h(e.emptyLabel ?? e.placeholder), 1)
674
- ], 10, Ot)) : f("", !0),
675
- e.groupKey ? (s(!0), o(B, { key: 1 }, E(X.value, (u) => (s(), o(B, {
674
+ t("span", null, p(e.emptyLabel ?? e.placeholder), 1)
675
+ ], 10, At)) : y("", !0),
676
+ e.groupKey ? (s(!0), l(B, { key: 1 }, D(Y.value, (u) => (s(), l(B, {
676
677
  key: u.label
677
678
  }, [
678
- u.label ? (s(), o("div", At, h(u.label), 1)) : f("", !0),
679
- (s(!0), o(B, null, E(u.entries, (r) => (s(), o("button", {
679
+ u.label ? (s(), l("div", It, p(u.label), 1)) : y("", !0),
680
+ (s(!0), l(B, null, D(u.entries, (r) => (s(), l("button", {
680
681
  key: r.item[e.valueKey],
681
- class: x(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", L(r.item) ? "bg-gray-50 font-medium" : ""]),
682
+ class: b(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", L(r.item) ? "bg-gray-50 font-medium" : ""]),
682
683
  role: "option",
683
684
  "aria-selected": L(r.item),
684
- onClick: (O) => z(r.item, () => I(w).close())
685
+ onClick: (j) => z(r.item, () => C(d).close())
685
686
  }, [
686
- L(r.item) ? (s(), o("svg", It, [...l[18] || (l[18] = [
687
+ L(r.item) ? (s(), l("svg", Et, [...o[17] || (o[17] = [
687
688
  t("path", {
688
689
  "stroke-linecap": "round",
689
690
  "stroke-linejoin": "round",
690
691
  d: "M4.5 12.75l6 6 9-13.5"
691
692
  }, null, -1)
692
- ])])) : (s(), o("span", zt)),
693
- _(e.$slots, "item", W({ ref_for: !0 }, { item: r.item }), () => [
694
- t("span", null, h(r.item[e.labelKey]), 1)
693
+ ])])) : (s(), l("span", Dt)),
694
+ M(e.$slots, "item", W({ ref_for: !0 }, { item: r.item }), () => [
695
+ t("span", null, p(r.item[e.labelKey]), 1)
695
696
  ])
696
- ], 10, Bt))), 128))
697
- ], 64))), 128)) : (s(!0), o(B, { key: 2 }, E(M.value, (u) => (s(), o("button", {
697
+ ], 10, zt))), 128))
698
+ ], 64))), 128)) : (s(!0), l(B, { key: 2 }, D(E.value, (u) => (s(), l("button", {
698
699
  key: u[e.valueKey],
699
- class: x(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", L(u) ? "bg-gray-50 font-medium" : ""]),
700
+ class: b(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", L(u) ? "bg-gray-50 font-medium" : ""]),
700
701
  role: "option",
701
702
  "aria-selected": L(u),
702
- onClick: (r) => z(u, () => I(w).close())
703
+ onClick: (r) => z(u, () => C(d).close())
703
704
  }, [
704
- L(u) ? (s(), o("svg", Dt, [...l[19] || (l[19] = [
705
+ L(u) ? (s(), l("svg", Ft, [...o[18] || (o[18] = [
705
706
  t("path", {
706
707
  "stroke-linecap": "round",
707
708
  "stroke-linejoin": "round",
708
709
  d: "M4.5 12.75l6 6 9-13.5"
709
710
  }, null, -1)
710
- ])])) : (s(), o("span", Rt)),
711
- _(e.$slots, "item", W({ ref_for: !0 }, { item: u }), () => [
712
- t("span", null, h(u[e.labelKey]), 1)
711
+ ])])) : (s(), l("span", Wt)),
712
+ M(e.$slots, "item", W({ ref_for: !0 }, { item: u }), () => [
713
+ t("span", null, p(u[e.labelKey]), 1)
713
714
  ])
714
- ], 10, Et))), 128)),
715
- M.value.length === 0 && !e.allowEmpty ? (s(), o("div", Wt, [
716
- _(e.$slots, "empty", {}, () => [
717
- l[20] || (l[20] = ie(" Nothing found ", -1))
715
+ ], 10, Rt))), 128)),
716
+ E.value.length === 0 && !e.allowEmpty ? (s(), l("div", Pt, [
717
+ M(e.$slots, "empty", {}, () => [
718
+ ue(p(C(a)("ui.dropdown.nothingFound")), 1)
718
719
  ])
719
- ])) : f("", !0)
720
+ ])) : y("", !0)
720
721
  ]))
721
722
  ])
722
723
  ]),
723
724
  _: 3
724
- }, 8, ["useModal", "title"])) : f("", !0)
725
- ], 64)) : (s(), T(Oe, {
725
+ }, 8, ["useModal", "title"])) : y("", !0)
726
+ ], 64)) : (s(), U(Ae, {
726
727
  key: 0,
727
728
  stick: e.stick,
728
- onOpen: fe,
729
- onClose: he
729
+ onOpen: he,
730
+ onClose: ye
730
731
  }, {
731
- button: D(({ onToggle: u, isExpanded: r }) => [
732
- _(e.$slots, "button", P(F({ onToggle: u, isExpanded: r, selectedLabel: R.value })), () => [
732
+ button: R(({ onToggle: u, isExpanded: r }) => [
733
+ M(e.$slots, "button", P(T({ onToggle: u, isExpanded: r, selectedLabel: F.value })), () => [
733
734
  t("button", {
734
- class: x(["inline-flex items-center justify-between gap-2 text-sm transition-colors", [
735
+ class: b(["inline-flex items-center justify-between gap-2 text-sm transition-colors", [
735
736
  e.view === "pill" ? "rounded-full bg-gray-100 px-3.5 py-1.5 hover:bg-gray-200 text-gray-700" : "rounded-lg border border-gray-300 bg-white px-3 py-2 hover:bg-gray-50 min-w-[180px]",
736
737
  e.view === "default" && r ? "ring-1 ring-blue-500 border-blue-500" : ""
737
738
  ]]),
738
- style: U(e.maxWidth ? { maxWidth: e.maxWidth } : void 0),
739
+ style: N(e.maxWidth ? { maxWidth: e.maxWidth } : void 0),
739
740
  onClick: u
740
741
  }, [
741
742
  t("span", {
742
- class: x(["truncate", e.view === "pill" ? "" : A.value ? "text-gray-900" : "text-gray-500"])
743
- }, h(R.value), 3),
744
- (s(), o("svg", {
743
+ class: b(["truncate", e.view === "pill" ? "" : S.value ? "text-gray-900" : "text-gray-500"])
744
+ }, p(F.value), 3),
745
+ (s(), l("svg", {
745
746
  xmlns: "http://www.w3.org/2000/svg",
746
747
  fill: "none",
747
748
  viewBox: "0 0 24 24",
748
749
  "stroke-width": "1.5",
749
750
  stroke: "currentColor",
750
- class: x(["w-4 h-4 text-gray-400 transition-transform shrink-0", r ? "rotate-180" : ""])
751
- }, [...l[5] || (l[5] = [
751
+ class: b(["w-4 h-4 text-gray-400 transition-transform shrink-0", r ? "rotate-180" : ""])
752
+ }, [...o[5] || (o[5] = [
752
753
  t("path", {
753
754
  "stroke-linecap": "round",
754
755
  "stroke-linejoin": "round",
755
756
  d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
756
757
  }, null, -1)
757
758
  ])], 2))
758
- ], 14, st)
759
+ ], 14, ot)
759
760
  ])
760
761
  ]),
761
- menu: D(({ onToggle: u }) => [
762
+ menu: R(({ onToggle: u }) => [
762
763
  t("div", {
763
764
  class: "min-w-[240px] w-full",
764
- onKeydown: (r) => ye(r, u)
765
+ onKeydown: (r) => we(r, u)
765
766
  }, [
766
- e.title ? (s(), o("div", ot, h(e.title), 1)) : f("", !0),
767
- e.searchable ? (s(), o("div", nt, [
768
- t("div", rt, [
769
- l[6] || (l[6] = t("svg", {
767
+ e.title ? (s(), l("div", rt, p(e.title), 1)) : y("", !0),
768
+ e.searchable ? (s(), l("div", at, [
769
+ t("div", it, [
770
+ o[6] || (o[6] = t("svg", {
770
771
  xmlns: "http://www.w3.org/2000/svg",
771
772
  fill: "none",
772
773
  viewBox: "0 0 24 24",
@@ -780,25 +781,25 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
780
781
  d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
781
782
  })
782
783
  ], -1)),
783
- J(t("input", {
784
+ X(t("input", {
784
785
  ref_key: "searchInputRef",
785
- ref: K,
786
- "onUpdate:modelValue": l[0] || (l[0] = (r) => v.value = r),
786
+ ref: $,
787
+ "onUpdate:modelValue": o[0] || (o[0] = (r) => v.value = r),
787
788
  type: "text",
788
789
  placeholder: e.searchPlaceholder,
789
790
  class: "w-full rounded-md border border-gray-300 py-1.5 pl-8 pr-3 text-sm outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500",
790
- onInput: te
791
- }, null, 40, at), [
792
- [ae, v.value]
791
+ onInput: se
792
+ }, null, 40, ut), [
793
+ [ie, v.value]
793
794
  ])
794
795
  ])
795
- ])) : f("", !0),
796
- e.createLabel ? (s(), o("div", it, [
796
+ ])) : y("", !0),
797
+ e.createLabel ? (s(), l("div", dt, [
797
798
  t("button", {
798
799
  class: "flex items-center gap-2 w-full px-3 py-2 text-sm text-blue-700 hover:bg-gray-50 transition-colors",
799
- onClick: (r) => ee(u)
800
+ onClick: (r) => te(u)
800
801
  }, [
801
- l[7] || (l[7] = t("svg", {
802
+ o[7] || (o[7] = t("svg", {
802
803
  xmlns: "http://www.w3.org/2000/svg",
803
804
  fill: "none",
804
805
  viewBox: "0 0 24 24",
@@ -812,21 +813,21 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
812
813
  d: "M12 4.5v15m7.5-7.5h-15"
813
814
  })
814
815
  ], -1)),
815
- t("span", null, h(e.createLabel), 1)
816
- ], 8, ut)
817
- ])) : f("", !0),
818
- e.multiple ? (s(), o("div", dt, [
816
+ t("span", null, p(e.createLabel), 1)
817
+ ], 8, ct)
818
+ ])) : y("", !0),
819
+ e.multiple ? (s(), l("div", pt, [
819
820
  t("button", {
820
821
  class: "text-xs text-blue-600 hover:text-blue-800 transition-colors",
821
- onClick: Z
822
- }, " Обрати все "),
823
- A.value ? (s(), o("button", {
822
+ onClick: Q
823
+ }, p(C(a)("ui.dropdown.selectAll")), 1),
824
+ S.value ? (s(), l("button", {
824
825
  key: 0,
825
826
  class: "text-xs text-gray-500 hover:text-gray-700 transition-colors",
826
- onClick: Q
827
- }, " Очистити ")) : f("", !0)
828
- ])) : f("", !0),
829
- e.isLoading ? (s(), o("div", ct, [...l[8] || (l[8] = [
827
+ onClick: ee
828
+ }, p(C(a)("ui.dropdown.clear")), 1)) : y("", !0)
829
+ ])) : y("", !0),
830
+ e.isLoading ? (s(), l("div", vt, [...o[8] || (o[8] = [
830
831
  t("svg", {
831
832
  class: "animate-spin h-5 w-5 text-gray-400",
832
833
  xmlns: "http://www.w3.org/2000/svg",
@@ -847,107 +848,107 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
847
848
  d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
848
849
  })
849
850
  ], -1)
850
- ])])) : (s(), o("div", {
851
+ ])])) : (s(), l("div", {
851
852
  key: 5,
852
853
  ref_key: "listRef",
853
- ref: $,
854
+ ref: I,
854
855
  class: "max-h-[300px] overflow-y-auto",
855
856
  role: "listbox"
856
857
  }, [
857
- e.allowEmpty ? (s(), o("button", {
858
+ e.allowEmpty ? (s(), l("button", {
858
859
  key: 0,
859
- ref: (r) => i(r, 0),
860
- class: x(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors", [
861
- A.value ? "hover:bg-gray-50" : "bg-gray-100 font-medium",
862
- d.value === 0 ? "bg-gray-50" : ""
860
+ ref: (r) => x(r, 0),
861
+ class: b(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors", [
862
+ S.value ? "hover:bg-gray-50" : "bg-gray-100 font-medium",
863
+ c.value === 0 ? "bg-gray-50" : ""
863
864
  ]]),
864
865
  role: "option",
865
- "aria-selected": !A.value,
866
+ "aria-selected": !S.value,
866
867
  onClick: (r) => z(null, u),
867
- onMouseenter: l[1] || (l[1] = (r) => d.value = 0)
868
+ onMouseenter: o[1] || (o[1] = (r) => c.value = 0)
868
869
  }, [
869
- A.value ? (s(), o("span", mt)) : (s(), o("svg", vt, [...l[9] || (l[9] = [
870
+ S.value ? (s(), l("span", ht)) : (s(), l("svg", ft, [...o[9] || (o[9] = [
870
871
  t("path", {
871
872
  "stroke-linecap": "round",
872
873
  "stroke-linejoin": "round",
873
874
  d: "M4.5 12.75l6 6 9-13.5"
874
875
  }, null, -1)
875
876
  ])])),
876
- t("span", null, h(e.emptyLabel ?? e.placeholder), 1)
877
- ], 42, pt)) : f("", !0),
878
- e.groupKey ? (s(!0), o(B, { key: 1 }, E(X.value, (r, O) => (s(), o(B, {
877
+ t("span", null, p(e.emptyLabel ?? e.placeholder), 1)
878
+ ], 42, mt)) : y("", !0),
879
+ e.groupKey ? (s(!0), l(B, { key: 1 }, D(Y.value, (r, j) => (s(), l(B, {
879
880
  key: r.label
880
881
  }, [
881
- r.label ? (s(), o("div", {
882
+ r.label ? (s(), l("div", {
882
883
  key: 0,
883
- class: x(["px-3 pt-2 pb-1 text-xs font-semibold text-gray-500 uppercase tracking-wide", O > 0 ? "border-t border-gray-100 mt-1" : ""])
884
- }, h(r.label), 3)) : f("", !0),
885
- (s(!0), o(B, null, E(r.entries, (g) => (s(), o("button", {
886
- key: g.item[e.valueKey],
884
+ class: b(["px-3 pt-2 pb-1 text-xs font-semibold text-gray-500 uppercase tracking-wide", j > 0 ? "border-t border-gray-100 mt-1" : ""])
885
+ }, p(r.label), 3)) : y("", !0),
886
+ (s(!0), l(B, null, D(r.entries, (w) => (s(), l("button", {
887
+ key: w.item[e.valueKey],
887
888
  ref_for: !0,
888
- ref: (q) => i(q, g.flatIndex),
889
- class: x(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
890
- L(g.item) ? "bg-gray-100 font-medium" : "hover:bg-gray-50",
891
- d.value === g.flatIndex ? "bg-gray-50" : ""
889
+ ref: (G) => x(G, w.flatIndex),
890
+ class: b(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
891
+ L(w.item) ? "bg-gray-100 font-medium" : "hover:bg-gray-50",
892
+ c.value === w.flatIndex ? "bg-gray-50" : ""
892
893
  ]]),
893
894
  role: "option",
894
- "aria-selected": L(g.item),
895
- onClick: (q) => z(g.item, u),
896
- onMouseenter: (q) => d.value = g.flatIndex
895
+ "aria-selected": L(w.item),
896
+ onClick: (G) => z(w.item, u),
897
+ onMouseenter: (G) => c.value = w.flatIndex
897
898
  }, [
898
- L(g.item) ? (s(), o("svg", ht, [...l[10] || (l[10] = [
899
+ L(w.item) ? (s(), l("svg", wt, [...o[10] || (o[10] = [
899
900
  t("path", {
900
901
  "stroke-linecap": "round",
901
902
  "stroke-linejoin": "round",
902
903
  d: "M4.5 12.75l6 6 9-13.5"
903
904
  }, null, -1)
904
- ])])) : (s(), o("span", yt)),
905
- _(e.$slots, "item", W({ ref_for: !0 }, { item: g.item }), () => [
906
- t("span", null, h(g.item[e.labelKey]), 1)
905
+ ])])) : (s(), l("span", gt)),
906
+ M(e.$slots, "item", W({ ref_for: !0 }, { item: w.item }), () => [
907
+ t("span", null, p(w.item[e.labelKey]), 1)
907
908
  ])
908
- ], 42, ft))), 128))
909
- ], 64))), 128)) : (s(!0), o(B, { key: 2 }, E(M.value, (r, O) => (s(), o("button", {
909
+ ], 42, yt))), 128))
910
+ ], 64))), 128)) : (s(!0), l(B, { key: 2 }, D(E.value, (r, j) => (s(), l("button", {
910
911
  key: r[e.valueKey],
911
912
  ref_for: !0,
912
- ref: (g) => i(g, k.value + O),
913
- class: x(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
913
+ ref: (w) => x(w, O.value + j),
914
+ class: b(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
914
915
  L(r) ? "bg-gray-100 font-medium" : "hover:bg-gray-50",
915
- d.value === k.value + O ? "bg-gray-50" : ""
916
+ c.value === O.value + j ? "bg-gray-50" : ""
916
917
  ]]),
917
918
  role: "option",
918
919
  "aria-selected": L(r),
919
- onClick: (g) => z(r, u),
920
- onMouseenter: (g) => d.value = k.value + O
920
+ onClick: (w) => z(r, u),
921
+ onMouseenter: (w) => c.value = O.value + j
921
922
  }, [
922
- L(r) ? (s(), o("svg", gt, [...l[11] || (l[11] = [
923
+ L(r) ? (s(), l("svg", kt, [...o[11] || (o[11] = [
923
924
  t("path", {
924
925
  "stroke-linecap": "round",
925
926
  "stroke-linejoin": "round",
926
927
  d: "M4.5 12.75l6 6 9-13.5"
927
928
  }, null, -1)
928
- ])])) : (s(), o("span", bt)),
929
- _(e.$slots, "item", W({ ref_for: !0 }, { item: r }), () => [
930
- t("span", null, h(r[e.labelKey]), 1)
929
+ ])])) : (s(), l("span", xt)),
930
+ M(e.$slots, "item", W({ ref_for: !0 }, { item: r }), () => [
931
+ t("span", null, p(r[e.labelKey]), 1)
931
932
  ])
932
- ], 42, wt))), 128)),
933
- M.value.length === 0 && !e.allowEmpty ? (s(), o("div", kt, [
934
- _(e.$slots, "empty", {}, () => [
935
- l[12] || (l[12] = ie(" Nothing found ", -1))
933
+ ], 42, bt))), 128)),
934
+ E.value.length === 0 && !e.allowEmpty ? (s(), l("div", Ct, [
935
+ M(e.$slots, "empty", {}, () => [
936
+ ue(p(C(a)("ui.dropdown.nothingFound")), 1)
936
937
  ])
937
- ])) : f("", !0)
938
+ ])) : y("", !0)
938
939
  ], 512))
939
- ], 40, lt)
940
+ ], 40, nt)
940
941
  ]),
941
942
  _: 3
942
943
  }, 8, ["stick"]));
943
944
  }
944
945
  });
945
946
  export {
946
- et as O,
947
- Oe as _,
948
- Nt as a,
949
- qt as b,
950
- Gt as c,
951
- Je as m,
952
- tt as u
947
+ st as O,
948
+ Ae as _,
949
+ Ht as a,
950
+ Jt as b,
951
+ Xt as c,
952
+ Ye as m,
953
+ lt as u
953
954
  };