@vlalg-nimbus/nb-selects 1.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/README.md +47 -0
- package/dist/favicon.ico +0 -0
- package/dist/nb-selects.js +1984 -0
- package/dist/nb-selects.umd.cjs +1 -0
- package/dist/style.css +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,1984 @@
|
|
|
1
|
+
import { useCssVars as Ue, unref as t, onMounted as Ge, onUnmounted as _t, toRefs as Je, ref as J, computed as o, watch as pe, openBlock as T, createElementBlock as _, normalizeClass as R, normalizeStyle as Re, createElementVNode as I, mergeProps as Qe, createTextVNode as nt, toDisplayString as le, createCommentVNode as ke, withModifiers as m, withKeys as D, Fragment as vt, renderList as ct, renderSlot as pt, nextTick as Y, withDirectives as lt, vModelCheckbox as at } from "vue";
|
|
2
|
+
const Ze = (e, S) => {
|
|
3
|
+
const y = e.__vccOpts || e;
|
|
4
|
+
for (const [ae, V] of S)
|
|
5
|
+
y[ae] = V;
|
|
6
|
+
return y;
|
|
7
|
+
}, Vt = ["id"], wt = ["for"], Ht = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "component__label--required"
|
|
10
|
+
}, $t = ["tabindex"], Dt = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "component__dropdown-placeholder"
|
|
13
|
+
}, It = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "component__dropdown-selected"
|
|
16
|
+
}, At = ["tabindex", "aria-selected"], Nt = { class: "component__option-label" }, Et = ["data-option-index-single", "tabindex", "aria-selected", "onClick", "onKeydown"], zt = { class: "component__option-label" }, Rt = ["tabindex"], Wt = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "component__dropdown-placeholder"
|
|
19
|
+
}, Lt = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "component__dropdown-selected"
|
|
22
|
+
}, Kt = ["data-option-index-multiple", "tabindex", "aria-selected", "onClick", "onKeydown"], Ft = ["value", "checked", "disabled"], jt = { class: "component__checkbox-label" }, Xt = /* @__PURE__ */ Object.assign({
|
|
23
|
+
name: "NbSelect",
|
|
24
|
+
inheritAttrs: !1
|
|
25
|
+
}, {
|
|
26
|
+
__name: "NbSelect",
|
|
27
|
+
props: {
|
|
28
|
+
nbId: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: !0
|
|
31
|
+
},
|
|
32
|
+
display: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "b",
|
|
35
|
+
validator: (e = "b") => {
|
|
36
|
+
const S = e.toLowerCase();
|
|
37
|
+
return ["b", "ib"].includes(S);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
textColor: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: "#ffffff"
|
|
43
|
+
},
|
|
44
|
+
theme: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: "light",
|
|
47
|
+
validator: (e) => ["dark", "light"].indexOf(e) !== -1
|
|
48
|
+
},
|
|
49
|
+
hasBorderRadius: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !1,
|
|
52
|
+
validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
|
|
53
|
+
},
|
|
54
|
+
borderRadius: {
|
|
55
|
+
type: Number,
|
|
56
|
+
default: 0.5
|
|
57
|
+
},
|
|
58
|
+
disabled: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: !1,
|
|
61
|
+
validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
|
|
62
|
+
},
|
|
63
|
+
fontFamily: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "'Lato', sans-serif"
|
|
66
|
+
},
|
|
67
|
+
fontSize: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: "1.6em",
|
|
70
|
+
validator: (e) => e || "1.6em"
|
|
71
|
+
},
|
|
72
|
+
fontWeight: {
|
|
73
|
+
type: Number,
|
|
74
|
+
default: 400,
|
|
75
|
+
validator: (e) => e || 700
|
|
76
|
+
},
|
|
77
|
+
textAlign: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: "left",
|
|
80
|
+
validator: (e) => ["center", "left", "right"].indexOf(e) !== -1
|
|
81
|
+
},
|
|
82
|
+
selectWidth: {
|
|
83
|
+
type: Number,
|
|
84
|
+
default: 200
|
|
85
|
+
},
|
|
86
|
+
inputStyle: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: "background",
|
|
89
|
+
validator: (e) => ["background", "line", "border"].indexOf(e) !== -1
|
|
90
|
+
},
|
|
91
|
+
selectName: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: "selectX"
|
|
94
|
+
},
|
|
95
|
+
required: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
default: !1,
|
|
98
|
+
validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
|
|
99
|
+
},
|
|
100
|
+
options: {
|
|
101
|
+
type: Array,
|
|
102
|
+
default: () => []
|
|
103
|
+
},
|
|
104
|
+
selectedOptionOnly: {
|
|
105
|
+
type: [String, Number, Boolean],
|
|
106
|
+
default: ""
|
|
107
|
+
},
|
|
108
|
+
selectedOptionMultiple: {
|
|
109
|
+
type: Array,
|
|
110
|
+
default: () => [],
|
|
111
|
+
validator: (e) => e === null || Array.isArray(e)
|
|
112
|
+
},
|
|
113
|
+
textKey: {
|
|
114
|
+
type: String,
|
|
115
|
+
default: "text"
|
|
116
|
+
},
|
|
117
|
+
valueKey: {
|
|
118
|
+
type: String,
|
|
119
|
+
default: "value"
|
|
120
|
+
},
|
|
121
|
+
multiple: {
|
|
122
|
+
type: Boolean,
|
|
123
|
+
default: !1,
|
|
124
|
+
validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
|
|
125
|
+
},
|
|
126
|
+
hasEmptyOption: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: !0,
|
|
129
|
+
validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
|
|
130
|
+
},
|
|
131
|
+
emptyOptionText: {
|
|
132
|
+
type: String,
|
|
133
|
+
default: "Selecione uma opção"
|
|
134
|
+
},
|
|
135
|
+
emptyOptionValue: {
|
|
136
|
+
type: [String, Number],
|
|
137
|
+
default: null
|
|
138
|
+
},
|
|
139
|
+
dropdownScrollClass: {
|
|
140
|
+
type: String,
|
|
141
|
+
default: ""
|
|
142
|
+
},
|
|
143
|
+
hasLabel: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
default: !1,
|
|
146
|
+
validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
|
|
147
|
+
},
|
|
148
|
+
labelText: {
|
|
149
|
+
type: String,
|
|
150
|
+
default: "Select: "
|
|
151
|
+
},
|
|
152
|
+
// Cores do tema light
|
|
153
|
+
lightBgColor: {
|
|
154
|
+
type: String,
|
|
155
|
+
default: "#f8f8f2"
|
|
156
|
+
},
|
|
157
|
+
lightBgColorFocus: {
|
|
158
|
+
type: String,
|
|
159
|
+
default: "#eaeaea"
|
|
160
|
+
},
|
|
161
|
+
lightBorderColor: {
|
|
162
|
+
type: String,
|
|
163
|
+
default: "#353734"
|
|
164
|
+
},
|
|
165
|
+
lightBorderColorFocus: {
|
|
166
|
+
type: String,
|
|
167
|
+
default: "#272936"
|
|
168
|
+
},
|
|
169
|
+
lightDisabledBgColor: {
|
|
170
|
+
type: String,
|
|
171
|
+
default: "#dfdfd9"
|
|
172
|
+
},
|
|
173
|
+
lightTextColor: {
|
|
174
|
+
type: String,
|
|
175
|
+
default: "#000000"
|
|
176
|
+
},
|
|
177
|
+
lightDisabledBorderColor: {
|
|
178
|
+
type: String,
|
|
179
|
+
default: "rgba(53, 55, 52, 0.3)"
|
|
180
|
+
},
|
|
181
|
+
lightOptionTextColor: {
|
|
182
|
+
type: String,
|
|
183
|
+
default: "#000000"
|
|
184
|
+
},
|
|
185
|
+
lightOptionTextColorSelected: {
|
|
186
|
+
type: String,
|
|
187
|
+
default: "#000000"
|
|
188
|
+
},
|
|
189
|
+
lightOptionBgColorSelected: {
|
|
190
|
+
type: String,
|
|
191
|
+
default: "#e0e0e0"
|
|
192
|
+
},
|
|
193
|
+
lightPlaceholderColor: {
|
|
194
|
+
type: String,
|
|
195
|
+
default: "#999999"
|
|
196
|
+
},
|
|
197
|
+
// Cores do tema dark
|
|
198
|
+
darkBgColor: {
|
|
199
|
+
type: String,
|
|
200
|
+
default: "#353734"
|
|
201
|
+
},
|
|
202
|
+
darkBgColorFocus: {
|
|
203
|
+
type: String,
|
|
204
|
+
default: "#272936"
|
|
205
|
+
},
|
|
206
|
+
darkBorderColor: {
|
|
207
|
+
type: String,
|
|
208
|
+
default: "#44475a"
|
|
209
|
+
},
|
|
210
|
+
darkBorderColorFocus: {
|
|
211
|
+
type: String,
|
|
212
|
+
default: "rgba(68, 71, 90, 0.4)"
|
|
213
|
+
},
|
|
214
|
+
darkDisabledBgColor: {
|
|
215
|
+
type: String,
|
|
216
|
+
default: "rgba(40, 42, 54, 1)"
|
|
217
|
+
},
|
|
218
|
+
darkTextColor: {
|
|
219
|
+
type: String,
|
|
220
|
+
default: "#ffffff"
|
|
221
|
+
},
|
|
222
|
+
darkDisabledBorderColor: {
|
|
223
|
+
type: String,
|
|
224
|
+
default: "rgba(68, 71, 90, 0.3)"
|
|
225
|
+
},
|
|
226
|
+
darkOptionTextColor: {
|
|
227
|
+
type: String,
|
|
228
|
+
default: "#ffffff"
|
|
229
|
+
},
|
|
230
|
+
darkOptionTextColorSelected: {
|
|
231
|
+
type: String,
|
|
232
|
+
default: "#ffffff"
|
|
233
|
+
},
|
|
234
|
+
darkOptionBgColorSelected: {
|
|
235
|
+
type: String,
|
|
236
|
+
default: "#3d3d3d"
|
|
237
|
+
},
|
|
238
|
+
darkPlaceholderColor: {
|
|
239
|
+
type: String,
|
|
240
|
+
default: "#999999"
|
|
241
|
+
},
|
|
242
|
+
tabindex: {
|
|
243
|
+
type: [String, Number],
|
|
244
|
+
default: 0
|
|
245
|
+
},
|
|
246
|
+
tabIndex: {
|
|
247
|
+
type: Number,
|
|
248
|
+
default: 0
|
|
249
|
+
},
|
|
250
|
+
hasTabIndexEnter: {
|
|
251
|
+
type: Boolean,
|
|
252
|
+
default: !0
|
|
253
|
+
},
|
|
254
|
+
hasTabIndexSpace: {
|
|
255
|
+
type: Boolean,
|
|
256
|
+
default: !0
|
|
257
|
+
},
|
|
258
|
+
ariaLabel: {
|
|
259
|
+
type: String,
|
|
260
|
+
default: "Select"
|
|
261
|
+
},
|
|
262
|
+
ariaAttrs: {
|
|
263
|
+
type: Object,
|
|
264
|
+
default: () => ({})
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
emits: ["clicked", "changed", "user-changed"],
|
|
268
|
+
setup(e, { emit: S }) {
|
|
269
|
+
Ue((a) => ({
|
|
270
|
+
v65344439: Ye.value,
|
|
271
|
+
v710765ac: t(E),
|
|
272
|
+
v7ca0dd96: t(Be),
|
|
273
|
+
cae33bdc: t(ue),
|
|
274
|
+
v675d52d0: t(_e),
|
|
275
|
+
v6299e2f0: t(Te),
|
|
276
|
+
v9c37df88: t(Ve),
|
|
277
|
+
v2be47de6: t($),
|
|
278
|
+
v03aa8eea: t(he),
|
|
279
|
+
v6fff1a94: t(i),
|
|
280
|
+
f8a7447e: t(z),
|
|
281
|
+
f6930ac4: t(we),
|
|
282
|
+
f324ebb8: t($e),
|
|
283
|
+
v0677637c: t(U),
|
|
284
|
+
v2f80d530: t(De),
|
|
285
|
+
v3df1dcda: t(He),
|
|
286
|
+
v2388a9d2: t(Oe),
|
|
287
|
+
v39084b0d: t(Ce),
|
|
288
|
+
v92b5dffe: t(me),
|
|
289
|
+
cf5f9c6c: a.styleButtonColor,
|
|
290
|
+
v7c1e3a22: Me.value,
|
|
291
|
+
v45dc07f6: t(de),
|
|
292
|
+
v5caacc6f: t(v),
|
|
293
|
+
v07d8d482: t(h),
|
|
294
|
+
v031672fb: t(O)
|
|
295
|
+
})), Ge(() => {
|
|
296
|
+
ee.value ? A.value = q.value || [] : f.value = M.value, document.addEventListener("click", ut), document.addEventListener("nbselect:close-all", st), Ne.value = !0;
|
|
297
|
+
}), _t(() => {
|
|
298
|
+
document.removeEventListener("click", ut), document.removeEventListener("nbselect:close-all", st);
|
|
299
|
+
});
|
|
300
|
+
const y = S, ae = e, {
|
|
301
|
+
display: V,
|
|
302
|
+
textColor: Q,
|
|
303
|
+
theme: ge,
|
|
304
|
+
hasBorderRadius: ie,
|
|
305
|
+
borderRadius: be,
|
|
306
|
+
disabled: u,
|
|
307
|
+
fontFamily: C,
|
|
308
|
+
fontSize: fe,
|
|
309
|
+
fontWeight: oe,
|
|
310
|
+
textAlign: ne,
|
|
311
|
+
selectWidth: ve,
|
|
312
|
+
inputStyle: Z,
|
|
313
|
+
selectName: ye,
|
|
314
|
+
required: re,
|
|
315
|
+
options: k,
|
|
316
|
+
selectedOptionOnly: M,
|
|
317
|
+
selectedOptionMultiple: q,
|
|
318
|
+
textKey: w,
|
|
319
|
+
valueKey: c,
|
|
320
|
+
multiple: ee,
|
|
321
|
+
hasEmptyOption: N,
|
|
322
|
+
emptyOptionValue: B,
|
|
323
|
+
dropdownScrollClass: H,
|
|
324
|
+
hasLabel: x,
|
|
325
|
+
labelText: K,
|
|
326
|
+
emptyOptionText: F,
|
|
327
|
+
lightBgColor: ue,
|
|
328
|
+
lightBgColorFocus: $,
|
|
329
|
+
lightBorderColor: he,
|
|
330
|
+
lightBorderColorFocus: Ce,
|
|
331
|
+
lightDisabledBgColor: de,
|
|
332
|
+
lightTextColor: E,
|
|
333
|
+
lightDisabledBorderColor: v,
|
|
334
|
+
lightOptionTextColor: Be,
|
|
335
|
+
lightOptionTextColorSelected: Te,
|
|
336
|
+
lightOptionBgColorSelected: _e,
|
|
337
|
+
lightPlaceholderColor: Ve,
|
|
338
|
+
darkBgColor: we,
|
|
339
|
+
darkBgColorFocus: He,
|
|
340
|
+
darkBorderColor: Oe,
|
|
341
|
+
darkBorderColorFocus: me,
|
|
342
|
+
darkDisabledBgColor: h,
|
|
343
|
+
darkTextColor: i,
|
|
344
|
+
darkDisabledBorderColor: O,
|
|
345
|
+
darkOptionTextColor: z,
|
|
346
|
+
darkOptionTextColorSelected: U,
|
|
347
|
+
darkOptionBgColorSelected: $e,
|
|
348
|
+
darkPlaceholderColor: De,
|
|
349
|
+
tabindex: Se,
|
|
350
|
+
tabIndex: ce,
|
|
351
|
+
hasTabIndexEnter: G,
|
|
352
|
+
hasTabIndexSpace: se,
|
|
353
|
+
ariaLabel: l,
|
|
354
|
+
ariaAttrs: p
|
|
355
|
+
} = Je(ae), f = J(null), A = J([]), Ne = J(!1), b = J(!1), g = J(!1), Ee = J(null), Ie = J(!1), W = J(null), X = J(null), L = J(-1), P = J(-1), te = o({
|
|
356
|
+
get: () => Array.isArray(A.value) ? A.value : [],
|
|
357
|
+
set: (a) => {
|
|
358
|
+
A.value = Array.isArray(a) ? a : [];
|
|
359
|
+
}
|
|
360
|
+
}), xe = o(() => {
|
|
361
|
+
const a = u.value ? "component-disabled" : "", n = V.value !== "b" ? "inline-block" : "block", r = Q.value ? Q.value : "#ffffff", s = C.value ? C.value : "'Lato', sans-serif", d = fe.value ? fe.value : "1.6rem", j = !oe.value || oe.value < 0 ? 100 : oe.value, Ot = ve.value ? ve.value : 200, St = !be.value || be.value < 0 ? 0 : be.value, kt = ie.value ? ie.value : !1, Bt = !ne.value || !["center", "left", "right"].includes(ne.value) ? "left" : ne.value, Tt = !Z.value || !["background", "line", "border"].includes(Z.value) ? "background" : Z.value;
|
|
362
|
+
return {
|
|
363
|
+
disabled: a,
|
|
364
|
+
display: n,
|
|
365
|
+
font: s,
|
|
366
|
+
fontSize: d,
|
|
367
|
+
fontWeight: j,
|
|
368
|
+
textColor: r,
|
|
369
|
+
selectWidth: Ot,
|
|
370
|
+
borderRadius: St,
|
|
371
|
+
hasBorderRadius: kt,
|
|
372
|
+
textAlign: Bt,
|
|
373
|
+
inputStyle: Tt
|
|
374
|
+
};
|
|
375
|
+
}), Fe = o(() => xe.value.disabled), je = o(() => ({
|
|
376
|
+
display: xe.value.display
|
|
377
|
+
})), Xe = o(() => {
|
|
378
|
+
const a = xe.value;
|
|
379
|
+
return {
|
|
380
|
+
color: a.textColor,
|
|
381
|
+
fontSize: a.fontSize,
|
|
382
|
+
fontWeight: a.fontWeight,
|
|
383
|
+
textAlign: a.textAlign
|
|
384
|
+
};
|
|
385
|
+
}), Ye = o(() => xe.value.font), Me = o(() => xe.value.textColor), We = o(() => {
|
|
386
|
+
const a = xe.value;
|
|
387
|
+
return a.display === "block" ? { width: "100%" } : {
|
|
388
|
+
width: `${a.selectWidth}px`
|
|
389
|
+
};
|
|
390
|
+
}), ze = o(() => {
|
|
391
|
+
const a = xe.value;
|
|
392
|
+
return a.inputStyle !== "line" && a.hasBorderRadius ? { borderRadius: `${a.borderRadius}rem` } : {};
|
|
393
|
+
}), qe = o(() => {
|
|
394
|
+
switch (ge.value) {
|
|
395
|
+
case "dark":
|
|
396
|
+
return "component__theme--dark";
|
|
397
|
+
default:
|
|
398
|
+
return "component__theme--light";
|
|
399
|
+
}
|
|
400
|
+
}), Pe = o(() => {
|
|
401
|
+
switch (Z.value) {
|
|
402
|
+
case "line":
|
|
403
|
+
return "component__input--line";
|
|
404
|
+
case "border":
|
|
405
|
+
return "component__input--border";
|
|
406
|
+
default:
|
|
407
|
+
return "component__input--background";
|
|
408
|
+
}
|
|
409
|
+
}), Ae = (a) => {
|
|
410
|
+
const n = k.value.map((d, j) => ({
|
|
411
|
+
value: d[c.value],
|
|
412
|
+
disabled: d.disabled || u.value,
|
|
413
|
+
index: j
|
|
414
|
+
}));
|
|
415
|
+
if (n.filter((d) => !d.disabled).length === 0)
|
|
416
|
+
return;
|
|
417
|
+
let s = P.value;
|
|
418
|
+
if (s < 0 && k.value.length > 0 && (s = 0), a === "down") {
|
|
419
|
+
let d = (s + 1) % n.length, j = 0;
|
|
420
|
+
for (; n[d].disabled && j < n.length; )
|
|
421
|
+
d = (d + 1) % n.length, j++;
|
|
422
|
+
n[d].disabled || (s = d);
|
|
423
|
+
} else if (a === "up") {
|
|
424
|
+
let d = s <= 0 ? n.length - 1 : s - 1, j = 0;
|
|
425
|
+
for (; n[d].disabled && j < n.length; )
|
|
426
|
+
d = d <= 0 ? n.length - 1 : d - 1, j++;
|
|
427
|
+
n[d].disabled || (s = d);
|
|
428
|
+
}
|
|
429
|
+
P.value = s, Y(() => {
|
|
430
|
+
const d = document.querySelector(`[data-option-index-multiple="${s}"]`);
|
|
431
|
+
d && d.focus();
|
|
432
|
+
});
|
|
433
|
+
}, et = (a) => {
|
|
434
|
+
if (!u.value) {
|
|
435
|
+
a.stopPropagation();
|
|
436
|
+
const n = b.value;
|
|
437
|
+
b.value = !b.value, !n && b.value ? (dt(), k.value.length > 0 && (P.value = 0, Y(() => {
|
|
438
|
+
const r = document.querySelector(`[data-option-index-multiple="${P.value}"]`);
|
|
439
|
+
r && r.focus();
|
|
440
|
+
}))) : b.value || (P.value = -1);
|
|
441
|
+
}
|
|
442
|
+
}, ut = (a) => {
|
|
443
|
+
a.target.closest(".component__dropdown") || (b.value = !1, g.value = !1);
|
|
444
|
+
}, gt = (a) => {
|
|
445
|
+
var n;
|
|
446
|
+
(b.value || g.value) && !((n = Ee.value) != null && n.contains(a.relatedTarget)) && setTimeout(() => {
|
|
447
|
+
var r;
|
|
448
|
+
Ie.value || (r = Ee.value) != null && r.contains(document.activeElement) || (b.value && (b.value = !1, P.value = -1, Y(() => {
|
|
449
|
+
X.value && X.value.focus();
|
|
450
|
+
})), g.value && (g.value = !1, L.value = -1, Y(() => {
|
|
451
|
+
W.value && W.value.focus();
|
|
452
|
+
})));
|
|
453
|
+
}, 100);
|
|
454
|
+
}, dt = () => {
|
|
455
|
+
document.dispatchEvent(new CustomEvent("nbselect:close-all", {
|
|
456
|
+
detail: { excludeId: ae.nbId }
|
|
457
|
+
}));
|
|
458
|
+
}, st = (a) => {
|
|
459
|
+
var n;
|
|
460
|
+
((n = a.detail) == null ? void 0 : n.excludeId) !== ae.nbId && (b.value && (b.value = !1), g.value && (g.value = !1));
|
|
461
|
+
}, Le = (a) => {
|
|
462
|
+
const n = [];
|
|
463
|
+
if (N.value && n.push({ value: B.value, disabled: u.value, index: 0 }), n.push(...k.value.map((d, j) => ({
|
|
464
|
+
value: d[c.value],
|
|
465
|
+
disabled: d.disabled || u.value,
|
|
466
|
+
index: N.value ? j + 1 : j
|
|
467
|
+
}))), n.filter((d) => !d.disabled).length === 0)
|
|
468
|
+
return;
|
|
469
|
+
let s = L.value;
|
|
470
|
+
if (s < 0 && (s = N.value || k.value.length > 0 ? 0 : -1), a === "down") {
|
|
471
|
+
let d = (s + 1) % n.length, j = 0;
|
|
472
|
+
for (; n[d].disabled && j < n.length; )
|
|
473
|
+
d = (d + 1) % n.length, j++;
|
|
474
|
+
n[d].disabled || (s = d);
|
|
475
|
+
} else if (a === "up") {
|
|
476
|
+
let d = s <= 0 ? n.length - 1 : s - 1, j = 0;
|
|
477
|
+
for (; n[d].disabled && j < n.length; )
|
|
478
|
+
d = d <= 0 ? n.length - 1 : d - 1, j++;
|
|
479
|
+
n[d].disabled || (s = d);
|
|
480
|
+
}
|
|
481
|
+
L.value = s, Y(() => {
|
|
482
|
+
const d = document.querySelector(`[data-option-index-single="${s}"]`);
|
|
483
|
+
d && d.focus();
|
|
484
|
+
});
|
|
485
|
+
}, it = () => {
|
|
486
|
+
!u.value && g.value && (g.value = !1, L.value = -1, Y(() => {
|
|
487
|
+
W.value && W.value.focus();
|
|
488
|
+
}));
|
|
489
|
+
}, bt = () => {
|
|
490
|
+
!u.value && b.value && (b.value = !1, P.value = -1, Y(() => {
|
|
491
|
+
X.value && X.value.focus();
|
|
492
|
+
}));
|
|
493
|
+
}, tt = (a) => {
|
|
494
|
+
if (!u.value) {
|
|
495
|
+
a.stopPropagation();
|
|
496
|
+
const n = g.value;
|
|
497
|
+
g.value = !g.value, !n && g.value ? (dt(), L.value = N.value ? 0 : -1, !N.value && k.value.length > 0 && (L.value = 0), Y(() => {
|
|
498
|
+
const r = document.querySelector(`[data-option-index-single="${L.value}"]`);
|
|
499
|
+
r && r.focus();
|
|
500
|
+
})) : g.value || (L.value = -1);
|
|
501
|
+
}
|
|
502
|
+
}, Ke = (a) => {
|
|
503
|
+
u.value || (Ie.value = !0, f.value = a, g.value = !1, L.value = -1, ft(a), setTimeout(() => {
|
|
504
|
+
Ie.value = !1, Y(() => {
|
|
505
|
+
W.value && W.value.focus();
|
|
506
|
+
});
|
|
507
|
+
}, 150));
|
|
508
|
+
}, yt = () => {
|
|
509
|
+
if (!f.value || f.value === B.value)
|
|
510
|
+
return F.value;
|
|
511
|
+
const a = k.value.find(
|
|
512
|
+
(n) => n[c.value] === f.value
|
|
513
|
+
);
|
|
514
|
+
return a ? a[w.value] : F.value;
|
|
515
|
+
}, ht = () => {
|
|
516
|
+
const a = k.value.filter(
|
|
517
|
+
(n) => te.value.includes(n[c.value])
|
|
518
|
+
);
|
|
519
|
+
return a.length === 0 ? F.value : a.length === 1 ? a[0][w.value] : `${a.length} itens selecionados`;
|
|
520
|
+
}, ot = (a) => {
|
|
521
|
+
if (u.value)
|
|
522
|
+
return;
|
|
523
|
+
Ie.value = !0;
|
|
524
|
+
const n = [...te.value];
|
|
525
|
+
if (n.includes(a)) {
|
|
526
|
+
const r = n.filter((s) => s !== a);
|
|
527
|
+
te.value = r;
|
|
528
|
+
} else
|
|
529
|
+
te.value = [...n, a];
|
|
530
|
+
ft(te.value), setTimeout(() => {
|
|
531
|
+
Ie.value = !1;
|
|
532
|
+
}, 150);
|
|
533
|
+
}, ft = (a) => {
|
|
534
|
+
y("user-changed", a);
|
|
535
|
+
}, Ct = o(() => {
|
|
536
|
+
const a = {};
|
|
537
|
+
p.value && Object.keys(p.value).forEach((s) => a[`aria-${s}`] = p.value[s]);
|
|
538
|
+
const n = {
|
|
539
|
+
"aria-label": l.value,
|
|
540
|
+
"aria-disabled": u.value,
|
|
541
|
+
...a
|
|
542
|
+
};
|
|
543
|
+
return Object.fromEntries(
|
|
544
|
+
Object.entries(n).filter(([r, s]) => s != null)
|
|
545
|
+
);
|
|
546
|
+
}), mt = (a) => {
|
|
547
|
+
if (!u.value) {
|
|
548
|
+
if (g.value)
|
|
549
|
+
switch (a.key) {
|
|
550
|
+
case "ArrowDown":
|
|
551
|
+
a.preventDefault(), Le("down");
|
|
552
|
+
return;
|
|
553
|
+
case "ArrowUp":
|
|
554
|
+
a.preventDefault(), Le("up");
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
switch (a.key) {
|
|
558
|
+
case "Enter":
|
|
559
|
+
G.value && (a.preventDefault(), g.value ? (g.value = !1, L.value = -1, Y(() => {
|
|
560
|
+
W.value && W.value.focus();
|
|
561
|
+
})) : tt(a));
|
|
562
|
+
break;
|
|
563
|
+
case " ":
|
|
564
|
+
se.value && (a.preventDefault(), g.value ? (g.value = !1, L.value = -1, Y(() => {
|
|
565
|
+
W.value && W.value.focus();
|
|
566
|
+
})) : tt(a));
|
|
567
|
+
break;
|
|
568
|
+
case "Escape":
|
|
569
|
+
g.value && (a.preventDefault(), g.value = !1, L.value = -1, Y(() => {
|
|
570
|
+
W.value && W.value.focus();
|
|
571
|
+
}));
|
|
572
|
+
break;
|
|
573
|
+
case "ArrowDown":
|
|
574
|
+
a.preventDefault(), g.value || tt(a);
|
|
575
|
+
break;
|
|
576
|
+
case "ArrowUp":
|
|
577
|
+
a.preventDefault(), g.value && (g.value = !1, L.value = -1, Y(() => {
|
|
578
|
+
W.value && W.value.focus();
|
|
579
|
+
}));
|
|
580
|
+
break;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}, xt = (a) => {
|
|
584
|
+
if (!u.value) {
|
|
585
|
+
if (b.value)
|
|
586
|
+
switch (a.key) {
|
|
587
|
+
case "ArrowDown":
|
|
588
|
+
a.preventDefault(), Ae("down");
|
|
589
|
+
return;
|
|
590
|
+
case "ArrowUp":
|
|
591
|
+
a.preventDefault(), Ae("up");
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
switch (a.key) {
|
|
595
|
+
case "Enter":
|
|
596
|
+
G.value && (a.preventDefault(), b.value ? (b.value = !1, P.value = -1, Y(() => {
|
|
597
|
+
X.value && X.value.focus();
|
|
598
|
+
})) : et(a));
|
|
599
|
+
break;
|
|
600
|
+
case " ":
|
|
601
|
+
se.value && (a.preventDefault(), b.value ? (b.value = !1, P.value = -1, Y(() => {
|
|
602
|
+
X.value && X.value.focus();
|
|
603
|
+
})) : et(a));
|
|
604
|
+
break;
|
|
605
|
+
case "Escape":
|
|
606
|
+
b.value && (a.preventDefault(), b.value = !1, P.value = -1, Y(() => {
|
|
607
|
+
X.value && X.value.focus();
|
|
608
|
+
}));
|
|
609
|
+
break;
|
|
610
|
+
case "ArrowDown":
|
|
611
|
+
a.preventDefault(), b.value || et(a);
|
|
612
|
+
break;
|
|
613
|
+
case "ArrowUp":
|
|
614
|
+
a.preventDefault(), b.value && (b.value = !1, P.value = -1, Y(() => {
|
|
615
|
+
X.value && X.value.focus();
|
|
616
|
+
}));
|
|
617
|
+
break;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
};
|
|
621
|
+
return pe(f, (a, n) => {
|
|
622
|
+
Ne.value && a !== n && y("changed", a);
|
|
623
|
+
}), pe(M, (a, n) => {
|
|
624
|
+
a !== n && (f.value = a);
|
|
625
|
+
}), pe(A, (a, n) => {
|
|
626
|
+
Ne.value && a !== n && y("changed", a);
|
|
627
|
+
}), pe(q, (a, n) => {
|
|
628
|
+
a !== n && (A.value = a || []);
|
|
629
|
+
}), (a, n) => e.nbId ? (T(), _("div", {
|
|
630
|
+
key: 0,
|
|
631
|
+
ref_key: "wrapperRef",
|
|
632
|
+
ref: Ee,
|
|
633
|
+
class: R(["nb-wrapper", Fe.value]),
|
|
634
|
+
style: Re([je.value, We.value]),
|
|
635
|
+
onFocusout: gt
|
|
636
|
+
}, [
|
|
637
|
+
I("div", Qe({
|
|
638
|
+
id: e.nbId,
|
|
639
|
+
ref: e.nbId,
|
|
640
|
+
class: ["nb-reset", "component", qe.value, Pe.value],
|
|
641
|
+
style: [Xe.value, We.value, ze.value]
|
|
642
|
+
}, Ct.value), [
|
|
643
|
+
t(x) ? (T(), _("label", {
|
|
644
|
+
key: 0,
|
|
645
|
+
for: t(ye),
|
|
646
|
+
class: "component__label"
|
|
647
|
+
}, [
|
|
648
|
+
nt(le(t(K)), 1),
|
|
649
|
+
t(re) ? (T(), _("span", Ht, "*")) : ke("", !0)
|
|
650
|
+
], 8, wt)) : ke("", !0),
|
|
651
|
+
t(ee) ? (T(), _("div", {
|
|
652
|
+
key: 2,
|
|
653
|
+
class: R(["component__dropdown", { open: b.value, disabled: t(u) }])
|
|
654
|
+
}, [
|
|
655
|
+
I("div", {
|
|
656
|
+
ref_key: "dropdownFieldMultipleRef",
|
|
657
|
+
ref: X,
|
|
658
|
+
class: R(["component__dropdown-field", { "has-selection": te.value.length > 0 }]),
|
|
659
|
+
style: Re([ze.value]),
|
|
660
|
+
tabindex: t(u) ? -1 : t(ce) >= 0 ? t(ce) : t(Se),
|
|
661
|
+
onClick: et,
|
|
662
|
+
onKeydown: xt
|
|
663
|
+
}, [
|
|
664
|
+
te.value.length === 0 ? (T(), _("span", Wt, le(t(F)), 1)) : (T(), _("span", Lt, le(ht()), 1)),
|
|
665
|
+
I("span", {
|
|
666
|
+
class: R(["component__dropdown-arrow", { open: b.value }])
|
|
667
|
+
}, "▼", 2)
|
|
668
|
+
], 46, Rt),
|
|
669
|
+
b.value ? (T(), _("div", {
|
|
670
|
+
key: 0,
|
|
671
|
+
class: R(["component__checkbox-group", t(H)]),
|
|
672
|
+
role: "listbox"
|
|
673
|
+
}, [
|
|
674
|
+
(T(!0), _(vt, null, ct(t(k), (r, s) => (T(), _("label", {
|
|
675
|
+
key: s,
|
|
676
|
+
"data-option-index-multiple": s,
|
|
677
|
+
class: R(["component__checkbox-option", {
|
|
678
|
+
disabled: r.disabled || t(u),
|
|
679
|
+
selected: te.value.includes(r[t(c)])
|
|
680
|
+
}]),
|
|
681
|
+
tabindex: r.disabled || t(u) ? -1 : P.value === s ? 0 : -1,
|
|
682
|
+
role: "option",
|
|
683
|
+
"aria-selected": te.value.includes(r[t(c)]),
|
|
684
|
+
onClick: m((d) => !r.disabled && !t(u) && ot(r[t(c)]), ["prevent"]),
|
|
685
|
+
onKeydown: [
|
|
686
|
+
D(m((d) => !r.disabled && !t(u) && t(G) && ot(r[t(c)]), ["prevent"]), ["enter"]),
|
|
687
|
+
D(m((d) => !r.disabled && !t(u) && t(se) && ot(r[t(c)]), ["prevent"]), ["space"]),
|
|
688
|
+
D(m((d) => !r.disabled && !t(u) && Ae("down"), ["prevent"]), ["arrow-down"]),
|
|
689
|
+
D(m((d) => !r.disabled && !t(u) && Ae("up"), ["prevent"]), ["arrow-up"]),
|
|
690
|
+
D(m((d) => !r.disabled && !t(u) && bt(), ["prevent"]), ["escape"])
|
|
691
|
+
]
|
|
692
|
+
}, [
|
|
693
|
+
I("input", {
|
|
694
|
+
type: "checkbox",
|
|
695
|
+
value: r[t(c)],
|
|
696
|
+
checked: te.value.includes(r[t(c)]),
|
|
697
|
+
disabled: r.disabled || t(u),
|
|
698
|
+
onClick: n[6] || (n[6] = m(() => {
|
|
699
|
+
}, ["stop"]))
|
|
700
|
+
}, null, 8, Ft),
|
|
701
|
+
I("span", jt, [
|
|
702
|
+
pt(a.$slots, "slot-select-item", {
|
|
703
|
+
propRow: r,
|
|
704
|
+
propIndex: s
|
|
705
|
+
}, () => [
|
|
706
|
+
nt(le(r[t(w)]), 1)
|
|
707
|
+
], !0)
|
|
708
|
+
])
|
|
709
|
+
], 42, Kt))), 128))
|
|
710
|
+
], 2)) : ke("", !0)
|
|
711
|
+
], 2)) : (T(), _("div", {
|
|
712
|
+
key: 1,
|
|
713
|
+
class: R(["component__dropdown", { open: g.value, disabled: t(u) }])
|
|
714
|
+
}, [
|
|
715
|
+
I("div", {
|
|
716
|
+
ref_key: "dropdownFieldSingleRef",
|
|
717
|
+
ref: W,
|
|
718
|
+
class: R(["component__dropdown-field", { "has-selection": f.value !== null && f.value !== t(B) }]),
|
|
719
|
+
style: Re([ze.value]),
|
|
720
|
+
tabindex: t(u) ? -1 : t(ce) >= 0 ? t(ce) : t(Se),
|
|
721
|
+
onClick: tt,
|
|
722
|
+
onKeydown: mt
|
|
723
|
+
}, [
|
|
724
|
+
!f.value || f.value === t(B) ? (T(), _("span", Dt, le(t(F)), 1)) : (T(), _("span", It, le(yt()), 1)),
|
|
725
|
+
I("span", {
|
|
726
|
+
class: R(["component__dropdown-arrow", { open: g.value }])
|
|
727
|
+
}, "▼", 2)
|
|
728
|
+
], 46, $t),
|
|
729
|
+
g.value ? (T(), _("div", {
|
|
730
|
+
key: 0,
|
|
731
|
+
class: R(["component__option-group", t(H)]),
|
|
732
|
+
role: "listbox"
|
|
733
|
+
}, [
|
|
734
|
+
t(N) ? (T(), _("div", {
|
|
735
|
+
key: 0,
|
|
736
|
+
"data-option-index-single": "0",
|
|
737
|
+
class: R(["component__option-item", {
|
|
738
|
+
disabled: t(u),
|
|
739
|
+
selected: !f.value || f.value === t(B)
|
|
740
|
+
}]),
|
|
741
|
+
tabindex: t(u) ? -1 : L.value === 0 ? 0 : -1,
|
|
742
|
+
role: "option",
|
|
743
|
+
"aria-selected": !f.value || f.value === t(B),
|
|
744
|
+
onClick: n[0] || (n[0] = m((r) => !t(u) && Ke(t(B)), ["prevent"])),
|
|
745
|
+
onKeydown: [
|
|
746
|
+
n[1] || (n[1] = D(m((r) => !t(u) && t(G) && Ke(t(B)), ["prevent"]), ["enter"])),
|
|
747
|
+
n[2] || (n[2] = D(m((r) => !t(u) && t(se) && Ke(t(B)), ["prevent"]), ["space"])),
|
|
748
|
+
n[3] || (n[3] = D(m((r) => !t(u) && Le("down"), ["prevent"]), ["arrow-down"])),
|
|
749
|
+
n[4] || (n[4] = D(m((r) => !t(u) && Le("up"), ["prevent"]), ["arrow-up"])),
|
|
750
|
+
n[5] || (n[5] = D(m((r) => !t(u) && it(), ["prevent"]), ["escape"]))
|
|
751
|
+
]
|
|
752
|
+
}, [
|
|
753
|
+
I("span", Nt, le(t(F)), 1)
|
|
754
|
+
], 42, At)) : ke("", !0),
|
|
755
|
+
(T(!0), _(vt, null, ct(t(k), (r, s) => (T(), _("div", {
|
|
756
|
+
key: s,
|
|
757
|
+
"data-option-index-single": t(N) ? s + 1 : s,
|
|
758
|
+
class: R(["component__option-item", {
|
|
759
|
+
disabled: r.disabled || t(u),
|
|
760
|
+
selected: f.value === r[t(c)]
|
|
761
|
+
}]),
|
|
762
|
+
tabindex: r.disabled || t(u) ? -1 : L.value === (t(N) ? s + 1 : s) ? 0 : -1,
|
|
763
|
+
role: "option",
|
|
764
|
+
"aria-selected": f.value === r[t(c)],
|
|
765
|
+
onClick: m((d) => !r.disabled && !t(u) && Ke(r[t(c)]), ["prevent"]),
|
|
766
|
+
onKeydown: [
|
|
767
|
+
D(m((d) => !r.disabled && !t(u) && t(G) && Ke(r[t(c)]), ["prevent"]), ["enter"]),
|
|
768
|
+
D(m((d) => !r.disabled && !t(u) && t(se) && Ke(r[t(c)]), ["prevent"]), ["space"]),
|
|
769
|
+
D(m((d) => !r.disabled && !t(u) && Le("down"), ["prevent"]), ["arrow-down"]),
|
|
770
|
+
D(m((d) => !r.disabled && !t(u) && Le("up"), ["prevent"]), ["arrow-up"]),
|
|
771
|
+
D(m((d) => !r.disabled && !t(u) && it(), ["prevent"]), ["escape"])
|
|
772
|
+
]
|
|
773
|
+
}, [
|
|
774
|
+
I("span", zt, [
|
|
775
|
+
pt(a.$slots, "slot-select-item", {
|
|
776
|
+
propRow: r,
|
|
777
|
+
propIndex: s
|
|
778
|
+
}, () => [
|
|
779
|
+
nt(le(r[t(w)]), 1)
|
|
780
|
+
], !0)
|
|
781
|
+
])
|
|
782
|
+
], 42, Et))), 128))
|
|
783
|
+
], 2)) : ke("", !0)
|
|
784
|
+
], 2))
|
|
785
|
+
], 16, Vt)
|
|
786
|
+
], 38)) : ke("", !0);
|
|
787
|
+
}
|
|
788
|
+
}), Yt = /* @__PURE__ */ Ze(Xt, [["__scopeId", "data-v-7feeaa38"]]);
|
|
789
|
+
const Mt = ["tabIndex"], qt = ["id"], Pt = ["id", "disabled"], Ut = ["for"], Gt = {
|
|
790
|
+
key: 0,
|
|
791
|
+
class: "component-label-text"
|
|
792
|
+
}, Jt = {
|
|
793
|
+
key: 1,
|
|
794
|
+
class: "component-label-text"
|
|
795
|
+
}, Qt = /* @__PURE__ */ Object.assign({
|
|
796
|
+
name: "NbToggleLight",
|
|
797
|
+
inheritAttrs: !1
|
|
798
|
+
}, {
|
|
799
|
+
__name: "NbToggleLight",
|
|
800
|
+
props: {
|
|
801
|
+
nbId: {
|
|
802
|
+
type: String,
|
|
803
|
+
required: !0
|
|
804
|
+
},
|
|
805
|
+
value: {
|
|
806
|
+
type: Boolean,
|
|
807
|
+
default: !1
|
|
808
|
+
},
|
|
809
|
+
tabIndex: {
|
|
810
|
+
type: Number,
|
|
811
|
+
default: 0
|
|
812
|
+
},
|
|
813
|
+
hasTabIndexEnter: {
|
|
814
|
+
type: Boolean,
|
|
815
|
+
default: !0
|
|
816
|
+
},
|
|
817
|
+
hasTabIndexSpace: {
|
|
818
|
+
type: Boolean,
|
|
819
|
+
default: !0
|
|
820
|
+
},
|
|
821
|
+
ariaLabel: {
|
|
822
|
+
type: String,
|
|
823
|
+
default: "Alternate Text Button"
|
|
824
|
+
},
|
|
825
|
+
ariaAttrs: {
|
|
826
|
+
type: Object,
|
|
827
|
+
default: () => ({})
|
|
828
|
+
},
|
|
829
|
+
theme: {
|
|
830
|
+
type: String,
|
|
831
|
+
default: "light",
|
|
832
|
+
validator: (e) => {
|
|
833
|
+
const S = e ? e.toLowerCase() : "";
|
|
834
|
+
return ["light", "dark"].includes(S);
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
// Cores do tema light
|
|
838
|
+
lightTextColor: {
|
|
839
|
+
type: String,
|
|
840
|
+
default: "#8e8e8e"
|
|
841
|
+
},
|
|
842
|
+
lightButtonColor: {
|
|
843
|
+
type: String,
|
|
844
|
+
default: "#eaeaea"
|
|
845
|
+
},
|
|
846
|
+
lightTextBgColor: {
|
|
847
|
+
type: String,
|
|
848
|
+
default: "#f8f8f2"
|
|
849
|
+
},
|
|
850
|
+
// Cores do tema dark
|
|
851
|
+
darkTextColor: {
|
|
852
|
+
type: String,
|
|
853
|
+
default: "#e0e0e0"
|
|
854
|
+
},
|
|
855
|
+
darkButtonColor: {
|
|
856
|
+
type: String,
|
|
857
|
+
default: "#2d2d2d"
|
|
858
|
+
},
|
|
859
|
+
darkTextBgColor: {
|
|
860
|
+
type: String,
|
|
861
|
+
default: "#3d3d3d"
|
|
862
|
+
},
|
|
863
|
+
borderRadius: {
|
|
864
|
+
type: Number,
|
|
865
|
+
default: 0
|
|
866
|
+
},
|
|
867
|
+
width: {
|
|
868
|
+
type: Number,
|
|
869
|
+
default: 55,
|
|
870
|
+
validator: (e) => e || 55
|
|
871
|
+
},
|
|
872
|
+
paddingX: {
|
|
873
|
+
type: Number,
|
|
874
|
+
default: 1,
|
|
875
|
+
validator: (e) => e || 1
|
|
876
|
+
},
|
|
877
|
+
paddingY: {
|
|
878
|
+
type: Number,
|
|
879
|
+
default: 0.2,
|
|
880
|
+
validator: (e) => e || 0.2
|
|
881
|
+
},
|
|
882
|
+
disabled: {
|
|
883
|
+
type: Boolean,
|
|
884
|
+
default: !1,
|
|
885
|
+
validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
|
|
886
|
+
},
|
|
887
|
+
fontFamily: {
|
|
888
|
+
type: String,
|
|
889
|
+
default: "'Lato', sans-serif"
|
|
890
|
+
},
|
|
891
|
+
fontSize: {
|
|
892
|
+
type: String,
|
|
893
|
+
default: "1.6em",
|
|
894
|
+
validator: (e) => e || "1.6em"
|
|
895
|
+
},
|
|
896
|
+
fontWeight: {
|
|
897
|
+
type: Number,
|
|
898
|
+
default: 200,
|
|
899
|
+
validator: (e) => e || 200
|
|
900
|
+
},
|
|
901
|
+
hasAnimation: {
|
|
902
|
+
type: Boolean,
|
|
903
|
+
default: !1,
|
|
904
|
+
validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
|
|
905
|
+
},
|
|
906
|
+
textEnable: {
|
|
907
|
+
type: String,
|
|
908
|
+
default: "On"
|
|
909
|
+
},
|
|
910
|
+
textDisable: {
|
|
911
|
+
type: String,
|
|
912
|
+
default: "Off"
|
|
913
|
+
},
|
|
914
|
+
buttonSize: {
|
|
915
|
+
type: Number,
|
|
916
|
+
default: 30
|
|
917
|
+
}
|
|
918
|
+
},
|
|
919
|
+
emits: ["clicked", "current-value"],
|
|
920
|
+
setup(e, { emit: S }) {
|
|
921
|
+
Ue((i) => ({
|
|
922
|
+
v3531e937: he.value,
|
|
923
|
+
v22553608: Ve.value,
|
|
924
|
+
v30d9bc4b: we.value,
|
|
925
|
+
v6310c7e9: de.value,
|
|
926
|
+
v710ac044: E.value,
|
|
927
|
+
c5a0b5b8: v.value,
|
|
928
|
+
v40a22417: Be.value,
|
|
929
|
+
v2fb5c8f2: Te.value,
|
|
930
|
+
v5bdaadd2: _e.value
|
|
931
|
+
}));
|
|
932
|
+
const y = S;
|
|
933
|
+
Ge(() => {
|
|
934
|
+
h();
|
|
935
|
+
});
|
|
936
|
+
const ae = e, {
|
|
937
|
+
nbId: V,
|
|
938
|
+
value: Q,
|
|
939
|
+
textEnable: ge,
|
|
940
|
+
textDisable: ie,
|
|
941
|
+
hasAnimation: be,
|
|
942
|
+
ariaLabel: u,
|
|
943
|
+
ariaAttrs: C,
|
|
944
|
+
theme: fe,
|
|
945
|
+
lightTextColor: oe,
|
|
946
|
+
lightButtonColor: ne,
|
|
947
|
+
lightTextBgColor: ve,
|
|
948
|
+
darkTextColor: Z,
|
|
949
|
+
darkButtonColor: ye,
|
|
950
|
+
darkTextBgColor: re,
|
|
951
|
+
borderRadius: k,
|
|
952
|
+
width: M,
|
|
953
|
+
paddingX: q,
|
|
954
|
+
paddingY: w,
|
|
955
|
+
disabled: c,
|
|
956
|
+
fontFamily: ee,
|
|
957
|
+
fontSize: N,
|
|
958
|
+
fontWeight: B,
|
|
959
|
+
buttonSize: H
|
|
960
|
+
} = Je(ae), x = J(!1), K = o(() => {
|
|
961
|
+
const i = c.value ? "component-disabled" : "", O = "inline-block", z = !k.value || k.value < 0 ? 0 : k.value, U = !M.value || M.value < 55 ? 55 : M.value, $e = !q.value || q.value < 0 ? 1 : q.value, De = !w.value || w.value < 0 ? 0.2 : w.value, Se = ee.value ? ee.value : "'Lato', sans-serif", ce = N.value ? N.value : "1.6em", G = !B.value || B.value < 0 ? 200 : B.value, se = !H.value || H.value < 0 || H.value > 50 ? 30 : H.value;
|
|
962
|
+
return {
|
|
963
|
+
disabled: i,
|
|
964
|
+
display: O,
|
|
965
|
+
borderRadius: z,
|
|
966
|
+
width: U,
|
|
967
|
+
paddingX: $e,
|
|
968
|
+
paddingY: De,
|
|
969
|
+
font: Se,
|
|
970
|
+
fontSize: ce,
|
|
971
|
+
fontWeight: G,
|
|
972
|
+
buttonSize: se
|
|
973
|
+
};
|
|
974
|
+
}), F = o(() => K.value.disabled), ue = o(() => ({
|
|
975
|
+
display: K.value.display
|
|
976
|
+
})), $ = o(() => {
|
|
977
|
+
const i = K.value;
|
|
978
|
+
return {
|
|
979
|
+
minWidth: "33px",
|
|
980
|
+
width: `${i.width}px`,
|
|
981
|
+
// padding: `${defaultValues.paddingY}rem ${defaultValues.paddingX}rem`,
|
|
982
|
+
lineHeight: "1.42857143",
|
|
983
|
+
fontSize: i.fontSize,
|
|
984
|
+
fontWeight: i.fontWeight
|
|
985
|
+
};
|
|
986
|
+
}), he = o(() => K.value.font), Ce = o(() => fe.value === "dark" ? "component__theme--dark" : "component__theme--light"), de = o(() => oe.value), E = o(() => ne.value), v = o(() => ve.value), Be = o(() => Z.value), Te = o(() => ye.value), _e = o(() => re.value), Ve = o(() => `${K.value.buttonSize}%`), we = o(() => `${K.value.borderRadius}rem`), He = o(() => {
|
|
987
|
+
const i = {};
|
|
988
|
+
C.value && Object.keys(C.value).forEach((U) => i[`aria-${U}`] = C.value[U]);
|
|
989
|
+
const O = {
|
|
990
|
+
"aria-label": u.value,
|
|
991
|
+
"aria-checked": x.value,
|
|
992
|
+
"aria-disabled": c.value,
|
|
993
|
+
...i
|
|
994
|
+
};
|
|
995
|
+
return Object.fromEntries(
|
|
996
|
+
Object.entries(O).filter(([z, U]) => U != null)
|
|
997
|
+
);
|
|
998
|
+
}), Oe = () => {
|
|
999
|
+
c.value || y("clicked");
|
|
1000
|
+
}, me = () => {
|
|
1001
|
+
c.value || (x.value = !x.value, y("clicked"));
|
|
1002
|
+
}, h = () => {
|
|
1003
|
+
const i = Q.value;
|
|
1004
|
+
x.value = i, y("current-value", i);
|
|
1005
|
+
};
|
|
1006
|
+
return pe(x, (i) => {
|
|
1007
|
+
y("current-value", i);
|
|
1008
|
+
}), pe(Q, () => {
|
|
1009
|
+
h();
|
|
1010
|
+
}), (i, O) => t(V) ? (T(), _("div", Qe({
|
|
1011
|
+
key: 0,
|
|
1012
|
+
class: ["nb-wrapper", F.value],
|
|
1013
|
+
style: [ue.value],
|
|
1014
|
+
tabIndex: t(c) ? -1 : e.tabIndex,
|
|
1015
|
+
role: "button"
|
|
1016
|
+
}, He.value, {
|
|
1017
|
+
onKeydown: [
|
|
1018
|
+
O[1] || (O[1] = D(m((z) => !t(c) && e.hasTabIndexEnter && me(), ["prevent"]), ["enter"])),
|
|
1019
|
+
O[2] || (O[2] = D(m((z) => !t(c) && e.hasTabIndexSpace && me(), ["prevent"]), ["space"]))
|
|
1020
|
+
]
|
|
1021
|
+
}), [
|
|
1022
|
+
I("div", {
|
|
1023
|
+
id: t(V),
|
|
1024
|
+
class: R(["nb-reset", "component", Ce.value]),
|
|
1025
|
+
style: Re([$.value])
|
|
1026
|
+
}, [
|
|
1027
|
+
lt(I("input", {
|
|
1028
|
+
id: `${t(V)}-input`,
|
|
1029
|
+
"onUpdate:modelValue": O[0] || (O[0] = (z) => x.value = z),
|
|
1030
|
+
type: "checkbox",
|
|
1031
|
+
disabled: t(c),
|
|
1032
|
+
class: "component-input",
|
|
1033
|
+
onChange: Oe
|
|
1034
|
+
}, null, 40, Pt), [
|
|
1035
|
+
[at, x.value]
|
|
1036
|
+
]),
|
|
1037
|
+
I("label", {
|
|
1038
|
+
for: `${t(V)}-input`,
|
|
1039
|
+
class: R(["component-label", [
|
|
1040
|
+
x.value ? "component-button--left" : "component-button--right",
|
|
1041
|
+
t(be) ? "component-label-text-animation" : ""
|
|
1042
|
+
]])
|
|
1043
|
+
}, [
|
|
1044
|
+
O[3] || (O[3] = I("div", { class: "component-label-button" }, null, -1)),
|
|
1045
|
+
x.value ? (T(), _("span", Gt, le(t(ge)), 1)) : (T(), _("span", Jt, le(t(ie)), 1))
|
|
1046
|
+
], 10, Ut)
|
|
1047
|
+
], 14, qt)
|
|
1048
|
+
], 16, Mt)) : ke("", !0);
|
|
1049
|
+
}
|
|
1050
|
+
}), Zt = /* @__PURE__ */ Ze(Qt, [["__scopeId", "data-v-e7c5d5fc"]]);
|
|
1051
|
+
const el = ["tabIndex"], tl = ["id"], ll = ["id", "disabled"], al = ["for"], ol = {
|
|
1052
|
+
key: 0,
|
|
1053
|
+
class: "component-label-text"
|
|
1054
|
+
}, nl = {
|
|
1055
|
+
key: 1,
|
|
1056
|
+
class: "component-label-text"
|
|
1057
|
+
}, rl = /* @__PURE__ */ Object.assign({
|
|
1058
|
+
name: "NbTest",
|
|
1059
|
+
inheritAttrs: !1
|
|
1060
|
+
}, {
|
|
1061
|
+
__name: "NbToggleSlim",
|
|
1062
|
+
props: {
|
|
1063
|
+
nbId: {
|
|
1064
|
+
type: String,
|
|
1065
|
+
required: !0
|
|
1066
|
+
},
|
|
1067
|
+
value: {
|
|
1068
|
+
type: Boolean,
|
|
1069
|
+
default: !1
|
|
1070
|
+
},
|
|
1071
|
+
tabIndex: {
|
|
1072
|
+
type: Number,
|
|
1073
|
+
default: 0
|
|
1074
|
+
},
|
|
1075
|
+
hasTabIndexEnter: {
|
|
1076
|
+
type: Boolean,
|
|
1077
|
+
default: !0
|
|
1078
|
+
},
|
|
1079
|
+
hasTabIndexSpace: {
|
|
1080
|
+
type: Boolean,
|
|
1081
|
+
default: !0
|
|
1082
|
+
},
|
|
1083
|
+
ariaLabel: {
|
|
1084
|
+
type: String,
|
|
1085
|
+
default: "Alternate Text Button"
|
|
1086
|
+
},
|
|
1087
|
+
ariaAttrs: {
|
|
1088
|
+
type: Object,
|
|
1089
|
+
default: () => ({})
|
|
1090
|
+
},
|
|
1091
|
+
theme: {
|
|
1092
|
+
type: String,
|
|
1093
|
+
default: "light",
|
|
1094
|
+
validator: (e) => {
|
|
1095
|
+
const S = e ? e.toLowerCase() : "";
|
|
1096
|
+
return ["light", "dark"].includes(S);
|
|
1097
|
+
}
|
|
1098
|
+
},
|
|
1099
|
+
// Cores do tema light
|
|
1100
|
+
lightTextColor: {
|
|
1101
|
+
type: String,
|
|
1102
|
+
default: "#8e8e8e"
|
|
1103
|
+
},
|
|
1104
|
+
lightButtonColor: {
|
|
1105
|
+
type: String,
|
|
1106
|
+
default: "#eaeaea"
|
|
1107
|
+
},
|
|
1108
|
+
lightTextBgColor: {
|
|
1109
|
+
type: String,
|
|
1110
|
+
default: "#f8f8f2"
|
|
1111
|
+
},
|
|
1112
|
+
// Cores do tema dark
|
|
1113
|
+
darkTextColor: {
|
|
1114
|
+
type: String,
|
|
1115
|
+
default: "#e0e0e0"
|
|
1116
|
+
},
|
|
1117
|
+
darkButtonColor: {
|
|
1118
|
+
type: String,
|
|
1119
|
+
default: "#2d2d2d"
|
|
1120
|
+
},
|
|
1121
|
+
darkTextBgColor: {
|
|
1122
|
+
type: String,
|
|
1123
|
+
default: "#3d3d3d"
|
|
1124
|
+
},
|
|
1125
|
+
borderRadius: {
|
|
1126
|
+
type: Number,
|
|
1127
|
+
default: 0
|
|
1128
|
+
},
|
|
1129
|
+
width: {
|
|
1130
|
+
type: Number,
|
|
1131
|
+
default: 55,
|
|
1132
|
+
validator: (e) => e || 55
|
|
1133
|
+
},
|
|
1134
|
+
paddingX: {
|
|
1135
|
+
type: Number,
|
|
1136
|
+
default: 1,
|
|
1137
|
+
validator: (e) => e || 1
|
|
1138
|
+
},
|
|
1139
|
+
paddingY: {
|
|
1140
|
+
type: Number,
|
|
1141
|
+
default: 0.2,
|
|
1142
|
+
validator: (e) => e || 0.2
|
|
1143
|
+
},
|
|
1144
|
+
disabled: {
|
|
1145
|
+
type: Boolean,
|
|
1146
|
+
default: !1,
|
|
1147
|
+
validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
|
|
1148
|
+
},
|
|
1149
|
+
fontFamily: {
|
|
1150
|
+
type: String,
|
|
1151
|
+
default: "'Lato', sans-serif"
|
|
1152
|
+
},
|
|
1153
|
+
fontSize: {
|
|
1154
|
+
type: String,
|
|
1155
|
+
default: "1.6em",
|
|
1156
|
+
validator: (e) => e || "1.6em"
|
|
1157
|
+
},
|
|
1158
|
+
fontWeight: {
|
|
1159
|
+
type: Number,
|
|
1160
|
+
default: 200,
|
|
1161
|
+
validator: (e) => e || 200
|
|
1162
|
+
},
|
|
1163
|
+
textEnable: {
|
|
1164
|
+
type: String,
|
|
1165
|
+
default: "On"
|
|
1166
|
+
},
|
|
1167
|
+
textDisable: {
|
|
1168
|
+
type: String,
|
|
1169
|
+
default: "Off"
|
|
1170
|
+
},
|
|
1171
|
+
buttonSize: {
|
|
1172
|
+
type: Number,
|
|
1173
|
+
default: 30
|
|
1174
|
+
}
|
|
1175
|
+
},
|
|
1176
|
+
emits: ["clicked", "current-value"],
|
|
1177
|
+
setup(e, { emit: S }) {
|
|
1178
|
+
Ue((h) => ({
|
|
1179
|
+
v7d859b54: $.value,
|
|
1180
|
+
ae83a282: _e.value,
|
|
1181
|
+
v13b7214e: Ve.value,
|
|
1182
|
+
v0428f82c: Ce.value,
|
|
1183
|
+
v2cd7ebc7: de.value,
|
|
1184
|
+
v58fcd0a7: E.value,
|
|
1185
|
+
v8d1d4118: v.value,
|
|
1186
|
+
v9cb8bde2: Be.value,
|
|
1187
|
+
v446ef422: Te.value
|
|
1188
|
+
}));
|
|
1189
|
+
const y = S;
|
|
1190
|
+
Ge(() => {
|
|
1191
|
+
me();
|
|
1192
|
+
});
|
|
1193
|
+
const ae = e, {
|
|
1194
|
+
nbId: V,
|
|
1195
|
+
value: Q,
|
|
1196
|
+
textEnable: ge,
|
|
1197
|
+
textDisable: ie,
|
|
1198
|
+
ariaLabel: be,
|
|
1199
|
+
ariaAttrs: u,
|
|
1200
|
+
theme: C,
|
|
1201
|
+
lightTextColor: fe,
|
|
1202
|
+
lightButtonColor: oe,
|
|
1203
|
+
lightTextBgColor: ne,
|
|
1204
|
+
darkTextColor: ve,
|
|
1205
|
+
darkButtonColor: Z,
|
|
1206
|
+
darkTextBgColor: ye,
|
|
1207
|
+
borderRadius: re,
|
|
1208
|
+
width: k,
|
|
1209
|
+
paddingX: M,
|
|
1210
|
+
paddingY: q,
|
|
1211
|
+
disabled: w,
|
|
1212
|
+
fontFamily: c,
|
|
1213
|
+
fontSize: ee,
|
|
1214
|
+
fontWeight: N,
|
|
1215
|
+
buttonSize: B
|
|
1216
|
+
} = Je(ae), H = J(!1), x = o(() => {
|
|
1217
|
+
const h = w.value ? "component-disabled" : "", i = "inline-block", O = !re.value || re.value < 0 ? 0 : re.value, z = !k.value || k.value < 55 ? 55 : k.value, U = !M.value || M.value < 0 ? 1 : M.value, $e = !q.value || q.value < 0 ? 0.2 : q.value, De = c.value ? c.value : "'Lato', sans-serif", Se = ee.value ? ee.value : "1.6em", ce = !N.value || N.value < 0 ? 200 : N.value, G = !B.value || B.value < 0 || B.value > 50 ? 30 : B.value;
|
|
1218
|
+
return {
|
|
1219
|
+
disabled: h,
|
|
1220
|
+
display: i,
|
|
1221
|
+
borderRadius: O,
|
|
1222
|
+
width: z,
|
|
1223
|
+
paddingX: U,
|
|
1224
|
+
paddingY: $e,
|
|
1225
|
+
font: De,
|
|
1226
|
+
fontSize: Se,
|
|
1227
|
+
fontWeight: ce,
|
|
1228
|
+
buttonSize: G
|
|
1229
|
+
};
|
|
1230
|
+
}), K = o(() => x.value.disabled), F = o(() => ({
|
|
1231
|
+
display: x.value.display
|
|
1232
|
+
})), ue = o(() => {
|
|
1233
|
+
const h = x.value;
|
|
1234
|
+
return {
|
|
1235
|
+
minWidth: "33px",
|
|
1236
|
+
width: `${h.width}px`,
|
|
1237
|
+
// padding: `${defaultValues.paddingY}rem ${defaultValues.paddingX}rem`,
|
|
1238
|
+
lineHeight: "1.42857143",
|
|
1239
|
+
fontSize: h.fontSize,
|
|
1240
|
+
fontWeight: h.fontWeight
|
|
1241
|
+
};
|
|
1242
|
+
}), $ = o(() => x.value.font), he = o(() => C.value === "dark" ? "component__theme--dark" : "component__theme--light"), Ce = o(() => fe.value), de = o(() => oe.value), E = o(() => ne.value), v = o(() => ve.value), Be = o(() => Z.value), Te = o(() => ye.value), _e = o(() => `${x.value.buttonSize}%`), Ve = o(() => `${x.value.borderRadius}rem`), we = o(() => {
|
|
1243
|
+
const h = {};
|
|
1244
|
+
u.value && Object.keys(u.value).forEach((z) => h[`aria-${z}`] = u.value[z]);
|
|
1245
|
+
const i = {
|
|
1246
|
+
"aria-label": be.value,
|
|
1247
|
+
"aria-checked": H.value,
|
|
1248
|
+
"aria-disabled": w.value,
|
|
1249
|
+
...h
|
|
1250
|
+
};
|
|
1251
|
+
return Object.fromEntries(
|
|
1252
|
+
Object.entries(i).filter(([O, z]) => z != null)
|
|
1253
|
+
);
|
|
1254
|
+
}), He = () => {
|
|
1255
|
+
w.value || y("clicked");
|
|
1256
|
+
}, Oe = () => {
|
|
1257
|
+
w.value || (H.value = !H.value, y("clicked"));
|
|
1258
|
+
}, me = () => {
|
|
1259
|
+
const h = Q.value;
|
|
1260
|
+
H.value = h, y("current-value", h);
|
|
1261
|
+
};
|
|
1262
|
+
return pe(H, (h) => {
|
|
1263
|
+
y("current-value", h);
|
|
1264
|
+
}), pe(Q, () => {
|
|
1265
|
+
me();
|
|
1266
|
+
}), (h, i) => t(V) ? (T(), _("div", Qe({
|
|
1267
|
+
key: 0,
|
|
1268
|
+
class: ["nb-wrapper", K.value],
|
|
1269
|
+
style: [F.value],
|
|
1270
|
+
tabIndex: t(w) ? -1 : e.tabIndex,
|
|
1271
|
+
role: "button"
|
|
1272
|
+
}, we.value, {
|
|
1273
|
+
onKeydown: [
|
|
1274
|
+
i[1] || (i[1] = D(m((O) => !t(w) && e.hasTabIndexEnter && Oe(), ["prevent"]), ["enter"])),
|
|
1275
|
+
i[2] || (i[2] = D(m((O) => !t(w) && e.hasTabIndexSpace && Oe(), ["prevent"]), ["space"]))
|
|
1276
|
+
]
|
|
1277
|
+
}), [
|
|
1278
|
+
I("div", {
|
|
1279
|
+
id: t(V),
|
|
1280
|
+
class: R(["nb-reset", "component", he.value]),
|
|
1281
|
+
style: Re([ue.value])
|
|
1282
|
+
}, [
|
|
1283
|
+
lt(I("input", {
|
|
1284
|
+
id: `${t(V)}-input`,
|
|
1285
|
+
"onUpdate:modelValue": i[0] || (i[0] = (O) => H.value = O),
|
|
1286
|
+
type: "checkbox",
|
|
1287
|
+
disabled: t(w),
|
|
1288
|
+
class: "component-input",
|
|
1289
|
+
onChange: He
|
|
1290
|
+
}, null, 40, ll), [
|
|
1291
|
+
[at, H.value]
|
|
1292
|
+
]),
|
|
1293
|
+
I("label", {
|
|
1294
|
+
for: `${t(V)}-input`,
|
|
1295
|
+
class: R(["component-label", [
|
|
1296
|
+
H.value ? "component-button--left" : "component-button--right"
|
|
1297
|
+
]])
|
|
1298
|
+
}, [
|
|
1299
|
+
i[3] || (i[3] = I("div", { class: "component-label-button" }, null, -1)),
|
|
1300
|
+
H.value ? (T(), _("span", ol, le(t(ge)), 1)) : (T(), _("span", nl, le(t(ie)), 1))
|
|
1301
|
+
], 10, al)
|
|
1302
|
+
], 14, tl)
|
|
1303
|
+
], 16, el)) : ke("", !0);
|
|
1304
|
+
}
|
|
1305
|
+
}), ul = /* @__PURE__ */ Ze(rl, [["__scopeId", "data-v-d3eeac20"]]);
|
|
1306
|
+
const dl = ["tabIndex"], sl = ["id"], il = ["id", "disabled"], fl = ["for", "data-tg-off", "data-tg-on"], vl = /* @__PURE__ */ Object.assign({
|
|
1307
|
+
name: "NbToggleFlip",
|
|
1308
|
+
inheritAttrs: !1
|
|
1309
|
+
}, {
|
|
1310
|
+
__name: "NbToggleFlip",
|
|
1311
|
+
props: {
|
|
1312
|
+
nbId: {
|
|
1313
|
+
type: String,
|
|
1314
|
+
required: !0
|
|
1315
|
+
},
|
|
1316
|
+
value: {
|
|
1317
|
+
type: Boolean,
|
|
1318
|
+
default: !1
|
|
1319
|
+
},
|
|
1320
|
+
tabIndex: {
|
|
1321
|
+
type: Number,
|
|
1322
|
+
default: 0
|
|
1323
|
+
},
|
|
1324
|
+
hasTabIndexEnter: {
|
|
1325
|
+
type: Boolean,
|
|
1326
|
+
default: !0
|
|
1327
|
+
},
|
|
1328
|
+
hasTabIndexSpace: {
|
|
1329
|
+
type: Boolean,
|
|
1330
|
+
default: !0
|
|
1331
|
+
},
|
|
1332
|
+
ariaLabel: {
|
|
1333
|
+
type: String,
|
|
1334
|
+
default: "Alternate Text Button"
|
|
1335
|
+
},
|
|
1336
|
+
ariaAttrs: {
|
|
1337
|
+
type: Object,
|
|
1338
|
+
default: () => ({})
|
|
1339
|
+
},
|
|
1340
|
+
theme: {
|
|
1341
|
+
type: String,
|
|
1342
|
+
default: "light",
|
|
1343
|
+
validator: (e) => {
|
|
1344
|
+
const S = e ? e.toLowerCase() : "";
|
|
1345
|
+
return ["light", "dark"].includes(S);
|
|
1346
|
+
}
|
|
1347
|
+
},
|
|
1348
|
+
// Cores do tema light
|
|
1349
|
+
lightTextColorOn: {
|
|
1350
|
+
type: String,
|
|
1351
|
+
default: "#4a4a4a"
|
|
1352
|
+
},
|
|
1353
|
+
lightTextColorOnHover: {
|
|
1354
|
+
type: String,
|
|
1355
|
+
default: "#3a3a3a"
|
|
1356
|
+
},
|
|
1357
|
+
lightTextColorOff: {
|
|
1358
|
+
type: String,
|
|
1359
|
+
default: "#585858"
|
|
1360
|
+
},
|
|
1361
|
+
lightTextColorOffHover: {
|
|
1362
|
+
type: String,
|
|
1363
|
+
default: "#707070"
|
|
1364
|
+
},
|
|
1365
|
+
lightButtonColorOn: {
|
|
1366
|
+
type: String,
|
|
1367
|
+
default: "#f8f8f2"
|
|
1368
|
+
},
|
|
1369
|
+
lightButtonColorOnHover: {
|
|
1370
|
+
type: String,
|
|
1371
|
+
default: "#e8e8e2"
|
|
1372
|
+
},
|
|
1373
|
+
lightButtonColorOff: {
|
|
1374
|
+
type: String,
|
|
1375
|
+
default: "#d5d5d5"
|
|
1376
|
+
},
|
|
1377
|
+
lightButtonColorOffHover: {
|
|
1378
|
+
type: String,
|
|
1379
|
+
default: "#c0c0c0"
|
|
1380
|
+
},
|
|
1381
|
+
// Cores do tema dark
|
|
1382
|
+
darkTextColorOn: {
|
|
1383
|
+
type: String,
|
|
1384
|
+
default: "#f8f8f8"
|
|
1385
|
+
},
|
|
1386
|
+
darkTextColorOnHover: {
|
|
1387
|
+
type: String,
|
|
1388
|
+
default: "#ffffff"
|
|
1389
|
+
},
|
|
1390
|
+
darkTextColorOff: {
|
|
1391
|
+
type: String,
|
|
1392
|
+
default: "#909090"
|
|
1393
|
+
},
|
|
1394
|
+
darkTextColorOffHover: {
|
|
1395
|
+
type: String,
|
|
1396
|
+
default: "#b0b0b0"
|
|
1397
|
+
},
|
|
1398
|
+
darkButtonColorOn: {
|
|
1399
|
+
type: String,
|
|
1400
|
+
default: "#3d3d3d"
|
|
1401
|
+
},
|
|
1402
|
+
darkButtonColorOnHover: {
|
|
1403
|
+
type: String,
|
|
1404
|
+
default: "#4d4d4d"
|
|
1405
|
+
},
|
|
1406
|
+
darkButtonColorOff: {
|
|
1407
|
+
type: String,
|
|
1408
|
+
default: "#2c2c2c"
|
|
1409
|
+
},
|
|
1410
|
+
darkButtonColorOffHover: {
|
|
1411
|
+
type: String,
|
|
1412
|
+
default: "#2d2d2d"
|
|
1413
|
+
},
|
|
1414
|
+
borderRadius: {
|
|
1415
|
+
type: Number,
|
|
1416
|
+
default: 0
|
|
1417
|
+
},
|
|
1418
|
+
width: {
|
|
1419
|
+
type: Number,
|
|
1420
|
+
default: 86,
|
|
1421
|
+
validator: (e) => e || 86
|
|
1422
|
+
},
|
|
1423
|
+
paddingX: {
|
|
1424
|
+
type: Number,
|
|
1425
|
+
default: 1,
|
|
1426
|
+
validator: (e) => e || 1
|
|
1427
|
+
},
|
|
1428
|
+
paddingY: {
|
|
1429
|
+
type: Number,
|
|
1430
|
+
default: 0.2,
|
|
1431
|
+
validator: (e) => e || 0.2
|
|
1432
|
+
},
|
|
1433
|
+
disabled: {
|
|
1434
|
+
type: Boolean,
|
|
1435
|
+
default: !1,
|
|
1436
|
+
validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
|
|
1437
|
+
},
|
|
1438
|
+
fontFamily: {
|
|
1439
|
+
type: String,
|
|
1440
|
+
default: "'Lato', sans-serif"
|
|
1441
|
+
},
|
|
1442
|
+
fontSize: {
|
|
1443
|
+
type: String,
|
|
1444
|
+
default: "1.6em",
|
|
1445
|
+
validator: (e) => e || "1.6em"
|
|
1446
|
+
},
|
|
1447
|
+
fontWeight: {
|
|
1448
|
+
type: Number,
|
|
1449
|
+
default: 400,
|
|
1450
|
+
validator: (e) => e || 200
|
|
1451
|
+
},
|
|
1452
|
+
textEnable: {
|
|
1453
|
+
type: String,
|
|
1454
|
+
default: "On"
|
|
1455
|
+
},
|
|
1456
|
+
textDisable: {
|
|
1457
|
+
type: String,
|
|
1458
|
+
default: "Off"
|
|
1459
|
+
}
|
|
1460
|
+
},
|
|
1461
|
+
emits: ["clicked", "current-value"],
|
|
1462
|
+
setup(e, { emit: S }) {
|
|
1463
|
+
Ue((l) => ({
|
|
1464
|
+
ac6aa1d0: Ve.value,
|
|
1465
|
+
v4696e6e9: Oe.value,
|
|
1466
|
+
cc154ff4: He.value,
|
|
1467
|
+
v6b4169e8: z.value,
|
|
1468
|
+
v64b0c7af: i.value,
|
|
1469
|
+
v32476034: $e.value,
|
|
1470
|
+
v89819b8a: O.value,
|
|
1471
|
+
bf08ab54: De.value,
|
|
1472
|
+
v21ae018d: me.value,
|
|
1473
|
+
v14122f81: h.value,
|
|
1474
|
+
v06285af4: U.value
|
|
1475
|
+
}));
|
|
1476
|
+
const y = S;
|
|
1477
|
+
Ge(() => {
|
|
1478
|
+
se();
|
|
1479
|
+
});
|
|
1480
|
+
const ae = e, {
|
|
1481
|
+
nbId: V,
|
|
1482
|
+
value: Q,
|
|
1483
|
+
textEnable: ge,
|
|
1484
|
+
textDisable: ie,
|
|
1485
|
+
ariaLabel: be,
|
|
1486
|
+
ariaAttrs: u,
|
|
1487
|
+
theme: C,
|
|
1488
|
+
lightButtonColorOn: fe,
|
|
1489
|
+
lightButtonColorOff: oe,
|
|
1490
|
+
lightButtonColorOnHover: ne,
|
|
1491
|
+
lightButtonColorOffHover: ve,
|
|
1492
|
+
lightTextColorOn: Z,
|
|
1493
|
+
lightTextColorOff: ye,
|
|
1494
|
+
lightTextColorOnHover: re,
|
|
1495
|
+
lightTextColorOffHover: k,
|
|
1496
|
+
darkButtonColorOn: M,
|
|
1497
|
+
darkButtonColorOff: q,
|
|
1498
|
+
darkButtonColorOnHover: w,
|
|
1499
|
+
darkButtonColorOffHover: c,
|
|
1500
|
+
darkTextColorOn: ee,
|
|
1501
|
+
darkTextColorOff: N,
|
|
1502
|
+
darkTextColorOnHover: B,
|
|
1503
|
+
darkTextColorOffHover: H,
|
|
1504
|
+
borderRadius: x,
|
|
1505
|
+
width: K,
|
|
1506
|
+
paddingX: F,
|
|
1507
|
+
paddingY: ue,
|
|
1508
|
+
disabled: $,
|
|
1509
|
+
fontFamily: he,
|
|
1510
|
+
fontSize: Ce,
|
|
1511
|
+
fontWeight: de
|
|
1512
|
+
} = Je(ae), E = J(!1), v = o(() => {
|
|
1513
|
+
const l = $.value ? "component-disabled" : "", p = "inline-block", f = !x.value || x.value < 0 ? 0 : x.value, A = !K.value || K.value < 86 ? 86 : K.value, Ne = !F.value || F.value < 0 ? 1 : F.value, b = !ue.value || ue.value < 0 ? 0.2 : ue.value, g = he.value ? he.value : "'Lato', sans-serif", Ee = Ce.value ? Ce.value : "1.6em", Ie = !de.value || de.value < 0 ? 200 : de.value, W = fe.value ? fe.value : "#f8f8f2", X = oe.value ? oe.value : "#d5d5d5", L = ne.value ? ne.value : "#e8e8e2", P = ve.value ? ve.value : "#c0c0c0", te = Z.value ? Z.value : "#4a4a4a", xe = ye.value ? ye.value : "#909090", Fe = re.value ? re.value : "#3a3a3a", je = k.value ? k.value : "#707070", Xe = M.value ? M.value : "#3d3d3d", Ye = q.value ? q.value : "#1d1d1d", Me = w.value ? w.value : "#4d4d4d", We = c.value ? c.value : "#2d2d2d", ze = ee.value ? ee.value : "#f8f8f8", qe = N.value ? N.value : "#909090", Pe = B.value ? B.value : "#ffffff", Ae = H.value ? H.value : "#b0b0b0";
|
|
1514
|
+
return {
|
|
1515
|
+
disabled: l,
|
|
1516
|
+
display: p,
|
|
1517
|
+
lightButtonColorOn: W,
|
|
1518
|
+
lightButtonColorOff: X,
|
|
1519
|
+
lightButtonColorOnHover: L,
|
|
1520
|
+
lightButtonColorOffHover: P,
|
|
1521
|
+
lightTextColorOn: te,
|
|
1522
|
+
lightTextColorOff: xe,
|
|
1523
|
+
lightTextColorOnHover: Fe,
|
|
1524
|
+
lightTextColorOffHover: je,
|
|
1525
|
+
darkButtonColorOn: Xe,
|
|
1526
|
+
darkButtonColorOff: Ye,
|
|
1527
|
+
darkButtonColorOnHover: Me,
|
|
1528
|
+
darkButtonColorOffHover: We,
|
|
1529
|
+
darkTextColorOn: ze,
|
|
1530
|
+
darkTextColorOff: qe,
|
|
1531
|
+
darkTextColorOnHover: Pe,
|
|
1532
|
+
darkTextColorOffHover: Ae,
|
|
1533
|
+
borderRadius: f,
|
|
1534
|
+
width: A,
|
|
1535
|
+
paddingX: Ne,
|
|
1536
|
+
paddingY: b,
|
|
1537
|
+
font: g,
|
|
1538
|
+
fontSize: Ee,
|
|
1539
|
+
fontWeight: Ie
|
|
1540
|
+
};
|
|
1541
|
+
}), Be = o(() => v.value.disabled), Te = o(() => ({
|
|
1542
|
+
display: v.value.display
|
|
1543
|
+
})), _e = o(() => {
|
|
1544
|
+
const l = v.value;
|
|
1545
|
+
return {
|
|
1546
|
+
minWidth: "33px",
|
|
1547
|
+
width: l.display === "block" ? "auto" : `${l.width}px`,
|
|
1548
|
+
lineHeight: "1.42857143",
|
|
1549
|
+
fontSize: l.fontSize,
|
|
1550
|
+
fontWeight: l.fontWeight
|
|
1551
|
+
};
|
|
1552
|
+
}), Ve = o(() => v.value.font), we = o(() => C.value === "dark" ? "component__theme--dark" : "component__theme--light"), He = o(() => `${v.value.borderRadius}rem`), Oe = o(() => {
|
|
1553
|
+
const l = v.value;
|
|
1554
|
+
return `${l.paddingY}rem ${l.paddingX}rem`;
|
|
1555
|
+
}), me = o(() => {
|
|
1556
|
+
const l = v.value;
|
|
1557
|
+
return C.value === "light" ? l.lightTextColorOn : l.darkTextColorOn;
|
|
1558
|
+
}), h = o(() => {
|
|
1559
|
+
const l = v.value;
|
|
1560
|
+
return C.value === "light" ? l.lightTextColorOff : l.darkTextColorOff;
|
|
1561
|
+
}), i = o(() => {
|
|
1562
|
+
const l = v.value;
|
|
1563
|
+
return C.value === "light" ? l.lightTextColorOnHover : l.darkTextColorOnHover;
|
|
1564
|
+
}), O = o(() => {
|
|
1565
|
+
const l = v.value;
|
|
1566
|
+
return C.value === "light" ? l.lightTextColorOffHover : l.darkTextColorOffHover;
|
|
1567
|
+
}), z = o(() => {
|
|
1568
|
+
const l = v.value;
|
|
1569
|
+
return C.value === "light" ? l.lightButtonColorOn : l.darkButtonColorOn;
|
|
1570
|
+
}), U = o(() => {
|
|
1571
|
+
const l = v.value;
|
|
1572
|
+
return C.value === "light" ? l.lightButtonColorOff : l.darkButtonColorOff;
|
|
1573
|
+
}), $e = o(() => {
|
|
1574
|
+
const l = v.value;
|
|
1575
|
+
return C.value === "light" ? l.lightButtonColorOnHover : l.darkButtonColorOnHover;
|
|
1576
|
+
}), De = o(() => {
|
|
1577
|
+
const l = v.value;
|
|
1578
|
+
return C.value === "light" ? l.lightButtonColorOffHover : l.darkButtonColorOffHover;
|
|
1579
|
+
}), Se = o(() => {
|
|
1580
|
+
const l = {};
|
|
1581
|
+
u.value && Object.keys(u.value).forEach((A) => l[`aria-${A}`] = u.value[A]);
|
|
1582
|
+
const p = {
|
|
1583
|
+
"aria-label": be.value,
|
|
1584
|
+
"aria-disabled": $.value,
|
|
1585
|
+
...l
|
|
1586
|
+
};
|
|
1587
|
+
return Object.fromEntries(
|
|
1588
|
+
Object.entries(p).filter(([f, A]) => A != null)
|
|
1589
|
+
);
|
|
1590
|
+
}), ce = () => {
|
|
1591
|
+
$.value || y("clicked");
|
|
1592
|
+
}, G = () => {
|
|
1593
|
+
$.value || (E.value = !E.value, y("clicked"));
|
|
1594
|
+
}, se = () => {
|
|
1595
|
+
const l = Q.value;
|
|
1596
|
+
E.value = l, y("current-value", l);
|
|
1597
|
+
};
|
|
1598
|
+
return pe(E, (l) => {
|
|
1599
|
+
y("current-value", l);
|
|
1600
|
+
}), pe(Q, () => {
|
|
1601
|
+
se();
|
|
1602
|
+
}), (l, p) => t(V) ? (T(), _("div", Qe({
|
|
1603
|
+
key: 0,
|
|
1604
|
+
class: ["nb-wrapper", Be.value],
|
|
1605
|
+
style: [Te.value],
|
|
1606
|
+
tabIndex: t($) ? -1 : e.tabIndex,
|
|
1607
|
+
role: "button"
|
|
1608
|
+
}, Se.value, {
|
|
1609
|
+
onClick: p[1] || (p[1] = (...f) => l.interacted && l.interacted(...f)),
|
|
1610
|
+
onKeydown: [
|
|
1611
|
+
p[2] || (p[2] = D(m((f) => !t($) && e.hasTabIndexEnter && G(), ["prevent"]), ["enter"])),
|
|
1612
|
+
p[3] || (p[3] = D(m((f) => !t($) && e.hasTabIndexSpace && G(), ["prevent"]), ["space"]))
|
|
1613
|
+
]
|
|
1614
|
+
}), [
|
|
1615
|
+
I("div", {
|
|
1616
|
+
id: t(V),
|
|
1617
|
+
class: R(["nb-reset", "component", we.value]),
|
|
1618
|
+
style: Re([_e.value])
|
|
1619
|
+
}, [
|
|
1620
|
+
lt(I("input", {
|
|
1621
|
+
id: `${t(V)}-input`,
|
|
1622
|
+
"onUpdate:modelValue": p[0] || (p[0] = (f) => E.value = f),
|
|
1623
|
+
type: "checkbox",
|
|
1624
|
+
disabled: t($),
|
|
1625
|
+
class: R(["component__input", "component__input--flip"]),
|
|
1626
|
+
onChange: ce
|
|
1627
|
+
}, null, 40, il), [
|
|
1628
|
+
[at, E.value]
|
|
1629
|
+
]),
|
|
1630
|
+
I("label", {
|
|
1631
|
+
for: `${t(V)}-input`,
|
|
1632
|
+
class: "component__button",
|
|
1633
|
+
"data-tg-off": t(ie),
|
|
1634
|
+
"data-tg-on": t(ge)
|
|
1635
|
+
}, le(E.value ? t(ge) : t(ie)), 9, fl)
|
|
1636
|
+
], 14, sl)
|
|
1637
|
+
], 16, dl)) : ke("", !0);
|
|
1638
|
+
}
|
|
1639
|
+
}), cl = /* @__PURE__ */ Ze(vl, [["__scopeId", "data-v-9684280d"]]);
|
|
1640
|
+
const pl = ["tabIndex"], gl = ["id"], bl = ["id", "disabled"], yl = ["for", "data-tg-off", "data-tg-on"], hl = /* @__PURE__ */ Object.assign({
|
|
1641
|
+
name: "NbToggleSkewed",
|
|
1642
|
+
inheritAttrs: !1
|
|
1643
|
+
}, {
|
|
1644
|
+
__name: "NbToggleSkewed",
|
|
1645
|
+
props: {
|
|
1646
|
+
nbId: {
|
|
1647
|
+
type: String,
|
|
1648
|
+
required: !0
|
|
1649
|
+
},
|
|
1650
|
+
value: {
|
|
1651
|
+
type: Boolean,
|
|
1652
|
+
default: !1
|
|
1653
|
+
},
|
|
1654
|
+
tabIndex: {
|
|
1655
|
+
type: Number,
|
|
1656
|
+
default: 0
|
|
1657
|
+
},
|
|
1658
|
+
hasTabIndexEnter: {
|
|
1659
|
+
type: Boolean,
|
|
1660
|
+
default: !0
|
|
1661
|
+
},
|
|
1662
|
+
hasTabIndexSpace: {
|
|
1663
|
+
type: Boolean,
|
|
1664
|
+
default: !0
|
|
1665
|
+
},
|
|
1666
|
+
ariaLabel: {
|
|
1667
|
+
type: String,
|
|
1668
|
+
default: "Alternate Text Button"
|
|
1669
|
+
},
|
|
1670
|
+
ariaAttrs: {
|
|
1671
|
+
type: Object,
|
|
1672
|
+
default: () => ({})
|
|
1673
|
+
},
|
|
1674
|
+
theme: {
|
|
1675
|
+
type: String,
|
|
1676
|
+
default: "light",
|
|
1677
|
+
validator: (e) => {
|
|
1678
|
+
const S = e ? e.toLowerCase() : "";
|
|
1679
|
+
return ["light", "dark"].includes(S);
|
|
1680
|
+
}
|
|
1681
|
+
},
|
|
1682
|
+
// Cores do tema light
|
|
1683
|
+
lightTextColorOn: {
|
|
1684
|
+
type: String,
|
|
1685
|
+
default: "#4a4a4a"
|
|
1686
|
+
},
|
|
1687
|
+
lightTextColorOnHover: {
|
|
1688
|
+
type: String,
|
|
1689
|
+
default: "#3a3a3a"
|
|
1690
|
+
},
|
|
1691
|
+
lightTextColorOff: {
|
|
1692
|
+
type: String,
|
|
1693
|
+
default: "#585858"
|
|
1694
|
+
},
|
|
1695
|
+
lightTextColorOffHover: {
|
|
1696
|
+
type: String,
|
|
1697
|
+
default: "#707070"
|
|
1698
|
+
},
|
|
1699
|
+
lightButtonColorOn: {
|
|
1700
|
+
type: String,
|
|
1701
|
+
default: "#f8f8f2"
|
|
1702
|
+
},
|
|
1703
|
+
lightButtonColorOnHover: {
|
|
1704
|
+
type: String,
|
|
1705
|
+
default: "#e8e8e2"
|
|
1706
|
+
},
|
|
1707
|
+
lightButtonColorOff: {
|
|
1708
|
+
type: String,
|
|
1709
|
+
default: "#d5d5d5"
|
|
1710
|
+
},
|
|
1711
|
+
lightButtonColorOffHover: {
|
|
1712
|
+
type: String,
|
|
1713
|
+
default: "#c0c0c0"
|
|
1714
|
+
},
|
|
1715
|
+
// Cores do tema dark
|
|
1716
|
+
darkTextColorOn: {
|
|
1717
|
+
type: String,
|
|
1718
|
+
default: "#f8f8f8"
|
|
1719
|
+
},
|
|
1720
|
+
darkTextColorOnHover: {
|
|
1721
|
+
type: String,
|
|
1722
|
+
default: "#ffffff"
|
|
1723
|
+
},
|
|
1724
|
+
darkTextColorOff: {
|
|
1725
|
+
type: String,
|
|
1726
|
+
default: "#909090"
|
|
1727
|
+
},
|
|
1728
|
+
darkTextColorOffHover: {
|
|
1729
|
+
type: String,
|
|
1730
|
+
default: "#b0b0b0"
|
|
1731
|
+
},
|
|
1732
|
+
darkButtonColorOn: {
|
|
1733
|
+
type: String,
|
|
1734
|
+
default: "#3d3d3d"
|
|
1735
|
+
},
|
|
1736
|
+
darkButtonColorOnHover: {
|
|
1737
|
+
type: String,
|
|
1738
|
+
default: "#4d4d4d"
|
|
1739
|
+
},
|
|
1740
|
+
darkButtonColorOff: {
|
|
1741
|
+
type: String,
|
|
1742
|
+
default: "#2c2c2c"
|
|
1743
|
+
},
|
|
1744
|
+
darkButtonColorOffHover: {
|
|
1745
|
+
type: String,
|
|
1746
|
+
default: "#2d2d2d"
|
|
1747
|
+
},
|
|
1748
|
+
borderRadius: {
|
|
1749
|
+
type: Number,
|
|
1750
|
+
default: 0
|
|
1751
|
+
},
|
|
1752
|
+
width: {
|
|
1753
|
+
type: Number,
|
|
1754
|
+
default: 86,
|
|
1755
|
+
validator: (e) => e || 86
|
|
1756
|
+
},
|
|
1757
|
+
paddingX: {
|
|
1758
|
+
type: Number,
|
|
1759
|
+
default: 1,
|
|
1760
|
+
validator: (e) => e || 1
|
|
1761
|
+
},
|
|
1762
|
+
paddingY: {
|
|
1763
|
+
type: Number,
|
|
1764
|
+
default: 0.2,
|
|
1765
|
+
validator: (e) => e || 0.2
|
|
1766
|
+
},
|
|
1767
|
+
disabled: {
|
|
1768
|
+
type: Boolean,
|
|
1769
|
+
default: !1,
|
|
1770
|
+
validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
|
|
1771
|
+
},
|
|
1772
|
+
fontFamily: {
|
|
1773
|
+
type: String,
|
|
1774
|
+
default: "'Lato', sans-serif"
|
|
1775
|
+
},
|
|
1776
|
+
fontSize: {
|
|
1777
|
+
type: String,
|
|
1778
|
+
default: "1.6em",
|
|
1779
|
+
validator: (e) => e || "1.6em"
|
|
1780
|
+
},
|
|
1781
|
+
fontWeight: {
|
|
1782
|
+
type: Number,
|
|
1783
|
+
default: 400,
|
|
1784
|
+
validator: (e) => e || 200
|
|
1785
|
+
},
|
|
1786
|
+
textEnable: {
|
|
1787
|
+
type: String,
|
|
1788
|
+
default: "On"
|
|
1789
|
+
},
|
|
1790
|
+
textDisable: {
|
|
1791
|
+
type: String,
|
|
1792
|
+
default: "Off"
|
|
1793
|
+
}
|
|
1794
|
+
},
|
|
1795
|
+
emits: ["clicked", "current-value"],
|
|
1796
|
+
setup(e, { emit: S }) {
|
|
1797
|
+
Ue((l) => ({
|
|
1798
|
+
v53ee1386: Ve.value,
|
|
1799
|
+
v84fb8de4: Oe.value,
|
|
1800
|
+
v2b1ed5fe: He.value,
|
|
1801
|
+
v2a2dcc4d: z.value,
|
|
1802
|
+
v63bc9622: $e.value,
|
|
1803
|
+
v5aff0f2a: i.value,
|
|
1804
|
+
v1b8bbcc1: U.value,
|
|
1805
|
+
v648d6c7c: h.value,
|
|
1806
|
+
v7febecfb: De.value,
|
|
1807
|
+
e28c4bc0: O.value,
|
|
1808
|
+
v9eac8d9c: me.value
|
|
1809
|
+
}));
|
|
1810
|
+
const y = S;
|
|
1811
|
+
Ge(() => {
|
|
1812
|
+
se();
|
|
1813
|
+
});
|
|
1814
|
+
const ae = e, {
|
|
1815
|
+
nbId: V,
|
|
1816
|
+
value: Q,
|
|
1817
|
+
textEnable: ge,
|
|
1818
|
+
textDisable: ie,
|
|
1819
|
+
ariaLabel: be,
|
|
1820
|
+
ariaAttrs: u,
|
|
1821
|
+
theme: C,
|
|
1822
|
+
lightButtonColorOn: fe,
|
|
1823
|
+
lightButtonColorOff: oe,
|
|
1824
|
+
lightButtonColorOnHover: ne,
|
|
1825
|
+
lightButtonColorOffHover: ve,
|
|
1826
|
+
lightTextColorOn: Z,
|
|
1827
|
+
lightTextColorOff: ye,
|
|
1828
|
+
lightTextColorOnHover: re,
|
|
1829
|
+
lightTextColorOffHover: k,
|
|
1830
|
+
darkButtonColorOn: M,
|
|
1831
|
+
darkButtonColorOff: q,
|
|
1832
|
+
darkButtonColorOnHover: w,
|
|
1833
|
+
darkButtonColorOffHover: c,
|
|
1834
|
+
darkTextColorOn: ee,
|
|
1835
|
+
darkTextColorOff: N,
|
|
1836
|
+
darkTextColorOnHover: B,
|
|
1837
|
+
darkTextColorOffHover: H,
|
|
1838
|
+
borderRadius: x,
|
|
1839
|
+
width: K,
|
|
1840
|
+
paddingX: F,
|
|
1841
|
+
paddingY: ue,
|
|
1842
|
+
disabled: $,
|
|
1843
|
+
fontFamily: he,
|
|
1844
|
+
fontSize: Ce,
|
|
1845
|
+
fontWeight: de
|
|
1846
|
+
} = Je(ae), E = J(!1), v = o(() => {
|
|
1847
|
+
const l = $.value ? "component-disabled" : "", p = "inline-block", f = !x.value || x.value < 0 ? 0 : x.value, A = !K.value || K.value < 86 ? 86 : K.value, Ne = !F.value || F.value < 0 ? 1 : F.value, b = !ue.value || ue.value < 0 ? 0.2 : ue.value, g = he.value ? he.value : "'Lato', sans-serif", Ee = Ce.value ? Ce.value : "1.6em", Ie = !de.value || de.value < 0 ? 200 : de.value, W = fe.value ? fe.value : "#f8f8f2", X = oe.value ? oe.value : "#d5d5d5", L = ne.value ? ne.value : "#e8e8e2", P = ve.value ? ve.value : "#c0c0c0", te = Z.value ? Z.value : "#4a4a4a", xe = ye.value ? ye.value : "#909090", Fe = re.value ? re.value : "#3a3a3a", je = k.value ? k.value : "#707070", Xe = M.value ? M.value : "#3d3d3d", Ye = q.value ? q.value : "#1d1d1d", Me = w.value ? w.value : "#4d4d4d", We = c.value ? c.value : "#2d2d2d", ze = ee.value ? ee.value : "#f8f8f8", qe = N.value ? N.value : "#909090", Pe = B.value ? B.value : "#ffffff", Ae = H.value ? H.value : "#b0b0b0";
|
|
1848
|
+
return {
|
|
1849
|
+
disabled: l,
|
|
1850
|
+
display: p,
|
|
1851
|
+
lightButtonColorOn: W,
|
|
1852
|
+
lightButtonColorOff: X,
|
|
1853
|
+
lightButtonColorOnHover: L,
|
|
1854
|
+
lightButtonColorOffHover: P,
|
|
1855
|
+
lightTextColorOn: te,
|
|
1856
|
+
lightTextColorOff: xe,
|
|
1857
|
+
lightTextColorOnHover: Fe,
|
|
1858
|
+
lightTextColorOffHover: je,
|
|
1859
|
+
darkButtonColorOn: Xe,
|
|
1860
|
+
darkButtonColorOff: Ye,
|
|
1861
|
+
darkButtonColorOnHover: Me,
|
|
1862
|
+
darkButtonColorOffHover: We,
|
|
1863
|
+
darkTextColorOn: ze,
|
|
1864
|
+
darkTextColorOff: qe,
|
|
1865
|
+
darkTextColorOnHover: Pe,
|
|
1866
|
+
darkTextColorOffHover: Ae,
|
|
1867
|
+
borderRadius: f,
|
|
1868
|
+
width: A,
|
|
1869
|
+
paddingX: Ne,
|
|
1870
|
+
paddingY: b,
|
|
1871
|
+
font: g,
|
|
1872
|
+
fontSize: Ee,
|
|
1873
|
+
fontWeight: Ie
|
|
1874
|
+
};
|
|
1875
|
+
}), Be = o(() => v.value.disabled), Te = o(() => ({
|
|
1876
|
+
display: v.value.display
|
|
1877
|
+
})), _e = o(() => {
|
|
1878
|
+
const l = v.value;
|
|
1879
|
+
return {
|
|
1880
|
+
minWidth: "33px",
|
|
1881
|
+
width: l.display === "block" ? "auto" : `${l.width}px`,
|
|
1882
|
+
lineHeight: "1.42857143",
|
|
1883
|
+
fontSize: l.fontSize,
|
|
1884
|
+
fontWeight: l.fontWeight
|
|
1885
|
+
};
|
|
1886
|
+
}), Ve = o(() => v.value.font), we = o(() => C.value === "dark" ? "component__theme--dark" : "component__theme--light"), He = o(() => `${v.value.borderRadius}rem`), Oe = o(() => {
|
|
1887
|
+
const l = v.value;
|
|
1888
|
+
return `${l.paddingY}rem ${l.paddingX}rem`;
|
|
1889
|
+
}), me = o(() => {
|
|
1890
|
+
const l = v.value;
|
|
1891
|
+
return C.value === "light" ? l.lightTextColorOn : l.darkTextColorOn;
|
|
1892
|
+
}), h = o(() => {
|
|
1893
|
+
const l = v.value;
|
|
1894
|
+
return C.value === "light" ? l.lightTextColorOff : l.darkTextColorOff;
|
|
1895
|
+
}), i = o(() => {
|
|
1896
|
+
const l = v.value;
|
|
1897
|
+
return C.value === "light" ? l.lightTextColorOnHover : l.darkTextColorOnHover;
|
|
1898
|
+
}), O = o(() => {
|
|
1899
|
+
const l = v.value;
|
|
1900
|
+
return C.value === "light" ? l.lightTextColorOffHover : l.darkTextColorOffHover;
|
|
1901
|
+
}), z = o(() => {
|
|
1902
|
+
const l = v.value;
|
|
1903
|
+
return C.value === "light" ? l.lightButtonColorOn : l.darkButtonColorOn;
|
|
1904
|
+
}), U = o(() => {
|
|
1905
|
+
const l = v.value;
|
|
1906
|
+
return C.value === "light" ? l.lightButtonColorOff : l.darkButtonColorOff;
|
|
1907
|
+
}), $e = o(() => {
|
|
1908
|
+
const l = v.value;
|
|
1909
|
+
return C.value === "light" ? l.lightButtonColorOnHover : l.darkButtonColorOnHover;
|
|
1910
|
+
}), De = o(() => {
|
|
1911
|
+
const l = v.value;
|
|
1912
|
+
return C.value === "light" ? l.lightButtonColorOffHover : l.darkButtonColorOffHover;
|
|
1913
|
+
}), Se = o(() => {
|
|
1914
|
+
const l = {};
|
|
1915
|
+
u.value && Object.keys(u.value).forEach((A) => l[`aria-${A}`] = u.value[A]);
|
|
1916
|
+
const p = {
|
|
1917
|
+
"aria-label": be.value,
|
|
1918
|
+
"aria-disabled": $.value,
|
|
1919
|
+
...l
|
|
1920
|
+
};
|
|
1921
|
+
return Object.fromEntries(
|
|
1922
|
+
Object.entries(p).filter(([f, A]) => A != null)
|
|
1923
|
+
);
|
|
1924
|
+
}), ce = () => {
|
|
1925
|
+
$.value || y("clicked");
|
|
1926
|
+
}, G = () => {
|
|
1927
|
+
$.value || (E.value = !E.value, y("clicked"));
|
|
1928
|
+
}, se = () => {
|
|
1929
|
+
const l = Q.value;
|
|
1930
|
+
E.value = l, y("current-value", l);
|
|
1931
|
+
};
|
|
1932
|
+
return pe(E, (l) => {
|
|
1933
|
+
y("current-value", l);
|
|
1934
|
+
}), pe(Q, () => {
|
|
1935
|
+
se();
|
|
1936
|
+
}), (l, p) => t(V) ? (T(), _("div", Qe({
|
|
1937
|
+
key: 0,
|
|
1938
|
+
class: ["nb-wrapper", Be.value],
|
|
1939
|
+
style: [Te.value],
|
|
1940
|
+
tabIndex: t($) ? -1 : e.tabIndex,
|
|
1941
|
+
role: "button"
|
|
1942
|
+
}, Se.value, {
|
|
1943
|
+
onClick: p[1] || (p[1] = (...f) => l.interacted && l.interacted(...f)),
|
|
1944
|
+
onKeydown: [
|
|
1945
|
+
p[2] || (p[2] = D(m((f) => !t($) && e.hasTabIndexEnter && G(), ["prevent"]), ["enter"])),
|
|
1946
|
+
p[3] || (p[3] = D(m((f) => !t($) && e.hasTabIndexSpace && G(), ["prevent"]), ["space"]))
|
|
1947
|
+
]
|
|
1948
|
+
}), [
|
|
1949
|
+
I("div", {
|
|
1950
|
+
id: t(V),
|
|
1951
|
+
class: R(["nb-reset", "component", we.value]),
|
|
1952
|
+
style: Re([_e.value])
|
|
1953
|
+
}, [
|
|
1954
|
+
lt(I("input", {
|
|
1955
|
+
id: `${t(V)}-input`,
|
|
1956
|
+
"onUpdate:modelValue": p[0] || (p[0] = (f) => E.value = f),
|
|
1957
|
+
type: "checkbox",
|
|
1958
|
+
disabled: t($),
|
|
1959
|
+
class: R(["component__input", "component__input--skewed"]),
|
|
1960
|
+
onChange: ce
|
|
1961
|
+
}, null, 40, bl), [
|
|
1962
|
+
[at, E.value]
|
|
1963
|
+
]),
|
|
1964
|
+
I("label", {
|
|
1965
|
+
for: `${t(V)}-input`,
|
|
1966
|
+
class: "component__button",
|
|
1967
|
+
"data-tg-off": t(ie),
|
|
1968
|
+
"data-tg-on": t(ge)
|
|
1969
|
+
}, le(E.value ? t(ge) : t(ie)), 9, yl)
|
|
1970
|
+
], 14, gl)
|
|
1971
|
+
], 16, pl)) : ke("", !0);
|
|
1972
|
+
}
|
|
1973
|
+
}), Cl = /* @__PURE__ */ Ze(hl, [["__scopeId", "data-v-f356669c"]]), rt = { NbSelect: Yt, NbToggleLight: Zt, NbToggleSlim: ul, NbToggleFlip: cl, NbToggleSkewed: Cl }, xl = {
|
|
1974
|
+
install(e) {
|
|
1975
|
+
for (const S in rt)
|
|
1976
|
+
if (Object.prototype.hasOwnProperty.call(rt, S)) {
|
|
1977
|
+
const y = rt[S];
|
|
1978
|
+
e.component(y.name, y);
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
};
|
|
1982
|
+
export {
|
|
1983
|
+
xl as default
|
|
1984
|
+
};
|