@arcgis/map-components 5.2.0-next.130 → 5.2.0-next.131
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/3XQAKJRR.js +2 -0
- package/dist/cdn/CBFS3BEX.js +2 -0
- package/dist/cdn/{S62FQUEJ.js → I6UNOZIU.js} +1 -1
- package/dist/cdn/{KY3ND2AY.js → ILB7T57D.js} +1 -1
- package/dist/cdn/{LA2B6YUW.js → QGJT6HJM.js} +2 -2
- package/dist/cdn/{MIGBO54V.js → QMTJIBIF.js} +1 -1
- package/dist/cdn/{KM2GXXBO.js → TXCP3D4T.js} +1 -1
- package/dist/cdn/YGXUS6KG.js +2 -0
- package/dist/cdn/assets/feature-form-next/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/attachment-utils.js +12 -0
- package/dist/components/arcgis-add-attachment-view/customElement.d.ts +48 -0
- package/dist/components/arcgis-attachment-thumbnail/customElement.d.ts +164 -0
- package/dist/components/arcgis-attachment-thumbnail/customElement.js +69 -0
- package/dist/components/arcgis-attachment-thumbnail/index.d.ts +1 -0
- package/dist/components/arcgis-attachment-thumbnail/index.js +2 -0
- package/dist/components/arcgis-attachment-validation-view/customElement.d.ts +48 -0
- package/dist/components/arcgis-feature-attachments/customElement.js +63 -69
- package/dist/components/arcgis-feature-form-field/customElement.d.ts +48 -0
- 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 +4 -0
- package/dist/loader.js +1 -0
- package/dist/types/lumina.d.ts +5 -0
- package/dist/types/preact.d.ts +6 -0
- package/dist/types/react.d.ts +7 -0
- package/dist/types/stencil.d.ts +5 -0
- package/package.json +6 -6
- package/dist/cdn/75DQILK2.js +0 -2
|
@@ -1,53 +1,47 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { c as k } from "../../chunks/runtime.js";
|
|
3
|
-
import { css as I, html as
|
|
3
|
+
import { css as I, html as i } from "lit";
|
|
4
4
|
import _ from "@arcgis/core/rest/query/support/AttachmentInfo.js";
|
|
5
5
|
import L from "@arcgis/core/rest/support/AttachmentQuery.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { LitElement as P, nothing as
|
|
6
|
+
import T from "@arcgis/core/core/Collection.js";
|
|
7
|
+
import y from "@arcgis/core/core/Error.js";
|
|
8
|
+
import { LitElement as P, nothing as d, safeClassMap as b, safeStyleMap as A } from "@arcgis/lumina";
|
|
9
9
|
import { bypassReadOnly as S } from "@arcgis/lumina/controllers";
|
|
10
|
-
import { classes as
|
|
11
|
-
import { g as
|
|
10
|
+
import { classes as $ } from "@arcgis/toolkit/dom";
|
|
11
|
+
import { g as v, i as w } from "../../chunks/attachment-utils.js";
|
|
12
|
+
import { g as f } from "../../chunks/feature-utils.js";
|
|
12
13
|
import { watch as C } from "@arcgis/core/core/reactiveUtils.js";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return t === "image/bmp" || t === "image/emf" || t === "image/exif" || t === "image/gif" || t === "image/x-icon" || t === "image/jpeg" || t === "image/png" || t === "image/tiff" || t === "image/x-wmf";
|
|
16
|
-
}
|
|
17
|
-
function x(i) {
|
|
18
|
-
return i ? i === "text/plain" ? "file-text" : i === "application/pdf" ? "file-pdf" : i === "text/csv" ? "file-csv" : i === "application/gpx+xml" ? "file-gpx" : i === "application/x-dwf" ? "file-cad" : i === "application/postscript" || i === "application/json" || i === "text/xml" || i === "model/vrml" ? "file-code" : i === "application/x-zip-compressed" || i === "application/x-7z-compressed" || i === "application/x-gzip" || i === "application/x-tar" || i === "application/x-gtar" || i === "application/x-bzip2" || i === "application/gzip" || i === "application/x-compress" || i === "application/x-apple-diskimage" || i === "application/x-rar-compressed" || i === "application/zip" ? "file-zip" : i.includes("image/") ? "file-image" : i.includes("audio/") ? "file-sound" : i.includes("video/") ? "file-video" : i.includes("msexcel") || i.includes("ms-excel") || i.includes("spreadsheetml") ? "file-excel" : i.includes("msword") || i.includes("ms-word") || i.includes("wordprocessingml") ? "file-word" : i.includes("powerpoint") || i.includes("presentationml") ? "file-report" : "file" : "file";
|
|
19
|
-
}
|
|
20
|
-
const j = I`:host([empty]){display:none}.item-link{display:flex;flex-grow:1;color:var(--calcite-color-text-3)}.item-link:visited,.item-link:hover,.item-link:focus-visible,.item-link:active{color:var(--calcite-color-text-1)}.item-link img{max-width:100%;max-height:100%;object-fit:contain}.item-link--list{align-items:center;justify-content:center;width:64px;max-height:64px;overflow:hidden;border-radius:var(--calcite-corner-radius-sm)}.item-link--list img{border-radius:var(--calcite-corner-radius-sm)}.item-link--list-icon{border:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.item-link--list calcite-icon{margin:var(--calcite-spacing-lg)}.item-link--preview{align-items:center;justify-content:center}.item-link--preview calcite-icon{margin-block:var(--calcite-spacing-lg)}.item-description{text-align:center;word-wrap:break-word;word-break:break-word}calcite-link{--calcite-link-text-color: var(--calcite-color-text-3);padding-inline:var(--calcite-spacing-sm);word-wrap:break-word;word-break:break-word}calcite-card{width:100%}calcite-card:hover,calcite-card:focus,calcite-card:focus-within{--calcite-card-border-color: var(--calcite-color-text-1)}`, E = z.ofType(_);
|
|
21
|
-
class R extends P {
|
|
14
|
+
const x = I`:host([empty]){display:none}.item-link{display:flex;flex-grow:1;color:var(--calcite-color-text-3)}.item-link:visited,.item-link:hover,.item-link:focus-visible,.item-link:active{color:var(--calcite-color-text-1)}.item-link img{max-width:100%;max-height:100%;object-fit:contain}.item-link--list{align-items:center;justify-content:center;width:64px;max-height:64px;overflow:hidden;border-radius:var(--calcite-corner-radius-sm)}.item-link--list img{border-radius:var(--calcite-corner-radius-sm)}.item-link--list-icon{border:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.item-link--list calcite-icon{margin:var(--calcite-spacing-lg)}.item-link--preview{align-items:center;justify-content:center}.item-link--preview calcite-icon{margin-block:var(--calcite-spacing-lg)}.item-description{text-align:center;word-wrap:break-word;word-break:break-word}calcite-link{--calcite-link-text-color: var(--calcite-color-text-3);padding-inline:var(--calcite-spacing-sm);word-wrap:break-word;word-break:break-word}calcite-card{width:100%}calcite-card:hover,calcite-card:focus,calcite-card:focus-within{--calcite-card-border-color: var(--calcite-color-text-1)}`, z = T.ofType(_);
|
|
15
|
+
class E extends P {
|
|
22
16
|
constructor() {
|
|
23
|
-
super(...arguments), this._attachmentLayer = null, this._supportsImageOrientation = window?.CSS?.supports("image-orientation", "from-image"), this.hideSection = !1, this._attachmentInfos = new
|
|
17
|
+
super(...arguments), this._attachmentLayer = null, this._supportsImageOrientation = window?.CSS?.supports("image-orientation", "from-image"), this.hideSection = !1, this._attachmentInfos = new z(), this.headingLevel = 2, this.hidePreviewImageAttachmentName = !1, this.empty = !1;
|
|
24
18
|
}
|
|
25
19
|
static {
|
|
26
20
|
this.properties = { effectiveDisplayType: 16, getAttachmentsPromise: 16, hideSection: 16, _attachmentInfos: 16, _hasContent: 16, supportsResizeAttachments: 16, attachmentKeywords: 0, attachmentTypes: 0, description: 1, displayType: 1, graphic: 0, heading: 1, messages: 0, orderByFields: 0, headingLevel: 9, hidePreviewImageAttachmentName: 5, empty: 39 };
|
|
27
21
|
}
|
|
28
22
|
static {
|
|
29
|
-
this.styles =
|
|
23
|
+
this.styles = x;
|
|
30
24
|
}
|
|
31
25
|
get _supportsTypeWildcard() {
|
|
32
|
-
const { graphic:
|
|
33
|
-
if (!
|
|
26
|
+
const { graphic: e } = this;
|
|
27
|
+
if (!e)
|
|
34
28
|
return !1;
|
|
35
|
-
const
|
|
36
|
-
return
|
|
29
|
+
const t = f(e);
|
|
30
|
+
return t?.loaded && "capabilities" in t && t.capabilities && "attachment" in t.capabilities && t.capabilities.attachment && "supportsResize" in t.capabilities.attachment && t.capabilities.attachment.supportsTypeWildcard || !1;
|
|
37
31
|
}
|
|
38
32
|
get effectiveDisplayType() {
|
|
39
|
-
const { displayType:
|
|
40
|
-
return !
|
|
33
|
+
const { displayType: e } = this;
|
|
34
|
+
return !e || e === "auto" ? this.supportsResizeAttachments ? "preview" : "list" : e;
|
|
41
35
|
}
|
|
42
36
|
get _hasContent() {
|
|
43
37
|
return this._attachmentInfos.length > 0 || this.getAttachmentsPromise != null;
|
|
44
38
|
}
|
|
45
39
|
get supportsResizeAttachments() {
|
|
46
|
-
const { graphic:
|
|
47
|
-
if (!
|
|
40
|
+
const { graphic: e } = this;
|
|
41
|
+
if (!e)
|
|
48
42
|
return !1;
|
|
49
|
-
const
|
|
50
|
-
return
|
|
43
|
+
const t = f(e);
|
|
44
|
+
return t?.loaded && "capabilities" in t && t.capabilities && "attachment" in t.capabilities && t.capabilities.attachment && "supportsResize" in t.capabilities.attachment && t.capabilities.attachment.supportsResize || !1;
|
|
51
45
|
}
|
|
52
46
|
loaded() {
|
|
53
47
|
this.manager.onLifecycle(() => [
|
|
@@ -55,29 +49,29 @@ class R extends P {
|
|
|
55
49
|
]);
|
|
56
50
|
}
|
|
57
51
|
async getAttachments() {
|
|
58
|
-
const { _attachmentLayer:
|
|
59
|
-
if (!
|
|
60
|
-
throw new
|
|
61
|
-
const
|
|
62
|
-
if (typeof
|
|
63
|
-
throw new
|
|
64
|
-
const g =
|
|
65
|
-
objectIds: [
|
|
52
|
+
const { _attachmentLayer: e, _attachmentInfos: t, orderByFields: s, attachmentTypes: n, attachmentKeywords: c, _supportsTypeWildcard: o } = this;
|
|
53
|
+
if (!e || typeof e.queryAttachments != "function")
|
|
54
|
+
throw new y("invalid-layer", "getAttachments(): A valid layer is required.");
|
|
55
|
+
const l = this.graphic?.getObjectId();
|
|
56
|
+
if (typeof l != "number")
|
|
57
|
+
throw new y("invalid-object-id", "getAttachments(): Numeric object id is required");
|
|
58
|
+
const g = s?.map((a) => `${a.field} ${a.order === "descending" ? "DESC" : "ASC"}`), r = new L({
|
|
59
|
+
objectIds: [l],
|
|
66
60
|
returnMetadata: !0,
|
|
67
61
|
orderByFields: g,
|
|
68
|
-
attachmentTypes: o ? n?.filter(Boolean).map((
|
|
69
|
-
keywords:
|
|
70
|
-
}),
|
|
71
|
-
this.getAttachmentsPromise =
|
|
72
|
-
const p = await
|
|
73
|
-
|
|
62
|
+
attachmentTypes: o ? n?.filter(Boolean).map((a) => `${a}/*`) : void 0,
|
|
63
|
+
keywords: c
|
|
64
|
+
}), m = [], h = e.queryAttachments(r).then((a) => a[l] || m).catch(() => m);
|
|
65
|
+
this.getAttachmentsPromise = h, this._setEmpty(!1);
|
|
66
|
+
const p = await h;
|
|
67
|
+
t.destroyAll(), p.length && t.addMany(p), this.getAttachmentsPromise = null, this._setEmpty(!this._hasContent);
|
|
74
68
|
}
|
|
75
|
-
_setEmpty(
|
|
76
|
-
S(() => this.empty =
|
|
69
|
+
_setEmpty(e) {
|
|
70
|
+
S(() => this.empty = e);
|
|
77
71
|
}
|
|
78
72
|
setAttachmentLayer() {
|
|
79
|
-
const { graphic:
|
|
80
|
-
this._attachmentLayer =
|
|
73
|
+
const { graphic: e } = this, t = f(e);
|
|
74
|
+
this._attachmentLayer = t ? t.type === "scene" && t.associatedLayer != null ? t.associatedLayer : t : null;
|
|
81
75
|
}
|
|
82
76
|
graphicChanged() {
|
|
83
77
|
if (!this.graphic) {
|
|
@@ -88,42 +82,42 @@ class R extends P {
|
|
|
88
82
|
this._attachmentInfos.destroyAll(), this.getAttachmentsPromise = null, this._setEmpty(!0);
|
|
89
83
|
});
|
|
90
84
|
}
|
|
91
|
-
getCSSTransform(
|
|
92
|
-
const { orientationInfo:
|
|
93
|
-
return !this._supportsImageOrientation &&
|
|
94
|
-
|
|
95
|
-
|
|
85
|
+
getCSSTransform(e) {
|
|
86
|
+
const { orientationInfo: t } = e;
|
|
87
|
+
return !this._supportsImageOrientation && t ? [
|
|
88
|
+
t.rotation ? `rotate(${t.rotation}deg)` : "",
|
|
89
|
+
t.mirrored ? "scaleX(-1)" : ""
|
|
96
90
|
].join(" ") : "";
|
|
97
91
|
}
|
|
98
92
|
render() {
|
|
99
|
-
return this.empty ? null :
|
|
93
|
+
return this.empty ? null : i`<div class="root"><arcgis-feature-element-info .heading=${this.heading} .description=${this.description} .headingLevel=${this.headingLevel}></arcgis-feature-element-info>${this.renderAttachments()}</div>`;
|
|
100
94
|
}
|
|
101
|
-
renderAttachmentsList(
|
|
102
|
-
return
|
|
95
|
+
renderAttachmentsList(e) {
|
|
96
|
+
return i`<calcite-list .loading=${!!this.getAttachmentsPromise} .label=${this.messages?.componentLabel ?? ""} interaction-mode=static selection-mode=none>${e.toArray().filter(Boolean).map((t) => this.renderAttachmentListItem(t))}</calcite-list>`;
|
|
103
97
|
}
|
|
104
|
-
renderAttachmentsPreview(
|
|
105
|
-
return
|
|
98
|
+
renderAttachmentsPreview(e) {
|
|
99
|
+
return i`<calcite-card-group .label=${this.messages?.componentLabel ?? ""}>${this.getAttachmentsPromise ? i`<calcite-card loading></calcite-card>` : e.toArray().filter(Boolean).map((t) => this.renderAttachmentPreviewItem(t))}</calcite-card-group>`;
|
|
106
100
|
}
|
|
107
|
-
renderAttachmentsCarousel(
|
|
108
|
-
const
|
|
109
|
-
return
|
|
101
|
+
renderAttachmentsCarousel(e) {
|
|
102
|
+
const t = e.toArray().filter(Boolean);
|
|
103
|
+
return i`<calcite-carousel .paginationDisabled=${t.length < 2} .label=${this.messages?.componentLabel ?? ""} pagination-position=top>${this.getAttachmentsPromise ? i`<calcite-carousel-item .label=${this.messages?.componentLabel ?? ""}><calcite-card loading></calcite-card></calcite-carousel-item>` : t.map((s) => i`<calcite-carousel-item .label=${s.name || this.messages?.noTitle || ""}>${this.renderAttachmentPreviewItem(s, !0)}</calcite-carousel-item>`)}</calcite-carousel>`;
|
|
110
104
|
}
|
|
111
105
|
renderAttachments() {
|
|
112
|
-
const { effectiveDisplayType:
|
|
113
|
-
return
|
|
106
|
+
const { effectiveDisplayType: e, _attachmentInfos: t } = this;
|
|
107
|
+
return e === "carousel" ? this.renderAttachmentsCarousel(t) : e === "preview" ? this.renderAttachmentsPreview(t) : this.renderAttachmentsList(t);
|
|
114
108
|
}
|
|
115
|
-
renderAttachmentListItem(
|
|
116
|
-
const { supportsResizeAttachments:
|
|
109
|
+
renderAttachmentListItem(e) {
|
|
110
|
+
const { supportsResizeAttachments: t } = this, { contentType: s, name: n, url: c, size: o } = e, l = 64, g = n || this.messages?.noTitle, r = v(s), m = this.getCSSTransform(e), h = m ? { transform: m, "image-orientation": "none" } : {}, p = t && w(s), a = i`<a class=${b($("item-link", "item-link--list", {
|
|
117
111
|
"item-link--list-icon": !p
|
|
118
|
-
}))} slot=content-start href=${
|
|
119
|
-
return
|
|
112
|
+
}))} slot=content-start href=${c ?? void 0 ?? d} rel=noreferrer target=_blank>${p ? i`<img alt=${n ?? d} src=${`${c}${c?.includes("?") ? "&" : "?"}w=${l}&s=${o}`} style=${A(h)} title=${n ?? d}>` : i`<calcite-icon .icon=${r}></calcite-icon>`}</a>`, u = i`<calcite-link slot=content .href=${c ?? void 0} rel=noreferrer target=_blank>${g}</calcite-link>`;
|
|
113
|
+
return i`<calcite-list-item .label=${g}>${a}${u}</calcite-list-item>`;
|
|
120
114
|
}
|
|
121
|
-
renderAttachmentPreviewItem(
|
|
122
|
-
const { supportsResizeAttachments:
|
|
123
|
-
return
|
|
115
|
+
renderAttachmentPreviewItem(e, t = !1) {
|
|
116
|
+
const { supportsResizeAttachments: s } = this, { contentType: n, name: c, url: o, size: l } = e, g = 225, r = c || this.messages?.noTitle, m = v(n), h = this.getCSSTransform(e), p = h ? { transform: h, "image-orientation": "none" } : {}, a = s && w(n), u = i`<a class=${b($("item-link", "item-link--preview"))} slot=thumbnail href=${o ?? void 0 ?? d} rel=noreferrer target=_blank aria-label=${r ?? d} title=${r ?? d}>${a ? i`<img alt=${r ?? d} src=${`${o}${o?.includes("?") ? "&" : "?"}w=${g}&s=${l}`} style=${A(p)}>` : i`<calcite-icon scale=l .icon=${m}></calcite-icon>`}</a>`;
|
|
117
|
+
return i`<calcite-card .label=${r}>${u}${(t || this.hidePreviewImageAttachmentName) && a ? null : i`<span class="item-description" slot=description>${r}</span>`}</calcite-card>`;
|
|
124
118
|
}
|
|
125
119
|
}
|
|
126
|
-
k("arcgis-feature-attachments",
|
|
120
|
+
k("arcgis-feature-attachments", E);
|
|
127
121
|
export {
|
|
128
|
-
|
|
122
|
+
E as ArcgisFeatureAttachments
|
|
129
123
|
};
|
|
@@ -23,6 +23,22 @@ export abstract class ArcgisFeatureFormField extends LitElement {
|
|
|
23
23
|
fileToBeReplaced: string;
|
|
24
24
|
heading: string;
|
|
25
25
|
};
|
|
26
|
+
thumbnail: { fileTypes: {
|
|
27
|
+
"file-cad": string;
|
|
28
|
+
"file-code": string;
|
|
29
|
+
"file-csv": string;
|
|
30
|
+
"file-excel": string;
|
|
31
|
+
"file-gpx": string;
|
|
32
|
+
"file-image": string;
|
|
33
|
+
"file-pdf": string;
|
|
34
|
+
"file-ppt": string;
|
|
35
|
+
"file-sound": string;
|
|
36
|
+
"file-text": string;
|
|
37
|
+
"file-video": string;
|
|
38
|
+
"file-word": string;
|
|
39
|
+
"file-zip": string;
|
|
40
|
+
file: string;
|
|
41
|
+
}; };
|
|
26
42
|
}; };
|
|
27
43
|
units: { bytes: {
|
|
28
44
|
B: string;
|
|
@@ -50,6 +66,22 @@ export abstract class ArcgisFeatureFormField extends LitElement {
|
|
|
50
66
|
fileToBeReplaced: string;
|
|
51
67
|
heading: string;
|
|
52
68
|
};
|
|
69
|
+
thumbnail: { fileTypes: {
|
|
70
|
+
"file-cad": string;
|
|
71
|
+
"file-code": string;
|
|
72
|
+
"file-csv": string;
|
|
73
|
+
"file-excel": string;
|
|
74
|
+
"file-gpx": string;
|
|
75
|
+
"file-image": string;
|
|
76
|
+
"file-pdf": string;
|
|
77
|
+
"file-ppt": string;
|
|
78
|
+
"file-sound": string;
|
|
79
|
+
"file-text": string;
|
|
80
|
+
"file-video": string;
|
|
81
|
+
"file-word": string;
|
|
82
|
+
"file-zip": string;
|
|
83
|
+
file: string;
|
|
84
|
+
}; };
|
|
53
85
|
}; };
|
|
54
86
|
units: { bytes: {
|
|
55
87
|
B: string;
|
|
@@ -86,6 +118,22 @@ export abstract class ArcgisFeatureFormField extends LitElement {
|
|
|
86
118
|
fileToBeReplaced?: string | undefined;
|
|
87
119
|
heading?: string | undefined;
|
|
88
120
|
} | undefined;
|
|
121
|
+
thumbnail?: { fileTypes?: {
|
|
122
|
+
"file-cad"?: string | undefined;
|
|
123
|
+
"file-code"?: string | undefined;
|
|
124
|
+
"file-csv"?: string | undefined;
|
|
125
|
+
"file-excel"?: string | undefined;
|
|
126
|
+
"file-gpx"?: string | undefined;
|
|
127
|
+
"file-image"?: string | undefined;
|
|
128
|
+
"file-pdf"?: string | undefined;
|
|
129
|
+
"file-ppt"?: string | undefined;
|
|
130
|
+
"file-sound"?: string | undefined;
|
|
131
|
+
"file-text"?: string | undefined;
|
|
132
|
+
"file-video"?: string | undefined;
|
|
133
|
+
"file-word"?: string | undefined;
|
|
134
|
+
"file-zip"?: string | undefined;
|
|
135
|
+
file?: string | undefined;
|
|
136
|
+
} | undefined; } | undefined;
|
|
89
137
|
} | undefined; } | undefined;
|
|
90
138
|
units?: { bytes?: {
|
|
91
139
|
B?: string | undefined;
|