@vlalg-nimbus/nb-inputs 6.0.8 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/nb-inputs.js CHANGED
@@ -1,10 +1,10 @@
1
- import { useCssVars as oe, unref as H, onMounted as ue, ref as ne, toRefs as re, computed as l, watch as D, openBlock as E, createElementBlock as N, normalizeClass as C, normalizeStyle as F, createElementVNode as f, Fragment as se, renderList as ce, withDirectives as ie, vModelRadio as Se, toDisplayString as de, createCommentVNode as fe, vModelCheckbox as Ce } from "vue";
2
- const ve = (e, o) => {
3
- const s = e.__vccOpts || e;
4
- for (const [d, c] of o)
5
- s[d] = c;
6
- return s;
7
- }, He = ["id"], Ee = ["id", "disabled", "value", "name"], Ne = ["for"], Ge = /* @__PURE__ */ Object.assign({
1
+ import { useCssVars as Ge, unref as l, onMounted as Ke, ref as Q, toRefs as Ue, computed as t, watch as K, openBlock as h, createElementBlock as C, normalizeClass as X, normalizeStyle as se, createElementVNode as V, mergeProps as Qe, Fragment as St, renderList as kt, withDirectives as Xe, vModelRadio as ya, withKeys as Re, withModifiers as qe, toDisplayString as Oe, createCommentVNode as ie, vModelCheckbox as ga, onUnmounted as ba, renderSlot as Me, createTextVNode as Vt, vModelDynamic as ma, vModelText as ha } from "vue";
2
+ const Ye = (e, i) => {
3
+ const r = e.__vccOpts || e;
4
+ for (const [B, y] of i)
5
+ r[B] = y;
6
+ return r;
7
+ }, Ca = ["id"], Va = ["id", "disabled", "value", "name"], xa = ["for", "tabindex"], Sa = /* @__PURE__ */ Object.assign({
8
8
  name: "NbInputRadio",
9
9
  inheritAttrs: !1
10
10
  }, {
@@ -18,10 +18,31 @@ const ve = (e, o) => {
18
18
  type: String,
19
19
  default: "b",
20
20
  validator: (e = "b") => {
21
- const o = e ? e.toLowerCase() : "";
22
- return ["b", "ib"].includes(o);
21
+ const i = e ? e.toLowerCase() : "";
22
+ return ["b", "ib"].includes(i);
23
23
  }
24
24
  },
25
+ tabIndex: {
26
+ type: [Number, Array],
27
+ default: 0,
28
+ validator: (e, i) => Array.isArray(e) ? e.length === i.options.length : !0
29
+ },
30
+ hasTabIndexEnter: {
31
+ type: Boolean,
32
+ default: !0
33
+ },
34
+ hasTabIndexSpace: {
35
+ type: Boolean,
36
+ default: !0
37
+ },
38
+ ariaLabel: {
39
+ type: String,
40
+ default: "Alternate Text Button"
41
+ },
42
+ ariaAttrs: {
43
+ type: Object,
44
+ default: () => ({})
45
+ },
25
46
  groupName: {
26
47
  type: String,
27
48
  default: "",
@@ -35,12 +56,12 @@ const ve = (e, o) => {
35
56
  validator: (e) => {
36
57
  if (!e.length)
37
58
  return !1;
38
- let o = !1;
39
- for (const s of e) {
40
- const d = Object.keys(s);
41
- d.length !== 2 && (o = !0), d.every((v) => ["value", "text"].includes(v)) || (o = !0);
59
+ let i = !1;
60
+ for (const r of e) {
61
+ const B = Object.keys(r);
62
+ B.length !== 2 && (i = !0), B.every((W) => ["value", "text"].includes(W)) || (i = !0);
42
63
  }
43
- if (!o)
64
+ if (!i)
44
65
  return e;
45
66
  }
46
67
  },
@@ -107,123 +128,146 @@ const ve = (e, o) => {
107
128
  validator: (e) => e || 200
108
129
  }
109
130
  },
110
- emits: ["current-value", "changed"],
111
- setup(e, { emit: o }) {
112
- oe((a) => ({
113
- "5b350e6b": P.value,
114
- "091c7c57": Z.value,
115
- "288498b0": X.value,
116
- "2482ccb5": H(p),
117
- "7cafd2be": J.value,
118
- "71206dfc": Y.value,
119
- "6c28f48e": Q.value,
120
- "4091f564": K.value
121
- })), ue(() => {
122
- j();
131
+ emits: ["current-value", "changed", "clicked"],
132
+ setup(e, { emit: i }) {
133
+ Ge((u) => ({
134
+ "2ff4bfca": ee.value,
135
+ "29d66636": he.value,
136
+ "1c590c29": ue.value,
137
+ "032c8a58": l(I),
138
+ "541cdd40": ce.value,
139
+ "6d04505b": fe.value,
140
+ "284d01cf": me.value,
141
+ "8cc41926": ne.value
142
+ })), Ke(() => {
143
+ pe();
123
144
  });
124
- const s = o, d = e, c = ne(null), {
125
- currentOption: v,
126
- valueType: G,
127
- display: k,
128
- options: g,
129
- textColor: x,
130
- color: I,
131
- hoverEffect: z,
132
- activeHoverEffect: A,
133
- colorHover: p,
134
- itemGap: b,
135
- internalGap: y,
136
- scale: h,
137
- disabled: O,
138
- fontFamily: $,
139
- fontSize: B,
140
- fontWeight: _
141
- } = re(d), i = l(() => {
142
- const a = O.value ? "component-disabled" : "", n = k.value !== "b" ? "inline-block" : "block", V = $.value ? $.value : "'Lato', sans-serif", R = B.value ? B.value : "1.6em", w = !_.value || _.value < 0 ? 200 : _.value, te = x.value ? x.value : "black", q = I.value ? I.value : "#767676", t = [!1, !0].includes(z.value) ? z.value : !1, r = [!1, !0].includes(A.value) ? A.value : !1, m = p.value ? p.value : "#a6a6a6", L = !b.value || b.value < 0 ? 15 : b.value, W = !y.value || y.value < 0 ? 6 : y.value, ae = !h.value || h.value < 0 ? 1 : h.value;
145
+ const r = i, B = e, y = Q(null), {
146
+ ariaLabel: W,
147
+ ariaAttrs: _,
148
+ currentOption: H,
149
+ valueType: oe,
150
+ display: x,
151
+ options: F,
152
+ textColor: j,
153
+ color: U,
154
+ hoverEffect: P,
155
+ activeHoverEffect: T,
156
+ colorHover: I,
157
+ itemGap: S,
158
+ internalGap: k,
159
+ scale: w,
160
+ disabled: E,
161
+ fontFamily: Y,
162
+ fontSize: N,
163
+ fontWeight: D
164
+ } = Ue(B), v = t(() => {
165
+ const u = E.value ? "component-disabled" : "", c = x.value !== "b" ? "inline-block" : "block", $ = Y.value ? Y.value : "'Lato', sans-serif", b = N.value ? N.value : "1.6em", q = !D.value || D.value < 0 ? 200 : D.value, ve = j.value ? j.value : "black", Se = U.value ? U.value : "#767676", o = [!1, !0].includes(P.value) ? P.value : !1, d = [!1, !0].includes(T.value) ? T.value : !1, z = I.value ? I.value : "#a6a6a6", m = !S.value || S.value < 0 ? 15 : S.value, G = !k.value || k.value < 0 ? 6 : k.value, re = !w.value || w.value < 0 ? 1 : w.value;
143
166
  return {
144
- disabled: a,
145
- display: n,
146
- textColor: te,
147
- color: q,
148
- hoverEffect: t,
149
- activeHoverEffect: r,
150
- colorHover: m,
151
- itemGap: L,
152
- internalGap: W,
153
- scale: ae,
154
- font: V,
155
- fontSize: R,
156
- fontWeight: w
167
+ disabled: u,
168
+ display: c,
169
+ textColor: ve,
170
+ color: Se,
171
+ hoverEffect: o,
172
+ activeHoverEffect: d,
173
+ colorHover: z,
174
+ itemGap: m,
175
+ internalGap: G,
176
+ scale: re,
177
+ font: $,
178
+ fontSize: b,
179
+ fontWeight: q
157
180
  };
158
- }), S = l(() => i.value.disabled), u = l(() => ({
159
- display: i.value.display
160
- })), T = l(() => i.value.display === "inline-block" ? "component-radio__item--display-inline" : "component-radio__item--display-block"), M = l(() => {
161
- const a = i.value;
181
+ }), J = t(() => v.value.disabled), p = t(() => ({
182
+ display: v.value.display
183
+ })), Z = t(() => v.value.display === "inline-block" ? "component-radio__item--display-inline" : "component-radio__item--display-block"), de = t(() => {
184
+ const u = v.value;
162
185
  return {
163
- fontSize: a.fontSize,
164
- fontWeight: a.fontWeight
186
+ fontSize: u.fontSize,
187
+ fontWeight: u.fontWeight
165
188
  };
166
- }), U = l(() => Array.isArray(g.value) && g.value.constructor === Array && g.value.length > 0), P = l(() => i.value.font), J = l(() => i.value.textColor), K = l(() => i.value.color), Q = l(() => {
167
- const a = i.value;
168
- return a.hoverEffect ? a.colorHover : a.color;
169
- }), X = l(() => {
170
- const a = i.value;
171
- return a.activeHoverEffect ? a.colorHover : a.color;
172
- }), Y = l(() => {
173
- const n = i.value.internalGap;
174
- return !n || n < 0 ? 0 : `${n}px`;
175
- }), Z = l(() => {
176
- const n = i.value.itemGap;
177
- return !n || n < 0 ? 0 : `${n}px`;
178
- }), ee = l(() => ({
179
- zoom: i.value.scale
180
- })), j = () => {
181
- const a = v.value;
182
- a && ["string"].includes(G.value) ? c.value = a.toString().toLowerCase() : c.value = a;
189
+ }), R = t(() => Array.isArray(F.value) && F.value.constructor === Array && F.value.length > 0), ee = t(() => v.value.font), ce = t(() => v.value.textColor), ne = t(() => v.value.color), me = t(() => {
190
+ const u = v.value;
191
+ return u.hoverEffect ? u.colorHover : u.color;
192
+ }), ue = t(() => {
193
+ const u = v.value;
194
+ return u.activeHoverEffect ? u.colorHover : u.color;
195
+ }), fe = t(() => {
196
+ const c = v.value.internalGap;
197
+ return !c || c < 0 ? 0 : `${c}px`;
198
+ }), he = t(() => {
199
+ const c = v.value.itemGap;
200
+ return !c || c < 0 ? 0 : `${c}px`;
201
+ }), Ce = t(() => ({
202
+ zoom: v.value.scale
203
+ })), Ve = t(() => {
204
+ const u = {};
205
+ _.value && Object.keys(_.value).forEach((b) => u[`aria-${b}`] = _.value[b]);
206
+ const c = {
207
+ "aria-label": W.value,
208
+ "aria-disabled": E.value,
209
+ ...u
210
+ };
211
+ return Object.fromEntries(
212
+ Object.entries(c).filter(([$, b]) => b != null)
213
+ );
214
+ }), pe = () => {
215
+ const u = H.value;
216
+ u && ["string"].includes(oe.value) ? y.value = u.toString().toLowerCase() : y.value = u;
217
+ }, xe = () => {
218
+ r("clicked");
183
219
  };
184
- return D(v, (a, n) => {
185
- a !== n && j();
186
- }), D(c, (a, n) => {
187
- a !== n && (s("current-value", a), s("changed", a));
188
- }), (a, n) => e.nbId && U.value ? (E(), N("div", {
220
+ return K(H, (u, c) => {
221
+ u !== c && pe();
222
+ }), K(y, (u, c) => {
223
+ u !== c && (r("current-value", u), r("changed", u));
224
+ }), (u, c) => e.nbId && R.value ? (h(), C("div", {
189
225
  key: 0,
190
- class: C(["nb-wrapper", S.value]),
191
- style: F([u.value, ee.value])
226
+ class: X(["nb-wrapper", J.value]),
227
+ style: se([p.value, Ce.value])
192
228
  }, [
193
- f("div", {
229
+ V("div", Qe({
194
230
  id: e.nbId,
195
- class: C(["nb-reset", "component", T.value])
196
- }, [
197
- (E(!0), N(se, null, ce(H(g), (V, R) => (E(), N("div", {
198
- key: R,
231
+ role: "radiogroup"
232
+ }, Ve.value, {
233
+ class: ["nb-reset", "component", Z.value]
234
+ }), [
235
+ (h(!0), C(St, null, kt(l(F), ($, b) => (h(), C("div", {
236
+ key: b,
199
237
  class: "component-radio__item"
200
238
  }, [
201
- ie(f("input", {
202
- id: `${e.nbId}-${V.value}`,
203
- "onUpdate:modelValue": n[0] || (n[0] = (w) => c.value = w),
239
+ Xe(V("input", {
240
+ id: `${e.nbId}-${$.value}`,
241
+ "onUpdate:modelValue": c[0] || (c[0] = (q) => y.value = q),
204
242
  type: "radio",
205
243
  class: "component-radio__item--input",
206
- disabled: H(O),
207
- value: V.value,
208
- name: e.groupName
209
- }, null, 8, Ee), [
210
- [Se, c.value]
244
+ disabled: l(E),
245
+ value: $.value,
246
+ name: e.groupName,
247
+ onClick: xe
248
+ }, null, 8, Va), [
249
+ [ya, y.value]
211
250
  ]),
212
- f("label", {
213
- for: `${e.nbId}-${V.value}`,
214
- class: "component-radio__item--label"
251
+ V("label", {
252
+ for: `${e.nbId}-${$.value}`,
253
+ tabindex: l(E) ? -1 : Array.isArray(e.tabIndex) ? e.tabIndex[b] : e.tabIndex >= 0 ? e.tabIndex : b + 1,
254
+ class: "component-radio__item--label",
255
+ onKeydown: [
256
+ c[1] || (c[1] = Re(qe((q) => !l(E) && e.hasTabIndexEnter && q.target.click(), ["prevent"]), ["enter"])),
257
+ c[2] || (c[2] = Re(qe((q) => !l(E) && e.hasTabIndexSpace && q.target.click(), ["prevent"]), ["space"]))
258
+ ]
215
259
  }, [
216
- n[1] || (n[1] = f("div", null, null, -1)),
217
- f("span", {
218
- style: F([M.value])
219
- }, de(V.text), 5)
220
- ], 8, Ne)
260
+ c[3] || (c[3] = V("div", null, null, -1)),
261
+ V("span", {
262
+ style: se([de.value])
263
+ }, Oe($.text), 5)
264
+ ], 40, xa)
221
265
  ]))), 128))
222
- ], 10, He)
223
- ], 6)) : fe("", !0);
266
+ ], 16, Ca)
267
+ ], 6)) : ie("", !0);
224
268
  }
225
- }), Ie = /* @__PURE__ */ ve(Ge, [["__scopeId", "data-v-8ea32fd7"]]);
226
- const ze = ["id"], Ae = ["id", "disabled", "value", "name"], Oe = ["for"], $e = /* @__PURE__ */ Object.assign({
269
+ }), ka = /* @__PURE__ */ Ye(Sa, [["__scopeId", "data-v-7b02a5bf"]]);
270
+ const Ba = ["id"], _a = ["id", "disabled", "value", "name"], Ia = ["for", "tabindex"], Aa = /* @__PURE__ */ Object.assign({
227
271
  name: "NbInputCheckbox",
228
272
  inheritAttrs: !1
229
273
  }, {
@@ -237,10 +281,31 @@ const ze = ["id"], Ae = ["id", "disabled", "value", "name"], Oe = ["for"], $e =
237
281
  type: String,
238
282
  default: "b",
239
283
  validator: (e = "b") => {
240
- const o = e ? e.toLowerCase() : "";
241
- return ["b", "ib"].includes(o);
284
+ const i = e ? e.toLowerCase() : "";
285
+ return ["b", "ib"].includes(i);
242
286
  }
243
287
  },
288
+ tabIndex: {
289
+ type: [Number, Array],
290
+ default: 0,
291
+ validator: (e, i) => Array.isArray(e) ? e.length === i.options.length : !0
292
+ },
293
+ hasTabIndexEnter: {
294
+ type: Boolean,
295
+ default: !0
296
+ },
297
+ hasTabIndexSpace: {
298
+ type: Boolean,
299
+ default: !0
300
+ },
301
+ ariaLabel: {
302
+ type: String,
303
+ default: "Alternate Text Button"
304
+ },
305
+ ariaAttrs: {
306
+ type: Object,
307
+ default: () => ({})
308
+ },
244
309
  groupName: {
245
310
  type: String,
246
311
  default: "",
@@ -254,12 +319,12 @@ const ze = ["id"], Ae = ["id", "disabled", "value", "name"], Oe = ["for"], $e =
254
319
  validator: (e) => {
255
320
  if (!e.length)
256
321
  return !1;
257
- let o = !1;
258
- for (const s of e) {
259
- const d = Object.keys(s);
260
- d.length !== 2 && (o = !0), d.every((v) => ["value", "text"].includes(v)) || (o = !0);
322
+ let i = !1;
323
+ for (const r of e) {
324
+ const B = Object.keys(r);
325
+ B.length !== 2 && (i = !0), B.every((W) => ["value", "text"].includes(W)) || (i = !0);
261
326
  }
262
- if (!o)
327
+ if (!i)
263
328
  return e;
264
329
  }
265
330
  },
@@ -335,153 +400,1398 @@ const ze = ["id"], Ae = ["id", "disabled", "value", "name"], Oe = ["for"], $e =
335
400
  validator: (e) => e || 200
336
401
  }
337
402
  },
338
- emits: ["current-value", "changed"],
339
- setup(e, { emit: o }) {
340
- oe((t) => ({
341
- "10898a25": K.value,
342
- "780ee9de": R.value,
343
- "1ae639a4": Z.value,
344
- ced3d622: H(p),
345
- c43a725a: ee.value,
346
- "53ca4d88": X.value,
347
- "532c43b4": V.value,
348
- "23ee9c4a": Q.value,
349
- "2d828fb6": n.value,
350
- "68487ed8": Y.value,
351
- "51e3aafa": a.value
352
- })), ue(() => {
353
- q();
403
+ emits: ["current-value", "changed", "clicked"],
404
+ setup(e, { emit: i }) {
405
+ Ge((o) => ({
406
+ "22160a8e": ne.value,
407
+ "410caefa": c.value,
408
+ "3b6621e5": he.value,
409
+ "2130e298": l(I),
410
+ "156733ca": Ce.value,
411
+ "4735c99e": ue.value,
412
+ "204a4b1d": u.value,
413
+ "287af9f8": me.value,
414
+ "0abed1c2": xe.value,
415
+ f547d6ea: fe.value,
416
+ "5546b8ec": pe.value
417
+ })), Ke(() => {
418
+ ve();
354
419
  });
355
- const s = o, d = e, c = ne(null), {
356
- currentOption: v,
357
- display: G,
358
- options: k,
359
- textColor: g,
360
- boxRadius: x,
361
- color: I,
362
- hoverEffect: z,
363
- activeHoverEffect: A,
364
- colorHover: p,
365
- itemGap: b,
366
- internalGap: y,
367
- scale: h,
368
- type: O,
369
- background: $,
370
- disabled: B,
371
- fontFamily: _,
372
- fontSize: i,
373
- fontWeight: S
374
- } = re(d), u = l(() => {
375
- const t = B.value ? "component-disabled" : "", r = G.value !== "b" ? "inline-block" : "block", m = _.value ? _.value : "'Lato', sans-serif", L = i.value ? i.value : "1.6em", W = S.value !== 0 && !S.value || S.value < 0 ? 200 : S.value, ae = g.value ? g.value : "black", pe = x.value !== 0 && !x.value || x.value < 0 ? 0 : x.value, be = I.value ? I.value : "#767676", ye = [!1, !0].includes(z.value) ? z.value : !1, Ve = [!1, !0].includes(A.value) ? A.value : !1, me = p.value ? p.value : "#a6a6a6", ge = b.value !== 0 && !b.value || b.value < 0 ? 15 : b.value, xe = y.value !== 0 && !y.value || y.value < 0 ? 6 : y.value, he = ["box", "circle"].includes(O.value) ? O.value : "box", ke = !h.value || h.value < 0 ? 1 : h.value, _e = [!1, !0].includes($.value) ? $.value : !1;
420
+ const r = i, B = e, y = Q(null), {
421
+ ariaLabel: W,
422
+ ariaAttrs: _,
423
+ currentOption: H,
424
+ display: oe,
425
+ options: x,
426
+ textColor: F,
427
+ boxRadius: j,
428
+ color: U,
429
+ hoverEffect: P,
430
+ activeHoverEffect: T,
431
+ colorHover: I,
432
+ itemGap: S,
433
+ internalGap: k,
434
+ scale: w,
435
+ type: E,
436
+ background: Y,
437
+ disabled: N,
438
+ fontFamily: D,
439
+ fontSize: v,
440
+ fontWeight: J
441
+ } = Ue(B), p = t(() => {
442
+ const o = N.value ? "component-disabled" : "", d = oe.value !== "b" ? "inline-block" : "block", z = D.value ? D.value : "'Lato', sans-serif", m = v.value ? v.value : "1.6em", G = J.value !== 0 && !J.value || J.value < 0 ? 200 : J.value, re = F.value ? F.value : "black", ke = j.value !== 0 && !j.value || j.value < 0 ? 0 : j.value, Te = U.value ? U.value : "#767676", M = [!1, !0].includes(P.value) ? P.value : !1, Be = [!1, !0].includes(T.value) ? T.value : !1, te = I.value ? I.value : "#a6a6a6", we = S.value !== 0 && !S.value || S.value < 0 ? 15 : S.value, Ee = k.value !== 0 && !k.value || k.value < 0 ? 6 : k.value, Ne = ["box", "circle"].includes(E.value) ? E.value : "box", A = !w.value || w.value < 0 ? 1 : w.value, ye = [!1, !0].includes(Y.value) ? Y.value : !1;
376
443
  return {
377
- disabled: t,
378
- display: r,
379
- textColor: ae,
380
- boxRadius: pe,
381
- color: be,
382
- hoverEffect: ye,
383
- activeHoverEffect: Ve,
384
- colorHover: me,
385
- itemGap: ge,
386
- internalGap: xe,
387
- scale: ke,
388
- type: he,
389
- font: m,
390
- background: _e,
391
- fontSize: L,
392
- fontWeight: W
444
+ disabled: o,
445
+ display: d,
446
+ textColor: re,
447
+ boxRadius: ke,
448
+ color: Te,
449
+ hoverEffect: M,
450
+ activeHoverEffect: Be,
451
+ colorHover: te,
452
+ itemGap: we,
453
+ internalGap: Ee,
454
+ scale: A,
455
+ type: Ne,
456
+ font: z,
457
+ background: ye,
458
+ fontSize: m,
459
+ fontWeight: G
393
460
  };
394
- }), T = l(() => u.value.disabled), M = l(() => ({
395
- display: u.value.display
396
- })), U = l(() => u.value.display === "inline-block" ? "component-checkbox__item--display-inline" : "component-checkbox__item--display-block"), P = l(() => {
397
- const t = u.value;
461
+ }), Z = t(() => p.value.disabled), de = t(() => ({
462
+ display: p.value.display
463
+ })), R = t(() => p.value.display === "inline-block" ? "component-checkbox__item--display-inline" : "component-checkbox__item--display-block"), ee = t(() => {
464
+ const o = p.value;
398
465
  return {
399
- fontSize: t.fontSize,
400
- fontWeight: t.fontWeight
466
+ fontSize: o.fontSize,
467
+ fontWeight: o.fontWeight
401
468
  };
402
- }), J = l(() => Array.isArray(k.value) && k.value.constructor === Array && k.value.length > 0), K = l(() => u.value.font), Q = l(() => u.value.textColor), X = l(() => u.value.color), Y = l(() => {
403
- const t = u.value;
404
- return t.hoverEffect ? t.colorHover : t.color;
405
- }), Z = l(() => {
406
- const t = u.value;
407
- return t.activeHoverEffect ? t.colorHover : t.color;
408
- }), ee = l(() => {
409
- const t = u.value;
410
- return t.activeHoverEffect && t.background ? `${t.colorHover}80` : p.value;
411
- }), j = l(() => u.value.background ? "component-checkbox__item--with-background" : "component-checkbox__item--without-background"), a = l(() => {
412
- const t = u.value;
413
- return t.background ? "#ffffff" : t.textColor;
469
+ }), ce = t(() => Array.isArray(x.value) && x.value.constructor === Array && x.value.length > 0), ne = t(() => p.value.font), me = t(() => p.value.textColor), ue = t(() => p.value.color), fe = t(() => {
470
+ const o = p.value;
471
+ return o.hoverEffect ? o.colorHover : o.color;
472
+ }), he = t(() => {
473
+ const o = p.value;
474
+ return o.activeHoverEffect ? o.colorHover : o.color;
475
+ }), Ce = t(() => {
476
+ const o = p.value;
477
+ return o.activeHoverEffect && o.background ? `${o.colorHover}80` : I.value;
478
+ }), Ve = t(() => p.value.background ? "component-checkbox__item--with-background" : "component-checkbox__item--without-background"), pe = t(() => {
479
+ const o = p.value;
480
+ return o.background ? "#ffffff" : o.textColor;
414
481
  });
415
- l(() => u.value.background ? "19px" : "auto");
416
- const n = l(() => {
417
- const r = u.value.internalGap;
418
- return !r || r < 0 ? 0 : `${r}px`;
419
- }), V = l(() => {
420
- const t = u.value;
421
- return `${t.boxRadius > 7 ? 7 : t.boxRadius}px`;
422
- }), R = l(() => {
423
- const r = u.value.itemGap;
424
- return !r || r < 0 ? 0 : `${r}px`;
425
- }), w = l(() => u.value.type === "circle" ? "custom-checkbox__input--type-circle" : ""), te = l(() => ({
426
- zoom: u.value.scale
427
- })), q = () => {
428
- c.value = v.value;
482
+ t(() => p.value.background ? "19px" : "auto");
483
+ const xe = t(() => {
484
+ const d = p.value.internalGap;
485
+ return !d || d < 0 ? 0 : `${d}px`;
486
+ }), u = t(() => {
487
+ const o = p.value;
488
+ return `${o.boxRadius > 7 ? 7 : o.boxRadius}px`;
489
+ }), c = t(() => {
490
+ const d = p.value.itemGap;
491
+ return !d || d < 0 ? 0 : `${d}px`;
492
+ }), $ = t(() => p.value.type === "circle" ? "custom-checkbox__input--type-circle" : ""), b = t(() => ({
493
+ zoom: p.value.scale
494
+ })), q = t(() => {
495
+ const o = {};
496
+ _.value && Object.keys(_.value).forEach((m) => o[`aria-${m}`] = _.value[m]);
497
+ const d = {
498
+ "aria-label": W.value,
499
+ "aria-disabled": N.value,
500
+ ...o
501
+ };
502
+ return Object.fromEntries(
503
+ Object.entries(d).filter(([z, m]) => m != null)
504
+ );
505
+ }), ve = () => {
506
+ y.value = H.value;
507
+ }, Se = () => {
508
+ r("clicked");
429
509
  };
430
- return D(v, (t, r) => {
431
- t !== r && q();
432
- }), D(c, (t, r) => {
433
- t !== r && (s("current-value", t), s("changed", t));
434
- }), (t, r) => e.nbId && J.value ? (E(), N("div", {
510
+ return K(H, (o, d) => {
511
+ o !== d && ve();
512
+ }), K(y, (o, d) => {
513
+ o !== d && (r("current-value", o), r("changed", o));
514
+ }), (o, d) => e.nbId && ce.value ? (h(), C("div", {
435
515
  key: 0,
436
- class: C(["nb-wrapper", T.value]),
437
- style: F([M.value, te.value])
516
+ class: X(["nb-wrapper", Z.value]),
517
+ style: se([de.value, b.value])
438
518
  }, [
439
- f("div", {
519
+ V("div", Qe({
440
520
  id: e.nbId,
441
- class: C(["nb-reset", "component", U.value])
442
- }, [
443
- (E(!0), N(se, null, ce(H(k), (m, L) => (E(), N("div", {
444
- key: L,
521
+ role: "group"
522
+ }, q.value, {
523
+ class: ["nb-reset", "component", R.value]
524
+ }), [
525
+ (h(!0), C(St, null, kt(l(x), (z, m) => (h(), C("div", {
526
+ key: m,
445
527
  class: "component-checkbox__item"
446
528
  }, [
447
- ie(f("input", {
448
- id: `${e.nbId}-${m.value}`,
449
- "onUpdate:modelValue": r[0] || (r[0] = (W) => c.value = W),
529
+ Xe(V("input", {
530
+ id: `${e.nbId}-${z.value}`,
531
+ "onUpdate:modelValue": d[0] || (d[0] = (G) => y.value = G),
450
532
  type: "checkbox",
451
533
  class: "component-checkbox__item--input",
452
- disabled: H(B),
453
- value: m.value,
454
- name: e.groupName
455
- }, null, 8, Ae), [
456
- [Ce, c.value]
534
+ disabled: l(N),
535
+ value: z.value,
536
+ name: e.groupName,
537
+ onClick: Se
538
+ }, null, 8, _a), [
539
+ [ga, y.value]
457
540
  ]),
458
- f("label", {
459
- for: `${e.nbId}-${m.value}`,
460
- class: C([[w.value], "component-checkbox__item--label"])
541
+ V("label", {
542
+ for: `${e.nbId}-${z.value}`,
543
+ class: X([[$.value], "component-checkbox__item--label"]),
544
+ tabindex: l(N) ? -1 : Array.isArray(e.tabIndex) ? e.tabIndex[m] : e.tabIndex >= 0 ? e.tabIndex : m + 1,
545
+ onKeydown: [
546
+ d[1] || (d[1] = Re(qe((G) => !l(N) && e.hasTabIndexEnter && G.target.click(), ["prevent"]), ["enter"])),
547
+ d[2] || (d[2] = Re(qe((G) => !l(N) && e.hasTabIndexSpace && G.target.click(), ["prevent"]), ["space"]))
548
+ ]
461
549
  }, [
462
- f("div", {
463
- class: C([j.value])
550
+ V("div", {
551
+ class: X([Ve.value])
464
552
  }, null, 2),
465
- f("span", {
466
- style: F([P.value])
467
- }, de(m.text), 5)
468
- ], 10, Oe)
553
+ V("span", {
554
+ style: se([ee.value])
555
+ }, Oe(z.text), 5)
556
+ ], 42, Ia)
469
557
  ]))), 128))
470
- ], 10, ze)
471
- ], 6)) : fe("", !0);
558
+ ], 16, Ba)
559
+ ], 6)) : ie("", !0);
560
+ }
561
+ }), Ta = /* @__PURE__ */ Ye(Aa, [["__scopeId", "data-v-80f01756"]]);
562
+ const wa = ["id"], Ea = {
563
+ class: /* @__PURE__ */ X(["component__eye-icon", "fas"])
564
+ }, Na = { key: 0 }, Da = { key: 1 }, Ra = ["id", "name", "type", "placeholder", "disabled", "required", "readonly", "autocomplete", "tabindex"], $a = ["for"], za = /* @__PURE__ */ Object.assign({
565
+ name: "NbInput",
566
+ inheritAttrs: !1
567
+ }, {
568
+ __name: "NbInput",
569
+ props: {
570
+ nbId: {
571
+ type: String,
572
+ required: !0
573
+ },
574
+ display: {
575
+ type: String,
576
+ default: "b",
577
+ validator: (e = "b") => {
578
+ const i = e.toLowerCase();
579
+ return ["b", "ib"].includes(i);
580
+ }
581
+ },
582
+ tabIndex: {
583
+ type: Number,
584
+ default: 0
585
+ },
586
+ hasTabIndexEnter: {
587
+ type: Boolean,
588
+ default: !0
589
+ },
590
+ ariaLabel: {
591
+ type: String,
592
+ default: "Alternate Text Button"
593
+ },
594
+ ariaAttrs: {
595
+ type: Object,
596
+ default: () => ({})
597
+ },
598
+ textColor: {
599
+ // TESTAR AINDA
600
+ type: String,
601
+ default: "#ffffff"
602
+ },
603
+ caretColor: {
604
+ type: String,
605
+ default: "",
606
+ validator: (e) => !e || typeof e == "string"
607
+ },
608
+ selectionBgColor: {
609
+ type: String,
610
+ default: "",
611
+ validator: (e) => !e || typeof e == "string"
612
+ },
613
+ selectionTextColor: {
614
+ type: String,
615
+ default: "",
616
+ validator: (e) => !e || typeof e == "string"
617
+ },
618
+ theme: {
619
+ type: String,
620
+ default: "light",
621
+ validator: (e) => ["dark", "light"].indexOf(e) !== -1
622
+ },
623
+ hasBorderRadius: {
624
+ type: Boolean,
625
+ default: !1,
626
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
627
+ },
628
+ borderRadius: {
629
+ type: Number,
630
+ default: 0.5
631
+ // 0.375
632
+ },
633
+ disabled: {
634
+ type: Boolean,
635
+ default: !1,
636
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
637
+ },
638
+ fontFamily: {
639
+ type: String,
640
+ default: "'Lato', sans-serif"
641
+ },
642
+ fontSize: {
643
+ type: String,
644
+ default: null
645
+ },
646
+ fontWeight: {
647
+ type: Number,
648
+ default: 400,
649
+ validator: (e) => e || 700
650
+ },
651
+ fontFamilyMsg: {
652
+ type: String,
653
+ default: "'Lato', sans-serif"
654
+ },
655
+ fontSizeMsg: {
656
+ type: String,
657
+ default: "1em",
658
+ validator: (e) => e || "1em"
659
+ },
660
+ fontWeightMsg: {
661
+ type: Number,
662
+ default: 400,
663
+ validator: (e) => e || 700
664
+ },
665
+ textMessageColor: {
666
+ type: String,
667
+ default: "#f15574"
668
+ },
669
+ textAlign: {
670
+ type: String,
671
+ default: "left",
672
+ validator: (e) => ["center", "left", "right"].indexOf(e) !== -1
673
+ },
674
+ inputText: {
675
+ type: String,
676
+ default: ""
677
+ },
678
+ inputType: {
679
+ type: String,
680
+ default: "text",
681
+ validator: (e) => ["text", "number", "email", "password"].indexOf(e) !== -1
682
+ },
683
+ hasTrim: {
684
+ type: Boolean,
685
+ default: !1,
686
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
687
+ },
688
+ inputName: {
689
+ type: String,
690
+ required: !0
691
+ },
692
+ inputPlaceholder: {
693
+ type: String,
694
+ default: ""
695
+ },
696
+ showInputEye: {
697
+ type: Boolean,
698
+ default: !1,
699
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
700
+ },
701
+ inputEyeIcon: {
702
+ type: String,
703
+ default: "🫣"
704
+ },
705
+ inputEyeIconHidden: {
706
+ type: String,
707
+ default: "😎"
708
+ },
709
+ inputEyeCustomIcon: {
710
+ type: Boolean,
711
+ default: !1,
712
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
713
+ },
714
+ activeTextStyle: {
715
+ type: String,
716
+ default: "normal",
717
+ validator: (e) => ["normal", "italic", "oblique"].indexOf(e) !== -1
718
+ },
719
+ sizeMediaQuery: {
720
+ type: String,
721
+ default: "sm",
722
+ validator: (e) => ["xs", "sm", "md", "lg"].indexOf(e) !== -1
723
+ },
724
+ required: {
725
+ type: Boolean,
726
+ default: !1,
727
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
728
+ },
729
+ inputReadonly: {
730
+ type: Boolean,
731
+ default: !1,
732
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
733
+ },
734
+ inputAutocomplete: {
735
+ type: String,
736
+ default: "on",
737
+ validator: (e) => ["on", "off"].indexOf(e) !== -1
738
+ },
739
+ inputUppercase: {
740
+ type: Boolean,
741
+ default: !1,
742
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
743
+ },
744
+ inputWidth: {
745
+ type: Number,
746
+ default: 200
747
+ },
748
+ inputStyle: {
749
+ type: String,
750
+ default: "background",
751
+ validator: (e) => ["background", "line", "border"].indexOf(e) !== -1
752
+ },
753
+ // Cores do tema light
754
+ lightBgColor: {
755
+ type: String,
756
+ default: "#f8f8f2"
757
+ },
758
+ lightBgColorFocus: {
759
+ type: String,
760
+ default: "#eaeaea"
761
+ },
762
+ lightEyeBgColor: {
763
+ type: String,
764
+ default: "#353734"
765
+ },
766
+ lightEyeBgColorActive: {
767
+ type: String,
768
+ default: "#272936"
769
+ },
770
+ lightDisabledBgColor: {
771
+ type: String,
772
+ default: "#dfdfd9"
773
+ },
774
+ lightTextColor: {
775
+ type: String,
776
+ default: "#000000"
777
+ },
778
+ // Cores do tema dark
779
+ darkBgColor: {
780
+ type: String,
781
+ default: "#353734"
782
+ },
783
+ darkBgColorFocus: {
784
+ type: String,
785
+ default: "#272936"
786
+ },
787
+ darkEyeBgColor: {
788
+ type: String,
789
+ default: "#353734"
790
+ },
791
+ darkEyeBgColorActive: {
792
+ type: String,
793
+ default: "#272936"
794
+ },
795
+ darkDisabledBgColor: {
796
+ type: String,
797
+ default: "rgba(40, 42, 54, 1)"
798
+ },
799
+ darkTextColor: {
800
+ type: String,
801
+ default: "#000000"
802
+ },
803
+ darkDisabledEyeBgColor: {
804
+ type: String,
805
+ default: "rgba(68, 71, 90, 0.3)"
806
+ },
807
+ lightDisabledEyeBgColor: {
808
+ type: String,
809
+ default: "rgba(53, 55, 52, 0.3)"
810
+ },
811
+ tabindex: {
812
+ type: [String, Number],
813
+ default: 0
814
+ },
815
+ showMsg: {
816
+ // Se mostrado o erro
817
+ type: Boolean,
818
+ default: !1,
819
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
820
+ },
821
+ hasMsg: {
822
+ // Se tem erro
823
+ type: Boolean,
824
+ default: !1,
825
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
826
+ },
827
+ message: {
828
+ type: String,
829
+ default: "Default message text"
830
+ },
831
+ hasCustomMsg: {
832
+ type: Boolean,
833
+ default: !1,
834
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
835
+ },
836
+ hasIcon: {
837
+ type: Boolean,
838
+ default: !1,
839
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
840
+ },
841
+ iconWidth: {
842
+ type: Number,
843
+ default: 32
844
+ },
845
+ iconDirection: {
846
+ type: String,
847
+ default: "left",
848
+ validator: (e) => ["left", "right"].includes(e)
849
+ },
850
+ iconPadding: {
851
+ type: String,
852
+ default: "5px 10px",
853
+ validator: (e) => typeof e == "string" && e.split(" ").length === 2
854
+ },
855
+ iconPaddingInput: {
856
+ type: Number,
857
+ default: 35
858
+ },
859
+ iconMargin: {
860
+ type: String,
861
+ default: "0"
862
+ },
863
+ iconLightTextColor: {
864
+ type: String,
865
+ default: "#f8f8f2"
866
+ },
867
+ iconDarkTextColor: {
868
+ type: String,
869
+ default: "#f8f8f2"
870
+ },
871
+ iconLightBgColor: {
872
+ type: String,
873
+ default: "#353734"
874
+ },
875
+ iconLightBgColorActive: {
876
+ type: String,
877
+ default: "#272936"
878
+ },
879
+ iconDarkBgColor: {
880
+ type: String,
881
+ default: "#353734"
882
+ },
883
+ iconDarkBgColorActive: {
884
+ type: String,
885
+ default: "#272936"
886
+ },
887
+ iconDarkDisabledBgColor: {
888
+ type: String,
889
+ default: "rgba(68, 71, 90, 0.3)"
890
+ },
891
+ iconLightDisabledBgColor: {
892
+ type: String,
893
+ default: "rgba(53, 55, 52, 0.3)"
894
+ },
895
+ iconBorderRadius: {
896
+ type: Number,
897
+ default: 0
898
+ },
899
+ iconSize: {
900
+ type: Number,
901
+ default: 1
902
+ }
903
+ },
904
+ emits: [
905
+ "current-value",
906
+ "changed",
907
+ "focused",
908
+ "blurred",
909
+ "show-input-eye",
910
+ "clicked",
911
+ "entered"
912
+ ],
913
+ setup(e, { emit: i }) {
914
+ Ge((a) => ({
915
+ "7db11dc6": lt.value,
916
+ "465ec593": Fe.value,
917
+ "0bd0a5e4": l(b),
918
+ "490fdeba": n.value,
919
+ "09c697b5": g.value,
920
+ "497da60d": L.value,
921
+ "5e478652": l(z),
922
+ "65dc7d59": l(ye),
923
+ "7caea4a6": l(m),
924
+ "7d9d18e5": l(Ze),
925
+ "40dc79c4": l(d),
926
+ "3febb3de": l(Se),
927
+ 55340077: l(o),
928
+ "6cbaee7c": Tt.value,
929
+ ccb4758c: l(q),
930
+ "3734d3be": l(ve),
931
+ "35bcd232": l(A),
932
+ "86db4b1e": l(G),
933
+ eebf601a: l(Je),
934
+ "6540ecda": l($),
935
+ 83825256: l(u),
936
+ f52be38a: l(c),
937
+ "23886af6": l(pe),
938
+ "5b006382": l(xe),
939
+ "3eca0d2c": Bt.value,
940
+ b46ea296: It.value,
941
+ "21492e8a": At.value,
942
+ "01e48fba": wt.value,
943
+ "0f7f0fdd": Ct.value,
944
+ "060b01ca": l(re),
945
+ "21c08896": bt.value,
946
+ "8b25c7ac": ot.value,
947
+ "5b17912e": nt.value,
948
+ "6f485452": ut.value,
949
+ "501e5a2c": je.value,
950
+ dcd9aea4: a.styleButtonColor,
951
+ "16e77a5a": rt.value
952
+ })), Ke(() => {
953
+ ae.value = ue.value;
954
+ }), ba(() => {
955
+ Nt();
956
+ });
957
+ const r = i, B = e, {
958
+ display: y,
959
+ hasTabIndexEnter: W,
960
+ ariaLabel: _,
961
+ ariaAttrs: H,
962
+ textColor: oe,
963
+ caretColor: x,
964
+ selectionBgColor: F,
965
+ selectionTextColor: j,
966
+ hasBorderRadius: U,
967
+ borderRadius: P,
968
+ disabled: T,
969
+ fontFamily: I,
970
+ fontSize: S,
971
+ fontWeight: k,
972
+ fontFamilyMsg: w,
973
+ fontSizeMsg: E,
974
+ fontWeightMsg: Y,
975
+ textMessageColor: N,
976
+ inputWidth: D,
977
+ inputStyle: v,
978
+ activeTextStyle: J,
979
+ sizeMediaQuery: p,
980
+ inputReadonly: Z,
981
+ showInputEye: de,
982
+ inputType: R,
983
+ hasTrim: ee,
984
+ inputUppercase: ce,
985
+ inputName: ne,
986
+ inputPlaceholder: me,
987
+ inputText: ue,
988
+ theme: fe,
989
+ inputEyeIcon: he,
990
+ tabindex: Ce,
991
+ inputEyeIconHidden: Ve,
992
+ lightBgColor: pe,
993
+ lightBgColorFocus: xe,
994
+ lightEyeBgColor: u,
995
+ lightEyeBgColorActive: c,
996
+ lightDisabledBgColor: $,
997
+ lightTextColor: b,
998
+ darkBgColor: q,
999
+ darkBgColorFocus: ve,
1000
+ darkEyeBgColor: Se,
1001
+ darkEyeBgColorActive: o,
1002
+ darkDisabledBgColor: d,
1003
+ darkTextColor: z,
1004
+ darkDisabledEyeBgColor: m,
1005
+ lightDisabledEyeBgColor: G,
1006
+ textAlign: re,
1007
+ showMsg: ke,
1008
+ hasMsg: Te,
1009
+ hasIcon: M,
1010
+ iconDirection: Be,
1011
+ iconPadding: te,
1012
+ iconPaddingInput: we,
1013
+ iconMargin: Ee,
1014
+ iconBorderRadius: Ne,
1015
+ iconLightTextColor: A,
1016
+ iconDarkTextColor: ye,
1017
+ iconLightBgColor: O,
1018
+ iconDarkBgColor: Le,
1019
+ iconLightBgColorActive: We,
1020
+ iconDarkBgColorActive: He,
1021
+ iconLightDisabledBgColor: Je,
1022
+ iconDarkDisabledBgColor: Ze,
1023
+ iconWidth: $e,
1024
+ iconSize: ze
1025
+ } = Ue(B), ae = Q(""), _e = Q(""), ge = Q(!1), Ie = Q(!1), s = t(() => {
1026
+ const a = T.value ? "component-disabled" : "", f = y.value !== "b" ? "inline-block" : "block", be = oe ? oe.value : "ffffff", Ae = x.value ? x.value : "", zt = F.value ? F.value : "", Mt = j.value ? j.value : "", Ot = U.value ? U.value : !1, Lt = !P.value || P.value < 0 ? 0 : P.value, Wt = I.value ? I.value : "'Lato', sans-serif", Ht = S.value && S.value >= 0 ? S.value : null, Ft = !k.value || k.value < 0 ? 100 : k.value, jt = w.value ? w.value : "'Lato', sans-serif", Pt = E.value ? E.value : "1em", qt = !Y.value || Y.value < 0 ? 100 : Y.value, Gt = N.value ? N.value : "#f15574", Kt = D.value ? D.value : 200, Ut = J.value ? J.value : "normal", Qt = p.value ? p.value : "xs", Xt = Z.value ? Z.value : !1, Yt = de.value ? de.value : !1, Jt = R.value ? R.value : "text", Zt = ce.value ? ce.value : !1, ea = fe.value ? fe.value : "normal", ta = re.value ? re.value : "left", aa = v.value ? v.value : "background", la = te.value ? te.value : "5px 10px", oa = Ee.value ? Ee.value : "0", na = we.value ? we.value : 10, ua = A.value ? A.value : "#000000", ra = ye.value ? ye.value : "#000000", ia = O.value ? O.value : "transparent", sa = Le.value ? Le.value : "transparent", da = Ne.value ? Ne.value : 0, ca = We.value ? We.value : "transparent", fa = He.value ? He.value : "transparent", pa = $e.value ? $e.value : 32, va = ze.value ? ze.value : 1;
1027
+ return {
1028
+ disabled: a,
1029
+ display: f,
1030
+ font: Wt,
1031
+ fontSize: Ht,
1032
+ fontWeight: Ft,
1033
+ fontFamilyMsg: jt,
1034
+ fontSizeMsg: Pt,
1035
+ fontWeightMsg: qt,
1036
+ textMessageColor: Gt,
1037
+ textColor: be,
1038
+ caretColor: Ae,
1039
+ selectionBgColor: zt,
1040
+ selectionTextColor: Mt,
1041
+ hasBorderRadius: Ot,
1042
+ borderRadius: Lt,
1043
+ textAlign: ta,
1044
+ inputWidth: Kt,
1045
+ activeTextStyle: Ut,
1046
+ sizeMediaQuery: Qt,
1047
+ inputReadonly: Xt,
1048
+ showInputEye: Yt,
1049
+ inputType: Jt,
1050
+ inputUppercase: Zt,
1051
+ theme: ea,
1052
+ inputStyle: aa,
1053
+ iconPadding: la,
1054
+ iconMargin: oa,
1055
+ iconPaddingInput: na,
1056
+ iconLightTextColor: ua,
1057
+ iconDarkTextColor: ra,
1058
+ iconLightBgColor: ia,
1059
+ iconDarkBgColor: sa,
1060
+ iconBorderRadius: da,
1061
+ iconLightBgColorActive: ca,
1062
+ iconDarkBgColorActive: fa,
1063
+ iconWidth: pa,
1064
+ iconSize: va
1065
+ };
1066
+ }), et = t(() => s.value.disabled), tt = t(() => ({
1067
+ display: s.value.display
1068
+ })), Fe = t(() => {
1069
+ const a = s.value;
1070
+ if (a.fontSize)
1071
+ return `${a.fontSize}em`;
1072
+ let f = "";
1073
+ switch (a.sizeMediaQuery) {
1074
+ case "sm":
1075
+ return "1.2em";
1076
+ case "md":
1077
+ return "1.6em";
1078
+ case "lg":
1079
+ return "2em";
1080
+ default:
1081
+ f = "1.2em";
1082
+ }
1083
+ return f;
1084
+ }), at = t(() => {
1085
+ const a = s.value;
1086
+ return {
1087
+ fontSize: Fe.value,
1088
+ fontWeight: a.fontWeight
1089
+ };
1090
+ }), De = t(() => {
1091
+ const a = s.value;
1092
+ return a.inputStyle !== "line" && a.hasBorderRadius ? { borderRadius: `${a.borderRadius}rem` } : {};
1093
+ }), lt = t(() => s.value.font), ot = t(() => s.value.fontFamilyMsg), nt = t(() => s.value.fontSizeMsg), ut = t(() => s.value.fontWeightMsg), rt = t(() => s.value.textColor), je = t(() => s.value.textMessageColor), n = t(() => {
1094
+ const a = s.value;
1095
+ return a.caretColor || (a.theme === "dark" ? "#00d4ff" : "#007bff");
1096
+ }), g = t(() => {
1097
+ const a = s.value;
1098
+ return a.selectionBgColor || (a.theme === "dark" ? "#00d4ff" : "#007bff");
1099
+ }), L = t(() => {
1100
+ const a = s.value;
1101
+ return a.selectionTextColor || (a.theme === "dark" ? "#000000" : "#ffffff");
1102
+ }), le = t(() => {
1103
+ const a = s.value;
1104
+ return a.display === "block" ? { width: "100%" } : {
1105
+ width: `${a.inputWidth}px`
1106
+ };
1107
+ }), it = t(() => {
1108
+ switch (v.value) {
1109
+ case "line":
1110
+ return "component__input--line";
1111
+ case "border":
1112
+ return "component__input--border";
1113
+ default:
1114
+ return "component__input--background";
1115
+ }
1116
+ }), st = t(() => {
1117
+ switch (s.value.activeTextStyle) {
1118
+ case "italic":
1119
+ return "component__input--active--italic";
1120
+ case "oblique":
1121
+ return "component__input--active--oblique";
1122
+ default:
1123
+ return "component__input--active--normal";
1124
+ }
1125
+ }), dt = t(() => {
1126
+ switch (s.value.sizeMediaQuery) {
1127
+ case "sm":
1128
+ return "component__sm";
1129
+ case "md":
1130
+ return "component__md";
1131
+ case "lg":
1132
+ return "component__lg";
1133
+ default:
1134
+ return "";
1135
+ }
1136
+ }), ct = t(() => {
1137
+ switch (s.value.theme) {
1138
+ case "dark":
1139
+ return "component__theme--dark";
1140
+ default:
1141
+ return "component__theme--light";
1142
+ }
1143
+ }), ft = t(() => s.value.inputReadonly ? "component__input--read-only" : ""), pt = t(() => s.value.inputUppercase ? "component__input--uppercase" : ""), Pe = t(() => {
1144
+ const a = s.value;
1145
+ return !!(a.showInputEye && a.inputType === "password");
1146
+ }), vt = t(() => ge.value ? he.value : Ve.value), yt = t(() => s.value.inputType === "password" ? "component__input__eye-default--hidden" : ""), gt = t(() => Ie.value ? "component__input--active" : "component__input--no-active"), bt = t(() => Pe.value ? "6px 50px 6px 10px" : "6px 10px"), mt = t(() => !!(ke.value && Te.value)), ht = t(() => {
1147
+ const a = {};
1148
+ H.value && Object.keys(H.value).forEach((Ae) => a[`aria-${Ae}`] = H.value[Ae]);
1149
+ const f = {
1150
+ "aria-label": _.value,
1151
+ "aria-disabled": T.value,
1152
+ ...a
1153
+ };
1154
+ return Object.fromEntries(
1155
+ Object.entries(f).filter(([be, Ae]) => Ae != null)
1156
+ );
1157
+ }), Ct = t(() => M.value ? `${ze.value}rem` : "0"), Bt = t(() => M.value ? `${$e.value}px` : "0"), _t = t(() => M.value ? `component__icon--${Be.value}` : ""), It = t(() => {
1158
+ const a = s.value;
1159
+ return M.value ? a.iconPadding : "0";
1160
+ }), At = t(() => {
1161
+ const a = s.value;
1162
+ return M.value ? a.iconMargin : "0";
1163
+ }), Tt = t(() => {
1164
+ const a = s.value;
1165
+ return M.value ? a.theme === "dark" ? a.iconDarkBgColor : a.iconLightBgColor : "transparent";
1166
+ }), wt = t(() => {
1167
+ const a = s.value;
1168
+ return M.value ? `${a.iconBorderRadius}rem` : "0";
1169
+ }), Et = t(() => {
1170
+ const a = s.value;
1171
+ return M.value ? Be.value === "left" ? { paddingLeft: `${a.iconPaddingInput}px` } : { paddingRight: `${a.iconPaddingInput}px` } : {};
1172
+ }), Nt = () => {
1173
+ ae.value = ue.value, _e.value = R.value;
1174
+ }, Dt = () => {
1175
+ const a = s.value;
1176
+ if (a.inputReadonly || a.disabled)
1177
+ return;
1178
+ const f = !ge.value;
1179
+ f ? _e.value = "text" : _e.value = R.value, ge.value = f;
1180
+ }, Rt = () => {
1181
+ r("clicked");
1182
+ }, $t = () => {
1183
+ T.value || s.value.inputReadonly || !W.value || r("entered", ae.value);
1184
+ };
1185
+ return K(R, (a) => {
1186
+ _e.value = a;
1187
+ }, { immediate: !0 }), K(ue, (a) => {
1188
+ a !== ae.value && (ae.value = a);
1189
+ }, { immediate: !0 }), K(ae, (a) => {
1190
+ ee.value && (a = a.trim()), r("changed", a);
1191
+ }), K(Ie, (a) => {
1192
+ r(a ? "focused" : "blurred");
1193
+ }), K(ge, (a) => {
1194
+ r("show-input-eye", a);
1195
+ }, { immediate: !0 }), K(ae, (a) => {
1196
+ ee.value && (a = a.trim()), r("current-value", a);
1197
+ }), K(R, (a) => {
1198
+ a === "password" && nextTick(() => {
1199
+ const f = document.getElementById(ne.value);
1200
+ f && (f.type = "password", f.removeAttribute("autocomplete"));
1201
+ });
1202
+ }), (a, f) => e.nbId ? (h(), C("div", Qe({
1203
+ key: 0,
1204
+ class: ["nb-wrapper", et.value],
1205
+ style: [tt.value, le.value, De.value],
1206
+ role: "input"
1207
+ }, ht.value), [
1208
+ V("div", {
1209
+ id: e.nbId,
1210
+ class: X(["nb-reset", "component", dt.value, ct.value, ft.value, it.value]),
1211
+ style: se([at.value, le.value, De.value]),
1212
+ onClick: Rt
1213
+ }, [
1214
+ Pe.value ? (h(), C("div", {
1215
+ key: 0,
1216
+ class: X(["component__eye", gt.value]),
1217
+ style: se([De.value]),
1218
+ onClick: Dt
1219
+ }, [
1220
+ V("span", Ea, [
1221
+ e.inputEyeCustomIcon ? (h(), C("span", Da, [
1222
+ ge.value ? Me(a.$slots, "eye-icon-show", { key: 0 }, () => [
1223
+ f[4] || (f[4] = Vt("show"))
1224
+ ], !0) : Me(a.$slots, "eye-icon-hidden", { key: 1 }, () => [
1225
+ f[5] || (f[5] = Vt("hidden"))
1226
+ ], !0)
1227
+ ])) : (h(), C("span", Na, Oe(vt.value), 1))
1228
+ ])
1229
+ ], 6)) : ie("", !0),
1230
+ Xe(V("input", {
1231
+ "onUpdate:modelValue": f[0] || (f[0] = (be) => ae.value = be),
1232
+ id: l(ne),
1233
+ name: l(ne),
1234
+ type: _e.value,
1235
+ class: X(["component__input", [
1236
+ pt.value,
1237
+ yt.value,
1238
+ st.value
1239
+ ]]),
1240
+ placeholder: l(me),
1241
+ disabled: l(T) || l(Z),
1242
+ required: e.required,
1243
+ readonly: l(Z),
1244
+ autocomplete: e.inputAutocomplete,
1245
+ tabindex: l(T) || l(Z) ? -1 : l(Ce),
1246
+ role: "input",
1247
+ style: se([De.value, Et.value]),
1248
+ onFocus: f[1] || (f[1] = (be) => Ie.value = !0),
1249
+ onBlur: f[2] || (f[2] = (be) => Ie.value = !1),
1250
+ onKeydown: f[3] || (f[3] = Re((be) => !l(T) && l(W) && $t(), ["enter"]))
1251
+ }, null, 46, Ra), [
1252
+ [ma, ae.value]
1253
+ ]),
1254
+ l(M) ? (h(), C("label", {
1255
+ key: 1,
1256
+ for: l(ne),
1257
+ class: X(["component__icon", _t.value])
1258
+ }, [
1259
+ Me(a.$slots, "icon", {}, () => [
1260
+ f[6] || (f[6] = V("span", null, "♥", -1))
1261
+ ], !0)
1262
+ ], 10, $a)) : ie("", !0)
1263
+ ], 14, wa),
1264
+ mt.value ? (h(), C("div", {
1265
+ key: 0,
1266
+ class: X(["component__message", e.hasCustomMsg ? "component__message--custom" : "component__message--default"])
1267
+ }, [
1268
+ Me(a.$slots, "message", {}, () => [
1269
+ Vt(Oe(e.message), 1)
1270
+ ], !0)
1271
+ ], 2)) : ie("", !0)
1272
+ ], 16)) : ie("", !0);
1273
+ }
1274
+ }), Ma = /* @__PURE__ */ Ye(za, [["__scopeId", "data-v-d689f281"]]);
1275
+ const Oa = ["id"], La = { class: "chip-text" }, Wa = ["onClick"], Ha = ["name", "placeholder", "readonly", "autocomplete", "required", "tabindex"], Fa = /* @__PURE__ */ Object.assign({
1276
+ name: "NbInputChip",
1277
+ inheritAttrs: !1
1278
+ }, {
1279
+ __name: "NbInputChip",
1280
+ props: {
1281
+ nbId: {
1282
+ type: String,
1283
+ required: !0
1284
+ },
1285
+ display: {
1286
+ type: String,
1287
+ default: "b",
1288
+ validator: (e = "b") => {
1289
+ const i = e.toLowerCase();
1290
+ return ["b", "ib"].includes(i);
1291
+ }
1292
+ },
1293
+ tabIndex: {
1294
+ type: Number,
1295
+ default: 0
1296
+ },
1297
+ hasTabIndexEnter: {
1298
+ type: Boolean,
1299
+ default: !0
1300
+ },
1301
+ ariaLabel: {
1302
+ type: String,
1303
+ default: "Input Chip"
1304
+ },
1305
+ ariaAttrs: {
1306
+ type: Object,
1307
+ default: () => ({})
1308
+ },
1309
+ caretColor: {
1310
+ type: String,
1311
+ default: "",
1312
+ validator: (e) => !e || typeof e == "string"
1313
+ },
1314
+ width: {
1315
+ type: Number,
1316
+ default: 185,
1317
+ validator: (e) => e || 185
1318
+ },
1319
+ textColor: {
1320
+ type: String,
1321
+ default: "#ffffff"
1322
+ },
1323
+ selectionBgColor: {
1324
+ type: String,
1325
+ default: "",
1326
+ validator: (e) => !e || typeof e == "string"
1327
+ },
1328
+ selectionTextColor: {
1329
+ type: String,
1330
+ default: "",
1331
+ validator: (e) => !e || typeof e == "string"
1332
+ },
1333
+ paddingX: {
1334
+ type: Number,
1335
+ default: 0.2,
1336
+ validator: (e) => e || 1
1337
+ },
1338
+ paddingY: {
1339
+ type: Number,
1340
+ default: 0.2,
1341
+ validator: (e) => e || 0.2
1342
+ },
1343
+ hasBorderRadius: {
1344
+ type: Boolean,
1345
+ default: !1,
1346
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
1347
+ },
1348
+ borderRadius: {
1349
+ type: Number,
1350
+ default: 0.375
1351
+ },
1352
+ disabled: {
1353
+ type: Boolean,
1354
+ default: !1,
1355
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
1356
+ },
1357
+ fontFamily: {
1358
+ type: String,
1359
+ default: "'Lato', sans-serif"
1360
+ },
1361
+ fontSize: {
1362
+ type: String,
1363
+ default: "1.6em",
1364
+ validator: (e) => e || "1.6em"
1365
+ },
1366
+ fontWeight: {
1367
+ type: Number,
1368
+ default: 400,
1369
+ validator: (e) => e || 700
1370
+ },
1371
+ currentList: {
1372
+ type: Array,
1373
+ default: () => [],
1374
+ validator: (e) => Array.isArray(e)
1375
+ },
1376
+ allowDuplicates: {
1377
+ type: Boolean,
1378
+ default: !1,
1379
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
1380
+ },
1381
+ minChips: {
1382
+ type: Number,
1383
+ default: 0
1384
+ },
1385
+ maxChips: {
1386
+ type: Number,
1387
+ default: 10
1388
+ },
1389
+ inputPosition: {
1390
+ type: String,
1391
+ default: "bottom",
1392
+ validator: (e) => ["top", "bottom"].includes(e)
1393
+ },
1394
+ inputName: {
1395
+ type: String,
1396
+ default: ""
1397
+ },
1398
+ inputPlaceholder: {
1399
+ type: String,
1400
+ default: "Type and press Enter"
1401
+ },
1402
+ inputUppercase: {
1403
+ type: Boolean,
1404
+ default: !1,
1405
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
1406
+ },
1407
+ inputReadonly: {
1408
+ type: Boolean,
1409
+ default: !1,
1410
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
1411
+ },
1412
+ inputAutocomplete: {
1413
+ type: String,
1414
+ default: "on",
1415
+ validator: (e) => ["on", "off"].indexOf(e) !== -1
1416
+ },
1417
+ required: {
1418
+ type: Boolean,
1419
+ default: !1,
1420
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
1421
+ },
1422
+ textAlign: {
1423
+ type: String,
1424
+ default: "left",
1425
+ validator: (e) => ["center", "left", "right"].indexOf(e) !== -1
1426
+ },
1427
+ activeTextStyle: {
1428
+ type: String,
1429
+ default: "normal",
1430
+ validator: (e) => ["normal", "italic", "oblique"].indexOf(e) !== -1
1431
+ },
1432
+ theme: {
1433
+ type: String,
1434
+ default: "light",
1435
+ validator: (e) => ["dark", "light"].indexOf(e) !== -1
1436
+ },
1437
+ inputStyle: {
1438
+ type: String,
1439
+ default: "background",
1440
+ validator: (e) => ["background", "line", "border"].indexOf(e) !== -1
1441
+ },
1442
+ // Cores do tema light
1443
+ lightBgColor: {
1444
+ type: String,
1445
+ default: "#f8f8f2"
1446
+ },
1447
+ lightBgColorFocus: {
1448
+ type: String,
1449
+ default: "#eaeaea"
1450
+ },
1451
+ lightBorderColor: {
1452
+ type: String,
1453
+ default: "#353734"
1454
+ },
1455
+ lightBorderColorFocus: {
1456
+ type: String,
1457
+ default: "#272936"
1458
+ },
1459
+ lightDisabledBgColor: {
1460
+ type: String,
1461
+ default: "#dfdfd9"
1462
+ },
1463
+ lightTextColor: {
1464
+ type: String,
1465
+ default: "#000000"
1466
+ },
1467
+ lightChipBgColor: {
1468
+ type: String,
1469
+ default: "#e0e0e0"
1470
+ },
1471
+ lightChipTextColor: {
1472
+ type: String,
1473
+ default: "#000000"
1474
+ },
1475
+ lightChipRemoveColor: {
1476
+ type: String,
1477
+ default: "#f44336"
1478
+ },
1479
+ lightDisabledBorderColor: {
1480
+ type: String,
1481
+ default: "rgba(53, 55, 52, 0.3)"
1482
+ },
1483
+ // Cores do tema dark
1484
+ darkBgColor: {
1485
+ type: String,
1486
+ default: "#353734"
1487
+ },
1488
+ darkBgColorFocus: {
1489
+ type: String,
1490
+ default: "#272936"
1491
+ },
1492
+ darkBorderColor: {
1493
+ type: String,
1494
+ default: "#44475a"
1495
+ },
1496
+ darkBorderColorFocus: {
1497
+ type: String,
1498
+ default: "rgba(68, 71, 90, 0.4)"
1499
+ },
1500
+ darkDisabledBgColor: {
1501
+ type: String,
1502
+ default: "rgba(40, 42, 54, 1)"
1503
+ },
1504
+ darkTextColor: {
1505
+ type: String,
1506
+ default: "#ffffff"
1507
+ },
1508
+ darkChipBgColor: {
1509
+ type: String,
1510
+ default: "#44475a"
1511
+ },
1512
+ darkChipTextColor: {
1513
+ type: String,
1514
+ default: "#ffffff"
1515
+ },
1516
+ darkChipRemoveColor: {
1517
+ type: String,
1518
+ default: "#f44336"
1519
+ },
1520
+ darkDisabledBorderColor: {
1521
+ type: String,
1522
+ default: "rgba(68, 71, 90, 0.3)"
1523
+ }
1524
+ },
1525
+ emits: ["clicked", "changed", "removed", "added", "input-changed", "focused", "blurred"],
1526
+ setup(e, { emit: i }) {
1527
+ Ge((n) => ({
1528
+ "1549ffc9": $e.value,
1529
+ "73ec4a48": ae.value,
1530
+ "1eee568c": l(he),
1531
+ "6d90e4bc": l(ce),
1532
+ "16339c1b": l(me),
1533
+ "56fd01b6": l(Ce),
1534
+ "22c193ce": l(Ve),
1535
+ "5f1758d7": l(pe),
1536
+ "6e7cb926": l(ve),
1537
+ "6d719d0e": l(u),
1538
+ "327fd4f2": l($),
1539
+ "27897b22": l(Se),
1540
+ "0215623a": l(o),
1541
+ "8e9d877a": l(d),
1542
+ "37cf217d": l(ue),
1543
+ "1171ab91": l(b),
1544
+ "99a84312": ge.value,
1545
+ "3b55b689": Ie.value,
1546
+ "53c05fe1": s.value,
1547
+ "9f4dd54c": n.styleButtonColor,
1548
+ "2a052b02": ze.value,
1549
+ beaeb8f4: l(fe),
1550
+ "019f1fff": l(xe),
1551
+ "0b7af21c": l(q),
1552
+ "6b816d6b": l(z)
1553
+ })), Ke(() => {
1554
+ P.value.length > 0 && (A.value = P.value);
1555
+ });
1556
+ const r = i, B = e, {
1557
+ display: y,
1558
+ textColor: W,
1559
+ paddingX: _,
1560
+ paddingY: H,
1561
+ borderRadius: oe,
1562
+ disabled: x,
1563
+ fontFamily: F,
1564
+ fontSize: j,
1565
+ fontWeight: U,
1566
+ currentList: P,
1567
+ allowDuplicates: T,
1568
+ minChips: I,
1569
+ maxChips: S,
1570
+ inputPosition: k,
1571
+ width: w,
1572
+ inputName: E,
1573
+ inputPlaceholder: Y,
1574
+ inputUppercase: N,
1575
+ inputReadonly: D,
1576
+ inputAutocomplete: v,
1577
+ required: J,
1578
+ textAlign: p,
1579
+ hasBorderRadius: Z,
1580
+ activeTextStyle: de,
1581
+ theme: R,
1582
+ inputStyle: ee,
1583
+ lightBgColor: ce,
1584
+ lightBgColorFocus: ne,
1585
+ lightBorderColor: me,
1586
+ lightBorderColorFocus: ue,
1587
+ lightDisabledBgColor: fe,
1588
+ lightTextColor: he,
1589
+ lightChipBgColor: Ce,
1590
+ lightChipTextColor: Ve,
1591
+ lightChipRemoveColor: pe,
1592
+ lightDisabledBorderColor: xe,
1593
+ darkBgColor: u,
1594
+ darkBgColorFocus: c,
1595
+ darkBorderColor: $,
1596
+ darkBorderColorFocus: b,
1597
+ darkDisabledBgColor: q,
1598
+ darkTextColor: ve,
1599
+ darkChipBgColor: Se,
1600
+ darkChipTextColor: o,
1601
+ darkChipRemoveColor: d,
1602
+ darkDisabledBorderColor: z,
1603
+ tabIndex: m,
1604
+ hasTabIndexEnter: G,
1605
+ ariaLabel: re,
1606
+ ariaAttrs: ke,
1607
+ caretColor: Te,
1608
+ selectionBgColor: M,
1609
+ selectionTextColor: Be
1610
+ } = Ue(B), te = Q(""), we = Q(null), Ee = Q(null), Ne = Q(null), A = Q([]), ye = Q(!1), O = t(() => {
1611
+ const n = x.value ? "component-disabled" : "", g = y.value !== "b" ? "inline-block" : "block", L = !w.value || w.value < 185 ? 185 : w.value, le = W ? W.value : "ffffff", it = Te.value ? Te.value : "", st = M.value ? M.value : "", dt = Be.value ? Be.value : "", ct = !_.value || _.value < 0 ? 1 : _.value, ft = !H.value || H.value < 0 ? 0.2 : H.value, pt = !oe.value || oe.value < 0 ? 0 : oe.value, Pe = F.value ? F.value : "'Lato', sans-serif", vt = j.value ? j.value : "1.6rem", yt = !U.value || U.value < 0 ? 100 : U.value, gt = !I.value || I.value < 0 ? 0 : I.value, bt = !S.value || S.value < 0 ? 10 : S.value, mt = !k.value || !["top", "bottom"].includes(k.value) ? "bottom" : k.value, ht = !ee.value || !["background", "line", "border"].includes(ee.value) ? "background" : ee.value, Ct = R.value ? R.value : "light";
1612
+ return {
1613
+ disabled: n,
1614
+ display: g,
1615
+ width: L,
1616
+ font: Pe,
1617
+ fontSize: vt,
1618
+ fontWeight: yt,
1619
+ textColor: le,
1620
+ caretColor: it,
1621
+ selectionBgColor: st,
1622
+ selectionTextColor: dt,
1623
+ paddingX: ct,
1624
+ paddingY: ft,
1625
+ borderRadius: pt,
1626
+ minChips: gt,
1627
+ maxChips: bt,
1628
+ inputPosition: mt,
1629
+ inputStyle: ht,
1630
+ theme: Ct
1631
+ };
1632
+ }), Le = t(() => O.value.disabled), We = t(() => ({
1633
+ display: O.value.display
1634
+ })), He = t(() => {
1635
+ const n = O.value;
1636
+ return {
1637
+ color: n.textColor,
1638
+ padding: `${n.paddingY}rem ${n.paddingX}rem`,
1639
+ fontSize: n.fontSize,
1640
+ fontWeight: n.fontWeight,
1641
+ textAlign: p.value
1642
+ };
1643
+ }), Je = t(() => {
1644
+ switch (de.value) {
1645
+ case "italic":
1646
+ return "component__text--italic";
1647
+ case "oblique":
1648
+ return "component__text--oblique";
1649
+ default:
1650
+ return "component__text--normal";
1651
+ }
1652
+ }), Ze = t(() => {
1653
+ const n = O.value;
1654
+ return n.inputStyle !== "line" && Z.value ? { borderRadius: `${n.borderRadius}rem` } : {};
1655
+ }), $e = t(() => O.value.font), ze = t(() => O.value.textColor), ae = t(() => O.value.inputPosition === "top" ? "column" : "column-reverse"), _e = t(() => {
1656
+ const n = {};
1657
+ ke.value && Object.keys(ke.value).forEach((le) => n[`aria-${le}`] = ke.value[le]);
1658
+ const g = {
1659
+ "aria-label": re.value,
1660
+ "aria-disabled": x.value,
1661
+ ...n
1662
+ };
1663
+ return Object.fromEntries(
1664
+ Object.entries(g).filter(([L, le]) => le != null)
1665
+ );
1666
+ }), ge = t(() => {
1667
+ const n = O.value;
1668
+ return n.caretColor || (n.theme === "dark" ? "#00d4ff" : "#007bff");
1669
+ }), Ie = t(() => {
1670
+ const n = O.value;
1671
+ return n.selectionBgColor || (n.theme === "dark" ? "#00d4ff" : "#007bff");
1672
+ }), s = t(() => {
1673
+ const n = O.value;
1674
+ return n.selectionTextColor || (n.theme === "dark" ? "#000000" : "#ffffff");
1675
+ }), et = t(() => ({
1676
+ caretColor: ge.value
1677
+ })), tt = t(() => ({
1678
+ "--selection-bg-color": Ie.value,
1679
+ "--selection-text-color": s.value
1680
+ })), Fe = t(() => {
1681
+ const n = O.value, g = {
1682
+ width: `${n.width}px`
1683
+ };
1684
+ return n.display === "block" ? { width: "auto" } : g;
1685
+ }), at = t(() => {
1686
+ switch (R.value) {
1687
+ case "dark":
1688
+ return "component__theme--dark";
1689
+ default:
1690
+ return "component__theme--light";
1691
+ }
1692
+ }), De = t(() => {
1693
+ switch (ee.value) {
1694
+ case "line":
1695
+ return "component__input--line";
1696
+ case "border":
1697
+ return "component__input--border";
1698
+ default:
1699
+ return "component__input--background";
1700
+ }
1701
+ }), lt = () => {
1702
+ r("clicked");
1703
+ }, ot = () => {
1704
+ ye.value = !0, r("focused");
1705
+ }, nt = () => {
1706
+ ye.value = !1, r("blurred");
1707
+ }, ut = (n) => {
1708
+ if (!(x.value || D.value) && n.key === "Enter" && te.value.trim() !== "") {
1709
+ n.preventDefault();
1710
+ let g = te.value.trim();
1711
+ N.value && (g = g.toUpperCase()), (T.value || !A.value.includes(g)) && rt(g), te.value = "";
1712
+ }
1713
+ }, rt = (n) => {
1714
+ A.value.push(n), r("added", n);
1715
+ }, je = (n) => {
1716
+ A.value = A.value.filter((g) => g !== n), r("removed", n);
1717
+ };
1718
+ return K(P, (n) => {
1719
+ A.value = n, r("changed", n);
1720
+ }), K(te, (n) => {
1721
+ r("input-changed", n);
1722
+ }), (n, g) => e.nbId ? (h(), C("div", Qe({
1723
+ key: 0,
1724
+ class: ["nb-wrapper", Le.value],
1725
+ style: [We.value],
1726
+ role: "input"
1727
+ }, _e.value, { onClick: lt }), [
1728
+ V("div", {
1729
+ id: e.nbId,
1730
+ ref_key: "chipsContainer",
1731
+ ref: we,
1732
+ class: X(["nb-reset", "component", at.value, De.value]),
1733
+ style: se([He.value, Fe.value, Ze.value])
1734
+ }, [
1735
+ A.value.length > 0 ? (h(), C("div", {
1736
+ key: 0,
1737
+ ref_key: "chips",
1738
+ ref: Ne,
1739
+ class: "chips"
1740
+ }, [
1741
+ (h(!0), C(St, null, kt(A.value, (L) => (h(), C("div", {
1742
+ key: L,
1743
+ class: "chip"
1744
+ }, [
1745
+ Me(n.$slots, "chip", {
1746
+ chips: A.value,
1747
+ chip: L,
1748
+ removeChip: je
1749
+ }, () => [
1750
+ V("span", La, Oe(L), 1),
1751
+ !l(x) && !l(D) ? (h(), C("span", {
1752
+ key: 0,
1753
+ class: "chip-remove",
1754
+ onClick: (le) => je(L)
1755
+ }, "×", 8, Wa)) : ie("", !0)
1756
+ ], !0)
1757
+ ]))), 128))
1758
+ ], 512)) : ie("", !0),
1759
+ Xe(V("input", {
1760
+ ref_key: "chipInput",
1761
+ ref: Ee,
1762
+ type: "text",
1763
+ "onUpdate:modelValue": g[0] || (g[0] = (L) => te.value = L),
1764
+ name: l(E),
1765
+ placeholder: l(Y),
1766
+ readonly: l(D),
1767
+ autocomplete: l(v),
1768
+ required: l(J),
1769
+ tabindex: l(x) || l(D) ? -1 : l(m),
1770
+ class: X(["chips-input", Je.value]),
1771
+ style: se([et.value, tt.value]),
1772
+ onKeydown: g[1] || (g[1] = Re((L) => !l(x) && l(G) && ut(L), ["enter"])),
1773
+ onFocus: ot,
1774
+ onBlur: nt
1775
+ }, null, 46, Ha), [
1776
+ [ha, te.value]
1777
+ ])
1778
+ ], 14, Oa)
1779
+ ], 16)) : ie("", !0);
472
1780
  }
473
- }), Be = /* @__PURE__ */ ve($e, [["__scopeId", "data-v-c62d0c08"]]), le = {
474
- NbInputRadio: Ie,
475
- NbInputCheckbox: Be
476
- }, we = {
1781
+ }), ja = /* @__PURE__ */ Ye(Fa, [["__scopeId", "data-v-4af4ff9b"]]), xt = {
1782
+ NbInputRadio: ka,
1783
+ NbInputCheckbox: Ta,
1784
+ NbInput: Ma,
1785
+ NbInputChip: ja
1786
+ }, qa = {
477
1787
  install(e) {
478
- for (const o in le)
479
- if (Object.prototype.hasOwnProperty.call(le, o)) {
480
- const s = le[o];
481
- e.component(s.name, s);
1788
+ for (const i in xt)
1789
+ if (Object.prototype.hasOwnProperty.call(xt, i)) {
1790
+ const r = xt[i];
1791
+ e.component(r.name, r);
482
1792
  }
483
1793
  }
484
1794
  };
485
1795
  export {
486
- we as default
1796
+ qa as default
487
1797
  };