@datagouv/components-next 0.2.0 → 1.0.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.
Files changed (155) hide show
  1. package/README.md +1 -1
  2. package/assets/main.css +49 -22
  3. package/dist/Control-BNCDn-8E.js +148 -0
  4. package/dist/{Datafair.client-x39O4yfF.js → Datafair.client-B5lBpOl8.js} +2 -2
  5. package/dist/Event-BOgJUhNR.js +738 -0
  6. package/dist/Image-BN-4XkIn.js +247 -0
  7. package/dist/{JsonPreview.client-BMsC5JcY.js → JsonPreview.client-Doz1Z0BS.js} +23 -23
  8. package/dist/Map-BdT3i2C4.js +7609 -0
  9. package/dist/MapContainer.client-oiieO8H-.js +105 -0
  10. package/dist/OSM-CamriM9b.js +71 -0
  11. package/dist/PdfPreview.client-CdAhkDFJ.js +14513 -0
  12. package/dist/{Pmtiles.client-BaiIo4VZ.js → Pmtiles.client-B0v8tGJQ.js} +3 -3
  13. package/dist/ScaleLine-BiesrgOv.js +165 -0
  14. package/dist/Swagger.client-CsK65JnG.js +4 -0
  15. package/dist/Tile-DCuqwNOI.js +1206 -0
  16. package/dist/TileImage-CmZf8EdU.js +1067 -0
  17. package/dist/View-DcDc7N2K.js +2858 -0
  18. package/dist/{XmlPreview.client-CAdN0w_Y.js → XmlPreview.client-CrjHf74q.js} +17 -17
  19. package/dist/common-C4rDcQpp.js +243 -0
  20. package/dist/components-next.css +1 -1
  21. package/dist/components-next.js +158 -117
  22. package/dist/components.css +1 -1
  23. package/dist/{MapContainer.client-DeSo8EvG.js → index-Bbu9rOHt.js} +4975 -21416
  24. package/dist/leaflet-src-7m1mB8LI.js +6338 -0
  25. package/dist/{main-Dgri3TQL.js → main-CiH8ZmBI.js} +56973 -51462
  26. package/dist/proj-CKwYjU38.js +1569 -0
  27. package/dist/tilecoord-YW3qEH_j.js +884 -0
  28. package/dist/{vue3-xml-viewer.common-D6skc_Ai.js → vue3-xml-viewer.common-Bi_bsV6C.js} +1 -1
  29. package/package.json +6 -2
  30. package/src/components/ActivityList/ActivityList.vue +6 -2
  31. package/src/components/AppLink.vue +4 -1
  32. package/src/components/Avatar.vue +2 -2
  33. package/src/components/AvatarWithName.vue +8 -4
  34. package/src/components/BouncingDots.vue +21 -0
  35. package/src/components/BrandedButton.vue +2 -0
  36. package/src/components/CopyButton.vue +19 -7
  37. package/src/components/DataserviceCard.vue +85 -120
  38. package/src/components/DatasetCard.vue +110 -171
  39. package/src/components/DatasetInformation/DatasetEmbedSection.vue +43 -0
  40. package/src/components/DatasetInformation/DatasetInformationSection.vue +73 -0
  41. package/src/components/DatasetInformation/DatasetSchemaSection.vue +74 -0
  42. package/src/components/DatasetInformation/DatasetSpatialSection.vue +59 -0
  43. package/src/components/DatasetInformation/DatasetTemporalitySection.vue +45 -0
  44. package/src/components/DatasetInformation/index.ts +5 -0
  45. package/src/components/DatasetQuality.vue +23 -16
  46. package/src/components/DatasetQualityInline.vue +13 -17
  47. package/src/components/DatasetQualityScore.vue +12 -15
  48. package/src/components/DatasetQualityTooltipContent.vue +3 -3
  49. package/src/components/DescriptionList.vue +1 -4
  50. package/src/components/DescriptionListDetails.vue +5 -0
  51. package/src/components/DescriptionListTerm.vue +5 -0
  52. package/src/components/DiscussionMessageCard.vue +63 -0
  53. package/src/components/ExtraAccordion.vue +4 -4
  54. package/src/components/Form/BadgeSelect.vue +35 -0
  55. package/src/components/Form/FormatSelect.vue +28 -0
  56. package/src/components/Form/GeozoneSelect.vue +52 -0
  57. package/src/components/Form/GranularitySelect.vue +29 -0
  58. package/src/components/Form/LicenseSelect.vue +30 -0
  59. package/src/components/Form/OrganizationSelect.vue +62 -0
  60. package/src/components/Form/OrganizationTypeSelect.vue +34 -0
  61. package/src/components/Form/ReuseTopicSelect.vue +29 -0
  62. package/src/components/Form/SchemaSelect.vue +30 -0
  63. package/src/components/Form/SearchableSelect.vue +334 -0
  64. package/src/components/Form/SelectGroup.vue +132 -0
  65. package/src/components/Form/TagSelect.vue +38 -0
  66. package/src/components/LeafletMap.vue +31 -0
  67. package/src/components/LicenseBadge.vue +24 -0
  68. package/src/components/LoadingBlock.vue +23 -2
  69. package/src/components/MarkdownViewer.vue +3 -1
  70. package/src/components/ObjectCard.vue +42 -0
  71. package/src/components/ObjectCardBadge.vue +22 -0
  72. package/src/components/ObjectCardHeader.vue +35 -0
  73. package/src/components/ObjectCardOwner.vue +43 -0
  74. package/src/components/ObjectCardShortDescription.vue +28 -0
  75. package/src/components/OrganizationCard.vue +35 -20
  76. package/src/components/OrganizationHorizontalCard.vue +87 -0
  77. package/src/components/OrganizationLogo.vue +1 -1
  78. package/src/components/OrganizationNameWithCertificate.vue +12 -6
  79. package/src/components/OwnerTypeIcon.vue +1 -0
  80. package/src/components/Pagination.vue +1 -1
  81. package/src/components/Placeholder.vue +5 -2
  82. package/src/components/PostCard.vue +62 -0
  83. package/src/components/ProgressBar.vue +31 -0
  84. package/src/components/RadioGroup.vue +32 -0
  85. package/src/components/RadioInput.vue +64 -0
  86. package/src/components/ResourceAccordion/Datafair.client.vue +1 -1
  87. package/src/components/ResourceAccordion/EditButton.vue +2 -3
  88. package/src/components/ResourceAccordion/JsonPreview.client.vue +3 -3
  89. package/src/components/ResourceAccordion/MapContainer.client.vue +21 -17
  90. package/src/components/ResourceAccordion/Metadata.vue +11 -24
  91. package/src/components/ResourceAccordion/PdfPreview.client.vue +70 -74
  92. package/src/components/ResourceAccordion/Pmtiles.client.vue +2 -2
  93. package/src/components/ResourceAccordion/Preview.vue +2 -2
  94. package/src/components/ResourceAccordion/ResourceAccordion.vue +35 -28
  95. package/src/components/ResourceAccordion/ResourceIcon.vue +1 -0
  96. package/src/components/ResourceAccordion/SchemaBadge.vue +2 -2
  97. package/src/components/ResourceAccordion/XmlPreview.client.vue +3 -3
  98. package/src/components/ResourceExplorer/ResourceExplorer.vue +243 -0
  99. package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +116 -0
  100. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +410 -0
  101. package/src/components/ReuseCard.vue +8 -28
  102. package/src/components/ReuseHorizontalCard.vue +80 -0
  103. package/src/components/Search/BasicAndAdvancedFilters.vue +49 -0
  104. package/src/components/Search/Filter/AccessTypeFilter.vue +37 -0
  105. package/src/components/Search/Filter/DatasetBadgeFilter.vue +40 -0
  106. package/src/components/Search/Filter/FilterButtonGroup.vue +78 -0
  107. package/src/components/Search/Filter/FormatFamilyFilter.vue +39 -0
  108. package/src/components/Search/Filter/LastUpdateRangeFilter.vue +37 -0
  109. package/src/components/Search/Filter/ProducerTypeFilter.vue +49 -0
  110. package/src/components/Search/Filter/ReuseTypeFilter.vue +42 -0
  111. package/src/components/Search/GlobalSearch.vue +707 -0
  112. package/src/components/Search/SearchInput.vue +63 -0
  113. package/src/components/Search/Sidemenu.vue +38 -0
  114. package/src/components/StatBox.vue +5 -5
  115. package/src/components/Tag.vue +30 -0
  116. package/src/components/Toggletip.vue +11 -4
  117. package/src/components/Tooltip.vue +2 -3
  118. package/src/components/TopicCard.vue +134 -0
  119. package/src/components/radioGroupContext.ts +9 -0
  120. package/src/composables/useDebouncedRef.ts +31 -0
  121. package/src/composables/useHasTabularData.ts +15 -0
  122. package/src/composables/useMetrics.ts +4 -3
  123. package/src/composables/useResourceCapabilities.ts +131 -0
  124. package/src/composables/useRouteQueryBoolean.ts +10 -0
  125. package/src/composables/useSelectModelSync.ts +89 -0
  126. package/src/composables/useStableQueryParams.ts +84 -0
  127. package/src/composables/useTranslation.ts +2 -1
  128. package/src/config.ts +4 -0
  129. package/src/functions/api.ts +25 -6
  130. package/src/functions/api.types.ts +5 -3
  131. package/src/functions/datasets.ts +1 -29
  132. package/src/functions/description.ts +33 -0
  133. package/src/functions/helpers.ts +11 -0
  134. package/src/functions/markdown.ts +60 -16
  135. package/src/functions/metrics.ts +33 -0
  136. package/src/functions/organizations.ts +5 -5
  137. package/src/functions/resourceCapabilities.ts +55 -0
  138. package/src/main.ts +96 -7
  139. package/src/types/dataservices.ts +14 -12
  140. package/src/types/datasets.ts +20 -7
  141. package/src/types/discussions.ts +20 -0
  142. package/src/types/licenses.ts +3 -3
  143. package/src/types/organizations.ts +13 -1
  144. package/src/types/owned.ts +4 -2
  145. package/src/types/pages.ts +70 -0
  146. package/src/types/posts.ts +27 -0
  147. package/src/types/resources.ts +16 -0
  148. package/src/types/reuses.ts +14 -5
  149. package/src/types/search.ts +407 -0
  150. package/src/types/users.ts +12 -3
  151. package/dist/PdfPreview.client-COOkEkRA.js +0 -107
  152. package/dist/Swagger.client-CpLgaLg6.js +0 -4
  153. package/dist/pdf-vue3-IkJO65RH.js +0 -273
  154. package/dist/pdf.min-f72cfa08-CdgJTooZ.js +0 -9501
  155. package/src/components/DatasetInformationPanel.vue +0 -211
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as ig, ref as rg, computed as Ol, useTemplateRef as ng, onMounted as ag, createElementBlock as Th, openBlock as nu, createBlock as sg, withCtx as wd, createVNode as Td, createElementVNode as ha, unref as La, toDisplayString as jl, createCommentVNode as og, createTextVNode as lg } from "vue";
2
- import { g as cg, u as ug, b as hg, d as pg, e as dg, f as fg, a as mg, F as gg, h as _g, i as yg, K as xg, t as vg } from "./main-Dgri3TQL.js";
2
+ import { b as cg, a as ug, c as hg, u as pg, d as dg, e as fg, _ as mg, F as gg, f as _g, h as yg, K as xg, t as vg } from "./main-CiH8ZmBI.js";
3
3
  var tn = Uint8Array, So = Uint16Array, bg = Int32Array, Dd = new tn([
4
4
  0,
5
5
  0,
@@ -22680,7 +22680,7 @@ const T_ = 8, S_ = "Bright", P_ = { "mapbox:autocomposite": !1, "mapbox:groups":
22680
22680
  }, B_ = {
22681
22681
  key: 0,
22682
22682
  class: "bg-blue-100 text-datagouv fr-hidden fr-unhidden-md p-4"
22683
- }, O_ = { class: "fr-grid-row fr-grid-row--middle fr-grid-row--gutters" }, j_ = ["innerHTML"], N_ = { class: "fr-col" }, U_ = { class: "fr-text--bold fr-m-0" }, V_ = { class: "fr-text--sm fr-m-0 f-italic" }, $_ = { class: "fr-col-auto fr-my-0" }, Z_ = {
22683
+ }, O_ = { class: "fr-grid-row fr-grid-row--middle fr-grid-row--gutters" }, j_ = ["innerHTML"], N_ = { class: "fr-col" }, U_ = { class: "fr-text--bold fr-m-0" }, V_ = { class: "fr-text--sm fr-m-0 italic" }, $_ = { class: "fr-col-auto fr-my-0" }, Z_ = {
22684
22684
  ref: "containerRef",
22685
22685
  style: { height: "600px" }
22686
22686
  }, G_ = { class: "fr-px-5v fr-pt-5v" }, ty = /* @__PURE__ */ ig({
@@ -22772,7 +22772,7 @@ const T_ = 8, S_ = "Bright", P_ = { "mapbox:autocomposite": !1, "mapbox:groups":
22772
22772
  class: "flex items-center space-x-2"
22773
22773
  }, {
22774
22774
  default: wd(() => [
22775
- Td(La(gg), { class: "shink-0 size-6" }),
22775
+ Td(La(gg), { class: "shrink-0 size-6" }),
22776
22776
  ha("span", null, jl(La(X)("L'aperçu cartographique de ce fichier n'a pas pu être chargé.")), 1)
22777
22777
  ]),
22778
22778
  _: 1
@@ -0,0 +1,165 @@
1
+ import { C as M, a as b } from "./Control-BNCDn-8E.js";
2
+ import { g as E, M as T } from "./proj-CKwYjU38.js";
3
+ const S = "units", W = [1, 2, 5], f = 25.4 / 0.28;
4
+ class y extends M {
5
+ /**
6
+ * @param {Options} [options] Scale line options.
7
+ */
8
+ constructor(e) {
9
+ e = e || {};
10
+ const i = document.createElement("div");
11
+ i.style.pointerEvents = "none", super({
12
+ element: i,
13
+ render: e.render,
14
+ target: e.target
15
+ }), this.on, this.once, this.un;
16
+ const r = e.className !== void 0 ? e.className : e.bar ? "ol-scale-bar" : "ol-scale-line";
17
+ this.innerElement_ = document.createElement("div"), this.innerElement_.className = r + "-inner", this.element.className = r + " " + b, this.element.appendChild(this.innerElement_), this.viewState_ = null, this.minWidth_ = e.minWidth !== void 0 ? e.minWidth : 64, this.maxWidth_ = e.maxWidth, this.renderedVisible_ = !1, this.renderedWidth_ = void 0, this.renderedHTML_ = "", this.addChangeListener(S, this.handleUnitsChanged_), this.setUnits(e.units || "metric"), this.scaleBar_ = e.bar || !1, this.scaleBarSteps_ = e.steps || 4, this.scaleBarText_ = e.text || !1, this.dpi_ = e.dpi || void 0;
18
+ }
19
+ /**
20
+ * Return the units to use in the scale line.
21
+ * @return {Units} The units
22
+ * to use in the scale line.
23
+ * @observable
24
+ * @api
25
+ */
26
+ getUnits() {
27
+ return this.get(S);
28
+ }
29
+ /**
30
+ * @private
31
+ */
32
+ handleUnitsChanged_() {
33
+ this.updateElement_();
34
+ }
35
+ /**
36
+ * Set the units to use in the scale line.
37
+ * @param {Units} units The units to use in the scale line.
38
+ * @observable
39
+ * @api
40
+ */
41
+ setUnits(e) {
42
+ this.set(S, e);
43
+ }
44
+ /**
45
+ * Specify the dpi of output device such as printer.
46
+ * @param {number|undefined} dpi The dpi of output device.
47
+ * @api
48
+ */
49
+ setDpi(e) {
50
+ this.dpi_ = e;
51
+ }
52
+ /**
53
+ * @private
54
+ */
55
+ updateElement_() {
56
+ const e = this.viewState_;
57
+ if (!e) {
58
+ this.renderedVisible_ && (this.element.style.display = "none", this.renderedVisible_ = !1);
59
+ return;
60
+ }
61
+ const i = e.center, r = e.projection, l = this.getUnits(), m = l == "degrees" ? "degrees" : "m";
62
+ let s = E(
63
+ r,
64
+ e.resolution,
65
+ i,
66
+ m
67
+ );
68
+ const h = this.minWidth_ * (this.dpi_ || f) / f, d = this.maxWidth_ !== void 0 ? this.maxWidth_ * (this.dpi_ || f) / f : void 0;
69
+ let n = h * s, t = "";
70
+ if (l == "degrees") {
71
+ const _ = T.degrees;
72
+ n *= _, n < _ / 60 ? (t = "″", s *= 3600) : n < _ ? (t = "′", s *= 60) : t = "°";
73
+ } else if (l == "imperial")
74
+ n < 0.9144 ? (t = "in", s /= 0.0254) : n < 1609.344 ? (t = "ft", s /= 0.3048) : (t = "mi", s /= 1609.344);
75
+ else if (l == "nautical")
76
+ s /= 1852, t = "NM";
77
+ else if (l == "metric")
78
+ n < 1e-6 ? (t = "nm", s *= 1e9) : n < 1e-3 ? (t = "μm", s *= 1e6) : n < 1 ? (t = "mm", s *= 1e3) : n < 1e3 ? t = "m" : (t = "km", s /= 1e3);
79
+ else if (l == "us")
80
+ n < 0.9144 ? (t = "in", s *= 39.37) : n < 1609.344 ? (t = "ft", s /= 0.30480061) : (t = "mi", s /= 1609.3472);
81
+ else
82
+ throw new Error("Invalid units");
83
+ let u = 3 * Math.floor(Math.log(h * s) / Math.log(10)), c, a, o, g = 0, v, x;
84
+ for (; ; ) {
85
+ o = Math.floor(u / 3);
86
+ const _ = Math.pow(10, o);
87
+ if (c = W[(u % 3 + 3) % 3] * _, a = Math.round(c / s), isNaN(a)) {
88
+ this.element.style.display = "none", this.renderedVisible_ = !1;
89
+ return;
90
+ }
91
+ if (d !== void 0 && a >= d) {
92
+ c = g, a = v, o = x;
93
+ break;
94
+ } else if (a >= h)
95
+ break;
96
+ g = c, v = a, x = o, ++u;
97
+ }
98
+ const p = this.scaleBar_ ? this.createScaleBar(a, c, t) : c.toFixed(o < 0 ? -o : 0) + " " + t;
99
+ this.renderedHTML_ != p && (this.innerElement_.innerHTML = p, this.renderedHTML_ = p), this.renderedWidth_ != a && (this.innerElement_.style.width = a + "px", this.renderedWidth_ = a), this.renderedVisible_ || (this.element.style.display = "", this.renderedVisible_ = !0);
100
+ }
101
+ /**
102
+ * @private
103
+ * @param {number} width The current width of the scalebar.
104
+ * @param {number} scale The current scale.
105
+ * @param {string} suffix The suffix to append to the scale text.
106
+ * @return {string} The stringified HTML of the scalebar.
107
+ */
108
+ createScaleBar(e, i, r) {
109
+ const l = this.getScaleForResolution(), m = l < 1 ? Math.round(1 / l).toLocaleString() + " : 1" : "1 : " + Math.round(l).toLocaleString(), s = this.scaleBarSteps_, h = e / s, d = [this.createMarker("absolute")];
110
+ for (let t = 0; t < s; ++t) {
111
+ const u = t % 2 === 0 ? "ol-scale-singlebar-odd" : "ol-scale-singlebar-even";
112
+ d.push(
113
+ `<div><div class="ol-scale-singlebar ${u}" style="width: ${h}px;"></div>` + this.createMarker("relative") + // render text every second step, except when only 2 steps
114
+ (t % 2 === 0 || s === 2 ? this.createStepText(t, e, !1, i, r) : "") + "</div>"
115
+ );
116
+ }
117
+ return d.push(this.createStepText(s, e, !0, i, r)), (this.scaleBarText_ ? `<div class="ol-scale-text" style="width: ${e}px;">` + m + "</div>" : "") + d.join("");
118
+ }
119
+ /**
120
+ * Creates a marker at given position
121
+ * @param {'absolute'|'relative'} position The position, absolute or relative
122
+ * @return {string} The stringified div containing the marker
123
+ */
124
+ createMarker(e) {
125
+ return `<div class="ol-scale-step-marker" style="position: ${e}; top: ${e === "absolute" ? 3 : -10}px;"></div>`;
126
+ }
127
+ /**
128
+ * Creates the label for a marker marker at given position
129
+ * @param {number} i The iterator
130
+ * @param {number} width The width the scalebar will currently use
131
+ * @param {boolean} isLast Flag indicating if we add the last step text
132
+ * @param {number} scale The current scale for the whole scalebar
133
+ * @param {string} suffix The suffix for the scale
134
+ * @return {string} The stringified div containing the step text
135
+ */
136
+ createStepText(e, i, r, l, m) {
137
+ const h = (e === 0 ? 0 : Math.round(l / this.scaleBarSteps_ * e * 100) / 100) + (e === 0 ? "" : " " + m), d = e === 0 ? -3 : i / this.scaleBarSteps_ * -1, n = e === 0 ? 0 : i / this.scaleBarSteps_ * 2;
138
+ return `<div class="ol-scale-step-text" style="margin-left: ${d}px;text-align: ${e === 0 ? "left" : "center"};min-width: ${n}px;left: ${r ? i + "px" : "unset"};">` + h + "</div>";
139
+ }
140
+ /**
141
+ * Returns the appropriate scale for the given resolution and units.
142
+ * @return {number} The appropriate scale.
143
+ */
144
+ getScaleForResolution() {
145
+ const e = E(
146
+ this.viewState_.projection,
147
+ this.viewState_.resolution,
148
+ this.viewState_.center,
149
+ "m"
150
+ ), i = this.dpi_ || f, r = 1e3 / 25.4;
151
+ return e * r * i;
152
+ }
153
+ /**
154
+ * Update the scale line element.
155
+ * @param {import("../MapEvent.js").default} mapEvent Map event.
156
+ * @override
157
+ */
158
+ render(e) {
159
+ const i = e.frameState;
160
+ i ? this.viewState_ = i.viewState : this.viewState_ = null, this.updateElement_();
161
+ }
162
+ }
163
+ export {
164
+ y as default
165
+ };
@@ -0,0 +1,4 @@
1
+ import { i as f } from "./main-CiH8ZmBI.js";
2
+ export {
3
+ f as default
4
+ };