@politicalwatch/tipi-uikit 1.9.11 → 1.9.12

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": "@politicalwatch/tipi-uikit",
3
- "version": "1.9.11",
3
+ "version": "1.9.12",
4
4
  "main": "src/components/index.js",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -32,6 +32,8 @@
32
32
  v-else
33
33
  :data="csvItems"
34
34
  :fields="csvFields"
35
+ :escapeCsv="false"
36
+ :meta="json_meta"
35
37
  :name="getNameFromCSV()"
36
38
  id="downloadCSV"
37
39
  type="csv"
@@ -73,14 +75,32 @@ const props = defineProps({
73
75
  csvFields: {
74
76
  type: Object,
75
77
  default: () => ({
76
- title: 'title',
78
+ title: {
79
+ field: 'title',
80
+ callback: (value) => `"${value.replace(/\n/g, ' ')}"`,
81
+ },
77
82
  reference: 'reference',
78
83
  initiative_type_alt: 'initiative_type_alt',
79
- authors: 'authors',
80
- deputies: 'deputies',
81
- topics: 'topics',
82
- tags: 'tags',
83
- place: 'place',
84
+ authors: {
85
+ field: 'authors',
86
+ callback: (value) => `"${value.join('; ').replace(/\n/g, ' ')}"`,
87
+ },
88
+ deputies: {
89
+ field: 'deputies',
90
+ callback: (value) => `"${value.join('; ').replace(/\n/g, ' ')}"`,
91
+ },
92
+ topics: {
93
+ field: 'topics',
94
+ callback: (value) => `"${value.replace(/\n/g, ' ')}"`,
95
+ },
96
+ tags: {
97
+ field: 'tags',
98
+ callback: (value) => `"${value.replace(/\n/g, ' ')}"`,
99
+ },
100
+ place: {
101
+ field: 'place',
102
+ callback: (value) => `"${value.replace(/\n/g, ' ')}"`,
103
+ },
84
104
  status: 'status',
85
105
  created: 'created',
86
106
  updated: 'updated',
@@ -100,6 +120,15 @@ const { initiatives, csvItems, canDownloadCSV, csvFields, label, buttonClass } =
100
120
 
101
121
  const emit = defineEmits(['loadCSVItems']);
102
122
 
123
+ const json_meta = [
124
+ [
125
+ {
126
+ key: 'charset',
127
+ value: 'utf-8',
128
+ },
129
+ ],
130
+ ];
131
+
103
132
  const loadCSVItems = (event) => {
104
133
  emit('loadCSVItems', event);
105
134
  };