@telia-ace/widget-types-grid 1.0.35-next.5 → 1.0.35
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/index.js +166 -166
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var we = Object.defineProperty, ve = Object.defineProperties;
|
|
|
2
2
|
var Ee = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var W = Object.getOwnPropertySymbols;
|
|
4
4
|
var oe = Object.prototype.hasOwnProperty, re = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var ie = (t, e, n) => e in t ? we(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n,
|
|
5
|
+
var ie = (t, e, n) => e in t ? we(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, p = (t, e) => {
|
|
6
6
|
for (var n in e || (e = {}))
|
|
7
7
|
oe.call(e, n) && ie(t, n, e[n]);
|
|
8
8
|
if (W)
|
|
@@ -10,7 +10,7 @@ var ie = (t, e, n) => e in t ? we(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
10
10
|
re.call(e, n) && ie(t, n, e[n]);
|
|
11
11
|
return t;
|
|
12
12
|
}, C = (t, e) => ve(t, Ee(e));
|
|
13
|
-
var
|
|
13
|
+
var M = (t, e) => {
|
|
14
14
|
var n = {};
|
|
15
15
|
for (var s in t)
|
|
16
16
|
oe.call(t, s) && e.indexOf(s) < 0 && (n[s] = t[s]);
|
|
@@ -21,21 +21,21 @@ var N = (t, e) => {
|
|
|
21
21
|
};
|
|
22
22
|
import { css as ue, ThemeProvider as Ce, useTheme as Oe } from "@emotion/react";
|
|
23
23
|
import { asDescriptor as ae, ComponentPlatform as Se, createComponentModel as Ae, ComponentQuery as De, WidgetRenderState as O } from "@telia-ace/widget-core";
|
|
24
|
-
import { Grid as de, useRouteData as
|
|
25
|
-
import
|
|
24
|
+
import { Grid as de, useRouteData as Ne, useRouter as xe, useProperties as he, useContext as X, useContainer as T, useComponentNode as ee, useScroll as pe, transitionComposer as Me, paddedBorderTabStyle as $e, useComponent as Le, useComponentDescriptor as ke, filterCssPropsStyle as Pe, Typography as Re, useComponentPlatform as me, useIsMounted as Ve, useColumns as _e, useLayout as Ie, ComponentNodeContext as ze, ComponentPropertyContext as Be, filterCssProps as Te } from "@telia-ace/widget-ui";
|
|
25
|
+
import d, { useState as z, forwardRef as fe, useMemo as je, Suspense as Ge, useEffect as B } from "react";
|
|
26
26
|
import P from "@emotion/styled";
|
|
27
27
|
import { appendClassNames as K, notifyDataLoaded as We, lock as q, removeNullAndUndefinedValues as ce, uuid as Fe } from "@telia-ace/widget-utilities";
|
|
28
28
|
import { TransitionGroup as He, Transition as Ke } from "react-transition-group";
|
|
29
29
|
import { Switch as Ue, Route as Q } from "react-router";
|
|
30
30
|
import { onWidgetUrl as Ye } from "@telia-ace/widget-routing";
|
|
31
|
-
import { readStorage as $, StorageMedium as
|
|
31
|
+
import { readStorage as $, StorageMedium as E, createStorageWriter as V, StorageCategory as _, StorageScope as qe } from "@telia-ace/widget-services";
|
|
32
32
|
import { supportBootstrapping as Qe } from "@webprovisions/bootstrapping";
|
|
33
33
|
import { WidgetState as Ze, WidgetType as Je } from "@webprovisions/platform";
|
|
34
34
|
var J = /* @__PURE__ */ ((t) => (t.back = "back", t.forth = "forth", t))(J || {});
|
|
35
|
-
const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[t] > n[e] ? "back" : "forth", et = ({ views: t, location: e, render: n }) => /* @__PURE__ */
|
|
35
|
+
const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[t] > n[e] ? "back" : "forth", et = ({ views: t, location: e, render: n }) => /* @__PURE__ */ d.createElement(
|
|
36
36
|
Ue,
|
|
37
37
|
{
|
|
38
|
-
location: e && C(
|
|
38
|
+
location: e && C(p({}, e), {
|
|
39
39
|
pathname: e.pathname.split("?")[0]
|
|
40
40
|
})
|
|
41
41
|
},
|
|
@@ -44,7 +44,7 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
44
44
|
...Object.keys(t).filter((s) => !t[s].path)
|
|
45
45
|
].map((s) => {
|
|
46
46
|
const { path: i } = t[s];
|
|
47
|
-
return i ? Array.isArray(i) ? i.map((o) => /* @__PURE__ */
|
|
47
|
+
return i ? Array.isArray(i) ? i.map((o) => /* @__PURE__ */ d.createElement(Q, { key: s, exact: !0, path: o, render: () => n(s) })) : /* @__PURE__ */ d.createElement(Q, { key: s, exact: !0, path: i, render: () => n(s) }) : /* @__PURE__ */ d.createElement(Q, { key: s, render: () => n(s) });
|
|
48
48
|
})
|
|
49
49
|
), ge = et, tt = P.div`
|
|
50
50
|
position: relative;
|
|
@@ -65,61 +65,61 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
65
65
|
"contact-method": 6,
|
|
66
66
|
conversation: 7
|
|
67
67
|
}, it = (n) => {
|
|
68
|
-
var s = n, { className: t = "" } = s, e =
|
|
69
|
-
const [i, o] = z("index"), [r, c] = z(J.forth), a =
|
|
70
|
-
if (!
|
|
68
|
+
var s = n, { className: t = "" } = s, e = M(s, ["className"]);
|
|
69
|
+
const [i, o] = z("index"), [r, c] = z(J.forth), a = Ne(), u = xe(), h = he(), l = X(), g = T(), f = ee(), { gap: m = "0" } = l, G = h, { columns: y = 1, animation: b = "none", scrollable: w = !1 } = G, A = M(G, ["columns", "animation", "scrollable"]), [j, L] = pe(w);
|
|
70
|
+
if (!f || !u)
|
|
71
71
|
return null;
|
|
72
72
|
const { location: se } = u;
|
|
73
|
-
a.name !== i && a.name !== "" &&
|
|
74
|
-
const { views: D } =
|
|
73
|
+
a.name !== i && a.name !== "" && b && (c(Xe(i, a.name, st)), o(a.name));
|
|
74
|
+
const { views: D } = g.get("$settings");
|
|
75
75
|
if (!Object.keys(D).length)
|
|
76
76
|
return null;
|
|
77
|
-
const
|
|
78
|
-
const S = Y(
|
|
79
|
-
return /* @__PURE__ */
|
|
77
|
+
const N = (v, x, R) => {
|
|
78
|
+
const S = Y(x, R), I = f.getChildren(v)[0];
|
|
79
|
+
return /* @__PURE__ */ d.createElement(
|
|
80
80
|
nt,
|
|
81
|
-
C(
|
|
81
|
+
C(p(C(p(p({}, e), A), {
|
|
82
82
|
scrollableCss: j,
|
|
83
83
|
ref: L,
|
|
84
|
-
columns:
|
|
85
|
-
gap:
|
|
84
|
+
columns: y,
|
|
85
|
+
gap: m
|
|
86
86
|
}), S), {
|
|
87
87
|
className: K(t, "humany-view")
|
|
88
88
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ d.createElement(te, { id: I.id, branch: "default" })
|
|
90
90
|
);
|
|
91
|
-
}, Y = (
|
|
92
|
-
if (
|
|
91
|
+
}, Y = (v, x) => {
|
|
92
|
+
if (b === "slide" || b === "fade")
|
|
93
93
|
return {
|
|
94
|
-
animationCss:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
animationCss: Me.composeViewTransition(
|
|
95
|
+
v,
|
|
96
|
+
b,
|
|
97
|
+
x
|
|
98
98
|
),
|
|
99
|
-
["data-state"]:
|
|
99
|
+
["data-state"]: v
|
|
100
100
|
};
|
|
101
101
|
};
|
|
102
|
-
return /* @__PURE__ */
|
|
102
|
+
return /* @__PURE__ */ d.createElement(tt, { className: "humany-animated-view" }, /* @__PURE__ */ d.createElement(
|
|
103
103
|
He,
|
|
104
104
|
{
|
|
105
105
|
component: null,
|
|
106
|
-
childFactory: (
|
|
106
|
+
childFactory: (v) => d.cloneElement(v, { direction: r })
|
|
107
107
|
},
|
|
108
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ d.createElement(
|
|
109
109
|
Ke,
|
|
110
110
|
{
|
|
111
111
|
key: i,
|
|
112
112
|
timeout: { enter: 500, exit: 500 },
|
|
113
|
-
onEnter: (
|
|
113
|
+
onEnter: (v) => v == null ? void 0 : v.clientHeight,
|
|
114
114
|
unmountOnExit: !0,
|
|
115
115
|
direction: J.forth
|
|
116
116
|
},
|
|
117
|
-
(
|
|
117
|
+
(v, { direction: x }) => /* @__PURE__ */ d.createElement(
|
|
118
118
|
ge,
|
|
119
119
|
{
|
|
120
120
|
views: D,
|
|
121
121
|
location: se,
|
|
122
|
-
render: (R) =>
|
|
122
|
+
render: (R) => N(R, v, x)
|
|
123
123
|
}
|
|
124
124
|
)
|
|
125
125
|
)
|
|
@@ -127,24 +127,24 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
127
127
|
}, ot = it, rt = P(de)`
|
|
128
128
|
${(t) => !!t.scrollableCss && t.scrollableCss}
|
|
129
129
|
`, at = (n) => {
|
|
130
|
-
var s = n, { className: t = "" } = s, e =
|
|
131
|
-
const i = he(), o = X(), r = T(), c = ee(), { views: a } = r.get("$settings"), { gap: u = "0" } = o,
|
|
132
|
-
return c ? /* @__PURE__ */
|
|
130
|
+
var s = n, { className: t = "" } = s, e = M(s, ["className"]);
|
|
131
|
+
const i = he(), o = X(), r = T(), c = ee(), { views: a } = r.get("$settings"), { gap: u = "0" } = o, b = i, { columns: h = 1, animation: l = "none", scrollable: g = !1 } = b, f = M(b, ["columns", "animation", "scrollable"]), [m, y] = pe(g);
|
|
132
|
+
return c ? /* @__PURE__ */ d.createElement(
|
|
133
133
|
rt,
|
|
134
|
-
C(
|
|
135
|
-
scrollableCss:
|
|
136
|
-
ref:
|
|
137
|
-
columns:
|
|
134
|
+
C(p(p({}, e), f), {
|
|
135
|
+
scrollableCss: m,
|
|
136
|
+
ref: y,
|
|
137
|
+
columns: h,
|
|
138
138
|
gap: u,
|
|
139
139
|
className: K(t, "humany-view")
|
|
140
140
|
}),
|
|
141
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ d.createElement(
|
|
142
142
|
ge,
|
|
143
143
|
{
|
|
144
144
|
views: a,
|
|
145
|
-
render: (
|
|
146
|
-
const A = c.getChildren(
|
|
147
|
-
return /* @__PURE__ */
|
|
145
|
+
render: (w) => {
|
|
146
|
+
const A = c.getChildren(w)[0];
|
|
147
|
+
return /* @__PURE__ */ d.createElement(te, { id: A.id, node: A, branch: "default" });
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
)
|
|
@@ -194,21 +194,21 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
194
194
|
${(t) => U(t)}
|
|
195
195
|
`, ht = fe(
|
|
196
196
|
(i, s) => {
|
|
197
|
-
var o = i, { className: t = "", children: e } = o, n =
|
|
198
|
-
const r = Le(), { name: c, type: a, id: u } = ke(),
|
|
197
|
+
var o = i, { className: t = "", children: e } = o, n = M(o, ["className", "children"]);
|
|
198
|
+
const r = Le(), { name: c, type: a, id: u } = ke(), h = je(() => r ? P(r)`
|
|
199
199
|
${U}
|
|
200
200
|
${Pe}
|
|
201
201
|
` : null, [r]);
|
|
202
|
-
return typeof r == "undefined" ? null : r === null ||
|
|
202
|
+
return typeof r == "undefined" ? null : r === null || h === null ? process.env.NODE_ENV !== "production" ? /* @__PURE__ */ d.createElement(
|
|
203
203
|
dt,
|
|
204
|
-
C(
|
|
204
|
+
C(p({}, n), {
|
|
205
205
|
title: `type: ${a}, definition-id: ${c}, instance-id: ${u}`,
|
|
206
206
|
className: K(t, "humany-non-resolved-component")
|
|
207
207
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
) : null : /* @__PURE__ */
|
|
210
|
-
|
|
211
|
-
C(
|
|
208
|
+
/* @__PURE__ */ d.createElement(Re, { variant: "h5" }, "Non Resolved Component Type")
|
|
209
|
+
) : null : /* @__PURE__ */ d.createElement(Ge, { fallback: null }, /* @__PURE__ */ d.createElement(
|
|
210
|
+
h,
|
|
211
|
+
C(p({
|
|
212
212
|
ref: s
|
|
213
213
|
}, n), {
|
|
214
214
|
className: K(
|
|
@@ -239,74 +239,74 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
239
239
|
}, [n, o, t, e]), s;
|
|
240
240
|
}, ft = (t, e) => e ? !0 : typeof t == "string" ? t === "full" : t > 0, gt = fe(
|
|
241
241
|
(u, a) => {
|
|
242
|
-
var
|
|
243
|
-
const l = me(),
|
|
242
|
+
var h = u, { className: t = "", id: e, branch: n, node: s, ariaLabel: i, tabIndex: o, context: r } = h, c = M(h, ["className", "id", "branch", "node", "ariaLabel", "tabIndex", "context"]);
|
|
243
|
+
const l = me(), g = T(), [f, m] = z(), y = _e(), b = X(e), w = mt(e), { size: A = "none", indent: j = 0 } = Ie(e), L = ft(A, s);
|
|
244
244
|
if (B(() => {
|
|
245
245
|
if (l) {
|
|
246
246
|
if (e && !s) {
|
|
247
247
|
const S = l.nodes.get(e);
|
|
248
|
-
if (S && (
|
|
249
|
-
const I = S.mount(
|
|
248
|
+
if (S && (m(ae(S, n)), L)) {
|
|
249
|
+
const I = S.mount(g);
|
|
250
250
|
return () => {
|
|
251
251
|
I();
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
254
|
} else if (s) {
|
|
255
|
-
|
|
256
|
-
const S = s.mount(
|
|
255
|
+
m(ae(s, n));
|
|
256
|
+
const S = s.mount(g);
|
|
257
257
|
return () => {
|
|
258
258
|
S();
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
}, [l, e, s, L]), !
|
|
262
|
+
}, [l, e, s, L]), !f || !L)
|
|
263
263
|
return null;
|
|
264
|
-
const R =
|
|
264
|
+
const R = p(p({}, b), r || {}), {
|
|
265
265
|
cardinal: D,
|
|
266
|
-
fonts:
|
|
266
|
+
fonts: N = {},
|
|
267
267
|
accessibility: Y = {}
|
|
268
|
-
} = R, G =
|
|
268
|
+
} = R, G = M(R, [
|
|
269
269
|
"cardinal",
|
|
270
270
|
"fonts",
|
|
271
271
|
"accessibility"
|
|
272
|
-
]),
|
|
273
|
-
type:
|
|
274
|
-
base:
|
|
275
|
-
small:
|
|
276
|
-
normal:
|
|
277
|
-
medium:
|
|
278
|
-
large:
|
|
279
|
-
huge:
|
|
280
|
-
},
|
|
281
|
-
fonts:
|
|
282
|
-
accessibility:
|
|
272
|
+
]), v = {
|
|
273
|
+
type: N.type,
|
|
274
|
+
base: N.base || "16px",
|
|
275
|
+
small: N.small || "0.8em",
|
|
276
|
+
normal: N.normal || "1em",
|
|
277
|
+
medium: N.medium || "1.2em",
|
|
278
|
+
large: N.large || "1.6em",
|
|
279
|
+
huge: N.huge || "2.5em"
|
|
280
|
+
}, x = C(p({}, G), {
|
|
281
|
+
fonts: v,
|
|
282
|
+
accessibility: p({}, Y)
|
|
283
283
|
});
|
|
284
|
-
return typeof D == "number" && (
|
|
284
|
+
return typeof D == "number" && (x.sizes = {
|
|
285
285
|
cardinal: D,
|
|
286
286
|
small: `${D}px`,
|
|
287
287
|
normal: `${D * 3}px`,
|
|
288
288
|
medium: `${D * 5}px`,
|
|
289
289
|
large: `${D * 8}px`
|
|
290
|
-
}), /* @__PURE__ */
|
|
291
|
-
const S =
|
|
292
|
-
"data-width": A === "full" ?
|
|
290
|
+
}), /* @__PURE__ */ d.createElement(Ce, { theme: x }, /* @__PURE__ */ d.createElement(ze.Provider, { value: f }, /* @__PURE__ */ d.createElement(Be.Provider, { value: w }, (() => {
|
|
291
|
+
const S = p({
|
|
292
|
+
"data-width": A === "full" ? y : Math.min(A, y),
|
|
293
293
|
"data-indent": j,
|
|
294
|
-
"data-name":
|
|
295
|
-
"data-node-id":
|
|
296
|
-
"data-component-type":
|
|
294
|
+
"data-name": f.name,
|
|
295
|
+
"data-node-id": f.id,
|
|
296
|
+
"data-component-type": f.type,
|
|
297
297
|
"aria-label": i,
|
|
298
298
|
tabIndex: o,
|
|
299
|
-
id:
|
|
300
|
-
role:
|
|
299
|
+
id: f.id,
|
|
300
|
+
role: w && w.role
|
|
301
301
|
}, c);
|
|
302
|
-
switch (
|
|
302
|
+
switch (f.type) {
|
|
303
303
|
case "view":
|
|
304
|
-
return typeof
|
|
304
|
+
return typeof w.animation == "string" && w.animation !== "none" ? /* @__PURE__ */ d.createElement(ut, C(p({}, S), { className: t })) : /* @__PURE__ */ d.createElement(lt, C(p({}, S), { className: t }));
|
|
305
305
|
default: {
|
|
306
|
-
const I = Te(
|
|
307
|
-
return /* @__PURE__ */
|
|
306
|
+
const I = Te(w);
|
|
307
|
+
return /* @__PURE__ */ d.createElement(
|
|
308
308
|
pt,
|
|
309
|
-
C(
|
|
309
|
+
C(p(p({
|
|
310
310
|
ref: a
|
|
311
311
|
}, S), I), {
|
|
312
312
|
className: t
|
|
@@ -316,7 +316,7 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
316
316
|
}
|
|
317
317
|
})())));
|
|
318
318
|
}
|
|
319
|
-
), te = gt,
|
|
319
|
+
), te = gt, bt = ({ builder: t }) => {
|
|
320
320
|
const e = T(), [n, s] = z(null);
|
|
321
321
|
return B(() => {
|
|
322
322
|
e.getAsync("components").then((i) => t(i).then((o) => {
|
|
@@ -328,19 +328,19 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
328
328
|
(o) => o.id !== n.id
|
|
329
329
|
);
|
|
330
330
|
});
|
|
331
|
-
}, [n]), n ? /* @__PURE__ */
|
|
332
|
-
},
|
|
331
|
+
}, [n]), n ? /* @__PURE__ */ d.createElement(te, { id: n.id, node: n, branch: "default" }) : null;
|
|
332
|
+
}, yt = bt, wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
333
333
|
__proto__: null,
|
|
334
|
-
default:
|
|
335
|
-
}, Symbol.toStringTag, { value: "Module" })), vt =
|
|
334
|
+
default: yt
|
|
335
|
+
}, Symbol.toStringTag, { value: "Module" })), vt = d.lazy(() => Promise.resolve().then(() => wt)), Et = ({ showSearch: t = !1 }) => {
|
|
336
336
|
const e = Oe(), n = T();
|
|
337
|
-
return /* @__PURE__ */
|
|
337
|
+
return /* @__PURE__ */ d.createElement(d.Suspense, { fallback: null }, /* @__PURE__ */ d.createElement(
|
|
338
338
|
vt,
|
|
339
339
|
{
|
|
340
340
|
builder: (s) => n.get("settings").then((i) => {
|
|
341
341
|
var u;
|
|
342
342
|
const { properties: o, context: r } = Object.keys(i.components).reduce(
|
|
343
|
-
(
|
|
343
|
+
(h, l) => (i.components[l].type === "not-found" && (h.properties = i.components[l].properties, h.context = i.components[l].context), h),
|
|
344
344
|
{ properties: {}, context: {} }
|
|
345
345
|
);
|
|
346
346
|
o.showSearch = t;
|
|
@@ -348,13 +348,13 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
348
348
|
if (c.name = "not-found-area", c.writeLayout({
|
|
349
349
|
size: "full"
|
|
350
350
|
}), t) {
|
|
351
|
-
const
|
|
352
|
-
(
|
|
351
|
+
const h = Object.keys(i.components).reduce(
|
|
352
|
+
(g, f) => i.components[f].type === "search" ? i.components[f].properties : g,
|
|
353
353
|
{}
|
|
354
354
|
), l = s.createNode("search", { detached: !0 });
|
|
355
|
-
l.writeLayout({ size: "full" }), l.writeProperties(
|
|
355
|
+
l.writeLayout({ size: "full" }), l.writeProperties(p({
|
|
356
356
|
"css-margin-bottom": ((u = e == null ? void 0 : e.sizes) == null ? void 0 : u.normal) || "15px"
|
|
357
|
-
},
|
|
357
|
+
}, h)), c.appendChild(l);
|
|
358
358
|
}
|
|
359
359
|
const a = s.createNode("not-found", { detached: !0 });
|
|
360
360
|
return a.writeLayout({ size: "full" }), a.writeProperties(o), a.writeContext(r), c.appendChild(a), c;
|
|
@@ -419,18 +419,18 @@ function Dt(t) {
|
|
|
419
419
|
e.classList.remove("humany-active"), e.classList.add("humany-loading");
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function be(t, e) {
|
|
423
423
|
t instanceof HTMLElement ? (e && t.setAttribute("title", e), t.classList.add("humany-active"), t.classList.remove("humany-loading")) : t instanceof Array && t.forEach((n) => {
|
|
424
424
|
e && n.setAttribute("title", e), n.classList.add("humany-active"), n.classList.remove("humany-loading");
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
427
|
var k = /* @__PURE__ */ ((t) => (t.Inline = "inline", t.Link = "link", t.Badge = "badge", t.Unsupported = "unsupported", t))(k || {});
|
|
428
|
-
const
|
|
429
|
-
var u,
|
|
430
|
-
const o =
|
|
428
|
+
const Nt = (t, e) => t && e ? "both" : t ? "widgetDOM" : e ? "triggerDOM" : "none", ye = (t) => t ? typeof t == "boolean" && t ? "link" : typeof t == "object" && !Array.isArray(t) ? "badge" : "unsupported" : "inline", xt = (t, e, n, s, i = !1) => {
|
|
429
|
+
var u, h;
|
|
430
|
+
const o = Nt(
|
|
431
431
|
e,
|
|
432
432
|
n
|
|
433
|
-
), r =
|
|
433
|
+
), r = ye(s), c = {
|
|
434
434
|
widgetDOMElement: e ? e.cloneNode(!0) : void 0,
|
|
435
435
|
triggerDOMElement: n ? n.cloneNode(!0) : void 0
|
|
436
436
|
}, a = {
|
|
@@ -453,12 +453,12 @@ const xt = (t, e) => t && e ? "both" : t ? "widgetDOM" : e ? "triggerDOM" : "non
|
|
|
453
453
|
case "triggerDOM": {
|
|
454
454
|
const l = document.createElement("div");
|
|
455
455
|
a.widgetDOMElement = l, r === "inline" ? (l.id = (n == null ? void 0 : n.id) || "", i ? (l.style.display = "none", (u = n == null ? void 0 : n.parentNode) == null || u.appendChild(l), a.callback = () => {
|
|
456
|
-
var
|
|
457
|
-
(
|
|
456
|
+
var g;
|
|
457
|
+
(g = n == null ? void 0 : n.parentNode) == null || g.replaceChild(
|
|
458
458
|
l,
|
|
459
459
|
n
|
|
460
460
|
), l.style.display = (n == null ? void 0 : n.style.display) || "block";
|
|
461
|
-
}) : (
|
|
461
|
+
}) : (h = n == null ? void 0 : n.parentNode) == null || h.replaceChild(
|
|
462
462
|
l,
|
|
463
463
|
n
|
|
464
464
|
), a.cachedOriginals.widgetDOMElement = n, a.cachedOriginals.triggerDOMElement = void 0) : (a.widgetDOMElement = document.body.appendChild(l), a.triggerDOMElement = n);
|
|
@@ -467,14 +467,14 @@ const xt = (t, e) => t && e ? "both" : t ? "widgetDOM" : e ? "triggerDOM" : "non
|
|
|
467
467
|
case "none": {
|
|
468
468
|
const l = document.body.appendChild(document.createElement("div"));
|
|
469
469
|
if (a.widgetDOMElement = l, r !== "inline") {
|
|
470
|
-
const
|
|
471
|
-
r === "link" && (
|
|
470
|
+
const g = document.body.appendChild(document.createElement("a"));
|
|
471
|
+
r === "link" && (g.innerText = t), a.triggerDOMElement = g;
|
|
472
472
|
}
|
|
473
473
|
break;
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
476
|
return a;
|
|
477
|
-
},
|
|
477
|
+
}, Mt = "modals";
|
|
478
478
|
class $t {
|
|
479
479
|
constructor(e, n) {
|
|
480
480
|
this.options = n, this.unsubscribe = [], this.container = e.createChild(this), this.container.register("widgetDOMElement", this.options.widgetDOMElement), this.container.register("triggerDOMElement", this.options.triggerDOMElement);
|
|
@@ -494,14 +494,14 @@ class $t {
|
|
|
494
494
|
return e.getAttribute("data-rendered") === "true" ? Promise.resolve() : (n && this.options.triggerType === k.Badge && Dt(n), import("./render-668e4aa4.js").then((i) => i.default(this.container, e)).then(() => {
|
|
495
495
|
if (e.setAttribute("data-rendered", "true"), n && this.options.triggerType === k.Badge) {
|
|
496
496
|
const o = this.options.triggerOptions.openTooltip;
|
|
497
|
-
|
|
497
|
+
be(n, o);
|
|
498
498
|
}
|
|
499
499
|
We(this.container, e);
|
|
500
500
|
const i = this.container.get("$environment").widgets.all();
|
|
501
501
|
$(
|
|
502
502
|
this.container,
|
|
503
|
-
|
|
504
|
-
|
|
503
|
+
Mt,
|
|
504
|
+
E.Session
|
|
505
505
|
).then((o) => {
|
|
506
506
|
o && o.forEach((r) => {
|
|
507
507
|
i.find(
|
|
@@ -518,14 +518,14 @@ class $t {
|
|
|
518
518
|
n.getAttribute("role") || n.setAttribute("role", "button");
|
|
519
519
|
const { name: s } = this.container.get("$widget"), { label: i, symbol: o, ariaLabel: r, closedTooltip: c, openTooltip: a } = e, u = { closedTooltip: c, openTooltip: a };
|
|
520
520
|
this.options.triggerOptions = u;
|
|
521
|
-
const
|
|
521
|
+
const h = St(n, {
|
|
522
522
|
label: i,
|
|
523
523
|
symbol: o,
|
|
524
524
|
ariaLabel: r,
|
|
525
525
|
widgetName: s,
|
|
526
526
|
tooltip: c
|
|
527
527
|
});
|
|
528
|
-
this.unsubscribe.push(
|
|
528
|
+
this.unsubscribe.push(h);
|
|
529
529
|
}
|
|
530
530
|
dispose() {
|
|
531
531
|
return import("./unmount-063d8ea3.js").then((e) => {
|
|
@@ -553,14 +553,14 @@ class ne {
|
|
|
553
553
|
}
|
|
554
554
|
static create(e) {
|
|
555
555
|
return V(e, F, _.Necessary, {
|
|
556
|
-
medium:
|
|
556
|
+
medium: E.Local
|
|
557
557
|
}).then((n) => new ne(e, n));
|
|
558
558
|
}
|
|
559
559
|
write(e, n, s, i) {
|
|
560
560
|
return q(this)(() => $(
|
|
561
561
|
this.container,
|
|
562
562
|
F,
|
|
563
|
-
|
|
563
|
+
E.Local
|
|
564
564
|
).then((o = {}) => {
|
|
565
565
|
const { keys: r = [], items: c = {} } = o, a = r.indexOf(e);
|
|
566
566
|
return a > -1 && r.splice(a, 1), r.push(e), c[e] = {
|
|
@@ -574,7 +574,7 @@ class ne {
|
|
|
574
574
|
return q(this)(() => $(
|
|
575
575
|
this.container,
|
|
576
576
|
F,
|
|
577
|
-
|
|
577
|
+
E.Local
|
|
578
578
|
).then((n = {}) => {
|
|
579
579
|
const { keys: s = [], items: i = {} } = n, o = s.indexOf(e);
|
|
580
580
|
if (o > -1)
|
|
@@ -585,7 +585,7 @@ class ne {
|
|
|
585
585
|
return q(this)(() => $(
|
|
586
586
|
this.container,
|
|
587
587
|
F,
|
|
588
|
-
|
|
588
|
+
E.Local
|
|
589
589
|
).then((n = {}) => {
|
|
590
590
|
const { keys: s = [], items: i = {} } = n;
|
|
591
591
|
s.forEach((o) => {
|
|
@@ -642,8 +642,8 @@ class Jt extends Je {
|
|
|
642
642
|
}, this.container.registerAsync("storage", () => Rt(this.container)), this.container.registerFactory("settings", () => $(
|
|
643
643
|
this.container,
|
|
644
644
|
Z,
|
|
645
|
-
|
|
646
|
-
).then((n = {}) =>
|
|
645
|
+
E.Local
|
|
646
|
+
).then((n = {}) => p(p({}, this.container.get("$settings")), n))), Qe(this, "load", this.handleBootstrapping), this.container.registerAsync(
|
|
647
647
|
"componentResolver",
|
|
648
648
|
() => _t(this.container)
|
|
649
649
|
), this.container.registerAsync("router", () => Pt(this.container)), this.container.registerAsync("actionResolver", () => Vt(this.container)), this.container.register("matchMedia", window.matchMedia), this.container.registerAsync("components", () => It(this.container));
|
|
@@ -653,47 +653,47 @@ class Jt extends Je {
|
|
|
653
653
|
"actionResolver",
|
|
654
654
|
"router",
|
|
655
655
|
"components"
|
|
656
|
-
);
|
|
657
|
-
return Promise.all([e, this.container.get("settings")]).then(
|
|
658
|
-
([{ actionResolver:
|
|
659
|
-
var
|
|
660
|
-
|
|
656
|
+
), n = this.container.get("csp");
|
|
657
|
+
return n && (window.webprovisionsEnvironmentVariables || (window.webprovisionsEnvironmentVariables = {}), window.webprovisionsEnvironmentVariables.cspNonce = n.cspNonce), Promise.all([e, this.container.get("settings")]).then(
|
|
658
|
+
([{ actionResolver: s, router: i, components: o }, r]) => {
|
|
659
|
+
var u;
|
|
660
|
+
s.subscribe(
|
|
661
661
|
this.widget.name,
|
|
662
|
-
(
|
|
662
|
+
(h, l, g) => this.onAction(l, g)
|
|
663
663
|
);
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
|
|
664
|
+
const c = (h) => {
|
|
665
|
+
o.nodes.query({ type: "view" }).forEach((l) => {
|
|
666
|
+
o.setSwitch(l, h);
|
|
667
667
|
});
|
|
668
|
-
},
|
|
669
|
-
return
|
|
668
|
+
}, a = ((u = i.getInitialRoute()) == null ? void 0 : u.name) || "index";
|
|
669
|
+
return c(a), this.events.subscribe("widget:data-loaded", (h, { element: l }) => {
|
|
670
670
|
this.widget.container.get("seoConfiguration") && this.events.dispatch("widget:preloaded-replaced", {
|
|
671
|
-
element:
|
|
671
|
+
element: l
|
|
672
672
|
});
|
|
673
673
|
}), this.events.subscribe(
|
|
674
674
|
"router:change",
|
|
675
|
-
(
|
|
676
|
-
const { routeData: f } =
|
|
677
|
-
!
|
|
675
|
+
(h, { previous: l = { routeData: {} }, next: g = { routeData: {} } }) => {
|
|
676
|
+
const { routeData: f } = l, { routeData: m } = g, y = Object.keys(r.views).reduce((b, w) => typeof r.views[w].path == "undefined" ? w : b, "");
|
|
677
|
+
!m.name && y ? c(y) : c(m.name), ce(f && f.params), ce(m && m.params), this.container.getAsync("actionResolver").then((b) => {
|
|
678
678
|
b.action(this.widget.name, "routeChange", {
|
|
679
|
-
next:
|
|
679
|
+
next: m,
|
|
680
680
|
previous: f
|
|
681
681
|
});
|
|
682
682
|
});
|
|
683
683
|
}
|
|
684
|
-
),
|
|
684
|
+
), i.initialize();
|
|
685
685
|
}
|
|
686
686
|
);
|
|
687
687
|
}
|
|
688
688
|
attach(e = {}) {
|
|
689
689
|
return this.container.get("settings").then(({ trigger: n }) => {
|
|
690
|
-
var
|
|
690
|
+
var g, f;
|
|
691
691
|
const {
|
|
692
692
|
widgetDOMElement: s,
|
|
693
693
|
key: i = Fe(),
|
|
694
694
|
triggerDOMElement: o,
|
|
695
695
|
withRenderState: r
|
|
696
|
-
} = e, a =
|
|
696
|
+
} = e, a = ye(n) === k.Inline && ((o == null ? void 0 : o.childElementCount) || 0) > 0, u = xt(
|
|
697
697
|
this.widget.name,
|
|
698
698
|
s,
|
|
699
699
|
o,
|
|
@@ -701,37 +701,37 @@ class Jt extends Je {
|
|
|
701
701
|
a
|
|
702
702
|
);
|
|
703
703
|
this.outlets.size < 1 && !r && this.setRenderState("unset");
|
|
704
|
-
const
|
|
705
|
-
const
|
|
706
|
-
|
|
707
|
-
},
|
|
704
|
+
const h = () => {
|
|
705
|
+
const m = () => y.querySelectorAll("[data-loading=true]").length === 0, [y] = this.widget.container.get("widgetDOMElements"), b = (j, L) => {
|
|
706
|
+
m() && (u.callback && u.callback(), L.disconnect());
|
|
707
|
+
}, w = {
|
|
708
708
|
attributes: !0,
|
|
709
709
|
subtree: !0,
|
|
710
710
|
childList: !0
|
|
711
711
|
};
|
|
712
|
-
|
|
712
|
+
m() && u.callback && u.callback(), new MutationObserver(b).observe(y, w);
|
|
713
713
|
};
|
|
714
|
-
a && this.widget.container.getAsync("dataClient").then(({ events:
|
|
715
|
-
|
|
716
|
-
|
|
714
|
+
a && this.widget.container.getAsync("dataClient").then(({ events: m }) => {
|
|
715
|
+
m.subscribe("data-client:fetched", (y, b) => {
|
|
716
|
+
b.unresolvedQueries === 0 && h();
|
|
717
717
|
});
|
|
718
718
|
});
|
|
719
719
|
const l = this.getOrCreateViewOutlet(i, u);
|
|
720
|
-
if (this.outlets.set(i, l), this.widget.events.dispatch("widget:attached", {}, { bubbles: !0 }), u.triggerType === k.Badge && n && ((
|
|
721
|
-
|
|
722
|
-
l.render().then(() => this.renderState()).then((
|
|
720
|
+
if (this.outlets.set(i, l), this.widget.events.dispatch("widget:attached", {}, { bubbles: !0 }), u.triggerType === k.Badge && n && ((g = u.triggerDOMElement) == null || g.setAttribute("aria-expanded", "false"), l == null || l.renderBadge(n)), u.triggerType !== k.Inline && ((f = u.triggerDOMElement) == null || f.addEventListener("click", (m) => {
|
|
721
|
+
m.preventDefault(), this.container.get("settings").then(({ trigger: y }) => {
|
|
722
|
+
l.render().then(() => this.renderState()).then((b) => y && y.action && y.action === "hide" ? b === O.open ? this.hide() : this.open() : b === O.open ? this.close() : this.open());
|
|
723
723
|
});
|
|
724
724
|
})), this.outlets.size > 1)
|
|
725
|
-
return this.renderState().then((
|
|
726
|
-
this.triggerStateIfApplicable(
|
|
725
|
+
return this.renderState().then((m) => {
|
|
726
|
+
this.triggerStateIfApplicable(m);
|
|
727
727
|
});
|
|
728
728
|
if (r)
|
|
729
|
-
return r === "storage" ? this.renderState().then((
|
|
729
|
+
return r === "storage" ? this.renderState().then((m) => {
|
|
730
730
|
if (u.triggerType === k.Inline) {
|
|
731
731
|
this.triggerStateIfApplicable("open");
|
|
732
732
|
return;
|
|
733
733
|
}
|
|
734
|
-
this.triggerStateIfApplicable(
|
|
734
|
+
this.triggerStateIfApplicable(m);
|
|
735
735
|
}) : this.triggerStateIfApplicable(r);
|
|
736
736
|
});
|
|
737
737
|
}
|
|
@@ -771,7 +771,7 @@ class Jt extends Je {
|
|
|
771
771
|
}
|
|
772
772
|
render(e = {}) {
|
|
773
773
|
if (process.env.NODE_ENV !== "production" && console.warn("widget.render() is deprecated. Use widget.attach() instead."), e.open) {
|
|
774
|
-
const n = C(
|
|
774
|
+
const n = C(p({}, e), {
|
|
775
775
|
withRenderState: "open"
|
|
776
776
|
/* Open */
|
|
777
777
|
});
|
|
@@ -786,10 +786,10 @@ class Jt extends Je {
|
|
|
786
786
|
return Promise.all([
|
|
787
787
|
this.container.get("settings"),
|
|
788
788
|
V(this.container, Z, _.Necessary, {
|
|
789
|
-
medium:
|
|
789
|
+
medium: E.Local
|
|
790
790
|
})
|
|
791
791
|
]).then(([n, s]) => Promise.resolve(e(n)).then((i) => s(i).then(() => {
|
|
792
|
-
const o =
|
|
792
|
+
const o = p(p({}, n), i);
|
|
793
793
|
return this.widget.events.dispatch("widget:settings-updated", o), o;
|
|
794
794
|
})));
|
|
795
795
|
}
|
|
@@ -798,7 +798,7 @@ class Jt extends Je {
|
|
|
798
798
|
this.container,
|
|
799
799
|
Z,
|
|
800
800
|
_.Necessary,
|
|
801
|
-
{ medium:
|
|
801
|
+
{ medium: E.Local }
|
|
802
802
|
).then((e) => e()).then(() => this.container.get("settings")).then((e) => {
|
|
803
803
|
this.widget.events.dispatch("widget:settings-updated", e);
|
|
804
804
|
});
|
|
@@ -814,11 +814,11 @@ class Jt extends Je {
|
|
|
814
814
|
const e = () => $(
|
|
815
815
|
this.container,
|
|
816
816
|
H,
|
|
817
|
-
|
|
817
|
+
E.Session
|
|
818
818
|
).then((s = O.closed) => s), n = () => $(
|
|
819
819
|
this.container,
|
|
820
820
|
H,
|
|
821
|
-
|
|
821
|
+
E.Session
|
|
822
822
|
).then((s = O.closed) => s);
|
|
823
823
|
return this.container.getAsync("router").then((s) => s.isSticky() ? n().then((i) => i === O.open ? i : e()) : e());
|
|
824
824
|
}
|
|
@@ -864,10 +864,10 @@ class Jt extends Je {
|
|
|
864
864
|
const { invoke: n, events: s } = this.container.get("$widget");
|
|
865
865
|
return Promise.all([
|
|
866
866
|
V(this.container, H, _.Necessary, {
|
|
867
|
-
medium:
|
|
867
|
+
medium: E.Session
|
|
868
868
|
}),
|
|
869
869
|
V(this.container, H, _.Necessary, {
|
|
870
|
-
medium:
|
|
870
|
+
medium: E.Local,
|
|
871
871
|
duration: { minutes: 5 }
|
|
872
872
|
}),
|
|
873
873
|
this.container.getAsync("router"),
|
|
@@ -918,7 +918,7 @@ class Jt extends Je {
|
|
|
918
918
|
const {
|
|
919
919
|
options: { triggerDOMElement: s, triggerOptions: i }
|
|
920
920
|
} = n, { openTooltip: o, closedTooltip: r } = i || {};
|
|
921
|
-
s && (e ?
|
|
921
|
+
s && (e ? be(s, o) : At(s, r));
|
|
922
922
|
});
|
|
923
923
|
}
|
|
924
924
|
deactivate() {
|
|
@@ -927,13 +927,13 @@ class Jt extends Je {
|
|
|
927
927
|
return this.outlets.forEach((n) => e.push(n.dispose())), $(
|
|
928
928
|
this.container,
|
|
929
929
|
le,
|
|
930
|
-
|
|
930
|
+
E.Local
|
|
931
931
|
).then((n) => n === this.widget.name ? V(
|
|
932
932
|
this.container,
|
|
933
933
|
le,
|
|
934
934
|
_.Necessary,
|
|
935
935
|
{
|
|
936
|
-
medium:
|
|
936
|
+
medium: E.Local,
|
|
937
937
|
scope: qe.Implementation
|
|
938
938
|
}
|
|
939
939
|
).then((s) => s()).then(() => Promise.all(e)) : Promise.all(e));
|
|
@@ -941,7 +941,7 @@ class Jt extends Je {
|
|
|
941
941
|
}
|
|
942
942
|
export {
|
|
943
943
|
te as Component,
|
|
944
|
-
|
|
944
|
+
yt as DetachedComponent,
|
|
945
945
|
Jt as GridWidget,
|
|
946
946
|
Zt as NotFound,
|
|
947
947
|
Jt as Widget,
|