diff --git a/Frontend/src/assets/tooltips/xpath/xpath1.json b/Frontend/src/assets/tooltips/xpath/xpath1.json new file mode 100644 index 0000000..5f66284 --- /dev/null +++ b/Frontend/src/assets/tooltips/xpath/xpath1.json @@ -0,0 +1,72 @@ +[ + { + "name": "Node-Set", + "entries": [ + { + "name": "last", + "description": "The last function returns a number equal to the context size from the expression evaluation context.", + "arguments": [], + "output": "number", + "examples": [ + { + "command": "last()", + "output": "blablabla" + } + ] + }, + { + "name": "position", + "description": "The position function returns a number equal to the context position from the expression evaluation context.", + "arguments": [], + "output": "number", + "examples": [ + { + "command": "position()", + "output": "blablabla" + } + ] + } + ] + }, + { + "name": "Number", + "entries": [ + { + "name": "sum", + "description": "The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.", + "arguments": [ + { + "name": "$arg", + "type": "node-set", + "description": "Data to sum" + } + ], + "output": "number", + "examples": [ + { + "command": "sum()", + "output": "blablabla" + } + ] + }, + { + "name": "floor", + "description": "The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.", + "arguments": [ + { + "name": "$arg", + "type": "number", + "description": "Data to round" + } + ], + "output": "number", + "examples": [ + { + "command": "floor(3.6)", + "output": "3" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/Frontend/src/assets/tooltips/xpath/xpath2.json b/Frontend/src/assets/tooltips/xpath/xpath2.json new file mode 100644 index 0000000..d78fb81 --- /dev/null +++ b/Frontend/src/assets/tooltips/xpath/xpath2.json @@ -0,0 +1,43 @@ +[ + { + "name": "Number", + "entries": [ + { + "name": "sum", + "description": "The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.", + "arguments": [ + { + "name": "$arg", + "type": "node-set", + "description": "Data to sum" + } + ], + "output": "number", + "examples": [ + { + "command": "sum()", + "output": "blablabla" + } + ] + }, + { + "name": "floor", + "description": "The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.", + "arguments": [ + { + "name": "$arg", + "type": "number", + "description": "Data to round" + } + ], + "output": "number", + "examples": [ + { + "command": "floor(3.6)", + "output": "3" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/Frontend/src/components/xml/tooltips/TooltipComponent.vue b/Frontend/src/components/xml/tooltips/TooltipComponent.vue index 2d8af24..179c649 100644 --- a/Frontend/src/components/xml/tooltips/TooltipComponent.vue +++ b/Frontend/src/components/xml/tooltips/TooltipComponent.vue @@ -2,8 +2,12 @@ import { ref } from 'vue'; import tooltipCategoryComponent from '@components/xml/tooltips/TooltipCategoryComponent.vue' import tooltipEntryComponent from '@components/xml/tooltips/TooltipEntryComponent.vue' + +import xpath1 from '@assets/tooltips/xpath/xpath1.json' +import xpath2 from '@assets/tooltips/xpath/xpath1.json' const areTooltipsHidden = ref(true) + function toggleTooltips() { areTooltipsHidden.value = !areTooltipsHidden.value; } @@ -16,15 +20,8 @@ function toggleTooltips() { T
o
o
l
t
i
p
s
- - - Teścik - - - - - Teścik - + +
diff --git a/Frontend/src/components/xml/tooltips/TooltipEntryComponent.vue b/Frontend/src/components/xml/tooltips/TooltipEntryComponent.vue index 04b036d..2c6edca 100644 --- a/Frontend/src/components/xml/tooltips/TooltipEntryComponent.vue +++ b/Frontend/src/components/xml/tooltips/TooltipEntryComponent.vue @@ -3,40 +3,48 @@ import { ref } from 'vue'; const isEntryHidden = ref(true) const props = defineProps({ - name: {type: String, required: true} + entryData: {type: Object, required: true} }) function toggleTooltips() { isEntryHidden.value = !isEntryHidden.value; } +function entryHasArguments() { + return props.entryData.arguments.length > 0; +} + +function entryHasExamples() { + return props.entryData.examples.length > 0; +} +