@telia-ace/widget-types-grid 1.0.30-experimental.2 → 1.0.30-experimental.3
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.d.ts +1 -0
- package/dist/index.js +378 -327
- package/dist/index.js.map +1 -1
- package/dist/render.6ad0b099.js +472 -0
- package/dist/render.6ad0b099.js.map +1 -0
- package/dist/ui/widget-root.d.ts +4 -4
- package/package.json +8 -8
- package/dist/render.b6303746.js +0 -494
- package/dist/render.b6303746.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,56 +1,72 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var ie = (t, e, n) => e in t ?
|
|
1
|
+
var ve = Object.defineProperty, Ee = Object.defineProperties;
|
|
2
|
+
var Ce = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var G = Object.getOwnPropertySymbols;
|
|
4
|
+
var re = Object.prototype.hasOwnProperty, ae = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var ie = (t, e, n) => e in t ? ve(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
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var n of
|
|
10
|
-
|
|
7
|
+
re.call(e, n) && ie(t, n, e[n]);
|
|
8
|
+
if (G)
|
|
9
|
+
for (var n of G(e))
|
|
10
|
+
ae.call(e, n) && ie(t, n, e[n]);
|
|
11
11
|
return t;
|
|
12
|
-
}, C = (t, e) =>
|
|
13
|
-
var
|
|
12
|
+
}, C = (t, e) => Ee(t, Ce(e));
|
|
13
|
+
var M = (t, e) => {
|
|
14
14
|
var n = {};
|
|
15
|
-
for (var
|
|
16
|
-
|
|
17
|
-
if (t != null &&
|
|
18
|
-
for (var
|
|
19
|
-
e.indexOf(
|
|
15
|
+
for (var o in t)
|
|
16
|
+
re.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
|
|
17
|
+
if (t != null && G)
|
|
18
|
+
for (var o of G(t))
|
|
19
|
+
e.indexOf(o) < 0 && ae.call(t, o) && (n[o] = t[o]);
|
|
20
20
|
return n;
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
var ce = (t, e, n) => new Promise((o, s) => {
|
|
23
|
+
var i = (a) => {
|
|
24
|
+
try {
|
|
25
|
+
c(n.next(a));
|
|
26
|
+
} catch (l) {
|
|
27
|
+
s(l);
|
|
28
|
+
}
|
|
29
|
+
}, r = (a) => {
|
|
30
|
+
try {
|
|
31
|
+
c(n.throw(a));
|
|
32
|
+
} catch (l) {
|
|
33
|
+
s(l);
|
|
34
|
+
}
|
|
35
|
+
}, c = (a) => a.done ? o(a.value) : Promise.resolve(a.value).then(i, r);
|
|
36
|
+
c((n = n.apply(t, e)).next());
|
|
37
|
+
});
|
|
38
|
+
import { Grid as de, useRouteData as Oe, useRouter as Se, useProperties as he, useContext as ee, useContainer as B, useComponentNode as te, useScroll as me, transitionComposer as Ae, paddedBorderTabStyle as $e, useComponent as xe, useComponentDescriptor as De, filterCssPropsStyle as Me, Typography as Ne, useComponentPlatform as pe, useIsMounted as Le, useColumns as Pe, useLayout as ke, ComponentNodeContext as Re, ComponentPropertyContext as Ve, filterCssProps as _e } from "@telia-ace/widget-ui";
|
|
39
|
+
import h, { useState as T, forwardRef as fe, useMemo as Ie, Suspense as Te, useEffect as z } from "react";
|
|
40
|
+
import { css as ge, ThemeProvider as ze, useTheme as Be } from "@emotion/react";
|
|
41
|
+
import { asDescriptor as J, ComponentPlatform as je, createComponentModel as Fe, ComponentQuery as Ge, WidgetRenderState as O } from "@telia-ace/widget-core";
|
|
42
|
+
import k from "@emotion/styled";
|
|
43
|
+
import { appendClassNames as K, notifyDataLoaded as We, lock as q, removeNullAndUndefinedValues as le, uuid as He } from "@telia-ace/widget-utilities";
|
|
44
|
+
import { TransitionGroup as Ke, Transition as Ue } from "react-transition-group";
|
|
45
|
+
import { Switch as Ye, Route as Q } from "react-router";
|
|
46
|
+
import { onWidgetUrl as qe } from "@telia-ace/widget-routing";
|
|
47
|
+
import { readStorage as N, StorageMedium as v, createStorageWriter as V, StorageCategory as _, StorageScope as Qe } from "@telia-ace/widget-services";
|
|
48
|
+
import { supportBootstrapping as Ze } from "@webprovisions/bootstrapping";
|
|
49
|
+
import { WidgetState as Je, WidgetType as Xe } from "@webprovisions/platform";
|
|
50
|
+
var X = /* @__PURE__ */ ((t) => (t.back = "back", t.forth = "forth", t))(X || {});
|
|
51
|
+
const et = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[t] > n[e] ? "back" : "forth", tt = ({ views: t, location: e, render: n }) => /* @__PURE__ */ h.createElement(
|
|
52
|
+
Ye,
|
|
37
53
|
{
|
|
38
54
|
location: e && C(p({}, e), {
|
|
39
55
|
pathname: e.pathname.split("?")[0]
|
|
40
56
|
})
|
|
41
57
|
},
|
|
42
58
|
[
|
|
43
|
-
...Object.keys(t).filter((
|
|
44
|
-
...Object.keys(t).filter((
|
|
45
|
-
].map((
|
|
46
|
-
const { path:
|
|
47
|
-
return
|
|
59
|
+
...Object.keys(t).filter((o) => !!t[o].path),
|
|
60
|
+
...Object.keys(t).filter((o) => !t[o].path)
|
|
61
|
+
].map((o) => {
|
|
62
|
+
const { path: s } = t[o];
|
|
63
|
+
return s ? Array.isArray(s) ? s.map((i) => /* @__PURE__ */ h.createElement(Q, { key: o, exact: !0, path: i, render: () => n(o) })) : /* @__PURE__ */ h.createElement(Q, { key: o, exact: !0, path: s, render: () => n(o) }) : /* @__PURE__ */ h.createElement(Q, { key: o, render: () => n(o) });
|
|
48
64
|
})
|
|
49
|
-
),
|
|
65
|
+
), ye = tt, nt = k.div`
|
|
50
66
|
position: relative;
|
|
51
67
|
width: 100%;
|
|
52
68
|
flex: 1;
|
|
53
|
-
`,
|
|
69
|
+
`, ot = k(de)`
|
|
54
70
|
position: absolute;
|
|
55
71
|
left: 0;
|
|
56
72
|
right: 0;
|
|
@@ -65,19 +81,19 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
65
81
|
"contact-method": 6,
|
|
66
82
|
conversation: 7
|
|
67
83
|
}, it = (n) => {
|
|
68
|
-
var
|
|
69
|
-
const [
|
|
70
|
-
if (!m || !
|
|
84
|
+
var o = n, { className: t = "" } = o, e = M(o, ["className"]);
|
|
85
|
+
const [s, i] = T("index"), [r, c] = T(X.forth), a = Oe(), l = Se(), d = he(), u = ee(), f = B(), m = te(), { gap: g = "0" } = u, F = d, { columns: b = 1, animation: y = "none", scrollable: E = !1 } = F, A = M(F, ["columns", "animation", "scrollable"]), [j, L] = me(E);
|
|
86
|
+
if (!m || !l)
|
|
71
87
|
return null;
|
|
72
|
-
const { location: se } =
|
|
73
|
-
a.name !==
|
|
74
|
-
const { views:
|
|
75
|
-
if (!Object.keys(
|
|
88
|
+
const { location: se } = l;
|
|
89
|
+
a.name !== s && a.name !== "" && y && (c(et(s, a.name, st)), i(a.name));
|
|
90
|
+
const { views: $ } = f.get("$settings");
|
|
91
|
+
if (!Object.keys($).length)
|
|
76
92
|
return null;
|
|
77
|
-
const x = (w,
|
|
78
|
-
const S = Y(
|
|
93
|
+
const x = (w, D, R) => {
|
|
94
|
+
const S = Y(D, R), I = m.getChildren(w)[0];
|
|
79
95
|
return /* @__PURE__ */ h.createElement(
|
|
80
|
-
|
|
96
|
+
ot,
|
|
81
97
|
C(p(C(p(p({}, e), A), {
|
|
82
98
|
scrollableCss: j,
|
|
83
99
|
ref: L,
|
|
@@ -86,72 +102,72 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
86
102
|
}), S), {
|
|
87
103
|
className: K(t, "humany-view")
|
|
88
104
|
}),
|
|
89
|
-
/* @__PURE__ */ h.createElement(
|
|
105
|
+
/* @__PURE__ */ h.createElement(ne, { id: I.id, branch: "default" })
|
|
90
106
|
);
|
|
91
|
-
}, Y = (w,
|
|
107
|
+
}, Y = (w, D) => {
|
|
92
108
|
if (y === "slide" || y === "fade")
|
|
93
109
|
return {
|
|
94
|
-
animationCss:
|
|
110
|
+
animationCss: Ae.composeViewTransition(
|
|
95
111
|
w,
|
|
96
112
|
y,
|
|
97
|
-
|
|
113
|
+
D
|
|
98
114
|
),
|
|
99
115
|
["data-state"]: w
|
|
100
116
|
};
|
|
101
117
|
};
|
|
102
|
-
return /* @__PURE__ */ h.createElement(
|
|
103
|
-
|
|
118
|
+
return /* @__PURE__ */ h.createElement(nt, { className: "humany-animated-view" }, /* @__PURE__ */ h.createElement(
|
|
119
|
+
Ke,
|
|
104
120
|
{
|
|
105
121
|
component: null,
|
|
106
122
|
childFactory: (w) => h.cloneElement(w, { direction: r })
|
|
107
123
|
},
|
|
108
124
|
/* @__PURE__ */ h.createElement(
|
|
109
|
-
|
|
125
|
+
Ue,
|
|
110
126
|
{
|
|
111
|
-
key:
|
|
127
|
+
key: s,
|
|
112
128
|
timeout: { enter: 500, exit: 500 },
|
|
113
129
|
onEnter: (w) => w == null ? void 0 : w.clientHeight,
|
|
114
130
|
unmountOnExit: !0,
|
|
115
|
-
direction:
|
|
131
|
+
direction: X.forth
|
|
116
132
|
},
|
|
117
|
-
(w, { direction:
|
|
118
|
-
|
|
133
|
+
(w, { direction: D }) => /* @__PURE__ */ h.createElement(
|
|
134
|
+
ye,
|
|
119
135
|
{
|
|
120
|
-
views:
|
|
136
|
+
views: $,
|
|
121
137
|
location: se,
|
|
122
|
-
render: (R) => x(R, w,
|
|
138
|
+
render: (R) => x(R, w, D)
|
|
123
139
|
}
|
|
124
140
|
)
|
|
125
141
|
)
|
|
126
142
|
));
|
|
127
|
-
},
|
|
143
|
+
}, rt = it, at = k(de)`
|
|
128
144
|
${(t) => !!t.scrollableCss && t.scrollableCss}
|
|
129
|
-
`,
|
|
130
|
-
var
|
|
131
|
-
const
|
|
145
|
+
`, ct = (n) => {
|
|
146
|
+
var o = n, { className: t = "" } = o, e = M(o, ["className"]);
|
|
147
|
+
const s = he(), i = ee(), r = B(), c = te(), { views: a } = r.get("$settings"), { gap: l = "0" } = i, y = s, { columns: d = 1, animation: u = "none", scrollable: f = !1 } = y, m = M(y, ["columns", "animation", "scrollable"]), [g, b] = me(f);
|
|
132
148
|
return c ? /* @__PURE__ */ h.createElement(
|
|
133
|
-
|
|
149
|
+
at,
|
|
134
150
|
C(p(p({}, e), m), {
|
|
135
151
|
scrollableCss: g,
|
|
136
152
|
ref: b,
|
|
137
153
|
columns: d,
|
|
138
|
-
gap:
|
|
154
|
+
gap: l,
|
|
139
155
|
className: K(t, "humany-view")
|
|
140
156
|
}),
|
|
141
157
|
/* @__PURE__ */ h.createElement(
|
|
142
|
-
|
|
158
|
+
ye,
|
|
143
159
|
{
|
|
144
160
|
views: a,
|
|
145
161
|
render: (E) => {
|
|
146
162
|
const A = c.getChildren(E)[0];
|
|
147
|
-
return /* @__PURE__ */ h.createElement(
|
|
163
|
+
return /* @__PURE__ */ h.createElement(ne, { id: A.id, node: A, branch: "default" });
|
|
148
164
|
}
|
|
149
165
|
}
|
|
150
166
|
)
|
|
151
167
|
) : null;
|
|
152
|
-
},
|
|
168
|
+
}, lt = ct, U = (t) => {
|
|
153
169
|
var e, n;
|
|
154
|
-
return
|
|
170
|
+
return ge`
|
|
155
171
|
outline: none;
|
|
156
172
|
box-sizing: border-box;
|
|
157
173
|
* {
|
|
@@ -174,42 +190,42 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
174
190
|
`}
|
|
175
191
|
|
|
176
192
|
&:focus-visible {
|
|
177
|
-
${
|
|
193
|
+
${$e(t)};
|
|
178
194
|
}
|
|
179
195
|
`;
|
|
180
|
-
},
|
|
196
|
+
}, ut = k(lt)`
|
|
181
197
|
${(t) => U(t)}
|
|
182
|
-
`,
|
|
198
|
+
`, dt = k(rt)`
|
|
183
199
|
${(t) => U(t)}
|
|
184
|
-
`,
|
|
200
|
+
`, ht = k.div`
|
|
185
201
|
text-align: center;
|
|
186
202
|
${(t) => {
|
|
187
|
-
var e, n,
|
|
188
|
-
return typeof ((e = t.theme.colors) == null ? void 0 : e.warning) != "undefined" &&
|
|
203
|
+
var e, n, o;
|
|
204
|
+
return typeof ((e = t.theme.colors) == null ? void 0 : e.warning) != "undefined" && ge`
|
|
189
205
|
color: ${(n = t.theme.colors) == null ? void 0 : n.warning};
|
|
190
|
-
border: 2px dashed ${(
|
|
206
|
+
border: 2px dashed ${(o = t.theme.colors) == null ? void 0 : o.warning};
|
|
191
207
|
`;
|
|
192
208
|
}}
|
|
193
209
|
${(t) => typeof t.theme.borderRadius != "undefined" && `border-radius: ${t.theme.borderRadius};`}
|
|
194
210
|
${(t) => U(t)}
|
|
195
|
-
`,
|
|
196
|
-
(
|
|
197
|
-
var
|
|
198
|
-
const r =
|
|
211
|
+
`, mt = fe(
|
|
212
|
+
(s, o) => {
|
|
213
|
+
var i = s, { className: t = "", children: e } = i, n = M(i, ["className", "children"]);
|
|
214
|
+
const r = xe(), { name: c, type: a, id: l } = De(), d = Ie(() => r ? k(r)`
|
|
199
215
|
${U}
|
|
200
216
|
${Me}
|
|
201
217
|
` : null, [r]);
|
|
202
218
|
return typeof r == "undefined" ? null : r === null || d === null ? process.env.NODE_ENV !== "production" ? /* @__PURE__ */ h.createElement(
|
|
203
|
-
|
|
219
|
+
ht,
|
|
204
220
|
C(p({}, n), {
|
|
205
|
-
title: `type: ${a}, definition-id: ${c}, instance-id: ${
|
|
221
|
+
title: `type: ${a}, definition-id: ${c}, instance-id: ${l}`,
|
|
206
222
|
className: K(t, "humany-non-resolved-component")
|
|
207
223
|
}),
|
|
208
224
|
/* @__PURE__ */ h.createElement(Ne, { variant: "h5" }, "Non Resolved Component Type")
|
|
209
|
-
) : null : /* @__PURE__ */ h.createElement(
|
|
225
|
+
) : null : /* @__PURE__ */ h.createElement(Te, { fallback: null }, /* @__PURE__ */ h.createElement(
|
|
210
226
|
d,
|
|
211
227
|
C(p({
|
|
212
|
-
ref:
|
|
228
|
+
ref: o
|
|
213
229
|
}, n), {
|
|
214
230
|
className: K(
|
|
215
231
|
t,
|
|
@@ -220,52 +236,52 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
220
236
|
e
|
|
221
237
|
));
|
|
222
238
|
}
|
|
223
|
-
),
|
|
224
|
-
const e =
|
|
225
|
-
return
|
|
226
|
-
e &&
|
|
227
|
-
}, [e, t,
|
|
239
|
+
), pt = mt, ft = (t) => {
|
|
240
|
+
const e = te(t), n = pe(), [o, s] = T({}), i = Le();
|
|
241
|
+
return z(() => {
|
|
242
|
+
e && i.current && s(e.attributes.properties);
|
|
243
|
+
}, [e, t, i]), z(() => {
|
|
228
244
|
if (n) {
|
|
229
245
|
const r = n.events.subscribe(
|
|
230
246
|
"components:properties-changed",
|
|
231
247
|
(c, a) => {
|
|
232
|
-
e === a.node &&
|
|
248
|
+
e === a.node && i.current && s(a.node.attributes.properties);
|
|
233
249
|
}
|
|
234
250
|
);
|
|
235
251
|
return () => {
|
|
236
252
|
r();
|
|
237
253
|
};
|
|
238
254
|
}
|
|
239
|
-
}, [n,
|
|
240
|
-
},
|
|
241
|
-
(
|
|
242
|
-
var d =
|
|
243
|
-
const
|
|
244
|
-
if (
|
|
245
|
-
if (
|
|
246
|
-
if (e && !
|
|
247
|
-
const S =
|
|
248
|
-
if (S && (g(
|
|
255
|
+
}, [n, i, t, e]), o;
|
|
256
|
+
}, gt = (t, e) => e ? !0 : typeof t == "string" ? t === "full" : t > 0, yt = fe(
|
|
257
|
+
(l, a) => {
|
|
258
|
+
var d = l, { className: t = "", id: e, branch: n, node: o, ariaLabel: s, tabIndex: i, context: r } = d, c = M(d, ["className", "id", "branch", "node", "ariaLabel", "tabIndex", "context"]);
|
|
259
|
+
const u = pe(), f = B(), [m, g] = T(), b = Pe(), y = ee(e), E = ft(e), { size: A = "none", indent: j = 0 } = ke(e), L = gt(A, o);
|
|
260
|
+
if (z(() => {
|
|
261
|
+
if (u) {
|
|
262
|
+
if (e && !o) {
|
|
263
|
+
const S = u.nodes.get(e);
|
|
264
|
+
if (S && (g(J(S, n)), L)) {
|
|
249
265
|
const I = S.mount(f);
|
|
250
266
|
return () => {
|
|
251
267
|
I();
|
|
252
268
|
};
|
|
253
269
|
}
|
|
254
|
-
} else if (
|
|
255
|
-
g(
|
|
256
|
-
const S =
|
|
270
|
+
} else if (o) {
|
|
271
|
+
g(J(o, n));
|
|
272
|
+
const S = o.mount(f);
|
|
257
273
|
return () => {
|
|
258
274
|
S();
|
|
259
275
|
};
|
|
260
276
|
}
|
|
261
277
|
}
|
|
262
|
-
}, [
|
|
278
|
+
}, [u, e, o, L]), !m || !L)
|
|
263
279
|
return null;
|
|
264
280
|
const R = p(p({}, y), r || {}), {
|
|
265
|
-
cardinal:
|
|
281
|
+
cardinal: $,
|
|
266
282
|
fonts: x = {},
|
|
267
283
|
accessibility: Y = {}
|
|
268
|
-
} = R,
|
|
284
|
+
} = R, F = M(R, [
|
|
269
285
|
"cardinal",
|
|
270
286
|
"fonts",
|
|
271
287
|
"accessibility"
|
|
@@ -277,35 +293,35 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
277
293
|
medium: x.medium || "1.2em",
|
|
278
294
|
large: x.large || "1.6em",
|
|
279
295
|
huge: x.huge || "2.5em"
|
|
280
|
-
},
|
|
296
|
+
}, D = C(p({}, F), {
|
|
281
297
|
fonts: w,
|
|
282
298
|
accessibility: p({}, Y)
|
|
283
299
|
});
|
|
284
|
-
return typeof
|
|
285
|
-
cardinal:
|
|
286
|
-
small: `${
|
|
287
|
-
normal: `${
|
|
288
|
-
medium: `${
|
|
289
|
-
large: `${
|
|
290
|
-
}), /* @__PURE__ */ h.createElement(ze, { theme:
|
|
300
|
+
return typeof $ == "number" && (D.sizes = {
|
|
301
|
+
cardinal: $,
|
|
302
|
+
small: `${$}px`,
|
|
303
|
+
normal: `${$ * 3}px`,
|
|
304
|
+
medium: `${$ * 5}px`,
|
|
305
|
+
large: `${$ * 8}px`
|
|
306
|
+
}), /* @__PURE__ */ h.createElement(ze, { theme: D }, /* @__PURE__ */ h.createElement(Re.Provider, { value: m }, /* @__PURE__ */ h.createElement(Ve.Provider, { value: E }, (() => {
|
|
291
307
|
const S = p({
|
|
292
308
|
"data-width": A === "full" ? b : Math.min(A, b),
|
|
293
309
|
"data-indent": j,
|
|
294
310
|
"data-name": m.name,
|
|
295
311
|
"data-node-id": m.id,
|
|
296
312
|
"data-component-type": m.type,
|
|
297
|
-
"aria-label":
|
|
298
|
-
tabIndex:
|
|
313
|
+
"aria-label": s,
|
|
314
|
+
tabIndex: i,
|
|
299
315
|
id: m.id,
|
|
300
316
|
role: E && E.role
|
|
301
317
|
}, c);
|
|
302
318
|
switch (m.type) {
|
|
303
319
|
case "view":
|
|
304
|
-
return typeof E.animation == "string" && E.animation !== "none" ? /* @__PURE__ */ h.createElement(
|
|
320
|
+
return typeof E.animation == "string" && E.animation !== "none" ? /* @__PURE__ */ h.createElement(dt, C(p({}, S), { className: t })) : /* @__PURE__ */ h.createElement(ut, C(p({}, S), { className: t }));
|
|
305
321
|
default: {
|
|
306
|
-
const I =
|
|
322
|
+
const I = _e(E);
|
|
307
323
|
return /* @__PURE__ */ h.createElement(
|
|
308
|
-
|
|
324
|
+
pt,
|
|
309
325
|
C(p(p({
|
|
310
326
|
ref: a
|
|
311
327
|
}, S), I), {
|
|
@@ -316,52 +332,86 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
316
332
|
}
|
|
317
333
|
})())));
|
|
318
334
|
}
|
|
319
|
-
),
|
|
320
|
-
const e =
|
|
321
|
-
return
|
|
322
|
-
e.getAsync("components").then((
|
|
323
|
-
|
|
335
|
+
), ne = yt, bt = ({ builder: t }) => {
|
|
336
|
+
const e = B(), [n, o] = T(null);
|
|
337
|
+
return z(() => {
|
|
338
|
+
e.getAsync("components").then((s) => t(s).then((i) => {
|
|
339
|
+
o(i);
|
|
324
340
|
}));
|
|
325
|
-
}, []),
|
|
326
|
-
n && e.getAsync("components").then((
|
|
327
|
-
|
|
328
|
-
(
|
|
341
|
+
}, []), z(() => () => {
|
|
342
|
+
n && e.getAsync("components").then((s) => {
|
|
343
|
+
s.nodes.detached = s.nodes.detached.filter(
|
|
344
|
+
(i) => i.id !== n.id
|
|
329
345
|
);
|
|
330
346
|
});
|
|
331
|
-
}, [n]), n ? /* @__PURE__ */ h.createElement(
|
|
332
|
-
},
|
|
347
|
+
}, [n]), n ? /* @__PURE__ */ h.createElement(ne, { id: n.id, node: n, branch: "default" }) : null;
|
|
348
|
+
}, wt = bt, vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
333
349
|
__proto__: null,
|
|
334
|
-
default:
|
|
335
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
336
|
-
const e = Be(), n =
|
|
350
|
+
default: wt
|
|
351
|
+
}, Symbol.toStringTag, { value: "Module" })), Et = h.lazy(() => Promise.resolve().then(() => vt)), Ct = ({ showSearch: t = !1 }) => {
|
|
352
|
+
const e = Be(), n = B();
|
|
337
353
|
return /* @__PURE__ */ h.createElement(h.Suspense, { fallback: null }, /* @__PURE__ */ h.createElement(
|
|
338
|
-
|
|
354
|
+
Et,
|
|
339
355
|
{
|
|
340
|
-
builder: (
|
|
341
|
-
var
|
|
342
|
-
const { properties:
|
|
343
|
-
(d,
|
|
356
|
+
builder: (o) => n.get("settings").then((s) => {
|
|
357
|
+
var l;
|
|
358
|
+
const { properties: i, context: r } = Object.keys(s.components).reduce(
|
|
359
|
+
(d, u) => (s.components[u].type === "not-found" && (d.properties = s.components[u].properties, d.context = s.components[u].context), d),
|
|
344
360
|
{ properties: {}, context: {} }
|
|
345
361
|
);
|
|
346
|
-
|
|
347
|
-
const c =
|
|
362
|
+
i.showSearch = t;
|
|
363
|
+
const c = o.createNode("area", { detached: !0 });
|
|
348
364
|
if (c.name = "not-found-area", c.writeLayout({
|
|
349
365
|
size: "full"
|
|
350
366
|
}), t) {
|
|
351
|
-
const d = Object.keys(
|
|
352
|
-
(f, m) =>
|
|
367
|
+
const d = Object.keys(s.components).reduce(
|
|
368
|
+
(f, m) => s.components[m].type === "search" ? s.components[m].properties : f,
|
|
353
369
|
{}
|
|
354
|
-
),
|
|
355
|
-
|
|
356
|
-
"css-margin-bottom": ((
|
|
357
|
-
}, d)), c.appendChild(
|
|
370
|
+
), u = o.createNode("search", { detached: !0 });
|
|
371
|
+
u.writeLayout({ size: "full" }), u.writeProperties(p({
|
|
372
|
+
"css-margin-bottom": ((l = e == null ? void 0 : e.sizes) == null ? void 0 : l.normal) || "15px"
|
|
373
|
+
}, d)), c.appendChild(u);
|
|
358
374
|
}
|
|
359
|
-
const a =
|
|
360
|
-
return a.writeLayout({ size: "full" }), a.writeProperties(
|
|
375
|
+
const a = o.createNode("not-found", { detached: !0 });
|
|
376
|
+
return a.writeLayout({ size: "full" }), a.writeProperties(i), a.writeContext(r), c.appendChild(a), c;
|
|
361
377
|
})
|
|
362
378
|
}
|
|
363
379
|
));
|
|
364
|
-
},
|
|
380
|
+
}, Xt = Ct, Ot = (t) => `w-${t}`, en = (t, e, n) => ce(void 0, null, function* () {
|
|
381
|
+
const o = n.nodes.get(t);
|
|
382
|
+
if (!e) {
|
|
383
|
+
console.warn("Could not find resolver. Make sure it is registered on the container.");
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
if (!o) {
|
|
387
|
+
console.warn(`Unable to find node with id: ${t}`);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
const s = J(o);
|
|
391
|
+
if (!(s != null && s.type)) {
|
|
392
|
+
console.warn(`Could not get descriptor for: ${o.name}`);
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
const i = Ot(s.type);
|
|
396
|
+
if (customElements.get(i))
|
|
397
|
+
return;
|
|
398
|
+
const r = e.getComponent(s.type);
|
|
399
|
+
if (!r) {
|
|
400
|
+
console.warn("Component is missing or using incorrect import.");
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
const c = yield r();
|
|
404
|
+
if (!customElements.get(i))
|
|
405
|
+
try {
|
|
406
|
+
customElements.define(i, c.default);
|
|
407
|
+
} catch (a) {
|
|
408
|
+
console.log("error", a);
|
|
409
|
+
}
|
|
410
|
+
return customElements.whenDefined(i).then(() => ({
|
|
411
|
+
nodeId: t,
|
|
412
|
+
tag: i
|
|
413
|
+
}));
|
|
414
|
+
}), St = (t) => {
|
|
365
415
|
if (t) {
|
|
366
416
|
const { type: e, content: n } = t;
|
|
367
417
|
switch (e) {
|
|
@@ -373,22 +423,22 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
|
|
|
373
423
|
return "";
|
|
374
424
|
}
|
|
375
425
|
}
|
|
376
|
-
},
|
|
377
|
-
const e = (
|
|
378
|
-
!
|
|
379
|
-
}, n = (
|
|
380
|
-
|
|
381
|
-
},
|
|
426
|
+
}, At = (t) => {
|
|
427
|
+
const e = (s, i) => {
|
|
428
|
+
!s || (i ? s.classList.add("humany-tabbing") : s.classList.remove("humany-tabbing"));
|
|
429
|
+
}, n = (s) => {
|
|
430
|
+
s.key === "Tab" ? e(t, !0) : s.key === "Enter" && document.activeElement && document.activeElement.classList.contains("humany-trigger") || e(t, !1);
|
|
431
|
+
}, o = (s) => {
|
|
382
432
|
document.activeElement && document.activeElement.classList.contains("humany-trigger") && document.activeElement.classList.contains("humany-tabbing") || e(t, !1);
|
|
383
433
|
};
|
|
384
|
-
return document.addEventListener("keydown", n), document.addEventListener("click",
|
|
385
|
-
document.removeEventListener("keydown", n), document.removeEventListener("click",
|
|
434
|
+
return document.addEventListener("keydown", n), document.addEventListener("click", o), () => {
|
|
435
|
+
document.removeEventListener("keydown", n), document.removeEventListener("click", o);
|
|
386
436
|
};
|
|
387
437
|
};
|
|
388
|
-
function
|
|
389
|
-
const { symbol: n, widgetName:
|
|
390
|
-
t.classList.add("humany-trigger"), t.classList.add(`humany_${
|
|
391
|
-
const c =
|
|
438
|
+
function $t(t, e) {
|
|
439
|
+
const { symbol: n, widgetName: o, label: s = "", ariaLabel: i = "", tooltip: r = "" } = e;
|
|
440
|
+
t.classList.add("humany-trigger"), t.classList.add(`humany_${o}`), s.length && t.classList.add("humany-has-text"), i.length && !t.getAttribute("aria-label") && t.setAttribute("aria-label", i), i.length && !t.getAttribute("tabindex") && t.setAttribute("tabindex", "0"), r.length && !t.getAttribute("title") && t.setAttribute("title", r);
|
|
441
|
+
const c = St(n) || "";
|
|
392
442
|
return t.innerHTML = `${c}
|
|
393
443
|
<span class="humany-close">
|
|
394
444
|
<svg width="18" height="9" viewBox="0 0 18 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -407,9 +457,9 @@ function St(t, e) {
|
|
|
407
457
|
stroke-miterlimit="10" />
|
|
408
458
|
</svg>
|
|
409
459
|
</span>
|
|
410
|
-
${
|
|
460
|
+
${s.length ? `<span>${s}</span>` : ""}`, setTimeout(() => t && t.classList.add("humany-rendered")), At(t);
|
|
411
461
|
}
|
|
412
|
-
function
|
|
462
|
+
function xt(t, e) {
|
|
413
463
|
t instanceof HTMLElement ? (e && t.setAttribute("title", e), t.classList.remove("humany-active"), t.classList.remove("humany-loading")) : t instanceof Array && t.forEach((n) => {
|
|
414
464
|
e && n.setAttribute("title", e), n.classList.remove("humany-active"), n.classList.remove("humany-loading");
|
|
415
465
|
});
|
|
@@ -419,18 +469,18 @@ function Dt(t) {
|
|
|
419
469
|
e.classList.remove("humany-active"), e.classList.add("humany-loading");
|
|
420
470
|
});
|
|
421
471
|
}
|
|
422
|
-
function
|
|
472
|
+
function be(t, e) {
|
|
423
473
|
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
474
|
e && n.setAttribute("title", e), n.classList.add("humany-active"), n.classList.remove("humany-loading");
|
|
425
475
|
});
|
|
426
476
|
}
|
|
427
|
-
var
|
|
428
|
-
const
|
|
429
|
-
var
|
|
430
|
-
const
|
|
477
|
+
var P = /* @__PURE__ */ ((t) => (t.Inline = "inline", t.Link = "link", t.Badge = "badge", t.Unsupported = "unsupported", t))(P || {});
|
|
478
|
+
const Mt = (t, e) => t && e ? "both" : t ? "widgetDOM" : e ? "triggerDOM" : "none", we = (t) => t ? typeof t == "boolean" && t ? "link" : typeof t == "object" && !Array.isArray(t) ? "badge" : "unsupported" : "inline", Nt = (t, e, n, o, s = !1) => {
|
|
479
|
+
var l, d;
|
|
480
|
+
const i = Mt(
|
|
431
481
|
e,
|
|
432
482
|
n
|
|
433
|
-
), r =
|
|
483
|
+
), r = we(o), c = {
|
|
434
484
|
widgetDOMElement: e ? e.cloneNode(!0) : void 0,
|
|
435
485
|
triggerDOMElement: n ? n.cloneNode(!0) : void 0
|
|
436
486
|
}, a = {
|
|
@@ -438,35 +488,35 @@ const xt = (t, e) => t && e ? "both" : t ? "widgetDOM" : e ? "triggerDOM" : "non
|
|
|
438
488
|
cachedOriginals: c,
|
|
439
489
|
widgetDOMElement: document.createElement("div")
|
|
440
490
|
};
|
|
441
|
-
switch (
|
|
491
|
+
switch (i) {
|
|
442
492
|
case "both": {
|
|
443
493
|
a.widgetDOMElement = e || document.createElement("div"), r !== "inline" && (a.triggerDOMElement = n);
|
|
444
494
|
break;
|
|
445
495
|
}
|
|
446
496
|
case "widgetDOM": {
|
|
447
497
|
if (a.widgetDOMElement = e || document.createElement("div"), r !== "inline") {
|
|
448
|
-
const
|
|
449
|
-
r === "link" && (
|
|
498
|
+
const u = document.body.appendChild(document.createElement("a"));
|
|
499
|
+
r === "link" && (u.innerText = t), a.triggerDOMElement = u;
|
|
450
500
|
}
|
|
451
501
|
break;
|
|
452
502
|
}
|
|
453
503
|
case "triggerDOM": {
|
|
454
|
-
const
|
|
455
|
-
a.widgetDOMElement =
|
|
504
|
+
const u = document.createElement("div");
|
|
505
|
+
a.widgetDOMElement = u, r === "inline" ? (u.id = (n == null ? void 0 : n.id) || "", s ? (u.style.display = "none", (l = n == null ? void 0 : n.parentNode) == null || l.appendChild(u), a.callback = () => {
|
|
456
506
|
var f;
|
|
457
507
|
(f = n == null ? void 0 : n.parentNode) == null || f.replaceChild(
|
|
458
|
-
|
|
508
|
+
u,
|
|
459
509
|
n
|
|
460
|
-
),
|
|
510
|
+
), u.style.display = (n == null ? void 0 : n.style.display) || "block";
|
|
461
511
|
}) : (d = n == null ? void 0 : n.parentNode) == null || d.replaceChild(
|
|
462
|
-
|
|
512
|
+
u,
|
|
463
513
|
n
|
|
464
|
-
), a.cachedOriginals.widgetDOMElement = n, a.cachedOriginals.triggerDOMElement = void 0) : (a.widgetDOMElement = document.body.appendChild(
|
|
514
|
+
), a.cachedOriginals.widgetDOMElement = n, a.cachedOriginals.triggerDOMElement = void 0) : (a.widgetDOMElement = document.body.appendChild(u), a.triggerDOMElement = n);
|
|
465
515
|
break;
|
|
466
516
|
}
|
|
467
517
|
case "none": {
|
|
468
|
-
const
|
|
469
|
-
if (a.widgetDOMElement =
|
|
518
|
+
const u = document.body.appendChild(document.createElement("div"));
|
|
519
|
+
if (a.widgetDOMElement = u, r !== "inline") {
|
|
470
520
|
const f = document.body.appendChild(document.createElement("a"));
|
|
471
521
|
r === "link" && (f.innerText = t), a.triggerDOMElement = f;
|
|
472
522
|
}
|
|
@@ -474,36 +524,36 @@ const xt = (t, e) => t && e ? "both" : t ? "widgetDOM" : e ? "triggerDOM" : "non
|
|
|
474
524
|
}
|
|
475
525
|
}
|
|
476
526
|
return a;
|
|
477
|
-
},
|
|
478
|
-
class
|
|
527
|
+
}, Lt = "modals";
|
|
528
|
+
class Pt {
|
|
479
529
|
constructor(e, n) {
|
|
480
530
|
this.options = n, this.unsubscribe = [], this.container = e.createChild(this), this.container.register("widgetDOMElement", this.options.widgetDOMElement), this.container.register("triggerDOMElement", this.options.triggerDOMElement);
|
|
481
|
-
const
|
|
482
|
-
this.options.widgetDOMElement.classList.add("humany-widget"), this.options.widgetDOMElement.classList.add(`humany_${
|
|
483
|
-
const
|
|
531
|
+
const o = this.container.get("$widget");
|
|
532
|
+
this.options.widgetDOMElement.classList.add("humany-widget"), this.options.widgetDOMElement.classList.add(`humany_${o.name}`);
|
|
533
|
+
const s = e.get("widgetDOMElements") || [];
|
|
484
534
|
e.register("widgetDOMElements", [
|
|
485
|
-
...
|
|
535
|
+
...s,
|
|
486
536
|
this.options.widgetDOMElement
|
|
487
537
|
]);
|
|
488
538
|
}
|
|
489
539
|
render() {
|
|
490
|
-
const { widgetDOMElement: e, triggerDOMElement: n } = this.options,
|
|
491
|
-
return e.getAttribute("data-rendered") === "true" ? Promise.resolve() : (n && this.options.triggerType ===
|
|
492
|
-
if (e.setAttribute("data-rendered", "true"), n && this.options.triggerType ===
|
|
493
|
-
const
|
|
494
|
-
|
|
540
|
+
const { widgetDOMElement: e, triggerDOMElement: n } = this.options, o = this.container.get("$widget");
|
|
541
|
+
return e.getAttribute("data-rendered") === "true" ? Promise.resolve() : (n && this.options.triggerType === P.Badge && Dt(n), import("./render.6ad0b099.js").then((s) => s.default(o.name, this.container, e)).then(() => {
|
|
542
|
+
if (e.setAttribute("data-rendered", "true"), n && this.options.triggerType === P.Badge) {
|
|
543
|
+
const i = this.options.triggerOptions.openTooltip;
|
|
544
|
+
be(n, i);
|
|
495
545
|
}
|
|
496
546
|
We(this.container, e);
|
|
497
|
-
const
|
|
498
|
-
|
|
547
|
+
const s = this.container.get("$environment").widgets.all();
|
|
548
|
+
N(
|
|
499
549
|
this.container,
|
|
500
|
-
|
|
550
|
+
Lt,
|
|
501
551
|
v.Session
|
|
502
|
-
).then((
|
|
503
|
-
|
|
504
|
-
|
|
552
|
+
).then((i) => {
|
|
553
|
+
i && i.forEach((r) => {
|
|
554
|
+
s.find(
|
|
505
555
|
(c) => c.name === r.name && c.state === "activated"
|
|
506
|
-
) &&
|
|
556
|
+
) && o.events.dispatch("widget:modal-opened", r);
|
|
507
557
|
});
|
|
508
558
|
});
|
|
509
559
|
}));
|
|
@@ -513,85 +563,85 @@ class $t {
|
|
|
513
563
|
if (!n)
|
|
514
564
|
return;
|
|
515
565
|
n.getAttribute("role") || n.setAttribute("role", "button");
|
|
516
|
-
const { name:
|
|
517
|
-
this.options.triggerOptions =
|
|
518
|
-
const d =
|
|
519
|
-
label:
|
|
520
|
-
symbol:
|
|
566
|
+
const { name: o } = this.container.get("$widget"), { label: s, symbol: i, ariaLabel: r, closedTooltip: c, openTooltip: a } = e, l = { closedTooltip: c, openTooltip: a };
|
|
567
|
+
this.options.triggerOptions = l;
|
|
568
|
+
const d = $t(n, {
|
|
569
|
+
label: s,
|
|
570
|
+
symbol: i,
|
|
521
571
|
ariaLabel: r,
|
|
522
|
-
widgetName:
|
|
572
|
+
widgetName: o,
|
|
523
573
|
tooltip: c
|
|
524
574
|
});
|
|
525
575
|
this.unsubscribe.push(d);
|
|
526
576
|
}
|
|
527
577
|
dispose() {
|
|
528
578
|
return import("./unmount.b0816844.js").then((e) => {
|
|
529
|
-
var
|
|
530
|
-
const { triggerDOMElement: n, widgetDOMElement:
|
|
531
|
-
e.default(
|
|
579
|
+
var s, i, r, c;
|
|
580
|
+
const { triggerDOMElement: n, widgetDOMElement: o } = this.options;
|
|
581
|
+
e.default(o), this.options.cachedOriginals.widgetDOMElement && o && ((s = o.parentNode) == null || s.replaceChild(
|
|
532
582
|
this.options.cachedOriginals.widgetDOMElement,
|
|
533
|
-
|
|
534
|
-
)), this.options.cachedOriginals.triggerDOMElement && n && ((
|
|
583
|
+
o
|
|
584
|
+
)), this.options.cachedOriginals.triggerDOMElement && n && ((i = n.parentNode) == null || i.replaceChild(
|
|
535
585
|
this.options.cachedOriginals.triggerDOMElement,
|
|
536
586
|
n
|
|
537
587
|
)), this.unsubscribe.forEach((a) => {
|
|
538
588
|
a();
|
|
539
|
-
}), (r =
|
|
589
|
+
}), (r = o.parentNode) == null || r.removeChild(o), (c = n == null ? void 0 : n.parentNode) == null || c.removeChild(n);
|
|
540
590
|
});
|
|
541
591
|
}
|
|
542
592
|
}
|
|
543
|
-
const
|
|
593
|
+
const W = "changesets", kt = (t) => {
|
|
544
594
|
const e = { tags: t.tags };
|
|
545
595
|
return t.context && typeof t.context != "function" && (e.context = t.context), t.properties && typeof t.properties != "function" && (e.properties = t.properties), t.layout && typeof t.layout != "function" && (e.layout = t.layout), e;
|
|
546
596
|
};
|
|
547
|
-
class
|
|
597
|
+
class oe {
|
|
548
598
|
constructor(e, n) {
|
|
549
599
|
this.container = e, this.storageWriter = n;
|
|
550
600
|
}
|
|
551
601
|
static create(e) {
|
|
552
|
-
return V(e,
|
|
602
|
+
return V(e, W, _.Necessary, {
|
|
553
603
|
medium: v.Local
|
|
554
|
-
}).then((n) => new
|
|
604
|
+
}).then((n) => new oe(e, n));
|
|
555
605
|
}
|
|
556
|
-
write(e, n,
|
|
557
|
-
return q(this)(() =>
|
|
606
|
+
write(e, n, o, s) {
|
|
607
|
+
return q(this)(() => N(
|
|
558
608
|
this.container,
|
|
559
|
-
|
|
609
|
+
W,
|
|
560
610
|
v.Local
|
|
561
|
-
).then((
|
|
562
|
-
const { keys: r = [], items: c = {} } =
|
|
611
|
+
).then((i = {}) => {
|
|
612
|
+
const { keys: r = [], items: c = {} } = i, a = r.indexOf(e);
|
|
563
613
|
return a > -1 && r.splice(a, 1), r.push(e), c[e] = {
|
|
564
|
-
options:
|
|
565
|
-
attributes:
|
|
614
|
+
options: s,
|
|
615
|
+
attributes: kt(o),
|
|
566
616
|
rules: n.rules
|
|
567
617
|
}, this.storageWriter({ keys: r, items: c });
|
|
568
618
|
}));
|
|
569
619
|
}
|
|
570
620
|
remove(e) {
|
|
571
|
-
return q(this)(() =>
|
|
621
|
+
return q(this)(() => N(
|
|
572
622
|
this.container,
|
|
573
|
-
|
|
623
|
+
W,
|
|
574
624
|
v.Local
|
|
575
625
|
).then((n = {}) => {
|
|
576
|
-
const { keys:
|
|
577
|
-
if (
|
|
578
|
-
return
|
|
626
|
+
const { keys: o = [], items: s = {} } = n, i = o.indexOf(e);
|
|
627
|
+
if (i > -1)
|
|
628
|
+
return o.splice(i, 1), delete s[e], this.storageWriter(n);
|
|
579
629
|
}));
|
|
580
630
|
}
|
|
581
631
|
load(e) {
|
|
582
|
-
return q(this)(() =>
|
|
632
|
+
return q(this)(() => N(
|
|
583
633
|
this.container,
|
|
584
|
-
|
|
634
|
+
W,
|
|
585
635
|
v.Local
|
|
586
636
|
).then((n = {}) => {
|
|
587
|
-
const { keys:
|
|
588
|
-
|
|
589
|
-
const r = i
|
|
637
|
+
const { keys: o = [], items: s = {} } = n;
|
|
638
|
+
o.forEach((i) => {
|
|
639
|
+
const r = s[i];
|
|
590
640
|
if (r) {
|
|
591
|
-
const { rules: c, attributes: a, options:
|
|
641
|
+
const { rules: c, attributes: a, options: l } = r;
|
|
592
642
|
e.write({
|
|
593
643
|
attributes: a,
|
|
594
|
-
options:
|
|
644
|
+
options: l,
|
|
595
645
|
target: new Ge(e, c)
|
|
596
646
|
});
|
|
597
647
|
}
|
|
@@ -599,50 +649,50 @@ class ne {
|
|
|
599
649
|
}));
|
|
600
650
|
}
|
|
601
651
|
}
|
|
602
|
-
const
|
|
652
|
+
const Rt = (t) => {
|
|
603
653
|
const { container: e } = t;
|
|
604
|
-
return
|
|
605
|
-
const
|
|
654
|
+
return oe.create(e).then((n) => {
|
|
655
|
+
const o = e.get("$settings"), s = { localStorage: n }, i = new je(t, s), r = Fe(i, o);
|
|
606
656
|
return t.events.subscribe("widget:state-change", (c, a) => {
|
|
607
|
-
a.state ===
|
|
608
|
-
}),
|
|
657
|
+
a.state === Je.Deactivating && r();
|
|
658
|
+
}), i;
|
|
609
659
|
});
|
|
610
|
-
},
|
|
660
|
+
}, Vt = (t) => import("@telia-ace/widget-routing").then(({ RoutingService: e, HistoryMode: n }) => t.get("settings").then((o) => {
|
|
611
661
|
const {
|
|
612
|
-
routing: { initialPath:
|
|
662
|
+
routing: { initialPath: s = "/", mode: i = n.scopedHash, basePath: r },
|
|
613
663
|
views: c
|
|
614
|
-
} =
|
|
664
|
+
} = o;
|
|
615
665
|
return new e(t, {
|
|
616
|
-
initialPath:
|
|
617
|
-
mode:
|
|
618
|
-
routes: Object.keys(c).map((
|
|
619
|
-
name:
|
|
620
|
-
path: c[
|
|
666
|
+
initialPath: s,
|
|
667
|
+
mode: i,
|
|
668
|
+
routes: Object.keys(c).map((l) => ({
|
|
669
|
+
name: l,
|
|
670
|
+
path: c[l].path
|
|
621
671
|
})),
|
|
622
672
|
basePath: r
|
|
623
673
|
});
|
|
624
|
-
})),
|
|
625
|
-
class
|
|
674
|
+
})), _t = (t) => import("@telia-ace/widget-services").then(({ StorageProvider: e }) => new e()), It = (t) => import("@telia-ace/widget-core").then(({ ActionResolver: e }) => new e(t)), Tt = (t) => import("@telia-ace/widget-core").then(({ ComponentResolver: e }) => new e(t)), zt = (t) => import("@telia-ace/widget-core").then(({ ComponentPlatform: e, createComponentModel: n }) => Rt(t.get("$widget"))), Z = "$settings", H = "open", ue = "activeStickyWidget";
|
|
675
|
+
class tn extends Xe {
|
|
626
676
|
constructor(e) {
|
|
627
677
|
super(e), this.outlets = /* @__PURE__ */ new Map(), this.activated = void 0, this.subs = [], this.handleBootstrapping = (n) => {
|
|
628
|
-
const
|
|
678
|
+
const o = {
|
|
629
679
|
triggerDOMElement: n.sourceDOMElement,
|
|
630
680
|
withRenderState: "storage"
|
|
631
681
|
};
|
|
632
|
-
this.container.get("settings").then((
|
|
633
|
-
const { activate:
|
|
634
|
-
(typeof
|
|
635
|
-
() => this.attach(
|
|
682
|
+
this.container.get("settings").then((s) => {
|
|
683
|
+
const { activate: i } = s;
|
|
684
|
+
(typeof i == "undefined" || i === null || i === !0) && (this.activated = (this.activated || this.widget.activate()).then(
|
|
685
|
+
() => this.attach(o)
|
|
636
686
|
));
|
|
637
687
|
});
|
|
638
|
-
}, this.container.registerAsync("storage", () =>
|
|
688
|
+
}, this.container.registerAsync("storage", () => _t(this.container)), this.container.registerFactory("settings", () => N(
|
|
639
689
|
this.container,
|
|
640
690
|
Z,
|
|
641
691
|
v.Local
|
|
642
|
-
).then((n = {}) => p(p({}, this.container.get("$settings")), n))),
|
|
692
|
+
).then((n = {}) => p(p({}, this.container.get("$settings")), n))), Ze(this, "load", this.handleBootstrapping), this.container.registerAsync(
|
|
643
693
|
"componentResolver",
|
|
644
|
-
() =>
|
|
645
|
-
), this.container.registerAsync("router", () =>
|
|
694
|
+
() => Tt(this.container)
|
|
695
|
+
), this.container.registerAsync("router", () => Vt(this.container)), this.container.registerAsync("actionResolver", () => It(this.container)), this.container.register("matchMedia", window.matchMedia), this.container.registerAsync("components", () => zt(this.container));
|
|
646
696
|
}
|
|
647
697
|
initialize() {
|
|
648
698
|
const e = this.container.getManyAsync(
|
|
@@ -651,33 +701,33 @@ class Jt extends Je {
|
|
|
651
701
|
"components"
|
|
652
702
|
);
|
|
653
703
|
return Promise.all([e, this.container.get("settings")]).then(
|
|
654
|
-
([{ actionResolver: n, router:
|
|
704
|
+
([{ actionResolver: n, router: o, components: s }, i]) => {
|
|
655
705
|
var a;
|
|
656
706
|
n.subscribe(
|
|
657
707
|
this.widget.name,
|
|
658
|
-
(
|
|
708
|
+
(l, d, u) => this.onAction(d, u)
|
|
659
709
|
);
|
|
660
|
-
const r = (
|
|
661
|
-
|
|
662
|
-
|
|
710
|
+
const r = (l) => {
|
|
711
|
+
s.nodes.query({ type: "view" }).forEach((d) => {
|
|
712
|
+
s.setSwitch(d, l);
|
|
663
713
|
});
|
|
664
|
-
}, c = ((a =
|
|
665
|
-
return r(c), this.events.subscribe("widget:data-loaded", (
|
|
714
|
+
}, c = ((a = o.getInitialRoute()) == null ? void 0 : a.name) || "index";
|
|
715
|
+
return r(c), this.events.subscribe("widget:data-loaded", (l, { element: d }) => {
|
|
666
716
|
this.widget.container.get("seoConfiguration") && this.events.dispatch("widget:preloaded-replaced", {
|
|
667
717
|
element: d
|
|
668
718
|
});
|
|
669
719
|
}), this.events.subscribe(
|
|
670
720
|
"router:change",
|
|
671
|
-
(
|
|
672
|
-
const { routeData: f } = d, { routeData: m } =
|
|
673
|
-
!m.name && g ? r(g) : r(m.name),
|
|
721
|
+
(l, { previous: d = { routeData: {} }, next: u = { routeData: {} } }) => {
|
|
722
|
+
const { routeData: f } = d, { routeData: m } = u, g = Object.keys(i.views).reduce((b, y) => typeof i.views[y].path == "undefined" ? y : b, "");
|
|
723
|
+
!m.name && g ? r(g) : r(m.name), le(f && f.params), le(m && m.params), this.container.getAsync("actionResolver").then((b) => {
|
|
674
724
|
b.action(this.widget.name, "routeChange", {
|
|
675
725
|
next: m,
|
|
676
726
|
previous: f
|
|
677
727
|
});
|
|
678
728
|
});
|
|
679
729
|
}
|
|
680
|
-
),
|
|
730
|
+
), o.initialize();
|
|
681
731
|
}
|
|
682
732
|
);
|
|
683
733
|
}
|
|
@@ -685,37 +735,37 @@ class Jt extends Je {
|
|
|
685
735
|
return this.container.get("settings").then(({ trigger: n }) => {
|
|
686
736
|
var f, m;
|
|
687
737
|
const {
|
|
688
|
-
widgetDOMElement:
|
|
689
|
-
key:
|
|
690
|
-
triggerDOMElement:
|
|
738
|
+
widgetDOMElement: o,
|
|
739
|
+
key: s = He(),
|
|
740
|
+
triggerDOMElement: i,
|
|
691
741
|
withRenderState: r
|
|
692
|
-
} = e, a =
|
|
742
|
+
} = e, a = we(n) === P.Inline && ((i == null ? void 0 : i.childElementCount) || 0) > 0, l = Nt(
|
|
693
743
|
this.widget.name,
|
|
694
|
-
s,
|
|
695
744
|
o,
|
|
745
|
+
i,
|
|
696
746
|
n,
|
|
697
747
|
a
|
|
698
748
|
);
|
|
699
749
|
this.outlets.size < 1 && !r && this.setRenderState("unset");
|
|
700
750
|
const d = () => {
|
|
701
751
|
const g = () => b.querySelectorAll("[data-loading=true]").length === 0, [b] = this.widget.container.get("widgetDOMElements"), y = (j, L) => {
|
|
702
|
-
g() && (
|
|
752
|
+
g() && (l.callback && l.callback(), L.disconnect());
|
|
703
753
|
}, E = {
|
|
704
754
|
attributes: !0,
|
|
705
755
|
subtree: !0,
|
|
706
756
|
childList: !0
|
|
707
757
|
};
|
|
708
|
-
g() &&
|
|
758
|
+
g() && l.callback && l.callback(), new MutationObserver(y).observe(b, E);
|
|
709
759
|
};
|
|
710
760
|
a && this.widget.container.getAsync("dataClient").then(({ events: g }) => {
|
|
711
761
|
g.subscribe("data-client:fetched", (b, y) => {
|
|
712
762
|
y.unresolvedQueries === 0 && d();
|
|
713
763
|
});
|
|
714
764
|
});
|
|
715
|
-
const
|
|
716
|
-
if (this.outlets.set(
|
|
765
|
+
const u = this.getOrCreateViewOutlet(s, l);
|
|
766
|
+
if (this.outlets.set(s, u), this.widget.events.dispatch("widget:attached", {}, { bubbles: !0 }), l.triggerType === P.Badge && n && ((f = l.triggerDOMElement) == null || f.setAttribute("aria-expanded", "false"), u == null || u.renderBadge(n)), l.triggerType !== P.Inline && ((m = l.triggerDOMElement) == null || m.addEventListener("click", (g) => {
|
|
717
767
|
g.preventDefault(), this.container.get("settings").then(({ trigger: b }) => {
|
|
718
|
-
|
|
768
|
+
u.render().then(() => this.renderState()).then((y) => b && b.action && b.action === "hide" ? y === O.open ? this.hide() : this.open() : y === O.open ? this.close() : this.open());
|
|
719
769
|
});
|
|
720
770
|
})), this.outlets.size > 1)
|
|
721
771
|
return this.renderState().then((g) => {
|
|
@@ -723,7 +773,7 @@ class Jt extends Je {
|
|
|
723
773
|
});
|
|
724
774
|
if (r)
|
|
725
775
|
return r === "storage" ? this.renderState().then((g) => {
|
|
726
|
-
if (
|
|
776
|
+
if (l.triggerType === P.Inline) {
|
|
727
777
|
this.triggerStateIfApplicable("open");
|
|
728
778
|
return;
|
|
729
779
|
}
|
|
@@ -763,7 +813,7 @@ class Jt extends Je {
|
|
|
763
813
|
});
|
|
764
814
|
}
|
|
765
815
|
getOrCreateViewOutlet(e, n) {
|
|
766
|
-
return this.outlets.has(e) ? this.outlets.get(e) : new
|
|
816
|
+
return this.outlets.has(e) ? this.outlets.get(e) : new Pt(this.container, n);
|
|
767
817
|
}
|
|
768
818
|
render(e = {}) {
|
|
769
819
|
if (process.env.NODE_ENV !== "production" && console.warn("widget.render() is deprecated. Use widget.attach() instead."), e.open) {
|
|
@@ -783,9 +833,9 @@ class Jt extends Je {
|
|
|
783
833
|
V(this.container, Z, _.Necessary, {
|
|
784
834
|
medium: v.Local
|
|
785
835
|
})
|
|
786
|
-
]).then(([n,
|
|
787
|
-
const
|
|
788
|
-
return this.widget.events.dispatch("widget:settings-updated",
|
|
836
|
+
]).then(([n, o]) => Promise.resolve(e(n)).then((s) => o(s).then(() => {
|
|
837
|
+
const i = p(p({}, n), s);
|
|
838
|
+
return this.widget.events.dispatch("widget:settings-updated", i), i;
|
|
789
839
|
})));
|
|
790
840
|
}
|
|
791
841
|
clearSettings() {
|
|
@@ -799,23 +849,23 @@ class Jt extends Je {
|
|
|
799
849
|
});
|
|
800
850
|
}
|
|
801
851
|
action({ action: e, value: n }) {
|
|
802
|
-
return this.container.getAsync("actionResolver").then((
|
|
803
|
-
|
|
852
|
+
return this.container.getAsync("actionResolver").then((o) => {
|
|
853
|
+
o.action(this.widget.name, e, n);
|
|
804
854
|
});
|
|
805
855
|
}
|
|
806
856
|
renderState() {
|
|
807
|
-
if (
|
|
857
|
+
if (qe(this.container))
|
|
808
858
|
return Promise.resolve(O.open);
|
|
809
|
-
const e = () =>
|
|
859
|
+
const e = () => N(
|
|
810
860
|
this.container,
|
|
811
861
|
H,
|
|
812
862
|
v.Session
|
|
813
|
-
).then((
|
|
863
|
+
).then((o = O.closed) => o), n = () => N(
|
|
814
864
|
this.container,
|
|
815
865
|
H,
|
|
816
866
|
v.Session
|
|
817
|
-
).then((
|
|
818
|
-
return this.container.getAsync("router").then((
|
|
867
|
+
).then((o = O.closed) => o);
|
|
868
|
+
return this.container.getAsync("router").then((o) => o.isSticky() ? n().then((s) => s === O.open ? s : e()) : e());
|
|
819
869
|
}
|
|
820
870
|
hide() {
|
|
821
871
|
return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn(
|
|
@@ -844,19 +894,19 @@ class Jt extends Je {
|
|
|
844
894
|
case "close":
|
|
845
895
|
case "open":
|
|
846
896
|
case "hide":
|
|
847
|
-
const
|
|
848
|
-
return this.setRenderState(
|
|
849
|
-
this.setTriggerState(
|
|
850
|
-
(
|
|
851
|
-
var
|
|
852
|
-
return (
|
|
897
|
+
const o = e === "open" ? O.open : e === "close" ? O.closed : O.hidden;
|
|
898
|
+
return this.setRenderState(o).then(() => {
|
|
899
|
+
this.setTriggerState(o === O.open), o !== O.hidden ? o === O.open ? this.onOpen() : this.onClose() : this.outlets.forEach(
|
|
900
|
+
(s) => {
|
|
901
|
+
var i;
|
|
902
|
+
return (i = s.options.triggerDOMElement) == null ? void 0 : i.setAttribute("aria-expanded", "false");
|
|
853
903
|
}
|
|
854
904
|
);
|
|
855
905
|
});
|
|
856
906
|
}
|
|
857
907
|
}
|
|
858
908
|
setRenderState(e) {
|
|
859
|
-
const { invoke: n, events:
|
|
909
|
+
const { invoke: n, events: o } = this.container.get("$widget");
|
|
860
910
|
return Promise.all([
|
|
861
911
|
V(this.container, H, _.Necessary, {
|
|
862
912
|
medium: v.Session
|
|
@@ -867,8 +917,8 @@ class Jt extends Je {
|
|
|
867
917
|
}),
|
|
868
918
|
this.container.getAsync("router"),
|
|
869
919
|
n("renderState")
|
|
870
|
-
]).then(([
|
|
871
|
-
e === "unset" || !e ? (
|
|
920
|
+
]).then(([s, i, r, c]) => {
|
|
921
|
+
e === "unset" || !e ? (i(), s()) : (r.isSticky() && i(e), s(e)), o.dispatch("widget:render-state-changed", {
|
|
872
922
|
previous: c,
|
|
873
923
|
next: e
|
|
874
924
|
});
|
|
@@ -877,69 +927,70 @@ class Jt extends Je {
|
|
|
877
927
|
onOpen() {
|
|
878
928
|
return this.container.getAsync("router").then((e) => (this.outlets.forEach(
|
|
879
929
|
(n) => {
|
|
880
|
-
var
|
|
881
|
-
return (
|
|
930
|
+
var o;
|
|
931
|
+
return (o = n.options.triggerDOMElement) == null ? void 0 : o.setAttribute("aria-expanded", "true");
|
|
882
932
|
}
|
|
883
933
|
), e.start()));
|
|
884
934
|
}
|
|
885
935
|
onClose() {
|
|
886
936
|
const e = this.container.getManyAsync("router", "components");
|
|
887
|
-
return (() => this.container.get("settings").then((
|
|
888
|
-
const { activate:
|
|
889
|
-
return
|
|
937
|
+
return (() => this.container.get("settings").then((o) => {
|
|
938
|
+
const { activate: s } = this.container.get("$settings");
|
|
939
|
+
return o.activate !== s ? this.setSettings(() => Promise.resolve({ activate: s })) : Promise.resolve();
|
|
890
940
|
}))().then(() => e).then(
|
|
891
941
|
({
|
|
892
|
-
router:
|
|
893
|
-
components:
|
|
942
|
+
router: o,
|
|
943
|
+
components: s
|
|
894
944
|
}) => {
|
|
895
|
-
const
|
|
945
|
+
const i = s.nodes.visible;
|
|
896
946
|
return this.outlets.forEach(
|
|
897
947
|
(r) => {
|
|
898
948
|
var c;
|
|
899
949
|
return (c = r.options.triggerDOMElement) == null ? void 0 : c.setAttribute("aria-expanded", "false");
|
|
900
950
|
}
|
|
901
|
-
),
|
|
951
|
+
), i.filter(
|
|
902
952
|
(r) => r.attributes.properties.animation && r.attributes.properties.animation !== "none"
|
|
903
953
|
).length ? new Promise((r) => {
|
|
904
954
|
setTimeout(() => {
|
|
905
|
-
r(
|
|
955
|
+
r(o);
|
|
906
956
|
}, 200);
|
|
907
|
-
}) : Promise.resolve(
|
|
957
|
+
}) : Promise.resolve(o);
|
|
908
958
|
}
|
|
909
|
-
).then((
|
|
959
|
+
).then((o) => o.stop());
|
|
910
960
|
}
|
|
911
961
|
setTriggerState(e) {
|
|
912
962
|
this.outlets.forEach((n) => {
|
|
913
963
|
const {
|
|
914
|
-
options: { triggerDOMElement:
|
|
915
|
-
} = n, { openTooltip:
|
|
916
|
-
|
|
964
|
+
options: { triggerDOMElement: o, triggerOptions: s }
|
|
965
|
+
} = n, { openTooltip: i, closedTooltip: r } = s || {};
|
|
966
|
+
o && (e ? be(o, i) : xt(o, r));
|
|
917
967
|
});
|
|
918
968
|
}
|
|
919
969
|
deactivate() {
|
|
920
970
|
this.subs.forEach((n) => n());
|
|
921
971
|
const e = [];
|
|
922
|
-
return this.outlets.forEach((n) => e.push(n.dispose())),
|
|
972
|
+
return this.outlets.forEach((n) => e.push(n.dispose())), N(
|
|
923
973
|
this.container,
|
|
924
|
-
|
|
974
|
+
ue,
|
|
925
975
|
v.Local
|
|
926
976
|
).then((n) => n === this.widget.name ? V(
|
|
927
977
|
this.container,
|
|
928
|
-
|
|
978
|
+
ue,
|
|
929
979
|
_.Necessary,
|
|
930
980
|
{
|
|
931
981
|
medium: v.Local,
|
|
932
|
-
scope:
|
|
982
|
+
scope: Qe.Implementation
|
|
933
983
|
}
|
|
934
|
-
).then((
|
|
984
|
+
).then((o) => o()).then(() => Promise.all(e)) : Promise.all(e));
|
|
935
985
|
}
|
|
936
986
|
}
|
|
937
987
|
export {
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
U as genericComponentStyling
|
|
988
|
+
ne as Component,
|
|
989
|
+
wt as DetachedComponent,
|
|
990
|
+
tn as GridWidget,
|
|
991
|
+
Xt as NotFound,
|
|
992
|
+
tn as Widget,
|
|
993
|
+
U as genericComponentStyling,
|
|
994
|
+
en as resolveComponent
|
|
944
995
|
};
|
|
945
996
|
//# sourceMappingURL=index.js.map
|