@rio-cloud/rio-uikit 0.16.2-beta.3 → 0.16.2-beta.5
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/.DS_Store +0 -0
- package/components/.DS_Store +0 -0
- package/components/autosuggest/AutoSuggest.js +2 -2
- package/components/filepicker/FilePicker.js +5 -4
- package/components/map/.DS_Store +0 -0
- package/components/map/assets/icon_map_settings_maptype_night_active.svg +12 -0
- package/components/map/assets/icon_map_settings_maptype_night_inactive.svg +12 -0
- package/components/map/components/.DS_Store +0 -0
- package/components/map/components/Map.js +54 -44
- package/components/map/components/constants.js +2 -4
- package/components/map/components/features/layers/baselayers/DefaultRasterLayer.js +4 -5
- package/components/map/components/features/layers/baselayers/DefaultVectorLayer.js +4 -3
- package/components/map/components/features/layers/baselayers/FleetStyleLayer.js +2 -2
- package/components/map/components/features/layers/baselayers/NightLayer.js +17 -0
- package/components/map/components/features/layers/baselayers/SatelliteLayer.js +2 -2
- package/components/map/components/features/layers/baselayers/TerrainLayer.js +2 -2
- package/components/map/components/features/layers/baselayers/useBaseLayer.js +27 -15
- package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +9 -3
- package/components/map/components/mapUtils.js +37 -7
- package/components/map/icons/MapIcon.js +64 -0
- package/components/mapMarker/SingleMapMarker.js +6 -0
- package/components/numberControl/NumberControl.js +34 -11
- package/components/numberInput/NumberInput.js +52 -50
- package/hooks/useDarkMode.js +29 -0
- package/hooks/useElementSize.js +1 -1
- package/hooks/useFullscreen.js +37 -41
- package/hooks/useMutationObserver.js +29 -0
- package/lib/.DS_Store +0 -0
- package/lib/es/.DS_Store +0 -0
- package/lib/es/components/.DS_Store +0 -0
- package/lib/es/components/autosuggest/AutoSuggest.js +2 -2
- package/lib/es/components/filepicker/FilePicker.js +5 -4
- package/lib/es/components/map/assets/icon_map_settings_maptype_night_active.svg +12 -0
- package/lib/es/components/map/assets/icon_map_settings_maptype_night_inactive.svg +12 -0
- package/lib/es/components/map/components/Map.js +53 -43
- package/lib/es/components/map/components/constants.js +3 -4
- package/lib/es/components/map/components/features/layers/baselayers/DefaultRasterLayer.js +4 -5
- package/lib/es/components/map/components/features/layers/baselayers/DefaultVectorLayer.js +4 -3
- package/lib/es/components/map/components/features/layers/baselayers/FleetStyleLayer.js +2 -2
- package/lib/es/components/map/components/features/layers/baselayers/NightLayer.js +23 -0
- package/lib/es/components/map/components/features/layers/baselayers/SatelliteLayer.js +2 -2
- package/lib/es/components/map/components/features/layers/baselayers/TerrainLayer.js +2 -2
- package/lib/es/components/map/components/features/layers/baselayers/useBaseLayer.js +28 -16
- package/lib/es/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +7 -1
- package/lib/es/components/map/components/mapUtils.js +37 -7
- package/lib/es/components/map/icons/MapIcon.js +67 -1
- package/lib/es/components/mapMarker/SingleMapMarker.js +6 -0
- package/lib/es/components/numberControl/NumberControl.js +33 -10
- package/lib/es/components/numberInput/NumberInput.js +51 -50
- package/lib/es/hooks/useDarkMode.js +37 -0
- package/lib/es/hooks/useElementSize.js +1 -1
- package/lib/es/hooks/useFullscreen.js +37 -41
- package/lib/es/hooks/useMutationObserver.js +35 -0
- package/lib/es/styles/.DS_Store +0 -0
- package/lib/es/styles/components/Dialog.less +1 -1
- package/lib/es/styles/mapping/color-map.less +11 -11
- package/lib/es/themes/.DS_Store +0 -0
- package/lib/es/themes/Website/styles/rio-website.less +10 -5
- package/lib/es/types.ts +8 -2
- package/lib/es/utils/colorScheme.js +12 -3
- package/lib/es/utils/init.js +32 -34
- package/lib/es/version.json +1 -1
- package/package.json +33 -33
- package/styles/.DS_Store +0 -0
- package/styles/components/Dialog.less +1 -1
- package/styles/mapping/color-map.less +11 -11
- package/themes/.DS_Store +0 -0
- package/themes/Volkswagen/.DS_Store +0 -0
- package/themes/Website/.DS_Store +0 -0
- package/themes/Website/styles/rio-website.less +10 -5
- package/types.ts +8 -2
- package/utils/colorScheme.js +7 -3
- package/utils/init.js +32 -34
- package/version.json +1 -1
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.ZOOM_OUT = exports.ZOOM_IN = exports.WORKSHOP_POIS_INACTIVE = exports.WORKSHOP_POIS_ACTIVE = exports.TRAFFIC_INACTIVE = exports.TRAFFIC_ACTIVE = exports.SYSTEM_POIS_INACTIVE = exports.SYSTEM_POIS_ACTIVE = exports.ROAD_RESTRICTIONS_INACTIVE = exports.ROAD_RESTRICTIONS_ACTIVE = exports.NO_CLUSTER_INACTIVE = exports.NO_CLUSTER_ACTIVE = exports.MapIcon = exports.MAP_TYPE_TERRAIN_INACTIVE = exports.MAP_TYPE_TERRAIN_ACTIVE = exports.MAP_TYPE_SATELITE_INACTIVE = exports.MAP_TYPE_SATELITE_ACTIVE = exports.MAP_TYPE_FLAT_TRUCK_INACTIVE = exports.MAP_TYPE_FLAT_TRUCK_ACTIVE = exports.MAP_TYPE_FLAT_INACTIVE = exports.MAP_TYPE_FLAT_ACTIVE = exports.LOCK_INACTIVE = exports.LOCK_ACTIVE = exports.LAYER_INACTIVE = exports.LAYER_ACTIVE = exports.CONSTRUCTION_INACTIVE = exports.CONSTRUCTION_ACTIVE = exports.CLUSTER_INACTIVE = exports.CLUSTER_ACTIVE = exports.CENTER_MARKER_INACTIVE = exports.CENTER_MARKER_ACTIVE = exports.BOUNDING_BOX_INACTIVE = exports.BOUNDING_BOX_ACTIVE = void 0;
|
|
7
|
+
exports.ZOOM_OUT = exports.ZOOM_IN = exports.WORKSHOP_POIS_INACTIVE = exports.WORKSHOP_POIS_ACTIVE = exports.TRAFFIC_INACTIVE = exports.TRAFFIC_ACTIVE = exports.SYSTEM_POIS_INACTIVE = exports.SYSTEM_POIS_ACTIVE = exports.ROAD_RESTRICTIONS_INACTIVE = exports.ROAD_RESTRICTIONS_ACTIVE = exports.NO_CLUSTER_INACTIVE = exports.NO_CLUSTER_ACTIVE = exports.MapIcon = exports.MAP_TYPE_TERRAIN_INACTIVE = exports.MAP_TYPE_TERRAIN_ACTIVE = exports.MAP_TYPE_SATELITE_INACTIVE = exports.MAP_TYPE_SATELITE_ACTIVE = exports.MAP_TYPE_NIGHT_INACTIVE = exports.MAP_TYPE_NIGHT_ACTIVE = exports.MAP_TYPE_FLAT_TRUCK_INACTIVE = exports.MAP_TYPE_FLAT_TRUCK_ACTIVE = exports.MAP_TYPE_FLAT_INACTIVE = exports.MAP_TYPE_FLAT_ACTIVE = exports.LOCK_INACTIVE = exports.LOCK_ACTIVE = exports.LAYER_INACTIVE = exports.LAYER_ACTIVE = exports.CONSTRUCTION_INACTIVE = exports.CONSTRUCTION_ACTIVE = exports.CLUSTER_INACTIVE = exports.CLUSTER_ACTIVE = exports.CENTER_MARKER_INACTIVE = exports.CENTER_MARKER_ACTIVE = exports.BOUNDING_BOX_INACTIVE = exports.BOUNDING_BOX_ACTIVE = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
/* eslint-disable max-len */
|
|
10
10
|
|
|
@@ -71,6 +71,10 @@ var MAP_TYPE_TERRAIN_ACTIVE = 'mapTypeTerrainActive';
|
|
|
71
71
|
exports.MAP_TYPE_TERRAIN_ACTIVE = MAP_TYPE_TERRAIN_ACTIVE;
|
|
72
72
|
var MAP_TYPE_TERRAIN_INACTIVE = 'mapTypeTerrainInactive';
|
|
73
73
|
exports.MAP_TYPE_TERRAIN_INACTIVE = MAP_TYPE_TERRAIN_INACTIVE;
|
|
74
|
+
var MAP_TYPE_NIGHT_ACTIVE = 'mapTypeNightActive';
|
|
75
|
+
exports.MAP_TYPE_NIGHT_ACTIVE = MAP_TYPE_NIGHT_ACTIVE;
|
|
76
|
+
var MAP_TYPE_NIGHT_INACTIVE = 'mapTypeNightInactive';
|
|
77
|
+
exports.MAP_TYPE_NIGHT_INACTIVE = MAP_TYPE_NIGHT_INACTIVE;
|
|
74
78
|
var NO_CLUSTER_ACTIVE = 'noClusterActive';
|
|
75
79
|
exports.NO_CLUSTER_ACTIVE = NO_CLUSTER_ACTIVE;
|
|
76
80
|
var NO_CLUSTER_INACTIVE = 'noClusterInactive';
|
|
@@ -358,6 +362,68 @@ var icons = {
|
|
|
358
362
|
fillRule: "evenodd",
|
|
359
363
|
d: "M0 20.2l20 11.333L40 20.2 20 8.867 0 20.2zm26.737-6.121c-.891.5-1.763.96-2.756 1.25-.073.02-.146.039-.22.057-.397-.188-.793-.374-1.186-.557a81.547 81.547 0 0 1-1.507-.71c-.245-.119-.487-.245-.733-.37a98.714 98.714 0 0 0 2.957-1.623l3.445 1.953zm3.755 2.129c-.924.518-1.918 1.035-2.961 1.298a35.637 35.637 0 0 0-1.605-.996 27.1 27.1 0 0 0-1.752-.925c1.037-.318 1.973-.82 2.873-1.33l3.445 1.953zm3.753 2.126a91.698 91.698 0 0 1-2.974 1.625c-.273-.168-.547-.336-.814-.51-.536-.344-1.065-.7-1.592-1.055-.332-.224-.669-.449-1.007-.672 1.063-.309 2.06-.84 2.943-1.34l3.444 1.952zm3.293 1.866l-2.984 1.69a108.786 108.786 0 0 1-2.983-1.743c1.003-.53 1.997-1.076 2.982-1.639l2.985 1.692zm-32.09-1.692a98.34 98.34 0 0 0 2.982 1.639c-1.01.616-2.027 1.199-2.984 1.743L2.463 20.2l2.985-1.692zM9.2 16.383c.882.497 1.88 1.03 2.942 1.34-.339.224-.674.449-1.004.67-.529.356-1.058.713-1.593 1.058-.268.173-.542.342-.815.51-1.008-.523-2-1.075-2.974-1.626L9.2 16.383zm7.508-4.255c.966.547 1.954 1.1 2.956 1.624-.244.124-.487.25-.733.37-.5.242-1.003.476-1.508.71-.391.18-.787.366-1.183.555-.073-.02-.143-.035-.22-.059-.993-.29-1.866-.747-2.758-1.25l3.446-1.95zm9.061 4.642c.454.262.9.543 1.342.827a5.05 5.05 0 0 1-1.106.085c-.444-.014-.832-.047-1.21-.078a15.38 15.38 0 0 0-.956-.062 16.057 16.057 0 0 0-.505-.54c-.488-.494-.956-.893-1.491-1.169.207.018.412.03.623.03a5.37 5.37 0 0 0 1.26-.155c.69.33 1.38.676 2.043 1.062zm-9.494-1.064c.477.113.883.156 1.26.156.218 0 .428-.014.64-.032-.544.279-1.019.677-1.493 1.158-.178.18-.35.365-.52.554-.319.01-.637.03-.955.062-.377.031-.766.066-1.21.078a5.32 5.32 0 0 1-1.105-.085c.44-.284.887-.563 1.34-.826.66-.387 1.352-.733 2.043-1.065zm3.734-.003c1.358.012 2.193.587 3.1 1.509.108.108.212.223.316.335-.888.046-1.728.345-2.806 1.386-.214.208-.42.424-.62.642-.2-.218-.406-.434-.62-.642-1.078-1.041-1.918-1.339-2.808-1.384.11-.117.217-.236.329-.35.907-.919 1.743-1.488 3.109-1.496zm-6.004 2.28c.41-.015.82-.042 1.228-.08.23-.02.447-.038.655-.05-.342.4-.678.806-1.006 1.217-.194.24-.387.479-.582.716-.669.81-1.254 1.432-1.84 1.964-.383-.182-.766-.36-1.144-.536a87.688 87.688 0 0 1-1.509-.71c-.255-.124-.506-.255-.76-.382.223-.139.448-.276.666-.418.537-.347 1.07-.7 1.598-1.06.402-.27.811-.545 1.225-.815.48.108.972.17 1.468.154h.001zm.532 1.992c.197-.237.391-.478.585-.719.382-.472.773-.954 1.185-1.418.952-.003 1.742.232 2.857 1.308.218.21.426.431.631.656-.416.472-.812.957-1.197 1.435-.526.653-1.07 1.33-1.663 1.945-.229.238-.468.46-.712.675-.511-.333-1.03-.66-1.56-.967-.622-.36-1.266-.69-1.91-1a18.968 18.968 0 0 0 1.784-1.915zm2.621 3.415c.603-.625 1.151-1.306 1.68-1.966.374-.464.757-.934 1.161-1.392.402.458.787.928 1.16 1.392.531.66 1.08 1.341 1.68 1.966.217.225.443.436.673.64-.374.246-.744.495-1.108.738-.53.358-1.061.715-1.6 1.063-.265.171-.536.336-.805.503-.27-.167-.54-.332-.805-.503a82.344 82.344 0 0 1-1.6-1.063c-.364-.243-.734-.492-1.108-.738.23-.203.456-.413.672-.64zm5.906-.206c-.593-.615-1.136-1.29-1.662-1.945a39.25 39.25 0 0 0-1.198-1.435c.204-.225.414-.446.632-.657 1.114-1.076 1.905-1.31 2.857-1.307.41.462.802.944 1.182 1.414.197.244.394.488.594.73a19.38 19.38 0 0 0 1.777 1.906c-.645.312-1.29.64-1.911 1.001a35.08 35.08 0 0 0-1.56.968c-.245-.216-.482-.44-.71-.675h-.001zm2.643-3.39c-.2-.24-.396-.484-.594-.728a46.52 46.52 0 0 0-1.005-1.214c.209.013.425.03.658.05.363.032.774.067 1.226.081a5.73 5.73 0 0 0 1.467-.159c.415.272.826.546 1.228.818.53.358 1.06.715 1.598 1.06.22.143.445.28.666.418-.252.129-.505.26-.76.382-.502.244-1.007.477-1.512.712-.377.174-.757.352-1.138.533-.587-.532-1.172-1.153-1.834-1.953zm-4.262-4.304a15.1 15.1 0 0 0-1.268-.09h-.003c-.013 0-.024.005-.035.007-.044-.002-.082-.008-.127-.008h-.003c-.045 0-.087.006-.132.008a.171.171 0 0 0-.057-.007c-.49.01-.903.052-1.269.09-.622.063-1.146.117-1.83.002.278-.13.556-.26.832-.387.505-.235 1.011-.47 1.513-.713.313-.151.622-.31.931-.47a45.06 45.06 0 0 0 2.444 1.181c.276.128.555.257.833.389-.683.113-1.205.061-1.829-.002zm-8.492-1.235c.901.51 1.836 1.012 2.873 1.33-.592.29-1.182.593-1.754.925a37.06 37.06 0 0 0-1.603.996c-1.045-.263-2.04-.779-2.963-1.298l3.447-1.953zm-4.208 6.052c.306.157.614.315.923.466.502.244 1.008.478 1.513.712.342.16.687.318 1.031.482-.878.758-1.787 1.34-3.015 2.05l-3.444-1.95c.965-.55 1.982-1.139 2.992-1.76zm3.766 1.802c.674.324 1.35.664 1.997 1.041.5.29.993.598 1.478.915-.982.83-2.04 1.502-3.035 2.078L9.506 24.19c1.192-.694 2.11-1.294 3.006-2.08l-.001-.001zm3.738 2.129c.395.26.786.522 1.17.78.533.36 1.065.716 1.605 1.066.227.144.457.288.688.43-1.02.622-2.042 1.21-3.006 1.757l-3.452-1.956c.986-.576 2.027-1.246 2.995-2.077zM20 26.693c1.01.62 2.025 1.207 2.985 1.753L20 30.139l-2.985-1.692c.962-.547 1.975-1.134 2.985-1.754zm.286-.178c.229-.143.46-.283.687-.43.54-.347 1.073-.706 1.605-1.065.385-.26.776-.52 1.172-.78.97.83 2.009 1.5 2.995 2.077l-3.452 1.956a112.097 112.097 0 0 1-3.007-1.758zm3.727-2.45c.486-.315.98-.625 1.478-.915.652-.373 1.319-.72 1.998-1.04.894.787 1.812 1.385 3.007 2.08l-3.446 1.954c-.994-.578-2.053-1.247-3.037-2.08v.001zm3.777-2.1c.343-.162.685-.322 1.023-.478.508-.233 1.014-.47 1.517-.713.31-.15.617-.308.923-.465 1.01.621 2.027 1.208 2.992 1.757L30.8 24.02c-1.205-.7-2.122-1.289-3.01-2.053v-.002zM20 13.584a94.01 94.01 0 0 1-2.983-1.63L20 10.26l2.984 1.69A89.36 89.36 0 0 1 20 13.583v.001z"
|
|
360
364
|
})),
|
|
365
|
+
mapTypeNightActive: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
366
|
+
width: "40",
|
|
367
|
+
height: "40",
|
|
368
|
+
viewBox: "0 0 40 40",
|
|
369
|
+
fill: "none",
|
|
370
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
371
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
372
|
+
fillRule: "evenodd",
|
|
373
|
+
clipRule: "evenodd",
|
|
374
|
+
d: "M0 20.322L19.98 31.644L39.96 20.322L19.98 9L0 20.322ZM5.363 22.178C5.363 22.178 2.01 20.254 2.01 20.256L5.363 18.354L8.717 20.254L5.363 22.178V22.178ZM8.98 24.24L5.626 22.317L8.98 20.417L12.333 22.316L8.98 24.24ZM12.614 26.277C12.614 26.277 9.261 24.352 9.261 24.354L12.614 22.454L15.967 24.352L12.614 26.277V26.277ZM16.25 28.317L12.897 26.394L16.25 24.494L19.603 26.393L16.25 28.317V28.317ZM19.887 30.392L16.534 28.469L19.887 26.569L23.241 28.468L19.887 30.392ZM9.11 20.128C9.11 20.128 5.757 18.204 5.757 18.206L9.11 16.304L12.464 18.204L9.11 20.128V20.128ZM12.727 22.19L9.373 20.267L12.727 18.367L16.08 20.266L12.727 22.19V22.19ZM16.361 24.227L13.008 22.304L16.361 20.404L19.714 22.303L16.361 24.227V24.227ZM19.997 26.267C19.997 26.267 16.644 24.343 16.644 24.345L19.997 22.443L23.35 24.343L19.997 26.267V26.267ZM23.634 28.342L20.28 26.419L23.633 24.519L26.987 26.418L23.633 28.342H23.634V28.342ZM12.76 18.038C12.76 18.038 9.407 16.114 9.407 16.116L12.76 14.214L16.113 16.114L12.76 18.038ZM16.376 20.1L13.023 18.177L16.376 16.277L19.729 18.176L16.376 20.1ZM20.011 22.137C20.011 22.137 16.658 20.212 16.658 20.214L20.011 18.313L23.364 20.213L20.011 22.137V22.137ZM23.647 24.177L20.294 22.254L23.647 20.354L27 22.253L23.647 24.177ZM27.284 26.252L23.931 24.329L27.284 22.429L30.637 24.328L27.284 26.252V26.252ZM16.367 15.964L13.014 14.041L16.367 12.141L19.721 14.04L16.367 15.964V15.964ZM19.983 18.026L16.63 16.102L19.983 14.202L23.337 16.101L19.983 18.025V18.026ZM23.618 20.063C23.618 20.063 20.265 18.138 20.265 18.14L23.618 16.239L26.971 18.139L23.618 20.063ZM27.254 22.103L23.901 20.18L27.254 18.28L30.607 20.179L27.254 22.103V22.103ZM30.891 24.178C30.891 24.178 27.538 22.253 27.538 22.255L30.891 20.355L34.244 22.253L30.891 24.178V24.178ZM20.061 13.835C20.061 13.835 16.707 11.91 16.707 11.912L20.06 10.011L23.413 11.911L20.06 13.835H20.061V13.835ZM23.676 15.896C23.676 15.896 20.323 13.972 20.323 13.974L23.676 12.073L27.03 13.972L23.676 15.896ZM27.311 17.933C27.311 17.933 23.958 16.009 23.958 16.011L27.311 14.109L30.664 16.009L27.311 17.933ZM30.947 19.973C30.947 19.973 27.594 18.049 27.594 18.051L30.947 16.15L34.3 18.05L30.947 19.973V19.973ZM34.584 22.048C34.584 22.048 31.231 20.124 31.231 20.126L34.584 18.225L37.937 20.124L34.584 22.048Z",
|
|
375
|
+
fill: "#30B4C0"
|
|
376
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
377
|
+
fillRule: "evenodd",
|
|
378
|
+
clipRule: "evenodd",
|
|
379
|
+
d: "M12.352 3.14533C12.4221 3.2154 12.4698 3.3047 12.489 3.40192C12.5082 3.49913 12.4981 3.59987 12.46 3.69133C12.1552 4.42281 11.9989 5.20757 12 6C12 7.5913 12.6321 9.11742 13.7574 10.2426C14.8826 11.3679 16.4087 12 18 12C18.7924 12.0011 19.5772 11.8448 20.3087 11.54C20.4001 11.5019 20.5007 11.4919 20.5978 11.5111C20.695 11.5303 20.7842 11.5779 20.8543 11.6478C20.9243 11.7178 20.972 11.807 20.9913 11.9041C21.0106 12.0012 21.0006 12.1019 20.9627 12.1933C20.4307 13.4688 19.5332 14.5584 18.3831 15.3248C17.2331 16.0911 15.882 16.5 14.5 16.5C10.634 16.5 7.5 13.366 7.5 9.5C7.5 6.588 9.278 4.092 11.8067 3.03733C11.898 2.99935 11.9986 2.98933 12.0957 3.00856C12.1928 3.02778 12.282 3.07538 12.352 3.14533V3.14533Z",
|
|
380
|
+
fill: "#30B4C0"
|
|
381
|
+
}), /*#__PURE__*/_react["default"].createElement("g", {
|
|
382
|
+
clipPath: "url(#clip0_1_2)"
|
|
383
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
384
|
+
fillRule: "evenodd",
|
|
385
|
+
clipRule: "evenodd",
|
|
386
|
+
d: "M25.5 4.25C25.5815 4.25002 25.6607 4.27657 25.7258 4.32565C25.7908 4.37473 25.8381 4.44365 25.8605 4.522L26.267 5.945C26.3545 6.25146 26.5187 6.53055 26.7441 6.75591C26.9695 6.98128 27.2485 7.14548 27.555 7.233L28.978 7.6395C29.0563 7.66193 29.1252 7.70924 29.1742 7.77428C29.2232 7.83932 29.2497 7.91855 29.2497 8C29.2497 8.08145 29.2232 8.16068 29.1742 8.22572C29.1252 8.29076 29.0563 8.33807 28.978 8.3605L27.555 8.767C27.2485 8.85452 26.9695 9.01872 26.7441 9.24409C26.5187 9.46945 26.3545 9.74854 26.267 10.055L25.8605 11.478C25.8381 11.5563 25.7908 11.6252 25.7257 11.6742C25.6607 11.7232 25.5815 11.7497 25.5 11.7497C25.4186 11.7497 25.3393 11.7232 25.2743 11.6742C25.2092 11.6252 25.1619 11.5563 25.1395 11.478L24.733 10.055C24.6455 9.74854 24.4813 9.46945 24.2559 9.24409C24.0306 9.01872 23.7515 8.85452 23.445 8.767L22.022 8.3605C21.9437 8.33807 21.8748 8.29076 21.8258 8.22572C21.7768 8.16068 21.7503 8.08145 21.7503 8C21.7503 7.91855 21.7768 7.83932 21.8258 7.77428C21.8748 7.70924 21.9437 7.66193 22.022 7.6395L23.445 7.233C23.7515 7.14548 24.0306 6.98128 24.2559 6.75591C24.4813 6.53055 24.6455 6.25146 24.733 5.945L25.1395 4.522C25.1619 4.44365 25.2092 4.37473 25.2742 4.32565C25.3393 4.27657 25.4185 4.25002 25.5 4.25ZM30 2.75C30.0837 2.74995 30.1649 2.77788 30.2309 2.82934C30.2968 2.8808 30.3437 2.95284 30.364 3.034L30.493 3.552C30.611 4.022 30.978 4.389 31.448 4.507L31.966 4.636C32.0473 4.65614 32.1195 4.70293 32.1712 4.7689C32.2228 4.83487 32.2508 4.91623 32.2508 5C32.2508 5.08377 32.2228 5.16513 32.1712 5.2311C32.1195 5.29707 32.0473 5.34386 31.966 5.364L31.448 5.493C30.978 5.611 30.611 5.978 30.493 6.448L30.364 6.966C30.3439 7.04731 30.2971 7.11954 30.2311 7.17117C30.1651 7.22279 30.0838 7.25084 30 7.25084C29.9162 7.25084 29.8349 7.22279 29.7689 7.17117C29.7029 7.11954 29.6561 7.04731 29.636 6.966L29.507 6.448C29.4493 6.21721 29.33 6.00645 29.1618 5.83824C28.9936 5.67003 28.7828 5.55069 28.552 5.493L28.034 5.364C27.9527 5.34386 27.8805 5.29707 27.8288 5.2311C27.7772 5.16513 27.7492 5.08377 27.7492 5C27.7492 4.91623 27.7772 4.83487 27.8288 4.7689C27.8805 4.70293 27.9527 4.65614 28.034 4.636L28.552 4.507C28.7828 4.44931 28.9936 4.32997 29.1618 4.16176C29.33 3.99355 29.4493 3.78279 29.507 3.552L29.636 3.034C29.6563 2.95284 29.7032 2.8808 29.7691 2.82934C29.8351 2.77788 29.9163 2.74995 30 2.75V2.75ZM29.25 9.5C29.3288 9.49995 29.4055 9.52471 29.4694 9.57075C29.5333 9.61679 29.5811 9.68178 29.606 9.7565L29.803 10.348C29.878 10.5715 30.053 10.7475 30.277 10.822L30.8685 11.0195C30.943 11.0445 31.0077 11.0923 31.0536 11.1561C31.0995 11.2198 31.1242 11.2964 31.1242 11.375C31.1242 11.4536 31.0995 11.5302 31.0536 11.5939C31.0077 11.6577 30.943 11.7055 30.8685 11.7305L30.277 11.928C30.0535 12.003 29.8775 12.178 29.803 12.402L29.6055 12.9935C29.5805 13.068 29.5327 13.1327 29.4689 13.1786C29.4052 13.2245 29.3286 13.2491 29.25 13.2491C29.1714 13.2491 29.0949 13.2245 29.0311 13.1786C28.9673 13.1327 28.9195 13.068 28.8945 12.9935L28.697 12.402C28.6602 12.2916 28.5982 12.1914 28.5159 12.1091C28.4336 12.0268 28.3334 11.9648 28.223 11.928L27.6315 11.7305C27.557 11.7055 27.4923 11.6577 27.4464 11.5939C27.4005 11.5302 27.3759 11.4536 27.3759 11.375C27.3759 11.2964 27.4005 11.2198 27.4464 11.1561C27.4923 11.0923 27.557 11.0445 27.6315 11.0195L28.223 10.822C28.4465 10.747 28.6225 10.572 28.697 10.348L28.8945 9.7565C28.9194 9.68186 28.9671 9.61693 29.0309 9.57089C29.0947 9.52486 29.1713 9.50006 29.25 9.5V9.5Z",
|
|
387
|
+
fill: "#30B4C0"
|
|
388
|
+
})), /*#__PURE__*/_react["default"].createElement("defs", null, /*#__PURE__*/_react["default"].createElement("clipPath", {
|
|
389
|
+
id: "clip0_1_2"
|
|
390
|
+
}, /*#__PURE__*/_react["default"].createElement("rect", {
|
|
391
|
+
width: "12",
|
|
392
|
+
height: "12",
|
|
393
|
+
fill: "white",
|
|
394
|
+
transform: "translate(21 2)"
|
|
395
|
+
})))),
|
|
396
|
+
mapTypeNightInactive: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
397
|
+
width: "40",
|
|
398
|
+
height: "40",
|
|
399
|
+
viewBox: "0 0 40 40",
|
|
400
|
+
fill: "none",
|
|
401
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
402
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
403
|
+
fillRule: "evenodd",
|
|
404
|
+
clipRule: "evenodd",
|
|
405
|
+
d: "M0.0199966 20.2L20 31.522L39.98 20.2L20 8.878L0.0199966 20.2ZM5.383 22.056C5.383 22.056 2.03 20.132 2.03 20.134L5.383 18.232L8.737 20.132L5.383 22.056V22.056ZM9 24.118L5.646 22.195L9 20.295L12.353 22.194L9 24.118ZM12.634 26.155C12.634 26.155 9.281 24.23 9.281 24.232L12.634 22.332L15.987 24.23L12.634 26.155V26.155ZM16.27 28.195L12.917 26.272L16.27 24.372L19.623 26.271L16.27 28.195V28.195ZM19.907 30.27L16.554 28.347L19.907 26.447L23.261 28.346L19.907 30.27ZM9.13 20.006C9.13 20.006 5.777 18.082 5.777 18.084L9.13 16.182L12.484 18.082L9.13 20.006V20.006ZM12.747 22.068L9.393 20.145L12.747 18.245L16.1 20.144L12.747 22.068V22.068ZM16.381 24.105L13.028 22.182L16.381 20.282L19.734 22.181L16.381 24.105V24.105ZM20.017 26.145C20.017 26.145 16.664 24.221 16.664 24.223L20.017 22.321L23.37 24.221L20.017 26.145V26.145ZM23.654 28.22L20.3 26.297L23.653 24.397L27.007 26.296L23.653 28.22H23.654V28.22ZM12.78 17.916C12.78 17.916 9.427 15.992 9.427 15.994L12.78 14.092L16.133 15.992L12.78 17.916ZM16.396 19.978L13.043 18.055L16.396 16.155L19.749 18.054L16.396 19.978ZM20.031 22.015C20.031 22.015 16.678 20.09 16.678 20.092L20.031 18.191L23.384 20.091L20.031 22.015V22.015ZM23.667 24.055L20.314 22.132L23.667 20.232L27.02 22.131L23.667 24.055ZM27.304 26.13L23.951 24.207L27.304 22.307L30.657 24.206L27.304 26.13V26.13ZM16.387 15.842L13.034 13.919L16.387 12.019L19.741 13.918L16.387 15.842V15.842ZM20.003 17.904L16.65 15.98L20.003 14.08L23.357 15.979L20.003 17.903V17.904ZM23.638 19.941C23.638 19.941 20.285 18.016 20.285 18.018L23.638 16.117L26.991 18.017L23.638 19.941ZM27.274 21.981L23.921 20.058L27.274 18.158L30.627 20.057L27.274 21.981V21.981ZM30.911 24.056C30.911 24.056 27.558 22.131 27.558 22.133L30.911 20.233L34.264 22.131L30.911 24.056V24.056ZM20.081 13.713C20.081 13.713 16.727 11.788 16.727 11.79L20.08 9.889L23.433 11.789L20.08 13.713H20.081V13.713ZM23.696 15.774C23.696 15.774 20.343 13.85 20.343 13.852L23.696 11.951L27.05 13.85L23.696 15.774ZM27.331 17.811C27.331 17.811 23.978 15.887 23.978 15.889L27.331 13.987L30.684 15.887L27.331 17.811ZM30.967 19.851C30.967 19.851 27.614 17.927 27.614 17.929L30.967 16.028L34.32 17.928L30.967 19.851V19.851ZM34.604 21.926C34.604 21.926 31.251 20.002 31.251 20.004L34.604 18.103L37.957 20.002L34.604 21.926Z",
|
|
406
|
+
fill: "#939BA8"
|
|
407
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
408
|
+
fillRule: "evenodd",
|
|
409
|
+
clipRule: "evenodd",
|
|
410
|
+
d: "M12.352 3.14533C12.4221 3.2154 12.4698 3.3047 12.489 3.40192C12.5082 3.49913 12.4981 3.59987 12.46 3.69133C12.1552 4.42281 11.9989 5.20757 12 6C12 7.5913 12.6321 9.11742 13.7574 10.2426C14.8826 11.3679 16.4087 12 18 12C18.7924 12.0011 19.5772 11.8448 20.3087 11.54C20.4001 11.5019 20.5007 11.4919 20.5978 11.5111C20.695 11.5303 20.7842 11.5779 20.8543 11.6478C20.9243 11.7178 20.972 11.807 20.9913 11.9041C21.0106 12.0012 21.0006 12.1019 20.9627 12.1933C20.4307 13.4688 19.5332 14.5584 18.3831 15.3248C17.2331 16.0911 15.882 16.5 14.5 16.5C10.634 16.5 7.5 13.366 7.5 9.5C7.5 6.588 9.278 4.092 11.8067 3.03733C11.898 2.99935 11.9986 2.98933 12.0957 3.00856C12.1928 3.02778 12.282 3.07538 12.352 3.14533V3.14533Z",
|
|
411
|
+
fill: "#939BA8"
|
|
412
|
+
}), /*#__PURE__*/_react["default"].createElement("g", {
|
|
413
|
+
clipPath: "url(#clip0_1_4)"
|
|
414
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
415
|
+
fillRule: "evenodd",
|
|
416
|
+
clipRule: "evenodd",
|
|
417
|
+
d: "M25.5 4.25C25.5815 4.25002 25.6607 4.27657 25.7258 4.32565C25.7908 4.37473 25.8381 4.44365 25.8605 4.522L26.267 5.945C26.3545 6.25146 26.5187 6.53055 26.7441 6.75591C26.9694 6.98128 27.2485 7.14548 27.555 7.233L28.978 7.6395C29.0563 7.66193 29.1252 7.70924 29.1742 7.77428C29.2232 7.83932 29.2497 7.91855 29.2497 8C29.2497 8.08145 29.2232 8.16068 29.1742 8.22572C29.1252 8.29076 29.0563 8.33807 28.978 8.3605L27.555 8.767C27.2485 8.85452 26.9694 9.01872 26.7441 9.24409C26.5187 9.46945 26.3545 9.74854 26.267 10.055L25.8605 11.478C25.8381 11.5563 25.7908 11.6252 25.7257 11.6742C25.6607 11.7232 25.5814 11.7497 25.5 11.7497C25.4185 11.7497 25.3393 11.7232 25.2743 11.6742C25.2092 11.6252 25.1619 11.5563 25.1395 11.478L24.733 10.055C24.6455 9.74854 24.4813 9.46945 24.2559 9.24409C24.0305 9.01872 23.7515 8.85452 23.445 8.767L22.022 8.3605C21.9437 8.33807 21.8748 8.29076 21.8258 8.22572C21.7768 8.16068 21.7503 8.08145 21.7503 8C21.7503 7.91855 21.7768 7.83932 21.8258 7.77428C21.8748 7.70924 21.9437 7.66193 22.022 7.6395L23.445 7.233C23.7515 7.14548 24.0305 6.98128 24.2559 6.75591C24.4813 6.53055 24.6455 6.25146 24.733 5.945L25.1395 4.522C25.1619 4.44365 25.2092 4.37473 25.2742 4.32565C25.3393 4.27657 25.4185 4.25002 25.5 4.25ZM30 2.75C30.0837 2.74995 30.1649 2.77788 30.2309 2.82934C30.2968 2.8808 30.3437 2.95284 30.364 3.034L30.493 3.552C30.611 4.022 30.978 4.389 31.448 4.507L31.966 4.636C32.0473 4.65614 32.1195 4.70293 32.1712 4.7689C32.2228 4.83487 32.2508 4.91623 32.2508 5C32.2508 5.08377 32.2228 5.16513 32.1712 5.2311C32.1195 5.29707 32.0473 5.34386 31.966 5.364L31.448 5.493C30.978 5.611 30.611 5.978 30.493 6.448L30.364 6.966C30.3439 7.04731 30.2971 7.11954 30.2311 7.17117C30.1651 7.22279 30.0838 7.25084 30 7.25084C29.9162 7.25084 29.8349 7.22279 29.7689 7.17117C29.7029 7.11954 29.6561 7.04731 29.636 6.966L29.507 6.448C29.4493 6.21721 29.33 6.00645 29.1618 5.83824C28.9935 5.67003 28.7828 5.55069 28.552 5.493L28.034 5.364C27.9527 5.34386 27.8805 5.29707 27.8288 5.2311C27.7772 5.16513 27.7492 5.08377 27.7492 5C27.7492 4.91623 27.7772 4.83487 27.8288 4.7689C27.8805 4.70293 27.9527 4.65614 28.034 4.636L28.552 4.507C28.7828 4.44931 28.9935 4.32997 29.1618 4.16176C29.33 3.99355 29.4493 3.78279 29.507 3.552L29.636 3.034C29.6563 2.95284 29.7032 2.8808 29.7691 2.82934C29.8351 2.77788 29.9163 2.74995 30 2.75V2.75ZM29.25 9.5C29.3288 9.49995 29.4055 9.52471 29.4694 9.57075C29.5333 9.61679 29.5811 9.68178 29.606 9.7565L29.803 10.348C29.878 10.5715 30.053 10.7475 30.277 10.822L30.8685 11.0195C30.943 11.0445 31.0077 11.0923 31.0536 11.1561C31.0995 11.2198 31.1241 11.2964 31.1241 11.375C31.1241 11.4536 31.0995 11.5302 31.0536 11.5939C31.0077 11.6577 30.943 11.7055 30.8685 11.7305L30.277 11.928C30.0535 12.003 29.8775 12.178 29.803 12.402L29.6055 12.9935C29.5805 13.068 29.5327 13.1327 29.4689 13.1786C29.4051 13.2245 29.3286 13.2491 29.25 13.2491C29.1714 13.2491 29.0948 13.2245 29.0311 13.1786C28.9673 13.1327 28.9195 13.068 28.8945 12.9935L28.697 12.402C28.6602 12.2916 28.5982 12.1914 28.5159 12.1091C28.4336 12.0268 28.3334 11.9648 28.223 11.928L27.6315 11.7305C27.557 11.7055 27.4923 11.6577 27.4464 11.5939C27.4005 11.5302 27.3758 11.4536 27.3758 11.375C27.3758 11.2964 27.4005 11.2198 27.4464 11.1561C27.4923 11.0923 27.557 11.0445 27.6315 11.0195L28.223 10.822C28.4465 10.747 28.6225 10.572 28.697 10.348L28.8945 9.7565C28.9194 9.68186 28.9671 9.61693 29.0309 9.57089C29.0947 9.52486 29.1713 9.50006 29.25 9.5V9.5Z",
|
|
418
|
+
fill: "#939BA8"
|
|
419
|
+
})), /*#__PURE__*/_react["default"].createElement("defs", null, /*#__PURE__*/_react["default"].createElement("clipPath", {
|
|
420
|
+
id: "clip0_1_4"
|
|
421
|
+
}, /*#__PURE__*/_react["default"].createElement("rect", {
|
|
422
|
+
width: "12",
|
|
423
|
+
height: "12",
|
|
424
|
+
fill: "white",
|
|
425
|
+
transform: "translate(21 2)"
|
|
426
|
+
})))),
|
|
361
427
|
noClusterActive: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
362
428
|
xmlns: "http://www.w3.org/2000/svg",
|
|
363
429
|
width: "40",
|
|
@@ -49,6 +49,9 @@ var SingleMapMarker = function SingleMapMarker(props) {
|
|
|
49
49
|
textColor = props.textColor,
|
|
50
50
|
warningCount = props.warningCount,
|
|
51
51
|
fixed = props.fixed;
|
|
52
|
+
|
|
53
|
+
// TODO: check if we still need "colorClass"
|
|
54
|
+
|
|
52
55
|
if (colorClass) {
|
|
53
56
|
// warnung
|
|
54
57
|
}
|
|
@@ -59,6 +62,9 @@ var SingleMapMarker = function SingleMapMarker(props) {
|
|
|
59
62
|
};
|
|
60
63
|
var mapDirection = getMapDirection(moving, bearing, rotationStyle);
|
|
61
64
|
var baseColor = getColorMapping(colorClass, markerColor);
|
|
65
|
+
|
|
66
|
+
// const baseColorWithMode = isDarkMode ?
|
|
67
|
+
|
|
62
68
|
var markerBackgroundColor = active ? 'bg-map-marker-active' : baseColor;
|
|
63
69
|
var markerBorderColor = baseColor.replace('bg-', 'border-color-');
|
|
64
70
|
var markerTextColor = active ? baseColor.replace('bg-', 'text-color-') : 'color-map-marker-text';
|
|
@@ -13,12 +13,12 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
15
|
var _NumberInput = _interopRequireWildcard(require("../numberInput/NumberInput"));
|
|
16
|
-
var _excluded = ["min", "max", "step", "value", "onValueChanged", "disabled", "bsSize", "className", "unit", "inputAddon"];
|
|
16
|
+
var _excluded = ["min", "max", "step", "value", "onValueChanged", "disabled", "bsSize", "className", "unit", "inputAddon", "digitPrecision", "placeholder"];
|
|
17
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
19
|
var INITIAL_TICK = 700;
|
|
20
20
|
var TICK_TIME = 50;
|
|
21
|
-
var NumberControl = function
|
|
21
|
+
var NumberControl = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
22
22
|
var _props$min = props.min,
|
|
23
23
|
min = _props$min === void 0 ? _NumberInput.defaultProps.min : _props$min,
|
|
24
24
|
_props$max = props.max,
|
|
@@ -34,6 +34,9 @@ var NumberControl = function NumberControl(props) {
|
|
|
34
34
|
className = props.className,
|
|
35
35
|
unit = props.unit,
|
|
36
36
|
inputAddon = props.inputAddon,
|
|
37
|
+
_props$digitPrecision = props.digitPrecision,
|
|
38
|
+
digitPrecision = _props$digitPrecision === void 0 ? 3 : _props$digitPrecision,
|
|
39
|
+
placeholder = props.placeholder,
|
|
37
40
|
remainingProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
38
41
|
var timeout = (0, _react.useRef)();
|
|
39
42
|
var _useState = (0, _react.useState)(false),
|
|
@@ -59,6 +62,20 @@ var NumberControl = function NumberControl(props) {
|
|
|
59
62
|
callback();
|
|
60
63
|
}, TICK_TIME);
|
|
61
64
|
};
|
|
65
|
+
|
|
66
|
+
// Update internal state if external value has changed
|
|
67
|
+
(0, _react.useEffect)(function () {
|
|
68
|
+
if (internalValue !== value) {
|
|
69
|
+
setInternalValue(value);
|
|
70
|
+
}
|
|
71
|
+
}, [value]);
|
|
72
|
+
|
|
73
|
+
// Notify external component if internal value has changed
|
|
74
|
+
(0, _react.useEffect)(function () {
|
|
75
|
+
if (internalValue !== value) {
|
|
76
|
+
onValueChanged(internalValue);
|
|
77
|
+
}
|
|
78
|
+
}, [internalValue]);
|
|
62
79
|
(0, _react.useEffect)(function () {
|
|
63
80
|
// Call increment function for a loop when button is holding down
|
|
64
81
|
if (isHoldingDownInc && !disabled) {
|
|
@@ -73,15 +90,17 @@ var NumberControl = function NumberControl(props) {
|
|
|
73
90
|
var incrementInternalValue = function incrementInternalValue() {
|
|
74
91
|
setInternalValue(function (val) {
|
|
75
92
|
var currentValue = (0, _NumberInput.convertNonIntegerToDefault)(val);
|
|
76
|
-
var newValue = currentValue + step;
|
|
77
|
-
|
|
93
|
+
var newValue = Number((currentValue + step).toFixed(digitPrecision));
|
|
94
|
+
var newValueLimited = newValue <= max ? newValue : val;
|
|
95
|
+
return newValueLimited;
|
|
78
96
|
});
|
|
79
97
|
};
|
|
80
98
|
var decrementInternalValue = function decrementInternalValue() {
|
|
81
99
|
setInternalValue(function (val) {
|
|
82
100
|
var currentValue = (0, _NumberInput.convertNonIntegerToDefault)(val);
|
|
83
|
-
var newValue = currentValue - step;
|
|
84
|
-
|
|
101
|
+
var newValue = Number((currentValue - step).toFixed(digitPrecision));
|
|
102
|
+
var newValueLimited = newValue >= min ? newValue : val;
|
|
103
|
+
return newValueLimited;
|
|
85
104
|
});
|
|
86
105
|
};
|
|
87
106
|
var incrementRecusively = function incrementRecusively() {
|
|
@@ -120,7 +139,7 @@ var NumberControl = function NumberControl(props) {
|
|
|
120
139
|
// for instance the user has typed in a number manually and to
|
|
121
140
|
// use this number as base to increase or decrease from.
|
|
122
141
|
// Ignore empty value in case the user has removed it
|
|
123
|
-
if (value && (
|
|
142
|
+
if (value !== undefined && !(isHoldingDownDec && isHoldingDownInc)) {
|
|
124
143
|
setInternalValue(Number(value));
|
|
125
144
|
}
|
|
126
145
|
onValueChanged(value);
|
|
@@ -136,12 +155,14 @@ var NumberControl = function NumberControl(props) {
|
|
|
136
155
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
137
156
|
className: inputAddon
|
|
138
157
|
})), /*#__PURE__*/_react["default"].createElement(_NumberInput["default"], {
|
|
158
|
+
ref: ref,
|
|
139
159
|
min: min,
|
|
140
160
|
max: max,
|
|
141
161
|
value: internalValue,
|
|
142
162
|
step: step,
|
|
143
163
|
disabled: disabled,
|
|
144
|
-
onValueChanged: handleUpdatedNumberInputValue
|
|
164
|
+
onValueChanged: handleUpdatedNumberInputValue,
|
|
165
|
+
placeholder: placeholder
|
|
145
166
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
146
167
|
className: 'input-group-addon'
|
|
147
168
|
}, unit && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -163,7 +184,7 @@ var NumberControl = function NumberControl(props) {
|
|
|
163
184
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
164
185
|
className: 'rioglyph rioglyph-plus scale-90'
|
|
165
186
|
})))));
|
|
166
|
-
};
|
|
187
|
+
});
|
|
167
188
|
NumberControl.propTypes = {
|
|
168
189
|
min: _propTypes["default"].number,
|
|
169
190
|
max: _propTypes["default"].number,
|
|
@@ -174,7 +195,9 @@ NumberControl.propTypes = {
|
|
|
174
195
|
bsSize: _propTypes["default"].string,
|
|
175
196
|
className: _propTypes["default"].string,
|
|
176
197
|
unit: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node]),
|
|
177
|
-
inputAddon: _propTypes["default"].string
|
|
198
|
+
inputAddon: _propTypes["default"].string,
|
|
199
|
+
digitPrecision: _propTypes["default"].number,
|
|
200
|
+
placeholder: _propTypes["default"].string
|
|
178
201
|
};
|
|
179
202
|
var _default = NumberControl;
|
|
180
203
|
exports["default"] = _default;
|
|
@@ -13,21 +13,26 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
15
|
var _useAfterMount = _interopRequireDefault(require("../../hooks/useAfterMount"));
|
|
16
|
-
var _excluded = ["unit", "inputAddon", "className", "bsSize", "disabled", "onValueChanged", "min", "max", "value", "step", "
|
|
16
|
+
var _excluded = ["unit", "inputAddon", "className", "bsSize", "disabled", "onValueChanged", "min", "max", "value", "step", "placeholder"];
|
|
17
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
// Note: even if limits are set and input type is number, many browsers allow to enter invalid data
|
|
20
|
+
// like entering characters or values outside the boundaries, hence we have to check the input here
|
|
21
|
+
// See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number
|
|
22
|
+
|
|
19
23
|
var defaultProps = {
|
|
20
24
|
min: 0,
|
|
21
25
|
max: Number.MAX_VALUE,
|
|
22
|
-
value: 0,
|
|
23
26
|
step: 1
|
|
24
27
|
};
|
|
25
28
|
exports.defaultProps = defaultProps;
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
var DEFAULT_VALUE = 0;
|
|
30
|
+
var getValueFromProps = function getValueFromProps(val, min, max, placeholder) {
|
|
31
|
+
// Show placeholders if given instead of 0
|
|
32
|
+
if (val === undefined && placeholder) {
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
35
|
+
return clampNumber(Number(val), min, max) || DEFAULT_VALUE;
|
|
31
36
|
};
|
|
32
37
|
var clampNumber = function clampNumber(value, min, max) {
|
|
33
38
|
if (value < min) {
|
|
@@ -37,13 +42,10 @@ var clampNumber = function clampNumber(value, min, max) {
|
|
|
37
42
|
}
|
|
38
43
|
return value;
|
|
39
44
|
};
|
|
40
|
-
var
|
|
41
|
-
return /^(-)?([1-9]\d*)?$/.test(value) || value === '0';
|
|
42
|
-
};
|
|
43
|
-
var convertNonIntegerToDefault = function convertNonIntegerToDefault(value, min) {
|
|
45
|
+
var convertNonIntegerToDefault = function convertNonIntegerToDefault(value) {
|
|
44
46
|
var currentValue = value;
|
|
45
|
-
if (!Number.
|
|
46
|
-
currentValue =
|
|
47
|
+
if (!Number.isFinite(currentValue)) {
|
|
48
|
+
currentValue = DEFAULT_VALUE;
|
|
47
49
|
}
|
|
48
50
|
return currentValue;
|
|
49
51
|
};
|
|
@@ -59,16 +61,13 @@ var NumberInput = /*#__PURE__*/_react["default"].forwardRef(function (props, ref
|
|
|
59
61
|
propMin = props.min,
|
|
60
62
|
propMax = props.max,
|
|
61
63
|
propValue = props.value,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
_props$step = props.step,
|
|
65
|
+
step = _props$step === void 0 ? 1 : _props$step,
|
|
66
|
+
placeholder = props.placeholder,
|
|
64
67
|
remainingProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var
|
|
68
|
-
var min = Number.isInteger(propMin) ? propMin : defaultProps.min;
|
|
69
|
-
var max = Number.isInteger(propMax) ? propMax : defaultProps.max;
|
|
70
|
-
var value = getValueFromProps(propValue, min, max, defaultProps.value);
|
|
71
|
-
var step = getStepFromProps(propStep, defaultProps.step, max, min);
|
|
68
|
+
var min = Number.isFinite(propMin) ? propMin : defaultProps.min;
|
|
69
|
+
var max = Number.isFinite(propMax) ? propMax : defaultProps.max;
|
|
70
|
+
var value = getValueFromProps(propValue, min, max, placeholder);
|
|
72
71
|
|
|
73
72
|
// Define local state and define initial values
|
|
74
73
|
var _useState = (0, _react.useState)({
|
|
@@ -83,33 +82,31 @@ var NumberInput = /*#__PURE__*/_react["default"].forwardRef(function (props, ref
|
|
|
83
82
|
// Update internal value whenever the value prop from outside changes
|
|
84
83
|
(0, _useAfterMount["default"])(function () {
|
|
85
84
|
setState({
|
|
86
|
-
value: getValueFromProps(propValue, min, max,
|
|
85
|
+
value: getValueFromProps(propValue, min, max, placeholder),
|
|
87
86
|
enteredValue: value,
|
|
88
87
|
isValid: true
|
|
89
88
|
});
|
|
90
89
|
}, [propValue, clampNumber]);
|
|
91
90
|
var applyValue = function applyValue(newValue) {
|
|
92
|
-
if (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
} else {
|
|
100
|
-
var enteredValue = Number(newValue);
|
|
101
|
-
var isValid = enteredValue >= min && enteredValue <= max;
|
|
102
|
-
var newValidValue = clampNumber(enteredValue, min, max);
|
|
103
|
-
setState({
|
|
104
|
-
value: newValidValue,
|
|
105
|
-
enteredValue: enteredValue,
|
|
106
|
-
isValid: isValid
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// Only call back the caller for valid values
|
|
110
|
-
isValid && onValueChanged(newValidValue);
|
|
111
|
-
}
|
|
91
|
+
if (newValue === '-' || newValue === '') {
|
|
92
|
+
setState({
|
|
93
|
+
value: newValue,
|
|
94
|
+
enteredValue: newValue,
|
|
95
|
+
isValid: true
|
|
96
|
+
});
|
|
97
|
+
return;
|
|
112
98
|
}
|
|
99
|
+
var enteredValue = Number(newValue);
|
|
100
|
+
var isValid = !isNaN(enteredValue) && enteredValue >= min && enteredValue <= max;
|
|
101
|
+
var newValidValue = clampNumber(enteredValue, min, max);
|
|
102
|
+
setState({
|
|
103
|
+
value: newValidValue,
|
|
104
|
+
enteredValue: enteredValue,
|
|
105
|
+
isValid: isValid
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// Only call back the caller for valid values
|
|
109
|
+
isValid && onValueChanged(newValidValue);
|
|
113
110
|
};
|
|
114
111
|
var handleOnChange = function handleOnChange(event) {
|
|
115
112
|
return applyValue(event.target.value);
|
|
@@ -117,7 +114,7 @@ var NumberInput = /*#__PURE__*/_react["default"].forwardRef(function (props, ref
|
|
|
117
114
|
var handleBlur = function handleBlur(event) {
|
|
118
115
|
// console.log({enteredValue: state.enteredValue, event: Number(event.target.value)});
|
|
119
116
|
|
|
120
|
-
// When the
|
|
117
|
+
// When the value is removed, keep the input empty but trigger the onValueChanged callback
|
|
121
118
|
// since the user has finished his input
|
|
122
119
|
var lastEnteredValue = state.enteredValue;
|
|
123
120
|
if (lastEnteredValue === '') {
|
|
@@ -125,15 +122,15 @@ var NumberInput = /*#__PURE__*/_react["default"].forwardRef(function (props, ref
|
|
|
125
122
|
return;
|
|
126
123
|
}
|
|
127
124
|
|
|
128
|
-
// Otherwise, validate the input and
|
|
129
|
-
var convertedEnteredValue = convertNonIntegerToDefault(Number(lastEnteredValue)
|
|
125
|
+
// Otherwise, validate the input and clamp it if the entered value exeeds the limitations
|
|
126
|
+
var convertedEnteredValue = convertNonIntegerToDefault(Number(lastEnteredValue));
|
|
130
127
|
var validNumber = clampNumber(convertedEnteredValue, min, max);
|
|
131
128
|
applyValue(validNumber);
|
|
132
129
|
};
|
|
133
130
|
var inputGroupClassNames = (0, _classnames["default"])('input-group', bsSize === 'sm' && 'input-group-sm', bsSize === 'lg' && 'input-group-lg');
|
|
134
131
|
var inputClassNames = (0, _classnames["default"])('form-control', 'no-controls', bsSize === 'sm' && 'input-sm', bsSize === 'lg' && 'input-lg', className);
|
|
135
132
|
var input = /*#__PURE__*/_react["default"].createElement("input", (0, _extends2["default"])({}, remainingProps, {
|
|
136
|
-
type:
|
|
133
|
+
type: "number",
|
|
137
134
|
step: step,
|
|
138
135
|
min: min,
|
|
139
136
|
max: max,
|
|
@@ -143,7 +140,11 @@ var NumberInput = /*#__PURE__*/_react["default"].forwardRef(function (props, ref
|
|
|
143
140
|
onBlur: handleBlur,
|
|
144
141
|
onChange: handleOnChange,
|
|
145
142
|
ref: ref,
|
|
146
|
-
"aria-label":
|
|
143
|
+
"aria-label": "number-input",
|
|
144
|
+
placeholder: placeholder,
|
|
145
|
+
onWheel: function onWheel(event) {
|
|
146
|
+
return event.target.blur();
|
|
147
|
+
}
|
|
147
148
|
}));
|
|
148
149
|
return unit || inputAddon ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
149
150
|
className: inputGroupClassNames
|
|
@@ -160,13 +161,13 @@ NumberInput.propTypes = {
|
|
|
160
161
|
max: _propTypes["default"].number,
|
|
161
162
|
value: _propTypes["default"].number,
|
|
162
163
|
step: _propTypes["default"].number,
|
|
163
|
-
type: _propTypes["default"].string,
|
|
164
164
|
disabled: _propTypes["default"].bool,
|
|
165
165
|
onValueChanged: _propTypes["default"].func,
|
|
166
166
|
bsSize: _propTypes["default"].oneOf(['sm', 'lg', 'small', 'large']),
|
|
167
167
|
className: _propTypes["default"].string,
|
|
168
168
|
unit: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node]),
|
|
169
|
-
inputAddon: _propTypes["default"].string
|
|
169
|
+
inputAddon: _propTypes["default"].string,
|
|
170
|
+
placeholder: _propTypes["default"].string
|
|
170
171
|
};
|
|
171
172
|
var _default = NumberInput;
|
|
172
173
|
exports["default"] = _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useDarkMode = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _colorScheme = require("./../utils/colorScheme");
|
|
11
|
+
var _useMutationObserver = _interopRequireDefault(require("./useMutationObserver"));
|
|
12
|
+
var useDarkMode = function useDarkMode(widgetName) {
|
|
13
|
+
var _useState = (0, _react.useState)(false),
|
|
14
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
15
|
+
isDarkMode = _useState2[0],
|
|
16
|
+
setIsDarkMode = _useState2[1];
|
|
17
|
+
var handleMutation = (0, _react.useCallback)(function (mutationList) {
|
|
18
|
+
mutationList.map(function (mutation) {
|
|
19
|
+
if (mutation.type === 'attributes' && mutation.attributeName === _colorScheme.THEME_DATA_ATTRIBUTE) {
|
|
20
|
+
var _mutation$target$attr;
|
|
21
|
+
var scheme = (_mutation$target$attr = mutation.target.attributes[_colorScheme.THEME_DATA_ATTRIBUTE]) === null || _mutation$target$attr === void 0 ? void 0 : _mutation$target$attr.value;
|
|
22
|
+
setIsDarkMode(scheme === _colorScheme.THEME_DARK);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// if (mutation.type === 'classList') {
|
|
26
|
+
// console.log({ classList: mutation });
|
|
27
|
+
// }
|
|
28
|
+
});
|
|
29
|
+
}, []);
|
|
30
|
+
(0, _useMutationObserver["default"])(document.documentElement, handleMutation, {
|
|
31
|
+
attributes: true,
|
|
32
|
+
childList: false,
|
|
33
|
+
subtree: false
|
|
34
|
+
});
|
|
35
|
+
return isDarkMode;
|
|
36
|
+
};
|
|
37
|
+
exports.useDarkMode = useDarkMode;
|
|
@@ -9,7 +9,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
11
11
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
12
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
13
13
|
function useElementSize(elementRef) {
|
|
14
14
|
var _useState = (0, _react.useState)(),
|
|
15
15
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
@@ -120,25 +120,23 @@ var useFullscreen = function useFullscreen() {
|
|
|
120
120
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(newTargetElement) {
|
|
121
121
|
var isHtmlElement, target;
|
|
122
122
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
123
|
-
while (1) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return _context.stop();
|
|
141
|
-
}
|
|
123
|
+
while (1) switch (_context.prev = _context.next) {
|
|
124
|
+
case 0:
|
|
125
|
+
// check whether the new target element is a real DOm node or just a function
|
|
126
|
+
isHtmlElement = newTargetElement instanceof HTMLElement;
|
|
127
|
+
_context.prev = 1;
|
|
128
|
+
target = newTargetElement && isHtmlElement ? newTargetElement : defaultFullscreenElement;
|
|
129
|
+
_context.next = 5;
|
|
130
|
+
return target[getRequestFunctionName(target)](requestFullscreenOptions);
|
|
131
|
+
case 5:
|
|
132
|
+
return _context.abrupt("return", _context.sent);
|
|
133
|
+
case 8:
|
|
134
|
+
_context.prev = 8;
|
|
135
|
+
_context.t0 = _context["catch"](1);
|
|
136
|
+
console.log(_context.t0);
|
|
137
|
+
case 11:
|
|
138
|
+
case "end":
|
|
139
|
+
return _context.stop();
|
|
142
140
|
}
|
|
143
141
|
}, _callee, null, [[1, 8]]);
|
|
144
142
|
}));
|
|
@@ -148,29 +146,27 @@ var useFullscreen = function useFullscreen() {
|
|
|
148
146
|
}(), []);
|
|
149
147
|
var exitFullscreen = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
150
148
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
151
|
-
while (1) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
_context2.next = 5;
|
|
157
|
-
break;
|
|
158
|
-
}
|
|
159
|
-
_context2.next = 4;
|
|
160
|
-
return document[getExitFunctionName()]();
|
|
161
|
-
case 4:
|
|
162
|
-
return _context2.abrupt("return", _context2.sent);
|
|
163
|
-
case 5:
|
|
164
|
-
_context2.next = 10;
|
|
149
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
150
|
+
case 0:
|
|
151
|
+
_context2.prev = 0;
|
|
152
|
+
if (!fullscreenElement) {
|
|
153
|
+
_context2.next = 5;
|
|
165
154
|
break;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
155
|
+
}
|
|
156
|
+
_context2.next = 4;
|
|
157
|
+
return document[getExitFunctionName()]();
|
|
158
|
+
case 4:
|
|
159
|
+
return _context2.abrupt("return", _context2.sent);
|
|
160
|
+
case 5:
|
|
161
|
+
_context2.next = 10;
|
|
162
|
+
break;
|
|
163
|
+
case 7:
|
|
164
|
+
_context2.prev = 7;
|
|
165
|
+
_context2.t0 = _context2["catch"](0);
|
|
166
|
+
console.warn(_context2.t0);
|
|
167
|
+
case 10:
|
|
168
|
+
case "end":
|
|
169
|
+
return _context2.stop();
|
|
174
170
|
}
|
|
175
171
|
}, _callee2, null, [[0, 7]]);
|
|
176
172
|
})), [fullscreenElement]);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
// Options for the observer (which mutations to observe)
|
|
9
|
+
var DEFAULT_OPTIONS = {
|
|
10
|
+
attributes: true,
|
|
11
|
+
childList: true,
|
|
12
|
+
subtree: true
|
|
13
|
+
};
|
|
14
|
+
var useMutationObserver = function useMutationObserver(targetElement, callback) {
|
|
15
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_OPTIONS;
|
|
16
|
+
var observer = (0, _react.useRef)(null);
|
|
17
|
+
var disconnect = (0, _react.useCallback)(function () {
|
|
18
|
+
var _observer$current;
|
|
19
|
+
return (_observer$current = observer.current) === null || _observer$current === void 0 ? void 0 : _observer$current.disconnect();
|
|
20
|
+
}, []);
|
|
21
|
+
var observe = (0, _react.useCallback)(function () {
|
|
22
|
+
observer.current = new MutationObserver(callback);
|
|
23
|
+
if (targetElement) {
|
|
24
|
+
observer.current.observe(targetElement, options);
|
|
25
|
+
}
|
|
26
|
+
}, [targetElement]);
|
|
27
|
+
(0, _react.useLayoutEffect)(function () {
|
|
28
|
+
observe();
|
|
29
|
+
return function () {
|
|
30
|
+
return disconnect();
|
|
31
|
+
};
|
|
32
|
+
}, [disconnect, observe]);
|
|
33
|
+
};
|
|
34
|
+
var _default = useMutationObserver;
|
|
35
|
+
exports["default"] = _default;
|
|
Binary file
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
@modal-title-padding: 15px;
|
|
4
4
|
@modal-content-bg: var(--color-white);
|
|
5
5
|
@modal-content-border-color: var(--gray-light);
|
|
6
|
-
@modal-backdrop-bg: var(always-color-black);
|
|
6
|
+
@modal-backdrop-bg: var(--always-color-black);
|
|
7
7
|
@modal-header-border-color: var(--gray-lighter);
|
|
8
8
|
@modal-footer-border-color: var(--gray-lighter);
|
|
9
9
|
|