@hortiview/shared-components 0.0.7018 → 0.0.7067
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,8 +1,8 @@
|
|
|
1
1
|
import "../../assets/Filter.css";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { Modal as j, Button as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { u as
|
|
2
|
+
import { jsxs as v, Fragment as I, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { Modal as j, Button as s, Group as q, Select as A, IconButton as D, NotificationBadge as C } from "@element/react-components";
|
|
4
|
+
import { useState as u } from "react";
|
|
5
|
+
import { u as _ } from "../../useBreakpoint-BNeVhjjZ.js";
|
|
6
6
|
import "../../alertBanner.module-HneYdVzN.js";
|
|
7
7
|
import "../../iconify.module-C89oaw5b.js";
|
|
8
8
|
import "../../isArray-Ca4KR8TK.js";
|
|
@@ -30,55 +30,55 @@ import "react-hook-form";
|
|
|
30
30
|
import "../../formDatePicker.module-BV3ma_7y.js";
|
|
31
31
|
import "../../formSelect.module-C18N-SsT.js";
|
|
32
32
|
import "../../formText.module-Blt6Y-SR.js";
|
|
33
|
-
const
|
|
34
|
-
filterButton:
|
|
35
|
-
filterBadge:
|
|
33
|
+
const K = "_filterButton_66wbq_1", M = "_filterBadge_66wbq_6", f = {
|
|
34
|
+
filterButton: K,
|
|
35
|
+
filterBadge: M
|
|
36
36
|
}, gt = ({
|
|
37
|
-
clearFilterText:
|
|
38
|
-
closeCallback:
|
|
37
|
+
clearFilterText: a,
|
|
38
|
+
closeCallback: m,
|
|
39
39
|
currentFilter: i,
|
|
40
40
|
filterButtonAsIcon: r = !1,
|
|
41
41
|
filterButtonText: l,
|
|
42
|
-
filterModalTitle:
|
|
43
|
-
filters:
|
|
44
|
-
modalCancelButtonText:
|
|
45
|
-
modalConfirmButtonText:
|
|
42
|
+
filterModalTitle: F,
|
|
43
|
+
filters: x,
|
|
44
|
+
modalCancelButtonText: y,
|
|
45
|
+
modalConfirmButtonText: b
|
|
46
46
|
}) => {
|
|
47
|
-
const { isDesktop:
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const { isDesktop: S } = _(), [k, c] = u(!1), [n, h] = u(i), [O, g] = u(0), B = () => {
|
|
48
|
+
c(!1), m(n), g(
|
|
49
|
+
n.reduce((e, { selectedOptions: o }) => e + o.length, 0)
|
|
50
50
|
);
|
|
51
|
-
},
|
|
51
|
+
}, w = () => {
|
|
52
52
|
h([]), g(0);
|
|
53
|
-
},
|
|
53
|
+
}, N = (e) => {
|
|
54
54
|
const o = [
|
|
55
|
-
...
|
|
55
|
+
...n.filter((d) => d.id !== e.id),
|
|
56
56
|
e
|
|
57
57
|
];
|
|
58
58
|
h(o);
|
|
59
59
|
};
|
|
60
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ v(I, { children: [
|
|
61
61
|
/* @__PURE__ */ t(
|
|
62
|
-
|
|
62
|
+
z,
|
|
63
63
|
{
|
|
64
64
|
filterButtonText: l,
|
|
65
65
|
filterButtonAsIcon: r,
|
|
66
|
-
count:
|
|
67
|
-
onClick: () =>
|
|
66
|
+
count: O,
|
|
67
|
+
onClick: () => c(!0)
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
70
|
/* @__PURE__ */ t(
|
|
71
71
|
j,
|
|
72
72
|
{
|
|
73
|
-
open:
|
|
74
|
-
onClose:
|
|
75
|
-
title:
|
|
76
|
-
modalSize:
|
|
77
|
-
headerActions: /* @__PURE__ */ t(
|
|
78
|
-
dismissiveButton: /* @__PURE__ */ t(
|
|
79
|
-
primaryButton: /* @__PURE__ */ t(
|
|
80
|
-
children: /* @__PURE__ */ t(
|
|
81
|
-
|
|
73
|
+
open: k,
|
|
74
|
+
onClose: B,
|
|
75
|
+
title: F,
|
|
76
|
+
modalSize: S ? "small" : "fullscreen",
|
|
77
|
+
headerActions: /* @__PURE__ */ t(s, { variant: "text", onClick: w, children: a }),
|
|
78
|
+
dismissiveButton: /* @__PURE__ */ t(s, { variant: "outlined", onClick: () => c(!1), children: y }),
|
|
79
|
+
primaryButton: /* @__PURE__ */ t(s, { variant: "filled", onClick: B, children: b }),
|
|
80
|
+
children: /* @__PURE__ */ t(q, { direction: "vertical", children: x.map(({ id: e, title: o, availableOptions: d }) => /* @__PURE__ */ t(
|
|
81
|
+
A,
|
|
82
82
|
{
|
|
83
83
|
variant: "outlined",
|
|
84
84
|
options: d,
|
|
@@ -86,8 +86,8 @@ const M = "_filterButton_btr13_1", z = "_filterBadge_btr13_6", u = {
|
|
|
86
86
|
multiSelect: !0,
|
|
87
87
|
textKey: "text",
|
|
88
88
|
valueKey: "id",
|
|
89
|
-
value:
|
|
90
|
-
onChange: (p) =>
|
|
89
|
+
value: n.find((p) => p.id === e)?.selectedOptions ?? [],
|
|
90
|
+
onChange: (p) => N({ id: e, selectedOptions: p }),
|
|
91
91
|
hoisted: !0,
|
|
92
92
|
menuMaxHeight: "300px",
|
|
93
93
|
disabled: e === "location",
|
|
@@ -98,46 +98,46 @@ const M = "_filterButton_btr13_1", z = "_filterBadge_btr13_6", u = {
|
|
|
98
98
|
}
|
|
99
99
|
)
|
|
100
100
|
] });
|
|
101
|
-
},
|
|
102
|
-
filterButtonText:
|
|
103
|
-
filterButtonAsIcon:
|
|
101
|
+
}, z = ({
|
|
102
|
+
filterButtonText: a,
|
|
103
|
+
filterButtonAsIcon: m,
|
|
104
104
|
count: i,
|
|
105
105
|
onClick: r
|
|
106
106
|
}) => {
|
|
107
|
-
const { isDesktop: l } =
|
|
108
|
-
return
|
|
109
|
-
|
|
107
|
+
const { isDesktop: l } = _();
|
|
108
|
+
return m ? /* @__PURE__ */ t(
|
|
109
|
+
D,
|
|
110
110
|
{
|
|
111
111
|
icon: "filter_list_alt",
|
|
112
112
|
onClick: r,
|
|
113
113
|
badge: i !== 0 && /* @__PURE__ */ t(
|
|
114
|
-
|
|
114
|
+
C,
|
|
115
115
|
{
|
|
116
116
|
counter: i,
|
|
117
|
-
className:
|
|
117
|
+
className: f.filterBadge,
|
|
118
118
|
themeColor: "secondary",
|
|
119
119
|
"data-testid": "filter-badge"
|
|
120
120
|
}
|
|
121
121
|
)
|
|
122
122
|
}
|
|
123
|
-
) : /* @__PURE__ */
|
|
123
|
+
) : /* @__PURE__ */ v("div", { style: { height: "100%", width: l ? void 0 : "100%" }, children: [
|
|
124
124
|
/* @__PURE__ */ t(
|
|
125
|
-
|
|
125
|
+
s,
|
|
126
126
|
{
|
|
127
127
|
variant: "outlined",
|
|
128
128
|
themeColor: "primary",
|
|
129
129
|
leadingIcon: "filter_list_alt",
|
|
130
130
|
onClick: r,
|
|
131
|
-
className:
|
|
131
|
+
className: f.filterButton,
|
|
132
132
|
fullWidth: !l,
|
|
133
|
-
children:
|
|
133
|
+
children: a
|
|
134
134
|
}
|
|
135
135
|
),
|
|
136
136
|
i !== 0 && /* @__PURE__ */ t(
|
|
137
|
-
|
|
137
|
+
C,
|
|
138
138
|
{
|
|
139
139
|
counter: i,
|
|
140
|
-
className:
|
|
140
|
+
className: f.filterBadge,
|
|
141
141
|
themeColor: "secondary",
|
|
142
142
|
"data-testid": "filter-badge"
|
|
143
143
|
}
|
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.7067",
|
|
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>",
|