@hortiview/shared-components 2.3.0 → 2.5.0
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/CHANGELOG.md +24 -0
- package/README.md +11 -0
- package/dist/{AlertBanner-75jjene1.js → AlertBanner-JnX0tJGC.js} +9 -9
- package/dist/{BigLoadingSpinner-BbXMCKpm.js → BigLoadingSpinner-chQoiNY9.js} +1 -1
- package/dist/{GenericCard-BFYKwkzI.js → GenericCard-c9yuyN3m.js} +3 -3
- package/dist/ListAreaService-BY6ZTds9.js +124 -0
- package/dist/OfflineView-HbuDPpQL.js +48 -0
- package/dist/{_MapCache-B75yWNNd.js → _MapCache-B75dXJyg.js} +2 -2
- package/dist/_baseIsEqual-CZNn3LMM.js +241 -0
- package/dist/_getAllKeys-tc1bcd1W.js +86 -0
- package/dist/{_getTag-BCf9b56Z.js → _getTag-DYHrLaIw.js} +2 -2
- package/dist/_setToString-Do1lSQTZ.js +2034 -0
- package/dist/assets/ContextMenu.css +1 -1
- package/dist/assets/ListAreaService.css +1 -1
- package/dist/assets/OfflineView.css +1 -0
- package/dist/components/AlertBanner/AlertBanner.js +4 -4
- package/dist/components/AlertBanner/AlertBanner.test.js +1 -1
- package/dist/components/AlertBanner/LinkBanner.js +3 -3
- package/dist/components/BaseView/BaseView.d.ts +14 -1
- package/dist/components/BaseView/BaseView.js +47 -41
- package/dist/components/BaseView/BaseView.test.js +51 -34
- package/dist/components/BasicHeading/BasicHeading.js +2 -2
- package/dist/components/BasicHeading/BasicHeading.test.js +1 -1
- package/dist/components/BlockView/BlockView.js +1 -1
- package/dist/components/ChipCard/ChipCard.js +4 -4
- package/dist/components/ContextMenu/ContextMenu.d.ts +12 -1
- package/dist/components/ContextMenu/ContextMenu.js +40 -36
- package/dist/components/ContextMenu/ContextMenu.test.js +42 -19
- package/dist/components/DeleteModal/DeleteModal.d.ts +13 -1
- package/dist/components/DeleteModal/DeleteModal.js +53 -49
- package/dist/components/DeleteModal/DeleteModal.test.js +35 -11
- package/dist/components/DetailContentWrapper/DetailContentWrapper.js +1 -1
- package/dist/components/Disclaimer/Disclaimer.js +3 -3
- package/dist/components/EmptyView/EmptyView.js +4 -4
- package/dist/components/Filter/Filter.js +17 -16
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +1 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +4 -4
- package/dist/components/FormComponents/FormNumber/CustomTextField.js +13 -12
- package/dist/components/FormComponents/FormRadio/FormRadio.js +1 -1
- package/dist/components/FormComponents/FormSelect/FormSelect.js +1 -1
- package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +2 -2
- package/dist/components/FormComponents/FormSlider/FormSlider.js +4 -4
- package/dist/components/FormComponents/FormText/FormText.js +2 -2
- package/dist/components/FormComponents/FormToggle/FormToggle.js +3 -3
- package/dist/components/GenericTable/GenericTable.d.ts +3 -1
- package/dist/components/GenericTable/GenericTable.js +2013 -2030
- package/dist/components/GenericTable/GenericTable.test.js +36 -6
- package/dist/components/GenericTable/Mobile/GenericCard.js +4 -4
- package/dist/components/GenericTable/Mobile/GenericCard.test.js +1 -1
- package/dist/components/GenericTable/Mobile/GenericCardList.js +4 -4
- package/dist/components/HashTabView/HashTabView.js +6 -6
- package/dist/components/HeaderFilter/HeaderFilter.js +1 -1
- package/dist/components/HealthCheckFailed/HealthCheckFailed.js +4 -4
- package/dist/components/Iconify/Iconify.js +2 -2
- package/dist/components/InfoGroup/InfoGroup.js +3 -3
- package/dist/components/ListArea/ListArea.js +36 -35
- package/dist/components/ListArea/ListArea.test.js +14 -9
- package/dist/components/ListArea/ListAreaService.js +9 -7
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +2 -2
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +1 -1
- package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +6 -6
- package/dist/components/Modal/Modal.d.ts +6 -1
- package/dist/components/Modal/Modal.js +134 -118
- package/dist/components/ModulePadding/ModulePadding.js +9 -8
- package/dist/components/OfflineView/OfflineView.d.ts +68 -0
- package/dist/components/OfflineView/OfflineView.js +9 -0
- package/dist/components/OfflineView/OfflineView.test.d.ts +1 -0
- package/dist/components/OfflineView/OfflineView.test.js +24 -0
- package/dist/components/OnboardingBanner/OnboardingBanner.js +7 -7
- package/dist/components/OverflowTooltip/OverflowTooltip.js +1 -1
- package/dist/components/OverflowTooltip/OverflowTooltip.test.js +1 -1
- package/dist/components/SearchBar/SearchBar.js +2 -2
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Stepper/Stepper.js +1 -1
- package/dist/components/Stepper/components/StepperButton.js +1 -1
- package/dist/components/Stepper/components/StepperHeader.js +2 -2
- package/dist/components/Stepper/components/StepperIndicator.js +1 -1
- package/dist/{get-DFv1gXfq.js → get-B8c-T4F8.js} +1 -1
- package/dist/{get-7ACccM2X.js → get-C7KpEkVs.js} +1 -1
- package/dist/hooks/useHelperText.js +1 -1
- package/dist/{index.es-D54RuMc_.js → index.es--yyG47az.js} +2 -2
- package/dist/{index.es-DKDgy7Kt.js → index.es-6c1Xbl0N.js} +1 -1
- package/dist/{index.es-BWgXLqXn.js → index.es-BTc2I5pe.js} +2 -2
- package/dist/{index.es-BtjV0oNv.js → index.es-Bf149BSP.js} +4 -4
- package/dist/{index.es-CoFul5zR.js → index.es-BoWmBoqO.js} +8 -8
- package/dist/{index.es-CiqbARoC.js → index.es-Bx1E5MPK.js} +4 -4
- package/dist/{index.es-fnFnw2P1.js → index.es-CPqaUyn3.js} +10 -10
- package/dist/{index.es-25EARqhH.js → index.es-CUuzYysw.js} +4 -4
- package/dist/{index.es-DntoATwO.js → index.es-CbBdaRO2.js} +2 -2
- package/dist/{index.es-8GOVkuo-.js → index.es-CqgVUhln.js} +3 -3
- package/dist/{index.es-BNHI3ZIK.js → index.es-CzUKBF7E.js} +10 -10
- package/dist/{index.es-D-CKRzIB.js → index.es-D-ph6ImM.js} +1 -1
- package/dist/{index.es-6TJ1S8Jr.js → index.es-DDo_AHL0.js} +7 -7
- package/dist/{index.es-3043KTnb.js → index.es-DErA6zWG.js} +2 -2
- package/dist/{index.es-h2lMdt7G.js → index.es-DF11ERDs.js} +2 -2
- package/dist/{index.es-B-_jXDuz.js → index.es-DMGNht46.js} +1 -1
- package/dist/{index.es-Dvj_qpAp.js → index.es-DOX4XTz_.js} +2 -2
- package/dist/index.es-DlzwTKbh.js +311 -0
- package/dist/{index.es-CL_Heu1n.js → index.es-DxDU9C_B.js} +1 -1
- package/dist/{index.es-0lQcz8m1.js → index.es-Kg9soDed.js} +3 -3
- package/dist/{index.es-41ztjcFT.js → index.es-U5-b20Gv.js} +4 -4
- package/dist/{index.es-BvrQnJ3j.js → index.es-oOD85ZwA.js} +4 -4
- package/dist/{index.es-D6N-XWHe.js → index.es-zQBuWUgU.js} +2 -2
- package/dist/{isEmpty-B4GG2s-V.js → isEmpty-DsdC9UUD.js} +2 -2
- package/dist/main.d.ts +1 -0
- package/dist/main.js +66 -64
- package/dist/omit-1Eom1PmQ.js +366 -0
- package/dist/{orderBy-Bd48bw88.js → orderBy-CyjsW2ET.js} +31 -30
- package/dist/types/GenericTable.d.ts +9 -0
- package/dist/types/ListElement.d.ts +23 -9
- package/package.json +1 -1
- package/dist/ListAreaService-BVtuBN0K.js +0 -110
- package/dist/_baseIsEqual-D0Dsajdb.js +0 -317
- package/dist/identity-DLWZln-X.js +0 -1763
- package/dist/index.es-da0cf7oE.js +0 -569
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._menu_1xwk3_1{width:15.875rem}._icon_1xwk3_5{color:var(--lmnt-theme-on-secondary-inactive)}._listItem_1xwk3_9 [class*=mdc-list-item__start]{color:var(--lmnt-theme-on-secondary-inactive);align-self:center!important;margin:0 1rem!important}._listItem_1xwk3_9 [class*=mdc-list-item__end]{color:var(--lmnt-theme-on-secondary-inactive)}._offlineViewMargin_1xwk3_19{margin:.5rem}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._fullWidth_v1ae9_1{width:100%}._mainElevation_v1ae9_5{background:var(--lmnt-theme-background);border-radius:.5rem;width:100%}._searchbar_v1ae9_11 div{border:none}._searchbar_v1ae9_11 button{margin-right:.5rem}._roundedBottom_v1ae9_19{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}._primaryText_v1ae9_24 [class*=mdc-list-item__primary-text]{display:none!important}._list_v1ae9_28{padding-top:0;padding-bottom:0;overflow-y:auto}._list_v1ae9_28 [class*=mdc-list-item__overline-text]{margin-bottom:-2.25rem}._list_v1ae9_28::-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_v1ae9_28::-webkit-scrollbar{width:.5rem;background-color:var(--lmnt-theme-background)}._list_v1ae9_28::-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_v1ae9_56{border-bottom:.0775rem solid var(--lmnt-utility-gray-surface)}._listItem_v1ae9_56 i:not(._trailingIcon_v1ae9_60){color:var(--lmnt-theme-on-surface-inactive)}._listItem_v1ae9_56 i._trailingIcon_v1ae9_60{color:var(--lmnt-theme-on-surface-disabled)}._listItem_v1ae9_56 [class^=mdc-list-item__start]{margin:0 1rem!important;align-self:center!important}._groupedListItem_v1ae9_72{height:4.5rem!important}._noGroupHeaderMargin_v1ae9_76 h3{margin:0}._indentGroupedElement_v1ae9_80{padding-left:2.5rem!important}._isNotSelected_v1ae9_84 [class*=mdc-list-item__ripple]:before{opacity:inherit!important;background-color:inherit!important}._isSelected_v1ae9_89 [class*=mdc-list-item__ripple]:before{opacity:.2!important;background-color:var(--lmnt-theme-primary)!important}._iconColor_v1ae9_94{color:var(--lmnt-theme-on-surface-disabled)!important}._overlineTitle_v1ae9_98 [class*=mdc-list-item__overline-text]{color:var(--lmnt-theme-on-surface-inactive)!important;line-height:1rem!important}._noOverlineTitle_v1ae9_103 [class*=mdc-list-item__secondary-text] [class*=lmnt-group]{margin-top:-.875rem}._truncate_v1ae9_107{display:-webkit-box!important;line-clamp:2;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;max-width:100%;word-break:break-all}._truncateOverlineText_v1ae9_118{margin-bottom:-1rem!important;margin-top:-1rem!important}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._gap_18we6_1{gap:.125rem!important}._container_18we6_5{border-radius:.5rem;padding:2.5rem 2rem;width:auto}._bgWhite_18we6_11{background:var(--lmnt-theme-surface);color:var(--lmnt-theme-on-surface-active)}._bgGrey_18we6_16{background:var(--lmnt-theme-surface-variant);color:var(--lmnt-theme-on-surface-active)}._subtitle_18we6_21{color:var(--on-colors-on-surface-inactive-medium, #000000BA);font-weight:500}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../../index.es-
|
|
3
|
-
import "../../index.es-
|
|
4
|
-
import "../../index.es
|
|
5
|
-
import { A as e } from "../../AlertBanner-
|
|
2
|
+
import "../../index.es-CbBdaRO2.js";
|
|
3
|
+
import "../../index.es-DErA6zWG.js";
|
|
4
|
+
import "../../index.es--yyG47az.js";
|
|
5
|
+
import { A as e } from "../../AlertBanner-JnX0tJGC.js";
|
|
6
6
|
export {
|
|
7
7
|
e as AlertBanner
|
|
8
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, Fragment as m } from "react/jsx-runtime";
|
|
2
2
|
import { a as t, s } from "../../react.esm-CX1WJ2Pp.js";
|
|
3
3
|
import { a as o } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
4
|
-
import { A as n } from "../../AlertBanner-
|
|
4
|
+
import { A as n } from "../../AlertBanner-JnX0tJGC.js";
|
|
5
5
|
import { d as p, b as c, a as l, t as r, g as a } from "../../vi.CjhMlMwf-CKxPQtd6.js";
|
|
6
6
|
p("AlertBanner Test", () => {
|
|
7
7
|
c(() => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import { G as l } from "../../index.es-
|
|
3
|
-
import { T as s } from "../../index.es
|
|
2
|
+
import { G as l } from "../../index.es-CbBdaRO2.js";
|
|
3
|
+
import { T as s } from "../../index.es--yyG47az.js";
|
|
4
4
|
import { Iconify as p } from "../Iconify/Iconify.js";
|
|
5
|
-
import { A as m, s as c } from "../../AlertBanner-
|
|
5
|
+
import { A as m, s as c } from "../../AlertBanner-JnX0tJGC.js";
|
|
6
6
|
const g = ({
|
|
7
7
|
text: n,
|
|
8
8
|
color: o = "info",
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { BaseListElement } from '../../types/ListElement';
|
|
2
2
|
import { LinkProps } from '../../types/internal/ReactRouterTypes';
|
|
3
|
+
import { OfflineViewProps } from '../OfflineView/OfflineView';
|
|
3
4
|
|
|
4
5
|
type BaseViewProps = {
|
|
5
6
|
/**
|
|
6
7
|
* elements to be displayed in the list area
|
|
7
8
|
*/
|
|
8
9
|
elements: BaseListElement[];
|
|
10
|
+
/**
|
|
11
|
+
* isGrouped is true if the list should be grouped, @default false
|
|
12
|
+
*/
|
|
13
|
+
isGrouped?: boolean;
|
|
9
14
|
/**
|
|
10
15
|
* text to be displayed when the list is empty
|
|
11
16
|
*/
|
|
@@ -50,6 +55,14 @@ type BaseViewProps = {
|
|
|
50
55
|
* searchPlaceholder is the placeholder of the search input, @default ''
|
|
51
56
|
*/
|
|
52
57
|
searchPlaceholder?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the user is online; shows OfflineView when false.
|
|
60
|
+
*/
|
|
61
|
+
isOnline?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Props forwarded to <OfflineView /> when offline.
|
|
64
|
+
*/
|
|
65
|
+
offlineViewProps?: Partial<OfflineViewProps>;
|
|
53
66
|
/**
|
|
54
67
|
* routerLinkElement is the element to be used for the elements link, use react-router Link component for the best experience.
|
|
55
68
|
* If the element has `noNavigation=false` and the `routerLinkElement` is undefined an `<a>` tag is used.
|
|
@@ -62,5 +75,5 @@ type BaseViewProps = {
|
|
|
62
75
|
/**
|
|
63
76
|
* `BaseView` is a layout component that displays a main (a list) and a detail section.
|
|
64
77
|
*/
|
|
65
|
-
export declare const BaseView: ({ heading, action, hint, elements, emptyText, hasSearch, isSorted, className, withAvatar, listMaxHeight, pathname, routerLinkElement, searchPlaceholder, }: BaseViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
export declare const BaseView: ({ heading, action, hint, elements, emptyText, hasSearch, isSorted, className, withAvatar, listMaxHeight, pathname, isOnline, offlineViewProps, routerLinkElement, searchPlaceholder, isGrouped }: BaseViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
66
79
|
export {};
|
|
@@ -1,70 +1,75 @@
|
|
|
1
1
|
import { jsx as i, Fragment as d, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { G as r } from "../../index.es-
|
|
2
|
+
import { G as r } from "../../index.es-CbBdaRO2.js";
|
|
3
3
|
import { useMemo as a } from "react";
|
|
4
|
-
import { BasicHeading as
|
|
5
|
-
import { EmptyView as
|
|
6
|
-
import { ListArea as
|
|
7
|
-
import { u as
|
|
8
|
-
import { VerticalDivider as
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
4
|
+
import { BasicHeading as h } from "../BasicHeading/BasicHeading.js";
|
|
5
|
+
import { EmptyView as N } from "../EmptyView/EmptyView.js";
|
|
6
|
+
import { ListArea as A } from "../ListArea/ListArea.js";
|
|
7
|
+
import { u as H } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
8
|
+
import { VerticalDivider as V } from "../VerticalDivider/VerticalDivider.js";
|
|
9
|
+
import { O as j } from "../../OfflineView-HbuDPpQL.js";
|
|
10
|
+
import '../../assets/BaseView.css';const E = "_parentGroup_w7vsz_1", I = "_divider_w7vsz_5", $ = "_maxWidth_w7vsz_10", y = "_desktopList_w7vsz_14", F = "_mobileList_w7vsz_19", M = "_desktopDetail_w7vsz_23", O = "_mobileDetail_w7vsz_28", o = {
|
|
11
|
+
parentGroup: E,
|
|
12
|
+
divider: I,
|
|
13
|
+
maxWidth: $,
|
|
14
|
+
desktopList: y,
|
|
15
|
+
mobileList: F,
|
|
16
|
+
desktopDetail: M,
|
|
17
|
+
mobileDetail: O
|
|
18
|
+
}, X = ({
|
|
18
19
|
heading: c,
|
|
19
20
|
action: m = /* @__PURE__ */ i(d, {}),
|
|
20
|
-
hint:
|
|
21
|
+
hint: _ = /* @__PURE__ */ i(d, {}),
|
|
21
22
|
elements: n,
|
|
22
|
-
emptyText:
|
|
23
|
-
hasSearch:
|
|
24
|
-
isSorted:
|
|
25
|
-
className:
|
|
26
|
-
withAvatar:
|
|
27
|
-
listMaxHeight:
|
|
23
|
+
emptyText: u,
|
|
24
|
+
hasSearch: f = !0,
|
|
25
|
+
isSorted: b = !0,
|
|
26
|
+
className: g,
|
|
27
|
+
withAvatar: w = !1,
|
|
28
|
+
listMaxHeight: D = "calc(100vh - 200px)",
|
|
28
29
|
pathname: l,
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
isOnline: p = !0,
|
|
31
|
+
offlineViewProps: v,
|
|
32
|
+
routerLinkElement: k,
|
|
33
|
+
searchPlaceholder: L,
|
|
34
|
+
isGrouped: x = !1
|
|
31
35
|
}) => {
|
|
32
|
-
const { isDesktopNavbar: e } =
|
|
36
|
+
const { isDesktopNavbar: e } = H(), t = a(() => n.find((G) => G.route === l), [l, n]), W = a(() => p ? t?.component ?? (e ? /* @__PURE__ */ i(N, { subtitle: u }) : /* @__PURE__ */ i(d, {})) : /* @__PURE__ */ i(j, { ...v, fullWidth: !0 }), [t?.component, u, e, p, v]), z = a(() => e ? !0 : !t, [t, e]), B = a(() => e ? !0 : t, [t, e]);
|
|
33
37
|
return /* @__PURE__ */ s(
|
|
34
38
|
r,
|
|
35
39
|
{
|
|
36
40
|
"data-testid": "base-view-container",
|
|
37
|
-
className: `${o.parentGroup} ${
|
|
41
|
+
className: `${o.parentGroup} ${g ?? ""}`,
|
|
38
42
|
gap: "none",
|
|
39
43
|
fullWidth: !0,
|
|
40
44
|
children: [
|
|
41
|
-
|
|
42
|
-
c && /* @__PURE__ */ i(
|
|
43
|
-
|
|
45
|
+
z && /* @__PURE__ */ i(r, { gap: "none", className: e ? o.desktopList : o.mobileList, children: /* @__PURE__ */ s(r, { direction: "vertical", fullWidth: !0, gap: e ? "standard" : "dense", children: [
|
|
46
|
+
c && /* @__PURE__ */ i(h, { "data-testid": "heading", heading: c, level: 4, marginBottom: 0, children: m }),
|
|
47
|
+
_,
|
|
44
48
|
/* @__PURE__ */ i(
|
|
45
|
-
|
|
49
|
+
A,
|
|
46
50
|
{
|
|
47
51
|
elements: n,
|
|
48
|
-
hasSearch:
|
|
49
|
-
maxHeight:
|
|
50
|
-
isSorted:
|
|
52
|
+
hasSearch: f,
|
|
53
|
+
maxHeight: D,
|
|
54
|
+
isSorted: b,
|
|
51
55
|
pathname: l,
|
|
52
|
-
routerLinkElement:
|
|
53
|
-
searchPlaceholder:
|
|
56
|
+
routerLinkElement: k,
|
|
57
|
+
searchPlaceholder: L,
|
|
58
|
+
isGrouped: x
|
|
54
59
|
}
|
|
55
60
|
)
|
|
56
61
|
] }) }),
|
|
57
|
-
|
|
62
|
+
B && /* @__PURE__ */ s(
|
|
58
63
|
r,
|
|
59
64
|
{
|
|
60
65
|
"data-testid": "details",
|
|
61
66
|
gap: "none",
|
|
62
67
|
className: e ? o.desktopDetail : o.mobileDetail,
|
|
63
68
|
children: [
|
|
64
|
-
e && /* @__PURE__ */ i(
|
|
69
|
+
e && /* @__PURE__ */ i(V, { className: o.divider, height: "100%" }),
|
|
65
70
|
/* @__PURE__ */ s(r, { direction: "vertical", fullWidth: !0, children: [
|
|
66
71
|
/* @__PURE__ */ i(
|
|
67
|
-
|
|
72
|
+
h,
|
|
68
73
|
{
|
|
69
74
|
className: o.maxWidth,
|
|
70
75
|
heading: t?.detailTitle ?? t?.title ?? "",
|
|
@@ -72,11 +77,12 @@ import '../../assets/BaseView.css';const A = "_parentGroup_w7vsz_1", V = "_divid
|
|
|
72
77
|
icon: t?.hideIconInDetail === !0 ? void 0 : t?.icon,
|
|
73
78
|
marginBottom: 0,
|
|
74
79
|
invisibleButton: t?.detailAction === void 0,
|
|
75
|
-
withAvatar:
|
|
80
|
+
withAvatar: w,
|
|
81
|
+
subHeading: t?.detailSubTitle,
|
|
76
82
|
children: t?.detailAction ?? m
|
|
77
83
|
}
|
|
78
84
|
),
|
|
79
|
-
|
|
85
|
+
W
|
|
80
86
|
] })
|
|
81
87
|
]
|
|
82
88
|
}
|
|
@@ -86,5 +92,5 @@ import '../../assets/BaseView.css';const A = "_parentGroup_w7vsz_1", V = "_divid
|
|
|
86
92
|
);
|
|
87
93
|
};
|
|
88
94
|
export {
|
|
89
|
-
|
|
95
|
+
X as BaseView
|
|
90
96
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { a as
|
|
1
|
+
import { jsx as o, Fragment as s } from "react/jsx-runtime";
|
|
2
|
+
import { a as n, s as e, f as p } from "../../react.esm-CX1WJ2Pp.js";
|
|
3
3
|
import { a as l } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
4
|
-
import { BaseView as
|
|
5
|
-
import { d as u, b as
|
|
4
|
+
import { BaseView as r } from "./BaseView.js";
|
|
5
|
+
import { d as u, b as f, a as c, t as i, g as t } from "../../vi.CjhMlMwf-CKxPQtd6.js";
|
|
6
6
|
u("BaseView Test", () => {
|
|
7
|
-
|
|
7
|
+
f(() => {
|
|
8
8
|
c.spyOn(l, "useBreakpoints").mockReturnValue({
|
|
9
9
|
isMobile: !1,
|
|
10
10
|
isTablet: !1,
|
|
@@ -12,20 +12,20 @@ u("BaseView Test", () => {
|
|
|
12
12
|
isDesktopNavbar: !0
|
|
13
13
|
});
|
|
14
14
|
});
|
|
15
|
-
const
|
|
15
|
+
const a = [
|
|
16
16
|
{
|
|
17
17
|
id: "1",
|
|
18
18
|
title: "user.personal_information",
|
|
19
19
|
icon: "account_circle",
|
|
20
20
|
route: "/personal-profile/personal-information",
|
|
21
|
-
component: /* @__PURE__ */
|
|
21
|
+
component: /* @__PURE__ */ o(s, { children: "Personal information selected" })
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
id: "2",
|
|
25
25
|
title: "user.data_privacy",
|
|
26
26
|
icon: "privacy_tip",
|
|
27
27
|
route: "/personal-profile/data-privacy",
|
|
28
|
-
component: /* @__PURE__ */
|
|
28
|
+
component: /* @__PURE__ */ o(s, { children: "Data Privacy selected" }),
|
|
29
29
|
detailTitle: "Data Privacy 2000",
|
|
30
30
|
hideIconInDetail: !0
|
|
31
31
|
},
|
|
@@ -34,16 +34,16 @@ u("BaseView Test", () => {
|
|
|
34
34
|
title: "user.security",
|
|
35
35
|
icon: "security",
|
|
36
36
|
route: "/personal-profile/security",
|
|
37
|
-
component: /* @__PURE__ */
|
|
37
|
+
component: /* @__PURE__ */ o(s, { children: "Security selected" })
|
|
38
38
|
}
|
|
39
39
|
];
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
40
|
+
i("render BaseView with empty view and navigation list", () => {
|
|
41
|
+
n(
|
|
42
|
+
/* @__PURE__ */ o(
|
|
43
|
+
r,
|
|
44
44
|
{
|
|
45
45
|
pathname: "/personal-profile",
|
|
46
|
-
elements:
|
|
46
|
+
elements: a,
|
|
47
47
|
heading: "user.personal-profile",
|
|
48
48
|
hasSearch: !1,
|
|
49
49
|
emptyText: "user.noselection",
|
|
@@ -52,13 +52,13 @@ u("BaseView Test", () => {
|
|
|
52
52
|
}
|
|
53
53
|
)
|
|
54
54
|
), t(e.getByText("user.noselection")).toBeInTheDocument(), t(e.getByText("user.personal-profile")).toBeInTheDocument(), t(e.getByText("user.personal_information")).toBeInTheDocument(), t(e.getByText("user.data_privacy")).toBeInTheDocument(), t(e.getByText("user.security")).toBeInTheDocument();
|
|
55
|
-
}),
|
|
56
|
-
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
55
|
+
}), i("render BaseView with data and navigation list", () => {
|
|
56
|
+
n(
|
|
57
|
+
/* @__PURE__ */ o(
|
|
58
|
+
r,
|
|
59
59
|
{
|
|
60
60
|
pathname: "/personal-profile/personal-information",
|
|
61
|
-
elements:
|
|
61
|
+
elements: a,
|
|
62
62
|
heading: "user.personal-profile",
|
|
63
63
|
hasSearch: !1,
|
|
64
64
|
emptyText: "user.noselection",
|
|
@@ -67,13 +67,13 @@ u("BaseView Test", () => {
|
|
|
67
67
|
}
|
|
68
68
|
)
|
|
69
69
|
), t(e.getByText("Personal information selected")).toBeInTheDocument(), t(e.getAllByText("account_circle")).toHaveLength(2), t(e.getAllByText("user.personal_information")).toHaveLength(2);
|
|
70
|
-
}),
|
|
71
|
-
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
|
|
70
|
+
}), i("render BaseView with custom detail title and no detail icon", () => {
|
|
71
|
+
n(
|
|
72
|
+
/* @__PURE__ */ o(
|
|
73
|
+
r,
|
|
74
74
|
{
|
|
75
75
|
pathname: "/personal-profile/data-privacy",
|
|
76
|
-
elements:
|
|
76
|
+
elements: a,
|
|
77
77
|
heading: "user.personal-profile",
|
|
78
78
|
hasSearch: !1,
|
|
79
79
|
emptyText: "user.noselection",
|
|
@@ -82,18 +82,18 @@ u("BaseView Test", () => {
|
|
|
82
82
|
}
|
|
83
83
|
)
|
|
84
84
|
), t(e.getByText("Data Privacy selected")).toBeInTheDocument(), t(e.getByText("Data Privacy 2000")).toBeInTheDocument(), t(e.getAllByText("privacy_tip")).toHaveLength(1), t(e.getAllByText("user.data_privacy")).toHaveLength(1);
|
|
85
|
-
}),
|
|
85
|
+
}), i("hide empty view when screen is small", () => {
|
|
86
86
|
c.spyOn(l, "useBreakpoints").mockReturnValue({
|
|
87
87
|
isMobile: !0,
|
|
88
88
|
isTablet: !1,
|
|
89
89
|
isDesktop: !1,
|
|
90
90
|
isDesktopNavbar: !1
|
|
91
|
-
}),
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
|
|
91
|
+
}), n(
|
|
92
|
+
/* @__PURE__ */ o(
|
|
93
|
+
r,
|
|
94
94
|
{
|
|
95
95
|
pathname: "/personal-profile/data-privacy",
|
|
96
|
-
elements:
|
|
96
|
+
elements: a,
|
|
97
97
|
heading: "user.personal-profile",
|
|
98
98
|
hasSearch: !1,
|
|
99
99
|
emptyText: "user.noselection",
|
|
@@ -102,13 +102,13 @@ u("BaseView Test", () => {
|
|
|
102
102
|
}
|
|
103
103
|
)
|
|
104
104
|
), t(e.queryByText("user.noselection")).not.toBeInTheDocument();
|
|
105
|
-
}),
|
|
106
|
-
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
|
|
105
|
+
}), i("render BaseView with selected detail section", () => {
|
|
106
|
+
n(
|
|
107
|
+
/* @__PURE__ */ o(
|
|
108
|
+
r,
|
|
109
109
|
{
|
|
110
110
|
pathname: "/personal-profile/data-privacy",
|
|
111
|
-
elements:
|
|
111
|
+
elements: a,
|
|
112
112
|
heading: "user.personal-profile",
|
|
113
113
|
hasSearch: !1,
|
|
114
114
|
emptyText: "user.noselection",
|
|
@@ -117,5 +117,22 @@ u("BaseView Test", () => {
|
|
|
117
117
|
}
|
|
118
118
|
)
|
|
119
119
|
), p.click(e.getAllByRole("option")[1]), t(e.getByText("Data Privacy selected")).toBeInTheDocument();
|
|
120
|
+
}), i("renders only offline view when offline", () => {
|
|
121
|
+
n(
|
|
122
|
+
/* @__PURE__ */ o(
|
|
123
|
+
r,
|
|
124
|
+
{
|
|
125
|
+
pathname: "/personal-profile/personal-information",
|
|
126
|
+
elements: a,
|
|
127
|
+
heading: "user.personal-profile",
|
|
128
|
+
hasSearch: !1,
|
|
129
|
+
emptyText: "user.noselection",
|
|
130
|
+
isSorted: !1,
|
|
131
|
+
isOnline: !1,
|
|
132
|
+
offlineViewProps: { "data-testid": "offline-test" },
|
|
133
|
+
routerLinkElement: void 0
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
), t(e.queryByText("Personal information selected")).not.toBeInTheDocument(), t(e.getByTestId("offline-test")).toBeInTheDocument();
|
|
120
137
|
});
|
|
121
138
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as o, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { I as u } from "../../index.es-
|
|
3
|
-
import { b as y, T as C } from "../../index.es
|
|
2
|
+
import { I as u } from "../../index.es-DErA6zWG.js";
|
|
3
|
+
import { b as y, T as C } from "../../index.es--yyG47az.js";
|
|
4
4
|
import { Iconify as w } from "../Iconify/Iconify.js";
|
|
5
5
|
import { AvailableCustomIcons as j } from "../../enums/AvailableCustomIcons.js";
|
|
6
6
|
import { u as I } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o, Fragment as c } from "react/jsx-runtime";
|
|
2
|
-
import { B as g } from "../../index.es-
|
|
2
|
+
import { B as g } from "../../index.es-Bx1E5MPK.js";
|
|
3
3
|
import { a, s as n } from "../../react.esm-CX1WJ2Pp.js";
|
|
4
4
|
import { BasicHeading as i } from "./BasicHeading.js";
|
|
5
5
|
import { d as h, t as s, g as e } from "../../vi.CjhMlMwf-CKxPQtd6.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as v, jsx as t, Fragment as h } from "react/jsx-runtime";
|
|
2
|
-
import { d as C, b as R, a as B } from "../../index.es
|
|
2
|
+
import { d as C, b as R, a as B } from "../../index.es--yyG47az.js";
|
|
3
3
|
import { useState as A, useEffect as D, useMemo as S } from "react";
|
|
4
4
|
import { getBlockNumberByDto as F } from "../../services/BlockService.js";
|
|
5
5
|
import '../../assets/BlockView.css';const M = "_grid_17o13_1", V = "_black_17o13_11", j = "_blockLayout_17o13_15", q = "_blockRow_17o13_26", G = "_block_17o13_15", H = "_active_17o13_45", I = "_error_17o13_51", J = "_empty_17o13_57", K = "_blockText_17o13_61", O = "_emptyLayout_17o13_70", o = {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as lt } from "react/jsx-runtime";
|
|
2
|
-
import { o as Ut, e as jt, i as qt, C as $t } from "../../index.es-
|
|
3
|
-
import { _ as Kt, c as ut, P as l } from "../../
|
|
2
|
+
import { o as Ut, e as jt, i as qt, C as $t } from "../../index.es-DDo_AHL0.js";
|
|
3
|
+
import { _ as Kt, c as ut, P as l } from "../../_setToString-Do1lSQTZ.js";
|
|
4
4
|
import C, { useEffect as ft, useState as $, useMemo as ht, useCallback as I, useRef as Mt, forwardRef as Xt, useImperativeHandle as zt } from "react";
|
|
5
|
-
import { u as Jt, f as Qt, h as Zt } from "../../index.es-
|
|
5
|
+
import { u as Jt, f as Qt, h as Zt } from "../../index.es-DlzwTKbh.js";
|
|
6
6
|
import { e as te, c as A, b as U } from "../../tslib.es6-BDCynO9F.js";
|
|
7
7
|
import { M as _t, a as Et } from "../../component-neHBNHRu.js";
|
|
8
8
|
import { M as et, b as kt } from "../../component-DsB0poTj.js";
|
|
9
9
|
import { n as ee, i as ie, K as L } from "../../keyboard-Bpt0aBqQ.js";
|
|
10
|
-
import { I as Rt } from "../../index.es-
|
|
10
|
+
import { I as Rt } from "../../index.es-DErA6zWG.js";
|
|
11
11
|
import { g as ne } from "../../_commonjsHelpers-BkfeUUK-.js";
|
|
12
12
|
import { b as oe } from "../../isArray-DN9s620O.js";
|
|
13
13
|
import { OverflowTooltip as re } from "../OverflowTooltip/OverflowTooltip.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ListItemProps } from '@element-public/react-list';
|
|
2
|
+
import { OfflineViewProps } from '../OfflineView/OfflineView';
|
|
2
3
|
|
|
3
4
|
type ContextMenuProps = {
|
|
4
5
|
/**
|
|
@@ -19,6 +20,14 @@ type ContextMenuProps = {
|
|
|
19
20
|
* data-testid for testing
|
|
20
21
|
*/
|
|
21
22
|
'data-testid'?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the user is online; shows OfflineView when false.
|
|
25
|
+
*/
|
|
26
|
+
isOnline?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Props forwarded to <OfflineView /> when offline.
|
|
29
|
+
*/
|
|
30
|
+
offlineViewProps?: Partial<OfflineViewProps>;
|
|
22
31
|
};
|
|
23
32
|
export type ActionProps = ListItemProps & {
|
|
24
33
|
closeOnClick?: boolean;
|
|
@@ -35,7 +44,9 @@ export type ActionProps = ListItemProps & {
|
|
|
35
44
|
* { primaryText: 'Delete', onClick: () => DeleteSomeThing(), leadingBlock: 'delete_outline'},
|
|
36
45
|
* { primaryText: 'Edit', onClick: () => EditSomeThing(), leadingBlock: 'edit'},
|
|
37
46
|
* ];
|
|
47
|
+
* @param {boolean} isOnline Whether the user is online; shows OfflineView when false.
|
|
48
|
+
* @param {OfflineViewProps} offlineViewProps Props forwarded to OfflineView when offline.
|
|
38
49
|
* @returns a context menu with the given actions as ListItems
|
|
39
50
|
*/
|
|
40
|
-
export declare const ContextMenu: ({ triggerOpen, actions, iconOrientation, "data-testid": dataTestId, }: ContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare const ContextMenu: ({ triggerOpen, actions, iconOrientation, "data-testid": dataTestId, isOnline, offlineViewProps, }: ContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
52
|
export {};
|
|
@@ -1,48 +1,52 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { I as
|
|
3
|
-
import { M as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { u as
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { I as _ } from "../../index.es-Kg9soDed.js";
|
|
3
|
+
import { M as k, L as p, a as w } from "../../index.es-CPqaUyn3.js";
|
|
4
|
+
import { useState as I, useCallback as a, useEffect as M } from "react";
|
|
5
|
+
import { u as x } from "../../uniqueId-NU3-C36A.js";
|
|
6
|
+
import { O as C } from "../../OfflineView-HbuDPpQL.js";
|
|
7
|
+
import '../../assets/ContextMenu.css';const v = "_menu_1xwk3_1", y = "_icon_1xwk3_5", V = "_listItem_1xwk3_9", g = "_offlineViewMargin_1xwk3_19", s = {
|
|
8
|
+
menu: v,
|
|
8
9
|
icon: y,
|
|
9
|
-
listItem:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
10
|
+
listItem: V,
|
|
11
|
+
offlineViewMargin: g
|
|
12
|
+
}, b = ({
|
|
13
|
+
triggerOpen: o = null,
|
|
14
|
+
actions: r,
|
|
15
|
+
iconOrientation: c = "vertical",
|
|
16
|
+
"data-testid": m,
|
|
17
|
+
isOnline: f = !0,
|
|
18
|
+
offlineViewProps: u
|
|
15
19
|
}) => {
|
|
16
|
-
const [
|
|
17
|
-
|
|
18
|
-
}, [
|
|
19
|
-
|
|
20
|
+
const [i, n] = I(!1), d = a(() => {
|
|
21
|
+
n(!i);
|
|
22
|
+
}, [i]), l = a(() => {
|
|
23
|
+
n(!1);
|
|
20
24
|
}, []);
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
|
|
25
|
+
return M(() => {
|
|
26
|
+
n(o !== null ? o : !1);
|
|
27
|
+
}, [o]), /* @__PURE__ */ t(
|
|
28
|
+
k,
|
|
25
29
|
{
|
|
26
|
-
className:
|
|
27
|
-
"data-testid":
|
|
28
|
-
open:
|
|
30
|
+
className: s.menu,
|
|
31
|
+
"data-testid": m ?? "selection-menu",
|
|
32
|
+
open: i,
|
|
29
33
|
surfaceOnly: !0,
|
|
30
34
|
hoistToBody: !0,
|
|
31
35
|
onClose: l,
|
|
32
|
-
trigger: /* @__PURE__ */
|
|
33
|
-
|
|
36
|
+
trigger: /* @__PURE__ */ t(
|
|
37
|
+
_,
|
|
34
38
|
{
|
|
35
|
-
className:
|
|
36
|
-
variant:
|
|
39
|
+
className: s.icon,
|
|
40
|
+
variant: i ? "filled-primary" : void 0,
|
|
37
41
|
"data-testid": "open-button",
|
|
38
|
-
icon:
|
|
39
|
-
onClick:
|
|
42
|
+
icon: c === "vertical" ? "more_vert" : "more_horiz",
|
|
43
|
+
onClick: d
|
|
40
44
|
}
|
|
41
45
|
),
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
-
|
|
46
|
+
children: f ? /* @__PURE__ */ t(p, { "data-testid": "selection-list", children: r.map((e) => /* @__PURE__ */ t(
|
|
47
|
+
w,
|
|
44
48
|
{
|
|
45
|
-
className:
|
|
49
|
+
className: s.listItem,
|
|
46
50
|
...e,
|
|
47
51
|
leadingBlockType: "icon",
|
|
48
52
|
"data-testid": e["data-testid"],
|
|
@@ -50,12 +54,12 @@ import '../../assets/ContextMenu.css';const k = "_menu_ol91v_1", y = "_icon_ol91
|
|
|
50
54
|
e?.onClick?.(), e.closeOnClick !== !1 && l();
|
|
51
55
|
}
|
|
52
56
|
},
|
|
53
|
-
|
|
54
|
-
)) })
|
|
57
|
+
x(`LI_${e.primaryText?.toString()}_`)
|
|
58
|
+
)) }) : /* @__PURE__ */ t(C, { size: "small", variant: "filled", className: s.offlineViewMargin, ...u })
|
|
55
59
|
},
|
|
56
60
|
"selectionmenu"
|
|
57
61
|
);
|
|
58
62
|
};
|
|
59
63
|
export {
|
|
60
|
-
|
|
64
|
+
b as ContextMenu
|
|
61
65
|
};
|