@opentripplanner/trip-details 2.1.0-alpha.2 → 2.1.2
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/__mocks__/{custom-messages.yml → custom-english-messages.yml} +7 -0
- package/__mocks__/custom-french-messages.yml +10 -0
- package/esm/fare-table.js +153 -0
- package/esm/fare-table.js.map +1 -0
- package/esm/index.js +34 -91
- package/esm/index.js.map +1 -1
- package/esm/styled.js +7 -15
- package/esm/styled.js.map +1 -1
- package/esm/types.js +11 -0
- package/esm/types.js.map +1 -1
- package/esm/utils.js +29 -0
- package/esm/utils.js.map +1 -0
- package/i18n/en-US.yml +9 -18
- package/i18n/fr.yml +7 -17
- package/lib/fare-table.d.ts +4 -0
- package/lib/fare-table.d.ts.map +1 -0
- package/lib/fare-table.js +160 -0
- package/lib/fare-table.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +37 -97
- package/lib/index.js.map +1 -1
- package/lib/styled.d.ts +0 -2
- package/lib/styled.d.ts.map +1 -1
- package/lib/styled.js +8 -22
- package/lib/styled.js.map +1 -1
- package/lib/types.d.ts +29 -11
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js +18 -0
- package/lib/types.js.map +1 -1
- package/lib/utils.d.ts +13 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +41 -0
- package/lib/utils.js.map +1 -0
- package/package.json +1 -1
- package/src/TripDetails.story.tsx +57 -38
- package/src/fare-table.tsx +222 -0
- package/src/index.tsx +46 -120
- package/src/styled.ts +0 -4
- package/src/types.ts +31 -11
- package/src/utils.tsx +30 -0
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +69 -100
- package/esm/fare-detail.js +0 -111
- package/esm/fare-detail.js.map +0 -1
- package/lib/fare-detail.d.ts +0 -3
- package/lib/fare-detail.d.ts.map +0 -1
- package/lib/fare-detail.js +0 -115
- package/lib/fare-detail.js.map +0 -1
- package/src/fare-detail.tsx +0 -154
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"program": {
|
|
3
3
|
"fileInfos": {
|
|
4
|
-
"../../node_modules/typescript/lib/lib.d.ts": {
|
|
5
|
-
"version": "
|
|
6
|
-
"signature": "
|
|
4
|
+
"../../node_modules/typescript/lib/lib.es6.d.ts": {
|
|
5
|
+
"version": "721cec59c3fef87aaf480047d821fb758b3ec9482c4129a54631e6e25e432a31",
|
|
6
|
+
"signature": "721cec59c3fef87aaf480047d821fb758b3ec9482c4129a54631e6e25e432a31",
|
|
7
7
|
"affectsGlobalScope": false
|
|
8
8
|
},
|
|
9
9
|
"../../node_modules/typescript/lib/lib.es5.d.ts": {
|
|
@@ -36,6 +36,11 @@
|
|
|
36
36
|
"signature": "feeeb1dd8a80fb76be42b0426e8f3ffa9bdef3c2f3c12c147e7660b1c5ba8b3b",
|
|
37
37
|
"affectsGlobalScope": true
|
|
38
38
|
},
|
|
39
|
+
"../../node_modules/typescript/lib/lib.dom.iterable.d.ts": {
|
|
40
|
+
"version": "d42f4141bd9ce82b4e2902f26acb00c183e321be19a38bbc0e76a922c1724c94",
|
|
41
|
+
"signature": "d42f4141bd9ce82b4e2902f26acb00c183e321be19a38bbc0e76a922c1724c94",
|
|
42
|
+
"affectsGlobalScope": true
|
|
43
|
+
},
|
|
39
44
|
"../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts": {
|
|
40
45
|
"version": "7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481",
|
|
41
46
|
"signature": "7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481",
|
|
@@ -182,8 +187,13 @@
|
|
|
182
187
|
"affectsGlobalScope": true
|
|
183
188
|
},
|
|
184
189
|
"../types/lib/index.d.ts": {
|
|
185
|
-
"version": "
|
|
186
|
-
"signature": "
|
|
190
|
+
"version": "f647d8c48bc7bfe71ed6aa59b8a00080d3040099679881519a730a99330175e3",
|
|
191
|
+
"signature": "f647d8c48bc7bfe71ed6aa59b8a00080d3040099679881519a730a99330175e3",
|
|
192
|
+
"affectsGlobalScope": false
|
|
193
|
+
},
|
|
194
|
+
"../../node_modules/@types/flat/index.d.ts": {
|
|
195
|
+
"version": "d9890ea8f1da57be3c2e2d3627b787cd4b4a463fd1747c823a0de24b240c8fe5",
|
|
196
|
+
"signature": "d9890ea8f1da57be3c2e2d3627b787cd4b4a463fd1747c823a0de24b240c8fe5",
|
|
187
197
|
"affectsGlobalScope": false
|
|
188
198
|
},
|
|
189
199
|
"../../node_modules/@types/hoist-non-react-statics/index.d.ts": {
|
|
@@ -561,19 +571,29 @@
|
|
|
561
571
|
"signature": "516e2ded162ddc84294deb452dda9982b2a938e6df2d7f838ae0fd8b4ed38159",
|
|
562
572
|
"affectsGlobalScope": false
|
|
563
573
|
},
|
|
564
|
-
"
|
|
565
|
-
"version": "
|
|
566
|
-
"signature": "
|
|
574
|
+
"../../node_modules/@styled-icons/styled-icon/index.d.ts": {
|
|
575
|
+
"version": "a4ce8cb63b46ff55db10c4bdd3007240a42ba71c03f159ea7e6517aef9a8013c",
|
|
576
|
+
"signature": "a4ce8cb63b46ff55db10c4bdd3007240a42ba71c03f159ea7e6517aef9a8013c",
|
|
567
577
|
"affectsGlobalScope": false
|
|
568
578
|
},
|
|
569
|
-
"
|
|
570
|
-
"version": "
|
|
571
|
-
"signature": "
|
|
579
|
+
"../../node_modules/@styled-icons/boxicons-regular/Transfer/Transfer.d.ts": {
|
|
580
|
+
"version": "8a237d3bc8b7d9d4aa2f03d3ada1c230493177df302d91f9da46d69b730f0d9c",
|
|
581
|
+
"signature": "8a237d3bc8b7d9d4aa2f03d3ada1c230493177df302d91f9da46d69b730f0d9c",
|
|
572
582
|
"affectsGlobalScope": false
|
|
573
583
|
},
|
|
574
|
-
"
|
|
575
|
-
"version": "
|
|
576
|
-
"signature": "
|
|
584
|
+
"./src/utils.tsx": {
|
|
585
|
+
"version": "f05b036e2c3a090da6dd6852320669d527389a929553de8d5fb067c9c7bfd38f",
|
|
586
|
+
"signature": "624668423c973a8a094b3584213fab36eff916bbae1e0d8d7274fb965d5573e4",
|
|
587
|
+
"affectsGlobalScope": false
|
|
588
|
+
},
|
|
589
|
+
"./src/types.ts": {
|
|
590
|
+
"version": "853e8563f3fe41f14da5f08eec31cc094f7d1c1fc640f21fca0467f3969a3b38",
|
|
591
|
+
"signature": "3e7f40398ddb92472734e499ca1568e6ccb8ac35f17bf7be2668a71dab0edf05",
|
|
592
|
+
"affectsGlobalScope": false
|
|
593
|
+
},
|
|
594
|
+
"./src/fare-table.tsx": {
|
|
595
|
+
"version": "b37b931463d3c7c72c3bd3fe039490e5b3709f28e9bc539f6d899f594d3c5ffb",
|
|
596
|
+
"signature": "8c2bf7f8d8026785763349df6fbeea93dd5a53a1138bcb73a00404fdaaf483d0",
|
|
577
597
|
"affectsGlobalScope": false
|
|
578
598
|
},
|
|
579
599
|
"./node_modules/@opentripplanner/core-utils/lib/itinerary.d.ts": {
|
|
@@ -616,21 +636,11 @@
|
|
|
616
636
|
"signature": "1d70ffdcee3aaa052be9562efd39d3b97c5ece8cc3ebb190eed4205c2201674a",
|
|
617
637
|
"affectsGlobalScope": false
|
|
618
638
|
},
|
|
619
|
-
"../../node_modules/@styled-icons/styled-icon/index.d.ts": {
|
|
620
|
-
"version": "a4ce8cb63b46ff55db10c4bdd3007240a42ba71c03f159ea7e6517aef9a8013c",
|
|
621
|
-
"signature": "a4ce8cb63b46ff55db10c4bdd3007240a42ba71c03f159ea7e6517aef9a8013c",
|
|
622
|
-
"affectsGlobalScope": false
|
|
623
|
-
},
|
|
624
639
|
"../../node_modules/@styled-icons/fa-solid/CalendarAlt/CalendarAlt.d.ts": {
|
|
625
640
|
"version": "0f45bc35aa17950b1198b3db89c3103736a925f3977086cfce73eca8cb725563",
|
|
626
641
|
"signature": "0f45bc35aa17950b1198b3db89c3103736a925f3977086cfce73eca8cb725563",
|
|
627
642
|
"affectsGlobalScope": false
|
|
628
643
|
},
|
|
629
|
-
"../../node_modules/@styled-icons/fa-solid/HandPaper/HandPaper.d.ts": {
|
|
630
|
-
"version": "28bcbca335542e2c72c1c0878e29a2380794ed7ccf34b27e2ae3a07a59fa26ad",
|
|
631
|
-
"signature": "28bcbca335542e2c72c1c0878e29a2380794ed7ccf34b27e2ae3a07a59fa26ad",
|
|
632
|
-
"affectsGlobalScope": false
|
|
633
|
-
},
|
|
634
644
|
"../../node_modules/@styled-icons/fa-solid/Heartbeat/Heartbeat.d.ts": {
|
|
635
645
|
"version": "343207da98112e392e81971c3941a051ac4fb6659436efc44bfa7b3a353d75f4",
|
|
636
646
|
"signature": "343207da98112e392e81971c3941a051ac4fb6659436efc44bfa7b3a353d75f4",
|
|
@@ -641,19 +651,14 @@
|
|
|
641
651
|
"signature": "573f44d54725af32c1c805f969cae9e59f525df24403861a54daffe1f182ff35",
|
|
642
652
|
"affectsGlobalScope": false
|
|
643
653
|
},
|
|
644
|
-
"../../node_modules/@styled-icons/fa-solid/PhoneVolume/PhoneVolume.d.ts": {
|
|
645
|
-
"version": "74416effd7119dceb27a7a2ca0fa51dfc98e4c2fb65490dac18ec369473a14de",
|
|
646
|
-
"signature": "74416effd7119dceb27a7a2ca0fa51dfc98e4c2fb65490dac18ec369473a14de",
|
|
647
|
-
"affectsGlobalScope": false
|
|
648
|
-
},
|
|
649
654
|
"../../node_modules/@styled-icons/fa-solid/Route/Route.d.ts": {
|
|
650
655
|
"version": "3d271456988cb89ce51fc89e926bff197c426f97e8b7fd1bd8f6479eda4b2db1",
|
|
651
656
|
"signature": "3d271456988cb89ce51fc89e926bff197c426f97e8b7fd1bd8f6479eda4b2db1",
|
|
652
657
|
"affectsGlobalScope": false
|
|
653
658
|
},
|
|
654
659
|
"./src/styled.ts": {
|
|
655
|
-
"version": "
|
|
656
|
-
"signature": "
|
|
660
|
+
"version": "dcb3031d076686e17ad0f2e68c529948213645a505d0864ef2edc1f386906f08",
|
|
661
|
+
"signature": "98a89b96b0db6060eed8a349d2d4170e58e440df39bfe68513eee9157143f771",
|
|
657
662
|
"affectsGlobalScope": false
|
|
658
663
|
},
|
|
659
664
|
"../../node_modules/@styled-icons/fa-solid/QuestionCircle/QuestionCircle.d.ts": {
|
|
@@ -672,8 +677,8 @@
|
|
|
672
677
|
"affectsGlobalScope": false
|
|
673
678
|
},
|
|
674
679
|
"./src/index.tsx": {
|
|
675
|
-
"version": "
|
|
676
|
-
"signature": "
|
|
680
|
+
"version": "b1fa4e2bb3d3579020eec1dea7da99e5cbceab64b99d147fdded56db6ebf6be7",
|
|
681
|
+
"signature": "280628cb5b434821e3fb27721ecfb6d348b6aa9eea0e28fd5bee326a9444ed34",
|
|
677
682
|
"affectsGlobalScope": false
|
|
678
683
|
},
|
|
679
684
|
"./src/__unpublished__/external-types.d.ts": {
|
|
@@ -1007,8 +1012,8 @@
|
|
|
1007
1012
|
"affectsGlobalScope": false
|
|
1008
1013
|
},
|
|
1009
1014
|
"../../node_modules/@types/fs-extra/index.d.ts": {
|
|
1010
|
-
"version": "
|
|
1011
|
-
"signature": "
|
|
1015
|
+
"version": "6435575b4feae200831d37df9f871de6e695c64d3148611fe1b4d714d648ea24",
|
|
1016
|
+
"signature": "6435575b4feae200831d37df9f871de6e695c64d3148611fe1b4d714d648ea24",
|
|
1012
1017
|
"affectsGlobalScope": false
|
|
1013
1018
|
},
|
|
1014
1019
|
"../../node_modules/@types/geojson/index.d.ts": {
|
|
@@ -1577,8 +1582,8 @@
|
|
|
1577
1582
|
"affectsGlobalScope": false
|
|
1578
1583
|
},
|
|
1579
1584
|
"../../node_modules/@types/json-stable-stringify/index.d.ts": {
|
|
1580
|
-
"version": "
|
|
1581
|
-
"signature": "
|
|
1585
|
+
"version": "626520302b2c8880e9eaa3a6a12022cc8b577a32e4d903aef85e3dd275063da4",
|
|
1586
|
+
"signature": "626520302b2c8880e9eaa3a6a12022cc8b577a32e4d903aef85e3dd275063da4",
|
|
1582
1587
|
"affectsGlobalScope": false
|
|
1583
1588
|
},
|
|
1584
1589
|
"../../node_modules/@types/json5/index.d.ts": {
|
|
@@ -1586,26 +1591,6 @@
|
|
|
1586
1591
|
"signature": "96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538",
|
|
1587
1592
|
"affectsGlobalScope": false
|
|
1588
1593
|
},
|
|
1589
|
-
"../../node_modules/@types/mapbox-gl/index.d.ts": {
|
|
1590
|
-
"version": "a49c26a7bad73494e987a795709e298223800407fa4e5c40c28539f752eb32ad",
|
|
1591
|
-
"signature": "a49c26a7bad73494e987a795709e298223800407fa4e5c40c28539f752eb32ad",
|
|
1592
|
-
"affectsGlobalScope": false
|
|
1593
|
-
},
|
|
1594
|
-
"../../node_modules/@types/mapbox__point-geometry/index.d.ts": {
|
|
1595
|
-
"version": "e86cd9c6c99834f8591ed72f08e4ca31570296f081206d0168f58f032cec5b58",
|
|
1596
|
-
"signature": "e86cd9c6c99834f8591ed72f08e4ca31570296f081206d0168f58f032cec5b58",
|
|
1597
|
-
"affectsGlobalScope": false
|
|
1598
|
-
},
|
|
1599
|
-
"../../node_modules/@types/pbf/index.d.ts": {
|
|
1600
|
-
"version": "2a856615ecd0af49997dfbb38cf94fd787d529062a2e96ce26b84432e61d785d",
|
|
1601
|
-
"signature": "2a856615ecd0af49997dfbb38cf94fd787d529062a2e96ce26b84432e61d785d",
|
|
1602
|
-
"affectsGlobalScope": false
|
|
1603
|
-
},
|
|
1604
|
-
"../../node_modules/@types/mapbox__vector-tile/index.d.ts": {
|
|
1605
|
-
"version": "ab438f22fa7748112b6b9744b992ab6049d2fa6f46f011c145ff9c90e533856a",
|
|
1606
|
-
"signature": "ab438f22fa7748112b6b9744b992ab6049d2fa6f46f011c145ff9c90e533856a",
|
|
1607
|
-
"affectsGlobalScope": false
|
|
1608
|
-
},
|
|
1609
1594
|
"../../node_modules/@types/mdast/index.d.ts": {
|
|
1610
1595
|
"version": "9a6d65d77455efaaaeff945bea30c38b8fe0922b807ba45cd23792392f1bfe76",
|
|
1611
1596
|
"signature": "9a6d65d77455efaaaeff945bea30c38b8fe0922b807ba45cd23792392f1bfe76",
|
|
@@ -1829,7 +1814,7 @@
|
|
|
1829
1814
|
},
|
|
1830
1815
|
"options": {
|
|
1831
1816
|
"module": 1,
|
|
1832
|
-
"target":
|
|
1817
|
+
"target": 2,
|
|
1833
1818
|
"sourceMap": true,
|
|
1834
1819
|
"declaration": true,
|
|
1835
1820
|
"declarationMap": true,
|
|
@@ -2020,10 +2005,10 @@
|
|
|
2020
2005
|
"../../node_modules/@formatjs/ecma402-abstract/index.d.ts",
|
|
2021
2006
|
"../../node_modules/@formatjs/intl/src/types.d.ts"
|
|
2022
2007
|
],
|
|
2023
|
-
"../../node_modules/@styled-icons/
|
|
2008
|
+
"../../node_modules/@styled-icons/boxicons-regular/Transfer/Transfer.d.ts": [
|
|
2024
2009
|
"../../node_modules/@styled-icons/styled-icon/index.d.ts"
|
|
2025
2010
|
],
|
|
2026
|
-
"../../node_modules/@styled-icons/fa-solid/
|
|
2011
|
+
"../../node_modules/@styled-icons/fa-solid/CalendarAlt/CalendarAlt.d.ts": [
|
|
2027
2012
|
"../../node_modules/@styled-icons/styled-icon/index.d.ts"
|
|
2028
2013
|
],
|
|
2029
2014
|
"../../node_modules/@styled-icons/fa-solid/Heartbeat/Heartbeat.d.ts": [
|
|
@@ -2032,9 +2017,6 @@
|
|
|
2032
2017
|
"../../node_modules/@styled-icons/fa-solid/MoneyBillAlt/MoneyBillAlt.d.ts": [
|
|
2033
2018
|
"../../node_modules/@styled-icons/styled-icon/index.d.ts"
|
|
2034
2019
|
],
|
|
2035
|
-
"../../node_modules/@styled-icons/fa-solid/PhoneVolume/PhoneVolume.d.ts": [
|
|
2036
|
-
"../../node_modules/@styled-icons/styled-icon/index.d.ts"
|
|
2037
|
-
],
|
|
2038
2020
|
"../../node_modules/@styled-icons/fa-solid/QuestionCircle/QuestionCircle.d.ts": [
|
|
2039
2021
|
"../../node_modules/@styled-icons/styled-icon/index.d.ts"
|
|
2040
2022
|
],
|
|
@@ -2238,14 +2220,6 @@
|
|
|
2238
2220
|
"../../node_modules/@types/jest/node_modules/pretty-format/build/index.d.ts": [
|
|
2239
2221
|
"../../node_modules/@types/jest/node_modules/pretty-format/build/types.d.ts"
|
|
2240
2222
|
],
|
|
2241
|
-
"../../node_modules/@types/mapbox-gl/index.d.ts": [
|
|
2242
|
-
"../../node_modules/@types/geojson/index.d.ts"
|
|
2243
|
-
],
|
|
2244
|
-
"../../node_modules/@types/mapbox__vector-tile/index.d.ts": [
|
|
2245
|
-
"../../node_modules/@types/geojson/index.d.ts",
|
|
2246
|
-
"../../node_modules/@types/mapbox__point-geometry/index.d.ts",
|
|
2247
|
-
"../../node_modules/@types/pbf/index.d.ts"
|
|
2248
|
-
],
|
|
2249
2223
|
"../../node_modules/@types/mdast/index.d.ts": [
|
|
2250
2224
|
"../../node_modules/@types/unist/index.d.ts"
|
|
2251
2225
|
],
|
|
@@ -3009,30 +2983,32 @@
|
|
|
3009
2983
|
"./src/__unpublished__/external-types.d.ts": [
|
|
3010
2984
|
"../../node_modules/@types/react/index.d.ts"
|
|
3011
2985
|
],
|
|
3012
|
-
"./src/fare-
|
|
2986
|
+
"./src/fare-table.tsx": [
|
|
2987
|
+
"../../node_modules/@styled-icons/boxicons-regular/Transfer/Transfer.d.ts",
|
|
2988
|
+
"../../node_modules/@types/flat/index.d.ts",
|
|
3013
2989
|
"../../node_modules/@types/react/index.d.ts",
|
|
3014
2990
|
"../../node_modules/@types/styled-components/index.d.ts",
|
|
3015
2991
|
"../../node_modules/react-intl/index.d.ts",
|
|
3016
2992
|
"../types/lib/index.d.ts",
|
|
3017
|
-
"./src/
|
|
2993
|
+
"./src/__unpublished__/messages.d.ts",
|
|
2994
|
+
"./src/types.ts",
|
|
2995
|
+
"./src/utils.tsx"
|
|
3018
2996
|
],
|
|
3019
2997
|
"./src/index.tsx": [
|
|
3020
2998
|
"../../node_modules/@styled-icons/fa-solid/CalendarAlt/CalendarAlt.d.ts",
|
|
3021
|
-
"../../node_modules/@styled-icons/fa-solid/HandPaper/HandPaper.d.ts",
|
|
3022
2999
|
"../../node_modules/@styled-icons/fa-solid/Heartbeat/Heartbeat.d.ts",
|
|
3023
3000
|
"../../node_modules/@styled-icons/fa-solid/MoneyBillAlt/MoneyBillAlt.d.ts",
|
|
3024
|
-
"../../node_modules/@styled-icons/fa-solid/PhoneVolume/PhoneVolume.d.ts",
|
|
3025
3001
|
"../../node_modules/@styled-icons/fa-solid/Route/Route.d.ts",
|
|
3026
3002
|
"../../node_modules/@types/flat/index.d.ts",
|
|
3027
3003
|
"../../node_modules/@types/react/index.d.ts",
|
|
3028
3004
|
"../../node_modules/react-intl/index.d.ts",
|
|
3029
|
-
"../types/lib/index.d.ts",
|
|
3030
3005
|
"./node_modules/@opentripplanner/core-utils/lib/index.d.ts",
|
|
3031
3006
|
"./src/__unpublished__/messages.d.ts",
|
|
3032
|
-
"./src/fare-
|
|
3007
|
+
"./src/fare-table.tsx",
|
|
3033
3008
|
"./src/styled.ts",
|
|
3034
3009
|
"./src/trip-detail.tsx",
|
|
3035
|
-
"./src/types.ts"
|
|
3010
|
+
"./src/types.ts",
|
|
3011
|
+
"./src/utils.tsx"
|
|
3036
3012
|
],
|
|
3037
3013
|
"./src/styled.ts": [
|
|
3038
3014
|
"../../node_modules/@types/styled-components/index.d.ts"
|
|
@@ -3048,6 +3024,10 @@
|
|
|
3048
3024
|
"../../node_modules/@types/react/index.d.ts",
|
|
3049
3025
|
"../types/lib/index.d.ts"
|
|
3050
3026
|
],
|
|
3027
|
+
"./src/utils.tsx": [
|
|
3028
|
+
"../../node_modules/@types/react/index.d.ts",
|
|
3029
|
+
"../../node_modules/react-intl/index.d.ts"
|
|
3030
|
+
],
|
|
3051
3031
|
"../types/lib/index.d.ts": [
|
|
3052
3032
|
"../../node_modules/@types/react/index.d.ts"
|
|
3053
3033
|
]
|
|
@@ -3229,10 +3209,10 @@
|
|
|
3229
3209
|
"../../node_modules/@formatjs/ecma402-abstract/index.d.ts",
|
|
3230
3210
|
"../../node_modules/@formatjs/intl/src/types.d.ts"
|
|
3231
3211
|
],
|
|
3232
|
-
"../../node_modules/@styled-icons/
|
|
3212
|
+
"../../node_modules/@styled-icons/boxicons-regular/Transfer/Transfer.d.ts": [
|
|
3233
3213
|
"../../node_modules/@styled-icons/styled-icon/index.d.ts"
|
|
3234
3214
|
],
|
|
3235
|
-
"../../node_modules/@styled-icons/fa-solid/
|
|
3215
|
+
"../../node_modules/@styled-icons/fa-solid/CalendarAlt/CalendarAlt.d.ts": [
|
|
3236
3216
|
"../../node_modules/@styled-icons/styled-icon/index.d.ts"
|
|
3237
3217
|
],
|
|
3238
3218
|
"../../node_modules/@styled-icons/fa-solid/Heartbeat/Heartbeat.d.ts": [
|
|
@@ -3241,9 +3221,6 @@
|
|
|
3241
3221
|
"../../node_modules/@styled-icons/fa-solid/MoneyBillAlt/MoneyBillAlt.d.ts": [
|
|
3242
3222
|
"../../node_modules/@styled-icons/styled-icon/index.d.ts"
|
|
3243
3223
|
],
|
|
3244
|
-
"../../node_modules/@styled-icons/fa-solid/PhoneVolume/PhoneVolume.d.ts": [
|
|
3245
|
-
"../../node_modules/@styled-icons/styled-icon/index.d.ts"
|
|
3246
|
-
],
|
|
3247
3224
|
"../../node_modules/@styled-icons/fa-solid/QuestionCircle/QuestionCircle.d.ts": [
|
|
3248
3225
|
"../../node_modules/@styled-icons/styled-icon/index.d.ts"
|
|
3249
3226
|
],
|
|
@@ -3447,14 +3424,6 @@
|
|
|
3447
3424
|
"../../node_modules/@types/jest/node_modules/pretty-format/build/index.d.ts": [
|
|
3448
3425
|
"../../node_modules/@types/jest/node_modules/pretty-format/build/types.d.ts"
|
|
3449
3426
|
],
|
|
3450
|
-
"../../node_modules/@types/mapbox-gl/index.d.ts": [
|
|
3451
|
-
"../../node_modules/@types/geojson/index.d.ts"
|
|
3452
|
-
],
|
|
3453
|
-
"../../node_modules/@types/mapbox__vector-tile/index.d.ts": [
|
|
3454
|
-
"../../node_modules/@types/geojson/index.d.ts",
|
|
3455
|
-
"../../node_modules/@types/mapbox__point-geometry/index.d.ts",
|
|
3456
|
-
"../../node_modules/@types/pbf/index.d.ts"
|
|
3457
|
-
],
|
|
3458
3427
|
"../../node_modules/@types/mdast/index.d.ts": [
|
|
3459
3428
|
"../../node_modules/@types/unist/index.d.ts"
|
|
3460
3429
|
],
|
|
@@ -4218,7 +4187,7 @@
|
|
|
4218
4187
|
"./src/__unpublished__/external-types.d.ts": [
|
|
4219
4188
|
"../../node_modules/@types/react/index.d.ts"
|
|
4220
4189
|
],
|
|
4221
|
-
"./src/fare-
|
|
4190
|
+
"./src/fare-table.tsx": [
|
|
4222
4191
|
"./src/types.ts"
|
|
4223
4192
|
],
|
|
4224
4193
|
"./src/index.tsx": [
|
|
@@ -4236,6 +4205,9 @@
|
|
|
4236
4205
|
"../../node_modules/@types/react/index.d.ts",
|
|
4237
4206
|
"../types/lib/index.d.ts"
|
|
4238
4207
|
],
|
|
4208
|
+
"./src/utils.tsx": [
|
|
4209
|
+
"../../node_modules/@types/react/index.d.ts"
|
|
4210
|
+
],
|
|
4239
4211
|
"../types/lib/index.d.ts": [
|
|
4240
4212
|
"../../node_modules/@types/react/index.d.ts"
|
|
4241
4213
|
]
|
|
@@ -4299,11 +4271,10 @@
|
|
|
4299
4271
|
"../../node_modules/@formatjs/intl/src/relativeTime.d.ts",
|
|
4300
4272
|
"../../node_modules/@formatjs/intl/src/types.d.ts",
|
|
4301
4273
|
"../../node_modules/@formatjs/intl/src/utils.d.ts",
|
|
4274
|
+
"../../node_modules/@styled-icons/boxicons-regular/Transfer/Transfer.d.ts",
|
|
4302
4275
|
"../../node_modules/@styled-icons/fa-solid/CalendarAlt/CalendarAlt.d.ts",
|
|
4303
|
-
"../../node_modules/@styled-icons/fa-solid/HandPaper/HandPaper.d.ts",
|
|
4304
4276
|
"../../node_modules/@styled-icons/fa-solid/Heartbeat/Heartbeat.d.ts",
|
|
4305
4277
|
"../../node_modules/@styled-icons/fa-solid/MoneyBillAlt/MoneyBillAlt.d.ts",
|
|
4306
|
-
"../../node_modules/@styled-icons/fa-solid/PhoneVolume/PhoneVolume.d.ts",
|
|
4307
4278
|
"../../node_modules/@styled-icons/fa-solid/QuestionCircle/QuestionCircle.d.ts",
|
|
4308
4279
|
"../../node_modules/@styled-icons/fa-solid/Route/Route.d.ts",
|
|
4309
4280
|
"../../node_modules/@styled-icons/fa-solid/TimesCircle/TimesCircle.d.ts",
|
|
@@ -4361,9 +4332,6 @@
|
|
|
4361
4332
|
"../../node_modules/@types/json-schema/index.d.ts",
|
|
4362
4333
|
"../../node_modules/@types/json-stable-stringify/index.d.ts",
|
|
4363
4334
|
"../../node_modules/@types/json5/index.d.ts",
|
|
4364
|
-
"../../node_modules/@types/mapbox-gl/index.d.ts",
|
|
4365
|
-
"../../node_modules/@types/mapbox__point-geometry/index.d.ts",
|
|
4366
|
-
"../../node_modules/@types/mapbox__vector-tile/index.d.ts",
|
|
4367
4335
|
"../../node_modules/@types/mdast/index.d.ts",
|
|
4368
4336
|
"../../node_modules/@types/minimatch/index.d.ts",
|
|
4369
4337
|
"../../node_modules/@types/minimist/index.d.ts",
|
|
@@ -4427,7 +4395,6 @@
|
|
|
4427
4395
|
"../../node_modules/@types/overlayscrollbars/index.d.ts",
|
|
4428
4396
|
"../../node_modules/@types/parse-json/index.d.ts",
|
|
4429
4397
|
"../../node_modules/@types/parse5/index.d.ts",
|
|
4430
|
-
"../../node_modules/@types/pbf/index.d.ts",
|
|
4431
4398
|
"../../node_modules/@types/pixelmatch/index.d.ts",
|
|
4432
4399
|
"../../node_modules/@types/prettier/index.d.ts",
|
|
4433
4400
|
"../../node_modules/@types/pretty-hrtime/index.d.ts",
|
|
@@ -4558,8 +4525,8 @@
|
|
|
4558
4525
|
"../../node_modules/source-map/source-map.d.ts",
|
|
4559
4526
|
"../../node_modules/ssim.js/dist/index.d.ts",
|
|
4560
4527
|
"../../node_modules/ssim.js/dist/types.d.ts",
|
|
4561
|
-
"../../node_modules/typescript/lib/lib.d.ts",
|
|
4562
4528
|
"../../node_modules/typescript/lib/lib.dom.d.ts",
|
|
4529
|
+
"../../node_modules/typescript/lib/lib.dom.iterable.d.ts",
|
|
4563
4530
|
"../../node_modules/typescript/lib/lib.es2015.collection.d.ts",
|
|
4564
4531
|
"../../node_modules/typescript/lib/lib.es2015.core.d.ts",
|
|
4565
4532
|
"../../node_modules/typescript/lib/lib.es2015.d.ts",
|
|
@@ -4586,6 +4553,7 @@
|
|
|
4586
4553
|
"../../node_modules/typescript/lib/lib.es2018.regexp.d.ts",
|
|
4587
4554
|
"../../node_modules/typescript/lib/lib.es2020.bigint.d.ts",
|
|
4588
4555
|
"../../node_modules/typescript/lib/lib.es5.d.ts",
|
|
4556
|
+
"../../node_modules/typescript/lib/lib.es6.d.ts",
|
|
4589
4557
|
"../../node_modules/typescript/lib/lib.esnext.intl.d.ts",
|
|
4590
4558
|
"../../node_modules/typescript/lib/lib.scripthost.d.ts",
|
|
4591
4559
|
"../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts",
|
|
@@ -4600,11 +4568,12 @@
|
|
|
4600
4568
|
"./node_modules/@opentripplanner/core-utils/lib/ui.d.ts",
|
|
4601
4569
|
"./src/__unpublished__/external-types.d.ts",
|
|
4602
4570
|
"./src/__unpublished__/messages.d.ts",
|
|
4603
|
-
"./src/fare-
|
|
4571
|
+
"./src/fare-table.tsx",
|
|
4604
4572
|
"./src/index.tsx",
|
|
4605
4573
|
"./src/styled.ts",
|
|
4606
4574
|
"./src/trip-detail.tsx",
|
|
4607
4575
|
"./src/types.ts",
|
|
4576
|
+
"./src/utils.tsx",
|
|
4608
4577
|
"../types/lib/index.d.ts"
|
|
4609
4578
|
]
|
|
4610
4579
|
},
|
package/esm/fare-detail.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
|
-
|
|
7
|
-
/* eslint-disable import/prefer-default-export */
|
|
8
|
-
import React from "react";
|
|
9
|
-
import styled from "styled-components";
|
|
10
|
-
import { FormattedNumber } from "react-intl";
|
|
11
|
-
var TableHeader = styled.thead.withConfig({
|
|
12
|
-
displayName: "fare-detail__TableHeader",
|
|
13
|
-
componentId: "sc-9025ni-0"
|
|
14
|
-
})(["th{min-width:5ch;padding:0.75em 1.5em;text-align:center;}th:nth-of-type(2n + 1){background:#cccccc22;}th.main{color:#ffffffcc;background:#333333;}"]);
|
|
15
|
-
var TotalRow = styled.tr.withConfig({
|
|
16
|
-
displayName: "fare-detail__TotalRow",
|
|
17
|
-
componentId: "sc-9025ni-1"
|
|
18
|
-
})(["border-top:2px solid #333;font-weight:600;"]);
|
|
19
|
-
var Table = styled.table.withConfig({
|
|
20
|
-
displayName: "fare-detail__Table",
|
|
21
|
-
componentId: "sc-9025ni-2"
|
|
22
|
-
})(["border-collapse:collapse;display:block;font-family:sans-serif;margin:-8px;margin-bottom:16px;padding:0;td{text-align:right;}td:nth-of-type(2n + 1){background:#cccccc22;}td.no-zebra{background:transparent;}th:first-of-type{height:40px;}"]);
|
|
23
|
-
|
|
24
|
-
var FareTypeTable = function FareTypeTable(props) {
|
|
25
|
-
var header = props.header,
|
|
26
|
-
fareTotals = props.fareTotals,
|
|
27
|
-
cols = props.cols,
|
|
28
|
-
legs = props.legs;
|
|
29
|
-
return /*#__PURE__*/React.createElement(Table, null, /*#__PURE__*/React.createElement(TableHeader, null, /*#__PURE__*/React.createElement("th", {
|
|
30
|
-
className: "main"
|
|
31
|
-
}, header), cols.map(function (col) {
|
|
32
|
-
return /*#__PURE__*/React.createElement("th", {
|
|
33
|
-
key: col.header
|
|
34
|
-
}, col.header);
|
|
35
|
-
})), legs.map(function (leg, index) {
|
|
36
|
-
return /*#__PURE__*/React.createElement("tr", {
|
|
37
|
-
key: index
|
|
38
|
-
}, /*#__PURE__*/React.createElement("td", {
|
|
39
|
-
className: "no-zebra"
|
|
40
|
-
}, leg.routeShortName), cols.map(function (col) {
|
|
41
|
-
var _fare$price, _legs$0$fares, _legs$0$fares$col$key, _legs$0$fares$col$key2;
|
|
42
|
-
|
|
43
|
-
var fare = leg.fares[col.key];
|
|
44
|
-
return /*#__PURE__*/React.createElement("td", {
|
|
45
|
-
key: col.key
|
|
46
|
-
}, /*#__PURE__*/React.createElement(FormattedNumber, {
|
|
47
|
-
value: (fare === null || fare === void 0 ? void 0 : (_fare$price = fare.price) === null || _fare$price === void 0 ? void 0 : _fare$price.cents) / 100 || 0 // This isn't a "real" style prop
|
|
48
|
-
// eslint-disable-next-line react/style-prop-object
|
|
49
|
-
,
|
|
50
|
-
style: "currency",
|
|
51
|
-
currency: (fare === null || fare === void 0 ? void 0 : fare.price.currency.currencyCode) || ( // This is how the itinerary-wide currency code is calculated on the back-end
|
|
52
|
-
legs === null || legs === void 0 ? void 0 : (_legs$0$fares = legs[0].fares) === null || _legs$0$fares === void 0 ? void 0 : (_legs$0$fares$col$key = _legs$0$fares[col.key]) === null || _legs$0$fares$col$key === void 0 ? void 0 : (_legs$0$fares$col$key2 = _legs$0$fares$col$key.price) === null || _legs$0$fares$col$key2 === void 0 ? void 0 : _legs$0$fares$col$key2.currency.currencyCode),
|
|
53
|
-
currencyDisplay: "narrowSymbol"
|
|
54
|
-
}));
|
|
55
|
-
}));
|
|
56
|
-
}), /*#__PURE__*/React.createElement(TotalRow, null, /*#__PURE__*/React.createElement("td", {
|
|
57
|
-
className: "no-zebra"
|
|
58
|
-
}, "Total"), cols.map(function (col) {
|
|
59
|
-
var _fare$currency;
|
|
60
|
-
|
|
61
|
-
var fare = fareTotals[col.key];
|
|
62
|
-
return /*#__PURE__*/React.createElement("td", {
|
|
63
|
-
key: col.key
|
|
64
|
-
}, /*#__PURE__*/React.createElement(FormattedNumber, {
|
|
65
|
-
value: ((fare === null || fare === void 0 ? void 0 : fare.cents) || 0) / 100 // This isn't a "real" style prop
|
|
66
|
-
// eslint-disable-next-line react/style-prop-object
|
|
67
|
-
,
|
|
68
|
-
style: "currency",
|
|
69
|
-
currency: fare === null || fare === void 0 ? void 0 : (_fare$currency = fare.currency) === null || _fare$currency === void 0 ? void 0 : _fare$currency.currencyCode,
|
|
70
|
-
currencyDisplay: "narrowSymbol"
|
|
71
|
-
}));
|
|
72
|
-
})));
|
|
73
|
-
}; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
export var FareDetails = function FareDetails(props) {
|
|
77
|
-
var legs = props.legs,
|
|
78
|
-
transitFares = props.transitFares,
|
|
79
|
-
layout = props.layout;
|
|
80
|
-
var fareKeys = Object.keys(transitFares.details);
|
|
81
|
-
var legsWithFares = legs.map(function (leg, index) {
|
|
82
|
-
var fares = fareKeys.reduce(function (prev, key) {
|
|
83
|
-
var _transitFares$details;
|
|
84
|
-
|
|
85
|
-
var fareForKey = (_transitFares$details = transitFares.details[key]) === null || _transitFares$details === void 0 ? void 0 : _transitFares$details.find(function (detail) {
|
|
86
|
-
return detail.legIndex === index;
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
if (fareForKey) {
|
|
90
|
-
prev[key] = fareForKey;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return prev;
|
|
94
|
-
}, {});
|
|
95
|
-
return _objectSpread(_objectSpread({}, leg), {}, {
|
|
96
|
-
fares: fares
|
|
97
|
-
});
|
|
98
|
-
}).filter(function (leg) {
|
|
99
|
-
return leg.transitLeg;
|
|
100
|
-
});
|
|
101
|
-
return /*#__PURE__*/React.createElement("div", null, layout.map(function (config) {
|
|
102
|
-
return /*#__PURE__*/React.createElement(FareTypeTable, {
|
|
103
|
-
header: config.header,
|
|
104
|
-
cols: config.cols,
|
|
105
|
-
key: config.header,
|
|
106
|
-
legs: legsWithFares,
|
|
107
|
-
fareTotals: transitFares.fare
|
|
108
|
-
});
|
|
109
|
-
}));
|
|
110
|
-
};
|
|
111
|
-
//# sourceMappingURL=fare-detail.js.map
|
package/esm/fare-detail.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/fare-detail.tsx"],"names":["React","styled","FormattedNumber","TableHeader","thead","TotalRow","tr","Table","table","FareTypeTable","props","header","fareTotals","cols","legs","map","col","leg","index","routeShortName","fare","fares","key","price","cents","currency","currencyCode","FareDetails","transitFares","layout","fareKeys","Object","keys","details","legsWithFares","reduce","prev","fareForKey","find","detail","legIndex","filter","transitLeg","config"],"mappings":"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","sourcesContent":["/* eslint-disable import/prefer-default-export */\nimport { Leg, Money } from \"@opentripplanner/types\";\n\nimport React from \"react\";\nimport styled from \"styled-components\";\nimport { FormattedNumber } from \"react-intl\";\nimport { FareDetailsProps } from \"./types\";\n\ninterface FareTypeTableProps {\n header: string;\n cols: {\n key: string;\n header: string;\n }[];\n legs: (Leg & { fares: { [key: string]: { price: Money } } })[];\n fareTotals: { [fareKey: string]: Money };\n}\n\nconst TableHeader = styled.thead`\n th {\n min-width: 5ch;\n padding: 0.75em 1.5em;\n text-align: center;\n }\n th:nth-of-type(2n + 1) {\n background: #cccccc22;\n }\n th.main {\n color: #ffffffcc;\n background: #333333;\n }\n`;\n\nconst TotalRow = styled.tr`\n border-top: 2px solid #333;\n font-weight: 600;\n`;\n\nconst Table = styled.table`\n border-collapse: collapse;\n display: block;\n font-family: sans-serif;\n margin: -8px;\n /* This line can not be sorted alphabetically, because it must come after the margin rule */\n margin-bottom: 16px;\n padding: 0;\n\n td {\n text-align: right;\n }\n td:nth-of-type(2n + 1) {\n background: #cccccc22;\n }\n td.no-zebra {\n background: transparent;\n }\n th:first-of-type {\n height: 40px;\n }\n`;\n\nconst FareTypeTable = (props: FareTypeTableProps): JSX.Element => {\n const { header, fareTotals, cols, legs } = props;\n return (\n <Table>\n <TableHeader>\n <th className=\"main\">{header}</th>\n {cols.map(col => (\n <th key={col.header}>{col.header}</th>\n ))}\n </TableHeader>\n {legs.map((leg, index) => (\n <tr key={index}>\n <td className=\"no-zebra\">{leg.routeShortName}</td>\n {cols.map(col => {\n const fare = leg.fares[col.key];\n return (\n <td key={col.key}>\n <FormattedNumber\n value={fare?.price?.cents / 100 || 0}\n // This isn't a \"real\" style prop\n // eslint-disable-next-line react/style-prop-object\n style=\"currency\"\n currency={\n fare?.price.currency.currencyCode ||\n // This is how the itinerary-wide currency code is calculated on the back-end\n legs?.[0].fares?.[col.key]?.price?.currency.currencyCode\n }\n currencyDisplay=\"narrowSymbol\"\n />\n </td>\n );\n })}\n </tr>\n ))}\n <TotalRow>\n <td className=\"no-zebra\">Total</td>\n {cols.map(col => {\n const fare = fareTotals[col.key];\n return (\n <td key={col.key}>\n <FormattedNumber\n value={(fare?.cents || 0) / 100}\n // This isn't a \"real\" style prop\n // eslint-disable-next-line react/style-prop-object\n style=\"currency\"\n currency={fare?.currency?.currencyCode}\n currencyDisplay=\"narrowSymbol\"\n />\n </td>\n );\n })}\n </TotalRow>\n </Table>\n );\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const FareDetails = (props: FareDetailsProps): JSX.Element => {\n const { legs, transitFares, layout } = props;\n const fareKeys = Object.keys(transitFares.details);\n\n const legsWithFares = legs\n .map((leg, index) => {\n const fares = fareKeys.reduce((prev, key) => {\n const fareForKey = transitFares.details[key]?.find(\n detail => detail.legIndex === index\n );\n if (fareForKey) {\n prev[key] = fareForKey;\n }\n return prev;\n }, {});\n return {\n ...leg,\n fares\n };\n })\n .filter(leg => leg.transitLeg);\n\n return (\n <div>\n {layout.map(config => (\n <FareTypeTable\n header={config.header}\n cols={config.cols}\n key={config.header}\n legs={legsWithFares}\n fareTotals={transitFares.fare}\n />\n ))}\n </div>\n );\n};\n"],"file":"fare-detail.js"}
|
package/lib/fare-detail.d.ts
DELETED
package/lib/fare-detail.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fare-detail.d.ts","sourceRoot":"","sources":["../src/fare-detail.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgH3C,eAAO,MAAM,WAAW,UAAW,gBAAgB,KAAG,WAmCrD,CAAC"}
|