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