@arcgis/core 5.2.0-next.137 → 5.2.0-next.139
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/analysis/LineOfSightAnalysisObserver.d.ts +12 -0
- package/analysis/LineOfSightAnalysisObserver.js +1 -1
- package/analysis/LineOfSightAnalysisTarget.d.ts +12 -0
- package/analysis/LineOfSightAnalysisTarget.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/sources/FeatureLayerParquet.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/shared.js +1 -1
- package/arcade/featureset/support/sqlUtils.js +1 -1
- package/arcade/featureset/support/stats.js +1 -1
- package/arcade/functions/featuresetstats.js +1 -1
- package/arcade/functions/fieldStats.js +1 -1
- package/arcgisGlobal.d.ts +5 -1
- package/assets/components/assets/icon/blockHeightMedium16.json +1 -0
- package/assets/components/assets/icon/blockHeightMedium24.json +1 -0
- package/assets/components/assets/icon/blockHeightMedium32.json +1 -0
- package/assets/components/assets/icon/blockHeightShort16.json +1 -0
- package/assets/components/assets/icon/blockHeightShort24.json +1 -0
- package/assets/components/assets/icon/blockHeightShort32.json +1 -0
- package/assets/components/assets/icon/blockHeightTall16.json +1 -0
- package/assets/components/assets/icon/blockHeightTall24.json +1 -0
- package/assets/components/assets/icon/blockHeightTall32.json +1 -0
- package/assets/components/assets/icon/cursorCircle16.json +1 -0
- package/assets/components/assets/icon/cursorCircle24.json +1 -0
- package/assets/components/assets/icon/cursorCircle32.json +1 -0
- package/assets/components/assets/icon/dictionary16.json +1 -0
- package/assets/components/assets/icon/dictionary24.json +1 -0
- package/assets/components/assets/icon/dictionary32.json +1 -0
- package/assets/components/assets/icon/jobDependency16.json +1 -0
- package/assets/components/assets/icon/jobDependency24.json +1 -0
- package/assets/components/assets/icon/jobDependency32.json +1 -0
- package/assets/components/assets/icon/referenceChip16.json +1 -0
- package/assets/components/assets/icon/referenceChip24.json +1 -0
- package/assets/components/assets/icon/referenceChip32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{4e6f95d8c624d513849a.js → 05963f57cbe5a5249496.js} +1 -1
- package/assets/esri/core/workers/chunks/{0b8681ca4a83e97f1f71.js → 067de1910190da228291.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c0fd1c6cda44e9f40ab.js → 070684943698fa43c2b4.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc1cb4b9a02e6c78deb7.js → 076e8d2e08ff2a013736.js} +1 -1
- package/assets/esri/core/workers/chunks/{c10e040368065411506a.js → 10445313d0d57b34511b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d537c59b46cdaaf66034.js → 1188d0a136fffc009643.js} +1 -1
- package/assets/esri/core/workers/chunks/1380cec385426673f294.js +1 -0
- package/assets/esri/core/workers/chunks/{20af3f085f60c32c6c53.js → 178083d8ed7707b45ca2.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5efe3e800c6e23efcf3.js → 1819c45655c836b9a8d7.js} +1 -1
- package/assets/esri/core/workers/chunks/1b946714ca4a1a7359d4.js +2 -0
- package/assets/esri/core/workers/chunks/{d8d8b38ac8a91d9e45fc.js → 1cc744ab5eee5ee3bed8.js} +1 -1
- package/assets/esri/core/workers/chunks/{05e39b4de7f62c5b22cc.js → 20f75cc777af13fa249b.js} +1 -1
- package/assets/esri/core/workers/chunks/2671035cc08027185737.js +1 -0
- package/assets/esri/core/workers/chunks/2a1ec30f9ad305763f81.js +2 -0
- package/assets/esri/core/workers/chunks/34570e6bbf559f18c1a5.js +1 -0
- package/assets/esri/core/workers/chunks/{60f6d5da9480dd36e877.js → 3dddae78286d05eb10fc.js} +1 -1
- package/assets/esri/core/workers/chunks/{9efd30bbd02ec0d1031b.js → 3ec3589f6e74d7cb87cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{0bec054fca104f3bf141.js → 3f776d9fd2ab68b21fca.js} +1 -1
- package/assets/esri/core/workers/chunks/3f946c13ad97fbed867b.js +1 -0
- package/assets/esri/core/workers/chunks/402a82c77420254831bc.js +1 -0
- package/assets/esri/core/workers/chunks/{e2ebf0ea3af2e6907987.js → 406f24ec13eb30d43405.js} +1 -1
- package/assets/esri/core/workers/chunks/43fc42405167a5537039.js +1 -0
- package/assets/esri/core/workers/chunks/{ddedc414bb478b376221.js → 46b2d4addfc73f9183a4.js} +1 -1
- package/assets/esri/core/workers/chunks/498d6dfd3bb0d3490548.js +1 -0
- package/assets/esri/core/workers/chunks/{36ef86701883a20dd6f6.js → 4a640548032355e57acd.js} +1 -1
- package/assets/esri/core/workers/chunks/5566f14afb63065e438f.js +1 -0
- package/assets/esri/core/workers/chunks/{c3b96d1d43afccd23e45.js → 590e6c70206122e4cc3c.js} +2 -2
- package/assets/esri/core/workers/chunks/{54860dd53a46cf4c47f3.js → 59295b99bdff4045a0e7.js} +1 -1
- package/assets/esri/core/workers/chunks/5aeb5e18514644fe2cf9.js +1 -0
- package/assets/esri/core/workers/chunks/{5da86409d70098fc6a10.js → 5b3cfe95314a75a735c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{a54678bfa0f1807b61cd.js → 5c855af73ee3c3e764fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{a8b7e6198c2d0c37c9a0.js → 5e90c1b49f2b7e21d05a.js} +4 -4
- package/assets/esri/core/workers/chunks/{30f808cac8a34f95ea6e.js → 6079d27f4ab319fb8f0c.js} +1 -1
- package/assets/esri/core/workers/chunks/66c2a28a851130b87c04.js +1 -0
- package/assets/esri/core/workers/chunks/{dac90b3631f7f7158f68.js → 67f15538c51838201fc7.js} +1 -1
- package/assets/esri/core/workers/chunks/{cfaba0470619786e1ef8.js → 68d8ae42ab71d01a70a5.js} +2 -2
- package/assets/esri/core/workers/chunks/6aebf7cfd294e88bf926.js +1 -0
- package/assets/esri/core/workers/chunks/{864e7030c4ddbfcf0114.js → 6ccf9535013fe672c93b.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba7f0cf7e495d3ec2d55.js → 6e62581d933e7298d1f6.js} +1 -1
- package/assets/esri/core/workers/chunks/{83b5dd4029e00abd80bf.js → 700b1d5bc67b7e1b3ff3.js} +1 -1
- package/assets/esri/core/workers/chunks/{f9fea72cc222a30ef2f9.js → 72399062767abdfb0bee.js} +1 -1
- package/assets/esri/core/workers/chunks/{2a7fbfd77002a24bf737.js → 747461bb6a1bc2f0a64d.js} +1 -1
- package/assets/esri/core/workers/chunks/{c333f6ed42985bb2b11f.js → 7851aef196eea5d6c94e.js} +1 -1
- package/assets/esri/core/workers/chunks/{f0b6bd6fab5320c3082f.js → 7a05b18f655c1167ce0a.js} +1 -1
- package/assets/esri/core/workers/chunks/{04296b75d0f81fbd1bb5.js → 864194927d05ebc4cc31.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c4a13a9f0b305394a26.js → 876f7633c15f1e31078d.js} +1 -1
- package/assets/esri/core/workers/chunks/{b547b3bce729c9dac90d.js → 898359be6996fd9763b8.js} +1 -1
- package/assets/esri/core/workers/chunks/8b1c17cc52d989924313.js +1 -0
- package/assets/esri/core/workers/chunks/8cb716f110d164030309.js +1 -0
- package/assets/esri/core/workers/chunks/8dc1c3042267618fd710.js +2 -0
- package/assets/esri/core/workers/chunks/{625f02db93d7fbf175ca.js → 9001e9a1e81bce175ddd.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ffa6c8d93d3443834c6.js → 912080c90b5cc2e817cf.js} +1 -1
- package/assets/esri/core/workers/chunks/96c50a0dda0f1503ef92.js +2 -0
- package/assets/esri/core/workers/chunks/{13e4379441499599c3b5.js → 9cbde13e536676767900.js} +1 -1
- package/assets/esri/core/workers/chunks/{408db4f32850b77264ae.js → 9cd3fcb5fca6f9dbbcd8.js} +1 -1
- package/assets/esri/core/workers/chunks/a054da6cbd8ee4774a57.js +1 -0
- package/assets/esri/core/workers/chunks/{468fa166608ffc9108d9.js → a05790444115e4cf1bcc.js} +1 -1
- package/assets/esri/core/workers/chunks/{d1f2685782b423ef87a6.js → a556dd4e9e6d35e33a2c.js} +1 -1
- package/assets/esri/core/workers/chunks/acfa03c65ba3ca6c5685.js +1 -0
- package/assets/esri/core/workers/chunks/{00d576d355599c88931e.js → bc38def1983089514e4b.js} +1 -1
- package/assets/esri/core/workers/chunks/{0725e515f3004bdd5c56.js → ca2adcbcf44454484fd5.js} +1 -1
- package/assets/esri/core/workers/chunks/{f3507b9e831ffd7a6bf8.js → cca8bd07bcd1d267a2e8.js} +1 -1
- package/assets/esri/core/workers/chunks/cfae60b9d2f2939e9c16.js +1 -0
- package/assets/esri/core/workers/chunks/{1d6b2a64f4e40e5cc13d.js → d201fbf3ceff946d2bd6.js} +1 -1
- package/assets/esri/core/workers/chunks/{4439078780d9ba49fd26.js → d51bb11baadc741c46bc.js} +1 -1
- package/assets/esri/core/workers/chunks/db1ab9b9c8bf5c7635d3.js +1 -0
- package/assets/esri/core/workers/chunks/de02a6a1f4810f99e9bb.js +1 -0
- package/assets/esri/core/workers/chunks/e630f3c56c077cb2bd8e.js +1 -0
- package/assets/esri/core/workers/chunks/e81173724e8de8c1e65b.js +1 -0
- package/assets/esri/core/workers/chunks/{2025288bed125594ceda.js → f6e62d2d279a328cbed7.js} +1 -1
- package/assets/esri/core/workers/chunks/{47c19778fcee7154ca38.js → f8bc474434fd365ab174.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a20dc26cb9c7b2087cf.js → f95a1f878c9c1146180e.js} +1 -1
- package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-TW.json +1 -1
- package/chunks/Bufferer-CclWhXVb.js +1 -1
- package/chunks/Component.glsl.js +3 -3
- package/chunks/DefaultMaterial.glsl.js +2 -2
- package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/Envelope2D.js +1 -1
- package/chunks/FocusArea.glsl.js +8 -10
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
- package/chunks/GeodeticUtils.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/GeometryCleaner-CIE8Wfmb.js +1 -1
- package/chunks/LineMarker.glsl.js +35 -42
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorAffineTransform.js +1 -1
- package/chunks/OperatorClip.js +1 -1
- package/chunks/OperatorDensify.js +1 -1
- package/chunks/OperatorDistance.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorGraphicBuffer.js +1 -1
- package/chunks/OperatorIntegrate.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/Path.glsl.js +2 -2
- package/chunks/Point2D.js +1 -1
- package/chunks/RealisticTree.glsl.js +2 -2
- package/chunks/RibbonLine.glsl.js +50 -56
- package/chunks/SideCalculator2D-DX0718xq.js +1 -1
- package/chunks/Terrain.glsl.js +2 -2
- package/chunks/Transformation2D.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/config.js +1 -1
- package/core/sql/AggregateFunctions.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/editing/fieldUtils.d.ts +12 -0
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorBoundary.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/interfaces.d.ts +15 -18
- package/kernel.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/list/LayerItemCollection.d.ts +1 -0
- package/layers/list/types.d.ts +5 -1
- package/layers/support/TimeSeriesCalculation.d.ts +1 -1
- package/layers/support/TimeSeriesCalculation.js +1 -1
- package/layers/support/dataSeriesUtils.d.ts +10 -0
- package/layers/support/timeSeriesUtils.js +17 -6
- package/legend/ActiveLayerInfo.d.ts +2 -2
- package/legend/{LegendContent.d.ts → LegendModel.d.ts} +10 -10
- package/legend/{LegendContent.js → LegendModel.js} +1 -1
- package/legend/types.d.ts +4 -4
- package/libs/lyr3d/Lyr3DModule.js +1 -1
- package/networks/UtilityNetwork.d.ts +15 -0
- package/networks/UtilityNetwork.js +1 -1
- package/package.json +4 -4
- package/popup/FeatureContent.d.ts +24 -2
- package/popup/FeatureContent.js +1 -1
- package/popup/FeatureContentCollection.d.ts +3 -10
- package/popup/FeatureContentCollection.js +1 -1
- package/popup/actions.js +1 -1
- package/popup/support/featureUtils.js +1 -1
- package/renderers/support/RenderingInfo.js +1 -1
- package/renderers/support/renderingInfoUtils.js +1 -1
- package/renderers/visualVariables/SizeVariable.d.ts +16 -20
- package/renderers/visualVariables/support/SizeStop.d.ts +6 -2
- package/rest/networks/support/TraceLocation.js +1 -1
- package/rest/networks/support/TraceResult.d.ts +7 -0
- package/rest/networks/support/TraceResult.js +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/opacity.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/timeSeriesUtils.js +1 -1
- package/smartMapping/statistics/histogramForTimeSeries.d.ts +11 -0
- package/smartMapping/statistics/histogramForTimeSeries.js +2 -0
- package/smartMapping/statistics/summaryStatisticsForTimeSeries.d.ts +11 -0
- package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +2 -0
- package/smartMapping/statistics/support/timeSeriesUtils.js +24 -0
- package/smartMapping/statistics/types.d.ts +50 -0
- package/symbols/cim/CIMPlacements.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/types.d.ts +493 -8
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/ComputedAnimatedParams.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextParams.js +1 -1
- package/views/2d/layers/SketchLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/ExceedsLimitCache.js +1 -1
- package/views/2d/layers/features/schema/TimeSchema.js +2 -0
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
- package/views/2d/types.d.ts +2 -1
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +24 -0
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/camera/constraintUtils.js +1 -1
- package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +1 -1
- package/views/3d/interactive/placementTools/GroundNavigationPlacementTool3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/state/controllers/GroundNavigationController.js +1 -1
- package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/evaluateSceneLightingFragment.glsl.js +12 -0
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/focusArea/FocusArea.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/SelectionManager.d.ts +3 -3
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/options/bindViewToolOptions.js +1 -1
- package/views/interactive/sketch/SketchLabelOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchLabelOptions.js +1 -1
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchTooltipOptions.js +1 -1
- package/views/interactive/sketch/SketchValueOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchValueOptions.js +1 -1
- package/views/interactive/snapping/SnappingOptions.d.ts +3 -0
- package/views/interactive/snapping/SnappingOptions.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/interactive/tooltip/fields/parsingAndFormattingUtils.js +1 -1
- package/views/layers/SketchLayerView.d.ts +34 -0
- package/views/layers/SketchLayerView.js +2 -0
- package/views/layers/types.d.ts +3 -2
- package/views/selection/types.d.ts +15 -4
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/Bookmarks/BookmarksViewModel.d.ts +4 -0
- package/widgets/Bookmarks/BookmarksVisibleElements.d.ts +5 -1
- package/widgets/Bookmarks/types.d.ts +2 -0
- package/widgets/Editor/EditorViewModel.d.ts +31 -30
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/components/Settings.js +1 -1
- package/widgets/Editor/types.d.ts +44 -0
- package/widgets/Editor.d.ts +30 -27
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.d.ts +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable.d.ts +6 -0
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Histogram/types.d.ts +10 -2
- package/widgets/HistogramRangeSlider/types.d.ts +4 -1
- package/widgets/LayerList/LayerListViewModel.d.ts +2 -1
- package/widgets/Legend/LegendViewModel.d.ts +3 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/styles/card/CardView.d.ts +2 -0
- package/widgets/Legend/styles/classic/ClassicView.d.ts +4 -1
- package/widgets/Legend.d.ts +3 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.d.ts +7 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/types.d.ts +9 -0
- package/widgets/OrientedImageryViewer.d.ts +7 -0
- package/widgets/OrientedImageryViewer.js +2 -2
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/ScaleRangeSlider/types.d.ts +9 -2
- package/widgets/Sketch/SketchViewModel.d.ts +32 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.d.ts +27 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slider/types.d.ts +58 -13
- package/widgets/Slider.d.ts +6 -0
- package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ClassedColorSlider/ClassedColorSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ClassedSizeSlider/ClassedSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ColorSizeSlider/ColorSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.d.ts +3 -0
- package/widgets/smartMapping/SmartMappingPrimaryHandleSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/SmartMappingSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/types.d.ts +30 -7
- package/widgets/support/FilterBuilder/FilterBuilderViewModel.d.ts +21 -11
- package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
- package/widgets/support/FilterBuilder/types.d.ts +28 -0
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition/FilterConditionViewModel.d.ts +24 -0
- package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
- package/widgets/support/FilterCondition/types.d.ts +16 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/SnappingControls/snappingLayerListUtils.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0606ab6fdfc1dfea3856.js +0 -1
- package/assets/esri/core/workers/chunks/1289204f8ca96032c17a.js +0 -1
- package/assets/esri/core/workers/chunks/12b5a645c0987a0efe54.js +0 -2
- package/assets/esri/core/workers/chunks/17b938ba49fb1e7ab8c4.js +0 -1
- package/assets/esri/core/workers/chunks/1dbb3e25e005a8220779.js +0 -2
- package/assets/esri/core/workers/chunks/37fc47373c1c8fcdfd1a.js +0 -1
- package/assets/esri/core/workers/chunks/3d6fef25af7e1a51e1bd.js +0 -1
- package/assets/esri/core/workers/chunks/537dbd3b870bbef7433e.js +0 -1
- package/assets/esri/core/workers/chunks/55ae00f33f5240a73a50.js +0 -1
- package/assets/esri/core/workers/chunks/62298dba3f6cbdc3f4ae.js +0 -1
- package/assets/esri/core/workers/chunks/703411e4a18a6a36048a.js +0 -1
- package/assets/esri/core/workers/chunks/74211d096cc3296e0968.js +0 -1
- package/assets/esri/core/workers/chunks/7926faab76a721a2e1c4.js +0 -1
- package/assets/esri/core/workers/chunks/96c3900685cfb2a8ca12.js +0 -1
- package/assets/esri/core/workers/chunks/ad28486bc6afaa346de5.js +0 -1
- package/assets/esri/core/workers/chunks/ad29c729e90b5866713c.js +0 -1
- package/assets/esri/core/workers/chunks/b72a2514aa4cc4ae7d1b.js +0 -1
- package/assets/esri/core/workers/chunks/b748faaa5ebdeba73103.js +0 -1
- package/assets/esri/core/workers/chunks/be761749f8d77fbd9df5.js +0 -1
- package/assets/esri/core/workers/chunks/d4f55e2b1ace7867a3b8.js +0 -1
- package/assets/esri/core/workers/chunks/dbfd25aa0d19aed5890c.js +0 -1
- package/assets/esri/core/workers/chunks/de28a86775235bd5d3c4.js +0 -2
- package/assets/esri/core/workers/chunks/f6cfc901267a229de7a1.js +0 -2
- package/assets/esri/core/workers/chunks/fb147097149a89e671ff.js +0 -1
- package/support/revision.js +0 -2
- /package/assets/esri/core/workers/chunks/{1dbb3e25e005a8220779.js.LICENSE.txt → 1b946714ca4a1a7359d4.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{f6cfc901267a229de7a1.js.LICENSE.txt → 2a1ec30f9ad305763f81.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{c3b96d1d43afccd23e45.js.LICENSE.txt → 590e6c70206122e4cc3c.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{cfaba0470619786e1ef8.js.LICENSE.txt → 68d8ae42ab71d01a70a5.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{de28a86775235bd5d3c4.js.LICENSE.txt → 8dc1c3042267618fd710.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{12b5a645c0987a0efe54.js.LICENSE.txt → 96c50a0dda0f1503ef92.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{onLocaleChange as t}from"../intl.js";import n from"../core/Accessor.js";import r from"../core/Collection.js";import{watch as i,initial as a,when as o}from"../core/reactiveUtils.js";import{property as s,subclass as c}from"../core/accessorSupport/decorators.js";import{get as l}from"../core/accessorSupport/get.js";import u from"./ActiveLayerInfo.js";import{getEffectiveFeatureReduction as d}from"../views/2d/layers/features/layerAdapters/featureReductionUtils.js";const f={state:`state`,view:`view`,allLayerViews:`all-layer-views`,legendProperties:`legend-properties`},p=r.ofType(u),m=new Set(`esri.layers.BuildingSceneLayer,esri.layers.CatalogLayer,esri.layers.CSVLayer,esri.layers.FeatureLayer,esri.layers.GeoJSONLayer,esri.layers.GeoRSSLayer,esri.layers.GroupLayer,esri.layers.HeatmapLayer,esri.layers.ImageryLayer,esri.layers.ImageryTileLayer,esri.layers.MapImageLayer,esri.layers.OGCFeatureLayer,esri.layers.OrientedImageryLayer,esri.layers.ParquetLayer,esri.layers.PointCloudLayer,esri.layers.StreamLayer,esri.layers.SceneLayer,esri.layers.SubtypeGroupLayer,esri.layers.TileLayer,esri.layers.VoxelLayer,esri.layers.WFSLayer,esri.layers.WMSLayer,esri.layers.WMTSLayer,esri.layers.WCSLayer,esri.layers.LinkChartLayer,esri.layers.catalog.CatalogFootprintLayer,esri.layers.catalog.CatalogDynamicGroupLayer,esri.layers.knowledgeGraph.KnowledgeGraphSublayer,esri.layers.KnowledgeGraphLayer`.split(`,`)),h=`view.basemapView.baseLayerViews`,g=`view.groundView.layerViews`,_=`view.basemapView.referenceLayerViews`,v=[h,g,`view.layerViews`,_];let y=class extends n{constructor(e){super(e),this._layerViewByLayerId={},this._layerInfosByLayerViewId={},this._activeLayerInfosByLayerViewId={},this._activeLayerInfosWithNoParent=new r,this._activeLayerInfosPromises=new WeakMap,this.activeLayerInfos=new p,this.basemapLegendVisible=!1,this.groundLegendVisible=!1,this.hideLayersNotInCurrentView=!1,this.keepCacheOnDestroy=!1,this.layerInfos=[],this.respectLayerDefinitionExpression=!1,this.respectLayerVisibility=!0,this.view=null}initialize(){this.addHandles(i(()=>this.view,()=>this._viewHandles(),a),f.view),this.addHandles(t(()=>this._refresh()))}destroy(){this._destroyViewActiveLayerInfos(),this.view=null}get loading(){return this.activeLayerInfos.some(e=>e.loading)}get state(){return this.view?.ready?`ready`:`disabled`}_viewHandles(){this.removeHandles(f.state),this.view&&this.addHandles(i(()=>this.state,()=>this._stateHandles(),a),f.state)}_stateHandles(){this._resetAll(),this.state===`ready`&&this._watchPropertiesAndAllLayerViews()}_resetAll(){this.removeHandles([f.allLayerViews,f.legendProperties]),this._destroyViewActiveLayerInfos(),this.activeLayerInfos.removeAll()}_destroyViewActiveLayerInfos(){Object.keys(this._activeLayerInfosByLayerViewId).forEach(this._destroyViewActiveLayerInfo,this)}_destroyViewActiveLayerInfo(e){this.removeHandles(e);let t=this._activeLayerInfosByLayerViewId[e];t&&this._activeLayerInfosPromises.delete(t),delete this._activeLayerInfosByLayerViewId[e],t?.parent?.children.remove(t)}_watchPropertiesAndAllLayerViews(){let{view:e}=this;if(!e)return;let{allLayerViews:t}=e;t.length&&this._refresh(),this.addHandles(t.on(`change`,e=>this._allLayerViewsChangeHandle(e)),f.allLayerViews),this.addHandles(i(()=>[this.basemapLegendVisible,this.groundLegendVisible,this.hideLayersNotInCurrentView,this.keepCacheOnDestroy,this.layerInfos,this.respectLayerDefinitionExpression,this.respectLayerVisibility],()=>this._refresh()),f.legendProperties)}_allLayerViewsChangeHandle(e){if(e.added.length&&this._generateActiveLayerInfosForLayerViews(e.added),e.moved.length){this._destroyViewActiveLayerInfos(),this._refresh();return}if(e.removed.length){for(let{uid:t}of e.removed)this._destroyViewActiveLayerInfo(t);this._refresh()}}_refresh(){this._layerInfosByLayerViewId={},this.activeLayerInfos.drain(e=>this._activeLayerInfosPromises.delete(e)),this._generateActiveLayerInfosForLayerViews(this._generateLayerViews())}_generateActiveLayerInfosForLayerViews(e){e.filter(this._filterBasemapLayerViews,this).filter(this._filterLayerViewsByLayerInfos,this).filter(this._isLayerViewSupported,this).forEach(this._generateActiveLayerInfo,this)}_filterBasemapLayerViews(e){if(!this.view?.basemapView)return!0;let{baseLayerViews:t,groundLayerViews:n,referenceLayerViews:r}=this.view.basemapView,i=t.some(t=>{let n=`layerViews`in t?t.layerViews:null;return n?n.includes(e):t===e}),a=!this.basemapLegendVisible&&(i||r?.includes(e)),o=!this.groundLegendVisible&&n?.includes(e);return!a&&!o}_sortActiveLayerInfos(e){let t=this.view;if(e.length<2||!t)return;let n=[];e.forEach(t=>{if(!t.parent){let r=t.layer.parent,i=r&&`uid`in r&&this._layerViewByLayerId[r.uid],a=i&&this._activeLayerInfosByLayerViewId[i.uid];a&&e.includes(a)&&(n.push(t),t.parent=a,a.children.add(t),this._sortActiveLayerInfos(a.children))}}),e.removeMany(n);let r={};t.allLayerViews.forEach((e,t)=>r[e.layer.uid]=t),e.sort((e,t)=>{let n=r[e.layer.uid]||0;return(r[t.layer.uid]||0)-n})}_generateLayerViews(){let e=[];return v.filter(this._filterLayerViews,this).map(e=>l(this,e)).filter(e=>e!=null).forEach(this._collectLayerViews(`layerViews`,e)),e}_filterLayerViews(e){let t=!this.basemapLegendVisible&&(e===h||e===_),n=!this.groundLegendVisible&&e===g;return!t&&!n}_collectLayerViews(e,t){let n=r=>(r&&r.forEach(r=>{t.push(r),n(r[e])}),t);return n}_filterLayerViewsByLayerInfos(e){let t=this.layerInfos;return t&&t.length?t.some(t=>this._hasLayerInfo(t,e)):!0}_hasLayerInfo(e,t){let n=this._isLayerUIDMatching(e.layer,t.layer.uid);return n&&(this._layerInfosByLayerViewId[t.uid]=e),n}_isLayerUIDMatching(e,t){return e&&(e.uid===t||this._hasLayerUID(e.layers,t))}_hasLayerUID(e,t){return e&&e.some(e=>this._isLayerUIDMatching(e,t))}_isLayerViewSupported(e){return m.has(e.layer.declaredClass)?(this._layerViewByLayerId[e.layer.uid]=e,!0):!1}_generateActiveLayerInfo(e){if(this._isLayerActive(e)){this._buildActiveLayerInfo(e);return}this.removeHandles(e.uid),this.addHandles(i(()=>[e.legendEnabled,e.layer?.legendEnabled],()=>this._layerActiveHandle(e)),e.uid)}_layerActiveHandle(e){this._isLayerActive(e)&&(this.removeHandles(e.uid),this._buildActiveLayerInfo(e))}_isLayerActive(e){return!this.respectLayerVisibility||e.legendEnabled&&e.layer?.legendEnabled}async _buildActiveLayerInfo(e){let t=e.layer,n=e.uid,r=this._layerInfosByLayerViewId[n],i=this._activeLayerInfosByLayerViewId[n];i||(i=new u({keepCacheOnDestroy:this.keepCacheOnDestroy,layer:t,layerView:e,view:this.view??void 0}),this._activeLayerInfosByLayerViewId[n]=i);let a=r?.title!==void 0&&r.layer.uid===t.uid;i.title=a?r.title:t.title,i.respectLayerDefinitionExpression=this.respectLayerDefinitionExpression,i.respectLayerVisibility=this.respectLayerVisibility,i.hideLayersNotInCurrentView=this.hideLayersNotInCurrentView,i.sublayerIds=r?.sublayerIds||[];let o=t.parent&&`uid`in t.parent?this._layerViewByLayerId[t.parent?.uid]:null;i.parent=this._activeLayerInfosByLayerViewId[o?.uid],this._addActiveLayerInfo(i),this._constructLegendElements(i),this._attachHandlesToActiveLayerInfo(i)}_attachHandlesToActiveLayerInfo(e){let{layer:t,layerView:n}=e,r=n.uid;this.removeHandles(r),this.addHandles([i(()=>t.title,t=>this._titleHandle(t,e)),i(()=>[t.opacity,`renderer`in t&&t.renderer,`pointSymbol`in t&&t.pointSymbol,`lineSymbol`in t&&t.lineSymbol,`polygonSymbol`in t&&t.polygonSymbol,`effect`in t&&t.effect,`featureReduction`in t&&d(t,n.view),this.view?.timeZone],()=>this._constructLegendElements(e)),i(()=>`filter`in n&&n.filter,()=>{d(n.layer,n.view)!=null&&this._constructLegendElements(e)}),o(()=>!!this.view?.stationary,()=>this._scaleHandle(e)),i(()=>e.loading,()=>this.notifyChange(`loading`),a)],r),this.respectLayerVisibility&&this.addHandles([i(()=>t.legendEnabled,t=>this._legendEnabledHandle(t,e)),i(()=>n.legendEnabled,t=>{this.view?.suspended||this._legendEnabledHandle(t,e)})],r),this.respectLayerDefinitionExpression&&`definitionExpression`in t&&this.addHandles(i(()=>t.definitionExpression,()=>this._constructLegendElements(e)),r)}_titleHandle(e,t){t.title=e,this._constructLegendElements(t)}_legendEnabledHandle(e,t){e?this._addActiveLayerInfo(t):this._removeActiveLayerInfo(t)}_scaleHandle(e){(e.isScaleDriven||e.hideLayersNotInCurrentView)&&this._constructLegendElements(e)}_addActiveLayerInfo(e){let{layerView:t,layer:n}=e;if(this._isLayerActive(t)&&!this.activeLayerInfos.includes(e)){let t=e.parent;if(t)t.children.includes(e)||t.children.push(e),this._sortActiveLayerInfos(t.children);else{let t=this.layerInfos?.some(e=>e.layer.uid===n.uid),r=n.parent;r&&`uid`in r&&this._layerViewByLayerId[r.uid]&&!t?this._activeLayerInfosWithNoParent.add(e):(this.activeLayerInfos.add(e),this._sortActiveLayerInfos(this.activeLayerInfos))}if(this._activeLayerInfosWithNoParent.length){let e=[];this._activeLayerInfosWithNoParent.forEach(t=>{let n=t.layer.parent,r=n&&`uid`in n?this._layerViewByLayerId[n?.uid]:null,i=this._activeLayerInfosByLayerViewId[r?.uid];i&&(e.push(t),t.parent=i)}),e.length&&(this._activeLayerInfosWithNoParent.removeMany(e),e.forEach(e=>this._addActiveLayerInfo(e)))}}}_removeActiveLayerInfo(e){let t=e.parent;t?t.children.remove(e):this.activeLayerInfos.remove(e)}async _getBuildLegendPromise(e){let{layer:t}=e;if(`featureCollections`in t&&t.featureCollections)return e.buildLegendElementsForFeatureCollections(t.featureCollections);if(`featureReduction`in t&&t.featureReduction&&`renderer`in t.featureReduction&&(t.featureReduction.type===`binning`||t.featureReduction.type===`cluster`)&&(!this.view||t.featureReduction.maxScale<=this.view.scale))return e.buildLegendElementsForFeatureReduction(t.featureReduction);if(`renderer`in t&&t.renderer&&!(`sublayers`in t))return e.buildLegendElementsForRenderer(t.renderer);if(`url`in t&&t.url&&t.type!==`catalog`&&t.type!==`knowledge-graph`)return e.buildLegendElementsForTools();let n=e.children.map(e=>this._constructLegendElements(e));return Promise.all(n).then(()=>{})}async _constructLegendElements(e){let t=this._activeLayerInfosPromises.get(e);t&&await t.catch(()=>{});let n=this._getBuildLegendPromise(e);this._activeLayerInfosPromises.set(e,n),n.finally(()=>{this._activeLayerInfosPromises.delete(e)})}};e([s({type:p})],y.prototype,`activeLayerInfos`,void 0),e([s()],y.prototype,`basemapLegendVisible`,void 0),e([s()],y.prototype,`groundLegendVisible`,void 0),e([s()],y.prototype,`hideLayersNotInCurrentView`,void 0),e([s()],y.prototype,`keepCacheOnDestroy`,void 0),e([s()],y.prototype,`layerInfos`,void 0),e([s({readOnly:!0})],y.prototype,`loading`,null),e([s()],y.prototype,`respectLayerDefinitionExpression`,void 0),e([s()],y.prototype,`respectLayerVisibility`,void 0),e([s({readOnly:!0})],y.prototype,`state`,null),e([s()],y.prototype,`view`,void 0),y=e([c(`esri.legend.LegendContent`)],y);const b=y;export{b as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{onLocaleChange as t}from"../intl.js";import n from"../core/Accessor.js";import r from"../core/Collection.js";import{watch as i,initial as a,when as o}from"../core/reactiveUtils.js";import{property as s,subclass as c}from"../core/accessorSupport/decorators.js";import{get as l}from"../core/accessorSupport/get.js";import u from"./ActiveLayerInfo.js";import{getEffectiveFeatureReduction as d}from"../views/2d/layers/features/layerAdapters/featureReductionUtils.js";const f={state:`state`,view:`view`,allLayerViews:`all-layer-views`,legendProperties:`legend-properties`},p=r.ofType(u),m=new Set(`esri.layers.BuildingSceneLayer,esri.layers.CatalogLayer,esri.layers.CSVLayer,esri.layers.FeatureLayer,esri.layers.GeoJSONLayer,esri.layers.GeoRSSLayer,esri.layers.GroupLayer,esri.layers.HeatmapLayer,esri.layers.ImageryLayer,esri.layers.ImageryTileLayer,esri.layers.MapImageLayer,esri.layers.OGCFeatureLayer,esri.layers.OrientedImageryLayer,esri.layers.ParquetLayer,esri.layers.PointCloudLayer,esri.layers.StreamLayer,esri.layers.SceneLayer,esri.layers.SubtypeGroupLayer,esri.layers.TileLayer,esri.layers.VoxelLayer,esri.layers.WFSLayer,esri.layers.WMSLayer,esri.layers.WMTSLayer,esri.layers.WCSLayer,esri.layers.LinkChartLayer,esri.layers.catalog.CatalogFootprintLayer,esri.layers.catalog.CatalogDynamicGroupLayer,esri.layers.knowledgeGraph.KnowledgeGraphSublayer,esri.layers.KnowledgeGraphLayer`.split(`,`)),h=`view.basemapView.baseLayerViews`,g=`view.groundView.layerViews`,_=`view.basemapView.referenceLayerViews`,v=[h,g,`view.layerViews`,_];let y=class extends n{constructor(e){super(e),this._layerViewByLayerId={},this._layerInfosByLayerViewId={},this._activeLayerInfosByLayerViewId={},this._activeLayerInfosWithNoParent=new r,this._activeLayerInfosPromises=new WeakMap,this.activeLayerInfos=new p,this.basemapLegendVisible=!1,this.groundLegendVisible=!1,this.hideLayersNotInCurrentView=!1,this.keepCacheOnDestroy=!1,this.layerInfos=[],this.respectLayerDefinitionExpression=!1,this.respectLayerVisibility=!0,this.view=null}initialize(){this.addHandles(i(()=>this.view,()=>this._viewHandles(),a),f.view),this.addHandles(t(()=>this._refresh()))}destroy(){this._destroyViewActiveLayerInfos(),this.view=null}get loading(){return this.activeLayerInfos.some(e=>e.loading)}get state(){return this.view?.ready?`ready`:`disabled`}_viewHandles(){this.removeHandles(f.state),this.view&&this.addHandles(i(()=>this.state,()=>this._stateHandles(),a),f.state)}_stateHandles(){this._resetAll(),this.state===`ready`&&this._watchPropertiesAndAllLayerViews()}_resetAll(){this.removeHandles([f.allLayerViews,f.legendProperties]),this._destroyViewActiveLayerInfos(),this.activeLayerInfos.removeAll()}_destroyViewActiveLayerInfos(){Object.keys(this._activeLayerInfosByLayerViewId).forEach(this._destroyViewActiveLayerInfo,this)}_destroyViewActiveLayerInfo(e){this.removeHandles(e);let t=this._activeLayerInfosByLayerViewId[e];t&&this._activeLayerInfosPromises.delete(t),delete this._activeLayerInfosByLayerViewId[e],t?.parent?.children.remove(t)}_watchPropertiesAndAllLayerViews(){let{view:e}=this;if(!e)return;let{allLayerViews:t}=e;t.length&&this._refresh(),this.addHandles(t.on(`change`,e=>this._allLayerViewsChangeHandle(e)),f.allLayerViews),this.addHandles(i(()=>[this.basemapLegendVisible,this.groundLegendVisible,this.hideLayersNotInCurrentView,this.keepCacheOnDestroy,this.layerInfos,this.respectLayerDefinitionExpression,this.respectLayerVisibility],()=>this._refresh()),f.legendProperties)}_allLayerViewsChangeHandle(e){if(e.added.length&&this._generateActiveLayerInfosForLayerViews(e.added),e.moved.length){this._destroyViewActiveLayerInfos(),this._refresh();return}if(e.removed.length){for(let{uid:t}of e.removed)this._destroyViewActiveLayerInfo(t);this._refresh()}}_refresh(){this._layerInfosByLayerViewId={},this.activeLayerInfos.drain(e=>this._activeLayerInfosPromises.delete(e)),this._generateActiveLayerInfosForLayerViews(this._generateLayerViews())}_generateActiveLayerInfosForLayerViews(e){e.filter(this._filterBasemapLayerViews,this).filter(this._filterLayerViewsByLayerInfos,this).filter(this._isLayerViewSupported,this).forEach(this._generateActiveLayerInfo,this)}_filterBasemapLayerViews(e){if(!this.view?.basemapView)return!0;let{baseLayerViews:t,groundLayerViews:n,referenceLayerViews:r}=this.view.basemapView,i=t.some(t=>{let n=`layerViews`in t?t.layerViews:null;return n?n.includes(e):t===e}),a=!this.basemapLegendVisible&&(i||r?.includes(e)),o=!this.groundLegendVisible&&n?.includes(e);return!a&&!o}_sortActiveLayerInfos(e){let t=this.view;if(e.length<2||!t)return;let n=[];e.forEach(t=>{if(!t.parent){let r=t.layer.parent,i=r&&`uid`in r&&this._layerViewByLayerId[r.uid],a=i&&this._activeLayerInfosByLayerViewId[i.uid];a&&e.includes(a)&&(n.push(t),t.parent=a,a.children.add(t),this._sortActiveLayerInfos(a.children))}}),e.removeMany(n);let r={};t.allLayerViews.forEach((e,t)=>r[e.layer.uid]=t),e.sort((e,t)=>{let n=r[e.layer.uid]||0;return(r[t.layer.uid]||0)-n})}_generateLayerViews(){let e=[];return v.filter(this._filterLayerViews,this).map(e=>l(this,e)).filter(e=>e!=null).forEach(this._collectLayerViews(`layerViews`,e)),e}_filterLayerViews(e){let t=!this.basemapLegendVisible&&(e===h||e===_),n=!this.groundLegendVisible&&e===g;return!t&&!n}_collectLayerViews(e,t){let n=r=>(r&&r.forEach(r=>{t.push(r),n(r[e])}),t);return n}_filterLayerViewsByLayerInfos(e){let t=this.layerInfos;return t&&t.length?t.some(t=>this._hasLayerInfo(t,e)):!0}_hasLayerInfo(e,t){let n=this._isLayerUIDMatching(e.layer,t.layer.uid);return n&&(this._layerInfosByLayerViewId[t.uid]=e),n}_isLayerUIDMatching(e,t){return e&&(e.uid===t||this._hasLayerUID(e.layers,t))}_hasLayerUID(e,t){return e&&e.some(e=>this._isLayerUIDMatching(e,t))}_isLayerViewSupported(e){return m.has(e.layer.declaredClass)?(this._layerViewByLayerId[e.layer.uid]=e,!0):!1}_generateActiveLayerInfo(e){if(this._isLayerActive(e)){this._buildActiveLayerInfo(e);return}this.removeHandles(e.uid),this.addHandles(i(()=>[e.legendEnabled,e.layer?.legendEnabled],()=>this._layerActiveHandle(e)),e.uid)}_layerActiveHandle(e){this._isLayerActive(e)&&(this.removeHandles(e.uid),this._buildActiveLayerInfo(e))}_isLayerActive(e){return!this.respectLayerVisibility||e.legendEnabled&&e.layer?.legendEnabled}async _buildActiveLayerInfo(e){let t=e.layer,n=e.uid,r=this._layerInfosByLayerViewId[n],i=this._activeLayerInfosByLayerViewId[n];i||(i=new u({keepCacheOnDestroy:this.keepCacheOnDestroy,layer:t,layerView:e,view:this.view??void 0}),this._activeLayerInfosByLayerViewId[n]=i);let a=r?.title!==void 0&&r.layer.uid===t.uid;i.title=a?r.title:t.title,i.respectLayerDefinitionExpression=this.respectLayerDefinitionExpression,i.respectLayerVisibility=this.respectLayerVisibility,i.hideLayersNotInCurrentView=this.hideLayersNotInCurrentView,i.sublayerIds=r?.sublayerIds||[];let o=t.parent&&`uid`in t.parent?this._layerViewByLayerId[t.parent?.uid]:null;i.parent=this._activeLayerInfosByLayerViewId[o?.uid],this._addActiveLayerInfo(i),this._constructLegendElements(i),this._attachHandlesToActiveLayerInfo(i)}_attachHandlesToActiveLayerInfo(e){let{layer:t,layerView:n}=e,r=n.uid;this.removeHandles(r),this.addHandles([i(()=>t.title,t=>this._titleHandle(t,e)),i(()=>[t.opacity,`renderer`in t&&t.renderer,`pointSymbol`in t&&t.pointSymbol,`lineSymbol`in t&&t.lineSymbol,`polygonSymbol`in t&&t.polygonSymbol,`effect`in t&&t.effect,`featureReduction`in t&&d(t,n.view),this.view?.timeZone],()=>this._constructLegendElements(e)),i(()=>`filter`in n&&n.filter,()=>{d(n.layer,n.view)!=null&&this._constructLegendElements(e)}),o(()=>!!this.view?.stationary,()=>this._scaleHandle(e)),i(()=>e.loading,()=>this.notifyChange(`loading`),a)],r),this.respectLayerVisibility&&this.addHandles([i(()=>t.legendEnabled,t=>this._legendEnabledHandle(t,e)),i(()=>n.legendEnabled,t=>{this.view?.suspended||this._legendEnabledHandle(t,e)})],r),this.respectLayerDefinitionExpression&&`definitionExpression`in t&&this.addHandles(i(()=>t.definitionExpression,()=>this._constructLegendElements(e)),r)}_titleHandle(e,t){t.title=e,this._constructLegendElements(t)}_legendEnabledHandle(e,t){e?this._addActiveLayerInfo(t):this._removeActiveLayerInfo(t)}_scaleHandle(e){(e.isScaleDriven||e.hideLayersNotInCurrentView)&&this._constructLegendElements(e)}_addActiveLayerInfo(e){let{layerView:t,layer:n}=e;if(this._isLayerActive(t)&&!this.activeLayerInfos.includes(e)){let t=e.parent;if(t)t.children.includes(e)||t.children.push(e),this._sortActiveLayerInfos(t.children);else{let t=this.layerInfos?.some(e=>e.layer.uid===n.uid),r=n.parent;r&&`uid`in r&&this._layerViewByLayerId[r.uid]&&!t?this._activeLayerInfosWithNoParent.add(e):(this.activeLayerInfos.add(e),this._sortActiveLayerInfos(this.activeLayerInfos))}if(this._activeLayerInfosWithNoParent.length){let e=[];this._activeLayerInfosWithNoParent.forEach(t=>{let n=t.layer.parent,r=n&&`uid`in n?this._layerViewByLayerId[n?.uid]:null,i=this._activeLayerInfosByLayerViewId[r?.uid];i&&(e.push(t),t.parent=i)}),e.length&&(this._activeLayerInfosWithNoParent.removeMany(e),e.forEach(e=>this._addActiveLayerInfo(e)))}}}_removeActiveLayerInfo(e){let t=e.parent;t?t.children.remove(e):this.activeLayerInfos.remove(e)}async _getBuildLegendPromise(e){let{layer:t}=e;if(`featureCollections`in t&&t.featureCollections)return e.buildLegendElementsForFeatureCollections(t.featureCollections);if(`featureReduction`in t&&t.featureReduction&&`renderer`in t.featureReduction&&(t.featureReduction.type===`binning`||t.featureReduction.type===`cluster`)&&(!this.view||t.featureReduction.maxScale<=this.view.scale))return e.buildLegendElementsForFeatureReduction(t.featureReduction);if(`renderer`in t&&t.renderer&&!(`sublayers`in t))return e.buildLegendElementsForRenderer(t.renderer);if(`url`in t&&t.url&&t.type!==`catalog`&&t.type!==`knowledge-graph`)return e.buildLegendElementsForTools();let n=e.children.map(e=>this._constructLegendElements(e));return Promise.all(n).then(()=>{})}async _constructLegendElements(e){let t=this._activeLayerInfosPromises.get(e);t&&await t.catch(()=>{});let n=this._getBuildLegendPromise(e);this._activeLayerInfosPromises.set(e,n),n.finally(()=>{this._activeLayerInfosPromises.delete(e)})}};e([s({type:p})],y.prototype,`activeLayerInfos`,void 0),e([s()],y.prototype,`basemapLegendVisible`,void 0),e([s()],y.prototype,`groundLegendVisible`,void 0),e([s()],y.prototype,`hideLayersNotInCurrentView`,void 0),e([s()],y.prototype,`keepCacheOnDestroy`,void 0),e([s()],y.prototype,`layerInfos`,void 0),e([s({readOnly:!0})],y.prototype,`loading`,null),e([s()],y.prototype,`respectLayerDefinitionExpression`,void 0),e([s()],y.prototype,`respectLayerVisibility`,void 0),e([s({readOnly:!0})],y.prototype,`state`,null),e([s()],y.prototype,`view`,void 0),y=e([c(`esri.legend.LegendModel`)],y);const b=y;export{b as default};
|
package/legend/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Public types used to configure [
|
|
2
|
+
* Public types used to configure [LegendModel](https://developers.arcgis.com/javascript/latest/references/core/legend/LegendModel/) and describe the legend elements generated by
|
|
3
3
|
* [ActiveLayerInfo](https://developers.arcgis.com/javascript/latest/references/core/legend/ActiveLayerInfo/).
|
|
4
4
|
*
|
|
5
5
|
* These types can be used when rendering a custom legend independently of the Legend component.
|
|
@@ -115,7 +115,7 @@ export interface ImageSymbolTableElementInfo {
|
|
|
115
115
|
/**
|
|
116
116
|
* An object that defines a layer, optional sublayer IDs, and a custom title for legend display.
|
|
117
117
|
* Use this to specify which layers and sublayers appear in the legend and how they are labeled with
|
|
118
|
-
* [layerInfos](https://developers.arcgis.com/javascript/latest/references/core/legend/
|
|
118
|
+
* [layerInfos](https://developers.arcgis.com/javascript/latest/references/core/legend/LegendModel/#layerInfos).
|
|
119
119
|
*/
|
|
120
120
|
export interface LayerInfo {
|
|
121
121
|
/** A layer to display in the legend. */
|
|
@@ -136,8 +136,8 @@ export interface LayerInfo {
|
|
|
136
136
|
/** The allowed color names used in multilayer stretch legends. */
|
|
137
137
|
export type LegendColorName = "red" | "green" | "blue";
|
|
138
138
|
|
|
139
|
-
/** Represents the allowed values for the [
|
|
140
|
-
export type
|
|
139
|
+
/** Represents the allowed values for the [LegendModel.state](https://developers.arcgis.com/javascript/latest/references/core/legend/LegendModel/#state) property. */
|
|
140
|
+
export type LegendModelState = "ready" | "disabled";
|
|
141
141
|
|
|
142
142
|
/** Properties defining the scheme of each supported [legend element](https://developers.arcgis.com/javascript/latest/references/core/legend/ActiveLayerInfo/#legendElements). */
|
|
143
143
|
export type LegendElement = SymbolTableElement | ColorRampElement | StretchRampElement | OpacityRampElement | SizeRampElement | HeatmapRampElement | RelationshipRampElement | UnivariateColorSizeRampElement | PieChartRampElement;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{getAssetUrl as e}from"../../assets.js";function
|
|
2
|
+
import{getAssetUrl as e}from"../../assets.js";import t from"../../core/Error.js";const n=new Map;async function r(){let{default:e}=await import(`../../chunks/lyr3DMain.js`);return a(`lyr3DMain`,e)}async function i(){let{default:e}=await import(`../../chunks/lyr3DWorker.js`);return a(`lyr3DWorker`,e)}async function a(e,t){if(process.env.NODE_ENV!==`test`)return t({locateFile:s});let r=new URL(s(`${e}.wasm`),globalThis.document?.baseURI??globalThis.location.href).href,i=n.get(e);i?.url!==r&&(i={url:r,promise:o(r)},n.set(e,i));let{promise:a}=i;try{let e=await a;return await t({locateFile:s,instantiateWasm:(t,n)=>{let r=new WebAssembly.Instance(e,t);return n(r,e),r.exports}})}catch(t){throw n.get(e)?.promise===a&&n.delete(e),t}}async function o(e){let n=await fetch(e,{credentials:`same-origin`});if(!n.ok)throw new t(`lyr3d:wasm-load-failed`,`Failed to load WASM (${n.status})`,{url:e});return typeof WebAssembly.compileStreaming==`function`&&n.headers.get(`content-type`)?.split(`;`)[0].trim().toLowerCase()===`application/wasm`?WebAssembly.compileStreaming(n):WebAssembly.compile(await n.arrayBuffer())}function s(t){return e(`esri/libs/lyr3d/${t}`)}export{r as loadLyr3DMainWASM,i as loadLyr3DWorkerWASM};
|
|
@@ -12,8 +12,10 @@ import type TerminalConfiguration from "./support/TerminalConfiguration.js";
|
|
|
12
12
|
import type TraceJobInfo from "./support/TraceJobInfo.js";
|
|
13
13
|
import type Association from "../rest/networks/support/Association.js";
|
|
14
14
|
import type AssociationGeometriesResult from "../rest/networks/support/AssociationGeometriesResult.js";
|
|
15
|
+
import type TraceLocation from "../rest/networks/support/TraceLocation.js";
|
|
15
16
|
import type TraceResult from "../rest/networks/support/TraceResult.js";
|
|
16
17
|
import type { AbortOptions } from "../core/promiseUtils.js";
|
|
18
|
+
import type { TraceLocationType } from "./support/typeUtils.js";
|
|
17
19
|
import type { RequestOptions } from "../request/types.js";
|
|
18
20
|
import type { ServiceEdits } from "../rest/featureService/types.js";
|
|
19
21
|
import type { QueryAssociationsParametersProperties } from "../rest/networks/support/QueryAssociationsParameters.js";
|
|
@@ -195,6 +197,19 @@ export default class UtilityNetwork extends Network {
|
|
|
195
197
|
* const isValidAssociation = await utilityNetwork.canAddAssociation(association);
|
|
196
198
|
*/
|
|
197
199
|
canAddAssociation(association: Association): Promise<boolean>;
|
|
200
|
+
/**
|
|
201
|
+
* Creates a trace location from a utility network graphic.
|
|
202
|
+
*
|
|
203
|
+
* Point and polygon graphics use the first terminal in their terminal configuration, or terminal `1` when no configuration is available.
|
|
204
|
+
* Polyline graphics use a location halfway along the line (`percentAlong` is `0.5`). The returned location is not a filter barrier.
|
|
205
|
+
*
|
|
206
|
+
* @param graphic - The graphic to convert. Its geometry must be a point, polygon, polyline, or nonspatial (undefined).
|
|
207
|
+
* @param traceLocationType - Whether the location is a starting point, barrier, or stopping point.
|
|
208
|
+
* @returns The trace location created from the graphic.
|
|
209
|
+
* @since 5.2
|
|
210
|
+
* @throws An error if the graphic has no supported geometry type.
|
|
211
|
+
*/
|
|
212
|
+
createTraceLocation(graphic: Graphic, traceLocationType: TraceLocationType): TraceLocation;
|
|
198
213
|
/**
|
|
199
214
|
* Returns [ServiceEdits](https://developers.arcgis.com/javascript/latest/references/core/rest/featureService/types/#ServiceEdits) which are used to add an [Association](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/Association/) via the `applyEdits` method on the [FeatureService](https://developers.arcgis.com/javascript/latest/references/core/rest/featureService/FeatureService/) class.
|
|
200
215
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Graphic.js";import n from"../core/Error.js";import{getOrCreateMapValue as r}from"../core/MapUtils.js";import{watch as i}from"../core/reactiveUtils.js";import{property as a,subclass as o}from"../core/accessorSupport/decorators.js";import{getGraphicLayer as s}from"../graphic/graphicOriginUtils.js";import c from"../layers/FeatureLayer.js";import{queryAllJSON as l}from"../layers/support/featureQueryAll.js";import u from"./Network.js";import d from"./RulesTable.js";import f from"./support/NamedTraceConfiguration.js";import{getAssociationsTableFields as p}from"./support/networkFieldUtils.js";import m from"./support/NetworkSystemLayers.js";import h from"./support/TerminalConfiguration.js";import g from"./support/TraceJobInfo.js";import{AssociationTypeEnum as _,nullGuid as v,associationTypeKebabDict as y}from"./support/typeUtils.js";import{doesRuleAllowAssociation as b}from"./support/utils.js";import x from"../rest/networks/support/TelecomNetworkElement.js";import S from"../rest/support/Query.js";let C=class extends u{constructor(e){super(e),this.sharedNamedTraceConfigurations=[],this.type=`utility`,this._circuitManagerMap=new Map,this._terminalById=new Map,this._unitIdentifierManager=null}initialize(){this.addHandles(i(()=>[this.gdbVersion,this.historicMoment],()=>{this.networkSystemLayers.associationsTable&&(this.networkSystemLayers.associationsTable.gdbVersion!==this.gdbVersion&&(this.networkSystemLayers.associationsTable.gdbVersion=this.gdbVersion),this.networkSystemLayers.associationsTable.historicMoment!==this.historicMoment&&(this.networkSystemLayers.associationsTable.historicMoment=this.historicMoment))}))}get _rulesLayer(){let{gdbVersion:e,historicMoment:t}=this,n=this.networkSystemLayers.rulesTableUrl;return new c({url:n,gdbVersion:e,historicMoment:t})}get _telecomSourceSet(){let e=new Set;return this.dataElement?.domainNetworks.forEach(t=>{t.isTelecomNetwork&&(t.edgeSources?.forEach(t=>e.add(t.sourceId)),t.junctionSources?.forEach(t=>e.add(t.sourceId)))}),e}get _utilityLayerList(){let e=new Set;return this.dataElement?.domainNetworks?.map(t=>{t?.edgeSources?.map(({layerId:t,sourceId:n})=>{this._layerIdBySourceId.set(n,t),this._sourceIdByLayerId.set(t,n),e.add(t)}),t?.junctionSources?.map(({layerId:t,sourceId:n})=>{this._layerIdBySourceId.set(n,t),this._sourceIdByLayerId.set(t,n),e.add(t)})}),e}get serviceTerritoryFeatureLayerId(){return this.dataElement?.serviceTerritoryFeatureLayerId??null}get networkSystemLayers(){return new m({rulesTableId:this.sourceJSON?.systemLayers.rulesTableId,rulesTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.rulesTableId}`:null,subnetworksTableId:this.sourceJSON?.systemLayers.subnetworksTableId,subnetworksTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.subnetworksTableId}`:null,dirtyAreasLayerId:this.sourceJSON?.systemLayers.dirtyAreasLayerId,dirtyAreasLayerUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.dirtyAreasLayerId}`:null,associationsTableId:this.sourceJSON?.systemLayers.associationsTableId,associationsTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.associationsTableId}`:null})}get terminalConfigurations(){return this.dataElement?.terminalConfigurations.map(e=>h.fromJSON(e))||[]}get domainNetworkNames(){return this.dataElement?.domainNetworks.map(e=>e.domainNetworkName)||[]}get hasTelecomNetwork(){return this.dataElement?.domainNetworks.some(e=>e.isTelecomNetwork)??!1}get associationsTable(){return this.networkSystemLayers.associationsTable}async load(e){return this.addResolvingPromise(this._load(e)),this}async _load(e){await super._load(e);let{dataElement:t,layerId:r,sourceJSON:i}=this;if(!(t&&`domainNetworks`in t&&Array.isArray(t.domainNetworks)))throw new n(`network:invalid-data-element`,`The data element for layer ${r} does not have the expected properties for a utility network.`);if(!(i&&`type`in i&&typeof i.type==`string`&&i.type===`Utility Network Layer`))throw new n(`network:invalid-layer`,`The metadata for layer ${r} does not have the expected properties for a utility network.`);await Promise.all([this._loadNamedTraceConfigurationsFromNetwork(e),this.networkSystemLayers.loadAssociationsTable(e)])}getTerminalConfiguration(e){let t=null,n=null,r=s(e)??null,i=null;if(r?.type===`feature`){if(i=r.layerId,i===null)return null}else if(r?.type===`subtype-sublayer`){if(i=r?.parent?.layerId??null,i===null)return null}else return null;let a=e.attributes;if(a==null)return null;for(let r of Object.keys(a))r.toUpperCase()===`ASSETGROUP`&&(t=e.getAttribute(r)),r.toUpperCase()===`ASSETTYPE`&&(n=e.getAttribute(r));if(!this.dataElement)return null;let o=null,c=this.dataElement.domainNetworks;for(let e of c){let r=e.junctionSources?.find(e=>e.layerId===i);if(r){let e=r.assetGroups?.find(e=>e.assetGroupCode===t);if(e){let t=e.assetTypes?.find(e=>e.assetTypeCode===n);if(t?.isTerminalConfigurationSupported){o=t.terminalConfigurationId;break}}}}if(o!=null){let e=this.dataElement.terminalConfigurations?.find(e=>e.terminalConfigurationId===o);return e?h.fromJSON(e):null}return null}getTierNames(e){return(this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e))?.tiers?.map(e=>e.name)||[]}async getRulesTable(){let e=this._rulesLayer;e.loaded||await e.load();let t=this.dataElement?.domainNetworks;if(!t)return null;let n=t.flatMap(e=>[...e.edgeSources||[],...e.junctionSources||[]]),r=(await this._queryRulesTable(e)).map(t=>this._hydrateRuleInfo(e,n,t));return new d({rulesLayer:e,rules:r})}async getCircuitManager(e){if(!this.hasTelecomNetwork)return null;let t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e&&t.isTelecomNetwork);if(!t)return null;let{default:n}=await import(`./CircuitManager.js`);return r(this._circuitManagerMap,e,()=>new n({utilityNetwork:this,telecomDomainNetwork:t}))}async getUnitIdentifierManager(){if(!this.hasTelecomNetwork)return null;if(this._unitIdentifierManager)return this._unitIdentifierManager;let{default:e}=await import(`./UnitIdentifierManager.js`);return this._unitIdentifierManager=new e({utilityNetwork:this}),this._unitIdentifierManager}getTerminalById(e){return!this.dataElement||e==null?null:this._terminalById.get(e)??(this.terminalConfigurations.forEach(e=>{e.terminals.forEach(e=>{this._terminalById.set(e.id,e)})}),this._terminalById.get(e))}isUtilityLayer(e){return`layerId`in e?e.layerId!=null&&this._utilityLayerList.has(e.layerId)&&(e.url?.startsWith(this.featureServiceUrl)??!1):e.type===`subtype-sublayer`&&e.parent?this._utilityLayerList.has(e.parent.layerId)&&(e.parent.url?.startsWith(this.featureServiceUrl)??!1):!1}async queryAssociations(e,t){let[{queryAssociations:n},{default:r}]=await Promise.all([import(`../rest/networks/queryAssociations.js`),import(`../rest/networks/support/QueryAssociationsParameters.js`)]),i=r.from(e);return i.gdbVersion=this.gdbVersion,i.moment=this.historicMoment,(await n(this.networkServiceUrl,i,t)).associations}async synthesizeAssociationGeometries(e){let[{synthesizeAssociationGeometries:t},{default:n}]=await Promise.all([import(`../rest/networks/synthesizeAssociationGeometries.js`),import(`../rest/networks/support/SynthesizeAssociationGeometriesParameters.js`)]),r=n.from(e);return r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment,t(this.networkServiceUrl,r)}async trace(e){let[{trace:t},{default:n}]=await Promise.all([import(`../rest/networks/trace.js`),import(`../rest/networks/support/TraceParameters.js`)]),r=n.from({...e,telecomSourceSet:this._telecomSourceSet});return r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment,t(this.networkServiceUrl,r)}async submitTraceJob(e){let[{submitTraceJob:t},{default:n}]=await Promise.all([import(`../rest/networks/trace.js`),import(`../rest/networks/support/TraceParameters.js`)]),r=n.from(e);r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment;let i=await t(this.networkServiceUrl,r);return new g({statusUrl:i,telecomSourceSet:this._telecomSourceSet})}async canAddAssociation(e){let t=await this.getRulesTable();if(!t)return!1;let{fromNetworkElement:n,toNetworkElement:r}=e;if(!n||!r)return!1;await t.load();let i=null;switch(e.associationType){case`containment`:i=t.rulesCategorized.containment;break;case`attachment`:i=t.rulesCategorized.attachment;break;default:i=t.rulesCategorized.connectivity}return i.some(e=>b(e,n,r))}generateAddAssociations(e){let{associationsTable:n}=this.networkSystemLayers,{fromNetworkSourceId:r,fromGlobalId:i,fromTerminalId:a,fromFirstUnit:o,fromLastUnit:s,toNetworkSourceId:c,toGlobalId:l,toTerminalId:u,toFirstUnit:d,toLastUnit:f,associationType:m,isContentVisible:h,percentAlong:g,globalId:v}=p(n);return{addFeatures:e.map(e=>{let n=new t({attributes:{[r]:e.fromNetworkElement?.networkSourceId,[i]:e.fromNetworkElement?.globalId,[a]:e.fromNetworkElement?.terminalId,[c]:e.toNetworkElement?.networkSourceId,[l]:e.toNetworkElement?.globalId,[u]:e.toNetworkElement?.terminalId,[m]:_[e.associationType],[h]:e.isContentVisible==null?void 0:+!!e.isContentVisible,[g]:e.percentAlong,[v]:e.globalId}}),p=e.associationType.includes(`connectivity`);return e.fromNetworkElement instanceof x&&(n.attributes[o]=e.fromNetworkElement?.firstUnit,n.attributes[s]=e.fromNetworkElement?.lastUnit),e.toNetworkElement instanceof x&&(n.attributes[d]=e.toNetworkElement?.firstUnit,n.attributes[f]=e.toNetworkElement?.lastUnit),p&&(n.attributes[a]=e.fromNetworkElement?.terminalId??1,n.attributes[u]=e.toNetworkElement?.terminalId??1),n}),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:n?.globalIdField??`globalid`,objectIdField:n?.objectIdField??`objectid`}}}generateDeleteAssociations(e){let{associationsTable:t,associationsTableId:n}=this.networkSystemLayers,r={id:n,identifierFields:{globalIdField:t?.globalIdField??`globalid`,objectIdField:t?.objectIdField??`objectid`}};if(this.dataElement?.schemaGeneration===-8){let t=this._generateDeleteTelecomAssociationPayload(e);return{...r,deleteAssociations:t}}let i=e.map(e=>({globalId:e.globalId}));return{...r,deleteFeatures:i}}async loadAssociationsTable(){return this.networkSystemLayers.loadAssociationsTable()}async loadSubnetworksTable(){return this.networkSystemLayers.loadSubnetworksTable()}async _loadNamedTraceConfigurationsFromNetwork(e){if(this.sharedNamedTraceConfigurations?.length===0)return;let t=this.sharedNamedTraceConfigurations.map(e=>e.globalId),n=await this.queryNamedTraceConfigurations({globalIds:t},e);for(let e of this.sharedNamedTraceConfigurations){let t=n?.find(t=>t.globalId===e.globalId);if(t){let n=t.write({},{origin:`service`});e.read(n,{origin:`service`})}}}_hydrateRuleInfo(e,t,n){let r=e.fieldsIndex,i=r.get(`RULETYPE`),a=r.get(`CREATIONDATE`),o=r.get(`FROMNETWORKSOURCEID`),s=r.get(`FROMASSETGROUP`),c=r.get(`FROMASSETTYPE`),l=r.get(`FROMTERMINALID`),u=r.get(`TONETWORKSOURCEID`),d=r.get(`TOASSETGROUP`),f=r.get(`TOASSETTYPE`),p=r.get(`TOTERMINALID`),m=r.get(`VIANETWORKSOURCEID`),h=r.get(`VIAASSETGROUP`),g=r.get(`VIAASSETTYPE`),_=r.get(`VIATERMINALID`),v=n.attributes[i.name],y=new Date(n.attributes[a.name]),b=n.attributes[o.name],x=n.attributes[s.name],S=n.attributes[c.name],C=n.attributes[l.name],w=n.attributes[u.name],T=n.attributes[d.name],E=n.attributes[f.name],D=n.attributes[p.name],O=n.attributes[m.name],k=n.attributes[h.name],A=n.attributes[g.name],j=n.attributes[_.name],M=[{networkSourceId:b,assetGroupId:x,assetTypeId:S,terminalId:C},{networkSourceId:w,assetGroupId:T,assetTypeId:E,terminalId:D},{networkSourceId:O,assetGroupId:k,assetTypeId:A,terminalId:j}],N={ruleType:v,creationDate:y};for(let e of[0,1,2]){if(v!==5&&e===2)continue;let n=M[e],r=t.find(e=>e.sourceId===n.networkSourceId),i=r?.assetGroups.find(e=>e.assetGroupCode===n.assetGroupId),a=i?.assetTypes.find(e=>e.assetTypeCode===n.assetTypeId),o=this._getTerminal(a,n),s=``;switch(e){case 0:s=`from`;break;case 1:s=`to`;break;case 2:s=`via`}N[`${s}NetworkSource`]=r,N[`${s}AssetGroup`]=i,N[`${s}AssetType`]=a,N[`${s}Terminal`]=o?.toJSON()}return N}_getTerminal(e,t){let n=e?.terminalConfigurationId;return(this.terminalConfigurations?.find(e=>e.id===n))?.terminals?.find(e=>e.id===t.terminalId)??null}async _queryRulesTable(e){let{gdbVersion:t,historicMoment:n}=this,r=new S({where:`1=1`,outFields:[`*`],gdbVersion:t,historicMoment:n});return(await l(e,r)).features}_generateDeleteTelecomAssociationPayload(e){return e.map(e=>({globalId:e.globalId??v,associationType:y.toJSON(e.associationType),fromSourceId:e.fromNetworkElement.networkSourceId,fromGlobalId:e.fromNetworkElement.globalId,fromTerminalId:e.fromNetworkElement.terminalId,toSourceId:e.toNetworkElement.networkSourceId,toGlobalId:e.toNetworkElement.globalId,toTerminalId:e.toNetworkElement.terminalId}))}};e([a({readOnly:!0})],C.prototype,`_rulesLayer`,null),e([a({readOnly:!0})],C.prototype,`_telecomSourceSet`,null),e([a({type:[f],json:{origins:{"web-map":{read:{source:`traceConfigurations`},write:{target:`traceConfigurations`}},service:{read:{source:`traceConfigurations`}}},read:!1}})],C.prototype,`sharedNamedTraceConfigurations`,void 0),e([a({type:[`utility`],readOnly:!0,json:{read:!1,write:!1}})],C.prototype,`type`,void 0),e([a({readOnly:!0})],C.prototype,`serviceTerritoryFeatureLayerId`,null),e([a({readOnly:!0})],C.prototype,`networkSystemLayers`,null),e([a({readOnly:!0})],C.prototype,`terminalConfigurations`,null),e([a({readOnly:!0})],C.prototype,`domainNetworkNames`,null),e([a({readOnly:!0})],C.prototype,`hasTelecomNetwork`,null),e([a({readOnly:!0,json:{read:!1}})],C.prototype,`associationsTable`,null),C=e([o(`esri.networks.UtilityNetwork`)],C);const w=C;export{w as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Graphic.js";import n from"../core/Error.js";import{getOrCreateMapValue as r}from"../core/MapUtils.js";import{watch as i}from"../core/reactiveUtils.js";import{property as a,subclass as o}from"../core/accessorSupport/decorators.js";import{getGraphicLayer as s}from"../graphic/graphicOriginUtils.js";import c from"../layers/FeatureLayer.js";import{queryAllJSON as l}from"../layers/support/featureQueryAll.js";import{isSubtypeSublayer as u}from"../layers/support/layerUtils.js";import d from"./Network.js";import f from"./RulesTable.js";import p from"./support/NamedTraceConfiguration.js";import{getAssociationsTableFields as m}from"./support/networkFieldUtils.js";import h from"./support/NetworkSystemLayers.js";import g from"./support/TerminalConfiguration.js";import _ from"./support/TraceJobInfo.js";import{AssociationTypeEnum as v,nullGuid as y,associationTypeKebabDict as b}from"./support/typeUtils.js";import{doesRuleAllowAssociation as x}from"./support/utils.js";import S from"../rest/networks/support/TelecomNetworkElement.js";import C from"../rest/networks/support/TraceLocation.js";import w from"../rest/support/Query.js";let T=class extends d{constructor(e){super(e),this.sharedNamedTraceConfigurations=[],this.type=`utility`,this._circuitManagerMap=new Map,this._terminalById=new Map,this._unitIdentifierManager=null}initialize(){this.addHandles(i(()=>[this.gdbVersion,this.historicMoment],()=>{this.networkSystemLayers.associationsTable&&(this.networkSystemLayers.associationsTable.gdbVersion!==this.gdbVersion&&(this.networkSystemLayers.associationsTable.gdbVersion=this.gdbVersion),this.networkSystemLayers.associationsTable.historicMoment!==this.historicMoment&&(this.networkSystemLayers.associationsTable.historicMoment=this.historicMoment))}))}get _rulesLayer(){let{gdbVersion:e,historicMoment:t}=this,n=this.networkSystemLayers.rulesTableUrl;return new c({url:n,gdbVersion:e,historicMoment:t})}get _telecomSourceSet(){let e=new Set;return this.dataElement?.domainNetworks.forEach(t=>{t.isTelecomNetwork&&(t.edgeSources?.forEach(t=>e.add(t.sourceId)),t.junctionSources?.forEach(t=>e.add(t.sourceId)))}),e}get _utilityLayerList(){let e=new Set;return this.dataElement?.domainNetworks?.map(t=>{t?.edgeSources?.map(({layerId:t,sourceId:n})=>{this._layerIdBySourceId.set(n,t),this._sourceIdByLayerId.set(t,n),e.add(t)}),t?.junctionSources?.map(({layerId:t,sourceId:n})=>{this._layerIdBySourceId.set(n,t),this._sourceIdByLayerId.set(t,n),e.add(t)})}),e}get _edgeSourceLayerIds(){let e=this.dataElement?.domainNetworks;return e?e.flatMap(e=>e.edgeSources).map(e=>e.layerId).filter(Boolean):[]}get serviceTerritoryFeatureLayerId(){return this.dataElement?.serviceTerritoryFeatureLayerId??null}get networkSystemLayers(){return new h({rulesTableId:this.sourceJSON?.systemLayers.rulesTableId,rulesTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.rulesTableId}`:null,subnetworksTableId:this.sourceJSON?.systemLayers.subnetworksTableId,subnetworksTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.subnetworksTableId}`:null,dirtyAreasLayerId:this.sourceJSON?.systemLayers.dirtyAreasLayerId,dirtyAreasLayerUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.dirtyAreasLayerId}`:null,associationsTableId:this.sourceJSON?.systemLayers.associationsTableId,associationsTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.associationsTableId}`:null})}get terminalConfigurations(){return this.dataElement?.terminalConfigurations.map(e=>g.fromJSON(e))||[]}get domainNetworkNames(){return this.dataElement?.domainNetworks.map(e=>e.domainNetworkName)||[]}get hasTelecomNetwork(){return this.dataElement?.domainNetworks.some(e=>e.isTelecomNetwork)??!1}get associationsTable(){return this.networkSystemLayers.associationsTable}async load(e){return this.addResolvingPromise(this._load(e)),this}async _load(e){await super._load(e);let{dataElement:t,layerId:r,sourceJSON:i}=this;if(!(t&&`domainNetworks`in t&&Array.isArray(t.domainNetworks)))throw new n(`network:invalid-data-element`,`The data element for layer ${r} does not have the expected properties for a utility network.`);if(!(i&&`type`in i&&typeof i.type==`string`&&i.type===`Utility Network Layer`))throw new n(`network:invalid-layer`,`The metadata for layer ${r} does not have the expected properties for a utility network.`);await Promise.all([this._loadNamedTraceConfigurationsFromNetwork(e),this.networkSystemLayers.loadAssociationsTable(e)])}getTerminalConfiguration(e){let t=null,n=null,r=s(e)??null,i=null;if(r?.type===`feature`){if(i=r.layerId,i===null)return null}else if(r?.type===`subtype-sublayer`){if(i=r?.parent?.layerId??null,i===null)return null}else return null;let a=e.attributes;if(a==null)return null;for(let r of Object.keys(a))r.toUpperCase()===`ASSETGROUP`&&(t=e.getAttribute(r)),r.toUpperCase()===`ASSETTYPE`&&(n=e.getAttribute(r));if(!this.dataElement)return null;let o=null,c=this.dataElement.domainNetworks;for(let e of c){let r=e.junctionSources?.find(e=>e.layerId===i);if(r){let e=r.assetGroups?.find(e=>e.assetGroupCode===t);if(e){let t=e.assetTypes?.find(e=>e.assetTypeCode===n);if(t?.isTerminalConfigurationSupported){o=t.terminalConfigurationId;break}}}}if(o!=null){let e=this.dataElement.terminalConfigurations?.find(e=>e.terminalConfigurationId===o);return e?g.fromJSON(e):null}return null}getTierNames(e){return(this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e))?.tiers?.map(e=>e.name)||[]}async getRulesTable(){let e=this._rulesLayer;e.loaded||await e.load();let t=this.dataElement?.domainNetworks;if(!t)return null;let n=t.flatMap(e=>[...e.edgeSources||[],...e.junctionSources||[]]),r=(await this._queryRulesTable(e)).map(t=>this._hydrateRuleInfo(e,n,t));return new f({rulesLayer:e,rules:r})}async getCircuitManager(e){if(!this.hasTelecomNetwork)return null;let t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e&&t.isTelecomNetwork);if(!t)return null;let{default:n}=await import(`./CircuitManager.js`);return r(this._circuitManagerMap,e,()=>new n({utilityNetwork:this,telecomDomainNetwork:t}))}async getUnitIdentifierManager(){if(!this.hasTelecomNetwork)return null;if(this._unitIdentifierManager)return this._unitIdentifierManager;let{default:e}=await import(`./UnitIdentifierManager.js`);return this._unitIdentifierManager=new e({utilityNetwork:this}),this._unitIdentifierManager}getTerminalById(e){return!this.dataElement||e==null?null:this._terminalById.get(e)??(this.terminalConfigurations.forEach(e=>{e.terminals.forEach(e=>{this._terminalById.set(e.id,e)})}),this._terminalById.get(e))}isUtilityLayer(e){return`layerId`in e?e.layerId!=null&&this._utilityLayerList.has(e.layerId)&&(e.url?.startsWith(this.featureServiceUrl)??!1):e.type===`subtype-sublayer`&&e.parent?this._utilityLayerList.has(e.parent.layerId)&&(e.parent.url?.startsWith(this.featureServiceUrl)??!1):!1}async queryAssociations(e,t){let[{queryAssociations:n},{default:r}]=await Promise.all([import(`../rest/networks/queryAssociations.js`),import(`../rest/networks/support/QueryAssociationsParameters.js`)]),i=r.from(e);return i.gdbVersion=this.gdbVersion,i.moment=this.historicMoment,(await n(this.networkServiceUrl,i,t)).associations}async synthesizeAssociationGeometries(e){let[{synthesizeAssociationGeometries:t},{default:n}]=await Promise.all([import(`../rest/networks/synthesizeAssociationGeometries.js`),import(`../rest/networks/support/SynthesizeAssociationGeometriesParameters.js`)]),r=n.from(e);return r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment,t(this.networkServiceUrl,r)}async trace(e){let[{trace:t},{default:n}]=await Promise.all([import(`../rest/networks/trace.js`),import(`../rest/networks/support/TraceParameters.js`)]),r=n.from({...e,telecomSourceSet:this._telecomSourceSet});return r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment,t(this.networkServiceUrl,r)}async submitTraceJob(e){let[{submitTraceJob:t},{default:n}]=await Promise.all([import(`../rest/networks/trace.js`),import(`../rest/networks/support/TraceParameters.js`)]),r=n.from(e);r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment;let i=await t(this.networkServiceUrl,r);return new _({statusUrl:i,telecomSourceSet:this._telecomSourceSet})}async canAddAssociation(e){let t=await this.getRulesTable();if(!t)return!1;let{fromNetworkElement:n,toNetworkElement:r}=e;if(!n||!r)return!1;await t.load();let i=null;switch(e.associationType){case`containment`:i=t.rulesCategorized.containment;break;case`attachment`:i=t.rulesCategorized.attachment;break;default:i=t.rulesCategorized.connectivity}return i.some(e=>x(e,n,r))}generateAddAssociations(e){let{associationsTable:n}=this.networkSystemLayers,{fromNetworkSourceId:r,fromGlobalId:i,fromTerminalId:a,fromFirstUnit:o,fromLastUnit:s,toNetworkSourceId:c,toGlobalId:l,toTerminalId:u,toFirstUnit:d,toLastUnit:f,associationType:p,isContentVisible:h,percentAlong:g,globalId:_}=m(n);return{addFeatures:e.map(e=>{let n=new t({attributes:{[r]:e.fromNetworkElement?.networkSourceId,[i]:e.fromNetworkElement?.globalId,[a]:e.fromNetworkElement?.terminalId,[c]:e.toNetworkElement?.networkSourceId,[l]:e.toNetworkElement?.globalId,[u]:e.toNetworkElement?.terminalId,[p]:v[e.associationType],[h]:e.isContentVisible==null?void 0:+!!e.isContentVisible,[g]:e.percentAlong,[_]:e.globalId}}),m=e.associationType.includes(`connectivity`);return e.fromNetworkElement instanceof S&&(n.attributes[o]=e.fromNetworkElement?.firstUnit,n.attributes[s]=e.fromNetworkElement?.lastUnit),e.toNetworkElement instanceof S&&(n.attributes[d]=e.toNetworkElement?.firstUnit,n.attributes[f]=e.toNetworkElement?.lastUnit),m&&(n.attributes[a]=e.fromNetworkElement?.terminalId??1,n.attributes[u]=e.toNetworkElement?.terminalId??1),n}),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:n?.globalIdField??`globalid`,objectIdField:n?.objectIdField??`objectid`}}}generateDeleteAssociations(e){let{associationsTable:t,associationsTableId:n}=this.networkSystemLayers,r={id:n,identifierFields:{globalIdField:t?.globalIdField??`globalid`,objectIdField:t?.objectIdField??`objectid`}};if(this.dataElement?.schemaGeneration===-8){let t=this._generateDeleteTelecomAssociationPayload(e);return{...r,deleteAssociations:t}}let i=e.map(e=>({globalId:e.globalId}));return{...r,deleteFeatures:i}}async loadAssociationsTable(){return this.networkSystemLayers.loadAssociationsTable()}async loadSubnetworksTable(){return this.networkSystemLayers.loadSubnetworksTable()}createTraceLocation(e,t){let n=e.getGlobalId()??``,r=e.geometry?.type;if(r===`point`||r===`polygon`){let r=this.getTerminalConfiguration(e),i=r?r.terminals[0].id:1;return new C({type:t,isFilterBarrier:!1,globalId:n,terminalId:i})}if(r===`polyline`)return new C({type:t,isFilterBarrier:!1,globalId:n,percentAlong:.5});if(!r){let r=u(e.layer)?e.layer.parent:e.layer,i=r&&this._edgeSourceLayerIds.includes(r.layerId),a=this.getTerminalConfiguration(e),o=a?a.terminals[0].id:i?-1:1;return new C({type:t,isFilterBarrier:!1,globalId:n,terminalId:o,percentAlong:i?.5:-1})}throw Error(`Unsupported geometry type: ${r}`)}async _loadNamedTraceConfigurationsFromNetwork(e){if(this.sharedNamedTraceConfigurations?.length===0)return;let t=this.sharedNamedTraceConfigurations.map(e=>e.globalId),n=await this.queryNamedTraceConfigurations({globalIds:t},e);for(let e of this.sharedNamedTraceConfigurations){let t=n?.find(t=>t.globalId===e.globalId);if(t){let n=t.write({},{origin:`service`});e.read(n,{origin:`service`})}}}_hydrateRuleInfo(e,t,n){let r=e.fieldsIndex,i=r.get(`RULETYPE`),a=r.get(`CREATIONDATE`),o=r.get(`FROMNETWORKSOURCEID`),s=r.get(`FROMASSETGROUP`),c=r.get(`FROMASSETTYPE`),l=r.get(`FROMTERMINALID`),u=r.get(`TONETWORKSOURCEID`),d=r.get(`TOASSETGROUP`),f=r.get(`TOASSETTYPE`),p=r.get(`TOTERMINALID`),m=r.get(`VIANETWORKSOURCEID`),h=r.get(`VIAASSETGROUP`),g=r.get(`VIAASSETTYPE`),_=r.get(`VIATERMINALID`),v=n.attributes[i.name],y=new Date(n.attributes[a.name]),b=n.attributes[o.name],x=n.attributes[s.name],S=n.attributes[c.name],C=n.attributes[l.name],w=n.attributes[u.name],T=n.attributes[d.name],E=n.attributes[f.name],D=n.attributes[p.name],O=n.attributes[m.name],k=n.attributes[h.name],A=n.attributes[g.name],j=n.attributes[_.name],M=[{networkSourceId:b,assetGroupId:x,assetTypeId:S,terminalId:C},{networkSourceId:w,assetGroupId:T,assetTypeId:E,terminalId:D},{networkSourceId:O,assetGroupId:k,assetTypeId:A,terminalId:j}],N={ruleType:v,creationDate:y};for(let e of[0,1,2]){if(v!==5&&e===2)continue;let n=M[e],r=t.find(e=>e.sourceId===n.networkSourceId),i=r?.assetGroups.find(e=>e.assetGroupCode===n.assetGroupId),a=i?.assetTypes.find(e=>e.assetTypeCode===n.assetTypeId),o=this._getTerminal(a,n),s=``;switch(e){case 0:s=`from`;break;case 1:s=`to`;break;case 2:s=`via`}N[`${s}NetworkSource`]=r,N[`${s}AssetGroup`]=i,N[`${s}AssetType`]=a,N[`${s}Terminal`]=o?.toJSON()}return N}_getTerminal(e,t){let n=e?.terminalConfigurationId;return(this.terminalConfigurations?.find(e=>e.id===n))?.terminals?.find(e=>e.id===t.terminalId)??null}async _queryRulesTable(e){let{gdbVersion:t,historicMoment:n}=this,r=new w({where:`1=1`,outFields:[`*`],gdbVersion:t,historicMoment:n});return(await l(e,r)).features}_generateDeleteTelecomAssociationPayload(e){return e.map(e=>({globalId:e.globalId??y,associationType:b.toJSON(e.associationType),fromSourceId:e.fromNetworkElement.networkSourceId,fromGlobalId:e.fromNetworkElement.globalId,fromTerminalId:e.fromNetworkElement.terminalId,toSourceId:e.toNetworkElement.networkSourceId,toGlobalId:e.toNetworkElement.globalId,toTerminalId:e.toNetworkElement.terminalId}))}};e([a({readOnly:!0})],T.prototype,`_rulesLayer`,null),e([a({readOnly:!0})],T.prototype,`_telecomSourceSet`,null),e([a({type:[p],json:{origins:{"web-map":{read:{source:`traceConfigurations`},write:{target:`traceConfigurations`}},service:{read:{source:`traceConfigurations`}}},read:!1}})],T.prototype,`sharedNamedTraceConfigurations`,void 0),e([a({type:[`utility`],readOnly:!0,json:{read:!1,write:!1}})],T.prototype,`type`,void 0),e([a({readOnly:!0})],T.prototype,`serviceTerritoryFeatureLayerId`,null),e([a({readOnly:!0})],T.prototype,`networkSystemLayers`,null),e([a({readOnly:!0})],T.prototype,`terminalConfigurations`,null),e([a({readOnly:!0})],T.prototype,`domainNetworkNames`,null),e([a({readOnly:!0})],T.prototype,`hasTelecomNetwork`,null),e([a({readOnly:!0,json:{read:!1}})],T.prototype,`associationsTable`,null),T=e([o(`esri.networks.UtilityNetwork`)],T);const E=T;export{E as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.139",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.20.8",
|
|
23
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
23
|
+
"@arcgis/toolkit": "5.2.0-next.139",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
|
|
25
|
-
"@esri/calcite-components": "^5.2.0-next.
|
|
25
|
+
"@esri/calcite-components": "^5.2.0-next.89",
|
|
26
26
|
"@vaadin/grid": "~25.3.2",
|
|
27
27
|
"@zip.js/zip.js": "~2.23.0",
|
|
28
28
|
"luxon": "~3.7.2",
|
|
29
|
-
"marked": "~18.0
|
|
29
|
+
"marked": "~18.1.0",
|
|
30
30
|
"tslib": "^2.8.1"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import type Graphic from "../Graphic.js";
|
|
2
2
|
import type EsriMap from "../Map.js";
|
|
3
3
|
import type Accessor from "../core/Accessor.js";
|
|
4
|
+
import type Collection from "../core/Collection.js";
|
|
4
5
|
import type Point from "../geometry/Point.js";
|
|
5
6
|
import type SpatialReference from "../geometry/SpatialReference.js";
|
|
6
7
|
import type FeatureAbilities from "./support/FeatureAbilities.js";
|
|
7
8
|
import type { IdentifiableMixin, IdentifiableMixinProperties } from "../core/Identifiable.js";
|
|
8
9
|
import type { SpatialReferenceProperties } from "../geometry/SpatialReference.js";
|
|
9
|
-
import type { FeatureFormattedAttributes, LastEditInfo, PopupTemplateContentResolved, RelatedInfo, State } from "./types.js";
|
|
10
|
+
import type { FeatureFormattedAttributes, LastEditInfo, PopupAction, PopupTemplateContentResolved, RelatedInfo, State } from "./types.js";
|
|
10
11
|
import type { TimeZone } from "../time/types.js";
|
|
11
12
|
import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js";
|
|
12
13
|
import type { FeatureAbilitiesProperties } from "./support/FeatureAbilities.js";
|
|
14
|
+
import type { ActionToggleProperties } from "../support/actions/ActionToggle.js";
|
|
15
|
+
import type { ActionButtonProperties } from "../support/actions/ActionButton.js";
|
|
16
|
+
import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
|
|
13
17
|
import type { GraphicProperties } from "../Graphic.js";
|
|
14
18
|
import type { PointProperties } from "../geometry/Point.js";
|
|
15
19
|
|
|
16
|
-
export interface FeatureContentProperties extends IdentifiableMixinProperties, Partial<Pick<FeatureContent, "defaultPopupTemplateEnabled" | "map" | "view">> {
|
|
20
|
+
export interface FeatureContentProperties extends IdentifiableMixinProperties, Partial<Pick<FeatureContent, "defaultPopupTemplateEnabled" | "includeDefaultActions" | "map" | "view">> {
|
|
17
21
|
/** Defines the specific [FeatureAbilities](https://developers.arcgis.com/javascript/latest/references/core/popup/support/FeatureAbilities/) that should be used when querying and displaying content. */
|
|
18
22
|
abilities?: FeatureAbilitiesProperties;
|
|
23
|
+
/** A collection of custom actions to include with the feature's popup actions. */
|
|
24
|
+
actions?: ReadonlyArrayOrCollection<((ActionButtonProperties & { type: "button" }) | (ActionToggleProperties & { type: "toggle" }))>;
|
|
19
25
|
/**
|
|
20
26
|
* The [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) used to represent the feature.
|
|
21
27
|
*
|
|
@@ -94,8 +100,18 @@ export default class FeatureContent extends FeatureContentSuperclass {
|
|
|
94
100
|
/** Defines the specific [FeatureAbilities](https://developers.arcgis.com/javascript/latest/references/core/popup/support/FeatureAbilities/) that should be used when querying and displaying content. */
|
|
95
101
|
get abilities(): FeatureAbilities;
|
|
96
102
|
set abilities(value: FeatureAbilitiesProperties);
|
|
103
|
+
/** A collection of custom actions to include with the feature's popup actions. */
|
|
104
|
+
get actions(): Collection<PopupAction>;
|
|
105
|
+
set actions(value: ReadonlyArrayOrCollection<((ActionButtonProperties & { type: "button" }) | (ActionToggleProperties & { type: "toggle" }))>);
|
|
106
|
+
/** A collection of the actions available for the feature. */
|
|
107
|
+
get allActions(): Collection<PopupAction>;
|
|
97
108
|
/** The [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/#content) of the feature. */
|
|
98
109
|
get content(): PopupContent | null | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* A read-only property that specifies the [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) of default action [buttons](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionButton/) and/or [toggles](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionToggle/).
|
|
112
|
+
* By default, there is a "Zoom to" action that allows users to zoom to the selected feature.
|
|
113
|
+
*/
|
|
114
|
+
get defaultActions(): Collection<PopupAction>;
|
|
99
115
|
/**
|
|
100
116
|
* Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined. Automatic popup templates are supported for layers that support the `createPopupTemplate` method. Supported for [BuildingComponentSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/buildingSublayers/BuildingComponentSublayer/), [CatalogFootprintLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/), [CSVLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/), [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/), [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/), [ImageryLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryLayer/)), [ImageryTileLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryTileLayer/), [KnowledgeGraphSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/knowledgeGraph/KnowledgeGraphSublayer/), [OGCFeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/OGCFeatureLayer/), [ParquetLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/), [PointCloudLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/PointCloudLayer/), [SceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/), [StreamLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/StreamLayer/), [Sublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Sublayer/), [SubtypeSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/SubtypeSublayer/), [VoxelLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/VoxelLayer/), [WCSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WCSLayer/), and [WFSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer/).
|
|
101
117
|
*
|
|
@@ -144,6 +160,12 @@ export default class FeatureContent extends FeatureContentSuperclass {
|
|
|
144
160
|
* @default ""
|
|
145
161
|
*/
|
|
146
162
|
get heading(): string;
|
|
163
|
+
/**
|
|
164
|
+
* Indicates whether to include the default actions.
|
|
165
|
+
*
|
|
166
|
+
* @default false
|
|
167
|
+
*/
|
|
168
|
+
accessor includeDefaultActions: boolean;
|
|
147
169
|
/** Indicates whether the current [graphic](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContent/#graphic) resides in a non-spatial table. */
|
|
148
170
|
get isFeatureFromTable(): boolean;
|
|
149
171
|
/** A read-only property containing metadata regarding the last edit performed on a feature. */
|
package/popup/FeatureContent.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{FeatureSetQueryInterceptor as n}from"../arcade/featureset/support/FeatureSetQueryInterceptor.js";import r from"../core/Accessor.js";import{isSome as i}from"../core/arrayUtils.js";import{createTask as a}from"../core/asyncUtils.js";import{IdentifiableMixin as o}from"../core/Identifiable.js";import s from"../core/Logger.js";import{abortMaybe as c}from"../core/maybe.js";import{eachAlways as l,isAbortError as u,throwIfAborted as d}from"../core/promiseUtils.js";import{watch as f,initial as p,when as m}from"../core/reactiveUtils.js";import{throttle as h}from"../core/throttle.js";import{property as g,subclass as _}from"../core/accessorSupport/decorators.js";import v from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import b from"./content/TextContent.js";import{compileExpressionInfos as x,formatArcadeValue as S}from"./support/arcadeFeatureUtils.js";import C from"./support/FeatureAbilities.js";import{preLayerQueryCallback as w,preRequestCallback as T,getPopupLayer as E,createFieldInfoMap as D,getAllFieldInfos as O,querySourceLayer as k,queryUpdatedFeature as A,isRelatableFeatureSupportedLayer as j,isAssociatedFeatureSupportedLayer as M,formatEditInfo as N,substituteFieldsInLinksAndAttributes as P,graphicCallback as F,formatAttributes as I,isRelatedField as L}from"./support/featureUtils.js";import{queryLayerInfos as R,queryRelatedFeatures as z,setRelatedFeatures as B,getRelatedFieldInfo as V,createRelatedInfo as H,updateRelatedInfo as U}from"./support/relatedFeatureUtils.js";import{system as W}from"../time/constants.js";var G;let K=class extends o(r){static{G=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._graphicExpressionAttributes=null,this.abilities=new C,this.content=null,this.description=null,this.defaultPopupTemplateEnabled=!1,this.expressionAttributes=null,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.heading=``,this.view=null,this._graphicChangedThrottled=h(this._graphicChanged,()=>this.notifyChange(`waitingForContent`),1,this),this._isAllowedContentType=e=>{let{abilities:t}=this;return e.type===`attachments`&&!!t.attachmentsContent||e.type===`custom`&&!!t.customContent||e.type===`fields`&&!!t.fieldsContent||e.type===`media`&&!!t.mediaContent||e.type===`text`&&!!t.textContent||e.type===`expression`&&!!t.expressionContent||e.type===`relationship`&&!!t.relationshipContent||e.type===`utility-network-associations`&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=h(this._evaluateExpressionAttributes,()=>this.notifyChange(`waitingForContent`),1,this),this.addHandles([f(()=>[this._effectivePopupTemplate,this.abilities.attachmentsContent,this.abilities.chartAnimation,this.abilities.customContent,this.abilities.expressionContent,this.abilities.fieldsContent,this.abilities.mediaContent,this.abilities.relationshipContent,this.abilities.textContent,this.abilities.utilityNetworkAssociationsContent,this.graphic,this.timeZone],()=>this._graphicChangedThrottled(),p),m(()=>{if(!this._graphicChangedTask?.finished||this._graphicChangedTask.value==null)return null;let e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has(`view-scale`)?this.view?.scale:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.start:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=c(this._graphicChangedTask),this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this.relatedInfos.clear()}static{this.interceptor=new n(w,T)}get _effectivePopupTemplate(){return this.graphic?.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled)??null}get _fieldInfoMap(){let e=E(this.graphic);return D(O(this._effectivePopupTemplate),e)}get isFeatureFromTable(){return E(this.graphic)?.isTable??!1}get state(){return this.graphic?this._error?`error`:this.waitingForContent?`loading`:`ready`:`disabled`}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get timeZone(){return this.view?.timeZone??W}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get map(){return this.view?.map||null}set map(e){this._override(`map`,e)}get waitingForContent(){let{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:n,_evaluateExpressionAttributesTask:r}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||n!=null&&!n.finished||r!=null&&!r.finished}async updateGeometry(){let{graphic:e,spatialReference:t}=this,n=E(e);await n?.load();let r=n?.objectIdField;if(!r||!e)return;let i=e.attributes?.[r];if(i==null)return;let a=(await k({layer:n,graphic:e,outFields:[],objectIds:[i],returnGeometry:!0,spatialReference:t}))?.geometry;a&&(e.geometry=a)}_clear(){this._set(`heading`,``),this._set(`content`,null),this._set(`formattedAttributes`,null),this._set(`expressionAttributes`,null)}_graphicChanged(){this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._graphicChangedTask=c(this._graphicChangedTask),this._graphicChangedTask=a(async e=>{this._error=null,this._clear();let{graphic:t}=this;try{if(!t)return null;let{_effectivePopupTemplate:n}=this,r=E(t),i=this.spatialReference;await A({graphic:t,popupTemplate:n,layer:r,spatialReference:i},{signal:e});let[{value:a},{value:o}]=await l([this._getContent(),this._getTitle()]),[,{value:s}]=await l([this._checkForRelatedFeatures({signal:e}),x(n?.expressionInfos,t)]);return{expressionInfos:s,content:a,heading:o}}catch(e){throw u(e)||(this._error=e,s.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:e,graphic:t,popupTemplate:this._effectivePopupTemplate})),e}})}_compileContentElement(e){let t=E(this.graphic);return e.type===`relationship`?j(t)?e:void 0:e.type===`utility-network-associations`?M(t)?e:void 0:e}_compileContent(e){if(this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map(e=>this._compileContentElement(e)).filter(i):typeof e==`string`?new b({text:e}).text:e}_compileLastEditInfo(){let{_effectivePopupTemplate:e,graphic:t,timeZone:n}=this,r=E(t);if(!e)return;let{lastEditInfoEnabled:i}=e,a=r?.editFieldsInfo;if(i&&a)return N(a,t?.attributes,n,r)}_compileHeading(e){let{_fieldInfoMap:t,graphic:n,expressionAttributes:r}=this,i=E(n),a=n?.attributes??{},o=this.formattedAttributes?.global??{};return P({attributes:a,fieldInfoMap:t,globalAttributes:o,expressionAttributes:r,layer:i,text:e})}async _getTitle(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?F({type:`title`,value:e?.title,event:{graphic:t}}):null}async _getContent(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?F({type:`content`,value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({heading:e,content:t,expressionInfos:n}){this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=a(async r=>{let{graphic:i,map:a,view:o,spatialReference:c,location:l}=this;try{if(!i)return;let s;if(n!=null){let e=[];for(let[t,s]of n.expressions.entries())s==null?e.push(Promise.resolve([t,void 0])):e.push(s.evaluate({graphic:i,interceptor:G.interceptor,location:l,map:a,options:{signal:r},spatialReference:c,view:o}).then(e=>[t,typeof e==`string`?S(e):e]).catch(()=>[t,void 0]));s=Object.fromEntries(await Promise.all(e)),d(r)}this._set(`expressionAttributes`,s??null),this._graphicExpressionAttributes={...i.attributes,...s},this._set(`formattedAttributes`,this._createFormattedAttributes(t)),this._set(`heading`,this._compileHeading(e)),this._set(`lastEditInfo`,this._compileLastEditInfo()||null),this._set(`content`,this._compileContent(t)||null)}catch(e){u(e)||(this._error=e,s.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:e,graphic:i,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){let{_effectivePopupTemplate:r,graphic:i,relatedInfos:a,_fieldInfoMap:o,_graphicExpressionAttributes:s,timeZone:c}=this,l=E(i);n.content[t]=I({attributes:{...s,...e.attributes},fieldInfoMap:o,fieldInfos:r?.fieldInfos,graphic:i,layer:l,relatedInfos:a,timeZone:c})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){if(e.fieldInfos){let{graphic:r,relatedInfos:i,_fieldInfoMap:a,_graphicExpressionAttributes:o,timeZone:s}=this,c=E(r);n.content[t]=I({attributes:{...o,...e.attributes},fieldInfoMap:a,fieldInfos:e.fieldInfos,graphic:r,isContentFieldInfos:!0,layer:c,relatedInfos:i,timeZone:s})}}_createFormattedAttributes(e){let{_effectivePopupTemplate:t,graphic:n,relatedInfos:r,_fieldInfoMap:i,_graphicExpressionAttributes:a,timeZone:o}=this,s=E(n),c=t?.fieldInfos,l={global:I({attributes:a,fieldInfoMap:i,fieldInfos:c,graphic:n,layer:s,relatedInfos:r,timeZone:o}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{e.type===`fields`&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l}),e.type===`media`&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l})}),l}_checkForRelatedFeatures(e){let{graphic:t,_effectivePopupTemplate:n}=this;return this._queryRelatedInfos(t,O(n),e)}async _queryRelatedInfos(e,t,n){let{relatedInfos:r}=this,i=E(e);r.clear();let a=await i?.associatedLayer?.load(n)??i;if(!a||!e||!t.filter(e=>!!e.fieldName&&L(e.fieldName))?.length)return;t.forEach(e=>this._configureRelatedInfo(e,a));let o=await R({relatedInfos:r,layer:a},n);Object.keys(o).forEach(e=>{let t=r.get(e.toString()),n=o[e]?.value;t&&n&&(t.layerInfo=n.data)});let s=await z({graphic:e,relatedInfos:r,layer:a},n);Object.keys(s).forEach(e=>{B(s[e]?.value,r.get(e.toString()))})}_configureRelatedInfo(e,t){let{relatedInfos:n}=this,r=V(e.fieldName||``);if(!r)return;let{layerId:i,fieldName:a}=r;if(!i)return;let o=n.get(i.toString())||H(i,t);o&&(U({relatedInfo:o,fieldName:a,fieldInfo:e}),this.relatedInfos.set(i,o))}};e([g()],K.prototype,`_error`,void 0),e([g()],K.prototype,`_graphicChangedTask`,void 0),e([g()],K.prototype,`_evaluateExpressionAttributesTask`,void 0),e([g({readOnly:!0})],K.prototype,`_effectivePopupTemplate`,null),e([g({readOnly:!0})],K.prototype,`_fieldInfoMap`,null),e([g({type:C})],K.prototype,`abilities`,void 0),e([g({readOnly:!0})],K.prototype,`content`,void 0),e([g()],K.prototype,`description`,void 0),e([g({type:Boolean})],K.prototype,`defaultPopupTemplateEnabled`,void 0),e([g({readOnly:!0})],K.prototype,`expressionAttributes`,void 0),e([g({readOnly:!0})],K.prototype,`isFeatureFromTable`,null),e([g({readOnly:!0})],K.prototype,`state`,null),e([g({readOnly:!0})],K.prototype,`formattedAttributes`,void 0),e([g({type:t})],K.prototype,`graphic`,void 0),e([g({readOnly:!0})],K.prototype,`lastEditInfo`,void 0),e([g({type:v})],K.prototype,`location`,void 0),e([g({readOnly:!0})],K.prototype,`relatedInfos`,void 0),e([g({type:y})],K.prototype,`spatialReference`,null),e([g()],K.prototype,`timeZone`,null),e([g({readOnly:!0})],K.prototype,`heading`,void 0),e([g()],K.prototype,`map`,null),e([g({readOnly:!0})],K.prototype,`waitingForContent`,null),e([g()],K.prototype,`view`,void 0),K=G=e([_(`esri.popup.FeatureContent`)],K);const q=K;export{q as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{FeatureSetQueryInterceptor as n}from"../arcade/featureset/support/FeatureSetQueryInterceptor.js";import r from"../core/Accessor.js";import{isSome as i}from"../core/arrayUtils.js";import{createTask as a}from"../core/asyncUtils.js";import{IdentifiableMixin as o}from"../core/Identifiable.js";import s from"../core/Logger.js";import{abortMaybe as c}from"../core/maybe.js";import{eachAlways as l,isAbortError as u,throwIfAborted as d}from"../core/promiseUtils.js";import{watch as f,initial as p,when as m}from"../core/reactiveUtils.js";import{throttle as h}from"../core/throttle.js";import{property as g,subclass as _}from"../core/accessorSupport/decorators.js";import v from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import{ActionsCollection as b,createDefaultAggregateActions as x,createDefaultActions as S}from"./actions.js";import C from"./content/TextContent.js";import{compileExpressionInfos as w,formatArcadeValue as T}from"./support/arcadeFeatureUtils.js";import E from"./support/FeatureAbilities.js";import{preLayerQueryCallback as D,preRequestCallback as O,getPopupLayer as k,createFieldInfoMap as A,getAllFieldInfos as j,querySourceLayer as M,queryUpdatedFeature as N,isRelatableFeatureSupportedLayer as P,isAssociatedFeatureSupportedLayer as F,formatEditInfo as I,substituteFieldsInLinksAndAttributes as L,graphicCallback as R,formatAttributes as z,isRelatedField as B}from"./support/featureUtils.js";import{queryLayerInfos as V,queryRelatedFeatures as H,setRelatedFeatures as U,getRelatedFieldInfo as W,createRelatedInfo as G,updateRelatedInfo as K}from"./support/relatedFeatureUtils.js";import{system as q}from"../time/constants.js";var J;let Y=class extends o(r){static{J=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._graphicExpressionAttributes=null,this.abilities=new E,this.content=null,this.description=null,this.actions=new b,this.includeDefaultActions=!1,this.defaultPopupTemplateEnabled=!1,this.expressionAttributes=null,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.heading=``,this.view=null,this._graphicChangedThrottled=h(this._graphicChanged,()=>this.notifyChange(`waitingForContent`),1,this),this._isAllowedContentType=e=>{let{abilities:t}=this;return e.type===`attachments`&&!!t.attachmentsContent||e.type===`custom`&&!!t.customContent||e.type===`fields`&&!!t.fieldsContent||e.type===`media`&&!!t.mediaContent||e.type===`text`&&!!t.textContent||e.type===`expression`&&!!t.expressionContent||e.type===`relationship`&&!!t.relationshipContent||e.type===`utility-network-associations`&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=h(this._evaluateExpressionAttributes,()=>this.notifyChange(`waitingForContent`),1,this),this.addHandles([f(()=>[this._effectivePopupTemplate,this.abilities.attachmentsContent,this.abilities.chartAnimation,this.abilities.customContent,this.abilities.expressionContent,this.abilities.fieldsContent,this.abilities.mediaContent,this.abilities.relationshipContent,this.abilities.textContent,this.abilities.utilityNetworkAssociationsContent,this.graphic,this.timeZone],()=>this._graphicChangedThrottled(),p),m(()=>{if(!this._graphicChangedTask?.finished||this._graphicChangedTask.value==null)return null;let e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has(`view-scale`)?this.view?.scale:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.start:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=c(this._graphicChangedTask),this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this.relatedInfos.clear()}static{this.interceptor=new n(D,O)}get _effectivePopupTemplate(){return this.graphic?.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled)??null}get _fieldInfoMap(){let e=k(this.graphic);return A(j(this._effectivePopupTemplate),e)}get defaultActions(){let e=this._get(`defaultActions`)||new b;return e.removeAll(),e.addMany(this.graphic?.isAggregate?x():S()),e}get allActions(){let e=this._get(`allActions`)||new b,{actions:t,defaultPopupTemplateEnabled:n,includeDefaultActions:r,graphic:a}=this,o=[];if(a){let e=r?this.defaultActions.concat(t):t,s=typeof a.getEffectivePopupTemplate==`function`&&a.getEffectivePopupTemplate(n)||a.popupTemplate,c=s?.actions;o=(s?.overwriteActions?c:c?.concat(e)??e)?.filter(i).toArray()??[]}let s=e.toArray();return(s.length!==o.length||s.some((e,t)=>e!==o[t]))&&(e.removeAll(),e.addMany(o)),e}get isFeatureFromTable(){return k(this.graphic)?.isTable??!1}get state(){return this.graphic?this._error?`error`:this.waitingForContent?`loading`:`ready`:`disabled`}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get timeZone(){return this.view?.timeZone??q}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get map(){return this.view?.map||null}set map(e){this._override(`map`,e)}get waitingForContent(){let{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:n,_evaluateExpressionAttributesTask:r}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||n!=null&&!n.finished||r!=null&&!r.finished}async updateGeometry(){let{graphic:e,spatialReference:t}=this,n=k(e);await n?.load();let r=n?.objectIdField;if(!r||!e)return;let i=e.attributes?.[r];if(i==null)return;let a=(await M({layer:n,graphic:e,outFields:[],objectIds:[i],returnGeometry:!0,spatialReference:t}))?.geometry;a&&(e.geometry=a)}_clear(){this._set(`heading`,``),this._set(`content`,null),this._set(`formattedAttributes`,null),this._set(`expressionAttributes`,null)}_graphicChanged(){this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._graphicChangedTask=c(this._graphicChangedTask),this._graphicChangedTask=a(async e=>{this._error=null,this._clear();let{graphic:t}=this;try{if(!t)return null;let{_effectivePopupTemplate:n}=this,r=k(t),i=this.spatialReference;await N({graphic:t,popupTemplate:n,layer:r,spatialReference:i},{signal:e});let[{value:a},{value:o}]=await l([this._getContent(),this._getTitle()]),[,{value:s}]=await l([this._checkForRelatedFeatures({signal:e}),w(n?.expressionInfos,t)]);return{expressionInfos:s,content:a,heading:o}}catch(e){throw u(e)||(this._error=e,s.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:e,graphic:t,popupTemplate:this._effectivePopupTemplate})),e}})}_compileContentElement(e){let t=k(this.graphic);return e.type===`relationship`?P(t)?e:void 0:e.type===`utility-network-associations`?F(t)?e:void 0:e}_compileContent(e){if(this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map(e=>this._compileContentElement(e)).filter(i):typeof e==`string`?new C({text:e}).text:e}_compileLastEditInfo(){let{_effectivePopupTemplate:e,graphic:t,timeZone:n}=this,r=k(t);if(!e)return;let{lastEditInfoEnabled:i}=e,a=r?.editFieldsInfo;if(i&&a)return I(a,t?.attributes,n,r)}_compileHeading(e){let{_fieldInfoMap:t,graphic:n,expressionAttributes:r}=this,i=k(n),a=n?.attributes??{},o=this.formattedAttributes?.global??{};return L({attributes:a,fieldInfoMap:t,globalAttributes:o,expressionAttributes:r,layer:i,text:e})}async _getTitle(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?R({type:`title`,value:e?.title,event:{graphic:t}}):null}async _getContent(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?R({type:`content`,value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({heading:e,content:t,expressionInfos:n}){this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=a(async r=>{let{graphic:i,map:a,view:o,spatialReference:c,location:l}=this;try{if(!i)return;let s;if(n!=null){let e=[];for(let[t,s]of n.expressions.entries())s==null?e.push(Promise.resolve([t,void 0])):e.push(s.evaluate({graphic:i,interceptor:J.interceptor,location:l,map:a,options:{signal:r},spatialReference:c,view:o}).then(e=>[t,typeof e==`string`?T(e):e]).catch(()=>[t,void 0]));s=Object.fromEntries(await Promise.all(e)),d(r)}this._set(`expressionAttributes`,s??null),this._graphicExpressionAttributes={...i.attributes,...s},this._set(`formattedAttributes`,this._createFormattedAttributes(t)),this._set(`heading`,this._compileHeading(e)),this._set(`lastEditInfo`,this._compileLastEditInfo()||null),this._set(`content`,this._compileContent(t)||null)}catch(e){u(e)||(this._error=e,s.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:e,graphic:i,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){let{_effectivePopupTemplate:r,graphic:i,relatedInfos:a,_fieldInfoMap:o,_graphicExpressionAttributes:s,timeZone:c}=this,l=k(i);n.content[t]=z({attributes:{...s,...e.attributes},fieldInfoMap:o,fieldInfos:r?.fieldInfos,graphic:i,layer:l,relatedInfos:a,timeZone:c})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){if(e.fieldInfos){let{graphic:r,relatedInfos:i,_fieldInfoMap:a,_graphicExpressionAttributes:o,timeZone:s}=this,c=k(r);n.content[t]=z({attributes:{...o,...e.attributes},fieldInfoMap:a,fieldInfos:e.fieldInfos,graphic:r,isContentFieldInfos:!0,layer:c,relatedInfos:i,timeZone:s})}}_createFormattedAttributes(e){let{_effectivePopupTemplate:t,graphic:n,relatedInfos:r,_fieldInfoMap:i,_graphicExpressionAttributes:a,timeZone:o}=this,s=k(n),c=t?.fieldInfos,l={global:z({attributes:a,fieldInfoMap:i,fieldInfos:c,graphic:n,layer:s,relatedInfos:r,timeZone:o}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{e.type===`fields`&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l}),e.type===`media`&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l})}),l}_checkForRelatedFeatures(e){let{graphic:t,_effectivePopupTemplate:n}=this;return this._queryRelatedInfos(t,j(n),e)}async _queryRelatedInfos(e,t,n){let{relatedInfos:r}=this,i=k(e);r.clear();let a=await i?.associatedLayer?.load(n)??i;if(!a||!e||!t.filter(e=>!!e.fieldName&&B(e.fieldName))?.length)return;t.forEach(e=>this._configureRelatedInfo(e,a));let o=await V({relatedInfos:r,layer:a},n);Object.keys(o).forEach(e=>{let t=r.get(e.toString()),n=o[e]?.value;t&&n&&(t.layerInfo=n.data)});let s=await H({graphic:e,relatedInfos:r,layer:a},n);Object.keys(s).forEach(e=>{U(s[e]?.value,r.get(e.toString()))})}_configureRelatedInfo(e,t){let{relatedInfos:n}=this,r=W(e.fieldName||``);if(!r)return;let{layerId:i,fieldName:a}=r;if(!i)return;let o=n.get(i.toString())||G(i,t);o&&(K({relatedInfo:o,fieldName:a,fieldInfo:e}),this.relatedInfos.set(i,o))}};e([g()],Y.prototype,`_error`,void 0),e([g()],Y.prototype,`_graphicChangedTask`,void 0),e([g()],Y.prototype,`_evaluateExpressionAttributesTask`,void 0),e([g({readOnly:!0})],Y.prototype,`_effectivePopupTemplate`,null),e([g({readOnly:!0})],Y.prototype,`_fieldInfoMap`,null),e([g({type:E})],Y.prototype,`abilities`,void 0),e([g({readOnly:!0})],Y.prototype,`content`,void 0),e([g()],Y.prototype,`description`,void 0),e([g({type:b,readOnly:!0})],Y.prototype,`defaultActions`,null),e([g({type:b})],Y.prototype,`actions`,void 0),e([g()],Y.prototype,`includeDefaultActions`,void 0),e([g({type:b,readOnly:!0})],Y.prototype,`allActions`,null),e([g({type:Boolean})],Y.prototype,`defaultPopupTemplateEnabled`,void 0),e([g({readOnly:!0})],Y.prototype,`expressionAttributes`,void 0),e([g({readOnly:!0})],Y.prototype,`isFeatureFromTable`,null),e([g({readOnly:!0})],Y.prototype,`state`,null),e([g({readOnly:!0})],Y.prototype,`formattedAttributes`,void 0),e([g({type:t})],Y.prototype,`graphic`,void 0),e([g({readOnly:!0})],Y.prototype,`lastEditInfo`,void 0),e([g({type:v})],Y.prototype,`location`,void 0),e([g({readOnly:!0})],Y.prototype,`relatedInfos`,void 0),e([g({type:y})],Y.prototype,`spatialReference`,null),e([g()],Y.prototype,`timeZone`,null),e([g({readOnly:!0})],Y.prototype,`heading`,void 0),e([g()],Y.prototype,`map`,null),e([g({readOnly:!0})],Y.prototype,`waitingForContent`,null),e([g()],Y.prototype,`view`,void 0),Y=J=e([_(`esri.popup.FeatureContent`)],Y);const X=Y;export{X as default};
|
|
@@ -31,6 +31,7 @@ export interface FeatureContentCollectionProperties extends GoToProperties, Part
|
|
|
31
31
|
* [PopupTemplate.overwriteActions](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/).
|
|
32
32
|
* The order of each action is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/).
|
|
33
33
|
*
|
|
34
|
+
* @internal
|
|
34
35
|
* @see [Sample - Popup actions](https://developers.arcgis.com/javascript/latest/sample-code/popup-actions/)
|
|
35
36
|
* @example
|
|
36
37
|
* ```js
|
|
@@ -110,6 +111,7 @@ export default class FeatureContentCollection extends FeatureContentCollectionSu
|
|
|
110
111
|
* [PopupTemplate.overwriteActions](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/).
|
|
111
112
|
* The order of each action is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/).
|
|
112
113
|
*
|
|
114
|
+
* @internal
|
|
113
115
|
* @see [Sample - Popup actions](https://developers.arcgis.com/javascript/latest/sample-code/popup-actions/)
|
|
114
116
|
* @example
|
|
115
117
|
* ```js
|
|
@@ -143,8 +145,6 @@ export default class FeatureContentCollection extends FeatureContentCollectionSu
|
|
|
143
145
|
* @default false
|
|
144
146
|
*/
|
|
145
147
|
accessor aggregatedFeaturesEnabled: boolean;
|
|
146
|
-
/** A collection of all the [action buttons](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionButton/) or [action toggles](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionToggle/). */
|
|
147
|
-
get allActions(): Collection<PopupAction>;
|
|
148
148
|
/**
|
|
149
149
|
* The information to display. When this property is set, this content may
|
|
150
150
|
* only be static and cannot use fields to set content templates. To set a template
|
|
@@ -159,14 +159,7 @@ export default class FeatureContentCollection extends FeatureContentCollectionSu
|
|
|
159
159
|
* ```
|
|
160
160
|
*/
|
|
161
161
|
accessor content: string | HTMLElement | null | undefined;
|
|
162
|
-
/**
|
|
163
|
-
* A read-only property that specifies a [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) of action [buttons](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionButton/) and/or [toggles](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionToggle/).
|
|
164
|
-
* By default, there is a "Zoom to" action that allows users to zoom to the selected feature.
|
|
165
|
-
*
|
|
166
|
-
* > [!WARNING]
|
|
167
|
-
* >
|
|
168
|
-
* > In order to disable any default actions, it is necessary to set [includeDefaultActions](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#includeDefaultActions) to `false`.
|
|
169
|
-
*/
|
|
162
|
+
/** The default actions for the selected feature, or the default zoom action when no feature is selected. */
|
|
170
163
|
get defaultActions(): Collection<PopupAction>;
|
|
171
164
|
/**
|
|
172
165
|
* Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined. Automatic popup templates are supported for layers that support the `createPopupTemplate` method. Supported for [BuildingComponentSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/buildingSublayers/BuildingComponentSublayer/), [CatalogFootprintLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/), [CSVLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/), [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/), [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/), [ImageryLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryLayer/)), [ImageryTileLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryTileLayer/), [KnowledgeGraphSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/knowledgeGraph/KnowledgeGraphSublayer/), [OGCFeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/OGCFeatureLayer/), [ParquetLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/), [PointCloudLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/PointCloudLayer/), [SceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/), [StreamLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/StreamLayer/), [Sublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Sublayer/), [SubtypeSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/SubtypeSublayer/), [VoxelLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/VoxelLayer/), [WCSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WCSLayer/), and [WFSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer/).
|
|
@@ -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 n from"../core/Error.js";import{EventedAccessor as r}from"../core/Evented.js";import i from"../core/Logger.js";import{abortMaybe as a}from"../core/maybe.js";import{debounce as o,logOnError as s,isAbortError as c}from"../core/promiseUtils.js";import{watch as l,when as u}from"../core/reactiveUtils.js";import{property as d,subclass as f}from"../core/accessorSupport/decorators.js";import p from"../geometry/Point.js";import{project as m}from"../geometry/projectionUtils.js";import h from"../geometry/SpatialReference.js";import{geographicToWebMercator as g}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as _}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as v}from"../layers/LayerConstants.js";import{ActionsCollection as y,zoomToAggregatedFeatures as b,browseAggregatedFeatures as x,zoomToFeature as S}from"./actions.js";import{getSelectedTarget as C}from"./actionUtils.js";import w from"./FeatureContent.js";import T from"./support/FeatureAbilities.js";import{getDisplayedSymbol as E}from"../symbols/support/symbolUtils.js";import{system as D}from"../time/constants.js";import{highlightsSupported as O}from"../views/support/layerViewUtils.js";import{GoTo as k}from"../widgets/support/GoTo.js";const A=()=>[S.clone()],j=()=>[b.clone(),x.clone()];let M=null;function N(e,t){switch(e){case`building-scene`:case`map-image`:case`tile`:case`imagery`:return!0;case`imagery-tile`:return t===`2d`;default:return!1}}let P=class extends k(r){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new T,this._activeFeatureStream=null,this._featureStreamHasYielded=!1,this.actions=new y,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=o(async()=>{this._cancelLocationUpdate();let e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([l(()=>this.view?.scale,()=>{this.open&&s(this._debouncedLocationUpdate(),i.getLogger(this))}),l(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),l(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),l(()=>this.location,e=>this._locationChange(e)),l(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),l(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),l(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),l(()=>this.featureItems,()=>this._featureItemsChange()),l(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),u(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){let e=this._get(`allActions`)||new y;e.removeAll();let{actions:n,defaultActions:r,defaultPopupTemplateEnabled:i,includeDefaultActions:a,selectedFeature:o}=this,s=a?r.concat(n):n,c=o&&(typeof o.getEffectivePopupTemplate==`function`&&o.getEffectivePopupTemplate(i)||o.popupTemplate),l=c?.actions;return(c?.overwriteActions?l:l?.concat(s)??s)?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.featureStream=null,this._set(`diagnostics`,null),this.features=[],this._set(`content`,e)}get defaultActions(){let e=this._get(`defaultActions`)||new y;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?j():A()),e}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}set features(e){if(this._get(`features`)===e)return;let t=e||[];this._set(`features`,t),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get(`featureStream`)||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,n){this._set(`diagnostics`,n??null),this._get(`featureStream`)!==e&&(this._set(`featureStream`,e),this._cancelFeatureStream(),e&&(this._featureStreamHasYielded=!1,this._set(`pendingLocation`,t??null),this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionEnabled?`list`:`feature`)}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?g(e):e;this._set(`location`,t)}get map(){return this.view?.map??null}set map(e){this._override(`map`,e)}get pendingLocation(){return this._get(`pendingLocation`)??null}get streamingFeatures(){return this._activeFeatureStream!=null}get selectedFeature(){return this.selectedFeatureIndex===-1?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){let e=this._get(`selectedFeatureIndex`);return typeof e==`number`?e:-1}set selectedFeatureIndex(e){let{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set(`selectedFeatureIndex`,e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get state(){return this.view?this.view.ready?`ready`:`disabled`:this.map?`ready`:`disabled`}get timeZone(){return this.view?.timeZone??D}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&!this._featureStreamHasYielded}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set(`diagnostics`,null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,t){let{view:r}=this;if(!r||!e)throw new n(`fetch-features:invalid-screenpoint-or-view`,`Cannot fetch features without a screen point/screen area and view.`,{screenPoint:e,view:r});let i={},a=r.fetchPopupFeatures(e,{diagnostics:i,pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal});this._setFeatureStream(a,void 0,i)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){let{selectedFeatureIndex:t}=this,n=this._activeFeatureStream!=null&&e.length>0;if(this.initialDisplayMode===`list`){n||(this.selectedFeatureIndex=-1);return}if(n&&t===-1){this.selectedFeatureIndex=0;return}n&&t!==-1||(this.selectedFeatureIndex=e.length?0:-1)}_centerAtLocation(){let{view:e}=this,t=C(this);this._cancelCenterAtLocation();let r=new AbortController,{signal:a}=r;return this._centerAtLocationController=r,!t||!e?Promise.reject(new n(`center-at-location:invalid-target-or-view`,`Cannot center at a location without a target and view.`,{target:t,view:e})):this.callGoTo({target:{target:t,scale:e.scale},options:{signal:a}}).catch(e=>{c(e)||i.getLogger(this).error(e)})}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){let{selectedFeature:t,updateLocationEnabled:n,view:r}=this;r&&!this._locationUpdateController&&n&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){this.selectedFeatureIndex!==-1&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){let{features:e,featureCount:t,featurePage:n,featuresPerPage:r,featureItems:i}=this;if(n==null)return;let a=((n-1)*r+t)%t,o=Math.min(a+r,i.length);for(let t=a;t<o;t++){let n=i[t];n&&(n.graphic??=e[t])}}async _selectedFeatureChange(e){let{location:t,updateLocationEnabled:n,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;let i=_(e)?.type;if((i===`map-image`||i===`imagery`||i===`imagery-tile`)&&(e.symbol=await E(e)),(n||!t)&&e.geometry){if(e.geometry.type===`point`){this.location=e.geometry;return}let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);this.location=t(e.geometry);return}if(n&&!e.geometry){await this._centerAtLocation();let e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set(`featureItems`,[])}_updateFeatureItems(){let e=this.selectedFeature,t=this.features,n=this.featureItems,r=this.view,i=this.spatialReference,a=this.map,o=this.timeZone,s=this.location,c=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length){this._destroyFeatureItems();return}let l=[],u=new Map,d=new Set;n.forEach(e=>{let t=e?.graphic;e&&t&&u.set(t,e)}),t.forEach((t,f)=>{if(!t)return;let p=n[f];if(p&&!d.has(p)&&(p.graphic==null||p.graphic===t)){p.abilities=c,l[f]=p,d.add(p);return}let m=u.get(t);if(m&&!d.has(m)){m.abilities=c,l[f]=m,d.add(m);return}let h=new w({abilities:c,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:i,graphic:t===e?t:null,location:s,map:a,view:r,timeZone:o});l[f]=h,d.add(h)}),n.forEach(e=>{e&&!d.has(e)&&!e.destroyed&&e.destroy()}),this._set(`featureItems`,l)}_cancelCenterAtLocation(){this._centerAtLocationController=a(this._centerAtLocationController)}_cancelFeatureStream(){let e=this._activeFeatureStream;this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._get(`featureStream`)===e&&this._set(`featureStream`,null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){let{spatialReference:t}=this,n=this.selectedFeature,r=n?.geometry?.type,a=this.location;if(r&&r!==`mesh`&&t&&a&&n){if(r===`point`){let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);if(e?.signal?.aborted||this.selectedFeature!==n||!n.geometry)return;this.location=t(n.geometry);return}try{let r=n.geometry,i=this._getHighlightLayer(n),o=n.getObjectId();if(!i||!this.view)return;if(o!=null){let n=this.view?.allLayerViews.find(e=>e.layer.uid===i.uid);if(!n||!(`queryFeatures`in n))return;let a=n.createQuery();a.outSpatialReference=t,a.objectIds=[o],a.returnGeometry=!0;let{features:s}=await n.queryFeatures(a,e);if(e?.signal?.aborted)return;r=s[0]?.geometry}if(!r||r.type===`mesh`)return;r=m(r,t),M??=await Promise.all([import(`../geometry/operators/intersectsOperator.js`),import(`../geometry/operators/proximityOperator.js`)]);let[{intersectsExecute:s},{proximityGetNearestCoordinate:c}]=M;if(!s(r,a)){let e=c(r,a).coordinate??a;this.selectedFeature===n&&(this.location=e)}}catch(e){c(e)||i.getLogger(this).error(e)}}}_cancelLocationUpdate(){this._locationUpdateController=a(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){let t=_(e),{layer:n}=e;return t&&`layer`in t&&t.layer?t.layer:t?.type===`map-notes`||t?.type===`sketch`||t?.type===`subtype-group`?t:n??t}_getHighlightLayerView(e,t){return t.type===`subtype-sublayer`&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,n){if(N(t.type,n))return e;let r=e.getObjectId();if(r!=null)return r;let i=t.type===`imagery`?void 0:`objectIdField`in t?t.objectIdField||v:null,a=e.attributes;return a&&i&&a[i]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);let n=this[t];if(!n)return;let{highlightEnabled:r,view:i,open:a}=this;if(!i||!r||!a)return;let o=this._getHighlightLayer(n);if(!o)return;let s=this._getHighlightLayerView(i,o);if(!s)return;this._highlightPromises[e]=s;let c=await s;if(!c||!O(c)||this._highlightPromises[e]!==s||!this[t]||!this.highlightEnabled)return;let l=c.highlight(this._getHighlightTarget(n,o,i.type));this.addHandles(l,e)}async _highlightActiveFeature(){return this._highlightFeature(`highlight-active-feature`,`activeFeature`)}async _highlightSelectedFeature(){return this._highlightFeature(`highlight-selected-feature`,`selectedFeature`)}async _consumeFeatureStream(e,t){try{for await(let n of e){if(e!==this._activeFeatureStream)return;let r=!this._featureStreamHasYielded;r&&(this.features=[]),t!==void 0&&(this.location=t,t=void 0),this._set(`pendingLocation`,null),this._addFeature(n),r&&(this._featureStreamHasYielded=!0)}}finally{this._activeFeatureStream===e&&(this._featureStreamHasYielded||(this.features=[]),this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._waitingForResultChange())}}_addFeature(e){let{features:t}=this;t.includes(e)||(this.features=t.concat(e))}};e([d()],P.prototype,`_initialDisplayMode`,void 0),e([d()],P.prototype,`_activeFeatureStream`,void 0),e([d()],P.prototype,`_featureStreamHasYielded`,void 0),e([d({type:y})],P.prototype,`actions`,void 0),e([d({readOnly:!0})],P.prototype,`active`,null),e([d()],P.prototype,`activeFeature`,void 0),e([d({readOnly:!0})],P.prototype,`allActions`,null),e([d()],P.prototype,`aggregatedFeaturesEnabled`,void 0),e([d({value:null})],P.prototype,`content`,null),e([d({type:y,readOnly:!0})],P.prototype,`defaultActions`,null),e([d({type:Boolean})],P.prototype,`defaultPopupTemplateEnabled`,void 0),e([d({readOnly:!0})],P.prototype,`diagnostics`,void 0),e([d({readOnly:!0})],P.prototype,`effectiveHeading`,null),e([d({readOnly:!0})],P.prototype,`featureCount`,null),e([d()],P.prototype,`featurePage`,void 0),e([d({value:[]})],P.prototype,`features`,null),e([d()],P.prototype,`featureStream`,null),e([d()],P.prototype,`featuresPerPage`,void 0),e([d()],P.prototype,`featureMenuOpen`,void 0),e([d({type:T})],P.prototype,`featureItemAbilities`,void 0),e([d({readOnly:!0})],P.prototype,`featureItems`,void 0),e([d()],P.prototype,`heading`,void 0),e([d()],P.prototype,`highlightEnabled`,void 0),e([d()],P.prototype,`includeDefaultActions`,void 0),e([d()],P.prototype,`initialDisplayMode`,null),e([d({type:p})],P.prototype,`location`,null),e([d()],P.prototype,`map`,null),e([d()],P.prototype,`open`,void 0),e([d({readOnly:!0})],P.prototype,`pendingLocation`,null),e([d({readOnly:!0})],P.prototype,`streamingFeatures`,null),e([d({value:null,readOnly:!0})],P.prototype,`selectedFeature`,null),e([d({value:-1})],P.prototype,`selectedFeatureIndex`,null),e([d({readOnly:!0})],P.prototype,`selectedFeatureItem`,null),e([d({type:h})],P.prototype,`spatialReference`,null),e([d({readOnly:!0})],P.prototype,`state`,null),e([d()],P.prototype,`timeZone`,null),e([d()],P.prototype,`updateLocationEnabled`,void 0),e([d()],P.prototype,`view`,void 0),e([d({readOnly:!0})],P.prototype,`waitingForContents`,null),e([d({readOnly:!0})],P.prototype,`waitingForResult`,null),e([d()],P.prototype,`zoomFactor`,void 0),P=e([f(`esri.popup.FeatureContentCollection`)],P);const F=P;export{F as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{EventedAccessor as n}from"../core/Evented.js";import r from"../core/Logger.js";import{abortMaybe as i}from"../core/maybe.js";import{debounce as a,logOnError as o,isAbortError as s}from"../core/promiseUtils.js";import{watch as c,when as l}from"../core/reactiveUtils.js";import{property as u,subclass as d}from"../core/accessorSupport/decorators.js";import f from"../geometry/Point.js";import{project as p}from"../geometry/projectionUtils.js";import m from"../geometry/SpatialReference.js";import{geographicToWebMercator as h}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as g}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as _}from"../layers/LayerConstants.js";import{ActionsCollection as v,createDefaultActions as y}from"./actions.js";import{getSelectedTarget as b}from"./actionUtils.js";import x from"./FeatureContent.js";import S from"./support/FeatureAbilities.js";import{getDisplayedSymbol as C}from"../symbols/support/symbolUtils.js";import{system as w}from"../time/constants.js";import{highlightsSupported as T}from"../views/support/layerViewUtils.js";import{GoTo as E}from"../widgets/support/GoTo.js";let D=null;function O(e,t){switch(e){case`building-scene`:case`map-image`:case`tile`:case`imagery`:return!0;case`imagery-tile`:return t===`2d`;default:return!1}}let k=class extends E(n){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new S,this._activeFeatureStream=null,this._featureStreamHasYielded=!1,this.actions=new v,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=a(async()=>{this._cancelLocationUpdate();let e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([c(()=>this.view?.scale,()=>{this.open&&o(this._debouncedLocationUpdate(),r.getLogger(this))}),c(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),c(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),c(()=>this.location,e=>this._locationChange(e)),c(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),c(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),c(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),c(()=>this.featureItems,()=>this._featureItemsChange()),c(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.actions,this.includeDefaultActions,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),l(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get defaultActions(){let e=this._get(`defaultActions`)||new v;return e.removeAll(),e.addMany(this.selectedFeatureItem?.defaultActions.toArray()??y()),e}get active(){return this.open&&!this.waitingForResult}set content(e){this.featureStream=null,this._set(`diagnostics`,null),this.features=[],this._set(`content`,e)}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}set features(e){if(this._get(`features`)===e)return;let t=e||[];this._set(`features`,t),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get(`featureStream`)||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,n){this._set(`diagnostics`,n??null),this._get(`featureStream`)!==e&&(this._set(`featureStream`,e),this._cancelFeatureStream(),e&&(this._featureStreamHasYielded=!1,this._set(`pendingLocation`,t??null),this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionEnabled?`list`:`feature`)}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?h(e):e;this._set(`location`,t)}get map(){return this.view?.map??null}set map(e){this._override(`map`,e)}get pendingLocation(){return this._get(`pendingLocation`)??null}get streamingFeatures(){return this._activeFeatureStream!=null}get selectedFeature(){return this.selectedFeatureIndex===-1?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){let e=this._get(`selectedFeatureIndex`);return typeof e==`number`?e:-1}set selectedFeatureIndex(e){let{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set(`selectedFeatureIndex`,e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get state(){return this.view?this.view.ready?`ready`:`disabled`:this.map?`ready`:`disabled`}get timeZone(){return this.view?.timeZone??w}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&!this._featureStreamHasYielded}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set(`diagnostics`,null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,n){let{view:r}=this;if(!r||!e)throw new t(`fetch-features:invalid-screenpoint-or-view`,`Cannot fetch features without a screen point/screen area and view.`,{screenPoint:e,view:r});let i={},a=r.fetchPopupFeatures(e,{diagnostics:i,pointerType:n?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:n?.signal});this._setFeatureStream(a,void 0,i)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){let{selectedFeatureIndex:t}=this,n=this._activeFeatureStream!=null&&e.length>0;if(this.initialDisplayMode===`list`){n||(this.selectedFeatureIndex=-1);return}if(n&&t===-1){this.selectedFeatureIndex=0;return}n&&t!==-1||(this.selectedFeatureIndex=e.length?0:-1)}_centerAtLocation(){let{view:e}=this,n=b(this);this._cancelCenterAtLocation();let i=new AbortController,{signal:a}=i;return this._centerAtLocationController=i,!n||!e?Promise.reject(new t(`center-at-location:invalid-target-or-view`,`Cannot center at a location without a target and view.`,{target:n,view:e})):this.callGoTo({target:{target:n,scale:e.scale},options:{signal:a}}).catch(e=>{s(e)||r.getLogger(this).error(e)})}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){let{selectedFeature:t,updateLocationEnabled:n,view:r}=this;r&&!this._locationUpdateController&&n&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){this.selectedFeatureIndex!==-1&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){let{features:e,featureCount:t,featurePage:n,featuresPerPage:r,featureItems:i}=this;if(n==null)return;let a=((n-1)*r+t)%t,o=Math.min(a+r,i.length);for(let t=a;t<o;t++){let n=i[t];n&&(n.graphic??=e[t])}}async _selectedFeatureChange(e){let{location:t,updateLocationEnabled:n,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;let i=g(e)?.type;if((i===`map-image`||i===`imagery`||i===`imagery-tile`)&&(e.symbol=await C(e)),(n||!t)&&e.geometry){if(e.geometry.type===`point`){this.location=e.geometry;return}let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);this.location=t(e.geometry);return}if(n&&!e.geometry){await this._centerAtLocation();let e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set(`featureItems`,[])}_updateFeatureItems(){let e=this.selectedFeature,t=this.features,n=this.featureItems,r=this.view,i=this.spatialReference,a=this.map,o=this.timeZone,s=this.location,c=this.actions,l=this.includeDefaultActions,u=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length){this._destroyFeatureItems();return}let d=[],f=new Map,p=new Set;n.forEach(e=>{let t=e?.graphic;e&&t&&f.set(t,e)}),t.forEach((t,m)=>{if(!t)return;let h=n[m];if(h&&!p.has(h)&&(h.graphic==null||h.graphic===t)){h.abilities=u,h.actions=c,h.includeDefaultActions=l,d[m]=h,p.add(h);return}let g=f.get(t);if(g&&!p.has(g)){g.abilities=u,g.actions=c,g.includeDefaultActions=l,d[m]=g,p.add(g);return}let _=new x({actions:c,abilities:u,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,includeDefaultActions:l,spatialReference:i,graphic:t===e?t:null,location:s,map:a,view:r,timeZone:o});d[m]=_,p.add(_)}),n.forEach(e=>{e&&!p.has(e)&&!e.destroyed&&e.destroy()}),this._set(`featureItems`,d)}_cancelCenterAtLocation(){this._centerAtLocationController=i(this._centerAtLocationController)}_cancelFeatureStream(){let e=this._activeFeatureStream;this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._get(`featureStream`)===e&&this._set(`featureStream`,null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){let{spatialReference:t}=this,n=this.selectedFeature,i=n?.geometry?.type,a=this.location;if(i&&i!==`mesh`&&t&&a&&n){if(i===`point`){let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);if(e?.signal?.aborted||this.selectedFeature!==n||!n.geometry)return;this.location=t(n.geometry);return}try{let r=n.geometry,i=this._getHighlightLayer(n),o=n.getObjectId();if(!i||!this.view)return;if(o!=null){let n=this.view?.allLayerViews.find(e=>e.layer.uid===i.uid);if(!n||!(`queryFeatures`in n))return;let a=n.createQuery();a.outSpatialReference=t,a.objectIds=[o],a.returnGeometry=!0;let{features:s}=await n.queryFeatures(a,e);if(e?.signal?.aborted)return;r=s[0]?.geometry}if(!r||r.type===`mesh`)return;r=p(r,t),D??=await Promise.all([import(`../geometry/operators/intersectsOperator.js`),import(`../geometry/operators/proximityOperator.js`)]);let[{intersectsExecute:s},{proximityGetNearestCoordinate:c}]=D;if(!s(r,a)){let e=c(r,a).coordinate??a;this.selectedFeature===n&&(this.location=e)}}catch(e){s(e)||r.getLogger(this).error(e)}}}_cancelLocationUpdate(){this._locationUpdateController=i(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){let t=g(e),{layer:n}=e;return t&&`layer`in t&&t.layer?t.layer:t?.type===`map-notes`||t?.type===`sketch`||t?.type===`subtype-group`?t:n??t}_getHighlightLayerView(e,t){return t.type===`subtype-sublayer`&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,n){if(O(t.type,n))return e;let r=e.getObjectId();if(r!=null)return r;let i=t.type===`imagery`?void 0:`objectIdField`in t?t.objectIdField||_:null,a=e.attributes;return a&&i&&a[i]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);let n=this[t];if(!n)return;let{highlightEnabled:r,view:i,open:a}=this;if(!i||!r||!a)return;let o=this._getHighlightLayer(n);if(!o)return;let s=this._getHighlightLayerView(i,o);if(!s)return;this._highlightPromises[e]=s;let c=await s;if(!c||!T(c)||this._highlightPromises[e]!==s||!this[t]||!this.highlightEnabled)return;let l=c.highlight(this._getHighlightTarget(n,o,i.type));this.addHandles(l,e)}async _highlightActiveFeature(){return this._highlightFeature(`highlight-active-feature`,`activeFeature`)}async _highlightSelectedFeature(){return this._highlightFeature(`highlight-selected-feature`,`selectedFeature`)}async _consumeFeatureStream(e,t){try{for await(let n of e){if(e!==this._activeFeatureStream)return;let r=!this._featureStreamHasYielded;r&&(this.features=[]),t!==void 0&&(this.location=t,t=void 0),this._set(`pendingLocation`,null),this._addFeature(n),r&&(this._featureStreamHasYielded=!0)}}finally{this._activeFeatureStream===e&&(this._featureStreamHasYielded||(this.features=[]),this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._waitingForResultChange())}}_addFeature(e){let{features:t}=this;t.includes(e)||(this.features=t.concat(e))}};e([u()],k.prototype,`_initialDisplayMode`,void 0),e([u()],k.prototype,`_activeFeatureStream`,void 0),e([u()],k.prototype,`_featureStreamHasYielded`,void 0),e([u({type:v})],k.prototype,`actions`,void 0),e([u({type:v,readOnly:!0})],k.prototype,`defaultActions`,null),e([u({readOnly:!0})],k.prototype,`active`,null),e([u()],k.prototype,`activeFeature`,void 0),e([u()],k.prototype,`aggregatedFeaturesEnabled`,void 0),e([u({value:null})],k.prototype,`content`,null),e([u({type:Boolean})],k.prototype,`defaultPopupTemplateEnabled`,void 0),e([u({readOnly:!0})],k.prototype,`diagnostics`,void 0),e([u({readOnly:!0})],k.prototype,`effectiveHeading`,null),e([u({readOnly:!0})],k.prototype,`featureCount`,null),e([u()],k.prototype,`featurePage`,void 0),e([u({value:[]})],k.prototype,`features`,null),e([u()],k.prototype,`featureStream`,null),e([u()],k.prototype,`featuresPerPage`,void 0),e([u()],k.prototype,`featureMenuOpen`,void 0),e([u({type:S})],k.prototype,`featureItemAbilities`,void 0),e([u({readOnly:!0})],k.prototype,`featureItems`,void 0),e([u()],k.prototype,`heading`,void 0),e([u()],k.prototype,`highlightEnabled`,void 0),e([u()],k.prototype,`includeDefaultActions`,void 0),e([u()],k.prototype,`initialDisplayMode`,null),e([u({type:f})],k.prototype,`location`,null),e([u()],k.prototype,`map`,null),e([u()],k.prototype,`open`,void 0),e([u({readOnly:!0})],k.prototype,`pendingLocation`,null),e([u({readOnly:!0})],k.prototype,`streamingFeatures`,null),e([u({value:null,readOnly:!0})],k.prototype,`selectedFeature`,null),e([u({value:-1})],k.prototype,`selectedFeatureIndex`,null),e([u({readOnly:!0})],k.prototype,`selectedFeatureItem`,null),e([u({type:m})],k.prototype,`spatialReference`,null),e([u({readOnly:!0})],k.prototype,`state`,null),e([u()],k.prototype,`timeZone`,null),e([u()],k.prototype,`updateLocationEnabled`,void 0),e([u()],k.prototype,`view`,void 0),e([u({readOnly:!0})],k.prototype,`waitingForContents`,null),e([u({readOnly:!0})],k.prototype,`waitingForResult`,null),e([u()],k.prototype,`zoomFactor`,void 0),k=e([d(`esri.popup.FeatureContentCollection`)],k);const A=k;export{A as default};
|
package/popup/actions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../core/Collection.js";import t from"../support/actions/ActionBase.js";import n from"../support/actions/ActionButton.js";import r from"../support/actions/ActionToggle.js";const i=e.ofType({key:`type`,defaultKeyValue:`button`,base:t,typeMap:{button:n,toggle:r}}),a=new n({icon:`magnifying-glass-plus`,id:`zoom-to-feature`,title:`{messages.zoom}`}),o=new n({icon:`magnifying-glass-plus`,id:`zoom-to-aggregated-features`,title:`{messages.zoom}`}),
|
|
2
|
+
import e from"../core/Collection.js";import t from"../support/actions/ActionBase.js";import n from"../support/actions/ActionButton.js";import r from"../support/actions/ActionToggle.js";const i=e.ofType({key:`type`,defaultKeyValue:`button`,base:t,typeMap:{button:n,toggle:r}}),a=new n({icon:`magnifying-glass-plus`,id:`zoom-to-feature`,title:`{messages.zoom}`}),o=()=>[a.clone()],s=new n({icon:`magnifying-glass-plus`,id:`zoom-to-aggregated-features`,title:`{messages.zoom}`}),c=new n({icon:`list`,id:`browse-aggregated-features`,title:`{messages.browseAggregatedFeatures}`}),l=()=>[s.clone(),c.clone()];export{i as ActionsCollection,c as browseAggregatedFeatures,o as createDefaultActions,l as createDefaultAggregateActions,s as zoomToAggregatedFeatures,a as zoomToFeature};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Logger.js";import{replace as t}from"../../core/string.js";import{getGraphicLayer as n}from"../../graphic/graphicOriginUtils.js";import{formatDate as r,convertDateFormatToIntlOptions as i}from"../../intl/date.js";import{convertNumberFieldFormatToIntlOptions as a,convertNumberFormatToIntlOptions as o,formatNumber as s}from"../../intl/number.js";import{typesHaveUniqueIdsAndNames as c}from"../../layers/support/featureLayerUtils.js";import{fieldFormatFromFieldInfo as l}from"../../layers/support/fieldFormatUtils.js";import{isRasterPixelValueField as u,featureHasFields as d,isTimeOnlyField as f}from"../../layers/support/fieldUtils.js";import{getFieldConfigurationsContainer as p,getEffectiveLayerCapabilities as m}from"../../layers/support/layerUtils.js";import{formatAnyDate as h,isAnyDateField as g}from"../../smartMapping/support/utils.js";import{loadArcade as _}from"../../support/loadArcade.js";import{getTimeZoneFormattingOptions as v}from"../../time/timeZoneUtils.js";const y=()=>e.getLogger(`esri.popup.support.featureUtils`),b=/href=(""|'')/gi,ee=/(\{([^{\r\n]+)\})/g,te=/'/g,x=/^\s*expression\//i,ne=/(\n)/gi,re=/[\u00A0-\u9999<>&]/gim,ie=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,ae=/^(?:mailto:|tel:)/,S=`relationships/`,C=i(`short-date-short-time`);function oe(e){if(e!=null)return(e.sourceLayer||e.layer)??void 0}const se=new Set([`building`,`knowledge-graph`,`link-chart`,`map-image`,`map-notes`,`subtype-group`,`tile`]);function ce(e){let t=e?.origin;return(t==null?void 0:se.has(t.type??``)?t.sublayer:t.layer)??e?.layer}async function le({type:e,value:t,event:n}){try{return typeof t==`function`?t(n):await t}catch(r){y().error(`error`,`An error occurred when calling the "${e}" function`,{error:r,graphic:n.graphic,value:t});return}}function ue(e=``){if(e)return!ae.test(e.trim().toLowerCase())}function w(e){return e?x.test(e):!1}function T(e,t){if(!t||!w(t)||!e)return;let n=t.replace(x,``).toLowerCase();return e.find(({name:e})=>e.toLowerCase()===n)}function E(e){let{fieldInfo:t,graphic:n,layer:r}=e;return de({fieldInfo:t,graphic:n})?p(r,{graphic:n}):null}function de({fieldInfo:e,graphic:t}){return!!e?.fieldName&&!w(e.fieldName)&&!J(e.fieldName)&&!t?.popupTemplate}function fe({expressionInfos:e,fieldInfo:t,graphic:n,isContentFieldInfos:r,layer:i}){if(!t?.fieldName)return null;let a=T(e,t.fieldName);if(a)return a.title||null;let o=E({fieldInfo:t,graphic:n,layer:i});if(o){let e=o.getFieldAlias(t.fieldName);return r?t.label||e||t.fieldName:e||t.fieldName}return t.label||t.fieldName}function D(e){let{configurableFieldsContainer:t,fieldInfo:n,isContentFieldInfos:r}=e;if(!n?.fieldName)return null;let i=!t.popupTemplate&&!t.fieldConfigurations?l(n,t.getField(n.fieldName)):t.getFieldConfiguration(n.fieldName)?.fieldFormat;return r&&n.fieldFormat||i}function pe(e,t){return`{${t.get(e.toLowerCase())?.fieldName||e}}`}function me(e){return e.replaceAll(b,``)}function O(e,t){let n=k(t,e);return n?n.name:e}function he(e,t){return e&&e.map(e=>O(e,t))}function k(e,t){return!(e&&typeof e.getField==`function`)||!t?null:e.getField(t)??null}function A(e){return`${e}`.trim()}function ge({attributes:e,globalAttributes:t,layer:n,text:r,expressionAttributes:i,fieldInfoMap:a}){return r?j({formattedAttributes:t,template:I(r,{...t,...i,...e},n),fieldInfoMap:a}):``}function j({formattedAttributes:e,template:n,fieldInfoMap:r}){return A(me(t(t(n,e=>pe(e,r)),e)))}function M(e,t,n=!1){let r=t[e];typeof r==`string`&&(t[e]=(n?encodeURIComponent(r):r).replaceAll(te,`%27`))}function N(e,t=!1){let n={...e};return Object.keys(n).forEach(e=>M(e,n,t)),n}function P(e,n,r){n=A(n);let i=n&&!n.startsWith(`{`);return t(e,N(r,i||!1))}function F(e,t){return e.replaceAll(ee,(e,n,r)=>{let i=k(t,r);return i?`{${i.name}}`:n})}function I(e,t,n){let r=F(e,n);return r&&r.replaceAll(ie,(e,n,r)=>P(e,n||r,t))}function L(e,t){let n=t?.fieldFormat?.type===`number`||t?.format&&t.format.dateFormat==null&&(t.format.places!=null||t.format.digitSeparator!=null);if(typeof e==`string`&&n){let t=Number(e);if(!isNaN(t))return t}return e}function R(e){return typeof e==`object`&&!!e&&`fieldsIndex`in e&&`geometryType`in e&&`getField`in e&&`load`in e&&`loaded`in e&&`objectIdField`in e&&`spatialReference`in e&&`type`in e&&(e.type===`feature`||e.type===`scene`||e.type===`subtype-group`||e.type===`subtype-sublayer`||e.type===`sublayer`)&&`when`in e}function z(e){return typeof e==`object`&&!!e&&`createQuery`in e&&`queryFeatureCount`in e&&`queryObjectIds`in e&&`queryRelatedFeatures`in e&&`queryRelatedFeaturesCount`in e&&`relationships`in e}function B(e){return R(e)&&z(e)}function _e(e){return e&&typeof e==`object`&&`createQuery`in e&&`getField`in e&&`queryFeatureCount`in e&&`queryFeatures`in e&&`queryObjectIds`in e&&`capabilities`in e&&`fields`in e&&`fieldsIndex`in e&&`type`in e&&(e.type===`feature`||e.type===`subtype-group`||e.type===`subtype-sublayer`||e.type===`sublayer`)&&`when`in e?e.type===`subtype-sublayer`&&`parent`in e&&e.parent&&typeof e.parent==`object`?`globalIdField`in e.parent:`globalIdField`in e:!1}function ve(e){return!e||typeof e!=`object`?!1:B(n(e))}function V(e,t){let{fieldInfos:n,fieldName:r,graphic:i,isContentFieldInfos:c,layer:l,preventPlacesFormatting:d,timeZone:f}=t,p=U(n,r),m=E({fieldInfo:p,graphic:i,layer:l}),g=k(m||l,r),_=m?null:p?.format,v=m?D({configurableFieldsContainer:m,fieldInfo:p,isContentFieldInfos:c}):null,y=v?.type===`number`;if(p&&!u(r)){let t=g?.type,n=v?.type===`date-time`,r=_?.dateFormat;if(t===`date`||t===`date-only`||t===`time-only`||t===`timestamp-offset`||n||r)return h(e,{format:n?void 0:r,fieldFormat:n?v:void 0,fieldType:t,timeZoneOptions:{layerTimeZone:l&&`preferredTimeZone`in l?l.preferredTimeZone:null,viewTimeZone:f,datesInUnknownTimezone:l&&`datesInUnknownTimezone`in l?!!l.datesInUnknownTimezone:!1}})}if(typeof e==`string`&&u(r)&&_)return ye(e,_);if(e=L(e,{format:y?void 0:_,fieldFormat:y?v:void 0}),typeof e==`string`||e==null||_==null&&v==null)return G(e);let b=y?a(v):_?o(_):void 0;return d?s(e,{...b,minimumFractionDigits:0,maximumFractionDigits:20}):s(e,b)}function ye(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(`,`)?H(e,`,`,`, `,t):e.includes(`;`)?H(e,`;`,`; `,t):e.includes(` `)?H(e,` `,` `,t):s(Number(e),o(t))}function H(e,t,n,r){return e.trim().split(t).map(e=>s(Number(e),o(r))).join(n)}function U(e,t){if(e?.length&&t)return e.find(e=>e.fieldName?.toLowerCase()===t.toLowerCase())}function be({fieldName:e,graphic:t,layer:n}){if(J(e)||!n||typeof n.getFeatureType!=`function`)return null;let{typeIdField:r}=n;if(!r||e!==r)return null;let i=n.getFeatureType(t);return i?i.name:null}function xe({fieldName:e,value:t,graphic:n,layer:r}){if(J(e)||!r||typeof r.getFieldDomain!=`function`)return null;let i=n&&r.getFieldDomain(e,{feature:n});return!i||i.type!==`coded-value`?null:i.getName(t)}function Se(e,t,n,i){let{creatorField:a,creationDateField:o,editorField:s,editDateField:c}=e;if(!t)return;let l=v(i&&`preferredTimeZone`in i?i.preferredTimeZone:null,i&&`datesInUnknownTimezone`in i?!!i.datesInUnknownTimezone:!1,n,C,`date`),u={...C,...l},d=t[c];if(typeof d==`number`){let e=t[s];return{type:`edit`,date:r(d,u),user:e}}let f=t[o];if(typeof f==`number`){let e=t[a];return{type:`create`,date:r(f,u),user:e}}return null}function W(e,t){let n=new Map;if(!e)return n;for(let r of e){if(!r.fieldName)continue;let e=O(r.fieldName,t);r.fieldName=e,n.set(e.toLowerCase(),r)}return n}function Ce(e){let t=[];if(!e)return t;let{fieldInfos:n,content:r}=e;return n&&t.push(...n),!r||!Array.isArray(r)||r.forEach(e=>{if(e.type===`fields`){let n=e?.fieldInfos;n&&t.push(...n)}}),t}function we(e){return e.replaceAll(re,e=>`&#${e.charCodeAt(0)};`)}function G(e){return typeof e==`string`?e.replaceAll(ne,`<br class="esri-text-new-line" />`):e}function K(e){let{fieldInfoMap:t,fieldInfos:n,fieldName:r,graphic:i,isContentFieldInfos:a,layer:o,timeZone:s,value:l}=e;if(l==null)return``;let u=xe({fieldName:r,value:l,graphic:i,layer:o});if(u)return u;let d=o?.types&&c(o.types)?be({fieldName:r,graphic:i,layer:o}):null;if(d)return d;if(t.get(r.toLowerCase()))return V(l,{fieldInfos:n||Array.from(t.values()),fieldName:r,graphic:i,isContentFieldInfos:a,layer:o,timeZone:s});let p=o?.fieldsIndex?.get(r);return p&&(g(p)||f(p))?h(l,{fieldType:p.type,timeZoneOptions:{layerTimeZone:o&&`preferredTimeZone`in o?o.preferredTimeZone:null,viewTimeZone:s,datesInUnknownTimezone:o&&`datesInUnknownTimezone`in o?!!o.datesInUnknownTimezone:!1}}):G(l)}function Te({attributes:e,fieldInfoMap:t,fieldInfos:n,graphic:r,isContentFieldInfos:i,layer:a,relatedInfos:o,timeZone:s}){let c={};return o?.forEach(e=>Ae({attributes:c,relatedInfo:e,fieldInfoMap:t,fieldInfos:n,layer:a,timeZone:s})),e&&Object.keys(e).forEach(o=>{let l=e[o];c[o]=K({fieldInfoMap:t,fieldInfos:n,fieldName:o,graphic:r,isContentFieldInfos:i,layer:a,timeZone:s,value:l})}),c}async function q(e,t){let{layer:n,graphic:r,outFields:i,objectIds:a,returnGeometry:o,spatialReference:s}=e,c=a[0];if(typeof c!=`number`&&typeof c!=`string`){let e={layer:n,graphic:r,objectId:c,requiredFields:i};return y().warn(`Could not query required fields for the specified feature. The feature's ID is invalid.`,e),null}if(!m(n)?.operations?.supportsQuery){let e={layer:n,graphic:r,requiredFields:i,returnGeometry:o};return y().warn(`The specified layer cannot be queried. The following fields will not be available.`,e),null}let l=n.createQuery();return l.objectIds=a,l.outFields=i?.length?i:[n.objectIdField],l.returnGeometry=!!o,l.returnZ=!!o,l.returnM=!!o,l.outSpatialReference=s,(await n.queryFeatures(l,t)).features[0]}async function Ee(e){if(!e.expressionInfos?.length)return!1;let{arcadeUtils:{hasGeometryFunctions:t}}=await _();return t(e)}async function De(e){if(!e.expressionInfos?.length)return!1;let{arcadeUtils:{requiresTrack:t}}=await _();return t(e)}async function Oe({graphic:e,popupTemplate:t,layer:n,spatialReference:r},i){if(!n||!t||(typeof n.load==`function`&&await n.load(i),!e.attributes))return;let a=n.objectIdField,o=e.attributes[a];if(o==null)return;let s=[o],c=new Set(await t.getRequiredFields(n.fieldsIndex));n.timeInfo?.trackIdField!=null&&!c.has(n.timeInfo.trackIdField)&&await De(t)&&c.add(n.timeInfo.trackIdField);let l=d(e,c),u=l?[]:c.has(a)?[...c]:[...c,a],f=t.returnGeometry||await Ee(t);if(l&&!f)return;let p=await q({layer:n,graphic:e,outFields:u,objectIds:s,returnGeometry:f,spatialReference:r},i);p&&(p.geometry&&(e.geometry=p.geometry),p.attributes&&(e.attributes={...e.attributes,...p.attributes}))}function J(e=``){return e?e.includes(S):!1}function ke(e){return e?`${S}${e.layerId}/${e.fieldName}`:``}function Y({attributes:e,graphic:t,relatedInfo:n,fieldInfos:r,fieldInfoMap:i,layer:a,timeZone:o}){e&&t&&n&&Object.keys(t.attributes).forEach(s=>{let c=ke({layerId:n.relation.id.toString(),fieldName:s}),l=t.attributes[s];e[c]=K({fieldName:c,fieldInfos:r,fieldInfoMap:i,layer:a,value:l,graphic:t,timeZone:o})})}function Ae({attributes:e,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a}){e&&t&&(t.relatedFeatures?.forEach(o=>Y({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})),t.relatedStatsFeatures?.forEach(o=>Y({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})))}const X=e=>{if(!e)return!1;let t=e.toUpperCase();return t.includes(`CURRENT_TIMESTAMP`)||t.includes(`CURRENT_DATE`)||t.includes(`CURRENT_TIME`)},Z=({layer:e,method:t,query:n,definitionExpression:r})=>{if(!e.capabilities?.query?.supportsCacheHint||t===`attachments`)return;let i=n.where==null?null:n.where,a=n.geometry==null?null:n.geometry;!X(r)&&!X(i)&&a?.type!==`extent`&&n.resultType!==`tile`&&(n.cacheHint=!0)},je=({query:e,layer:t,method:n})=>{Z({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??``}`})},Me=({queryPayload:e,layer:t,method:n})=>{Z({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??``}`})};function Ne(e,t,n){return!e||!t||!n?null:t.type===`sublayer`?$({layers:t.layer?.allSublayers,map:e,relatedLayer:t,relationship:n})||$({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:n}):$({layers:e.allLayers,map:e,relatedLayer:t,relationship:n})||$({layers:e.allTables,map:e,relatedLayer:t,relationship:n})}function Pe(e,t){return!e||!(`utilityNetworks`in e)||!t?null:e.utilityNetworks?.find(e=>e.isUtilityLayer(t))}function Q(e,t){return e?.allTables.find(e=>e.type===`feature`&&e.layerId===t.id&&e.url===t.layer?.url)}function $({map:e,relationship:t,relationship:{relatedTableId:n},relatedLayer:r,layers:i}){if(!i)return null;for(let a of i){if(a.type===`map-image`){let n=$({layers:a.sublayers,map:e,relatedLayer:r,relationship:t})||$({layers:a.subtables,map:e,relatedLayer:r,relationship:t});if(n)return n;continue}if(!B(a))continue;if(r.type===`sublayer`){if(a!==r&&a.id===n)return a.isTable?Q(e,a):a;continue}let i=r.type===`scene`&&r.associatedLayer?r.associatedLayer.url:r.url;if(!i)return null;if(a.type===`sublayer`){if(a!==r&&a.layer?.url===i&&a.id===n)return a.isTable?Q(e,a):a;continue}if(a!==r&&a.url===i&&a.layerId===n)return a}return null}export{G as applyTextFormattingHTML,W as createFieldInfoMap,Ne as findRelatedLayer,Pe as findUtilityNetwork,F as fixTokens,Te as formatAttributes,Se as formatEditInfo,V as formatValueToFieldInfo,Ce as getAllFieldInfos,E as getConfigurableFieldsContainer,D as getFieldFormat,U as getFieldInfo,fe as getFieldInfoLabel,O as getFixedFieldName,he as getFixedFieldNames,ce as getPopupLayer,oe as getSourceLayer,le as graphicCallback,we as htmlEntities,_e as isAssociatedFeatureSupportedLayer,w as isExpressionField,R as isFeatureSupportedLayer,ve as isGraphicForRelatableFeatureSupportedLayer,B as isRelatableFeatureSupportedLayer,z as isRelatableLayer,J as isRelatedField,je as preLayerQueryCallback,Me as preRequestCallback,q as querySourceLayer,Oe as queryUpdatedFeature,ue as shouldOpenInNewTab,j as substituteAttributes,ge as substituteFieldsInLinksAndAttributes};
|
|
2
|
+
import e from"../../core/Logger.js";import{replace as t}from"../../core/string.js";import{getGraphicLayer as n}from"../../graphic/graphicOriginUtils.js";import{formatDate as r,convertDateFormatToIntlOptions as i}from"../../intl/date.js";import{convertNumberFieldFormatToIntlOptions as a,convertNumberFormatToIntlOptions as o,formatNumber as s}from"../../intl/number.js";import{typesHaveUniqueIdsAndNames as c}from"../../layers/support/featureLayerUtils.js";import{fieldFormatFromFieldInfo as l}from"../../layers/support/fieldFormatUtils.js";import{isRasterPixelValueField as u,featureHasFields as d,isTimeOnlyField as f}from"../../layers/support/fieldUtils.js";import{getFieldConfigurationsContainer as p,getEffectiveLayerCapabilities as m}from"../../layers/support/layerUtils.js";import{formatAnyDate as h,isAnyDateField as g}from"../../smartMapping/support/utils.js";import{loadArcade as _}from"../../support/loadArcade.js";import{getTimeZoneFormattingOptions as v}from"../../time/timeZoneUtils.js";const y=()=>e.getLogger(`esri.popup.support.featureUtils`),b=/href=(""|'')/gi,ee=/(\{([^{\r\n]+)\})/g,te=/'/g,x=/^\s*expression\//i,ne=/(\n)/gi,re=/[\u00A0-\u9999<>&]/gim,ie=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,ae=/^(?:mailto:|tel:)/,S=`relationships/`,C=i(`short-date-short-time`);function oe(e){if(e!=null)return(e.sourceLayer||e.layer)??void 0}const se=new Set([`building`,`knowledge-graph`,`link-chart`,`map-image`,`map-notes`,`subtype-group`,`tile`]);function ce(e){let t=e?.origin;return(t==null?void 0:se.has(t.type??``)?t.sublayer:t.layer)??e?.layer}async function le({type:e,value:t,event:n}){try{return typeof t==`function`?t(n):await t}catch(r){y().error(`error`,`An error occurred when calling the "${e}" function`,{error:r,graphic:n.graphic,value:t});return}}function ue(e=``){if(e)return!ae.test(e.trim().toLowerCase())}function w(e){return e?x.test(e):!1}function T(e,t){if(!t||!w(t)||!e)return;let n=t.replace(x,``).toLowerCase();return e.find(({name:e})=>e.toLowerCase()===n)}function E(e){let{fieldInfo:t,graphic:n,layer:r}=e;return de({fieldInfo:t,graphic:n})?p(r,{graphic:n}):null}function de({fieldInfo:e,graphic:t}){return!!e?.fieldName&&!w(e.fieldName)&&!J(e.fieldName)&&!t?.popupTemplate}function fe({expressionInfos:e,fieldInfo:t,graphic:n,isContentFieldInfos:r,layer:i}){if(!t?.fieldName)return null;let a=T(e,t.fieldName);if(a)return a.title||null;let o=E({fieldInfo:t,graphic:n,layer:i});if(o){let e=o.getFieldAlias(t.fieldName);return r?t.label||e||t.fieldName:e||t.fieldName}return t.label||t.fieldName}function D(e){let{configurableFieldsContainer:t,fieldInfo:n,isContentFieldInfos:r}=e;if(!n?.fieldName)return null;let i=!t.popupTemplate&&!t.fieldConfigurations?l(n,t.getField(n.fieldName)):t.getFieldConfiguration(n.fieldName)?.fieldFormat;return r&&n.fieldFormat||i}function pe(e,t){return`{${t.get(e.toLowerCase())?.fieldName||e}}`}function me(e){return e.replaceAll(b,``)}function O(e,t){let n=k(t,e);return n?n.name:e}function he(e,t){return e&&e.map(e=>O(e,t))}function k(e,t){return!(e&&typeof e.getField==`function`)||!t?null:e.getField(t)??null}function A(e){return`${e}`.trim()}function ge({attributes:e,globalAttributes:t,layer:n,text:r,expressionAttributes:i,fieldInfoMap:a}){return r?j({formattedAttributes:t,template:I(r,{...t,...i,...e},n),fieldInfoMap:a}):``}function j({formattedAttributes:e,template:n,fieldInfoMap:r}){return A(me(t(t(n,e=>pe(e,r)),e)))}function M(e,t,n=!1){let r=t[e];typeof r==`string`&&(t[e]=(n?encodeURIComponent(r):r).replaceAll(te,`%27`))}function N(e,t=!1){let n={...e};return Object.keys(n).forEach(e=>M(e,n,t)),n}function P(e,n,r){n=A(n);let i=n&&!n.startsWith(`{`);return t(e,N(r,i||!1))}function F(e,t){return e.replaceAll(ee,(e,n,r)=>{let i=k(t,r);return i?`{${i.name}}`:n})}function I(e,t,n){let r=F(e,n);return r&&r.replaceAll(ie,(e,n,r)=>P(e,n||r,t))}function L(e,t){let n=t?.fieldFormat?.type===`number`||t?.format&&t.format.dateFormat==null&&(t.format.places!=null||t.format.digitSeparator!=null);if(typeof e==`string`&&n){let t=Number(e);if(!isNaN(t))return t}return e}function R(e){return typeof e==`object`&&!!e&&`fieldsIndex`in e&&`geometryType`in e&&`getField`in e&&`load`in e&&`loaded`in e&&`objectIdField`in e&&`spatialReference`in e&&`type`in e&&(e.type===`feature`||e.type===`scene`||e.type===`subtype-group`||e.type===`subtype-sublayer`||e.type===`sublayer`)&&`when`in e}function z(e){return typeof e==`object`&&!!e&&`createQuery`in e&&`queryFeatureCount`in e&&`queryObjectIds`in e&&`queryRelatedFeatures`in e&&`queryRelatedFeaturesCount`in e&&`relationships`in e}function B(e){return R(e)&&z(e)}function _e(e){return e&&typeof e==`object`&&`createQuery`in e&&`getField`in e&&`queryFeatureCount`in e&&`queryFeatures`in e&&`queryObjectIds`in e&&`capabilities`in e&&`fields`in e&&`fieldsIndex`in e&&`type`in e&&(e.type===`feature`||e.type===`subtype-group`||e.type===`subtype-sublayer`||e.type===`sublayer`)&&`when`in e?e.type===`subtype-sublayer`&&`parent`in e&&e.parent&&typeof e.parent==`object`?`globalIdField`in e.parent:`globalIdField`in e:!1}function ve(e){return!e||typeof e!=`object`?!1:B(n(e))}function V(e,t){let{fieldInfos:n,fieldName:r,graphic:i,isContentFieldInfos:c,layer:l,preventPlacesFormatting:d,timeZone:f}=t,p=U(n,r),m=E({fieldInfo:p,graphic:i,layer:l}),g=k(m||l,r),_=m?null:p?.format,v=m?D({configurableFieldsContainer:m,fieldInfo:p,isContentFieldInfos:c}):null,y=v?.type===`number`;if(p&&!u(r)){let t=g?.type,n=v?.type===`date-time`,r=_?.dateFormat;if(t===`date`||t===`date-only`||t===`time-only`||t===`timestamp-offset`||n||r)return h(e,{format:n?void 0:r,fieldFormat:n?v:void 0,fieldType:t,timeZoneOptions:{layerTimeZone:l&&`preferredTimeZone`in l?l.preferredTimeZone:null,viewTimeZone:f,datesInUnknownTimezone:l&&`datesInUnknownTimezone`in l?!!l.datesInUnknownTimezone:!1}})}if(typeof e==`string`&&u(r)&&_)return ye(e,_);if(e=L(e,{format:y?void 0:_,fieldFormat:y?v:void 0}),typeof e==`string`||e==null||_==null&&v==null)return G(e);let b=y?a(v):_?o(_):void 0;return d?s(e,{...b,minimumFractionDigits:0,maximumFractionDigits:20}):s(e,b)}function ye(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(`,`)?H(e,`,`,`, `,t):e.includes(`;`)?H(e,`;`,`; `,t):e.includes(` `)?H(e,` `,` `,t):s(Number(e),o(t))}function H(e,t,n,r){return e.trim().split(t).map(e=>s(Number(e),o(r))).join(n)}function U(e,t){if(e?.length&&t)return e.find(e=>e.fieldName?.toLowerCase()===t.toLowerCase())}function be({fieldName:e,graphic:t,layer:n}){if(J(e)||!n||typeof n.getFeatureType!=`function`)return null;let{typeIdField:r}=n;if(!r||e!==r)return null;let i=n.getFeatureType(t);return i?i.name:null}function xe({fieldName:e,value:t,graphic:n,layer:r}){if(J(e)||!r||typeof r.getFieldDomain!=`function`)return null;let i=n&&r.getFieldDomain(e,{feature:n});return!i||i.type!==`coded-value`?null:i.getName(t)}function Se(e,t,n,i){let{creatorField:a,creationDateField:o,editorField:s,editDateField:c}=e;if(!t)return;let l=v(i&&`preferredTimeZone`in i?i.preferredTimeZone:null,i&&`datesInUnknownTimezone`in i?!!i.datesInUnknownTimezone:!1,n,C,`date`),u={...C,...l},d=t[c];if(typeof d==`number`){let e=t[s];return{type:`edit`,date:r(d,u),user:e}}let f=t[o];if(typeof f==`number`){let e=t[a];return{type:`create`,date:r(f,u),user:e}}return null}function W(e,t){let n=new Map;if(!e)return n;for(let r of e){if(!r.fieldName)continue;let e=O(r.fieldName,t);r.fieldName=e,n.set(e.toLowerCase(),r)}return n}function Ce(e){let t=[];if(!e)return t;let{fieldInfos:n,content:r}=e;return n&&t.push(...n),!r||!Array.isArray(r)||r.forEach(e=>{if(e.type===`fields`){let n=e?.fieldInfos;n&&t.push(...n)}}),t}function we(e){return e.replaceAll(re,e=>`&#${e.charCodeAt(0)};`)}function G(e){return typeof e==`string`?e.replaceAll(ne,`<br class="esri-text-new-line" />`):e}function K(e){let{fieldInfoMap:t,fieldInfos:n,fieldName:r,graphic:i,isContentFieldInfos:a,layer:o,timeZone:s,value:l}=e;if(l==null)return``;let u=xe({fieldName:r,value:l,graphic:i,layer:o});if(u)return u;let d=o?.types&&c(o.types)?be({fieldName:r,graphic:i,layer:o}):null;if(d)return d;if(t.get(r.toLowerCase()))return V(l,{fieldInfos:n||Array.from(t.values()),fieldName:r,graphic:i,isContentFieldInfos:a,layer:o,timeZone:s});let p=o?.fieldsIndex?.get(r);return p&&(g(p)||f(p))?h(l,{fieldType:p.type,timeZoneOptions:{layerTimeZone:o&&`preferredTimeZone`in o?o.preferredTimeZone:null,viewTimeZone:s,datesInUnknownTimezone:o&&`datesInUnknownTimezone`in o?!!o.datesInUnknownTimezone:!1}}):G(l)}function Te({attributes:e,fieldInfoMap:t,fieldInfos:n,graphic:r,isContentFieldInfos:i,layer:a,relatedInfos:o,timeZone:s}){let c={};return o?.forEach(e=>Ae({attributes:c,relatedInfo:e,fieldInfoMap:t,fieldInfos:n,layer:a,timeZone:s})),e&&Object.keys(e).forEach(o=>{let l=e[o];c[o]=K({fieldInfoMap:t,fieldInfos:n,fieldName:o,graphic:r,isContentFieldInfos:i,layer:a,timeZone:s,value:l})}),c}async function q(e,t){let{layer:n,graphic:r,outFields:i,objectIds:a,returnGeometry:o,spatialReference:s}=e,c=a[0];if(typeof c!=`number`&&typeof c!=`string`){let e={layer:n,graphic:r,objectId:c,requiredFields:i};return y().warn(`Could not query required fields for the specified feature. The feature's ID is invalid.`,e),null}if(!m(n)?.operations?.supportsQuery){let e={layer:n,graphic:r,requiredFields:i,returnGeometry:o};return y().warn(`The specified layer cannot be queried. The following fields will not be available.`,e),null}let l=n.createQuery();return l.objectIds=a,l.outFields=i?.length?i:[n.objectIdField],l.returnGeometry=!!o,l.returnZ=!!o,l.returnM=!!o,l.outSpatialReference=s,(await n.queryFeatures(l,t)).features[0]}async function Ee(e){if(!e.expressionInfos?.length)return!1;let{arcadeUtils:{hasGeometryFunctions:t}}=await _();return t(e)}async function De(e){if(!e.expressionInfos?.length)return!1;let{arcadeUtils:{requiresTrack:t}}=await _();return t(e)}async function Oe({graphic:e,popupTemplate:t,layer:n,spatialReference:r},i){if(!n||!t||(typeof n.load==`function`&&await n.load(i),!e.attributes))return;let a=n.objectIdField,o=e.attributes[a];if(o==null)return;let s=[o],c=new Set(await t.getRequiredFields(n.fieldsIndex));n.timeInfo?.trackIdField!=null&&!c.has(n.timeInfo.trackIdField)&&await De(t)&&c.add(n.timeInfo.trackIdField);let l=d(e,c),u=l?[]:c.has(a)?[...c]:[...c,a],f=t.returnGeometry||await Ee(t);if(l&&!f)return;let p=await q({layer:n,graphic:e,outFields:u,objectIds:s,returnGeometry:f,spatialReference:r},i);p&&(p.geometry&&(e.geometry=p.geometry),p.attributes&&(e.attributes={...e.attributes,...p.attributes}))}function J(e=``){return e?e.includes(S):!1}function ke(e){return e?`${S}${e.layerId}/${e.fieldName}`:``}function Y({attributes:e,graphic:t,relatedInfo:n,fieldInfos:r,fieldInfoMap:i,layer:a,timeZone:o}){e&&t&&n&&Object.keys(t.attributes).forEach(s=>{let c=ke({layerId:n.relation.id.toString(),fieldName:s}),l=t.attributes[s];e[c]=K({fieldName:c,fieldInfos:r,fieldInfoMap:i,layer:a,value:l,graphic:t,timeZone:o})})}function Ae({attributes:e,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a}){e&&t&&(t.relatedFeatures?.forEach(o=>Y({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})),t.relatedStatsFeatures?.forEach(o=>Y({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})))}const X=e=>{if(!e)return!1;let t=e.toUpperCase();return t.includes(`CURRENT_TIMESTAMP`)||t.includes(`CURRENT_DATE`)||t.includes(`CURRENT_TIME`)},Z=({layer:e,method:t,query:n,definitionExpression:r})=>{if(!e.capabilities?.query?.supportsCacheHint||t===`attachments`)return;let i=n.where==null?null:n.where,a=n.geometry==null?null:n.geometry;e.capabilities.query.supportsCacheHint&&!X(r)&&!X(i)&&a?.type!==`extent`&&n.resultType!==`tile`&&(n.cacheHint=!0)},je=({query:e,layer:t,method:n})=>{Z({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??``}`})},Me=({queryPayload:e,layer:t,method:n})=>{Z({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??``}`})};function Ne(e,t,n){return!e||!t||!n?null:t.type===`sublayer`?$({layers:t.layer?.allSublayers,map:e,relatedLayer:t,relationship:n})||$({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:n}):$({layers:e.allLayers,map:e,relatedLayer:t,relationship:n})||$({layers:e.allTables,map:e,relatedLayer:t,relationship:n})}function Pe(e,t){return!e||!(`utilityNetworks`in e)||!t?null:e.utilityNetworks?.find(e=>e.isUtilityLayer(t))}function Q(e,t){return e?.allTables.find(e=>e.type===`feature`&&e.layerId===t.id&&e.url===t.layer?.url)}function $({map:e,relationship:t,relationship:{relatedTableId:n},relatedLayer:r,layers:i}){if(!i)return null;for(let a of i){if(a.type===`map-image`){let n=$({layers:a.sublayers,map:e,relatedLayer:r,relationship:t})||$({layers:a.subtables,map:e,relatedLayer:r,relationship:t});if(n)return n;continue}if(!B(a))continue;if(r.type===`sublayer`){if(a!==r&&a.id===n)return a.isTable?Q(e,a):a;continue}let i=r.type===`scene`&&r.associatedLayer?r.associatedLayer.url:r.url;if(!i)return null;if(a.type===`sublayer`){if(a!==r&&a.layer?.url===i&&a.id===n)return a.isTable?Q(e,a):a;continue}if(a!==r&&a.url===i&&a.layerId===n)return a}return null}export{G as applyTextFormattingHTML,W as createFieldInfoMap,Ne as findRelatedLayer,Pe as findUtilityNetwork,F as fixTokens,Te as formatAttributes,Se as formatEditInfo,V as formatValueToFieldInfo,Ce as getAllFieldInfos,E as getConfigurableFieldsContainer,D as getFieldFormat,U as getFieldInfo,fe as getFieldInfoLabel,O as getFixedFieldName,he as getFixedFieldNames,ce as getPopupLayer,oe as getSourceLayer,le as graphicCallback,we as htmlEntities,_e as isAssociatedFeatureSupportedLayer,w as isExpressionField,R as isFeatureSupportedLayer,ve as isGraphicForRelatableFeatureSupportedLayer,B as isRelatableFeatureSupportedLayer,z as isRelatableLayer,J as isRelatedField,je as preLayerQueryCallback,Me as preRequestCallback,q as querySourceLayer,Oe as queryUpdatedFeature,ue as shouldOpenInNewTab,j as substituteAttributes,ge as substituteFieldsInLinksAndAttributes};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
class e{constructor(e,t){this.renderer=e,this.symbol=t,this.color=null,this.size=null,this.opacity=null,this.outlineSize=null,this.heading=null,this.tilt=null,this.roll=null}}class t{constructor(e,t){this.output=e,this.input=t}}export{e as RenderingInfo,t as RenderingInfoVisualVariableInfo};
|
|
2
|
+
class e{constructor(e,t){this.renderer=e,this.symbol=t,this.color=null,this.size=null,this.opacity=null,this.outlineSize=null,this.heading=null,this.tilt=null,this.roll=null}}class t{constructor(e,t){this.output=e,this.input=t}}class n extends t{constructor(e,t,n){super(e,t),this.variables=n}}export{e as RenderingInfo,n as RenderingInfoSizeVariableInfo,t as RenderingInfoVisualVariableInfo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{RenderingInfo as e,RenderingInfoVisualVariableInfo as t}from"./RenderingInfo.js";import{getVisualVariableValues as
|
|
2
|
+
import{RenderingInfo as e,RenderingInfoVisualVariableInfo as t,RenderingInfoSizeVariableInfo as n}from"./RenderingInfo.js";import{getVisualVariableValues as r}from"../visualVariables/support/visualVariableUtils.js";function i(e,t){if(e.symbol!=null)return e.symbol;let n=t?.renderer;return n!=null&&n.type!==`dot-density`?n.getSymbol(e,t):null}function a(e,t){return o(e,i(e,t),t)}function o(i,a,o){if(!a)return null;let s=o?.renderer,c=new e(s,a);if(s==null||!(`visualVariables`in s)||!s.visualVariables)return c;let u=r(s,i,o)??[],d=[`proportional`,`proportional`,`proportional`],f=[null,null,null],p=[null,null,null];for(let{type:e,variable:n,output:r,input:i}of u)switch(e){case`color`:if(r==null)continue;c.color=new t(r.toRgba(),i);break;case`size`:if(n.target===`outline`){if(r==null)continue;c.outlineSize=new t(r??0,i)}else{let e=n.axis;l(d,e,n.useSymbolValue?`symbol-value`:r??`proportional`),l(f,e,i),l(p,e,n)}break;case`opacity`:if(r==null)continue;c.opacity=new t(r,i);break;case`rotation`:if(r==null)continue;switch(n.axis){case`tilt`:c.tilt=new t(r,i);break;case`roll`:c.roll=new t(r,i);break;default:c.heading=new t(r,i)}}return(d[0]!==`proportional`||d[1]!==`proportional`||d[2]!==`proportional`)&&(c.size=new n(d,f,p)),c}async function s(e,t){return e.symbol==null?t?.renderer?.getSymbolAsync(e,t)??null:e.symbol}async function c(e,t){return o(e,await s(e,t),t)}function l(e,t,n){switch(t){case`width`:e[0]=n;break;case`depth`:e[1]=n;break;case`height`:e[2]=n;break;case`width-and-depth`:e[0]=e[1]=n;break;default:e[0]=e[1]=e[2]=n}}function u(e,t=0){let n=e[t];return typeof n==`number`&&isFinite(n)?n:null}function d(e){let t=e.find(e=>typeof e==`number`);return t!=null&&isFinite(t)?t:0}export{u as getDriverAxisSizeValue,d as getDriverAxisSizeValueAny,a as getRenderingInfo,c as getRenderingInfoAsync,s as getSymbolAsync};
|