@arcgis/portal-components 5.0.0-next.136 → 5.0.0-next.138
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/{KAAVLN67.js → 77AHGEH2.js} +2 -2
- package/dist/cdn/{QF4PT6DN.js → 7HJNBQ4Z.js} +2 -2
- package/dist/cdn/{K7NJST56.js → 7IUGSPNA.js} +2 -2
- package/dist/cdn/{X63SQRMQ.js → B5SBCJ3C.js} +1 -1
- package/dist/cdn/{P6R5NA3A.js → BMVMPK5L.js} +2 -2
- package/dist/cdn/{KGMTMMHV.js → CI6BKI5S.js} +2 -2
- package/dist/cdn/{VVWPJRUI.js → DGCGGFDO.js} +2 -2
- package/dist/cdn/DNYIE6VB.js +6 -0
- package/dist/cdn/{LXQRUFRM.js → EG7OXB7L.js} +2 -2
- package/dist/cdn/{4RPZSSVS.js → F3NO2DJ7.js} +2 -2
- package/dist/cdn/{PQD35XIM.js → KKDTTTRJ.js} +2 -2
- package/dist/cdn/{3QGXNHUJ.js → M3FLI3RE.js} +2 -2
- package/dist/cdn/{OLL7YXB7.js → TM7MOVDU.js} +1 -1
- package/dist/cdn/{BFBSGGTS.js → UPVXKXHM.js} +2 -2
- package/dist/cdn/{YEPDFJPA.js → VBAMQMEX.js} +2 -2
- package/dist/cdn/{CBZCGQ7U.js → WFP254HP.js} +2 -2
- package/dist/cdn/{6X4M6WCH.js → XQZNQPZY.js} +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/item.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.d.ts +39 -34
- package/dist/components/arcgis-portal-classification-banner/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-banner/index.d.ts +0 -1
- package/dist/components/arcgis-portal-classification-config/customElement.d.ts +67 -41
- package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-config/index.d.ts +0 -11
- package/dist/components/arcgis-portal-classification-favorite/customElement.d.ts +61 -16
- package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-favorite/index.d.ts +0 -11
- package/dist/components/arcgis-portal-classification-form-element/customElement.d.ts +27 -15
- package/dist/components/arcgis-portal-classification-form-element/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-form-element/index.d.ts +0 -8
- package/dist/components/arcgis-portal-extent-picker/customElement.d.ts +119 -51
- package/dist/components/arcgis-portal-extent-picker/customElement.js +1 -1
- package/dist/components/arcgis-portal-extent-picker/index.d.ts +0 -7
- package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +1 -1
- package/dist/components/arcgis-portal-field-delete/customElement.d.ts +88 -29
- package/dist/components/arcgis-portal-field-delete/customElement.js +1 -1
- package/dist/components/arcgis-portal-field-delete/index.d.ts +0 -9
- package/dist/components/arcgis-portal-replacement-item-redirect/customElement.d.ts +33 -21
- package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +1 -1
- package/dist/components/arcgis-portal-replacement-item-redirect/index.d.ts +0 -5
- package/dist/docs/api.json +1 -1609
- package/dist/docs/docs.json +1 -1520
- package/dist/docs/vscode.css-custom-data.json +1 -6
- package/dist/docs/vscode.html-custom-data.json +1 -142
- package/dist/docs/web-types.json +1 -484
- package/dist/index.d.ts +31 -17
- package/dist/index.js +1 -1
- package/dist/loader.js +10 -10
- package/dist/models/classificationModel.d.ts +1 -68
- package/dist/types/classification.d.ts +89 -165
- package/dist/types/lumina.d.ts +17 -17
- package/dist/types/preact.d.ts +17 -17
- package/dist/types/react.d.ts +17 -17
- package/dist/types/stencil.d.ts +17 -17
- package/dist/utils/fieldAddDelete.d.ts +12 -3
- package/dist/utils/types.d.ts +25 -24
- package/package.json +4 -4
- package/dist/cdn/HTG4KVD4.js +0 -6
- package/dist/components/arcgis-portal-extent-picker/mask-layer.d.ts +0 -28
- package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.d.ts +0 -29
- package/dist/components/arcgis-portal-extent-picker-coord-field/index.d.ts +0 -3
- package/dist/components/arcgis-portal-field-delete/types.d.ts +0 -5
- package/dist/components/arcgis-portal-replacement-item-redirect/types/actions.d.ts +0 -11
- package/dist/components/arcgis-portal-replacement-item-redirect/utils/actions.d.ts +0 -24
- package/dist/components/arcgis-portal-replacement-item-redirect/utils/capabilities.d.ts +0 -4
- package/dist/components/arcgis-portal-replacement-item-redirect/utils/info.d.ts +0 -2
- package/dist/controllers/loadClassificationData.d.ts +0 -11
- package/dist/controllers/useClassificationModel.d.ts +0 -9
- package/dist/controllers/useT9n.d.ts +0 -1
- package/dist/runtime.d.ts +0 -6
- package/dist/utils/arcade.d.ts +0 -27
- package/dist/utils/common.d.ts +0 -29
- package/dist/utils/commonEnums.d.ts +0 -5
- package/dist/utils/commonFunctions.d.ts +0 -12
- package/dist/utils/functionalComponents/FieldIcons.d.ts +0 -6
- package/dist/utils/item.d.ts +0 -21
- package/dist/utils/portal.d.ts +0 -2
- package/dist/utils/requests.d.ts +0 -15
- package/dist/utils/style.d.ts +0 -1
- package/dist/utils/url.d.ts +0 -1
|
@@ -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 m}from"./
|
|
3
|
+
v5.0.0-next.138 */
|
|
4
|
+
import{a as m}from"./VBAMQMEX.js";import{a as h}from"./M3FLI3RE.js";import"./EG7OXB7L.js";import{I as b,L as a,O as d,h as c,j as i,u}from"./DNYIE6VB.js";var g=c`.spacing-y{margin:var(--calcite-spacing-md) 0}.portal-classification-form-element-tooltip{display:flex;justify-content:space-between;align-items:center}`;function s(o,e){return o.uiElement===e}var n=class extends b{constructor(){super(...arguments),this.messages=h(),this.isRequiredErrors=new Set,this.arcgisAttributeValueChange=u()}static{this.properties={validationMsg:16,attributeKey:1,attribute:0,value:0,renderingInfo:0,isRequiredErrors:0}}static{this.styles=g}willUpdate(e){(e.has("renderingInfo")||e.has("isRequiredErrors"))&&(this.validationMsg=this._getValidationMessage())}_getValidationMessage(){if(this.renderingInfo?.attributeValidationResult)return this.renderingInfo.attributeValidationResult;if(this.isRequiredErrors.has(this.attributeKey))return this.messages.requiredfield??"This is a required field."}renderCheckbox(){return s(this.attribute,"checkbox")?i`<calcite-label class="spacing-y" .for=${this.attributeKey} layout=inline><calcite-checkbox .checked=${this.value} id=${this.attributeKey??a} @calciteCheckboxChange=${e=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.checked})} .required=${this.attribute.isRequired??!1} .status=${this.validationMsg?"invalid":"valid"}></calcite-checkbox>${this.attribute.label}</calcite-label>`:null}renderDateInput(){return s(this.attribute,"date")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-input-date-picker id=${this.attributeKey??a} .name=${this.attribute.label} @calciteInputDatePickerChange=${e=>this.isConnected&&this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.value})} overlay-positioning=fixed .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}></calcite-input-date-picker></calcite-label>`:null}renderTextInput(){if(!s(this.attribute,"text"))return null;let e=this.attribute.label,t=this.attribute.description;return i`<calcite-label .for=${this.attributeKey}><div class="portal-classification-form-element-tooltip">${e}${this.attribute.labelTooltip&&i`<div><calcite-icon scale=s icon=information .id=${`tooltip-button-${this.attribute.bannerLabel}`} text-label=${this.messages.information??"Information"??a}></calcite-icon><calcite-tooltip .referenceElement=${`tooltip-button-${this.attribute.bannerLabel}`} placement=right>${this.attribute.labelTooltip}</calcite-tooltip></div>`||""}</div><calcite-input-text id=${this.attributeKey??a} .label=${e} .name=${this.attributeKey} @calciteInputTextChange=${r=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:r.target.value})} .placeholder=${t} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}></calcite-input-text></calcite-label>`}renderSingleSelect(){return s(this.attribute,"single-select")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox selection-mode=single id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.value})} .placeholder=${this.attribute.description??this.messages.selectanoption} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} overlay-positioning=fixed validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value} data-testid=${`single-select-${this.attributeKey}`}>${this._renderSingleSelectComboboxOptions()}</calcite-combobox></calcite-label>`:null}_renderSingleSelectComboboxOptions(){if(!Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return m(this.renderingInfo?.valueExpressionResult,t=>t.label,t=>i`<calcite-combobox-item .selected=${e===t.value} .heading=${t.label} .value=${t.value} data-testid=${`single-combobox-item-${t.value}`}></calcite-combobox-item>`)}_renderComboboxOptions(){if(!Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return this.renderingInfo?.valueExpressionResult.map(t=>i`<calcite-combobox-item .selected=${e?.includes(t.value)} .heading=${t.label} .value=${t.value} data-testid=${`combobox-item-${t.value}`}></calcite-combobox-item>`)}renderMultiSelect(){return s(this.attribute,"multi-select")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>{let t=e.target.value;this.arcgisAttributeValueChange.emit({[this.attributeKey]:t?Array.isArray(t)?t:[t]:void 0})}} .placeholder=${this.attribute.description??this.messages.selectoptions} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}>${this._renderComboboxOptions()}</calcite-combobox></calcite-label>`:null}_renderGroupedComboboxOptions(){if(!this.renderingInfo?.valueExpressionResult||Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return Object.entries(this.renderingInfo?.valueExpressionResult).map(([t,r])=>i`<calcite-combobox-item .selected=${e?.includes(t)} .heading=${t} .value=${t}>${r.map(l=>i`<calcite-combobox-item .selected=${e?.includes(l.value)} .heading=${l.label} .value=${l.value} data-testid=${`grouped-combobox-item-${l.value}`}></calcite-combobox-item>`)}</calcite-combobox-item>`)}renderMultiGroupedSelectNested(){return s(this.attribute,"multi-grouped-select-nested")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>{let t=e.target.value;this.arcgisAttributeValueChange.emit({[this.attributeKey]:t?Array.isArray(t)?t:[t]:void 0})}} .placeholder=${this.attribute.description??this.messages.selectoptions} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}>${this._renderGroupedComboboxOptions()}</calcite-combobox></calcite-label>`:null}render(){switch(this.attribute.uiElement){case"checkbox":return this.renderCheckbox();case"date":return this.renderDateInput();case"multi-select":return this.renderMultiSelect();case"multi-grouped-select-nested":return this.renderMultiGroupedSelectNested();case"single-select":return this.renderSingleSelect();case"text":return this.renderTextInput();default:return i`<div>Not Implemented Yet.</div>`}}};d("arcgis-portal-classification-form-element",n);export{n as ArcgisPortalClassificationFormElement};
|
|
@@ -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 V,B as m,C as h,D as A,E as D,F as y,k as P,y as k,z as w}from"./
|
|
3
|
+
v5.0.0-next.138 */
|
|
4
|
+
import{A as V,B as m,C as h,D as A,E as D,F as y,k as P,y as k,z as w}from"./DNYIE6VB.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
|
-
import a from"./OLL7YXB7.js";import{b as q}from"./P6R5NA3A.js";import{a as G}from"./3QGXNHUJ.js";import"./LXQRUFRM.js";import{G as C,H as P,I as B,M as A,O as W,h as j,j as g,n as N,p as S,q as J,u as E}from"./HTG4KVD4.js";export default $arcgis.t(([le,Ie,ve,Fe,x,I,ce,pe,L,ee,$,{a:T,b:z,c:V,d:U,e:_,f:H,g:K,h:Q,i:X,j:Y,k:Z}])=>{var k=(i=>(i.expression="expression/",i.raster="Raster.",i.relationship="relationships/",i))(k||{}),fe=["feature"];function O(i){return"fieldConfigurations"in i&&fe.includes(i.type)}function F(i){return i!=null}function te(i,e,t){let s=e.fieldName;if(s.includes(k.expression)){let a=t.get(s);return a?.title?a.title:s}else return O(i)&&i.getFieldConfiguration(s)?i.getFieldAlias(s)||s:e.label||s}function se(i,e,t){let s="";if(/^raster.(?:item|service)pixelvalue/iu.test(i))s="number";else if(e.has(i)){let a=e.get(i);s=a.type?a.type.toLowerCase():""}else if(t.has(i)){let a=t.get(i);s=a.returnType?a.returnType.toLowerCase():""}else s="number";return s}async function ie(i){return new Map((await me(i)).filter(e=>e.visible).map(e=>[e.name,e]))}function ae(i){let e=new Map;return i?.expressionInfos&&i.expressionInfos.forEach(t=>{let s=`${k.expression}${t.name}`;e.set(s,t)}),e}async function me(i){return await new Promise((e,t)=>{switch(i.type){case"feature":case"ogc-feature":case"stream":e(i.fields);break;case"sublayer":{let s=i,a=s?.layer;a?.portalItem&&a.url.includes("https://demographics")&&a.url.includes(".arcgis.com")?a.portalItem?.fetchData().then(r=>{if(r?.thematicGroup){let o=new Map(s.fields.map(n=>[n.name,n])),c=r.thematicGroup.fieldNames,p=[];c.forEach(n=>{o.has(n)&&p.push(o.get(n))}),e(p)}else e(s.fields)}).catch(r=>{t(new Error(r))}):e(s.fields);break}case"imagery":case"imagery-tile":case"wcs":e(i.rasterFields);break;default:e("fields"in i?i.fields??[]:[])}})}function d(i,e){return!i||!e?!1:i.toLocaleLowerCase()===e.toLocaleLowerCase()}async function re(i,e,t,s){if(!t)return!1;let a=["feature","oriented-imagery"].includes(e.type),r=s?.item??e.portalItem,o=e.sourceJSON;if(!a||!r||!r.portal.user||!_(r)||U(r)||H(r)||K(o)||r.portal.isPortal&&V(r)||["oid","global-id","geometry"].includes(t.type)||await ue(e,t.name,s))return!1;let c=e.sourceJSON.geometryProperties,p=c?.shapeLengthFieldName,n=c?.shapeAreaFieldName;if(d(p,t.name)||d(n,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(!s?.ignoreLayerRenderer&&e.featureReduction){let m=new Set;if(await I.collectFeatureReductionFields(m,e,e.featureReduction),Array.from(m).some(w=>d(w,t.name)))return!1}if(!s?.ignoreLayerRenderer&&(await I.getRendererFields(e.renderer,e.fieldsIndex)).some(m=>d(m,t.name)))return!1;if(!s?.ignoreLayerLabelingInfo){let m=e.labelingInfo?.map(w=>w.labelExpressionInfo?.expression);if(m&&((await I.getExpressionFields(e,m)).some(w=>d(w,t.name))||await oe(e,t,"layer")))return!1}if(!s?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await $.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(m=>d(m,t.name))||await ge(e,t,s)||await ye(e,t))return!1;if(await be(e,t))return await Promise.resolve(!1);if(await we(e,t))return await Promise.resolve(!1);if(he(i,e,t)||e.relationships?.map(m=>m.keyField)?.some(m=>d(m,t.name)))return!1;let f=z(r,r.portal.user),v=s?.userItemInfo?.userGroups??await Q(e)??[],h=s?.userItemInfo?.itemGroups??await X(e)??[],b=Z(v,h);if(!f&&!b)return!1;let y=s?.userItemInfo?.relatedItems??await Y(r.id,r.portal,{relationshipType:"Service2Service"});return!(y?.data?.relatedItems&&y.data.relatedItems.some(m=>["WMTS","Map Service","Vector Tile Service"].includes(m.type)))}async function ue(i,e,t){let s=`${i.url}/${i.layerId}/fieldGroups`,a=t?.userItemInfo&&"fieldGroups"in t.userItemInfo?t.userItemInfo.fieldGroups:(await ee(s,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return a?a.some(r=>r.fields.some(o=>d(o,e))):!1}function he(i,e,t){if(!i)return!1;let s=i.map?.applicationProperties?.viewing?.search;if(s){let a=s.layers?.find(r=>r.id===e.id);if(a){let r=a?.field?.name;if(r)return d(r,t.name)}}return!1}async function oe(i,e,t){let s=t==="layer"?i.labelingInfo?.filter(o=>F(o.where)):i.sourceJSON?.drawingInfo?.labelingInfo?.filter(o=>F(o.where));if(!s?.length)return!1;let a=[...await Promise.all(s.map(async o=>await $.parseWhereClause(o.where,i.fieldsIndex)))],r=!1;for(let o=0;o<a.length;o++){let c=a[o].fieldNames?.some(p=>d(p,e.name));if(!r&&c){r=!0;break}}return await Promise.resolve(r)}async function ge(i,e,t){let s=i.portalItem;if(!s)return!1;let a=`${T(s.portal)}content/items/${s.id}/data`,r=(t?.userItemInfo?.itemData??await ee(a,{query:{f:"json"},responseType:"json"}))?.data;if(!r)return!1;if(r?.layers){let o=r.layers.find(l=>l.id===i.layerId),c=o?.layerDefinition?.drawingInfo?.renderer,p=o?.layerDefinition?.featureReduction,n=o?.layerDefinition?.definitionExpression;if(!c&&!p&&!n)return!1;if(!t?.ignoreItemRenderer&&c){let l=L.fromJSON(c);if((await I.getRendererFields(l,i.fieldsIndex)).some(f=>d(f,e.name)))return!0}if(!t?.ignoreItemFeatureReduction&&p&&await ne(i,e,p)||n&&(await $.parseWhereClause(n,i.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function ye(i,e){let t=i.sourceJSON,s=t?.drawingInfo?.renderer,a=t?.featureReduction;if(!s&&!a)return!1;if(s){let r=L.fromJSON(s);if((await I.getRendererFields(r,i.fieldsIndex)).some(o=>d(o,e.name)))return!0}return!!(a&&await ne(i,e,a))}async function be(i,e){let t=i.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let s=t?.map(a=>a.labelExpressionInfo?.expression);if(s){if((await I.getExpressionFields(i,s)).some(a=>d(a,e.name)))return await Promise.resolve(!0);if(await oe(i,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function we(i,e){let t=i.sourceJSON?.definitionQuery;return t?(await $.parseWhereClause(t,i.fieldsIndex)).fieldNames.some(s=>d(s,e.name))?await Promise.resolve(!0):await Promise.resolve(!1):await Promise.resolve(!1)}async function ne(i,e,t){let s=t.type==="binning"?ce.fromJSON(t):pe.fromJSON(t),a=new Set;return await I.collectFeatureReductionFields(a,i,s),!!Array.from(a).some(r=>d(r,e.name))}var u=new Map;u.set("oid","key");u.set("guid","key");u.set("global-id","key");u.set("blob","binary");u.set("integer","integer");u.set("small-integer","integer");u.set("big-integer","integer");u.set("single","number");u.set("double","number");u.set("long","number");u.set("number","number");u.set("date","date-time");u.set("date-only","calendar");u.set("time-only","clock");u.set("timestamp-offset","time-zone");u.set("string","string");var Ne=({fieldType:i})=>g`<calcite-icon scale=s .icon=${u.get(i)}></calcite-icon>`,Ee=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}`,M=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 q(this,{task:async([e,t])=>{let s=F(e)&&F(t);if(F(e)||N("error",this,S("layer")),F(t)||N("error",this,S("fieldNames")),!s)throw new Error("Required properties are missing");this._propWatcherTask.autoRun=!1,await this.processProps()},args:()=>[this.layer,this.fieldNames]}),this.arcgisBeforeModalClose=E(),this.arcgisClose=E(),this.arcgisBeforeDelete=E(),this.arcgisFieldsDeleted=E()}static{this.properties={config:0,fieldNames:0,layer:0,mapView:0,options:0}}static{this.styles=Ee}async processProps(){let{layer:e,mapView:t,fieldNames:s}=this;if(!e||!s){this.fieldsAreDeletable=!1;return}e.loaded||await e.load(),this.layerFields=e.fields.filter(r=>s.includes(r.name));let a=s.some(r=>!e.fields.find(o=>o.name===r));if(!this.layerFields?.length||a)this.fieldsAreDeletable=!1;else{let r=await Promise.all(this.layerFields.map(async o=>await re(t,e,o,this.options)));if(this.fieldsAreDeletable=r.every(o=>o),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await ie(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=ae(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:s}=this;if(this.options?.ignorePopupTemplate)return this.getFieldDisplayNameFromLayerFields(e);{let a=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(r=>r.fieldName===e);return a?te(t,a,s):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let{layer:t}=this,s=this.layerFieldsMap.get(e);return O(t)?t.getFieldAlias(e):s.alias??s.name}async deleteFields(){let{layer:e,fieldNames:t}=this,s=`${e.url.replace("/rest/services","/rest/admin/services")}/${e.layerId}/deleteFromDefinition`,a={fields:t.map(o=>({name:o}))},r={deleteFromDefinition:JSON.stringify(a)};await x(s,{query:{...r,f:"json",async:!1},method:"post",responseType:"json"}).then(async o=>{if(o.data?.success){let c=`${e.url}/${e.layerId}`;t.forEach(n=>{e.type==="feature"&&e.floorInfo?.floorField===n&&(e.floorInfo=null)});let p=await x(c,{query:{f:"json"},responseType:"json"});if(p){let n=p.data;this.currentLayerInfo=p.data,n&&(this.updateTypesAndTemplatesOnLayer(),t.forEach(l=>{n.templates?.length?n.templates.forEach(f=>delete f.prototype.attributes[l]):n.types?.forEach(f=>{f.templates.forEach(v=>delete v.prototype.attributes[l])})}),this.updateFeatureService(n))}else this.handleError()}},()=>this.handleError())}updateTypesAndTemplatesOnLayer(){let{currentLayerInfo:e}=this,t=e;if(t.templates?.length){let s=this.updateTemplatesList(t.templates);t.templates=s}else if(t.types){let s=t.types;t.types=[],s.forEach(a=>{a.templates=this.updateTemplatesList(a.templates),this.addType(t,a)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:s}=this,a=[];return(e??[]).forEach(r=>{let o=new Ie;o.description=r.description??"",o.name=r.name||s.newFeature,o.drawingTool=r.drawingTool||"point";let c={};t.fields.forEach(n=>{let l=!1;for(let f=0;f<r.prototype.attributes.length;f++)if(r.prototype.attributes[f]===n.name){l=!0,c[n.name]=r.prototype.attributes[n.name];break}!l&&n.editable&&(c[n.name]=n.defaultValue||null)});let p=new ve({attributes:c});o.prototype=p,a.push(o)}),a}addType(e,t){e.types?e.types.some(s=>s.id===t.id)||e.types.push(t):e.types=[t]}async updateFeatureService(e){let{layer:t,fieldNames:s}=this,a={templates:e.templates,types:e.types},r=`${t.url.replace("/rest/services","/rest/admin/services")}/${t.layerId}/updateDefinition`,o={f:"json",updateDefinition:JSON.stringify(a)};await x(r,{query:{...o,f:"json"},method:"post",responseType:"json"}).then(async c=>{if(c.data?.success){let p=`${T(this.portal)}content/items/${this.item.id}/data`;if(this.options?.ignorePopupTemplate||s.forEach(n=>{t.popupTemplate?.fieldInfos&&(t.popupTemplate.fieldInfos=t.popupTemplate.fieldInfos.filter(l=>l.fieldName!==n)),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!==n))})}),t.attributeTableTemplate){let n=t.attributeTableTemplate.clone();n.elements=n.elements.filter(l=>!(l.type==="field"&&s.includes(l.fieldName))),n.orderByFields=n.orderByFields.filter(l=>!s.includes(l.field)),t.attributeTableTemplate=n}if(t.fieldConfigurations?.length){let n=le.clone(t.fieldConfigurations).filter(l=>!s.includes(l.name));t.fieldConfigurations=n}await x(p,{query:{f:"json"},responseType:"json"}).then(async n=>{let l=n.data;if(l?.layers||l?.tables){let f=t.isTable,v=f?l.tables:l.layers,h=v?.find(b=>b.id===t.layerId);if(s.forEach(b=>{h?.attributeTableInfo?.attributeTableElements&&(h.attributeTableInfo.attributeTableElements=h.attributeTableInfo.attributeTableElements.filter(y=>!(y.type==="field"&&y.fieldName===b)),h.attributeTableInfo.orderByFields=h.attributeTableInfo.orderByFields.filter(y=>y.field!==b))}),h?.layerDefinition?.fieldConfigurations&&(h.layerDefinition.fieldConfigurations=h.layerDefinition.fieldConfigurations.filter(b=>!s.includes(b.name))),h?.popupInfo){s.forEach(w=>{h.popupInfo.fieldInfos=h.popupInfo.fieldInfos.filter(D=>D.fieldName!==w),h.popupInfo.popupElements?.forEach((D,R)=>{D.type==="fields"&&D.fieldInfos&&(h.popupInfo.popupElements[R].fieldInfos=h.popupInfo.popupElements[R].fieldInfos.filter(de=>de.fieldName!==w))})});let b=`${T(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,y={};f?(y.tables=v,l.layers&&(y.layers=l.layers)):(y.layers=v,l.tables&&(y.tables=l.tables));let m={f:"json",text:JSON.stringify(y)};await x(b,{query:{...m},method:"post",responseType:"json"}).then(w=>{w.data?.success?this.handleSuccess():this.handleError()},()=>this.handleError())}else this.handleSuccess()}else n.httpStatus===200&&(!n.data||JSON.stringify(n.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=A(g`<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=A(g`<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=A(g`<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&&g`<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:s,deleteInProgress:a}=this;return this._propWatcherTask.render({complete:()=>(t||(s?.length?s?.length===1?N("error",this,"Field cannot be deleted"):N("error",this,"One or more fields cannot be deleted"):N("error",this,J("fieldNames"))),g`<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} ${P(this.dialogNode)}>${t?g`<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>`)})}renderError(){let{messages:e}=this;return g`<div class="loader-container active"><div class="loader-text">${e.errorOccurred}</div></div>`}renderDeleteLoader(){let{messages:e,fieldNames:t,deleteInProgress:s}=this;return g`<div class=${`loader-container ${s?"active":""}`}><calcite-loader class="loader" .label=${t.length===1?e.deletingField:e.deletingFields} .hidden=${!s}></calcite-loader><div class="loader-text">${t.length===1?e.deletingField:e.deletingFields}</div></div>`}renderFieldsPreview(){let{fieldNames:e,layerFields:t,layerFieldsMap:s,arcadeExpMap:a,messages:r}=this;return g`<calcite-list .label=${r.fields}>${e.map(o=>{let c=t.find(p=>p.name===o);return g`<calcite-list-item .label=${this.getFieldLabel(o)} .description=${`{${o}}`} .value=${o} .disabled=${!c.editable}><div slot=actions-end class="field-icons">${Ne({fieldType:se(o,s,a)})}</div></calcite-list-item>`})}</calcite-list>`}renderCancelButton(){let{messages:e}=this;return g`<calcite-button @click=${()=>this.dialogNode.value.open=!1} slot=footer-end appearance=outline ${P(this.cancelNode)}>${e.cancel}</calcite-button>`}renderDeleteButton(){let{messages:e,fieldNames:t}=this;return g`<calcite-button kind=danger slot=footer-end @click=${async s=>{let{portal:a}=this;s.currentTarget.disabled=!0,this.cancelNode.value.disabled=!0,this.dialogNode.value.closeDisabled=!0,a.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>`}};W("arcgis-portal-field-delete",M);return M},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql",a)
|
|
3
|
+
v5.0.0-next.138 */
|
|
4
|
+
import a from"./TM7MOVDU.js";import{b as q}from"./BMVMPK5L.js";import{a as G}from"./M3FLI3RE.js";import"./EG7OXB7L.js";import{G as C,H as P,I as B,M as A,O as W,h as j,j as g,n as N,p as S,q as J,u as E}from"./DNYIE6VB.js";export default $arcgis.t(([le,Ie,ve,Fe,x,I,ce,pe,L,ee,$,{a:T,b:z,c:V,d:U,e:_,f:H,g:K,h:Q,i:X,j:Y,k:Z}])=>{var k=(i=>(i.expression="expression/",i.raster="Raster.",i.relationship="relationships/",i))(k||{}),fe=["feature"];function O(i){return"fieldConfigurations"in i&&fe.includes(i.type)}function F(i){return i!=null}function te(i,e,t){let s=e.fieldName;if(s.includes(k.expression)){let a=t.get(s);return a?.title?a.title:s}else return O(i)&&i.getFieldConfiguration(s)?i.getFieldAlias(s)||s:e.label||s}function se(i,e,t){let s="";if(/^raster.(?:item|service)pixelvalue/iu.test(i))s="number";else if(e.has(i)){let a=e.get(i);s=a.type?a.type.toLowerCase():""}else if(t.has(i)){let a=t.get(i);s=a.returnType?a.returnType.toLowerCase():""}else s="number";return s}async function ie(i){return new Map((await me(i)).filter(e=>e.visible).map(e=>[e.name,e]))}function ae(i){let e=new Map;return i?.expressionInfos&&i.expressionInfos.forEach(t=>{let s=`${k.expression}${t.name}`;e.set(s,t)}),e}async function me(i){return await new Promise((e,t)=>{switch(i.type){case"feature":case"ogc-feature":case"stream":e(i.fields);break;case"sublayer":{let s=i,a=s?.layer;a?.portalItem&&a.url.includes("https://demographics")&&a.url.includes(".arcgis.com")?a.portalItem?.fetchData().then(r=>{if(r?.thematicGroup){let o=new Map(s.fields.map(n=>[n.name,n])),c=r.thematicGroup.fieldNames,p=[];c.forEach(n=>{o.has(n)&&p.push(o.get(n))}),e(p)}else e(s.fields)}).catch(r=>{t(new Error(r))}):e(s.fields);break}case"imagery":case"imagery-tile":case"wcs":e(i.rasterFields);break;default:e("fields"in i?i.fields??[]:[])}})}function d(i,e){return!i||!e?!1:i.toLocaleLowerCase()===e.toLocaleLowerCase()}async function re(i,e,t,s){if(!t)return!1;let a=["feature","oriented-imagery"].includes(e.type),r=s?.item??e.portalItem,o=e.sourceJSON;if(!a||!r||!r.portal.user||!_(r)||U(r)||H(r)||K(o)||r.portal.isPortal&&V(r)||["oid","global-id","geometry"].includes(t.type)||await ue(e,t.name,s))return!1;let c=e.sourceJSON.geometryProperties,p=c?.shapeLengthFieldName,n=c?.shapeAreaFieldName;if(d(p,t.name)||d(n,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(!s?.ignoreLayerRenderer&&e.featureReduction){let m=new Set;if(await I.collectFeatureReductionFields(m,e,e.featureReduction),Array.from(m).some(w=>d(w,t.name)))return!1}if(!s?.ignoreLayerRenderer&&(await I.getRendererFields(e.renderer,e.fieldsIndex)).some(m=>d(m,t.name)))return!1;if(!s?.ignoreLayerLabelingInfo){let m=e.labelingInfo?.map(w=>w.labelExpressionInfo?.expression);if(m&&((await I.getExpressionFields(e,m)).some(w=>d(w,t.name))||await oe(e,t,"layer")))return!1}if(!s?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await $.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(m=>d(m,t.name))||await ge(e,t,s)||await ye(e,t))return!1;if(await be(e,t))return await Promise.resolve(!1);if(await we(e,t))return await Promise.resolve(!1);if(he(i,e,t)||e.relationships?.map(m=>m.keyField)?.some(m=>d(m,t.name)))return!1;let f=z(r,r.portal.user),v=s?.userItemInfo?.userGroups??await Q(e)??[],h=s?.userItemInfo?.itemGroups??await X(e)??[],b=Z(v,h);if(!f&&!b)return!1;let y=s?.userItemInfo?.relatedItems??await Y(r.id,r.portal,{relationshipType:"Service2Service"});return!(y?.data?.relatedItems&&y.data.relatedItems.some(m=>["WMTS","Map Service","Vector Tile Service"].includes(m.type)))}async function ue(i,e,t){let s=`${i.url}/${i.layerId}/fieldGroups`,a=t?.userItemInfo&&"fieldGroups"in t.userItemInfo?t.userItemInfo.fieldGroups:(await ee(s,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return a?a.some(r=>r.fields.some(o=>d(o,e))):!1}function he(i,e,t){if(!i)return!1;let s=i.map?.applicationProperties?.viewing?.search;if(s){let a=s.layers?.find(r=>r.id===e.id);if(a){let r=a?.field?.name;if(r)return d(r,t.name)}}return!1}async function oe(i,e,t){let s=t==="layer"?i.labelingInfo?.filter(o=>F(o.where)):i.sourceJSON?.drawingInfo?.labelingInfo?.filter(o=>F(o.where));if(!s?.length)return!1;let a=[...await Promise.all(s.map(async o=>await $.parseWhereClause(o.where,i.fieldsIndex)))],r=!1;for(let o=0;o<a.length;o++){let c=a[o].fieldNames?.some(p=>d(p,e.name));if(!r&&c){r=!0;break}}return await Promise.resolve(r)}async function ge(i,e,t){let s=i.portalItem;if(!s)return!1;let a=`${T(s.portal)}content/items/${s.id}/data`,r=(t?.userItemInfo?.itemData??await ee(a,{query:{f:"json"},responseType:"json"}))?.data;if(!r)return!1;if(r?.layers){let o=r.layers.find(l=>l.id===i.layerId),c=o?.layerDefinition?.drawingInfo?.renderer,p=o?.layerDefinition?.featureReduction,n=o?.layerDefinition?.definitionExpression;if(!c&&!p&&!n)return!1;if(!t?.ignoreItemRenderer&&c){let l=L.fromJSON(c);if((await I.getRendererFields(l,i.fieldsIndex)).some(f=>d(f,e.name)))return!0}if(!t?.ignoreItemFeatureReduction&&p&&await ne(i,e,p)||n&&(await $.parseWhereClause(n,i.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function ye(i,e){let t=i.sourceJSON,s=t?.drawingInfo?.renderer,a=t?.featureReduction;if(!s&&!a)return!1;if(s){let r=L.fromJSON(s);if((await I.getRendererFields(r,i.fieldsIndex)).some(o=>d(o,e.name)))return!0}return!!(a&&await ne(i,e,a))}async function be(i,e){let t=i.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let s=t?.map(a=>a.labelExpressionInfo?.expression);if(s){if((await I.getExpressionFields(i,s)).some(a=>d(a,e.name)))return await Promise.resolve(!0);if(await oe(i,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function we(i,e){let t=i.sourceJSON?.definitionQuery;return t?(await $.parseWhereClause(t,i.fieldsIndex)).fieldNames.some(s=>d(s,e.name))?await Promise.resolve(!0):await Promise.resolve(!1):await Promise.resolve(!1)}async function ne(i,e,t){let s=t.type==="binning"?ce.fromJSON(t):pe.fromJSON(t),a=new Set;return await I.collectFeatureReductionFields(a,i,s),!!Array.from(a).some(r=>d(r,e.name))}var u=new Map;u.set("oid","key");u.set("guid","key");u.set("global-id","key");u.set("blob","binary");u.set("integer","integer");u.set("small-integer","integer");u.set("big-integer","integer");u.set("single","number");u.set("double","number");u.set("long","number");u.set("number","number");u.set("date","date-time");u.set("date-only","calendar");u.set("time-only","clock");u.set("timestamp-offset","time-zone");u.set("string","string");var Ne=({fieldType:i})=>g`<calcite-icon scale=s .icon=${u.get(i)}></calcite-icon>`,Ee=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}`,M=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 q(this,{task:async([e,t])=>{let s=F(e)&&F(t);if(F(e)||N("error",this,S("layer")),F(t)||N("error",this,S("fieldNames")),!s)throw new Error("Required properties are missing");this._propWatcherTask.autoRun=!1,await this.processProps()},args:()=>[this.layer,this.fieldNames]}),this.arcgisBeforeModalClose=E(),this.arcgisClose=E(),this.arcgisBeforeDelete=E(),this.arcgisFieldsDeleted=E()}static{this.properties={config:0,fieldNames:0,layer:0,mapView:0,options:0}}static{this.styles=Ee}async processProps(){let{layer:e,mapView:t,fieldNames:s}=this;if(!e||!s){this.fieldsAreDeletable=!1;return}e.loaded||await e.load(),this.layerFields=e.fields.filter(r=>s.includes(r.name));let a=s.some(r=>!e.fields.find(o=>o.name===r));if(!this.layerFields?.length||a)this.fieldsAreDeletable=!1;else{let r=await Promise.all(this.layerFields.map(async o=>await re(t,e,o,this.options)));if(this.fieldsAreDeletable=r.every(o=>o),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await ie(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=ae(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:s}=this;if(this.options?.ignorePopupTemplate)return this.getFieldDisplayNameFromLayerFields(e);{let a=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(r=>r.fieldName===e);return a?te(t,a,s):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let{layer:t}=this,s=this.layerFieldsMap.get(e);return O(t)?t.getFieldAlias(e):s.alias??s.name}async deleteFields(){let{layer:e,fieldNames:t}=this,s=`${e.url.replace("/rest/services","/rest/admin/services")}/${e.layerId}/deleteFromDefinition`,a={fields:t.map(o=>({name:o}))},r={deleteFromDefinition:JSON.stringify(a)};await x(s,{query:{...r,f:"json",async:!1},method:"post",responseType:"json"}).then(async o=>{if(o.data?.success){let c=`${e.url}/${e.layerId}`;t.forEach(n=>{e.type==="feature"&&e.floorInfo?.floorField===n&&(e.floorInfo=null)});let p=await x(c,{query:{f:"json"},responseType:"json"});if(p){let n=p.data;this.currentLayerInfo=p.data,n&&(this.updateTypesAndTemplatesOnLayer(),t.forEach(l=>{n.templates?.length?n.templates.forEach(f=>delete f.prototype.attributes[l]):n.types?.forEach(f=>{f.templates.forEach(v=>delete v.prototype.attributes[l])})}),this.updateFeatureService(n))}else this.handleError()}},()=>this.handleError())}updateTypesAndTemplatesOnLayer(){let{currentLayerInfo:e}=this,t=e;if(t.templates?.length){let s=this.updateTemplatesList(t.templates);t.templates=s}else if(t.types){let s=t.types;t.types=[],s.forEach(a=>{a.templates=this.updateTemplatesList(a.templates),this.addType(t,a)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:s}=this,a=[];return(e??[]).forEach(r=>{let o=new Ie;o.description=r.description??"",o.name=r.name||s.newFeature,o.drawingTool=r.drawingTool||"point";let c={};t.fields.forEach(n=>{let l=!1;for(let f=0;f<r.prototype.attributes.length;f++)if(r.prototype.attributes[f]===n.name){l=!0,c[n.name]=r.prototype.attributes[n.name];break}!l&&n.editable&&(c[n.name]=n.defaultValue||null)});let p=new ve({attributes:c});o.prototype=p,a.push(o)}),a}addType(e,t){e.types?e.types.some(s=>s.id===t.id)||e.types.push(t):e.types=[t]}async updateFeatureService(e){let{layer:t,fieldNames:s}=this,a={templates:e.templates,types:e.types},r=`${t.url.replace("/rest/services","/rest/admin/services")}/${t.layerId}/updateDefinition`,o={f:"json",updateDefinition:JSON.stringify(a)};await x(r,{query:{...o,f:"json"},method:"post",responseType:"json"}).then(async c=>{if(c.data?.success){let p=`${T(this.portal)}content/items/${this.item.id}/data`;if(this.options?.ignorePopupTemplate||s.forEach(n=>{t.popupTemplate?.fieldInfos&&(t.popupTemplate.fieldInfos=t.popupTemplate.fieldInfos.filter(l=>l.fieldName!==n)),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!==n))})}),t.attributeTableTemplate){let n=t.attributeTableTemplate.clone();n.elements=n.elements.filter(l=>!(l.type==="field"&&s.includes(l.fieldName))),n.orderByFields=n.orderByFields.filter(l=>!s.includes(l.field)),t.attributeTableTemplate=n}if(t.fieldConfigurations?.length){let n=le.clone(t.fieldConfigurations).filter(l=>!s.includes(l.name));t.fieldConfigurations=n}await x(p,{query:{f:"json"},responseType:"json"}).then(async n=>{let l=n.data;if(l?.layers||l?.tables){let f=t.isTable,v=f?l.tables:l.layers,h=v?.find(b=>b.id===t.layerId);if(s.forEach(b=>{h?.attributeTableInfo?.attributeTableElements&&(h.attributeTableInfo.attributeTableElements=h.attributeTableInfo.attributeTableElements.filter(y=>!(y.type==="field"&&y.fieldName===b)),h.attributeTableInfo.orderByFields=h.attributeTableInfo.orderByFields.filter(y=>y.field!==b))}),h?.layerDefinition?.fieldConfigurations&&(h.layerDefinition.fieldConfigurations=h.layerDefinition.fieldConfigurations.filter(b=>!s.includes(b.name))),h?.popupInfo){s.forEach(w=>{h.popupInfo.fieldInfos=h.popupInfo.fieldInfos.filter(D=>D.fieldName!==w),h.popupInfo.popupElements?.forEach((D,R)=>{D.type==="fields"&&D.fieldInfos&&(h.popupInfo.popupElements[R].fieldInfos=h.popupInfo.popupElements[R].fieldInfos.filter(de=>de.fieldName!==w))})});let b=`${T(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,y={};f?(y.tables=v,l.layers&&(y.layers=l.layers)):(y.layers=v,l.tables&&(y.tables=l.tables));let m={f:"json",text:JSON.stringify(y)};await x(b,{query:{...m},method:"post",responseType:"json"}).then(w=>{w.data?.success?this.handleSuccess():this.handleError()},()=>this.handleError())}else this.handleSuccess()}else n.httpStatus===200&&(!n.data||JSON.stringify(n.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=A(g`<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=A(g`<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=A(g`<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&&g`<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:s,deleteInProgress:a}=this;return this._propWatcherTask.render({complete:()=>(t||(s?.length?s?.length===1?N("error",this,"Field cannot be deleted"):N("error",this,"One or more fields cannot be deleted"):N("error",this,J("fieldNames"))),g`<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} ${P(this.dialogNode)}>${t?g`<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>`)})}renderError(){let{messages:e}=this;return g`<div class="loader-container active"><div class="loader-text">${e.errorOccurred}</div></div>`}renderDeleteLoader(){let{messages:e,fieldNames:t,deleteInProgress:s}=this;return g`<div class=${`loader-container ${s?"active":""}`}><calcite-loader class="loader" .label=${t.length===1?e.deletingField:e.deletingFields} .hidden=${!s}></calcite-loader><div class="loader-text">${t.length===1?e.deletingField:e.deletingFields}</div></div>`}renderFieldsPreview(){let{fieldNames:e,layerFields:t,layerFieldsMap:s,arcadeExpMap:a,messages:r}=this;return g`<calcite-list .label=${r.fields}>${e.map(o=>{let c=t.find(p=>p.name===o);return g`<calcite-list-item .label=${this.getFieldLabel(o)} .description=${`{${o}}`} .value=${o} .disabled=${!c.editable}><div slot=actions-end class="field-icons">${Ne({fieldType:se(o,s,a)})}</div></calcite-list-item>`})}</calcite-list>`}renderCancelButton(){let{messages:e}=this;return g`<calcite-button @click=${()=>this.dialogNode.value.open=!1} slot=footer-end appearance=outline ${P(this.cancelNode)}>${e.cancel}</calcite-button>`}renderDeleteButton(){let{messages:e,fieldNames:t}=this;return g`<calcite-button kind=danger slot=footer-end @click=${async s=>{let{portal:a}=this;s.currentTarget.disabled=!0,this.cancelNode.value.disabled=!0,this.dialogNode.value.closeDisabled=!0,a.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>`}};W("arcgis-portal-field-delete",M);return M},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql",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.
|
|
3
|
+
v5.0.0-next.138 */
|
|
4
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{N as t,x as e}from"./
|
|
3
|
+
v5.0.0-next.138 */
|
|
4
|
+
import{N as t,x as e}from"./DNYIE6VB.js";var a=e(t,{"arcgis-portal-classification-banner":[()=>import("./7IUGSPNA.js"),"autoDestroyDisabled,messages:,missingExistingClassification,portalItem:,validationErrors,variant;destroy"],"arcgis-portal-classification-config":[()=>import("./DGCGGFDO.js"),"autoDestroyDisabled,messages:,portalItem:,status,valid,values;destroy,resetForm,validateForm"],"arcgis-portal-classification-favorite":[()=>import("./F3NO2DJ7.js"),"attributeExpressionResults:,classificationValue:,favoriteClassifications:,messages:,portalItem:,resetFavoriteClassification:,selectedFavoriteClassificationName,updateClassificationData:"],"arcgis-portal-classification-form-element":[()=>import("./UPVXKXHM.js"),"attribute:,attributeKey,isRequiredErrors:,messages:,renderingInfo:,value:"],"arcgis-portal-extent-picker":[()=>import("./KKDTTTRJ.js"),"active,contentOnly,extentService,extentValue:,isArea,itemId,messages:,portal:;;getExtent"],"arcgis-portal-extent-picker-coord-field":[()=>import("./CI6BKI5S.js"),"errorMessage,inputId,label,max,min,relatedErrorMessage,validateRelated:,value;;checkRelatedField,isValid,setFocus"],"arcgis-portal-field-delete":[()=>import("./WFP254HP.js"),"config:,fieldNames:,layer:,mapView:,messages:,options:"],"arcgis-portal-replacement-item-redirect":[()=>import("./7HJNBQ4Z.js"),"itemId,portal:,t9n:,user:;setFocus"]});a({resourcesUrl:import.meta.url});var i=new CSSStyleSheet;i.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,arcgis-portal-replacement-item-redirect){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,i];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.138 */
|
|
6
6
|
const U = (t, e, s) => {
|
|
7
7
|
let r = d(
|
|
8
8
|
t,
|
|
@@ -7,7 +7,7 @@ import * as L from "@arcgis/core/core/sql.js";
|
|
|
7
7
|
import { i as J, a as N, l as T, b as G, c as H, u as P, d as E, e as D, f as V, h as C, g as z } from "./item.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.138 */
|
|
11
11
|
var O = /* @__PURE__ */ ((r) => (r.expression = "expression/", r.raster = "Raster.", r.relationship = "relationships/", r))(O || {});
|
|
12
12
|
const K = ["feature"];
|
|
13
13
|
function X(r) {
|
package/dist/chunks/item.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import i from "@arcgis/core/request.js";
|
|
2
2
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
-
v5.0.0-next.
|
|
4
|
+
v5.0.0-next.138 */
|
|
5
5
|
const m = (e) => e && !e.endsWith("/") ? `${e}/` : e;
|
|
6
6
|
function a(e) {
|
|
7
7
|
return m(e.restUrl);
|
|
@@ -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.138 */
|
|
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.138 */
|
|
6
6
|
async function f(s, t) {
|
|
7
7
|
const i = `${s}/portals/self/classification/classificationSchema`, e = {};
|
|
8
8
|
try {
|
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.138 */
|
|
7
7
|
const t = e({ defaultAssetPath: "https://jsdev.arcgis.com/5.0.0-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.138 */
|
|
6
6
|
const s = o(t);
|
|
7
7
|
export {
|
|
8
8
|
s as u
|
|
@@ -1,36 +1,41 @@
|
|
|
1
|
-
/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
2
1
|
/// <reference path="../../index.d.ts" />
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { PropertyValues } from 'lit';
|
|
2
|
+
/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
3
|
+
import type { PublicLitElement as LitElement } from "@arcgis/lumina/PublicLitElement";
|
|
4
|
+
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
7
5
|
|
|
8
|
-
/** @internal
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
6
|
+
/** @internal */
|
|
7
|
+
export abstract class ArcgisPortalClassificationBanner extends LitElement {
|
|
8
|
+
/** @internal */
|
|
9
|
+
protected messages: Partial<{
|
|
10
|
+
notyetclassified: string;
|
|
11
|
+
invalidclassificationerror: string;
|
|
12
|
+
}> & T9nMeta<{
|
|
13
|
+
notyetclassified: string;
|
|
14
|
+
invalidclassificationerror: string;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* If the portal item has a classification previously
|
|
18
|
+
*
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
accessor missingExistingClassification: boolean;
|
|
22
|
+
/** The portal item to display the classification banner for. */
|
|
23
|
+
accessor portalItem: __esri.PortalItem | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* The classification validation error - validate the classification value against the classification schema.
|
|
26
|
+
*
|
|
27
|
+
* @default ""
|
|
28
|
+
*/
|
|
29
|
+
accessor validationErrors: string;
|
|
30
|
+
/**
|
|
31
|
+
* The size of the banner to display.
|
|
32
|
+
*
|
|
33
|
+
* - `"full"`: Used when the banner is displayed at the top and bottom of a page. This is the default mode cached for performance.
|
|
34
|
+
* - `"preview"`: Used when the banner is rendered inside a configuration component. This mode is not cached and is used to display a preview of the classification.
|
|
35
|
+
*
|
|
36
|
+
* @default "full"
|
|
37
|
+
*/
|
|
38
|
+
accessor variant: "full" | "preview";
|
|
39
|
+
/** Permanently destroy the component */
|
|
40
|
+
destroy(): Promise<void>;
|
|
41
|
+
}
|
|
@@ -6,7 +6,7 @@ import { css as h, html as s } from "lit";
|
|
|
6
6
|
import { rethrowError as o } from "@arcgis/toolkit/log";
|
|
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.138 */
|
|
10
10
|
const m = h`.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}`;
|
|
11
11
|
class p extends l {
|
|
12
12
|
constructor() {
|
|
@@ -1,48 +1,74 @@
|
|
|
1
|
-
/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
2
1
|
/// <reference path="../../index.d.ts" />
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { AttributeExpressionResults, FavoriteClassification } from '../../types/classification';
|
|
2
|
+
/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
3
|
+
import type { PublicLitElement as LitElement } from "@arcgis/lumina/PublicLitElement";
|
|
4
|
+
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
5
|
+
import type { Status } from "../../models/classificationModel.js";
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* The `arcgis-portal-classification-config` component enables users to edit or provide a classification schema to a portal item through a user-friendly form. The schema is saved to the associated portal item.
|
|
11
9
|
*
|
|
12
10
|
* @internal
|
|
13
11
|
*/
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
12
|
+
export abstract class ArcgisPortalClassificationConfig extends LitElement {
|
|
13
|
+
/** @internal */
|
|
14
|
+
protected messages: Partial<{
|
|
15
|
+
error: string;
|
|
16
|
+
errors: string;
|
|
17
|
+
loading: string;
|
|
18
|
+
and: string;
|
|
19
|
+
isrequired: string;
|
|
20
|
+
arerequired: string;
|
|
21
|
+
selectcategory: string;
|
|
22
|
+
documentbannerpreview: string;
|
|
23
|
+
portalitemrequired: string;
|
|
24
|
+
userconfigurepermissionrequired: string;
|
|
25
|
+
missingclassificationschema: string;
|
|
26
|
+
anerroroccurred: string;
|
|
27
|
+
bannererror: string;
|
|
28
|
+
}> & T9nMeta<{
|
|
29
|
+
error: string;
|
|
30
|
+
errors: string;
|
|
31
|
+
loading: string;
|
|
32
|
+
and: string;
|
|
33
|
+
isrequired: string;
|
|
34
|
+
arerequired: string;
|
|
35
|
+
selectcategory: string;
|
|
36
|
+
documentbannerpreview: string;
|
|
37
|
+
portalitemrequired: string;
|
|
38
|
+
userconfigurepermissionrequired: string;
|
|
39
|
+
missingclassificationschema: string;
|
|
40
|
+
anerroroccurred: string;
|
|
41
|
+
bannererror: string;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* The portal item to display the classification banner for.
|
|
45
|
+
*
|
|
46
|
+
* @required
|
|
47
|
+
*/
|
|
48
|
+
accessor portalItem: __esri.PortalItem | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* The loading status of the component, will be set to "loaded" when the classification schema is loaded.
|
|
51
|
+
*
|
|
52
|
+
* @default "idle"
|
|
53
|
+
*/
|
|
54
|
+
get status(): Status;
|
|
55
|
+
/**
|
|
56
|
+
* The validity of the form values against the Portal's classification schema.
|
|
57
|
+
*
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
accessor valid: boolean;
|
|
61
|
+
/** The edited classification values of the portal item. */
|
|
62
|
+
accessor values: __esri.PortalItem["classification"];
|
|
63
|
+
/** Permanently destroy the component. */
|
|
64
|
+
destroy(): Promise<void>;
|
|
65
|
+
/** Reset the form to the initial classification values from the portalItem */
|
|
66
|
+
resetForm(): Promise<void>;
|
|
67
|
+
/** Validates the form and sets the formValidationErrors state. */
|
|
68
|
+
validateForm(): Promise<void>;
|
|
69
|
+
/** Event emitted when component property values status, values, or valid change. */
|
|
70
|
+
readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "status" | "values" | "valid"; }>;
|
|
71
|
+
readonly "@eventTypes": {
|
|
72
|
+
arcgisPropertyChange: ArcgisPortalClassificationConfig["arcgisPropertyChange"]["detail"];
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -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.138 */
|
|
17
17
|
async function T({
|
|
18
18
|
portalClassificationSchema: a,
|
|
19
19
|
itemClassification: t
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import "@esri/calcite-components/components/calcite-list";
|
|
2
|
-
import "@esri/calcite-components/components/calcite-list-item";
|
|
3
|
-
import "@esri/calcite-components/components/calcite-icon";
|
|
4
|
-
import "@esri/calcite-components/components/calcite-notice";
|
|
5
|
-
import "../arcgis-portal-classification-favorite/index.js";
|
|
6
|
-
import "@esri/calcite-components/components/calcite-loader";
|
|
7
|
-
import "../arcgis-portal-classification-form-element/index.js";
|
|
8
|
-
import "@esri/calcite-components/components/calcite-action";
|
|
9
|
-
import "@esri/calcite-components/components/calcite-popover";
|
|
10
|
-
import "@esri/calcite-components/components/calcite-link";
|
|
11
|
-
import "../arcgis-portal-classification-banner/index.js";
|
|
12
1
|
export * from "./customElement.js";
|
|
@@ -1,18 +1,63 @@
|
|
|
1
|
-
/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
2
1
|
/// <reference path="../../index.d.ts" />
|
|
3
|
-
|
|
4
|
-
import {
|
|
2
|
+
/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
3
|
+
import type { PublicLitElement as LitElement } from "@arcgis/lumina/PublicLitElement";
|
|
4
|
+
import type { FavoriteClassification, AttributeExpressionResults } from "../../types/classification.js";
|
|
5
|
+
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
5
6
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
export abstract class ArcgisPortalClassificationFavorite extends LitElement {
|
|
8
|
+
accessor attributeExpressionResults: AttributeExpressionResults | undefined;
|
|
9
|
+
/** Current classification value */
|
|
10
|
+
accessor classificationValue: __esri.PortalItem["classification"] | undefined;
|
|
11
|
+
/** List of favorite classifications */
|
|
12
|
+
accessor favoriteClassifications: FavoriteClassification[];
|
|
13
|
+
/** @internal */
|
|
14
|
+
protected messages: Partial<{
|
|
15
|
+
classificationNotificationHandler: string;
|
|
16
|
+
applyClassificationFavoriteLabel: string;
|
|
17
|
+
manageClassificationFavoriteBtn: string;
|
|
18
|
+
manageClassificationFavoriteLabel: string;
|
|
19
|
+
updateClassificationFavoriteBtn: string;
|
|
20
|
+
saveNewClassificationBtn: string;
|
|
21
|
+
saveNewClassificationFavoriteBtn: string;
|
|
22
|
+
addClassificationFavorite: string;
|
|
23
|
+
duplicatedClassificationError: string;
|
|
24
|
+
emptyFavoriteError: string;
|
|
25
|
+
selectFavoritePlaceholder: string;
|
|
26
|
+
addFavoriteDialogHeading: string;
|
|
27
|
+
removeClassificationFavoriteSuccessMessage: string;
|
|
28
|
+
addClassificationFavoriteSuccessMessage: string;
|
|
29
|
+
updateClassificationFavoriteSuccessMessage: string;
|
|
30
|
+
favoriteClassificationBtnDone: string;
|
|
31
|
+
updateWarning: string;
|
|
32
|
+
retrieveClassificationFavoriteError: string;
|
|
33
|
+
uploadClassificationFavoriteError: string;
|
|
34
|
+
classificationFavoriteListLabel: string;
|
|
35
|
+
}> & T9nMeta<{
|
|
36
|
+
classificationNotificationHandler: string;
|
|
37
|
+
applyClassificationFavoriteLabel: string;
|
|
38
|
+
manageClassificationFavoriteBtn: string;
|
|
39
|
+
manageClassificationFavoriteLabel: string;
|
|
40
|
+
updateClassificationFavoriteBtn: string;
|
|
41
|
+
saveNewClassificationBtn: string;
|
|
42
|
+
saveNewClassificationFavoriteBtn: string;
|
|
43
|
+
addClassificationFavorite: string;
|
|
44
|
+
duplicatedClassificationError: string;
|
|
45
|
+
emptyFavoriteError: string;
|
|
46
|
+
selectFavoritePlaceholder: string;
|
|
47
|
+
addFavoriteDialogHeading: string;
|
|
48
|
+
removeClassificationFavoriteSuccessMessage: string;
|
|
49
|
+
addClassificationFavoriteSuccessMessage: string;
|
|
50
|
+
updateClassificationFavoriteSuccessMessage: string;
|
|
51
|
+
favoriteClassificationBtnDone: string;
|
|
52
|
+
updateWarning: string;
|
|
53
|
+
retrieveClassificationFavoriteError: string;
|
|
54
|
+
uploadClassificationFavoriteError: string;
|
|
55
|
+
classificationFavoriteListLabel: string;
|
|
56
|
+
}>;
|
|
57
|
+
/** The portal item to display the classification banner for. */
|
|
58
|
+
accessor portalItem: __esri.PortalItem | undefined;
|
|
59
|
+
accessor resetFavoriteClassification: (favoriteClassifications: FavoriteClassification[]) => void;
|
|
60
|
+
/** @default "" */
|
|
61
|
+
accessor selectedFavoriteClassificationName: string;
|
|
62
|
+
accessor updateClassificationData: (selectedClassification: FavoriteClassification) => void;
|
|
63
|
+
}
|
|
@@ -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.138 */
|
|
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() {
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import "@esri/calcite-components/components/calcite-alert";
|
|
2
|
-
import "@esri/calcite-components/components/calcite-label";
|
|
3
|
-
import "@esri/calcite-components/components/calcite-link";
|
|
4
|
-
import "@esri/calcite-components/components/calcite-combobox";
|
|
5
|
-
import "@esri/calcite-components/components/calcite-combobox-item";
|
|
6
|
-
import "@esri/calcite-components/components/calcite-dialog";
|
|
7
|
-
import "@esri/calcite-components/components/calcite-list";
|
|
8
|
-
import "@esri/calcite-components/components/calcite-list-item";
|
|
9
|
-
import "@esri/calcite-components/components/calcite-icon";
|
|
10
|
-
import "@esri/calcite-components/components/calcite-button";
|
|
11
|
-
import "@esri/calcite-components/components/calcite-input";
|
|
12
1
|
export * from "./customElement.js";
|