@hortiview/shared-components 0.0.7857 → 0.0.7897

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,13 +1,14 @@
1
1
  import { jsx as r, jsxs as p, Fragment as s } from "react/jsx-runtime";
2
- import { Modal as D, Button as u, Group as c, Icon as N, TypoBody as t } from "@element/react-components";
3
- import { uniqueId as S } from "lodash";
4
- import { AvailableCustomIcons as x } from "../../enums/AvailableCustomIcons.js";
5
- import { u as M } from "../../useBreakpoints-BNeVhjjZ.js";
6
- import { I as j } from "../../Iconify-CY9lZjFd.js";
2
+ import { Button as u, Group as c, Icon as D, TypoBody as t } from "@element/react-components";
3
+ import { uniqueId as N } from "lodash";
4
+ import { AvailableCustomIcons as S } from "../../enums/AvailableCustomIcons.js";
5
+ import { u as x } from "../../useBreakpoints-BNeVhjjZ.js";
6
+ import { I as M } from "../../Iconify-CY9lZjFd.js";
7
+ import { Modal as j } from "../Modal/Modal.js";
7
8
  import { s as n } from "../../deleteModal.module-Ds3MDzdl.js";
8
- const K = ({
9
- title: e,
10
- confirmButtonLabel: o,
9
+ const L = ({
10
+ title: o,
11
+ confirmButtonLabel: e,
11
12
  cancelButtonLabel: l,
12
13
  deleteHeader: a,
13
14
  deleteBody: i,
@@ -20,22 +21,22 @@ const K = ({
20
21
  onDelete: b,
21
22
  isDeletePossible: d = !0
22
23
  }) => {
23
- const { isDesktop: C } = M(), k = (I) => {
24
+ const { isDesktop: C } = x(), k = (I) => {
24
25
  I.detail.action === "close" && m(!1);
25
26
  };
26
27
  return /* @__PURE__ */ r(
27
- D,
28
+ j,
28
29
  {
29
30
  className: n.modal,
30
31
  modalSize: C ? "small" : "fullscreen",
31
32
  open: y,
32
33
  onClose: k,
33
- title: e,
34
+ title: o,
34
35
  primaryButton: /* @__PURE__ */ r(
35
36
  u,
36
37
  {
37
38
  variant: "danger",
38
- label: o,
39
+ label: e,
39
40
  onClick: b,
40
41
  disabled: !d
41
42
  }
@@ -55,24 +56,24 @@ const K = ({
55
56
  }
56
57
  );
57
58
  }, z = ({
58
- element: e,
59
- isCrossedOut: o = !1
60
- }) => o ? /* @__PURE__ */ r("span", { className: n.crossedOut, children: e }) : e, B = ({ icon: e }) => e ? typeof e != "string" ? e : Object.values(x).includes(e) ? /* @__PURE__ */ r(
61
- j,
59
+ element: o,
60
+ isCrossedOut: e = !1
61
+ }) => e ? /* @__PURE__ */ r("span", { className: n.crossedOut, children: o }) : o, B = ({ icon: o }) => o ? typeof o != "string" ? o : Object.values(S).includes(o) ? /* @__PURE__ */ r(
62
+ M,
62
63
  {
63
- icon: e,
64
+ icon: o,
64
65
  iconSize: "xlarge",
65
66
  className: n.colorDanger
66
67
  }
67
- ) : /* @__PURE__ */ r(N, { icon: e, iconSize: "xlarge", className: n.colorDanger }) : /* @__PURE__ */ r(s, {}), O = ({
68
- deleteHeader: e,
69
- deleteText: o,
68
+ ) : /* @__PURE__ */ r(D, { icon: o, iconSize: "xlarge", className: n.colorDanger }) : /* @__PURE__ */ r(s, {}), O = ({
69
+ deleteHeader: o,
70
+ deleteText: e,
70
71
  deleteBody: l
71
72
  }) => /* @__PURE__ */ p(s, { children: [
72
- /* @__PURE__ */ r(t, { level: 1, themeColor: "text-primary-on-background", children: e }),
73
- o && typeof o == "string" && /* @__PURE__ */ r(t, { level: 2, themeColor: "text-secondary-on-background", children: o }),
74
- o && typeof o != "string" && /* @__PURE__ */ r(s, { children: o }),
75
- l && o === void 0 && /* @__PURE__ */ r(c, { direction: "vertical", gap: "none", children: l.map((a, i) => /* @__PURE__ */ r(
73
+ /* @__PURE__ */ r(t, { level: 1, themeColor: "text-primary-on-background", children: o }),
74
+ e && typeof e == "string" && /* @__PURE__ */ r(t, { level: 2, themeColor: "text-secondary-on-background", children: e }),
75
+ e && typeof e != "string" && /* @__PURE__ */ r(s, { children: e }),
76
+ l && e === void 0 && /* @__PURE__ */ r(c, { direction: "vertical", gap: "none", children: l.map((a, i) => /* @__PURE__ */ r(
76
77
  t,
77
78
  {
78
79
  level: 2,
@@ -80,11 +81,11 @@ const K = ({
80
81
  themeColor: "text-secondary-on-background",
81
82
  children: a
82
83
  },
83
- S(i.toString())
84
+ N(i.toString())
84
85
  )) })
85
86
  ] }), A = ({
86
- impossibleDeleteHeader: e
87
- }) => /* @__PURE__ */ r(t, { level: 1, themeColor: "text-primary-on-background", children: e });
87
+ impossibleDeleteHeader: o
88
+ }) => /* @__PURE__ */ r(t, { level: 1, themeColor: "text-primary-on-background", children: o });
88
89
  export {
89
- K as DeleteModal
90
+ L as DeleteModal
90
91
  };
@@ -1,10 +1,10 @@
1
1
  import { jsx as t, jsxs as B, Fragment as I } from "react/jsx-runtime";
2
- import { Group as y, Modal as T, Button as h, Select as W, Switch as j, IconButton as z, NotificationBadge as b } from "@element/react-components";
2
+ import { Group as y, Button as h, Select as T, Switch as W, IconButton as j, NotificationBadge as b } from "@element/react-components";
3
3
  import { useState as v } from "react";
4
4
  import { s as c } from "../../genericTable.module-Dk3yy2S3.js";
5
5
  import { u as A } from "../../useBreakpoints-BNeVhjjZ.js";
6
6
  import "../../alertBanner.module-BPiKN0gh.js";
7
- import { I as H } from "../../Iconify-CY9lZjFd.js";
7
+ import { I as z } from "../../Iconify-CY9lZjFd.js";
8
8
  import "../../react-tooltip.min-BzHiZW8k.js";
9
9
  import "../../overflowTooltip.module-BN3bp9Cj.js";
10
10
  import "../../basicHeading.module-BYb8xvuk.js";
@@ -12,13 +12,14 @@ import "../../isArray-Ca4KR8TK.js";
12
12
  import "../../_baseToString-BNXOi2Mf.js";
13
13
  import "../../_equalByTag-DJhSpgVG.js";
14
14
  import "../../iconify.module-C89oaw5b.js";
15
- import { SearchBar as K } from "../SearchBar/SearchBar.js";
15
+ import { SearchBar as H } from "../SearchBar/SearchBar.js";
16
16
  import "../../listArea.module-CGpHPOji.js";
17
17
  import "../../verticalDivider.module-C3_GL-fH.js";
18
18
  import "../../baseView.module-uWbm_a5f.js";
19
19
  import "../../BlockView.module-BPlNT5uh.js";
20
20
  import "lodash";
21
21
  import "../../contextMenu.module-DNQ8d9Aj.js";
22
+ import { Modal as K } from "../Modal/Modal.js";
22
23
  import "../../deleteModal.module-Ds3MDzdl.js";
23
24
  import "../../disclaimer.module-BZydt-Q_.js";
24
25
  import "../../genericCard.module-DrQu86jX.js";
@@ -27,7 +28,6 @@ import "../../HeaderFilter.module-DiBmulr5.js";
27
28
  import "../../infoGroup.module-Cxw88dfC.js";
28
29
  import "../../bigLoadingSpinner.module-GgbFol8k.js";
29
30
  import "../../loadingSpinner.module-CLtqSMWA.js";
30
- import "../../modal.module-BlDp1Wiq.js";
31
31
  import "../Scrollbar/Scrollbar.js";
32
32
  import "react-hook-form";
33
33
  import "../../formDatePicker.module-BV3ma_7y.js";
@@ -69,7 +69,7 @@ const xt = ({
69
69
  }
70
70
  ),
71
71
  /* @__PURE__ */ t(
72
- T,
72
+ K,
73
73
  {
74
74
  open: w,
75
75
  onClose: S,
@@ -83,9 +83,9 @@ const xt = ({
83
83
  )
84
84
  ] }) : /* @__PURE__ */ t(y, { secondaryAlign: "center", fullWidth: !0, children: k(d, f, F, !1) });
85
85
  }, k = (m, a, i, n = !0) => m.map(({ id: r, title: p, availableOptions: d, icon: u, type: s }) => /* @__PURE__ */ B(y, { fullWidth: !0, secondaryAlign: "center", children: [
86
- u ? /* @__PURE__ */ t(H, { icon: u, iconSize: "medium" }) : null,
86
+ u ? /* @__PURE__ */ t(z, { icon: u, iconSize: "medium" }) : null,
87
87
  s === "select" && /* @__PURE__ */ t(
88
- W,
88
+ T,
89
89
  {
90
90
  className: n ? void 0 : c.dense,
91
91
  variant: "outlined",
@@ -106,7 +106,7 @@ const xt = ({
106
106
  }
107
107
  ),
108
108
  s === "toggle" && /* @__PURE__ */ t(
109
- j,
109
+ W,
110
110
  {
111
111
  label: p,
112
112
  onChange: (e) => i({ id: r, type: s, filterValue: e }),
@@ -114,7 +114,7 @@ const xt = ({
114
114
  }
115
115
  ),
116
116
  s === "search" && /* @__PURE__ */ t(
117
- K,
117
+ H,
118
118
  {
119
119
  placeholder: p,
120
120
  searchTerm: a.find((e) => e.id === r)?.filterValue,
@@ -129,7 +129,7 @@ const xt = ({
129
129
  }) => {
130
130
  const { isDesktop: r } = A();
131
131
  return a ? /* @__PURE__ */ t(
132
- z,
132
+ j,
133
133
  {
134
134
  icon: "filter_list_alt",
135
135
  onClick: n,
@@ -1,3 +1,4 @@
1
+ import { DatepickerProps as ElementDatePickerProps } from '@element/react-components';
1
2
  import { FieldPath, FieldValues, Path, RegisterOptions } from 'react-hook-form';
2
3
  type DatePickerProps<T extends FieldValues> = {
3
4
  /** Name of the property that this date picker represents. */
@@ -33,9 +34,10 @@ type DatePickerProps<T extends FieldValues> = {
33
34
  * @param minRangeYear - number of years to subtract from the current date as bottom of range
34
35
  * @param maxRangeYear - number of years to add to the current date as top of range
35
36
  * @param locale - locale to be used for the date picker.
37
+ * @param props - additional props to be passed to the date picker, which are the props of the element date picker {@link ElementDatePickerProps}.
36
38
  * @param rules - rules for the date picker. default _undefined_ example: _{ required: { value: true, message: 'This field is required' } }_
37
39
  *
38
40
  * @returns A JSX element that renders a date picker form input.
39
41
  */
40
- export declare const FormDatePicker: <T extends FieldValues>({ propertyName, label, closeLabel, className, minRangeYear, maxRangeYear, locale, rules, }: DatePickerProps<T>) => import("react/jsx-runtime").JSX.Element;
42
+ export declare const FormDatePicker: <T extends FieldValues>({ propertyName, label, closeLabel, className, minRangeYear, maxRangeYear, locale, rules, ...props }: ElementDatePickerProps & DatePickerProps<T>) => import("react/jsx-runtime").JSX.Element;
41
43
  export {};
@@ -1,10 +1,10 @@
1
- import { jsx as n, jsxs as O } from "react/jsx-runtime";
2
- import { Datepicker as Y, Divider as b, Padding as j, Button as H } from "@element/react-components";
3
- import { g as M } from "../../../get-UxX31Aph.js";
4
- import { useMemo as s, useState as Q } from "react";
5
- import { useFormContext as $, Controller as w } from "react-hook-form";
1
+ import { jsx as n, jsxs as Y } from "react/jsx-runtime";
2
+ import { Datepicker as b, Divider as j, Padding as H, Button as M } from "@element/react-components";
3
+ import { g as Q } from "../../../get-UxX31Aph.js";
4
+ import { useMemo as s, useState as $ } from "react";
5
+ import { useFormContext as w, Controller as B } from "react-hook-form";
6
6
  import { s as l } from "../../../formDatePicker.module-BV3ma_7y.js";
7
- const A = ({
7
+ const G = ({
8
8
  propertyName: t,
9
9
  label: k,
10
10
  closeLabel: p,
@@ -12,27 +12,28 @@ const A = ({
12
12
  minRangeYear: m,
13
13
  maxRangeYear: f,
14
14
  locale: D,
15
- rules: o
15
+ rules: o,
16
+ ...S
16
17
  }) => {
17
18
  const {
18
- control: S,
19
+ control: h,
19
20
  formState: { errors: r, isValidating: u }
20
- } = $(), g = s(
21
+ } = w(), g = s(
21
22
  () => o?.required?.value,
22
23
  [o]
23
24
  ), x = s(
24
25
  () => o?.required?.message,
25
26
  [o]
26
- ), h = s(
27
+ ), C = s(
27
28
  () => (/* @__PURE__ */ new Date()).getFullYear() - (m ?? 95),
28
29
  [m]
29
- ), C = s(
30
+ ), v = s(
30
31
  () => (/* @__PURE__ */ new Date()).getFullYear() + (f ?? 15),
31
32
  [f]
32
33
  ), c = s(
33
- () => !u && M(r, t) !== void 0,
34
+ () => !u && Q(r, t) !== void 0,
34
35
  [r, t, u]
35
- ), v = s(() => ({
36
+ ), T = s(() => ({
36
37
  valid: !c,
37
38
  helperTextPersistent: c || g,
38
39
  helperText: (() => {
@@ -43,26 +44,27 @@ const A = ({
43
44
  return x;
44
45
  })(),
45
46
  className: `${l.fromPickerText} ${c ? l.invalid : ""}`
46
- }), [r, x, t, g, c]), [T, d] = Q(!1);
47
+ }), [r, x, t, g, c]), [q, d] = $(!1);
47
48
  return /* @__PURE__ */ n(
48
- w,
49
+ B,
49
50
  {
50
51
  name: t,
51
52
  rules: o,
52
- control: S,
53
- render: ({ field: { ref: q, onChange: i, value: a, ...F } }) => /* @__PURE__ */ n("div", { className: l.datePickerContainer, children: /* @__PURE__ */ n(
54
- Y,
53
+ control: h,
54
+ render: ({ field: { ref: F, onChange: i, value: a, ...O } }) => /* @__PURE__ */ n("div", { className: l.datePickerContainer, children: /* @__PURE__ */ n(
55
+ b,
55
56
  {
56
- ...F,
57
+ ...S,
58
+ ...O,
57
59
  className: P ?? "",
58
60
  value: a,
59
61
  variant: "outlined",
60
62
  label: k,
61
63
  format: (e) => e ? e.toLocaleDateString(D ?? "en") : "",
62
64
  disableClearing: !0,
63
- trailingContent: /* @__PURE__ */ O("div", { className: l.trailingContent, children: [
64
- /* @__PURE__ */ n(b, {}),
65
- /* @__PURE__ */ n(j, { variant: "dense", children: /* @__PURE__ */ n(H, { label: p, variant: "text", onClick: () => d(!1) }) })
65
+ trailingContent: /* @__PURE__ */ Y("div", { className: l.trailingContent, children: [
66
+ /* @__PURE__ */ n(j, {}),
67
+ /* @__PURE__ */ n(H, { variant: "dense", children: /* @__PURE__ */ n(M, { label: p, variant: "text", onClick: () => d(!1) }) })
66
68
  ] }),
67
69
  onClick: () => {
68
70
  d(!0);
@@ -78,16 +80,16 @@ const A = ({
78
80
  },
79
81
  hoisted: !0,
80
82
  calendarProps: { hoisted: !0, className: l.datePickerCalendar },
81
- minQuickSelectYear: h,
82
- maxQuickSelectYear: C,
83
+ minQuickSelectYear: C,
84
+ maxQuickSelectYear: v,
83
85
  readOnly: !0,
84
- textfieldProps: v,
85
- alwaysOpen: T
86
+ textfieldProps: T,
87
+ alwaysOpen: q
86
88
  }
87
89
  ) })
88
90
  }
89
91
  );
90
92
  };
91
93
  export {
92
- A as FormDatePicker
94
+ G as FormDatePicker
93
95
  };
@@ -18,6 +18,7 @@ import "../../baseView.module-uWbm_a5f.js";
18
18
  import "../../BlockView.module-BPlNT5uh.js";
19
19
  import "lodash";
20
20
  import "../../contextMenu.module-DNQ8d9Aj.js";
21
+ import "../../modal.module-BlDp1Wiq.js";
21
22
  import "../../deleteModal.module-Ds3MDzdl.js";
22
23
  import "../../disclaimer.module-BZydt-Q_.js";
23
24
  import "../../HashTabView.module-DUekkiTC.js";
@@ -25,7 +26,6 @@ import "../../HeaderFilter.module-DiBmulr5.js";
25
26
  import "../../infoGroup.module-Cxw88dfC.js";
26
27
  import "../../bigLoadingSpinner.module-GgbFol8k.js";
27
28
  import "../../loadingSpinner.module-CLtqSMWA.js";
28
- import "../../modal.module-BlDp1Wiq.js";
29
29
  import "../Scrollbar/Scrollbar.js";
30
30
  import "react-hook-form";
31
31
  import "../../formDatePicker.module-BV3ma_7y.js";
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.7857",
4
+ "version": "0.0.7897",
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>",