Add export functionality to Sensors page

- Create TableToolbarExport component to be used as a slot
  in TableToolbar
- Allows selected table items to be exported

Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I929347e046af8a5d5188e4c4fd9fc874e067cce5
diff --git a/src/components/Global/TableToolbarExport.vue b/src/components/Global/TableToolbarExport.vue
new file mode 100644
index 0000000..ed1d980
--- /dev/null
+++ b/src/components/Global/TableToolbarExport.vue
@@ -0,0 +1,35 @@
+<template>
+  <b-link
+    class="btn btn-primary d-block align-self-center"
+    :download="download"
+    :href="href"
+  >
+    {{ $t('global.action.export') }}
+  </b-link>
+</template>
+
+<script>
+export default {
+  props: {
+    data: {
+      type: Array,
+      default: () => []
+    },
+    fileName: {
+      type: String,
+      default: 'data'
+    }
+  },
+  computed: {
+    dataForExport() {
+      return JSON.stringify(this.data);
+    },
+    download() {
+      return `${this.fileName}.json`;
+    },
+    href() {
+      return `data:text/json;charset=utf-8,${this.dataForExport}`;
+    }
+  }
+};
+</script>