@vertigis/arcgis-extensions 32.9.1 → 33.2.0

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.
Files changed (407) hide show
  1. package/AppConfig.schema.json +5 -0
  2. package/Entity.d.ts +11 -3
  3. package/Entity.js +1 -1
  4. package/ItemType.d.ts +156 -30
  5. package/ItemType.js +1 -1
  6. package/LanguageResources.d.ts +1 -1
  7. package/LanguageResources.js +1 -1
  8. package/data/ArcGISServiceTableExtension.d.ts +1 -1
  9. package/data/ArcGISServiceTableExtension.js +1 -1
  10. package/data/Attachment.d.ts +1 -1
  11. package/data/Attachment.js +1 -1
  12. package/data/Feature.d.ts +4 -4
  13. package/data/Feature.js +1 -1
  14. package/data/FeatureList.d.ts +4 -0
  15. package/data/FeatureList.js +1 -1
  16. package/data/FeatureSet.d.ts +4 -0
  17. package/data/FeatureSet.js +1 -1
  18. package/data/FeatureSettings.d.ts +1 -1
  19. package/data/FeatureSettings.js +1 -1
  20. package/data/FeatureSourceBase.js +1 -1
  21. package/data/FeatureStream.d.ts +4 -4
  22. package/data/FeatureStream.js +1 -1
  23. package/data/FieldExtension.d.ts +4 -4
  24. package/data/FieldExtension.js +1 -1
  25. package/data/RelationshipBase.d.ts +7 -3
  26. package/data/RelationshipBase.js +1 -1
  27. package/data/Schema.d.ts +1 -1
  28. package/data/Schema.js +1 -1
  29. package/data/_Relationship.d.ts +6 -1
  30. package/data/_TableExtension.d.ts +2 -2
  31. package/data/_TableExtension.js +1 -1
  32. package/data/convert.js +1 -1
  33. package/docs/html/assets/js/search.js +1 -1
  34. package/docs/html/classes/data__tableextension.tableextension.html +93 -76
  35. package/docs/html/classes/data__tableextension.tablefeaturesettings.html +20 -20
  36. package/docs/html/classes/data__tableextension.tableschema.html +31 -31
  37. package/docs/html/classes/data_arcgisservicetableextension.arcgisservicetableextension.html +88 -74
  38. package/docs/html/classes/data_attachment.attachment.html +54 -37
  39. package/docs/html/classes/data_feature.feature.html +72 -55
  40. package/docs/html/classes/data_featurelist.featurelist.html +40 -13
  41. package/docs/html/classes/data_featureset.featureset.html +43 -16
  42. package/docs/html/classes/data_featuresettings.featuresettings.html +20 -20
  43. package/docs/html/classes/data_featuresourcebase.featuresourcebase.html +72 -45
  44. package/docs/html/classes/data_featuresourcebase.relationshipcollection.html +4 -4
  45. package/docs/html/classes/data_featurestream.featurestream.html +57 -40
  46. package/docs/html/classes/data_fieldextension.fieldextension.html +64 -47
  47. package/docs/html/classes/data_relationshipbase.relationshipbase.html +112 -61
  48. package/docs/html/classes/data_schema.schema.html +23 -23
  49. package/docs/html/classes/entity.entitybase.html +34 -7
  50. package/docs/html/classes/languageresources.languageresources-1.html +20 -20
  51. package/docs/html/classes/layer_preset_layerpreset.layerpreset.html +56 -39
  52. package/docs/html/classes/mapping__layerextension.arraywrappedcollection.html +4 -4
  53. package/docs/html/classes/mapping__layerextension.layerextension.html +129 -113
  54. package/docs/html/classes/mapping__layerextension.layerextensionschema.html +28 -28
  55. package/docs/html/classes/mapping__sublayerextension.sublayerextension.html +101 -85
  56. package/docs/html/classes/mapping__sublayerextension.sublayerschema.html +24 -24
  57. package/docs/html/classes/mapping__sublayerextension.subsublayerextensioncollection.html +6 -6
  58. package/docs/html/classes/mapping_arcgissublayerextension.arcgissublayerextension.html +81 -67
  59. package/docs/html/classes/mapping_arcgissublayerextension.arcgissublayerfeaturesettings.html +18 -18
  60. package/docs/html/classes/mapping_arcgissublayerextension.arcgissublayerrelationshipcollection.html +3 -3
  61. package/docs/html/classes/mapping_arcgissublayerextension.arcgissublayerschema.html +13 -13
  62. package/docs/html/classes/mapping_basemapextension.basemapextension.html +70 -54
  63. package/docs/html/classes/mapping_bookmark.bookmark.html +57 -36
  64. package/docs/html/classes/mapping_buildingcomponentsublayerextension.buildingcomponentsublayerextension.html +83 -69
  65. package/docs/html/classes/mapping_buildingcomponentsublayerextension.buildingcomponentsublayerschema.html +18 -18
  66. package/docs/html/classes/mapping_buildinggroupsublayerextension.buildinggroupsublayerextension.html +86 -72
  67. package/docs/html/classes/mapping_buildinggroupsublayerextension.buildinggroupsublayerschema.html +24 -24
  68. package/docs/html/classes/mapping_buildingscenelayerextension.buildingscenelayerextension.html +112 -98
  69. package/docs/html/classes/mapping_buildingscenelayerextension.buildingscenelayerreadonlyschema.html +26 -26
  70. package/docs/html/classes/mapping_buildingsublayerextension.buildingsublayerextension.html +91 -77
  71. package/docs/html/classes/mapping_buildingsublayerextension.buildingsublayerfeaturesettings.html +20 -20
  72. package/docs/html/classes/mapping_buildingsublayerextension.buildingsublayerschema.html +19 -19
  73. package/docs/html/classes/mapping_csvlayerextension.csvlayerextension.html +117 -103
  74. package/docs/html/classes/mapping_elevationlayerextension.elevationlayerextension.html +118 -104
  75. package/docs/html/classes/mapping_featurecollectionlayerextension.featurecollectionlayerextension.html +110 -96
  76. package/docs/html/classes/mapping_featurelayerextension.featurelayerextension.html +121 -107
  77. package/docs/html/classes/mapping_featurelayerextensionbase.featurelayerextensionbase.html +114 -100
  78. package/docs/html/classes/mapping_featurelayerextensionbase.featurelayerschema.html +25 -25
  79. package/docs/html/classes/mapping_georsslayerextension.georsslayerextension.html +117 -103
  80. package/docs/html/classes/mapping_graphicslayerextension.graphicslayerextension.html +112 -98
  81. package/docs/html/classes/mapping_groundextension.groundextension.html +59 -43
  82. package/docs/html/classes/mapping_grouplayerextension.grouplayerextension.html +110 -96
  83. package/docs/html/classes/mapping_grouplayerextension.grouplayerextensioncollection.html +13 -13
  84. package/docs/html/classes/mapping_imagerylayerextension.imagerylayerextension.html +115 -101
  85. package/docs/html/classes/mapping_imagerytilelayerextension.imagerytilelayerextension.html +115 -101
  86. package/docs/html/classes/mapping_integratedmeshlayerextension.integratedmeshlayerextension.html +119 -105
  87. package/docs/html/classes/mapping_kmllayerextension.kmllayerextension.html +113 -99
  88. package/docs/html/classes/mapping_kmlsublayerextension.kmlsublayerextension.html +89 -75
  89. package/docs/html/classes/mapping_mapextension.mapextension.html +106 -90
  90. package/docs/html/classes/mapping_mapimagelayerextension.mapimagelayerextension.html +115 -101
  91. package/docs/html/classes/mapping_mapimagesublayerextension.mapimagesublayerextension.html +80 -66
  92. package/docs/html/classes/mapping_openstreetmaplayerextension.openstreetmaplayerextension.html +120 -106
  93. package/docs/html/classes/mapping_pointcloudlayerextension.pointcloudlayerextension.html +116 -102
  94. package/docs/html/classes/mapping_scenelayerextension.scenelayerextension.html +115 -101
  95. package/docs/html/classes/mapping_streamlayerextension.streamlayerextension.html +116 -102
  96. package/docs/html/classes/mapping_streamlayerextension.streamlayerschema.html +26 -26
  97. package/docs/html/classes/mapping_support__layerextensioncollection.layerextensioncollectionbase.html +19 -19
  98. package/docs/html/classes/mapping_support_layerlistsettings.extensionbaselayerlistsettings.html +3 -3
  99. package/docs/html/classes/mapping_tilelayerextension.tilelayerextension.html +114 -100
  100. package/docs/html/classes/mapping_tilesublayerextension.tilesublayerextension.html +80 -66
  101. package/docs/html/classes/mapping_vectortilelayerextension.vectortilelayerextension.html +117 -103
  102. package/docs/html/classes/mapping_webtilelayerextension.webtilelayerextension.html +120 -106
  103. package/docs/html/classes/mapping_wmslayerextension.wmslayerextension.html +115 -101
  104. package/docs/html/classes/mapping_wmssublayerextension.wmssublayerextension.html +89 -75
  105. package/docs/html/classes/mapping_wmtslayerextension.wmtslayerextension.html +119 -105
  106. package/docs/html/classes/mapping_wmtssublayerextension.wmtssublayerextension.html +90 -76
  107. package/docs/html/classes/menus_menu.menu.html +60 -43
  108. package/docs/html/classes/menus_menuitem.menuitem.html +72 -55
  109. package/docs/html/classes/support_cancellable.cancellable.html +3 -3
  110. package/docs/html/classes/support_cancellable.cancellation.html +3 -3
  111. package/docs/html/classes/tasks_geocoding_arcgisgeocoder.arcgisgeocoder.html +96 -82
  112. package/docs/html/classes/tasks_geocoding_geocoder.geocoder.html +94 -78
  113. package/docs/html/classes/tasks_identify_arcgissublayerqueryidentifyprovider.arcgissublayerqueryidentifyprovider.html +2 -2
  114. package/docs/html/classes/tasks_identify_buildingcomponentsublayerclientsideidentifyprovider.buildingcomponentsublayerclientsideidentifyprovider.html +48 -5
  115. package/docs/html/classes/tasks_identify_buildingcomponentsublayerhittestidentifyprovider.buildingcomponentsublayerhittestidentifyprovider.html +5 -5
  116. package/docs/html/classes/tasks_identify_clientsideidentifyprovider.clientsideidentifyprovider.html +55 -7
  117. package/docs/html/classes/tasks_identify_csvlayer3dhittestidentifyprovider.csvlayer3dhittestidentifyprovider.html +7 -7
  118. package/docs/html/classes/tasks_identify_csvlayerclientsidequeryidentifyprovider.csvlayerclientsidequeryidentifyprovider.html +13 -7
  119. package/docs/html/classes/tasks_identify_featurelayer3dhittestidentifyprovider.featurelayer3dhittestidentifyprovider.html +9 -9
  120. package/docs/html/classes/tasks_identify_featurelayerclientsideidentifyprovider.featurelayerclientsideidentifyprovider.html +66 -8
  121. package/docs/html/classes/tasks_identify_featurelayerqueryidentifyprovider.featurelayerqueryidentifyprovider.html +5 -5
  122. package/docs/html/classes/tasks_identify_georsslayeridentifyprovider.georsslayeridentifyprovider.html +5 -5
  123. package/docs/html/classes/tasks_identify_graphicslayerqueryidentifyprovider.graphicslayerqueryidentifyprovider.html +2 -2
  124. package/docs/html/classes/tasks_identify_hittestidentifyprovider.hittestidentifyprovider.html +9 -9
  125. package/docs/html/classes/tasks_identify_identifyproviderbase.identifyproviderbase.html +18 -6
  126. package/docs/html/classes/tasks_identify_imagerylayeridentifyprovider.imagerylayeridentifyprovider.html +5 -5
  127. package/docs/html/classes/tasks_identify_kmllayerqueryidentifyprovider.kmllayerqueryidentifyprovider.html +2 -2
  128. package/docs/html/classes/tasks_identify_pointcloudlayerhittestidentifyprovider.pointcloudlayerhittestidentifyprovider.html +6 -6
  129. package/docs/html/classes/tasks_identify_scenelayerclientsideidentifyprovider.scenelayerclientsideidentifyprovider.html +48 -5
  130. package/docs/html/classes/tasks_identify_scenelayerhittestidentifyprovider.scenelayerhittestidentifyprovider.html +5 -5
  131. package/docs/html/classes/tasks_identify_scenelayerqueryidentifyprovider.scenelayerqueryidentifyprovider.html +2 -2
  132. package/docs/html/classes/tasks_identify_streamlayerclientsidequeryidentifyprovider.streamlayerclientsidequeryidentifyprovider.html +48 -5
  133. package/docs/html/classes/tasks_identify_wmssublayeridentifyprovider.wmssublayeridentifyprovider.html +6 -6
  134. package/docs/html/classes/tasks_query_arcgissublayerqueryprovider.arcgissublayerqueryprovider.html +3 -3
  135. package/docs/html/classes/tasks_query_querybasedrelationship.querybasedrelationship.html +78 -42
  136. package/docs/html/classes/tasks_search_geocodersearchprovider.geocodersearchprovider.html +4 -4
  137. package/docs/html/classes/tasks_search_querysearchprovider.querysearchprovider.html +7 -7
  138. package/docs/html/classes/tasks_search_searchservice.searchservice.html +12 -12
  139. package/docs/html/classes/utilities_geometry.coordinatesystembounds.html +26 -5
  140. package/docs/html/enums/data_convert.geometryformat.html +7 -7
  141. package/docs/html/enums/itemtype.itemtype-1.html +73 -19
  142. package/docs/html/index.html +15 -0
  143. package/docs/html/interfaces/data__relationship.relationship-1.html +230 -7
  144. package/docs/html/interfaces/data__relationship.relationshipproperties.html +3 -3
  145. package/docs/html/interfaces/data__tableextension.tableextensionproperties.html +2 -2
  146. package/docs/html/interfaces/data_arcgisservicetableextension.arcgisservicetableextensionproperties.html +4 -4
  147. package/docs/html/interfaces/data_attachment.attachmentproperties.html +1 -1
  148. package/docs/html/interfaces/data_convert.fromcsvoptions.html +13 -13
  149. package/docs/html/interfaces/data_convert.fromshapefileoptions.html +9 -9
  150. package/docs/html/interfaces/data_convert.fromxlsxoptions.html +12 -12
  151. package/docs/html/interfaces/data_convert.tocsvoptions.html +13 -13
  152. package/docs/html/interfaces/data_convert.toshapefileoptions.html +8 -8
  153. package/docs/html/interfaces/data_convert.toxlsxoptions.html +10 -10
  154. package/docs/html/interfaces/data_feature.featureproperties.html +1 -1
  155. package/docs/html/interfaces/data_featurelist.featurelistproperties.html +1 -1
  156. package/docs/html/interfaces/data_featureset.featuresetproperties.html +1 -1
  157. package/docs/html/interfaces/data_featuresettings.featuresettingsproperties.html +9 -9
  158. package/docs/html/interfaces/data_featuresource.featuresource.html +21 -1
  159. package/docs/html/interfaces/data_featuresourcebase.featuresourcebaseproperties.html +2 -2
  160. package/docs/html/interfaces/data_featurestream.featurestreamproperties.html +1 -1
  161. package/docs/html/interfaces/data_fieldextension.fieldextensionproperties.html +5 -5
  162. package/docs/html/interfaces/data_fieldextension.fieldproperties.html +1 -1
  163. package/docs/html/interfaces/data_schema.fieldcollection.html +1 -1
  164. package/docs/html/interfaces/data_schema.fieldextensioncollection.html +1 -1
  165. package/docs/html/interfaces/data_schema.schemaproperties.html +9 -9
  166. package/docs/html/interfaces/data_table.tableproperties.html +1 -1
  167. package/docs/html/interfaces/entity.entity-1.html +20 -1
  168. package/docs/html/interfaces/entity.entitybaseproperties.html +1 -1
  169. package/docs/html/interfaces/entity.entityproperties.html +1 -1
  170. package/docs/html/interfaces/languageresources.languageresourcesproperties.html +1 -1
  171. package/docs/html/interfaces/layer_preset_layerpreset.layerpresetproperties.html +1 -1
  172. package/docs/html/interfaces/mapping__layerextension.layerextensionproperties.html +9 -9
  173. package/docs/html/interfaces/mapping__layerextension.layerproperties.html +2 -2
  174. package/docs/html/interfaces/mapping__layerextension.layerreference.html +4 -4
  175. package/docs/html/interfaces/mapping__sublayerextension.sublayerextensionproperties.html +2 -2
  176. package/docs/html/interfaces/mapping_arcgissublayerextension.arcgissublayerextensionproperties.html +2 -2
  177. package/docs/html/interfaces/mapping_arcgissublayerextension.arcgissublayerproperties.html +16 -16
  178. package/docs/html/interfaces/mapping_basemapextension.basemapextensionproperties.html +8 -8
  179. package/docs/html/interfaces/mapping_bookmark.bookmarkproperties.html +4 -4
  180. package/docs/html/interfaces/mapping_buildingcomponentsublayerextension.buildingcomponentsublayerextensionproperties.html +2 -2
  181. package/docs/html/interfaces/mapping_buildinggroupsublayerextension.buildinggroupsublayerextensionproperties.html +2 -2
  182. package/docs/html/interfaces/mapping_buildingscenelayerextension.buildingscenelayerextensionproperties.html +7 -7
  183. package/docs/html/interfaces/mapping_buildingscenelayerextension.buildingscenelayerproperties.html +2 -2
  184. package/docs/html/interfaces/mapping_buildingsublayerextension.buildingsublayerextensionproperties.html +2 -2
  185. package/docs/html/interfaces/mapping_csvlayerextension.csvlayerextensionproperties.html +8 -8
  186. package/docs/html/interfaces/mapping_elevationlayerextension.elevationlayerextensionproperties.html +8 -8
  187. package/docs/html/interfaces/mapping_featurelayerextension.featurelayerextensionproperties.html +10 -10
  188. package/docs/html/interfaces/mapping_featurelayerextension.featurelayerproperties.html +4 -4
  189. package/docs/html/interfaces/mapping_featurelayerextensionbase.featurelayerbaseproperties.html +2 -2
  190. package/docs/html/interfaces/mapping_featurelayerextensionbase.featurelayerextensionbaseproperties.html +8 -8
  191. package/docs/html/interfaces/mapping_georsslayerextension.georsslayerextensionproperties.html +8 -8
  192. package/docs/html/interfaces/mapping_graphicslayerextension.graphicslayerextensionproperties.html +8 -8
  193. package/docs/html/interfaces/mapping_groundextension.groundextensionproperties.html +1 -1
  194. package/docs/html/interfaces/mapping_grouplayerextension.grouplayerextensionproperties.html +8 -8
  195. package/docs/html/interfaces/mapping_imagerylayerextension.imagerylayerextensionproperties.html +8 -8
  196. package/docs/html/interfaces/mapping_imagerytilelayerextension.imagerytilelayerextensionproperties.html +8 -8
  197. package/docs/html/interfaces/mapping_imagerytilelayerextension.imagerytilelayerproperties.html +2 -2
  198. package/docs/html/interfaces/mapping_integratedmeshlayerextension.integratedmeshlayerextensionproperties.html +8 -8
  199. package/docs/html/interfaces/mapping_kmllayerextension.kmllayerextensionproperties.html +7 -7
  200. package/docs/html/interfaces/mapping_kmlsublayerextension.kmlsublayerextensionproperties.html +2 -2
  201. package/docs/html/interfaces/mapping_mapextension.mapextensionproperties.html +24 -24
  202. package/docs/html/interfaces/mapping_mapextension.tableextensioncollection.html +3 -3
  203. package/docs/html/interfaces/mapping_mapimagelayerextension.mapimagelayerextensionproperties.html +7 -7
  204. package/docs/html/interfaces/mapping_mapimagesublayerextension.mapimagesublayerextensionproperties.html +2 -2
  205. package/docs/html/interfaces/mapping_mapimagesublayerextension.mapimagesublayerproperties.html +16 -16
  206. package/docs/html/interfaces/mapping_openstreetmaplayerextension.openstreetmaplayerextensionproperties.html +8 -8
  207. package/docs/html/interfaces/mapping_pointcloudlayerextension.pointcloudlayerextensionproperties.html +8 -8
  208. package/docs/html/interfaces/mapping_scenelayerextension.scenelayerextensionproperties.html +8 -8
  209. package/docs/html/interfaces/mapping_streamlayerextension.streamlayerextensionproperties.html +8 -8
  210. package/docs/html/interfaces/mapping_support__layerextensioncollection.layerextensioncollection.html +3 -3
  211. package/docs/html/interfaces/mapping_tilelayerextension.tilelayerextensionproperties.html +8 -8
  212. package/docs/html/interfaces/mapping_tilelayerextension.tilelayerproperties.html +2 -2
  213. package/docs/html/interfaces/mapping_tilesublayerextension.tilesublayerextensionproperties.html +2 -2
  214. package/docs/html/interfaces/mapping_tilesublayerextension.tilesublayerproperties.html +16 -16
  215. package/docs/html/interfaces/mapping_vectortilelayerextension.vectortilelayerextensionproperties.html +8 -8
  216. package/docs/html/interfaces/mapping_webtilelayerextension.webtilelayerextensionproperties.html +8 -8
  217. package/docs/html/interfaces/mapping_wmslayerextension.wmslayerextensionproperties.html +7 -7
  218. package/docs/html/interfaces/mapping_wmssublayerextension.wmssublayerextensionproperties.html +2 -2
  219. package/docs/html/interfaces/mapping_wmtslayerextension.wmtslayerextensionproperties.html +7 -7
  220. package/docs/html/interfaces/mapping_wmtssublayerextension.wmtssublayerextensionproperties.html +2 -2
  221. package/docs/html/interfaces/menus_menu.menuproperties.html +1 -1
  222. package/docs/html/interfaces/menus_menuitem.menuitemproperties.html +1 -1
  223. package/docs/html/interfaces/portal_drawinginfo.drawinginfo-1.html +7 -7
  224. package/docs/html/interfaces/portal_extent.extent.html +1 -1
  225. package/docs/html/interfaces/portal_geometry.geometrybase.html +1 -1
  226. package/docs/html/interfaces/portal_layer.layer-1.html +16 -16
  227. package/docs/html/interfaces/portal_layerdefinition.fieldoverride.html +3 -3
  228. package/docs/html/interfaces/portal_layerdefinition.layerdefinition-1.html +47 -47
  229. package/docs/html/interfaces/portal_layerdefinition.layerdefinitiondefaults.html +8 -8
  230. package/docs/html/interfaces/portal_layerdefinition.layertimeinfo.html +9 -9
  231. package/docs/html/interfaces/portal_layerdefinition.timeinfoexportoptions.html +4 -4
  232. package/docs/html/interfaces/portal_multipoint.multipoint.html +1 -1
  233. package/docs/html/interfaces/portal_point.point.html +1 -1
  234. package/docs/html/interfaces/portal_polygon.polygon.html +1 -1
  235. package/docs/html/interfaces/portal_polyline.polyline.html +1 -1
  236. package/docs/html/interfaces/portal_symbol.font.html +5 -5
  237. package/docs/html/interfaces/portal_symbol.symbolbase.html +1 -1
  238. package/docs/html/interfaces/portal_symbol3d.symbol3dbase.html +1 -1
  239. package/docs/html/interfaces/portal_tiledmapservicelayer.tiledmapservicelayer-1.html +8 -8
  240. package/docs/html/interfaces/portal_webmap.webmap-1.html +16 -16
  241. package/docs/html/interfaces/portal_webscene.webscene-1.html +16 -16
  242. package/docs/html/interfaces/support_serializable.serializable.html +5 -0
  243. package/docs/html/interfaces/tasks_geocoding_arcgisgeocoder.arcgisgeocoderproperties.html +7 -7
  244. package/docs/html/interfaces/tasks_geocoding_geocoder.geocodeoptions-1.html +6 -6
  245. package/docs/html/interfaces/tasks_geocoding_geocoder.geocodercapabilities.html +4 -4
  246. package/docs/html/interfaces/tasks_geocoding_geocoder.geocoderproperties.html +2 -2
  247. package/docs/html/interfaces/tasks_query_querybasedrelationship.querybasedrelationshipproperties.html +2 -2
  248. package/docs/html/interfaces/utilities_geometry.geographictransformationjson.html +22 -1
  249. package/docs/html/interfaces/utilities_geometry.geographictransformationstepjson.html +24 -3
  250. package/docs/html/interfaces/utilities_geometry.geojsonlinestring.html +23 -2
  251. package/docs/html/interfaces/utilities_geometry.geojsonmultilinestring.html +23 -2
  252. package/docs/html/interfaces/utilities_geometry.geojsonmultipoint.html +23 -2
  253. package/docs/html/interfaces/utilities_geometry.geojsonmultipolygon.html +23 -2
  254. package/docs/html/interfaces/utilities_geometry.geojsonpoint.html +23 -2
  255. package/docs/html/interfaces/utilities_geometry.geojsonpolygon.html +23 -2
  256. package/docs/html/interfaces/utilities_geometry.gmloptions.html +24 -3
  257. package/docs/html/modules/data__relationship.html +5 -5
  258. package/docs/html/modules/data__relationship.relationship.html +2 -2
  259. package/docs/html/modules/data_attachment.html +1 -1
  260. package/docs/html/modules/data_convert.html +6 -6
  261. package/docs/html/modules/data_feature.html +3 -3
  262. package/docs/html/modules/itemtype.html +638 -0
  263. package/docs/html/modules/mapping__layerextension.html +1 -1
  264. package/docs/html/modules/mapping_bookmark.html +1 -1
  265. package/docs/html/modules/mapping_layerextension.html +27 -0
  266. package/docs/html/modules/mapping_mapextension.html +5 -5
  267. package/docs/html/modules/mapping_sublayerextension.html +9 -0
  268. package/docs/html/modules/portal_drawinginfo.drawinginfo.html +2 -2
  269. package/docs/html/modules/portal_geometry.geometrytype.html +2 -2
  270. package/docs/html/modules/portal_geometry.html +4 -4
  271. package/docs/html/modules/portal_layer.layer.html +4 -4
  272. package/docs/html/modules/portal_layerdefinition.html +2 -2
  273. package/docs/html/modules/portal_layerdefinition.layerdefinition.html +2 -2
  274. package/docs/html/modules/portal_layerdefinition.layerdefinitioncapabilities.html +6 -6
  275. package/docs/html/modules/portal_symbol.html +10 -10
  276. package/docs/html/modules/portal_symbol.symboltype.html +2 -2
  277. package/docs/html/modules/portal_tiledmapservicelayer.tiledmapservicelayer.html +11 -5
  278. package/docs/html/modules/portal_webmap.webmap.html +3 -3
  279. package/docs/html/modules/portal_webscene.webscene.html +3 -3
  280. package/docs/html/modules/support_cancellable.html +3 -3
  281. package/docs/html/modules/support_utilities.html +164 -0
  282. package/docs/html/modules/tasks_geocoding_geocoder.geocodeoptions.html +2 -2
  283. package/docs/html/modules/tasks_identify__utilities.html +114 -0
  284. package/docs/html/modules/tasks_search_searchservice.html +1 -1
  285. package/docs/html/modules/utilities__layers.html +117 -82
  286. package/docs/html/modules/utilities_esri.html +389 -4
  287. package/docs/html/modules/utilities_extensions.html +654 -0
  288. package/docs/html/modules/utilities_geometry.html +263 -18
  289. package/docs/html/modules/utilities_layers.html +9 -0
  290. package/docs/html/modules/utilities_mapping.html +74 -4
  291. package/docs/html/modules/utilities_portal.html +9 -9
  292. package/docs/html/modules/utilities_query.html +3 -3
  293. package/docs/html/modules/utilities_relationships.html +164 -0
  294. package/docs/html/modules/utilities_renderers.html +339 -0
  295. package/docs/html/modules/utilities_symbol.html +264 -19
  296. package/docs/html/modules/version.html +1 -1
  297. package/docs/html/modules.html +20 -0
  298. package/layer-preset/LayerPreset.d.ts +3 -3
  299. package/layer-preset/LayerPreset.js +1 -1
  300. package/layer-preset/LayerPresetSettings.d.ts +1 -1
  301. package/mapping/ArcGISSublayerExtension.d.ts +1 -1
  302. package/mapping/ArcGISSublayerExtension.js +1 -1
  303. package/mapping/BasemapExtension.d.ts +4 -4
  304. package/mapping/BasemapExtension.js +1 -1
  305. package/mapping/Bookmark.d.ts +3 -3
  306. package/mapping/Bookmark.js +1 -1
  307. package/mapping/FeatureLayerExtension.js +1 -1
  308. package/mapping/GroundExtension.d.ts +1 -1
  309. package/mapping/GroundExtension.js +1 -1
  310. package/mapping/LayerExtension.d.ts +2 -1
  311. package/mapping/LayerExtension.js +1 -1
  312. package/mapping/MapExtension.d.ts +4 -1
  313. package/mapping/MapExtension.js +1 -1
  314. package/mapping/SublayerExtension.d.ts +2 -1
  315. package/mapping/SublayerExtension.js +1 -1
  316. package/mapping/WMTSLayerExtension.js +1 -1
  317. package/mapping/_LayerExtension.d.ts +5 -5
  318. package/mapping/_LayerExtension.js +1 -1
  319. package/mapping/_SublayerExtension.d.ts +4 -4
  320. package/mapping/_SublayerExtension.js +1 -1
  321. package/mapping/support/_LayerExtensionCollection.js +1 -1
  322. package/menus/Menu.d.ts +4 -4
  323. package/menus/Menu.js +1 -1
  324. package/menus/MenuItem.d.ts +4 -4
  325. package/menus/MenuItem.js +1 -1
  326. package/package.json +1 -1
  327. package/portal/DrawingInfo.d.ts +1 -1
  328. package/portal/DrawingInfo.js +1 -1
  329. package/portal/Geometry.d.ts +1 -1
  330. package/portal/Geometry.js +1 -1
  331. package/portal/Layer.js +1 -1
  332. package/portal/LayerDefinition.d.ts +1 -1
  333. package/portal/LayerDefinition.js +1 -1
  334. package/portal/Slide.js +1 -1
  335. package/portal/Symbol.d.ts +1 -1
  336. package/portal/Symbol.js +1 -1
  337. package/portal/TiledMapServiceLayer.d.ts +3 -1
  338. package/portal/TiledMapServiceLayer.js +1 -1
  339. package/portal/WebMap.d.ts +1 -1
  340. package/portal/WebMap.js +1 -1
  341. package/portal/WebScene.d.ts +1 -1
  342. package/portal/WebScene.js +1 -1
  343. package/support/Cancellable.js +1 -1
  344. package/support/_graphicsQuery.js +1 -1
  345. package/support/utilities.d.ts +7 -0
  346. package/support/utilities.js +1 -0
  347. package/tasks/geocoding/ArcGISGeocoder.js +1 -1
  348. package/tasks/geocoding/Geocoder.d.ts +1 -1
  349. package/tasks/geocoding/Geocoder.js +1 -1
  350. package/tasks/identify/ArcGISSublayerQueryIdentifyProvider.js +1 -1
  351. package/tasks/identify/BuildingComponentSublayerClientSideIdentifyProvider.js +1 -1
  352. package/tasks/identify/CSVLayer3DHitTestIdentifyProvider.js +1 -1
  353. package/tasks/identify/CSVLayerClientSideQueryIdentifyProvider.d.ts +3 -3
  354. package/tasks/identify/CSVLayerClientSideQueryIdentifyProvider.js +1 -1
  355. package/tasks/identify/ClientSideIdentifyProvider.d.ts +6 -4
  356. package/tasks/identify/ClientSideIdentifyProvider.js +1 -1
  357. package/tasks/identify/FeatureLayer3DHitTestIdentifyProvider.js +1 -1
  358. package/tasks/identify/FeatureLayerClientSideIdentifyProvider.d.ts +6 -0
  359. package/tasks/identify/FeatureLayerClientSideIdentifyProvider.js +1 -1
  360. package/tasks/identify/FeatureLayerQueryIdentifyProvider.js +1 -1
  361. package/tasks/identify/GeoRSSLayerIdentifyProvider.js +1 -1
  362. package/tasks/identify/HitTestIdentifyProvider.d.ts +1 -1
  363. package/tasks/identify/HitTestIdentifyProvider.js +1 -1
  364. package/tasks/identify/IdentifyProviderBase.d.ts +4 -2
  365. package/tasks/identify/IdentifyProviderBase.js +1 -1
  366. package/tasks/identify/IdentifyService.d.ts +1 -1
  367. package/tasks/identify/IdentifyService.js +1 -1
  368. package/tasks/identify/ImageryLayerIdentifyProvider.js +1 -1
  369. package/tasks/identify/PointCloudLayerHitTestIdentifyProvider.d.ts +1 -1
  370. package/tasks/identify/PointCloudLayerHitTestIdentifyProvider.js +1 -1
  371. package/tasks/identify/SceneLayerHitTestIdentifyProvider.d.ts +1 -1
  372. package/tasks/identify/SceneLayerHitTestIdentifyProvider.js +1 -1
  373. package/tasks/identify/WMSSublayerIdentifyProvider.js +1 -1
  374. package/tasks/identify/_utilities.d.ts +1 -0
  375. package/tasks/identify/_utilities.js +1 -0
  376. package/tasks/query/ArcGISSublayerQueryProvider.js +1 -1
  377. package/tasks/query/QueryBasedRelationship.d.ts +4 -0
  378. package/tasks/query/QueryBasedRelationship.js +1 -1
  379. package/tasks/query/QueryService.js +1 -1
  380. package/tasks/search/GeocoderSearchProvider.js +1 -1
  381. package/tasks/search/QuerySearchProvider.js +1 -1
  382. package/tasks/search/SearchService.d.ts +1 -1
  383. package/tasks/search/SearchService.js +1 -1
  384. package/tasks/search/_utilities.js +1 -1
  385. package/utilities/_layers.d.ts +33 -27
  386. package/utilities/_layers.js +1 -1
  387. package/utilities/esri.d.ts +76 -0
  388. package/utilities/esri.js +1 -1
  389. package/utilities/extensions.d.ts +105 -0
  390. package/utilities/extensions.js +1 -0
  391. package/utilities/geometry.d.ts +46 -0
  392. package/utilities/geometry.js +1 -1
  393. package/utilities/layers.d.ts +1 -1
  394. package/utilities/layers.js +1 -1
  395. package/utilities/mapping.d.ts +14 -0
  396. package/utilities/mapping.js +1 -1
  397. package/utilities/portal.js +1 -1
  398. package/utilities/query.d.ts +1 -1
  399. package/utilities/query.js +1 -1
  400. package/utilities/relationships.d.ts +7 -0
  401. package/utilities/relationships.js +1 -0
  402. package/utilities/renderers.d.ts +43 -0
  403. package/utilities/renderers.js +1 -0
  404. package/utilities/symbol.d.ts +49 -0
  405. package/utilities/symbol.js +1 -1
  406. package/version.d.ts +1 -1
  407. package/version.js +1 -1
@@ -2018,6 +2018,10 @@
2018
2018
  "description": "Determines whether this item is currently toggled from its initial state.\nThis property is only meaningful if {@link MenuItem.canBeToggled} is\ntrue. When this property is changed, other properties of the menu item\nwill be swapped with those in \"alternate\". An item can only be toggled if\nit has an alternate state.",
2019
2019
  "type": "boolean"
2020
2020
  },
2021
+ "itemType": {
2022
+ "description": "The item type for this entity when it participates in an App.",
2023
+ "type": "string"
2024
+ },
2021
2025
  "menu": {
2022
2026
  "$ref": "#/definitions/Menu",
2023
2027
  "description": "The parent menu that this item belongs to."
@@ -2068,6 +2072,7 @@
2068
2072
  "isEnabled",
2069
2073
  "isInitialized",
2070
2074
  "isToggled",
2075
+ "itemType",
2071
2076
  "menu",
2072
2077
  "root",
2073
2078
  "submenu",
package/Entity.d.ts CHANGED
@@ -12,6 +12,10 @@ export interface Entity {
12
12
  * The unique ID for this entity.
13
13
  */
14
14
  readonly id: string;
15
+ /**
16
+ * The item type for this entity when it participates in an App.
17
+ */
18
+ readonly itemType: string;
15
19
  /**
16
20
  * Creates an item:// URI reference to this entity.
17
21
  */
@@ -42,13 +46,17 @@ export declare abstract class EntityBase<TProperties extends EntityBasePropertie
42
46
  */
43
47
  get id(): string;
44
48
  /**
45
- * The unique ID for this entity. Once set, this should never change.
49
+ * The item type for this entity when it participates in an App.
46
50
  */
47
- protected _id: string;
51
+ get itemType(): string;
48
52
  /**
49
53
  * The item type for this entity when it participates in an App.
50
54
  */
51
- protected abstract _itemType: string;
55
+ protected abstract readonly _itemType: string;
56
+ /**
57
+ * The unique ID for this entity. Once set, this should never change.
58
+ */
59
+ protected _id: string;
52
60
  /**
53
61
  * Creates a new instance of the entity and assigns the given properties.
54
62
  *
package/Entity.js CHANGED
@@ -1 +1 @@
1
- import{InitializableBase}from"./support/InitializableBase.js";import{generateUuid as generateId}from"./utilities/uuid.js";export{generateId};export class EntityBase extends InitializableBase{constructor(e){super(e),e&&(this._id=e.id)}get id(){return this._id||(this._id=generateId()),this._id}toItemUri(){return`item://${encodeURIComponent(this._itemType)}/${encodeURIComponent(this.id)}`}_getSerializableProperties(){return{...super._getSerializableProperties(),id:{serializeModes:["initial","project"],deserialize:!1}}}}
1
+ import{InitializableBase}from"./support/InitializableBase.js";import{generateUuid as generateId}from"./utilities/uuid.js";export{generateId};export class EntityBase extends InitializableBase{constructor(e){super(e),e&&(this._id=e.id)}get id(){return this._id||(this._id=generateId()),this._id}get itemType(){return this._itemType}toItemUri(){return`item://${encodeURIComponent(this.itemType)}/${encodeURIComponent(this.id)}`}_getSerializableProperties(){return{...super._getSerializableProperties(),id:{serializeModes:["initial","project"],deserialize:!1}}}}
package/ItemType.d.ts CHANGED
@@ -1,3 +1,21 @@
1
+ import type { LanguageResources } from "./LanguageResources.js";
2
+ import type { Attachment } from "./data/Attachment.js";
3
+ import type { Feature } from "./data/Feature.js";
4
+ import type { FeatureList } from "./data/FeatureList.js";
5
+ import type { FeatureSet } from "./data/FeatureSet.js";
6
+ import type { FieldExtension } from "./data/FieldExtension.js";
7
+ import type { Relationship } from "./data/_Relationship.js";
8
+ import type { TableExtension } from "./data/_TableExtension.js";
9
+ import type { LayerPreset } from "./layer-preset/LayerPreset.js";
10
+ import type { BasemapExtension } from "./mapping/BasemapExtension.js";
11
+ import type { Bookmark } from "./mapping/Bookmark.js";
12
+ import type { GroundExtension } from "./mapping/GroundExtension.js";
13
+ import type { MapExtension } from "./mapping/MapExtension.js";
14
+ import type { LayerExtension } from "./mapping/_LayerExtension.js";
15
+ import type { SublayerExtension } from "./mapping/_SublayerExtension.js";
16
+ import type { Menu } from "./menus/Menu.js";
17
+ import type { MenuItem } from "./menus/MenuItem.js";
18
+ import type { Geocoder } from "./tasks/geocoding/Geocoder.js";
1
19
  /**
2
20
  * Well-known values for the "$type" property of an item in an
3
21
  * app config.
@@ -7,34 +25,14 @@ export declare enum ItemType {
7
25
  * Item type for an {@link Attachment}.
8
26
  */
9
27
  ATTACHMENT = "attachment",
10
- /**
11
- * Item type for a {@link Bookmark}.
12
- */
13
- BOOKMARK = "bookmark",
14
- /**
15
- * Item type for a {@link LayerExtension}.
16
- */
17
- LAYER_EXTENSION = "layer-extension",
18
- /**
19
- * Item type for a {@link MapExtension}.
20
- */
21
- MAP_EXTENSION = "map-extension",
22
- /**
23
- * Item type for a {@link SublayerExtension}.
24
- */
25
- SUBLAYER_EXTENSION = "sublayer-extension",
26
- /**
27
- * Item type for a {@link TableExtension}.
28
- */
29
- TABLE_EXTENSION = "table-extension",
30
28
  /**
31
29
  * Item type for a {@link BasemapExtension}.
32
30
  */
33
31
  BASEMAP_EXTENSION = "basemap-extension",
34
32
  /**
35
- * Item type for a {@link GroundExtension}.
33
+ * Item type for a {@link Bookmark}.
36
34
  */
37
- GROUND_EXTENSION = "ground-extension",
35
+ BOOKMARK = "bookmark",
38
36
  /**
39
37
  * Item type for a {@link Feature}.
40
38
  */
@@ -56,9 +54,29 @@ export declare enum ItemType {
56
54
  */
57
55
  GEOCODER = "geocoder",
58
56
  /**
59
- * Item type for a {@link Relationship}.
57
+ * Item type for a {@link GroundExtension}.
60
58
  */
61
- RELATIONSHIP = "relationship",
59
+ GROUND_EXTENSION = "ground-extension",
60
+ /**
61
+ * Item type for a {@link LanguageResources}.
62
+ */
63
+ LANGUAGE_RESOURCES = "language-resources",
64
+ /**
65
+ * Item type for a layer.
66
+ */
67
+ LAYER = "layer",
68
+ /**
69
+ * Item type for a {@link LayerExtension}.
70
+ */
71
+ LAYER_EXTENSION = "layer-extension",
72
+ /**
73
+ * Item type for a {@link LayerPreset}.
74
+ */
75
+ LAYER_PRESET = "layer-preset",
76
+ /**
77
+ * Item type for a {@link MapExtension}.
78
+ */
79
+ MAP_EXTENSION = "map-extension",
62
80
  /**
63
81
  * Item type for a {@link Menu}.
64
82
  */
@@ -68,15 +86,123 @@ export declare enum ItemType {
68
86
  */
69
87
  MENU_ITEM = "menu-item",
70
88
  /**
71
- * Item type for a {@link LayerPreset}.
89
+ * Item type for a {@link Relationship}.
72
90
  */
73
- LAYER_PRESET = "layer-preset",
91
+ RELATIONSHIP = "relationship",
74
92
  /**
75
- * Item type for a layer.
93
+ * Item type for a {@link SublayerExtension}.
76
94
  */
77
- LAYER = "layer",
95
+ SUBLAYER_EXTENSION = "sublayer-extension",
78
96
  /**
79
- * Item type for a {@link LanguageResources}.
97
+ * Item type for a {@link TableExtension}.
80
98
  */
81
- LANGUAGE_RESOURCES = "language-resources"
99
+ TABLE_EXTENSION = "table-extension"
82
100
  }
101
+ /**
102
+ * Returns true if item is an Attachment.
103
+ *
104
+ * @param item The item to check.
105
+ */
106
+ export declare function isAttachment(item: unknown): item is Attachment;
107
+ /**
108
+ * Returns true if item is a Bookmark.
109
+ *
110
+ * @param item The item to check.
111
+ */
112
+ export declare function isBookmark(item: unknown): item is Bookmark;
113
+ /**
114
+ * Returns true if item is a LayerExtension.
115
+ *
116
+ * @param item The item to check.
117
+ */
118
+ export declare function isLayerExtension(item: unknown): item is LayerExtension;
119
+ /**
120
+ * Returns true if item is a MapExtension.
121
+ *
122
+ * @param item The item to check.
123
+ */
124
+ export declare function isMapExtension(item: unknown): item is MapExtension;
125
+ /**
126
+ * Returns true if item is a SublayerExtension.
127
+ *
128
+ * @param item The item to check.
129
+ */
130
+ export declare function isSublayerExtension(item: unknown): item is SublayerExtension;
131
+ /**
132
+ * Returns true if item is a TableExtension.
133
+ *
134
+ * @param item The item to check.
135
+ */
136
+ export declare function isTableExtension(item: unknown): item is TableExtension;
137
+ /**
138
+ * Returns true if item is a BasemapExtension.
139
+ *
140
+ * @param item The item to check.
141
+ */
142
+ export declare function isBasemapExtension(item: unknown): item is BasemapExtension;
143
+ /**
144
+ * Returns true if item is a GroundExtension.
145
+ *
146
+ * @param item The item to check.
147
+ */
148
+ export declare function isGroundExtension(item: unknown): item is GroundExtension;
149
+ /**
150
+ * Returns true if item is a Feature.
151
+ *
152
+ * @param item The item to check.
153
+ */
154
+ export declare function isFeature(item: unknown): item is Feature;
155
+ /**
156
+ * Returns true if item is a FeatureSet.
157
+ *
158
+ * @param item The item to check.
159
+ */
160
+ export declare function isFeatureSet(item: unknown): item is FeatureSet;
161
+ /**
162
+ * Returns true if item is a FeatureList.
163
+ *
164
+ * @param item The item to check.
165
+ */
166
+ export declare function isFeatureList(item: unknown): item is FeatureList;
167
+ /**
168
+ * Returns true if item is a FieldExtension.
169
+ *
170
+ * @param item The item to check.
171
+ */
172
+ export declare function isFieldExtension(item: unknown): item is FieldExtension;
173
+ /**
174
+ * Returns true if item is a Geocoder.
175
+ *
176
+ * @param item The item to check.
177
+ */
178
+ export declare function isGeocoder(item: unknown): item is Geocoder;
179
+ /**
180
+ * Returns true if item is a Relationship.
181
+ *
182
+ * @param item The item to check.
183
+ */
184
+ export declare function isRelationship(item: unknown): item is Relationship;
185
+ /**
186
+ * Returns true if item is a Menu.
187
+ *
188
+ * @param item The item to check.
189
+ */
190
+ export declare function isMenu(item: unknown): item is Menu;
191
+ /**
192
+ * Returns true if item is a MenuItem.
193
+ *
194
+ * @param item The item to check.
195
+ */
196
+ export declare function isMenuItem(item: unknown): item is MenuItem;
197
+ /**
198
+ * Returns true if item is a LayerPreset.
199
+ *
200
+ * @param item The item to check.
201
+ */
202
+ export declare function isLayerPreset(item: unknown): item is LayerPreset;
203
+ /**
204
+ * Returns true if item is a LanguageResources.
205
+ *
206
+ * @param item The item to check.
207
+ */
208
+ export declare function isLanguageResources(item: unknown): item is LanguageResources;
package/ItemType.js CHANGED
@@ -1 +1 @@
1
- export var ItemType;!function(e){e.ATTACHMENT="attachment",e.BOOKMARK="bookmark",e.LAYER_EXTENSION="layer-extension",e.MAP_EXTENSION="map-extension",e.SUBLAYER_EXTENSION="sublayer-extension",e.TABLE_EXTENSION="table-extension",e.BASEMAP_EXTENSION="basemap-extension",e.GROUND_EXTENSION="ground-extension",e.FEATURE="feature",e.FEATURE_SET="feature-set",e.FEATURE_LIST="feature-list",e.FIELD_EXTENSION="field-extension",e.GEOCODER="geocoder",e.RELATIONSHIP="relationship",e.MENU="menu",e.MENU_ITEM="menu-item",e.LAYER_PRESET="layer-preset",e.LAYER="layer",e.LANGUAGE_RESOURCES="language-resources"}(ItemType||(ItemType={}));
1
+ export var ItemType;!function(e){e.ATTACHMENT="attachment",e.BASEMAP_EXTENSION="basemap-extension",e.BOOKMARK="bookmark",e.FEATURE="feature",e.FEATURE_SET="feature-set",e.FEATURE_LIST="feature-list",e.FIELD_EXTENSION="field-extension",e.GEOCODER="geocoder",e.GROUND_EXTENSION="ground-extension",e.LANGUAGE_RESOURCES="language-resources",e.LAYER="layer",e.LAYER_EXTENSION="layer-extension",e.LAYER_PRESET="layer-preset",e.MAP_EXTENSION="map-extension",e.MENU="menu",e.MENU_ITEM="menu-item",e.RELATIONSHIP="relationship",e.SUBLAYER_EXTENSION="sublayer-extension",e.TABLE_EXTENSION="table-extension"}(ItemType||(ItemType={}));export function isAttachment(e){return(null==e?void 0:e.itemType)===ItemType.ATTACHMENT}export function isBookmark(e){return(null==e?void 0:e.itemType)===ItemType.BOOKMARK}export function isLayerExtension(e){return(null==e?void 0:e.itemType)===ItemType.LAYER_EXTENSION}export function isMapExtension(e){return(null==e?void 0:e.itemType)===ItemType.MAP_EXTENSION}export function isSublayerExtension(e){return(null==e?void 0:e.itemType)===ItemType.SUBLAYER_EXTENSION}export function isTableExtension(e){return(null==e?void 0:e.itemType)===ItemType.TABLE_EXTENSION}export function isBasemapExtension(e){return(null==e?void 0:e.itemType)===ItemType.BASEMAP_EXTENSION}export function isGroundExtension(e){return(null==e?void 0:e.itemType)===ItemType.GROUND_EXTENSION}export function isFeature(e){return(null==e?void 0:e.itemType)===ItemType.FEATURE}export function isFeatureSet(e){return(null==e?void 0:e.itemType)===ItemType.FEATURE_SET}export function isFeatureList(e){return(null==e?void 0:e.itemType)===ItemType.FEATURE_LIST}export function isFieldExtension(e){return(null==e?void 0:e.itemType)===ItemType.FIELD_EXTENSION}export function isGeocoder(e){return(null==e?void 0:e.itemType)===ItemType.GEOCODER}export function isRelationship(e){return(null==e?void 0:e.itemType)===ItemType.RELATIONSHIP}export function isMenu(e){return(null==e?void 0:e.itemType)===ItemType.MENU}export function isMenuItem(e){return(null==e?void 0:e.itemType)===ItemType.MENU_ITEM}export function isLayerPreset(e){return(null==e?void 0:e.itemType)===ItemType.LAYER_PRESET}export function isLanguageResources(e){return(null==e?void 0:e.itemType)===ItemType.LANGUAGE_RESOURCES}
@@ -36,7 +36,7 @@ export declare class LanguageResources extends SerializableBase<LanguageResource
36
36
  /**
37
37
  * @inheritdoc
38
38
  */
39
- protected get _itemType(): string;
39
+ get itemType(): string;
40
40
  /**
41
41
  * The unique ID for this entity. Once set, this should never change.
42
42
  */
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import{ItemType}from"./ItemType.js";import{INVARIANT}from"./locale.js";import{serializable,SerializableBase}from"./support/Serializable.js";import{ObservableMap}from"./utilities/ObservableMap.js";import{generateUuid}from"./utilities/uuid.js";let LanguageResources=class extends SerializableBase{constructor(e){super(e),this._locale=INVARIANT,this._values=new ObservableMap,this._id=null==e?void 0:e.id,(null==e?void 0:e.locale)&&(this._locale=e.locale)}get id(){return this._id||(this._id=generateUuid()),this._id}get locale(){return this._locale}get values(){return this._values}get _itemType(){return ItemType.LANGUAGE_RESOURCES}toItemUri(){return`item://${encodeURIComponent(this._itemType)}/${encodeURIComponent(this.id)}`}_getSerializableProperties(){return{...super._getSerializableProperties(),id:{serializeModes:["initial"],deserialize:!1},locale:{serializeModes:["initial"],deserialize:!1},values:{serializeModes:["initial"],serialize:()=>{const e={};for(const[i,s]of this.values.entries())e[i]=s;return e},deserialize:e=>{this._values.clear();for(const i of Object.keys(e))this._values.set(i,e[i])}}}}};LanguageResources=__decorate([serializable],LanguageResources);export{LanguageResources};
1
+ import{__decorate}from"tslib";import{ItemType}from"./ItemType.js";import{INVARIANT}from"./locale.js";import{serializable,SerializableBase}from"./support/Serializable.js";import{ObservableMap}from"./utilities/ObservableMap.js";import{generateUuid}from"./utilities/uuid.js";let LanguageResources=class extends SerializableBase{constructor(e){super(e),this._locale=INVARIANT,this._values=new ObservableMap,this._id=null==e?void 0:e.id,(null==e?void 0:e.locale)&&(this._locale=e.locale)}get id(){return this._id||(this._id=generateUuid()),this._id}get locale(){return this._locale}get values(){return this._values}get itemType(){return ItemType.LANGUAGE_RESOURCES}toItemUri(){return`item://${encodeURIComponent(this.itemType)}/${encodeURIComponent(this.id)}`}_getSerializableProperties(){return{...super._getSerializableProperties(),id:{serializeModes:["initial"],deserialize:!1},locale:{serializeModes:["initial"],deserialize:!1},values:{serializeModes:["initial"],serialize:()=>{const e={};for(const[i,s]of this.values.entries())e[i]=s;return e},deserialize:e=>{this._values.clear();for(const i of Object.keys(e))this._values.set(i,e[i])}}}}};LanguageResources=__decorate([serializable],LanguageResources);export{LanguageResources};
@@ -1,4 +1,4 @@
1
- import FeatureLayer from "@arcgis/core/layers/FeatureLayer";
1
+ import type FeatureLayer from "@arcgis/core/layers/FeatureLayer";
2
2
  import { Attachment } from "../data/Attachment.js";
3
3
  import { ArcGISRequestHelper } from "../support/ArcGISRequestHelper.js";
4
4
  import { PropertyDefs } from "../support/Serializable.js";
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import FeatureLayer from"@arcgis/core/layers/FeatureLayer";import MapImageSublayer from"@arcgis/core/layers/support/Sublayer";import{InvalidOperationError}from"../InvalidOperationError.js";import{toAttachment}from"../data/Attachment.js";import{FeatureSaveError}from"../data/FeatureSaveError.js";import{DefaultArcGISRequestHelper}from"../support/ArcGISRequestHelper.js";import{cancelify}from"../support/Cancellable.js";import{serializable}from"../support/Serializable.js";import{ArcGISRelationshipCollection}from"../support/_ArcGISRelationshipCollection.js";import{executeQuery}from"../support/_query.js";import{ReadOnlyCollection}from"../utilities/ReadOnlyCollection.js";import{Collection}from"../utilities/collection.js";import{isNumeric,parse}from"../utilities/number.js";import{toGraphic}from"./Feature.js";import{TableExtension,TableFeatureSettings,TableSchema}from"./_TableExtension.js";const ERR_SCHEMA_READ_ONLY="This schema property is read-only.";let ArcGISServiceTableExtension=class extends TableExtension{get requestHelper(){return this._requestHelper||(this._requestHelper=new DefaultArcGISRequestHelper),this._requestHelper}set requestHelper(e){this._requestHelper=e}get capabilities(){var e,t,r;return null!==(r=null===(t=null===(e=this.table)||void 0===e?void 0:e.capabilities)||void 0===t?void 0:t.operations)&&void 0!==r?r:super.capabilities}get table(){return super.table}async _getAttachments(e){var t,r;if(!(null===(t=this.table.capabilities)||void 0===t?void 0:t.data.supportsAttachment))return[];const a=`${this._layerUrl}/${e.primaryKey}/attachments`,i=await this.requestHelper.request(a,{query:{f:"json"}});return(null===(r=null==i?void 0:i.data)||void 0===r?void 0:r.attachmentInfos)?i.data.attachmentInfos.map((e=>toAttachment(e,a))):[]}get _layerUrl(){return isNumeric(this.table.layerId)?`${this.table.url}/${this.table.layerId}`:this.table.url}_getFeatures(e,t){const r=this.table.createQuery();return r.objectIds=e.map((e=>parse(e))),r.where=void 0,r.outFields=t.outFields,r.returnGeometry=t.returnGeometry,executeQuery(r,this,this.table,t.cancelToken)}async _addFeatures(e,t){const r=Array.from(e);if(0===r.length)return;const a=await this._applyEdits({addFeatures:r.map(toGraphic),updateFeatures:[],deleteFeatures:[]});if(!a.addFeatureResults||a.addFeatureResults.length!==r.length)throw new FeatureSaveError("Received malformed response from server while saving feature(s).");let i;if(a.addFeatureResults.forEach(((e,t)=>{if(e.error){i=i||new FeatureSaveError("Errors encountered when adding features.");const{primaryKey:a}=r[t];i.errors.set(a,new Error(`Failed to add feature with id ${a}. ${e.error.description}`))}})),i)throw i}async _updateFeatures(e,t){const r=Array.from(e);if(0===r.length)return;const a=await this._applyEdits({addFeatures:[],updateFeatures:r.map(toGraphic),deleteFeatures:[]});if(!a.updateFeatureResults||a.updateFeatureResults.length!==r.length)throw new FeatureSaveError("Received malformed response from server while saving feature(s).");let i;if(a.updateFeatureResults.forEach(((e,t)=>{if(e.error){i=i||new FeatureSaveError("Errors encountered when updating features.");const{primaryKey:a}=r[t];i.errors.set(a,new Error(`Failed to update feature with id ${a}. ${e.error.description}`))}})),i)throw i}async _deleteFeatures(e,t){if(0===e.length)return;const r=await this._applyEdits({addFeatures:[],updateFeatures:[],deleteFeatures:e.map((e=>({globalId:e})))});if(!r.deleteFeatureResults)throw new FeatureSaveError("Received malformed response from server while saving feature(s).");let a;if(r.deleteFeatureResults.forEach(((t,r)=>{if(t.error){a=a||new FeatureSaveError("Errors encountered when deleting features.");const i=e[r];a.errors.set(i,new Error(`Failed to delete feature with id ${i}. ${t.error.description}`))}})),a)throw a}async _onInitialize(){await super._onInitialize(),await this.relationships.initialize()}_isSupportedTable(e){return!e.loaded||e.isTable}_createFeatureSettings(){return new ArcGISServiceTableFeatureSettings(this)}_createRelationships(){return new RelationshipCollection(this)}_createSchema(){return new ArcGISServiceTableSchema(this)}_getSerializableProperties(){const e=super._getSerializableProperties();return{...e,table:{...this._toPropertyDef(e.table),default:{$tableType:"ArcGISServiceTable"}},requestHelper:{serialize:!1}}}async _applyEdits(e,t={}){const r=this.table.applyEdits(e),a=await cancelify(r,t.cancelToken);if(!a)throw new FeatureSaveError("Received malformed response from server while saving feature(s).");return a}};ArcGISServiceTableExtension=__decorate([serializable],ArcGISServiceTableExtension);export{ArcGISServiceTableExtension};class TypeCollection extends ReadOnlyCollection{constructor(e){if(super(),e.table)this._onTableResolved(e.table);else{this._collection=new Collection;const t=e.watch("table",(()=>{this._onTableResolved(e.table),t.remove()}),!0)}}_onTableResolved(e){this._collection=new Collection(e.types)}}let ArcGISServiceTableSchema=class extends TableSchema{constructor(e){super(e),this._typeCollection=new TypeCollection(e),this._bindSettingToTableProperty("displayField"),this._bindSettingToTableProperty("typeIdField")}get types(){return this._typeCollection}_setSetting(e,t){if(this._tableBindings.has(e))throw new InvalidOperationError(ERR_SCHEMA_READ_ONLY);super._setSetting(e,t)}_createFieldCollection(){return new ReadOnlyCollection(super._createFieldCollection())}};ArcGISServiceTableSchema=__decorate([serializable],ArcGISServiceTableSchema);let ArcGISServiceTableFeatureSettings=class extends TableFeatureSettings{constructor(e){if(super(),this._tableBindings=new Map,this._tableExtension=e,this._bindSettingToTableProperty("popupTemplate"),e.table)this._onTableResolved(e.table);else{const t=e.watch("table",(()=>{this._onTableResolved(e.table),t.remove()}),!0)}}_getSetting(e,t){return this._tableBindings.has(e)&&this._tableExtension.table?this._tableExtension.table[this._tableBindings.get(e)]:super._getSetting(e,t)}_setSetting(e,t){this._tableBindings.has(e)&&this._tableExtension.table?this._tableExtension.table[this._tableBindings.get(e)]=t:super._setSetting(e,t)}_bindSettingToTableProperty(e,t){const r=null!=t?t:e;this._tableBindings.set(e,r),this._tableExtension.watch(`table.${r}`,(()=>this.notifyChange(e)),!0)}_onTableResolved(e){for(const t of this._tableBindings.keys())this.isModified(t)&&(e[t]=this[t],this.reset(t))}};ArcGISServiceTableFeatureSettings=__decorate([serializable],ArcGISServiceTableFeatureSettings);class RelationshipCollection extends ArcGISRelationshipCollection{get _sourceUrl(){if(this._source.table&&this._source.table.url)return isNumeric(this._source.table.layerId)?`${this._source.table.url}/${this._source.table.layerId}`:this._source.table.url}get _sourceLayerId(){var e;return null===(e=this._source.table)||void 0===e?void 0:e.layerId}_findRelatedSource(e){if(!this._source.mapExtension||!this._source.table||!this._source.table.url)return;const t=this._source.mapExtension.tableExtensions.initializedItems.find((t=>t instanceof ArcGISServiceTableExtension&&t.table.url===this._source.table.url&&t.table.layerId===e));if(t)return t;for(const t of this._source.mapExtension.layerExtensions.initializedItems.toArray()){const r=t.allSublayerExtensions.initializedItems.find((t=>t.sublayer instanceof MapImageSublayer&&t.sublayer.layer.url===this._source.table.url&&t.sublayer.id===e));if(r)return r}return this._source.mapExtension.layerExtensions.initializedItems.find((t=>t.layer instanceof FeatureLayer&&t.layer.url===this._source.table.url&&t.layer.layerId===e))}}
1
+ import{__decorate}from"tslib";import{InvalidOperationError}from"../InvalidOperationError.js";import{toAttachment}from"../data/Attachment.js";import{FeatureSaveError}from"../data/FeatureSaveError.js";import{DefaultArcGISRequestHelper}from"../support/ArcGISRequestHelper.js";import{cancelify}from"../support/Cancellable.js";import{serializable}from"../support/Serializable.js";import{ArcGISRelationshipCollection}from"../support/_ArcGISRelationshipCollection.js";import{executeQuery}from"../support/_query.js";import{ReadOnlyCollection}from"../utilities/ReadOnlyCollection.js";import{Collection}from"../utilities/collection.js";import{isArcGISServiceTableExtension}from"../utilities/extensions.js";import{isFeatureLayer,isMapImageSublayer}from"../utilities/layers.js";import{isNumeric,parse}from"../utilities/number.js";import{toGraphic}from"./Feature.js";import{TableExtension,TableFeatureSettings,TableSchema}from"./_TableExtension.js";const ERR_SCHEMA_READ_ONLY="This schema property is read-only.";let ArcGISServiceTableExtension=class extends TableExtension{get requestHelper(){return this._requestHelper||(this._requestHelper=new DefaultArcGISRequestHelper),this._requestHelper}set requestHelper(e){this._requestHelper=e}get capabilities(){var e,t,r;return null!==(r=null===(t=null===(e=this.table)||void 0===e?void 0:e.capabilities)||void 0===t?void 0:t.operations)&&void 0!==r?r:super.capabilities}get table(){return super.table}async _getAttachments(e){var t,r;if(!(null===(t=this.table.capabilities)||void 0===t?void 0:t.data.supportsAttachment))return[];const i=`${this._layerUrl}/${e.primaryKey}/attachments`,a=await this.requestHelper.request(i,{query:{f:"json"}});return(null===(r=null==a?void 0:a.data)||void 0===r?void 0:r.attachmentInfos)?a.data.attachmentInfos.map((e=>toAttachment(e,i))):[]}get _layerUrl(){return isNumeric(this.table.layerId)?`${this.table.url}/${this.table.layerId}`:this.table.url}_getFeatures(e,t){const r=this.table.createQuery();return r.objectIds=e.map((e=>parse(e))),r.where=void 0,r.outFields=t.outFields,r.returnGeometry=t.returnGeometry,executeQuery(r,this,this.table,t.cancelToken)}async _addFeatures(e,t){const r=Array.from(e);if(0===r.length)return;const i=await this._applyEdits({addFeatures:r.map(toGraphic),updateFeatures:[],deleteFeatures:[]});if(!i.addFeatureResults||i.addFeatureResults.length!==r.length)throw new FeatureSaveError("Received malformed response from server while saving feature(s).");let a;if(i.addFeatureResults.forEach(((e,t)=>{if(e.error){a=a||new FeatureSaveError("Errors encountered when adding features.");const{primaryKey:i}=r[t];a.errors.set(i,new Error(`Failed to add feature with id ${i}. ${e.error.description}`))}})),a)throw a}async _updateFeatures(e,t){const r=Array.from(e);if(0===r.length)return;const i=await this._applyEdits({addFeatures:[],updateFeatures:r.map(toGraphic),deleteFeatures:[]});if(!i.updateFeatureResults||i.updateFeatureResults.length!==r.length)throw new FeatureSaveError("Received malformed response from server while saving feature(s).");let a;if(i.updateFeatureResults.forEach(((e,t)=>{if(e.error){a=a||new FeatureSaveError("Errors encountered when updating features.");const{primaryKey:i}=r[t];a.errors.set(i,new Error(`Failed to update feature with id ${i}. ${e.error.description}`))}})),a)throw a}async _deleteFeatures(e,t){if(0===e.length)return;const r=await this._applyEdits({addFeatures:[],updateFeatures:[],deleteFeatures:e.map((e=>({globalId:e})))});if(!r.deleteFeatureResults)throw new FeatureSaveError("Received malformed response from server while saving feature(s).");let i;if(r.deleteFeatureResults.forEach(((t,r)=>{if(t.error){i=i||new FeatureSaveError("Errors encountered when deleting features.");const a=e[r];i.errors.set(a,new Error(`Failed to delete feature with id ${a}. ${t.error.description}`))}})),i)throw i}async _onInitialize(){await super._onInitialize(),await this.relationships.initialize()}_isSupportedTable(e){return!e.loaded||e.isTable}_createFeatureSettings(){return new ArcGISServiceTableFeatureSettings(this)}_createRelationships(){return new RelationshipCollection(this)}_createSchema(){return new ArcGISServiceTableSchema(this)}_getSerializableProperties(){const e=super._getSerializableProperties();return{...e,table:{...this._toPropertyDef(e.table),default:{$tableType:"ArcGISServiceTable"}},requestHelper:{serialize:!1}}}async _applyEdits(e,t={}){const r=this.table.applyEdits(e),i=await cancelify(r,t.cancelToken);if(!i)throw new FeatureSaveError("Received malformed response from server while saving feature(s).");return i}};ArcGISServiceTableExtension=__decorate([serializable],ArcGISServiceTableExtension);export{ArcGISServiceTableExtension};class TypeCollection extends ReadOnlyCollection{constructor(e){if(super(),e.table)this._onTableResolved(e.table);else{this._collection=new Collection;const t=e.watch("table",(()=>{this._onTableResolved(e.table),t.remove()}),!0)}}_onTableResolved(e){this._collection=new Collection(e.types)}}let ArcGISServiceTableSchema=class extends TableSchema{constructor(e){super(e),this._typeCollection=new TypeCollection(e),this._bindSettingToTableProperty("displayField"),this._bindSettingToTableProperty("typeIdField")}get types(){return this._typeCollection}_setSetting(e,t){if(this._tableBindings.has(e))throw new InvalidOperationError(ERR_SCHEMA_READ_ONLY);super._setSetting(e,t)}_createFieldCollection(){return new ReadOnlyCollection(super._createFieldCollection())}};ArcGISServiceTableSchema=__decorate([serializable],ArcGISServiceTableSchema);let ArcGISServiceTableFeatureSettings=class extends TableFeatureSettings{constructor(e){if(super(),this._tableBindings=new Map,this._tableExtension=e,this._bindSettingToTableProperty("popupTemplate"),e.table)this._onTableResolved(e.table);else{const t=e.watch("table",(()=>{this._onTableResolved(e.table),t.remove()}),!0)}}_getSetting(e,t){return this._tableBindings.has(e)&&this._tableExtension.table?this._tableExtension.table[this._tableBindings.get(e)]:super._getSetting(e,t)}_setSetting(e,t){this._tableBindings.has(e)&&this._tableExtension.table?this._tableExtension.table[this._tableBindings.get(e)]=t:super._setSetting(e,t)}_bindSettingToTableProperty(e,t){const r=null!=t?t:e;this._tableBindings.set(e,r),this._tableExtension.watch(`table.${r}`,(()=>this.notifyChange(e)),!0)}_onTableResolved(e){for(const t of this._tableBindings.keys())this.isModified(t)&&(e[t]=this[t],this.reset(t))}};ArcGISServiceTableFeatureSettings=__decorate([serializable],ArcGISServiceTableFeatureSettings);class RelationshipCollection extends ArcGISRelationshipCollection{get _sourceUrl(){if(this._source.table&&this._source.table.url)return isNumeric(this._source.table.layerId)?`${this._source.table.url}/${this._source.table.layerId}`:this._source.table.url}get _sourceLayerId(){var e;return null===(e=this._source.table)||void 0===e?void 0:e.layerId}_findRelatedSource(e){if(!this._source.mapExtension||!this._source.table||!this._source.table.url)return;const t=this._source.mapExtension.tableExtensions.initializedItems.find((t=>isArcGISServiceTableExtension(t)&&t.table.url===this._source.table.url&&t.table.layerId===e));if(t)return t;for(const t of this._source.mapExtension.layerExtensions.initializedItems.toArray()){const r=t.allSublayerExtensions.initializedItems.find((t=>isMapImageSublayer(t.sublayer)&&t.sublayer.layer.url===this._source.table.url&&t.sublayer.id===e));if(r)return r}return this._source.mapExtension.layerExtensions.initializedItems.find((t=>isFeatureLayer(t.layer)&&t.layer.url===this._source.table.url&&t.layer.layerId===e))}}
@@ -69,7 +69,7 @@ export declare class Attachment extends EntityBase<AttachmentProperties> {
69
69
  /**
70
70
  * @inheritdoc
71
71
  */
72
- protected get _itemType(): string;
72
+ protected readonly _itemType: string;
73
73
  /**
74
74
  * @inheritdoc
75
75
  */
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import{EntityBase}from"../Entity.js";import{ItemType}from"../ItemType.js";import{serializable}from"../support/Serializable.js";let Attachment=class extends EntityBase{get _itemType(){return ItemType.ATTACHMENT}_getSerializableProperties(){return{...super._getSerializableProperties(),url:"initial",contentType:"initial",size:"initial",title:"initial"}}};Attachment=__decorate([serializable],Attachment);export{Attachment};export function toAttachment(t,e){var i;return new Attachment({id:t.id.toString(),contentType:t.contentType,size:t.size,title:t.name,url:null!==(i=t.url)&&void 0!==i?i:`${e}/${t.id}`})}
1
+ import{__decorate}from"tslib";import{EntityBase}from"../Entity.js";import{ItemType}from"../ItemType.js";import{serializable}from"../support/Serializable.js";let Attachment=class extends EntityBase{constructor(){super(...arguments),this._itemType=ItemType.ATTACHMENT}_getSerializableProperties(){return{...super._getSerializableProperties(),url:"initial",contentType:"initial",size:"initial",title:"initial"}}};Attachment=__decorate([serializable],Attachment);export{Attachment};export function toAttachment(t,e){var i;return new Attachment({id:t.id.toString(),contentType:t.contentType,size:t.size,title:t.name,url:null!==(i=t.url)&&void 0!==i?i:`${e}/${t.id}`})}
package/data/Feature.d.ts CHANGED
@@ -104,6 +104,10 @@ export declare class Feature extends EntityBase<FeatureProperties> {
104
104
  * The Expression values associated with this feature. See {@link fetchExpressionInfos}.
105
105
  */
106
106
  readonly expressionFieldValues: ReadOnlyMap<string, unknown>;
107
+ /**
108
+ * @inheritdoc
109
+ */
110
+ protected readonly _itemType: string;
107
111
  /**
108
112
  * The type of geometry. This property will be undefined if the data is
109
113
  * not spatial.
@@ -146,10 +150,6 @@ export declare class Feature extends EntityBase<FeatureProperties> {
146
150
  * The Esri API FeatureType object that is associated with this feature.
147
151
  */
148
152
  get type(): FeatureType;
149
- /**
150
- * @inheritdoc
151
- */
152
- protected get _itemType(): string;
153
153
  private get _title();
154
154
  private get _description();
155
155
  private _geometry;
package/data/Feature.js CHANGED
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import Graphic from"@arcgis/core/Graphic";import*as Arcade from"@arcgis/core/arcade/arcade";import CodedValueDomain from"@arcgis/core/layers/support/CodedValueDomain";import{EntityBase}from"../Entity.js";import{Hyperlink}from"../Hyperlink.js";import{InvalidOperationError}from"../InvalidOperationError.js";import{ItemType}from"../ItemType.js";import{toEsriApiGeometry,toPortalGeometry}from"../portal/Geometry.js";import{serializable}from"../support/Serializable.js";import{MapTransformCollection}from"../utilities/MapTransformCollection.js";import{ObservableMap}from"../utilities/ObservableMap.js";import{ReadOnlyMap}from"../utilities/ReadOnlyMap.js";import{arcadeScriptUsesGeometry,isArcadeScriptAsync,runArcadeExpression,runAsyncArcadeExpression}from"../utilities/arcade.js";import{flatten,groupBy}from"../utilities/array.js";import{checkArg}from"../utilities/checkArg.js";import{Collection}from"../utilities/collection.js";import{parse as parseDate,esriFormatToGeocortexFormat}from"../utilities/date.js";import{some,map as mapIterable,concat,forEach,find}from"../utilities/iterable.js";import{getLogger}from"../utilities/log.js";import{parse as parseNumber,NumberFormat}from"../utilities/number.js";import{map as promiseMap}from"../utilities/promise.js";import{format as formatString}from"../utilities/string.js";import{FeatureSettings}from"./FeatureSettings.js";import{_fieldWithArcadeXRegex,_fieldWithRelationshipRegex,Schema}from"./Schema.js";const log=getLogger("geocortex.api.data.Feature");export const SCORE_FIELD="_score";export const SCORE_FIELD_ORIGINAL="_score_original";let Feature=class extends EntityBase{constructor(e){super(e),this._expressionFieldValues=new ObservableMap,this._expressionValuesUpdatePending=!1,this.settings=new FeatureSettings,this.settings._setFeature(this),this.schema=new Schema,this.schema._featureSettings=this.settings,this.attachments=new Collection,this.attributes=new ObservableMap,this._relatedFeatures=new ObservableMap,this.expressionFieldValues=new ExpressionFieldsValuesImpl(this._expressionFieldValues,this)}get geometry(){return this._geometry}set geometry(e){var t;this._notifyChange("geometryType"),this._geometry=toEsriApiGeometry(e),this.schema.spatialReference=null===(t=this._geometry)||void 0===t?void 0:t.spatialReference}get geometryType(){return this.geometry?this.geometry.type:void 0}get source(){return this._source}set source(e){this._source&&this.settings.parent===this._source.featureSettings&&(this.settings.parent=void 0),this._source&&this.schema.parent===this._source.schema&&(this.settings.parent=void 0),this._source=e,this.settings.parent||(this.settings.parent=e?e.featureSettings:void 0),this.schema.parent||(this.schema.parent=e?e.schema:void 0)}get primaryKey(){const e=this.attributes.get(this.schema.primaryKeyField);return null!=e?`${e}`:void 0}get presentableAttributes(){return this._presentableAttributes=this._presentableAttributes||new PresentableAttributesImpl(this),this._presentableAttributes}get title(){return this.format(this._title||"")}get description(){return this.format(this._description)}get hyperlinks(){return this._hyperlinks||(this._hyperlinks=new HyperlinksCollection(this))}get relatedFeatures(){return this._relatedFeatures}get type(){if(this.schema.typeIdField&&this.attributes.has(this.schema.typeIdField)){const e=this.attributes.get(this.schema.typeIdField);return this.schema.types.find((t=>t.id===e))}}get _hydrationStatus(){var e,t;return this._featureHydrationStatus?this._featureHydrationStatus:(null===(t=null===(e=this.source)||void 0===e?void 0:e.capabilities)||void 0===t?void 0:t.supportsQuery)&&1===this.attributes.size&&void 0!==this.primaryKey?"dehydrated":"hydrated"}set _hydrationStatus(e){this._featureHydrationStatus=e}get _itemType(){return ItemType.FEATURE}get _title(){let e;return this.settings.popupTemplate&&(e="function"==typeof this.settings.popupTemplate.title?this.settings.popupTemplate.title():this.settings.popupTemplate.title),e||this.schema.displayField&&this.presentableAttributes.get(this.schema.displayField)||""}get _description(){var e;if(null===(e=this.settings.popupTemplate)||void 0===e?void 0:e.content){if("string"==typeof this.settings.popupTemplate.content)return this.settings.popupTemplate.content;if(Array.isArray(this.settings.popupTemplate.content)){const e=this.settings.popupTemplate.content.find((e=>"text"===e.type));if(e)return e.text}}return""}format(e,...t){let r="string"==typeof e?{format:e}:e;checkArg("options",r).isNotMissing();const{format:i}=r;checkArg("format",i).isNotMissing();let s=r.format.replace(escapedBraceRegex,escapedBracePlaceholder);return s=s.replace(fieldTokenRegex,((e,t,i,s,a)=>formatAttribute(this,t||i,s,{...r,format:a?`{0:${a}}`:"{0}"}))),s=s.replace(escapedBracePlaceholderRegex,"{{"),r={...r},r.format=s,formatString(r,...t)}clearExpressionInfos(){this._expressionFieldValues.clear()}async fetchExpressionInfos(e=!1){var t;const{expressionInfos:r}=null!==(t=this.settings.popupTemplate)&&void 0!==t?t:{};if(r)return await Promise.all(r.map((async e=>{var t,r,i,s,a;try{const o=null!==(r=null===(t=this.source)||void 0===t?void 0:t.layer)&&void 0!==r?r:null===(i=this.source)||void 0===i?void 0:i.sublayer;let n=null===(s=this.source)||void 0===s?void 0:s.mapExtension;if(!n){const e=null===(a=this.source)||void 0===a?void 0:a.layerExtension;n=null==e?void 0:e.mapExtension}this._expressionFieldValues.set(e.name,await runAsyncArcadeExpression(e.expression,{layer:o,map:null==n?void 0:n.map,feature:this,spatialReference:this.schema.spatialReference}))}catch(t){t instanceof Error&&log.error({message:"Error evaluating expression '{0}': {1}.",error:t},e.name,t.message),this._expressionFieldValues.set(e.name,invalidRelationshipOrExpression)}}))),e?this.attributes.on("change",(async e=>{this._expressionValuesUpdatePending||(this._expressionValuesUpdatePending=!0,setTimeout((async()=>{this._expressionValuesUpdatePending=!1,await this.fetchExpressionInfos()}),0))})):void 0}async fetchRelatedFeatures(e){if(!this.source)return;let t;if(e){const r="string"==typeof e?this.source.relationships.find((t=>t.id===e)):e;if(!r||!this.source.relationships.includes(r))throw new InvalidOperationError("Relationship not found in feature source.");t=[r]}else t=this.source.relationships.toArray();const r=await promiseMap(t,(async e=>[e,await e.getRelatedFeatures(this)]));for(const e of r)this._relatedFeatures.set(e[0],e[1])}async fetchAttachments(){if(this.source){const e=await this.source.getAttachments(this);for(const t of e){const e=this.attachments.findIndex((e=>e.id===t.id));e>=0?this.attachments.splice(e,1,t):this.attachments.add(t)}}}_getSerializableProperties(){return{...super._getSerializableProperties(),attributes:{serializeModes:["project"],serialize:e=>{var t;const r={};if("project"===e&&this.primaryKey&&(null===(t=this.source)||void 0===t?void 0:t.capabilities).supportsQuery)r[this.schema.primaryKeyField]=this.primaryKey;else for(const[e,t]of this.attributes.entries())r[e]=t;return r},deserialize:e=>{if(this.attributes.clear(),e instanceof Map)e.forEach(((e,t)=>{this.attributes.set(t,e)}));else for(const[t,r]of Object.entries(e))this.attributes.set(t,r)}},geometry:{serializeModes:["project"],serialize:e=>{var t;return"project"===e&&(null===(t=this.source)||void 0===t?void 0:t.capabilities).supportsQuery?this.getDefault("geometry"):toPortalGeometry(this.geometry)},deserialize:e=>this.geometry=toEsriApiGeometry(e)},settings:{serializeModes:["project"],serialize:e=>{var t;return"project"===e&&(null===(t=this.source)||void 0===t?void 0:t.capabilities).supportsQuery?this.getDefault("settings"):this.settings.toJSON(e)}},schema:{serializeModes:["project"],serialize:e=>{var t;return"project"===e&&(null===(t=this.source)||void 0===t?void 0:t.capabilities).supportsQuery?this.getDefault("schema"):this.schema.toJSON(e)}},source:["project"]}}_watchProperty(e,t,r,i){if("title"===e||"description"===e){const s=super._watchProperty(e,t,r,i),a="title"===e?"settings.popupTemplate.title":"settings.popupTemplate.content",o=this.watch(a,(()=>{this._notifyChange(e)})),n=this.presentableAttributes.on("change",(()=>{this._notifyChange(e)}));return{remove(){s.remove(),o.remove(),n.remove()}}}return super._watchProperty(e,t,r,i)}async _onInitialize(){const e=this._findRelationshipIds(this._title,this._description),t=this.source?this.source.relationships.map((e=>e.id)).toArray():[],r=[];for(const i of e)t.includes(i)?r.push(this.fetchRelatedFeatures(i)):log.error("Could not find relationship '{0}' referenced in feature title or description.",i);await Promise.all(r)}_findRelationshipIds(...e){const t=[];for(const r of e){let e;const i=r.replace(escapedBraceRegex,escapedBracePlaceholder);for(;e=relationshipIdRegex.exec(i),null!==e;){const r=e[0];t.includes(r)||t.push(e[1])}}return t}};Feature=__decorate([serializable],Feature);export{Feature};export function toFeature(e,t){const r=new Feature(t);for(const t of Object.keys(e.attributes))r.attributes.set(t,e.attributes[t]);return r.geometry=e.geometry,e.popupTemplate&&(r.settings.popupTemplate=e.popupTemplate),r}export function toGraphic(e){var t,r;const i=new Graphic;i.attributes={};for(const t of e.attributes.keys())i.attributes[t]=e.attributes.get(t);return(null===(t=e.source)||void 0===t?void 0:t.layer)&&(i.layer=null===(r=e.source)||void 0===r?void 0:r.layer),i.geometry=e.geometry,e.settings.popupTemplate&&(i.popupTemplate=e.settings.popupTemplate),i}const ERR_PRESENTABLE_ATTRIBUTES_READONLY="Presentable attributes are read-only.",ERR_HYPERLINK_READONLY="Feature hyperlinks are read-only. Modify the feature's hyperlink templates instead.";class ExpressionFieldsValuesImpl extends ReadOnlyMap{constructor(e,t){super(e),this._feature=t}get(e){var t,r;if(!super.has(e)){const{spatialReference:i}=this._feature.schema,s=null===(r=null===(t=this._feature.settings.popupTemplate)||void 0===t?void 0:t.expressionInfos)||void 0===r?void 0:r.find((t=>t.name===e));if(!s)return;(async()=>{var t,r,a,o,n;try{if(isArcadeScriptAsync(s.expression,i)){const l=null!==(r=null===(t=this._feature.source)||void 0===t?void 0:t.layer)&&void 0!==r?r:null===(a=this._feature.source)||void 0===a?void 0:a.sublayer;let p=null===(o=this._feature.source)||void 0===o?void 0:o.mapExtension;if(!p){const e=null===(n=this._feature.source)||void 0===n?void 0:n.layerExtension;p=null==e?void 0:e.mapExtension}this._originalMap.set(e,await runAsyncArcadeExpression(s.expression,{feature:this._feature,layer:l,map:null==p?void 0:p.map,spatialReference:i}))}else await Arcade.load(),arcadeScriptUsesGeometry(s.expression,i)&&await Arcade.enableGeometrySupport(),this._originalMap.set(e,runArcadeExpression(s.expression,{feature:this._feature,spatialReference:i}))}catch(t){t instanceof Error&&log.error({message:"Error evaluating expression '{0}': {1}.",error:t},e,t.message),this._originalMap.set(e,invalidRelationshipOrExpression)}})()}return super.get(e)}}class PresentableAttributesImpl extends ReadOnlyMap{constructor(e){super(new ObservableMap),this._feature=e}get size(){return this._feature.attributes.size+this._feature.schema.fields._expressionFieldsLength}clear(){throw new InvalidOperationError(ERR_PRESENTABLE_ATTRIBUTES_READONLY)}delete(e){throw new InvalidOperationError(ERR_PRESENTABLE_ATTRIBUTES_READONLY)}forEach(e,t){checkArg("callback",e).isNotMissing();for(const r of this.keys())e.call(t,this.get(r),r,this)}get(e){const t=this._getFieldExtensionFormat(e);return this._formatAttribute(e,t)}has(e){return some(this.keys(),(t=>t===e))}set(...e){throw new InvalidOperationError(ERR_PRESENTABLE_ATTRIBUTES_READONLY)}*entries(){yield*mapIterable(this.keys(),(e=>[e,this.get(e)]))}*keys(){var e;const t=this._feature.schema.fields.expressionFields.map((e=>e.name)),r=[];(null===(e=this._feature.source)||void 0===e?void 0:e.relationships)&&this._feature.source.relationships.filter((e=>"one-to-one"===e.cardinality||"many-to-one"===e.cardinality)).forEach((e=>r.push(...e.relatedSource.schema.fields.map((t=>`relationships/${e.id}/${t.name}`)).toArray()))),yield*concat(this._feature.attributes.keys(),t.toArray(),r)}*values(){yield*mapIterable(this.keys(),(e=>this.get(e)))}[Symbol.iterator](){return this.entries()}toJSON(){return Array.from(this.entries())}on(e,t){if(checkArg("callback",t).isNotMissing(),!this._numObservers){const e=new Map,t=new Set,r=()=>{t.forEach((e=>e.remove())),t.clear()},i=()=>{const t={added:Array.from(this.entries()).filter((t=>t[1]!==e.get(t[0]))),removed:Array.from(e.entries()).filter((e=>!this.has(e[0])||e[1]!==this.get(e[0]))),target:this};(t.added.length||t.removed.length)&&(this.emit("change",t),s())},s=()=>{e.clear(),r(),forEach(this.keys(),(r=>{const s=this._getFieldExtension(r);let a="{0}";if(s){const e=s.watch("format",(()=>{i()}));t.add(e),s.format&&(a=s.format)}e.set(r,this._formatAttribute(r,a))}))};s();const a=this._feature.attributes.on("change",(()=>{i()})),o=this._feature.schema.fieldExtensions.on("change",(()=>{i()})),n=this._feature.settings.formatSettings.watch(["numberFormat","dateFormat","locale"],(()=>{i()})),l=this._feature.expressionFieldValues.on("change",(()=>{i()})),p=this._feature.schema.fields.on("change",(e=>{var t,r;((null===(t=e.added)||void 0===t?void 0:t.some((e=>null!==e.name.match(_fieldWithArcadeXRegex))))||(null===(r=e.removed)||void 0===r?void 0:r.some((e=>null!==e.name.match(_fieldWithArcadeXRegex)))))&&i()})),u=this._feature.settings.watch("popupTemplate",(()=>{i()}));this._onAllObserversRemoved=()=>{l.remove(),a.remove(),o.remove(),p.remove(),n.remove(),u.remove(),e.clear(),r()}}const r=super.on("change",t);return this._numObservers++,{remove:()=>{r.remove(),this._numObservers--,this._numObservers||this._onAllObserversRemoved()}}}watch(e,t){if("size"===e){const e=this._feature.attributes.watch("size",((e,r)=>{t(e+this._feature.schema.fields._expressionFieldsLength,r+this._feature.schema.fields._expressionFieldsLength,"size",this)})),r=this._feature.schema.fields.watch("_expressionFieldsLength",((e,r)=>{t(e+this._feature.attributes.size,r+this._feature.attributes.size,"size",this)}));return{remove:()=>{e.remove(),r.remove()}}}return super.watch(e,t)}_getFieldExtension(e){const t=this._feature.schema.findFieldByName(e);if(t)return this._feature.schema.fieldExtensions.forField(t)}_getFieldExtensionFormat(e){const t=this._getFieldExtension(e);return t?t.format:"{0}"}_formatAttribute(e,t){const r=e.match(_fieldWithArcadeXRegex),i=e.match(_fieldWithRelationshipRegex);if(r)return formatAttribute(this._feature,"expression",r[1],{format:t});if(i){const[,e,r]=i;return formatAttribute(this._feature,e,r,{format:t})}return formatAttribute(this._feature,void 0,e,{format:t})}}const fieldTokenRegex=/\{(?:relationships[\\/](\w\w*)[\\/])?(?:(expression)[\\/])?([a-zA-Z][.\w]*)(?::([^}]*))?\}/g,relationshipIdRegex=/\{relationships\/(\w\w*)[\\/]([^}]*)\}/g,escapedBraceRegex=/{{/g,escapedBracePlaceholder="\0MAGIC\0",escapedBracePlaceholderRegex=new RegExp(escapedBracePlaceholder,"g"),invalidRelationshipOrExpression="#INVALID";class HyperlinksCollection extends MapTransformCollection{constructor(e){super(e.settings.hyperlinkTemplates,(e=>this._getHyperlink(e))),this._feature=e}_getHyperlink(e){return this._hyperlinks=this._hyperlinks||new WeakMap,this._hyperlinks.has(e)||this._hyperlinks.set(e,new FeatureHyperlink(this._feature,e)),this._hyperlinks.get(e)}}let FeatureHyperlink=class extends Hyperlink{constructor(e,t){super(t.toJSON()),this._feature=e,this._template=t}get url(){return this._template.url?this._feature.format(this._template.url):this._template.url}set url(e){throw new InvalidOperationError(ERR_HYPERLINK_READONLY)}get text(){return this._template.text?this._feature.format(this._template.text):this._template.text}set text(e){throw new InvalidOperationError(ERR_HYPERLINK_READONLY)}get iconUrl(){return this._template.iconUrl?this._feature.format(this._template.iconUrl):this._template.iconUrl}set iconUrl(e){throw new InvalidOperationError(ERR_HYPERLINK_READONLY)}get target(){return this._template.target?this._feature.format(this._template.target):this._template.target}set target(e){throw new InvalidOperationError(ERR_HYPERLINK_READONLY)}get tooltip(){return this._template.tooltip?this._feature.format(this._template.tooltip):this._template.tooltip}set tooltip(e){throw new InvalidOperationError(ERR_HYPERLINK_READONLY)}_watchProperty(e,t,r,i){const s=super._watchProperty(e,t,r,i),a=this._template.watch(e,(()=>{this._notifyChange(e)})),o=this._feature.presentableAttributes.on("change",(()=>{this._notifyChange(e)}));return{remove:()=>{s.remove(),a.remove(),o.remove()}}}_getSerializableProperties(){return{}}};function formatAttribute(e,t,r,i={format:"{0}"}){var s,a,o,n;if("expression"!==t){if(t){const s=find(e.relatedFeatures.keys(),(e=>e.id===t));if(!s)return log.debug("Could not resolve related field '{0}/{1}",t,r),invalidRelationshipOrExpression;const a=Array.from(e.relatedFeatures.get(s));return"many-to-one"===s.cardinality||"one-to-one"===s.cardinality?a.length<1?(log.debug("Could not resolve related field '{0}/{1}",t,r),invalidRelationshipOrExpression):formatAttributeValue(a[0],r,i):a.map((e=>formatAttributeValue(e,r,i))).filter((e=>""!==e)).join(",")}return formatAttributeValue(e,r,i)}if(!(null===(a=null===(s=e.settings.popupTemplate)||void 0===s?void 0:s.expressionInfos)||void 0===a?void 0:a.find((e=>e.name===r))))return log.debug("Could not find expression '{0}'.",r),invalidRelationshipOrExpression;try{const t=null!==(n=null!==(o=e.expressionFieldValues.get(r))&&void 0!==o?o:i.defaultExpressionValue)&&void 0!==n?n:"",s=e.schema.findFieldByName(`expression/${r}`);let a=i;if(s){const t=e.schema.fieldExtensions.forField(s);a=formatOptionsForField(e,r,formatOptionsFromSettings(t.formatSettings),a)}return formatValue(e,t,a)}catch(e){if(e instanceof Error)return log.error({message:"Error evaluating expression '{0}': {1}.",error:e},r,e.message),invalidRelationshipOrExpression;throw e}}function formatAttributeValue(e,t,r){var i,s,a,o;let n=e.attributes.get(t);if(null==n)return"";const l=e.schema.findFieldByName(t);let p={format:"{0}"};if(t===e.schema.typeIdField)n=e.type?e.type.name:n;else if((null===(s=null===(i=e.type)||void 0===i?void 0:i.domains)||void 0===s?void 0:s[t])instanceof CodedValueDomain){const r=(null===(o=null===(a=e.type)||void 0===a?void 0:a.domains)||void 0===o?void 0:o[t]).codedValues.find((e=>`${e.code}`==`${n.toString()}`));n=r?r.name:n}else if(l)if(l.domain instanceof CodedValueDomain){const e=l.domain.codedValues.find((e=>`${e.code}`==`${n.toString()}`));e&&(n=e.name)}else{switch(l.type){case"integer":case"small-integer":case"single":case"double":n=parseNumber(n);break;case"date":n=parseDate({timeZone:e.schema.timeZone},n);break;default:n=`${n.toString()}`}p=formatOptionsFromSettings(e.schema.fieldExtensions.forField(l).formatSettings)}return formatValue(e,n,formatOptionsForField(e,t,p,r))}function formatValue(e,t,r){let i=r;if("number"==typeof t||t instanceof Date){i={...formatOptionsFromSettings(e.settings.formatSettings),...r}}return"{0}"===i.format&&"string"==typeof t?t:formatString(i,t)}function formatOptionsFromSettings(e){return{format:"{0}",dateFormat:e.dateFormat,numberFormat:e.numberFormat,currency:e.currency,fractionalDigits:e.fractionalDigits,locale:e.locale,timeZone:e.timeZone}}function formatOptionsForField(e,t,r,i){const{popupTemplate:s}=e.settings,a=(null==s?void 0:s.fieldInfos)?s.fieldInfos.find((e=>e.fieldName===t)):void 0,o=a?a.format:void 0;let n;return o&&(n={format:"{0}",numberFormat:o.digitSeparator?NumberFormat.NUMBER:NumberFormat.FIXED_POINT,dateFormat:esriFormatToGeocortexFormat(o.dateFormat),fractionalDigits:o.places}),{...n,...r,...i}}FeatureHyperlink=__decorate([serializable],FeatureHyperlink);export async function resolveRelatedFeatures(e){const t=groupBy(e,(e=>e.source));await Promise.all(flatten([...t.keys()].map((e=>e.relationships.toArray()))).map((e=>(async e=>{[...(await e.getAllRelatedFeatures(t.get(e.source))).entries()].forEach((([t,r])=>{t.relatedFeatures.set(e,r)}))})(e))))}
1
+ import{__decorate}from"tslib";import Graphic from"@arcgis/core/Graphic";import*as Arcade from"@arcgis/core/arcade/arcade";import{EntityBase}from"../Entity.js";import{Hyperlink}from"../Hyperlink.js";import{InvalidOperationError}from"../InvalidOperationError.js";import{ItemType}from"../ItemType.js";import{toEsriApiGeometry,toPortalGeometry}from"../portal/Geometry.js";import{serializable}from"../support/Serializable.js";import{MapTransformCollection}from"../utilities/MapTransformCollection.js";import{ObservableMap}from"../utilities/ObservableMap.js";import{ReadOnlyMap}from"../utilities/ReadOnlyMap.js";import{arcadeScriptUsesGeometry,isArcadeScriptAsync,runArcadeExpression,runAsyncArcadeExpression}from"../utilities/arcade.js";import{flatten,groupBy}from"../utilities/array.js";import{checkArg}from"../utilities/checkArg.js";import{Collection}from"../utilities/collection.js";import{parse as parseDate,esriFormatToGeocortexFormat}from"../utilities/date.js";import{isCodedValueDomain}from"../utilities/esri.js";import{some,map as mapIterable,concat,forEach,find}from"../utilities/iterable.js";import{getLogger}from"../utilities/log.js";import{parse as parseNumber,NumberFormat}from"../utilities/number.js";import{map as promiseMap}from"../utilities/promise.js";import{format as formatString}from"../utilities/string.js";import{FeatureSettings}from"./FeatureSettings.js";import{_fieldWithArcadeXRegex,_fieldWithRelationshipRegex,Schema}from"./Schema.js";const log=getLogger("geocortex.api.data.Feature");export const SCORE_FIELD="_score";export const SCORE_FIELD_ORIGINAL="_score_original";let Feature=class extends EntityBase{constructor(e){super(e),this._itemType=ItemType.FEATURE,this._expressionFieldValues=new ObservableMap,this._expressionValuesUpdatePending=!1,this.settings=new FeatureSettings,this.settings._setFeature(this),this.schema=new Schema,this.schema._featureSettings=this.settings,this.attachments=new Collection,this.attributes=new ObservableMap,this._relatedFeatures=new ObservableMap,this.expressionFieldValues=new ExpressionFieldsValuesImpl(this._expressionFieldValues,this)}get geometry(){return this._geometry}set geometry(e){var t;this._notifyChange("geometryType"),this._geometry=toEsriApiGeometry(e),this.schema.spatialReference=null===(t=this._geometry)||void 0===t?void 0:t.spatialReference}get geometryType(){return this.geometry?this.geometry.type:void 0}get source(){return this._source}set source(e){this._source&&this.settings.parent===this._source.featureSettings&&(this.settings.parent=void 0),this._source&&this.schema.parent===this._source.schema&&(this.settings.parent=void 0),this._source=e,this.settings.parent||(this.settings.parent=e?e.featureSettings:void 0),this.schema.parent||(this.schema.parent=e?e.schema:void 0)}get primaryKey(){const e=this.attributes.get(this.schema.primaryKeyField);return null!=e?`${e}`:void 0}get presentableAttributes(){return this._presentableAttributes=this._presentableAttributes||new PresentableAttributesImpl(this),this._presentableAttributes}get title(){return this.format(this._title||"")}get description(){return this.format(this._description)}get hyperlinks(){return this._hyperlinks||(this._hyperlinks=new HyperlinksCollection(this))}get relatedFeatures(){return this._relatedFeatures}get type(){if(this.schema.typeIdField&&this.attributes.has(this.schema.typeIdField)){const e=this.attributes.get(this.schema.typeIdField);return this.schema.types.find((t=>t.id===e))}}get _hydrationStatus(){var e,t;return this._featureHydrationStatus?this._featureHydrationStatus:(null===(t=null===(e=this.source)||void 0===e?void 0:e.capabilities)||void 0===t?void 0:t.supportsQuery)&&1===this.attributes.size&&void 0!==this.primaryKey?"dehydrated":"hydrated"}set _hydrationStatus(e){this._featureHydrationStatus=e}get _title(){let e;return this.settings.popupTemplate&&(e="function"==typeof this.settings.popupTemplate.title?this.settings.popupTemplate.title():this.settings.popupTemplate.title),e||this.schema.displayField&&this.presentableAttributes.get(this.schema.displayField)||""}get _description(){var e;if(null===(e=this.settings.popupTemplate)||void 0===e?void 0:e.content){if("string"==typeof this.settings.popupTemplate.content)return this.settings.popupTemplate.content;if(Array.isArray(this.settings.popupTemplate.content)){const e=this.settings.popupTemplate.content.find((e=>"text"===e.type));if(e)return e.text}}return""}format(e,...t){let r="string"==typeof e?{format:e}:e;checkArg("options",r).isNotMissing();const{format:i}=r;checkArg("format",i).isNotMissing();let s=r.format.replace(escapedBraceRegex,escapedBracePlaceholder);return s=s.replace(fieldTokenRegex,((e,t,i,s,a)=>formatAttribute(this,t||i,s,{...r,format:a?`{0:${a}}`:"{0}"}))),s=s.replace(escapedBracePlaceholderRegex,"{{"),r={...r},r.format=s,formatString(r,...t)}clearExpressionInfos(){this._expressionFieldValues.clear()}async fetchExpressionInfos(e=!1){var t;const{expressionInfos:r}=null!==(t=this.settings.popupTemplate)&&void 0!==t?t:{};if(r)return await Promise.all(r.map((async e=>{var t,r,i,s,a;try{const o=null!==(r=null===(t=this.source)||void 0===t?void 0:t.layer)&&void 0!==r?r:null===(i=this.source)||void 0===i?void 0:i.sublayer;let n=null===(s=this.source)||void 0===s?void 0:s.mapExtension;if(!n){const e=null===(a=this.source)||void 0===a?void 0:a.layerExtension;n=null==e?void 0:e.mapExtension}this._expressionFieldValues.set(e.name,await runAsyncArcadeExpression(e.expression,{layer:o,map:null==n?void 0:n.map,feature:this,spatialReference:this.schema.spatialReference}))}catch(t){t instanceof Error&&log.error({message:"Error evaluating expression '{0}': {1}.",error:t},e.name,t.message),this._expressionFieldValues.set(e.name,invalidRelationshipOrExpression)}}))),e?this.attributes.on("change",(async e=>{this._expressionValuesUpdatePending||(this._expressionValuesUpdatePending=!0,setTimeout((async()=>{this._expressionValuesUpdatePending=!1,await this.fetchExpressionInfos()}),0))})):void 0}async fetchRelatedFeatures(e){if(!this.source)return;let t;if(e){const r="string"==typeof e?this.source.relationships.find((t=>t.id===e)):e;if(!r||!this.source.relationships.includes(r))throw new InvalidOperationError("Relationship not found in feature source.");t=[r]}else t=this.source.relationships.toArray();const r=await promiseMap(t,(async e=>[e,await e.getRelatedFeatures(this)]));for(const e of r)this._relatedFeatures.set(e[0],e[1])}async fetchAttachments(){if(this.source){const e=await this.source.getAttachments(this);for(const t of e){const e=this.attachments.findIndex((e=>e.id===t.id));e>=0?this.attachments.splice(e,1,t):this.attachments.add(t)}}}_getSerializableProperties(){return{...super._getSerializableProperties(),attributes:{serializeModes:["project"],serialize:e=>{var t;const r={};if("project"===e&&this.primaryKey&&(null===(t=this.source)||void 0===t?void 0:t.capabilities).supportsQuery)r[this.schema.primaryKeyField]=this.primaryKey;else for(const[e,t]of this.attributes.entries())r[e]=t;return r},deserialize:e=>{if(this.attributes.clear(),e instanceof Map)e.forEach(((e,t)=>{this.attributes.set(t,e)}));else for(const[t,r]of Object.entries(e))this.attributes.set(t,r)}},geometry:{serializeModes:["project"],serialize:e=>{var t;return"project"===e&&(null===(t=this.source)||void 0===t?void 0:t.capabilities).supportsQuery?this.getDefault("geometry"):toPortalGeometry(this.geometry)},deserialize:e=>this.geometry=toEsriApiGeometry(e)},settings:{serializeModes:["project"],serialize:e=>{var t;return"project"===e&&(null===(t=this.source)||void 0===t?void 0:t.capabilities).supportsQuery?this.getDefault("settings"):this.settings.toJSON(e)}},schema:{serializeModes:["project"],serialize:e=>{var t;return"project"===e&&(null===(t=this.source)||void 0===t?void 0:t.capabilities).supportsQuery?this.getDefault("schema"):this.schema.toJSON(e)}},source:["project"]}}_watchProperty(e,t,r,i){if("title"===e||"description"===e){const s=super._watchProperty(e,t,r,i),a="title"===e?"settings.popupTemplate.title":"settings.popupTemplate.content",o=this.watch(a,(()=>{this._notifyChange(e)})),n=this.presentableAttributes.on("change",(()=>{this._notifyChange(e)}));return{remove(){s.remove(),o.remove(),n.remove()}}}return super._watchProperty(e,t,r,i)}async _onInitialize(){const e=this._findRelationshipIds(this._title,this._description),t=this.source?this.source.relationships.map((e=>e.id)).toArray():[],r=[];for(const i of e)t.includes(i)?r.push(this.fetchRelatedFeatures(i)):log.error("Could not find relationship '{0}' referenced in feature title or description.",i);await Promise.all(r)}_findRelationshipIds(...e){const t=[];for(const r of e){let e;const i=r.replace(escapedBraceRegex,escapedBracePlaceholder);for(;e=relationshipIdRegex.exec(i),null!==e;){const r=e[0];t.includes(r)||t.push(e[1])}}return t}};Feature=__decorate([serializable],Feature);export{Feature};export function toFeature(e,t){const r=new Feature(t);for(const t of Object.keys(e.attributes))r.attributes.set(t,e.attributes[t]);return r.geometry=e.geometry,e.popupTemplate&&(r.settings.popupTemplate=e.popupTemplate),r}export function toGraphic(e){var t,r;const i=new Graphic;i.attributes={};for(const t of e.attributes.keys())i.attributes[t]=e.attributes.get(t);return(null===(t=e.source)||void 0===t?void 0:t.layer)&&(i.layer=null===(r=e.source)||void 0===r?void 0:r.layer),i.geometry=e.geometry,e.settings.popupTemplate&&(i.popupTemplate=e.settings.popupTemplate),i}const ERR_PRESENTABLE_ATTRIBUTES_READONLY="Presentable attributes are read-only.",ERR_HYPERLINK_READONLY="Feature hyperlinks are read-only. Modify the feature's hyperlink templates instead.";class ExpressionFieldsValuesImpl extends ReadOnlyMap{constructor(e,t){super(e),this._feature=t}get(e){var t,r;if(!super.has(e)){const{spatialReference:i}=this._feature.schema,s=null===(r=null===(t=this._feature.settings.popupTemplate)||void 0===t?void 0:t.expressionInfos)||void 0===r?void 0:r.find((t=>t.name===e));if(!s)return;(async()=>{var t,r,a,o,n;try{if(isArcadeScriptAsync(s.expression,i)){const l=null!==(r=null===(t=this._feature.source)||void 0===t?void 0:t.layer)&&void 0!==r?r:null===(a=this._feature.source)||void 0===a?void 0:a.sublayer;let p=null===(o=this._feature.source)||void 0===o?void 0:o.mapExtension;if(!p){const e=null===(n=this._feature.source)||void 0===n?void 0:n.layerExtension;p=null==e?void 0:e.mapExtension}this._originalMap.set(e,await runAsyncArcadeExpression(s.expression,{feature:this._feature,layer:l,map:null==p?void 0:p.map,spatialReference:i}))}else await Arcade.load(),arcadeScriptUsesGeometry(s.expression,i)&&await Arcade.enableGeometrySupport(),this._originalMap.set(e,runArcadeExpression(s.expression,{feature:this._feature,spatialReference:i}))}catch(t){t instanceof Error&&log.error({message:"Error evaluating expression '{0}': {1}.",error:t},e,t.message),this._originalMap.set(e,invalidRelationshipOrExpression)}})()}return super.get(e)}}class PresentableAttributesImpl extends ReadOnlyMap{constructor(e){super(new ObservableMap),this._feature=e}get size(){return this._feature.attributes.size+this._feature.schema.fields._expressionFieldsLength}clear(){throw new InvalidOperationError(ERR_PRESENTABLE_ATTRIBUTES_READONLY)}delete(e){throw new InvalidOperationError(ERR_PRESENTABLE_ATTRIBUTES_READONLY)}forEach(e,t){checkArg("callback",e).isNotMissing();for(const r of this.keys())e.call(t,this.get(r),r,this)}get(e){const t=this._getFieldExtensionFormat(e);return this._formatAttribute(e,t)}has(e){return some(this.keys(),(t=>t===e))}set(...e){throw new InvalidOperationError(ERR_PRESENTABLE_ATTRIBUTES_READONLY)}*entries(){yield*mapIterable(this.keys(),(e=>[e,this.get(e)]))}*keys(){var e;const t=this._feature.schema.fields.expressionFields.map((e=>e.name)),r=[];(null===(e=this._feature.source)||void 0===e?void 0:e.relationships)&&this._feature.source.relationships.filter((e=>"one-to-one"===e.cardinality||"many-to-one"===e.cardinality)).forEach((e=>r.push(...e.relatedSource.schema.fields.map((t=>`relationships/${e.id}/${t.name}`)).toArray()))),yield*concat(this._feature.attributes.keys(),t.toArray(),r)}*values(){yield*mapIterable(this.keys(),(e=>this.get(e)))}[Symbol.iterator](){return this.entries()}toJSON(){return Array.from(this.entries())}on(e,t){if(checkArg("callback",t).isNotMissing(),!this._numObservers){const e=new Map,t=new Set,r=()=>{t.forEach((e=>e.remove())),t.clear()},i=()=>{const t={added:Array.from(this.entries()).filter((t=>t[1]!==e.get(t[0]))),removed:Array.from(e.entries()).filter((e=>!this.has(e[0])||e[1]!==this.get(e[0]))),target:this};(t.added.length||t.removed.length)&&(this.emit("change",t),s())},s=()=>{e.clear(),r(),forEach(this.keys(),(r=>{const s=this._getFieldExtension(r);let a="{0}";if(s){const e=s.watch("format",(()=>{i()}));t.add(e),s.format&&(a=s.format)}e.set(r,this._formatAttribute(r,a))}))};s();const a=this._feature.attributes.on("change",(()=>{i()})),o=this._feature.schema.fieldExtensions.on("change",(()=>{i()})),n=this._feature.settings.formatSettings.watch(["numberFormat","dateFormat","locale"],(()=>{i()})),l=this._feature.expressionFieldValues.on("change",(()=>{i()})),p=this._feature.schema.fields.on("change",(e=>{var t,r;((null===(t=e.added)||void 0===t?void 0:t.some((e=>null!==e.name.match(_fieldWithArcadeXRegex))))||(null===(r=e.removed)||void 0===r?void 0:r.some((e=>null!==e.name.match(_fieldWithArcadeXRegex)))))&&i()})),u=this._feature.settings.watch("popupTemplate",(()=>{i()}));this._onAllObserversRemoved=()=>{l.remove(),a.remove(),o.remove(),p.remove(),n.remove(),u.remove(),e.clear(),r()}}const r=super.on("change",t);return this._numObservers++,{remove:()=>{r.remove(),this._numObservers--,this._numObservers||this._onAllObserversRemoved()}}}watch(e,t){if("size"===e){const e=this._feature.attributes.watch("size",((e,r)=>{t(e+this._feature.schema.fields._expressionFieldsLength,r+this._feature.schema.fields._expressionFieldsLength,"size",this)})),r=this._feature.schema.fields.watch("_expressionFieldsLength",((e,r)=>{t(e+this._feature.attributes.size,r+this._feature.attributes.size,"size",this)}));return{remove:()=>{e.remove(),r.remove()}}}return super.watch(e,t)}_getFieldExtension(e){const t=this._feature.schema.findFieldByName(e);if(t)return this._feature.schema.fieldExtensions.forField(t)}_getFieldExtensionFormat(e){const t=this._getFieldExtension(e);return t?t.format:"{0}"}_formatAttribute(e,t){const r=e.match(_fieldWithArcadeXRegex),i=e.match(_fieldWithRelationshipRegex);if(r)return formatAttribute(this._feature,"expression",r[1],{format:t});if(i){const[,e,r]=i;return formatAttribute(this._feature,e,r,{format:t})}return formatAttribute(this._feature,void 0,e,{format:t})}}const fieldTokenRegex=/\{(?:relationships[\\/](\w\w*)[\\/])?(?:(expression)[\\/])?([a-zA-Z][.\w]*)(?::([^}]*))?\}/g,relationshipIdRegex=/\{relationships\/(\w\w*)[\\/]([^}]*)\}/g,escapedBraceRegex=/{{/g,escapedBracePlaceholder="\0MAGIC\0",escapedBracePlaceholderRegex=new RegExp(escapedBracePlaceholder,"g"),invalidRelationshipOrExpression="#INVALID";class HyperlinksCollection extends MapTransformCollection{constructor(e){super(e.settings.hyperlinkTemplates,(e=>this._getHyperlink(e))),this._feature=e}_getHyperlink(e){return this._hyperlinks=this._hyperlinks||new WeakMap,this._hyperlinks.has(e)||this._hyperlinks.set(e,new FeatureHyperlink(this._feature,e)),this._hyperlinks.get(e)}}let FeatureHyperlink=class extends Hyperlink{constructor(e,t){super(t.toJSON()),this._feature=e,this._template=t}get url(){return this._template.url?this._feature.format(this._template.url):this._template.url}set url(e){throw new InvalidOperationError(ERR_HYPERLINK_READONLY)}get text(){return this._template.text?this._feature.format(this._template.text):this._template.text}set text(e){throw new InvalidOperationError(ERR_HYPERLINK_READONLY)}get iconUrl(){return this._template.iconUrl?this._feature.format(this._template.iconUrl):this._template.iconUrl}set iconUrl(e){throw new InvalidOperationError(ERR_HYPERLINK_READONLY)}get target(){return this._template.target?this._feature.format(this._template.target):this._template.target}set target(e){throw new InvalidOperationError(ERR_HYPERLINK_READONLY)}get tooltip(){return this._template.tooltip?this._feature.format(this._template.tooltip):this._template.tooltip}set tooltip(e){throw new InvalidOperationError(ERR_HYPERLINK_READONLY)}_watchProperty(e,t,r,i){const s=super._watchProperty(e,t,r,i),a=this._template.watch(e,(()=>{this._notifyChange(e)})),o=this._feature.presentableAttributes.on("change",(()=>{this._notifyChange(e)}));return{remove:()=>{s.remove(),a.remove(),o.remove()}}}_getSerializableProperties(){return{}}};function formatAttribute(e,t,r,i={format:"{0}"}){var s,a,o,n;if("expression"!==t){if(t){const s=find(e.relatedFeatures.keys(),(e=>e.id===t));if(!s)return log.debug("Could not resolve related field '{0}/{1}",t,r),invalidRelationshipOrExpression;const a=Array.from(e.relatedFeatures.get(s));return"many-to-one"===s.cardinality||"one-to-one"===s.cardinality?a.length<1?(log.debug("Could not resolve related field '{0}/{1}",t,r),invalidRelationshipOrExpression):formatAttributeValue(a[0],r,i):a.map((e=>formatAttributeValue(e,r,i))).filter((e=>""!==e)).join(",")}return formatAttributeValue(e,r,i)}if(!(null===(a=null===(s=e.settings.popupTemplate)||void 0===s?void 0:s.expressionInfos)||void 0===a?void 0:a.find((e=>e.name===r))))return log.debug("Could not find expression '{0}'.",r),invalidRelationshipOrExpression;try{const t=null!==(n=null!==(o=e.expressionFieldValues.get(r))&&void 0!==o?o:i.defaultExpressionValue)&&void 0!==n?n:"",s=e.schema.findFieldByName(`expression/${r}`);let a=i;if(s){const t=e.schema.fieldExtensions.forField(s);a=formatOptionsForField(e,r,formatOptionsFromSettings(t.formatSettings),a)}return formatValue(e,t,a)}catch(e){if(e instanceof Error)return log.error({message:"Error evaluating expression '{0}': {1}.",error:e},r,e.message),invalidRelationshipOrExpression;throw e}}function formatAttributeValue(e,t,r){var i,s;let a=e.attributes.get(t);if(null==a)return"";const o=e.schema.findFieldByName(t);let n={format:"{0}"};const l=null===(s=null===(i=e.type)||void 0===i?void 0:i.domains)||void 0===s?void 0:s[t];if(t===e.schema.typeIdField)a=e.type?e.type.name:a;else if(isCodedValueDomain(l)){const e=l.codedValues.find((e=>`${e.code}`==`${a.toString()}`));a=e?e.name:a}else if(o)if(isCodedValueDomain(o.domain)){const e=o.domain.codedValues.find((e=>`${e.code}`==`${a.toString()}`));e&&(a=e.name)}else{switch(o.type){case"integer":case"small-integer":case"single":case"double":a=parseNumber(a);break;case"date":a=parseDate({timeZone:e.schema.timeZone},a);break;default:a=`${a.toString()}`}n=formatOptionsFromSettings(e.schema.fieldExtensions.forField(o).formatSettings)}return formatValue(e,a,formatOptionsForField(e,t,n,r))}function formatValue(e,t,r){let i=r;if("number"==typeof t||t instanceof Date){i={...formatOptionsFromSettings(e.settings.formatSettings),...r}}return"{0}"===i.format&&"string"==typeof t?t:formatString(i,t)}function formatOptionsFromSettings(e){return{format:"{0}",dateFormat:e.dateFormat,numberFormat:e.numberFormat,currency:e.currency,fractionalDigits:e.fractionalDigits,locale:e.locale,timeZone:e.timeZone}}function formatOptionsForField(e,t,r,i){const{popupTemplate:s}=e.settings,a=(null==s?void 0:s.fieldInfos)?s.fieldInfos.find((e=>e.fieldName===t)):void 0,o=a?a.format:void 0;let n;return o&&(n={format:"{0}",numberFormat:o.digitSeparator?NumberFormat.NUMBER:NumberFormat.FIXED_POINT,dateFormat:esriFormatToGeocortexFormat(o.dateFormat),fractionalDigits:o.places}),{...n,...r,...i}}FeatureHyperlink=__decorate([serializable],FeatureHyperlink);export async function resolveRelatedFeatures(e){const t=groupBy(e,(e=>e.source));await Promise.all(flatten([...t.keys()].map((e=>e.relationships.toArray()))).map((e=>(async e=>{[...(await e.getAllRelatedFeatures(t.get(e.source))).entries()].forEach((([t,r])=>{t.relatedFeatures.set(e,r)}))})(e))))}
@@ -82,6 +82,10 @@ export declare class FeatureList extends ReadOnlyCollection<Feature> implements
82
82
  readonly featureSet: FeatureSet;
83
83
  private _sortFunc;
84
84
  private _filterFunc;
85
+ /**
86
+ * @inheritdoc
87
+ */
88
+ get itemType(): string;
85
89
  constructor(featureSet: FeatureSet);
86
90
  constructor(properties?: FeatureListProperties);
87
91
  /**
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import CodedValueDomain from"@arcgis/core/layers/support/CodedValueDomain";import Field from"@arcgis/core/layers/support/Field";import{ArgumentError}from"../ArgumentError.js";import{generateId}from"../Entity.js";import{ItemType}from"../ItemType.js";import{assignProperties,filterJSONProperties,getDefaults,getSerializableProperties,serializable}from"../support/Serializable.js";import{getSearchableValue}from"../tasks/search/_utilities.js";import{ReadOnlyCollection}from"../utilities/ReadOnlyCollection.js";import{Collection}from"../utilities/collection.js";import{parse as parseDate}from"../utilities/date.js";import{parse as parseNumber}from"../utilities/number.js";import{escapeRegExp}from"../utilities/string.js";import{FeatureSet}from"./FeatureSet.js";let FeatureList=class extends ReadOnlyCollection{constructor(e){var t;if(super(new Collection),this.id=null!==(t=null==e?void 0:e.id)&&void 0!==t?t:generateId(),e instanceof FeatureSet)this.featureSet=e;else if(e){const t=e;Array.isArray(t.featureSet)?this.featureSet=new FeatureSet({features:t.featureSet}):t.featureSet instanceof FeatureSet?this.featureSet=t.featureSet:this.featureSet=new FeatureSet(t.featureSet)}else this.featureSet=new FeatureSet;for(const e of this.featureSet)this._collection.add(e);this.featureSet.on("change",(e=>this._onFeatureSetChange(e)))}toItemUri(){return`item://${encodeURIComponent(ItemType.FEATURE_LIST)}/${encodeURIComponent(this.id)}`}assignProperties(e){assignProperties(this._getSerializableProperties(),this,e)}toJSON(e="all"){return filterJSONProperties(this._getSerializableProperties(),this,e)}getDefaults(){return getDefaults(this._getSerializableProperties())}getDefault(e){return this.getDefaults()[e]}sort(e){if("function"==typeof e)this._sortFunc=e;else if(Array.isArray(e))this._sortFunc=this._createSortFunc(e);else if("object"==typeof e&&e.field)this._sortFunc=this._createSortFunc([e]);else{if("string"!=typeof e)throw new ArgumentError("criteria","Invalid sort criteria.");this._sortFunc=this._createSortFunc([{field:e}])}this._sortFunc=this._stabilizeSortFunc(this._sortFunc),this._sort(this._sortFunc),this.emit("change",{moved:this._collection.toArray(),target:this})}applyFilter(e){if(e)if("function"==typeof e)this._filterFunc=e;else if(Array.isArray(e))this._filterFunc=this._createFilterFunc(e);else if("object"==typeof e&&e.field)this._filterFunc=this._createFilterFunc([e]);else{if("string"!=typeof e)throw new ArgumentError("criteria","Invalid filter criteria.");{const t=this.featureSet.schema.fieldExtensions.initializedItems.filter((e=>e.searchable)).map((t=>({field:t.field.name,match:e}))).toArray();this._filterFunc=this._createFilterFunc(t)}}else delete this._filterFunc;const t=new Set,i=[],r=[];let s=0;for(;s<this._collection.length;){const e=this._collection.getItemAt(s);this._filterFunc&&!this._filterFunc(e)?(i.push(e),this._collection.removeAt(s)):(t.add(e),s++)}for(const e of this.featureSet)t.has(e)||this._filterFunc&&!this._filterFunc(e)||(this._collection.add(e),r.push(e));this._sortFunc&&r.length&&(r.length<=10?this._insertionSort(this._sortFunc):this._sort(this._sortFunc)),(r.length||i.length)&&this.emit("change",{added:r,removed:i,target:this})}removeFilter(){this.applyFilter(void 0)}getSerializableProperties(e="all"){return getSerializableProperties(this._getSerializableProperties(),e)}_getSerializableProperties(){return{featureSet:{serializeModes:["project"],deserialize:e=>{e instanceof FeatureSet?this.featureSet.assignProperties({title:e.title,features:[...e]}):Array.isArray(e)?this.featureSet.assignProperties({features:e}):this.featureSet.assignProperties(e)}},title:["project"]}}_onFeatureSetChange(e){var t,i;if((null===(t=e.removed)||void 0===t?void 0:t.length)&&this._collection.removeMany(e.removed),null===(i=e.added)||void 0===i?void 0:i.length){const t=this._filterFunc?e.added.filter(this._filterFunc):e.added;t.length&&(this._collection.addMany(t),this._sortFunc&&(t.length<=10?this._insertionSort(this._sortFunc):this._sort(this._sortFunc)))}}_createSortFunc(e){return(t,i)=>{for(let r of e){if("string"==typeof r&&(r={field:r}),!r.field)throw new ArgumentError("criteria","Invalid sort criteria.");const e=this._getField(r.field),s=this._getSortValue(t,e),o=this._getSortValue(i,e);let n="string"==typeof s?s.localeCompare(o):s-o;if("desc"===r.direction&&(n*=-1),0!==n)return n}return 0}}_stabilizeSortFunc(e){return(t,i)=>{const r=e(t,i);return 0===r?this._collection.indexOf(t)-this._collection.indexOf(i):r}}_createFilterFunc(e){const t=new Map;for(const i of e){if(!i.field)throw new ArgumentError("criteria","Invalid sort criteria.");if(!i.match)continue;const e=this._getField(i.field),r=this._getFilterRegex(i.match,e);t.set(e.name,r)}return t.size?e=>{var i,r;for(const s of t.keys()){const o=this._getField(s),n=getSearchableValue(e,o),a=t.get(s);let l=a[0];if(a.length>1&&"string"!==o.type&&(null===(r=null===(i=e.type)||void 0===i?void 0:i.domains)||void 0===r?void 0:r[o.name])instanceof CodedValueDomain&&(l=a[1]),l.exec(n))return!0}return!1}:()=>!0}_getSortValue(e,t){var i,r;if((null===(r=null===(i=e.type)||void 0===i?void 0:i.domains)||void 0===r?void 0:r[t.name])instanceof CodedValueDomain||t.domain instanceof CodedValueDomain)return e.presentableAttributes.get(t.name);switch(t.type){case"integer":case"small-integer":case"double":case"single":case"oid":{const i=e.attributes.get(t.name);return null==i||isNaN(i)?Number.MIN_VALUE:parseNumber(i)}case"date":{const i=parseDate(e.attributes.get(t.name)).getTime();return isNaN(i)?0:i}default:{const i=e.presentableAttributes.get(t.name);return null!=i?i:""}}}_getFilterRegex(e,t){if(t.domain&&"coded-value"===t.domain.type)return[new RegExp(`${escapeRegExp(e)}`,"i")];switch(t.type){case"integer":case"small-integer":case"double":case"single":case"oid":{const i=new RegExp(`(^|${SEPARATOR})${escapeRegExp(e)}`,"i");return this.featureSet.schema.types.some((e=>{var i;return(null===(i=e.domains)||void 0===i?void 0:i[t.name])instanceof CodedValueDomain}))?[i,new RegExp(`${escapeRegExp(e)}`,"i")]:[i]}default:return[new RegExp(`${escapeRegExp(e)}`,"i")]}}_getField(e){let t=this.featureSet.schema.findFieldByName(e);return t||(t=new Field({name:e,type:this._inferFieldType(e),editable:!1}),this.featureSet.schema.fields.add(t)),t}_inferFieldType(e){for(const t of this.featureSet.values()){const i=t.attributes.get(e);if(null!=i)return"number"==typeof i?"double":i instanceof Date?"date":"string"}return"string"}_sort(e){this._collection._items.sort(e)}_insertionSort(e){const t=this._collection._items;for(let i=1;i<this.length;i++){const r=t[i];let s=i-1;for(;s>=0&&e(t[s],r)>0;)t[s+1]=t[s],s--;t[s+1]=r}}};FeatureList=__decorate([serializable],FeatureList);export{FeatureList};const SEPARATOR="\t";
1
+ import{__decorate}from"tslib";import Field from"@arcgis/core/layers/support/Field";import{ArgumentError}from"../ArgumentError.js";import{generateId}from"../Entity.js";import{isFeatureSet,ItemType}from"../ItemType.js";import{assignProperties,filterJSONProperties,getDefaults,getSerializableProperties,serializable}from"../support/Serializable.js";import{getSearchableValue}from"../tasks/search/_utilities.js";import{ReadOnlyCollection}from"../utilities/ReadOnlyCollection.js";import{Collection}from"../utilities/collection.js";import{parse as parseDate}from"../utilities/date.js";import{isCodedValueDomain}from"../utilities/esri.js";import{parse as parseNumber}from"../utilities/number.js";import{escapeRegExp}from"../utilities/string.js";import{FeatureSet}from"./FeatureSet.js";let FeatureList=class extends ReadOnlyCollection{constructor(e){var t;if(super(new Collection),this.id=null!==(t=null==e?void 0:e.id)&&void 0!==t?t:generateId(),isFeatureSet(e))this.featureSet=e;else if(e){const t=e;Array.isArray(t.featureSet)?this.featureSet=new FeatureSet({features:t.featureSet}):isFeatureSet(t.featureSet)?this.featureSet=t.featureSet:this.featureSet=new FeatureSet(t.featureSet)}else this.featureSet=new FeatureSet;for(const e of this.featureSet)this._collection.add(e);this.featureSet.on("change",(e=>this._onFeatureSetChange(e)))}get itemType(){return ItemType.FEATURE_LIST}toItemUri(){return`item://${encodeURIComponent(ItemType.FEATURE_LIST)}/${encodeURIComponent(this.id)}`}assignProperties(e){assignProperties(this._getSerializableProperties(),this,e)}toJSON(e="all"){return filterJSONProperties(this._getSerializableProperties(),this,e)}getDefaults(){return getDefaults(this._getSerializableProperties())}getDefault(e){return this.getDefaults()[e]}sort(e){if("function"==typeof e)this._sortFunc=e;else if(Array.isArray(e))this._sortFunc=this._createSortFunc(e);else if("object"==typeof e&&e.field)this._sortFunc=this._createSortFunc([e]);else{if("string"!=typeof e)throw new ArgumentError("criteria","Invalid sort criteria.");this._sortFunc=this._createSortFunc([{field:e}])}this._sortFunc=this._stabilizeSortFunc(this._sortFunc),this._sort(this._sortFunc),this.emit("change",{moved:this._collection.toArray(),target:this})}applyFilter(e){if(e)if("function"==typeof e)this._filterFunc=e;else if(Array.isArray(e))this._filterFunc=this._createFilterFunc(e);else if("object"==typeof e&&e.field)this._filterFunc=this._createFilterFunc([e]);else{if("string"!=typeof e)throw new ArgumentError("criteria","Invalid filter criteria.");{const t=this.featureSet.schema.fieldExtensions.initializedItems.filter((e=>e.searchable)).map((t=>({field:t.field.name,match:e}))).toArray();this._filterFunc=this._createFilterFunc(t)}}else delete this._filterFunc;const t=new Set,i=[],r=[];let s=0;for(;s<this._collection.length;){const e=this._collection.getItemAt(s);this._filterFunc&&!this._filterFunc(e)?(i.push(e),this._collection.removeAt(s)):(t.add(e),s++)}for(const e of this.featureSet)t.has(e)||this._filterFunc&&!this._filterFunc(e)||(this._collection.add(e),r.push(e));this._sortFunc&&r.length&&(r.length<=10?this._insertionSort(this._sortFunc):this._sort(this._sortFunc)),(r.length||i.length)&&this.emit("change",{added:r,removed:i,target:this})}removeFilter(){this.applyFilter(void 0)}getSerializableProperties(e="all"){return getSerializableProperties(this._getSerializableProperties(),e)}_getSerializableProperties(){return{featureSet:{serializeModes:["project"],deserialize:e=>{isFeatureSet(e)?this.featureSet.assignProperties({title:e.title,features:[...e]}):Array.isArray(e)?this.featureSet.assignProperties({features:e}):this.featureSet.assignProperties(e)}},title:["project"]}}_onFeatureSetChange(e){var t,i;if((null===(t=e.removed)||void 0===t?void 0:t.length)&&this._collection.removeMany(e.removed),null===(i=e.added)||void 0===i?void 0:i.length){const t=this._filterFunc?e.added.filter(this._filterFunc):e.added;t.length&&(this._collection.addMany(t),this._sortFunc&&(t.length<=10?this._insertionSort(this._sortFunc):this._sort(this._sortFunc)))}}_createSortFunc(e){return(t,i)=>{for(let r of e){if("string"==typeof r&&(r={field:r}),!r.field)throw new ArgumentError("criteria","Invalid sort criteria.");const e=this._getField(r.field),s=this._getSortValue(t,e),o=this._getSortValue(i,e);let a="string"==typeof s?s.localeCompare(o):s-o;if("desc"===r.direction&&(a*=-1),0!==a)return a}return 0}}_stabilizeSortFunc(e){return(t,i)=>{const r=e(t,i);return 0===r?this._collection.indexOf(t)-this._collection.indexOf(i):r}}_createFilterFunc(e){const t=new Map;for(const i of e){if(!i.field)throw new ArgumentError("criteria","Invalid sort criteria.");if(!i.match)continue;const e=this._getField(i.field),r=this._getFilterRegex(i.match,e);t.set(e.name,r)}return t.size?e=>{var i,r;for(const s of t.keys()){const o=this._getField(s),a=getSearchableValue(e,o),n=t.get(s);let l=n[0];if(n.length>1&&"string"!==o.type&&isCodedValueDomain(null===(r=null===(i=e.type)||void 0===i?void 0:i.domains)||void 0===r?void 0:r[o.name])&&(l=n[1]),l.exec(a))return!0}return!1}:()=>!0}_getSortValue(e,t){var i,r;if(isCodedValueDomain(null===(r=null===(i=e.type)||void 0===i?void 0:i.domains)||void 0===r?void 0:r[t.name])||isCodedValueDomain(t.domain))return e.presentableAttributes.get(t.name);switch(t.type){case"integer":case"small-integer":case"double":case"single":case"oid":{const i=e.attributes.get(t.name);return null==i||isNaN(i)?Number.MIN_VALUE:parseNumber(i)}case"date":{const i=parseDate(e.attributes.get(t.name)).getTime();return isNaN(i)?0:i}default:{const i=e.presentableAttributes.get(t.name);return null!=i?i:""}}}_getFilterRegex(e,t){if(t.domain&&"coded-value"===t.domain.type)return[new RegExp(`${escapeRegExp(e)}`,"i")];switch(t.type){case"integer":case"small-integer":case"double":case"single":case"oid":{const i=new RegExp(`(^|${SEPARATOR})${escapeRegExp(e)}`,"i");return this.featureSet.schema.types.some((e=>{var i;return isCodedValueDomain(null===(i=e.domains)||void 0===i?void 0:i[t.name])}))?[i,new RegExp(`${escapeRegExp(e)}`,"i")]:[i]}default:return[new RegExp(`${escapeRegExp(e)}`,"i")]}}_getField(e){let t=this.featureSet.schema.findFieldByName(e);return t||(t=new Field({name:e,type:this._inferFieldType(e),editable:!1}),this.featureSet.schema.fields.add(t)),t}_inferFieldType(e){for(const t of this.featureSet.values()){const i=t.attributes.get(e);if(null!=i)return"number"==typeof i?"double":i instanceof Date?"date":"string"}return"string"}_sort(e){this._collection._items.sort(e)}_insertionSort(e){const t=this._collection._items;for(let i=1;i<this.length;i++){const r=t[i];let s=i-1;for(;s>=0&&e(t[s],r)>0;)t[s+1]=t[s],s--;t[s+1]=r}}};FeatureList=__decorate([serializable],FeatureList);export{FeatureList};const SEPARATOR="\t";
@@ -56,6 +56,10 @@ export declare class FeatureSet extends ObservableSet<Feature> implements Entity
56
56
  * Metadata about features such as fields, domains, and geometry type.
57
57
  */
58
58
  readonly schema: Schema;
59
+ /**
60
+ * @inheritdoc
61
+ */
62
+ get itemType(): string;
59
63
  private _source;
60
64
  private _rehydratingFeatureCount;
61
65
  private readonly _rehydratingFeatures;
@@ -1 +1 @@
1
- var FeatureSet_1;import{__decorate}from"tslib";import Collection from"@arcgis/core/core/Collection";import{generateId}from"../Entity.js";import{ItemType}from"../ItemType.js";import{assignProperties,filterJSONProperties,getDefaults,getSerializableProperties,serializable}from"../support/Serializable.js";import{ObservableSet}from"../utilities/ObservableSet.js";import{groupBy}from"../utilities/array.js";import{toArray,from,empty}from"../utilities/asyncIterable.js";import{compare}from"../utilities/iterable.js";import{getLogger}from"../utilities/log.js";import{find}from"../utilities/set.js";import{watchEach}from"../utilities/watch.js";import{Feature}from"./Feature.js";import{FeatureSettings}from"./FeatureSettings.js";import{Schema}from"./Schema.js";const log=getLogger("feature-set");let FeatureSet=FeatureSet_1=class extends ObservableSet{constructor(e){var t;super(),this.settings=new FeatureSettings,this.schema=new Schema,this._rehydratingFeatureCount=0,this._rehydratingFeatures=new Collection,this.schema._featureSettings=this.settings,this.id=null!==(t=null==e?void 0:e.id)&&void 0!==t?t:generateId(),this._originalSet=new Set,watchEach(this._rehydratingFeatures,"_featureHydrationStatus",((e,t,r,i)=>{if(this._rehydratingFeatureCount--,!this._rehydratingFeatureCount){const e=this._rehydratingFeatures.toArray();this.addMany(e),this.emit("feature-hydration-complete",e)}})),this.on("dehydrated-features-added",(async e=>{this._rehydratingFeatures.addMany(e);const t=groupBy(e,(e=>e.source)),r=groupBy(await toArray(from([...t.entries()].map((([e,t])=>{var r,i;let s;try{s=null!==(r=null==e?void 0:e.getFeatures(t.map((e=>e.primaryKey)).filter((e=>!!e))))&&void 0!==r?r:empty()}catch(t){s=empty(),log.error(`Failed to hydrate features from source '${null!==(i=null==e?void 0:e.title)&&void 0!==i?i:null==e?void 0:e.id}': ${t}`)}return s})))),(e=>e.source));[...t.entries()].forEach((([e,t])=>{const i=r.get(e);t.forEach((e=>{const t=null==i?void 0:i.find((t=>t.primaryKey===e.primaryKey));t&&(e.geometry=t.geometry,[...t.attributes.entries()].forEach((([t,r])=>{e.attributes.set(t,r)}))),e._hydrationStatus=void 0}))}))})),this.assignProperties(e)}get source(){return this._source}set source(e){this._source&&this.settings.parent===this._source.featureSettings&&(this.settings.parent=void 0),this._source&&this.schema.parent===this._source.schema&&(this.settings.parent=void 0),this._source=e,this.settings.parent||(this.settings.parent=e?e.featureSettings:void 0),this.schema.parent||(this.schema.parent=e?e.schema:void 0)}static async fromFeatureStream(e,t){const r=new FeatureSet_1(t);for await(const t of e)r.add(t);return r}on(e,t){return super.on(e,t)}assignProperties(e){assignProperties(this._getSerializableProperties(),this,e)}toJSON(e="all"){return filterJSONProperties(this._getSerializableProperties(),this,e)}toItemUri(){return`item://${encodeURIComponent(ItemType.FEATURE_SET)}/${encodeURIComponent(this.id)}`}add(e){return super.add(e),this.source&&!e.source&&(e.source=this.source),e.schema.parent||(e.schema.parent=this.schema),e.settings.parent||(e.settings.parent=this.settings),this}delete(e){const t=super.delete(e);return t&&(e.schema.parent===this.schema&&(e.schema.parent=void 0),e.settings.parent===this.settings&&(e.settings.parent=void 0)),t}findById(e){return find(this,(t=>t.id===e))}findByPrimaryKey(e){return find(this,(t=>t.primaryKey===e))}getSerializableProperties(e="all"){return getSerializableProperties(this._getSerializableProperties(),e)}getDefaults(){return getDefaults(this._getSerializableProperties())}getDefault(e){return this.getDefaults()[e]}_getSerializableProperties(){return{id:["project"],features:{serializeModes:["project"],serialize:()=>[...this],deserialize:e=>{const t=[],r=[];compare(this,e,{onNew:e=>{if(e instanceof Feature)"dehydrated"===e._hydrationStatus?(e._hydrationStatus="rehydrating",this._rehydratingFeatureCount++,t.push(e)):"rehydrating"===e._hydrationStatus?(this._rehydratingFeatureCount++,this._rehydratingFeatures.push(e)):(r.push(e),this.add(e));else{const t=new Feature(e);r.push(t),this.add(t)}},onMatch:(e,r)=>{r instanceof Feature?"dehydrated"===e._hydrationStatus&&(e._hydrationStatus="rehydrating",this._rehydratingFeatureCount++,t.push(e)):e.assignProperties(r)},onMissing:e=>{this.delete(e)},equals:(e,t)=>t instanceof Feature?t===e:e.id===t.id}),t.length?this.emit("dehydrated-features-added",t):this._rehydratingFeatureCount||this.emit("feature-hydration-complete",r)}},title:["project"],source:[],schema:[],settings:[]}}};FeatureSet=FeatureSet_1=__decorate([serializable],FeatureSet);export{FeatureSet};
1
+ var FeatureSet_1;import{__decorate}from"tslib";import Collection from"@arcgis/core/core/Collection";import{generateId}from"../Entity.js";import{isFeature,ItemType}from"../ItemType.js";import{assignProperties,filterJSONProperties,getDefaults,getSerializableProperties,serializable}from"../support/Serializable.js";import{ObservableSet}from"../utilities/ObservableSet.js";import{groupBy}from"../utilities/array.js";import{toArray,from,empty}from"../utilities/asyncIterable.js";import{compare}from"../utilities/iterable.js";import{getLogger}from"../utilities/log.js";import{find}from"../utilities/set.js";import{watchEach}from"../utilities/watch.js";import{Feature}from"./Feature.js";import{FeatureSettings}from"./FeatureSettings.js";import{Schema}from"./Schema.js";const log=getLogger("feature-set");let FeatureSet=FeatureSet_1=class extends ObservableSet{constructor(e){var t;super(),this.settings=new FeatureSettings,this.schema=new Schema,this._rehydratingFeatureCount=0,this._rehydratingFeatures=new Collection,this.schema._featureSettings=this.settings,this.id=null!==(t=null==e?void 0:e.id)&&void 0!==t?t:generateId(),this._originalSet=new Set,watchEach(this._rehydratingFeatures,"_featureHydrationStatus",((e,t,r,i)=>{if(this._rehydratingFeatureCount--,!this._rehydratingFeatureCount){const e=this._rehydratingFeatures.toArray();this.addMany(e),this.emit("feature-hydration-complete",e)}})),this.on("dehydrated-features-added",(async e=>{this._rehydratingFeatures.addMany(e);const t=groupBy(e,(e=>e.source)),r=groupBy(await toArray(from([...t.entries()].map((([e,t])=>{var r,i;let s;try{s=null!==(r=null==e?void 0:e.getFeatures(t.map((e=>e.primaryKey)).filter((e=>!!e))))&&void 0!==r?r:empty()}catch(t){s=empty(),log.error(`Failed to hydrate features from source '${null!==(i=null==e?void 0:e.title)&&void 0!==i?i:null==e?void 0:e.id}': ${t}`)}return s})))),(e=>e.source));[...t.entries()].forEach((([e,t])=>{const i=r.get(e);t.forEach((e=>{const t=null==i?void 0:i.find((t=>t.primaryKey===e.primaryKey));t&&(e.geometry=t.geometry,[...t.attributes.entries()].forEach((([t,r])=>{e.attributes.set(t,r)}))),e._hydrationStatus=void 0}))}))})),this.assignProperties(e)}get source(){return this._source}set source(e){this._source&&this.settings.parent===this._source.featureSettings&&(this.settings.parent=void 0),this._source&&this.schema.parent===this._source.schema&&(this.settings.parent=void 0),this._source=e,this.settings.parent||(this.settings.parent=e?e.featureSettings:void 0),this.schema.parent||(this.schema.parent=e?e.schema:void 0)}get itemType(){return ItemType.FEATURE_SET}static async fromFeatureStream(e,t){const r=new FeatureSet_1(t);for await(const t of e)r.add(t);return r}on(e,t){return super.on(e,t)}assignProperties(e){assignProperties(this._getSerializableProperties(),this,e)}toJSON(e="all"){return filterJSONProperties(this._getSerializableProperties(),this,e)}toItemUri(){return`item://${encodeURIComponent(ItemType.FEATURE_SET)}/${encodeURIComponent(this.id)}`}add(e){return super.add(e),this.source&&!e.source&&(e.source=this.source),e.schema.parent||(e.schema.parent=this.schema),e.settings.parent||(e.settings.parent=this.settings),this}delete(e){const t=super.delete(e);return t&&(e.schema.parent===this.schema&&(e.schema.parent=void 0),e.settings.parent===this.settings&&(e.settings.parent=void 0)),t}findById(e){return find(this,(t=>t.id===e))}findByPrimaryKey(e){return find(this,(t=>t.primaryKey===e))}getSerializableProperties(e="all"){return getSerializableProperties(this._getSerializableProperties(),e)}getDefaults(){return getDefaults(this._getSerializableProperties())}getDefault(e){return this.getDefaults()[e]}_getSerializableProperties(){return{id:["project"],features:{serializeModes:["project"],serialize:()=>[...this],deserialize:e=>{const t=[],r=[];compare(this,e,{onNew:e=>{if(isFeature(e))"dehydrated"===e._hydrationStatus?(e._hydrationStatus="rehydrating",this._rehydratingFeatureCount++,t.push(e)):"rehydrating"===e._hydrationStatus?(this._rehydratingFeatureCount++,this._rehydratingFeatures.push(e)):(r.push(e),this.add(e));else{const t=new Feature(e);r.push(t),this.add(t)}},onMatch:(e,r)=>{isFeature(r)?"dehydrated"===e._hydrationStatus&&(e._hydrationStatus="rehydrating",this._rehydratingFeatureCount++,t.push(e)):e.assignProperties(r)},onMissing:e=>{this.delete(e)},equals:(e,t)=>isFeature(t)?t===e:e.id===t.id}),t.length?this.emit("dehydrated-features-added",t):this._rehydratingFeatureCount||this.emit("feature-hydration-complete",r)}},title:["project"],source:[],schema:[],settings:[]}}};FeatureSet=FeatureSet_1=__decorate([serializable],FeatureSet);export{FeatureSet};
@@ -1,4 +1,4 @@
1
- import PopupTemplate from "@arcgis/core/PopupTemplate";
1
+ import type PopupTemplate from "@arcgis/core/PopupTemplate";
2
2
  import type SpatialReference from "@arcgis/core/geometry/SpatialReference";
3
3
  import { Hyperlink, HyperlinkProperties } from "../Hyperlink.js";
4
4
  import { PopupInfo as PopupInfoJson } from "../portal/PopupInfo.js";
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import PopupTemplate from"@arcgis/core/PopupTemplate";import{Hyperlink}from"../Hyperlink.js";import{PopupInfo as PopupInfoJson}from"../portal/PopupInfo.js";import{FormatSettings}from"../support/FormatSettings.js";import{serializable}from"../support/Serializable.js";import{Settings}from"../support/Settings.js";import{QueryBasedRelationship}from"../tasks/query/QueryBasedRelationship.js";import{getAllFieldInfos,getAllReferencedFieldNames}from"../utilities/esri.js";import{_fieldWithArcadeXRegex,_fieldWithRelationshipRegex}from"./Schema.js";let FeatureSettings=class extends Settings{get hyperlinkTemplates(){return this._getCollectionSetting("hyperlinkTemplates")}get popupTemplate(){return this._getSetting("popupTemplate")}set popupTemplate(e){this._setSetting("popupTemplate",e instanceof Object&&!(e instanceof PopupTemplate)?PopupInfoJson.toEsriApiPopupTemplate(e):e)}get formatSettings(){return this._getNestedSettings("formatSettings",(()=>new FormatSettings))}get returnGeometry(){return this._getSetting("returnGeometry",!0)}set returnGeometry(e){this._setSetting("returnGeometry",e)}get outFields(){return this._getSetting("outFields",this._defaultOutFields)}set outFields(e){this._setSetting("outFields",e)}get outSpatialReference(){return this._getSetting("outSpatialReference")}set outSpatialReference(e){this._setSetting("outSpatialReference",e)}get maxAllowableOffset(){return this._getSetting("maxAllowableOffset")}set maxAllowableOffset(e){this._setSetting("maxAllowableOffset",e)}get zoomScale(){return this._getSetting("zoomScale")}set zoomScale(e){this._setSetting("zoomScale",e)}get zoomFactor(){var e;const t=this._feature?this._feature.schema:null===(e=this._featureSource)||void 0===e?void 0:e.schema,i=t&&"point"===t.geometryType?void 0:1.5;return this._getSetting("zoomFactor",i)}set zoomFactor(e){this._setSetting("zoomFactor",e)}get featureSource(){return this._featureSource}get feature(){return this._feature}get _defaultOutFields(){var e,t;const i=getAllFieldInfos(this.popupTemplate),r=null===(t=null===(e=this.featureSource)||void 0===e?void 0:e.schema)||void 0===t?void 0:t.primaryKeyField;if(i&&r){const e=new Set;e.add(r);const t=this.featureSource.schema.fields.toArray().map((e=>e.name)),s=getAllReferencedFieldNames(this.popupTemplate),o=i.filter((e=>e.visible)).map((e=>e.fieldName)).concat(...s).filter((e=>t.includes(e)));return this._featureSource.relationships.forEach((e=>{e instanceof QueryBasedRelationship&&o.push(e.keyField)})),o.filter((e=>!(e.match(_fieldWithArcadeXRegex)||e.match(_fieldWithRelationshipRegex)))).forEach((t=>e.add(t))),Array.from(e.values())}return["*"]}_setFeatureSource(e){this._featureSource=e,this.notifyChange("featureSource")}_setFeature(e){this._feature=e,this.notifyChange("feature")}_getSerializableProperties(){return{hyperlinkTemplates:{serializeModes:["initial"],deserialize:e=>{e.forEach((e=>{this.hyperlinkTemplates.find((t=>this._hyperlinksAreEquivalent(t,e)))||this.hyperlinkTemplates.add(e instanceof Hyperlink?e:new Hyperlink(e))})),this.hyperlinkTemplates.toArray().forEach((t=>{const i=this.hyperlinkTemplates.indexOf(t),r=e.findIndex((e=>this._hyperlinksAreEquivalent(e,t)));r<0?this.hyperlinkTemplates.removeAt(i):r!==i&&this.hyperlinkTemplates.reorder(t,r)}))}},popupTemplate:{serialize:!1},formatSettings:"initial",outFields:{serializeModes:["initial"],serialize:()=>this.isModified("outFields")?this.outFields:void 0},returnGeometry:{serializeModes:["initial"],default:!0},outSpatialReference:"initial",maxAllowableOffset:"initial",zoomScale:"initial",zoomFactor:{serializeModes:["initial"],isDefault:e=>{var t;const i=this._feature?this._feature.schema:null===(t=this._featureSource)||void 0===t?void 0:t.schema;return e===(i&&"point"===i.geometryType?void 0:1.5)}}}}_hyperlinksAreEquivalent(e,t){if(e===t)return!0;const i=e=>e||"";return i(e.text)===i(t.text)&&i(e.url)===i(t.url)&&i(e.iconUrl)===i(t.iconUrl)&&i(e.target)===i(t.target)&&i(e.tooltip)===i(t.tooltip)}};FeatureSettings=__decorate([serializable],FeatureSettings);export{FeatureSettings};
1
+ import{__decorate}from"tslib";import{Hyperlink}from"../Hyperlink.js";import{PopupInfo as PopupInfoJson}from"../portal/PopupInfo.js";import{FormatSettings}from"../support/FormatSettings.js";import{serializable}from"../support/Serializable.js";import{Settings}from"../support/Settings.js";import{getAllFieldInfos,getAllReferencedFieldNames,isPopupTemplate}from"../utilities/esri.js";import{isQueryBasedRelationship}from"../utilities/relationships.js";import{_fieldWithArcadeXRegex,_fieldWithRelationshipRegex}from"./Schema.js";let FeatureSettings=class extends Settings{get hyperlinkTemplates(){return this._getCollectionSetting("hyperlinkTemplates")}get popupTemplate(){return this._getSetting("popupTemplate")}set popupTemplate(e){this._setSetting("popupTemplate",e instanceof Object&&!isPopupTemplate(e)?PopupInfoJson.toEsriApiPopupTemplate(e):e)}get formatSettings(){return this._getNestedSettings("formatSettings",(()=>new FormatSettings))}get returnGeometry(){return this._getSetting("returnGeometry",!0)}set returnGeometry(e){this._setSetting("returnGeometry",e)}get outFields(){return this._getSetting("outFields",this._defaultOutFields)}set outFields(e){this._setSetting("outFields",e)}get outSpatialReference(){return this._getSetting("outSpatialReference")}set outSpatialReference(e){this._setSetting("outSpatialReference",e)}get maxAllowableOffset(){return this._getSetting("maxAllowableOffset")}set maxAllowableOffset(e){this._setSetting("maxAllowableOffset",e)}get zoomScale(){return this._getSetting("zoomScale")}set zoomScale(e){this._setSetting("zoomScale",e)}get zoomFactor(){var e;const t=this._feature?this._feature.schema:null===(e=this._featureSource)||void 0===e?void 0:e.schema,i=t&&"point"===t.geometryType?void 0:1.5;return this._getSetting("zoomFactor",i)}set zoomFactor(e){this._setSetting("zoomFactor",e)}get featureSource(){return this._featureSource}get feature(){return this._feature}get _defaultOutFields(){var e,t;const i=getAllFieldInfos(this.popupTemplate),r=null===(t=null===(e=this.featureSource)||void 0===e?void 0:e.schema)||void 0===t?void 0:t.primaryKeyField;if(i&&r){const e=new Set;e.add(r);const t=this.featureSource.schema.fields.toArray().map((e=>e.name)),s=getAllReferencedFieldNames(this.popupTemplate),o=i.filter((e=>e.visible)).map((e=>e.fieldName)).concat(...s).filter((e=>t.includes(e)));return this._featureSource.relationships.forEach((e=>{isQueryBasedRelationship(e)&&o.push(e.keyField)})),o.filter((e=>!(e.match(_fieldWithArcadeXRegex)||e.match(_fieldWithRelationshipRegex)))).forEach((t=>e.add(t))),Array.from(e.values())}return["*"]}_setFeatureSource(e){this._featureSource=e,this.notifyChange("featureSource")}_setFeature(e){this._feature=e,this.notifyChange("feature")}_getSerializableProperties(){return{hyperlinkTemplates:{serializeModes:["initial"],deserialize:e=>{e.forEach((e=>{this.hyperlinkTemplates.find((t=>this._hyperlinksAreEquivalent(t,e)))||this.hyperlinkTemplates.add(e instanceof Hyperlink?e:new Hyperlink(e))})),this.hyperlinkTemplates.toArray().forEach((t=>{const i=this.hyperlinkTemplates.indexOf(t),r=e.findIndex((e=>this._hyperlinksAreEquivalent(e,t)));r<0?this.hyperlinkTemplates.removeAt(i):r!==i&&this.hyperlinkTemplates.reorder(t,r)}))}},popupTemplate:{serialize:!1},formatSettings:"initial",outFields:{serializeModes:["initial"],serialize:()=>this.isModified("outFields")?this.outFields:void 0},returnGeometry:{serializeModes:["initial"],default:!0},outSpatialReference:"initial",maxAllowableOffset:"initial",zoomScale:"initial",zoomFactor:{serializeModes:["initial"],isDefault:e=>{var t;const i=this._feature?this._feature.schema:null===(t=this._featureSource)||void 0===t?void 0:t.schema;return e===(i&&"point"===i.geometryType?void 0:1.5)}}}}_hyperlinksAreEquivalent(e,t){if(e===t)return!0;const i=e=>e||"";return i(e.text)===i(t.text)&&i(e.url)===i(t.url)&&i(e.iconUrl)===i(t.iconUrl)&&i(e.target)===i(t.target)&&i(e.tooltip)===i(t.tooltip)}};FeatureSettings=__decorate([serializable],FeatureSettings);export{FeatureSettings};