@arcgis/portal-components 6.0.0-next.2 → 6.0.0-next.21

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 (308) hide show
  1. package/dist/cdn/{MKSFNVXL.js → 22TDAUX4.js} +1 -1
  2. package/dist/cdn/234TH32X.js +106 -0
  3. package/dist/cdn/2D3FQXJ4.js +2 -0
  4. package/dist/cdn/{BKD7JSV2.js → 2DXO6FVX.js} +1 -1
  5. package/dist/cdn/{TWCJJCPC.js → 2XJX2JUO.js} +1 -1
  6. package/dist/cdn/{SGDDFWCJ.js → 3EQGUCO4.js} +1 -1
  7. package/dist/cdn/{OR6T5SB3.js → 3J3ISO3E.js} +1 -1
  8. package/dist/cdn/3RTST3I6.js +2 -0
  9. package/dist/cdn/3XH3JHOI.js +2 -0
  10. package/dist/cdn/4ONCJSSP.js +2 -0
  11. package/dist/cdn/4QYVBXZT.js +2 -0
  12. package/dist/cdn/{K75JTQPW.js → 4VLEUN7I.js} +1 -1
  13. package/dist/cdn/4WQA7UAJ.js +2 -0
  14. package/dist/cdn/5OWIWCEQ.js +2 -0
  15. package/dist/cdn/{7ZWYUHGK.js → 5R4JJWGB.js} +1 -1
  16. package/dist/cdn/63HYFDRU.js +2 -0
  17. package/dist/cdn/6MATPHXT.js +79 -0
  18. package/dist/cdn/7IP3RVPH.js +2 -0
  19. package/dist/cdn/7ISSDO2T.js +2 -0
  20. package/dist/cdn/AKTIIRJQ.js +2 -0
  21. package/dist/cdn/ASID6YW7.js +135 -0
  22. package/dist/cdn/B3HV5JVN.js +2 -0
  23. package/dist/cdn/B6666VUQ.js +2 -0
  24. package/dist/cdn/BOO7GG5L.js +2 -0
  25. package/dist/cdn/CZ4FC4GM.js +2 -0
  26. package/dist/cdn/D3LZFIHV.js +2 -0
  27. package/dist/cdn/{NWVLGU2C.js → D3Q72PPN.js} +1 -1
  28. package/dist/cdn/DABNV2OO.js +2 -0
  29. package/dist/cdn/DELNTRCT.js +2 -0
  30. package/dist/cdn/DOCNBKQZ.js +2 -0
  31. package/dist/cdn/EP7NWEC5.js +2 -0
  32. package/dist/cdn/EQRBP6H6.js +66 -0
  33. package/dist/cdn/{ABORO35R.js → ESKKH4DE.js} +1 -1
  34. package/dist/cdn/EUQQZIRW.js +2 -0
  35. package/dist/cdn/F2HT5PVQ.js +2 -0
  36. package/dist/cdn/FE3O23SE.js +2 -0
  37. package/dist/cdn/FGRMURKX.js +2 -0
  38. package/dist/cdn/FN2QMDEW.js +2 -0
  39. package/dist/cdn/{I6IRHXWR.js → FYVATGMR.js} +1 -1
  40. package/dist/cdn/{RHCRPJWS.js → G3WDR53S.js} +1 -1
  41. package/dist/cdn/GAU6DNV5.js +2 -0
  42. package/dist/cdn/GPAIXN52.js +2 -0
  43. package/dist/cdn/GRSBU4PD.js +2 -0
  44. package/dist/cdn/{JWBUJT43.js → H7FA5HFE.js} +1 -1
  45. package/dist/cdn/HHGKNVCH.js +4 -0
  46. package/dist/cdn/HJLWIQDI.js +2 -0
  47. package/dist/cdn/I3EWDYTU.js +2 -0
  48. package/dist/cdn/{24QSQLRY.js → IKPVMXXW.js} +1 -1
  49. package/dist/cdn/{5HZNBMW6.js → IOFXDIWC.js} +1 -1
  50. package/dist/cdn/IPHBVKMY.js +2 -0
  51. package/dist/cdn/{GAF4YT5N.js → IUIFCQQU.js} +1 -1
  52. package/dist/cdn/{ZKZDKJ6D.js → IVDZGUNZ.js} +1 -1
  53. package/dist/cdn/J6SI4Z4F.js +2 -0
  54. package/dist/cdn/K3GAZFRI.js +63 -0
  55. package/dist/cdn/K7LYYLUF.js +2 -0
  56. package/dist/cdn/{74T6IXSN.js → KDORI7H4.js} +1 -1
  57. package/dist/cdn/KRORL7QC.js +2 -0
  58. package/dist/cdn/LGJWULAW.js +2 -0
  59. package/dist/cdn/LTMPXQTC.js +2 -0
  60. package/dist/cdn/M5STJJRX.js +2 -0
  61. package/dist/cdn/M7J7RAM4.js +2 -0
  62. package/dist/cdn/{AXOBMX3S.js → MLTZSPZQ.js} +1 -1
  63. package/dist/cdn/MSSJRDR7.js +2 -0
  64. package/dist/cdn/{L64UURQB.js → N4ZRMYZL.js} +1 -1
  65. package/dist/cdn/NBCYYUHP.js +2 -0
  66. package/dist/cdn/NHVPNSNH.js +2 -0
  67. package/dist/cdn/NQ2IAQKL.js +41 -0
  68. package/dist/cdn/NXGTEDK4.js +2 -0
  69. package/dist/cdn/{7LMZHJZG.js → NYOXMT6S.js} +1 -1
  70. package/dist/cdn/O3JP4FQ3.js +2 -0
  71. package/dist/cdn/O4YFPGD5.js +2 -0
  72. package/dist/cdn/{JIJO4CAS.js → ODSA6NNS.js} +1 -1
  73. package/dist/cdn/OHAQPQAP.js +2 -0
  74. package/dist/cdn/OOXTSCQT.js +2 -0
  75. package/dist/cdn/OQ2JULON.js +2 -0
  76. package/dist/cdn/OVH4YLTS.js +2 -0
  77. package/dist/cdn/QB5BGHLA.js +2 -0
  78. package/dist/cdn/QKCRNS75.js +2 -0
  79. package/dist/cdn/{2YZWRFCI.js → RKMW4FUN.js} +1 -1
  80. package/dist/cdn/RT26JZP5.js +2 -0
  81. package/dist/cdn/SKHFISBA.js +2 -0
  82. package/dist/cdn/SKIDJ4QI.js +2 -0
  83. package/dist/cdn/SRWFOV5W.js +2 -0
  84. package/dist/cdn/{IN4JPZTY.js → SSCKCDXD.js} +1 -1
  85. package/dist/cdn/T66G7GIR.js +2 -0
  86. package/dist/cdn/{RQYNPDN3.js → TIMYD2HM.js} +1 -1
  87. package/dist/cdn/{ROX3GKKA.js → TIPQ2ZWK.js} +1 -1
  88. package/dist/cdn/TJWJ3LTU.js +2 -0
  89. package/dist/cdn/{DHMNNIXZ.js → TMR4BRFI.js} +1 -1
  90. package/dist/cdn/{JN23JH3T.js → TTQGRN2V.js} +1 -1
  91. package/dist/cdn/{MLYQGIJU.js → U2HTYOBB.js} +13 -13
  92. package/dist/cdn/{YZTBAUIO.js → UHOW7Q65.js} +1 -1
  93. package/dist/cdn/ULGME5RT.js +2 -0
  94. package/dist/cdn/{Z6R3C4AK.js → US3N5L73.js} +1 -1
  95. package/dist/cdn/W5POIPYP.js +2 -0
  96. package/dist/cdn/{TLM457Z5.js → WJWWYBZ7.js} +1 -1
  97. package/dist/cdn/WNEPEEPZ.js +2 -0
  98. package/dist/cdn/WPAZDJHU.js +2 -0
  99. package/dist/cdn/WT72SOAU.js +2 -0
  100. package/dist/cdn/XJGKRAN5.js +2 -0
  101. package/dist/cdn/{JPUUMGX5.js → XS5EOWBK.js} +1 -1
  102. package/dist/cdn/Y5VUMGKH.js +3 -0
  103. package/dist/cdn/{EQDYQOOT.js → YCIFVZ4J.js} +1 -1
  104. package/dist/cdn/{3NSHGKZA.js → YDXJHNDI.js} +1 -1
  105. package/dist/cdn/{32BWFMTC.js → YIOJIA4Y.js} +1 -1
  106. package/dist/cdn/{K2XSYDAP.js → YK6FCXWU.js} +1 -1
  107. package/dist/cdn/YPDHSE2J.js +2 -0
  108. package/dist/cdn/{M5PPX4ZX.js → YQLFXHFG.js} +1 -1
  109. package/dist/cdn/YSVPB3BO.js +2 -0
  110. package/dist/cdn/YUOVGTP5.js +2 -0
  111. package/dist/cdn/Z5CA4C6H.js +2 -0
  112. package/dist/cdn/{TXC7YBGL.js → ZD6XJVGV.js} +1 -1
  113. package/dist/cdn/ZHQXYCPA.js +2 -0
  114. package/dist/cdn/{DLI4XKJ3.js → ZOX4RLS4.js} +1 -1
  115. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.en.json +1 -1
  116. package/dist/cdn/assets/portal-entity-picker/t9n/messages.en.json +1 -1
  117. package/dist/cdn/assets/portal-item-card-sublayer-select/t9n/messages.en.json +1 -0
  118. package/dist/cdn/assets/portal-item-share-summary/t9n/messages.en.json +1 -0
  119. package/dist/cdn/index.js +1 -1
  120. package/dist/cdn/main.css +1 -1
  121. package/dist/chunks/fieldAddDelete.js +7 -7
  122. package/dist/chunks/functionalities.js +14 -9
  123. package/dist/chunks/groups.js +8 -61
  124. package/dist/chunks/groups2.js +23 -8
  125. package/dist/chunks/info.js +2 -2
  126. package/dist/chunks/item.js +58 -26
  127. package/dist/chunks/item2.js +34 -30
  128. package/dist/chunks/itemThumbnail.js +21 -21
  129. package/dist/chunks/loadClassificationData.js +26 -27
  130. package/dist/chunks/portal-delete-items-review.js +1 -1
  131. package/dist/chunks/portal-item-badge.js +1 -1
  132. package/dist/chunks/portal-related-items-list-item.js +1 -1
  133. package/dist/chunks/portal.js +6 -6
  134. package/dist/chunks/portal2.js +11 -11
  135. package/dist/chunks/portalEntitySelection.js +54 -0
  136. package/dist/chunks/query.js +13 -13
  137. package/dist/chunks/request.js +49 -41
  138. package/dist/chunks/requests.js +7 -7
  139. package/dist/chunks/selectedMentions.js +25 -0
  140. package/dist/chunks/services.js +1 -1
  141. package/dist/chunks/string.js +14 -10
  142. package/dist/chunks/ui.js +1 -0
  143. package/dist/chunks/url.js +2 -2
  144. package/dist/chunks/user.js +10 -10
  145. package/dist/chunks/utils.js +35 -22
  146. package/dist/chunks/utils2.js +4 -4
  147. package/dist/chunks/utils3.js +88 -657
  148. package/dist/chunks/utils4.js +664 -0
  149. package/dist/components/arcgis-portal-account-switcher/customElement.js +28 -26
  150. package/dist/components/arcgis-portal-account-switcher-accounts/customElement.d.ts +4 -4
  151. package/dist/components/arcgis-portal-account-switcher-accounts/customElement.js +8 -8
  152. package/dist/components/arcgis-portal-account-switcher-list/customElement.d.ts +4 -4
  153. package/dist/components/arcgis-portal-account-switcher-list/customElement.js +6 -6
  154. package/dist/components/arcgis-portal-account-switcher-signout/customElement.d.ts +5 -5
  155. package/dist/components/arcgis-portal-account-switcher-signout/customElement.js +3 -3
  156. package/dist/components/arcgis-portal-add-gps-metadata/customElement.d.ts +6 -0
  157. package/dist/components/arcgis-portal-add-gps-metadata/customElement.js +153 -130
  158. package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +25 -15
  159. package/dist/components/arcgis-portal-ai-assistant/customElement.js +574 -2409
  160. package/dist/components/arcgis-portal-ai-assistant/index.js +4 -0
  161. package/dist/components/arcgis-portal-ai-assistant/tools/getItemTool.d.ts +11 -0
  162. package/dist/components/arcgis-portal-ai-assistant/types/assistantTools.d.ts +51 -0
  163. package/dist/components/arcgis-portal-ai-assistant/types/portalEntityTools.d.ts +14 -0
  164. package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.d.ts +39 -0
  165. package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.js +63 -27
  166. package/dist/components/arcgis-portal-ai-assistant-interrupt/index.js +3 -1
  167. package/dist/components/arcgis-portal-classification-banner/customElement.js +2 -2
  168. package/dist/components/arcgis-portal-classification-config/customElement.js +2 -2
  169. package/dist/components/arcgis-portal-classification-favorite/customElement.js +2 -2
  170. package/dist/components/arcgis-portal-classification-form-element/customElement.js +1 -1
  171. package/dist/components/arcgis-portal-delete-items/customElement.d.ts +69 -3
  172. package/dist/components/arcgis-portal-delete-items/customElement.js +446 -330
  173. package/dist/components/arcgis-portal-delete-items/index.js +1 -2
  174. package/dist/components/arcgis-portal-delete-items/types.d.ts +1 -0
  175. package/dist/components/arcgis-portal-entity-picker/customElement.d.ts +36 -0
  176. package/dist/components/arcgis-portal-entity-picker/customElement.js +202 -120
  177. package/dist/components/arcgis-portal-entity-picker/index.js +2 -0
  178. package/dist/components/arcgis-portal-field-delete/customElement.js +33 -31
  179. package/dist/components/arcgis-portal-field-delete/index.js +1 -1
  180. package/dist/components/arcgis-portal-group-badges/customElement.js +5 -5
  181. package/dist/components/arcgis-portal-group-browser/customElement.js +93 -99
  182. package/dist/components/arcgis-portal-group-browser/types.d.ts +3 -7
  183. package/dist/components/arcgis-portal-group-browser-preview/customElement.js +2 -2
  184. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.js +1 -1
  185. package/dist/components/arcgis-portal-group-card/customElement.js +18 -18
  186. package/dist/components/arcgis-portal-group-thumbnail/customElement.js +1 -1
  187. package/dist/components/arcgis-portal-item-card/customElement.d.ts +26 -10
  188. package/dist/components/arcgis-portal-item-card/customElement.js +101 -91
  189. package/dist/components/arcgis-portal-item-card/index.js +2 -1
  190. package/dist/components/arcgis-portal-item-card-sublayer-select/customElement.d.ts +102 -0
  191. package/dist/components/arcgis-portal-item-card-sublayer-select/customElement.js +352 -0
  192. package/dist/components/arcgis-portal-item-card-sublayer-select/index.d.ts +1 -0
  193. package/dist/components/arcgis-portal-item-card-sublayer-select/index.js +8 -0
  194. package/dist/components/arcgis-portal-item-card-sublayer-select/types.d.ts +22 -0
  195. package/dist/components/arcgis-portal-item-share-summary/customElement.d.ts +113 -0
  196. package/dist/components/arcgis-portal-item-share-summary/customElement.js +172 -0
  197. package/dist/components/arcgis-portal-item-share-summary/index.d.ts +1 -0
  198. package/dist/components/arcgis-portal-item-share-summary/index.js +5 -0
  199. package/dist/components/arcgis-portal-item-share-summary-editable/customElement.d.ts +33 -0
  200. package/dist/components/arcgis-portal-item-share-summary-editable/customElement.js +19 -0
  201. package/dist/components/arcgis-portal-item-share-summary-editable/index.d.ts +1 -0
  202. package/dist/components/arcgis-portal-item-share-summary-editable/index.js +2 -0
  203. package/dist/components/arcgis-portal-item-thumbnail/customElement.d.ts +1 -0
  204. package/dist/components/arcgis-portal-item-thumbnail/customElement.js +14 -14
  205. package/dist/components/arcgis-portal-item-type/customElement.js +1 -1
  206. package/dist/components/arcgis-portal-mentionable-text-area/customElement.js +61 -57
  207. package/dist/components/arcgis-portal-navigation/customElement.js +7 -8
  208. package/dist/components/arcgis-portal-navigation/index.js +1 -1
  209. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +8 -8
  210. package/dist/components/arcgis-portal-review-related-items/customElement.d.ts +333 -0
  211. package/dist/components/arcgis-portal-review-related-items/customElement.js +45 -18
  212. package/dist/components/arcgis-portal-review-related-items/index.js +2 -0
  213. package/dist/components/arcgis-portal-sublayer-type/customElement.js +13 -103
  214. package/dist/components/arcgis-portal-user-popup/customElement.js +28 -28
  215. package/dist/components/portal-group-browser-filters/customElement.js +15 -15
  216. package/dist/components/portal-related-items-list-item/customElement.js +16 -14
  217. package/dist/components/portal-related-items-list-item/index.js +1 -1
  218. package/dist/docs/api.json +1 -1
  219. package/dist/docs/docs.json +1 -1
  220. package/dist/docs/vscode.html-custom-data.json +1 -1
  221. package/dist/docs/web-types.json +1 -1
  222. package/dist/index.d.ts +30 -0
  223. package/dist/index.js +155 -6
  224. package/dist/loader.js +15 -12
  225. package/dist/services/groups.d.ts +9 -0
  226. package/dist/services/item.d.ts +9 -0
  227. package/dist/types/item.d.ts +9 -9
  228. package/dist/types/lumina.d.ts +36 -17
  229. package/dist/types/preact.d.ts +39 -17
  230. package/dist/types/react.d.ts +42 -17
  231. package/dist/types/services.d.ts +27 -1
  232. package/dist/types/stencil.d.ts +36 -17
  233. package/dist/utils/generateEmbeddings.d.ts +7 -0
  234. package/dist/utils/semanticSearch.d.ts +60 -0
  235. package/dist/utils/types.d.ts +10 -0
  236. package/package.json +10 -10
  237. package/dist/cdn/23FS4XTG.js +0 -2
  238. package/dist/cdn/2MPQ5IWJ.js +0 -2
  239. package/dist/cdn/3CQKCUM5.js +0 -2
  240. package/dist/cdn/3EYB5GQX.js +0 -2
  241. package/dist/cdn/3LEQ37YT.js +0 -68
  242. package/dist/cdn/46BUEBWS.js +0 -2
  243. package/dist/cdn/4AI52H7C.js +0 -2
  244. package/dist/cdn/4MUB6TL6.js +0 -2
  245. package/dist/cdn/4PRXQFCV.js +0 -2
  246. package/dist/cdn/4QFTKB6T.js +0 -2
  247. package/dist/cdn/4TSXFX3M.js +0 -2
  248. package/dist/cdn/5C5GHX4D.js +0 -2
  249. package/dist/cdn/5PPZNVWG.js +0 -2
  250. package/dist/cdn/66XWNGQ2.js +0 -2
  251. package/dist/cdn/6F4SJDRR.js +0 -2
  252. package/dist/cdn/6RZEXOK3.js +0 -2
  253. package/dist/cdn/A2SQ4EMZ.js +0 -2
  254. package/dist/cdn/AICPYLWE.js +0 -4
  255. package/dist/cdn/AJQT7UXB.js +0 -2
  256. package/dist/cdn/APSYZEPP.js +0 -209
  257. package/dist/cdn/AZOJHVAO.js +0 -2
  258. package/dist/cdn/BSTA5KI5.js +0 -2
  259. package/dist/cdn/CD5UWSCP.js +0 -2
  260. package/dist/cdn/CXXV6WJT.js +0 -2
  261. package/dist/cdn/DDBXEXOV.js +0 -2
  262. package/dist/cdn/DYO5P3F2.js +0 -2
  263. package/dist/cdn/E66BDC6N.js +0 -2
  264. package/dist/cdn/EEAVX4PP.js +0 -2
  265. package/dist/cdn/EITRZQSC.js +0 -2
  266. package/dist/cdn/EMJQI4MA.js +0 -2
  267. package/dist/cdn/FIBQAMJ3.js +0 -2
  268. package/dist/cdn/FIQZPIIK.js +0 -2
  269. package/dist/cdn/FNLBJ4ZQ.js +0 -2
  270. package/dist/cdn/FRE56NBG.js +0 -2
  271. package/dist/cdn/GSOBDGLK.js +0 -2
  272. package/dist/cdn/GUO7HKSP.js +0 -463
  273. package/dist/cdn/GX7U3727.js +0 -2
  274. package/dist/cdn/GXM3XY3J.js +0 -2
  275. package/dist/cdn/I273CANO.js +0 -2
  276. package/dist/cdn/I6NVKNZJ.js +0 -2
  277. package/dist/cdn/J5FKIZAM.js +0 -2
  278. package/dist/cdn/JL52W3Z4.js +0 -2
  279. package/dist/cdn/JOUR2FB2.js +0 -3
  280. package/dist/cdn/LISDTBEX.js +0 -2
  281. package/dist/cdn/LWFACY3F.js +0 -2
  282. package/dist/cdn/LYLQCBVX.js +0 -2
  283. package/dist/cdn/N4VOTJ25.js +0 -2
  284. package/dist/cdn/N5QLV56W.js +0 -2
  285. package/dist/cdn/NRMQDCM3.js +0 -2
  286. package/dist/cdn/OD5WXP7J.js +0 -2
  287. package/dist/cdn/OXPXXIWL.js +0 -2
  288. package/dist/cdn/PMRFXB4F.js +0 -2
  289. package/dist/cdn/PNIFJ5DQ.js +0 -2
  290. package/dist/cdn/PZDI5ZDC.js +0 -2
  291. package/dist/cdn/RVYSVTPQ.js +0 -2
  292. package/dist/cdn/SVROAT3Z.js +0 -2
  293. package/dist/cdn/TBZXKKGP.js +0 -2
  294. package/dist/cdn/TNUCSWBN.js +0 -2
  295. package/dist/cdn/TOICLGFK.js +0 -2
  296. package/dist/cdn/TOTWYGB3.js +0 -2
  297. package/dist/cdn/TUUUK3VX.js +0 -2
  298. package/dist/cdn/U3KMGSVH.js +0 -2
  299. package/dist/cdn/WC3FPLYQ.js +0 -2
  300. package/dist/cdn/XYMBRPC7.js +0 -2
  301. package/dist/cdn/YTODQCOG.js +0 -2
  302. package/dist/cdn/YYTEJVBL.js +0 -2
  303. package/dist/cdn/ZDDN7UKS.js +0 -2
  304. package/dist/chunks/functional.js +0 -9
  305. package/dist/components/arcgis-portal-ai-assistant/data/capability-registries/types.d.ts +0 -45
  306. /package/dist/cdn/{OUMTV5H5.js → KHKREBVZ.js} +0 -0
  307. /package/dist/components/arcgis-portal-ai-assistant/{agents/types.d.ts → types/navigation.d.ts} +0 -0
  308. /package/dist/components/arcgis-portal-ai-assistant/{agents → types}/portalRouteKeys.d.ts +0 -0
@@ -5,13 +5,12 @@ import "@esri/calcite-components/components/calcite-list-item";
5
5
  import "../arcgis-portal-item-type/index.js";
6
6
  import "@esri/calcite-components/components/calcite-block";
7
7
  import "@esri/calcite-components/components/calcite-icon";
8
- import "@esri/calcite-components/components/calcite-chip";
9
8
  import "@esri/calcite-components/components/calcite-notice";
10
9
  import "../arcgis-portal-review-related-items/index.js";
11
10
  import "@esri/calcite-components/components/calcite-button";
12
11
  import "@esri/calcite-components/components/calcite-scrim";
13
12
  import "@esri/calcite-components/components/calcite-panel";
14
- import "@esri/calcite-components/components/calcite-checkbox";
15
13
  import "../arcgis-portal-delete-items-review/index.js";
14
+ import "@esri/calcite-components/components/calcite-checkbox";
16
15
  import "@esri/calcite-components/components/calcite-dialog";
17
16
  export * from "./customElement.js";
@@ -8,6 +8,7 @@ export interface RecycleStatus extends DeleteCheckResult {
8
8
  export interface DeleteCheckResult {
9
9
  item: PortalItem;
10
10
  usedByItems: PortalItem[];
11
+ usedByItemsCount: number;
11
12
  sourceData: PortalItem | null;
12
13
  replacementItemFor: PortalItem[] | null;
13
14
  resultData: PortalItem[] | null;
@@ -2,34 +2,52 @@
2
2
  import type Portal from "@arcgis/core/portal/Portal.js";
3
3
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
4
4
  import type { PortalEntityPickerEntityType, PortalEntityPickerMode, PortalEntityPickerSelection } from "../../types/portalEntityPicker.js";
5
+ import type { ArcgisPortalItemCard } from "../arcgis-portal-item-card/customElement.js";
5
6
  import type { T9nMeta } from "@arcgis/lumina/controllers";
6
7
  import type { Icon as Icon } from "@esri/calcite-components/components/calcite-icon";
7
8
 
8
9
  /**
9
10
  * Search for and select an item, group, or organization member from a portal.
11
+ * Item and group searches initially include all accessible results on the configured portal.
12
+ * The search bucket can narrow results to the signed-in user's content, group memberships,
13
+ * or organization, as applicable. Organization-member searches remain organization-only.
14
+ * The bucket selector is shown only when multiple search scopes are available.
15
+ * Changes to the signed-in account on an existing portal instance are not observed.
10
16
  *
11
17
  * @slot [list-start] - Content displayed before the search results.
12
18
  */
13
19
  export abstract class ArcgisPortalEntityPicker extends LitElement {
14
20
  /** @internal */
15
21
  protected _messages: {
22
+ allContent: string;
23
+ allGroups: string;
16
24
  clearSelection: string;
25
+ myContent: string;
26
+ myGroups: string;
27
+ myOrganization: string;
17
28
  noGroupsFound: string;
18
29
  noItemsFound: string;
19
30
  noUsersFound: string;
20
31
  searchFailed: string;
21
32
  searchGroups: string;
22
33
  searchItems: string;
34
+ searchIn: string;
23
35
  searchUsers: string;
24
36
  searching: string;
25
37
  } & T9nMeta<{
38
+ allContent: string;
39
+ allGroups: string;
26
40
  clearSelection: string;
41
+ myContent: string;
42
+ myGroups: string;
43
+ myOrganization: string;
27
44
  noGroupsFound: string;
28
45
  noItemsFound: string;
29
46
  noUsersFound: string;
30
47
  searchFailed: string;
31
48
  searchGroups: string;
32
49
  searchItems: string;
50
+ searchIn: string;
33
51
  searchUsers: string;
34
52
  searching: string;
35
53
  }>;
@@ -41,15 +59,27 @@ export abstract class ArcgisPortalEntityPicker extends LitElement {
41
59
  accessor entityType: PortalEntityPickerEntityType;
42
60
  /** The icon displayed in the search input. */
43
61
  accessor icon: Icon["icon"] | undefined;
62
+ /**
63
+ * Initial search text. Changing this value resets the search text and results.
64
+ *
65
+ * @default ""
66
+ */
67
+ accessor initialSearchTerm: string;
44
68
  /** Overrides for search text and other translated messages. */
45
69
  accessor messageOverrides: {
70
+ allContent?: string | undefined;
71
+ allGroups?: string | undefined;
46
72
  clearSelection?: string | undefined;
73
+ myContent?: string | undefined;
74
+ myGroups?: string | undefined;
75
+ myOrganization?: string | undefined;
47
76
  noGroupsFound?: string | undefined;
48
77
  noItemsFound?: string | undefined;
49
78
  noUsersFound?: string | undefined;
50
79
  searchFailed?: string | undefined;
51
80
  searchGroups?: string | undefined;
52
81
  searchItems?: string | undefined;
82
+ searchIn?: string | undefined;
53
83
  searchUsers?: string | undefined;
54
84
  searching?: string | undefined;
55
85
  };
@@ -71,6 +101,12 @@ export abstract class ArcgisPortalEntityPicker extends LitElement {
71
101
  accessor query: string | undefined;
72
102
  /** The currently selected entity. The component does not mutate this property. */
73
103
  accessor selected: PortalEntityPickerSelection | null;
104
+ /**
105
+ * Controls selection indicators for inline results. `none` keeps click and keyboard selection without controls.
106
+ *
107
+ * @default "single"
108
+ */
109
+ accessor selectionMode: Extract<ArcgisPortalItemCard["selection"], "none" | "single">;
74
110
  /** Sets focus on the search input. */
75
111
  setFocus(): Promise<void>;
76
112
  /**
@@ -1,87 +1,187 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import { c as m } from "../../chunks/runtime.js";
3
- import { css as y, html as n } from "lit";
4
- import { keyed as h } from "lit/directives/keyed.js";
5
- import { LitElement as f, createEvent as v, safeStyleMap as g } from "@arcgis/lumina";
6
- import { createRef as u, ref as d } from "lit/directives/ref.js";
7
- import { u as $ } from "../../chunks/useT9n.js";
8
- import { c as b } from "../../chunks/string.js";
9
- import { s as R } from "../../chunks/dom.js";
10
- import { a as T } from "../../chunks/portal.js";
11
- import { r as S } from "../../chunks/request.js";
2
+ import { c as P } from "../../chunks/runtime.js";
3
+ import { css as O, html as p } from "lit";
4
+ import { keyed as y } from "lit/directives/keyed.js";
5
+ import { LitElement as F, createEvent as L, safeStyleMap as E } from "@arcgis/lumina";
6
+ import { createRef as T, ref as b } from "lit/directives/ref.js";
7
+ import { u as x } from "../../chunks/useT9n.js";
8
+ import { isAbortError as k } from "@arcgis/core/core/promiseUtils.js";
9
+ import w from "@arcgis/core/portal/PortalQueryResult.js";
10
+ import { c as G, a as S } from "../../chunks/string.js";
11
+ import { s as M } from "../../chunks/groups2.js";
12
+ import { s as z } from "../../chunks/dom.js";
13
+ import { g as U } from "../../chunks/portal.js";
14
+ import { r as D } from "../../chunks/request.js";
12
15
  import "../arcgis-portal-group-card/customElement.js";
13
16
  import "../arcgis-portal-item-card/customElement.js";
14
- import { S as k } from "../../chunks/utils.js";
17
+ import { makeGenericController as q } from "@arcgis/lumina/controllers";
18
+ import { S as N } from "../../chunks/utils.js";
15
19
  import "../arcgis-portal-user-avatar/customElement.js";
16
- const w = [
20
+ const B = [
17
21
  "esri_livingatlas",
18
22
  "esri_boundaries",
19
23
  "esri_demographics",
20
24
  "esri_nav",
21
25
  "esri_webstyles"
22
26
  ];
23
- function I(o) {
24
- return R(o.trim()).replace(/[!*+\-&|()[\]{}^~?:"\\]/gu, "\\$&");
27
+ function W(a) {
28
+ return z(a.trim()).replace(/[!*+\-&|()[\]{}^~?:"\\]/gu, "\\$&");
25
29
  }
26
- async function _({
27
- portal: o,
30
+ async function Q({
31
+ portal: a,
28
32
  searchTerm: e,
29
33
  num: t = 100,
30
- query: s
34
+ query: i,
35
+ signal: o
31
36
  }) {
32
- const i = I(e), l = `${T(o)}portals/self/users/search`, r = [i ? `(${i})` : void 0, s?.trim() ? `(${s.trim()})` : void 0];
33
- o.isPortal && r.push(...w.map((p) => `-username:${p}`));
34
- const a = l.includes("www.arcgis.com") && o.isPortal ? { disableIdentityLookup: !0, addTokenManually: !1 } : {};
35
- return await S({
36
- url: l,
37
- portal: o,
37
+ const r = W(e), s = `${U(a)}portals/self/users/search`, c = [r ? `(${r})` : void 0, i?.trim() ? `(${i.trim()})` : void 0];
38
+ a.isPortal && c.push(...B.map((d) => `-username:${d}`));
39
+ const u = s.includes("www.arcgis.com") && a.isPortal ? { disableIdentityLookup: !0, addTokenManually: !1 } : {};
40
+ return await D({
41
+ url: s,
42
+ portal: a,
38
43
  params: {
39
44
  num: Math.min(Math.max(t, 1), 100),
40
- q: r.filter(Boolean).join(" AND "),
45
+ q: c.filter(Boolean).join(" AND "),
41
46
  sortField: "relevance"
42
47
  },
43
- options: a
48
+ options: { ...u, ...o ? { signal: o } : {} }
44
49
  });
45
50
  }
46
- function A(...o) {
47
- return o.map((e) => e?.trim()).filter((e) => !!e).map((e) => `(${e})`).join(" AND ");
51
+ function R(a, e) {
52
+ const t = ["all"];
53
+ return e === "user" || !a.user?.username || (e === "item" && t.push("myContent"), t.push("myGroups"), a.user.orgId && t.push("myOrganization")), t;
48
54
  }
49
- async function P(o, e, t, s = {}) {
50
- const i = Math.min(Math.max(s.num ?? 10, 1), 100);
51
- if (e === "user")
52
- try {
55
+ function v(a) {
56
+ return `"${a.replace(/[\\"]/gu, "\\$&")}"`;
57
+ }
58
+ async function j(a) {
59
+ const { portal: e, entityType: t, searchTerm: i, signal: o } = a, r = Math.min(Math.max(a.num ?? 10, 1), 100), s = a.scope ?? "all";
60
+ try {
61
+ if (o?.throwIfAborted(), !R(e, t).includes(s))
62
+ throw new Error(`Search scope "${s}" is unavailable for ${t} searches.`);
63
+ if (t === "user")
53
64
  return {
54
65
  result: {
55
- entityType: e,
56
- result: await _({ portal: o, searchTerm: t, num: i, query: s.query })
66
+ entityType: t,
67
+ result: await Q({
68
+ portal: e,
69
+ searchTerm: i,
70
+ num: r,
71
+ query: a.query,
72
+ ...o ? { signal: o } : {}
73
+ })
57
74
  }
58
75
  };
59
- } catch (c) {
60
- return console.error(c), { error: { code: "unhandledError" } };
76
+ const c = G(i);
77
+ if (!c)
78
+ return {};
79
+ let l;
80
+ const u = e.user;
81
+ if (s === "myContent" && u)
82
+ l = `owner:${v(u.username)}`;
83
+ else if (s === "myOrganization" && u?.orgId)
84
+ l = `orgid:${v(u.orgId)}`;
85
+ else if (s === "myGroups" && u) {
86
+ if (t === "group") {
87
+ const n = await M(
88
+ e,
89
+ {
90
+ num: r,
91
+ q: S(c, a.query),
92
+ searchUserAccess: "groupMember",
93
+ searchUserName: u.username
94
+ },
95
+ { signal: o }
96
+ );
97
+ return {
98
+ result: {
99
+ entityType: t,
100
+ result: new w({ results: n.results, total: n.total })
101
+ }
102
+ };
103
+ }
104
+ const m = await u.fetchGroups();
105
+ if (o?.throwIfAborted(), !m.length)
106
+ return {
107
+ result: { entityType: t, result: new w({ results: [], total: 0 }) }
108
+ };
109
+ l = m.map(({ id: n }) => {
110
+ if (!n)
111
+ throw new Error("A membership group is missing its ID.");
112
+ return `group:${v(n)}`;
113
+ }).join(" OR ");
61
114
  }
62
- const l = b(t);
63
- if (!l)
64
- return {};
65
- const r = {
66
- num: i,
67
- query: A(l, s.query)
68
- };
69
- try {
70
- return e === "group" ? { result: { entityType: e, result: await o.queryGroups(r) } } : { result: { entityType: e, result: await o.queryItems(r) } };
115
+ const d = {
116
+ num: r,
117
+ query: S(c, a.query, l)
118
+ };
119
+ return t === "group" ? { result: { entityType: t, result: await e.queryGroups(d, { signal: o }) } } : { result: { entityType: t, result: await e.queryItems(d, { signal: o }) } };
71
120
  } catch (c) {
121
+ if (o?.aborted || k(c))
122
+ throw c;
72
123
  return console.error(c), { error: { code: "unhandledError" } };
73
124
  }
74
125
  }
75
- const O = y`:host{display:block;inline-size:100%}.entity-picker{display:flex;flex-direction:column;gap:.5rem;min-inline-size:16rem}.entity-picker__results{max-block-size:22rem;overflow-y:auto}.entity-picker__cards{display:flex;flex-direction:column;gap:.5rem}.entity-picker__status{color:var(--calcite-color-text-3);font-size:.875rem;margin:0;padding:.75rem}.entity-picker__selection{align-items:center;display:flex;gap:.5rem}.entity-picker__selection-label{flex:1;min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entity-picker__input{inline-size:100%}`;
76
- class F extends f {
126
+ const H = (a) => q((e, t) => {
127
+ let i = {
128
+ searchTerm: "",
129
+ scope: "all",
130
+ isSearching: !1,
131
+ searchFailed: !1
132
+ }, o, r;
133
+ const s = (n) => {
134
+ i = { ...i, ...n }, t.exports = { ...i, setSearchTerm: d, setScope: m };
135
+ }, c = () => {
136
+ o !== void 0 && (clearTimeout(o), o = void 0), r?.abort(), r = void 0;
137
+ }, l = async (n, h) => {
138
+ const { entityType: g, num: C, portal: I, query: _ } = e, { scope: $ } = i;
139
+ try {
140
+ const { error: f, result: A } = await j({
141
+ portal: I,
142
+ entityType: g,
143
+ searchTerm: n,
144
+ num: C,
145
+ query: _,
146
+ signal: h,
147
+ ...$ === "all" ? {} : { scope: $ }
148
+ });
149
+ h.aborted || s({ searchFailed: !!f, searchResult: A, isSearching: !1 });
150
+ } catch (f) {
151
+ !h.aborted && !k(f) && (console.error(f), s({ searchFailed: !0, searchResult: void 0, isSearching: !1 }));
152
+ }
153
+ }, u = (n) => {
154
+ const h = n.searchTerm.trim();
155
+ if (c(), s({ ...n, searchFailed: !1, searchResult: void 0, isSearching: !!h }), a(!!h), h) {
156
+ r = new AbortController();
157
+ const { signal: g } = r;
158
+ o = setTimeout(() => {
159
+ o = void 0, l(h, g);
160
+ }, N);
161
+ }
162
+ }, d = (n) => {
163
+ u({ searchTerm: n, scope: i.scope });
164
+ }, m = (n) => {
165
+ n !== i.scope && u({ searchTerm: i.searchTerm, scope: n });
166
+ };
167
+ return t.onUpdate((n) => {
168
+ (n.has("portal") || n.has("entityType") || n.has("query") || n.has("num") || n.has("initialSearchTerm")) && u({
169
+ searchTerm: e.initialSearchTerm,
170
+ scope: n.has("portal") || n.has("entityType") ? "all" : i.scope
171
+ });
172
+ }), t.onDisconnected(c), { ...i, setSearchTerm: d, setScope: m };
173
+ }), K = O`:host{display:block;inline-size:100%}.entity-picker{display:flex;flex-direction:column;gap:.5rem;min-inline-size:16rem}.entity-picker__results{max-block-size:var(--arcgis-portal-entity-picker-results-max-block-size, 22rem);overflow-y:auto}.entity-picker__cards{display:flex;flex-direction:column;gap:.5rem}.entity-picker__status{color:var(--calcite-color-text-3);font-size:.875rem;margin:0;padding:.75rem}.entity-picker__selection{align-items:center;display:var(--arcgis-portal-entity-picker-selection-display, flex);gap:.5rem}.entity-picker__selection-label{flex:1;min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entity-picker__input{inline-size:100%}`;
174
+ class V extends F {
77
175
  constructor() {
78
- super(...arguments), this._messages = $({ blocking: !0, name: "portal-entity-picker" }), this.inputRef = u(), this.inputContainerRef = u(), this.resizeObserver = null, this.searchId = 0, this.searchTerm = "", this.isSearching = !1, this.searchFailed = !1, this.popoverOpen = !1, this.popoverWidth = 0, this.entityType = "group", this.mode = "inline", this.selected = null, this.num = 10, this.arcgisSelectionChange = v();
176
+ super(...arguments), this._messages = x({ blocking: !0, name: "portal-entity-picker" }), this.inputRef = T(), this.inputContainerRef = T(), this.resizeObserver = null, this.searchController = H((e) => {
177
+ (!e || this.mode === "popover") && (this.popoverOpen = e);
178
+ })(this), this.popoverOpen = !1, this.popoverWidth = 0, this.entityType = "group", this.mode = "inline", this.selectionMode = "single", this.selected = null, this.initialSearchTerm = "", this.num = 10, this.arcgisSelectionChange = L();
79
179
  }
80
180
  static {
81
- this.properties = { searchTerm: 16, isSearching: 16, searchFailed: 16, searchResult: 16, popoverOpen: 16, popoverWidth: 16, portal: 0, entityType: 1, mode: 1, selected: 0, query: 1, num: 9, icon: 1, messageOverrides: 0 };
181
+ this.properties = { popoverOpen: 16, popoverWidth: 16, portal: 0, entityType: 1, mode: 1, selectionMode: 1, selected: 0, query: 1, initialSearchTerm: 1, num: 9, icon: 1, messageOverrides: 0 };
82
182
  }
83
183
  static {
84
- this.styles = O;
184
+ this.styles = K;
85
185
  }
86
186
  get searchLabel() {
87
187
  const { entityType: e, _messages: t } = this;
@@ -102,52 +202,21 @@ class F extends f {
102
202
  this.updatePopoverWidth(), !(typeof ResizeObserver > "u" || !this.inputContainerRef.value) && (this.resizeObserver = new ResizeObserver(() => this.updatePopoverWidth()), this.resizeObserver.observe(this.inputContainerRef.value));
103
203
  }
104
204
  willUpdate(e) {
105
- (e.has("portal") || e.has("entityType") || e.has("query") || e.has("num")) && this.resetSearch(), e.has("mode") && this.mode === "inline" && (this.popoverOpen = !1);
205
+ e.has("mode") && this.mode === "inline" && (this.popoverOpen = !1);
106
206
  }
107
207
  disconnectedCallback() {
108
- this.cancelPendingSearch(), this.resizeObserver?.disconnect(), this.resizeObserver = null, super.disconnectedCallback();
208
+ this.resizeObserver?.disconnect(), this.resizeObserver = null, super.disconnectedCallback();
109
209
  }
110
210
  updatePopoverWidth() {
111
211
  requestAnimationFrame(() => {
112
212
  this.popoverWidth = this.inputContainerRef.value?.offsetWidth ?? 0;
113
213
  });
114
214
  }
115
- cancelPendingSearch() {
116
- return this.debounceId !== void 0 && (window.clearTimeout(this.debounceId), this.debounceId = void 0), this.searchId += 1, this.searchId;
117
- }
118
- resetSearch() {
119
- this.cancelPendingSearch(), this.searchTerm = "", this.isSearching = !1, this.searchFailed = !1, this.searchResult = void 0, this.popoverOpen = !1;
120
- }
121
- scheduleSearch(e) {
122
- const t = e.trim(), s = this.cancelPendingSearch();
123
- if (this.searchFailed = !1, this.searchResult = void 0, !t) {
124
- this.isSearching = !1, this.popoverOpen = !1;
125
- return;
126
- }
127
- this.isSearching = !0, this.mode === "popover" && (this.popoverOpen = !0), this.debounceId = window.setTimeout(() => {
128
- this.debounceId = void 0, this.search(t, s);
129
- }, k);
130
- }
131
- async search(e, t) {
132
- const { entityType: s, num: i, portal: l, query: r } = this;
133
- try {
134
- const { error: c, result: a } = await P(l, s, e, { num: i, query: r });
135
- if (t !== this.searchId)
136
- return;
137
- this.searchFailed = !!c, this.searchResult = a;
138
- } catch {
139
- if (t !== this.searchId)
140
- return;
141
- this.searchFailed = !0, this.searchResult = void 0;
142
- } finally {
143
- t === this.searchId && (this.isSearching = !1);
144
- }
145
- }
146
215
  emitSelection(e) {
147
216
  this.arcgisSelectionChange.emit(e), this.mode === "popover" && this.togglePicker(!1);
148
217
  }
149
218
  getFocusableResults() {
150
- const e = Array.from(this.renderRoot.querySelector('slot[name="list-start"]')?.assignedElements({ flatten: !0 }) ?? []).filter((s) => s instanceof HTMLElement && (s.tagName === "CALCITE-LIST-ITEM" || s.tabIndex >= 0)), t = Array.from(this.renderRoot.querySelectorAll("calcite-list-item, arcgis-portal-group-card, arcgis-portal-item-card"));
219
+ const e = Array.from(this.renderRoot.querySelector('slot[name="list-start"]')?.assignedElements({ flatten: !0 }) ?? []).filter((i) => i instanceof HTMLElement && (i.tagName === "CALCITE-LIST-ITEM" || i.tabIndex >= 0)), t = Array.from(this.renderRoot.querySelectorAll("calcite-list-item, arcgis-portal-group-card, arcgis-portal-item-card"));
151
220
  return [...e, ...t];
152
221
  }
153
222
  async focusResult(e) {
@@ -169,79 +238,92 @@ class F extends f {
169
238
  const t = this.getFocusableResults();
170
239
  if (!t.length)
171
240
  return;
172
- const s = (e + t.length) % t.length;
173
- await this.focusResult(t[s]);
241
+ const i = (e + t.length) % t.length;
242
+ await this.focusResult(t[i]);
174
243
  }
175
244
  handleResultsKeyDown(e) {
176
- const t = this.getFocusableResults(), s = e.composedPath(), i = t.findIndex((r) => s.includes(r));
177
- if (i === -1)
245
+ if (e.defaultPrevented)
246
+ return;
247
+ const t = this.getFocusableResults(), i = e.composedPath(), o = t.findIndex((s) => i.includes(s));
248
+ if (o === -1)
178
249
  return;
179
250
  if (this.mode === "inline" && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
180
- e.preventDefault(), this.focusResultAt(i + (e.key === "ArrowDown" ? 1 : -1));
251
+ e.preventDefault(), this.focusResultAt(o + (e.key === "ArrowDown" ? 1 : -1));
181
252
  return;
182
253
  }
183
- const l = t[i];
184
- if (l.tagName === "ARCGIS-PORTAL-GROUP-CARD" && (e.key === "Enter" || e.key === " ")) {
254
+ const r = t[o];
255
+ if (r.tagName === "ARCGIS-PORTAL-GROUP-CARD" && (e.key === "Enter" || e.key === " ")) {
185
256
  e.preventDefault();
186
- const { group: r } = l;
187
- this.emitSelection({ entityType: "group", entity: r });
257
+ const { group: s } = r;
258
+ this.emitSelection({ entityType: "group", entity: s });
188
259
  return;
189
260
  }
190
- if (l.tagName === "ARCGIS-PORTAL-ITEM-CARD" && (e.key === "Enter" || e.key === " ")) {
261
+ if (r.tagName === "ARCGIS-PORTAL-ITEM-CARD" && (e.key === "Enter" || e.key === " ")) {
191
262
  e.preventDefault();
192
- const { item: r } = l;
193
- this.emitSelection({ entityType: "item", entity: r });
263
+ const { item: s } = r;
264
+ this.emitSelection({ entityType: "item", entity: s });
194
265
  }
195
266
  }
267
+ renderScopeSelector() {
268
+ const { entityType: e, portal: t, _messages: i } = this, { scope: o } = this.searchController, r = R(t, e);
269
+ return r.length <= 1 ? null : p`<calcite-select .label=${i.searchIn} scale=m @calciteSelectChange=${(s) => {
270
+ const c = r.find((l) => l === s.target.value);
271
+ c && this.searchController.setScope(c);
272
+ }}>${r.map((s) => p`<calcite-option .selected=${s === o} .value=${s}>${s === "all" ? e === "item" ? i.allContent : i.allGroups : i[s]}</calcite-option>`)}</calcite-select>`;
273
+ }
196
274
  renderGroup(e) {
197
- return h(e.id, n`<calcite-list-item .label=${e.title || e.id || ""} .description=${[e.owner, e.access].filter(Boolean).join(" · ")} .selected=${this.selected?.entityType === "group" && this.selected.entity.id === e.id} @calciteListItemSelect=${() => this.emitSelection({ entityType: "group", entity: e })}><calcite-avatar slot=content-start .fullName=${e.title ?? void 0} .thumbnail=${e.thumbnailUrl ?? void 0} scale=m></calcite-avatar></calcite-list-item>`);
275
+ return y(e.id, p`<calcite-list-item .label=${e.title || e.id || ""} .description=${[e.owner, e.access].filter(Boolean).join(" · ")} .selected=${this.selected?.entityType === "group" && this.selected.entity.id === e.id} @calciteListItemSelect=${() => this.emitSelection({ entityType: "group", entity: e })}><calcite-avatar slot=content-start .fullName=${e.title ?? void 0} .thumbnail=${e.thumbnailUrl ?? void 0} scale=m></calcite-avatar></calcite-list-item>`);
198
276
  }
199
277
  renderInlineGroup(e) {
200
- return h(e.id, n`<arcgis-portal-group-card .group=${e} .portal=${this.portal} .selected=${this.selected?.entityType === "group" && this.selected.entity.id === e.id} selection=none show-summary .user=${this.portal.user ?? void 0} view=compact></arcgis-portal-group-card>`);
278
+ return y(e.id, p`<arcgis-portal-group-card .group=${e} .portal=${this.portal} .preview=${this.selectionMode === "none" ? "top" : void 0} .selected=${this.selected?.entityType === "group" && this.selected.entity.id === e.id} .selection=${this.selectionMode} @arcgisGroupBrowserCardPreview=${() => this.emitSelection({ entityType: "group", entity: e })} @arcgisGroupCardSelect=${({ detail: t }) => {
279
+ t.selected && this.emitSelection({ entityType: "group", entity: t.group });
280
+ }} .user=${this.portal.user ?? void 0} view=compact></arcgis-portal-group-card>`);
201
281
  }
202
282
  renderItem(e) {
203
- return h(e.id, n`<calcite-list-item .label=${e.title || e.id || ""} .description=${[e.type, e.owner].filter(Boolean).join(" · ")} .selected=${this.selected?.entityType === "item" && this.selected.entity.id === e.id} @calciteListItemSelect=${() => this.emitSelection({ entityType: "item", entity: e })}><calcite-avatar slot=content-start .fullName=${e.title ?? void 0} .thumbnail=${e.thumbnailUrl ?? void 0} scale=m></calcite-avatar></calcite-list-item>`);
283
+ return y(e.id, p`<calcite-list-item .label=${e.title || e.id || ""} .description=${[e.type, e.owner].filter(Boolean).join(" · ")} .selected=${this.selected?.entityType === "item" && this.selected.entity.id === e.id} @calciteListItemSelect=${() => this.emitSelection({ entityType: "item", entity: e })}><calcite-avatar slot=content-start .fullName=${e.title ?? void 0} .thumbnail=${e.thumbnailUrl ?? void 0} scale=m></calcite-avatar></calcite-list-item>`);
204
284
  }
205
285
  renderInlineItem(e) {
206
- return h(e.id, n`<arcgis-portal-item-card .item=${e} .portal=${this.portal} .selected=${this.selected?.entityType === "item" && this.selected.entity.id === e.id} selection=none show-summary .user=${this.portal.user ?? void 0} view=list></arcgis-portal-item-card>`);
286
+ return y(e.id, p`<arcgis-portal-item-card .item=${e} .portal=${this.portal} .preview=${this.selectionMode === "none" ? "top" : void 0} .selected=${this.selected?.entityType === "item" && this.selected.entity.id === e.id} .selection=${this.selectionMode} @arcgisItemBrowserCardPreview=${() => this.emitSelection({ entityType: "item", entity: e })} @arcgisItemCardSelect=${({ detail: t }) => {
287
+ t.selected && this.emitSelection({ entityType: "item", entity: t.item });
288
+ }} .user=${this.portal.user ?? void 0} view=list></arcgis-portal-item-card>`);
207
289
  }
208
290
  renderUser(e) {
209
- return h(e.username, n`<calcite-list-item .label=${e.fullName || e.username} .description=${e.username} .selected=${this.selected?.entityType === "user" && this.selected.entity.username === e.username} @calciteListItemSelect=${() => this.emitSelection({ entityType: "user", entity: e })}><arcgis-portal-user-avatar slot=content-start .portal=${this.portal} .user=${e} scale=m></arcgis-portal-user-avatar></calcite-list-item>`);
291
+ return y(e.username, p`<calcite-list-item .label=${e.fullName || e.username} .description=${e.username} .selected=${this.selected?.entityType === "user" && this.selected.entity.username === e.username} @calciteListItemSelect=${() => this.emitSelection({ entityType: "user", entity: e })}><arcgis-portal-user-avatar slot=content-start .portal=${this.portal} .user=${e} scale=m></arcgis-portal-user-avatar></calcite-list-item>`);
210
292
  }
211
293
  renderSearchResults() {
212
- const { entityType: e, isSearching: t, searchFailed: s, searchResult: i, searchTerm: l, _messages: r } = this;
213
- if (!l.trim())
294
+ const { entityType: e, _messages: t } = this, { isSearching: i, searchFailed: o, searchResult: r, searchTerm: s } = this.searchController;
295
+ if (!s.trim())
214
296
  return null;
215
- if (t)
216
- return n`<div role=status><calcite-loader .label=${r.searching} scale=s></calcite-loader></div>`;
217
- if (s)
218
- return n`<p class="entity-picker__status" role=alert>${r.searchFailed}</p>`;
219
- if (!(i?.result.results ?? []).length) {
220
- const a = e === "group" ? r.noGroupsFound : e === "item" ? r.noItemsFound : r.noUsersFound;
221
- return n`<p class="entity-picker__status" role=status>${a}</p>`;
297
+ if (i)
298
+ return p`<div role=status><calcite-loader .label=${t.searching} scale=s></calcite-loader></div>`;
299
+ if (o)
300
+ return p`<p class="entity-picker__status" role=alert>${t.searchFailed}</p>`;
301
+ if (!(r?.result.results ?? []).length) {
302
+ const l = e === "group" ? t.noGroupsFound : e === "item" ? t.noItemsFound : t.noUsersFound;
303
+ return p`<p class="entity-picker__status" role=status>${l}</p>`;
222
304
  }
223
- return this.mode === "inline" && i?.entityType === "group" ? n`<div class="entity-picker__cards"><slot name=list-start></slot>${i.result.results.map((a) => this.renderInlineGroup(a))}</div>` : this.mode === "inline" && i?.entityType === "item" ? n`<div class="entity-picker__cards"><slot name=list-start></slot>${i.result.results.map((a) => this.renderInlineItem(a))}</div>` : n`<calcite-list interaction-mode=interactive .label=${this.searchLabel} selection-mode=none><slot name=list-start></slot>${i?.entityType === "group" ? i.result.results.map((a) => this.renderGroup(a)) : i?.entityType === "item" ? i.result.results.map((a) => this.renderItem(a)) : i?.result.results.map((a) => this.renderUser(a))}</calcite-list>`;
305
+ return this.mode === "inline" && r?.entityType === "group" ? p`<div class="entity-picker__cards"><slot name=list-start></slot>${r.result.results.map((l) => this.renderInlineGroup(l))}</div>` : this.mode === "inline" && r?.entityType === "item" ? p`<div class="entity-picker__cards"><slot name=list-start></slot>${r.result.results.map((l) => this.renderInlineItem(l))}</div>` : p`<calcite-list interaction-mode=interactive .label=${this.searchLabel} .selectionMode=${this.mode === "inline" && this.selectionMode === "single" ? "single-persist" : "none"}><slot name=list-start></slot>${r?.entityType === "group" ? r.result.results.map((l) => this.renderGroup(l)) : r?.entityType === "item" ? r.result.results.map((l) => this.renderItem(l)) : r?.result.results.map((l) => this.renderUser(l))}</calcite-list>`;
224
306
  }
225
307
  renderPicker(e = !0) {
226
- return n`<div class="entity-picker">${this.selectedLabel && n`<div class="entity-picker__selection"><span class="entity-picker__selection-label">${this.selectedLabel}</span><calcite-button appearance=transparent icon-start=x kind=neutral .label=${this._messages.clearSelection} @click=${() => this.arcgisSelectionChange.emit(null)} scale=s></calcite-button></div>` || ""}<div class="entity-picker__input" ${d(this.inputContainerRef)}><calcite-input .icon=${this.icon} .label=${this.searchLabel} .placeholder=${this.searchLabel} .value=${this.searchTerm} @click=${() => {
227
- this.mode === "popover" && this.searchTerm.trim() && (this.popoverOpen = !0);
308
+ return p`<div class="entity-picker">${this.selectedLabel && p`<div class="entity-picker__selection"><span class="entity-picker__selection-label">${this.selectedLabel}</span><calcite-button appearance=transparent icon-start=x kind=neutral .label=${this._messages.clearSelection} @click=${() => this.arcgisSelectionChange.emit(null)} scale=s></calcite-button></div>` || ""}${this.renderScopeSelector()}<div class="entity-picker__input" ${b(this.inputContainerRef)}><calcite-input .icon=${this.icon} .clearable=${this.mode === "inline"} .label=${this.searchLabel} .placeholder=${this.searchLabel} .value=${this.searchController.searchTerm} @click=${() => {
309
+ this.mode === "popover" && this.searchController.searchTerm.trim() && (this.popoverOpen = !0);
228
310
  }} @keydown=${(t) => {
229
- (t.key === "ArrowDown" || t.key === "ArrowUp") && this.searchResult?.result.results.length && (t.preventDefault(), this.focusResultAt(t.key === "ArrowDown" ? 0 : -1));
311
+ (t.key === "ArrowDown" || t.key === "ArrowUp") && this.searchController.searchResult?.result.results.length && (t.preventDefault(), this.focusResultAt(t.key === "ArrowDown" ? 0 : -1));
230
312
  }} @focus=${() => {
231
- this.mode === "popover" && this.searchTerm.trim() && (this.popoverOpen = !0);
313
+ this.mode === "popover" && this.searchController.searchTerm.trim() && (this.popoverOpen = !0);
232
314
  }} @calciteInputInput=${(t) => {
233
- this.searchTerm = t.target.value, this.scheduleSearch(this.searchTerm);
234
- }} ${d(this.inputRef)}></calcite-input></div>${e && n`<div class="entity-picker__results" @keydown=${this.handleResultsKeyDown}>${this.renderSearchResults()}</div>` || ""}</div>`;
315
+ this.searchController.setSearchTerm(t.target.value);
316
+ }} ${b(this.inputRef)}></calcite-input></div>${e && p`<div class="entity-picker__results" @keydown=${this.handleResultsKeyDown}>${this.renderSearchResults()}</div>` || ""}</div>`;
235
317
  }
236
318
  render() {
237
- return this.mode === "inline" ? this.renderPicker() : n`${this.renderPicker(!1)}<calcite-popover .label=${this.searchLabel} .open=${this.popoverOpen} placement=bottom-start .referenceElement=${this.inputContainerRef.value} trigger-disabled @calcitePopoverClose=${(e) => {
319
+ return this.mode === "inline" ? this.renderPicker() : p`${this.renderPicker(!1)}<calcite-popover .label=${this.searchLabel} .open=${this.popoverOpen} placement=bottom-start .referenceElement=${this.inputContainerRef.value} trigger-disabled @calcitePopoverClose=${(e) => {
238
320
  !e.target.open && this.popoverOpen && (this.popoverOpen = !1, requestAnimationFrame(() => {
239
321
  this.setFocus();
240
322
  }));
241
- }}><div class="entity-picker__results" style=${g({ inlineSize: this.popoverWidth ? `${this.popoverWidth}px` : void 0 })}>${this.renderSearchResults()}</div></calcite-popover>`;
323
+ }}><div class="entity-picker__results" style=${E({ inlineSize: this.popoverWidth ? `${this.popoverWidth}px` : void 0 })}>${this.renderSearchResults()}</div></calcite-popover>`;
242
324
  }
243
325
  }
244
- m("arcgis-portal-entity-picker", F);
326
+ P("arcgis-portal-entity-picker", V);
245
327
  export {
246
- F as ArcgisPortalEntityPicker
328
+ V as ArcgisPortalEntityPicker
247
329
  };
@@ -1,3 +1,5 @@
1
+ import "@esri/calcite-components/components/calcite-select";
2
+ import "@esri/calcite-components/components/calcite-option";
1
3
  import "@esri/calcite-components/components/calcite-list-item";
2
4
  import "@esri/calcite-components/components/calcite-avatar";
3
5
  import "../arcgis-portal-group-card/index.js";