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