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