@hortiview/shared-components 0.0.8519 → 0.0.8611
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/assets/contextMenu.css +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +5 -2
- package/dist/components/ContextMenu/ContextMenu.js +21 -20
- package/dist/components/Filter/Filter.js +1 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +63 -60
- package/dist/components/GenericTable/GenericTable.js +1 -1
- package/dist/contextMenu.module-vNQHb48g.js +9 -0
- package/dist/main.d.ts +1 -0
- package/package.json +1 -1
- package/dist/contextMenu.module-DNQ8d9Aj.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._menu_ol91v_1{width:15.875rem}._icon_ol91v_5{color:var(--lmnt-theme-on-secondary-inactive)}._listItem_ol91v_9 [class*=mdc-list-item__start]{color:var(--lmnt-theme-on-secondary-inactive);align-self:center!important;margin:0 1rem!important}._listItem_ol91v_9 [class*=mdc-list-item__end]{color:var(--lmnt-theme-on-secondary-inactive)}
|
|
@@ -6,15 +6,18 @@ type ContextMenuProps = {
|
|
|
6
6
|
triggerOpen?: boolean | null;
|
|
7
7
|
/**
|
|
8
8
|
* List of actions to display in the context menu as ListItems
|
|
9
|
-
* @see
|
|
9
|
+
* @see ActionProps
|
|
10
10
|
*/
|
|
11
|
-
actions:
|
|
11
|
+
actions: ActionProps[];
|
|
12
12
|
/**
|
|
13
13
|
* Determines if menu icon should be vertical or horizontal three dots
|
|
14
14
|
* Default is 'vertical'
|
|
15
15
|
*/
|
|
16
16
|
iconOrientation?: 'vertical' | 'horizontal';
|
|
17
17
|
};
|
|
18
|
+
export type ActionProps = ListItemProps & {
|
|
19
|
+
closeOnClick?: boolean;
|
|
20
|
+
};
|
|
18
21
|
/**
|
|
19
22
|
*
|
|
20
23
|
* @param {boolean} triggerOpen indicates if the menu should be open
|
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Menu as u, IconButton as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { uniqueId as
|
|
5
|
-
import { s
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Menu as u, IconButton as f, List as d, ListItem as p } from "@element/react-components";
|
|
3
|
+
import { useState as C, useCallback as r, useEffect as k } from "react";
|
|
4
|
+
import { uniqueId as y } from "lodash";
|
|
5
|
+
import { s } from "../../contextMenu.module-vNQHb48g.js";
|
|
6
6
|
const M = ({
|
|
7
|
-
triggerOpen:
|
|
7
|
+
triggerOpen: l = null,
|
|
8
8
|
actions: a,
|
|
9
9
|
iconOrientation: c = "vertical"
|
|
10
10
|
}) => {
|
|
11
|
-
const [e, t] =
|
|
11
|
+
const [e, t] = C(!1), m = r(() => {
|
|
12
12
|
t(!e);
|
|
13
|
-
}, [e]),
|
|
13
|
+
}, [e]), i = r(() => {
|
|
14
14
|
t(!1);
|
|
15
15
|
}, []);
|
|
16
|
-
return
|
|
17
|
-
t(
|
|
18
|
-
}, [
|
|
16
|
+
return k(() => {
|
|
17
|
+
t(l !== null ? l : !1);
|
|
18
|
+
}, [l]), /* @__PURE__ */ n(
|
|
19
19
|
u,
|
|
20
20
|
{
|
|
21
|
-
className:
|
|
21
|
+
className: s.menu,
|
|
22
22
|
"data-testid": "selectionmenu",
|
|
23
23
|
open: e,
|
|
24
24
|
surfaceOnly: !0,
|
|
25
25
|
hoistToBody: !0,
|
|
26
|
-
onClose:
|
|
27
|
-
trigger: /* @__PURE__ */
|
|
28
|
-
|
|
26
|
+
onClose: i,
|
|
27
|
+
trigger: /* @__PURE__ */ n(
|
|
28
|
+
f,
|
|
29
29
|
{
|
|
30
|
-
className:
|
|
30
|
+
className: s.icon,
|
|
31
31
|
variant: e ? "filled-primary" : void 0,
|
|
32
32
|
"data-testid": "openButton",
|
|
33
33
|
icon: c === "vertical" ? "more_vert" : "more_horiz",
|
|
34
34
|
onClick: m
|
|
35
35
|
}
|
|
36
36
|
),
|
|
37
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ n(d, { children: a.map((o) => /* @__PURE__ */ n(
|
|
38
38
|
p,
|
|
39
39
|
{
|
|
40
|
-
|
|
40
|
+
className: s.listItem,
|
|
41
|
+
...o,
|
|
41
42
|
leadingBlockType: "icon",
|
|
42
43
|
"data-testid": "listItemButton",
|
|
43
44
|
onClick: () => {
|
|
44
|
-
|
|
45
|
+
o?.onClick?.(), o.closeOnClick !== !1 && i();
|
|
45
46
|
}
|
|
46
47
|
},
|
|
47
|
-
|
|
48
|
+
y(`LI_${o.primaryText?.toString()}_`)
|
|
48
49
|
)) })
|
|
49
50
|
},
|
|
50
51
|
"selectionmenu"
|
|
@@ -19,7 +19,7 @@ import "../../baseView.module-uWbm_a5f.js";
|
|
|
19
19
|
import "../../BlockView.module-BPlNT5uh.js";
|
|
20
20
|
import "../../chipCard.module-BjpKuf1b.js";
|
|
21
21
|
import "lodash";
|
|
22
|
-
import "../../contextMenu.module-
|
|
22
|
+
import "../../contextMenu.module-vNQHb48g.js";
|
|
23
23
|
import { Modal as K } from "../Modal/Modal.js";
|
|
24
24
|
import "../../deleteModal.module-Ds3MDzdl.js";
|
|
25
25
|
import "../../disclaimer.module-BZydt-Q_.js";
|
|
@@ -1,90 +1,93 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Datepicker as
|
|
3
|
-
import { g as
|
|
4
|
-
import { useMemo as s, useState as
|
|
5
|
-
import { useFormContext as
|
|
1
|
+
import { jsx as o, jsxs as Y } from "react/jsx-runtime";
|
|
2
|
+
import { Datepicker as w, Divider as M, Padding as U, Button as b } from "@element/react-components";
|
|
3
|
+
import { g as j } from "../../../get-UxX31Aph.js";
|
|
4
|
+
import { useMemo as s, useState as H } from "react";
|
|
5
|
+
import { useFormContext as I, Controller as Q } from "react-hook-form";
|
|
6
6
|
import { s as l } from "../../../formDatePicker.module-BV3ma_7y.js";
|
|
7
|
-
const
|
|
7
|
+
const $ = (t) => {
|
|
8
|
+
const a = new Date(t), u = a.getUTCDate(), f = a.getUTCMonth(), d = a.getUTCFullYear();
|
|
9
|
+
return new Date(d, f, u);
|
|
10
|
+
}, G = ({
|
|
8
11
|
propertyName: t,
|
|
9
|
-
label:
|
|
10
|
-
closeLabel:
|
|
11
|
-
className:
|
|
12
|
-
minRangeYear:
|
|
13
|
-
maxRangeYear:
|
|
14
|
-
locale:
|
|
15
|
-
rules:
|
|
16
|
-
...
|
|
12
|
+
label: a,
|
|
13
|
+
closeLabel: u,
|
|
14
|
+
className: f,
|
|
15
|
+
minRangeYear: d,
|
|
16
|
+
maxRangeYear: g,
|
|
17
|
+
locale: h,
|
|
18
|
+
rules: i,
|
|
19
|
+
...k
|
|
17
20
|
}) => {
|
|
18
21
|
const {
|
|
19
|
-
control:
|
|
20
|
-
formState: { errors: r, isValidating:
|
|
21
|
-
} =
|
|
22
|
-
() =>
|
|
23
|
-
[
|
|
24
|
-
),
|
|
25
|
-
() =>
|
|
26
|
-
[
|
|
27
|
-
),
|
|
28
|
-
() => (/* @__PURE__ */ new Date()).getFullYear() - (
|
|
29
|
-
[
|
|
30
|
-
),
|
|
31
|
-
() => (/* @__PURE__ */ new Date()).getFullYear() + (
|
|
32
|
-
[
|
|
33
|
-
),
|
|
34
|
-
() => !
|
|
35
|
-
[r, t,
|
|
36
|
-
),
|
|
37
|
-
valid: !
|
|
38
|
-
helperTextPersistent:
|
|
22
|
+
control: p,
|
|
23
|
+
formState: { errors: r, isValidating: x }
|
|
24
|
+
} = I(), C = s(
|
|
25
|
+
() => i?.required?.value,
|
|
26
|
+
[i]
|
|
27
|
+
), S = s(
|
|
28
|
+
() => i?.required?.message,
|
|
29
|
+
[i]
|
|
30
|
+
), P = s(
|
|
31
|
+
() => (/* @__PURE__ */ new Date()).getFullYear() - (d ?? 95),
|
|
32
|
+
[d]
|
|
33
|
+
), T = s(
|
|
34
|
+
() => (/* @__PURE__ */ new Date()).getFullYear() + (g ?? 15),
|
|
35
|
+
[g]
|
|
36
|
+
), m = s(
|
|
37
|
+
() => !x && j(r, t) !== void 0,
|
|
38
|
+
[r, t, x]
|
|
39
|
+
), v = s(() => ({
|
|
40
|
+
valid: !m,
|
|
41
|
+
helperTextPersistent: m || C,
|
|
39
42
|
helperText: (() => {
|
|
40
43
|
if (r && r[t]) {
|
|
41
|
-
const
|
|
42
|
-
return
|
|
44
|
+
const n = r[t]?.message;
|
|
45
|
+
return n || "Invalid input";
|
|
43
46
|
}
|
|
44
|
-
return
|
|
47
|
+
return S;
|
|
45
48
|
})(),
|
|
46
|
-
className: `${l.fromPickerText} ${
|
|
47
|
-
}), [r,
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
|
|
49
|
+
className: `${l.fromPickerText} ${m ? l.invalid : ""}`
|
|
50
|
+
}), [r, S, t, C, m]), [F, D] = H(!1);
|
|
51
|
+
return /* @__PURE__ */ o(
|
|
52
|
+
Q,
|
|
50
53
|
{
|
|
51
54
|
name: t,
|
|
52
|
-
rules:
|
|
53
|
-
control:
|
|
54
|
-
render: ({ field: { ref:
|
|
55
|
-
|
|
55
|
+
rules: i,
|
|
56
|
+
control: p,
|
|
57
|
+
render: ({ field: { ref: q, onChange: n, value: c, ...O } }) => /* @__PURE__ */ o("div", { className: l.datePickerContainer, children: /* @__PURE__ */ o(
|
|
58
|
+
w,
|
|
56
59
|
{
|
|
57
|
-
...
|
|
60
|
+
...k,
|
|
58
61
|
...O,
|
|
59
|
-
className:
|
|
60
|
-
value:
|
|
62
|
+
className: f ?? "",
|
|
63
|
+
value: c,
|
|
61
64
|
variant: "outlined",
|
|
62
|
-
label:
|
|
63
|
-
format: (e) => e ? e.toLocaleDateString(
|
|
65
|
+
label: a,
|
|
66
|
+
format: (e) => e ? $(e.toISOString()).toLocaleDateString(h ?? "en") : "",
|
|
64
67
|
disableClearing: !0,
|
|
65
68
|
trailingContent: /* @__PURE__ */ Y("div", { className: l.trailingContent, children: [
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ o(M, {}),
|
|
70
|
+
/* @__PURE__ */ o(U, { variant: "dense", children: /* @__PURE__ */ o(b, { label: u, variant: "text", onClick: () => D(!1) }) })
|
|
68
71
|
] }),
|
|
69
72
|
onClick: () => {
|
|
70
|
-
|
|
73
|
+
D(!0);
|
|
71
74
|
},
|
|
72
75
|
onSelect: (e) => {
|
|
73
|
-
|
|
76
|
+
n(e), D(!1);
|
|
74
77
|
},
|
|
75
78
|
onSelectMonth: (e) => {
|
|
76
|
-
|
|
79
|
+
c && (e.setDate(c.getDate()), n(e));
|
|
77
80
|
},
|
|
78
81
|
onSelectYear: (e) => {
|
|
79
|
-
|
|
82
|
+
c && (e.setDate(c.getDate()), n(e));
|
|
80
83
|
},
|
|
81
84
|
hoisted: !0,
|
|
82
85
|
calendarProps: { hoisted: !0, className: l.datePickerCalendar },
|
|
83
|
-
minQuickSelectYear:
|
|
84
|
-
maxQuickSelectYear:
|
|
86
|
+
minQuickSelectYear: P,
|
|
87
|
+
maxQuickSelectYear: T,
|
|
85
88
|
readOnly: !0,
|
|
86
|
-
textfieldProps:
|
|
87
|
-
alwaysOpen:
|
|
89
|
+
textfieldProps: v,
|
|
90
|
+
alwaysOpen: F
|
|
88
91
|
}
|
|
89
92
|
) })
|
|
90
93
|
}
|
|
@@ -18,7 +18,7 @@ import "../../baseView.module-uWbm_a5f.js";
|
|
|
18
18
|
import "../../BlockView.module-BPlNT5uh.js";
|
|
19
19
|
import "../../chipCard.module-BjpKuf1b.js";
|
|
20
20
|
import "lodash";
|
|
21
|
-
import "../../contextMenu.module-
|
|
21
|
+
import "../../contextMenu.module-vNQHb48g.js";
|
|
22
22
|
import "../../modal.module-BlDp1Wiq.js";
|
|
23
23
|
import "../../deleteModal.module-Ds3MDzdl.js";
|
|
24
24
|
import "../../disclaimer.module-BZydt-Q_.js";
|
package/dist/main.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export { AvailableCustomIcons } from './enums/AvailableCustomIcons';
|
|
|
30
30
|
export { ThemeColor } from './enums/ThemeColor';
|
|
31
31
|
export { useBreakpoints } from './hooks/useBreakpoints';
|
|
32
32
|
export { capitalizeFirstLetters } from './services/UtilService';
|
|
33
|
+
export type { ActionProps } from './components/ContextMenu/ContextMenu';
|
|
33
34
|
export type { FormSelectOption } from './components/FormComponents/FormSelect/FormSelect';
|
|
34
35
|
export type { FormTextProps } from './components/FormComponents/FormText/FormText';
|
|
35
36
|
export type { FieldItem } from './components/InfoGroup/InfoGroup';
|
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.8611",
|
|
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>",
|