@arcgis/core 5.2.0-next.7 → 5.2.0-next.9
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/applications/SceneViewer/layerUtils.d.ts +9 -1
- package/applications/SceneViewer/layerUtils.js +1 -1
- package/arcgisGlobal.d.ts +4 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/07cc5743cb6a9fd68adb.js +1 -0
- package/assets/esri/core/workers/chunks/0cbd7f5fe24271942abd.js +1 -0
- package/assets/esri/core/workers/chunks/0ecc1bc1686844cdd60e.js +1 -0
- package/assets/esri/core/workers/chunks/0f75c19d8e296a32e329.js +1 -0
- package/assets/esri/core/workers/chunks/174cc2e69e5b5a13d880.js +1 -0
- package/assets/esri/core/workers/chunks/18f980465db5a86153d1.js +1 -0
- package/assets/esri/core/workers/chunks/1996f0a930abdd97b855.js +1 -0
- package/assets/esri/core/workers/chunks/1c8436b27a3d3cde5cfc.js +1 -0
- package/assets/esri/core/workers/chunks/1cb1f125dccbf8c8cac9.js +1 -0
- package/assets/esri/core/workers/chunks/1dd06335bb2d35c66339.js +1 -0
- package/assets/esri/core/workers/chunks/1f289aa69dd6b6be534a.js +1 -0
- package/assets/esri/core/workers/chunks/2185e8a52c5e29d46680.js +1 -0
- package/assets/esri/core/workers/chunks/{da29cf0e64065631a470.js → 24810c36ae09bb4e83dc.js} +1 -1
- package/assets/esri/core/workers/chunks/26583db2af1a1cc456e5.js +1 -0
- package/assets/esri/core/workers/chunks/274b82cb183ddd0042f3.js +1 -0
- package/assets/esri/core/workers/chunks/27c6def22c2b0791ce9e.js +1 -0
- package/assets/esri/core/workers/chunks/2d2895f1fdf44d212a4d.js +1 -0
- package/assets/esri/core/workers/chunks/2dbc2fd0f2dde505c465.js +1 -0
- package/assets/esri/core/workers/chunks/2dbcdfdf000226bfe746.js +1 -0
- package/assets/esri/core/workers/chunks/2e6382d50bf012064eae.js +1 -0
- package/assets/esri/core/workers/chunks/30f1909c5ef1835b8507.js +1 -0
- package/assets/esri/core/workers/chunks/31918a0d9886dedf385f.js +1 -0
- package/assets/esri/core/workers/chunks/{1c029b03ed836f393a50.js → 3248001d9dfb9153699e.js} +1 -1
- package/assets/esri/core/workers/chunks/3297658ccd8d4b9ce733.js +1 -0
- package/assets/esri/core/workers/chunks/{716a4d7e8b908b81870b.js → 32f26757e36704923286.js} +1 -1
- package/assets/esri/core/workers/chunks/3529afab0c2444275d91.js +1 -0
- package/assets/esri/core/workers/chunks/36dac6ab51d9dbdd091d.js +1 -0
- package/assets/esri/core/workers/chunks/390fda094fa8695d98cf.js +1 -0
- package/assets/esri/core/workers/chunks/39596715e84d0da2f803.js +30 -0
- package/assets/esri/core/workers/chunks/398eb3100a282e4736bb.js +1 -0
- package/assets/esri/core/workers/chunks/3b3f91a61e3f29af1fb2.js +1 -0
- package/assets/esri/core/workers/chunks/{f815106d439ff1f76e51.js → 3b837b512999e6ab24bc.js} +1 -1
- package/assets/esri/core/workers/chunks/3d20c86f1fe877bf884b.js +1 -0
- package/assets/esri/core/workers/chunks/3dc5fbecc427df1fd827.js +1 -0
- package/assets/esri/core/workers/chunks/3e65b4b18760bde8ceee.js +1 -0
- package/assets/esri/core/workers/chunks/3ff7aa216cd794d951e8.js +1 -0
- package/assets/esri/core/workers/chunks/{8e1865392681d390ab2e.js → 401ee7fa500adad77db1.js} +1 -1
- package/assets/esri/core/workers/chunks/{60915a3708a34da1977e.js → 426156137f279d979ddd.js} +1 -1
- package/assets/esri/core/workers/chunks/434c1dd3f48e6f0802fc.js +1 -0
- package/assets/esri/core/workers/chunks/4517630bf869205bab87.js +1 -0
- package/assets/esri/core/workers/chunks/48f1c3a7c9f16d6896f6.js +1 -0
- package/assets/esri/core/workers/chunks/{cfd28eba44cf5a296c6d.js → 49308bdc36373555f1af.js} +1 -1
- package/assets/esri/core/workers/chunks/{09d0e430c66788a2626f.js → 4a20f7a0700fd14a129f.js} +1 -1
- package/assets/esri/core/workers/chunks/5075e85e1eafd431a8c0.js +1 -0
- package/assets/esri/core/workers/chunks/5121768c70f1e03b685c.js +1 -0
- package/assets/esri/core/workers/chunks/5201105ca11a2d450460.js +1 -0
- package/assets/esri/core/workers/chunks/528ed0bd8dc149ead023.js +1 -0
- package/assets/esri/core/workers/chunks/52f354bf80ee5ab0379a.js +1 -0
- package/assets/esri/core/workers/chunks/538537f9bc866d9caa75.js +1 -0
- package/assets/esri/core/workers/chunks/58a7cdebc3d182c15ec6.js +1 -0
- package/assets/esri/core/workers/chunks/58ac245ff7fb57c1004f.js +1 -0
- package/assets/esri/core/workers/chunks/58acc18b92533166135d.js +1 -0
- package/assets/esri/core/workers/chunks/597aa39cdb5366ef9a74.js +1 -0
- package/assets/esri/core/workers/chunks/5bfae465872760e7af6d.js +1 -0
- package/assets/esri/core/workers/chunks/5cb274e5759f7ca0d4ed.js +1 -0
- package/assets/esri/core/workers/chunks/5d3ddbf94539cb4f493e.js +1 -0
- package/assets/esri/core/workers/chunks/{542f5469f7b42026b24f.js → 5d62d1920e3e35fc0192.js} +1 -1
- package/assets/esri/core/workers/chunks/5dd441db1e74dc9b56e9.js +1 -0
- package/assets/esri/core/workers/chunks/630ad47857de3cf726d1.js +1 -0
- package/assets/esri/core/workers/chunks/64114a7d2da162987958.js +1 -0
- package/assets/esri/core/workers/chunks/6821462e5c1e9c76010a.js +1 -0
- package/assets/esri/core/workers/chunks/684d3cb4fb233180b2d0.js +1 -0
- package/assets/esri/core/workers/chunks/686c51fd2144e132783e.js +1 -0
- package/assets/esri/core/workers/chunks/68f9b2da1fd08785320f.js +2 -0
- package/assets/esri/core/workers/chunks/69e98de578f467a35054.js +1 -0
- package/assets/esri/core/workers/chunks/6a3d207308b29651f397.js +1 -0
- package/assets/esri/core/workers/chunks/6aabde21b0b376d95888.js +1 -0
- package/assets/esri/core/workers/chunks/6d616b66fb32904b55a1.js +1 -0
- package/assets/esri/core/workers/chunks/{bcb021a167580bb1619f.js → 6ef3b8d67b498d655a99.js} +1 -1
- package/assets/esri/core/workers/chunks/6f125b4ed06c0022dee6.js +1 -0
- package/assets/esri/core/workers/chunks/6f4825c3ef1fe202ab82.js +1 -0
- package/assets/esri/core/workers/chunks/6f5d61f734ec40dafabb.js +1 -0
- package/assets/esri/core/workers/chunks/{fce7995c26953bfd8d3d.js → 70229007d594536ba6a3.js} +1 -1
- package/assets/esri/core/workers/chunks/71e55381fdff3fc2542e.js +1 -0
- package/assets/esri/core/workers/chunks/{90953a827bc89d0e6bd5.js → 72cfb186e50537bcdd19.js} +1 -1
- package/assets/esri/core/workers/chunks/72d67cc3a382e83bf1a2.js +1 -0
- package/assets/esri/core/workers/chunks/7748743d4be047094d67.js +1 -0
- package/assets/esri/core/workers/chunks/78c53aeb0a408ab3c80c.js +1 -0
- package/assets/esri/core/workers/chunks/7b5c1030a7cf0f382cc4.js +1 -0
- package/assets/esri/core/workers/chunks/7cee81c5aa1e6b7d2452.js +1 -0
- package/assets/esri/core/workers/chunks/7e89cb9ff615742e0894.js +1 -0
- package/assets/esri/core/workers/chunks/80f4f686ce403cb2693f.js +1 -0
- package/assets/esri/core/workers/chunks/{62dfbdc847be4800e833.js → 8103d06f760a2c79773d.js} +10 -14
- package/assets/esri/core/workers/chunks/{8477b5fdd99c6ac5c27b.js → 851705cf276eae8d4d37.js} +1 -1
- package/assets/esri/core/workers/chunks/89e09276086745aa21fa.js +1 -0
- package/assets/esri/core/workers/chunks/{4894997bfa438f66da36.js → 8a8c5e5ce457ca004687.js} +1 -1
- package/assets/esri/core/workers/chunks/{b79428c5093614174e76.js → 8b0a01ebc86ab226f01f.js} +1 -1
- package/assets/esri/core/workers/chunks/{452c01cecbbd1e370098.js → 8f93e6fc11a158d4f1ee.js} +1 -1
- package/assets/esri/core/workers/chunks/93bd56396b8cd020f965.js +1 -0
- package/assets/esri/core/workers/chunks/{359d3acb3953e64e5a78.js → 93ceb74ac88ef460fe5f.js} +1 -1
- package/assets/esri/core/workers/chunks/957f7b8de4aecb6f644e.js +1 -0
- package/assets/esri/core/workers/chunks/{875cce0be4f6c89f80f3.js → 9629601de5e44ffe90ea.js} +2 -2
- package/assets/esri/core/workers/chunks/976ab2be6c244768c08a.js +1 -0
- package/assets/esri/core/workers/chunks/{e785f76c1a75cb1d1e1f.js → 99101789035f1787c630.js} +1 -1
- package/assets/esri/core/workers/chunks/99e5296192ab98fd0d99.js +1 -0
- package/assets/esri/core/workers/chunks/9d5f7573bfe3b051daf1.js +1 -0
- package/assets/esri/core/workers/chunks/a0c00c6fe60db49b3ab9.js +1 -0
- package/assets/esri/core/workers/chunks/a2247f4c3116efb16c4f.js +1 -0
- package/assets/esri/core/workers/chunks/a4245bd4e67a428fd835.js +1 -0
- package/assets/esri/core/workers/chunks/a442534ac0956a68b769.js +1 -0
- package/assets/esri/core/workers/chunks/a4e9a17dacbb52444d75.js +1 -0
- package/assets/esri/core/workers/chunks/{8bdca6f06c8b5fedd917.js → a5abba59e738c3240c22.js} +1 -1
- package/assets/esri/core/workers/chunks/a9fc53ae040320e49834.js +1 -0
- package/assets/esri/core/workers/chunks/aa118c1bcd922b8ac328.js +1 -0
- package/assets/esri/core/workers/chunks/aae0049c2c3e15a813e8.js +1 -0
- package/assets/esri/core/workers/chunks/ac33b10fe65f9e9e824f.js +1 -0
- package/assets/esri/core/workers/chunks/adc32f6b45ea3026fc34.js +1 -0
- package/assets/esri/core/workers/chunks/af31e62499d45bdab3c3.js +1 -0
- package/assets/esri/core/workers/chunks/b22a1c98271c2e4d8808.js +1 -0
- package/assets/esri/core/workers/chunks/{9f4681713f03365a2a53.js → b666027b9022fa346a79.js} +1 -1
- package/assets/esri/core/workers/chunks/b73c146d3e550eaf07eb.js +1 -0
- package/assets/esri/core/workers/chunks/{0f3654c8157ec8f22869.js → b895674c0550826ecb28.js} +3 -3
- package/assets/esri/core/workers/chunks/c0cbc50e5afd68bd485c.js +1 -0
- package/assets/esri/core/workers/chunks/c2a65de34f6a6c89c652.js +1 -0
- package/assets/esri/core/workers/chunks/c357c0a08b99c1e7f290.js +1 -0
- package/assets/esri/core/workers/chunks/{4a23b27bfbcfa08fd9a7.js → c3cf9e6e91f71c9cc5f3.js} +1 -1
- package/assets/esri/core/workers/chunks/c3ff2ff0a86a9143d7a5.js +1 -0
- package/assets/esri/core/workers/chunks/{e545df5ea7c0ced92cee.js → c424a66f1546275e2bcb.js} +1 -1
- package/assets/esri/core/workers/chunks/c60b4f2dd5fccdf362a7.js +1 -0
- package/assets/esri/core/workers/chunks/c6d0b4875b6b8d6bc25a.js +1 -0
- package/assets/esri/core/workers/chunks/c80fc1b3048e8d58a1f8.js +1 -0
- package/assets/esri/core/workers/chunks/c911f0b5bdd43b66b731.js +1 -0
- package/assets/esri/core/workers/chunks/c9a4601073e1a3eee9d0.js +1 -0
- package/assets/esri/core/workers/chunks/ccffaba50674adba7a0f.js +1 -0
- package/assets/esri/core/workers/chunks/{24646a1176ce34039155.js → cdf6ad970dc1893dac58.js} +1 -1
- package/assets/esri/core/workers/chunks/d13e003c9293cb7e2852.js +1 -0
- package/assets/esri/core/workers/chunks/d24e027bb8b2c09f25c8.js +1 -0
- package/assets/esri/core/workers/chunks/d2df8c328054dc6cb7b7.js +1 -0
- package/assets/esri/core/workers/chunks/d5c35a75fd4c41def420.js +1 -0
- package/assets/esri/core/workers/chunks/{5e3e0d7b85dfd52d1c7d.js → d78b7cac322755e87eb8.js} +1 -1
- package/assets/esri/core/workers/chunks/d7be278aed1fb37ad5ec.js +1 -0
- package/assets/esri/core/workers/chunks/d9695794cfaa014a55b1.js +1 -0
- package/assets/esri/core/workers/chunks/da1e8b338ab9fe9e0a8e.js +1 -0
- package/assets/esri/core/workers/chunks/dd920a6f6422fa213eba.js +1 -0
- package/assets/esri/core/workers/chunks/e1bf87077541da6853c6.js +1 -0
- package/assets/esri/core/workers/chunks/e279bcbe4f10e87bde6c.js +1 -0
- package/assets/esri/core/workers/chunks/e4406baf206b9e4c7e4f.js +1 -0
- package/assets/esri/core/workers/chunks/e499252cb52f7aed49a0.js +1 -0
- package/assets/esri/core/workers/chunks/{e178cd0e9178d6716410.js → e5837e5ac6ef761f26a2.js} +1 -1
- package/assets/esri/core/workers/chunks/e6a7272b59a4c2e34dca.js +1 -0
- package/assets/esri/core/workers/chunks/e912b515704e20313e53.js +1 -0
- package/assets/esri/core/workers/chunks/eac683a37339aa558455.js +1 -0
- package/assets/esri/core/workers/chunks/ec1841e6e498d54012eb.js +1 -0
- package/assets/esri/core/workers/chunks/ed3d16a5b4084ef61f8a.js +1 -0
- package/assets/esri/core/workers/chunks/ee07f54bc77fe9f8575a.js +1 -0
- package/assets/esri/core/workers/chunks/{e094364e54981c91e1b4.js → eeea5710275c967e8d51.js} +1 -1
- package/assets/esri/core/workers/chunks/ef46ef4f0ee9f2aeaa4a.js +1 -0
- package/assets/esri/core/workers/chunks/efb4aa5886730ea377bd.js +1 -0
- package/assets/esri/core/workers/chunks/{485d20152495c27b8074.js → f2a268c69f2a5566381b.js} +1 -1
- package/assets/esri/core/workers/chunks/f590db684d88e72bd79b.js +1 -0
- package/assets/esri/core/workers/chunks/f69df22a5c64389ebe28.js +1 -0
- package/assets/esri/core/workers/chunks/{f60292d97bcdbf19165b.js → f6d047358d14328f3622.js} +1 -1
- package/assets/esri/core/workers/chunks/f7fca88d120d45bb782a.js +1 -0
- package/assets/esri/core/workers/chunks/f819854098d63fe4ccdb.js +1 -0
- package/assets/esri/core/workers/chunks/f8f3579d0c1b65762902.js +1 -0
- package/assets/esri/core/workers/chunks/f98118127469449ca145.js +1 -0
- package/assets/esri/core/workers/chunks/f9ed05d4ad1f44d033bb.js +1 -0
- package/assets/esri/core/workers/chunks/fb6605be0c5e36785543.js +1 -0
- package/assets/esri/core/workers/chunks/fbe7dae0b4bf2d172487.js +1 -0
- package/assets/esri/core/workers/chunks/fc4d9be62cf5e9758842.js +1 -0
- package/assets/esri/core/workers/chunks/fd70a25ffdf2cc6c5be2.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +38 -8
- 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/GaussianSplatComposition.glsl.js +1 -1
- package/chunks/GlobalIllumination.glsl.js +1 -1
- package/chunks/GlowComposition.glsl.js +2 -2
- package/chunks/OITBlend.glsl.js +3 -3
- package/chunks/OITBlendEmission.glsl.js +2 -2
- package/chunks/OITDimOpaque.glsl.js +2 -2
- package/chunks/SlicePlaneMaterial.glsl.js +4 -4
- package/chunks/bundle2.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/screenUtils.js +1 -1
- package/core/sql.d.ts +1 -1
- package/geometry/Extent.d.ts +0 -13
- package/geometry/Geometry.d.ts +10 -8
- package/geometry/Multipoint.d.ts +9 -0
- package/geometry/Multipoint.js +1 -1
- package/geometry/Point.d.ts +15 -71
- package/geometry/Polygon.js +1 -1
- package/geometry/support/geometryUtils.js +1 -1
- package/graphic/AnnotationGraphicOrigin.d.ts +34 -0
- package/graphic/AnnotationGraphicOrigin.js +2 -0
- package/graphic/DimensionFeatureGraphicOrigin.d.ts +34 -0
- package/graphic/DimensionFeatureGraphicOrigin.js +2 -0
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +11 -0
- package/kernel.js +1 -1
- package/layers/AnnotationLayer.d.ts +263 -32
- package/layers/AnnotationLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +263 -32
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/FeatureLayer.d.ts +1 -1
- package/layers/GeoJSONLayer.d.ts +7 -7
- package/layers/ParquetLayer.d.ts +22 -2
- package/layers/SceneLayer.d.ts +4 -2
- package/layers/VideoLayer.d.ts +7 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/catalog/CatalogFootprintLayer.d.ts +40 -10
- package/layers/graphics/sources/parquet/FileProvider.js +1 -1
- package/layers/graphics/sources/parquet/ParquetFileInfo.js +2 -0
- package/layers/graphics/sources/parquet/ParquetFileStatistics.js +2 -0
- package/layers/graphics/sources/parquet/PortalParquetFileProvider.js +1 -1
- package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
- package/layers/graphics/sources/parquet/UrlsFileProvider.js +1 -1
- package/layers/graphics/sources/parquet/createFileProvider.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/FeatureLayerBase.d.ts +40 -16
- package/layers/mixins/TemporalLayer.d.ts +4 -2
- package/layers/support/AnnotationSublayer.d.ts +44 -0
- package/layers/support/AnnotationSublayer.js +2 -0
- package/layers/support/GeometryEncodingLocation.d.ts +1 -1
- package/layers/support/GeometryEncodingWkb.d.ts +3 -2
- package/layers/support/ParquetFilesData.d.ts +13 -3
- package/layers/support/ParquetPortalItemData.d.ts +12 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/support/timeSeriesUtils.js +1 -1
- package/layers/video/types.d.ts +61 -1
- package/libs/parquet/parquet.js +1 -1
- package/package.json +1 -1
- package/request/types.d.ts +18 -20
- package/rest/support/Query.d.ts +1 -0
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
- package/views/2d/layers/GraphicsLayerView2D.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/MapNotesLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightAggregateManipulatedObject3D.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightConfiguration.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightManipulators.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementLeafPlugin.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightRootPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/isSupportedObject.js +1 -1
- package/views/3d/interactive/editingTools/reshape/reshapeTooltipUtils3D.js +1 -1
- package/views/3d/interactive/editingTools/visualElementUtils.js +1 -1
- package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl/RenderNode.d.ts +25 -4
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/RenderSubmitSystem.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/EmissionDimming.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/emissive/emissions.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlendTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RendererBase.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +2 -2
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ToneMapping.glsl.js +6 -10
- package/views/draw/plugins/PolygonPlugin.js +1 -1
- package/views/interactive/interactiveToolUtils.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/interactive/snapping/LineSnapper.js +1 -1
- package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +25 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/types.d.ts +4 -4
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/renderState.js +1 -1
- package/webdoc/support/webdocSaveUtils.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +10 -2
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +1 -1
- package/widgets/BatchAttributeForm/attachmentUtils.d.ts +14 -0
- package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +8 -6
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/attachmentValidationCriteriaState.d.ts +5 -0
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/types.d.ts +8 -1
- package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
- package/widgets/BatchAttributeForm/rendered-content/RelationshipDetails.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.d.ts +9 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/GroupColumn.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +7 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/support/ContingentValuesManager.js +1 -1
- package/assets/esri/core/workers/chunks/02aaeaa988e9e7d65a7f.js +0 -1
- package/assets/esri/core/workers/chunks/03354ad3d74d858173b4.js +0 -1
- package/assets/esri/core/workers/chunks/09a4139fc6d069ab6928.js +0 -1
- package/assets/esri/core/workers/chunks/0a510acf50915e00c62b.js +0 -1
- package/assets/esri/core/workers/chunks/0a780a883abfcdf0b900.js +0 -1
- package/assets/esri/core/workers/chunks/0fbf9bf52ecb4cd8293b.js +0 -1
- package/assets/esri/core/workers/chunks/119d352dd586f2bb61ec.js +0 -1
- package/assets/esri/core/workers/chunks/130784a27661de6b52a5.js +0 -1
- package/assets/esri/core/workers/chunks/145364aa20b4435294c2.js +0 -1
- package/assets/esri/core/workers/chunks/1595dc499a06b23b6a96.js +0 -1
- package/assets/esri/core/workers/chunks/16713986893adfbc9331.js +0 -1
- package/assets/esri/core/workers/chunks/179c9fe4ac83b42e5976.js +0 -1
- package/assets/esri/core/workers/chunks/19dcae83be0fc0aced02.js +0 -1
- package/assets/esri/core/workers/chunks/1c64e10f966e26af6fed.js +0 -1
- package/assets/esri/core/workers/chunks/1eabe746481e0b228498.js +0 -1
- package/assets/esri/core/workers/chunks/201007cf1a91e2b126fc.js +0 -1
- package/assets/esri/core/workers/chunks/20d0adc678f11981059c.js +0 -1
- package/assets/esri/core/workers/chunks/227eff8aa4a6f5f03bc2.js +0 -1
- package/assets/esri/core/workers/chunks/233ff588798c8a5eedf4.js +0 -1
- package/assets/esri/core/workers/chunks/238478cfe493fd4a6100.js +0 -1
- package/assets/esri/core/workers/chunks/24647e7424798dccdaf5.js +0 -1
- package/assets/esri/core/workers/chunks/249616ea2d90d40a8299.js +0 -1
- package/assets/esri/core/workers/chunks/24d9e4f1c7b8ff0d2cce.js +0 -1
- package/assets/esri/core/workers/chunks/2b36a54927f5a7281da3.js +0 -1
- package/assets/esri/core/workers/chunks/2bcd4d395bfe6a19ccc8.js +0 -1
- package/assets/esri/core/workers/chunks/2c8584ec1c3c9fd5aba2.js +0 -1
- package/assets/esri/core/workers/chunks/2d374cc8c54a722a7afe.js +0 -1
- package/assets/esri/core/workers/chunks/2e11b4e9d66474a60064.js +0 -1
- package/assets/esri/core/workers/chunks/2fa080539d039c92ce08.js +0 -1
- package/assets/esri/core/workers/chunks/3109b05fe4fc40d4f25b.js +0 -1
- package/assets/esri/core/workers/chunks/31442f25d550ead58fc4.js +0 -1
- package/assets/esri/core/workers/chunks/32323b0e0fcecd8f640e.js +0 -1
- package/assets/esri/core/workers/chunks/330da3828eefd8d72d3f.js +0 -1
- package/assets/esri/core/workers/chunks/33e0130e6a40fc768978.js +0 -1
- package/assets/esri/core/workers/chunks/343ba5ea459e96ba79c6.js +0 -1
- package/assets/esri/core/workers/chunks/388e71e8f2ec41bfa5a9.js +0 -1
- package/assets/esri/core/workers/chunks/3a5c1c501808352857bd.js +0 -1
- package/assets/esri/core/workers/chunks/3aacaa1be5efeac23a37.js +0 -1
- package/assets/esri/core/workers/chunks/3b765a8cac9e92f644f2.js +0 -1
- package/assets/esri/core/workers/chunks/3bf6d55511cd7722eb93.js +0 -1
- package/assets/esri/core/workers/chunks/3e012cd3ca4451f89f59.js +0 -1
- package/assets/esri/core/workers/chunks/3fbb6ff940156a981983.js +0 -1
- package/assets/esri/core/workers/chunks/40910c69307e2d2d3f28.js +0 -1
- package/assets/esri/core/workers/chunks/40c4e14e7bb505ef10a3.js +0 -1
- package/assets/esri/core/workers/chunks/4104fa1ede36bcee9be5.js +0 -1
- package/assets/esri/core/workers/chunks/423a9882abd4a6dadf86.js +0 -1
- package/assets/esri/core/workers/chunks/428561df7ba6f02e2d80.js +0 -1
- package/assets/esri/core/workers/chunks/45323491f9005629c602.js +0 -1
- package/assets/esri/core/workers/chunks/46d0a25d33b5b328cfce.js +0 -1
- package/assets/esri/core/workers/chunks/47dd2bfecc5c4b5f10f0.js +0 -1
- package/assets/esri/core/workers/chunks/4845df00f6ebcce6ea3e.js +0 -1
- package/assets/esri/core/workers/chunks/48fcc10768d93e95a04e.js +0 -1
- package/assets/esri/core/workers/chunks/4a9dd9f8aa98882218f3.js +0 -1
- package/assets/esri/core/workers/chunks/4bfffdfbe6d467f143a4.js +0 -1
- package/assets/esri/core/workers/chunks/518046d2b95a7590a092.js +0 -1
- package/assets/esri/core/workers/chunks/54dad475dc806a38c287.js +0 -1
- package/assets/esri/core/workers/chunks/552945a73a95cd2a9f54.js +0 -1
- package/assets/esri/core/workers/chunks/5553279998ae07b60f5f.js +0 -1
- package/assets/esri/core/workers/chunks/58155f24f8ed6aca7a21.js +0 -1
- package/assets/esri/core/workers/chunks/5838f46d341d2fde42ee.js +0 -1
- package/assets/esri/core/workers/chunks/592a599f514de373dead.js +0 -1
- package/assets/esri/core/workers/chunks/5aba23584e0b230c75f5.js +0 -1
- package/assets/esri/core/workers/chunks/5f9bacee6fbf9ac1bca0.js +0 -1
- package/assets/esri/core/workers/chunks/62206d5d497b95fc4caf.js +0 -1
- package/assets/esri/core/workers/chunks/624b1bb269744142b835.js +0 -1
- package/assets/esri/core/workers/chunks/62fc3c367f736c73b0d7.js +0 -1
- package/assets/esri/core/workers/chunks/643c33a98f2d30a92001.js +0 -1
- package/assets/esri/core/workers/chunks/64daa2a714e59d22bbd4.js +0 -1
- package/assets/esri/core/workers/chunks/65621650a53f69f7b05a.js +0 -1
- package/assets/esri/core/workers/chunks/6a5356ebed70e0f8f979.js +0 -1
- package/assets/esri/core/workers/chunks/6c9933f948efd7923aa1.js +0 -1
- package/assets/esri/core/workers/chunks/6cab67fc7044ee9b863b.js +0 -1
- package/assets/esri/core/workers/chunks/7014e73dfd3c8baa704c.js +0 -1
- package/assets/esri/core/workers/chunks/75839240022b280929f7.js +0 -1
- package/assets/esri/core/workers/chunks/76589434d573111a8fb4.js +0 -1
- package/assets/esri/core/workers/chunks/767ea5b455b3823afd09.js +0 -1
- package/assets/esri/core/workers/chunks/77859a61d059738d057f.js +0 -1
- package/assets/esri/core/workers/chunks/78aa5bc6af2758da20d0.js +0 -1
- package/assets/esri/core/workers/chunks/7b564226def99fcf79d8.js +0 -1
- package/assets/esri/core/workers/chunks/7bbffe07e62897928773.js +0 -1
- package/assets/esri/core/workers/chunks/7cadfd7444a2a05cf2fb.js +0 -1
- package/assets/esri/core/workers/chunks/7df94cb985db41815fad.js +0 -2
- package/assets/esri/core/workers/chunks/823789261ca3338f0fa8.js +0 -1
- package/assets/esri/core/workers/chunks/8419934bec7723b0feef.js +0 -1
- package/assets/esri/core/workers/chunks/84b0b6e099d949e0fea5.js +0 -1
- package/assets/esri/core/workers/chunks/9133c1b7cc1c9da27deb.js +0 -1
- package/assets/esri/core/workers/chunks/92ab5886aa2d8b9b179f.js +0 -1
- package/assets/esri/core/workers/chunks/9a6e62ef984e9c5babc4.js +0 -1
- package/assets/esri/core/workers/chunks/9b676606bf839b7aa433.js +0 -1
- package/assets/esri/core/workers/chunks/9d27cc631bab8aa7479e.js +0 -1
- package/assets/esri/core/workers/chunks/9dcfaca1f4fa8c8026ac.js +0 -1
- package/assets/esri/core/workers/chunks/9f23a61c60949459c14f.js +0 -30
- package/assets/esri/core/workers/chunks/a03c4c0bf138734a002e.js +0 -1
- package/assets/esri/core/workers/chunks/a0fa60a24e58f7a47e41.js +0 -1
- package/assets/esri/core/workers/chunks/a261f4c22224511fdfff.js +0 -1
- package/assets/esri/core/workers/chunks/a2ac139d0975085279a6.js +0 -1
- package/assets/esri/core/workers/chunks/a806ac351ef5da04c250.js +0 -1
- package/assets/esri/core/workers/chunks/ab94c9f62462d7a98f6a.js +0 -1
- package/assets/esri/core/workers/chunks/abdb05754c50776c3edd.js +0 -1
- package/assets/esri/core/workers/chunks/ad488985824fbb830ed6.js +0 -1
- package/assets/esri/core/workers/chunks/b0ac4b0b7aec70cfe6eb.js +0 -1
- package/assets/esri/core/workers/chunks/b23009d9f8eb7c20ce45.js +0 -1
- package/assets/esri/core/workers/chunks/bfbd1ca28ed2f263e58f.js +0 -1
- package/assets/esri/core/workers/chunks/c1b6de0d728d25d7905a.js +0 -1
- package/assets/esri/core/workers/chunks/c44be4aaba829e6d149d.js +0 -1
- package/assets/esri/core/workers/chunks/ca6907e14b1dde4d5c07.js +0 -1
- package/assets/esri/core/workers/chunks/cbbd94c53e75efc99876.js +0 -1
- package/assets/esri/core/workers/chunks/ce0e627a5e1cb78adce8.js +0 -1
- package/assets/esri/core/workers/chunks/cf7acf5acb6d322fd996.js +0 -1
- package/assets/esri/core/workers/chunks/d21480b078ec9680d4c4.js +0 -1
- package/assets/esri/core/workers/chunks/d81291dac1932350eccd.js +0 -1
- package/assets/esri/core/workers/chunks/da3c54e27a808f4fcc18.js +0 -1
- package/assets/esri/core/workers/chunks/dc6d50e1097a920ff820.js +0 -1
- package/assets/esri/core/workers/chunks/dd58286dde3b20356f84.js +0 -1
- package/assets/esri/core/workers/chunks/dfeddb7b17fa9eaae64c.js +0 -1
- package/assets/esri/core/workers/chunks/e4e0c5a45cf32973d5d5.js +0 -1
- package/assets/esri/core/workers/chunks/e638391801ad83fe4a68.js +0 -1
- package/assets/esri/core/workers/chunks/e755477dc78e9d6038d4.js +0 -1
- package/assets/esri/core/workers/chunks/e7712467db46e1385cf4.js +0 -1
- package/assets/esri/core/workers/chunks/ed2cb60e4f17f46fb78d.js +0 -1
- package/assets/esri/core/workers/chunks/edb55329305becdb204f.js +0 -1
- package/assets/esri/core/workers/chunks/f02fe24177e56a7e42b2.js +0 -1
- package/assets/esri/core/workers/chunks/f1fb2f12371f4c562079.js +0 -1
- package/assets/esri/core/workers/chunks/f3dfe1bd1146a6927407.js +0 -1
- package/assets/esri/core/workers/chunks/ff48334528d2554db4fe.js +0 -1
- package/views/3d/analysis/LineOfSight/LineOfSightAuthoringStore.js +0 -2
- /package/assets/esri/core/workers/chunks/{7df94cb985db41815fad.js.LICENSE.txt → 68f9b2da1fd08785320f.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{875cce0be4f6c89f80f3.js.LICENSE.txt → 9629601de5e44ffe90ea.js.LICENSE.txt} +0 -0
|
@@ -6,6 +6,8 @@ import type { AttachmentInputUnion } from "../../../form/elements/inputs/attachm
|
|
|
6
6
|
import type { AttributeFormSupportedLayerUnion, PendingAttachmentEdits } from "../types.js";
|
|
7
7
|
import type { ArcadeBatchFormCalculationContextInfo } from "../expressions/types.js";
|
|
8
8
|
import type { EditableInputProperties } from "./EditableInput.js";
|
|
9
|
+
import type { AttachmentEditState } from "./types.js";
|
|
10
|
+
import type { AttachmentValidationCriterionKey, AttachmentValidationCriterionState } from "./support/attachmentValidationCriteriaState.js";
|
|
9
11
|
|
|
10
12
|
/** @since 5.1 */
|
|
11
13
|
export interface AttachmentElementInputProperties extends EditableInputProperties, Partial<Pick<AttachmentElementInput, "attachments" | "displayCount">> {}
|
|
@@ -109,18 +111,18 @@ export default class AttachmentElementInput extends EditableInput<any> {
|
|
|
109
111
|
* @returns The current staged edit state for the provided attachment.
|
|
110
112
|
* @internal
|
|
111
113
|
*/
|
|
112
|
-
getAttachmentEditState(attachment: AttachmentInfo):
|
|
113
|
-
initialName: string | null;
|
|
114
|
-
isDeleted: boolean;
|
|
115
|
-
isRenamed: boolean;
|
|
116
|
-
isReplaced: boolean;
|
|
117
|
-
};
|
|
114
|
+
getAttachmentEditState(attachment: AttachmentInfo): AttachmentEditState;
|
|
118
115
|
/**
|
|
119
116
|
* @param attachment - Attachment whose preview URL should be resolved.
|
|
120
117
|
* @param thumbnailSize - Optional thumbnail width to request for committed service-backed attachments.
|
|
121
118
|
* @internal
|
|
122
119
|
*/
|
|
123
120
|
getAttachmentPreviewUrl(attachment: AttachmentInfo, thumbnailSize?: number): string | null;
|
|
121
|
+
/**
|
|
122
|
+
* @param key - The validation criterion key to read.
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
125
|
+
getValidationCriterionState(key: AttachmentValidationCriterionKey): AttachmentValidationCriterionState | null;
|
|
124
126
|
/**
|
|
125
127
|
* @param file - File to validate against the configured attachment input types.
|
|
126
128
|
* @internal
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../request.js";import a from"../../../core/Collection.js";import n from"../../../core/Logger.js";import{isAbortError as s}from"../../../core/promiseUtils.js";import i from"../../../core/ReactiveMap.js";import r from"../../../core/ReactiveSet.js";import{generateBracedUUID as o}from"../../../core/uuid.js";import{property as d,subclass as l}from"../../../core/accessorSupport/decorators.js";import{getEffectiveLayerCapabilities as p}from"../../../layers/support/layerUtils.js";import h from"../../../rest/query/support/AttachmentInfo.js";import{getAttachmentTypeCategory as c}from"../../Attachments/support/attachmentUtils.js";import{getAttachmentUrl as m}from"../attachmentUtils.js";import{isAttributeFormSupportedLayer as u}from"../batchAttributeFormUtils.js";import g from"./EditableInput.js";import y from"./SingleFeatureInputAdapter.js";let f=-1,_=class extends g{constructor(t){super(t),this.attachments=[],this.displayCount=3,this.group=null,this.single=new y({input:this}),this.type="attachment",this._initialAttachments=[],this._stagedAdds=new a,this._stagedDeletes=new r,this._stagedUpdates=new i,this._failedStagedUpdateHydrations=new r,this._pendingStagedUpdateHydrations=new i,this._temporaryAttachmentUrls=new i}get allowUserRename(){return this.template.allowUserRename}get addDisabled(){const t=this.maxAttachmentCount,e=this.effectiveAttachmentCount;return null!=t&&e>=t}get effectiveAttachmentCount(){return this._initialAttachments.length-this._stagedDeletes.size+this._stagedAdds.length}get accept(){const{categories:t}=this;if(!t.size)return;const e=[];return t.has("image")&&e.push("image/*"),t.has("audio")&&e.push("audio/*"),t.has("video")&&e.push("video/*"),t.has("document")&&e.push("text/*","application/*","model/*"),e.length>0?e.join(","):void 0}get categories(){const{input:t}=this,e=new Set;if(!t)return e;if("attachment"===t.type){const{inputTypes:a}=t;if(!a||0===a.length)return e;for(const t of a)U(e,t.type);return e}return U(e,t.type),e}get captureDisabled(){const{input:t}=this;if(!t)return!1;if("attachment"===t.type){const{inputTypes:e}=t;return!!e?.length&&e.every(v)}return v(t)}get captureMediaType(){const{input:t}=this;if(!t)return null;const e=new Set,a=b(t);if(!a?.length)return null;for(const n of a)if(S(n))switch(n.type){case"audio":e.add("audio");break;case"video":e.add("video");break;case"image":case"signature":e.add("image")}return 1===e.size?Array.from(e)[0]:null}get canUploadFiles(){const{input:t}=this;if(!t)return!0;if("attachment"===t.type){const{inputTypes:e}=t;return!e?.length||e.some(I)}return I(t)}get hasCaptureInputs(){const{input:t}=this;return!!t&&("attachment"===t.type?!!t.inputTypes?.some(S):S(t))}get attachmentKeyword(){return this.template.attachmentKeyword?.trim()}get displayFilename(){return this.template.displayFilename}get allAttachmentsVisibleOnDefaultPage(){return this.defaultPageAttachments.length===this.attachments.length}get defaultPageAttachments(){return this.attachments.slice(0,this.displayCount)}get feature(){return this.single.feature}get hasAttachmentChanges(){return this._stagedAdds.length>0||this._stagedUpdates.size>0||this._stagedDeletes.size>0}get hasPendingAttachmentUpdateData(){return this._pendingStagedUpdateHydrations.size>0}get input(){return this.template.input}get layer(){return this.single.layer}get maxAttachmentCount(){return this.template.maxAttachmentCount}get minAttachmentCount(){return this.template.minAttachmentCount}get supportsResize(){const{layer:t}=this;if(!t)return!1;const e=p(t);return!!e&&("attachment"in e&&!!e.attachment?.supportsResize)}get useOriginalFilename(){return this.template.useOriginalFilename}get valid(){const t=this.effectiveAttachmentCount,e=this.minAttachmentCount??-1/0,a=this.maxAttachmentCount??1/0,n=this.hasAttachmentChanges;return!(this._failedStagedUpdateHydrations.size>0)&&(!(t<e||t>a)||!n)}get _expressionLayer(){const t=this.layer;if(t)return"scene"===t.type&&"associatedLayer"in t&&null!=t.associatedLayer?t.associatedLayer:"feature"===t.type?t:void 0}destroy(){this._clearTemporaryAttachmentUrls()}applyFetchedAttachments(t){for(const e of t)this._normalizeAttachmentName(e);this._initialAttachments=t,this._failedStagedUpdateHydrations.clear(),this._recomputeAttachments()}clearAttachmentChanges(){this._clearTemporaryAttachmentUrls(),this._stagedAdds.removeAll(),this._stagedUpdates.clear(),this._stagedDeletes.clear(),this._failedStagedUpdateHydrations.clear(),this._pendingStagedUpdateHydrations.clear(),this._recomputeAttachments()}stageAddAttachment(t){const{contentType:e,data:a,name:n}=t,s=t.globalId??o(),i=a instanceof Blob?a.size:void 0,r=n.trim(),d=new h({contentType:e??void 0,globalId:s,id:f--,keywords:this.attachmentKeyword??void 0,name:r,size:i});return this._setTemporaryAttachmentUrl(s,a),this._stagedAdds.add({globalId:s,info:d,data:a}),this._recomputeAttachments(),d}async stageAddAttachments(t,e){const a=t.filter(t=>this.isFileAllowed(t));if(0===a.length)return[];const n=[],s=new Map,i=Date.now();for(let r=0;r<a.length;r++){const t=a[r],o=t instanceof File?t.name:`attachment-${i}_${r+1}`,d=await this._computeAttachmentFilename(o,e),l=this._makeUniqueFilenameForOperation(s,d);n.push(this.stageAddAttachment({contentType:t.type,data:t,name:l}))}return n}findAttachment(t){if(t)return this.attachments.find(e=>e.globalId===t)}getAttachmentEditState(t){const e=t.globalId,a=e?this._getInitialAttachment(e):void 0,n=a?.name??null,s=e?this._stagedUpdates.get(e):void 0,i=s?.name??t.name??null;return{initialName:n,isDeleted:!!e&&this._stagedDeletes.has(e),isRenamed:null!=i&&null!=n&&i!==n,isReplaced:!!s?.data}}getAttachmentPreviewUrl(t,e){return(t.globalId?this._temporaryAttachmentUrls.get(t.globalId):void 0)??m(t,this.supportsResize,e)}async ensureStagedUpdateData(t){const e=t.globalId;if(!e)return!1;const a=this._stagedUpdates.get(e);if(!a||a.data||this._stagedDeletes.has(e))return this._failedStagedUpdateHydrations.delete(e),!1;const n=this._pendingStagedUpdateHydrations.get(e);if(n)return await n;const s=this._hydrateStagedUpdateData(t);this._pendingStagedUpdateHydrations.set(e,s);try{return await s}finally{this._pendingStagedUpdateHydrations.get(e)===s&&this._pendingStagedUpdateHydrations.delete(e)}}async waitForPendingAttachmentUpdateData(){await Promise.allSettled(Array.from(this._pendingStagedUpdateHydrations.values()))}discardStagedEdits(t){const e=t.globalId;if(!e)return;const a=this._stagedAdds.findIndex(t=>t.globalId===e);if(a>-1)return this._clearTemporaryAttachmentUrl(e),this._stagedAdds.removeAt(a),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),void this._recomputeAttachments();this._clearTemporaryAttachmentUrl(e),this._stagedDeletes.delete(e),this._stagedUpdates.delete(e),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),this._recomputeAttachments()}isFileAllowed(t){if(!t.type)return!0;const{categories:e}=this;return!e.size||e.has(c(t.type))}isStagedAttachmentAddition(t){return"number"==typeof t.id&&t.id<0}stageDeleteAttachment(t){const e=t.globalId;if(!e)return;const a=this._stagedAdds.findIndex(t=>t.globalId===e);if(a>-1)return this._clearTemporaryAttachmentUrl(e),this._stagedAdds.removeAt(a),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),void this._recomputeAttachments();this._clearTemporaryAttachmentUrl(e),this._stagedUpdates.delete(e),this._stagedDeletes.add(e),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),this._recomputeAttachments()}stageRenameAttachment(t,e){const a=t.globalId;if(!a)return;const n=this._stagedAdds.find(t=>t.globalId===a);if(n)return n.info.name=e,void this._recomputeAttachments();const s=this._stagedUpdates.get(a),i=this._getInitialAttachment(a)?.name??null,r=null!=i&&e===i;if(r&&null==s?.data&&null==s?.contentType&&null==s?.size)return this._stagedUpdates.delete(a),this._failedStagedUpdateHydrations.delete(a),this._pendingStagedUpdateHydrations.delete(a),void this._recomputeAttachments();const o={...s,info:t};r?delete o.name:o.name=e,this._stagedUpdates.set(a,o),this._recomputeAttachments(),this.ensureStagedUpdateData(t)}async stageReplaceAttachment(t,e,a){if(!this.isFileAllowed(e))return!1;const n=e instanceof File?e.name:t.name,s=await this._computeAttachmentFilename(n,a);return this._stageReplaceAttachment(t,e,s),!0}toSubmitEdits(){const t=[],e=[],a=Array.from(this._stagedDeletes);if(0===this._stagedAdds.length&&0===this._stagedUpdates.size&&0===a.length)return null;const s=this._featureIdentifier;if(!s)return n.getLogger(this).error("Unable to build attachment edits without a valid feature and layer."),null;for(const n of this._stagedAdds)t.push({feature:s,attachment:{globalId:n.globalId,contentType:n.info.contentType,data:n.data,name:n.info.name}});for(const[n,i]of this._stagedUpdates)this._canSubmitStagedUpdate(i)&&e.push({feature:s,attachment:{globalId:n,contentType:i.contentType,data:i.data,name:i.name}});return 0===t.length&&0===e.length&&0===a.length?null:{label:this.template.label,attachmentKeyword:this.attachmentKeyword,add:t,delete:a,update:e}}_recomputeAttachments(){const t=[];for(const e of this._stagedAdds)t.push(e.info);for(const e of this._initialAttachments){const a=e.globalId;if(a&&this._stagedUpdates.has(a)){const n=this._stagedUpdates.get(a),s=e.clone();null!=n.name&&(s.name=n.name),null!=n.contentType&&(s.contentType=n.contentType),null!=n.size&&(s.size=n.size),t.push(s);continue}t.push(e)}this.attachments=t}get _featureIdentifier(){const t=this.single.feature,e=this.layer;if(!t||!u(e))return null;const a=e.objectIdField,n="globalIdField"in e?e.globalIdField:null,s=t.getGlobalId()??(n?t.getAttribute(n):void 0);if(s)return{globalId:s};const i=t.getObjectId()??t.getAttribute(a),r=Number(i);return null==i||isNaN(r)?null:{objectId:r}}async _computeAttachmentFilename(t,e){const a=this.template.filenameExpressionExecutor;if(!a)return t;const i=this.single.feature,r=i?.plainGraphic,o=this._expressionLayer,d={$originalfeature:i?.original,$editcontext:{editType:e.editType},$layer:o,$featureset:o,$datastore:o?.url,$feature:r,$map:e.map},l={rawOutput:!0,spatialReference:e.spatialReference,timeZone:e.timeZone};try{const t=a.isAsync?await a.executeAsync(d,l):a.execute(d,l);if("string"==typeof t&&t.trim().length>0)return t.trim()}catch(p){s(p)||n.getLogger(this).error("Failed evaluating attachment filename expression",p)}return t}_makeUniqueFilenameForOperation(t,e){const a=e.toLowerCase(),n=t.get(a)??0;if(t.set(a,n+1),0===n)return e;const s=e.lastIndexOf(".");return`${s>0?e.slice(0,s):e}_${n}${s>0?e.slice(s):""}`}_stageReplaceAttachment(t,e,a){const n=t.globalId;if(!n)return;const s=this._stagedAdds.find(t=>t.globalId===n);if(s)return s.data=e,s.info.name=a,s.info.contentType=e.type,s.info.size=e.size,this._setTemporaryAttachmentUrl(n,e),void this._recomputeAttachments();const i=this._stagedUpdates.get(n);this._setTemporaryAttachmentUrl(n,e),this._failedStagedUpdateHydrations.delete(n),this._pendingStagedUpdateHydrations.delete(n),this._stagedUpdates.set(n,{...i,info:t,contentType:e.type||i?.contentType||t.contentType,data:e,name:a,size:e.size}),this._recomputeAttachments()}_getInitialAttachment(t){return this._initialAttachments.find(e=>e.globalId===t)}_canSubmitStagedUpdate(t){return null!=t.data}_normalizeAttachmentName(t){const{name:e}=t;"string"==typeof e&&(t.name=e.trim())}async _hydrateStagedUpdateData(t){const a=t.globalId,i=t.url;if(!a||!i)return!1;try{const{data:n}=await e(i,{responseType:"blob"});this._failedStagedUpdateHydrations.delete(a);const s=this._stagedUpdates.get(a);return!(!s||s.data||this._stagedDeletes.has(a))&&(this._stagedUpdates.set(a,{...s,info:t,contentType:s.contentType??t.contentType??n.type,data:n}),!0)}catch(r){const t=this._stagedUpdates.get(a);return!t||t.data||this._stagedDeletes.has(a)||this._failedStagedUpdateHydrations.add(a),s(r)||n.getLogger(this).error("Failed to fetch attachment data for staged update",r),!1}}_setTemporaryAttachmentUrl(t,e){if(this._clearTemporaryAttachmentUrl(t),!(e instanceof Blob))return;const a=URL.createObjectURL(e);return this._temporaryAttachmentUrls.set(t,a),a}_clearTemporaryAttachmentUrl(t){const e=this._temporaryAttachmentUrls.get(t);e&&(URL.revokeObjectURL(e),this._temporaryAttachmentUrls.delete(t))}_clearTemporaryAttachmentUrls(){for(const t of this._temporaryAttachmentUrls.values())URL.revokeObjectURL(t);this._temporaryAttachmentUrls.clear()}};t([d()],_.prototype,"allowUserRename",null),t([d()],_.prototype,"addDisabled",null),t([d()],_.prototype,"effectiveAttachmentCount",null),t([d()],_.prototype,"accept",null),t([d()],_.prototype,"categories",null),t([d()],_.prototype,"captureDisabled",null),t([d()],_.prototype,"captureMediaType",null),t([d()],_.prototype,"canUploadFiles",null),t([d()],_.prototype,"hasCaptureInputs",null),t([d()],_.prototype,"attachmentKeyword",null),t([d()],_.prototype,"attachments",void 0),t([d()],_.prototype,"displayFilename",null),t([d({readOnly:!0})],_.prototype,"allAttachmentsVisibleOnDefaultPage",null),t([d({readOnly:!0})],_.prototype,"defaultPageAttachments",null),t([d()],_.prototype,"displayCount",void 0),t([d()],_.prototype,"feature",null),t([d()],_.prototype,"group",void 0),t([d({readOnly:!0})],_.prototype,"hasAttachmentChanges",null),t([d({readOnly:!0})],_.prototype,"hasPendingAttachmentUpdateData",null),t([d()],_.prototype,"input",null),t([d()],_.prototype,"layer",null),t([d()],_.prototype,"maxAttachmentCount",null),t([d()],_.prototype,"minAttachmentCount",null),t([d({readOnly:!0})],_.prototype,"single",void 0),t([d({readOnly:!0})],_.prototype,"type",void 0),t([d({readOnly:!0})],_.prototype,"supportsResize",null),t([d()],_.prototype,"useOriginalFilename",null),t([d({readOnly:!0})],_.prototype,"valid",null),t([d()],_.prototype,"_initialAttachments",void 0),t([d()],_.prototype,"_expressionLayer",null),t([d()],_.prototype,"_stagedAdds",void 0),t([d()],_.prototype,"_stagedDeletes",void 0),t([d()],_.prototype,"_stagedUpdates",void 0),t([d()],_.prototype,"_failedStagedUpdateHydrations",void 0),t([d()],_.prototype,"_pendingStagedUpdateHydrations",void 0),t([d()],_.prototype,"_temporaryAttachmentUrls",void 0),t([d()],_.prototype,"_featureIdentifier",null),_=t([l("esri.widgets.BatchAttributeForm.inputs.AttachmentElementInput")],_);const A=_;function U(t,e){switch(e){case"audio":t.add("audio");break;case"document":t.add("document");break;case"image":case"signature":t.add("image");break;case"video":t.add("video")}}function b(t){return"attachment"===t.type?t.inputTypes:[t]}function v(t){return"document"!==t.type&&"capture"===t.inputMethod}function S(t){return v(t)}function I(t){return"document"===t.type||"capture"!==t.inputMethod}export{A as default};
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../request.js";import a from"../../../core/Collection.js";import n from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import s from"../../../core/ReactiveMap.js";import r from"../../../core/ReactiveSet.js";import{generateBracedUUID as o}from"../../../core/uuid.js";import{property as d,subclass as l}from"../../../core/accessorSupport/decorators.js";import{getEffectiveLayerCapabilities as h}from"../../../layers/support/layerUtils.js";import c from"../../../rest/query/support/AttachmentInfo.js";import{getAttachmentTypeCategory as p}from"../../Attachments/support/attachmentUtils.js";import{getAttachmentUrl as m,attachmentValidationUtils as u}from"../attachmentUtils.js";import{isAttributeFormSupportedLayer as g}from"../batchAttributeFormUtils.js";import y from"./EditableInput.js";import f from"./SingleFeatureInputAdapter.js";let _=-1;const A=["maximum-audio-length","maximum-file-size","minimum-number-of-files","maximum-number-of-files","maximum-video-length"];let U=class extends y{constructor(t){super(t),this.attachments=[],this.displayCount=3,this.group=null,this.single=new f({input:this}),this.type="attachment",this._initialAttachments=[],this._stagedAdds=new a,this._stagedDeletes=new r,this._stagedUpdates=new s,this._failedStagedUpdateHydrations=new r,this._pendingStagedUpdateHydrations=new s,this._temporaryAttachmentUrls=new s,this._validationCriterionStates=new s,this._hasUnsupportedFileTypeValidationError=!1}get allowUserRename(){return this.template.allowUserRename}get addDisabled(){const t=this.maxAttachmentCount,e=this.effectiveAttachmentCount;return null!=t&&e>=t}get effectiveAttachmentCount(){return this._initialAttachments.length-this._stagedDeletes.size+this._stagedAdds.length}get accept(){const{categories:t}=this;if(!t.size)return;const e=[];return t.has("image")&&e.push("image/*"),t.has("audio")&&e.push("audio/*"),t.has("video")&&e.push("video/*"),t.has("document")&&e.push("text/*","application/*","model/*"),e.length>0?e.join(","):void 0}get categories(){const t=new Set;for(const e of this._nestableInputs)v(t,e.type);return t}get _nestableInputs(){const{input:t}=this;return null==t?[]:"attachment"===t.type?t.inputTypes??[]:[t]}get attachmentKeyword(){return this.template.attachmentKeyword?.trim()}get displayFilename(){return this.template.displayFilename}get allAttachmentsVisibleOnDefaultPage(){return this.defaultPageAttachments.length===this.attachments.length}get canUploadFiles(){const t=this._nestableInputs;return!t.length||t.some(I)}get hasCaptureInputs(){return this._nestableInputs.some(C)}get captureMediaType(){const t=new Set;for(const e of this._nestableInputs)if(C(e))switch(e.type){case"audio":t.add("audio");break;case"video":t.add("video");break;case"image":case"signature":t.add("image")}return 1===t.size?Array.from(t)[0]:null}get isCaptureOnly(){const t=this._nestableInputs;return!!t.length&&t.every(S)}get defaultPageAttachments(){return this.attachments.slice(0,this.displayCount)}get feature(){return this.single.feature}get hasAttachmentChanges(){return this._stagedAdds.length>0||this._stagedUpdates.size>0||this._stagedDeletes.size>0}get attachmentCount(){return this.attachments.length}get hasMinimumAttachmentCountNotMet(){const t=this.minAttachmentCount,e=this.effectiveAttachmentCount;return null!=t&&e<t}get hasReachedAttachmentLimit(){const t=this.maxAttachmentCount,e=this.effectiveAttachmentCount;return null!=t&&e===t}get hasExceededAttachmentLimit(){const t=this.maxAttachmentCount,e=this.effectiveAttachmentCount;return null!=t&&e>t}get hasPendingAttachmentUpdateData(){return this._pendingStagedUpdateHydrations.size>0}get input(){return this.template.input}get layer(){return this.single.layer}get maxAttachmentCount(){return this.template.maxAttachmentCount}get minAttachmentCount(){return this.template.minAttachmentCount}get supportsResize(){const{layer:t}=this;if(!t)return!1;const e=h(t);return!!e&&("attachment"in e&&!!e.attachment?.supportsResize)}get useOriginalFilename(){return this.template.useOriginalFilename}get valid(){const t=this.effectiveAttachmentCount,e=this.minAttachmentCount??-1/0,a=this.maxAttachmentCount??1/0,n=this.hasAttachmentChanges;return!(this._failedStagedUpdateHydrations.size>0)&&(!(t<e||t>a)||!n)}get _expressionLayer(){const t=this.layer;if(t)return"scene"===t.type&&"associatedLayer"in t&&null!=t.associatedLayer?t.associatedLayer:"feature"===t.type?t:void 0}destroy(){this._clearTemporaryAttachmentUrls()}applyFetchedAttachments(t){for(const e of t)this._normalizeAttachmentName(e);this._initialAttachments=t,this._failedStagedUpdateHydrations.clear(),this._recomputeAttachments()}clearAttachmentChanges(){this.clearValidationCriteriaState(),this._clearTemporaryAttachmentUrls(),this._stagedAdds.removeAll(),this._stagedUpdates.clear(),this._stagedDeletes.clear(),this._failedStagedUpdateHydrations.clear(),this._pendingStagedUpdateHydrations.clear(),this._recomputeAttachments()}clearValidationCriteriaState(){this._validationCriterionStates.clear(),this._hasUnsupportedFileTypeValidationError=!1}get hasInvalidValidationCriteria(){for(const t of this._validationCriterionStates.values())if("danger"===t)return!0;return!1}hasUnsupportedFileTypeValidationError(){return this._hasUnsupportedFileTypeValidationError}getValidationCriterionState(t){return this._validationCriterionStates.get(t)??null}stageAddAttachment(t){const{contentType:e,data:a,name:n}=t,i=t.globalId??o(),s=a instanceof Blob?a.size:void 0,r=n.trim(),d=new c({contentType:e??void 0,globalId:i,id:_--,keywords:this.attachmentKeyword??void 0,name:r,size:s});return this._setTemporaryAttachmentUrl(i,a),this._stagedAdds.add({globalId:i,info:d,data:a}),this._recomputeAttachments(),d}async stageAddAttachments(t,e){this.clearValidationCriteriaState();const a=t.filter(t=>this.isFileAllowed(t));if(this._hasUnsupportedFileTypeValidationError=a.length!==t.length,0===a.length)return[];const n=[],i=new Map,s=Date.now(),r={},o=this.attachmentCount,d=o+a.length;null!=this.minAttachmentCount&&this.minAttachmentCount>0&&this._setValidationCriterionState(r,"minimum-number-of-files",d>=this.minAttachmentCount?"success":"danger");for(let l=0;l<a.length;l++){const t=a[l];if(!await this._validateAttachmentFile(t,o+n.length+1,r))continue;const d=t instanceof File?t.name:`attachment-${s}_${l+1}`,h=await this._computeAttachmentFilename(d,e),c=this._makeUniqueFilenameForOperation(i,h);n.push(this.stageAddAttachment({contentType:t.type,data:t,name:c}))}return this._setValidationCriteriaState(r),n}findAttachment(t){if(t)return this.attachments.find(e=>e.globalId===t)}getAttachmentEditState(t){const e=t.globalId,a=e?this._getInitialAttachment(e):void 0,n=a?.name??null,i=e?this._stagedUpdates.get(e):void 0,s=i?.name??t.name??null;return{initialName:n,isDeleted:!!e&&this._stagedDeletes.has(e),isRenamed:null!=s&&null!=n&&s!==n,isReplaced:!!i?.data}}getAttachmentPreviewUrl(t,e){return(t.globalId?this._temporaryAttachmentUrls.get(t.globalId):void 0)??m(t,this.supportsResize,e)}async ensureStagedUpdateData(t){const e=t.globalId;if(!e)return!1;const a=this._stagedUpdates.get(e);if(!a||a.data||this._stagedDeletes.has(e))return this._failedStagedUpdateHydrations.delete(e),!1;const n=this._pendingStagedUpdateHydrations.get(e);if(n)return await n;const i=this._hydrateStagedUpdateData(t);this._pendingStagedUpdateHydrations.set(e,i);try{return await i}finally{this._pendingStagedUpdateHydrations.get(e)===i&&this._pendingStagedUpdateHydrations.delete(e)}}async waitForPendingAttachmentUpdateData(){await Promise.allSettled(Array.from(this._pendingStagedUpdateHydrations.values()))}discardStagedEdits(t){const e=t.globalId;if(!e)return;const a=this._stagedAdds.findIndex(t=>t.globalId===e);if(a>-1)return this._clearTemporaryAttachmentUrl(e),this._stagedAdds.removeAt(a),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),void this._recomputeAttachments();this._clearTemporaryAttachmentUrl(e),this._stagedDeletes.delete(e),this._stagedUpdates.delete(e),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),this._recomputeAttachments()}isFileAllowed(t){if(!t.type)return!0;const{categories:e}=this;return!e.size||e.has(p(t.type))}isStagedAttachmentAddition(t){return"number"==typeof t.id&&t.id<0}stageDeleteAttachment(t){const e=t.globalId;if(!e)return;const a=this._stagedAdds.findIndex(t=>t.globalId===e);if(a>-1)return this._clearTemporaryAttachmentUrl(e),this._stagedAdds.removeAt(a),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),void this._recomputeAttachments();this._clearTemporaryAttachmentUrl(e),this._stagedUpdates.delete(e),this._stagedDeletes.add(e),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),this._recomputeAttachments()}stageRenameAttachment(t,e){const a=t.globalId;if(!a)return;const n=this._stagedAdds.find(t=>t.globalId===a);if(n)return n.info.name=e,void this._recomputeAttachments();const i=this._stagedUpdates.get(a),s=this._getInitialAttachment(a)?.name??null,r=null!=s&&e===s;if(r&&null==i?.data&&null==i?.contentType&&null==i?.size)return this._stagedUpdates.delete(a),this._failedStagedUpdateHydrations.delete(a),this._pendingStagedUpdateHydrations.delete(a),void this._recomputeAttachments();const o={...i,info:t};r?delete o.name:o.name=e,this._stagedUpdates.set(a,o),this._recomputeAttachments(),this.ensureStagedUpdateData(t)}async stageReplaceAttachment(t,e,a){if(this.clearValidationCriteriaState(),!this.isFileAllowed(e))return this._hasUnsupportedFileTypeValidationError=!0,!1;const n={},i=await this._validateAttachmentFile(e,void 0,n);if(this._setValidationCriteriaState(n),!i)return!1;const s=e instanceof File?e.name:t.name,r=await this._computeAttachmentFilename(s,a);return this._stageReplaceAttachment(t,e,r),!0}toSubmitEdits(){const t=[],e=[],a=Array.from(this._stagedDeletes);if(0===this._stagedAdds.length&&0===this._stagedUpdates.size&&0===a.length)return null;const i=this._featureIdentifier;if(!i)return n.getLogger(this).error("Unable to build attachment edits without a valid feature and layer."),null;for(const n of this._stagedAdds)t.push({feature:i,attachment:{globalId:n.globalId,contentType:n.info.contentType,data:n.data,name:n.info.name}});for(const[n,s]of this._stagedUpdates)this._canSubmitStagedUpdate(s)&&e.push({feature:i,attachment:{globalId:n,contentType:s.contentType,data:s.data,name:s.name}});return 0===t.length&&0===e.length&&0===a.length?null:{label:this.template.label,attachmentKeyword:this.attachmentKeyword,add:t,delete:a,update:e}}_recomputeAttachments(){const t=[];for(const e of this._stagedAdds)t.push(e.info);for(const e of this._initialAttachments){const a=e.globalId;if(a&&this._stagedUpdates.has(a)){const n=this._stagedUpdates.get(a),i=e.clone();null!=n.name&&(i.name=n.name),null!=n.contentType&&(i.contentType=n.contentType),null!=n.size&&(i.size=n.size),t.push(i);continue}t.push(e)}this.attachments=t}get _featureIdentifier(){const t=this.single.feature,e=this.layer;if(!t||!g(e))return null;const a=e.objectIdField,n="globalIdField"in e?e.globalIdField:null,i=t.getGlobalId()??(n?t.getAttribute(n):void 0);if(i)return{globalId:i};const s=t.getObjectId()??t.getAttribute(a),r=Number(s);return null==s||isNaN(r)?null:{objectId:r}}async _computeAttachmentFilename(t,e){const a=this.template.filenameExpressionExecutor;if(!a)return t;const s=this.single.feature,r=s?.plainGraphic,o=this._expressionLayer,d={$originalfeature:s?.original,$editcontext:{editType:e.editType},$layer:o,$featureset:o,$datastore:o?.url,$feature:r,$map:e.map},l={rawOutput:!0,spatialReference:e.spatialReference,timeZone:e.timeZone};try{const t=a.isAsync?await a.executeAsync(d,l):a.execute(d,l);if("string"==typeof t&&t.trim().length>0)return t.trim()}catch(h){i(h)||n.getLogger(this).error("Failed evaluating attachment filename expression",h)}return t}_setValidationCriteriaState(t){this._validationCriterionStates.clear();for(const e of A){const a=t[e];a&&this._validationCriterionStates.set(e,a)}}_setValidationCriterionState(t,e,a){"danger"!==t[e]&&(t[e]=a)}async _validateAttachmentFile(t,e,a){let n=!0;const i=t.type?p(t.type):null;for(const s of this._nestableInputs){const e=u.getAttachmentCategoryForInputType(s.type);if(null==i||e===i){if("document"===s.type&&null!=s.maxFileSize){const e=t.size<=1048576*s.maxFileSize;this._setValidationCriterionState(a,"maximum-file-size",e?"success":"danger"),n=n&&e}if(("audio"===s.type||"video"===s.type)&&null!=s.maxDuration){const e=await u.getMediaDurationInSeconds(t,s.type);if(null!=e){const t=e<=s.maxDuration;this._setValidationCriterionState(a,"audio"===s.type?"maximum-audio-length":"maximum-video-length",t?"success":"danger"),n=n&&t}}}}if(null!=e&&null!=this.maxAttachmentCount){const t=e<=this.maxAttachmentCount;this._setValidationCriterionState(a,"maximum-number-of-files",t?"success":"danger"),n=n&&t}return n}_makeUniqueFilenameForOperation(t,e){const a=e.toLowerCase(),n=t.get(a)??0;if(t.set(a,n+1),0===n)return e;const i=e.lastIndexOf(".");return`${i>0?e.slice(0,i):e}_${n}${i>0?e.slice(i):""}`}_stageReplaceAttachment(t,e,a){const n=t.globalId;if(!n)return;const i=this._stagedAdds.find(t=>t.globalId===n);if(i)return i.data=e,i.info.name=a,i.info.contentType=e.type,i.info.size=e.size,this._setTemporaryAttachmentUrl(n,e),void this._recomputeAttachments();const s=this._stagedUpdates.get(n);this._setTemporaryAttachmentUrl(n,e),this._failedStagedUpdateHydrations.delete(n),this._pendingStagedUpdateHydrations.delete(n),this._stagedUpdates.set(n,{...s,info:t,contentType:e.type||s?.contentType||t.contentType,data:e,name:a,size:e.size}),this._recomputeAttachments()}_getInitialAttachment(t){return this._initialAttachments.find(e=>e.globalId===t)}_canSubmitStagedUpdate(t){return null!=t.data}_normalizeAttachmentName(t){const{name:e}=t;"string"==typeof e&&(t.name=e.trim())}async _hydrateStagedUpdateData(t){const a=t.globalId,s=t.url;if(!a||!s)return!1;try{const{data:n}=await e(s,{responseType:"blob"});this._failedStagedUpdateHydrations.delete(a);const i=this._stagedUpdates.get(a);return!(!i||i.data||this._stagedDeletes.has(a))&&(this._stagedUpdates.set(a,{...i,info:t,contentType:i.contentType??t.contentType??n.type,data:n}),!0)}catch(r){const t=this._stagedUpdates.get(a);return!t||t.data||this._stagedDeletes.has(a)||this._failedStagedUpdateHydrations.add(a),i(r)||n.getLogger(this).error("Failed to fetch attachment data for staged update",r),!1}}_setTemporaryAttachmentUrl(t,e){if(this._clearTemporaryAttachmentUrl(t),!(e instanceof Blob))return;const a=URL.createObjectURL(e);return this._temporaryAttachmentUrls.set(t,a),a}_clearTemporaryAttachmentUrl(t){const e=this._temporaryAttachmentUrls.get(t);e&&(URL.revokeObjectURL(e),this._temporaryAttachmentUrls.delete(t))}_clearTemporaryAttachmentUrls(){for(const t of this._temporaryAttachmentUrls.values())URL.revokeObjectURL(t);this._temporaryAttachmentUrls.clear()}};t([d()],U.prototype,"allowUserRename",null),t([d()],U.prototype,"addDisabled",null),t([d()],U.prototype,"effectiveAttachmentCount",null),t([d()],U.prototype,"accept",null),t([d()],U.prototype,"categories",null),t([d()],U.prototype,"attachmentKeyword",null),t([d()],U.prototype,"attachments",void 0),t([d()],U.prototype,"displayFilename",null),t([d({readOnly:!0})],U.prototype,"allAttachmentsVisibleOnDefaultPage",null),t([d()],U.prototype,"canUploadFiles",null),t([d()],U.prototype,"hasCaptureInputs",null),t([d()],U.prototype,"captureMediaType",null),t([d()],U.prototype,"isCaptureOnly",null),t([d({readOnly:!0})],U.prototype,"defaultPageAttachments",null),t([d()],U.prototype,"displayCount",void 0),t([d()],U.prototype,"feature",null),t([d()],U.prototype,"group",void 0),t([d({readOnly:!0})],U.prototype,"hasAttachmentChanges",null),t([d()],U.prototype,"attachmentCount",null),t([d()],U.prototype,"hasMinimumAttachmentCountNotMet",null),t([d()],U.prototype,"hasReachedAttachmentLimit",null),t([d()],U.prototype,"hasExceededAttachmentLimit",null),t([d({readOnly:!0})],U.prototype,"hasPendingAttachmentUpdateData",null),t([d()],U.prototype,"input",null),t([d()],U.prototype,"layer",null),t([d()],U.prototype,"maxAttachmentCount",null),t([d()],U.prototype,"minAttachmentCount",null),t([d({readOnly:!0})],U.prototype,"single",void 0),t([d({readOnly:!0})],U.prototype,"type",void 0),t([d({readOnly:!0})],U.prototype,"supportsResize",null),t([d()],U.prototype,"useOriginalFilename",null),t([d({readOnly:!0})],U.prototype,"valid",null),t([d()],U.prototype,"_initialAttachments",void 0),t([d()],U.prototype,"_expressionLayer",null),t([d()],U.prototype,"_stagedAdds",void 0),t([d()],U.prototype,"_stagedDeletes",void 0),t([d()],U.prototype,"_stagedUpdates",void 0),t([d()],U.prototype,"_failedStagedUpdateHydrations",void 0),t([d()],U.prototype,"_pendingStagedUpdateHydrations",void 0),t([d()],U.prototype,"_temporaryAttachmentUrls",void 0),t([d()],U.prototype,"hasInvalidValidationCriteria",null),t([d()],U.prototype,"_featureIdentifier",null),U=t([l("esri.widgets.BatchAttributeForm.inputs.AttachmentElementInput")],U);const b=U;function v(t,e){switch(e){case"audio":t.add("audio");break;case"document":t.add("document");break;case"image":case"signature":t.add("image");break;case"video":t.add("video")}}function S(t){return"document"!==t.type&&"capture"===t.inputMethod}function C(t){return S(t)}function I(t){return"document"===t.type||"capture"!==t.inputMethod}export{b as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as i}from"../../../core/MapUtils.js";import{property as l,subclass as r}from"../../../core/accessorSupport/decorators.js";import{isMultipleChoiceInput as o}from"../../../form/elements/inputs/inputUtils.js";import n from"../../../layers/support/CodedValue.js";import s from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as a,dateTimeFieldValuesToNumericRange as u,isDomainValidForField as h}from"../../../layers/support/domainUtils.js";import{isNumericField as p,isStringField as c,isTimeOnlyField as m,getFieldRange as d,isDateOnlyField as f,isTimestampOffsetField as C}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as g}from"../../../layers/support/layerUtils.js";import y from"../../../layers/support/RangeDomain.js";import{isAnyDateField as b}from"../../../smartMapping/support/utils.js";import{isNumber as x}from"../../../support/guards.js";import v from"./EditableInput.js";import{visibilityCodeToBoolean as V,differentValuesString as O,isFieldInputWithShowNoValueOptionInput as F}from"./support/inputUtils.js";import{otherChoiceCheckedPlaceholderValue as M,multipleChoiceOtherChoiceCheckedStateByExpressionsManager as _}from"./support/multipleChoiceInputUtils.js";import{isEmptyValue as S,getMaxLength as w,getMinLength as E,dateIsValid as k,validateFormValue as D}from"../../support/forms/formUtils.js";let N=class extends v{constructor(e){super(e),this.getFieldValueOptionsForFeature=null,this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return"batch-attribute-form-validation::features-have-different-errors";const t=e[0];for(const i of e)if(i.error!==t.error)return"batch-attribute-form-validation::features-have-different-errors";return t.error}get dataType(){const{field:e}=this;return p(e)?"number":c(e)?"text":b(e)||m(e)?"date":"unsupported"}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get label(){const e=this.template;if(null!=e.label&&""!==e.label)return e.label;const{field:t,layers:i}=this;if(1===i.length){const e=i[0];if(g(e)){const i=e.getFieldAlias(t.name);if(null!=i&&""!==i)return i}}return t.alias||t.name}get effectiveVisible(){return V(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if("visible"!==e)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return"hidden:visibility-expression:all-features"===i?"hidden:group-visibility-expression:all-features":"hidden:visibility-expression:some-features"===i?"hidden:group-visibility-expression:some-features":e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>i.getAttribute(e)===t)}get field(){return this.template.field}get fieldName(){return this.field.name}get input(){return this.template.input}get multipleChoiceInput(){const{input:e}=this;return e&&o(e)?e:null}get multipleChoiceChoices(){const{multipleChoiceInput:e}=this;if(!e)return null;const t=new Map;for(const i of e.choices)t.has(i.value)||t.set(i.value,i);return Array.from(t.values())}get multipleChoiceValues(){return this.multipleChoiceChoices?.map(e=>e.value)??null}get multipleChoiceOtherChoiceFieldName(){return this.multipleChoiceInput?.otherChoice?.fieldName??null}get multipleChoiceOtherChoiceHint(){return this.multipleChoiceInput?.otherChoice?.hint??""}get multipleChoiceOtherChoiceLabel(){return this.multipleChoiceInput?.otherChoice?.label??null}get hasMultipleChoiceOtherChoiceField(){const{multipleChoiceOtherChoiceFieldName:e}=this;return!!e&&this.layers.every(t=>null!=t.getField(e))}get shouldShowMultipleChoiceOtherChoice(){return null!=this.multipleChoiceInput?.otherChoice&&this.hasMultipleChoiceOtherChoiceField}set shouldShowMultipleChoiceOtherChoice(e){this._overrideIfSome("shouldShowMultipleChoiceOtherChoice",e)}get multipleChoiceOtherChoiceValue(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return null;const t=this.features.map(t=>t.getAttribute(e));if(0===t.length)return null;const[i]=t;return t.every(e=>e===i)?i:O}get multipleChoiceOtherChoiceMaxLength(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return;let t;for(const i of this.layers){const l=i.getField(e)?.length;null==l||l<0||(t=null==t?l:Math.min(t,l))}return t}getMultipleChoiceOtherChoiceRenderState(e){const t=this.multipleChoiceOtherChoiceFieldName??void 0,i=this.shouldShowMultipleChoiceOtherChoice,l=this.multipleChoiceOtherChoiceValue,r=i?this.multipleChoiceOtherChoiceCheckboxState:{checked:!1,indeterminate:!1},o=i?this.getExplicitMultipleChoiceOtherChoiceCheckedState():void 0,n=void 0===o?r:{checked:o,indeterminate:!1};return{fieldName:t,hint:this.multipleChoiceOtherChoiceHint,label:this.multipleChoiceOtherChoiceLabel??e,shouldShow:i,checkboxState:n,value:l,normalizedValue:l===M?"":l,maxLength:this.multipleChoiceOtherChoiceMaxLength}}get multipleChoiceOtherChoiceCheckboxState(){const e=this.multipleChoiceOtherChoiceFieldName;if(!e)return{checked:!1,indeterminate:!1};const t=this.features.map(t=>t.getAttribute(e));return{checked:t.length>0&&t.every(e=>!S(e)),indeterminate:t.some(e=>!S(e))&&t.some(e=>S(e))}}initializeExplicitMultipleChoiceOtherChoiceCheckedState(){this.hasExplicitMultipleChoiceOtherChoiceCheckedState()||this.setExplicitMultipleChoiceOtherChoiceCheckedState(this.multipleChoiceOtherChoiceCheckboxState.checked)}hasExplicitMultipleChoiceOtherChoiceCheckedState(){return void 0!==this.getExplicitMultipleChoiceOtherChoiceCheckedState()}getExplicitMultipleChoiceOtherChoiceCheckedState(){const e=this._multipleChoiceOtherChoiceCheckedStateKey;if(e)return this._multipleChoiceOtherChoiceCheckedStateStore.get(e)}setExplicitMultipleChoiceOtherChoiceCheckedState(e){const t=this._multipleChoiceOtherChoiceCheckedStateKey;t&&this._multipleChoiceOtherChoiceCheckedStateStore.set(t,e)}stashMultipleChoiceOtherChoiceDraftValueForFeatures(e,t){const i=this.multipleChoiceOtherChoiceFieldName;if(i)for(const l of e)l.stashAttribute(i,t)}setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e){const t=this.multipleChoiceOtherChoiceFieldName;if(t)for(const i of e)i.stashAttribute(t,i.getAttribute(t))}getMultipleChoiceOtherChoiceDraftValue(e){const t=this.multipleChoiceOtherChoiceFieldName;if(t)return e.getStashedAttribute(t)}get invalidFeatures(){return this.errors.map(e=>e.feature)}get _multipleChoiceOtherChoiceCheckedStateKey(){return null!=this.multipleChoiceOtherChoiceFieldName?this.template.elementId:null}get _multipleChoiceOtherChoiceCheckedStateStore(){const e=this.expressionsManager;return e?i(_,e,()=>new Map):new Map}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this;return!this.required&&(!F(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this;return F(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return"date"===this.dataType&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const{input:e}=this;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}get maxLength(){return w({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return E({dataType:this.dataType,field:this.field,input:this.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=a(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?d(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get submittable(){return(!this.required||!this.distinctValues.some(e=>S(e)))&&!!this.valid}get valid(){return 0===this.errors.length}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:O}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?"hidden:no-domain-in-common":this._baseVisibilityCode:"hidden:field-definition"}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}get codedValueOptions(){const{getFieldValueOptionsForFeature:e}=this;if(1===this.features.length&&e){const t=this.features.at(0);return e({domain:this.domain??void 0,feature:t,fieldName:this.fieldName,layer:t.layer})}const t=this.codedValueDomainOptions,{value:i}=this,l=null==i||i===O||t.some(e=>e.value===i)?[]:[{name:`${i}`,value:i}];return{recommended:t,other:[],unsupported:l,containsEmptyOption:!1}}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const l of this.features){if(null==i.getExpressionExecutorsForLayer(l.layer)?.requiredExpression)continue;t=!1;const r=this._lookupEvaluatedExpression(l,"required");"success"===r?.status?e=e||!0===r.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const{input:e}=this;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"timestampoffset-picker"!==t||(i=u(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:l}=e;i={max:null!=t&&k(t)?t.getTime():null,min:null!=l&&k(l)?l.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:l}=this;if("date"!==this.dataType)return{};if(!l)return this._fieldShouldHaveDomain?{}:e;const r=a(i,l);if(!r)return e;const{max:o,min:n,rawMax:s,rawMin:u}=e,{type:h}=t.field;if("date"===h){const{max:e,min:t}=r;return{max:x(o)&&(null===e||null!=e&&o<=e)?o:e??null,min:x(n)&&(null===t||null!=t&&n>=t)?n:t??null}}if("date-only"===h||"time-only"===h||"timestamp-offset"===h){const{max:e,min:t,rawMax:i,rawMin:l}=r,a=x(o)&&s&&(null==e||o<e),h=x(n)&&u&&(null==t||n>t);return{max:a?o:e,min:h?n:t,rawMax:a?s:i,rawMin:h?u:l}}return{}}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:l,range:r}=this,o=[],{multipleChoiceInput:n}=this;for(const s of this.features){const{layer:a}=s,u=a.getField(t)??this.field,h=a.getFieldDomain(t,{feature:s.plainGraphic}),p=this.calculateDomain([h]),c=this._requiredForFeature(s),m=s.getAttribute(t),d=D(m,{dataType:e,domain:p,field:u,maxLength:i,minLength:l,multipleChoice:n,range:r,required:c});d&&o.push({error:d,feature:s.source})}return o}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&h(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let l=null;switch(t?.type){case"range":l=this._intersectRangeDomains(e);break;case"coded-value":l=this._intersectCodedValueDomains(e)}return l}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const o of e)for(const[e,i]of t){o.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let l=t;if(i){l=new Map;for(const[e,r]of i)t.has(e)&&l.set(e,r)}const r=Array.from(l.entries()).map(([e,t])=>new n({code:e,name:t}));return r.length?new s({codedValues:r}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let l=1;l<e.length;l++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[l])}if(t&&!h(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof y){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:l}=this;return f(l)||m(l)||C(l)?u(l,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new y,l=this._getMinMaxFromRangeDomain(e),r=this._getMinMaxFromRangeDomain(t),{field:o}=this,n=this._getValidRangeValue(l.min,-1/0),s=this._getValidRangeValue(l.max,1/0),a=this._getValidRangeValue(r.min,-1/0),u=this._getValidRangeValue(r.max,1/0);return i.minValue=Math.max(n,a),i.maxValue=Math.min(s,u),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((f(o)||m(o)||C(o))&&(i.minValue=Number(l.min)>Number(r.min)?l.rawMin:r.rawMin,i.maxValue=Number(l.max)<Number(r.max)?l.rawMax:r.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return x(e)?e:t}};e([l()],N.prototype,"dataType",null),e([l()],N.prototype,"domain",null),e([l()],N.prototype,"distinctValues",null),e([l()],N.prototype,"editable",null),e([l()],N.prototype,"label",null),e([l()],N.prototype,"effectiveVisible",null),e([l()],N.prototype,"effectiveVisibilityCode",null),e([l()],N.prototype,"errors",null),e([l()],N.prototype,"featuresHaveSameValue",null),e([l()],N.prototype,"field",null),e([l()],N.prototype,"fieldName",null),e([l()],N.prototype,"getFieldValueOptionsForFeature",void 0),e([l()],N.prototype,"group",void 0),e([l()],N.prototype,"input",null),e([l()],N.prototype,"multipleChoiceInput",null),e([l()],N.prototype,"multipleChoiceChoices",null),e([l()],N.prototype,"multipleChoiceValues",null),e([l()],N.prototype,"multipleChoiceOtherChoiceFieldName",null),e([l()],N.prototype,"multipleChoiceOtherChoiceHint",null),e([l()],N.prototype,"multipleChoiceOtherChoiceLabel",null),e([l()],N.prototype,"hasMultipleChoiceOtherChoiceField",null),e([l()],N.prototype,"shouldShowMultipleChoiceOtherChoice",null),e([l()],N.prototype,"multipleChoiceOtherChoiceValue",null),e([l()],N.prototype,"multipleChoiceOtherChoiceMaxLength",null),e([l()],N.prototype,"multipleChoiceOtherChoiceCheckboxState",null),e([l()],N.prototype,"invalidFeatures",null),e([l()],N.prototype,"_multipleChoiceOtherChoiceCheckedStateStore",null),e([l()],N.prototype,"isSubtypeField",null),e([l()],N.prototype,"showNoValueOptionEnabled",null),e([l()],N.prototype,"showNoValueLabel",null),e([l()],N.prototype,"includeTime",null),e([l()],N.prototype,"includeTimeOffset",null),e([l()],N.prototype,"maxLength",null),e([l()],N.prototype,"minLength",null),e([l()],N.prototype,"range",null),e([l()],N.prototype,"required",null),e([l()],N.prototype,"submittable",null),e([l({readOnly:!0})],N.prototype,"type",void 0),e([l()],N.prototype,"userHasChangedValue",void 0),e([l()],N.prototype,"valid",null),e([l()],N.prototype,"value",null),e([l()],N.prototype,"visibilityCode",null),e([l()],N.prototype,"codedValueDomainOptions",null),e([l()],N.prototype,"codedValueOptions",null),e([l()],N.prototype,"_evaluatedRequiredExpression",null),e([l()],N.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([l()],N.prototype,"_allDomains",null),e([l()],N.prototype,"_fieldShouldHaveDomain",null),e([l()],N.prototype,"_dateFormRange",null),e([l()],N.prototype,"_dateRange",null),N=e([r("esri.widgets.BatchAttributeForm.inputs.FieldInput")],N);const L=N;export{L as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as i}from"../../../core/MapUtils.js";import{property as l,subclass as r}from"../../../core/accessorSupport/decorators.js";import{isMultipleChoiceInput as o}from"../../../form/elements/inputs/inputUtils.js";import n from"../../../layers/support/CodedValue.js";import a from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as s,dateTimeFieldValuesToNumericRange as u,isDomainValidForField as h}from"../../../layers/support/domainUtils.js";import{isNumericField as p,isStringField as c,isTimeOnlyField as m,getFieldRange as d,isDateOnlyField as f,isTimestampOffsetField as C}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as g}from"../../../layers/support/layerUtils.js";import y from"../../../layers/support/RangeDomain.js";import{isAnyDateField as b}from"../../../smartMapping/support/utils.js";import{isNumber as x}from"../../../support/guards.js";import v from"./EditableInput.js";import{visibilityCodeToBoolean as F,differentValuesString as V,isFieldInputWithShowNoValueOptionInput as O}from"./support/inputUtils.js";import{otherChoiceCheckedPlaceholderValue as M,multipleChoiceOtherChoiceCheckedStateByExpressionsManager as _}from"./support/multipleChoiceInputUtils.js";import{isEmptyValue as E,getMaxLength as S,getMinLength as w,dateIsValid as k,validateFormValue as D}from"../../support/forms/formUtils.js";let N=class extends v{constructor(e){super(e),this.getExternalErrorForFeature=null,this.getFieldValueOptionsForFeature=null,this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return"batch-attribute-form-validation::features-have-different-errors";const t=e[0];for(const i of e)if(i.error!==t.error)return"batch-attribute-form-validation::features-have-different-errors";return t.error}get dataType(){const{field:e}=this;return p(e)?"number":c(e)?"text":b(e)||m(e)?"date":"unsupported"}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get label(){const e=this.template;if(null!=e.label&&""!==e.label)return e.label;const{field:t,layers:i}=this;if(1===i.length){const e=i[0];if(g(e)){const i=e.getFieldAlias(t.name);if(null!=i&&""!==i)return i}}return t.alias||t.name}get effectiveVisible(){return F(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if("visible"!==e)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return"hidden:visibility-expression:all-features"===i?"hidden:group-visibility-expression:all-features":"hidden:visibility-expression:some-features"===i?"hidden:group-visibility-expression:some-features":e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>i.getAttribute(e)===t)}get field(){return this.template.field}get fieldName(){return this.field.name}get input(){return this.template.input}get multipleChoiceInput(){const{input:e}=this;return e&&o(e)?e:null}get multipleChoiceChoices(){const{multipleChoiceInput:e}=this;if(!e)return null;const t=new Map;for(const i of e.choices)t.has(i.value)||t.set(i.value,i);return Array.from(t.values())}get multipleChoiceValues(){return this.multipleChoiceChoices?.map(e=>e.value)??null}get multipleChoiceOtherChoiceFieldName(){return this.multipleChoiceInput?.otherChoice?.fieldName??null}get multipleChoiceOtherChoiceHint(){return this.multipleChoiceInput?.otherChoice?.hint??""}get multipleChoiceOtherChoiceLabel(){return this.multipleChoiceInput?.otherChoice?.label??null}get hasMultipleChoiceOtherChoiceField(){const{multipleChoiceOtherChoiceFieldName:e}=this;return!!e&&this.layers.every(t=>null!=t.getField(e))}get shouldShowMultipleChoiceOtherChoice(){return null!=this.multipleChoiceInput?.otherChoice&&this.hasMultipleChoiceOtherChoiceField}set shouldShowMultipleChoiceOtherChoice(e){this._overrideIfSome("shouldShowMultipleChoiceOtherChoice",e)}get multipleChoiceOtherChoiceValue(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return null;const t=this.features.map(t=>t.getAttribute(e));if(0===t.length)return null;const[i]=t;return t.every(e=>e===i)?i:V}get multipleChoiceOtherChoiceMaxLength(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return;let t;for(const i of this.layers){const l=i.getField(e)?.length;null==l||l<0||(t=null==t?l:Math.min(t,l))}return t}getMultipleChoiceOtherChoiceRenderState(e){const t=this.multipleChoiceOtherChoiceFieldName??void 0,i=this.shouldShowMultipleChoiceOtherChoice,l=this.multipleChoiceOtherChoiceValue,r=i?this.multipleChoiceOtherChoiceCheckboxState:{checked:!1,indeterminate:!1},o=i?this.getExplicitMultipleChoiceOtherChoiceCheckedState():void 0,n=void 0===o?r:{checked:o,indeterminate:!1};return{fieldName:t,hint:this.multipleChoiceOtherChoiceHint,label:this.multipleChoiceOtherChoiceLabel??e,shouldShow:i,checkboxState:n,value:l,normalizedValue:l===M?"":l,maxLength:this.multipleChoiceOtherChoiceMaxLength}}get multipleChoiceOtherChoiceCheckboxState(){const e=this.multipleChoiceOtherChoiceFieldName;if(!e)return{checked:!1,indeterminate:!1};const t=this.features.map(t=>t.getAttribute(e));return{checked:t.length>0&&t.every(e=>!E(e)),indeterminate:t.some(e=>!E(e))&&t.some(e=>E(e))}}initializeExplicitMultipleChoiceOtherChoiceCheckedState(){this.hasExplicitMultipleChoiceOtherChoiceCheckedState()||this.setExplicitMultipleChoiceOtherChoiceCheckedState(this.multipleChoiceOtherChoiceCheckboxState.checked)}hasExplicitMultipleChoiceOtherChoiceCheckedState(){return void 0!==this.getExplicitMultipleChoiceOtherChoiceCheckedState()}getExplicitMultipleChoiceOtherChoiceCheckedState(){const e=this._multipleChoiceOtherChoiceCheckedStateKey;if(e)return this._multipleChoiceOtherChoiceCheckedStateStore.get(e)}setExplicitMultipleChoiceOtherChoiceCheckedState(e){const t=this._multipleChoiceOtherChoiceCheckedStateKey;t&&this._multipleChoiceOtherChoiceCheckedStateStore.set(t,e)}stashMultipleChoiceOtherChoiceDraftValueForFeatures(e,t){const i=this.multipleChoiceOtherChoiceFieldName;if(i)for(const l of e)l.stashAttribute(i,t)}setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e){const t=this.multipleChoiceOtherChoiceFieldName;if(t)for(const i of e)i.stashAttribute(t,i.getAttribute(t))}getMultipleChoiceOtherChoiceDraftValue(e){const t=this.multipleChoiceOtherChoiceFieldName;if(t)return e.getStashedAttribute(t)}get invalidFeatures(){return this.errors.map(e=>e.feature)}get _multipleChoiceOtherChoiceCheckedStateKey(){return null!=this.multipleChoiceOtherChoiceFieldName?this.template.elementId:null}get _multipleChoiceOtherChoiceCheckedStateStore(){const e=this.expressionsManager;return e?i(_,e,()=>new Map):new Map}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this;return!this.required&&(!O(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this;return O(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return"date"===this.dataType&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const{input:e}=this;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}get maxLength(){return S({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return w({dataType:this.dataType,field:this.field,input:this.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=s(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?d(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get submittable(){return(!this.required||!this.distinctValues.some(e=>E(e)))&&!!this.valid}get valid(){return 0===this.errors.length}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:V}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?"hidden:no-domain-in-common":this._baseVisibilityCode:"hidden:field-definition"}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}get codedValueOptions(){const{getFieldValueOptionsForFeature:e}=this;if(1===this.features.length&&e){const t=this.features.at(0);return e({domain:this.domain??void 0,feature:t,fieldName:this.fieldName,layer:t.layer})}const t=this.codedValueDomainOptions,{value:i}=this,l=null==i||i===V||t.some(e=>e.value===i)?[]:[{name:`${i}`,value:i}];return{recommended:t,other:[],unsupported:l,containsEmptyOption:!1}}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const l of this.features){if(null==i.getExpressionExecutorsForLayer(l.layer)?.requiredExpression)continue;t=!1;const r=this._lookupEvaluatedExpression(l,"required");"success"===r?.status?e=e||!0===r.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const{input:e}=this;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"timestampoffset-picker"!==t||(i=u(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:l}=e;i={max:null!=t&&k(t)?t.getTime():null,min:null!=l&&k(l)?l.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:l}=this;if("date"!==this.dataType)return{};if(!l)return this._fieldShouldHaveDomain?{}:e;const r=s(i,l);if(!r)return e;const{max:o,min:n,rawMax:a,rawMin:u}=e,{type:h}=t.field;if("date"===h){const{max:e,min:t}=r;return{max:x(o)&&(null===e||null!=e&&o<=e)?o:e??null,min:x(n)&&(null===t||null!=t&&n>=t)?n:t??null}}if("date-only"===h||"time-only"===h||"timestamp-offset"===h){const{max:e,min:t,rawMax:i,rawMin:l}=r,s=x(o)&&a&&(null==e||o<e),h=x(n)&&u&&(null==t||n>t);return{max:s?o:e,min:h?n:t,rawMax:s?a:i,rawMin:h?u:l}}return{}}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:l,range:r}=this,o=[],{multipleChoiceInput:n}=this;for(const a of this.features){const{layer:s}=a,u=s.getField(t)??this.field,h=s.getFieldDomain(t,{feature:a.plainGraphic}),p=this.calculateDomain([h]),c=this._requiredForFeature(a),m=a.getAttribute(t),d=D(m,{dataType:e,domain:p,field:u,maxLength:i,minLength:l,multipleChoice:n,range:r,required:c})??this.getExternalErrorForFeature?.(a,t);d&&o.push({error:d,feature:a.source})}return o}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&h(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let l=null;switch(t?.type){case"range":l=this._intersectRangeDomains(e);break;case"coded-value":l=this._intersectCodedValueDomains(e)}return l}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const o of e)for(const[e,i]of t){o.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let l=t;if(i){l=new Map;for(const[e,r]of i)t.has(e)&&l.set(e,r)}const r=Array.from(l.entries()).map(([e,t])=>new n({code:e,name:t}));return r.length?new a({codedValues:r}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let l=1;l<e.length;l++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[l])}if(t&&!h(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof y){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:l}=this;return f(l)||m(l)||C(l)?u(l,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new y,l=this._getMinMaxFromRangeDomain(e),r=this._getMinMaxFromRangeDomain(t),{field:o}=this,n=this._getValidRangeValue(l.min,-1/0),a=this._getValidRangeValue(l.max,1/0),s=this._getValidRangeValue(r.min,-1/0),u=this._getValidRangeValue(r.max,1/0);return i.minValue=Math.max(n,s),i.maxValue=Math.min(a,u),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((f(o)||m(o)||C(o))&&(i.minValue=Number(l.min)>Number(r.min)?l.rawMin:r.rawMin,i.maxValue=Number(l.max)<Number(r.max)?l.rawMax:r.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return x(e)?e:t}};e([l()],N.prototype,"dataType",null),e([l()],N.prototype,"domain",null),e([l()],N.prototype,"distinctValues",null),e([l()],N.prototype,"editable",null),e([l()],N.prototype,"label",null),e([l()],N.prototype,"effectiveVisible",null),e([l()],N.prototype,"effectiveVisibilityCode",null),e([l()],N.prototype,"errors",null),e([l()],N.prototype,"featuresHaveSameValue",null),e([l()],N.prototype,"field",null),e([l()],N.prototype,"fieldName",null),e([l()],N.prototype,"getExternalErrorForFeature",void 0),e([l()],N.prototype,"getFieldValueOptionsForFeature",void 0),e([l()],N.prototype,"group",void 0),e([l()],N.prototype,"input",null),e([l()],N.prototype,"multipleChoiceInput",null),e([l()],N.prototype,"multipleChoiceChoices",null),e([l()],N.prototype,"multipleChoiceValues",null),e([l()],N.prototype,"multipleChoiceOtherChoiceFieldName",null),e([l()],N.prototype,"multipleChoiceOtherChoiceHint",null),e([l()],N.prototype,"multipleChoiceOtherChoiceLabel",null),e([l()],N.prototype,"hasMultipleChoiceOtherChoiceField",null),e([l()],N.prototype,"shouldShowMultipleChoiceOtherChoice",null),e([l()],N.prototype,"multipleChoiceOtherChoiceValue",null),e([l()],N.prototype,"multipleChoiceOtherChoiceMaxLength",null),e([l()],N.prototype,"multipleChoiceOtherChoiceCheckboxState",null),e([l()],N.prototype,"invalidFeatures",null),e([l()],N.prototype,"_multipleChoiceOtherChoiceCheckedStateStore",null),e([l()],N.prototype,"isSubtypeField",null),e([l()],N.prototype,"showNoValueOptionEnabled",null),e([l()],N.prototype,"showNoValueLabel",null),e([l()],N.prototype,"includeTime",null),e([l()],N.prototype,"includeTimeOffset",null),e([l()],N.prototype,"maxLength",null),e([l()],N.prototype,"minLength",null),e([l()],N.prototype,"range",null),e([l()],N.prototype,"required",null),e([l()],N.prototype,"submittable",null),e([l({readOnly:!0})],N.prototype,"type",void 0),e([l()],N.prototype,"userHasChangedValue",void 0),e([l()],N.prototype,"valid",null),e([l()],N.prototype,"value",null),e([l()],N.prototype,"visibilityCode",null),e([l()],N.prototype,"codedValueDomainOptions",null),e([l()],N.prototype,"codedValueOptions",null),e([l()],N.prototype,"_evaluatedRequiredExpression",null),e([l()],N.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([l()],N.prototype,"_allDomains",null),e([l()],N.prototype,"_fieldShouldHaveDomain",null),e([l()],N.prototype,"_dateFormRange",null),e([l()],N.prototype,"_dateRange",null),N=e([r("esri.widgets.BatchAttributeForm.inputs.FieldInput")],N);const L=N;export{L as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{destroyMaybe as t}from"../../../core/maybe.js";import{on as
|
|
2
|
+
import{__decorate as e}from"tslib";import{destroyMaybe as t}from"../../../core/maybe.js";import{on as l}from"../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{isSubtypeGroupLayer as o,getEffectiveLayerCapabilities as s}from"../../../layers/support/layerUtils.js";import{isRelatableFeatureSupportedLayer as a}from"../../../popup/support/featureUtils.js";import n from"./EditableInput.js";import p from"./SingleFeatureInputAdapter.js";import d from"../../Feature/FeatureRelationship/FeatureRelationshipViewModel.js";import{getComputedAttributes as h,parseFormTemplateString as u}from"../../FeatureForm/featureFormUtils.js";let y=class extends n{constructor(e){super(e),this._relationshipVM=new d,this._showAllCategories=!1,this._showAllRelatedRecords=!1,this.group=null,this.map=null,this.single=new p({input:this}),this.type="relationship"}initialize(){this._setRelationshipVMProps(),this.addHandles([l(()=>this.relatedLayer,"edits",()=>this._relationshipVM?.refresh())])}destroy(){t(this._relationshipVM)}get activeCategory(){return this._relationshipVM.activeCategory}get allCategories(){const{relatedLayer:e,_relationshipVM:t}=this;if(!o(e))return;const l=t?.categories,r=(e.subtypes??[]).map(({code:e,name:t})=>{const r=l?.find(e=>e.name===t);return{name:t,count:r?.count??0,value:r?.value??e}});return r.length?r:null}get categories(){return this.showAllEnabled?this.allCategories:this.allCategories?.slice(0,this.displayCount)}get canAddRelatedFeature(){const{editable:e,relatedFeatureCount:t,relationship:l}=this;if(!l||!this.loaded||!this._relatedLayerAllowsAdds)return!1;if(this.allCategories?.length&&!this.activeCategory)return!1;const{cardinality:r,role:i}=l;return!("one-to-one"===r&&t>0)&&("many-to-many"!==r&&(!("one-to-many"===r&&"destination"===i&&t>0)&&e))}get displayCount(){return this.template.displayCount}get displayType(){return this.template.displayType}get editable(){return!!this._relatedLayerAllowsAdds&&(this._evaluatedEditableExpression??!0)}get feature(){return this.single.feature}get relatedFeatureCount(){return this._relationshipVM?.featureCount??0}get label(){return this.activeCategory?.name?this.activeCategory.name:this.template.label}get layer(){return this.single.layer}get loaded(){return"loading"!==this._relationshipVM?.state}get orderByFields(){return this.template.orderByFields}get originHasValidKey(){return!!this.relationship&&null!=this.feature?.getAttribute(this.relationship.keyField)}get relationship(){return this._relationshipVM?.relationship}get relationshipId(){return this.template.relationshipId}get relatedFeatureInfos(){const{_relationshipVM:e,effectiveTimeZone:t}=this;if(!e?.relatedFeatures?.length||!e?.relatedLayer)return[];const{itemDescriptionFieldName:l,relatedFeatures:r,relatedLayer:i}=e,o=i?.formTemplate?.title||void 0;return r.map(e=>{let r;if(l){const o=e.getAttribute(l),s=i.fieldsIndex.get(l);if(s){const e=h({fields:[s],layer:i,values:[o],timeZone:t})[l];null!=e&&(r=e.toString())}}return{feature:e,description:r,title:o?u({attributes:e.attributes,label:o,layer:i,timeZone:t}):void 0}}).toArray()}get relatedLayer(){return this._relationshipVM?.relatedLayer}get relatedLayerIsTable(){return!!this.relatedLayer?.isTable}get showAllEnabled(){return this._relationshipVM.showAllEnabled}get showAllActionVisible(){return!this.showAllEnabled&&this.relatedFeatureCount>0&&this.relatedFeatureCount>this.displayCount}get showAllCategories(){return this._showAllCategories}get showAllCategoriesVisible(){const e=this.allCategories?.length??0;return!this.showAllEnabled&&e>0&&e>this.displayCount}get showAllRelatedRecords(){return this._showAllRelatedRecords}get updating(){return"loading"===this._relationshipVM?.state||"querying"===this._relationshipVM?.state}incrementPage(){this._relationshipVM&&this._relationshipVM.featurePage++}setActiveCategory(e){this._relationshipVM.activeCategory=e,this.setShowAllRelatedRecords(!!e)}setShowAllCategories(e){this._showAllCategories=e,this._showAllRelatedRecords||this._setShowAllEnabled(e)}setShowAllRelatedRecords(e){this._showAllRelatedRecords=e,this._showAllCategories||this._setShowAllEnabled(e)}get _relatedLayerAllowsAdds(){const{relatedLayer:e}=this;if(!e||!this._relatedLayerAllowsEdits)return!1;const t=s(e);return!!t?.operations?.supportsAdd}get _relatedLayerAllowsEdits(){const{relatedLayer:e}=this;if(!e)return!1;const t=s(e);return!!t?.operations?.supportsEditing}_setRelationshipVMProps(){const{displayCount:e,feature:t,layer:l,orderByFields:r,map:i,relationshipId:o,showAllEnabled:s}=this;t&&l&&a(l)&&this._relationshipVM.set({displayCount:e,graphic:t.plainGraphic,layer:l,map:i,orderByFields:r,relationshipId:o,showAllEnabled:s})}_setShowAllEnabled(e){this._relationshipVM.showAllEnabled=e}};e([r()],y.prototype,"_relationshipVM",void 0),e([r()],y.prototype,"_showAllCategories",void 0),e([r()],y.prototype,"_showAllRelatedRecords",void 0),e([r()],y.prototype,"activeCategory",null),e([r()],y.prototype,"allCategories",null),e([r()],y.prototype,"categories",null),e([r()],y.prototype,"canAddRelatedFeature",null),e([r()],y.prototype,"displayCount",null),e([r()],y.prototype,"displayType",null),e([r()],y.prototype,"editable",null),e([r()],y.prototype,"feature",null),e([r()],y.prototype,"group",void 0),e([r()],y.prototype,"label",null),e([r()],y.prototype,"layer",null),e([r()],y.prototype,"loaded",null),e([r()],y.prototype,"map",void 0),e([r()],y.prototype,"orderByFields",null),e([r()],y.prototype,"originHasValidKey",null),e([r()],y.prototype,"relationship",null),e([r()],y.prototype,"relationshipId",null),e([r()],y.prototype,"relatedFeatureInfos",null),e([r()],y.prototype,"relatedLayer",null),e([r()],y.prototype,"relatedLayerIsTable",null),e([r({readOnly:!0})],y.prototype,"single",void 0),e([r()],y.prototype,"showAllEnabled",null),e([r()],y.prototype,"showAllActionVisible",null),e([r()],y.prototype,"showAllCategories",null),e([r()],y.prototype,"showAllCategoriesVisible",null),e([r()],y.prototype,"showAllRelatedRecords",null),e([r({readOnly:!0})],y.prototype,"type",void 0),e([r()],y.prototype,"updating",null),e([r()],y.prototype,"_relatedLayerAllowsAdds",null),e([r()],y.prototype,"_relatedLayerAllowsEdits",null),y=e([i("esri.widgets.BatchAttributeForm.inputs.RelationshipElementInput")],y);const g=y;export{g as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @internal */
|
|
2
|
+
export type AttachmentValidationCriterionKey = "maximum-audio-length" | "maximum-file-size" | "minimum-number-of-files" | "maximum-number-of-files" | "maximum-video-length";
|
|
3
|
+
|
|
4
|
+
/** @internal */
|
|
5
|
+
export type AttachmentValidationCriterionState = "danger" | "success";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import t from"../AttachmentElementInput.js";import r from"../BatchFormInputs.js";import s from"../FieldInput.js";import n from"../GroupInput.js";import o from"../RelationshipElementInput.js";import a from"../TextElementInput.js";import i from"../UtilityNetworkAssociationsElementInput.js";import{isFieldElementTemplate as l,isGroupElementTemplate as p,isRelationshipElementTemplate as m,isTextElementTemplate as u,isAttachmentElementTemplate as f,isUtilityNetworkAssociationsElementTemplate as c}from"../../templates/support/templateUtils.js";function h(e,t){const s=new r({inputs:e.elements.map(e=>
|
|
2
|
+
import e from"../../../../core/Error.js";import t from"../AttachmentElementInput.js";import r from"../BatchFormInputs.js";import s from"../FieldInput.js";import n from"../GroupInput.js";import o from"../RelationshipElementInput.js";import a from"../TextElementInput.js";import i from"../UtilityNetworkAssociationsElementInput.js";import{isFieldElementTemplate as l,isGroupElementTemplate as p,isRelationshipElementTemplate as m,isTextElementTemplate as u,isAttachmentElementTemplate as f,isUtilityNetworkAssociationsElementTemplate as c}from"../../templates/support/templateUtils.js";function h(e,t){const s=new r({inputs:e.elements.map(e=>F(e,t)),template:e});return x(s),s}function x(e){const t=e.allFieldInputs,r=new Set(t.map(e=>e.fieldName));for(const s of t){const e=s.multipleChoiceOtherChoiceFieldName;if(!e)continue;const t=s.layers[0]?.getField(e)?.name??e;r.has(t)&&(s.shouldShowMultipleChoiceOtherChoice=!1)}}function F(r,h){const{allFeatures:x,expressionsManager:g,getFieldValueOptionsForFeature:I,getExternalErrorForFeature:w,map:d}=h,y=new Set(r.layers),j=x.filter(e=>y.has(e.layer)),E=j.length===x.length;if(l(r))return new s({existsInAllLayers:E,features:j,template:r,expressionsManager:g,getExternalErrorForFeature:w,getFieldValueOptionsForFeature:I});if(p(r)){const e=r.elements.map(e=>F(e,h));return new n({existsInAllLayers:E,features:j,inputs:e,template:r,expressionsManager:g})}if(m(r))return new o({existsInAllLayers:E,features:j,map:d,template:r,expressionsManager:g});if(u(r))return new a({existsInAllLayers:E,features:j,template:r,expressionsManager:g});if(f(r))return new t({existsInAllLayers:E,features:j,template:r,expressionsManager:g});if(c(r))return new i({existsInAllLayers:E,features:j,template:r,expressionsManager:g,map:d});throw new e("batch-attribute-form:unsupported-element-template","The type of form element template provided is not supported")}export{h as createBatchFormInputsFromBatchFormTemplate};
|
|
@@ -22,4 +22,11 @@ export type GroupableInput = FieldInput | RelationshipElementInput | AttachmentE
|
|
|
22
22
|
*
|
|
23
23
|
* @since 5.0
|
|
24
24
|
*/
|
|
25
|
-
export type FormInput = GroupInput | FieldInput | RelationshipElementInput | AttachmentElementInput | TextElementInput | UtilityNetworkAssociationsElementInput;
|
|
25
|
+
export type FormInput = GroupInput | FieldInput | RelationshipElementInput | AttachmentElementInput | TextElementInput | UtilityNetworkAssociationsElementInput;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Information about edits made to existing attachments.
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export interface AttachmentEditState {}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
function e(e){const{messages:n,onclick:a}=e;return[{appearance:"solid",kind:"brand",
|
|
2
|
+
function e(e){const{messages:n,onclick:a}=e;return[{appearance:"solid",kind:"brand",label:n.footerButtons.add,purpose:"stage-add-attachment",onclick:a??(()=>{})}]}function n(e){const{callback:n,disabled:a,formId:t,messages:c}=e;return[{appearance:"solid",disabled:a,form:t,kind:"brand",label:c.footerButtons.update,purpose:"submit",onclick:()=>n()}]}function a(e){const{label:n,onclick:a}=e;return[{appearance:"outline",icon:"trash",kind:"danger",label:n,purpose:"discard-attachment-changes",onclick:a??(()=>{})}]}function t(e){const{disabled:n,messages:a,onclick:t}=e;return[{appearance:"solid",disabled:n,kind:"brand",label:a.footerButtons.replace,purpose:"stage-replace-attachment",onclick:t??(()=>{})}]}function c(e){const{messages:n,onclick:a}=e;return[{appearance:"outline",icon:"reset",kind:"brand",label:n.footerButtons.reset,purpose:"discard-attachment-name-changes",onclick:a??(()=>{})}]}function o(e){const{deleteDisabled:n,deleteOnclick:a,doneOnclick:t,messages:c}=e;return[{appearance:"outline",kind:"brand",label:c.done,purpose:"stage-update-attachment",onclick:t??(()=>{})},{appearance:"outline",disabled:n,icon:"attachment",kind:"danger",label:c.delete,purpose:"stage-delete-attachment",onclick:a??(()=>{})}]}function s(e){const{messages:n,purpose:a,onclick:t}=e;return[{appearance:"outline",kind:"brand",label:n.cancel,purpose:a,onclick:t??(()=>{})}]}export{e as makeAddAttachmentFooterButtons,s as makeCancelFooterButton,n as makeDefaultFooterButtons,a as makeDiscardAttachmentFooterButtons,t as makeReplaceAttachmentFooterButtons,c as makeResetAttachmentFooterButtons,o as makeViewingAttachmentFooterButtons};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{formatNumber as e}from"../../../intl/number.js";import{substitute as t}from"../../../intl/substitute.js";import{isSubtypeGroupLayer as i}from"../../../layers/support/layerUtils.js";import{isRelatableFeatureSupportedLayer as n}from"../../../popup/support/featureUtils.js";import{css as l}from"../css.js";import{loadCalciteComponents as o}from"../../support/componentsUtils.js";import{getIconForFeature as a}from"../../support/iconUtils.js";import{tsx as s,classes as
|
|
2
|
+
import{formatNumber as e}from"../../../intl/number.js";import{substitute as t}from"../../../intl/substitute.js";import{isSubtypeGroupLayer as i}from"../../../layers/support/layerUtils.js";import{isRelatableFeatureSupportedLayer as n}from"../../../popup/support/featureUtils.js";import{css as l}from"../css.js";import{loadCalciteComponents as o}from"../../support/componentsUtils.js";import{getIconForFeature as a}from"../../support/iconUtils.js";import{tsx as s,classes as r}from"../../support/widget.js";const c=()=>o({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),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")});function d(e){const{input:t}=e,{template:i}=t;return s("div",{class:r({[l.relationshipElementInput]:!0,[l.relationshipElementInputShowingAll]:t.showAllEnabled}),"data-testid":`relationship-element-${i.elementId}`,key:`relationship-${t.relationshipId}-container`},p(t,e.messagesCommon),u(t),t.showAllEnabled&&R(e),m(e),!t.showAllEnabled&&R(e))}function p(e,t){const i=e.updating||!e.loaded;return s("div",{class:l.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},s("span",null,e.label),i?s("calcite-loader",{inline:!0,key:"loader",label:t?.loading,scale:"s",type:"indeterminate"}):void 0)}function u(e){const{activeCategory:t,description:i}=e;if(!t&&i)return s("calcite-input-message",{class:r(l.description,l.relatedRecordsDescription)},i)}function m(e){const{input:t,messages:i}=e,{activeCategory:n,relatedFeatureCount:l}=t;return l>0?f(e):n&&!l?L(e.messages):t.allCategories?.length?I(e):t.loaded?t.originHasValidKey?L(i):F(e):void 0}function f(e){const{viewModel:t,input:i,messages:n}=e,o=!i.editable||t.readOnly;return s("calcite-list",{class:l.relatedRecordsList,label:n.relatedRecords.relatedRecordsTitle},i.relatedFeatureInfos.map(t=>h(t,o,e)),g(e),y(e))}function h(e,t,i){const{feature:n,description:l,title:o}=e,{viewModel:r,input:c}=i,{relationshipId:d,single:p}=c,{feature:u}=p,m=r.callbacks?.editRelatedRecord,{highlightHelper:f}=r;if(!u||!m)return;const h=()=>{f?.removeAll(),m({parentFeature:u.plainGraphic,readOnly:t,relatedFeature:n,relationshipId:d})},g=f?()=>f.add(n):void 0,v=f?()=>f.remove(n):void 0;return s("calcite-list-item",{description:l,key:`${d}-${n.uid}`,label:o,value:o,onCalciteListItemSelect:h,onmouseenter:g,onmouseleave:v},s("calcite-icon",{icon:a(n),slot:"content-start"}),s("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}function g(e){const{input:i,messages:n}=e;if(i.showAllActionVisible)return s("calcite-list-item",{description:t(n.totalCount,{count:i.relatedFeatureCount}),key:"show-all-related-features",label:n.showAll,value:!0,onCalciteListItemSelect:()=>b(e)},s("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}function v(e){e.input.setShowAllCategories(!0),e.viewModel.setActiveRelationshipInput(e.input)}function b(e){e.input.setShowAllRelatedRecords(!0),e.viewModel.setActiveRelationshipInput(e.input)}function y(e){const{afterObserverCreated:t,afterObserverRemoved:i,viewModel:n}=e;if(n.activeRelationshipInput?.showAllEnabled)return s("div",{afterCreate:t,afterRemoved:i,class:l.relatedRecordsListObserver,key:"feature-observer"})}function R(e){const{input:t,viewModel:i,messages:n}=e,{canAddRelatedFeature:o,relationshipId:a,relatedLayer:c,editable:d}=t,{callbacks:p}=i;if(!(o&&p?.addRelatedRecord&&c&&d))return;const u=i.disabled||i.readOnly||t.updating||!t.originHasValidKey;return s("calcite-button",{alignment:"center",appearance:"outline-fill",class:r(l.centeredButton,l.relatedRecordsAddButton),disabled:u,iconStart:"plus",key:`${a}-add-button`,round:!0,scale:"s",width:"full",onclick:()=>w(e)},t.relatedLayerIsTable?n.addRecord:n.addFeature)}function w(e){const{input:t,viewModel:l}=e,{relationshipId:o,relatedLayer:a,single:s}=t,{feature:r}=s,{callbacks:c}=l;if(!r||!c?.addRelatedRecord)return;let d=a;if(i(a)&&t.activeCategory){const e=t.activeCategory.value,i=a.findSublayerForSubtypeCode(e);i&&n(i)&&(d=i)}d&&c.addRelatedRecord({parentFeature:r.plainGraphic,relatedLayer:d,relationshipId:o})}function I(e){const{input:t,messages:i}=e;return s("calcite-list",{displayMode:"flat",label:i.relatedRecords.relatedRecordsTitle,loading:t.updating},t.categories?.map(t=>C(t,e)),k(e))}function C(t,i){const{count:n,name:l,value:o}=t,a=e(n);return s("calcite-list-item",{key:`${l}-${o}`,label:l,onCalciteListItemSelect:()=>A(t,i)},s("calcite-chip",{label:a,scale:"s",slot:"content-end"},a),s("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}function A(e,t){t.viewModel.setActiveRelationshipCategory(e,t.input)}function k(e){const{input:i,messages:n}=e;if(i.showAllCategoriesVisible)return s("calcite-list-item",{description:t(n.totalCount,{count:i.allCategories?.length??0}),key:"show-all-categories",label:n.showAll,value:!0,onCalciteListItemSelect:()=>v(e)},s("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}function F(e){const{viewModel:i,input:n,messages:l}=e,o=n.relatedLayerIsTable?l.relatedRecords.noOriginKeyRecord:l.relatedRecords.noOriginKeyFeature,a=n.relationship?.keyField,s=i.findFieldInput(a),r=n.layer?.fieldsIndex.get(a),c=s?.label||r?.alias||a;return M(t(o,{relatedLayerName:n.relatedLayer?.title??l.relatedRecords.untitledLayer,originKeyField:c}))}function L(e){return M(e.relatedRecords.noRecordsFound)}function M(e){return s("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},s("div",{slot:"message"},e))}export{d as RelationshipDetails,c as loadRelationshipDetailsComponents};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{createArcadeProfile as e,createArcadeExecutor as
|
|
2
|
+
import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../../arcade.js";import r from"../../../../core/Error.js";import n from"../../../../core/Logger.js";import{getEffectiveFieldAlias as o}from"../../../../editing/fieldUtils.js";import i from"../../../../form/ExpressionInfo.js";import s from"../../../../form/elements/AttachmentElement.js";import{isMultipleChoiceInput as a}from"../../../../form/elements/inputs/inputUtils.js";import{isAttachmentElement as l,isFieldElement as m,isGroupElement as d,isRelationshipElement as p,isTextElement as c,isUtilityNetworkAssociationsElement as f}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as u,isFieldVisibleByDefault as x}from"../../../../layers/support/fieldUtils.js";import{isSubtypeSublayer as y,isSubtypeGroupLayer as w}from"../../../../layers/support/layerUtils.js";import{isNumber as h}from"../../../../support/guards.js";import{unknown as E}from"../../../../time/constants.js";import{layerSupportsQueryAttachments as b}from"../../batchAttributeFormUtils.js";import{makeExpressionInfosMap as v,makeExecutorSetForFormElement as I}from"../../expressions/expressionUtils.js";import{AttachmentElementTemplate as T}from"../AttachmentElementTemplate.js";import j from"../BatchFormTemplate.js";import{FieldElementTemplate as F}from"../FieldElementTemplate.js";import{GroupElementTemplate as g}from"../GroupElementTemplate.js";import{RelationshipElementTemplate as P}from"../RelationshipElementTemplate.js";import{TextElementTemplate as C}from"../TextElementTemplate.js";import{UtilityNetworkAssociationsElementTemplate as A}from"../UtilityNetworkAssociationsElementTemplate.js";import{compileTextElementMarkdownToHTML as L}from"./textElementTemplateUtils.js";const U="expression/dea57012-47ca4b55a000-8df62742ed0c",Z=e("form-attachment-filename-calculation"),N=()=>n.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function k(e,t,r=e.formTemplate){return await e.load(),r?.elements&&r.elements.length>0?S(r,e,t):B(e,t)}async function B(e,{arcadeExecutorProvider:t,attachmentsEnabled:r,formTimeZone:n}){const o=new Set(u(e)),i={arcadeExecutorProvider:t,formTimeZone:n,layer:e},s=[];for(const l of e.fields)D(l,e,o)&&s.push(q(l,i));const a=await Promise.all(s);return r&&await R(a,{arcadeExecutorProvider:t,expressionInfos:v(void 0),layer:e}),new j({elements:a,preserveFieldValuesWhenHidden:!0})}function H(e,t){for(const r of e??[])if("group"!==r.type){if("field"===r.type){if(!1===r.editable&&!r.editableExpression)return!0;if(t.subtypeField&&(y(t)||w(t))&&r.fieldName?.toLowerCase()===t.subtypeField.toLowerCase())return!0}}else if(H(r.elements??[],t))return!0;return!1}async function R(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){if(!b(n))return;const o=await V(new s({displayFilename:!0}),{arcadeExecutorProvider:t,expressionInfos:r,layer:n});e.push(o)}async function S(e,t,r){let n=null;H(e.elements??[],t)&&(n=new i({title:"",name:U,expression:"false"}));const o=v(n?[...e.expressionInfos??[],n]:e.expressionInfos),s={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,supportsAttachmentElements:e.supportsAttachmentElements},{elements:a}=e;if(!a)return new j(s);let l=!1;const{arcadeExecutorProvider:m,formTimeZone:d}=r;for(const i of a){const e=await W(i,{arcadeExecutorProvider:m,expressionInfos:o,layer:t,formTimeZone:d});e&&(s.elements.push(e),"attachment"===e.type&&(l=!0))}return e.supportsAttachmentElements||!r.attachmentsEnabled||l||await R(s.elements,{arcadeExecutorProvider:m,expressionInfos:o,layer:t}),new j(s)}async function V(e,{arcadeExecutorProvider:r,expressionInfos:n,layer:o}){const i=n.get(e.filenameExpression),s=i?await t(i.expression,Z):null,a=new T({allowUserRename:e.allowUserRename,attachmentKeyword:e.attachmentKeyword,description:e.description,displayFilename:e.displayFilename,filenameExpressionExecutor:s,input:e.input,label:e.label,maxAttachmentCount:e.maxAttachmentCount,minAttachmentCount:e.minAttachmentCount,useOriginalFilename:e.useOriginalFilename}),l=await I({element:e,expressionInfos:n,provider:r});return a.addLayer(o,l),a}async function W(e,t){return l(e)?V(e,{arcadeExecutorProvider:t.arcadeExecutorProvider,expressionInfos:t.expressionInfos,layer:t.layer}):m(e)?z(e,t):d(e)?K(e,t):p(e)?O(e,t):c(e)?G(e,t):f(e)?$(e,t):null}async function z(e,{arcadeExecutorProvider:t,expressionInfos:n,layer:o,formTimeZone:i}){const{fieldsIndex:s}=o,{description:l,domain:m,fieldName:d,hint:p,input:c,label:f}=e;if(null==d||!s.has(d))return N().warn(new r("batch-attribute-form:invalid-form-element-field",`Field element with label '${f}' does not refer to a valid field`)),null;if(!1!==e.editable||e.editableExpression||((e=e.clone()).editableExpression=U),o.subtypeField&&(y(o)||w(o))&&e.fieldName?.toLowerCase()===o.subtypeField.toLowerCase()&&((e=e.clone()).editableExpression=U),c&&a(c)&&c.otherChoice){const e=c.otherChoice.fieldName,t=s.get(e);t&&t.name!==e&&(c.otherChoice=c.otherChoice.clone(),c.otherChoice.fieldName=t.name)}const u=new F({description:l,domain:m,field:s.get(d),hint:p,input:c,formTimeZone:i,layerTimeZone:J(o),label:f}),x=await I({element:e,expressionInfos:n,provider:t});return u.addLayer(o,x),u}async function K(e,t){const{arcadeExecutorProvider:r,expressionInfos:n,layer:o}=t,{description:i,label:s,initialState:a}=e,l=[];for(const p of e.elements){const e=await W(p,t);e&&l.push(e)}const m=new g({description:i,elements:l,label:s,initialState:a??"expanded"}),d=await I({element:e,expressionInfos:n,provider:r});return m.addLayer(o,d),m}async function O(e,t){const{description:r,label:n,displayCount:o,displayType:i,orderByFields:s,relationshipId:a}=e,{arcadeExecutorProvider:l,expressionInfos:m,layer:d}=t,p=new P({description:r,...h(o)&&{displayCount:o},displayType:i,label:n,orderByFields:s,relationshipId:a}),c=await I({element:e,expressionInfos:m,provider:l});return p.addLayer(d,c),p}async function G(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){const{description:o,label:i,text:s,textFormat:a}=e,{fieldsIndex:l}=n,m=s&&"markdown"===a?await L(s):s,d=new C({compiledText:m,description:o,fieldsIndex:l,label:i}),p=await I({element:e,expressionInfos:r,provider:t}),{expressionParts:c}=d;if(c.length){const e=await Promise.all(c.map(e=>{const n=r.get(e)?.expression??e;return t.getArcadeExecutor(n)}));p.textExpressions=e}return d.addLayer(n,p),d}async function $(e,t){const{associationTypes:r,description:n,label:o}=e,{arcadeExecutorProvider:i,expressionInfos:s,layer:a}=t,l=new A({associationTypes:r,description:n,label:o}),m=await I({element:e,expressionInfos:s,provider:i});return l.addLayer(a,m),l}async function q(e,{arcadeExecutorProvider:t,layer:r,formTimeZone:n}){const i=o(e,r)||e.name,s=new F({field:e,label:i,formTimeZone:n,layerTimeZone:J(r)}),a={},l=(w(r)||y(r))&&r.subtypeField&&r.subtypeField.toLowerCase()===e.name.toLowerCase();return!l&&e.editable&&r.userHasUpdateItemPrivileges&&(a.editableExpression=await t.getArcadeExecutor("true")),l&&(a.editableExpression=await t.getArcadeExecutor("false")),s.addLayer(r,a),s}function D(e,t,r){return!r.has(e.name.toLowerCase())&&x(e,t)}function J(e){return y(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?E:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}export{k as createBatchFormTemplate,B as createBatchFormTemplateFromFields};
|
|
@@ -13,7 +13,7 @@ import type { AssociationsLayerUnion, AttributeFormSupportedLayerInfo, FooterBut
|
|
|
13
13
|
import type { HeadingLevel } from "./support/types.js";
|
|
14
14
|
import type { VisibleElementsProperties } from "./BatchAttributeForm/VisibleElements.js";
|
|
15
15
|
|
|
16
|
-
export interface BatchAttributeFormProperties extends WidgetProperties, Partial<Pick<BatchAttributeForm, "activeFeatureIndex" | "disabled" | "features" | "groupDisplay" | "headingLevel" | "layerInfos" | "map" | "readOnly" | "timeZone">> {
|
|
16
|
+
export interface BatchAttributeFormProperties extends WidgetProperties, Partial<Pick<BatchAttributeForm, "activeFeatureIndex" | "attachmentsEnabled" | "disabled" | "features" | "groupDisplay" | "headingLevel" | "layerInfos" | "map" | "readOnly" | "timeZone">> {
|
|
17
17
|
/**
|
|
18
18
|
* Icon displayed in the widget's button.
|
|
19
19
|
*
|
|
@@ -91,6 +91,14 @@ export default class BatchAttributeForm extends Widget<BatchAttributeFormPropert
|
|
|
91
91
|
* });
|
|
92
92
|
*/
|
|
93
93
|
accessor activeFeatureIndex: number;
|
|
94
|
+
/**
|
|
95
|
+
* Indicates whether attachment elements should be rendered in the form. Changing this value will cause the form to regenerate
|
|
96
|
+
* and discard any pending edits.
|
|
97
|
+
*
|
|
98
|
+
* @default false
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
accessor attachmentsEnabled: boolean;
|
|
94
102
|
/**
|
|
95
103
|
* Indicates if the widget is disabled. When `true`, the widget is not interactive and cannot be submitted.
|
|
96
104
|
*
|