@hortiview/shared-components 0.0.5551 → 0.0.5635
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/ListAreaService-zxVNvD59.js +80 -0
- package/dist/assets/ListAreaService.css +1 -1
- package/dist/components/DeleteModal/DeleteModal.d.ts +3 -3
- package/dist/components/DeleteModal/DeleteModal.js +4 -4
- package/dist/components/FormComponents/FormText/FormText.d.ts +1 -2
- package/dist/components/HashTabView/HashTabView.js +26 -26
- package/dist/components/ListArea/ListArea.js +21 -21
- package/dist/components/ListArea/ListArea.test.js +1 -1
- package/dist/components/ListArea/ListAreaService.d.ts +5 -6
- package/dist/components/ListArea/ListAreaService.js +1 -1
- package/dist/main.d.ts +3 -2
- package/dist/types/ListElement.d.ts +1 -5
- package/package.json +2 -2
- package/dist/ListAreaService-DhlEJxAH.js +0 -74
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import "./assets/ListAreaService.css";
|
|
2
|
+
import { jsx as s, jsxs as B } from "react/jsx-runtime";
|
|
3
|
+
import { TypoButton as b, Group as k, TypoSubtitle as C, TypoBody as L, Icon as N } from "@element/react-components";
|
|
4
|
+
import { Iconify as O } from "./components/Iconify/Iconify.js";
|
|
5
|
+
import { AvailableCustomIcons as E } from "./enums/AvailableCustomIcons.js";
|
|
6
|
+
const $ = "_fullWidth_1ja2q_1", W = "_mainElevation_1ja2q_5", G = "_searchbar_1ja2q_11", S = "_roundedBottom_1ja2q_19", w = "_primaryText_1ja2q_24", A = "_noOverlineText_1ja2q_28", P = "_list_1ja2q_32", z = "_listItem_1ja2q_60", D = "_trailingIcon_1ja2q_64", F = "_groupedListItem_1ja2q_76", v = {
|
|
7
|
+
fullWidth: $,
|
|
8
|
+
mainElevation: W,
|
|
9
|
+
searchbar: G,
|
|
10
|
+
roundedBottom: S,
|
|
11
|
+
primaryText: w,
|
|
12
|
+
noOverlineText: A,
|
|
13
|
+
list: P,
|
|
14
|
+
listItem: z,
|
|
15
|
+
trailingIcon: D,
|
|
16
|
+
groupedListItem: F
|
|
17
|
+
}, V = (e, n, r, a) => {
|
|
18
|
+
const o = e.reduce((i, l) => {
|
|
19
|
+
const { groupName: t, ...c } = l;
|
|
20
|
+
return !t || typeof t != "string" || (i[t] || (i[t] = {
|
|
21
|
+
groupName: /* @__PURE__ */ s(b, { children: t }),
|
|
22
|
+
id: t,
|
|
23
|
+
items: []
|
|
24
|
+
}), i[t].items = [
|
|
25
|
+
...i[t].items,
|
|
26
|
+
y(c, n, r, a)
|
|
27
|
+
]), i;
|
|
28
|
+
}, {});
|
|
29
|
+
return Object.values(o);
|
|
30
|
+
}, X = (e, n, r, a) => e.map((o) => y(o, n, r, a)), y = (e, n, r, a) => {
|
|
31
|
+
const {
|
|
32
|
+
id: o,
|
|
33
|
+
title: i,
|
|
34
|
+
subTitle: l,
|
|
35
|
+
route: t,
|
|
36
|
+
value: c,
|
|
37
|
+
noNavigation: p,
|
|
38
|
+
disabled: m,
|
|
39
|
+
icon: I,
|
|
40
|
+
iconType: _,
|
|
41
|
+
trailingIcon: T,
|
|
42
|
+
trailingIconType: f,
|
|
43
|
+
actionButton: j,
|
|
44
|
+
onClick: x,
|
|
45
|
+
customTitle: u,
|
|
46
|
+
listItemClassName: h,
|
|
47
|
+
overlineTitle: g
|
|
48
|
+
} = e, d = n === t;
|
|
49
|
+
return {
|
|
50
|
+
id: o,
|
|
51
|
+
key: o,
|
|
52
|
+
select: d,
|
|
53
|
+
primaryText: o,
|
|
54
|
+
secondaryText: /* @__PURE__ */ B(k, { direction: "vertical", gap: "none", children: [
|
|
55
|
+
u ?? /* @__PURE__ */ s(C, { level: 1, bold: d, children: i }),
|
|
56
|
+
l && !u ? /* @__PURE__ */ s(L, { level: 2, themeColor: d ? "primary" : void 0, children: l }) : void 0
|
|
57
|
+
] }),
|
|
58
|
+
overlineText: g,
|
|
59
|
+
trailingBlock: j ?? T ?? /* @__PURE__ */ s(N, { icon: "arrow_right" }),
|
|
60
|
+
leadingBlock: H(I),
|
|
61
|
+
value: c,
|
|
62
|
+
componentProps: {
|
|
63
|
+
id: o,
|
|
64
|
+
key: o,
|
|
65
|
+
leadingBlockType: _ ?? "icon",
|
|
66
|
+
trailingBlockType: f ?? "icon",
|
|
67
|
+
className: `${_ === "avatar" ? "" : v.listItem} ${r} ${h ?? ""} ${g ? "" : v.noOverlineText}`,
|
|
68
|
+
onClick: (J, q) => x?.(q),
|
|
69
|
+
tag: m || p ? void 0 : a ?? "a",
|
|
70
|
+
to: m || p ? void 0 : t,
|
|
71
|
+
disabled: m
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}, H = (e) => typeof e == "string" && e in E ? /* @__PURE__ */ s(O, { icon: e }) : e;
|
|
75
|
+
export {
|
|
76
|
+
X as a,
|
|
77
|
+
V as g,
|
|
78
|
+
y as m,
|
|
79
|
+
v as s
|
|
80
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._fullWidth_1ja2q_1{width:100%}._mainElevation_1ja2q_5{background:var(--lmnt-theme-background);border-radius:.5rem;width:100%}._searchbar_1ja2q_11 div{border:none}._searchbar_1ja2q_11 button{margin-right:.5rem}._roundedBottom_1ja2q_19{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}._primaryText_1ja2q_24 [class*=mdc-list-item__primary-text]{display:none!important}._noOverlineText_1ja2q_28 [class*=mdc-list-item__content]{margin-top:-.625rem}._list_1ja2q_32{padding-top:0;padding-bottom:0;overflow-y:auto}._list_1ja2q_32 [class*=mdc-list-item__overline-text]{margin-bottom:-2.25rem}._list_1ja2q_32::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 .25rem rgba(0,0,0,.2);border-radius:.5rem;margin-right:.25rem;background-color:var(--lmnt-theme-background)}._list_1ja2q_32::-webkit-scrollbar{width:.5rem;background-color:var(--lmnt-theme-background)}._list_1ja2q_32::-webkit-scrollbar-thumb{border-radius:.5rem;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:var(--lmnt-theme-primary-on-surface)}._listItem_1ja2q_60{border-bottom:.0775rem solid var(--lmnt-utility-gray-surface)}._listItem_1ja2q_60 i:not(._trailingIcon_1ja2q_64){color:var(--lmnt-theme-on-surface-inactive)}._listItem_1ja2q_60 i._trailingIcon_1ja2q_64{color:var(--lmnt-theme-on-surface-disabled)}._listItem_1ja2q_60 [class^=mdc-list-item__start]{margin:0 1rem!important;align-self:center!important}._groupedListItem_1ja2q_76{height:4.5rem!important}
|
|
@@ -15,11 +15,11 @@ type DeleteModalProps = {
|
|
|
15
15
|
/**
|
|
16
16
|
* The header text of the delete modal.
|
|
17
17
|
*/
|
|
18
|
-
deleteHeader: string;
|
|
18
|
+
deleteHeader: string | JSX.Element;
|
|
19
19
|
/**
|
|
20
20
|
* The body text of the delete modal. Each entry will be displayed as a bullet point.
|
|
21
21
|
*/
|
|
22
|
-
deleteBody?: string[];
|
|
22
|
+
deleteBody?: (string | JSX.Element)[];
|
|
23
23
|
/**
|
|
24
24
|
* A text or JSX element to display in the delete modal. If provided the deleteBody will be ignored.
|
|
25
25
|
*/
|
|
@@ -27,7 +27,7 @@ type DeleteModalProps = {
|
|
|
27
27
|
/**
|
|
28
28
|
* The header to display in the modal if the {@link isDeletePossible} is false.
|
|
29
29
|
*/
|
|
30
|
-
impossibleDeleteHeader: string;
|
|
30
|
+
impossibleDeleteHeader: string | JSX.Element;
|
|
31
31
|
/**
|
|
32
32
|
* The icon to display in the modal.
|
|
33
33
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../../assets/DeleteModal.css";
|
|
2
2
|
import { jsx as o, jsxs as m, Fragment as d } from "react/jsx-runtime";
|
|
3
3
|
import { Modal as D, Button as u, Group as i, Icon as j, TypoBody as n } from "@element/react-components";
|
|
4
|
-
import {
|
|
5
|
-
import { uniqueId as x } from "lodash";
|
|
4
|
+
import { uniqueId as q } from "lodash";
|
|
6
5
|
import { AvailableCustomIcons as g } from "../../enums/AvailableCustomIcons.js";
|
|
6
|
+
import { Iconify as x } from "../Iconify/Iconify.js";
|
|
7
7
|
const I = "_bulletPoint_469qk_1", N = "_modal_469qk_6", S = "_colorDanger_469qk_10", e = {
|
|
8
8
|
bulletPoint: I,
|
|
9
9
|
modal: N,
|
|
@@ -45,7 +45,7 @@ const I = "_bulletPoint_469qk_1", N = "_modal_469qk_6", S = "_colorDanger_469qk_
|
|
|
45
45
|
dismissiveButton: /* @__PURE__ */ o(u, { variant: "text", label: v, onClick: () => c(!1) }),
|
|
46
46
|
children: /* @__PURE__ */ m(i, { direction: "vertical", secondaryAlign: "center", children: [
|
|
47
47
|
l && Object.values(g).includes(l) && /* @__PURE__ */ o(
|
|
48
|
-
|
|
48
|
+
x,
|
|
49
49
|
{
|
|
50
50
|
icon: l,
|
|
51
51
|
iconSize: "xlarge",
|
|
@@ -65,7 +65,7 @@ const I = "_bulletPoint_469qk_1", N = "_modal_469qk_6", S = "_colorDanger_469qk_
|
|
|
65
65
|
themeColor: "text-secondary-on-background",
|
|
66
66
|
children: a
|
|
67
67
|
},
|
|
68
|
-
|
|
68
|
+
q(_.toString())
|
|
69
69
|
)) })
|
|
70
70
|
] }) : /* @__PURE__ */ o(n, { level: 1, themeColor: "text-primary-on-background", children: f }) })
|
|
71
71
|
] })
|
|
@@ -3,7 +3,7 @@ import { FieldPath, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
|
3
3
|
/**
|
|
4
4
|
* a generic FormText property type. the generic T represents the interface, which is used in the form, like {@link CreateOrganizationDto}
|
|
5
5
|
*/
|
|
6
|
-
type FormTextProps<T extends FieldValues> = {
|
|
6
|
+
export type FormTextProps<T extends FieldValues> = {
|
|
7
7
|
/** the path to the property, like Address.AddressLine1 */
|
|
8
8
|
propertyName: Path<T>;
|
|
9
9
|
/** the label of the Textbox */
|
|
@@ -59,4 +59,3 @@ type FormTextProps<T extends FieldValues> = {
|
|
|
59
59
|
* @returns a JSX element that renders a textfield form input
|
|
60
60
|
*/
|
|
61
61
|
export declare const FormText: <T extends FieldValues>(props: FormTextProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
-
export {};
|
|
@@ -1,77 +1,77 @@
|
|
|
1
1
|
import "../../assets/HashTabView.css";
|
|
2
|
-
import { jsx as a, jsxs as
|
|
3
|
-
import { Elevation as T, Group as
|
|
2
|
+
import { jsx as a, jsxs as d, Fragment as w } from "react/jsx-runtime";
|
|
3
|
+
import { Elevation as T, Group as i, TabBar as C, Tab as k, Padding as A } from "@element/react-components";
|
|
4
4
|
import { useState as I, useEffect as L } from "react";
|
|
5
5
|
import { a as N } from "../../useBreakpoint-DROHPVxO.js";
|
|
6
|
-
const x = "_elevation_1rcw6_1", y = "_themeBackground_1rcw6_6", W = "_tabBar_1rcw6_10",
|
|
6
|
+
const x = "_elevation_1rcw6_1", y = "_themeBackground_1rcw6_6", W = "_tabBar_1rcw6_10", $ = "_tabWrapper_1rcw6_16", j = "_tabButton_1rcw6_20", E = "_childContainer_1rcw6_24", z = "_childContainerLg_1rcw6_28", t = {
|
|
7
7
|
elevation: x,
|
|
8
8
|
themeBackground: y,
|
|
9
9
|
tabBar: W,
|
|
10
|
-
tabWrapper:
|
|
11
|
-
tabButton:
|
|
12
|
-
childContainer:
|
|
10
|
+
tabWrapper: $,
|
|
11
|
+
tabButton: j,
|
|
12
|
+
childContainer: E,
|
|
13
13
|
childContainerLg: z
|
|
14
14
|
}, p = (n, r) => !r || !n ? 0 : n.findIndex((c) => c.hash === r.replace("#", "")) ?? 0, q = ({
|
|
15
15
|
tabs: n,
|
|
16
16
|
hasHash: r = !0,
|
|
17
17
|
hash: c = "",
|
|
18
|
-
clusterAlign:
|
|
19
|
-
hasClusteredTabs:
|
|
20
|
-
children:
|
|
18
|
+
clusterAlign: _ = "start",
|
|
19
|
+
hasClusteredTabs: u,
|
|
20
|
+
children: s,
|
|
21
21
|
verticalGap: g = "none",
|
|
22
22
|
elevation: B = 0,
|
|
23
23
|
backgroundColor: v = "themeBackground",
|
|
24
24
|
onChange: b
|
|
25
25
|
}) => {
|
|
26
|
-
const [
|
|
26
|
+
const [h, m] = I(p(n, c)), { isLg: l } = N();
|
|
27
27
|
L(() => {
|
|
28
28
|
const e = p(n, c);
|
|
29
|
-
|
|
29
|
+
m(e);
|
|
30
30
|
}, [c, n, r]);
|
|
31
31
|
const f = (e) => {
|
|
32
|
-
const
|
|
33
|
-
|
|
32
|
+
const o = n[e].hash;
|
|
33
|
+
o != null && r && (window.location.hash = o), m(e), b?.(e);
|
|
34
34
|
};
|
|
35
35
|
return /* @__PURE__ */ a(
|
|
36
36
|
T,
|
|
37
37
|
{
|
|
38
38
|
elevation: B,
|
|
39
39
|
className: `${t.elevation} ${v === "none" ? "" : t.themeBackground}`,
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ d(i, { direction: "vertical", gap: g, secondaryAlign: "stretch", children: [
|
|
41
|
+
/* @__PURE__ */ d(i, { direction: l ? "horizontal" : "vertical", className: t.tabWrapper, children: [
|
|
42
42
|
/* @__PURE__ */ a(
|
|
43
43
|
C,
|
|
44
44
|
{
|
|
45
45
|
className: t.tabBar,
|
|
46
|
-
clustered:
|
|
47
|
-
clusterAlign:
|
|
46
|
+
clustered: l ? u : !1,
|
|
47
|
+
clusterAlign: _,
|
|
48
48
|
variant: "surface",
|
|
49
|
-
activeTabIndex:
|
|
49
|
+
activeTabIndex: h,
|
|
50
50
|
onTabActivated: f,
|
|
51
|
-
children: n.map((e) => /* @__PURE__ */ a(
|
|
51
|
+
children: n.map((e, o) => /* @__PURE__ */ a(
|
|
52
52
|
k,
|
|
53
53
|
{
|
|
54
54
|
icon: e.leadingIcon,
|
|
55
|
-
className:
|
|
56
|
-
children: /* @__PURE__ */
|
|
55
|
+
className: s ? t.tabButton : "",
|
|
56
|
+
children: /* @__PURE__ */ d(i, { gap: "dense", children: [
|
|
57
57
|
e.title,
|
|
58
58
|
e.trailingIcon
|
|
59
59
|
] })
|
|
60
60
|
},
|
|
61
|
-
e.hash
|
|
61
|
+
`${o}_${e.hash}`
|
|
62
62
|
))
|
|
63
63
|
}
|
|
64
64
|
),
|
|
65
|
-
|
|
65
|
+
s ? /* @__PURE__ */ a(
|
|
66
66
|
A,
|
|
67
67
|
{
|
|
68
68
|
variant: "dense",
|
|
69
|
-
className:
|
|
70
|
-
children: /* @__PURE__ */ a(
|
|
69
|
+
className: l ? t.childContainer : t.childContainerLg,
|
|
70
|
+
children: /* @__PURE__ */ a(i, { gap: "dense", primaryAlign: "center", secondaryAlign: "center", children: s })
|
|
71
71
|
}
|
|
72
72
|
) : /* @__PURE__ */ a(w, {})
|
|
73
73
|
] }),
|
|
74
|
-
n[
|
|
74
|
+
n[h]?.component
|
|
75
75
|
] })
|
|
76
76
|
}
|
|
77
77
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as m, jsxs as J, Fragment as Kr } from "react/jsx-runtime";
|
|
2
2
|
import { Elevation as Ur, Divider as Q, List as qr } from "@element/react-components";
|
|
3
3
|
import { g as Hr } from "../../_commonjsHelpers-CT_km90n.js";
|
|
4
|
-
import { _ as H, a as Tr, b as wr, c as
|
|
4
|
+
import { _ as H, a as Tr, b as wr, c as w, d as Nr, e as Wr, i as h, f as N, h as B, j as Xr, k as zr, l as I, m as Yr, n as Zr, o as Jr, p as W, q as Qr, r as Or, s as Pr, t as kr, u as Vr } from "../../get-Dyz8NMrE.js";
|
|
5
5
|
import { useState as re, useMemo as k } from "react";
|
|
6
6
|
import { SearchBar as ee } from "../SearchBar/SearchBar.js";
|
|
7
|
-
import { g as ae, a as te, s as
|
|
7
|
+
import { g as ae, a as te, s as T } from "../../ListAreaService-zxVNvD59.js";
|
|
8
8
|
var ne = H;
|
|
9
9
|
function se() {
|
|
10
10
|
this.__data__ = new ne(), this.size = 0;
|
|
@@ -34,16 +34,16 @@ function $e(r, e) {
|
|
|
34
34
|
return a.set(r, e), this.size = a.size, this;
|
|
35
35
|
}
|
|
36
36
|
var be = $e, de = H, Ae = ie, he = fe, Te = ce, we = ge, Oe = be;
|
|
37
|
-
function
|
|
37
|
+
function O(r) {
|
|
38
38
|
var e = this.__data__ = new de(r);
|
|
39
39
|
this.size = e.size;
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var mr =
|
|
41
|
+
O.prototype.clear = Ae;
|
|
42
|
+
O.prototype.delete = he;
|
|
43
|
+
O.prototype.get = Te;
|
|
44
|
+
O.prototype.has = we;
|
|
45
|
+
O.prototype.set = Oe;
|
|
46
|
+
var mr = O, Pe = "__lodash_hash_undefined__";
|
|
47
47
|
function me(r) {
|
|
48
48
|
return this.__data__.set(r, Pe), this;
|
|
49
49
|
}
|
|
@@ -104,7 +104,7 @@ function He(r, e, a, t, s, n) {
|
|
|
104
104
|
}
|
|
105
105
|
return n.delete(r), n.delete(e), g;
|
|
106
106
|
}
|
|
107
|
-
var Er = He, Ne =
|
|
107
|
+
var Er = He, Ne = w, We = Ne.Uint8Array, Xe = We;
|
|
108
108
|
function ze(r) {
|
|
109
109
|
var e = -1, a = Array(r.size);
|
|
110
110
|
return r.forEach(function(t, s) {
|
|
@@ -202,7 +202,7 @@ function Ha() {
|
|
|
202
202
|
var Na = Ha;
|
|
203
203
|
C.exports;
|
|
204
204
|
(function(r, e) {
|
|
205
|
-
var a =
|
|
205
|
+
var a = w, t = Na, s = e && !e.nodeType && e, n = s && !0 && r && !r.nodeType && r, i = n && n.exports === s, u = i ? a.Buffer : void 0, f = u ? u.isBuffer : void 0, o = f || t;
|
|
206
206
|
r.exports = o;
|
|
207
207
|
})(C, C.exports);
|
|
208
208
|
var Mr = C.exports, Wa = 9007199254740991, Xa = /^(?:0|[1-9]\d*)$/;
|
|
@@ -313,9 +313,9 @@ function yn(r, e, a, t, s, n) {
|
|
|
313
313
|
}
|
|
314
314
|
return n.delete(r), n.delete(e), y;
|
|
315
315
|
}
|
|
316
|
-
var $n = yn, bn = I, dn =
|
|
316
|
+
var $n = yn, bn = I, dn = w, An = bn(dn, "DataView"), hn = An, Tn = I, wn = w, On = Tn(wn, "Promise"), Pn = On, mn = I, En = w, Sn = mn(En, "Set"), Ln = Sn, Mn = I, Cn = w, xn = Mn(Cn, "WeakMap"), Bn = xn, R = hn, j = Tr, K = Pn, U = Ln, q = Bn, Ir = N, P = Yr, ur = "[object Map]", In = "[object Object]", fr = "[object Promise]", or = "[object Set]", cr = "[object WeakMap]", vr = "[object DataView]", Fn = P(R), Dn = P(j), Gn = P(K), Rn = P(U), jn = P(q), A = Ir;
|
|
317
317
|
(R && A(new R(new ArrayBuffer(1))) != vr || j && A(new j()) != ur || K && A(K.resolve()) != fr || U && A(new U()) != or || q && A(new q()) != cr) && (A = function(r) {
|
|
318
|
-
var e = Ir(r), a = e == In ? r.constructor : void 0, t = a ?
|
|
318
|
+
var e = Ir(r), a = e == In ? r.constructor : void 0, t = a ? P(a) : "";
|
|
319
319
|
if (t)
|
|
320
320
|
switch (t) {
|
|
321
321
|
case Fn:
|
|
@@ -568,26 +568,26 @@ const hr = /* @__PURE__ */ Hr(Hi), Qi = ({
|
|
|
568
568
|
() => a ? ae(p, e, u, _) : te(p, e, u, _),
|
|
569
569
|
[p, e, u, a, _]
|
|
570
570
|
);
|
|
571
|
-
return /* @__PURE__ */
|
|
571
|
+
return /* @__PURE__ */ m(Ur, { elevation: n ? 0 : 1, className: `${T.mainElevation}`, children: /* @__PURE__ */ J("div", { className: T.fullWidth, children: [
|
|
572
572
|
t && r.length > 0 && /* @__PURE__ */ J(Kr, { children: [
|
|
573
|
-
n && /* @__PURE__ */
|
|
574
|
-
/* @__PURE__ */
|
|
573
|
+
n && /* @__PURE__ */ m(Q, {}),
|
|
574
|
+
/* @__PURE__ */ m(
|
|
575
575
|
ee,
|
|
576
576
|
{
|
|
577
577
|
searchTerm: v,
|
|
578
578
|
setSearchTerm: g,
|
|
579
|
-
className:
|
|
579
|
+
className: T.searchbar,
|
|
580
580
|
placeholder: s
|
|
581
581
|
}
|
|
582
582
|
),
|
|
583
|
-
/* @__PURE__ */
|
|
583
|
+
/* @__PURE__ */ m(Q, {})
|
|
584
584
|
] }),
|
|
585
585
|
p.length === 0 && o,
|
|
586
|
-
/* @__PURE__ */
|
|
586
|
+
/* @__PURE__ */ m(
|
|
587
587
|
qr,
|
|
588
588
|
{
|
|
589
589
|
items: l,
|
|
590
|
-
className: `${
|
|
590
|
+
className: `${T.list} ${T.primaryText} ${a ? "" : T.roundedBottom}`,
|
|
591
591
|
style: { maxHeight: f },
|
|
592
592
|
showDivider: !1
|
|
593
593
|
}
|
|
@@ -2,7 +2,7 @@ import { jsx as r, Fragment as i } from "react/jsx-runtime";
|
|
|
2
2
|
import { TypoButton as p } from "@element/react-components";
|
|
3
3
|
import { r as s, s as a, f as u } from "../../react.esm-C0LtovhP.js";
|
|
4
4
|
import { ListArea as c } from "./ListArea.js";
|
|
5
|
-
import { g as h } from "../../ListAreaService-
|
|
5
|
+
import { g as h } from "../../ListAreaService-zxVNvD59.js";
|
|
6
6
|
import { d as m, t as n, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
7
7
|
m("ListArea Test", () => {
|
|
8
8
|
const o = [
|
|
@@ -24,8 +24,8 @@ export declare const getListedItems: (items: ListElement[], pathname: string, it
|
|
|
24
24
|
id: string;
|
|
25
25
|
key: string;
|
|
26
26
|
select: boolean;
|
|
27
|
-
primaryText:
|
|
28
|
-
secondaryText: import("react/jsx-runtime").JSX.Element
|
|
27
|
+
primaryText: string;
|
|
28
|
+
secondaryText: import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
overlineText: string | undefined;
|
|
30
30
|
trailingBlock: string | number | boolean | JSX.Element | Iterable<import("react").ReactNode>;
|
|
31
31
|
leadingBlock: string | JSX.Element | undefined;
|
|
@@ -47,15 +47,14 @@ export declare const getListedItems: (items: ListElement[], pathname: string, it
|
|
|
47
47
|
* @param element the item to map
|
|
48
48
|
* @param pathname current browser location
|
|
49
49
|
* @param itemClassName custom class name or CSS module style
|
|
50
|
-
* @param isGrouped whether the item is part of a group
|
|
51
50
|
* @returns an object with List component schema
|
|
52
51
|
*/
|
|
53
|
-
export declare const mapListElement: (element: ListElement, pathname: string | undefined, itemClassName: string | undefined,
|
|
52
|
+
export declare const mapListElement: (element: ListElement, pathname: string | undefined, itemClassName: string | undefined, routerLinkElement: undefined | React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>) => {
|
|
54
53
|
id: string;
|
|
55
54
|
key: string;
|
|
56
55
|
select: boolean;
|
|
57
|
-
primaryText:
|
|
58
|
-
secondaryText: import("react/jsx-runtime").JSX.Element
|
|
56
|
+
primaryText: string;
|
|
57
|
+
secondaryText: import("react/jsx-runtime").JSX.Element;
|
|
59
58
|
overlineText: string | undefined;
|
|
60
59
|
trailingBlock: string | number | boolean | JSX.Element | Iterable<import("react").ReactNode>;
|
|
61
60
|
leadingBlock: string | JSX.Element | undefined;
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "@element/react-components";
|
|
3
3
|
import "../Iconify/Iconify.js";
|
|
4
4
|
import "../../enums/AvailableCustomIcons.js";
|
|
5
|
-
import { g as s, a as i, m as a } from "../../ListAreaService-
|
|
5
|
+
import { g as s, a as i, m as a } from "../../ListAreaService-zxVNvD59.js";
|
|
6
6
|
export {
|
|
7
7
|
s as getGroupedItems,
|
|
8
8
|
i as getListedItems,
|
package/dist/main.d.ts
CHANGED
|
@@ -26,8 +26,9 @@ export { FormText } from './components/FormComponents/FormText/FormText';
|
|
|
26
26
|
export { AvailableCustomIcons } from './enums/AvailableCustomIcons';
|
|
27
27
|
export { useBreakpoints } from './hooks/useBreakpoint';
|
|
28
28
|
export { capitalizeFirstLetters } from './services/UtilService';
|
|
29
|
+
export type { CellTemplate, CellTemplateProps, TableLayoutProps } from './types/GenericTable';
|
|
29
30
|
export type { FieldItem } from './components/InfoGroup/InfoGroup';
|
|
31
|
+
export type { FormSelectOption } from './components/FormComponents/FormSelect/FormSelect';
|
|
32
|
+
export type { FormTextProps } from './components/FormComponents/FormText/FormText';
|
|
30
33
|
export type { HashTab } from './types/HashTab';
|
|
31
34
|
export type { ListElement, BaseListElement } from './types/ListElement';
|
|
32
|
-
export type { CellTemplate, CellTemplateProps, TableLayoutProps } from './types/GenericTable';
|
|
33
|
-
export type { FormSelectOption } from './components/FormComponents/FormSelect/FormSelect';
|
|
@@ -85,13 +85,9 @@ export type BaseListElement = {
|
|
|
85
85
|
*/
|
|
86
86
|
export type ListElement = Omit<BaseListElement, 'component'> & {
|
|
87
87
|
/**
|
|
88
|
-
* the group name of
|
|
88
|
+
* the group name of the element, if provided and the List has the `isGroup` property the item is located in that group
|
|
89
89
|
*/
|
|
90
90
|
groupName?: string | JSX.Element;
|
|
91
|
-
/**
|
|
92
|
-
* the list elements of the group
|
|
93
|
-
*/
|
|
94
|
-
items?: ListElement[];
|
|
95
91
|
/**
|
|
96
92
|
* will be rendered instead of title and subtitle
|
|
97
93
|
*/
|
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.5635",
|
|
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>",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"start": "vite",
|
|
22
22
|
"build": "tsc --p ./tsconfig-build.json && vite build",
|
|
23
23
|
"test": "vitest",
|
|
24
|
-
"test:ci": "vitest run --coverage",
|
|
24
|
+
"test:ci": "vitest run --coverage --coverage.include=lib",
|
|
25
25
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
26
26
|
"preview": "vite preview"
|
|
27
27
|
},
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import "./assets/ListAreaService.css";
|
|
2
|
-
import { jsx as l } from "react/jsx-runtime";
|
|
3
|
-
import { TypoButton as C, TypoSubtitle as L, TypoBody as x, Icon as N } from "@element/react-components";
|
|
4
|
-
import { Iconify as E } from "./components/Iconify/Iconify.js";
|
|
5
|
-
import { AvailableCustomIcons as $ } from "./enums/AvailableCustomIcons.js";
|
|
6
|
-
const W = "_fullWidth_1y0ty_1", j = "_mainElevation_1y0ty_5", S = "_searchbar_1y0ty_11", w = "_roundedBottom_1y0ty_19", A = "_list_1y0ty_24", G = "_listItem_1y0ty_52", O = "_trailingIcon_1y0ty_56", P = "_groupedListItem_1y0ty_68", _ = {
|
|
7
|
-
fullWidth: W,
|
|
8
|
-
mainElevation: j,
|
|
9
|
-
searchbar: S,
|
|
10
|
-
roundedBottom: w,
|
|
11
|
-
list: A,
|
|
12
|
-
listItem: G,
|
|
13
|
-
trailingIcon: O,
|
|
14
|
-
groupedListItem: P
|
|
15
|
-
}, M = (t, i, n, r) => {
|
|
16
|
-
const s = t.reduce((o, m) => {
|
|
17
|
-
const { groupName: e, ...a } = m;
|
|
18
|
-
return !e || typeof e != "string" || (o[e] || (o[e] = {
|
|
19
|
-
groupName: /* @__PURE__ */ l(C, { children: e }),
|
|
20
|
-
id: e,
|
|
21
|
-
items: []
|
|
22
|
-
}), o[e].items = [
|
|
23
|
-
...o[e].items,
|
|
24
|
-
g(a, i, n, !0, r)
|
|
25
|
-
]), o;
|
|
26
|
-
}, {});
|
|
27
|
-
return Object.values(s);
|
|
28
|
-
}, Q = (t, i, n, r) => t.map((s) => g(s, i, n, !1, r)), g = (t, i, n, r, s) => {
|
|
29
|
-
const {
|
|
30
|
-
id: o,
|
|
31
|
-
title: m,
|
|
32
|
-
subTitle: e,
|
|
33
|
-
route: a,
|
|
34
|
-
value: I,
|
|
35
|
-
noNavigation: y,
|
|
36
|
-
disabled: d,
|
|
37
|
-
icon: v,
|
|
38
|
-
iconType: p,
|
|
39
|
-
trailingIcon: f,
|
|
40
|
-
trailingIconType: T,
|
|
41
|
-
actionButton: h,
|
|
42
|
-
onClick: B,
|
|
43
|
-
customTitle: u,
|
|
44
|
-
listItemClassName: b
|
|
45
|
-
} = t, c = i === a;
|
|
46
|
-
return {
|
|
47
|
-
id: o,
|
|
48
|
-
key: o,
|
|
49
|
-
select: c,
|
|
50
|
-
primaryText: u ?? /* @__PURE__ */ l(L, { level: 1, bold: c, themeColor: c ? "primary" : void 0, children: m }),
|
|
51
|
-
secondaryText: e && !u ? /* @__PURE__ */ l(x, { level: 2, themeColor: c ? "primary" : void 0, children: e }) : void 0,
|
|
52
|
-
overlineText: t.overlineTitle,
|
|
53
|
-
trailingBlock: h ?? f ?? /* @__PURE__ */ l(N, { icon: "arrow_right" }),
|
|
54
|
-
leadingBlock: q(v),
|
|
55
|
-
value: I,
|
|
56
|
-
componentProps: {
|
|
57
|
-
id: o,
|
|
58
|
-
key: o,
|
|
59
|
-
leadingBlockType: p ?? "icon",
|
|
60
|
-
trailingBlockType: T ?? "icon",
|
|
61
|
-
className: `${p === "avatar" ? "" : _.listItem} ${n} ${r ? _.groupedListItem : ""} ${b ?? ""}`,
|
|
62
|
-
onClick: (z, k) => B?.(k),
|
|
63
|
-
tag: d || y ? void 0 : s ?? "a",
|
|
64
|
-
to: d || y ? void 0 : a,
|
|
65
|
-
disabled: d
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}, q = (t) => typeof t == "string" && t in $ ? /* @__PURE__ */ l(E, { icon: t }) : t;
|
|
69
|
-
export {
|
|
70
|
-
Q as a,
|
|
71
|
-
M as g,
|
|
72
|
-
g as m,
|
|
73
|
-
_ as s
|
|
74
|
-
};
|