@hortiview/shared-components 0.0.8936 → 0.0.9015

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.
@@ -4,92 +4,91 @@ import { g as H } from "../../../get-UxX31Aph.js";
4
4
  import { useMemo as a, useState as Q } from "react";
5
5
  import { useFormContext as $, Controller as B } from "react-hook-form";
6
6
  import { s as d } from "../../../formDatePicker.module-BV3ma_7y.js";
7
- const f = (e) => {
8
- const i = new Date(e), D = i.getUTCDate(), g = i.getUTCMonth(), m = i.getUTCFullYear();
9
- return new Date(m, g, D);
7
+ const x = (e) => {
8
+ const i = new Date(e), f = i.getUTCDate(), D = i.getUTCMonth(), m = i.getUTCFullYear();
9
+ return new Date(m, D, f);
10
10
  }, G = ({
11
11
  propertyName: e,
12
12
  label: i,
13
- closeLabel: D,
14
- className: g,
13
+ closeLabel: f,
14
+ className: D,
15
15
  minRangeYear: m,
16
- maxRangeYear: S,
16
+ maxRangeYear: g,
17
17
  locale: p,
18
18
  rules: c,
19
19
  ...P
20
20
  }) => {
21
21
  const {
22
22
  control: T,
23
- formState: { errors: n, isValidating: C }
23
+ formState: { errors: r, isValidating: C }
24
24
  } = $(), h = a(
25
25
  () => c?.required?.value,
26
26
  [c]
27
27
  ), k = a(
28
28
  () => c?.required?.message,
29
29
  [c]
30
- ), O = a(
30
+ ), v = a(
31
31
  () => (/* @__PURE__ */ new Date()).getFullYear() - (m ?? 95),
32
32
  [m]
33
- ), v = a(
34
- () => (/* @__PURE__ */ new Date()).getFullYear() + (S ?? 15),
35
- [S]
33
+ ), O = a(
34
+ () => (/* @__PURE__ */ new Date()).getFullYear() + (g ?? 15),
35
+ [g]
36
36
  ), u = a(
37
- () => !C && H(n, e) !== void 0,
38
- [n, e, C]
37
+ () => !C && H(r, e) !== void 0,
38
+ [r, e, C]
39
39
  ), w = a(() => ({
40
40
  valid: !u,
41
41
  helperTextPersistent: u || h,
42
42
  helperText: (() => {
43
- if (n && n[e]) {
44
- const o = n[e]?.message;
45
- return o || "Invalid input";
43
+ if (r && r[e]) {
44
+ const n = r[e]?.message;
45
+ return n || "Invalid input";
46
46
  }
47
47
  return k;
48
48
  })(),
49
49
  className: `${d.fromPickerText} ${u ? d.invalid : ""}`
50
- }), [n, k, e, h, u]), [F, x] = Q(!1);
50
+ }), [r, k, e, h, u]), [F, S] = Q(!1);
51
51
  return /* @__PURE__ */ s(
52
52
  B,
53
53
  {
54
54
  name: e,
55
55
  rules: c,
56
56
  control: T,
57
- render: ({ field: { ref: I, onChange: o, value: l, ...q } }) => /* @__PURE__ */ s("div", { className: d.datePickerContainer, children: /* @__PURE__ */ s(
57
+ render: ({ field: { ref: q, onChange: n, value: l, ...I } }) => /* @__PURE__ */ s("div", { className: d.datePickerContainer, children: /* @__PURE__ */ s(
58
58
  M,
59
59
  {
60
60
  ...P,
61
- ...q,
62
- className: g ?? "",
61
+ ...I,
62
+ className: D ?? "",
63
63
  value: l,
64
64
  variant: "outlined",
65
65
  label: i,
66
- format: (t) => t ? f(t.toISOString()).toLocaleDateString(p ?? "en") : "",
66
+ format: (t) => t ? x(t.toISOString()).toLocaleDateString(p ?? "en") : "",
67
67
  disableClearing: !0,
68
68
  trailingContent: /* @__PURE__ */ Y("div", { className: d.trailingContent, children: [
69
69
  /* @__PURE__ */ s(U, {}),
70
- /* @__PURE__ */ s(b, { variant: "dense", children: /* @__PURE__ */ s(j, { label: D, variant: "text", onClick: () => x(!1) }) })
70
+ /* @__PURE__ */ s(b, { variant: "dense", children: /* @__PURE__ */ s(j, { label: f, variant: "text", onClick: () => S(!1) }) })
71
71
  ] }),
72
72
  onClick: () => {
73
- x(!0);
73
+ S(!0);
74
74
  },
75
75
  onSelect: (t) => {
76
- const r = f(t.toISOString());
77
- o(r), x(!1);
76
+ n(t), S(!1);
78
77
  },
79
78
  onSelectMonth: (t) => {
80
- const r = f(t.toISOString());
81
- l && (r.setDate(l.getDate()), o(r));
79
+ const o = x(t.toISOString());
80
+ l && (o.setDate(l.getDate()), n(o));
82
81
  },
83
82
  onSelectYear: (t) => {
84
83
  if (l) {
85
- const r = f(t.toISOString());
86
- r.setDate(l.getDate()), o(r);
84
+ const o = x(t.toISOString());
85
+ o.setDate(l.getDate()), n(o);
87
86
  }
88
87
  },
89
88
  hoisted: !0,
90
89
  calendarProps: { hoisted: !0, className: d.datePickerCalendar },
91
- minQuickSelectYear: O,
92
- maxQuickSelectYear: v,
90
+ minQuickSelectYear: v,
91
+ maxQuickSelectYear: O,
93
92
  readOnly: !0,
94
93
  textfieldProps: w,
95
94
  alwaysOpen: F
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hortiview/shared-components",
3
3
  "description": "This is a shared component library. It should used in the HortiView platform and its modules.",
4
- "version": "0.0.8936",
4
+ "version": "0.0.9015",
5
5
  "type": "module",
6
6
  "repository": "https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared",
7
7
  "author": "Falk Menge <falk.menge.ext@bayer.com>",