UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.5 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Error.js";import t from"../../core/JSONSupport.js";import{setDeepValue as l}from"../../core/object.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{write as s,read as c}from"../effects/jsonUtils.js";import u from"./FeatureFilter.js";var d;const f={read:{reader:c},write:{writer:s,overridePolicy(){return{allowNull:null!=this.excludedEffect,isRequired:null==this.excludedEffect}}}},n={read:{reader:c},write:{writer:s,overridePolicy(){return{allowNull:null!=this.includedEffect,isRequired:null==this.includedEffect}}}},a={name:"showExcludedLabels",default:!0};let p=d=class extends t{constructor(e){super(e),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(e,t){const l=super.write(e,t);if(t?.origin){if(l.filter){const e=Object.keys(l.filter);if(e.length>1||"where"!==e[0])return t.messages?.push(new r("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:t.layer,effect:this})),null}if("showExcludedLabels"in l)return t.messages?.push(new r("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:t.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:u,json:{write:{allowNull:!0,writer(e,r,t,i){const o=e?.write({},i);o&&0!==Object.keys(o).length?l(t,o,r):l(t,null,r)}}}})],p.prototype,"filter",void 0),e([i({json:{read:c,write:{writer:s,allowNull:!0},origins:{"web-map":f,"portal-item":f}}})],p.prototype,"includedEffect",void 0),e([i({json:{read:c,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};