@konfuzio/document-validation-ui 0.1.46 → 0.1.47-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/app.css +1 -1
- package/dist/index.html +1 -1
- package/dist/js/app.js +1 -1
- package/dist/js/app.js.map +1 -1
- package/package.json +1 -1
- package/src/components/DocumentPage/DocumentPage.vue +17 -4
- package/src/store/document.js +3 -1
package/package.json
CHANGED
|
@@ -83,7 +83,10 @@
|
|
|
83
83
|
:key="`label${annotation.id}`"
|
|
84
84
|
:config="{
|
|
85
85
|
listening: false,
|
|
86
|
-
...annotationLabelRect(
|
|
86
|
+
...annotationLabelRect(
|
|
87
|
+
bbox,
|
|
88
|
+
labelOfAnnotation(annotation).name
|
|
89
|
+
),
|
|
87
90
|
}"
|
|
88
91
|
>
|
|
89
92
|
<v-tag
|
|
@@ -150,7 +153,10 @@
|
|
|
150
153
|
:key="`label${documentAnnotationSelected.id}`"
|
|
151
154
|
:config="{
|
|
152
155
|
listening: false,
|
|
153
|
-
...annotationLabelRect(
|
|
156
|
+
...annotationLabelRect(
|
|
157
|
+
documentAnnotationSelected.span,
|
|
158
|
+
documentAnnotationSelected.labelName
|
|
159
|
+
),
|
|
154
160
|
}"
|
|
155
161
|
>
|
|
156
162
|
<v-tag
|
|
@@ -683,10 +689,17 @@ export default {
|
|
|
683
689
|
/**
|
|
684
690
|
* Builds the konva config object for the annotation label.
|
|
685
691
|
*/
|
|
686
|
-
annotationLabelRect(bbox) {
|
|
692
|
+
annotationLabelRect(bbox, labelName) {
|
|
687
693
|
const rect = this.bboxToRect(this.page, bbox, true);
|
|
694
|
+
|
|
695
|
+
// calculations to check if label name will go off document
|
|
696
|
+
const calculatedX =
|
|
697
|
+
rect.x + labelName.length * 5.4 < this.scaledViewport.width
|
|
698
|
+
? rect.x
|
|
699
|
+
: this.scaledViewport.width - labelName.length * 5.4;
|
|
700
|
+
|
|
688
701
|
return {
|
|
689
|
-
x:
|
|
702
|
+
x: calculatedX,
|
|
690
703
|
y: rect.y,
|
|
691
704
|
};
|
|
692
705
|
},
|
package/src/store/document.js
CHANGED
|
@@ -1172,7 +1172,9 @@ const actions = {
|
|
|
1172
1172
|
|
|
1173
1173
|
// Get document set data
|
|
1174
1174
|
fetchDocumentSet: ({ commit, state }, documentSetId) => {
|
|
1175
|
-
return HTTP.get(
|
|
1175
|
+
return HTTP.get(
|
|
1176
|
+
`document-sets/${documentSetId}/?expand=documents&fields=documents.id,documents.data_file_name,documents.category`
|
|
1177
|
+
)
|
|
1176
1178
|
.then((response) => {
|
|
1177
1179
|
commit("SET_DOC_SET", response.data);
|
|
1178
1180
|
})
|