@esri/solutions-components 0.2.2 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/t9n/solution-config-modal/resources.json +22 -0
- package/dist/assets/t9n/solution-config-modal/resources_en.json +22 -0
- package/dist/cjs/calcite-action-menu_2.cjs.entry.js +18 -401
- package/dist/cjs/calcite-action-menu_2.cjs.entry.js.map +1 -1
- package/dist/cjs/calcite-action_2.cjs.entry.js +423 -71
- package/dist/cjs/calcite-action_2.cjs.entry.js.map +1 -1
- package/dist/cjs/calcite-loader.cjs.entry.js +97 -0
- package/dist/cjs/calcite-loader.cjs.entry.js.map +1 -0
- package/dist/cjs/{solution-configuration.cjs.entry.js → calcite-modal_2.cjs.entry.js} +451 -13
- package/dist/cjs/calcite-modal_2.cjs.entry.js.map +1 -0
- package/dist/cjs/{calcite-shell-panel_14.cjs.entry.js → calcite-panel_12.cjs.entry.js} +455 -709
- package/dist/cjs/calcite-panel_12.cjs.entry.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/solution-config-modal.cjs.entry.js +131 -0
- package/dist/cjs/solution-config-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/{solution-contents_3.cjs.entry.js → solution-contents_7.cjs.entry.js} +664 -5
- package/dist/cjs/solution-contents_7.cjs.entry.js.map +1 -0
- package/dist/cjs/{solution-store-893499a5.js → solution-store-09b3fc53.js} +4 -6
- package/dist/cjs/solution-store-09b3fc53.js.map +1 -0
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/solution-config-modal/solution-config-modal.css +91 -0
- package/dist/collection/components/solution-config-modal/solution-config-modal.js +245 -0
- package/dist/collection/components/solution-config-modal/solution-config-modal.js.map +1 -0
- package/dist/collection/components/solution-configuration/solution-configuration.js +23 -17
- package/dist/collection/components/solution-configuration/solution-configuration.js.map +1 -1
- package/dist/collection/components/solution-item/solution-item.js +0 -2
- package/dist/collection/components/solution-item/solution-item.js.map +1 -1
- package/dist/collection/components/solution-item-details/solution-item-details.js +0 -13
- package/dist/collection/components/solution-item-details/solution-item-details.js.map +1 -1
- package/dist/collection/utils/solution-store.js +3 -5
- package/dist/collection/utils/solution-store.js.map +1 -1
- package/dist/collection/utils/solution-store.ts +3 -5
- package/dist/esm/buffer-tools_6.entry.js +2 -2
- package/dist/esm/calcite-action-bar_6.entry.js +2 -2
- package/dist/esm/calcite-action-menu_2.entry.js +20 -403
- package/dist/esm/calcite-action-menu_2.entry.js.map +1 -1
- package/dist/esm/calcite-action_2.entry.js +424 -72
- package/dist/esm/calcite-action_2.entry.js.map +1 -1
- package/dist/esm/calcite-combobox_3.entry.js +2 -2
- package/dist/esm/calcite-loader.entry.js +93 -0
- package/dist/esm/calcite-loader.entry.js.map +1 -0
- package/dist/esm/{solution-configuration.entry.js → calcite-modal_2.entry.js} +453 -16
- package/dist/esm/calcite-modal_2.entry.js.map +1 -0
- package/dist/esm/{calcite-shell-panel_14.entry.js → calcite-panel_12.entry.js} +454 -706
- package/dist/esm/calcite-panel_12.entry.js.map +1 -0
- package/dist/esm/config-layer-picker.entry.js +2 -2
- package/dist/esm/{interfaces-e2a2064d.js → interfaces-1bdfc3a8.js} +2 -2
- package/dist/esm/{interfaces-e2a2064d.js.map → interfaces-1bdfc3a8.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{mapViewUtils-09f1e7bd.js → mapViewUtils-809947c8.js} +2 -2
- package/dist/esm/{mapViewUtils-09f1e7bd.js.map → mapViewUtils-809947c8.js.map} +1 -1
- package/dist/esm/public-notification.entry.js +2 -2
- package/dist/esm/solution-config-modal.entry.js +127 -0
- package/dist/esm/solution-config-modal.entry.js.map +1 -0
- package/dist/esm/{solution-contents_3.entry.js → solution-contents_7.entry.js} +661 -6
- package/dist/esm/solution-contents_7.entry.js.map +1 -0
- package/dist/esm/{solution-store-0c58c852.js → solution-store-d8519c64.js} +5 -7
- package/dist/esm/solution-store-d8519c64.js.map +1 -0
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-be1ed982.entry.js → p-11068040.entry.js} +3 -3
- package/dist/solutions-components/{p-be1ed982.entry.js.map → p-11068040.entry.js.map} +0 -0
- package/dist/solutions-components/{p-659edb14.js → p-2910dd9e.js} +5 -7
- package/dist/{cjs/solution-store-893499a5.js.map → solutions-components/p-2910dd9e.js.map} +1 -1
- package/dist/solutions-components/{p-291fd295.entry.js → p-30810b45.entry.js} +3 -3
- package/dist/solutions-components/{p-291fd295.entry.js.map → p-30810b45.entry.js.map} +0 -0
- package/dist/solutions-components/p-38ddadf2.entry.js +342 -0
- package/dist/solutions-components/p-38ddadf2.entry.js.map +1 -0
- package/dist/solutions-components/{p-77c75f3a.entry.js → p-5b20090f.entry.js} +661 -6
- package/dist/solutions-components/p-5b20090f.entry.js.map +1 -0
- package/dist/solutions-components/{p-9393631c.entry.js → p-9ef1328a.entry.js} +3 -3
- package/dist/solutions-components/{p-9393631c.entry.js.map → p-9ef1328a.entry.js.map} +0 -0
- package/dist/solutions-components/{p-984cb687.entry.js → p-a1786d11.entry.js} +454 -706
- package/dist/solutions-components/p-a1786d11.entry.js.map +1 -0
- package/dist/solutions-components/{p-fe0fdd8b.js → p-c20bd963.js} +2 -2
- package/dist/solutions-components/{p-fe0fdd8b.js.map → p-c20bd963.js.map} +1 -1
- package/dist/solutions-components/p-c5721b0f.entry.js +127 -0
- package/dist/solutions-components/p-c5721b0f.entry.js.map +1 -0
- package/dist/solutions-components/{p-24d75151.entry.js → p-c818e661.entry.js} +3 -3
- package/dist/solutions-components/{p-24d75151.entry.js.map → p-c818e661.entry.js.map} +0 -0
- package/dist/solutions-components/{p-90629c1d.entry.js → p-cf59eb16.entry.js} +453 -16
- package/dist/solutions-components/p-cf59eb16.entry.js.map +1 -0
- package/dist/solutions-components/p-e405ebe8.entry.js +93 -0
- package/dist/solutions-components/p-e405ebe8.entry.js.map +1 -0
- package/dist/solutions-components/{p-77e6b03c.entry.js → p-e6fb9cde.entry.js} +3 -3
- package/dist/solutions-components/{p-77e6b03c.entry.js.map → p-e6fb9cde.entry.js.map} +0 -0
- package/dist/solutions-components/{p-97c4a268.entry.js → p-ef6f9e24.entry.js} +113 -229
- package/dist/solutions-components/p-ef6f9e24.entry.js.map +1 -0
- package/dist/solutions-components/{p-6b9dc092.js → p-f04fdb9a.js} +2 -2
- package/dist/solutions-components/{p-6b9dc092.js.map → p-f04fdb9a.js.map} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/solution-store.ts +3 -5
- package/dist/solutions-components_commit.txt +8 -8
- package/dist/types/components/solution-config-modal/solution-config-modal.d.ts +69 -0
- package/dist/types/components/solution-configuration/solution-configuration.d.ts +4 -2
- package/dist/types/components/solution-item-details/solution-item-details.d.ts +0 -1
- package/dist/types/components.d.ts +43 -5
- package/dist/types/preact.d.ts +4 -0
- package/package.json +1 -1
- package/dist/cjs/calcite-modal.cjs.entry.js +0 -449
- package/dist/cjs/calcite-modal.cjs.entry.js.map +0 -1
- package/dist/cjs/calcite-panel_2.cjs.entry.js +0 -439
- package/dist/cjs/calcite-panel_2.cjs.entry.js.map +0 -1
- package/dist/cjs/calcite-scrim.cjs.entry.js +0 -64
- package/dist/cjs/calcite-scrim.cjs.entry.js.map +0 -1
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js.map +0 -1
- package/dist/cjs/solution-configuration.cjs.entry.js.map +0 -1
- package/dist/cjs/solution-contents_3.cjs.entry.js.map +0 -1
- package/dist/esm/calcite-modal.entry.js +0 -445
- package/dist/esm/calcite-modal.entry.js.map +0 -1
- package/dist/esm/calcite-panel_2.entry.js +0 -434
- package/dist/esm/calcite-panel_2.entry.js.map +0 -1
- package/dist/esm/calcite-scrim.entry.js +0 -60
- package/dist/esm/calcite-scrim.entry.js.map +0 -1
- package/dist/esm/calcite-shell-panel_14.entry.js.map +0 -1
- package/dist/esm/solution-configuration.entry.js.map +0 -1
- package/dist/esm/solution-contents_3.entry.js.map +0 -1
- package/dist/esm/solution-store-0c58c852.js.map +0 -1
- package/dist/solutions-components/p-0fda7d9e.entry.js +0 -434
- package/dist/solutions-components/p-0fda7d9e.entry.js.map +0 -1
- package/dist/solutions-components/p-2ff754ce.entry.js +0 -257
- package/dist/solutions-components/p-2ff754ce.entry.js.map +0 -1
- package/dist/solutions-components/p-30a6199a.entry.js +0 -445
- package/dist/solutions-components/p-30a6199a.entry.js.map +0 -1
- package/dist/solutions-components/p-659edb14.js.map +0 -1
- package/dist/solutions-components/p-77c75f3a.entry.js.map +0 -1
- package/dist/solutions-components/p-90629c1d.entry.js.map +0 -1
- package/dist/solutions-components/p-97c4a268.entry.js.map +0 -1
- package/dist/solutions-components/p-984cb687.entry.js.map +0 -1
- package/dist/solutions-components/p-f5268b4f.entry.js +0 -60
- package/dist/solutions-components/p-f5268b4f.entry.js.map +0 -1
@@ -3,7 +3,7 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import { E as EWorkflowType } from './p-
|
6
|
+
import { E as EWorkflowType } from './p-f04fdb9a.js';
|
7
7
|
|
8
8
|
/** @license
|
9
9
|
* Copyright 2022 Esri
|
@@ -281,4 +281,4 @@ async function goToSelection(ids, layerView, mapView, flashFeatures = true) {
|
|
281
281
|
|
282
282
|
export { goToSelection as a, getMapLayerView as b, getSelectionSetQuery as c, getQueryGeoms as d, queryFeaturesByID as e, queryFeaturesByGeometry as f, getMapLayerNames as g, highlightFeatures as h, queryObjectIds as q };
|
283
283
|
|
284
|
-
//# sourceMappingURL=p-
|
284
|
+
//# sourceMappingURL=p-c20bd963.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"p-fe0fdd8b.js","mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;AAkBA;;;;;;;;AAQO,eAAe,cAAc,CAClC,UAA6B,EAC7B,KAA0B;EAE1B,IAAI,GAAG,GAAG,EAAE,CAAC;EACb,MAAM,SAAS,GAAG,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CAAC,CAAC,KAAK,KAAK,KAAK,CAAC;KAC1B,CAAC,CAAC;GACJ,CAAC,CAAC;EACH,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AACnD,CAAC;AAED;;;;;;;;;;;AAWO,eAAe,iBAAiB,CACrC,GAAa,EACb,SAAkC,EAClC,OAAuB,EACvB,YAAY,GAAG,KAAK;EAEpB,IAAI,YAAY,EAAE;IAChB,MAAM,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;GACrD;EACD,OAAO,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;AASO,eAAe,cAAc,CAClC,GAAa,EACb,SAAkC;EAElC,MAAM,aAAa,GAAG;IACpB,SAAS,EAAE,GAAG;GACS,CAAC;EAC1B,SAAS,CAAC,aAAa,GAAG;IACxB,MAAM,EAAE,aAAa;IACrB,cAAc,EAAE,cAAc;IAC9B,cAAc,EAAE,WAAW;GACJ,CAAC;EAE1B,UAAU,CAAC;IACT,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC;GACrC,EAAE,IAAI,CAAC,CAAC;AACX,CAAC;AAED;;;;;;;;;;;AAWO,eAAe,aAAa,CACjC,GAAa,EACb,SAAkC,EAClC,OAAuB,EACvB,aAAa,GAAG,IAAI;EAEpB,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;EACvD,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;EAClC,IAAI,aAAa,EAAE;IACjB,MAAM,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;GACtC;AACH;;;;","names":[],"sources":["./src/utils/queryUtils.ts","./src/utils/mapViewUtils.ts"],"sourcesContent":["/** @license\r\n * Copyright 2022 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\nimport { EWorkflowType, ISelectionSet, IQueryExtentResponse } from \"./interfaces\";\r\n\r\n/**\r\n * Query the layer for OIDs based on any user drawn geometries or buffers\r\n *\r\n * @param geometries Array of geometries used for the selection of ids from the layer\r\n * @param layer the layer to retrieve ids from\r\n *\r\n * @returns Promise with the OIDs of features from the layer that interset the provided geometries\r\n */\r\nexport async function queryObjectIds(\r\n geometries: __esri.Geometry[],\r\n layer: __esri.FeatureLayer\r\n): Promise<number[]> {\r\n let ids = [];\r\n const queryDefs = geometries.map(g => _intersectQuery(g, layer))\r\n const results = await Promise.all(queryDefs);\r\n results.forEach(resultIds => {\r\n ids = [\r\n ...ids,\r\n ...resultIds\r\n ]\r\n });\r\n return ids;\r\n}\r\n\r\n/**\r\n * Query the layer for features that have the provided OIDs\r\n *\r\n * @param ids array of ObjectIDs to be used to query for features in a layer\r\n * @param layer the layer to retrieve features from\r\n *\r\n * @returns Promise with the featureSet from the layer that match the provided ids\r\n */\r\n export async function queryFeaturesByID(\r\n ids: number[],\r\n layer: __esri.FeatureLayer\r\n): Promise<__esri.FeatureSet> {\r\n const q = layer.createQuery();\r\n q.outFields = [\"*\"];\r\n q.objectIds = ids;\r\n return layer.queryFeatures(q);\r\n}\r\n\r\n/**\r\n * Query the layer for features that intersect the provided geometry\r\n *\r\n * @param start zero-based index indicating where to begin retrieving features\r\n * @param layer the layer to retrieve features from\r\n * @param geometry the geometry to apply to the spatial filter\r\n * @param featuresCollection\r\n *\r\n * @returns Promise with the featureSet from the layer that match the provided ids\r\n */\r\nexport async function queryFeaturesByGeometry(\r\n start: number,\r\n layer: __esri.FeatureLayer,\r\n geometry: __esri.Geometry,\r\n featuresCollection: {[key: string]: __esri.Graphic[]}\r\n): Promise<{[key: string]: __esri.Graphic[]}> {\r\n const num = layer.capabilities.query.maxRecordCount;\r\n const query = {\r\n start,\r\n num,\r\n outFields: [\"*\"],\r\n returnGeometry: true,\r\n geometry\r\n };\r\n\r\n const result = await layer.queryFeatures(query);\r\n featuresCollection[layer.title] = featuresCollection[layer.title].concat(\r\n result.features\r\n );\r\n\r\n return result.exceededTransferLimit ?\r\n queryFeaturesByGeometry(start += num, layer, geometry, featuresCollection) :\r\n Promise.resolve(featuresCollection);\r\n}\r\n\r\n/**\r\n * Query the layer for the extent of features with the provided OIDs\r\n *\r\n * @param ids array of ObjectIDs to be used to query for features in a layer\r\n * @param layer the layer to query\r\n *\r\n * @returns Promise with the Extent of all features that match the provided ids\r\n */\r\n export async function queryExtent(\r\n ids: number[],\r\n layer: __esri.FeatureLayer\r\n): Promise<IQueryExtentResponse> {\r\n const query = layer.createQuery();\r\n query.objectIds = ids;\r\n return layer.queryExtent(query);\r\n}\r\n\r\n/**\r\n * Union geometries based on geometry type\r\n *\r\n * @param geometries Array of geometries to union\r\n * @param geometryEngine the geometry engine instance to perform the unions\r\n *\r\n * @returns Array of single unioned geometry for each geometry type\r\n */\r\nexport function getQueryGeoms(\r\n geometries: __esri.Geometry[],\r\n geometryEngine: __esri.geometryEngine\r\n): __esri.Geometry[] {\r\n // sort and union by geom type so we have a single geom for each type to query with\r\n return [\r\n ..._unionGeoms(geometries, \"polygon\", geometryEngine),\r\n ..._unionGeoms(geometries, \"polyline\", geometryEngine),\r\n ..._unionGeoms(geometries, \"point\", geometryEngine)\r\n ];\r\n}\r\n\r\n/**\r\n * Get the appropriate ObjectIds query for the provided selection set\r\n *\r\n * @param selectionSet the current selection set to fetch the query for\r\n * @param geometryEngine the geometry engine instance to perform the union of the user drawn graphics or buffers\r\n *\r\n * @returns A promise that will resolve with ids that intersect the selection sets geometries\r\n */\r\nexport function getSelectionSetQuery(\r\n selectionSet: ISelectionSet,\r\n geometryEngine: __esri.geometryEngine\r\n): Promise<number[]> {\r\n let q = Promise.resolve([]);\r\n if (selectionSet.workflowType !== EWorkflowType.REFINE) {\r\n if (!selectionSet.buffer) {\r\n const queryGeoms = getQueryGeoms(\r\n selectionSet.geometries,\r\n geometryEngine\r\n );\r\n q = queryObjectIds(\r\n queryGeoms,\r\n selectionSet.layerView.layer\r\n );\r\n } else {\r\n // buffer is a single unioned geom\r\n q = queryObjectIds(\r\n [selectionSet.buffer],\r\n selectionSet.layerView.layer\r\n );\r\n }\r\n }\r\n return q;\r\n}\r\n\r\n/**\r\n * Union geometries based on geometry type\r\n *\r\n * @param geometries array of geometries to union\r\n * @param type the current geometry type to union\r\n * @param geometryEngine the geometry engine instance to perform the unions\r\n *\r\n * @returns Array of single unioned geometry for the provided geometry type\r\n */\r\n function _unionGeoms(\r\n geometries: __esri.Geometry[],\r\n type: string,\r\n geometryEngine: __esri.geometryEngine\r\n): __esri.Geometry[] {\r\n const geoms = geometries.filter(g => g.type === type);\r\n return geoms.length <= 1 ? geoms : [geometryEngine.union(geoms)];\r\n}\r\n\r\n/**\r\n * Query the layer for ObjectIds of features that intersect the provided geometry\r\n *\r\n * @param geometry Geometry used for the selection of ids from the select layer view\r\n * @param layer the layer to query\r\n *\r\n * @returns Promise that will contain the selected ids\r\n */\r\nasync function _intersectQuery(\r\n geometry: __esri.Geometry,\r\n layer: __esri.FeatureLayer\r\n): Promise<number[]> {\r\n const q = layer.createQuery();\r\n q.spatialRelationship = \"intersects\";\r\n q.geometry = geometry;\r\n return layer.queryObjectIds(q);\r\n}\r\n","/** @license\r\n * Copyright 2022 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\nimport { queryExtent } from \"./queryUtils\";\r\n\r\n/**\r\n * Gets the layer names from the current map\r\n * \r\n * @param mapView the map view to fetch the layer names from\r\n *\r\n * @returns Promise resolving with an array of layer names\r\n *\r\n */\r\nexport async function getMapLayerNames(\r\n mapView: __esri.MapView\r\n): Promise<string[]> {\r\n let layerNames = [];\r\n await mapView.when(() => {\r\n layerNames = mapView.map.layers.toArray().map((l) => {\r\n return l.title;\r\n });\r\n });\r\n return layerNames;\r\n}\r\n\r\n/**\r\n * Get a layer view by title\r\n * \r\n * @param mapView the map view to fetch the layer from\r\n * @param title the title if the layer to fetch\r\n *\r\n * @returns Promise resolving with the fetched layer view\r\n *\r\n */\r\nexport async function getMapLayerView(\r\n mapView: __esri.MapView,\r\n title: string\r\n): Promise<__esri.FeatureLayerView> {\r\n const layer = await getMapLayer(mapView, title);\r\n return layer ? await mapView.whenLayerView(layer) : undefined;\r\n}\r\n\r\n/**\r\n * Get a layer by title\r\n * \r\n * @param mapView the map view to fetch the layer from\r\n * @param title the title if the layer to fetch\r\n *\r\n * @returns Promise resolving with the fetched layer\r\n *\r\n */\r\nexport async function getMapLayer(\r\n mapView: __esri.MapView,\r\n title: string\r\n): Promise<__esri.FeatureLayer> {\r\n let layers = [];\r\n await mapView.when(() => {\r\n layers = mapView.map.layers.toArray().filter((l) => {\r\n return l.title === title;\r\n });\r\n });\r\n return layers.length > 0 ? layers[0] : undefined;\r\n}\r\n\r\n/**\r\n * Highlight features by OID\r\n * \r\n * @param ids the OIDs from the layer to highlight\r\n * @param layerView the layer view to highlight\r\n * @param mapView the map view used if updateExtent is true\r\n * @param updateExtent optional (default false) boolean to indicate if we should zoom to the extent\r\n *\r\n * @returns Promise resolving with the highlight handle\r\n *\r\n */\r\nexport async function highlightFeatures(\r\n ids: number[],\r\n layerView: __esri.FeatureLayerView,\r\n mapView: __esri.MapView,\r\n updateExtent = false\r\n): Promise<__esri.Handle> {\r\n if (updateExtent) {\r\n await goToSelection(ids, layerView, mapView, false);\r\n }\r\n return layerView.highlight(ids);\r\n}\r\n\r\n/**\r\n * Flash features by OID\r\n * \r\n * @param ids the OIDs from the layer to highlight\r\n * @param layerView the layer view to highlight\r\n *\r\n * @returns Promise resolving when the operation is complete\r\n *\r\n */\r\nexport async function flashSelection(\r\n ids: number[],\r\n layerView: __esri.FeatureLayerView\r\n): Promise<void> {\r\n const featureFilter = {\r\n objectIds: ids\r\n } as __esri.FeatureFilter;\r\n layerView.featureEffect = {\r\n filter: featureFilter,\r\n includedEffect: \"invert(100%)\",\r\n excludedEffect: \"blur(5px)\"\r\n } as __esri.FeatureEffect;\r\n\r\n setTimeout(() => {\r\n layerView.featureEffect = undefined;\r\n }, 1300);\r\n}\r\n\r\n/**\r\n * Zoom to features based on OID\r\n * \r\n * @param ids the OIDs from the layer to go to\r\n * @param layerView the layer view that contains the OIDs\r\n * @param mapView the map view to show the extent change\r\n * @param flashFeatures optional (default true) boolean to indicate if we should flash the features\r\n * \r\n * @returns Promise resolving when the operation is complete\r\n *\r\n */\r\nexport async function goToSelection(\r\n ids: number[],\r\n layerView: __esri.FeatureLayerView,\r\n mapView: __esri.MapView,\r\n flashFeatures = true\r\n): Promise<void> {\r\n const result = await queryExtent(ids, layerView.layer);\r\n await mapView.goTo(result.extent);\r\n if (flashFeatures) {\r\n await flashSelection(ids, layerView);\r\n }\r\n}\r\n"],"version":3}
|
1
|
+
{"file":"p-c20bd963.js","mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;AAkBA;;;;;;;;AAQO,eAAe,cAAc,CAClC,UAA6B,EAC7B,KAA0B;EAE1B,IAAI,GAAG,GAAG,EAAE,CAAC;EACb,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,EAAE,KAAK,CAA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AC;EACH,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AACnD,CAAC;AAED;;;;;;;;;;;AAWO,eAAe,iBAAiB,CACrC,GAAa,EACb,SAAkC,EAClC,OAAuB,EACvB,YAAY,GAAG,KAAK;EAEpB,IAAI,YAAY,EAAE;IAChB,MAAM,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;GACrD;EACD,OAAO,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;AASO,eAAe,cAAc,CAClC,GAAa,EACb,SAAkC;EAElC,MAAM,aAAa,GAAG;IACpB,SAAS,EAAE,GAAG;GACS,CAAC;EAC1B,SAAS,CAAC,aAAa,GAAG;IACxB,MAAM,EAAE,aAAa;IACrB,cAAc,EAAE,cAAc;IAC9B,cAAc,EAAE,WAAW;GACJ,CAAC;EAE1B,UAAU,CAAC;IACT,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC;GACrC,EAAE,IAAI,CAAC,CAAC;AACX,CAAC;AAED;;;;;;;;;;;AAWO,eAAe,aAAa,CACjC,GAAa,EACb,SAAkC,EAClC,OAAuB,EACvB,aAAa,GAAG,IAAI;EAEpB,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;EACvD,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;EAClC,IAAI,aAAa,EAAE;IACjB,MAAM,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;GACtC;AACH;;;;","names":[],"sources":["./src/utils/queryUtils.ts","./src/utils/mapViewUtils.ts"],"sourcesContent":["/** @license\r\n * Copyright 2022 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\nimport { EWorkflowType, ISelectionSet, IQueryExtentResponse } from \"./interfaces\";\r\n\r\n/**\r\n * Query the layer for OIDs based on any user drawn geometries or buffers\r\n *\r\n * @param geometries Array of geometries used for the selection of ids from the layer\r\n * @param layer the layer to retrieve ids from\r\n *\r\n * @returns Promise with the OIDs of features from the layer that interset the provided geometries\r\n */\r\nexport async function queryObjectIds(\r\n geometries: __esri.Geometry[],\r\n layer: __esri.FeatureLayer\r\n): Promise<number[]> {\r\n let ids = [];\r\n const queryDefs = geometries.map(g => _intersectQuery(g, layer))\r\n const results = await Promise.all(queryDefs);\r\n results.forEach(resultIds => {\r\n ids = [\r\n ...ids,\r\n ...resultIds\r\n ]\r\n });\r\n return ids;\r\n}\r\n\r\n/**\r\n * Query the layer for features that have the provided OIDs\r\n *\r\n * @param ids array of ObjectIDs to be used to query for features in a layer\r\n * @param layer the layer to retrieve features from\r\n *\r\n * @returns Promise with the featureSet from the layer that match the provided ids\r\n */\r\n export async function queryFeaturesByID(\r\n ids: number[],\r\n layer: __esri.FeatureLayer\r\n): Promise<__esri.FeatureSet> {\r\n const q = layer.createQuery();\r\n q.outFields = [\"*\"];\r\n q.objectIds = ids;\r\n return layer.queryFeatures(q);\r\n}\r\n\r\n/**\r\n * Query the layer for features that intersect the provided geometry\r\n *\r\n * @param start zero-based index indicating where to begin retrieving features\r\n * @param layer the layer to retrieve features from\r\n * @param geometry the geometry to apply to the spatial filter\r\n * @param featuresCollection\r\n *\r\n * @returns Promise with the featureSet from the layer that match the provided ids\r\n */\r\nexport async function queryFeaturesByGeometry(\r\n start: number,\r\n layer: __esri.FeatureLayer,\r\n geometry: __esri.Geometry,\r\n featuresCollection: {[key: string]: __esri.Graphic[]}\r\n): Promise<{[key: string]: __esri.Graphic[]}> {\r\n const num = layer.capabilities.query.maxRecordCount;\r\n const query = {\r\n start,\r\n num,\r\n outFields: [\"*\"],\r\n returnGeometry: true,\r\n geometry\r\n };\r\n\r\n const result = await layer.queryFeatures(query);\r\n featuresCollection[layer.title] = featuresCollection[layer.title].concat(\r\n result.features\r\n );\r\n\r\n return result.exceededTransferLimit ?\r\n queryFeaturesByGeometry(start += num, layer, geometry, featuresCollection) :\r\n Promise.resolve(featuresCollection);\r\n}\r\n\r\n/**\r\n * Query the layer for the extent of features with the provided OIDs\r\n *\r\n * @param ids array of ObjectIDs to be used to query for features in a layer\r\n * @param layer the layer to query\r\n *\r\n * @returns Promise with the Extent of all features that match the provided ids\r\n */\r\n export async function queryExtent(\r\n ids: number[],\r\n layer: __esri.FeatureLayer\r\n): Promise<IQueryExtentResponse> {\r\n const query = layer.createQuery();\r\n query.objectIds = ids;\r\n return layer.queryExtent(query);\r\n}\r\n\r\n/**\r\n * Union geometries based on geometry type\r\n *\r\n * @param geometries Array of geometries to union\r\n * @param geometryEngine the geometry engine instance to perform the unions\r\n *\r\n * @returns Array of single unioned geometry for each geometry type\r\n */\r\nexport function getQueryGeoms(\r\n geometries: __esri.Geometry[],\r\n geometryEngine: __esri.geometryEngine\r\n): __esri.Geometry[] {\r\n // sort and union by geom type so we have a single geom for each type to query with\r\n return [\r\n ..._unionGeoms(geometries, \"polygon\", geometryEngine),\r\n ..._unionGeoms(geometries, \"polyline\", geometryEngine),\r\n ..._unionGeoms(geometries, \"point\", geometryEngine)\r\n ];\r\n}\r\n\r\n/**\r\n * Get the appropriate ObjectIds query for the provided selection set\r\n *\r\n * @param selectionSet the current selection set to fetch the query for\r\n * @param geometryEngine the geometry engine instance to perform the union of the user drawn graphics or buffers\r\n *\r\n * @returns A promise that will resolve with ids that intersect the selection sets geometries\r\n */\r\nexport function getSelectionSetQuery(\r\n selectionSet: ISelectionSet,\r\n geometryEngine: __esri.geometryEngine\r\n): Promise<number[]> {\r\n let q = Promise.resolve([]);\r\n if (selectionSet.workflowType !== EWorkflowType.REFINE) {\r\n if (!selectionSet.buffer) {\r\n const queryGeoms = getQueryGeoms(\r\n selectionSet.geometries,\r\n geometryEngine\r\n );\r\n q = queryObjectIds(\r\n queryGeoms,\r\n selectionSet.layerView.layer\r\n );\r\n } else {\r\n // buffer is a single unioned geom\r\n q = queryObjectIds(\r\n [selectionSet.buffer],\r\n selectionSet.layerView.layer\r\n );\r\n }\r\n }\r\n return q;\r\n}\r\n\r\n/**\r\n * Union geometries based on geometry type\r\n *\r\n * @param geometries array of geometries to union\r\n * @param type the current geometry type to union\r\n * @param geometryEngine the geometry engine instance to perform the unions\r\n *\r\n * @returns Array of single unioned geometry for the provided geometry type\r\n */\r\n function _unionGeoms(\r\n geometries: __esri.Geometry[],\r\n type: string,\r\n geometryEngine: __esri.geometryEngine\r\n): __esri.Geometry[] {\r\n const geoms = geometries.filter(g => g.type === type);\r\n return geoms.length <= 1 ? geoms : [geometryEngine.union(geoms)];\r\n}\r\n\r\n/**\r\n * Query the layer for ObjectIds of features that intersect the provided geometry\r\n *\r\n * @param geometry Geometry used for the selection of ids from the select layer view\r\n * @param layer the layer to query\r\n *\r\n * @returns Promise that will contain the selected ids\r\n */\r\nasync function _intersectQuery(\r\n geometry: __esri.Geometry,\r\n layer: __esri.FeatureLayer\r\n): Promise<number[]> {\r\n const q = layer.createQuery();\r\n q.spatialRelationship = \"intersects\";\r\n q.geometry = geometry;\r\n return layer.queryObjectIds(q);\r\n}\r\n","/** @license\r\n * Copyright 2022 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\nimport { queryExtent } from \"./queryUtils\";\r\n\r\n/**\r\n * Gets the layer names from the current map\r\n * \r\n * @param mapView the map view to fetch the layer names from\r\n *\r\n * @returns Promise resolving with an array of layer names\r\n *\r\n */\r\nexport async function getMapLayerNames(\r\n mapView: __esri.MapView\r\n): Promise<string[]> {\r\n let layerNames = [];\r\n await mapView.when(() => {\r\n layerNames = mapView.map.layers.toArray().map((l) => {\r\n return l.title;\r\n });\r\n });\r\n return layerNames;\r\n}\r\n\r\n/**\r\n * Get a layer view by title\r\n * \r\n * @param mapView the map view to fetch the layer from\r\n * @param title the title if the layer to fetch\r\n *\r\n * @returns Promise resolving with the fetched layer view\r\n *\r\n */\r\nexport async function getMapLayerView(\r\n mapView: __esri.MapView,\r\n title: string\r\n): Promise<__esri.FeatureLayerView> {\r\n const layer = await getMapLayer(mapView, title);\r\n return layer ? await mapView.whenLayerView(layer) : undefined;\r\n}\r\n\r\n/**\r\n * Get a layer by title\r\n * \r\n * @param mapView the map view to fetch the layer from\r\n * @param title the title if the layer to fetch\r\n *\r\n * @returns Promise resolving with the fetched layer\r\n *\r\n */\r\nexport async function getMapLayer(\r\n mapView: __esri.MapView,\r\n title: string\r\n): Promise<__esri.FeatureLayer> {\r\n let layers = [];\r\n await mapView.when(() => {\r\n layers = mapView.map.layers.toArray().filter((l) => {\r\n return l.title === title;\r\n });\r\n });\r\n return layers.length > 0 ? layers[0] : undefined;\r\n}\r\n\r\n/**\r\n * Highlight features by OID\r\n * \r\n * @param ids the OIDs from the layer to highlight\r\n * @param layerView the layer view to highlight\r\n * @param mapView the map view used if updateExtent is true\r\n * @param updateExtent optional (default false) boolean to indicate if we should zoom to the extent\r\n *\r\n * @returns Promise resolving with the highlight handle\r\n *\r\n */\r\nexport async function highlightFeatures(\r\n ids: number[],\r\n layerView: __esri.FeatureLayerView,\r\n mapView: __esri.MapView,\r\n updateExtent = false\r\n): Promise<__esri.Handle> {\r\n if (updateExtent) {\r\n await goToSelection(ids, layerView, mapView, false);\r\n }\r\n return layerView.highlight(ids);\r\n}\r\n\r\n/**\r\n * Flash features by OID\r\n * \r\n * @param ids the OIDs from the layer to highlight\r\n * @param layerView the layer view to highlight\r\n *\r\n * @returns Promise resolving when the operation is complete\r\n *\r\n */\r\nexport async function flashSelection(\r\n ids: number[],\r\n layerView: __esri.FeatureLayerView\r\n): Promise<void> {\r\n const featureFilter = {\r\n objectIds: ids\r\n } as __esri.FeatureFilter;\r\n layerView.featureEffect = {\r\n filter: featureFilter,\r\n includedEffect: \"invert(100%)\",\r\n excludedEffect: \"blur(5px)\"\r\n } as __esri.FeatureEffect;\r\n\r\n setTimeout(() => {\r\n layerView.featureEffect = undefined;\r\n }, 1300);\r\n}\r\n\r\n/**\r\n * Zoom to features based on OID\r\n * \r\n * @param ids the OIDs from the layer to go to\r\n * @param layerView the layer view that contains the OIDs\r\n * @param mapView the map view to show the extent change\r\n * @param flashFeatures optional (default true) boolean to indicate if we should flash the features\r\n * \r\n * @returns Promise resolving when the operation is complete\r\n *\r\n */\r\nexport async function goToSelection(\r\n ids: number[],\r\n layerView: __esri.FeatureLayerView,\r\n mapView: __esri.MapView,\r\n flashFeatures = true\r\n): Promise<void> {\r\n const result = await queryExtent(ids, layerView.layer);\r\n await mapView.goTo(result.extent);\r\n if (flashFeatures) {\r\n await flashSelection(ids, layerView);\r\n }\r\n}\r\n"],"version":3}
|
@@ -0,0 +1,127 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './p-58c69df2.js';
|
7
|
+
import { g as getLocaleComponentStrings } from './p-20bdf42f.js';
|
8
|
+
import './p-3b010ce1.js';
|
9
|
+
|
10
|
+
const solutionConfigModalCss = ".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%}.config-solution{position:absolute;top:3.5rem;right:-1px;bottom:-1px;left:-1px;display:flex;padding:0.5rem}.config-inventory{display:inline;max-width:-moz-min-content;max-width:min-content;flex-grow:0;overflow-y:auto}.config-inventory-hide{display:none;max-width:-moz-min-content;max-width:min-content;flex-grow:0;overflow-y:auto}.config-item{position:relative;display:inline;flex-grow:1;overflow-y:auto;-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}solution-contents{position:relative;height:100%}solution-item{position:relative;height:100%}solution-spatial-ref{position:relative;height:100%;width:100%;overflow-y:auto}";
|
11
|
+
|
12
|
+
const SolutionConfigModal = class {
|
13
|
+
//--------------------------------------------------------------------------
|
14
|
+
//
|
15
|
+
// Lifecycle
|
16
|
+
//
|
17
|
+
//--------------------------------------------------------------------------
|
18
|
+
constructor(hostRef) {
|
19
|
+
registerInstance(this, hostRef);
|
20
|
+
this.solutionConfigModalClosed = createEvent(this, "solutionConfigModalClosed", 7);
|
21
|
+
this.cacheBreaker = undefined;
|
22
|
+
this.serializedAuthentication = "";
|
23
|
+
this.solutionTitle = "";
|
24
|
+
this.solutionItemId = undefined;
|
25
|
+
this._canSave = false;
|
26
|
+
this._translations = undefined;
|
27
|
+
//console.log("MODAL constructor " + this.solutionItemId);//??? + " open:" + this._modalIsOpen);//???
|
28
|
+
window.addEventListener("solutionCanSave", (evt) => {
|
29
|
+
this._canSave = evt.detail;
|
30
|
+
});
|
31
|
+
}
|
32
|
+
async valueWatchHandler() {
|
33
|
+
console.log("MODAL watch " + this.solutionItemId); //???
|
34
|
+
}
|
35
|
+
/**
|
36
|
+
* StencilJS: Called once just after the component is first connected to the DOM.
|
37
|
+
*
|
38
|
+
* @returns Promise when complete
|
39
|
+
*/
|
40
|
+
async componentWillLoad() {
|
41
|
+
return this._getTranslations();
|
42
|
+
}
|
43
|
+
componentWillRender() {
|
44
|
+
console.log("MODAL will render " + this.solutionTitle + " (" + this.solutionItemId + ", " + this.cacheBreaker + ")"); //???
|
45
|
+
}
|
46
|
+
/**
|
47
|
+
* Renders the component.
|
48
|
+
*/
|
49
|
+
render() {
|
50
|
+
const cacheBreakerParts = this.cacheBreaker.split("_");
|
51
|
+
if (!this.solutionItemId && cacheBreakerParts.length === 2) {
|
52
|
+
this.solutionItemId = cacheBreakerParts[0];
|
53
|
+
}
|
54
|
+
const modalIsOpen = !!this.solutionItemId;
|
55
|
+
console.log("MODAL render " + this.solutionTitle + " (" + this.solutionItemId + ", " + this.cacheBreaker + ")" + " open:" + modalIsOpen.toString()); //???
|
56
|
+
return (h(Host, null, h("calcite-modal", { "aria-labelledby": "solutions-modal-title", fullscreen: "", "intl-close": this._translations.cancel, onCalciteModalClose: () => this._cancel(), open: modalIsOpen, ref: (el) => this._modal = el }, h("h3", { id: "solutions-modal-title", slot: "header" }, this._translations.title.replace("{{solutionName}}", this.solutionTitle)), h("div", { class: "solutions-modal-content", id: "solutions-modal-content", slot: "content" }, h("solution-configuration", { ref: (el) => (this._configuration = el), "serialized-authentication": this.serializedAuthentication, "solution-item-id": this.solutionItemId })), h("calcite-button", { appearance: "outline", disabled: !this._canSave, onClick: () => this._cancel(), ref: (el) => (this._cancelBtn = el), slot: "secondary", width: "full" }, this._translations.cancel), h("calcite-button", { appearance: "solid", disabled: !this._canSave, onClick: () => this._save(), ref: (el) => (this._saveBtn = el), slot: "primary", width: "full" }, this._translations.save))));
|
57
|
+
}
|
58
|
+
//--------------------------------------------------------------------------
|
59
|
+
//
|
60
|
+
// Public Methods (async)
|
61
|
+
//
|
62
|
+
//--------------------------------------------------------------------------
|
63
|
+
//--------------------------------------------------------------------------
|
64
|
+
//
|
65
|
+
// Private Methods
|
66
|
+
//
|
67
|
+
//--------------------------------------------------------------------------
|
68
|
+
async _cancel() {
|
69
|
+
console.log("MODAL cancel " + this.solutionItemId); //???
|
70
|
+
this._cancelBtn.disabled = this._saveBtn.disabled = true;
|
71
|
+
this._canSave
|
72
|
+
? confirm("Save changes?")
|
73
|
+
? await this._saveChanges()
|
74
|
+
: await this._cancelChanges()
|
75
|
+
: await this._cancelChanges();
|
76
|
+
this._closeModal();
|
77
|
+
}
|
78
|
+
async _cancelChanges() {
|
79
|
+
console.log("MODAL cancelChanges"); //???
|
80
|
+
this._canSave = false;
|
81
|
+
await this._configuration.unloadSolution();
|
82
|
+
}
|
83
|
+
_closeModal() {
|
84
|
+
console.log("MODAL close"); //???
|
85
|
+
this.solutionItemId = "";
|
86
|
+
//this.solutionTitle = "";
|
87
|
+
this.cacheBreaker = "";
|
88
|
+
this.solutionConfigModalClosed.emit();
|
89
|
+
}
|
90
|
+
// Save changes and close the modal
|
91
|
+
async _save() {
|
92
|
+
console.log("MODAL save " + this.solutionItemId); //???
|
93
|
+
this._cancelBtn.disabled = this._saveBtn.disabled = true;
|
94
|
+
if (this._canSave) {
|
95
|
+
await this._saveChanges();
|
96
|
+
}
|
97
|
+
}
|
98
|
+
async _saveChanges() {
|
99
|
+
console.log("MODAL saveChanges"); //???
|
100
|
+
try {
|
101
|
+
this._canSave = false;
|
102
|
+
await this._configuration.saveSolution();
|
103
|
+
}
|
104
|
+
catch (error) {
|
105
|
+
//reportError("Unable to save", error.originalMessage);
|
106
|
+
console.log("Unable to save", error.originalMessage);
|
107
|
+
}
|
108
|
+
}
|
109
|
+
/**
|
110
|
+
* Fetches the component's translations
|
111
|
+
*
|
112
|
+
* @protected
|
113
|
+
*/
|
114
|
+
async _getTranslations() {
|
115
|
+
const translations = await getLocaleComponentStrings(this.el);
|
116
|
+
this._translations = translations[0];
|
117
|
+
}
|
118
|
+
get el() { return getElement(this); }
|
119
|
+
static get watchers() { return {
|
120
|
+
"solutionItemId": ["valueWatchHandler"]
|
121
|
+
}; }
|
122
|
+
};
|
123
|
+
SolutionConfigModal.style = solutionConfigModalCss;
|
124
|
+
|
125
|
+
export { SolutionConfigModal as solution_config_modal };
|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AAE,CAAC;KAC1C;IAAC,OAAO,KAAK,EAAE;;MAEd,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;KACtD;GACF;;;;;;EAOS,MAAM,gBAAgB;IAC9B,MAAM,YAAY,GAAG,MAAM,yBAAyB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9D,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC,CAAmC,CAAC;GACxE;;;;;;;;;;","names":[],"sources":["./src/components/solution-config-modal/solution-config-modal.scss?tag=solution-config-modal","./src/components/solution-config-modal/solution-config-modal.tsx"],"sourcesContent":["/** @license\r\n * Copyright 2022 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n.configuration-container {\r\n @apply w-full\r\n h-full\r\n relative;\r\n}\r\n\r\n.configuration {\r\n @apply absolute\r\n top-0\r\n right-0\r\n bottom-0\r\n left-0\r\n flex\r\n p-2\r\n border-lightgray;\r\n}\r\n\r\n.config-tabs {\r\n @apply w-full;\r\n}\r\n\r\n.config-tab {\r\n @apply w-full;\r\n}\r\n\r\n.config-solution {\r\n @apply\r\n absolute\r\n top-14\r\n -right-px\r\n -bottom-px\r\n -left-px\r\n flex\r\n p-2;\r\n}\r\n\r\n.config-inventory {\r\n @apply inline\r\n flex-grow-0\r\n overflow-y-auto\r\n max-w-min;\r\n}\r\n\r\n.config-inventory-hide {\r\n @apply flex-grow-0\r\n overflow-y-auto\r\n max-w-min\r\n hidden;\r\n}\r\n\r\n.config-item {\r\n @apply inline\r\n flex-grow\r\n overflow-y-auto\r\n relative\r\n m-inline-start-2;\r\n}\r\n\r\nsolution-contents {\r\n @apply relative\r\n h-full;\r\n}\r\n\r\nsolution-item {\r\n @apply relative\r\n h-full;\r\n}\r\n\r\nsolution-spatial-ref {\r\n @apply w-full\r\n h-full\r\n relative\r\n overflow-y-auto;\r\n}\r\n","/** @license\r\n * Copyright 2022 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\nimport { Component, Element, Event, EventEmitter, h, Host, Prop, State, VNode, Watch } from \"@stencil/core\";\r\nimport \"@esri/calcite-components\";\r\nimport SolutionConfigModal_T9n from \"../../assets/t9n/solution-config-modal/resources.json\";\r\nimport { getLocaleComponentStrings } from \"../../utils/locale\";\r\n\r\n@Component({\r\n tag: \"solution-config-modal\",\r\n styleUrl: \"solution-config-modal.scss\",\r\n shadow: false\r\n})\r\nexport class SolutionConfigModal {\r\n\r\n //--------------------------------------------------------------------------\r\n //\r\n // Host element access\r\n //\r\n //--------------------------------------------------------------------------\r\n\r\n @Element() el: HTMLSolutionConfigModalElement;\r\n\r\n //--------------------------------------------------------------------------\r\n //\r\n // Properties (public)\r\n //\r\n //--------------------------------------------------------------------------\r\n\r\n @Prop({ mutable: true }) cacheBreaker: string;\r\n\r\n /**\r\n * Credentials for requests in a serialized form\r\n */\r\n @Prop({ mutable: true }) serializedAuthentication = \"\";\r\n\r\n @Prop({ mutable: true }) solutionTitle = \"\";\r\n\r\n /**\r\n * Contains the current solution item id\r\n */\r\n @Prop({ mutable: true }) solutionItemId: string;\r\n\r\n @Watch(\"solutionItemId\") async valueWatchHandler(): Promise<void> {\r\n console.log(\"MODAL watch \" + this.solutionItemId);//???\r\n }\r\n\r\n //--------------------------------------------------------------------------\r\n //\r\n // Lifecycle\r\n //\r\n //--------------------------------------------------------------------------\r\n\r\n constructor() {\r\n //console.log(\"MODAL constructor \" + this.solutionItemId);//??? + \" open:\" + this._modalIsOpen);//???\r\n\r\n window.addEventListener(\"solutionCanSave\",\r\n (evt) => {\r\n this._canSave = (evt as any).detail as boolean;\r\n }\r\n );\r\n }\r\n\r\n /**\r\n * StencilJS: Called once just after the component is first connected to the DOM.\r\n *\r\n * @returns Promise when complete\r\n */\r\n async componentWillLoad(): Promise<void> {\r\n return this._getTranslations();\r\n }\r\n\r\n componentWillRender(): void {\r\n console.log(\"MODAL will render \" + this.solutionTitle + \" (\" + this.solutionItemId + \", \" + this.cacheBreaker + \")\");//???\r\n }\r\n\r\n /**\r\n * Renders the component.\r\n */\r\n render(): VNode {\r\n const cacheBreakerParts = this.cacheBreaker.split(\"_\");\r\n if (!this.solutionItemId && cacheBreakerParts.length === 2) {\r\n this.solutionItemId = cacheBreakerParts[0];\r\n }\r\n\r\n const modalIsOpen = !!this.solutionItemId;\r\n console.log(\"MODAL render \" + this.solutionTitle + \" (\" + this.solutionItemId + \", \" + this.cacheBreaker + \")\" + \" open:\" + modalIsOpen.toString());//???\r\n return (\r\n <Host>\r\n <calcite-modal\r\n aria-labelledby=\"solutions-modal-title\"\r\n fullscreen=\"\"\r\n intl-close={this._translations.cancel}\r\n onCalciteModalClose={() => this._cancel()}\r\n open={modalIsOpen}\r\n ref={(el) => this._modal = el}\r\n >\r\n <h3\r\n id=\"solutions-modal-title\"\r\n slot=\"header\"\r\n >\r\n {this._translations.title.replace(\"{{solutionName}}\", this.solutionTitle)}\r\n </h3>\r\n <div\r\n class=\"solutions-modal-content\"\r\n id=\"solutions-modal-content\"\r\n slot=\"content\"\r\n >\r\n <solution-configuration\r\n ref ={(el) => (this._configuration = el)}\r\n serialized-authentication={this.serializedAuthentication}\r\n solution-item-id={this.solutionItemId}\r\n />\r\n </div>\r\n <calcite-button\r\n appearance=\"outline\"\r\n disabled={!this._canSave}\r\n onClick={() => this._cancel()}\r\n ref={(el) => (this._cancelBtn = el)}\r\n slot=\"secondary\"\r\n width=\"full\"\r\n >\r\n {this._translations.cancel}\r\n </calcite-button>\r\n <calcite-button\r\n appearance=\"solid\"\r\n disabled={!this._canSave}\r\n onClick={() => this._save()}\r\n ref={(el) => (this._saveBtn = el)}\r\n slot=\"primary\"\r\n width=\"full\"\r\n >\r\n {this._translations.save}\r\n </calcite-button>\r\n </calcite-modal>\r\n </Host>\r\n );\r\n }\r\n\r\n //--------------------------------------------------------------------------\r\n //\r\n // Properties (protected)\r\n //\r\n //--------------------------------------------------------------------------\r\n\r\n protected _cancelBtn: HTMLCalciteButtonElement;\r\n\r\n /**\r\n * Controls enablement of Cancel and Save modal buttons\r\n */\r\n @State() protected _canSave = false;\r\n\r\n protected _configuration: HTMLSolutionConfigurationElement;\r\n\r\n protected _modal: HTMLCalciteModalElement;\r\n\r\n //@State() protected _modalIsOpen = false;\r\n\r\n protected _saveBtn: HTMLCalciteButtonElement;\r\n\r\n /**\r\n * Contains the _translations for this component.\r\n * All UI strings should be defined here.\r\n */\r\n @State() protected _translations: typeof SolutionConfigModal_T9n;\r\n\r\n //--------------------------------------------------------------------------\r\n //\r\n // Event Listeners\r\n //\r\n //--------------------------------------------------------------------------\r\n\r\n //--------------------------------------------------------------------------\r\n //\r\n // Events\r\n //\r\n //--------------------------------------------------------------------------\r\n\r\n @Event() solutionConfigModalClosed: EventEmitter<void>;\r\n\r\n //--------------------------------------------------------------------------\r\n //\r\n // Public Methods (async)\r\n //\r\n //--------------------------------------------------------------------------\r\n\r\n //--------------------------------------------------------------------------\r\n //\r\n // Private Methods\r\n //\r\n //--------------------------------------------------------------------------\r\n\r\n protected async _cancel(): Promise<void> {\r\n console.log(\"MODAL cancel \" + this.solutionItemId);//???\r\n this._cancelBtn.disabled = this._saveBtn.disabled = true;\r\n this._canSave\r\n ? confirm(\"Save changes?\")\r\n ? await this._saveChanges()\r\n : await this._cancelChanges()\r\n : await this._cancelChanges();\r\n this._closeModal();\r\n }\r\n\r\n protected async _cancelChanges(): Promise<void> {\r\n console.log(\"MODAL cancelChanges\");//???\r\n this._canSave = false;\r\n await this._configuration.unloadSolution();\r\n }\r\n\r\n protected _closeModal(): void {\r\n console.log(\"MODAL close\");//???\r\n this.solutionItemId = \"\";\r\n //this.solutionTitle = \"\";\r\n this.cacheBreaker = \"\";\r\n this.solutionConfigModalClosed.emit();\r\n }\r\n\r\n // Save changes and close the modal\r\n protected async _save(): Promise<void> {\r\n console.log(\"MODAL save \" + this.solutionItemId);//???\r\n this._cancelBtn.disabled = this._saveBtn.disabled = true;\r\n if (this._canSave) {\r\n await this._saveChanges();\r\n }\r\n }\r\n\r\n protected async _saveChanges(): Promise<void> {\r\n console.log(\"MODAL saveChanges\");//???\r\n try {\r\n this._canSave = false;\r\n await this._configuration.saveSolution();\r\n } catch (error) {\r\n //reportError(\"Unable to save\", error.originalMessage);\r\n console.log(\"Unable to save\", error.originalMessage);\r\n }\r\n }\r\n\r\n /**\r\n * Fetches the component's translations\r\n *\r\n * @protected\r\n */\r\n protected async _getTranslations(): Promise<void> {\r\n const translations = await getLocaleComponentStrings(this.el);\r\n this._translations = translations[0] as typeof SolutionConfigModal_T9n;\r\n }\r\n}\r\n"],"version":3}
|
@@ -5,9 +5,9 @@
|
|
5
5
|
*/
|
6
6
|
import { r as registerInstance, h, H as Host, g as getElement } from './p-58c69df2.js';
|
7
7
|
import { g as getLocaleComponentStrings } from './p-20bdf42f.js';
|
8
|
-
import { g as getMapLayerNames } from './p-
|
8
|
+
import { g as getMapLayerNames } from './p-c20bd963.js';
|
9
9
|
import './p-3b010ce1.js';
|
10
|
-
import './p-
|
10
|
+
import './p-f04fdb9a.js';
|
11
11
|
|
12
12
|
const configLayerPickerCss = ":host{display:block}.label-spacing{--calcite-label-margin-bottom:0}.padding-block-end-1{-webkit-padding-after:1rem;padding-block-end:1rem}.padding-inline-start-1{-webkit-padding-start:1rem;padding-inline-start:1rem}";
|
13
13
|
|
@@ -104,4 +104,4 @@ ConfigLayerPicker.style = configLayerPickerCss;
|
|
104
104
|
|
105
105
|
export { ConfigLayerPicker as config_layer_picker };
|
106
106
|
|
107
|
-
//# sourceMappingURL=p-
|
107
|
+
//# sourceMappingURL=p-c818e661.entry.js.map
|
File without changes
|