@projectcaluma/ember-analytics 12.11.1 → 12.12.0
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.
|
@@ -4,7 +4,16 @@
|
|
|
4
4
|
<UkSpinner @ratio={{1}} />
|
|
5
5
|
</div>
|
|
6
6
|
{{else}}
|
|
7
|
-
<
|
|
7
|
+
<UkButton
|
|
8
|
+
class="uk-button uk-button-primary uk-float-right uk-margin-small-top"
|
|
9
|
+
{{on "click" this.exportTable}}
|
|
10
|
+
>
|
|
11
|
+
{{t "caluma.analytics.preview.export"}}
|
|
12
|
+
</UkButton>
|
|
13
|
+
<table
|
|
14
|
+
class="uk-table uk-table-divider uk-table-striped"
|
|
15
|
+
id="reports-table"
|
|
16
|
+
>
|
|
8
17
|
<thead>
|
|
9
18
|
<tr>
|
|
10
19
|
{{#each this.data.value.headings as |header|}}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { action } from "@ember/object";
|
|
2
|
+
import { next } from "@ember/runloop";
|
|
1
3
|
import { inject as service } from "@ember/service";
|
|
2
4
|
import Component from "@glimmer/component";
|
|
3
5
|
import { tracked } from "@glimmer/tracking";
|
|
4
6
|
import { queryManager } from "ember-apollo-client";
|
|
5
7
|
import { task } from "ember-concurrency";
|
|
6
8
|
import { trackedTask } from "reactiveweb/ember-concurrency";
|
|
9
|
+
import * as XLSX from "xlsx";
|
|
7
10
|
|
|
8
11
|
import getAnalyticsResultsQuery from "@projectcaluma/ember-analytics/gql/queries/get-analytics-results.graphql";
|
|
9
12
|
|
|
@@ -58,4 +61,17 @@ export default class CaReportPreviewComponent extends Component {
|
|
|
58
61
|
}
|
|
59
62
|
return null;
|
|
60
63
|
}
|
|
64
|
+
|
|
65
|
+
@action
|
|
66
|
+
exportTable() {
|
|
67
|
+
next(() => {
|
|
68
|
+
const wb = XLSX.utils.table_to_book(
|
|
69
|
+
document.getElementById("reports-table"),
|
|
70
|
+
);
|
|
71
|
+
XLSX.writeFile(
|
|
72
|
+
wb,
|
|
73
|
+
`${new Date().toLocaleDateString()}_${this.args.slug}.xlsx`,
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
61
77
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@projectcaluma/ember-analytics",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.12.0",
|
|
4
4
|
"description": "Ember addon for Caluma analytics.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"ember-validated-form": "^7.0.1",
|
|
32
32
|
"graphql": "^15.8.0",
|
|
33
33
|
"reactiveweb": "^1.2.2",
|
|
34
|
-
"
|
|
34
|
+
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz",
|
|
35
|
+
"@projectcaluma/ember-core": "^12.12.0"
|
|
35
36
|
},
|
|
36
37
|
"//": [
|
|
37
38
|
"TODO: remove obsolete dependency to `ember-data` which is only necessary",
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
"sass": "1.75.0",
|
|
71
72
|
"uikit": "3.19.2",
|
|
72
73
|
"webpack": "5.91.0",
|
|
73
|
-
"@projectcaluma/ember-testing": "12.
|
|
74
|
+
"@projectcaluma/ember-testing": "12.12.0"
|
|
74
75
|
},
|
|
75
76
|
"peerDependency": {
|
|
76
77
|
"ember-engines": "^0.9.0",
|
package/translations/de.yaml
CHANGED
package/translations/en.yaml
CHANGED