golden-logic-ui 1.3.21 → 1.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as g, onMounted as Q, onBeforeUnmount as W, computed as X, watch as k, createElementBlock as i, openBlock as u, Fragment as h, createCommentVNode as w, normalizeClass as b, createElementVNode as l, toDisplayString as m, renderList as S, withDirectives as j, createTextVNode as Y, withModifiers as L, vModelText as Z, vShow as ee, nextTick as te } from "vue";
|
|
2
2
|
const re = { class: "font-bold ptext-lg dark:text-white" }, le = { class: "mt-3 mb-4" }, ne = { class: "px-3 py-1 mt-2 mb-2 text-sm font-medium text-blue-800 bg-blue-100 rounded-sm me-2 dark:bg-blue-900 dark:text-blue-300" }, oe = ["name", "value"], ae = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "dropdown"
|
|
5
5
|
}, se = {
|
|
6
|
-
class: "inline-flex
|
|
6
|
+
class: "inline-flex mb-1.5 ms-2 rounded-lg shadow-xs",
|
|
7
7
|
role: "group"
|
|
8
|
-
}, ie = { class: "relative" },
|
|
8
|
+
}, ie = { class: "relative" }, ue = ["onClick"], de = { class: "text-gray-700 bg-white border dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200 absolute w-full z-999999999 rounded-md mt-1 pt-1 showOptions" }, ce = { class: "border-b border-gray-200 dark:border-gray-700" }, fe = { class: "relative" }, ge = ["id", "placeholder"], ve = { class: "overflow-y-auto max-h-64 px-1 py-1" }, me = ["onClick", "onMousedown", "id"], ye = { class: "flex justify-between items-center py-2" }, xe = ["innerHTML"], pe = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "flex items-center shrink-0 w-4 h-4 text-green-500 ltr:right-2 rtl:left-2 dark:text-green-400",
|
|
11
11
|
"aria-hidden": "true",
|
|
12
12
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13
13
|
fill: "none",
|
|
14
14
|
viewBox: "0 0 16 12"
|
|
15
|
-
}, he = { class: "block mt-1 text-sm font-normal leading-5 text-red-500" }, be = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" },
|
|
15
|
+
}, he = { class: "block mt-1 text-sm font-normal leading-5 text-red-500" }, be = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" }, we = {
|
|
16
16
|
__name: "GlMultiSelectDropdown",
|
|
17
17
|
props: {
|
|
18
18
|
language: {
|
|
@@ -87,19 +87,19 @@ const re = { class: "font-bold ptext-lg dark:text-white" }, le = { class: "mt-3
|
|
|
87
87
|
},
|
|
88
88
|
emits: ["update:modelValue", "selected", "selectionChanged"],
|
|
89
89
|
setup(o, { emit: N }) {
|
|
90
|
-
const a = o,
|
|
90
|
+
const a = o, d = N, q = g(null), n = g([]), p = g([]), c = g([]), f = g(0), y = g(!1), v = g(""), x = g(""), T = g(null), D = (e) => {
|
|
91
91
|
e.key === "Enter" && e.target.form && e.preventDefault();
|
|
92
92
|
};
|
|
93
93
|
Q(() => {
|
|
94
|
-
|
|
94
|
+
x.value = P(), a.show || (document.body.addEventListener("click", V), document.addEventListener("keypress", D));
|
|
95
95
|
}), W(() => {
|
|
96
96
|
document.body.removeEventListener("click", V), document.removeEventListener("keypress", D);
|
|
97
97
|
});
|
|
98
98
|
const A = X(() => {
|
|
99
|
-
const e = [], t = new RegExp(
|
|
100
|
-
for (const r of
|
|
99
|
+
const e = [], t = new RegExp(v.value, "ig");
|
|
100
|
+
for (const r of p.value) {
|
|
101
101
|
const s = String(r.name);
|
|
102
|
-
(
|
|
102
|
+
(v.value.length < 1 || s.match(t)) && e.length < a.maxItem && e.push(r);
|
|
103
103
|
}
|
|
104
104
|
return e;
|
|
105
105
|
});
|
|
@@ -139,21 +139,21 @@ const re = { class: "font-bold ptext-lg dark:text-white" }, le = { class: "mt-3
|
|
|
139
139
|
n.value = E();
|
|
140
140
|
}
|
|
141
141
|
function H() {
|
|
142
|
-
n.value = [],
|
|
142
|
+
n.value = [], d("update:modelValue", []), d("selected", []), d("selectionChanged", []);
|
|
143
143
|
}
|
|
144
144
|
function J(e) {
|
|
145
145
|
let t = n.value.findIndex((r) => r.id === e.id);
|
|
146
|
-
t !== -1 && n.value.splice(t, 1), c.value = n.value.map((r) => r.id),
|
|
146
|
+
t !== -1 && n.value.splice(t, 1), c.value = n.value.map((r) => r.id), d("update:modelValue", c.value), d("selected", n.value), d("selectionChanged", n.value);
|
|
147
147
|
}
|
|
148
148
|
function V(e) {
|
|
149
|
-
e.target.id != a.field_name + "search" +
|
|
149
|
+
e.target.id != a.field_name + "search" + x.value && e.target.id != a.field_name && !e.target.classList.contains("showOptions") && (B(), f.value = 0, y.value = !1);
|
|
150
150
|
}
|
|
151
151
|
function C(e) {
|
|
152
|
-
const t = `${e}${
|
|
152
|
+
const t = `${e}${x.value}`, r = document.getElementById(t);
|
|
153
153
|
r && r.scrollIntoView();
|
|
154
154
|
}
|
|
155
155
|
function R(e) {
|
|
156
|
-
const t = `${e}${
|
|
156
|
+
const t = `${e}${x.value}`, r = document.getElementById(t);
|
|
157
157
|
r && r.click();
|
|
158
158
|
}
|
|
159
159
|
function G(e) {
|
|
@@ -164,21 +164,21 @@ const re = { class: "font-bold ptext-lg dark:text-white" }, le = { class: "mt-3
|
|
|
164
164
|
}
|
|
165
165
|
function I() {
|
|
166
166
|
if (O(n.value))
|
|
167
|
-
return _(n.value) ?
|
|
167
|
+
return _(n.value) ? p.value.filter(
|
|
168
168
|
(e) => n.value.some(
|
|
169
169
|
(t) => String(t.id) === String(e.id)
|
|
170
170
|
)
|
|
171
|
-
) || [] :
|
|
171
|
+
) || [] : p.value.filter(
|
|
172
172
|
(e) => n.value.some(
|
|
173
173
|
(t) => String(t) === String(e.id)
|
|
174
174
|
)
|
|
175
175
|
) || [];
|
|
176
176
|
if (a.modelValue)
|
|
177
|
-
return _(a.modelValue) ?
|
|
177
|
+
return _(a.modelValue) ? p.value.filter(
|
|
178
178
|
(e) => a.modelValue.some(
|
|
179
179
|
(t) => String(t.id) === String(e.id)
|
|
180
180
|
)
|
|
181
|
-
) || [] :
|
|
181
|
+
) || [] : p.value.filter(
|
|
182
182
|
(e) => a.modelValue.some(
|
|
183
183
|
(t) => String(t) === String(e.id)
|
|
184
184
|
)
|
|
@@ -186,67 +186,67 @@ const re = { class: "font-bold ptext-lg dark:text-white" }, le = { class: "mt-3
|
|
|
186
186
|
}
|
|
187
187
|
function $(e) {
|
|
188
188
|
let t = n.value.findIndex((r) => r.id === e.id);
|
|
189
|
-
t !== -1 ? n.value.splice(t, 1) : n.value.push(e),
|
|
189
|
+
t !== -1 ? n.value.splice(t, 1) : n.value.push(e), y.value = !1, c.value = n.value.map((r) => r.id), d("update:modelValue", c.value), d("selected", n.value), d("selectionChanged", n.value);
|
|
190
190
|
}
|
|
191
191
|
function M() {
|
|
192
192
|
if (!a.show) {
|
|
193
|
-
if (
|
|
194
|
-
|
|
193
|
+
if (y.value) {
|
|
194
|
+
y.value = !1;
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
|
-
|
|
197
|
+
v.value = "", y.value = !0, te(() => {
|
|
198
198
|
var e = document.getElementById(
|
|
199
|
-
`${a.field_name}search${
|
|
199
|
+
`${a.field_name}search${x.value}`
|
|
200
200
|
);
|
|
201
201
|
e && e.focus();
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
function B() {
|
|
206
|
-
|
|
206
|
+
v.value = "";
|
|
207
207
|
}
|
|
208
|
-
return
|
|
208
|
+
return k(v, () => {
|
|
209
209
|
A.value.length === 0 && (n.value = []);
|
|
210
|
-
}),
|
|
210
|
+
}), k(n, (e) => {
|
|
211
211
|
if (O(e)) {
|
|
212
212
|
c.value = e.map((s) => s.id);
|
|
213
213
|
const t = Array.isArray(c.value) ? c.value : [], r = Array.isArray(a.modelValue) ? a.modelValue : [];
|
|
214
|
-
JSON.stringify(t) !== JSON.stringify(r) &&
|
|
214
|
+
JSON.stringify(t) !== JSON.stringify(r) && d("update:modelValue", c.value);
|
|
215
215
|
}
|
|
216
|
-
}),
|
|
216
|
+
}), k(
|
|
217
217
|
() => a.modelValue,
|
|
218
218
|
(e) => {
|
|
219
|
-
|
|
219
|
+
v.value = "", e ? (n.value = a.modelValue, n.value = I()) : n.value = {};
|
|
220
220
|
},
|
|
221
221
|
{ immediate: !0, deep: !0 }
|
|
222
|
-
),
|
|
222
|
+
), k(
|
|
223
223
|
() => a.options,
|
|
224
224
|
() => {
|
|
225
|
-
|
|
225
|
+
p.value = E(), n.value = I();
|
|
226
226
|
},
|
|
227
227
|
{ immediate: !0, deep: !0 }
|
|
228
|
-
), (e, t) => (
|
|
229
|
-
o.show ? (
|
|
228
|
+
), (e, t) => (u(), i(h, null, [
|
|
229
|
+
o.show ? (u(), i("div", {
|
|
230
230
|
key: 0,
|
|
231
231
|
class: b(o.field_name)
|
|
232
232
|
}, [
|
|
233
233
|
l("h3", re, m(o.label_name), 1),
|
|
234
234
|
l("p", le, [
|
|
235
|
-
(
|
|
235
|
+
(u(!0), i(h, null, S(n.value, (r, s) => (u(), i("span", ne, m(r?.name), 1))), 256))
|
|
236
236
|
]),
|
|
237
237
|
t[4] || (t[4] = l("hr", { class: "opacity-100! bg-gray-200 border-0 dark:bg-gray-700" }, null, -1))
|
|
238
|
-
], 2)) :
|
|
239
|
-
o.show ?
|
|
238
|
+
], 2)) : w("", !0),
|
|
239
|
+
o.show ? w("", !0) : (u(), i("div", {
|
|
240
240
|
key: 1,
|
|
241
241
|
class: b(o.field_name)
|
|
242
242
|
}, [
|
|
243
|
-
(
|
|
243
|
+
(u(!0), i(h, null, S(c.value, (r, s) => (u(), i("input", {
|
|
244
244
|
type: "hidden",
|
|
245
245
|
name: o.field_name + "[]",
|
|
246
246
|
key: s,
|
|
247
247
|
value: r
|
|
248
248
|
}, null, 8, oe))), 128)),
|
|
249
|
-
o.options ? (
|
|
249
|
+
o.options ? (u(), i("div", ae, [
|
|
250
250
|
l("label", {
|
|
251
251
|
class: b({
|
|
252
252
|
"gl-label-form": o.error_message == "",
|
|
@@ -258,12 +258,12 @@ const re = { class: "font-bold ptext-lg dark:text-white" }, le = { class: "mt-3
|
|
|
258
258
|
l("button", {
|
|
259
259
|
onClick: F,
|
|
260
260
|
type: "button",
|
|
261
|
-
class: "px-
|
|
261
|
+
class: "rounded-s-lg px-3 py-1 text-xs font-medium text-gray-700 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-900 focus:z-10 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
|
|
262
262
|
}, m(o.language?.select_all ?? "Select all"), 1),
|
|
263
263
|
l("button", {
|
|
264
264
|
onClick: H,
|
|
265
265
|
type: "button",
|
|
266
|
-
class: "
|
|
266
|
+
class: "-ms-px rounded-e-lg px-3 py-1 text-xs font-medium text-gray-700 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-900 focus:z-10 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
|
|
267
267
|
}, m(o.language?.deselect_all ?? "Deselect all"), 1)
|
|
268
268
|
]),
|
|
269
269
|
l("div", {
|
|
@@ -276,7 +276,7 @@ const re = { class: "font-bold ptext-lg dark:text-white" }, le = { class: "mt-3
|
|
|
276
276
|
class: "flex flex-wrap gap-2 pr-2 gl-multi-dropdown showOptions",
|
|
277
277
|
onClick: t[0] || (t[0] = (r) => M())
|
|
278
278
|
}, [
|
|
279
|
-
(
|
|
279
|
+
(u(!0), i(h, null, S(n.value, (r, s) => (u(), i("span", {
|
|
280
280
|
key: s,
|
|
281
281
|
class: "flex gap-2 px-2 py-1 text-xs font-medium text-blue-800 bg-blue-100 rounded-sm pointer-events-none dark:bg-blue-900 dark:text-blue-300"
|
|
282
282
|
}, [
|
|
@@ -300,7 +300,7 @@ const re = { class: "font-bold ptext-lg dark:text-white" }, le = { class: "mt-3
|
|
|
300
300
|
d: "m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"
|
|
301
301
|
})
|
|
302
302
|
], -1)
|
|
303
|
-
]), 8,
|
|
303
|
+
]), 8, ue)
|
|
304
304
|
]))), 128))
|
|
305
305
|
]),
|
|
306
306
|
l("i", {
|
|
@@ -308,8 +308,8 @@ const re = { class: "font-bold ptext-lg dark:text-white" }, le = { class: "mt-3
|
|
|
308
308
|
class: "absolute text-xl text-gray-500 cursor-pointer fas ltr:right-2 rtl:left-2 hover:text-gray-700 dark:hover:text-gray-800 showOptions",
|
|
309
309
|
style: { top: "14px" }
|
|
310
310
|
}, [
|
|
311
|
-
(
|
|
312
|
-
class: b([
|
|
311
|
+
(u(), i("svg", {
|
|
312
|
+
class: b([y.value ? "" : "rotate-180", "w-3 h-3 shrink-0"]),
|
|
313
313
|
"aria-hidden": "true",
|
|
314
314
|
xmlns: "http://www.w3.org/2000/svg",
|
|
315
315
|
fill: "none",
|
|
@@ -324,7 +324,7 @@ const re = { class: "font-bold ptext-lg dark:text-white" }, le = { class: "mt-3
|
|
|
324
324
|
}, null, -1)
|
|
325
325
|
]), 2))
|
|
326
326
|
]),
|
|
327
|
-
j(l("div",
|
|
327
|
+
j(l("div", de, [
|
|
328
328
|
l("div", ce, [
|
|
329
329
|
t[8] || (t[8] = l("label", {
|
|
330
330
|
for: "default-search",
|
|
@@ -334,21 +334,21 @@ const re = { class: "font-bold ptext-lg dark:text-white" }, le = { class: "mt-3
|
|
|
334
334
|
t[7] || (t[7] = l("div", { class: "absolute inset-y-0 flex items-center pointer-events-none start-0 ps-3" }, null, -1)),
|
|
335
335
|
j(l("input", {
|
|
336
336
|
type: "search",
|
|
337
|
-
"onUpdate:modelValue": t[2] || (t[2] = (r) =>
|
|
337
|
+
"onUpdate:modelValue": t[2] || (t[2] = (r) => v.value = r),
|
|
338
338
|
ref: q.value,
|
|
339
|
-
id: `${o.field_name}search${
|
|
339
|
+
id: `${o.field_name}search${x.value}`,
|
|
340
340
|
onKeydown: z,
|
|
341
341
|
onBlur: t[3] || (t[3] = (r) => B()),
|
|
342
342
|
autocomplete: "off",
|
|
343
343
|
class: "block w-full p-2 text-sm text-gray-900 outline-hidden dark:bg-gray-800 dark:text-white",
|
|
344
344
|
placeholder: o.search_input_placeholder
|
|
345
|
-
}, null, 40,
|
|
346
|
-
[Z,
|
|
345
|
+
}, null, 40, ge), [
|
|
346
|
+
[Z, v.value]
|
|
347
347
|
])
|
|
348
348
|
])
|
|
349
349
|
]),
|
|
350
|
-
l("div",
|
|
351
|
-
(
|
|
350
|
+
l("div", ve, [
|
|
351
|
+
(u(!0), i(h, null, S(A.value, (r, s) => (u(), i("div", {
|
|
352
352
|
class: b([
|
|
353
353
|
"block px-2 py-0.5 text-xs leading-4 text-gray-700 no-underline cursor-pointer dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 dark:hover:text-white hover:rounded-sm",
|
|
354
354
|
s + 1 == f.value ? "bg-gray-100 dark:bg-gray-700 rounded-sm" : ""
|
|
@@ -356,13 +356,13 @@ const re = { class: "font-bold ptext-lg dark:text-white" }, le = { class: "mt-3
|
|
|
356
356
|
onClick: (U) => $(r),
|
|
357
357
|
onMousedown: (U) => $(r),
|
|
358
358
|
key: s,
|
|
359
|
-
id: `${s + 1}${
|
|
359
|
+
id: `${s + 1}${x.value}`
|
|
360
360
|
}, [
|
|
361
|
-
l("div",
|
|
361
|
+
l("div", ye, [
|
|
362
362
|
l("span", {
|
|
363
363
|
innerHTML: r.name || r.id || "-"
|
|
364
|
-
}, null, 8,
|
|
365
|
-
K(r.id) ? (
|
|
364
|
+
}, null, 8, xe),
|
|
365
|
+
K(r.id) ? (u(), i("svg", pe, t[9] || (t[9] = [
|
|
366
366
|
l("path", {
|
|
367
367
|
stroke: "currentColor",
|
|
368
368
|
"stroke-linecap": "round",
|
|
@@ -370,16 +370,16 @@ const re = { class: "font-bold ptext-lg dark:text-white" }, le = { class: "mt-3
|
|
|
370
370
|
"stroke-width": "2",
|
|
371
371
|
d: "M1 5.917 5.724 10.5 15 1.5"
|
|
372
372
|
}, null, -1)
|
|
373
|
-
]))) :
|
|
373
|
+
]))) : w("", !0)
|
|
374
374
|
])
|
|
375
375
|
], 42, me))), 128))
|
|
376
376
|
])
|
|
377
377
|
], 512), [
|
|
378
|
-
[ee,
|
|
378
|
+
[ee, y.value]
|
|
379
379
|
])
|
|
380
380
|
])
|
|
381
381
|
], 512)
|
|
382
|
-
])) :
|
|
382
|
+
])) : w("", !0),
|
|
383
383
|
l("span", he, m(o.error_message), 1),
|
|
384
384
|
l("small", be, m(o.description), 1)
|
|
385
385
|
], 2))
|
|
@@ -387,5 +387,5 @@ const re = { class: "font-bold ptext-lg dark:text-white" }, le = { class: "mt-3
|
|
|
387
387
|
}
|
|
388
388
|
};
|
|
389
389
|
export {
|
|
390
|
-
|
|
390
|
+
we as default
|
|
391
391
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const
|
|
1
|
+
import { ref as k, computed as b, createElementBlock as l, openBlock as d, Fragment as h, createCommentVNode as s, normalizeClass as n, createElementVNode as r, createTextVNode as m, toDisplayString as a, withDirectives as x, vModelCheckbox as v } from "vue";
|
|
2
|
+
const w = { class: "relative inline-flex items-center cursor-pointer" }, V = ["name", "id", "checked"], S = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "flex justify-between items-center"
|
|
5
|
-
},
|
|
5
|
+
}, B = { class: "gl-label-form" }, D = { class: "relative inline-flex items-center cursor-pointer" }, _ = ["name", "id"], j = { class: "gl-span-form-error" }, z = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" }, N = {
|
|
6
6
|
__name: "GlToggleBox",
|
|
7
7
|
props: {
|
|
8
8
|
is_required: {
|
|
@@ -44,26 +44,37 @@ const v = { class: "flex justify-between p-2 h-10 -mb-px border rounded-lg no-un
|
|
|
44
44
|
description: {
|
|
45
45
|
type: String,
|
|
46
46
|
default: ""
|
|
47
|
+
},
|
|
48
|
+
// "md" is the form row; "sm" matches a small button (text-sm, py-2) so
|
|
49
|
+
// the toggle can sit in a toolbar beside one.
|
|
50
|
+
size: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: "md",
|
|
53
|
+
validator: (e) => ["md", "sm"].includes(e)
|
|
47
54
|
}
|
|
48
55
|
},
|
|
49
56
|
emits: ["update:modelValue"],
|
|
50
|
-
setup(e, { emit:
|
|
51
|
-
const
|
|
57
|
+
setup(e, { emit: g }) {
|
|
58
|
+
const o = e, y = g, i = k(null), u = b(
|
|
59
|
+
() => o.size === "sm" ? "items-center px-3 py-1.5 text-sm" : "p-2 h-10"
|
|
60
|
+
), f = b({
|
|
52
61
|
get() {
|
|
53
|
-
return
|
|
62
|
+
return o.modelValue;
|
|
54
63
|
},
|
|
55
|
-
set(
|
|
56
|
-
|
|
64
|
+
set(c) {
|
|
65
|
+
y("update:modelValue", c);
|
|
57
66
|
}
|
|
58
67
|
});
|
|
59
|
-
return (
|
|
68
|
+
return (c, t) => (d(), l(h, null, [
|
|
60
69
|
e.show ? (d(), l("div", {
|
|
61
70
|
key: 0,
|
|
62
|
-
class:
|
|
71
|
+
class: n(e.field_name)
|
|
63
72
|
}, [
|
|
64
73
|
r("div", null, [
|
|
65
|
-
r("li",
|
|
66
|
-
|
|
74
|
+
r("li", {
|
|
75
|
+
class: n(["flex justify-between -mb-px border rounded-lg no-underlin bg-gray-50 focus:border-primary dark:bg-gray-800 dark:border-gray-700 dark:text-white dark:focus:border-primaryDark border-gray-200", u.value])
|
|
76
|
+
}, [
|
|
77
|
+
m(a(e.label_name) + " ", 1),
|
|
67
78
|
r("label", w, [
|
|
68
79
|
r("input", {
|
|
69
80
|
type: "checkbox",
|
|
@@ -79,23 +90,23 @@ const v = { class: "flex justify-between p-2 h-10 -mb-px border rounded-lg no-un
|
|
|
79
90
|
}, null, 8, V),
|
|
80
91
|
t[1] || (t[1] = r("div", { class: "w-11 h-6 bg-gray-200 peer-focus:outline-hidden peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:rtl:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[1px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600" }, null, -1))
|
|
81
92
|
])
|
|
82
|
-
])
|
|
93
|
+
], 2)
|
|
83
94
|
]),
|
|
84
95
|
t[2] || (t[2] = r("hr", { class: "opacity-100! bg-gray-200 border-0 dark:bg-gray-700" }, null, -1))
|
|
85
|
-
], 2)) :
|
|
86
|
-
e.show ?
|
|
96
|
+
], 2)) : s("", !0),
|
|
97
|
+
e.show ? s("", !0) : (d(), l("div", {
|
|
87
98
|
key: 1,
|
|
88
|
-
class:
|
|
99
|
+
class: n(e.field_name)
|
|
89
100
|
}, [
|
|
90
101
|
e.has_label_up ? (d(), l("div", S, [
|
|
91
|
-
r("label",
|
|
92
|
-
])) :
|
|
102
|
+
r("label", B, a(e.label_name), 1)
|
|
103
|
+
])) : s("", !0),
|
|
93
104
|
r("li", {
|
|
94
|
-
class:
|
|
105
|
+
class: n(["flex -mb-px border rounded-lg no-underlin bg-gray-50 focus:border-primary dark:bg-gray-800 dark:border-gray-700 dark:text-white dark:focus:border-primaryDark border-gray-200", [u.value, e.has_label_up ? "justify-end" : "justify-between"]])
|
|
95
106
|
}, [
|
|
96
|
-
|
|
97
|
-
r("label",
|
|
98
|
-
|
|
107
|
+
m(a(e.has_label_up ? "" : e.label_name) + " ", 1),
|
|
108
|
+
r("label", D, [
|
|
109
|
+
x(r("input", {
|
|
99
110
|
type: "checkbox",
|
|
100
111
|
class: "sr-only peer",
|
|
101
112
|
name: e.field_name,
|
|
@@ -104,19 +115,19 @@ const v = { class: "flex justify-between p-2 h-10 -mb-px border rounded-lg no-un
|
|
|
104
115
|
"false-value": 0,
|
|
105
116
|
ref_key: "input",
|
|
106
117
|
ref: i,
|
|
107
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
108
|
-
}, null, 8,
|
|
109
|
-
[
|
|
118
|
+
"onUpdate:modelValue": t[0] || (t[0] = (p) => f.value = p)
|
|
119
|
+
}, null, 8, _), [
|
|
120
|
+
[v, f.value]
|
|
110
121
|
]),
|
|
111
122
|
t[3] || (t[3] = r("div", { class: "w-11 h-6 bg-gray-200 peer-focus:outline-hidden rounded-full peer dark:bg-gray-500 peer-checked:after:translate-x-full peer-checked:rtl:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[1px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-400 peer-checked:bg-primary dark:peer-checked:bg-primaryDark" }, null, -1))
|
|
112
123
|
])
|
|
113
124
|
], 2),
|
|
114
125
|
r("span", j, a(e.error_message), 1),
|
|
115
|
-
r("small",
|
|
126
|
+
r("small", z, a(e.description), 1)
|
|
116
127
|
], 2))
|
|
117
128
|
], 64));
|
|
118
129
|
}
|
|
119
130
|
};
|
|
120
131
|
export {
|
|
121
|
-
|
|
132
|
+
N as default
|
|
122
133
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const w = { class: "
|
|
1
|
+
import { ref as h, computed as b, createElementBlock as a, openBlock as n, Fragment as k, createCommentVNode as s, normalizeClass as d, createElementVNode as t, createTextVNode as m, toDisplayString as l, withDirectives as x, vModelCheckbox as v } from "vue";
|
|
2
|
+
const w = { class: "relative inline-flex items-center cursor-pointer" }, V = ["name", "id", "checked"], B = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "flex justify-between items-center"
|
|
5
|
-
}, S = { class: "gl-label-form" },
|
|
5
|
+
}, S = { class: "gl-label-form" }, j = { class: "relative inline-flex items-center cursor-pointer" }, z = ["name", "id"], C = { class: "gl-span-form-error" }, _ = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" }, N = {
|
|
6
6
|
__name: "GlToggleBoxTrueFalse",
|
|
7
7
|
props: {
|
|
8
8
|
is_required: {
|
|
@@ -40,27 +40,38 @@ const w = { class: "flex justify-between p-2 -mb-px border border-gray-300 no-un
|
|
|
40
40
|
description: {
|
|
41
41
|
type: String,
|
|
42
42
|
default: ""
|
|
43
|
+
},
|
|
44
|
+
// "md" is the form row; "sm" matches a small button (text-sm, py-2) so
|
|
45
|
+
// the toggle can sit in a toolbar beside one.
|
|
46
|
+
size: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: "md",
|
|
49
|
+
validator: (e) => ["md", "sm"].includes(e)
|
|
43
50
|
}
|
|
44
51
|
},
|
|
45
52
|
emits: ["update:modelValue"],
|
|
46
|
-
setup(e, { emit:
|
|
47
|
-
const
|
|
53
|
+
setup(e, { emit: g }) {
|
|
54
|
+
const o = e, y = g, i = h(null), u = b(
|
|
55
|
+
() => o.size === "sm" ? "items-center px-3 py-1.5 text-sm" : "p-2"
|
|
56
|
+
), f = b({
|
|
48
57
|
get() {
|
|
49
|
-
return
|
|
58
|
+
return o.modelValue;
|
|
50
59
|
},
|
|
51
|
-
set(
|
|
52
|
-
|
|
60
|
+
set(c) {
|
|
61
|
+
y("update:modelValue", c);
|
|
53
62
|
}
|
|
54
63
|
});
|
|
55
|
-
return (
|
|
64
|
+
return (c, r) => (n(), a(k, null, [
|
|
56
65
|
e.show ? (n(), a("div", {
|
|
57
66
|
key: 0,
|
|
58
|
-
class:
|
|
67
|
+
class: d(e.field_name)
|
|
59
68
|
}, [
|
|
60
69
|
t("div", null, [
|
|
61
|
-
t("li",
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
t("li", {
|
|
71
|
+
class: d(["flex justify-between -mb-px border border-gray-300 no-underlin", u.value])
|
|
72
|
+
}, [
|
|
73
|
+
m(l(e.label_name) + " ", 1),
|
|
74
|
+
t("label", w, [
|
|
64
75
|
t("input", {
|
|
65
76
|
type: "checkbox",
|
|
66
77
|
class: "sr-only peer",
|
|
@@ -68,47 +79,47 @@ const w = { class: "flex justify-between p-2 -mb-px border border-gray-300 no-un
|
|
|
68
79
|
id: e.field_name,
|
|
69
80
|
checked: e.modelValue,
|
|
70
81
|
ref_key: "input",
|
|
71
|
-
ref:
|
|
82
|
+
ref: i,
|
|
72
83
|
disabled: ""
|
|
73
84
|
}, null, 8, V),
|
|
74
85
|
r[1] || (r[1] = t("div", { class: "w-11 h-6 bg-gray-200 peer-focus:outline-hidden peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:rtl:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[1px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600" }, null, -1))
|
|
75
86
|
])
|
|
76
|
-
])
|
|
87
|
+
], 2)
|
|
77
88
|
]),
|
|
78
89
|
r[2] || (r[2] = t("hr", { class: "opacity-100! bg-gray-200 border-0 dark:bg-gray-700" }, null, -1))
|
|
79
|
-
], 2)) :
|
|
80
|
-
e.show ?
|
|
90
|
+
], 2)) : s("", !0),
|
|
91
|
+
e.show ? s("", !0) : (n(), a("div", {
|
|
81
92
|
key: 1,
|
|
82
|
-
class:
|
|
93
|
+
class: d(e.field_name)
|
|
83
94
|
}, [
|
|
84
95
|
e.has_label_up ? (n(), a("div", B, [
|
|
85
96
|
t("label", S, l(e.label_name), 1)
|
|
86
|
-
])) :
|
|
97
|
+
])) : s("", !0),
|
|
87
98
|
t("li", {
|
|
88
|
-
class:
|
|
99
|
+
class: d(["flex -mb-px border border-gray-200 rounded-lg no-underlin dark:border-gray-600 dark:focus:border-primaryDark", [u.value, e.has_label_up ? "justify-end" : "justify-between"]])
|
|
89
100
|
}, [
|
|
90
|
-
|
|
91
|
-
t("label",
|
|
92
|
-
|
|
101
|
+
m(l(e.has_label_up ? "" : e.label_name) + " ", 1),
|
|
102
|
+
t("label", j, [
|
|
103
|
+
x(t("input", {
|
|
93
104
|
type: "checkbox",
|
|
94
105
|
class: "sr-only peer",
|
|
95
106
|
name: e.field_name,
|
|
96
107
|
id: e.field_name,
|
|
97
108
|
ref_key: "input",
|
|
98
|
-
ref:
|
|
99
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
100
|
-
}, null, 8,
|
|
101
|
-
[
|
|
109
|
+
ref: i,
|
|
110
|
+
"onUpdate:modelValue": r[0] || (r[0] = (p) => f.value = p)
|
|
111
|
+
}, null, 8, z), [
|
|
112
|
+
[v, f.value]
|
|
102
113
|
]),
|
|
103
114
|
r[3] || (r[3] = t("div", { class: "w-11 h-6 bg-gray-200 peer-focus:outline-hidden peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:rtl:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[1px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600" }, null, -1))
|
|
104
115
|
])
|
|
105
116
|
], 2),
|
|
106
117
|
t("span", C, l(e.error_message), 1),
|
|
107
|
-
t("small",
|
|
118
|
+
t("small", _, l(e.description), 1)
|
|
108
119
|
], 2))
|
|
109
120
|
], 64));
|
|
110
121
|
}
|
|
111
122
|
};
|
|
112
123
|
export {
|
|
113
|
-
|
|
124
|
+
N as default
|
|
114
125
|
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "The most popular library of interactive components built with Vuejs && Tailwind CSS",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "1.3.
|
|
6
|
+
"version": "1.3.23",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/mrgiant/GoldenLogicUi.git"
|