UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 4 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{isMapImageLayer as t}from"../../../layers/support/layerUtils.js";import{isGroupColumn as e}from"./columnUtils.js";import{loadCalciteComponents as n}from"../../support/componentsUtils.js";const i={action:"EsriFeatureTableActionColumn",attachments:"EsriFeatureTableAttachmentsColumn",relationship:"EsriFeatureTableRelationshipColumn"},o=()=>n({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")}),r=()=>Promise.all([n({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker")}),o()]),c=()=>Promise.all([n({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar")}),r()]);function s(t){return null!=t&&"object"==typeof t&&"createQuery"in t&&"getField"in t&&"queryFeatureCount"in t&&"queryFeatures"in t&&"queryObjectIds"in t&&"capabilities"in t&&"fields"in t&&"fieldsIndex"in t&&"id"in t&&"load"in t&&"objectIdField"in t&&"type"in t&&"when"in t}function a(t){return s(t)&&"queryAttachments"in t}function l(t){return a(t)&&"addAttachment"in t&&"deleteAttachments"in t&&"updateAttachment"in t}function p(t){return s(t)&&"editingEnabled"in t&&"applyEdits"in t}function u(t){return s(t)&&"relationships"in t&&"queryRelatedFeatures"in t&&"queryRelatedFeaturesCount"in t}function m(t,e,n){if(e?.map)return d(t,[...e.map.allLayers,...e.map.allTables],n)}function d(e,n,{relatedTableId:i}){const o="scene"===e.type&&e.associatedLayer?e.associatedLayer.url:e.url,r=t=>!(!u(t)||t===e)&&("sublayer"===t.type&&t.layer?.url===e.url?t.id===i:o===t.url&&t.layerId===i);if("sublayer"===e.type&&"layer"in e&&t(e.layer)){const t=t=>u(t)&&t!==e&&t.id===i,n=e.layer,o=n.allSublayers?.find(t)||n.subtables?.find(t);if(u(o))return o}let c=null;for(const s of n)if(t(s)){const t=s.allSublayers?.find(r)||s.subtables?.find(r);if(t){c=t;break}}else if(r(s)){c=s;break}if(u(c))return c}function f(t,e){return null!=t&&Number.isInteger(t)&&t>-1&&t<e}function y(t){return null==t||0===t.trim().length}function b(t,e){return(t.relationships??[]).filter((t=>!(t.id===e&&"one-to-one"===t.cardinality))).map((({id:t})=>({relationshipId:t})))}function h(t,e){return t.relationships?.find((({id:t})=>t===e))}function w(t,e){return null==e?null:t?.fields?.find((t=>e.toLowerCase()===t.name?.toLowerCase()))}function F(t,e){return e.some((e=>!("group"!==e.type||!F(t,e.columnTemplates))||e.fieldName===t))}function g(t,n){return n?.some((n=>!(!e(n)||!g(t,n.columns))||n.fieldName===t))??!1}function C(t,e){return`${t.id}-${e}`}export{w as findField,m as findRelatedLayer,d as findRelatedLayerInSources,h as findRelationship,b as getRelationshipIdsToShow,C as getTableHighlightKey,g as hasColumnForField,F as hasTemplateForField,y as isEmptyStringOrWhitespace,s as isIFeatureTableSupportedLayer,a as isIFeatureTableSupportedLayerWithAttachments,l as isIFeatureTableSupportedLayerWithAttachmentsEditing,p as isIFeatureTableSupportedLayerWithEditing,u as isIFeatureTableSupportedLayerWithRelationships,f as isPageIndexValid,o as loadColumnComponents,r as loadEditorColumnComponents,c as loadFieldColumnComponents,i as uniqueColumnNames};