@geops/rvf-mobility-web-component 0.1.79 → 0.1.80

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.80](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.79...v0.1.80) (2025-10-31)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * order by startDate and severyity ([be8d1de](https://github.com/geops/rvf-mobility-web-component/commit/be8d1de30cacc685baee2193a6a4694b19ef99da))
11
+
5
12
  ### [0.1.79](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.78...v0.1.79) (2025-10-31)
6
13
 
7
14
 
package/index.js CHANGED
@@ -3583,7 +3583,7 @@ html {
3583
3583
  --tw-drop-shadow: initial;
3584
3584
  --tw-duration: initial;
3585
3585
  --tw-ease: initial;
3586
- }`}),W("style",{children:bA}),W("style",{children:GX}),W(JM.Provider,{value:qt,children:[W(nB,{}),W(rP,{replaceState:r1}),W(cB,{node:t.current,wcAttributes:r}),W(fP,{eventNode:t.current}),W(uP,{}),W(eB,{}),W(tB,{}),J&&W(eP,{}),g1&&W(Xy,{}),x1&&W(wA,{}),E&&W(oB,{}),E&&W(sB,{}),V&&W(tP,{}),W("div",{className:"@container/main relative size-full border font-sans",ref:t,children:W($y,{})})]})]})}var ML1=ht(bL1),jX={};Object.entries(ds).forEach(([r])=>{jX[r]=ds[r].defaultValue||null});function BL1(r){return W(ML1,{...jX,...r})}var qX=ht(BL1);function SL1(r){let[t,e]=wt(),[i,o]=wt(),[n,l]=wt(),[A,d]=wt(),L=ge(()=>({poisLayer:n,sellingPointsLayer:t,setPoisLayer:l,setSellingPointsLayer:e,setSharedMobilityLayerGroup:d,setTarifZonenLayer:o,sharedMobilityLayerGroup:A,tarifZonenLayer:i}),[n,t,A,i]);return W(OF.Provider,{value:L,children:W(qX,{...r})})}var EL1=ht(SL1),KX={};Object.entries(ds).forEach(([r])=>{KX[r]=ds[r].defaultValue||null});function TL1(r){return W(EL1,{...KX,...r})}var Jy=ht(TL1);var WX;(function(r){r.Bus="BUS",r.Cablecar="CABLECAR",r.Coach="COACH",r.Ferry="FERRY",r.Funicular="FUNICULAR",r.Gondola="GONDOLA",r.Rail="RAIL",r.Subway="SUBWAY",r.Tram="TRAM"})(WX||(WX={}));var $X;(function(r){r.Error="ERROR",r.Info="INFO",r.Permission="PERMISSION",r.Validation="VALIDATION",r.Warning="WARNING"})($X||($X={}));var XX;(function(r){r.Asc="ASC",r.AscNullsFirst="ASC_NULLS_FIRST",r.AscNullsLast="ASC_NULLS_LAST",r.Desc="DESC",r.DescNullsFirst="DESC_NULLS_FIRST",r.DescNullsLast="DESC_NULLS_LAST"})(XX||(XX={}));var YX;(function(r){r.Construction="CONSTRUCTION",r.Disruption="DISRUPTION",r.IndustrialAction="INDUSTRIAL_ACTION",r.LiftFailure="LIFT_FAILURE",r.Other="OTHER",r.RailReplacement="RAIL_REPLACEMENT",r.SpecialEvent="SPECIAL_EVENT",r.VehicleFaulure="VEHICLE_FAULURE",r.Warning="WARNING"})(YX||(YX={}));var JX;(function(r){r.AdditionalRide="ADDITIONAL_RIDE",r.AdditionalStop="ADDITIONAL_STOP",r.Boarding="BOARDING",r.ChangeOfPlatform="CHANGE_OF_PLATFORM",r.Delay="DELAY",r.DiscontinuedOperation="DISCONTINUED_OPERATION",r.Disruption="DISRUPTION",r.DisturbanceRectified="DISTURBANCE_RECTIFIED",r.Diverted="DIVERTED",r.GoToGate="GO_TO_GATE",r.IrregularTraffic="IRREGULAR_TRAFFIC",r.LimitedOperation="LIMITED_OPERATION",r.LineCancellation="LINE_CANCELLATION",r.MajorDelays="MAJOR_DELAYS",r.MinorDelays="MINOR_DELAYS",r.OnTime="ON_TIME",r.OperationTimeExtension="OPERATION_TIME_EXTENSION",r.ReplacementRide="REPLACEMENT_RIDE",r.StopCancelled="STOP_CANCELLED",r.StopMoved="STOP_MOVED",r.StopOnDemand="STOP_ON_DEMAND",r.SubstitutedStop="SUBSTITUTED_STOP",r.TemporarilyNonStopping="TEMPORARILY_NON_STOPPING",r.TemporaryStopplace="TEMPORARY_STOPPLACE",r.TrainShortened="TRAIN_SHORTENED",r.TripCancellation="TRIP_CANCELLATION",r.UndefinedStatus="UNDEFINED_STATUS",r.Unknown="UNKNOWN",r.WagonOrderChanged="WAGON_ORDER_CHANGED"})(JX||(JX={}));var tY;(function(r){r.Changes="CHANGES",r.Disruption="DISRUPTION",r.Information="INFORMATION"})(tY||(tY={}));var no;(function(r){r.Normal="NORMAL",r.NoImpact="NO_IMPACT",r.Severe="SEVERE",r.Slight="SLIGHT",r.Undefined="UNDEFINED",r.Unknown="UNKNOWN",r.VerySevere="VERY_SEVERE",r.VerySlight="VERY_SLIGHT"})(no||(no={}));var eY;(function(r){r.High="HIGH",r.Low="LOW",r.Normal="NORMAL",r.Undefined="UNDEFINED"})(eY||(eY={}));var IL1='<a href="https://developer.geops.io/">geOps API key</a>',rY='<a href="https://geops.com/en/solution/disruption-information">geOps MOCO API</a>',FL1={apikey:{defaultValue:"5cc87b12d7c5370001c1d655820abcc37dfd4d968d7bab5b2a74a935",description:`Your ${IL1}`,public:!1},lang:{defaultValue:"de",description:"The language to use for the notifications.",public:!1},notificationat:{description:"An ISO date string used to display active notification at this date in the notification layer. If not defined the current date will be used.<br/>Ex: 2025-08-01T00:00:00Z .",public:!1},notificationtenant:{defaultValue:"rvf",description:`The ${rY} tenant to get the notification from.`,public:!1},notificationurl:{defaultValue:"https://moco.geops.io/api/v2/",description:`The ${rY} url to use.`,public:!1}},MA=FL1;var iY={[no.NoImpact]:2,[no.Normal]:5,[no.Severe]:6,[no.Slight]:4,[no.Undefined]:1,[no.Unknown]:0,[no.VerySevere]:7,[no.VerySlight]:3};function PL1({apikey:r,lang:t,notificationtenant:e,notificationurl:i}){let[o,n]=wt([]);return tt(()=>{new xd({apiKey:r||void 0,tenant:e,url:i}).export({contentMedium:!0,includeGeoms:!1,includeLines:!0,includeStops:!0,publicNow:!0}).then(l=>{l?.paginatedSituations?.results&&n(l.paginatedSituations.results)}).catch(l=>{console.error(l)})},[r,i,e]),tt(()=>{wl.locale(t)},[t]),W(mc.Provider,{value:wl,children:[W("style",{children:bA}),W("div",{className:"flex w-full flex-col gap-6",children:o?.sort((l,A)=>{let d=l.affectedTimeIntervalsStart,L=A.affectedTimeIntervalsStart;if(d&&L){if(d===L){let C=l.publications.find(E=>!!E.severity)?.severity||0,B=A.publications.find(E=>!!E.severity)?.severity||0;return iY[C]>iY[B]?-1:1}return d<L?-1:1}}).map(l=>(console.log("Rendering situation",l.id,l.title),W($p,{canToggle:!0,headerClassName:"text-rvf-h3 font-semibold",iconClassName:"w-8 h-8 text-red",reasonClassName:"hidden",situation:l,timeIntervalClassName:"pl-1 text-base py-3 font-semibold text-balance",useShortMonth:!1},l.id)))})]})}var nY={};Object.entries(MA).forEach(([r])=>{nY[r]=MA[r].defaultValue||null});function RL1(r){return W(PL1,{...nY,...r})}var CP=ht(RL1);var zL1='<a href="https://developer.geops.io/">geOps API key</a>',bl='<a href="https://developer.geops.io/apis/stops">geOps Stops API</a>',DL1={apikey:{description:`Your ${zL1}`,public:!0},bbox:{description:`The extent where to search the stops (minx,miny,maxx,maxy). See the ${bl} documentation.`,public:!0},countrycode:{description:"The country code to filter the results (IT, DE, CH ...)",public:!0},event:{defaultValue:"mwc:stopssearchselect",description:"The event's name to listen to when a stop is selected.",public:!0},field:{description:`Which field to look up, default all of them, Possible values:id, name, coords. See the ${bl} documentation.`,public:!0},limit:{defaultValue:"5",description:`The number of suggestions to show. See the ${bl} documentation.`,public:!0},mots:{description:`Commas separated list of mots used to filter the results (rail, bus, coach, foot, tram, subway, gondola, funicular, ferry, car). See the ${bl} documentation.`,public:!0},onselect:{description:null,public:!1},params:{description:`JSON string with additional parameters to pass to the request to the API. Ex: {"{ 'key': 'value' }"}. See the ${bl} documentation.`,public:!0},prefagencies:{description:`comma seperated list, order chooses which agency will be preferred as
3586
+ }`}),W("style",{children:bA}),W("style",{children:GX}),W(JM.Provider,{value:qt,children:[W(nB,{}),W(rP,{replaceState:r1}),W(cB,{node:t.current,wcAttributes:r}),W(fP,{eventNode:t.current}),W(uP,{}),W(eB,{}),W(tB,{}),J&&W(eP,{}),g1&&W(Xy,{}),x1&&W(wA,{}),E&&W(oB,{}),E&&W(sB,{}),V&&W(tP,{}),W("div",{className:"@container/main relative size-full border font-sans",ref:t,children:W($y,{})})]})]})}var ML1=ht(bL1),jX={};Object.entries(ds).forEach(([r])=>{jX[r]=ds[r].defaultValue||null});function BL1(r){return W(ML1,{...jX,...r})}var qX=ht(BL1);function SL1(r){let[t,e]=wt(),[i,o]=wt(),[n,l]=wt(),[A,d]=wt(),L=ge(()=>({poisLayer:n,sellingPointsLayer:t,setPoisLayer:l,setSellingPointsLayer:e,setSharedMobilityLayerGroup:d,setTarifZonenLayer:o,sharedMobilityLayerGroup:A,tarifZonenLayer:i}),[n,t,A,i]);return W(OF.Provider,{value:L,children:W(qX,{...r})})}var EL1=ht(SL1),KX={};Object.entries(ds).forEach(([r])=>{KX[r]=ds[r].defaultValue||null});function TL1(r){return W(EL1,{...KX,...r})}var Jy=ht(TL1);var WX;(function(r){r.Bus="BUS",r.Cablecar="CABLECAR",r.Coach="COACH",r.Ferry="FERRY",r.Funicular="FUNICULAR",r.Gondola="GONDOLA",r.Rail="RAIL",r.Subway="SUBWAY",r.Tram="TRAM"})(WX||(WX={}));var $X;(function(r){r.Error="ERROR",r.Info="INFO",r.Permission="PERMISSION",r.Validation="VALIDATION",r.Warning="WARNING"})($X||($X={}));var XX;(function(r){r.Asc="ASC",r.AscNullsFirst="ASC_NULLS_FIRST",r.AscNullsLast="ASC_NULLS_LAST",r.Desc="DESC",r.DescNullsFirst="DESC_NULLS_FIRST",r.DescNullsLast="DESC_NULLS_LAST"})(XX||(XX={}));var YX;(function(r){r.Construction="CONSTRUCTION",r.Disruption="DISRUPTION",r.IndustrialAction="INDUSTRIAL_ACTION",r.LiftFailure="LIFT_FAILURE",r.Other="OTHER",r.RailReplacement="RAIL_REPLACEMENT",r.SpecialEvent="SPECIAL_EVENT",r.VehicleFaulure="VEHICLE_FAULURE",r.Warning="WARNING"})(YX||(YX={}));var JX;(function(r){r.AdditionalRide="ADDITIONAL_RIDE",r.AdditionalStop="ADDITIONAL_STOP",r.Boarding="BOARDING",r.ChangeOfPlatform="CHANGE_OF_PLATFORM",r.Delay="DELAY",r.DiscontinuedOperation="DISCONTINUED_OPERATION",r.Disruption="DISRUPTION",r.DisturbanceRectified="DISTURBANCE_RECTIFIED",r.Diverted="DIVERTED",r.GoToGate="GO_TO_GATE",r.IrregularTraffic="IRREGULAR_TRAFFIC",r.LimitedOperation="LIMITED_OPERATION",r.LineCancellation="LINE_CANCELLATION",r.MajorDelays="MAJOR_DELAYS",r.MinorDelays="MINOR_DELAYS",r.OnTime="ON_TIME",r.OperationTimeExtension="OPERATION_TIME_EXTENSION",r.ReplacementRide="REPLACEMENT_RIDE",r.StopCancelled="STOP_CANCELLED",r.StopMoved="STOP_MOVED",r.StopOnDemand="STOP_ON_DEMAND",r.SubstitutedStop="SUBSTITUTED_STOP",r.TemporarilyNonStopping="TEMPORARILY_NON_STOPPING",r.TemporaryStopplace="TEMPORARY_STOPPLACE",r.TrainShortened="TRAIN_SHORTENED",r.TripCancellation="TRIP_CANCELLATION",r.UndefinedStatus="UNDEFINED_STATUS",r.Unknown="UNKNOWN",r.WagonOrderChanged="WAGON_ORDER_CHANGED"})(JX||(JX={}));var tY;(function(r){r.Changes="CHANGES",r.Disruption="DISRUPTION",r.Information="INFORMATION"})(tY||(tY={}));var no;(function(r){r.Normal="NORMAL",r.NoImpact="NO_IMPACT",r.Severe="SEVERE",r.Slight="SLIGHT",r.Undefined="UNDEFINED",r.Unknown="UNKNOWN",r.VerySevere="VERY_SEVERE",r.VerySlight="VERY_SLIGHT"})(no||(no={}));var eY;(function(r){r.High="HIGH",r.Low="LOW",r.Normal="NORMAL",r.Undefined="UNDEFINED"})(eY||(eY={}));var IL1='<a href="https://developer.geops.io/">geOps API key</a>',rY='<a href="https://geops.com/en/solution/disruption-information">geOps MOCO API</a>',FL1={apikey:{defaultValue:"5cc87b12d7c5370001c1d655820abcc37dfd4d968d7bab5b2a74a935",description:`Your ${IL1}`,public:!1},lang:{defaultValue:"de",description:"The language to use for the notifications.",public:!1},notificationat:{description:"An ISO date string used to display active notification at this date in the notification layer. If not defined the current date will be used.<br/>Ex: 2025-08-01T00:00:00Z .",public:!1},notificationtenant:{defaultValue:"rvf",description:`The ${rY} tenant to get the notification from.`,public:!1},notificationurl:{defaultValue:"https://moco.geops.io/api/v2/",description:`The ${rY} url to use.`,public:!1}},MA=FL1;var iY={[no.NoImpact]:2,[no.Normal]:5,[no.Severe]:6,[no.Slight]:4,[no.Undefined]:1,[no.Unknown]:0,[no.VerySevere]:7,[no.VerySlight]:3};function PL1({apikey:r,lang:t,notificationtenant:e,notificationurl:i}){let[o,n]=wt([]);return tt(()=>{new xd({apiKey:r||void 0,tenant:e,url:i}).export({contentMedium:!0,includeGeoms:!1,includeLines:!0,includeStops:!0,publicNow:!0}).then(l=>{l?.paginatedSituations?.results&&n(l.paginatedSituations.results)}).catch(l=>{console.error(l)})},[r,i,e]),tt(()=>{wl.locale(t)},[t]),W(mc.Provider,{value:wl,children:[W("style",{children:bA}),W("div",{className:"flex w-full flex-col gap-6",children:o?.sort((l,A)=>{let d=l.affectedTimeIntervalsStart,L=A.affectedTimeIntervalsStart;if(d&&L){if(d.split("T")[0]===L.split("T")[0]){let C=l.publications.find(E=>!!E.severity)?.severity||0,B=A.publications.find(E=>!!E.severity)?.severity||0;return iY[C]>iY[B]?-1:1}return d<L?-1:1}if(!d)return 1;if(!L)return-1}).map(l=>(console.log("Rendering situation",l.id,l.title),W($p,{canToggle:!0,headerClassName:"text-rvf-h3 font-semibold",iconClassName:"w-8 h-8 text-red",reasonClassName:"hidden",situation:l,timeIntervalClassName:"pl-1 text-base py-3 font-semibold text-balance",useShortMonth:!1},l.id)))})]})}var nY={};Object.entries(MA).forEach(([r])=>{nY[r]=MA[r].defaultValue||null});function RL1(r){return W(PL1,{...nY,...r})}var CP=ht(RL1);var zL1='<a href="https://developer.geops.io/">geOps API key</a>',bl='<a href="https://developer.geops.io/apis/stops">geOps Stops API</a>',DL1={apikey:{description:`Your ${zL1}`,public:!0},bbox:{description:`The extent where to search the stops (minx,miny,maxx,maxy). See the ${bl} documentation.`,public:!0},countrycode:{description:"The country code to filter the results (IT, DE, CH ...)",public:!0},event:{defaultValue:"mwc:stopssearchselect",description:"The event's name to listen to when a stop is selected.",public:!0},field:{description:`Which field to look up, default all of them, Possible values:id, name, coords. See the ${bl} documentation.`,public:!0},limit:{defaultValue:"5",description:`The number of suggestions to show. See the ${bl} documentation.`,public:!0},mots:{description:`Commas separated list of mots used to filter the results (rail, bus, coach, foot, tram, subway, gondola, funicular, ferry, car). See the ${bl} documentation.`,public:!0},onselect:{description:null,public:!1},params:{description:`JSON string with additional parameters to pass to the request to the API. Ex: {"{ 'key': 'value' }"}. See the ${bl} documentation.`,public:!0},prefagencies:{description:`comma seperated list, order chooses which agency will be preferred as
3587
3587
  ident_source (for id and code fields). Possible values: sbb, db. See the ${bl} documentation.`,public:!0},reflocation:{description:`Coordinates in WGS84 (in lat,lon order) used to rank stops close to this position higher. See the ${bl} documentation.`,public:!0},url:{defaultValue:"https://api.geops.io/stops/v1/",description:`The URL to the ${bl}.`,public:!0}},BA=DL1;function kL1(r){return W(mc.Provider,{value:wl,children:[W("style",{children:bA}),W(fL,{...r})]})}var oY={};Object.entries(BA).forEach(([r])=>{oY[r]=BA[r].defaultValue||null});function OL1(r){return W(kL1,{...oY,...r})}var gP=ht(OL1);KL(Jy,"geops-mobility",Object.keys(ds),{mode:"open",shadow:!0});KL(gP,"geops-mobility-search",Object.keys(BA),{mode:"open",shadow:!0});KL(CP,"geops-mobility-notifications",Object.keys(MA),{mode:"open",shadow:!0});})();
3588
3588
  /*! Bundled license information:
3589
3589
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@geops/rvf-mobility-web-component",
3
3
  "license": "UNLICENSED",
4
4
  "description": "Web components for rvf in the domains of mobility and logistics.",
5
- "version": "0.1.79",
5
+ "version": "0.1.80",
6
6
  "homepage": "https://rvf-mobility-web-component-geops.vercel.app/",
7
7
  "type": "module",
8
8
  "main": "index.js",
@@ -77,7 +77,8 @@ function MobilityNotifications({
77
77
  const startDateA = a.affectedTimeIntervalsStart;
78
78
  const startDateB = b.affectedTimeIntervalsStart;
79
79
  if (startDateA && startDateB) {
80
- if (startDateA === startDateB) {
80
+ // If they start the same day we sort by severity
81
+ if (startDateA.split("T")[0] === startDateB.split("T")[0]) {
81
82
  // Sort by severity;
82
83
  const severityA =
83
84
  a.publications.find((pub) => {
@@ -93,6 +94,14 @@ function MobilityNotifications({
93
94
  }
94
95
  return startDateA < startDateB ? -1 : 1;
95
96
  }
97
+
98
+ if (!startDateA) {
99
+ return 1;
100
+ }
101
+
102
+ if (!startDateB) {
103
+ return -1;
104
+ }
96
105
  })
97
106
  .map((situation) => {
98
107
  console.log("Rendering situation", situation.id, situation.title);