@eox/itemfilter 1.16.0 → 1.17.0
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/eox-itemfilter.js +238 -202
- package/dist/eox-itemfilter.umd.cjs +57 -38
- package/package.json +4 -3
- package/src/components/filters/range.js +70 -14
- package/src/enums/config.js +2 -0
- package/src/enums/index.js +1 -1
- package/src/helpers/filter-client.js +1 -1
- package/src/helpers/index.js +1 -0
- package/src/helpers/is-date.js +9 -0
- package/src/methods/filters/range.js +20 -11
- package/src/methods/itemfilter/create-filter.js +3 -0
- package/src/methods/itemfilter/filter-apply.js +1 -1
- package/src/style.eox.js +2 -0
- package/types/components/filters/range.d.ts +9 -0
- package/types/components/filters/range.d.ts.map +1 -1
- package/types/enums/config.d.ts +1 -0
- package/types/enums/config.d.ts.map +1 -1
- package/types/enums/index.d.ts +1 -1
- package/types/helpers/index.d.ts +1 -0
- package/types/helpers/is-date.d.ts +8 -0
- package/types/helpers/is-date.d.ts.map +1 -0
- package/types/methods/filters/range.d.ts.map +1 -1
- package/types/methods/itemfilter/create-filter.d.ts.map +1 -1
- package/types/style.eox.d.ts.map +1 -1
package/dist/eox-itemfilter.js
CHANGED
|
@@ -807,6 +807,8 @@ nav.title-nav {
|
|
|
807
807
|
}
|
|
808
808
|
eox-itemfilter-range {
|
|
809
809
|
display: block;
|
|
810
|
+
margin-left: var(--_list-padding);
|
|
811
|
+
padding-right: var(--_padding);
|
|
810
812
|
}
|
|
811
813
|
.range-wrapper {
|
|
812
814
|
margin-left: var(--_list-padding);
|
|
@@ -4450,7 +4452,7 @@ var Ga = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
4450
4452
|
for (let t = 0; t < i.length; t++) {
|
|
4451
4453
|
let n = {};
|
|
4452
4454
|
for (let [e, r] of Object.entries(a)) {
|
|
4453
|
-
let o = (e) => r.format === "date" ? (0, Ga.default)(e).
|
|
4455
|
+
let o = (e) => r.format === "date" ? (0, Ga.default)(e).valueOf() : e, s = no(e, i[t]);
|
|
4454
4456
|
if (s) if (Array.isArray(s)) {
|
|
4455
4457
|
let t = "overlap";
|
|
4456
4458
|
t === "overlap" ? n[e] = a[e].min <= o(s[1]) && o(s[0]) <= a[e].max : t === "contain" && (n[e] = o(s[0]) >= a[e].min && o(s[1]) <= a[e].max);
|
|
@@ -4601,8 +4603,13 @@ function io(e, { mergeAdjacent: t = !1 } = {}) {
|
|
|
4601
4603
|
return r;
|
|
4602
4604
|
}
|
|
4603
4605
|
//#endregion
|
|
4606
|
+
//#region src/helpers/is-date.js
|
|
4607
|
+
function ao(e) {
|
|
4608
|
+
return e.format === "date";
|
|
4609
|
+
}
|
|
4610
|
+
//#endregion
|
|
4604
4611
|
//#region src/components/itemfilter-container.js
|
|
4605
|
-
var
|
|
4612
|
+
var oo = class extends U {
|
|
4606
4613
|
static get properties() {
|
|
4607
4614
|
return {
|
|
4608
4615
|
filterProperties: {
|
|
@@ -4748,10 +4755,10 @@ var ao = class extends U {
|
|
|
4748
4755
|
`;
|
|
4749
4756
|
}
|
|
4750
4757
|
};
|
|
4751
|
-
customElements.define("eox-itemfilter-container",
|
|
4758
|
+
customElements.define("eox-itemfilter-container", oo);
|
|
4752
4759
|
//#endregion
|
|
4753
4760
|
//#region src/methods/filters/text.js
|
|
4754
|
-
var
|
|
4761
|
+
var so = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
4755
4762
|
var n = "Expected a function", r = NaN, i = "[object Symbol]", a = /^\s+|\s+$/g, o = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, c = /^0o[0-7]+$/i, l = parseInt, u = typeof global == "object" && global && global.Object === Object && global, d = typeof self == "object" && self && self.Object === Object && self, f = u || d || Function("return this")(), p = Object.prototype.toString, m = Math.max, h = Math.min, g = function() {
|
|
4756
4763
|
return f.Date.now();
|
|
4757
4764
|
};
|
|
@@ -4822,50 +4829,91 @@ var oo = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
4822
4829
|
}
|
|
4823
4830
|
t.exports = _;
|
|
4824
4831
|
})))(), 1);
|
|
4825
|
-
function
|
|
4832
|
+
function co(e) {
|
|
4826
4833
|
let t = e.renderRoot.querySelector("input[type='text']");
|
|
4827
4834
|
t.value = "", Xa(e.filterObject), e.requestUpdate();
|
|
4828
4835
|
}
|
|
4829
|
-
function
|
|
4836
|
+
function lo(e) {
|
|
4830
4837
|
let t = e.renderRoot.querySelector("input[type='text']");
|
|
4831
4838
|
e.isValid = t.checkValidity(), e.filterObject.keys.forEach((n) => {
|
|
4832
4839
|
e.filterObject.state[n] = t.value;
|
|
4833
4840
|
}), e.filterObject.dirty = !0, e.filterObject.stringifiedState = t.value, e.dispatchEvent(new CustomEvent("filter")), t.value === "" && e.reset();
|
|
4834
4841
|
}
|
|
4835
4842
|
//#endregion
|
|
4843
|
+
//#region src/enums/config.js
|
|
4844
|
+
var uo = Object.freeze({
|
|
4845
|
+
aggregateResults: void 0,
|
|
4846
|
+
autoSpreadSingle: !1,
|
|
4847
|
+
enableHighlighting: !1,
|
|
4848
|
+
externalFilter: () => {},
|
|
4849
|
+
filterProperties: [],
|
|
4850
|
+
fuseConfig: {},
|
|
4851
|
+
inlineMode: !1,
|
|
4852
|
+
matchAllWhenEmpty: !0,
|
|
4853
|
+
showResults: !0,
|
|
4854
|
+
idProperty: "id",
|
|
4855
|
+
titleProperty: "title",
|
|
4856
|
+
subTitleProperty: void 0,
|
|
4857
|
+
imageProperty: void 0,
|
|
4858
|
+
resultSorting: void 0,
|
|
4859
|
+
expandMultipleFilters: !0,
|
|
4860
|
+
expandResults: !0,
|
|
4861
|
+
expandMultipleResults: !0
|
|
4862
|
+
}), fo = [
|
|
4863
|
+
"aggregateResults",
|
|
4864
|
+
"autoSpreadSingle",
|
|
4865
|
+
"enableHighlighting",
|
|
4866
|
+
"externalFilter",
|
|
4867
|
+
"filterProperties",
|
|
4868
|
+
"fuseConfig",
|
|
4869
|
+
"inlineMode",
|
|
4870
|
+
"matchAllWhenEmpty",
|
|
4871
|
+
"showResults",
|
|
4872
|
+
"titleProperty",
|
|
4873
|
+
"subTitleProperty",
|
|
4874
|
+
"imageProperty",
|
|
4875
|
+
"idProperty",
|
|
4876
|
+
"resultSorting",
|
|
4877
|
+
"expandMultipleFilters",
|
|
4878
|
+
"expandResults",
|
|
4879
|
+
"expandMultipleResults",
|
|
4880
|
+
"items"
|
|
4881
|
+
], po = "YYYY-MM-DD";
|
|
4882
|
+
//#endregion
|
|
4836
4883
|
//#region src/methods/filters/range.js
|
|
4837
|
-
|
|
4838
|
-
function uo(e) {
|
|
4884
|
+
function mo(e) {
|
|
4839
4885
|
if (e.filterObject = Xa(e.filterObject), e.filterObject) {
|
|
4840
|
-
let t = e.
|
|
4841
|
-
|
|
4886
|
+
let t = e.filterObject.min, n = e.filterObject.max, r = e.querySelector("eox-timecontrol");
|
|
4887
|
+
r && r.dateChange([(0, Ga.default)(t), (0, Ga.default)(n)], r);
|
|
4888
|
+
let i = e.querySelector("tc-range-slider");
|
|
4889
|
+
i && (i.value1 !== t && (i.value1 = t), i.value2 !== n && (i.value2 = n));
|
|
4842
4890
|
}
|
|
4843
4891
|
e.requestUpdate();
|
|
4844
4892
|
}
|
|
4845
|
-
function
|
|
4893
|
+
function ho(e, t) {
|
|
4846
4894
|
let [n, r] = e.detail.values;
|
|
4847
|
-
(n !== t.filterObject.state.min || r !== t.filterObject.state.max) && ([t.filterObject.state.min, t.filterObject.state.max] = [n, r], t.filterObject.dirty = !0), t.filterObject.dirty && (t.filterObject.stringifiedState = t.filterObject.format === "date" ? `${Ga.default
|
|
4895
|
+
(n !== t.filterObject.state.min || r !== t.filterObject.state.max) && ([t.filterObject.state.min, t.filterObject.state.max] = [n, r], t.filterObject.dirty = !0), t.filterObject.dirty && (t.filterObject.stringifiedState = t.filterObject.format === "date" ? `${(0, Ga.default)(n).format(po)} - ${(0, Ga.default)(r).format(po)}` : `${n} - ${r}`), t.dispatchEvent(new CustomEvent("filter")), n === t.filterObject.min && r === t.filterObject.max ? t.reset() : t.requestUpdate();
|
|
4848
4896
|
}
|
|
4849
|
-
function
|
|
4850
|
-
let r = n.filterObject.
|
|
4851
|
-
return B`<div class="range-${t}">${
|
|
4897
|
+
function go(e, t, n) {
|
|
4898
|
+
let r = n.filterObject.state[e];
|
|
4899
|
+
return B`<div class="range-${t}">${ao(n.filterObject) ? (0, Ga.default)(r).format(po) : r}</div>`;
|
|
4852
4900
|
}
|
|
4853
4901
|
//#endregion
|
|
4854
4902
|
//#region src/methods/filters/selector.js
|
|
4855
|
-
function
|
|
4856
|
-
|
|
4903
|
+
function _o(e) {
|
|
4904
|
+
vo(-1, e), Xa(e.filterObject), e.requestUpdate();
|
|
4857
4905
|
}
|
|
4858
|
-
function
|
|
4859
|
-
t.selectedItems = e === -1 ? [] : t.selectedItems.filter((t, n) => n !== e),
|
|
4906
|
+
function vo(e, t) {
|
|
4907
|
+
t.selectedItems = e === -1 ? [] : t.selectedItems.filter((t, n) => n !== e), wo(t), To(t);
|
|
4860
4908
|
}
|
|
4861
|
-
function
|
|
4909
|
+
function yo(e, t) {
|
|
4862
4910
|
let n = t.selectedItems.indexOf(e);
|
|
4863
|
-
n >= 0 ? t.selectedItems = t.selectedItems.filter((e, t) => t !== n) : t.type === "multiselect" ? t.selectedItems = [...t.selectedItems, e] : (t.selectedItems = [e], t.showSuggestions = !1),
|
|
4911
|
+
n >= 0 ? t.selectedItems = t.selectedItems.filter((e, t) => t !== n) : t.type === "multiselect" ? t.selectedItems = [...t.selectedItems, e] : (t.selectedItems = [e], t.showSuggestions = !1), wo(t), To(t);
|
|
4864
4912
|
}
|
|
4865
|
-
function
|
|
4913
|
+
function bo(e, t) {
|
|
4866
4914
|
e.target instanceof HTMLInputElement && (t.query = e.target.value, t.showSuggestions = !0);
|
|
4867
4915
|
}
|
|
4868
|
-
function
|
|
4916
|
+
function xo(e, t) {
|
|
4869
4917
|
switch (e.key) {
|
|
4870
4918
|
case "ArrowDown":
|
|
4871
4919
|
t.highlightedIndex = Math.min(t.highlightedIndex + 1, t.filteredSuggestions.length - 1);
|
|
@@ -4874,46 +4922,46 @@ function vo(e, t) {
|
|
|
4874
4922
|
t.highlightedIndex = Math.max(t.highlightedIndex - 1, 0);
|
|
4875
4923
|
break;
|
|
4876
4924
|
case "Enter":
|
|
4877
|
-
t.highlightedIndex >= 0 &&
|
|
4925
|
+
t.highlightedIndex >= 0 && yo(t.filteredSuggestions[t.highlightedIndex], t);
|
|
4878
4926
|
break;
|
|
4879
4927
|
case "Escape":
|
|
4880
4928
|
t.showSuggestions = !1;
|
|
4881
4929
|
break;
|
|
4882
4930
|
}
|
|
4883
4931
|
}
|
|
4884
|
-
function
|
|
4885
|
-
(e.has("suggestions") || e.has("query")) &&
|
|
4932
|
+
function So(e, t) {
|
|
4933
|
+
(e.has("suggestions") || e.has("query")) && wo(t);
|
|
4886
4934
|
}
|
|
4887
|
-
function
|
|
4935
|
+
function Co(e, t) {
|
|
4888
4936
|
let n = e.filterObject?.sort || ((e, t) => e.toString().localeCompare(t.toString(), void 0, { numeric: !0 }));
|
|
4889
4937
|
return t.sort(n).map((e) => e);
|
|
4890
4938
|
}
|
|
4891
|
-
function
|
|
4939
|
+
function wo(e) {
|
|
4892
4940
|
let t = (e.filterObject?.filterKeys || e.suggestions).map((e) => `${e}`), n = t;
|
|
4893
|
-
e.query && (n = new tn(t, { threshold: .4 }).search(e.query).map((e) => e.item)), e.filteredSuggestions = e.filterObject?.filterKeys ? n :
|
|
4941
|
+
e.query && (n = new tn(t, { threshold: .4 }).search(e.query).map((e) => e.item)), e.filteredSuggestions = e.filterObject?.filterKeys ? n : Co(e, n), e.filterObject?.filterKeys && (e.filterObject.state = t.reduce((e, t) => (t in e || (e[t] = void 0), e), e.filterObject.state)), e.highlightedIndex = -1;
|
|
4894
4942
|
}
|
|
4895
|
-
function
|
|
4943
|
+
function To(e) {
|
|
4896
4944
|
Object.keys(e.filterObject.state).forEach((t) => {
|
|
4897
4945
|
e.filterObject.state[t] = e.selectedItems.includes(t);
|
|
4898
4946
|
}), e.filterObject.stringifiedState = Object.keys(e.filterObject.state).filter((t) => e.filterObject.state[t]).join(", ") || "", e.filterObject.dirty = e.filterObject.stringifiedState.length > 0, e.dispatchEvent(new CustomEvent("filter")), e.requestUpdate();
|
|
4899
4947
|
}
|
|
4900
4948
|
//#endregion
|
|
4901
4949
|
//#region src/methods/filters/spatial.js
|
|
4902
|
-
function
|
|
4950
|
+
function Eo(e) {
|
|
4903
4951
|
Xa(e.filterObject), e.renderRoot.querySelector("eox-itemfilter-spatial-filter").reset(), e.requestUpdate();
|
|
4904
4952
|
}
|
|
4905
|
-
function
|
|
4906
|
-
e.renderRoot.querySelector("#eox-map").innerHTML = "",
|
|
4953
|
+
function Do(e) {
|
|
4954
|
+
e.renderRoot.querySelector("#eox-map").innerHTML = "", ko(e);
|
|
4907
4955
|
}
|
|
4908
|
-
function
|
|
4956
|
+
function Oo(e, t) {
|
|
4909
4957
|
t.filterObject.state.mode = e;
|
|
4910
4958
|
let n = new CustomEvent("filter", { detail: { [t.filterObject.key]: {} } });
|
|
4911
4959
|
t.dispatchEvent(n);
|
|
4912
4960
|
}
|
|
4913
|
-
function
|
|
4961
|
+
function ko(e) {
|
|
4914
4962
|
let t = e.renderRoot.querySelector("#eox-map");
|
|
4915
4963
|
t.innerHTML === "" && (t.innerHTML = "<eox-map part=\"map\" style=\"height: 400px\"></eox-map>");
|
|
4916
|
-
let n = e.geometry &&
|
|
4964
|
+
let n = e.geometry && Ao(e.geometry), r = Ya(e.geometry, n);
|
|
4917
4965
|
e.eoxMap = e.renderRoot.querySelector("eox-map"), setTimeout(() => {
|
|
4918
4966
|
e.eoxMap.layers = r;
|
|
4919
4967
|
let t = (t) => {
|
|
@@ -4930,7 +4978,7 @@ function Eo(e) {
|
|
|
4930
4978
|
});
|
|
4931
4979
|
}, 1e3);
|
|
4932
4980
|
}
|
|
4933
|
-
function
|
|
4981
|
+
function Ao(e) {
|
|
4934
4982
|
return `data:text/json,${encodeURIComponent(JSON.stringify({
|
|
4935
4983
|
type: "FeatureCollection",
|
|
4936
4984
|
features: [{
|
|
@@ -4942,7 +4990,7 @@ function Do(e) {
|
|
|
4942
4990
|
}
|
|
4943
4991
|
//#endregion
|
|
4944
4992
|
//#region src/components/filters/text.js
|
|
4945
|
-
var
|
|
4993
|
+
var jo = class extends U {
|
|
4946
4994
|
static get properties() {
|
|
4947
4995
|
return {
|
|
4948
4996
|
filterObject: {
|
|
@@ -4968,15 +5016,15 @@ var Oo = class extends U {
|
|
|
4968
5016
|
super(), this.filterObject = {}, this.results = null, this.unstyled = !1, this.tabIndex = 0, this.isValid = !1;
|
|
4969
5017
|
}
|
|
4970
5018
|
#e = () => {
|
|
4971
|
-
|
|
5019
|
+
lo(this);
|
|
4972
5020
|
};
|
|
4973
5021
|
#t = (e) => {
|
|
4974
5022
|
e.key === "Enter" && e.target.value && this.results && this.results.length === 1 && (this.dispatchEvent(new CustomEvent("result", { detail: this.results[0] })), e.target.value = "", this.#e());
|
|
4975
5023
|
};
|
|
4976
5024
|
reset() {
|
|
4977
|
-
|
|
5025
|
+
co(this);
|
|
4978
5026
|
}
|
|
4979
|
-
debouncedInputHandler = (0,
|
|
5027
|
+
debouncedInputHandler = (0, so.default)(this.#e, 500, { leading: !0 });
|
|
4980
5028
|
createRenderRoot() {
|
|
4981
5029
|
return this;
|
|
4982
5030
|
}
|
|
@@ -5009,10 +5057,10 @@ var Oo = class extends U {
|
|
|
5009
5057
|
`);
|
|
5010
5058
|
}
|
|
5011
5059
|
};
|
|
5012
|
-
customElements.define("eox-itemfilter-text",
|
|
5060
|
+
customElements.define("eox-itemfilter-text", jo);
|
|
5013
5061
|
//#endregion
|
|
5014
5062
|
//#region src/methods/results/aggregate-results.js
|
|
5015
|
-
function
|
|
5063
|
+
function Mo(e, t, n) {
|
|
5016
5064
|
if (!t || typeof t == "string" && t.trim() === "") return [];
|
|
5017
5065
|
let r = n.config.aggregateResults;
|
|
5018
5066
|
return t === "No category" ? e.filter((e) => {
|
|
@@ -5029,33 +5077,33 @@ function ko(e, t, n) {
|
|
|
5029
5077
|
}
|
|
5030
5078
|
//#endregion
|
|
5031
5079
|
//#region ../../node_modules/lit-html/static.js
|
|
5032
|
-
var
|
|
5033
|
-
if (e?.r ===
|
|
5034
|
-
},
|
|
5080
|
+
var No = Symbol.for(""), Po = (e) => {
|
|
5081
|
+
if (e?.r === No) return e?._$litStatic$;
|
|
5082
|
+
}, Fo = (e) => ({
|
|
5035
5083
|
_$litStatic$: e,
|
|
5036
|
-
r:
|
|
5037
|
-
}),
|
|
5084
|
+
r: No
|
|
5085
|
+
}), Io = /* @__PURE__ */ new Map(), Lo = ((e) => (t, ...n) => {
|
|
5038
5086
|
let r = n.length, i, a, o = [], s = [], c, l = 0, u = !1;
|
|
5039
5087
|
for (; l < r;) {
|
|
5040
|
-
for (c = t[l]; l < r && (a = n[l], i =
|
|
5088
|
+
for (c = t[l]; l < r && (a = n[l], i = Po(a)) !== void 0;) c += i + t[++l], u = !0;
|
|
5041
5089
|
l !== r && s.push(a), o.push(c), l++;
|
|
5042
5090
|
}
|
|
5043
5091
|
if (l === r && o.push(t[r]), u) {
|
|
5044
5092
|
let e = o.join("$$lit$$");
|
|
5045
|
-
(t =
|
|
5093
|
+
(t = Io.get(e)) === void 0 && (o.raw = o, Io.set(e, t = o)), n = s;
|
|
5046
5094
|
}
|
|
5047
5095
|
return e(t, ...n);
|
|
5048
|
-
})(B),
|
|
5096
|
+
})(B), Ro = {
|
|
5049
5097
|
ATTRIBUTE: 1,
|
|
5050
5098
|
CHILD: 2,
|
|
5051
5099
|
PROPERTY: 3,
|
|
5052
5100
|
BOOLEAN_ATTRIBUTE: 4,
|
|
5053
5101
|
EVENT: 5,
|
|
5054
5102
|
ELEMENT: 6
|
|
5055
|
-
},
|
|
5103
|
+
}, zo = (e) => (...t) => ({
|
|
5056
5104
|
_$litDirective$: e,
|
|
5057
5105
|
values: t
|
|
5058
|
-
}),
|
|
5106
|
+
}), Bo = class {
|
|
5059
5107
|
constructor(e) {}
|
|
5060
5108
|
get _$AU() {
|
|
5061
5109
|
return this._$AM._$AU;
|
|
@@ -5069,9 +5117,9 @@ var Ao = Symbol.for(""), jo = (e) => {
|
|
|
5069
5117
|
update(e, t) {
|
|
5070
5118
|
return this.render(...t);
|
|
5071
5119
|
}
|
|
5072
|
-
}, { I:
|
|
5120
|
+
}, { I: Vo } = Te, Ho = () => document.createComment(""), Uo = (e, t, n) => {
|
|
5073
5121
|
let r = e._$AA.parentNode, i = t === void 0 ? e._$AB : t._$AA;
|
|
5074
|
-
if (n === void 0) n = new
|
|
5122
|
+
if (n === void 0) n = new Vo(r.insertBefore(Ho(), i), r.insertBefore(Ho(), i), e, e.options);
|
|
5075
5123
|
else {
|
|
5076
5124
|
let t = n._$AB.nextSibling, a = n._$AM, o = a !== e;
|
|
5077
5125
|
if (o) {
|
|
@@ -5087,15 +5135,15 @@ var Ao = Symbol.for(""), jo = (e) => {
|
|
|
5087
5135
|
}
|
|
5088
5136
|
}
|
|
5089
5137
|
return n;
|
|
5090
|
-
},
|
|
5138
|
+
}, Wo = (e, t, n = e) => (e._$AI(t, n), e), Go = {}, Ko = (e, t = Go) => e._$AH = t, qo = (e) => e._$AH, Jo = (e) => {
|
|
5091
5139
|
e._$AR(), e._$AA.remove();
|
|
5092
|
-
},
|
|
5140
|
+
}, Yo = (e, t, n) => {
|
|
5093
5141
|
let r = /* @__PURE__ */ new Map();
|
|
5094
5142
|
for (let i = t; i <= n; i++) r.set(e[i], i);
|
|
5095
5143
|
return r;
|
|
5096
|
-
},
|
|
5144
|
+
}, Xo = zo(class extends Bo {
|
|
5097
5145
|
constructor(e) {
|
|
5098
|
-
if (super(e), e.type !==
|
|
5146
|
+
if (super(e), e.type !== Ro.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
5099
5147
|
}
|
|
5100
5148
|
dt(e, t, n) {
|
|
5101
5149
|
let r;
|
|
@@ -5111,37 +5159,37 @@ var Ao = Symbol.for(""), jo = (e) => {
|
|
|
5111
5159
|
return this.dt(e, t, n).values;
|
|
5112
5160
|
}
|
|
5113
5161
|
update(e, [t, n, r]) {
|
|
5114
|
-
let i =
|
|
5162
|
+
let i = qo(e), { values: a, keys: o } = this.dt(t, n, r);
|
|
5115
5163
|
if (!Array.isArray(i)) return this.ut = o, a;
|
|
5116
5164
|
let s = this.ut ??= [], c = [], l, u, d = 0, f = i.length - 1, p = 0, m = a.length - 1;
|
|
5117
5165
|
for (; d <= f && p <= m;) if (i[d] === null) d++;
|
|
5118
5166
|
else if (i[f] === null) f--;
|
|
5119
|
-
else if (s[d] === o[p]) c[p] =
|
|
5120
|
-
else if (s[f] === o[m]) c[m] =
|
|
5121
|
-
else if (s[d] === o[m]) c[m] =
|
|
5122
|
-
else if (s[f] === o[p]) c[p] =
|
|
5123
|
-
else if (l === void 0 && (l =
|
|
5167
|
+
else if (s[d] === o[p]) c[p] = Wo(i[d], a[p]), d++, p++;
|
|
5168
|
+
else if (s[f] === o[m]) c[m] = Wo(i[f], a[m]), f--, m--;
|
|
5169
|
+
else if (s[d] === o[m]) c[m] = Wo(i[d], a[m]), Uo(e, c[m + 1], i[d]), d++, m--;
|
|
5170
|
+
else if (s[f] === o[p]) c[p] = Wo(i[f], a[p]), Uo(e, i[d], i[f]), f--, p++;
|
|
5171
|
+
else if (l === void 0 && (l = Yo(o, p, m), u = Yo(s, d, f)), l.has(s[d])) if (l.has(s[f])) {
|
|
5124
5172
|
let t = u.get(o[p]), n = t === void 0 ? null : i[t];
|
|
5125
5173
|
if (n === null) {
|
|
5126
|
-
let t =
|
|
5127
|
-
|
|
5128
|
-
} else c[p] =
|
|
5174
|
+
let t = Uo(e, i[d]);
|
|
5175
|
+
Wo(t, a[p]), c[p] = t;
|
|
5176
|
+
} else c[p] = Wo(n, a[p]), Uo(e, i[d], n), i[t] = null;
|
|
5129
5177
|
p++;
|
|
5130
|
-
} else
|
|
5131
|
-
else
|
|
5178
|
+
} else Jo(i[f]), f--;
|
|
5179
|
+
else Jo(i[d]), d++;
|
|
5132
5180
|
for (; p <= m;) {
|
|
5133
|
-
let t =
|
|
5134
|
-
|
|
5181
|
+
let t = Uo(e, c[m + 1]);
|
|
5182
|
+
Wo(t, a[p]), c[p++] = t;
|
|
5135
5183
|
}
|
|
5136
5184
|
for (; d <= f;) {
|
|
5137
5185
|
let e = i[d++];
|
|
5138
|
-
e !== null &&
|
|
5186
|
+
e !== null && Jo(e);
|
|
5139
5187
|
}
|
|
5140
|
-
return this.ut = o,
|
|
5188
|
+
return this.ut = o, Ko(e, c), fe;
|
|
5141
5189
|
}
|
|
5142
|
-
}),
|
|
5190
|
+
}), Zo = class extends Bo {
|
|
5143
5191
|
constructor(e) {
|
|
5144
|
-
if (super(e), this.it = V, e.type !==
|
|
5192
|
+
if (super(e), this.it = V, e.type !== Ro.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
5145
5193
|
}
|
|
5146
5194
|
render(e) {
|
|
5147
5195
|
if (e === V || e == null) return this._t = void 0, this.it = e;
|
|
@@ -5157,11 +5205,11 @@ var Ao = Symbol.for(""), jo = (e) => {
|
|
|
5157
5205
|
};
|
|
5158
5206
|
}
|
|
5159
5207
|
};
|
|
5160
|
-
|
|
5161
|
-
var
|
|
5208
|
+
Zo.directiveName = "unsafeHTML", Zo.resultType = 1;
|
|
5209
|
+
var Qo = zo(Zo);
|
|
5162
5210
|
//#endregion
|
|
5163
5211
|
//#region src/methods/results/create.js
|
|
5164
|
-
function
|
|
5212
|
+
function $o(e, t) {
|
|
5165
5213
|
return B`
|
|
5166
5214
|
<details
|
|
5167
5215
|
class="details-results"
|
|
@@ -5188,17 +5236,17 @@ function Xo(e, t) {
|
|
|
5188
5236
|
</nav>
|
|
5189
5237
|
</summary>
|
|
5190
5238
|
<div>
|
|
5191
|
-
${
|
|
5239
|
+
${es(t, e)}
|
|
5192
5240
|
</div>
|
|
5193
5241
|
</details>
|
|
5194
5242
|
`;
|
|
5195
5243
|
}
|
|
5196
|
-
function
|
|
5244
|
+
function es(e, t) {
|
|
5197
5245
|
let n = e.results, r = t ? e.aggregateResults(n, t) : n, i = e.config, a = (t) => e.selectedResult?.[i.idProperty] === t[i.idProperty] ? "highlighted" : V;
|
|
5198
|
-
return
|
|
5199
|
-
${e.resultType === "cards" ?
|
|
5200
|
-
${
|
|
5201
|
-
${e.resultType === "cards" ?
|
|
5246
|
+
return Lo`
|
|
5247
|
+
${e.resultType === "cards" ? Fo("<eox-layout fill-grid>") : Fo("<ul id=\"results\" class=\"list no-space\" part=\"results\">")}
|
|
5248
|
+
${Xo(r, (e) => e.id, (t) => Lo`
|
|
5249
|
+
${e.resultType === "cards" ? Fo("<eox-layout-item") : Fo("<li")}
|
|
5202
5250
|
class="${a(t)}"
|
|
5203
5251
|
@click=${() => {
|
|
5204
5252
|
e.selectedResult === t ? e.selectedResult = null : e.selectedResult = t, e.dispatchEvent(new CustomEvent("result", { detail: e.selectedResult }));
|
|
@@ -5260,11 +5308,11 @@ function Zo(e, t) {
|
|
|
5260
5308
|
<div class="title-container small-line max truncate">
|
|
5261
5309
|
<span
|
|
5262
5310
|
class="title truncate ${t.highlightedText ? "highlight-enabled" : ""}"
|
|
5263
|
-
>${
|
|
5311
|
+
>${Qo(t.highlightedText || no(i.titleProperty, t).toString())}</span
|
|
5264
5312
|
>
|
|
5265
5313
|
${W(!!no(i.subTitleProperty, t), () => B`
|
|
5266
5314
|
<small class="subtitle no-line truncate"
|
|
5267
|
-
>${
|
|
5315
|
+
>${Qo(no(i.subTitleProperty, t).toString())}</small
|
|
5268
5316
|
>
|
|
5269
5317
|
`)}
|
|
5270
5318
|
</div>
|
|
@@ -5272,7 +5320,7 @@ function Zo(e, t) {
|
|
|
5272
5320
|
<div class="small-line max truncate">
|
|
5273
5321
|
<span
|
|
5274
5322
|
class="title truncate ${t.highlightedText ? "highlight-enabled" : ""}"
|
|
5275
|
-
>${
|
|
5323
|
+
>${Qo(t.highlightedText || t[i.titleProperty])}</span
|
|
5276
5324
|
>
|
|
5277
5325
|
</div>
|
|
5278
5326
|
`)}
|
|
@@ -5284,19 +5332,19 @@ function Zo(e, t) {
|
|
|
5284
5332
|
}}
|
|
5285
5333
|
>
|
|
5286
5334
|
<icon class="small"
|
|
5287
|
-
>${
|
|
5335
|
+
>${Qo(e.resultActionIcon)}</icon
|
|
5288
5336
|
>
|
|
5289
5337
|
</button>
|
|
5290
5338
|
`)}
|
|
5291
5339
|
</nav>
|
|
5292
5340
|
</li>
|
|
5293
5341
|
`)}
|
|
5294
|
-
${e.resultType === "cards" ?
|
|
5342
|
+
${e.resultType === "cards" ? Fo("</eox-layout>") : Fo("</ul>")}
|
|
5295
5343
|
`;
|
|
5296
5344
|
}
|
|
5297
5345
|
//#endregion
|
|
5298
5346
|
//#region src/components/results.js
|
|
5299
|
-
var
|
|
5347
|
+
var ts = class extends U {
|
|
5300
5348
|
static get properties() {
|
|
5301
5349
|
return {
|
|
5302
5350
|
config: {
|
|
@@ -5333,13 +5381,13 @@ var Qo = class extends U {
|
|
|
5333
5381
|
super(), this.config = null, this.results = null, this.filters = {}, this.resultAggregation = [], this.selectedResult = null, this.resultType = "list", this.resultActionIcon = void 0;
|
|
5334
5382
|
}
|
|
5335
5383
|
#e(e) {
|
|
5336
|
-
return
|
|
5384
|
+
return es(this, e);
|
|
5337
5385
|
}
|
|
5338
5386
|
#t(e) {
|
|
5339
|
-
return
|
|
5387
|
+
return $o(e, this);
|
|
5340
5388
|
}
|
|
5341
5389
|
aggregateResults(e, t) {
|
|
5342
|
-
return
|
|
5390
|
+
return Mo(e, t, this);
|
|
5343
5391
|
}
|
|
5344
5392
|
createRenderRoot() {
|
|
5345
5393
|
return this;
|
|
@@ -5365,10 +5413,10 @@ var Qo = class extends U {
|
|
|
5365
5413
|
`;
|
|
5366
5414
|
}
|
|
5367
5415
|
};
|
|
5368
|
-
customElements.define("eox-itemfilter-results",
|
|
5416
|
+
customElements.define("eox-itemfilter-results", ts);
|
|
5369
5417
|
//#endregion
|
|
5370
5418
|
//#region src/components/filters/selector.js
|
|
5371
|
-
var
|
|
5419
|
+
var ns = class extends U {
|
|
5372
5420
|
static properties = {
|
|
5373
5421
|
filterObject: {
|
|
5374
5422
|
attribute: !1,
|
|
@@ -5416,21 +5464,21 @@ var $o = class extends U {
|
|
|
5416
5464
|
super(), this.filterObject = {}, this.suggestions = [], this.selectedItems = [], this.query = "", this.showSuggestions = !1, this.highlightedIndex = -1, this.filteredSuggestions = [], this.type = "select", this.unstyled = !1, this.tabIndex = 0, this.inlineMode = !1;
|
|
5417
5465
|
}
|
|
5418
5466
|
updated(e) {
|
|
5419
|
-
|
|
5467
|
+
So(e, this);
|
|
5420
5468
|
}
|
|
5421
5469
|
#e(e) {
|
|
5422
|
-
|
|
5470
|
+
bo(e, this);
|
|
5423
5471
|
}
|
|
5424
5472
|
#t(e) {
|
|
5425
|
-
|
|
5473
|
+
xo(e, this);
|
|
5426
5474
|
}
|
|
5427
5475
|
#n(e) {
|
|
5428
|
-
|
|
5476
|
+
yo(e, this);
|
|
5429
5477
|
}
|
|
5430
5478
|
reset() {
|
|
5431
|
-
|
|
5479
|
+
_o(this);
|
|
5432
5480
|
}
|
|
5433
|
-
debouncedInputHandler = (0,
|
|
5481
|
+
debouncedInputHandler = (0, so.default)(this.#n, 500, { leading: !0 });
|
|
5434
5482
|
firstUpdated() {
|
|
5435
5483
|
this.filterObject.state && (this.selectedItems = Object.keys(this.filterObject.state).map((e) => this.filterObject.state[e] ? e : null).filter((e) => !!e), this.filterObject.stringifiedState = this.selectedItems.join(", ") || "", this.requestUpdate());
|
|
5436
5484
|
}
|
|
@@ -5494,7 +5542,7 @@ var $o = class extends U {
|
|
|
5494
5542
|
};
|
|
5495
5543
|
//#endregion
|
|
5496
5544
|
//#region ../../node_modules/toolcool-range-slider/dist/toolcool-range-slider.min.js
|
|
5497
|
-
customElements.define("eox-itemfilter-select",
|
|
5545
|
+
customElements.define("eox-itemfilter-select", ns), (() => {
|
|
5498
5546
|
var e = Object.defineProperty, t = Math.pow, n = (t, n, r) => n in t ? e(t, n, {
|
|
5499
5547
|
enumerable: !0,
|
|
5500
5548
|
configurable: !0,
|
|
@@ -6548,55 +6596,79 @@ customElements.define("eox-itemfilter-select", $o), (() => {
|
|
|
6548
6596
|
})();
|
|
6549
6597
|
//#endregion
|
|
6550
6598
|
//#region src/components/filters/range.js
|
|
6551
|
-
var
|
|
6599
|
+
var rs = class extends U {
|
|
6552
6600
|
static properties = {
|
|
6553
6601
|
filterObject: {
|
|
6554
6602
|
attribute: !1,
|
|
6555
6603
|
type: Object
|
|
6556
6604
|
},
|
|
6605
|
+
suggestions: {
|
|
6606
|
+
attribute: !1,
|
|
6607
|
+
type: Array
|
|
6608
|
+
},
|
|
6557
6609
|
tabIndex: {
|
|
6558
6610
|
attribute: !1,
|
|
6559
6611
|
type: Number
|
|
6560
6612
|
}
|
|
6561
6613
|
};
|
|
6562
6614
|
constructor() {
|
|
6563
|
-
super(), this.filterObject = {}, this.tabIndex = 0, this.inputHandler = this.#e.bind(this), this.debouncedInputHandler = (0,
|
|
6615
|
+
super(), this.filterObject = {}, this.suggestions = [], this.tabIndex = 0, this.inputHandler = this.#e.bind(this), this.debouncedInputHandler = (0, so.default)(this.inputHandler, 500, { leading: !1 });
|
|
6564
6616
|
}
|
|
6565
6617
|
#e(e) {
|
|
6566
|
-
|
|
6618
|
+
ho(e, this);
|
|
6567
6619
|
}
|
|
6568
6620
|
#t(e, t) {
|
|
6569
|
-
return
|
|
6621
|
+
return go(e, t, this);
|
|
6570
6622
|
}
|
|
6571
6623
|
reset() {
|
|
6572
|
-
|
|
6624
|
+
mo(this);
|
|
6573
6625
|
}
|
|
6574
6626
|
createRenderRoot() {
|
|
6575
6627
|
return this;
|
|
6576
6628
|
}
|
|
6577
6629
|
render() {
|
|
6578
6630
|
return W(this.filterObject, () => B`
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6631
|
+
${W(ao(this.filterObject), () => B`
|
|
6632
|
+
<eox-timecontrol
|
|
6633
|
+
.controlValues=${[{
|
|
6634
|
+
id: this.filterObject.key,
|
|
6635
|
+
title: this.filterObject.title || "Filter",
|
|
6636
|
+
timeControlValues: (this.filterObject.filterKeys || this.suggestions || []).map((e) => typeof e == "object" ? e : { date: e })
|
|
6637
|
+
}]}
|
|
6638
|
+
.initDate=${[(0, Ga.default)(this.filterObject.state.min || this.filterObject.min), (0, Ga.default)(this.filterObject.state.max || this.filterObject.max)]}
|
|
6639
|
+
@select=${(e) => ho(new CustomEvent("values", { detail: { values: [(0, Ga.default)(e.detail.date[0]).valueOf(), (0, Ga.default)(e.detail.date[1]).valueOf()] } }), this)}
|
|
6640
|
+
>
|
|
6641
|
+
<eox-timecontrol-date
|
|
6642
|
+
.format=${po}
|
|
6643
|
+
></eox-timecontrol-date>
|
|
6644
|
+
<eox-timecontrol-picker
|
|
6645
|
+
popup
|
|
6646
|
+
range
|
|
6647
|
+
show-dots
|
|
6648
|
+
.position=${["bottom", "left"]}
|
|
6649
|
+
></eox-timecontrol-picker>
|
|
6650
|
+
</eox-timecontrol>
|
|
6651
|
+
`, () => B`
|
|
6652
|
+
<div style="display: flex; gap: .5rem; align-items: center;">
|
|
6653
|
+
${this.#t("min", "before")}
|
|
6654
|
+
<tc-range-slider
|
|
6655
|
+
min="${this.filterObject.min}"
|
|
6656
|
+
max="${this.filterObject.max}"
|
|
6657
|
+
value1="${this.filterObject.state.min || this.filterObject.min}"
|
|
6658
|
+
value2="${this.filterObject.state.max || this.filterObject.max}"
|
|
6659
|
+
step="${this.filterObject.step || 1}"
|
|
6660
|
+
@change=${this.debouncedInputHandler}
|
|
6661
|
+
></tc-range-slider>
|
|
6662
|
+
${this.#t("max", "after")}
|
|
6663
|
+
</div>
|
|
6664
|
+
`)}
|
|
6593
6665
|
`);
|
|
6594
6666
|
}
|
|
6595
6667
|
};
|
|
6596
|
-
customElements.define("eox-itemfilter-range",
|
|
6668
|
+
customElements.define("eox-itemfilter-range", rs);
|
|
6597
6669
|
//#endregion
|
|
6598
6670
|
//#region src/components/filters/spatial.js
|
|
6599
|
-
var
|
|
6671
|
+
var is = class extends U {
|
|
6600
6672
|
static get properties() {
|
|
6601
6673
|
return {
|
|
6602
6674
|
filterObject: { type: Object },
|
|
@@ -6610,13 +6682,13 @@ var ts = class extends U {
|
|
|
6610
6682
|
super(), this.filterObject = {}, this.tabIndex = 0;
|
|
6611
6683
|
}
|
|
6612
6684
|
reset() {
|
|
6613
|
-
|
|
6685
|
+
Eo(this);
|
|
6614
6686
|
}
|
|
6615
6687
|
createRenderRoot() {
|
|
6616
6688
|
return this;
|
|
6617
6689
|
}
|
|
6618
6690
|
#e(e) {
|
|
6619
|
-
|
|
6691
|
+
Oo(e, this);
|
|
6620
6692
|
}
|
|
6621
6693
|
render() {
|
|
6622
6694
|
return W(this.filterObject, () => B`
|
|
@@ -6649,8 +6721,8 @@ var ts = class extends U {
|
|
|
6649
6721
|
`);
|
|
6650
6722
|
}
|
|
6651
6723
|
};
|
|
6652
|
-
customElements.define("eox-itemfilter-spatial",
|
|
6653
|
-
var
|
|
6724
|
+
customElements.define("eox-itemfilter-spatial", is);
|
|
6725
|
+
var as = class extends U {
|
|
6654
6726
|
static get properties() {
|
|
6655
6727
|
return {
|
|
6656
6728
|
geometry: { type: Object },
|
|
@@ -6664,24 +6736,24 @@ var ns = class extends U {
|
|
|
6664
6736
|
this.#e();
|
|
6665
6737
|
}
|
|
6666
6738
|
#e() {
|
|
6667
|
-
|
|
6739
|
+
ko(this);
|
|
6668
6740
|
}
|
|
6669
6741
|
reset() {
|
|
6670
|
-
|
|
6742
|
+
Do(this);
|
|
6671
6743
|
}
|
|
6672
6744
|
render() {
|
|
6673
6745
|
return B`<div id="eox-map"></div>`;
|
|
6674
6746
|
}
|
|
6675
6747
|
};
|
|
6676
|
-
customElements.define("eox-itemfilter-spatial-filter",
|
|
6748
|
+
customElements.define("eox-itemfilter-spatial-filter", as);
|
|
6677
6749
|
//#endregion
|
|
6678
6750
|
//#region src/methods/chips/handler.js
|
|
6679
|
-
function
|
|
6751
|
+
function os(e, t) {
|
|
6680
6752
|
t.renderRoot.querySelectorAll(".chip").forEach((e) => {
|
|
6681
6753
|
e.classList.remove("highlighted");
|
|
6682
6754
|
}), e.target instanceof HTMLElement && e.target.classList.add("highlighted"), t.requestUpdate();
|
|
6683
6755
|
}
|
|
6684
|
-
function
|
|
6756
|
+
function ss(e, t) {
|
|
6685
6757
|
let { code: n, target: r } = e;
|
|
6686
6758
|
r instanceof HTMLElement && r.id !== "eox-itemfilter-input-search" || t.parentElement.classList.contains("hidden") && [
|
|
6687
6759
|
"ArrowLeft",
|
|
@@ -6696,9 +6768,9 @@ function is(e, t) {
|
|
|
6696
6768
|
"ArrowRight",
|
|
6697
6769
|
"Escape",
|
|
6698
6770
|
"Backspace"
|
|
6699
|
-
].includes(n) &&
|
|
6771
|
+
].includes(n) && cs(n, e.target.value ?? "", t));
|
|
6700
6772
|
}
|
|
6701
|
-
function
|
|
6773
|
+
function cs(e, t, n) {
|
|
6702
6774
|
let r = n.renderRoot.querySelector(".chip.highlighted");
|
|
6703
6775
|
if ((e === "Escape" || t) && r && r.classList.remove("highlighted"), e === "Backspace" && !t) {
|
|
6704
6776
|
if (n.items.length) {
|
|
@@ -6716,7 +6788,7 @@ function as(e, t, n) {
|
|
|
6716
6788
|
}
|
|
6717
6789
|
//#endregion
|
|
6718
6790
|
//#region src/components/chips.js
|
|
6719
|
-
var
|
|
6791
|
+
var ls = class extends U {
|
|
6720
6792
|
static get properties() {
|
|
6721
6793
|
return {
|
|
6722
6794
|
items: {
|
|
@@ -6745,10 +6817,10 @@ var os = class extends U {
|
|
|
6745
6817
|
this.dispatchEvent(new CustomEvent("items-selected", { detail: this.items }));
|
|
6746
6818
|
}
|
|
6747
6819
|
#e(e) {
|
|
6748
|
-
|
|
6820
|
+
ss(e, this);
|
|
6749
6821
|
}
|
|
6750
6822
|
#t(e) {
|
|
6751
|
-
|
|
6823
|
+
os(e, this);
|
|
6752
6824
|
}
|
|
6753
6825
|
render() {
|
|
6754
6826
|
return B`
|
|
@@ -6770,47 +6842,10 @@ var os = class extends U {
|
|
|
6770
6842
|
`;
|
|
6771
6843
|
}
|
|
6772
6844
|
};
|
|
6773
|
-
customElements.define("eox-itemfilter-chips",
|
|
6845
|
+
customElements.define("eox-itemfilter-chips", ls);
|
|
6774
6846
|
//#endregion
|
|
6775
|
-
//#region
|
|
6776
|
-
var
|
|
6777
|
-
aggregateResults: void 0,
|
|
6778
|
-
autoSpreadSingle: !1,
|
|
6779
|
-
enableHighlighting: !1,
|
|
6780
|
-
externalFilter: () => {},
|
|
6781
|
-
filterProperties: [],
|
|
6782
|
-
fuseConfig: {},
|
|
6783
|
-
inlineMode: !1,
|
|
6784
|
-
matchAllWhenEmpty: !0,
|
|
6785
|
-
showResults: !0,
|
|
6786
|
-
idProperty: "id",
|
|
6787
|
-
titleProperty: "title",
|
|
6788
|
-
subTitleProperty: void 0,
|
|
6789
|
-
imageProperty: void 0,
|
|
6790
|
-
resultSorting: void 0,
|
|
6791
|
-
expandMultipleFilters: !0,
|
|
6792
|
-
expandResults: !0,
|
|
6793
|
-
expandMultipleResults: !0
|
|
6794
|
-
}), cs = [
|
|
6795
|
-
"aggregateResults",
|
|
6796
|
-
"autoSpreadSingle",
|
|
6797
|
-
"enableHighlighting",
|
|
6798
|
-
"externalFilter",
|
|
6799
|
-
"filterProperties",
|
|
6800
|
-
"fuseConfig",
|
|
6801
|
-
"inlineMode",
|
|
6802
|
-
"matchAllWhenEmpty",
|
|
6803
|
-
"showResults",
|
|
6804
|
-
"titleProperty",
|
|
6805
|
-
"subTitleProperty",
|
|
6806
|
-
"imageProperty",
|
|
6807
|
-
"idProperty",
|
|
6808
|
-
"resultSorting",
|
|
6809
|
-
"expandMultipleFilters",
|
|
6810
|
-
"expandResults",
|
|
6811
|
-
"expandMultipleResults",
|
|
6812
|
-
"items"
|
|
6813
|
-
], ls = /* @__PURE__ */ o(((e, t) => {
|
|
6847
|
+
//#region ../../node_modules/lodash.uniq/index.js
|
|
6848
|
+
var us = /* @__PURE__ */ o(((e, t) => {
|
|
6814
6849
|
var n = 200, r = "__lodash_hash_undefined__", i = Infinity, a = "[object Function]", o = "[object GeneratorFunction]", s = /[\\^$.*+?()[\]{}|]/g, c = /^\[object .+?Constructor\]$/, l = typeof global == "object" && global && global.Object === Object && global, u = typeof self == "object" && self && self.Object === Object && self, d = l || u || Function("return this")();
|
|
6815
6850
|
function f(e, t) {
|
|
6816
6851
|
return !!(e && e.length) && h(e, t, 0) > -1;
|
|
@@ -7017,7 +7052,7 @@ var ss = Object.freeze({
|
|
|
7017
7052
|
}
|
|
7018
7053
|
function Te() {}
|
|
7019
7054
|
t.exports = xe;
|
|
7020
|
-
})),
|
|
7055
|
+
})), ds = /* @__PURE__ */ o(((e, t) => {
|
|
7021
7056
|
var n = 200, r = "Expected a function", i = "__lodash_hash_undefined__", a = 1, o = 2, s = Infinity, c = 9007199254740991, l = "[object Arguments]", u = "[object Array]", d = "[object Boolean]", f = "[object Date]", p = "[object Error]", m = "[object Function]", h = "[object GeneratorFunction]", g = "[object Map]", _ = "[object Number]", v = "[object Object]", y = "[object Promise]", b = "[object RegExp]", x = "[object Set]", S = "[object String]", C = "[object Symbol]", w = "[object WeakMap]", T = "[object ArrayBuffer]", E = "[object DataView]", D = "[object Float32Array]", O = "[object Float64Array]", k = "[object Int8Array]", A = "[object Int16Array]", j = "[object Int32Array]", ee = "[object Uint8Array]", te = "[object Uint8ClampedArray]", M = "[object Uint16Array]", ne = "[object Uint32Array]", N = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, P = /^\w*$/, re = /^\./, ie = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ae = /[\\^$.*+?()[\]{}|]/g, F = /\\(\\)?/g, oe = /^\[object .+?Constructor\]$/, se = /^(?:0|[1-9]\d*)$/, I = {};
|
|
7022
7057
|
I[D] = I[O] = I[k] = I[A] = I[j] = I[ee] = I[te] = I[M] = I[ne] = !0, I[l] = I[u] = I[T] = I[d] = I[E] = I[f] = I[p] = I[m] = I[g] = I[_] = I[v] = I[b] = I[x] = I[S] = I[w] = !1;
|
|
7023
7058
|
var L = typeof global == "object" && global && global.Object === Object && global, R = typeof self == "object" && self && self.Object === Object && self, ce = L || R || Function("return this")(), le = typeof e == "object" && e && !e.nodeType && e, z = le && typeof t == "object" && t && !t.nodeType && t, ue = z && z.exports === le && L.process, de = function() {
|
|
@@ -7578,11 +7613,11 @@ var ss = Object.freeze({
|
|
|
7578
7613
|
return Yt(e) ? me(nn(e)) : Pt(e);
|
|
7579
7614
|
}
|
|
7580
7615
|
t.exports = an;
|
|
7581
|
-
})),
|
|
7582
|
-
function
|
|
7616
|
+
})), fs = /* @__PURE__ */ c(us(), 1), ps = /* @__PURE__ */ c(ds(), 1);
|
|
7617
|
+
function ms(e, t, n) {
|
|
7583
7618
|
let r = [];
|
|
7584
7619
|
e.filterProperties.length && e.filterProperties.forEach((e) => {
|
|
7585
|
-
let r = {}, i = (t) => e.format === "date" ? (0, Ga.default)(t).
|
|
7620
|
+
let r = {}, i = (t) => e.format === "date" ? (0, Ga.default)(t).valueOf() : parseFloat(t);
|
|
7586
7621
|
t.forEach((t) => {
|
|
7587
7622
|
if (e.type === "range") {
|
|
7588
7623
|
let n = no(e.key, t);
|
|
@@ -7597,7 +7632,7 @@ function ps(e, t, n) {
|
|
|
7597
7632
|
}
|
|
7598
7633
|
Array.isArray(t[e.key]) ? t[e.key].forEach((e) => {
|
|
7599
7634
|
r[e] = void 0;
|
|
7600
|
-
}) : e.type === "spatial" ? (r.geometry = e?.state?.geometry || void 0, r.geometry && (e.stringifiedState = r.geometry.type), r.mode = e.mode || "intersects") : e.key?.includes(".") ? (0,
|
|
7635
|
+
}) : e.type === "spatial" ? (r.geometry = e?.state?.geometry || void 0, r.geometry && (e.stringifiedState = r.geometry.type), r.mode = e.mode || "intersects") : e.key?.includes(".") ? (0, fs.default)((0, ps.default)(n.items, e.key)).filter((e) => e).forEach((e) => {
|
|
7601
7636
|
r[e] = void 0;
|
|
7602
7637
|
}) : r[t[e.key]] = void 0;
|
|
7603
7638
|
});
|
|
@@ -7621,13 +7656,13 @@ function ps(e, t, n) {
|
|
|
7621
7656
|
}
|
|
7622
7657
|
//#endregion
|
|
7623
7658
|
//#region src/methods/itemfilter/search.js
|
|
7624
|
-
async function
|
|
7659
|
+
async function hs(e, t, n) {
|
|
7625
7660
|
let r;
|
|
7626
7661
|
r = n.externalFilter ? await eo(t, n.filters, e) : await Ja(t, n.filters, e), n.results = n.sortResults(r, { isExternalResult: !!n.externalFilter });
|
|
7627
7662
|
}
|
|
7628
7663
|
//#endregion
|
|
7629
7664
|
//#region src/methods/itemfilter/create-filter.js
|
|
7630
|
-
function
|
|
7665
|
+
function gs(e, t, n) {
|
|
7631
7666
|
let r = `filter-${e.key}`.replace("|", "-");
|
|
7632
7667
|
switch (e.type) {
|
|
7633
7668
|
case "text": return B`<eox-itemfilter-text
|
|
@@ -7651,7 +7686,7 @@ function hs(e, t, n) {
|
|
|
7651
7686
|
.tabIndex=${t}
|
|
7652
7687
|
.filterObject=${e}
|
|
7653
7688
|
slot="filter"
|
|
7654
|
-
.suggestions="${(0,
|
|
7689
|
+
.suggestions="${(0, fs.default)((0, ps.default)(n.items, e.key)).filter((e) => e)}"
|
|
7655
7690
|
type="${e.type}"
|
|
7656
7691
|
.unstyled=${n.unstyled}
|
|
7657
7692
|
@filter=${() => n.search()}
|
|
@@ -7664,6 +7699,7 @@ function hs(e, t, n) {
|
|
|
7664
7699
|
.tabIndex=${t}
|
|
7665
7700
|
.filterObject=${e}
|
|
7666
7701
|
slot="filter"
|
|
7702
|
+
.suggestions="${(0, fs.default)((0, ps.default)(n.items, e.key)).filter((e) => e)}"
|
|
7667
7703
|
.unstyled=${n.unstyled}
|
|
7668
7704
|
@filter=${() => n.search()}
|
|
7669
7705
|
></eox-itemfilter-range>
|
|
@@ -7683,7 +7719,7 @@ function hs(e, t, n) {
|
|
|
7683
7719
|
}
|
|
7684
7720
|
//#endregion
|
|
7685
7721
|
//#region src/methods/itemfilter/sort-results.js
|
|
7686
|
-
function
|
|
7722
|
+
function _s(e, t, n = {}) {
|
|
7687
7723
|
let { resultSorting: r } = t;
|
|
7688
7724
|
if (r === !1) return e;
|
|
7689
7725
|
if (r === void 0) return n.isExternalResult || t.fuseConfig?.shouldSort ? e : [...e].sort((e, n) => {
|
|
@@ -7699,7 +7735,7 @@ function gs(e, t, n = {}) {
|
|
|
7699
7735
|
}
|
|
7700
7736
|
//#endregion
|
|
7701
7737
|
//#region src/methods/itemfilter/create-reset.js
|
|
7702
|
-
function
|
|
7738
|
+
function vs(e, t, n) {
|
|
7703
7739
|
return B`
|
|
7704
7740
|
${W(e.dirty, () => B`
|
|
7705
7741
|
<button
|
|
@@ -7729,14 +7765,14 @@ function _s(e, t, n) {
|
|
|
7729
7765
|
}
|
|
7730
7766
|
//#endregion
|
|
7731
7767
|
//#region src/methods/itemfilter/reset-filter.js
|
|
7732
|
-
function
|
|
7768
|
+
function ys(e) {
|
|
7733
7769
|
e.renderRoot.querySelectorAll("[data-type='filter']").forEach((e) => {
|
|
7734
7770
|
typeof e.reset == "function" && e.reset();
|
|
7735
7771
|
}), e.search();
|
|
7736
7772
|
}
|
|
7737
7773
|
//#endregion
|
|
7738
7774
|
//#region src/main.js
|
|
7739
|
-
var
|
|
7775
|
+
var bs = class extends U {
|
|
7740
7776
|
static get properties() {
|
|
7741
7777
|
return {
|
|
7742
7778
|
items: { type: Array },
|
|
@@ -7822,15 +7858,15 @@ var ys = class extends U {
|
|
|
7822
7858
|
}
|
|
7823
7859
|
#e = [];
|
|
7824
7860
|
#t = [];
|
|
7825
|
-
#n =
|
|
7861
|
+
#n = uo;
|
|
7826
7862
|
constructor() {
|
|
7827
|
-
super(), this.items = null, this.filters = {}, this.results = [], this.selectedResult = null, this.search = (0,
|
|
7863
|
+
super(), this.items = null, this.filters = {}, this.results = [], this.selectedResult = null, this.search = (0, so.default)(this.searchHandler, 100, { leading: !0 }), this.aggregateResults = void 0, this.autoSpreadSingle = !1, this.enableHighlighting = !1, this.externalFilter = null, this.filterProperties = [], this.fuseConfig = {}, this.inlineMode = !1, this.matchAllWhenEmpty = !0, this.showResults = !0, this.titleProperty = "title", this.subTitleProperty = void 0, this.imageProperty = void 0, this.resultSorting = void 0, this.idProperty = "id", this.expandMultipleFilters = !0, this.expandResults = !0, this.expandMultipleResults = !0, this.resultType = "list", this.enableResultAction = !1, this.resultActionIcon = "<svg style=\"width: 24px;\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><title>click me!</title><path fill=\"currentColor\" d=\"M11.5,11L17.88,16.37L17,16.55L16.36,16.67C15.73,16.8 15.37,17.5 15.65,18.07L15.92,18.65L17.28,21.59L15.86,22.25L14.5,19.32L14.24,18.74C13.97,18.15 13.22,17.97 12.72,18.38L12.21,18.78L11.5,19.35V11M10.76,8.69A0.76,0.76 0 0,0 10,9.45V20.9C10,21.32 10.34,21.66 10.76,21.66C10.95,21.66 11.11,21.6 11.24,21.5L13.15,19.95L14.81,23.57C14.94,23.84 15.21,24 15.5,24C15.61,24 15.72,24 15.83,23.92L18.59,22.64C18.97,22.46 19.15,22 18.95,21.63L17.28,18L19.69,17.55C19.85,17.5 20,17.43 20.12,17.29C20.39,16.97 20.35,16.5 20,16.21L11.26,8.86L11.25,8.87C11.12,8.76 10.95,8.69 10.76,8.69M15,10V8H20V10H15M13.83,4.76L16.66,1.93L18.07,3.34L15.24,6.17L13.83,4.76M10,0H12V5H10V0M3.93,14.66L6.76,11.83L8.17,13.24L5.34,16.07L3.93,14.66M3.93,3.34L5.34,1.93L8.17,4.76L6.76,6.17L3.93,3.34M7,10H2V8H7V10\" /></svg>", this.styleOverride = "", this.unstyled = !1;
|
|
7828
7864
|
}
|
|
7829
7865
|
apply() {
|
|
7830
|
-
this.#n =
|
|
7866
|
+
this.#n = fo.reduce((e, t) => (e[t] = this[t], e), {}), this.#e = ms(this.#n, this.#t, this), this.search();
|
|
7831
7867
|
}
|
|
7832
7868
|
async searchHandler() {
|
|
7833
|
-
await
|
|
7869
|
+
await hs(this.#n, this.#t, this), this.dispatchEvent(new CustomEvent("filter", {
|
|
7834
7870
|
detail: {
|
|
7835
7871
|
results: this.results,
|
|
7836
7872
|
filters: this.filters
|
|
@@ -7840,20 +7876,20 @@ var ys = class extends U {
|
|
|
7840
7876
|
})), this.inlineMode && this.renderRoot.querySelector("eox-itemfilter-container").updateInline(), this.requestUpdate();
|
|
7841
7877
|
}
|
|
7842
7878
|
sortResults(e, t) {
|
|
7843
|
-
return
|
|
7879
|
+
return _s(e, this.#n, t);
|
|
7844
7880
|
}
|
|
7845
7881
|
#r(e, t) {
|
|
7846
|
-
return
|
|
7882
|
+
return gs(e, t, this);
|
|
7847
7883
|
}
|
|
7848
7884
|
#i(e, t) {
|
|
7849
|
-
return
|
|
7885
|
+
return vs(e, t, this);
|
|
7850
7886
|
}
|
|
7851
7887
|
resetFilters() {
|
|
7852
|
-
|
|
7888
|
+
ys(this);
|
|
7853
7889
|
}
|
|
7854
7890
|
firstUpdated(e) {
|
|
7855
7891
|
let t = {};
|
|
7856
|
-
|
|
7892
|
+
fo.map((e) => {
|
|
7857
7893
|
t = {
|
|
7858
7894
|
...t,
|
|
7859
7895
|
[e]: this[e]
|
|
@@ -7861,7 +7897,7 @@ var ys = class extends U {
|
|
|
7861
7897
|
}), this.#n = t, this.#t = this.items?.map((e, t) => Object.assign({ id: e[this.idProperty] || `item-${t}` }, e)) || [], this.apply();
|
|
7862
7898
|
}
|
|
7863
7899
|
updated(e) {
|
|
7864
|
-
|
|
7900
|
+
fo.map((t) => e.has(t) ? (this.firstUpdated(void 0), !0) : !1);
|
|
7865
7901
|
}
|
|
7866
7902
|
updateResult(e) {
|
|
7867
7903
|
this.selectedResult = e.detail, this.dispatchEvent(new CustomEvent("select", {
|
|
@@ -7996,6 +8032,6 @@ var ys = class extends U {
|
|
|
7996
8032
|
`;
|
|
7997
8033
|
}
|
|
7998
8034
|
};
|
|
7999
|
-
customElements.define("eox-itemfilter",
|
|
8035
|
+
customElements.define("eox-itemfilter", bs);
|
|
8000
8036
|
//#endregion
|
|
8001
|
-
export {
|
|
8037
|
+
export { bs as EOxItemFilter };
|