@arcgis/portal-components 5.2.0-next.65 → 5.2.0-next.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/cdn/2BUE3JLM.js +2 -0
  2. package/dist/cdn/{Y7FCEDRU.js → 2OU5PLGU.js} +1 -1
  3. package/dist/cdn/2WI5FBDF.js +2 -0
  4. package/dist/cdn/3VHBMKYX.js +2 -0
  5. package/dist/cdn/64DIXKV3.js +2 -0
  6. package/dist/cdn/6KVA4AKM.js +2 -0
  7. package/dist/cdn/6TO2BYXU.js +2 -0
  8. package/dist/cdn/AR6YIWRX.js +2 -0
  9. package/dist/cdn/CYCKQHLO.js +2 -0
  10. package/dist/cdn/{ZV4GLQQG.js → D4VYYWA6.js} +1 -1
  11. package/dist/cdn/DEOAKHYN.js +2 -0
  12. package/dist/cdn/FKVT4PNP.js +2 -0
  13. package/dist/cdn/GC6YLNZF.js +2 -0
  14. package/dist/cdn/{VD6VGWCQ.js → JMEXULSL.js} +1 -1
  15. package/dist/cdn/KTBQ26TD.js +2 -0
  16. package/dist/cdn/LRADZ46B.js +2 -0
  17. package/dist/cdn/NWT7EITA.js +2 -0
  18. package/dist/cdn/{EE7XFMJG.js → O5AP2PN5.js} +1 -1
  19. package/dist/cdn/OUNIRHWU.js +2 -0
  20. package/dist/cdn/{XW42SAEJ.js → QFI3ZPNB.js} +1 -1
  21. package/dist/cdn/QMFRNHQJ.js +2 -0
  22. package/dist/cdn/QNA62UMC.js +2 -0
  23. package/dist/cdn/{6RLJVPF6.js → QWMWVF47.js} +1 -1
  24. package/dist/cdn/RWQL7W3X.js +2 -0
  25. package/dist/cdn/T6Z7IFG2.js +2 -0
  26. package/dist/cdn/USQ4RJYL.js +2 -0
  27. package/dist/cdn/{Q7SDLUZ6.js → V257KGGO.js} +1 -1
  28. package/dist/cdn/XSUV6RLR.js +2 -0
  29. package/dist/cdn/XTTOOMCY.js +66 -0
  30. package/dist/cdn/{CG4WYBHN.js → XUIVR4NX.js} +1 -1
  31. package/dist/cdn/{7YQTBSDS.js → YQV3M6JO.js} +109 -84
  32. package/dist/cdn/{SOJU4OFZ.js → ZMTS73PF.js} +1 -1
  33. package/dist/cdn/ZSNLY6QY.js +2 -0
  34. package/dist/cdn/assets/portal-item-badges/t9n/messages.en.json +1 -0
  35. package/dist/cdn/assets/portal-item-card/t9n/messages.en.json +1 -0
  36. package/dist/cdn/assets/portal-item-favorite/t9n/messages.en.json +1 -0
  37. package/dist/cdn/assets/portal-item-type/icons/applicationtheme16.svg +1 -0
  38. package/dist/cdn/assets/portal-item-type/icons/applicationtheme32.svg +1 -0
  39. package/dist/cdn/assets/portal-item-type/icons/layout16.svg +1 -0
  40. package/dist/cdn/assets/portal-item-type/icons/layout32.svg +1 -0
  41. package/dist/cdn/index.js +1 -1
  42. package/dist/cdn/main.css +1 -1
  43. package/dist/chunks/fieldAddDelete.js +1 -1
  44. package/dist/chunks/info.js +179 -0
  45. package/dist/chunks/item.js +8 -8
  46. package/dist/chunks/items.js +16 -0
  47. package/dist/chunks/portal-item-badge.js +346 -0
  48. package/dist/chunks/portal.js +3 -3
  49. package/dist/chunks/portal2.js +3 -3
  50. package/dist/chunks/query.js +4 -4
  51. package/dist/chunks/string.js +2 -2
  52. package/dist/chunks/users.js +7 -0
  53. package/dist/chunks/utils.js +75 -636
  54. package/dist/chunks/utils2.js +653 -0
  55. package/dist/chunks/verified.js +40 -0
  56. package/dist/components/arcgis-portal-account-switcher/customElement.js +58 -72
  57. package/dist/components/arcgis-portal-account-switcher-list/customElement.js +6 -6
  58. package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +9 -7
  59. package/dist/components/arcgis-portal-ai-assistant/customElement.js +944 -775
  60. package/dist/components/arcgis-portal-field-delete/customElement.js +2 -1
  61. package/dist/components/arcgis-portal-group-browser/customElement.js +3 -3
  62. package/dist/components/arcgis-portal-group-browser/types.d.ts +6 -2
  63. package/dist/components/arcgis-portal-group-browser-preview/customElement.d.ts +9 -9
  64. package/dist/components/arcgis-portal-group-browser-preview/customElement.js +16 -16
  65. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.d.ts +18 -18
  66. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.js +31 -30
  67. package/dist/components/arcgis-portal-group-card/customElement.d.ts +25 -25
  68. package/dist/components/arcgis-portal-group-card/customElement.js +7 -7
  69. package/dist/components/arcgis-portal-item-actions/customElement.d.ts +74 -0
  70. package/dist/components/arcgis-portal-item-actions/customElement.js +89 -0
  71. package/dist/components/arcgis-portal-item-actions/index.d.ts +1 -0
  72. package/dist/components/arcgis-portal-item-actions/index.js +5 -0
  73. package/dist/components/arcgis-portal-item-badge/customElement.d.ts +260 -0
  74. package/dist/components/arcgis-portal-item-badge/customElement.js +9 -0
  75. package/dist/components/arcgis-portal-item-badge/index.d.ts +1 -0
  76. package/dist/components/arcgis-portal-item-badge/index.js +5 -0
  77. package/dist/components/arcgis-portal-item-badges/customElement.d.ts +48 -0
  78. package/dist/components/arcgis-portal-item-badges/customElement.js +35 -0
  79. package/dist/components/arcgis-portal-item-badges/index.d.ts +1 -0
  80. package/dist/components/arcgis-portal-item-badges/index.js +2 -0
  81. package/dist/components/arcgis-portal-item-badges/types.d.ts +1 -0
  82. package/dist/components/arcgis-portal-item-card/customElement.d.ts +215 -0
  83. package/dist/components/arcgis-portal-item-card/customElement.js +190 -0
  84. package/dist/components/arcgis-portal-item-card/index.d.ts +1 -0
  85. package/dist/components/arcgis-portal-item-card/index.js +10 -0
  86. package/dist/components/arcgis-portal-item-favorite/customElement.d.ts +36 -0
  87. package/dist/components/arcgis-portal-item-favorite/customElement.js +66 -0
  88. package/dist/components/arcgis-portal-item-favorite/index.d.ts +1 -0
  89. package/dist/components/arcgis-portal-item-favorite/index.js +3 -0
  90. package/dist/components/arcgis-portal-item-favorite/utils.d.ts +4 -0
  91. package/dist/components/arcgis-portal-item-type/customElement.js +1 -1
  92. package/dist/components/arcgis-portal-navigation/customElement.js +40 -40
  93. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +42 -214
  94. package/dist/components/arcgis-portal-user-popup/customElement.js +66 -100
  95. package/dist/components/portal-group-browser-filters/customElement.js +71 -73
  96. package/dist/docs/api.json +1 -1
  97. package/dist/docs/docs.json +1 -1
  98. package/dist/docs/vscode.html-custom-data.json +1 -1
  99. package/dist/docs/web-types.json +1 -1
  100. package/dist/index.d.ts +38 -0
  101. package/dist/loader.js +9 -4
  102. package/dist/types/item.d.ts +5 -1
  103. package/dist/types/lumina.d.ts +38 -4
  104. package/dist/types/preact.d.ts +43 -4
  105. package/dist/types/react.d.ts +48 -4
  106. package/dist/types/stencil.d.ts +38 -4
  107. package/package.json +6 -6
  108. package/dist/cdn/332KSPIN.js +0 -2
  109. package/dist/cdn/7PPA7V23.js +0 -2
  110. package/dist/cdn/DML7662F.js +0 -2
  111. package/dist/cdn/FF24VDOG.js +0 -65
  112. package/dist/cdn/G2NXASJO.js +0 -2
  113. package/dist/cdn/JZTBGLFH.js +0 -2
  114. package/dist/cdn/PP7GTURX.js +0 -2
  115. package/dist/cdn/QQ432AB6.js +0 -2
  116. package/dist/cdn/RKWOBE3M.js +0 -2
  117. package/dist/cdn/V4IAC7WR.js +0 -2
  118. package/dist/cdn/WEJQVIN4.js +0 -2
  119. package/dist/cdn/ZK2VXTNX.js +0 -2
  120. package/dist/components/portal-browser/components/portal-browser-filter-date/portal-browser-filter-date.d.ts +0 -122
@@ -0,0 +1,190 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { c as S } from "../../chunks/runtime.js";
3
+ import { css as U, html as t } from "lit";
4
+ import { formatDate as y, substitute as w } from "@arcgis/core/intl.js";
5
+ import { LitElement as B, createEvent as g, safeClassMap as d, nothing as l } from "@arcgis/lumina";
6
+ import { createRef as k, ref as I } from "lit/directives/ref.js";
7
+ import { u as F } from "../../chunks/useT9n.js";
8
+ import { g as z } from "../../chunks/items.js";
9
+ import { g as D } from "../../chunks/url.js";
10
+ import { g as P } from "../../chunks/thumbnail.js";
11
+ import { a as E } from "../../chunks/functionalities.js";
12
+ const O = U`: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-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__access{display:flex;align-items:center;color:var(--calcite-color-text-2);font-size:.75rem}.item-card__detail__icon{margin-inline-end:.375rem}.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 B {
14
+ constructor() {
15
+ super(...arguments), this.messages = F({ blocking: !0 }), this.sectionEl = k(), this.linkEl = k(), this.handleCardClick = (e) => {
16
+ if (!(this.link || this.disabled || e?.target?.closest(".item-card__footer"))) {
17
+ if (this.preview === "top" && !this.recycleBin) {
18
+ this.arcgisItemBrowserCardPreview.emit(this.item);
19
+ return;
20
+ }
21
+ if (this.selection === "single") {
22
+ this.selected = !0, this.arcgisItemCardSelect.emit({ item: this.item, selected: !0 });
23
+ return;
24
+ }
25
+ this.selection === "multiple" && (this.selected = !this.selected, this.arcgisItemCardSelect.emit({ item: this.item, selected: this.selected }));
26
+ }
27
+ }, this.isLoaded = !1, 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 = g(), this.arcgisItemCardActionsOpen = g(), this.arcgisItemCardInternalUIAction = g(), this.arcgisItemCardSelect = g();
28
+ }
29
+ static {
30
+ this.properties = { isLoaded: 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, showThumbnail: 5, link: 1, linkHandler: 0, newTab: 5, disableSelection: 5, disabled: 7, userPopupZIndex: 9, actions: 0, recycleBin: 5, hideActionsStart: 5 };
31
+ }
32
+ static {
33
+ this.styles = O;
34
+ }
35
+ get sourceJSON() {
36
+ return z(this.item);
37
+ }
38
+ async restoreFocus() {
39
+ if (this.link && this.linkEl.value) {
40
+ this.linkEl.value.focus();
41
+ return;
42
+ }
43
+ this.preview === "top" && this.sectionEl.value && this.sectionEl.value.focus();
44
+ }
45
+ firstUpdated() {
46
+ requestAnimationFrame(() => {
47
+ this.isLoaded = !0;
48
+ });
49
+ }
50
+ getThumbnailUri(e) {
51
+ return e.thumbnailUrl ?? P(this.portal, e);
52
+ }
53
+ getAccessInfo(e) {
54
+ return {
55
+ public: {
56
+ icon: "globe",
57
+ text: this.messages.everyone
58
+ },
59
+ private: {
60
+ icon: "lock",
61
+ text: this.messages.owner
62
+ },
63
+ org: {
64
+ icon: "organization",
65
+ text: this.messages.organization
66
+ },
67
+ shared: {
68
+ icon: "group",
69
+ text: this.messages.group
70
+ }
71
+ }[e];
72
+ }
73
+ getMessage(e, s = "") {
74
+ const a = this.messages[e];
75
+ return typeof a == "string" ? a : s;
76
+ }
77
+ getResolvedBaseUrl() {
78
+ return this.portal ? `${D({ portal: this.portal, usePortalHostname: !this.portal.user })}/home` : "";
79
+ }
80
+ renderUpdatedDetails(e) {
81
+ return t`<span class="item-card__detail item-card__detail--updated-short item-card__divider">${y(e, { dateStyle: "medium" })}</span><span class="item-card__detail item-card__detail--updated-full item-card__divider">${w(this.messages.lastUpdated ?? "", {
82
+ date: y(e, { dateStyle: "medium" })
83
+ })}</span>`;
84
+ }
85
+ renderSelectionInput(e, s = !1) {
86
+ const { selection: a, disableSelection: _, name: f, messages: v, item: c } = this, m = {
87
+ "item-card__input": !0,
88
+ "item-card__input--compact": s
89
+ };
90
+ switch (a) {
91
+ case "single":
92
+ return t`<calcite-radio-button class=${d(m)} .checked=${e} .disabled=${_} .value=${c.title ?? ""} .name=${f} @click=${(i) => {
93
+ i.stopPropagation();
94
+ }} @calciteRadioButtonChange=${() => {
95
+ this.selected = !0, this.arcgisItemCardSelect.emit({ item: c, selected: !0 });
96
+ }}><span class="screen-readers-only">${w(v.select ?? "", { title: c.title ?? "" })}</span></calcite-radio-button>`;
97
+ case "multiple":
98
+ return t`<calcite-checkbox class=${d(m)} .checked=${e} .disabled=${_} @click=${(i) => {
99
+ i.stopPropagation(), i.preventDefault();
100
+ }} @calciteCheckboxChange=${() => {
101
+ this.selected = !e, this.arcgisItemCardSelect.emit({ item: c, selected: !e });
102
+ }}><span class="screen-readers-only">${c.title ?? ""}</span></calcite-checkbox>`;
103
+ case "none":
104
+ return null;
105
+ default:
106
+ return E(a);
107
+ }
108
+ }
109
+ renderThumbnail(e, s) {
110
+ if (!this.showThumbnail)
111
+ return null;
112
+ const a = this.getThumbnailUri(e);
113
+ return s ? t`<figure class="item-card__thumbnail item-card__thumbnail--grid">${a ? t`<img class="item-card__thumbnail-image" src=${a ?? l} alt>` : t`<div class="item-card__thumbnail-fallback" aria-hidden=true><calcite-icon icon=file scale=m></calcite-icon></div>`}${this.preview === "top" && !this.link && t`<div class="item-card__hover-text">${this.previewed ? this.messages.closePreview : this.messages.preview}</div>` || ""}${this.link?.includes(`item.html?id=${e.id}`) && t`<div class="item-card__hover-text">${this.messages.viewItemDetails}</div>` || ""}</figure>` : t`<figure class="item-card__thumbnail">${a ? t`<img class="item-card__thumbnail-image" src=${a ?? l} alt>` : t`<div class="item-card__thumbnail-fallback" aria-hidden=true><calcite-icon icon=file scale=m></calcite-icon></div>`}</figure>`;
114
+ }
115
+ renderAccess(e) {
116
+ return this.showAccess ? t`<div class="item-card__access-wrap" @click=${(s) => {
117
+ s.preventDefault(), s.stopPropagation();
118
+ }}><slot name=sharing-summary><slot name=share-summary><span class="item-card__access"><calcite-icon .icon=${e.icon} scale=s class="item-card__detail__icon"></calcite-icon>${e.text}</span></slot></slot></div>` : null;
119
+ }
120
+ renderBadges() {
121
+ return !this.showBadges || !this.item || !this.portal ? null : this.view === "grid" ? t`<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>` : t`<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>`;
122
+ }
123
+ render() {
124
+ const { item: e, portal: s, user: a, selection: _, isLoaded: f, disabled: v, link: c, newTab: m } = this;
125
+ if (!e || !s || !this.messages._lang)
126
+ return;
127
+ const i = this.sourceJSON, u = i.modified || e.modified, T = this.getAccessInfo(i.access), o = this.view === "grid", p = this.selected, b = this.preview === "action" && !this.recycleBin, $ = this.actions.length > 0 || this.showFavoriteInActionsMenu, x = this.showFavorite && !this.showFavoriteInActionsMenu && !!a, A = $ || x || b, C = (this.showAccess || o && this.showOwner) && A, h = this.preview === "top" && !c;
128
+ return t`<section class=${d({
129
+ "item-card": !0,
130
+ "item-card--grid": o,
131
+ "item-card--hoverable": _ !== "none",
132
+ "item-card--selected": p,
133
+ "item-card--disabled": v,
134
+ "item-card--loaded": f,
135
+ "item-card--previewed": this.previewed && h
136
+ })} @click=${c ? void 0 : this.handleCardClick} tabindex=${(h ? 0 : void 0) ?? l} .role=${h ? "button" : void 0} aria-haspopup=${(h ? "dialog" : void 0) ?? l} @keydown=${(r) => {
137
+ h && (r.key === "Enter" || r.key === " ") && (r.preventDefault(), this.handleCardClick());
138
+ }} ${I(this.sectionEl)}><slot name=content-top></slot>${c ? t`<a class="item-card__upper item-card__upper--link" href=${c ?? l} target=${(m ? "_blank" : void 0) ?? l} rel=${(m ? "noopener noreferrer" : void 0) ?? l} @click=${(r) => {
139
+ if (this.linkHandler && !r.ctrlKey && !r.metaKey) {
140
+ r.preventDefault(), this.linkHandler(this.item);
141
+ return;
142
+ }
143
+ const n = r.target;
144
+ n instanceof HTMLElement && n.closest(".item-card__footer") && r.preventDefault();
145
+ }} ${I(this.linkEl)}>${t`${o && this.renderThumbnail(e, !0) || ""}<div class="item-card-flex item-card__top">${!o && this.renderSelectionInput(p, !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({
146
+ "item-card__title": !0,
147
+ "item-card__title--grid": o,
148
+ "item-card__title--padded": this.showItemType || this.showSummary && !!i.snippet,
149
+ "item-card-flex-1": !0
150
+ })}><span class="item-card__title__span">${i.title ?? e.title ?? ""}</span></h3>${o && this.renderSelectionInput(p) || ""}</div>${this.showSummary && !!i.snippet && t`<p class="item-card__summary">${i.snippet.length > 250 ? `${i.snippet.substring(0, 250)}...` : i.snippet}</p>` || ""}<div class="item-card__details">${this.showItemType && t`<arcgis-portal-item-type class="item-card__divider item-card-item-type" ellipsis .user=${a} .showHosted=${this.showItemTypeHosted} scale=s .item=${e} .portal=${s}></arcgis-portal-item-type>` || ""}${this.showDateUpdated && !!u && this.renderUpdatedDetails(u) || ""}${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>` : t`<div class="item-card__upper">${o && this.renderThumbnail(e, !0) || ""}<div class="item-card-flex item-card__top">${!o && this.renderSelectionInput(p, !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({
151
+ "item-card__title": !0,
152
+ "item-card__title--grid": o,
153
+ "item-card__title--padded": this.showItemType || this.showSummary && !!i.snippet,
154
+ "item-card-flex-1": !0
155
+ })}><span class="item-card__title__span">${i.title ?? e.title ?? ""}</span></h3>${o && this.renderSelectionInput(p) || ""}</div>${this.showSummary && !!i.snippet && t`<p class="item-card__summary">${i.snippet.length > 250 ? `${i.snippet.substring(0, 250)}...` : i.snippet}</p>` || ""}<div class="item-card__details">${this.showItemType && t`<arcgis-portal-item-type class="item-card__divider item-card-item-type" ellipsis .user=${a} .showHosted=${this.showItemTypeHosted} scale=s .item=${e} .portal=${s}></arcgis-portal-item-type>` || ""}${this.showDateUpdated && !!u && this.renderUpdatedDetails(u) || ""}${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 && t`<slot name=actions-start></slot>` || ""}${this.showOwner && !!i.owner && t`<div class="item-card__profile-wrap"><arcgis-portal-user-popup class="item-card__owner" .portal=${s} .username=${i.owner} .baseUrl=${this.getResolvedBaseUrl()} underline .zIndex=${this.userPopupZIndex} @arcgisUserPopupInternalUIAction=${({ detail: r, stopPropagation: n }) => {
156
+ n(), this.arcgisItemCardInternalUIAction.emit(r);
157
+ }}></arcgis-portal-user-popup></div>` || ""}</div>${this.renderAccess(T)}${C && t`<span class="item-card__footer-divider"></span>` || ""}${x && t`<slot name=favorite-action><arcgis-portal-item-favorite .item=${e} .portal=${s} .user=${a} icon-only scale=s show-tooltip @arcgisItemFavoriteUpdate=${() => {
158
+ this.arcgisItemCardInternalUIAction.emit({
159
+ category: "card action",
160
+ action: "favorite"
161
+ });
162
+ }}></arcgis-portal-item-favorite></slot>` || ""}${b && t`<calcite-button scale=s class="item-card__preview-button" .appearance=${this.previewed ? "solid" : "outline"} kind=neutral @click=${(r) => {
163
+ r.preventDefault(), r.stopPropagation(), this.arcgisItemBrowserCardPreview.emit(this.item);
164
+ }}>${this.messages.preview}</calcite-button>` || ""}${$ && t`<arcgis-portal-item-actions .item=${e} .portal=${s} .user=${a} .actions=${this.actions} .label=${w(this.getMessage("itemActions", "Item actions for {title}"), {
165
+ title: i.title ?? e.title ?? ""
166
+ })} .showFavorite=${this.showFavoriteInActionsMenu && !!a} @arcgisItemActionsOpen=${({ detail: r, stopPropagation: n }) => {
167
+ n(), this.arcgisItemCardActionsOpen.emit({
168
+ actions: this.actions,
169
+ el: r.el
170
+ });
171
+ }} @arcgisItemActionClick=${({ detail: r, stopPropagation: n }) => {
172
+ n(), this.arcgisItemCardInternalUIAction.emit({
173
+ category: "card action",
174
+ action: "more options",
175
+ attribute: r
176
+ });
177
+ }} @arcgisItemFavoriteUpdate=${({ stopPropagation: r }) => {
178
+ r(), this.arcgisItemCardInternalUIAction.emit({
179
+ category: "card action",
180
+ action: "favorite"
181
+ });
182
+ }}></arcgis-portal-item-actions>` || ""}<div @click=${(r) => {
183
+ r.stopPropagation();
184
+ }}><slot name=actions-end></slot></div></div></section>`;
185
+ }
186
+ }
187
+ S("arcgis-portal-item-card", H);
188
+ export {
189
+ H as ArcgisPortalItemCard
190
+ };
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1,10 @@
1
+ import "@esri/calcite-components/components/calcite-radio-button";
2
+ import "@esri/calcite-components/components/calcite-checkbox";
3
+ import "@esri/calcite-components/components/calcite-icon";
4
+ import "../arcgis-portal-item-badges/index.js";
5
+ import "../arcgis-portal-item-type/index.js";
6
+ import "../arcgis-portal-user-popup/index.js";
7
+ import "../arcgis-portal-item-favorite/index.js";
8
+ import "@esri/calcite-components/components/calcite-button";
9
+ import "../arcgis-portal-item-actions/index.js";
10
+ export * from "./customElement.js";
@@ -0,0 +1,36 @@
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 PortalUser from "@arcgis/core/portal/PortalUser.js";
5
+ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
6
+ import type { FavoriteUpdate } from "./utils.js";
7
+ import type { T9nMeta } from "@arcgis/lumina/controllers";
8
+ import type { Button as Button } from "@esri/calcite-components/components/calcite-button";
9
+
10
+ export abstract class ArcgisPortalItemFavorite extends LitElement {
11
+ /** @default false */
12
+ accessor iconOnly: boolean;
13
+ accessor item: PortalItem;
14
+ /** @internal */
15
+ protected messages: {
16
+ add: string;
17
+ remove: string;
18
+ } & T9nMeta<{
19
+ add: string;
20
+ remove: string;
21
+ }>;
22
+ accessor portal: Portal;
23
+ /** @default "m" */
24
+ accessor scale: Button["scale"];
25
+ /** @default false */
26
+ accessor showTooltip: boolean;
27
+ accessor user: PortalUser | undefined;
28
+ /** @default "full" */
29
+ accessor width: Button["width"];
30
+ setFocus(): Promise<void>;
31
+ /** Fires when user changes the favorite status. */
32
+ readonly arcgisItemFavoriteUpdate: import("@arcgis/lumina").TargetedEvent<this, FavoriteUpdate>;
33
+ readonly "@eventTypes": {
34
+ arcgisItemFavoriteUpdate: ArcgisPortalItemFavorite["arcgisItemFavoriteUpdate"]["detail"];
35
+ };
36
+ }
@@ -0,0 +1,66 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { c as n } from "../../chunks/runtime.js";
3
+ import { LitElement as c, createEvent as d } from "@arcgis/lumina";
4
+ import { html as r } from "lit";
5
+ import { createRef as v, ref as u } from "lit/directives/ref.js";
6
+ import { u as f } from "../../chunks/useT9n.js";
7
+ import { g as m, t as p, i as F } from "../../chunks/utils.js";
8
+ class g extends c {
9
+ constructor() {
10
+ super(), this.messages = f({ blocking: !0 }), this.buttonRef = v(), this.favoriteRequestId = 0, this.handleFavoriteUpdate = (t) => {
11
+ const i = m(t, this.item?.id ?? void 0);
12
+ i && (this.isFavorite = i.favorite);
13
+ }, this.handleToggleFavorite = async (t) => {
14
+ t.preventDefault(), t.stopPropagation();
15
+ const { item: i, portal: s, user: a } = this;
16
+ if (!i.id || !s || !a)
17
+ return;
18
+ const h = {
19
+ id: i.id,
20
+ access: i.access
21
+ }, o = this.isFavorite, e = !o;
22
+ this.isFavorite = e;
23
+ const { updated: l } = await p({
24
+ currentFavorite: o,
25
+ item: h,
26
+ portal: s,
27
+ user: a
28
+ });
29
+ if (!l) {
30
+ this.isFavorite = !e;
31
+ return;
32
+ }
33
+ this.arcgisItemFavoriteUpdate.emit({
34
+ id: i.id,
35
+ favorite: e
36
+ });
37
+ }, this.isFavorite = !1, this.isFavoriteLoaded = !1, this.width = "full", this.iconOnly = !1, this.scale = "m", this.showTooltip = !1, this.arcgisItemFavoriteUpdate = d(), this.listenOn(window, "arcgisItemFavoriteUpdate", this.handleFavoriteUpdate);
38
+ }
39
+ static {
40
+ this.properties = { isFavorite: 16, isFavoriteLoaded: 16, item: 0, portal: 0, user: 0, width: 1, iconOnly: 5, scale: 1, showTooltip: 5 };
41
+ }
42
+ async setFocus() {
43
+ await this.buttonRef.value?.setFocus();
44
+ }
45
+ willUpdate(t) {
46
+ (t.has("item") || t.has("portal") || t.has("user")) && (this.isFavoriteLoaded = !1, this.refreshFavorite());
47
+ }
48
+ async refreshFavorite() {
49
+ if (!this.item.id || !this.portal || !this.user) {
50
+ this.isFavorite = !1;
51
+ return;
52
+ }
53
+ const t = ++this.favoriteRequestId, i = await F(this.item.id, this.portal, this.user);
54
+ t === this.favoriteRequestId && (this.isFavorite = i, this.isFavoriteLoaded = !0);
55
+ }
56
+ render() {
57
+ if (!this.isFavoriteLoaded)
58
+ return null;
59
+ const t = this.isFavorite ? this.messages.remove : this.messages.add;
60
+ return r`<calcite-button .width=${this.iconOnly ? "auto" : this.width} .scale=${this.scale} .appearance=${this.iconOnly ? "transparent" : "outline-fill"} kind=neutral .iconStart=${this.isFavorite ? "star-f" : "star"} .ariaLabel=${this.iconOnly ? t : void 0} @click=${this.handleToggleFavorite} ${u(this.buttonRef)}>${this.iconOnly ? null : t}</calcite-button>${this.showTooltip ? r`<calcite-tooltip .referenceElement=${this.buttonRef.value}>${t}</calcite-tooltip>` : null}`;
61
+ }
62
+ }
63
+ n("arcgis-portal-item-favorite", g);
64
+ export {
65
+ g as ArcgisPortalItemFavorite
66
+ };
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1,3 @@
1
+ import "@esri/calcite-components/components/calcite-button";
2
+ import "@esri/calcite-components/components/calcite-tooltip";
3
+ export * from "./customElement.js";
@@ -0,0 +1,4 @@
1
+ export type FavoriteUpdate = {
2
+ id: string;
3
+ favorite: boolean;
4
+ };
@@ -3,7 +3,7 @@ import { g as d, c as g } from "../../chunks/runtime.js";
3
3
  import { css as y, html as c } from "lit";
4
4
  import { LitElement as f, nothing as p, safeClassMap as x } from "@arcgis/lumina";
5
5
  import { u } from "../../chunks/useT9n.js";
6
- import { g as w } from "../../chunks/utils.js";
6
+ import { g as w } from "../../chunks/utils2.js";
7
7
  const v = y`:host{display:inline-flex;align-items:center}:host([scale="s"]){--arcgis-portal-item-type-font-size: var(--calcite-font-size--2);--arcgis-portal-item-type-spacing: 1rem}:host([scale="m"]){--arcgis-portal-item-type-font-size: var(--calcite-font-size--1);--arcgis-portal-item-type-spacing: 1rem}:host([scale="l"]){--arcgis-portal-item-type-font-size: var(--calcite-font-size-0);--arcgis-portal-item-type-spacing: 1rem}.icon{display:block;flex-grow:0;flex-shrink:0;width:var(--arcgis-portal-item-type-spacing);height:var(--arcgis-portal-item-type-spacing)}.text{color:var(--calcite-text-color-2);font-size:var(--arcgis-portal-item-type-font-size);line-height:1.25rem}.text--ellipsis{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.text--spaced{margin-inline-start:calc(var(--arcgis-portal-item-type-spacing) / 2);word-wrap:break-word;word-break:break-word}`;
8
8
  class I extends f {
9
9
  constructor() {