@civicactions/cmsds-open-data-components 3.2.4 → 3.2.6-alpha.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/main.js +168 -153
- package/dist/main.js.map +1 -1
- package/dist/types.d.ts +5 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1385,6 +1385,7 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
|
|
|
1385
1385
|
"datastore" + id + additionalParamsString
|
|
1386
1386
|
],
|
|
1387
1387
|
queryFn: ()=>{
|
|
1388
|
+
setCount(null);
|
|
1388
1389
|
return fetch(`${rootUrl}/datastore/query/${id}?${additionalParamsString}`).then((res)=>res.json());
|
|
1389
1390
|
},
|
|
1390
1391
|
enabled: enabled
|
|
@@ -1876,6 +1877,7 @@ const $d98f94c79ddf4e0e$var$DataTable = ({ data: data, columns: columns, setSort
|
|
|
1876
1877
|
maxWidth: cell.column.getSize()
|
|
1877
1878
|
},
|
|
1878
1879
|
className: `${classList} ${tablePadding}`,
|
|
1880
|
+
title: cell.getValue(),
|
|
1879
1881
|
children: (0, $hgUW1$flexRender)(cell.column.columnDef.cell, cell.getContext())
|
|
1880
1882
|
});
|
|
1881
1883
|
})
|
|
@@ -2074,7 +2076,7 @@ const $2ed0091f7e32d1e6$var$DataTablePageResults = ({ totalRows: totalRows, limi
|
|
|
2074
2076
|
const page = offset / limit;
|
|
2075
2077
|
const startTotal = ()=>page * limit + 1;
|
|
2076
2078
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
|
|
2077
|
-
className:
|
|
2079
|
+
className: className,
|
|
2078
2080
|
children: [
|
|
2079
2081
|
"Displaying",
|
|
2080
2082
|
" ",
|
|
@@ -2108,120 +2110,149 @@ var $2ed0091f7e32d1e6$export$2e2bcd8739ae039 = $2ed0091f7e32d1e6$var$DataTablePa
|
|
|
2108
2110
|
|
|
2109
2111
|
|
|
2110
2112
|
|
|
2111
|
-
const $6380a4a580b24362$var$DataTableHeader = ({ resource: resource, downloadURL: downloadURL, unfilteredDownloadURL: unfilteredDownloadURL, jsonUrl: jsonUrl })=>{
|
|
2112
|
-
const { limit: limit, offset: offset, count: count, conditions: conditions } = resource;
|
|
2113
|
+
const $6380a4a580b24362$var$DataTableHeader = ({ resource: resource, downloadURL: downloadURL, unfilteredDownloadURL: unfilteredDownloadURL, jsonUrl: jsonUrl, setPage: setPage })=>{
|
|
2114
|
+
const { limit: limit, offset: offset, count: count, conditions: conditions, setLimit: setLimit, setOffset: setOffset } = resource;
|
|
2113
2115
|
const intCount = count ? count : 0;
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
className: "fas fa-copy"
|
|
2147
|
-
}),
|
|
2148
|
-
" Copy link to filtered data"
|
|
2149
|
-
]
|
|
2150
|
-
})
|
|
2151
|
-
}) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
2152
|
-
"aria-disabled": true,
|
|
2153
|
-
"aria-label": "Copy link to filtered data",
|
|
2154
|
-
className: "ds-c-button ds-u-text-align--center ds-u-display--inline-block ds-l-col--12",
|
|
2155
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
2156
|
-
className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
|
|
2157
|
-
children: [
|
|
2158
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
2159
|
-
className: "fas fa-copy"
|
|
2160
|
-
}),
|
|
2161
|
-
" Copy link to filtered data"
|
|
2162
|
-
]
|
|
2163
|
-
})
|
|
2116
|
+
const rowOptions = [
|
|
2117
|
+
10,
|
|
2118
|
+
25,
|
|
2119
|
+
50,
|
|
2120
|
+
100
|
|
2121
|
+
];
|
|
2122
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2123
|
+
className: "ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--between",
|
|
2124
|
+
children: [
|
|
2125
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2126
|
+
className: "dc-c-resource-header--buttons ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end ds-l-col--12 ds-u-margin-top--2 ds-u-padding-x--0",
|
|
2127
|
+
children: [
|
|
2128
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2129
|
+
className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-margin-bottom--2",
|
|
2130
|
+
children: conditions && conditions.length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Tooltip), {
|
|
2131
|
+
onOpen: ()=>{
|
|
2132
|
+
navigator.clipboard.writeText(window.location.href);
|
|
2133
|
+
},
|
|
2134
|
+
className: "ds-c-button ds-u-text-align--center ds-u-display--inline-block ds-l-col--12",
|
|
2135
|
+
placement: "bottom",
|
|
2136
|
+
dialog: true,
|
|
2137
|
+
ariaLabel: "Copy link to filtered data",
|
|
2138
|
+
title: "Link copied to clipboard",
|
|
2139
|
+
"aria-disabled": !conditions || conditions.length === 0,
|
|
2140
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
2141
|
+
className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
|
|
2142
|
+
children: [
|
|
2143
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
2144
|
+
className: "fas fa-copy"
|
|
2145
|
+
}),
|
|
2146
|
+
" Copy link to filtered data"
|
|
2147
|
+
]
|
|
2164
2148
|
})
|
|
2165
|
-
}),
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
children:
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
" Download full dataset (CSV)"
|
|
2198
|
-
]
|
|
2199
|
-
})
|
|
2149
|
+
}) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
2150
|
+
"aria-disabled": true,
|
|
2151
|
+
"aria-label": "Copy link to filtered data",
|
|
2152
|
+
className: "ds-c-button ds-u-text-align--center ds-u-display--inline-block ds-l-col--12",
|
|
2153
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
2154
|
+
className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
|
|
2155
|
+
children: [
|
|
2156
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
2157
|
+
className: "fas fa-copy"
|
|
2158
|
+
}),
|
|
2159
|
+
" Copy link to filtered data"
|
|
2160
|
+
]
|
|
2161
|
+
})
|
|
2162
|
+
})
|
|
2163
|
+
}),
|
|
2164
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2165
|
+
className: "ds-l-col--12 ds-l-md-col--auto ds-u-padding-x--0 ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end",
|
|
2166
|
+
children: [
|
|
2167
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2168
|
+
className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-sm-margin-left--2 ds-u-margin-bottom--2",
|
|
2169
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
2170
|
+
className: "ds-u-text-align--center ds-u-font-weight--normal ds-u-font-size--base ds-u-margin-right--1 ds-u-display--inline-block ds-l-col--12",
|
|
2171
|
+
href: downloadURL,
|
|
2172
|
+
"aria-disabled": !conditions || conditions.length === 0,
|
|
2173
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
2174
|
+
className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
|
|
2175
|
+
children: [
|
|
2176
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
2177
|
+
className: "fas fa-file-csv"
|
|
2178
|
+
}),
|
|
2179
|
+
" Download filtered data (CSV)"
|
|
2180
|
+
]
|
|
2200
2181
|
})
|
|
2201
2182
|
})
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
]
|
|
2183
|
+
}),
|
|
2184
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2185
|
+
className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-sm-margin-left--2 ds-u-margin-bottom--2",
|
|
2186
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
2187
|
+
className: "ds-u-text-align--center ds-u-font-weight--normal ds-u-font-size--base ds-u-margin-right--1 ds-u-display--inline-block ds-l-col--12",
|
|
2188
|
+
href: unfilteredDownloadURL,
|
|
2189
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
2190
|
+
className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
|
|
2191
|
+
children: [
|
|
2192
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
2193
|
+
className: "fas fa-file-csv"
|
|
2194
|
+
}),
|
|
2195
|
+
" Download full dataset (CSV)"
|
|
2196
|
+
]
|
|
2197
|
+
})
|
|
2218
2198
|
})
|
|
2219
2199
|
})
|
|
2200
|
+
]
|
|
2201
|
+
}),
|
|
2202
|
+
jsonUrl && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2203
|
+
className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-margin-left--2 ds-u-margin-top--2 ds-u-sm-margin-top--0",
|
|
2204
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
2205
|
+
className: "ds-u-text-align--center ds-u-font-weight--normal ds-u-font-size--base ds-u-margin-right--1 ds-u-display--inline-block ds-l-col--12",
|
|
2206
|
+
href: jsonUrl,
|
|
2207
|
+
"aria-label": "Export to .JSON",
|
|
2208
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
2209
|
+
className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
|
|
2210
|
+
children: [
|
|
2211
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
2212
|
+
className: "fas fa-file-code"
|
|
2213
|
+
}),
|
|
2214
|
+
" Export to JSON"
|
|
2215
|
+
]
|
|
2216
|
+
})
|
|
2220
2217
|
})
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2218
|
+
})
|
|
2219
|
+
]
|
|
2220
|
+
}),
|
|
2221
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2222
|
+
className: "ds-l-col--12 ds-u-display--flex ds-u-align-items--end ds-u-flex-direction--row-reverse ds-u-sm-flex-direction--row ds-u-padding-x--0 ds-u-margin-bottom--2 ds-u-flex-wrap--wrap",
|
|
2223
|
+
children: [
|
|
2224
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2225
|
+
className: "ds-l-col--12 ds-l-sm-col--8 ds-u-padding-x--0",
|
|
2226
|
+
children: !resource.loading && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2ed0091f7e32d1e6$export$2e2bcd8739ae039), {
|
|
2227
|
+
totalRows: intCount,
|
|
2228
|
+
limit: limit,
|
|
2229
|
+
offset: offset
|
|
2230
|
+
})
|
|
2231
|
+
}),
|
|
2232
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2233
|
+
className: "ds-l-col--12 ds-l-sm-col--4 ds-u-display--flex ds-u-justify-content--end ds-u-padding-x--0",
|
|
2234
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2235
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
|
|
2236
|
+
options: rowOptions.map((row)=>({
|
|
2237
|
+
label: row.toString(),
|
|
2238
|
+
value: row
|
|
2239
|
+
})),
|
|
2240
|
+
size: "medium",
|
|
2241
|
+
label: "Rows per page:",
|
|
2242
|
+
labelClassName: "ds-u-margin-top--0",
|
|
2243
|
+
name: "datatable_rows_per_page",
|
|
2244
|
+
onChange: (e)=>{
|
|
2245
|
+
setLimit(parseInt(e.target.value));
|
|
2246
|
+
setPage(1);
|
|
2247
|
+
setOffset(0);
|
|
2248
|
+
},
|
|
2249
|
+
defaultValue: limit.toString()
|
|
2250
|
+
})
|
|
2251
|
+
})
|
|
2252
|
+
})
|
|
2253
|
+
]
|
|
2254
|
+
})
|
|
2255
|
+
]
|
|
2225
2256
|
});
|
|
2226
2257
|
};
|
|
2227
2258
|
var $6380a4a580b24362$export$2e2bcd8739ae039 = $6380a4a580b24362$var$DataTableHeader;
|
|
@@ -2637,18 +2668,12 @@ function $a35cf16d1488f54e$export$1147582dfae658c6(columns, schema) {
|
|
|
2637
2668
|
accessor: column
|
|
2638
2669
|
}));
|
|
2639
2670
|
}
|
|
2640
|
-
const $a35cf16d1488f54e$var$DatasetTable = ({ id: id, distribution: distribution, resource: resource, rootUrl: rootUrl, customColumns: customColumns = [], jsonUrl: jsonUrl })=>{
|
|
2671
|
+
const $a35cf16d1488f54e$var$DatasetTable = ({ id: id, distribution: distribution, resource: resource, rootUrl: rootUrl, customColumns: customColumns = [], jsonUrl: jsonUrl, dataDictionaryBanner: dataDictionaryBanner })=>{
|
|
2641
2672
|
const defaultPage = 1;
|
|
2642
2673
|
const defaultPageSize = 10;
|
|
2643
2674
|
const [page, setPage] = (0, $hgUW1$useState)(defaultPage);
|
|
2644
2675
|
const customColumnHeaders = (0, $7264a673914aa746$export$8049e8f40a9bdfb8)(customColumns, resource.columns, resource.schema[distribution.identifier]);
|
|
2645
2676
|
const columns = customColumnHeaders ? customColumnHeaders : $a35cf16d1488f54e$export$1147582dfae658c6(resource.columns, resource.schema[id]);
|
|
2646
|
-
const rowOptions = [
|
|
2647
|
-
10,
|
|
2648
|
-
25,
|
|
2649
|
-
50,
|
|
2650
|
-
100
|
|
2651
|
-
];
|
|
2652
2677
|
const { limit: limit, setLimit: setLimit, setOffset: setOffset } = resource;
|
|
2653
2678
|
const pageSize = limit ? limit : defaultPageSize;
|
|
2654
2679
|
const downloadURL = `${rootUrl}/datastore/query/${id}/0/download?${(0, $hgUW1$qs).stringify({
|
|
@@ -2663,11 +2688,17 @@ const $a35cf16d1488f54e$var$DatasetTable = ({ id: id, distribution: distribution
|
|
|
2663
2688
|
id: distribution.identifier,
|
|
2664
2689
|
customColumns: customColumnHeaders
|
|
2665
2690
|
}),
|
|
2691
|
+
dataDictionaryBanner && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2692
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
2693
|
+
children: 'Click on the "Data Dictionary" tab above for full column definitions'
|
|
2694
|
+
})
|
|
2695
|
+
}),
|
|
2666
2696
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $6380a4a580b24362$export$2e2bcd8739ae039), {
|
|
2667
2697
|
resource: resource,
|
|
2668
2698
|
downloadURL: downloadURL,
|
|
2669
2699
|
unfilteredDownloadURL: distribution.data.downloadURL,
|
|
2670
|
-
jsonUrl: jsonUrl
|
|
2700
|
+
jsonUrl: jsonUrl,
|
|
2701
|
+
setPage: setPage
|
|
2671
2702
|
}),
|
|
2672
2703
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2673
2704
|
className: "ds-u-border-x--1 ds-u-border-bottom--1",
|
|
@@ -2681,39 +2712,21 @@ const $a35cf16d1488f54e$var$DatasetTable = ({ id: id, distribution: distribution
|
|
|
2681
2712
|
loading: resource.loading
|
|
2682
2713
|
})
|
|
2683
2714
|
}),
|
|
2684
|
-
!resource.loading && /*#__PURE__*/ (0, $hgUW1$
|
|
2715
|
+
!resource.loading && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2685
2716
|
className: "ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end ds-u-md-justify-content--between ds-u-margin-top--2 ds-u-align-items--center",
|
|
2686
|
-
children:
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
}),
|
|
2700
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
|
|
2701
|
-
options: rowOptions.map((row)=>({
|
|
2702
|
-
label: row.toString(),
|
|
2703
|
-
value: row
|
|
2704
|
-
})),
|
|
2705
|
-
size: "medium",
|
|
2706
|
-
label: "Rows per page:",
|
|
2707
|
-
labelClassName: "ds-u-margin-top--0",
|
|
2708
|
-
name: "datatable_rows_per_page",
|
|
2709
|
-
onChange: (e)=>{
|
|
2710
|
-
setLimit(parseInt(e.target.value));
|
|
2711
|
-
setPage(1);
|
|
2712
|
-
setOffset(0);
|
|
2713
|
-
},
|
|
2714
|
-
defaultValue: limit.toString()
|
|
2715
|
-
})
|
|
2716
|
-
]
|
|
2717
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Pagination), {
|
|
2718
|
+
totalPages: Math.ceil(resource.count ? resource.count / pageSize : 1),
|
|
2719
|
+
currentPage: page,
|
|
2720
|
+
onPageChange: (evt, page)=>{
|
|
2721
|
+
evt.preventDefault();
|
|
2722
|
+
setOffset((page - 1) * limit);
|
|
2723
|
+
setPage(page);
|
|
2724
|
+
},
|
|
2725
|
+
renderHref: (page)=>{
|
|
2726
|
+
return "";
|
|
2727
|
+
},
|
|
2728
|
+
className: "ds-l-col--12 ds-u-padding-x--0"
|
|
2729
|
+
})
|
|
2717
2730
|
})
|
|
2718
2731
|
]
|
|
2719
2732
|
});
|
|
@@ -3524,7 +3537,7 @@ const $a0f13962e513caa1$var$getDataDictionary = (dataDictionaryUrl, additionalPa
|
|
|
3524
3537
|
dataDictionaryLoading: isPending
|
|
3525
3538
|
};
|
|
3526
3539
|
};
|
|
3527
|
-
const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalParams: additionalParams, customColumns: customColumns, setDatasetTitle: setDatasetTitle, customMetadataMapping: customMetadataMapping, apiPageUrl: apiPageUrl = "/api", dataDictionaryUrl: dataDictionaryUrl, borderlessTabs: borderlessTabs = false, defaultPageSize: defaultPageSize = 25, dataDictionaryCSV: dataDictionaryCSV = false })=>{
|
|
3540
|
+
const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalParams: additionalParams, customColumns: customColumns, setDatasetTitle: setDatasetTitle, customMetadataMapping: customMetadataMapping, apiPageUrl: apiPageUrl = "/api", dataDictionaryUrl: dataDictionaryUrl, borderlessTabs: borderlessTabs = false, defaultPageSize: defaultPageSize = 25, dataDictionaryCSV: dataDictionaryCSV = false, dataDictionaryBanner: dataDictionaryBanner = false })=>{
|
|
3528
3541
|
const options = location.search ? {
|
|
3529
3542
|
...(0, $hgUW1$qs).parse(location.search, {
|
|
3530
3543
|
ignoreQueryPrefix: true
|
|
@@ -3608,6 +3621,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
|
|
|
3608
3621
|
distribution,
|
|
3609
3622
|
window.location.hash
|
|
3610
3623
|
]);
|
|
3624
|
+
const displayDataDictionaryTab = distribution.data && distribution.data.describedBy && distribution.data.describedByType === "application/vnd.tableschema+json" || datasetSitewideDictionary && datasetSitewideDictionary.length > 0;
|
|
3611
3625
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
|
|
3612
3626
|
children: dataset.error ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $026cb986f9fea2b1$export$2e2bcd8739ae039), {
|
|
3613
3627
|
content: notFoundContent,
|
|
@@ -3678,7 +3692,8 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
|
|
|
3678
3692
|
distribution: distribution,
|
|
3679
3693
|
resource: resource,
|
|
3680
3694
|
rootUrl: rootUrl,
|
|
3681
|
-
customColumns: customColumns
|
|
3695
|
+
customColumns: customColumns,
|
|
3696
|
+
dataDictionaryBanner: dataDictionaryBanner && displayDataDictionaryTab
|
|
3682
3697
|
})
|
|
3683
3698
|
}),
|
|
3684
3699
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
@@ -3700,7 +3715,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
|
|
|
3700
3715
|
metadataMapping: metadataMapping
|
|
3701
3716
|
})
|
|
3702
3717
|
}),
|
|
3703
|
-
|
|
3718
|
+
displayDataDictionaryTab && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
3704
3719
|
id: "data-dictionary",
|
|
3705
3720
|
tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3706
3721
|
className: "ds-u-color--primary",
|
|
@@ -3719,7 +3734,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
|
|
|
3719
3734
|
additionalParams: additionalParams,
|
|
3720
3735
|
csvDownload: dataDictionaryCSV
|
|
3721
3736
|
})
|
|
3722
|
-
})
|
|
3737
|
+
}),
|
|
3723
3738
|
distribution && distribution.data && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
3724
3739
|
id: "api",
|
|
3725
3740
|
tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
@@ -5288,7 +5303,7 @@ const $af099c546cb226c7$var$ResourceHeader = ({ setTablePadding: setTablePadding
|
|
|
5288
5303
|
className: "ds-l-col--12 ds-u-display--flex ds-u-justify-content--between ds-u-align-items--center",
|
|
5289
5304
|
children: [
|
|
5290
5305
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
5291
|
-
className: "ds-u-font-weight--bold",
|
|
5306
|
+
className: "ds-u-font-weight--bold ds-u-margin-bottom--2",
|
|
5292
5307
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2ed0091f7e32d1e6$export$2e2bcd8739ae039), {
|
|
5293
5308
|
totalRows: parseInt(intCount),
|
|
5294
5309
|
limit: parseInt(limit),
|