@startinblox/components-ds4go 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +106 -100
- package/package.json +1 -1
- package/src/components/solid-fact-bundle-creation.ts +59 -50
package/dist/index.js
CHANGED
|
@@ -249,7 +249,7 @@ let R = class extends HTMLElement {
|
|
|
249
249
|
R.elementStyles = [], R.shadowRootOptions = { mode: "open" }, R[L("elementProperties")] = /* @__PURE__ */ new Map(), R[L("finalized")] = /* @__PURE__ */ new Map(), ct?.({ ReactiveElement: R }), (te.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
250
|
const ye = globalThis, Ce = (t) => t, Z = ye.trustedTypes, Ee = Z ? Z.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, qe = "$lit$", w = `lit$${Math.random().toFixed(9).slice(2)}$`, ze = "?" + w, dt = `<${ze}>`, P = document, F = () => P.createComment(""), B = (t) => t === null || typeof t != "object" && typeof t != "function", ve = Array.isArray, ht = (t) => ve(t) || typeof t?.[Symbol.iterator] == "function", oe = `[
|
|
251
251
|
\f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Pe = /-->/g, je = />/g, S = RegExp(`>|${oe}(?:([^\\s"'>=/]+)(${oe}*=${oe}*(?:[^
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Re = /'/g, Oe = /"/g, Ie = /^(?:script|style|textarea|title)$/i, ut = (t) => (e, ...s) => ({ _$litType$: t, strings: e, values: s }), p = ut(1),
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Re = /'/g, Oe = /"/g, Ie = /^(?:script|style|textarea|title)$/i, ut = (t) => (e, ...s) => ({ _$litType$: t, strings: e, values: s }), p = ut(1), k = /* @__PURE__ */ Symbol.for("lit-noChange"), c = /* @__PURE__ */ Symbol.for("lit-nothing"), Te = /* @__PURE__ */ new WeakMap(), E = P.createTreeWalker(P, 129);
|
|
253
253
|
function Ve(t, e) {
|
|
254
254
|
if (!ve(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
255
|
return Ee !== void 0 ? Ee.createHTML(e) : e;
|
|
@@ -259,8 +259,8 @@ const ft = (t, e) => {
|
|
|
259
259
|
let i, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = M;
|
|
260
260
|
for (let a = 0; a < s; a++) {
|
|
261
261
|
const l = t[a];
|
|
262
|
-
let d,
|
|
263
|
-
for (; $ < l.length && (n.lastIndex = $,
|
|
262
|
+
let d, f, h = -1, $ = 0;
|
|
263
|
+
for (; $ < l.length && (n.lastIndex = $, f = n.exec(l), f !== null); ) $ = n.lastIndex, n === M ? f[1] === "!--" ? n = Pe : f[1] !== void 0 ? n = je : f[2] !== void 0 ? (Ie.test(f[2]) && (i = RegExp("</" + f[2], "g")), n = S) : f[3] !== void 0 && (n = S) : n === S ? f[0] === ">" ? (n = i ?? M, h = -1) : f[1] === void 0 ? h = -2 : (h = n.lastIndex - f[2].length, d = f[1], n = f[3] === void 0 ? S : f[3] === '"' ? Oe : Re) : n === Oe || n === Re ? n = S : n === Pe || n === je ? n = M : (n = S, i = void 0);
|
|
264
264
|
const _ = n === S && t[a + 1].startsWith("/>") ? " " : "";
|
|
265
265
|
o += n === M ? l + dt : h >= 0 ? (r.push(d), l.slice(0, h) + qe + l.slice(h) + w + _) : l + w + (h === -2 ? a : _);
|
|
266
266
|
}
|
|
@@ -271,7 +271,7 @@ class H {
|
|
|
271
271
|
let i;
|
|
272
272
|
this.parts = [];
|
|
273
273
|
let o = 0, n = 0;
|
|
274
|
-
const a = e.length - 1, l = this.parts, [d,
|
|
274
|
+
const a = e.length - 1, l = this.parts, [d, f] = ft(e, s);
|
|
275
275
|
if (this.el = H.createElement(d, r), E.currentNode = this.el.content, s === 2 || s === 3) {
|
|
276
276
|
const h = this.el.content.firstChild;
|
|
277
277
|
h.replaceWith(...h.childNodes);
|
|
@@ -279,7 +279,7 @@ class H {
|
|
|
279
279
|
for (; (i = E.nextNode()) !== null && l.length < a; ) {
|
|
280
280
|
if (i.nodeType === 1) {
|
|
281
281
|
if (i.hasAttributes()) for (const h of i.getAttributeNames()) if (h.endsWith(qe)) {
|
|
282
|
-
const $ =
|
|
282
|
+
const $ = f[n++], _ = i.getAttribute(h).split(w), V = /([.?@])?(.*)/.exec($);
|
|
283
283
|
l.push({ type: 1, index: o, name: V[2], strings: _, ctor: V[1] === "." ? mt : V[1] === "?" ? gt : V[1] === "@" ? yt : ie }), i.removeAttribute(h);
|
|
284
284
|
} else h.startsWith(w) && (l.push({ type: 6, index: o }), i.removeAttribute(h));
|
|
285
285
|
if (Ie.test(i.tagName)) {
|
|
@@ -304,7 +304,7 @@ class H {
|
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
function D(t, e, s = t, r) {
|
|
307
|
-
if (e ===
|
|
307
|
+
if (e === k) return e;
|
|
308
308
|
let i = r !== void 0 ? s._$Co?.[r] : s._$Cl;
|
|
309
309
|
const o = B(e) ? void 0 : e._$litDirective$;
|
|
310
310
|
return i?.constructor !== o && (i?._$AO?.(!1), o === void 0 ? i = void 0 : (i = new o(t), i._$AT(t, s, r)), r !== void 0 ? (s._$Co ??= [])[r] = i : s._$Cl = i), i !== void 0 && (e = D(t, i._$AS(t, e.values), i, r)), e;
|
|
@@ -356,7 +356,7 @@ class z {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(e, s = this) {
|
|
359
|
-
e = D(this, e, s), B(e) ? e === c || e == null || e === "" ? (this._$AH !== c && this._$AR(), this._$AH = c) : e !== this._$AH && e !==
|
|
359
|
+
e = D(this, e, s), B(e) ? e === c || e == null || e === "" ? (this._$AH !== c && this._$AR(), this._$AH = c) : e !== this._$AH && e !== k && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : ht(e) ? this.k(e) : this._(e);
|
|
360
360
|
}
|
|
361
361
|
O(e) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -376,8 +376,8 @@ class z {
|
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
_$AC(e) {
|
|
379
|
-
let s =
|
|
380
|
-
return s === void 0 &&
|
|
379
|
+
let s = Te.get(e.strings);
|
|
380
|
+
return s === void 0 && Te.set(e.strings, s = new H(e)), s;
|
|
381
381
|
}
|
|
382
382
|
k(e) {
|
|
383
383
|
ve(this._$AH) || (this._$AH = [], this._$AR());
|
|
@@ -409,11 +409,11 @@ class ie {
|
|
|
409
409
|
_$AI(e, s = this, r, i) {
|
|
410
410
|
const o = this.strings;
|
|
411
411
|
let n = !1;
|
|
412
|
-
if (o === void 0) e = D(this, e, s, 0), n = !B(e) || e !== this._$AH && e !==
|
|
412
|
+
if (o === void 0) e = D(this, e, s, 0), n = !B(e) || e !== this._$AH && e !== k, n && (this._$AH = e);
|
|
413
413
|
else {
|
|
414
414
|
const a = e;
|
|
415
415
|
let l, d;
|
|
416
|
-
for (e = o[0], l = 0; l < o.length - 1; l++) d = D(this, a[r + l], s, l), d ===
|
|
416
|
+
for (e = o[0], l = 0; l < o.length - 1; l++) d = D(this, a[r + l], s, l), d === k && (d = this._$AH[l]), n ||= !B(d) || d !== this._$AH[l], d === c ? e = c : e !== c && (e += (d ?? "") + o[l + 1]), this._$AH[l] = d;
|
|
417
417
|
}
|
|
418
418
|
n && !i && this.j(e);
|
|
419
419
|
}
|
|
@@ -442,7 +442,7 @@ class yt extends ie {
|
|
|
442
442
|
super(e, s, r, i, o), this.type = 5;
|
|
443
443
|
}
|
|
444
444
|
_$AI(e, s = this) {
|
|
445
|
-
if ((e = D(this, e, s, 0) ?? c) ===
|
|
445
|
+
if ((e = D(this, e, s, 0) ?? c) === k) return;
|
|
446
446
|
const r = this._$AH, i = e === c && r !== c || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, o = e !== c && (r === c || i);
|
|
447
447
|
i && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
448
448
|
}
|
|
@@ -473,7 +473,7 @@ const bt = (t, e, s) => {
|
|
|
473
473
|
return i._$AI(t), i;
|
|
474
474
|
};
|
|
475
475
|
const $e = globalThis;
|
|
476
|
-
let
|
|
476
|
+
let T = class extends R {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
479
479
|
}
|
|
@@ -492,14 +492,14 @@ let k = class extends R {
|
|
|
492
492
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
493
493
|
}
|
|
494
494
|
render() {
|
|
495
|
-
return
|
|
495
|
+
return k;
|
|
496
496
|
}
|
|
497
497
|
};
|
|
498
|
-
|
|
498
|
+
T._$litElement$ = !0, T.finalized = !0, $e.litElementHydrateSupport?.({ LitElement: T });
|
|
499
499
|
const _t = $e.litElementPolyfillSupport;
|
|
500
|
-
_t?.({ LitElement:
|
|
500
|
+
_t?.({ LitElement: T });
|
|
501
501
|
($e.litElementVersions ??= []).push("4.2.2");
|
|
502
|
-
class wt extends
|
|
502
|
+
class wt extends T {
|
|
503
503
|
constructor() {
|
|
504
504
|
super(...arguments), this.object = {
|
|
505
505
|
"@id": ""
|
|
@@ -549,7 +549,7 @@ var St = Object.defineProperty, Ct = (t, e, s, r) => {
|
|
|
549
549
|
(n = t[o]) && (i = n(e, s, i) || i);
|
|
550
550
|
return i && St(e, s, i), i;
|
|
551
551
|
};
|
|
552
|
-
class be extends
|
|
552
|
+
class be extends T {
|
|
553
553
|
constructor() {
|
|
554
554
|
super(...arguments), this.objects = [], this.hasType = (e, s = this.objects) => new Set(s.flatMap((i) => i["@type"])).has(e);
|
|
555
555
|
}
|
|
@@ -738,7 +738,7 @@ const jt = ({
|
|
|
738
738
|
document.removeEventListener(r[0], r[1]);
|
|
739
739
|
}, t._subscribe();
|
|
740
740
|
};
|
|
741
|
-
function
|
|
741
|
+
function ke(t) {
|
|
742
742
|
return !Number.isNaN(new Date(t).getTime());
|
|
743
743
|
}
|
|
744
744
|
const le = (t, e, s) => {
|
|
@@ -751,14 +751,14 @@ const le = (t, e, s) => {
|
|
|
751
751
|
i = i[o];
|
|
752
752
|
else
|
|
753
753
|
return !1;
|
|
754
|
-
if (
|
|
754
|
+
if (ke(i)) {
|
|
755
755
|
if (new Date(i) > s)
|
|
756
756
|
return !0;
|
|
757
757
|
} else
|
|
758
758
|
return !1;
|
|
759
759
|
return Array.isArray(t) ? t.some(
|
|
760
760
|
(o) => le(o, e, s)
|
|
761
|
-
) : typeof t == "object" ? Object.entries(t).some(([o, n]) => o === e &&
|
|
761
|
+
) : typeof t == "object" ? Object.entries(t).some(([o, n]) => o === e && ke(n) ? !1 : le(n, e, s)) : !1;
|
|
762
762
|
}, Rt = (t, e, s) => {
|
|
763
763
|
if (!e || !s || typeof s != "string")
|
|
764
764
|
return t;
|
|
@@ -779,7 +779,7 @@ const le = (t, e, s) => {
|
|
|
779
779
|
(a) => typeof a == "object" && a !== null && "@id" in a && a["@id"] === s
|
|
780
780
|
) : !1 : !1;
|
|
781
781
|
});
|
|
782
|
-
function
|
|
782
|
+
function Tt(t) {
|
|
783
783
|
return typeof t != "string" && typeof t != "number" && !(t instanceof Date) ? !1 : !Number.isNaN(new Date(t).getTime());
|
|
784
784
|
}
|
|
785
785
|
const ce = (t, e, s, r) => {
|
|
@@ -795,7 +795,7 @@ const ce = (t, e, s, r) => {
|
|
|
795
795
|
if (typeof o == "number") {
|
|
796
796
|
if (typeof s == "number" && typeof r == "number" && s <= o && o <= r)
|
|
797
797
|
return !0;
|
|
798
|
-
} else if (
|
|
798
|
+
} else if (Tt(o)) {
|
|
799
799
|
const n = new Date(o);
|
|
800
800
|
if (s instanceof Date && r instanceof Date && s <= n && n <= r)
|
|
801
801
|
return !0;
|
|
@@ -806,7 +806,7 @@ const ce = (t, e, s, r) => {
|
|
|
806
806
|
) : typeof t == "object" ? Object.entries(t).some(
|
|
807
807
|
([n, a]) => ce(a, e, s, r)
|
|
808
808
|
) : !1;
|
|
809
|
-
},
|
|
809
|
+
}, kt = (t, e, s) => {
|
|
810
810
|
if (!e || !s || typeof s != "string")
|
|
811
811
|
return t;
|
|
812
812
|
const [r, i] = s.split("/").map(Number);
|
|
@@ -852,9 +852,9 @@ const ce = (t, e, s, r) => {
|
|
|
852
852
|
const r = s.toLowerCase(), o = t.map((n) => {
|
|
853
853
|
let a = n;
|
|
854
854
|
const l = e.split(".");
|
|
855
|
-
for (const
|
|
856
|
-
if (a && typeof a == "object" &&
|
|
857
|
-
a = a[
|
|
855
|
+
for (const f of l)
|
|
856
|
+
if (a && typeof a == "object" && f in a)
|
|
857
|
+
a = a[f];
|
|
858
858
|
else {
|
|
859
859
|
a = null;
|
|
860
860
|
break;
|
|
@@ -906,7 +906,7 @@ const ce = (t, e, s, r) => {
|
|
|
906
906
|
for (let r = 0; r < e.length && (s && e[r] in s); r++)
|
|
907
907
|
s = s[e[r]];
|
|
908
908
|
return s;
|
|
909
|
-
},
|
|
909
|
+
}, N = (t, e, s = "asc") => t.sort((r, i) => {
|
|
910
910
|
let o = r, n = i;
|
|
911
911
|
Array.isArray(e) ? (o = De(r, e), n = De(i, e)) : (o = r[e], n = i[e]);
|
|
912
912
|
let a = 0;
|
|
@@ -919,7 +919,7 @@ const ce = (t, e, s, r) => {
|
|
|
919
919
|
else
|
|
920
920
|
throw new TypeError(`Unsupported data type for key "${e}"`);
|
|
921
921
|
return s === "asc" ? a : -a;
|
|
922
|
-
}),
|
|
922
|
+
}), U = (t, e = {
|
|
923
923
|
day: "2-digit",
|
|
924
924
|
month: "2-digit",
|
|
925
925
|
year: "2-digit"
|
|
@@ -936,10 +936,10 @@ const ce = (t, e, s, r) => {
|
|
|
936
936
|
}
|
|
937
937
|
})
|
|
938
938
|
);
|
|
939
|
-
}, Lt = "https://cdn.startinblox.com/owl/ds4go.jsonld#",
|
|
939
|
+
}, Lt = "https://cdn.startinblox.com/owl/ds4go.jsonld#", Nt = { "@id": "ds4go:link", "@type": "@id" }, Ut = { "@id": "ds4go:enclosure", "@type": "@id" }, Ft = { "@id": "ds4go:url", "@type": "@id" }, Me = {
|
|
940
940
|
ds4go: Lt,
|
|
941
|
-
link:
|
|
942
|
-
enclosure:
|
|
941
|
+
link: Nt,
|
|
942
|
+
enclosure: Ut,
|
|
943
943
|
url: Ft
|
|
944
944
|
};
|
|
945
945
|
const ue = "lit-localize-status";
|
|
@@ -954,11 +954,11 @@ const Bt = (t, ...e) => ({
|
|
|
954
954
|
return r;
|
|
955
955
|
};
|
|
956
956
|
const Ge = ((t) => Ht(t) ? Ke(t.strings, t.values) : t);
|
|
957
|
-
let
|
|
957
|
+
let u = Ge, Le = !1;
|
|
958
958
|
function qt(t) {
|
|
959
959
|
if (Le)
|
|
960
960
|
throw new Error("lit-localize can only be configured once");
|
|
961
|
-
|
|
961
|
+
u = t, Le = !0;
|
|
962
962
|
}
|
|
963
963
|
class zt {
|
|
964
964
|
constructor(e) {
|
|
@@ -1001,7 +1001,7 @@ const Gt = "", Zt = "h", Jt = "s";
|
|
|
1001
1001
|
function Xt(t, e) {
|
|
1002
1002
|
return (e ? Zt : Jt) + Kt(typeof t == "string" ? t : t.join(Gt));
|
|
1003
1003
|
}
|
|
1004
|
-
const
|
|
1004
|
+
const Ne = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new Map();
|
|
1005
1005
|
function Qt(t, e, s) {
|
|
1006
1006
|
if (t) {
|
|
1007
1007
|
const r = s?.id ?? Yt(e), i = t[r];
|
|
@@ -1017,8 +1017,8 @@ function Qt(t, e, s) {
|
|
|
1017
1017
|
i.values
|
|
1018
1018
|
);
|
|
1019
1019
|
{
|
|
1020
|
-
let o =
|
|
1021
|
-
return o === void 0 && (o = i.values,
|
|
1020
|
+
let o = Ne.get(i);
|
|
1021
|
+
return o === void 0 && (o = i.values, Ne.set(i, o)), {
|
|
1022
1022
|
...i,
|
|
1023
1023
|
values: o.map((n) => e.values[n])
|
|
1024
1024
|
};
|
|
@@ -1029,8 +1029,8 @@ function Qt(t, e, s) {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
function Yt(t) {
|
|
1031
1031
|
const e = typeof t == "string" ? t : t.strings;
|
|
1032
|
-
let s =
|
|
1033
|
-
return s === void 0 && (s = Xt(e, typeof t != "string" && !("strTag" in t)),
|
|
1032
|
+
let s = Ue.get(e);
|
|
1033
|
+
return s === void 0 && (s = Xt(e, typeof t != "string" && !("strTag" in t)), Ue.set(e, s)), s;
|
|
1034
1034
|
}
|
|
1035
1035
|
function ne(t) {
|
|
1036
1036
|
window.dispatchEvent(new CustomEvent(ue, { detail: t }));
|
|
@@ -1088,7 +1088,7 @@ let q = class extends be {
|
|
|
1088
1088
|
switch (n.type) {
|
|
1089
1089
|
case "interval":
|
|
1090
1090
|
o.push(
|
|
1091
|
-
|
|
1091
|
+
kt(
|
|
1092
1092
|
r,
|
|
1093
1093
|
n.name,
|
|
1094
1094
|
n.value
|
|
@@ -1151,7 +1151,7 @@ let q = class extends be {
|
|
|
1151
1151
|
${this._displayObjects.map((t) => {
|
|
1152
1152
|
const e = [
|
|
1153
1153
|
{
|
|
1154
|
-
name: `${t.facts.length} ${t.facts.length > 1 ?
|
|
1154
|
+
name: `${t.facts.length} ${t.facts.length > 1 ? u("facts") : u("fact")}`,
|
|
1155
1155
|
type: "information"
|
|
1156
1156
|
}
|
|
1157
1157
|
];
|
|
@@ -1227,7 +1227,7 @@ let Y = class extends wt {
|
|
|
1227
1227
|
><div>${String(this.object.description)}</div></tems-division
|
|
1228
1228
|
>
|
|
1229
1229
|
<tems-division type="h4"
|
|
1230
|
-
><div>${
|
|
1230
|
+
><div>${u("All facts in this bundle")}</div></tems-division
|
|
1231
1231
|
>
|
|
1232
1232
|
<div class="card-grid card-grid-vertical">
|
|
1233
1233
|
${this.object.facts.map((t) => {
|
|
@@ -1238,7 +1238,7 @@ let Y = class extends wt {
|
|
|
1238
1238
|
if (e.length > 3) {
|
|
1239
1239
|
const s = e.length - 3;
|
|
1240
1240
|
e.splice(3, s), e.push({
|
|
1241
|
-
name: `+${s} ${
|
|
1241
|
+
name: `+${s} ${u("more")}`,
|
|
1242
1242
|
type: "information"
|
|
1243
1243
|
});
|
|
1244
1244
|
}
|
|
@@ -1254,10 +1254,10 @@ let Y = class extends wt {
|
|
|
1254
1254
|
<tems-division type="body-sm"
|
|
1255
1255
|
><div>
|
|
1256
1256
|
<div>
|
|
1257
|
-
${
|
|
1257
|
+
${u("Bundle created on")} ${String(this.object.created_at)}
|
|
1258
1258
|
</div>
|
|
1259
1259
|
<div>
|
|
1260
|
-
${
|
|
1260
|
+
${u("Bundle updated on")} ${String(this.object.updated_at)}
|
|
1261
1261
|
</div>
|
|
1262
1262
|
</div></tems-division
|
|
1263
1263
|
>
|
|
@@ -1373,8 +1373,8 @@ var hs = Object.defineProperty, us = Object.getOwnPropertyDescriptor, A = (t, e,
|
|
|
1373
1373
|
let y = class extends v {
|
|
1374
1374
|
constructor() {
|
|
1375
1375
|
super(...arguments), this.header = "DS4GO Fact Bundling Creation", this.selectedFacts = [], this.bundleName = "", this.bundleDescription = "", this.filterFactText = "", this.spliceLength = 0, this.cherryPickedProperties = [
|
|
1376
|
-
{ key: "created_at", value: "created_at", cast:
|
|
1377
|
-
{ key: "updated_at", value: "updated_at", cast:
|
|
1376
|
+
{ key: "created_at", value: "created_at", cast: U },
|
|
1377
|
+
{ key: "updated_at", value: "updated_at", cast: U },
|
|
1378
1378
|
{ key: "name", value: "name" },
|
|
1379
1379
|
{ key: "description", value: "description" },
|
|
1380
1380
|
{ key: "author", value: "author" },
|
|
@@ -1382,7 +1382,7 @@ let y = class extends v {
|
|
|
1382
1382
|
key: "categories",
|
|
1383
1383
|
value: "categories",
|
|
1384
1384
|
expand: !0,
|
|
1385
|
-
cast: (e) =>
|
|
1385
|
+
cast: (e) => N(e, "name")
|
|
1386
1386
|
}
|
|
1387
1387
|
], this._getResource = new Ye(this, {
|
|
1388
1388
|
task: async ([e, s, r]) => {
|
|
@@ -1391,7 +1391,7 @@ let y = class extends v {
|
|
|
1391
1391
|
if (!e) return;
|
|
1392
1392
|
this.facts = await this._getProxyValue(e), this.hasCachedDatas = !0;
|
|
1393
1393
|
}
|
|
1394
|
-
return this.oldDataSrc !== e && (this.oldDataSrc = e), Array.isArray(this.facts) || (this.facts = []), s ?
|
|
1394
|
+
return this.oldDataSrc !== e && (this.oldDataSrc = e), Array.isArray(this.facts) || (this.facts = []), s ? N(
|
|
1395
1395
|
We(
|
|
1396
1396
|
this.facts.filter(
|
|
1397
1397
|
(i) => !r.includes(i)
|
|
@@ -1400,7 +1400,7 @@ let y = class extends v {
|
|
|
1400
1400
|
),
|
|
1401
1401
|
"name",
|
|
1402
1402
|
"asc"
|
|
1403
|
-
) : (r.length === 0 && (this.spliceLength = Math.floor((window.innerWidth - 800) / 354) * Math.floor((window.innerHeight - 255) / 500)),
|
|
1403
|
+
) : (r.length === 0 && (this.spliceLength = Math.floor((window.innerWidth - 800) / 354) * Math.floor((window.innerHeight - 255) / 500)), N(
|
|
1404
1404
|
this.facts.filter(
|
|
1405
1405
|
(i) => !this.selectedFacts.includes(i)
|
|
1406
1406
|
),
|
|
@@ -1477,7 +1477,7 @@ let y = class extends v {
|
|
|
1477
1477
|
<tems-button
|
|
1478
1478
|
type="primary"
|
|
1479
1479
|
disabled=${!i || c}
|
|
1480
|
-
label=${
|
|
1480
|
+
label=${u("Create bundle")}
|
|
1481
1481
|
@click=${this._createFactBundle}
|
|
1482
1482
|
></tems-button>
|
|
1483
1483
|
</div>
|
|
@@ -1488,8 +1488,8 @@ let y = class extends v {
|
|
|
1488
1488
|
<div>
|
|
1489
1489
|
<tems-input
|
|
1490
1490
|
type="text"
|
|
1491
|
-
label=${
|
|
1492
|
-
placeholder=${
|
|
1491
|
+
label=${u("Bundle name")}
|
|
1492
|
+
placeholder=${u("Bundle name")}
|
|
1493
1493
|
required=""
|
|
1494
1494
|
.value=${this.bundleName}
|
|
1495
1495
|
@change=${this._updateBundleName}
|
|
@@ -1498,15 +1498,15 @@ let y = class extends v {
|
|
|
1498
1498
|
<div>
|
|
1499
1499
|
<tems-textarea
|
|
1500
1500
|
rows="4"
|
|
1501
|
-
label=${
|
|
1502
|
-
placeholder=${
|
|
1501
|
+
label=${u("Bundle description")}
|
|
1502
|
+
placeholder=${u("Bundle description")}
|
|
1503
1503
|
.value=${this.bundleDescription}
|
|
1504
1504
|
@change=${this._updateBundleDescription}
|
|
1505
1505
|
></tems-textarea>
|
|
1506
1506
|
</div>
|
|
1507
1507
|
${r > 0 ? p`<tems-division type="h4">
|
|
1508
1508
|
<div>
|
|
1509
|
-
${
|
|
1509
|
+
${u(
|
|
1510
1510
|
J`${r} selected fact${r > 1 ? "s" : ""}`
|
|
1511
1511
|
)}
|
|
1512
1512
|
</div></tems-division
|
|
@@ -1520,7 +1520,7 @@ let y = class extends v {
|
|
|
1520
1520
|
if (n.length > 3) {
|
|
1521
1521
|
const a = n.length - 3;
|
|
1522
1522
|
n.splice(3, a), n.push({
|
|
1523
|
-
name: `+${a} ${
|
|
1523
|
+
name: `+${a} ${u("more")}`,
|
|
1524
1524
|
type: "information"
|
|
1525
1525
|
});
|
|
1526
1526
|
}
|
|
@@ -1537,7 +1537,7 @@ let y = class extends v {
|
|
|
1537
1537
|
})}
|
|
1538
1538
|
</div>` : c}
|
|
1539
1539
|
</div>
|
|
1540
|
-
|
|
1540
|
+
${s.length > 0 || this.filterFactText ? p`<div>
|
|
1541
1541
|
<div>
|
|
1542
1542
|
<tems-search-bar
|
|
1543
1543
|
.displayFilters=${!1}
|
|
@@ -1552,52 +1552,57 @@ let y = class extends v {
|
|
|
1552
1552
|
@search=${this._searchFacts}
|
|
1553
1553
|
></tems-search-bar>
|
|
1554
1554
|
</div>
|
|
1555
|
-
<div class="card-grid card-grid-vertical">
|
|
1556
|
-
|
|
1557
|
-
const n = o.categories.map(
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1555
|
+
${s.length > 0 ? p` <div class="card-grid card-grid-vertical">
|
|
1556
|
+
${s.map((o) => {
|
|
1557
|
+
const n = o.categories.map(
|
|
1558
|
+
(a) => ({
|
|
1559
|
+
name: a.name,
|
|
1560
|
+
type: "information"
|
|
1561
|
+
})
|
|
1562
|
+
);
|
|
1561
1563
|
if (n.length > 3) {
|
|
1562
1564
|
const a = n.length - 3;
|
|
1563
1565
|
n.splice(3, a), n.push({
|
|
1564
|
-
name: `+${a} ${
|
|
1566
|
+
name: `+${a} ${u("more")}`,
|
|
1565
1567
|
type: "information"
|
|
1566
1568
|
});
|
|
1567
1569
|
}
|
|
1568
1570
|
return p`<tems-card-catalog
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1571
|
+
.object=${c}
|
|
1572
|
+
.tags=${n}
|
|
1573
|
+
.header=${o.name || c}
|
|
1574
|
+
.content=${o.description || c}
|
|
1575
|
+
date=${o.updated_at || c}
|
|
1576
|
+
@click=${this._toggleFactSelection.bind(
|
|
1577
|
+
this,
|
|
1578
|
+
o
|
|
1579
|
+
)}
|
|
1580
|
+
></tems-card-catalog>`;
|
|
1576
1581
|
})}
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1582
|
+
</div>
|
|
1583
|
+
${s.length < e.length ? p`<div
|
|
1584
|
+
class="flex flex-row justify-content-space-between align-items-flex-end"
|
|
1585
|
+
>
|
|
1586
|
+
<div>
|
|
1587
|
+
${u(
|
|
1583
1588
|
J`Displaying ${s.length} of ${e.length} result${e.length > 1 ? "s" : ""}`
|
|
1584
1589
|
)}
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1590
|
+
</div>
|
|
1591
|
+
<div class="flex flex-row gap-400">
|
|
1592
|
+
<tems-button
|
|
1593
|
+
@click=${this._showMoreResults}
|
|
1594
|
+
type="primary"
|
|
1595
|
+
size="sm"
|
|
1596
|
+
label=${u("Show more results")}
|
|
1597
|
+
></tems-button>
|
|
1598
|
+
<tems-button
|
|
1599
|
+
@click=${this._showAllResults}
|
|
1600
|
+
type="primary"
|
|
1601
|
+
size="sm"
|
|
1602
|
+
label=${u("Show all results")}
|
|
1603
|
+
></tems-button>
|
|
1604
|
+
</div>
|
|
1605
|
+
</div>` : c}` : p`${u("No results found")} ${this.filterFactText ? `for "${this.filterFactText}".` : ""}`}
|
|
1601
1606
|
</div>` : c}
|
|
1602
1607
|
</section>
|
|
1603
1608
|
</div>
|
|
@@ -1689,8 +1694,8 @@ var fs = Object.defineProperty, ps = Object.getOwnPropertyDescriptor, I = (t, e,
|
|
|
1689
1694
|
let j = class extends v {
|
|
1690
1695
|
constructor() {
|
|
1691
1696
|
super(...arguments), this.header = "DS4GO Fact Bundling", this.search = [], this.resultCount = this.objects?.length || 0, this.cherryPickedProperties = [
|
|
1692
|
-
{ key: "created_at", value: "created_at", cast:
|
|
1693
|
-
{ key: "updated_at", value: "updated_at", cast:
|
|
1697
|
+
{ key: "created_at", value: "created_at", cast: U },
|
|
1698
|
+
{ key: "updated_at", value: "updated_at", cast: U },
|
|
1694
1699
|
{ key: "name", value: "name" },
|
|
1695
1700
|
{ key: "description", value: "description" }
|
|
1696
1701
|
], this._getResource = new Ye(this, {
|
|
@@ -1704,7 +1709,7 @@ let j = class extends v {
|
|
|
1704
1709
|
if (!t) return;
|
|
1705
1710
|
this.objects = await this._getProxyValue(t), this.hasCachedDatas = !0;
|
|
1706
1711
|
}
|
|
1707
|
-
return this.oldDataSrc !== t && (this.oldDataSrc = t), Array.isArray(this.objects) || (this.objects = []), this.object = this.objects.find((s) => s["@id"] === e),
|
|
1712
|
+
return this.oldDataSrc !== t && (this.oldDataSrc = t), Array.isArray(this.objects) || (this.objects = []), this.object = this.objects.find((s) => s["@id"] === e), N(this.objects, "name", "asc");
|
|
1708
1713
|
}
|
|
1709
1714
|
},
|
|
1710
1715
|
args: () => [
|
|
@@ -1719,14 +1724,14 @@ let j = class extends v {
|
|
|
1719
1724
|
return t?._originalResource?.hasType("ds4go:FactBundle") && (t.facts = await Promise.all(
|
|
1720
1725
|
(await t._originalResource["ldp:contains"]).map(
|
|
1721
1726
|
(e) => this._getProxyValue(e["@id"], !1, [
|
|
1722
|
-
{ key: "updated_at", value: "updated_at", cast:
|
|
1727
|
+
{ key: "updated_at", value: "updated_at", cast: U },
|
|
1723
1728
|
{ key: "name", value: "name" },
|
|
1724
1729
|
{ key: "description", value: "description" },
|
|
1725
1730
|
{
|
|
1726
1731
|
key: "categories",
|
|
1727
1732
|
value: "categories",
|
|
1728
1733
|
expand: !0,
|
|
1729
|
-
cast: (s) =>
|
|
1734
|
+
cast: (s) => N(s, "name")
|
|
1730
1735
|
},
|
|
1731
1736
|
{ key: "author", value: "author" },
|
|
1732
1737
|
{ key: "link", value: "link" },
|
|
@@ -1789,7 +1794,7 @@ let j = class extends v {
|
|
|
1789
1794
|
<tems-button
|
|
1790
1795
|
type="primary"
|
|
1791
1796
|
disabled=${!this.bundleCreationComponent?.route || c}
|
|
1792
|
-
label=${
|
|
1797
|
+
label=${u("Create a bundle")}
|
|
1793
1798
|
@click=${this._goToBundleCreation}
|
|
1794
1799
|
></tems-button>
|
|
1795
1800
|
</div>
|
|
@@ -1861,6 +1866,7 @@ const ms = {
|
|
|
1861
1866
|
s8272d3578b7c78d5: J`Displaying ${0} of ${1} result${2}`,
|
|
1862
1867
|
sa40e7f4f2a43e2f7: "Show more results",
|
|
1863
1868
|
sacf246e0fa11730d: "Show all results",
|
|
1869
|
+
s9094c0cde8fb5058: "No results found",
|
|
1864
1870
|
sf5509a9f253b9836: "Create a bundle",
|
|
1865
1871
|
sefa717c1620c4ae4: "facts",
|
|
1866
1872
|
sef234a791696afff: "fact",
|
package/package.json
CHANGED
|
@@ -312,7 +312,7 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
312
312
|
</div>`
|
|
313
313
|
: nothing}
|
|
314
314
|
</div>
|
|
315
|
-
|
|
315
|
+
${splicedDatas.length > 0 || this.filterFactText
|
|
316
316
|
? html`<div>
|
|
317
317
|
<div>
|
|
318
318
|
<tems-search-bar
|
|
@@ -328,56 +328,65 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
328
328
|
@search=${this._searchFacts}
|
|
329
329
|
></tems-search-bar>
|
|
330
330
|
</div>
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
)}
|
|
364
|
-
</div>
|
|
365
|
-
<div class="flex flex-row gap-400">
|
|
366
|
-
<tems-button
|
|
367
|
-
@click=${this._showMoreResults}
|
|
368
|
-
type="primary"
|
|
369
|
-
size="sm"
|
|
370
|
-
label=${msg("Show more results")}
|
|
371
|
-
></tems-button>
|
|
372
|
-
<tems-button
|
|
373
|
-
@click=${this._showAllResults}
|
|
374
|
-
type="primary"
|
|
375
|
-
size="sm"
|
|
376
|
-
label=${msg("Show all results")}
|
|
377
|
-
></tems-button>
|
|
331
|
+
${splicedDatas.length > 0
|
|
332
|
+
? html` <div class="card-grid card-grid-vertical">
|
|
333
|
+
${splicedDatas.map((fact: Resource) => {
|
|
334
|
+
const tags = fact.categories.map(
|
|
335
|
+
(c: Resource) => ({
|
|
336
|
+
name: c.name,
|
|
337
|
+
type: "information",
|
|
338
|
+
}),
|
|
339
|
+
);
|
|
340
|
+
if (tags.length > 3) {
|
|
341
|
+
const overflowTags = tags.length - 3;
|
|
342
|
+
tags.splice(3, overflowTags);
|
|
343
|
+
tags.push({
|
|
344
|
+
name: `+${overflowTags} ${msg("more")}`,
|
|
345
|
+
type: "information",
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return html`<tems-card-catalog
|
|
350
|
+
.object=${import.meta.env.DEV
|
|
351
|
+
? fact
|
|
352
|
+
: nothing}
|
|
353
|
+
.tags=${tags}
|
|
354
|
+
.header=${fact.name || nothing}
|
|
355
|
+
.content=${fact.description || nothing}
|
|
356
|
+
date=${fact.updated_at || nothing}
|
|
357
|
+
@click=${this._toggleFactSelection.bind(
|
|
358
|
+
this,
|
|
359
|
+
fact,
|
|
360
|
+
)}
|
|
361
|
+
></tems-card-catalog>`;
|
|
362
|
+
})}
|
|
378
363
|
</div>
|
|
379
|
-
|
|
380
|
-
|
|
364
|
+
${splicedDatas.length < datas.length
|
|
365
|
+
? html`<div
|
|
366
|
+
class="flex flex-row justify-content-space-between align-items-flex-end"
|
|
367
|
+
>
|
|
368
|
+
<div>
|
|
369
|
+
${msg(
|
|
370
|
+
str`Displaying ${splicedDatas.length} of ${datas.length} result${datas.length > 1 ? "s" : ""}`,
|
|
371
|
+
)}
|
|
372
|
+
</div>
|
|
373
|
+
<div class="flex flex-row gap-400">
|
|
374
|
+
<tems-button
|
|
375
|
+
@click=${this._showMoreResults}
|
|
376
|
+
type="primary"
|
|
377
|
+
size="sm"
|
|
378
|
+
label=${msg("Show more results")}
|
|
379
|
+
></tems-button>
|
|
380
|
+
<tems-button
|
|
381
|
+
@click=${this._showAllResults}
|
|
382
|
+
type="primary"
|
|
383
|
+
size="sm"
|
|
384
|
+
label=${msg("Show all results")}
|
|
385
|
+
></tems-button>
|
|
386
|
+
</div>
|
|
387
|
+
</div>`
|
|
388
|
+
: nothing}`
|
|
389
|
+
: html`${msg("No results found")} ${this.filterFactText ? `for "${this.filterFactText}".` : ""}`}
|
|
381
390
|
</div>`
|
|
382
391
|
: nothing}
|
|
383
392
|
</section>
|