@telia-ace/knowledge-widget-types-grid 1.1.1-rc.1 → 1.1.1-rc.2
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/index-37d41a7c.js +1 -0
- package/index-4000749f.mjs +18 -0
- package/index-4a7683d6.mjs +7686 -0
- package/{index-2a0d3b27.mjs → index-53f86cb1.mjs} +15 -10
- package/index-6573c0b0.js +1258 -0
- package/index-83935001.js +1 -0
- package/index-89e0c636.js +1 -0
- package/{index-ef4f44cd.mjs → index-8ea3d174.mjs} +34 -29
- package/{index-e3bba2b0.mjs → index-a20f39e4.mjs} +157 -152
- package/index-a53df8cf.js +642 -0
- package/{index-6cc56345.js → index-da27700c.js} +1 -1
- package/{index-2a67ee55.mjs → index-f2febaed.mjs} +71 -66
- package/index.js +1 -1
- package/index.mjs +18 -13
- package/package.json +5 -5
- package/render-6b17449a.js +1 -0
- package/render-e363a527.mjs +57 -0
- package/unmount-7ebc3b77.js +1 -0
- package/index-0d4037dc.js +0 -1
- package/index-48abc5fd.js +0 -1
- package/index-6e1f4d54.js +0 -1291
- package/index-a87d669f.js +0 -642
- package/index-ddecdfc6.mjs +0 -13
- package/index-f35c9d50.js +0 -1
- package/index-f6d7c0ea.mjs +0 -11776
- package/render-8a105395.js +0 -1
- package/render-e917ce7f.mjs +0 -51
- package/unmount-481ce5a7.js +0 -1
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
var Rt = Object.defineProperty;
|
|
2
2
|
var Mt = (r, t, e) => t in r ? Rt(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
3
|
var k = (r, t, e) => (Mt(r, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { G as Tt, H as Ct, I as U, J as Dt, K as nt, _ as It, M as Y, N as Z, O as ut, P as At, Q as $t, T as _t, k as ft, j as Bt, c as Nt, U as dt, V as rt, X as it, Y as Ut, L as Ft, Z as st, $ as Q, a0 as lt, a1 as et, a2 as jt, r as Wt, a3 as Kt, a4 as z, a5 as J, a6 as Vt } from "./index-4a7683d6.mjs";
|
|
5
|
+
import { a7 as ke, a8 as Re } from "./index-4a7683d6.mjs";
|
|
6
6
|
import { c as Yt } from "./create-params-4e652cc7.mjs";
|
|
7
7
|
import "react/jsx-runtime";
|
|
8
|
+
import "@emotion/styled";
|
|
9
|
+
import "@emotion/react";
|
|
8
10
|
import "react";
|
|
11
|
+
import "react-transition-group";
|
|
9
12
|
import "react-dom";
|
|
13
|
+
import "react-router-dom";
|
|
14
|
+
import "react-router";
|
|
10
15
|
var zt = function(r, t, e, n, s, a, c, p) {
|
|
11
16
|
if (process.env.NODE_ENV !== "production" && t === void 0)
|
|
12
17
|
throw new Error("invariant requires an error message argument");
|
|
@@ -17,10 +22,10 @@ var zt = function(r, t, e, n, s, a, c, p) {
|
|
|
17
22
|
"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
|
|
18
23
|
);
|
|
19
24
|
else {
|
|
20
|
-
var d = [e, n, s, a, c, p],
|
|
25
|
+
var d = [e, n, s, a, c, p], S = 0;
|
|
21
26
|
h = new Error(
|
|
22
27
|
t.replace(/%s/g, function() {
|
|
23
|
-
return d[
|
|
28
|
+
return d[S++];
|
|
24
29
|
})
|
|
25
30
|
), h.name = "Invariant Violation";
|
|
26
31
|
}
|
|
@@ -69,24 +74,24 @@ var Qt = function(t) {
|
|
|
69
74
|
return U(t == null, "A history supports only one prompt at a time"), t = h, function() {
|
|
70
75
|
t === h && (t = null);
|
|
71
76
|
};
|
|
72
|
-
}, n = function(h, d,
|
|
77
|
+
}, n = function(h, d, S, v) {
|
|
73
78
|
if (t != null) {
|
|
74
79
|
var C = typeof t == "function" ? t(h, d) : t;
|
|
75
|
-
typeof C == "string" ? typeof
|
|
80
|
+
typeof C == "string" ? typeof S == "function" ? S(C, v) : (U(!1, "A history needs a getUserConfirmation function in order to use a prompt message"), v(!0)) : v(C !== !1);
|
|
76
81
|
} else
|
|
77
82
|
v(!0);
|
|
78
83
|
}, s = [], a = function(h) {
|
|
79
|
-
var d = !0,
|
|
84
|
+
var d = !0, S = function() {
|
|
80
85
|
d && h.apply(void 0, arguments);
|
|
81
86
|
};
|
|
82
|
-
return s.push(
|
|
87
|
+
return s.push(S), function() {
|
|
83
88
|
d = !1, s = s.filter(function(v) {
|
|
84
|
-
return v !==
|
|
89
|
+
return v !== S;
|
|
85
90
|
});
|
|
86
91
|
};
|
|
87
92
|
}, c = function() {
|
|
88
|
-
for (var h = arguments.length, d = Array(h),
|
|
89
|
-
d[
|
|
93
|
+
for (var h = arguments.length, d = Array(h), S = 0; S < h; S++)
|
|
94
|
+
d[S] = arguments[S];
|
|
90
95
|
s.forEach(function(v) {
|
|
91
96
|
return v.apply(void 0, d);
|
|
92
97
|
});
|
|
@@ -130,16 +135,16 @@ var Qt = function(t) {
|
|
|
130
135
|
}, oe = function() {
|
|
131
136
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
132
137
|
Gt(ee, "Browser history needs a DOM");
|
|
133
|
-
var e = window.history, n = ae(), s = !re(), a = t.forceRefresh, c = a === void 0 ? !1 : a, p = t.getUserConfirmation, h = p === void 0 ? ne : p, d = t.keyLength,
|
|
138
|
+
var e = window.history, n = ae(), s = !re(), a = t.forceRefresh, c = a === void 0 ? !1 : a, p = t.getUserConfirmation, h = p === void 0 ? ne : p, d = t.keyLength, S = d === void 0 ? 6 : d, v = t.basename ? Xt(Qt(t.basename)) : "", C = function(i) {
|
|
134
139
|
var l = i || {}, y = l.key, g = l.state, H = window.location, P = H.pathname, M = H.search, N = H.hash, T = P + M + N;
|
|
135
140
|
return U(!v || Ot(T, v), 'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "' + T + '" to begin with "' + v + '".'), v && (T = Jt(T, v)), q(T, g, y);
|
|
136
141
|
}, F = function() {
|
|
137
|
-
return Math.random().toString(36).substr(2,
|
|
142
|
+
return Math.random().toString(36).substr(2, S);
|
|
138
143
|
}, D = kt(), B = function(i) {
|
|
139
144
|
se(f, i), f.length = e.length, D.notifyListeners(f.location, f.action);
|
|
140
145
|
}, R = function(i) {
|
|
141
146
|
ie(i) || W(C(i.state));
|
|
142
|
-
},
|
|
147
|
+
}, A = function() {
|
|
143
148
|
W(C(wt()));
|
|
144
149
|
}, j = !1, W = function(i) {
|
|
145
150
|
if (j)
|
|
@@ -151,13 +156,13 @@ var Qt = function(t) {
|
|
|
151
156
|
});
|
|
152
157
|
}
|
|
153
158
|
}, X = function(i) {
|
|
154
|
-
var l = f.location, y =
|
|
159
|
+
var l = f.location, y = I.indexOf(l.key);
|
|
155
160
|
y === -1 && (y = 0);
|
|
156
|
-
var g =
|
|
161
|
+
var g = I.indexOf(i.key);
|
|
157
162
|
g === -1 && (g = 0);
|
|
158
163
|
var H = y - g;
|
|
159
|
-
H && (j = !0,
|
|
160
|
-
}, G = C(wt()),
|
|
164
|
+
H && (j = !0, b(H));
|
|
165
|
+
}, G = C(wt()), I = [G.key], m = function(i) {
|
|
161
166
|
return v + Et(i);
|
|
162
167
|
}, x = function(i, l) {
|
|
163
168
|
U(!((typeof i > "u" ? "undefined" : mt(i)) === "object" && i.state !== void 0 && l !== void 0), "You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");
|
|
@@ -169,8 +174,8 @@ var Qt = function(t) {
|
|
|
169
174
|
if (e.pushState({ key: M, state: N }, null, P), c)
|
|
170
175
|
window.location.href = P;
|
|
171
176
|
else {
|
|
172
|
-
var T =
|
|
173
|
-
tt.push(g.key),
|
|
177
|
+
var T = I.indexOf(f.location.key), tt = I.slice(0, T === -1 ? 0 : T + 1);
|
|
178
|
+
tt.push(g.key), I = tt, B({ action: y, location: g });
|
|
174
179
|
}
|
|
175
180
|
else
|
|
176
181
|
U(N === void 0, "Browser history cannot push state in browsers that do not support HTML5 history"), window.location.href = P;
|
|
@@ -186,21 +191,21 @@ var Qt = function(t) {
|
|
|
186
191
|
if (e.replaceState({ key: M, state: N }, null, P), c)
|
|
187
192
|
window.location.replace(P);
|
|
188
193
|
else {
|
|
189
|
-
var T =
|
|
190
|
-
T !== -1 && (
|
|
194
|
+
var T = I.indexOf(f.location.key);
|
|
195
|
+
T !== -1 && (I[T] = g.key), B({ action: y, location: g });
|
|
191
196
|
}
|
|
192
197
|
else
|
|
193
198
|
U(N === void 0, "Browser history cannot replace state in browsers that do not support HTML5 history"), window.location.replace(P);
|
|
194
199
|
}
|
|
195
200
|
});
|
|
196
|
-
},
|
|
201
|
+
}, b = function(i) {
|
|
197
202
|
e.go(i);
|
|
198
203
|
}, E = function() {
|
|
199
|
-
return
|
|
204
|
+
return b(-1);
|
|
200
205
|
}, L = function() {
|
|
201
|
-
return
|
|
206
|
+
return b(1);
|
|
202
207
|
}, $ = 0, V = function(i) {
|
|
203
|
-
$ += i, $ === 1 ? (pt(window, vt, R), s && pt(window, yt,
|
|
208
|
+
$ += i, $ === 1 ? (pt(window, vt, R), s && pt(window, yt, A)) : $ === 0 && (gt(window, vt, R), s && gt(window, yt, A));
|
|
204
209
|
}, _ = !1, O = function() {
|
|
205
210
|
var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, l = D.setPrompt(i);
|
|
206
211
|
return _ || (V(1), _ = !0), function() {
|
|
@@ -218,7 +223,7 @@ var Qt = function(t) {
|
|
|
218
223
|
createHref: m,
|
|
219
224
|
push: x,
|
|
220
225
|
replace: w,
|
|
221
|
-
go:
|
|
226
|
+
go: b,
|
|
222
227
|
goBack: E,
|
|
223
228
|
goForward: L,
|
|
224
229
|
block: O,
|
|
@@ -236,22 +241,22 @@ var Qt = function(t) {
|
|
|
236
241
|
Object.prototype.hasOwnProperty.call(e, n) && (r[n] = e[n]);
|
|
237
242
|
}
|
|
238
243
|
return r;
|
|
239
|
-
},
|
|
244
|
+
}, St = function(t, e, n) {
|
|
240
245
|
return Math.min(Math.max(t, e), n);
|
|
241
246
|
}, he = function() {
|
|
242
|
-
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = t.getUserConfirmation, n = t.initialEntries, s = n === void 0 ? ["/"] : n, a = t.initialIndex, c = a === void 0 ? 0 : a, p = t.keyLength, h = p === void 0 ? 6 : p, d = kt(),
|
|
247
|
+
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = t.getUserConfirmation, n = t.initialEntries, s = n === void 0 ? ["/"] : n, a = t.initialIndex, c = a === void 0 ? 0 : a, p = t.keyLength, h = p === void 0 ? 6 : p, d = kt(), S = function(w) {
|
|
243
248
|
ce(m, w), m.length = m.entries.length, d.notifyListeners(m.location, m.action);
|
|
244
249
|
}, v = function() {
|
|
245
250
|
return Math.random().toString(36).substr(2, h);
|
|
246
|
-
}, C =
|
|
251
|
+
}, C = St(c, 0, s.length - 1), F = s.map(function(x) {
|
|
247
252
|
return typeof x == "string" ? q(x, void 0, v()) : q(x, void 0, x.key || v());
|
|
248
|
-
}), D = Et, B = function(w,
|
|
249
|
-
U(!((typeof w > "u" ? "undefined" : Pt(w)) === "object" && w.state !== void 0 &&
|
|
250
|
-
var E = "PUSH", L = q(w,
|
|
253
|
+
}), D = Et, B = function(w, b) {
|
|
254
|
+
U(!((typeof w > "u" ? "undefined" : Pt(w)) === "object" && w.state !== void 0 && b !== void 0), "You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");
|
|
255
|
+
var E = "PUSH", L = q(w, b, v(), m.location);
|
|
251
256
|
d.confirmTransitionTo(L, E, e, function($) {
|
|
252
257
|
if ($) {
|
|
253
258
|
var V = m.index, _ = V + 1, O = m.entries.slice(0);
|
|
254
|
-
O.length > _ ? O.splice(_, O.length - _, L) : O.push(L),
|
|
259
|
+
O.length > _ ? O.splice(_, O.length - _, L) : O.push(L), S({
|
|
255
260
|
action: E,
|
|
256
261
|
location: L,
|
|
257
262
|
index: _,
|
|
@@ -259,32 +264,32 @@ var Qt = function(t) {
|
|
|
259
264
|
});
|
|
260
265
|
}
|
|
261
266
|
});
|
|
262
|
-
}, R = function(w,
|
|
263
|
-
U(!((typeof w > "u" ? "undefined" : Pt(w)) === "object" && w.state !== void 0 &&
|
|
264
|
-
var E = "REPLACE", L = q(w,
|
|
267
|
+
}, R = function(w, b) {
|
|
268
|
+
U(!((typeof w > "u" ? "undefined" : Pt(w)) === "object" && w.state !== void 0 && b !== void 0), "You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");
|
|
269
|
+
var E = "REPLACE", L = q(w, b, v(), m.location);
|
|
265
270
|
d.confirmTransitionTo(L, E, e, function($) {
|
|
266
|
-
$ && (m.entries[m.index] = L,
|
|
271
|
+
$ && (m.entries[m.index] = L, S({ action: E, location: L }));
|
|
267
272
|
});
|
|
268
|
-
},
|
|
269
|
-
var
|
|
273
|
+
}, A = function(w) {
|
|
274
|
+
var b = St(m.index + w, 0, m.entries.length - 1), E = "POP", L = m.entries[b];
|
|
270
275
|
d.confirmTransitionTo(L, E, e, function($) {
|
|
271
|
-
$ ?
|
|
276
|
+
$ ? S({
|
|
272
277
|
action: E,
|
|
273
278
|
location: L,
|
|
274
|
-
index:
|
|
275
|
-
}) :
|
|
279
|
+
index: b
|
|
280
|
+
}) : S();
|
|
276
281
|
});
|
|
277
282
|
}, j = function() {
|
|
278
|
-
return
|
|
283
|
+
return A(-1);
|
|
279
284
|
}, W = function() {
|
|
280
|
-
return
|
|
285
|
+
return A(1);
|
|
281
286
|
}, X = function(w) {
|
|
282
|
-
var
|
|
283
|
-
return
|
|
287
|
+
var b = m.index + w;
|
|
288
|
+
return b >= 0 && b < m.entries.length;
|
|
284
289
|
}, G = function() {
|
|
285
290
|
var w = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
|
|
286
291
|
return d.setPrompt(w);
|
|
287
|
-
},
|
|
292
|
+
}, I = function(w) {
|
|
288
293
|
return d.appendListener(w);
|
|
289
294
|
}, m = {
|
|
290
295
|
length: F.length,
|
|
@@ -295,16 +300,16 @@ var Qt = function(t) {
|
|
|
295
300
|
createHref: D,
|
|
296
301
|
push: B,
|
|
297
302
|
replace: R,
|
|
298
|
-
go:
|
|
303
|
+
go: A,
|
|
299
304
|
goBack: j,
|
|
300
305
|
goForward: W,
|
|
301
306
|
canGo: X,
|
|
302
307
|
block: G,
|
|
303
|
-
listen:
|
|
308
|
+
listen: I
|
|
304
309
|
};
|
|
305
310
|
return m;
|
|
306
311
|
};
|
|
307
|
-
const
|
|
312
|
+
const bt = "hashchange", ue = {
|
|
308
313
|
hashbang: {
|
|
309
314
|
encodePath: (r) => r.charAt(0) === "!" ? r : "!/" + ut(r),
|
|
310
315
|
decodePath: (r) => r.charAt(0) === "!" ? r.substr(1) : r
|
|
@@ -335,10 +340,10 @@ const St = "hashchange", ue = {
|
|
|
335
340
|
n = n.replace(a, s);
|
|
336
341
|
}), n;
|
|
337
342
|
}, fe = (r = {}) => {
|
|
338
|
-
const t = window.history, { getUserConfirmation: e =
|
|
339
|
-
const u = K(), f =
|
|
343
|
+
const t = window.history, { getUserConfirmation: e = At, hashType: n = "slash" } = r, s = r.basename ? Dt(nt(r.basename)) : "", { encodePath: a } = ue[n], c = () => {
|
|
344
|
+
const u = K(), f = S(u);
|
|
340
345
|
return Z(f, at);
|
|
341
|
-
}, p = r.transitionManager ||
|
|
346
|
+
}, p = r.transitionManager || It(), h = (u) => {
|
|
342
347
|
Object.assign(O, u), O.length = t.length, p.notifyListeners(
|
|
343
348
|
O.location,
|
|
344
349
|
O.action,
|
|
@@ -346,7 +351,7 @@ const St = "hashchange", ue = {
|
|
|
346
351
|
);
|
|
347
352
|
};
|
|
348
353
|
let d = !1;
|
|
349
|
-
const
|
|
354
|
+
const S = (u) => {
|
|
350
355
|
const f = (l) => {
|
|
351
356
|
function y(g, H) {
|
|
352
357
|
const P = {};
|
|
@@ -386,8 +391,8 @@ const St = "hashchange", ue = {
|
|
|
386
391
|
}, D = K(), B = a(D);
|
|
387
392
|
D !== B && Lt(B);
|
|
388
393
|
let R = [];
|
|
389
|
-
const
|
|
390
|
-
|
|
394
|
+
const A = c();
|
|
395
|
+
A.pathname !== null && R.push(Y(A));
|
|
391
396
|
const j = (u = "") => {
|
|
392
397
|
const f = [
|
|
393
398
|
{ from: /\?+/gi, to: ";" },
|
|
@@ -437,7 +442,7 @@ const St = "hashchange", ue = {
|
|
|
437
442
|
h();
|
|
438
443
|
}
|
|
439
444
|
);
|
|
440
|
-
},
|
|
445
|
+
}, I = (u, f) => {
|
|
441
446
|
const o = "REPLACE", i = Z(u, at);
|
|
442
447
|
p.confirmTransitionTo(
|
|
443
448
|
i,
|
|
@@ -455,16 +460,16 @@ const St = "hashchange", ue = {
|
|
|
455
460
|
}, m = (u) => {
|
|
456
461
|
t.go(u);
|
|
457
462
|
}, x = () => m(-1), w = () => m(1);
|
|
458
|
-
let
|
|
463
|
+
let b = 0;
|
|
459
464
|
const E = (u) => {
|
|
460
|
-
|
|
465
|
+
b += u, b === 1 ? window.addEventListener(bt, v) : b === 0 && window.removeEventListener(bt, v);
|
|
461
466
|
};
|
|
462
467
|
let L = !1;
|
|
463
468
|
const O = {
|
|
464
469
|
createHref: X,
|
|
465
470
|
createLocation: Z,
|
|
466
471
|
push: G,
|
|
467
|
-
replace:
|
|
472
|
+
replace: I,
|
|
468
473
|
go: m,
|
|
469
474
|
goBack: x,
|
|
470
475
|
goForward: w,
|
|
@@ -488,7 +493,7 @@ const St = "hashchange", ue = {
|
|
|
488
493
|
},
|
|
489
494
|
length: t.length,
|
|
490
495
|
action: "POP",
|
|
491
|
-
location:
|
|
496
|
+
location: A
|
|
492
497
|
};
|
|
493
498
|
return O;
|
|
494
499
|
}, de = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -497,7 +502,7 @@ const St = "hashchange", ue = {
|
|
|
497
502
|
default: fe,
|
|
498
503
|
getHashPath: K
|
|
499
504
|
}, Symbol.toStringTag, { value: "Module" })), Ht = "routeData";
|
|
500
|
-
class
|
|
505
|
+
class He {
|
|
501
506
|
constructor(t, e) {
|
|
502
507
|
k(this, "settings");
|
|
503
508
|
k(this, "routes");
|
|
@@ -778,10 +783,10 @@ class Pe {
|
|
|
778
783
|
}
|
|
779
784
|
export {
|
|
780
785
|
z as HistoryMode,
|
|
781
|
-
|
|
786
|
+
He as RoutingService,
|
|
782
787
|
fe as createHashHistory,
|
|
783
|
-
|
|
784
|
-
|
|
788
|
+
ke as getScopedHashDOMLocation,
|
|
789
|
+
Re as getSpecificWidgetPath,
|
|
785
790
|
et as matchParams,
|
|
786
791
|
Kt as onWidgetUrl
|
|
787
792
|
};
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-6573c0b0.js");require("react/jsx-runtime");require("@emotion/styled");require("@emotion/react");require("react");require("react-transition-group");require("react-dom");require("react-router-dom");require("react-router");exports.Component=e.Component;exports.DataClient=e.DataClient;exports.DataType=e.DataType;exports.DetachedComponent=e.DetachedComponent;exports.FeedbackType=e.FeedbackType;exports.GridWidget=e.ExtendedWidget;exports.NotFound=e.NotFound;exports.ServiceClientQueryType=e.ServiceClientQueryType;exports.SortingType=e.SortingType;exports.determineServiceClientQueryType=e.determineServiceClientQueryType;exports.formatLegacyData=e.formatLegacyData;exports.genericComponentStyling=e.styling;
|
package/index.mjs
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as y, D as d, a as C, aA as c, F as D, aD as g, aC as S, S as T, b as l, d as f, f as u, aB as F } from "./index-4a7683d6.mjs";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
|
+
import "@emotion/styled";
|
|
4
|
+
import "@emotion/react";
|
|
3
5
|
import "react";
|
|
6
|
+
import "react-transition-group";
|
|
4
7
|
import "react-dom";
|
|
8
|
+
import "react-router-dom";
|
|
9
|
+
import "react-router";
|
|
5
10
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
y as Component,
|
|
12
|
+
d as DataClient,
|
|
13
|
+
C as DataType,
|
|
14
|
+
c as DetachedComponent,
|
|
15
|
+
D as FeedbackType,
|
|
16
|
+
g as GridWidget,
|
|
17
|
+
S as NotFound,
|
|
18
|
+
T as ServiceClientQueryType,
|
|
19
|
+
l as SortingType,
|
|
20
|
+
f as determineServiceClientQueryType,
|
|
21
|
+
u as formatLegacyData,
|
|
22
|
+
F as genericComponentStyling
|
|
18
23
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-types-grid",
|
|
3
|
-
"version": "1.1.1-rc.
|
|
3
|
+
"version": "1.1.1-rc.2",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@telia-ace/knowledge-widget-core": "^1.1.1-rc.
|
|
14
|
-
"@telia-ace/knowledge-data-client": "^1.1.1-rc.
|
|
15
|
-
"@telia-ace/widget-types-grid": "^1.1.1-rc.
|
|
16
|
-
"@telia-ace/knowledge-widget-adapters": "^1.1.1-rc.
|
|
13
|
+
"@telia-ace/knowledge-widget-core": "^1.1.1-rc.2",
|
|
14
|
+
"@telia-ace/knowledge-data-client": "^1.1.1-rc.2",
|
|
15
|
+
"@telia-ace/widget-types-grid": "^1.1.1-rc.2",
|
|
16
|
+
"@telia-ace/knowledge-widget-adapters": "^1.1.1-rc.2",
|
|
17
17
|
"@webprovisions/platform": "^1.1.4"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),h=require("react-dom"),v=require("@emotion/cache"),y=require("@emotion/react"),s=require("./index-6573c0b0.js"),c=require("react");require("react-transition-group");const R=require("react-router-dom");require("@emotion/styled");require("react-router");var l,i=h;if(process.env.NODE_ENV==="production")l=i.createRoot,i.hydrateRoot;else{var d=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;l=function(r,e){d.usingClientEntryPoint=!0;try{return i.createRoot(r,e)}finally{d.usingClientEntryPoint=!1}}}const E=r=>{const[e,t]=c.useState(null),o=s.useIsMounted();return c.useEffect(()=>{r.getAsync("router").then(u=>{o.current&&t(u)})},[r,o]),e};var f;const _=v({key:"css",prepend:!0,nonce:((f=window.webprovisionsEnvironmentVariables)==null?void 0:f.cspNonce)||void 0}),b=({container:r})=>{const e=s.useComponentPlatform(r),t=E(r),[o,u]=c.useState(null);return c.useEffect(()=>{if(e)return u(e.nodes.root.children.default[0].id||null),e.events.subscribe("components:root-children-changed",(C,{node:a})=>{if(a.parent&&a.parent.type==="root"){const p=a.parent.children.default[0].id;u(p)}})},[e]),!t||!t.history||!e||!o?null:n.jsx(y.CacheProvider,{value:_,children:n.jsx(R.Router,{history:t.history,children:n.jsx(s.ContainerContext.Provider,{value:r,children:n.jsx(s.RoutingContext.Provider,{value:t,children:n.jsx(s.Component,{id:o,branch:"default"})})})})})},q=b,m=(r,e)=>{l(e).render(n.jsx(q,{container:r}))};exports.default=m;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import f from "react-dom";
|
|
3
|
+
import h from "@emotion/cache";
|
|
4
|
+
import { CacheProvider as v } from "@emotion/react";
|
|
5
|
+
import { y, z as E, B as R, R as _, E as C } from "./index-4a7683d6.mjs";
|
|
6
|
+
import { useState as p, useEffect as d } from "react";
|
|
7
|
+
import "react-transition-group";
|
|
8
|
+
import { Router as b } from "react-router-dom";
|
|
9
|
+
import "@emotion/styled";
|
|
10
|
+
import "react-router";
|
|
11
|
+
var c, i = f;
|
|
12
|
+
if (process.env.NODE_ENV === "production")
|
|
13
|
+
c = i.createRoot, i.hydrateRoot;
|
|
14
|
+
else {
|
|
15
|
+
var a = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
16
|
+
c = function(e, r) {
|
|
17
|
+
a.usingClientEntryPoint = !0;
|
|
18
|
+
try {
|
|
19
|
+
return i.createRoot(e, r);
|
|
20
|
+
} finally {
|
|
21
|
+
a.usingClientEntryPoint = !1;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const P = (e) => {
|
|
26
|
+
const [r, t] = p(null), n = y();
|
|
27
|
+
return d(() => {
|
|
28
|
+
e.getAsync("router").then((s) => {
|
|
29
|
+
n.current && t(s);
|
|
30
|
+
});
|
|
31
|
+
}, [e, n]), r;
|
|
32
|
+
};
|
|
33
|
+
var l;
|
|
34
|
+
const N = h({
|
|
35
|
+
key: "css",
|
|
36
|
+
prepend: !0,
|
|
37
|
+
nonce: ((l = window.webprovisionsEnvironmentVariables) == null ? void 0 : l.cspNonce) || void 0
|
|
38
|
+
}), g = ({ container: e }) => {
|
|
39
|
+
const r = E(e), t = P(e), [n, s] = p(null);
|
|
40
|
+
return d(() => {
|
|
41
|
+
if (r)
|
|
42
|
+
return s(r.nodes.root.children.default[0].id || null), r.events.subscribe(
|
|
43
|
+
"components:root-children-changed",
|
|
44
|
+
(I, { node: u }) => {
|
|
45
|
+
if (u.parent && u.parent.type === "root") {
|
|
46
|
+
const m = u.parent.children.default[0].id;
|
|
47
|
+
s(m);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}, [r]), !t || !t.history || !r || !n ? null : /* @__PURE__ */ o(v, { value: N, children: /* @__PURE__ */ o(b, { history: t.history, children: /* @__PURE__ */ o(R.Provider, { value: e, children: /* @__PURE__ */ o(_.Provider, { value: t, children: /* @__PURE__ */ o(C, { id: n, branch: "default" }) }) }) }) });
|
|
52
|
+
}, O = g, U = (e, r) => {
|
|
53
|
+
c(r).render(/* @__PURE__ */ o(O, { container: e }));
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
U as default
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react-dom"),o=e=>t.unmountComponentAtNode(e);exports.default=o;
|
package/index-0d4037dc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-6e1f4d54.js");require("react/jsx-runtime");require("react");require("react-dom");exports.DataClient=e.DataClient;exports.DataType=e.DataType;exports.FeedbackType=e.FeedbackType;exports.ServiceClientQueryType=e.ServiceClientQueryType;exports.SortingType=e.SortingType;exports.determineServiceClientQueryType=e.determineServiceClientQueryType;exports.formatLegacyData=e.formatLegacyData;
|
package/index-48abc5fd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var mt=Object.defineProperty;var vt=(i,t,e)=>t in i?mt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var R=(i,t,e)=>(vt(i,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-6e1f4d54.js"),yt=require("./create-params-13c11e30.js");require("react/jsx-runtime");require("react");require("react-dom");var wt=function(i,t,e,n,s,a,h,p){if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error("invariant requires an error message argument");if(!i){var u;if(t===void 0)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[e,n,s,a,h,p],b=0;u=new Error(t.replace(/%s/g,function(){return l[b++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}},Pt=wt;const St=r.getDefaultExportFromCjs(Pt);var bt=function(t){return t.charAt(0)==="/"?t:"/"+t},ft=function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)},xt=function(t,e){return ft(t,e)?t.substr(e.length):t},Lt=function(t){return t.charAt(t.length-1)==="/"?t.slice(0,-1):t},Ht=function(t){var e=t||"/",n="",s="",a=e.indexOf("#");a!==-1&&(s=e.substr(a),e=e.substr(0,a));var h=e.indexOf("?");return h!==-1&&(n=e.substr(h),e=e.substr(0,h)),{pathname:e,search:n==="?"?"":n,hash:s==="#"?"":s}},lt=function(t){var e=t.pathname,n=t.search,s=t.hash,a=e||"/";return n&&n!=="?"&&(a+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(a+=s.charAt(0)==="#"?s:"#"+s),a},Ot=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},V=function(t,e,n,s){var a=void 0;typeof t=="string"?(a=Ht(t),a.state=e):(a=Ot({},t),a.pathname===void 0&&(a.pathname=""),a.search?a.search.charAt(0)!=="?"&&(a.search="?"+a.search):a.search="",a.hash?a.hash.charAt(0)!=="#"&&(a.hash="#"+a.hash):a.hash="",e!==void 0&&a.state===void 0&&(a.state=e));try{a.pathname=decodeURI(a.pathname)}catch(h){throw h instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):h}return n&&(a.key=n),s?a.pathname?a.pathname.charAt(0)!=="/"&&(a.pathname=r.resolvePathname(a.pathname,s.pathname)):a.pathname=s.pathname:a.pathname||(a.pathname="/"),a},gt=function(){var t=null,e=function(u){return r.warning(t==null,"A history supports only one prompt at a time"),t=u,function(){t===u&&(t=null)}},n=function(u,l,b,y){if(t!=null){var _=typeof t=="function"?t(u,l):t;typeof _=="string"?typeof b=="function"?b(_,y):(r.warning(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),y(!0)):y(_!==!1)}else y(!0)},s=[],a=function(u){var l=!0,b=function(){l&&u.apply(void 0,arguments)};return s.push(b),function(){l=!1,s=s.filter(function(y){return y!==b})}},h=function(){for(var u=arguments.length,l=Array(u),b=0;b<u;b++)l[b]=arguments[b];s.forEach(function(y){return y.apply(void 0,l)})};return{setPrompt:e,confirmTransitionTo:n,appendListener:a,notifyListeners:h}},Mt=!!(typeof window<"u"&&window.document&&window.document.createElement),tt=function(t,e,n){return t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)},et=function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)},Et=function(t,e){return e(window.confirm(t))},Rt=function(){var t=window.navigator.userAgent;return(t.indexOf("Android 2.")!==-1||t.indexOf("Android 4.0")!==-1)&&t.indexOf("Mobile Safari")!==-1&&t.indexOf("Chrome")===-1&&t.indexOf("Windows Phone")===-1?!1:window.history&&"pushState"in window.history},kt=function(){return window.navigator.userAgent.indexOf("Trident")===-1},Tt=function(t){return t.state===void 0&&navigator.userAgent.indexOf("CriOS")===-1},nt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},Ct=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},at="popstate",rt="hashchange",it=function(){try{return window.history.state||{}}catch{return{}}},_t=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};St(Mt,"Browser history needs a DOM");var e=window.history,n=Rt(),s=!kt(),a=t.forceRefresh,h=a===void 0?!1:a,p=t.getUserConfirmation,u=p===void 0?Et:p,l=t.keyLength,b=l===void 0?6:l,y=t.basename?Lt(bt(t.basename)):"",_=function(o){var g=o||{},w=g.key,m=g.state,O=window.location,S=O.pathname,T=O.search,B=O.hash,C=S+T+B;return r.warning(!y||ft(C,y),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+C+'" to begin with "'+y+'".'),y&&(C=xt(C,y)),V(C,m,w)},F=function(){return Math.random().toString(36).substr(2,b)},I=gt(),U=function(o){Ct(f,o),f.length=e.length,I.notifyListeners(f.location,f.action)},k=function(o){Tt(o)||j(_(o.state))},N=function(){j(_(it()))},W=!1,j=function(o){if(W)W=!1,U();else{var g="POP";I.confirmTransitionTo(o,g,u,function(w){w?U({action:g,location:o}):Y(o)})}},Y=function(o){var g=f.location,w=D.indexOf(g.key);w===-1&&(w=0);var m=D.indexOf(o.key);m===-1&&(m=0);var O=w-m;O&&(W=!0,x(O))},K=_(it()),D=[K.key],v=function(o){return y+lt(o)},L=function(o,g){r.warning(!((typeof o>"u"?"undefined":nt(o))==="object"&&o.state!==void 0&&g!==void 0),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var w="PUSH",m=V(o,g,F(),f.location);I.confirmTransitionTo(m,w,u,function(O){if(O){var S=v(m),T=m.key,B=m.state;if(n)if(e.pushState({key:T,state:B},null,S),h)window.location.href=S;else{var C=D.indexOf(f.location.key),G=D.slice(0,C===-1?0:C+1);G.push(m.key),D=G,U({action:w,location:m})}else r.warning(B===void 0,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=S}})},P=function(o,g){r.warning(!((typeof o>"u"?"undefined":nt(o))==="object"&&o.state!==void 0&&g!==void 0),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var w="REPLACE",m=V(o,g,F(),f.location);I.confirmTransitionTo(m,w,u,function(O){if(O){var S=v(m),T=m.key,B=m.state;if(n)if(e.replaceState({key:T,state:B},null,S),h)window.location.replace(S);else{var C=D.indexOf(f.location.key);C!==-1&&(D[C]=m.key),U({action:w,location:m})}else r.warning(B===void 0,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(S)}})},x=function(o){e.go(o)},E=function(){return x(-1)},H=function(){return x(1)},A=0,z=function(o){A+=o,A===1?(tt(window,at,k),s&&tt(window,rt,N)):A===0&&(et(window,at,k),s&&et(window,rt,N))},$=!1,M=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=I.setPrompt(o);return $||(z(1),$=!0),function(){return $&&($=!1,z(-1)),g()}},d=function(o){var g=I.appendListener(o);return z(1),function(){z(-1),g()}},f={length:e.length,action:"POP",location:K,createHref:v,push:L,replace:P,go:x,goBack:E,goForward:H,block:M,listen:d};return f},ot=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},It=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},st=function(t,e,n){return Math.min(Math.max(t,e),n)},Dt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.getUserConfirmation,n=t.initialEntries,s=n===void 0?["/"]:n,a=t.initialIndex,h=a===void 0?0:a,p=t.keyLength,u=p===void 0?6:p,l=gt(),b=function(P){It(v,P),v.length=v.entries.length,l.notifyListeners(v.location,v.action)},y=function(){return Math.random().toString(36).substr(2,u)},_=st(h,0,s.length-1),F=s.map(function(L){return typeof L=="string"?V(L,void 0,y()):V(L,void 0,L.key||y())}),I=lt,U=function(P,x){r.warning(!((typeof P>"u"?"undefined":ot(P))==="object"&&P.state!==void 0&&x!==void 0),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var E="PUSH",H=V(P,x,y(),v.location);l.confirmTransitionTo(H,E,e,function(A){if(A){var z=v.index,$=z+1,M=v.entries.slice(0);M.length>$?M.splice($,M.length-$,H):M.push(H),b({action:E,location:H,index:$,entries:M})}})},k=function(P,x){r.warning(!((typeof P>"u"?"undefined":ot(P))==="object"&&P.state!==void 0&&x!==void 0),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var E="REPLACE",H=V(P,x,y(),v.location);l.confirmTransitionTo(H,E,e,function(A){A&&(v.entries[v.index]=H,b({action:E,location:H}))})},N=function(P){var x=st(v.index+P,0,v.entries.length-1),E="POP",H=v.entries[x];l.confirmTransitionTo(H,E,e,function(A){A?b({action:E,location:H,index:x}):b()})},W=function(){return N(-1)},j=function(){return N(1)},Y=function(P){var x=v.index+P;return x>=0&&x<v.entries.length},K=function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return l.setPrompt(P)},D=function(P){return l.appendListener(P)},v={length:F.length,action:"POP",location:F[_],index:_,entries:F,createHref:I,push:U,replace:k,go:N,goBack:W,goForward:j,canGo:Y,block:K,listen:D};return v};const ct="hashchange",At={hashbang:{encodePath:i=>i.charAt(0)==="!"?i:"!/"+r.stripLeadingSlash_1(i),decodePath:i=>i.charAt(0)==="!"?i.substr(1):i},noslash:{encodePath:r.stripLeadingSlash_1,decodePath:r.addLeadingSlash_1},slash:{encodePath:r.addLeadingSlash_1,decodePath:r.addLeadingSlash_1}},q=()=>{const i=window.location.href,t=i.indexOf("#");return t===-1?"":i.substring(t+1)},ht=i=>window.location.hash=i,ut=i=>{const t=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,t>=0?t:0)+"#"+i)},Q=(i="")=>{const t=i.replace(";","?"),e=[{from:/\;+/gi,to:"&"},{from:/:+/gi,to:"="}];let n=t;return e.forEach(({to:s,from:a})=>{n=n.replace(a,s)}),n},pt=(i={})=>{const t=window.history,{getUserConfirmation:e=r.getConfirmation_1,hashType:n="slash"}=i,s=i.basename?r.stripTrailingSlash_1(r.addLeadingSlash_1(i.basename)):"",{encodePath:a}=At[n],h=()=>{const d=q(),f=b(d);return r.createLocation(f,Q)},p=i.transitionManager||r._default(),u=d=>{Object.assign(M,d),M.length=t.length,p.notifyListeners(M.location,M.action,i.widgetName)};let l=!1;const b=d=>{const f=g=>{function w(m,O){const S={};let T;for(;T=O.exec(m);)S[T[1]]=T[2];return S}return w(g,/([^#?&=]+)=([^&#]*)(?!.*?\#)/gi)||null},c="humany-"+i.widgetName;return f(d)[c]},y=()=>{const d=h(),f=M.location;!l&&r.locationsAreEqual_1(f,d)||_(d)},_=d=>{if(l)l=!1,u();else{const f="POP";p.confirmTransitionTo(d,f,e,c=>{c?u({action:f,location:d}):F(d)})}},F=d=>{const f=M.location;let c=k.lastIndexOf(r.createPath_1(f));c===-1&&(c=0);let o=k.lastIndexOf(r.createPath_1(d));o===-1&&(o=0);const g=c-o;g&&(l=!0,v(g))},I=q(),U=a(I);I!==U&&ut(U);let k=[];const N=h();N.pathname!==null&&k.push(r.createPath_1(N));const W=(d="")=>{const f=[{from:/\?+/gi,to:";"},{from:/\&+/gi,to:";"},{from:/\&+/gi,to:";"},{from:/=+/gi,to:":"}];let c=d;return f.forEach(({to:o,from:g})=>{c=c.replace(g,o)}),c},j=(d,f,c)=>{let o="",g=!1;return d.split("&").forEach(m=>{const O=m.split("="),S=O[0],T=O[1];if(S===f){if(g=!0,c===null)return;o.length>0&&(o+="&"),typeof c<"u"?o+=S+"="+c:o+=S}else S&&(o.length>0&&(o+="&"),o+=S+"="+T)}),!g&&c!==null&&(o.length>0&&(o+="&"),typeof c<"u"?o+=f+"="+c:o+=f),o},Y=d=>{const f=d.pathname,c=W(d.search),o=f+(c?`;${c}`:""),w=`humany-${i.widgetName}`,m=q();return`#${j(m,w,o).replace(";;",";")}`},K=(d,f)=>{const c="PUSH",o=r.createLocation(d,Q),g=o.pathname,w=W(o.search),m=g+(w?`${w}`:""),S=`humany-${i.widgetName}`,T=q(),B=j(T,S,m);p.confirmTransitionTo(o,c,e,C=>{if(!C)return;const G=r.createPath_1(o),J=a(B);if(q()!==J){ht(J);const X=k.lastIndexOf(r.createPath_1(M.location)),Z=k.slice(0,X===-1?0:X+1);Z.push(G),k=Z,u({action:c,location:o})}else u()})},D=(d,f)=>{const c="REPLACE",o=r.createLocation(d,Q);p.confirmTransitionTo(o,c,e,g=>{if(!g)return;const w=r.createPath_1(o),m=a(s+w);q()!==m&&ut(m);const S=k.indexOf(r.createPath_1(M.location));S!==-1&&(k[S]=w),u({action:c,location:o})})},v=d=>{t.go(d)},L=()=>v(-1),P=()=>v(1);let x=0;const E=d=>{x+=d,x===1?window.addEventListener(ct,y):x===0&&window.removeEventListener(ct,y)};let H=!1;const A=(d=!1)=>{const f=p.setPrompt(d);return H||(E(1),H=!0),()=>(H&&(H=!1,E(-1)),f())},z=d=>{const f=p.appendListener(d);return E(1),()=>{E(-1),f()}},$=()=>{const d=q(),f=j(d,`humany-${i.widgetName}`,null),c=a(f);ht(c)},M={createHref:Y,createLocation:r.createLocation,push:K,replace:D,go:v,goBack:L,goForward:P,block:A,listen:z,stop:$,length:t.length,action:"POP",location:N};return M},$t=Object.freeze(Object.defineProperty({__proto__:null,decodeSearch:Q,default:pt,getHashPath:q},Symbol.toStringTag,{value:"Module"})),dt="routeData";class Nt{constructor(t,e){R(this,"settings");R(this,"routes");R(this,"steps",[]);R(this,"location");R(this,"history");R(this,"widget");R(this,"match");R(this,"currentRoute");R(this,"historyListenSubscription",()=>{});R(this,"initialized");R(this,"sticky",!1);R(this,"storageWriter",null);R(this,"storageMedium");this.container=t,this.widget=t.get("$widget");const{routes:n,...s}=e;this.settings={...s,...t.get("routingSettings")},this.sticky=r.determineIfSticky(this.settings),this.storageMedium=this.sticky?r.StorageMedium.Local:r.StorageMedium.Session,r.createStorageWriter(t,dt,r.StorageCategory.Necessary,{medium:this.storageMedium}).then(a=>this.storageWriter=a),this.routes=n}initialize(){return this.initialized=this.initialized||this.createHistory().then(t=>{this.history=t,this.location=t.location,this.historyListenSubscription=t.listen((e,n,s)=>this.handleLocationChange(e,s))})}setMatch(t){if(this.match=t,this.location){const e=this.getRouteData(),n={routeData:e,location:this.location},s=this.steps[0],a=e.name===(s==null?void 0:s.routeData.name),h=r.shallowCompare(e.params,(s==null?void 0:s.routeData.params)||{});(!a||!h)&&(this.widget.events.dispatch("router:change",{next:n,previous:s}),this.steps.unshift(n),this.storageWriter&&this.storageWriter(n.routeData),this.widget.events.dispatch("router:changed",{previous:s,current:n}))}}onRouteChange(t){return this.widget.events.subscribe("router:change",t)}isSticky(){return this.sticky}generate(t,e={}){const n=r.findRoute(t,this.routes);if(!n||!this.history)throw`No route found for ${t}`;const s=r.createParamsPath(e,n.path);if(!s)throw`Unable to generate path for "${t}".`;const a=r.createLocation(s,this.settings.decodeSearch);let h=this.history.createHref(a);const{mode:p,basePath:u}=this.settings;return p==="browser"&&u&&(h=h.replace(u,"")),h.charAt(0)!=="/"&&(h=`/${h}`),h}navigate(t,e={}){const n=r.findRoute(t,this.routes);if(!n||!this.history)return;const s=r.createParamsPath(e,n.path);if(!s)return;const a=this.getRouteData(),h=a&&a.name===t&&r.compareParams(a.params,e);if(this.steps[0]&&h)return;const{decodeSearch:u}=this.settings,l=u?u(s):s;this.widget.events.dispatch("router:navigate",{decodedPath:l}),l.charAt(0)!=="/"?this.history.push(`/${l}`):this.history.push(l)}hasBack(){if(this.steps.length>1)return!0;const t=this.getRouteData(this.settings.initialPath),e=this.getRouteData(),n=e.name===t.name,s=r.shallowCompare(e.params,t.params);return!n||!s}goBack(t=1){if(this.steps.length<2){const e=this.getRouteData(this.settings.initialPath);e&&e.name&&(this.navigate(e.name,e.params),this.steps=[])}else{const e=t>=this.steps.length?this.steps.length-1:t,{routeData:n}=this.steps[e];this.steps=[...this.steps.slice(e+1)],this.navigate(n.name,yt.createParams(n.params))}}goForward(){this.history&&this.history.goForward()}current(){return this.location}getInitialRoute(){const{name:t}=this.getRouteData(this.settings.initialPath),e=this.routes.find(n=>n.name===t);return e||(this.routes.length>0?this.routes[0]:(process.env.NODE_ENV!=="production"&&r.Logger.warn("Unable to get initial route as no routes are defined."),null))}getRouteData(t){const e=r.getNotFoundRoute(this.container);if(t){const n=r.matchRoute(t,this.routes);return n?{params:r.removeNullAndUndefinedValues(r.matchParams(t,n.path)),name:n.name}:e||{name:"",params:{}}}if(this.location){const{pathname:n,search:s}=this.location;if(this.currentRoute=this.currentRoute||r.matchRoute(n,this.routes),this.currentRoute){const{path:a,name:h}=this.currentRoute;this.match||(this.match={params:r.matchParams(n,a),isExact:!0,path:a,url:n});const p=r.removeNullAndUndefinedValues({...this.match.params,...s.length>0&&r.queryStringAsObject(s)});return{name:h,params:p}}}return e||{name:"",params:{}}}dispose(){return this.historyListenSubscription(),this.stop()}setupInitialRoute(){return r.readStorage(this.container,dt,this.storageMedium).then(t=>{if(!this.location||!this.history)return;const{initialPath:e,mode:n}=this.settings;switch((()=>{const a=r.onWidgetUrl(this.container);return n===r.HistoryMode.browser||a?r.InitializationMode.path:n===r.HistoryMode.memory&&t?r.InitializationMode.storage:r.InitializationMode.initialPath})()){case r.InitializationMode.initialPath:{const a=this.getRouteData(e);return a&&a.name?this.navigate(a.name,a.params):void 0}case r.InitializationMode.path:{const{pathname:a}=this.location;if(this.currentRoute=r.matchRoute(a,this.routes),this.currentRoute){const{path:p}=this.currentRoute;return this.setMatch({params:r.matchParams(a,p),isExact:!0,path:p,url:a})}const h=r.getNotFoundRoute(this.container);return h?this.setMatch({params:{},isExact:!0,path:h.name,url:a}):void 0}case r.InitializationMode.storage:{const{pathname:a}=this.location;this.currentRoute=r.matchRoute(a,this.routes);const{name:h="",params:p={}}=t||{},u=r.findRoute(h,this.routes);if(u){const l=r.createParamsPath(p,u.path);if(l)return this.history.push(l),this.location={...this.location,pathname:l},this.currentRoute=r.matchRoute(l,this.routes),this.setMatch({params:p,isExact:!0,path:u.path,url:l})}return}}})}start(){return this.setupInitialRoute()}stop(){return this.history&&(this.settings.mode===r.HistoryMode.scopedHash&&this.history.stop(),this.steps=[],this.storageWriter)?this.storageWriter():Promise.resolve()}handleLocationChange(t,e){const{pathname:n}=t,{mode:s}=this.settings;if(n.indexOf("?")>-1||n.indexOf(";")>-1||s===r.HistoryMode.scopedHash&&e!==this.widget.name)return;this.location=t,this.currentRoute=r.matchRoute(n,this.routes);const a=r.getNotFoundRoute(this.container);if(this.currentRoute){const{path:h}=this.currentRoute;this.setMatch({params:r.matchParams(n,h),isExact:!0,path:h,url:n})}else a&&this.setMatch({params:{},isExact:!0,path:a.name,url:n})}createHistory(){return new Promise(t=>{const{mode:e,basePath:n}=this.settings;if(e===r.HistoryMode.scopedHash){const s=this.widget.name,a=r.getTransitionManager(this.container);return Promise.resolve().then(()=>$t).then(h=>{const p=h.default({widgetName:s,transitionManager:a,hashType:"noslash"});return t(p)})}if(e===r.HistoryMode.memory)return t(Dt());if(e===r.HistoryMode.browser)return t(_t({basename:n}));throw"RoutingService: History could not be created."})}}exports.HistoryMode=r.HistoryMode;exports.getScopedHashDOMLocation=r.getScopedHashDOMLocation;exports.getSpecificWidgetPath=r.getSpecificWidgetPath;exports.matchParams=r.matchParams;exports.onWidgetUrl=r.onWidgetUrl;exports.RoutingService=Nt;exports.createHashHistory=pt;
|