@piveau/piveau-hub-ui-modules 4.6.6 → 4.6.7
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/data-provider-interface/composables/useFormSchema.d.ts +5 -1
- package/dist/data-provider-interface/composables/useFormSchema.mjs +28 -30
- package/dist/data-provider-interface/composables/useFormSchema.mjs.map +1 -1
- package/dist/data-provider-interface/utils/translation-helper.mjs +18 -19
- package/dist/data-provider-interface/utils/translation-helper.mjs.map +1 -1
- package/dist/data-provider-interface/views/InputPage.vue.mjs +60 -59
- package/dist/data-provider-interface/views/InputPage.vue.mjs.map +1 -1
- package/dist/datasetDetails/distributions/distributionActions/DistributionActions.vue.d.ts +1 -0
- package/dist/datasetDetails/distributions/distributionActions/DistributionActions.vue.mjs +45 -35
- package/dist/datasetDetails/distributions/distributionActions/DistributionActions.vue.mjs.map +1 -1
- package/dist/datasetDetails/distributions/distributionActions/DistributionActions.vue2.mjs +2 -2
- package/dist/datasetDetails/distributions/distributionActions/DistributionVisualizeButton.vue.d.ts +35 -0
- package/dist/datasetDetails/distributions/distributionActions/DistributionVisualizeButton.vue.mjs +102 -0
- package/dist/datasetDetails/distributions/distributionActions/DistributionVisualizeButton.vue.mjs.map +1 -0
- package/dist/datasetDetails/distributions/distributionActions/DistributionVisualizeButton.vue2.mjs +5 -0
- package/dist/datasetDetails/distributions/distributionActions/DistributionVisualizeButton.vue2.mjs.map +1 -0
- package/dist/piveau-hub-ui-modules.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { MaybeRefOrGetter } from 'vue';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export interface UseFormSchemaOptions {
|
|
4
|
+
t?: (key: string) => string;
|
|
5
|
+
te?: (key: string) => boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function useFormSchema(options?: UseFormSchemaOptions): {
|
|
4
8
|
createSchema: ({ property, page }: {
|
|
5
9
|
property: string;
|
|
6
10
|
page: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { useDpiContext as
|
|
3
|
-
import { useI18n as
|
|
4
|
-
import
|
|
5
|
-
import { createSharedComposable as
|
|
6
|
-
const
|
|
7
|
-
const
|
|
1
|
+
import { computed as d, ref as p, toValue as b } from "vue";
|
|
2
|
+
import { useDpiContext as x } from "./useDpiContext.mjs";
|
|
3
|
+
import { useI18n as D } from "vue-i18n";
|
|
4
|
+
import w from "../utils/translation-helper.mjs";
|
|
5
|
+
import { createSharedComposable as A } from "../../external/@vueuse/shared/index";
|
|
6
|
+
const F = A(() => {
|
|
7
|
+
const c = p({
|
|
8
8
|
schema: {
|
|
9
9
|
datasets: {},
|
|
10
10
|
distributions: {},
|
|
@@ -12,48 +12,46 @@ const D = x(() => {
|
|
|
12
12
|
},
|
|
13
13
|
usersCatalogs: {}
|
|
14
14
|
});
|
|
15
|
-
return { state:
|
|
16
|
-
const
|
|
15
|
+
return { state: c, getSchema: (a) => d(() => {
|
|
16
|
+
const r = b(a);
|
|
17
17
|
if (a === "catalogues" || a === "datasets" || a === "distributions")
|
|
18
|
-
return
|
|
18
|
+
return c.value.schema[r];
|
|
19
19
|
}) };
|
|
20
20
|
});
|
|
21
|
-
function
|
|
22
|
-
const i =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const o = (c = u.value.pageConent) == null ? void 0 : c[t][e], m = (s = u.value.inputDefinition) == null ? void 0 : s[t], r = JSON.parse(JSON.stringify(n.value));
|
|
28
|
-
d({ state: r, pageProperties: o, propertyDefinitions: m, property: t, page: e }), n.value = r;
|
|
21
|
+
function K(c) {
|
|
22
|
+
const l = x(), { t: a, te: r } = c || D({ useScope: "global" }), { state: i, getSchema: S } = F(), h = d(() => l.value.specification);
|
|
23
|
+
function v({ property: t, page: e }) {
|
|
24
|
+
var n, s;
|
|
25
|
+
const o = (n = h.value.pageConent) == null ? void 0 : n[t][e], m = (s = h.value.inputDefinition) == null ? void 0 : s[t], u = JSON.parse(JSON.stringify(i.value));
|
|
26
|
+
C({ state: u, pageProperties: o, propertyDefinitions: m, property: t, page: e }), i.value = u;
|
|
29
27
|
}
|
|
30
|
-
function
|
|
28
|
+
function C({
|
|
31
29
|
state: t,
|
|
32
30
|
pageProperties: e,
|
|
33
31
|
propertyDefinitions: o,
|
|
34
32
|
property: m,
|
|
35
|
-
page:
|
|
33
|
+
page: u
|
|
36
34
|
}) {
|
|
37
|
-
const
|
|
35
|
+
const n = [];
|
|
38
36
|
for (let s = 0; s < e.length; s += 1) {
|
|
39
|
-
const
|
|
37
|
+
const f = e[s];
|
|
40
38
|
try {
|
|
41
|
-
|
|
39
|
+
n.push(o[f]);
|
|
42
40
|
} catch {
|
|
43
41
|
console.warn(
|
|
44
|
-
`DCATAP doens't include a property called: ${
|
|
42
|
+
`DCATAP doens't include a property called: ${f}`
|
|
45
43
|
);
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
|
-
t.schema[m][
|
|
46
|
+
t.schema[m][u] = n;
|
|
49
47
|
}
|
|
50
|
-
function
|
|
51
|
-
const o = { ...
|
|
52
|
-
|
|
48
|
+
function g({ property: t, page: e }) {
|
|
49
|
+
const o = { ...i.value.schema };
|
|
50
|
+
w(o[t][e], t, a, r), i.value.schema[t][e] = o[t][e];
|
|
53
51
|
}
|
|
54
|
-
return { createSchema:
|
|
52
|
+
return { createSchema: v, translateSchema: g, getSchema: S };
|
|
55
53
|
}
|
|
56
54
|
export {
|
|
57
|
-
|
|
55
|
+
K as useFormSchema
|
|
58
56
|
};
|
|
59
57
|
//# sourceMappingURL=useFormSchema.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormSchema.mjs","sources":["../../../lib/data-provider-interface/composables/useFormSchema.ts"],"sourcesContent":["import { createSharedComposable } from '@vueuse/core'\nimport { computed, MaybeRefOrGetter, ref, toValue, watch } from 'vue'\nimport { useDpiContext } from './useDpiContext'\nimport { useI18n } from 'vue-i18n'\nimport translate from '../utils/translation-helper'\n\nconst useFormSchemaGlobal = createSharedComposable(() => {\n const state = ref({\n schema: {\n datasets: {},\n distributions: {},\n catalogues: {}\n },\n usersCatalogs: {}\n })\n\n /**\n * Retrieves the schema for a given property.\n *\n * @param property - The property whose schema should be retrieved.\n * Can be a string or a ref to a string.\n * @returns A computed ref to the schema of the given property.\n */\n const getSchema = (property: MaybeRefOrGetter<string>) => computed(() => {\n const _property = toValue(property)\n\n if (property === 'catalogues' || property === 'datasets' || property === 'distributions') {\n return state.value.schema[_property as keyof typeof state.value.schema]\n }\n\n return undefined\n })\n\n return { state, getSchema }\n})\n\nexport function useFormSchema() {\n const dpiContext = useDpiContext()\n const { t } = useI18n({ useScope: 'global' })\n const { state, getSchema } = useFormSchemaGlobal()\n\n const dpiConfig = computed(() => dpiContext.value.specification)\n\n function createSchema({ property, page }: { property: string, page: string }) {\n const pageProperties = dpiConfig.value.pageConent?.[property as keyof typeof dpiConfig.value.pageConent][page] as unknown as string[]\n const propertyDefinitions = dpiConfig.value.inputDefinition?.[property as keyof typeof dpiConfig.value.inputDefinition]\n\n // Create copy of state because extractSchema does in-place modifications.\n // Just to be safe.\n const stateCopy = JSON.parse(JSON.stringify(state.value))\n extractSchema({ state: stateCopy, pageProperties, propertyDefinitions, property, page })\n\n state.value = stateCopy\n }\n\n function extractSchema({\n state,\n pageProperties,\n propertyDefinitions,\n property,\n page,\n }: {\n state: any\n pageProperties: string[]\n propertyDefinitions: any\n property: string\n page: string\n }) {\n // important: create new empty schema each time so already existing schema will be overwritten on route/view-change\n const newSchema = [];\n\n for (let index = 0; index < pageProperties.length; index += 1) {\n const propertyKey = pageProperties[index];\n try {\n newSchema.push(propertyDefinitions[propertyKey]);\n } catch (err) {\n console.warn(\n `DCATAP doens't include a property called: ${propertyKey}`\n );\n }\n }\n\n state.schema[property][page] = newSchema;\n }\n\n function translateSchema({ property, page }: { property: string, page: string }) {\n const schemaCopy = { ...state.value.schema }\n // @ts-ignore\n translate(schemaCopy[property][page], property);\n\n // Update the global state with the new schema\n // @ts-ignore\n state.value.schema[property][page] = schemaCopy[property][page]\n }\n\n return { createSchema, translateSchema, getSchema }\n\n}"],"names":["useFormSchemaGlobal","createSharedComposable","state","ref","property","computed","_property","toValue","useFormSchema","dpiContext","useDpiContext","useI18n","getSchema","dpiConfig","createSchema","page","pageProperties","_a","propertyDefinitions","_b","stateCopy","extractSchema","newSchema","index","propertyKey","translateSchema","schemaCopy","translate"],"mappings":";;;;;AAMA,MAAMA,IAAsBC,EAAuB,MAAM;AACvD,QAAMC,IAAQC,EAAI;AAAA,IAChB,QAAQ;AAAA,MACN,UAAU,CAAC;AAAA,MACX,eAAe,CAAC;AAAA,MAChB,YAAY,CAAC;AAAA,IACf;AAAA,IACA,eAAe,CAAC;AAAA,EAAA,CACjB;AAmBM,SAAA,EAAE,OAAAD,GAAO,WAVE,CAACE,MAAuCC,EAAS,MAAM;AACjE,UAAAC,IAAYC,EAAQH,CAAQ;AAElC,QAAIA,MAAa,gBAAgBA,MAAa,cAAcA,MAAa;AAChE,aAAAF,EAAM,MAAM,OAAOI,CAA4C;AAAA,EAGjE,CACR;AAGH,CAAC;
|
|
1
|
+
{"version":3,"file":"useFormSchema.mjs","sources":["../../../lib/data-provider-interface/composables/useFormSchema.ts"],"sourcesContent":["import { createSharedComposable } from '@vueuse/core'\nimport { computed, MaybeRefOrGetter, ref, toValue, watch } from 'vue'\nimport { useDpiContext } from './useDpiContext'\nimport { useI18n } from 'vue-i18n'\nimport translate from '../utils/translation-helper'\n\nconst useFormSchemaGlobal = createSharedComposable(() => {\n const state = ref({\n schema: {\n datasets: {},\n distributions: {},\n catalogues: {}\n },\n usersCatalogs: {}\n })\n\n /**\n * Retrieves the schema for a given property.\n *\n * @param property - The property whose schema should be retrieved.\n * Can be a string or a ref to a string.\n * @returns A computed ref to the schema of the given property.\n */\n const getSchema = (property: MaybeRefOrGetter<string>) => computed(() => {\n const _property = toValue(property)\n\n if (property === 'catalogues' || property === 'datasets' || property === 'distributions') {\n return state.value.schema[_property as keyof typeof state.value.schema]\n }\n\n return undefined\n })\n\n return { state, getSchema }\n})\n\nexport interface UseFormSchemaOptions {\n t?: (key: string) => string\n te?: (key: string) => boolean\n}\n\nexport function useFormSchema(options?: UseFormSchemaOptions) {\n const dpiContext = useDpiContext()\n const { t, te } = options || useI18n({ useScope: 'global' })\n const { state, getSchema } = useFormSchemaGlobal()\n\n const dpiConfig = computed(() => dpiContext.value.specification)\n\n function createSchema({ property, page }: { property: string, page: string }) {\n const pageProperties = dpiConfig.value.pageConent?.[property as keyof typeof dpiConfig.value.pageConent][page] as unknown as string[]\n const propertyDefinitions = dpiConfig.value.inputDefinition?.[property as keyof typeof dpiConfig.value.inputDefinition]\n\n // Create copy of state because extractSchema does in-place modifications.\n // Just to be safe.\n const stateCopy = JSON.parse(JSON.stringify(state.value))\n extractSchema({ state: stateCopy, pageProperties, propertyDefinitions, property, page })\n\n state.value = stateCopy\n }\n\n function extractSchema({\n state,\n pageProperties,\n propertyDefinitions,\n property,\n page,\n }: {\n state: any\n pageProperties: string[]\n propertyDefinitions: any\n property: string\n page: string\n }) {\n // important: create new empty schema each time so already existing schema will be overwritten on route/view-change\n const newSchema = [];\n\n for (let index = 0; index < pageProperties.length; index += 1) {\n const propertyKey = pageProperties[index];\n try {\n newSchema.push(propertyDefinitions[propertyKey]);\n } catch (err) {\n console.warn(\n `DCATAP doens't include a property called: ${propertyKey}`\n );\n }\n }\n\n state.schema[property][page] = newSchema;\n }\n\n function translateSchema({ property, page }: { property: string, page: string }) {\n const schemaCopy = { ...state.value.schema }\n // @ts-ignore\n translate(schemaCopy[property][page], property, t, te);\n\n // Update the global state with the new schema\n // @ts-ignore\n state.value.schema[property][page] = schemaCopy[property][page]\n }\n\n return { createSchema, translateSchema, getSchema }\n\n}"],"names":["useFormSchemaGlobal","createSharedComposable","state","ref","property","computed","_property","toValue","useFormSchema","options","dpiContext","useDpiContext","t","te","useI18n","getSchema","dpiConfig","createSchema","page","pageProperties","_a","propertyDefinitions","_b","stateCopy","extractSchema","newSchema","index","propertyKey","translateSchema","schemaCopy","translate"],"mappings":";;;;;AAMA,MAAMA,IAAsBC,EAAuB,MAAM;AACvD,QAAMC,IAAQC,EAAI;AAAA,IAChB,QAAQ;AAAA,MACN,UAAU,CAAC;AAAA,MACX,eAAe,CAAC;AAAA,MAChB,YAAY,CAAC;AAAA,IACf;AAAA,IACA,eAAe,CAAC;AAAA,EAAA,CACjB;AAmBM,SAAA,EAAE,OAAAD,GAAO,WAVE,CAACE,MAAuCC,EAAS,MAAM;AACjE,UAAAC,IAAYC,EAAQH,CAAQ;AAElC,QAAIA,MAAa,gBAAgBA,MAAa,cAAcA,MAAa;AAChE,aAAAF,EAAM,MAAM,OAAOI,CAA4C;AAAA,EAGjE,CACR;AAGH,CAAC;AAOM,SAASE,EAAcC,GAAgC;AAC5D,QAAMC,IAAaC,KACb,EAAE,GAAAC,GAAG,IAAAC,MAAOJ,KAAWK,EAAQ,EAAE,UAAU,SAAA,CAAU,GACrD,EAAE,OAAAZ,GAAO,WAAAa,EAAU,IAAIf,EAAoB,GAE3CgB,IAAYX,EAAS,MAAMK,EAAW,MAAM,aAAa;AAE/D,WAASO,EAAa,EAAE,UAAAb,GAAU,MAAAc,KAA4C;;AAC5E,UAAMC,KAAiBC,IAAAJ,EAAU,MAAM,eAAhB,gBAAAI,EAA6BhB,GAAqDc,IACnGG,KAAsBC,IAAAN,EAAU,MAAM,oBAAhB,gBAAAM,EAAkClB,IAIxDmB,IAAY,KAAK,MAAM,KAAK,UAAUrB,EAAM,KAAK,CAAC;AACxD,IAAAsB,EAAc,EAAE,OAAOD,GAAW,gBAAAJ,GAAgB,qBAAAE,GAAqB,UAAAjB,GAAU,MAAAc,GAAM,GAEvFhB,EAAM,QAAQqB;AAAA,EAChB;AAEA,WAASC,EAAc;AAAA,IACrB,OAAAtB;AAAAA,IACA,gBAAAiB;AAAA,IACA,qBAAAE;AAAA,IACA,UAAAjB;AAAA,IACA,MAAAc;AAAA,EAAA,GAOC;AAED,UAAMO,IAAY,CAAA;AAElB,aAASC,IAAQ,GAAGA,IAAQP,EAAe,QAAQO,KAAS,GAAG;AACvD,YAAAC,IAAcR,EAAeO,CAAK;AACpC,UAAA;AACQ,QAAAD,EAAA,KAAKJ,EAAoBM,CAAW,CAAC;AAAA,cACnC;AACJ,gBAAA;AAAA,UACN,6CAA6CA,CAAW;AAAA,QAAA;AAAA,MAE5D;AAAA,IACF;AAEAzB,IAAAA,EAAM,OAAOE,CAAQ,EAAEc,CAAI,IAAIO;AAAA,EACjC;AAEA,WAASG,EAAgB,EAAE,UAAAxB,GAAU,MAAAc,KAA4C;AAC/E,UAAMW,IAAa,EAAE,GAAG3B,EAAM,MAAM,OAAO;AAE3C,IAAA4B,EAAUD,EAAWzB,CAAQ,EAAEc,CAAI,GAAGd,GAAUQ,GAAGC,CAAE,GAI/CX,EAAA,MAAM,OAAOE,CAAQ,EAAEc,CAAI,IAAIW,EAAWzB,CAAQ,EAAEc,CAAI;AAAA,EAChE;AAEO,SAAA,EAAE,cAAAD,GAAc,iBAAAW,GAAiB,WAAAb;AAE1C;"}
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
import { has as m, isObject as h } from "lodash-es";
|
|
2
|
-
import
|
|
3
|
-
function u(s,
|
|
4
|
-
const { t: o, te: e } = r({ useScope: "global" });
|
|
2
|
+
import "vue-i18n";
|
|
3
|
+
function u(s, l, o, n) {
|
|
5
4
|
if (m(s, "identifier")) {
|
|
6
|
-
const d = ["label", "info", "help", "placeholder", "add-label"],
|
|
5
|
+
const d = ["label", "info", "help", "placeholder", "add-label"], a = s.identifier;
|
|
7
6
|
for (let c = 0; c < d.length; c += 1) {
|
|
8
|
-
let
|
|
9
|
-
const
|
|
10
|
-
m(
|
|
7
|
+
let t = a;
|
|
8
|
+
const e = d[c], C = n(`message.dataupload.${l}.${a}.${e}`), f = n(`message.dataupload.${l}.${a}.${e}`, "en");
|
|
9
|
+
m(l, e) || (C ? t = o(`message.dataupload.${l}.${a}.${e}`) : f ? t = o(`message.dataupload.${l}.${a}.${e}`, "en") : t = e, !!s.$cmp && !s.$formkit && h(s.props) && s.$cmp === "SelectControlledGroup" ? s.props[e] = t : s[e] = t), s.mandatory && e === "label" && (s[e] = `${t}*`);
|
|
11
10
|
}
|
|
12
11
|
}
|
|
13
12
|
}
|
|
14
|
-
function $(s,
|
|
15
|
-
for (let
|
|
16
|
-
const
|
|
17
|
-
if (m(
|
|
18
|
-
u(
|
|
19
|
-
else if (m(
|
|
20
|
-
u(
|
|
21
|
-
const
|
|
22
|
-
for (let
|
|
23
|
-
const
|
|
24
|
-
$(
|
|
13
|
+
function $(s, l, o, n) {
|
|
14
|
+
for (let d = 0; d < s.length; d += 1) {
|
|
15
|
+
const a = s[d];
|
|
16
|
+
if (m(a, "children"))
|
|
17
|
+
u(a, l, o, n), $(a.children, l, o, n);
|
|
18
|
+
else if (m(a, "data")) {
|
|
19
|
+
u(a, l, o, n);
|
|
20
|
+
const c = Object.keys(a.data);
|
|
21
|
+
for (let t = 0; t < c.length; t += 1) {
|
|
22
|
+
const e = c[t];
|
|
23
|
+
$(a.data[e], l, o, n);
|
|
25
24
|
}
|
|
26
25
|
} else
|
|
27
|
-
u(
|
|
26
|
+
u(a, l, o, n);
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation-helper.mjs","sources":["../../../lib/data-provider-interface/utils/translation-helper.js"],"sourcesContent":["import { has, isObject } from 'lodash-es';\nimport { useI18n } from 'vue-i18n';\n\n/**\n * Translation of each translatable parameter within the given structure if a translation is available\n * @param {*} propertyDefinition Object containing parameters defining the form and their content\n * @param {String} property String defining which property translation should be used\n */\n\nfunction translateProperty(propertyDefinition, property
|
|
1
|
+
{"version":3,"file":"translation-helper.mjs","sources":["../../../lib/data-provider-interface/utils/translation-helper.js"],"sourcesContent":["import { has, isObject } from 'lodash-es';\nimport { useI18n } from 'vue-i18n';\n\n/**\n * Translation of each translatable parameter within the given structure if a translation is available\n * @param {*} propertyDefinition Object containing parameters defining the form and their content\n * @param {String} property String defining which property translation should be used\n */\n\nfunction translateProperty(propertyDefinition, property, t, te) {\n\n if (has(propertyDefinition, 'identifier')) { // hidden fields don't need a label and have no identifier\n const translatableParameters = ['label', 'info', 'help', 'placeholder', 'add-label'];\n const propertyName = propertyDefinition.identifier;\n\n for (let valueIndex = 0; valueIndex < translatableParameters.length; valueIndex += 1) {\n let translation = propertyName;\n const parameter = translatableParameters[valueIndex];\n\n const translationExsists = te(`message.dataupload.${property}.${propertyName}.${parameter}`);\n const translationExsistsEN = te(`message.dataupload.${property}.${propertyName}.${parameter}`, 'en');\n\n // Check if translation exists\n if (!has(property, parameter)) {\n if (translationExsists) {\n translation = t(`message.dataupload.${property}.${propertyName}.${parameter}`);\n } else if (translationExsistsEN) {\n translation = t(`message.dataupload.${property}.${propertyName}.${parameter}`, 'en');\n } else {\n translation = parameter;\n }\n\n const isCustomComponentWithProps = !!propertyDefinition.$cmp\n && !propertyDefinition.$formkit\n && isObject(propertyDefinition.props);\n\n const isSelectControlledGroupCustomComponent = isCustomComponentWithProps\n && propertyDefinition.$cmp === 'SelectControlledGroup';\n\n if (isSelectControlledGroupCustomComponent) {\n propertyDefinition.props[parameter] = translation;\n } else {\n propertyDefinition[parameter] = translation;\n }\n\n // if (parameter === \"info\") {\n\n // propertyDefinition['sections-schema'] = { prefix: { $el: 'div', attrs: { class: 'infoI', }, children: [{ $el: 'div', children: translation, attrs: { class: 'tooltipFormkit' } }] } }\n // }\n }\n\n // Highlight mandatory fields\n if (propertyDefinition.mandatory && parameter === \"label\") propertyDefinition[parameter] = `${translation}*`\n }\n }\n}\n\n/**\n * Recursive translation of propertie parameters including recursive translation of nested properties\n * @param {Object} schema Object containing the forms schema\n * @param {String} property String defining which property translation should be used (datasets/ distribution/ catalogues)\n */\nfunction translate(schema, property, t, te) {\n for (let index = 0; index < schema.length; index += 1) {\n const schemaPropertyValues = schema[index];\n\n // translation of group forms and their nested properties\n if (has(schemaPropertyValues, 'children')) {\n // group attributes should be translated too\n translateProperty(schemaPropertyValues, property, t, te);\n // translated nested properties\n translate(schemaPropertyValues.children, property, t, te);\n // translation of conditional forms and their nested properties\n } else if (has(schemaPropertyValues, 'data')) {\n // group attributes should be translated too\n translateProperty(schemaPropertyValues, property, t, te);\n // translate nested data\n const dataKeys = Object.keys(schemaPropertyValues.data);\n for (let keyIndex = 0; keyIndex < dataKeys.length; keyIndex += 1) {\n const currentKey = dataKeys[keyIndex];\n translate(schemaPropertyValues.data[currentKey], property, t, te);\n }\n // translation of 'normal' singular form properties\n } else {\n translateProperty(schemaPropertyValues, property, t, te);\n }\n }\n}\n\nexport default translate;\n"],"names":["translateProperty","propertyDefinition","property","t","te","has","translatableParameters","propertyName","valueIndex","translation","parameter","translationExsists","translationExsistsEN","isObject","translate","schema","index","schemaPropertyValues","dataKeys","keyIndex","currentKey"],"mappings":";;AASA,SAASA,EAAkBC,GAAoBC,GAAUC,GAAGC,GAAI;AAE5D,MAAIC,EAAIJ,GAAoB,YAAY,GAAG;AACvC,UAAMK,IAAyB,CAAC,SAAS,QAAQ,QAAQ,eAAe,WAAW,GAC7EC,IAAeN,EAAmB;AAExC,aAASO,IAAa,GAAGA,IAAaF,EAAuB,QAAQE,KAAc,GAAG;AAClF,UAAIC,IAAcF;AAClB,YAAMG,IAAYJ,EAAuBE,CAAU,GAE7CG,IAAqBP,EAAG,sBAAsBF,CAAQ,IAAIK,CAAY,IAAIG,CAAS,EAAE,GACrFE,IAAuBR,EAAG,sBAAsBF,CAAQ,IAAIK,CAAY,IAAIG,CAAS,IAAI,IAAI;AAGnG,MAAKL,EAAIH,GAAUQ,CAAS,MACpBC,IACAF,IAAcN,EAAE,sBAAsBD,CAAQ,IAAIK,CAAY,IAAIG,CAAS,EAAE,IACtEE,IACPH,IAAcN,EAAE,sBAAsBD,CAAQ,IAAIK,CAAY,IAAIG,CAAS,IAAI,IAAI,IAEnFD,IAAcC,GAGiB,CAAC,CAACT,EAAmB,QACjD,CAACA,EAAmB,YACpBY,EAASZ,EAAmB,KAAK,KAGjCA,EAAmB,SAAS,0BAG/BA,EAAmB,MAAMS,CAAS,IAAID,IAEtCR,EAAmBS,CAAS,IAAID,IAUpCR,EAAmB,aAAaS,MAAc,YAAST,EAAmBS,CAAS,IAAI,GAAGD,CAAW;AAAA,IAC5G;AAAA,EACJ;AACL;AAOA,SAASK,EAAUC,GAAQb,GAAUC,GAAGC,GAAI;AACxC,WAASY,IAAQ,GAAGA,IAAQD,EAAO,QAAQC,KAAS,GAAG;AACnD,UAAMC,IAAuBF,EAAOC,CAAK;AAGzC,QAAIX,EAAIY,GAAsB,UAAU;AAEpC,MAAAjB,EAAkBiB,GAAsBf,GAAUC,GAAGC,CAAE,GAEvDU,EAAUG,EAAqB,UAAUf,GAAUC,GAAGC,CAAE;AAAA,aAEjDC,EAAIY,GAAsB,MAAM,GAAG;AAE1C,MAAAjB,EAAkBiB,GAAsBf,GAAUC,GAAGC,CAAE;AAEvD,YAAMc,IAAW,OAAO,KAAKD,EAAqB,IAAI;AACtD,eAASE,IAAW,GAAGA,IAAWD,EAAS,QAAQC,KAAY,GAAG;AAC9D,cAAMC,IAAaF,EAASC,CAAQ;AACpC,QAAAL,EAAUG,EAAqB,KAAKG,CAAU,GAAGlB,GAAUC,GAAGC,CAAE;AAAA,MACnE;AAAA,IAEb;AACY,MAAAJ,EAAkBiB,GAAsBf,GAAUC,GAAGC,CAAE;AAAA,EAE9D;AACL;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as U, markRaw as W, computed as j, resolveComponent as v, openBlock as o, createElementBlock as r, createElementVNode as p, createVNode as T, withModifiers as q, withCtx as D, Fragment as V, renderList as $, normalizeClass as B, toDisplayString as f, createTextVNode as n, createCommentVNode as u, createBlock as P } from "vue";
|
|
2
2
|
import { mapGetters as F, mapActions as w } from "vuex";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { has as g, isNil as E, isEmpty as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useDpiStepper as
|
|
11
|
-
import { useWindowScroll as
|
|
3
|
+
import K from "jquery";
|
|
4
|
+
import R from "./PropertyChooser.vue.mjs";
|
|
5
|
+
import { has as g, isNil as E, isEmpty as z } from "lodash-es";
|
|
6
|
+
import G from "./DistributionInputPage.vue.mjs";
|
|
7
|
+
import H from "./OverviewPage.vue.mjs";
|
|
8
|
+
import N from "../components/InputPageStep.vue.mjs";
|
|
9
|
+
import Z from "../components/Navigation.vue.mjs";
|
|
10
|
+
import { useDpiStepper as J } from "../composables/useDpiStepper.mjs";
|
|
11
|
+
import { useWindowScroll as Q } from "../../external/@vueuse/core/index";
|
|
12
12
|
import "@formkit/vue";
|
|
13
|
-
import { useDpiContext as
|
|
13
|
+
import { useDpiContext as X } from "../composables/useDpiContext.mjs";
|
|
14
14
|
import "vue-router";
|
|
15
15
|
import "merge-anything";
|
|
16
16
|
import "../../configurations/config-schema/apiSchema.mjs";
|
|
@@ -24,10 +24,11 @@ import "../../configurations/config-schema/trackerSchema.mjs";
|
|
|
24
24
|
import "../../configurations/config-schema/configSchema.mjs";
|
|
25
25
|
import "../../utils/helpers.mjs";
|
|
26
26
|
import "axios";
|
|
27
|
-
import { useFormSchema as
|
|
27
|
+
import { useFormSchema as Y } from "../composables/useFormSchema.mjs";
|
|
28
|
+
import { useI18n as x } from "vue-i18n";
|
|
28
29
|
import "./InputPage.vue2.mjs";
|
|
29
|
-
import
|
|
30
|
-
const
|
|
30
|
+
import _ from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
31
|
+
const ee = U({
|
|
31
32
|
props: {
|
|
32
33
|
property: {
|
|
33
34
|
required: !0,
|
|
@@ -51,10 +52,10 @@ const Y = M({
|
|
|
51
52
|
};
|
|
52
53
|
},
|
|
53
54
|
components: {
|
|
54
|
-
InputPageStep:
|
|
55
|
-
DistributionInputPage:
|
|
56
|
-
PropertyChooser:
|
|
57
|
-
Navigation:
|
|
55
|
+
InputPageStep: N,
|
|
56
|
+
DistributionInputPage: G,
|
|
57
|
+
PropertyChooser: R,
|
|
58
|
+
Navigation: Z
|
|
58
59
|
},
|
|
59
60
|
computed: {
|
|
60
61
|
...F("auth", [
|
|
@@ -118,8 +119,8 @@ const Y = M({
|
|
|
118
119
|
}
|
|
119
120
|
), localStorage.getItem("dpi_editmode") === "false" && (this.setIsDraft(!1), this.setIsEditMode(!1)), this.saveLocalstorageValues(this.property);
|
|
120
121
|
const d = this.$store.getters["dpiStore/getRawValues"]({ property: this.property });
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
z(d) || (this.formValues = d), this.$nextTick(() => {
|
|
123
|
+
K('[data-toggle="tooltip"]').tooltip({
|
|
123
124
|
container: "body"
|
|
124
125
|
}), setTimeout(() => {
|
|
125
126
|
document.querySelectorAll(".formkitProperty h4").forEach((a, m) => {
|
|
@@ -169,7 +170,7 @@ const Y = M({
|
|
|
169
170
|
});
|
|
170
171
|
},
|
|
171
172
|
setup() {
|
|
172
|
-
const e =
|
|
173
|
+
const e = X(), {
|
|
173
174
|
steps: t,
|
|
174
175
|
activeStep: d,
|
|
175
176
|
visitedSteps: s,
|
|
@@ -178,10 +179,10 @@ const Y = M({
|
|
|
178
179
|
stepPlugin: S,
|
|
179
180
|
goToNextStep: y,
|
|
180
181
|
goToPreviousStep: I
|
|
181
|
-
} =
|
|
182
|
-
let { x: c, y:
|
|
183
|
-
|
|
184
|
-
},
|
|
182
|
+
} = J(), { t: k, te: b } = x(), { translateSchema: i, createSchema: l, getSchema: h } = Y({ t: k, te: b }), C = () => {
|
|
183
|
+
let { x: c, y: O } = Q({ behavior: "smooth" });
|
|
184
|
+
O.value = 0;
|
|
185
|
+
}, L = (c) => (t[c].errorCount > 0 || t[c].blockingCount > 0) && s.value.includes(c), A = W({ OverviewPage: H }), M = j(() => {
|
|
185
186
|
var c;
|
|
186
187
|
return !!((c = e.value.edit) != null && c.enabled);
|
|
187
188
|
});
|
|
@@ -192,39 +193,39 @@ const Y = M({
|
|
|
192
193
|
previousStep: a,
|
|
193
194
|
nextStep: m,
|
|
194
195
|
stepPlugin: S,
|
|
195
|
-
checkStepValidity:
|
|
196
|
+
checkStepValidity: L,
|
|
196
197
|
goToNextStep: y,
|
|
197
198
|
goToPreviousStep: I,
|
|
198
|
-
scrollToTop:
|
|
199
|
-
library:
|
|
200
|
-
isEditMode:
|
|
201
|
-
translateSchema:
|
|
202
|
-
createSchema:
|
|
203
|
-
getSchema:
|
|
199
|
+
scrollToTop: C,
|
|
200
|
+
library: A,
|
|
201
|
+
isEditMode: M,
|
|
202
|
+
translateSchema: i,
|
|
203
|
+
createSchema: l,
|
|
204
|
+
getSchema: h
|
|
204
205
|
};
|
|
205
206
|
}
|
|
206
|
-
}),
|
|
207
|
+
}), te = { class: "form-container" }, ie = {
|
|
207
208
|
key: 0,
|
|
208
209
|
ref: "fkInputContainer",
|
|
209
210
|
class: "inputContainer"
|
|
210
|
-
},
|
|
211
|
+
}, se = { class: "formContainer formkit position-relative" }, oe = { class: "d-flex" }, re = { class: "steps" }, ae = ["data-step-active", "data-step-valid", "onClick"], ne = { class: "stepBubbleWrap" }, le = { class: "circle stepCircle" }, pe = ["textContent"], de = {
|
|
211
212
|
key: 0,
|
|
212
213
|
class: "seperatorHorizontalStepper"
|
|
213
|
-
},
|
|
214
|
+
}, ue = {
|
|
214
215
|
key: 0,
|
|
215
216
|
class: "step inactiveStep"
|
|
216
|
-
},
|
|
217
|
+
}, me = { class: "d-flex flex-column w-100" }, ce = {
|
|
217
218
|
key: 0,
|
|
218
219
|
class: "w-100 d-flex justify-content-between"
|
|
219
|
-
},
|
|
220
|
+
}, fe = { style: { "min-width": "80%" } }, he = { key: 0 }, ve = { key: 1 }, ge = { key: 1 }, Se = {
|
|
220
221
|
key: 4,
|
|
221
222
|
class: "p-1"
|
|
222
223
|
};
|
|
223
|
-
function
|
|
224
|
+
function ye(e, t, d, s, a, m) {
|
|
224
225
|
const S = v("FormKitSchema"), y = v("DistributionInputPage"), I = v("InputPageStep"), k = v("Navigation"), b = v("FormKit");
|
|
225
|
-
return o(), r("div",
|
|
226
|
-
e.isInput ? (o(), r("div",
|
|
227
|
-
p("div",
|
|
226
|
+
return o(), r("div", te, [
|
|
227
|
+
e.isInput ? (o(), r("div", ie, [
|
|
228
|
+
p("div", se, [
|
|
228
229
|
T(b, {
|
|
229
230
|
type: "form",
|
|
230
231
|
modelValue: e.formValues,
|
|
@@ -234,47 +235,47 @@ function ve(e, t, d, s, a, m) {
|
|
|
234
235
|
id: "dpiForm",
|
|
235
236
|
onChange: t[2] || (t[2] = (i) => e.saveFormValues({ property: e.property, page: e.page, distid: e.id, values: e.formValues })),
|
|
236
237
|
onClick: t[3] || (t[3] = (i) => e.saveFormValues({ property: e.property, page: e.page, distid: e.id, values: e.formValues })),
|
|
237
|
-
onSubmit: t[4] || (t[4] =
|
|
238
|
+
onSubmit: t[4] || (t[4] = q(() => {
|
|
238
239
|
}, ["prevent"])),
|
|
239
240
|
class: "d-flex"
|
|
240
241
|
}, {
|
|
241
242
|
default: D(() => [
|
|
242
|
-
p("div",
|
|
243
|
-
p("ul",
|
|
243
|
+
p("div", oe, [
|
|
244
|
+
p("ul", re, [
|
|
244
245
|
(o(!0), r(V, null, $(e.steps, (i, l, h) => (o(), r("li", {
|
|
245
246
|
key: i,
|
|
246
|
-
class:
|
|
247
|
+
class: B(["step", { activeItem: e.activeStep === l, inactiveStep: l != e.activeStep, "has-errors": e.checkStepValidity(l) }]),
|
|
247
248
|
"data-step-active": e.activeStep === l,
|
|
248
249
|
"data-step-valid": i.valid && i.errorCount === 0,
|
|
249
250
|
onClick: (C) => {
|
|
250
251
|
e.activeStep = l, e.update(), e.scrollToTop();
|
|
251
252
|
}
|
|
252
253
|
}, [
|
|
253
|
-
p("div",
|
|
254
|
-
p("div",
|
|
254
|
+
p("div", ne, [
|
|
255
|
+
p("div", le, f(h + 1), 1),
|
|
255
256
|
t[5] || (t[5] = n()),
|
|
256
257
|
e.checkStepValidity(l) ? (o(), r("span", {
|
|
257
258
|
key: 0,
|
|
258
259
|
class: "step--errors",
|
|
259
260
|
textContent: f(i.errorCount + i.blockingCount)
|
|
260
|
-
}, null, 8,
|
|
261
|
+
}, null, 8, pe)) : u("", !0),
|
|
261
262
|
n(f(e.$t("message.dataupload.steps." + l + "Step")), 1)
|
|
262
263
|
]),
|
|
263
264
|
t[6] || (t[6] = n()),
|
|
264
|
-
h != Object.keys(e.steps).length ? (o(), r("div",
|
|
265
|
-
], 10,
|
|
265
|
+
h != Object.keys(e.steps).length ? (o(), r("div", de)) : u("", !0)
|
|
266
|
+
], 10, ae))), 128)),
|
|
266
267
|
t[8] || (t[8] = n()),
|
|
267
|
-
e.activeStep === "Overview" ? (o(), r("li",
|
|
268
|
+
e.activeStep === "Overview" ? (o(), r("li", ue, t[7] || (t[7] = [
|
|
268
269
|
p("div", { class: "circle stepCircle" }, null, -1)
|
|
269
270
|
]))) : u("", !0)
|
|
270
271
|
]),
|
|
271
272
|
t[15] || (t[15] = n()),
|
|
272
|
-
p("div",
|
|
273
|
+
p("div", me, [
|
|
273
274
|
(o(!0), r(V, null, $(e.getNavSteps(e.$env.content.dataProviderInterface.specification)[e.property], (i, l) => (o(), r("div", { key: l }, [
|
|
274
275
|
T(I, { name: i }, {
|
|
275
276
|
default: D(() => [
|
|
276
|
-
i !== "Distributions" && i !== "Overview" ? (o(), r("div",
|
|
277
|
-
p("h1",
|
|
277
|
+
i !== "Distributions" && i !== "Overview" ? (o(), r("div", ce, [
|
|
278
|
+
p("h1", fe, f(e.$t("message.dataupload.steps." + i)), 1),
|
|
278
279
|
t[9] || (t[9] = n()),
|
|
279
280
|
p("a", {
|
|
280
281
|
class: "standardButtonDPI",
|
|
@@ -282,11 +283,11 @@ function ve(e, t, d, s, a, m) {
|
|
|
282
283
|
e.dropdownCLick(), e.expandall = !e.expandall;
|
|
283
284
|
})
|
|
284
285
|
}, [
|
|
285
|
-
e.expandall ? (o(), r("span",
|
|
286
|
+
e.expandall ? (o(), r("span", he, f(e.$t("message.dataupload.info.expand")), 1)) : (o(), r("span", ve, f(e.$t("message.dataupload.info.hide")), 1))
|
|
286
287
|
])
|
|
287
288
|
])) : u("", !0),
|
|
288
289
|
t[11] || (t[11] = n()),
|
|
289
|
-
i !== "Distributions" ? (o(), r("hr",
|
|
290
|
+
i !== "Distributions" ? (o(), r("hr", ge)) : u("", !0),
|
|
290
291
|
t[12] || (t[12] = n()),
|
|
291
292
|
i !== "Distributions" ? (o(), P(S, {
|
|
292
293
|
key: 2,
|
|
@@ -300,7 +301,7 @@ function ve(e, t, d, s, a, m) {
|
|
|
300
301
|
values: e.formValues
|
|
301
302
|
}, null, 8, ["schema", "values"])) : u("", !0),
|
|
302
303
|
t[14] || (t[14] = n()),
|
|
303
|
-
i === "Mandatory" ? (o(), r("p",
|
|
304
|
+
i === "Mandatory" ? (o(), r("p", Se, [
|
|
304
305
|
t[10] || (t[10] = p("b", null, "*", -1)),
|
|
305
306
|
n(" " + f(e.$t("message.dataupload.info.mandatory")), 1)
|
|
306
307
|
])) : u("", !0)
|
|
@@ -325,8 +326,8 @@ function ve(e, t, d, s, a, m) {
|
|
|
325
326
|
], 512)) : u("", !0)
|
|
326
327
|
]);
|
|
327
328
|
}
|
|
328
|
-
const
|
|
329
|
+
const Xe = /* @__PURE__ */ _(ee, [["render", ye]]);
|
|
329
330
|
export {
|
|
330
|
-
|
|
331
|
+
Xe as default
|
|
331
332
|
};
|
|
332
333
|
//# sourceMappingURL=InputPage.vue.mjs.map
|