golden-logic-ui 1.2.345 → 1.2.346
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/components/GeneralComponents/GlDateTimePicker.vue.js +732 -0
- package/dist/components/GeneralComponents/GlDateTimeRangePicker.vue.js +256 -0
- package/dist/components/GeneralComponents/GlDropdown.vue.js +17 -17
- package/dist/components/GeneralComponents/GlMultiSelectDropdown.vue.js +8 -8
- package/dist/main.js +118 -114
- package/package.json +1 -1
|
@@ -0,0 +1,732 @@
|
|
|
1
|
+
import { ref as p, computed as G, watch as Ce, onMounted as Ne, onUnmounted as $e, createElementBlock as g, openBlock as m, Fragment as q, createCommentVNode as x, normalizeClass as b, createElementVNode as a, toDisplayString as f, withDirectives as Ve, renderList as oe, vShow as Ie } from "vue";
|
|
2
|
+
const Be = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "gl-label-form"
|
|
5
|
+
}, He = { class: "mt-1 text-gray-900 dark:text-white" }, Fe = ["for"], Le = { class: "relative" }, Pe = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "flex items-center"
|
|
8
|
+
}, Ge = ["innerHTML"], qe = { class: "relative w-full" }, Ae = ["required", "name", "id", "value", "placeholder"], ze = ["innerHTML"], Ee = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "relative"
|
|
11
|
+
}, Ue = ["required", "name", "id", "value", "placeholder"], Ze = { class: "absolute z-50 mt-1 bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 p-4 w-full" }, Re = { class: "flex items-center justify-between mb-4" }, We = { class: "text-sm font-semibold text-gray-900 dark:text-white" }, Je = { class: "grid grid-cols-7 gap-1 mb-2" }, Ke = { class: "grid grid-cols-7 gap-1" }, Qe = ["onClick", "disabled"], Xe = { class: "mt-4 pt-3 border-t border-gray-200 dark:border-gray-700" }, je = { class: "flex items-center justify-center gap-2" }, _e = { class: "text-xs font-medium text-gray-500 dark:text-gray-400 me-1" }, Oe = { class: "flex flex-col items-center" }, et = ["value"], tt = { class: "flex flex-col items-center" }, rt = ["value"], at = { class: "flex flex-col gap-1 ms-1" }, nt = { class: "flex items-center justify-between mt-4 pt-3 border-t border-gray-200 dark:border-gray-700" }, ot = { class: "flex items-center gap-3" }, lt = { class: "gl-span-form-error" }, st = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" }, ut = {
|
|
12
|
+
__name: "GlDateTimePicker",
|
|
13
|
+
props: {
|
|
14
|
+
is_required: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: !1
|
|
17
|
+
},
|
|
18
|
+
show: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
22
|
+
error_message: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ""
|
|
25
|
+
},
|
|
26
|
+
modelValue: {
|
|
27
|
+
type: [String, Date],
|
|
28
|
+
default: ""
|
|
29
|
+
},
|
|
30
|
+
field_name: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
},
|
|
34
|
+
label_name: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ""
|
|
37
|
+
},
|
|
38
|
+
description: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: ""
|
|
41
|
+
},
|
|
42
|
+
placeholder: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: "Select date & time"
|
|
45
|
+
},
|
|
46
|
+
input_class: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: ""
|
|
49
|
+
},
|
|
50
|
+
container_class: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: ""
|
|
53
|
+
},
|
|
54
|
+
// Date format options
|
|
55
|
+
date_format: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: "YYYY-MM-DD"
|
|
58
|
+
// Options: YYYY-MM-DD, DD-MM-YYYY, MM-DD-YYYY, DD/MM/YYYY, MM/DD/YYYY, YYYY/MM/DD
|
|
59
|
+
},
|
|
60
|
+
// Step (in minutes) used when stepping the minute selector
|
|
61
|
+
minute_step: {
|
|
62
|
+
type: Number,
|
|
63
|
+
default: 1
|
|
64
|
+
},
|
|
65
|
+
// Min and max date constraints
|
|
66
|
+
// Accepts: "YYYY-MM-DD" or relative: "+3m", "-1y", "+7d", "today"
|
|
67
|
+
min_date: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: null
|
|
70
|
+
},
|
|
71
|
+
// Accepts: "YYYY-MM-DD" or relative: "+3m", "-1y", "+7d", "today"
|
|
72
|
+
max_date: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: null
|
|
75
|
+
},
|
|
76
|
+
// Disable specific days (0 = Sunday, 6 = Saturday)
|
|
77
|
+
disabled_days: {
|
|
78
|
+
type: Array,
|
|
79
|
+
default: () => []
|
|
80
|
+
},
|
|
81
|
+
// Disable specific dates (array of date strings in any supported format or Date objects)
|
|
82
|
+
// Example: ["2026-01-15", "2026-02-20", "25-12-2026"]
|
|
83
|
+
disabled_dates: {
|
|
84
|
+
type: Array,
|
|
85
|
+
default: () => []
|
|
86
|
+
},
|
|
87
|
+
// Locale for month/day names
|
|
88
|
+
locale: {
|
|
89
|
+
type: String,
|
|
90
|
+
default: "en"
|
|
91
|
+
},
|
|
92
|
+
inputGroupType: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: ""
|
|
95
|
+
},
|
|
96
|
+
inputGroupText: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: ""
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
emits: ["update:modelValue", "change", "blur-sm"],
|
|
102
|
+
setup(n, { expose: le, emit: se }) {
|
|
103
|
+
const s = n, h = se, Y = p(null), F = p(null), D = p(!1), u = p((/* @__PURE__ */ new Date()).getMonth()), c = p((/* @__PURE__ */ new Date()).getFullYear()), k = p(12), w = p(0), C = p("AM"), A = (t) => {
|
|
104
|
+
if (!t) return null;
|
|
105
|
+
if (t.toLowerCase() === "today")
|
|
106
|
+
return /* @__PURE__ */ new Date();
|
|
107
|
+
const e = t.match(/^([+-]?)(\d+)([dmy])$/i);
|
|
108
|
+
if (e) {
|
|
109
|
+
const l = e[1] === "-" ? -1 : 1, y = parseInt(e[2]) * l, d = e[3].toLowerCase(), i = /* @__PURE__ */ new Date();
|
|
110
|
+
return d === "d" ? i.setDate(i.getDate() + y) : d === "m" ? i.setMonth(i.getMonth() + y) : d === "y" && i.setFullYear(i.getFullYear() + y), i;
|
|
111
|
+
}
|
|
112
|
+
const r = Z(t);
|
|
113
|
+
if (r) return r;
|
|
114
|
+
const o = new Date(t);
|
|
115
|
+
return isNaN(o.getTime()) ? null : o;
|
|
116
|
+
}, ie = G(() => {
|
|
117
|
+
const t = [];
|
|
118
|
+
for (let e = 0; e < 12; e++) {
|
|
119
|
+
const r = new Date(2e3, e, 1);
|
|
120
|
+
t.push(r.toLocaleDateString(s.locale, { month: "long" }));
|
|
121
|
+
}
|
|
122
|
+
return t;
|
|
123
|
+
}), ue = G(() => {
|
|
124
|
+
const t = [];
|
|
125
|
+
for (let e = 0; e < 7; e++) {
|
|
126
|
+
const r = new Date(2e3, 0, 2 + e);
|
|
127
|
+
t.push(r.toLocaleDateString(s.locale, { weekday: "short" }));
|
|
128
|
+
}
|
|
129
|
+
return t;
|
|
130
|
+
}), z = (t, e) => {
|
|
131
|
+
let r = t % 12;
|
|
132
|
+
return e === "PM" && (r += 12), r;
|
|
133
|
+
}, E = (t) => {
|
|
134
|
+
const e = t >= 12 ? "PM" : "AM";
|
|
135
|
+
let r = t % 12;
|
|
136
|
+
return r === 0 && (r = 12), { hour: r, meridiem: e };
|
|
137
|
+
}, de = (t) => {
|
|
138
|
+
const e = t.getFullYear(), r = String(t.getMonth() + 1).padStart(2, "0"), o = String(t.getDate()).padStart(2, "0");
|
|
139
|
+
switch (s.date_format) {
|
|
140
|
+
case "DD-MM-YYYY":
|
|
141
|
+
return `${o}-${r}-${e}`;
|
|
142
|
+
case "MM-DD-YYYY":
|
|
143
|
+
return `${r}-${o}-${e}`;
|
|
144
|
+
case "DD/MM/YYYY":
|
|
145
|
+
return `${o}/${r}/${e}`;
|
|
146
|
+
case "MM/DD/YYYY":
|
|
147
|
+
return `${r}/${o}/${e}`;
|
|
148
|
+
case "YYYY/MM/DD":
|
|
149
|
+
return `${e}/${r}/${o}`;
|
|
150
|
+
default:
|
|
151
|
+
return `${e}-${r}-${o}`;
|
|
152
|
+
}
|
|
153
|
+
}, ce = (t) => {
|
|
154
|
+
const { hour: e, meridiem: r } = E(t.getHours()), o = String(e).padStart(2, "0"), l = String(t.getMinutes()).padStart(2, "0");
|
|
155
|
+
return `${o}:${l} ${r}`;
|
|
156
|
+
}, V = (t) => {
|
|
157
|
+
if (!t) return "";
|
|
158
|
+
let e;
|
|
159
|
+
return typeof t == "string" && (e = T(t)), (!e || isNaN(e.getTime())) && (e = new Date(t)), isNaN(e.getTime()) ? "" : `${de(e)} ${ce(e)}`;
|
|
160
|
+
}, U = (t) => {
|
|
161
|
+
if (!t) return null;
|
|
162
|
+
let e, r, o;
|
|
163
|
+
const l = t.split(/[-/]/);
|
|
164
|
+
if (l.length !== 3) return null;
|
|
165
|
+
switch (s.date_format) {
|
|
166
|
+
case "DD-MM-YYYY":
|
|
167
|
+
case "DD/MM/YYYY":
|
|
168
|
+
o = parseInt(l[0]), r = parseInt(l[1]) - 1, e = parseInt(l[2]);
|
|
169
|
+
break;
|
|
170
|
+
case "MM-DD-YYYY":
|
|
171
|
+
case "MM/DD/YYYY":
|
|
172
|
+
r = parseInt(l[0]) - 1, o = parseInt(l[1]), e = parseInt(l[2]);
|
|
173
|
+
break;
|
|
174
|
+
default:
|
|
175
|
+
e = parseInt(l[0]), r = parseInt(l[1]) - 1, o = parseInt(l[2]);
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
return { year: e, month: r, day: o };
|
|
179
|
+
}, Z = (t) => {
|
|
180
|
+
if (!t) return null;
|
|
181
|
+
const e = String(t).trim().split(" ")[0], r = U(e);
|
|
182
|
+
if (!r) return null;
|
|
183
|
+
const { year: o, month: l, day: y } = r, d = new Date(o, l, y);
|
|
184
|
+
return isNaN(d.getTime()) || d.getFullYear() !== o || d.getMonth() !== l || d.getDate() !== y ? null : d;
|
|
185
|
+
}, T = (t) => {
|
|
186
|
+
if (!t) return null;
|
|
187
|
+
const e = String(t).trim(), r = e.indexOf(" "), o = r === -1 ? e : e.slice(0, r), l = r === -1 ? "" : e.slice(r + 1).trim(), y = U(o);
|
|
188
|
+
if (!y) return null;
|
|
189
|
+
let d = 0, i = 0;
|
|
190
|
+
if (l) {
|
|
191
|
+
const $ = l.match(/^(\d{1,2}):(\d{2})\s*(AM|PM)?$/i);
|
|
192
|
+
if ($) {
|
|
193
|
+
const ae = parseInt($[1]);
|
|
194
|
+
i = parseInt($[2]);
|
|
195
|
+
const ne = $[3] ? $[3].toUpperCase() : null;
|
|
196
|
+
ne ? d = z(ae, ne) : d = ae;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
const { year: ee, month: te, day: re } = y, N = new Date(ee, te, re, d, i);
|
|
200
|
+
return isNaN(N.getTime()) || N.getFullYear() !== ee || N.getMonth() !== te || N.getDate() !== re ? null : N;
|
|
201
|
+
}, v = p(""), L = p(!1), I = (t) => {
|
|
202
|
+
if (!t) return;
|
|
203
|
+
let e = typeof t == "string" ? T(t) : null;
|
|
204
|
+
if ((!e || isNaN(e.getTime())) && (e = new Date(t)), isNaN(e.getTime())) return;
|
|
205
|
+
const { hour: r, meridiem: o } = E(e.getHours());
|
|
206
|
+
k.value = r, w.value = e.getMinutes(), C.value = o;
|
|
207
|
+
};
|
|
208
|
+
Ce(() => s.modelValue, (t) => {
|
|
209
|
+
L.value || (v.value = V(t), I(t));
|
|
210
|
+
}, { immediate: !0 });
|
|
211
|
+
const R = (t) => {
|
|
212
|
+
const e = t.target.value;
|
|
213
|
+
v.value = e, e === "" && (h("update:modelValue", ""), h("change", ""));
|
|
214
|
+
}, W = (t) => {
|
|
215
|
+
L.value = !1;
|
|
216
|
+
const e = v.value, r = T(e);
|
|
217
|
+
if (r && !isNaN(r.getTime()) && !S(r)) {
|
|
218
|
+
const o = V(r);
|
|
219
|
+
v.value = o, I(o), h("update:modelValue", o), h("change", o);
|
|
220
|
+
} else e !== "" && (v.value = V(s.modelValue));
|
|
221
|
+
h("blur-sm", t);
|
|
222
|
+
}, ge = G(() => {
|
|
223
|
+
const t = new Date(c.value, u.value, 1), e = new Date(c.value, u.value + 1, 0), r = t.getDay(), o = e.getDate(), l = [], y = new Date(c.value, u.value, 0).getDate();
|
|
224
|
+
for (let i = r - 1; i >= 0; i--)
|
|
225
|
+
l.push({
|
|
226
|
+
day: y - i,
|
|
227
|
+
currentMonth: !1,
|
|
228
|
+
date: new Date(c.value, u.value - 1, y - i)
|
|
229
|
+
});
|
|
230
|
+
for (let i = 1; i <= o; i++)
|
|
231
|
+
l.push({
|
|
232
|
+
day: i,
|
|
233
|
+
currentMonth: !0,
|
|
234
|
+
date: new Date(c.value, u.value, i)
|
|
235
|
+
});
|
|
236
|
+
const d = 42 - l.length;
|
|
237
|
+
for (let i = 1; i <= d; i++)
|
|
238
|
+
l.push({
|
|
239
|
+
day: i,
|
|
240
|
+
currentMonth: !1,
|
|
241
|
+
date: new Date(c.value, u.value + 1, i)
|
|
242
|
+
});
|
|
243
|
+
return l;
|
|
244
|
+
}), S = (t) => {
|
|
245
|
+
if (s.disabled_days.includes(t.getDay()))
|
|
246
|
+
return !0;
|
|
247
|
+
if (s.disabled_dates && s.disabled_dates.length > 0) {
|
|
248
|
+
const r = new Date(t);
|
|
249
|
+
r.setHours(0, 0, 0, 0);
|
|
250
|
+
for (const o of s.disabled_dates) {
|
|
251
|
+
let l;
|
|
252
|
+
if (typeof o == "string" ? (l = Z(o), (!l || isNaN(l.getTime())) && (l = new Date(o))) : o instanceof Date && (l = o), l && !isNaN(l.getTime()) && (l.setHours(0, 0, 0, 0), r.getTime() === l.getTime()))
|
|
253
|
+
return !0;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const e = new Date(t);
|
|
257
|
+
if (e.setHours(0, 0, 0, 0), s.min_date) {
|
|
258
|
+
const r = A(s.min_date);
|
|
259
|
+
if (r && (r.setHours(0, 0, 0, 0), e < r))
|
|
260
|
+
return !0;
|
|
261
|
+
}
|
|
262
|
+
if (s.max_date) {
|
|
263
|
+
const r = A(s.max_date);
|
|
264
|
+
if (r && (r.setHours(0, 0, 0, 0), e > r))
|
|
265
|
+
return !0;
|
|
266
|
+
}
|
|
267
|
+
return !1;
|
|
268
|
+
}, B = (t) => {
|
|
269
|
+
if (!s.modelValue) return !1;
|
|
270
|
+
const e = T(s.modelValue) || new Date(s.modelValue);
|
|
271
|
+
return isNaN(e.getTime()) ? !1 : t.toDateString() === e.toDateString();
|
|
272
|
+
}, me = (t) => t.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), fe = (t) => {
|
|
273
|
+
const e = z(k.value, C.value);
|
|
274
|
+
return new Date(
|
|
275
|
+
t.getFullYear(),
|
|
276
|
+
t.getMonth(),
|
|
277
|
+
t.getDate(),
|
|
278
|
+
e,
|
|
279
|
+
w.value
|
|
280
|
+
);
|
|
281
|
+
}, P = (t) => {
|
|
282
|
+
const e = fe(t), r = V(e);
|
|
283
|
+
v.value = r, h("update:modelValue", r), h("change", r);
|
|
284
|
+
}, ye = () => {
|
|
285
|
+
const t = T(s.modelValue);
|
|
286
|
+
return t && !isNaN(t.getTime()) ? t : /* @__PURE__ */ new Date();
|
|
287
|
+
}, ve = (t) => {
|
|
288
|
+
S(t.date) || P(t.date);
|
|
289
|
+
}, M = () => {
|
|
290
|
+
s.modelValue && P(ye());
|
|
291
|
+
}, J = (t) => {
|
|
292
|
+
C.value = t, M();
|
|
293
|
+
}, K = (t) => {
|
|
294
|
+
let e = k.value + t;
|
|
295
|
+
e > 12 && (e = 1), e < 1 && (e = 12), k.value = e, M();
|
|
296
|
+
}, Q = (t) => {
|
|
297
|
+
let e = w.value + t * s.minute_step;
|
|
298
|
+
e > 59 && (e = 0), e < 0 && (e = 59 - (59 - e) % 60), w.value = (e % 60 + 60) % 60, M();
|
|
299
|
+
}, pe = (t) => {
|
|
300
|
+
let e = t.target.value.replace(/\D/g, "").slice(0, 2), r = parseInt(e);
|
|
301
|
+
isNaN(r) && (r = 0), r > 12 && (r = 12), e !== "" && r < 1 && (r = 1), t.target.value = e === "" ? "" : String(r), e !== "" && (k.value = r, M());
|
|
302
|
+
}, he = (t) => {
|
|
303
|
+
let e = t.target.value.replace(/\D/g, "").slice(0, 2), r = parseInt(e);
|
|
304
|
+
isNaN(r) && (r = 0), r > 59 && (r = 59), r < 0 && (r = 0), t.target.value = e === "" ? "" : String(r), e !== "" && (w.value = r, M());
|
|
305
|
+
}, ke = (t) => {
|
|
306
|
+
k.value < 1 && (k.value = 12), t.target.value = String(k.value).padStart(2, "0"), M();
|
|
307
|
+
}, xe = (t) => {
|
|
308
|
+
t.target.value = String(w.value).padStart(2, "0"), M();
|
|
309
|
+
}, be = () => {
|
|
310
|
+
u.value === 0 ? (u.value = 11, c.value--) : u.value--;
|
|
311
|
+
}, De = () => {
|
|
312
|
+
u.value === 11 ? (u.value = 0, c.value++) : u.value++;
|
|
313
|
+
}, we = () => {
|
|
314
|
+
c.value--;
|
|
315
|
+
}, Me = () => {
|
|
316
|
+
c.value++;
|
|
317
|
+
}, X = {
|
|
318
|
+
en: {
|
|
319
|
+
clear: "Clear",
|
|
320
|
+
now: "Now",
|
|
321
|
+
done: "Done",
|
|
322
|
+
time: "Time"
|
|
323
|
+
},
|
|
324
|
+
ar: {
|
|
325
|
+
clear: "مسح",
|
|
326
|
+
now: "الآن",
|
|
327
|
+
done: "تم",
|
|
328
|
+
time: "الوقت"
|
|
329
|
+
}
|
|
330
|
+
}, Ye = () => s.locale && s.locale.startsWith("ar") ? "ar" : "en", H = (t) => {
|
|
331
|
+
const e = Ye();
|
|
332
|
+
return X[e][t] || X.en[t] || t;
|
|
333
|
+
}, Te = () => {
|
|
334
|
+
const t = /* @__PURE__ */ new Date();
|
|
335
|
+
u.value = t.getMonth(), c.value = t.getFullYear(), I(t), P(t);
|
|
336
|
+
}, Se = () => {
|
|
337
|
+
v.value = "", h("update:modelValue", ""), h("change", ""), D.value = !1;
|
|
338
|
+
}, j = () => {
|
|
339
|
+
L.value = !0;
|
|
340
|
+
}, _ = () => {
|
|
341
|
+
if (D.value = !D.value, D.value && s.modelValue) {
|
|
342
|
+
const t = T(s.modelValue) || new Date(s.modelValue);
|
|
343
|
+
isNaN(t.getTime()) || (u.value = t.getMonth(), c.value = t.getFullYear(), I(t));
|
|
344
|
+
}
|
|
345
|
+
}, O = (t) => {
|
|
346
|
+
F.value && !F.value.contains(t.target) && (D.value = !1);
|
|
347
|
+
};
|
|
348
|
+
return Ne(() => {
|
|
349
|
+
document.addEventListener("click", O), Y.value !== null && Y.value.hasAttribute("autofocus") && Y.value.focus();
|
|
350
|
+
}), $e(() => {
|
|
351
|
+
document.removeEventListener("click", O);
|
|
352
|
+
}), le({ focus: () => Y.value?.focus() }), (t, e) => (m(), g(q, null, [
|
|
353
|
+
n.show ? (m(), g("div", {
|
|
354
|
+
key: 0,
|
|
355
|
+
class: b(n.field_name)
|
|
356
|
+
}, [
|
|
357
|
+
n.label_name ? (m(), g("label", Be, f(n.label_name), 1)) : x("", !0),
|
|
358
|
+
a("p", He, f(v.value), 1),
|
|
359
|
+
e[7] || (e[7] = a("hr", { class: "opacity-100! bg-gray-200 border-0 dark:bg-gray-700" }, null, -1))
|
|
360
|
+
], 2)) : x("", !0),
|
|
361
|
+
n.show ? x("", !0) : (m(), g("div", {
|
|
362
|
+
key: 1,
|
|
363
|
+
class: b({
|
|
364
|
+
[n.field_name]: n.field_name && n.field_name !== "",
|
|
365
|
+
[n.container_class]: n.container_class && n.container_class !== ""
|
|
366
|
+
}),
|
|
367
|
+
ref_key: "datepickerContainer",
|
|
368
|
+
ref: F
|
|
369
|
+
}, [
|
|
370
|
+
n.label_name ? (m(), g("label", {
|
|
371
|
+
key: 0,
|
|
372
|
+
class: b({
|
|
373
|
+
"gl-label-form": n.error_message == "",
|
|
374
|
+
"gl-label-form-invalid": n.error_message !== "",
|
|
375
|
+
required: n.is_required
|
|
376
|
+
}),
|
|
377
|
+
for: n.field_name
|
|
378
|
+
}, f(n.label_name), 11, Fe)) : x("", !0),
|
|
379
|
+
a("div", Le, [
|
|
380
|
+
n.inputGroupType ? (m(), g("div", Pe, [
|
|
381
|
+
n.inputGroupType == "prepend" ? (m(), g("label", {
|
|
382
|
+
key: 0,
|
|
383
|
+
innerHTML: n.inputGroupText,
|
|
384
|
+
class: "h-10 z-10 inline-flex items-center shrink-0 px-4 text-sm font-medium text-center text-gray-500 bg-gray-100 border border-gray-300 dark:text-gray-400 rounded-s-lg focus:outline-hidden dark:bg-gray-700 dark:border-gray-600"
|
|
385
|
+
}, null, 8, Ge)) : x("", !0),
|
|
386
|
+
a("div", qe, [
|
|
387
|
+
a("input", {
|
|
388
|
+
type: "text",
|
|
389
|
+
class: b(["rtl:text-right rounded-none!", {
|
|
390
|
+
"gl-input-form": n.error_message == "",
|
|
391
|
+
"gl-input-form-invalid": n.error_message !== "",
|
|
392
|
+
[n.input_class]: n.input_class && n.input_class !== "",
|
|
393
|
+
"border-e-0! rounded-s-lg!": n.inputGroupType == "append",
|
|
394
|
+
"border-s-0! rounded-e-lg!": n.inputGroupType == "prepend"
|
|
395
|
+
}]),
|
|
396
|
+
required: n.is_required,
|
|
397
|
+
name: n.field_name,
|
|
398
|
+
id: n.field_name,
|
|
399
|
+
value: v.value,
|
|
400
|
+
onInput: R,
|
|
401
|
+
onFocus: j,
|
|
402
|
+
onBlur: W,
|
|
403
|
+
ref_key: "input",
|
|
404
|
+
ref: Y,
|
|
405
|
+
placeholder: n.placeholder
|
|
406
|
+
}, null, 42, Ae),
|
|
407
|
+
a("div", {
|
|
408
|
+
class: "absolute inset-y-0 end-0 flex items-center pe-3 cursor-pointer",
|
|
409
|
+
onClick: _
|
|
410
|
+
}, e[8] || (e[8] = [
|
|
411
|
+
a("svg", {
|
|
412
|
+
class: "w-4 h-4 text-gray-500 dark:text-gray-400",
|
|
413
|
+
"aria-hidden": "true",
|
|
414
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
415
|
+
fill: "none",
|
|
416
|
+
stroke: "currentColor",
|
|
417
|
+
viewBox: "0 0 24 24"
|
|
418
|
+
}, [
|
|
419
|
+
a("path", {
|
|
420
|
+
"stroke-linecap": "round",
|
|
421
|
+
"stroke-linejoin": "round",
|
|
422
|
+
"stroke-width": "2",
|
|
423
|
+
d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2Zm7-6 1.5 1.5"
|
|
424
|
+
})
|
|
425
|
+
], -1)
|
|
426
|
+
]))
|
|
427
|
+
]),
|
|
428
|
+
n.inputGroupType == "append" ? (m(), g("label", {
|
|
429
|
+
key: 1,
|
|
430
|
+
innerHTML: n.inputGroupText,
|
|
431
|
+
class: "h-10 z-10 inline-flex items-center shrink-0 px-4 text-sm font-medium text-center text-gray-500 bg-gray-100 border border-gray-300 dark:text-gray-400 rounded-e-lg focus:outline-hidden dark:bg-gray-700 dark:border-gray-600"
|
|
432
|
+
}, null, 8, ze)) : x("", !0)
|
|
433
|
+
])) : x("", !0),
|
|
434
|
+
n.inputGroupType == "" ? (m(), g("div", Ee, [
|
|
435
|
+
a("input", {
|
|
436
|
+
type: "text",
|
|
437
|
+
class: b(["rtl:text-right pe-10", {
|
|
438
|
+
"gl-input-form": n.error_message == "",
|
|
439
|
+
"gl-input-form-invalid": n.error_message !== "",
|
|
440
|
+
[n.input_class]: n.input_class && n.input_class !== ""
|
|
441
|
+
}]),
|
|
442
|
+
required: n.is_required,
|
|
443
|
+
name: n.field_name,
|
|
444
|
+
id: n.field_name,
|
|
445
|
+
value: v.value,
|
|
446
|
+
onInput: R,
|
|
447
|
+
onFocus: j,
|
|
448
|
+
onBlur: W,
|
|
449
|
+
ref_key: "input",
|
|
450
|
+
ref: Y,
|
|
451
|
+
placeholder: n.placeholder
|
|
452
|
+
}, null, 42, Ue),
|
|
453
|
+
a("div", {
|
|
454
|
+
class: "absolute inset-y-0 end-0 flex items-center pe-3 cursor-pointer",
|
|
455
|
+
onClick: _
|
|
456
|
+
}, e[9] || (e[9] = [
|
|
457
|
+
a("svg", {
|
|
458
|
+
class: "w-4 h-4 text-gray-500 dark:text-gray-400",
|
|
459
|
+
"aria-hidden": "true",
|
|
460
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
461
|
+
fill: "none",
|
|
462
|
+
stroke: "currentColor",
|
|
463
|
+
viewBox: "0 0 24 24"
|
|
464
|
+
}, [
|
|
465
|
+
a("path", {
|
|
466
|
+
"stroke-linecap": "round",
|
|
467
|
+
"stroke-linejoin": "round",
|
|
468
|
+
"stroke-width": "2",
|
|
469
|
+
d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2Zm7-6 1.5 1.5"
|
|
470
|
+
})
|
|
471
|
+
], -1)
|
|
472
|
+
]))
|
|
473
|
+
])) : x("", !0),
|
|
474
|
+
Ve(a("div", Ze, [
|
|
475
|
+
a("div", Re, [
|
|
476
|
+
a("button", {
|
|
477
|
+
type: "button",
|
|
478
|
+
onClick: we,
|
|
479
|
+
class: "p-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded text-gray-500 dark:text-gray-400"
|
|
480
|
+
}, e[10] || (e[10] = [
|
|
481
|
+
a("svg", {
|
|
482
|
+
class: "w-4 h-4",
|
|
483
|
+
fill: "none",
|
|
484
|
+
stroke: "currentColor",
|
|
485
|
+
viewBox: "0 0 24 24"
|
|
486
|
+
}, [
|
|
487
|
+
a("path", {
|
|
488
|
+
"stroke-linecap": "round",
|
|
489
|
+
"stroke-linejoin": "round",
|
|
490
|
+
"stroke-width": "2",
|
|
491
|
+
d: "M11 19l-7-7 7-7m8 14l-7-7 7-7"
|
|
492
|
+
})
|
|
493
|
+
], -1)
|
|
494
|
+
])),
|
|
495
|
+
a("button", {
|
|
496
|
+
type: "button",
|
|
497
|
+
onClick: be,
|
|
498
|
+
class: "p-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded text-gray-500 dark:text-gray-400"
|
|
499
|
+
}, e[11] || (e[11] = [
|
|
500
|
+
a("svg", {
|
|
501
|
+
class: "w-4 h-4",
|
|
502
|
+
fill: "none",
|
|
503
|
+
stroke: "currentColor",
|
|
504
|
+
viewBox: "0 0 24 24"
|
|
505
|
+
}, [
|
|
506
|
+
a("path", {
|
|
507
|
+
"stroke-linecap": "round",
|
|
508
|
+
"stroke-linejoin": "round",
|
|
509
|
+
"stroke-width": "2",
|
|
510
|
+
d: "M15 19l-7-7 7-7"
|
|
511
|
+
})
|
|
512
|
+
], -1)
|
|
513
|
+
])),
|
|
514
|
+
a("span", We, f(ie.value[u.value]) + " " + f(c.value), 1),
|
|
515
|
+
a("button", {
|
|
516
|
+
type: "button",
|
|
517
|
+
onClick: De,
|
|
518
|
+
class: "p-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded text-gray-500 dark:text-gray-400"
|
|
519
|
+
}, e[12] || (e[12] = [
|
|
520
|
+
a("svg", {
|
|
521
|
+
class: "w-4 h-4",
|
|
522
|
+
fill: "none",
|
|
523
|
+
stroke: "currentColor",
|
|
524
|
+
viewBox: "0 0 24 24"
|
|
525
|
+
}, [
|
|
526
|
+
a("path", {
|
|
527
|
+
"stroke-linecap": "round",
|
|
528
|
+
"stroke-linejoin": "round",
|
|
529
|
+
"stroke-width": "2",
|
|
530
|
+
d: "M9 5l7 7-7 7"
|
|
531
|
+
})
|
|
532
|
+
], -1)
|
|
533
|
+
])),
|
|
534
|
+
a("button", {
|
|
535
|
+
type: "button",
|
|
536
|
+
onClick: Me,
|
|
537
|
+
class: "p-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded text-gray-500 dark:text-gray-400"
|
|
538
|
+
}, e[13] || (e[13] = [
|
|
539
|
+
a("svg", {
|
|
540
|
+
class: "w-4 h-4",
|
|
541
|
+
fill: "none",
|
|
542
|
+
stroke: "currentColor",
|
|
543
|
+
viewBox: "0 0 24 24"
|
|
544
|
+
}, [
|
|
545
|
+
a("path", {
|
|
546
|
+
"stroke-linecap": "round",
|
|
547
|
+
"stroke-linejoin": "round",
|
|
548
|
+
"stroke-width": "2",
|
|
549
|
+
d: "M13 5l7 7-7 7m-8-14l7 7-7 7"
|
|
550
|
+
})
|
|
551
|
+
], -1)
|
|
552
|
+
]))
|
|
553
|
+
]),
|
|
554
|
+
a("div", Je, [
|
|
555
|
+
(m(!0), g(q, null, oe(ue.value, (r) => (m(), g("div", {
|
|
556
|
+
key: r,
|
|
557
|
+
class: "text-center text-xs font-medium text-gray-500 dark:text-gray-400 py-1"
|
|
558
|
+
}, f(r), 1))), 128))
|
|
559
|
+
]),
|
|
560
|
+
a("div", Ke, [
|
|
561
|
+
(m(!0), g(q, null, oe(ge.value, (r, o) => (m(), g("button", {
|
|
562
|
+
key: o,
|
|
563
|
+
type: "button",
|
|
564
|
+
onClick: (l) => ve(r),
|
|
565
|
+
disabled: S(r.date),
|
|
566
|
+
class: b([
|
|
567
|
+
"w-8 h-8 text-sm rounded-full flex items-center justify-center transition-colors",
|
|
568
|
+
{
|
|
569
|
+
"text-gray-400 dark:text-gray-600": !r.currentMonth,
|
|
570
|
+
"text-gray-900 dark:text-white": r.currentMonth && !B(r.date) && !S(r.date),
|
|
571
|
+
"bg-primary dark:bg-primaryDark text-white hover:bg-primary/90 dark:hover:bg-primaryDark/90": B(r.date),
|
|
572
|
+
"ring-2 ring-primary dark:ring-primaryDark ring-offset-1 dark:ring-offset-gray-800": me(r.date) && !B(r.date),
|
|
573
|
+
"hover:bg-gray-100 dark:hover:bg-gray-700": !B(r.date) && !S(r.date),
|
|
574
|
+
"opacity-50 cursor-not-allowed": S(r.date)
|
|
575
|
+
}
|
|
576
|
+
])
|
|
577
|
+
}, f(r.day), 11, Qe))), 128))
|
|
578
|
+
]),
|
|
579
|
+
a("div", Xe, [
|
|
580
|
+
a("div", je, [
|
|
581
|
+
a("span", _e, f(H("time")), 1),
|
|
582
|
+
a("div", Oe, [
|
|
583
|
+
a("button", {
|
|
584
|
+
type: "button",
|
|
585
|
+
onClick: e[0] || (e[0] = (r) => K(1)),
|
|
586
|
+
class: "p-1 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"
|
|
587
|
+
}, e[14] || (e[14] = [
|
|
588
|
+
a("svg", {
|
|
589
|
+
class: "w-3 h-3",
|
|
590
|
+
fill: "none",
|
|
591
|
+
stroke: "currentColor",
|
|
592
|
+
viewBox: "0 0 24 24"
|
|
593
|
+
}, [
|
|
594
|
+
a("path", {
|
|
595
|
+
"stroke-linecap": "round",
|
|
596
|
+
"stroke-linejoin": "round",
|
|
597
|
+
"stroke-width": "2",
|
|
598
|
+
d: "M5 15l7-7 7 7"
|
|
599
|
+
})
|
|
600
|
+
], -1)
|
|
601
|
+
])),
|
|
602
|
+
a("input", {
|
|
603
|
+
type: "text",
|
|
604
|
+
inputmode: "numeric",
|
|
605
|
+
maxlength: "2",
|
|
606
|
+
value: String(k.value).padStart(2, "0"),
|
|
607
|
+
onInput: pe,
|
|
608
|
+
onBlur: ke,
|
|
609
|
+
class: "w-12 text-center text-sm rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white py-1 focus:outline-hidden focus:ring-2 focus:ring-primary dark:focus:ring-primaryDark"
|
|
610
|
+
}, null, 40, et),
|
|
611
|
+
a("button", {
|
|
612
|
+
type: "button",
|
|
613
|
+
onClick: e[1] || (e[1] = (r) => K(-1)),
|
|
614
|
+
class: "p-1 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"
|
|
615
|
+
}, e[15] || (e[15] = [
|
|
616
|
+
a("svg", {
|
|
617
|
+
class: "w-3 h-3",
|
|
618
|
+
fill: "none",
|
|
619
|
+
stroke: "currentColor",
|
|
620
|
+
viewBox: "0 0 24 24"
|
|
621
|
+
}, [
|
|
622
|
+
a("path", {
|
|
623
|
+
"stroke-linecap": "round",
|
|
624
|
+
"stroke-linejoin": "round",
|
|
625
|
+
"stroke-width": "2",
|
|
626
|
+
d: "M19 9l-7 7-7-7"
|
|
627
|
+
})
|
|
628
|
+
], -1)
|
|
629
|
+
]))
|
|
630
|
+
]),
|
|
631
|
+
e[18] || (e[18] = a("span", { class: "text-lg font-semibold text-gray-900 dark:text-white pb-1" }, ":", -1)),
|
|
632
|
+
a("div", tt, [
|
|
633
|
+
a("button", {
|
|
634
|
+
type: "button",
|
|
635
|
+
onClick: e[2] || (e[2] = (r) => Q(1)),
|
|
636
|
+
class: "p-1 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"
|
|
637
|
+
}, e[16] || (e[16] = [
|
|
638
|
+
a("svg", {
|
|
639
|
+
class: "w-3 h-3",
|
|
640
|
+
fill: "none",
|
|
641
|
+
stroke: "currentColor",
|
|
642
|
+
viewBox: "0 0 24 24"
|
|
643
|
+
}, [
|
|
644
|
+
a("path", {
|
|
645
|
+
"stroke-linecap": "round",
|
|
646
|
+
"stroke-linejoin": "round",
|
|
647
|
+
"stroke-width": "2",
|
|
648
|
+
d: "M5 15l7-7 7 7"
|
|
649
|
+
})
|
|
650
|
+
], -1)
|
|
651
|
+
])),
|
|
652
|
+
a("input", {
|
|
653
|
+
type: "text",
|
|
654
|
+
inputmode: "numeric",
|
|
655
|
+
maxlength: "2",
|
|
656
|
+
value: String(w.value).padStart(2, "0"),
|
|
657
|
+
onInput: he,
|
|
658
|
+
onBlur: xe,
|
|
659
|
+
class: "w-12 text-center text-sm rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white py-1 focus:outline-hidden focus:ring-2 focus:ring-primary dark:focus:ring-primaryDark"
|
|
660
|
+
}, null, 40, rt),
|
|
661
|
+
a("button", {
|
|
662
|
+
type: "button",
|
|
663
|
+
onClick: e[3] || (e[3] = (r) => Q(-1)),
|
|
664
|
+
class: "p-1 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"
|
|
665
|
+
}, e[17] || (e[17] = [
|
|
666
|
+
a("svg", {
|
|
667
|
+
class: "w-3 h-3",
|
|
668
|
+
fill: "none",
|
|
669
|
+
stroke: "currentColor",
|
|
670
|
+
viewBox: "0 0 24 24"
|
|
671
|
+
}, [
|
|
672
|
+
a("path", {
|
|
673
|
+
"stroke-linecap": "round",
|
|
674
|
+
"stroke-linejoin": "round",
|
|
675
|
+
"stroke-width": "2",
|
|
676
|
+
d: "M19 9l-7 7-7-7"
|
|
677
|
+
})
|
|
678
|
+
], -1)
|
|
679
|
+
]))
|
|
680
|
+
]),
|
|
681
|
+
a("div", at, [
|
|
682
|
+
a("button", {
|
|
683
|
+
type: "button",
|
|
684
|
+
onClick: e[4] || (e[4] = (r) => J("AM")),
|
|
685
|
+
class: b([
|
|
686
|
+
"px-2 py-1 text-xs font-medium rounded-md transition-colors",
|
|
687
|
+
C.value === "AM" ? "bg-primary dark:bg-primaryDark text-white" : "bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"
|
|
688
|
+
])
|
|
689
|
+
}, " AM ", 2),
|
|
690
|
+
a("button", {
|
|
691
|
+
type: "button",
|
|
692
|
+
onClick: e[5] || (e[5] = (r) => J("PM")),
|
|
693
|
+
class: b([
|
|
694
|
+
"px-2 py-1 text-xs font-medium rounded-md transition-colors",
|
|
695
|
+
C.value === "PM" ? "bg-primary dark:bg-primaryDark text-white" : "bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"
|
|
696
|
+
])
|
|
697
|
+
}, " PM ", 2)
|
|
698
|
+
])
|
|
699
|
+
])
|
|
700
|
+
]),
|
|
701
|
+
a("div", nt, [
|
|
702
|
+
a("button", {
|
|
703
|
+
type: "button",
|
|
704
|
+
onClick: Se,
|
|
705
|
+
class: "text-sm text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"
|
|
706
|
+
}, f(H("clear")), 1),
|
|
707
|
+
a("div", ot, [
|
|
708
|
+
a("button", {
|
|
709
|
+
type: "button",
|
|
710
|
+
onClick: Te,
|
|
711
|
+
class: "text-sm text-primary dark:text-primaryDark hover:text-primary/80 dark:hover:text-primaryDark/80 font-medium"
|
|
712
|
+
}, f(H("now")), 1),
|
|
713
|
+
a("button", {
|
|
714
|
+
type: "button",
|
|
715
|
+
onClick: e[6] || (e[6] = (r) => D.value = !1),
|
|
716
|
+
class: "text-sm text-primary dark:text-primaryDark hover:text-primary/80 dark:hover:text-primaryDark/80 font-medium"
|
|
717
|
+
}, f(H("done")), 1)
|
|
718
|
+
])
|
|
719
|
+
])
|
|
720
|
+
], 512), [
|
|
721
|
+
[Ie, D.value]
|
|
722
|
+
])
|
|
723
|
+
]),
|
|
724
|
+
a("span", lt, f(n.error_message), 1),
|
|
725
|
+
a("small", st, f(n.description), 1)
|
|
726
|
+
], 2))
|
|
727
|
+
], 64));
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
export {
|
|
731
|
+
ut as default
|
|
732
|
+
};
|