@datagouv/components-next 1.0.2-dev.16 → 1.0.2-dev.160
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/README.md +7 -6
- package/assets/main.css +4 -0
- package/dist/{Control-DuZJdKV_.js → Control-B9WQxlpJ.js} +1 -1
- package/dist/{Datafair.client-BtQqFBTQ.js → Datafair.client-CTp0KeR2.js} +4 -4
- package/dist/{Event--kp8kMdJ.js → Event-iXDrp-fy.js} +31 -31
- package/dist/{Image-34hvypZI.js → Image-mNMBOofs.js} +9 -9
- package/dist/ImagePreview.client-CpOf0A1Y.js +36 -0
- package/dist/JsonPreview.client-DL3IBzvJ.js +40 -0
- package/dist/{Map-BjUnLyj8.js → Map-BfqKMw0S.js} +1739 -1599
- package/dist/{MapContainer.client-DB6p6KF8.js → MapContainer.client-DwyIXqCs.js} +38 -39
- package/dist/{OSM-s40W6sQ2.js → OSM-CcrUhItr.js} +15 -23
- package/dist/{PdfPreview.client-Dr4VcIur.js → PdfPreview.client-BoR_Mszg.js} +823 -855
- package/dist/Pmtiles.client-BpMMDkeP.js +26289 -0
- package/dist/PreviewWrapper.vue_vue_type_script_setup_true_lang-Dnz4oSUe.js +58 -0
- package/dist/{ScaleLine-KW-nXqp3.js → ScaleLine-VGQ7nkMS.js} +2 -2
- package/dist/{Tile-DbNFNPfU.js → Tile-CSpn0Ca8.js} +160 -163
- package/dist/{TileImage-BsXBxMtq.js → TileImage-CpbaEFwd.js} +143 -131
- package/dist/{View-BR92hTWP.js → View-BYBpt-AU.js} +483 -422
- package/dist/XmlPreview.client-C3Y-2Eij.js +34 -0
- package/dist/{common-PJfpC179.js → common-BoeTUnDZ.js} +52 -52
- package/dist/components-next.css +1 -52
- package/dist/components-next.js +182 -146
- package/dist/components.css +2 -2
- package/dist/{index-D3rieddI.js → index-B8gyXZY_.js} +21832 -15810
- package/dist/{leaflet-src-7m1mB8LI.js → leaflet-src-BDNw7m8K.js} +185 -187
- package/dist/main-SY-oNn1W.js +73989 -0
- package/dist/{proj-DsetBcW7.js → proj-DxGbobp7.js} +662 -626
- package/dist/{text-clamp.esm-B5kW_XMt.js → text-clamp.esm-DVseBqZZ.js} +4 -4
- package/dist/{tilecoord-Db24Px13.js → tilecoord-DvX7WWiA.js} +273 -264
- package/dist/{vue3-json-viewer-BXwup7nO.js → vue3-json-viewer-CJLQFzXZ.js} +10 -16
- package/dist/{vue3-xml-viewer.common-CJXShyPB.js → vue3-xml-viewer.common-CBGfdux9.js} +16 -16
- package/package.json +50 -36
- package/src/chart.ts +5 -0
- package/src/components/ActivityList/ActivityList.vue +3 -2
- package/src/components/Chart/ChartViewer.vue +320 -0
- package/src/components/Chart/ChartViewerWrapper.vue +182 -0
- package/src/components/DataserviceCard.vue +9 -0
- package/src/components/DataserviceQuality.vue +82 -0
- package/src/components/DataserviceQualityInline.vue +31 -0
- package/src/components/DataserviceQualityTooltipContent.vue +79 -0
- package/src/components/DatasetCard.vue +9 -4
- package/src/components/DatasetQuality.vue +11 -11
- package/src/components/DatasetQualityInline.vue +2 -2
- package/src/components/DatasetQualityTooltipContent.vue +1 -1
- package/src/components/Form/Listbox.vue +101 -0
- package/src/components/Form/SearchableSelect.vue +2 -1
- package/src/components/InfiniteLoader.vue +53 -0
- package/src/components/ObjectCardHeader.vue +11 -4
- package/src/components/OpenApiViewer/ContentTypeSelect.vue +48 -0
- package/src/components/OpenApiViewer/EndpointRequest.vue +164 -0
- package/src/components/OpenApiViewer/EndpointResponses.vue +149 -0
- package/src/components/OpenApiViewer/OpenApiViewer.vue +308 -0
- package/src/components/OpenApiViewer/SchemaPanel.vue +53 -0
- package/src/components/OpenApiViewer/SchemaTree.vue +77 -0
- package/src/components/OpenApiViewer/openapi.ts +150 -0
- package/src/components/OrganizationNameWithCertificate.vue +3 -2
- package/src/components/Pagination.vue +8 -5
- package/src/components/RadioInput.vue +7 -2
- package/src/components/ResourceAccordion/DataStructure.vue +11 -33
- package/src/components/ResourceAccordion/Downloads.vue +160 -0
- package/src/components/ResourceAccordion/ImagePreview.client.vue +48 -0
- package/src/components/ResourceAccordion/JsonPreview.client.vue +23 -104
- package/src/components/ResourceAccordion/MapContainer.client.vue +1 -3
- package/src/components/ResourceAccordion/Metadata.vue +1 -2
- package/src/components/ResourceAccordion/PdfPreview.client.vue +24 -87
- package/src/components/ResourceAccordion/Pmtiles.client.vue +3 -1
- package/src/components/ResourceAccordion/Preview.vue +11 -11
- package/src/components/ResourceAccordion/PreviewWrapper.vue +82 -0
- package/src/components/ResourceAccordion/ResourceAccordion.vue +19 -113
- package/src/components/ResourceAccordion/XmlPreview.client.vue +16 -98
- package/src/components/ResourceExplorer/ResourceExplorer.vue +22 -19
- package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +2 -2
- package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +64 -148
- package/src/components/ResourceExplorer/ResourceSelector.vue +113 -0
- package/src/components/ReuseCard.vue +14 -6
- package/src/components/ReuseDetails.vue +2 -2
- package/src/components/ReuseHorizontalCard.vue +2 -2
- package/src/components/Search/GlobalSearch.vue +219 -117
- package/src/components/Search/SearchInput.vue +5 -4
- package/src/components/TabularExplorer/TabularCell.vue +51 -0
- package/src/components/TabularExplorer/TabularCellPopover.vue +170 -0
- package/src/components/TabularExplorer/TabularExplorer.vue +1132 -0
- package/src/components/TabularExplorer/TabularFilterContent.vue +353 -0
- package/src/components/TabularExplorer/TabularFilterPopover.vue +106 -0
- package/src/components/TabularExplorer/types.ts +86 -0
- package/src/composables/useHasTabularData.ts +15 -1
- package/src/composables/useMetrics.ts +1 -1
- package/src/composables/useResourceCapabilities.ts +28 -15
- package/src/composables/useSearchFilter.ts +120 -0
- package/src/composables/useStableQueryParams.ts +38 -6
- package/src/composables/useTabularProfile.ts +70 -0
- package/src/config.ts +21 -3
- package/src/functions/activities.ts +3 -3
- package/src/functions/api.ts +20 -42
- package/src/functions/api.types.ts +1 -0
- package/src/functions/charts.ts +95 -0
- package/src/functions/datasets.ts +0 -17
- package/src/functions/dates.ts +3 -2
- package/src/functions/metrics.ts +6 -4
- package/src/functions/resources.ts +117 -1
- package/src/functions/tabular.ts +171 -0
- package/src/functions/tabularApi.ts +96 -11
- package/src/main.ts +107 -14
- package/src/types/dataservices.ts +17 -0
- package/src/types/organizations.ts +10 -0
- package/src/types/pages.ts +0 -5
- package/src/types/posts.ts +2 -2
- package/src/types/reports.ts +5 -1
- package/src/types/resources.ts +0 -1
- package/src/types/reuses.ts +12 -1
- package/src/types/search.ts +63 -1
- package/src/types/site.ts +5 -3
- package/src/types/ui.ts +2 -0
- package/src/types/users.ts +2 -1
- package/src/types/visualizations.ts +93 -0
- package/assets/swagger-themes/newspaper.css +0 -1670
- package/dist/JsonPreview.client-DojrmGyU.js +0 -72
- package/dist/Pmtiles.client-DbMjfK00.js +0 -25185
- package/dist/Swagger.client-Db_xYKJv.js +0 -4
- package/dist/XmlPreview.client-CHxSFhd7.js +0 -64
- package/dist/main-D70Xt4a7.js +0 -105854
- package/src/components/ResourceAccordion/Swagger.client.vue +0 -48
- package/src/functions/pagination.ts +0 -9
- /package/src/components/{DatasetQualityItem.vue → QualityItem.vue} +0 -0
- /package/src/components/{DatasetQualityItemWarning.vue → QualityItemWarning.vue} +0 -0
- /package/src/components/{DatasetQualityScore.vue → QualityScore.vue} +0 -0
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ app.vueApp.use(datagouv, {
|
|
|
65
65
|
`@datagouv/components` is using [TailwindCSS](https://tailwindcss.com/docs) and some [DSFR](https://www.systeme-de-design.gouv.fr/) right now. The user needs to provide the correct version of the DSFR. Concerning TailwindCSS, there are two modes:
|
|
66
66
|
|
|
67
67
|
1. If the user is using TailwindCSS, it can import a full TailwindCSS config with `@import "@datagouv/components-next/assets/main.css";`, then build the CSS via TailwindCSS CLI or Vite plugin.
|
|
68
|
-
2. If the user is not using TailwindCSS, it can import an already built CSS file with `@import '@datagouv/components-next/dist/components.css';`. Note @dev, this file should be built before publishing the package to
|
|
68
|
+
2. If the user is not using TailwindCSS, it can import an already built CSS file with `@import '@datagouv/components-next/dist/components.css';`. Note @dev, this file should be built before publishing the package to PNPM with `pnpm run css`. For more details on the [technology stack](../README.md#-technology-stack), see the main README.
|
|
69
69
|
|
|
70
70
|
### I18n
|
|
71
71
|
|
|
@@ -94,8 +94,8 @@ For general development guidelines and contributing, see the [contributing secti
|
|
|
94
94
|
This component library uses both ESLint and Prettier for code quality and formatting:
|
|
95
95
|
|
|
96
96
|
```bash
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
pnpm run lint # Lint and auto-fix ESLint issues
|
|
98
|
+
pnpm run format # Format code with Prettier
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
**Note:** Make sure to run both commands before submitting contributions to ensure consistent code style.
|
|
@@ -172,10 +172,10 @@ To make a new release, you have to :
|
|
|
172
172
|
|
|
173
173
|
### Update the version
|
|
174
174
|
|
|
175
|
-
Use the dedicated
|
|
175
|
+
Use the dedicated pnpm command, with the correct parameter :
|
|
176
176
|
|
|
177
177
|
```
|
|
178
|
-
|
|
178
|
+
pnpm version VERSION
|
|
179
179
|
```
|
|
180
180
|
|
|
181
181
|
Where VERSION is :
|
|
@@ -187,7 +187,8 @@ Additional labels for pre-release and build metadata are available as extensions
|
|
|
187
187
|
### Publish to NPM
|
|
188
188
|
|
|
189
189
|
```
|
|
190
|
-
|
|
190
|
+
pnpm login
|
|
191
|
+
pnpm run publish-stable
|
|
191
192
|
```
|
|
192
193
|
|
|
193
194
|
## 📄 License
|
package/assets/main.css
CHANGED
|
@@ -182,6 +182,10 @@
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
@layer components {
|
|
185
|
+
.input {
|
|
186
|
+
@apply block w-full rounded-t text-base leading-6 py-2 px-4 text-gray-plain bg-gray-lower! placeholder:opacity-100 placeholder:italic placeholder:text-gray-medium;
|
|
187
|
+
}
|
|
188
|
+
|
|
185
189
|
.subtitle {
|
|
186
190
|
@apply text-sm! font-bold! leading-5!;
|
|
187
191
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as l, computed as a,
|
|
2
|
-
import { a as x, _ as g } from "./main-
|
|
1
|
+
import { defineComponent as l, computed as a, openBlock as t, createElementBlock as o, createElementVNode as u, createBlock as f, withCtx as p, createTextVNode as m, toDisplayString as _, unref as h } from "vue";
|
|
2
|
+
import { a as x, _ as g } from "./main-SY-oNn1W.js";
|
|
3
3
|
const v = { class: "fr-text--xs" }, b = { key: 0 }, k = ["src"], $ = /* @__PURE__ */ l({
|
|
4
4
|
__name: "Datafair.client",
|
|
5
5
|
props: {
|
|
@@ -10,13 +10,13 @@ const v = { class: "fr-text--xs" }, b = { key: 0 }, k = ["src"], $ = /* @__PURE_
|
|
|
10
10
|
const e = c, { t: i } = x(), r = a(() => e.resource.extras.datafairOrigin || e.dataset.extras.datafairOrigin), s = a(() => e.resource.extras.datafairDatasetId || e.dataset.extras.datafairDatasetId), d = a(() => e.resource.extras.datafairEmbed), n = a(() => !r.value || !s.value ? null : `${r.value}/embed/dataset/${s.value}/${d.value}`);
|
|
11
11
|
return (D, y) => (t(), o("div", v, [
|
|
12
12
|
n.value ? (t(), o("div", b, [
|
|
13
|
-
|
|
13
|
+
u("iframe", {
|
|
14
14
|
src: n.value,
|
|
15
15
|
width: "100%",
|
|
16
16
|
height: "500px",
|
|
17
17
|
style: { "background-color": "transparent", border: "none" }
|
|
18
18
|
}, null, 8, k)
|
|
19
|
-
])) : (t(),
|
|
19
|
+
])) : (t(), f(g, { key: 1 }, {
|
|
20
20
|
default: p(() => [
|
|
21
21
|
m(_(h(i)("L'aperçu de ce fichier n'a pas pu être chargé. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
|
|
22
22
|
]),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as I } from "./common-
|
|
3
|
-
import { B as C,
|
|
4
|
-
import { c as T } from "./Image-
|
|
1
|
+
import { I as x } from "./View-BYBpt-AU.js";
|
|
2
|
+
import { a as I } from "./common-BoeTUnDZ.js";
|
|
3
|
+
import { B as C, a6 as h, al as m, u as S, l as p, E as N, i as L, a3 as P, G as Z } from "./proj-DxGbobp7.js";
|
|
4
|
+
import { c as T } from "./Image-mNMBOofs.js";
|
|
5
5
|
const n = {
|
|
6
6
|
OPACITY: "opacity",
|
|
7
7
|
VISIBLE: "visible",
|
|
@@ -16,7 +16,7 @@ const n = {
|
|
|
16
16
|
};
|
|
17
17
|
class D extends C {
|
|
18
18
|
/**
|
|
19
|
-
* @param {Options} options Layer options.
|
|
19
|
+
* @param {Options<NoInfer<Properties>>} options Layer options.
|
|
20
20
|
*/
|
|
21
21
|
constructor(e) {
|
|
22
22
|
super(), this.on, this.once, this.un, this.background_ = e.background;
|
|
@@ -313,9 +313,9 @@ const K = {
|
|
|
313
313
|
*/
|
|
314
314
|
RENDERCOMPLETE: "rendercomplete"
|
|
315
315
|
};
|
|
316
|
-
class
|
|
316
|
+
class q extends D {
|
|
317
317
|
/**
|
|
318
|
-
* @param {Options<SourceType
|
|
318
|
+
* @param {Options<SourceType, NoInfer<Properties>>} options Layer options.
|
|
319
319
|
*/
|
|
320
320
|
constructor(e) {
|
|
321
321
|
const r = Object.assign({}, e);
|
|
@@ -393,15 +393,15 @@ class G extends D {
|
|
|
393
393
|
}, 0))), this.changed();
|
|
394
394
|
}
|
|
395
395
|
/**
|
|
396
|
-
* @param {import("../pixel").Pixel} pixel Pixel.
|
|
397
|
-
* @return {Promise<Array<import("../Feature").FeatureLike>>} Promise that resolves with
|
|
396
|
+
* @param {import("../pixel.js").Pixel} pixel Pixel.
|
|
397
|
+
* @return {Promise<Array<import("../Feature.js").FeatureLike>>} Promise that resolves with
|
|
398
398
|
* an array of features.
|
|
399
399
|
*/
|
|
400
400
|
getFeatures(e) {
|
|
401
401
|
return this.renderer_ ? this.renderer_.getFeatures(e) : Promise.resolve([]);
|
|
402
402
|
}
|
|
403
403
|
/**
|
|
404
|
-
* @param {import("../pixel").Pixel} pixel Pixel.
|
|
404
|
+
* @param {import("../pixel.js").Pixel} pixel Pixel.
|
|
405
405
|
* @return {Uint8ClampedArray|Uint8Array|Float32Array|DataView|null} Pixel data.
|
|
406
406
|
*/
|
|
407
407
|
getData(e) {
|
|
@@ -600,7 +600,7 @@ const B = /^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01])
|
|
|
600
600
|
function f(t, e) {
|
|
601
601
|
return t.endsWith("%") ? Number(t.substring(0, t.length - 1)) / e : Number(t);
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function l(t) {
|
|
604
604
|
throw new Error('failed to parse "' + t + '" as color');
|
|
605
605
|
}
|
|
606
606
|
function A(t) {
|
|
@@ -615,7 +615,7 @@ function A(t) {
|
|
|
615
615
|
o !== void 0 ? h(f(o, 100), 0, 1) : 1
|
|
616
616
|
];
|
|
617
617
|
}
|
|
618
|
-
|
|
618
|
+
l(t);
|
|
619
619
|
}
|
|
620
620
|
if (t.startsWith("#")) {
|
|
621
621
|
if (F.test(t)) {
|
|
@@ -626,12 +626,12 @@ function A(t) {
|
|
|
626
626
|
}
|
|
627
627
|
return u[3] = u[3] / 255, u;
|
|
628
628
|
}
|
|
629
|
-
|
|
629
|
+
l(t);
|
|
630
630
|
}
|
|
631
631
|
const e = V();
|
|
632
632
|
e.fillStyle = "#abcdef";
|
|
633
633
|
let r = e.fillStyle;
|
|
634
|
-
e.fillStyle = t, e.fillStyle === r && (e.fillStyle = "#fedcba", r = e.fillStyle, e.fillStyle = t, e.fillStyle === r &&
|
|
634
|
+
e.fillStyle = t, e.fillStyle === r && (e.fillStyle = "#fedcba", r = e.fillStyle, e.fillStyle = t, e.fillStyle === r && l(t));
|
|
635
635
|
const s = e.fillStyle;
|
|
636
636
|
if (s.startsWith("#") || s.startsWith("rgba"))
|
|
637
637
|
return A(s);
|
|
@@ -640,9 +640,9 @@ function A(t) {
|
|
|
640
640
|
return i[3] = P(i[3] / 255, 3), i;
|
|
641
641
|
}
|
|
642
642
|
function v(t) {
|
|
643
|
-
return typeof t == "string" ? t :
|
|
643
|
+
return typeof t == "string" ? t : W(t);
|
|
644
644
|
}
|
|
645
|
-
const k = 1024,
|
|
645
|
+
const k = 1024, d = {};
|
|
646
646
|
let R = 0;
|
|
647
647
|
function J(t) {
|
|
648
648
|
if (t.length === 4)
|
|
@@ -650,10 +650,10 @@ function J(t) {
|
|
|
650
650
|
const e = t.slice();
|
|
651
651
|
return e[3] = 1, e;
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function M(t) {
|
|
654
654
|
return t > 31308e-7 ? Math.pow(t, 1 / 2.4) * 269.025 - 14.025 : t * 3294.6;
|
|
655
655
|
}
|
|
656
|
-
function
|
|
656
|
+
function E(t) {
|
|
657
657
|
return t > 0.2068965 ? Math.pow(t, 3) : (t - 4 / 29) * (108 / 841);
|
|
658
658
|
}
|
|
659
659
|
function O(t) {
|
|
@@ -672,7 +672,7 @@ function Q(t) {
|
|
|
672
672
|
];
|
|
673
673
|
}
|
|
674
674
|
function ee(t) {
|
|
675
|
-
const e = (t[0] + 16) / 116, r = t[1], s = t[2] * Math.PI / 180, i =
|
|
675
|
+
const e = (t[0] + 16) / 116, r = t[1], s = t[2] * Math.PI / 180, i = E(e), a = E(e + r / 500 * Math.cos(s)), o = E(e - r / 200 * Math.sin(s)), u = M(a * 3.021973625 - i * 1.617392459 - o * 0.404875592), c = M(a * -0.943766287 + i * 1.916279586 + o * 0.027607165), g = M(a * 0.069407491 - i * 0.22898585 + o * 1.159737864);
|
|
676
676
|
return [
|
|
677
677
|
h(u + 0.5 | 0, 0, 255),
|
|
678
678
|
h(c + 0.5 | 0, 0, 255),
|
|
@@ -683,23 +683,23 @@ function ee(t) {
|
|
|
683
683
|
function j(t) {
|
|
684
684
|
if (t === "none")
|
|
685
685
|
return U;
|
|
686
|
-
if (
|
|
687
|
-
return
|
|
686
|
+
if (d.hasOwnProperty(t))
|
|
687
|
+
return d[t];
|
|
688
688
|
if (R >= k) {
|
|
689
689
|
let r = 0;
|
|
690
|
-
for (const s in
|
|
691
|
-
(r++ & 3) === 0 && (delete
|
|
690
|
+
for (const s in d)
|
|
691
|
+
(r++ & 3) === 0 && (delete d[s], --R);
|
|
692
692
|
}
|
|
693
693
|
const e = A(t);
|
|
694
|
-
e.length !== 4 &&
|
|
694
|
+
e.length !== 4 && l(t);
|
|
695
695
|
for (const r of e)
|
|
696
|
-
isNaN(r) &&
|
|
697
|
-
return
|
|
696
|
+
isNaN(r) && l(t);
|
|
697
|
+
return d[t] = e, ++R, e;
|
|
698
698
|
}
|
|
699
699
|
function te(t) {
|
|
700
700
|
return Array.isArray(t) ? t : j(t);
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function W(t) {
|
|
703
703
|
let e = t[0];
|
|
704
704
|
e != (e | 0) && (e = e + 0.5 | 0);
|
|
705
705
|
let r = t[1];
|
|
@@ -723,16 +723,16 @@ class re extends Z {
|
|
|
723
723
|
}
|
|
724
724
|
export {
|
|
725
725
|
D as B,
|
|
726
|
-
|
|
727
|
-
G as L,
|
|
726
|
+
q as L,
|
|
728
727
|
U as N,
|
|
729
|
-
|
|
728
|
+
K as R,
|
|
730
729
|
te as a,
|
|
731
730
|
v as b,
|
|
731
|
+
re as c,
|
|
732
732
|
j as f,
|
|
733
733
|
X as i,
|
|
734
734
|
ee as l,
|
|
735
735
|
Q as r,
|
|
736
|
-
|
|
736
|
+
W as t,
|
|
737
737
|
J as w
|
|
738
738
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aD as v, E as f, ar as C, aC as h, u as R } from "./proj-DxGbobp7.js";
|
|
2
2
|
const r = typeof navigator < "u" && typeof navigator.userAgent < "u" ? navigator.userAgent.toLowerCase() : "", I = r.includes("safari") && !r.includes("chrom");
|
|
3
3
|
I && (r.includes("version/15.4") || /cpu (os|iphone os) 15_4 like mac os x/.test(r));
|
|
4
|
-
const
|
|
4
|
+
const D = r.includes("webkit") && !r.includes("edge"), L = r.includes("macintosh"), w = typeof devicePixelRatio < "u" ? devicePixelRatio : 1, y = typeof WorkerGlobalScope < "u" && typeof OffscreenCanvas < "u" && self instanceof WorkerGlobalScope, u = typeof Image < "u" && Image.prototype.decode, p = typeof createImageBitmap == "function", O = (function() {
|
|
5
5
|
let e = !1;
|
|
6
6
|
try {
|
|
7
7
|
const t = Object.defineProperty({}, "passive", {
|
|
@@ -268,7 +268,7 @@ function g(e, t) {
|
|
|
268
268
|
)
|
|
269
269
|
) : x(e);
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Y(e, t) {
|
|
272
272
|
return t && (e.src = t), e.src && u && p ? e.decode().then(() => createImageBitmap(e)).catch((n) => {
|
|
273
273
|
if (e.complete && e.width)
|
|
274
274
|
return e;
|
|
@@ -278,19 +278,19 @@ function q(e, t) {
|
|
|
278
278
|
export {
|
|
279
279
|
w as D,
|
|
280
280
|
F as I,
|
|
281
|
-
|
|
281
|
+
L as M,
|
|
282
282
|
O as P,
|
|
283
283
|
_ as T,
|
|
284
|
-
|
|
284
|
+
D as W,
|
|
285
285
|
M as a,
|
|
286
286
|
T as b,
|
|
287
287
|
m as c,
|
|
288
288
|
a as d,
|
|
289
|
-
|
|
289
|
+
Y as e,
|
|
290
290
|
P as f,
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
N as g,
|
|
292
|
+
g as h,
|
|
293
|
+
y as i,
|
|
294
294
|
G as j,
|
|
295
295
|
B as k,
|
|
296
296
|
W as l,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineComponent as T, ref as _, computed as l, openBlock as r, createElementBlock as u, createBlock as p, withCtx as f, createTextVNode as m, toDisplayString as g, unref as o } from "vue";
|
|
2
|
+
import { a as y, u as z, b as k, _ as d } from "./main-SY-oNn1W.js";
|
|
3
|
+
const w = { class: "text-xs" }, B = ["src"], E = /* @__PURE__ */ T({
|
|
4
|
+
__name: "ImagePreview.client",
|
|
5
|
+
props: {
|
|
6
|
+
resource: {}
|
|
7
|
+
},
|
|
8
|
+
setup(a) {
|
|
9
|
+
const n = a, { t } = y(), h = z(), i = _(!1), v = l(() => n.resource.format?.toUpperCase() ?? t("Fichier")), c = l(() => k(n.resource)), x = l(() => {
|
|
10
|
+
const s = c.value, e = h.maxImagePreviewByteSize;
|
|
11
|
+
return !s || !e ? !1 : s <= e;
|
|
12
|
+
});
|
|
13
|
+
return (s, e) => (r(), u("div", w, [
|
|
14
|
+
x.value ? i.value ? (r(), p(d, { key: 1 }, {
|
|
15
|
+
default: f(() => [
|
|
16
|
+
m(g(o(t)("L'aperçu de ce fichier n'a pas pu être chargé. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
|
|
17
|
+
]),
|
|
18
|
+
_: 1
|
|
19
|
+
})) : (r(), u("img", {
|
|
20
|
+
key: 2,
|
|
21
|
+
src: a.resource.url,
|
|
22
|
+
alt: "",
|
|
23
|
+
class: "block w-full h-auto max-w-[800px]",
|
|
24
|
+
onError: e[0] || (e[0] = (C) => i.value = !0)
|
|
25
|
+
}, null, 40, B)) : (r(), p(d, { key: 0 }, {
|
|
26
|
+
default: f(() => [
|
|
27
|
+
m(g(c.value ? o(t)("Le fichier {fileType} est trop volumineux pour être prévisualisé. Téléchargez-le depuis l'onglet Téléchargements.", { fileType: v.value }) : o(t)("La taille du fichier est inconnue, l'aperçu n'est pas disponible. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
|
|
28
|
+
]),
|
|
29
|
+
_: 1
|
|
30
|
+
}))
|
|
31
|
+
]));
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
E as default
|
|
36
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineComponent as c, defineAsyncComponent as u, openBlock as m, createBlock as p, unref as r, withCtx as f, createVNode as l } from "vue";
|
|
2
|
+
import { u as d } from "./main-SY-oNn1W.js";
|
|
3
|
+
import { _ as h } from "./PreviewWrapper.vue_vue_type_script_setup_true_lang-Dnz4oSUe.js";
|
|
4
|
+
const J = /* @__PURE__ */ c({
|
|
5
|
+
__name: "JsonPreview.client",
|
|
6
|
+
props: {
|
|
7
|
+
resource: {}
|
|
8
|
+
},
|
|
9
|
+
setup(o) {
|
|
10
|
+
const t = u(
|
|
11
|
+
() => import("./vue3-json-viewer-CJLQFzXZ.js").then((e) => (Promise.resolve({ }), e.JsonViewer))
|
|
12
|
+
), n = o, s = d(), i = async () => {
|
|
13
|
+
const e = await fetch(n.resource.url);
|
|
14
|
+
if (!e.ok) throw new Error(`HTTP error! status: ${e.status}`);
|
|
15
|
+
return e.json();
|
|
16
|
+
};
|
|
17
|
+
return (e, w) => (m(), p(h, {
|
|
18
|
+
"file-type": "JSON",
|
|
19
|
+
resource: o.resource,
|
|
20
|
+
"max-size": r(s).maxJsonPreviewCharSize,
|
|
21
|
+
load: i
|
|
22
|
+
}, {
|
|
23
|
+
default: f(({ data: a }) => [
|
|
24
|
+
l(r(t), {
|
|
25
|
+
value: a,
|
|
26
|
+
boxed: "",
|
|
27
|
+
sort: "",
|
|
28
|
+
theme: "light",
|
|
29
|
+
"max-depth": 3,
|
|
30
|
+
"expand-depth": 2,
|
|
31
|
+
"indent-width": 2
|
|
32
|
+
}, null, 8, ["value"])
|
|
33
|
+
]),
|
|
34
|
+
_: 1
|
|
35
|
+
}, 8, ["resource", "max-size"]));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
J as default
|
|
40
|
+
};
|