@konfuzio/document-validation-ui 0.1.26-dev.3 → 0.1.26-dev.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konfuzio/document-validation-ui",
3
- "version": "0.1.26-dev.3",
3
+ "version": "0.1.26-dev.4",
4
4
  "repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
@@ -501,6 +501,12 @@
501
501
  }
502
502
  }
503
503
 
504
+ .button-icon {
505
+ height: 24px;
506
+ width: 24px;
507
+ padding: 6px;
508
+ }
509
+
504
510
  .accept-decline-container {
505
511
  padding-right: 14px;
506
512
  display: flex;
@@ -20,7 +20,10 @@
20
20
  type="is-primary"
21
21
  @click.stop="save"
22
22
  >
23
- {{ $t("save") }}
23
+ <span v-if="showText">{{ $t("save") }}</span>
24
+ <b-tooltip v-else position="is-left" :label="$t('save')">
25
+ <b-icon icon="floppy-disk" size="small" class="button-icon" />
26
+ </b-tooltip>
24
27
  </b-button>
25
28
 
26
29
  <!-- cancel button -->
@@ -57,14 +60,20 @@
57
60
  class="missing-button-container"
58
61
  >
59
62
  <b-button type="is-ghost" class="missing-btn" @click.stop="markAsMissing">
60
- {{ $t("missing_annotation") }}
63
+ <span v-if="showText">{{ $t("missing_annotation") }}</span>
64
+ <b-tooltip v-else position="is-left" :label="$t('missing_annotation')">
65
+ <b-icon icon="xmark" size="small" class="button-icon" />
66
+ </b-tooltip>
61
67
  </b-button>
62
68
  <b-button
63
69
  type="is-ghost"
64
70
  class="search-btn"
65
71
  @click.stop="searchInDocument"
66
72
  >
67
- {{ $t("search_in_document") }}
73
+ <span v-if="showText">{{ $t("search_in_document") }}</span>
74
+ <b-tooltip v-else position="is-left" :label="$t('search_in_document')">
75
+ <b-icon icon="search" size="small" class="button-icon" />
76
+ </b-tooltip>
68
77
  </b-button>
69
78
  </div>
70
79
 
@@ -75,7 +84,10 @@
75
84
  type="is-primary"
76
85
  @click.stop="restore"
77
86
  >
78
- {{ $t("restore") }}
87
+ <span v-if="showText">{{ $t("restore") }}</span>
88
+ <b-tooltip v-else position="is-left" :label="$t('restore')">
89
+ <b-icon icon="trash-arrow-up" size="small" class="button-icon" />
90
+ </b-tooltip>
79
91
  </b-button>
80
92
  </div>
81
93
  </template>
@@ -83,6 +95,7 @@
83
95
  /* Component for showing actions for each annotation row */
84
96
  import { mapGetters, mapState } from "vuex";
85
97
  import AcceptedCheckMark from "../../assets/images/AcceptedCheckMark";
98
+ import { TEXT_BREAKPOINT_WIDTH } from "../../constants";
86
99
  export default {
87
100
  name: "AnnotationActionButtons",
88
101
  components: {
@@ -116,6 +129,11 @@ export default {
116
129
  required: false,
117
130
  },
118
131
  },
132
+ data() {
133
+ return {
134
+ showText: window.innerWidth > TEXT_BREAKPOINT_WIDTH,
135
+ };
136
+ },
119
137
  computed: {
120
138
  ...mapState("document", ["publicView", "missingAnnotations"]),
121
139
  ...mapGetters("document", ["isDocumentReviewed"]),
@@ -129,7 +147,17 @@ export default {
129
147
  );
130
148
  },
131
149
  },
150
+ created() {
151
+ window.addEventListener("resize", this.resize);
152
+ },
153
+
154
+ destroyed() {
155
+ window.removeEventListener("resize", this.resize);
156
+ },
132
157
  methods: {
158
+ resize() {
159
+ this.showText = window.innerWidth > TEXT_BREAKPOINT_WIDTH;
160
+ },
133
161
  save() {
134
162
  this.$emit("save");
135
163
  },
package/src/constants.js CHANGED
@@ -2,4 +2,5 @@ export const PIXEL_RATIO = window.devicePixelRatio || 1;
2
2
  export const VIEWPORT_RATIO = 0.98;
3
3
  export const MINIMUM_APP_WIDTH = 600;
4
4
  export const MINIMUM_OPTIMIZED_APP_WIDTH = 950;
5
+ export const TEXT_BREAKPOINT_WIDTH = 1350;
5
6
  export const MULTI_ANN_TABLE_FEATURE = false;
package/src/icons.js CHANGED
@@ -19,6 +19,8 @@ import {
19
19
  faArrowRight,
20
20
  faDownload,
21
21
  faSearch,
22
+ faTrashArrowUp,
23
+ faFloppyDisk,
22
24
  } from "@fortawesome/free-solid-svg-icons";
23
25
  import { FontAwesomeIcon as Icons } from "@fortawesome/vue-fontawesome";
24
26
 
@@ -41,7 +43,9 @@ library.add(
41
43
  faArrowLeft,
42
44
  faArrowRight,
43
45
  faDownload,
44
- faSearch
46
+ faSearch,
47
+ faTrashArrowUp,
48
+ faFloppyDisk
45
49
  );
46
50
 
47
51
  export default Icons;