@dmsi/wedgekit-react 3.1.1 → 3.2.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.
@@ -0,0 +1,10 @@
1
+ type CalendarIconButtonProps = {
2
+ id?: string;
3
+ testid?: string;
4
+ disabled?: boolean;
5
+ expanded: boolean;
6
+ onToggle: () => void;
7
+ };
8
+ export declare const CalendarIconButton: import('react').ForwardRefExoticComponent<CalendarIconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
9
+ export {};
10
+ //# sourceMappingURL=CalendarIconButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalendarIconButton.d.ts","sourceRoot":"","sources":["../../src/components/CalendarIconButton.tsx"],"names":[],"mappings":"AAIA,KAAK,uBAAuB,GAAG;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAGF,eAAO,MAAM,kBAAkB,uHA2B7B,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { clsx as c } from "../node_modules/clsx/dist/clsx.js";
3
+ import { forwardRef as s } from "react";
4
+ import { Icon as l } from "./Icon.js";
5
+ const x = s(function({ id: e, testid: t, disabled: n, expanded: o, onToggle: a }, i) {
6
+ return /* @__PURE__ */ r(
7
+ "button",
8
+ {
9
+ ref: i,
10
+ id: e,
11
+ "data-testid": t,
12
+ type: "button",
13
+ "aria-label": "Open calendar",
14
+ "aria-haspopup": "dialog",
15
+ "aria-expanded": o,
16
+ disabled: n,
17
+ onClick: a,
18
+ className: c(
19
+ "inline-flex shrink-0 items-center justify-center rounded bg-transparent p-0 text-text-secondary-normal",
20
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-400",
21
+ n ? "cursor-default" : "cursor-pointer"
22
+ ),
23
+ children: /* @__PURE__ */ r(l, { name: "calendar_month", "aria-hidden": "true" })
24
+ }
25
+ );
26
+ });
27
+ export {
28
+ x as CalendarIconButton
29
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/components/DateInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAa,MAAM,SAAS,CAAC;AAcpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,KAAK,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,GAAG;IACjD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,KAAK,OAAO,CAAC;IACzD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,EAAE,EACF,MAAM,EACN,KAAK,EACL,QAAQ,EACR,WAA0B,EAC1B,QAAQ,EACR,QAAgB,EAChB,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,cAAc,2CAwThB"}
1
+ {"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/components/DateInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAa,MAAM,SAAS,CAAC;AAcpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,KAAK,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,GAAG;IACjD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,KAAK,OAAO,CAAC;IACzD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,EAAE,EACF,MAAM,EACN,KAAK,EACL,QAAQ,EACR,WAA0B,EAC1B,QAAQ,EACR,QAAgB,EAChB,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,cAAc,2CAqUhB"}
@@ -1,227 +1,238 @@
1
1
  "use client";
2
- import { jsxs as $, jsx as l, Fragment as _ } from "react/jsx-runtime";
3
- import { useState as D, useRef as k, useEffect as I, useLayoutEffect as J } from "react";
4
- import { createPortal as Q } from "react-dom";
5
- import { clsx as Z } from "../node_modules/clsx/dist/clsx.js";
6
- import { InputBase as O } from "./Input.js";
7
- import { CalendarRange as T } from "./CalendarRange.js";
8
- import { Icon as ee } from "./Icon.js";
9
- import { findDocumentRoot as te } from "../utils.js";
10
- import { useMatchesMobile as ne } from "../hooks/useMatchesMedia.js";
11
- import { isValidDate as b, calculateCursorPosition as oe } from "../utils/date.js";
12
- import { formatDateWithDashes as re, formatInputValueWithDashes as A, parseInputDateWithDashes as E } from "../utils/date-patch-dashes.js";
13
- import { marginTopUsingComponentGap as ae } from "../classNames.js";
14
- function xe({
15
- id: r,
16
- testid: d,
17
- value: z,
18
- onChange: y,
19
- placeholder: K = "MM/DD/YYYY",
20
- disabled: j,
21
- readOnly: h = !1,
22
- label: H,
23
- isDateAvailable: V,
2
+ import { jsxs as F, jsx as l, Fragment as te } from "react/jsx-runtime";
3
+ import { useState as D, useRef as k, useEffect as E, useLayoutEffect as oe } from "react";
4
+ import { createPortal as ne } from "react-dom";
5
+ import { clsx as re } from "../node_modules/clsx/dist/clsx.js";
6
+ import { InputBase as ae } from "./Input.js";
7
+ import { CalendarRange as A } from "./CalendarRange.js";
8
+ import { CalendarIconButton as se } from "./CalendarIconButton.js";
9
+ import { findDocumentRoot as ie } from "../utils.js";
10
+ import { useMatchesMobile as le } from "../hooks/useMatchesMedia.js";
11
+ import { isValidDate as y, calculateCursorPosition as ce } from "../utils/date.js";
12
+ import { formatDateWithDashes as ue, formatInputValueWithDashes as N, parseInputDateWithDashes as I } from "../utils/date-patch-dashes.js";
13
+ import { marginTopUsingComponentGap as fe } from "../classNames.js";
14
+ function Pe({
15
+ id: o,
16
+ testid: c,
17
+ value: j,
18
+ onChange: C,
19
+ placeholder: H = "MM/DD/YYYY",
20
+ disabled: V,
21
+ readOnly: d = !1,
22
+ label: K,
23
+ isDateAvailable: M,
24
24
  disableManualInput: q,
25
- theme: M,
25
+ theme: $,
26
26
  ...X
27
27
  }) {
28
- const [C, f] = D(!1), [x, g] = D(""), [B, p] = D(!1), w = k(null), s = k(null), P = k(null), c = ne(), [F, G] = D({
28
+ const [g, p] = D(!1), [x, w] = D(""), [T, m] = D(!1), v = k(null), s = k(null), P = k(null), u = le(), [B, G] = D({
29
29
  top: 0,
30
30
  left: 0,
31
31
  width: 0,
32
32
  openAbove: !1
33
- }), u = z;
34
- I(() => {
35
- B || g(N(u));
36
- }, [u, B]), J(() => {
37
- C && m();
38
- }, [C]);
39
- const m = () => {
33
+ }), f = j;
34
+ E(() => {
35
+ T || w(z(f));
36
+ }, [f, T]), oe(() => {
37
+ g && h();
38
+ }, [g]);
39
+ const h = () => {
40
40
  if (P.current) {
41
41
  const e = P.current.getBoundingClientRect(), t = window.innerWidth, a = window.innerHeight, n = 340, i = 400;
42
- let o = e.left;
43
- o + n > t && (o = e.right - n, o < 0 && (o = Math.max(0, (t - n) / 2)));
44
- const v = o + window.scrollX, W = a - e.bottom, U = e.top, Y = W < i && U > W;
42
+ let r = e.left;
43
+ r + n > t && (r = e.right - n, r < 0 && (r = Math.max(0, (t - n) / 2)));
44
+ const b = r + window.scrollX, W = a - e.bottom, ee = e.top, Y = W < i && ee > W;
45
45
  let R;
46
- Y ? R = e.top + window.scrollY - i - 4 : R = e.bottom + window.scrollY + 4, G({ top: R, left: v, width: e.width, openAbove: Y });
46
+ Y ? R = e.top + window.scrollY - i - 4 : R = e.bottom + window.scrollY + 4, G({ top: R, left: b, width: e.width, openAbove: Y });
47
47
  }
48
48
  };
49
- I(() => {
50
- m();
51
- const e = new ResizeObserver(m);
52
- return s.current && e.observe(s.current), window.addEventListener("scroll", m), () => {
53
- e.disconnect(), window.removeEventListener("scroll", m);
49
+ E(() => {
50
+ h();
51
+ const e = new ResizeObserver(h);
52
+ return s.current && e.observe(s.current), window.addEventListener("scroll", h), () => {
53
+ e.disconnect(), window.removeEventListener("scroll", h);
54
54
  };
55
- }, []), I(() => {
55
+ }, []), E(() => {
56
56
  const e = (t) => {
57
- t.key === "Escape" && w.current && (f(!1), s.current?.blur());
57
+ t.key === "Escape" && v.current && (p(!1), s.current?.blur());
58
58
  };
59
59
  return document.addEventListener("keydown", e), () => {
60
60
  document.removeEventListener("keydown", e);
61
61
  };
62
62
  });
63
63
  function L(e) {
64
- y(e), f(!1), p(!1);
64
+ C(e), p(!1), m(!1);
65
65
  }
66
66
  const S = () => {
67
- h || f(!0);
67
+ d || p(!0);
68
+ }, U = () => {
69
+ S();
70
+ }, J = () => {
71
+ d || p((e) => !e);
72
+ }, Q = (e) => {
73
+ e.preventDefault(), e.stopPropagation(), e.currentTarget.blur();
74
+ }, Z = (e) => {
75
+ if (d) return;
76
+ const t = e.target.value, a = e.target.selectionStart || 0;
77
+ m(!0);
78
+ const n = N(t);
79
+ w(n), requestAnimationFrame(() => {
80
+ if (s.current) {
81
+ const r = ce(
82
+ t,
83
+ n,
84
+ a
85
+ );
86
+ s.current.setSelectionRange(r, r);
87
+ }
88
+ });
89
+ const i = I(n);
90
+ i && y(i) && C(i);
91
+ }, _ = () => {
92
+ m(!1);
93
+ const e = I(x);
94
+ (!e || !y(e)) && w(z(f));
95
+ }, O = (e) => {
96
+ if (e.key === "Backspace") {
97
+ const t = e.target, a = t.selectionStart || 0, n = t.value;
98
+ if (a > 0 && n[a - 1] === "/") {
99
+ e.preventDefault();
100
+ const i = n.slice(0, a - 2) + n.slice(a), r = N(i);
101
+ w(r), requestAnimationFrame(() => {
102
+ if (s.current) {
103
+ const b = Math.max(0, a - 2);
104
+ s.current.setSelectionRange(b, b);
105
+ }
106
+ }), m(!0);
107
+ return;
108
+ }
109
+ }
110
+ if (e.key === "Enter") {
111
+ const t = I(x);
112
+ t && y(t) && (C(t), p(!1), m(!1));
113
+ }
68
114
  };
69
- return /* @__PURE__ */ $("div", { className: "relative", children: [
115
+ return /* @__PURE__ */ F("div", { className: "relative", children: [
70
116
  /* @__PURE__ */ l(
71
- O,
117
+ ae,
72
118
  {
73
- id: r,
74
- testid: d,
119
+ id: o,
120
+ testid: c,
75
121
  ref: (e) => {
76
122
  s.current = e;
77
123
  },
78
124
  ...X,
79
125
  wrapperRef: P,
80
126
  value: x,
81
- placeholder: K,
82
- disabled: j,
83
- readOnly: h,
84
- after: /* @__PURE__ */ l(ee, { name: "calendar_month" }),
85
- onFocus: q ? (e) => {
86
- e.preventDefault(), e.stopPropagation(), e.currentTarget.blur();
87
- } : S,
88
- onClick: () => {
89
- S();
90
- },
91
- onChange: (e) => {
92
- if (h) return;
93
- const t = e.target.value, a = e.target.selectionStart || 0;
94
- p(!0);
95
- const n = A(t);
96
- g(n), requestAnimationFrame(() => {
97
- if (s.current) {
98
- const o = oe(
99
- t,
100
- n,
101
- a
102
- );
103
- s.current.setSelectionRange(o, o);
104
- }
105
- });
106
- const i = E(n);
107
- i && b(i) && y(i);
108
- },
109
- onBlur: () => {
110
- p(!1);
111
- const e = E(x);
112
- (!e || !b(e)) && g(N(u));
113
- },
114
- onKeyDown: (e) => {
115
- if (e.key === "Backspace") {
116
- const t = e.target, a = t.selectionStart || 0, n = t.value;
117
- if (a > 0 && n[a - 1] === "/") {
118
- e.preventDefault();
119
- const i = n.slice(0, a - 2) + n.slice(a), o = A(i);
120
- g(o), requestAnimationFrame(() => {
121
- if (s.current) {
122
- const v = Math.max(0, a - 2);
123
- s.current.setSelectionRange(v, v);
124
- }
125
- }), p(!0);
126
- return;
127
- }
128
- }
129
- if (e.key === "Enter") {
130
- const t = E(x);
131
- t && b(t) && (y(t), f(!1), p(!1));
127
+ placeholder: H,
128
+ disabled: V,
129
+ readOnly: d,
130
+ after: /* @__PURE__ */ l(
131
+ se,
132
+ {
133
+ id: o ? `${o}-calendar-button` : void 0,
134
+ testid: c ? `${c}-calendar-button` : void 0,
135
+ disabled: V || d,
136
+ expanded: g,
137
+ onToggle: J
132
138
  }
133
- },
134
- label: H,
139
+ ),
140
+ onFocus: q ? Q : S,
141
+ onClick: U,
142
+ onChange: Z,
143
+ onBlur: _,
144
+ onKeyDown: O,
145
+ label: K,
135
146
  secondaryIconColor: !0
136
147
  }
137
148
  ),
138
- C && !h && Q(
139
- /* @__PURE__ */ $(_, { children: [
149
+ g && !d && ne(
150
+ /* @__PURE__ */ F(te, { children: [
140
151
  /* @__PURE__ */ l(
141
152
  "div",
142
153
  {
143
- className: Z(
154
+ className: re(
144
155
  "fixed inset-0 z-30",
145
- c && "overflow-y-auto bg-neutral-600/50"
156
+ u && "overflow-y-auto bg-neutral-600/50"
146
157
  ),
147
- "data-theme": M,
148
- onClick: () => f(!1),
158
+ "data-theme": $,
159
+ onClick: () => p(!1),
149
160
  onMouseDown: (e) => {
150
- c || e.preventDefault();
161
+ u || e.preventDefault();
151
162
  },
152
163
  onWheel: (e) => {
153
- if (!c) {
164
+ if (!u) {
154
165
  const t = document.scrollingElement ?? document.documentElement;
155
166
  t.scrollTop += e.deltaY, t.scrollLeft += e.deltaX;
156
167
  }
157
168
  },
158
169
  onTouchMove: (e) => {
159
- c || e.stopPropagation();
170
+ u || e.stopPropagation();
160
171
  },
161
- style: { touchAction: c ? "auto" : "pan-y pan-x" },
172
+ style: { touchAction: u ? "auto" : "pan-y pan-x" },
162
173
  "aria-hidden": "true",
163
- children: c && /* @__PURE__ */ l("div", { className: "min-h-full flex items-start justify-center py-4 px-2", children: /* @__PURE__ */ l(
174
+ children: u && /* @__PURE__ */ l("div", { className: "min-h-full flex items-start justify-center py-4 px-2", children: /* @__PURE__ */ l(
164
175
  "div",
165
176
  {
166
177
  ref: (e) => {
167
- w.current = e;
178
+ v.current = e;
168
179
  },
169
180
  className: "bg-background-primary-normal rounded-base shadow-4 max-w-full",
170
181
  onClick: (e) => e.stopPropagation(),
171
182
  children: /* @__PURE__ */ l(
172
- T,
183
+ A,
173
184
  {
174
- id: r ? `${r}-calendar` : void 0,
175
- testid: d ? `${d}-calendar` : void 0,
176
- from: u,
177
- to: u,
185
+ id: o ? `${o}-calendar` : void 0,
186
+ testid: c ? `${c}-calendar` : void 0,
187
+ from: f,
188
+ to: f,
178
189
  onChange: L,
179
190
  cardStyle: !0,
180
191
  mode: "single",
181
192
  disableRange: !0,
182
- isDateAvailable: V
193
+ isDateAvailable: M
183
194
  }
184
195
  )
185
196
  }
186
197
  ) })
187
198
  }
188
199
  ),
189
- !c && /* @__PURE__ */ l(
200
+ !u && /* @__PURE__ */ l(
190
201
  "div",
191
202
  {
192
203
  ref: (e) => {
193
- w.current = e;
204
+ v.current = e;
194
205
  },
195
- className: `absolute z-50 ${ae}`,
196
- "data-theme": M,
206
+ className: `absolute z-50 ${fe}`,
207
+ "data-theme": $,
197
208
  style: {
198
- top: `${F.top}px`,
199
- left: `${F.left}px`
209
+ top: `${B.top}px`,
210
+ left: `${B.left}px`
200
211
  },
201
212
  children: /* @__PURE__ */ l(
202
- T,
213
+ A,
203
214
  {
204
- id: r ? `${r}-calendar` : void 0,
205
- testid: d ? `${d}-calendar` : void 0,
206
- from: u,
207
- to: u,
215
+ id: o ? `${o}-calendar` : void 0,
216
+ testid: c ? `${c}-calendar` : void 0,
217
+ from: f,
218
+ to: f,
208
219
  onChange: L,
209
220
  cardStyle: !0,
210
221
  mode: "single",
211
222
  disableRange: !0,
212
- isDateAvailable: V
223
+ isDateAvailable: M
213
224
  }
214
225
  )
215
226
  }
216
227
  )
217
228
  ] }),
218
- te(w.current)
229
+ ie(v.current)
219
230
  )
220
231
  ] });
221
232
  }
222
- function N(r) {
223
- return !r || !b(r) ? "" : re(r);
233
+ function z(o) {
234
+ return !o || !y(o) ? "" : ue(o);
224
235
  }
225
236
  export {
226
- xe as DateInput
237
+ Pe as DateInput
227
238
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DateRangeInput.d.ts","sourceRoot":"","sources":["../../src/components/DateRangeInput.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAa,MAAM,SAAS,CAAC;AACpD,OAAO,EAAiB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAcpE,KAAK,mBAAmB,GAAG,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,GAAG;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,GAAG,qBAAqB,CAAC,CAAC;AAExE,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,MAAM,EACN,KAAK,EACL,QAAQ,EACR,WAAuC,EACvC,QAAQ,EACR,QAAgB,EAChB,MAAc,EACd,YAAoB,EACpB,KAAK,EACL,eAAe,EACf,mBAAmB,EACnB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,mBAAmB,2CA4kBrB"}
1
+ {"version":3,"file":"DateRangeInput.d.ts","sourceRoot":"","sources":["../../src/components/DateRangeInput.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAa,MAAM,SAAS,CAAC;AACpD,OAAO,EAAiB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAcpE,KAAK,mBAAmB,GAAG,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,GAAG;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,GAAG,qBAAqB,CAAC,CAAC;AAExE,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,MAAM,EACN,KAAK,EACL,QAAQ,EACR,WAAuC,EACvC,QAAQ,EACR,QAAgB,EAChB,MAAc,EACd,YAAoB,EACpB,KAAK,EACL,eAAe,EACf,mBAAmB,EACnB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,mBAAmB,2CA4lBrB"}
@@ -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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmsi/wedgekit-react",
3
- "version": "3.1.1",
3
+ "version": "3.2.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",