@arcgis/portal-components 5.0.0-next.80 → 5.0.0-next.81
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/{SRAY4KFR.js → 2BKJ3E2R.js} +2 -2
- package/dist/cdn/2PVJJ43M.js +4 -0
- package/dist/cdn/{CWFDUEWC.js → 3EDATKP2.js} +2 -2
- package/dist/cdn/{TACZTOXO.js → 3XZSJBC3.js} +2 -2
- package/dist/cdn/{6VVNKH3C.js → 57CBE6UK.js} +2 -2
- package/dist/cdn/{3PLIPHN3.js → 66VQYDGM.js} +2 -2
- package/dist/cdn/{L7XZSKU5.js → EEJEJHOB.js} +2 -2
- package/dist/cdn/{IGTNTMJZ.js → F6RQG7NJ.js} +2 -2
- package/dist/cdn/{LJC3RJ32.js → FKB6IXKC.js} +2 -2
- package/dist/cdn/{S4MD7LWI.js → GJD4UASV.js} +1 -1
- package/dist/cdn/{FB3OEXTD.js → JFCNIRL5.js} +2 -2
- package/dist/cdn/{RNZZASX2.js → PCRY6MB7.js} +2 -2
- package/dist/cdn/{EAQU436Q.js → QT5W7VZ7.js} +1 -1
- package/dist/cdn/{Q5GZCFBS.js → R7WP4KGH.js} +2 -2
- package/dist/cdn/{XTIAGADP.js → RORELFBP.js} +2 -2
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/common.js +1 -1
- package/dist/chunks/fieldAddDelete.js +1 -1
- package/dist/chunks/loadClassificationData.js +1 -1
- package/dist/chunks/requests.js +2 -2
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/components/arcgis-portal-classification-banner/customElement.js +1 -1
- 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-extent-picker/customElement.js +1 -1
- package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +1 -1
- package/dist/components/arcgis-portal-field-delete/customElement.js +57 -55
- package/dist/docs/api.json +2 -2
- package/dist/docs/docs.json +2 -2
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/package.json +3 -3
- package/dist/cdn/BP374N4Z.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
3
|
+
v5.0.0-next.81 */
|
|
4
4
|
export default $arcgis.t(([c,{once:l}])=>{var D=(t,e,r)=>{let a=d(t,e,r);return a=m(r,a),a},d=(t,e,r)=>{let a=r.classificationMetadata.defaultValue,s=structuredClone(t)??{[e]:a};return s[e]??=a,s},$=(t,e)=>t&&Object.fromEntries(Object.entries(t).filter(([r])=>e.get(r)?.enabled!==!1)),m=(t,e)=>{let r=structuredClone(e);return Object.entries(t.attributes).forEach(([a,s])=>{if(r?.[a])return;let{uiElement:o,defaultValue:n}=s;switch(o){case"date":r&&(r[a]=p(s));break;case"multi-select":case"multi-grouped-select-nested":n&&r&&(r[a]=[n]);break;case"checkbox":n&&r&&(r[a]=n==="true");break;case"single-select":case"text":n&&r&&(r[a]=n);break}}),r?.fgi||delete r?.fgiOptions,r},p=t=>{let e=new Date,{type:r,defaultDateTimeline:a,defaultDateTimelineUnits:s}=t;if(r==="date"&&a&&s)switch(s.toLowerCase()){case"years":e.setFullYear(e.getFullYear()+a);break;case"months":e.setMonth(e.getMonth()+a);break;case"days":e.setDate(e.getDate()+a);break}let o=(e.getMonth()+1).toString(),n=e.getDate().toString();return`${e.getFullYear()}-${o.length===1?`0${o}`:o}-${n.length===1?`0${n}`:n}`},k=(t,e,r)=>{let a=e?.createdUser,s=e?.createdDate;return e={[r]:t,...a?{createdUser:a}:{},...s?{createdDate:s}:{}},e},U=async t=>{try{if(!t)return!1;t.loaded||await t.load();let e=t.portal.user??await l(()=>t?.portal.user);if(!e)return!1;let r=e.privileges.includes("portal:admin:updateItems");return i(t,e)||g(t,e)||r||t.access==="shared"&&await f(t,e)}catch(e){return console.error(e),!1}};function i(t,e){return t.owner===e.username}function g(t,e){let r=t.owner,a=t.itemControl==="admin",s=["esri_livingatlas","esri_demographics","esri_boundaries"];return t.portal?.isPortal&&!i(t,e)&&a&&r?.includes("esri_")&&!s.includes(r)?!1:a}var f=async(t,e)=>{let r=t.portal.restUrl,a=(await h(e,r)).result??[],s=(await b(t,r)).result??[];return a?.some(o=>s?.some(n=>o.id===n.id&&o.capabilities.includes("updateitemcontrol")))},h=async(t,e)=>{let r=`${e}/community/users/${t.username}`;try{return{result:(await c(r,{query:{f:"json"},responseType:"json"})).data?.groups??[]}}catch{return{error:{code:"unhandledError"}}}},b=async(t,e)=>{let r=t.id,a=`${e}/content/items/${r}/groups`;try{let s=await c(a,{query:{f:"json",method:"post"},responseType:"json"}),o=s.data?.admin??[],n=s.data?.member??[],u=s.data?.other??[];return{result:[...o,...n,...u]}}catch{return{error:{code:"unhandledError"}}}},j=(t,e)=>{let r=Date.now(),a=t?.portal.user?.username??"",{createdUser:s=a,createdDate:o=r}=e??{};return{createdUser:s,createdDate:o,lastEditedUser:a,lastEditedDate:r}};return{a:D,b:$,c:m,d:k,e:U,f:j}},"request","core/reactiveUtils")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{A as y,k as P,t as k,u as w,v as V,w as m,x as h,y as A,z as D}from"./
|
|
3
|
+
v5.0.0-next.81 */
|
|
4
|
+
import{A as y,k as P,t as k,u as w,v as V,w as m,x as h,y as A,z as D}from"./GJD4UASV.js";var b=(s,f,c)=>{let p=new Map;for(let e=f;e<=c;e++)p.set(s[e],e);return p},I=w(class extends V{constructor(s){if(super(s),s.type!==k.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,f,c){let p;c===void 0?c=f:f!==void 0&&(p=f);let e=[],n=[],o=0;for(let a of s)e[o]=p?p(a,o):o,n[o]=c(a,o),o++;return{values:n,keys:e}}render(s,f,c){return this.dt(s,f,c).values}update(s,[f,c,p]){let e=D(s),{values:n,keys:o}=this.dt(f,c,p);if(!Array.isArray(e))return this.ut=o,n;let a=this.ut??=[],u=[],v,g,t=0,l=e.length-1,r=0,i=n.length-1;for(;t<=l&&r<=i;)if(e[t]===null)t++;else if(e[l]===null)l--;else if(a[t]===o[r])u[r]=h(e[t],n[r]),t++,r++;else if(a[l]===o[i])u[i]=h(e[l],n[i]),l--,i--;else if(a[t]===o[i])u[i]=h(e[t],n[i]),m(s,u[i+1],e[t]),t++,i--;else if(a[l]===o[r])u[r]=h(e[l],n[r]),m(s,e[t],e[l]),l--,r++;else if(v===void 0&&(v=b(o,r,i),g=b(a,t,l)),v.has(a[t]))if(v.has(a[l])){let d=g.get(o[r]),x=d!==void 0?e[d]:null;if(x===null){let C=m(s,e[t]);h(C,n[r]),u[r]=C}else u[r]=h(x,n[r]),m(s,e[t],x),e[d]=null;r++}else y(e[l]),l--;else y(e[t]),t++;for(;r<=i;){let d=m(s,u[i+1]);h(d,n[r]),u[r++]=d}for(;t<=l;){let d=e[t++];d!==null&&y(d)}return this.ut=o,A(s,u),P}});export{I as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
export default $arcgis.t(([n,{once:c}])=>{async function u(r,e){let s=`${r}/portals/self/classification/classificationSchema`,t={};try{let a=(await n(s,{query:{f:"json"},signal:e})).data;if(typeof a=="object"&&a!==null&&"classificationSchema"in a)t.result=a.classificationSchema;else throw new Error("Invalid response format received from the classification schema endpoint")}catch(a){t.error=a}return t}async function d(r,e,s){let t=`${r}/portals/self/classification/validateClassification`,a={classificationValue:JSON.stringify(e),f:"json"},i={};try{let o=await n(t,{query:a,method:"post",signal:s.signal});i.result=o.data}catch(o){console.error(o),i.error=o}return i}async function y(r){if(!r)return;r.loaded||await r.load();let e=r.portal.user??await c(()=>r?.portal.user);if(!e)return;let s=`${r.portal.restUrl}/community/users/${e.username}/resources/classification_favorites`,t={};try{let a=await n(s,{query:{f:"json"}});t.result=a.data}catch(a){console.error(a),t.error=a}return t}async function m(r,e){if(!r)return;r.loaded||await r.load();let s=r.portal.user??await c(()=>r?.portal.user);if(!s)return;let t=`${r.portal.restUrl}/community/users/${s.username}/addResource`,a={},i={f:"json",key:"classification_favorites",text:JSON.stringify({favorites:e}),access:"UserPrivateAllApps"};try{let o=await n(t,{query:i,method:"post"});a.result=o.data.success}catch(o){console.error(
|
|
3
|
+
v5.0.0-next.81 */
|
|
4
|
+
export default $arcgis.t(([n,{once:c}])=>{async function u(r,e){let s=`${r}/portals/self/classification/classificationSchema`,t={};try{let a=(await n(s,{query:{f:"json"},signal:e})).data;if(typeof a=="object"&&a!==null&&"classificationSchema"in a)t.result=a.classificationSchema;else throw new Error("Invalid response format received from the classification schema endpoint")}catch(a){t.error=a}return t}async function d(r,e,s){let t=`${r}/portals/self/classification/validateClassification`,a={classificationValue:JSON.stringify(e),f:"json"},i={};try{let o=await n(t,{query:a,method:"post",signal:s.signal});i.result=o.data}catch(o){console.error(o),i.error=o}return i}async function y(r){if(!r)return;r.loaded||await r.load();let e=r.portal.user??await c(()=>r?.portal.user);if(!e)return;let s=`${r.portal.restUrl}/community/users/${e.username}/resources/classification_favorites`,t={};try{let a=await n(s,{query:{f:"json"}});t.result=a.data}catch(a){console.error(a),t.error=a}return t}async function m(r,e){if(!r)return;r.loaded||await r.load();let s=r.portal.user??await c(()=>r?.portal.user);if(!s)return;let t=`${r.portal.restUrl}/community/users/${s.username}/addResource`,a={},i={f:"json",key:"classification_favorites",text:JSON.stringify({favorites:e}),access:"UserPrivateAllApps"};try{let o=await n(t,{query:i,method:"post"});a.result=o.data.success}catch(o){console.error(o),a.error=o}return a}return{a:u,b:d,c:y,d:m}},"request","core/reactiveUtils")
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{I as t,s as e}from"./
|
|
3
|
+
v5.0.0-next.81 */
|
|
4
|
+
import{I as t,s as e}from"./GJD4UASV.js";var i=e(t,{"arcgis-portal-classification-banner":[()=>import("./3XZSJBC3.js"),"autoDestroyDisabled,missingExistingClassification,portalItem:,validationErrors,variant;destroy"],"arcgis-portal-classification-config":[()=>import("./2BKJ3E2R.js"),"autoDestroyDisabled,portalItem:,status,valid,values;destroy,resetForm,validateForm"],"arcgis-portal-classification-favorite":[()=>import("./F6RQG7NJ.js"),"attributeExpressionResults:,classificationValue:,favoriteClassifications:,portalItem:,resetFavoriteClassification:,selectedFavoriteClassificationName,updateClassificationData:"],"arcgis-portal-classification-form-element":[()=>import("./JFCNIRL5.js"),"attribute:,attributeKey,isRequiredErrors:,renderingInfo:,value:"],"arcgis-portal-extent-picker":[()=>import("./FKB6IXKC.js"),"active,contentOnly,extentService,extentValue:,isArea,itemId,portal:;;getExtent"],"arcgis-portal-extent-picker-coord-field":[()=>import("./3EDATKP2.js"),"errorMessage,inputId,label,max,min,relatedErrorMessage,validateRelated:,value;;checkRelatedField,isValid,setFocus"],"arcgis-portal-field-delete":[()=>import("./2PVJJ43M.js"),"config:,fieldNames:,layer:,mapView:,options:"]});i({resourcesUrl:import.meta.url});var a=new CSSStyleSheet;a.replaceSync("@layer{:not([hydrated]):is(arcgis-portal-classification-banner,arcgis-portal-classification-config,arcgis-portal-classification-favorite,arcgis-portal-classification-form-element,arcgis-portal-extent-picker,arcgis-portal-field-delete){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,a];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,t)
|
package/dist/chunks/common.js
CHANGED
|
@@ -2,7 +2,7 @@ import i from "@arcgis/core/request.js";
|
|
|
2
2
|
import { once as l } from "@arcgis/core/core/reactiveUtils.js";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.81 */
|
|
6
6
|
const U = (t, e, s) => {
|
|
7
7
|
let r = d(
|
|
8
8
|
t,
|
|
@@ -6,7 +6,7 @@ import L from "@arcgis/core/request.js";
|
|
|
6
6
|
import * as v from "@arcgis/core/core/sql.js";
|
|
7
7
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
8
8
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
9
|
-
v5.0.0-next.
|
|
9
|
+
v5.0.0-next.81 */
|
|
10
10
|
var b = /* @__PURE__ */ ((e) => (e.expression = "expression/", e.raster = "Raster.", e.relationship = "relationships/", e))(b || {});
|
|
11
11
|
const H = ["feature"];
|
|
12
12
|
function z(e) {
|
|
@@ -6,7 +6,7 @@ import { makeAccessorController as C } from "@arcgis/lumina/controllers/accessor
|
|
|
6
6
|
import { Task as v } from "@lit/task";
|
|
7
7
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
8
8
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
9
|
-
v5.0.0-next.
|
|
9
|
+
v5.0.0-next.81 */
|
|
10
10
|
var w = Object.defineProperty, g = Object.getOwnPropertyDescriptor, e = (i, a, s, t) => {
|
|
11
11
|
for (var r = t > 1 ? void 0 : t ? g(a, s) : a, l = i.length - 1, c; l >= 0; l--)
|
|
12
12
|
(c = i[l]) && (r = (t ? c(a, s, r) : c(r)) || r);
|
package/dist/chunks/requests.js
CHANGED
|
@@ -2,7 +2,7 @@ import n from "@arcgis/core/request.js";
|
|
|
2
2
|
import { once as c } from "@arcgis/core/core/reactiveUtils.js";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.81 */
|
|
6
6
|
async function f(s, t) {
|
|
7
7
|
const i = `${s}/portals/self/classification/classificationSchema`, e = {};
|
|
8
8
|
try {
|
|
@@ -59,7 +59,7 @@ async function v(s, t) {
|
|
|
59
59
|
const o = await n(e, { query: a, method: "post" });
|
|
60
60
|
r.result = o.data.success;
|
|
61
61
|
} catch (o) {
|
|
62
|
-
console.error(
|
|
62
|
+
console.error(o), r.error = o;
|
|
63
63
|
}
|
|
64
64
|
return r;
|
|
65
65
|
}
|
package/dist/chunks/runtime.js
CHANGED
|
@@ -3,7 +3,7 @@ import { makeRuntime as e } from "@arcgis/lumina";
|
|
|
3
3
|
import { trackAccess as s, createObservable as r, createTrackingTarget as a, runTracked as c } from "@arcgis/core/applications/Components/reactiveUtils.js";
|
|
4
4
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
5
5
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
6
|
-
v5.0.0-next.
|
|
6
|
+
v5.0.0-next.81 */
|
|
7
7
|
const t = e({ defaultAssetPath: "https://jsdev.arcgis.com/next/portal-components/", hydratedAttribute: "hydrated" }), { customElement: n, getAssetPath: d, setAssetPath: i } = t;
|
|
8
8
|
t.t = s;
|
|
9
9
|
t.o = r;
|
package/dist/chunks/useT9n.js
CHANGED
|
@@ -2,7 +2,7 @@ import { makeT9nController as o } from "@arcgis/lumina/controllers";
|
|
|
2
2
|
import { g as t } from "./runtime.js";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.81 */
|
|
6
6
|
const s = o(t);
|
|
7
7
|
export {
|
|
8
8
|
s as u
|
|
@@ -5,7 +5,7 @@ import { u as f } from "../../chunks/useT9n.js";
|
|
|
5
5
|
import { css as d, html as t } from "lit";
|
|
6
6
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
7
7
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
8
|
-
v5.0.0-next.
|
|
8
|
+
v5.0.0-next.81 */
|
|
9
9
|
const m = d`.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-spacing-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-spacing-sm);font-size:var(--calcite-font-size);overflow-wrap:break-word}`;
|
|
10
10
|
class h extends r {
|
|
11
11
|
constructor() {
|
|
@@ -13,7 +13,7 @@ import { watch as _ } from "@arcgis/core/core/reactiveUtils.js";
|
|
|
13
13
|
import { r as D } from "../../chunks/requests.js";
|
|
14
14
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
15
15
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
16
|
-
v5.0.0-next.
|
|
16
|
+
v5.0.0-next.81 */
|
|
17
17
|
async function T({
|
|
18
18
|
portalClassificationSchema: a,
|
|
19
19
|
itemClassification: t
|
|
@@ -7,7 +7,7 @@ import { u as d, r as v } from "../../chunks/requests.js";
|
|
|
7
7
|
import { g as h } from "../../chunks/common.js";
|
|
8
8
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
9
9
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
10
|
-
v5.0.0-next.
|
|
10
|
+
v5.0.0-next.81 */
|
|
11
11
|
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-foreground-2)"}.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}`;
|
|
12
12
|
class C extends n {
|
|
13
13
|
constructor() {
|
|
@@ -5,7 +5,7 @@ import { css as d, html as i } from "lit";
|
|
|
5
5
|
import { u as h } from "../../chunks/useT9n.js";
|
|
6
6
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
7
7
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
8
|
-
v5.0.0-next.
|
|
8
|
+
v5.0.0-next.81 */
|
|
9
9
|
const m = d`.spacing-y{margin:var(--calcite-spacing-md) 0}.portal-classification-form-element-tooltip{display:flex;justify-content:space-between;align-items:center}`;
|
|
10
10
|
function l(n, e) {
|
|
11
11
|
return n.uiElement === e;
|
|
@@ -26,7 +26,7 @@ import { createRef as d, ref as x } from "lit/directives/ref.js";
|
|
|
26
26
|
import { u as B } from "../../chunks/useT9n.js";
|
|
27
27
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
28
28
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
29
|
-
v5.0.0-next.
|
|
29
|
+
v5.0.0-next.81 */
|
|
30
30
|
const W = F`.extent-picker-modal{z-index:1001}.extent-picker-content{display:flex;min-height:100%;height:100%}.side-panel{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;overflow-y:auto;max-height:100%;width:420px}.extent-button{margin-top:var(--calcite-spacing-lg)}.use-location-header{margin-top:var(--calcite-spacing-xxxl);margin-bottom:var(--calcite-spacing-lg)}.search-container,.search-container .esri-search{width:100%}.search-container calcite-autocomplete{width:100%}.map-panel{flex:1 1 0%;position:relative;display:flex}.map-loader{position:absolute;z-index:var(--calcite-z-index-1);top:50%;left:50%;transform:translate(-50%,-50%)}.map-container{flex:1 1 0%;opacity:0;transition:opacity .3s ease}.loader-container{flex:1 1 0%}.map-container--loaded{opacity:1}.coordinates-section{margin-top:var(--calcite-spacing-lg)}`;
|
|
31
31
|
class J {
|
|
32
32
|
constructor(t) {
|
|
@@ -5,7 +5,7 @@ import { css as h, html as o } from "lit";
|
|
|
5
5
|
import { useDirection as m } from "@arcgis/lumina/controllers";
|
|
6
6
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
7
7
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
8
|
-
v5.0.0-next.
|
|
8
|
+
v5.0.0-next.81 */
|
|
9
9
|
const g = h`.coord-field{margin-bottom:var(--calcite-spacing-sm)}.coord-label{display:block;margin-bottom:var(--calcite-spacing-sm);font-size:14px}.coordinate-input{width:100%;block-size:var(--calcite-spacing-xxxl);box-sizing:border-box;padding-inline:var(--calcite-spacing-md);font-size:14px;color:var(--calcite-color-text-3);outline-color:var(--calcite-color-brand)}.coordinate-input--error{border:1px solid var(--calcite-color-status-danger)}.coord-error-message{position:relative;max-width:100%;margin:var(--calcite-spacing-sm) 0;display:flex;font-size:14px;padding:6px 7px;background-color:var(--calcite-color-foreground-1);border:1px solid var(--calcite-color-status-danger);box-shadow:0 1px 2px #00000054}.coord-error-message:before{pointer-events:none;content:"";position:absolute;left:11px;top:-16px;width:0;height:0;border:8px solid transparent;border-bottom-color:var(--calcite-ui-danger)}.coord-error-message:after{position:absolute;pointer-events:none;content:"";left:11px;top:-15px;width:0;height:0;border:8px solid transparent;border-bottom-color:var(--calcite-ui-foreground-1)}.is-rtl .coord-error-message:before,.is-rtl .coord-error-message:after{left:initial;right:11px}.coord-error-message calcite-icon{color:var(--calcite-ui-danger)}.coord-error-message__text{margin-left:var(--calcite-spacing-sm);margin-right:var(--calcite-spacing-sm);line-height:var(--calcite-spacing-xl)}`;
|
|
10
10
|
class v extends u {
|
|
11
11
|
constructor() {
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { html as p, css as
|
|
3
|
-
import { LitElement as
|
|
4
|
-
import { createRef as
|
|
5
|
-
import { Task as
|
|
6
|
-
import * as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import { c as P } from "../../chunks/runtime.js";
|
|
2
|
+
import { html as p, css as O } from "lit";
|
|
3
|
+
import { LitElement as x, createEvent as T, renderElement as E } from "@arcgis/lumina";
|
|
4
|
+
import { createRef as w, ref as D } from "lit/directives/ref.js";
|
|
5
|
+
import { Task as L } from "@lit/task";
|
|
6
|
+
import * as S from "@arcgis/core/core/lang.js";
|
|
7
|
+
import B from "@arcgis/core/layers/support/FeatureTemplate.js";
|
|
8
|
+
import j from "@arcgis/core/Graphic.js";
|
|
9
|
+
import U from "@arcgis/core/identity/IdentityManager.js";
|
|
10
10
|
import y from "@arcgis/core/request.js";
|
|
11
|
-
import { a as
|
|
12
|
-
import { u as
|
|
11
|
+
import { i as $, a as q, g as R, b as J, d as z, s as W, e as A, f as _ } from "../../chunks/fieldAddDelete.js";
|
|
12
|
+
import { u as V } from "../../chunks/useT9n.js";
|
|
13
|
+
import { log as b, composeMissingPropertyMessage as C, composeEmptyPropertyMessage as G } from "@arcgis/toolkit/log";
|
|
13
14
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
14
15
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
15
|
-
v5.0.0-next.
|
|
16
|
+
v5.0.0-next.81 */
|
|
16
17
|
const n = /* @__PURE__ */ new Map();
|
|
17
18
|
n.set("oid", "key");
|
|
18
19
|
n.set("guid", "key");
|
|
@@ -30,23 +31,24 @@ n.set("date-only", "calendar");
|
|
|
30
31
|
n.set("time-only", "clock");
|
|
31
32
|
n.set("timestamp-offset", "time-zone");
|
|
32
33
|
n.set("string", "string");
|
|
33
|
-
const
|
|
34
|
-
class
|
|
34
|
+
const H = ({ fieldType: I }) => p`<calcite-icon scale=s .icon=${n.get(I)}></calcite-icon>`, K = O`.dialog{--calcite-dialog-max-size-y: 60%}.dialog-content-wrapper{position:relative;min-height:100px}.hide-overflow{overflow:hidden}.field-icons{padding:0 var(--calcite-spacing-lg);display:flex;align-items:center}.warning{border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);margin-bottom:var(--calcite-spacing-md)}.warning-message{font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold)}.loader-container{position:absolute;height:100%;width:100%;top:0;right:0;display:none;z-index:40;overflow:hidden;background:#fffffff2;padding:0}.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.loader{padding:0}.loader-text{font-weight:var(--calcite-font-weight-medium);text-align:center;margin-right:6.25rem;margin-left:6.25rem}`;
|
|
35
|
+
class Q extends x {
|
|
35
36
|
constructor() {
|
|
36
|
-
super(...arguments), this.arcadeExpMap = /* @__PURE__ */ new Map(), this.cancelNode =
|
|
37
|
+
super(...arguments), this.arcadeExpMap = /* @__PURE__ */ new Map(), this.cancelNode = w(), this.dialogNode = w(), this.layerFields = [], this.layerFieldsMap = /* @__PURE__ */ new Map(), this.messages = V({ blocking: !0 }), this.deleteInProgress = !1, this.fieldsAreDeletable = !1, this._propWatcherTask = new L(this, {
|
|
37
38
|
task: async ([e, t]) => {
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
const s = $(e) && $(t);
|
|
40
|
+
if ($(e) || b("error", this, C("layer")), $(t) || b("error", this, C("fieldNames")), !s)
|
|
41
|
+
throw new Error("Required properties are missing");
|
|
40
42
|
this._propWatcherTask.autoRun = !1, await this.processProps();
|
|
41
43
|
},
|
|
42
44
|
args: () => [this.layer, this.fieldNames]
|
|
43
|
-
}), this.arcgisBeforeModalClose =
|
|
45
|
+
}), this.arcgisBeforeModalClose = T(), this.arcgisClose = T(), this.arcgisBeforeDelete = T(), this.arcgisFieldsDeleted = T();
|
|
44
46
|
}
|
|
45
47
|
static {
|
|
46
48
|
this.properties = { config: 0, fieldNames: 0, layer: 0, mapView: 0, options: 0 };
|
|
47
49
|
}
|
|
48
50
|
static {
|
|
49
|
-
this.styles =
|
|
51
|
+
this.styles = K;
|
|
50
52
|
}
|
|
51
53
|
async processProps() {
|
|
52
54
|
const { layer: e, mapView: t, fieldNames: s } = this;
|
|
@@ -59,15 +61,15 @@ class G extends O {
|
|
|
59
61
|
if (!this.layerFields?.length || a)
|
|
60
62
|
this.fieldsAreDeletable = !1;
|
|
61
63
|
else {
|
|
62
|
-
const o = await Promise.all(this.layerFields.map(async (r) => await
|
|
64
|
+
const o = await Promise.all(this.layerFields.map(async (r) => await q(t, e, r, this.options)));
|
|
63
65
|
if (this.fieldsAreDeletable = o.every((r) => r), !this.fieldsAreDeletable)
|
|
64
66
|
return;
|
|
65
67
|
}
|
|
66
|
-
if (this.layerFieldsMap = await
|
|
68
|
+
if (this.layerFieldsMap = await R(e), this.options?.ignorePopupTemplate || (this.arcadeExpMap = J(e.popupTemplate)), this.portal = e.portalItem?.portal ?? this.options?.portal, this.item = e.portalItem ?? this.options?.item, !this.item) {
|
|
67
69
|
this.fieldsAreDeletable = !1;
|
|
68
70
|
return;
|
|
69
71
|
}
|
|
70
|
-
await
|
|
72
|
+
await U.getCredential(this.item.url.replace("rest/services", "rest/admin/services"));
|
|
71
73
|
}
|
|
72
74
|
getFieldLabel(e) {
|
|
73
75
|
const { layer: t, arcadeExpMap: s } = this;
|
|
@@ -75,12 +77,12 @@ class G extends O {
|
|
|
75
77
|
return this.getFieldDisplayNameFromLayerFields(e);
|
|
76
78
|
{
|
|
77
79
|
const o = (t.popupTemplate ?? t.createPopupTemplate()).fieldInfos?.find((r) => r.fieldName === e);
|
|
78
|
-
return o ?
|
|
80
|
+
return o ? z(t, o, s) : this.getFieldDisplayNameFromLayerFields(e);
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
getFieldDisplayNameFromLayerFields(e) {
|
|
82
84
|
const { layer: t } = this, s = this.layerFieldsMap.get(e);
|
|
83
|
-
return
|
|
85
|
+
return W(t) ? t.getFieldAlias(e) : s.alias ?? s.name;
|
|
84
86
|
}
|
|
85
87
|
async deleteFields() {
|
|
86
88
|
const { layer: e, fieldNames: t } = this, s = `${e.url.replace("/rest/services", "/rest/admin/services")}/${e.layerId}/deleteFromDefinition`, a = {
|
|
@@ -100,12 +102,12 @@ class G extends O {
|
|
|
100
102
|
t.forEach((i) => {
|
|
101
103
|
e.type === "feature" && e.floorInfo?.floorField === i && (e.floorInfo = null);
|
|
102
104
|
});
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
105
|
-
const i =
|
|
106
|
-
this.currentLayerInfo =
|
|
105
|
+
const m = await y(h, { query: { f: "json" }, responseType: "json" });
|
|
106
|
+
if (m) {
|
|
107
|
+
const i = m.data;
|
|
108
|
+
this.currentLayerInfo = m.data, i && (this.updateTypesAndTemplatesOnLayer(), t.forEach((l) => {
|
|
107
109
|
i.templates?.length ? i.templates.forEach((d) => delete d.prototype.attributes[l]) : i.types?.forEach((d) => {
|
|
108
|
-
d.templates.forEach((
|
|
110
|
+
d.templates.forEach((u) => delete u.prototype.attributes[l]);
|
|
109
111
|
});
|
|
110
112
|
}), this.updateFeatureService(i));
|
|
111
113
|
} else
|
|
@@ -128,7 +130,7 @@ class G extends O {
|
|
|
128
130
|
updateTemplatesList(e) {
|
|
129
131
|
const { currentLayerInfo: t, messages: s } = this, a = [];
|
|
130
132
|
return (e ?? []).forEach((o) => {
|
|
131
|
-
const r = new
|
|
133
|
+
const r = new B();
|
|
132
134
|
r.description = o.description ?? "", r.name = o.name || s.newFeature, r.drawingTool = o.drawingTool || "point";
|
|
133
135
|
const h = {};
|
|
134
136
|
t.fields.forEach((i) => {
|
|
@@ -140,8 +142,8 @@ class G extends O {
|
|
|
140
142
|
}
|
|
141
143
|
!l && i.editable && (h[i.name] = i.defaultValue || null);
|
|
142
144
|
});
|
|
143
|
-
const
|
|
144
|
-
r.prototype =
|
|
145
|
+
const m = new j({ attributes: h });
|
|
146
|
+
r.prototype = m, a.push(r);
|
|
145
147
|
}), a;
|
|
146
148
|
}
|
|
147
149
|
addType(e, t) {
|
|
@@ -161,48 +163,48 @@ class G extends O {
|
|
|
161
163
|
responseType: "json"
|
|
162
164
|
}).then(async (h) => {
|
|
163
165
|
if (h.data?.success) {
|
|
164
|
-
const
|
|
166
|
+
const m = `${A(this.portal)}content/items/${this.item.id}/data`;
|
|
165
167
|
if (this.options?.ignorePopupTemplate || s.forEach((i) => {
|
|
166
168
|
t.popupTemplate?.fieldInfos && (t.popupTemplate.fieldInfos = t.popupTemplate.fieldInfos.filter((l) => l.fieldName !== i)), t.popupTemplate?.content?.forEach((l, d) => {
|
|
167
|
-
l.type === "fields" && l.fieldInfos && ((t.popupTemplate?.content)[d].fieldInfos = (t.popupTemplate?.content)[d].fieldInfos?.filter((
|
|
169
|
+
l.type === "fields" && l.fieldInfos && ((t.popupTemplate?.content)[d].fieldInfos = (t.popupTemplate?.content)[d].fieldInfos?.filter((u) => u.fieldName !== i));
|
|
168
170
|
});
|
|
169
171
|
}), t.attributeTableTemplate) {
|
|
170
172
|
const i = t.attributeTableTemplate.clone();
|
|
171
173
|
i.elements = i.elements.filter((l) => !(l.type === "field" && s.includes(l.fieldName))), i.orderByFields = i.orderByFields.filter((l) => !s.includes(l.field)), t.attributeTableTemplate = i;
|
|
172
174
|
}
|
|
173
175
|
if (t.fieldConfigurations?.length) {
|
|
174
|
-
const l =
|
|
176
|
+
const l = S.clone(t.fieldConfigurations).filter((d) => !s.includes(d.name));
|
|
175
177
|
t.fieldConfigurations = l;
|
|
176
178
|
}
|
|
177
|
-
await y(
|
|
179
|
+
await y(m, {
|
|
178
180
|
query: { f: "json" },
|
|
179
181
|
responseType: "json"
|
|
180
182
|
}).then(async (i) => {
|
|
181
183
|
const l = i.data;
|
|
182
184
|
if (l?.layers || l?.tables) {
|
|
183
|
-
const d = t.isTable,
|
|
185
|
+
const d = t.isTable, u = d ? l.tables : l.layers, c = u?.find((g) => g.id === t.layerId);
|
|
184
186
|
if (s.forEach((g) => {
|
|
185
187
|
c?.attributeTableInfo?.attributeTableElements && (c.attributeTableInfo.attributeTableElements = c.attributeTableInfo.attributeTableElements.filter((f) => !(f.type === "field" && f.fieldName === g)), c.attributeTableInfo.orderByFields = c.attributeTableInfo.orderByFields.filter((f) => f.field !== g));
|
|
186
188
|
}), c?.layerDefinition?.fieldConfigurations && (c.layerDefinition.fieldConfigurations = c.layerDefinition.fieldConfigurations.filter((g) => !s.includes(g.name))), c?.popupInfo) {
|
|
187
|
-
s.forEach((
|
|
188
|
-
c.popupInfo.fieldInfos = c.popupInfo.fieldInfos.filter((
|
|
189
|
-
|
|
189
|
+
s.forEach((F) => {
|
|
190
|
+
c.popupInfo.fieldInfos = c.popupInfo.fieldInfos.filter((v) => v.fieldName !== F), c.popupInfo.popupElements?.forEach((v, N) => {
|
|
191
|
+
v.type === "fields" && v.fieldInfos && (c.popupInfo.popupElements[N].fieldInfos = c.popupInfo.popupElements[N].fieldInfos.filter((M) => M.fieldName !== F));
|
|
190
192
|
});
|
|
191
193
|
});
|
|
192
|
-
const g = `${
|
|
193
|
-
d ? (f.tables =
|
|
194
|
-
const
|
|
194
|
+
const g = `${A(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`, f = {};
|
|
195
|
+
d ? (f.tables = u, l.layers && (f.layers = l.layers)) : (f.layers = u, l.tables && (f.tables = l.tables));
|
|
196
|
+
const k = {
|
|
195
197
|
f: "json",
|
|
196
198
|
text: JSON.stringify(f)
|
|
197
199
|
};
|
|
198
200
|
await y(g, {
|
|
199
201
|
query: {
|
|
200
|
-
...
|
|
202
|
+
...k
|
|
201
203
|
},
|
|
202
204
|
method: "post",
|
|
203
205
|
responseType: "json"
|
|
204
|
-
}).then((
|
|
205
|
-
|
|
206
|
+
}).then((F) => {
|
|
207
|
+
F.data?.success ? this.handleSuccess() : this.handleError();
|
|
206
208
|
}, () => this.handleError());
|
|
207
209
|
} else
|
|
208
210
|
this.handleSuccess();
|
|
@@ -219,20 +221,20 @@ class G extends O {
|
|
|
219
221
|
}
|
|
220
222
|
displaySuccessAlert() {
|
|
221
223
|
const { messages: e, fieldNames: t } = this;
|
|
222
|
-
this.successAlertNode && (this.successAlertNode.parentElement?.removeChild(this.successAlertNode), this.successAlertNode = void 0), this.successAlertNode =
|
|
224
|
+
this.successAlertNode && (this.successAlertNode.parentElement?.removeChild(this.successAlertNode), this.successAlertNode = void 0), this.successAlertNode = E(p`<calcite-alert .label=${t.length === 1 ? e.fieldDeleted : e.fieldsDeleted} kind=success icon=check-circle auto-close open><div slot=message>${t.length === 1 ? e.fieldDeleted : e.fieldsDeleted}</div></calcite-alert>`), document.body.append(this.successAlertNode);
|
|
223
225
|
}
|
|
224
226
|
displayErrorAlert() {
|
|
225
227
|
const { messages: e } = this;
|
|
226
|
-
this.errorAlertNode && (this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode), this.errorAlertNode = void 0), this.errorAlertNode =
|
|
228
|
+
this.errorAlertNode && (this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode), this.errorAlertNode = void 0), this.errorAlertNode = E(p`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close open><div slot=message>${e.fieldDeletionUnsuccessful}</div></calcite-alert>`), document.body.append(this.errorAlertNode);
|
|
227
229
|
}
|
|
228
230
|
displayReadOnlyErrorAlert() {
|
|
229
231
|
const { messages: e, portal: t } = this;
|
|
230
|
-
this.errorAlertNode && (this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode), this.errorAlertNode = void 0), this.errorAlertNode =
|
|
232
|
+
this.errorAlertNode && (this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode), this.errorAlertNode = void 0), this.errorAlertNode = E(p`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close auto-close-duration=slow open><div slot=title>${e.error}</div><div slot=message>${t.isPortal ? e.readOnlyErrorMessageEnterprise : e.readOnlyErrorMessage}</div>${!t.isPortal && p`<calcite-link slot=link target=_blank href=https://status.arcgis.com>${e.healthDashboard}</calcite-link>` || ""}</calcite-alert>`), document.body.append(this.errorAlertNode);
|
|
231
233
|
}
|
|
232
234
|
render() {
|
|
233
235
|
const { messages: e, fieldsAreDeletable: t, fieldNames: s, deleteInProgress: a } = this;
|
|
234
236
|
return this._propWatcherTask.render({
|
|
235
|
-
complete: () => (t || (s?.length ? s?.length === 1 ?
|
|
237
|
+
complete: () => (t || (s?.length ? s?.length === 1 ? b("error", this, "Field cannot be deleted") : b("error", this, "One or more fields cannot be deleted") : b("error", this, G("fieldNames"))), p`<calcite-dialog class="dialog" width=s open modal outside-close-disabled escape-disabled @calciteDialogClose=${() => this.arcgisClose.emit()} .heading=${s?.length === 1 ? e.deleteField : e.deleteFields} ${D(this.dialogNode)}>${t ? p`<div class=${`dialog-content-wrapper ${a ? "hide-overflow" : ""}`}>${this.renderDeleteLoader()}<calcite-label>${s.length === 1 ? e.deletePrompt : e.deleteMultiplePrompt}</calcite-label>${this.renderFieldsPreview()}</div>${this.renderCancelButton()}${this.renderDeleteButton()}` : this.renderError()}</calcite-dialog>`)
|
|
236
238
|
});
|
|
237
239
|
}
|
|
238
240
|
renderError() {
|
|
@@ -246,13 +248,13 @@ class G extends O {
|
|
|
246
248
|
renderFieldsPreview() {
|
|
247
249
|
const { fieldNames: e, layerFields: t, layerFieldsMap: s, arcadeExpMap: a, messages: o } = this;
|
|
248
250
|
return p`<calcite-list .label=${o.fields}>${e.map((r) => {
|
|
249
|
-
const h = t.find((
|
|
250
|
-
return p`<calcite-list-item .label=${this.getFieldLabel(r)} .description=${`{${r}}`} .value=${r} .disabled=${!h.editable}><div slot=actions-end class="field-icons">${
|
|
251
|
+
const h = t.find((m) => m.name === r);
|
|
252
|
+
return p`<calcite-list-item .label=${this.getFieldLabel(r)} .description=${`{${r}}`} .value=${r} .disabled=${!h.editable}><div slot=actions-end class="field-icons">${H({ fieldType: _(r, s, a) })}</div></calcite-list-item>`;
|
|
251
253
|
})}</calcite-list>`;
|
|
252
254
|
}
|
|
253
255
|
renderCancelButton() {
|
|
254
256
|
const { messages: e } = this;
|
|
255
|
-
return p`<calcite-button @click=${() => this.dialogNode.value.open = !1} slot=footer-end appearance=outline ${
|
|
257
|
+
return p`<calcite-button @click=${() => this.dialogNode.value.open = !1} slot=footer-end appearance=outline ${D(this.cancelNode)}>${e.cancel}</calcite-button>`;
|
|
256
258
|
}
|
|
257
259
|
renderDeleteButton() {
|
|
258
260
|
const { messages: e, fieldNames: t } = this;
|
|
@@ -262,7 +264,7 @@ class G extends O {
|
|
|
262
264
|
}}>${t.length === 1 ? e.deleteField : e.deleteFieldsWithNumber.replace("${number}", `${t.length}`)}</calcite-button>`;
|
|
263
265
|
}
|
|
264
266
|
}
|
|
265
|
-
|
|
267
|
+
P("arcgis-portal-field-delete", Q);
|
|
266
268
|
export {
|
|
267
|
-
|
|
269
|
+
Q as ArcgisPortalFieldDelete
|
|
268
270
|
};
|
package/dist/docs/api.json
CHANGED
package/dist/docs/docs.json
CHANGED
package/dist/docs/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@arcgis/portal-components",
|
|
4
|
-
"version": "5.0.0-next.
|
|
4
|
+
"version": "5.0.0-next.81",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { g as a, s as t } from "./chunks/runtime.js";
|
|
|
2
2
|
import { c as o, a as r } from "./chunks/fieldAddDelete.js";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.81 */
|
|
6
6
|
export {
|
|
7
7
|
o as canAddField,
|
|
8
8
|
r as canDeleteField,
|
package/dist/loader.js
CHANGED
|
@@ -2,7 +2,7 @@ import { r as e } from "./chunks/runtime.js";
|
|
|
2
2
|
import { makeDefineCustomElements as t } from "@arcgis/lumina";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.81 */
|
|
6
6
|
const r = t(e, {
|
|
7
7
|
"arcgis-portal-classification-banner": [() => import("./components/arcgis-portal-classification-banner/customElement.js"), "autoDestroyDisabled,missingExistingClassification,portalItem:,validationErrors,variant;destroy"],
|
|
8
8
|
"arcgis-portal-classification-config": [() => import("./components/arcgis-portal-classification-config/customElement.js"), "autoDestroyDisabled,portalItem:,status,valid,values;destroy,resetForm,validateForm"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/portal-components",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.81",
|
|
4
4
|
"description": "ArcGIS Portal Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
],
|
|
39
39
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@arcgis/lumina": "5.0.0-next.
|
|
42
|
-
"@arcgis/toolkit": "5.0.0-next.
|
|
41
|
+
"@arcgis/lumina": "5.0.0-next.81",
|
|
42
|
+
"@arcgis/toolkit": "5.0.0-next.81",
|
|
43
43
|
"@lit/task": "^1.0.3",
|
|
44
44
|
"lit": "^3.3.0",
|
|
45
45
|
"tslib": "^2.8.1"
|
package/dist/cdn/BP374N4Z.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.80 */
|
|
4
|
-
import{b as B}from"./RNZZASX2.js";import{a as q}from"./L7XZSKU5.js";import"./3PLIPHN3.js";import{B as S,C as A,D as R,H as P,J,h as j,j as y,p as N}from"./S4MD7LWI.js";export default $arcgis.t(([Y,ve,Ie,Fe,x,v,X,Z,C,$,E])=>{var k=(s=>(s.expression="expression/",s.raster="Raster.",s.relationship="relationships/",s))(k||{}),ee=["feature"];function L(s){return"fieldConfigurations"in s&&ee.includes(s.type)}function T(s){return s!=null}function W(s,e,t){let i=e.fieldName;if(i.includes(k.expression)){let r=t.get(i);return r?.title?r.title:i}else return L(s)&&s.getFieldConfiguration(i)?s.getFieldAlias(i)||i:e.label||i}function V(s,e,t){let i="";if(/^raster.(?:item|service)pixelvalue/iu.test(s))i="number";else if(e.has(s)){let r=e.get(s);i=r.type?r.type.toLowerCase():""}else if(t.has(s)){let r=t.get(s);i=r.returnType?r.returnType.toLowerCase():""}else i="number";return i}async function _(s){return new Map((await te(s)).filter(e=>e.visible).map(e=>[e.name,e]))}function G(s){let e=new Map;return s?.expressionInfos&&s.expressionInfos.forEach(t=>{let i=`${k.expression}${t.name}`;e.set(i,t)}),e}async function te(s){return await new Promise((e,t)=>{switch(s.type){case"feature":case"ogc-feature":case"stream":e(s.fields);break;case"sublayer":{let i=s,r=i?.layer;r?.portalItem&&r.url.includes("https://demographics")&&r.url.includes(".arcgis.com")?r.portalItem?.fetchData().then(a=>{if(a?.thematicGroup){let n=new Map(i.fields.map(o=>[o.name,o])),c=a.thematicGroup.fieldNames,p=[];c.forEach(o=>{n.has(o)&&p.push(n.get(o))}),e(p)}else e(i.fields)}).catch(a=>{t(new Error(a))}):e(i.fields);break}case"imagery":case"imagery-tile":case"wcs":e(s.rasterFields);break;default:e("fields"in s?s.fields??[]:[])}})}var se=s=>s&&!s.endsWith("/")?`${s}/`:s;function F(s){return se(s.restUrl)}function ie(s,e){return z(s,e)||re(s,e)}function z(s,e){return s.owner===e.username}function re(s,e){let t=s.owner,i=s.itemControl==="admin",r=["esri_livingatlas","esri_demographics","esri_boundaries"];return s.portal?.isPortal&&!z(s,e)&&i&&t?.includes("esri_")&&!r.includes(t)?!1:i}function ae(s){return s.typeKeywords?.includes("Spatiotemporal")}function ne(s){return s.typeKeywords?.includes("View Service")}function oe(s){return s.typeKeywords?.includes("Hosted Service")}function le(s){return s.typeKeywords?.includes("Multi Services View")}function de(s){return s?.hasViews&&!s.sourceSchemaChangesAllowed}async function ce(s){let e=s?.portalItem;if(!e)return await Promise.resolve(null);let t=e.portal;if(t?.user){let i=`${F(t)}community/users/${t.user.username}`;return await $(i,{query:{f:"json",token:e.portal.credential?.token},responseType:"json"}).then(async r=>{let a=r.data?.groups??[];return await Promise.resolve(a)},async()=>await Promise.reject(new Error("Failed to fetch user groups")))}return await Promise.resolve(null)}async function pe(s){let e=s?.portalItem;if(!e)return await Promise.resolve(null);let t=e.portal,i=`${F(t)}content/items/${e.id}/groups`;return await $(i,{query:{f:"json",token:e.portal.credential?.token},responseType:"json"}).then(async r=>{let a=r.data?.admin??[],n=r.data?.member??[],c=r.data?.other??[],p=[...a,...n,...c];return await Promise.resolve(p)},async()=>await Promise.reject(new Error("Failed to fetch item groups")))}async function fe(s,e,{relationshipType:t,direction:i}){let r=`${F(e)}content/items/${s}/relatedItems`;return await $(r,{query:{f:"json",relationshipType:t,direction:i},responseType:"json"})}function ue(s,e){return s?.some(t=>e?.some(i=>t.id===i.id&&t.capabilities.includes("updateitemcontrol")))}function d(s,e){return!s||!e?!1:s.toLocaleLowerCase()===e.toLocaleLowerCase()}async function U(s,e,t,i){if(!t)return!1;let r=["feature","oriented-imagery"].includes(e.type),a=i?.item??e.portalItem,n=e.sourceJSON;if(!r||!a||!a.portal.user||!oe(a)||ne(a)||le(a)||de(n)||a.portal.isPortal&&ae(a)||["oid","global-id","geometry"].includes(t.type)||await me(e,t.name,i))return!1;let c=e.sourceJSON.geometryProperties,p=c?.shapeLengthFieldName,o=c?.shapeAreaFieldName;if(d(p,t.name)||d(o,t.name))return!1;let l=e.editFieldsInfo;if(l&&(d(l.creationDateField,t.name)||d(l.creatorField,t.name)||d(l.editDateField,t.name)||d(l.editorField,t.name))||d(e.objectIdField,t.name)||d(e.displayField,t.name)||d(e.typeIdField,t.name)||d(e.subtypeField,t.name)||e.timeInfo&&(d(e.timeInfo.startField,t.name)||d(e.timeInfo.endField,t.name)||d(e.timeInfo.trackIdField,t.name)))return!1;if(!i?.ignoreLayerRenderer&&e.featureReduction){let u=new Set;if(await v.collectFeatureReductionFields(u,e,e.featureReduction),Array.from(u).some(b=>d(b,t.name)))return!1}if(!i?.ignoreLayerRenderer&&(await v.getRendererFields(e.renderer,e.fieldsIndex)).some(u=>d(u,t.name)))return!1;if(!i?.ignoreLayerLabelingInfo){let u=e.labelingInfo?.map(b=>b.labelExpressionInfo?.expression);if(u&&((await v.getExpressionFields(e,u)).some(b=>d(b,t.name))||await K(e,t,"layer")))return!1}if(!i?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await E.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(u=>d(u,t.name))||await ye(e,t,i)||await ge(e,t))return!1;if(await we(e,t))return await Promise.resolve(!1);if(await be(e,t))return await Promise.resolve(!1);if(he(s,e,t)||e.relationships?.map(u=>u.keyField)?.some(u=>d(u,t.name)))return!1;let f=ie(a,a.portal.user),I=i?.userItemInfo?.userGroups??await ce(e)??[],h=i?.userItemInfo?.itemGroups??await pe(e)??[],w=ue(I,h);if(!f&&!w)return!1;let g=i?.userItemInfo?.relatedItems??await fe(a.id,a.portal,{relationshipType:"Service2Service"});return!(g?.data?.relatedItems&&g.data.relatedItems.some(u=>["WMTS","Map Service","Vector Tile Service"].includes(u.type)))}async function me(s,e,t){let i=`${s.url}/${s.layerId}/fieldGroups`,r=t?.userItemInfo&&"fieldGroups"in t.userItemInfo?t.userItemInfo.fieldGroups:(await $(i,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return r?r.some(a=>a.fields.some(n=>d(n,e))):!1}function he(s,e,t){if(!s)return!1;let i=s.map?.applicationProperties?.viewing?.search;if(i){let r=i.layers?.find(a=>a.id===e.id);if(r){let a=r?.field?.name;if(a)return d(a,t.name)}}return!1}async function K(s,e,t){let i=t==="layer"?s.labelingInfo?.filter(n=>T(n.where)):s.sourceJSON?.drawingInfo?.labelingInfo?.filter(n=>T(n.where));if(!i?.length)return!1;let r=[...await Promise.all(i.map(async n=>await E.parseWhereClause(n.where,s.fieldsIndex)))],a=!1;for(let n=0;n<r.length;n++){let c=r[n].fieldNames?.some(p=>d(p,e.name));if(!a&&c){a=!0;break}}return await Promise.resolve(a)}async function ye(s,e,t){let i=s.portalItem;if(!i)return!1;let r=`${F(i.portal)}content/items/${i.id}/data`,a=(t?.userItemInfo?.itemData??await $(r,{query:{f:"json"},responseType:"json"}))?.data;if(!a)return!1;if(a?.layers){let n=a.layers.find(l=>l.id===s.layerId),c=n?.layerDefinition?.drawingInfo?.renderer,p=n?.layerDefinition?.featureReduction,o=n?.layerDefinition?.definitionExpression;if(!c&&!p&&!o)return!1;if(!t?.ignoreItemRenderer&&c){let l=C.fromJSON(c);if((await v.getRendererFields(l,s.fieldsIndex)).some(f=>d(f,e.name)))return!0}if(!t?.ignoreItemFeatureReduction&&p&&await H(s,e,p)||o&&(await E.parseWhereClause(o,s.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function ge(s,e){let t=s.sourceJSON,i=t?.drawingInfo?.renderer,r=t?.featureReduction;if(!i&&!r)return!1;if(i){let a=C.fromJSON(i);if((await v.getRendererFields(a,s.fieldsIndex)).some(n=>d(n,e.name)))return!0}return!!(r&&await H(s,e,r))}async function we(s,e){let t=s.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let i=t?.map(r=>r.labelExpressionInfo?.expression);if(i){if((await v.getExpressionFields(s,i)).some(r=>d(r,e.name)))return await Promise.resolve(!0);if(await K(s,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function be(s,e){let t=s.sourceJSON?.definitionQuery;return t?(await E.parseWhereClause(t,s.fieldsIndex)).fieldNames.some(i=>d(i,e.name))?await Promise.resolve(!0):await Promise.resolve(!1):await Promise.resolve(!1)}async function H(s,e,t){let i=t.type==="binning"?X.fromJSON(t):Z.fromJSON(t),r=new Set;return await v.collectFeatureReductionFields(r,s,i),!!Array.from(r).some(a=>d(a,e.name))}var m=new Map;m.set("oid","key");m.set("guid","key");m.set("global-id","key");m.set("blob","binary");m.set("integer","integer");m.set("small-integer","integer");m.set("big-integer","integer");m.set("single","number");m.set("double","number");m.set("long","number");m.set("number","number");m.set("date","date-time");m.set("date-only","calendar");m.set("time-only","clock");m.set("timestamp-offset","time-zone");m.set("string","string");var Ne=({fieldType:s})=>y`<calcite-icon scale=s .icon=${m.get(s)}></calcite-icon>`,Te=j`.dialog{--calcite-dialog-max-size-y: 60%}.dialog-content-wrapper{position:relative;min-height:100px}.hide-overflow{overflow:hidden}.field-icons{padding:0 var(--calcite-spacing-lg);display:flex;align-items:center}.warning{border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);margin-bottom:var(--calcite-spacing-md)}.warning-message{font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold)}.loader-container{position:absolute;height:100%;width:100%;top:0;right:0;display:none;z-index:40;overflow:hidden;background:#fffffff2;padding:0}.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.loader{padding:0}.loader-text{font-weight:var(--calcite-font-weight-medium);text-align:center;margin-right:6.25rem;margin-left:6.25rem}`,O=class extends R{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=S(),this.dialogNode=S(),this.layerFields=[],this.layerFieldsMap=new Map,this.messages=q({blocking:!0}),this.deleteInProgress=!1,this.fieldsAreDeletable=!1,this._propWatcherTask=new B(this,{task:async([e,t])=>{if(!(T(e)&&T(t)))throw console.error("Required properties are missing."),new Error;this._propWatcherTask.autoRun=!1,await this.processProps()},args:()=>[this.layer,this.fieldNames]}),this.arcgisBeforeModalClose=N(),this.arcgisClose=N(),this.arcgisBeforeDelete=N(),this.arcgisFieldsDeleted=N()}static{this.properties={config:0,fieldNames:0,layer:0,mapView:0,options:0}}static{this.styles=Te}async processProps(){let{layer:e,mapView:t,fieldNames:i}=this;if(!e||!i){this.fieldsAreDeletable=!1;return}e.loaded||await e.load(),this.layerFields=e.fields.filter(a=>i.includes(a.name));let r=i.some(a=>!e.fields.find(n=>n.name===a));if(!this.layerFields?.length||r)this.fieldsAreDeletable=!1;else{let a=await Promise.all(this.layerFields.map(async n=>await U(t,e,n,this.options)));if(this.fieldsAreDeletable=a.every(n=>n),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await _(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=G(e.popupTemplate)),this.portal=e.portalItem?.portal??this.options?.portal,this.item=e.portalItem??this.options?.item,!this.item){this.fieldsAreDeletable=!1;return}await Fe.getCredential(this.item.url.replace("rest/services","rest/admin/services"))}getFieldLabel(e){let{layer:t,arcadeExpMap:i}=this;if(this.options?.ignorePopupTemplate)return this.getFieldDisplayNameFromLayerFields(e);{let r=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(a=>a.fieldName===e);return r?W(t,r,i):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let{layer:t}=this,i=this.layerFieldsMap.get(e);return L(t)?t.getFieldAlias(e):i.alias??i.name}async deleteFields(){let{layer:e,fieldNames:t}=this,i=`${e.url.replace("/rest/services","/rest/admin/services")}/${e.layerId}/deleteFromDefinition`,r={fields:t.map(n=>({name:n}))},a={deleteFromDefinition:JSON.stringify(r)};await x(i,{query:{...a,f:"json",async:!1},method:"post",responseType:"json"}).then(async n=>{if(n.data?.success){let c=`${e.url}/${e.layerId}`;t.forEach(o=>{e.type==="feature"&&e.floorInfo?.floorField===o&&(e.floorInfo=null)});let p=await x(c,{query:{f:"json"},responseType:"json"});if(p){let o=p.data;this.currentLayerInfo=p.data,o&&(this.updateTypesAndTemplatesOnLayer(),t.forEach(l=>{o.templates?.length?o.templates.forEach(f=>delete f.prototype.attributes[l]):o.types?.forEach(f=>{f.templates.forEach(I=>delete I.prototype.attributes[l])})}),this.updateFeatureService(o))}else this.handleError()}},()=>this.handleError())}updateTypesAndTemplatesOnLayer(){let{currentLayerInfo:e}=this,t=e;if(t.templates?.length){let i=this.updateTemplatesList(t.templates);t.templates=i}else if(t.types){let i=t.types;t.types=[],i.forEach(r=>{r.templates=this.updateTemplatesList(r.templates),this.addType(t,r)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:i}=this,r=[];return(e??[]).forEach(a=>{let n=new ve;n.description=a.description??"",n.name=a.name||i.newFeature,n.drawingTool=a.drawingTool||"point";let c={};t.fields.forEach(o=>{let l=!1;for(let f=0;f<a.prototype.attributes.length;f++)if(a.prototype.attributes[f]===o.name){l=!0,c[o.name]=a.prototype.attributes[o.name];break}!l&&o.editable&&(c[o.name]=o.defaultValue||null)});let p=new Ie({attributes:c});n.prototype=p,r.push(n)}),r}addType(e,t){e.types?e.types.some(i=>i.id===t.id)||e.types.push(t):e.types=[t]}async updateFeatureService(e){let{layer:t,fieldNames:i}=this,r={templates:e.templates,types:e.types},a=`${t.url.replace("/rest/services","/rest/admin/services")}/${t.layerId}/updateDefinition`,n={f:"json",updateDefinition:JSON.stringify(r)};await x(a,{query:{...n,f:"json"},method:"post",responseType:"json"}).then(async c=>{if(c.data?.success){let p=`${F(this.portal)}content/items/${this.item.id}/data`;if(this.options?.ignorePopupTemplate||i.forEach(o=>{t.popupTemplate?.fieldInfos&&(t.popupTemplate.fieldInfos=t.popupTemplate.fieldInfos.filter(l=>l.fieldName!==o)),t.popupTemplate?.content?.forEach((l,f)=>{l.type==="fields"&&l.fieldInfos&&((t.popupTemplate?.content)[f].fieldInfos=(t.popupTemplate?.content)[f].fieldInfos?.filter(I=>I.fieldName!==o))})}),t.attributeTableTemplate){let o=t.attributeTableTemplate.clone();o.elements=o.elements.filter(l=>!(l.type==="field"&&i.includes(l.fieldName))),o.orderByFields=o.orderByFields.filter(l=>!i.includes(l.field)),t.attributeTableTemplate=o}if(t.fieldConfigurations?.length){let o=Y.clone(t.fieldConfigurations).filter(l=>!i.includes(l.name));t.fieldConfigurations=o}await x(p,{query:{f:"json"},responseType:"json"}).then(async o=>{let l=o.data;if(l?.layers||l?.tables){let f=t.isTable,I=f?l.tables:l.layers,h=I?.find(w=>w.id===t.layerId);if(i.forEach(w=>{h?.attributeTableInfo?.attributeTableElements&&(h.attributeTableInfo.attributeTableElements=h.attributeTableInfo.attributeTableElements.filter(g=>!(g.type==="field"&&g.fieldName===w)),h.attributeTableInfo.orderByFields=h.attributeTableInfo.orderByFields.filter(g=>g.field!==w))}),h?.layerDefinition?.fieldConfigurations&&(h.layerDefinition.fieldConfigurations=h.layerDefinition.fieldConfigurations.filter(w=>!i.includes(w.name))),h?.popupInfo){i.forEach(b=>{h.popupInfo.fieldInfos=h.popupInfo.fieldInfos.filter(D=>D.fieldName!==b),h.popupInfo.popupElements?.forEach((D,M)=>{D.type==="fields"&&D.fieldInfos&&(h.popupInfo.popupElements[M].fieldInfos=h.popupInfo.popupElements[M].fieldInfos.filter(Q=>Q.fieldName!==b))})});let w=`${F(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,g={};f?(g.tables=I,l.layers&&(g.layers=l.layers)):(g.layers=I,l.tables&&(g.tables=l.tables));let u={f:"json",text:JSON.stringify(g)};await x(w,{query:{...u},method:"post",responseType:"json"}).then(b=>{b.data?.success?this.handleSuccess():this.handleError()},()=>this.handleError())}else this.handleSuccess()}else o.httpStatus===200&&(!o.data||JSON.stringify(o.data)==="{}")?this.handleSuccess():this.handleError()},()=>this.handleError())}},()=>this.handleError())}handleSuccess(){this.arcgisFieldsDeleted.emit(),this.dialogNode?.value&&(this.dialogNode.value.open=!1),this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("success"):this.displaySuccessAlert()}handleError(e){this.dialogNode?.value&&(this.dialogNode.value.open=!1),e?this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("read-only-error"):this.displayReadOnlyErrorAlert():this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("error"):this.displayErrorAlert()}displaySuccessAlert(){let{messages:e,fieldNames:t}=this;this.successAlertNode&&(this.successAlertNode.parentElement?.removeChild(this.successAlertNode),this.successAlertNode=void 0),this.successAlertNode=P(y`<calcite-alert .label=${t.length===1?e.fieldDeleted:e.fieldsDeleted} kind=success icon=check-circle auto-close open><div slot=message>${t.length===1?e.fieldDeleted:e.fieldsDeleted}</div></calcite-alert>`),document.body.append(this.successAlertNode)}displayErrorAlert(){let{messages:e}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=P(y`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close open><div slot=message>${e.fieldDeletionUnsuccessful}</div></calcite-alert>`),document.body.append(this.errorAlertNode)}displayReadOnlyErrorAlert(){let{messages:e,portal:t}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=P(y`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close auto-close-duration=slow open><div slot=title>${e.error}</div><div slot=message>${t.isPortal?e.readOnlyErrorMessageEnterprise:e.readOnlyErrorMessage}</div>${!t.isPortal&&y`<calcite-link slot=link target=_blank href=https://status.arcgis.com>${e.healthDashboard}</calcite-link>`||""}</calcite-alert>`),document.body.append(this.errorAlertNode)}render(){let{messages:e,fieldsAreDeletable:t,fieldNames:i,deleteInProgress:r}=this;return this._propWatcherTask.render({complete:()=>(t||(i?.length?i?.length===1?console.error("Field cannot be deleted"):console.error("One or more fields cannot be deleted"):console.error("You must select at least one field.")),y`<calcite-dialog class="dialog" width=s open modal outside-close-disabled escape-disabled @calciteDialogClose=${()=>this.arcgisClose.emit()} .heading=${i?.length===1?e.deleteField:e.deleteFields} ${A(this.dialogNode)}>${t?y`<div class=${`dialog-content-wrapper ${r?"hide-overflow":""}`}>${this.renderDeleteLoader()}<calcite-label>${i.length===1?e.deletePrompt:e.deleteMultiplePrompt}</calcite-label>${this.renderFieldsPreview()}</div>${this.renderCancelButton()}${this.renderDeleteButton()}`:this.renderError()}</calcite-dialog>`)})}renderError(){let{messages:e}=this;return y`<div class="loader-container active"><div class="loader-text">${e.errorOccurred}</div></div>`}renderDeleteLoader(){let{messages:e,fieldNames:t,deleteInProgress:i}=this;return y`<div class=${`loader-container ${i?"active":""}`}><calcite-loader class="loader" .label=${t.length===1?e.deletingField:e.deletingFields} .hidden=${!i}></calcite-loader><div class="loader-text">${t.length===1?e.deletingField:e.deletingFields}</div></div>`}renderFieldsPreview(){let{fieldNames:e,layerFields:t,layerFieldsMap:i,arcadeExpMap:r,messages:a}=this;return y`<calcite-list .label=${a.fields}>${e.map(n=>{let c=t.find(p=>p.name===n);return y`<calcite-list-item .label=${this.getFieldLabel(n)} .description=${`{${n}}`} .value=${n} .disabled=${!c.editable}><div slot=actions-end class="field-icons">${Ne({fieldType:V(n,i,r)})}</div></calcite-list-item>`})}</calcite-list>`}renderCancelButton(){let{messages:e}=this;return y`<calcite-button @click=${()=>this.dialogNode.value.open=!1} slot=footer-end appearance=outline ${A(this.cancelNode)}>${e.cancel}</calcite-button>`}renderDeleteButton(){let{messages:e,fieldNames:t}=this;return y`<calcite-button kind=danger slot=footer-end @click=${async i=>{let{portal:r}=this;i.currentTarget.disabled=!0,this.cancelNode.value.disabled=!0,this.dialogNode.value.closeDisabled=!0,r.sourceJSON?.isReadOnly?this.handleError(!0):(this.deleteInProgress=!0,this.requestUpdate(),this.arcgisBeforeDelete.emit(),await this.deleteFields())}}>${t.length===1?e.deleteField:e.deleteFieldsWithNumber.replace("${number}",`${t.length}`)}</calcite-button>`}};J("arcgis-portal-field-delete",O);return O},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql")
|