@arcgis/core 4.27.0-next.20230514 → 4.27.0-next.20230516
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/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0618fb0058f39ecd363f.js +1 -0
- package/assets/esri/core/workers/chunks/415c326d268b1a8fd03f.js +1 -0
- package/assets/esri/core/workers/chunks/5c811527898eb1c04e67.js +1 -0
- package/assets/esri/core/workers/chunks/62d9d15f0d00a75da42c.js +1 -0
- package/assets/esri/core/workers/chunks/93ad67930aa7d4a4b0ac.js +1 -0
- package/assets/esri/core/workers/chunks/953407451813f406fdf1.js +1 -0
- package/assets/esri/core/workers/chunks/{27081162d73cdded68ff.js → 9e209c6a2aded37f90fb.js} +1 -1
- package/assets/esri/core/workers/chunks/a507135977d83aea4421.js +1 -0
- package/assets/esri/core/workers/chunks/abe6c99a1a719543dbe8.js +1 -0
- package/assets/esri/core/workers/chunks/b91c155de9a89e4e6971.js +1 -0
- package/assets/esri/core/workers/chunks/cbe817e966b57599bafd.js +1 -0
- package/assets/esri/core/workers/chunks/d265da47f6c752a40ac1.js +1 -0
- package/assets/esri/core/workers/chunks/d95ca50ca7af4c222036.js +1 -0
- package/assets/esri/core/workers/chunks/e1e0b3580e2c3098c9f4.js +1 -0
- package/assets/esri/core/workers/chunks/ef141014ed21a7fd1ff3.js.LICENSE.txt +1 -1
- package/assets/esri/t9n/common_ar.json +1 -1
- package/assets/esri/t9n/common_bg.json +1 -1
- package/assets/esri/t9n/common_bs.json +1 -1
- package/assets/esri/t9n/common_ca.json +1 -1
- package/assets/esri/t9n/common_cs.json +1 -1
- package/assets/esri/t9n/common_da.json +1 -1
- package/assets/esri/t9n/common_de.json +1 -1
- package/assets/esri/t9n/common_el.json +1 -1
- package/assets/esri/t9n/common_es.json +1 -1
- package/assets/esri/t9n/common_et.json +1 -1
- package/assets/esri/t9n/common_fi.json +1 -1
- package/assets/esri/t9n/common_fr.json +1 -1
- package/assets/esri/t9n/common_he.json +1 -1
- package/assets/esri/t9n/common_hr.json +1 -1
- package/assets/esri/t9n/common_hu.json +1 -1
- package/assets/esri/t9n/common_id.json +1 -1
- package/assets/esri/t9n/common_it.json +1 -1
- package/assets/esri/t9n/common_ja.json +1 -1
- package/assets/esri/t9n/common_ko.json +1 -1
- package/assets/esri/t9n/common_lt.json +1 -1
- package/assets/esri/t9n/common_lv.json +1 -1
- package/assets/esri/t9n/common_nb.json +1 -1
- package/assets/esri/t9n/common_nl.json +1 -1
- package/assets/esri/t9n/common_pl.json +1 -1
- package/assets/esri/t9n/common_pt-BR.json +1 -1
- package/assets/esri/t9n/common_pt-PT.json +1 -1
- package/assets/esri/t9n/common_ro.json +1 -1
- package/assets/esri/t9n/common_ru.json +1 -1
- package/assets/esri/t9n/common_sk.json +1 -1
- package/assets/esri/t9n/common_sl.json +1 -1
- package/assets/esri/t9n/common_sr.json +1 -1
- package/assets/esri/t9n/common_sv.json +1 -1
- package/assets/esri/t9n/common_th.json +1 -1
- package/assets/esri/t9n/common_tr.json +1 -1
- package/assets/esri/t9n/common_uk.json +1 -1
- package/assets/esri/t9n/common_vi.json +1 -1
- package/assets/esri/t9n/common_zh-CN.json +1 -1
- package/assets/esri/t9n/common_zh-HK.json +1 -1
- package/assets/esri/t9n/common_zh-TW.json +1 -1
- package/assets/esri/themes/base/_core.scss +2 -0
- package/assets/esri/themes/base/widgets/_BasemapGallery.scss +198 -125
- package/assets/esri/themes/base/widgets/_Features.scss +57 -0
- package/assets/esri/themes/base/widgets/_Popup.scss +3 -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/widgets/BasemapGallery/t9n/BasemapGallery.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_en.json +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_nb.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nl.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/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_nb.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_nl.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/Feature/t9n/Feature_ar.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_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_nb.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_nl.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/Slice/t9n/Slice_ar.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_bg.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_bs.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ca.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_cs.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_da.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_de.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_el.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_es.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_et.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_fi.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_fr.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_he.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_hr.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_hu.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_id.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_it.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ja.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ko.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_lt.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_lv.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_nb.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_nl.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_pl.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_pt-BR.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_pt-PT.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ro.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ru.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_sk.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_sl.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_sr.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_sv.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_th.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_tr.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_uk.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_vi.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_zh-CN.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_zh-HK.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_zh-TW.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ar.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bg.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bs.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ca.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_cs.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_da.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_de.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_el.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_es.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_et.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fi.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_he.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hu.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_id.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_it.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ja.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ko.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lt.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lv.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nb.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nl.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pl.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-BR.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-PT.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ro.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ru.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sk.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sl.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sv.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_th.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_tr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_uk.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_vi.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-CN.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-HK.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-TW.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ar.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_bg.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_bs.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ca.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_cs.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_da.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_de.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_el.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_es.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_et.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_fi.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_fr.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_he.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_hr.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_hu.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_id.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_it.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ja.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ko.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_lt.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_lv.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_nb.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_nl.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_pl.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_pt-BR.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_pt-PT.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ro.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ru.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sk.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sl.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sr.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sv.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_th.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_tr.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_uk.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_vi.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_zh-CN.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_zh-HK.json +1 -1
- package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_zh-TW.json +1 -1
- package/chunks/languageUtils.js +1 -1
- package/core/ReactiveMap.js +5 -0
- package/core/ReactiveSet.js +5 -0
- package/form/elements/RelationshipElement.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/support/meshUtils/External.js +1 -1
- package/interfaces.d.ts +102 -54
- package/layers/BuildingSceneLayer.js +1 -1
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/support/uploadAssets.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/video/VideoEngine.js +1 -1
- package/package.json +2 -2
- package/portal/schemas/buildingSceneLayerItem.js +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/support/basemapUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushFill.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
- package/views/2d/engine/webgl/painter/RenderPass.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/RenderTargetHelper.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/textureUtils.js +5 -0
- package/views/PopupView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/View.js +1 -1
- package/views/interactive/InteractiveToolBase.js +1 -1
- package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
- package/widgets/BasemapGallery/css.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/Editor/Edits.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/FeatureForm/RelationshipInput.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +5 -0
- package/widgets/Features.js +5 -0
- package/widgets/Popup/actionUtils.js +1 -1
- package/widgets/Popup/actions.js +1 -1
- package/widgets/Popup.js +1 -1
- package/assets/esri/core/workers/chunks/08e1453cc3689a0094a6.js +0 -1
- package/assets/esri/core/workers/chunks/3a658eb0bc632ff0d01c.js +0 -1
- package/assets/esri/core/workers/chunks/43fcc9a3b5a46c3dfd0d.js +0 -1
- package/assets/esri/core/workers/chunks/47f721daa1652124c066.js +0 -1
- package/assets/esri/core/workers/chunks/544dce9710638d126763.js +0 -1
- package/assets/esri/core/workers/chunks/630b3fca46208caf4190.js +0 -1
- package/assets/esri/core/workers/chunks/6d2a448fe0dc6ebdbd6d.js +0 -1
- package/assets/esri/core/workers/chunks/7e9b173a71beeba8b263.js +0 -1
- package/assets/esri/core/workers/chunks/b1976202b918a64357ac.js +0 -1
- package/assets/esri/core/workers/chunks/b4d03661d1d8983fc13f.js +0 -1
- package/assets/esri/core/workers/chunks/b636581516f2e7342d29.js +0 -1
- package/assets/esri/core/workers/chunks/e7e7f6046cf1286365ca.js +0 -1
- package/assets/esri/core/workers/chunks/f17a7024dd49abeaa4f3.js +0 -1
package/views/View.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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Map.js";import i from"../TimeExtent.js";import r from"../core/Accessor.js";import{createTask as a}from"../core/asyncUtils.js";import s from"../core/Collection.js";import o from"../core/CollectionFlattener.js";import n from"../core/Error.js";import l from"../core/Evented.js";import{HandleOwnerMixin as p}from"../core/HandleOwner.js";import{makeHandle as h}from"../core/handleUtils.js";import d from"../core/Loadable.js";import y from"../core/Logger.js";import{destroyMaybe as c,abortMaybe as u}from"../core/maybe.js";import{EsriPromiseMixin as m}from"../core/Promise.js";import{after as f}from"../core/promiseUtils.js";import{watch as g,whenOnce as w,when as v,sync as V}from"../core/reactiveUtils.js";import{property as M}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as R}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as _}from"../core/support/OwningCollection.js";import S from"../geometry/Extent.js";import j from"../geometry/HeightModelInfo.js";import F from"../geometry/SpatialReference.js";import{equals as L}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as O}from"../support/AnalysesCollection.js";import{GraphicsCollection as E}from"../support/GraphicsCollection.js";import b from"../time/TimeReference.js";import{BasemapView as x}from"./BasemapView.js";import C from"./LayerViewManager.js";import I from"./Magnifier.js";import T from"./ToolViewManager.js";import q from"./input/Input.js";import{ViewEvents as D}from"./input/ViewEvents.js";import P from"./navigation/Navigation.js";import{DefaultsFromMap as U}from"./support/DefaultsFromMap.js";var k;let W=k=class extends(p(l.EventedMixin(m(r)))){constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.allLayerViews=new o({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:A}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new E,this.analyses=new O,this.typeSpecificPreconditionsReady=!0,this.layerViews=new s,this.magnifier=new I,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.timeReference=new b,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new q,this.navigation=new P,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new D(this),this.persistableViewModels=new s,this._isValid=!1,this._readyCycleForced=!1,this._currentSpatialReference=null,this.handles.add(g((()=>this.preconditionsReady),(e=>{e?(this._currentSpatialReference=this.spatialReference,k.views.add(this)):(this._currentSpatialReference=null,k.views.remove(this)),this.notifyChange("spatialReference"),!e&&this.ready?(this.toolViewManager?.detach(),null!=this.analysisViewManager&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown()):e&&!this.ready&&(this._startup(),null!=this.analysisViewManager&&this.analysisViewManager.attach(),this.toolViewManager.attach())}),V))}initialize(){this.addResolvingPromise(this.validate().then((()=>(this._isValid=!0,w((()=>this.ready)))))),this.basemapView=new x({view:this}),this.layerViewManager=new C({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new T({view:this}),this._setupSpatialReferenceLogger(),this.handles.add([g((()=>this.initialExtentRequired),(e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e}),{sync:!0,initial:!0}),g((()=>this.ready),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)}),{sync:!0}),g((()=>this._userSpatialReference),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)}),{sync:!0,initial:!0})])}_setupSpatialReferenceLogger(){let e=null;this.handles.add([g((()=>this.defaultsFromMap?.ready),(t=>{const i=this.map?.allLayers.length>0;if(t&&!this.spatialReference&&i){if(null!=e)return;const t=h((()=>e=u(e)));e=a((async t=>{try{await f(this.spatialReferenceWarningDelay,null,t)}catch{return}finally{e=null}y.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")})),this.handles.add(t,"spatial-reference-logger-task")}else this.handles.remove("spatial-reference-logger-task")}),{sync:!0})])}destroy(){this.destroyed||(k.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=c(this.graphics),this.analyses=c(this.analyses),this.handles.remove("defaultsFromMap"),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),c(this.analysisViewManager),this.toolViewManager=c(this.toolViewManager),this.layerViewManager=c(this.layerViewManager),this.basemapView=c(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach((e=>e.destroy())),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.removeAll(),this.map=c(this.map))}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return y.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new U({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:e=>this.getSpatialReferenceSupport(e),...this._defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||d.isLoadable(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._currentSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(y.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),d.isLoadable(e)&&e.load().catch((()=>{})),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._currentSpatialReference=null),this._set("map",e))}get spatialReference(){let e=this._userSpatialReference||this._currentSpatialReference||this.getDefaultSpatialReference()||null;return e&&this.defaultsFromMap?.required?.heightModelInfo&&(e=e.clone(),e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid),e}set spatialReference(e){const t=!L(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){const e=this.toolViewManager?this.toolViewManager.cursor:null;return null!=e?e:this._cursor||"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}importLayerView(e){throw new n("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport({spatialReference:e})}when(e,t){return this.isResolved()&&!this.ready&&y.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(v((()=>this.destroyed||!1===this.preconditionsReady),(()=>this._readyCycleForced=!1),{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}};W.views=new s,e([M()],W.prototype,"_userSpatialReference",void 0),e([M()],W.prototype,"activeTool",null),e([M({readOnly:!0})],W.prototype,"allLayerViews",void 0),e([M()],W.prototype,"groundView",void 0),e([M()],W.prototype,"animation",null),e([M()],W.prototype,"basemapView",void 0),e([M()],W.prototype,"center",null),e([M({readOnly:!0})],W.prototype,"_defaultsFromMapSettings",null),e([M()],W.prototype,"defaultsFromMap",null),e([M()],W.prototype,"fatalError",void 0),e([M({type:S})],W.prototype,"extent",null),e([M(_(E,"graphics"))],W.prototype,"graphics",void 0),e([M(_(O,"analyses"))],W.prototype,"analyses",void 0),e([M({readOnly:!0,type:j})],W.prototype,"heightModelInfo",null),e([M({readOnly:!0})],W.prototype,"interacting",null),e([M({readOnly:!0})],W.prototype,"navigating",null),e([M({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_currentSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],W.prototype,"preconditionsReady",null),e([M({readOnly:!0})],W.prototype,"typeSpecificPreconditionsReady",void 0),e([M({type:s,readOnly:!0})],W.prototype,"layerViews",void 0),e([M()],W.prototype,"resolution",null),e([M({type:I})],W.prototype,"magnifier",void 0),e([M({value:null,type:t})],W.prototype,"map",null),e([M()],W.prototype,"padding",void 0),e([M({readOnly:!0})],W.prototype,"ready",void 0),e([M({type:F})],W.prototype,"spatialReference",null),e([M()],W.prototype,"spatialReferenceWarningDelay",void 0),e([M()],W.prototype,"stationary",null),e([M({readOnly:!0})],W.prototype,"supportsGround",void 0),e([M({type:i})],W.prototype,"timeExtent",void 0),e([M({type:b,nonNullable:!0})],W.prototype,"timeReference",void 0),e([M()],W.prototype,"tools",null),e([M()],W.prototype,"toolViewManager",void 0),e([M({readOnly:!0})],W.prototype,"type",void 0),e([M({type:Number})],W.prototype,"scale",void 0),e([M({readOnly:!0})],W.prototype,"updating",void 0),e([M({readOnly:!0})],W.prototype,"initialExtentRequired",void 0),e([M({readOnly:!0})],W.prototype,"initialExtent",null),e([M()],W.prototype,"cursor",null),e([M({readOnly:!0})],W.prototype,"input",void 0),e([M({type:P,nonNullable:!0})],W.prototype,"navigation",void 0),e([M()],W.prototype,"layerViewManager",void 0),e([M()],W.prototype,"analysisViewManager",void 0),e([M()],W.prototype,"width",void 0),e([M()],W.prototype,"height",void 0),e([M({readOnly:!0})],W.prototype,"resizing",void 0),e([M({value:null,readOnly:!0})],W.prototype,"size",null),e([M({readOnly:!0})],W.prototype,"suspended",void 0),e([M({readOnly:!0})],W.prototype,"viewEvents",void 0),e([M({readOnly:!0})],W.prototype,"persistableViewModels",void 0),e([M()],W.prototype,"_isValid",void 0),e([M()],W.prototype,"_readyCycleForced",void 0),e([M()],W.prototype,"_currentSpatialReference",void 0),W=k=e([R("esri.views.View")],W);const z=W;function A(e){return e.layerViews}export{z as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Map.js";import i from"../TimeExtent.js";import r from"../core/Accessor.js";import{createTask as a}from"../core/asyncUtils.js";import s from"../core/Collection.js";import o from"../core/CollectionFlattener.js";import n from"../core/Error.js";import l from"../core/Evented.js";import{HandleOwnerMixin as p}from"../core/HandleOwner.js";import{makeHandle as h}from"../core/handleUtils.js";import d from"../core/Loadable.js";import y from"../core/Logger.js";import{destroyMaybe as c,abortMaybe as u}from"../core/maybe.js";import{EsriPromiseMixin as m}from"../core/Promise.js";import{after as f}from"../core/promiseUtils.js";import{watch as g,whenOnce as w,when as v,sync as V}from"../core/reactiveUtils.js";import{property as M}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as R}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as _}from"../core/support/OwningCollection.js";import S from"../geometry/Extent.js";import j from"../geometry/HeightModelInfo.js";import F from"../geometry/SpatialReference.js";import{equals as L}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as O}from"../support/AnalysesCollection.js";import{GraphicsCollection as E}from"../support/GraphicsCollection.js";import b from"../time/TimeReference.js";import{BasemapView as x}from"./BasemapView.js";import C from"./LayerViewManager.js";import I from"./Magnifier.js";import{ToolViewManager as T}from"./ToolViewManager.js";import q from"./input/Input.js";import{ViewEvents as D}from"./input/ViewEvents.js";import P from"./navigation/Navigation.js";import{DefaultsFromMap as U}from"./support/DefaultsFromMap.js";var k;let W=k=class extends(p(l.EventedMixin(m(r)))){constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.allLayerViews=new o({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:A}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new E,this.analyses=new O,this.typeSpecificPreconditionsReady=!0,this.layerViews=new s,this.magnifier=new I,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.timeReference=new b,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new q,this.navigation=new P,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new D(this),this.persistableViewModels=new s,this._isValid=!1,this._readyCycleForced=!1,this._currentSpatialReference=null,this.handles.add(g((()=>this.preconditionsReady),(e=>{e?(this._currentSpatialReference=this.spatialReference,k.views.add(this)):(this._currentSpatialReference=null,k.views.remove(this)),this.notifyChange("spatialReference"),!e&&this.ready?(this.toolViewManager?.detach(),null!=this.analysisViewManager&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown()):e&&!this.ready&&(this._startup(),null!=this.analysisViewManager&&this.analysisViewManager.attach(),this.toolViewManager.attach())}),V))}initialize(){this.addResolvingPromise(this.validate().then((()=>(this._isValid=!0,w((()=>this.ready)))))),this.basemapView=new x({view:this}),this.layerViewManager=new C({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new T({view:this}),this._setupSpatialReferenceLogger(),this.handles.add([g((()=>this.initialExtentRequired),(e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e}),{sync:!0,initial:!0}),g((()=>this.ready),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)}),{sync:!0}),g((()=>this._userSpatialReference),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)}),{sync:!0,initial:!0})])}_setupSpatialReferenceLogger(){let e=null;this.handles.add([g((()=>this.defaultsFromMap?.ready),(t=>{const i=this.map?.allLayers.length>0;if(t&&!this.spatialReference&&i){if(null!=e)return;const t=h((()=>e=u(e)));e=a((async t=>{try{await f(this.spatialReferenceWarningDelay,null,t)}catch{return}finally{e=null}y.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")})),this.handles.add(t,"spatial-reference-logger-task")}else this.handles.remove("spatial-reference-logger-task")}),{sync:!0})])}destroy(){this.destroyed||(k.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=c(this.graphics),this.analyses=c(this.analyses),this.handles.remove("defaultsFromMap"),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),c(this.analysisViewManager),this.toolViewManager=c(this.toolViewManager),this.layerViewManager=c(this.layerViewManager),this.basemapView=c(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach((e=>e.destroy())),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.removeAll(),this.map=c(this.map))}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return y.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new U({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:e=>this.getSpatialReferenceSupport(e),...this._defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||d.isLoadable(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._currentSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(y.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),d.isLoadable(e)&&e.load().catch((()=>{})),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._currentSpatialReference=null),this._set("map",e))}get spatialReference(){let e=this._userSpatialReference||this._currentSpatialReference||this.getDefaultSpatialReference()||null;return e&&this.defaultsFromMap?.required?.heightModelInfo&&(e=e.clone(),e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid),e}set spatialReference(e){const t=!L(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){const e=this.toolViewManager?this.toolViewManager.cursor:null;return null!=e?e:this._cursor||"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}importLayerView(e){throw new n("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport({spatialReference:e})}when(e,t){return this.isResolved()&&!this.ready&&y.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(v((()=>this.destroyed||!1===this.preconditionsReady),(()=>this._readyCycleForced=!1),{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}};W.views=new s,e([M()],W.prototype,"_userSpatialReference",void 0),e([M()],W.prototype,"activeTool",null),e([M({readOnly:!0})],W.prototype,"allLayerViews",void 0),e([M()],W.prototype,"groundView",void 0),e([M()],W.prototype,"animation",null),e([M()],W.prototype,"basemapView",void 0),e([M()],W.prototype,"center",null),e([M({readOnly:!0})],W.prototype,"_defaultsFromMapSettings",null),e([M()],W.prototype,"defaultsFromMap",null),e([M()],W.prototype,"fatalError",void 0),e([M({type:S})],W.prototype,"extent",null),e([M(_(E,"graphics"))],W.prototype,"graphics",void 0),e([M(_(O,"analyses"))],W.prototype,"analyses",void 0),e([M({readOnly:!0,type:j})],W.prototype,"heightModelInfo",null),e([M({readOnly:!0})],W.prototype,"interacting",null),e([M({readOnly:!0})],W.prototype,"navigating",null),e([M({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_currentSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],W.prototype,"preconditionsReady",null),e([M({readOnly:!0})],W.prototype,"typeSpecificPreconditionsReady",void 0),e([M({type:s,readOnly:!0})],W.prototype,"layerViews",void 0),e([M()],W.prototype,"resolution",null),e([M({type:I})],W.prototype,"magnifier",void 0),e([M({value:null,type:t})],W.prototype,"map",null),e([M()],W.prototype,"padding",void 0),e([M({readOnly:!0})],W.prototype,"ready",void 0),e([M({type:F})],W.prototype,"spatialReference",null),e([M()],W.prototype,"spatialReferenceWarningDelay",void 0),e([M()],W.prototype,"stationary",null),e([M({readOnly:!0})],W.prototype,"supportsGround",void 0),e([M({type:i})],W.prototype,"timeExtent",void 0),e([M({type:b,nonNullable:!0})],W.prototype,"timeReference",void 0),e([M()],W.prototype,"tools",null),e([M()],W.prototype,"toolViewManager",void 0),e([M({readOnly:!0})],W.prototype,"type",void 0),e([M({type:Number})],W.prototype,"scale",void 0),e([M({readOnly:!0})],W.prototype,"updating",void 0),e([M({readOnly:!0})],W.prototype,"initialExtentRequired",void 0),e([M({readOnly:!0})],W.prototype,"initialExtent",null),e([M()],W.prototype,"cursor",null),e([M({readOnly:!0})],W.prototype,"input",void 0),e([M({type:P,nonNullable:!0})],W.prototype,"navigation",void 0),e([M()],W.prototype,"layerViewManager",void 0),e([M()],W.prototype,"analysisViewManager",void 0),e([M()],W.prototype,"width",void 0),e([M()],W.prototype,"height",void 0),e([M({readOnly:!0})],W.prototype,"resizing",void 0),e([M({value:null,readOnly:!0})],W.prototype,"size",null),e([M({readOnly:!0})],W.prototype,"suspended",void 0),e([M({readOnly:!0})],W.prototype,"viewEvents",void 0),e([M({readOnly:!0})],W.prototype,"persistableViewModels",void 0),e([M()],W.prototype,"_isValid",void 0),e([M()],W.prototype,"_readyCycleForced",void 0),e([M()],W.prototype,"_currentSpatialReference",void 0),W=k=e([R("esri.views.View")],W);const z=W;function A(e){return e.layerViews}export{z 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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import i from"../../core/Logger.js";import{createResolver as o}from"../../core/promiseUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{EditableFlag as r}from"./interfaces.js";import{ManipulatorCollection as n}from"./ManipulatorCollection.js";let l=class extends e{constructor(t){super(t),this.manipulators=new n,this.automaticManipulatorSelection=!0,this.hasGrabbedManipulators=!1,this.hasHoveredManipulators=!1,this.firstGrabbedManipulator=null,this.created=!1,this.removeIncompleteOnCancel=!0,this._editableFlags=new Map([[r.MANAGER,!0],[r.USER,!0]]),this._creationFinishedResolver=o()}get active(){return null!=this.view&&this.view.activeTool===this}set visible(t){this._get("visible")!==t&&(this._set("visible",t),this._syncVisible())}get editable(){return this.getEditableFlag(r.USER)}set editable(t){this.setEditableFlag(r.USER,t)}get updating(){return!1}get
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import i from"../../core/Logger.js";import{createResolver as o}from"../../core/promiseUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{EditableFlag as r}from"./interfaces.js";import{ManipulatorCollection as n}from"./ManipulatorCollection.js";let l=class extends e{constructor(t){super(t),this.manipulators=new n,this.automaticManipulatorSelection=!0,this.hasGrabbedManipulators=!1,this.hasHoveredManipulators=!1,this.firstGrabbedManipulator=null,this.created=!1,this.removeIncompleteOnCancel=!0,this._editableFlags=new Map([[r.MANAGER,!0],[r.USER,!0]]),this._creationFinishedResolver=o()}get active(){return null!=this.view&&this.view.activeTool===this}set visible(t){this._get("visible")!==t&&(this._set("visible",t),this._syncVisible())}get editable(){return this.getEditableFlag(r.USER)}set editable(t){this.setEditableFlag(r.USER,t)}get updating(){return!1}get cursor(){return null}get hasFocusedManipulators(){return this.hasGrabbedManipulators||this.hasHoveredManipulators}destroy(){this.manipulators.destroy(),this._set("view",null)}onAdd(){this._syncVisible()}activate(){null!=this.view?(this.view.focus(),this.onActivate()):i.getLogger(this).error("Can't activate tool if view is not defined.")}deactivate(){this.onDeactivate()}handleInputEvent(t){this.onInputEvent(t)}handleInputEventAfter(t){this.onInputEventAfter(t)}setEditableFlag(t,e){this._editableFlags.set(t,e),this.manipulators.isToolEditable=this.internallyEditable,this._updateManipulatorAttachment(),t===r.USER&&this.notifyChange("editable"),this.onEditableChange(),this.onManipulatorSelectionChanged()}getEditableFlag(t){return this._editableFlags.get(t)??!1}whenCreated(){return this._creationFinishedResolver.promise}onManipulatorSelectionChanged(){}onActivate(){}onDeactivate(){}onShow(){}onHide(){}onEditableChange(){}onInputEvent(t){}onInputEventAfter(t){}get internallyEditable(){return this.getEditableFlag(r.USER)&&this.getEditableFlag(r.MANAGER)}finishToolCreation(){this.created||this._creationFinishedResolver.resolve(this),this._set("created",!0)}_syncVisible(){if(this.initialized)if(this.visible)this._show();else if(this._hide(),this.active)return void(this.view.activeTool=null)}_show(){this._updateManipulatorAttachment(),this.onShow()}_hide(){this._updateManipulatorAttachment(),this.onHide()}_updateManipulatorAttachment(){this.visible?this.manipulators.attach():this.manipulators.detach()}};t([a({constructOnly:!0})],l.prototype,"view",void 0),t([a({readOnly:!0})],l.prototype,"active",null),t([a({value:!0})],l.prototype,"visible",null),t([a({value:!0})],l.prototype,"editable",null),t([a({readOnly:!0})],l.prototype,"manipulators",void 0),t([a({readOnly:!0})],l.prototype,"updating",null),t([a()],l.prototype,"cursor",null),t([a({readOnly:!0})],l.prototype,"automaticManipulatorSelection",void 0),t([a()],l.prototype,"hasFocusedManipulators",null),t([a()],l.prototype,"hasGrabbedManipulators",void 0),t([a()],l.prototype,"hasHoveredManipulators",void 0),t([a()],l.prototype,"firstGrabbedManipulator",void 0),t([a({readOnly:!0})],l.prototype,"created",void 0),t([a({readOnly:!0})],l.prototype,"removeIncompleteOnCancel",void 0),l=t([s("esri.views.interactive.InteractiveToolBase")],l);export{l as InteractiveToolBase};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{find as t}from"../../core/iteratorUtils.js";import{someMap as e}from"../../core/MapUtils.js";import{clamp as o}from"../../core/mathUtils.js";import{applySome as r}from"../../core/maybe.js";import{createScreenPoint as i}from"../../core/screenUtils.js";import{areToolManipulatorsEditable as a}from"./interactiveToolUtils.js";import{createScreenPointFromEvent as n}from"../support/screenUtils.js";class s{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}
|
|
5
|
+
import{find as t}from"../../core/iteratorUtils.js";import{someMap as e}from"../../core/MapUtils.js";import{clamp as o}from"../../core/mathUtils.js";import{applySome as r}from"../../core/maybe.js";import{createScreenPoint as i}from"../../core/screenUtils.js";import{areToolManipulatorsEditable as a}from"./interactiveToolUtils.js";import{createScreenPointFromEvent as n}from"../support/screenUtils.js";class s{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(t,e){const i=()=>t.stopPropagation();switch(t.type){case"pointer-move":l(t.pointerType)&&this._pointerLocations.set(t.pointerId,{x:t.x,y:t.y,pointerType:t.pointerType});break;case"drag":this._grabbedManipulators.size>0&&(this._stopDrag=!0),this._stopDrag&&(i(),"end"===t.action&&(this._stopDrag=!1));break;case"pointer-down":{if(!p(t))break;const o=n(t),r=this._intersect(o,t.pointerType,e.forEachTool);if(null==r)break;const a=r.manipulator,s=r.tool;null==a||null==s||!a.interactive||a.grabbable&&a.grabbableForEvent(t)||!a.grabbing||a.dragging||this._ungrabManipulatorBeforeDragging(a,t,e),null!=a&&null!=s&&a.interactive&&a.grabbable&&a.grabbableForEvent(t)&&!a.grabbing&&(this._grabbedManipulators.set(t.pointerId,{manipulator:a,tool:s,start:o,pointerType:t.pointerType}),1===this._grabbedManipulators.size&&null==e.activeTool&&(this._revertToNullActiveTool=!0,e.setActiveTool(r.tool)),a.grabbing=!0,a.events.emit("grab-changed",{action:"start",pointerType:t.pointerType,screenPoint:o}),i());break}case"pointer-up":this._draggedManipulators.has(t.pointerId)||this._handlePointerEnd(t,e);break;case"pointer-drag":{if(!p(t))break;const a=this._grabbedManipulators.get(t.pointerId),s=r(a,(({manipulator:t})=>t)),l=r(a,(({tool:t})=>t));if(null==s||null==l)break;const u=n(t);u.x=o(u.x,0,e.view.width),u.y=o(u.y,0,e.view.height);const c=a.start,h=this._draggedManipulators.get(t.pointerId);switch(t.action){case"start":case"update":"update"!==t.action&&1!==this._grabbedManipulators.size||(s.dragging=!0,h?s.events.emit("drag",{action:"update",start:c,screenPoint:u}):s.events.emit("drag",{action:"start",start:c,screenPoint:u,pointerType:t.pointerType}),this._draggedManipulators.set(t.pointerId,{tool:l,manipulator:s,start:c}));break;case"end":s.dragging=!1,h&&s.events.emit("drag",{action:"end",start:c,screenPoint:u}),this._draggedManipulators.delete(t.pointerId),this._handlePointerEnd(t,e)}i();break}case"immediate-click":{const o=n(t),r=this._intersect(o,t.pointerType,e.forEachTool);if(u(t)||e.forEachTool((t=>{if((null==r||r.tool!==t||t.automaticManipulatorSelection)&&t.manipulators){let e=!1;t.manipulators.forEach((({manipulator:t})=>{t.selected&&(t.selected=!1,e=!0)})),e&&t.onManipulatorSelectionChanged&&t.onManipulatorSelectionChanged()}})),null==r)break;const{manipulator:a,tool:s}=r;if(!a.interactive)break;a.selectable&&s.automaticManipulatorSelection&&(a.selected=!a.selected,s.onManipulatorSelectionChanged&&s.onManipulatorSelectionChanged());const l=t.native.shiftKey;a.events.emit("immediate-click",{screenPoint:o,button:t.button,pointerType:t.pointerType,shiftKey:l,stopPropagation:i});break}case"click":{const o=n(t),r=this._intersect(o,t.pointerType,e.forEachTool),a=null!=r?r.manipulator:null;if(null==a||!a.interactive)break;const s=t.native.shiftKey;a.events.emit(t.type,{screenPoint:o,button:t.button,pointerType:t.pointerType,shiftKey:s}),i();break}case"double-click":{const o=n(t),r=this._intersect(o,t.pointerType,e.forEachTool),a=null!=r?r.manipulator:null;if(null==a||!a.interactive)break;const s=t.native.shiftKey;a.events.emit("double-click",{screenPoint:o,button:t.button,pointerType:t.pointerType,shiftKey:s,stopPropagation:i});break}case"immediate-double-click":{const o=n(t),r=this._intersect(o,t.pointerType,e.forEachTool),a=null!=r?r.manipulator:null;if(null==a||!a.interactive)break;const s=t.native.shiftKey;a.events.emit("immediate-double-click",{screenPoint:o,button:t.button,pointerType:t.pointerType,shiftKey:s,stopPropagation:i});break}}this._onFocusChange(e.forEachTool)}_ungrabManipulatorBeforeDragging(t,e,o){t.grabbing=!1,t.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:n(e)}),this._grabbedManipulators.forEach((({manipulator:e},o)=>{e===t&&this._grabbedManipulators.delete(o)})),this._afterManipulatorUngrab(o.setActiveTool)}_handlePointerEnd(t,e){const o=r(this._grabbedManipulators.get(t.pointerId),(({manipulator:t})=>t));null!=o&&o.grabbing&&(o.grabbing=!1,o.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:n(t)}),this._grabbedManipulators.delete(t.pointerId),this._afterManipulatorUngrab(e.setActiveTool))}_cursorFromMap(t){let o=null;return e(t,(({manipulator:t})=>!(null==t||!t.interactive)&&(t.grabbing&&t.grabCursor?(o=t.grabCursor,!0):!!t.cursor&&(o=t.cursor,!0)))),o}_onFocusChange(t){this._updateCursor(),this._updateFocusedManipulatorTools(t)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=this._cursorFromMap(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=this._cursorFromMap(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(e){const o=new Set,r=new Set;this._grabbedManipulators.forEach((({tool:t})=>{o.add(t)})),this._hoveredManipulators.forEach((({tool:t})=>{r.add(t)})),e((e=>{e.hasGrabbedManipulators=o.has(e),e.hasHoveredManipulators=r.has(e);const i=this._grabbedManipulators.values(),a=t(i,(({tool:t})=>t===e));e.firstGrabbedManipulator=null!=a?a.manipulator:null}))}clearPointers(t,{forEachTool:e,setActiveTool:o},r=!0,i){const a=(e,o)=>e===t&&(null==i||i===o);this._grabbedManipulators.forEach((({tool:t,manipulator:e,pointerType:o},r)=>{a(t,e)&&(this._grabbedManipulators.delete(r),e.grabbing=!1,e.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:o}))})),this._draggedManipulators.forEach((({tool:t,manipulator:e},o)=>{a(t,e)&&(this._draggedManipulators.delete(o),e.dragging=!1,e.events.emit("drag",{action:"cancel"}))})),r&&this._hoveredManipulators.forEach((({tool:t,manipulator:e},o)=>{a(t,e)&&(this._hoveredManipulators.delete(o),e.hovering=!1)})),this._afterManipulatorUngrab(o),this._onFocusChange(e)}_intersect(t,e,o){let r=null;return o((o=>{if(null==o.manipulators||!a(o))return!1;const i=o.manipulators.intersect(t,e);return null!=i&&(r={tool:o,manipulator:i},!0)})),r}updateHoveredStateFromKnownPointers(t){this._pointerLocations.forEach(((e,o)=>{this._updateHoveredStateForPointerAtScreenPosition(i(e.x,e.y),o,e.pointerType,t)}))}handleHoverEvent(t,e){"pointer-up"!==t.type&&"immediate-click"!==t.type&&"pointer-move"!==t.type||!l(t.pointerType)||this._updateHoveredStateForPointerAtScreenPosition(n(t),t.pointerId,t.pointerType,e)}_updateHoveredStateForPointerAtScreenPosition(t,e,o,i){let a=this._intersect(t,o,i);const n=r(this._hoveredManipulators.get(e),(({manipulator:t})=>t));null==a||a.manipulator.interactive||(a=null),null!=a&&n===a.manipulator||(null!=n&&(n.hovering=!1),null!=a?(a.manipulator.hovering=!0,this._hoveredManipulators.set(e,a)):this._hoveredManipulators.delete(e),this._onFocusChange(i))}_afterManipulatorUngrab(t){0===this._grabbedManipulators.size&&this._revertToNullActiveTool&&(t(null),this._revertToNullActiveTool=!1)}}function l(t){return"mouse"===t}function p(t){return"mouse"!==t.pointerType||0===t.button}function u(t){return!!t.native.shiftKey}export{s as ToolViewManagerManipulatorState};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const e="esri-basemap-gallery",i={base:`${e} esri-widget esri-widget--panel-height-only`,sourceLoading:`${e}--source-loading`,loader:`${e}__loader`,item:`${e}__item`,itemContainer:`${e}__item-container`,itemTitle:`${e}__item-title`,itemThumbnail:`${e}__item-thumbnail`,selectedItem:`${e}__item--selected`,itemError:`${e}__item--error`,emptyMessage:"esri-widget__content--empty",widgetIcon:"esri-icon-basemap",disabled:"esri-disabled",loaderAnimation:"esri-widget__loader-animation"};export{i as CSS};
|
|
5
|
+
const e="esri-basemap-gallery",i={base:`${e} esri-widget esri-widget--panel-height-only`,sourceLoading:`${e}--source-loading`,loader:`${e}__loader`,item:`${e}__item`,itemContainer:`${e}__item-container`,itemContent:`${e}__item-content`,itemTitle:`${e}__item-title`,itemTagsContainer:`${e}__item-tags-container`,itemThumbnail:`${e}__item-thumbnail`,selectedItem:`${e}__item--selected`,itemError:`${e}__item--error`,emptyMessage:"esri-widget__content--empty",widgetIcon:"esri-icon-basemap",disabled:"esri-disabled",loaderAnimation:"esri-widget__loader-animation"};export{i as CSS};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as s}from"../assets.js";import t from"../core/Handles.js";import{on as a,when as i,watch as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as s}from"../assets.js";import t from"../core/Handles.js";import{on as a,when as i,watch as r}from"../core/reactiveUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{isBasemap3D as n}from"../support/basemapUtils.js";import d from"./Widget.js";import p from"./BasemapGallery/BasemapGalleryViewModel.js";import{CSS as m}from"./BasemapGallery/css.js";import{loadCalciteComponents as c}from"./support/componentsUtils.js";import{Heading as h}from"./support/Heading.js";import{accessibleHandler as u}from"./support/decorators/accessibleHandler.js";import{messageBundle as g}from"./support/decorators/messageBundle.js";import{tsx as v}from"./support/jsxFactory.js";import"./support/widgetUtils.js";let b=class extends d{constructor(e,s){super(e,s),this._handles=new t,this._focusBasemapItemEnabled=!1,this.disabled=!1,this.headingLevel=2,this.iconClass=m.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new p}initialize(){const e=this._handles;this.addHandles([a((()=>this.viewModel.items),"change",(s=>{const t="basemap-gallery-item-changes",{added:a,moved:i}=s;e.remove(t),e.add([...a,...i].map((e=>r((()=>e.state),(()=>this.scheduleRender())))),t),this.scheduleRender()})),i((()=>this.source),(()=>this.viewModel.load()),{initial:!0,once:!0})])}destroy(){this._handles.destroy()}loadDependencies(){return c({scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim.js"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip.js")})}get activeBasemap(){return this.viewModel.activeBasemap}set activeBasemap(e){this.viewModel.activeBasemap=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get source(){return this.viewModel.source}set source(e){this.viewModel.source=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e="loading"===this.source.state,s=this.disabled||"disabled"===this.viewModel.state,t=this.viewModel.items.map(((e,s)=>this._renderBasemapGalleryItem(e,s))).toArray(),a={[m.sourceLoading]:e,[m.disabled]:s},i=e?v("div",{class:m.loader,key:"esri-basemap-gallery__loader"}):null,r=e?null:t.length>0?v("ul",{bind:this,"aria-disabled":this.disabled,"aria-label":this.label,class:m.itemContainer,key:"esri-basemap-gallery__item-container",onkeydown:this._handleKeyDown,role:"radiogroup"},t):v("div",{class:m.emptyMessage,key:"esri-basemap-gallery__empty-message"},v(h,{level:this.headingLevel},this.messages.noBasemaps));return v("div",{class:this.classes(m.base,a)},i,r)}_getRoundRobinIndex(e,s){return(e+s)%s}_handleKeyDown(e){const{key:s}=e;if(!["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(s))return;e.preventDefault();const{items:t,activeBasemapIndex:a}=this.viewModel,i="ArrowUp"===s||"ArrowLeft"===s?this._getRoundRobinIndex(Math.max(a-1,-1),t.length):this._getRoundRobinIndex(a+1,t.length),r=t.getItemAt(i);"ready"===r?.state&&(this.viewModel.activeBasemap=r.basemap),this._focusBasemapItemEnabled=!0}_focusBasemapItem(e){this._focusBasemapItemEnabled&&0===e.tabIndex&&(e.focus(),this._focusBasemapItemEnabled=!1)}_handleClick(e){const s=e.currentTarget["data-item"];"ready"===s.state&&(this.viewModel.activeBasemap=s.basemap)}_renderBasemapGalleryItem(e,t){const a=e.basemap.thumbnailUrl||s("esri/themes/base/images/basemap-toggle-64.svg"),i=e.basemap.title,r=e.basemap.portalItem?.snippet,o=e.error?.message||r||i,{viewModel:{state:l,activeBasemapIndex:d}}=this,p=this.disabled||"disabled"===l,c=d===t,h=c||-1===d&&0===t?0:-1,u="loading"===l,g={[m.selectedItem]:c,[m.itemError]:"error"===e.state},b=`basemapgallery-item-${e.uid}`;return v("li",{"aria-checked":c.toString(),"aria-disabled":p.toString(),"aria-labelledby":b,bind:this,class:this.classes(m.item,g),"data-item":e,onkeydown:this._handleClick,onclick:this._handleClick,role:"radio",tabIndex:h,afterUpdate:this._focusBasemapItem,title:o},v("img",{alt:"",class:m.itemThumbnail,src:a}),v("div",{class:m.itemContent},v("div",{class:m.itemTitle},v("span",{id:b},i)),n(e.basemap)?this._render3DTags():null),"loading"===e.state||c&&u?v("calcite-scrim",null,v("span",{"aria-hidden":"true",role:"presentation",class:m.loaderAnimation})):null)}_render3DTags(){const{messages:e}=this;return v("div",{class:m.itemTagsContainer},v("calcite-chip",{value:e.tag3D,scale:"s"},this.messages.tag3D),v("calcite-chip",{value:e.tagBeta,scale:"s",appearance:"outline-fill"},this.messages.tagBeta))}};e([o()],b.prototype,"activeBasemap",null),e([o()],b.prototype,"disabled",void 0),e([o()],b.prototype,"headingLevel",void 0),e([o()],b.prototype,"iconClass",void 0),e([o()],b.prototype,"icon",void 0),e([o()],b.prototype,"label",null),e([o(),g("esri/widgets/BasemapGallery/t9n/BasemapGallery")],b.prototype,"messages",void 0),e([o()],b.prototype,"source",null),e([o()],b.prototype,"view",null),e([o()],b.prototype,"viewModel",void 0),e([u()],b.prototype,"_handleClick",null),b=e([l("esri.widgets.BasemapGallery")],b);const y=b;export{y as default};
|
package/widgets/Editor/Edits.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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import{HandleOwnerMixin as r}from"../../core/HandleOwner.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";function o(t){return null==t?null:JSON.stringify(t)}let n=class extends(r(e)){constructor(t){super(t),this._baselineAttributesJSON=null,this._baselineGeometryJSON=null,this._stagedForDelete=!1,this.feature=null}get attributesModified(){const t=this.feature?.attributes;return null!=t&&this._baselineAttributesJSON!==this._stringifyAttributes(t)}get geometryModified(){const t=this.feature?.geometry;return null!=t&&this._baselineGeometryJSON!==this._stringifyGeometry(t)}get stagedForDelete(){return this._stagedForDelete}get modified(){return this.attributesModified||this.geometryModified||this._stagedForDelete}stageDelete(){this._stagedForDelete=!0}unstageDelete(){this._stagedForDelete=!1}trackChanges(){const{feature:t}=this;if(!t)return;const{attributes:e,geometry:r}=t;this._baselineAttributesJSON=this._stringifyAttributes(e),this._baselineGeometryJSON=this._stringifyGeometry(r),this.notifyChange("attributesModified"),this.notifyChange("geometryModified")}updateAttributes(t){const{feature:e}=this;e&&(e.attributes=t,this.notifyChange("attributesModified"))}updateGeometry(t){const{feature:e}=this;e&&(e.geometry=t,this.notifyChange("geometryModified"))}_stringifyAttributes(t){return o(t)}_stringifyGeometry(t){return o("mesh"===t?.type?{transform:t.transform}:t)}};t([s()],n.prototype,"_stagedForDelete",void 0),t([s()],n.prototype,"attributesModified",null),t([s()],n.prototype,"feature",void 0),t([s()],n.prototype,"geometryModified",null),t([s()],n.prototype,"modified",null),n=t([i("esri.widgets.Editor.Edits")],n);export{n as Edits};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{makeHandle as t}from"../../core/handleUtils.js";import{onAbort as i,createAbortError as a,throwIfAborted as s,isAborted as r}from"../../core/promiseUtils.js";import{watch as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{getEffectiveLayerCapabilities as l,getEffectiveEditingEnabled as u}from"../../layers/support/layerUtils.js";import{sceneLayerEditingEnabled as c,i3sPatchingEnabled as p}from"../../support/featureFlags.js";import{highlightsSupported as m}from"../../views/support/layerViewUtils.js";import{Edits as h}from"./Edits.js";import f from"./UpdateWorkflowData.js";import g from"./Workflow.js";import{
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{makeHandle as t}from"../../core/handleUtils.js";import{onAbort as i,createAbortError as a,throwIfAborted as s,isAborted as r}from"../../core/promiseUtils.js";import{watch as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{getEffectiveLayerCapabilities as l,getEffectiveEditingEnabled as u}from"../../layers/support/layerUtils.js";import{sceneLayerEditingEnabled as c,i3sPatchingEnabled as p}from"../../support/featureFlags.js";import{highlightsSupported as m}from"../../views/support/layerViewUtils.js";import{Edits as h}from"./Edits.js";import f from"./UpdateWorkflowData.js";import g from"./Workflow.js";import{cloneGraphicExceptMesh as w,createWorkflowSteps as y,fetchCandidates as v,whenEditorLayerView as b,fetchFullFeature as M,findLayerInfo as U,canCreateInteractiveEditSession as j,getVisualVariableAttributes as A,setUpGeometryUpdate as I,isTerminalUpdateEventType as k}from"./workflowUtils.js";var E;const V="candidate-highlight";let x=E=class extends g{constructor(e){super(e),this.type="update"}get shouldShowAttachments(){return!!this.data?.editableItem.attachmentsOnUpdateEnabled}get shouldAllowAttachmentEditing(){return!!this.data?.editableItem.supports.includes("update")}get helpMessage(){return"awaiting-feature-to-update"===this.stepId?"select":void 0}get reliesOnOwnerAdminPrivileges(){const{layer:e}=this.data.editableItem,t=e.capabilities?.operations.supportsUpdate,i=l(e)?.operations.supportsUpdate;return u(e)&&!e.editingEnabled||!!i&&!t}static create(e,t,i){const a=new E({data:new f({edits:new h,viewModel:e}),onCommit:async e=>{const t=e.edits.feature;if(!t)return;const a=t.sourceLayer,s=w(t);if(!e.edits.attributesModified){const e=a.objectIdField;if(s.attributes={[e]:t.getAttribute(e)},c()&&p()&&"scene"===a.type&&null!=a.infoFor3D){const e=a.associatedLayer?.globalIdField;null!=e&&(s.attributes[e]=t.getAttribute(e))}}e.edits.geometryModified||(s.geometry=null),await i(a,{updateFeatures:[s]})}});return a._set("steps",this._createWorkflowSteps(a,t)),a}async deleteFeature(e){const t=this.data.edits.feature;await this.reset();const i=t?.sourceLayer;i&&"applyEdits"in i&&await e(i,{deleteFeatures:[t]})}highlight(e){const t=this.data.viewModel.view;if(!t||!e)return;const i=e&&t.allLayerViews.items.find((({layer:t})=>t===e.layer||"subtype-sublayer"===e.layer?.type&&e.layer?.parent===t));m(i)&&this.handles.add(i.highlight(e),V)}unhighlight(){this.handles.remove(V)}static _createWorkflowSteps(e,n="awaiting-feature-to-update"){const{data:d,handles:l}=e,u=new Map;return y(["awaiting-feature-to-update","awaiting-update-feature-candidate","editing-existing-feature","adding-attachment","editing-attachment"],n,{"awaiting-feature-to-update":()=>({id:"awaiting-feature-to-update",async setUp(){const{spinnerViewModel:e}=d.viewModel,t=d.viewModel.view;let r=null;l.add({remove(){r&&(r.abort(),r=null)}},this.id),d.edits.feature=null,d.candidates=[];const o=t.on("immediate-click",(o=>{e.location=o.mapPoint,e.visible=!0,r?.abort();const{editableItems:n}=d.viewModel;r=new AbortController,new Promise(((e,s)=>{i(r?.signal,(()=>s(a()))),e(v(n,t,o,r?.signal))})).then((e=>{if(s(r),d.candidates=e.reduce(((e,t)=>t.error?e:[...e,...t.value]),[]),d.viewModel.spinnerViewModel.visible=1===d.candidates.length,0===d.candidates.length)return;const t=d.viewModel.activeWorkflow;if(1===d.candidates.length){const e=d.candidates[0];d.edits.feature=e,t.go("editing-existing-feature").catch((()=>{})).then((()=>d.viewModel.spinnerViewModel.visible=!1))}else t.next()}))}));t.focus(),l.add(o,this.id)},async tearDown(){l.remove(this.id)}}),"awaiting-update-feature-candidate":()=>({id:"awaiting-update-feature-candidate",async setUp(){const{edits:t}=d;t.feature=null,l.add(o((()=>t.feature),(t=>{e.unhighlight(),e.highlight(t)})),this.id)},async tearDown(){e.unhighlight(),l.remove(this.id)}}),"editing-existing-feature":()=>({id:"editing-existing-feature",async setUp(){if(l.has("editing-existing-feature"))return;const i=d.edits.feature,a=d.viewModel.view,{attachmentsViewModel:s,editableItems:n,featureFormViewModel:m,layerInfos:h,sketchViewModel:f}=d.viewModel;d.editableItem=n.find((e=>e.layer===i.layer));const g=new AbortController;l.add(t((()=>g.abort())),this.id);const w=b(a,i.layer),y=M(i,a.spatialReference,g.signal),v=await w,E=await y;if(r(g))return;d.edits.updateGeometry(E.geometry),d.edits.updateAttributes(E.attributes),d.edits.trackChanges();const V=d.editableItem.supports,x=V.includes("create"),D=V.includes("update");s.set({capabilities:{editing:!0,operations:{add:x||D,update:D,delete:D}},graphic:E,filesEnabled:!1,mode:"view"});const F=E.sourceLayer,C=null!=F&&"feature"===F.type?U(h,F):void 0,S=C?.formTemplate,W=a.spatialReference;m.set({arcadeEditType:"UPDATE",feature:E,formTemplate:S,spatialReference:W,view:a});const _=j(v)?v.createInteractiveEditSession(i):null,L=[m.on("value-change",(e=>{d.edits.updateAttributes(m.getValues()),E.attributes=d.edits.feature.attributes,_&&_.setAttribute(e.fieldName,e.value)})),o((()=>s.mode),(e=>{"add"===e&&d.viewModel.activeWorkflow.go("adding-attachment"),"edit"===e&&d.viewModel.activeWorkflow.go("editing-attachment")}))];_&&(L.push(t((()=>_.rollback()))),l.add(t((()=>_.commit())),e._handleKeys.afterCommit));if(d.editableItem.geometryUpdatesEnabled){f.allowDeleteKey=!1;const t=A(E),{interactive:i,visual:s}=await I(E,t,f,a,(({geometry:e,attributes:i},a)=>{if(null!=t.rotation){const{field:e}=t.rotation;m.setValue(e,i[e])}if(null!=t.size){const{field:e}=t.size;m.setValue(e,i[e])}d.edits.updateAttributes(i),d.edits.updateGeometry(e),m.feature.geometry=e,"scene"===F?.type&&null!=F?.infoFor3D&&c()&&p()&&_&&"mesh"===e?.type&&_.setGeometry(e),("undo"===a.type||"redo"===a.type||"update"===a.type&&null!=a.toolEventInfo&&k(a.toolEventInfo.type))&&m.notifyFeatureGeometryChanged()}),u);L.push(i,s),l.add(i,e._handleKeys.beforeCommit),l.add(s,e._handleKeys.afterCommit)}else e.highlight(E);l.add(L,this.id)},async tearDown({canceled:t}){t&&(e.unhighlight(),l.remove(this.id))}}),"adding-attachment":()=>({id:"adding-attachment",parent:"editing-existing-feature",async setUp(){},async tearDown(){d.viewModel.attachmentsViewModel.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"editing-existing-feature",async setUp(){},async tearDown(){d.viewModel.attachmentsViewModel.mode="view"}})})}};e([n()],x.prototype,"shouldShowAttachments",null),e([n()],x.prototype,"shouldAllowAttachmentEditing",null),e([n()],x.prototype,"helpMessage",null),e([n()],x.prototype,"reliesOnOwnerAdminPrivileges",null),x=E=e([d("esri.widgets.Editor.UpdateWorkflow")],x);const D=x;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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../Graphic.js";import"../../core/has.js";import{handlesGroup as t}from"../../core/handleUtils.js";import{removeMaybe as r}from"../../core/maybe.js";import{throwIfAborted as n,whenOrAbort as i,eachAlways as a}from"../../core/promiseUtils.js";import{watch as s,initial as l,whenOnce as o}from"../../core/reactiveUtils.js";import{px2pt as c}from"../../core/screenUtils.js";import{diff as u}from"../../core/accessorSupport/diffUtils.js";import{calculateTolerance as p}from"../../renderers/support/clickToleranceUtils.js";import{meterIn as y}from"../../renderers/support/lengthUtils.js";import{getTransformationType as d,TransformationType as f}from"../../renderers/visualVariables/support/sizeVariableUtils.js";import{getRotationAngle as m,getSize as h}from"../../renderers/visualVariables/support/visualVariableUtils.js";import{sceneLayerEditingEnabled as g,i3sPatchingEnabled as b}from"../../support/featureFlags.js";import{to3D as w}from"../../symbols/support/symbolConversion.js";import{getDisplayedSymbol as v}from"../../symbols/support/symbolUtils.js";import{GraphicState as S}from"../../views/3d/layers/graphics/GraphicState.js";import{createQueryGeometry as j}from"../../views/support/drapedUtils.js";import{hitTestSelectSimilarDistance as I,filterGraphicHits as U}from"../../views/support/hitTestSelectUtils.js";function V(e){const t=e.sourceLayer;if(!t||"feature"!==t.type||!E(t.renderer))return{rotation:null,size:null};let r=null,n=null;const i=t.renderer.getVisualVariablesForType("rotation").filter((t=>(!t.axis||"heading"===t.axis)&&t.field&&!t.valueExpression&&null!=m(t,e)));1===i.length&&(r=F(i[0],t));const a=t.renderer.getVisualVariablesForType("size").filter((t=>t.field&&!t.useSymbolValue&&!t.valueExpression&&d(t)===f.RealWorldSize&&null!=h(t,e)));return 1===a.length&&(n=x(a[0],t)),{rotation:r,size:n}}function F(e,t){const r="heading"===(e.axis||"heading")&&"arithmetic"===e.rotationType?-1:1,n=e.field,i=t.fields&&t.fields.filter((e=>e.name===n)),a=i&&1===i.length?i[0].type:"double",s={initial:0,current:0};return{field:n,fieldType:a,getDefault:()=>Promise.resolve(0),getValue:e=>(s.current=s.initial-r*e,L((s.current+360)%360,a)),initValue:e=>{s.initial=null!=e?e:s.current,s.current=0},isUpdatingInteractively:!1,rotationType:e.rotationType??"geographic"}}function T(e,t){switch(t){case"width":return e[0];case"depth":return e[1];case"height":return e[2];default:return e[2]||e[1]||e[0]}}async function z(e,t,r){if(null==t)return 0;const{symbol:n}=w(t);if(null==n||"web-style"===n.type||"cim"===n.type)return 0;const i=n.symbolLayers.getItemAt(0);if(!i)return 0;switch(i.type){case"icon":{const{computeIconLayerResourceSize:e}=await import("../../symbols/support/symbolLayerUtils.js");return i.size||Math.min(J.icon,(await e(i,J.icon))[0])||J.icon}case"text":return i.size||J.text;case"line":return i.size||J.line;case"object":{const{computeObjectLayerResourceSize:t}=await import("../../symbols/support/symbolLayerUtils.js");return T(await t(i,e.scale/J.viewScaleSizeFactor),r)}case"path":return(null!=i.width?i.width:i.height)||e.scale/J.viewScaleSizeFactor;case"extrude":return i.size||e.scale/J.viewScaleSizeFactor;default:return 0}}function x(e,t){const r=e.field,n=e.axis,i=t.fields&&t.fields.filter((e=>e.name===r)),a=i&&1===i.length?i[0].type:"double",s={updating:!1,initial:0,current:0},l=y[e.valueUnit]??1;let o;return o="area"===e.valueRepresentation?e=>(e*l/2)**2*Math.PI:"radius"===e.valueRepresentation||"distance"===e.valueRepresentation?e=>e*l/2:e=>e*l,{field:r,fieldType:a,getDefault:async(e,t)=>L(o(await z(t,e,n)),a),getValue:(e,t)=>(s.initial||(s.initial=t.pixelSizeAt(t.center)),s.current=s.initial*e,L(s.current,a)),initValue:e=>{s.initial=null!=e?e:s.current,s.current=0},isUpdatingInteractively:!1,displayUnit:Y(e.valueUnit),axis:e.axis}}function L(e,t){switch(t){case"small-integer":case"integer":case"long":return Math.round(e);case"double":case"single":return e;default:return 0}}function E(e){switch(e?.type){case"class-breaks":case"simple":case"unique-value":case"dot-density":case"dictionary":case"pie-chart":return!0;default:return!1}}async function A(e,t){const r=await v(e,{useSourceLayer:!0,ignoreGraphicSymbol:!0,webStyleCache:t});null!=u(e.symbol,r)&&(e.symbol=r)}function M(e){if(!e)throw new Error("no geometry type");return"multipatch"===e?"mesh":e}async function O(e,t,r,n){await R(e,t,n);const i=e.on("create",(async i=>{if("cancel"===i.state)return R(e,t,n);if("complete"===i.state){const e=i.graphic;e.sourceLayer||(e.sourceLayer=t.layer),e.attributes||(e.attributes={...t.template.prototype.attributes}),await A(e,n),r(e)}}));return{remove:()=>{i.remove(),e.cancel()}}}async function R(e,t,r){const n=t.layer,i={...t.template.prototype.attributes};await k(e,n,i,r);const a={graphicProperties:{attributes:i,sourceLayer:n},hasZ:n.capabilities.data.supportsZ,geometryToPlace:t.geometryToPlace??void 0};return e.layer.elevationInfo=n.elevationInfo,e.create(M(n.geometryType),a)}async function k(t,r,n,i){const a=new e({sourceLayer:r,attributes:n}),{rotation:s,size:l}=V(a);let o=await v(a,{useSourceLayer:!0,webStyleCache:i}),c=!1;for(const e of[l,s]){if(null==e)continue;null==n[e.field]&&(n[e.field]=await e.getDefault(o,t.view),c=!0)}switch(c&&(o=await v(a,{useSourceLayer:!0,webStyleCache:i})),o?.type){case"simple-fill":case"polygon-3d":t.polygonSymbol=o;break;case"simple-line":case"line-3d":t.polylineSymbol=o;break;case"simple-marker":case"picture-marker":case"point-3d":case"cim":t.pointSymbol=o}P(t.tooltipOptions,l,s)}function P(e,t,r){e.visualVariables=null!=t||null!=r?{size:null!=t?{unit:t.displayUnit,axis:t.axis,valueType:t.fieldType}:null,rotation:null!=r?{valueType:r.fieldType,rotationType:r.rotationType??"geographic"}:null}:null}function D(e,t){return e?e.find((e=>e.layer===t)):void 0}async function G(e,t,r,n){if(0===e.length)return[];const{updatable:s,graphicsByLayer:l}=await r.async((async()=>{const{results:a}=await i(I(t,r),n),s=new Map,l=e=>{const t=e.layer,r=s.get(t);if(!r){const e=new Array;return s.set(t,e),e}return r};U(a).forEach((({graphic:e})=>l(e).push(e)));const o=e.filter((({supports:e,layer:t})=>e.includes("update")&&s.has(t)));return 0!==o.length&&r.stopPropagation(),{updatable:o,graphicsByLayer:s}}));return i(a(s.map((async({layer:e})=>{const{objectIdField:t}=e,r="displayField"in e?e.displayField:null,i=[t];null!=r&&e.fieldsIndex.has(r)&&i.push(r);const a=l.get(e);if(!!a.some((e=>i.some((t=>!(t in e.attributes)))))){const t=e.createQuery();return t.outFields=i,t.returnGeometry=!1,t.objectIds=a.map((e=>e.getObjectId())),e.queryFeatures(t,{signal:n}).then((({features:e})=>e))}return a}))),n)}async function C(e,t,r,n){if(0===e.length)return[];let s=null;const l=await r.async((async()=>{const{results:a}=await i(t.hitTest(r),n);if(0===a.length)return[];const l=new Set;s=U(a),s.forEach((({graphic:e})=>e&&l.add(e.layer)));const o=e.items.filter((({layer:e,supports:t,attachmentsOnUpdateEnabled:r})=>l.has(e)&&(t.includes("update")||t.includes("delete")||r)));return o.length>0&&r.stopPropagation(),o}));return i(a(l.map((({layer:e})=>{const i=e.objectIdField,a="displayField"in e?e.displayField:null,l=[i];null!=a&&e.fieldsIndex.has(a)&&l.push(a);const o=e.createQuery();o.outFields=l,o.returnGeometry=!1;const c="renderer"in e?p({renderer:e.renderer,event:r}):0;return o.geometry=j(r.mapPoint,c,t),o.outSpatialReference=t.spatialReference,e.queryFeatures(o,{signal:n}).then((({features:t})=>(s?.forEach((({graphic:r})=>{r.layer!==e||t.some((e=>e.getObjectId()===r.getObjectId()))||t.push(r)})),t)))}))),n)}async function q(e,t,r,n){switch(t.type){case"3d":return G(e,t,r,n);case"2d":return C(e,t,r,n)}}async function Z(e,t,r){const{sourceLayer:i}=e,a=i.createQuery();a.objectIds=[e.getAttribute(i.objectIdField)],a.outFields=["*"],a.outSpatialReference=t,a.returnM=i.capabilities.data.supportsM,a.returnZ=i.capabilities.data.supportsZ,g()&&b()&&"scene"===i.type&&null!=i.infoFor3D&&(a.returnGeometry=!0,a.formatOf3DObjects="3D_glb");const s=await i.queryFeatures(a,{signal:r});n(r);const l=s.features[0];if("mesh"===l.geometry?.type&&!l.geometry.transform){const e=(await import("../../geometry/support/MeshTransform.js")).default;n(r),l.geometry.transform=new e({geographic:!0})}return l}async function Q(e,t,r,n,i){let a=!1;const{rotation:s,size:l}=n;[s,l].forEach((async r=>{if(null==r)return;const n=t.getAttribute(r.field);if(null!=n)r.initValue(n);else{const n=await r.getDefault(t.symbol,e.view);r.initValue(n),t.setAttribute(r.field,n),a=!0}})),a&&await A(t,i);const o={multipleSelectionEnabled:!1};return"point"===r.geometryType&&(o.enableRotation=null!=s,o.enableScaling=null!=l),P(e.tooltipOptions,l,s),e.layer.elevationInfo=r.elevationInfo,e.update(t,o)}function B(e){return null==e||"rotate-start"!==e.type&&"rotate"!==e.type&&"rotate-stop"!==e.type?null:e}function W(e){return null==e||"scale-start"!==e.type&&"scale"!==e.type&&"scale-stop"!==e.type?null:e}async function _(e,t,r,n,i){if(null==t.geometry||"point"!==t.geometry?.type)return;const a=n.rotation,s=B(r.toolEventInfo);if(null!=a&&null!=s)if("rotate-stop"===s.type)a.isUpdatingInteractively=!1,a.initValue();else{a.isUpdatingInteractively=!0;const{field:r,getValue:n}=a;t.setAttribute(r,n(s.angle,e))}const l=n.size,o=W(r.toolEventInfo);if(null!=l&&null!=o)if("scale-stop"===o.type)l.isUpdatingInteractively=!1,l.initValue();else{l.isUpdatingInteractively=!0;const{field:r,getValue:n}=l;t.setAttribute(r,n(o.xScale,e))}await A(t,i)}async function H(e,n,i,a,c,u){const p=e.clone();await A(p,u),a.map.add(i.layer),i.layer.add(p);const y=e.sourceLayer,d=re(a,y),f=()=>{const t=e.layer,r=e.getAttribute(t.objectIdField);return d.then((e=>e.setVisibility?.(r,!1)),(()=>{})),{remove(){d.then((e=>e.setVisibility?.(r,!0)),(()=>{}))}}};let m=null,h=null;if("3d"===a.type){const e=new S({graphic:p});m=t([a.trackGraphicState(e),s((()=>e.displaying),(e=>{h=e?f():r(h)}),l)])}else h=f();await Q(i,p,y,n,u);let g=null;d.then((e=>g=e),(()=>{}));const b=n.size,w=n.rotation,v=s((()=>e.attributes),(async e=>{let t=!1;for(const r in e){const n=e[r];n!==p.getAttribute(r)&&(p.setAttribute(r,n),null==b||b.isUpdatingInteractively||b.field!==r||b.initValue(n),null==w||w.isUpdatingInteractively||w.field!==r||w.initValue(n),(null==g||g.requiredFields.includes(r))&&(t=!0))}t&&await A(p,u)})),j=i.on("update",(async e=>{const t=e.graphics[0];if("complete"===e.state)return Q(i,t,y,n,u);await _(a,t,e,n,u),c(t.clone(),e)})),I=i.on(["undo","redo"],(async e=>{c(e.graphics[0].clone(),e)})),U=()=>{};return{interactive:{remove(){I.remove(),j.remove(),i.cancel(),v&&v.remove(),this.remove=U}},visual:{remove(){r(h),re(a,y).then((e=>o((()=>!e.updating)))).then((()=>{r(m),i.layer.remove(p),this.remove=U}))}}}}const J={icon:c(24),text:c(12),line:c(1),viewScaleSizeFactor:100};function K(e,t,r){let n=!1;return e.filter((e=>!!n||(n=e===t,n))).map((e=>r[e]()))}function N(e){if(1!==e.length)return null;const t=e[0];if("items"in t){const e=t;return 1===e.items.length?e.items[0]:null}return t}function X(e,t){if(e.viewModel.refreshCreationTemplates(),"awaiting-feature-creation-info"===t[0].id){const r=N(e.viewModel.featureTemplatesViewModel.items);null==r||r.supportsUpload||(e.creationInfo=r,t.shift())}return t}function Y(e){switch(e){case"unknown":case"decimal-degrees":return null;default:return e}}function $(e){e.filesEnabled=!0,e.mode="view",e.capabilities={editing:!0,operations:{add:!0,update:!0,delete:!0}}}function ee(e){const{creationInfo:t,viewModel:r}=e;if(!t)return!1;const{layer:n}=t,i=r.editableItems.find((e=>e.layer===n));if(i)return i.attachmentsOnCreateEnabled;const a=n.capabilities?.data,s=r.layerInfos?.find((e=>e.layer===n));return!(!(a&&"supportsAttachment"in a&&a.supportsAttachment)||s&&(!1===s.allowAttachments||!1===s.attachmentsOnUpdateEnabled))}const te=e=>/-stop/.test(e)||/vertex-/.test(e),re=(e,t)=>{const r="subtype-sublayer"===t.type?t.parent:t;return e.whenLayerView(r)};function ne(e){return"createInteractiveEditSession"in e}const ie=Symbol();function ae(e){return e&&"object"==typeof e&&ie in e}export{ie as UsesSketchViewModelSymbol,X as avoidFeatureTemplateSelectionWithOnlyOneItem,ne as canCreateInteractiveEditSession,K as createWorkflowSteps,q as fetchCandidates,Z as fetchFullFeature,D as findLayerInfo,V as getVisualVariableAttributes,te as isTerminalUpdateEventType,$ as prepareAttachmentsForCreateWorkflow,O as setUpFeatureAdd,H as setUpGeometryUpdate,ee as shouldShowAttachmentsForCreateWorkflow,J as sizeDefaults,Y as sizeVariableUnitToLengthUnit,R as startCreatingNewFeature,Q as startUpdatingFeature,A as updateGraphicSymbolWhenRequired,_ as visualVariableInteractiveUpdate,re as whenEditorLayerView,ae as workflowUsesSketchViewModel};
|
|
5
|
+
import e from"../../Graphic.js";import"../../core/has.js";import{handlesGroup as t}from"../../core/handleUtils.js";import{clone as r}from"../../core/lang.js";import{removeMaybe as n}from"../../core/maybe.js";import{throwIfAborted as i,whenOrAbort as a,eachAlways as s}from"../../core/promiseUtils.js";import{watch as l,initial as o,whenOnce as c}from"../../core/reactiveUtils.js";import{px2pt as u}from"../../core/screenUtils.js";import{diff as p}from"../../core/accessorSupport/diffUtils.js";import{calculateTolerance as y}from"../../renderers/support/clickToleranceUtils.js";import{meterIn as f}from"../../renderers/support/lengthUtils.js";import{getTransformationType as d,TransformationType as m}from"../../renderers/visualVariables/support/sizeVariableUtils.js";import{getRotationAngle as g,getSize as h}from"../../renderers/visualVariables/support/visualVariableUtils.js";import{sceneLayerEditingEnabled as b,i3sPatchingEnabled as w}from"../../support/featureFlags.js";import{to3D as v}from"../../symbols/support/symbolConversion.js";import{getDisplayedSymbol as S}from"../../symbols/support/symbolUtils.js";import{GraphicState as j}from"../../views/3d/layers/graphics/GraphicState.js";import{createQueryGeometry as I}from"../../views/support/drapedUtils.js";import{hitTestSelectSimilarDistance as U,filterGraphicHits as V}from"../../views/support/hitTestSelectUtils.js";function F(e){const t=e.sourceLayer;if(!t||"feature"!==t.type||!A(t.renderer))return{rotation:null,size:null};let r=null,n=null;const i=t.renderer.getVisualVariablesForType("rotation").filter((t=>(!t.axis||"heading"===t.axis)&&t.field&&!t.valueExpression&&null!=g(t,e)));1===i.length&&(r=T(i[0],t));const a=t.renderer.getVisualVariablesForType("size").filter((t=>t.field&&!t.useSymbolValue&&!t.valueExpression&&d(t)===m.RealWorldSize&&null!=h(t,e)));return 1===a.length&&(n=L(a[0],t)),{rotation:r,size:n}}function T(e,t){const r="heading"===(e.axis||"heading")&&"arithmetic"===e.rotationType?-1:1,n=e.field,i=t.fields&&t.fields.filter((e=>e.name===n)),a=i&&1===i.length?i[0].type:"double",s={initial:0,current:0};return{field:n,fieldType:a,getDefault:()=>Promise.resolve(0),getValue:e=>(s.current=s.initial-r*e,E((s.current+360)%360,a)),initValue:e=>{s.initial=null!=e?e:s.current,s.current=0},isUpdatingInteractively:!1,rotationType:e.rotationType??"geographic"}}function z(e,t){switch(t){case"width":return e[0];case"depth":return e[1];case"height":return e[2];default:return e[2]||e[1]||e[0]}}async function x(e,t,r){if(null==t)return 0;const{symbol:n}=v(t);if(null==n||"web-style"===n.type||"cim"===n.type)return 0;const i=n.symbolLayers.getItemAt(0);if(!i)return 0;switch(i.type){case"icon":{const{computeIconLayerResourceSize:e}=await import("../../symbols/support/symbolLayerUtils.js");return i.size||Math.min(K.icon,(await e(i,K.icon))[0])||K.icon}case"text":return i.size||K.text;case"line":return i.size||K.line;case"object":{const{computeObjectLayerResourceSize:t}=await import("../../symbols/support/symbolLayerUtils.js");return z(await t(i,e.scale/K.viewScaleSizeFactor),r)}case"path":return(null!=i.width?i.width:i.height)||e.scale/K.viewScaleSizeFactor;case"extrude":return i.size||e.scale/K.viewScaleSizeFactor;default:return 0}}function L(e,t){const r=e.field,n=e.axis,i=t.fields&&t.fields.filter((e=>e.name===r)),a=i&&1===i.length?i[0].type:"double",s={updating:!1,initial:0,current:0},l=f[e.valueUnit]??1;let o;return o="area"===e.valueRepresentation?e=>(e*l/2)**2*Math.PI:"radius"===e.valueRepresentation||"distance"===e.valueRepresentation?e=>e*l/2:e=>e*l,{field:r,fieldType:a,getDefault:async(e,t)=>E(o(await x(t,e,n)),a),getValue:(e,t)=>(s.initial||(s.initial=t.pixelSizeAt(t.center)),s.current=s.initial*e,E(s.current,a)),initValue:e=>{s.initial=null!=e?e:s.current,s.current=0},isUpdatingInteractively:!1,displayUnit:$(e.valueUnit),axis:e.axis}}function E(e,t){switch(t){case"small-integer":case"integer":case"long":return Math.round(e);case"double":case"single":return e;default:return 0}}function A(e){switch(e?.type){case"class-breaks":case"simple":case"unique-value":case"dot-density":case"dictionary":case"pie-chart":return!0;default:return!1}}async function M(e,t){const r=await S(e,{useSourceLayer:!0,ignoreGraphicSymbol:!0,webStyleCache:t});null!=p(e.symbol,r)&&(e.symbol=r)}function O(e){if(!e)throw new Error("no geometry type");return"multipatch"===e?"mesh":e}async function R(e,t,r,n){await k(e,t,n);const i=e.on("create",(async i=>{if("cancel"===i.state)return k(e,t,n);if("complete"===i.state){const e=i.graphic;e.sourceLayer||(e.sourceLayer=t.layer),e.attributes||(e.attributes={...t.template.prototype.attributes}),await M(e,n),r(e)}}));return{remove:()=>{i.remove(),e.cancel()}}}async function k(e,t,r){const n=t.layer,i={...t.template.prototype.attributes};await P(e,n,i,r);const a={graphicProperties:{attributes:i,sourceLayer:n},hasZ:n.capabilities.data.supportsZ,geometryToPlace:t.geometryToPlace??void 0};return e.layer.elevationInfo=n.elevationInfo,e.create(O(n.geometryType),a)}async function P(t,r,n,i){const a=new e({sourceLayer:r,attributes:n}),{rotation:s,size:l}=F(a);let o=await S(a,{useSourceLayer:!0,webStyleCache:i}),c=!1;for(const e of[l,s]){if(null==e)continue;null==n[e.field]&&(n[e.field]=await e.getDefault(o,t.view),c=!0)}switch(c&&(o=await S(a,{useSourceLayer:!0,webStyleCache:i})),o?.type){case"simple-fill":case"polygon-3d":t.polygonSymbol=o;break;case"simple-line":case"line-3d":t.polylineSymbol=o;break;case"simple-marker":case"picture-marker":case"point-3d":case"cim":t.pointSymbol=o}D(t.tooltipOptions,l,s)}function D(e,t,r){e.visualVariables=null!=t||null!=r?{size:null!=t?{unit:t.displayUnit,axis:t.axis,valueType:t.fieldType}:null,rotation:null!=r?{valueType:r.fieldType,rotationType:r.rotationType??"geographic"}:null}:null}function G(e,t){return e?e.find((e=>e.layer===t)):void 0}async function C(e,t,r,n){if(0===e.length)return[];const{updatable:i,graphicsByLayer:l}=await r.async((async()=>{const{results:i}=await a(U(t,r),n),s=new Map,l=e=>{const t=e.layer,r=s.get(t);if(!r){const e=new Array;return s.set(t,e),e}return r};V(i).forEach((({graphic:e})=>l(e).push(e)));const o=e.filter((({supports:e,layer:t})=>e.includes("update")&&s.has(t)));return 0!==o.length&&r.stopPropagation(),{updatable:o,graphicsByLayer:s}}));return a(s(i.map((async({layer:e})=>{const{objectIdField:t}=e,r="displayField"in e?e.displayField:null,i=[t];null!=r&&e.fieldsIndex.has(r)&&i.push(r);const a=l.get(e);if(!!a.some((e=>i.some((t=>!(t in e.attributes)))))){const t=e.createQuery();return t.outFields=i,t.returnGeometry=!1,t.objectIds=a.map((e=>e.getObjectId())),e.queryFeatures(t,{signal:n}).then((({features:e})=>e))}return a}))),n)}async function q(e,t,r,n){if(0===e.length)return[];let i=null;const l=await r.async((async()=>{const{results:s}=await a(t.hitTest(r),n);if(0===s.length)return[];const l=new Set;i=V(s),i.forEach((({graphic:e})=>e&&l.add(e.layer)));const o=e.items.filter((({layer:e,supports:t,attachmentsOnUpdateEnabled:r})=>l.has(e)&&(t.includes("update")||t.includes("delete")||r)));return o.length>0&&r.stopPropagation(),o}));return a(s(l.map((({layer:e})=>{const a=e.objectIdField,s="displayField"in e?e.displayField:null,l=[a];null!=s&&e.fieldsIndex.has(s)&&l.push(s);const o=e.createQuery();o.outFields=l,o.returnGeometry=!1;const c="renderer"in e?y({renderer:e.renderer,event:r}):0;return o.geometry=I(r.mapPoint,c,t),o.outSpatialReference=t.spatialReference,e.queryFeatures(o,{signal:n}).then((({features:t})=>(i?.forEach((({graphic:r})=>{r.layer!==e||t.some((e=>e.getObjectId()===r.getObjectId()))||t.push(r)})),t)))}))),n)}async function Z(e,t,r,n){switch(t.type){case"3d":return C(e,t,r,n);case"2d":return q(e,t,r,n)}}async function Q(e,t,r){const{sourceLayer:n}=e,a=n.createQuery();a.objectIds=[e.getAttribute(n.objectIdField)],a.outFields=["*"],a.outSpatialReference=t,a.returnM=n.capabilities.data.supportsM,a.returnZ=n.capabilities.data.supportsZ,b()&&w()&&"scene"===n.type&&null!=n.infoFor3D&&(a.returnGeometry=!0,a.formatOf3DObjects="3D_glb");const s=await n.queryFeatures(a,{signal:r});i(r);const l=s.features[0];if("mesh"===l.geometry?.type&&!l.geometry.transform){const e=(await import("../../geometry/support/MeshTransform.js")).default;i(r),l.geometry.transform=new e({geographic:!0})}return l}async function B(e,t,r,n,i){let a=!1;const{rotation:s,size:l}=n;[s,l].forEach((async r=>{if(null==r)return;const n=t.getAttribute(r.field);if(null!=n)r.initValue(n);else{const n=await r.getDefault(t.symbol,e.view);r.initValue(n),t.setAttribute(r.field,n),a=!0}})),a&&await M(t,i);const o={multipleSelectionEnabled:!1};return"point"===r.geometryType&&(o.enableRotation=null!=s,o.enableScaling=null!=l),D(e.tooltipOptions,l,s),e.layer.elevationInfo=r.elevationInfo,e.update(t,o)}function W(e){return null==e||"rotate-start"!==e.type&&"rotate"!==e.type&&"rotate-stop"!==e.type?null:e}function _(e){return null==e||"scale-start"!==e.type&&"scale"!==e.type&&"scale-stop"!==e.type?null:e}async function H(e,t,r,n,i){if(null==t.geometry||"point"!==t.geometry?.type)return;const a=n.rotation,s=W(r.toolEventInfo);if(null!=a&&null!=s)if("rotate-stop"===s.type)a.isUpdatingInteractively=!1,a.initValue();else{a.isUpdatingInteractively=!0;const{field:r,getValue:n}=a;t.setAttribute(r,n(s.angle,e))}const l=n.size,o=_(r.toolEventInfo);if(null!=l&&null!=o)if("scale-stop"===o.type)l.isUpdatingInteractively=!1,l.initValue();else{l.isUpdatingInteractively=!0;const{field:r,getValue:n}=l;t.setAttribute(r,n(o.xScale,e))}await M(t,i)}async function J(e,r,i,a,s,u){const p=le(e);await M(p,u),a.map.add(i.layer),i.layer.add(p);const y=e.sourceLayer,f=ne(a,y),d=()=>{const t=e.layer,r=e.getAttribute(t.objectIdField);return f.then((e=>e.setVisibility?.(r,!1)),(()=>{})),{remove(){f.then((e=>e.setVisibility?.(r,!0)),(()=>{}))}}};let m=null,g=null;if("3d"===a.type){const e=new j({graphic:p});m=t([a.trackGraphicState(e),l((()=>e.displaying),(e=>{g=e?d():n(g)}),o)])}else g=d();await B(i,p,y,r,u);let h=null;f.then((e=>h=e),(()=>{}));const b=r.size,w=r.rotation,v=l((()=>e.attributes),(async e=>{let t=!1;for(const r in e){const n=e[r];n!==p.getAttribute(r)&&(p.setAttribute(r,n),null==b||b.isUpdatingInteractively||b.field!==r||b.initValue(n),null==w||w.isUpdatingInteractively||w.field!==r||w.initValue(n),(null==h||h.requiredFields.includes(r))&&(t=!0))}t&&await M(p,u)})),S=i.on("update",(async e=>{const t=e.graphics[0];if("complete"===e.state)return B(i,t,y,r,u);await H(a,t,e,r,u),s(le(t),e)})),I=i.on(["undo","redo"],(async e=>{s(le(e.graphics[0]),e)})),U=()=>{};return{interactive:{remove(){I.remove(),S.remove(),i.cancel(),v&&v.remove(),this.remove=U}},visual:{remove(){n(g),ne(a,y).then((e=>c((()=>!e.updating)))).then((()=>{n(m),i.layer.remove(p),this.remove=U}))}}}}const K={icon:u(24),text:u(12),line:u(1),viewScaleSizeFactor:100};function N(e,t,r){let n=!1;return e.filter((e=>!!n||(n=e===t,n))).map((e=>r[e]()))}function X(e){if(1!==e.length)return null;const t=e[0];if("items"in t){const e=t;return 1===e.items.length?e.items[0]:null}return t}function Y(e,t){if(e.viewModel.refreshCreationTemplates(),"awaiting-feature-creation-info"===t[0].id){const r=X(e.viewModel.featureTemplatesViewModel.items);null==r||r.supportsUpload||(e.creationInfo=r,t.shift())}return t}function $(e){switch(e){case"unknown":case"decimal-degrees":return null;default:return e}}function ee(e){e.filesEnabled=!0,e.mode="view",e.capabilities={editing:!0,operations:{add:!0,update:!0,delete:!0}}}function te(e){const{creationInfo:t,viewModel:r}=e;if(!t)return!1;const{layer:n}=t,i=r.editableItems.find((e=>e.layer===n));if(i)return i.attachmentsOnCreateEnabled;const a=n.capabilities?.data,s=r.layerInfos?.find((e=>e.layer===n));return!(!(a&&"supportsAttachment"in a&&a.supportsAttachment)||s&&(!1===s.allowAttachments||!1===s.attachmentsOnUpdateEnabled))}const re=e=>/-stop/.test(e)||/vertex-/.test(e),ne=(e,t)=>{const r="subtype-sublayer"===t.type?t.parent:t;return e.whenLayerView(r)};function ie(e){return"createInteractiveEditSession"in e}const ae=Symbol();function se(e){return e&&"object"==typeof e&&ae in e}function le(e){const t=e.geometry;if("mesh"===t?.type){const n=e.cloneShallow();return n.attributes=r(e.attributes),n.geometry=t.cloneShallow(),n.geometry.transform=t.transform?.clone()??null,n}return e.clone()}export{ae as UsesSketchViewModelSymbol,Y as avoidFeatureTemplateSelectionWithOnlyOneItem,ie as canCreateInteractiveEditSession,le as cloneGraphicExceptMesh,N as createWorkflowSteps,Z as fetchCandidates,Q as fetchFullFeature,G as findLayerInfo,F as getVisualVariableAttributes,re as isTerminalUpdateEventType,ee as prepareAttachmentsForCreateWorkflow,R as setUpFeatureAdd,J as setUpGeometryUpdate,te as shouldShowAttachmentsForCreateWorkflow,K as sizeDefaults,$ as sizeVariableUnitToLengthUnit,k as startCreatingNewFeature,B as startUpdatingFeature,M as updateGraphicSymbolWhenRequired,H as visualVariableInteractiveUpdate,ne as whenEditorLayerView,se as workflowUsesSketchViewModel};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{destroyMaybe as t}from"../../core/maybe.js";import{after as s}from"../../core/promiseUtils.js";import{watch as r,initial as i,on as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{cast as a}from"../../core/accessorSupport/decorators/cast.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import d from"../Widget.js";import c from"./FeatureRelationship/FeatureRelationshipViewModel.js";import u from"./support/FeatureElementInfo.js";import{loadCalciteComponents as h}from"../support/componentsUtils.js";import{isRTL as p}from"../support/widgetUtils.js";import{messageBundle as m}from"../support/decorators/messageBundle.js";import{tsx as v}from"../support/jsxFactory.js";import{substitute as g}from"../../intl/substitute.js";const w="esri-feature",b=`${w}-relationship`,f={base:b,esriWidget:"esri-widget",listContainer:`${b}__list`,listContainerQuerying:`${b}__list--querying`,featureObserver:`${w}__feature-observer`,stickySpinnerContainer:`${w}__sticky-loading-container`,loadingSpinnerContainer:`${w}__loading-container`,spinner:`${w}__loading-spinner`,iconLoading:"esri-icon-loading-indicator esri-rotating"},y={title:!0,description:!0};let F=class extends d{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver((([e])=>{e?.isIntersecting&&this._increaseFeaturePage()}),{root:window.document}),this.headingLevel=2,this.viewModel=new c,this.messages=null,this.messagesCommon=null,this.visibleElements={...y},this._increaseFeaturePage=()=>{const{state:e,showAllEnabled:t,relatedFeatures:s,featuresPerPage:r,featurePage:i}=this.viewModel;"ready"===e&&t&&s.length>=r*i&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new u,this.addHandles([r((()=>[this.viewModel.description,this.viewModel.title,this.headingLevel]),(()=>this._setupFeatureElementInfo()),i),r((()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode]),(()=>this._handleRelatedFeatureObserverChange())),o((()=>this.viewModel.relatedFeatureViewModels),"change",(()=>this._setupRelatedFeatureViewModels()))])}loadDependencies(){return h({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js")})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=t(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:s,
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{destroyMaybe as t}from"../../core/maybe.js";import{after as s}from"../../core/promiseUtils.js";import{watch as r,initial as i,on as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{cast as a}from"../../core/accessorSupport/decorators/cast.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import d from"../Widget.js";import c from"./FeatureRelationship/FeatureRelationshipViewModel.js";import u from"./support/FeatureElementInfo.js";import{loadCalciteComponents as h}from"../support/componentsUtils.js";import{isRTL as p}from"../support/widgetUtils.js";import{messageBundle as m}from"../support/decorators/messageBundle.js";import{tsx as v}from"../support/jsxFactory.js";import{substitute as g}from"../../intl/substitute.js";const w="esri-feature",b=`${w}-relationship`,f={base:b,esriWidget:"esri-widget",listContainer:`${b}__list`,listContainerQuerying:`${b}__list--querying`,featureObserver:`${w}__feature-observer`,stickySpinnerContainer:`${w}__sticky-loading-container`,loadingSpinnerContainer:`${w}__loading-container`,spinner:`${w}__loading-spinner`,iconLoading:"esri-icon-loading-indicator esri-rotating"},y={title:!0,description:!0};let F=class extends d{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver((([e])=>{e?.isIntersecting&&this._increaseFeaturePage()}),{root:window.document}),this.headingLevel=2,this.viewModel=new c,this.messages=null,this.messagesCommon=null,this.visibleElements={...y},this._increaseFeaturePage=()=>{const{state:e,showAllEnabled:t,relatedFeatures:s,featuresPerPage:r,featurePage:i}=this.viewModel;"ready"===e&&t&&s.length>=r*i&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new u,this.addHandles([r((()=>[this.viewModel.description,this.viewModel.title,this.headingLevel]),(()=>this._setupFeatureElementInfo()),i),r((()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode]),(()=>this._handleRelatedFeatureObserverChange())),o((()=>this.viewModel.relatedFeatureViewModels),"change",(()=>this._setupRelatedFeatureViewModels()))])}loadDependencies(){return h({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js")})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=t(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:s,state:r}=this.viewModel;return!e&&!!t&&"ready"===r&&(t>s||0===s)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return g(e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...y,...e}}renderStickyLoading(){return"querying"===this.viewModel.state?v("div",{key:"sticky-loader",class:f.stickySpinnerContainer},this.renderLoadingIcon()):null}renderLoadingIcon(){return v("span",{class:this.classes(f.iconLoading,f.spinner)})}renderLoading(){return v("div",{key:"loading-container",class:f.loadingSpinnerContainer},this.renderLoadingIcon())}renderShowAllIconNode(){return v("calcite-icon",{scale:"s",icon:"list",slot:"content-end"})}renderChevronIconNode(){const e=p(this.container)?"chevron-left":"chevron-right";return v("calcite-icon",{scale:"s",icon:e,slot:"content-end"})}renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,s=e.title;e.description=t&&e.formattedAttributes?.global[t];const r="loading"===e.state;return v("calcite-list-item",{key:e.uid,label:r?`${this.messagesCommon?.loading}…`:s,description:r?"…":e.description??"",onCalciteListItemSelect:()=>this.emit("select-record",{featureViewModel:e})},this.renderChevronIconNode())}renderShowAllListItem(){return this.displayShowAllButton?v("calcite-list-item",{key:"show-all-item",label:this.messages?.showAll,description:this.featureCountDescription,onCalciteListItemSelect:()=>this.emit("show-all-records")},this.renderShowAllIconNode()):null}renderNoRelatedFeaturesMessage(){return v("calcite-notice",{key:"no-related-features-message",icon:"information",open:!0,kind:"brand",scale:"s",width:"full"},v("div",{slot:"message"},this.messages?.noRelatedFeatures))}renderFeatureObserver(){return v("div",{key:"feature-observer",class:f.featureObserver,bind:this,afterCreate:this._relatedFeatureIntersectionObserverCreated})}renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return v("calcite-list",null,e.toArray().map((e=>this.renderRelatedFeature(e))),this.renderShowAllListItem())}renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return v("div",{key:"list-container",class:this.classes(f.listContainer,{[f.listContainerQuerying]:"querying"===t})},e?this.renderList():"ready"===t?this.renderNoRelatedFeaturesMessage():null,this.renderStickyLoading(),this.renderFeatureObserver())}renderRelationshipNotFound(){return v("calcite-notice",{key:"relationship-not-found",icon:"exclamation-mark-triangle",open:!0,kind:"danger",scale:"s",width:"full"},v("div",{slot:"message"},this.messages?.relationshipNotFound))}render(){const{state:e}=this.viewModel;return v("div",{class:this.classes(f.base,f.esriWidget)},this._featureElementInfo?.render(),"loading"===e?this.renderLoading():"disabled"===e?this.renderRelationshipNotFound():this.renderRelatedFeatures())}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach((e=>{this.addHandles(r((()=>[e.title,e.state]),(()=>this.scheduleRender()),i),t)})),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,s=t.description&&this.description,r=t.title&&this.title;this._featureElementInfo?.set({description:s,title:r,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await s(0),this._relatedFeatureIntersectionObserverNode&&"ready"===e&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};e([n()],F.prototype,"_relatedFeatureIntersectionObserverNode",void 0),e([n({readOnly:!0})],F.prototype,"displayShowAllButton",null),e([n({readOnly:!0})],F.prototype,"displayListItems",null),e([n()],F.prototype,"description",null),e([n({readOnly:!0})],F.prototype,"featureCountDescription",null),e([n()],F.prototype,"headingLevel",void 0),e([n()],F.prototype,"title",null),e([n({type:c})],F.prototype,"viewModel",void 0),e([n(),m("esri/widgets/Feature/t9n/Feature")],F.prototype,"messages",void 0),e([n(),m("esri/t9n/common")],F.prototype,"messagesCommon",void 0),e([n()],F.prototype,"visibleElements",void 0),e([a("visibleElements")],F.prototype,"castVisibleElements",null),F=e([l("esri.widgets.Feature.FeatureRelationship")],F);const _=F;export{_ 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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{watch as t,initial as r}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import l from"../Feature/FeatureRelationship/FeatureRelationshipViewModel.js";import{isRelatableFeatureSupportedLayer as o}from"../Feature/support/featureUtils.js";import a from"./EditableInput.js";const n=3;let p=class extends a{constructor(e){super(e),this._relationshipVM=null,this.group=null,this.type="relationship",this.handles.add([t((()=>({feature:this.feature,element:this.element,layer:this.layer})),(e=>this._createRelationshipVM(e)),r)])}destroy(){this._relationshipVM?.destroy()}get addActionVisible(){return this.editable}get displayCount(){return this.element.displayCount??n}get displayType(){return this.element.displayType}get editable(){const{element:e,layer:t}=this;return
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{watch as t,initial as r}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import l from"../Feature/FeatureRelationship/FeatureRelationshipViewModel.js";import{isRelatableFeatureSupportedLayer as o}from"../Feature/support/featureUtils.js";import a from"./EditableInput.js";const n=3;let p=class extends a{constructor(e){super(e),this._relationshipVM=null,this.group=null,this.type="relationship",this.handles.add([t((()=>({feature:this.feature,element:this.element,layer:this.layer})),(e=>this._createRelationshipVM(e)),r)])}destroy(){this._relationshipVM?.destroy()}get addActionVisible(){return this.editable}get displayCount(){return this.element.displayCount??n}get displayType(){return this.element.displayType}get editable(){const{element:e,layer:t}=this;return e?.editableExpression?!!this.evaluatedEditableExpression:!!t?.userHasUpdateItemPrivileges}get featureCount(){return this._relationshipVM?.featureCount??0}get map(){return this._get("map")}set map(e){e&&this._relationshipVM?.set("map",e),this._set("map",e)}get orderByFields(){return this.element.orderByFields}get relationshipId(){return this.element.relationshipId}get relatedFeatureInfos(){return this._relationshipVM?.relatedFeatureInfos??[]}get relatedLayer(){return this._relationshipVM?.relatedLayer}get showAllEnabled(){return this._get("showAllEnabled")}set showAllEnabled(e){this._relationshipVM?.set("showAllEnabled",e),this._set("showAllEnabled",e)}get showAllActionVisible(){return!this.showAllEnabled&&this.featureCount>0&&this.featureCount>this.displayCount}get updating(){return"loading"===this._relationshipVM?.state||"querying"===this._relationshipVM?.state}incrementPage(){this._relationshipVM&&this._relationshipVM.featurePage++}getRelatedFeatureByObjectId(e){return this._relationshipVM?.getRelatedFeatureByObjectId(e)}_createRelationshipVM(e){const{feature:t,element:r,layer:s}=e;if(this._relationshipVM?.destroy(),!t||!r||!s)return;const{displayCount:i,map:a,orderByFields:n,relationshipId:p,showAllEnabled:u}=this;o(s)&&(this._relationshipVM=new l({graphic:t,displayCount:i,layer:s,map:a,orderByFields:n,relationshipId:p,showAllEnabled:u}))}};e([s()],p.prototype,"addActionVisible",null),e([s()],p.prototype,"displayCount",null),e([s()],p.prototype,"displayType",null),e([s()],p.prototype,"editable",null),e([s()],p.prototype,"group",void 0),e([s()],p.prototype,"map",null),e([s()],p.prototype,"orderByFields",null),e([s()],p.prototype,"relationshipId",null),e([s()],p.prototype,"relatedFeatureInfos",null),e([s()],p.prototype,"relatedLayer",null),e([s()],p.prototype,"showAllEnabled",null),e([s()],p.prototype,"showAllActionVisible",null),e([s({readOnly:!0})],p.prototype,"type",void 0),e([s()],p.prototype,"updating",null),e([s()],p.prototype,"incrementPage",null),e([s()],p.prototype,"getRelatedFeatureByObjectId",null),p=e([i("esri.widgets.FeatureForm.RelationshipInput")],p);const u=p;export{u as default};
|
package/widgets/FeatureForm.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{neverReached as i}from"../core/compilerUtils.js";import{deprecatedProperty as s}from"../core/deprecate.js";import l from"../core/Logger.js";import{watch as a}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import o from"./Widget.js";import{CSS as d}from"./FeatureForm/css.js";import{isGroupInput as u,isFieldInput as c,isRelationshipInput as p,isInputInGroupInput as m,isFieldElementWithInputType as h,getErrorMessageForFieldInput as v,getIconForFeature as _,isNumberFieldInput as b}from"./FeatureForm/featureFormUtils.js";import g from"./FeatureForm/FeatureFormViewModel.js";import{loadCalciteComponents as f}from"./support/componentsUtils.js";import{Heading as I,incrementHeadingLevel as F}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as y}from"./support/decorators/messageBundle.js";import{vmEvent as w}from"./support/decorators/vmEvent.js";import{tsx as R}from"./support/jsxFactory.js";import{DateTime as V}from"luxon";import{substitute as C}from"../intl/substitute.js";import{getLocale as D}from"../intl/locale.js";const O="TT",M="data-field-name",T="latn",k=e=>"valueAsDate"in e,x="esri.widgets.FeatureForm",N=l.getLogger(x);let L=class extends o{constructor(e,t){super(e,t),this._dateFieldInputMap=new Map,this._activeInputName="",this._activeNumberFieldEdit=null,this._fieldFocusNeeded=!1,this._fieldToInitialIncompatibleDomainValue=new Map,this._switchFieldsWithInitialIncompatibleValue=new Set,this._userUpdatedFieldInputNames=new Set,this._listObserverNode=null,this._listObserver=new IntersectionObserver((e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()}),{root:window.document}),this.disabled=!1,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesTemplates=null,this.relatedRecordCallbacks=null,this.viewModel=new g,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,relatedRecordCallbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=e=>{const{feature:t,relatedRecordCallbacks:i}=this;t&&i?.addRelatedRecord&&i.addRelatedRecord({parentFeature:t,relationshipId:e})},this._handleInputInput=e=>{this._commitInputValue(e.currentTarget)},this._handleFormKeyDown=this._handleFormKeyDown.bind(this),this._handleInputBlur=this._handleInputBlur.bind(this),this._handleInputFocus=this._handleInputFocus.bind(this),this._handleNumberInputMouseDown=this._handleNumberInputMouseDown.bind(this),this._handleInputKeyDown=this._handleInputKeyDown.bind(this),this._handleOptionChange=this._handleOptionChange.bind(this),this._handleGroupClick=this._handleGroupClick.bind(this),this._handleSubmit=this._handleSubmit.bind(this),this._afterInputCreateOrUpdate=this._afterInputCreateOrUpdate.bind(this),this._afterDateInputCreateOrUpdate=this._afterDateInputCreateOrUpdate.bind(this)}initialize(){this.addHandles([a((()=>this.feature),(()=>{const e=this._getFocusableInput("forward");this._activeInputName=e?.name||"",this._userUpdatedFieldInputNames.clear(),this._fieldToInitialIncompatibleDomainValue.clear(),this._switchFieldsWithInitialIncompatibleValue.clear(),this._dateFieldInputMap.clear(),this._fieldFocusNeeded=!0})),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._userUpdatedFieldInputNames.add(e))),this._activeInputName=t,this._fieldFocusNeeded=!0,this.scheduleRender()}})),a((()=>[this.viewModel.activeRelationshipInput,this._listObserverNode]),(()=>this._onObserverChange()))])}loadDependencies(){return f({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox.js"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item.js"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker.js"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message.js"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker.js"),label:()=>import("@esri/calcite-components/dist/components/calcite-label.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress.js"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch.js")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const e=this.relatedRecordCallbacks;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get view(){return s(N,"view",{replacement:"Use FeatureForm.map instead.",version:"4.27"}),this.viewModel.view}set view(e){s(N,"view",{replacement:"Use FeatureForm.map instead.",version:"4.27"}),this.viewModel.view=e}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return R("div",{class:this.classes(d.base,d.widget,d.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return R("form",{class:d.form,novalidate:!0,onsubmit:this._handleSubmit,onkeydown:this._handleFormKeyDown},this._renderHeader(),this._renderInputs())}_renderHeader(){const e=this.viewModel;if(!e.formHeaderVisible)return;const t=null!=e.formTitle&&R(I,{key:"title",level:this.headingLevel},e.formTitle),i=null!=e.formDescription&&R("p",{class:d.description,key:"description"},e.formDescription);return R("div",{class:d.formHeader},t,i)}_renderInputs(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderActiveRelationshipInput(e.activeRelationshipInput):e.inputs.filter(t).filter((e=>e.visible)).map(((e,t)=>u(e)?this._renderGroup(e,t):c(e)?this._renderLabeledField(e):p(e)?this._renderRelationshipInput(e):void 0))}_renderActiveRelationshipInput(e){return this._renderRelationshipInput(e)}_renderDescriptionOrEmpty(e,t){return null==e?null:R("div",{class:this.classes(d.description),id:t},e)}_renderGroup(e,t){const{formTemplate:i,disabled:s}=this,{description:l,inputs:a,label:n,state:r}=e,o=a.filter((e=>e.visible)),u=this.viewModel.findField(this._activeInputName),m=!(!u||u.group!==e),h=`${this.id}_group_${t}`,v=`${this.id}_group-label_${t}`,_=`${this.id}_group-description_${t}`,b=this._renderDescriptionOrEmpty(l,_),g="sequential"===this.groupDisplay,f=g?m:"expanded"===r,y=f?d.collapseIcon:d.expandIcon;return R("fieldset",{"aria-expanded":f.toString(),"aria-labelledby":v,"aria-describedby":l?_:"",class:this.classes(d.group,g?d.groupSequential:null,f?null:d.groupCollapsed,m?d.groupActive:null,s?d.inputDisabled:null),disabled:s,"data-group":e,id:h,key:t,onclick:this._handleGroupClick},R("button",{role:g?"presentation":void 0,class:d.groupHeader,type:"button",tabIndex:g?-1:0},R("div",{class:d.groupTitle},R(I,{class:d.groupLabel,id:v,level:null!=i&&i.title?F(this.headingLevel):this.headingLevel},n),b),g?null:R("span",{class:this.classes(y,d.groupToggleIcon)})),o.map((e=>c(e)?this._renderLabeledField(e):p(e)?this._renderRelationshipInput(e):void 0)))}_getFocusableInput(e,t){const i=this.viewModel.allFieldInputs,s="forward"===e?i:i.slice().reverse();let l;if(!t||p(t))l=0;else if(u(t)){const e=t.inputs.find(c);l=e?s.indexOf(e):0}else{let i;if(m(t)&&"collapsed"===t.group.state){const s=t.group.inputs.filter(c);i="forward"===e?s[s.length-1]:s[0]}else i=t;l=s.indexOf(i)+1}for(let a=l;a<s.length;a++){const e=s[a];if(e.visible&&c(e))return e}return null}_renderLabeledField(e){const{dataType:t,feature:i,label:s,layer:l}=e;return R("label",{key:`${l.id}-${i.uid}-${e.name}`,class:d.label},[s,"unsupported"!==t?this._renderFieldInput(e):this._renderUnsupportedField(e),this._renderAuxiliaryText(e)])}_renderFieldInput(e){const{dataType:t,domain:i,name:s,updating:l,value:a}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){if(h(e.element,"switch")){const{element:t}=e;if(!(this._switchFieldsWithInitialIncompatibleValue.has(s)||null==a||t.input.onValue!==a&&t.input.offValue!==a))return this._renderSwitchFieldInput(e,n);this._switchFieldsWithInitialIncompatibleValue.add(s)}return"radio-buttons"===e.inputType?this._renderRadioButtonsFieldInput(e,i.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),n):this._renderSelectFieldInput(e,this._getFieldValueOptions(s,i),n)}if("datetime-picker"===e.inputType||"date"===t)return this._renderDateFieldInput(e,n);const r="number"===t?R("input",{type:"number",...n,value:null!=this._activeNumberFieldEdit&&this._activeNumberFieldEdit.fieldName===e.name?this._activeNumberFieldEdit.value:`${n.value}`}):"text-area"===e.inputType?R("textarea",{...n}):R("input",{type:"text",...n});return l?R("div",{class:d.fieldInputWrapper},r,R("div",{class:d.fieldInputLoader},R("calcite-progress",{type:"indeterminate"}))):r}_renderDateFieldInput(e,t){const{includeTime:i,label:s,name:l,valid:a,value:n}=e,{readOnly:r,required:o}=t,{date:u,time:c}=this._formatValueForDateInputs(n),p=null!=t.max?this._formatValueForDateInputs(t.max):void 0,m=null!=t.min?this._formatValueForDateInputs(t.min):void 0,h=p?.date??void 0,v=m?.date??void 0,_={afterCreate:this._afterDateInputCreate,afterUpdate:this._afterDateInputCreateOrUpdate,"aria-invalid":!a,label:s,numberingSystem:T,overlayPositioning:"fixed",readOnly:r,required:o,tabIndex:0,[M]:l};return R("div",{key:`${t.key}-date-time-container`,class:d.dateInputContainer},R("calcite-input-date-picker",{bind:this,..._,class:this.classes(t.class,d.inputDate),"data-date-part":"date",key:`${t.key}-date-input`,valueAsDate:u??void 0,maxAsDate:h,minAsDate:v,onCalciteInputDatePickerChange:e=>this._commitDateChanges(e.target),onblur:e=>this._commitDateChanges(e.target,!0)}),i?R("calcite-input-time-picker",{bind:this,..._,class:this.classes(t.class,d.inputTime),"data-date-part":"time",key:`${t.key}-time-input`,value:c??void 0,step:1,onCalciteInputTimePickerChange:e=>this._commitDateChanges(e.target),onfocus:e=>{e.target.calciteTimePickerEl&&(e.target.calciteTimePickerEl.showSecond=!0)},onblur:e=>this._commitDateChanges(e.target,!0)}):null)}_renderUnsupportedField(e){const t=this.getCommonInputProps(e);return R("input",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,class:this.classes(d.input,d.fieldInput,d.inputDisabled),onfocus:t.onfocus,readOnly:!0,tabIndex:t.tabIndex,type:"text",value:t.value,[M]:t[M]})}_renderSelectFieldInput(e,t,i){const{element:s,required:l,value:a}=e,{messages:n,messagesTemplates:r}=this,o=t.map((e=>e.map((e=>R("calcite-combobox-item",{value:`${e.value}`,textLabel:e.name,key:`#${e.value}`,selected:a===e.value}))))),[d,u]=o;this._registerIncompatibleValue(a,t.flat(),e,(e=>{u.unshift(R("calcite-combobox-item",{value:`${e}`,textLabel:`${e}`,key:"incompatible-option",readOnly:!0}))}));const c=u.length>0?[R("calcite-combobox-item-group",{key:"recommended",label:n.recommended},d),R("calcite-combobox-item-group",{key:"other",label:r.other},u)]:d,p=null==s,m=h(s,"combo-box"),v=p||m&&s.input?.showNoValueOption;if(!l&&v){const e="",t=m&&s.input.noValueOptionLabel||n.empty;c.unshift(R("calcite-combobox-item",{value:e,textLabel:n.empty,key:"empty-option"},t))}return R("calcite-combobox",{...i,selectionMode:"single",disabled:i.readOnly,allowCustomValues:!1,onCalciteComboboxChange:e=>this._handleOptionChange(e.target)},c)}_registerIncompatibleValue(e,t,i,s){const l=this._fieldToInitialIncompatibleDomainValue,a=l.has(i.name);(a||null!=e&&""!==e&&!t.some((t=>t.value===e)))&&(a||l.set(i.name,e),s?.(e))}_renderRadioButtonsFieldInput(e,t,i){const{element:s,name:l,required:a,value:n}=e,r=t.map((e=>this._renderRadioButton({key:e.name,label:e.name,name:l,value:e.value,selected:e.value===n,props:i})));this._registerIncompatibleValue(n,t,e);const o=null==s,u=h(s,"radio-buttons"),c=o||u&&s.input?.showNoValueOption;if(!a&&c){const e="",t=u&&s.input.noValueOptionLabel||this.messages.empty,a=n===e||null===n;r.unshift(this._renderRadioButton({key:"empty-option",label:t,name:l,value:e,selected:a,props:i}))}return R("div",{key:`${i.key}-radio`,class:d.inputRadioGroup},r)}_renderSwitchFieldInput(e,t){const{value:i}=e,s=!!h(e.element,"switch")&&i===e.element.input.onValue;return R("calcite-switch",{...t,class:d.inputSwitch,onCalciteSwitchChange:e=>this._commitInputValue(e.target),checked:s,disabled:t.readOnly})}_renderRadioButton({key:e,name:t,value:i,selected:s,label:l,props:a}){return R("label",{key:e,class:d.inputRadioLabel},R("input",{...a,class:d.inputRadio,name:t,type:"radio",value:i,checked:s,disabled:a.readOnly,onchange:e=>this._commitInputValue(e.target)}),l)}_renderAuxiliaryText(e){const t=this._userUpdatedFieldInputNames.has(e.name)&&!e.valid?v(e,this.messages):null!=this.viewModel.contingencyConstraintViolations.get(e.name)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=t?R("calcite-input-message",{status:"invalid",icon:!0},t):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){const{featureCount:t,relationshipId:i,showAllActionVisible:s}=e,{relatedRecordCallbacks:l}=this;if(!s||!l?.showAllRelatedRecords)return;const a=this.messages;return R("calcite-list-item",{description:C(a.totalCount,{count:t}),label:a.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(i)},R("calcite-icon",{slot:"content-end",scale:"s",icon:"list"}))}_renderAddRelatedRecordButton(e){const{addActionVisible:t,relationshipId:i}=e,{relatedRecordCallbacks:s}=this;if(t&&s?.addRelatedRecord)return R("calcite-button",{alignment:"center",appearance:"outline-fill",class:d.centeredButton,iconStart:"plus",key:`${i}-add-button`,round:!0,scale:"s",width:"half",onclick:()=>this._onAddRelatedRecordsClick(i)},this.messages.addRecord)}_renderRelatedRecordListItem(e,t){const{feature:i,description:s,title:l}=e,{feature:a,relatedRecordCallbacks:n}=this,r=()=>{n?.editRelatedRecord&&a&&n.editRelatedRecord({parentFeature:a,relationshipId:t,relatedFeature:i})};return R("calcite-list-item",{bind:this,description:s,label:l,key:`${t}-${i.uid}`,value:l,onclick:r},R("calcite-icon",{slot:"content-start",scale:"m",icon:_(i)}),R("calcite-icon",{slot:"content-end",scale:"s",icon:"chevron-right"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled)return;const{relationshipId:t,relatedFeatureInfos:i,showAllEnabled:s}=e,l=s?null:e.label,a=s?null:this._renderDescriptionOrEmpty(e.description),n=i.map((e=>this._renderRelatedRecordListItem(e,t)));return R("div",{class:d.label,key:`${l}-${t}`},R("calcite-label",null,l,a,R("calcite-list",{loading:e.updating,class:d.relatedRecordList},n,this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())),this._renderAddRelatedRecordButton(e))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return R("div",{key:"feature-observer",class:d.listObserver,bind:this,afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved})}getCommonInputProps(e){const{disabled:t,groupDisplay:i}=this,{dataType:s,editable:l,group:a,hint:n,label:r,maxLength:o,minLength:u,name:c,required:p,valid:m,value:h}=e,v=this._userUpdatedFieldInputNames.has(c),_=!l||t,b="all"===i&&null!=a&&"collapsed"===a.state;return{afterCreate:this._afterInputCreateOrUpdate,afterUpdate:this._afterInputCreateOrUpdate,"aria-invalid":m?"false":"true",class:this.classes(d.input,d.fieldInput,_?d.inputDisabled:null,v&&!m?d.inputInvalid:null),key:c,label:r,minlength:u>-1?`${u}`:"",maxlength:o>-1?`${o}`:"",...e.range,readOnly:_,value:null==h?"":`${h}`,[M]:c,onfocus:this._handleInputFocus,oninput:this._handleInputInput,onblur:this._handleInputBlur,onkeydown:this._handleInputKeyDown,onmousedown:"number"===s?this._handleNumberInputMouseDown:void 0,placeholder:"number"===s||"text"===s?n??void 0:"",required:p,tabIndex:b?-1:0}}_handleNumberInputMouseDown({target:e}){e.focus(),this.scheduleRender()}_getFieldValueOptions(e,t){const i=t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),s=this.viewModel.fieldsWithContingentValues.has(e)?this._getContingentValueOptions(e):[];if(s.length>0){const e=new Set(s.map((e=>e.value)));return[s,i.filter((t=>!e.has(t.value)))]}return[i,[]]}_getContingentValueOptions(e){const t={};for(const l of this.viewModel.allFieldInputs){const{name:i,value:s}=l;null!=s&&i!==e&&this.viewModel.fieldsWithContingentValues.has(i)&&(t[i]=s)}const i=this.viewModel.joinedContingentValues.slice(),s=new Map;for(const l of i){const i=l.values[e];if(null==i||"code"!==i.objectType&&"null"!==i.objectType)continue;const{code:a,name:n}=i.codedValue&&"null"!==i.objectType?i.codedValue:{code:"",name:this.messages.empty};if(s.has(a))continue;Object.entries(t).every((([e,t])=>!l.values.hasOwnProperty(e)||this._valueIsValidContingentValue(t,l.values[e])))&&s.set(a,{name:n,value:a})}return[...s.values()]}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(M))}async _afterDateInputCreate(e){!k(e)&&null!=e.value&&"setValue"in e&&e.setValue({value:e.value,origin:"external"}),this._afterDateInputCreateOrUpdate(e)}_afterDateInputCreateOrUpdate(e){const{name:t}=this._getFieldInputFromHTMLElement(e),i=this._dateFieldInputMap.get(t),s=k(e);null!=i?s?i.date=e:i.time=e:this._dateFieldInputMap.set(t,{[s?"date":"time"]:e}),this._afterInputCreateOrUpdate(e)}_afterInputCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),s=t.findField(this._activeInputName),l=this._fieldToInitialIncompatibleDomainValue.get(i.name)===i.value;this._fieldFocusNeeded&&s===i&&("radio-buttons"!==i.inputType||l||e.checked)&&(this._fieldFocusNeeded=!1,m(i)&&(i.group.state="expanded"),e.focus())}_handleInputFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._activeInputName=i.name,b(i)&&(this._activeNumberFieldEdit={fieldName:i.name,input:t,value:t.value})}_handleInputBlur(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);"number"===i.dataType&&null!=this._activeNumberFieldEdit&&(this._activeNumberFieldEdit.input.value=`${i.value}`,this._activeNumberFieldEdit=null),this._commitInputValue(t),this.scheduleRender()}_commitDateChanges(e,t=!1){const{name:i}=this._getFieldInputFromHTMLElement(e);if(!this._dateFieldInputMap.has(i))return;const s=this._dateFieldInputMap.get(i);if(!s||!s.date)return;const l=this._getFieldValueFromDateInput(e),a=this._getFieldValueFromDateInputs(s.date,s.time);this.viewModel.getValue(i)!==a&&(null!==l&&null!==a?this._updateFieldValue(i,a):t&&this._updateFieldValue(i,null))}_commitInputValue(e){const t=this._getFieldInputFromHTMLElement(e);null!=this._activeNumberFieldEdit&&b(t)&&(this._activeNumberFieldEdit.value=e.value),this._updateFieldValue(t.name,this._parseValue(e))}_handleInputKeyDown(e){const{key:t,altKey:i,ctrlKey:s,metaKey:l}=e,a=this._getFieldInputFromHTMLElement(e.target);if("Enter"===t)m(a)&&"collapsed"===a.group.state&&(a.group.state="expanded");else{const{type:n}=a.field,r="single"===n||"double"===n;if(("integer"===n||"small-integer"===n||r)&&(!i&&!s&&!l)&&1===t.length){const i=Number(t),s=["-","+"],l=["e","."],a=r?[...s,...l]:s;isNaN(i)&&!a.includes(t)&&e.preventDefault()}}}_updateFieldValue(e,t){if(this.viewModel.setValue(e,t),this._userUpdatedFieldInputNames.add(e),this.viewModel.fieldsWithContingentValues.has(e)){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>null!=t)));this.viewModel.validateContingencyConstraints(e)}}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;if(h(t.element,"switch")&&"CALCITE-COMBOBOX"!==e.tagName)return e.checked?t.element.input.onValue:t.element.input.offValue;if("radio-buttons"===t.inputType&&"radio"===e.type&&!e.checked)return t.value;const{dataType:s}=t;return"number"===s?i?parseFloat(i):null:i}_handleOptionChange(e){this._commitInputValue(e),this.scheduleRender()}_handleGroupClick(e){const t=e.currentTarget["data-group"],i="expanded"===t.state,s="sequential"===this.groupDisplay,l=`.${d.groupHeader}`;if(!(i&&!e.target.closest(l))){if(this._activeInputName=this._getFocusableInput("forward",t)?.name||"",s){const s=e.target.closest(l);if(i&&!s)return;this.viewModel.inputs.forEach((e=>{u(e)&&e!==t&&(e.state="collapsed")}))}t.state=i?"collapsed":"expanded",this._fieldFocusNeeded=s,this.scheduleRender()}}_handleSubmit(e){e.preventDefault()}_handleFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_getDefaultLocaleOptions(){return{locale:D(),numberingSystem:T}}_getFieldValueFromDateInputs(e,t){const i=this._getDateTimeFromInput(e),s=this._getDateTimeFromInput(t);if(!i&&!s)return null;const l=this._getFieldInputFromHTMLElement(e).range,a=Date.now(),n=null!=l.max&&l.max<a?l.max:a,r=V.fromMillis(n,this._getDefaultLocaleOptions()),o=i||r,{year:d,month:u,day:c}=o,{hour:p,minute:m,second:h}=s||r,v=o.set({year:d,month:u,day:c,hour:p,minute:m,second:h});return v.isValid?v.toMillis():null}_getDateTimeFromInput(e){if(!e)return null;let t=null;if(k(e)){const i=e.valueAsDate;if(!i||Array.isArray(i))return null;t=V.fromJSDate(i)}else{if(!e.value)return null;t=V.fromFormat(e.value,O,this._getDefaultLocaleOptions())}return t??null}_getFieldValueFromDateInput(e){return this._dateTimeToFieldValue(this._getDateTimeFromInput(e))}_dateTimeToFieldValue(e){return e?.isValid?e.toMillis():null}_dateTimeFromFieldValue(e){return null===e?null:V.fromMillis(e,this._getDefaultLocaleOptions())}_formatValueForDateInputs(e){if(null==e||isNaN(e))return{date:null,time:null};const t=this._dateTimeFromFieldValue(e);return t?{date:t.toJSDate(),time:t.toFormat(O,this._getDefaultLocaleOptions())}:{date:null,time:null}}_valueIsValidContingentValue(e,t){switch(t.objectType){case"any":return!0;case"null":return null==e;case"code":return e===t.codedValue?.code;case"range":return null!=e&&null!=t.minValue&&null!=t.maxValue&&+e>=t.minValue&&+e<=t.maxValue;default:return i(t.objectType),!1}}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}async _onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;if(!e)return;const{showAllEnabled:t,updating:i}=e;this._listObserverNode&&!i&&t&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}};e([n()],L.prototype,"_listObserverNode",void 0),e([n()],L.prototype,"_relatedRecordsEnabled",null),e([n()],L.prototype,"disabled",void 0),e([n()],L.prototype,"feature",null),e([n()],L.prototype,"formTemplate",null),e([n()],L.prototype,"groupDisplay",void 0),e([n()],L.prototype,"headingLevel",void 0),e([n()],L.prototype,"label",null),e([n()],L.prototype,"layer",null),e([n()],L.prototype,"map",null),e([n(),y("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"messages",void 0),e([n(),y("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],L.prototype,"messagesTemplates",void 0),e([n()],L.prototype,"relatedRecordCallbacks",void 0),e([n()],L.prototype,"relationshipId",null),e([n()],L.prototype,"spatialReference",null),e([n()],L.prototype,"strict",null),e([n()],L.prototype,"view",null),e([n(),w(["value-change","submit"])],L.prototype,"viewModel",void 0),L=e([r(x)],L);const E=L;export{E as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{neverReached as i}from"../core/compilerUtils.js";import{deprecatedProperty as s}from"../core/deprecate.js";import l from"../core/Logger.js";import{watch as a}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import o from"./Widget.js";import{CSS as d}from"./FeatureForm/css.js";import{isGroupInput as u,isFieldInput as c,isRelationshipInput as p,isInputInGroupInput as m,isFieldElementWithInputType as h,getErrorMessageForFieldInput as v,getIconForFeature as _,isNumberFieldInput as b}from"./FeatureForm/featureFormUtils.js";import g from"./FeatureForm/FeatureFormViewModel.js";import{loadCalciteComponents as f}from"./support/componentsUtils.js";import{Heading as I,incrementHeadingLevel as F}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as y}from"./support/decorators/messageBundle.js";import{vmEvent as w}from"./support/decorators/vmEvent.js";import{tsx as R}from"./support/jsxFactory.js";import{DateTime as V}from"luxon";import{substitute as C}from"../intl/substitute.js";import{getLocale as D}from"../intl/locale.js";const O="TT",M="data-field-name",k="latn",T=e=>"valueAsDate"in e,x="esri.widgets.FeatureForm",N=l.getLogger(x);let L=class extends o{constructor(e,t){super(e,t),this._dateFieldInputMap=new Map,this._activeInputName="",this._activeNumberFieldEdit=null,this._fieldFocusNeeded=!1,this._fieldToInitialIncompatibleDomainValue=new Map,this._switchFieldsWithInitialIncompatibleValue=new Set,this._userUpdatedFieldInputNames=new Set,this._listObserverNode=null,this._listObserver=new IntersectionObserver((e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()}),{root:window.document}),this.disabled=!1,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesTemplates=null,this.relatedRecordCallbacks=null,this.viewModel=new g,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,relatedRecordCallbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=e=>{const{feature:t,relatedRecordCallbacks:i}=this;t&&i?.addRelatedRecord&&i.addRelatedRecord({parentFeature:t,relationshipId:e})},this._handleInputInput=e=>{this._commitInputValue(e.currentTarget)},this._handleFormKeyDown=this._handleFormKeyDown.bind(this),this._handleInputBlur=this._handleInputBlur.bind(this),this._handleInputFocus=this._handleInputFocus.bind(this),this._handleNumberInputMouseDown=this._handleNumberInputMouseDown.bind(this),this._handleInputKeyDown=this._handleInputKeyDown.bind(this),this._handleOptionChange=this._handleOptionChange.bind(this),this._handleGroupClick=this._handleGroupClick.bind(this),this._handleSubmit=this._handleSubmit.bind(this),this._afterInputCreateOrUpdate=this._afterInputCreateOrUpdate.bind(this),this._afterDateInputCreateOrUpdate=this._afterDateInputCreateOrUpdate.bind(this)}initialize(){this.addHandles([a((()=>this.feature),(()=>{const e=this._getFocusableInput("forward");this._activeInputName=e?.name||"",this._userUpdatedFieldInputNames.clear(),this._fieldToInitialIncompatibleDomainValue.clear(),this._switchFieldsWithInitialIncompatibleValue.clear(),this._dateFieldInputMap.clear(),this._fieldFocusNeeded=!0})),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._userUpdatedFieldInputNames.add(e))),this._activeInputName=t,this._fieldFocusNeeded=!0,this.scheduleRender()}})),a((()=>[this.viewModel.activeRelationshipInput,this._listObserverNode]),(()=>this._onObserverChange()))])}loadDependencies(){return f({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox.js"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item.js"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker.js"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message.js"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker.js"),label:()=>import("@esri/calcite-components/dist/components/calcite-label.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress.js"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch.js")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const e=this.relatedRecordCallbacks;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get view(){return s(N,"view",{replacement:"Use FeatureForm.map instead.",version:"4.27"}),this.viewModel.view}set view(e){s(N,"view",{replacement:"Use FeatureForm.map instead.",version:"4.27"}),this.viewModel.view=e}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return R("div",{class:this.classes(d.base,d.widget,d.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return R("form",{class:d.form,novalidate:!0,onsubmit:this._handleSubmit,onkeydown:this._handleFormKeyDown},this._renderHeader(),this._renderInputs())}_renderHeader(){const e=this.viewModel;if(!e.formHeaderVisible)return;const t=null!=e.formTitle&&R(I,{key:"title",level:this.headingLevel},e.formTitle),i=null!=e.formDescription&&R("p",{class:d.description,key:"description"},e.formDescription);return R("div",{class:d.formHeader},t,i)}_renderInputs(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderActiveRelationshipInput(e.activeRelationshipInput):e.inputs.filter(t).filter((e=>e.visible)).map(((e,t)=>u(e)?this._renderGroup(e,t):c(e)?this._renderLabeledField(e):p(e)?this._renderRelationshipInput(e):void 0))}_renderActiveRelationshipInput(e){return this._renderRelationshipInput(e)}_renderDescriptionOrEmpty(e,t){return null==e?null:R("div",{class:this.classes(d.description),id:t},e)}_renderGroup(e,t){const{formTemplate:i,disabled:s}=this,{description:l,inputs:a,label:n,state:r}=e,o=a.filter((e=>e.visible)),u=this.viewModel.findField(this._activeInputName),m=!(!u||u.group!==e),h=`${this.id}_group_${t}`,v=`${this.id}_group-label_${t}`,_=`${this.id}_group-description_${t}`,b=this._renderDescriptionOrEmpty(l,_),g="sequential"===this.groupDisplay,f=g?m:"expanded"===r,y=f?d.collapseIcon:d.expandIcon;return R("fieldset",{"aria-expanded":f.toString(),"aria-labelledby":v,"aria-describedby":l?_:"",class:this.classes(d.group,g?d.groupSequential:null,f?null:d.groupCollapsed,m?d.groupActive:null,s?d.inputDisabled:null),disabled:s,"data-group":e,id:h,key:t,onclick:this._handleGroupClick},R("button",{role:g?"presentation":void 0,class:d.groupHeader,type:"button",tabIndex:g?-1:0},R("div",{class:d.groupTitle},R(I,{class:d.groupLabel,id:v,level:null!=i&&i.title?F(this.headingLevel):this.headingLevel},n),b),g?null:R("span",{class:this.classes(y,d.groupToggleIcon)})),o.map((e=>c(e)?this._renderLabeledField(e):p(e)?this._renderRelationshipInput(e):void 0)))}_getFocusableInput(e,t){const i=this.viewModel.allFieldInputs,s="forward"===e?i:i.slice().reverse();let l;if(!t||p(t))l=0;else if(u(t)){const e=t.inputs.find(c);l=e?s.indexOf(e):0}else{let i;if(m(t)&&"collapsed"===t.group.state){const s=t.group.inputs.filter(c);i="forward"===e?s[s.length-1]:s[0]}else i=t;l=s.indexOf(i)+1}for(let a=l;a<s.length;a++){const e=s[a];if(e.visible&&c(e))return e}return null}_renderLabeledField(e){const{dataType:t,feature:i,label:s,layer:l}=e;return R("label",{key:`${l.id}-${i.uid}-${e.name}`,class:d.label},[s,"unsupported"!==t?this._renderFieldInput(e):this._renderUnsupportedField(e),this._renderAuxiliaryText(e)])}_renderFieldInput(e){const{dataType:t,domain:i,name:s,updating:l,value:a}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){if(h(e.element,"switch")){const{element:t}=e;if(!(this._switchFieldsWithInitialIncompatibleValue.has(s)||null==a||t.input.onValue!==a&&t.input.offValue!==a))return this._renderSwitchFieldInput(e,n);this._switchFieldsWithInitialIncompatibleValue.add(s)}return"radio-buttons"===e.inputType?this._renderRadioButtonsFieldInput(e,i.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),n):this._renderSelectFieldInput(e,this._getFieldValueOptions(s,i),n)}if("datetime-picker"===e.inputType||"date"===t)return this._renderDateFieldInput(e,n);const r="number"===t?R("input",{type:"number",...n,value:null!=this._activeNumberFieldEdit&&this._activeNumberFieldEdit.fieldName===e.name?this._activeNumberFieldEdit.value:`${n.value}`}):"text-area"===e.inputType?R("textarea",{...n}):R("input",{type:"text",...n});return l?R("div",{key:`${n.key}-input-updating-wrapper`,class:d.fieldInputWrapper},r,R("div",{class:d.fieldInputLoader},R("calcite-progress",{type:"indeterminate"}))):r}_renderDateFieldInput(e,t){const{includeTime:i,label:s,name:l,valid:a,value:n}=e,{readOnly:r,required:o}=t,{date:u,time:c}=this._formatValueForDateInputs(n),p=null!=t.max?this._formatValueForDateInputs(t.max):void 0,m=null!=t.min?this._formatValueForDateInputs(t.min):void 0,h=p?.date??void 0,v=m?.date??void 0,_={afterCreate:this._afterDateInputCreate,afterUpdate:this._afterDateInputCreateOrUpdate,"aria-invalid":!a,label:s,numberingSystem:k,overlayPositioning:"fixed",readOnly:r,required:o,tabIndex:0,[M]:l};return R("div",{key:`${t.key}-date-time-container`,class:d.dateInputContainer},R("calcite-input-date-picker",{bind:this,..._,class:this.classes(t.class,d.inputDate),"data-date-part":"date",key:`${t.key}-date-input`,valueAsDate:u??void 0,maxAsDate:h,minAsDate:v,onCalciteInputDatePickerChange:e=>this._commitDateChanges(e.target),onblur:e=>this._commitDateChanges(e.target,!0)}),i?R("calcite-input-time-picker",{bind:this,..._,class:this.classes(t.class,d.inputTime),"data-date-part":"time",key:`${t.key}-time-input`,value:c??void 0,step:1,onCalciteInputTimePickerChange:e=>this._commitDateChanges(e.target),onfocus:e=>{e.target.calciteTimePickerEl&&(e.target.calciteTimePickerEl.showSecond=!0)},onblur:e=>this._commitDateChanges(e.target,!0)}):null)}_renderUnsupportedField(e){const t=this.getCommonInputProps(e);return R("input",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,class:this.classes(d.input,d.fieldInput,d.inputDisabled),onfocus:t.onfocus,readOnly:!0,tabIndex:t.tabIndex,type:"text",value:t.value,[M]:t[M]})}_renderSelectFieldInput(e,t,i){const{element:s,required:l,value:a}=e,{messages:n,messagesTemplates:r}=this,o=t.map((e=>e.map((e=>R("calcite-combobox-item",{value:`${e.value}`,textLabel:e.name,key:`#${e.value}`,selected:a===e.value}))))),[d,u]=o;this._registerIncompatibleValue(a,t.flat(),e,(e=>{u.unshift(R("calcite-combobox-item",{value:`${e}`,textLabel:`${e}`,key:"incompatible-option",readOnly:!0}))}));const c=u.length>0?[R("calcite-combobox-item-group",{key:"recommended",label:n.recommended},d),R("calcite-combobox-item-group",{key:"other",label:r.other},u)]:d,p=null==s,m=h(s,"combo-box"),v=p||m&&s.input?.showNoValueOption;if(!l&&v){const e="",t=m&&s.input.noValueOptionLabel||n.empty;c.unshift(R("calcite-combobox-item",{value:e,textLabel:n.empty,key:"empty-option"},t))}return R("calcite-combobox",{...i,selectionMode:"single",disabled:i.readOnly,allowCustomValues:!1,onCalciteComboboxChange:e=>this._handleOptionChange(e.target)},c)}_registerIncompatibleValue(e,t,i,s){const l=this._fieldToInitialIncompatibleDomainValue,a=l.has(i.name);(a||null!=e&&""!==e&&!t.some((t=>t.value===e)))&&(a||l.set(i.name,e),s?.(e))}_renderRadioButtonsFieldInput(e,t,i){const{element:s,name:l,required:a,value:n}=e,r=t.map((e=>this._renderRadioButton({key:e.name,label:e.name,name:l,value:e.value,selected:e.value===n,props:i})));this._registerIncompatibleValue(n,t,e);const o=null==s,u=h(s,"radio-buttons"),c=o||u&&s.input?.showNoValueOption;if(!a&&c){const e="",t=u&&s.input.noValueOptionLabel||this.messages.empty,a=n===e||null===n;r.unshift(this._renderRadioButton({key:"empty-option",label:t,name:l,value:e,selected:a,props:i}))}return R("div",{key:`${i.key}-radio`,class:d.inputRadioGroup},r)}_renderSwitchFieldInput(e,t){const{value:i}=e,s=!!h(e.element,"switch")&&i===e.element.input.onValue;return R("calcite-switch",{...t,class:d.inputSwitch,onCalciteSwitchChange:e=>this._commitInputValue(e.target),checked:s,disabled:t.readOnly})}_renderRadioButton({key:e,name:t,value:i,selected:s,label:l,props:a}){return R("label",{key:e,class:d.inputRadioLabel},R("input",{...a,class:d.inputRadio,name:t,type:"radio",value:i,checked:s,disabled:a.readOnly,onchange:e=>this._commitInputValue(e.target)}),l)}_renderAuxiliaryText(e){const t=this._userUpdatedFieldInputNames.has(e.name)&&!e.valid?v(e,this.messages):null!=this.viewModel.contingencyConstraintViolations.get(e.name)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=t?R("calcite-input-message",{status:"invalid",icon:!0},t):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){const{featureCount:t,relationshipId:i,showAllActionVisible:s}=e,{relatedRecordCallbacks:l}=this;if(!s||!l?.showAllRelatedRecords)return;const a=this.messages;return R("calcite-list-item",{description:C(a.totalCount,{count:t}),label:a.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(i)},R("calcite-icon",{slot:"content-end",scale:"s",icon:"list"}))}_renderAddRelatedRecordButton(e){const{addActionVisible:t,relationshipId:i}=e,{relatedRecordCallbacks:s}=this;if(t&&s?.addRelatedRecord)return R("calcite-button",{alignment:"center",appearance:"outline-fill",class:d.centeredButton,iconStart:"plus",key:`${i}-add-button`,round:!0,scale:"s",width:"half",onclick:()=>this._onAddRelatedRecordsClick(i)},this.messages.addRecord)}_renderRelatedRecordListItem(e,t){const{feature:i,description:s,title:l}=e,{feature:a,relatedRecordCallbacks:n}=this,r=()=>{n?.editRelatedRecord&&a&&n.editRelatedRecord({parentFeature:a,relationshipId:t,relatedFeature:i})};return R("calcite-list-item",{bind:this,description:s,label:l,key:`${t}-${i.uid}`,value:l,onclick:r},R("calcite-icon",{slot:"content-start",scale:"m",icon:_(i)}),R("calcite-icon",{slot:"content-end",scale:"s",icon:"chevron-right"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled)return;const{relationshipId:t,relatedFeatureInfos:i,showAllEnabled:s}=e,l=s?null:e.label,a=s?null:this._renderDescriptionOrEmpty(e.description),n=i.map((e=>this._renderRelatedRecordListItem(e,t)));return R("div",{class:d.label,key:`${l}-${t}`},R("calcite-label",null,l,a,R("calcite-list",{loading:e.updating,class:d.relatedRecordList},n,this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())),this._renderAddRelatedRecordButton(e))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return R("div",{key:"feature-observer",class:d.listObserver,bind:this,afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved})}getCommonInputProps(e){const{disabled:t,groupDisplay:i}=this,{dataType:s,editable:l,group:a,hint:n,label:r,maxLength:o,minLength:u,name:c,required:p,valid:m,value:h}=e,v=this._userUpdatedFieldInputNames.has(c),_=!l||t,b="all"===i&&null!=a&&"collapsed"===a.state;return{afterCreate:this._afterInputCreateOrUpdate,afterUpdate:this._afterInputCreateOrUpdate,"aria-invalid":m?"false":"true",class:this.classes(d.input,d.fieldInput,_?d.inputDisabled:null,v&&!m?d.inputInvalid:null),key:c,label:r,minlength:u>-1?`${u}`:"",maxlength:o>-1?`${o}`:"",...e.range,readOnly:_,value:null==h?"":`${h}`,[M]:c,onfocus:this._handleInputFocus,oninput:this._handleInputInput,onblur:this._handleInputBlur,onkeydown:this._handleInputKeyDown,onmousedown:"number"===s?this._handleNumberInputMouseDown:void 0,placeholder:"number"===s||"text"===s?n??void 0:"",required:p,tabIndex:b?-1:0}}_handleNumberInputMouseDown({target:e}){e.focus(),this.scheduleRender()}_getFieldValueOptions(e,t){const i=t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),s=this.viewModel.fieldsWithContingentValues.has(e)?this._getContingentValueOptions(e):[];if(s.length>0){const e=new Set(s.map((e=>e.value)));return[s,i.filter((t=>!e.has(t.value)))]}return[i,[]]}_getContingentValueOptions(e){const t={};for(const l of this.viewModel.allFieldInputs){const{name:i,value:s}=l;null!=s&&i!==e&&this.viewModel.fieldsWithContingentValues.has(i)&&(t[i]=s)}const i=this.viewModel.joinedContingentValues.slice(),s=new Map;for(const l of i){const i=l.values[e];if(null==i||"code"!==i.objectType&&"null"!==i.objectType)continue;const{code:a,name:n}=i.codedValue&&"null"!==i.objectType?i.codedValue:{code:"",name:this.messages.empty};if(s.has(a))continue;Object.entries(t).every((([e,t])=>!l.values.hasOwnProperty(e)||this._valueIsValidContingentValue(t,l.values[e])))&&s.set(a,{name:n,value:a})}return[...s.values()]}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(M))}async _afterDateInputCreate(e){!T(e)&&null!=e.value&&"setValue"in e&&e.setValue({value:e.value,origin:"external"}),this._afterDateInputCreateOrUpdate(e)}_afterDateInputCreateOrUpdate(e){const{name:t}=this._getFieldInputFromHTMLElement(e),i=this._dateFieldInputMap.get(t),s=T(e);null!=i?s?i.date=e:i.time=e:this._dateFieldInputMap.set(t,{[s?"date":"time"]:e}),this._afterInputCreateOrUpdate(e)}_afterInputCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),s=t.findField(this._activeInputName),l=this._fieldToInitialIncompatibleDomainValue.get(i.name)===i.value;this._fieldFocusNeeded&&s===i&&("radio-buttons"!==i.inputType||l||e.checked)&&(this._fieldFocusNeeded=!1,m(i)&&(i.group.state="expanded"),e.focus())}_handleInputFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._activeInputName=i.name,b(i)&&(this._activeNumberFieldEdit={fieldName:i.name,input:t,value:t.value})}_handleInputBlur(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);"number"===i.dataType&&null!=this._activeNumberFieldEdit&&(this._activeNumberFieldEdit.input.value=`${i.value}`,this._activeNumberFieldEdit=null),this._commitInputValue(t),this.scheduleRender()}_commitDateChanges(e,t=!1){const{name:i}=this._getFieldInputFromHTMLElement(e);if(!this._dateFieldInputMap.has(i))return;const s=this._dateFieldInputMap.get(i);if(!s||!s.date)return;const l=this._getFieldValueFromDateInput(e),a=this._getFieldValueFromDateInputs(s.date,s.time);this.viewModel.getValue(i)!==a&&(null!==l&&null!==a?this._updateFieldValue(i,a):t&&this._updateFieldValue(i,null))}_commitInputValue(e){const t=this._getFieldInputFromHTMLElement(e);null!=this._activeNumberFieldEdit&&b(t)&&(this._activeNumberFieldEdit.value=e.value),this._updateFieldValue(t.name,this._parseValue(e))}_handleInputKeyDown(e){const{key:t,altKey:i,ctrlKey:s,metaKey:l}=e,a=this._getFieldInputFromHTMLElement(e.target);if("Enter"===t)m(a)&&"collapsed"===a.group.state&&(a.group.state="expanded");else{const{type:n}=a.field,r="single"===n||"double"===n;if(("integer"===n||"small-integer"===n||r)&&(!i&&!s&&!l)&&1===t.length){const i=Number(t),s=["-","+"],l=["e","."],a=r?[...s,...l]:s;isNaN(i)&&!a.includes(t)&&e.preventDefault()}}}_updateFieldValue(e,t){if(this.viewModel.setValue(e,t),this._userUpdatedFieldInputNames.add(e),this.viewModel.fieldsWithContingentValues.has(e)){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>null!=t)));this.viewModel.validateContingencyConstraints(e)}}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;if(h(t.element,"switch")&&"CALCITE-COMBOBOX"!==e.tagName)return e.checked?t.element.input.onValue:t.element.input.offValue;if("radio-buttons"===t.inputType&&"radio"===e.type&&!e.checked)return t.value;const{dataType:s}=t;return"number"===s?i?parseFloat(i):null:i}_handleOptionChange(e){this._commitInputValue(e),this.scheduleRender()}_handleGroupClick(e){const t=e.currentTarget["data-group"],i="expanded"===t.state,s="sequential"===this.groupDisplay,l=`.${d.groupHeader}`;if(!(i&&!e.target.closest(l))){if(this._activeInputName=this._getFocusableInput("forward",t)?.name||"",s){const s=e.target.closest(l);if(i&&!s)return;this.viewModel.inputs.forEach((e=>{u(e)&&e!==t&&(e.state="collapsed")}))}t.state=i?"collapsed":"expanded",this._fieldFocusNeeded=s,this.scheduleRender()}}_handleSubmit(e){e.preventDefault()}_handleFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_getDefaultLocaleOptions(){return{locale:D(),numberingSystem:k}}_getFieldValueFromDateInputs(e,t){const i=this._getDateTimeFromInput(e),s=this._getDateTimeFromInput(t);if(!i&&!s)return null;const l=this._getFieldInputFromHTMLElement(e).range,a=Date.now(),n=null!=l.max&&l.max<a?l.max:a,r=V.fromMillis(n,this._getDefaultLocaleOptions()),o=i||r,{year:d,month:u,day:c}=o,{hour:p,minute:m,second:h}=s||r,v=o.set({year:d,month:u,day:c,hour:p,minute:m,second:h});return v.isValid?v.toMillis():null}_getDateTimeFromInput(e){if(!e)return null;let t=null;if(T(e)){const i=e.valueAsDate;if(!i||Array.isArray(i))return null;t=V.fromJSDate(i)}else{if(!e.value)return null;t=V.fromFormat(e.value,O,this._getDefaultLocaleOptions())}return t??null}_getFieldValueFromDateInput(e){return this._dateTimeToFieldValue(this._getDateTimeFromInput(e))}_dateTimeToFieldValue(e){return e?.isValid?e.toMillis():null}_dateTimeFromFieldValue(e){return null===e?null:V.fromMillis(e,this._getDefaultLocaleOptions())}_formatValueForDateInputs(e){if(null==e||isNaN(e))return{date:null,time:null};const t=this._dateTimeFromFieldValue(e);return t?{date:t.toJSDate(),time:t.toFormat(O,this._getDefaultLocaleOptions())}:{date:null,time:null}}_valueIsValidContingentValue(e,t){switch(t.objectType){case"any":return!0;case"null":return null==e;case"code":return e===t.codedValue?.code;case"range":return null!=e&&null!=t.minValue&&null!=t.maxValue&&+e>=t.minValue&&+e<=t.maxValue;default:return i(t.objectType),!1}}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}async _onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;if(!e)return;const{showAllEnabled:t,updating:i}=e;this._listObserverNode&&!i&&t&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}};e([n()],L.prototype,"_listObserverNode",void 0),e([n()],L.prototype,"_relatedRecordsEnabled",null),e([n()],L.prototype,"disabled",void 0),e([n()],L.prototype,"feature",null),e([n()],L.prototype,"formTemplate",null),e([n()],L.prototype,"groupDisplay",void 0),e([n()],L.prototype,"headingLevel",void 0),e([n()],L.prototype,"label",null),e([n()],L.prototype,"layer",null),e([n()],L.prototype,"map",null),e([n(),y("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"messages",void 0),e([n(),y("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],L.prototype,"messagesTemplates",void 0),e([n()],L.prototype,"relatedRecordCallbacks",void 0),e([n()],L.prototype,"relationshipId",null),e([n()],L.prototype,"spatialReference",null),e([n()],L.prototype,"strict",null),e([n()],L.prototype,"view",null),e([n(),w(["value-change","submit"])],L.prototype,"viewModel",void 0),L=e([r(x)],L);const E=L;export{E as default};
|