@arcgis/map-components-react 1.0.0-beta.12

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/LICENSE.md ADDED
@@ -0,0 +1,13 @@
1
+ # Licensing
2
+
3
+ COPYRIGHT © 2023 Esri
4
+
5
+ All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
6
+
7
+ This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement. You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
8
+
9
+ See use restrictions at <http://www.esri.com/legal/pdfs/mla_e204_e300/english>
10
+
11
+ For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts and Legal Services Department 380 New York Street Redlands, California, USA 92373 USA
12
+
13
+ email: contracts@esri.com
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # React wrapper for @arcgis/map-components (beta)
2
+
3
+ This Web Component package is part of the [ArcGIS Maps SDK for JavaScript](https://developers.arcgis.com/javascript) and is under active development. At this time, customer support is **not** provided. More news to come.
4
+
5
+ ## License
6
+
7
+ COPYRIGHT © 2023 Esri
8
+
9
+ All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
10
+
11
+ This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement. You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
12
+
13
+ See use restrictions at <http://www.esri.com/legal/pdfs/mla_e204_e300/english>
14
+
15
+ For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts and Legal Services Department 380 New York Street Redlands, California, USA 92373 USA
16
+
17
+ email: contracts@esri.com
@@ -0,0 +1,53 @@
1
+ /// <reference types="react" />
2
+ import type { JSX } from '@arcgis/map-components';
3
+ export declare const ArcgisAreaMeasurement2d: import("react").ForwardRefExoticComponent<JSX.ArcgisAreaMeasurement2d & Omit<import("react").HTMLAttributes<HTMLArcgisAreaMeasurement2dElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisAreaMeasurement2dElement>>;
4
+ export declare const ArcgisAreaMeasurement3d: import("react").ForwardRefExoticComponent<JSX.ArcgisAreaMeasurement3d & Omit<import("react").HTMLAttributes<HTMLArcgisAreaMeasurement3dElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisAreaMeasurement3dElement>>;
5
+ export declare const ArcgisAttachments: import("react").ForwardRefExoticComponent<JSX.ArcgisAttachments & Omit<import("react").HTMLAttributes<HTMLArcgisAttachmentsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisAttachmentsElement>>;
6
+ export declare const ArcgisBasemapGallery: import("react").ForwardRefExoticComponent<JSX.ArcgisBasemapGallery & Omit<import("react").HTMLAttributes<HTMLArcgisBasemapGalleryElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisBasemapGalleryElement>>;
7
+ export declare const ArcgisBasemapLayerList: import("react").ForwardRefExoticComponent<JSX.ArcgisBasemapLayerList & Omit<import("react").HTMLAttributes<HTMLArcgisBasemapLayerListElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisBasemapLayerListElement>>;
8
+ export declare const ArcgisBasemapToggle: import("react").ForwardRefExoticComponent<JSX.ArcgisBasemapToggle & Omit<import("react").HTMLAttributes<HTMLArcgisBasemapToggleElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisBasemapToggleElement>>;
9
+ export declare const ArcgisBookmarks: import("react").ForwardRefExoticComponent<JSX.ArcgisBookmarks & Omit<import("react").HTMLAttributes<HTMLArcgisBookmarksElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisBookmarksElement>>;
10
+ export declare const ArcgisBuildingExplorer: import("react").ForwardRefExoticComponent<JSX.ArcgisBuildingExplorer & Omit<import("react").HTMLAttributes<HTMLArcgisBuildingExplorerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisBuildingExplorerElement>>;
11
+ export declare const ArcgisCompass: import("react").ForwardRefExoticComponent<JSX.ArcgisCompass & Omit<import("react").HTMLAttributes<HTMLArcgisCompassElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisCompassElement>>;
12
+ export declare const ArcgisCoordinateConversion: import("react").ForwardRefExoticComponent<JSX.ArcgisCoordinateConversion & Omit<import("react").HTMLAttributes<HTMLArcgisCoordinateConversionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisCoordinateConversionElement>>;
13
+ export declare const ArcgisDaylight: import("react").ForwardRefExoticComponent<JSX.ArcgisDaylight & Omit<import("react").HTMLAttributes<HTMLArcgisDaylightElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisDaylightElement>>;
14
+ export declare const ArcgisDirections: import("react").ForwardRefExoticComponent<JSX.ArcgisDirections & Omit<import("react").HTMLAttributes<HTMLArcgisDirectionsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisDirectionsElement>>;
15
+ export declare const ArcgisDirectlineMeasurement3d: import("react").ForwardRefExoticComponent<JSX.ArcgisDirectlineMeasurement3d & Omit<import("react").HTMLAttributes<HTMLArcgisDirectlineMeasurement3dElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisDirectlineMeasurement3dElement>>;
16
+ export declare const ArcgisDistanceMeasurement2d: import("react").ForwardRefExoticComponent<JSX.ArcgisDistanceMeasurement2d & Omit<import("react").HTMLAttributes<HTMLArcgisDistanceMeasurement2dElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisDistanceMeasurement2dElement>>;
17
+ export declare const ArcgisEditor: import("react").ForwardRefExoticComponent<JSX.ArcgisEditor & Omit<import("react").HTMLAttributes<HTMLArcgisEditorElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisEditorElement>>;
18
+ export declare const ArcgisElevationProfile: import("react").ForwardRefExoticComponent<JSX.ArcgisElevationProfile & Omit<import("react").HTMLAttributes<HTMLArcgisElevationProfileElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisElevationProfileElement>>;
19
+ export declare const ArcgisExpand: import("react").ForwardRefExoticComponent<JSX.ArcgisExpand & Omit<import("react").HTMLAttributes<HTMLArcgisExpandElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisExpandElement>>;
20
+ export declare const ArcgisFeature: import("react").ForwardRefExoticComponent<JSX.ArcgisFeature & Omit<import("react").HTMLAttributes<HTMLArcgisFeatureElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisFeatureElement>>;
21
+ export declare const ArcgisFeatureForm: import("react").ForwardRefExoticComponent<JSX.ArcgisFeatureForm & Omit<import("react").HTMLAttributes<HTMLArcgisFeatureFormElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisFeatureFormElement>>;
22
+ export declare const ArcgisFeatureTable: import("react").ForwardRefExoticComponent<JSX.ArcgisFeatureTable & Omit<import("react").HTMLAttributes<HTMLArcgisFeatureTableElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisFeatureTableElement>>;
23
+ export declare const ArcgisFeatureTemplates: import("react").ForwardRefExoticComponent<JSX.ArcgisFeatureTemplates & Omit<import("react").HTMLAttributes<HTMLArcgisFeatureTemplatesElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisFeatureTemplatesElement>>;
24
+ export declare const ArcgisFeatures: import("react").ForwardRefExoticComponent<JSX.ArcgisFeatures & Omit<import("react").HTMLAttributes<HTMLArcgisFeaturesElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisFeaturesElement>>;
25
+ export declare const ArcgisFloorFilter: import("react").ForwardRefExoticComponent<JSX.ArcgisFloorFilter & Omit<import("react").HTMLAttributes<HTMLArcgisFloorFilterElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisFloorFilterElement>>;
26
+ export declare const ArcgisFullscreen: import("react").ForwardRefExoticComponent<JSX.ArcgisFullscreen & Omit<import("react").HTMLAttributes<HTMLArcgisFullscreenElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisFullscreenElement>>;
27
+ export declare const ArcgisHistogram: import("react").ForwardRefExoticComponent<JSX.ArcgisHistogram & Omit<import("react").HTMLAttributes<HTMLArcgisHistogramElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisHistogramElement>>;
28
+ export declare const ArcgisHistogramRangeSlider: import("react").ForwardRefExoticComponent<JSX.ArcgisHistogramRangeSlider & Omit<import("react").HTMLAttributes<HTMLArcgisHistogramRangeSliderElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisHistogramRangeSliderElement>>;
29
+ export declare const ArcgisHome: import("react").ForwardRefExoticComponent<JSX.ArcgisHome & Omit<import("react").HTMLAttributes<HTMLArcgisHomeElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisHomeElement>>;
30
+ export declare const ArcgisLayerList: import("react").ForwardRefExoticComponent<JSX.ArcgisLayerList & Omit<import("react").HTMLAttributes<HTMLArcgisLayerListElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisLayerListElement>>;
31
+ export declare const ArcgisLegend: import("react").ForwardRefExoticComponent<JSX.ArcgisLegend & Omit<import("react").HTMLAttributes<HTMLArcgisLegendElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisLegendElement>>;
32
+ export declare const ArcgisLineOfSight: import("react").ForwardRefExoticComponent<JSX.ArcgisLineOfSight & Omit<import("react").HTMLAttributes<HTMLArcgisLineOfSightElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisLineOfSightElement>>;
33
+ export declare const ArcgisLocate: import("react").ForwardRefExoticComponent<JSX.ArcgisLocate & Omit<import("react").HTMLAttributes<HTMLArcgisLocateElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisLocateElement>>;
34
+ export declare const ArcgisMap: import("react").ForwardRefExoticComponent<JSX.ArcgisMap & Omit<import("react").HTMLAttributes<HTMLArcgisMapElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisMapElement>>;
35
+ export declare const ArcgisMeasurement: import("react").ForwardRefExoticComponent<JSX.ArcgisMeasurement & Omit<import("react").HTMLAttributes<HTMLArcgisMeasurementElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisMeasurementElement>>;
36
+ export declare const ArcgisNavigationToggle: import("react").ForwardRefExoticComponent<JSX.ArcgisNavigationToggle & Omit<import("react").HTMLAttributes<HTMLArcgisNavigationToggleElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisNavigationToggleElement>>;
37
+ export declare const ArcgisPrint: import("react").ForwardRefExoticComponent<JSX.ArcgisPrint & Omit<import("react").HTMLAttributes<HTMLArcgisPrintElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisPrintElement>>;
38
+ export declare const ArcgisScaleBar: import("react").ForwardRefExoticComponent<JSX.ArcgisScaleBar & Omit<import("react").HTMLAttributes<HTMLArcgisScaleBarElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisScaleBarElement>>;
39
+ export declare const ArcgisScaleRangeSlider: import("react").ForwardRefExoticComponent<JSX.ArcgisScaleRangeSlider & Omit<import("react").HTMLAttributes<HTMLArcgisScaleRangeSliderElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisScaleRangeSliderElement>>;
40
+ export declare const ArcgisScene: import("react").ForwardRefExoticComponent<JSX.ArcgisScene & Omit<import("react").HTMLAttributes<HTMLArcgisSceneElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisSceneElement>>;
41
+ export declare const ArcgisSearch: import("react").ForwardRefExoticComponent<JSX.ArcgisSearch & Omit<import("react").HTMLAttributes<HTMLArcgisSearchElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisSearchElement>>;
42
+ export declare const ArcgisShadowCast: import("react").ForwardRefExoticComponent<JSX.ArcgisShadowCast & Omit<import("react").HTMLAttributes<HTMLArcgisShadowCastElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisShadowCastElement>>;
43
+ export declare const ArcgisSketch: import("react").ForwardRefExoticComponent<JSX.ArcgisSketch & Omit<import("react").HTMLAttributes<HTMLArcgisSketchElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisSketchElement>>;
44
+ export declare const ArcgisSlice: import("react").ForwardRefExoticComponent<JSX.ArcgisSlice & Omit<import("react").HTMLAttributes<HTMLArcgisSliceElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisSliceElement>>;
45
+ export declare const ArcgisSlider: import("react").ForwardRefExoticComponent<JSX.ArcgisSlider & Omit<import("react").HTMLAttributes<HTMLArcgisSliderElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisSliderElement>>;
46
+ export declare const ArcgisSwipe: import("react").ForwardRefExoticComponent<JSX.ArcgisSwipe & Omit<import("react").HTMLAttributes<HTMLArcgisSwipeElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisSwipeElement>>;
47
+ export declare const ArcgisTableList: import("react").ForwardRefExoticComponent<JSX.ArcgisTableList & Omit<import("react").HTMLAttributes<HTMLArcgisTableListElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisTableListElement>>;
48
+ export declare const ArcgisTimeSlider: import("react").ForwardRefExoticComponent<JSX.ArcgisTimeSlider & Omit<import("react").HTMLAttributes<HTMLArcgisTimeSliderElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisTimeSliderElement>>;
49
+ export declare const ArcgisTrack: import("react").ForwardRefExoticComponent<JSX.ArcgisTrack & Omit<import("react").HTMLAttributes<HTMLArcgisTrackElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisTrackElement>>;
50
+ export declare const ArcgisUtilityNetworkTrace: import("react").ForwardRefExoticComponent<JSX.ArcgisUtilityNetworkTrace & Omit<import("react").HTMLAttributes<HTMLArcgisUtilityNetworkTraceElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisUtilityNetworkTraceElement>>;
51
+ export declare const ArcgisValuePicker: import("react").ForwardRefExoticComponent<JSX.ArcgisValuePicker & Omit<import("react").HTMLAttributes<HTMLArcgisValuePickerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisValuePickerElement>>;
52
+ export declare const ArcgisWeather: import("react").ForwardRefExoticComponent<JSX.ArcgisWeather & Omit<import("react").HTMLAttributes<HTMLArcgisWeatherElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisWeatherElement>>;
53
+ export declare const ArcgisZoom: import("react").ForwardRefExoticComponent<JSX.ArcgisZoom & Omit<import("react").HTMLAttributes<HTMLArcgisZoomElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLArcgisZoomElement>>;
@@ -0,0 +1,106 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ /* auto-generated react proxies */
4
+ import { createReactComponent } from './react-component-lib';
5
+ import { defineCustomElement as defineArcgisAreaMeasurement2d } from '@arcgis/map-components/dist/components/arcgis-area-measurement-2d.js';
6
+ import { defineCustomElement as defineArcgisAreaMeasurement3d } from '@arcgis/map-components/dist/components/arcgis-area-measurement-3d.js';
7
+ import { defineCustomElement as defineArcgisAttachments } from '@arcgis/map-components/dist/components/arcgis-attachments.js';
8
+ import { defineCustomElement as defineArcgisBasemapGallery } from '@arcgis/map-components/dist/components/arcgis-basemap-gallery.js';
9
+ import { defineCustomElement as defineArcgisBasemapLayerList } from '@arcgis/map-components/dist/components/arcgis-basemap-layer-list.js';
10
+ import { defineCustomElement as defineArcgisBasemapToggle } from '@arcgis/map-components/dist/components/arcgis-basemap-toggle.js';
11
+ import { defineCustomElement as defineArcgisBookmarks } from '@arcgis/map-components/dist/components/arcgis-bookmarks.js';
12
+ import { defineCustomElement as defineArcgisBuildingExplorer } from '@arcgis/map-components/dist/components/arcgis-building-explorer.js';
13
+ import { defineCustomElement as defineArcgisCompass } from '@arcgis/map-components/dist/components/arcgis-compass.js';
14
+ import { defineCustomElement as defineArcgisCoordinateConversion } from '@arcgis/map-components/dist/components/arcgis-coordinate-conversion.js';
15
+ import { defineCustomElement as defineArcgisDaylight } from '@arcgis/map-components/dist/components/arcgis-daylight.js';
16
+ import { defineCustomElement as defineArcgisDirections } from '@arcgis/map-components/dist/components/arcgis-directions.js';
17
+ import { defineCustomElement as defineArcgisDirectlineMeasurement3d } from '@arcgis/map-components/dist/components/arcgis-directline-measurement-3d.js';
18
+ import { defineCustomElement as defineArcgisDistanceMeasurement2d } from '@arcgis/map-components/dist/components/arcgis-distance-measurement-2d.js';
19
+ import { defineCustomElement as defineArcgisEditor } from '@arcgis/map-components/dist/components/arcgis-editor.js';
20
+ import { defineCustomElement as defineArcgisElevationProfile } from '@arcgis/map-components/dist/components/arcgis-elevation-profile.js';
21
+ import { defineCustomElement as defineArcgisExpand } from '@arcgis/map-components/dist/components/arcgis-expand.js';
22
+ import { defineCustomElement as defineArcgisFeature } from '@arcgis/map-components/dist/components/arcgis-feature.js';
23
+ import { defineCustomElement as defineArcgisFeatureForm } from '@arcgis/map-components/dist/components/arcgis-feature-form.js';
24
+ import { defineCustomElement as defineArcgisFeatureTable } from '@arcgis/map-components/dist/components/arcgis-feature-table.js';
25
+ import { defineCustomElement as defineArcgisFeatureTemplates } from '@arcgis/map-components/dist/components/arcgis-feature-templates.js';
26
+ import { defineCustomElement as defineArcgisFeatures } from '@arcgis/map-components/dist/components/arcgis-features.js';
27
+ import { defineCustomElement as defineArcgisFloorFilter } from '@arcgis/map-components/dist/components/arcgis-floor-filter.js';
28
+ import { defineCustomElement as defineArcgisFullscreen } from '@arcgis/map-components/dist/components/arcgis-fullscreen.js';
29
+ import { defineCustomElement as defineArcgisHistogram } from '@arcgis/map-components/dist/components/arcgis-histogram.js';
30
+ import { defineCustomElement as defineArcgisHistogramRangeSlider } from '@arcgis/map-components/dist/components/arcgis-histogram-range-slider.js';
31
+ import { defineCustomElement as defineArcgisHome } from '@arcgis/map-components/dist/components/arcgis-home.js';
32
+ import { defineCustomElement as defineArcgisLayerList } from '@arcgis/map-components/dist/components/arcgis-layer-list.js';
33
+ import { defineCustomElement as defineArcgisLegend } from '@arcgis/map-components/dist/components/arcgis-legend.js';
34
+ import { defineCustomElement as defineArcgisLineOfSight } from '@arcgis/map-components/dist/components/arcgis-line-of-sight.js';
35
+ import { defineCustomElement as defineArcgisLocate } from '@arcgis/map-components/dist/components/arcgis-locate.js';
36
+ import { defineCustomElement as defineArcgisMap } from '@arcgis/map-components/dist/components/arcgis-map.js';
37
+ import { defineCustomElement as defineArcgisMeasurement } from '@arcgis/map-components/dist/components/arcgis-measurement.js';
38
+ import { defineCustomElement as defineArcgisNavigationToggle } from '@arcgis/map-components/dist/components/arcgis-navigation-toggle.js';
39
+ import { defineCustomElement as defineArcgisPrint } from '@arcgis/map-components/dist/components/arcgis-print.js';
40
+ import { defineCustomElement as defineArcgisScaleBar } from '@arcgis/map-components/dist/components/arcgis-scale-bar.js';
41
+ import { defineCustomElement as defineArcgisScaleRangeSlider } from '@arcgis/map-components/dist/components/arcgis-scale-range-slider.js';
42
+ import { defineCustomElement as defineArcgisScene } from '@arcgis/map-components/dist/components/arcgis-scene.js';
43
+ import { defineCustomElement as defineArcgisSearch } from '@arcgis/map-components/dist/components/arcgis-search.js';
44
+ import { defineCustomElement as defineArcgisShadowCast } from '@arcgis/map-components/dist/components/arcgis-shadow-cast.js';
45
+ import { defineCustomElement as defineArcgisSketch } from '@arcgis/map-components/dist/components/arcgis-sketch.js';
46
+ import { defineCustomElement as defineArcgisSlice } from '@arcgis/map-components/dist/components/arcgis-slice.js';
47
+ import { defineCustomElement as defineArcgisSlider } from '@arcgis/map-components/dist/components/arcgis-slider.js';
48
+ import { defineCustomElement as defineArcgisSwipe } from '@arcgis/map-components/dist/components/arcgis-swipe.js';
49
+ import { defineCustomElement as defineArcgisTableList } from '@arcgis/map-components/dist/components/arcgis-table-list.js';
50
+ import { defineCustomElement as defineArcgisTimeSlider } from '@arcgis/map-components/dist/components/arcgis-time-slider.js';
51
+ import { defineCustomElement as defineArcgisTrack } from '@arcgis/map-components/dist/components/arcgis-track.js';
52
+ import { defineCustomElement as defineArcgisUtilityNetworkTrace } from '@arcgis/map-components/dist/components/arcgis-utility-network-trace.js';
53
+ import { defineCustomElement as defineArcgisValuePicker } from '@arcgis/map-components/dist/components/arcgis-value-picker.js';
54
+ import { defineCustomElement as defineArcgisWeather } from '@arcgis/map-components/dist/components/arcgis-weather.js';
55
+ import { defineCustomElement as defineArcgisZoom } from '@arcgis/map-components/dist/components/arcgis-zoom.js';
56
+ export const ArcgisAreaMeasurement2d = /*@__PURE__*/ createReactComponent('arcgis-area-measurement-2d', undefined, undefined, defineArcgisAreaMeasurement2d);
57
+ export const ArcgisAreaMeasurement3d = /*@__PURE__*/ createReactComponent('arcgis-area-measurement-3d', undefined, undefined, defineArcgisAreaMeasurement3d);
58
+ export const ArcgisAttachments = /*@__PURE__*/ createReactComponent('arcgis-attachments', undefined, undefined, defineArcgisAttachments);
59
+ export const ArcgisBasemapGallery = /*@__PURE__*/ createReactComponent('arcgis-basemap-gallery', undefined, undefined, defineArcgisBasemapGallery);
60
+ export const ArcgisBasemapLayerList = /*@__PURE__*/ createReactComponent('arcgis-basemap-layer-list', undefined, undefined, defineArcgisBasemapLayerList);
61
+ export const ArcgisBasemapToggle = /*@__PURE__*/ createReactComponent('arcgis-basemap-toggle', undefined, undefined, defineArcgisBasemapToggle);
62
+ export const ArcgisBookmarks = /*@__PURE__*/ createReactComponent('arcgis-bookmarks', undefined, undefined, defineArcgisBookmarks);
63
+ export const ArcgisBuildingExplorer = /*@__PURE__*/ createReactComponent('arcgis-building-explorer', undefined, undefined, defineArcgisBuildingExplorer);
64
+ export const ArcgisCompass = /*@__PURE__*/ createReactComponent('arcgis-compass', undefined, undefined, defineArcgisCompass);
65
+ export const ArcgisCoordinateConversion = /*@__PURE__*/ createReactComponent('arcgis-coordinate-conversion', undefined, undefined, defineArcgisCoordinateConversion);
66
+ export const ArcgisDaylight = /*@__PURE__*/ createReactComponent('arcgis-daylight', undefined, undefined, defineArcgisDaylight);
67
+ export const ArcgisDirections = /*@__PURE__*/ createReactComponent('arcgis-directions', undefined, undefined, defineArcgisDirections);
68
+ export const ArcgisDirectlineMeasurement3d = /*@__PURE__*/ createReactComponent('arcgis-directline-measurement-3d', undefined, undefined, defineArcgisDirectlineMeasurement3d);
69
+ export const ArcgisDistanceMeasurement2d = /*@__PURE__*/ createReactComponent('arcgis-distance-measurement-2d', undefined, undefined, defineArcgisDistanceMeasurement2d);
70
+ export const ArcgisEditor = /*@__PURE__*/ createReactComponent('arcgis-editor', undefined, undefined, defineArcgisEditor);
71
+ export const ArcgisElevationProfile = /*@__PURE__*/ createReactComponent('arcgis-elevation-profile', undefined, undefined, defineArcgisElevationProfile);
72
+ export const ArcgisExpand = /*@__PURE__*/ createReactComponent('arcgis-expand', undefined, undefined, defineArcgisExpand);
73
+ export const ArcgisFeature = /*@__PURE__*/ createReactComponent('arcgis-feature', undefined, undefined, defineArcgisFeature);
74
+ export const ArcgisFeatureForm = /*@__PURE__*/ createReactComponent('arcgis-feature-form', undefined, undefined, defineArcgisFeatureForm);
75
+ export const ArcgisFeatureTable = /*@__PURE__*/ createReactComponent('arcgis-feature-table', undefined, undefined, defineArcgisFeatureTable);
76
+ export const ArcgisFeatureTemplates = /*@__PURE__*/ createReactComponent('arcgis-feature-templates', undefined, undefined, defineArcgisFeatureTemplates);
77
+ export const ArcgisFeatures = /*@__PURE__*/ createReactComponent('arcgis-features', undefined, undefined, defineArcgisFeatures);
78
+ export const ArcgisFloorFilter = /*@__PURE__*/ createReactComponent('arcgis-floor-filter', undefined, undefined, defineArcgisFloorFilter);
79
+ export const ArcgisFullscreen = /*@__PURE__*/ createReactComponent('arcgis-fullscreen', undefined, undefined, defineArcgisFullscreen);
80
+ export const ArcgisHistogram = /*@__PURE__*/ createReactComponent('arcgis-histogram', undefined, undefined, defineArcgisHistogram);
81
+ export const ArcgisHistogramRangeSlider = /*@__PURE__*/ createReactComponent('arcgis-histogram-range-slider', undefined, undefined, defineArcgisHistogramRangeSlider);
82
+ export const ArcgisHome = /*@__PURE__*/ createReactComponent('arcgis-home', undefined, undefined, defineArcgisHome);
83
+ export const ArcgisLayerList = /*@__PURE__*/ createReactComponent('arcgis-layer-list', undefined, undefined, defineArcgisLayerList);
84
+ export const ArcgisLegend = /*@__PURE__*/ createReactComponent('arcgis-legend', undefined, undefined, defineArcgisLegend);
85
+ export const ArcgisLineOfSight = /*@__PURE__*/ createReactComponent('arcgis-line-of-sight', undefined, undefined, defineArcgisLineOfSight);
86
+ export const ArcgisLocate = /*@__PURE__*/ createReactComponent('arcgis-locate', undefined, undefined, defineArcgisLocate);
87
+ export const ArcgisMap = /*@__PURE__*/ createReactComponent('arcgis-map', undefined, undefined, defineArcgisMap);
88
+ export const ArcgisMeasurement = /*@__PURE__*/ createReactComponent('arcgis-measurement', undefined, undefined, defineArcgisMeasurement);
89
+ export const ArcgisNavigationToggle = /*@__PURE__*/ createReactComponent('arcgis-navigation-toggle', undefined, undefined, defineArcgisNavigationToggle);
90
+ export const ArcgisPrint = /*@__PURE__*/ createReactComponent('arcgis-print', undefined, undefined, defineArcgisPrint);
91
+ export const ArcgisScaleBar = /*@__PURE__*/ createReactComponent('arcgis-scale-bar', undefined, undefined, defineArcgisScaleBar);
92
+ export const ArcgisScaleRangeSlider = /*@__PURE__*/ createReactComponent('arcgis-scale-range-slider', undefined, undefined, defineArcgisScaleRangeSlider);
93
+ export const ArcgisScene = /*@__PURE__*/ createReactComponent('arcgis-scene', undefined, undefined, defineArcgisScene);
94
+ export const ArcgisSearch = /*@__PURE__*/ createReactComponent('arcgis-search', undefined, undefined, defineArcgisSearch);
95
+ export const ArcgisShadowCast = /*@__PURE__*/ createReactComponent('arcgis-shadow-cast', undefined, undefined, defineArcgisShadowCast);
96
+ export const ArcgisSketch = /*@__PURE__*/ createReactComponent('arcgis-sketch', undefined, undefined, defineArcgisSketch);
97
+ export const ArcgisSlice = /*@__PURE__*/ createReactComponent('arcgis-slice', undefined, undefined, defineArcgisSlice);
98
+ export const ArcgisSlider = /*@__PURE__*/ createReactComponent('arcgis-slider', undefined, undefined, defineArcgisSlider);
99
+ export const ArcgisSwipe = /*@__PURE__*/ createReactComponent('arcgis-swipe', undefined, undefined, defineArcgisSwipe);
100
+ export const ArcgisTableList = /*@__PURE__*/ createReactComponent('arcgis-table-list', undefined, undefined, defineArcgisTableList);
101
+ export const ArcgisTimeSlider = /*@__PURE__*/ createReactComponent('arcgis-time-slider', undefined, undefined, defineArcgisTimeSlider);
102
+ export const ArcgisTrack = /*@__PURE__*/ createReactComponent('arcgis-track', undefined, undefined, defineArcgisTrack);
103
+ export const ArcgisUtilityNetworkTrace = /*@__PURE__*/ createReactComponent('arcgis-utility-network-trace', undefined, undefined, defineArcgisUtilityNetworkTrace);
104
+ export const ArcgisValuePicker = /*@__PURE__*/ createReactComponent('arcgis-value-picker', undefined, undefined, defineArcgisValuePicker);
105
+ export const ArcgisWeather = /*@__PURE__*/ createReactComponent('arcgis-weather', undefined, undefined, defineArcgisWeather);
106
+ export const ArcgisZoom = /*@__PURE__*/ createReactComponent('arcgis-zoom', undefined, undefined, defineArcgisZoom);
@@ -0,0 +1 @@
1
+ export * from "./components";
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from "./components";
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export interface HTMLStencilElement extends HTMLElement {
3
+ componentOnReady(): Promise<this>;
4
+ }
5
+ interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {
6
+ forwardedRef: React.RefObject<ElementType>;
7
+ ref?: React.Ref<any>;
8
+ }
9
+ export declare const createReactComponent: <PropType, ElementType extends HTMLStencilElement, ContextStateType = {}, ExpandedPropsTypes = {}>(tagName: string, ReactComponentContext?: React.Context<ContextStateType> | undefined, manipulatePropsFunction?: ((originalProps: StencilReactInternalProps<ElementType>, propsToPass: any) => ExpandedPropsTypes) | undefined, defineCustomElement?: () => void) => React.ForwardRefExoticComponent<React.PropsWithoutRef<import("./utils").StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
10
+ export {};
@@ -0,0 +1,67 @@
1
+ import React, { createElement } from 'react';
2
+ import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils';
3
+ export const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) => {
4
+ if (defineCustomElement !== undefined) {
5
+ defineCustomElement();
6
+ }
7
+ const displayName = dashToPascalCase(tagName);
8
+ const ReactComponent = class extends React.Component {
9
+ constructor(props) {
10
+ super(props);
11
+ this.setComponentElRef = (element) => {
12
+ this.componentEl = element;
13
+ };
14
+ }
15
+ componentDidMount() {
16
+ this.componentDidUpdate(this.props);
17
+ }
18
+ componentDidUpdate(prevProps) {
19
+ attachProps(this.componentEl, this.props, prevProps);
20
+ }
21
+ render() {
22
+ const { children, forwardedRef, style, className, ref, ...cProps } = this.props;
23
+ let propsToPass = Object.keys(cProps).reduce((acc, name) => {
24
+ const value = cProps[name];
25
+ if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
26
+ const eventName = name.substring(2).toLowerCase();
27
+ if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
28
+ acc[name] = value;
29
+ }
30
+ }
31
+ else {
32
+ // we should only render strings, booleans, and numbers as attrs in html.
33
+ // objects, functions, arrays etc get synced via properties on mount.
34
+ const type = typeof value;
35
+ if (type === 'string' || type === 'boolean' || type === 'number') {
36
+ acc[camelToDashCase(name)] = value;
37
+ }
38
+ }
39
+ return acc;
40
+ }, {});
41
+ if (manipulatePropsFunction) {
42
+ propsToPass = manipulatePropsFunction(this.props, propsToPass);
43
+ }
44
+ const newProps = {
45
+ ...propsToPass,
46
+ ref: mergeRefs(forwardedRef, this.setComponentElRef),
47
+ style,
48
+ };
49
+ /**
50
+ * We use createElement here instead of
51
+ * React.createElement to work around a
52
+ * bug in Vite (https://github.com/vitejs/vite/issues/6104).
53
+ * React.createElement causes all elements to be rendered
54
+ * as <tagname> instead of the actual Web Component.
55
+ */
56
+ return createElement(tagName, newProps, children);
57
+ }
58
+ static get displayName() {
59
+ return displayName;
60
+ }
61
+ };
62
+ // If context was passed to createReactComponent then conditionally add it to the Component Class
63
+ if (ReactComponentContext) {
64
+ ReactComponent.contextType = ReactComponentContext;
65
+ }
66
+ return createForwardRef(ReactComponent, displayName);
67
+ };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { OverlayEventDetail } from './interfaces';
3
+ import { StencilReactForwardedRef } from './utils';
4
+ interface OverlayElement extends HTMLElement {
5
+ present: () => Promise<void>;
6
+ dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;
7
+ }
8
+ export interface ReactOverlayProps {
9
+ children?: React.ReactNode;
10
+ isOpen: boolean;
11
+ onDidDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
12
+ onDidPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
13
+ onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
14
+ onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
15
+ }
16
+ export declare const createOverlayComponent: <OverlayComponent extends object, OverlayType extends OverlayElement>(tagName: string, controller: {
17
+ create: (options: any) => Promise<OverlayType>;
18
+ }, customElement?: any) => React.ForwardRefExoticComponent<React.PropsWithoutRef<OverlayComponent & ReactOverlayProps & {
19
+ forwardedRef?: StencilReactForwardedRef<OverlayType> | undefined;
20
+ }> & React.RefAttributes<OverlayType>>;
21
+ export {};
@@ -0,0 +1,95 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ import { attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';
4
+ export const createOverlayComponent = (tagName, controller, customElement) => {
5
+ defineCustomElement(tagName, customElement);
6
+ const displayName = dashToPascalCase(tagName);
7
+ const didDismissEventName = `on${displayName}DidDismiss`;
8
+ const didPresentEventName = `on${displayName}DidPresent`;
9
+ const willDismissEventName = `on${displayName}WillDismiss`;
10
+ const willPresentEventName = `on${displayName}WillPresent`;
11
+ let isDismissing = false;
12
+ class Overlay extends React.Component {
13
+ constructor(props) {
14
+ super(props);
15
+ if (typeof document !== 'undefined') {
16
+ this.el = document.createElement('div');
17
+ }
18
+ this.handleDismiss = this.handleDismiss.bind(this);
19
+ }
20
+ static get displayName() {
21
+ return displayName;
22
+ }
23
+ componentDidMount() {
24
+ if (this.props.isOpen) {
25
+ this.present();
26
+ }
27
+ }
28
+ componentWillUnmount() {
29
+ if (this.overlay) {
30
+ this.overlay.dismiss();
31
+ }
32
+ }
33
+ handleDismiss(event) {
34
+ if (this.props.onDidDismiss) {
35
+ this.props.onDidDismiss(event);
36
+ }
37
+ setRef(this.props.forwardedRef, null);
38
+ }
39
+ shouldComponentUpdate(nextProps) {
40
+ // Check if the overlay component is about to dismiss
41
+ if (this.overlay && nextProps.isOpen !== this.props.isOpen && nextProps.isOpen === false) {
42
+ isDismissing = true;
43
+ }
44
+ return true;
45
+ }
46
+ async componentDidUpdate(prevProps) {
47
+ if (this.overlay) {
48
+ attachProps(this.overlay, this.props, prevProps);
49
+ }
50
+ if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {
51
+ this.present(prevProps);
52
+ }
53
+ if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {
54
+ await this.overlay.dismiss();
55
+ isDismissing = false;
56
+ /**
57
+ * Now that the overlay is dismissed
58
+ * we need to render again so that any
59
+ * inner components will be unmounted
60
+ */
61
+ this.forceUpdate();
62
+ }
63
+ }
64
+ async present(prevProps) {
65
+ const { children, isOpen, onDidDismiss, onDidPresent, onWillDismiss, onWillPresent, ...cProps } = this.props;
66
+ const elementProps = {
67
+ ...cProps,
68
+ ref: this.props.forwardedRef,
69
+ [didDismissEventName]: this.handleDismiss,
70
+ [didPresentEventName]: (e) => this.props.onDidPresent && this.props.onDidPresent(e),
71
+ [willDismissEventName]: (e) => this.props.onWillDismiss && this.props.onWillDismiss(e),
72
+ [willPresentEventName]: (e) => this.props.onWillPresent && this.props.onWillPresent(e),
73
+ };
74
+ this.overlay = await controller.create({
75
+ ...elementProps,
76
+ component: this.el,
77
+ componentProps: {},
78
+ });
79
+ setRef(this.props.forwardedRef, this.overlay);
80
+ attachProps(this.overlay, elementProps, prevProps);
81
+ await this.overlay.present();
82
+ }
83
+ render() {
84
+ /**
85
+ * Continue to render the component even when
86
+ * overlay is dismissing otherwise component
87
+ * will be hidden before animation is done.
88
+ */
89
+ return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);
90
+ }
91
+ }
92
+ return React.forwardRef((props, ref) => {
93
+ return React.createElement(Overlay, { ...props, forwardedRef: ref });
94
+ });
95
+ };
@@ -0,0 +1,2 @@
1
+ export { createReactComponent } from './createComponent';
2
+ export { createOverlayComponent } from './createOverlayComponent';
@@ -0,0 +1,2 @@
1
+ export { createReactComponent } from './createComponent';
2
+ export { createOverlayComponent } from './createOverlayComponent';
@@ -0,0 +1,29 @@
1
+ export interface EventEmitter<T = any> {
2
+ emit: (data?: T) => CustomEvent<T>;
3
+ }
4
+ export interface StyleReactProps {
5
+ class?: string;
6
+ className?: string;
7
+ style?: {
8
+ [key: string]: any;
9
+ };
10
+ }
11
+ export interface OverlayEventDetail<T = any> {
12
+ data?: T;
13
+ role?: string;
14
+ }
15
+ export interface OverlayInterface {
16
+ el: HTMLElement;
17
+ animated: boolean;
18
+ keyboardClose: boolean;
19
+ overlayIndex: number;
20
+ presented: boolean;
21
+ enterAnimation?: any;
22
+ leaveAnimation?: any;
23
+ didPresent: EventEmitter<void>;
24
+ willPresent: EventEmitter<void>;
25
+ willDismiss: EventEmitter<OverlayEventDetail>;
26
+ didDismiss: EventEmitter<OverlayEventDetail>;
27
+ present(): Promise<void>;
28
+ dismiss(data?: any, role?: string): Promise<boolean>;
29
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void;
2
+ export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string;
3
+ /**
4
+ * Transforms a React event name to a browser event name.
5
+ */
6
+ export declare const transformReactEventName: (eventNameSuffix: string) => string;
7
+ /**
8
+ * Checks if an event is supported in the current execution environment.
9
+ * @license Modernizr 3.0.0pre (Custom Build) | MIT
10
+ */
11
+ export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
12
+ export declare const syncEvent: (node: Element & {
13
+ __events?: {
14
+ [key: string]: ((e: Event) => any) | undefined;
15
+ } | undefined;
16
+ }, eventName: string, newEventHandler?: ((e: Event) => any) | undefined) => void;
@@ -0,0 +1,107 @@
1
+ import { camelToDashCase } from './case';
2
+ export const attachProps = (node, newProps, oldProps = {}) => {
3
+ // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
4
+ if (node instanceof Element) {
5
+ // add any classes in className to the class list
6
+ const className = getClassName(node.classList, newProps, oldProps);
7
+ if (className !== '') {
8
+ node.className = className;
9
+ }
10
+ Object.keys(newProps).forEach((name) => {
11
+ if (name === 'children' ||
12
+ name === 'style' ||
13
+ name === 'ref' ||
14
+ name === 'class' ||
15
+ name === 'className' ||
16
+ name === 'forwardedRef') {
17
+ return;
18
+ }
19
+ if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
20
+ const eventName = name.substring(2);
21
+ const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
22
+ if (!isCoveredByReact(eventNameLc)) {
23
+ syncEvent(node, eventNameLc, newProps[name]);
24
+ }
25
+ }
26
+ else {
27
+ node[name] = newProps[name];
28
+ const propType = typeof newProps[name];
29
+ if (propType === 'string') {
30
+ node.setAttribute(camelToDashCase(name), newProps[name]);
31
+ }
32
+ }
33
+ });
34
+ }
35
+ };
36
+ export const getClassName = (classList, newProps, oldProps) => {
37
+ const newClassProp = newProps.className || newProps.class;
38
+ const oldClassProp = oldProps.className || oldProps.class;
39
+ // map the classes to Maps for performance
40
+ const currentClasses = arrayToMap(classList);
41
+ const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
42
+ const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
43
+ const finalClassNames = [];
44
+ // loop through each of the current classes on the component
45
+ // to see if it should be a part of the classNames added
46
+ currentClasses.forEach((currentClass) => {
47
+ if (incomingPropClasses.has(currentClass)) {
48
+ // add it as its already included in classnames coming in from newProps
49
+ finalClassNames.push(currentClass);
50
+ incomingPropClasses.delete(currentClass);
51
+ }
52
+ else if (!oldPropClasses.has(currentClass)) {
53
+ // add it as it has NOT been removed by user
54
+ finalClassNames.push(currentClass);
55
+ }
56
+ });
57
+ incomingPropClasses.forEach((s) => finalClassNames.push(s));
58
+ return finalClassNames.join(' ');
59
+ };
60
+ /**
61
+ * Transforms a React event name to a browser event name.
62
+ */
63
+ export const transformReactEventName = (eventNameSuffix) => {
64
+ switch (eventNameSuffix) {
65
+ case 'doubleclick':
66
+ return 'dblclick';
67
+ }
68
+ return eventNameSuffix;
69
+ };
70
+ /**
71
+ * Checks if an event is supported in the current execution environment.
72
+ * @license Modernizr 3.0.0pre (Custom Build) | MIT
73
+ */
74
+ export const isCoveredByReact = (eventNameSuffix) => {
75
+ if (typeof document === 'undefined') {
76
+ return true;
77
+ }
78
+ else {
79
+ const eventName = 'on' + transformReactEventName(eventNameSuffix);
80
+ let isSupported = eventName in document;
81
+ if (!isSupported) {
82
+ const element = document.createElement('div');
83
+ element.setAttribute(eventName, 'return;');
84
+ isSupported = typeof element[eventName] === 'function';
85
+ }
86
+ return isSupported;
87
+ }
88
+ };
89
+ export const syncEvent = (node, eventName, newEventHandler) => {
90
+ const eventStore = node.__events || (node.__events = {});
91
+ const oldEventHandler = eventStore[eventName];
92
+ // Remove old listener so they don't double up.
93
+ if (oldEventHandler) {
94
+ node.removeEventListener(eventName, oldEventHandler);
95
+ }
96
+ // Bind new listener.
97
+ node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {
98
+ if (newEventHandler) {
99
+ newEventHandler.call(this, e);
100
+ }
101
+ }));
102
+ };
103
+ const arrayToMap = (arr) => {
104
+ const map = new Map();
105
+ arr.forEach((s) => map.set(s, s));
106
+ return map;
107
+ };
@@ -0,0 +1,2 @@
1
+ export declare const dashToPascalCase: (str: string) => string;
2
+ export declare const camelToDashCase: (str: string) => string;
@@ -0,0 +1,6 @@
1
+ export const dashToPascalCase = (str) => str
2
+ .toLowerCase()
3
+ .split('-')
4
+ .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
5
+ .join('');
6
+ export const camelToDashCase = (str) => str.replace(/([A-Z])/g, (m) => `-${m[0].toLowerCase()}`);
@@ -0,0 +1,2 @@
1
+ export declare const isDevMode: () => boolean;
2
+ export declare const deprecationWarning: (key: string, message: string) => void;
@@ -0,0 +1,12 @@
1
+ export const isDevMode = () => {
2
+ return process && process.env && process.env.NODE_ENV === 'development';
3
+ };
4
+ const warnings = {};
5
+ export const deprecationWarning = (key, message) => {
6
+ if (isDevMode()) {
7
+ if (!warnings[key]) {
8
+ console.warn(message);
9
+ warnings[key] = true;
10
+ }
11
+ }
12
+ };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { StyleReactProps } from '../interfaces';
3
+ export type StencilReactExternalProps<PropType, ElementType> = PropType & Omit<React.HTMLAttributes<ElementType>, 'style'> & StyleReactProps;
4
+ export type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;
5
+ export declare const setRef: (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => void;
6
+ export declare const mergeRefs: (...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]) => React.RefCallback<any>;
7
+ export declare const createForwardRef: <PropType, ElementType>(ReactComponent: any, displayName: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
8
+ export declare const defineCustomElement: (tagName: string, customElement: any) => void;
9
+ export * from './attachProps';
10
+ export * from './case';
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ export const setRef = (ref, value) => {
3
+ if (typeof ref === 'function') {
4
+ ref(value);
5
+ }
6
+ else if (ref != null) {
7
+ // Cast as a MutableRef so we can assign current
8
+ ref.current = value;
9
+ }
10
+ };
11
+ export const mergeRefs = (...refs) => {
12
+ return (value) => {
13
+ refs.forEach((ref) => {
14
+ setRef(ref, value);
15
+ });
16
+ };
17
+ };
18
+ export const createForwardRef = (ReactComponent, displayName) => {
19
+ const forwardRef = (props, ref) => {
20
+ return React.createElement(ReactComponent, { ...props, forwardedRef: ref });
21
+ };
22
+ forwardRef.displayName = displayName;
23
+ return React.forwardRef(forwardRef);
24
+ };
25
+ export const defineCustomElement = (tagName, customElement) => {
26
+ if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
27
+ customElements.define(tagName, customElement);
28
+ }
29
+ };
30
+ export * from './attachProps';
31
+ export * from './case';
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@arcgis/map-components-react",
3
+ "sideEffects": false,
4
+ "version": "1.0.0-beta.12",
5
+ "description": "A set of React components that wrap map components",
6
+ "license": "SEE LICENSE.md",
7
+ "scripts": {
8
+ "build": "rimraf dist && yarn util:patch-jsx-import && yarn compile",
9
+ "clean": "rimraf dist node_modules .turbo",
10
+ "compile": "yarn tsc",
11
+ "tsc": "tsc",
12
+ "util:patch-jsx-import": "ts-node ./support/patchImportPathJSX.ts"
13
+ },
14
+ "main": "./dist/index.js",
15
+ "module": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "files": [
18
+ "dist/"
19
+ ],
20
+ "publishConfig": {
21
+ "registry": "https://registry.npmjs.org/",
22
+ "access": "public"
23
+ },
24
+ "dependencies": {
25
+ "@arcgis/map-components": "1.0.0-beta.14"
26
+ },
27
+ "peerDependencies": {
28
+ "react": "^18",
29
+ "react-dom": "^18"
30
+ },
31
+ "devDependencies": {
32
+ "@types/react-dom": "^18.2.0",
33
+ "rimraf": "^5.0.0",
34
+ "ts-node": "^10.9.1",
35
+ "typescript": "4.9.5"
36
+ },
37
+ "gitHead": "cd1b3bf7e48b497211638bbe607ad0e10340b119"
38
+ }