@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 C, Fragment as I, jsx as t } from "react/jsx-runtime";
3
- import { Modal as j, Button as a, Group as A, Select as D, IconButton as K, NotificationBadge as B } from "@element/react-components";
4
- import { useState as f } from "react";
5
- import { u as v } from "../../useBreakpoint-BNeVhjjZ.js";
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 M = "_filterButton_btr13_1", z = "_filterBadge_btr13_6", u = {
34
- filterButton: M,
35
- filterBadge: z
33
+ const K = "_filterButton_66wbq_1", M = "_filterBadge_66wbq_6", f = {
34
+ filterButton: K,
35
+ filterBadge: M
36
36
  }, gt = ({
37
- clearFilterText: m,
38
- closeCallback: c,
37
+ clearFilterText: a,
38
+ closeCallback: m,
39
39
  currentFilter: i,
40
40
  filterButtonAsIcon: r = !1,
41
41
  filterButtonText: l,
42
- filterModalTitle: _,
43
- filters: F,
44
- modalCancelButtonText: x,
45
- modalConfirmButtonText: y
42
+ filterModalTitle: F,
43
+ filters: x,
44
+ modalCancelButtonText: y,
45
+ modalConfirmButtonText: b
46
46
  }) => {
47
- const { isDesktop: b } = v(), [S, n] = f(!1), [s, h] = f(i), [k, g] = f(0), O = () => {
48
- n(!1), c(s), g(
49
- s.reduce((e, { selectedOptions: o }) => e + o.length, 0)
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
- }, N = () => {
51
+ }, w = () => {
52
52
  h([]), g(0);
53
- }, w = (e) => {
53
+ }, N = (e) => {
54
54
  const o = [
55
- ...s.filter((d) => d.id !== e.id),
55
+ ...n.filter((d) => d.id !== e.id),
56
56
  e
57
57
  ];
58
58
  h(o);
59
59
  };
60
- return /* @__PURE__ */ C(I, { children: [
60
+ return /* @__PURE__ */ v(I, { children: [
61
61
  /* @__PURE__ */ t(
62
- G,
62
+ z,
63
63
  {
64
64
  filterButtonText: l,
65
65
  filterButtonAsIcon: r,
66
- count: k,
67
- onClick: () => n(!0)
66
+ count: O,
67
+ onClick: () => c(!0)
68
68
  }
69
69
  ),
70
70
  /* @__PURE__ */ t(
71
71
  j,
72
72
  {
73
- open: S,
74
- onClose: () => n(!1),
75
- title: _,
76
- modalSize: b ? "small" : "fullscreen",
77
- headerActions: /* @__PURE__ */ t(a, { variant: "text", onClick: N, children: m }),
78
- dismissiveButton: /* @__PURE__ */ t(a, { variant: "outlined", onClick: () => n(!1), children: x }),
79
- primaryButton: /* @__PURE__ */ t(a, { variant: "filled", onClick: O, children: y }),
80
- children: /* @__PURE__ */ t(A, { direction: "vertical", children: F.map(({ id: e, title: o, availableOptions: d }) => /* @__PURE__ */ t(
81
- D,
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: s.find((p) => p.id === e)?.selectedOptions ?? [],
90
- onChange: (p) => w({ id: e, selectedOptions: 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
- }, G = ({
102
- filterButtonText: m,
103
- filterButtonAsIcon: c,
101
+ }, z = ({
102
+ filterButtonText: a,
103
+ filterButtonAsIcon: m,
104
104
  count: i,
105
105
  onClick: r
106
106
  }) => {
107
- const { isDesktop: l } = v();
108
- return c ? /* @__PURE__ */ t(
109
- K,
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
- B,
114
+ C,
115
115
  {
116
116
  counter: i,
117
- className: u.filterBadge,
117
+ className: f.filterBadge,
118
118
  themeColor: "secondary",
119
119
  "data-testid": "filter-badge"
120
120
  }
121
121
  )
122
122
  }
123
- ) : /* @__PURE__ */ C("div", { style: { height: "100%", width: l ? void 0 : "100%" }, children: [
123
+ ) : /* @__PURE__ */ v("div", { style: { height: "100%", width: l ? void 0 : "100%" }, children: [
124
124
  /* @__PURE__ */ t(
125
- a,
125
+ s,
126
126
  {
127
127
  variant: "outlined",
128
128
  themeColor: "primary",
129
129
  leadingIcon: "filter_list_alt",
130
130
  onClick: r,
131
- className: u.filterButton,
131
+ className: f.filterButton,
132
132
  fullWidth: !l,
133
- children: m
133
+ children: a
134
134
  }
135
135
  ),
136
136
  i !== 0 && /* @__PURE__ */ t(
137
- B,
137
+ C,
138
138
  {
139
139
  counter: i,
140
- className: u.filterBadge,
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.7018",
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>",