@piveau/piveau-hub-ui-modules 4.4.27 → 4.4.29

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.
@@ -68,6 +68,325 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
68
68
  }>, {
69
69
  overviewPageIsVisible: import('vue').Ref<boolean, boolean>;
70
70
  }, {
71
+ instance: {
72
+ metadata: {
73
+ title: string;
74
+ description: string;
75
+ keywords: string;
76
+ };
77
+ api: {
78
+ baseUrl: string;
79
+ hubUrl: string;
80
+ qualityBaseUrl: string;
81
+ similarityBaseUrl: string;
82
+ similarityServiceName: string;
83
+ fileUploadUrl: string;
84
+ sparqlUrl: string;
85
+ gazetteerBaseUrl: string;
86
+ corsproxyApiUrl: string;
87
+ };
88
+ authentication: {
89
+ useService: boolean;
90
+ login: {
91
+ useLogin: boolean;
92
+ loginTitle: string;
93
+ loginURL: string;
94
+ loginRedirectUri: string;
95
+ logoutTitle: string;
96
+ logoutURL: string;
97
+ logoutRedirectUri: string;
98
+ };
99
+ keycloak: {
100
+ realm: string;
101
+ clientId: string;
102
+ 'ssl-required': string;
103
+ 'public-client': boolean;
104
+ 'verify-token-audience': boolean;
105
+ 'use-resource-role-mappings': boolean;
106
+ 'confidential-port': number;
107
+ url?: string | undefined;
108
+ };
109
+ keycloakInit: {
110
+ onLoad: "check-sso" | "login-required";
111
+ pkceMethod: string;
112
+ useNone: boolean;
113
+ adapter: string;
114
+ checkLoginIframe: boolean;
115
+ checkLoginIframeInterval: number;
116
+ responseMode: "query" | "fragment" | "form_post";
117
+ flow: "standard" | "implicit" | "hybrid";
118
+ scope: string;
119
+ token?: string | undefined;
120
+ refreshToken?: string | undefined;
121
+ idToken?: string | undefined;
122
+ timeSkew?: number | undefined;
123
+ redirectUri?: string | undefined;
124
+ silentCheckSsoRedirectUri?: string | undefined;
125
+ } & {
126
+ [k: string]: unknown;
127
+ };
128
+ rtp: {
129
+ grand_type: string;
130
+ audience: string;
131
+ };
132
+ authToken: string;
133
+ authMiddleware: {
134
+ baseUrl: string;
135
+ enable: boolean;
136
+ loginRedirectUrl: string;
137
+ logoutRedirectUrl: string;
138
+ };
139
+ } & {
140
+ [k: string]: unknown;
141
+ };
142
+ routing: {
143
+ routerOptions: {
144
+ base: string;
145
+ mode: string;
146
+ };
147
+ navigation: {
148
+ showSparql: boolean;
149
+ };
150
+ pagination: {
151
+ usePagination: boolean;
152
+ usePaginationArrows: boolean;
153
+ useItemsPerPage: boolean;
154
+ defaultItemsPerPage: number;
155
+ defaultItemsPerPageOptions: number[];
156
+ };
157
+ };
158
+ content: {
159
+ datasetDetails: {
160
+ embed: {
161
+ enable: boolean;
162
+ defaultWidth: number;
163
+ defaultHeight: number;
164
+ minRange: number;
165
+ maxRange: number;
166
+ };
167
+ header: {
168
+ navigation: string;
169
+ hidePublisher: boolean;
170
+ hideDate: boolean;
171
+ };
172
+ description: {
173
+ enableMarkdownInterpretation: boolean;
174
+ };
175
+ keywords: {
176
+ showTitle: boolean;
177
+ isVisible: boolean;
178
+ collapsed: boolean;
179
+ };
180
+ dataServices: {
181
+ isVisible: boolean;
182
+ displayAll: boolean;
183
+ displayCount: number;
184
+ incrementSteps: number[];
185
+ descriptionMaxLines: number;
186
+ descriptionMaxChars: number;
187
+ };
188
+ properties: string;
189
+ distributions: {
190
+ displayAll: boolean;
191
+ displayCount: number;
192
+ incrementSteps: number[];
193
+ descriptionMaxLines: number;
194
+ descriptionMaxChars: number;
195
+ showValidationButton: boolean;
196
+ };
197
+ downloadAs: {
198
+ url: string;
199
+ enable: boolean;
200
+ proxyUrl: string;
201
+ conversionFormats: {
202
+ sourceFileFormat: string;
203
+ targetFileFormat: string[];
204
+ }[];
205
+ };
206
+ similarDatasets: {
207
+ useSimilarDatasets: boolean;
208
+ breakpoints: {
209
+ verySimilar: {
210
+ start: number;
211
+ end: number;
212
+ };
213
+ similar: {
214
+ start: number;
215
+ end: number;
216
+ };
217
+ lessSimilar: {
218
+ start: number;
219
+ end: number;
220
+ };
221
+ };
222
+ };
223
+ pages: {
224
+ isVisible: boolean;
225
+ displayAll: boolean;
226
+ displayCount: number;
227
+ incrementSteps: number[];
228
+ descriptionMaxLines: number;
229
+ descriptionMaxChars: number;
230
+ };
231
+ visualisations: {
232
+ isVisible: boolean;
233
+ displayAll: boolean;
234
+ displayCount: number;
235
+ incrementSteps: number[];
236
+ descriptionMaxLines: number;
237
+ descriptionMaxChars: number;
238
+ };
239
+ isUsedBy: {
240
+ isVisible: boolean;
241
+ };
242
+ relatedResources: {
243
+ isVisible: boolean;
244
+ };
245
+ bulkDownload: {
246
+ buttonPosition: string;
247
+ MAX_FILE_TITLE_LENGTH: number;
248
+ MAX_REQUESTS_COUNT: number;
249
+ INTERVAL_MS: number;
250
+ TIMEOUT_MS: number;
251
+ };
252
+ quality: {
253
+ displayAll: boolean;
254
+ numberOfDisplayedQualityDistributions: number;
255
+ csvLinter: {
256
+ enable: boolean;
257
+ displayAll: boolean;
258
+ numberOfDisplayedValidationResults: number;
259
+ };
260
+ };
261
+ };
262
+ datasets: {
263
+ useSort: boolean;
264
+ useFeed: boolean;
265
+ useCatalogs: boolean;
266
+ followKeywordLinks: string;
267
+ maxKeywordLength: number;
268
+ facets: {
269
+ useDatasetFacets: boolean;
270
+ useDatasetFacetsMap: boolean;
271
+ showClearButton: boolean;
272
+ showFacetsTitle: boolean;
273
+ cutoff: number;
274
+ MIN_FACET_LIMIT: number;
275
+ MAX_FACET_LIMIT: number;
276
+ FACET_OPERATORS: {
277
+ or: string;
278
+ and: string;
279
+ };
280
+ FACET_GROUP_OPERATORS: {
281
+ or: string;
282
+ and: string;
283
+ };
284
+ defaultFacetOrder: string[];
285
+ scoringFacets: {
286
+ useScoringFacets: boolean;
287
+ defaultScoringFacets: Record<string, {
288
+ title: string;
289
+ id: string;
290
+ count: number;
291
+ minScoring: number;
292
+ maxScoring: number;
293
+ }>;
294
+ };
295
+ };
296
+ };
297
+ catalogs: {
298
+ useSort: boolean;
299
+ facets: {
300
+ useDatasetFacetsMap: boolean;
301
+ showClearButton: boolean;
302
+ showFacetsTitle: boolean;
303
+ cutoff: number;
304
+ MIN_FACET_LIMIT: number;
305
+ MAX_FACET_LIMIT: number;
306
+ FACET_OPERATORS: {
307
+ or: string;
308
+ and: string;
309
+ };
310
+ FACET_GROUP_OPERATORS: {
311
+ or: string;
312
+ and: string;
313
+ };
314
+ defaultFacetOrder: string[];
315
+ useCatalogFacets: boolean;
316
+ };
317
+ useCatalogCountries: boolean;
318
+ defaultCatalogImagePath: string;
319
+ defaultCatalogCountryID: string;
320
+ defaultCatalogID: string;
321
+ };
322
+ maps: {
323
+ options: {
324
+ id: string;
325
+ accessToken: string;
326
+ attribution: string;
327
+ };
328
+ mapVisible: boolean;
329
+ useAnimation: boolean;
330
+ location: [number[], number];
331
+ spatialType: "Point" | "Polygon";
332
+ height: string;
333
+ width: string;
334
+ mapContainerId: string;
335
+ urlTemplate: string;
336
+ geoBoundsId: string;
337
+ sender: {
338
+ height: string;
339
+ width: string;
340
+ mapContainerId: string;
341
+ startBounds: [[number, number], [number, number]];
342
+ };
343
+ receiver: {
344
+ height: string;
345
+ width: string;
346
+ mapContainerId: string;
347
+ startBounds: [[number, number], [number, number]];
348
+ attributionPosition: "topleft" | "topright" | "bottomleft" | "bottomright";
349
+ };
350
+ mapStyle: {
351
+ color: string;
352
+ fillColor: string;
353
+ fillOpacity: number;
354
+ weight: number;
355
+ radius: number;
356
+ };
357
+ };
358
+ dataProviderInterface: {
359
+ useService: boolean;
360
+ uploadFileTypes: string[];
361
+ enableFileUploadReplace: boolean;
362
+ basePath: string;
363
+ specification: "dcatap" | "dcatapde";
364
+ annifIntegration: boolean;
365
+ annifLinkTheme: string;
366
+ annifLinkSubject: string;
367
+ buttons: {
368
+ Dataset: boolean;
369
+ Catalogue: boolean;
370
+ };
371
+ doiRegistrationService: {
372
+ persistentIdentifierType: string;
373
+ };
374
+ };
375
+ };
376
+ languages: {
377
+ locale: string;
378
+ fallbackLocale: string;
379
+ useLanguageSelector: boolean;
380
+ };
381
+ themes: {
382
+ header: string;
383
+ };
384
+ tracker: {
385
+ isPiwikPro: boolean;
386
+ siteId: string;
387
+ trackerUrl: string;
388
+ };
389
+ };
71
390
  dpiLocale: string | {
72
391
  [x: string]: string[];
73
392
  } | import('vue-router').LocationQueryValue[];
@@ -1,92 +1,84 @@
1
- import { computed as f, ref as u, onMounted as B, openBlock as s, createElementBlock as c, createElementVNode as m, toDisplayString as p, createTextVNode as v, unref as o, createBlock as C, isRef as h, withDirectives as D, Fragment as S, renderList as L, createCommentVNode as F, vShow as R } from "vue";
1
+ import { computed as c, ref as n, onMounted as _, openBlock as d, createElementBlock as u, createElementVNode as m, toDisplayString as p, createTextVNode as v, createVNode as O, unref as r, isRef as C, withDirectives as j, Fragment as h, renderList as x, createCommentVNode as F, vShow as R } from "vue";
2
2
  import { useStore as U } from "vuex";
3
- import { getNode as d } from "@formkit/core";
3
+ import { getNode as f } from "@formkit/core";
4
4
  import { onClickOutside as q } from "../../external/@vueuse/core/index";
5
5
  import A from "axios";
6
- import { useRuntimeEnv as J } from "../../composables/useRuntimeEnv.mjs";
7
- import { has as w, isNil as I } from "lodash-es";
8
- import { FormKit as N } from "@formkit/vue";
6
+ import { useRuntimeEnv as B } from "../../composables/useRuntimeEnv.mjs";
7
+ import { has as S, isNil as L } from "lodash-es";
8
+ import { FormKit as D } from "@formkit/vue";
9
9
  import "./SimpleSelect.vue2.mjs";
10
- const K = { class: "formkitProperty" }, $ = { class: "position-relative formkitCmpWrap" }, M = ["onClick"], P = ["onClick"], ee = {
10
+ const J = { class: "formkitProperty" }, K = { class: "position-relative formkitCmpWrap" }, $ = ["onClick"], M = ["onClick"], Z = {
11
11
  __name: "SimpleSelect",
12
12
  props: {
13
13
  context: Object
14
14
  },
15
- setup(V) {
16
- const i = V, E = f(() => localStorage.getItem("dpi_duplicate")), g = f(() => y.getters["auth/getUserCatalogIds"]);
17
- let a = u();
18
- const y = U(), k = u(null), b = u();
19
- u(!0), b.value = f(() => y.getters["auth/getIsEditMode"]);
20
- let n = u([]), O = J(), r = u();
21
- r = d("dcat:catalog").value, q(k, (l) => a.value = !1);
22
- const x = async (l) => {
23
- l.id ? (i.context.node.input(l.id), a.value = !a.value, d("dcat:catalog").value = l.id, r = l.name) : (i.context.node.input(l), a.value = !a.value, d("dcat:catalog").value = l, r = l);
15
+ setup(N) {
16
+ const i = N;
17
+ c(() => localStorage.getItem("dpi_duplicate"));
18
+ const g = c(() => b.getters["auth/getUserCatalogIds"]);
19
+ let o = n();
20
+ const b = U(), k = n(null), V = n();
21
+ n(!0), V.value = c(() => b.getters["auth/getIsEditMode"]);
22
+ let s = n([]), w = B(), a = n();
23
+ a = f("dcat:catalog").value, q(k, (l) => o.value = !1);
24
+ const y = async (l) => {
25
+ l.id ? (i.context.node.input(l.id), o.value = !o.value, f("dcat:catalog").value = l.id, a = l.name) : (i.context.node.input(l), o.value = !o.value, f("dcat:catalog").value = l, a = l);
24
26
  };
25
- let _ = async () => {
27
+ let E = async () => {
26
28
  let l;
27
- await A.get(O.api.baseUrl + "search?filter=catalogue&limit=1000").then((e) => l = e).catch((e) => {
29
+ await A.get(w.api.baseUrl + "search?filter=catalogue&limit=1000").then((e) => l = e).catch((e) => {
28
30
  reject(e);
29
31
  }), l.data.result.results.forEach((e) => {
30
- w(e, "title") && !I(e.title) && w(e, "id") && !I(e.id) && n.value.push({ title: Object.values(e.title)[0], id: e.id });
31
- }), n.value = await n.value.filter((e) => g.value.includes(e.id)).map((e) => ({ id: e.id, name: e.title }));
32
- let t = JSON.parse(JSON.stringify(n.value));
33
- t.length === 1 && (r = t[0].id);
32
+ S(e, "title") && !L(e.title) && S(e, "id") && !L(e.id) && s.value.push({ title: Object.values(e.title)[0], id: e.id });
33
+ }), s.value = await s.value.filter((e) => g.value.includes(e.id)).map((e) => ({ id: e.id, name: e.title }));
34
+ let t = JSON.parse(JSON.stringify(s.value));
35
+ t.length === 1 && (a = t[0].id);
34
36
  };
35
- return B(async () => {
36
- _();
37
- }), (l, t) => (s(), c("div", K, [
37
+ return _(async () => {
38
+ E();
39
+ }), (l, t) => (d(), u("div", J, [
38
40
  m("h4", null, p(i.context.label), 1),
39
- t[5] || (t[5] = v()),
40
- m("div", $, [
41
- m("details", null, p(o(d)("dcat:catalog").value), 1),
42
- t[3] || (t[3] = v()),
43
- b.value.value && !E.value && o(d)("dcat:catalog").value != "" ? (s(), C(o(N), {
44
- key: 0,
41
+ t[4] || (t[4] = v()),
42
+ m("div", K, [
43
+ O(r(D), {
45
44
  class: "autocompleteInputfield",
46
- type: "text",
47
- readonly: "",
48
- placeholder: o(d)("dcat:catalog").value,
49
- name: i.context.node.name
50
- }, null, 8, ["placeholder", "name"])) : (s(), C(o(N), {
51
- key: 1,
52
- class: "autocompleteInputfield",
53
- modelValue: o(r),
54
- "onUpdate:modelValue": t[0] || (t[0] = (e) => h(r) ? r.value = e : r = e),
45
+ modelValue: r(a),
46
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => C(a) ? a.value = e : a = e),
55
47
  placeholder: i.context.attrs.placeholder,
56
48
  type: "text",
57
- onClick: t[1] || (t[1] = (e) => h(a) ? a.value = !o(a) : a = !o(a)),
49
+ onClick: t[1] || (t[1] = (e) => C(o) ? o.value = !r(o) : o = !r(o)),
58
50
  validation: "required",
59
51
  mandatory: "true",
60
52
  "validation-messages": {
61
53
  required: i.context.attrs.placeholder
62
54
  },
63
55
  name: i.context.node.name
64
- }, null, 8, ["modelValue", "placeholder", "validation-messages", "name"])),
65
- t[4] || (t[4] = v()),
66
- D(m("ul", {
56
+ }, null, 8, ["modelValue", "placeholder", "validation-messages", "name"]),
57
+ t[3] || (t[3] = v()),
58
+ j(m("ul", {
67
59
  ref_key: "dropdownList",
68
60
  ref: k,
69
61
  class: "autocompleteResultList selectListFK catSelectList"
70
62
  }, [
71
- (s(!0), c(S, null, L(o(n), (e) => (s(), c("li", {
63
+ (d(!0), u(h, null, x(r(s), (e) => (d(), u("li", {
72
64
  key: e,
73
- onClick: (j) => x(e),
65
+ onClick: (I) => y(e),
74
66
  class: "p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC"
75
- }, p(e.name), 9, M))), 128)),
67
+ }, p(e.name), 9, $))), 128)),
76
68
  t[2] || (t[2] = v()),
77
- o(n).length === 0 ? (s(!0), c(S, { key: 0 }, L(g.value, (e) => (s(), c("li", {
69
+ r(s).length === 0 ? (d(!0), u(h, { key: 0 }, x(g.value, (e) => (d(), u("li", {
78
70
  key: e,
79
- onClick: (j) => x(e),
71
+ onClick: (I) => y(e),
80
72
  class: "p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC"
81
- }, p(e), 9, P))), 128)) : F("", !0)
73
+ }, p(e), 9, M))), 128)) : F("", !0)
82
74
  ], 512), [
83
- [R, o(a)]
75
+ [R, r(o)]
84
76
  ])
85
77
  ])
86
78
  ]));
87
79
  }
88
80
  };
89
81
  export {
90
- ee as default
82
+ Z as default
91
83
  };
92
84
  //# sourceMappingURL=SimpleSelect.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleSelect.vue.mjs","sources":["../../../lib/data-provider-interface/components/SimpleSelect.vue"],"sourcesContent":["<template>\n <div class=\"formkitProperty\">\n <h4>{{ props.context.label }}</h4>\n <div class=\"position-relative formkitCmpWrap\">\n <details>{{ getNode('dcat:catalog').value}}</details>\n <FormKit v-if=\"isEditMode.value && !isDuplicate && getNode('dcat:catalog').value != ''\" class=\"autocompleteInputfield\" type=\"text\" readonly\n :placeholder=\"getNode('dcat:catalog').value\" :name=\"props.context.node.name\" />\n <FormKit v-else class=\"autocompleteInputfield\" v-model=\"catVal\"\n :placeholder=\"props.context.attrs.placeholder\" type=\"text\" @click=\"showList = !showList\"\n validation=\"required\" mandatory=\"true\" :validation-messages=\"{\n required: props.context.attrs.placeholder,\n }\" :name=\"props.context.node.name\" />\n\n <ul ref=\"dropdownList\" v-show=\"showList\" class=\"autocompleteResultList selectListFK catSelectList\">\n\n <li v-for=\"match in filteredCatalogs\" :key=\"match\" @click=\"setvalue(match)\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{\n match.name }}\n </li>\n <li v-if=\"filteredCatalogs.length === 0\" v-for=\"idMatch in userCats\" :key=\"idMatch\"\n @click=\"setvalue(idMatch)\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{\n idMatch }}\n </li>\n </ul>\n </div>\n </div>\n\n</template>\n<script setup>\nimport { ref, computed, onMounted } from 'vue';\nimport { useStore } from 'vuex';\nimport { getNode } from '@formkit/core'\nimport { onClickOutside } from '@vueuse/core'\nimport axios from 'axios'\nimport { useRuntimeEnv } from \"../../composables/useRuntimeEnv.ts\";\nimport {\n has,\n isNil,\n} from 'lodash-es';\nimport { FormKit } from '@formkit/vue';\n\nconst props = defineProps({\n context: Object\n})\n\n\n\nconst isDuplicate = computed(()=> localStorage.getItem('dpi_duplicate'))\nconst userCats = computed(() => store.getters['auth/getUserCatalogIds']);\nlet showList = ref()\nconst store = useStore()\nconst dropdownList = ref(null)\nconst isEditMode = ref()\nlet validationTrigger = ref(true)\nisEditMode.value = computed(() => store.getters['auth/getIsEditMode']);\nlet filteredCatalogs = ref([])\nlet env = useRuntimeEnv()\nlet catVal = ref()\n\ncatVal = getNode('dcat:catalog').value\n\nonClickOutside(dropdownList, event => showList.value = false)\n\nconst setvalue = async (e) => {\n \n validationTrigger = false\n if (e.id) {\n props.context.node.input(e.id)\n showList.value = !showList.value;\n getNode('dcat:catalog').value = e.id\n catVal = e.name\n } else {\n props.context.node.input(e)\n showList.value = !showList.value;\n getNode('dcat:catalog').value = e\n catVal = e\n }\n\n}\nlet filterCatList = async () => {\n let cache;\n await axios\n .get(env.api.baseUrl + 'search?filter=catalogue&limit=1000')\n .then(response => (cache = response))\n .catch((err) => {\n reject(err);\n });\n\n \n cache.data.result.results.forEach((e) => {\n // console.log(cache);\n \n if (has(e, 'title') && !isNil(e.title) && has(e, 'id') && !isNil(e.id)) filteredCatalogs.value.push({ title: Object.values(e.title)[0], id: e.id })\n });\n\n filteredCatalogs.value = await filteredCatalogs.value\n .filter(item => userCats.value.includes(item.id))\n .map(item => ({ id: item.id, name: item.title }));\n\n // Check if theres only one catalog and set it directly\n\n let clone = JSON.parse(JSON.stringify(filteredCatalogs.value))\n if (clone.length === 1) {\n catVal = clone[0].id\n }\n}\n\n\nonMounted(async () => {\n filterCatList();\n});\n\n</script>\n<style>\n.catSelectList {\n width: 97.3% !important;\n margin: 0 1rem;\n}\n\n.selectListFK {\n\n max-height: 20rem;\n overflow: overlay;\n overflow-x: hidden;\n}\n</style>"],"names":["props","__props","isDuplicate","computed","userCats","store","showList","ref","useStore","dropdownList","isEditMode","filteredCatalogs","env","useRuntimeEnv","catVal","getNode","onClickOutside","event","setvalue","e","filterCatList","cache","axios","response","err","has","isNil","item","clone","onMounted"],"mappings":";;;;;;;;;;;;;;;AA0CA,UAAMA,IAAQC,GAMRC,IAAcC,EAAS,MAAK,aAAa,QAAQ,eAAe,CAAC,GACjEC,IAAWD,EAAS,MAAME,EAAM,QAAQ,wBAAwB,CAAC;AACvE,QAAIC,IAAWC,EAAI;AACnB,UAAMF,IAAQG,EAAS,GACjBC,IAAeF,EAAI,IAAI,GACvBG,IAAaH,EAAI;AACC,IAAAA,EAAI,EAAI,GAChCG,EAAW,QAAQP,EAAS,MAAME,EAAM,QAAQ,oBAAoB,CAAC;AACrE,QAAIM,IAAmBJ,EAAI,EAAE,GACzBK,IAAMC,EAAc,GACpBC,IAASP,EAAI;AAEjB,IAAAO,IAASC,EAAQ,cAAc,EAAE,OAEnBC,EAACP,GAAc,CAAAQ,MAASX,EAAS,QAAQ,EAAK;AAE5D,UAAMY,IAAW,OAAOC,MAAM;AAG1B,MAAIA,EAAE,MACFnB,EAAM,QAAQ,KAAK,MAAMmB,EAAE,EAAE,GAC7Bb,EAAS,QAAQ,CAACA,EAAS,OAC3BS,EAAQ,cAAc,EAAE,QAAQI,EAAE,IAClCL,IAASK,EAAE,SAEXnB,EAAM,QAAQ,KAAK,MAAMmB,CAAC,GAC1Bb,EAAS,QAAQ,CAACA,EAAS,OAC3BS,EAAQ,cAAc,EAAE,QAAQI,GAChCL,IAASK;AAAA,IAGjB;AACA,QAAIC,IAAgB,YAAY;AAC5B,UAAIC;AACJ,YAAMC,EACD,IAAIV,EAAI,IAAI,UAAU,oCAAoC,EAC1D,KAAK,CAAAW,MAAaF,IAAQE,CAAS,EACnC,MAAM,CAACC,MAAQ;AACZ,eAAOA,CAAG;AAAA,MACtB,CAAS,GAGLH,EAAM,KAAK,OAAO,QAAQ,QAAQ,CAAC,MAAM;AAGrC,QAAII,EAAI,GAAG,OAAO,KAAK,CAACC,EAAM,EAAE,KAAK,KAAKD,EAAI,GAAG,IAAI,KAAK,CAACC,EAAM,EAAE,EAAE,KAAGf,EAAiB,MAAM,KAAK,EAAE,OAAO,OAAO,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,GAAE,CAAE;AAAA,MAC1J,CAAK,GAEDA,EAAiB,QAAQ,MAAMA,EAAiB,MAC3C,OAAO,CAAAgB,MAAQvB,EAAS,MAAM,SAASuB,EAAK,EAAE,CAAC,EAC/C,IAAI,CAAAA,OAAS,EAAE,IAAIA,EAAK,IAAI,MAAMA,EAAK,MAAO,EAAC;AAIpD,UAAIC,IAAQ,KAAK,MAAM,KAAK,UAAUjB,EAAiB,KAAK,CAAC;AAC7D,MAAIiB,EAAM,WAAW,MACjBd,IAASc,EAAM,CAAC,EAAE;AAAA,IAE1B;AAGA,WAAAC,EAAU,YAAY;AAClB,MAAAT;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SimpleSelect.vue.mjs","sources":["../../../lib/data-provider-interface/components/SimpleSelect.vue"],"sourcesContent":["<template>\n <div class=\"formkitProperty\">\n <h4>{{ props.context.label }}</h4>\n <div class=\"position-relative formkitCmpWrap\">\n \n \n <FormKit class=\"autocompleteInputfield\" v-model=\"catVal\"\n :placeholder=\"props.context.attrs.placeholder\" type=\"text\" @click=\"showList = !showList\"\n validation=\"required\" mandatory=\"true\" :validation-messages=\"{\n required: props.context.attrs.placeholder,\n }\" :name=\"props.context.node.name\" />\n\n <ul ref=\"dropdownList\" v-show=\"showList\" class=\"autocompleteResultList selectListFK catSelectList\">\n\n <li v-for=\"match in filteredCatalogs\" :key=\"match\" @click=\"setvalue(match)\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{\n match.name }}\n </li>\n <li v-if=\"filteredCatalogs.length === 0\" v-for=\"idMatch in userCats\" :key=\"idMatch\"\n @click=\"setvalue(idMatch)\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{\n idMatch }}\n </li>\n </ul>\n </div>\n </div>\n\n</template>\n<script setup>\nimport { ref, computed, onMounted } from 'vue';\nimport { useStore } from 'vuex';\nimport { getNode } from '@formkit/core'\nimport { onClickOutside } from '@vueuse/core'\nimport axios from 'axios'\nimport { useRuntimeEnv } from \"../../composables/useRuntimeEnv.ts\";\nimport {\n has,\n isNil,\n} from 'lodash-es';\nimport { FormKit } from '@formkit/vue';\n\nconst props = defineProps({\n context: Object\n})\n\n\n\nconst isDuplicate = computed(()=> localStorage.getItem('dpi_duplicate'))\nconst userCats = computed(() => store.getters['auth/getUserCatalogIds']);\nlet showList = ref()\nconst store = useStore()\nconst dropdownList = ref(null)\nconst isEditMode = ref()\nlet validationTrigger = ref(true)\nisEditMode.value = computed(() => store.getters['auth/getIsEditMode']);\nlet filteredCatalogs = ref([])\nlet env = useRuntimeEnv()\nlet catVal = ref()\n\ncatVal = getNode('dcat:catalog').value\n\nonClickOutside(dropdownList, event => showList.value = false)\n\nconst setvalue = async (e) => {\n \n validationTrigger = false\n if (e.id) {\n props.context.node.input(e.id)\n showList.value = !showList.value;\n getNode('dcat:catalog').value = e.id\n catVal = e.name\n } else {\n props.context.node.input(e)\n showList.value = !showList.value;\n getNode('dcat:catalog').value = e\n catVal = e\n }\n\n}\nlet filterCatList = async () => {\n let cache;\n await axios\n .get(env.api.baseUrl + 'search?filter=catalogue&limit=1000')\n .then(response => (cache = response))\n .catch((err) => {\n reject(err);\n });\n\n \n cache.data.result.results.forEach((e) => {\n // console.log(cache);\n \n if (has(e, 'title') && !isNil(e.title) && has(e, 'id') && !isNil(e.id)) filteredCatalogs.value.push({ title: Object.values(e.title)[0], id: e.id })\n });\n\n filteredCatalogs.value = await filteredCatalogs.value\n .filter(item => userCats.value.includes(item.id))\n .map(item => ({ id: item.id, name: item.title }));\n\n // Check if theres only one catalog and set it directly\n\n let clone = JSON.parse(JSON.stringify(filteredCatalogs.value))\n if (clone.length === 1) {\n catVal = clone[0].id\n }\n}\n\n\nonMounted(async () => {\n filterCatList();\n});\n\n</script>\n<style>\n.catSelectList {\n width: 97.3% !important;\n margin: 0 1rem;\n}\n\n.selectListFK {\n\n max-height: 20rem;\n overflow: overlay;\n overflow-x: hidden;\n}\n</style>"],"names":["props","__props","computed","userCats","store","showList","ref","useStore","dropdownList","isEditMode","filteredCatalogs","env","useRuntimeEnv","catVal","getNode","onClickOutside","event","setvalue","e","filterCatList","cache","axios","response","err","has","isNil","item","clone","onMounted"],"mappings":";;;;;;;;;;;;;;;AAyCA,UAAMA,IAAQC;AAMM,IAAAC,EAAS,MAAK,aAAa,QAAQ,eAAe,CAAC;AACvE,UAAMC,IAAWD,EAAS,MAAME,EAAM,QAAQ,wBAAwB,CAAC;AACvE,QAAIC,IAAWC,EAAI;AACnB,UAAMF,IAAQG,EAAS,GACjBC,IAAeF,EAAI,IAAI,GACvBG,IAAaH,EAAI;AACC,IAAAA,EAAI,EAAI,GAChCG,EAAW,QAAQP,EAAS,MAAME,EAAM,QAAQ,oBAAoB,CAAC;AACrE,QAAIM,IAAmBJ,EAAI,EAAE,GACzBK,IAAMC,EAAc,GACpBC,IAASP,EAAI;AAEjB,IAAAO,IAASC,EAAQ,cAAc,EAAE,OAEnBC,EAACP,GAAc,CAAAQ,MAASX,EAAS,QAAQ,EAAK;AAE5D,UAAMY,IAAW,OAAOC,MAAM;AAG1B,MAAIA,EAAE,MACFlB,EAAM,QAAQ,KAAK,MAAMkB,EAAE,EAAE,GAC7Bb,EAAS,QAAQ,CAACA,EAAS,OAC3BS,EAAQ,cAAc,EAAE,QAAQI,EAAE,IAClCL,IAASK,EAAE,SAEXlB,EAAM,QAAQ,KAAK,MAAMkB,CAAC,GAC1Bb,EAAS,QAAQ,CAACA,EAAS,OAC3BS,EAAQ,cAAc,EAAE,QAAQI,GAChCL,IAASK;AAAA,IAGjB;AACA,QAAIC,IAAgB,YAAY;AAC5B,UAAIC;AACJ,YAAMC,EACD,IAAIV,EAAI,IAAI,UAAU,oCAAoC,EAC1D,KAAK,CAAAW,MAAaF,IAAQE,CAAS,EACnC,MAAM,CAACC,MAAQ;AACZ,eAAOA,CAAG;AAAA,MACtB,CAAS,GAGLH,EAAM,KAAK,OAAO,QAAQ,QAAQ,CAAC,MAAM;AAGrC,QAAII,EAAI,GAAG,OAAO,KAAK,CAACC,EAAM,EAAE,KAAK,KAAKD,EAAI,GAAG,IAAI,KAAK,CAACC,EAAM,EAAE,EAAE,KAAGf,EAAiB,MAAM,KAAK,EAAE,OAAO,OAAO,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,GAAE,CAAE;AAAA,MAC1J,CAAK,GAEDA,EAAiB,QAAQ,MAAMA,EAAiB,MAC3C,OAAO,CAAAgB,MAAQvB,EAAS,MAAM,SAASuB,EAAK,EAAE,CAAC,EAC/C,IAAI,CAAAA,OAAS,EAAE,IAAIA,EAAK,IAAI,MAAMA,EAAK,MAAO,EAAC;AAIpD,UAAIC,IAAQ,KAAK,MAAM,KAAK,UAAUjB,EAAiB,KAAK,CAAC;AAC7D,MAAIiB,EAAM,WAAW,MACjBd,IAASc,EAAM,CAAC,EAAE;AAAA,IAE1B;AAGA,WAAAC,EAAU,YAAY;AAClB,MAAAT;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}