@hortiview/shared-components 0.0.4540 → 0.0.4721
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/README.md +101 -29
- package/dist/{ListAreaService-CFOmATRF.js → ListAreaService-BQCdQv7a.js} +5 -5
- package/dist/assets/{main.css → DeleteModal.css} +2 -2
- package/dist/assets/Disclaimer.css +1 -0
- package/dist/assets/HeaderFilter.css +1 -0
- package/dist/assets/Scrollbar.css +1 -0
- package/dist/{component-D1YrRAXe.js → component-DCtofpGS.js} +61 -54
- package/dist/components/BaseView/BaseView.js +2 -2
- package/dist/components/BaseView/BaseView.test.js +15 -14
- package/dist/components/BasicHeading/BasicHeading.d.ts +2 -5
- package/dist/components/BasicHeading/BasicHeading.js +2 -2
- package/dist/components/BasicHeading/BasicHeading.test.js +33 -333
- package/dist/components/BlockView/BlockView.js +5 -5
- package/dist/components/BlockView/BlockView.test.js +15 -14
- package/dist/components/DeleteModal/DeleteModal.d.ts +65 -0
- package/dist/components/DeleteModal/DeleteModal.js +4721 -0
- package/dist/components/DeleteModal/DeleteModal.test.d.ts +1 -0
- package/dist/components/DeleteModal/DeleteModal.test.js +85 -0
- package/dist/components/Disclaimer/Disclaimer.d.ts +33 -0
- package/dist/components/Disclaimer/Disclaimer.js +24 -0
- package/dist/components/Disclaimer/Disclaimer.test.d.ts +1 -0
- package/dist/components/Disclaimer/Disclaimer.test.js +13 -0
- package/dist/components/EmptyView/EmptyView.js +4 -4
- package/dist/components/EmptyView/EmptyView.test.js +14 -13
- package/dist/components/HashTabView/HashTabView.js +5 -5
- package/dist/components/HashTabView/HashTabView.test.js +9 -8
- package/dist/components/HeaderFilter/HeaderFilter.d.ts +33 -0
- package/dist/components/HeaderFilter/HeaderFilter.js +7606 -0
- package/dist/components/HeaderFilter/HeaderFilter.test.d.ts +1 -0
- package/dist/components/HeaderFilter/HeaderFilter.test.js +46 -0
- package/dist/components/Iconify/Iconify.js +1 -1
- package/dist/components/Iconify/Iconify.test.js +8 -7
- package/dist/components/ListArea/ListArea.js +298 -5351
- package/dist/components/ListArea/ListArea.test.js +4 -3
- package/dist/components/ListArea/ListAreaService.js +3 -3
- package/dist/components/Scrollbar/Scrollbar.d.ts +2 -0
- package/dist/components/Scrollbar/Scrollbar.js +9 -0
- package/dist/components/Scrollbar/scrollbar.test.d.ts +1 -0
- package/dist/components/Scrollbar/scrollbar.test.js +15 -0
- package/dist/components/SearchBar/SearchBar.js +2052 -3
- package/dist/components/SearchBar/SearchBar.test.js +16 -15
- package/dist/components/VerticalDivider/VerticalDivider.test.js +8 -7
- package/dist/{index.es-Cv6meSAn.js → index.es-3I3oam0G.js} +1 -1
- package/dist/{index.es-WZ1mqvGz.js → index.es-BahjEG5L.js} +104 -97
- package/dist/index.es-BcHAMD5J.js +5068 -0
- package/dist/index.es-C3EKMb0J.js +305 -0
- package/dist/{index.es-CUWXKh7P.js → index.es-CcfZlo4c.js} +8 -8
- package/dist/index.es-DVNdCQvl.js +1192 -0
- package/dist/{index.es-mBp_Btvi.js → index.es-STyHqa-8.js} +2 -2
- package/dist/{index.es-DYsXox--.js → index.es-hAl7Wxm5.js} +1 -1
- package/dist/{index.es-BD4kFWFx.js → index.es-z8RCxF8n.js} +3 -3
- package/dist/main.d.ts +5 -1
- package/dist/main.js +33 -23
- package/dist/react.esm-BeDwcQWb.js +12741 -0
- package/dist/services/UtilService.d.ts +6 -0
- package/dist/services/UtilService.js +4 -0
- package/dist/services/services.test.d.ts +1 -0
- package/dist/services/services.test.js +22 -0
- package/dist/vi.JYQecGiw-BbUbJcT8.js +9795 -0
- package/package.json +1 -1
- package/dist/SearchBar-CY2zfu6B.js +0 -3232
- package/dist/vi.JYQecGiw-8gz0k16C.js +0 -22532
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { r as c, s as e } from "../../react.esm-BeDwcQWb.js";
|
|
3
|
+
import { DeleteModal as b } from "./DeleteModal.js";
|
|
4
|
+
import { d, t as a, v as o, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
|
+
d("DeleteModal Test", () => {
|
|
6
|
+
a("should render the DeleteModal properly", () => {
|
|
7
|
+
c(
|
|
8
|
+
/* @__PURE__ */ n(
|
|
9
|
+
b,
|
|
10
|
+
{
|
|
11
|
+
icon: "block",
|
|
12
|
+
open: !0,
|
|
13
|
+
setOpen: o.fn(),
|
|
14
|
+
onDelete: o.fn(),
|
|
15
|
+
title: "DELETE",
|
|
16
|
+
confirmButtonLabel: "Remove",
|
|
17
|
+
cancelButtonLabel: "Cancel",
|
|
18
|
+
deleteHeader: "Delete my block",
|
|
19
|
+
impossibleDeleteHeader: "block cant be deleted",
|
|
20
|
+
deleteBody: ["block 1", "block 2", "block 3"],
|
|
21
|
+
isDeletePossible: !0
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
), t(e.getByText("DELETE")).toBeInTheDocument(), t(e.getByTestId("block")).toBeInTheDocument(), t(e.getByText("block 1")).toBeInTheDocument(), t(e.getByText("block 2")).toBeInTheDocument(), t(e.getByText("block 3")).toBeInTheDocument(), t(e.getByText("Remove")).toBeInTheDocument(), t(e.getByText("Cancel")).toBeInTheDocument(), t(e.queryByText("block cant be deleted")).not.toBeInTheDocument();
|
|
25
|
+
}), a("should render the DeleteModal properly when isDeletePossible = false", () => {
|
|
26
|
+
c(
|
|
27
|
+
/* @__PURE__ */ n(
|
|
28
|
+
b,
|
|
29
|
+
{
|
|
30
|
+
icon: "block",
|
|
31
|
+
open: !0,
|
|
32
|
+
setOpen: o.fn(),
|
|
33
|
+
onDelete: o.fn(),
|
|
34
|
+
title: "DELETE",
|
|
35
|
+
confirmButtonLabel: "Remove",
|
|
36
|
+
cancelButtonLabel: "Cancel",
|
|
37
|
+
deleteHeader: "Delete my block",
|
|
38
|
+
impossibleDeleteHeader: "block cant be deleted",
|
|
39
|
+
deleteBody: ["block 1", "block 2", "block 3"],
|
|
40
|
+
isDeletePossible: !1
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
), e.debug(), t(e.getByText("DELETE")).toBeInTheDocument(), t(e.getByTestId("block")).toBeInTheDocument(), t(e.queryByText("block 1")).not.toBeInTheDocument(), t(e.queryByText("block 2")).not.toBeInTheDocument(), t(e.queryByText("block 3")).not.toBeInTheDocument(), t(e.getByText("Remove")).toBeInTheDocument(), t(e.getByText("Remove").parentElement).toBeDisabled(), t(e.getByText("Cancel")).toBeInTheDocument(), t(e.queryByText("block cant be deleted")).toBeInTheDocument();
|
|
44
|
+
}), a("should call setOpen with false when clicking on cancel button", () => {
|
|
45
|
+
const l = o.fn();
|
|
46
|
+
c(
|
|
47
|
+
/* @__PURE__ */ n(
|
|
48
|
+
b,
|
|
49
|
+
{
|
|
50
|
+
icon: "block",
|
|
51
|
+
open: !0,
|
|
52
|
+
setOpen: l,
|
|
53
|
+
onDelete: o.fn(),
|
|
54
|
+
title: "DELETE",
|
|
55
|
+
confirmButtonLabel: "Remove",
|
|
56
|
+
cancelButtonLabel: "Cancel",
|
|
57
|
+
deleteHeader: "Delete my block",
|
|
58
|
+
impossibleDeleteHeader: "block cant be deleted",
|
|
59
|
+
deleteBody: ["block 1", "block 2", "block 3"],
|
|
60
|
+
isDeletePossible: !0
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
), e.getByText("Cancel").click(), t(l).toHaveBeenCalledWith(!1);
|
|
64
|
+
}), a("should call onDelete when clicking on delete button", () => {
|
|
65
|
+
const l = o.fn();
|
|
66
|
+
c(
|
|
67
|
+
/* @__PURE__ */ n(
|
|
68
|
+
b,
|
|
69
|
+
{
|
|
70
|
+
icon: "block",
|
|
71
|
+
open: !0,
|
|
72
|
+
setOpen: o.fn(),
|
|
73
|
+
onDelete: l,
|
|
74
|
+
title: "DELETE",
|
|
75
|
+
confirmButtonLabel: "Remove",
|
|
76
|
+
cancelButtonLabel: "Cancel",
|
|
77
|
+
deleteHeader: "Delete my block",
|
|
78
|
+
impossibleDeleteHeader: "block cant be deleted",
|
|
79
|
+
deleteBody: ["block 1", "block 2", "block 3"],
|
|
80
|
+
isDeletePossible: !0
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
), e.getByText("Remove").click(), t(l).toHaveBeenCalled();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type DisclaimerProps = {
|
|
2
|
+
/**
|
|
3
|
+
* The text of the disclaimer - required
|
|
4
|
+
*/
|
|
5
|
+
text: string;
|
|
6
|
+
/**
|
|
7
|
+
* The level of the disclaimer - optional, defaults to _2_
|
|
8
|
+
*/
|
|
9
|
+
level?: 1 | 2;
|
|
10
|
+
/**
|
|
11
|
+
* Whether the disclaimer should be bold - optional, defaults to _false_
|
|
12
|
+
*/
|
|
13
|
+
bold?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The icon of the disclaimer - optional, defaults to _wifi_off_
|
|
16
|
+
*/
|
|
17
|
+
icon?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The subtext of the disclaimer - optional
|
|
20
|
+
*/
|
|
21
|
+
subtext?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A disclaimer component with additional icon and subtext
|
|
25
|
+
* @prop **text** - the text of the disclaimer - required
|
|
26
|
+
* @prop **level** - the level of the disclaimer - optional, defaults to _2_
|
|
27
|
+
* @prop **bold** - whether the disclaimer should be bold - optional, defaults to _false_
|
|
28
|
+
* @prop **icon** - the icon of the disclaimer - optional, defaults to _wifi_off_
|
|
29
|
+
* @prop **subtext** - the subtext of the disclaimer - optional
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
export declare const Disclaimer: ({ text, subtext, icon, level, bold }: DisclaimerProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "../../assets/Disclaimer.css";
|
|
2
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { G as n } from "../../index.es-hAl7Wxm5.js";
|
|
4
|
+
import { a as m, b as t } from "../../index.es-z8RCxF8n.js";
|
|
5
|
+
import { I as d } from "../../index.es-3I3oam0G.js";
|
|
6
|
+
const p = "_disclaimer_1k38t_1", y = "_iconArea_1k38t_7", o = {
|
|
7
|
+
disclaimer: p,
|
|
8
|
+
iconArea: y
|
|
9
|
+
}, v = ({ text: a, subtext: i, icon: e, level: c = 2, bold: s = !1 }) => /* @__PURE__ */ l(
|
|
10
|
+
n,
|
|
11
|
+
{
|
|
12
|
+
direction: e || i ? "vertical" : "horizontal",
|
|
13
|
+
secondaryAlign: "center",
|
|
14
|
+
primaryAlign: "center",
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ r(m, { className: o.disclaimer, level: c, bold: s, children: a }),
|
|
17
|
+
i && /* @__PURE__ */ r(t, { level: 2, children: i }),
|
|
18
|
+
e && /* @__PURE__ */ r("div", { className: o.iconArea, children: /* @__PURE__ */ r(d, { className: o.Icon, icon: e, iconSize: "large" }) })
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
export {
|
|
23
|
+
v as Disclaimer
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { r, s as t } from "../../react.esm-BeDwcQWb.js";
|
|
3
|
+
import { Disclaimer as s } from "./Disclaimer.js";
|
|
4
|
+
import { d as i, t as m, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
|
+
i("Disclaimer test", () => {
|
|
6
|
+
m("should render with default text", () => {
|
|
7
|
+
r(/* @__PURE__ */ o(s, { text: "disclaimer.default" })), e(t.getByText("disclaimer.default")).toBeInTheDocument();
|
|
8
|
+
}), m("should render with custom text", () => {
|
|
9
|
+
r(/* @__PURE__ */ o(s, { text: "custom-text" })), e(t.getByText("custom-text")).toBeInTheDocument(), e(t.queryByText("disclaimer.default")).not.toBeInTheDocument();
|
|
10
|
+
}), m("should render Disclaimer including the custom text", () => {
|
|
11
|
+
r(/* @__PURE__ */ o(s, { subtext: "custom-text", text: "offline-alterText" })), e(t.getByText("offline-alterText")).toBeInTheDocument(), e(t.getByText("custom-text")).toBeInTheDocument();
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as k } from "react/jsx-runtime";
|
|
2
|
-
import { P as e, c as P, _ as C } from "../../index.es-
|
|
2
|
+
import { P as e, c as P, _ as C } from "../../index.es-BahjEG5L.js";
|
|
3
3
|
import l, { forwardRef as H, useRef as T, useImperativeHandle as O, useMemo as p } from "react";
|
|
4
|
-
import { G as E } from "../../index.es-
|
|
5
|
-
import { d as N } from "../../index.es-
|
|
6
|
-
import { I as x } from "../../index.es-
|
|
4
|
+
import { G as E } from "../../index.es-hAl7Wxm5.js";
|
|
5
|
+
import { d as N } from "../../index.es-z8RCxF8n.js";
|
|
6
|
+
import { I as x } from "../../index.es-3I3oam0G.js";
|
|
7
7
|
const $ = {
|
|
8
8
|
/**
|
|
9
9
|
* Aligns the Hero contents.
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { EmptyView as
|
|
4
|
-
r
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { r as s, s as d } from "../../react.esm-BeDwcQWb.js";
|
|
3
|
+
import { EmptyView as n } from "./EmptyView.js";
|
|
4
|
+
import { d as i, t as r, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
|
+
i("EmptyView", () => {
|
|
6
|
+
r("should render", () => {
|
|
7
|
+
s(/* @__PURE__ */ o(n, {})), e(d.getByText("dashbord")).toBeInTheDocument();
|
|
8
|
+
}), r("should render with custom icon", () => {
|
|
9
|
+
s(/* @__PURE__ */ o(n, { icon: "add" })), e(d.getByText("add")).toBeInTheDocument();
|
|
10
|
+
}), r("should render with title", () => {
|
|
11
|
+
s(/* @__PURE__ */ o(n, { icon: "add", title: "TITLE" }));
|
|
12
|
+
const t = d.getByText("TITLE");
|
|
12
13
|
e(t).toBeInTheDocument(), e(t).toHaveClass(/headline2/);
|
|
13
|
-
}),
|
|
14
|
-
|
|
15
|
-
const t =
|
|
14
|
+
}), r("should render with subtitle", () => {
|
|
15
|
+
s(/* @__PURE__ */ o(n, { icon: "add", subtitle: "SUB_TITLE" }));
|
|
16
|
+
const t = d.getByText("SUB_TITLE");
|
|
16
17
|
e(t).toBeInTheDocument(), e(t).toHaveClass(/headline6/);
|
|
17
18
|
});
|
|
18
19
|
});
|
|
@@ -2,12 +2,12 @@ import "../../assets/HashTabView.css";
|
|
|
2
2
|
import { jsx as I, jsxs as q, Fragment as dt } from "react/jsx-runtime";
|
|
3
3
|
import p, { forwardRef as w, useMemo as rt, useRef as C, useImperativeHandle as W, useContext as ft, useEffect as D, useCallback as ht, createContext as pt, useState as mt } from "react";
|
|
4
4
|
import { a as gt } from "../../useBreakpoint-DROHPVxO.js";
|
|
5
|
-
import { P as i, _ as x, c as K, d as tt,
|
|
6
|
-
import { I as Tt } from "../../index.es-
|
|
5
|
+
import { P as i, _ as x, c as K, d as tt, e as at } from "../../index.es-BahjEG5L.js";
|
|
6
|
+
import { I as Tt } from "../../index.es-3I3oam0G.js";
|
|
7
7
|
import { c as T, _ as E, b as vt } from "../../tslib.es6-BOWp4lfV.js";
|
|
8
|
-
import { a as k, b,
|
|
9
|
-
import { E as St } from "../../index.es-
|
|
10
|
-
import { G as Y } from "../../index.es-
|
|
8
|
+
import { a as k, d as b, b as H, m as _t, f as bt, M as et } from "../../component-DCtofpGS.js";
|
|
9
|
+
import { E as St } from "../../index.es-CcfZlo4c.js";
|
|
10
|
+
import { G as Y } from "../../index.es-hAl7Wxm5.js";
|
|
11
11
|
/**
|
|
12
12
|
* @license
|
|
13
13
|
* Copyright 2018 Google Inc.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as n, Fragment as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { HashTabView as
|
|
2
|
+
import { r as a, s as e, f as r } from "../../react.esm-BeDwcQWb.js";
|
|
3
|
+
import { HashTabView as c } from "./HashTabView.js";
|
|
4
|
+
import { d as h, t as l, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
4
5
|
const m = [
|
|
5
6
|
{
|
|
6
7
|
title: "Map",
|
|
@@ -18,13 +19,13 @@ const m = [
|
|
|
18
19
|
}
|
|
19
20
|
];
|
|
20
21
|
h("HashTabView test", () => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}),
|
|
24
|
-
|
|
22
|
+
l("should render HashTabView with all given tabs, icons and the initial component", () => {
|
|
23
|
+
a(/* @__PURE__ */ n(c, { tabs: m })), t(e.getByText(/Map/)).toBeInTheDocument(), t(e.getByText("map")).toBeInTheDocument(), t(e.getByText(/TrIcon1/)).toBeInTheDocument(), t(e.getByText(/Manually/)).toBeInTheDocument(), t(e.getByText("list_alt")).toBeInTheDocument(), t(e.getByText(/TrIcon2/)).toBeInTheDocument(), t(e.getByText("My map component")).toBeInTheDocument();
|
|
24
|
+
}), l("should change to component on tab-click", () => {
|
|
25
|
+
a(/* @__PURE__ */ n(c, { tabs: m }));
|
|
25
26
|
const i = e.getByText(/Manually/);
|
|
26
27
|
r.click(i), t(e.getByText("My manually component")).toBeInTheDocument();
|
|
27
|
-
}),
|
|
28
|
-
|
|
28
|
+
}), l("should render the correct tab according to hash in route", () => {
|
|
29
|
+
a(/* @__PURE__ */ n(c, { tabs: m, hash: "#manually" })), t(e.getByText("My manually component")).toBeInTheDocument();
|
|
29
30
|
});
|
|
30
31
|
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SelectProps } from '@element/react-components';
|
|
2
|
+
type HeaderFilterProps = {
|
|
3
|
+
/**
|
|
4
|
+
* heading of the filter
|
|
5
|
+
*/
|
|
6
|
+
heading: string;
|
|
7
|
+
/**
|
|
8
|
+
* text to display before the filter
|
|
9
|
+
*/
|
|
10
|
+
filterByText?: string;
|
|
11
|
+
/**
|
|
12
|
+
* function to set the filter
|
|
13
|
+
*/
|
|
14
|
+
setFilter: (filterValue: string) => void;
|
|
15
|
+
/**
|
|
16
|
+
* current value of the filter
|
|
17
|
+
*/
|
|
18
|
+
filterValue: string;
|
|
19
|
+
/**
|
|
20
|
+
* options for the filter
|
|
21
|
+
*/
|
|
22
|
+
filterOptions: SelectProps[];
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Provides a HeaderFilter component with a single filtervalue select
|
|
26
|
+
* @prop {string} heading - heading of the filter
|
|
27
|
+
* @prop {string} filterByText - text to display before the filter
|
|
28
|
+
* @prop {(filterValue: string) => void} setFilter - function to set the filter
|
|
29
|
+
* @prop {string} filterValue - current value of the filter
|
|
30
|
+
* @prop {SelectProps[]} filterOptions - options for the filter
|
|
31
|
+
*/
|
|
32
|
+
export declare const HeaderFilter: ({ heading, filterByText, setFilter, filterValue, filterOptions, }: HeaderFilterProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export {};
|