@arcgis/map-components 5.2.0-next.114 → 5.2.0-next.115
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/CBZ7YZAZ.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-feature-attachments/customElement.js +38 -34
- package/dist/components/arcgis-feature-attachments/index.js +2 -0
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/cdn/P62456RX.js +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/map-components",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.115",
|
|
4
4
|
"description": "ArcGIS Map Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"2D",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@amcharts/amcharts5": "~5.20.6",
|
|
46
|
-
"@arcgis/common-components": "5.2.0-next.
|
|
47
|
-
"@arcgis/lumina": "5.2.0-next.
|
|
48
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
46
|
+
"@arcgis/common-components": "5.2.0-next.115",
|
|
47
|
+
"@arcgis/lumina": "5.2.0-next.115",
|
|
48
|
+
"@arcgis/toolkit": "5.2.0-next.115",
|
|
49
49
|
"lit": "^3.3.0",
|
|
50
50
|
"lodash-es": "^4.18.1",
|
|
51
51
|
"tslib": "^2.8.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@arcgis/core": "5.2.0-next.
|
|
54
|
+
"@arcgis/core": "5.2.0-next.115",
|
|
55
55
|
"@esri/calcite-components": "^5.2.0-next.73"
|
|
56
56
|
},
|
|
57
57
|
"css.customData": [
|
package/dist/cdn/P62456RX.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import d from"./POT6OMKJ.js";import c from"./C2HB2U6P.js";import"./5CHDLE4G.js";import"./QX3ZXA2B.js";import"./QUZTFUWM.js";import{b as v}from"./3CORLJ7S.js";import"./XURWCCLX.js";import{N as x,O as y,P as w,Q as l,T as k,a as b,b as a,n as A}from"./RM4OPQBM.js";import"./H6RQVSYM.js";export default $arcgis.t(([z,P,C,_,{watch:S},,{d:u}])=>{function L(i){let t=i.toLowerCase();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"}function I(i){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"}var j=b`: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%}`,E=C.ofType(z),$=class extends x{constructor(){super(...arguments),this._attachmentLayer=null,this._supportsImageOrientation=window?.CSS?.supports("image-orientation","from-image"),this.hideSection=!1,this._attachmentInfos=new E,this.headingLevel=2,this.hidePreviewImageAttachmentName=!1,this.empty=!1}static{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}}static{this.styles=j}get _supportsTypeWildcard(){let{graphic:t}=this;if(!t)return!1;let e=u(t);return e?.loaded&&"capabilities"in e&&e.capabilities&&"attachment"in e.capabilities&&e.capabilities.attachment&&"supportsResize"in e.capabilities.attachment&&e.capabilities.attachment.supportsTypeWildcard||!1}get effectiveDisplayType(){let{displayType:t}=this;return!t||t==="auto"?this.supportsResizeAttachments?"preview":"list":t}get _hasContent(){return this._attachmentInfos.length>0||!!this.graphic&&this.getAttachmentsPromise!==null}get supportsResizeAttachments(){let{graphic:t}=this;if(!t)return!1;let e=u(t);return e?.loaded&&"capabilities"in e&&e.capabilities&&"attachment"in e.capabilities&&e.capabilities.attachment&&"supportsResize"in e.capabilities.attachment&&e.capabilities.attachment.supportsResize||!1}loaded(){this.manager.onLifecycle(()=>[S(()=>this.graphic,()=>this.graphicChanged(),{initial:!0})])}async getAttachments(){let{_attachmentLayer:t,_attachmentInfos:e,orderByFields:m,attachmentTypes:p,attachmentKeywords:s,_supportsTypeWildcard:g}=this;if(!t||typeof t.queryAttachments!="function")throw new _("invalid-layer","getAttachments(): A valid layer is required.");let h=this.graphic?.getObjectId();if(typeof h!="number")throw new _("invalid-object-id","getAttachments(): Numeric object id is required");let n=m?.map(r=>`${r.field} ${r.order==="descending"?"DESC":"ASC"}`),f=new P({objectIds:[h],returnMetadata:!0,orderByFields:n,attachmentTypes:g?p?.filter(Boolean).map(r=>`${r}/*`):void 0,keywords:s}),c=[],d=t.queryAttachments(f).then(r=>r[h]||c).catch(()=>c);this.getAttachmentsPromise=d,this._setEmpty(!1);let o=await d;e.destroyAll(),o.length&&e.addMany(o),this.getAttachmentsPromise=null,this._setEmpty(!this._hasContent)}_setEmpty(t){A(()=>this.empty=t)}setAttachmentLayer(){let{graphic:t}=this,e=u(t);this._attachmentLayer=e?e.type==="scene"&&e.associatedLayer!=null?e.associatedLayer:e:null}graphicChanged(){if(!this.graphic){this._attachmentInfos.destroyAll(),this.getAttachmentsPromise=null,this._setEmpty(!0);return}this.setAttachmentLayer(),this.getAttachments().catch(()=>{this._attachmentInfos.destroyAll(),this.getAttachmentsPromise=null,this._setEmpty(!0)})}getCSSTransform(t){let{orientationInfo:e}=t;return!this._supportsImageOrientation&&e?[e.rotation?`rotate(${e.rotation}deg)`:"",e.mirrored?"scaleX(-1)":""].join(" "):""}render(){return a`<div class="root"><arcgis-feature-element-info .heading=${this.heading} .description=${this.description} .headingLevel=${this.headingLevel}></arcgis-feature-element-info>${this.renderAttachments()}</div>`}renderAttachmentsList(t){return a`<calcite-list .loading=${!!this.getAttachmentsPromise} .label=${this.messages?.componentLabel??""} interaction-mode=static selection-mode=none>${t.toArray().filter(Boolean).map(e=>this.renderAttachmentListItem(e))}</calcite-list>`}renderAttachmentsPreview(t){return a`<calcite-card-group .label=${this.messages?.componentLabel??""}>${this.getAttachmentsPromise?a`<calcite-card loading></calcite-card>`:t.toArray().filter(Boolean).map(e=>this.renderAttachmentPreviewItem(e))}</calcite-card-group>`}renderAttachments(){let{effectiveDisplayType:t,_attachmentInfos:e}=this;return t==="preview"?this.renderAttachmentsPreview(e):this.renderAttachmentsList(e)}renderAttachmentListItem(t){let{supportsResizeAttachments:e}=this,{contentType:m,name:p,url:s,size:g}=t,h=64,n=p||this.messages?.noTitle,f=I(m),c=this.getCSSTransform(t),d=c?{transform:c,"image-orientation":"none"}:{},o=e&&L(m),r=a`<a class=${y(v("item-link","item-link--list",{"item-link--list-icon":!o}))} slot=content-start href=${s??void 0??l} rel=noreferrer target=_blank>${o?a`<img alt=${p??l} src=${`${s}${s?.includes("?")?"&":"?"}w=${h}&s=${g}`} style=${w(d)} title=${p??l}>`:a`<calcite-icon .icon=${f}></calcite-icon>`}</a>`,T=a`<calcite-link slot=content .href=${s??void 0} rel=noreferrer target=_blank>${n}</calcite-link>`;return a`<calcite-list-item .label=${n}>${r}${T}</calcite-list-item>`}renderAttachmentPreviewItem(t){let{supportsResizeAttachments:e}=this,{contentType:m,name:p,url:s,size:g}=t,h=225,n=p||this.messages?.noTitle,f=I(m),c=this.getCSSTransform(t),d=c?{transform:c,"image-orientation":"none"}:{},o=e&&L(m),r=a`<a class=${y(v("item-link","item-link--preview"))} slot=thumbnail href=${s??void 0??l} rel=noreferrer target=_blank aria-label=${n??l} title=${n??l}>${o?a`<img alt=${n??l} src=${`${s}${s?.includes("?")?"&":"?"}w=${h}&s=${g}`} style=${w(d)}>`:a`<calcite-icon scale=l .icon=${f}></calcite-icon>`}</a>`;return a`<calcite-card .label=${n}>${r}${this.hidePreviewImageAttachmentName&&o?null:a`<span class="item-description" slot=description>${n}</span>`}</calcite-card>`}};k("arcgis-feature-attachments",$);return $},"rest/query/support/AttachmentInfo","rest/support/AttachmentQuery","core/Collection","core/Error","core/reactiveUtils",c,d)
|