@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.
- package/dist/components/DeleteModal/DeleteModal.js +29 -28
- package/dist/components/Filter/Filter.js +10 -10
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.d.ts +3 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +29 -27
- package/dist/components/GenericTable/GenericTable.js +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p, Fragment as s } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { uniqueId as
|
|
4
|
-
import { AvailableCustomIcons as
|
|
5
|
-
import { u as
|
|
6
|
-
import { I as
|
|
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
|
|
9
|
-
title:
|
|
10
|
-
confirmButtonLabel:
|
|
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 } =
|
|
24
|
+
const { isDesktop: C } = x(), k = (I) => {
|
|
24
25
|
I.detail.action === "close" && m(!1);
|
|
25
26
|
};
|
|
26
27
|
return /* @__PURE__ */ r(
|
|
27
|
-
|
|
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:
|
|
34
|
+
title: o,
|
|
34
35
|
primaryButton: /* @__PURE__ */ r(
|
|
35
36
|
u,
|
|
36
37
|
{
|
|
37
38
|
variant: "danger",
|
|
38
|
-
label:
|
|
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:
|
|
59
|
-
isCrossedOut:
|
|
60
|
-
}) =>
|
|
61
|
-
|
|
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:
|
|
64
|
+
icon: o,
|
|
64
65
|
iconSize: "xlarge",
|
|
65
66
|
className: n.colorDanger
|
|
66
67
|
}
|
|
67
|
-
) : /* @__PURE__ */ r(
|
|
68
|
-
deleteHeader:
|
|
69
|
-
deleteText:
|
|
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:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
l &&
|
|
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
|
-
|
|
84
|
+
N(i.toString())
|
|
84
85
|
)) })
|
|
85
86
|
] }), A = ({
|
|
86
|
-
impossibleDeleteHeader:
|
|
87
|
-
}) => /* @__PURE__ */ r(t, { level: 1, themeColor: "text-primary-on-background", children:
|
|
87
|
+
impossibleDeleteHeader: o
|
|
88
|
+
}) => /* @__PURE__ */ r(t, { level: 1, themeColor: "text-primary-on-background", children: o });
|
|
88
89
|
export {
|
|
89
|
-
|
|
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,
|
|
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
|
|
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
|
|
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
|
-
|
|
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(
|
|
86
|
+
u ? /* @__PURE__ */ t(z, { icon: u, iconSize: "medium" }) : null,
|
|
87
87
|
s === "select" && /* @__PURE__ */ t(
|
|
88
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
import { Datepicker as
|
|
3
|
-
import { g as
|
|
4
|
-
import { useMemo as s, useState as
|
|
5
|
-
import { useFormContext as
|
|
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
|
|
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:
|
|
19
|
+
control: h,
|
|
19
20
|
formState: { errors: r, isValidating: u }
|
|
20
|
-
} =
|
|
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
|
-
),
|
|
27
|
+
), C = s(
|
|
27
28
|
() => (/* @__PURE__ */ new Date()).getFullYear() - (m ?? 95),
|
|
28
29
|
[m]
|
|
29
|
-
),
|
|
30
|
+
), v = s(
|
|
30
31
|
() => (/* @__PURE__ */ new Date()).getFullYear() + (f ?? 15),
|
|
31
32
|
[f]
|
|
32
33
|
), c = s(
|
|
33
|
-
() => !u &&
|
|
34
|
+
() => !u && Q(r, t) !== void 0,
|
|
34
35
|
[r, t, u]
|
|
35
|
-
),
|
|
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]), [
|
|
47
|
+
}), [r, x, t, g, c]), [q, d] = $(!1);
|
|
47
48
|
return /* @__PURE__ */ n(
|
|
48
|
-
|
|
49
|
+
B,
|
|
49
50
|
{
|
|
50
51
|
name: t,
|
|
51
52
|
rules: o,
|
|
52
|
-
control:
|
|
53
|
-
render: ({ field: { ref:
|
|
54
|
-
|
|
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
|
-
...
|
|
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__ */
|
|
64
|
-
/* @__PURE__ */ n(
|
|
65
|
-
/* @__PURE__ */ n(
|
|
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:
|
|
82
|
-
maxQuickSelectYear:
|
|
83
|
+
minQuickSelectYear: C,
|
|
84
|
+
maxQuickSelectYear: v,
|
|
83
85
|
readOnly: !0,
|
|
84
|
-
textfieldProps:
|
|
85
|
-
alwaysOpen:
|
|
86
|
+
textfieldProps: T,
|
|
87
|
+
alwaysOpen: q
|
|
86
88
|
}
|
|
87
89
|
) })
|
|
88
90
|
}
|
|
89
91
|
);
|
|
90
92
|
};
|
|
91
93
|
export {
|
|
92
|
-
|
|
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.
|
|
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>",
|