golden-logic-ui 1.2.371 → 1.2.372
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as $, computed as
|
|
1
|
+
import { ref as $, computed as w, watch as ge, onMounted as me, onUnmounted as ve, createElementBlock as g, openBlock as m, Fragment as S, createCommentVNode as T, normalizeClass as b, createElementVNode as r, toDisplayString as u, withDirectives as fe, renderList as I, vShow as he } from "vue";
|
|
2
2
|
const ye = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "gl-label-form"
|
|
5
|
-
}, pe = { class: "mt-1 text-gray-900 dark:text-white" }, De = ["dir"], ke = ["for"],
|
|
5
|
+
}, pe = { class: "mt-1 text-gray-900 dark:text-white" }, De = ["dir"], ke = ["for"], we = { class: "relative" }, xe = { class: "relative" }, Me = ["required", "name", "id", "value", "placeholder"], Ye = { 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-[20rem] sm:w-auto max-w-[calc(100vw-2rem)]" }, be = { class: "flex flex-col sm:flex-row gap-4 sm:gap-6" }, _e = { class: "w-full sm:w-64" }, $e = { class: "flex items-center justify-between mb-3" }, Ce = { class: "text-sm font-semibold text-gray-900 dark:text-white" }, Se = { class: "grid grid-cols-7 gap-y-1 mb-1" }, Te = { class: "grid grid-cols-7" }, Ve = ["onClick", "onMouseenter", "disabled"], Ne = { class: "hidden sm:block sm:w-64" }, Ie = { class: "flex items-center justify-between mb-3" }, Le = { class: "text-sm font-semibold text-gray-900 dark:text-white" }, Be = { class: "grid grid-cols-7 gap-y-1 mb-1" }, Ee = { class: "grid grid-cols-7" }, Fe = ["onClick", "onMouseenter", "disabled"], qe = { class: "flex items-center justify-between gap-3 mt-4 pt-3 border-t border-gray-200 dark:border-gray-700" }, He = { class: "text-sm text-gray-600 dark:text-gray-300 truncate" }, Re = { class: "flex items-center gap-2 shrink-0" }, Ae = { class: "gl-span-form-error" }, Ze = {
|
|
6
6
|
key: 1,
|
|
7
7
|
class: "block mt-1 text-sm font-normal leading-5 text-gray-500"
|
|
8
8
|
}, Pe = {
|
|
@@ -86,19 +86,19 @@ const ye = {
|
|
|
86
86
|
},
|
|
87
87
|
emits: ["update:modelValue", "change"],
|
|
88
88
|
setup(s, { emit: te }) {
|
|
89
|
-
const o = s,
|
|
89
|
+
const o = s, F = te, L = $(null), M = $(!1), q = /* @__PURE__ */ new Date(), v = $(q.getMonth()), _ = $(q.getFullYear()), c = $(null), f = $(null), V = $(null), ae = w(() => B() === "ar"), H = {
|
|
90
90
|
en: { apply: "Apply", cancel: "Cancel" },
|
|
91
91
|
ar: { apply: "تطبيق", cancel: "إلغاء" }
|
|
92
|
-
},
|
|
92
|
+
}, B = () => o.locale && o.locale.startsWith("ar") ? "ar" : "en", R = (a) => H[B()][a] || H.en[a] || a, A = w(() => {
|
|
93
93
|
const a = [];
|
|
94
94
|
for (let e = 0; e < 12; e++)
|
|
95
95
|
a.push(new Date(2e3, e, 1).toLocaleDateString(o.locale, { month: "long" }));
|
|
96
96
|
return a;
|
|
97
|
-
}), Z =
|
|
98
|
-
const a = [];
|
|
99
|
-
for (let
|
|
100
|
-
|
|
101
|
-
return
|
|
97
|
+
}), Z = w(() => {
|
|
98
|
+
const a = B() === "ar" ? "narrow" : "short", e = [];
|
|
99
|
+
for (let t = 0; t < 7; t++)
|
|
100
|
+
e.push(new Date(2e3, 0, 2 + t).toLocaleDateString(o.locale, { weekday: a }));
|
|
101
|
+
return e;
|
|
102
102
|
}), Y = (a) => {
|
|
103
103
|
if (!a) return null;
|
|
104
104
|
let e, t, n;
|
|
@@ -124,8 +124,8 @@ const ye = {
|
|
|
124
124
|
if (String(a).toLowerCase() === "today") return /* @__PURE__ */ new Date();
|
|
125
125
|
const e = String(a).match(/^([+-]?)(\d+)([dmy])$/i);
|
|
126
126
|
if (e) {
|
|
127
|
-
const l = e[1] === "-" ? -1 : 1, p = parseInt(e[2]) * l,
|
|
128
|
-
return
|
|
127
|
+
const l = e[1] === "-" ? -1 : 1, p = parseInt(e[2]) * l, x = e[3].toLowerCase(), k = /* @__PURE__ */ new Date();
|
|
128
|
+
return x === "d" ? k.setDate(k.getDate() + p) : x === "m" ? k.setMonth(k.getMonth() + p) : x === "y" && k.setFullYear(k.getFullYear() + p), k;
|
|
129
129
|
}
|
|
130
130
|
const t = Y(a);
|
|
131
131
|
if (t) return t;
|
|
@@ -153,32 +153,32 @@ const ye = {
|
|
|
153
153
|
}, i = (a) => {
|
|
154
154
|
const e = new Date(a);
|
|
155
155
|
return e.setHours(0, 0, 0, 0), e;
|
|
156
|
-
}, P = (a, e) => a && e && a.toDateString() === e.toDateString(), G =
|
|
156
|
+
}, P = (a, e) => a && e && a.toDateString() === e.toDateString(), G = w(() => {
|
|
157
157
|
const a = o.modelValue?.start, e = o.modelValue?.end;
|
|
158
158
|
if (!a && !e) return "";
|
|
159
159
|
const t = a ? C(Y(a) || new Date(a)) : "", n = e ? C(Y(e) || new Date(e)) : "";
|
|
160
160
|
return t && n ? `${t} ${o.separator} ${n}` : t || n;
|
|
161
|
-
}), re =
|
|
161
|
+
}), re = w(() => {
|
|
162
162
|
const a = c.value ? C(c.value) : "…", e = f.value ? C(f.value) : "…";
|
|
163
163
|
return `${a} ${o.separator} ${e}`;
|
|
164
164
|
}), U = (a, e) => {
|
|
165
|
-
const t = new Date(a, e, 1), n = new Date(a, e + 1, 0), l = t.getDay(), p = n.getDate(),
|
|
165
|
+
const t = new Date(a, e, 1), n = new Date(a, e + 1, 0), l = t.getDay(), p = n.getDate(), x = [], k = new Date(a, e, 0).getDate();
|
|
166
166
|
for (let d = l - 1; d >= 0; d--)
|
|
167
|
-
|
|
167
|
+
x.push({
|
|
168
168
|
day: k - d,
|
|
169
169
|
currentMonth: !1,
|
|
170
170
|
date: new Date(a, e - 1, k - d)
|
|
171
171
|
});
|
|
172
172
|
for (let d = 1; d <= p; d++)
|
|
173
|
-
|
|
174
|
-
const de = 42 -
|
|
173
|
+
x.push({ day: d, currentMonth: !0, date: new Date(a, e, d) });
|
|
174
|
+
const de = 42 - x.length;
|
|
175
175
|
for (let d = 1; d <= de; d++)
|
|
176
|
-
|
|
177
|
-
return
|
|
178
|
-
}, N =
|
|
176
|
+
x.push({ day: d, currentMonth: !1, date: new Date(a, e + 1, d) });
|
|
177
|
+
return x;
|
|
178
|
+
}, N = w(() => {
|
|
179
179
|
const a = v.value === 11 ? 0 : v.value + 1, e = v.value === 11 ? _.value + 1 : _.value;
|
|
180
180
|
return { month: a, year: e };
|
|
181
|
-
}), ne =
|
|
181
|
+
}), ne = w(() => U(_.value, v.value)), se = w(() => U(N.value.year, N.value.month)), D = (a) => {
|
|
182
182
|
if (o.disabled_days.includes(a.getDay())) return !0;
|
|
183
183
|
if (o.disabled_dates && o.disabled_dates.length > 0) {
|
|
184
184
|
const e = i(a);
|
|
@@ -197,17 +197,17 @@ const ye = {
|
|
|
197
197
|
if (e && i(a) > i(e)) return !0;
|
|
198
198
|
}
|
|
199
199
|
return !1;
|
|
200
|
-
}, le =
|
|
200
|
+
}, le = w(() => c.value && !f.value && V.value ? V.value : f.value), E = w(() => {
|
|
201
201
|
const a = c.value, e = le.value;
|
|
202
202
|
return !a || !e ? null : a <= e ? { lo: i(a), hi: i(e) } : { lo: i(e), hi: i(a) };
|
|
203
203
|
}), h = (a) => {
|
|
204
|
-
const e =
|
|
204
|
+
const e = E.value;
|
|
205
205
|
return e ? i(a).getTime() === e.lo.getTime() : P(a, c.value);
|
|
206
206
|
}, y = (a) => {
|
|
207
|
-
const e =
|
|
207
|
+
const e = E.value;
|
|
208
208
|
return e ? i(a).getTime() === e.hi.getTime() : !1;
|
|
209
209
|
}, W = (a) => {
|
|
210
|
-
const e =
|
|
210
|
+
const e = E.value;
|
|
211
211
|
if (!e) return !1;
|
|
212
212
|
const t = i(a).getTime();
|
|
213
213
|
return t > e.lo.getTime() && t < e.hi.getTime();
|
|
@@ -233,7 +233,7 @@ const ye = {
|
|
|
233
233
|
start: c.value ? C(c.value) : "",
|
|
234
234
|
end: f.value ? C(f.value) : ""
|
|
235
235
|
};
|
|
236
|
-
|
|
236
|
+
F("update:modelValue", a), F("change", a), M.value = !1;
|
|
237
237
|
}, ce = () => {
|
|
238
238
|
M.value = !1;
|
|
239
239
|
}, ee = (a) => {
|
|
@@ -273,8 +273,8 @@ const ye = {
|
|
|
273
273
|
}),
|
|
274
274
|
for: s.field_name
|
|
275
275
|
}, u(s.label_name), 11, ke)) : T("", !0),
|
|
276
|
-
r("div",
|
|
277
|
-
r("div",
|
|
276
|
+
r("div", we, [
|
|
277
|
+
r("div", xe, [
|
|
278
278
|
r("input", {
|
|
279
279
|
type: "text",
|
|
280
280
|
readonly: "",
|
|
@@ -353,7 +353,7 @@ const ye = {
|
|
|
353
353
|
r("div", Se, [
|
|
354
354
|
(m(!0), g(S, null, I(Z.value, (t) => (m(), g("div", {
|
|
355
355
|
key: "lh-" + t,
|
|
356
|
-
class: "text-center text-xs font-semibold text-gray-700 dark:text-gray-300 py-1"
|
|
356
|
+
class: "text-center text-xs font-semibold text-gray-700 dark:text-gray-300 py-1 truncate"
|
|
357
357
|
}, u(t), 1))), 128))
|
|
358
358
|
]),
|
|
359
359
|
r("div", Te, [
|
|
@@ -412,7 +412,7 @@ const ye = {
|
|
|
412
412
|
r("div", Be, [
|
|
413
413
|
(m(!0), g(S, null, I(Z.value, (t) => (m(), g("div", {
|
|
414
414
|
key: "rh-" + t,
|
|
415
|
-
class: "text-center text-xs font-semibold text-gray-700 dark:text-gray-300 py-1"
|
|
415
|
+
class: "text-center text-xs font-semibold text-gray-700 dark:text-gray-300 py-1 truncate"
|
|
416
416
|
}, u(t), 1))), 128))
|
|
417
417
|
]),
|
|
418
418
|
r("div", Ee, [
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "The most popular library of interactive components built with Vuejs && Tailwind CSS",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "1.2.
|
|
6
|
+
"version": "1.2.372",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/mrgiant/GoldenLogicUi.git"
|