golden-logic-ui 0.0.0 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/golden-logic-ui.js +2262 -19
- package/dist/golden-logic-ui.umd.cjs +3 -1
- package/dist/style.css +1 -1
- package/package.json +5 -4
package/dist/golden-logic-ui.js
CHANGED
|
@@ -1,30 +1,2273 @@
|
|
|
1
|
-
import { openBlock as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
for (const [
|
|
5
|
-
|
|
6
|
-
return
|
|
7
|
-
},
|
|
1
|
+
import { openBlock as d, createElementBlock as u, createElementVNode as t, renderSlot as k, createCommentVNode as m, Fragment as y, normalizeClass as f, toDisplayString as h, renderList as x, createTextVNode as p, withModifiers as O, withDirectives as w, vModelText as $, vShow as T, createBlock as I, resolveDynamicComponent as D, mergeProps as j, withCtx as B, ref as v, onMounted as P, provide as M, inject as E, pushScopeId as N, popScopeId as A, watch as q, resolveComponent as L, createVNode as F } from "vue";
|
|
2
|
+
const S = (e, r) => {
|
|
3
|
+
const l = e.__vccOpts || e;
|
|
4
|
+
for (const [i, a] of r)
|
|
5
|
+
l[i] = a;
|
|
6
|
+
return l;
|
|
7
|
+
}, R = {
|
|
8
8
|
name: "Card"
|
|
9
|
-
},
|
|
9
|
+
}, K = { class: "flex flex-col gap-9" }, U = { class: "bg-white border rounded-lg border-stroke shadow-default dark:border-strokedark dark:bg-boxdark" }, z = { class: "px-3 py-4 border-b border-stroke dark:border-strokedark" }, X = { class: "font-semibold text-black dark:text-white" }, Y = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "p-6"
|
|
12
12
|
};
|
|
13
|
-
function
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
function H(e, r, l, i, a, s) {
|
|
14
|
+
return d(), u("div", K, [
|
|
15
|
+
t("div", U, [
|
|
16
|
+
t("div", z, [
|
|
17
|
+
t("h3", X, [
|
|
18
|
+
k(e.$slots, "header")
|
|
19
19
|
])
|
|
20
20
|
]),
|
|
21
|
-
e.$slots.body ? (
|
|
22
|
-
|
|
23
|
-
])) :
|
|
21
|
+
e.$slots.body ? (d(), u("div", Y, [
|
|
22
|
+
k(e.$slots, "body")
|
|
23
|
+
])) : m("", !0)
|
|
24
24
|
])
|
|
25
25
|
]);
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const rs = /* @__PURE__ */ S(R, [["render", H]]), J = {
|
|
28
|
+
name: "MultiSelectDropdown",
|
|
29
|
+
template: "MultiSelectDropdown",
|
|
30
|
+
props: {
|
|
31
|
+
modelValue: {
|
|
32
|
+
type: [String, Number],
|
|
33
|
+
default: ""
|
|
34
|
+
},
|
|
35
|
+
default_value: {
|
|
36
|
+
type: Array,
|
|
37
|
+
default: []
|
|
38
|
+
},
|
|
39
|
+
field_name: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: ""
|
|
42
|
+
},
|
|
43
|
+
is_required: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !1
|
|
46
|
+
},
|
|
47
|
+
has_cancel: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: !0
|
|
50
|
+
},
|
|
51
|
+
label_name: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: ""
|
|
54
|
+
},
|
|
55
|
+
options: {
|
|
56
|
+
type: Array,
|
|
57
|
+
required: !0,
|
|
58
|
+
default: [],
|
|
59
|
+
note: "Options of dropdown. An array of options with id and name"
|
|
60
|
+
},
|
|
61
|
+
placeholder: {
|
|
62
|
+
type: String,
|
|
63
|
+
required: !1,
|
|
64
|
+
default: "Please select an option",
|
|
65
|
+
note: "Placeholder of dropdown"
|
|
66
|
+
},
|
|
67
|
+
maxItem: {
|
|
68
|
+
type: Number,
|
|
69
|
+
required: !1,
|
|
70
|
+
default: 100,
|
|
71
|
+
note: "Max items showing"
|
|
72
|
+
},
|
|
73
|
+
show: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: !1
|
|
76
|
+
},
|
|
77
|
+
error_message: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: ""
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
data() {
|
|
83
|
+
return {
|
|
84
|
+
selected: [],
|
|
85
|
+
count: 0,
|
|
86
|
+
optionsShown: !1,
|
|
87
|
+
// options_values: [],
|
|
88
|
+
searchFilter: "",
|
|
89
|
+
selectedIds: []
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
created() {
|
|
93
|
+
this.$emit("selected", this.selected);
|
|
94
|
+
},
|
|
95
|
+
mounted() {
|
|
96
|
+
self = this;
|
|
97
|
+
var e = this.convertedOptionsDefault();
|
|
98
|
+
this.selected = this.options_values.filter(
|
|
99
|
+
(r) => e.includes(r.id + "")
|
|
100
|
+
), this.show || (document.body.addEventListener("click", function(r) {
|
|
101
|
+
self.clearData(r);
|
|
102
|
+
}), document.getElementById(this.field_name + "search").addEventListener("keydown", function(r) {
|
|
103
|
+
if (_.includes([37, 38, 39, 40, 13], r.keyCode)) {
|
|
104
|
+
if ((r.keyCode === 38 || r.keyCode === 40) && r.preventDefault(), r.keyCode === 40 && self.posts == "")
|
|
105
|
+
return;
|
|
106
|
+
self.selectItem(r.keyCode);
|
|
107
|
+
}
|
|
108
|
+
}), document.addEventListener("keypress", function(r) {
|
|
109
|
+
r.key === "Enter" && r.target.form && r.preventDefault();
|
|
110
|
+
}));
|
|
111
|
+
},
|
|
112
|
+
computed: {
|
|
113
|
+
options_values() {
|
|
114
|
+
return this.convertedOptions();
|
|
115
|
+
},
|
|
116
|
+
filteredOptions() {
|
|
117
|
+
const e = [], r = new RegExp(this.searchFilter, "ig");
|
|
118
|
+
for (const l of this.options_values) {
|
|
119
|
+
const i = String(l.name);
|
|
120
|
+
(this.searchFilter.length < 1 || i.match(r)) && e.length < this.maxItem && e.push(l);
|
|
121
|
+
}
|
|
122
|
+
return e;
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
emits: ["update:modelValue", "selected"],
|
|
126
|
+
methods: {
|
|
127
|
+
selectAll() {
|
|
128
|
+
this.selected = this.convertedOptions();
|
|
129
|
+
},
|
|
130
|
+
deselectAll() {
|
|
131
|
+
this.selected = [];
|
|
132
|
+
},
|
|
133
|
+
isOptionSelected(e) {
|
|
134
|
+
return this.selected.findIndex((r) => r.id === e) !== -1;
|
|
135
|
+
},
|
|
136
|
+
clearData: function(e) {
|
|
137
|
+
e.target.id != this.field_name + "search" && e.target.id != this.field_name && !e.target.classList.contains("showOptions") && (this.exit(), this.count = 0);
|
|
138
|
+
},
|
|
139
|
+
selectItem: function(e) {
|
|
140
|
+
e == 40 && this.count < this.filteredOptions.length && (this.count++, document.getElementById(this.count).scrollIntoView()), e == 38 && this.count > 1 && (this.count--, document.getElementById(this.count).scrollIntoView()), e == 13 && document.getElementById(this.count).click();
|
|
141
|
+
},
|
|
142
|
+
convertedOptions() {
|
|
143
|
+
return this.options.map((e, r) => typeof e == "object" ? e : { id: e, name: e });
|
|
144
|
+
},
|
|
145
|
+
convertedOptionsDefault() {
|
|
146
|
+
return this.default_value.map((e, r) => typeof e == "object" ? e.id + "" : e + "");
|
|
147
|
+
},
|
|
148
|
+
clearOption(e) {
|
|
149
|
+
let r = this.selected.findIndex((l) => l.id === e.id);
|
|
150
|
+
r !== -1 && this.selected.splice(r, 1), this.selectedIds = this.selected.map((l) => l.id), this.$emit("update:modelValue", this.selectedIds), this.$emit("selected", this.selectedIds);
|
|
151
|
+
},
|
|
152
|
+
selectOption(e) {
|
|
153
|
+
let r = this.selected.findIndex((l) => l.id === e.id);
|
|
154
|
+
r !== -1 ? this.selected.splice(r, 1) : this.selected.push(e), this.selectedIds = this.selected.map((l) => l.id), this.$emit("update:modelValue", this.selectedIds), this.$emit("selected", this.selectedIds);
|
|
155
|
+
},
|
|
156
|
+
showOptions() {
|
|
157
|
+
this.show || (this.searchFilter = "", this.optionsShown = !0, this.$nextTick(() => {
|
|
158
|
+
this.$refs[this.field_name + "search"].focus();
|
|
159
|
+
}));
|
|
160
|
+
},
|
|
161
|
+
ClearInput() {
|
|
162
|
+
this.show || (this.selected = [], this.searchFilter = "", this.showOptions());
|
|
163
|
+
},
|
|
164
|
+
exit() {
|
|
165
|
+
this.selected || (this.selected = [], this.searchFilter = ""), this.optionsShown = !1;
|
|
166
|
+
},
|
|
167
|
+
// Selecting when pressing Enter
|
|
168
|
+
keyMonitor: function(e) {
|
|
169
|
+
if (_.includes([37, 38, 39, 40, 13], e.keyCode)) {
|
|
170
|
+
if ((e.keyCode === 38 || e.keyCode === 40) && e.preventDefault(), e.keyCode === 40 && self.posts == "")
|
|
171
|
+
return;
|
|
172
|
+
this.selectItem(e.keyCode);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
watch: {
|
|
177
|
+
searchFilter() {
|
|
178
|
+
this.filteredOptions.length;
|
|
179
|
+
},
|
|
180
|
+
selected(e) {
|
|
181
|
+
this.selectedIds = e.map((r) => r.id), this.$emit("update:modelValue", this.selectedIds), this.$emit("selected", this.selectedIds);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}, W = { class: "font-bold ptext-lg dark:text-white" }, Z = { class: "mt-3 mb-4" }, G = { class: "bg-blue-100 text-blue-800 text-sm font-medium mb-2 mt-2 me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300" }, Q = /* @__PURE__ */ t("hr", { class: "!opacity-100 bg-gray-200 border-0 dark:bg-gray-700" }, null, -1), ee = ["name", "value"], te = {
|
|
185
|
+
key: 0,
|
|
186
|
+
class: "dropdown"
|
|
187
|
+
}, re = {
|
|
188
|
+
class: "inline-flex ml-2 rounded-md shadow-sm",
|
|
189
|
+
role: "group"
|
|
190
|
+
}, le = { class: "border border-gray-200 rounded-lg focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:focus:ring-blue-500 dark:focus:border-blue-500" }, se = { class: "relative" }, ne = ["onClick"], oe = { class: "text-gray-700 bg-white dark:border-strokedark dark:bg-boxdark dark:text-gray-200 !border-b !border-t-0 !border-r !border-l absolute w-full z-[999999999] showOptions" }, ae = { class: "p-1" }, ie = /* @__PURE__ */ t("label", {
|
|
191
|
+
for: "default-search",
|
|
192
|
+
class: "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"
|
|
193
|
+
}, "Search", -1), de = { class: "relative" }, ue = /* @__PURE__ */ t("div", { class: "absolute inset-y-0 flex items-center pointer-events-none start-0 ps-3" }, [
|
|
194
|
+
/* @__PURE__ */ t("svg", {
|
|
195
|
+
class: "w-4 h-4 text-gray-500 dark:text-gray-400",
|
|
196
|
+
"aria-hidden": "true",
|
|
197
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
198
|
+
fill: "none",
|
|
199
|
+
viewBox: "0 0 20 20"
|
|
200
|
+
}, [
|
|
201
|
+
/* @__PURE__ */ t("path", {
|
|
202
|
+
stroke: "currentColor",
|
|
203
|
+
"stroke-linecap": "round",
|
|
204
|
+
"stroke-linejoin": "round",
|
|
205
|
+
"stroke-width": "2",
|
|
206
|
+
d: "m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"
|
|
207
|
+
})
|
|
208
|
+
])
|
|
209
|
+
], -1), ce = ["id"], he = { class: "overflow-y-auto max-h-64" }, fe = ["onClick", "onMousedown", "id"];
|
|
210
|
+
function me(e, r, l, i, a, s) {
|
|
211
|
+
return d(), u(y, null, [
|
|
212
|
+
l.show ? (d(), u("div", {
|
|
213
|
+
key: 0,
|
|
214
|
+
class: f(l.field_name)
|
|
215
|
+
}, [
|
|
216
|
+
t("h3", W, h(l.label_name), 1),
|
|
217
|
+
t("p", Z, [
|
|
218
|
+
(d(!0), u(y, null, x(a.selected, (o, n) => (d(), u("span", G, h(o.name), 1))), 256))
|
|
219
|
+
]),
|
|
220
|
+
Q
|
|
221
|
+
], 2)) : m("", !0),
|
|
222
|
+
l.show ? m("", !0) : (d(), u("div", {
|
|
223
|
+
key: 1,
|
|
224
|
+
class: f(["mb-4", l.field_name])
|
|
225
|
+
}, [
|
|
226
|
+
(d(!0), u(y, null, x(a.selectedIds, (o, n) => (d(), u("input", {
|
|
227
|
+
type: "hidden",
|
|
228
|
+
name: l.field_name + "[]",
|
|
229
|
+
key: n,
|
|
230
|
+
value: o
|
|
231
|
+
}, null, 8, ee))), 128)),
|
|
232
|
+
l.options ? (d(), u("div", te, [
|
|
233
|
+
t("label", {
|
|
234
|
+
class: f({
|
|
235
|
+
"gl-label-form": l.error_message == "",
|
|
236
|
+
"gl-label-form-invalid": l.error_message !== "",
|
|
237
|
+
required: l.is_required
|
|
238
|
+
})
|
|
239
|
+
}, h(l.label_name), 3),
|
|
240
|
+
t("div", re, [
|
|
241
|
+
t("button", {
|
|
242
|
+
onClick: r[0] || (r[0] = (...o) => s.selectAll && s.selectAll(...o)),
|
|
243
|
+
type: "button",
|
|
244
|
+
class: "px-4 py-0 text-sm font-medium text-gray-900 bg-transparent border border-gray-900 rounded-s-md hover:bg-gray-900 hover:text-white focus:z-10 focus:bg-gray-900 focus:text-white dark:border-white dark:text-white dark:hover:text-white dark:hover:bg-gray-700 dark:focus:bg-gray-700"
|
|
245
|
+
}, " Select all "),
|
|
246
|
+
t("button", {
|
|
247
|
+
onClick: r[1] || (r[1] = (...o) => s.deselectAll && s.deselectAll(...o)),
|
|
248
|
+
type: "button",
|
|
249
|
+
class: "px-4 py-0 text-sm font-medium text-gray-900 bg-transparent border border-gray-900 rounded-e-md hover:bg-gray-900 hover:text-white focus:z-10 focus:bg-gray-900 focus:text-white dark:border-white dark:text-white dark:hover:text-white dark:hover:bg-gray-700 dark:focus:bg-gray-700"
|
|
250
|
+
}, " Deselect all ")
|
|
251
|
+
]),
|
|
252
|
+
t("div", le, [
|
|
253
|
+
t("div", se, [
|
|
254
|
+
t("div", {
|
|
255
|
+
class: "flex flex-wrap gap-2 pl-8 pr-2 gl-multi-dropdown showOptions",
|
|
256
|
+
onClick: r[2] || (r[2] = (o) => s.showOptions())
|
|
257
|
+
}, [
|
|
258
|
+
(d(!0), u(y, null, x(a.selected, (o, n) => (d(), u("span", {
|
|
259
|
+
key: n,
|
|
260
|
+
class: "px-2 py-1 text-xs font-medium text-blue-800 bg-blue-100 rounded pointer-events-none dark:bg-blue-900 dark:text-blue-300"
|
|
261
|
+
}, [
|
|
262
|
+
p(h(o.name) + " ", 1),
|
|
263
|
+
t("i", {
|
|
264
|
+
onClick: O((c) => s.clearOption(o), ["stop"]),
|
|
265
|
+
class: "cursor-pointer pointer-events-auto hover:text-red-600 dark:hover:text-red-400 fas fa-times"
|
|
266
|
+
}, null, 8, ne)
|
|
267
|
+
]))), 128))
|
|
268
|
+
]),
|
|
269
|
+
t("i", {
|
|
270
|
+
class: f([a.optionsShown ? "fa-angle-up" : "fa-angle-down", "absolute text-xl text-gray-500 cursor-pointer fas right-2 hover:text-gray-700"]),
|
|
271
|
+
style: { top: "11px" }
|
|
272
|
+
}, null, 2)
|
|
273
|
+
]),
|
|
274
|
+
w(t("div", oe, [
|
|
275
|
+
t("div", ae, [
|
|
276
|
+
ie,
|
|
277
|
+
t("div", de, [
|
|
278
|
+
ue,
|
|
279
|
+
w(t("input", {
|
|
280
|
+
type: "search",
|
|
281
|
+
"onUpdate:modelValue": r[3] || (r[3] = (o) => a.searchFilter = o),
|
|
282
|
+
id: l.field_name + "search",
|
|
283
|
+
ref: l.field_name + "search",
|
|
284
|
+
onBlur: r[4] || (r[4] = (o) => s.exit()),
|
|
285
|
+
autocomplete: "off",
|
|
286
|
+
class: "block w-full p-2 text-sm text-gray-900 border border-gray-300 rounded-lg ps-10 bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",
|
|
287
|
+
placeholder: "Search ..."
|
|
288
|
+
}, null, 40, ce), [
|
|
289
|
+
[$, a.searchFilter]
|
|
290
|
+
])
|
|
291
|
+
])
|
|
292
|
+
]),
|
|
293
|
+
t("div", he, [
|
|
294
|
+
(d(!0), u(y, null, x(s.filteredOptions, (o, n) => (d(), u("div", {
|
|
295
|
+
class: f([
|
|
296
|
+
"block px-2 py-2 text-xs leading-4 text-gray-700 no-underline cursor-pointer dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white",
|
|
297
|
+
n + 1 == a.count || s.isOptionSelected(o.id) ? "bg-gray-100 dark:bg-gray-600" : ""
|
|
298
|
+
]),
|
|
299
|
+
onClick: (c) => s.selectOption(o),
|
|
300
|
+
onMousedown: (c) => s.selectOption(o),
|
|
301
|
+
key: n,
|
|
302
|
+
id: n + 1
|
|
303
|
+
}, h(o.name || o.id || "-"), 43, fe))), 128))
|
|
304
|
+
])
|
|
305
|
+
], 512), [
|
|
306
|
+
[T, a.optionsShown]
|
|
307
|
+
])
|
|
308
|
+
])
|
|
309
|
+
])) : m("", !0)
|
|
310
|
+
], 2))
|
|
311
|
+
], 64);
|
|
312
|
+
}
|
|
313
|
+
const ls = /* @__PURE__ */ S(J, [["render", me]]), ge = {
|
|
314
|
+
props: {
|
|
315
|
+
button_type: {
|
|
316
|
+
type: String,
|
|
317
|
+
default: "default"
|
|
318
|
+
},
|
|
319
|
+
is_submit: {
|
|
320
|
+
type: Boolean,
|
|
321
|
+
default: !1
|
|
322
|
+
},
|
|
323
|
+
icon: {
|
|
324
|
+
type: String,
|
|
325
|
+
default: ""
|
|
326
|
+
},
|
|
327
|
+
is_loading: {
|
|
328
|
+
type: Boolean,
|
|
329
|
+
default: !1
|
|
330
|
+
},
|
|
331
|
+
tag: {
|
|
332
|
+
type: String,
|
|
333
|
+
default: "button"
|
|
334
|
+
},
|
|
335
|
+
href: {
|
|
336
|
+
type: String,
|
|
337
|
+
default: ""
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
computed: {
|
|
341
|
+
buttonTypeClass() {
|
|
342
|
+
switch (this.button_type) {
|
|
343
|
+
case "default":
|
|
344
|
+
return "text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800";
|
|
345
|
+
case "alternative":
|
|
346
|
+
return " text-gray-900 bg-white border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700";
|
|
347
|
+
case "dark":
|
|
348
|
+
return "text-white bg-gray-800 hover:bg-gray-900 focus:ring-4 focus:ring-gray-300 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-700 dark:border-gray-700";
|
|
349
|
+
case "light":
|
|
350
|
+
return "text-gray-900 bg-white border border-gray-300 hover:bg-gray-100 focus:ring-4 focus:ring-gray-100 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700";
|
|
351
|
+
case "green":
|
|
352
|
+
return " text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800";
|
|
353
|
+
case "red":
|
|
354
|
+
return " text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900";
|
|
355
|
+
case "yellow":
|
|
356
|
+
return " text-white bg-yellow-400 hover:bg-yellow-500 focus:ring-4 focus:ring-yellow-300 dark:focus:ring-yellow-900";
|
|
357
|
+
case "purple":
|
|
358
|
+
return " text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-900";
|
|
359
|
+
default:
|
|
360
|
+
return "";
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
methods: {}
|
|
365
|
+
}, ye = /* @__PURE__ */ t("svg", {
|
|
366
|
+
"aria-hidden": "true",
|
|
367
|
+
role: "status",
|
|
368
|
+
class: "inline w-4 h-4 me-3 animate-spin",
|
|
369
|
+
viewBox: "0 0 100 101",
|
|
370
|
+
fill: "none",
|
|
371
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
372
|
+
}, [
|
|
373
|
+
/* @__PURE__ */ t("path", {
|
|
374
|
+
d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
|
|
375
|
+
fill: "currentColor"
|
|
376
|
+
}),
|
|
377
|
+
/* @__PURE__ */ t("path", {
|
|
378
|
+
d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
|
|
379
|
+
fill: "#1C64F2"
|
|
380
|
+
})
|
|
381
|
+
], -1);
|
|
382
|
+
function be(e, r, l, i, a, s) {
|
|
383
|
+
return l.is_loading ? (d(), I(D("button"), {
|
|
384
|
+
key: 1,
|
|
385
|
+
disabled: "",
|
|
386
|
+
class: f(`flex items-center gap-2 focus:outline-none text-sm px-2 py-2 me-2 font-medium rounded-lg ${s.buttonTypeClass}`)
|
|
387
|
+
}, {
|
|
388
|
+
default: B(() => [
|
|
389
|
+
ye,
|
|
390
|
+
p(" Loading... ")
|
|
391
|
+
]),
|
|
392
|
+
_: 1
|
|
393
|
+
}, 8, ["class"])) : (d(), I(D(l.tag), j({
|
|
394
|
+
key: 0,
|
|
395
|
+
type: l.is_submit
|
|
396
|
+
}, { type: l.is_submit ? "submit" : void 0 }, {
|
|
397
|
+
href: l.tag === "a" ? l.href : void 0,
|
|
398
|
+
class: `flex items-center gap-2 focus:outline-none text-sm px-5 py-2 me-2 font-medium rounded-lg ${s.buttonTypeClass}`
|
|
399
|
+
}), {
|
|
400
|
+
default: B(() => [
|
|
401
|
+
l.icon ? (d(), u("i", {
|
|
402
|
+
key: 0,
|
|
403
|
+
class: f([l.icon, "text-base"])
|
|
404
|
+
}, null, 2)) : m("", !0),
|
|
405
|
+
k(e.$slots, "default")
|
|
406
|
+
]),
|
|
407
|
+
_: 3
|
|
408
|
+
}, 16, ["type", "href", "class"]));
|
|
409
|
+
}
|
|
410
|
+
const ss = /* @__PURE__ */ S(ge, [["render", be]]), _e = { class: "font-bold ptext-lg dark:text-white" }, xe = ["name", "id"], we = ["id"], ve = /* @__PURE__ */ t("hr", { class: "!opacity-100 bg-gray-200 border-0 dark:bg-gray-700" }, null, -1), pe = ["for"], ke = /* @__PURE__ */ t("span", { class: "language-label js-language-label bg-blue-100 text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300" }, null, -1), Se = ["name", "id"], Ce = ["required", "name", "id", "type"], $e = { class: "gl-span-form-error" }, Pe = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" }, ns = {
|
|
411
|
+
__name: "TextareaTranslate",
|
|
412
|
+
props: {
|
|
413
|
+
is_required: {
|
|
414
|
+
type: Boolean,
|
|
415
|
+
default: !1
|
|
416
|
+
},
|
|
417
|
+
show: {
|
|
418
|
+
type: Boolean,
|
|
419
|
+
default: !1
|
|
420
|
+
},
|
|
421
|
+
error_message: {
|
|
422
|
+
type: String,
|
|
423
|
+
default: ""
|
|
424
|
+
},
|
|
425
|
+
model_value: {
|
|
426
|
+
type: [String, Number],
|
|
427
|
+
default: null
|
|
428
|
+
},
|
|
429
|
+
modelValue: {
|
|
430
|
+
type: [String, Number],
|
|
431
|
+
default: ""
|
|
432
|
+
},
|
|
433
|
+
model_value_translate: {
|
|
434
|
+
type: [String, Object],
|
|
435
|
+
default: null
|
|
436
|
+
},
|
|
437
|
+
modelValueTranslate: {
|
|
438
|
+
type: [String, Object],
|
|
439
|
+
default: ""
|
|
440
|
+
},
|
|
441
|
+
type: {
|
|
442
|
+
type: String,
|
|
443
|
+
default: "text"
|
|
444
|
+
},
|
|
445
|
+
field_name: {
|
|
446
|
+
type: String,
|
|
447
|
+
default: ""
|
|
448
|
+
},
|
|
449
|
+
label_name: {
|
|
450
|
+
type: String,
|
|
451
|
+
default: ""
|
|
452
|
+
},
|
|
453
|
+
get_field_translations: {
|
|
454
|
+
type: String,
|
|
455
|
+
default: ""
|
|
456
|
+
},
|
|
457
|
+
description: {
|
|
458
|
+
type: String,
|
|
459
|
+
default: ""
|
|
460
|
+
},
|
|
461
|
+
translatable: {
|
|
462
|
+
type: Object,
|
|
463
|
+
default: null
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
emits: ["update:modelValue", "update:modelValueTranslate", "keydown"],
|
|
467
|
+
setup(e, { expose: r, emit: l }) {
|
|
468
|
+
const i = e, a = l, s = v(null), o = v(null);
|
|
469
|
+
return P(() => {
|
|
470
|
+
s.value !== null && s.value.hasAttribute("autofocus") && s.value.focus(), i.model_value && (a("update:modelValue", i.model_value), s.value.value = i.model_value), i.model_value_translate, i.translatable && axios.post("/admin/get_field_translations", {
|
|
471
|
+
model: i.translatable.model,
|
|
472
|
+
row_id: i.translatable.row_id,
|
|
473
|
+
field: i.translatable.field
|
|
474
|
+
}).then((n) => {
|
|
475
|
+
o.value.value = JSON.stringify(n.data), a("update:modelValueTranslate", JSON.stringify(n.data)), console.log("input_translate", o.value.value);
|
|
476
|
+
}).catch((n) => {
|
|
477
|
+
console.log(n);
|
|
478
|
+
});
|
|
479
|
+
}), r({ focus: () => s.value.focus() }), (n, c) => (d(), u(y, null, [
|
|
480
|
+
e.show ? (d(), u("div", {
|
|
481
|
+
key: 0,
|
|
482
|
+
class: f(e.field_name)
|
|
483
|
+
}, [
|
|
484
|
+
t("h3", _e, h(e.label_name), 1),
|
|
485
|
+
w(t("input", {
|
|
486
|
+
type: "hidden",
|
|
487
|
+
"data-i18n": "true",
|
|
488
|
+
name: e.field_name + "_i18n",
|
|
489
|
+
id: e.field_name + "_i18n",
|
|
490
|
+
ref_key: "input_translate",
|
|
491
|
+
ref: o,
|
|
492
|
+
"onUpdate:modelValue": c[0] || (c[0] = (g) => n.inputTranslateValue = g)
|
|
493
|
+
}, null, 8, xe), [
|
|
494
|
+
[$, n.inputTranslateValue]
|
|
495
|
+
]),
|
|
496
|
+
t("p", {
|
|
497
|
+
id: e.field_name,
|
|
498
|
+
class: "mb-4 text-base text-gray-900 input_tr_show dark:text-white"
|
|
499
|
+
}, h(e.model_value), 9, we),
|
|
500
|
+
ve
|
|
501
|
+
], 2)) : m("", !0),
|
|
502
|
+
e.show ? m("", !0) : (d(), u("div", {
|
|
503
|
+
key: 1,
|
|
504
|
+
class: f(["mb-4", e.field_name])
|
|
505
|
+
}, [
|
|
506
|
+
t("label", {
|
|
507
|
+
class: f({
|
|
508
|
+
"gl-label-translation-form": e.error_message == "",
|
|
509
|
+
"gl-label-translation-form-invalid": e.error_message !== "",
|
|
510
|
+
required: e.is_required
|
|
511
|
+
}),
|
|
512
|
+
for: e.field_name
|
|
513
|
+
}, h(e.label_name), 11, pe),
|
|
514
|
+
ke,
|
|
515
|
+
t("input", {
|
|
516
|
+
class: "mb-4",
|
|
517
|
+
type: "hidden",
|
|
518
|
+
"data-i18n": "true",
|
|
519
|
+
name: e.field_name + "_i18n",
|
|
520
|
+
id: e.field_name + "_i18n",
|
|
521
|
+
onInput: c[1] || (c[1] = (g) => n.$emit("update:modelValueTranslate", g.target.value)),
|
|
522
|
+
ref_key: "input_translate",
|
|
523
|
+
ref: o
|
|
524
|
+
}, null, 40, Se),
|
|
525
|
+
t("textarea", {
|
|
526
|
+
required: e.is_required,
|
|
527
|
+
name: e.field_name,
|
|
528
|
+
id: e.field_name,
|
|
529
|
+
class: f({
|
|
530
|
+
" gl-textarea-form form-input-translation mt-4 ": e.error_message == "",
|
|
531
|
+
" gl-textarea-form-invalid form-input-translation mt-4 ": e.error_message !== ""
|
|
532
|
+
}),
|
|
533
|
+
type: e.type,
|
|
534
|
+
onInput: c[2] || (c[2] = (g) => n.$emit("update:modelValue", g.target.value)),
|
|
535
|
+
onKeydown: c[3] || (c[3] = (g) => n.$emit("keydown", g)),
|
|
536
|
+
ref_key: "input",
|
|
537
|
+
ref: s,
|
|
538
|
+
rows: "4"
|
|
539
|
+
}, `
|
|
540
|
+
`, 42, Ce),
|
|
541
|
+
t("span", $e, h(e.error_message), 1),
|
|
542
|
+
t("small", Pe, h(e.description), 1)
|
|
543
|
+
], 2))
|
|
544
|
+
], 64));
|
|
545
|
+
}
|
|
546
|
+
}, Te = { class: "font-bold ptext-lg dark:text-white" }, Oe = ["name", "id"], Ve = ["id"], Ie = /* @__PURE__ */ t("hr", { class: "!opacity-100 bg-gray-200 border-0 dark:bg-gray-700" }, null, -1), De = ["for"], Be = /* @__PURE__ */ t("span", { class: "language-label js-language-label bg-blue-100 text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300" }, null, -1), je = ["name", "id"], Me = ["name", "id", "type"], Ee = { class: "gl-span-form-error" }, Ne = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" }, os = {
|
|
547
|
+
__name: "TinymceTranslate",
|
|
548
|
+
props: {
|
|
549
|
+
is_required: {
|
|
550
|
+
type: Boolean,
|
|
551
|
+
default: !1
|
|
552
|
+
},
|
|
553
|
+
show: {
|
|
554
|
+
type: Boolean,
|
|
555
|
+
default: !1
|
|
556
|
+
},
|
|
557
|
+
error_message: {
|
|
558
|
+
type: String,
|
|
559
|
+
default: ""
|
|
560
|
+
},
|
|
561
|
+
model_value: {
|
|
562
|
+
type: [String, Number],
|
|
563
|
+
default: null
|
|
564
|
+
},
|
|
565
|
+
modelValue: {
|
|
566
|
+
type: [String, Number],
|
|
567
|
+
default: ""
|
|
568
|
+
},
|
|
569
|
+
model_value_translate: {
|
|
570
|
+
type: [String, Object],
|
|
571
|
+
default: null
|
|
572
|
+
},
|
|
573
|
+
modelValueTranslate: {
|
|
574
|
+
type: [String, Object],
|
|
575
|
+
default: ""
|
|
576
|
+
},
|
|
577
|
+
type: {
|
|
578
|
+
type: String,
|
|
579
|
+
default: "text"
|
|
580
|
+
},
|
|
581
|
+
field_name: {
|
|
582
|
+
type: String,
|
|
583
|
+
default: ""
|
|
584
|
+
},
|
|
585
|
+
label_name: {
|
|
586
|
+
type: String,
|
|
587
|
+
default: ""
|
|
588
|
+
},
|
|
589
|
+
get_field_translations: {
|
|
590
|
+
type: String,
|
|
591
|
+
default: ""
|
|
592
|
+
},
|
|
593
|
+
description: {
|
|
594
|
+
type: String,
|
|
595
|
+
default: ""
|
|
596
|
+
},
|
|
597
|
+
translatable: {
|
|
598
|
+
type: Object,
|
|
599
|
+
default: null
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
emits: ["update:modelValue", "update:modelValueTranslate", "keydown"],
|
|
603
|
+
setup(e, { expose: r, emit: l }) {
|
|
604
|
+
const i = e, a = l, s = v(null), o = v(null);
|
|
605
|
+
return P(() => {
|
|
606
|
+
tinymce.init({
|
|
607
|
+
selector: "#" + i.field_name,
|
|
608
|
+
width: "100%",
|
|
609
|
+
height: 300
|
|
610
|
+
}), console.log("tinymce ", i.model_value), s.value !== null && s.value.hasAttribute("autofocus") && s.value.focus(), i.model_value && (a("update:modelValue", i.model_value), s.value.value = i.model_value), i.model_value_translate, i.translatable && axios.post("/admin/get_field_translations", {
|
|
611
|
+
model: i.translatable.model,
|
|
612
|
+
row_id: i.translatable.row_id,
|
|
613
|
+
field: i.translatable.field
|
|
614
|
+
}).then((n) => {
|
|
615
|
+
o.value.value = JSON.stringify(n.data), a("update:modelValueTranslate", JSON.stringify(n.data));
|
|
616
|
+
}).catch((n) => {
|
|
617
|
+
console.log(n);
|
|
618
|
+
});
|
|
619
|
+
}), r({ focus: () => s.value.focus() }), (n, c) => (d(), u(y, null, [
|
|
620
|
+
e.show ? (d(), u("div", {
|
|
621
|
+
key: 0,
|
|
622
|
+
class: f(e.field_name)
|
|
623
|
+
}, [
|
|
624
|
+
t("h3", Te, h(e.label_name), 1),
|
|
625
|
+
w(t("input", {
|
|
626
|
+
type: "hidden",
|
|
627
|
+
"data-i18n": "true",
|
|
628
|
+
name: e.field_name + "_i18n",
|
|
629
|
+
id: e.field_name + "_i18n",
|
|
630
|
+
ref_key: "input_translate",
|
|
631
|
+
ref: o,
|
|
632
|
+
"onUpdate:modelValue": c[0] || (c[0] = (g) => n.inputTranslateValue = g)
|
|
633
|
+
}, null, 8, Oe), [
|
|
634
|
+
[$, n.inputTranslateValue]
|
|
635
|
+
]),
|
|
636
|
+
t("p", {
|
|
637
|
+
id: e.field_name,
|
|
638
|
+
class: "mb-4 text-base text-gray-900 input_tr_show dark:text-white"
|
|
639
|
+
}, h(e.model_value), 9, Ve),
|
|
640
|
+
Ie
|
|
641
|
+
], 2)) : m("", !0),
|
|
642
|
+
e.show ? m("", !0) : (d(), u("div", {
|
|
643
|
+
key: 1,
|
|
644
|
+
class: f(["mb-4", e.field_name])
|
|
645
|
+
}, [
|
|
646
|
+
t("label", {
|
|
647
|
+
class: f({
|
|
648
|
+
"gl-label-translation-form": e.error_message == "",
|
|
649
|
+
"gl-label-translation-form-invalid": e.error_message !== "",
|
|
650
|
+
required: e.is_required
|
|
651
|
+
}),
|
|
652
|
+
for: e.field_name
|
|
653
|
+
}, h(e.label_name), 11, De),
|
|
654
|
+
Be,
|
|
655
|
+
t("input", {
|
|
656
|
+
class: "mb-4",
|
|
657
|
+
type: "hidden",
|
|
658
|
+
"data-i18n": "true",
|
|
659
|
+
name: e.field_name + "_i18n",
|
|
660
|
+
id: e.field_name + "_i18n",
|
|
661
|
+
onInput: c[1] || (c[1] = (g) => n.$emit("update:modelValueTranslate", g.target.value)),
|
|
662
|
+
ref_key: "input_translate",
|
|
663
|
+
ref: o
|
|
664
|
+
}, null, 40, je),
|
|
665
|
+
t("textarea", {
|
|
666
|
+
name: e.field_name,
|
|
667
|
+
id: e.field_name,
|
|
668
|
+
class: f(["tiny", {
|
|
669
|
+
" gl-textarea-form form-input-translation mt-4 ": e.error_message == "",
|
|
670
|
+
" gl-textarea-form-invalid form-input-translation mt-4 ": e.error_message !== ""
|
|
671
|
+
}]),
|
|
672
|
+
type: e.type,
|
|
673
|
+
onInput: c[2] || (c[2] = (g) => n.$emit("update:modelValue", g.target.value)),
|
|
674
|
+
onKeydown: c[3] || (c[3] = (g) => n.$emit("keydown", g)),
|
|
675
|
+
ref_key: "input",
|
|
676
|
+
ref: s,
|
|
677
|
+
rows: "4"
|
|
678
|
+
}, `
|
|
679
|
+
`, 42, Me),
|
|
680
|
+
t("span", Ee, h(e.error_message), 1),
|
|
681
|
+
t("small", Ne, h(e.description), 1)
|
|
682
|
+
], 2))
|
|
683
|
+
], 64));
|
|
684
|
+
}
|
|
685
|
+
}, Ae = { class: "font-bold ptext-lg dark:text-white" }, qe = ["name", "id"], Le = ["id"], Fe = /* @__PURE__ */ t("hr", { class: "!opacity-100 bg-gray-200 border-0 dark:bg-gray-700" }, null, -1), Re = ["for"], Ke = /* @__PURE__ */ t("span", { class: "language-label js-language-label bg-blue-100 text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300" }, null, -1), Ue = ["name", "id"], ze = ["required", "name", "id", "type"], Xe = { class: "gl-span-form-error" }, Ye = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" }, as = {
|
|
686
|
+
__name: "TextTranslate",
|
|
687
|
+
props: {
|
|
688
|
+
is_required: {
|
|
689
|
+
type: Boolean,
|
|
690
|
+
default: !1
|
|
691
|
+
},
|
|
692
|
+
show: {
|
|
693
|
+
type: Boolean,
|
|
694
|
+
default: !1
|
|
695
|
+
},
|
|
696
|
+
error_message: {
|
|
697
|
+
type: String,
|
|
698
|
+
default: ""
|
|
699
|
+
},
|
|
700
|
+
model_value: {
|
|
701
|
+
type: [String, Number],
|
|
702
|
+
default: null
|
|
703
|
+
},
|
|
704
|
+
modelValue: {
|
|
705
|
+
type: [String, Number],
|
|
706
|
+
default: ""
|
|
707
|
+
},
|
|
708
|
+
model_value_translate: {
|
|
709
|
+
type: [String, Object],
|
|
710
|
+
default: null
|
|
711
|
+
},
|
|
712
|
+
modelValueTranslate: {
|
|
713
|
+
type: [String, Object],
|
|
714
|
+
default: ""
|
|
715
|
+
},
|
|
716
|
+
type: {
|
|
717
|
+
type: String,
|
|
718
|
+
default: "text"
|
|
719
|
+
},
|
|
720
|
+
field_name: {
|
|
721
|
+
type: String,
|
|
722
|
+
default: ""
|
|
723
|
+
},
|
|
724
|
+
label_name: {
|
|
725
|
+
type: String,
|
|
726
|
+
default: ""
|
|
727
|
+
},
|
|
728
|
+
get_field_translations: {
|
|
729
|
+
type: String,
|
|
730
|
+
default: ""
|
|
731
|
+
},
|
|
732
|
+
description: {
|
|
733
|
+
type: String,
|
|
734
|
+
default: ""
|
|
735
|
+
},
|
|
736
|
+
translatable: {
|
|
737
|
+
type: Object,
|
|
738
|
+
default: null
|
|
739
|
+
}
|
|
740
|
+
},
|
|
741
|
+
emits: ["update:modelValue", "update:modelValueTranslate", "keydown"],
|
|
742
|
+
setup(e, { expose: r, emit: l }) {
|
|
743
|
+
const i = e, a = l, s = v(null), o = v(null);
|
|
744
|
+
return P(() => {
|
|
745
|
+
s.value !== null && s.value.hasAttribute("autofocus") && s.value.focus(), i.model_value && (a("update:modelValue", i.model_value), s.value.value = i.model_value), i.model_value_translate, i.translatable && axios.post("/admin/get_field_translations", {
|
|
746
|
+
model: i.translatable.model,
|
|
747
|
+
row_id: i.translatable.row_id,
|
|
748
|
+
field: i.translatable.field
|
|
749
|
+
}).then((n) => {
|
|
750
|
+
o.value.value = JSON.stringify(n.data), a("update:modelValueTranslate", JSON.stringify(n.data));
|
|
751
|
+
}).catch((n) => {
|
|
752
|
+
console.log(n);
|
|
753
|
+
});
|
|
754
|
+
}), r({ focus: () => s.value.focus() }), (n, c) => (d(), u(y, null, [
|
|
755
|
+
e.show ? (d(), u("div", {
|
|
756
|
+
key: 0,
|
|
757
|
+
class: f(e.field_name)
|
|
758
|
+
}, [
|
|
759
|
+
t("h3", Ae, h(e.label_name), 1),
|
|
760
|
+
w(t("input", {
|
|
761
|
+
type: "hidden",
|
|
762
|
+
"data-i18n": "true",
|
|
763
|
+
name: e.field_name + "_i18n",
|
|
764
|
+
id: e.field_name + "_i18n",
|
|
765
|
+
ref: "input_translate_s",
|
|
766
|
+
"onUpdate:modelValue": c[0] || (c[0] = (g) => n.inputTranslateValue = g)
|
|
767
|
+
}, null, 8, qe), [
|
|
768
|
+
[$, n.inputTranslateValue]
|
|
769
|
+
]),
|
|
770
|
+
t("p", {
|
|
771
|
+
id: e.field_name,
|
|
772
|
+
class: "mb-4 text-base text-gray-900 input_tr_show dark:text-white"
|
|
773
|
+
}, h(e.model_value), 9, Le),
|
|
774
|
+
Fe
|
|
775
|
+
], 2)) : m("", !0),
|
|
776
|
+
e.show ? m("", !0) : (d(), u("div", {
|
|
777
|
+
key: 1,
|
|
778
|
+
class: f(["mb-4", e.field_name])
|
|
779
|
+
}, [
|
|
780
|
+
t("label", {
|
|
781
|
+
class: f({
|
|
782
|
+
"gl-label-translation-form": e.error_message == "",
|
|
783
|
+
"gl-label-translation-form-invalid": e.error_message !== "",
|
|
784
|
+
required: e.is_required
|
|
785
|
+
}),
|
|
786
|
+
for: e.field_name
|
|
787
|
+
}, h(e.label_name), 11, Re),
|
|
788
|
+
Ke,
|
|
789
|
+
t("input", {
|
|
790
|
+
class: "mb-4",
|
|
791
|
+
type: "hidden",
|
|
792
|
+
"data-i18n": "true",
|
|
793
|
+
name: e.field_name + "_i18n",
|
|
794
|
+
id: e.field_name + "_i18n",
|
|
795
|
+
onInput: c[1] || (c[1] = (g) => n.$emit("update:modelValueTranslate", g.target.value)),
|
|
796
|
+
ref_key: "input_translate",
|
|
797
|
+
ref: o
|
|
798
|
+
}, null, 40, Ue),
|
|
799
|
+
t("input", {
|
|
800
|
+
required: e.is_required,
|
|
801
|
+
name: e.field_name,
|
|
802
|
+
id: e.field_name,
|
|
803
|
+
class: f({
|
|
804
|
+
" gl-input-form form-input-translation mt-2 ": e.error_message == "",
|
|
805
|
+
" gl-input-form-invalid form-input-translation mt-2 ": e.error_message !== ""
|
|
806
|
+
}),
|
|
807
|
+
type: e.type,
|
|
808
|
+
onInput: c[2] || (c[2] = (g) => n.$emit("update:modelValue", g.target.value)),
|
|
809
|
+
onKeydown: c[3] || (c[3] = (g) => n.$emit("keydown", g)),
|
|
810
|
+
ref_key: "input",
|
|
811
|
+
ref: s
|
|
812
|
+
}, null, 42, ze),
|
|
813
|
+
t("span", Xe, h(e.error_message), 1),
|
|
814
|
+
t("small", Ye, h(e.description), 1)
|
|
815
|
+
], 2))
|
|
816
|
+
], 64));
|
|
817
|
+
}
|
|
818
|
+
}, He = { class: "font-bold ptext-lg dark:text-white" }, Je = { class: "mb-4 text-base text-gray-900 dark:text-white" }, We = /* @__PURE__ */ t("hr", { class: "!opacity-100 bg-gray-200 border-0 dark:bg-gray-700" }, null, -1), Ze = ["for"], Ge = ["required", "name", "id", "type"], Qe = { class: "gl-span-form-error" }, et = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" }, is = {
|
|
819
|
+
__name: "TextInput",
|
|
820
|
+
props: {
|
|
821
|
+
is_required: {
|
|
822
|
+
type: Boolean,
|
|
823
|
+
default: !1
|
|
824
|
+
},
|
|
825
|
+
show: {
|
|
826
|
+
type: Boolean,
|
|
827
|
+
default: !1
|
|
828
|
+
},
|
|
829
|
+
error_message: {
|
|
830
|
+
type: String,
|
|
831
|
+
default: ""
|
|
832
|
+
},
|
|
833
|
+
model_value: {
|
|
834
|
+
type: [String, Number],
|
|
835
|
+
default: ""
|
|
836
|
+
},
|
|
837
|
+
modelValue: {
|
|
838
|
+
type: [String, Number],
|
|
839
|
+
default: ""
|
|
840
|
+
},
|
|
841
|
+
type: {
|
|
842
|
+
type: String,
|
|
843
|
+
default: "text"
|
|
844
|
+
},
|
|
845
|
+
field_name: {
|
|
846
|
+
type: String,
|
|
847
|
+
default: ""
|
|
848
|
+
},
|
|
849
|
+
label_name: {
|
|
850
|
+
type: String,
|
|
851
|
+
default: ""
|
|
852
|
+
},
|
|
853
|
+
description: {
|
|
854
|
+
type: String,
|
|
855
|
+
default: ""
|
|
856
|
+
}
|
|
857
|
+
},
|
|
858
|
+
emits: ["update:modelValue", "keydown"],
|
|
859
|
+
setup(e, { expose: r, emit: l }) {
|
|
860
|
+
const i = e, a = l, s = v(null);
|
|
861
|
+
return P(() => {
|
|
862
|
+
s.value !== null && s.value.hasAttribute("autofocus") && s.value.focus(), i.model_value != "" && (a("update:modelValue", i.model_value), s.value.value = i.model_value), i.modelValue != "" && (a("update:modelValue", i.modelValue), s.value.value = i.modelValue);
|
|
863
|
+
}), r({ focus: () => s.value.focus() }), (o, n) => (d(), u(y, null, [
|
|
864
|
+
e.show ? (d(), u("div", {
|
|
865
|
+
key: 0,
|
|
866
|
+
class: f(e.field_name)
|
|
867
|
+
}, [
|
|
868
|
+
t("h3", He, h(e.label_name), 1),
|
|
869
|
+
t("p", Je, h(e.type == "password" ? e.model_value.replace(/./g, "*") : e.model_value), 1),
|
|
870
|
+
We
|
|
871
|
+
], 2)) : m("", !0),
|
|
872
|
+
e.show ? m("", !0) : (d(), u("div", {
|
|
873
|
+
key: 1,
|
|
874
|
+
class: f(["mb-4", e.field_name])
|
|
875
|
+
}, [
|
|
876
|
+
t("label", {
|
|
877
|
+
class: f({
|
|
878
|
+
"gl-label-form": e.error_message == "",
|
|
879
|
+
"gl-label-form-invalid": e.error_message !== "",
|
|
880
|
+
required: e.is_required
|
|
881
|
+
}),
|
|
882
|
+
for: e.field_name
|
|
883
|
+
}, h(e.label_name), 11, Ze),
|
|
884
|
+
t("input", {
|
|
885
|
+
required: e.is_required,
|
|
886
|
+
name: e.field_name,
|
|
887
|
+
id: e.field_name,
|
|
888
|
+
class: f({
|
|
889
|
+
"gl-input-form": e.error_message == "",
|
|
890
|
+
"gl-input-form-invalid": e.error_message !== ""
|
|
891
|
+
}),
|
|
892
|
+
type: e.type,
|
|
893
|
+
onInput: n[0] || (n[0] = (c) => o.$emit("update:modelValue", c.target.value)),
|
|
894
|
+
onKeydown: n[1] || (n[1] = (c) => o.$emit("keydown", c)),
|
|
895
|
+
ref_key: "input",
|
|
896
|
+
ref: s
|
|
897
|
+
}, null, 42, Ge),
|
|
898
|
+
t("span", Qe, h(e.error_message), 1),
|
|
899
|
+
t("small", et, h(e.description), 1)
|
|
900
|
+
], 2))
|
|
901
|
+
], 64));
|
|
902
|
+
}
|
|
903
|
+
}, tt = {
|
|
904
|
+
setup(e, { slots: r }) {
|
|
905
|
+
const l = v(r.default().map((a) => a.props)), i = v(l.value[0].title);
|
|
906
|
+
return M("selectedTitle", i), {
|
|
907
|
+
tabs: l,
|
|
908
|
+
selectedTitle: i
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
}, rt = { class: "flex flex-wrap" }, lt = { class: "w-full" }, st = { class: "flex flex-row flex-wrap gap-1 pt-3 pb-4 mb-0 list-none" }, nt = ["onClick"], ot = { class: "relative flex flex-col w-full min-w-0 mb-6 break-words bg-white rounded shadow-lg dark:border-strokedark dark:bg-boxdark" }, at = { class: "flex-auto px-4 py-5" }, it = { class: "tab-content tab-space" };
|
|
912
|
+
function dt(e, r, l, i, a, s) {
|
|
913
|
+
return d(), u(y, null, [
|
|
914
|
+
t("div", rt, [
|
|
915
|
+
t("div", lt, [
|
|
916
|
+
t("ul", st, [
|
|
917
|
+
(d(!0), u(y, null, x(i.tabs, (o) => (d(), u("li", {
|
|
918
|
+
key: o.title,
|
|
919
|
+
onClick: (n) => i.selectedTitle = o.title,
|
|
920
|
+
class: "flex-auto -mb-px text-center"
|
|
921
|
+
}, [
|
|
922
|
+
t("a", {
|
|
923
|
+
class: f([{ "text-slate-600 bg-white dark:bg-meta-4": i.selectedTitle != o.title, "text-white bg-slate-600 dark:bg-primary": i.selectedTitle === o.title }, "block px-5 py-3 text-xs font-bold leading-normal uppercase rounded shadow-lg hover:text-white tex hover:bg-slate-600 dark:hover:bg-primary dark:text-white tabs_buttons"])
|
|
924
|
+
}, [
|
|
925
|
+
t("i", {
|
|
926
|
+
class: f([o.icon, "mr-1 text-base"])
|
|
927
|
+
}, null, 2),
|
|
928
|
+
p(" " + h(o.title), 1)
|
|
929
|
+
], 2)
|
|
930
|
+
], 8, nt))), 128))
|
|
931
|
+
])
|
|
932
|
+
])
|
|
933
|
+
]),
|
|
934
|
+
t("div", ot, [
|
|
935
|
+
t("div", at, [
|
|
936
|
+
t("div", it, [
|
|
937
|
+
k(e.$slots, "default")
|
|
938
|
+
])
|
|
939
|
+
])
|
|
940
|
+
])
|
|
941
|
+
], 64);
|
|
942
|
+
}
|
|
943
|
+
const ds = /* @__PURE__ */ S(tt, [["render", dt]]), ut = {
|
|
944
|
+
props: ["title"],
|
|
945
|
+
setup() {
|
|
946
|
+
return {
|
|
947
|
+
selectedTitle: E("selectedTitle")
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
}, ct = { class: "block" };
|
|
951
|
+
function ht(e, r, l, i, a, s) {
|
|
952
|
+
return w((d(), u("div", ct, [
|
|
953
|
+
k(e.$slots, "default")
|
|
954
|
+
], 512)), [
|
|
955
|
+
[T, l.title == i.selectedTitle]
|
|
956
|
+
]);
|
|
957
|
+
}
|
|
958
|
+
const us = /* @__PURE__ */ S(ut, [["render", ht]]), ft = {
|
|
959
|
+
props: {
|
|
960
|
+
elements_to_show_prop: {
|
|
961
|
+
type: Number,
|
|
962
|
+
default: 3
|
|
963
|
+
},
|
|
964
|
+
hide_arrow: {
|
|
965
|
+
type: Boolean,
|
|
966
|
+
default: !1
|
|
967
|
+
},
|
|
968
|
+
disable_touch: {
|
|
969
|
+
type: Boolean,
|
|
970
|
+
default: !1
|
|
971
|
+
},
|
|
972
|
+
direction_property: {
|
|
973
|
+
type: String,
|
|
974
|
+
default: "ltr"
|
|
975
|
+
// Default to left-to-right
|
|
976
|
+
},
|
|
977
|
+
slider_arrows_indicators_position: {
|
|
978
|
+
type: String,
|
|
979
|
+
default: "arrows_outside_slider"
|
|
980
|
+
// arrows_outside_slide,arrows_indicators_inside_slider,arrows_indicators_below_slider
|
|
981
|
+
}
|
|
982
|
+
},
|
|
983
|
+
data: function() {
|
|
984
|
+
return {
|
|
985
|
+
elementsToShow: 3,
|
|
986
|
+
dotsNum: 0,
|
|
987
|
+
currentDot: 1,
|
|
988
|
+
dotsNavigation: [],
|
|
989
|
+
touchStartX: 0,
|
|
990
|
+
isMoving: !1,
|
|
991
|
+
initialX: 0,
|
|
992
|
+
initialY: 0,
|
|
993
|
+
Random_string: this.generateRandomString(6)
|
|
994
|
+
};
|
|
995
|
+
},
|
|
996
|
+
mounted() {
|
|
997
|
+
this.elementsToShow = this.elements_to_show_prop, this.initSlider(), this.disable_touch || this.movingActions();
|
|
998
|
+
},
|
|
999
|
+
methods: {
|
|
1000
|
+
sliderIndicatorsAction() {
|
|
1001
|
+
var e = "";
|
|
1002
|
+
return this.direction_property == "rtl" ? (e += " space-x-reverse ", e += " slider_indicators ") : this.slider_arrows_indicators_position == "arrows_indicators_inside_slider" && (e += " slider_indicators "), e;
|
|
1003
|
+
},
|
|
1004
|
+
sliderContainerAction() {
|
|
1005
|
+
var e = "";
|
|
1006
|
+
return !this.hide_arrow && this.slider_arrows_indicators_position == "arrows_outside_slider" ? e += " w-12/12 xl:w-8/12 xxl:w-8/12 md:w-8/12 sm:w-8/12" : this.slider_arrows_indicators_position != "arrows_outside_slider" && (e += " w-12/12 "), e;
|
|
1007
|
+
},
|
|
1008
|
+
generateRandomString(e) {
|
|
1009
|
+
let r = "";
|
|
1010
|
+
const l = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", i = l.length;
|
|
1011
|
+
for (let a = 0; a < e; a++)
|
|
1012
|
+
r += l.charAt(Math.floor(Math.random() * i));
|
|
1013
|
+
return r;
|
|
1014
|
+
},
|
|
1015
|
+
movingActions() {
|
|
1016
|
+
let e = this, r = document.getElementById("slider_" + this.Random_string);
|
|
1017
|
+
const l = (a) => {
|
|
1018
|
+
r.style.cursor = "grabbing";
|
|
1019
|
+
const s = (n) => {
|
|
1020
|
+
const c = n.clientX || n.touches && n.touches[0] && n.touches[0].clientX, g = n.clientY || n.touches && n.touches[0] && n.touches[0].clientY, C = c - e.initialX, V = g - e.initialY;
|
|
1021
|
+
Math.abs(C) > Math.abs(V) ? (n.preventDefault(), Math.abs(C) >= 70 && (C < 0 ? e.next() : e.prev(), e.initialX = c)) : r.style.cursor = "grab", Math.abs(V) > Math.abs(C) && (r.style.cursor = "grab");
|
|
1022
|
+
}, o = () => {
|
|
1023
|
+
document.removeEventListener("mousemove", s), document.removeEventListener("touchmove", s), document.removeEventListener("mouseup", o), document.removeEventListener("touchend", o), r.style.cursor = "grab";
|
|
1024
|
+
};
|
|
1025
|
+
document.addEventListener("mousemove", s), document.addEventListener("touchmove", s, { passive: !1 }), document.addEventListener("mouseup", o), document.addEventListener("touchend", o), e.initialX = a.clientX || a.touches && a.touches[0] && a.touches[0].clientX, e.initialY = a.clientY || a.touches && a.touches[0] && a.touches[0].clientY;
|
|
1026
|
+
}, i = (a) => {
|
|
1027
|
+
a.key === "ArrowLeft" ? e.prev() : a.key === "ArrowRight" && e.next();
|
|
1028
|
+
};
|
|
1029
|
+
r.addEventListener("mousedown", l), r.addEventListener("touchstart", l), document.addEventListener("keydown", i);
|
|
1030
|
+
},
|
|
1031
|
+
next() {
|
|
1032
|
+
this.currentDot < this.dotsNavigation.length && (this.currentDot++, this.setDot(this.currentDot));
|
|
1033
|
+
},
|
|
1034
|
+
prev() {
|
|
1035
|
+
this.currentDot > 1 && (this.currentDot--, this.setDot(this.currentDot));
|
|
1036
|
+
},
|
|
1037
|
+
initSlider() {
|
|
1038
|
+
let e = document.getElementById("sliderContainer_" + this.Random_string), r = document.getElementById("mainSliderContainer_" + this.Random_string), l = document.getElementById("slider_" + this.Random_string), i = l.querySelectorAll("li"), a = Array.from(i).filter((n) => n.parentNode === l), s = e.clientWidth, o = s / this.elementsToShow;
|
|
1039
|
+
if (this.elementsToShow > 1 ? document.body.clientWidth < 1e3 ? (this.elementsToShow = 1, o = this.hide_arrow ? r.clientWidth : s) : document.body.clientWidth < 1500 && (this.elementsToShow = 2) : (this.elementsToShow = 1, o = this.hide_arrow ? r.clientWidth : s), a.length > 1) {
|
|
1040
|
+
this.dotsNum = this.elementsToShow == 1 ? a.length : a.length - this.elementsToShow + 1;
|
|
1041
|
+
let n = this.elementsToShow == 1 ? o * a.length / this.dotsNum : o * (a.length - this.elementsToShow) / (this.dotsNum - 1);
|
|
1042
|
+
this.dotsNavigation = [];
|
|
1043
|
+
for (let c = 0; c < this.dotsNum; c++)
|
|
1044
|
+
this.dotsNavigation.push(n * c);
|
|
1045
|
+
}
|
|
1046
|
+
l.style.width = a.length * o + "px", l.style.transition = "margin", l.style.transitionDuration = "1s";
|
|
1047
|
+
for (let n = 0; n < a.length; n++) {
|
|
1048
|
+
const c = a[n];
|
|
1049
|
+
c.style.width = o + "px";
|
|
1050
|
+
}
|
|
1051
|
+
},
|
|
1052
|
+
setDot(e) {
|
|
1053
|
+
let r = document.getElementById("slider_" + this.Random_string);
|
|
1054
|
+
this.direction_property == "rtl" ? r.style.marginRight = -this.dotsNavigation[e - 1] + "px" : r.style.marginLeft = -this.dotsNavigation[e - 1] + "px", this.currentDot = e;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
}, b = (e) => (N("data-v-02efc15f"), e = e(), A(), e), mt = ["id"], gt = {
|
|
1058
|
+
key: 0,
|
|
1059
|
+
class: "items-center hidden w-2/12 xl:flex xxl:flex md:flex sm:flex arrow_button"
|
|
1060
|
+
}, yt = { class: "w-full" }, bt = {
|
|
1061
|
+
key: 0,
|
|
1062
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1063
|
+
class: "w-6 h-6",
|
|
1064
|
+
fill: "none",
|
|
1065
|
+
viewBox: "0 0 24 24",
|
|
1066
|
+
stroke: "currentColor",
|
|
1067
|
+
"stroke-width": "2"
|
|
1068
|
+
}, _t = /* @__PURE__ */ b(() => /* @__PURE__ */ t("path", {
|
|
1069
|
+
"stroke-linecap": "round",
|
|
1070
|
+
"stroke-linejoin": "round",
|
|
1071
|
+
d: "M11 17l-5-5m0 0l5-5m-5 5h12"
|
|
1072
|
+
}, null, -1)), xt = [
|
|
1073
|
+
_t
|
|
1074
|
+
], wt = {
|
|
1075
|
+
key: 1,
|
|
1076
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1077
|
+
class: "w-6 h-6",
|
|
1078
|
+
fill: "none",
|
|
1079
|
+
viewBox: "0 0 24 24",
|
|
1080
|
+
stroke: "currentColor",
|
|
1081
|
+
"stroke-width": "2"
|
|
1082
|
+
}, vt = /* @__PURE__ */ b(() => /* @__PURE__ */ t("path", {
|
|
1083
|
+
"stroke-linecap": "round",
|
|
1084
|
+
"stroke-linejoin": "round",
|
|
1085
|
+
d: "M13 7l5 5m0 0l-5 5m5-5H6"
|
|
1086
|
+
}, null, -1)), pt = [
|
|
1087
|
+
vt
|
|
1088
|
+
], kt = ["id"], St = ["id"], Ct = { class: "w-full" }, $t = {
|
|
1089
|
+
key: 0,
|
|
1090
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1091
|
+
class: "w-6 h-6",
|
|
1092
|
+
fill: "none",
|
|
1093
|
+
viewBox: "0 0 24 24",
|
|
1094
|
+
stroke: "currentColor",
|
|
1095
|
+
"stroke-width": "2"
|
|
1096
|
+
}, Pt = /* @__PURE__ */ b(() => /* @__PURE__ */ t("path", {
|
|
1097
|
+
"stroke-linecap": "round",
|
|
1098
|
+
"stroke-linejoin": "round",
|
|
1099
|
+
d: "M11 17l-5-5m0 0l5-5m-5 5h12"
|
|
1100
|
+
}, null, -1)), Tt = [
|
|
1101
|
+
Pt
|
|
1102
|
+
], Ot = {
|
|
1103
|
+
key: 1,
|
|
1104
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1105
|
+
class: "w-6 h-6",
|
|
1106
|
+
fill: "none",
|
|
1107
|
+
viewBox: "0 0 24 24",
|
|
1108
|
+
stroke: "currentColor",
|
|
1109
|
+
"stroke-width": "2"
|
|
1110
|
+
}, Vt = /* @__PURE__ */ b(() => /* @__PURE__ */ t("path", {
|
|
1111
|
+
"stroke-linecap": "round",
|
|
1112
|
+
"stroke-linejoin": "round",
|
|
1113
|
+
d: "M13 7l5 5m0 0l-5 5m5-5H6"
|
|
1114
|
+
}, null, -1)), It = [
|
|
1115
|
+
Vt
|
|
1116
|
+
], Dt = { class: "w-full" }, Bt = {
|
|
1117
|
+
key: 0,
|
|
1118
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1119
|
+
class: "w-6 h-6",
|
|
1120
|
+
fill: "none",
|
|
1121
|
+
viewBox: "0 0 24 24",
|
|
1122
|
+
stroke: "currentColor",
|
|
1123
|
+
"stroke-width": "2"
|
|
1124
|
+
}, jt = /* @__PURE__ */ b(() => /* @__PURE__ */ t("path", {
|
|
1125
|
+
"stroke-linecap": "round",
|
|
1126
|
+
"stroke-linejoin": "round",
|
|
1127
|
+
d: "M13 7l5 5m0 0l-5 5m5-5H6"
|
|
1128
|
+
}, null, -1)), Mt = [
|
|
1129
|
+
jt
|
|
1130
|
+
], Et = {
|
|
1131
|
+
key: 1,
|
|
1132
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1133
|
+
class: "w-6 h-6",
|
|
1134
|
+
fill: "none",
|
|
1135
|
+
viewBox: "0 0 24 24",
|
|
1136
|
+
stroke: "currentColor",
|
|
1137
|
+
"stroke-width": "2"
|
|
1138
|
+
}, Nt = /* @__PURE__ */ b(() => /* @__PURE__ */ t("path", {
|
|
1139
|
+
"stroke-linecap": "round",
|
|
1140
|
+
"stroke-linejoin": "round",
|
|
1141
|
+
d: "M11 17l-5-5m0 0l5-5m-5 5h12"
|
|
1142
|
+
}, null, -1)), At = [
|
|
1143
|
+
Nt
|
|
1144
|
+
], qt = ["onClick"], Lt = /* @__PURE__ */ b(() => /* @__PURE__ */ t("span", null, null, -1)), Ft = [
|
|
1145
|
+
Lt
|
|
1146
|
+
], Rt = {
|
|
1147
|
+
key: 1,
|
|
1148
|
+
class: "flex justify-between pl-5 pr-5"
|
|
1149
|
+
}, Kt = ["onClick"], Ut = /* @__PURE__ */ b(() => /* @__PURE__ */ t("span", null, null, -1)), zt = [
|
|
1150
|
+
Ut
|
|
1151
|
+
], Xt = {
|
|
1152
|
+
key: 0,
|
|
1153
|
+
class: "flex"
|
|
1154
|
+
}, Yt = { class: "flex items-center" }, Ht = { class: "w-full" }, Jt = {
|
|
1155
|
+
key: 0,
|
|
1156
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1157
|
+
class: "w-6 h-6",
|
|
1158
|
+
fill: "none",
|
|
1159
|
+
viewBox: "0 0 24 24",
|
|
1160
|
+
stroke: "currentColor",
|
|
1161
|
+
"stroke-width": "2"
|
|
1162
|
+
}, Wt = /* @__PURE__ */ b(() => /* @__PURE__ */ t("path", {
|
|
1163
|
+
"stroke-linecap": "round",
|
|
1164
|
+
"stroke-linejoin": "round",
|
|
1165
|
+
d: "M11 17l-5-5m0 0l5-5m-5 5h12"
|
|
1166
|
+
}, null, -1)), Zt = [
|
|
1167
|
+
Wt
|
|
1168
|
+
], Gt = {
|
|
1169
|
+
key: 1,
|
|
1170
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1171
|
+
class: "w-6 h-6",
|
|
1172
|
+
fill: "none",
|
|
1173
|
+
viewBox: "0 0 24 24",
|
|
1174
|
+
stroke: "currentColor",
|
|
1175
|
+
"stroke-width": "2"
|
|
1176
|
+
}, Qt = /* @__PURE__ */ b(() => /* @__PURE__ */ t("path", {
|
|
1177
|
+
"stroke-linecap": "round",
|
|
1178
|
+
"stroke-linejoin": "round",
|
|
1179
|
+
d: "M13 7l5 5m0 0l-5 5m5-5H6"
|
|
1180
|
+
}, null, -1)), er = [
|
|
1181
|
+
Qt
|
|
1182
|
+
], tr = { class: "flex items-center" }, rr = { class: "w-full" }, lr = {
|
|
1183
|
+
key: 0,
|
|
1184
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1185
|
+
class: "w-6 h-6",
|
|
1186
|
+
fill: "none",
|
|
1187
|
+
viewBox: "0 0 24 24",
|
|
1188
|
+
stroke: "currentColor",
|
|
1189
|
+
"stroke-width": "2"
|
|
1190
|
+
}, sr = /* @__PURE__ */ b(() => /* @__PURE__ */ t("path", {
|
|
1191
|
+
"stroke-linecap": "round",
|
|
1192
|
+
"stroke-linejoin": "round",
|
|
1193
|
+
d: "M13 7l5 5m0 0l-5 5m5-5H6"
|
|
1194
|
+
}, null, -1)), nr = [
|
|
1195
|
+
sr
|
|
1196
|
+
], or = {
|
|
1197
|
+
key: 1,
|
|
1198
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1199
|
+
class: "w-6 h-6",
|
|
1200
|
+
fill: "none",
|
|
1201
|
+
viewBox: "0 0 24 24",
|
|
1202
|
+
stroke: "currentColor",
|
|
1203
|
+
"stroke-width": "2"
|
|
1204
|
+
}, ar = /* @__PURE__ */ b(() => /* @__PURE__ */ t("path", {
|
|
1205
|
+
"stroke-linecap": "round",
|
|
1206
|
+
"stroke-linejoin": "round",
|
|
1207
|
+
d: "M11 17l-5-5m0 0l5-5m-5 5h12"
|
|
1208
|
+
}, null, -1)), ir = [
|
|
1209
|
+
ar
|
|
1210
|
+
], dr = {
|
|
1211
|
+
key: 1,
|
|
1212
|
+
class: "items-center hidden w-2/12 xl:flex xxl:flex md:flex sm:flex arrow_button"
|
|
1213
|
+
}, ur = { class: "w-full" }, cr = {
|
|
1214
|
+
key: 0,
|
|
1215
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1216
|
+
class: "w-6 h-6",
|
|
1217
|
+
fill: "none",
|
|
1218
|
+
viewBox: "0 0 24 24",
|
|
1219
|
+
stroke: "currentColor",
|
|
1220
|
+
"stroke-width": "2"
|
|
1221
|
+
}, hr = /* @__PURE__ */ b(() => /* @__PURE__ */ t("path", {
|
|
1222
|
+
"stroke-linecap": "round",
|
|
1223
|
+
"stroke-linejoin": "round",
|
|
1224
|
+
d: "M13 7l5 5m0 0l-5 5m5-5H6"
|
|
1225
|
+
}, null, -1)), fr = [
|
|
1226
|
+
hr
|
|
1227
|
+
], mr = {
|
|
1228
|
+
key: 1,
|
|
1229
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1230
|
+
class: "w-6 h-6",
|
|
1231
|
+
fill: "none",
|
|
1232
|
+
viewBox: "0 0 24 24",
|
|
1233
|
+
stroke: "currentColor",
|
|
1234
|
+
"stroke-width": "2"
|
|
1235
|
+
}, gr = /* @__PURE__ */ b(() => /* @__PURE__ */ t("path", {
|
|
1236
|
+
"stroke-linecap": "round",
|
|
1237
|
+
"stroke-linejoin": "round",
|
|
1238
|
+
d: "M11 17l-5-5m0 0l5-5m-5 5h12"
|
|
1239
|
+
}, null, -1)), yr = [
|
|
1240
|
+
gr
|
|
1241
|
+
];
|
|
1242
|
+
function br(e, r, l, i, a, s) {
|
|
1243
|
+
return d(), u("div", null, [
|
|
1244
|
+
t("div", {
|
|
1245
|
+
class: f(["", !l.hide_arrow && l.slider_arrows_indicators_position == "arrows_outside_slide" ? "flex" : "relative block"]),
|
|
1246
|
+
id: "mainSliderContainer_" + e.Random_string
|
|
1247
|
+
}, [
|
|
1248
|
+
e.dotsNum > 0 && !l.hide_arrow && l.slider_arrows_indicators_position == "arrows_outside_slider" ? (d(), u("div", gt, [
|
|
1249
|
+
t("div", yt, [
|
|
1250
|
+
t("button", {
|
|
1251
|
+
class: "p-3 mr-5 rounded-full shadow-lg arrow_button_styles",
|
|
1252
|
+
onClick: r[0] || (r[0] = (o) => s.prev())
|
|
1253
|
+
}, [
|
|
1254
|
+
l.direction_property == "ltr" ? (d(), u("svg", bt, xt)) : m("", !0),
|
|
1255
|
+
l.direction_property == "rtl" ? (d(), u("svg", wt, pt)) : m("", !0)
|
|
1256
|
+
])
|
|
1257
|
+
])
|
|
1258
|
+
])) : m("", !0),
|
|
1259
|
+
t("div", {
|
|
1260
|
+
class: f(["overflow-hidden", s.sliderContainerAction()]),
|
|
1261
|
+
id: "sliderContainer_" + e.Random_string
|
|
1262
|
+
}, [
|
|
1263
|
+
t("ul", {
|
|
1264
|
+
class: "flex",
|
|
1265
|
+
id: "slider_" + e.Random_string
|
|
1266
|
+
}, [
|
|
1267
|
+
e.dotsNum > 0 && !l.hide_arrow && l.slider_arrows_indicators_position == "arrows_indicators_inside_slider" ? (d(), u("div", {
|
|
1268
|
+
key: 0,
|
|
1269
|
+
class: f(["items-center justify-center hidden arrow_button xl:flex xxl:flex md:flex sm:flex", l.direction_property == "rtl" ? "arrow_button_next" : "arrow_button_prev"])
|
|
1270
|
+
}, [
|
|
1271
|
+
t("div", Ct, [
|
|
1272
|
+
t("button", {
|
|
1273
|
+
class: "p-3 rounded-full shadow-lg arrow_button_styles",
|
|
1274
|
+
onClick: r[1] || (r[1] = O((o) => s.prev(), ["stop"]))
|
|
1275
|
+
}, [
|
|
1276
|
+
l.direction_property == "ltr" ? (d(), u("svg", $t, Tt)) : m("", !0),
|
|
1277
|
+
l.direction_property == "rtl" ? (d(), u("svg", Ot, It)) : m("", !0)
|
|
1278
|
+
])
|
|
1279
|
+
])
|
|
1280
|
+
], 2)) : m("", !0),
|
|
1281
|
+
k(e.$slots, "default", {}, void 0, !0),
|
|
1282
|
+
e.dotsNum > 0 && !l.hide_arrow && l.slider_arrows_indicators_position == "arrows_indicators_inside_slider" ? (d(), u("div", {
|
|
1283
|
+
key: 1,
|
|
1284
|
+
class: f(["items-center justify-center hidden xl:flex xxl:flex md:flex sm:flex arrow_button", l.direction_property == "rtl" ? "arrow_button_prev" : "arrow_button_next"])
|
|
1285
|
+
}, [
|
|
1286
|
+
t("div", Dt, [
|
|
1287
|
+
t("button", {
|
|
1288
|
+
class: "p-3 rounded-full shadow-lg arrow_button_styles",
|
|
1289
|
+
onClick: r[2] || (r[2] = O((o) => s.next(), ["stop"]))
|
|
1290
|
+
}, [
|
|
1291
|
+
l.direction_property == "ltr" ? (d(), u("svg", Bt, Mt)) : m("", !0),
|
|
1292
|
+
l.direction_property == "rtl" ? (d(), u("svg", Et, At)) : m("", !0)
|
|
1293
|
+
])
|
|
1294
|
+
])
|
|
1295
|
+
], 2)) : m("", !0)
|
|
1296
|
+
], 8, St),
|
|
1297
|
+
l.slider_arrows_indicators_position != "arrows_indicators_below_slider" ? (d(), u("div", {
|
|
1298
|
+
key: 0,
|
|
1299
|
+
class: f(["flex justify-center mb-1 space-x-1", s.sliderIndicatorsAction()])
|
|
1300
|
+
}, [
|
|
1301
|
+
(d(!0), u(y, null, x(e.dotsNum, (o) => (d(), u("button", {
|
|
1302
|
+
role: "button",
|
|
1303
|
+
class: f(["gl-dot", { active: e.currentDot == o }]),
|
|
1304
|
+
key: o,
|
|
1305
|
+
onClick: (n) => s.setDot(o)
|
|
1306
|
+
}, Ft, 10, qt))), 128))
|
|
1307
|
+
], 2)) : m("", !0),
|
|
1308
|
+
l.slider_arrows_indicators_position == "arrows_indicators_below_slider" ? (d(), u("div", Rt, [
|
|
1309
|
+
t("div", {
|
|
1310
|
+
class: f(["flex justify-center mb-1 space-x-1", s.sliderIndicatorsAction()])
|
|
1311
|
+
}, [
|
|
1312
|
+
(d(!0), u(y, null, x(e.dotsNum, (o) => (d(), u("button", {
|
|
1313
|
+
role: "button",
|
|
1314
|
+
class: f(["gl-dot", { active: e.currentDot == o }]),
|
|
1315
|
+
key: o,
|
|
1316
|
+
onClick: (n) => s.setDot(o)
|
|
1317
|
+
}, zt, 10, Kt))), 128))
|
|
1318
|
+
], 2),
|
|
1319
|
+
e.dotsNum > 0 ? (d(), u("div", Xt, [
|
|
1320
|
+
t("div", Yt, [
|
|
1321
|
+
t("div", Ht, [
|
|
1322
|
+
t("button", {
|
|
1323
|
+
class: f(["p-3 rounded-full arrow_button_styles", l.direction_property == "rtl" ? "ml-3" : "mr-3"]),
|
|
1324
|
+
onClick: r[3] || (r[3] = (o) => s.prev())
|
|
1325
|
+
}, [
|
|
1326
|
+
l.direction_property == "ltr" ? (d(), u("svg", Jt, Zt)) : m("", !0),
|
|
1327
|
+
l.direction_property == "rtl" ? (d(), u("svg", Gt, er)) : m("", !0)
|
|
1328
|
+
], 2)
|
|
1329
|
+
])
|
|
1330
|
+
]),
|
|
1331
|
+
t("div", tr, [
|
|
1332
|
+
t("div", rr, [
|
|
1333
|
+
t("button", {
|
|
1334
|
+
class: "p-3 rounded-full arrow_button_styles",
|
|
1335
|
+
onClick: r[4] || (r[4] = (o) => s.next())
|
|
1336
|
+
}, [
|
|
1337
|
+
l.direction_property == "ltr" ? (d(), u("svg", lr, nr)) : m("", !0),
|
|
1338
|
+
l.direction_property == "rtl" ? (d(), u("svg", or, ir)) : m("", !0)
|
|
1339
|
+
])
|
|
1340
|
+
])
|
|
1341
|
+
])
|
|
1342
|
+
])) : m("", !0)
|
|
1343
|
+
])) : m("", !0)
|
|
1344
|
+
], 10, kt),
|
|
1345
|
+
e.dotsNum > 0 && !l.hide_arrow && l.slider_arrows_indicators_position == "arrows_outside_slider" ? (d(), u("div", dr, [
|
|
1346
|
+
t("div", ur, [
|
|
1347
|
+
t("button", {
|
|
1348
|
+
class: "p-3 ml-5 rounded-full shadow-lg arrow_button_styles",
|
|
1349
|
+
onClick: r[5] || (r[5] = (o) => s.next())
|
|
1350
|
+
}, [
|
|
1351
|
+
l.direction_property == "ltr" ? (d(), u("svg", cr, fr)) : m("", !0),
|
|
1352
|
+
l.direction_property == "rtl" ? (d(), u("svg", mr, yr)) : m("", !0)
|
|
1353
|
+
])
|
|
1354
|
+
])
|
|
1355
|
+
])) : m("", !0)
|
|
1356
|
+
], 10, mt)
|
|
1357
|
+
]);
|
|
1358
|
+
}
|
|
1359
|
+
const cs = /* @__PURE__ */ S(ft, [["render", br], ["__scopeId", "data-v-02efc15f"]]), _r = {
|
|
1360
|
+
class: "fixed left-0 top-13 z-[1055] h-full w-full overflow-y-auto overflow-x-hidden outline-none inset-0 bg-black bg-opacity-80",
|
|
1361
|
+
tabindex: "-1",
|
|
1362
|
+
"aria-hidden": "true"
|
|
1363
|
+
}, xr = { class: "pointer-events-auto relative flex max-h-[100%] w-full flex-col overflow-hidden text-current shadow-4 outline-none bg-white border rounded-lg border-stroke dark:border-strokedark dark:bg-boxdark" }, wr = { class: "flex items-center justify-between flex-shrink-0 pt-10 pb-3 pl-3 pr-3 border-b-2 dark:border-gray-600" }, vr = { class: "text-xl font-medium leading-normal text-surface dark:text-white" }, pr = /* @__PURE__ */ t("span", { class: "[&>svg]:h-6 [&>svg]:w-6" }, [
|
|
1364
|
+
/* @__PURE__ */ t("svg", {
|
|
1365
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1366
|
+
fill: "currentColor",
|
|
1367
|
+
viewBox: "0 0 24 24",
|
|
1368
|
+
"stroke-width": "1.5",
|
|
1369
|
+
stroke: "currentColor"
|
|
1370
|
+
}, [
|
|
1371
|
+
/* @__PURE__ */ t("path", {
|
|
1372
|
+
"stroke-linecap": "round",
|
|
1373
|
+
"stroke-linejoin": "round",
|
|
1374
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
1375
|
+
})
|
|
1376
|
+
])
|
|
1377
|
+
], -1), kr = [
|
|
1378
|
+
pr
|
|
1379
|
+
], Sr = { class: "relative p-4 overflow-y-auto" }, Cr = { class: "flex flex-wrap items-center justify-end flex-shrink-0 p-4 border-t-2 rounded-b-md border-neutral-100 dark:border-gray-600" }, hs = {
|
|
1380
|
+
__name: "Modal",
|
|
1381
|
+
props: {
|
|
1382
|
+
is_open: {
|
|
1383
|
+
type: Boolean,
|
|
1384
|
+
default: !1
|
|
1385
|
+
},
|
|
1386
|
+
title: {
|
|
1387
|
+
type: String,
|
|
1388
|
+
default: ""
|
|
1389
|
+
},
|
|
1390
|
+
max_width: {
|
|
1391
|
+
type: String,
|
|
1392
|
+
default: "max-w-2xl"
|
|
1393
|
+
}
|
|
1394
|
+
},
|
|
1395
|
+
emits: ["closeModal"],
|
|
1396
|
+
setup(e, { emit: r }) {
|
|
1397
|
+
const l = e, i = r, a = () => {
|
|
1398
|
+
document.documentElement.style.overflow = "hidden", document.documentElement.style.paddingRight = "0px";
|
|
1399
|
+
}, s = () => {
|
|
1400
|
+
document.documentElement.style.overflow = "", document.documentElement.style.paddingRight = "";
|
|
1401
|
+
}, o = () => {
|
|
1402
|
+
i("closeModal"), s();
|
|
1403
|
+
};
|
|
1404
|
+
return q(
|
|
1405
|
+
() => l.is_open,
|
|
1406
|
+
(n, c) => {
|
|
1407
|
+
n ? a() : s();
|
|
1408
|
+
},
|
|
1409
|
+
{ immediate: !0, deep: !0 }
|
|
1410
|
+
), (n, c) => w((d(), u("div", _r, [
|
|
1411
|
+
t("div", {
|
|
1412
|
+
class: f(["pointer-events-none relative h-[calc(100%-1rem)] w-auto translate-y-[-50px] transition-all duration-300 ease-in-out min-[576px]:mx-auto min-[576px]:mt-7 min-[576px]:h-[calc(100%-3.5rem)]", e.max_width])
|
|
1413
|
+
}, [
|
|
1414
|
+
t("div", xr, [
|
|
1415
|
+
t("div", wr, [
|
|
1416
|
+
t("h5", vr, h(e.title), 1),
|
|
1417
|
+
t("button", {
|
|
1418
|
+
type: "button",
|
|
1419
|
+
class: "box-content border-none rounded-none text-neutral-500 hover:text-neutral-800 hover:no-underline focus:text-neutral-800 focus:opacity-100 focus:shadow-none focus:outline-none dark:text-neutral-400 dark:hover:text-neutral-300 dark:focus:text-neutral-300",
|
|
1420
|
+
onClick: o,
|
|
1421
|
+
"aria-label": "Close"
|
|
1422
|
+
}, kr)
|
|
1423
|
+
]),
|
|
1424
|
+
t("div", Sr, [
|
|
1425
|
+
k(n.$slots, "body")
|
|
1426
|
+
]),
|
|
1427
|
+
t("div", Cr, [
|
|
1428
|
+
k(n.$slots, "buttons"),
|
|
1429
|
+
t("button", {
|
|
1430
|
+
onClick: o,
|
|
1431
|
+
type: "button",
|
|
1432
|
+
class: "px-5 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-200 rounded-lg ms-3 hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-blue-300 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"
|
|
1433
|
+
}, " Close ")
|
|
1434
|
+
])
|
|
1435
|
+
])
|
|
1436
|
+
], 2)
|
|
1437
|
+
], 512)), [
|
|
1438
|
+
[T, e.is_open]
|
|
1439
|
+
]);
|
|
1440
|
+
}
|
|
1441
|
+
}, $r = { class: "mb-4" }, Pr = { class: "flex justify-between px-6 py-3 -mb-px border border-gray-300 no-underlin" }, Tr = { class: "relative inline-flex items-center cursor-pointer" }, Or = ["name", "id"], Vr = /* @__PURE__ */ t("div", { class: "w-11 h-6 bg-gray-200 peer-focus:outline-none 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 rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] 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), Ir = /* @__PURE__ */ t("hr", { class: "!opacity-100 bg-gray-200 border-0 dark:bg-gray-700" }, null, -1), Dr = { class: "flex justify-between px-6 py-3 -mb-px border border-gray-200 rounded-lg no-underlin dark:border-gray-600 dark:focus:border-frontenddark" }, Br = { class: "relative inline-flex items-center cursor-pointer" }, jr = ["name", "id", "value", "checked"], Mr = /* @__PURE__ */ t("div", { class: "w-11 h-6 bg-gray-200 peer-focus:outline-none 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 rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] 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), Er = { class: "gl-span-form-error" }, Nr = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" }, fs = {
|
|
1442
|
+
__name: "ToggleBox",
|
|
1443
|
+
props: {
|
|
1444
|
+
is_required: {
|
|
1445
|
+
type: Boolean,
|
|
1446
|
+
default: !1
|
|
1447
|
+
},
|
|
1448
|
+
show: {
|
|
1449
|
+
type: Boolean,
|
|
1450
|
+
default: !1
|
|
1451
|
+
},
|
|
1452
|
+
error_message: {
|
|
1453
|
+
type: String,
|
|
1454
|
+
default: ""
|
|
1455
|
+
},
|
|
1456
|
+
model_value: {
|
|
1457
|
+
type: String,
|
|
1458
|
+
required: !0
|
|
1459
|
+
},
|
|
1460
|
+
modelValue: {
|
|
1461
|
+
type: [String, Number],
|
|
1462
|
+
default: ""
|
|
1463
|
+
},
|
|
1464
|
+
type: {
|
|
1465
|
+
type: String,
|
|
1466
|
+
default: "text"
|
|
1467
|
+
},
|
|
1468
|
+
field_name: {
|
|
1469
|
+
type: String,
|
|
1470
|
+
default: ""
|
|
1471
|
+
},
|
|
1472
|
+
label_name: {
|
|
1473
|
+
type: String,
|
|
1474
|
+
default: ""
|
|
1475
|
+
},
|
|
1476
|
+
description: {
|
|
1477
|
+
type: String,
|
|
1478
|
+
default: ""
|
|
1479
|
+
}
|
|
1480
|
+
},
|
|
1481
|
+
emits: ["update:modelValue"],
|
|
1482
|
+
setup(e, { emit: r }) {
|
|
1483
|
+
const l = e, i = r, a = v(null);
|
|
1484
|
+
P(() => {
|
|
1485
|
+
l.model_value != "" && (i("update:modelValue", l.model_value), a.value.checked = l.model_value == 1), l.modelValue != "" && (i("update:modelValue", l.modelValue), a.value.checked = l.modelValue == 1);
|
|
1486
|
+
});
|
|
1487
|
+
const s = (o) => {
|
|
1488
|
+
const n = o.target.checked ? 1 : 0;
|
|
1489
|
+
i("update:modelValue", n);
|
|
1490
|
+
};
|
|
1491
|
+
return (o, n) => (d(), u(y, null, [
|
|
1492
|
+
e.show ? (d(), u("div", {
|
|
1493
|
+
key: 0,
|
|
1494
|
+
class: f(e.field_name)
|
|
1495
|
+
}, [
|
|
1496
|
+
t("div", $r, [
|
|
1497
|
+
t("li", Pr, [
|
|
1498
|
+
p(h(e.label_name) + " ", 1),
|
|
1499
|
+
t("label", Tr, [
|
|
1500
|
+
t("input", {
|
|
1501
|
+
type: "checkbox",
|
|
1502
|
+
class: "sr-only peer",
|
|
1503
|
+
name: e.field_name,
|
|
1504
|
+
id: e.field_name,
|
|
1505
|
+
"true-value": 1,
|
|
1506
|
+
"false-value": 0,
|
|
1507
|
+
ref_key: "input",
|
|
1508
|
+
ref: a,
|
|
1509
|
+
disabled: ""
|
|
1510
|
+
}, null, 8, Or),
|
|
1511
|
+
Vr
|
|
1512
|
+
])
|
|
1513
|
+
])
|
|
1514
|
+
]),
|
|
1515
|
+
Ir
|
|
1516
|
+
], 2)) : m("", !0),
|
|
1517
|
+
e.show ? m("", !0) : (d(), u("div", {
|
|
1518
|
+
key: 1,
|
|
1519
|
+
class: f(["mb-4", e.field_name])
|
|
1520
|
+
}, [
|
|
1521
|
+
t("li", Dr, [
|
|
1522
|
+
p(h(e.label_name) + " ", 1),
|
|
1523
|
+
t("label", Br, [
|
|
1524
|
+
t("input", {
|
|
1525
|
+
type: "checkbox",
|
|
1526
|
+
class: "sr-only peer",
|
|
1527
|
+
name: e.field_name,
|
|
1528
|
+
id: e.field_name,
|
|
1529
|
+
value: e.model_value,
|
|
1530
|
+
checked: e.model_value == 1,
|
|
1531
|
+
"true-value": 1,
|
|
1532
|
+
"false-value": 0,
|
|
1533
|
+
ref_key: "input",
|
|
1534
|
+
ref: a,
|
|
1535
|
+
onChange: s
|
|
1536
|
+
}, null, 40, jr),
|
|
1537
|
+
Mr
|
|
1538
|
+
])
|
|
1539
|
+
]),
|
|
1540
|
+
t("span", Er, h(e.error_message), 1),
|
|
1541
|
+
t("small", Nr, h(e.description), 1)
|
|
1542
|
+
], 2))
|
|
1543
|
+
], 64));
|
|
1544
|
+
}
|
|
1545
|
+
}, Ar = {
|
|
1546
|
+
name: "Dropdown",
|
|
1547
|
+
template: "Dropdown",
|
|
1548
|
+
props: {
|
|
1549
|
+
modelValue: {
|
|
1550
|
+
type: [String, Number],
|
|
1551
|
+
default: ""
|
|
1552
|
+
},
|
|
1553
|
+
default_value: {
|
|
1554
|
+
type: [String, Number],
|
|
1555
|
+
default: ""
|
|
1556
|
+
},
|
|
1557
|
+
field_name: {
|
|
1558
|
+
type: String,
|
|
1559
|
+
default: ""
|
|
1560
|
+
},
|
|
1561
|
+
is_required: {
|
|
1562
|
+
type: Boolean,
|
|
1563
|
+
default: !1
|
|
1564
|
+
},
|
|
1565
|
+
has_cancel: {
|
|
1566
|
+
type: Boolean,
|
|
1567
|
+
default: !0
|
|
1568
|
+
},
|
|
1569
|
+
label_name: {
|
|
1570
|
+
type: String,
|
|
1571
|
+
default: ""
|
|
1572
|
+
},
|
|
1573
|
+
options: {
|
|
1574
|
+
type: Array,
|
|
1575
|
+
required: !0,
|
|
1576
|
+
default: [],
|
|
1577
|
+
note: "Options of dropdown. An array of options with id and name"
|
|
1578
|
+
},
|
|
1579
|
+
placeholder: {
|
|
1580
|
+
type: String,
|
|
1581
|
+
required: !1,
|
|
1582
|
+
default: "Please select an option",
|
|
1583
|
+
note: "Placeholder of dropdown"
|
|
1584
|
+
},
|
|
1585
|
+
maxItem: {
|
|
1586
|
+
type: Number,
|
|
1587
|
+
required: !1,
|
|
1588
|
+
default: 1e4,
|
|
1589
|
+
note: "Max items showing"
|
|
1590
|
+
},
|
|
1591
|
+
show: {
|
|
1592
|
+
type: Boolean,
|
|
1593
|
+
default: !1
|
|
1594
|
+
},
|
|
1595
|
+
error_message: {
|
|
1596
|
+
type: String,
|
|
1597
|
+
default: ""
|
|
1598
|
+
},
|
|
1599
|
+
description: {
|
|
1600
|
+
type: String,
|
|
1601
|
+
default: ""
|
|
1602
|
+
}
|
|
1603
|
+
},
|
|
1604
|
+
emits: ["update:modelValue", "selected"],
|
|
1605
|
+
data() {
|
|
1606
|
+
return {
|
|
1607
|
+
selected: {},
|
|
1608
|
+
count: 0,
|
|
1609
|
+
optionsShown: !1,
|
|
1610
|
+
// options_values: [],
|
|
1611
|
+
searchFilter: "",
|
|
1612
|
+
uuid: ""
|
|
1613
|
+
};
|
|
1614
|
+
},
|
|
1615
|
+
created() {
|
|
1616
|
+
this.$emit("selected", this.selected);
|
|
1617
|
+
},
|
|
1618
|
+
mounted() {
|
|
1619
|
+
this.uuid = this.generateUUID(), self = this;
|
|
1620
|
+
var e = this.convertedOptionDefault();
|
|
1621
|
+
this.selected = this.options_values.find(
|
|
1622
|
+
(r) => String(r.id) === String(e)
|
|
1623
|
+
) || {}, this.show || (document.body.addEventListener("click", function(r) {
|
|
1624
|
+
self.clearData(r);
|
|
1625
|
+
}), document.addEventListener("keypress", function(r) {
|
|
1626
|
+
r.key === "Enter" && r.target.form && r.preventDefault();
|
|
1627
|
+
}));
|
|
1628
|
+
},
|
|
1629
|
+
computed: {
|
|
1630
|
+
options_values() {
|
|
1631
|
+
return this.convertedOptions();
|
|
1632
|
+
},
|
|
1633
|
+
filteredOptions() {
|
|
1634
|
+
const e = [], r = new RegExp(this.searchFilter, "ig");
|
|
1635
|
+
for (const l of this.options_values) {
|
|
1636
|
+
const i = String(l.name);
|
|
1637
|
+
(this.searchFilter.length < 1 || i.match(r)) && e.length < this.maxItem && e.push(l);
|
|
1638
|
+
}
|
|
1639
|
+
return e;
|
|
1640
|
+
}
|
|
1641
|
+
},
|
|
1642
|
+
methods: {
|
|
1643
|
+
handleKeyDown(e) {
|
|
1644
|
+
if ([
|
|
1645
|
+
"ArrowLeft",
|
|
1646
|
+
"ArrowUp",
|
|
1647
|
+
"ArrowRight",
|
|
1648
|
+
"ArrowDown",
|
|
1649
|
+
"Enter"
|
|
1650
|
+
].includes(e.key)) {
|
|
1651
|
+
if (["ArrowUp", "ArrowDown"].includes(e.key) && e.preventDefault(), e.key === "ArrowDown" && this.posts === "")
|
|
1652
|
+
return;
|
|
1653
|
+
this.selectPost(e.key);
|
|
1654
|
+
}
|
|
1655
|
+
},
|
|
1656
|
+
generateUUID() {
|
|
1657
|
+
let e = (/* @__PURE__ */ new Date()).getTime();
|
|
1658
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
|
|
1659
|
+
/[xy]/g,
|
|
1660
|
+
function(l) {
|
|
1661
|
+
const i = (e + Math.random() * 16) % 16 | 0;
|
|
1662
|
+
return e = Math.floor(e / 16), (l === "x" ? i : i & 3 | 8).toString(16);
|
|
1663
|
+
}
|
|
1664
|
+
);
|
|
1665
|
+
},
|
|
1666
|
+
isObjectNotEmpty(e) {
|
|
1667
|
+
return Object.keys(e).length > 0;
|
|
1668
|
+
},
|
|
1669
|
+
clearData: function(e) {
|
|
1670
|
+
e.target.id != this.field_name + "search" + this.uuid && e.target.id != this.field_name && !e.target.classList.contains("showOptions") && (this.exit(), this.count = 0);
|
|
1671
|
+
},
|
|
1672
|
+
scrollToElement: function(e) {
|
|
1673
|
+
const r = `${e}${this.uuid}`, l = document.getElementById(r);
|
|
1674
|
+
l && l.scrollIntoView();
|
|
1675
|
+
},
|
|
1676
|
+
clickElement: function(e) {
|
|
1677
|
+
const r = `${e}${this.uuid}`, l = document.getElementById(r);
|
|
1678
|
+
l && l.click();
|
|
1679
|
+
},
|
|
1680
|
+
selectPost: function(e) {
|
|
1681
|
+
e === "ArrowDown" && this.count < this.filteredOptions.length && (this.count++, this.scrollToElement(this.count)), e === "ArrowUp" && this.count > 1 && (this.count--, this.scrollToElement(this.count)), e === "Enter" && this.clickElement(this.count);
|
|
1682
|
+
},
|
|
1683
|
+
convertedOptions() {
|
|
1684
|
+
return this.options.map((e, r) => typeof e == "object" ? e : { id: e, name: e });
|
|
1685
|
+
},
|
|
1686
|
+
convertedOptionDefault() {
|
|
1687
|
+
var e = this.default_value || this.modelValue;
|
|
1688
|
+
return e ? typeof e == "object" ? e.id + "" : e + "" : "";
|
|
1689
|
+
},
|
|
1690
|
+
updateModelValue(e) {
|
|
1691
|
+
this.$emit("update:modelValue", e.target.value);
|
|
1692
|
+
},
|
|
1693
|
+
selectOption(e) {
|
|
1694
|
+
this.selected = e, this.optionsShown = !1, this.$emit("selected", this.selected);
|
|
1695
|
+
},
|
|
1696
|
+
showOptions() {
|
|
1697
|
+
this.show || (this.searchFilter = "", this.optionsShown = !0, this.$nextTick(() => {
|
|
1698
|
+
this.$refs[this.field_name + "search" + this.uuid].focus();
|
|
1699
|
+
}));
|
|
1700
|
+
},
|
|
1701
|
+
ClearInput() {
|
|
1702
|
+
this.show || (this.selected = {}, this.searchFilter = "", this.$emit("update:modelValue", ""), this.showOptions());
|
|
1703
|
+
},
|
|
1704
|
+
exit() {
|
|
1705
|
+
this.selected.id || (this.selected = {}, this.searchFilter = ""), this.$emit("selected", this.selected), this.optionsShown = !1;
|
|
1706
|
+
}
|
|
1707
|
+
// Selecting when pressing Enter
|
|
1708
|
+
},
|
|
1709
|
+
watch: {
|
|
1710
|
+
searchFilter() {
|
|
1711
|
+
this.filteredOptions.length === 0 && (this.selected = {});
|
|
1712
|
+
},
|
|
1713
|
+
selected(e) {
|
|
1714
|
+
this.isObjectNotEmpty(e) && this.$emit("update:modelValue", e.id);
|
|
1715
|
+
}
|
|
1716
|
+
// options(newOptions) {
|
|
1717
|
+
/*
|
|
1718
|
+
this.options_values = this.convertedOptions();
|
|
1719
|
+
|
|
1720
|
+
var default_value = this.convertedOptionDefault();
|
|
1721
|
+
console.log("default_value_options : ", default_value);
|
|
1722
|
+
|
|
1723
|
+
this.selected =
|
|
1724
|
+
this.options_values.find(
|
|
1725
|
+
(item) => String(item.id) === String(default_value)
|
|
1726
|
+
) || {};
|
|
1727
|
+
|
|
1728
|
+
*/
|
|
1729
|
+
// },
|
|
1730
|
+
}
|
|
1731
|
+
}, qr = { class: "font-bold ptext-lg dark:text-white" }, Lr = { class: "mt-3 mb-4" }, Fr = { class: "bg-blue-100 text-blue-800 text-sm font-medium mb-2 mt-2 me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300" }, Rr = /* @__PURE__ */ t("hr", { class: "!opacity-100 bg-gray-200 border-0 dark:bg-gray-700" }, null, -1), Kr = ["name", "id", "value"], Ur = {
|
|
1732
|
+
key: 0,
|
|
1733
|
+
class: "dropdown"
|
|
1734
|
+
}, zr = { class: "border border-gray-200 rounded-lg focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:focus:ring-blue-500 dark:focus:border-blue-500" }, Xr = { class: "relative showOptions" }, Yr = ["value", "placeholder"], Hr = { class: "text-gray-700 bg-white dark:border-strokedark dark:bg-boxdark dark:text-gray-200 !border-b !border-t-0 !border-r !border-l absolute w-full z-[999999999]" }, Jr = { class: "p-1" }, Wr = /* @__PURE__ */ t("label", {
|
|
1735
|
+
for: "default-search",
|
|
1736
|
+
class: "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"
|
|
1737
|
+
}, "Search", -1), Zr = { class: "relative" }, Gr = /* @__PURE__ */ t("div", { class: "absolute inset-y-0 flex items-center pointer-events-none start-0 ps-3" }, [
|
|
1738
|
+
/* @__PURE__ */ t("svg", {
|
|
1739
|
+
class: "w-4 h-4 text-gray-500 dark:text-gray-400",
|
|
1740
|
+
"aria-hidden": "true",
|
|
1741
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1742
|
+
fill: "none",
|
|
1743
|
+
viewBox: "0 0 20 20"
|
|
1744
|
+
}, [
|
|
1745
|
+
/* @__PURE__ */ t("path", {
|
|
1746
|
+
stroke: "currentColor",
|
|
1747
|
+
"stroke-linecap": "round",
|
|
1748
|
+
"stroke-linejoin": "round",
|
|
1749
|
+
"stroke-width": "2",
|
|
1750
|
+
d: "m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"
|
|
1751
|
+
})
|
|
1752
|
+
])
|
|
1753
|
+
], -1), Qr = ["id"], el = { class: "overflow-y-auto max-h-64" }, tl = ["onClick", "onMousedown", "id"], rl = { class: "flex items-center py-2 pl-10 pr-4" }, ll = {
|
|
1754
|
+
key: 0,
|
|
1755
|
+
class: "absolute flex items-center flex-shrink-0 w-4 h-4 text-green-500 left-2 dark:text-green-400",
|
|
1756
|
+
"aria-hidden": "true",
|
|
1757
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1758
|
+
fill: "none",
|
|
1759
|
+
viewBox: "0 0 16 12"
|
|
1760
|
+
}, sl = /* @__PURE__ */ t("path", {
|
|
1761
|
+
stroke: "currentColor",
|
|
1762
|
+
"stroke-linecap": "round",
|
|
1763
|
+
"stroke-linejoin": "round",
|
|
1764
|
+
"stroke-width": "2",
|
|
1765
|
+
d: "M1 5.917 5.724 10.5 15 1.5"
|
|
1766
|
+
}, null, -1), nl = [
|
|
1767
|
+
sl
|
|
1768
|
+
], ol = { class: "block mt-1 text-sm font-normal leading-5 text-red-500" }, al = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" };
|
|
1769
|
+
function il(e, r, l, i, a, s) {
|
|
1770
|
+
return d(), u(y, null, [
|
|
1771
|
+
l.show ? (d(), u("div", {
|
|
1772
|
+
key: 0,
|
|
1773
|
+
class: f(l.field_name)
|
|
1774
|
+
}, [
|
|
1775
|
+
t("h3", qr, h(l.label_name), 1),
|
|
1776
|
+
t("p", Lr, [
|
|
1777
|
+
t("span", Fr, h(e.selectedValue.name), 1)
|
|
1778
|
+
]),
|
|
1779
|
+
Rr
|
|
1780
|
+
], 2)) : m("", !0),
|
|
1781
|
+
l.show ? m("", !0) : (d(), u("div", {
|
|
1782
|
+
key: 1,
|
|
1783
|
+
class: f(["mb-4", l.field_name])
|
|
1784
|
+
}, [
|
|
1785
|
+
t("input", {
|
|
1786
|
+
type: "hidden",
|
|
1787
|
+
name: l.field_name,
|
|
1788
|
+
id: l.field_name,
|
|
1789
|
+
value: a.selected.id
|
|
1790
|
+
}, null, 8, Kr),
|
|
1791
|
+
l.options ? (d(), u("div", Ur, [
|
|
1792
|
+
l.label_name ? (d(), u("label", {
|
|
1793
|
+
key: 0,
|
|
1794
|
+
class: f({
|
|
1795
|
+
"gl-label-form": l.error_message == "",
|
|
1796
|
+
"gl-label-form-invalid": l.error_message !== "",
|
|
1797
|
+
required: l.is_required
|
|
1798
|
+
})
|
|
1799
|
+
}, h(l.label_name), 3)) : m("", !0),
|
|
1800
|
+
t("div", zr, [
|
|
1801
|
+
t("div", Xr, [
|
|
1802
|
+
t("input", {
|
|
1803
|
+
class: "!border-0 gl-input-form pl-8 pr-2 showOptions",
|
|
1804
|
+
ref: l.field_name,
|
|
1805
|
+
onClick: r[0] || (r[0] = (o) => s.showOptions()),
|
|
1806
|
+
value: a.selected.name,
|
|
1807
|
+
placeholder: l.placeholder,
|
|
1808
|
+
autocomplete: "off",
|
|
1809
|
+
readonly: ""
|
|
1810
|
+
}, null, 8, Yr),
|
|
1811
|
+
w(t("i", {
|
|
1812
|
+
onClick: r[1] || (r[1] = O((o) => s.ClearInput(), ["stop"])),
|
|
1813
|
+
class: "absolute text-gray-500 cursor-pointer fas fa-times right-7 hover:text-gray-700",
|
|
1814
|
+
style: { top: "13px" }
|
|
1815
|
+
}, null, 512), [
|
|
1816
|
+
[T, s.isObjectNotEmpty(a.selected) && l.has_cancel]
|
|
1817
|
+
]),
|
|
1818
|
+
t("i", {
|
|
1819
|
+
onClick: r[2] || (r[2] = (o) => !a.optionsShown && s.showOptions()),
|
|
1820
|
+
class: f([a.optionsShown ? "fa-angle-up" : "fa-angle-down", "absolute text-xl text-gray-500 cursor-pointer fas right-2 hover:text-gray-700 showOptions"]),
|
|
1821
|
+
style: { top: "11px" }
|
|
1822
|
+
}, null, 2)
|
|
1823
|
+
]),
|
|
1824
|
+
w(t("div", Hr, [
|
|
1825
|
+
t("div", Jr, [
|
|
1826
|
+
Wr,
|
|
1827
|
+
t("div", Zr, [
|
|
1828
|
+
Gr,
|
|
1829
|
+
w(t("input", {
|
|
1830
|
+
type: "search",
|
|
1831
|
+
"onUpdate:modelValue": r[3] || (r[3] = (o) => a.searchFilter = o),
|
|
1832
|
+
ref: `${l.field_name}search${a.uuid}`,
|
|
1833
|
+
id: `${l.field_name}search${a.uuid}`,
|
|
1834
|
+
onKeydown: r[4] || (r[4] = (...o) => s.handleKeyDown && s.handleKeyDown(...o)),
|
|
1835
|
+
onBlur: r[5] || (r[5] = (o) => s.exit()),
|
|
1836
|
+
autocomplete: "off",
|
|
1837
|
+
class: "block w-full p-2 text-sm text-gray-900 border rounded-lg outline-none border-frontend ps-10 bg-gray-50 focus:border-frontend dark:bg-gray-700 dark:border-frontenddark dark:placeholder-frontenddark dark:text-white dark:focus:border-frontenddark",
|
|
1838
|
+
placeholder: "Search ..."
|
|
1839
|
+
}, null, 40, Qr), [
|
|
1840
|
+
[$, a.searchFilter]
|
|
1841
|
+
])
|
|
1842
|
+
])
|
|
1843
|
+
]),
|
|
1844
|
+
t("div", el, [
|
|
1845
|
+
(d(!0), u(y, null, x(s.filteredOptions, (o, n) => (d(), u("div", {
|
|
1846
|
+
class: f([
|
|
1847
|
+
"relative px-2 py-2 text-xs leading-4 text-gray-700 no-underline cursor-pointer dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white",
|
|
1848
|
+
n + 1 == a.count ? "bg-gray-100 dark:bg-gray-600" : ""
|
|
1849
|
+
]),
|
|
1850
|
+
onClick: (c) => s.selectOption(o),
|
|
1851
|
+
onMousedown: (c) => s.selectOption(o),
|
|
1852
|
+
key: n,
|
|
1853
|
+
id: `${n + 1}${a.uuid}`
|
|
1854
|
+
}, [
|
|
1855
|
+
t("div", rl, [
|
|
1856
|
+
a.selected.id === o.id ? (d(), u("svg", ll, nl)) : m("", !0),
|
|
1857
|
+
t("span", null, h(o.name || o.id || "-"), 1)
|
|
1858
|
+
])
|
|
1859
|
+
], 42, tl))), 128))
|
|
1860
|
+
])
|
|
1861
|
+
], 512), [
|
|
1862
|
+
[T, a.optionsShown]
|
|
1863
|
+
])
|
|
1864
|
+
])
|
|
1865
|
+
])) : m("", !0),
|
|
1866
|
+
t("span", ol, h(l.error_message), 1),
|
|
1867
|
+
t("small", al, h(l.description), 1)
|
|
1868
|
+
], 2))
|
|
1869
|
+
], 64);
|
|
1870
|
+
}
|
|
1871
|
+
const ms = /* @__PURE__ */ S(Ar, [["render", il]]), dl = { class: "font-bold ptext-lg dark:text-white" }, ul = ["id"], cl = /* @__PURE__ */ t("hr", { class: "!opacity-100 bg-gray-200 border-0 dark:bg-gray-700" }, null, -1), hl = ["for"], fl = ["required", "name", "id", "type", "placeholder"], ml = { class: "gl-span-form-error" }, gl = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" }, gs = {
|
|
1872
|
+
__name: "GLTextarea",
|
|
1873
|
+
props: {
|
|
1874
|
+
is_required: {
|
|
1875
|
+
type: Boolean,
|
|
1876
|
+
default: !1
|
|
1877
|
+
},
|
|
1878
|
+
show: {
|
|
1879
|
+
type: Boolean,
|
|
1880
|
+
default: !1
|
|
1881
|
+
},
|
|
1882
|
+
error_message: {
|
|
1883
|
+
type: String,
|
|
1884
|
+
default: ""
|
|
1885
|
+
},
|
|
1886
|
+
model_value: {
|
|
1887
|
+
type: [String, Number],
|
|
1888
|
+
default: ""
|
|
1889
|
+
},
|
|
1890
|
+
modelValue: {
|
|
1891
|
+
type: [String, Number],
|
|
1892
|
+
default: ""
|
|
1893
|
+
},
|
|
1894
|
+
type: {
|
|
1895
|
+
type: String,
|
|
1896
|
+
default: "text"
|
|
1897
|
+
},
|
|
1898
|
+
field_name: {
|
|
1899
|
+
type: String,
|
|
1900
|
+
default: ""
|
|
1901
|
+
},
|
|
1902
|
+
label_name: {
|
|
1903
|
+
type: String,
|
|
1904
|
+
default: ""
|
|
1905
|
+
},
|
|
1906
|
+
description: {
|
|
1907
|
+
type: String,
|
|
1908
|
+
default: ""
|
|
1909
|
+
},
|
|
1910
|
+
place_holder: {
|
|
1911
|
+
type: String,
|
|
1912
|
+
default: ""
|
|
1913
|
+
}
|
|
1914
|
+
},
|
|
1915
|
+
emits: ["update:modelValue", "keydown"],
|
|
1916
|
+
setup(e, { expose: r, emit: l }) {
|
|
1917
|
+
const i = e, a = l, s = v(null);
|
|
1918
|
+
return P(() => {
|
|
1919
|
+
s.value !== null && s.value.hasAttribute("autofocus") && s.value.focus(), i.model_value && (a("update:modelValue", i.model_value), s.value.value = i.model_value), i.modelValue != "" && (a("update:modelValue", i.modelValue), s.value.value = i.modelValue);
|
|
1920
|
+
}), r({ focus: () => s.value.focus() }), (o, n) => (d(), u(y, null, [
|
|
1921
|
+
e.show ? (d(), u("div", {
|
|
1922
|
+
key: 0,
|
|
1923
|
+
class: f(e.field_name)
|
|
1924
|
+
}, [
|
|
1925
|
+
t("h3", dl, h(e.label_name), 1),
|
|
1926
|
+
t("p", {
|
|
1927
|
+
id: e.field_name,
|
|
1928
|
+
class: "mb-4 text-base text-gray-900 input_tr_show dark:text-white"
|
|
1929
|
+
}, h(e.model_value), 9, ul),
|
|
1930
|
+
cl
|
|
1931
|
+
], 2)) : m("", !0),
|
|
1932
|
+
e.show ? m("", !0) : (d(), u("div", {
|
|
1933
|
+
key: 1,
|
|
1934
|
+
class: f(["mb-4", e.field_name])
|
|
1935
|
+
}, [
|
|
1936
|
+
t("label", {
|
|
1937
|
+
class: f({
|
|
1938
|
+
"gl-label-form": e.error_message == "",
|
|
1939
|
+
"gl-label-form-invalid": e.error_message !== "",
|
|
1940
|
+
required: e.is_required
|
|
1941
|
+
}),
|
|
1942
|
+
for: e.field_name
|
|
1943
|
+
}, h(e.label_name), 11, hl),
|
|
1944
|
+
t("textarea", {
|
|
1945
|
+
required: e.is_required,
|
|
1946
|
+
name: e.field_name,
|
|
1947
|
+
id: e.field_name,
|
|
1948
|
+
class: f({
|
|
1949
|
+
" gl-textarea-form mt-4 ": e.error_message == "",
|
|
1950
|
+
" gl-textarea-form-invalid mt-4 ": e.error_message !== ""
|
|
1951
|
+
}),
|
|
1952
|
+
type: e.type,
|
|
1953
|
+
onInput: n[0] || (n[0] = (c) => o.$emit("update:modelValue", c.target.value)),
|
|
1954
|
+
ref_key: "input",
|
|
1955
|
+
ref: s,
|
|
1956
|
+
rows: "4",
|
|
1957
|
+
placeholder: e.place_holder
|
|
1958
|
+
}, null, 42, fl),
|
|
1959
|
+
t("span", ml, h(e.error_message), 1),
|
|
1960
|
+
t("small", gl, h(e.description), 1)
|
|
1961
|
+
], 2))
|
|
1962
|
+
], 64));
|
|
1963
|
+
}
|
|
1964
|
+
}, yl = {
|
|
1965
|
+
components: {},
|
|
1966
|
+
props: {
|
|
1967
|
+
data: Array,
|
|
1968
|
+
columns: Array
|
|
1969
|
+
},
|
|
1970
|
+
data() {
|
|
1971
|
+
return {
|
|
1972
|
+
showNoOfEntries: [1, 2, 3, 10, 20, 30, 40],
|
|
1973
|
+
search: "",
|
|
1974
|
+
isDropdownOpen: !1,
|
|
1975
|
+
sortKey: "",
|
|
1976
|
+
sortOrder: 1,
|
|
1977
|
+
currentPage: 1,
|
|
1978
|
+
itemsPerPage: 10,
|
|
1979
|
+
jumpToPage: "",
|
|
1980
|
+
maxDisplayedPages: 10
|
|
1981
|
+
// Set the maximum number of displayed pagination buttons
|
|
1982
|
+
};
|
|
1983
|
+
},
|
|
1984
|
+
computed: {
|
|
1985
|
+
filteredData() {
|
|
1986
|
+
const e = this.search.toLowerCase();
|
|
1987
|
+
return this.sortData(this.data).filter((l) => Object.values(l).some(
|
|
1988
|
+
(i) => i != null && i.toString().toLowerCase().includes(e)
|
|
1989
|
+
));
|
|
1990
|
+
},
|
|
1991
|
+
totalPages() {
|
|
1992
|
+
return Math.ceil(this.filteredData.length / this.itemsPerPage);
|
|
1993
|
+
},
|
|
1994
|
+
paginatedData() {
|
|
1995
|
+
const e = (this.currentPage - 1) * this.itemsPerPage, r = e + this.itemsPerPage;
|
|
1996
|
+
return this.filteredData.slice(e, r);
|
|
1997
|
+
},
|
|
1998
|
+
displayedPageNumbers() {
|
|
1999
|
+
let e = Math.max(
|
|
2000
|
+
this.currentPage - Math.floor(this.maxDisplayedPages / 2),
|
|
2001
|
+
1
|
|
2002
|
+
), r = e + this.maxDisplayedPages - 1;
|
|
2003
|
+
return r > this.totalPages && (r = this.totalPages, e = Math.max(r - this.maxDisplayedPages + 1, 1)), Array.from(
|
|
2004
|
+
{ length: r - e + 1 },
|
|
2005
|
+
(l, i) => e + i
|
|
2006
|
+
);
|
|
2007
|
+
},
|
|
2008
|
+
firstItemIndex() {
|
|
2009
|
+
return this.itemsPerPage * (this.currentPage - 1) + 1;
|
|
2010
|
+
},
|
|
2011
|
+
lastItemIndex() {
|
|
2012
|
+
const e = this.itemsPerPage * this.currentPage;
|
|
2013
|
+
return e > this.filteredData.length ? this.filteredData.length : e;
|
|
2014
|
+
}
|
|
2015
|
+
},
|
|
2016
|
+
methods: {
|
|
2017
|
+
handleItemsPerPageChange(e) {
|
|
2018
|
+
this.itemsPerPage = e;
|
|
2019
|
+
},
|
|
2020
|
+
goToPage(e) {
|
|
2021
|
+
e >= 1 && e <= this.totalPages && (this.currentPage = e);
|
|
2022
|
+
},
|
|
2023
|
+
sort(e) {
|
|
2024
|
+
e === this.sortKey ? this.sortOrder *= -1 : (this.sortKey = e, this.sortOrder = 1);
|
|
2025
|
+
},
|
|
2026
|
+
sortData(e) {
|
|
2027
|
+
return this.sortKey ? e.slice().sort((r, l) => (r[this.sortKey] < l[this.sortKey] ? -1 : 1) * this.sortOrder) : e;
|
|
2028
|
+
},
|
|
2029
|
+
previousPage() {
|
|
2030
|
+
this.currentPage > 1 && this.currentPage--;
|
|
2031
|
+
},
|
|
2032
|
+
nextPage() {
|
|
2033
|
+
this.currentPage < this.totalPages && this.currentPage++;
|
|
2034
|
+
},
|
|
2035
|
+
firstPage() {
|
|
2036
|
+
this.currentPage = 1;
|
|
2037
|
+
},
|
|
2038
|
+
lastPage() {
|
|
2039
|
+
this.currentPage = this.totalPages;
|
|
2040
|
+
},
|
|
2041
|
+
goToPage(e) {
|
|
2042
|
+
e >= 1 && e <= this.totalPages && (this.currentPage = e);
|
|
2043
|
+
},
|
|
2044
|
+
onJumpToPageChange() {
|
|
2045
|
+
const e = parseInt(this.jumpToPage);
|
|
2046
|
+
e >= 1 && e <= this.totalPages && (this.jumpToPage = e);
|
|
2047
|
+
},
|
|
2048
|
+
jumpToPageButton() {
|
|
2049
|
+
this.jumpToPage >= 1 && this.jumpToPage <= this.totalPages && (this.currentPage = this.jumpToPage);
|
|
2050
|
+
},
|
|
2051
|
+
closeBoxOnbodyClick() {
|
|
2052
|
+
event.target.closest(".main_box_close") || (this.isDropdownOpen = !1);
|
|
2053
|
+
}
|
|
2054
|
+
},
|
|
2055
|
+
beforeDestroy() {
|
|
2056
|
+
document.body.removeEventListener("click", this.closeBoxOnbodyClick);
|
|
2057
|
+
},
|
|
2058
|
+
mounted() {
|
|
2059
|
+
document.body.addEventListener("click", this.closeBoxOnbodyClick);
|
|
2060
|
+
}
|
|
2061
|
+
}, bl = { class: "p-2" }, _l = { class: "flex flex-wrap pb-4 space-y-4 md:items-center md:justify-between flex-column sm:flex-row sm:space-y-0" }, xl = { class: "flex items-center gap-2" }, wl = /* @__PURE__ */ t("span", { class: "font-medium" }, " Show ", -1), vl = { style: { "margin-top": "9px" } }, pl = /* @__PURE__ */ t("span", { class: "font-medium" }, " Entries ", -1), kl = /* @__PURE__ */ t("label", {
|
|
2062
|
+
for: "table-search",
|
|
2063
|
+
class: "sr-only"
|
|
2064
|
+
}, "Search", -1), Sl = { class: "relative" }, Cl = /* @__PURE__ */ t("div", { class: "absolute inset-y-0 left-0 flex items-center pointer-events-none rtl:inset-r-0 rtl:right-0 ps-3" }, [
|
|
2065
|
+
/* @__PURE__ */ t("svg", {
|
|
2066
|
+
class: "w-5 h-5 text-gray-500 dark:text-gray-400",
|
|
2067
|
+
"aria-hidden": "true",
|
|
2068
|
+
fill: "currentColor",
|
|
2069
|
+
viewBox: "0 0 20 20",
|
|
2070
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2071
|
+
}, [
|
|
2072
|
+
/* @__PURE__ */ t("path", {
|
|
2073
|
+
"fill-rule": "evenodd",
|
|
2074
|
+
d: "M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",
|
|
2075
|
+
"clip-rule": "evenodd"
|
|
2076
|
+
})
|
|
2077
|
+
])
|
|
2078
|
+
], -1), $l = { class: "overflow-auto rounded-lg dark:text-gray-400 dark:bg-gray-800" }, Pl = { class: "w-full h-full max-w-full overflow-hidden bg-white border-separate xl:overflow-auto lg:border-collapse border-spacing-y-3 lg:border-spacing-y-0 dark:border-strokedark dark:bg-boxdark" }, Tl = { class: "hidden text-sm font-normal text-center text-gray-700 uppercase lg:table-header-group dark:border-strokedark bg-gray-50 dark:bg-gray-700 dark:text-gray-400" }, Ol = ["onClick"], Vl = {
|
|
2079
|
+
key: 0,
|
|
2080
|
+
class: "ml-2"
|
|
2081
|
+
}, Il = ["data-label"], Dl = ["innerHTML"], Bl = { class: "flex items-center justify-between px-4 py-3 bg-white border-gray-200 sm:px-6 dark:text-gray-400 dark:bg-gray-800" }, jl = { class: "flex justify-between flex-1 sm:hidden" }, Ml = ["disabled"], El = ["disabled"], Nl = { class: "hidden sm:flex sm:flex-1 sm:items-center sm:justify-between" }, Al = { class: "text-sm text-gray-700 dark:text-gray-400" }, ql = { class: "font-medium" }, Ll = { class: "font-medium" }, Fl = { class: "font-medium" }, Rl = { "aria-label": "Page navigation" }, Kl = { class: "flex items-center h-8 -space-x-px text-sm" }, Ul = ["disabled"], zl = /* @__PURE__ */ t("span", { class: "sr-only" }, "Previous", -1), Xl = /* @__PURE__ */ t("svg", {
|
|
2082
|
+
class: "w-2.5 h-2.5 rtl:rotate-180",
|
|
2083
|
+
"aria-hidden": "true",
|
|
2084
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2085
|
+
fill: "none",
|
|
2086
|
+
viewBox: "0 0 6 10"
|
|
2087
|
+
}, [
|
|
2088
|
+
/* @__PURE__ */ t("path", {
|
|
2089
|
+
stroke: "currentColor",
|
|
2090
|
+
"stroke-linecap": "round",
|
|
2091
|
+
"stroke-linejoin": "round",
|
|
2092
|
+
"stroke-width": "2",
|
|
2093
|
+
d: "M5 1 1 5l4 4"
|
|
2094
|
+
})
|
|
2095
|
+
], -1), Yl = [
|
|
2096
|
+
zl,
|
|
2097
|
+
Xl
|
|
2098
|
+
], Hl = ["onClick"], Jl = ["onClick"], Wl = ["disabled"], Zl = /* @__PURE__ */ t("span", { class: "sr-only" }, "Next", -1), Gl = /* @__PURE__ */ t("svg", {
|
|
2099
|
+
class: "w-2.5 h-2.5 rtl:rotate-180",
|
|
2100
|
+
"aria-hidden": "true",
|
|
2101
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2102
|
+
fill: "none",
|
|
2103
|
+
viewBox: "0 0 6 10"
|
|
2104
|
+
}, [
|
|
2105
|
+
/* @__PURE__ */ t("path", {
|
|
2106
|
+
stroke: "currentColor",
|
|
2107
|
+
"stroke-linecap": "round",
|
|
2108
|
+
"stroke-linejoin": "round",
|
|
2109
|
+
"stroke-width": "2",
|
|
2110
|
+
d: "m1 9 4-4-4-4"
|
|
2111
|
+
})
|
|
2112
|
+
], -1), Ql = [
|
|
2113
|
+
Zl,
|
|
2114
|
+
Gl
|
|
2115
|
+
];
|
|
2116
|
+
function es(e, r, l, i, a, s) {
|
|
2117
|
+
const o = L("dropdown");
|
|
2118
|
+
return d(), u("div", bl, [
|
|
2119
|
+
t("div", _l, [
|
|
2120
|
+
t("div", xl, [
|
|
2121
|
+
wl,
|
|
2122
|
+
t("div", vl, [
|
|
2123
|
+
F(o, {
|
|
2124
|
+
has_cancel: !1,
|
|
2125
|
+
options: a.showNoOfEntries,
|
|
2126
|
+
modelValue: a.itemsPerPage,
|
|
2127
|
+
"onUpdate:modelValue": r[0] || (r[0] = (n) => a.itemsPerPage = n),
|
|
2128
|
+
is_required: !1,
|
|
2129
|
+
field_name: "NoOfEntries",
|
|
2130
|
+
label_name: "",
|
|
2131
|
+
default_value: "10",
|
|
2132
|
+
show: !1,
|
|
2133
|
+
placeholder: "Please select an option"
|
|
2134
|
+
}, null, 8, ["options", "modelValue"])
|
|
2135
|
+
]),
|
|
2136
|
+
pl
|
|
2137
|
+
]),
|
|
2138
|
+
kl,
|
|
2139
|
+
t("div", Sl, [
|
|
2140
|
+
Cl,
|
|
2141
|
+
w(t("input", {
|
|
2142
|
+
type: "text",
|
|
2143
|
+
"onUpdate:modelValue": r[1] || (r[1] = (n) => a.search = n),
|
|
2144
|
+
class: "block p-2 text-sm text-gray-900 border border-gray-300 rounded-lg ps-10 w-80 bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",
|
|
2145
|
+
placeholder: "Search ..."
|
|
2146
|
+
}, null, 512), [
|
|
2147
|
+
[$, a.search]
|
|
2148
|
+
])
|
|
2149
|
+
])
|
|
2150
|
+
]),
|
|
2151
|
+
t("div", $l, [
|
|
2152
|
+
t("table", Pl, [
|
|
2153
|
+
t("thead", Tl, [
|
|
2154
|
+
t("tr", null, [
|
|
2155
|
+
(d(!0), u(y, null, x(l.columns, (n, c) => (d(), u("th", {
|
|
2156
|
+
key: c,
|
|
2157
|
+
onClick: (g) => s.sort(n),
|
|
2158
|
+
class: "w-full px-4 py-2 lg:w-2/12"
|
|
2159
|
+
}, [
|
|
2160
|
+
p(h(n) + " ", 1),
|
|
2161
|
+
a.sortKey === n ? (d(), u("span", Vl, h(a.sortOrder === 1 ? "▲" : "▼"), 1)) : m("", !0)
|
|
2162
|
+
], 8, Ol))), 128))
|
|
2163
|
+
])
|
|
2164
|
+
]),
|
|
2165
|
+
t("tbody", null, [
|
|
2166
|
+
(d(!0), u(y, null, x(s.paginatedData, (n, c) => (d(), u("tr", {
|
|
2167
|
+
key: c,
|
|
2168
|
+
class: "bg-white dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600"
|
|
2169
|
+
}, [
|
|
2170
|
+
(d(!0), u(y, null, x(l.columns, (g, C) => (d(), u("td", {
|
|
2171
|
+
key: C,
|
|
2172
|
+
"data-label": g,
|
|
2173
|
+
class: "text-pretty before:content-[attr(data-label)] before:font-bold lg:before:content-none flex md:flex-row flex-col justify-between gap-2 lg:table-cell py-4 px-5 lg:py-2.5 lg:px-4 border dark:border-gray-700"
|
|
2174
|
+
}, [
|
|
2175
|
+
t("p", {
|
|
2176
|
+
class: "text-pretty",
|
|
2177
|
+
innerHTML: n[C]
|
|
2178
|
+
}, null, 8, Dl)
|
|
2179
|
+
], 8, Il))), 128))
|
|
2180
|
+
]))), 128))
|
|
2181
|
+
])
|
|
2182
|
+
])
|
|
2183
|
+
]),
|
|
2184
|
+
t("div", Bl, [
|
|
2185
|
+
t("div", jl, [
|
|
2186
|
+
t("a", {
|
|
2187
|
+
href: "#",
|
|
2188
|
+
onClick: r[2] || (r[2] = (...n) => s.previousPage && s.previousPage(...n)),
|
|
2189
|
+
disabled: a.currentPage === 1,
|
|
2190
|
+
class: "relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"
|
|
2191
|
+
}, "Previous", 8, Ml),
|
|
2192
|
+
t("a", {
|
|
2193
|
+
href: "#",
|
|
2194
|
+
onClick: r[3] || (r[3] = (...n) => s.nextPage && s.nextPage(...n)),
|
|
2195
|
+
disabled: a.currentPage === s.totalPages,
|
|
2196
|
+
class: "relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"
|
|
2197
|
+
}, "Next", 8, El)
|
|
2198
|
+
]),
|
|
2199
|
+
t("div", Nl, [
|
|
2200
|
+
t("div", null, [
|
|
2201
|
+
t("p", Al, [
|
|
2202
|
+
p(" Showing "),
|
|
2203
|
+
t("span", ql, h(s.firstItemIndex), 1),
|
|
2204
|
+
p(" to "),
|
|
2205
|
+
t("span", Ll, h(s.lastItemIndex), 1),
|
|
2206
|
+
p(" of "),
|
|
2207
|
+
t("span", Fl, h(s.filteredData.length), 1),
|
|
2208
|
+
p(" entries ")
|
|
2209
|
+
])
|
|
2210
|
+
]),
|
|
2211
|
+
t("div", null, [
|
|
2212
|
+
t("nav", Rl, [
|
|
2213
|
+
t("ul", Kl, [
|
|
2214
|
+
t("li", null, [
|
|
2215
|
+
t("a", {
|
|
2216
|
+
href: "#",
|
|
2217
|
+
onClick: r[4] || (r[4] = (...n) => s.previousPage && s.previousPage(...n)),
|
|
2218
|
+
disabled: a.currentPage === 1,
|
|
2219
|
+
class: "flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 ms-0 border-e-0 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
|
|
2220
|
+
}, Yl, 8, Ul)
|
|
2221
|
+
]),
|
|
2222
|
+
(d(!0), u(y, null, x(s.displayedPageNumbers, (n) => (d(), u(y, { key: n }, [
|
|
2223
|
+
t("li", null, [
|
|
2224
|
+
a.currentPage !== n ? (d(), u("a", {
|
|
2225
|
+
key: 0,
|
|
2226
|
+
href: "#",
|
|
2227
|
+
onClick: (c) => s.goToPage(n),
|
|
2228
|
+
class: "flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
|
|
2229
|
+
}, h(n), 9, Hl)) : m("", !0)
|
|
2230
|
+
]),
|
|
2231
|
+
t("li", null, [
|
|
2232
|
+
a.currentPage === n ? (d(), u("a", {
|
|
2233
|
+
key: 0,
|
|
2234
|
+
href: "#",
|
|
2235
|
+
onClick: (c) => s.goToPage(n),
|
|
2236
|
+
"aria-current": "page",
|
|
2237
|
+
class: "z-10 flex items-center justify-center h-8 px-3 leading-tight text-blue-600 border border-blue-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white"
|
|
2238
|
+
}, h(n), 9, Jl)) : m("", !0)
|
|
2239
|
+
])
|
|
2240
|
+
], 64))), 128)),
|
|
2241
|
+
t("li", null, [
|
|
2242
|
+
t("a", {
|
|
2243
|
+
href: "#",
|
|
2244
|
+
onClick: r[5] || (r[5] = (...n) => s.nextPage && s.nextPage(...n)),
|
|
2245
|
+
disabled: a.currentPage === s.totalPages,
|
|
2246
|
+
class: "flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
|
|
2247
|
+
}, Ql, 8, Wl)
|
|
2248
|
+
])
|
|
2249
|
+
])
|
|
2250
|
+
])
|
|
2251
|
+
])
|
|
2252
|
+
])
|
|
2253
|
+
])
|
|
2254
|
+
]);
|
|
2255
|
+
}
|
|
2256
|
+
const ys = /* @__PURE__ */ S(yl, [["render", es]]);
|
|
28
2257
|
export {
|
|
29
|
-
|
|
2258
|
+
rs as Card,
|
|
2259
|
+
ms as Dropdown,
|
|
2260
|
+
ss as GLButton,
|
|
2261
|
+
ys as GLDataTable,
|
|
2262
|
+
gs as GLTextarea,
|
|
2263
|
+
hs as Modal,
|
|
2264
|
+
cs as MultiItemSlide,
|
|
2265
|
+
ls as MultiSelectDropdown,
|
|
2266
|
+
us as Tab,
|
|
2267
|
+
ds as TabsWrapper,
|
|
2268
|
+
is as TextInput,
|
|
2269
|
+
as as TextTranslate,
|
|
2270
|
+
ns as TextareaTranslate,
|
|
2271
|
+
os as TinymceTranslate,
|
|
2272
|
+
fs as ToggleBox
|
|
30
2273
|
};
|