@arcgis/core 5.0.0-next.11 → 5.0.0-next.13
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/PopupTemplate.js +1 -1
- package/analysis/AreaMeasurementAnalysis.js +1 -1
- package/applications/KnowledgeStudio/generalSdkInternalAccess.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/arcade/geometry/nearestVertex.js +5 -0
- package/arcade/geometry/operators.js +1 -1
- package/arcade/geometry/operatorsWorker.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{af47272aaaef0ea57e71.js → 00ea3052170e831c6bc8.js} +1 -1
- package/assets/esri/core/workers/chunks/{91dfd29e2dba200eab09.js → 0105d814fb51c366d1da.js} +1 -1
- package/assets/esri/core/workers/chunks/{125e71b0e29d1d132777.js → 02a22dd6d208a925cc5a.js} +1 -1
- package/assets/esri/core/workers/chunks/02e7359162cf974b41b6.js +1 -0
- package/assets/esri/core/workers/chunks/{ead8d0cbcebd12dbfad7.js → 04211fba145d9f06b3ec.js} +1 -1
- package/assets/esri/core/workers/chunks/0441ea7c89266a68b6f0.js +1 -0
- package/assets/esri/core/workers/chunks/07f2a75431dd8fc502ef.js +1 -0
- package/assets/esri/core/workers/chunks/{d1e97cce5047f1791e22.js → 0ac13de43438f572f59c.js} +1 -1
- package/assets/esri/core/workers/chunks/{629127877042ad784ad2.js → 0c8aeb6262e9ec7c87d0.js} +1 -1
- package/assets/esri/core/workers/chunks/{d07f911d40bf05fc0306.js → 1008e3d64f5880e3dbf2.js} +1 -1
- package/assets/esri/core/workers/chunks/{c29486c4eeb3e72effff.js → 110429583b28c28c36ee.js} +1 -1
- package/assets/esri/core/workers/chunks/{61d970ed75c2c358b1e9.js → 14d601e0fe7a0538c7c1.js} +1 -1
- package/assets/esri/core/workers/chunks/18474c017ddacd1d3d2c.js +1 -0
- package/assets/esri/core/workers/chunks/{1257c37bf04d39c27b62.js → 1c3bee704bafb64bba70.js} +1 -1
- package/assets/esri/core/workers/chunks/1d07846bcaac47df0644.js +1 -0
- package/assets/esri/core/workers/chunks/{509392131ec473d6b988.js → 1dfca37f95f2b968aa54.js} +1 -1
- package/assets/esri/core/workers/chunks/2132ccc45da90f6208b2.js +1 -0
- package/assets/esri/core/workers/chunks/2166238a7ad63a2d43c7.js +1 -0
- package/assets/esri/core/workers/chunks/2214d3b1f11658a85d0f.js +1 -0
- package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +1 -0
- package/assets/esri/core/workers/chunks/22ca80f491e070b2a5e7.js +1 -0
- package/assets/esri/core/workers/chunks/{f80f5dbf96c343ac4df6.js → 24d8922ac9cd48621357.js} +1 -1
- package/assets/esri/core/workers/chunks/257f17b3836a623a9dbe.js +1 -0
- package/assets/esri/core/workers/chunks/2b27499fa9de22970b7a.js +1 -0
- package/assets/esri/core/workers/chunks/2e76fbd3c874300fc4a7.js +1 -0
- package/assets/esri/core/workers/chunks/31b5900119dd7cd9e7d3.js +1 -0
- package/assets/esri/core/workers/chunks/34bb4852ebef0f529c96.js +1 -0
- package/assets/esri/core/workers/chunks/{9698f36c143953a975d4.js → 353d447f3745942c88a8.js} +1 -1
- package/assets/esri/core/workers/chunks/{52282f767bd0e99ddca0.js → 3545dce74bb6b0354cb7.js} +1 -1
- package/assets/esri/core/workers/chunks/36b1f47d70b57d79df7b.js +1 -0
- package/assets/esri/core/workers/chunks/38810e3f298e8a0b64a6.js +1 -0
- package/assets/esri/core/workers/chunks/{7290e7a819eb291b1df2.js → 38fa50336983265c73a4.js} +3 -3
- package/assets/esri/core/workers/chunks/{fe49321dca22dc60d105.js → 3b1982bf7b44ff897a35.js} +1 -1
- package/assets/esri/core/workers/chunks/3bacd904cd93c8013f6a.js +1 -0
- package/assets/esri/core/workers/chunks/{588533c3abe876f20f62.js → 3d5b157bd9060b07670b.js} +1 -1
- package/assets/esri/core/workers/chunks/{06e60fc7715d08ede59d.js → 3edffdb0e282ed562ac7.js} +1 -1
- package/assets/esri/core/workers/chunks/3fa15d4ee5fab8fff76e.js +1 -0
- package/assets/esri/core/workers/chunks/487e1c592f1b6fd03a7d.js +1 -0
- package/assets/esri/core/workers/chunks/{ee5aa11750c51b220f1e.js → 4bcb83119481453dbb90.js} +1 -1
- package/assets/esri/core/workers/chunks/4ca5d58117e7a5f73e1e.js +1 -0
- package/assets/esri/core/workers/chunks/{826fa0dfb63df77bfd95.js → 4f0016111fd84c612f41.js} +1 -1
- package/assets/esri/core/workers/chunks/{24cd7b84cd0f3de4bff2.js → 4f14fed0ec885c3c33d5.js} +1 -1
- package/assets/esri/core/workers/chunks/{4baf6f6e7ddedb25f806.js → 5299ec59c86022ca37e2.js} +1 -1
- package/assets/esri/core/workers/chunks/53a9c34cb3f6ac06cd50.js +1 -0
- package/assets/esri/core/workers/chunks/5415fbcc7ed203fc5575.js +1 -0
- package/assets/esri/core/workers/chunks/54c49a768147720c3c56.js +1 -0
- package/assets/esri/core/workers/chunks/558822b700e8bd844052.js +1 -0
- package/assets/esri/core/workers/chunks/{da24ad57747714ac5eda.js → 55adbd7481f8dfb1067e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7803495f8862d9025bcd.js → 56e06c9c1120bea2c641.js} +1 -1
- package/assets/esri/core/workers/chunks/{dc66490520f97eef15bf.js → 57806a01f33074b601e7.js} +24 -24
- package/assets/esri/core/workers/chunks/{67f03d042455cd0f7009.js → 57b410198d83bf0ab708.js} +1 -1
- package/assets/esri/core/workers/chunks/{0a5d74414dd02a2fb8e1.js → 5bc4140333d0db904949.js} +1 -1
- package/assets/esri/core/workers/chunks/5e08b19e6d7202ea38d7.js +1 -0
- package/assets/esri/core/workers/chunks/{0d5212f59e9b62c16164.js → 5f6df4a3376b52ead53f.js} +1 -1
- package/assets/esri/core/workers/chunks/{15c7c10ff9ac63f0e792.js → 5fb2edf942b1cd8d7336.js} +1 -1
- package/assets/esri/core/workers/chunks/600e2e6b51e2fb9c598c.js +1 -0
- package/assets/esri/core/workers/chunks/{dc51438b832551924a9e.js → 6238ca7541800eb2566b.js} +1 -1
- package/assets/esri/core/workers/chunks/{731f7b552dde0fb325cd.js → 62c2bd082a0c669bc857.js} +1 -1
- package/assets/esri/core/workers/chunks/{b8a3f1e60e24a13749c1.js → 631fb2e62e48f8be4051.js} +1 -1
- package/assets/esri/core/workers/chunks/{c8e686efe344a33a0258.js → 6490bc392a4b4f9e24f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{e767f83f9e2de6650f80.js → 6581b94e796781c0ad4a.js} +1 -1
- package/assets/esri/core/workers/chunks/{53654edd766d9b4ef750.js → 658cd45b5fb304fd840a.js} +1 -1
- package/assets/esri/core/workers/chunks/67f305b0c72e77a6331a.js +1 -0
- package/assets/esri/core/workers/chunks/6922351c001fdb4cb757.js +1 -0
- package/assets/esri/core/workers/chunks/{6e22b02a9715c10578d0.js → 69cca5d3f715876c6b32.js} +1 -1
- package/assets/esri/core/workers/chunks/6c13c01c47abc1939f96.js +1 -0
- package/assets/esri/core/workers/chunks/{c37f7756d48ff9af2656.js → 736035c0069ccb03bee6.js} +1 -1
- package/assets/esri/core/workers/chunks/7c14f99e6cfff2a8ef4a.js +1 -0
- package/assets/esri/core/workers/chunks/812f2ccc01f44e3cfd41.js +1 -0
- package/assets/esri/core/workers/chunks/82338cdd56aa1de28db3.js +1 -0
- package/assets/esri/core/workers/chunks/{51ab2acac4ecc1ca9c34.js → 86830fcb5475502dac65.js} +1 -1
- package/assets/esri/core/workers/chunks/{11e96a312f1294d34c50.js → 881df4fd1dc594576457.js} +1 -1
- package/assets/esri/core/workers/chunks/{d1ca7c3a32ce00ed8b81.js → 8be16b03caa947ac7631.js} +1 -1
- package/assets/esri/core/workers/chunks/8d9ccc9a43a315cb6b04.js +1 -0
- package/assets/esri/core/workers/chunks/{042cd64e1f4eb326c30f.js → 8fc82fe1fcbcedf35400.js} +1 -1
- package/assets/esri/core/workers/chunks/91afee11072471e4eefe.js +1 -0
- package/assets/esri/core/workers/chunks/{fbd8d2f61f8a15bcf3db.js → 9595aabbaf411eceea1e.js} +1 -1
- package/assets/esri/core/workers/chunks/{6cf391b5ed7351601a2a.js → 9978ec6c67e87dc08a1d.js} +1 -1
- package/assets/esri/core/workers/chunks/9cdd087c43a601ec331d.js +1 -0
- package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
- package/assets/esri/core/workers/chunks/{5e2ce34def5e053913b2.js → a10e533f336c035d8d40.js} +1 -1
- package/assets/esri/core/workers/chunks/{311b564e44ae637c960d.js → a3ade7e8b9ddadb5f800.js} +1 -1
- package/assets/esri/core/workers/chunks/{18c5d79d5ee1136e0a57.js → a57751f3d78524c876cd.js} +1 -1
- package/assets/esri/core/workers/chunks/{0030d68d9edf42b4af57.js → a6a87f92f453204e9bdb.js} +1 -1
- package/assets/esri/core/workers/chunks/a6ee40dfc471d6612f3c.js +1 -0
- package/assets/esri/core/workers/chunks/a8ea050090c351e3b6d6.js +1 -0
- package/assets/esri/core/workers/chunks/adf7ccf4ef629211c7ee.js +1 -0
- package/assets/esri/core/workers/chunks/ae6066ea6cb373dc6db3.js +1 -0
- package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +1 -0
- package/assets/esri/core/workers/chunks/b328635d191f5424c047.js +1 -0
- package/assets/esri/core/workers/chunks/b59f9c3f7a149214256f.js +1 -0
- package/assets/esri/core/workers/chunks/{664ae441617afe4b17ec.js → b87bc987983b31c13f64.js} +1 -1
- package/assets/esri/core/workers/chunks/bb56717c4e36f28d4c08.js +1 -0
- package/assets/esri/core/workers/chunks/bbdfa8ffcf084cbd9938.js +1 -0
- package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +1 -0
- package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +1 -0
- package/assets/esri/core/workers/chunks/{ddfd01bb9ba8577c3ffc.js → c3dcfe26c2c3c829762d.js} +1 -1
- package/assets/esri/core/workers/chunks/c3ddcf9148dd2640c402.js +1 -0
- package/assets/esri/core/workers/chunks/{6d9f2b113d6bde936a04.js → c4dfd897bcab20dee43b.js} +1 -1
- package/assets/esri/core/workers/chunks/{0f30a9514571c7be9978.js → c5c02ace54fe4ab9214b.js} +1 -1
- package/assets/esri/core/workers/chunks/{87921f3fa9001f5801ed.js → c68935ed44eb0702a6ba.js} +1 -1
- package/assets/esri/core/workers/chunks/{b6853c6a25eaabc9a7f6.js → c9579d607e59bae214da.js} +1 -1
- package/assets/esri/core/workers/chunks/d39a10155317e6f7a21c.js +1 -0
- package/assets/esri/core/workers/chunks/{773f2c6c9d38db76dfed.js → d42f7e48d694b2427c0d.js} +1 -1
- package/assets/esri/core/workers/chunks/d466f3f0d3824c77da7c.js +1 -0
- package/assets/esri/core/workers/chunks/d4a91f2256e48316a8f0.js +1 -0
- package/assets/esri/core/workers/chunks/d69265ceabfa92b40bb7.js +1 -0
- package/assets/esri/core/workers/chunks/d7755c4c8d1d3059efca.js +1 -0
- package/assets/esri/core/workers/chunks/{eb9c166db0db6fa60e95.js → d7b0fcce847f563ea255.js} +1 -1
- package/assets/esri/core/workers/chunks/d87f0116ee53ec5f98e9.js +1 -0
- package/assets/esri/core/workers/chunks/d888ae5ac1810a486919.js +1 -0
- package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +1 -0
- package/assets/esri/core/workers/chunks/dc4d29cfce12ac599888.js +1 -0
- package/assets/esri/core/workers/chunks/dda6ca9af35518652d0f.js +1 -0
- package/assets/esri/core/workers/chunks/{7005d956c990a04ee8b2.js → dec336700cfb83abbbeb.js} +1 -1
- package/assets/esri/core/workers/chunks/{b3613a38178cad2ebc82.js → dee9867b3379e024ae96.js} +1 -1
- package/assets/esri/core/workers/chunks/df130abb76713a85b4f9.js +1 -0
- package/assets/esri/core/workers/chunks/e0aa036c56ecdfe01503.js +1 -0
- package/assets/esri/core/workers/chunks/e2e4f6b58763fae51ae5.js +1 -0
- package/assets/esri/core/workers/chunks/e8a9c56fd0e7fd2558ef.js +1 -0
- package/assets/esri/core/workers/chunks/{1d06fcae4c2f02fb1c95.js → eb7eb3b3b8800fd73f3e.js} +1 -1
- package/assets/esri/core/workers/chunks/{37c1f155da14de91565a.js → edf58513f789856cd1db.js} +1 -1
- package/assets/esri/core/workers/chunks/{f34e3fa0c5b28531e289.js → ef789e8487deab916fad.js} +1 -1
- package/assets/esri/core/workers/chunks/f28ffda9a95c6568503d.js +1 -0
- package/assets/esri/core/workers/chunks/f98689562017583f73ee.js +1 -0
- package/assets/esri/core/workers/chunks/{292daac70bb828e4923f.js → f9cd068d184cab66dc33.js} +1 -1
- package/assets/esri/core/workers/chunks/{dff2df259f140b7d97a9.js → fd88e07cba5964f80e9e.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9b16fd41cd59d452522.js → fdbe16e3b23e01655c0c.js} +1 -1
- package/assets/esri/core/workers/chunks/{063905fbf9a0c6586949.js → ffdba51e7256ebf8ebd3.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Editor.scss +35 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/chunks/containsOperator.js +1 -1
- package/chunks/densifyOperator.js +1 -1
- package/chunks/differenceOperator.js +1 -1
- package/chunks/intersectsOperator.js +1 -1
- package/chunks/persistableUrlUtils.js +1 -1
- package/config.js +1 -1
- package/core/XHRAdapter.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/quantityFormatUtils.js +1 -1
- package/core/unitFormatUtils.js +1 -1
- package/core/unitUtils.js +1 -1
- package/editing/fieldUtils.js +5 -0
- package/geometry/Extent.js +1 -1
- package/geometry/Geometry.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/Point.js +1 -1
- package/geometry/SpatialReference.js +1 -1
- package/geometry/ellipsoidUtils.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/MeshTransform.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/meshUtils/scale.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/geometry/support/polygonUtils.js +1 -1
- package/interfaces.d.ts +90 -7
- package/kernel.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/MapNotesLayer.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
- package/layers/save/groupLayerUtils.js +1 -1
- package/layers/save/imageryUtils.js +1 -1
- package/layers/save/streamLayerUtils.js +1 -1
- package/layers/support/DateTimeFieldFormat.js +1 -1
- package/layers/support/FieldFormat.js +1 -1
- package/layers/support/LayerLoadContext.js +1 -1
- package/layers/support/NumberFieldFormat.js +1 -1
- package/layers/support/arcgisLayerUrl.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/fetchService.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/layers/video/VideoCameraSensorModel.js +1 -1
- package/networks/support/UNTraceConfiguration.js +1 -1
- package/package.json +1 -1
- package/popup/ExpressionInfo.js +1 -1
- package/popup/FieldInfo.js +1 -1
- package/popup/content/AttachmentsContent.js +1 -1
- package/popup/content/BarChartMediaInfo.js +1 -1
- package/popup/content/ColumnChartMediaInfo.js +1 -1
- package/popup/content/Content.js +1 -1
- package/popup/content/CustomContent.js +1 -1
- package/popup/content/ExpressionContent.js +1 -1
- package/popup/content/FieldsContent.js +1 -1
- package/popup/content/ImageMediaInfo.js +1 -1
- package/popup/content/LineChartMediaInfo.js +1 -1
- package/popup/content/MediaContent.js +1 -1
- package/popup/content/PieChartMediaInfo.js +1 -1
- package/popup/content/RelationshipContent.js +1 -1
- package/popup/content/TextContent.js +1 -1
- package/popup/content/UtilityNetworkAssociationsContent.js +1 -1
- package/popup/content/mixins/ChartMediaInfo.js +1 -1
- package/popup/content/mixins/MediaInfo.js +1 -1
- package/popup/content.js +1 -1
- package/popup/support/FieldInfoFormat.js +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/request/cors.js +5 -0
- package/request/loadImage.js +5 -0
- package/request/preferredHosts.js +5 -0
- package/request/process.js +5 -0
- package/request/queue.js +5 -0
- package/request/serviceJSON.js +5 -0
- package/request.js +1 -1
- package/rest/geometryService/utils.js +1 -1
- package/rest/knowledgeGraphService.d.ts +1 -0
- package/support/getDefaultUnitForView.js +1 -1
- package/support/popupUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/time/TimeExtent.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementAreaVisualization.js +5 -0
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +5 -0
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementLabelVisualization.js +5 -0
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementManipulatorVisualization.js +5 -0
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementSketchVisualization.js +5 -0
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +5 -0
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +5 -0
- package/views/2d/analysis/analysisViewModuleImportUtils.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
- package/views/3d/environment/CloudsRenderer.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/layers/ElevationLayerView3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SDataRequester.js +1 -1
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/support/StreamTextureCollection.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
- package/views/View2D.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
- package/views/analysis/ElevationProfile/constants.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileErrors.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/magnifier/resources.js +1 -1
- package/webdoc/support/webdocSaveUtils.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor/components/FeatureList.js +1 -1
- package/widgets/Editor/components/MergeFeaturesList.js +5 -0
- package/widgets/Editor/components/Notices.js +1 -1
- package/widgets/Editor/components/PanelContent.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/css.js +1 -1
- package/widgets/Editor/support/EditorItem.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/support/errors.js +1 -1
- package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
- package/widgets/Editor/support/splitFeatureUtils.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend/support/utils.js +1 -1
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/assets/esri/core/workers/chunks/0200637e0503556a3b97.js +0 -1
- package/assets/esri/core/workers/chunks/022c854eff2c2c2aed6b.js +0 -1
- package/assets/esri/core/workers/chunks/06f75c5b6b50934d72a6.js +0 -1
- package/assets/esri/core/workers/chunks/15f969836d63c7fe2d9d.js +0 -1
- package/assets/esri/core/workers/chunks/2857bcb68df874e9aa62.js +0 -1
- package/assets/esri/core/workers/chunks/2a9fc0301268ff909246.js +0 -1
- package/assets/esri/core/workers/chunks/2ddcf3cea0efe4052618.js +0 -1
- package/assets/esri/core/workers/chunks/2e8a4df83c43f86d7361.js +0 -1
- package/assets/esri/core/workers/chunks/2f2e4f81f3daa3fb8527.js +0 -1
- package/assets/esri/core/workers/chunks/3109f0a6914e7be088ed.js +0 -1
- package/assets/esri/core/workers/chunks/31bb1ee9370c2753ce9d.js +0 -1
- package/assets/esri/core/workers/chunks/329fccd7f5cb8401e0c3.js +0 -1
- package/assets/esri/core/workers/chunks/38f6b9288c82dac9a800.js +0 -1
- package/assets/esri/core/workers/chunks/3b1848713ee25f750242.js +0 -1
- package/assets/esri/core/workers/chunks/4291681d067ebdf86e73.js +0 -1
- package/assets/esri/core/workers/chunks/42a1e71d09e8583a7327.js +0 -1
- package/assets/esri/core/workers/chunks/44f27eac92c5ccc57e12.js +0 -1
- package/assets/esri/core/workers/chunks/4941bfd3aae7f6bdac97.js +0 -1
- package/assets/esri/core/workers/chunks/4bd2cc65f7db0d261543.js +0 -1
- package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +0 -1
- package/assets/esri/core/workers/chunks/4fbe2a8d742065cbaea3.js +0 -1
- package/assets/esri/core/workers/chunks/4fe4feeb251f2916a339.js +0 -1
- package/assets/esri/core/workers/chunks/55eb6a0f1e4569a65f2a.js +0 -1
- package/assets/esri/core/workers/chunks/591e459f9fce34f519ca.js +0 -1
- package/assets/esri/core/workers/chunks/59514624daf188a8030f.js +0 -1
- package/assets/esri/core/workers/chunks/5c09d98b41f71a036e2a.js +0 -1
- package/assets/esri/core/workers/chunks/605b9643b1baeff16149.js +0 -1
- package/assets/esri/core/workers/chunks/6293e33f304c4952f88c.js +0 -1
- package/assets/esri/core/workers/chunks/655beaf83e9845a02334.js +0 -1
- package/assets/esri/core/workers/chunks/6e25ef5ad6d6b3f88343.js +0 -1
- package/assets/esri/core/workers/chunks/759321045c264bc6964e.js +0 -1
- package/assets/esri/core/workers/chunks/7e3f27ebf366d4266350.js +0 -1
- package/assets/esri/core/workers/chunks/826072cfc0ac8e36f03c.js +0 -1
- package/assets/esri/core/workers/chunks/9b0c2f4311fe9bca370a.js +0 -1
- package/assets/esri/core/workers/chunks/9c48d8d17831aa57f8a4.js +0 -1
- package/assets/esri/core/workers/chunks/9f28b2800945903bc165.js +0 -1
- package/assets/esri/core/workers/chunks/a27e74117c37f3efcbca.js +0 -1
- package/assets/esri/core/workers/chunks/a41ba05c09a59d1eb35f.js +0 -1
- package/assets/esri/core/workers/chunks/a93ebd076bc55aa6eab0.js +0 -1
- package/assets/esri/core/workers/chunks/aaed35a6414859233678.js +0 -1
- package/assets/esri/core/workers/chunks/acd0564ad1544f452f3f.js +0 -1
- package/assets/esri/core/workers/chunks/b0f43191a431c9de16e5.js +0 -1
- package/assets/esri/core/workers/chunks/b320bb76c7e9998fe53b.js +0 -1
- package/assets/esri/core/workers/chunks/ba4571d2637a74a59552.js +0 -1
- package/assets/esri/core/workers/chunks/c4090a60d149a5962179.js +0 -1
- package/assets/esri/core/workers/chunks/c61c61dac1e8d6188749.js +0 -1
- package/assets/esri/core/workers/chunks/c84caf81bfaa4a8b5aa1.js +0 -1
- package/assets/esri/core/workers/chunks/c8c8cf43fd640d2f5cb1.js +0 -1
- package/assets/esri/core/workers/chunks/d28670cb11164e318e45.js +0 -1
- package/assets/esri/core/workers/chunks/d56ac52a5288e06365e7.js +0 -1
- package/assets/esri/core/workers/chunks/ddca92e18e96ea1c9d89.js +0 -1
- package/assets/esri/core/workers/chunks/ded9747ae04ab889d52a.js +0 -1
- package/assets/esri/core/workers/chunks/df5afa06c6deb6b40109.js +0 -1
- package/assets/esri/core/workers/chunks/df8279e1baf378faf85f.js +0 -1
- package/assets/esri/core/workers/chunks/e3434f91f47f551d9e02.js +0 -1
- package/assets/esri/core/workers/chunks/eb6c3dd440ede4adf603.js +0 -1
- package/assets/esri/core/workers/chunks/edc671b9b83c8e19cb42.js +0 -1
- package/assets/esri/core/workers/chunks/f141c9f7f0d9b2322bf6.js +0 -1
- package/assets/esri/core/workers/chunks/f57401a759f420596b2c.js +0 -1
- package/assets/esri/core/workers/chunks/f7a1f48c53422c6e2028.js +0 -1
- package/assets/esri/core/workers/chunks/f7f002ea5ff5fe7f6249.js +0 -1
- package/assets/esri/core/workers/chunks/f8e889be4b45f6f0667e.js +0 -1
- package/assets/esri/core/workers/chunks/fbd796c88f07bb6755dc.js +0 -1
- package/assets/esri/core/workers/chunks/fec3897ed7e8691387ed.js +0 -1
- package/processRequest.js +0 -5
- package/requestQueue.js +0 -5
- package/support/requestPresets.js +0 -5
- package/support/requestUtils.js +0 -5
- /package/{rest/support → request}/ImageWithType.js +0 -0
- /package/{requestConfig.js → request/config.js} +0 -0
- /package/{support/requestImageUtils.js → request/image.js} +0 -0
package/widgets/Editor.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../intl.js";import{deprecatedFunction as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{destroyMaybe as s,abortMaybe as o,mappedFind as r}from"../core/maybe.js";import{createResolver as a}from"../core/promiseUtils.js";import{watch as n,on as l,when as c,initial as d}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../core/support/UpdatingHandles.js";import u from"../views/interactive/sketch/SketchValueOptions.js";import g from"./Attachments.js";import _ from"./BatchAttributeForm.js";import w from"./FeatureForm.js";import v from"./FeatureTemplates.js";import f from"./Spinner.js";import y from"./Widget.js";import{VisibleElements as b}from"./BatchAttributeForm/VisibleElements.js";import{css as k}from"./Editor/css.js";import F from"./Editor/EditorViewModel.js";import{isModelUpload as A}from"./Editor/modelUploadUtils.js";import M from"./Editor/VisibleElements.js";import{isFeatureFormViewModel as S,isUpdateWorkflow as T,isUpdateRecordWorkflow as C,isBatchAttributeFormViewModel as L}from"./Editor/workflowUtils.js";import{loadCreateFeaturesPanelContentComponents as E,CreateFeaturesPanelContent as W}from"./Editor/components/CreateFeaturesPanelContent.js";import{loadFeatureListComponents as P,FeatureList as I}from"./Editor/components/FeatureList.js";import{loadFooterActionsComponents as j,FooterActions as U}from"./Editor/components/FooterActions.js";import{loadNoticesComponents as V,Notice as D}from"./Editor/components/Notices.js";import{loadPanelContentComponents as x,PanelContent as B,PanelContentSection as O,PanelContentMessage as N}from"./Editor/components/PanelContent.js";import{PanelToolbar as H,loadPanelToolbarComponents as R}from"./Editor/components/PanelToolbar.js";import{loadPromptComponents as G,Prompt as z}from"./Editor/components/Prompt.js";import{loadUpdateFeaturePanelContentComponents as q,UpdateFeaturePanelContent as K}from"./Editor/components/UpdateFeaturePanelContent.js";import{loadUploadDetailsComponents as Z,UploadDetails as $}from"./Editor/components/UploadDetails.js";import{CreateToolVisibilityMap as J}from"./Sketch/CreateToolVisibilityMap.js";import{SelectionToolVisibilityMap as Q}from"./Sketch/SelectionToolVisibilityMap.js";import{VisibleElements as X}from"./Sketch/VisibleElements.js";import{loadCalciteComponents as Y}from"./support/componentsUtils.js";import{globalCss as ee}from"./support/globalCss.js";import{incrementHeadingLevel as te,Heading as ie}from"./support/Heading.js";import{renderItem as se}from"./support/ItemList.js";import{connectDelayedLoading as oe}from"./support/loaderUtils.js";import re from"./support/SelectionList.js";import ae from"./support/SelectionToolbar.js";import"./support/widgetUtils.js";import{messageBundle as ne}from"./support/decorators/messageBundle.js";import{vmEvent as le}from"./support/decorators/vmEvent.js";import{tsx as ce}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import de from"./support/SelectionList/VisibleElements.js";import he from"./support/SelectionToolbar/VisibleElements.js";import{substitute as me}from"../intl/substitute.js";const pe=Symbol("sketch-setup-handles");let ue=class extends y{constructor(e,t){super(e,t),this._batchAttributeForm=new _({visibleElements:new b({loadingIndicator:!1})}),this._featureForm=new w,this._sketchToolbar=null,this._attachments=new g({visibleElements:{addSubmitButton:!1,cancelAddButton:!1,cancelUpdateButton:!1,deleteButton:!1,errorMessage:!1,progressBar:!1,updateButton:!1}}),this._associationItemList=null,this._associationSettings=null,this._featureTemplates=new v({enableListScroll:!1,renderItemContentEnd:e=>e.supportsUpload?ce("calcite-icon",{class:k.templateItemContentEnd,icon:"upload-to",key:"upload-icon"}):null,renderItemLabel:e=>e.label,renderCustomGroupContent:e=>this._renderCustomTemplateGroupContent(e)}),this._filterText="",this._prompt=null,this._spinner=new f,this._loading=!1,this._selectionList=new re({displayMode:"layer",itemActionConfigs:this._selectionListItemActionConfigs,onListItemSelect:({item:e})=>this._onSelectionListItemSelect(e),visibleElements:new de({header:!1})}),this._selectionToolbar=new ae({visibleElements:new he({chip:!1})}),this._updatingHandles=new p,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesTemplates=null,this.messagesFeature=null,this.supportingWidgetDefaults=null,this.viewModel=new F,this.visibleElements=new M,this._renderAttachments=()=>this._attachments.render(),this._renderFeatureForm=()=>this._featureForm.render(),this._renderBatchAttributeForm=()=>this._batchAttributeForm.render(),this._renderFeatureTemplates=()=>this._featureTemplates.render(),this._renderSelectionList=()=>this._selectionList.render(),this._renderSelectionToolbar=()=>this._selectionToolbar.render(),this._renderSketch=()=>this._sketchToolbar?ce("div",{class:k.sketchContainer,key:"editor-sketch-container"},this._sketchToolbar?.render()):void 0,this._renderSelectIcon=()=>ce("calcite-icon",{icon:"cursor",slot:"content-start"}),this.EditorPanel=({heading:e,key:t,selected:i},...s)=>{const{visibleElements:o}=this;return ce("calcite-flow-item",{closable:!1,heading:e,headingLevel:this.headingLevel,key:t,loading:this._loading,selected:i,onCalciteFlowItemBack:this._onBack},o.settingsMenu?ce(H,{editorViewModel:this.viewModel,messagesCommon:this.messagesCommon,visibleElements:o}):null,...s)},this._showDiscardEditsPrompt=()=>{const{messages:e,activeWorkflow:t}=this,i={title:e.cancelEditTitle,message:e.cancelEditWarningMessage,yesLabel:e.discardEdits,noLabel:e.continueEditing};return"create-features"===t?.type&&A(t.data.creationInfo)?this._showPromptAndWait("success"===t.data.upload?.state?e.modelUploads.cancelPlacementPrompt:e.modelUploads.cancelUploadPrompt):"update"===t?.type&&S(t.activeFormViewModel)&&t.activeFormViewModel.activeAssociation?this._showPromptAndWait({...i,message:e.cancelAssociationEditWarning}):this._showPromptAndWait(i)},this._showGenericCancelPrompt=()=>{const{messages:e,messagesCommon:t}=this;return this._showPromptAndWait({title:e.cancelRequestTitle,message:e.cancelRequestWarningMessage,yesLabel:t.form.yes,noLabel:t.form.no})},this._showPrompt=e=>{this._prompt?.cancel?.(),this._prompt=e},this._clearPrompt=()=>{this._prompt=null},this._onSave=()=>{this.viewModel.saveWorkflow()},this._onSplit=()=>{const{activeWorkflow:e}=this.viewModel;if(T(e)){const t=e.activeWorkflow;if(C(t)){const i=t.data.edits.feature;i&&e.startSplittingFeature(i)}}},this._onDelete=()=>{const e=this.viewModel.activeFeatureCount,t=e>1?this.messages.multiFeature:this.messages.singleFeature;this._showPrompt({title:t.deleteWarningTitle,message:t.deleteWarningMessage,context:"danger",actions:{primary:{label:me(t.delete,{count:e}),action:()=>{this.deleteFeatures(),this._clearPrompt()}},secondary:{label:t.keep,action:this._clearPrompt}}})},this._onDeleteAssociation=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAssociationTitle,message:e.deleteAssociationMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.deleteAssociationFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepAssociation,action:this._clearPrompt}}})},this._onToggleUpdateWorkflow=()=>this.viewModel.toggleUpdateWorkflow(),this._onBack=e=>(e?.stopPropagation(),this.viewModel.back()),this._onAttachmentAdd=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type||"update"===e.type&&"create-features"===e.activeWorkflow?.type?(this._attachments.addFile(),e.back()):this._attachments.addAttachment().then(()=>e.back()))},this._onAttachmentUpdate=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type?(this._attachments.updateFile(),e.back()):this._attachments.updateAttachment().then(()=>e.back()))},this._onAttachmentDelete=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAttachmentWarningTitle,message:e.deleteAttachmentWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:this._onAttachmentDeleteConfirm},secondary:{label:e.keepAttachment,action:this._clearPrompt}}})},this._onAttachmentDeleteConfirm=async()=>{const e=this._attachments,{activeWorkflow:t}=this.viewModel;t&&("create-features"===t.type?e.deleteFile():(await e.deleteAttachment(e.viewModel.activeAttachmentInfo),this._clearPrompt()),await t.back(),this._clearPrompt())},this._onAttachmentsError=e=>{this._showPrompt({title:this.messages.errorWarningTitle,message:e.message,context:"warning",actions:{primary:{label:this.messagesCommon.form.ok,action:this._clearPrompt}}})}}initialize(){this._featureForm.showPrompt=this._showPrompt,this._featureForm.clearPrompt=this._clearPrompt,this.addHandles([n(()=>te(this.headingLevel),e=>{this._featureForm.headingLevel=e,this._featureTemplates.headingLevel=e},d),l(()=>this.viewModel.activeWorkflow,"cancel-request",({controller:e})=>{(this.viewModel.hasPendingEdits?this._showDiscardEditsPrompt():this._showGenericCancelPrompt()).then(t=>t?e.allow():e.deny())}),c(()=>this.viewModel.formViewModel,e=>{L(e)?this._batchAttributeForm.viewModel=e:this._featureForm.viewModel=e},d),c(()=>this.viewModel.utilityNetworkAssociationAddAssociationViewModel,e=>{this._associationItemList?this._associationItemList.viewModel=e:this._updatingHandles.addPromise(this._initializeAssociationItemList(e))},d),c(()=>this.viewModel.utilityNetworkAssociationAddAssociationViewModel?.association,()=>{this._setUpAssociationSettings()}),n(()=>[this.viewModel,this.viewModel?.attachmentsViewModel,this.viewModel?.featureTemplatesViewModel,this.viewModel?.spinnerViewModel,this.viewModel?.selectionListViewModel,this.viewModel?.selectionToolbarViewModel],([e,t,i,s,o,r])=>{this._attachments.viewModel=t,this._featureTemplates.viewModel=i,this._spinner.viewModel=s,this._selectionList.viewModel=o,this._selectionToolbar.viewModel=r,e.showDiscardEditsPrompt=this._showDiscardEditsPrompt},d),n(()=>this.view,(e,t)=>{const i=`editor-${this.id}-spinner`;t?.ui.remove(this._spinner,i),e?.ui.add(this._spinner,{key:i,position:"manual"}),this._associationItemList&&(this._associationItemList.view=e)},d),n(()=>[this.supportingWidgetDefaults,this.viewModel.sketchViewModel],([e])=>{e&&(this._featureForm.set(e.featureForm),this._attachments.set(e.attachments),this._featureTemplates.set(e.featureTemplates),this.viewModel.sketchViewModel?.set(e.sketch))},d),c(()=>this._attachments?.error,e=>this._onAttachmentsError(e)),c(()=>this._selectionListItemActionConfigs,()=>{this._selectionList.itemActionConfigs=this._selectionListItemActionConfigs}),c(()=>this.viewModel?.failures,e=>{const{messages:t}=this,[{error:i,retry:s,cancel:o}]=e;this._showPrompt({title:t.errorWarningTitle,message:me(t.errorWarningMessageTemplate,{errorMessage:i.message}),context:"warning",actions:{primary:{label:t.retry,action:()=>{s(),this._clearPrompt()}},secondary:{label:t.ignore,action:()=>{o(),this._clearPrompt()}}}})}),n(()=>this.viewModel?.state,e=>{switch(e){case"awaiting-feature-to-update":case"ready":case"disabled":this._filterText="",this._featureTemplates.filterText=""}}),n(()=>this.viewModel.featureFormDisabled,e=>this._featureForm.disabled=e),n(()=>this.visibleElements.sketch,()=>this._setupSketch(),d),oe({getLoading:()=>{const{viewModel:e}=this;return e.syncing||e.updating||this._attachments.submitting||this._updatingHandles.updating},setEffectiveLoading:e=>{this._loading=e}})])}destroy(){this._associationItemList?.destroy(),this._associationSettings?.destroy(),this._selectionList.destroy(),this._selectionToolbar.destroy(),this._attachments.destroy(),this._batchAttributeForm.destroy(),this._featureForm.destroy(),this._featureTemplates.destroy(),this._spinner.destroy(),this._sketchToolbar=s(this._sketchToolbar),this._sketchImportAbortController=o(this._sketchImportAbortController)}loadDependencies(){return Promise.all([Y({flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list")}),E(),P(),j(),V(),x(),R(),G(),q(),Z()])}get _hasInvalidBatchSelection(){return this._hasSelectionFromMultipleLayers||this._selectionCountExceedsMaximum||0===this._selectionList.visibleFeatureCount}get _hasSelectionFromMultipleLayers(){return this._selectionList.visibleLayerCount>1}get _deleteButtonCommonInfo(){return{appearance:"outline",kind:"danger"}}get _selectionCountExceedsMaximum(){const e=this._batchAttributeForm.maximumFeatureCount,{activeLayerItem:t,effectiveCount:i,filterText:s,visibleFeatureCount:o}=this._selectionList;return null!=s&&""!==s?o>e:t?t.total>e:i>e}get _selectionListItemActionConfigs(){const{messages:e}=this;return[{label:e?.batchEditing?.editThisFeature,icon:"edit-attributes",type:"feature",callback:({item:e})=>this._onSelectionListMenuItemSelect(e)},{label:e?.batchEditing?.editTheseFeatures,icon:"edit-attributes",type:"layer",callback:({item:e})=>this._onSelectionListMenuItemSelect(e)}]}get _visibleSelectionCount(){const{activeLayerItem:e,effectiveCount:t,filterText:i,visibleFeatureCount:s}=this._selectionList;return null!=i&&""!==i?s:e?e.total:t}get activeWorkflow(){return this.viewModel.activeWorkflow}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get hideTemplatesForInactiveLayers(){return this.viewModel.hideTemplatesForInactiveLayers}set hideTemplatesForInactiveLayers(e){this.viewModel.hideTemplatesForInactiveLayers=e}get icon(){return"pencil"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.viewModel.startCreateFeaturesWorkflowAtFeatureTypeSelection()}startCreateFeaturesWorkflowAtFeatureCreation(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureCreation(e)}startCreateFeaturesWorkflowAtFeatureEdit(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureEdit(e)}async startSplitFeatureWorkflow(e,t={}){await this.viewModel.startSplitFeatureWorkflow(e,t)}startUpdateFeaturesWorkflow(e){return this.viewModel.startUpdateFeaturesWorkflow(e)}startUpdateWorkflowAtFeatureSelection(){return this.viewModel.startUpdateWorkflowAtFeatureSelection()}startUpdateWorkflowAtMultipleFeatureSelection(e){return this.viewModel.startUpdateWorkflowAtMultipleFeatureSelection(e)}startUpdateWorkflowAtFeatureEdit(e){return this.viewModel.startUpdateWorkflowAtFeatureEdit(e)}async startUpdateWorkflowWithActiveSelection(){await this.viewModel.startUpdateWorkflowWithActiveSelection()}deleteFeatureFromWorkflow(){return t(i.getLogger(this),"Editor.deleteFeatureFromWorkflow is deprecated. Use Editor.deleteFeatures instead.",{version:"4.33",replacement:"Editor.deleteFeatures",warnOnce:!0}),this.deleteFeatures()}async deleteFeatures(){await this.viewModel.deleteFeatures()}deleteAssociationFromWorkflow(){return this.viewModel.deleteAssociationFromWorkflow()}cancelWorkflow(e){return this.viewModel.cancelWorkflow(e)}render(){const{visibleElements:e,viewModel:t}=this,i=this.classes(k.base,ee.widget,ee.panel);if(!t)return ce("div",{class:i,key:"empty"});const{pageStack:s}=t,o=s.length-1,r=s.map((e,t)=>this._renderPage(e,t===o));return ce("div",{class:i,key:"base"},e.flow?ce("calcite-flow",{inert:!!this._prompt,key:"flow"},r):r,this._prompt?ce(z,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderPage(e,t){const i={selected:t};switch(e){case"disabled":break;case"ready":return this._renderReady(i);case"viewing-selection-list":return this._renderSelectionListPage(i);case"awaiting-feature-creation-info":return this._renderAwaitingFeatureCreationInfo(i);case"creating-features-upload-details":return this._renderUploadDetails(i);case"creating-features":return this._renderCreatingFeatures(i);case"editing-existing-feature":case"editing-features":case"editing-attributes":return this._renderUpdateFeature(i);case"awaiting-update-feature-candidate":return this._renderFeatureList(i);case"adding-attachment":return this._renderAttachmentAdding(i);case"editing-attachment":return this._renderAttachmentEditing(i);case"viewing-associated-layers":case"viewing-associated-features":return this._renderViewAssociatedLayers(i);case"add-association-select-layer":case"add-association-select-feature":return this._renderSelectFeature(i);case"add-association-create-association":return this._renderAddAssociation(i);case"drawing-splitter-geometry":return this._renderDrawingSplitGeometry(i);case"reviewing-features":return this._renderReviewingSplitFeatures(i)}return ce("div",{key:"empty-page"})}_renderAwaitingFeatureCreationInfo(e){const{EditorPanel:t,messages:i}=this;return ce(t,{heading:i.selectTemplate,key:"templates-panel",...e},ce(B,{key:"feature-templates"},ce(O,null,this._renderFeatureTemplates())))}_renderUploadDetails(e){const{EditorPanel:t,activeWorkflow:i,messages:s}=this;if("create-features"!==i?.type)return null;const o=i.data.upload;return o?ce(t,{heading:s.createFeatures,key:"upload-details-panel",...e},ce($,{helpMessage:this._helpMessage,messages:s,upload:o})):null}_renderCreatingFeatures(e){const{EditorPanel:t,activeWorkflow:i,messages:s,messagesCommon:o,headingLevel:r,viewModel:a}=this;if(!i)return null;const n="create-features"===i.type&&i.numPendingFeatures>0||"update"===i.type&&"create-features"===i?.activeWorkflow?.type&&i.activeWorkflow?.numPendingFeatures>0;return ce(t,{heading:s.createFeatures,key:"create-features-panel",...e},n?ce(K,{editorViewModel:a,headingLevel:r,messages:s,messagesCommon:o,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave,onSplit:this._onSplit}):ce(W,{helpMessage:this._helpMessage,renderSketchToolbar:this._renderSketch}))}_renderUpdateFeature(e){const{EditorPanel:t,messages:i,messagesCommon:s,headingLevel:o,viewModel:r}=this,a=r.activeFeatureCount>1?i.multiFeature.editPanelTitle:i.singleFeature.editPanelTitle;return ce(t,{heading:a,key:"update-feature-panel",...e},ce(K,{editorViewModel:r,headingLevel:o,messages:i,messagesCommon:s,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave,onSplit:this._onSplit}))}_renderDrawingSplitGeometry(e){const{EditorPanel:t}=this;return ce(t,{heading:this.messages.splitFeature,key:"draw-split-geometry-panel",...e},ce(W,{helpMessage:this._helpMessage,renderSketchToolbar:this._renderSketch}))}_renderReviewingSplitFeatures(e){const{EditorPanel:t,messages:i,messagesCommon:s,headingLevel:o,viewModel:r}=this;return ce(t,{heading:i.splitFeature,key:"review-split-features-panel",...e},ce(K,{editorViewModel:r,headingLevel:o,messages:i,messagesCommon:s,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,visibleElements:this.visibleElements,onDelete:()=>{},onDeleteAssociation:()=>{},onSave:this._onSave,onSplit:this._onSplit}))}_getAssociationTypeTitle(e){const{messages:t}=this;if(!e)return t.singleFeature.editPanelTitle;if(e.title)return e.title;const{messagesFeature:i}=this;switch(e.type){case"attachment":return i.associationsAttachments;case"connectivity":return i.associationsConnectivity;case"structure":return i.associationsStructure;case"content":return i.associationsContents;case"container":return i.associationsContainer}}_getAddAssociationTypeTitle(e){const{messages:t}=this;if(!e)return t.singleFeature.editPanelTitle;const i=t.associations;switch(e.type){case"attachment":return i.addAttachment;case"connectivity":return i.addConnectivity;case"structure":return i.addStructure;case"content":return i.addContent;case"container":return i.addContainer}}async _initializeAssociationItemList(e){const t=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js")).default;this._associationItemList=new t({view:this.view,viewModel:e})}async _initializeAssociationSettings(){const e=new(0,(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js")).default);return this._associationSettings=e,e}_renderViewAssociatedLayers(e){const{EditorPanel:t,messages:i,messagesCommon:s,headingLevel:o,viewModel:r}=this,a=r.featureFormViewModel?.activeAssociationInput?.activeAssociationType,n=this._getAssociationTypeTitle(a);return ce(t,{heading:n,key:"viewing-associated-layers-panel",...e},ce(K,{editorViewModel:r,headingLevel:o,messages:i,messagesCommon:s,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave,onSplit:this._onSplit}))}_renderSelectFeature(e){const{_associationItemList:t,EditorPanel:i,viewModel:s,messagesCommon:o}=this,r=s.utilityNetworkAssociationAddAssociationViewModel,a=this._getAddAssociationTypeTitle(r?.associationType),n="ready"!==r?.state||this.viewModel.featureFormDisabled;return t?ce(i,{heading:a,key:"add-association-select-feature",...e},ce(B,{key:"select-feature"},ce(O,null,t.render())),ce(U,{buttons:[t.filterOptionsVisible?{appearance:"solid",label:o.apply,disabled:n,onClick:()=>t.applyFilterOptions(),type:"button"}:void 0,{appearance:"outline",label:o.cancel,disabled:n,onClick:()=>{"update"===s.activeWorkflow?.type&&(r?.reset(),s.activeWorkflow.cancelActiveWorkflow())},type:"button"}]})):ce(i,{heading:a,key:"add-association-select-feature",...e})}async _setUpAssociationSettings(){const{viewModel:e}=this,t=this._associationSettings??await this._updatingHandles.addPromise(this._initializeAssociationSettings()),i=e.utilityNetworkAssociationAddAssociationViewModel,s="update"===e.activeWorkflow?.type?e.activeWorkflow:null,o=s?s.activeWorkflow:null,r="add-association"===o?.type?o.sourceFeatureItem:null,a=i?.selectedFeature,n=i?.association,l=i?.utilityNetwork;r&&a&&n&&l&&(t.sourceFeature=r,t.targetFeature=a,t.association=n,t.utilityNetwork=l)}_renderAddAssociation(e){const{_associationSettings:t,EditorPanel:i,viewModel:s,messagesCommon:o}=this;if(!t)return null;const r=s.utilityNetworkAssociationAddAssociationViewModel,a=this._getAddAssociationTypeTitle(r?.associationType),n="ready"!==r?.state;return ce(i,{heading:a,key:"add-association",...e},ce(B,{key:"add-association-content"},ce(O,null,t.render())),ce(U,{buttons:[{label:o.add,disabled:n||!r.canAddAssociation,onClick:()=>this._onSave(),type:"button"},{appearance:"outline",label:o.cancel,disabled:n,onClick:()=>{"update"===s.activeWorkflow?.type&&s.activeWorkflow.cancelActiveWorkflow()},type:"button"}]}))}_renderCustomTemplateGroupContent(e){const{messages:t,viewModel:i}=this,s=r(e.group.items,e=>i.itemHasInvalidFormTemplate(e)?t.formFieldCreateError:void 0);return s?ce(D,{kind:"warning",message:s}):null}_renderAttachmentAdding(e){const{EditorPanel:t,_attachments:i,messages:s,messagesCommon:o}=this;return ce(t,{heading:s.addAttachment,key:"attachment-adding-panel",...e},ce(B,{key:"attachments"},this._renderAttachments()),ce(U,{buttons:[{label:i.submitting?o.cancel:o.add,disabled:i.submitting||!i.selectedFile,onClick:this._onAttachmentAdd,type:"button"}]}))}_renderSelectionListPage(e){const{_hasSelectionFromMultipleLayers:t,_hasInvalidBatchSelection:i,_selectionCountExceedsMaximum:s,_selectionList:o,_visibleSelectionCount:r,messages:a,EditorPanel:n}=this,{batchUpdateActions:l}=this.visibleElements,{maxVisibleFeatureCountPerLayer:c}=o;return ce(n,{heading:a.widgetLabel,key:"selection-list-panel",...e},this.visibleElements.selectionToolbar&&"3d"!==this.view?.type?ce("div",{class:k.selectionToolbarContainer},this._renderSelectionToolbar()):void 0,ce(B,{key:"selection-list"},ce(O,null,this._renderSelectionList())),ce(U,{buttons:[l?{label:me(a.batchEditing.editCount,{count:r}),disabled:i,onClick:()=>this.startUpdateWorkflowWithActiveSelection(),type:"button"}:void 0],notice:l&&t?{text:a.batchEditing.selectOneLayer,icon:"information"}:l&&s?{text:me(this.messages.multiFeature.formFailedToLoadTooManyFeatures,{num:c}),icon:"information"}:void 0}))}_renderAttachmentEditing(e){const{EditorPanel:t,_attachments:i,activeWorkflow:s,messages:o,messagesCommon:r}=this;return s?ce(t,{heading:o.editAttachment,key:"attachment-editing-panel",...e},ce(B,{key:"attachments"},this._renderAttachments()),s.shouldAllowAttachmentEditing?ce(U,{buttons:[{label:r.update,disabled:i.submitting||!i.selectedFile,onClick:this._onAttachmentUpdate,type:"button"},{...this._deleteButtonCommonInfo,onClick:this._onAttachmentDelete,disabled:i.submitting,label:r.delete,type:"button"}]}):void 0):null}_renderReady(e){const{EditorPanel:t,messages:i,viewModel:s,visibleElements:o}=this,r=this._helpMessage;return ce(t,{heading:i.widgetLabel,key:"landing-panel",...e},ce(B,{key:"landing-content"},s.editorItems.length?[o.editFeaturesSection?ce(O,{key:"edit-actions"},this._renderUpdateActions()):null,o.createFeaturesSection&&s.canCreateVisible?ce(O,{key:"create-actions"},this._renderCreateActions()):null]:ce(N,{key:"no-content"},i.noEditableLayers)),r?ce("div",{class:k.helpMessage,key:"footer-actions",slot:"footer"},r):void 0)}get _helpMessage(){const{activeWorkflow:e,messages:t,view:i}=this,s=e?.helpMessage;return s?t["3d"===i?.type?"helpMessages3d":"helpMessages2d"]?.[s]:void 0}_renderUpdateActions(){const{messages:e,messagesCommon:t,viewModel:i}=this,s={id:"select",label:t.select};return ce("div",{class:k.updateActions,key:"update-actions"},ce(ie,{level:te(this.headingLevel)},e.editFeatures),this.visibleElements.selectionToolbar&&"3d"!==this.view?.type?ce("div",{class:k.selectionToolbarContainer},this._renderSelectionToolbar()):ce("calcite-list",{class:k.updateActionsList,label:e.editFeaturesList,selectionAppearance:"border",selectionMode:"single"},se({disabled:!i.canUpdateVisible,grouped:!1,item:s,selectedItem:"awaiting-feature-to-update"===i.activeWorkflow?.stepId?s:void 0,renderIcon:this._renderSelectIcon,onItemSelect:this._onToggleUpdateWorkflow})))}_renderCreateActions(){return ce("div",{key:"create-actions"},ce(ie,{level:te(this.headingLevel)},this.messages.createFeatures),ce("div",{class:k.featureTemplatesContainer,key:"templates"},this._renderFeatureTemplates()))}_renderFeatureList(e){const{EditorPanel:t,viewModel:i}=this,{activeWorkflow:s}=i;if("update"!==s?.type)return null;const o=s.data.candidates,r=me(this.messages.multipleFeaturesTemplate,{total:o.length});return ce(t,{heading:r,key:"feature-list",...e},ce(I,{editorItems:i.editorItems,editorMessages:this.messages,filterText:this._filterText,id:this.id,messagesTemplates:this.messagesTemplates,workflow:s,onFilterTextChange:e=>this._filterText=e,onSelectFeature:(e,t)=>i.selectFeature(e,t),onZoomTo:e=>i.zoomTo(e)}))}_showPromptAndWait({title:e,message:t,yesLabel:i,noLabel:s}){const o=a(),{view:r}=this,n=r?.focused;return this._showPrompt({title:e,message:t,context:"danger",actions:{primary:{label:i,action:()=>o.resolve(!0)},secondary:{label:s,action:()=>o.resolve(!1)}}}),o.promise.finally(()=>{this._clearPrompt(),n&&r?.focus()})}async _onSelectionListItemSelect(e){await this.viewModel.onSelectionListItemSelect(e)}async _onSelectionListMenuItemSelect(e){await this.viewModel.onSelectionListMenuItemSelect(e)}async _setupSketch(){if(!!!this.visibleElements.sketch)return this._sketchImportAbortController=o(this._sketchImportAbortController),this._sketchToolbar=s(this._sketchToolbar),void this.removeHandles(pe);if(this._sketchImportAbortController)return;const e=new AbortController;this._sketchImportAbortController=e;const t=await import("./Sketch.js");if(!e.signal.aborted)try{this._sketchToolbar=new t.default({toolbarKind:"docked",contextualToolLocation:"inline-end",scale:"s",visibleElements:new X({deleteButton:!1,settingsMenu:!1,directionModePicker:!1,selectionCountLabel:!1,duplicateButton:!1,createTools:new J({freehandPolygon:!0,freehandPolyline:!0}),selectionTools:new Q({"lasso-selection":!1,"rectangle-selection":!1})})}),this.addHandles([n(()=>{const e=this.viewModel.activeLeafWorkflow;return e&&"availableCreateTools"in e?e.availableCreateTools:null},e=>{this._sketchToolbar&&(this._sketchToolbar.availableCreateTools=e)},d),n(()=>this.visibleElements.undoRedoButtons,e=>{this._sketchToolbar&&(this._sketchToolbar.visibleElements.undoRedoMenu=e)},d),c(()=>this.viewModel?.sketchViewModel,e=>{this._sketchToolbar&&(this._sketchToolbar.viewModel=e)},d)],pe)}finally{this._sketchImportAbortController=null}}get test(){return{sketch:this._sketchToolbar,showPrompt:this._showPromptAndWait.bind(this)}}};e([h()],ue.prototype,"_batchAttributeForm",void 0),e([h()],ue.prototype,"_featureForm",void 0),e([h()],ue.prototype,"_sketchToolbar",void 0),e([h()],ue.prototype,"_attachments",void 0),e([h()],ue.prototype,"_associationItemList",void 0),e([h()],ue.prototype,"_associationSettings",void 0),e([h()],ue.prototype,"_featureTemplates",void 0),e([h()],ue.prototype,"_filterText",void 0),e([h()],ue.prototype,"_hasInvalidBatchSelection",null),e([h()],ue.prototype,"_hasSelectionFromMultipleLayers",null),e([h()],ue.prototype,"_prompt",void 0),e([h()],ue.prototype,"_spinner",void 0),e([h()],ue.prototype,"_deleteButtonCommonInfo",null),e([h()],ue.prototype,"_loading",void 0),e([h()],ue.prototype,"_selectionCountExceedsMaximum",null),e([h()],ue.prototype,"_selectionList",void 0),e([h()],ue.prototype,"_selectionListItemActionConfigs",null),e([h()],ue.prototype,"_selectionToolbar",void 0),e([h()],ue.prototype,"_visibleSelectionCount",null),e([h({readOnly:!0})],ue.prototype,"activeWorkflow",null),e([h()],ue.prototype,"effectiveSelectionManager",null),e([h()],ue.prototype,"headingLevel",void 0),e([h()],ue.prototype,"hideTemplatesForInactiveLayers",null),e([h()],ue.prototype,"icon",null),e([h()],ue.prototype,"label",null),e([h()],ue.prototype,"labelOptions",null),e([h()],ue.prototype,"layerInfos",null),e([h(),ne("esri/widgets/Editor/t9n/Editor")],ue.prototype,"messages",void 0),e([h(),ne("esri/t9n/common")],ue.prototype,"messagesCommon",void 0),e([h(),ne("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],ue.prototype,"messagesTemplates",void 0),e([h(),ne("esri/widgets/Feature/t9n/Feature")],ue.prototype,"messagesFeature",void 0),e([h()],ue.prototype,"snappingOptions",null),e([h()],ue.prototype,"tooltipOptions",null),e([h()],ue.prototype,"supportingWidgetDefaults",void 0),e([h({type:u,nonNullable:!0})],ue.prototype,"valueOptions",null),e([h()],ue.prototype,"view",null),e([h(),le(["sketch-create","sketch-delete","sketch-update","workflow-cancel","workflow-commit"])],ue.prototype,"viewModel",void 0),e([h({type:M,nonNullable:!0})],ue.prototype,"visibleElements",void 0),e([h()],ue.prototype,"_helpMessage",null),ue=e([m("esri.widgets.Editor")],ue);const ge=ue;export{ge as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import"../intl.js";import{deprecatedFunction as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{destroyMaybe as s,abortMaybe as o,mappedFind as r}from"../core/maybe.js";import{createResolver as a}from"../core/promiseUtils.js";import{watch as n,on as l,when as c,initial as d}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../core/support/UpdatingHandles.js";import u from"../views/interactive/sketch/SketchValueOptions.js";import g from"./Attachments.js";import w from"./BatchAttributeForm.js";import _ from"./FeatureForm.js";import v from"./FeatureTemplates.js";import f from"./Spinner.js";import y from"./Widget.js";import{VisibleElements as b}from"./BatchAttributeForm/VisibleElements.js";import{css as k}from"./Editor/css.js";import F from"./Editor/EditorViewModel.js";import{isModelUpload as A}from"./Editor/modelUploadUtils.js";import M from"./Editor/VisibleElements.js";import{isFeatureFormViewModel as T,isUpdateWorkflow as S,isUpdateFeaturesWorkflow as C,isUpdateRecordWorkflow as L,isBatchAttributeFormViewModel as E}from"./Editor/workflowUtils.js";import{loadCreateFeaturesPanelContentComponents as W,CreateFeaturesPanelContent as P}from"./Editor/components/CreateFeaturesPanelContent.js";import{loadFeatureListComponents as I,FeatureList as j}from"./Editor/components/FeatureList.js";import{loadFooterActionsComponents as U,FooterActions as V}from"./Editor/components/FooterActions.js";import{loadNoticesComponents as x,Notice as D}from"./Editor/components/Notices.js";import{loadPanelContentComponents as B,PanelContent as O,PanelContentSection as N,PanelContentMessage as H}from"./Editor/components/PanelContent.js";import{PanelToolbar as G,loadPanelToolbarComponents as R}from"./Editor/components/PanelToolbar.js";import{loadPromptComponents as z,Prompt as q}from"./Editor/components/Prompt.js";import{loadUpdateFeaturePanelContentComponents as K,UpdateFeaturePanelContent as Z}from"./Editor/components/UpdateFeaturePanelContent.js";import{loadUploadDetailsComponents as $,UploadDetails as J}from"./Editor/components/UploadDetails.js";import{CreateToolVisibilityMap as Q}from"./Sketch/CreateToolVisibilityMap.js";import{SelectionToolVisibilityMap as X}from"./Sketch/SelectionToolVisibilityMap.js";import{VisibleElements as Y}from"./Sketch/VisibleElements.js";import{loadCalciteComponents as ee}from"./support/componentsUtils.js";import{globalCss as te}from"./support/globalCss.js";import{incrementHeadingLevel as ie,Heading as se}from"./support/Heading.js";import{renderItem as oe}from"./support/ItemList.js";import{connectDelayedLoading as re}from"./support/loaderUtils.js";import ae from"./support/SelectionList.js";import ne from"./support/SelectionToolbar.js";import"./support/widgetUtils.js";import{messageBundle as le}from"./support/decorators/messageBundle.js";import{vmEvent as ce}from"./support/decorators/vmEvent.js";import{tsx as de}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import he from"./support/SelectionList/VisibleElements.js";import me from"./support/SelectionToolbar/VisibleElements.js";import{substitute as pe}from"../intl/substitute.js";const ue=Symbol("sketch-setup-handles");let ge=class extends y{constructor(e,t){super(e,t),this._batchAttributeForm=new w({visibleElements:new b({loadingIndicator:!1})}),this._featureForm=new _,this._sketchToolbar=null,this._attachments=new g({visibleElements:{addSubmitButton:!1,cancelAddButton:!1,cancelUpdateButton:!1,deleteButton:!1,errorMessage:!1,progressBar:!1,updateButton:!1}}),this._associationItemList=null,this._associationSettings=null,this._featureTemplates=new v({enableListScroll:!1,renderItemContentEnd:e=>e.supportsUpload?de("calcite-icon",{class:k.templateItemContentEnd,icon:"upload-to",key:"upload-icon"}):null,renderItemLabel:e=>e.label,renderCustomGroupContent:e=>this._renderCustomTemplateGroupContent(e)}),this._filterText="",this._prompt=null,this._spinner=new f,this._loading=!1,this._selectionList=new ae({displayMode:"layer",itemActionConfigs:this._selectionListItemActionConfigs,onListItemSelect:({item:e})=>this._onSelectionListItemSelect(e),visibleElements:new he({header:!1})}),this._selectionToolbar=new ne({visibleElements:new me({chip:!1})}),this._updatingHandles=new p,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesTemplates=null,this.messagesFeature=null,this.supportingWidgetDefaults=null,this.viewModel=new F,this.visibleElements=new M,this._renderAttachments=()=>this._attachments.render(),this._renderFeatureForm=()=>this._featureForm.render(),this._renderBatchAttributeForm=()=>this._batchAttributeForm.render(),this._renderFeatureTemplates=()=>this._featureTemplates.render(),this._renderSelectionList=()=>this._selectionList.render(),this._renderSelectionToolbar=()=>this._selectionToolbar.render(),this._renderSketch=()=>this._sketchToolbar?de("div",{class:k.sketchContainer,key:"editor-sketch-container"},this._sketchToolbar?.render()):void 0,this._renderSelectIcon=()=>de("calcite-icon",{icon:"cursor",slot:"content-start"}),this.EditorPanel=({heading:e,key:t,selected:i},...s)=>{const{visibleElements:o}=this;return de("calcite-flow-item",{closable:!1,heading:e,headingLevel:this.headingLevel,key:t,loading:this._loading,selected:i,onCalciteFlowItemBack:this._onBack},o.settingsMenu?de(G,{editorViewModel:this.viewModel,messagesCommon:this.messagesCommon,visibleElements:o}):null,...s)},this._showDiscardEditsPrompt=()=>{const{messages:e,activeWorkflow:t}=this,i={title:e.cancelEditTitle,message:e.cancelEditWarningMessage,yesLabel:e.discardEdits,noLabel:e.continueEditing};return"create-features"===t?.type&&A(t.data.creationInfo)?this._showPromptAndWait("success"===t.data.upload?.state?e.modelUploads.cancelPlacementPrompt:e.modelUploads.cancelUploadPrompt):"update"===t?.type&&T(t.formViewModel)&&t.formViewModel.activeAssociation?this._showPromptAndWait({...i,message:e.cancelAssociationEditWarning}):this._showPromptAndWait(i)},this._showGenericCancelPrompt=()=>{const{messages:e,messagesCommon:t}=this;return this._showPromptAndWait({title:e.cancelRequestTitle,message:e.cancelRequestWarningMessage,yesLabel:t.form.yes,noLabel:t.form.no})},this._showPrompt=e=>{this._prompt?.cancel?.(),this._prompt=e},this._clearPrompt=()=>{this._prompt=null},this._onSave=()=>{this.viewModel.saveWorkflow()},this._onMerge=()=>{const{activeWorkflow:e}=this.viewModel;if(S(e)){const t=e.activeWorkflow;C(t)&&e.startMergingFeatures(t.viewGraphics)}},this._onSplit=()=>{const{activeWorkflow:e}=this.viewModel;if(S(e)){const t=e.activeWorkflow;if(L(t)){const i=t.data.edits.feature;i&&e.startSplittingFeature(i)}}},this._onDelete=()=>{const e=this.viewModel.activeFeatureCount,t=e>1?this.messages.multiFeature:this.messages.singleFeature;this._showPrompt({title:t.deleteWarningTitle,message:t.deleteWarningMessage,context:"danger",actions:{primary:{label:pe(t.delete,{count:e}),action:()=>{this.deleteFeatures(),this._clearPrompt()}},secondary:{label:t.keep,action:this._clearPrompt}}})},this._onDeleteAssociation=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAssociationTitle,message:e.deleteAssociationMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.deleteAssociationFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepAssociation,action:this._clearPrompt}}})},this._onToggleUpdateWorkflow=()=>this.viewModel.toggleUpdateWorkflow(),this._onBack=e=>(e?.stopPropagation(),this.viewModel.back()),this._onAttachmentAdd=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type||"update"===e.type&&"create-features"===e.activeWorkflow?.type?(this._attachments.addFile(),e.back()):this._attachments.addAttachment().then(()=>e.back()))},this._onAttachmentUpdate=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type?(this._attachments.updateFile(),e.back()):this._attachments.updateAttachment().then(()=>e.back()))},this._onAttachmentDelete=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAttachmentWarningTitle,message:e.deleteAttachmentWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:this._onAttachmentDeleteConfirm},secondary:{label:e.keepAttachment,action:this._clearPrompt}}})},this._onAttachmentDeleteConfirm=async()=>{const e=this._attachments,{activeWorkflow:t}=this.viewModel;t&&("create-features"===t.type?e.deleteFile():(await e.deleteAttachment(e.viewModel.activeAttachmentInfo),this._clearPrompt()),await t.back(),this._clearPrompt())},this._onAttachmentsError=e=>{this._showPrompt({title:this.messages.errorWarningTitle,message:e.message,context:"warning",actions:{primary:{label:this.messagesCommon.form.ok,action:this._clearPrompt}}})}}initialize(){this._featureForm.showPrompt=this._showPrompt,this._featureForm.clearPrompt=this._clearPrompt,this.addHandles([n(()=>ie(this.headingLevel),e=>{this._featureForm.headingLevel=e,this._featureTemplates.headingLevel=e},d),l(()=>this.viewModel.activeWorkflow,"cancel-request",({controller:e})=>{(this.viewModel.hasPendingEdits?this._showDiscardEditsPrompt():this._showGenericCancelPrompt()).then(t=>t?e.allow():e.deny())}),c(()=>this.viewModel.formViewModel,e=>{E(e)?this._batchAttributeForm.viewModel=e:this._featureForm.viewModel=e},d),c(()=>this.viewModel.utilityNetworkAssociationAddAssociationViewModel,e=>{this._associationItemList?this._associationItemList.viewModel=e:this._updatingHandles.addPromise(this._initializeAssociationItemList(e))},d),c(()=>this.viewModel.utilityNetworkAssociationAddAssociationViewModel?.association,()=>{this._setUpAssociationSettings()}),n(()=>[this.viewModel,this.viewModel?.attachmentsViewModel,this.viewModel?.featureTemplatesViewModel,this.viewModel?.spinnerViewModel,this.viewModel?.selectionListViewModel,this.viewModel?.selectionToolbarViewModel],([e,t,i,s,o,r])=>{this._attachments.viewModel=t,this._featureTemplates.viewModel=i,this._spinner.viewModel=s,this._selectionList.viewModel=o,this._selectionToolbar.viewModel=r,e.showDiscardEditsPrompt=this._showDiscardEditsPrompt},d),n(()=>this.view,(e,t)=>{const i=`editor-${this.id}-spinner`;t?.ui.remove(this._spinner,i),e?.ui.add(this._spinner,{key:i,position:"manual"}),this._associationItemList&&(this._associationItemList.view=e)},d),n(()=>[this.supportingWidgetDefaults,this.viewModel.sketchViewModel],([e])=>{e&&(this._featureForm.set(e.featureForm),this._attachments.set(e.attachments),this._featureTemplates.set(e.featureTemplates),this.viewModel.sketchViewModel?.set(e.sketch))},d),c(()=>this._attachments?.error,e=>this._onAttachmentsError(e)),c(()=>this._selectionListItemActionConfigs,()=>{this._selectionList.itemActionConfigs=this._selectionListItemActionConfigs}),c(()=>this.viewModel?.failures,e=>{const{messages:t}=this,[{error:i,retry:s,cancel:o}]=e;this._showPrompt({title:t.errorWarningTitle,message:pe(t.errorWarningMessageTemplate,{errorMessage:i.message}),context:"warning",actions:{primary:{label:t.retry,action:()=>{s(),this._clearPrompt()}},secondary:{label:t.ignore,action:()=>{o(),this._clearPrompt()}}}})}),n(()=>this.viewModel?.state,e=>{switch(e){case"awaiting-feature-to-update":case"ready":case"disabled":this._filterText="",this._featureTemplates.filterText=""}}),n(()=>this.viewModel.featureFormDisabled,e=>this._featureForm.disabled=e),n(()=>this.visibleElements.sketch,()=>this._setupSketch(),d),re({getLoading:()=>{const{viewModel:e}=this;return e.syncing||e.updating||this._attachments.submitting||this._updatingHandles.updating},setEffectiveLoading:e=>{this._loading=e}})])}destroy(){this._associationItemList?.destroy(),this._associationSettings?.destroy(),this._selectionList.destroy(),this._selectionToolbar.destroy(),this._attachments.destroy(),this._batchAttributeForm.destroy(),this._featureForm.destroy(),this._featureTemplates.destroy(),this._spinner.destroy(),this._sketchToolbar=s(this._sketchToolbar),this._sketchImportAbortController=o(this._sketchImportAbortController)}loadDependencies(){return Promise.all([ee({flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list")}),W(),I(),U(),x(),B(),R(),z(),K(),$()])}get _hasInvalidBatchSelection(){return this._hasSelectionFromMultipleLayers||this._selectionCountExceedsMaximum||0===this._selectionList.visibleFeatureCount}get _hasSelectionFromMultipleLayers(){return this._selectionList.visibleLayerCount>1}get _deleteButtonCommonInfo(){return{appearance:"outline",kind:"danger"}}get _selectionCountExceedsMaximum(){const e=this._batchAttributeForm.maximumFeatureCount,{activeLayerItem:t,effectiveCount:i,filterText:s,visibleFeatureCount:o}=this._selectionList;return null!=s&&""!==s?o>e:t?t.total>e:i>e}get _selectionListItemActionConfigs(){const{messages:e}=this;return[{label:e?.batchEditing?.editThisFeature,icon:"edit-attributes",type:"feature",callback:({item:e})=>this._onSelectionListMenuItemSelect(e,"update")},{label:e?.batchEditing.editTheseFeatures,icon:"edit-attributes",type:"layer",callback:({item:e})=>this._onSelectionListMenuItemSelect(e,"update")},{label:e?.batchEditing.mergeTheseFeatures,icon:"merge",type:"layer",callback:({item:e})=>this._onSelectionListMenuItemSelect(e,"merge")}]}get _visibleSelectionCount(){const{activeLayerItem:e,effectiveCount:t,filterText:i,visibleFeatureCount:s}=this._selectionList;return null!=i&&""!==i?s:e?e.total:t}get activeWorkflow(){return this.viewModel.activeWorkflow}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get hideTemplatesForInactiveLayers(){return this.viewModel.hideTemplatesForInactiveLayers}set hideTemplatesForInactiveLayers(e){this.viewModel.hideTemplatesForInactiveLayers=e}get icon(){return"pencil"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.viewModel.startCreateFeaturesWorkflowAtFeatureTypeSelection()}startCreateFeaturesWorkflowAtFeatureCreation(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureCreation(e)}startCreateFeaturesWorkflowAtFeatureEdit(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureEdit(e)}startMergeFeaturesWorkflow(e,t={}){return this.viewModel.startMergeFeaturesWorkflow(e,t)}startSplitFeatureWorkflow(e,t={}){return this.viewModel.startSplitFeatureWorkflow(e,t)}async startUpdateFeaturesWorkflow(e){return this.viewModel.startUpdateFeaturesWorkflow(e)}startUpdateWorkflowAtFeatureSelection(){return this.viewModel.startUpdateWorkflowAtFeatureSelection()}startUpdateWorkflowAtMultipleFeatureSelection(e){return this.viewModel.startUpdateWorkflowAtMultipleFeatureSelection(e)}startUpdateWorkflowAtFeatureEdit(e){return this.viewModel.startUpdateWorkflowAtFeatureEdit(e)}startUpdateWorkflowWithActiveSelection(){return this.viewModel.startUpdateWorkflowWithActiveSelection()}deleteFeatureFromWorkflow(){return t(i.getLogger(this),"Editor.deleteFeatureFromWorkflow is deprecated. Use Editor.deleteFeatures instead.",{version:"4.33",replacement:"Editor.deleteFeatures",warnOnce:!0}),this.deleteFeatures()}async deleteFeatures(){await this.viewModel.deleteFeatures()}deleteAssociationFromWorkflow(){return this.viewModel.deleteAssociationFromWorkflow()}cancelWorkflow(e){return this.viewModel.cancelWorkflow(e)}render(){const{visibleElements:e,viewModel:t}=this,i=this.classes(k.base,te.widget,te.panel);if(!t)return de("div",{class:i,key:"empty"});const{pageStack:s}=t,o=s.length-1,r=s.map((e,t)=>this._renderPage(e,t===o));return de("div",{class:i,key:"base"},e.flow?de("calcite-flow",{inert:!!this._prompt,key:"flow"},r):r,this._prompt?de(q,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderPage(e,t){const i={selected:t};switch(e){case"disabled":break;case"ready":return this._renderReady(i);case"viewing-selection-list":return this._renderSelectionListPage(i);case"awaiting-feature-creation-info":return this._renderAwaitingFeatureCreationInfo(i);case"creating-features-upload-details":return this._renderUploadDetails(i);case"creating-features":return this._renderCreatingFeatures(i);case"editing-existing-feature":case"editing-features":case"editing-attributes":case"choosing-key-feature":return this._renderUpdateFeature(i);case"awaiting-update-feature-candidate":return this._renderFeatureList(i);case"adding-attachment":return this._renderAttachmentAdding(i);case"editing-attachment":return this._renderAttachmentEditing(i);case"viewing-associated-layers":case"viewing-associated-features":return this._renderViewAssociatedLayers(i);case"add-association-select-layer":case"add-association-select-feature":return this._renderSelectFeature(i);case"add-association-create-association":return this._renderAddAssociation(i);case"drawing-splitter-geometry":return this._renderDrawingSplitGeometry(i);case"reviewing-features":return this._renderReviewingSplitFeatures(i)}return de("div",{key:"empty-page"})}_renderAwaitingFeatureCreationInfo(e){const{EditorPanel:t,messages:i}=this;return de(t,{heading:i.selectTemplate,key:"templates-panel",...e},de(O,{key:"feature-templates"},de(N,null,this._renderFeatureTemplates())))}_renderUploadDetails(e){const{EditorPanel:t,activeWorkflow:i,messages:s}=this;if("create-features"!==i?.type)return null;const o=i.data.upload;return o?de(t,{heading:s.createFeatures,key:"upload-details-panel",...e},de(J,{helpMessage:this._helpMessage,messages:s,upload:o})):null}_renderCreatingFeatures(e){const{EditorPanel:t,activeWorkflow:i,messages:s,messagesCommon:o,headingLevel:r,viewModel:a}=this;if(!i)return null;const n="create-features"===i.type&&i.numPendingFeatures>0||"update"===i.type&&"create-features"===i?.activeWorkflow?.type&&i.activeWorkflow?.numPendingFeatures>0;return de(t,{heading:s.createFeatures,key:"create-features-panel",...e},n?de(Z,{editorViewModel:a,headingLevel:r,messages:s,messagesCommon:o,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}):de(P,{helpMessage:this._helpMessage,renderSketchToolbar:this._renderSketch}))}_renderUpdateFeature(e){const{EditorPanel:t,messages:i,messagesCommon:s,headingLevel:o,viewModel:r}=this,a=r.activeFeatureCount>1?i.multiFeature.editPanelTitle:i.singleFeature.editPanelTitle;return de(t,{heading:a,key:"update-feature-panel",...e},de(Z,{editorViewModel:r,headingLevel:o,messages:i,messagesCommon:s,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onMerge:this._onMerge,onSave:this._onSave,onSplit:this._onSplit}))}_renderDrawingSplitGeometry(e){const{EditorPanel:t}=this;return de(t,{heading:this.messages.splitFeature,key:"draw-split-geometry-panel",...e},de(P,{helpMessage:this._helpMessage,renderSketchToolbar:this._renderSketch}))}_renderReviewingSplitFeatures(e){const{EditorPanel:t,messages:i,messagesCommon:s,headingLevel:o,viewModel:r}=this;return de(t,{heading:i.splitFeature,key:"review-split-features-panel",...e},de(Z,{editorViewModel:r,headingLevel:o,messages:i,messagesCommon:s,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,visibleElements:this.visibleElements,onSave:this._onSave}))}_getAssociationTypeTitle(e){const{messages:t}=this;if(!e)return t.singleFeature.editPanelTitle;if(e.title)return e.title;const{messagesFeature:i}=this;switch(e.type){case"attachment":return i.associationsAttachments;case"connectivity":return i.associationsConnectivity;case"structure":return i.associationsStructure;case"content":return i.associationsContents;case"container":return i.associationsContainer}}_getAddAssociationTypeTitle(e){const{messages:t}=this;if(!e)return t.singleFeature.editPanelTitle;const i=t.associations;switch(e.type){case"attachment":return i.addAttachment;case"connectivity":return i.addConnectivity;case"structure":return i.addStructure;case"content":return i.addContent;case"container":return i.addContainer}}async _initializeAssociationItemList(e){const t=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js")).default;this._associationItemList=new t({view:this.view,viewModel:e})}async _initializeAssociationSettings(){const e=new(0,(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js")).default);return this._associationSettings=e,e}_renderViewAssociatedLayers(e){const{EditorPanel:t,messages:i,messagesCommon:s,headingLevel:o,viewModel:r}=this,a=r.featureFormViewModel?.activeAssociationInput?.activeAssociationType,n=this._getAssociationTypeTitle(a);return de(t,{heading:n,key:"viewing-associated-layers-panel",...e},de(Z,{editorViewModel:r,headingLevel:o,messages:i,messagesCommon:s,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}))}_renderSelectFeature(e){const{_associationItemList:t,EditorPanel:i,viewModel:s,messagesCommon:o}=this,r=s.utilityNetworkAssociationAddAssociationViewModel,a=this._getAddAssociationTypeTitle(r?.associationType),n="ready"!==r?.state||this.viewModel.featureFormDisabled;return t?de(i,{heading:a,key:"add-association-select-feature",...e},de(O,{key:"select-feature"},de(N,null,t.render())),de(V,{buttons:[t.filterOptionsVisible?{appearance:"solid",label:o.apply,disabled:n,onClick:()=>t.applyFilterOptions(),type:"button"}:void 0,{appearance:"outline",label:o.cancel,disabled:n,onClick:()=>{"update"===s.activeWorkflow?.type&&(r?.reset(),s.activeWorkflow.cancelActiveWorkflow())},type:"button"}]})):de(i,{heading:a,key:"add-association-select-feature",...e})}async _setUpAssociationSettings(){const{viewModel:e}=this,t=this._associationSettings??await this._updatingHandles.addPromise(this._initializeAssociationSettings()),i=e.utilityNetworkAssociationAddAssociationViewModel,s="update"===e.activeWorkflow?.type?e.activeWorkflow:null,o=s?s.activeWorkflow:null,r="add-association"===o?.type?o.sourceFeatureItem:null,a=i?.selectedFeature,n=i?.association,l=i?.utilityNetwork;r&&a&&n&&l&&(t.sourceFeature=r,t.targetFeature=a,t.association=n,t.utilityNetwork=l)}_renderAddAssociation(e){const{_associationSettings:t,EditorPanel:i,viewModel:s,messagesCommon:o}=this;if(!t)return null;const r=s.utilityNetworkAssociationAddAssociationViewModel,a=this._getAddAssociationTypeTitle(r?.associationType),n="ready"!==r?.state;return de(i,{heading:a,key:"add-association",...e},de(O,{key:"add-association-content"},de(N,null,t.render())),de(V,{buttons:[{label:o.add,disabled:n||!r.canAddAssociation,onClick:()=>this._onSave(),type:"button"},{appearance:"outline",label:o.cancel,disabled:n,onClick:()=>{"update"===s.activeWorkflow?.type&&s.activeWorkflow.cancelActiveWorkflow()},type:"button"}]}))}_renderCustomTemplateGroupContent(e){const{messages:t,viewModel:i}=this,s=r(e.group.items,e=>i.itemHasInvalidFormTemplate(e)?t.formFieldCreateError:void 0);return s?de(D,{kind:"warning",message:s}):null}_renderAttachmentAdding(e){const{EditorPanel:t,_attachments:i,messages:s,messagesCommon:o}=this;return de(t,{heading:s.addAttachment,key:"attachment-adding-panel",...e},de(O,{key:"attachments"},this._renderAttachments()),de(V,{buttons:[{label:i.submitting?o.cancel:o.add,disabled:i.submitting||!i.selectedFile,onClick:this._onAttachmentAdd,type:"button"}]}))}_renderSelectionListPage(e){const{_hasSelectionFromMultipleLayers:t,_hasInvalidBatchSelection:i,_selectionCountExceedsMaximum:s,_selectionList:o,_visibleSelectionCount:r,messages:a,EditorPanel:n}=this,{batchUpdateActions:l}=this.visibleElements,{maxVisibleFeatureCountPerLayer:c}=o;return de(n,{heading:a.widgetLabel,key:"selection-list-panel",...e},this.visibleElements.selectionToolbar&&"3d"!==this.view?.type?de("div",{class:k.selectionToolbarContainer},this._renderSelectionToolbar()):void 0,de(O,{key:"selection-list"},de(N,null,this._renderSelectionList())),de(V,{buttons:[l?{label:pe(a.batchEditing.editCount,{count:r}),disabled:i,onClick:()=>this.startUpdateWorkflowWithActiveSelection(),type:"button"}:void 0],notice:l&&t?{text:a.batchEditing.selectOneLayer,icon:"information"}:l&&s?{text:pe(this.messages.multiFeature.formFailedToLoadTooManyFeatures,{num:c}),icon:"information"}:void 0}))}_renderAttachmentEditing(e){const{EditorPanel:t,_attachments:i,activeWorkflow:s,messages:o,messagesCommon:r}=this;return s?de(t,{heading:o.editAttachment,key:"attachment-editing-panel",...e},de(O,{key:"attachments"},this._renderAttachments()),s.shouldAllowAttachmentEditing?de(V,{buttons:[{label:r.update,disabled:i.submitting||!i.selectedFile,onClick:this._onAttachmentUpdate,type:"button"},{...this._deleteButtonCommonInfo,onClick:this._onAttachmentDelete,disabled:i.submitting,label:r.delete,type:"button"}]}):void 0):null}_renderReady(e){const{EditorPanel:t,messages:i,viewModel:s,visibleElements:o}=this,r=this._helpMessage;return de(t,{heading:i.widgetLabel,key:"landing-panel",...e},de(O,{key:"landing-content"},s.editorItems.length?[o.editFeaturesSection?de(N,{key:"edit-actions"},this._renderUpdateActions()):null,o.createFeaturesSection&&s.canCreateVisible?de(N,{key:"create-actions"},this._renderCreateActions()):null]:de(H,{key:"no-content"},i.noEditableLayers)),r?de("div",{class:k.helpMessage,key:"footer-actions",slot:"footer"},r):void 0)}get _helpMessage(){const{activeWorkflow:e,messages:t,view:i}=this,s=e?.helpMessage;return s?t["3d"===i?.type?"helpMessages3d":"helpMessages2d"]?.[s]:void 0}_renderUpdateActions(){const{messages:e,messagesCommon:t,viewModel:i}=this,s={id:"select",label:t.select};return de("div",{class:k.updateActions,key:"update-actions"},de(se,{level:ie(this.headingLevel)},e.editFeatures),this.visibleElements.selectionToolbar&&"3d"!==this.view?.type?de("div",{class:k.selectionToolbarContainer},this._renderSelectionToolbar()):de("calcite-list",{class:k.updateActionsList,label:e.editFeaturesList,selectionAppearance:"border",selectionMode:"single"},oe({disabled:!i.canUpdateVisible,grouped:!1,item:s,selectedItem:"awaiting-feature-to-update"===i.activeWorkflow?.stepId?s:void 0,renderIcon:this._renderSelectIcon,onItemSelect:this._onToggleUpdateWorkflow})))}_renderCreateActions(){return de("div",{key:"create-actions"},de(se,{level:ie(this.headingLevel)},this.messages.createFeatures),de("div",{class:k.featureTemplatesContainer,key:"templates"},this._renderFeatureTemplates()))}_renderFeatureList(e){const{EditorPanel:t,viewModel:i}=this,{activeWorkflow:s}=i;if("update"!==s?.type)return null;const o=s.data.candidates,r=pe(this.messages.multipleFeaturesTemplate,{total:o.length});return de(t,{heading:r,key:"feature-list",...e},de(j,{editorItems:i.editorItems,editorMessages:this.messages,filterText:this._filterText,id:this.id,messagesTemplates:this.messagesTemplates,workflow:s,onFilterTextChange:e=>this._filterText=e,onSelectFeature:(e,t)=>i.selectFeature(e,t),onZoomTo:e=>i.zoomTo(e)}))}_showPromptAndWait({title:e,message:t,yesLabel:i,noLabel:s}){const o=a(),{view:r}=this,n=r?.focused;return this._showPrompt({title:e,message:t,context:"danger",actions:{primary:{label:i,action:()=>o.resolve(!0)},secondary:{label:s,action:()=>o.resolve(!1)}}}),o.promise.finally(()=>{this._clearPrompt(),n&&r?.focus()})}async _onSelectionListItemSelect(e){await this.viewModel.onSelectionListItemSelect(e)}async _onSelectionListMenuItemSelect(e,t){await this.viewModel.onSelectionListMenuItemSelect(e,t)}async _setupSketch(){if(!!!this.visibleElements.sketch)return this._sketchImportAbortController=o(this._sketchImportAbortController),this._sketchToolbar=s(this._sketchToolbar),void this.removeHandles(ue);if(this._sketchImportAbortController)return;const e=new AbortController;this._sketchImportAbortController=e;const t=await import("./Sketch.js");if(!e.signal.aborted)try{this._sketchToolbar=new t.default({toolbarKind:"docked",contextualToolLocation:"inline-end",scale:"s",visibleElements:new Y({deleteButton:!1,settingsMenu:!1,directionModePicker:!1,selectionCountLabel:!1,duplicateButton:!1,createTools:new Q({freehandPolygon:!0,freehandPolyline:!0}),selectionTools:new X({"lasso-selection":!1,"rectangle-selection":!1})})}),this.addHandles([n(()=>{const e=this.viewModel.activeLeafWorkflow;return e&&"availableCreateTools"in e?e.availableCreateTools:null},e=>{this._sketchToolbar&&(this._sketchToolbar.availableCreateTools=e)},d),n(()=>this.visibleElements.undoRedoButtons,e=>{this._sketchToolbar&&(this._sketchToolbar.visibleElements.undoRedoMenu=e)},d),c(()=>this.viewModel?.sketchViewModel,e=>{this._sketchToolbar&&(this._sketchToolbar.viewModel=e)},d)],ue)}finally{this._sketchImportAbortController=null}}get test(){return{sketch:this._sketchToolbar,showPrompt:this._showPromptAndWait.bind(this)}}};e([h()],ge.prototype,"_batchAttributeForm",void 0),e([h()],ge.prototype,"_featureForm",void 0),e([h()],ge.prototype,"_sketchToolbar",void 0),e([h()],ge.prototype,"_attachments",void 0),e([h()],ge.prototype,"_associationItemList",void 0),e([h()],ge.prototype,"_associationSettings",void 0),e([h()],ge.prototype,"_featureTemplates",void 0),e([h()],ge.prototype,"_filterText",void 0),e([h()],ge.prototype,"_hasInvalidBatchSelection",null),e([h()],ge.prototype,"_hasSelectionFromMultipleLayers",null),e([h()],ge.prototype,"_prompt",void 0),e([h()],ge.prototype,"_spinner",void 0),e([h()],ge.prototype,"_deleteButtonCommonInfo",null),e([h()],ge.prototype,"_loading",void 0),e([h()],ge.prototype,"_selectionCountExceedsMaximum",null),e([h()],ge.prototype,"_selectionList",void 0),e([h()],ge.prototype,"_selectionListItemActionConfigs",null),e([h()],ge.prototype,"_selectionToolbar",void 0),e([h()],ge.prototype,"_visibleSelectionCount",null),e([h({readOnly:!0})],ge.prototype,"activeWorkflow",null),e([h()],ge.prototype,"effectiveSelectionManager",null),e([h()],ge.prototype,"headingLevel",void 0),e([h()],ge.prototype,"hideTemplatesForInactiveLayers",null),e([h()],ge.prototype,"icon",null),e([h()],ge.prototype,"label",null),e([h()],ge.prototype,"labelOptions",null),e([h()],ge.prototype,"layerInfos",null),e([h(),le("esri/widgets/Editor/t9n/Editor")],ge.prototype,"messages",void 0),e([h(),le("esri/t9n/common")],ge.prototype,"messagesCommon",void 0),e([h(),le("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],ge.prototype,"messagesTemplates",void 0),e([h(),le("esri/widgets/Feature/t9n/Feature")],ge.prototype,"messagesFeature",void 0),e([h()],ge.prototype,"snappingOptions",null),e([h()],ge.prototype,"tooltipOptions",null),e([h()],ge.prototype,"supportingWidgetDefaults",void 0),e([h({type:u,nonNullable:!0})],ge.prototype,"valueOptions",null),e([h()],ge.prototype,"view",null),e([h(),ce(["sketch-create","sketch-delete","sketch-update","workflow-cancel","workflow-commit"])],ge.prototype,"viewModel",void 0),e([h({type:M,nonNullable:!0})],ge.prototype,"visibleElements",void 0),e([h()],ge.prototype,"_helpMessage",null),ge=e([m("esri.widgets.Editor")],ge);const we=ge;export{we as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../../../intl.js";import{watch as t,on as r,initial as i}from"../../../core/reactiveUtils.js";import{stripHTML as s}from"../../../core/string.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{isGroupLayer as a,isSubtypeGroupLayer as n}from"../../../layers/support/layerUtils.js";import{defaultHighlightName as c,temporaryHighlightName as d}from"../../../views/support/HighlightDefaults.js";import p from"../../Widget.js";import u from"../UtilityNetworkAssociationAddAssociationViewModel.js";import{loadCalciteComponents as h}from"../../support/componentsUtils.js";import m from"../../support/FilterBuilder.js";import{globalCss as _}from"../../support/globalCss.js";import{Heading as v}from"../../support/Heading.js";import f from"../../support/SelectionToolbar.js";import"../../support/widgetUtils.js";import{messageBundle as g}from"../../support/decorators/messageBundle.js";import{tsx as y}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";import b from"../../support/SelectionToolbar/VisibleElements.js";import{substitute as F}from"../../../intl/substitute.js";const w="esri-feature-form-utility-network-association-layers",C={base:w,header:`${w}__header`,headingContent:`${w}__heading-content`,featureObserver:`${w}__feature-observer`,filterContainer:`${w}__filter-container`,filterOptionsContainer:`${w}__filter-options-container`,filterOptionsHeader:`${w}__filter-options-header`,listContainer:`${w}__list-container`,spatialSelectContainer:`${w}__spatial-select-container`,spatialSelectToolbar:`${w}__spatial-select-toolbar`,stickySpinnerContainer:`${w}__sticky-loading-container`,loadingContainer:`${w}__loading-container`};let L=class extends p{constructor(e,t){super(e,t),this.headingLevel=5,this.messagesCommon=null,this.messagesEditor=null,this.messagesFeature=null,this.messagesFeatureForm=null,this.messagesFilterBuilder=null,this.viewModel=new u,this.view=null,this._filterBuilder=new m,this._featureFilterText="",this._layerFilterText="",this._observer=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._observerNode=null,this._selectionToolbar=new f({returnFeatureTitleFields:!0,layerViewPreferenceEnabled:!1,persistSelection:!1,visibleElements:new b({chip:!1,operationTypeControls:!1,pan:!1})}),this._onSelectionComplete=async e=>{const{highlightHelper:t}=this.viewModel;await this.viewModel.onSelectionComplete(e),t?.removeAll(),this._featureSpatialGraphics.length>0&&t?.add(this._featureSpatialGraphics)}}initialize(){this._setupSelectionToolbar(),this.addHandles([t(()=>this.viewModel,()=>this.reset()),t(()=>[this.viewModel.state,this._observerNode],()=>this._onObserverChange()),t(()=>this.selectedLayer,e=>{this._filterBuilder.layer=e,e||(this.filterOptionsVisible=!1,this._featureFilterText="")})])}loadDependencies(){return h({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._filterBuilder.destroy(),this._selectionToolbar.destroy()}get filterOptionsVisible(){return this.viewModel.filterOptionsVisible}set filterOptionsVisible(e){this.viewModel.filterOptionsVisible=e}get isSelecting(){return"active"===this._selectionToolbar.state}get selectedLayer(){return this.viewModel.selectedLayer}set selectedLayer(e){this.viewModel.selectedLayer=e}get selectedFeature(){return this.viewModel.selectedFeature}set selectedFeature(e){this.viewModel.selectedFeature=e}get filterWhereClause(){return this.viewModel.filterWhereClause}set filterWhereClause(e){this.viewModel.filterWhereClause=e,e||this._filterBuilder.reset()}get _featureSpatialGraphics(){return this.viewModel.featureSpatialItems.toArray().map(e=>e.feature)}get _filteredFeatureItems(){const{_featureFilterText:e}=this,{featureItems:t,featureSpatialItems:r}=this.viewModel;return(r.length?r:t).map(e=>({label:e.label,graphic:e.feature,layer:e.feature.sourceLayer})).filter(t=>t.label?.toLowerCase().includes(e)??!1)}get _filteredFeatureItemsPage(){const{featurePage:e,featuresPerPage:t}=this.viewModel,r=e*t;return this._filteredFeatureItems.toArray().slice(0,r)}render(){return y("div",{class:this.classes(C.base,_.widget)},this._renderContent())}applyFilterOptions(){const{selectedLayer:e}=this;this.filterOptionsVisible=!1,e&&(this.filterWhereClause=this._filterBuilder.whereClause)}cancelSelection(){this._selectionToolbar.cancel()}reset(){this.filterWhereClause=null,this._featureFilterText="",this._layerFilterText="",this.filterOptionsVisible=!1,this._filterBuilder.reset()}startSelection(e){this._selectionToolbar.activateTool(e)}_setupSelectionToolbar(){this.addHandles([t(()=>this.view,e=>{this.viewModel.reset(),this._selectionToolbar.view="2d"===e?.type?e:null},i),t(()=>[this.viewModel,this.viewModel.layerItems.length,this.viewModel.map?.allLayers.map(e=>e.visible),this.viewModel.map?.allLayers?.filter(e=>n(e)).toArray().flatMap(e=>e.sublayers.toArray()).map(e=>e.visible)],()=>this._updateToolbarSources()),r(()=>this._selectionToolbar,"before-activate",e=>this.emit("before-selection",e)),r(()=>this._selectionToolbar,"complete",this._onSelectionComplete)])}_updateToolbarSources(){const e=this.viewModel.layerItems.toArray().filter(e=>{const{parent:t}=e;return!(t&&(a(t)||n(t))&&!t.visible)&&e.visible});this._selectionToolbar.sources=e}_onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);const{state:e}=this.viewModel;this._observerNode&&"ready"===e&&this._observer.observe(this._observerNode)}_increaseFeaturePage(){const{featureCount:e,featurePage:t,featureSpatialItems:r,state:i}=this.viewModel;e||r.length||1===t?"ready"===i&&this.viewModel.featurePage++:this.viewModel.featurePage=1}_renderContent(){const{state:e,filterOptionsVisible:t}=this.viewModel;return"loading"===e?this._renderLoading():t?this._renderFilterOptions():[this._renderSelectionToolbar(),this._renderListContent()]}_renderListContent(){return this._selectionToolbar.activeOperation?.processingFinalSelection?this._renderLoading():this.selectedLayer||this.viewModel.featureSpatialItems.length?this._renderFeatures():this._renderLayers()}_renderSelectionToolbar(){const{messagesCommon:e,_selectionToolbar:t}=this,{featureSpatialItems:r,selectedLayer:i}=this.viewModel;if(i||!t.sources?.length)return null;const s=y("div",{class:C.spatialSelectToolbar},t.render()),o=y("calcite-button",{appearance:"transparent",disabled:!r.length,label:e.clear,onclick:()=>this.viewModel.reset()},e.clear);return y("div",{class:C.spatialSelectContainer,key:"spatial-select-toolbar"},s,o)}_renderStickyLoading(){return"querying"===this.viewModel.state?y("div",{class:C.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoading(){return y("div",{class:C.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return y("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderFilterOptions(){return y("div",{class:C.filterOptionsContainer},y("div",{class:C.filterOptionsHeader},y("span",null,this.messagesFilterBuilder.widgetLabel),y("calcite-button",{appearance:"transparent",onclick:()=>this._filterBuilder.reset()},this.messagesCommon.clear)),this._filterBuilder.render())}_renderLayers(){const e=this.messagesFeatureForm.associations,t=e.availableLayers,r=e.filterLayers;return y("div",null,this._renderHeader({heading:t,placeholder:r,renderFilterOptions:!1,renderTotal:!1}),y("div",{class:C.listContainer},y("calcite-list",{label:e.associatedFeatures},this._renderLayerItems(),this._renderStickyLoading())))}_renderLayerItems(){const{_layerFilterText:e,viewModel:t,messagesCommon:r}=this,{layerItems:i,tableItems:s}=t;return i.concat(s).map(e=>({label:e.title??r.untitled,layer:e})).filter(t=>t.label?.toLowerCase().includes(e)??!1).toArray().map(e=>this._renderLayerItem(e))}_renderLayerItem(e){const{label:t,layer:r}=e;return y("calcite-list-item",{key:`layer-item-${r.id}`,label:s(t),onCalciteListItemSelect:()=>{this.selectedLayer=r,this._filterBuilder.reset()}},y("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderFeatures(){const{selectedLayer:e,viewModel:t}=this,r=t.featureSpatialItems.length>0,i=this.messagesFeatureForm.associations,s=r?void 0:e?.title||this.messagesCommon.untitled,o=i.filterFeatures;return y("div",null,this._renderHeader({heading:s,placeholder:o,renderFilterOptions:!r,renderTotal:!0}),y("div",{class:C.listContainer},y("calcite-list",{label:i.associatedFeatures},this._renderFeatureItems(),this._renderStickyLoading(),this._renderFeatureObserver())))}_renderFeatureItems(){return this._filteredFeatureItemsPage.map(e=>this._renderFeatureItem(e))}_renderFeatureItem(e){const{viewModel:t}=this,{highlightHelper:r}=t,{label:i,graphic:o}=e,l=t.featureSpatialItems.length>0?()=>r?.update(o,c):void 0,a=t.featureSpatialItems.length>0?()=>r?.update(o,d):void 0;return y("calcite-list-item",{key:`feature-item-${o.uid}`,label:s(i),onmouseenter:l,onmouseleave:a,onCalciteListItemSelect:()=>{this.selectedFeature={feature:o,label:i}}},y("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_onObserverCreate(e){this._observerNode=e}_renderFeatureObserver(){return y("div",{afterCreate:this._onObserverCreate,bind:this,class:C.featureObserver,key:"feature-observer"})}_renderHeader(e){return y("div",{class:C.header,key:"filter"},this._renderHeading(e.heading),this._renderFilter(e.placeholder,e.renderFilterOptions),e.renderTotal?this._renderTotal():null)}_renderHeading(e){return e?y(v,{key:"title",level:this.headingLevel},y("div",{class:C.headingContent},y("calcite-icon",{icon:"layer"}),e)):null}_renderFilter(e,t){const r=!this.selectedLayer&&!this.viewModel.featureSpatialItems.length,i=r?this._layerFilterText:this._featureFilterText;return y("div",{class:C.filterContainer,key:"filter"},y("calcite-input",{icon:"search",placeholder:e,type:"search",value:i,onCalciteInputInput:e=>{r?this._layerFilterText=e.currentTarget.value.trim().toLowerCase():this._featureFilterText=e.currentTarget.value.trim().toLowerCase()}},t?this._renderFilterOptionsAction():null))}_renderFilterOptionsAction(){const e=this.messagesFeatureForm.associations.filterOptions;return y("calcite-action",{appearance:"transparent",icon:"sliders",indicator:!!this._filterBuilder.whereClause,onclick:()=>{this.viewModel.filterOptionsVisible=!this.viewModel.filterOptionsVisible},scale:"s",slot:"action",text:e,title:e})}_renderTotal(){const{messagesFeature:e,viewModel:t}=this,{featureCount:r,featureSpatialItems:i}=t,s=F(e.numberRecords,{number:i.length?i.length:r});return y("div",{key:"total"},s)}};e([o()],L.prototype,"filterOptionsVisible",null),e([o()],L.prototype,"headingLevel",void 0),e([o()],L.prototype,"isSelecting",null),e([o(),g("esri/t9n/common")],L.prototype,"messagesCommon",void 0),e([o(),g("esri/widgets/Editor/t9n/Editor")],L.prototype,"messagesEditor",void 0),e([o(),g("esri/widgets/Feature/t9n/Feature")],L.prototype,"messagesFeature",void 0),e([o(),g("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"messagesFeatureForm",void 0),e([o(),g("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],L.prototype,"messagesFilterBuilder",void 0),e([o()],L.prototype,"selectedLayer",null),e([o({type:u})],L.prototype,"viewModel",void 0),e([o()],L.prototype,"selectedFeature",null),e([o()],L.prototype,"filterWhereClause",null),e([o()],L.prototype,"view",void 0),e([o()],L.prototype,"_filterBuilder",void 0),e([o()],L.prototype,"_featureFilterText",void 0),e([o()],L.prototype,"_layerFilterText",void 0),e([o()],L.prototype,"_observer",void 0),e([o()],L.prototype,"_featureSpatialGraphics",null),e([o()],L.prototype,"_filteredFeatureItems",null),e([o()],L.prototype,"_filteredFeatureItemsPage",null),e([o()],L.prototype,"_observerNode",void 0),L=e([l("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationItemList")],L);const S=L;export{S as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import"../../../intl.js";import{watch as t,on as r,initial as i}from"../../../core/reactiveUtils.js";import{stripHTML as s}from"../../../core/string.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{isSubtypeGroupLayer as a,isGroupLayer as n}from"../../../layers/support/layerUtils.js";import{defaultHighlightName as c,temporaryHighlightName as d}from"../../../views/support/HighlightDefaults.js";import p from"../../Widget.js";import u from"../UtilityNetworkAssociationAddAssociationViewModel.js";import{loadCalciteComponents as h}from"../../support/componentsUtils.js";import m from"../../support/FilterBuilder.js";import{globalCss as _}from"../../support/globalCss.js";import{Heading as v}from"../../support/Heading.js";import f from"../../support/SelectionToolbar.js";import"../../support/widgetUtils.js";import{messageBundle as g}from"../../support/decorators/messageBundle.js";import{tsx as y}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";import b from"../../support/SelectionToolbar/VisibleElements.js";import{substitute as F}from"../../../intl/substitute.js";const w="esri-feature-form-utility-network-association-layers",C={base:w,header:`${w}__header`,headingContent:`${w}__heading-content`,featureObserver:`${w}__feature-observer`,filterContainer:`${w}__filter-container`,filterOptionsContainer:`${w}__filter-options-container`,filterOptionsHeader:`${w}__filter-options-header`,listContainer:`${w}__list-container`,spatialSelectContainer:`${w}__spatial-select-container`,spatialSelectToolbar:`${w}__spatial-select-toolbar`,stickySpinnerContainer:`${w}__sticky-loading-container`,loadingContainer:`${w}__loading-container`};let L=class extends p{constructor(e,t){super(e,t),this.headingLevel=5,this.messagesCommon=null,this.messagesEditor=null,this.messagesFeature=null,this.messagesFeatureForm=null,this.messagesFilterBuilder=null,this.viewModel=new u,this.view=null,this._filterBuilder=new m,this._featureFilterText="",this._layerFilterText="",this._observer=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._observerNode=null,this._selectionToolbar=new f({returnFeatureTitleFields:!0,layerViewPreferenceEnabled:!1,persistSelection:!1,visibleElements:new b({chip:!1,operationTypeControls:!1,pan:!1})}),this._onSelectionComplete=async e=>{const{highlightHelper:t}=this.viewModel;await this.viewModel.onSelectionComplete(e),t?.removeAll(),this._featureSpatialGraphics.length>0&&t?.add(this._featureSpatialGraphics)}}initialize(){this._setupSelectionToolbar(),this.addHandles([t(()=>this.viewModel,()=>this.reset()),t(()=>[this.viewModel.state,this._observerNode],()=>this._onObserverChange()),t(()=>this.selectedLayer,e=>{this._filterBuilder.layer=e,e||(this.filterOptionsVisible=!1,this._featureFilterText="")})])}loadDependencies(){return h({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._filterBuilder.destroy(),this._selectionToolbar.destroy()}get filterOptionsVisible(){return this.viewModel.filterOptionsVisible}set filterOptionsVisible(e){this.viewModel.filterOptionsVisible=e}get isSelecting(){return"active"===this._selectionToolbar.state}get selectedLayer(){return this.viewModel.selectedLayer}set selectedLayer(e){this.viewModel.selectedLayer=e}get selectedFeature(){return this.viewModel.selectedFeature}set selectedFeature(e){this.viewModel.selectedFeature=e}get filterWhereClause(){return this.viewModel.filterWhereClause}set filterWhereClause(e){this.viewModel.filterWhereClause=e,e||this._filterBuilder.reset()}get _featureSpatialGraphics(){return this.viewModel.featureSpatialItems.toArray().map(e=>e.feature)}get _filteredFeatureItems(){const{_featureFilterText:e}=this,{featureItems:t,featureSpatialItems:r}=this.viewModel;return(r.length?r:t).map(e=>({label:e.label,graphic:e.feature,layer:e.feature.sourceLayer})).filter(t=>t.label?.toLowerCase().includes(e)??!1)}get _filteredFeatureItemsPage(){const{featurePage:e,featuresPerPage:t}=this.viewModel,r=e*t;return this._filteredFeatureItems.toArray().slice(0,r)}render(){return y("div",{class:this.classes(C.base,_.widget)},this._renderContent())}applyFilterOptions(){const{selectedLayer:e}=this;this.filterOptionsVisible=!1,e&&(this.filterWhereClause=this._filterBuilder.whereClause)}cancelSelection(){this._selectionToolbar.cancel()}reset(){this.filterWhereClause=null,this._featureFilterText="",this._layerFilterText="",this.filterOptionsVisible=!1,this._filterBuilder.reset()}startSelection(e){this._selectionToolbar.activateTool(e)}_setupSelectionToolbar(){this.addHandles([t(()=>this.view,e=>{this.viewModel.reset(),this._selectionToolbar.view="2d"===e?.type?e:null},i),t(()=>[this.viewModel,this.viewModel.layerItems.length,this.viewModel.map?.allLayers.map(e=>e.visible),this.viewModel.map?.allLayers?.filter(e=>a(e)).toArray().flatMap(e=>e.sublayers.toArray()).map(e=>e.visible)],()=>this._updateToolbarSources()),r(()=>this._selectionToolbar,"before-activate",e=>this.emit("before-selection",e)),r(()=>this._selectionToolbar,"complete",this._onSelectionComplete)])}_updateToolbarSources(){const e=this.viewModel.layerItems.toArray().filter(e=>{const{parent:t}=e;return!(t&&(n(t)||a(t))&&!t.visible)&&e.visible});this._selectionToolbar.sources=e}_onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);const{state:e}=this.viewModel;this._observerNode&&"ready"===e&&this._observer.observe(this._observerNode)}_increaseFeaturePage(){const{featureCount:e,featurePage:t,featureSpatialItems:r,state:i}=this.viewModel;e||r.length||1===t?"ready"===i&&this.viewModel.featurePage++:this.viewModel.featurePage=1}_renderContent(){const{state:e,filterOptionsVisible:t}=this.viewModel;return"loading"===e?this._renderLoading():t?this._renderFilterOptions():[this._renderSelectionToolbar(),this._renderListContent()]}_renderListContent(){return this._selectionToolbar.activeOperation?.processingFinalSelection?this._renderLoading():this.selectedLayer||this.viewModel.featureSpatialItems.length?this._renderFeatures():this._renderLayers()}_renderSelectionToolbar(){const{messagesCommon:e,_selectionToolbar:t}=this,{featureSpatialItems:r,selectedLayer:i}=this.viewModel;if(i||!t.sources?.length)return null;const s=y("div",{class:C.spatialSelectToolbar},t.render()),o=y("calcite-button",{appearance:"transparent",disabled:!r.length,label:e.clear,onclick:()=>this.viewModel.reset()},e.clear);return y("div",{class:C.spatialSelectContainer,key:"spatial-select-toolbar"},s,o)}_renderStickyLoading(){return"querying"===this.viewModel.state?y("div",{class:C.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoading(){return y("div",{class:C.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return y("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderFilterOptions(){return y("div",{class:C.filterOptionsContainer},y("div",{class:C.filterOptionsHeader},y("span",null,this.messagesFilterBuilder.widgetLabel),y("calcite-button",{appearance:"transparent",onclick:()=>this._filterBuilder.reset()},this.messagesCommon.clear)),this._filterBuilder.render())}_renderLayers(){const e=this.messagesFeatureForm.associations,t=e.availableLayers,r=e.filterLayers;return y("div",null,this._renderHeader({heading:t,placeholder:r,renderFilterOptions:!1,renderTotal:!1}),y("div",{class:C.listContainer},y("calcite-list",{label:e.associatedFeatures},this._renderLayerItems(),this._renderStickyLoading())))}_renderLayerItems(){const{_layerFilterText:e,viewModel:t,messagesCommon:r}=this,{layerItems:i,tableItems:s}=t;return i.concat(s).map(e=>({label:e.title??r.untitled,layer:e})).filter(t=>t.label?.toLowerCase().includes(e)??!1).toArray().map(e=>this._renderLayerItem(e))}_renderLayerItem(e){const{label:t,layer:r}=e;return y("calcite-list-item",{key:`layer-item-${r.id}`,label:s(t),onCalciteListItemSelect:()=>{this.selectedLayer=r,this._filterBuilder.reset()}},y("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderFeatures(){const{selectedLayer:e,viewModel:t}=this,r=t.featureSpatialItems.length>0,i=this.messagesFeatureForm.associations,s=r?void 0:e?.title||this.messagesCommon.untitled,o=i.filterFeatures;return y("div",null,this._renderHeader({heading:s,placeholder:o,renderFilterOptions:!r,renderTotal:!0}),y("div",{class:C.listContainer},y("calcite-list",{label:i.associatedFeatures},this._renderFeatureItems(),this._renderStickyLoading(),this._renderFeatureObserver())))}_renderFeatureItems(){return this._filteredFeatureItemsPage.map(e=>this._renderFeatureItem(e))}_renderFeatureItem(e){const{viewModel:t}=this,{highlightHelper:r}=t,{label:i,graphic:o}=e,l=t.featureSpatialItems.length>0?()=>r?.update(o,c):void 0,a=t.featureSpatialItems.length>0?()=>r?.update(o,d):void 0;return y("calcite-list-item",{key:`feature-item-${o.uid}`,label:s(i),onmouseenter:l,onmouseleave:a,onCalciteListItemSelect:()=>{this.selectedFeature={feature:o,label:i}}},y("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_onObserverCreate(e){this._observerNode=e}_renderFeatureObserver(){return y("div",{afterCreate:this._onObserverCreate,bind:this,class:C.featureObserver,key:"feature-observer"})}_renderHeader(e){return y("div",{class:C.header,key:"filter"},this._renderHeading(e.heading),this._renderFilter(e.placeholder,e.renderFilterOptions),e.renderTotal?this._renderTotal():null)}_renderHeading(e){return e?y(v,{key:"title",level:this.headingLevel},y("div",{class:C.headingContent},y("calcite-icon",{icon:"layer"}),e)):null}_renderFilter(e,t){const r=!this.selectedLayer&&!this.viewModel.featureSpatialItems.length,i=r?this._layerFilterText:this._featureFilterText;return y("div",{class:C.filterContainer,key:"filter"},y("calcite-input",{icon:"search",placeholder:e,type:"search",value:i,onCalciteInputInput:e=>{r?this._layerFilterText=e.currentTarget.value.trim().toLowerCase():this._featureFilterText=e.currentTarget.value.trim().toLowerCase()}},t?this._renderFilterOptionsAction():null))}_renderFilterOptionsAction(){const e=this.messagesFeatureForm.associations.filterOptions;return y("calcite-action",{appearance:"transparent",icon:"sliders",indicator:!!this._filterBuilder.whereClause,onclick:()=>{this.viewModel.filterOptionsVisible=!this.viewModel.filterOptionsVisible},scale:"s",slot:"action",text:e,title:e})}_renderTotal(){const{messagesFeature:e,viewModel:t}=this,{featureCount:r,featureSpatialItems:i}=t,s=F(e.numberRecords,{number:i.length?i.length:r});return y("div",{key:"total"},s)}};e([o()],L.prototype,"filterOptionsVisible",null),e([o()],L.prototype,"headingLevel",void 0),e([o()],L.prototype,"isSelecting",null),e([o(),g("esri/t9n/common")],L.prototype,"messagesCommon",void 0),e([o(),g("esri/widgets/Editor/t9n/Editor")],L.prototype,"messagesEditor",void 0),e([o(),g("esri/widgets/Feature/t9n/Feature")],L.prototype,"messagesFeature",void 0),e([o(),g("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"messagesFeatureForm",void 0),e([o(),g("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],L.prototype,"messagesFilterBuilder",void 0),e([o()],L.prototype,"selectedLayer",null),e([o({type:u})],L.prototype,"viewModel",void 0),e([o()],L.prototype,"selectedFeature",null),e([o()],L.prototype,"filterWhereClause",null),e([o()],L.prototype,"view",void 0),e([o()],L.prototype,"_filterBuilder",void 0),e([o()],L.prototype,"_featureFilterText",void 0),e([o()],L.prototype,"_layerFilterText",void 0),e([o()],L.prototype,"_observer",void 0),e([o()],L.prototype,"_featureSpatialGraphics",null),e([o()],L.prototype,"_filteredFeatureItems",null),e([o()],L.prototype,"_filteredFeatureItemsPage",null),e([o()],L.prototype,"_observerNode",void 0),L=e([l("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationItemList")],L);const S=L;export{S as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{watch as i,sync as l}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{getDomainRange as s,dateTimeFieldValuesToNumericRange as u,validateDomainValue as a}from"../../layers/support/domainUtils.js";import{isFieldVisibleByDefault as o,getLowerCaseEditTrackingFields as p,getEffectiveFieldAlias as d,isNumericField as m,isStringField as h,isTimeOnlyField as y,getFieldRange as f}from"../../layers/support/fieldUtils.js";import{isAnyDateField as c}from"../../smartMapping/support/utils.js";import{isNumber as g}from"../../support/guards.js";import{isRelatableFeatureSupportedLayer as x}from"../Feature/support/featureUtils.js";import v from"./EditableInput.js";import{isFieldElementWithInputType as E,valueIsInvalidSwitchValue as b,isFieldElementWithShowNoValueOptionInput as _}from"./featureFormUtils.js";import{timeResolutionToStepMap as V,isArcadeDate as T,arcadeDateToFieldValue as w}from"../support/dateUtils.js";import{dateIsValid as F,getMaxLength as L,getMinLength as D,validateFormValue as M}from"../support/forms/formUtils.js";let O=class extends v{constructor(e){super(e),this._storedValue=null,this.error=null,this.preservesValueWhenHidden=!0,this.field=null,this.group=null,this.requiredExpressionExecutor=null,this.type="field",this._fieldInputWasVisibleDuringLifetime=!1,this.valueExpressionExecutor=null}initialize(){this.addHandles(i(()=>this.feature,()=>this._fieldInputWasVisibleDuringLifetime=!1,l))}get _dateFormRange(){const{element:e,field:t}=this;if("date"!==this.dataType)return{};const i=e?.domain?s(t,e.domain):null;if(!e?.input)return i??{};const l=e.input,{type:n}=l;let r={};if("date-picker"!==n&&"time-picker"!==n&&"datetimeoffset-picker"!==n||(r=u(t,l.max,l.min)),"datetime-picker"===n){const{max:e,min:t}=l;r={max:null!=e&&F(e)?e.getTime():null,min:null!=t&&F(t)?t.getTime():null}}const{max:a,min:o}=r;if(i){const{max:e,min:t}=i,l=g(e)&&(null==a||null!=a&&e<a),n=g(t)&&(null==o||null!=o&&t>o);return{max:l?e:a??null,min:n?t:o??null,rawMax:l?i.rawMax:r?.rawMax??null,rawMin:n?i.rawMin:r?.rawMin??null}}return{min:o,max:a,rawMax:r?.rawMax??null,rawMin:r?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,field:t}=this;if("date"!==this.dataType)return{};const i=s(t);if(!i)return e;const{max:l,min:n,rawMax:r,rawMin:u}=e;if("date"===t.type){const{max:e,min:t}=i;return{max:g(l)&&(null===e||null!=e&&l<e)?l:e??null,min:g(n)&&(null===t||null!=t&&n>t)?n:t??null}}if("date-only"===t.type||"time-only"===t.type||"timestamp-offset"===t.type){const{max:e,min:t,rawMax:s,rawMin:a}=i,o=g(l)&&r&&(null==e||l<e),p=g(n)&&u&&(null==t||n>t);return{max:o?l:e,min:p?n:t,rawMax:o?r:s,rawMin:p?u:a}}return{max:null,min:null}}get _configAllowsEdits(){const{element:e,layer:t,name:i}=this;if(null!=e)return e.editableExpression?!!this.evaluatedEditableExpression:!1!==e.editable;if(t?.userHasUpdateItemPrivileges)return!0;const l=t&&"popupTemplate"in t?t?.popupTemplate?.fieldInfos?.find(({fieldName:e})=>e===i):null;return l?.isEditable??!0}get _layerAndFieldAllowEdits(){return this.layerAllowsEdits&&this.field?.editable}get _isVisibleByDefault(){const{field:e,layer:t}=this;return!!e?.visible&&o(e,t)}get _isEditTrackingField(){return p(this.layer).includes(this.name?.toLowerCase())}get _shouldUseValueExpression(){return this._layerAndFieldAllowEdits&&!this._configAllowsEdits&&null!=this.valueExpressionExecutor&&this.valueExpressionExecutor.initialExecutionComplete}get isSubtypeField(){const{layer:e}=this;if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.name}return!1}get valueIsOutOfDomain(){const{domain:e,value:t,field:i}=this;return!(!e||null==t)&&null!==a(i,t,e)}get alias(){return d(this.field,this.layer)}get dataType(){const{field:e}=this;return m(e)?"number":h(e)?"text":c(e)||y(e)?"date":"unsupported"}get dateDataType(){if("date"===this.dataType)return"date"!==this.field.type?"string":"number"}get domain(){const{layer:e,feature:t,name:i,element:l}=this,n=l?.domain;return null!=n&&this._isDomainCompatible(n)?n:e.getFieldDomain(i,{feature:t})}get editable(){return!!this._layerAndFieldAllowEdits&&(this.evaluatedEditableExpression??this._configAllowsEdits)}get evaluatedRequiredExpression(){const{requiredExpressionExecutor:e}=this;return null!=e?!!e.lastEvaluatedValue:null}get evaluatedValueExpression(){const{valueExpressionExecutor:e}=this;return null!=e?e.lastEvaluatedValue:null}get hint(){return this.element?.hint}get includeDate(){return!("date"!==this.dataType||"time-only"===this.field.type)}get includeTime(){const{element:e,field:t}=this;if("date"!==this.dataType)return!1;if("time-only"===t.type)return!0;if("date-only"===t.type)return!1;const i="datetime-picker"===e?.input?.type?e.input.includeTime:void 0;return void 0===i||i}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const e=this.element?.input;return!e||"datetimeoffset-picker"===e.type&&e.includeTimeOffset}set initialFeature(e){this._set("initialFeature",e),this.notifyChange("valid")}get inputType(){return this.element?.input?.type}get hasInvalidSwitchValue(){const{element:e}=this,t=E(e,"switch")?e.input:null;return!t||b(this.value,t)}get isRelationshipKeyField(){const{field:e,layer:t}=this;return x(t)&&!!t.relationships?.some(t=>t.keyField===e.name)}get label(){return this.getFormattedLabel(this.element?.label)||this.alias||this.field.name}get maxLength(){return L({dataType:this.dataType,field:this.field,input:this.element?.input})}get minLength(){return D({dataType:this.dataType,field:this.field,input:this.element?.input})}get name(){return this.field?.name}get range(){const{domain:e,element:t,field:i}=this;if("date"===this.dataType)return this._dateRange;const l=s(i,e)||f(i,e),n=l?.max===Number.MAX_VALUE?null:l?.max??null,r=l?.min===-Number.MAX_VALUE?null:l?.min??null;if(!t?.domain||"range"!==t.domain.type)return{max:n,min:r};const{max:u,min:a}=s(i)||{};return{max:null!=u&&(null===n||null!=n&&u<n)?u:n,min:null!=a&&(null===r||null!=r&&a>r)?a:r}}get required(){const{editable:e,evaluatedRequiredExpression:t,field:i,visible:l,isSubtypeField:n}=this;if(!e)return!1;if(!1===i?.nullable)return!0;if(n)return!0;return!(!l||!1===this.group?.visible||null==t)&&t}set required(e){this._overrideIfSome("required",e)}get showNoValueOptionEnabled(){const{element:e}=this;return!this.required&&(!_(e)||e.input.showNoValueOption)}get showNoValueLabel(){const{element:e}=this;return _(e)?e.input.noValueOptionLabel:null}get submittable(){const{field:e,required:t,valid:i,value:l}=this;return(!t||null!=l)&&(!!i||this.initialFeature.getAttribute(e.name)===l)}get timeResolution(){const e=this.element?.input;if(e&&("datetimeoffset-picker"===e.type||"time-picker"===e.type))return e.timeResolution??"minutes"}get timeStep(){return null!=this.timeResolution?V.get(this.timeResolution):void 0}get updating(){const{editableExpressionExecutor:e,valueExpressionExecutor:t,visibilityExpressionExecutor:i,preservesValueWhenHidden:l}=this;return null!=t&&t.updating||null!=e&&e.updating||!1===l&&null!=i&&i.updating}get valid(){const e=this.editable?this._validate():null;return this._set("error",e),null===e}get value(){if(this._fieldInputWasVisibleDuringLifetime=this._fieldInputWasVisibleDuringLifetime||this.visible&&!1!==this.group?.visible,!1===this.preservesValueWhenHidden&&this._fieldInputWasVisibleDuringLifetime&&(!1===this.visibilityExpressionExecutor?.lastEvaluatedValue||!1===this.group?.visibilityExpressionExecutor?.lastEvaluatedValue))return null!==this._storedValue&&this.set("_storedValue",null),null;if(this._shouldUseValueExpression){const e=this.evaluatedValueExpression;return"date"===this.dataType?this._arcadeOutputToDateFieldValue(e):null!=e&&"object"==typeof e?`${e}`:e}return this._storedValue}set value(e){this.notifyChange("evaluatedVisibilityExpression"),this.set("_storedValue",e),this.notifyChange("value"),this.notifyChange("valid")}get visible(){return!this._isEditTrackingField&&(null!=this.evaluatedVisibilityExpression?this.evaluatedVisibilityExpression:null!=this.element&&!1!==this.field?.visible||this._isVisibleByDefault)}_arcadeOutputToDateFieldValue(e){const i=this.field.type;try{if("object"==typeof e){if(null===e)return null;if(T(e))return w(e,i);if("getTime"in e&&"function"==typeof e.getTime&&"date"===i)return parseInt(e.getTime(),10);if("date-only"===i||"time-only"===i||"timestamp-offset"===i)return e.toString()}else{if("string"==typeof e)return"date"===i?parseInt(e,10):e;if("number"==typeof e&&"date"===i)return e}throw new t("feature-form:invalid-date-value","Date value is invalid")}catch{return"date"===i?NaN:""}}_isDomainCompatible(e){const{field:t}=this;if("coded-value"===e?.type){const i=typeof e.codedValues[0].code;if("string"===i&&h(t)||"number"===i&&m(t))return!0}return!!("range"===e?.type&&m(t)||c(t)||y(t))}_validate(){const{dataType:e,domain:t,field:i,minLength:l,range:n,required:r,value:s,maxLength:u}=this;return M(s,{dataType:e,domain:t,field:i,maxLength:u,minLength:l,range:n,required:r})}};e([n()],O.prototype,"_dateFormRange",null),e([n()],O.prototype,"_dateRange",null),e([n()],O.prototype,"_storedValue",void 0),e([n()],O.prototype,"_configAllowsEdits",null),e([n()],O.prototype,"_layerAndFieldAllowEdits",null),e([n()],O.prototype,"_isVisibleByDefault",null),e([n()],O.prototype,"_isEditTrackingField",null),e([n()],O.prototype,"_shouldUseValueExpression",null),e([n()],O.prototype,"isSubtypeField",null),e([n()],O.prototype,"valueIsOutOfDomain",null),e([n()],O.prototype,"alias",null),e([n()],O.prototype,"dataType",null),e([n()],O.prototype,"dateDataType",null),e([n()],O.prototype,"domain",null),e([n()],O.prototype,"editable",null),e([n({readOnly:!0})],O.prototype,"error",void 0),e([n({constructOnly:!0})],O.prototype,"preservesValueWhenHidden",void 0),e([n()],O.prototype,"evaluatedRequiredExpression",null),e([n()],O.prototype,"evaluatedValueExpression",null),e([n()],O.prototype,"field",void 0),e([n()],O.prototype,"group",void 0),e([n({readOnly:!0})],O.prototype,"hint",null),e([n()],O.prototype,"includeDate",null),e([n()],O.prototype,"includeTime",null),e([n()],O.prototype,"includeTimeOffset",null),e([n()],O.prototype,"initialFeature",null),e([n({readOnly:!0})],O.prototype,"inputType",null),e([n()],O.prototype,"hasInvalidSwitchValue",null),e([n()],O.prototype,"isRelationshipKeyField",null),e([n()],O.prototype,"label",null),e([n()],O.prototype,"maxLength",null),e([n()],O.prototype,"minLength",null),e([n({readOnly:!0})],O.prototype,"name",null),e([n()],O.prototype,"range",null),e([n()],O.prototype,"required",null),e([n()],O.prototype,"requiredExpressionExecutor",void 0),e([n()],O.prototype,"showNoValueOptionEnabled",null),e([n()],O.prototype,"submittable",null),e([n()],O.prototype,"timeResolution",null),e([n()],O.prototype,"timeStep",null),e([n({readOnly:!0})],O.prototype,"type",void 0),e([n()],O.prototype,"updating",null),e([n()],O.prototype,"valid",null),e([n({value:null})],O.prototype,"value",null),e([n()],O.prototype,"valueExpressionExecutor",void 0),e([n()],O.prototype,"visible",null),O=e([r("esri.widgets.FeatureForm.FieldInput")],O);const j=O;export{j as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{watch as i,sync as l}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{getEffectiveFieldAlias as s}from"../../editing/fieldUtils.js";import{getDomainRange as u,dateTimeFieldValuesToNumericRange as a,validateDomainValue as o}from"../../layers/support/domainUtils.js";import{isFieldVisibleByDefault as p,getLowerCaseEditTrackingFields as d,isNumericField as m,isStringField as h,isTimeOnlyField as f,getFieldRange as y}from"../../layers/support/fieldUtils.js";import{isAnyDateField as c}from"../../smartMapping/support/utils.js";import{isNumber as g}from"../../support/guards.js";import{isRelatableFeatureSupportedLayer as x}from"../Feature/support/featureUtils.js";import v from"./EditableInput.js";import{isFieldElementWithInputType as E,valueIsInvalidSwitchValue as b,isFieldElementWithShowNoValueOptionInput as _}from"./featureFormUtils.js";import{timeResolutionToStepMap as V,isArcadeDate as T,arcadeDateToFieldValue as w}from"../support/dateUtils.js";import{dateIsValid as F,getMaxLength as L,getMinLength as D,validateFormValue as j}from"../support/forms/formUtils.js";let M=class extends v{constructor(e){super(e),this._storedValue=null,this.error=null,this.preservesValueWhenHidden=!0,this.field=null,this.group=null,this.requiredExpressionExecutor=null,this.type="field",this._fieldInputWasVisibleDuringLifetime=!1,this.valueExpressionExecutor=null}initialize(){this.addHandles(i(()=>this.feature,()=>this._fieldInputWasVisibleDuringLifetime=!1,l))}get _dateFormRange(){const{element:e,field:t}=this;if("date"!==this.dataType)return{};const i=e?.domain?u(t,e.domain):null;if(!e?.input)return i??{};const l=e.input,{type:n}=l;let r={};if("date-picker"!==n&&"time-picker"!==n&&"datetimeoffset-picker"!==n||(r=a(t,l.max,l.min)),"datetime-picker"===n){const{max:e,min:t}=l;r={max:null!=e&&F(e)?e.getTime():null,min:null!=t&&F(t)?t.getTime():null}}const{max:s,min:o}=r;if(i){const{max:e,min:t}=i,l=g(e)&&(null==s||null!=s&&e<s),n=g(t)&&(null==o||null!=o&&t>o);return{max:l?e:s??null,min:n?t:o??null,rawMax:l?i.rawMax:r?.rawMax??null,rawMin:n?i.rawMin:r?.rawMin??null}}return{min:o,max:s,rawMax:r?.rawMax??null,rawMin:r?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,field:t}=this;if("date"!==this.dataType)return{};const i=u(t);if(!i)return e;const{max:l,min:n,rawMax:r,rawMin:s}=e;if("date"===t.type){const{max:e,min:t}=i;return{max:g(l)&&(null===e||null!=e&&l<e)?l:e??null,min:g(n)&&(null===t||null!=t&&n>t)?n:t??null}}if("date-only"===t.type||"time-only"===t.type||"timestamp-offset"===t.type){const{max:e,min:t,rawMax:u,rawMin:a}=i,o=g(l)&&r&&(null==e||l<e),p=g(n)&&s&&(null==t||n>t);return{max:o?l:e,min:p?n:t,rawMax:o?r:u,rawMin:p?s:a}}return{max:null,min:null}}get _configAllowsEdits(){const{element:e,layer:t,name:i}=this;if(null!=e)return e.editableExpression?!!this.evaluatedEditableExpression:!1!==e.editable;if(t?.userHasUpdateItemPrivileges)return!0;const l=t&&"popupTemplate"in t?t?.popupTemplate?.fieldInfos?.find(({fieldName:e})=>e===i):null;return l?.isEditable??!0}get _layerAndFieldAllowEdits(){return this.layerAllowsEdits&&this.field?.editable}get _isVisibleByDefault(){const{field:e,layer:t}=this;return!!e?.visible&&p(e,t)}get _isEditTrackingField(){return d(this.layer).includes(this.name?.toLowerCase())}get _shouldUseValueExpression(){return this._layerAndFieldAllowEdits&&!this._configAllowsEdits&&null!=this.valueExpressionExecutor&&this.valueExpressionExecutor.initialExecutionComplete}get isSubtypeField(){const{layer:e}=this;if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.name}return!1}get valueIsOutOfDomain(){const{domain:e,value:t,field:i}=this;return!(!e||null==t)&&null!==o(i,t,e)}get alias(){return s(this.field,this.layer)}get dataType(){const{field:e}=this;return m(e)?"number":h(e)?"text":c(e)||f(e)?"date":"unsupported"}get dateDataType(){if("date"===this.dataType)return"date"!==this.field.type?"string":"number"}get domain(){const{layer:e,feature:t,name:i,element:l}=this,n=l?.domain;return null!=n&&this._isDomainCompatible(n)?n:e.getFieldDomain(i,{feature:t})}get editable(){return!!this._layerAndFieldAllowEdits&&(this.evaluatedEditableExpression??this._configAllowsEdits)}get evaluatedRequiredExpression(){const{requiredExpressionExecutor:e}=this;return null!=e?!!e.lastEvaluatedValue:null}get evaluatedValueExpression(){const{valueExpressionExecutor:e}=this;return null!=e?e.lastEvaluatedValue:null}get hint(){return this.element?.hint}get includeDate(){return!("date"!==this.dataType||"time-only"===this.field.type)}get includeTime(){const{element:e,field:t}=this;if("date"!==this.dataType)return!1;if("time-only"===t.type)return!0;if("date-only"===t.type)return!1;const i="datetime-picker"===e?.input?.type?e.input.includeTime:void 0;return void 0===i||i}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const e=this.element?.input;return!e||"datetimeoffset-picker"===e.type&&e.includeTimeOffset}set initialFeature(e){this._set("initialFeature",e),this.notifyChange("valid")}get inputType(){return this.element?.input?.type}get hasInvalidSwitchValue(){const{element:e}=this,t=E(e,"switch")?e.input:null;return!t||b(this.value,t)}get isRelationshipKeyField(){const{field:e,layer:t}=this;return x(t)&&!!t.relationships?.some(t=>t.keyField===e.name)}get label(){return this.getFormattedLabel(this.element?.label)||this.alias||this.field.name}get maxLength(){return L({dataType:this.dataType,field:this.field,input:this.element?.input})}get minLength(){return D({dataType:this.dataType,field:this.field,input:this.element?.input})}get name(){return this.field?.name}get range(){const{domain:e,element:t,field:i}=this;if("date"===this.dataType)return this._dateRange;const l=u(i,e)||y(i,e),n=l?.max===Number.MAX_VALUE?null:l?.max??null,r=l?.min===-Number.MAX_VALUE?null:l?.min??null;if(!t?.domain||"range"!==t.domain.type)return{max:n,min:r};const{max:s,min:a}=u(i)||{};return{max:null!=s&&(null===n||null!=n&&s<n)?s:n,min:null!=a&&(null===r||null!=r&&a>r)?a:r}}get required(){const{editable:e,evaluatedRequiredExpression:t,field:i,visible:l,isSubtypeField:n}=this;if(!e)return!1;if(!1===i?.nullable)return!0;if(n)return!0;return!(!l||!1===this.group?.visible||null==t)&&t}set required(e){this._overrideIfSome("required",e)}get showNoValueOptionEnabled(){const{element:e}=this;return!this.required&&(!_(e)||e.input.showNoValueOption)}get showNoValueLabel(){const{element:e}=this;return _(e)?e.input.noValueOptionLabel:null}get submittable(){const{field:e,required:t,valid:i,value:l}=this;return(!t||null!=l)&&(!!i||this.initialFeature.getAttribute(e.name)===l)}get timeResolution(){const e=this.element?.input;if(e&&("datetimeoffset-picker"===e.type||"time-picker"===e.type))return e.timeResolution??"minutes"}get timeStep(){return null!=this.timeResolution?V.get(this.timeResolution):void 0}get updating(){const{editableExpressionExecutor:e,valueExpressionExecutor:t,visibilityExpressionExecutor:i,preservesValueWhenHidden:l}=this;return null!=t&&t.updating||null!=e&&e.updating||!1===l&&null!=i&&i.updating}get valid(){const e=this.editable?this._validate():null;return this._set("error",e),null===e}get value(){if(this._fieldInputWasVisibleDuringLifetime=this._fieldInputWasVisibleDuringLifetime||this.visible&&!1!==this.group?.visible,!1===this.preservesValueWhenHidden&&this._fieldInputWasVisibleDuringLifetime&&(!1===this.visibilityExpressionExecutor?.lastEvaluatedValue||!1===this.group?.visibilityExpressionExecutor?.lastEvaluatedValue))return null!==this._storedValue&&this.set("_storedValue",null),null;if(this._shouldUseValueExpression){const e=this.evaluatedValueExpression;return"date"===this.dataType?this._arcadeOutputToDateFieldValue(e):null!=e&&"object"==typeof e?`${e}`:e}return this._storedValue}set value(e){this.notifyChange("evaluatedVisibilityExpression"),this.set("_storedValue",e),this.notifyChange("value"),this.notifyChange("valid")}get visible(){return!this._isEditTrackingField&&(null!=this.evaluatedVisibilityExpression?this.evaluatedVisibilityExpression:null!=this.element&&!1!==this.field?.visible||this._isVisibleByDefault)}_arcadeOutputToDateFieldValue(e){const i=this.field.type;try{if("object"==typeof e){if(null===e)return null;if(T(e))return w(e,i);if("getTime"in e&&"function"==typeof e.getTime&&"date"===i)return parseInt(e.getTime(),10);if("date-only"===i||"time-only"===i||"timestamp-offset"===i)return e.toString()}else{if("string"==typeof e)return"date"===i?parseInt(e,10):e;if("number"==typeof e&&"date"===i)return e}throw new t("feature-form:invalid-date-value","Date value is invalid")}catch{return"date"===i?NaN:""}}_isDomainCompatible(e){const{field:t}=this;if("coded-value"===e?.type){const i=typeof e.codedValues[0].code;if("string"===i&&h(t)||"number"===i&&m(t))return!0}return!!("range"===e?.type&&m(t)||c(t)||f(t))}_validate(){const{dataType:e,domain:t,field:i,minLength:l,range:n,required:r,value:s,maxLength:u}=this;return j(s,{dataType:e,domain:t,field:i,maxLength:u,minLength:l,range:n,required:r})}};e([n()],M.prototype,"_dateFormRange",null),e([n()],M.prototype,"_dateRange",null),e([n()],M.prototype,"_storedValue",void 0),e([n()],M.prototype,"_configAllowsEdits",null),e([n()],M.prototype,"_layerAndFieldAllowEdits",null),e([n()],M.prototype,"_isVisibleByDefault",null),e([n()],M.prototype,"_isEditTrackingField",null),e([n()],M.prototype,"_shouldUseValueExpression",null),e([n()],M.prototype,"isSubtypeField",null),e([n()],M.prototype,"valueIsOutOfDomain",null),e([n()],M.prototype,"alias",null),e([n()],M.prototype,"dataType",null),e([n()],M.prototype,"dateDataType",null),e([n()],M.prototype,"domain",null),e([n()],M.prototype,"editable",null),e([n({readOnly:!0})],M.prototype,"error",void 0),e([n({constructOnly:!0})],M.prototype,"preservesValueWhenHidden",void 0),e([n()],M.prototype,"evaluatedRequiredExpression",null),e([n()],M.prototype,"evaluatedValueExpression",null),e([n()],M.prototype,"field",void 0),e([n()],M.prototype,"group",void 0),e([n({readOnly:!0})],M.prototype,"hint",null),e([n()],M.prototype,"includeDate",null),e([n()],M.prototype,"includeTime",null),e([n()],M.prototype,"includeTimeOffset",null),e([n()],M.prototype,"initialFeature",null),e([n({readOnly:!0})],M.prototype,"inputType",null),e([n()],M.prototype,"hasInvalidSwitchValue",null),e([n()],M.prototype,"isRelationshipKeyField",null),e([n()],M.prototype,"label",null),e([n()],M.prototype,"maxLength",null),e([n()],M.prototype,"minLength",null),e([n({readOnly:!0})],M.prototype,"name",null),e([n()],M.prototype,"range",null),e([n()],M.prototype,"required",null),e([n()],M.prototype,"requiredExpressionExecutor",void 0),e([n()],M.prototype,"showNoValueOptionEnabled",null),e([n()],M.prototype,"submittable",null),e([n()],M.prototype,"timeResolution",null),e([n()],M.prototype,"timeStep",null),e([n({readOnly:!0})],M.prototype,"type",void 0),e([n()],M.prototype,"updating",null),e([n()],M.prototype,"valid",null),e([n({value:null})],M.prototype,"value",null),e([n()],M.prototype,"valueExpressionExecutor",void 0),e([n()],M.prototype,"visible",null),M=e([r("esri.widgets.FeatureForm.FieldInput")],M);const O=M;export{O as default};
|
package/widgets/FeatureForm.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import"../core/has.js";import i from"../core/Logger.js";import{createResolver as o}from"../core/promiseUtils.js";import s from"../core/ReactiveMap.js";import{watch as n,initial as a,whenOnce as r}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as c}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as u,getSubtypesFromLayer as p}from"../layers/support/layerUtils.js";import{isString as m}from"../support/guards.js";import h from"./Widget.js";import{Prompt as v}from"./Editor/components/Prompt.js";import{isRelatableFeatureSupportedLayer as _}from"./Feature/support/featureUtils.js";import{css as g}from"./FeatureForm/css.js";import{isGroupInput as b,isFieldInput as f,isRelationshipInput as y,isTextElementInput as C,isUtilityNetworkAssociationInput as F,flattenInputs as w,isInputInGroupInput as R,isFieldElementWithInputType as k,getErrorMessageForFieldInput as I,getIconForFeature as O,isNumberFieldInput as N,isInputInThisGroupInput as M,subtypeChangeShouldPrompt as L}from"./FeatureForm/featureFormUtils.js";import T from"./FeatureForm/FeatureFormViewModel.js";import A from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as x}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as D,getIntlOptionsForField as V,numberingSystem as S,prepareISOFieldValueForDateComponents as U,prepareUnixFieldValueForDateComponents as E,normalizeTimeOnlyString as j,getISOFieldValueFromDateComponents as $,getUnixFieldValueFromDateComponents as P}from"./support/dateUtils.js";import{globalCss as G}from"./support/globalCss.js";import{Heading as H,incrementHeadingLevel as W}from"./support/Heading.js";import{setFocus as Z}from"./support/widgetUtils.js";import{messageBundle as B}from"./support/decorators/messageBundle.js";import{vmEvent as K}from"./support/decorators/vmEvent.js";import{tsx as q}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as z}from"../intl/substitute.js";import{formatNumber as J}from"../intl/number.js";const Q="data-field-name";let X=class extends h{constructor(e,t){super(e,t),this._associationsWidgetsMap=new s,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()},{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new T,this.visibleElements=new A,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,callbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,i)=>{const{feature:o,callbacks:s}=this;let n=i;if(o&&s?.addRelatedRecord){if(u(i)&&e.activeCategory){const t=e.activeCategory.value,o=i.findSublayerForSubtypeCode(t);o&&_(o)&&(n=o)}s.addRelatedRecord({parentFeature:o,relatedLayer:n,relationshipId:t})}},this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),this._afterGroupCreate=this._afterGroupCreate.bind(this)}initialize(){this.addHandles([n(()=>this.feature,()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),r(()=>!this.viewModel.updating).then(()=>{const e=this._getFocusableInput("forward");this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0})}),n(()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails],([e,t])=>{e&&(e.visibleElements.associationDetails=t)},a),n(()=>this.groupDisplay,()=>this._syncGroupInputStates()),this.on("submit",e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach(e=>this._inputsWithChanges.add(e)),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}}),n(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),n(()=>this.viewModel.activeAssociationInput,e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)}),n(()=>this.viewModel.inputs.filter(F),async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))})])}loadDependencies(){return x({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){const{callbacks:e}=this;return!(!e?.viewAssociatedLayers||!e.viewAssociatedFeatures)}get _subtypes(){return p(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get icon(){return"form-field"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return q("div",{class:this.classes(g.base,G.widget,G.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return q("div",null,q("form",{class:g.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderReadOnlyNotice(),this._renderHeader(),this._renderContent()),this._prompt?q(v,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderReadOnlyNotice(){const{disabled:e,messages:t}=this;if(e&&this.visibleElements.readOnlyNotice)return q("calcite-notice",{class:g.disabledNotice,icon:"read-only-non-editable",kind:"brand",open:!0,scale:"s",width:"full"},q("div",{slot:"message"},t.disabledForm))}_renderHeader(){const e=this.viewModel,{formTitle:t,formDescription:i}=e;if(!e.formHeaderVisible)return;const o=null!=t&&q(H,{key:"title",level:this.headingLevel},t),s=null!=i&&q("p",{class:g.description,key:"description"},i);return q("div",{class:g.formHeader},o,s)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(t).filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){return b(e)?this._renderGroup(e):f(e)?this._renderLabeledField(e):y(e)?this._renderRelationshipInput(e):C(e)?this._renderTextElementInput(e):F(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){const{feature:t,callbacks:i}=this;t&&i?.viewAssociatedFeatures&&i.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){const{feature:t,callbacks:i}=this;t&&i?.selectAssociatedFeature&&await i.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){const{feature:t,callbacks:i}=this;t&&i?.addAssociation&&i.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({onSelectAssociationType:({viewModel:t,listType:i})=>{t.activeAssociationType=i;const{feature:o,callbacks:s}=this;o&&s?.viewAssociatedLayers&&s.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return null==e?null:q("div",{class:this.classes(g.description),id:t},e)}_renderGroup(e){const{formTemplate:t,headingLevel:i}=this,{description:o,id:s,inputs:n,label:a,open:r}=e,l=n.filter(e=>e.visible),d=this.viewModel.findField(this._focusedFieldName),c=d?.group===e,u="sequential"===this.groupDisplay;return q("calcite-block",{afterCreate:this._afterGroupCreate,class:this.classes(g.group,u?g.groupSequential:null,c?g.groupActive:null),collapsible:!0,"data-group":e,description:o||void 0,expanded:r,heading:a??"",headingLevel:t?.title?W(i):i,id:s,key:s,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},l.map(e=>this._renderInput(e)))}_getFocusableInput(e,t){const i=w(this.viewModel.inputs);let o;if("backward"===e&&i.reverse(),t)if(b(t)){const e=t.inputs.find(e=>e.visible);o=e?i.indexOf(e):0}else{let s;if(R(t)&&!t.group.open){const i=t.group.inputs.filter(f);s="forward"===e?i[i.length-1]:i[0]}else s=t;o=i.indexOf(s)+1}else o=0;for(let s=o;s<i.length;s++){const e=i[s];if(e.visible&&f(e)){if(this.disabled&&e.inputType&&("switch"===e.inputType||"radio-buttons"===e.inputType))continue;return e}}return null}_renderLabeledField(e){const{dataType:t,feature:i,label:o,layer:s,required:n}=e,a={"aria-label":n?z(this.messages.requiredFieldLabel,{name:o}):o,class:g.label,key:`${s.id}-${i.uid}-${e.name}`},r=[q("div",{class:g.labelTextContent,key:"labelTextContainer"},o,n?q("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==t?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)];return"date"===t&&"coded-value"!==e.domain?.type?q("label",{...a},r):q("calcite-label",{...a},r)}_renderFieldInput(e){const{dataType:t,domain:i,inputType:o,name:s}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){const t=this.viewModel.getFieldValueOptionsForField(s,this.messages.empty);return"switch"!==o||e.hasInvalidSwitchValue?"radio-buttons"===o?this._renderRadioButtonComponents(e,t.flat(),n):this._renderComboBoxComponent(e,t,n):this._renderSwitchComponent(e,n)}return"datetime-picker"===o||"date"===t?this._renderDateComponents(e,n):"number"===t?this._renderNumberComponent(e,n):this._renderStringComponent(e,n)}_renderStringComponent(e,t){return"text-area"===e.inputType?t.readOnly?q("calcite-input",{...t,loading:e.updating,type:"textarea",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)}):q("calcite-text-area",{...t,resize:"vertical",onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):q("calcite-input",{...t,loading:e.updating,type:"text",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){const i=c(e.field),o=i&&""!==t.value?Math.round(parseFloat(t.value)).toString():t.value;return q("calcite-input-number",{...t,integer:i,loading:e.updating,type:"number",value:o,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){const{field:i}=e;switch(i.type){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,D(i,t.value,{timeZone:this.timeZone,...V(i)}))}}_renderDateOnlyFieldComponent(e,t){const{range:i,valid:o,value:s}=e,{class:n,key:a,readOnly:r}=t,{rawMax:l,rawMin:d}=i;return q("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!o,class:n,"data-date-part":"date","data-field-name":t[Q],key:`${a}-date-input`,max:m(l)?l:void 0,min:m(d)?d:void 0,numberingSystem:S,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:r,value:null!=s?`${s}`:void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{valid:i,value:o}=e,{class:s,key:n,readOnly:a}=t;return q("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,class:s,"data-date-part":"time","data-field-name":t[Q],key:`${n}-time-input`,numberingSystem:S,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,step:e.timeStep,value:null!=o?`${o}`:void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{name:i,range:o,timeZone:s,valid:n,value:a}=e,{class:r,key:l,readOnly:d}=t,{rawMax:c,rawMin:u}=o,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,numberingSystem:S,overlayPositioning:"fixed",readOnly:d,[Q]:i,onfocus:this._onComponentFocus},m=U(c,s),h=U(u,s),v=U(a,s);return q("div",{class:g.dateInputContainer,key:`${l}-date-time-container`},q("calcite-input-date-picker",{...p,class:r,"data-date-part":"date",key:`${l}-date-input`,max:m?.date??void 0,min:h?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),q("calcite-input-time-picker",{...p,class:r,"data-date-part":"time",key:`${l}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:e.timeStep,value:v.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?q("calcite-input-time-zone",{...p,class:r,"data-date-part":"timeZone",disabled:d,key:`${l}-timezone-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.timeZoneOffset??"0",onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){const{includeTime:i,name:o,valid:s,value:n}=e,{class:a,key:r,max:l,min:d,readOnly:c}=t,{timeZone:u}=this,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!s,numberingSystem:S,overlayPositioning:"fixed",readOnly:c,[Q]:o,onfocus:this._onComponentFocus},m=E(n,u),h=E(l,u),v=E(d,u);return q("div",{class:g.dateInputContainer,key:`${r}-date-time-container`},q("calcite-input-date-picker",{...p,class:a,"data-date-part":"date",key:`${r}-date-input`,max:h?.date??void 0,min:v?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:m.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),i?q("calcite-input-time-picker",{...p,class:a,"data-date-part":"time",key:`${r}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:1,value:m.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return q("calcite-input",{...i,class:this.classes(g.fieldInput,g.inputDisabled),readOnly:!0,type:"text",value:null!=t?`${t}`:i.value})}_renderComboBoxComponent(e,t,i){const{value:o,name:s}=e,{viewModel:n,_inputsWithChanges:a}=this,r="INSERT"===n.editType,l=a.has(s),d=null==o&&(!r||l),c=r&&e.showNoValueOptionEnabled&&!l?()=>{}:i.onblur;return q("calcite-combobox",{...i,allowCustomValues:!1,clearDisabled:!0,onblur:c,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{d&&0===t.selectedItems.length?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){const{value:i,name:o}=e,{messages:s,messagesTemplates:n,viewModel:a,_inputsWithChanges:r}=this,[l,d,c]=t.map(e=>e.map(({name:e,value:t})=>q("calcite-combobox-item",{key:`#${t}`,selected:i===t,textLabel:e,value:`${t}`}))),u=[];d.length>0&&u.push(q("calcite-combobox-item-group",{key:"other",label:n.other},d)),c.length>0&&u.push(q("calcite-combobox-item-group",{key:"unsupported",label:s.subtypes.unsupportedDomainGroupTitle},c)),u.length>0?u.unshift(q("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):u.push(...l);const p="INSERT"===a.editType,m=r.has(o),h=null==i&&(!p||m);return e.showNoValueOptionEnabled&&u.unshift(q("calcite-combobox-item",{key:"empty-option",selected:h,textLabel:e.showNoValueLabel||s.empty,value:""})),u}_renderRadioButtonComponents(e,t,i){const{name:o,value:s}=e,n=t.map(({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:o,value:t,selected:t===s,props:i}));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,r=s===t||null===s;n.unshift(this._renderRadioButtonComponent({key:"empty-option",label:a,name:o,value:t,selected:r,props:i}))}return q("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:g.inputRadioGroup,"data-field-name":i[Q],key:`${i.key}-radio-group`,layout:"vertical",name:i.key,required:i.required},n)}_renderSwitchComponent(e,t){const{value:i}=e,o=!!k(e.element,"switch")&&i===e.element.input.onValue;return q("calcite-switch",{...t,checked:o,class:g.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:o,label:s,props:n}){return q("calcite-label",{class:g.inputRadioLabel,key:e,layout:"inline"},q("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:o,class:g.inputRadio,disabled:n.readOnly,name:t,onblur:()=>{this._focusedFieldName=null},value:i,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.submittable?I(e,this.messages,this.timeZone):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?q("calcite-input-message",{icon:!0,status:"invalid"},i):this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?q("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;const t=this.messages;return q("calcite-list-item",{description:z(t.totalCount,{count:e.featureCount}),key:"show-all-related-features",label:t.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},q("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:o,editable:s}=e,{messages:n,callbacks:a,disabled:r}=this,l=!s||r;if(t&&a?.addRelatedRecord&&o&&!l)return q("calcite-button",{alignment:"center",appearance:"outline-fill",class:g.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:"plus",key:`${i}-add-button`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,i,o)},round:!0,scale:"s",width:"full"},e.relatedLayerIsTable?n.addRecord:n.addFeature)}_renderRelatedRecordListItem(e,t,i){const{feature:o,description:s,title:n}=e,{feature:a,callbacks:r}=this,{highlightHelper:l}=this.viewModel,d=()=>{l?.removeAll(),r?.editRelatedRecord&&a&&r.editRelatedRecord({parentFeature:a,relationshipId:t,relatedFeature:o,readOnly:i})},c=l?()=>l.add(o):void 0,u=l?()=>l.remove(o):void 0;return q("calcite-list-item",{bind:this,description:s,key:`${t}-${o.uid}`,label:n,onmouseenter:c,onmouseleave:u,value:n,onCalciteListItemSelect:d},q("calcite-icon",{icon:O(o),slot:"content-start"}),q("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled)return;const{relationshipId:t,activeCategory:i}=e,o=i?null:this._renderDescriptionOrEmpty(e.description);return q("calcite-label",{class:this.classes(g.label,g.relatedRecordsLabel),key:`relationship-${t}-container`},q("div",null,this._renderRelatedRecordsHeaderContainer(e),o,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){return e.featureCount>0?this._renderRelatedRecordsList(e):e.activeCategory&&0===e.featureCount?this._renderNoRelatedRecordsNotice():e.allCategories?.length?this._renderCategoryList(e):e.loaded?e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e):void 0}_renderCategoryList(e){return q("calcite-list",{displayMode:"flat",label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map(t=>this._renderCategory(e,t)),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){const{count:i,name:o,value:s}=t,n=J(i);return q("calcite-list-item",{key:`${o}-${s}`,label:o,onCalciteListItemSelect:()=>this._selectCategory(e,t)},q("calcite-chip",{label:n,scale:"s",slot:"content-end"},n),q("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:"s",slot:"content-end"}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;const t=this.messages;return q("calcite-list-item",{description:z(t.totalCount,{count:e.allCategories?.length??0}),key:"show-all-categories",label:t.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},q("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return q("div",{class:g.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},q("span",null,e.label),t?q("calcite-loader",{inline:!0,key:"loader",label:this.messagesCommon?.loading,scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t,editable:i}=e,{disabled:o}=this,s=!i||o;return q("calcite-list",{class:g.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map(e=>this._renderRelatedRecordListItem(e,t,s)),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){const{messages:t}=this,i=e.relatedLayerIsTable?t.noOriginKeyRecord:t.noOriginKeyFeature,o=e.relationship?.keyField,s=this.viewModel.findField(o),n=e.layer?.fieldsIndex.get(o),a=s?.label||n?.alias||o,r=z(i,{relatedLayerName:e.relatedLayer?.title,originKeyField:a});return q("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},q("div",{slot:"message"},r))}_renderNoRelatedRecordsNotice(){return q("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},q("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return q("div",{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:g.listObserver,key:"feature-observer"})}_renderTextElementInput(e){return q("div",{class:g.textElement,"data-testid":`text-element-${e.label}`,innerHTML:e.text,key:e.id})}getCommonInputProps(e){const{disabled:t}=this,{editable:i,hint:o,label:s,maxLength:n,minLength:a,name:r,range:{max:l,min:d},required:c,valid:u,value:p}=e,m=this._inputsWithChanges.has(r),h=!i||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":u?"false":"true",class:this.classes(g.fieldInput,h?g.inputDisabled:null),status:m&&!u?"invalid":"idle",key:r,label:s,max:null!=l?l:void 0,min:null!=d?d:void 0,maxLength:n>-1?n:void 0,minLength:a>-1?a:void 0,placeholder:o??void 0,readOnly:h,required:c,value:null==p?"":`${p}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[Q]:r}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(Q))}_afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e),i=e.dataset.datePart,o=this._dateComponentMap.get(t.name);if("valueAsDate"in e&&null!=e.value&&null!=t.value){const i=new ResizeObserver(()=>{switch(e.value=void 0,t.field.type){case"date":e.value=E(t.value,this.timeZone).date??"";break;case"timestamp-offset":e.value=U(t.value,this.timeZone).date??"";break;default:e.value=`${t.value}`}i.unobserve(e)});i.observe(e)}if(null!=o)switch(i){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}else this._dateComponentMap.set(t.name,{[i]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);N(t)&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),o=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&o===i&&(this._attemptFocusOnNextRender=!1,R(i)&&(i.group.open=!0),Z(e))}async _afterGroupCreate(e){const t=this.viewModel.findGroup(e.id),i=this.viewModel.findField(this._focusedFieldName);i&&t&&M(i,t)&&(!i.editable||this.disabled)&&(await e.componentOnReady(),this._attemptFocusOnNextRender=!0,this.scheduleRender())}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name}_onComponentBlur(e){const t=e.target;this._focusedFieldName=null;"readOnly"in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){const{timeZone:t}=this,i=this._getFieldInputFromHTMLElement(e),o=i.field.type,{name:s,range:n}=i,a=this._dateComponentMap.get(s);if(!a)return;let r=this.viewModel.getValue(s),l=null;"date-only"===o?l=Array.isArray(e.value)?e.value[0]:e.value:"time-only"===o?(r=j(r),l=j(e.value)):l="timestamp-offset"===o?null!=e.value?$({dateComponent:a.date,timeComponent:a.time,timeZoneComponent:a.timeZone,oldValue:r,defaultTimeZone:t}):null:null!=e.value?P({oldValue:r,dateComponent:a.date,timeComponent:a.time,timeZone:t,max:n.max,min:n.min}):null,null!==l&&e.value?r!==l&&this._updateFieldValue(s,l):this._updateFieldValue(s,null)}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e),i=this._parseValue(e),o=t.value;t.isSubtypeField&&L(this.layer,o,i)?this._pendingSubtypeChoice||i===o||(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,i)):this._updateFieldValue(t.name,i)}async _handleSubtypeChoice(e,t){const{value:i,name:s}=e,{messages:n,viewModel:a,messagesCommon:r,_subtypes:l}=this;if(this._updateFieldValue(s,t),!l?.length)return;const d=l.find(e=>e.code===t),c=l.find(e=>e.code===i)?.name??`${i}`;if(!d)return;const u=o();a.pendingSubtypeChoice=u;let p="update-fields";const m=[{label:n.subtypes.useDefaultValuesOption,value:"update-fields"},{label:n.subtypes.keepCurrentValuesOption,value:"keep-existing"}],h={context:"info",title:n.subtypes.changeWarningTitle,message:z(n.subtypes.changeWarning,{originalType:c,newType:d.name}),radios:m,defaultRadioSelection:"update-fields",onRadioSelection:e=>p=e,actions:{primary:{label:r.apply,action:()=>u.resolve(p),type:"positive"},secondary:{label:r.cancel,type:"neutral",action:()=>u.resolve("undo")}},cancel:()=>u.reject()};try{this.showPrompt(h);switch(await u.promise){case"update-fields":a.applySubtypeDefaults(d),this._validateContingenciesForNonNullFields();break;case"keep-existing":this._validateContingenciesForNonNullFields();break;case"undo":this._updateFieldValue(e.name,i)}}finally{a.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){const i=this._getFieldInputFromHTMLElement(t);"Enter"===e&&R(i)&&!i.group.open&&(i.group.open=!0)}_updateFieldValue(e,t){const i=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e);i!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){const e=Object.fromEntries(Object.entries(this.getValues()).filter(([e,t])=>null!=t));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;return k(t.element,"switch")?e.checked?t.element.input.onValue:t.element.input.offValue:null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:o}=e;0===o.length&&t&&"selected"in t?t.selected=!0:i.getLogger(this).warnOnce("Failed to override user attempt to deselect 'No value' option.")}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._focusedFieldName=this._getFocusableInput("forward",t)?.name||null,this._attemptFocusOnNextRender=!0,"sequential"===this.groupDisplay&&this.viewModel.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.allGroupInputs;if(!e.length)return;const t=e.filter(e=>e.open);0===t.length?e[0].open=!0:t.length>1&&t.slice(1).forEach(e=>e.open=!1)}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([l()],X.prototype,"_listObserverNode",void 0),e([l()],X.prototype,"_relatedRecordsEnabled",null),e([l()],X.prototype,"_utilityNetworkAssociationsEnabled",null),e([l()],X.prototype,"_prompt",void 0),e([l()],X.prototype,"_subtypes",null),e([l()],X.prototype,"associationId",null),e([l()],X.prototype,"associatedLayer",null),e([l()],X.prototype,"disabled",null),e([l()],X.prototype,"feature",null),e([l()],X.prototype,"_featureFormUNAssociationList",void 0),e([l()],X.prototype,"formTemplate",null),e([l()],X.prototype,"groupDisplay",void 0),e([l()],X.prototype,"headingLevel",void 0),e([l()],X.prototype,"icon",null),e([l()],X.prototype,"label",null),e([l()],X.prototype,"layer",null),e([l()],X.prototype,"map",null),e([l(),B("esri/widgets/FeatureForm/t9n/FeatureForm")],X.prototype,"messages",void 0),e([l(),B("esri/t9n/common")],X.prototype,"messagesCommon",void 0),e([l(),B("esri/widgets/Feature/t9n/Feature")],X.prototype,"messagesFeature",void 0),e([l(),B("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],X.prototype,"messagesTemplates",void 0),e([l()],X.prototype,"callbacks",null),e([l()],X.prototype,"relationshipId",null),e([l()],X.prototype,"spatialReference",null),e([l()],X.prototype,"strict",null),e([l()],X.prototype,"timeZone",null),e([l()],X.prototype,"showPrompt",null),e([l()],X.prototype,"clearPrompt",null),e([l(),K(["value-change","submit"])],X.prototype,"viewModel",void 0),e([l({type:A,nonNullable:!0})],X.prototype,"visibleElements",void 0),e([l()],X.prototype,"test",null),X=e([d("esri.widgets.FeatureForm")],X);const Y=X;export{Y as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import"../core/has.js";import i from"../core/Logger.js";import{createResolver as o}from"../core/promiseUtils.js";import s from"../core/ReactiveMap.js";import{watch as n,whenOnce as a,initial as r}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as c}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as u,getSubtypesFromLayer as p}from"../layers/support/layerUtils.js";import{isString as m}from"../support/guards.js";import h from"./Widget.js";import{Prompt as v}from"./Editor/components/Prompt.js";import{isRelatableFeatureSupportedLayer as _}from"./Feature/support/featureUtils.js";import{css as g}from"./FeatureForm/css.js";import{isUtilityNetworkAssociationInput as b,isGroupInput as f,isFieldInput as y,isRelationshipInput as C,isTextElementInput as F,flattenInputs as w,isInputInGroupInput as R,isFieldElementWithInputType as k,getErrorMessageForFieldInput as I,getIconForFeature as O,isNumberFieldInput as N,isInputInThisGroupInput as M,subtypeChangeShouldPrompt as L}from"./FeatureForm/featureFormUtils.js";import T from"./FeatureForm/FeatureFormViewModel.js";import A from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as x}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as D,getIntlOptionsForField as V,numberingSystem as S,prepareISOFieldValueForDateComponents as U,prepareUnixFieldValueForDateComponents as E,normalizeTimeOnlyString as j,getISOFieldValueFromDateComponents as $,getUnixFieldValueFromDateComponents as P}from"./support/dateUtils.js";import{globalCss as G}from"./support/globalCss.js";import{Heading as H,incrementHeadingLevel as W}from"./support/Heading.js";import{setFocus as Z}from"./support/widgetUtils.js";import{messageBundle as B}from"./support/decorators/messageBundle.js";import{vmEvent as K}from"./support/decorators/vmEvent.js";import{tsx as q}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as z}from"../intl/substitute.js";import{formatNumber as J}from"../intl/number.js";const Q="data-field-name";let X=class extends h{constructor(e,t){super(e,t),this._associationsWidgetsMap=new s,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()},{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new T,this.visibleElements=new A,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,callbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,i)=>{const{feature:o,callbacks:s}=this;let n=i;if(o&&s?.addRelatedRecord){if(u(i)&&e.activeCategory){const t=e.activeCategory.value,o=i.findSublayerForSubtypeCode(t);o&&_(o)&&(n=o)}s.addRelatedRecord({parentFeature:o,relatedLayer:n,relationshipId:t})}},this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),this._afterGroupCreate=this._afterGroupCreate.bind(this)}initialize(){this.addHandles([n(()=>this.feature,()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),a(()=>!this.viewModel.updating).then(()=>{const e=this._getFocusableInput("forward");this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0})}),n(()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails],([e,t])=>{e&&(e.visibleElements.associationDetails=t)},r),n(()=>this.groupDisplay,()=>this._syncGroupInputStates()),this.on("submit",e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach(e=>this._inputsWithChanges.add(e)),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}}),n(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),n(()=>this.viewModel.activeAssociationInput,e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)}),n(()=>this.viewModel.inputs.filter(b),async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))})])}loadDependencies(){return x({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){const{callbacks:e}=this;return!(!e?.viewAssociatedLayers||!e.viewAssociatedFeatures)}get _subtypes(){return p(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get icon(){return"form-field"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return q("div",{class:this.classes(g.base,G.widget,G.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return q("div",null,q("form",{class:g.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderReadOnlyNotice(),this._renderHeader(),this._renderContent()),this._prompt?q(v,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderReadOnlyNotice(){const{disabled:e,messages:t}=this;if(e&&this.visibleElements.readOnlyNotice)return q("calcite-notice",{class:g.disabledNotice,icon:"read-only-non-editable",kind:"brand",open:!0,scale:"s",width:"full"},q("div",{slot:"message"},t.disabledForm))}_renderHeader(){const e=this.viewModel,{formTitle:t,formDescription:i}=e;if(!e.formHeaderVisible)return;const o=null!=t&&q(H,{key:"title",level:this.headingLevel},t),s=null!=i&&q("p",{class:g.description,key:"description"},i);return q("div",{class:g.formHeader},o,s)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(t).filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){return f(e)?this._renderGroup(e):y(e)?this._renderLabeledField(e):C(e)?this._renderRelationshipInput(e):F(e)?this._renderTextElementInput(e):b(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){const{feature:t,callbacks:i}=this;t&&i?.viewAssociatedFeatures&&i.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){const{feature:t,callbacks:i}=this;t&&i?.selectAssociatedFeature&&await i.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){const{feature:t,callbacks:i}=this;t&&i?.addAssociation&&i.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({onSelectAssociationType:({viewModel:t,listType:i})=>{t.activeAssociationType=i;const{feature:o,callbacks:s}=this;o&&s?.viewAssociatedLayers&&s.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return null==e?null:q("div",{class:this.classes(g.description),id:t},e)}_renderGroup(e){const{formTemplate:t,headingLevel:i}=this,{description:o,id:s,inputs:n,label:a,open:r}=e,l=n.filter(e=>e.visible),d=this.viewModel.findField(this._focusedFieldName),c=d?.group===e,u="sequential"===this.groupDisplay;return q("calcite-block",{afterCreate:this._afterGroupCreate,class:this.classes(g.group,u?g.groupSequential:null,c?g.groupActive:null),collapsible:!0,"data-group":e,description:o||void 0,expanded:r,heading:a??"",headingLevel:t?.title?W(i):i,id:s,key:s,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},l.map(e=>this._renderInput(e)))}_getFocusableInput(e,t){const i=w(this.viewModel.inputs);let o;if("backward"===e&&i.reverse(),t)if(f(t)){const e=t.inputs.find(e=>e.visible);o=e?i.indexOf(e):0}else{let s;if(R(t)&&!t.group.open){const i=t.group.inputs.filter(y);s="forward"===e?i[i.length-1]:i[0]}else s=t;o=i.indexOf(s)+1}else o=0;for(let s=o;s<i.length;s++){const e=i[s];if(e.visible&&y(e)){if(this.disabled&&e.inputType&&("switch"===e.inputType||"radio-buttons"===e.inputType))continue;return e}}return null}_renderLabeledField(e){const{dataType:t,feature:i,label:o,layer:s,required:n}=e,a={"aria-label":n?z(this.messages.requiredFieldLabel,{name:o}):o,class:g.label,key:`${s.id}-${i.uid}-${e.name}`},r=[q("div",{class:g.labelTextContent,key:"labelTextContainer"},o,n?q("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==t?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)];return"date"===t&&"coded-value"!==e.domain?.type?q("label",{...a},r):q("calcite-label",{...a},r)}_renderFieldInput(e){const{dataType:t,domain:i,inputType:o,name:s}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){const t=this.viewModel.getFieldValueOptionsForField(s,this.messages.empty);return"switch"!==o||e.hasInvalidSwitchValue?"radio-buttons"===o?this._renderRadioButtonComponents(e,t.flat(),n):this._renderComboBoxComponent(e,t,n):this._renderSwitchComponent(e,n)}return"datetime-picker"===o||"date"===t?this._renderDateComponents(e,n):"number"===t?this._renderNumberComponent(e,n):this._renderStringComponent(e,n)}_renderStringComponent(e,t){return"text-area"===e.inputType?t.readOnly?q("calcite-input",{...t,loading:e.updating,type:"textarea",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)}):q("calcite-text-area",{...t,resize:"vertical",onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):q("calcite-input",{...t,loading:e.updating,type:"text",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){const i=c(e.field),o=i&&""!==t.value?Math.round(parseFloat(t.value)).toString():t.value;return q("calcite-input-number",{...t,integer:i,loading:e.updating,type:"number",value:o,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){const{field:i}=e;switch(i.type){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,D(i,t.value,{timeZone:this.timeZone,...V(i)}))}}_renderDateOnlyFieldComponent(e,t){const{range:i,valid:o,value:s}=e,{class:n,key:a,readOnly:r}=t,{rawMax:l,rawMin:d}=i;return q("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!o,class:n,"data-date-part":"date","data-field-name":t[Q],key:`${a}-date-input`,max:m(l)?l:void 0,min:m(d)?d:void 0,numberingSystem:S,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:r,value:null!=s?`${s}`:void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{valid:i,value:o}=e,{class:s,key:n,readOnly:a}=t;return q("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,class:s,"data-date-part":"time","data-field-name":t[Q],key:`${n}-time-input`,numberingSystem:S,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,step:e.timeStep,value:null!=o?`${o}`:void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{name:i,range:o,timeZone:s,valid:n,value:a}=e,{class:r,key:l,readOnly:d}=t,{rawMax:c,rawMin:u}=o,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,numberingSystem:S,overlayPositioning:"fixed",readOnly:d,[Q]:i,onfocus:this._onComponentFocus},m=U(c,s),h=U(u,s),v=U(a,s);return q("div",{class:g.dateInputContainer,key:`${l}-date-time-container`},q("calcite-input-date-picker",{...p,class:r,"data-date-part":"date",key:`${l}-date-input`,max:m?.date??void 0,min:h?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),q("calcite-input-time-picker",{...p,class:r,"data-date-part":"time",key:`${l}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:e.timeStep,value:v.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?q("calcite-input-time-zone",{...p,class:r,"data-date-part":"timeZone",disabled:d,key:`${l}-timezone-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.timeZoneOffset??"0",onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){const{includeTime:i,name:o,valid:s,value:n}=e,{class:a,key:r,max:l,min:d,readOnly:c}=t,{timeZone:u}=this,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!s,numberingSystem:S,overlayPositioning:"fixed",readOnly:c,[Q]:o,onfocus:this._onComponentFocus},m=E(n,u),h=E(l,u),v=E(d,u);return q("div",{class:g.dateInputContainer,key:`${r}-date-time-container`},q("calcite-input-date-picker",{...p,class:a,"data-date-part":"date",key:`${r}-date-input`,max:h?.date??void 0,min:v?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:m.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),i?q("calcite-input-time-picker",{...p,class:a,"data-date-part":"time",key:`${r}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:1,value:m.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return q("calcite-input",{...i,class:this.classes(g.fieldInput,g.inputDisabled),readOnly:!0,type:"text",value:null!=t?`${t}`:i.value})}_renderComboBoxComponent(e,t,i){const{value:o,name:s}=e,{viewModel:n,_inputsWithChanges:a}=this,r="INSERT"===n.editType,l=a.has(s),d=null==o&&(!r||l),c=r&&e.showNoValueOptionEnabled&&!l?()=>{}:i.onblur;return q("calcite-combobox",{...i,allowCustomValues:!1,clearDisabled:!0,onblur:c,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{d&&0===t.selectedItems.length?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){const{value:i,name:o}=e,{messages:s,messagesTemplates:n,viewModel:a,_inputsWithChanges:r}=this,[l,d,c]=t.map(e=>e.map(({name:e,value:t})=>q("calcite-combobox-item",{key:`#${t}`,selected:i===t,textLabel:e,value:`${t}`}))),u=[];d.length>0&&u.push(q("calcite-combobox-item-group",{key:"other",label:n.other},d)),c.length>0&&u.push(q("calcite-combobox-item-group",{key:"unsupported",label:s.subtypes.unsupportedDomainGroupTitle},c)),u.length>0?u.unshift(q("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):u.push(...l);const p="INSERT"===a.editType,m=r.has(o),h=null==i&&(!p||m);return e.showNoValueOptionEnabled&&u.unshift(q("calcite-combobox-item",{key:"empty-option",selected:h,textLabel:e.showNoValueLabel||s.empty,value:""})),u}_renderRadioButtonComponents(e,t,i){const{name:o,value:s}=e,n=t.map(({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:o,value:t,selected:t===s,props:i}));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,r=s===t||null===s;n.unshift(this._renderRadioButtonComponent({key:"empty-option",label:a,name:o,value:t,selected:r,props:i}))}return q("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:g.inputRadioGroup,"data-field-name":i[Q],key:`${i.key}-radio-group`,layout:"vertical",name:i.key,required:i.required},n)}_renderSwitchComponent(e,t){const{value:i}=e,o=!!k(e.element,"switch")&&i===e.element.input.onValue;return q("calcite-switch",{...t,checked:o,class:g.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:o,label:s,props:n}){return q("calcite-label",{class:g.inputRadioLabel,key:e,layout:"inline"},q("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:o,class:g.inputRadio,disabled:n.readOnly,name:t,onblur:()=>{this._focusedFieldName=null},value:i,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.submittable?I(e,this.messages,this.timeZone):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?q("calcite-input-message",{icon:!0,status:"invalid"},i):this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?q("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;const t=this.messages;return q("calcite-list-item",{description:z(t.totalCount,{count:e.featureCount}),key:"show-all-related-features",label:t.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},q("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:o,editable:s}=e,{messages:n,callbacks:a,disabled:r}=this,l=!s||r;if(t&&a?.addRelatedRecord&&o&&!l)return q("calcite-button",{alignment:"center",appearance:"outline-fill",class:g.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:"plus",key:`${i}-add-button`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,i,o)},round:!0,scale:"s",width:"full"},e.relatedLayerIsTable?n.addRecord:n.addFeature)}_renderRelatedRecordListItem(e,t,i){const{feature:o,description:s,title:n}=e,{feature:a,callbacks:r}=this,{highlightHelper:l}=this.viewModel,d=()=>{l?.removeAll(),r?.editRelatedRecord&&a&&r.editRelatedRecord({parentFeature:a,relationshipId:t,relatedFeature:o,readOnly:i})},c=l?()=>l.add(o):void 0,u=l?()=>l.remove(o):void 0;return q("calcite-list-item",{bind:this,description:s,key:`${t}-${o.uid}`,label:n,onmouseenter:c,onmouseleave:u,value:n,onCalciteListItemSelect:d},q("calcite-icon",{icon:O(o),slot:"content-start"}),q("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled)return;const{relationshipId:t,activeCategory:i}=e,o=i?null:this._renderDescriptionOrEmpty(e.description);return q("calcite-label",{class:this.classes(g.label,g.relatedRecordsLabel),key:`relationship-${t}-container`},q("div",null,this._renderRelatedRecordsHeaderContainer(e),o,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){return e.featureCount>0?this._renderRelatedRecordsList(e):e.activeCategory&&0===e.featureCount?this._renderNoRelatedRecordsNotice():e.allCategories?.length?this._renderCategoryList(e):e.loaded?e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e):void 0}_renderCategoryList(e){return q("calcite-list",{displayMode:"flat",label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map(t=>this._renderCategory(e,t)),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){const{count:i,name:o,value:s}=t,n=J(i);return q("calcite-list-item",{key:`${o}-${s}`,label:o,onCalciteListItemSelect:()=>this._selectCategory(e,t)},q("calcite-chip",{label:n,scale:"s",slot:"content-end"},n),q("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:"s",slot:"content-end"}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;const t=this.messages;return q("calcite-list-item",{description:z(t.totalCount,{count:e.allCategories?.length??0}),key:"show-all-categories",label:t.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},q("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return q("div",{class:g.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},q("span",null,e.label),t?q("calcite-loader",{inline:!0,key:"loader",label:this.messagesCommon?.loading,scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t,editable:i}=e,{disabled:o}=this,s=!i||o;return q("calcite-list",{class:g.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map(e=>this._renderRelatedRecordListItem(e,t,s)),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){const{messages:t}=this,i=e.relatedLayerIsTable?t.noOriginKeyRecord:t.noOriginKeyFeature,o=e.relationship?.keyField,s=this.viewModel.findField(o),n=e.layer?.fieldsIndex.get(o),a=s?.label||n?.alias||o,r=z(i,{relatedLayerName:e.relatedLayer?.title,originKeyField:a});return q("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},q("div",{slot:"message"},r))}_renderNoRelatedRecordsNotice(){return q("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},q("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return q("div",{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:g.listObserver,key:"feature-observer"})}_renderTextElementInput(e){return q("div",{class:g.textElement,"data-testid":`text-element-${e.label}`,innerHTML:e.text,key:e.id})}getCommonInputProps(e){const{disabled:t}=this,{editable:i,hint:o,label:s,maxLength:n,minLength:a,name:r,range:{max:l,min:d},required:c,valid:u,value:p}=e,m=this._inputsWithChanges.has(r),h=!i||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":u?"false":"true",class:this.classes(g.fieldInput,h?g.inputDisabled:null),status:m&&!u?"invalid":"idle",key:r,label:s,max:null!=l?l:void 0,min:null!=d?d:void 0,maxLength:n>-1?n:void 0,minLength:a>-1?a:void 0,placeholder:o??void 0,readOnly:h,required:c,value:null==p?"":`${p}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[Q]:r}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(Q))}_afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e),i=e.dataset.datePart,o=this._dateComponentMap.get(t.name);if("valueAsDate"in e&&null!=e.value&&null!=t.value){const i=new ResizeObserver(()=>{switch(e.value=void 0,t.field.type){case"date":e.value=E(t.value,this.timeZone).date??"";break;case"timestamp-offset":e.value=U(t.value,this.timeZone).date??"";break;default:e.value=`${t.value}`}i.unobserve(e)});i.observe(e)}if(null!=o)switch(i){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}else this._dateComponentMap.set(t.name,{[i]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);N(t)&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),o=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&o===i&&(this._attemptFocusOnNextRender=!1,R(i)&&(i.group.open=!0),Z(e))}async _afterGroupCreate(e){const t=this.viewModel.findGroup(e.id),i=this.viewModel.findField(this._focusedFieldName);i&&t&&M(i,t)&&(!i.editable||this.disabled)&&(await e.componentOnReady(),this._attemptFocusOnNextRender=!0,this.scheduleRender())}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name}_onComponentBlur(e){const t=e.target;this._focusedFieldName=null;"readOnly"in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){const{timeZone:t}=this,i=this._getFieldInputFromHTMLElement(e),o=i.field.type,{name:s,range:n}=i,a=this._dateComponentMap.get(s);if(!a)return;let r=this.viewModel.getValue(s),l=null;"date-only"===o?l=Array.isArray(e.value)?e.value[0]:e.value:"time-only"===o?(r=j(r),l=j(e.value)):l="timestamp-offset"===o?null!=e.value?$({dateComponent:a.date,timeComponent:a.time,timeZoneComponent:a.timeZone,oldValue:r,defaultTimeZone:t}):null:null!=e.value?P({oldValue:r,dateComponent:a.date,timeComponent:a.time,timeZone:t,max:n.max,min:n.min}):null,null!==l&&e.value?r!==l&&this._updateFieldValue(s,l):this._updateFieldValue(s,null)}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e),i=this._parseValue(e),o=t.value;t.isSubtypeField&&L(this.layer,o,i)?this._pendingSubtypeChoice||i===o||(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,i)):this._updateFieldValue(t.name,i)}async _handleSubtypeChoice(e,t){const{value:i,name:s}=e,{messages:n,viewModel:a,messagesCommon:r,_subtypes:l}=this;if(this._updateFieldValue(s,t),!l?.length)return;const d=l.find(e=>e.code===t),c=l.find(e=>e.code===i)?.name??`${i}`;if(!d)return;const u=o();a.pendingSubtypeChoice=u;let p="update-fields";const m=[{label:n.subtypes.useDefaultValuesOption,value:"update-fields"},{label:n.subtypes.keepCurrentValuesOption,value:"keep-existing"}],h={context:"info",title:n.subtypes.changeWarningTitle,message:z(n.subtypes.changeWarning,{originalType:c,newType:d.name}),radios:m,defaultRadioSelection:"update-fields",onRadioSelection:e=>p=e,actions:{primary:{label:r.apply,action:()=>u.resolve(p),type:"positive"},secondary:{label:r.cancel,type:"neutral",action:()=>u.resolve("undo")}},cancel:()=>u.reject()};try{this.showPrompt(h);switch(await u.promise){case"update-fields":a.applySubtypeDefaults(d),this._validateContingenciesForNonNullFields();break;case"keep-existing":this._validateContingenciesForNonNullFields();break;case"undo":this._updateFieldValue(e.name,i)}}finally{a.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){const i=this._getFieldInputFromHTMLElement(t);"Enter"===e&&R(i)&&!i.group.open&&(i.group.open=!0)}_updateFieldValue(e,t){const i=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e);i!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){const e=Object.fromEntries(Object.entries(this.getValues()).filter(([e,t])=>null!=t));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;return k(t.element,"switch")?e.checked?t.element.input.onValue:t.element.input.offValue:null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:o}=e;0===o.length&&t&&"selected"in t?t.selected=!0:i.getLogger(this).warnOnce("Failed to override user attempt to deselect 'No value' option.")}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._focusedFieldName=this._getFocusableInput("forward",t)?.name||null,this._attemptFocusOnNextRender=!0,"sequential"===this.groupDisplay&&this.viewModel.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.allGroupInputs;if(!e.length)return;const t=e.filter(e=>e.open);0===t.length?e[0].open=!0:t.length>1&&t.slice(1).forEach(e=>e.open=!1)}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([l()],X.prototype,"_listObserverNode",void 0),e([l()],X.prototype,"_relatedRecordsEnabled",null),e([l()],X.prototype,"_utilityNetworkAssociationsEnabled",null),e([l()],X.prototype,"_prompt",void 0),e([l()],X.prototype,"_subtypes",null),e([l()],X.prototype,"associationId",null),e([l()],X.prototype,"associatedLayer",null),e([l()],X.prototype,"disabled",null),e([l()],X.prototype,"feature",null),e([l()],X.prototype,"_featureFormUNAssociationList",void 0),e([l()],X.prototype,"formTemplate",null),e([l()],X.prototype,"groupDisplay",void 0),e([l()],X.prototype,"headingLevel",void 0),e([l()],X.prototype,"icon",null),e([l()],X.prototype,"label",null),e([l()],X.prototype,"layer",null),e([l()],X.prototype,"map",null),e([l(),B("esri/widgets/FeatureForm/t9n/FeatureForm")],X.prototype,"messages",void 0),e([l(),B("esri/t9n/common")],X.prototype,"messagesCommon",void 0),e([l(),B("esri/widgets/Feature/t9n/Feature")],X.prototype,"messagesFeature",void 0),e([l(),B("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],X.prototype,"messagesTemplates",void 0),e([l()],X.prototype,"callbacks",null),e([l()],X.prototype,"relationshipId",null),e([l()],X.prototype,"spatialReference",null),e([l()],X.prototype,"strict",null),e([l()],X.prototype,"timeZone",null),e([l()],X.prototype,"showPrompt",null),e([l()],X.prototype,"clearPrompt",null),e([l(),K(["value-change","submit"])],X.prototype,"viewModel",void 0),e([l({type:A,nonNullable:!0})],X.prototype,"visibleElements",void 0),e([l()],X.prototype,"test",null),X=e([d("esri.widgets.FeatureForm")],X);const Y=X;export{Y as default};
|