@arcgis/portal-components 6.0.0-next.3 → 6.0.0-next.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/234TH32X.js +106 -0
- package/dist/cdn/{Z6R3C4AK.js → 2W3O3KBH.js} +1 -1
- package/dist/cdn/2XRZP4QI.js +2 -0
- package/dist/cdn/365ICWHN.js +2 -0
- package/dist/cdn/{RHCRPJWS.js → 47EZWWY7.js} +1 -1
- package/dist/cdn/4PL5CXXD.js +2 -0
- package/dist/cdn/4QYVBXZT.js +2 -0
- package/dist/cdn/{K75JTQPW.js → 4VLEUN7I.js} +1 -1
- package/dist/cdn/{JPUUMGX5.js → 4XFXM76G.js} +1 -1
- package/dist/cdn/5BVGWSPJ.js +2 -0
- package/dist/cdn/{2TDHJSMP.js → 5MZ64QM7.js} +1 -1
- package/dist/cdn/{K2XSYDAP.js → 657KMT6Y.js} +1 -1
- package/dist/cdn/{JWBUJT43.js → 6P7WYZZS.js} +1 -1
- package/dist/cdn/76IANSI7.js +2 -0
- package/dist/cdn/7DBQRL5U.js +2 -0
- package/dist/cdn/{MKSFNVXL.js → 7ECLKNGV.js} +1 -1
- package/dist/cdn/7HNMTPSD.js +2 -0
- package/dist/cdn/AEJPC2Q5.js +2 -0
- package/dist/cdn/AHJDGTDG.js +2 -0
- package/dist/cdn/{D2YQWKME.js → ASID6YW7.js} +2 -2
- package/dist/cdn/{IN4JPZTY.js → BDMPW4YT.js} +1 -1
- package/dist/cdn/{NWVLGU2C.js → BNDM7DRY.js} +1 -1
- package/dist/cdn/BPFX6I6Z.js +2 -0
- package/dist/cdn/{SGDDFWCJ.js → CB3UEA5V.js} +1 -1
- package/dist/cdn/CFNR4XS2.js +91 -0
- package/dist/cdn/CHJAALGF.js +2 -0
- package/dist/cdn/{JE2376SE.js → COET6FWR.js} +1 -1
- package/dist/cdn/DOU2QZP5.js +2 -0
- package/dist/cdn/{QTAYXO5T.js → DSJOBYW5.js} +1 -1
- package/dist/cdn/EQZYUMUN.js +2 -0
- package/dist/cdn/{TRMFL7PT.js → ESKKH4DE.js} +1 -1
- package/dist/cdn/EY37MGL2.js +2 -0
- package/dist/cdn/{DDBXEXOV.js → F5T3DTCW.js} +1 -1
- package/dist/cdn/FCGMSMBW.js +2 -0
- package/dist/cdn/FGRMURKX.js +2 -0
- package/dist/cdn/FICE62PO.js +2 -0
- package/dist/cdn/FN2QMDEW.js +2 -0
- package/dist/cdn/GJP72ONW.js +2 -0
- package/dist/cdn/GQTAE72S.js +2 -0
- package/dist/cdn/{M5PPX4ZX.js → GRQLUOSD.js} +1 -1
- package/dist/cdn/{EY5S6ICQ.js → GW6SI25C.js} +1 -1
- package/dist/cdn/H6OQOEHS.js +2 -0
- package/dist/cdn/{I6IRHXWR.js → HH5DBWJ2.js} +1 -1
- package/dist/cdn/HNVQMOOU.js +2 -0
- package/dist/cdn/IMFTTYIV.js +2 -0
- package/dist/cdn/{J5NPDIZM.js → ITGOCCZZ.js} +1 -1
- package/dist/cdn/{GAF4YT5N.js → IUIFCQQU.js} +1 -1
- package/dist/cdn/JD6QT6IC.js +2 -0
- package/dist/cdn/JTSFNRWR.js +2 -0
- package/dist/cdn/K3GAZFRI.js +63 -0
- package/dist/cdn/K6NEES4K.js +2 -0
- package/dist/cdn/K6YTIB74.js +2 -0
- package/dist/cdn/KRORL7QC.js +2 -0
- package/dist/cdn/{TXC7YBGL.js → KWZIYNDC.js} +1 -1
- package/dist/cdn/{3NSHGKZA.js → L2P23REA.js} +1 -1
- package/dist/cdn/L3A3L7FY.js +2 -0
- package/dist/cdn/L3JSQQUK.js +2 -0
- package/dist/cdn/LGRW3SGR.js +2 -0
- package/dist/cdn/MDOMTVQY.js +2 -0
- package/dist/cdn/{YZTBAUIO.js → MDYX3ON3.js} +1 -1
- package/dist/cdn/{AXOBMX3S.js → MLTZSPZQ.js} +1 -1
- package/dist/cdn/MSOJ4BDB.js +2 -0
- package/dist/cdn/MSSJRDR7.js +2 -0
- package/dist/cdn/NHVPNSNH.js +2 -0
- package/dist/cdn/{JN23JH3T.js → NK474LV6.js} +1 -1
- package/dist/cdn/{24QSQLRY.js → NNILBERZ.js} +1 -1
- package/dist/cdn/NO5VHQVY.js +2 -0
- package/dist/cdn/{VNU4QX7M.js → NQ2IAQKL.js} +17 -17
- package/dist/cdn/{7LMZHJZG.js → NYOXMT6S.js} +1 -1
- package/dist/cdn/{OR6T5SB3.js → O2H6SPV3.js} +1 -1
- package/dist/cdn/O4YFPGD5.js +2 -0
- package/dist/cdn/OHAQPQAP.js +2 -0
- package/dist/cdn/OHEJPZ35.js +2 -0
- package/dist/cdn/OQ2JULON.js +2 -0
- package/dist/cdn/OUFJRLPQ.js +4 -0
- package/dist/cdn/OW67EEOH.js +2 -0
- package/dist/cdn/P4XDOAK2.js +2 -0
- package/dist/cdn/PU7NVVTN.js +2 -0
- package/dist/cdn/{CFRJU6VA.js → QE64NUUD.js} +1 -1
- package/dist/cdn/R3IQ7OYN.js +70 -0
- package/dist/cdn/R5LNWMD4.js +2 -0
- package/dist/cdn/RT26JZP5.js +2 -0
- package/dist/cdn/{TWCJJCPC.js → S4Y7FPSQ.js} +1 -1
- package/dist/cdn/SCZ2GY3E.js +2 -0
- package/dist/cdn/{URQML7KV.js → SF7P7MND.js} +1 -1
- package/dist/cdn/SRWFOV5W.js +2 -0
- package/dist/cdn/{74T6IXSN.js → TABWX4F2.js} +1 -1
- package/dist/cdn/{ROX3GKKA.js → TIPQ2ZWK.js} +1 -1
- package/dist/cdn/TOVMYLXB.js +2 -0
- package/dist/cdn/TP5IFB74.js +2 -0
- package/dist/cdn/TRPOPI34.js +2 -0
- package/dist/cdn/ULGME5RT.js +2 -0
- package/dist/cdn/UOY4FZLR.js +2 -0
- package/dist/cdn/{DHMNNIXZ.js → UPVGSEFX.js} +1 -1
- package/dist/cdn/{JIJO4CAS.js → VZPUDARW.js} +1 -1
- package/dist/cdn/W2MFAJEG.js +2 -0
- package/dist/cdn/W5AV2JMK.js +2 -0
- package/dist/cdn/WFPUAEJQ.js +3 -0
- package/dist/cdn/{7ZWYUHGK.js → WQOCWSJC.js} +1 -1
- package/dist/cdn/WRP5SUB4.js +2 -0
- package/dist/cdn/{2YZWRFCI.js → WUPQROF4.js} +1 -1
- package/dist/cdn/X4EHFUD4.js +2 -0
- package/dist/cdn/XLR4JEUA.js +2 -0
- package/dist/cdn/{ZKZDKJ6D.js → XMFA6QY6.js} +1 -1
- package/dist/cdn/XX6BL3DR.js +2 -0
- package/dist/cdn/YF4HTCBB.js +2 -0
- package/dist/cdn/{5HZNBMW6.js → YG5ZZUE4.js} +1 -1
- package/dist/cdn/YKFYCIOS.js +2 -0
- package/dist/cdn/YMVVEC2R.js +2 -0
- package/dist/cdn/{BKD7JSV2.js → YWWBQUH2.js} +1 -1
- package/dist/cdn/Z55T6COF.js +2 -0
- package/dist/cdn/Z7DRFGQ6.js +2 -0
- package/dist/cdn/ZJQ55GQG.js +2 -0
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/portal-entity-picker/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/portal-item-card-sublayer-select/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-item-share-summary/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/fieldAddDelete.js +7 -7
- package/dist/chunks/functionalities.js +14 -9
- package/dist/chunks/groups.js +8 -61
- package/dist/chunks/groups2.js +23 -8
- package/dist/chunks/info.js +2 -2
- package/dist/chunks/item.js +131 -33
- package/dist/chunks/item2.js +63 -125
- package/dist/chunks/itemThumbnail.js +21 -21
- package/dist/chunks/loadClassificationData.js +26 -27
- package/dist/chunks/portal-delete-items-review.js +1 -1
- package/dist/chunks/portal-item-badge.js +1 -1
- package/dist/chunks/portal-related-items-list-item.js +1 -1
- package/dist/chunks/portal.js +6 -6
- package/dist/chunks/portal2.js +11 -11
- package/dist/chunks/portalEntitySelection.js +61 -0
- package/dist/chunks/query.js +13 -13
- package/dist/chunks/request.js +49 -41
- package/dist/chunks/requests.js +7 -7
- package/dist/chunks/selectedMentions.js +25 -0
- package/dist/chunks/services.js +1 -1
- package/dist/chunks/string.js +19 -11
- package/dist/chunks/ui.js +1 -0
- package/dist/chunks/url.js +2 -2
- package/dist/chunks/user.js +67 -53
- package/dist/chunks/utils.js +35 -22
- package/dist/chunks/utils2.js +4 -4
- package/dist/chunks/utils3.js +88 -657
- package/dist/chunks/utils4.js +664 -0
- package/dist/components/arcgis-portal-account-switcher/customElement.js +57 -54
- package/dist/components/arcgis-portal-add-gps-metadata/customElement.d.ts +27 -0
- package/dist/components/arcgis-portal-add-gps-metadata/customElement.js +185 -137
- package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +26 -17
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +546 -2655
- package/dist/components/arcgis-portal-ai-assistant/index.js +4 -0
- package/dist/components/arcgis-portal-ai-assistant/tools/getItemTool.d.ts +11 -0
- package/dist/components/arcgis-portal-ai-assistant/tools/groups.d.ts +28 -0
- package/dist/components/arcgis-portal-ai-assistant/tools/users.d.ts +28 -0
- package/dist/components/arcgis-portal-ai-assistant/types/assistantTools.d.ts +8 -1
- package/dist/components/arcgis-portal-ai-assistant/types/portalEntityTools.d.ts +19 -0
- package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.d.ts +39 -0
- package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.js +67 -27
- package/dist/components/arcgis-portal-ai-assistant-interrupt/index.js +3 -1
- package/dist/components/arcgis-portal-classification-banner/customElement.js +2 -2
- package/dist/components/arcgis-portal-classification-config/customElement.js +2 -2
- package/dist/components/arcgis-portal-classification-favorite/customElement.js +2 -2
- package/dist/components/arcgis-portal-classification-form-element/customElement.js +1 -1
- package/dist/components/arcgis-portal-delete-items/customElement.d.ts +69 -3
- package/dist/components/arcgis-portal-delete-items/customElement.js +446 -330
- package/dist/components/arcgis-portal-delete-items/index.js +1 -2
- package/dist/components/arcgis-portal-delete-items/types.d.ts +1 -0
- package/dist/components/arcgis-portal-entity-picker/customElement.d.ts +51 -5
- package/dist/components/arcgis-portal-entity-picker/customElement.js +204 -119
- package/dist/components/arcgis-portal-entity-picker/index.js +2 -0
- package/dist/components/arcgis-portal-field-delete/customElement.js +34 -32
- package/dist/components/arcgis-portal-field-delete/index.js +1 -1
- package/dist/components/arcgis-portal-group-badges/customElement.js +5 -5
- package/dist/components/arcgis-portal-group-browser/customElement.js +93 -99
- package/dist/components/arcgis-portal-group-browser/types.d.ts +3 -7
- package/dist/components/arcgis-portal-group-browser-preview/customElement.js +14 -14
- package/dist/components/arcgis-portal-group-browser-preview-card/customElement.js +1 -4
- package/dist/components/arcgis-portal-group-card/customElement.js +16 -16
- package/dist/components/arcgis-portal-group-thumbnail/customElement.js +1 -1
- package/dist/components/arcgis-portal-item-card/customElement.d.ts +26 -10
- package/dist/components/arcgis-portal-item-card/customElement.js +90 -80
- package/dist/components/arcgis-portal-item-card/index.js +2 -1
- package/dist/components/arcgis-portal-item-card-sublayer-select/customElement.d.ts +102 -0
- package/dist/components/arcgis-portal-item-card-sublayer-select/customElement.js +352 -0
- package/dist/components/arcgis-portal-item-card-sublayer-select/index.d.ts +1 -0
- package/dist/components/arcgis-portal-item-card-sublayer-select/index.js +8 -0
- package/dist/components/arcgis-portal-item-card-sublayer-select/types.d.ts +22 -0
- package/dist/components/arcgis-portal-item-share-summary/customElement.d.ts +113 -0
- package/dist/components/arcgis-portal-item-share-summary/customElement.js +172 -0
- package/dist/components/arcgis-portal-item-share-summary/index.d.ts +1 -0
- package/dist/components/arcgis-portal-item-share-summary/index.js +5 -0
- package/dist/components/arcgis-portal-item-share-summary-editable/customElement.d.ts +33 -0
- package/dist/components/arcgis-portal-item-share-summary-editable/customElement.js +19 -0
- package/dist/components/arcgis-portal-item-share-summary-editable/index.d.ts +1 -0
- package/dist/components/arcgis-portal-item-share-summary-editable/index.js +2 -0
- package/dist/components/arcgis-portal-item-thumbnail/customElement.d.ts +1 -0
- package/dist/components/arcgis-portal-item-thumbnail/customElement.js +14 -14
- package/dist/components/arcgis-portal-item-type/customElement.js +1 -1
- package/dist/components/arcgis-portal-mentionable-text-area/customElement.js +61 -57
- package/dist/components/arcgis-portal-navigation/customElement.js +7 -8
- package/dist/components/arcgis-portal-navigation/index.js +4 -4
- package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +8 -8
- package/dist/components/arcgis-portal-review-related-items/customElement.d.ts +333 -0
- package/dist/components/arcgis-portal-review-related-items/customElement.js +46 -18
- package/dist/components/arcgis-portal-review-related-items/index.js +2 -0
- package/dist/components/arcgis-portal-sublayer-type/customElement.js +13 -103
- package/dist/components/arcgis-portal-user-popup/customElement.d.ts +1 -1
- package/dist/components/arcgis-portal-user-popup/customElement.js +17 -16
- package/dist/components/portal-group-browser-filters/customElement.js +15 -15
- package/dist/components/portal-related-items-list-item/customElement.js +16 -14
- package/dist/components/portal-related-items-list-item/index.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +31 -0
- package/dist/index.js +300 -6
- package/dist/loader.js +13 -10
- package/dist/services/group.d.ts +17 -0
- package/dist/services/groups.d.ts +9 -0
- package/dist/services/item.d.ts +9 -0
- package/dist/types/item.d.ts +11 -11
- package/dist/types/lumina.d.ts +31 -11
- package/dist/types/portalAssistantCurrentContext.d.ts +9 -0
- package/dist/types/portalEntityPicker.d.ts +3 -0
- package/dist/types/preact.d.ts +34 -11
- package/dist/types/react.d.ts +37 -11
- package/dist/types/services.d.ts +27 -1
- package/dist/types/stencil.d.ts +31 -11
- package/dist/utils/generateEmbeddings.d.ts +7 -0
- package/dist/utils/semanticSearch.d.ts +60 -0
- package/dist/utils/types.d.ts +10 -0
- package/package.json +10 -10
- package/dist/cdn/23NXHNPU.js +0 -2
- package/dist/cdn/2CN754CY.js +0 -2
- package/dist/cdn/2FQKDFEE.js +0 -2
- package/dist/cdn/2MPQ5IWJ.js +0 -2
- package/dist/cdn/3CQKCUM5.js +0 -2
- package/dist/cdn/3EYB5GQX.js +0 -2
- package/dist/cdn/3FSPL34I.js +0 -170
- package/dist/cdn/3LEQ37YT.js +0 -68
- package/dist/cdn/4MUB6TL6.js +0 -2
- package/dist/cdn/4PRXQFCV.js +0 -2
- package/dist/cdn/4QFTKB6T.js +0 -2
- package/dist/cdn/4TSXFX3M.js +0 -2
- package/dist/cdn/5C5GHX4D.js +0 -2
- package/dist/cdn/A2SQ4EMZ.js +0 -2
- package/dist/cdn/AICPYLWE.js +0 -4
- package/dist/cdn/AZOJHVAO.js +0 -2
- package/dist/cdn/BYHX3UWV.js +0 -2
- package/dist/cdn/CD5UWSCP.js +0 -2
- package/dist/cdn/DLI4XKJ3.js +0 -2
- package/dist/cdn/DYO5P3F2.js +0 -2
- package/dist/cdn/E66BDC6N.js +0 -2
- package/dist/cdn/EEAVX4PP.js +0 -2
- package/dist/cdn/EMJQI4MA.js +0 -2
- package/dist/cdn/FIBQAMJ3.js +0 -2
- package/dist/cdn/FIQZPIIK.js +0 -2
- package/dist/cdn/FNLBJ4ZQ.js +0 -2
- package/dist/cdn/FRE56NBG.js +0 -2
- package/dist/cdn/GSOBDGLK.js +0 -2
- package/dist/cdn/GXM3XY3J.js +0 -2
- package/dist/cdn/HCNTXLUT.js +0 -2
- package/dist/cdn/I273CANO.js +0 -2
- package/dist/cdn/I6NVKNZJ.js +0 -2
- package/dist/cdn/J5FKIZAM.js +0 -2
- package/dist/cdn/JOUR2FB2.js +0 -3
- package/dist/cdn/LISDTBEX.js +0 -2
- package/dist/cdn/LYLQCBVX.js +0 -2
- package/dist/cdn/MQK63FV7.js +0 -2
- package/dist/cdn/N4VOTJ25.js +0 -2
- package/dist/cdn/N5QLV56W.js +0 -2
- package/dist/cdn/OD5WXP7J.js +0 -2
- package/dist/cdn/OXPXXIWL.js +0 -2
- package/dist/cdn/PMRFXB4F.js +0 -2
- package/dist/cdn/PNIFJ5DQ.js +0 -2
- package/dist/cdn/PZDI5ZDC.js +0 -2
- package/dist/cdn/QROXYP6V.js +0 -2
- package/dist/cdn/QUOLQGKP.js +0 -2
- package/dist/cdn/QWHGLE3O.js +0 -2
- package/dist/cdn/R3PK7XOP.js +0 -2
- package/dist/cdn/REM3KCX6.js +0 -2
- package/dist/cdn/RNWICLRH.js +0 -2
- package/dist/cdn/RQYNPDN3.js +0 -2
- package/dist/cdn/S6F7U36E.js +0 -400
- package/dist/cdn/SMX2LEJB.js +0 -2
- package/dist/cdn/SVROAT3Z.js +0 -2
- package/dist/cdn/TBZXKKGP.js +0 -2
- package/dist/cdn/TNUCSWBN.js +0 -2
- package/dist/cdn/TOICLGFK.js +0 -2
- package/dist/cdn/TOTWYGB3.js +0 -2
- package/dist/cdn/TUUUK3VX.js +0 -2
- package/dist/cdn/U3KMGSVH.js +0 -2
- package/dist/cdn/UEP2NYJK.js +0 -2
- package/dist/cdn/UZP4YMTE.js +0 -2
- package/dist/cdn/XYMBRPC7.js +0 -2
- package/dist/cdn/YB3DR4VO.js +0 -2
- package/dist/cdn/YYTEJVBL.js +0 -2
- package/dist/cdn/Z3HGPBOR.js +0 -2
- package/dist/cdn/ZDDN7UKS.js +0 -2
- package/dist/cdn/ZXNF77OB.js +0 -2
- package/dist/chunks/functional.js +0 -9
- package/dist/components/arcgis-portal-ai-assistant/data/capability-registries/types.d.ts +0 -45
- /package/dist/cdn/{OUMTV5H5.js → KHKREBVZ.js} +0 -0
- /package/dist/cdn/{GGDOGNH4.js → U2HTYOBB.js} +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;
|
|
@@ -1,36 +1,51 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type Portal from "@arcgis/core/portal/Portal.js";
|
|
3
3
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
4
|
-
import type { PortalEntityPickerEntityType, PortalEntityPickerMode, PortalEntityPickerSelection } from "../../types/portalEntityPicker.js";
|
|
4
|
+
import type { PortalEntityPickerEntityType, PortalEntityPickerMode, PortalEntityPickerScope, PortalEntityPickerSelection } from "../../types/portalEntityPicker.js";
|
|
5
5
|
import type { ArcgisPortalItemCard } from "../arcgis-portal-item-card/customElement.js";
|
|
6
6
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
7
7
|
import type { Icon as Icon } from "@esri/calcite-components/components/calcite-icon";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Search for and select an item, group, or organization member from a portal.
|
|
11
|
+
* Item and group searches default to all accessible content; user searches are organization-only.
|
|
12
|
+
* Query and scope constraints narrow candidates but do not verify operation-specific eligibility.
|
|
13
|
+
* Changes to the signed-in account on an existing portal instance are not observed.
|
|
11
14
|
*
|
|
12
15
|
* @slot [list-start] - Content displayed before the search results.
|
|
13
16
|
*/
|
|
14
17
|
export abstract class ArcgisPortalEntityPicker extends LitElement {
|
|
15
18
|
/** @internal */
|
|
16
19
|
protected _messages: {
|
|
20
|
+
allContent: string;
|
|
21
|
+
allGroups: string;
|
|
17
22
|
clearSelection: string;
|
|
23
|
+
myContent: string;
|
|
24
|
+
myGroups: string;
|
|
25
|
+
myOrganization: string;
|
|
18
26
|
noGroupsFound: string;
|
|
19
27
|
noItemsFound: string;
|
|
20
28
|
noUsersFound: string;
|
|
21
29
|
searchFailed: string;
|
|
22
30
|
searchGroups: string;
|
|
23
31
|
searchItems: string;
|
|
32
|
+
searchIn: string;
|
|
24
33
|
searchUsers: string;
|
|
25
34
|
searching: string;
|
|
26
35
|
} & T9nMeta<{
|
|
36
|
+
allContent: string;
|
|
37
|
+
allGroups: string;
|
|
27
38
|
clearSelection: string;
|
|
39
|
+
myContent: string;
|
|
40
|
+
myGroups: string;
|
|
41
|
+
myOrganization: string;
|
|
28
42
|
noGroupsFound: string;
|
|
29
43
|
noItemsFound: string;
|
|
30
44
|
noUsersFound: string;
|
|
31
45
|
searchFailed: string;
|
|
32
46
|
searchGroups: string;
|
|
33
47
|
searchItems: string;
|
|
48
|
+
searchIn: string;
|
|
34
49
|
searchUsers: string;
|
|
35
50
|
searching: string;
|
|
36
51
|
}>;
|
|
@@ -42,15 +57,34 @@ export abstract class ArcgisPortalEntityPicker extends LitElement {
|
|
|
42
57
|
accessor entityType: PortalEntityPickerEntityType;
|
|
43
58
|
/** The icon displayed in the search input. */
|
|
44
59
|
accessor icon: Icon["icon"] | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Initial search bucket, restored when the portal, entity type, or bucket settings change.
|
|
62
|
+
* Unavailable scopes show an error. User searches support only `all` (organization members).
|
|
63
|
+
*
|
|
64
|
+
* @default "all"
|
|
65
|
+
*/
|
|
66
|
+
accessor initialScope: PortalEntityPickerScope;
|
|
67
|
+
/**
|
|
68
|
+
* Initial search text. Changing this value resets the search text and results.
|
|
69
|
+
*
|
|
70
|
+
* @default ""
|
|
71
|
+
*/
|
|
72
|
+
accessor initialSearchTerm: string;
|
|
45
73
|
/** Overrides for search text and other translated messages. */
|
|
46
74
|
accessor messageOverrides: {
|
|
75
|
+
allContent?: string | undefined;
|
|
76
|
+
allGroups?: string | undefined;
|
|
47
77
|
clearSelection?: string | undefined;
|
|
78
|
+
myContent?: string | undefined;
|
|
79
|
+
myGroups?: string | undefined;
|
|
80
|
+
myOrganization?: string | undefined;
|
|
48
81
|
noGroupsFound?: string | undefined;
|
|
49
82
|
noItemsFound?: string | undefined;
|
|
50
83
|
noUsersFound?: string | undefined;
|
|
51
84
|
searchFailed?: string | undefined;
|
|
52
85
|
searchGroups?: string | undefined;
|
|
53
86
|
searchItems?: string | undefined;
|
|
87
|
+
searchIn?: string | undefined;
|
|
54
88
|
searchUsers?: string | undefined;
|
|
55
89
|
searching?: string | undefined;
|
|
56
90
|
};
|
|
@@ -61,23 +95,35 @@ export abstract class ArcgisPortalEntityPicker extends LitElement {
|
|
|
61
95
|
*/
|
|
62
96
|
accessor mode: PortalEntityPickerMode;
|
|
63
97
|
/**
|
|
64
|
-
*
|
|
98
|
+
* Maximum results per search. Only the first page is displayed; additional pages are not loaded.
|
|
65
99
|
*
|
|
66
100
|
* @default 10
|
|
67
101
|
*/
|
|
68
102
|
accessor num: number;
|
|
69
103
|
/** The portal whose entities are searched. */
|
|
70
104
|
accessor portal: Portal;
|
|
71
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* Base Portal query combined with user-entered search text and scope using AND.
|
|
107
|
+
* A nonempty query shows matching candidates even when the search input is empty.
|
|
108
|
+
*/
|
|
72
109
|
accessor query: string | undefined;
|
|
73
|
-
/**
|
|
110
|
+
/**
|
|
111
|
+
* Locks the item or group search bucket to `initialScope`.
|
|
112
|
+
*
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
115
|
+
accessor scopeSelectionDisabled: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Controlled selection. Portal, entity type, or search-constraint changes emit
|
|
118
|
+
* `arcgisSelectionChange` with `null` to request clearing it without mutating this property.
|
|
119
|
+
*/
|
|
74
120
|
accessor selected: PortalEntityPickerSelection | null;
|
|
75
121
|
/**
|
|
76
122
|
* Controls selection indicators for inline results. `none` keeps click and keyboard selection without controls.
|
|
77
123
|
*
|
|
78
124
|
* @default "single"
|
|
79
125
|
*/
|
|
80
|
-
accessor selectionMode:
|
|
126
|
+
accessor selectionMode: Extract<ArcgisPortalItemCard["selection"], "none" | "single">;
|
|
81
127
|
/** Sets focus on the search input. */
|
|
82
128
|
setFocus(): Promise<void>;
|
|
83
129
|
/**
|
|
@@ -1,87 +1,196 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { keyed as
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { createRef as
|
|
7
|
-
import { u as
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import { a as
|
|
11
|
-
import {
|
|
2
|
+
import { c as P } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as O, html as p } from "lit";
|
|
4
|
+
import { keyed as v } from "lit/directives/keyed.js";
|
|
5
|
+
import { LitElement as D, createEvent as F, safeStyleMap as L } from "@arcgis/lumina";
|
|
6
|
+
import { createRef as k, ref as R } from "lit/directives/ref.js";
|
|
7
|
+
import { u as q } from "../../chunks/useT9n.js";
|
|
8
|
+
import { isAbortError as A } from "@arcgis/core/core/promiseUtils.js";
|
|
9
|
+
import C from "@arcgis/core/portal/PortalQueryResult.js";
|
|
10
|
+
import { c as x, q as T, a as I } from "../../chunks/string.js";
|
|
11
|
+
import { s as E } from "../../chunks/groups2.js";
|
|
12
|
+
import { s as G } from "../../chunks/dom.js";
|
|
13
|
+
import { g as M } from "../../chunks/portal.js";
|
|
14
|
+
import { r as z } from "../../chunks/request.js";
|
|
12
15
|
import "../arcgis-portal-group-card/customElement.js";
|
|
13
16
|
import "../arcgis-portal-item-card/customElement.js";
|
|
14
|
-
import {
|
|
17
|
+
import { makeGenericController as U } from "@arcgis/lumina/controllers";
|
|
18
|
+
import { S as N } from "../../chunks/utils.js";
|
|
15
19
|
import "../arcgis-portal-user-avatar/customElement.js";
|
|
16
|
-
const
|
|
20
|
+
const W = [
|
|
17
21
|
"esri_livingatlas",
|
|
18
22
|
"esri_boundaries",
|
|
19
23
|
"esri_demographics",
|
|
20
24
|
"esri_nav",
|
|
21
25
|
"esri_webstyles"
|
|
22
26
|
];
|
|
23
|
-
function
|
|
24
|
-
return
|
|
27
|
+
function B(n) {
|
|
28
|
+
return G(n.trim()).replace(/[!*+\-&|()[\]{}^~?:"\\]/gu, "\\$&");
|
|
25
29
|
}
|
|
26
|
-
async function
|
|
27
|
-
portal:
|
|
30
|
+
async function Q({
|
|
31
|
+
portal: n,
|
|
28
32
|
searchTerm: e,
|
|
29
33
|
num: t = 100,
|
|
30
|
-
query:
|
|
34
|
+
query: r,
|
|
35
|
+
signal: o
|
|
31
36
|
}) {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
return await
|
|
36
|
-
url:
|
|
37
|
-
portal:
|
|
37
|
+
const a = B(e), i = `${M(n)}portals/self/users/search`, c = [a ? `(${a})` : void 0, r?.trim() ? `(${r.trim()})` : void 0];
|
|
38
|
+
n.isPortal && c.push(...W.map((m) => `-username:${m}`));
|
|
39
|
+
const u = i.includes("www.arcgis.com") && n.isPortal ? { disableIdentityLookup: !0, addTokenManually: !1 } : {};
|
|
40
|
+
return await z({
|
|
41
|
+
url: i,
|
|
42
|
+
portal: n,
|
|
38
43
|
params: {
|
|
39
44
|
num: Math.min(Math.max(t, 1), 100),
|
|
40
|
-
q:
|
|
45
|
+
q: c.filter(Boolean).join(" AND "),
|
|
41
46
|
sortField: "relevance"
|
|
42
47
|
},
|
|
43
|
-
options:
|
|
48
|
+
options: { ...u, ...o ? { signal: o } : {} }
|
|
44
49
|
});
|
|
45
50
|
}
|
|
46
|
-
function
|
|
47
|
-
|
|
51
|
+
function b(n, e) {
|
|
52
|
+
const t = ["all"];
|
|
53
|
+
return e === "user" || !n.user?.username || (e === "item" && t.push("myContent"), t.push("myGroups"), n.user.orgId && t.push("myOrganization")), t;
|
|
48
54
|
}
|
|
49
|
-
async function
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
async function j(n) {
|
|
56
|
+
const { portal: e, entityType: t, searchTerm: r, signal: o } = n, a = Math.min(Math.max(n.num ?? 10, 1), 100), i = n.scope ?? "all";
|
|
57
|
+
try {
|
|
58
|
+
if (o?.throwIfAborted(), !b(e, t).includes(i))
|
|
59
|
+
throw new Error(`Search scope "${i}" is unavailable for ${t} searches.`);
|
|
60
|
+
if (!r.trim() && !n.query?.trim())
|
|
61
|
+
return {};
|
|
62
|
+
if (t === "user")
|
|
53
63
|
return {
|
|
54
64
|
result: {
|
|
55
|
-
entityType:
|
|
56
|
-
result: await
|
|
65
|
+
entityType: t,
|
|
66
|
+
result: await Q({
|
|
67
|
+
portal: e,
|
|
68
|
+
searchTerm: r,
|
|
69
|
+
num: a,
|
|
70
|
+
query: n.query,
|
|
71
|
+
...o ? { signal: o } : {}
|
|
72
|
+
})
|
|
57
73
|
}
|
|
58
74
|
};
|
|
59
|
-
|
|
60
|
-
|
|
75
|
+
const c = x(r);
|
|
76
|
+
if (!c && !n.query?.trim())
|
|
77
|
+
return {};
|
|
78
|
+
let l;
|
|
79
|
+
const u = e.user;
|
|
80
|
+
if (i === "myContent" && u)
|
|
81
|
+
l = `owner:${T(u.username)}`;
|
|
82
|
+
else if (i === "myOrganization" && u?.orgId)
|
|
83
|
+
l = `orgid:${T(u.orgId)}`;
|
|
84
|
+
else if (i === "myGroups" && u) {
|
|
85
|
+
if (t === "group") {
|
|
86
|
+
const s = await E(
|
|
87
|
+
e,
|
|
88
|
+
{
|
|
89
|
+
num: a,
|
|
90
|
+
q: I(c, n.query),
|
|
91
|
+
searchUserAccess: "groupMember",
|
|
92
|
+
searchUserName: u.username
|
|
93
|
+
},
|
|
94
|
+
{ signal: o }
|
|
95
|
+
);
|
|
96
|
+
return {
|
|
97
|
+
result: {
|
|
98
|
+
entityType: t,
|
|
99
|
+
result: new C({ results: s.results, total: s.total })
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
const y = await u.fetchGroups();
|
|
104
|
+
if (o?.throwIfAborted(), !y.length)
|
|
105
|
+
return {
|
|
106
|
+
result: { entityType: t, result: new C({ results: [], total: 0 }) }
|
|
107
|
+
};
|
|
108
|
+
l = y.map(({ id: s }) => {
|
|
109
|
+
if (!s)
|
|
110
|
+
throw new Error("A membership group is missing its ID.");
|
|
111
|
+
return `group:${T(s)}`;
|
|
112
|
+
}).join(" OR ");
|
|
61
113
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
query: P(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) } };
|
|
114
|
+
const m = {
|
|
115
|
+
num: a,
|
|
116
|
+
query: I(c, n.query, l)
|
|
117
|
+
};
|
|
118
|
+
return t === "group" ? { result: { entityType: t, result: await e.queryGroups(m, { signal: o }) } } : { result: { entityType: t, result: await e.queryItems(m, { signal: o }) } };
|
|
71
119
|
} catch (c) {
|
|
120
|
+
if (o?.aborted || A(c))
|
|
121
|
+
throw c;
|
|
72
122
|
return console.error(c), { error: { code: "unhandledError" } };
|
|
73
123
|
}
|
|
74
124
|
}
|
|
75
|
-
const
|
|
76
|
-
|
|
125
|
+
const H = (n) => U((e, t) => {
|
|
126
|
+
let r = {
|
|
127
|
+
searchTerm: "",
|
|
128
|
+
scope: "all",
|
|
129
|
+
searchActive: !1,
|
|
130
|
+
isSearching: !1,
|
|
131
|
+
searchFailed: !1
|
|
132
|
+
}, o, a;
|
|
133
|
+
const i = (s) => {
|
|
134
|
+
r = { ...r, ...s }, t.exports = { ...r, setSearchTerm: m, setScope: y };
|
|
135
|
+
}, c = () => {
|
|
136
|
+
o !== void 0 && (clearTimeout(o), o = void 0), a?.abort(), a = void 0;
|
|
137
|
+
}, l = async (s, h) => {
|
|
138
|
+
const { entityType: d, num: f, portal: g, query: S } = e, { scope: w } = r;
|
|
139
|
+
try {
|
|
140
|
+
const { error: $, result: _ } = await j({
|
|
141
|
+
portal: g,
|
|
142
|
+
entityType: d,
|
|
143
|
+
searchTerm: s,
|
|
144
|
+
num: f,
|
|
145
|
+
query: S,
|
|
146
|
+
signal: h,
|
|
147
|
+
...w === "all" ? {} : { scope: w }
|
|
148
|
+
});
|
|
149
|
+
h.aborted || i({ searchFailed: !!$, searchResult: _, isSearching: !1 });
|
|
150
|
+
} catch ($) {
|
|
151
|
+
!h.aborted && !A($) && (console.error($), i({ searchFailed: !0, searchResult: void 0, isSearching: !1 }));
|
|
152
|
+
}
|
|
153
|
+
}, u = (s) => {
|
|
154
|
+
const h = s.searchTerm.trim(), d = b(e.portal, e.entityType).includes(s.scope), f = !!(h || e.query?.trim()), g = !d || f;
|
|
155
|
+
if (c(), i({
|
|
156
|
+
...s,
|
|
157
|
+
searchActive: g,
|
|
158
|
+
searchFailed: !d,
|
|
159
|
+
searchResult: void 0,
|
|
160
|
+
isSearching: d && f
|
|
161
|
+
}), n(g), d && f) {
|
|
162
|
+
a = new AbortController();
|
|
163
|
+
const { signal: S } = a;
|
|
164
|
+
o = setTimeout(() => {
|
|
165
|
+
o = void 0, l(h, S);
|
|
166
|
+
}, N);
|
|
167
|
+
}
|
|
168
|
+
}, m = (s) => {
|
|
169
|
+
u({ searchTerm: s, scope: r.scope });
|
|
170
|
+
}, y = (s) => {
|
|
171
|
+
!e.scopeSelectionDisabled && s !== r.scope && u({ searchTerm: r.searchTerm, scope: s });
|
|
172
|
+
};
|
|
173
|
+
return t.onUpdate((s) => {
|
|
174
|
+
const h = s.has("portal") || s.has("entityType") || s.has("query") || s.has("num") || s.has("initialSearchTerm"), d = s.has("portal") || s.has("entityType") || s.has("initialScope") || s.has("scopeSelectionDisabled");
|
|
175
|
+
(h || d) && u({
|
|
176
|
+
searchTerm: h ? e.initialSearchTerm : r.searchTerm,
|
|
177
|
+
scope: d ? e.initialScope : r.scope
|
|
178
|
+
});
|
|
179
|
+
}), t.onConnected(() => {
|
|
180
|
+
r.isSearching && u({ searchTerm: r.searchTerm, scope: r.scope });
|
|
181
|
+
}), t.onDisconnected(c), { ...r, setSearchTerm: m, setScope: y };
|
|
182
|
+
}), 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%}`;
|
|
183
|
+
class V extends D {
|
|
77
184
|
constructor() {
|
|
78
|
-
super(...arguments), this._messages =
|
|
185
|
+
super(...arguments), this._messages = q({ blocking: !0, name: "portal-entity-picker" }), this.inputRef = k(), this.inputContainerRef = k(), this.resizeObserver = null, this.searchController = H((e) => {
|
|
186
|
+
(!e || this.mode === "popover") && (this.popoverOpen = e);
|
|
187
|
+
})(this), this.popoverOpen = !1, this.popoverWidth = 0, this.entityType = "group", this.mode = "inline", this.selectionMode = "single", this.selected = null, this.initialScope = "all", this.scopeSelectionDisabled = !1, this.initialSearchTerm = "", this.num = 10, this.arcgisSelectionChange = F();
|
|
79
188
|
}
|
|
80
189
|
static {
|
|
81
|
-
this.properties = {
|
|
190
|
+
this.properties = { popoverOpen: 16, popoverWidth: 16, portal: 0, entityType: 1, mode: 1, selectionMode: 1, selected: 0, query: 1, initialScope: 1, scopeSelectionDisabled: 5, initialSearchTerm: 1, num: 9, icon: 1, messageOverrides: 0 };
|
|
82
191
|
}
|
|
83
192
|
static {
|
|
84
|
-
this.styles =
|
|
193
|
+
this.styles = K;
|
|
85
194
|
}
|
|
86
195
|
get searchLabel() {
|
|
87
196
|
const { entityType: e, _messages: t } = this;
|
|
@@ -102,52 +211,21 @@ class O extends f {
|
|
|
102
211
|
this.updatePopoverWidth(), !(typeof ResizeObserver > "u" || !this.inputContainerRef.value) && (this.resizeObserver = new ResizeObserver(() => this.updatePopoverWidth()), this.resizeObserver.observe(this.inputContainerRef.value));
|
|
103
212
|
}
|
|
104
213
|
willUpdate(e) {
|
|
105
|
-
|
|
214
|
+
this.hasUpdated && this.selected && ["portal", "entityType", "query", "initialScope", "scopeSelectionDisabled"].some((t) => e.has(t)) && this.arcgisSelectionChange.emit(null), e.has("mode") && this.mode === "inline" && (this.popoverOpen = !1);
|
|
106
215
|
}
|
|
107
216
|
disconnectedCallback() {
|
|
108
|
-
this.
|
|
217
|
+
this.resizeObserver?.disconnect(), this.resizeObserver = null, super.disconnectedCallback();
|
|
109
218
|
}
|
|
110
219
|
updatePopoverWidth() {
|
|
111
220
|
requestAnimationFrame(() => {
|
|
112
221
|
this.popoverWidth = this.inputContainerRef.value?.offsetWidth ?? 0;
|
|
113
222
|
});
|
|
114
223
|
}
|
|
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
|
-
}, R);
|
|
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 A(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
224
|
emitSelection(e) {
|
|
147
225
|
this.arcgisSelectionChange.emit(e), this.mode === "popover" && this.togglePicker(!1);
|
|
148
226
|
}
|
|
149
227
|
getFocusableResults() {
|
|
150
|
-
const e = Array.from(this.renderRoot.querySelector('slot[name="list-start"]')?.assignedElements({ flatten: !0 }) ?? []).filter((
|
|
228
|
+
const e = Array.from(this.renderRoot.querySelector('slot[name="list-start"]')?.assignedElements({ flatten: !0 }) ?? []).filter((r) => r instanceof HTMLElement && (r.tagName === "CALCITE-LIST-ITEM" || r.tabIndex >= 0)), t = Array.from(this.renderRoot.querySelectorAll("calcite-list-item, arcgis-portal-group-card, arcgis-portal-item-card"));
|
|
151
229
|
return [...e, ...t];
|
|
152
230
|
}
|
|
153
231
|
async focusResult(e) {
|
|
@@ -169,85 +247,92 @@ class O extends f {
|
|
|
169
247
|
const t = this.getFocusableResults();
|
|
170
248
|
if (!t.length)
|
|
171
249
|
return;
|
|
172
|
-
const
|
|
173
|
-
await this.focusResult(t[
|
|
250
|
+
const r = (e + t.length) % t.length;
|
|
251
|
+
await this.focusResult(t[r]);
|
|
174
252
|
}
|
|
175
253
|
handleResultsKeyDown(e) {
|
|
176
254
|
if (e.defaultPrevented)
|
|
177
255
|
return;
|
|
178
|
-
const t = this.getFocusableResults(),
|
|
179
|
-
if (
|
|
256
|
+
const t = this.getFocusableResults(), r = e.composedPath(), o = t.findIndex((i) => r.includes(i));
|
|
257
|
+
if (o === -1)
|
|
180
258
|
return;
|
|
181
259
|
if (this.mode === "inline" && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
182
|
-
e.preventDefault(), this.focusResultAt(
|
|
260
|
+
e.preventDefault(), this.focusResultAt(o + (e.key === "ArrowDown" ? 1 : -1));
|
|
183
261
|
return;
|
|
184
262
|
}
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
263
|
+
const a = t[o];
|
|
264
|
+
if (a.tagName === "ARCGIS-PORTAL-GROUP-CARD" && (e.key === "Enter" || e.key === " ")) {
|
|
187
265
|
e.preventDefault();
|
|
188
|
-
const { group:
|
|
189
|
-
this.emitSelection({ entityType: "group", entity:
|
|
266
|
+
const { group: i } = a;
|
|
267
|
+
this.emitSelection({ entityType: "group", entity: i });
|
|
190
268
|
return;
|
|
191
269
|
}
|
|
192
|
-
if (
|
|
270
|
+
if (a.tagName === "ARCGIS-PORTAL-ITEM-CARD" && (e.key === "Enter" || e.key === " ")) {
|
|
193
271
|
e.preventDefault();
|
|
194
|
-
const { item:
|
|
195
|
-
this.emitSelection({ entityType: "item", entity:
|
|
272
|
+
const { item: i } = a;
|
|
273
|
+
this.emitSelection({ entityType: "item", entity: i });
|
|
196
274
|
}
|
|
197
275
|
}
|
|
276
|
+
renderScopeSelector() {
|
|
277
|
+
const { entityType: e, portal: t, _messages: r } = this, { scope: o } = this.searchController, a = b(t, e);
|
|
278
|
+
return a.length <= 1 ? null : p`<calcite-select .disabled=${this.scopeSelectionDisabled} .label=${r.searchIn} scale=m @calciteSelectChange=${(i) => {
|
|
279
|
+
const c = a.find((l) => l === i.target.value);
|
|
280
|
+
c && this.searchController.setScope(c);
|
|
281
|
+
}}>${a.map((i) => p`<calcite-option .selected=${i === o} .value=${i}>${i === "all" ? e === "item" ? r.allContent : r.allGroups : r[i]}</calcite-option>`)}</calcite-select>`;
|
|
282
|
+
}
|
|
198
283
|
renderGroup(e) {
|
|
199
|
-
return
|
|
284
|
+
return v(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>`);
|
|
200
285
|
}
|
|
201
286
|
renderInlineGroup(e) {
|
|
202
|
-
return
|
|
287
|
+
return v(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 }) => {
|
|
203
288
|
t.selected && this.emitSelection({ entityType: "group", entity: t.group });
|
|
204
289
|
}} .user=${this.portal.user ?? void 0} view=compact></arcgis-portal-group-card>`);
|
|
205
290
|
}
|
|
206
291
|
renderItem(e) {
|
|
207
|
-
return
|
|
292
|
+
return v(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>`);
|
|
208
293
|
}
|
|
209
294
|
renderInlineItem(e) {
|
|
210
|
-
return
|
|
295
|
+
return v(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 }) => {
|
|
211
296
|
t.selected && this.emitSelection({ entityType: "item", entity: t.item });
|
|
212
297
|
}} .user=${this.portal.user ?? void 0} view=list></arcgis-portal-item-card>`);
|
|
213
298
|
}
|
|
214
299
|
renderUser(e) {
|
|
215
|
-
return
|
|
300
|
+
return v(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>`);
|
|
216
301
|
}
|
|
217
302
|
renderSearchResults() {
|
|
218
|
-
const { entityType: e,
|
|
219
|
-
if (!
|
|
303
|
+
const { entityType: e, _messages: t } = this, { isSearching: r, searchActive: o, searchFailed: a, searchResult: i } = this.searchController;
|
|
304
|
+
if (!o)
|
|
220
305
|
return null;
|
|
221
|
-
if (
|
|
222
|
-
return
|
|
223
|
-
if (
|
|
224
|
-
return
|
|
306
|
+
if (r)
|
|
307
|
+
return p`<div role=status><calcite-loader .label=${t.searching} scale=s></calcite-loader></div>`;
|
|
308
|
+
if (a)
|
|
309
|
+
return p`<p class="entity-picker__status" role=alert>${t.searchFailed}</p>`;
|
|
225
310
|
if (!(i?.result.results ?? []).length) {
|
|
226
|
-
const
|
|
227
|
-
return
|
|
311
|
+
const l = e === "group" ? t.noGroupsFound : e === "item" ? t.noItemsFound : t.noUsersFound;
|
|
312
|
+
return p`<p class="entity-picker__status" role=status>${l}</p>`;
|
|
228
313
|
}
|
|
229
|
-
return this.mode === "inline" && i?.entityType === "group" ?
|
|
314
|
+
return this.mode === "inline" && i?.entityType === "group" ? p`<div class="entity-picker__cards"><slot name=list-start></slot>${i.result.results.map((l) => this.renderInlineGroup(l))}</div>` : this.mode === "inline" && i?.entityType === "item" ? p`<div class="entity-picker__cards"><slot name=list-start></slot>${i.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>${i?.entityType === "group" ? i.result.results.map((l) => this.renderGroup(l)) : i?.entityType === "item" ? i.result.results.map((l) => this.renderItem(l)) : i?.result.results.map((l) => this.renderUser(l))}</calcite-list>`;
|
|
230
315
|
}
|
|
231
316
|
renderPicker(e = !0) {
|
|
232
|
-
return
|
|
233
|
-
this.mode === "popover" && this.
|
|
317
|
+
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" ${R(this.inputContainerRef)}><calcite-input .icon=${this.icon} .clearable=${this.mode === "inline"} .label=${this.searchLabel} .placeholder=${this.searchLabel} .value=${this.searchController.searchTerm} @click=${() => {
|
|
318
|
+
this.mode === "popover" && this.searchController.searchActive && (this.popoverOpen = !0);
|
|
234
319
|
}} @keydown=${(t) => {
|
|
235
|
-
(t.key === "ArrowDown" || t.key === "ArrowUp") && this.searchResult?.result.results.length && (t.preventDefault(), this.focusResultAt(t.key === "ArrowDown" ? 0 : -1));
|
|
320
|
+
(t.key === "ArrowDown" || t.key === "ArrowUp") && this.searchController.searchResult?.result.results.length && (t.preventDefault(), this.focusResultAt(t.key === "ArrowDown" ? 0 : -1));
|
|
236
321
|
}} @focus=${() => {
|
|
237
|
-
this.mode === "popover" && this.
|
|
322
|
+
this.mode === "popover" && this.searchController.searchActive && (this.popoverOpen = !0);
|
|
238
323
|
}} @calciteInputInput=${(t) => {
|
|
239
|
-
this.
|
|
240
|
-
}} ${
|
|
324
|
+
this.searchController.setSearchTerm(t.target.value);
|
|
325
|
+
}} ${R(this.inputRef)}></calcite-input></div>${e && p`<div class="entity-picker__results" @keydown=${this.handleResultsKeyDown}>${this.renderSearchResults()}</div>` || ""}</div>`;
|
|
241
326
|
}
|
|
242
327
|
render() {
|
|
243
|
-
return this.mode === "inline" ? this.renderPicker() :
|
|
328
|
+
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) => {
|
|
244
329
|
!e.target.open && this.popoverOpen && (this.popoverOpen = !1, requestAnimationFrame(() => {
|
|
245
330
|
this.setFocus();
|
|
246
331
|
}));
|
|
247
|
-
}}><div class="entity-picker__results" style=${
|
|
332
|
+
}}><div class="entity-picker__results" style=${L({ inlineSize: this.popoverWidth ? `${this.popoverWidth}px` : void 0 })}>${this.renderSearchResults()}</div></calcite-popover>`;
|
|
248
333
|
}
|
|
249
334
|
}
|
|
250
|
-
|
|
335
|
+
P("arcgis-portal-entity-picker", V);
|
|
251
336
|
export {
|
|
252
|
-
|
|
337
|
+
V as ArcgisPortalEntityPicker
|
|
253
338
|
};
|
|
@@ -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";
|