@hortiview/shared-components 2.17.0 → 2.18.1
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 +20 -0
- package/dist/{AlertBanner-aW6joVUm.js → AlertBanner-BFzaGOer.js} +3 -3
- package/dist/{GenericCard-IWX-Bmb_.js → GenericCard-grpa3KJR.js} +3 -3
- package/dist/{ListAreaService-Fsm3-gDM.js → ListAreaService-DfxJ7jFs.js} +5 -5
- package/dist/{_Map-D8db_GOu.js → _Map-BYxTn6ob.js} +1 -1
- package/dist/{_commonjsHelpers-B4e78b8K.js → _commonjsHelpers-ByX85dGu.js} +18 -13
- package/dist/animationframe-CqXArbwZ.js +32 -0
- package/dist/component-By6nyiBU.js +70 -0
- package/dist/{component-DEJuY56h.js → component-DYpB_4EP.js} +1 -111
- package/dist/components/AlertBanner/AlertBanner.js +4 -4
- package/dist/components/AlertBanner/LinkBanner.js +3 -3
- package/dist/components/AllowedButton/AllowedButton.js +1 -1
- package/dist/components/AllowedIconButton/AllowedIconButton.js +1 -1
- package/dist/components/BaseView/BaseView.js +14 -14
- package/dist/components/BasicHeading/BasicHeading.js +5 -5
- package/dist/components/BlockView/BlockView.js +2 -2
- package/dist/components/ButtonCard/ButtonCard.js +6 -6
- package/dist/components/ChipCard/ChipCard.js +13 -255
- package/dist/components/ConfirmationModal/ConfirmationModal.js +8 -8
- package/dist/components/ContextMenu/ContextMenu.js +12 -12
- package/dist/components/DeleteModal/DeleteModal.js +25 -25
- package/dist/components/DetailContentWrapper/DetailContentWrapper.js +1 -1
- package/dist/components/Disclaimer/Disclaimer.js +3 -3
- package/dist/components/EmptyView/EmptyView.js +3 -3
- package/dist/components/Filter/Filter.js +15 -15
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +1 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +7 -22
- package/dist/components/FormComponents/FormNumber/CustomTextField.js +3 -3
- package/dist/components/FormComponents/FormNumber/FormNumber.js +1 -1
- package/dist/components/FormComponents/FormRadio/FormRadio.js +1 -1
- package/dist/components/FormComponents/FormSelect/FormSelect.d.ts +2 -2
- package/dist/components/FormComponents/FormSelect/FormSelect.js +73 -72
- package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +2 -2
- package/dist/components/FormComponents/FormSlider/FormSlider.js +10 -98
- package/dist/components/FormComponents/FormText/FormText.js +2 -2
- package/dist/components/FormComponents/FormToggle/FormToggle.js +4 -4
- package/dist/components/FormattedNumberDisplay/FormattedNumberDisplay.js +1 -1
- package/dist/components/GenericTable/GenericTable.js +36 -172
- package/dist/components/GenericTable/Mobile/GenericCard.js +4 -4
- package/dist/components/GenericTable/Mobile/GenericCardList.js +4 -4
- package/dist/components/HashTabView/HashTabView.js +10 -428
- package/dist/components/HeaderFilter/HeaderFilter.js +1 -1
- package/dist/components/Iconify/Iconify.js +2 -2
- package/dist/components/InfoCard/InfoCard.js +4 -4
- package/dist/components/InfoGroup/InfoGroup.js +4 -4
- package/dist/components/ListArea/ListArea.js +6 -6
- package/dist/components/ListArea/ListAreaService.js +6 -6
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +13 -5
- package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +8 -74
- package/dist/components/Modal/Modal.js +12 -122
- package/dist/components/ModulePadding/ModulePadding.js +11 -11
- package/dist/components/OfflineView/OfflineView.js +45 -7
- package/dist/components/OnboardingBanner/OnboardingBanner.js +8 -8
- package/dist/components/OverflowTooltip/OverflowTooltip.js +2 -2
- package/dist/components/SearchBar/SearchBar.js +2 -2
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Stepper/Stepper.js +1 -1
- package/dist/components/Stepper/components/StepperButton.js +1 -1
- package/dist/components/Stepper/components/StepperHeader.js +3 -3
- package/dist/components/Stepper/components/StepperItem.js +2 -2
- package/dist/{correct-is-regexp-logic-Y0ToWEjF.js → correct-is-regexp-logic-BJ-OWRrn.js} +1 -1
- package/dist/{defineProperty-BTsGZ3c1.js → defineProperty-B7N9EBBI.js} +3 -3
- package/dist/{es.string.iterator-UszlTFwY.js → es.string.iterator-DBx2A42F.js} +2 -2
- package/dist/{find-CHg-_ooq.js → find-eU9ab_u7.js} +4 -4
- package/dist/{get-DxjPG00Z.js → get-BLvvbtML.js} +3 -3
- package/dist/get-CBFiuc3f.js +7 -0
- package/dist/hooks/useBreakpoints.js +37 -3
- package/dist/hooks/useHelperText.js +1 -1
- package/dist/{identity-BVIVr9qu.js → identity-B0bbReND.js} +4 -4
- package/dist/{index-BcGujPyk.js → index-Df2FYN-K.js} +5 -26
- package/dist/{index.es-B8p8KCdj.js → index.es-B19PQgzU.js} +4 -4
- package/dist/{index.es-BYcQTTL8.js → index.es-B9BUXRQn.js} +9 -339
- package/dist/{index.es-BPv5dCFQ.js → index.es-BOG3_7IM.js} +12 -12
- package/dist/{index.es-DGoBge9W.js → index.es-BOvO8moE.js} +4 -4
- package/dist/{index.es-BoUnovl_.js → index.es-BcnmoCEg.js} +8 -74
- package/dist/{index.es-C32E1Lcb.js → index.es-BwafUoK3.js} +82 -147
- package/dist/{index.es-B1h6DPYp.js → index.es-C27R5Xae.js} +2 -2
- package/dist/{index.es-nwjKmW7-.js → index.es-C2IOpX7R.js} +34 -111
- package/dist/{index.es-Da7ok-B-.js → index.es-C6I3L4U4.js} +2 -2
- package/dist/{index.es-BHvm4m-B.js → index.es-Cg57snrN.js} +19 -261
- package/dist/{index.es-DUTChZks.js → index.es-Ci3O23C_.js} +6 -72
- package/dist/{index.es-t87yNd9Y.js → index.es-CkB4776y.js} +6 -72
- package/dist/{index.es-CeQB6igi.js → index.es-Cr1PSTyq.js} +3 -3
- package/dist/{index.es--C-VLspF.js → index.es-D1iB_QlE.js} +8 -140
- package/dist/{index.es-Dgxrk6xW.js → index.es-DEBGoIKX.js} +2 -2
- package/dist/{index.es-CWyjqoEE.js → index.es-DHnCVuQ8.js} +7 -73
- package/dist/{index.es-Bo-d_yTV.js → index.es-DHoIQ8lu.js} +2 -2
- package/dist/{index.es-SjZ_-d7U.js → index.es-DUrjyxNI.js} +5 -5
- package/dist/{index.es-Cfv794DG.js → index.es-DdeCB7LW.js} +1 -1
- package/dist/{index.es-BanVdXEd.js → index.es-DgncYOqO.js} +2 -2
- package/dist/{index.es-DOnQ26kT.js → index.es-DhlgTSuU.js} +3 -3
- package/dist/{index.es-oxil0uFe.js → index.es-Z0aF-7Cn.js} +3 -6
- package/dist/{index.es-DmRhbgqK.js → index.es-l_3PNohs.js} +2 -68
- package/dist/{isArray-B457bpaW.js → isArray-Ce1Q96lU.js} +1 -1
- package/dist/isArray-olhCpv2e.js +7 -0
- package/dist/{isEmpty-BnfHn4bl.js → isEmpty-l2xQKl4x.js} +3 -3
- package/dist/{isString-DVA49FEo.js → isString-BNdV0Jpg.js} +3 -3
- package/dist/{isTypedArray-DziahYkI.js → isTypedArray-D39qzPYE.js} +2 -2
- package/dist/{keyboard-DiKJoabs.js → keyboard-DbG3oyPU.js} +3 -25
- package/dist/main.js +15 -15
- package/dist/{map-BprzXv4m.js → map-ZSVweMI1.js} +5 -5
- package/dist/{omit-CYY_mIYv.js → omit-BWQrFyQ-.js} +7 -7
- package/dist/{orderBy-DLBJlgdL.js → orderBy-Ce85KqD6.js} +7 -7
- package/dist/{parse-int-D-3oah_F.js → parse-int-CGpIXMGa.js} +2 -2
- package/dist/{react-number-format.es-DzkMiF8j.js → react-number-format.es-pczkQ4lQ.js} +0 -1
- package/dist/{react-tooltip.min-CVsI--2Y.js → react-tooltip.min-Dkz5ltCC.js} +1 -12
- package/dist/{react.esm-Bm0cAgpZ.js → react.esm-DF7i80eN.js} +2471 -2582
- package/dist/services/UtilService.js +9 -9
- package/dist/{slicedToArray-ByMQIs5x.js → slicedToArray-DC6VAZtW.js} +4 -4
- package/dist/test-utils.js +1 -1
- package/dist/{toString-B7FIT8FE.js → toString-D5bEU-DN.js} +1 -1
- package/dist/{uniqueId-BNVTeImh.js → uniqueId-CJo-XRQb.js} +2 -2
- package/dist/{util-DA21pZXj.js → util-CBo-ipCE.js} +0 -22
- package/package.json +2 -2
- package/dist/BigLoadingSpinner-DGj9_Z5J.js +0 -16
- package/dist/OfflineView-CIwV08EQ.js +0 -48
- package/dist/animationframe-BVKDmEXe.js +0 -54
- package/dist/component-Bz_dtX1r.js +0 -114
- package/dist/components/AlertBanner/AlertBanner.test.d.ts +0 -1
- package/dist/components/AlertBanner/AlertBanner.test.js +0 -34
- package/dist/components/AlertBanner/LinkBanner.test.d.ts +0 -1
- package/dist/components/AlertBanner/LinkBanner.test.js +0 -17
- package/dist/components/Allowed/Allowed.test.d.ts +0 -1
- package/dist/components/Allowed/Allowed.test.js +0 -49
- package/dist/components/AllowedButton/AllowedButton.test.d.ts +0 -1
- package/dist/components/AllowedButton/AllowedButton.test.js +0 -126
- package/dist/components/AllowedIconButton/AllowedIconButton.test.d.ts +0 -1
- package/dist/components/AllowedIconButton/AllowedIconButton.test.js +0 -121
- package/dist/components/BaseView/BaseView.test.d.ts +0 -1
- package/dist/components/BaseView/BaseView.test.js +0 -180
- package/dist/components/BasicHeading/BasicHeading.test.d.ts +0 -1
- package/dist/components/BasicHeading/BasicHeading.test.js +0 -36
- package/dist/components/BlockView/BlockView.test.d.ts +0 -1
- package/dist/components/BlockView/BlockView.test.js +0 -47
- package/dist/components/ButtonCard/ButtonCard.test.d.ts +0 -1
- package/dist/components/ButtonCard/ButtonCard.test.js +0 -92
- package/dist/components/ChipCard/ChipCard.test.d.ts +0 -1
- package/dist/components/ChipCard/ChipCard.test.js +0 -25
- package/dist/components/ConfirmationModal/ConfirmationModal.test.d.ts +0 -1
- package/dist/components/ConfirmationModal/ConfirmationModal.test.js +0 -221
- package/dist/components/ContextMenu/ContextMenu.test.d.ts +0 -1
- package/dist/components/ContextMenu/ContextMenu.test.js +0 -96
- package/dist/components/DeleteModal/DeleteModal.test.d.ts +0 -1
- package/dist/components/DeleteModal/DeleteModal.test.js +0 -132
- package/dist/components/Disclaimer/Disclaimer.test.d.ts +0 -1
- package/dist/components/Disclaimer/Disclaimer.test.js +0 -13
- package/dist/components/EmptyView/EmptyView.test.d.ts +0 -1
- package/dist/components/EmptyView/EmptyView.test.js +0 -50
- package/dist/components/Filter/Filter.test.d.ts +0 -1
- package/dist/components/Filter/Filter.test.js +0 -166
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.d.ts +0 -1
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +0 -56
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.d.ts +0 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +0 -56
- package/dist/components/FormComponents/FormNumber/FormNumber.test.d.ts +0 -1
- package/dist/components/FormComponents/FormNumber/FormNumber.test.js +0 -51
- package/dist/components/FormComponents/FormRadio/FormRadio.test.d.ts +0 -1
- package/dist/components/FormComponents/FormRadio/FormRadio.test.js +0 -73
- package/dist/components/FormComponents/FormSelect/FormSelect.test.d.ts +0 -1
- package/dist/components/FormComponents/FormSelect/FormSelect.test.js +0 -154
- package/dist/components/FormComponents/FormSlider/FormSlider.test.d.ts +0 -1
- package/dist/components/FormComponents/FormSlider/FormSlider.test.js +0 -49
- package/dist/components/FormComponents/FormText/FormText.test.d.ts +0 -1
- package/dist/components/FormComponents/FormText/FormText.test.js +0 -113
- package/dist/components/FormComponents/FormToggle/FormToggle.test.d.ts +0 -1
- package/dist/components/FormComponents/FormToggle/FormToggle.test.js +0 -54
- package/dist/components/GenericTable/GenericTable.test.d.ts +0 -1
- package/dist/components/GenericTable/GenericTable.test.js +0 -115
- package/dist/components/GenericTable/Mobile/GenericCard.test.d.ts +0 -1
- package/dist/components/GenericTable/Mobile/GenericCard.test.js +0 -76
- package/dist/components/GenericTable/Mobile/GenericCardList.test.d.ts +0 -1
- package/dist/components/GenericTable/Mobile/GenericCardList.test.js +0 -75
- package/dist/components/HashTabView/HashTabView.test.d.ts +0 -1
- package/dist/components/HashTabView/HashTabView.test.js +0 -31
- package/dist/components/HeaderFilter/HeaderFilter.test.d.ts +0 -1
- package/dist/components/HeaderFilter/HeaderFilter.test.js +0 -46
- package/dist/components/Iconify/Iconify.test.d.ts +0 -1
- package/dist/components/Iconify/Iconify.test.js +0 -28
- package/dist/components/InfoCard/InfoCard.test.d.ts +0 -1
- package/dist/components/InfoCard/InfoCard.test.js +0 -48
- package/dist/components/InfoGroup/InfoGroup.test.d.ts +0 -1
- package/dist/components/InfoGroup/InfoGroup.test.js +0 -40
- package/dist/components/ListArea/ListArea.test.d.ts +0 -1
- package/dist/components/ListArea/ListArea.test.js +0 -110
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.d.ts +0 -1
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +0 -15
- package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.d.ts +0 -1
- package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.js +0 -20
- package/dist/components/ModulePadding/ModulePadding.test.d.ts +0 -1
- package/dist/components/ModulePadding/ModulePadding.test.js +0 -22
- package/dist/components/OfflineView/OfflineView.test.d.ts +0 -1
- package/dist/components/OfflineView/OfflineView.test.js +0 -24
- package/dist/components/OnboardingBanner/OnboardingBanner.test.d.ts +0 -1
- package/dist/components/OnboardingBanner/OnboardingBanner.test.js +0 -72
- package/dist/components/OverflowTooltip/OverflowTooltip.test.d.ts +0 -1
- package/dist/components/OverflowTooltip/OverflowTooltip.test.js +0 -37
- package/dist/components/PermissionChecks/PermissionService.test.d.ts +0 -1
- package/dist/components/PermissionChecks/PermissionService.test.js +0 -91
- package/dist/components/SafeForm/SafeForm.test.d.ts +0 -1
- package/dist/components/SafeForm/SafeForm.test.js +0 -91
- package/dist/components/Scrollbar/scrollbar.test.d.ts +0 -1
- package/dist/components/Scrollbar/scrollbar.test.js +0 -15
- package/dist/components/SearchBar/SearchBar.test.d.ts +0 -1
- package/dist/components/SearchBar/SearchBar.test.js +0 -23
- package/dist/components/Select/Select.test.d.ts +0 -1
- package/dist/components/Select/Select.test.js +0 -28
- package/dist/components/Stepper/Stepper.test.d.ts +0 -1
- package/dist/components/Stepper/Stepper.test.js +0 -342
- package/dist/components/VerticalDivider/VerticalDivider.test.d.ts +0 -1
- package/dist/components/VerticalDivider/VerticalDivider.test.js +0 -15
- package/dist/get-D8IXqiys.js +0 -7
- package/dist/hooks/useBreakpoints.test.d.ts +0 -1
- package/dist/hooks/useBreakpoints.test.js +0 -11
- package/dist/index-BLPBqbdx.js +0 -11025
- package/dist/isArray-BjSPDQ4v.js +0 -7
- package/dist/magic-string.es-uPKorP4O.js +0 -663
- package/dist/services/services.test.d.ts +0 -1
- package/dist/services/services.test.js +0 -106
- package/dist/useBreakpoints-MzTZ0tCT.js +0 -45
- package/dist/vi.bdSIJ99Y-B308Q-4w.js +0 -11963
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { s as t, f as u } from "../../react.esm-Bm0cAgpZ.js";
|
|
3
|
-
import { renderWithPermissions as i } from "../../test-utils.js";
|
|
4
|
-
import { HVMainPermissions as n } from "../../types/Permission.js";
|
|
5
|
-
import { AllowedIconButton as r } from "./AllowedIconButton.js";
|
|
6
|
-
import { u as c } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
7
|
-
import { v as d, d as m, b, t as a, g as e } from "../../vi.bdSIJ99Y-B308Q-4w.js";
|
|
8
|
-
d.mock("../../hooks/useBreakpoints", () => ({
|
|
9
|
-
useBreakpoints: d.fn()
|
|
10
|
-
}));
|
|
11
|
-
m("AllowedIconButton Test", () => {
|
|
12
|
-
b(() => {
|
|
13
|
-
d.mocked(c).mockReturnValue({
|
|
14
|
-
isDesktop: !0,
|
|
15
|
-
isMobile: !1,
|
|
16
|
-
isTablet: !1,
|
|
17
|
-
isDesktopNavbar: !0
|
|
18
|
-
});
|
|
19
|
-
}), a("renders icon button with no permissions required", () => {
|
|
20
|
-
i(
|
|
21
|
-
/* @__PURE__ */ s(
|
|
22
|
-
r,
|
|
23
|
-
{
|
|
24
|
-
"data-testid": "icon-button",
|
|
25
|
-
icon: "add",
|
|
26
|
-
permissions: [],
|
|
27
|
-
entityIds: "General"
|
|
28
|
-
}
|
|
29
|
-
)
|
|
30
|
-
);
|
|
31
|
-
const o = t.getAllByRole("button")[0];
|
|
32
|
-
e(o).toHaveClass("lmnt-icon-button"), e(t.getByTestId("allowed-icon-button-icon-button")).toBeInTheDocument();
|
|
33
|
-
}), a("renders secondary variant icon button", () => {
|
|
34
|
-
i(
|
|
35
|
-
/* @__PURE__ */ s(
|
|
36
|
-
r,
|
|
37
|
-
{
|
|
38
|
-
"data-testid": "secondary-button",
|
|
39
|
-
icon: "add",
|
|
40
|
-
variant: "filled-secondary",
|
|
41
|
-
permissions: [],
|
|
42
|
-
entityIds: "General"
|
|
43
|
-
}
|
|
44
|
-
)
|
|
45
|
-
);
|
|
46
|
-
const o = t.getAllByRole("button")[0];
|
|
47
|
-
e(o).toHaveClass("lmnt-icon-button--fill-secondary"), e(t.getByTestId("allowed-icon-button-secondary-button")).toBeInTheDocument();
|
|
48
|
-
}), a("calls onClick when clicked", () => {
|
|
49
|
-
const o = d.fn();
|
|
50
|
-
i(
|
|
51
|
-
/* @__PURE__ */ s(
|
|
52
|
-
r,
|
|
53
|
-
{
|
|
54
|
-
"data-testid": "test-onclick-button",
|
|
55
|
-
icon: "add",
|
|
56
|
-
onClick: o,
|
|
57
|
-
permissions: [],
|
|
58
|
-
entityIds: "General"
|
|
59
|
-
}
|
|
60
|
-
)
|
|
61
|
-
);
|
|
62
|
-
const l = t.getAllByRole("button")[0];
|
|
63
|
-
u.click(l), e(o).toHaveBeenCalled(), e(t.getByTestId("allowed-icon-button-test-onclick-button")).toBeInTheDocument();
|
|
64
|
-
}), a("renders disabled icon button when prop is used", () => {
|
|
65
|
-
i(
|
|
66
|
-
/* @__PURE__ */ s(
|
|
67
|
-
r,
|
|
68
|
-
{
|
|
69
|
-
"data-testid": "disabled-button",
|
|
70
|
-
icon: "add",
|
|
71
|
-
permissions: [n.SuperUser],
|
|
72
|
-
entityIds: "farm-123",
|
|
73
|
-
disabled: !0
|
|
74
|
-
}
|
|
75
|
-
),
|
|
76
|
-
{
|
|
77
|
-
userPermissions: {
|
|
78
|
-
"farm-123": [n.SuperUser]
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
), e(t.getByTestId("allowed-icon-button-disabled-button")).toBeInTheDocument();
|
|
82
|
-
const o = t.getAllByRole("button")[0];
|
|
83
|
-
e(o).toHaveAttribute("disabled");
|
|
84
|
-
}), a("hides icon button when permission is missing", () => {
|
|
85
|
-
i(
|
|
86
|
-
/* @__PURE__ */ s(
|
|
87
|
-
r,
|
|
88
|
-
{
|
|
89
|
-
"data-testid": "missing",
|
|
90
|
-
icon: "add",
|
|
91
|
-
permissions: [n.SuperUser],
|
|
92
|
-
entityIds: "farm-123"
|
|
93
|
-
}
|
|
94
|
-
),
|
|
95
|
-
{
|
|
96
|
-
userPermissions: {
|
|
97
|
-
"farm-123": [n.FarmsUpdate, n.FarmsRead]
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
), e(t.queryByTestId("allowed-icon-button-missing")).not.toBeInTheDocument();
|
|
101
|
-
}), a("renders icon button when permission exists", () => {
|
|
102
|
-
i(
|
|
103
|
-
/* @__PURE__ */ s(
|
|
104
|
-
r,
|
|
105
|
-
{
|
|
106
|
-
"data-testid": "enabled",
|
|
107
|
-
icon: "add",
|
|
108
|
-
permissions: [n.SuperUser],
|
|
109
|
-
entityIds: "farm-123"
|
|
110
|
-
}
|
|
111
|
-
),
|
|
112
|
-
{
|
|
113
|
-
userPermissions: {
|
|
114
|
-
"farm-123": [n.SuperUser]
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
), e(t.getByTestId("allowed-icon-button-enabled")).toBeInTheDocument();
|
|
118
|
-
const o = t.getAllByRole("button")[0];
|
|
119
|
-
e(o).not.toHaveAttribute("disabled");
|
|
120
|
-
});
|
|
121
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { jsx as o, Fragment as s } from "react/jsx-runtime";
|
|
2
|
-
import { a as n, s as e, f as d } from "../../react.esm-Bm0cAgpZ.js";
|
|
3
|
-
import { a as l } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
4
|
-
import { BaseView as i } from "./BaseView.js";
|
|
5
|
-
import { d as p, b as m, t as r, g as t, a as c } from "../../vi.bdSIJ99Y-B308Q-4w.js";
|
|
6
|
-
p("BaseView Test", () => {
|
|
7
|
-
m(() => {
|
|
8
|
-
c.spyOn(l, "useBreakpoints").mockReturnValue({
|
|
9
|
-
isMobile: !1,
|
|
10
|
-
isTablet: !1,
|
|
11
|
-
isDesktop: !1,
|
|
12
|
-
isDesktopNavbar: !0
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
const a = [
|
|
16
|
-
{
|
|
17
|
-
id: "1",
|
|
18
|
-
title: "user.personal_information",
|
|
19
|
-
detailIcon: "border_clear",
|
|
20
|
-
icon: "account_circle",
|
|
21
|
-
route: "/personal-profile/personal-information",
|
|
22
|
-
component: /* @__PURE__ */ o(s, { children: "Personal information selected" })
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: "2",
|
|
26
|
-
title: "user.data_privacy",
|
|
27
|
-
icon: "privacy_tip",
|
|
28
|
-
route: "/personal-profile/data-privacy",
|
|
29
|
-
component: /* @__PURE__ */ o(s, { children: "Data Privacy selected" }),
|
|
30
|
-
detailTitle: "Data Privacy 2000",
|
|
31
|
-
hideIconInDetail: !0
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
id: "3",
|
|
35
|
-
title: "user.security",
|
|
36
|
-
icon: "security",
|
|
37
|
-
route: "/personal-profile/security",
|
|
38
|
-
component: /* @__PURE__ */ o(s, { children: "Security selected" })
|
|
39
|
-
}
|
|
40
|
-
];
|
|
41
|
-
r("render BaseView with empty view and navigation list", () => {
|
|
42
|
-
n(
|
|
43
|
-
/* @__PURE__ */ o(
|
|
44
|
-
i,
|
|
45
|
-
{
|
|
46
|
-
pathname: "/personal-profile",
|
|
47
|
-
elements: a,
|
|
48
|
-
heading: "user.personal-profile",
|
|
49
|
-
hasSearch: !1,
|
|
50
|
-
emptyText: "user.noselection",
|
|
51
|
-
isSorted: !1,
|
|
52
|
-
routerLinkElement: void 0
|
|
53
|
-
}
|
|
54
|
-
)
|
|
55
|
-
), 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();
|
|
56
|
-
}), r("render BaseView with data and navigation list", () => {
|
|
57
|
-
n(
|
|
58
|
-
/* @__PURE__ */ o(
|
|
59
|
-
i,
|
|
60
|
-
{
|
|
61
|
-
pathname: "/personal-profile/personal-information",
|
|
62
|
-
elements: a,
|
|
63
|
-
heading: "user.personal-profile",
|
|
64
|
-
hasSearch: !1,
|
|
65
|
-
emptyText: "user.noselection",
|
|
66
|
-
isSorted: !1,
|
|
67
|
-
routerLinkElement: void 0,
|
|
68
|
-
basicHeadingIcon: "directions_car"
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
), t(e.getByText("Personal information selected")).toBeInTheDocument(), t(e.getAllByText("user.personal_information")).toHaveLength(2), t(e.getByText("account_circle")).toBeInTheDocument(), t(e.getByText("border_clear")).toBeInTheDocument(), t(e.getByText("directions_car")).toBeInTheDocument();
|
|
72
|
-
}), r("render BaseView with custom detail title and no detail icon", () => {
|
|
73
|
-
n(
|
|
74
|
-
/* @__PURE__ */ o(
|
|
75
|
-
i,
|
|
76
|
-
{
|
|
77
|
-
pathname: "/personal-profile/data-privacy",
|
|
78
|
-
elements: a,
|
|
79
|
-
heading: "user.personal-profile",
|
|
80
|
-
hasSearch: !1,
|
|
81
|
-
emptyText: "user.noselection",
|
|
82
|
-
isSorted: !1,
|
|
83
|
-
routerLinkElement: void 0
|
|
84
|
-
}
|
|
85
|
-
)
|
|
86
|
-
), 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);
|
|
87
|
-
}), r("hide empty view when screen is small", () => {
|
|
88
|
-
c.spyOn(l, "useBreakpoints").mockReturnValue({
|
|
89
|
-
isMobile: !0,
|
|
90
|
-
isTablet: !1,
|
|
91
|
-
isDesktop: !1,
|
|
92
|
-
isDesktopNavbar: !1
|
|
93
|
-
}), n(
|
|
94
|
-
/* @__PURE__ */ o(
|
|
95
|
-
i,
|
|
96
|
-
{
|
|
97
|
-
pathname: "/personal-profile/data-privacy",
|
|
98
|
-
elements: a,
|
|
99
|
-
heading: "user.personal-profile",
|
|
100
|
-
hasSearch: !1,
|
|
101
|
-
emptyText: "user.noselection",
|
|
102
|
-
isSorted: !1,
|
|
103
|
-
routerLinkElement: void 0
|
|
104
|
-
}
|
|
105
|
-
)
|
|
106
|
-
), t(e.queryByText("user.noselection")).not.toBeInTheDocument();
|
|
107
|
-
}), r("render BaseView with selected detail section", () => {
|
|
108
|
-
n(
|
|
109
|
-
/* @__PURE__ */ o(
|
|
110
|
-
i,
|
|
111
|
-
{
|
|
112
|
-
pathname: "/personal-profile/data-privacy",
|
|
113
|
-
elements: a,
|
|
114
|
-
heading: "user.personal-profile",
|
|
115
|
-
hasSearch: !1,
|
|
116
|
-
emptyText: "user.noselection",
|
|
117
|
-
isSorted: !1,
|
|
118
|
-
routerLinkElement: void 0
|
|
119
|
-
}
|
|
120
|
-
)
|
|
121
|
-
), d.click(e.getAllByRole("option")[1]), t(e.getByText("Data Privacy selected")).toBeInTheDocument();
|
|
122
|
-
}), r("renders only offline view when offline", () => {
|
|
123
|
-
n(
|
|
124
|
-
/* @__PURE__ */ o(
|
|
125
|
-
i,
|
|
126
|
-
{
|
|
127
|
-
pathname: "/personal-profile/personal-information",
|
|
128
|
-
elements: a,
|
|
129
|
-
heading: "user.personal-profile",
|
|
130
|
-
hasSearch: !1,
|
|
131
|
-
emptyText: "user.noselection",
|
|
132
|
-
isSorted: !1,
|
|
133
|
-
isOnline: !1,
|
|
134
|
-
offlineViewProps: { "data-testid": "offline-test" },
|
|
135
|
-
routerLinkElement: void 0
|
|
136
|
-
}
|
|
137
|
-
)
|
|
138
|
-
), t(e.queryByText("Personal information selected")).not.toBeInTheDocument(), t(e.getByTestId("offline-test")).toBeInTheDocument();
|
|
139
|
-
}), r("does not render elements when isAllowed is false", () => {
|
|
140
|
-
n(
|
|
141
|
-
/* @__PURE__ */ o(
|
|
142
|
-
i,
|
|
143
|
-
{
|
|
144
|
-
pathname: "",
|
|
145
|
-
elements: [
|
|
146
|
-
{
|
|
147
|
-
id: "1",
|
|
148
|
-
title: "Allowed Element",
|
|
149
|
-
icon: "account_circle",
|
|
150
|
-
route: "/allowed",
|
|
151
|
-
component: /* @__PURE__ */ o(s, { children: "Allowed content" }),
|
|
152
|
-
isAllowed: !0
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
id: "2",
|
|
156
|
-
title: "Not Allowed Element",
|
|
157
|
-
icon: "privacy_tip",
|
|
158
|
-
route: "/not-allowed",
|
|
159
|
-
component: /* @__PURE__ */ o(s, { children: "Not allowed content" }),
|
|
160
|
-
isAllowed: !1
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
id: "3",
|
|
164
|
-
title: "Another Allowed Element",
|
|
165
|
-
icon: "security",
|
|
166
|
-
route: "/allowed-2",
|
|
167
|
-
component: /* @__PURE__ */ o(s, { children: "Another allowed content" }),
|
|
168
|
-
isAllowed: !0
|
|
169
|
-
}
|
|
170
|
-
],
|
|
171
|
-
heading: "Permission Test",
|
|
172
|
-
hasSearch: !1,
|
|
173
|
-
emptyText: "No selection",
|
|
174
|
-
isSorted: !1,
|
|
175
|
-
routerLinkElement: void 0
|
|
176
|
-
}
|
|
177
|
-
)
|
|
178
|
-
), t(e.getByText("Allowed Element")).toBeInTheDocument(), t(e.getByText("Another Allowed Element")).toBeInTheDocument(), t(e.queryByText("Not Allowed Element")).not.toBeInTheDocument();
|
|
179
|
-
});
|
|
180
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { jsx as o, Fragment as d } from "react/jsx-runtime";
|
|
2
|
-
import { B as g } from "../../index.es-B8p8KCdj.js";
|
|
3
|
-
import { a, s as t } from "../../react.esm-Bm0cAgpZ.js";
|
|
4
|
-
import { BasicHeading as i } from "./BasicHeading.js";
|
|
5
|
-
import { d as h, t as s, g as e } from "../../vi.bdSIJ99Y-B308Q-4w.js";
|
|
6
|
-
h("BasicHeading-Test", () => {
|
|
7
|
-
s("render small container without content", () => {
|
|
8
|
-
a(/* @__PURE__ */ o(i, { heading: "Test" }));
|
|
9
|
-
const n = t.getByTestId("HeaderContainer");
|
|
10
|
-
e(n).toBeDefined();
|
|
11
|
-
const r = t.getByTestId("Header");
|
|
12
|
-
e(r).toBeDefined(), e(r).toHaveTextContent("Test");
|
|
13
|
-
const c = t.queryByTestId("RightPart");
|
|
14
|
-
e(c).toBeNull();
|
|
15
|
-
}), s("render large container with children", () => {
|
|
16
|
-
a(
|
|
17
|
-
/* @__PURE__ */ o(i, { heading: "Test", marginBottom: "large", children: /* @__PURE__ */ o(g, { children: "Extracontent" }) })
|
|
18
|
-
);
|
|
19
|
-
const n = t.getByTestId("HeaderContainer");
|
|
20
|
-
e(n).toBeDefined();
|
|
21
|
-
const r = t.getByTestId("Header");
|
|
22
|
-
e(r).toBeDefined(), e(r).toHaveTextContent("Test");
|
|
23
|
-
const c = t.getByTestId("RightPart");
|
|
24
|
-
e(c).toBeDefined(), e(c).toContainHTML("<button");
|
|
25
|
-
}), s("render with available custom icon", () => {
|
|
26
|
-
a(/* @__PURE__ */ o(i, { heading: "Test", icon: "farm" }));
|
|
27
|
-
const n = t.getByTestId("farm");
|
|
28
|
-
e(n).toBeInTheDocument();
|
|
29
|
-
}), s("render with JSX element as icon", () => {
|
|
30
|
-
a(/* @__PURE__ */ o(i, { heading: "Test", icon: /* @__PURE__ */ o(d, { children: "JSX" }) })), e(t.getByText("JSX")).toBeInTheDocument();
|
|
31
|
-
}), s("render with other icon", () => {
|
|
32
|
-
a(/* @__PURE__ */ o(i, { heading: "Test", icon: "contact_support" }));
|
|
33
|
-
const n = document.querySelector("i");
|
|
34
|
-
e(n).toHaveTextContent("contact_support");
|
|
35
|
-
});
|
|
36
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { a as s, s as o, f as n } from "../../react.esm-Bm0cAgpZ.js";
|
|
3
|
-
import { BlockView as i } from "./BlockView.js";
|
|
4
|
-
import { d as a, a as B, t as r, g as t } from "../../vi.bdSIJ99Y-B308Q-4w.js";
|
|
5
|
-
a("BlockView Test", () => {
|
|
6
|
-
const c = B.fn(), e = {
|
|
7
|
-
id: "1",
|
|
8
|
-
fieldId: "2",
|
|
9
|
-
position: {
|
|
10
|
-
row: 1,
|
|
11
|
-
column: 2
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
r("renders BlockView correctly with 2x3 blocks", () => {
|
|
15
|
-
s(
|
|
16
|
-
/* @__PURE__ */ l(
|
|
17
|
-
i,
|
|
18
|
-
{
|
|
19
|
-
blocks: [e],
|
|
20
|
-
columns: 2,
|
|
21
|
-
rows: 3,
|
|
22
|
-
currentBlock: e,
|
|
23
|
-
blockViewTitle: "Layout",
|
|
24
|
-
blockLabel: "Block"
|
|
25
|
-
}
|
|
26
|
-
)
|
|
27
|
-
), t(o.getByText("Layout")).toBeInTheDocument(), t(o.getByText("6 Block")).toBeInTheDocument();
|
|
28
|
-
const k = o.getAllByTestId("block-view-block");
|
|
29
|
-
t(k.length).toBe(6);
|
|
30
|
-
}), r("executes onClick method", () => {
|
|
31
|
-
s(
|
|
32
|
-
/* @__PURE__ */ l(
|
|
33
|
-
i,
|
|
34
|
-
{
|
|
35
|
-
blocks: [e],
|
|
36
|
-
columns: 2,
|
|
37
|
-
rows: 3,
|
|
38
|
-
onClick: c,
|
|
39
|
-
currentBlock: e,
|
|
40
|
-
hideText: !0,
|
|
41
|
-
blockViewTitle: "Layout",
|
|
42
|
-
blockLabel: "Block"
|
|
43
|
-
}
|
|
44
|
-
)
|
|
45
|
-
), n.click(o.getByText("2")), t(c).toHaveBeenCalled();
|
|
46
|
-
});
|
|
47
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { s as e } from "../../react.esm-Bm0cAgpZ.js";
|
|
3
|
-
import { ButtonCard as s } from "./ButtonCard.js";
|
|
4
|
-
import { renderWithPermissions as r } from "../../test-utils.js";
|
|
5
|
-
import { d as c, t as a, g as t, v as d } from "../../vi.bdSIJ99Y-B308Q-4w.js";
|
|
6
|
-
c("ButtonCard Component", () => {
|
|
7
|
-
a("renders the correct title and subtitle", () => {
|
|
8
|
-
r(
|
|
9
|
-
/* @__PURE__ */ o(
|
|
10
|
-
s,
|
|
11
|
-
{
|
|
12
|
-
title: "Card Title",
|
|
13
|
-
subtitle: "Card Subtitle",
|
|
14
|
-
entityIds: "General",
|
|
15
|
-
permissions: []
|
|
16
|
-
}
|
|
17
|
-
)
|
|
18
|
-
), t(e.getByText("Card Title")).toBeInTheDocument(), t(e.getByText("Card Subtitle")).toBeInTheDocument(), t(e.queryByTestId("card-icon")).not.toBeInTheDocument();
|
|
19
|
-
}), a("renders the correct title and subtitle with icon", () => {
|
|
20
|
-
r(
|
|
21
|
-
/* @__PURE__ */ o(
|
|
22
|
-
s,
|
|
23
|
-
{
|
|
24
|
-
title: "Card Title",
|
|
25
|
-
subtitle: "Card Subtitle",
|
|
26
|
-
icon: "store",
|
|
27
|
-
entityIds: "General",
|
|
28
|
-
permissions: []
|
|
29
|
-
}
|
|
30
|
-
)
|
|
31
|
-
), t(e.getByText("Card Title")).toBeInTheDocument(), t(e.getByText("Card Subtitle")).toBeInTheDocument(), t(e.getByTestId("card-icon-store")).toBeInTheDocument();
|
|
32
|
-
}), a("calls onClick when button is clicked", () => {
|
|
33
|
-
const n = d.fn();
|
|
34
|
-
r(
|
|
35
|
-
/* @__PURE__ */ o(
|
|
36
|
-
s,
|
|
37
|
-
{
|
|
38
|
-
title: "Clickable Card",
|
|
39
|
-
subtitle: "Card Subtitle",
|
|
40
|
-
onClick: n,
|
|
41
|
-
entityIds: "General",
|
|
42
|
-
permissions: []
|
|
43
|
-
}
|
|
44
|
-
)
|
|
45
|
-
);
|
|
46
|
-
const i = e.getByTestId("button-card-Clickable Card");
|
|
47
|
-
t(i).not.toHaveClass("noInteraction"), i.click(), t(n).toHaveBeenCalled();
|
|
48
|
-
}), a("adds noInteraction class when onClick is not set", () => {
|
|
49
|
-
r(
|
|
50
|
-
/* @__PURE__ */ o(
|
|
51
|
-
s,
|
|
52
|
-
{
|
|
53
|
-
title: "Static Card",
|
|
54
|
-
subtitle: "Card Subtitle",
|
|
55
|
-
entityIds: "General",
|
|
56
|
-
permissions: []
|
|
57
|
-
}
|
|
58
|
-
)
|
|
59
|
-
);
|
|
60
|
-
const n = e.getByTestId("button-card-Static Card");
|
|
61
|
-
t(Array.from(n.classList).some((i) => i.includes("noInteraction"))).toBe(!0);
|
|
62
|
-
}), a("does not add noInteraction class when onClick is set", () => {
|
|
63
|
-
r(
|
|
64
|
-
/* @__PURE__ */ o(
|
|
65
|
-
s,
|
|
66
|
-
{
|
|
67
|
-
title: "Interactive Card",
|
|
68
|
-
subtitle: "Card Subtitle",
|
|
69
|
-
onClick: () => {
|
|
70
|
-
},
|
|
71
|
-
entityIds: "General",
|
|
72
|
-
permissions: []
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
);
|
|
76
|
-
const n = e.getByTestId("button-card-Interactive Card");
|
|
77
|
-
t(Array.from(n.classList).some((i) => i.includes("noInteraction"))).toBe(!1);
|
|
78
|
-
}), a("sets correct data-testid for button and icon", () => {
|
|
79
|
-
r(
|
|
80
|
-
/* @__PURE__ */ o(
|
|
81
|
-
s,
|
|
82
|
-
{
|
|
83
|
-
title: "Icon Card",
|
|
84
|
-
subtitle: "Card Subtitle",
|
|
85
|
-
icon: "wifi",
|
|
86
|
-
entityIds: "General",
|
|
87
|
-
permissions: []
|
|
88
|
-
}
|
|
89
|
-
)
|
|
90
|
-
), t(e.getByTestId("button-card-Icon Card")).toBeInTheDocument(), t(e.getByTestId("card-icon-wifi")).toBeInTheDocument();
|
|
91
|
-
});
|
|
92
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { a, s as i } from "../../react.esm-Bm0cAgpZ.js";
|
|
3
|
-
import { ChipCard as n } from "./ChipCard.js";
|
|
4
|
-
import { d as s, t as c, g as t } from "../../vi.bdSIJ99Y-B308Q-4w.js";
|
|
5
|
-
s("ChipCard Component", () => {
|
|
6
|
-
const r = "Test Label", o = "domain";
|
|
7
|
-
c("renders the correct label and icon", () => {
|
|
8
|
-
a(/* @__PURE__ */ e(n, { label: r, icon: o })), t(i.getByText(r)).toBeInTheDocument(), t(i.getByText(o)).toBeInTheDocument();
|
|
9
|
-
}), c("applies OverflowTooltip correctly", () => {
|
|
10
|
-
const l = "Very looooooooooooooooooooooooooooooooooooong example label";
|
|
11
|
-
a(
|
|
12
|
-
/* @__PURE__ */ e(
|
|
13
|
-
"div",
|
|
14
|
-
{
|
|
15
|
-
style: {
|
|
16
|
-
width: "2rem"
|
|
17
|
-
},
|
|
18
|
-
children: /* @__PURE__ */ e(n, { label: l, icon: o })
|
|
19
|
-
}
|
|
20
|
-
)
|
|
21
|
-
);
|
|
22
|
-
const d = document.querySelector("div[data-tooltip-id]");
|
|
23
|
-
t(d).toHaveAttribute("data-tooltip-id", `chip_card_${l}`);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|