@arcgis/portal-components 6.0.0-next.20 → 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.
- package/dist/cdn/{EHHFEPC2.js → 22TDAUX4.js} +1 -1
- package/dist/cdn/{5D5INKHG.js → 234TH32X.js} +1 -1
- package/dist/cdn/2D3FQXJ4.js +2 -0
- package/dist/cdn/{AXKMKCEW.js → 2DXO6FVX.js} +1 -1
- package/dist/cdn/{57MT7FOI.js → 2XJX2JUO.js} +1 -1
- package/dist/cdn/{SCRIVOPW.js → 3EQGUCO4.js} +1 -1
- package/dist/cdn/{HXFKOELM.js → 3J3ISO3E.js} +1 -1
- package/dist/cdn/{PXG2SRSN.js → 3RTST3I6.js} +1 -1
- package/dist/cdn/{TKTMO2NO.js → 3XH3JHOI.js} +1 -1
- package/dist/cdn/{SASCLFKY.js → 4ONCJSSP.js} +1 -1
- package/dist/cdn/{O5MB4QQ2.js → 4WQA7UAJ.js} +1 -1
- package/dist/cdn/5OWIWCEQ.js +2 -0
- package/dist/cdn/{AYHYABMC.js → 5R4JJWGB.js} +1 -1
- package/dist/cdn/{SQCDEL42.js → 63HYFDRU.js} +1 -1
- package/dist/cdn/{IRCWBDGJ.js → 6MATPHXT.js} +10 -10
- package/dist/cdn/{565U4WSN.js → 7IP3RVPH.js} +1 -1
- package/dist/cdn/{QKGHH3FS.js → 7ISSDO2T.js} +1 -1
- package/dist/cdn/AKTIIRJQ.js +2 -0
- package/dist/cdn/{APLSVK3C.js → ASID6YW7.js} +1 -1
- package/dist/cdn/{OQ3OHDEB.js → B3HV5JVN.js} +1 -1
- package/dist/cdn/B6666VUQ.js +2 -0
- package/dist/cdn/{LVUKORME.js → BOO7GG5L.js} +1 -1
- package/dist/cdn/CZ4FC4GM.js +2 -0
- package/dist/cdn/{LY7NVMME.js → D3LZFIHV.js} +1 -1
- package/dist/cdn/{UYROTXZP.js → D3Q72PPN.js} +1 -1
- package/dist/cdn/{RAWBYOFF.js → DABNV2OO.js} +1 -1
- package/dist/cdn/DOCNBKQZ.js +2 -0
- package/dist/cdn/{VXYEF3XW.js → EP7NWEC5.js} +1 -1
- package/dist/cdn/{MK2KDBUL.js → EQRBP6H6.js} +1 -1
- package/dist/cdn/{AAWXEOVL.js → ESKKH4DE.js} +1 -1
- package/dist/cdn/{CUJG43PQ.js → EUQQZIRW.js} +1 -1
- package/dist/cdn/F2HT5PVQ.js +2 -0
- package/dist/cdn/FE3O23SE.js +2 -0
- package/dist/cdn/{U4PHGRXB.js → FGRMURKX.js} +1 -1
- package/dist/cdn/{ULTSLT4L.js → FYVATGMR.js} +1 -1
- package/dist/cdn/{5SKCVK2P.js → G3WDR53S.js} +1 -1
- package/dist/cdn/GAU6DNV5.js +2 -0
- package/dist/cdn/GPAIXN52.js +2 -0
- package/dist/cdn/GRSBU4PD.js +2 -0
- package/dist/cdn/{4I7NKRIH.js → H7FA5HFE.js} +1 -1
- package/dist/cdn/{3ZC26CT6.js → HHGKNVCH.js} +1 -1
- package/dist/cdn/{OQE662U3.js → HJLWIQDI.js} +1 -1
- package/dist/cdn/I3EWDYTU.js +2 -0
- package/dist/cdn/{I4ZRFXQ3.js → IKPVMXXW.js} +1 -1
- package/dist/cdn/{C5FTQSU6.js → IOFXDIWC.js} +1 -1
- package/dist/cdn/IPHBVKMY.js +2 -0
- package/dist/cdn/{ZS3JUQN3.js → IUIFCQQU.js} +1 -1
- package/dist/cdn/{QJB32L7F.js → IVDZGUNZ.js} +1 -1
- package/dist/cdn/J6SI4Z4F.js +2 -0
- package/dist/cdn/K7LYYLUF.js +2 -0
- package/dist/cdn/{Y72W3QFF.js → KDORI7H4.js} +1 -1
- package/dist/cdn/{2267AKWE.js → LGJWULAW.js} +1 -1
- package/dist/cdn/LTMPXQTC.js +2 -0
- package/dist/cdn/M5STJJRX.js +2 -0
- package/dist/cdn/{VAJV46OF.js → M7J7RAM4.js} +1 -1
- package/dist/cdn/{HIPJAMO4.js → N4ZRMYZL.js} +1 -1
- package/dist/cdn/NBCYYUHP.js +2 -0
- package/dist/cdn/NHVPNSNH.js +2 -0
- package/dist/cdn/{VNVGVYX6.js → NQ2IAQKL.js} +2 -2
- package/dist/cdn/NXGTEDK4.js +2 -0
- package/dist/cdn/{I3ECBIYX.js → NYOXMT6S.js} +1 -1
- package/dist/cdn/O3JP4FQ3.js +2 -0
- package/dist/cdn/{MXUHZ474.js → ODSA6NNS.js} +1 -1
- package/dist/cdn/{PVPTFK7N.js → OHAQPQAP.js} +1 -1
- package/dist/cdn/OOXTSCQT.js +2 -0
- package/dist/cdn/OQ2JULON.js +2 -0
- package/dist/cdn/{7XBN6ZF4.js → OVH4YLTS.js} +1 -1
- package/dist/cdn/{6T4X4RAB.js → QB5BGHLA.js} +1 -1
- package/dist/cdn/QKCRNS75.js +2 -0
- package/dist/cdn/{6XAFP5OI.js → RKMW4FUN.js} +1 -1
- package/dist/cdn/{E26PFYPI.js → RT26JZP5.js} +1 -1
- package/dist/cdn/SKHFISBA.js +2 -0
- package/dist/cdn/SKIDJ4QI.js +2 -0
- package/dist/cdn/{VXDDXPD7.js → SSCKCDXD.js} +1 -1
- package/dist/cdn/{YERFI6P2.js → T66G7GIR.js} +1 -1
- package/dist/cdn/{MOE6L5RN.js → TIMYD2HM.js} +1 -1
- package/dist/cdn/TJWJ3LTU.js +2 -0
- package/dist/cdn/{EXEAVQRP.js → TMR4BRFI.js} +1 -1
- package/dist/cdn/{ZJWAM6OL.js → TTQGRN2V.js} +1 -1
- package/dist/cdn/{YTVLEHJT.js → UHOW7Q65.js} +1 -1
- package/dist/cdn/{2XIDYV73.js → US3N5L73.js} +1 -1
- package/dist/cdn/W5POIPYP.js +2 -0
- package/dist/cdn/{EQTGOMBD.js → WJWWYBZ7.js} +1 -1
- package/dist/cdn/WNEPEEPZ.js +2 -0
- package/dist/cdn/{NDCMZLMU.js → WPAZDJHU.js} +1 -1
- package/dist/cdn/WT72SOAU.js +2 -0
- package/dist/cdn/XJGKRAN5.js +2 -0
- package/dist/cdn/{MSP6STQ7.js → XS5EOWBK.js} +1 -1
- package/dist/cdn/{7PBECSW5.js → YCIFVZ4J.js} +1 -1
- package/dist/cdn/{TNRHHR67.js → YDXJHNDI.js} +1 -1
- package/dist/cdn/{TRFH3KNJ.js → YIOJIA4Y.js} +1 -1
- package/dist/cdn/{I57CRKF7.js → YK6FCXWU.js} +1 -1
- package/dist/cdn/{FLUCWAMC.js → YPDHSE2J.js} +1 -1
- package/dist/cdn/{ZJCG6JI7.js → YQLFXHFG.js} +1 -1
- package/dist/cdn/{QSRWVCWP.js → YSVPB3BO.js} +1 -1
- package/dist/cdn/{SHGPWFEC.js → YUOVGTP5.js} +1 -1
- package/dist/cdn/{GOUAS2Q5.js → Z5CA4C6H.js} +1 -1
- package/dist/cdn/{GDCXUNOL.js → ZD6XJVGV.js} +1 -1
- package/dist/cdn/{4B2URSFO.js → ZHQXYCPA.js} +1 -1
- package/dist/cdn/{Y6WQZMYW.js → ZOX4RLS4.js} +1 -1
- package/dist/cdn/assets/portal-item-card-sublayer-select/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/item2.js +29 -25
- package/dist/chunks/itemThumbnail.js +21 -21
- package/dist/chunks/request.js +51 -43
- package/dist/chunks/utils3.js +88 -657
- package/dist/chunks/utils4.js +664 -0
- package/dist/components/arcgis-portal-account-switcher/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-banner/customElement.js +2 -2
- package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-form-element/customElement.js +1 -1
- package/dist/components/arcgis-portal-entity-picker/customElement.d.ts +1 -1
- package/dist/components/arcgis-portal-item-card/customElement.d.ts +20 -8
- package/dist/components/arcgis-portal-item-card/customElement.js +79 -70
- package/dist/components/arcgis-portal-item-card/index.js +1 -0
- 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-thumbnail/customElement.d.ts +1 -0
- package/dist/components/arcgis-portal-item-thumbnail/customElement.js +13 -13
- package/dist/components/arcgis-portal-item-type/customElement.js +1 -1
- package/dist/components/arcgis-portal-navigation/customElement.js +1 -1
- package/dist/components/arcgis-portal-navigation/index.js +4 -4
- package/dist/components/arcgis-portal-sublayer-type/customElement.js +13 -103
- 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 +10 -0
- package/dist/loader.js +2 -1
- package/dist/types/item.d.ts +11 -11
- package/dist/types/lumina.d.ts +9 -1
- package/dist/types/preact.d.ts +10 -1
- package/dist/types/react.d.ts +11 -1
- package/dist/types/services.d.ts +3 -0
- package/dist/types/stencil.d.ts +9 -1
- package/package.json +7 -7
- package/dist/cdn/225AERRK.js +0 -2
- package/dist/cdn/5VAV267L.js +0 -2
- package/dist/cdn/67QXUNKX.js +0 -2
- package/dist/cdn/6BQUKFTK.js +0 -2
- package/dist/cdn/723D3EKN.js +0 -2
- package/dist/cdn/AEPP4WJM.js +0 -2
- package/dist/cdn/B474WTYE.js +0 -2
- package/dist/cdn/C7KQT5QW.js +0 -2
- package/dist/cdn/CL5FABMT.js +0 -2
- package/dist/cdn/FTT33ZZJ.js +0 -2
- package/dist/cdn/FXTPC2Q5.js +0 -2
- package/dist/cdn/GJNGP34L.js +0 -2
- package/dist/cdn/IAK4F5SX.js +0 -2
- package/dist/cdn/JOQEFKCE.js +0 -2
- package/dist/cdn/K5Q4ZROX.js +0 -2
- package/dist/cdn/K6LF5U7K.js +0 -2
- package/dist/cdn/MUW2YNAS.js +0 -2
- package/dist/cdn/OQUQ7Z3E.js +0 -2
- package/dist/cdn/P74FP43E.js +0 -2
- package/dist/cdn/RA75BDVB.js +0 -2
- package/dist/cdn/RLI7T32U.js +0 -2
- package/dist/cdn/RYPYVJ5U.js +0 -2
- package/dist/cdn/TLZO6KZO.js +0 -2
- package/dist/cdn/UD4KPMGF.js +0 -2
- package/dist/cdn/UL3XBQUT.js +0 -2
- package/dist/cdn/VH2IMPMN.js +0 -2
- package/dist/cdn/VRGGPMVR.js +0 -2
- package/dist/cdn/WQWJVM5B.js +0 -2
- package/dist/cdn/XT6IKL7A.js +0 -2
- /package/dist/cdn/{OUMTV5H5.js → KHKREBVZ.js} +0 -0
- /package/dist/cdn/{XYT4533U.js → U2HTYOBB.js} +0 -0
|
@@ -5,7 +5,7 @@ import { u as n, c as f } from "../../chunks/loadClassificationData.js";
|
|
|
5
5
|
import { u as d } from "../../chunks/useT9n.js";
|
|
6
6
|
import { css as h, html as s } from "lit";
|
|
7
7
|
import { rethrowError as o } from "@arcgis/toolkit/log";
|
|
8
|
-
const m = h`.banner{box-sizing:border-box;width:100%;left:0;text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-
|
|
8
|
+
const m = h`.banner{box-sizing:border-box;width:100%;left:0;text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-space-sm);font-size:var(--calcite-font-size);text-transform:uppercase;overflow-wrap:break-word}.invalid-container{background-color:#fff;color:#000;display:flex;align-items:center;justify-content:center;gap:8px}.invalid-icon{--calcite-icon-color: var(--calcite-color-status-danger)}.invalid-message{text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-space-sm);font-size:var(--calcite-font-size);overflow-wrap:break-word}`;
|
|
9
9
|
class p extends l {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments), this.classificationModel = n(this), this.messages = d(), this._classificationDataTask = f(this), this.portalClassificationSchema = this.classificationModel.portalClassificationSchema, this.status = this.classificationModel.status, this.missingExistingClassification = !1, this.variant = "full", this.autoDestroyDisabled = !1, this.validationErrors = "";
|
|
@@ -36,7 +36,7 @@ class p extends l {
|
|
|
36
36
|
}
|
|
37
37
|
getStyle() {
|
|
38
38
|
const a = {};
|
|
39
|
-
if (this.variant === "preview" && (a.fontSize = "var(--calcite-font-size-sm)", a.padding = "var(--calcite-
|
|
39
|
+
if (this.variant === "preview" && (a.fontSize = "var(--calcite-font-size-sm)", a.padding = "var(--calcite-space-xs)"), this.itemClassification && this.portalClassificationSchema) {
|
|
40
40
|
const i = this.itemClassification.classification, t = this.portalClassificationSchema.classificationMetadata.classificationValueProperties.find(({ value: e }) => e === i);
|
|
41
41
|
t?.backgroundColor && (a.backgroundColor = t.backgroundColor), t?.textColor && (a.color = t.textColor);
|
|
42
42
|
}
|
|
@@ -144,7 +144,7 @@ async function L(r) {
|
|
|
144
144
|
]
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
const B = I`:host{height:100%;box-sizing:border-box;display:flex;flex-direction:column}.header-section{padding:var(--calcite-
|
|
147
|
+
const B = I`:host{height:100%;box-sizing:border-box;display:flex;flex-direction:column}.header-section{padding:var(--calcite-space-sm)}.header-section__title-container{display:flex;align-items:center;justify-content:space-between}.header-section__title-text{margin:unset;font-weight:unset;font-size:var(--calcite-font-size)}.header-section__title-popover{padding:var(--calcite-space-md)}.form-section{display:flex;border-top:var(--calcite-border-width-sm) solid var(--calcite-color-border-1);padding:var(--calcite-space-sm);height:100%;overflow:hidden}.form-section__sidebar{flex:1;padding:var(--calcite-space-sm)}.form-section__main-content{flex:3;padding:var(--calcite-space-sm);overflow:auto}.danger{color:var(--calcite-color-status-danger)}.spacing-y{margin:var(--calcite-space-md) 0}`;
|
|
148
148
|
class J extends v {
|
|
149
149
|
constructor() {
|
|
150
150
|
super(), this.classificationModel = P(this), this.messages = V(), this.formMainContentRef = f(), this.bannerRef = f(), this._classificationDataTask = S(this), this._formCreationTask = new y(this, {
|
|
@@ -6,7 +6,7 @@ import { LitElement as n } from "@arcgis/lumina";
|
|
|
6
6
|
import { u as f } from "../../chunks/useT9n.js";
|
|
7
7
|
import { u as d, r as v } from "../../chunks/requests.js";
|
|
8
8
|
import { g as h } from "../../chunks/common.js";
|
|
9
|
-
const m = r`.select-favorite-label{display:flex;justify-content:space-between;align-items:center}.favorite-actions{display:flex;justify-content:flex-end;gap:1.5rem;align-items:center}.classification-favorite-dialog{--calcite-dialog-content-space: 0;--calcite-dialog-background-color:
|
|
9
|
+
const m = r`.select-favorite-label{display:flex;justify-content:space-between;align-items:center}.favorite-actions{display:flex;justify-content:flex-end;gap:1.5rem;align-items:center}.classification-favorite-dialog{--calcite-dialog-content-space: 0;--calcite-dialog-background-color: var(--calcite-color-surface-3)}.save-new-favorite-button{display:flex;justify-content:flex-end;margin-top:.25rem;margin-bottom:1rem}.classification-favorite-item{display:flex;justify-content:space-between;padding-top:.5rem;padding-bottom:.5rem;border-bottom:1px solid var(--calcite-color-border-1)}.classification-favorite-list,.classification-favorite-input-section{margin:1.75rem 1rem}`;
|
|
10
10
|
class C extends n {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments), this.messages = f(), this.selectFavoriteClassification = (i) => {
|
|
@@ -4,7 +4,7 @@ import { repeat as u } from "lit/directives/repeat.js";
|
|
|
4
4
|
import { LitElement as c, createEvent as b, nothing as a } from "@arcgis/lumina";
|
|
5
5
|
import { css as d, html as i } from "lit";
|
|
6
6
|
import { u as h } from "../../chunks/useT9n.js";
|
|
7
|
-
const m = d`.spacing-y{margin:var(--calcite-
|
|
7
|
+
const m = d`.spacing-y{margin:var(--calcite-space-md) 0}.portal-classification-form-element-tooltip{display:flex;justify-content:space-between;align-items:center}`;
|
|
8
8
|
function l(n, e) {
|
|
9
9
|
return n.uiElement === e;
|
|
10
10
|
}
|
|
@@ -106,7 +106,7 @@ export abstract class ArcgisPortalEntityPicker extends LitElement {
|
|
|
106
106
|
*
|
|
107
107
|
* @default "single"
|
|
108
108
|
*/
|
|
109
|
-
accessor selectionMode:
|
|
109
|
+
accessor selectionMode: Extract<ArcgisPortalItemCard["selection"], "none" | "single">;
|
|
110
110
|
/** Sets focus on the search input. */
|
|
111
111
|
setFocus(): Promise<void>;
|
|
112
112
|
/**
|
|
@@ -3,9 +3,11 @@ import type Portal from "@arcgis/core/portal/Portal.js";
|
|
|
3
3
|
import type PortalItem from "@arcgis/core/portal/PortalItem.js";
|
|
4
4
|
import type PortalUser from "@arcgis/core/portal/PortalUser.js";
|
|
5
5
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
6
|
+
import type { SearchResultSublayerGeometry } from "../../types/item.js";
|
|
6
7
|
import type { PortalGroupSourceJSON } from "../../types/group.js";
|
|
7
8
|
import type { InternalUIAction } from "../../types/tracking.js";
|
|
8
9
|
import type { PortalItemAction } from "../arcgis-portal-item-actions/customElement.js";
|
|
10
|
+
import type { PortalItemCardSelectedItem, PortalItemCardSelectErrorDetail, PortalItemCardSublayerSelectDetail } from "../arcgis-portal-item-card-sublayer-select/types.js";
|
|
9
11
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
10
12
|
|
|
11
13
|
/**
|
|
@@ -20,6 +22,8 @@ import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
|
20
22
|
export abstract class ArcgisPortalItemCard extends LitElement {
|
|
21
23
|
/** Pass a set of actions to appear inside an ellipsis menu. */
|
|
22
24
|
accessor actions: PortalItemAction[];
|
|
25
|
+
/** Allowed sublayer geometries. An empty array permits all geometries. */
|
|
26
|
+
accessor allowedGeometries: SearchResultSublayerGeometry[];
|
|
23
27
|
/**
|
|
24
28
|
* Disable interaction when true.
|
|
25
29
|
*
|
|
@@ -98,13 +102,15 @@ export abstract class ArcgisPortalItemCard extends LitElement {
|
|
|
98
102
|
*/
|
|
99
103
|
accessor recycleBin: boolean;
|
|
100
104
|
/**
|
|
101
|
-
* Set to true to mark item as selected.
|
|
105
|
+
* Set to true to mark the whole item as selected. Sublayer modes use selectedItems instead.
|
|
102
106
|
*
|
|
103
107
|
* @default false
|
|
104
108
|
*/
|
|
105
109
|
accessor selected: boolean;
|
|
110
|
+
/** Parent-controlled item, sublayer, or task selections used by sublayer modes. Replace the array to accept arcgisItemCardSelect. */
|
|
111
|
+
accessor selectedItems: PortalItemCardSelectedItem[];
|
|
106
112
|
/**
|
|
107
|
-
* Type of selection behavior.
|
|
113
|
+
* Type of selection behavior. Sublayer modes render a built-in footer selector rather than a checkbox or radio.
|
|
108
114
|
*
|
|
109
115
|
* @default "none"
|
|
110
116
|
*/
|
|
@@ -175,6 +181,12 @@ export abstract class ArcgisPortalItemCard extends LitElement {
|
|
|
175
181
|
* @default true
|
|
176
182
|
*/
|
|
177
183
|
accessor showThumbnail: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Load thumbnails from production ArcGIS Online when viewing Online content in Enterprise.
|
|
186
|
+
*
|
|
187
|
+
* @default false
|
|
188
|
+
*/
|
|
189
|
+
accessor useProduction: boolean;
|
|
178
190
|
/** Current signed-in portal user. */
|
|
179
191
|
accessor user: PortalUser | undefined;
|
|
180
192
|
/** List of all the user's groups */
|
|
@@ -194,22 +206,22 @@ export abstract class ArcgisPortalItemCard extends LitElement {
|
|
|
194
206
|
readonly arcgisItemCardActionsOpen: import("@arcgis/lumina").TargetedEvent<this, PortalItemCardActionsOpenDetail>;
|
|
195
207
|
/** Fires on internal component interaction for telemetry. */
|
|
196
208
|
readonly arcgisItemCardInternalUIAction: import("@arcgis/lumina").TargetedEvent<this, InternalUIAction>;
|
|
197
|
-
/**
|
|
198
|
-
readonly arcgisItemCardSelect: import("@arcgis/lumina").TargetedEvent<this,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}>;
|
|
209
|
+
/** Requests an item, sublayer, or task selection change. In sublayer modes, the parent updates selectedItems. */
|
|
210
|
+
readonly arcgisItemCardSelect: import("@arcgis/lumina").TargetedEvent<this, PortalItemCardSublayerSelectDetail>;
|
|
211
|
+
/** Reports a service failure from the built-in sublayer selector. */
|
|
212
|
+
readonly arcgisItemCardSelectError: import("@arcgis/lumina").TargetedEvent<this, PortalItemCardSelectErrorDetail>;
|
|
202
213
|
readonly "@eventTypes": {
|
|
203
214
|
arcgisItemBrowserCardPreview: ArcgisPortalItemCard["arcgisItemBrowserCardPreview"]["detail"];
|
|
204
215
|
arcgisItemCardActionsOpen: ArcgisPortalItemCard["arcgisItemCardActionsOpen"]["detail"];
|
|
205
216
|
arcgisItemCardInternalUIAction: ArcgisPortalItemCard["arcgisItemCardInternalUIAction"]["detail"];
|
|
206
217
|
arcgisItemCardSelect: ArcgisPortalItemCard["arcgisItemCardSelect"]["detail"];
|
|
218
|
+
arcgisItemCardSelectError: ArcgisPortalItemCard["arcgisItemCardSelectError"]["detail"];
|
|
207
219
|
};
|
|
208
220
|
}
|
|
209
221
|
|
|
210
222
|
export type ItemCardView = "grid" | "list";
|
|
211
223
|
|
|
212
|
-
export type ItemCardSelection = "multiple" | "none" | "single";
|
|
224
|
+
export type ItemCardSelection = "multiple-sublayer" | "multiple" | "none" | "single-sublayer" | "single";
|
|
213
225
|
|
|
214
226
|
export type ItemCardPreview = "action" | "top";
|
|
215
227
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as P } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as B, html as r } from "lit";
|
|
4
|
-
import { formatDate as
|
|
5
|
-
import { LitElement as F, createEvent as
|
|
6
|
-
import { createRef as
|
|
4
|
+
import { formatDate as k, substitute as v } from "@arcgis/core/intl.js";
|
|
5
|
+
import { LitElement as F, createEvent as h, safeClassMap as d, nothing as g } from "@arcgis/lumina";
|
|
6
|
+
import { createRef as I, ref as S } from "lit/directives/ref.js";
|
|
7
7
|
import { u as U } from "../../chunks/useT9n.js";
|
|
8
8
|
import { b as C } from "../../chunks/ui.js";
|
|
9
|
-
import { a as
|
|
9
|
+
import { a as E } from "../../chunks/functionalities.js";
|
|
10
10
|
import { g as D } from "../../chunks/items.js";
|
|
11
|
-
import { b as
|
|
12
|
-
const
|
|
13
|
-
class
|
|
11
|
+
import { b as z } from "../../chunks/url.js";
|
|
12
|
+
const O = B`:host{display:block;min-width:0;container-type:inline-size;container-name:portal-item-card}.item-card{position:relative;display:flex;min-height:100%;flex-direction:column;color:var(--calcite-color-text-1);opacity:0;box-shadow:none;transition-duration:.15s;outline-color:transparent;background-color:var(--calcite-color-foreground-1);transition-property:background-color,outline,outline-offset,opacity;border:1px solid var(--calcite-color-border-3);&:focus{z-index:10;outline:2px solid var(--calcite-color-brand);outline-offset:-2px}}.item-card--loaded{opacity:1}.item-card--selected{border-color:var(--calcite-color-brand)}.item-card--previewed{outline:1px solid var(--calcite-color-brand);outline-offset:-2px}.item-card--hoverable{cursor:pointer}.item-card--disabled{opacity:.5;pointer-events:none}.item-card__upper{flex:1 1 0%;background-color:var(--calcite-color-foreground-1);transition:all var(--calcite-animation-timing) ease-in-out 0s,outline 0s,outline-offset 0s}.item-card__upper:hover{background-color:var(--calcite-color-background)}.item-card__upper--link{color:var(--calcite-color-text-1);text-decoration-line:none;outline-color:transparent;&:focus{z-index:10;outline:2px solid var(--calcite-color-brand);outline-offset:2px}}.item-card__upper:hover .item-card__hover-text,.item-card:focus .item-card__hover-text{opacity:1}.item-card__top{padding:.75rem}.item-card__content{display:flex;min-width:0;flex:1 1 0%;flex-direction:column}.item-card__content-end{min-width:0;margin-block-start:.25rem}.item-card__title{margin:0;overflow-wrap:break-word;padding:0;font-size:.875rem;font-weight:500;line-height:1.375}.item-card__title--grid{font-size:.875rem}.item-card__title--padded{margin-bottom:.25rem}.item-card__title__span{position:relative;display:inline;border-style:none;background-color:transparent;padding:0;transition:all var(--calcite-animation-timing) ease-in-out 0s,outline 0s,outline-offset 0s;background-image:linear-gradient(transparent,transparent);background-position-x:0%,100%;background-position-y:min(1.25em,100%);background-repeat:no-repeat,no-repeat;background-size:100% 1px,100% 1px}.item-card--previewed .item-card__title__span,.item-card__upper--link:hover .item-card__title__span{background-image:linear-gradient(var(--calcite-color-text-3),var(--calcite-color-text-3))}.item-card__summary{margin:0;flex:1 1 0%;color:var(--calcite-color-text-2);display:none;overflow-wrap:break-word;padding:0;font-size:.875rem;line-height:1.25}.item-card__detail--updated-full.item-card__divider{display:none}.item-card__details{margin-block-start:.25rem;display:flex;flex-direction:row}.item-card__detail{font-size:.75rem;line-height:1.35;color:var(--calcite-color-text-2)}.item-card__divider{display:flex;align-items:center;flex:0 0 auto}.item-card__divider:not([empty]):before{content:"";height:1.25rem;width:1px;background-color:var(--calcite-color-border-1);margin-inline:.75rem}.item-card__divider:first-child:before{display:none}.item-card__thumbnail{margin:0;width:5rem;height:3.5rem;margin-inline-start:.5rem;flex:0 0 auto;overflow:hidden;border-radius:.125rem}.item-card__thumbnail--grid{position:relative;width:100%;height:auto;aspect-ratio:16 / 9;margin:0;margin-inline-start:0;border-radius:0;border-bottom:1px solid var(--calcite-color-foreground-2)}.item-card__thumbnail-image{width:100%;height:100%;object-fit:cover;display:block}.item-card__thumbnail-media{display:block;width:100%;height:100%}.item-card__thumbnail-fallback{width:100%;height:100%;background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-3);display:flex;align-items:center;justify-content:center}.item-card__hover-text{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;opacity:0;color:var(--calcite-color-foreground-1);background-color:var(--calcite-color-transparent-scrim);font-size:.75rem;font-weight:500;text-align:center;transition:opacity var(--calcite-animation-timing) ease-in-out}.item-card__badges{display:flex;flex-wrap:wrap}.item-card__badges--compact{max-width:100%}.item-card__badges--responsive{display:none}.item-card__footer{margin-top:auto;display:flex;align-items:center;background-color:var(--calcite-color-foreground-1);padding:.25rem .75rem;border-top:1px solid var(--calcite-color-border-3)}.item-card__footer__start{display:flex;min-width:0;flex:1 1 0%;align-items:center;overflow:hidden;width:100%;margin-inline-end:.75rem}.item-card__footer__start--owner{margin-inline-start:-.25rem}.item-card__profile-wrap{max-width:100%;padding:.25rem}.item-card__owner{min-width:0}.item-card__footer-divider{height:1.25rem;width:1px;margin-inline:.75rem;background-color:var(--calcite-color-border-input)}.item-card__preview-button{margin-inline-end:.5rem}.item-card__footer arcgis-portal-item-favorite,.item-card__footer arcgis-portal-item-actions{display:inline-flex;align-items:center}.item-card__access-wrap{display:flex;align-items:center}.item-card-flex{display:flex}.item-card-flex-1{min-width:0;flex:1 1 0%}.item-card__input{margin-inline-end:1rem;margin-top:.125rem}.item-card__title+.item-card__input{margin-inline-start:1rem;margin-inline-end:0}.item-card__input--compact{height:100%;display:flex;align-items:center}.item-card-item-type{min-width:0}.screen-readers-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}@container portal-item-card (max-width: 320px){.item-card__title,.item-card__title--grid{font-size:.75rem}.item-card:not(.item-card--grid) .item-card__thumbnail{width:3.4375rem;margin-inline-start:.75rem}.item-card__footer__start{margin-inline-end:.5rem}.item-card__detail--updated-short{display:none}}@container portal-item-card (min-width: 321px) and (max-width: 480px){.item-card__title{font-size:.875rem}}@container portal-item-card (min-width: 481px){.item-card__top{padding:1rem}.item-card__title{font-size:1.125rem}.item-card__title--padded{margin-bottom:.5rem}.item-card__detail{font-size:.875rem}.item-card__footer{padding:.5rem 1rem}.item-card:not(.item-card--grid) .item-card__thumbnail{width:8rem;margin-inline-start:2rem}.item-card__summary{display:block}}@container portal-item-card (min-width: 641px){.item-card__badges--compact{display:none}.item-card__badges--responsive{display:flex}.item-card__summary{display:block}.item-card__footer{flex-wrap:nowrap;gap:0}.item-card__footer__start{width:auto;margin-inline-end:.75rem}.item-card__detail--updated-short{display:none}.item-card__detail--updated-full.item-card__divider{display:flex}.item-card:not(.item-card--grid) .item-card__thumbnail{height:4rem}}`;
|
|
13
|
+
class H extends F {
|
|
14
14
|
constructor() {
|
|
15
|
-
super(), this.messages = U({ blocking: !0 }), this.sectionEl =
|
|
15
|
+
super(), this.messages = U({ blocking: !0 }), this.sectionEl = I(), this.linkEl = I(), this.handleCardClick = (e) => {
|
|
16
16
|
if (!(this.link || this.disabled || e?.target?.closest(".item-card__footer"))) {
|
|
17
17
|
if (this.preview === "top" && !this.recycleBin) {
|
|
18
18
|
this.arcgisItemBrowserCardPreview.emit(this.item);
|
|
@@ -24,29 +24,32 @@ class O extends F {
|
|
|
24
24
|
}
|
|
25
25
|
this.selection === "multiple" && (this.selected = !this.selected, this.arcgisItemCardSelect.emit({ item: this.item, selected: this.selected }));
|
|
26
26
|
}
|
|
27
|
-
}, this.isLoaded = !1, this.cardWidth = 0, this.selected = !1, this.selection = "none", this.view = "list", this.previewed = !1, this.showOwner = !0, this.showDateUpdated = !0, this.showItemType = !0, this.showItemTypeHosted = !1, this.showSummary = !1, this.showBadges = !0, this.showBadgeTooltips = !0, this.showFavorite = !1, this.showFavoriteInActionsMenu = !1, this.showAccess = !1, this.showThumbnail = !0, this.newTab = !1, this.disableSelection = !1, this.disabled = !1, this.actions = [], this.recycleBin = !1, this.arcgisItemBrowserCardPreview =
|
|
27
|
+
}, this.isLoaded = !1, this.cardWidth = 0, this.selected = !1, this.selection = "none", this.selectedItems = [], this.allowedGeometries = [], this.view = "list", this.previewed = !1, this.showOwner = !0, this.showDateUpdated = !0, this.showItemType = !0, this.showItemTypeHosted = !1, this.showSummary = !1, this.showBadges = !0, this.showBadgeTooltips = !0, this.showFavorite = !1, this.showFavoriteInActionsMenu = !1, this.showAccess = !1, this.showThumbnail = !0, this.useProduction = !1, this.newTab = !1, this.disableSelection = !1, this.disabled = !1, this.actions = [], this.recycleBin = !1, this.arcgisItemBrowserCardPreview = h(), this.arcgisItemCardActionsOpen = h(), this.arcgisItemCardInternalUIAction = h(), this.arcgisItemCardSelect = h(), this.arcgisItemCardSelectError = h(), this.manager.onLifecycle(() => {
|
|
28
28
|
let e;
|
|
29
|
-
const
|
|
29
|
+
const i = new ResizeObserver(([s]) => {
|
|
30
30
|
e !== void 0 && (cancelAnimationFrame(e), e = void 0);
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
e = void 0, this.cardWidth =
|
|
31
|
+
const l = s.contentRect.width;
|
|
32
|
+
l > 0 && l !== this.cardWidth && (e = requestAnimationFrame(() => {
|
|
33
|
+
e = void 0, this.cardWidth = l;
|
|
34
34
|
}));
|
|
35
35
|
});
|
|
36
|
-
return
|
|
37
|
-
|
|
36
|
+
return i.observe(this.el), () => {
|
|
37
|
+
i.disconnect(), e !== void 0 && cancelAnimationFrame(e);
|
|
38
38
|
};
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
static {
|
|
42
|
-
this.properties = { isLoaded: 16, cardWidth: 16, item: 0, user: 0, portal: 0, selected: 7, selection: 1, view: 1, preview: 1, previewed: 5, name: 1, showOwner: 5, showDateUpdated: 5, showItemType: 5, showItemTypeHosted: 5, showSummary: 5, showBadges: 5, showBadgeTooltips: 5, showFavorite: 5, showFavoriteInActionsMenu: 5, showAccess: 5, groups: 0, userGroups: 0, showThumbnail: 5, link: 1, linkHandler: 0, newTab: 5, disableSelection: 5, disabled: 7, userPopupZIndex: 9, actions: 0, recycleBin: 5, hideActionsStart: 5 };
|
|
42
|
+
this.properties = { isLoaded: 16, cardWidth: 16, item: 0, user: 0, portal: 0, selected: 7, selection: 1, selectedItems: 0, allowedGeometries: 0, view: 1, preview: 1, previewed: 5, name: 1, showOwner: 5, showDateUpdated: 5, showItemType: 5, showItemTypeHosted: 5, showSummary: 5, showBadges: 5, showBadgeTooltips: 5, showFavorite: 5, showFavoriteInActionsMenu: 5, showAccess: 5, groups: 0, userGroups: 0, showThumbnail: 5, useProduction: 5, link: 1, linkHandler: 0, newTab: 5, disableSelection: 5, disabled: 7, userPopupZIndex: 9, actions: 0, recycleBin: 5, hideActionsStart: 5 };
|
|
43
43
|
}
|
|
44
44
|
static {
|
|
45
|
-
this.styles =
|
|
45
|
+
this.styles = O;
|
|
46
46
|
}
|
|
47
47
|
get sourceJSON() {
|
|
48
48
|
return D(this.item);
|
|
49
49
|
}
|
|
50
|
+
get sublayerSelection() {
|
|
51
|
+
return this.selection === "multiple-sublayer" ? "multiple" : this.selection === "single-sublayer" ? "single" : void 0;
|
|
52
|
+
}
|
|
50
53
|
async restoreFocus() {
|
|
51
54
|
if (await this.updateComplete, this.link && this.linkEl.value) {
|
|
52
55
|
this.linkEl.value.focus();
|
|
@@ -59,126 +62,132 @@ class O extends F {
|
|
|
59
62
|
this.isLoaded = !0;
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
|
-
getMessage(e,
|
|
65
|
+
getMessage(e, i = "") {
|
|
63
66
|
const s = this.messages[e];
|
|
64
|
-
return typeof s == "string" ? s :
|
|
67
|
+
return typeof s == "string" ? s : i;
|
|
65
68
|
}
|
|
66
69
|
getResolvedBaseUrl() {
|
|
67
|
-
return this.portal ? `${
|
|
70
|
+
return this.portal ? `${z({ portal: this.portal, usePortalHostname: !this.portal.user })}/home` : "";
|
|
68
71
|
}
|
|
69
72
|
handleSharingSlotChange() {
|
|
70
73
|
this.requestUpdate();
|
|
71
74
|
}
|
|
72
75
|
renderUpdatedDetails(e) {
|
|
73
|
-
return r`<span class="item-card__detail item-card__detail--updated-short item-card__divider">${
|
|
74
|
-
date:
|
|
76
|
+
return r`<span class="item-card__detail item-card__detail--updated-short item-card__divider">${k(e, { dateStyle: "medium" })}</span><span class="item-card__detail item-card__detail--updated-full item-card__divider">${v(this.messages.lastUpdated ?? "", {
|
|
77
|
+
date: k(e, { dateStyle: "medium" })
|
|
75
78
|
})}</span>`;
|
|
76
79
|
}
|
|
77
|
-
renderSelectionInput(e,
|
|
78
|
-
const { selection: s, disableSelection:
|
|
80
|
+
renderSelectionInput(e, i = !1) {
|
|
81
|
+
const { selection: s, disableSelection: l, name: f, messages: u, item: c } = this, n = {
|
|
79
82
|
"item-card__input": !0,
|
|
80
|
-
"item-card__input--compact":
|
|
83
|
+
"item-card__input--compact": i
|
|
81
84
|
};
|
|
82
85
|
switch (s) {
|
|
83
86
|
case "single":
|
|
84
|
-
return r`<calcite-radio-button class=${d(
|
|
87
|
+
return r`<calcite-radio-button class=${d(n)} .checked=${e} .disabled=${l} .value=${c.title ?? ""} .name=${f} @click=${(a) => {
|
|
85
88
|
a.stopPropagation();
|
|
86
89
|
}} @calciteRadioButtonChange=${() => {
|
|
87
90
|
this.selected = !0, this.arcgisItemCardSelect.emit({ item: c, selected: !0 });
|
|
88
|
-
}}><span class="screen-readers-only">${v(
|
|
91
|
+
}}><span class="screen-readers-only">${v(u.select ?? "", { title: c.title ?? "" })}</span></calcite-radio-button>`;
|
|
89
92
|
case "multiple":
|
|
90
|
-
return r`<calcite-checkbox class=${d(
|
|
93
|
+
return r`<calcite-checkbox class=${d(n)} .checked=${e} .disabled=${l} @click=${(a) => {
|
|
91
94
|
a.stopPropagation(), a.preventDefault();
|
|
92
95
|
}} @calciteCheckboxChange=${() => {
|
|
93
96
|
this.selected = !e, this.arcgisItemCardSelect.emit({ item: c, selected: !e });
|
|
94
97
|
}}><span class="screen-readers-only">${c.title ?? ""}</span></calcite-checkbox>`;
|
|
95
98
|
case "none":
|
|
99
|
+
case "multiple-sublayer":
|
|
100
|
+
case "single-sublayer":
|
|
96
101
|
return null;
|
|
97
102
|
default:
|
|
98
|
-
return
|
|
103
|
+
return E(s);
|
|
99
104
|
}
|
|
100
105
|
}
|
|
101
|
-
renderThumbnail(e,
|
|
102
|
-
return this.showThumbnail ?
|
|
106
|
+
renderThumbnail(e, i) {
|
|
107
|
+
return this.showThumbnail ? i ? r`<figure class="item-card__thumbnail item-card__thumbnail--grid"><arcgis-portal-item-thumbnail class="item-card__thumbnail-media" .item=${e} .portal=${this.portal} .user=${this.user} .useProduction=${this.useProduction}></arcgis-portal-item-thumbnail>${this.preview === "top" && !this.link && r`<div class="item-card__hover-text">${this.previewed ? this.messages.closePreview : this.messages.preview}</div>` || ""}${this.link?.includes(`item.html?id=${e.id}`) && r`<div class="item-card__hover-text">${this.messages.viewItemDetails}</div>` || ""}</figure>` : r`<figure class="item-card__thumbnail"><arcgis-portal-item-thumbnail class="item-card__thumbnail-media" .item=${e} .portal=${this.portal} .user=${this.user} .useProduction=${this.useProduction}></arcgis-portal-item-thumbnail></figure>` : null;
|
|
103
108
|
}
|
|
104
109
|
renderAccess() {
|
|
105
110
|
if (!this.showAccess)
|
|
106
111
|
return null;
|
|
107
|
-
const e = Array.from(this.el.children).some((
|
|
108
|
-
return r`<div class="item-card__access-wrap" @click=${(
|
|
109
|
-
|
|
110
|
-
}} @keydown=${(
|
|
111
|
-
(
|
|
112
|
+
const e = Array.from(this.el.children).some((i) => i.getAttribute("slot") === "share-summary");
|
|
113
|
+
return r`<div class="item-card__access-wrap" @click=${(i) => {
|
|
114
|
+
i.preventDefault(), i.stopPropagation();
|
|
115
|
+
}} @keydown=${(i) => {
|
|
116
|
+
(i.key === "Enter" || i.key === " ") && i.stopPropagation();
|
|
112
117
|
}}><slot name=share-summary @slotchange=${this.handleSharingSlotChange}>${!e && r`<arcgis-portal-item-share-summary .item=${this.item} .portal=${this.portal} .groups=${this.groups} .userGroups=${this.userGroups} .autoFetchGroups=${this.groups === void 0} .scale=${this.cardWidth <= C.xxs ? "s" : "m"} .showText=${this.view !== "grid" && this.cardWidth > C.md} overlay-positioning=fixed></arcgis-portal-item-share-summary>` || ""}</slot></div>`;
|
|
113
118
|
}
|
|
114
119
|
renderBadges() {
|
|
115
120
|
return !this.showBadges || !this.item || !this.portal ? null : this.view === "grid" ? r`<arcgis-portal-item-badges class="item-card__badges item-card__divider" .item=${this.item} .portal=${this.portal} .user=${this.user} scale=s appearance=outline-fill .showTooltips=${this.showBadgeTooltips} width=narrow></arcgis-portal-item-badges>` : r`<arcgis-portal-item-badges class="item-card__badges item-card__badges--compact item-card__divider" .item=${this.item} .portal=${this.portal} .user=${this.user} scale=s appearance=outline-fill .showTooltips=${this.showBadgeTooltips} width=narrow></arcgis-portal-item-badges><arcgis-portal-item-badges class="item-card__badges item-card__badges--responsive item-card__divider" .item=${this.item} .portal=${this.portal} .user=${this.user} scale=s appearance=outline-fill .showTooltips=${this.showBadgeTooltips} width=full></arcgis-portal-item-badges>`;
|
|
116
121
|
}
|
|
117
122
|
render() {
|
|
118
|
-
const { item: e, portal:
|
|
119
|
-
if (!e || !
|
|
123
|
+
const { item: e, portal: i, user: s, selection: l, isLoaded: f, disabled: u, link: c, newTab: n } = this;
|
|
124
|
+
if (!e || !i || !this.messages._lang)
|
|
120
125
|
return;
|
|
121
|
-
const a = this.sourceJSON,
|
|
126
|
+
const a = this.sourceJSON, _ = a.modified || e.modified, o = this.view === "grid", w = this.sublayerSelection, m = w ? this.selectedItems.some((t) => ("item" in t ? t.item.id : t.id) === e.id) : this.selected, b = this.preview === "action" && !this.recycleBin, $ = this.actions.length > 0 || this.showFavoriteInActionsMenu, y = this.showFavorite && !this.showFavoriteInActionsMenu && !this.useProduction && !!s, A = $ || y || b, T = (this.showAccess || o && this.showOwner) && A, p = this.preview === "top" && !c;
|
|
122
127
|
return r`<section class=${d({
|
|
123
128
|
"item-card": !0,
|
|
124
129
|
"item-card--grid": o,
|
|
125
|
-
"item-card--hoverable":
|
|
130
|
+
"item-card--hoverable": l !== "none",
|
|
126
131
|
"item-card--selected": m,
|
|
127
|
-
"item-card--disabled":
|
|
128
|
-
"item-card--loaded":
|
|
132
|
+
"item-card--disabled": u,
|
|
133
|
+
"item-card--loaded": f,
|
|
129
134
|
"item-card--previewed": this.previewed && p
|
|
130
|
-
})} @click=${c ? void 0 : this.handleCardClick} .tabIndex=${p ? 0 : -1} .role=${p ? "button" : void 0} aria-haspopup=${(p ? "dialog" : void 0) ??
|
|
131
|
-
p
|
|
132
|
-
}} ${
|
|
133
|
-
if (this.linkHandler && !
|
|
134
|
-
|
|
135
|
+
})} @click=${c ? void 0 : this.handleCardClick} .tabIndex=${p ? 0 : -1} .role=${p ? "button" : void 0} aria-haspopup=${(p ? "dialog" : void 0) ?? g} @keydown=${(t) => {
|
|
136
|
+
!p || t.target !== t.currentTarget || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.handleCardClick());
|
|
137
|
+
}} ${S(this.sectionEl)}><slot name=content-top></slot>${c ? r`<a class="item-card__upper item-card__upper--link" href=${c ?? g} target=${(n ? "_blank" : void 0) ?? g} rel=${(n ? "noopener noreferrer" : void 0) ?? g} @click=${(t) => {
|
|
138
|
+
if (this.linkHandler && !t.ctrlKey && !t.metaKey) {
|
|
139
|
+
t.preventDefault(), this.linkHandler(this.item);
|
|
135
140
|
return;
|
|
136
141
|
}
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
}} ${
|
|
142
|
+
const x = t.target;
|
|
143
|
+
x instanceof HTMLElement && x.closest(".item-card__footer") && t.preventDefault();
|
|
144
|
+
}} ${S(this.linkEl)}>${r`${o && this.renderThumbnail(e, !0) || ""}<div class="item-card-flex item-card__top">${!o && this.renderSelectionInput(m, !0) || ""}<div class="item-card-flex-1"><div class="item-card-flex"><div class="item-card__content"><div class="item-card-flex"><h3 class=${d({
|
|
140
145
|
"item-card__title": !0,
|
|
141
146
|
"item-card__title--grid": o,
|
|
142
147
|
"item-card__title--padded": this.showItemType || this.showSummary && !!a.snippet,
|
|
143
148
|
"item-card-flex-1": !0
|
|
144
|
-
})}><span class="item-card__title__span">${a.title ?? e.title ?? ""}</span></h3>${o && this.renderSelectionInput(m) || ""}</div>${this.showSummary && !!a.snippet && r`<p class="item-card__summary">${a.snippet.length > 250 ? `${a.snippet.substring(0, 250)}...` : a.snippet}</p>` || ""}<div class="item-card__details">${this.showItemType && r`<arcgis-portal-item-type class="item-card__divider item-card-item-type" ellipsis .user=${s} .showHosted=${this.showItemTypeHosted} scale=s .item=${e} .portal=${
|
|
149
|
+
})}><span class="item-card__title__span">${a.title ?? e.title ?? ""}</span></h3>${o && this.renderSelectionInput(m) || ""}</div>${this.showSummary && !!a.snippet && r`<p class="item-card__summary">${a.snippet.length > 250 ? `${a.snippet.substring(0, 250)}...` : a.snippet}</p>` || ""}<div class="item-card__details">${this.showItemType && r`<arcgis-portal-item-type class="item-card__divider item-card-item-type" ellipsis .user=${s} .showHosted=${this.showItemTypeHosted} scale=s .item=${e} .portal=${i}></arcgis-portal-item-type>` || ""}${this.showDateUpdated && !!_ && this.renderUpdatedDetails(_) || ""}${this.renderBadges()}</div></div>${!o && this.renderThumbnail(e, !1) || ""}</div><div class="item-card__content-end"><slot name=content-end></slot></div></div></div>`}</a>` : r`<div class="item-card__upper">${o && this.renderThumbnail(e, !0) || ""}<div class="item-card-flex item-card__top">${!o && this.renderSelectionInput(m, !0) || ""}<div class="item-card-flex-1"><div class="item-card-flex"><div class="item-card__content"><div class="item-card-flex"><h3 class=${d({
|
|
145
150
|
"item-card__title": !0,
|
|
146
151
|
"item-card__title--grid": o,
|
|
147
152
|
"item-card__title--padded": this.showItemType || this.showSummary && !!a.snippet,
|
|
148
153
|
"item-card-flex-1": !0
|
|
149
|
-
})}><span class="item-card__title__span">${a.title ?? e.title ?? ""}</span></h3>${o && this.renderSelectionInput(m) || ""}</div>${this.showSummary && !!a.snippet && r`<p class="item-card__summary">${a.snippet.length > 250 ? `${a.snippet.substring(0, 250)}...` : a.snippet}</p>` || ""}<div class="item-card__details">${this.showItemType && r`<arcgis-portal-item-type class="item-card__divider item-card-item-type" ellipsis .user=${s} .showHosted=${this.showItemTypeHosted} scale=s .item=${e} .portal=${
|
|
150
|
-
|
|
151
|
-
}}></arcgis-portal-user-popup></div>` || ""}</div>${this.renderAccess()}${
|
|
154
|
+
})}><span class="item-card__title__span">${a.title ?? e.title ?? ""}</span></h3>${o && this.renderSelectionInput(m) || ""}</div>${this.showSummary && !!a.snippet && r`<p class="item-card__summary">${a.snippet.length > 250 ? `${a.snippet.substring(0, 250)}...` : a.snippet}</p>` || ""}<div class="item-card__details">${this.showItemType && r`<arcgis-portal-item-type class="item-card__divider item-card-item-type" ellipsis .user=${s} .showHosted=${this.showItemTypeHosted} scale=s .item=${e} .portal=${i}></arcgis-portal-item-type>` || ""}${this.showDateUpdated && !!_ && this.renderUpdatedDetails(_) || ""}${this.renderBadges()}</div></div>${!o && this.renderThumbnail(e, !1) || ""}</div><div class="item-card__content-end"><slot name=content-end></slot></div></div></div></div>`}<div class="item-card__footer"><div class=${d({ "item-card__footer__start": !0, "item-card__footer__start--owner": this.showOwner })}>${!this.hideActionsStart && r`<slot name=actions-start></slot>` || ""}${this.showOwner && !!a.owner && r`<div class="item-card__profile-wrap"><arcgis-portal-user-popup class="item-card__owner" .portal=${i} .username=${a.owner} .baseUrl=${this.getResolvedBaseUrl()} underline .zIndex=${this.userPopupZIndex} @arcgisUserPopupInternalUIAction=${(t) => {
|
|
155
|
+
t.stopPropagation(), this.arcgisItemCardInternalUIAction.emit(t.detail);
|
|
156
|
+
}}></arcgis-portal-user-popup></div>` || ""}</div>${this.renderAccess()}${T && r`<span class="item-card__footer-divider"></span>` || ""}${y && r`<slot name=favorite-action><arcgis-portal-item-favorite .item=${e} .portal=${i} .user=${s} icon-only scale=s show-tooltip @arcgisItemFavoriteUpdate=${() => {
|
|
152
157
|
this.arcgisItemCardInternalUIAction.emit({
|
|
153
158
|
category: "card action",
|
|
154
159
|
action: "favorite"
|
|
155
160
|
});
|
|
156
|
-
}}></arcgis-portal-item-favorite></slot>` || ""}${
|
|
157
|
-
|
|
158
|
-
}}>${this.messages.preview}</calcite-button>` || ""}${
|
|
161
|
+
}}></arcgis-portal-item-favorite></slot>` || ""}${b && r`<calcite-button scale=s class="item-card__preview-button" .appearance=${this.previewed ? "solid" : "outline"} kind=neutral @click=${(t) => {
|
|
162
|
+
t.preventDefault(), t.stopPropagation(), this.arcgisItemBrowserCardPreview.emit(this.item);
|
|
163
|
+
}}>${this.messages.preview}</calcite-button>` || ""}${w && r`<arcgis-portal-item-card-sublayer-select .item=${e} .portal=${i} .selection=${w} .selectedItems=${this.selectedItems} .allowedGeometries=${this.allowedGeometries} .disabled=${u || this.disableSelection} @arcgisItemCardSelect=${(t) => {
|
|
164
|
+
t.stopPropagation(), this.arcgisItemCardSelect.emit(t.detail);
|
|
165
|
+
}} @arcgisItemCardSelectError=${(t) => {
|
|
166
|
+
t.stopPropagation(), this.arcgisItemCardSelectError.emit(t.detail);
|
|
167
|
+
}}></arcgis-portal-item-card-sublayer-select>` || ""}${$ && r`<arcgis-portal-item-actions .item=${e} .portal=${i} .user=${s} .actions=${this.actions} .label=${v(this.getMessage("itemActions", "Item actions for {title}"), {
|
|
159
168
|
title: a.title ?? e.title ?? ""
|
|
160
|
-
})} .showFavorite=${this.showFavoriteInActionsMenu && !!s} @arcgisItemActionsOpen=${(
|
|
161
|
-
|
|
169
|
+
})} .showFavorite=${this.showFavoriteInActionsMenu && !!s} @arcgisItemActionsOpen=${(t) => {
|
|
170
|
+
t.stopPropagation(), this.arcgisItemCardActionsOpen.emit({
|
|
162
171
|
actions: this.actions,
|
|
163
|
-
el:
|
|
172
|
+
el: t.detail.el
|
|
164
173
|
});
|
|
165
|
-
}} @arcgisItemActionClick=${(
|
|
166
|
-
|
|
174
|
+
}} @arcgisItemActionClick=${(t) => {
|
|
175
|
+
t.stopPropagation(), this.arcgisItemCardInternalUIAction.emit({
|
|
167
176
|
category: "card action",
|
|
168
177
|
action: "more options",
|
|
169
|
-
attribute:
|
|
178
|
+
attribute: t.detail
|
|
170
179
|
});
|
|
171
|
-
}} @arcgisItemFavoriteUpdate=${(
|
|
172
|
-
|
|
180
|
+
}} @arcgisItemFavoriteUpdate=${(t) => {
|
|
181
|
+
t.stopPropagation(), this.arcgisItemCardInternalUIAction.emit({
|
|
173
182
|
category: "card action",
|
|
174
183
|
action: "favorite"
|
|
175
184
|
});
|
|
176
|
-
}}></arcgis-portal-item-actions>` || ""}<div @click=${(
|
|
177
|
-
|
|
185
|
+
}}></arcgis-portal-item-actions>` || ""}<div @click=${(t) => {
|
|
186
|
+
t.stopPropagation();
|
|
178
187
|
}}><slot name=actions-end></slot></div></div></section>`;
|
|
179
188
|
}
|
|
180
189
|
}
|
|
181
|
-
|
|
190
|
+
P("arcgis-portal-item-card", H);
|
|
182
191
|
export {
|
|
183
|
-
|
|
192
|
+
H as ArcgisPortalItemCard
|
|
184
193
|
};
|
|
@@ -7,5 +7,6 @@ import "../arcgis-portal-item-type/index.js";
|
|
|
7
7
|
import "../arcgis-portal-user-popup/index.js";
|
|
8
8
|
import "../arcgis-portal-item-favorite/index.js";
|
|
9
9
|
import "@esri/calcite-components/components/calcite-button";
|
|
10
|
+
import "../arcgis-portal-item-card-sublayer-select/index.js";
|
|
10
11
|
import "../arcgis-portal-item-actions/index.js";
|
|
11
12
|
export * from "./customElement.js";
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import type Portal from "@arcgis/core/portal/Portal.js";
|
|
3
|
+
import type PortalItem from "@arcgis/core/portal/PortalItem.js";
|
|
4
|
+
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
5
|
+
import type { SearchResultSublayerGeometry } from "../../types/item.js";
|
|
6
|
+
import type { PortalItemCardSelectedItem, PortalItemCardSelectErrorDetail, PortalItemCardSublayerSelectDetail } from "./types.js";
|
|
7
|
+
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
8
|
+
import type { Button as Button } from "@esri/calcite-components/components/calcite-button";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Selects layers, tables, or tasks from a portal item.
|
|
12
|
+
* Selection is controlled by the parent through selectedItems and arcgisItemCardSelect.
|
|
13
|
+
* Parents can coordinate alerts using arcgisItemCardSelectError.
|
|
14
|
+
*/
|
|
15
|
+
export abstract class ArcgisPortalItemCardSublayerSelect extends LitElement {
|
|
16
|
+
/** Allowed geometries. Other geometries are disabled with an explanatory tooltip. An empty array permits all geometries. */
|
|
17
|
+
accessor allowedGeometries: SearchResultSublayerGeometry[];
|
|
18
|
+
/**
|
|
19
|
+
* Appearance of the select layers button (will always be solid if layers are selected)
|
|
20
|
+
*
|
|
21
|
+
* @default "outline"
|
|
22
|
+
*/
|
|
23
|
+
accessor appearance: Button["appearance"];
|
|
24
|
+
/**
|
|
25
|
+
* Disable user selection and service requests.
|
|
26
|
+
*
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
accessor disabled: boolean;
|
|
30
|
+
/** Portal item to select from. Search-index sublayers are read from sourceJSON. */
|
|
31
|
+
accessor item: PortalItem;
|
|
32
|
+
/** Overrides for localized messages. */
|
|
33
|
+
accessor messageOverrides: {
|
|
34
|
+
select?: string | undefined;
|
|
35
|
+
selectLayers?: string | undefined;
|
|
36
|
+
geometryNotAllowed?: string | undefined;
|
|
37
|
+
selectedSingle?: string | undefined;
|
|
38
|
+
selectedLayers?: string | undefined;
|
|
39
|
+
selectedName?: string | undefined;
|
|
40
|
+
selectedTask?: string | undefined;
|
|
41
|
+
errorTitle?: string | undefined;
|
|
42
|
+
errorBody?: string | undefined;
|
|
43
|
+
notebookErrorBody?: string | undefined;
|
|
44
|
+
retry?: string | undefined;
|
|
45
|
+
selectTask?: string | undefined;
|
|
46
|
+
selectTaskFrom?: string | undefined;
|
|
47
|
+
};
|
|
48
|
+
/** @internal */
|
|
49
|
+
protected messages: {
|
|
50
|
+
select: string;
|
|
51
|
+
selectLayers: string;
|
|
52
|
+
geometryNotAllowed: string;
|
|
53
|
+
selectedSingle: string;
|
|
54
|
+
selectedLayers: string;
|
|
55
|
+
selectedName: string;
|
|
56
|
+
selectedTask: string;
|
|
57
|
+
errorTitle: string;
|
|
58
|
+
errorBody: string;
|
|
59
|
+
notebookErrorBody: string;
|
|
60
|
+
retry: string;
|
|
61
|
+
selectTask: string;
|
|
62
|
+
selectTaskFrom: string;
|
|
63
|
+
} & T9nMeta<{
|
|
64
|
+
select: string;
|
|
65
|
+
selectLayers: string;
|
|
66
|
+
geometryNotAllowed: string;
|
|
67
|
+
selectedSingle: string;
|
|
68
|
+
selectedLayers: string;
|
|
69
|
+
selectedName: string;
|
|
70
|
+
selectedTask: string;
|
|
71
|
+
errorTitle: string;
|
|
72
|
+
errorBody: string;
|
|
73
|
+
notebookErrorBody: string;
|
|
74
|
+
retry: string;
|
|
75
|
+
selectTask: string;
|
|
76
|
+
selectTaskFrom: string;
|
|
77
|
+
}>;
|
|
78
|
+
/** Current Portal instance */
|
|
79
|
+
accessor portal: Portal;
|
|
80
|
+
/** Current parent-controlled selection. Replace the array to accept a selection event; ignored events leave the UI unchanged. */
|
|
81
|
+
accessor selectedItems: PortalItemCardSelectedItem[];
|
|
82
|
+
/**
|
|
83
|
+
* Type of selection
|
|
84
|
+
*
|
|
85
|
+
* @default "single"
|
|
86
|
+
*/
|
|
87
|
+
accessor selection: "multiple" | "single";
|
|
88
|
+
/**
|
|
89
|
+
* Width of the selection dropdown trigger
|
|
90
|
+
*
|
|
91
|
+
* @default "auto"
|
|
92
|
+
*/
|
|
93
|
+
accessor width: "auto" | "full";
|
|
94
|
+
/** Requests a selection change; the parent updates selectedItems. */
|
|
95
|
+
readonly arcgisItemCardSelect: import("@arcgis/lumina").TargetedEvent<this, PortalItemCardSublayerSelectDetail>;
|
|
96
|
+
/** Reports service failures. Alert coordination, if desired, belongs to the parent. */
|
|
97
|
+
readonly arcgisItemCardSelectError: import("@arcgis/lumina").TargetedEvent<this, PortalItemCardSelectErrorDetail>;
|
|
98
|
+
readonly "@eventTypes": {
|
|
99
|
+
arcgisItemCardSelect: ArcgisPortalItemCardSublayerSelect["arcgisItemCardSelect"]["detail"];
|
|
100
|
+
arcgisItemCardSelectError: ArcgisPortalItemCardSublayerSelect["arcgisItemCardSelectError"]["detail"];
|
|
101
|
+
};
|
|
102
|
+
}
|