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