@arcgis/portal-components 5.0.0-next.86 → 5.0.0-next.88
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/2ANZXOIG.js +4 -0
- package/dist/cdn/{HFO4L5IT.js → 37X75S2D.js} +2 -2
- package/dist/cdn/{L4Z5PHFA.js → 3WEGPEQ3.js} +2 -2
- package/dist/cdn/{WFFTPA2A.js → 46LWAWA3.js} +2 -2
- package/dist/cdn/{QUL427FG.js → 47UNWQWO.js} +2 -2
- package/dist/cdn/{D7EJFPXG.js → CKZZXERM.js} +2 -2
- package/dist/cdn/{K7HBVNH5.js → F475YP5Z.js} +1 -1
- package/dist/cdn/{R3CVFCT7.js → FKZDR3MJ.js} +2 -2
- package/dist/cdn/{HJXNLYHT.js → HLRDE6TK.js} +1 -1
- package/dist/cdn/{7Z7PRDPX.js → J2O65GFO.js} +2 -2
- package/dist/cdn/{4ZZKWZIO.js → JEBIVAX2.js} +2 -2
- package/dist/cdn/{QXTRUO2I.js → KW6NCSDZ.js} +2 -2
- package/dist/cdn/{RQTY5Q7N.js → LX3TGA7M.js} +2 -2
- package/dist/cdn/{Z5J5O76M.js → OMDJ22PV.js} +2 -2
- package/dist/cdn/{OA4IDOTR.js → P4VAVBXY.js} +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-TW.json +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/HDZQF7CT.js +0 -4
|
@@ -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.88 */
|
|
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.88 */
|
|
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.88 */
|
|
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.88 */
|
|
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.88 */
|
|
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.88 */
|
|
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() {
|
|
@@ -13,7 +13,7 @@ import { u as V } from "../../chunks/useT9n.js";
|
|
|
13
13
|
import { log as b, composeMissingPropertyMessage as C, composeEmptyPropertyMessage as G } from "@arcgis/toolkit/log";
|
|
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.88 */
|
|
17
17
|
const n = /* @__PURE__ */ new Map();
|
|
18
18
|
n.set("oid", "key");
|
|
19
19
|
n.set("guid", "key");
|
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.88",
|
|
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.88 */
|
|
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.88 */
|
|
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.88",
|
|
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.88",
|
|
42
|
+
"@arcgis/toolkit": "5.0.0-next.88",
|
|
43
43
|
"@lit/task": "^1.0.3",
|
|
44
44
|
"lit": "^3.3.0",
|
|
45
45
|
"tslib": "^2.8.1"
|
package/dist/cdn/HDZQF7CT.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.86 */
|
|
4
|
-
import{b as W}from"./R3CVFCT7.js";import{a as G}from"./Z5J5O76M.js";import"./QXTRUO2I.js";import{B as C,C as A,D as B,H as x,J as q,h as J,j as y,p as T}from"./K7HBVNH5.js";export default $arcgis.t(([ee,Ee,Se,Pe,P,I,se,ie,k,E,S])=>{var M=(s=>(s.expression="expression/",s.raster="Raster.",s.relationship="relationships/",s))(M||{}),re=["feature"];function L(s){return"fieldConfigurations"in s&&re.includes(s.type)}function N(s){return s!=null}function V(s,e,t){let i=e.fieldName;if(i.includes(M.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 _(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 U(s){return new Map((await ae(s)).filter(e=>e.visible).map(e=>[e.name,e]))}function z(s){let e=new Map;return s?.expressionInfos&&s.expressionInfos.forEach(t=>{let i=`${M.expression}${t.name}`;e.set(i,t)}),e}async function ae(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 ne=s=>s&&!s.endsWith("/")?`${s}/`:s;function F(s){return ne(s.restUrl)}function oe(s,e){return K(s,e)||le(s,e)}function K(s,e){return s.owner===e.username}function le(s,e){let t=s.owner,i=s.itemControl==="admin",r=["esri_livingatlas","esri_demographics","esri_boundaries"];return s.portal?.isPortal&&!K(s,e)&&i&&t?.includes("esri_")&&!r.includes(t)?!1:i}function de(s){return s.typeKeywords?.includes("Spatiotemporal")}function ce(s){return s.typeKeywords?.includes("View Service")}function pe(s){return s.typeKeywords?.includes("Hosted Service")}function fe(s){return s.typeKeywords?.includes("Multi Services View")}function ue(s){return s?.hasViews&&!s.sourceSchemaChangesAllowed}async function me(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 E(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 he(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 E(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 ye(s,e,{relationshipType:t,direction:i}){let r=`${F(e)}content/items/${s}/relatedItems`;return await E(r,{query:{f:"json",relationshipType:t,direction:i},responseType:"json"})}function ge(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 H(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||!pe(a)||ce(a)||fe(a)||ue(n)||a.portal.isPortal&&de(a)||["oid","global-id","geometry"].includes(t.type)||await we(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 I.collectFeatureReductionFields(u,e,e.featureReduction),Array.from(u).some(b=>d(b,t.name)))return!1}if(!i?.ignoreLayerRenderer&&(await I.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 I.getExpressionFields(e,u)).some(b=>d(b,t.name))||await X(e,t,"layer")))return!1}if(!i?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await S.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(u=>d(u,t.name))||await Ie(e,t,i)||await ve(e,t))return!1;if(await Ne(e,t))return await Promise.resolve(!1);if(await Fe(e,t))return await Promise.resolve(!1);if(be(s,e,t)||e.relationships?.map(u=>u.keyField)?.some(u=>d(u,t.name)))return!1;let f=oe(a,a.portal.user),v=i?.userItemInfo?.userGroups??await me(e)??[],h=i?.userItemInfo?.itemGroups??await he(e)??[],w=ge(v,h);if(!f&&!w)return!1;let g=i?.userItemInfo?.relatedItems??await ye(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 we(s,e,t){let i=`${s.url}/${s.layerId}/fieldGroups`,r=t?.userItemInfo&&"fieldGroups"in t.userItemInfo?t.userItemInfo.fieldGroups:(await E(i,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return r?r.some(a=>a.fields.some(n=>d(n,e))):!1}function be(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 X(s,e,t){let i=t==="layer"?s.labelingInfo?.filter(n=>N(n.where)):s.sourceJSON?.drawingInfo?.labelingInfo?.filter(n=>N(n.where));if(!i?.length)return!1;let r=[...await Promise.all(i.map(async n=>await S.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 Ie(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 E(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=k.fromJSON(c);if((await I.getRendererFields(l,s.fieldsIndex)).some(f=>d(f,e.name)))return!0}if(!t?.ignoreItemFeatureReduction&&p&&await Y(s,e,p)||o&&(await S.parseWhereClause(o,s.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function ve(s,e){let t=s.sourceJSON,i=t?.drawingInfo?.renderer,r=t?.featureReduction;if(!i&&!r)return!1;if(i){let a=k.fromJSON(i);if((await I.getRendererFields(a,s.fieldsIndex)).some(n=>d(n,e.name)))return!0}return!!(r&&await Y(s,e,r))}async function Ne(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 I.getExpressionFields(s,i)).some(r=>d(r,e.name)))return await Promise.resolve(!0);if(await X(s,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function Fe(s,e){let t=s.sourceJSON?.definitionQuery;return t?(await S.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 Y(s,e,t){let i=t.type==="binning"?se.fromJSON(t):ie.fromJSON(t),r=new Set;return await I.collectFeatureReductionFields(r,s,i),!!Array.from(r).some(a=>d(a,e.name))}var Z=new Set,$e;var Te=s=>typeof s=="string"?s:"el"in s?s.el.localName:"localName"in s?s.localName:s.declaredClass,$=(s,e,t,i)=>{let r=Te(e);if(i?.once){let a=`${s}${r}${t}`;if(Z.has(a))return;Z.add(a)}$e?.log.interceptors?.forEach(a=>a(s,r,t)),console[s](`[${r}]`,t)},O=s=>`The property \`${s.toString()}\` is required but missing.`,Q=s=>`The property \`${s.toString()}\` is empty but must have at least one element.`;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 De=({fieldType:s})=>y`<calcite-icon scale=s .icon=${m.get(s)}></calcite-icon>`,xe=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}`,j=class extends B{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=C(),this.dialogNode=C(),this.layerFields=[],this.layerFieldsMap=new Map,this.messages=G({blocking:!0}),this.deleteInProgress=!1,this.fieldsAreDeletable=!1,this._propWatcherTask=new W(this,{task:async([e,t])=>{let i=N(e)&&N(t);if(N(e)||$("error",this,O("layer")),N(t)||$("error",this,O("fieldNames")),!i)throw new Error("Required properties are missing");this._propWatcherTask.autoRun=!1,await this.processProps()},args:()=>[this.layer,this.fieldNames]}),this.arcgisBeforeModalClose=T(),this.arcgisClose=T(),this.arcgisBeforeDelete=T(),this.arcgisFieldsDeleted=T()}static{this.properties={config:0,fieldNames:0,layer:0,mapView:0,options:0}}static{this.styles=xe}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 H(t,e,n,this.options)));if(this.fieldsAreDeletable=a.every(n=>n),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await U(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=z(e.popupTemplate)),this.portal=e.portalItem?.portal??this.options?.portal,this.item=e.portalItem??this.options?.item,!this.item){this.fieldsAreDeletable=!1;return}await Pe.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?V(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 P(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 P(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(v=>delete v.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 Ee;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 Se({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 P(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(v=>v.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=ee.clone(t.fieldConfigurations).filter(l=>!i.includes(l.name));t.fieldConfigurations=o}await P(p,{query:{f:"json"},responseType:"json"}).then(async o=>{let l=o.data;if(l?.layers||l?.tables){let f=t.isTable,v=f?l.tables:l.layers,h=v?.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,R)=>{D.type==="fields"&&D.fieldInfos&&(h.popupInfo.popupElements[R].fieldInfos=h.popupInfo.popupElements[R].fieldInfos.filter(te=>te.fieldName!==b))})});let w=`${F(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,g={};f?(g.tables=v,l.layers&&(g.layers=l.layers)):(g.layers=v,l.tables&&(g.tables=l.tables));let u={f:"json",text:JSON.stringify(g)};await P(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=x(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=x(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=x(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?$("error",this,"Field cannot be deleted"):$("error",this,"One or more fields cannot be deleted"):$("error",this,Q("fieldNames"))),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">${De({fieldType:_(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>`}};q("arcgis-portal-field-delete",j);return j},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql")
|