@hortiview/shared-components 0.0.10001 → 0.0.10012

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 +1 @@
1
- ._invalid_pywdu_1+*[class*=mdc-select-helper-text]{color:var(--lmnt-theme-danger)!important}._formSelectContainer_pywdu_6{display:flex;flex-wrap:wrap;width:100%}._formSelectContainer_pywdu_6 *[class*=mdc-select-helper-text]{color:var(--lmnt-helper-text-color)}._formSelectContainer_pywdu_6 *[class*=lmnt__multi-value__label]{overflow:visible}._formSelect_pywdu_6+*[class*=mdc-select-helper-text]{margin-bottom:-19.33px!important}._formSelect_pywdu_6 *[class*=lmnt-select-menu]{z-index:2001}._multiText_pywdu_32 *[class*=lmnt-select-value-container]{white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis;display:block!important;padding:1.125rem 0!important}._tooltip_pywdu_41{z-index:42}._disabled_pywdu_46+*[class*=mdc-select-helper-text]{color:var(--lmnt-theme-on-surface-disabled)}[id*=select-container][class*=top] [class*=mdc-menu-surface--open]{bottom:0}[id*=select-container][class*=bottom] [class*=mdc-menu-surface--open]{top:0}[class*=lmnt__menu-portal]{z-index:6!important}
1
+ ._invalidHelperText_11d5q_1+*[class*=mdc-select-helper-text]{color:var(--lmnt-theme-danger)!important}._invalidBorder_11d5q_5 *[class*=mdc-notched-outline]{border-color:var(--lmnt-theme-danger)!important}._invalidPlaceholder_11d5q_9 *[class*=lmnt-select-label]{color:var(--lmnt-theme-danger)!important}._invalidDropdownIcon_11d5q_13 *[class*=mdc-select__dropdown-icon]{fill:var(--lmnt-theme-danger)!important}._formSelectContainer_11d5q_18{display:flex;flex-wrap:wrap;width:100%}._formSelectContainer_11d5q_18 *[class*=mdc-select-helper-text]{color:var(--lmnt-helper-text-color)}._formSelectContainer_11d5q_18 *[class*=lmnt__multi-value__label]{overflow:visible}._formSelect_11d5q_18+*[class*=mdc-select-helper-text]{margin-bottom:-19.33px!important}._formSelect_11d5q_18 *[class*=lmnt-select-menu]{z-index:2001}._multiText_11d5q_44 *[class*=lmnt-select-value-container]{white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis;display:block!important;padding:1.125rem 0!important}._tooltip_11d5q_53{z-index:42}._disabled_11d5q_58+*[class*=mdc-select-helper-text]{color:var(--lmnt-theme-on-surface-disabled)}[id*=select-container][class*=top] [class*=mdc-menu-surface--open]{bottom:0}[id*=select-container][class*=bottom] [class*=mdc-menu-surface--open]{top:0}[class*=lmnt__menu-portal]{z-index:6!important}
@@ -32,7 +32,7 @@ import "../../loadingSpinner.module-CLtqSMWA.js";
32
32
  import "../Scrollbar/Scrollbar.js";
33
33
  import "react-hook-form";
34
34
  import "../../formDatePicker.module-BV3ma_7y.js";
35
- import "../../formSelect.module-nnJoBE6f.js";
35
+ import "../../formSelect.module-C6cK23EF.js";
36
36
  import "../../formText.module-C0by6_DK.js";
37
37
  import "../../isPlainObject-BlCDf1Kc.js";
38
38
  const kt = ({
@@ -1,122 +1,130 @@
1
- import { jsx as i, Fragment as F, jsxs as z } from "react/jsx-runtime";
2
- import { Select as G } from "@element/react-components";
3
- import { g as p } from "../../../get-BJn2Enx7.js";
4
- import { i as J } from "../../../isArray-thIeLpc5.js";
5
- import { useEffect as Q, useMemo as C } from "react";
6
- import { useFormContext as R, Controller as M } from "react-hook-form";
7
- import { H as U } from "../../../react-tooltip.min-BzHiZW8k.js";
8
- import { SelectTooltipText as W } from "./SelectTooltipText.js";
9
- import { s as o } from "../../../formSelect.module-nnJoBE6f.js";
10
- const te = ({
1
+ import { jsx as n, Fragment as E, jsxs as Q } from "react/jsx-runtime";
2
+ import { Select as R } from "@element/react-components";
3
+ import { g as v } from "../../../get-BJn2Enx7.js";
4
+ import { i as U } from "../../../isArray-thIeLpc5.js";
5
+ import { useEffect as W, useMemo as C } from "react";
6
+ import { useFormContext as X, Controller as M } from "react-hook-form";
7
+ import { H as Y } from "../../../react-tooltip.min-BzHiZW8k.js";
8
+ import { SelectTooltipText as Z } from "./SelectTooltipText.js";
9
+ import { s as r } from "../../../formSelect.module-C6cK23EF.js";
10
+ const ne = ({
11
11
  propertyName: t,
12
- label: x,
13
- options: a,
12
+ label: S,
13
+ options: o,
14
14
  multi: f = !1,
15
- disabled: q = !1,
16
- hoisted: S = !1,
17
- hidden: v = !1,
18
- valueKey: n = "value",
19
- textKey: H = "text",
15
+ disabled: $ = !1,
16
+ hoisted: g = !1,
17
+ hidden: w = !1,
18
+ valueKey: l = "value",
19
+ textKey: p = "text",
20
20
  clearable: j = !1,
21
- searchable: w = !0,
22
- noOptionsMessage: A = "",
23
- rules: l,
24
- menuPosition: s = "auto",
25
- ...d
21
+ searchable: A = !0,
22
+ noOptionsMessage: B = "",
23
+ rules: a,
24
+ menuPosition: d = "auto",
25
+ ...s
26
26
  }) => {
27
27
  const {
28
28
  control: I,
29
- formState: { errors: c, isValidating: $ }
30
- } = R(), m = CSS.escape(t) + "-select-container", b = '[id="' + CSS.escape(m) + '"]';
31
- Q(() => {
32
- if (!(!S || s === "auto") && !document.getElementById(m)) {
33
- const r = document.createElement("div");
34
- r.id = m, r.classList.add(s), document.body.appendChild(r);
29
+ getFieldState: D,
30
+ formState: { errors: c, isValidating: H }
31
+ } = X(), m = CSS.escape(t) + "-select-container", b = '[id="' + CSS.escape(m) + '"]';
32
+ W(() => {
33
+ if (!(!g || d === "auto") && !document.getElementById(m)) {
34
+ const i = document.createElement("div");
35
+ i.id = m, i.classList.add(d), document.body.appendChild(i);
35
36
  }
36
- }, [S, s, m]);
37
- const g = C(
38
- () => !$ && p(c, t) !== void 0,
39
- [c, t, $]
40
- ), B = C(
41
- () => l?.required?.value,
42
- [l]
43
- ), D = C(
44
- () => l?.required?.message,
45
- [l]
46
- ), L = () => {
37
+ }, [g, d, m]);
38
+ const q = C(
39
+ () => !H && v(c, t) !== void 0,
40
+ [c, t, H]
41
+ ), L = C(
42
+ () => a?.required?.value,
43
+ [a]
44
+ ), O = C(
45
+ () => a?.required?.message,
46
+ [a]
47
+ ), V = () => {
47
48
  if (c && c[t]) {
48
- const r = c[t]?.message;
49
- return r || "Invalid input";
49
+ const i = c[t]?.message;
50
+ return i || "Invalid input";
50
51
  }
51
- return D;
52
+ return O;
52
53
  };
53
- return v ? /* @__PURE__ */ i(M, { name: t, control: I, render: () => /* @__PURE__ */ i(F, {}) }) : /* @__PURE__ */ i(
54
+ return w ? /* @__PURE__ */ n(M, { name: t, control: I, render: () => /* @__PURE__ */ n(E, {}) }) : /* @__PURE__ */ n(
54
55
  "div",
55
56
  {
56
57
  "data-testid": "form-select-container",
57
- className: o.formSelectContainer,
58
- "data-tooltip-id": x,
59
- children: /* @__PURE__ */ i(
58
+ className: r.formSelectContainer,
59
+ "data-tooltip-id": S,
60
+ children: /* @__PURE__ */ n(
60
61
  M,
61
62
  {
62
63
  name: t,
63
- rules: l,
64
+ rules: a,
64
65
  control: I,
65
- render: ({ field: { ref: r, onChange: h, value: E, ...O } }) => {
66
- let T = a;
67
- J(a) && p(a[0], "options") !== void 0 && (T = a.flatMap((e) => p(e, "options") ?? []));
66
+ render: ({ field: { ref: i, onChange: h, value: F, ...k } }) => {
67
+ let T = o;
68
+ U(o) && v(o[0], "options") !== void 0 && (T = o.flatMap((e) => v(e, "options") ?? []));
68
69
  const u = f ? T?.filter(
69
- (e) => E?.includes(e[n])
70
- ) : T?.find((e) => e[n] === E), V = f && d.multiDisplayType === "text" && d.fixedHeightInput;
71
- return /* @__PURE__ */ z(F, { children: [
72
- /* @__PURE__ */ i(
73
- G,
70
+ (e) => F?.includes(e[l])
71
+ ) : T?.find((e) => e[l] === F), z = f && s.multiDisplayType === "text" && s.fixedHeightInput, x = D(t).invalid, G = `
72
+ ${r.formSelect}
73
+ ${x ? r.invalidHelperText : ""}
74
+ ${x ? r.invalidDropdownIcon : ""}
75
+ ${x ? r.invalidBorder : ""}
76
+ ${x ? r.invalidPlaceholder : ""}
77
+ ${z ? r.multiText : ""}
78
+ ${$ ? r.disabled : ""}`;
79
+ return /* @__PURE__ */ Q(E, { children: [
80
+ /* @__PURE__ */ n(
81
+ R,
74
82
  {
75
- ...O,
76
- ...d,
83
+ ...k,
84
+ ...s,
77
85
  value: u ?? [],
78
- label: x,
86
+ label: S,
79
87
  variant: "outlined",
80
- helperText: L(),
81
- helperTextPersistent: B || g,
82
- options: a,
83
- valid: !g,
88
+ helperText: V(),
89
+ helperTextPersistent: L || q,
90
+ options: o,
91
+ valid: !q,
84
92
  "data-testid": `select-${t}`,
85
93
  multiSelect: f,
86
- className: `${o.formSelect} ${g ? o.invalid : ""} ${V ? o.multiText : ""} ${q ? o.disabled : ""}`,
87
- disabled: q,
88
- valueKey: n,
89
- textKey: H,
94
+ className: G,
95
+ disabled: $,
96
+ valueKey: l,
97
+ textKey: p,
90
98
  onChange: (e) => {
91
99
  if (e == null) {
92
100
  h(e);
93
101
  return;
94
102
  }
95
103
  if (f) {
96
- h(e.map((k) => k[n]));
104
+ h(e.map((J) => J[l]));
97
105
  return;
98
106
  }
99
- h(e[n]), d?.onChange?.(e);
107
+ h(e[l]), s?.onChange?.(e);
100
108
  },
101
- hoisted: S,
102
- noOptionsMessage: A,
103
- searchable: w,
109
+ hoisted: g,
110
+ noOptionsMessage: B,
111
+ searchable: A,
104
112
  clearable: j,
105
113
  menuMaxHeight: "15rem",
106
- menuPosition: s,
107
- portalContainer: s !== "auto" && b
114
+ menuPosition: d,
115
+ portalContainer: d !== "auto" && b
108
116
  }
109
117
  ),
110
- /* @__PURE__ */ i(
111
- U,
118
+ /* @__PURE__ */ n(
119
+ Y,
112
120
  {
113
- id: x,
121
+ id: S,
114
122
  noArrow: !0,
115
123
  place: "bottom",
116
124
  delayShow: 420,
117
- className: o.tooltip,
118
- hidden: !u || u.length === 0 || !d.fixedHeightInput,
119
- children: /* @__PURE__ */ i(W, { value: u, textKey: H, valueKey: n })
125
+ className: r.tooltip,
126
+ hidden: !u || u.length === 0 || !s.fixedHeightInput,
127
+ children: /* @__PURE__ */ n(Z, { value: u, textKey: p, valueKey: l })
120
128
  }
121
129
  )
122
130
  ] });
@@ -127,5 +135,5 @@ const te = ({
127
135
  );
128
136
  };
129
137
  export {
130
- te as FormSelect
138
+ ne as FormSelect
131
139
  };
@@ -30,7 +30,7 @@ import "../../loadingSpinner.module-CLtqSMWA.js";
30
30
  import "../Scrollbar/Scrollbar.js";
31
31
  import "react-hook-form";
32
32
  import "../../formDatePicker.module-BV3ma_7y.js";
33
- import "../../formSelect.module-nnJoBE6f.js";
33
+ import "../../formSelect.module-C6cK23EF.js";
34
34
  import "../../formText.module-C0by6_DK.js";
35
35
  import "../../isPlainObject-BlCDf1Kc.js";
36
36
  import { useGenerateColumns as x, useGenerateTableData as _ } from "./GenericTableService.js";
@@ -0,0 +1,15 @@
1
+ import "./assets/formSelect.css";
2
+ const o = "_invalidHelperText_11d5q_1", e = "_invalidBorder_11d5q_5", i = "_invalidPlaceholder_11d5q_9", l = "_invalidDropdownIcon_11d5q_13", t = "_formSelectContainer_11d5q_18", d = "_formSelect_11d5q_18", n = "_multiText_11d5q_44", _ = "_tooltip_11d5q_53", r = "_disabled_11d5q_58", c = {
3
+ invalidHelperText: o,
4
+ invalidBorder: e,
5
+ invalidPlaceholder: i,
6
+ invalidDropdownIcon: l,
7
+ formSelectContainer: t,
8
+ formSelect: d,
9
+ multiText: n,
10
+ tooltip: _,
11
+ disabled: r
12
+ };
13
+ export {
14
+ c as s
15
+ };
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.10001",
4
+ "version": "0.0.10012",
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>",
@@ -1,12 +0,0 @@
1
- import "./assets/formSelect.css";
2
- const t = "_invalid_pywdu_1", o = "_formSelectContainer_pywdu_6", e = "_formSelect_pywdu_6", i = "_multiText_pywdu_32", l = "_tooltip_pywdu_41", _ = "_disabled_pywdu_46", d = {
3
- invalid: t,
4
- formSelectContainer: o,
5
- formSelect: e,
6
- multiText: i,
7
- tooltip: l,
8
- disabled: _
9
- };
10
- export {
11
- d as s
12
- };