@arcgis/core 4.33.0-next.20250519 → 4.33.0-next.20250521
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/Graphic.js +1 -1
- package/applications/Components/QuantityFormatter.js +1 -1
- package/arcade/Feature.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{91cd29f53f07bc38fe75.js → 14b3c18581b31c93af82.js} +1 -1
- package/assets/esri/core/workers/chunks/{9c8224ca29475556e5ea.js → 26d3c9c6215c4076f943.js} +1 -1
- package/assets/esri/core/workers/chunks/{66a1b92358344dd28ee1.js → 571252c9822d73cf7b01.js} +1 -1
- package/assets/esri/core/workers/chunks/{151d6354e7bc105b25c0.js → 585c7b485c42555ec554.js} +6 -6
- package/assets/esri/core/workers/chunks/62b2d3720693c93a60f2.js +1 -0
- package/assets/esri/core/workers/chunks/{2adf558cd8d8155d07d7.js → 80b596496800e8d60eb8.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d5eac3bd1526e2b33e3.js → 8fda0a5b247385e68dc0.js} +1 -1
- package/assets/esri/core/workers/chunks/9b610fbfcd47c3dde34d.js +1 -0
- package/assets/esri/core/workers/chunks/a0c35521e677459f6fa3.js +1 -0
- package/assets/esri/core/workers/chunks/a22e5b2874647fe0d31a.js +1 -0
- package/assets/esri/core/workers/chunks/{0a4cece5e96fb7e8a57b.js → b893012bff5dc55e542d.js} +1 -1
- package/assets/esri/core/workers/chunks/{6fa1a5b7276a037dbd6a.js → cc4a6f4000cb6680be48.js} +4 -4
- package/assets/esri/themes/base/_core.scss +2 -0
- package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationLayers.scss +1 -1
- package/assets/esri/themes/base/widgets/_Legend.scss +0 -4
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +1 -1
- package/assets/esri/themes/base/widgets/_OrientedImageryViewerNavigationSettingsUI.scss +16 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/views/magnifier/overlay.ts.svg +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ar.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bg.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bs.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ca.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_cs.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_da.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_de.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_el.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_es.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_et.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fi.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fr.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_he.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hr.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hu.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_id.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_it.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ja.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ko.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lt.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lv.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nl.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_no.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pl.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-BR.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-PT.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ro.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ru.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sk.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sl.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sr.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sv.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_th.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_tr.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_uk.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_vi.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-CN.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-HK.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-TW.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ar.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_bg.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_bs.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ca.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_cs.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_da.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_de.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_el.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_es.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_et.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_fi.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_fr.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_he.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_hr.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_hu.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_id.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_it.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ja.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ko.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_lt.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_lv.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_nl.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_no.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pl.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pt-BR.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pt-PT.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ro.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ru.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sk.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sl.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sr.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sv.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_th.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_tr.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_uk.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_vi.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-CN.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-HK.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-TW.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_no.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_ar.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_bg.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_bs.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_ca.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_cs.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_da.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_de.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_el.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_es.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_et.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_fi.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_fr.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_he.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_hr.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_hu.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_id.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_it.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_ja.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_ko.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_lt.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_lv.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_nl.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_no.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_pl.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_pt-BR.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_pt-PT.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_ro.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_ru.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_sk.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_sl.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_sr.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_sv.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_th.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_tr.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_uk.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_vi.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_zh-CN.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_zh-HK.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_zh-TW.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ar.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_bg.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_bs.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ca.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_cs.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_da.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_de.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_el.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_es.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_et.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_fi.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_fr.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_he.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_hr.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_hu.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_id.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_it.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ja.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ko.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_lt.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_lv.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_nl.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_no.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pl.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pt-BR.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pt-PT.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ro.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ru.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sk.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sl.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sr.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sv.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_th.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_tr.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_uk.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_vi.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-CN.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-HK.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-TW.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ar.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_bg.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_bs.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ca.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_cs.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_da.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_de.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_el.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_es.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_et.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_fi.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_fr.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_he.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_hr.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_hu.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_id.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_it.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ja.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ko.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_lt.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_lv.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_nl.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_no.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pl.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pt-BR.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pt-PT.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ro.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ru.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sk.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sl.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sr.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sv.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_th.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_tr.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_uk.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_vi.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-CN.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-HK.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-TW.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ar.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_bg.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_bs.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ca.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_cs.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_da.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_de.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_el.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_es.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_et.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_fi.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_fr.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_he.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_hr.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_hu.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_id.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_it.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ja.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ko.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_lt.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_lv.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_nl.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_no.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_pl.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_pt-BR.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_pt-PT.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ro.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ru.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sk.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sl.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sr.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sv.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_th.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_tr.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_uk.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_vi.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_zh-CN.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_zh-HK.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_zh-TW.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ar.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_bg.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_bs.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ca.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_cs.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_da.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_de.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_el.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_es.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_et.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_fi.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_fr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_he.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_hr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_hu.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_id.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_it.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ja.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ko.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_lt.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_lv.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_nl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_no.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_pl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_pt-BR.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_pt-PT.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ro.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ru.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_sk.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_sl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_sr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_sv.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_th.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_tr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_uk.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_vi.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_zh-CN.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_zh-HK.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_zh-TW.json +1 -1
- package/chunks/HUDMaterial.glsl.js +6 -6
- package/geometry/operators/densifyOperator.d.ts +1 -0
- package/geometry/operators/json/geodesicBufferOperator.js +1 -1
- package/interfaces.d.ts +87 -3
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/support/rasterFunctions/clipUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/networks/CircuitManager.js +5 -0
- package/package.json +3 -3
- package/request.js +1 -1
- package/rest/knowledgeGraph/GraphUpdateSearchIndexResult.js +5 -0
- package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/networks/circuits/exportCircuits.js +5 -0
- package/rest/networks/circuits/queryCircuits.js +1 -1
- package/rest/networks/circuits/support/ExportCircuitsParameters.js +5 -0
- package/rest/networks/circuits/support/ExportCircuitsResult.js +5 -0
- package/rest/networks/circuits/support/QueryCircuitsParameters.js +1 -1
- package/rest/networks/circuits/support/QueryCircuitsResult.js +1 -1
- package/rest/networks/circuits/support/VerifyCircuitsResult.js +1 -1
- package/smartMapping/renderers/support/spikeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/views/2d/engine/imagery/RasterBitmap.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/FocusArea.js +1 -1
- package/views/FocusAreaOutline.js +1 -1
- package/views/FocusAreaOutlineItem.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/input/recognizers/DoubleTapDrag.js +1 -1
- package/views/input/recognizers/ImmediateDoubleClick.js +1 -1
- package/views/input/recognizers/PointerClickHoldAndDrag.js +1 -1
- package/views/input/recognizers/SingleAndDoubleClick.js +1 -1
- package/views/input/recognizers/support.js +1 -1
- package/views/magnifier/overlay-svg.js +1 -1
- package/views/support/LayerLayerViewInfo.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/support/TextureCompressionWorkerHandle.js +1 -1
- package/views/ui/video/DefaultUIVideo.js +5 -0
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/checkWebGLError.js +1 -1
- package/views/webgl/rasterUtils.js +1 -1
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
- package/widgets/Legend/styles/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/Alert.js +5 -0
- package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationActions.js +5 -0
- package/widgets/OrientedImageryViewer/components/NavigationSettings.js +5 -0
- package/widgets/OrientedImageryViewer/components/NavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +5 -0
- package/widgets/OrientedImageryViewer/css.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/errors.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/support/AnalysisViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/assets/esri/core/workers/chunks/2873cb727c59328074db.js +0 -1
- package/assets/esri/core/workers/chunks/47fe2379f2214bf50036.js +0 -1
- package/assets/esri/core/workers/chunks/7a9a0383f27f4967bcfa.js +0 -1
- package/assets/esri/core/workers/chunks/a937076d2f8c2b6a5d8a.js +0 -1
package/views/webgl/Texture.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../core/Error.js";import"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{throwIfAborted as r,isAbortError as s}from"../../core/promiseUtils.js";import{checkWebGLError as o}from"./checkWebGLError.js";import{TextureType as a,ResourceType as n,CompressedTextureFormat as p,TextureSamplingMode as l,TextureConstants as h}from"./enums.js";import{FBOAttachmentType as m}from"./FBOAttachmentType.js";import{estimateMemory as d}from"./TextureDescriptor.js";import{isCompressedData as c,deriveInternalFormat as _,isTexImageSource as u,is3DTarget as g,validateTexture as T,isCompressedFormat as x,getDimensions as E,calcMipmapLevels as M,isSizedPixelFormat as A,isSizedDepthFormat as b,isSizedDepthStencilFormat as w}from"./textureUtils.js";import{ValidatedTextureDescriptor as f}from"./ValidatedTextureDescriptor.js";const I=null,R=()=>e.getLogger("esri/views/webgl/Texture");let D=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,i=null,r=null){if(this.type=m.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=i;else{const r=f.validate(e,i);if(!r)throw new t("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}this._descriptor.target===a.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return d(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this._descriptor.context.gl&&this.hasWebGLTextureObject&&(this._descriptor.context.instanceCounter.decrement(n.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=i,this._descriptor.target===a.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t,e){this._descriptor.compressionHandle=t,this._descriptor.compressionCallback=e}disableCompression(){this._descriptor.compressionHandle=null,this._descriptor.compressionCallback=null}setData(t){this.abortCompression(),!c(t)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in p&&(this._descriptor.internalFormat=void 0),this._setData(t),!c(t)&&this._descriptor.compressionHandle&&this._compressOnWorker(t)}updateData(i,r,s,o,a,n,p=0){n||R().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||R().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=_(l);const{context:h,pixelFormat:m,dataType:d,target:g,isImmutable:T}=l;if(T&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");const x=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||s<0||r+o>l.width||s+a>l.height)&&R().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:E}=h;p&&(o&&a||R().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),E.pixelStorei(E.UNPACK_SKIP_ROWS,p)),u(n)?E.texSubImage2D(g,i,r,s,o,a,m,d,n):c(n)?E.compressedTexSubImage2D(g,i,r,s,o,a,l.internalFormat,n.levels[i]):E.texSubImage2D(g,i,r,s,o,a,m,d,n),p&&E.pixelStorei(E.UNPACK_SKIP_ROWS,0),h.bindTexture(x,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(i,r,s,o,a,n,p,l){l||R().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||R().error("An attempt to update an uninitialized texture!");const h=this._descriptor;h.internalFormat=_(h);const{context:m,pixelFormat:d,dataType:u,isImmutable:T,target:x}=h;if(T&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");g(x)||R().warn("Attempting to set 3D texture data on a non-3D texture");const E=m.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);m.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||s<0||o<0||r+a>h.width||s+n>h.height||o+p>h.depth)&&R().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=m;if(c(l))l=l.levels[i],M.compressedTexSubImage3D(x,i,r,s,o,a,n,p,h.internalFormat,l);else{const t=l;M.texSubImage3D(x,i,r,s,o,a,n,p,d,u,t)}m.bindTexture(E,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const i=this._descriptor;if(0===i.width||0===i.height)return;if(!i.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");i.hasMipmap=!0,this._samplingModeDirty=!0,T(i)}i.samplingMode===l.LINEAR?(this._samplingModeDirty=!0,i.samplingMode=l.LINEAR_MIPMAP_NEAREST):i.samplingMode===l.NEAREST&&(this._samplingModeDirty=!0,i.samplingMode=l.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(i.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,T(e)}e.samplingMode===l.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=l.LINEAR):e.samplingMode===l.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=l.NEAREST)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,T(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=t,this._descriptor.compareEnabled=t,this.setSamplingMode(t?l.LINEAR:l.NEAREST),T(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=i(this._compressionAbortController)}_setData(i,r){const s=this._descriptor,a=s.context?.gl;if(!a)return;o(a),this.hasWebGLTextureObject||(this._glName=a.createTexture(),s.context.instanceCounter.increment(n.Texture,this)),T(s);const p=s.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);s.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),o(a);const l=r??s.target,h=g(l);if(u(i))this._setDataFromTexImageSource(i,l);else{const{width:e,height:r,depth:n}=s;if(null==e||null==r)throw new t("texture:missing-size","Width and height must be specified!");if(h&&null==n)throw new t("texture:missing-depth","Depth must be specified!");if(s.internalFormat=_(s),s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,s.internalFormat,s.hasMipmap,e,r,n),c(i)){if(!x(s.internalFormat))throw new t("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(i,s.internalFormat,l)}else this._texImage(l,0,s.internalFormat,e,r,n,i),o(a),s.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),o(a),s.context.bindTexture(p,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=a.TEXTURE_CUBE_MAP_POSITIVE_X;e<=a.TEXTURE_CUBE_MAP_NEGATIVE_Z;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=_(r);const s=g(e),{width:a,height:n,depth:p}=E(t);r.width&&r.height,r.width||(r.width=a),r.height||(r.height=n),s&&r.depth,s&&(r.depth=p),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,a,n,p),this._texImage(e,0,r.internalFormat,a,n,p,t),o(i),r.hasMipmap&&(this.generateMipmap(),o(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,p=M(i,s,o,a),l=Math.min(p,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,h.MAX_LEVEL,l),this._forEachMipmapLevel(((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)}),l)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!A(i)&&!b(i)&&!w(i))throw new t("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const p=r?M(e,s,o,a):1;if(g(e)){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");n.texStorage3D(e,p,i,s,o,a)}else n.texStorage2D(e,p,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=g(e),{isImmutable:h,pixelFormat:m,dataType:d}=this._descriptor;if(h){if(null!=n){const r=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texSubImage3D(e,i,0,0,0,s,o,a,m,d,r)}else p.texSubImage2D(e,i,0,0,s,o,m,d,r)}}else{const h=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texImage3D(e,i,r,s,o,a,0,m,d,h)}else p.texImage2D(e,i,r,s,o,0,m,d,h)}}_compressedTexImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=g(e);if(this._descriptor.isImmutable){if(null!=n)if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else p.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexImage3D(e,i,r,s,o,a,0,n)}else p.compressedTexImage2D(e,i,r,s,o,0,n)}async _compressOnWorker(t){const{context:i,compressionHandle:o,compressionCallback:a,flipped:n,preMultiplyAlpha:p,hasMipmap:l}=this._descriptor,{compressedTextureETC:h,compressedTextureS3TC:m}=i.capabilities;if(!e.compressionWorkerHandle?.isCompressible(t)||!h&&!m)return;this.abortCompression();const d=new AbortController;this._compressionAbortController=d,o.increment();try{const i=await createImageBitmap(t,{imageOrientation:n?"flipY":"none"});r(d);const s={bitmap:i,width:t.width,height:t.height,preMultiplyAlpha:p,hasMipmap:l,hasETC:!!h,hasS3TC:!!m},o=await e.compressionWorkerHandle.invoke(s,d.signal);r(d),o&&this.hasWebGLTextureObject&&(this._descriptor.internalFormat=o.internalFormat,this._setData(o.compressedTexture),a?.())}catch(c){s(c)||R().error("Texture compression failed!")}finally{o.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null)}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:o,hasMipmap:n,target:p}=this._descriptor;const l=p===a.TEXTURE_3D;if(null==r||null==s||l&&null==o)throw new t("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,o),n&&(1!==r||1!==s||l&&1!==o)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),l&&(o=Math.max(1,o>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;i===l.LINEAR_MIPMAP_NEAREST||i===l.LINEAR_MIPMAP_LINEAR?(i=l.LINEAR,t.hasMipmap||(r=l.LINEAR)):i!==l.NEAREST_MIPMAP_NEAREST&&i!==l.NEAREST_MIPMAP_LINEAR||(i=l.NEAREST,t.hasMipmap||(r=l.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),o(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};export{D as Texture,I as tracer};
|
|
5
|
+
import t from"../../core/Error.js";import"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{throwIfAborted as r,isAbortError as s}from"../../core/promiseUtils.js";import{checkWebGLError as o}from"./checkWebGLError.js";import{TextureType as a,ResourceType as n,CompressedTextureFormat as p,TextureSamplingMode as l,TextureConstants as h,PixelFormat as m}from"./enums.js";import{FBOAttachmentType as d}from"./FBOAttachmentType.js";import{estimateMemory as c}from"./TextureDescriptor.js";import{isCompressedData as _,deriveInternalFormat as u,isTexImageSource as g,is3DTarget as T,validateTexture as x,isCompressedFormat as E,getDimensions as M,calcMipmapLevels as A,isSizedPixelFormat as b,isSizedDepthFormat as f,isSizedDepthStencilFormat as w}from"./textureUtils.js";import{ValidatedTextureDescriptor as I}from"./ValidatedTextureDescriptor.js";const R=null,D=()=>e.getLogger("esri/views/webgl/Texture");let S=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,i=null,r=null){if(this.type=d.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=i;else{const r=I.validate(e,i);if(!r)throw new t("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}this._descriptor.target===a.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return c(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this._descriptor.context.gl&&this.hasWebGLTextureObject&&(this._descriptor.context.instanceCounter.decrement(n.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=i,this._descriptor.target===a.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t,e){this._descriptor.compressionHandle=t,this._descriptor.compressionCallback=e}disableCompression(){this._descriptor.compressionHandle=null,this._descriptor.compressionCallback=null}setData(t){this.abortCompression(),!_(t)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in p&&(this._descriptor.internalFormat=void 0),this._setData(t),!_(t)&&this._descriptor.compressionHandle&&this._compressOnWorker(t)}updateData(i,r,s,o,a,n,p=0){n||D().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||D().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=u(l);const{context:h,pixelFormat:m,dataType:d,target:c,isImmutable:T}=l;if(T&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");const x=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||s<0||r+o>l.width||s+a>l.height)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:E}=h;p&&(o&&a||D().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),E.pixelStorei(E.UNPACK_SKIP_ROWS,p)),g(n)?E.texSubImage2D(c,i,r,s,o,a,m,d,n):_(n)?E.compressedTexSubImage2D(c,i,r,s,o,a,l.internalFormat,n.levels[i]):E.texSubImage2D(c,i,r,s,o,a,m,d,n),p&&E.pixelStorei(E.UNPACK_SKIP_ROWS,0),h.bindTexture(x,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(i,r,s,o,a,n,p,l){l||D().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||D().error("An attempt to update an uninitialized texture!");const h=this._descriptor;h.internalFormat=u(h);const{context:m,pixelFormat:d,dataType:c,isImmutable:g,target:x}=h;if(g&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");T(x)||D().warn("Attempting to set 3D texture data on a non-3D texture");const E=m.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);m.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||s<0||o<0||r+a>h.width||s+n>h.height||o+p>h.depth)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=m;if(_(l))l=l.levels[i],M.compressedTexSubImage3D(x,i,r,s,o,a,n,p,h.internalFormat,l);else{const t=l;M.texSubImage3D(x,i,r,s,o,a,n,p,d,c,t)}m.bindTexture(E,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const i=this._descriptor;if(0===i.width||0===i.height)return;if(!i.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");i.hasMipmap=!0,this._samplingModeDirty=!0,x(i)}i.samplingMode===l.LINEAR?(this._samplingModeDirty=!0,i.samplingMode=l.LINEAR_MIPMAP_NEAREST):i.samplingMode===l.NEAREST&&(this._samplingModeDirty=!0,i.samplingMode=l.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(i.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,x(e)}e.samplingMode===l.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=l.LINEAR):e.samplingMode===l.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=l.NEAREST)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,x(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=t,this._descriptor.compareEnabled=t,this.setSamplingMode(t?l.LINEAR:l.NEAREST),x(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=i(this._compressionAbortController)}_setData(i,r){const s=this._descriptor,a=s.context?.gl;if(!a)return;o(a),this.hasWebGLTextureObject||(this._glName=a.createTexture(),s.context.instanceCounter.increment(n.Texture,this)),x(s);const p=s.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);s.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),o(a);const l=r??s.target,h=T(l);if(g(i))this._setDataFromTexImageSource(i,l);else{const{width:e,height:r,depth:n}=s;if(null==e||null==r)throw new t("texture:missing-size","Width and height must be specified!");if(h&&null==n)throw new t("texture:missing-depth","Depth must be specified!");if(s.internalFormat=u(s),s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,s.internalFormat,s.hasMipmap,e,r,n),_(i)){if(!E(s.internalFormat))throw new t("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(i,s.internalFormat,l)}else this._texImage(l,0,s.internalFormat,e,r,n,i),o(a),s.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),o(a),s.context.bindTexture(p,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=a.TEXTURE_CUBE_MAP_POSITIVE_X;e<=a.TEXTURE_CUBE_MAP_NEGATIVE_Z;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=u(r);const s=T(e),{width:a,height:n,depth:p}=M(t);r.width&&r.height,r.width||(r.width=a),r.height||(r.height=n),s&&r.depth,s&&(r.depth=p),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,a,n,p),this._texImage(e,0,r.internalFormat,a,n,p,t),o(i),r.hasMipmap&&(this.generateMipmap(),o(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,p=A(i,s,o,a),l=Math.min(p,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,h.MAX_LEVEL,l),this._forEachMipmapLevel(((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)}),l)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!b(i)&&!f(i)&&!w(i))throw new t("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const p=r?A(e,s,o,a):1;if(T(e)){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");n.texStorage3D(e,p,i,s,o,a)}else n.texStorage2D(e,p,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=T(e),{isImmutable:h,pixelFormat:m,dataType:d}=this._descriptor;if(h){if(null!=n){const r=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texSubImage3D(e,i,0,0,0,s,o,a,m,d,r)}else p.texSubImage2D(e,i,0,0,s,o,m,d,r)}}else{const h=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texImage3D(e,i,r,s,o,a,0,m,d,h)}else p.texImage2D(e,i,r,s,o,0,m,d,h)}}_compressedTexImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=T(e);if(this._descriptor.isImmutable){if(null!=n)if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else p.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexImage3D(e,i,r,s,o,a,0,n)}else p.compressedTexImage2D(e,i,r,s,o,0,n)}async _compressOnWorker(t){const{width:i,height:o,context:a,compressionHandle:n,compressionCallback:p,flipped:l,preMultiplyAlpha:h,hasMipmap:d}=this._descriptor,{compressedTextureETC:c,compressedTextureS3TC:_}=a.capabilities;if(!e.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!c&&!_)return;this.abortCompression();const u=new AbortController;this._compressionAbortController=u,n.increment();try{let s;t instanceof Uint8Array?s=t.buffer:(s=await createImageBitmap(t,{imageOrientation:l?"flipY":"none"}),r(u));const a={data:s,width:i,height:o,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:this._descriptor.pixelFormat===m.RGBA?4:3,preMultiplyAlpha:h,hasMipmap:d,hasETC:!!c,hasS3TC:!!_},n=await e.compressionWorkerHandle.invoke(a,u.signal);if(r(u),n&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=n.internalFormat,this._setData(n.compressedTexture),p?.(t-this.usedMemory)}}catch(g){s(g)||D().error("Texture compression failed!")}finally{n.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null)}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:o,hasMipmap:n,target:p}=this._descriptor;const l=p===a.TEXTURE_3D;if(null==r||null==s||l&&null==o)throw new t("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,o),n&&(1!==r||1!==s||l&&1!==o)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),l&&(o=Math.max(1,o>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;i===l.LINEAR_MIPMAP_NEAREST||i===l.LINEAR_MIPMAP_LINEAR?(i=l.LINEAR,t.hasMipmap||(r=l.LINEAR)):i!==l.NEAREST_MIPMAP_NEAREST&&i!==l.NEAREST_MIPMAP_LINEAR||(i=l.NEAREST,t.hasMipmap||(r=l.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),o(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};export{S as Texture,R as tracer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import has from"../../core/has.js";import r from"../../core/Logger.js";import{ErrorConstant as o}from"./enums.js";const t=()=>r.getLogger("esri.views.webgl.checkWebGLError");function n(e){switch(e){case o.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case o.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case o.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case o.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case o.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case o.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!has("enable-feature:webgl-debug");function c(){return a}function u(){return a}function s(r){if(
|
|
5
|
+
import e from"../../core/Error.js";import has from"../../core/has.js";import r from"../../core/Logger.js";import{ErrorConstant as o}from"./enums.js";const t=()=>r.getLogger("esri.views.webgl.checkWebGLError");function n(e){switch(e){case o.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case o.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case o.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case o.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case o.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case o.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!has("enable-feature:webgl-debug");function c(){return a}function u(){return a}function s(r,o=c()){if(o){const o=r.getError();if(o){const r=n(o),a=(new Error).stack;t().error(new e("webgl-error","WebGL error occurred",{message:r,stack:a}))}}}export{s as checkWebGLError,n as getErrorMessage,a as hasFeatureFlagWebGLDebug,c as webglDebugEnabled,u as webglValidateShadersEnabled};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ZEROS as
|
|
5
|
+
import{ZEROS as t}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{SizedPixelFormat as e,PixelType as n,TextureSamplingMode as a,TextureWrapMode as i,PixelFormat as u}from"./enums.js";import{Texture as r}from"./Texture.js";import{TextureDescriptor as o}from"./TextureDescriptor.js";function s(t,s,m="nearest",l=!1){const f=!(l&&"u8"===s.pixelType),c=f?n.FLOAT:n.UNSIGNED_BYTE,p=null==s.pixels||0===s.pixels.length?null:f?s.getAsRGBAFloat():s.getAsRGBA(),_=t.capabilities.textureFloatLinear,g=new o;return g.width=s.width,g.height=s.height,g.internalFormat=f?e.RGBA32F:u.RGBA,g.samplingMode=!_||"bilinear"!==m&&"cubic"!==m?a.NEAREST:a.LINEAR,g.dataType=c,g.wrapMode=i.CLAMP_TO_EDGE,new r(t,g,p)}function m(t,u){const{spacing:s,offsets:m,coefficients:l,size:[f,c]}=u,p=s[0]>1,_=new o;_.width=p?4*f:f,_.height=c,_.internalFormat=e.RGBA32F,_.dataType=n.FLOAT,_.samplingMode=a.NEAREST,_.wrapMode=i.CLAMP_TO_EDGE;const g=new Float32Array(p?f*c*16:2*m.length);if(p&&null!=l)for(let e=0,n=0;e<l.length;e++)g[n++]=l[e],e%3==2&&(g[n++]=1);else for(let e=0;e<c;e++)for(let t=0;t<f;t++){const n=4*(e*f+t),a=2*(t*c+e);g[n]=m[a],g[n+1]=m[a+1],g[n+3]=-1===m[a]?0:1}return new r(t,_,g)}function l(t,e){const n=new o;return n.internalFormat=u.RGBA,n.width=e.length/4,n.height=1,n.samplingMode=a.NEAREST,n.wrapMode=i.CLAMP_TO_EDGE,new r(t,n,e)}function f(e,n,a,i=1,u=!0){return{u_flipY:u,u_applyTransform:!!e,u_opacity:i,u_transformSpacing:e?e.spacing:t,u_transformGridSize:e?e.size:t,u_targetImageSize:n,u_srcImageSize:a}}function c(t,e){return{u_colormapOffset:e||0,u_colormapMaxIndex:t?t.length/4-1:0}}function p(t){return{u_bandCount:t.bandCount,u_minOutput:t.minOutput,u_maxOutput:t.maxOutput,u_minCutOff:t.minCutOff,u_maxCutOff:t.maxCutOff,u_factor:t.factor,u_useGamma:t.useGamma,u_gamma:t.gamma,u_gammaCorrection:t.gammaCorrection}}function _(t){return{u_hillshadeType:t.hillshadeType,u_sinZcosAs:t.sinZcosAs,u_sinZsinAs:t.sinZsinAs,u_cosZs:t.cosZs,u_weights:t.weights,u_factor:t.factor,u_minValue:t.minValue,u_maxValue:t.maxValue}}export{l as createColormapTexture,s as createRasterTexture,m as createTransformTexture,c as getColormapUniforms,f as getCommonUniforms,_ as getShadedReliefUniforms,p as getStretchUniforms};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../analysis/AreaMeasurementAnalysis.js";import{deprecateUnnecessaryViewModel as s}from"../../core/deprecate.js";import i from"../../core/Logger.js";import{watch as r,syncAndInitial as n}from"../../core/reactiveUtils.js";import{measurementAreaUnits as o}from"../../core/unitUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{defaultUnitPropertyMetadata as u}from"../../properties/defaultUnit.js";import{AnalysisViewModel as p}from"../support/AnalysisViewModel.js";let d=class extends p{constructor(e){super(e),this.analysis=null,this._userUnitOptions=null,this._userUnit=null,this.supportedViewType="3d",this.unsupportedErrorMessage="AreaMeasurement3DViewModel is only supported in 3D views.",e?.isDefaultViewModel||s(i.getLogger(this),"Area Measurement 3D","arcgis-area-measurement-3d",{version:"4.33"})}initialize(){this.addHandles(r((()=>({analysis:this.analysis,unit:this.unit})),(({analysis:e,unit:t})=>{null!=e&&(e.unit=t)}),n))}get state(){return this.disabled||!this.ready?"disabled":null==this.tool?"ready":this.tool.state}get measurement(){if(null==this.tool||this.disabled||this.tool.destroyed)return null;const{analysisView:e}=this;if(null==e)return null;const{viewData:t,areaLabel:s,perimeterLengthLabel:i}=e,r=t.validMeasurement,n="euclidean"===t.mode,o=0===t.intersectingSegments.size,a=o?r?"available":"unavailable":"invalid";return{mode:n?"euclidean":"geodesic",area:{text:o&&r?s:null,state:a},perimeterLength:{text:o&&r?i:null,state:a}}}get unitOptions(){const e=this._userUnitOptions?.filter((e=>o.includes(e)));return e&&e.length>0?e:o.slice()}set unitOptions(e){this._userUnitOptions=e}get unit(){const e=this._userUnit,t=this.unitOptions;if(e&&t.includes(e))return e;const s=this.defaultUnit;return s&&t.includes(s)?s:t[0]}set unit(e){this._userUnit=e}constructAnalysis(){return new t}};e([a({type:t})],d.prototype,"analysis",void 0),e([a({readOnly:!0})],d.prototype,"state",null),e([a({readOnly:!0})],d.prototype,"measurement",null),e([a()],d.prototype,"unitOptions",null),e([a()],d.prototype,"_userUnitOptions",void 0),e([a()],d.prototype,"unit",null),e([a()],d.prototype,"_userUnit",void 0),e([a(u)],d.prototype,"defaultUnit",void 0),d=e([l("esri.widgets.AreaMeasurement3D.AreaMeasurement3DViewModel")],d);const m=d;export{m as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as t}from"../core/deprecate.js";import s from"../core/Logger.js";import{ignoreAbortErrors as i}from"../core/promiseUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import n from"./Widget.js";import a from"./AreaMeasurement3D/AreaMeasurement3DViewModel.js";import{globalCss as l}from"./support/globalCss.js";import{MeasurementWidgetContent as p}from"./support/MeasurementWidgetContent.js";import"./support/widgetUtils.js";import{messageBundle as u}from"./support/decorators/messageBundle.js";import{tsx as m}from"./support/jsxFactory.js";const d="esri-area-measurement-3d",c={base:d,newMeasurementButton:`${d}__clear-button`};let v=class extends n{constructor(e,i){super(e,i),this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.viewModel=new a({isDefaultViewModel:!0}),t(s.getLogger(this),"Area Measurement 3D","arcgis-area-measurement-3d",{version:"4.33"})}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get icon(){return"measure-area"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}render(){const{messages:e,messagesCommon:t,messagesUnits:s,unit:o,unitOptions:r,viewModel:n}=this,{active:a,measurement:u,state:d,supported:v}=n;return m("div",{"aria-label":this.messages.widgetLabel,class:this.classes(c.base,l.widget,l.panel),key:this,role:"presentation"},this.visible?m(p,{active:a,measurementItems:[{key:"direct",title:s.measures.area,value:g(u?.area)},{key:"perimeter",title:e.perimeterLength,value:g(u?.perimeterLength)}],messages:{...e,notApplicable:t.notApplicable},newMeasurementButtonClass:c.newMeasurementButton,state:d,supported:v,unit:o,unitOptions:r,onNewMeasurementClick:()=>{i(this.viewModel.start())},onUnitChange:e=>{this.unit=e}}):null)}};function g(e){return"available"===e?.state?e.text:null}e([o()],v.prototype,"view",null),e([o()],v.prototype,"visible",null),e([o()],v.prototype,"active",null),e([o({constructOnly:!0,nonNullable:!0})],v.prototype,"analysis",null),e([o()],v.prototype,"icon",null),e([o()],v.prototype,"label",null),e([o(),u("esri/widgets/AreaMeasurement3D/t9n/AreaMeasurement3D")],v.prototype,"messages",void 0),e([o(),u("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([o(),u("esri/core/t9n/Units")],v.prototype,"messagesUnits",void 0),e([o()],v.prototype,"uiStrings",void 0),e([o({type:a})],v.prototype,"viewModel",void 0),e([o()],v.prototype,"unitOptions",null),e([o()],v.prototype,"unit",null),v=e([r("esri.widgets.AreaMeasurement3D")],v);const w=v;export{w as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{createTask as t}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import r from"../../core/Error.js";import i from"../../core/Evented.js";import a from"../../core/Logger.js";import{abortMaybe as o}from"../../core/maybe.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{on as l,watch as u,sync as h,whenOnce as m}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import _ from"../../geometry/SpatialReference.js";import{system as g}from"../../time/constants.js";import{createReactiveGraphic as v}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as y}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as F}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as I}from"./expressions/ExpressionsModel.js";import{BatchFormInputs as E}from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as w}from"./inputs/support/createBatchFormInputs.js";import{NoVisibleElementCodes as M,InputVisibilityCode as x,isGroupInput as b,isFieldInput as T}from"./inputs/support/inputUtils.js";import k from"./templates/BatchFormTemplate.js";import{getLayerContingentValuesMetaData as V}from"./templates/support/contingentValuesUtils.js";import{createBatchFormTemplate as L}from"./templates/support/createBatchFormTemplate.js";let H=class extends i.EventedAccessor{constructor(e){super(e),this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new s,this.map=null,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this._arcadeExecutorProvider=new y,this._activeFormInputsByElementId=new Map,this._emptyForm=new E({inputs:[]}),this._emptyFormTemplate=new k({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new p,this._updatingHandles=new f,this._layerTemplateMap=new p,this._layerContingentValuesMap=new p,this._workingFeatures=new s,this._expressionsManager=new F({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:g}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([l((()=>this.features),"after-changes",(()=>this._prepare()),{sync:!0}),u((()=>[this.features,this.map,this.timeZone,this.editType]),(()=>{this._prepare()}),h),u((()=>this.activeForm),(()=>this._activeFormInputsByElementId.clear()),h)]),this._prepare()}destroy(){this._prepareTask=o(this._prepareTask),this._workingFeatures.destroyAll(),this._expressionsManager&&this._expressionsManager.abort(),this._reactiveGraphicLookup=new p,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get _effectiveTimeZone(){return this.timeZone??"system"}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get calculating(){return this._expressionsManager.calculating}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some((t=>t!==e))}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){for(const e of this.layers){const t=this._layerContingentValuesMap.get(e);if(t&&t.size>0)return!0}return!1}get visibleInputs(){return this.activeForm.inputs.filter((e=>e.visible))}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return M.noElements;const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case x.HIDDEN_NOT_IN_ALL_LAYERS:case x.HIDDEN_NO_DOMAIN_IN_COMMON:e.add(M.noElementsInCommon);break;case x.HIDDEN_FIELD_DEFINITION:case x.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL:case x.HIDDEN_VISIBILITY_EXPRESSION_ALL:e.add(M.allElementsHidden);break;case x.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME:case x.HIDDEN_VISIBILITY_EXPRESSION_SOME:return M.elementsHiddenInSome}return e.has(M.allElementsHidden)?M.allElementsHidden:M.noElementsInCommon}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid}get layers(){const e=new Set;return this.features.forEach((t=>{const s=t.sourceLayer??t.layer;e.add(s)})),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{})}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find((t=>t.template.elementId===e));return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(b(e)){const t=e.inputs.find((e=>!e.valid));if(t)return{input:t,groupInput:e}}if(T(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new r("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(t)}setFieldInputValue(e,t){const s=new Set(this.invalidFeatures);e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(s),this.emit("value-change",{features:e.features.toArray().map((e=>e.source)),fieldName:e.fieldName,name:"value-change",value:t})}setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new r("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);this.setFieldInputValue(s,t)}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await m((()=>!1===this.calculating));const t=this.invalidFeatures;for(const s of t)!1===e.has(s)&&this._reactiveGraphicLookup.has(s)&&(this._reactiveGraphicLookup.get(s).userChangesHaveMadeInvalid=!0)}validate(){return!1}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?w(t,new s([e]),this._expressionsManager):this._emptyForm}async _prepare(){this._prepareTask=o(this._prepareTask),this._updateWorkingFeatures(),o(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new F({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??_.WebMercator,map:this.map,timeZone:this._effectiveTimeZone}});const{layers:e}=this;if(0===e.length)return;const s=t((async t=>{try{n(t);const s=new Map;for(const t of e){const e=await V(t);if(e){const s=e.fieldGroups.flatMap((e=>e.fields));this._layerContingentValuesMap.set(t,new Set(s))}else this._layerContingentValuesMap.set(t,new Set);const r=await L(t,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this._effectiveTimeZone});this._layerTemplateMap.set(t,r),this._expressionsManager.layerExpressionsModelMap.set(t,new I({preserveFieldValuesWhenHidden:r.preserveFieldValuesWhenHidden,executorMap:r.getExpressionExecutorsForLayer(t)}));for(const t of r.elements){const{elementId:e}=t;s.has(e)?s.get(e).foldIn(t):s.set(e,t.clone())}}const r=new k({elements:Array.from(s.values())});this.sharedFormTemplate=r,this.sharedForm=w(r,this._workingFeatures,this._expressionsManager),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray())}catch(s){throw a.getLogger(this).error("Failed preparing form",s),s}}));this._updatingHandles.addPromise(s.promise),this._prepareTask=s}_updateWorkingFeatures(){this._workingFeatures.destroyAll();const{features:e}=this;if(this._reactiveGraphicLookup=new p,0!==e.length){this._workingFeatures.addMany(e.map(v));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}};e([d()],H.prototype,"_effectiveTimeZone",null),e([d({readOnly:!0})],H.prototype,"activeFeature",null),e([d()],H.prototype,"activeFeatureIndex",void 0),e([d({readOnly:!0})],H.prototype,"activeForm",null),e([d()],H.prototype,"disabled",void 0),e([d()],H.prototype,"calculating",null),e([d()],H.prototype,"editType",void 0),e([d()],H.prototype,"features",void 0),e([d()],H.prototype,"expressionEvaluationFailed",null),e([d()],H.prototype,"hasNonActiveInvalidFeatures",null),e([d()],H.prototype,"invalidFeatures",null),e([d()],H.prototype,"hasVisibleInputs",null),e([d()],H.prototype,"hasLayersWithContingentValues",null),e([d()],H.prototype,"visibleInputs",null),e([d()],H.prototype,"map",void 0),e([d()],H.prototype,"noVisibleElementsReason",null),e([d()],H.prototype,"spatialReference",void 0),e([d()],H.prototype,"submitHasBeenAttempted",void 0),e([d()],H.prototype,"timeZone",void 0),e([d()],H.prototype,"updating",null),e([d()],H.prototype,"valid",null),e([d()],H.prototype,"layers",null),e([d()],H.prototype,"mode",null),e([d()],H.prototype,"sharedForm",void 0),e([d()],H.prototype,"sharedFormTemplate",void 0),e([d()],H.prototype,"userHasChangedValues",void 0),e([d()],H.prototype,"_arcadeExecutorProvider",void 0),e([d()],H.prototype,"_prepareTask",void 0),e([d()],H.prototype,"_reactiveGraphicLookup",void 0),e([d()],H.prototype,"_layerTemplateMap",void 0),e([d()],H.prototype,"_layerContingentValuesMap",void 0),e([d()],H.prototype,"_workingFeatures",void 0),e([d()],H.prototype,"_expressionsManager",void 0),H=e([c("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],H);const j=H;export{j as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{createTask as t}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import r from"../../core/Error.js";import i from"../../core/Evented.js";import o from"../../core/Logger.js";import{abortMaybe as a}from"../../core/maybe.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{on as u,watch as l,sync as h,whenOnce as m}from"../../core/reactiveUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../core/support/UpdatingHandles.js";import f from"../../geometry/SpatialReference.js";import{system as _}from"../../time/constants.js";import{createReactiveGraphic as g}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as v}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as F}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as I}from"./expressions/ExpressionsModel.js";import{BatchFormInputs as x}from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as E}from"./inputs/support/createBatchFormInputs.js";import{NoVisibleElementCodes as w,InputVisibilityCode as M,isGroupInput as A,isFieldInput as T}from"./inputs/support/inputUtils.js";import b from"./templates/BatchFormTemplate.js";import{getLayerContingentValuesMetaData as k}from"./templates/support/contingentValuesUtils.js";import{createBatchFormTemplate as C}from"./templates/support/createBatchFormTemplate.js";let V=class extends i.EventedAccessor{constructor(e){super(e),this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new s,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCountWithComplexForms=50,this.maximumFeatureCount=2e3,this.map=null,this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this._arcadeExecutorProvider=new v,this._activeFormInputsByElementId=new Map,this._emptyForm=new x({inputs:[]}),this._emptyFormTemplate=new b({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new p,this._updatingHandles=new y,this._layerTemplateMap=new p,this._layerContingentValuesMap=new p,this._workingFeatures=new s,this._expressionsManager=new F({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:_}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([u((()=>this.features),"after-changes",(()=>this._prepare()),{sync:!0}),l((()=>[this.features,this.map,this.timeZone,this.editType]),(()=>{this._prepare()}),h),l((()=>this.activeForm),(()=>this._activeFormInputsByElementId.clear()),h)]),this._prepare()}destroy(){this._prepareTask=a(this._prepareTask),this._workingFeatures.destroyAll(),this._expressionsManager&&this._expressionsManager.abort(),this._reactiveGraphicLookup=new p,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get _effectiveTimeZone(){return this.timeZone??"system"}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get calculating(){return this._expressionsManager.calculating}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some((t=>t!==e))}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){for(const e of this.layers){const t=this._layerContingentValuesMap.get(e);if(t&&t.size>0)return!0}return!1}get visibleInputs(){return this.activeForm.inputs.filter((e=>e.visible))}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return w.noElements;const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case M.HIDDEN_NOT_IN_ALL_LAYERS:case M.HIDDEN_NO_DOMAIN_IN_COMMON:e.add(w.noElementsInCommon);break;case M.HIDDEN_FIELD_DEFINITION:case M.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL:case M.HIDDEN_VISIBILITY_EXPRESSION_ALL:e.add(w.allElementsHidden);break;case M.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME:case M.HIDDEN_VISIBILITY_EXPRESSION_SOME:return w.elementsHiddenInSome}return e.has(w.allElementsHidden)?w.allElementsHidden:w.noElementsInCommon}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid}get layers(){const e=new Set;return this.features.forEach((t=>{const s=t.sourceLayer??t.layer;e.add(s)})),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{})}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find((t=>t.template.elementId===e));return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(A(e)){const t=e.inputs.find((e=>!e.valid));if(t)return{input:t,groupInput:e}}if(T(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new r("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(t)}setFieldInputValue(e,t){const s=new Set(this.invalidFeatures);e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(s),this.emit("value-change",{features:e.features.toArray().map((e=>e.source)),fieldName:e.fieldName,name:"value-change",value:t})}setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new r("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);this.setFieldInputValue(s,t)}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await m((()=>!1===this.calculating));const t=this.invalidFeatures;for(const s of t)!1===e.has(s)&&this._reactiveGraphicLookup.has(s)&&(this._reactiveGraphicLookup.get(s).userChangesHaveMadeInvalid=!0)}validate(){return!1}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?E(t,new s([e]),this._expressionsManager):this._emptyForm}async _prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=a(this._prepareTask),this._updateWorkingFeatures(),a(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new F({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??f.WebMercator,map:this.map,timeZone:this._effectiveTimeZone}});const{layers:e}=this;if(0===e.length)return;const s=t((async t=>{try{n(t);const s=new Map;for(const t of e){const e=await k(t);if(e){const s=e.fieldGroups.flatMap((e=>e.fields));this._layerContingentValuesMap.set(t,new Set(s))}else this._layerContingentValuesMap.set(t,new Set);const r=await C(t,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this._effectiveTimeZone});this._layerTemplateMap.set(t,r);const i=r.getExpressionExecutorsForLayer(t);if(this._expressionsManager.layerExpressionsModelMap.set(t,new I({preserveFieldValuesWhenHidden:r.preserveFieldValuesWhenHidden,executorMap:i})),!this._hasAsyncArcadeExpressions)for(const t of i.keys()){const e=i.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of r.elements){const{elementId:e}=t;s.has(e)?s.get(e).foldIn(t):s.set(e,t.clone())}}if(this.hasTooManyComplexFeatures)throw new r("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new r("too-many-features","There are too many features to load into the form.");const i=new b({elements:Array.from(s.values())});this.sharedFormTemplate=i,this.sharedForm=E(i,this._workingFeatures,this._expressionsManager),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray())}catch(s){throw o.getLogger(this).error("Failed preparing form",s),s}}));this._updatingHandles.addPromise(s.promise),this._prepareTask=s}_updateWorkingFeatures(){this._workingFeatures.destroyAll();const{features:e}=this;if(this._reactiveGraphicLookup=new p,0!==e.length){this._workingFeatures.addMany(e.map(g));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}};e([c()],V.prototype,"_effectiveTimeZone",null),e([c({readOnly:!0})],V.prototype,"activeFeature",null),e([c()],V.prototype,"activeFeatureIndex",void 0),e([c({readOnly:!0})],V.prototype,"activeForm",null),e([c()],V.prototype,"disabled",void 0),e([c()],V.prototype,"calculating",null),e([c()],V.prototype,"editType",void 0),e([c()],V.prototype,"features",void 0),e([c()],V.prototype,"expressionEvaluationFailed",null),e([c()],V.prototype,"hasNonActiveInvalidFeatures",null),e([c()],V.prototype,"hasAsyncArcadeExpressions",null),e([c()],V.prototype,"_hasAsyncArcadeExpressions",void 0),e([c()],V.prototype,"invalidFeatures",null),e([c()],V.prototype,"hasVisibleInputs",null),e([c()],V.prototype,"hasLayersWithContingentValues",null),e([c()],V.prototype,"maximumFeatureCountWithComplexForms",void 0),e([c()],V.prototype,"maximumFeatureCount",void 0),e([c()],V.prototype,"visibleInputs",null),e([c()],V.prototype,"map",void 0),e([c()],V.prototype,"noVisibleElementsReason",null),e([c()],V.prototype,"readOnly",void 0),e([c()],V.prototype,"spatialReference",void 0),e([c()],V.prototype,"submitHasBeenAttempted",void 0),e([c()],V.prototype,"timeZone",void 0),e([c()],V.prototype,"updating",null),e([c()],V.prototype,"valid",null),e([c()],V.prototype,"layers",null),e([c()],V.prototype,"mode",null),e([c()],V.prototype,"sharedForm",void 0),e([c()],V.prototype,"sharedFormTemplate",void 0),e([c()],V.prototype,"userHasChangedValues",void 0),e([c()],V.prototype,"_arcadeExecutorProvider",void 0),e([c()],V.prototype,"_prepareTask",void 0),e([c()],V.prototype,"_reactiveGraphicLookup",void 0),e([c()],V.prototype,"_layerTemplateMap",void 0),e([c()],V.prototype,"_layerContingentValuesMap",void 0),e([c()],V.prototype,"_workingFeatures",void 0),e([c()],V.prototype,"_expressionsManager",void 0),V=e([d("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],V);const L=V;export{L as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import"../core/has.js";import{abortHandle as t}from"../core/handleUtils.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{watch as n,whenOnce as o}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as r}from"../layers/support/fieldUtils.js";import{isString as l}from"../support/guards.js";import d from"./Widget.js";import{getHiddenFieldsValidationErrorMessage as p,getVisibleFieldInputValidationErrorMessage as u,isElementTemplateWithInputType as c}from"./BatchAttributeForm/batchAttributeFormUtils.js";import m from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as h}from"./BatchAttributeForm/css.js";import{VisibleElements as v}from"./BatchAttributeForm/VisibleElements.js";import{InputVisibilityCode as f,isGroupInput as b,isFieldInput as _,differentValuesString as C}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as I,getIntlOptionsForField as y,prepareISOFieldValueForDateComponents as F,prepareUnixFieldValueForDateComponents as w,normalizeTimeOnlyString as x,getISOFieldValueFromDateComponents as k,getUnixFieldValueFromDateComponents as D}from"./support/dateUtils.js";import{globalCss as O}from"./support/globalCss.js";import{setFocus as M}from"./support/widgetUtils.js";import{messageBundle as T}from"./support/decorators/messageBundle.js";import{vmEvent as V}from"./support/decorators/vmEvent.js";import{tsx as S}from"./support/jsxFactory.js";import{isEmptyValue as E}from"./support/forms/formUtils.js";import{substitute as U}from"../intl/substitute.js";const R="data-element-id";let L=class extends d{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureFormMessages=null,this.readOnly=!1,this.viewModel=new m,this.visibleElements=new v,this.groupDisplay="all",this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentUpdate=this._afterDateComponentUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([n((()=>this.features),(()=>{this._dateComponentMap.clear();const e=new AbortController;o((()=>!this.viewModel.updating),e.signal).then((()=>{this._attemptFocusOnNextRender=!0})),this.addHandles(t(e))})),n((()=>this.viewModel.activeForm),(()=>{this._batchSwitchInputInitialValues.clear()}))])}loadDependencies(){return g({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get _effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}goToClosestError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),setTimeout((()=>{if(!this.domNode)return;const t=this.domNode.querySelector(`[data-element-id="${e.input.template.elementId}"]`);t&&M(t)}),10)}render(){const{status:e}=this.viewModel;return"failed"===e?this._renderErrorNotice(this.messages.formFailedToLoad):this.viewModel.expressionEvaluationFailed?this._renderErrorNotice(this.messages.expressionEvaluationFailed):this.viewModel.hasLayersWithContingentValues?this._renderErrorNotice(this.messages.unsupportedContingentValues):S("div",{class:this.classes(h.base,O.widget,O.panel)},"loaded"===e?this._renderForm():"loading"===e&&this.visibleElements.loadingIndicator?S("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null)}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:n}=e.dataset,o=this._getCalciteElementFromDateTimeTimeZonePicker(e,t);if(!o)return;const a=i(this._dateComponentMap,`${n}`,(()=>({placeholder:{date:"",time:"",timeZone:""}})));switch(a.placeholder[t]=o.placeholder??"",t){case"date":a.date=e;break;case"time":a.time=e;break;case"timeZone":a.timeZone=e,a.defaultComboboxItemElements=o.selectedItems}"timeZone"===t&&(a.defaultComboboxItemElements=o.selectedItems)}_getCalciteElementFromDateTimeTimeZonePicker(e,t){const i=e.shadowRoot;return i?"timeZone"===t?i.querySelector("calcite-combobox"):i.querySelector("calcite-input-text"):null}_updateDateTimeOrTimeZoneShadowDom(e,t){const{datePart:i,elementId:n}=e.dataset,o=this._dateComponentMap.get(`${n}`);if(!o)return;const a=this._getCalciteElementFromDateTimeTimeZonePicker(e,i);if(a)switch(i){case"date":case"time":a.placeholder=t?this.messages.differentValues:o.placeholder[i];break;case"timeZone":t?(a.value="",a.placeholder=this.messages.differentValues):(!a.selectedItems.length&&o.defaultComboboxItemElements?.length&&(a.selectedItems[0]=o.defaultComboboxItemElements[0]),a.placeholder=o.placeholder[i])}}_renderErrorNotice(e){return S("div",{class:this.classes(h.base,O.widget,O.panel)},S("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},S("div",{slot:"message"},e)))}_renderForm(){return S("form",{onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderContent())}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let n;if(!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(n=p(i,e.mode,this.messages),"batch"===this.viewModel.mode){const e=i.invalidHiddenInputs.filter((e=>e.effectiveVisibilityCode===f.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL||e.visibilityCode===f.HIDDEN_VISIBILITY_EXPRESSION_ALL));e.length>0?n+=` (${e.map((e=>e.label)).join(", ")})`:n=null}else n+=` (${i.invalidHiddenInputs.map((e=>e.label)).join(", ")})`;else if(t)return null;return n?S("calcite-notice",{class:h.noticeError,icon:!0,kind:"danger",open:!0},S("div",{slot:"message"},n)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[S("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},S("div",{slot:"message"},this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason]))];const{inputs:e}=this.viewModel.activeForm;return e.filter((e=>e.visible)).map((e=>this._renderInput(e)))}_renderInput(e){return b(e)?this._renderGroupInput(e):_(e)?this._renderLabeledField(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:n}=e,o=t.filter((e=>e.visible)),a=i.label??"";return S("calcite-block",{class:this.classes(h.group,"sequential"===this.groupDisplay?h.groupSequential:null,this.disabled?h.inputDisabled:null),collapsible:!0,description:i.description??void 0,disabled:this._effectiveDisabled,expanded:n,heading:a,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:a,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},o.map((e=>this._renderInput(e))))}_renderLabeledField(e){const{label:t,elementId:i}=e.template,{required:n,dataType:o}=e,a=n?U(this.messages.requiredFieldLabel,{name:t}):t;return S("calcite-label",{"aria-label":a,class:h.label,key:`field--${i}`},S("div",{class:h.labelTextContent,key:"labelTextContainer"},t,n?S("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==o?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:i}=e;return"date"===i?this._renderDateComponents(e,t):"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):"number"===i?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:i,submittable:n}=e,o=!n&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?u(e,t,this.messages):null;return o?S("calcite-input-message",{icon:!0,status:"invalid"},o):i?S("calcite-input-message",{class:h.description,icon:!1,status:"idle"},i):null}_renderCodedInputs({input:e,props:t}){const i=e.template.input?.type??null,n=e.codedValueOptions;switch(i){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:n.flat(),props:t});default:return this._renderComboBoxComponent({options:n,props:t,input:e})}}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===C||e.value===C)&&"batch"===this.viewModel.mode){const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[R]:t[R]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:i,options:[{name:this.messages.differentValues,value:C,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return S("calcite-switch",{...t,checked:!!c(e.template,"switch")&&e.value===e.template.input.onValue,class:h.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:i}){const{trigger:n,dropdown:o,group:a}=i;return S("calcite-dropdown",{...o,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},S("calcite-button",{...n},e===C?this.messages.differentValues:e),S("calcite-dropdown-group",{selectionMode:a.mode},t.map((t=>S("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name)))))}_renderComboBoxComponent({input:e,options:t,props:i}){const n="INSERT"===this.viewModel.editType,o=this._touchedInputs.has(e?.template?.elementId),a=n&&e.showNoValueOptionEnabled&&!o?()=>{}:i.onblur,s={...i,onblur:a};return S("calcite-combobox",{...s,selectionMode:"single",value:i.placeholder===this.messages.differentValues?C:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==C&&this._saveInput(e)}},this.renderComboboxOptionsList({input:e,options:t,props:i}))}renderComboboxOptionsList({input:e,options:t,props:i}){const[n,o]=t.map((e=>e.map((({name:e,value:t})=>S("calcite-combobox-item",{key:`#${t}`,selected:i.value===t,textLabel:e,value:`${t}`}))))),a=[...n];o.length>0&&a.push(S("calcite-combobox-item-group",{key:"unsupported",label:this.featureFormMessages.subtypes.unsupportedDomainGroupTitle},o));const s=i.placeholder===this.messages.differentValues,r=!s&&E(i.value);return e.showNoValueOptionEnabled&&a.unshift(S("calcite-combobox-item",{key:"empty-option",selected:r,textLabel:e.showNoValueLabel||this.messages.empty,value:""})),s&&a.unshift(S("calcite-combobox-item",{key:C,selected:!0,textLabel:this.messages.differentValues,value:C})),a}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const n=t.map((({name:t,value:n})=>this._renderRadioButtons({label:t,value:n,selected:n===e.value,props:i})));if(e.showNoValueOptionEnabled){const t="",o=e.showNoValueLabel||this.messages.empty,a=E(e.value);n.unshift(this._renderRadioButtons({label:o,value:t,selected:a,props:i}))}return S("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:h.inputRadioGroup,disabled:i.readOnly,key:`${i.key}-radio-group`,layout:"vertical",name:i.name,required:i.required},n,i.placeholder===this.messages.differentValues?S("calcite-label",{class:h.placeholderRadio,key:i.label,layout:"inline"},S("calcite-radio-button",{checked:!0,class:h.inputRadio,disabled:!0,name:i.placeholder,value:i.placeholder}),i.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:i,props:n}){return S("calcite-label",{class:h.inputRadioLabel,key:n.label,layout:"inline"},S("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:t,class:h.inputRadio,disabled:n.readOnly,name:n.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),i)}_renderStringComponent(e,t){const{template:i}=e;return i.field.editable?i.input&&"text-area"===i.input.type?S("calcite-text-area",{...t,class:this.classes(h.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):S("calcite-input",{...t,class:this.classes(h.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)}):this._renderReadOnlyComponent(e)}_renderNumberComponent(e,t){const i=r(e.field);return S("calcite-input-number",{...t,integer:i,type:"number",value:i&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return S("calcite-input",{...i,class:this.classes(h.fieldInput,h.inputDisabled,h.individualElement),readOnly:!0,type:"text",value:String(t??i.value??"")})}_renderDateComponents(e,t){const{type:i}=e.field;switch(i){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,I(e.field,t.value,{timeZone:e.effectiveTimeZone,...y(e.template.field)}))}}_renderDateOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range;return S("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:i,"data-date-part":"date","data-element-id":t[R],key:`${n}-date-input`,max:l(a)?a:void 0,min:l(s)?s:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:o}=t;return S("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:i,"data-date-part":"time","data-element-id":t[R],key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,key:n,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range,r=F(a),l=F(s),d=F(e.value===C?"":e.value),p=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[R]:t[R],onfocus:this._onComponentFocus};return S("div",{class:h.dateInputContainer,key:`${n}-date-time-container`},S("calcite-input-date-picker",{...u,class:i,"data-date-part":"date",key:`${n}-date-input`,max:r?.date??void 0,min:l?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:d.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),S("calcite-input-time-picker",{...u,class:i,"data-date-part":"time",key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:d.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?S("calcite-input-time-zone",{...u,class:i,"data-date-part":"timeZone",key:`${n}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:d.timeZoneOffset??"0",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,key:n,readOnly:o,min:a,max:s}=t,r=e.effectiveTimeZone,l=w(e.value===C?"":e.value,r),d=w(s,r),p=w(a,r),u=e.includeTime,c={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[R]:t[R],onfocus:this._onComponentFocus};return S("div",{class:h.dateInputContainer,key:`${n}-date-time-container`},S("calcite-input-date-picker",{...c,class:i,"data-date-part":"date",key:`${n}-date-input`,max:d?.date??void 0,min:p?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:l.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),u?S("calcite-input-time-picker",{...c,"data-date-part":"time",key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:l.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}getCommonInputProps(e){const{_effectiveDisabled:t}=this,{template:i,valid:n,value:o,minLength:a,maxLength:s,required:r,fieldName:l,editable:d,userHasChangedValue:p,range:{max:u,min:c}}=e,m=!d||t;let v=i.hint??void 0,f=!1;return o===C&&(v=this.messages.differentValues,f=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":n?"false":"true",class:this.classes(h.fieldInput,m?h.inputDisabled:null),status:!p&&!this.viewModel.submitHasBeenAttempted||n?"idle":"invalid",maxLength:s&&s>-1?s:void 0,minLength:a&&a>-1?a:void 0,key:i.elementId,label:l,name:l,max:null!=u?u:void 0,min:null!=c?c:void 0,readOnly:m,onblur:this._onComponentBlur,required:r,placeholder:v,value:f?"":o??"",[R]:i.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(R))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),n=t||i;n&&this._afterComponentCreateOrUpdate(n)}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(i.template.elementId),this._focusedFieldInput=i}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),i=this._focusedFieldInput;this._attemptFocusOnNextRender&&i===t&&(this._attemptFocusOnNextRender=!1,M(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(c(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const i of t.domain.codedValues)if(i.name===e.selectedItems[0].textContent)return i.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const i=e.value;return null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:n}=t.template;if(!t)return;const o=t?.value;if(c(t.template,"switch")&&"single"!==this.viewModel.mode){const e=i(this._batchSwitchInputInitialValues,t,(()=>t.value));this._batchSwitchInputInitialValues.set(t,null===e?o:e)}const a=this._parseValue(e,t);a!==o&&this.viewModel.setValue(n,a)}async _afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._setDateTimeTimeZoneMap(e),this._updateDateTimeOrTimeZoneShadowDom(e,t.value===C),this._afterComponentCreateOrUpdate(e)}async _afterDateComponentUpdate(e){const{value:t}=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._updateDateTimeOrTimeZoneShadowDom(e,t===C),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,n=e.field.type,o=this._dateComponentMap.get(`${i}`);if(!o)return;const a=e.effectiveTimeZone;let s=e.value===C?void 0:e.value,r=null;"date-only"===n?r=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===n?(s=x(s),r=x(t.value)):r="timestamp-offset"===n?null!=t.value?k({dateComponent:o.date,timeComponent:o.time,oldValue:s,timeZoneComponent:o.timeZone,defaultTimeZone:a}):null:null!=t.value?D({oldValue:s,dateComponent:o.date,timeZone:a,timeComponent:o.time?.value===C?void 0:o.time}):null,s!==r&&(null!==r&&t.value?this.viewModel.setValue(`${i}`,r):this.viewModel.setValue(`${i}`,null))}};e([a()],L.prototype,"activeFeatureIndex",null),e([a()],L.prototype,"disabled",null),e([a()],L.prototype,"_effectiveDisabled",null),e([a()],L.prototype,"features",null),e([a()],L.prototype,"map",null),e([a()],L.prototype,"spatialReference",null),e([a()],L.prototype,"timeZone",null),e([a()],L.prototype,"headingLevel",void 0),e([a()],L.prototype,"icon",null),e([a(),T("esri/t9n/common")],L.prototype,"messagesCommon",void 0),e([a(),T("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],L.prototype,"messages",void 0),e([a(),T("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"featureFormMessages",void 0),e([a()],L.prototype,"readOnly",void 0),e([a(),V(["value-change","submit"])],L.prototype,"viewModel",void 0),e([a({type:v,nonNullable:!0})],L.prototype,"visibleElements",void 0),e([a()],L.prototype,"groupDisplay",void 0),L=e([s("esri.widgets.BatchAttributeForm")],L);const j=L;export{j as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import"../core/has.js";import{abortHandle as t}from"../core/handleUtils.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{watch as o,whenOnce as n}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as r}from"../layers/support/fieldUtils.js";import{isString as l}from"../support/guards.js";import d from"./Widget.js";import{getHiddenFieldsValidationErrorMessage as p,getVisibleFieldInputValidationErrorMessage as u,isElementTemplateWithInputType as c}from"./BatchAttributeForm/batchAttributeFormUtils.js";import m from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as h}from"./BatchAttributeForm/css.js";import{VisibleElements as v}from"./BatchAttributeForm/VisibleElements.js";import{InputVisibilityCode as f,isGroupInput as b,isFieldInput as _,differentValuesString as C}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as y,getIntlOptionsForField as I,prepareISOFieldValueForDateComponents as F,prepareUnixFieldValueForDateComponents as w,normalizeTimeOnlyString as x,getISOFieldValueFromDateComponents as M,getUnixFieldValueFromDateComponents as O}from"./support/dateUtils.js";import{globalCss as T}from"./support/globalCss.js";import{setFocus as k}from"./support/widgetUtils.js";import{messageBundle as D}from"./support/decorators/messageBundle.js";import{vmEvent as V}from"./support/decorators/vmEvent.js";import{tsx as E}from"./support/jsxFactory.js";import{isEmptyValue as S}from"./support/forms/formUtils.js";import{substitute as U}from"../intl/substitute.js";const R="data-element-id";let L=class extends d{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureFormMessages=null,this.viewModel=new m,this.visibleElements=new v,this.groupDisplay="all",this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentUpdate=this._afterDateComponentUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([o((()=>this.features),(()=>{this._dateComponentMap.clear();const e=new AbortController;n((()=>!this.viewModel.updating),e.signal).then((()=>{this._attemptFocusOnNextRender=!0})),this.addHandles(t(e))})),o((()=>this.viewModel.activeForm),(()=>{this._batchSwitchInputInitialValues.clear()}))])}loadDependencies(){return g({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get _effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}goToClosestError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),setTimeout((()=>{if(!this.domNode)return;const t=this.domNode.querySelector(`[data-element-id="${e.input.template.elementId}"]`);t&&k(t)}),10)}render(){const{status:e}=this.viewModel;return"failed"===e?this.viewModel.hasTooManyComplexFeatures?this._renderErrorNotice(U(this.messages.formFailedToLoadTooManyComplexFeatures,{num:this.viewModel.maximumFeatureCountWithComplexForms})):this.viewModel.hasTooManyFeatures?this._renderErrorNotice(U(this.messages.formFailedToLoadTooManyFeatures,{num:this.viewModel.maximumFeatureCount})):this._renderErrorNotice(this.messages.formFailedToLoad):this.viewModel.expressionEvaluationFailed?this._renderErrorNotice(this.messages.expressionEvaluationFailed):this.viewModel.hasLayersWithContingentValues?this._renderErrorNotice(this.messages.unsupportedContingentValues):E("div",{class:this.classes(h.base,T.widget,T.panel)},"loaded"===e?this._renderForm():"loading"===e&&this.visibleElements.loadingIndicator?E("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null)}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:o}=e.dataset,n=this._getCalciteElementFromDateTimeTimeZonePicker(e,t);if(!n)return;const a=i(this._dateComponentMap,`${o}`,(()=>({placeholder:{date:"",time:"",timeZone:""}})));switch(a.placeholder[t]=n.placeholder??"",t){case"date":a.date=e;break;case"time":a.time=e;break;case"timeZone":a.timeZone=e,a.defaultComboboxItemElements=n.selectedItems}"timeZone"===t&&(a.defaultComboboxItemElements=n.selectedItems)}_getCalciteElementFromDateTimeTimeZonePicker(e,t){const i=e.shadowRoot;return i?"timeZone"===t?i.querySelector("calcite-combobox"):i.querySelector("calcite-input-text"):null}_updateDateTimeOrTimeZoneShadowDom(e,t){const{datePart:i,elementId:o}=e.dataset,n=this._dateComponentMap.get(`${o}`);if(!n)return;const a=this._getCalciteElementFromDateTimeTimeZonePicker(e,i);if(a)switch(i){case"date":case"time":a.placeholder=t?this.messages.differentValues:n.placeholder[i];break;case"timeZone":t?(a.value="",a.placeholder=this.messages.differentValues):(!a.selectedItems.length&&n.defaultComboboxItemElements?.length&&(a.selectedItems[0]=n.defaultComboboxItemElements[0]),a.placeholder=n.placeholder[i])}}_renderErrorNotice(e){return E("div",{class:this.classes(h.base,T.widget,T.panel)},E("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},E("div",{slot:"message"},e)))}_renderForm(){return E("form",{onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderContent())}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let o;if(!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(o=p(i,e.mode,this.messages),"batch"===this.viewModel.mode){const e=i.invalidHiddenInputs.filter((e=>e.effectiveVisibilityCode===f.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL||e.visibilityCode===f.HIDDEN_VISIBILITY_EXPRESSION_ALL));e.length>0?o+=` (${e.map((e=>e.label)).join(", ")})`:o=null}else o+=` (${i.invalidHiddenInputs.map((e=>e.label)).join(", ")})`;else if(t)return null;return o?E("calcite-notice",{class:h.noticeError,icon:!0,kind:"danger",open:!0},E("div",{slot:"message"},o)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[E("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},E("div",{slot:"message"},this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason]))];const{inputs:e}=this.viewModel.activeForm;return e.filter((e=>e.visible)).map((e=>this._renderInput(e)))}_renderInput(e){return b(e)?this._renderGroupInput(e):_(e)?this._renderLabeledField(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:o}=e,n=t.filter((e=>e.visible)),a=i.label??"";return E("calcite-block",{class:this.classes(h.group,"sequential"===this.groupDisplay?h.groupSequential:null,this.disabled?h.inputDisabled:null),collapsible:!0,description:i.description??void 0,disabled:this._effectiveDisabled,expanded:o,heading:a,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:a,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},n.map((e=>this._renderInput(e))))}_renderLabeledField(e){const{label:t,elementId:i}=e.template,{required:o,dataType:n}=e,a=o?U(this.messages.requiredFieldLabel,{name:t}):t;return E("calcite-label",{"aria-label":a,class:h.label,key:`field--${i}`},E("div",{class:h.labelTextContent,key:"labelTextContainer"},t,o?E("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==n?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:i}=e;return"date"===i?this._renderDateComponents(e,t):"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):"number"===i?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:i,submittable:o}=e,n=!o&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?u(e,t,this.messages):null;return n?E("calcite-input-message",{icon:!0,status:"invalid"},n):i?E("calcite-input-message",{class:h.description,icon:!1,status:"idle"},i):null}_renderCodedInputs({input:e,props:t}){const i=e.template.input?.type??null,o=e.codedValueOptions;switch(i){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:o.flat(),props:t});default:return this._renderComboBoxComponent({options:o,props:t,input:e})}}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===C||e.value===C)&&"batch"===this.viewModel.mode){const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[R]:t[R]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:i,options:[{name:this.messages.differentValues,value:C,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return E("calcite-switch",{...t,checked:!!c(e.template,"switch")&&e.value===e.template.input.onValue,class:h.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:i}){const{trigger:o,dropdown:n,group:a}=i;return E("calcite-dropdown",{...n,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},E("calcite-button",{...o},e===C?this.messages.differentValues:e),E("calcite-dropdown-group",{selectionMode:a.mode},t.map((t=>E("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name)))))}_renderComboBoxComponent({input:e,options:t,props:i}){const o="INSERT"===this.viewModel.editType,n=this._touchedInputs.has(e?.template?.elementId),a=o&&e.showNoValueOptionEnabled&&!n?()=>{}:i.onblur,s={...i,onblur:a};return E("calcite-combobox",{...s,selectionMode:"single",value:i.placeholder===this.messages.differentValues?C:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==C&&this._saveInput(e)}},this.renderComboboxOptionsList({input:e,options:t,props:i}))}renderComboboxOptionsList({input:e,options:t,props:i}){const[o,n]=t.map((e=>e.map((({name:e,value:t})=>E("calcite-combobox-item",{key:`#${t}`,selected:i.value===t,textLabel:e,value:`${t}`}))))),a=[...o];n.length>0&&a.push(E("calcite-combobox-item-group",{key:"unsupported",label:this.featureFormMessages.subtypes.unsupportedDomainGroupTitle},n));const s=i.placeholder===this.messages.differentValues,r=!s&&S(i.value);return e.showNoValueOptionEnabled&&a.unshift(E("calcite-combobox-item",{key:"empty-option",selected:r,textLabel:e.showNoValueLabel||this.messages.empty,value:""})),s&&a.unshift(E("calcite-combobox-item",{key:C,selected:!0,textLabel:this.messages.differentValues,value:C})),a}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const o=t.map((({name:t,value:o})=>this._renderRadioButtons({label:t,value:o,selected:o===e.value,props:i})));if(e.showNoValueOptionEnabled){const t="",n=e.showNoValueLabel||this.messages.empty,a=S(e.value);o.unshift(this._renderRadioButtons({label:n,value:t,selected:a,props:i}))}return E("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:h.inputRadioGroup,disabled:i.readOnly,key:`${i.key}-radio-group`,layout:"vertical",name:i.name,required:i.required},o,i.placeholder===this.messages.differentValues?E("calcite-label",{class:h.placeholderRadio,key:i.label,layout:"inline"},E("calcite-radio-button",{checked:!0,class:h.inputRadio,disabled:!0,name:i.placeholder,value:i.placeholder}),i.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:i,props:o}){return E("calcite-label",{class:h.inputRadioLabel,key:o.label,layout:"inline"},E("calcite-radio-button",{...o,afterCreate:void 0,afterUpdate:void 0,checked:t,class:h.inputRadio,disabled:o.readOnly,name:o.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),i)}_renderStringComponent(e,t){const{template:i}=e;return!i.field.editable||this.readOnly?this._renderReadOnlyComponent(e):i.input&&"text-area"===i.input.type?E("calcite-text-area",{...t,class:this.classes(h.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):E("calcite-input",{...t,class:this.classes(h.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)})}_renderNumberComponent(e,t){const i=r(e.field);return E("calcite-input-number",{...t,integer:i,type:"number",value:i&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return E("calcite-input",{...i,class:this.classes(h.fieldInput,h.inputDisabled,h.individualElement),readOnly:!0,type:"text",value:String(t??i.value??"")})}_renderDateComponents(e,t){const{type:i}=e.field;switch(i){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,y(e.field,t.value,{timeZone:e.effectiveTimeZone,...I(e.template.field)}))}}_renderDateOnlyFieldComponent(e,t){const{class:i,key:o,readOnly:n}=t,{rawMax:a,rawMin:s}=e.range;return E("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:i,"data-date-part":"date","data-element-id":t[R],key:`${o}-date-input`,max:l(a)?a:void 0,min:l(s)?s:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:i,key:o,readOnly:n}=t;return E("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:i,"data-date-part":"time","data-element-id":t[R],key:`${o}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,key:o,readOnly:n}=t,{rawMax:a,rawMin:s}=e.range,r=F(a),l=F(s),d=F(e.value===C?"":e.value),p=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:n,[R]:t[R],onfocus:this._onComponentFocus};return E("div",{class:h.dateInputContainer,key:`${o}-date-time-container`},E("calcite-input-date-picker",{...u,class:i,"data-date-part":"date",key:`${o}-date-input`,max:r?.date??void 0,min:l?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:d.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),E("calcite-input-time-picker",{...u,class:i,"data-date-part":"time",key:`${o}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:d.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?E("calcite-input-time-zone",{...u,class:i,"data-date-part":"timeZone",key:`${o}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:d.timeZoneOffset??"0",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,key:o,readOnly:n,min:a,max:s}=t,r=e.effectiveTimeZone,l=w(e.value===C?"":e.value,r),d=w(s,r),p=w(a,r),u=e.includeTime,c={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:n,[R]:t[R],onfocus:this._onComponentFocus};return E("div",{class:h.dateInputContainer,key:`${o}-date-time-container`},E("calcite-input-date-picker",{...c,class:i,"data-date-part":"date",key:`${o}-date-input`,max:d?.date??void 0,min:p?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:l.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),u?E("calcite-input-time-picker",{...c,"data-date-part":"time",key:`${o}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:l.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}getCommonInputProps(e){const{_effectiveDisabled:t}=this,{template:i,valid:o,value:n,minLength:a,maxLength:s,required:r,fieldName:l,editable:d,userHasChangedValue:p,range:{max:u,min:c}}=e,m=!d||t||this.readOnly;let v=i.hint??void 0,f=!1;return n===C&&(v=this.messages.differentValues,f=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":o?"false":"true",class:this.classes(h.fieldInput,m?h.inputDisabled:null),status:!p&&!this.viewModel.submitHasBeenAttempted||o?"idle":"invalid",maxLength:s&&s>-1?s:void 0,minLength:a&&a>-1?a:void 0,key:i.elementId,label:l,name:l,max:null!=u?u:void 0,min:null!=c?c:void 0,readOnly:m,onblur:this._onComponentBlur,required:r,placeholder:v,value:f?"":n??"",[R]:i.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(R))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(i.template.elementId),this._focusedFieldInput=i}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),i=this._focusedFieldInput;this._attemptFocusOnNextRender&&i===t&&(this._attemptFocusOnNextRender=!1,k(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(c(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const i of t.domain.codedValues)if(i.name===e.selectedItems[0].textContent)return i.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const i=e.value;return null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:o}=t.template;if(!t)return;const n=t?.value;if(c(t.template,"switch")&&"single"!==this.viewModel.mode){const e=i(this._batchSwitchInputInitialValues,t,(()=>t.value));this._batchSwitchInputInitialValues.set(t,null===e?n:e)}const a=this._parseValue(e,t);a!==n&&this.viewModel.setValue(o,a)}async _afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._setDateTimeTimeZoneMap(e),this._updateDateTimeOrTimeZoneShadowDom(e,t.value===C),this._afterComponentCreateOrUpdate(e)}async _afterDateComponentUpdate(e){const{value:t}=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._updateDateTimeOrTimeZoneShadowDom(e,t===C),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,o=e.field.type,n=this._dateComponentMap.get(`${i}`);if(!n)return;const a=e.effectiveTimeZone;let s=e.value===C?void 0:e.value,r=null;"date-only"===o?r=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===o?(s=x(s),r=x(t.value)):r="timestamp-offset"===o?null!=t.value?M({dateComponent:n.date,timeComponent:n.time,oldValue:s,timeZoneComponent:n.timeZone,defaultTimeZone:a}):null:null!=t.value?O({oldValue:s,dateComponent:n.date,timeZone:a,timeComponent:n.time?.value===C?void 0:n.time}):null,s!==r&&(null!==r&&t.value?this.viewModel.setValue(`${i}`,r):this.viewModel.setValue(`${i}`,null))}};e([a()],L.prototype,"activeFeatureIndex",null),e([a()],L.prototype,"disabled",null),e([a()],L.prototype,"_effectiveDisabled",null),e([a()],L.prototype,"features",null),e([a()],L.prototype,"map",null),e([a()],L.prototype,"spatialReference",null),e([a()],L.prototype,"timeZone",null),e([a()],L.prototype,"headingLevel",void 0),e([a()],L.prototype,"icon",null),e([a(),D("esri/t9n/common")],L.prototype,"messagesCommon",void 0),e([a(),D("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],L.prototype,"messages",void 0),e([a(),D("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"featureFormMessages",void 0),e([a()],L.prototype,"readOnly",null),e([a(),V(["value-change","submit"])],L.prototype,"viewModel",void 0),e([a({type:v,nonNullable:!0})],L.prototype,"visibleElements",void 0),e([a()],L.prototype,"groupDisplay",void 0),L=e([s("esri.widgets.BatchAttributeForm")],L);const j=L;export{j as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../analysis/DirectLineMeasurementAnalysis.js";import{watch as
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../analysis/DirectLineMeasurementAnalysis.js";import{deprecateUnnecessaryViewModel as s}from"../../core/deprecate.js";import i from"../../core/Logger.js";import{watch as r,syncAndInitial as n}from"../../core/reactiveUtils.js";import{measurementLengthUnits as o}from"../../core/unitUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{defaultUnitPropertyMetadata as u}from"../../properties/defaultUnit.js";import{AnalysisViewModel as p}from"../support/AnalysisViewModel.js";let c=class extends p{constructor(t){super(t),this.analysis=null,this._userUnitOptions=null,this._userUnit=null,this.supportedViewType="3d",this.unsupportedErrorMessage="DirectLineMeasurement3DViewModel is only supported in 3D views.",t?.isDefaultViewModel||s(i.getLogger(this),"Directline Measurement 3D","arcgis-directline-measurement-3d",{version:"4.33"})}initialize(){this.addHandles(r((()=>({analysis:this.analysis,unit:this.unit})),(({analysis:t,unit:e})=>{null!=t&&(t.unit=e)}),n))}get state(){return this.disabled||!this.ready?"disabled":null==this.tool?"ready":this.tool.state}get measurement(){const{tool:t}=this;if(null==t)return null;const e=()=>({text:null,state:"unavailable"}),s=t=>({text:t,state:"available"}),{analysisViewData:i}=t,r=null!=i.result;return{mode:i.result?.mode??"euclidean",directDistance:r&&"euclidean"===i.actualVisualizedMeasurement?s(i.directLabelText):e(),horizontalDistance:r?s(i.horizontalLabelText):e(),verticalDistance:r?s(i.verticalLabelText):e()}}get unitOptions(){const t=this._userUnitOptions?.filter((t=>o.includes(t)));return t&&t.length>0?t:o.slice()}set unitOptions(t){this._userUnitOptions=t}get unit(){const t=this._userUnit,e=this.unitOptions;if(t&&e.includes(t))return t;const s=this.defaultUnit;return s&&e.includes(s)?s:e[0]}set unit(t){this._userUnit=t}constructAnalysis(){return new e}};t([l({type:e})],c.prototype,"analysis",void 0),t([l({readOnly:!0})],c.prototype,"state",null),t([l({readOnly:!0})],c.prototype,"measurement",null),t([l()],c.prototype,"unitOptions",null),t([l()],c.prototype,"_userUnitOptions",void 0),t([l()],c.prototype,"unit",null),t([l()],c.prototype,"_userUnit",void 0),t([l(u)],c.prototype,"defaultUnit",void 0),c=t([a("esri.widgets.DirectLineMeasurement3D.DirectLineMeasurement3DViewModel")],c);const d=c;export{d as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as t}from"../core/deprecate.js";import s from"../core/Logger.js";import{ignoreAbortErrors as i}from"../core/promiseUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import n from"./Widget.js";import l from"./DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js";import{globalCss as a}from"./support/globalCss.js";import{MeasurementWidgetContent as u}from"./support/MeasurementWidgetContent.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as m}from"./support/jsxFactory.js";const c="esri-direct-line-measurement-3d",d={base:c,newMeasurementButton:`${c}__clear-button`};let v=class extends n{constructor(e,i){super(e,i),this.messages=null,this.messagesCommon=null,this.viewModel=new l({isDefaultViewModel:!0}),t(s.getLogger(this),"Directline Measurement 3D","arcgis-directline-measurement-3d",{version:"4.33"})}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get icon(){return"measure-line"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}render(){const{messages:e,messagesCommon:t,unit:s,unitOptions:o,viewModel:r}=this,{active:n,measurement:l,state:p,supported:c}=r;return m("div",{"aria-label":this.messages.widgetLabel,class:this.classes(d.base,a.widget,a.panel),key:this,role:"presentation"},this.visible?m(u,{active:n,measurementItems:[{key:"direct",title:e.direct,value:g(l?.directDistance)},{key:"horizontal",title:e.horizontal,value:g(l?.horizontalDistance)},{key:"vertical",title:e.vertical,value:g(l?.verticalDistance)}],messages:{...e,notApplicable:t?.notApplicable},newMeasurementButtonClass:d.newMeasurementButton,state:p,supported:c,unit:s,unitOptions:o,onNewMeasurementClick:()=>{i(this.viewModel.start())},onUnitChange:e=>{this.unit=e}}):null)}};function g(e){return"available"===e?.state?e.text:null}e([o()],v.prototype,"view",null),e([o()],v.prototype,"visible",null),e([o()],v.prototype,"active",null),e([o({constructOnly:!0,nonNullable:!0})],v.prototype,"analysis",null),e([o()],v.prototype,"icon",null),e([o()],v.prototype,"label",null),e([o(),p("esri/widgets/DirectLineMeasurement3D/t9n/DirectLineMeasurement3D")],v.prototype,"messages",void 0),e([o(),p("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([o()],v.prototype,"uiStrings",void 0),e([o({type:l})],v.prototype,"viewModel",void 0),e([o()],v.prototype,"unitOptions",null),e([o()],v.prototype,"unit",null),v=e([r("esri.widgets.DirectLineMeasurement3D")],v);const w=v;export{w as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{floatEqualUlp as e,lerp as t}from"../../../core/mathUtils.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as r}from"../../../core/unitUtils.js";import{distance as s,lerp as o}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{m as a}from"../../../chunks/vec32.js";import i from"../../../geometry/Polyline.js";import{initializeProjection as c,project as u}from"../../../geometry/projection.js";import l from"../../../geometry/SpatialReference.js";import{geodesicLengths as f,isSupported as h,inverseGeodeticSolver as p,directGeodeticSolver as m}from"../../../geometry/support/geodesicUtils.js";import{getElevationOffset as d}from"../../../support/elevationInfoUtils.js";import{ProfileGenerationError as g,ProfileGenerationErrorCause as w}from"./ProfileGenerationError.js";async function R(e,t,s,o,a,i,h){let p,m,d;const R=e.spatialReference,v=R.isGeographic||R.isWebMercator;let P=0;if(!v){const{execute:t}=await import("../../../geometry/operators/lengthOperator.js");n(h),P=
|
|
5
|
+
import{floatEqualUlp as e,lerp as t}from"../../../core/mathUtils.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as r}from"../../../core/unitUtils.js";import{distance as s,lerp as o}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{m as a}from"../../../chunks/vec32.js";import i from"../../../geometry/Polyline.js";import{initializeProjection as c,project as u}from"../../../geometry/projection.js";import l from"../../../geometry/SpatialReference.js";import{geodesicLengths as f,isSupported as h,inverseGeodeticSolver as p,directGeodeticSolver as m}from"../../../geometry/support/geodesicUtils.js";import{getElevationOffset as d}from"../../../support/elevationInfoUtils.js";import{ProfileGenerationError as g,ProfileGenerationErrorCause as w}from"./ProfileGenerationError.js";async function R(e,t,s,o,a,i,h){let p,m,d;const R=e.spatialReference,v=R.isGeographic||R.isWebMercator;let P=0;if(!v){const{execute:t}=await import("../../../geometry/operators/lengthOperator.js");n(h),P=t(e,{unit:"meters"}),n(h)}const Z=1/r(o);if(v){await c([{source:R,dest:o},{source:R,dest:l.WGS84}],h);const n=T(e);p=f([n],"meters")[0];const r=y(p,a);if(I(e,p,r)>i)throw new g(w.TooComplex);const v=j(n,t,s);({densifiedPath:m,distances:d}=U(v,r,Z)),m=u(m,o)}else{await c([{source:R,dest:o}],h),p=P;const r=y(p,a);if(I(e,p,r)>i)throw new g(w.TooComplex);const l=j(e,t,s);({densifiedPath:m,distances:d}=A(l,r,Z)),n(h),m=u(m,o)}return{densifiedPath:m,pathLength:p*Z,distances:d}}function y(e,t){const n=e/t.densificationMaxSamples;return Math.max(t.samplingDistance,n)}function j(e,t,n){if(null==t)return Z(e);const r=e.spatialReference,s=t.mode,o=d(t,r);let a=null;switch(n.type){case"2d":a=v(e,s,o);break;case"3d":a=P(e,s,o,n)}return null==a?Z(e):new i({hasZ:!0,hasM:!1,spatialReference:r,paths:x(e.paths,a)})}function v({hasZ:e},t,n){return"absolute-height"===t?e?([e,t,r])=>[e,t,r+n]:([e,t])=>[e,t,n]:null}function P({spatialReference:e,hasZ:t},n,r,{elevationProvider:s}){const o=(t,n,r,o)=>s?.getElevation(t,n,r,e,o)??0;switch(n){case"on-the-ground":return([e,t])=>[e,t,o(e,t,0,"ground")];case"absolute-height":return t?([e,t,n])=>[e,t,n+r]:([e,t])=>[e,t,r];case"relative-to-ground":return t?([e,t,n])=>[e,t,n+o(e,t,n,"ground")+r]:([e,t])=>[e,t,o(e,t,0,"ground")+r];case"relative-to-scene":return t?([e,t,n])=>[e,t,n+o(e,t,n,"scene")+r]:([e,t])=>[e,t,o(e,t,0,"scene")+r];default:return null}}function Z(e){return e.hasZ?new i({hasZ:!1,hasM:!1,spatialReference:e.spatialReference,paths:x(e.paths,(([e,t])=>[e,t]))}):e}function x(e,t){const n=e.length,r=new Array(n);for(let s=0;s<n;++s){const n=e[s],o=n.length,a=new Array(n.length);r[s]=a;for(let e=0;e<o;++e)a[e]=t(n[e])}return r}function M(e){return S(e)&&e.paths.length>0&&e.paths.every((e=>e.length>=2))}function S(e){return null!=e&&"polyline"===e.type}function b(t,n,s,o,a){const{spatialReference:c,hasZ:u}=t,l={from:null,to:null,distance:0,azimuth:0,reverseAzimuth:0,spatialReference:c,metersPerSR:r(c)},f=[],h=[];let p=0;for(let r=0;r<t.paths.length;++r){const i=t.paths[r],c=new Array,u=new Array;let m=0;for(let t=1;t<i.length;++t){const r=i[t-1],f=i[t],h=o(l,r,f);let d;for(d=m;d<h.distance&&!e(d,h.distance);d+=n)c.push(a(h,d)),u.push((p+d)*s);m=d-h.distance,p+=h.distance,c.push(f),u.push(p*s)}f[r]=c,h[r]=u}return{densifiedPath:new i({spatialReference:c,hasZ:u,paths:f}),distances:h}}function A(e,t,n){const{hasZ:r}=e;return b(e,t,n,G,r?E:C)}function U(e,t,n){const{hasZ:r}=e;return b(e,t,n,z,r?k:W)}function z(e,t,n){return e.distance=0,p(e,t,n,e.spatialReference),e.from=t,e.to=n,e}function G(e,t,n){return e.from=t,e.to=n,e.distance=s(n,t)*e.metersPerSR,e}function W({from:e,azimuth:t,spatialReference:n},r){return m([0,0],e,t,r,n)}function k({from:e,to:n,azimuth:r,distance:s,spatialReference:o},a){const i=a/s,c=[0,0,t(e[2],n[2],i)];return m(c,e,r,a,o),c}function C({from:e,to:t,distance:n},r){return o([0,0],e,t,r/n)}function E({from:e,to:t,distance:n},r){return a([0,0,0],e,t,r/n)}function T(e){return h(e.spatialReference)?e:u(e,l.WGS84)}function D(e){return e.paths.reduce(((e,t)=>e+t.length),0)}function I(e,t,n){return D(e)+Math.floor(t/n)+Math.max(0,e.paths.reduce((e=>1+e),0)-1)}export{D as countPoints,R as densifyPath,S as isPolyline,M as isValidInputPath,j as toAbsoluteHeightElevation};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import{watch as t,on as r,initial as i}from"../../../core/reactiveUtils.js";import{stripHTML as s}from"../../../core/string.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{defaultHighlightName as a,temporaryHighlightName as n}from"../../../views/support/HighlightDefaults.js";import d from"../../Widget.js";import c from"../UtilityNetworkAssociationAddAssociationViewModel.js";import{loadCalciteComponents as p}from"../../support/componentsUtils.js";import u from"../../support/FilterBuilder.js";import{globalCss as h}from"../../support/globalCss.js";import{Heading as m}from"../../support/Heading.js";import _ from"../../support/SelectionToolbar.js";import"../../support/widgetUtils.js";import{messageBundle as f}from"../../support/decorators/messageBundle.js";import{tsx as g}from"../../support/jsxFactory.js";import v from"../../support/SelectionToolbar/VisibleElements.js";import{fetchMessageBundle as y}from"../../../intl/messages.js";import{substitute as b}from"../../../intl/substitute.js";const F="esri-feature-form-utility-network-association-layers",w={base:F,header:`${F}__header`,headingContent:`${F}__heading-content`,featureObserver:`${F}__feature-observer`,filterContainer:`${F}__filter-container`,filterOptionsContainer:`${F}__filter-options-container`,filterOptionsHeader:`${F}__filter-options-header`,listContainer:`${F}__list-container`,spatialSelectContainer:`${F}__spatial-select-container`,spatialSelectToolbar:`${F}__spatial-select-toolbar`,stickySpinnerContainer:`${F}__sticky-loading-container`,loadingContainer:`${F}__loading-container`};let C=class extends d{constructor(e,t){super(e,t),this.headingLevel=5,this.messagesCommon=null,this.messagesEditor=null,this.messagesFeature=null,this.messagesFeatureForm=null,this.messagesFilterBuilder=null,this.viewModel=new c,this.view=null,this._filterBuilder=new u,this._featureFilterText="",this._layerFilterText="",this._observer=new IntersectionObserver((([e])=>{e?.isIntersecting&&this._increaseFeaturePage()}),{root:window.document}),this._observerNode=null,this._selectionToolbar=new _({layerViewPreferenceEnabled:!1,visibleElements:new v({chip:!1,pan:!1,pointTool:!1})}),this._handleSelectionComplete=async e=>{const{highlightHelper:t}=this.viewModel;await this.viewModel.handleSelectionComplete(e),t?.removeAll(),this._featureSpatialGraphics.length>0&&t?.add(this._featureSpatialGraphics)}}initialize(){this._setupSelectionToolbar(),this.addHandles([t((()=>this.viewModel),(()=>this.reset())),t((()=>[this.viewModel.state,this._observerNode]),(()=>this._onObserverChange())),t((()=>this.selectedLayer),(e=>{this._filterBuilder.layer=e,e||(this.filterOptionsVisible=!1,this._featureFilterText="")}))])}loadDependencies(){return p({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._filterBuilder.destroy(),this._selectionToolbar.destroy()}get filterOptionsVisible(){return this.viewModel.filterOptionsVisible}set filterOptionsVisible(e){this.viewModel.filterOptionsVisible=e}get selectedLayer(){return this.viewModel.selectedLayer}set selectedLayer(e){this.viewModel.selectedLayer=e}get selectedFeature(){return this.viewModel.selectedFeature}set selectedFeature(e){this.viewModel.selectedFeature=e}get filterWhereClause(){return this.viewModel.filterWhereClause}set filterWhereClause(e){this.viewModel.filterWhereClause=e,e||this._filterBuilder.reset()}get _featureSpatialGraphics(){return this.viewModel.featureSpatialItems.toArray().map((e=>e.feature))}get _filteredFeatureItems(){const{_featureFilterText:e}=this,{featureItems:t,featureSpatialItems:r}=this.viewModel;return(r.length?r:t).map((e=>({label:e.label,graphic:e.feature,layer:e.feature.sourceLayer}))).filter((t=>t.label?.toLowerCase().includes(e)??!1))}get _filteredFeatureItemsPage(){const{featurePage:e,featuresPerPage:t}=this.viewModel,r=e*t;return this._filteredFeatureItems.toArray().slice(0,r)}render(){return g("div",{class:this.classes(w.base,h.widget)},this._renderContent())}applyFilterOptions(){const{selectedLayer:e}=this;this.filterOptionsVisible=!1,e&&(this.filterWhereClause=this._filterBuilder.whereClause)}reset(){this.filterWhereClause=null,this._featureFilterText="",this._layerFilterText="",this.filterOptionsVisible=!1,this._filterBuilder.reset()}_setupSelectionToolbar(){const{_selectionToolbar:e}=this;e.defaultRectangleToolOptions={...e.defaultRectangleToolOptions,persistSelection:!1,selectOnComplete:!0},e.defaultLassoToolOptions={...e.defaultLassoToolOptions,persistSelection:!1,selectOnComplete:!0};const s={createTool:"point",mode:"click",toolName:"",icon:"cursor",toolKey:"point",persistSelection:!1,selectOnComplete:!0};y("esri/widgets/Editor/t9n/Editor").then((t=>{e.toolConfigs=[{...s,toolName:t.selectFeature}]})),this.addHandles([t((()=>this.view),(e=>{this.viewModel.reset(),this._selectionToolbar.view="2d"===e?.type?e:null}),i),t((()=>[this.viewModel,this.viewModel.layerItems.length]),(()=>this._selectionToolbar.sources=this.viewModel.layerItems.toArray())),r((()=>this._selectionToolbar),"complete",this._handleSelectionComplete)])}async _onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);const{state:e}=this.viewModel;this._observerNode&&"ready"===e&&this._observer.observe(this._observerNode)}_increaseFeaturePage(){const{featureCount:e,featurePage:t,featureSpatialItems:r,state:i}=this.viewModel;e||r.length||1===t?"ready"===i&&this.viewModel.featurePage++:this.viewModel.featurePage=1}_renderContent(){const{state:e,filterOptionsVisible:t}=this.viewModel;return"loading"===e?this._renderLoading():t?this._renderFilterOptions():[this._renderSelectionToolbar(),this._renderListContent()]}_renderListContent(){return this._selectionToolbar.activeOperation?.processingFinalSelection?this._renderLoading():this.selectedLayer||this.viewModel.featureSpatialItems.length?this._renderFeatures():this._renderLayers()}_renderSelectionToolbar(){const{messagesCommon:e,_selectionToolbar:t}=this,{featureSpatialItems:r,selectedLayer:i}=this.viewModel;if(i||!t.sources?.length)return null;const s=g("div",{class:w.spatialSelectToolbar},t.render()),o=g("calcite-button",{appearance:"transparent",disabled:!r.length,label:e.clear,onclick:()=>this.viewModel.reset()},e.clear);return g("div",{class:w.spatialSelectContainer,key:"spatial-select-toolbar"},s,o)}_renderStickyLoading(){return"querying"===this.viewModel.state?g("div",{class:w.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoading(){return g("div",{class:w.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return g("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderFilterOptions(){return g("div",{class:w.filterOptionsContainer},g("div",{class:w.filterOptionsHeader},g("span",null,this.messagesFilterBuilder.widgetLabel),g("calcite-button",{appearance:"transparent",onclick:()=>this._filterBuilder.reset()},this.messagesCommon.clear)),this._filterBuilder.render())}_renderLayers(){const e=this.messagesFeatureForm.associations,t=e.availableLayers,r=e.filterLayers;return g("div",null,this._renderHeader({heading:t,placeholder:r,renderFilterOptions:!1,renderTotal:!1}),g("div",{class:w.listContainer},g("calcite-list",{label:e.associatedFeatures},this._renderLayerItems(),this._renderStickyLoading())))}_renderLayerItems(){const{_layerFilterText:e,viewModel:t,messagesCommon:r}=this,{layerItems:i,tableItems:s}=t;return i.concat(s).map((e=>({label:e.title??r.untitled,layer:e}))).filter((t=>t.label?.toLowerCase().includes(e)??!1)).toArray().map((e=>this._renderLayerItem(e)))}_renderLayerItem(e){const{label:t,layer:r}=e;return g("calcite-list-item",{key:`layer-item-${r.id}`,label:s(t),onCalciteListItemSelect:()=>{this.selectedLayer=r,this._filterBuilder.reset()}},g("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderFeatures(){const{selectedLayer:e,viewModel:t}=this,r=t.featureSpatialItems.length>0,i=this.messagesFeatureForm.associations,s=e?.title??this.messagesCommon.untitled,o=i.filterFeatures;return g("div",null,this._renderHeader({heading:s,placeholder:o,renderFilterOptions:!r,renderTotal:!0}),g("div",{class:w.listContainer},g("calcite-list",{label:i.associatedFeatures},this._renderFeatureItems(),this._renderStickyLoading(),this._renderFeatureObserver())))}_renderFeatureItems(){return this._filteredFeatureItemsPage.map((e=>this._renderFeatureItem(e)))}_renderFeatureItem(e){const{viewModel:t}=this,{highlightHelper:r}=t,{label:i,graphic:o}=e,l=t.featureSpatialItems.length>0?()=>r?.update(o,a):void 0,d=t.featureSpatialItems.length>0?()=>r?.update(o,n):void 0;return g("calcite-list-item",{key:`feature-item-${o.uid}`,label:s(i),onmouseenter:l,onmouseleave:d,onCalciteListItemSelect:()=>{this.selectedFeature={feature:o,label:i}}},g("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_onObserverCreate(e){this._observerNode=e}_renderFeatureObserver(){return g("div",{afterCreate:this._onObserverCreate,bind:this,class:w.featureObserver,key:"feature-observer"})}_renderHeader(e){return g("div",{class:w.header,key:"filter"},this._renderHeading(e.heading),this._renderFilter(e.placeholder,e.renderFilterOptions),e.renderTotal?this._renderTotal():null)}_renderHeading(e){return e?g(m,{key:"title",level:this.headingLevel},g("div",{class:w.headingContent},g("calcite-icon",{icon:"layer"}),e)):null}_renderFilter(e,t){const r=!this.selectedLayer&&!this.viewModel.featureSpatialItems.length,i=r?this._layerFilterText:this._featureFilterText;return g("div",{class:w.filterContainer,key:"filter"},g("calcite-input",{icon:"search",placeholder:e,type:"search",value:i,onCalciteInputInput:e=>{r?this._layerFilterText=e.currentTarget.value.trim().toLowerCase():this._featureFilterText=e.currentTarget.value.trim().toLowerCase()}},t?this._renderFilterOptionsAction():null))}_renderFilterOptionsAction(){const e=this.messagesFeatureForm.associations.filterOptions;return g("calcite-action",{appearance:"transparent",icon:"sliders",indicator:!!this._filterBuilder.whereClause,onclick:()=>{this.viewModel.filterOptionsVisible=!this.viewModel.filterOptionsVisible},scale:"s",slot:"action",text:e,title:e})}_renderTotal(){const{messagesFeature:e,viewModel:t}=this,{featureCount:r,featureSpatialItems:i}=t,s=b(e.numberRecords,{number:i.length?i.length:r});return g("div",{key:"total"},s)}};e([o()],C.prototype,"filterOptionsVisible",null),e([o()],C.prototype,"headingLevel",void 0),e([o(),f("esri/t9n/common")],C.prototype,"messagesCommon",void 0),e([o(),f("esri/widgets/Editor/t9n/Editor")],C.prototype,"messagesEditor",void 0),e([o(),f("esri/widgets/Feature/t9n/Feature")],C.prototype,"messagesFeature",void 0),e([o(),f("esri/widgets/FeatureForm/t9n/FeatureForm")],C.prototype,"messagesFeatureForm",void 0),e([o(),f("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],C.prototype,"messagesFilterBuilder",void 0),e([o()],C.prototype,"selectedLayer",null),e([o({type:c})],C.prototype,"viewModel",void 0),e([o()],C.prototype,"selectedFeature",null),e([o()],C.prototype,"filterWhereClause",null),e([o()],C.prototype,"view",void 0),e([o()],C.prototype,"_filterBuilder",void 0),e([o()],C.prototype,"_featureFilterText",void 0),e([o()],C.prototype,"_layerFilterText",void 0),e([o()],C.prototype,"_observer",void 0),e([o()],C.prototype,"_featureSpatialGraphics",null),e([o()],C.prototype,"_filteredFeatureItems",null),e([o()],C.prototype,"_filteredFeatureItemsPage",null),e([o()],C.prototype,"_observerNode",void 0),C=e([l("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationItemList")],C);const L=C;export{L as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import{watch as t,on as i,initial as r}from"../../../core/reactiveUtils.js";import{stripHTML as s}from"../../../core/string.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{defaultHighlightName as a,temporaryHighlightName as n}from"../../../views/support/HighlightDefaults.js";import c from"../../Widget.js";import d from"../UtilityNetworkAssociationAddAssociationViewModel.js";import{loadCalciteComponents as p}from"../../support/componentsUtils.js";import u from"../../support/FilterBuilder.js";import{globalCss as h}from"../../support/globalCss.js";import{Heading as m}from"../../support/Heading.js";import _ from"../../support/SelectionToolbar.js";import"../../support/widgetUtils.js";import{messageBundle as f}from"../../support/decorators/messageBundle.js";import{tsx as v}from"../../support/jsxFactory.js";import g from"../../support/SelectionToolbar/VisibleElements.js";import{substitute as y}from"../../../intl/substitute.js";const b="esri-feature-form-utility-network-association-layers",F={base:b,header:`${b}__header`,headingContent:`${b}__heading-content`,featureObserver:`${b}__feature-observer`,filterContainer:`${b}__filter-container`,filterOptionsContainer:`${b}__filter-options-container`,filterOptionsHeader:`${b}__filter-options-header`,listContainer:`${b}__list-container`,spatialSelectContainer:`${b}__spatial-select-container`,spatialSelectToolbar:`${b}__spatial-select-toolbar`,stickySpinnerContainer:`${b}__sticky-loading-container`,loadingContainer:`${b}__loading-container`};let w=class extends c{constructor(e,t){super(e,t),this.headingLevel=5,this.messagesCommon=null,this.messagesEditor=null,this.messagesFeature=null,this.messagesFeatureForm=null,this.messagesFilterBuilder=null,this.viewModel=new d,this.view=null,this._filterBuilder=new u,this._featureFilterText="",this._layerFilterText="",this._observer=new IntersectionObserver((([e])=>{e?.isIntersecting&&this._increaseFeaturePage()}),{root:window.document}),this._observerNode=null,this._selectionToolbar=new _({layerViewPreferenceEnabled:!1,visibleElements:new g({chip:!1,pan:!1})}),this._onSelectionComplete=async e=>{const{highlightHelper:t}=this.viewModel;await this.viewModel.onSelectionComplete(e),t?.removeAll(),this._featureSpatialGraphics.length>0&&t?.add(this._featureSpatialGraphics)}}initialize(){this._setupSelectionToolbar(),this.addHandles([t((()=>this.viewModel),(()=>this.reset())),t((()=>[this.viewModel.state,this._observerNode]),(()=>this._onObserverChange())),t((()=>this.selectedLayer),(e=>{this._filterBuilder.layer=e,e||(this.filterOptionsVisible=!1,this._featureFilterText="")}))])}loadDependencies(){return p({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._filterBuilder.destroy(),this._selectionToolbar.destroy()}get filterOptionsVisible(){return this.viewModel.filterOptionsVisible}set filterOptionsVisible(e){this.viewModel.filterOptionsVisible=e}get isSelecting(){return"active"===this._selectionToolbar.state}get selectedLayer(){return this.viewModel.selectedLayer}set selectedLayer(e){this.viewModel.selectedLayer=e}get selectedFeature(){return this.viewModel.selectedFeature}set selectedFeature(e){this.viewModel.selectedFeature=e}get filterWhereClause(){return this.viewModel.filterWhereClause}set filterWhereClause(e){this.viewModel.filterWhereClause=e,e||this._filterBuilder.reset()}get _featureSpatialGraphics(){return this.viewModel.featureSpatialItems.toArray().map((e=>e.feature))}get _filteredFeatureItems(){const{_featureFilterText:e}=this,{featureItems:t,featureSpatialItems:i}=this.viewModel;return(i.length?i:t).map((e=>({label:e.label,graphic:e.feature,layer:e.feature.sourceLayer}))).filter((t=>t.label?.toLowerCase().includes(e)??!1))}get _filteredFeatureItemsPage(){const{featurePage:e,featuresPerPage:t}=this.viewModel,i=e*t;return this._filteredFeatureItems.toArray().slice(0,i)}render(){return v("div",{class:this.classes(F.base,h.widget)},this._renderContent())}applyFilterOptions(){const{selectedLayer:e}=this;this.filterOptionsVisible=!1,e&&(this.filterWhereClause=this._filterBuilder.whereClause)}cancelSelection(){this._selectionToolbar.cancel()}reset(){this.filterWhereClause=null,this._featureFilterText="",this._layerFilterText="",this.filterOptionsVisible=!1,this._filterBuilder.reset()}startSelection(e){this._selectionToolbar.activateTool(e)}_setupSelectionToolbar(){const{_selectionToolbar:e}=this;e.defaultRectangleToolOptions={...e.defaultRectangleToolOptions,persistSelection:!1},e.defaultLassoToolOptions={...e.defaultLassoToolOptions,persistSelection:!1},e.defaultPointToolOptions={...e.defaultPointToolOptions,persistSelection:!1},this.addHandles([t((()=>this.view),(e=>{this.viewModel.reset(),this._selectionToolbar.view="2d"===e?.type?e:null}),r),t((()=>[this.viewModel,this.viewModel.layerItems.length]),(()=>this._selectionToolbar.sources=this.viewModel.layerItems.toArray())),i((()=>this._selectionToolbar),"before-activate",(e=>this.emit("before-selection",e))),i((()=>this._selectionToolbar),"complete",this._onSelectionComplete)])}async _onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);const{state:e}=this.viewModel;this._observerNode&&"ready"===e&&this._observer.observe(this._observerNode)}_increaseFeaturePage(){const{featureCount:e,featurePage:t,featureSpatialItems:i,state:r}=this.viewModel;e||i.length||1===t?"ready"===r&&this.viewModel.featurePage++:this.viewModel.featurePage=1}_renderContent(){const{state:e,filterOptionsVisible:t}=this.viewModel;return"loading"===e?this._renderLoading():t?this._renderFilterOptions():[this._renderSelectionToolbar(),this._renderListContent()]}_renderListContent(){return this._selectionToolbar.activeOperation?.processingFinalSelection?this._renderLoading():this.selectedLayer||this.viewModel.featureSpatialItems.length?this._renderFeatures():this._renderLayers()}_renderSelectionToolbar(){const{messagesCommon:e,_selectionToolbar:t}=this,{featureSpatialItems:i,selectedLayer:r}=this.viewModel;if(r||!t.sources?.length)return null;const s=v("div",{class:F.spatialSelectToolbar},t.render()),o=v("calcite-button",{appearance:"transparent",disabled:!i.length,label:e.clear,onclick:()=>this.viewModel.reset()},e.clear);return v("div",{class:F.spatialSelectContainer,key:"spatial-select-toolbar"},s,o)}_renderStickyLoading(){return"querying"===this.viewModel.state?v("div",{class:F.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoading(){return v("div",{class:F.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return v("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderFilterOptions(){return v("div",{class:F.filterOptionsContainer},v("div",{class:F.filterOptionsHeader},v("span",null,this.messagesFilterBuilder.widgetLabel),v("calcite-button",{appearance:"transparent",onclick:()=>this._filterBuilder.reset()},this.messagesCommon.clear)),this._filterBuilder.render())}_renderLayers(){const e=this.messagesFeatureForm.associations,t=e.availableLayers,i=e.filterLayers;return v("div",null,this._renderHeader({heading:t,placeholder:i,renderFilterOptions:!1,renderTotal:!1}),v("div",{class:F.listContainer},v("calcite-list",{label:e.associatedFeatures},this._renderLayerItems(),this._renderStickyLoading())))}_renderLayerItems(){const{_layerFilterText:e,viewModel:t,messagesCommon:i}=this,{layerItems:r,tableItems:s}=t;return r.concat(s).map((e=>({label:e.title??i.untitled,layer:e}))).filter((t=>t.label?.toLowerCase().includes(e)??!1)).toArray().map((e=>this._renderLayerItem(e)))}_renderLayerItem(e){const{label:t,layer:i}=e;return v("calcite-list-item",{key:`layer-item-${i.id}`,label:s(t),onCalciteListItemSelect:()=>{this.selectedLayer=i,this._filterBuilder.reset()}},v("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderFeatures(){const{selectedLayer:e,viewModel:t}=this,i=t.featureSpatialItems.length>0,r=this.messagesFeatureForm.associations,s=i?void 0:e?.title||this.messagesCommon.untitled,o=r.filterFeatures;return v("div",null,this._renderHeader({heading:s,placeholder:o,renderFilterOptions:!i,renderTotal:!0}),v("div",{class:F.listContainer},v("calcite-list",{label:r.associatedFeatures},this._renderFeatureItems(),this._renderStickyLoading(),this._renderFeatureObserver())))}_renderFeatureItems(){return this._filteredFeatureItemsPage.map((e=>this._renderFeatureItem(e)))}_renderFeatureItem(e){const{viewModel:t}=this,{highlightHelper:i}=t,{label:r,graphic:o}=e,l=t.featureSpatialItems.length>0?()=>i?.update(o,a):void 0,c=t.featureSpatialItems.length>0?()=>i?.update(o,n):void 0;return v("calcite-list-item",{key:`feature-item-${o.uid}`,label:s(r),onmouseenter:l,onmouseleave:c,onCalciteListItemSelect:()=>{this.selectedFeature={feature:o,label:r}}},v("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_onObserverCreate(e){this._observerNode=e}_renderFeatureObserver(){return v("div",{afterCreate:this._onObserverCreate,bind:this,class:F.featureObserver,key:"feature-observer"})}_renderHeader(e){return v("div",{class:F.header,key:"filter"},this._renderHeading(e.heading),this._renderFilter(e.placeholder,e.renderFilterOptions),e.renderTotal?this._renderTotal():null)}_renderHeading(e){return e?v(m,{key:"title",level:this.headingLevel},v("div",{class:F.headingContent},v("calcite-icon",{icon:"layer"}),e)):null}_renderFilter(e,t){const i=!this.selectedLayer&&!this.viewModel.featureSpatialItems.length,r=i?this._layerFilterText:this._featureFilterText;return v("div",{class:F.filterContainer,key:"filter"},v("calcite-input",{icon:"search",placeholder:e,type:"search",value:r,onCalciteInputInput:e=>{i?this._layerFilterText=e.currentTarget.value.trim().toLowerCase():this._featureFilterText=e.currentTarget.value.trim().toLowerCase()}},t?this._renderFilterOptionsAction():null))}_renderFilterOptionsAction(){const e=this.messagesFeatureForm.associations.filterOptions;return v("calcite-action",{appearance:"transparent",icon:"sliders",indicator:!!this._filterBuilder.whereClause,onclick:()=>{this.viewModel.filterOptionsVisible=!this.viewModel.filterOptionsVisible},scale:"s",slot:"action",text:e,title:e})}_renderTotal(){const{messagesFeature:e,viewModel:t}=this,{featureCount:i,featureSpatialItems:r}=t,s=y(e.numberRecords,{number:r.length?r.length:i});return v("div",{key:"total"},s)}};e([o()],w.prototype,"filterOptionsVisible",null),e([o()],w.prototype,"headingLevel",void 0),e([o()],w.prototype,"isSelecting",null),e([o(),f("esri/t9n/common")],w.prototype,"messagesCommon",void 0),e([o(),f("esri/widgets/Editor/t9n/Editor")],w.prototype,"messagesEditor",void 0),e([o(),f("esri/widgets/Feature/t9n/Feature")],w.prototype,"messagesFeature",void 0),e([o(),f("esri/widgets/FeatureForm/t9n/FeatureForm")],w.prototype,"messagesFeatureForm",void 0),e([o(),f("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],w.prototype,"messagesFilterBuilder",void 0),e([o()],w.prototype,"selectedLayer",null),e([o({type:d})],w.prototype,"viewModel",void 0),e([o()],w.prototype,"selectedFeature",null),e([o()],w.prototype,"filterWhereClause",null),e([o()],w.prototype,"view",void 0),e([o()],w.prototype,"_filterBuilder",void 0),e([o()],w.prototype,"_featureFilterText",void 0),e([o()],w.prototype,"_layerFilterText",void 0),e([o()],w.prototype,"_observer",void 0),e([o()],w.prototype,"_featureSpatialGraphics",null),e([o()],w.prototype,"_filteredFeatureItems",null),e([o()],w.prototype,"_filteredFeatureItemsPage",null),e([o()],w.prototype,"_observerNode",void 0),w=e([l("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationItemList")],w);const C=w;export{C as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import o from"../../core/Collection.js";import{abortMaybe as a}from"../../core/maybe.js";import{ignoreAbortErrors as i,debounce as n}from"../../core/promiseUtils.js";import{watch as l,initial as u}from"../../core/reactiveUtils.js";import{sqlAnd as c}from"../../core/sql.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../../core/support/UpdatingHandles.js";import{isLayerFromCatalog as d}from"../../layers/catalog/catalogUtils.js";import{isSubtypeGroupLayer as g,isKnowledgeGraphLayer as _,isMapImageLayer as m,isSubtypeSublayer as f}from"../../layers/support/layerUtils.js";import{isAssociatedFeatureSupportedLayer as b}from"../Feature/support/featureUtils.js";import{createAssociation as C}from"../support/UtilityNetworkAssociations/utils/createAssociation.js";import{getFeatureTitle as F}from"../support/UtilityNetworkAssociations/utils/getFeatureTitle.js";const A=100,q="association-key";let w=class extends r{constructor(e){super(e),this.graphic=null,this.layer=null,this.map=null,this.utilityNetwork=null,this.associationType=null,this.featureCount=0,this.featureSpatialItems=new o,this.highlightHelper=null,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=30,this.selectedFeature=null,this.association=null,this.filterOptionsVisible=!1,this.filterWhereClause=null,this._rulesTable=null,this._canAssociate=!1,this._whereClause=null,this._setUpItemsTask=null,this._updatingHandlesSetUp=new p,this._queryFeaturesTask=null,this._updatingHandlesQueryFeatures=new p,this._validateAssociationTask=null,this._updatingHandlesAssociation=new p,this._featureIsNotSelected=e=>(this.globalIdField?e.attributes?.[this.globalIdField]??null:null)!==this.globalId,this._cancelQuery=()=>{const{_queryAbortController:e}=this;e&&e.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:e}=this;e&&e.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:e}=this;e&&e.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await i(this._query()).catch((()=>this._cancelQuery())),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async e=>{this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await i(this._queryFeatureCount(e)).catch((()=>this._cancelQueryFeatureCount())),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null)},this._queryPageController=async()=>{const e=new AbortController;this._queryPageAbortController=e,await i(this._queryPage()).catch((()=>this._cancelQueryPage())),this._queryPageAbortController===e&&(this._queryPageAbortController=null)},this._queryDebounced=n(this._queryController,A),this._queryFeatureCountDebounced=n(this._queryFeatureCountController,A),this._queryPageDebounced=n(this._queryPageController,A)}initialize(){this.addHandles([l((()=>[this.graphic,this.layer,this.map,this.utilityNetwork,this.globalId,this.associationType]),(()=>this._syncLayerItems()),u),l((()=>[this.selectedLayer,this.filterWhereClause,this.featuresPerPage]),(()=>{this.selectedLayer&&this._setUpFeatures()})),l((()=>this.selectedFeature),(()=>{this._setUpAssociation()})),l((()=>this.featurePage),(()=>this._queryPageDebounced()))])}destroy(){this._setUpItemsTask=a(this._setUpItemsTask),this._updatingHandlesSetUp.destroy(),this._queryFeaturesTask=a(this._queryFeaturesTask),this._updatingHandlesQueryFeatures.destroy(),this._validateAssociationTask=a(this._validateAssociationTask),this._updatingHandlesAssociation.destroy(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}get mapTables(){const{map:e}=this;if(!e)return null;const t=new Set;return e.allTables.forEach((e=>this._collectIfValidParent(e,t))),new o([...t])}get mapLayers(){const{map:e}=this;if(!e)return null;const t=new Set;return e.allLayers.forEach((e=>this._collectIfValidParent(e,t))),new o([...t])}get state(){const{canLoadLayers:e,_queryAbortController:t,_queryPageAbortController:r}=this;return e?t||r||this._updatingHandlesQueryFeatures.updating?"querying":this._updatingHandlesSetUp.updating?"loading":"ready":"disabled"}get canAddAssociation(){return!(this.updating||!this.association)&&this._canAssociate}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:e}=this;return e?.globalIdField??null}get layerItems(){return this._get("layerItems")||new o}get tableItems(){return this._get("tableItems")||new o}get featureItems(){return this._get("featureItems")||new o}set featurePage(e){const{featuresPerPage:t,featureCount:r,featureSpatialItems:s}=this,o=s.length||r,a=1,i=Math.ceil(o/t)||1;this._set("featurePage",Math.min(Math.max(e,a),i))}get featurePage(){return this._get("featurePage")}get canLoadLayers(){const{map:e,utilityNetwork:t,graphic:r,associationType:s}=this;return!!(e&&t&&r&&s)}get canQuery(){const{utilityNetwork:e,graphic:t,associationType:r,selectedLayer:s}=this;return!!(e&&t&&r&&s)}get updating(){return this._updatingHandlesSetUp.updating||this._updatingHandlesAssociation.updating}get selectedLayer(){return this._get("selectedLayer")}set selectedLayer(e){e!==this.selectedLayer&&(this.filterWhereClause=null),this._set("selectedLayer",e)}get queryWhereClause(){const{_whereClause:e,filterWhereClause:t}=this;return c(e,t)}async handleSelectionComplete(e){const{associationType:t,featureSpatialItems:r,graphic:s,_rulesTable:o}=this,{selection:a}=e;if(r.removeAll(),!(t&&s&&o&&a?.length))return;const i=this._convertTypeToDirection(t.type),n=a.filter(this._featureIsNotSelected),l=o.getFeaturesCanAssociateWith(s,n,i),u=await this._processFeatures(l);r.addMany(u)}reset(){this.highlightHelper?.removeAll(),this.featureSpatialItems.removeAll(),this.featurePage=1}_collectIfValidLayer(e,t){b(e)&&!g(e)&&t.add(e)}_collectIfValidParent(e,t){const r=e=>this._collectIfValidLayer(e,t);d(e)||"catalog-footprint"===e.type||(_(e)?(e.layers?.forEach(r),e.tables?.forEach(r)):m(e)?(e.sublayers?.forEach(r),e.subtables?.forEach(r)):g(e)?e.sublayers?.forEach(r):this._collectIfValidLayer(e,t))}async _queryFeatureCount(e){const{selectedLayer:t,_queryFeatureCountAbortController:r}=this;if(this._set("featureCount",0),!t)return;await t.load();const s=t.createQuery();s.returnGeometry=!1,s.where=c(s.where,e);const o=await t.queryFeatureCount(s,{signal:r?.signal});o>0&&this._set("featureCount",o)}async _query(){const{canQuery:e,queryWhereClause:t,_queryAbortController:r,featureItems:s}=this;e&&(this.featurePage=1,s.destroyAll(),this.featureCount&&!this.destroyed&&s.addMany(await this._queryAssociatedFeatures(t,{signal:r?.signal})))}async _queryPage(){const{canQuery:e,queryWhereClause:t,featurePage:r,_queryPageAbortController:s,featureCount:o,featureItems:a}=this;e&&(r<2||!o||a.addMany(await this._queryAssociatedFeatures(t,{signal:s?.signal})))}_convertTypeToDirection(e){switch(e){case"attachment":return[{type:"attachment",direction:"from"}];case"connectivity":return[{type:"junction-junction-connectivity"},{type:"junction-edge-from-connectivity"},{type:"junction-edge-midspan-connectivity"},{type:"junction-edge-to-connectivity"}];case"container":return[{type:"containment",direction:"to"}];case"content":return[{type:"containment",direction:"from"}];case"structure":return[{type:"attachment",direction:"to"}]}}async getRulesTable(){const{utilityNetwork:e}=this;if(!e)return null;if(this._rulesTable)return this._rulesTable;const t=await e.getRulesTable();return await(t?.load()),this._rulesTable=t,t}async _syncLayerItems(){a(this._setUpItemsTask);const{graphic:e,associationType:t,layerItems:r,tableItems:o,canLoadLayers:i}=this,n=s((async s=>{if(this.selectedLayer=null,r.removeAll(),o.removeAll(),!i)return;const a=this.mapLayers?.toArray(),n=this.mapTables?.toArray();if(!a&&!n)return;if(s.aborted)return;const l=await this.getRulesTable(),u=this._convertTypeToDirection(t.type);if(a?.length){const t=l?.getLayersCanAssociateWith(e,a,u);if(s.aborted)return;r.addMany(t||[])}if(n?.length){const t=l?.getLayersCanAssociateWith(e,n,u);if(s.aborted)return;o.addMany(t||[])}}));this._updatingHandlesSetUp.addPromise(n.promise),this._setUpItemsTask=n}async _setUpFeatures(){a(this._queryFeaturesTask);const{graphic:e,associationType:t,selectedLayer:r,canQuery:o}=this;if(!o)return;const i=s((async s=>{const o=await this.getRulesTable(),a=this._convertTypeToDirection(t.type),i=o?.getFeaturesCanAssociateWithClause(e,r,a);this._whereClause=i,s.aborted||(await this._queryFeatureCountDebounced(this.queryWhereClause),await this._queryDebounced())}));this._updatingHandlesQueryFeatures.addPromise(i.promise),this._queryFeaturesTask=i}_determineFromAndTo(e,t,r){return"from"===r?{fromFeature:e,toFeature:t}:{fromFeature:t,toFeature:e}}_determineJunctionEdgeConnectivity(e,t){const{utilityNetwork:r}=this,s=f(e.sourceLayer)?e.sourceLayer.parent:e.sourceLayer,o=f(t.sourceLayer)?t.sourceLayer.parent:t.sourceLayer;if(!(r&&s&&"layerId"in s&&o&&"layerId"in o))return{fromFeature:e,toFeature:t,type:"junction-junction-connectivity"};const a=r.getSourceIdByLayerId(s.layerId),i=r.getSourceIdByLayerId(o.layerId);if(!a||!i)return{fromFeature:e,toFeature:t,type:"junction-junction-connectivity"};const n="junction"===r.getSourceTypeById(a),l="junction"===r.getSourceTypeById(i);return n&&l?{fromFeature:e,toFeature:t,type:"junction-junction-connectivity"}:l?{fromFeature:t,toFeature:e,type:"junction-edge-midspan-connectivity"}:{fromFeature:e,toFeature:t,type:"junction-edge-midspan-connectivity"}}_setUpAssociationHandles(){this.removeHandles(q),this.association&&this.addHandles(l((()=>[this.association?.associationType,this.association?.fromNetworkElement,this.association?.fromNetworkElement?.terminalId,this.association?.toNetworkElement,this.association?.toNetworkElement?.terminalId]),(()=>this.validateAssociation()),u),q)}_setUpAssociation(){const{utilityNetwork:e,graphic:t,selectedFeature:r,associationType:s}=this;if(!(e&&t&&r&&s))return void(this.association=null);const o=this._convertTypeToDirection(s.type);if(o.length>1){const{fromFeature:s,toFeature:o,type:a}=this._determineJunctionEdgeConnectivity(t,r.feature);return this.association=C({fromFeature:s,toFeature:o,utilityNetwork:e,associationType:a}),void this._setUpAssociationHandles()}const{fromFeature:a,toFeature:i}=this._determineFromAndTo(t,r.feature,o[0].direction);this.association=C({fromFeature:a,toFeature:i,utilityNetwork:e,associationType:o[0].type}),this._setUpAssociationHandles()}async _processFeatures(e){return Promise.all(e.map((async e=>{const{sourceLayer:t}=e;if(t&&"getFeatureTitle"in t){return{label:await t.getFeatureTitle(e)||F(e),feature:e}}return{label:F(e),feature:e}})))}async _queryAssociatedFeatures(e,t){const{featuresPerPage:r,layer:s,featurePage:o,featureCount:a,selectedLayer:i}=this,{canQuery:n,globalId:l}=this;if(!n||!s||!i||null==l)return[];const u=((o-1)*r+a)%a,y=r,{historicMoment:h,gdbVersion:p}=i,d=i.createQuery();d.where=c(d.where,e),d.start=u,d.num=y,d.returnGeometry=!1,d.historicMoment=h,d.gdbVersion=p,d.outFields=["*"];const g=await i.queryFeatures(d,{signal:t?.signal});return await this._processFeatures(g.features)}validateAssociation(){a(this._validateAssociationTask);const{utilityNetwork:e,association:t}=this,r=s((async()=>{e&&t&&(this._canAssociate=await e.canAddAssociation(t))}));this._updatingHandlesAssociation.addPromise(r.promise),this._validateAssociationTask=r}};e([y({type:t})],w.prototype,"graphic",void 0),e([y()],w.prototype,"layer",void 0),e([y()],w.prototype,"map",void 0),e([y({readOnly:!0})],w.prototype,"mapTables",null),e([y({readOnly:!0})],w.prototype,"mapLayers",null),e([y()],w.prototype,"utilityNetwork",void 0),e([y()],w.prototype,"associationType",void 0),e([y()],w.prototype,"state",null),e([y({readOnly:!0})],w.prototype,"canAddAssociation",null),e([y({readOnly:!0})],w.prototype,"globalId",null),e([y({readOnly:!0})],w.prototype,"globalIdField",null),e([y()],w.prototype,"featureCount",void 0),e([y({readOnly:!0})],w.prototype,"layerItems",null),e([y({readOnly:!0})],w.prototype,"tableItems",null),e([y({readOnly:!0})],w.prototype,"featureItems",null),e([y()],w.prototype,"featureSpatialItems",void 0),e([y()],w.prototype,"highlightHelper",void 0),e([y()],w.prototype,"_queryAbortController",void 0),e([y()],w.prototype,"_queryPageAbortController",void 0),e([y()],w.prototype,"_queryFeatureCountAbortController",void 0),e([y({value:1})],w.prototype,"featurePage",null),e([y()],w.prototype,"featuresPerPage",void 0),e([y({readOnly:!0})],w.prototype,"canLoadLayers",null),e([y({readOnly:!0})],w.prototype,"canQuery",null),e([y({readOnly:!0})],w.prototype,"updating",null),e([y()],w.prototype,"selectedLayer",null),e([y()],w.prototype,"selectedFeature",void 0),e([y()],w.prototype,"association",void 0),e([y()],w.prototype,"filterOptionsVisible",void 0),e([y()],w.prototype,"filterWhereClause",void 0),e([y()],w.prototype,"queryWhereClause",null),e([y()],w.prototype,"_rulesTable",void 0),e([y()],w.prototype,"_canAssociate",void 0),e([y()],w.prototype,"_whereClause",void 0),w=e([h("esri.widgets.FeatureForm.UtilityNetworkAssociationAddAssociationViewModel")],w);export{w as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import o from"../../core/Collection.js";import{abortMaybe as a}from"../../core/maybe.js";import{ignoreAbortErrors as i,debounce as n}from"../../core/promiseUtils.js";import{watch as l,initial as u}from"../../core/reactiveUtils.js";import{sqlAnd as c}from"../../core/sql.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../../core/support/UpdatingHandles.js";import{isLayerFromCatalog as d}from"../../layers/catalog/catalogUtils.js";import{isSubtypeGroupLayer as g,isKnowledgeGraphLayer as _,isMapImageLayer as m,isSubtypeSublayer as f}from"../../layers/support/layerUtils.js";import{isAssociatedFeatureSupportedLayer as b}from"../Feature/support/featureUtils.js";import{createAssociation as C}from"../support/UtilityNetworkAssociations/utils/createAssociation.js";import{getFeatureTitle as F}from"../support/UtilityNetworkAssociations/utils/getFeatureTitle.js";const A=100,q="association-key";let w=class extends r{constructor(e){super(e),this.graphic=null,this.layer=null,this.map=null,this.utilityNetwork=null,this.associationType=null,this.featureCount=0,this.featureSpatialItems=new o,this.highlightHelper=null,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=30,this.selectedFeature=null,this.association=null,this.filterOptionsVisible=!1,this.filterWhereClause=null,this._rulesTable=null,this._canAssociate=!1,this._whereClause=null,this._setUpItemsTask=null,this._updatingHandlesSetUp=new p,this._queryFeaturesTask=null,this._updatingHandlesQueryFeatures=new p,this._validateAssociationTask=null,this._updatingHandlesAssociation=new p,this._featureIsNotSelected=e=>(this.globalIdField?e.attributes?.[this.globalIdField]??null:null)!==this.globalId,this._cancelQuery=()=>{const{_queryAbortController:e}=this;e&&e.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:e}=this;e&&e.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:e}=this;e&&e.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await i(this._query()).catch((()=>this._cancelQuery())),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async e=>{this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await i(this._queryFeatureCount(e)).catch((()=>this._cancelQueryFeatureCount())),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null)},this._queryPageController=async()=>{const e=new AbortController;this._queryPageAbortController=e,await i(this._queryPage()).catch((()=>this._cancelQueryPage())),this._queryPageAbortController===e&&(this._queryPageAbortController=null)},this._queryDebounced=n(this._queryController,A),this._queryFeatureCountDebounced=n(this._queryFeatureCountController,A),this._queryPageDebounced=n(this._queryPageController,A)}initialize(){this.addHandles([l((()=>[this.graphic,this.layer,this.map,this.utilityNetwork,this.globalId,this.associationType]),(()=>this._syncLayerItems()),u),l((()=>[this.selectedLayer,this.filterWhereClause,this.featuresPerPage]),(()=>{this.selectedLayer&&this._setUpFeatures()})),l((()=>this.selectedFeature),(()=>{this._setUpAssociation()})),l((()=>this.featurePage),(()=>this._queryPageDebounced()))])}destroy(){this._setUpItemsTask=a(this._setUpItemsTask),this._updatingHandlesSetUp.destroy(),this._queryFeaturesTask=a(this._queryFeaturesTask),this._updatingHandlesQueryFeatures.destroy(),this._validateAssociationTask=a(this._validateAssociationTask),this._updatingHandlesAssociation.destroy(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}get mapTables(){const{map:e}=this;if(!e)return null;const t=new Set;return e.allTables.forEach((e=>this._collectIfValidParent(e,t))),new o([...t])}get mapLayers(){const{map:e}=this;if(!e)return null;const t=new Set;return e.allLayers.forEach((e=>this._collectIfValidParent(e,t))),new o([...t])}get state(){const{canLoadLayers:e,_queryAbortController:t,_queryPageAbortController:r}=this;return e?t||r||this._updatingHandlesQueryFeatures.updating?"querying":this._updatingHandlesSetUp.updating?"loading":"ready":"disabled"}get canAddAssociation(){return!(this.updating||!this.association)&&this._canAssociate}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:e}=this;return e?.globalIdField??null}get layerItems(){return this._get("layerItems")||new o}get tableItems(){return this._get("tableItems")||new o}get featureItems(){return this._get("featureItems")||new o}set featurePage(e){const{featuresPerPage:t,featureCount:r,featureSpatialItems:s}=this,o=s.length||r,a=1,i=Math.ceil(o/t)||1;this._set("featurePage",Math.min(Math.max(e,a),i))}get featurePage(){return this._get("featurePage")}get canLoadLayers(){const{map:e,utilityNetwork:t,graphic:r,associationType:s}=this;return!!(e&&t&&r&&s)}get canQuery(){const{utilityNetwork:e,graphic:t,associationType:r,selectedLayer:s}=this;return!!(e&&t&&r&&s)}get updating(){return this._updatingHandlesSetUp.updating||this._updatingHandlesAssociation.updating}get selectedLayer(){return this._get("selectedLayer")}set selectedLayer(e){e!==this.selectedLayer&&(this.filterWhereClause=null),this._set("selectedLayer",e)}get queryWhereClause(){const{_whereClause:e,filterWhereClause:t}=this;return c(e,t)}async onSelectionComplete(e){const{associationType:t,featureSpatialItems:r,graphic:s,_rulesTable:o}=this,{selection:a}=e;if(r.removeAll(),!(t&&s&&o&&a?.length))return;const i=this._convertTypeToDirection(t.type),n=a.filter(this._featureIsNotSelected),l=o.getFeaturesCanAssociateWith(s,n,i),u=await this._processFeatures(l);r.addMany(u)}reset(){this.highlightHelper?.removeAll(),this.featureSpatialItems.removeAll(),this.featurePage=1}_collectIfValidLayer(e,t){b(e)&&!g(e)&&t.add(e)}_collectIfValidParent(e,t){const r=e=>this._collectIfValidLayer(e,t);d(e)||"catalog-footprint"===e.type||(_(e)?(e.layers?.forEach(r),e.tables?.forEach(r)):m(e)?(e.sublayers?.forEach(r),e.subtables?.forEach(r)):g(e)?e.sublayers?.forEach(r):this._collectIfValidLayer(e,t))}async _queryFeatureCount(e){const{selectedLayer:t,_queryFeatureCountAbortController:r}=this;if(this._set("featureCount",0),!t)return;await t.load();const s=t.createQuery();s.returnGeometry=!1,s.where=c(s.where,e);const o=await t.queryFeatureCount(s,{signal:r?.signal});o>0&&this._set("featureCount",o)}async _query(){const{canQuery:e,queryWhereClause:t,_queryAbortController:r,featureItems:s}=this;e&&(this.featurePage=1,s.destroyAll(),this.featureCount&&!this.destroyed&&s.addMany(await this._queryAssociatedFeatures(t,{signal:r?.signal})))}async _queryPage(){const{canQuery:e,queryWhereClause:t,featurePage:r,_queryPageAbortController:s,featureCount:o,featureItems:a}=this;e&&(r<2||!o||a.addMany(await this._queryAssociatedFeatures(t,{signal:s?.signal})))}_convertTypeToDirection(e){switch(e){case"attachment":return[{type:"attachment",direction:"from"}];case"connectivity":return[{type:"junction-junction-connectivity"},{type:"junction-edge-from-connectivity"},{type:"junction-edge-midspan-connectivity"},{type:"junction-edge-to-connectivity"}];case"container":return[{type:"containment",direction:"to"}];case"content":return[{type:"containment",direction:"from"}];case"structure":return[{type:"attachment",direction:"to"}]}}async getRulesTable(){const{utilityNetwork:e}=this;if(!e)return null;if(this._rulesTable)return this._rulesTable;const t=await e.getRulesTable();return await(t?.load()),this._rulesTable=t,t}async _syncLayerItems(){a(this._setUpItemsTask);const{graphic:e,associationType:t,layerItems:r,tableItems:o,canLoadLayers:i}=this,n=s((async s=>{if(this.selectedLayer=null,r.removeAll(),o.removeAll(),!i)return;const a=this.mapLayers?.toArray(),n=this.mapTables?.toArray();if(!a&&!n)return;if(s.aborted)return;const l=await this.getRulesTable(),u=this._convertTypeToDirection(t.type);if(a?.length){const t=l?.getLayersCanAssociateWith(e,a,u);if(s.aborted)return;r.addMany(t||[])}if(n?.length){const t=l?.getLayersCanAssociateWith(e,n,u);if(s.aborted)return;o.addMany(t||[])}}));this._updatingHandlesSetUp.addPromise(n.promise),this._setUpItemsTask=n}async _setUpFeatures(){a(this._queryFeaturesTask);const{graphic:e,associationType:t,selectedLayer:r,canQuery:o}=this;if(!o)return;const i=s((async s=>{const o=await this.getRulesTable(),a=this._convertTypeToDirection(t.type),i=o?.getFeaturesCanAssociateWithClause(e,r,a);this._whereClause=i,s.aborted||(await this._queryFeatureCountDebounced(this.queryWhereClause),await this._queryDebounced())}));this._updatingHandlesQueryFeatures.addPromise(i.promise),this._queryFeaturesTask=i}_determineFromAndTo(e,t,r){return"from"===r?{fromFeature:e,toFeature:t}:{fromFeature:t,toFeature:e}}_determineJunctionEdgeConnectivity(e,t){const{utilityNetwork:r}=this,s=f(e.sourceLayer)?e.sourceLayer.parent:e.sourceLayer,o=f(t.sourceLayer)?t.sourceLayer.parent:t.sourceLayer;if(!(r&&s&&"layerId"in s&&o&&"layerId"in o))return{fromFeature:e,toFeature:t,type:"junction-junction-connectivity"};const a=r.getSourceIdByLayerId(s.layerId),i=r.getSourceIdByLayerId(o.layerId);if(!a||!i)return{fromFeature:e,toFeature:t,type:"junction-junction-connectivity"};const n="junction"===r.getSourceTypeById(a),l="junction"===r.getSourceTypeById(i);return n&&l?{fromFeature:e,toFeature:t,type:"junction-junction-connectivity"}:l?{fromFeature:t,toFeature:e,type:"junction-edge-midspan-connectivity"}:{fromFeature:e,toFeature:t,type:"junction-edge-midspan-connectivity"}}_setUpAssociationHandles(){this.removeHandles(q),this.association&&this.addHandles(l((()=>[this.association?.associationType,this.association?.fromNetworkElement,this.association?.fromNetworkElement?.terminalId,this.association?.toNetworkElement,this.association?.toNetworkElement?.terminalId]),(()=>this.validateAssociation()),u),q)}_setUpAssociation(){const{utilityNetwork:e,graphic:t,selectedFeature:r,associationType:s}=this;if(!(e&&t&&r&&s))return void(this.association=null);const o=this._convertTypeToDirection(s.type);if(o.length>1){const{fromFeature:s,toFeature:o,type:a}=this._determineJunctionEdgeConnectivity(t,r.feature);return this.association=C({fromFeature:s,toFeature:o,utilityNetwork:e,associationType:a}),void this._setUpAssociationHandles()}const{fromFeature:a,toFeature:i}=this._determineFromAndTo(t,r.feature,o[0].direction);this.association=C({fromFeature:a,toFeature:i,utilityNetwork:e,associationType:o[0].type}),this._setUpAssociationHandles()}async _processFeatures(e){return Promise.all(e.map((async e=>{const{sourceLayer:t}=e;if(t&&"getFeatureTitle"in t){return{label:await t.getFeatureTitle(e)||F(e),feature:e}}return{label:F(e),feature:e}})))}async _queryAssociatedFeatures(e,t){const{featuresPerPage:r,layer:s,featurePage:o,featureCount:a,selectedLayer:i}=this,{canQuery:n,globalId:l}=this;if(!n||!s||!i||null==l)return[];const u=((o-1)*r+a)%a,y=r,{historicMoment:h,gdbVersion:p}=i,d=i.createQuery();d.where=c(d.where,e),d.start=u,d.num=y,d.returnGeometry=!1,d.historicMoment=h,d.gdbVersion=p,d.outFields=["*"];const g=await i.queryFeatures(d,{signal:t?.signal});return await this._processFeatures(g.features)}validateAssociation(){a(this._validateAssociationTask);const{utilityNetwork:e,association:t}=this,r=s((async()=>{e&&t&&(this._canAssociate=await e.canAddAssociation(t))}));this._updatingHandlesAssociation.addPromise(r.promise),this._validateAssociationTask=r}};e([y({type:t})],w.prototype,"graphic",void 0),e([y()],w.prototype,"layer",void 0),e([y()],w.prototype,"map",void 0),e([y({readOnly:!0})],w.prototype,"mapTables",null),e([y({readOnly:!0})],w.prototype,"mapLayers",null),e([y()],w.prototype,"utilityNetwork",void 0),e([y()],w.prototype,"associationType",void 0),e([y()],w.prototype,"state",null),e([y({readOnly:!0})],w.prototype,"canAddAssociation",null),e([y({readOnly:!0})],w.prototype,"globalId",null),e([y({readOnly:!0})],w.prototype,"globalIdField",null),e([y()],w.prototype,"featureCount",void 0),e([y({readOnly:!0})],w.prototype,"layerItems",null),e([y({readOnly:!0})],w.prototype,"tableItems",null),e([y({readOnly:!0})],w.prototype,"featureItems",null),e([y()],w.prototype,"featureSpatialItems",void 0),e([y()],w.prototype,"highlightHelper",void 0),e([y()],w.prototype,"_queryAbortController",void 0),e([y()],w.prototype,"_queryPageAbortController",void 0),e([y()],w.prototype,"_queryFeatureCountAbortController",void 0),e([y({value:1})],w.prototype,"featurePage",null),e([y()],w.prototype,"featuresPerPage",void 0),e([y({readOnly:!0})],w.prototype,"canLoadLayers",null),e([y({readOnly:!0})],w.prototype,"canQuery",null),e([y({readOnly:!0})],w.prototype,"updating",null),e([y()],w.prototype,"selectedLayer",null),e([y()],w.prototype,"selectedFeature",void 0),e([y()],w.prototype,"association",void 0),e([y()],w.prototype,"filterOptionsVisible",void 0),e([y()],w.prototype,"filterWhereClause",void 0),e([y()],w.prototype,"queryWhereClause",null),e([y()],w.prototype,"_rulesTable",void 0),e([y()],w.prototype,"_canAssociate",void 0),e([y()],w.prototype,"_whereClause",void 0),w=e([h("esri.widgets.FeatureForm.UtilityNetworkAssociationAddAssociationViewModel")],w);export{w as default};
|