vlite3 0.9.8 → 0.9.12

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,5 +1,5 @@
1
- import o from "./ColorIro.vue2.js";
2
- /* empty css */
1
+ import o from "./ColorIro.vue.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -6,8 +6,8 @@ import O from "../Input.vue.js";
6
6
  import "../../core/config.js";
7
7
  /* empty css */
8
8
  import y from "../Button.vue.js";
9
- import E from "./ColorIro.vue2.js";
10
- /* empty css */
9
+ import E from "./ColorIro.vue.js";
10
+ /* empty css */
11
11
  import { useEyeDropper as P } from "@vueuse/core";
12
12
  const I = {
13
13
  key: 0,
@@ -1,13 +1,13 @@
1
- import { defineComponent as I, computed as d, openBlock as g, createBlock as D, unref as o, withCtx as u, createElementVNode as N, createVNode as m, renderSlot as T, mergeProps as x } from "vue";
2
- import w from "./Button.vue.js";
3
- import z from "./Dropdown/Dropdown.vue.js";
1
+ import { defineComponent as T, computed as d, openBlock as x, createBlock as w, unref as o, withCtx as u, createElementVNode as z, createVNode as m, renderSlot as $, mergeProps as k } from "vue";
2
+ import P from "./Button.vue.js";
3
+ import B from "./Dropdown/Dropdown.vue.js";
4
4
  import "@iconify/vue";
5
- import { $t as k } from "../utils/i18n.js";
5
+ import { $t as S } from "../utils/i18n.js";
6
6
  /* empty css */
7
7
  /* empty css */
8
- import $, { TimePicker as B } from "v-datepicker-lite";
8
+ import j, { TimePicker as C } from "v-datepicker-lite";
9
9
  import "v-datepicker-lite/style.css";
10
- const j = { class: "overflow-hidden min-w-[300px]" }, q = /* @__PURE__ */ I({
10
+ const U = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ T({
11
11
  __name: "DatePicker",
12
12
  props: {
13
13
  placeholder: {},
@@ -29,22 +29,26 @@ const j = { class: "overflow-hidden min-w-[300px]" }, q = /* @__PURE__ */ I({
29
29
  readonly: { type: Boolean }
30
30
  },
31
31
  emits: ["update:modelValue", "change"],
32
- setup(t, { emit: P }) {
33
- const l = t, s = P, a = d({
32
+ setup(t, { emit: V }) {
33
+ const l = t, s = V, a = d({
34
34
  get: () => l.modelValue ?? l.value,
35
35
  set: (e) => {
36
36
  s("update:modelValue", e), s("change", e);
37
37
  }
38
- }), S = (e) => e instanceof Date ? e.getHours() !== 0 || e.getMinutes() !== 0 : typeof e == "string" ? e.includes("T") || /\d{2}:\d{2}/.test(e) : !1, c = (e) => {
38
+ }), I = (e) => e instanceof Date ? e.getHours() !== 0 || e.getMinutes() !== 0 : typeof e == "string" ? e.includes("T") || /\d{2}:\d{2}/.test(e) : !1, c = (e) => {
39
39
  try {
40
- if (e && typeof e == "object" && e.start && e.end) {
41
- const b = new Date(e.start), y = new Date(e.end);
42
- if (!isNaN(b.getTime()) && !isNaN(y.getTime())) return { start: b, end: y };
40
+ if (e && typeof e == "object") {
41
+ const h = e.startDate || e.start, b = e.endDate || e.end;
42
+ if (h && b) {
43
+ const y = new Date(h), g = new Date(b);
44
+ if (!isNaN(y.getTime()) && !isNaN(g.getTime()))
45
+ return { startDate: y, endDate: g };
46
+ }
43
47
  }
44
48
  const n = new Date(e);
45
49
  if (isNaN(n.getTime())) return null;
46
- const i = new Date(n), h = new Date(n);
47
- return h.setDate(i.getDate() + 6), { start: i, end: h };
50
+ const i = new Date(n), D = new Date(n);
51
+ return D.setDate(i.getDate() + 6), { startDate: i, endDate: D };
48
52
  } catch {
49
53
  return null;
50
54
  }
@@ -54,13 +58,21 @@ const j = { class: "overflow-hidden min-w-[300px]" }, q = /* @__PURE__ */ I({
54
58
  if (l.mode === "week") {
55
59
  const e = c(a.value);
56
60
  if (!e) return "";
57
- const n = e.start.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }), i = e.end.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
61
+ const n = e.startDate.toLocaleDateString("en-US", {
62
+ month: "short",
63
+ day: "numeric",
64
+ year: "numeric"
65
+ }), i = e.endDate.toLocaleDateString("en-US", {
66
+ month: "short",
67
+ day: "numeric",
68
+ year: "numeric"
69
+ });
58
70
  return `${n} - ${i}`;
59
71
  }
60
72
  try {
61
73
  const e = new Date(a.value);
62
74
  if (isNaN(e.getTime())) return String(a.value);
63
- const n = l.mode === "dateTime" && S(a.value);
75
+ const n = l.mode === "dateTime" && I(a.value);
64
76
  return e.toLocaleDateString("en-US", {
65
77
  month: "short",
66
78
  day: "numeric",
@@ -71,21 +83,21 @@ const j = { class: "overflow-hidden min-w-[300px]" }, q = /* @__PURE__ */ I({
71
83
  return String(a.value);
72
84
  }
73
85
  }), f = d(() => {
74
- if (l.placeholderI18n) return k(l.placeholderI18n);
86
+ if (l.placeholderI18n) return S(l.placeholderI18n);
75
87
  if (l.placeholder !== void 0) return l.placeholder;
76
- const e = k("vlite.datePicker.placeholder");
88
+ const e = S("vlite.datePicker.placeholder");
77
89
  return e !== "vlite.datePicker.placeholder" ? e : "Select date";
78
90
  }), v = (e) => {
79
91
  if (l.mode === "week") {
80
92
  const n = c(e);
81
93
  if (n) {
82
- a.value = { start: n.start, end: n.end };
94
+ a.value = { startDate: n.startDate, endDate: n.endDate };
83
95
  return;
84
96
  }
85
97
  }
86
98
  a.value = e;
87
- }, V = d(() => l.mode === "week" && a.value && typeof a.value == "object" && a.value.start ? a.value.start : a.value);
88
- return (e, n) => t.mode !== "time" ? (g(), D(o(z), {
99
+ }, N = d(() => l.mode === "week" && a.value && typeof a.value == "object" && (a.value.startDate || a.value.start) || a.value);
100
+ return (e, n) => t.mode !== "time" ? (x(), w(o(B), {
89
101
  key: 0,
90
102
  position: "bottom-start",
91
103
  class: "w-full",
@@ -94,12 +106,12 @@ const j = { class: "overflow-hidden min-w-[300px]" }, q = /* @__PURE__ */ I({
94
106
  disabled: t.disabled || t.readonly
95
107
  }, {
96
108
  trigger: u(() => [
97
- T(e.$slots, "default", {
109
+ $(e.$slots, "default", {
98
110
  value: a.value,
99
111
  displayValue: r.value
100
112
  }, () => [
101
- m(w, x({
102
- text: r.value || f.value,
113
+ m(P, k({
114
+ text: r.value?.replace("-", "—") || f.value,
103
115
  variant: t.variant || "outline",
104
116
  size: t.size || "md",
105
117
  icon: t.icon || "lucide:calendar",
@@ -108,9 +120,9 @@ const j = { class: "overflow-hidden min-w-[300px]" }, q = /* @__PURE__ */ I({
108
120
  ])
109
121
  ]),
110
122
  default: u(() => [
111
- N("div", j, [
112
- m(o($), {
113
- value: V.value,
123
+ z("div", U, [
124
+ m(o(j), {
125
+ value: N.value,
114
126
  mode: t.mode,
115
127
  "min-date": t.minDate,
116
128
  "max-date": t.maxDate,
@@ -125,7 +137,7 @@ const j = { class: "overflow-hidden min-w-[300px]" }, q = /* @__PURE__ */ I({
125
137
  ])
126
138
  ]),
127
139
  _: 3
128
- }, 8, ["teleport", "disabled"])) : (g(), D(o(B), {
140
+ }, 8, ["teleport", "disabled"])) : (x(), w(o(C), {
129
141
  key: 1,
130
142
  "model-value": a.value,
131
143
  "onUpdate:modelValue": [
@@ -143,7 +155,7 @@ const j = { class: "overflow-hidden min-w-[300px]" }, q = /* @__PURE__ */ I({
143
155
  readonly: t.readonly
144
156
  }, {
145
157
  default: u(() => [
146
- m(w, x({
158
+ m(P, k({
147
159
  text: r.value || f.value,
148
160
  variant: t.variant || "outline",
149
161
  size: t.size || "md",
@@ -156,5 +168,5 @@ const j = { class: "overflow-hidden min-w-[300px]" }, q = /* @__PURE__ */ I({
156
168
  }
157
169
  });
158
170
  export {
159
- q as default
171
+ G as default
160
172
  };
@@ -1,7 +1,7 @@
1
1
  import { ButtonSize, ButtonVariant } from '../types';
2
2
  export interface DateRange {
3
- start: any;
4
- end: any;
3
+ startDate: any;
4
+ endDate: any;
5
5
  }
6
6
  type __VLS_Props = {
7
7
  modelValue?: DateRange | null;
@@ -1,16 +1,16 @@
1
- import { defineComponent as V, ref as w, watch as L, computed as u, openBlock as d, createBlock as m, unref as h, withCtx as y, createElementVNode as r, createElementBlock as x, Fragment as z, renderList as B, createCommentVNode as E, createVNode as g, normalizeClass as k, toDisplayString as R } from "vue";
2
- import T from "./Dropdown/Dropdown.vue.js";
3
- import f from "./Icon.vue.js";
1
+ import { defineComponent as F, ref as b, watch as L, computed as u, openBlock as d, createBlock as m, unref as v, withCtx as D, createElementVNode as i, createElementBlock as w, Fragment as T, renderList as z, createCommentVNode as B, createVNode as h, normalizeClass as y, toDisplayString as x, createTextVNode as E } from "vue";
2
+ import $ from "./Dropdown/Dropdown.vue.js";
3
+ import R from "./Icon.vue.js";
4
4
  import { $t as l } from "../utils/i18n.js";
5
5
  /* empty css */
6
6
  /* empty css */
7
7
  import P from "./Button.vue.js";
8
8
  import p from "v-datepicker-lite";
9
9
  import "v-datepicker-lite/style.css";
10
- const $ = { class: "flex items-center justify-between gap-2 w-full" }, j = { class: "flex flex-col sm:flex-row bg-background rounded-md" }, H = {
10
+ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class: "flex flex-col sm:flex-row bg-background rounded-md" }, Q = {
11
11
  key: 0,
12
12
  class: "flex flex-col gap-1 sm:pr-3 py-2 sm:border-r border-border max-h-[280px]"
13
- }, Q = { class: "flex flex-col sm:flex-row items-center gap-4 py-2 p-3" }, O = { class: "border border-border rounded-md overflow-hidden bg-background" }, I = { class: "flex items-center justify-center shrink-0" }, U = { class: "border border-border rounded-md overflow-hidden bg-background" }, ae = /* @__PURE__ */ V({
13
+ }, O = { class: "flex flex-col sm:flex-row items-center gap-4 py-2 p-3" }, I = { class: "border border-border rounded-md overflow-hidden bg-background" }, U = { class: "flex items-center justify-center shrink-0" }, q = { class: "border border-border rounded-md overflow-hidden bg-background" }, te = /* @__PURE__ */ F({
14
14
  __name: "DateRangePicker",
15
15
  props: {
16
16
  modelValue: {},
@@ -27,35 +27,41 @@ const $ = { class: "flex items-center justify-between gap-2 w-full" }, j = { cla
27
27
  },
28
28
  emits: ["update:modelValue", "change"],
29
29
  setup(s, { emit: M }) {
30
- const v = s, b = M, o = w(!1), c = w(0);
31
- L(o, (t) => {
32
- t && c.value++;
30
+ const g = s, k = M, o = b(!1), c = b(0);
31
+ L(o, (a) => {
32
+ a && c.value++;
33
33
  });
34
34
  const n = u({
35
- get: () => v.modelValue || { start: null, end: null },
36
- set: (t) => {
37
- b("update:modelValue", t), b("change", t);
35
+ get: () => {
36
+ const a = g.modelValue;
37
+ return a ? {
38
+ startDate: a.startDate !== void 0 ? a.startDate : a.start,
39
+ endDate: a.endDate !== void 0 ? a.endDate : a.end
40
+ } : { startDate: null, endDate: null };
41
+ },
42
+ set: (a) => {
43
+ k("update:modelValue", a), k("change", a);
38
44
  }
39
- }), Y = (t) => {
40
- n.value = { ...n.value, start: t };
41
- }, _ = (t) => {
42
- n.value = { ...n.value, end: t };
43
- }, S = u(() => {
44
- if (n.value.end) {
45
- const t = new Date(n.value.end);
46
- if (!isNaN(t.getTime())) return t.toISOString();
45
+ }), Y = (a) => {
46
+ n.value = { ...n.value, startDate: a };
47
+ }, S = (a) => {
48
+ n.value = { ...n.value, endDate: a };
49
+ }, _ = u(() => {
50
+ if (n.value.endDate) {
51
+ const a = new Date(n.value.endDate);
52
+ if (!isNaN(a.getTime())) return a.toISOString();
47
53
  }
48
- return v.maxDate;
54
+ return g.maxDate;
49
55
  }), C = u(() => {
50
- if (n.value.start) {
51
- const t = new Date(n.value.start);
52
- if (!isNaN(t.getTime())) return t.toISOString();
56
+ if (n.value.startDate) {
57
+ const a = new Date(n.value.startDate);
58
+ if (!isNaN(a.getTime())) return a.toISOString();
53
59
  }
54
- return v.minDate;
55
- }), D = (t) => {
56
- if (!t) return "";
60
+ return g.minDate;
61
+ }), f = (a) => {
62
+ if (!a) return "";
57
63
  try {
58
- const e = new Date(t);
64
+ const e = new Date(a);
59
65
  return isNaN(e.getTime()) ? "" : e.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
60
66
  } catch {
61
67
  return "";
@@ -106,116 +112,113 @@ const $ = { class: "flex items-center justify-between gap-2 w-full" }, j = { cla
106
112
  value: "last_year",
107
113
  icon: "lucide:history"
108
114
  }
109
- ]), F = (t) => {
115
+ ]), V = (a) => {
110
116
  const e = /* @__PURE__ */ new Date();
111
- let a = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
112
- switch (e.setHours(0, 0, 0, 0), a.setHours(0, 0, 0, 0), i.setHours(0, 0, 0, 0), t.value) {
117
+ let t = /* @__PURE__ */ new Date(), r = /* @__PURE__ */ new Date();
118
+ switch (e.setHours(0, 0, 0, 0), t.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0), a.value) {
113
119
  case "today":
114
- a = new Date(e), i = new Date(e);
120
+ t = new Date(e), r = new Date(e);
115
121
  break;
116
122
  case "yesterday":
117
- a = new Date(e), a.setDate(a.getDate() - 1), i = new Date(a);
123
+ t = new Date(e), t.setDate(t.getDate() - 1), r = new Date(t);
118
124
  break;
119
125
  case "last_7_days":
120
- a = new Date(e), a.setDate(a.getDate() - 6), i = new Date(e);
126
+ t = new Date(e), t.setDate(t.getDate() - 6), r = new Date(e);
121
127
  break;
122
128
  case "last_30_days":
123
- a = new Date(e), a.setDate(a.getDate() - 29), i = new Date(e);
129
+ t = new Date(e), t.setDate(t.getDate() - 29), r = new Date(e);
124
130
  break;
125
131
  case "this_month":
126
- a = new Date(e.getFullYear(), e.getMonth(), 1), i = new Date(e);
132
+ t = new Date(e.getFullYear(), e.getMonth(), 1), r = new Date(e);
127
133
  break;
128
134
  case "last_month":
129
- a = new Date(e.getFullYear(), e.getMonth() - 1, 1), i = new Date(e.getFullYear(), e.getMonth(), 0);
135
+ t = new Date(e.getFullYear(), e.getMonth() - 1, 1), r = new Date(e.getFullYear(), e.getMonth(), 0);
130
136
  break;
131
137
  case "last_6_months":
132
- a = new Date(e.getFullYear(), e.getMonth() - 5, 1), i = new Date(e);
138
+ t = new Date(e.getFullYear(), e.getMonth() - 5, 1), r = new Date(e);
133
139
  break;
134
140
  case "this_year":
135
- a = new Date(e.getFullYear(), 0, 1), i = new Date(e);
141
+ t = new Date(e.getFullYear(), 0, 1), r = new Date(e);
136
142
  break;
137
143
  case "last_year":
138
- a = new Date(e.getFullYear() - 1, 0, 1), i = new Date(e.getFullYear() - 1, 11, 31);
144
+ t = new Date(e.getFullYear() - 1, 0, 1), r = new Date(e.getFullYear() - 1, 11, 31);
139
145
  break;
140
146
  }
141
- n.value = { start: a, end: i }, c.value++, o.value = !1;
147
+ n.value = { startDate: t, endDate: r }, c.value++, o.value = !1;
142
148
  };
143
- return (t, e) => (d(), m(h(T), {
149
+ return (a, e) => (d(), m(v($), {
144
150
  isOpen: o.value,
145
- "onUpdate:isOpen": e[0] || (e[0] = (a) => o.value = a),
151
+ "onUpdate:isOpen": e[0] || (e[0] = (t) => o.value = t),
146
152
  position: "bottom-start",
147
153
  disabled: s.disabled || s.readonly,
148
154
  class: "w-full sm:w-auto inline-block",
149
155
  maxHeight: "none"
150
156
  }, {
151
- trigger: y(({ isOpen: a }) => [
152
- g(P, {
157
+ trigger: D(({ isOpen: t }) => [
158
+ h(P, {
153
159
  icon: "lucide:calendar",
154
160
  variant: s.variant || "outline",
155
161
  size: s.size || "md",
156
162
  disabled: s.disabled,
157
- class: k(["w-max justify-between text-left font-normal", [s.triggerClass, { "ring-1 ring-ring ring-offset-[1]": a }]])
163
+ class: y(["w-full justify-between text-left font-normal", [s.triggerClass, { "ring-1 ring-ring ring-offset-[1]": t }]])
158
164
  }, {
159
- default: y(() => [
160
- r("div", $, [
161
- r("span", {
162
- class: k({ "text-muted-foreground": !n.value.start })
163
- }, R(n.value.start ? D(n.value.start) : s.placeholderStart), 3),
164
- g(f, {
165
- icon: "lucide:arrow-right",
166
- class: "w-4 h-4 text-muted-foreground opacity-60 shrink-0"
167
- }),
168
- r("span", {
169
- class: k({ "text-muted-foreground": !n.value.end })
170
- }, R(n.value.end ? D(n.value.end) : s.placeholderEnd), 3)
165
+ default: D(() => [
166
+ i("div", j, [
167
+ i("span", {
168
+ class: y({ "text-muted-foreground": !n.value.startDate })
169
+ }, x(n.value.startDate ? f(n.value.startDate) : s.placeholderStart), 3),
170
+ e[1] || (e[1] = E(" — ", -1)),
171
+ i("span", {
172
+ class: y({ "text-muted-foreground": !n.value.endDate })
173
+ }, x(n.value.endDate ? f(n.value.endDate) : s.placeholderEnd), 3)
171
174
  ])
172
175
  ]),
173
176
  _: 1
174
177
  }, 8, ["variant", "size", "disabled", "class"])
175
178
  ]),
176
- menu: y(() => [
177
- r("div", j, [
178
- s.showQuickRanges ? (d(), x("div", H, [
179
- e[1] || (e[1] = r("div", { class: "text-xs pl-2 pb-2 font-semibold text-muted-foreground uppercase tracking-wider" }, " Quick Ranges ", -1)),
180
- (d(!0), x(z, null, B(N.value, (a) => (d(), m(P, {
181
- key: a.value,
182
- text: a.label,
183
- icon: a.icon,
179
+ menu: D(() => [
180
+ i("div", H, [
181
+ s.showQuickRanges ? (d(), w("div", Q, [
182
+ e[2] || (e[2] = i("div", { class: "text-xs pl-2 pb-2 font-semibold text-muted-foreground uppercase tracking-wider" }, " Quick Ranges ", -1)),
183
+ (d(!0), w(T, null, z(N.value, (t) => (d(), m(P, {
184
+ key: t.value,
185
+ text: t.label,
186
+ icon: t.icon,
184
187
  variant: "ghost",
185
188
  size: "sm",
186
189
  class: "justify-start w-full font-normal",
187
- onClick: (i) => F(a)
190
+ onClick: (r) => V(t)
188
191
  }, null, 8, ["text", "icon", "onClick"]))), 128))
189
- ])) : E("", !0),
190
- r("div", Q, [
191
- r("div", O, [
192
- (d(), m(h(p), {
192
+ ])) : B("", !0),
193
+ i("div", O, [
194
+ i("div", I, [
195
+ (d(), m(v(p), {
193
196
  key: "start-" + c.value,
194
- value: n.value.start,
197
+ value: n.value.startDate,
195
198
  onChange: Y,
196
199
  mode: "date",
197
- "max-date": S.value,
200
+ "max-date": _.value,
198
201
  "min-date": s.minDate,
199
202
  disabled: s.disabled,
200
203
  class: "min-w-[270px]",
201
204
  readonly: s.readonly
202
205
  }, null, 8, ["value", "max-date", "min-date", "disabled", "readonly"]))
203
206
  ]),
204
- r("div", I, [
205
- g(f, {
207
+ i("div", U, [
208
+ h(R, {
206
209
  icon: "lucide:arrow-right",
207
210
  class: "w-5 h-5 text-muted-foreground hidden sm:block opacity-50"
208
211
  }),
209
- g(f, {
212
+ h(R, {
210
213
  icon: "lucide:arrow-down",
211
214
  class: "w-5 h-5 text-muted-foreground sm:hidden opacity-50"
212
215
  })
213
216
  ]),
214
- r("div", U, [
215
- (d(), m(h(p), {
217
+ i("div", q, [
218
+ (d(), m(v(p), {
216
219
  key: "end-" + c.value,
217
- value: n.value.end,
218
- onChange: _,
220
+ value: n.value.endDate,
221
+ onChange: S,
219
222
  mode: "date",
220
223
  "min-date": C.value,
221
224
  "max-date": s.maxDate,
@@ -232,5 +235,5 @@ const $ = { class: "flex items-center justify-between gap-2 w-full" }, j = { cla
232
235
  }
233
236
  });
234
237
  export {
235
- ae as default
238
+ te as default
236
239
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./CustomFields.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3674ca13"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3e1f26ae"]]);
5
5
  export {
6
- s as default
6
+ r as default
7
7
  };