@hortiview/default-components 1.5.0 → 1.5.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/dist/components/DefaultAllowedComponent/DefaultAllowedComponent.js +8 -48
- package/dist/components/DefaultFormNumber/DefaultFormNumber.js +12 -1514
- package/dist/components/DefaultFormSelect/DefaultFormSelect.js +9 -178
- package/dist/components/DefaultLoadingSpinner/DefaultLoadingSpinner.js +6 -6
- package/dist/components/GenericTable/GenericTable.js +12 -18746
- package/dist/components/HealthChecks/DataBaseHealthCheck.js +2 -2
- package/dist/components/HealthChecks/DefaultHealthCheck.js +4 -4
- package/dist/components/HealthChecks/IotServiceHealthCheck.js +5 -5
- package/dist/components/HealthChecks/PlatformHealthCheck.js +4 -4
- package/dist/components/ImpatienceLoadingSpinner/ImpatienceLoadingSpinner.js +9 -9
- package/dist/components/InternationalizationWrapper/InternationalizationWrapper.js +4 -4
- package/dist/components/OfflineView/OfflineView.js +9 -9
- package/dist/i18n.js +1696 -5
- package/dist/{i18nInstance-D_96ADqd.js → i18nInstance-CYqpK5II.js} +2 -2
- package/dist/useTranslation-DGtUf8nl.js +101 -0
- package/package.json +2 -2
- package/dist/Iconify-D3gVmKx3.js +0 -84
- package/dist/InfoCard-Ba-VFnki.js +0 -58
- package/dist/LoadingSpinner-CmwCv7BO.js +0 -503
- package/dist/OfflineView-CIwV08EQ-BClnJRzV.js +0 -46
- package/dist/assets/DefaultAllowedComponent.css +0 -1
- package/dist/assets/DefaultFormNumber.css +0 -1
- package/dist/assets/DefaultFormSelect.css +0 -1
- package/dist/assets/GenericTable.css +0 -1
- package/dist/assets/Iconify.css +0 -1
- package/dist/assets/InfoCard.css +0 -1
- package/dist/assets/LoadingSpinner.css +0 -1
- package/dist/assets/OfflineView-CIwV08EQ.css +0 -1
- package/dist/component-Bz_dtX1r-DqCAj-DR.js +0 -304
- package/dist/component-DEJuY56h-CYiwt7Ga.js +0 -571
- package/dist/correct-is-regexp-logic-Y0ToWEjF-pByZFQLo.js +0 -494
- package/dist/i18n-CCQpJsQK.js +0 -1707
- package/dist/index.es--C-VLspF-B3Cy1zrT.js +0 -845
- package/dist/index.es-B74L_Dje-mYAvKwSb.js +0 -2005
- package/dist/index.es-B8p8KCdj--cmqwwUJ.js +0 -360
- package/dist/index.es-BPv5dCFQ-BmH1Hq7_.js +0 -1044
- package/dist/index.es-BanVdXEd-BYOBCuJj.js +0 -79
- package/dist/index.es-SjZ_-d7U-HvaOH_Z0.js +0 -860
- package/dist/index.es-nwjKmW7--CUlbl1RR.js +0 -14375
- package/dist/isTypedArray-DziahYkI-Cw9ssvDH.js +0 -210
- package/dist/slicedToArray-ByMQIs5x-BsvSjTDl.js +0 -432
- package/dist/useHelperText-Cqx6ggnc.js +0 -392
- package/dist/useTranslation-BQQybhSd.js +0 -5042
|
@@ -1,51 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (e === void 0)
|
|
9
|
-
throw new Error("usePermissionContext must be used within a PermissionProvider");
|
|
10
|
-
return e;
|
|
11
|
-
}, P = "_disclaimer_1k38t_1", g = "_iconArea_1k38t_7", l = {
|
|
12
|
-
disclaimer: P,
|
|
13
|
-
iconArea: g
|
|
14
|
-
}, w = ({ text: e, subtext: t, icon: i, level: s = 2, bold: n = !1 }) => /* @__PURE__ */ a(
|
|
15
|
-
c,
|
|
16
|
-
{
|
|
17
|
-
"data-testid": "disclaimer",
|
|
18
|
-
direction: i || t ? "vertical" : "horizontal",
|
|
19
|
-
secondaryAlign: "center",
|
|
20
|
-
primaryAlign: "center",
|
|
21
|
-
children: [
|
|
22
|
-
/* @__PURE__ */ r(d, { className: l.disclaimer, level: s, bold: n, children: e }),
|
|
23
|
-
t && /* @__PURE__ */ r(m, { level: 2, children: t }),
|
|
24
|
-
i && /* @__PURE__ */ r("div", { className: l.iconArea, children: /* @__PURE__ */ r(u, { className: l.Icon, icon: i, iconSize: "large" }) })
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
), C = () => {
|
|
28
|
-
const { userPermissions: e } = A();
|
|
29
|
-
return x(
|
|
30
|
-
({ neededPermissions: t, entityIds: i, areAllPermissionsNeeded: s = !1 }) => {
|
|
31
|
-
if (t.length === 0) return !0;
|
|
32
|
-
const n = (Array.isArray(i) ? i : [i]).flatMap(
|
|
33
|
-
(o) => (e == null ? void 0 : e[o]) ?? []
|
|
34
|
-
);
|
|
35
|
-
return n.length === 0 ? !1 : s ? t.every((o) => n.includes(o)) : t.some((o) => n.includes(o));
|
|
36
|
-
},
|
|
37
|
-
[e]
|
|
38
|
-
);
|
|
39
|
-
}, I = ({
|
|
40
|
-
children: e,
|
|
41
|
-
neededPermissions: t,
|
|
42
|
-
entityIds: i,
|
|
43
|
-
disclaimer: s = !1,
|
|
44
|
-
disclaimerText: n = "You are not allowed to see the content of this section."
|
|
45
|
-
}) => C()({ neededPermissions: t, entityIds: i }) ? e : s ? /* @__PURE__ */ r(w, { text: n }) : null, z = ({ ...e }) => {
|
|
46
|
-
const { t } = f();
|
|
47
|
-
return /* @__PURE__ */ r(v, { children: /* @__PURE__ */ r(I, { ...e, disclaimerText: t("allowedComponent.disclaimerText") }) });
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Allowed as e } from "@hortiview/shared-components";
|
|
3
|
+
import { InternationalizationWrapper as n } from "../InternationalizationWrapper/InternationalizationWrapper.js";
|
|
4
|
+
import { u as i } from "../../useTranslation-DGtUf8nl.js";
|
|
5
|
+
const s = ({ ...r }) => {
|
|
6
|
+
const { t } = i();
|
|
7
|
+
return /* @__PURE__ */ o(n, { children: /* @__PURE__ */ o(e, { ...r, disclaimerText: t("allowedComponent.disclaimerText") }) });
|
|
48
8
|
};
|
|
49
9
|
export {
|
|
50
|
-
|
|
10
|
+
s as DefaultAllowedComponent
|
|
51
11
|
};
|