UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

3 lines (2 loc) 2.27 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{setDeepValue as l}from"../../core/object.js";import{property as i,subclass as o}from"../../core/accessorSupport/decorators.js";import{write as s,read as u}from"../effects/jsonUtils.js";import c from"./FeatureFilter.js";var d;const f={read:{reader:u},write:{writer:s,overridePolicy(){return{allowNull:null!=this.excludedEffect,isRequired:null==this.excludedEffect}}}},n={read:{reader:u},write:{writer:s,overridePolicy(){return{allowNull:null!=this.includedEffect,isRequired:null==this.includedEffect}}}},a={name:"showExcludedLabels",default:!0};let p=d=class extends r{constructor(e){super(e),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(e,r){const l=super.write(e,r);if(r?.origin){if(l.filter){const e=Object.keys(l.filter);if(e.length>1||"where"!==e[0])return r.messages?.push(new t("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:r.layer,effect:this})),null}if("showExcludedLabels"in l)return r.messages?.push(new t("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:r.layer,effect:this})),null}return l}clone(){return new d({filter:null!=this.filter?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};e([i({type:c,json:{write:{allowNull:!0,writer(e,t,r,i){const o=e?.write({},i);o&&0!==Object.keys(o).length?l(r,o,t):l(r,null,t)}}}})],p.prototype,"filter",void 0),e([i({json:{read:u,write:{writer:s,allowNull:!0},origins:{"web-map":f,"portal-item":f}}})],p.prototype,"includedEffect",void 0),e([i({json:{read:u,write:{writer:s,allowNull:!0},origins:{"web-map":n,"portal-item":n}}})],p.prototype,"excludedEffect",void 0),e([i({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":a,"portal-item":a}}})],p.prototype,"excludedLabelsVisible",void 0),p=d=e([o("esri.layers.support.FeatureEffect")],p);export{p as default};