golden-logic-ui 1.2.340 → 1.2.341

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,4 +1,4 @@
1
- import { ref as k, computed as S, watch as ee, onMounted as te, onUnmounted as ae, createElementBlock as c, openBlock as g, Fragment as N, createCommentVNode as p, normalizeClass as w, createElementVNode as n, toDisplayString as f, withDirectives as re, renderList as z, vShow as ne } from "vue";
1
+ import { ref as D, computed as S, watch as ee, onMounted as te, onUnmounted as ae, createElementBlock as c, openBlock as g, Fragment as N, createCommentVNode as h, normalizeClass as w, createElementVNode as n, toDisplayString as f, withDirectives as re, renderList as z, vShow as ne } from "vue";
2
2
  const le = {
3
3
  key: 0,
4
4
  class: "gl-label-form"
@@ -95,17 +95,19 @@ const le = {
95
95
  },
96
96
  emits: ["update:modelValue", "change", "blur-sm"],
97
97
  setup(r, { expose: E, emit: A }) {
98
- const o = r, y = A, x = k(null), V = k(null), D = k(!1), i = k((/* @__PURE__ */ new Date()).getMonth()), d = k((/* @__PURE__ */ new Date()).getFullYear()), $ = (t) => {
98
+ const o = r, y = A, k = D(null), V = D(null), p = D(!1), u = D((/* @__PURE__ */ new Date()).getMonth()), d = D((/* @__PURE__ */ new Date()).getFullYear()), $ = (t) => {
99
99
  if (!t) return null;
100
100
  if (t.toLowerCase() === "today")
101
101
  return /* @__PURE__ */ new Date();
102
102
  const e = t.match(/^([+-]?)(\d+)([dmy])$/i);
103
103
  if (e) {
104
- const l = e[1] === "-" ? -1 : 1, s = parseInt(e[2]) * l, m = e[3].toLowerCase(), h = /* @__PURE__ */ new Date();
105
- return m === "d" ? h.setDate(h.getDate() + s) : m === "m" ? h.setMonth(h.getMonth() + s) : m === "y" && h.setFullYear(h.getFullYear() + s), h;
104
+ const s = e[1] === "-" ? -1 : 1, m = parseInt(e[2]) * s, Y = e[3].toLowerCase(), i = /* @__PURE__ */ new Date();
105
+ return Y === "d" ? i.setDate(i.getDate() + m) : Y === "m" ? i.setMonth(i.getMonth() + m) : Y === "y" && i.setFullYear(i.getFullYear() + m), i;
106
106
  }
107
- const a = new Date(t);
108
- return isNaN(a.getTime()) ? null : a;
107
+ const a = x(t);
108
+ if (a) return a;
109
+ const l = new Date(t);
110
+ return isNaN(l.getTime()) ? null : l;
109
111
  }, P = S(() => {
110
112
  const t = [];
111
113
  for (let e = 0; e < 12; e++) {
@@ -123,7 +125,7 @@ const le = {
123
125
  }), M = (t) => {
124
126
  if (!t) return "";
125
127
  let e;
126
- if (typeof t == "string" && (e = Y(t)), (!e || isNaN(e.getTime())) && (e = new Date(t)), isNaN(e.getTime())) return "";
128
+ if (typeof t == "string" && (e = x(t)), (!e || isNaN(e.getTime())) && (e = new Date(t)), isNaN(e.getTime())) return "";
127
129
  const a = e.getFullYear(), l = String(e.getMonth() + 1).padStart(2, "0"), s = String(e.getDate()).padStart(2, "0");
128
130
  switch (o.date_format) {
129
131
  case "DD-MM-YYYY":
@@ -139,7 +141,7 @@ const le = {
139
141
  default:
140
142
  return `${a}-${l}-${s}`;
141
143
  }
142
- }, Y = (t) => {
144
+ }, x = (t) => {
143
145
  if (!t) return null;
144
146
  let e, a, l;
145
147
  const s = t.split(/[-/]/);
@@ -159,7 +161,7 @@ const le = {
159
161
  }
160
162
  const m = new Date(e, a, l);
161
163
  return isNaN(m.getTime()) || m.getFullYear() !== e || m.getMonth() !== a || m.getDate() !== l ? null : m;
162
- }, v = k(""), C = k(!1);
164
+ }, v = D(""), C = D(!1);
163
165
  ee(() => o.modelValue, (t) => {
164
166
  C.value || (v.value = M(t));
165
167
  }, { immediate: !0 });
@@ -168,32 +170,32 @@ const le = {
168
170
  v.value = e, e === "" && (y("update:modelValue", ""), y("change", ""));
169
171
  }, I = (t) => {
170
172
  C.value = !1;
171
- const e = v.value, a = Y(e);
173
+ const e = v.value, a = x(e);
172
174
  if (a && !isNaN(a.getTime()) && !b(a)) {
173
175
  const l = M(a);
174
176
  v.value = l, y("update:modelValue", l), y("change", l);
175
177
  } else e !== "" && (v.value = M(o.modelValue));
176
178
  y("blur-sm", t);
177
179
  }, U = S(() => {
178
- const t = new Date(d.value, i.value, 1), e = new Date(d.value, i.value + 1, 0), a = t.getDay(), l = e.getDate(), s = [], m = new Date(d.value, i.value, 0).getDate();
179
- for (let u = a - 1; u >= 0; u--)
180
+ const t = new Date(d.value, u.value, 1), e = new Date(d.value, u.value + 1, 0), a = t.getDay(), l = e.getDate(), s = [], m = new Date(d.value, u.value, 0).getDate();
181
+ for (let i = a - 1; i >= 0; i--)
180
182
  s.push({
181
- day: m - u,
183
+ day: m - i,
182
184
  currentMonth: !1,
183
- date: new Date(d.value, i.value - 1, m - u)
185
+ date: new Date(d.value, u.value - 1, m - i)
184
186
  });
185
- for (let u = 1; u <= l; u++)
187
+ for (let i = 1; i <= l; i++)
186
188
  s.push({
187
- day: u,
189
+ day: i,
188
190
  currentMonth: !0,
189
- date: new Date(d.value, i.value, u)
191
+ date: new Date(d.value, u.value, i)
190
192
  });
191
- const h = 42 - s.length;
192
- for (let u = 1; u <= h; u++)
193
+ const Y = 42 - s.length;
194
+ for (let i = 1; i <= Y; i++)
193
195
  s.push({
194
- day: u,
196
+ day: i,
195
197
  currentMonth: !1,
196
- date: new Date(d.value, i.value + 1, u)
198
+ date: new Date(d.value, u.value + 1, i)
197
199
  });
198
200
  return s;
199
201
  }), b = (t) => {
@@ -204,7 +206,7 @@ const le = {
204
206
  e.setHours(0, 0, 0, 0);
205
207
  for (const a of o.disabled_dates) {
206
208
  let l;
207
- if (typeof a == "string" ? (l = Y(a), (!l || isNaN(l.getTime())) && (l = new Date(a))) : a instanceof Date && (l = a), l && !isNaN(l.getTime()) && (l.setHours(0, 0, 0, 0), e.getTime() === l.getTime()))
209
+ if (typeof a == "string" ? (l = x(a), (!l || isNaN(l.getTime())) && (l = new Date(a))) : a instanceof Date && (l = a), l && !isNaN(l.getTime()) && (l.setHours(0, 0, 0, 0), e.getTime() === l.getTime()))
208
210
  return !0;
209
211
  }
210
212
  }
@@ -221,16 +223,16 @@ const le = {
221
223
  return !1;
222
224
  }, T = (t) => {
223
225
  if (!o.modelValue) return !1;
224
- const e = Y(o.modelValue) || new Date(o.modelValue);
226
+ const e = x(o.modelValue) || new Date(o.modelValue);
225
227
  return t.toDateString() === e.toDateString();
226
228
  }, W = (t) => t.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), B = (t) => {
227
229
  if (b(t.date)) return;
228
230
  const e = M(t.date);
229
- y("update:modelValue", e), y("change", e), D.value = !1;
231
+ y("update:modelValue", e), y("change", e), p.value = !1;
230
232
  }, J = () => {
231
- i.value === 0 ? (i.value = 11, d.value--) : i.value--;
233
+ u.value === 0 ? (u.value = 11, d.value--) : u.value--;
232
234
  }, K = () => {
233
- i.value === 11 ? (i.value = 0, d.value++) : i.value++;
235
+ u.value === 11 ? (u.value = 0, d.value++) : u.value++;
234
236
  }, Q = () => {
235
237
  d.value--;
236
238
  }, X = () => {
@@ -249,33 +251,33 @@ const le = {
249
251
  return L[e][t] || L.en[t] || t;
250
252
  }, j = () => {
251
253
  const t = /* @__PURE__ */ new Date();
252
- i.value = t.getMonth(), d.value = t.getFullYear(), B({ date: t });
254
+ u.value = t.getMonth(), d.value = t.getFullYear(), B({ date: t });
253
255
  }, O = () => {
254
- v.value = "", y("update:modelValue", ""), y("change", ""), D.value = !1;
256
+ v.value = "", y("update:modelValue", ""), y("change", ""), p.value = !1;
255
257
  }, G = () => {
256
258
  C.value = !0;
257
259
  }, q = () => {
258
- if (D.value = !D.value, D.value && o.modelValue) {
259
- const t = Y(o.modelValue) || new Date(o.modelValue);
260
- isNaN(t.getTime()) || (i.value = t.getMonth(), d.value = t.getFullYear());
260
+ if (p.value = !p.value, p.value && o.modelValue) {
261
+ const t = x(o.modelValue) || new Date(o.modelValue);
262
+ isNaN(t.getTime()) || (u.value = t.getMonth(), d.value = t.getFullYear());
261
263
  }
262
264
  }, Z = (t) => {
263
- V.value && !V.value.contains(t.target) && (D.value = !1);
265
+ V.value && !V.value.contains(t.target) && (p.value = !1);
264
266
  };
265
267
  return te(() => {
266
- document.addEventListener("click", Z), x.value !== null && x.value.hasAttribute("autofocus") && x.value.focus();
268
+ document.addEventListener("click", Z), k.value !== null && k.value.hasAttribute("autofocus") && k.value.focus();
267
269
  }), ae(() => {
268
270
  document.removeEventListener("click", Z);
269
- }), E({ focus: () => x.value?.focus() }), (t, e) => (g(), c(N, null, [
271
+ }), E({ focus: () => k.value?.focus() }), (t, e) => (g(), c(N, null, [
270
272
  r.show ? (g(), c("div", {
271
273
  key: 0,
272
274
  class: w(r.field_name)
273
275
  }, [
274
- r.label_name ? (g(), c("label", le, f(r.label_name), 1)) : p("", !0),
276
+ r.label_name ? (g(), c("label", le, f(r.label_name), 1)) : h("", !0),
275
277
  n("p", se, f(v.value), 1),
276
278
  e[0] || (e[0] = n("hr", { class: "opacity-100! bg-gray-200 border-0 dark:bg-gray-700" }, null, -1))
277
- ], 2)) : p("", !0),
278
- r.show ? p("", !0) : (g(), c("div", {
279
+ ], 2)) : h("", !0),
280
+ r.show ? h("", !0) : (g(), c("div", {
279
281
  key: 1,
280
282
  class: w({
281
283
  [r.field_name]: r.field_name && r.field_name !== "",
@@ -292,14 +294,14 @@ const le = {
292
294
  required: r.is_required
293
295
  }),
294
296
  for: r.field_name
295
- }, f(r.label_name), 11, oe)) : p("", !0),
297
+ }, f(r.label_name), 11, oe)) : h("", !0),
296
298
  n("div", ie, [
297
299
  r.inputGroupType ? (g(), c("div", ue, [
298
300
  r.inputGroupType == "prepend" ? (g(), c("label", {
299
301
  key: 0,
300
302
  innerHTML: r.inputGroupText,
301
303
  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"
302
- }, null, 8, de)) : p("", !0),
304
+ }, null, 8, de)) : h("", !0),
303
305
  n("div", ce, [
304
306
  n("input", {
305
307
  type: "text",
@@ -318,7 +320,7 @@ const le = {
318
320
  onFocus: G,
319
321
  onBlur: I,
320
322
  ref_key: "input",
321
- ref: x,
323
+ ref: k,
322
324
  placeholder: r.placeholder
323
325
  }, null, 42, ge),
324
326
  n("div", {
@@ -340,8 +342,8 @@ const le = {
340
342
  key: 1,
341
343
  innerHTML: r.inputGroupText,
342
344
  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"
343
- }, null, 8, me)) : p("", !0)
344
- ])) : p("", !0),
345
+ }, null, 8, me)) : h("", !0)
346
+ ])) : h("", !0),
345
347
  r.inputGroupType == "" ? (g(), c("div", fe, [
346
348
  n("input", {
347
349
  type: "text",
@@ -358,7 +360,7 @@ const le = {
358
360
  onFocus: G,
359
361
  onBlur: I,
360
362
  ref_key: "input",
361
- ref: x,
363
+ ref: k,
362
364
  placeholder: r.placeholder
363
365
  }, null, 42, ye),
364
366
  n("div", {
@@ -375,7 +377,7 @@ const le = {
375
377
  n("path", { d: "M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z" })
376
378
  ], -1)
377
379
  ]))
378
- ])) : p("", !0),
380
+ ])) : h("", !0),
379
381
  re(n("div", ve, [
380
382
  n("div", he, [
381
383
  n("button", {
@@ -416,7 +418,7 @@ const le = {
416
418
  })
417
419
  ], -1)
418
420
  ])),
419
- n("span", pe, f(P.value[i.value]) + " " + f(d.value), 1),
421
+ n("span", pe, f(P.value[u.value]) + " " + f(d.value), 1),
420
422
  n("button", {
421
423
  type: "button",
422
424
  onClick: K,
@@ -494,7 +496,7 @@ const le = {
494
496
  }, f(F("today")), 1)
495
497
  ])
496
498
  ], 512), [
497
- [ne, D.value]
499
+ [ne, p.value]
498
500
  ])
499
501
  ]),
500
502
  n("span", we, f(r.error_message), 1),
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.340",
6
+ "version": "1.2.341",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/mrgiant/GoldenLogicUi.git"