@dmsi/wedgekit-react 3.1.1 → 4.0.0

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,369 +1,381 @@
1
1
  "use client";
2
- import { jsxs as ht, Fragment as Dt, jsx as B } from "react/jsx-runtime";
3
- import { useState as O, useRef as W, useEffect as K, useLayoutEffect as $t } from "react";
4
- import { createPortal as wt } from "react-dom";
5
- import { InputBase as gt } from "./Input.js";
6
- import { CalendarRange as yt } from "./CalendarRange.js";
7
- import { Icon as Pt } from "./Icon.js";
8
- import { findDocumentRoot as St } from "../utils.js";
9
- import { parseInputDate as d, isValidDate as g, formatDate as z, isValidDateRangeOrder as Vt, formatInputValue as H, calculateCursorPosition as Mt } from "../utils/date.js";
10
- import { marginTopUsingComponentGap as Ft } from "../classNames.js";
11
- import { useMatchesMobile as Yt } from "../hooks/useMatchesMedia.js";
12
- function jt({
13
- id: o,
2
+ import { jsxs as wt, Fragment as Pt, jsx as T } from "react/jsx-runtime";
3
+ import { useState as b, useRef as z, useEffect as H, useLayoutEffect as St } from "react";
4
+ import { createPortal as yt } from "react-dom";
5
+ import { InputBase as Vt } from "./Input.js";
6
+ import { CalendarRange as Mt } from "./CalendarRange.js";
7
+ import { CalendarIconButton as vt } from "./CalendarIconButton.js";
8
+ import { findDocumentRoot as Ft } from "../utils.js";
9
+ import { parseInputDate as d, isValidDate as P, formatDate as K, isValidDateRangeOrder as Yt, formatInputValue as O, calculateCursorPosition as xt } from "../utils/date.js";
10
+ import { marginTopUsingComponentGap as It } from "../classNames.js";
11
+ import { useMatchesMobile as kt } from "../hooks/useMatchesMedia.js";
12
+ function Ct({
13
+ id: s,
14
14
  testid: i,
15
- value: V,
15
+ value: M,
16
16
  onChange: r,
17
17
  placeholder: p = "MM/DD/YYYY - MM/DD/YYYY",
18
- disabled: Y,
19
- readOnly: y = !1,
18
+ disabled: v,
19
+ readOnly: h = !1,
20
20
  single: k = !1,
21
21
  disableRange: a = !1,
22
22
  label: E,
23
- isDateAvailable: $,
24
- onPendingFromChange: Q,
25
- theme: Z,
26
- ...tt
23
+ isDateAvailable: g,
24
+ onPendingFromChange: _,
25
+ theme: tt,
26
+ ...et
27
27
  }) {
28
- const et = Yt(), [j, M] = O(!1), [v, u] = O(""), [X, h] = O(!1), A = W(null), N = W(null), l = W(null), [b, nt] = O({
28
+ const nt = kt(), [q, S] = b(!1), W = z(null), [Y, u] = b(""), [X, D] = b(!1), R = z(null), C = z(null), l = z(null), [N, rt] = b({
29
29
  top: 0,
30
30
  left: 0,
31
31
  width: 0
32
- }), [q, L] = V.split("|");
33
- K(() => {
32
+ }), [L, B] = M.split("|");
33
+ H(() => {
34
34
  if (!X) {
35
- const t = J(q, L);
35
+ const t = Z(L, B);
36
36
  t && u(t);
37
37
  }
38
- }, [q, L, X, a]), $t(() => {
39
- j && R();
40
- }, [j]);
41
- const R = () => {
42
- if (N.current) {
43
- const t = N.current.getBoundingClientRect();
44
- nt({
38
+ }, [L, B, X, a]), St(() => {
39
+ q && A();
40
+ }, [q]);
41
+ const A = () => {
42
+ if (C.current) {
43
+ const t = C.current.getBoundingClientRect();
44
+ rt({
45
45
  top: t.bottom + window.scrollY,
46
46
  left: t.left + window.scrollX,
47
47
  width: t.width
48
48
  });
49
49
  }
50
50
  };
51
- K(() => {
52
- R();
53
- const t = new ResizeObserver(R);
54
- return l.current && t.observe(l.current), window.addEventListener("scroll", R), () => {
55
- t.disconnect(), window.removeEventListener("scroll", R);
51
+ H(() => {
52
+ A();
53
+ const t = new ResizeObserver(A);
54
+ return l.current && t.observe(l.current), window.addEventListener("scroll", A), () => {
55
+ t.disconnect(), window.removeEventListener("scroll", A);
56
56
  };
57
- }, []), K(() => {
57
+ }, []), H(() => {
58
58
  const t = (e) => {
59
- e.key === "Escape" && A.current && (M(!1), l.current?.blur());
59
+ e.key === "Escape" && R.current && (S(!1), l.current?.blur());
60
60
  };
61
61
  return document.addEventListener("keydown", t), () => {
62
62
  document.removeEventListener("keydown", t);
63
63
  };
64
- }, []), K(() => {
64
+ }, []), H(() => {
65
65
  const t = (e) => {
66
- A.current && !A.current.contains(e.target) && l.current && !l.current.contains(e.target) && M(!1);
66
+ R.current && !R.current.contains(e.target) && l.current && !l.current.contains(e.target) && !W.current?.contains(e.target) && S(!1);
67
67
  };
68
68
  return document.addEventListener("mousedown", t), () => {
69
69
  document.removeEventListener("mousedown", t);
70
70
  };
71
71
  }, []);
72
- function rt(t, e) {
73
- r(a ? `${t}|${t}` : `${t}|${e}`), M(!1), h(!1);
72
+ function st(t, e) {
73
+ r(a ? `${t}|${t}` : `${t}|${e}`), S(!1), D(!1);
74
74
  }
75
- const _ = () => {
76
- y || M(!0);
77
- }, st = () => {
78
- _();
79
- }, ot = (t) => {
80
- if (y) return;
81
- const e = t.target.value, s = t.target.selectionStart || 0;
82
- if (ct(e)) {
83
- it(e, s);
75
+ const J = () => {
76
+ h || S(!0);
77
+ }, ot = () => {
78
+ J();
79
+ }, ct = () => {
80
+ h || S((t) => !t);
81
+ }, it = (t) => {
82
+ if (h) return;
83
+ const e = t.target.value, o = t.target.selectionStart || 0;
84
+ if (at(e)) {
85
+ lt(e, o);
84
86
  return;
85
87
  }
86
- h(!0);
87
- const n = F(e), c = at(n, e) ? `${n} - ` : n;
88
+ D(!0);
89
+ const n = F(e), c = ut(n, e) ? `${n} - ` : n;
88
90
  u(c);
89
- const f = lt(
91
+ const f = ft(
90
92
  e,
91
93
  n,
92
94
  c,
93
- s
95
+ o
94
96
  );
95
97
  requestAnimationFrame(() => {
96
- C(f);
97
- }), ut(c);
98
- }, ct = (t) => !a && t.includes("-") && !t.includes(" - "), it = (t, e) => {
99
- const s = t.replace(/-/g, ""), n = F(s);
98
+ Q(f);
99
+ }), dt(c);
100
+ }, at = (t) => !a && t.includes("-") && !t.includes(" - "), lt = (t, e) => {
101
+ const o = t.replace(/-/g, ""), n = F(o);
100
102
  u(n), requestAnimationFrame(() => {
101
103
  const c = Math.min(
102
104
  e - 1,
103
105
  n.length
104
106
  );
105
- C(c);
107
+ Q(c);
106
108
  });
107
- }, at = (t, e) => {
109
+ }, ut = (t, e) => {
108
110
  if (a || t.includes(" - ") || !t.match(/^(\d{2})\/(\d{2})\/(\d{4})$/) || e.length !== t.length)
109
111
  return !1;
110
112
  const n = e.length - 1;
111
113
  return !F(e.slice(0, n)).match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
112
- }, lt = (t, e, s, n) => s !== e ? s.length : It(
114
+ }, ft = (t, e, o, n) => o !== e ? o.length : Rt(
113
115
  t,
114
- s,
116
+ o,
115
117
  n,
116
118
  a
117
- ), C = (t) => {
119
+ ), Q = (t) => {
118
120
  l.current && l.current.setSelectionRange(t, t);
119
- }, ut = (t) => {
120
- a ? ft(t) : dt(t);
121
- }, ft = (t) => {
122
- const e = d(t);
123
- e && g(e) && r(`${e}|${e}`);
124
121
  }, dt = (t) => {
122
+ a ? mt(t) : pt(t);
123
+ }, mt = (t) => {
124
+ const e = d(t);
125
+ e && P(e) && r(`${e}|${e}`);
126
+ }, pt = (t) => {
125
127
  if (t === "") {
126
128
  r("");
127
129
  return;
128
130
  }
129
131
  const e = t.match(/^(.+?)\s*-\s*(.+)$/);
130
- e ? mt(e) : pt(t);
131
- }, mt = (t) => {
132
- const [, e, s] = t, n = d(e.trim()), c = d(s.trim());
133
- n && c && T(n, c) && r(`${n}|${c}`);
134
- }, pt = (t) => {
132
+ e ? ht(e) : Dt(t);
133
+ }, ht = (t) => {
134
+ const [, e, o] = t, n = d(e.trim()), c = d(o.trim());
135
+ n && c && j(n, c) && r(`${n}|${c}`);
136
+ }, Dt = (t) => {
135
137
  const e = d(t);
136
- e && g(e) && r(`${e}|`);
138
+ e && P(e) && r(`${e}|`);
139
+ }, $t = () => {
140
+ if (D(!1), a) {
141
+ const t = d(Y);
142
+ if (!t || !P(t)) {
143
+ const e = Z(L, B);
144
+ u(e || "");
145
+ }
146
+ } else {
147
+ const t = Y.match(/^(.+?)\s*-\s*(.+)$/);
148
+ if (t) {
149
+ const [, e, o] = t, n = d(e.trim()), c = d(o.trim());
150
+ (!n || !c || !j(n, c)) && (u(""), r(""));
151
+ } else if (Y.includes(" - "))
152
+ u(""), r("");
153
+ else {
154
+ const e = d(Y);
155
+ !e || P(e), u(""), r("");
156
+ }
157
+ }
158
+ }, gt = (t) => {
159
+ if (!a && t.key === "-") {
160
+ t.preventDefault();
161
+ return;
162
+ }
163
+ if (t.key === "Backspace") {
164
+ const e = t.target, o = e.selectionStart || 0, n = e.value;
165
+ if (o > 0 && n[o - 1] === "/") {
166
+ t.preventDefault();
167
+ const c = n.slice(0, o - 2) + n.slice(o), f = F(c);
168
+ u(f), requestAnimationFrame(() => {
169
+ if (l.current) {
170
+ const x = Math.max(0, o - 2);
171
+ l.current.setSelectionRange(x, x);
172
+ }
173
+ }), D(!0);
174
+ return;
175
+ }
176
+ if (!a && n.includes(" - ")) {
177
+ const c = n.indexOf(" - "), f = c, x = c + 3;
178
+ if (o >= f && o <= x) {
179
+ t.preventDefault();
180
+ const w = n.slice(0, f).trim(), y = w.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
181
+ if (y) {
182
+ const [, m, $, V] = y, G = V.slice(0, -1), U = `${m}/${$}/${G}`, I = F(U);
183
+ u(I), r(""), requestAnimationFrame(() => {
184
+ l.current && l.current.setSelectionRange(
185
+ I.length,
186
+ I.length
187
+ );
188
+ });
189
+ } else {
190
+ const m = F(w);
191
+ u(m);
192
+ const $ = d(w);
193
+ $ && P($) ? r(`${$}|`) : r(""), requestAnimationFrame(() => {
194
+ if (l.current) {
195
+ const V = m.length;
196
+ l.current.setSelectionRange(V, V);
197
+ }
198
+ });
199
+ }
200
+ D(!0);
201
+ return;
202
+ }
203
+ if (o === x) {
204
+ t.preventDefault();
205
+ const w = n.slice(0, f).trim(), y = `${w} - `;
206
+ u(y);
207
+ const m = d(w);
208
+ m && P(m) && r(`${m}|`), requestAnimationFrame(() => {
209
+ l.current && l.current.setSelectionRange(
210
+ y.length,
211
+ y.length
212
+ );
213
+ }), D(!0);
214
+ return;
215
+ }
216
+ }
217
+ }
218
+ if (t.key === "Delete") {
219
+ const e = t.target, o = e.selectionStart || 0, n = e.value;
220
+ if (!a && n.includes(" - ")) {
221
+ const c = n.indexOf(" - "), f = c, x = c + 3;
222
+ if (o >= f && o <= x) {
223
+ t.preventDefault();
224
+ const w = n.slice(0, f).trim(), y = w.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
225
+ if (y) {
226
+ const [, m, $, V] = y, G = V.slice(0, -1), U = `${m}/${$}/${G}`, I = F(U);
227
+ u(I), r(""), requestAnimationFrame(() => {
228
+ l.current && l.current.setSelectionRange(
229
+ I.length,
230
+ I.length
231
+ );
232
+ });
233
+ } else {
234
+ const m = F(w);
235
+ u(m);
236
+ const $ = d(w);
237
+ $ && P($) ? r(`${$}|`) : r(""), requestAnimationFrame(() => {
238
+ if (l.current) {
239
+ const V = m.length;
240
+ l.current.setSelectionRange(V, V);
241
+ }
242
+ });
243
+ }
244
+ D(!0);
245
+ return;
246
+ }
247
+ }
248
+ }
249
+ if (t.key === "Enter")
250
+ if (a) {
251
+ const e = d(Y);
252
+ e && P(e) && (r(`${e}|${e}`), S(!1), D(!1));
253
+ } else {
254
+ const e = Y.match(/^(.+?)\s*-\s*(.+)$/);
255
+ if (e) {
256
+ const [, o, n] = e, c = d(o.trim()), f = d(n.trim());
257
+ c && f && j(c, f) ? (r(`${c}|${f}`), S(!1), D(!1)) : (u(""), r(""), S(!1), D(!1));
258
+ } else
259
+ u(""), r(""), S(!1), D(!1);
260
+ }
137
261
  };
138
- return /* @__PURE__ */ ht(Dt, { children: [
139
- /* @__PURE__ */ B(
140
- gt,
262
+ return /* @__PURE__ */ wt(Pt, { children: [
263
+ /* @__PURE__ */ T(
264
+ Vt,
141
265
  {
142
- id: o,
266
+ id: s,
143
267
  testid: i,
144
268
  ref: (t) => {
145
269
  l.current = t;
146
270
  },
147
- ...tt,
148
- wrapperRef: N,
149
- value: v,
271
+ ...et,
272
+ wrapperRef: C,
273
+ value: Y,
150
274
  placeholder: a ? "MM/DD/YYYY" : p,
151
- disabled: Y,
152
- readOnly: y,
153
- after: /* @__PURE__ */ B(Pt, { name: "calendar_month" }),
154
- onFocus: _,
155
- onClick: st,
156
- onChange: ot,
157
- onBlur: () => {
158
- if (h(!1), a) {
159
- const t = d(v);
160
- if (!t || !g(t)) {
161
- const e = J(q, L);
162
- u(e || "");
163
- }
164
- } else {
165
- const t = v.match(/^(.+?)\s*-\s*(.+)$/);
166
- if (t) {
167
- const [, e, s] = t, n = d(e.trim()), c = d(s.trim());
168
- (!n || !c || !T(n, c)) && (u(""), r(""));
169
- } else if (v.includes(" - "))
170
- u(""), r("");
171
- else {
172
- const e = d(v);
173
- !e || g(e), u(""), r("");
174
- }
275
+ disabled: v,
276
+ readOnly: h,
277
+ after: /* @__PURE__ */ T(
278
+ vt,
279
+ {
280
+ ref: W,
281
+ id: s ? `${s}-calendar-button` : void 0,
282
+ testid: i ? `${i}-calendar-button` : void 0,
283
+ disabled: v || h,
284
+ expanded: q,
285
+ onToggle: ct
175
286
  }
176
- },
177
- onKeyDown: (t) => {
178
- if (!a && t.key === "-") {
179
- t.preventDefault();
180
- return;
181
- }
182
- if (t.key === "Backspace") {
183
- const e = t.target, s = e.selectionStart || 0, n = e.value;
184
- if (s > 0 && n[s - 1] === "/") {
185
- t.preventDefault();
186
- const c = n.slice(0, s - 2) + n.slice(s), f = F(c);
187
- u(f), requestAnimationFrame(() => {
188
- if (l.current) {
189
- const I = Math.max(0, s - 2);
190
- l.current.setSelectionRange(I, I);
191
- }
192
- }), h(!0);
193
- return;
194
- }
195
- if (!a && n.includes(" - ")) {
196
- const c = n.indexOf(" - "), f = c, I = c + 3;
197
- if (s >= f && s <= I) {
198
- t.preventDefault();
199
- const w = n.slice(0, f).trim(), P = w.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
200
- if (P) {
201
- const [, m, D, S] = P, G = S.slice(0, -1), U = `${m}/${D}/${G}`, x = F(U);
202
- u(x), r(""), requestAnimationFrame(() => {
203
- l.current && l.current.setSelectionRange(
204
- x.length,
205
- x.length
206
- );
207
- });
208
- } else {
209
- const m = F(w);
210
- u(m);
211
- const D = d(w);
212
- D && g(D) ? r(`${D}|`) : r(""), requestAnimationFrame(() => {
213
- if (l.current) {
214
- const S = m.length;
215
- l.current.setSelectionRange(S, S);
216
- }
217
- });
218
- }
219
- h(!0);
220
- return;
221
- }
222
- if (s === I) {
223
- t.preventDefault();
224
- const w = n.slice(0, f).trim(), P = `${w} - `;
225
- u(P);
226
- const m = d(w);
227
- m && g(m) && r(`${m}|`), requestAnimationFrame(() => {
228
- l.current && l.current.setSelectionRange(
229
- P.length,
230
- P.length
231
- );
232
- }), h(!0);
233
- return;
234
- }
235
- }
236
- }
237
- if (t.key === "Delete") {
238
- const e = t.target, s = e.selectionStart || 0, n = e.value;
239
- if (!a && n.includes(" - ")) {
240
- const c = n.indexOf(" - "), f = c, I = c + 3;
241
- if (s >= f && s <= I) {
242
- t.preventDefault();
243
- const w = n.slice(0, f).trim(), P = w.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
244
- if (P) {
245
- const [, m, D, S] = P, G = S.slice(0, -1), U = `${m}/${D}/${G}`, x = F(U);
246
- u(x), r(""), requestAnimationFrame(() => {
247
- l.current && l.current.setSelectionRange(
248
- x.length,
249
- x.length
250
- );
251
- });
252
- } else {
253
- const m = F(w);
254
- u(m);
255
- const D = d(w);
256
- D && g(D) ? r(`${D}|`) : r(""), requestAnimationFrame(() => {
257
- if (l.current) {
258
- const S = m.length;
259
- l.current.setSelectionRange(S, S);
260
- }
261
- });
262
- }
263
- h(!0);
264
- return;
265
- }
266
- }
267
- }
268
- if (t.key === "Enter")
269
- if (a) {
270
- const e = d(v);
271
- e && g(e) && (r(`${e}|${e}`), M(!1), h(!1));
272
- } else {
273
- const e = v.match(/^(.+?)\s*-\s*(.+)$/);
274
- if (e) {
275
- const [, s, n] = e, c = d(s.trim()), f = d(n.trim());
276
- c && f && T(c, f) ? (r(`${c}|${f}`), M(!1), h(!1)) : (u(""), r(""), M(!1), h(!1));
277
- } else
278
- u(""), r(""), M(!1), h(!1);
279
- }
280
- },
287
+ ),
288
+ onFocus: J,
289
+ onClick: ot,
290
+ onChange: it,
291
+ onBlur: $t,
292
+ onKeyDown: gt,
281
293
  label: E,
282
294
  secondaryIconColor: !0
283
295
  }
284
296
  ),
285
- j && !y && wt(
286
- /* @__PURE__ */ B(
297
+ q && !h && yt(
298
+ /* @__PURE__ */ T(
287
299
  "div",
288
300
  {
289
301
  ref: (t) => {
290
- A.current = t;
302
+ R.current = t;
291
303
  },
292
- className: `absolute z-40 ${Ft}`,
293
- "data-theme": Z,
304
+ className: `absolute z-40 ${It}`,
305
+ "data-theme": tt,
294
306
  style: {
295
- top: `${b.top}px`,
296
- left: `${b.left}px`,
297
- minWidth: `${b.width}px`
307
+ top: `${N.top}px`,
308
+ left: `${N.left}px`,
309
+ minWidth: `${N.width}px`
298
310
  },
299
- children: /* @__PURE__ */ B(
300
- yt,
311
+ children: /* @__PURE__ */ T(
312
+ Mt,
301
313
  {
302
- id: o ? `${o}-calendar` : void 0,
314
+ id: s ? `${s}-calendar` : void 0,
303
315
  testid: i ? `${i}-calendar` : void 0,
304
- from: q,
305
- to: L,
306
- onChange: rt,
316
+ from: L,
317
+ to: B,
318
+ onChange: st,
307
319
  cardStyle: !0,
308
- mode: k || et ? "single" : "double",
320
+ mode: k || nt ? "single" : "double",
309
321
  disableRange: a,
310
- isDateAvailable: $,
311
- onPendingFromChange: Q
322
+ isDateAvailable: g,
323
+ onPendingFromChange: _
312
324
  }
313
325
  )
314
326
  }
315
327
  ),
316
- St(A.current)
328
+ Ft(R.current)
317
329
  )
318
330
  ] });
319
331
  function F(t) {
320
- return vt(t, a);
332
+ return Et(t, a);
321
333
  }
322
- function J(t, e) {
323
- return xt(t, e, a);
334
+ function Z(t, e) {
335
+ return At(t, e, a);
324
336
  }
325
337
  }
326
- function T(o, i) {
327
- return Vt(o, i);
338
+ function j(s, i) {
339
+ return Yt(s, i);
328
340
  }
329
- function vt(o, i) {
341
+ function Et(s, i) {
330
342
  if (i)
331
- return H(o);
332
- if (o.includes(" - ")) {
333
- const [r, p] = o.split(" - "), Y = H(r), y = H(p || "");
334
- return `${Y} - ${y}`;
343
+ return O(s);
344
+ if (s.includes(" - ")) {
345
+ const [r, p] = s.split(" - "), v = O(r), h = O(p || "");
346
+ return `${v} - ${h}`;
335
347
  }
336
- const V = o.replace(/-/g, "");
337
- return H(V);
348
+ const M = s.replace(/-/g, "");
349
+ return O(M);
338
350
  }
339
- function It(o, i, V, r) {
351
+ function Rt(s, i, M, r) {
340
352
  if (!r && i.includes(" - ")) {
341
- const p = i.indexOf(" - "), Y = o.indexOf("-");
342
- if (Y !== -1 && V > Y) {
343
- const y = o.slice(Y + 1).replace(/\D/g, "").length, k = i.slice(p + 3);
353
+ const p = i.indexOf(" - "), v = s.indexOf("-");
354
+ if (v !== -1 && M > v) {
355
+ const h = s.slice(v + 1).replace(/\D/g, "").length, k = i.slice(p + 3);
344
356
  let a = p + 3, E = 0;
345
- for (let $ = 0; $ < k.length; $++) {
346
- if (/\d/.test(k[$]) && (E++, E >= y)) {
347
- $ + 1 < k.length && k[$ + 1] === "/" ? a = p + 3 + $ + 2 : a = p + 3 + $ + 1;
357
+ for (let g = 0; g < k.length; g++) {
358
+ if (/\d/.test(k[g]) && (E++, E >= h)) {
359
+ g + 1 < k.length && k[g + 1] === "/" ? a = p + 3 + g + 2 : a = p + 3 + g + 1;
348
360
  break;
349
361
  }
350
- E < y && (a = p + 3 + $ + 1);
362
+ E < h && (a = p + 3 + g + 1);
351
363
  }
352
364
  return Math.min(a, i.length);
353
365
  }
354
366
  }
355
- return Mt(
356
- o,
367
+ return xt(
368
+ s,
357
369
  i,
358
- V
370
+ M
359
371
  );
360
372
  }
361
- function xt(o, i, V) {
362
- if (!o && !i)
373
+ function At(s, i, M) {
374
+ if (!s && !i)
363
375
  return "";
364
- const r = o ? g(o) : !1, p = i ? g(i) : !1;
365
- return V ? r && o ? z(o) : "" : r && p && o && i && T(o, i) ? `${z(o)} - ${z(i)}` : r && !i && o ? `${z(o)} - ` : "";
376
+ const r = s ? P(s) : !1, p = i ? P(i) : !1;
377
+ return M ? r && s ? K(s) : "" : r && p && s && i && j(s, i) ? `${K(s)} - ${K(i)}` : r && !i && s ? `${K(s)} - ` : "";
366
378
  }
367
379
  export {
368
- jt as DateRangeInput
380
+ Ct as DateRangeInput
369
381
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AAEzB,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvF,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAA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