react-spatial 2.0.0-beta.0 → 2.0.0-beta.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.
Files changed (124) hide show
  1. package/README.md +5 -10
  2. package/components/BaseLayerSwitcher/BaseLayerSwitcher.js +188 -107
  3. package/components/BaseLayerSwitcher/BaseLayerSwitcher.js.map +2 -2
  4. package/components/BaseLayerSwitcher/BaseLayerSwitcher.scss +6 -5
  5. package/components/BaseLayerSwitcher/index.js.map +2 -2
  6. package/components/BasicMap/BasicMap.js +116 -98
  7. package/components/BasicMap/BasicMap.js.map +2 -2
  8. package/components/BasicMap/index.js.map +2 -2
  9. package/components/CanvasSaveButton/CanvasSaveButton.js +448 -316
  10. package/components/CanvasSaveButton/CanvasSaveButton.js.map +2 -2
  11. package/components/CanvasSaveButton/CanvasSaveButton.md.scss +1 -1
  12. package/components/CanvasSaveButton/index.js.map +2 -2
  13. package/components/Copyright/Copyright.js +43 -35
  14. package/components/Copyright/Copyright.js.map +2 -2
  15. package/components/Copyright/index.js.map +2 -2
  16. package/components/FeatureExportButton/FeatureExportButton.js +35 -17
  17. package/components/FeatureExportButton/FeatureExportButton.js.map +2 -2
  18. package/components/FeatureExportButton/index.js.map +2 -2
  19. package/components/FitExtent/FitExtent.js +36 -18
  20. package/components/FitExtent/FitExtent.js.map +2 -2
  21. package/components/FitExtent/index.js.map +2 -2
  22. package/components/Geolocation/Geolocation.js +131 -92
  23. package/components/Geolocation/Geolocation.js.map +2 -2
  24. package/components/Geolocation/Geolocation.scss +7 -5
  25. package/components/Geolocation/index.js.map +2 -2
  26. package/components/LayerTree/LayerTree.js +361 -169
  27. package/components/LayerTree/LayerTree.js.map +2 -2
  28. package/components/LayerTree/LayerTree.scss +4 -6
  29. package/components/LayerTree/index.js.map +2 -2
  30. package/components/MousePosition/MousePosition.js +64 -33
  31. package/components/MousePosition/MousePosition.js.map +2 -2
  32. package/components/MousePosition/index.js.map +2 -2
  33. package/components/NorthArrow/NorthArrow.js +35 -19
  34. package/components/NorthArrow/NorthArrow.js.map +2 -2
  35. package/components/NorthArrow/index.js.map +2 -2
  36. package/components/Overlay/Overlay.js +100 -83
  37. package/components/Overlay/Overlay.js.map +2 -2
  38. package/components/Overlay/index.js.map +2 -2
  39. package/components/Permalink/Permalink.js +135 -90
  40. package/components/Permalink/Permalink.js.map +2 -2
  41. package/components/Permalink/index.js.map +2 -2
  42. package/components/Popup/Popup.js +134 -83
  43. package/components/Popup/Popup.js.map +2 -2
  44. package/components/Popup/Popup.md.scss +1 -0
  45. package/components/Popup/Popup.scss +3 -1
  46. package/components/Popup/index.js.map +2 -2
  47. package/components/ResizeHandler/ResizeHandler.js +51 -45
  48. package/components/ResizeHandler/ResizeHandler.js.map +2 -2
  49. package/components/ResizeHandler/index.js.map +2 -2
  50. package/components/RouteSchedule/RouteSchedule.js +218 -136
  51. package/components/RouteSchedule/RouteSchedule.js.map +2 -2
  52. package/components/RouteSchedule/RouteSchedule.md.scss +4 -2
  53. package/components/RouteSchedule/RouteSchedule.scss +12 -23
  54. package/components/RouteSchedule/index.js.map +2 -2
  55. package/components/ScaleLine/ScaleLine.js +11 -9
  56. package/components/ScaleLine/ScaleLine.js.map +2 -2
  57. package/components/ScaleLine/ScaleLine.scss +6 -4
  58. package/components/ScaleLine/index.js.map +2 -2
  59. package/components/StopsFinder/StopsFinder.js +141 -118
  60. package/components/StopsFinder/StopsFinder.js.map +2 -2
  61. package/components/StopsFinder/StopsFinderOption.js +11 -24
  62. package/components/StopsFinder/StopsFinderOption.js.map +2 -2
  63. package/components/StopsFinder/index.js.map +2 -2
  64. package/components/Zoom/Zoom.js +101 -62
  65. package/components/Zoom/Zoom.js.map +2 -2
  66. package/components/Zoom/Zoom.md.scss +3 -1
  67. package/components/Zoom/Zoom.scss +7 -5
  68. package/components/Zoom/index.js.map +2 -2
  69. package/images/geops_qr.png +0 -0
  70. package/package.json +81 -177
  71. package/propTypes.js +67 -0
  72. package/propTypes.js.map +7 -0
  73. package/setupTests.js +22 -0
  74. package/setupTests.js.map +7 -0
  75. package/themes/README.md +26 -0
  76. package/themes/default/components.scss +9 -13
  77. package/themes/default/examples.scss +20 -19
  78. package/themes/default/index.scss +3 -3
  79. package/themes/default/mixins.scss +7 -5
  80. package/themes/default/variables.scss +27 -25
  81. package/utils/GlobalsForOle.js +57 -57
  82. package/utils/GlobalsForOle.js.map +2 -2
  83. package/utils/KML.js +174 -49
  84. package/utils/KML.js.map +2 -2
  85. package/utils/Styles.js +7 -7
  86. package/utils/Styles.js.map +2 -2
  87. package/utils/getLayersAsFlatArray.js +14 -0
  88. package/utils/getLayersAsFlatArray.js.map +7 -0
  89. package/utils/getPolygonPattern.js.map +2 -2
  90. package/utils/timeUtils.js +11 -7
  91. package/utils/timeUtils.js.map +2 -2
  92. package/components/FilterButton/FilterButton.js +0 -66
  93. package/components/FilterButton/FilterButton.js.map +0 -7
  94. package/components/FilterButton/FilterButton.scss +0 -36
  95. package/components/FilterButton/index.js +0 -1
  96. package/components/FilterButton/index.js.map +0 -7
  97. package/components/FollowButton/FollowButton.js +0 -73
  98. package/components/FollowButton/FollowButton.js.map +0 -7
  99. package/components/FollowButton/FollowButton.scss +0 -36
  100. package/components/FollowButton/index.js +0 -1
  101. package/components/FollowButton/index.js.map +0 -7
  102. package/components/Search/Search.js +0 -166
  103. package/components/Search/Search.js.map +0 -7
  104. package/components/Search/Search.md.scss +0 -4
  105. package/components/Search/Search.scss +0 -78
  106. package/components/Search/SearchService.js +0 -48
  107. package/components/Search/SearchService.js.map +0 -7
  108. package/components/Search/engines/Engine.js +0 -19
  109. package/components/Search/engines/Engine.js.map +0 -7
  110. package/components/Search/engines/StopFinder.js +0 -30
  111. package/components/Search/engines/StopFinder.js.map +0 -7
  112. package/components/Search/index.js +0 -3
  113. package/components/Search/index.js.map +0 -7
  114. package/components/TrackerControl/TrackerControl.js +0 -116
  115. package/components/TrackerControl/TrackerControl.js.map +0 -7
  116. package/components/TrackerControl/TrackerControl.scss +0 -30
  117. package/components/TrackerControl/index.js +0 -1
  118. package/components/TrackerControl/index.js.map +0 -7
  119. package/images/FilterButton/filter.svg +0 -1
  120. package/images/FollowButton/follow.svg +0 -1
  121. package/images/baselayer/osm.baselayer.hot.png +0 -0
  122. package/images/baselayer/osm.baselayer.png +0 -0
  123. package/utils/KMLFormat.js +0 -69
  124. package/utils/KMLFormat.js.map +0 -7
package/propTypes.js ADDED
@@ -0,0 +1,67 @@
1
+ import PropTypes from "prop-types";
2
+ const STATE_BOARDING = "BOARDING";
3
+ const STATE_LEAVING = "LEAVING";
4
+ const STATE_PENDING = "PENDING";
5
+ const STATE_TIME_BASED = "TIME_BASED";
6
+ const STATE_STOP_CANCELLED = "STOP_CANCELLED";
7
+ const STATE_JOURNEY_CANCELLED = "JOURNEY_CANCELLED";
8
+ const station = PropTypes.shape({
9
+ aimedArrivalTime: PropTypes.number,
10
+ // time in milliseconds.
11
+ aimedDepartureTime: PropTypes.number,
12
+ // time in milliseconds.
13
+ arrivalDelay: PropTypes.number,
14
+ // time in milliseconds.
15
+ arrivalTime: PropTypes.number,
16
+ // time in milliseconds with the delay included.
17
+ cancelled: PropTypes.bool,
18
+ coordinates: PropTypes.arrayOf(PropTypes.number),
19
+ departureDelay: PropTypes.number,
20
+ // time in milliseconds.
21
+ departureTime: PropTypes.number,
22
+ // time in milliseconds with the delay included
23
+ noDropOff: PropTypes.bool,
24
+ noPickUp: PropTypes.bool,
25
+ state: PropTypes.oneOf([
26
+ null,
27
+ STATE_BOARDING,
28
+ STATE_LEAVING,
29
+ STATE_PENDING,
30
+ STATE_TIME_BASED,
31
+ STATE_STOP_CANCELLED,
32
+ STATE_JOURNEY_CANCELLED
33
+ ]),
34
+ stationId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
35
+ stationName: PropTypes.string,
36
+ wheelchairAccessible: PropTypes.bool
37
+ });
38
+ const lineInfos = PropTypes.shape({
39
+ backgroundColor: PropTypes.string,
40
+ bicyclesAllowed: PropTypes.bool,
41
+ color: PropTypes.string,
42
+ destination: PropTypes.string,
43
+ feedsId: PropTypes.number,
44
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
45
+ license: PropTypes.string,
46
+ licenseNote: PropTypes.string,
47
+ licenseUrl: PropTypes.string,
48
+ longName: PropTypes.string,
49
+ operatingInformations: PropTypes.object,
50
+ operator: PropTypes.string,
51
+ operatorTimeZone: PropTypes.string,
52
+ operatorUrl: PropTypes.string,
53
+ publisher: PropTypes.string,
54
+ publisherTimeZone: PropTypes.string,
55
+ publisherUrl: PropTypes.string,
56
+ realTime: PropTypes.number,
57
+ shortName: PropTypes.string,
58
+ stations: PropTypes.arrayOf(station),
59
+ vehicleType: PropTypes.number,
60
+ wheelchairAccessible: PropTypes.bool
61
+ });
62
+ export default {
63
+ lineInfos,
64
+ STATE_BOARDING,
65
+ STATE_LEAVING,
66
+ station
67
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/propTypes.js"],
4
+ "sourcesContent": ["import PropTypes from \"prop-types\";\n\nconst STATE_BOARDING = \"BOARDING\";\nconst STATE_LEAVING = \"LEAVING\";\nconst STATE_PENDING = \"PENDING\";\nconst STATE_TIME_BASED = \"TIME_BASED\";\nconst STATE_STOP_CANCELLED = \"STOP_CANCELLED\";\nconst STATE_JOURNEY_CANCELLED = \"JOURNEY_CANCELLED\";\n\nconst station = PropTypes.shape({\n aimedArrivalTime: PropTypes.number, // time in milliseconds.\n aimedDepartureTime: PropTypes.number, // time in milliseconds.\n arrivalDelay: PropTypes.number, // time in milliseconds.\n arrivalTime: PropTypes.number, // time in milliseconds with the delay included.\n cancelled: PropTypes.bool,\n coordinates: PropTypes.arrayOf(PropTypes.number),\n departureDelay: PropTypes.number, // time in milliseconds.\n departureTime: PropTypes.number, // time in milliseconds with the delay included\n noDropOff: PropTypes.bool,\n noPickUp: PropTypes.bool,\n state: PropTypes.oneOf([\n null,\n STATE_BOARDING,\n STATE_LEAVING,\n STATE_PENDING,\n STATE_TIME_BASED,\n STATE_STOP_CANCELLED,\n STATE_JOURNEY_CANCELLED,\n ]),\n stationId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n stationName: PropTypes.string,\n wheelchairAccessible: PropTypes.bool,\n});\n\nconst lineInfos = PropTypes.shape({\n backgroundColor: PropTypes.string,\n bicyclesAllowed: PropTypes.bool,\n color: PropTypes.string,\n destination: PropTypes.string,\n feedsId: PropTypes.number,\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n license: PropTypes.string,\n licenseNote: PropTypes.string,\n licenseUrl: PropTypes.string,\n longName: PropTypes.string,\n operatingInformations: PropTypes.object,\n operator: PropTypes.string,\n operatorTimeZone: PropTypes.string,\n operatorUrl: PropTypes.string,\n publisher: PropTypes.string,\n publisherTimeZone: PropTypes.string,\n publisherUrl: PropTypes.string,\n realTime: PropTypes.number,\n shortName: PropTypes.string,\n stations: PropTypes.arrayOf(station),\n vehicleType: PropTypes.number,\n wheelchairAccessible: PropTypes.bool,\n});\n\nexport default {\n lineInfos,\n STATE_BOARDING,\n STATE_LEAVING,\n station,\n};\n"],
5
+ "mappings": "AAAA,OAAO,eAAe;AAEtB,MAAM,iBAAiB;AACvB,MAAM,gBAAgB;AACtB,MAAM,gBAAgB;AACtB,MAAM,mBAAmB;AACzB,MAAM,uBAAuB;AAC7B,MAAM,0BAA0B;AAEhC,MAAM,UAAU,UAAU,MAAM;AAAA,EAC9B,kBAAkB,UAAU;AAAA;AAAA,EAC5B,oBAAoB,UAAU;AAAA;AAAA,EAC9B,cAAc,UAAU;AAAA;AAAA,EACxB,aAAa,UAAU;AAAA;AAAA,EACvB,WAAW,UAAU;AAAA,EACrB,aAAa,UAAU,QAAQ,UAAU,MAAM;AAAA,EAC/C,gBAAgB,UAAU;AAAA;AAAA,EAC1B,eAAe,UAAU;AAAA;AAAA,EACzB,WAAW,UAAU;AAAA,EACrB,UAAU,UAAU;AAAA,EACpB,OAAO,UAAU,MAAM;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACnE,aAAa,UAAU;AAAA,EACvB,sBAAsB,UAAU;AAClC,CAAC;AAED,MAAM,YAAY,UAAU,MAAM;AAAA,EAChC,iBAAiB,UAAU;AAAA,EAC3B,iBAAiB,UAAU;AAAA,EAC3B,OAAO,UAAU;AAAA,EACjB,aAAa,UAAU;AAAA,EACvB,SAAS,UAAU;AAAA,EACnB,IAAI,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAC5D,SAAS,UAAU;AAAA,EACnB,aAAa,UAAU;AAAA,EACvB,YAAY,UAAU;AAAA,EACtB,UAAU,UAAU;AAAA,EACpB,uBAAuB,UAAU;AAAA,EACjC,UAAU,UAAU;AAAA,EACpB,kBAAkB,UAAU;AAAA,EAC5B,aAAa,UAAU;AAAA,EACvB,WAAW,UAAU;AAAA,EACrB,mBAAmB,UAAU;AAAA,EAC7B,cAAc,UAAU;AAAA,EACxB,UAAU,UAAU;AAAA,EACpB,WAAW,UAAU;AAAA,EACrB,UAAU,UAAU,QAAQ,OAAO;AAAA,EACnC,aAAa,UAAU;AAAA,EACvB,sBAAsB,UAAU;AAClC,CAAC;AAED,eAAe;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
6
+ "names": []
7
+ }
package/setupTests.js ADDED
@@ -0,0 +1,22 @@
1
+ import ResizeObserver from "resize-observer-polyfill";
2
+ global.URL.createObjectURL = jest.fn(() => {
3
+ return "fooblob";
4
+ });
5
+ global.ResizeObserver = ResizeObserver;
6
+ const noop = () => {
7
+ };
8
+ class Worker {
9
+ onmessage;
10
+ url;
11
+ constructor(stringUrl) {
12
+ this.url = stringUrl;
13
+ this.onmessage = noop;
14
+ }
15
+ postMessage(msg) {
16
+ this.onmessage(msg);
17
+ }
18
+ }
19
+ Object.defineProperty(window, "Worker", {
20
+ value: Worker,
21
+ writable: true
22
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/setupTests.js"],
4
+ "sourcesContent": ["import ResizeObserver from \"resize-observer-polyfill\";\n\nglobal.URL.createObjectURL = jest.fn(() => {\n return \"fooblob\";\n});\n\nglobal.ResizeObserver = ResizeObserver;\n\nconst noop = () => {};\n\nclass Worker {\n onmessage;\n\n url;\n\n constructor(stringUrl) {\n this.url = stringUrl;\n this.onmessage = noop;\n }\n\n postMessage(msg) {\n this.onmessage(msg);\n }\n}\n\nObject.defineProperty(window, \"Worker\", {\n value: Worker,\n writable: true,\n});\n"],
5
+ "mappings": "AAAA,OAAO,oBAAoB;AAE3B,OAAO,IAAI,kBAAkB,KAAK,GAAG,MAAM;AACzC,SAAO;AACT,CAAC;AAED,OAAO,iBAAiB;AAExB,MAAM,OAAO,MAAM;AAAC;AAEpB,MAAM,OAAO;AAAA,EACX;AAAA,EAEA;AAAA,EAEA,YAAY,WAAW;AACrB,SAAK,MAAM;AACX,SAAK,YAAY;AAAA,EACnB;AAAA,EAEA,YAAY,KAAK;AACf,SAAK,UAAU,GAAG;AAAA,EACpB;AACF;AAEA,OAAO,eAAe,QAAQ,UAAU;AAAA,EACtC,OAAO;AAAA,EACP,UAAU;AACZ,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,26 @@
1
+ # Themes
2
+
3
+ We are NOT a CSS library so we provide some default CSS helpers to help you start but feel free to use your own technology bootstrap or JSS or styled-compoennts.
4
+
5
+ ## How to use
6
+
7
+ We provide a set of CSS variables and classes to help you start using `react-spatial` .
8
+ To use it just import the `index.scss` file of the `default` theme in your application:
9
+
10
+ ```js
11
+ import 'react-spatial/themes/default/index.scss';
12
+ ```
13
+
14
+ If you want to override variables just import the `default/variables.css` and the default CSS files you want, there is one CSS file by component.
15
+
16
+ ## Create a new theme
17
+
18
+ Just add a folder with an `index.scss` file.
19
+
20
+ Some rules must be followed:
21
+
22
+ - no positionning css for container.
23
+ - no size information without using CSS variable.
24
+ - use `display: flex` for container when possible.
25
+
26
+ Of course those rules must be adapted depending on the component.
@@ -1,16 +1,12 @@
1
1
  /**
2
2
  * This file load the css of components.
3
3
  */
4
- @import '../../components/FilterButton/FilterButton.scss';
5
- @import '../../components/FollowButton/FollowButton.scss';
6
- @import '../../components/BaseLayerSwitcher/BaseLayerSwitcher.scss';
7
- @import '../../components/Geolocation/Geolocation.scss';
8
- @import '../../components/LayerTree/LayerTree.scss';
9
- @import '../../components/NorthArrow/NorthArrow.scss';
10
- @import '../../components/Popup/Popup.scss';
11
- @import '../../components/ScaleLine/ScaleLine.scss';
12
- @import '../../components/Zoom/Zoom.scss';
13
- @import '../../components/RouteSchedule/RouteSchedule.scss';
14
- @import '../../components/TrackerControl/TrackerControl.scss';
15
- @import '../../components/Search/Search.scss';
16
- @import '../../components/Overlay/Overlay.scss';
4
+ @use '../../components/BaseLayerSwitcher/BaseLayerSwitcher';
5
+ @use '../../components/Geolocation/Geolocation';
6
+ @use '../../components/LayerTree/LayerTree';
7
+ @use '../../components/NorthArrow/NorthArrow';
8
+ @use '../../components/Popup/Popup';
9
+ @use '../../components/ScaleLine/ScaleLine';
10
+ @use '../../components/Zoom/Zoom';
11
+ @use '../../components/RouteSchedule/RouteSchedule';
12
+ @use '../../components/Overlay/Overlay';
@@ -1,33 +1,34 @@
1
1
  /**
2
2
  * This file is loaded by the styleguide and provide additionnal css for all examples.
3
3
  */
4
- @import './index.scss';
5
- @import '../../components/BaseLayerSwitcher/BaseLayerSwitcher.md.scss';
6
- @import '../../components/BasicMap/BasicMap.md.scss';
7
- @import '../../components/CanvasSaveButton/CanvasSaveButton.md.scss';
8
- @import '../../components/FeatureExportButton/FeatureExportButton.md.scss';
9
- @import '../../components/FitExtent/FitExtent.md.scss';
10
- @import '../../components/Geolocation/Geolocation.md.scss';
11
- @import '../../components/LayerTree/LayerTree.md.scss';
12
- @import '../../components/MousePosition/MousePosition.md.scss';
13
- @import '../../components/Permalink/Permalink.md.scss';
14
- @import '../../components/Popup/Popup.md.scss';
15
- @import '../../components/Zoom/Zoom.md.scss';
16
- @import '../../components/RouteSchedule/RouteSchedule.md.scss';
17
- @import '../../components/Copyright/Copyright.md.scss';
18
- @import '../../components/Search/Search.md.scss';
19
- @import '../../components/Overlay/Overlay.md.scss';
4
+ @use 'index';
5
+ @use 'variables';
6
+ @use 'mixins';
7
+ @use '../../components/BaseLayerSwitcher/BaseLayerSwitcher.md';
8
+ @use '../../components/BasicMap/BasicMap.md';
9
+ @use '../../components/CanvasSaveButton/CanvasSaveButton.md';
10
+ @use '../../components/FeatureExportButton/FeatureExportButton.md';
11
+ @use '../../components/FitExtent/FitExtent.md';
12
+ @use '../../components/Geolocation/Geolocation.md';
13
+ @use '../../components/LayerTree/LayerTree.md';
14
+ @use '../../components/MousePosition/MousePosition.md';
15
+ @use '../../components/Permalink/Permalink.md';
16
+ @use '../../components/Popup/Popup.md';
17
+ @use '../../components/Zoom/Zoom.md';
18
+ @use '../../components/RouteSchedule/RouteSchedule.md';
19
+ @use '../../components/Copyright/Copyright.md';
20
+ @use '../../components/Overlay/Overlay.md';
20
21
 
21
22
  $link-color: #000;
22
23
  $link-color-hover: #000;
23
24
 
24
- // Load 'a' mixin
25
- @include a;
25
+ /* Load 'a' mixin */
26
+ @include mixins.a();
26
27
 
27
28
  a {
28
29
  font-size: 11px;
29
30
  }
30
31
 
31
32
  body {
32
- font-family: $font-family;
33
+ font-family: variables.$font-family;
33
34
  }
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * This file load the default theme, for all the components.
3
3
  */
4
- @import './variables.scss';
5
- @import './mixins.scss';
6
- @import './components.scss';
4
+ @use 'variables';
5
+ @use 'mixins';
6
+ @use 'components';
7
7
 
8
8
  [role='button']:not([disabled]),
9
9
  button:not([disabled]),
@@ -1,3 +1,5 @@
1
+ @use "variables";
2
+
1
3
  /**
2
4
  * This file defines mixins.
3
5
  */
@@ -7,16 +9,16 @@
7
9
  */
8
10
  @mixin a() {
9
11
  a {
10
- color: $link-color;
11
- text-decoration: $link-decoration;
12
+ color: variables.$link-color;
13
+ text-decoration: variables.$link-decoration;
12
14
 
13
15
  &:hover {
14
- color: $link-color-hover;
15
- text-decoration: $link-decoration-hover;
16
+ color: variables.$link-color-hover;
17
+ text-decoration: variables.$link-decoration-hover;
16
18
  }
17
19
 
18
20
  &:active {
19
- color: $link-color-active;
21
+ color: variables.$link-color-active;
20
22
  }
21
23
 
22
24
  &.rs-selected {
@@ -1,58 +1,60 @@
1
1
  /**
2
2
  * This file defines variables.
3
3
  */
4
+ @use "sass:color";
5
+ @use "sass:math";
4
6
 
5
- // Color
6
- $brand-primary: #eb0000;
7
+ /* Color */
8
+ $brand-primary: #000;
7
9
  $brand-secondary: #003d85;
8
10
  $gray-base: #000;
9
- $gray-lighter: lighten($gray-base, 93.5%);
10
- $gray-light: lighten($gray-base, 46.7%);
11
- $gray: lighten($gray-base, 33.5%);
12
- $gray-dark: lighten($gray-base, 20%);
13
- $gray-darker: lighten($gray-base, 13.5%);
11
+ $gray-lighter: color.adjust($gray-base, $lightness: 93.5%);
12
+ $gray-light: color.adjust($gray-base, $lightness: 46.7%);
13
+ $gray: color.adjust($gray-base,$lightness: 33.5%);
14
+ $gray-dark: color.adjust($gray-base, $lightness: 20%);
15
+ $gray-darker: color.adjust($gray-base, $lightness: 13.5%);
14
16
 
15
- // Text
17
+ /* Text */
16
18
  $font-family: arial, sans-serif;
17
19
  $font-family-bold: arial, sans-serif;
18
20
  $font-size-base: 15px;
19
- $font-size-small: ceil($font-size-base * 0.85);
20
- $font-size-large: ceil($font-size-base * 1.25);
21
+ $font-size-small: math.ceil($font-size-base * 0.85);
22
+ $font-size-large: math.ceil($font-size-base * 1.25);
21
23
 
22
- //Shadow
23
- $box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
24
+ /* Shadow */
25
+ $box-shadow: 0 1px 4px rgb(0 0 0 / 20%);
24
26
 
25
- // Padding
27
+ /* Padding */
26
28
  $padding-base: 5px;
27
29
  $padding-base-vertical: 5px;
28
30
  $padding-base-horizontal: 5px;
29
31
 
30
- // Link
32
+ /* Link */
31
33
  $link-color: $brand-primary;
32
- $link-color-hover: darken($brand-primary, 10%);
33
- $link-color-active: darken($brand-primary, 5%);
34
+ $link-color-hover: color.adjust($brand-primary,$lightness: -10%);
35
+ $link-color-active: color.adjust($brand-primary, $lightness: -5%);
34
36
  $link-decoration: none;
35
37
  $link-decoration-hover: underline;
36
38
 
37
- // Buttons
39
+ /* Buttons */
38
40
  $btn-primary-color: $brand-primary;
39
- $btn-primary-color-hover: darken($brand-primary, 10%);
40
- $btn-primary-color-active: darken($brand-primary, 5%);
41
+ $btn-primary-color-hover: color.adjust($brand-primary, $lightness: -10%);
42
+ $btn-primary-color-active: color.adjust($brand-primary, $lightness: -5%);
41
43
  $btn-secondary-color: $brand-secondary;
42
- $btn-secondary-color-hover: darken($btn-secondary-color, 10%);
43
- $btn-secondary-color-active: darken($btn-secondary-color, 5%);
44
+ $btn-secondary-color-hover: color.adjust($btn-secondary-color, $lightness: -10%);
45
+ $btn-secondary-color-active: color.adjust($btn-secondary-color, $lightness: -5%);
44
46
  $btn-size-base: 50px;
45
- $btn-size-small: ceil($btn-size-base * 0.85);
46
- $btn-size-large: ceil($btn-size-base * 1.25);
47
+ $btn-size-small: math.ceil($btn-size-base * 0.85);
48
+ $btn-size-large: math.ceil($btn-size-base * 1.25);
47
49
 
48
- // Z-index
50
+ /* Z-index */
49
51
  $zindex-base: 0;
50
52
  $zindex-lower: 200;
51
53
  $zindex-low: 400;
52
54
  $zindex-high: 600;
53
55
  $zindex-higher: 800;
54
56
 
55
- // Others
57
+ /* Others */
56
58
  $header-height: 55px;
57
59
  $footer-height: 25px;
58
60
  $sidebar-open-width: 200px;
@@ -1,85 +1,85 @@
1
- import OLVectorLayer from "ol/layer/Vector";
2
- import VectorSource from "ol/source/Vector";
3
- import Control from "ol/control/Control";
4
- import Draw from "ol/interaction/Draw";
5
- import Snap from "ol/interaction/Snap";
6
- import Pointer from "ol/interaction/Pointer";
7
- import Select from "ol/interaction/Select";
8
- import Modify from "ol/interaction/Modify";
9
- import Style from "ol/style/Style";
10
- import Fill from "ol/style/Fill";
11
- import Stroke from "ol/style/Stroke";
12
- import Circle from "ol/style/Circle";
13
- import Icon from "ol/style/Icon";
14
- import RegularShape from "ol/style/RegularShape";
1
+ import { OL3Parser } from "jsts/org/locationtech/jts/io";
2
+ import { BufferOp } from "jsts/org/locationtech/jts/operation/buffer";
3
+ import { OverlayOp } from "jsts/org/locationtech/jts/operation/overlay";
15
4
  import Collection from "ol/Collection";
16
- import Feature from "ol/Feature";
17
- import Observable, { unByKey } from "ol/Observable";
5
+ import Control from "ol/control/Control";
6
+ import * as events from "ol/events";
7
+ import * as condition from "ol/events/condition";
18
8
  import { getCenter } from "ol/extent";
9
+ import Feature from "ol/Feature";
19
10
  import {
20
- Point,
21
11
  LineString,
22
- Polygon,
23
- MultiPoint,
24
12
  MultiLineString,
25
- MultiPolygon
13
+ MultiPoint,
14
+ MultiPolygon,
15
+ Point,
16
+ Polygon
26
17
  } from "ol/geom";
27
18
  import LinearRing from "ol/geom/LinearRing";
28
19
  import { fromExtent } from "ol/geom/Polygon";
29
- import * as events from "ol/events";
30
- import * as condition from "ol/events/condition";
31
- import { OL3Parser } from "jsts/org/locationtech/jts/io";
32
- import { BufferOp } from "jsts/org/locationtech/jts/operation/buffer";
33
- import { OverlayOp } from "jsts/org/locationtech/jts/operation/overlay";
20
+ import Draw from "ol/interaction/Draw";
21
+ import Modify from "ol/interaction/Modify";
22
+ import Pointer from "ol/interaction/Pointer";
23
+ import Select from "ol/interaction/Select";
24
+ import Snap from "ol/interaction/Snap";
25
+ import OLVectorLayer from "ol/layer/Vector";
26
+ import Observable, { unByKey } from "ol/Observable";
27
+ import VectorSource from "ol/source/Vector";
28
+ import Circle from "ol/style/Circle";
29
+ import Fill from "ol/style/Fill";
30
+ import Icon from "ol/style/Icon";
31
+ import RegularShape from "ol/style/RegularShape";
32
+ import Stroke from "ol/style/Stroke";
33
+ import Style from "ol/style/Style";
34
34
  if (!window.ol) {
35
35
  window.ol = {
36
- Feature,
37
36
  Collection,
38
- layer: {
39
- Vector: OLVectorLayer
40
- },
41
- source: {
42
- Vector: VectorSource
43
- },
44
- interaction: {
45
- Draw,
46
- Snap,
47
- Pointer,
48
- Select,
49
- Modify
50
- },
51
37
  control: {
52
38
  Control
53
39
  },
54
- style: {
55
- Style,
56
- Fill,
57
- Stroke,
58
- Circle,
59
- RegularShape,
60
- Icon
40
+ events: {
41
+ ...events,
42
+ condition: {
43
+ ...condition
44
+ }
61
45
  },
46
+ extent: {
47
+ getCenter
48
+ },
49
+ Feature,
62
50
  geom: {
63
- Point,
51
+ LinearRing,
64
52
  LineString,
65
- Polygon,
66
- MultiPoint,
67
53
  MultiLineString,
54
+ MultiPoint,
68
55
  MultiPolygon,
69
- LinearRing
56
+ Point,
57
+ Polygon
70
58
  },
71
- extent: {
72
- getCenter
59
+ interaction: {
60
+ Draw,
61
+ Modify,
62
+ Pointer,
63
+ Select,
64
+ Snap
65
+ },
66
+ layer: {
67
+ Vector: OLVectorLayer
73
68
  },
74
69
  Observable: {
75
70
  ...Observable,
76
71
  unByKey
77
72
  },
78
- events: {
79
- ...events,
80
- condition: {
81
- ...condition
82
- }
73
+ source: {
74
+ Vector: VectorSource
75
+ },
76
+ style: {
77
+ Circle,
78
+ Fill,
79
+ Icon,
80
+ RegularShape,
81
+ Stroke,
82
+ Style
83
83
  }
84
84
  };
85
85
  window.ol.geom.Polygon.fromExtent = fromExtent;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/GlobalsForOle.js"],
4
- "sourcesContent": ["import OLVectorLayer from 'ol/layer/Vector';\nimport VectorSource from 'ol/source/Vector';\nimport Control from 'ol/control/Control';\nimport Draw from 'ol/interaction/Draw';\nimport Snap from 'ol/interaction/Snap';\nimport Pointer from 'ol/interaction/Pointer';\nimport Select from 'ol/interaction/Select';\nimport Modify from 'ol/interaction/Modify';\nimport Style from 'ol/style/Style';\nimport Fill from 'ol/style/Fill';\nimport Stroke from 'ol/style/Stroke';\nimport Circle from 'ol/style/Circle';\nimport Icon from 'ol/style/Icon';\nimport RegularShape from 'ol/style/RegularShape';\nimport Collection from 'ol/Collection';\nimport Feature from 'ol/Feature';\nimport Observable, { unByKey } from 'ol/Observable';\nimport { getCenter } from 'ol/extent';\nimport {\n Point,\n LineString,\n Polygon,\n MultiPoint,\n MultiLineString,\n MultiPolygon,\n} from 'ol/geom';\nimport LinearRing from 'ol/geom/LinearRing';\nimport { fromExtent } from 'ol/geom/Polygon';\nimport * as events from 'ol/events';\nimport * as condition from 'ol/events/condition';\nimport { OL3Parser } from 'jsts/org/locationtech/jts/io';\nimport { BufferOp } from 'jsts/org/locationtech/jts/operation/buffer';\nimport { OverlayOp } from 'jsts/org/locationtech/jts/operation/overlay';\n\n/**\n * This module create window.ol and window.jsts variables for ole editor.\n */\nif (!window.ol) {\n window.ol = {\n Feature,\n Collection,\n layer: {\n Vector: OLVectorLayer,\n },\n source: {\n Vector: VectorSource,\n },\n interaction: {\n Draw,\n Snap,\n Pointer,\n Select,\n Modify,\n },\n control: {\n Control,\n },\n style: {\n Style,\n Fill,\n Stroke,\n Circle,\n RegularShape,\n Icon,\n },\n geom: {\n Point,\n LineString,\n Polygon,\n MultiPoint,\n MultiLineString,\n MultiPolygon,\n LinearRing,\n },\n extent: {\n getCenter,\n },\n Observable: {\n ...Observable,\n unByKey,\n },\n events: {\n ...events,\n condition: {\n ...condition,\n },\n },\n };\n window.ol.geom.Polygon.fromExtent = fromExtent;\n}\n\nif (!window.jsts) {\n window.jsts = {\n io: {\n OL3Parser,\n },\n operation: { buffer: { BufferOp }, overlay: { OverlayOp } },\n };\n}\n"],
5
- "mappings": "AAAA,OAAO,mBAAmB;AAC1B,OAAO,kBAAkB;AACzB,OAAO,aAAa;AACpB,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,aAAa;AACpB,OAAO,YAAY;AACnB,OAAO,YAAY;AACnB,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,YAAY;AACnB,OAAO,YAAY;AACnB,OAAO,UAAU;AACjB,OAAO,kBAAkB;AACzB,OAAO,gBAAgB;AACvB,OAAO,aAAa;AACpB,OAAO,cAAc,eAAe;AACpC,SAAS,iBAAiB;AAC1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,OAAO,gBAAgB;AACvB,SAAS,kBAAkB;AAC3B,YAAY,YAAY;AACxB,YAAY,eAAe;AAC3B,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAK1B,IAAI,CAAC,OAAO,IAAI;AACd,SAAO,KAAK;AAAA,IACV;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACL,QAAQ;AAAA,IACV;AAAA,IACA,QAAQ;AAAA,MACN,QAAQ;AAAA,IACV;AAAA,IACA,aAAa;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP;AAAA,IACF;AAAA,IACA,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,QAAQ;AAAA,MACN;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV,GAAG;AAAA,MACH;AAAA,IACF;AAAA,IACA,QAAQ;AAAA,MACN,GAAG;AAAA,MACH,WAAW;AAAA,QACT,GAAG;AAAA,MACL;AAAA,IACF;AAAA,EACF;AACA,SAAO,GAAG,KAAK,QAAQ,aAAa;AACtC;AAEA,IAAI,CAAC,OAAO,MAAM;AAChB,SAAO,OAAO;AAAA,IACZ,IAAI;AAAA,MACF;AAAA,IACF;AAAA,IACA,WAAW,EAAE,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,UAAU,EAAE;AAAA,EAC5D;AACF;",
4
+ "sourcesContent": ["import { OL3Parser } from \"jsts/org/locationtech/jts/io\";\nimport { BufferOp } from \"jsts/org/locationtech/jts/operation/buffer\";\nimport { OverlayOp } from \"jsts/org/locationtech/jts/operation/overlay\";\nimport Collection from \"ol/Collection\";\nimport Control from \"ol/control/Control\";\nimport * as events from \"ol/events\";\nimport * as condition from \"ol/events/condition\";\nimport { getCenter } from \"ol/extent\";\nimport Feature from \"ol/Feature\";\nimport {\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n} from \"ol/geom\";\nimport LinearRing from \"ol/geom/LinearRing\";\nimport { fromExtent } from \"ol/geom/Polygon\";\nimport Draw from \"ol/interaction/Draw\";\nimport Modify from \"ol/interaction/Modify\";\nimport Pointer from \"ol/interaction/Pointer\";\nimport Select from \"ol/interaction/Select\";\nimport Snap from \"ol/interaction/Snap\";\nimport OLVectorLayer from \"ol/layer/Vector\";\nimport Observable, { unByKey } from \"ol/Observable\";\nimport VectorSource from \"ol/source/Vector\";\nimport Circle from \"ol/style/Circle\";\nimport Fill from \"ol/style/Fill\";\nimport Icon from \"ol/style/Icon\";\nimport RegularShape from \"ol/style/RegularShape\";\nimport Stroke from \"ol/style/Stroke\";\nimport Style from \"ol/style/Style\";\n\n/**\n * This module create window.ol and window.jsts variables for ole editor.\n */\nif (!window.ol) {\n window.ol = {\n Collection,\n control: {\n Control,\n },\n events: {\n ...events,\n condition: {\n ...condition,\n },\n },\n extent: {\n getCenter,\n },\n Feature,\n geom: {\n LinearRing,\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n },\n interaction: {\n Draw,\n Modify,\n Pointer,\n Select,\n Snap,\n },\n layer: {\n Vector: OLVectorLayer,\n },\n Observable: {\n ...Observable,\n unByKey,\n },\n source: {\n Vector: VectorSource,\n },\n style: {\n Circle,\n Fill,\n Icon,\n RegularShape,\n Stroke,\n Style,\n },\n };\n window.ol.geom.Polygon.fromExtent = fromExtent;\n}\n\nif (!window.jsts) {\n window.jsts = {\n io: {\n OL3Parser,\n },\n operation: { buffer: { BufferOp }, overlay: { OverlayOp } },\n };\n}\n"],
5
+ "mappings": "AAAA,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,OAAO,gBAAgB;AACvB,OAAO,aAAa;AACpB,YAAY,YAAY;AACxB,YAAY,eAAe;AAC3B,SAAS,iBAAiB;AAC1B,OAAO,aAAa;AACpB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,OAAO,gBAAgB;AACvB,SAAS,kBAAkB;AAC3B,OAAO,UAAU;AACjB,OAAO,YAAY;AACnB,OAAO,aAAa;AACpB,OAAO,YAAY;AACnB,OAAO,UAAU;AACjB,OAAO,mBAAmB;AAC1B,OAAO,cAAc,eAAe;AACpC,OAAO,kBAAkB;AACzB,OAAO,YAAY;AACnB,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,kBAAkB;AACzB,OAAO,YAAY;AACnB,OAAO,WAAW;AAKlB,IAAI,CAAC,OAAO,IAAI;AACd,SAAO,KAAK;AAAA,IACV;AAAA,IACA,SAAS;AAAA,MACP;AAAA,IACF;AAAA,IACA,QAAQ;AAAA,MACN,GAAG;AAAA,MACH,WAAW;AAAA,QACT,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IACA,QAAQ;AAAA,MACN;AAAA,IACF;AAAA,IACA;AAAA,IACA,MAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,aAAa;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,OAAO;AAAA,MACL,QAAQ;AAAA,IACV;AAAA,IACA,YAAY;AAAA,MACV,GAAG;AAAA,MACH;AAAA,IACF;AAAA,IACA,QAAQ;AAAA,MACN,QAAQ;AAAA,IACV;AAAA,IACA,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAO,GAAG,KAAK,QAAQ,aAAa;AACtC;AAEA,IAAI,CAAC,OAAO,MAAM;AAChB,SAAO,OAAO;AAAA,IACZ,IAAI;AAAA,MACF;AAAA,IACF;AAAA,IACA,WAAW,EAAE,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,UAAU,EAAE;AAAA,EAC5D;AACF;",
6
6
  "names": []
7
7
  }