@hortiview/default-components 1.4.4 → 1.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/README.md +51 -0
- package/dist/{Iconify-aUog1Oez.js → Iconify-D3gVmKx3.js} +11 -10
- package/dist/{InfoCard-BxjAQiFE.js → InfoCard-Ba-VFnki.js} +4 -4
- package/dist/{LoadingSpinner-DBMjIfY1.js → LoadingSpinner-CmwCv7BO.js} +22 -21
- package/dist/{OfflineView-NUM9WE0F-BI9rnget.js → OfflineView-CIwV08EQ-BClnJRzV.js} +4 -4
- package/dist/assets/DefaultAllowedComponent.css +1 -0
- package/dist/assets/GenericTable.css +1 -1
- package/dist/component-Bz_dtX1r-DqCAj-DR.js +304 -0
- package/dist/{component-DsB0poTj-DgsYK0_R.js → component-DEJuY56h-CYiwt7Ga.js} +6 -5
- package/dist/components/DefaultAllowedComponent/DefaultAllowedComponent.d.ts +11 -0
- package/dist/components/DefaultAllowedComponent/DefaultAllowedComponent.js +51 -0
- package/dist/components/DefaultFormNumber/DefaultFormNumber.js +475 -457
- package/dist/components/DefaultFormSelect/DefaultFormSelect.js +29 -29
- package/dist/components/DefaultLoadingSpinner/DefaultLoadingSpinner.js +2 -2
- package/dist/components/GenericTable/GenericTable.js +2204 -2189
- package/dist/components/HealthChecks/DataBaseHealthCheck.js +2 -2
- package/dist/components/HealthChecks/DefaultHealthCheck.js +2 -2
- package/dist/components/HealthChecks/IotServiceHealthCheck.js +2 -2
- package/dist/components/HealthChecks/PlatformHealthCheck.js +2 -2
- package/dist/components/ImpatienceLoadingSpinner/ImpatienceLoadingSpinner.js +2 -2
- package/dist/components/OfflineView/OfflineView.js +2 -2
- package/dist/{correct-is-regexp-logic-BBlm4UpN-CvII841s.js → correct-is-regexp-logic-Y0ToWEjF-pByZFQLo.js} +49 -48
- package/dist/{index.es-DiONypF4-eT98Y3u_.js → index.es--C-VLspF-B3Cy1zrT.js} +36 -35
- package/dist/{index.es-CvHDFF6V-CjZvA03R.js → index.es-B74L_Dje-mYAvKwSb.js} +5 -4
- package/dist/{index.es-B0QNuIUR-Bte5aF5M.js → index.es-B8p8KCdj--cmqwwUJ.js} +5 -5
- package/dist/{index.es-DnEIFMjv-DuuORGfo.js → index.es-BPv5dCFQ-BmH1Hq7_.js} +61 -61
- package/dist/{index.es-CIsLNz4j-ZEEcPmTs.js → index.es-BanVdXEd-BYOBCuJj.js} +1 -1
- package/dist/{index.es-NEYPxnlS-C8xQv2De.js → index.es-SjZ_-d7U-HvaOH_Z0.js} +33 -33
- package/dist/{index.es-fV9oWpEf-BXuhoGtE.js → index.es-nwjKmW7--CUlbl1RR.js} +12 -11
- package/dist/{isTypedArray-Dw_IY7Zq-wj3MphCb.js → isTypedArray-DziahYkI-Cw9ssvDH.js} +18 -18
- package/dist/locales/en-US.js +16 -14
- package/dist/locales/en-US.json.d.ts +3 -0
- package/dist/locales/es-MX.js +16 -14
- package/dist/locales/es-MX.json.d.ts +3 -0
- package/dist/locales/tr-TR.js +17 -15
- package/dist/locales/tr-TR.json.d.ts +3 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +24 -22
- package/dist/{slicedToArray-h0Nnkd_P-C4SkVJMK.js → slicedToArray-ByMQIs5x-BsvSjTDl.js} +158 -158
- package/dist/{useHelperText-B7OMZXvE.js → useHelperText-Cqx6ggnc.js} +55 -54
- package/dist/useTranslation-BQQybhSd.js +5042 -0
- package/package.json +2 -31
- package/dist/useTranslation-B_lNCuLm.js +0 -5343
- /package/dist/assets/{OfflineView-NUM9WE0F.css → OfflineView-CIwV08EQ.css} +0 -0
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
2
|
-
import { r as Z,
|
|
3
|
-
import a, { useState as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { jsx as c, jsxs as q } from "react/jsx-runtime";
|
|
2
|
+
import { r as Z, ah as ee, i as w, h as re, e as U, k as J, l as $, t as m, n as te } from "./useTranslation-BQQybhSd.js";
|
|
3
|
+
import a, { useState as ae, useEffect as T, useMemo as ie, forwardRef as se, useRef as V, useImperativeHandle as oe, useCallback as ne } from "react";
|
|
4
|
+
import { a as ce, f as le } from "./component-Bz_dtX1r-DqCAj-DR.js";
|
|
5
|
+
import { D as X, O as de } from "./index.es-SjZ_-d7U-HvaOH_Z0.js";
|
|
6
|
+
import { b as ue } from "./index.es-BanVdXEd-BYOBCuJj.js";
|
|
7
|
+
import { n as me } from "./Iconify-D3gVmKx3.js";
|
|
7
8
|
import './assets/LoadingSpinner.css';const pe = "_loadingBigOverlay_7dxo1_1", he = "_bigLoadSpinnerCard_7dxo1_12", ge = "_bigLoadSpinnerCardText_7dxo1_27", fe = "_logo_7dxo1_33", L = {
|
|
8
9
|
loadingBigOverlay: pe,
|
|
9
10
|
bigLoadSpinnerCard: he,
|
|
10
11
|
bigLoadSpinnerCardText: ge,
|
|
11
12
|
logo: fe
|
|
12
|
-
}, _e = ({ text: t }) => /* @__PURE__ */
|
|
13
|
+
}, _e = ({ text: t }) => /* @__PURE__ */ q("div", { className: L.bigLoadSpinnerCard, role: "progressbar", "data-testid": "loading-spinner", children: [
|
|
13
14
|
/* @__PURE__ */ c(me, { icon: "hortiview", className: L.logo, "data-testid": "logo-icon" }),
|
|
14
15
|
/* @__PURE__ */ c(X, { tag: "p", bold: !0, level: 1, className: L.bigLoadSpinnerCardText, children: t })
|
|
15
16
|
] }), ve = (t) => /* @__PURE__ */ c("div", { "data-testid": "big-loading-spinner", className: L.loadingBigOverlay, children: /* @__PURE__ */ c(_e, { ...t }) });
|
|
@@ -45,7 +46,7 @@ var h = {
|
|
|
45
46
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
46
47
|
* THE SOFTWARE.
|
|
47
48
|
*/
|
|
48
|
-
var
|
|
49
|
+
var K = (
|
|
49
50
|
/** @class */
|
|
50
51
|
function(t) {
|
|
51
52
|
J(e, t);
|
|
@@ -107,7 +108,7 @@ var q = (
|
|
|
107
108
|
}, e.prototype.isClosed = function() {
|
|
108
109
|
return this.closed;
|
|
109
110
|
}, e;
|
|
110
|
-
}(
|
|
111
|
+
}(ce)
|
|
111
112
|
);
|
|
112
113
|
/**
|
|
113
114
|
* @license
|
|
@@ -139,7 +140,7 @@ var Ce = (
|
|
|
139
140
|
return t !== null && t.apply(this, arguments) || this;
|
|
140
141
|
}
|
|
141
142
|
return e.prototype.initialize = function() {
|
|
142
|
-
this.determinateCircle_ = this.root.querySelector(
|
|
143
|
+
this.determinateCircle_ = this.root.querySelector(K.strings.DETERMINATE_CIRCLE_SELECTOR);
|
|
143
144
|
}, e.attachTo = function(r) {
|
|
144
145
|
return new e(r);
|
|
145
146
|
}, Object.defineProperty(e.prototype, "determinate", {
|
|
@@ -201,9 +202,9 @@ var Ce = (
|
|
|
201
202
|
return r.determinateCircle_.setAttribute(i, d);
|
|
202
203
|
}
|
|
203
204
|
};
|
|
204
|
-
return new
|
|
205
|
+
return new K(l);
|
|
205
206
|
}, e;
|
|
206
|
-
}(
|
|
207
|
+
}(le)
|
|
207
208
|
), ye = {
|
|
208
209
|
/**
|
|
209
210
|
* Accessibility label.
|
|
@@ -242,7 +243,7 @@ var Ce = (
|
|
|
242
243
|
*
|
|
243
244
|
* Defaults to **undefined**.
|
|
244
245
|
*/
|
|
245
|
-
size:
|
|
246
|
+
size: te(m.oneOf(["sm", "md", "lg"]), "CircularProgress", "Renamed, see indicatorSize instead."),
|
|
246
247
|
/**
|
|
247
248
|
* Color of the indicator stroke with 'primary' or 'secondary' theme color.
|
|
248
249
|
*
|
|
@@ -263,11 +264,11 @@ var Ce = (
|
|
|
263
264
|
progress: 0,
|
|
264
265
|
themeColor: "primary",
|
|
265
266
|
variant: "indeterminate"
|
|
266
|
-
}, be = ["ariaLabel", "className", "open", "progress", "size", "indicatorSize", "themeColor", "variant"], g = Ae, W = /* @__PURE__ */
|
|
267
|
+
}, be = ["ariaLabel", "className", "open", "progress", "size", "indicatorSize", "themeColor", "variant"], g = Ae, W = /* @__PURE__ */ se(function(t, e) {
|
|
267
268
|
var r, l = t.ariaLabel, i = l === void 0 ? g.ariaLabel : l, d = t.className, _ = d === void 0 ? g.className : d, v = t.open, A = v === void 0 ? g.open : v, b = t.progress, u = b === void 0 ? g.progress : b;
|
|
268
269
|
t.size;
|
|
269
270
|
var D = t.indicatorSize, I = D === void 0 ? g.indicatorSize : D, R = t.themeColor, E = R === void 0 ? g.themeColor : R, P = t.variant, S = P === void 0 ? g.variant : P, G = Z(t, be), O = V(), k = V();
|
|
270
|
-
|
|
271
|
+
oe(e, function() {
|
|
271
272
|
return O.current;
|
|
272
273
|
}, []), T(function() {
|
|
273
274
|
return k.current = Ce.attachTo(O.current), function() {
|
|
@@ -351,7 +352,7 @@ var Ce = (
|
|
|
351
352
|
halfStrokeDashoffset: "56.549"
|
|
352
353
|
};
|
|
353
354
|
}
|
|
354
|
-
}, o = Q(), z = o.heightWidth, n = o.viewBox, s = o.cxCy, f = o.r, C = o.strokeWidth, B = o.strokeWidth80, y = o.strokeDashArray, Y = o.strokeDashoffset, x = o.halfStrokeDashoffset, N =
|
|
355
|
+
}, o = Q(), z = o.heightWidth, n = o.viewBox, s = o.cxCy, f = o.r, C = o.strokeWidth, B = o.strokeWidth80, y = o.strokeDashArray, Y = o.strokeDashoffset, x = o.halfStrokeDashoffset, N = ne(function() {
|
|
355
356
|
var j, F, H;
|
|
356
357
|
return /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement("div", {
|
|
357
358
|
className: "mdc-circular-progress__circle-clipper mdc-circular-progress__circle-left"
|
|
@@ -442,7 +443,7 @@ W.displayName = "CircularProgress";
|
|
|
442
443
|
W.propTypes = ye;
|
|
443
444
|
const De = "_loadingSpinnerContainer_1f3ss_1", Ee = {
|
|
444
445
|
loadingSpinnerContainer: De
|
|
445
|
-
},
|
|
446
|
+
}, Ie = ({
|
|
446
447
|
size: t,
|
|
447
448
|
center: e = !1,
|
|
448
449
|
text: r,
|
|
@@ -453,14 +454,14 @@ const De = "_loadingSpinnerContainer_1f3ss_1", Ee = {
|
|
|
453
454
|
impatienceMessage: _ = "This is taking longer than expected. Please be patient.",
|
|
454
455
|
impatienceTimeout: v = 10
|
|
455
456
|
}) => {
|
|
456
|
-
const [A, b] =
|
|
457
|
+
const [A, b] = ae(0);
|
|
457
458
|
T(() => {
|
|
458
459
|
const D = setInterval(() => {
|
|
459
460
|
b((I) => I + 1);
|
|
460
461
|
}, 1e3);
|
|
461
462
|
return () => clearInterval(D);
|
|
462
463
|
}, []);
|
|
463
|
-
const u =
|
|
464
|
+
const u = ie(() => _ && A > v ? _ : r, [_, v, r, A]);
|
|
464
465
|
return t === "big" ? /* @__PURE__ */ c(ve, { text: u }) : d ? /* @__PURE__ */ c(
|
|
465
466
|
W,
|
|
466
467
|
{
|
|
@@ -474,7 +475,7 @@ const De = "_loadingSpinnerContainer_1f3ss_1", Ee = {
|
|
|
474
475
|
variant: "standard",
|
|
475
476
|
style: { textAlign: "center" },
|
|
476
477
|
className: e ? Ee.loadingSpinnerContainer : "",
|
|
477
|
-
children: /* @__PURE__ */
|
|
478
|
+
children: /* @__PURE__ */ q(
|
|
478
479
|
de,
|
|
479
480
|
{
|
|
480
481
|
direction: l === "right" ? "horizontal" : "vertical",
|
|
@@ -498,5 +499,5 @@ const De = "_loadingSpinnerContainer_1f3ss_1", Ee = {
|
|
|
498
499
|
);
|
|
499
500
|
};
|
|
500
501
|
export {
|
|
501
|
-
|
|
502
|
+
Ie as N
|
|
502
503
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { O as o, N as m, I as h, D as v } from "./index.es-
|
|
3
|
-
import { n as p } from "./Iconify-
|
|
4
|
-
import { d as x } from "./index.es-
|
|
5
|
-
import './assets/OfflineView-
|
|
2
|
+
import { O as o, N as m, I as h, D as v } from "./index.es-SjZ_-d7U-HvaOH_Z0.js";
|
|
3
|
+
import { n as p } from "./Iconify-D3gVmKx3.js";
|
|
4
|
+
import { d as x } from "./index.es-B8p8KCdj--cmqwwUJ.js";
|
|
5
|
+
import './assets/OfflineView-CIwV08EQ.css';const A = "_gapAndTextAlign_10nts_1", y = "_container_10nts_6", W = "_bgWhite_10nts_12", N = "_bgGrey_10nts_17", T = "_subtitle_10nts_22", t = {
|
|
6
6
|
gapAndTextAlign: A,
|
|
7
7
|
container: y,
|
|
8
8
|
bgWhite: W,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._disclaimer_1k38t_1{color:var(--lmnt-theme-danger);font-style:normal;line-height:20px}._iconArea_1k38t_7{display:flex;justify-content:center}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
._truncate_wgwcv_1{display:-webkit-box;line-clamp:2;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;max-width:100%;word-break:break-all}._truncate_wgwcv_1 *:not([class*=lmnt-icon]){overflow:hidden;text-overflow:ellipsis;word-break:break-all}._menu_148i2_1{width:15.875rem;border-radius:.5rem!important}._icon_148i2_6{color:var(--lmnt-theme-on-secondary-inactive)}._listItem_148i2_10 [class*=mdc-list-item__start]{color:var(--lmnt-theme-on-secondary-inactive);align-self:center!important;margin:0 1rem!important}._listItem_148i2_10 [class*=mdc-list-item__end]{color:var(--lmnt-theme-on-secondary-inactive)}._offlineViewMargin_148i2_20{margin:.5rem}.
|
|
1
|
+
._truncate_wgwcv_1{display:-webkit-box;line-clamp:2;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;max-width:100%;word-break:break-all}._truncate_wgwcv_1 *:not([class*=lmnt-icon]){overflow:hidden;text-overflow:ellipsis;word-break:break-all}._menu_148i2_1{width:15.875rem;border-radius:.5rem!important}._icon_148i2_6{color:var(--lmnt-theme-on-secondary-inactive)}._listItem_148i2_10 [class*=mdc-list-item__start]{color:var(--lmnt-theme-on-secondary-inactive);align-self:center!important;margin:0 1rem!important}._listItem_148i2_10 [class*=mdc-list-item__end]{color:var(--lmnt-theme-on-secondary-inactive)}._offlineViewMargin_148i2_20{margin:.5rem}._cardTitle_1w5we_1{padding:.5rem!important}._cardBody_1w5we_5{padding:.25rem .5rem!important;overflow:hidden!important}._cardContent_1w5we_10{border-radius:.5rem}._row_1w5we_14{padding:.25rem 0}._font_1w5we_18{font-weight:400;align-self:end}._fontHeader_1w5we_23{text-align:right}._title_1w5we_27{display:inline-block;width:65vw;text-wrap:nowrap}._emptyContainer_1w5we_33{width:inherit;height:inherit}._empty_1w5we_33{position:relative;top:50%;left:50%;transform:translate(-50%,-25%)}._fullWidth_1w5we_45{width:100%}._topBar_wc5ga_1 [class*=lmnt-table__top-bar__title]{display:none}._filterBar_wc5ga_5{padding:1rem;width:inherit!important}._start_wc5ga_10{padding-top:0;padding-bottom:0}._emptyTable_wc5ga_15{height:16rem}[class*=mnt-pagination][class*=mdc-data-table__pagination]{border-top:1px solid var(--lmnt-theme-on-secondary-stroke)}._elevation_wc5ga_23{border-radius:.4rem;width:100%}._table_wc5ga_28,._table_wc5ga_28 [class*=mdc-data-table__table-container]{border-radius:.4rem}._table_wc5ga_28 *[id=actions]{width:44px;padding:0 2px;position:sticky;right:0;background-color:var(--lmnt-theme-background)}._table_wc5ga_28 tr:hover td[id=actions]{background-color:var(--table-bg-color-hover)}._noBorder_wc5ga_48{border:none}._fullWidth_wc5ga_52{width:100%}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { ai as s, aj as Y, ak as Z } from "./useTranslation-BQQybhSd.js";
|
|
2
|
+
var p, k;
|
|
3
|
+
function tt() {
|
|
4
|
+
if (k) return p;
|
|
5
|
+
k = 1;
|
|
6
|
+
var t = typeof s == "object" && s && s.Object === Object && s;
|
|
7
|
+
return p = t, p;
|
|
8
|
+
}
|
|
9
|
+
var y, x;
|
|
10
|
+
function T() {
|
|
11
|
+
if (x) return y;
|
|
12
|
+
x = 1;
|
|
13
|
+
var t = tt(), r = typeof self == "object" && self && self.Object === Object && self, n = t || r || Function("return this")();
|
|
14
|
+
return y = n, y;
|
|
15
|
+
}
|
|
16
|
+
var b, A;
|
|
17
|
+
function B() {
|
|
18
|
+
if (A) return b;
|
|
19
|
+
A = 1;
|
|
20
|
+
var t = T(), r = t.Symbol;
|
|
21
|
+
return b = r, b;
|
|
22
|
+
}
|
|
23
|
+
var d, D;
|
|
24
|
+
function rt() {
|
|
25
|
+
if (D) return d;
|
|
26
|
+
D = 1;
|
|
27
|
+
var t = B(), r = Object.prototype, n = r.hasOwnProperty, e = r.toString, o = t ? t.toStringTag : void 0;
|
|
28
|
+
function a(u) {
|
|
29
|
+
var i = n.call(u, o), c = u[o];
|
|
30
|
+
try {
|
|
31
|
+
u[o] = void 0;
|
|
32
|
+
var l = !0;
|
|
33
|
+
} catch {
|
|
34
|
+
}
|
|
35
|
+
var v = e.call(u);
|
|
36
|
+
return l && (i ? u[o] = c : delete u[o]), v;
|
|
37
|
+
}
|
|
38
|
+
return d = a, d;
|
|
39
|
+
}
|
|
40
|
+
var g, N;
|
|
41
|
+
function nt() {
|
|
42
|
+
if (N) return g;
|
|
43
|
+
N = 1;
|
|
44
|
+
var t = Object.prototype, r = t.toString;
|
|
45
|
+
function n(e) {
|
|
46
|
+
return r.call(e);
|
|
47
|
+
}
|
|
48
|
+
return g = n, g;
|
|
49
|
+
}
|
|
50
|
+
var h, R;
|
|
51
|
+
function et() {
|
|
52
|
+
if (R) return h;
|
|
53
|
+
R = 1;
|
|
54
|
+
var t = B(), r = rt(), n = nt(), e = "[object Null]", o = "[object Undefined]", a = t ? t.toStringTag : void 0;
|
|
55
|
+
function u(i) {
|
|
56
|
+
return i == null ? i === void 0 ? o : e : a && a in Object(i) ? r(i) : n(i);
|
|
57
|
+
}
|
|
58
|
+
return h = u, h;
|
|
59
|
+
}
|
|
60
|
+
var $, I;
|
|
61
|
+
function pt() {
|
|
62
|
+
if (I) return $;
|
|
63
|
+
I = 1;
|
|
64
|
+
function t(r) {
|
|
65
|
+
return r != null && typeof r == "object";
|
|
66
|
+
}
|
|
67
|
+
return $ = t, $;
|
|
68
|
+
}
|
|
69
|
+
var j, L;
|
|
70
|
+
function yt() {
|
|
71
|
+
if (L) return j;
|
|
72
|
+
L = 1;
|
|
73
|
+
var t = Array.isArray;
|
|
74
|
+
return j = t, j;
|
|
75
|
+
}
|
|
76
|
+
var O, M;
|
|
77
|
+
function K() {
|
|
78
|
+
if (M) return O;
|
|
79
|
+
M = 1;
|
|
80
|
+
function t(r) {
|
|
81
|
+
var n = typeof r;
|
|
82
|
+
return r != null && (n == "object" || n == "function");
|
|
83
|
+
}
|
|
84
|
+
return O = t, O;
|
|
85
|
+
}
|
|
86
|
+
var m, q;
|
|
87
|
+
function ot() {
|
|
88
|
+
if (q) return m;
|
|
89
|
+
q = 1;
|
|
90
|
+
var t = et(), r = K(), n = "[object AsyncFunction]", e = "[object Function]", o = "[object GeneratorFunction]", a = "[object Proxy]";
|
|
91
|
+
function u(i) {
|
|
92
|
+
if (!r(i))
|
|
93
|
+
return !1;
|
|
94
|
+
var c = t(i);
|
|
95
|
+
return c == e || c == o || c == n || c == a;
|
|
96
|
+
}
|
|
97
|
+
return m = u, m;
|
|
98
|
+
}
|
|
99
|
+
var S, z;
|
|
100
|
+
function ut() {
|
|
101
|
+
if (z) return S;
|
|
102
|
+
z = 1;
|
|
103
|
+
var t = T(), r = t["__core-js_shared__"];
|
|
104
|
+
return S = r, S;
|
|
105
|
+
}
|
|
106
|
+
var E, G;
|
|
107
|
+
function it() {
|
|
108
|
+
if (G) return E;
|
|
109
|
+
G = 1;
|
|
110
|
+
var t = ut(), r = function() {
|
|
111
|
+
var e = /[^.]+$/.exec(t && t.keys && t.keys.IE_PROTO || "");
|
|
112
|
+
return e ? "Symbol(src)_1." + e : "";
|
|
113
|
+
}();
|
|
114
|
+
function n(e) {
|
|
115
|
+
return !!r && r in e;
|
|
116
|
+
}
|
|
117
|
+
return E = n, E;
|
|
118
|
+
}
|
|
119
|
+
var F, U;
|
|
120
|
+
function at() {
|
|
121
|
+
if (U) return F;
|
|
122
|
+
U = 1;
|
|
123
|
+
var t = Function.prototype, r = t.toString;
|
|
124
|
+
function n(e) {
|
|
125
|
+
if (e != null) {
|
|
126
|
+
try {
|
|
127
|
+
return r.call(e);
|
|
128
|
+
} catch {
|
|
129
|
+
}
|
|
130
|
+
try {
|
|
131
|
+
return e + "";
|
|
132
|
+
} catch {
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return "";
|
|
136
|
+
}
|
|
137
|
+
return F = n, F;
|
|
138
|
+
}
|
|
139
|
+
var w, W;
|
|
140
|
+
function ct() {
|
|
141
|
+
if (W) return w;
|
|
142
|
+
W = 1;
|
|
143
|
+
var t = ot(), r = it(), n = K(), e = at(), o = /[\\^$.*+?()[\]{}|]/g, a = /^\[object .+?Constructor\]$/, u = Function.prototype, i = Object.prototype, c = u.toString, l = i.hasOwnProperty, v = RegExp(
|
|
144
|
+
"^" + c.call(l).replace(o, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
145
|
+
);
|
|
146
|
+
function Q(f) {
|
|
147
|
+
if (!n(f) || r(f))
|
|
148
|
+
return !1;
|
|
149
|
+
var X = t(f) ? v : a;
|
|
150
|
+
return X.test(e(f));
|
|
151
|
+
}
|
|
152
|
+
return w = Q, w;
|
|
153
|
+
}
|
|
154
|
+
var P, H;
|
|
155
|
+
function ft() {
|
|
156
|
+
if (H) return P;
|
|
157
|
+
H = 1;
|
|
158
|
+
function t(r, n) {
|
|
159
|
+
return r == null ? void 0 : r[n];
|
|
160
|
+
}
|
|
161
|
+
return P = t, P;
|
|
162
|
+
}
|
|
163
|
+
var _, J;
|
|
164
|
+
function st() {
|
|
165
|
+
if (J) return _;
|
|
166
|
+
J = 1;
|
|
167
|
+
var t = ct(), r = ft();
|
|
168
|
+
function n(e, o) {
|
|
169
|
+
var a = r(e, o);
|
|
170
|
+
return t(a) ? a : void 0;
|
|
171
|
+
}
|
|
172
|
+
return _ = n, _;
|
|
173
|
+
}
|
|
174
|
+
var C, V;
|
|
175
|
+
function bt() {
|
|
176
|
+
if (V) return C;
|
|
177
|
+
V = 1;
|
|
178
|
+
var t = st(), r = T(), n = t(r, "Map");
|
|
179
|
+
return C = n, C;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* @license
|
|
183
|
+
* Copyright 2016 Google Inc.
|
|
184
|
+
*
|
|
185
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
186
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
187
|
+
* in the Software without restriction, including without limitation the rights
|
|
188
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
189
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
190
|
+
* furnished to do so, subject to the following conditions:
|
|
191
|
+
*
|
|
192
|
+
* The above copyright notice and this permission notice shall be included in
|
|
193
|
+
* all copies or substantial portions of the Software.
|
|
194
|
+
*
|
|
195
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
196
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
197
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
198
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
199
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
200
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
201
|
+
* THE SOFTWARE.
|
|
202
|
+
*/
|
|
203
|
+
var lt = (
|
|
204
|
+
/** @class */
|
|
205
|
+
function() {
|
|
206
|
+
function t(r) {
|
|
207
|
+
r === void 0 && (r = {}), this.adapter = r;
|
|
208
|
+
}
|
|
209
|
+
return Object.defineProperty(t, "cssClasses", {
|
|
210
|
+
get: function() {
|
|
211
|
+
return {};
|
|
212
|
+
},
|
|
213
|
+
enumerable: !1,
|
|
214
|
+
configurable: !0
|
|
215
|
+
}), Object.defineProperty(t, "strings", {
|
|
216
|
+
get: function() {
|
|
217
|
+
return {};
|
|
218
|
+
},
|
|
219
|
+
enumerable: !1,
|
|
220
|
+
configurable: !0
|
|
221
|
+
}), Object.defineProperty(t, "numbers", {
|
|
222
|
+
get: function() {
|
|
223
|
+
return {};
|
|
224
|
+
},
|
|
225
|
+
enumerable: !1,
|
|
226
|
+
configurable: !0
|
|
227
|
+
}), Object.defineProperty(t, "defaultAdapter", {
|
|
228
|
+
get: function() {
|
|
229
|
+
return {};
|
|
230
|
+
},
|
|
231
|
+
enumerable: !1,
|
|
232
|
+
configurable: !0
|
|
233
|
+
}), t.prototype.init = function() {
|
|
234
|
+
}, t.prototype.destroy = function() {
|
|
235
|
+
}, t;
|
|
236
|
+
}()
|
|
237
|
+
);
|
|
238
|
+
/**
|
|
239
|
+
* @license
|
|
240
|
+
* Copyright 2016 Google Inc.
|
|
241
|
+
*
|
|
242
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
243
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
244
|
+
* in the Software without restriction, including without limitation the rights
|
|
245
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
246
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
247
|
+
* furnished to do so, subject to the following conditions:
|
|
248
|
+
*
|
|
249
|
+
* The above copyright notice and this permission notice shall be included in
|
|
250
|
+
* all copies or substantial portions of the Software.
|
|
251
|
+
*
|
|
252
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
253
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
254
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
255
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
256
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
257
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
258
|
+
* THE SOFTWARE.
|
|
259
|
+
*/
|
|
260
|
+
var dt = (
|
|
261
|
+
/** @class */
|
|
262
|
+
function() {
|
|
263
|
+
function t(r, n) {
|
|
264
|
+
for (var e = [], o = 2; o < arguments.length; o++)
|
|
265
|
+
e[o - 2] = arguments[o];
|
|
266
|
+
this.root = r, this.initialize.apply(this, Y([], Z(e))), this.foundation = n === void 0 ? this.getDefaultFoundation() : n, this.foundation.init(), this.initialSyncWithDOM();
|
|
267
|
+
}
|
|
268
|
+
return t.attachTo = function(r) {
|
|
269
|
+
return new t(r, new lt({}));
|
|
270
|
+
}, t.prototype.initialize = function() {
|
|
271
|
+
}, t.prototype.getDefaultFoundation = function() {
|
|
272
|
+
throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class");
|
|
273
|
+
}, t.prototype.initialSyncWithDOM = function() {
|
|
274
|
+
}, t.prototype.destroy = function() {
|
|
275
|
+
this.foundation.destroy();
|
|
276
|
+
}, t.prototype.listen = function(r, n, e) {
|
|
277
|
+
this.root.addEventListener(r, n, e);
|
|
278
|
+
}, t.prototype.unlisten = function(r, n, e) {
|
|
279
|
+
this.root.removeEventListener(r, n, e);
|
|
280
|
+
}, t.prototype.emit = function(r, n, e) {
|
|
281
|
+
e === void 0 && (e = !1);
|
|
282
|
+
var o;
|
|
283
|
+
typeof CustomEvent == "function" ? o = new CustomEvent(r, {
|
|
284
|
+
bubbles: e,
|
|
285
|
+
detail: n
|
|
286
|
+
}) : (o = document.createEvent("CustomEvent"), o.initCustomEvent(r, e, !1, n)), this.root.dispatchEvent(o);
|
|
287
|
+
}, t;
|
|
288
|
+
}()
|
|
289
|
+
);
|
|
290
|
+
export {
|
|
291
|
+
tt as A,
|
|
292
|
+
et as F,
|
|
293
|
+
st as G,
|
|
294
|
+
bt as H,
|
|
295
|
+
ot as J,
|
|
296
|
+
pt as N,
|
|
297
|
+
K as T,
|
|
298
|
+
yt as U,
|
|
299
|
+
lt as a,
|
|
300
|
+
dt as f,
|
|
301
|
+
B as h,
|
|
302
|
+
T as k,
|
|
303
|
+
at as w
|
|
304
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { k as T, l as v
|
|
1
|
+
import { k as T, l as v } from "./useTranslation-BQQybhSd.js";
|
|
2
|
+
import { a as E, f as S } from "./component-Bz_dtX1r-DqCAj-DR.js";
|
|
2
3
|
/**
|
|
3
4
|
* @license
|
|
4
5
|
* Copyright 2018 Google Inc.
|
|
@@ -44,7 +45,7 @@ function R(n) {
|
|
|
44
45
|
var e = t.scrollWidth;
|
|
45
46
|
return document.documentElement.removeChild(t), e;
|
|
46
47
|
}
|
|
47
|
-
const
|
|
48
|
+
const N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
48
49
|
__proto__: null,
|
|
49
50
|
closest: I,
|
|
50
51
|
estimateScrollWidth: R,
|
|
@@ -471,7 +472,7 @@ var b = [
|
|
|
471
472
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
472
473
|
* THE SOFTWARE.
|
|
473
474
|
*/
|
|
474
|
-
var
|
|
475
|
+
var M = (
|
|
475
476
|
/** @class */
|
|
476
477
|
function(n) {
|
|
477
478
|
T(i, n);
|
|
@@ -561,9 +562,9 @@ var N = (
|
|
|
561
562
|
);
|
|
562
563
|
export {
|
|
563
564
|
R as D,
|
|
564
|
-
|
|
565
|
+
N as M,
|
|
565
566
|
V as O,
|
|
566
|
-
|
|
567
|
+
M as U,
|
|
567
568
|
h as _,
|
|
568
569
|
I as b,
|
|
569
570
|
p
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Allowed } from '@hortiview/shared-components';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
|
|
4
|
+
export type DefaultAllowedComponentProps = Omit<React.ComponentProps<typeof Allowed>, 'disclaimerText'>;
|
|
5
|
+
/**
|
|
6
|
+
* Default allowed component for the HortiView frontend.
|
|
7
|
+
* It provides a default disclaimer text using internationalization.
|
|
8
|
+
* @param param0
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare const DefaultAllowedComponent: ({ ...props }: DefaultAllowedComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { O as c, I as d, D as m } from "../../index.es-SjZ_-d7U-HvaOH_Z0.js";
|
|
3
|
+
import { m as u, u as f } from "../../useTranslation-BQQybhSd.js";
|
|
4
|
+
import { useContext as h, createContext as p, useCallback as x } from "react";
|
|
5
|
+
import { InternationalizationWrapper as v } from "../InternationalizationWrapper/InternationalizationWrapper.js";
|
|
6
|
+
import '../../assets/DefaultAllowedComponent.css';const y = p(void 0), A = () => {
|
|
7
|
+
const e = h(y);
|
|
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") }) });
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
z as DefaultAllowedComponent
|
|
51
|
+
};
|