@telia-ace/widget-types-grid 1.0.30-experimental.20 → 1.0.30-experimental.21
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
CHANGED
|
@@ -10,7 +10,7 @@ var ct = (e, t, n) => t in e ? St(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
10
10
|
ut.call(t, n) && ct(e, n, t[n]);
|
|
11
11
|
return e;
|
|
12
12
|
}, C = (e, t) => At(e, Dt(t));
|
|
13
|
-
var
|
|
13
|
+
var M = (e, t) => {
|
|
14
14
|
var n = {};
|
|
15
15
|
for (var s in e)
|
|
16
16
|
lt.call(e, s) && t.indexOf(s) < 0 && (n[s] = e[s]);
|
|
@@ -23,20 +23,20 @@ var dt = (e, t, n) => new Promise((s, o) => {
|
|
|
23
23
|
var i = (a) => {
|
|
24
24
|
try {
|
|
25
25
|
c(n.next(a));
|
|
26
|
-
} catch (
|
|
27
|
-
o(
|
|
26
|
+
} catch (l) {
|
|
27
|
+
o(l);
|
|
28
28
|
}
|
|
29
29
|
}, r = (a) => {
|
|
30
30
|
try {
|
|
31
31
|
c(n.throw(a));
|
|
32
|
-
} catch (
|
|
33
|
-
o(
|
|
32
|
+
} catch (l) {
|
|
33
|
+
o(l);
|
|
34
34
|
}
|
|
35
35
|
}, c = (a) => a.done ? s(a.value) : Promise.resolve(a.value).then(i, r);
|
|
36
36
|
c((n = n.apply(e, t)).next());
|
|
37
37
|
});
|
|
38
38
|
import { Grid as ft, useRouteData as Mt, useRouter as Nt, useProperties as gt, useContext as st, useContainer as W, useComponentNode as ot, useScroll as yt, transitionComposer as Pt, paddedBorderTabStyle as Lt, useComponent as _t, useComponentDescriptor as kt, filterCssPropsStyle as Rt, Typography as Vt, useComponentPlatform as bt, useIsMounted as It, useColumns as Tt, useLayout as zt, ComponentNodeContext as Bt, ComponentPropertyContext as jt, filterCssProps as Wt } from "@telia-ace/widget-ui";
|
|
39
|
-
import
|
|
39
|
+
import m, { useState as B, forwardRef as wt, useMemo as Ft, Suspense as Gt, useEffect as j } from "react";
|
|
40
40
|
import { css as vt, ThemeProvider as Ht, useTheme as qt } from "@emotion/react";
|
|
41
41
|
import { asDescriptor as U, ComponentPlatform as Et, createComponentModel as Kt, ComponentQuery as Ut, WidgetRenderState as O } from "@telia-ace/widget-core";
|
|
42
42
|
import k from "@emotion/styled";
|
|
@@ -45,14 +45,14 @@ import { TransitionGroup as Zt, Transition as Jt } from "react-transition-group"
|
|
|
45
45
|
import { Switch as Xt, Route as tt } from "react-router";
|
|
46
46
|
import { spread as te } from "@open-wc/lit-helpers";
|
|
47
47
|
import { nothing as ee, css as ne, LitElement as se } from "lit";
|
|
48
|
-
import { property as Ct, state as Q
|
|
49
|
-
import { html as
|
|
50
|
-
import { onWidgetUrl as
|
|
51
|
-
import { readStorage as
|
|
52
|
-
import { supportBootstrapping as
|
|
53
|
-
import { WidgetState as
|
|
48
|
+
import { property as Ct, state as Q } from "lit/decorators.js";
|
|
49
|
+
import { html as oe, unsafeStatic as ie } from "lit/static-html.js";
|
|
50
|
+
import { onWidgetUrl as re } from "@telia-ace/widget-routing";
|
|
51
|
+
import { readStorage as N, StorageMedium as v, createStorageWriter as V, StorageCategory as I, StorageScope as ae } from "@telia-ace/widget-services";
|
|
52
|
+
import { supportBootstrapping as ce } from "@webprovisions/bootstrapping";
|
|
53
|
+
import { WidgetState as le, WidgetType as ue } from "@webprovisions/platform";
|
|
54
54
|
var nt = /* @__PURE__ */ ((e) => (e.back = "back", e.forth = "forth", e))(nt || {});
|
|
55
|
-
const
|
|
55
|
+
const de = (e, t, n) => typeof n[e] == "number" && typeof n[t] == "number" && n[e] > n[t] ? "back" : "forth", he = ({ views: e, location: t, render: n }) => /* @__PURE__ */ m.createElement(
|
|
56
56
|
Xt,
|
|
57
57
|
{
|
|
58
58
|
location: t && C(f({}, t), {
|
|
@@ -64,19 +64,19 @@ const he = (e, t, n) => typeof n[e] == "number" && typeof n[t] == "number" && n[
|
|
|
64
64
|
...Object.keys(e).filter((s) => !e[s].path)
|
|
65
65
|
].map((s) => {
|
|
66
66
|
const { path: o } = e[s];
|
|
67
|
-
return o ? Array.isArray(o) ? o.map((i) => /* @__PURE__ */
|
|
67
|
+
return o ? Array.isArray(o) ? o.map((i) => /* @__PURE__ */ m.createElement(tt, { key: s, exact: !0, path: i, render: () => n(s) })) : /* @__PURE__ */ m.createElement(tt, { key: s, exact: !0, path: o, render: () => n(s) }) : /* @__PURE__ */ m.createElement(tt, { key: s, render: () => n(s) });
|
|
68
68
|
})
|
|
69
|
-
), Ot =
|
|
69
|
+
), Ot = he, pe = k.div`
|
|
70
70
|
position: relative;
|
|
71
71
|
width: 100%;
|
|
72
72
|
flex: 1;
|
|
73
|
-
`,
|
|
73
|
+
`, me = k(ft)`
|
|
74
74
|
position: absolute;
|
|
75
75
|
left: 0;
|
|
76
76
|
right: 0;
|
|
77
77
|
${(e) => !!e.animationCss && e.animationCss}
|
|
78
78
|
${(e) => !!e.scrollableCss && e.scrollableCss}
|
|
79
|
-
`,
|
|
79
|
+
`, fe = {
|
|
80
80
|
index: 1,
|
|
81
81
|
search: 2,
|
|
82
82
|
browse: 3,
|
|
@@ -84,20 +84,20 @@ const he = (e, t, n) => typeof n[e] == "number" && typeof n[t] == "number" && n[
|
|
|
84
84
|
contact: 5,
|
|
85
85
|
"contact-method": 6,
|
|
86
86
|
conversation: 7
|
|
87
|
-
},
|
|
88
|
-
var s = n, { className: e = "" } = s, t =
|
|
89
|
-
const [o, i] = B("index"), [r, c] = B(nt.forth), a = Mt(),
|
|
90
|
-
if (!
|
|
87
|
+
}, ge = (n) => {
|
|
88
|
+
var s = n, { className: e = "" } = s, t = M(s, ["className"]);
|
|
89
|
+
const [o, i] = B("index"), [r, c] = B(nt.forth), a = Mt(), l = Nt(), d = gt(), u = st(), p = W(), h = ot(), { gap: g = "0" } = u, G = d, { columns: b = 1, animation: y = "none", scrollable: E = !1 } = G, $ = M(G, ["columns", "animation", "scrollable"]), [F, L] = yt(E);
|
|
90
|
+
if (!h || !l)
|
|
91
91
|
return null;
|
|
92
|
-
const { location: at } =
|
|
93
|
-
a.name !== o && a.name !== "" && y && (c(
|
|
94
|
-
const { views: S } =
|
|
92
|
+
const { location: at } = l;
|
|
93
|
+
a.name !== o && a.name !== "" && y && (c(de(o, a.name, fe)), i(a.name));
|
|
94
|
+
const { views: S } = p.get("$settings");
|
|
95
95
|
if (!Object.keys(S).length)
|
|
96
96
|
return null;
|
|
97
|
-
const A = (w,
|
|
98
|
-
const x = J(
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
|
|
97
|
+
const A = (w, D, R) => {
|
|
98
|
+
const x = J(D, R), z = h.getChildren(w)[0];
|
|
99
|
+
return /* @__PURE__ */ m.createElement(
|
|
100
|
+
me,
|
|
101
101
|
C(f(C(f(f({}, t), $), {
|
|
102
102
|
scrollableCss: F,
|
|
103
103
|
ref: L,
|
|
@@ -106,26 +106,26 @@ const he = (e, t, n) => typeof n[e] == "number" && typeof n[t] == "number" && n[
|
|
|
106
106
|
}), x), {
|
|
107
107
|
className: Y(e, "humany-view")
|
|
108
108
|
}),
|
|
109
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ m.createElement(it, { id: z.id, branch: "default" })
|
|
110
110
|
);
|
|
111
|
-
}, J = (w,
|
|
111
|
+
}, J = (w, D) => {
|
|
112
112
|
if (y === "slide" || y === "fade")
|
|
113
113
|
return {
|
|
114
114
|
animationCss: Pt.composeViewTransition(
|
|
115
115
|
w,
|
|
116
116
|
y,
|
|
117
|
-
|
|
117
|
+
D
|
|
118
118
|
),
|
|
119
119
|
["data-state"]: w
|
|
120
120
|
};
|
|
121
121
|
};
|
|
122
|
-
return /* @__PURE__ */
|
|
122
|
+
return /* @__PURE__ */ m.createElement(pe, { className: "humany-animated-view" }, /* @__PURE__ */ m.createElement(
|
|
123
123
|
Zt,
|
|
124
124
|
{
|
|
125
125
|
component: null,
|
|
126
|
-
childFactory: (w) =>
|
|
126
|
+
childFactory: (w) => m.cloneElement(w, { direction: r })
|
|
127
127
|
},
|
|
128
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ m.createElement(
|
|
129
129
|
Jt,
|
|
130
130
|
{
|
|
131
131
|
key: o,
|
|
@@ -134,42 +134,42 @@ const he = (e, t, n) => typeof n[e] == "number" && typeof n[t] == "number" && n[
|
|
|
134
134
|
unmountOnExit: !0,
|
|
135
135
|
direction: nt.forth
|
|
136
136
|
},
|
|
137
|
-
(w, { direction:
|
|
137
|
+
(w, { direction: D }) => /* @__PURE__ */ m.createElement(
|
|
138
138
|
Ot,
|
|
139
139
|
{
|
|
140
140
|
views: S,
|
|
141
141
|
location: at,
|
|
142
|
-
render: (
|
|
142
|
+
render: (R) => A(R, w, D)
|
|
143
143
|
}
|
|
144
144
|
)
|
|
145
145
|
)
|
|
146
146
|
));
|
|
147
|
-
},
|
|
147
|
+
}, ye = ge, be = k(ft)`
|
|
148
148
|
${(e) => !!e.scrollableCss && e.scrollableCss}
|
|
149
|
-
`,
|
|
150
|
-
var s = n, { className: e = "" } = s, t =
|
|
151
|
-
const o = gt(), i = st(), r = W(), c = ot(), { views: a } = r.get("$settings"), { gap:
|
|
152
|
-
return c ? /* @__PURE__ */
|
|
153
|
-
|
|
154
|
-
C(f(f({}, t),
|
|
149
|
+
`, we = (n) => {
|
|
150
|
+
var s = n, { className: e = "" } = s, t = M(s, ["className"]);
|
|
151
|
+
const o = gt(), i = st(), r = W(), c = ot(), { views: a } = r.get("$settings"), { gap: l = "0" } = i, y = o, { columns: d = 1, animation: u = "none", scrollable: p = !1 } = y, h = M(y, ["columns", "animation", "scrollable"]), [g, b] = yt(p);
|
|
152
|
+
return c ? /* @__PURE__ */ m.createElement(
|
|
153
|
+
be,
|
|
154
|
+
C(f(f({}, t), h), {
|
|
155
155
|
scrollableCss: g,
|
|
156
156
|
ref: b,
|
|
157
157
|
columns: d,
|
|
158
|
-
gap:
|
|
158
|
+
gap: l,
|
|
159
159
|
className: Y(e, "humany-view")
|
|
160
160
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ m.createElement(
|
|
162
162
|
Ot,
|
|
163
163
|
{
|
|
164
164
|
views: a,
|
|
165
165
|
render: (E) => {
|
|
166
166
|
const $ = c.getChildren(E)[0];
|
|
167
|
-
return /* @__PURE__ */
|
|
167
|
+
return /* @__PURE__ */ m.createElement(it, { id: $.id, node: $, branch: "default" });
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
)
|
|
171
171
|
) : null;
|
|
172
|
-
},
|
|
172
|
+
}, ve = we, Z = (e) => {
|
|
173
173
|
var t, n;
|
|
174
174
|
return vt`
|
|
175
175
|
outline: none;
|
|
@@ -197,11 +197,11 @@ const he = (e, t, n) => typeof n[e] == "number" && typeof n[t] == "number" && n[
|
|
|
197
197
|
${Lt(e)};
|
|
198
198
|
}
|
|
199
199
|
`;
|
|
200
|
-
},
|
|
200
|
+
}, Ee = k(ve)`
|
|
201
201
|
${(e) => Z(e)}
|
|
202
|
-
`,
|
|
202
|
+
`, Ce = k(ye)`
|
|
203
203
|
${(e) => Z(e)}
|
|
204
|
-
`,
|
|
204
|
+
`, Oe = k.div`
|
|
205
205
|
text-align: center;
|
|
206
206
|
${(e) => {
|
|
207
207
|
var t, n, s;
|
|
@@ -212,21 +212,21 @@ const he = (e, t, n) => typeof n[e] == "number" && typeof n[t] == "number" && n[
|
|
|
212
212
|
}}
|
|
213
213
|
${(e) => typeof e.theme.borderRadius != "undefined" && `border-radius: ${e.theme.borderRadius};`}
|
|
214
214
|
${(e) => Z(e)}
|
|
215
|
-
`,
|
|
215
|
+
`, xe = wt(
|
|
216
216
|
(o, s) => {
|
|
217
|
-
var i = o, { className: e = "", children: t } = i, n =
|
|
218
|
-
const r = _t(), { name: c, type: a, id:
|
|
217
|
+
var i = o, { className: e = "", children: t } = i, n = M(i, ["className", "children"]);
|
|
218
|
+
const r = _t(), { name: c, type: a, id: l } = kt(), d = Ft(() => r ? k(r)`
|
|
219
219
|
${Z}
|
|
220
220
|
${Rt}
|
|
221
221
|
` : null, [r]);
|
|
222
|
-
return typeof r == "undefined" ? null : r === null || d === null ? process.env.NODE_ENV !== "production" ? /* @__PURE__ */
|
|
223
|
-
|
|
222
|
+
return typeof r == "undefined" ? null : r === null || d === null ? process.env.NODE_ENV !== "production" ? /* @__PURE__ */ m.createElement(
|
|
223
|
+
Oe,
|
|
224
224
|
C(f({}, n), {
|
|
225
|
-
title: `type: ${a}, definition-id: ${c}, instance-id: ${
|
|
225
|
+
title: `type: ${a}, definition-id: ${c}, instance-id: ${l}`,
|
|
226
226
|
className: Y(e, "humany-non-resolved-component")
|
|
227
227
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
) : null : /* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ m.createElement(Vt, { variant: "h5" }, "Non Resolved Component Type")
|
|
229
|
+
) : null : /* @__PURE__ */ m.createElement(Gt, { fallback: null }, /* @__PURE__ */ m.createElement(
|
|
230
230
|
d,
|
|
231
231
|
C(f({
|
|
232
232
|
ref: s
|
|
@@ -240,7 +240,7 @@ const he = (e, t, n) => typeof n[e] == "number" && typeof n[t] == "number" && n[
|
|
|
240
240
|
t
|
|
241
241
|
));
|
|
242
242
|
}
|
|
243
|
-
),
|
|
243
|
+
), $e = xe, Se = (e) => {
|
|
244
244
|
const t = ot(e), n = bt(), [s, o] = B({}), i = It();
|
|
245
245
|
return j(() => {
|
|
246
246
|
t && i.current && o(t.attributes.properties);
|
|
@@ -257,35 +257,35 @@ const he = (e, t, n) => typeof n[e] == "number" && typeof n[t] == "number" && n[
|
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
259
|
}, [n, i, e, t]), s;
|
|
260
|
-
},
|
|
261
|
-
(
|
|
262
|
-
var d =
|
|
263
|
-
const
|
|
260
|
+
}, Ae = (e, t) => t ? !0 : typeof e == "string" ? e === "full" : e > 0, De = wt(
|
|
261
|
+
(l, a) => {
|
|
262
|
+
var d = l, { className: e = "", id: t, branch: n, node: s, ariaLabel: o, tabIndex: i, context: r } = d, c = M(d, ["className", "id", "branch", "node", "ariaLabel", "tabIndex", "context"]);
|
|
263
|
+
const u = bt(), p = W(), [h, g] = B(), b = Tt(), y = st(t), E = Se(t), { size: $ = "none", indent: F = 0 } = zt(t), L = Ae($, s);
|
|
264
264
|
if (j(() => {
|
|
265
|
-
if (
|
|
265
|
+
if (u) {
|
|
266
266
|
if (t && !s) {
|
|
267
|
-
const x =
|
|
267
|
+
const x = u.nodes.get(t);
|
|
268
268
|
if (x && (g(U(x, n)), L)) {
|
|
269
|
-
const z = x.mount(
|
|
269
|
+
const z = x.mount(p);
|
|
270
270
|
return () => {
|
|
271
271
|
z();
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
274
|
} else if (s) {
|
|
275
275
|
g(U(s, n));
|
|
276
|
-
const x = s.mount(
|
|
276
|
+
const x = s.mount(p);
|
|
277
277
|
return () => {
|
|
278
278
|
x();
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
}, [
|
|
282
|
+
}, [u, t, s, L]), !h || !L)
|
|
283
283
|
return null;
|
|
284
|
-
const
|
|
284
|
+
const R = f(f({}, y), r || {}), {
|
|
285
285
|
cardinal: S,
|
|
286
286
|
fonts: A = {},
|
|
287
287
|
accessibility: J = {}
|
|
288
|
-
} =
|
|
288
|
+
} = R, G = M(R, [
|
|
289
289
|
"cardinal",
|
|
290
290
|
"fonts",
|
|
291
291
|
"accessibility"
|
|
@@ -297,35 +297,35 @@ const he = (e, t, n) => typeof n[e] == "number" && typeof n[t] == "number" && n[
|
|
|
297
297
|
medium: A.medium || "1.2em",
|
|
298
298
|
large: A.large || "1.6em",
|
|
299
299
|
huge: A.huge || "2.5em"
|
|
300
|
-
},
|
|
300
|
+
}, D = C(f({}, G), {
|
|
301
301
|
fonts: w,
|
|
302
302
|
accessibility: f({}, J)
|
|
303
303
|
});
|
|
304
|
-
return typeof S == "number" && (
|
|
304
|
+
return typeof S == "number" && (D.sizes = {
|
|
305
305
|
cardinal: S,
|
|
306
306
|
small: `${S}px`,
|
|
307
307
|
normal: `${S * 3}px`,
|
|
308
308
|
medium: `${S * 5}px`,
|
|
309
309
|
large: `${S * 8}px`
|
|
310
|
-
}), /* @__PURE__ */
|
|
310
|
+
}), /* @__PURE__ */ m.createElement(Ht, { theme: D }, /* @__PURE__ */ m.createElement(Bt.Provider, { value: h }, /* @__PURE__ */ m.createElement(jt.Provider, { value: E }, (() => {
|
|
311
311
|
const x = f({
|
|
312
312
|
"data-width": $ === "full" ? b : Math.min($, b),
|
|
313
313
|
"data-indent": F,
|
|
314
|
-
"data-name":
|
|
315
|
-
"data-node-id":
|
|
316
|
-
"data-component-type":
|
|
314
|
+
"data-name": h.name,
|
|
315
|
+
"data-node-id": h.id,
|
|
316
|
+
"data-component-type": h.type,
|
|
317
317
|
"aria-label": o,
|
|
318
318
|
tabIndex: i,
|
|
319
|
-
id:
|
|
319
|
+
id: h.id,
|
|
320
320
|
role: E && E.role
|
|
321
321
|
}, c);
|
|
322
|
-
switch (
|
|
322
|
+
switch (h.type) {
|
|
323
323
|
case "view":
|
|
324
|
-
return typeof E.animation == "string" && E.animation !== "none" ? /* @__PURE__ */
|
|
324
|
+
return typeof E.animation == "string" && E.animation !== "none" ? /* @__PURE__ */ m.createElement(Ce, C(f({}, x), { className: e })) : /* @__PURE__ */ m.createElement(Ee, C(f({}, x), { className: e }));
|
|
325
325
|
default: {
|
|
326
326
|
const z = Wt(E);
|
|
327
|
-
return /* @__PURE__ */
|
|
328
|
-
|
|
327
|
+
return /* @__PURE__ */ m.createElement(
|
|
328
|
+
$e,
|
|
329
329
|
C(f(f({
|
|
330
330
|
ref: a
|
|
331
331
|
}, x), z), {
|
|
@@ -336,7 +336,7 @@ const he = (e, t, n) => typeof n[e] == "number" && typeof n[t] == "number" && n[
|
|
|
336
336
|
}
|
|
337
337
|
})())));
|
|
338
338
|
}
|
|
339
|
-
), it =
|
|
339
|
+
), it = De, Me = ({ builder: e }) => {
|
|
340
340
|
const t = W(), [n, s] = B(null);
|
|
341
341
|
return j(() => {
|
|
342
342
|
t.getAsync("components").then((o) => e(o).then((i) => {
|
|
@@ -348,19 +348,19 @@ const he = (e, t, n) => typeof n[e] == "number" && typeof n[t] == "number" && n[
|
|
|
348
348
|
(i) => i.id !== n.id
|
|
349
349
|
);
|
|
350
350
|
});
|
|
351
|
-
}, [n]), n ? /* @__PURE__ */
|
|
352
|
-
},
|
|
351
|
+
}, [n]), n ? /* @__PURE__ */ m.createElement(it, { id: n.id, node: n, branch: "default" }) : null;
|
|
352
|
+
}, Ne = Me, Pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
353
353
|
__proto__: null,
|
|
354
|
-
default:
|
|
355
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
354
|
+
default: Ne
|
|
355
|
+
}, Symbol.toStringTag, { value: "Module" })), Le = m.lazy(() => Promise.resolve().then(() => Pe)), _e = ({ showSearch: e = !1 }) => {
|
|
356
356
|
const t = qt(), n = W();
|
|
357
|
-
return /* @__PURE__ */
|
|
358
|
-
|
|
357
|
+
return /* @__PURE__ */ m.createElement(m.Suspense, { fallback: null }, /* @__PURE__ */ m.createElement(
|
|
358
|
+
Le,
|
|
359
359
|
{
|
|
360
360
|
builder: (s) => n.get("settings").then((o) => {
|
|
361
|
-
var
|
|
361
|
+
var l;
|
|
362
362
|
const { properties: i, context: r } = Object.keys(o.components).reduce(
|
|
363
|
-
(d,
|
|
363
|
+
(d, u) => (o.components[u].type === "not-found" && (d.properties = o.components[u].properties, d.context = o.components[u].context), d),
|
|
364
364
|
{ properties: {}, context: {} }
|
|
365
365
|
);
|
|
366
366
|
i.showSearch = e;
|
|
@@ -369,19 +369,19 @@ const he = (e, t, n) => typeof n[e] == "number" && typeof n[t] == "number" && n[
|
|
|
369
369
|
size: "full"
|
|
370
370
|
}), e) {
|
|
371
371
|
const d = Object.keys(o.components).reduce(
|
|
372
|
-
(
|
|
372
|
+
(p, h) => o.components[h].type === "search" ? o.components[h].properties : p,
|
|
373
373
|
{}
|
|
374
|
-
),
|
|
375
|
-
|
|
376
|
-
"css-margin-bottom": ((
|
|
377
|
-
}, d)), c.appendChild(
|
|
374
|
+
), u = s.createNode("search", { detached: !0 });
|
|
375
|
+
u.writeLayout({ size: "full" }), u.writeProperties(f({
|
|
376
|
+
"css-margin-bottom": ((l = t == null ? void 0 : t.sizes) == null ? void 0 : l.normal) || "15px"
|
|
377
|
+
}, d)), c.appendChild(u);
|
|
378
378
|
}
|
|
379
379
|
const a = s.createNode("not-found", { detached: !0 });
|
|
380
380
|
return a.writeLayout({ size: "full" }), a.writeProperties(i), a.writeContext(r), c.appendChild(a), c;
|
|
381
381
|
})
|
|
382
382
|
}
|
|
383
383
|
));
|
|
384
|
-
},
|
|
384
|
+
}, wn = _e, ke = (e) => {
|
|
385
385
|
class t extends e {
|
|
386
386
|
requestInstance(s) {
|
|
387
387
|
const o = new CustomEvent("request-instance", {
|
|
@@ -395,13 +395,13 @@ const he = (e, t, n) => typeof n[e] == "number" && typeof n[t] == "number" && n[
|
|
|
395
395
|
}
|
|
396
396
|
return t;
|
|
397
397
|
};
|
|
398
|
-
var
|
|
399
|
-
for (var o = s > 1 ? void 0 : s ?
|
|
398
|
+
var Re = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, T = (e, t, n, s) => {
|
|
399
|
+
for (var o = s > 1 ? void 0 : s ? Ve(t, n) : t, i = e.length - 1, r; i >= 0; i--)
|
|
400
400
|
(r = e[i]) && (o = (s ? r(t, n, o) : r(o)) || o);
|
|
401
|
-
return s && o &&
|
|
401
|
+
return s && o && Re(t, n, o), o;
|
|
402
402
|
};
|
|
403
|
-
const
|
|
404
|
-
|
|
403
|
+
const Ie = (e) => `w-${e}`, pt = (e = "none", t = 1) => e === "full" ? t : Math.min(e, t);
|
|
404
|
+
class P extends ke(se) {
|
|
405
405
|
constructor() {
|
|
406
406
|
super(...arguments), this.listeners = [], this.branch = "default", this._descriptor = null, this._properties = {}, this._context = {}, this._layout = {};
|
|
407
407
|
}
|
|
@@ -409,64 +409,64 @@ let D = class extends Re(se) {
|
|
|
409
409
|
super.connectedCallback(), this.container = this.requestInstance("container"), this.container && Promise.all([
|
|
410
410
|
Et.getInstance(this.container),
|
|
411
411
|
this.container.getAsync("componentResolver")
|
|
412
|
-
]).then((
|
|
413
|
-
const
|
|
414
|
-
if (
|
|
415
|
-
this._descriptor = U(
|
|
416
|
-
const
|
|
417
|
-
this.style.setProperty("--gridColumn",
|
|
418
|
-
|
|
412
|
+
]).then((t) => {
|
|
413
|
+
const n = t[0], s = t[1], o = n.nodes.get(this.nodeId || "");
|
|
414
|
+
if (o) {
|
|
415
|
+
this._descriptor = U(o, this.branch), this._properties = o.attributes.properties, this._context = o.attributes.context, this._layout = o.attributes.layout;
|
|
416
|
+
const i = this.style.getPropertyValue("--columns") ? +this.style.getPropertyValue("--columns") : 1, r = pt(this._layout.size, i), c = typeof this._layout.indent != "undefined" ? `${this._layout.indent + 1} / ${this._layout.indent + (r || 0) + 1}` : `span ${r}`;
|
|
417
|
+
this.style.setProperty("--gridColumn", c), this.listeners.push(
|
|
418
|
+
n.events.subscribe(
|
|
419
419
|
"components:properties-changed",
|
|
420
|
-
(
|
|
420
|
+
(u, p) => {
|
|
421
421
|
var h;
|
|
422
|
-
this.nodeId === ((h =
|
|
422
|
+
this.nodeId === ((h = p.node) == null ? void 0 : h.id) && (this._properties = p.node.attributes.properties);
|
|
423
423
|
}
|
|
424
424
|
)
|
|
425
425
|
), this.listeners.push(
|
|
426
|
-
|
|
426
|
+
n.events.subscribe("components:context-changed", (u, p) => {
|
|
427
427
|
var h;
|
|
428
|
-
this.nodeId === ((h =
|
|
428
|
+
this.nodeId === ((h = p.node) == null ? void 0 : h.id) && (this._context = p.node.attributes.context);
|
|
429
429
|
})
|
|
430
430
|
), this.listeners.push(
|
|
431
|
-
|
|
431
|
+
n.events.subscribe("components:layout-changed", (u, p) => {
|
|
432
432
|
var h;
|
|
433
|
-
this.nodeId === ((h =
|
|
433
|
+
this.nodeId === ((h = p.node) == null ? void 0 : h.id) && (this._layout = p.node.attributes.layout);
|
|
434
434
|
})
|
|
435
435
|
);
|
|
436
|
-
const
|
|
437
|
-
if (this.listeners.push(
|
|
436
|
+
const a = o.mount(this.container);
|
|
437
|
+
if (this.listeners.push(a), !s) {
|
|
438
438
|
console.warn(
|
|
439
439
|
"Could not find resolver. Make sure it is registered on the container."
|
|
440
440
|
);
|
|
441
441
|
return;
|
|
442
442
|
}
|
|
443
|
-
const
|
|
444
|
-
if (customElements.get(
|
|
443
|
+
const l = Ie(this._descriptor.type);
|
|
444
|
+
if (customElements.get(l))
|
|
445
445
|
return;
|
|
446
|
-
const
|
|
447
|
-
if (!
|
|
446
|
+
const d = s.getComponent(this._descriptor.type);
|
|
447
|
+
if (!d) {
|
|
448
448
|
console.warn("Component is missing or using incorrect import.");
|
|
449
449
|
return;
|
|
450
450
|
}
|
|
451
|
-
return
|
|
452
|
-
customElements.get(
|
|
451
|
+
return d().then((u) => {
|
|
452
|
+
customElements.get(l) || customElements.define(l, u.default);
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
455
|
});
|
|
456
456
|
}
|
|
457
457
|
disconnectedCallback() {
|
|
458
|
-
this.listeners.forEach((
|
|
459
|
-
|
|
458
|
+
this.listeners.forEach((t) => {
|
|
459
|
+
t();
|
|
460
460
|
});
|
|
461
461
|
}
|
|
462
462
|
mapProps() {
|
|
463
|
-
var
|
|
464
|
-
const
|
|
463
|
+
var n;
|
|
464
|
+
const t = this.style.getPropertyValue("--columns") ? +this.style.getPropertyValue("--columns") : 1;
|
|
465
465
|
return Object.entries(this._properties).reduce(
|
|
466
|
-
(
|
|
466
|
+
(s, [o, i]) => (typeof i == "object" ? s[`.${o}`] = i : s[o] = i, s),
|
|
467
467
|
{
|
|
468
|
-
"data-width": pt(this._layout.size,
|
|
469
|
-
"data-indent": (
|
|
468
|
+
"data-width": pt(this._layout.size, t),
|
|
469
|
+
"data-indent": (n = this._layout.indent) != null ? n : 0,
|
|
470
470
|
id: this._descriptor.id,
|
|
471
471
|
"data-name": this._descriptor.name,
|
|
472
472
|
"data-component-type": this._descriptor.type,
|
|
@@ -477,53 +477,51 @@ let D = class extends Re(se) {
|
|
|
477
477
|
render() {
|
|
478
478
|
if (!this._descriptor)
|
|
479
479
|
return ee;
|
|
480
|
-
const
|
|
481
|
-
return
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
480
|
+
const t = `w-${this._descriptor.type}`, n = this.mapProps();
|
|
481
|
+
return oe`
|
|
482
|
+
<${ie(t)}
|
|
483
|
+
${te(n)}
|
|
484
|
+
.layout=${this._layout}
|
|
485
|
+
.context=${this._context}
|
|
486
|
+
/>
|
|
487
|
+
`;
|
|
488
488
|
}
|
|
489
|
-
}
|
|
490
|
-
|
|
489
|
+
}
|
|
490
|
+
P.styles = [
|
|
491
491
|
ne`
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
492
|
+
:host {
|
|
493
|
+
outline: none;
|
|
494
|
+
box-sizing: border-box;
|
|
495
|
+
}
|
|
496
496
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
497
|
+
* {
|
|
498
|
+
box-sizing: border-box;
|
|
499
|
+
outline: none;
|
|
500
|
+
}
|
|
501
501
|
|
|
502
|
-
|
|
503
|
-
|
|
502
|
+
grid-column: var(--gridColumn);
|
|
503
|
+
`
|
|
504
504
|
];
|
|
505
|
-
|
|
505
|
+
T([
|
|
506
506
|
Ct({ type: String })
|
|
507
|
-
],
|
|
508
|
-
|
|
507
|
+
], P.prototype, "nodeId", 2);
|
|
508
|
+
T([
|
|
509
509
|
Ct({ type: String })
|
|
510
|
-
],
|
|
511
|
-
|
|
510
|
+
], P.prototype, "branch", 2);
|
|
511
|
+
T([
|
|
512
512
|
Q()
|
|
513
|
-
],
|
|
514
|
-
|
|
513
|
+
], P.prototype, "_descriptor", 2);
|
|
514
|
+
T([
|
|
515
515
|
Q()
|
|
516
|
-
],
|
|
517
|
-
|
|
516
|
+
], P.prototype, "_properties", 2);
|
|
517
|
+
T([
|
|
518
518
|
Q()
|
|
519
|
-
],
|
|
520
|
-
|
|
519
|
+
], P.prototype, "_context", 2);
|
|
520
|
+
T([
|
|
521
521
|
Q()
|
|
522
|
-
],
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
], D);
|
|
526
|
-
const ze = (e) => `w-${e}`, En = (e, t, n) => dt(void 0, null, function* () {
|
|
522
|
+
], P.prototype, "_layout", 2);
|
|
523
|
+
customElements.get("widget-component") || customElements.define("widget-component", P);
|
|
524
|
+
const Te = (e) => `w-${e}`, vn = (e, t, n) => dt(void 0, null, function* () {
|
|
527
525
|
const s = n.nodes.get(e);
|
|
528
526
|
if (!t) {
|
|
529
527
|
console.warn("Could not find resolver. Make sure it is registered on the container.");
|
|
@@ -538,7 +536,7 @@ const ze = (e) => `w-${e}`, En = (e, t, n) => dt(void 0, null, function* () {
|
|
|
538
536
|
console.warn(`Could not get descriptor for: ${s.name}`);
|
|
539
537
|
return;
|
|
540
538
|
}
|
|
541
|
-
const i =
|
|
539
|
+
const i = Te(o.type);
|
|
542
540
|
if (customElements.get(i))
|
|
543
541
|
return;
|
|
544
542
|
const r = t.getComponent(o.type);
|
|
@@ -557,7 +555,7 @@ const ze = (e) => `w-${e}`, En = (e, t, n) => dt(void 0, null, function* () {
|
|
|
557
555
|
nodeId: e,
|
|
558
556
|
tag: i
|
|
559
557
|
}));
|
|
560
|
-
}),
|
|
558
|
+
}), ze = (e) => {
|
|
561
559
|
if (e) {
|
|
562
560
|
const { type: t, content: n } = e;
|
|
563
561
|
switch (t) {
|
|
@@ -569,7 +567,7 @@ const ze = (e) => `w-${e}`, En = (e, t, n) => dt(void 0, null, function* () {
|
|
|
569
567
|
return "";
|
|
570
568
|
}
|
|
571
569
|
}
|
|
572
|
-
},
|
|
570
|
+
}, Be = (e) => {
|
|
573
571
|
const t = (o, i) => {
|
|
574
572
|
!o || (i ? o.classList.add("humany-tabbing") : o.classList.remove("humany-tabbing"));
|
|
575
573
|
}, n = (o) => {
|
|
@@ -581,10 +579,10 @@ const ze = (e) => `w-${e}`, En = (e, t, n) => dt(void 0, null, function* () {
|
|
|
581
579
|
document.removeEventListener("keydown", n), document.removeEventListener("click", s);
|
|
582
580
|
};
|
|
583
581
|
};
|
|
584
|
-
function
|
|
582
|
+
function je(e, t) {
|
|
585
583
|
const { symbol: n, widgetName: s, label: o = "", ariaLabel: i = "", tooltip: r = "" } = t;
|
|
586
584
|
e.classList.add("humany-trigger"), e.classList.add(`humany_${s}`), o.length && e.classList.add("humany-has-text"), i.length && !e.getAttribute("aria-label") && e.setAttribute("aria-label", i), i.length && !e.getAttribute("tabindex") && e.setAttribute("tabindex", "0"), r.length && !e.getAttribute("title") && e.setAttribute("title", r);
|
|
587
|
-
const c =
|
|
585
|
+
const c = ze(n) || "";
|
|
588
586
|
return e.innerHTML = `${c}
|
|
589
587
|
<span class="humany-close">
|
|
590
588
|
<svg width="18" height="9" viewBox="0 0 18 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -603,14 +601,14 @@ function We(e, t) {
|
|
|
603
601
|
stroke-miterlimit="10" />
|
|
604
602
|
</svg>
|
|
605
603
|
</span>
|
|
606
|
-
${o.length ? `<span>${o}</span>` : ""}`, setTimeout(() => e && e.classList.add("humany-rendered")),
|
|
604
|
+
${o.length ? `<span>${o}</span>` : ""}`, setTimeout(() => e && e.classList.add("humany-rendered")), Be(e);
|
|
607
605
|
}
|
|
608
|
-
function
|
|
606
|
+
function We(e, t) {
|
|
609
607
|
e instanceof HTMLElement ? (t && e.setAttribute("title", t), e.classList.remove("humany-active"), e.classList.remove("humany-loading")) : e instanceof Array && e.forEach((n) => {
|
|
610
608
|
t && n.setAttribute("title", t), n.classList.remove("humany-active"), n.classList.remove("humany-loading");
|
|
611
609
|
});
|
|
612
610
|
}
|
|
613
|
-
function
|
|
611
|
+
function Fe(e) {
|
|
614
612
|
e instanceof HTMLElement ? (e.classList.remove("humany-active"), e.classList.add("humany-loading")) : e instanceof Array && e.forEach((t) => {
|
|
615
613
|
t.classList.remove("humany-active"), t.classList.add("humany-loading");
|
|
616
614
|
});
|
|
@@ -621,9 +619,9 @@ function xt(e, t) {
|
|
|
621
619
|
});
|
|
622
620
|
}
|
|
623
621
|
var _ = /* @__PURE__ */ ((e) => (e.Inline = "inline", e.Link = "link", e.Badge = "badge", e.Unsupported = "unsupported", e))(_ || {});
|
|
624
|
-
const
|
|
625
|
-
var
|
|
626
|
-
const i =
|
|
622
|
+
const Ge = (e, t) => e && t ? "both" : e ? "widgetDOM" : t ? "triggerDOM" : "none", $t = (e) => e ? typeof e == "boolean" && e ? "link" : typeof e == "object" && !Array.isArray(e) ? "badge" : "unsupported" : "inline", He = (e, t, n, s, o = !1) => {
|
|
623
|
+
var l, d;
|
|
624
|
+
const i = Ge(
|
|
627
625
|
t,
|
|
628
626
|
n
|
|
629
627
|
), r = $t(s), c = {
|
|
@@ -641,37 +639,37 @@ const He = (e, t) => e && t ? "both" : e ? "widgetDOM" : t ? "triggerDOM" : "non
|
|
|
641
639
|
}
|
|
642
640
|
case "widgetDOM": {
|
|
643
641
|
if (a.widgetDOMElement = t || document.createElement("div"), r !== "inline") {
|
|
644
|
-
const
|
|
645
|
-
r === "link" && (
|
|
642
|
+
const u = document.body.appendChild(document.createElement("a"));
|
|
643
|
+
r === "link" && (u.innerText = e), a.triggerDOMElement = u;
|
|
646
644
|
}
|
|
647
645
|
break;
|
|
648
646
|
}
|
|
649
647
|
case "triggerDOM": {
|
|
650
|
-
const
|
|
651
|
-
a.widgetDOMElement =
|
|
652
|
-
var
|
|
653
|
-
(
|
|
654
|
-
|
|
648
|
+
const u = document.createElement("div");
|
|
649
|
+
a.widgetDOMElement = u, r === "inline" ? (u.id = (n == null ? void 0 : n.id) || "", o ? (u.style.display = "none", (l = n == null ? void 0 : n.parentNode) == null || l.appendChild(u), a.callback = () => {
|
|
650
|
+
var p;
|
|
651
|
+
(p = n == null ? void 0 : n.parentNode) == null || p.replaceChild(
|
|
652
|
+
u,
|
|
655
653
|
n
|
|
656
|
-
),
|
|
654
|
+
), u.style.display = (n == null ? void 0 : n.style.display) || "block";
|
|
657
655
|
}) : (d = n == null ? void 0 : n.parentNode) == null || d.replaceChild(
|
|
658
|
-
|
|
656
|
+
u,
|
|
659
657
|
n
|
|
660
|
-
), a.cachedOriginals.widgetDOMElement = n, a.cachedOriginals.triggerDOMElement = void 0) : (a.widgetDOMElement = document.body.appendChild(
|
|
658
|
+
), a.cachedOriginals.widgetDOMElement = n, a.cachedOriginals.triggerDOMElement = void 0) : (a.widgetDOMElement = document.body.appendChild(u), a.triggerDOMElement = n);
|
|
661
659
|
break;
|
|
662
660
|
}
|
|
663
661
|
case "none": {
|
|
664
|
-
const
|
|
665
|
-
if (a.widgetDOMElement =
|
|
666
|
-
const
|
|
667
|
-
r === "link" && (
|
|
662
|
+
const u = document.body.appendChild(document.createElement("div"));
|
|
663
|
+
if (a.widgetDOMElement = u, r !== "inline") {
|
|
664
|
+
const p = document.body.appendChild(document.createElement("a"));
|
|
665
|
+
r === "link" && (p.innerText = e), a.triggerDOMElement = p;
|
|
668
666
|
}
|
|
669
667
|
break;
|
|
670
668
|
}
|
|
671
669
|
}
|
|
672
670
|
return a;
|
|
673
|
-
},
|
|
674
|
-
class
|
|
671
|
+
}, qe = "modals";
|
|
672
|
+
class Ke {
|
|
675
673
|
constructor(t, n) {
|
|
676
674
|
this.options = n, this.unsubscribe = [], this.container = t.createChild(this), this.container.register("widgetDOMElement", this.options.widgetDOMElement), this.container.register("triggerDOMElement", this.options.triggerDOMElement);
|
|
677
675
|
const s = this.container.get("$widget");
|
|
@@ -684,16 +682,16 @@ class Ue {
|
|
|
684
682
|
}
|
|
685
683
|
render() {
|
|
686
684
|
const { widgetDOMElement: t, triggerDOMElement: n } = this.options, s = this.container.get("$widget");
|
|
687
|
-
return t.getAttribute("data-rendered") === "true" ? Promise.resolve() : (n && this.options.triggerType === _.Badge &&
|
|
685
|
+
return t.getAttribute("data-rendered") === "true" ? Promise.resolve() : (n && this.options.triggerType === _.Badge && Fe(n), import("./render.3f019371.js").then((o) => o.default(s.name, this.container, t)).then(() => {
|
|
688
686
|
if (t.setAttribute("data-rendered", "true"), n && this.options.triggerType === _.Badge) {
|
|
689
687
|
const i = this.options.triggerOptions.openTooltip;
|
|
690
688
|
xt(n, i);
|
|
691
689
|
}
|
|
692
690
|
Yt(this.container, t);
|
|
693
691
|
const o = this.container.get("$environment").widgets.all();
|
|
694
|
-
|
|
692
|
+
N(
|
|
695
693
|
this.container,
|
|
696
|
-
|
|
694
|
+
qe,
|
|
697
695
|
v.Session
|
|
698
696
|
).then((i) => {
|
|
699
697
|
i && i.forEach((r) => {
|
|
@@ -709,9 +707,9 @@ class Ue {
|
|
|
709
707
|
if (!n)
|
|
710
708
|
return;
|
|
711
709
|
n.getAttribute("role") || n.setAttribute("role", "button");
|
|
712
|
-
const { name: s } = this.container.get("$widget"), { label: o, symbol: i, ariaLabel: r, closedTooltip: c, openTooltip: a } = t,
|
|
713
|
-
this.options.triggerOptions =
|
|
714
|
-
const d =
|
|
710
|
+
const { name: s } = this.container.get("$widget"), { label: o, symbol: i, ariaLabel: r, closedTooltip: c, openTooltip: a } = t, l = { closedTooltip: c, openTooltip: a };
|
|
711
|
+
this.options.triggerOptions = l;
|
|
712
|
+
const d = je(n, {
|
|
715
713
|
label: o,
|
|
716
714
|
symbol: i,
|
|
717
715
|
ariaLabel: r,
|
|
@@ -736,7 +734,7 @@ class Ue {
|
|
|
736
734
|
});
|
|
737
735
|
}
|
|
738
736
|
}
|
|
739
|
-
const q = "changesets",
|
|
737
|
+
const q = "changesets", Ue = (e) => {
|
|
740
738
|
const t = { tags: e.tags };
|
|
741
739
|
return e.context && typeof e.context != "function" && (t.context = e.context), e.properties && typeof e.properties != "function" && (t.properties = e.properties), e.layout && typeof e.layout != "function" && (t.layout = e.layout), t;
|
|
742
740
|
};
|
|
@@ -745,12 +743,12 @@ class rt {
|
|
|
745
743
|
this.container = t, this.storageWriter = n;
|
|
746
744
|
}
|
|
747
745
|
static create(t) {
|
|
748
|
-
return
|
|
746
|
+
return V(t, q, I.Necessary, {
|
|
749
747
|
medium: v.Local
|
|
750
748
|
}).then((n) => new rt(t, n));
|
|
751
749
|
}
|
|
752
750
|
write(t, n, s, o) {
|
|
753
|
-
return X(this)(() =>
|
|
751
|
+
return X(this)(() => N(
|
|
754
752
|
this.container,
|
|
755
753
|
q,
|
|
756
754
|
v.Local
|
|
@@ -758,13 +756,13 @@ class rt {
|
|
|
758
756
|
const { keys: r = [], items: c = {} } = i, a = r.indexOf(t);
|
|
759
757
|
return a > -1 && r.splice(a, 1), r.push(t), c[t] = {
|
|
760
758
|
options: o,
|
|
761
|
-
attributes:
|
|
759
|
+
attributes: Ue(s),
|
|
762
760
|
rules: n.rules
|
|
763
761
|
}, this.storageWriter({ keys: r, items: c });
|
|
764
762
|
}));
|
|
765
763
|
}
|
|
766
764
|
remove(t) {
|
|
767
|
-
return X(this)(() =>
|
|
765
|
+
return X(this)(() => N(
|
|
768
766
|
this.container,
|
|
769
767
|
q,
|
|
770
768
|
v.Local
|
|
@@ -775,7 +773,7 @@ class rt {
|
|
|
775
773
|
}));
|
|
776
774
|
}
|
|
777
775
|
load(t) {
|
|
778
|
-
return X(this)(() =>
|
|
776
|
+
return X(this)(() => N(
|
|
779
777
|
this.container,
|
|
780
778
|
q,
|
|
781
779
|
v.Local
|
|
@@ -784,10 +782,10 @@ class rt {
|
|
|
784
782
|
s.forEach((i) => {
|
|
785
783
|
const r = o[i];
|
|
786
784
|
if (r) {
|
|
787
|
-
const { rules: c, attributes: a, options:
|
|
785
|
+
const { rules: c, attributes: a, options: l } = r;
|
|
788
786
|
t.write({
|
|
789
787
|
attributes: a,
|
|
790
|
-
options:
|
|
788
|
+
options: l,
|
|
791
789
|
target: new Ut(t, c)
|
|
792
790
|
});
|
|
793
791
|
}
|
|
@@ -795,15 +793,15 @@ class rt {
|
|
|
795
793
|
}));
|
|
796
794
|
}
|
|
797
795
|
}
|
|
798
|
-
const
|
|
796
|
+
const Ye = (e) => {
|
|
799
797
|
const { container: t } = e;
|
|
800
798
|
return rt.create(t).then((n) => {
|
|
801
799
|
const s = t.get("$settings"), o = { localStorage: n }, i = new Et(e, o), r = Kt(i, s);
|
|
802
800
|
return e.events.subscribe("widget:state-change", (c, a) => {
|
|
803
|
-
a.state ===
|
|
801
|
+
a.state === le.Deactivating && r();
|
|
804
802
|
}), i;
|
|
805
803
|
});
|
|
806
|
-
},
|
|
804
|
+
}, Qe = (e) => import("@telia-ace/widget-routing").then(({ RoutingService: t, HistoryMode: n }) => e.get("settings").then((s) => {
|
|
807
805
|
const {
|
|
808
806
|
routing: { initialPath: o = "/", mode: i = n.scopedHash, basePath: r },
|
|
809
807
|
views: c
|
|
@@ -811,14 +809,14 @@ const Qe = (e) => {
|
|
|
811
809
|
return new t(e, {
|
|
812
810
|
initialPath: o,
|
|
813
811
|
mode: i,
|
|
814
|
-
routes: Object.keys(c).map((
|
|
815
|
-
name:
|
|
816
|
-
path: c[
|
|
812
|
+
routes: Object.keys(c).map((l) => ({
|
|
813
|
+
name: l,
|
|
814
|
+
path: c[l].path
|
|
817
815
|
})),
|
|
818
816
|
basePath: r
|
|
819
817
|
});
|
|
820
|
-
})),
|
|
821
|
-
class
|
|
818
|
+
})), Ze = (e) => import("@telia-ace/widget-services").then(({ StorageProvider: t }) => new t()), Je = (e) => import("@telia-ace/widget-core").then(({ ActionResolver: t }) => new t(e)), Xe = (e) => import("@telia-ace/widget-core").then(({ ComponentResolver: t }) => new t(e)), tn = (e) => import("@telia-ace/widget-core").then(({ ComponentPlatform: t, createComponentModel: n }) => Ye(e.get("$widget"))), et = "$settings", K = "open", mt = "activeStickyWidget";
|
|
819
|
+
class En extends ue {
|
|
822
820
|
constructor(t) {
|
|
823
821
|
super(t), this.outlets = /* @__PURE__ */ new Map(), this.activated = void 0, this.subs = [], this.handleBootstrapping = (n) => {
|
|
824
822
|
const s = {
|
|
@@ -831,14 +829,14 @@ class Cn extends de {
|
|
|
831
829
|
() => this.attach(s)
|
|
832
830
|
));
|
|
833
831
|
});
|
|
834
|
-
}, this.container.registerAsync("storage", () =>
|
|
832
|
+
}, this.container.registerAsync("storage", () => Ze(this.container)), this.container.registerFactory("settings", () => N(
|
|
835
833
|
this.container,
|
|
836
834
|
et,
|
|
837
835
|
v.Local
|
|
838
|
-
).then((n = {}) => f(f({}, this.container.get("$settings")), n))),
|
|
836
|
+
).then((n = {}) => f(f({}, this.container.get("$settings")), n))), ce(this, "load", this.handleBootstrapping), this.container.registerAsync(
|
|
839
837
|
"componentResolver",
|
|
840
|
-
() =>
|
|
841
|
-
), this.container.registerAsync("router", () =>
|
|
838
|
+
() => Xe(this.container)
|
|
839
|
+
), this.container.registerAsync("router", () => Qe(this.container)), this.container.registerAsync("actionResolver", () => Je(this.container)), this.container.register("matchMedia", window.matchMedia), this.container.registerAsync("components", () => tn(this.container));
|
|
842
840
|
}
|
|
843
841
|
initialize() {
|
|
844
842
|
const t = this.container.getManyAsync(
|
|
@@ -851,25 +849,25 @@ class Cn extends de {
|
|
|
851
849
|
var a;
|
|
852
850
|
n.subscribe(
|
|
853
851
|
this.widget.name,
|
|
854
|
-
(
|
|
852
|
+
(l, d, u) => this.onAction(d, u)
|
|
855
853
|
);
|
|
856
|
-
const r = (
|
|
854
|
+
const r = (l) => {
|
|
857
855
|
o.nodes.query({ type: "view" }).forEach((d) => {
|
|
858
|
-
o.setSwitch(d,
|
|
856
|
+
o.setSwitch(d, l);
|
|
859
857
|
});
|
|
860
858
|
}, c = ((a = s.getInitialRoute()) == null ? void 0 : a.name) || "index";
|
|
861
|
-
return r(c), this.events.subscribe("widget:data-loaded", (
|
|
859
|
+
return r(c), this.events.subscribe("widget:data-loaded", (l, { element: d }) => {
|
|
862
860
|
this.widget.container.get("seoConfiguration") && this.events.dispatch("widget:preloaded-replaced", {
|
|
863
861
|
element: d
|
|
864
862
|
});
|
|
865
863
|
}), this.events.subscribe(
|
|
866
864
|
"router:change",
|
|
867
|
-
(
|
|
868
|
-
const { routeData:
|
|
869
|
-
!
|
|
865
|
+
(l, { previous: d = { routeData: {} }, next: u = { routeData: {} } }) => {
|
|
866
|
+
const { routeData: p } = d, { routeData: h } = u, g = Object.keys(i.views).reduce((b, y) => typeof i.views[y].path == "undefined" ? y : b, "");
|
|
867
|
+
!h.name && g ? r(g) : r(h.name), ht(p && p.params), ht(h && h.params), this.container.getAsync("actionResolver").then((b) => {
|
|
870
868
|
b.action(this.widget.name, "routeChange", {
|
|
871
|
-
next:
|
|
872
|
-
previous:
|
|
869
|
+
next: h,
|
|
870
|
+
previous: p
|
|
873
871
|
});
|
|
874
872
|
});
|
|
875
873
|
}
|
|
@@ -879,13 +877,13 @@ class Cn extends de {
|
|
|
879
877
|
}
|
|
880
878
|
attach(t = {}) {
|
|
881
879
|
return this.container.get("settings").then(({ trigger: n }) => {
|
|
882
|
-
var
|
|
880
|
+
var p, h;
|
|
883
881
|
const {
|
|
884
882
|
widgetDOMElement: s,
|
|
885
883
|
key: o = Qt(),
|
|
886
884
|
triggerDOMElement: i,
|
|
887
885
|
withRenderState: r
|
|
888
|
-
} = t, a = $t(n) === _.Inline && ((i == null ? void 0 : i.childElementCount) || 0) > 0,
|
|
886
|
+
} = t, a = $t(n) === _.Inline && ((i == null ? void 0 : i.childElementCount) || 0) > 0, l = He(
|
|
889
887
|
this.widget.name,
|
|
890
888
|
s,
|
|
891
889
|
i,
|
|
@@ -895,23 +893,23 @@ class Cn extends de {
|
|
|
895
893
|
this.outlets.size < 1 && !r && this.setRenderState("unset");
|
|
896
894
|
const d = () => {
|
|
897
895
|
const g = () => b.querySelectorAll("[data-loading=true]").length === 0, [b] = this.widget.container.get("widgetDOMElements"), y = (F, L) => {
|
|
898
|
-
g() && (
|
|
896
|
+
g() && (l.callback && l.callback(), L.disconnect());
|
|
899
897
|
}, E = {
|
|
900
898
|
attributes: !0,
|
|
901
899
|
subtree: !0,
|
|
902
900
|
childList: !0
|
|
903
901
|
};
|
|
904
|
-
g() &&
|
|
902
|
+
g() && l.callback && l.callback(), new MutationObserver(y).observe(b, E);
|
|
905
903
|
};
|
|
906
904
|
a && this.widget.container.getAsync("dataClient").then(({ events: g }) => {
|
|
907
905
|
g.subscribe("data-client:fetched", (b, y) => {
|
|
908
906
|
y.unresolvedQueries === 0 && d();
|
|
909
907
|
});
|
|
910
908
|
});
|
|
911
|
-
const
|
|
912
|
-
if (this.outlets.set(o,
|
|
909
|
+
const u = this.getOrCreateViewOutlet(o, l);
|
|
910
|
+
if (this.outlets.set(o, u), this.widget.events.dispatch("widget:attached", {}, { bubbles: !0 }), l.triggerType === _.Badge && n && ((p = l.triggerDOMElement) == null || p.setAttribute("aria-expanded", "false"), u == null || u.renderBadge(n)), l.triggerType !== _.Inline && ((h = l.triggerDOMElement) == null || h.addEventListener("click", (g) => {
|
|
913
911
|
g.preventDefault(), this.container.get("settings").then(({ trigger: b }) => {
|
|
914
|
-
|
|
912
|
+
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());
|
|
915
913
|
});
|
|
916
914
|
})), this.outlets.size > 1)
|
|
917
915
|
return this.renderState().then((g) => {
|
|
@@ -919,7 +917,7 @@ class Cn extends de {
|
|
|
919
917
|
});
|
|
920
918
|
if (r)
|
|
921
919
|
return r === "storage" ? this.renderState().then((g) => {
|
|
922
|
-
if (
|
|
920
|
+
if (l.triggerType === _.Inline) {
|
|
923
921
|
this.triggerStateIfApplicable("open");
|
|
924
922
|
return;
|
|
925
923
|
}
|
|
@@ -959,7 +957,7 @@ class Cn extends de {
|
|
|
959
957
|
});
|
|
960
958
|
}
|
|
961
959
|
getOrCreateViewOutlet(t, n) {
|
|
962
|
-
return this.outlets.has(t) ? this.outlets.get(t) : new
|
|
960
|
+
return this.outlets.has(t) ? this.outlets.get(t) : new Ke(this.container, n);
|
|
963
961
|
}
|
|
964
962
|
render(t = {}) {
|
|
965
963
|
if (process.env.NODE_ENV !== "production" && console.warn("widget.render() is deprecated. Use widget.attach() instead."), t.open) {
|
|
@@ -976,7 +974,7 @@ class Cn extends de {
|
|
|
976
974
|
setSettings(t) {
|
|
977
975
|
return Promise.all([
|
|
978
976
|
this.container.get("settings"),
|
|
979
|
-
|
|
977
|
+
V(this.container, et, I.Necessary, {
|
|
980
978
|
medium: v.Local
|
|
981
979
|
})
|
|
982
980
|
]).then(([n, s]) => Promise.resolve(t(n)).then((o) => s(o).then(() => {
|
|
@@ -985,10 +983,10 @@ class Cn extends de {
|
|
|
985
983
|
})));
|
|
986
984
|
}
|
|
987
985
|
clearSettings() {
|
|
988
|
-
return
|
|
986
|
+
return V(
|
|
989
987
|
this.container,
|
|
990
988
|
et,
|
|
991
|
-
|
|
989
|
+
I.Necessary,
|
|
992
990
|
{ medium: v.Local }
|
|
993
991
|
).then((t) => t()).then(() => this.container.get("settings")).then((t) => {
|
|
994
992
|
this.widget.events.dispatch("widget:settings-updated", t);
|
|
@@ -1000,13 +998,13 @@ class Cn extends de {
|
|
|
1000
998
|
});
|
|
1001
999
|
}
|
|
1002
1000
|
renderState() {
|
|
1003
|
-
if (
|
|
1001
|
+
if (re(this.container))
|
|
1004
1002
|
return Promise.resolve(O.open);
|
|
1005
|
-
const t = () =>
|
|
1003
|
+
const t = () => N(
|
|
1006
1004
|
this.container,
|
|
1007
1005
|
K,
|
|
1008
1006
|
v.Session
|
|
1009
|
-
).then((s = O.closed) => s), n = () =>
|
|
1007
|
+
).then((s = O.closed) => s), n = () => N(
|
|
1010
1008
|
this.container,
|
|
1011
1009
|
K,
|
|
1012
1010
|
v.Session
|
|
@@ -1054,10 +1052,10 @@ class Cn extends de {
|
|
|
1054
1052
|
setRenderState(t) {
|
|
1055
1053
|
const { invoke: n, events: s } = this.container.get("$widget");
|
|
1056
1054
|
return Promise.all([
|
|
1057
|
-
|
|
1055
|
+
V(this.container, K, I.Necessary, {
|
|
1058
1056
|
medium: v.Session
|
|
1059
1057
|
}),
|
|
1060
|
-
|
|
1058
|
+
V(this.container, K, I.Necessary, {
|
|
1061
1059
|
medium: v.Local,
|
|
1062
1060
|
duration: { minutes: 5 }
|
|
1063
1061
|
}),
|
|
@@ -1109,35 +1107,35 @@ class Cn extends de {
|
|
|
1109
1107
|
const {
|
|
1110
1108
|
options: { triggerDOMElement: s, triggerOptions: o }
|
|
1111
1109
|
} = n, { openTooltip: i, closedTooltip: r } = o || {};
|
|
1112
|
-
s && (t ? xt(s, i) :
|
|
1110
|
+
s && (t ? xt(s, i) : We(s, r));
|
|
1113
1111
|
});
|
|
1114
1112
|
}
|
|
1115
1113
|
deactivate() {
|
|
1116
1114
|
this.subs.forEach((n) => n());
|
|
1117
1115
|
const t = [];
|
|
1118
|
-
return this.outlets.forEach((n) => t.push(n.dispose())),
|
|
1116
|
+
return this.outlets.forEach((n) => t.push(n.dispose())), N(
|
|
1119
1117
|
this.container,
|
|
1120
1118
|
mt,
|
|
1121
1119
|
v.Local
|
|
1122
|
-
).then((n) => n === this.widget.name ?
|
|
1120
|
+
).then((n) => n === this.widget.name ? V(
|
|
1123
1121
|
this.container,
|
|
1124
1122
|
mt,
|
|
1125
|
-
|
|
1123
|
+
I.Necessary,
|
|
1126
1124
|
{
|
|
1127
1125
|
medium: v.Local,
|
|
1128
|
-
scope:
|
|
1126
|
+
scope: ae.Implementation
|
|
1129
1127
|
}
|
|
1130
1128
|
).then((s) => s()).then(() => Promise.all(t)) : Promise.all(t));
|
|
1131
1129
|
}
|
|
1132
1130
|
}
|
|
1133
1131
|
export {
|
|
1134
1132
|
it as Component,
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1133
|
+
Ne as DetachedComponent,
|
|
1134
|
+
En as GridWidget,
|
|
1135
|
+
wn as NotFound,
|
|
1136
|
+
En as Widget,
|
|
1137
|
+
P as WidgetComponent,
|
|
1140
1138
|
Z as genericComponentStyling,
|
|
1141
|
-
|
|
1139
|
+
vn as resolveComponent
|
|
1142
1140
|
};
|
|
1143
1141
|
//# sourceMappingURL=index.js.map
|