@arcgis/core 6.0.0-next.6 → 6.0.0-next.7
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/arcade/functions/knowledgegraph.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{f09c9d9a554c33a753b4.js → 02253bdffbd580af22d8.js} +1 -1
- package/assets/esri/core/workers/chunks/{83589144eeeb08f45557.js → 2aeb5cc32284dd3e4d22.js} +1 -1
- package/assets/esri/core/workers/chunks/3ffda5bf0b91700dc308.js +1 -0
- package/assets/esri/core/workers/chunks/{1317ecdfd0cfa683a493.js → 42323093827adffe56d3.js} +1 -1
- package/assets/esri/core/workers/chunks/{f46a0d7cf588ba1b4157.js → 518e8883b6ed613bf451.js} +1 -1
- package/assets/esri/core/workers/chunks/{67ac6b326bf80fc3d33d.js → 53be85d04cd2da4f391d.js} +1 -1
- package/assets/esri/core/workers/chunks/54778dec1598818d93cb.js +1 -0
- package/assets/esri/core/workers/chunks/{3ac9dcbb0571a2580236.js → 62c8c9ad09e0166207fd.js} +1 -1
- package/assets/esri/core/workers/chunks/6588725275c75fae0d9c.js +1 -0
- package/assets/esri/core/workers/chunks/6ebe73f69ae822053b70.js +1 -0
- package/assets/esri/core/workers/chunks/7038ead1fa1674416ab3.js +1 -0
- package/assets/esri/core/workers/chunks/70cc2d79653d66e85b58.js +1 -0
- package/assets/esri/core/workers/chunks/{8ba32d3a0df4a206ef1c.js → 7165d6f6a5078768bebb.js} +1 -1
- package/assets/esri/core/workers/chunks/{cbe6c0f32608cb504695.js → 776ae25a34352d3468bc.js} +1 -1
- package/assets/esri/core/workers/chunks/801e9e66edb4961461eb.js +1 -0
- package/assets/esri/core/workers/chunks/9ce91a909eccc4dfe388.js +1 -0
- package/assets/esri/core/workers/chunks/ad76f7ab2f3e6d5a5b3c.js +1 -0
- package/assets/esri/core/workers/chunks/{250d3be6d3849d71fed8.js → c29c474c4b1049352d3e.js} +1 -1
- package/assets/esri/core/workers/chunks/ddf0671976648f621269.js +1 -0
- package/assets/esri/core/workers/chunks/ecaac39dde7ec4213264.js +1 -0
- package/assets/esri/core/workers/chunks/fb444954be74c1962ced.js +1 -0
- package/assets/esri/core/workers/chunks/{fccbb902fe08448f91de.js → fd0a5c243f3426f2a0b5.js} +1 -1
- package/assets/esri/core/workers/chunks/fecaf0bc28aeea4d15db.js +1 -0
- package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationSettings.scss +1 -1
- package/assets/esri/themes/base/widgets/_Features.scss +1 -1
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +5 -9
- package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +2 -4
- package/assets/esri/themes/base/widgets/_Tooltip.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
- package/chunks/GlobalIllumination.glsl.js +4 -2
- package/chunks/GlobalIlluminationBlur.glsl.js +3 -5
- package/chunks/GlobalIlluminationUpscale.glsl.js +1 -1
- package/config.js +1 -1
- package/core/colorUtils.js +1 -1
- package/core/has.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/geometry/projectionUtils.js +1 -1
- package/kernel.js +1 -1
- package/layers/graphics/data/FeatureStore.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/geometryUtils.js +1 -1
- package/layers/graphics/data/projectionSupport.js +1 -1
- package/layers/knowledgeGraph/layerUtils.js +1 -1
- package/layers/knowledgeGraph/nodeMovementUtils.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/package.json +2 -2
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
- package/views/2d/layers/features/sources/strategies/AFeatureTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/support/elevationUpdateUtils.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationColorQuantization.glsl.js +2 -2
- package/views/draw/Draw.d.ts +1 -1
- package/views/draw/support/InteractiveHandle.js +1 -1
- package/views/interactive/options/SnappingOptions.d.ts +1 -0
- package/views/interactive/options/TooltipOptions.d.ts +1 -0
- package/views/interactive/options/ViewOptions.d.ts +1 -0
- package/views/interactive/support/Units.d.ts +1 -0
- package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
- package/views/interactive/tooltip/components/ElevationModeSelect.js +1 -1
- package/views/support/projectionUtils.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/DirectionalPad.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
- package/widgets/Sketch.d.ts +1 -1
- package/widgets/Track/TrackViewModel.d.ts +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace/types.d.ts +2 -2
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
- package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/PluginSettingsControls.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/componentsUtils.js +1 -1
- package/assets/esri/core/workers/chunks/02d4f91652a79d2b637e.js +0 -1
- package/assets/esri/core/workers/chunks/107b025dc5b09465a78f.js +0 -1
- package/assets/esri/core/workers/chunks/1f43e06dcfe56229bb0f.js +0 -1
- package/assets/esri/core/workers/chunks/2a570ce6b99dac6ee996.js +0 -1
- package/assets/esri/core/workers/chunks/3880d2c7fb14955d7f93.js +0 -1
- package/assets/esri/core/workers/chunks/56851011276de0b3e318.js +0 -1
- package/assets/esri/core/workers/chunks/5f3ab77a79c408423fde.js +0 -1
- package/assets/esri/core/workers/chunks/65654e481cce9ae40e54.js +0 -1
- package/assets/esri/core/workers/chunks/8b54589f173259c1ba55.js +0 -1
- package/assets/esri/core/workers/chunks/bff767ec5bb4c0d6b324.js +0 -1
- package/assets/esri/core/workers/chunks/c906f984b2b6e7578c06.js +0 -1
- package/assets/esri/core/workers/chunks/de02a6a1f4810f99e9bb.js +0 -1
- package/assets/esri/core/workers/chunks/e5943f3a4bbc12c06c4d.js +0 -1
- package/assets/esri/core/workers/chunks/f0aaa646b17ffdbdcefa.js +0 -1
package/widgets/FeatureTable.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as n}from"../core/arrayUtils.js";import{deprecateWidget as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{watch as a,sync as o,syncAndInitial as s,initial as c,on as l}from"../core/reactiveUtils.js";import{renderingSanitizer as u}from"../core/sanitizerUtils.js";import{formatFileSize as d}from"../core/unitFormatUtils.js";import{property as f,subclass as p}from"../core/accessorSupport/decorators.js";import{geometryTypes as m}from"../geometry/support/typeUtils.js";import{isLayerFromCatalog as h}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as g,isMapImageLayer as _,isSubtypeGroupLayer as v}from"../layers/support/layerUtils.js";import y from"../tables/AttributeTableTemplate.js";import b from"../time/TimeExtent.js";import x from"./Widget.js";import{isSupportedImage as S,getCalciteIconForAttachment as C,getAttachmentTypeCategory as w}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as T,Prompt as E}from"./Editor/components/Prompt.js";import D from"./FeatureTable/ColumnMenuVisibleElements.js";import O from"./FeatureTable/FeatureTableViewModel.js";import k from"./FeatureTable/VisibleElements.js";import{isGroupColumn as A,isFieldColumn as j}from"./FeatureTable/support/columnUtils.js";import M from"./FeatureTable/support/TableTemplate.js";import{loadFieldColumnComponents as N,isIFeatureTableSupportedLayer as P,isIFeatureTableSupportedLayerWithAttachments as F,getRelationshipIdsToShow as I}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as L}from"./support/componentsUtils.js";import{globalCss as R}from"./support/globalCss.js";import{getIconForLayer as z}from"./support/iconUtils.js";import{messageBundle as B,vmEvent as V,tsx as H,tsxFragment as U}from"./support/widget.js";import{storeNode as W,discardNode as G}from"./support/widgetUtils.js";var K;const q=`esri-feature-table`,J=`${q}__dialog`,Y=`${q}__table-navigation`,X=`${q}__attachments-view`,Z={base:q,content:`${q}__content`,menuPopover:`${q}__menu-popover`,layerDropdownMenu:`${q}__layer-switcher-menu`,tableContainer:`${q}__table-container`,tableContainerWithAttachments:`${q}__table-container--attachments`,tableNavigation:Y,attachmentsView:X,attachmentsViewContent:`${X}__content`,attachmentsViewDetails:`${X}__details`,attachmentsViewDropArea:`${X}__drop-area`,attachmentsViewDropAreaLabel:`${X}__drop-area__label`,attachmentsViewDropAreaMessage:`${X}__drop-area__message`,attachmentsViewIcon:`${X}__icon`,attachmentsViewInformation:`${X}__information`,attachmentsViewInformationData:`${X}__information__data`,attachmentsViewInformationLabel:`${X}__information__label`,attachmentsViewList:`${X}__list`,attachmentsViewListFileSize:`${X}__list__filesize`,attachmentsViewListThumbnail:`${X}__list__thumbnail`,expanded:`${q}__expanded`,collapsed:`${q}__collapsed`,dialog:`${J}`,dialogContent:`${J}__content`,dialogHeader:`${J}__header`,footerMessage:`${q}__footer__message`,footerIconDanger:`${q}__footer__icon--danger`,footerIconSuccess:`${q}__footer__icon--success`},Q={checkCircle:`check-circle`,chevronRight:`chevron-right`,clearSelection:`clear-selection`,downloadTo:`download-to`,exclamationMarkTriangle:`exclamation-mark-triangle`,expand:`expand`,exportToCSV:`file-csv`,folderOpen:`folder-open`,delete:`trash`,layers:`layers`,moveUp:`move-up`,plus:`plus`,refresh:`refresh`,reset:`reset`,save:`save`,showAll:`selection-x`,showColumn:`show-column`,showSelected:`selection-filter`,table:`table`,upload:`upload`,zoomToSelection:`zoom-to-object`};let $=K=class extends x{constructor(e,t){super(e,t),this._attachmentsDialogPreviewLoading=!1,this._attachmentsInput=null,this._columnVisibilityActions=new Map,this._columnVisibilityList=null,this.attachmentsList=null,this.closed=!1,this.collapsed=!1,this.columnVisibilityMenuConfig=null,this.description=null,this.disabled=!1,this.messagesEditor=null,this.navigationScale=`m`,this.title=null,this.viewModel=new O,this.visibleElements=new k,this.announceDeprecation=()=>{r(i.getLogger(this),`Feature Table`,`arcgis-feature-table`,{version:`5.0`})},this._showDeleteSelectionPrompt=this._showDeleteSelectionPrompt.bind(this),this._showDiscardEditsPrompt=this._showDiscardEditsPrompt.bind(this),this._resetNestedViews=this._resetNestedViews.bind(this)}initialize(){this.addHandles([a(()=>[this.isQueryingOrSyncing,this.editingEnabled],()=>this.scheduleRender()),a(()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.columns.length],()=>{this.columns.forEach(e=>e.visibleElements=this._effectiveVisibleElements),this.refreshCellContent()},o),a(()=>[this.topLayerDisabled,this.columns],()=>this.columns.forEach(e=>e.topLayerDisabled=this.topLayerDisabled),s),a(()=>this._effectiveVisibleElements.selectionColumn,e=>{this.grid&&(this.grid.selectionColumnEnabled=e)},c),l(()=>this.viewModel,`show-related-table`,e=>this._onShowRelatedTable(e)),a(()=>this.editingEnabled,()=>{let{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)}),l(()=>this.effectiveTable,`column-reorder`,()=>this.scheduleRender())])}loadDependencies(){return Promise.all([L({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),alert:()=>import(`@esri/calcite-components/dist/components/calcite-alert`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),chip:()=>import(`@esri/calcite-components/dist/components/calcite-chip`),dialog:()=>import(`@esri/calcite-components/dist/components/calcite-dialog`),dropdown:()=>import(`@esri/calcite-components/dist/components/calcite-dropdown`),"dropdown-group":()=>import(`@esri/calcite-components/dist/components/calcite-dropdown-group`),"dropdown-item":()=>import(`@esri/calcite-components/dist/components/calcite-dropdown-item`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),pagination:()=>import(`@esri/calcite-components/dist/components/calcite-pagination`),panel:()=>import(`@esri/calcite-components/dist/components/calcite-panel`),popover:()=>import(`@esri/calcite-components/dist/components/calcite-popover`),progress:()=>import(`@esri/calcite-components/dist/components/calcite-progress`),switch:()=>import(`@esri/calcite-components/dist/components/calcite-switch`),tooltip:()=>import(`@esri/calcite-components/dist/components/calcite-tooltip`)}),T(),N()])}destroy(){this.drainRelatedTables(),this.clearPrompt()}get _attachmentsViewIsVisible(){return!!(this.attachmentsViewOptions.objectId!=null||this.relatedTables.some(e=>e.attachmentsViewOptions.objectId!=null))}get _columnVisibilityActionDisabled(){let e=this.effectiveTable;return e.menuConfig?.disabled??e.columns.length===0}get _dialogIsOpen(){return!!this.attachmentsViewOptions.dialogInfo}get _effectiveDescription(){let{description:e}=this;return e==null?void 0:u.sanitize(typeof e==`function`?e():e)}get _effectiveLayers(){let{layer:e,layers:t}=this,n=t?.length?t.filter(P):[],r=n.length?n:[...this._viewLayers];return e&&!r.includes(e)&&r.push(e),r}get _effectiveTitle(){let{layer:e,messages:n,state:r,highlightIds:i,title:a,size:o}=this;if(a)return u.sanitize(typeof a==`function`?a():a);if(!n)return``;if(!e)return n.noLayer;switch(r){case`disabled`:return n.errorLayer;case`ready`:case`loading`:return n.loading;case`error`:return n.errorData}return t(n.header,{title:u.sanitize(e.title),count:o,selected:i.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){let e=this.relatedTables.toArray(),t=e.length===1;return this.allRelatedTablesVisible?e:t?[e[0]]:this._attachmentsViewIsVisible?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return this.attachmentsViewOptions.error!=null}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showExportSelectionToCSVAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||this.relatedTables.length===1&&!this._attachmentsViewIsVisible}get _shouldShowMenu(){let{header:e,menu:t}=this._effectiveVisibleElements;return!!(e&&t&&(this._hasDefaultMenuItems||this._hasCustomMenuItems))}get _showClearSelectionAction(){return!!(this.effectiveTable.highlightIds.length&&this._effectiveVisibleElements.menuItems?.clearSelection&&!this._attachmentsViewIsVisible)}get _showColumnVisibilityAction(){let{columnVisibilityMenu:e,header:t,menu:n,menuItems:r}=this._effectiveVisibleElements;return!(!t||!n||!e||r?.toggleColumns===!1||this.showRelatedTableCallback||this.allRelatedTablesVisible||this._attachmentsViewIsVisible)}get _showDeleteSelectionAction(){return!!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete&&!this.relatedTables.length&&!this._attachmentsViewIsVisible)}get _showExportSelectionToCSVAction(){return!!(this._effectiveVisibleElements.menuItems.exportSelectionToCSV&&this.layer&&this.highlightIds.length&&!this.relatedTables.length)}get _showLayerDropdown(){return!!(this._effectiveLayers.length&&this._effectiveVisibleElements.layerDropdown)}get _shouldShowNavigationBar(){let e=!!this.relatedTable||this._attachmentsViewIsVisible;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){let e=this.objectIds.length,t=this.highlightIds.length;return!(!t||!this._effectiveVisibleElements.menuItems?.selectedRecordsShowSelectedToggle||e&&t===e||this.relatedTables.length||this._attachmentsViewIsVisible)}get _showSelectedRecordsShowAllAction(){return!!(this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle&&this.objectIds.length&&!this.relatedTables.length)}get _showZoomToSelectionAction(){let e=this.effectiveTable;return!!(e.view&&e.highlightIds.length&&!e.layer?.isTable&&this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){let e=this.view?.map;if(!e)return[];let t=new Set,n=e=>{P(e)&&!v(e)&&!t.has(e)&&(e.type!==`sublayer`||e.capabilities?.operations?.supportsQuery)&&(e.load().catch(()=>{}),t.add(e))},r=e=>{h(e)||e.type===`catalog-footprint`||(g(e)?(e.load().catch(()=>{}),e.layers?.forEach(n),e.tables?.forEach(n)):_(e)?(e.loadAll().catch(()=>{}),e.allSublayers?.forEach(n),e.subtables?.forEach(n)):v(e)?(e.loadAll().catch(()=>{}),e.sublayers?.forEach(n)):n(e))};return e.allLayers.forEach(r),e.allTables.forEach(r),[...t.values()]}get direction(){return this.viewModel.direction}set direction(e){this.viewModel.direction=e}get grid(){return this.viewModel.grid}get actionColumn(){return this.viewModel.actionColumn}get actionColumnConfig(){return this.viewModel.actionColumnConfig}set actionColumnConfig(e){this.viewModel.actionColumnConfig=e}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get allColumns(){return this.viewModel.allColumns}get allColumnsVisible(){return this.viewModel.allColumnsVisible}get allRelatedTablesVisible(){return this.viewModel.allRelatedTablesVisible}get allVisibleColumns(){return this.viewModel.allVisibleColumns}get attachmentsColumns(){return this.viewModel.attachmentsColumns}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get attachmentsViewOptions(){return this.viewModel.attachmentsViewOptions}set attachmentsViewOptions(e){this.viewModel.attachmentsViewOptions=e}get attributeTableTemplate(){return this.viewModel.attributeTableTemplate}set attributeTableTemplate(e){this.viewModel.attributeTableTemplate=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get autoSaveEnabled(){return this.viewModel.autoSaveEnabled}set autoSaveEnabled(e){this.viewModel.autoSaveEnabled=e}get canAddRelatedFeature(){return this.viewModel.canAddRelatedFeature}get clearPrompt(){return this.viewModel.clearPrompt}set clearPrompt(e){this.viewModel.clearPrompt=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get defaultSelectionManager(){return this.viewModel.defaultSelectionManager}get definitionExpression(){return this.viewModel.definitionExpression}set definitionExpression(e){this.viewModel.definitionExpression=e}get container(){return super.container}set container(e){super.container=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get effectiveSize(){return this.viewModel.effectiveSize}get effectiveTable(){return this.relatedTable||this}get effectiveTimeExtent(){return this.viewModel.effectiveTimeExtent}get fieldColumns(){return this.viewModel.fieldColumns}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get filterBySelectionEnabled(){return this.viewModel.filterBySelectionEnabled}set filterBySelectionEnabled(e){this.viewModel.filterBySelectionEnabled=e}get filterByViewExtent(){return this.viewModel.filterByViewExtent}set filterByViewExtent(e){this.viewModel.filterByViewExtent=e}get filterByLayerScaleRange(){return this.viewModel.filterByLayerScaleRange}set filterByLayerScaleRange(e){this.viewModel.filterByLayerScaleRange=e}get groupColumns(){return this.viewModel.groupColumns}get hasContingentValues(){return this.viewModel.hasContingentValues}get hasInvalidPendingEdits(){return this.viewModel.hasInvalidPendingEdits}get hasPendingEdits(){return this.viewModel.hasPendingEdits}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get icon(){return Q.table}set icon(e){this._overrideIfSome(`icon`,e)}get initialSize(){return this.viewModel.initialSize}set initialSize(e){this.viewModel.initialSize=e}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing}get isSyncing(){return this.viewModel.isSyncing}get isSyncingAttachments(){return this.viewModel.isSyncingAttachments}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get layerView(){return this.viewModel.layerView}get maxSize(){return this.viewModel.maxSize}set maxSize(e){this.viewModel.maxSize=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesUnits(){return this.viewModel.messagesUnits}set messagesUnits(e){this.viewModel.messagesUnits=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get menuConfig(){return this.viewModel.menuConfig}set menuConfig(e){this.viewModel.menuConfig=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multipleSelectionEnabledOverride(){return this.viewModel.multipleSelectionEnabledOverride}set multipleSelectionEnabledOverride(e){this.viewModel.multipleSelectionEnabledOverride=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get outFields(){return this.viewModel.outFields}set outFields(e){this.viewModel.outFields=e}get pageCount(){return this.viewModel.pageCount}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get pendingEditsCount(){return this.viewModel.pendingEditsCount}get prompt(){return this.viewModel.prompt}set prompt(e){this.viewModel.prompt=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.viewModel.relatedTable}get relatedTableHasContingentValues(){return this.viewModel.relatedTableHasContingentValues}get relatedTableHasInvalidPendingEdits(){return this.viewModel.relatedTableHasInvalidPendingEdits}get relatedTableHasPendingEdits(){return this.viewModel.relatedTableHasPendingEdits}get relatedTables(){return this.viewModel.relatedTables}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipColumns(){return this.viewModel.relationshipColumns}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get relationshipInfos(){return this.viewModel.relationshipInfos}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get returnMEnabled(){return this.viewModel.returnMEnabled}set returnMEnabled(e){this.viewModel.returnMEnabled=e}get returnZEnabled(){return this.viewModel.returnZEnabled}set returnZEnabled(e){this.viewModel.returnZEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=e}get showAllRelatedTables(){return this.viewModel.showAllRelatedTables}set showAllRelatedTables(e){this.viewModel.showAllRelatedTables=e}get showPrompt(){return this.viewModel.showPrompt}set showPrompt(e){this.viewModel.showPrompt=e}get showRelatedTableCallback(){return this.viewModel.showRelatedTableCallback}set showRelatedTableCallback(e){this.viewModel.showRelatedTableCallback=e}get size(){return this.viewModel.size}get state(){return this.viewModel.state}get supportsAddAttachments(){return this.viewModel.supportsAddAttachments}get supportsAttachments(){return this.viewModel.supportsAttachments}get supportsDeleteAttachments(){return this.viewModel.supportsDeleteAttachments}get supportsResizeAttachments(){return this.viewModel.supportsResizeAttachments}get supportsUpdateAttachments(){return this.viewModel.supportsUpdateAttachments}get syncTemplateOnChangesEnabled(){return this.viewModel.syncTemplateOnChangesEnabled}set syncTemplateOnChangesEnabled(e){this.viewModel.syncTemplateOnChangesEnabled=e}get syncViewSelection(){return this.viewModel.syncViewSelection}set syncViewSelection(e){this.viewModel.syncViewSelection=e}get syncWithViewSelectionManager(){return this.syncViewSelection}set syncWithViewSelectionManager(e){this.syncViewSelection=e}get tableController(){return this.viewModel.tableController}set tableController(e){this.viewModel.tableController=e}get tableParent(){return this.viewModel.tableParent}set tableParent(e){this.viewModel.tableParent=e}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get tableTemplateOverride(){return this.viewModel.tableTemplateOverride}set tableTemplateOverride(e){this.viewModel.tableTemplateOverride=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewTimeEnabled(){return this.viewModel.viewTimeEnabled}set viewTimeEnabled(e){this.viewModel.viewTimeEnabled=e}get visibleColumns(){return this.viewModel.visibleColumns}get visibleElementsOverride(){let{attachmentsViewOptions:e,relatedTable:t,tableController:n,visibleElements:r}=this,{columnDescriptions:i,columnMenus:a,tooltips:o}=r,s=e.objectId!=null;if(t)return new k({columnDescriptions:i,columnMenus:a,tooltips:o,close:r.close,header:r.header,layerDropdown:r.layerDropdown,layerDropdownIcons:r.layerDropdownIcons,menu:r.menu,menuItems:r.menuItems,progress:r.progress,selectionColumn:!1,columnMenuItems:new D({sortAscending:!1,sortDescending:!1})});if(n){let e=n.relatedTable===this,t=n.allRelatedTablesVisible,c=e&&r.selectionColumn&&!t&&!s,l=e&&!t&&!s;return new k({columnDescriptions:i,columnMenus:a,tooltips:o,selectionColumn:c,close:!1,header:!1,layerDropdown:!1,menu:!1,pendingEditsFooter:!1,progress:!1,columnMenuItems:new D({sortAscending:l,sortDescending:l})})}return s?new k({columnDescriptions:i,columnMenus:a,tooltips:o,close:r.close,header:r.header,layerDropdown:r.layerDropdown,layerDropdownIcons:r.layerDropdownIcons,menu:r.menu,menuItems:r.menuItems,progress:r.progress,selectionColumn:!1,columnMenuItems:new D({sortAscending:!1,sortDescending:!1})}):null}addPendingEdits(e){this.viewModel.addPendingEdits(e)}clearSelection(){this.effectiveTable.viewModel.clearSelection()}async deleteAttachments(e,t,n){e!=null&&t?.length&&(n?this._showDeleteAttachmentPrompt(e,t):await this.viewModel.deleteAttachments(e,t))}async deleteSelection(e){this.highlightIds.length&&(e?this._showDeleteSelectionPrompt():await this.viewModel.deleteSelection())}async discardPendingEdits(e,t){return t?this._showDiscardEditsPrompt(e):this.viewModel.discardPendingEdits(e)}async downloadAttachmentById(e,t){return this.viewModel.downloadAttachmentById(e,t)}drainRelatedTables(){this.viewModel.drainRelatedTables()}async exportSelectionToCSV(e){return this.viewModel.exportSelectionToCSV(e)}findColumn(e){return this.viewModel.findColumn(e)}getFeatureStoreItemByObjectId(e){return this.viewModel.getFeatureStoreItemByObjectId(e)}goToPage(e){this.viewModel.goToPage(e)}hideAllColumns(){this.viewModel.hideAllColumns()}hideColumn(e){this.grid?.hideColumn(e)}nextPage(){this.viewModel.nextPage()}previousPage(){this.viewModel.previousPage()}async refresh(){await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}async saveAttachmentsViewForm(){await this.viewModel.saveAttachmentsViewForm()}async savePendingEdits(){await this.viewModel.savePendingEdits()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollLeft(){this.viewModel.scrollLeft()}scrollToBottom(){this.viewModel.scrollToBottom()}scrollToIndex(e){this.viewModel.scrollToIndex(e)}scrollToRow(e){this.viewModel.scrollToRow(e)}scrollToTop(){this.viewModel.scrollToTop()}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}get visibilityMenuColumns(){let e=this.effectiveTable.columns;return this.columnVisibilityMenuConfig?.frozenColumnsExcluded?e.filter(e=>!e.frozen&&!e.frozenToEnd).toArray():e.toArray()}async zoomToSelection(){return this.effectiveTable.viewModel.zoomToSelection()}render(){let{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:n,state:r}=this;return H(`div`,{bind:this,class:this.classes(Z.base,R.widget)},H(`calcite-panel`,{bind:this,class:Z.content,closable:e.close,closed:this.closed,collapsed:this.collapsed,collapsible:e.collapse,description:this._effectiveDescription,dir:this.direction,disabled:this.disabled||r===`disabled`&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,key:`table-content`,loading:r===`loading`,menuOpen:!!n?.open,overlayPositioning:`fixed`,onCalcitePanelClose:()=>{this.closed=!0,this.emit(`close`)},onCalcitePanelToggle:e=>{this.collapsed=e.target.collapsed,this.emit(`toggle`)}},e.progress?H(`calcite-progress`,{type:t?`indeterminate`:`determinate`}):null,this._showLayerDropdown?this._renderLayerDropdown():null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderNavigationBar(),this._renderTables(),this._renderError(),this._renderFooterContent()),this._renderColumnVisibilityPopover(),this._renderPrompt(),this._renderDialog())}_renderTables(){let{grid:e,relatedTables:t}=this,n=this.classes(Z.tableContainer);if(t.length){let r=this.classes(Z.base,this.allRelatedTablesVisible?Z.expanded:Z.collapsed,this._attachmentsViewIsVisible?Z.tableContainerWithAttachments:void 0);return H(`div`,{class:n},H(`calcite-panel`,{overlayPositioning:`fixed`},H(`div`,null,[this._shouldShowGrid?H(`div`,{class:r},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map(e=>{let n=t.indexOf(e);return H(`div`,{class:r,key:`related-${n}`},e.render())}),,])))}return this.attachmentsViewOptions.objectId==null?[H(`div`,{class:n},e?.render()),this._renderPagination()]:H(`div`,{class:n},H(`calcite-panel`,{overlayPositioning:`fixed`},H(`div`,null,[H(`div`,{class:this.classes(Z.base,Z.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()])))}_renderPagination(){if(this.paginationEnabled)return H(`calcite-pagination`,{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>{this._attachmentsDialogPreviewLoading=!1,this.goToPage(e.currentTarget.startItem-1)}})}_renderError(){let{messages:e}=this;return H(`calcite-alert`,{autoClose:!0,autoCloseDuration:`fast`,icon:Q.exclamationMarkTriangle,kind:`danger`,label:e.errorOccured,open:this._hasAttachmentsViewError,slot:`alerts`,topLayerDisabled:this.topLayerDisabled,onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},H(`span`,{slot:`message`},e.errorOccured))}_renderFooterContent(){if(!this.hasPendingEdits||!this._effectiveVisibleElements.pendingEditsFooter)return;let{hasInvalidPendingEdits:e,isQueryingOrSyncing:t,messages:n,messagesCommon:r}=this,i=e||t,a=this.hasContingentValues,o=[H(`calcite-button`,{appearance:`outline`,disabled:t,iconStart:Q.reset,key:`footer-reset-button`,slot:`footer-end`,width:`auto`,onclick:()=>void this.discardPendingEdits()},r.reset),H(`calcite-button`,{disabled:i,iconStart:Q.save,key:`footer-save-button`,loading:this.isSyncing,slot:`footer-end`,width:`auto`,onclick:()=>{this.savePendingEdits()}},r.save)];if(a){let t=e?n.contingentValues.hasInvalidValues:n.contingentValues.hasValidValues,r=e?Q.exclamationMarkTriangle:Q.checkCircle,i=e?Z.footerIconDanger:Z.footerIconSuccess;o.push(H(`div`,{class:Z.footerMessage,key:`footer-message`,slot:`footer-start`},H(`calcite-icon`,{class:i,icon:r,scale:`s`,slot:`footer-start`}),t))}return o}_renderPrompt(){return this.prompt?H(E,{...this.prompt,headingLevel:2}):void 0}_showDeleteSelectionPrompt(){let{messages:e,messagesCommon:n}=this,r=t(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:r,message:e.deleteRecordsRemoved,context:`danger`,actions:{primary:{label:n.delete,action:async()=>{try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,n){let{messages:r,messagesCommon:i}=this,a=t(r.deleteAttachmentCount,{count:n.length});this.showPrompt({title:a,message:r.deleteAttachmentConfirmation,context:`danger`,actions:{primary:{label:i.delete,action:async()=>{try{await this.deleteAttachments(e,n,!1)}finally{this.clearPrompt()}}},secondary:{label:i.cancel,action:()=>this.clearPrompt()}}})}async _showDiscardEditsPrompt(e){let t=Promise.withResolvers(),{messagesEditor:n}=this;return this.showPrompt({title:n.cancelEditTitle,message:n.cancelEditWarningMessage,context:`danger`,actions:{primary:{label:n.discardEdits,action:async()=>{try{await this.discardPendingEdits(e)}finally{t.resolve(!0)}}},secondary:{label:n.continueEditing,action:()=>t.resolve(!1)}}}),t.promise.finally(()=>this.clearPrompt())}_onTableViewChange(e){this.hasPendingEdits?this._showDiscardEditsPrompt().then(t=>t&&e()):e()}_resetNestedViews(){this.relatedTable&&this.drainRelatedTables(),this.effectiveTable.attachmentsViewOptions.objectId=null}_renderDialog(){let{attachmentsViewOptions:e,messages:t}=this,{objectId:n}=e;return H(`calcite-dialog`,{class:Z.dialog,description:this.viewModel.getFeatureTitleSync(n),heading:t.attachments,modal:!0,open:this._dialogIsOpen,placement:`cover`,width:`l`,onCalciteDialogClose:()=>this._onDialogClose()},this._renderDialogContent())}_renderDialogContent(){let e=this.attachmentsViewOptions.dialogInfo;if(e)return this._renderAttachmentsDialogContent(e)}_renderAttachmentsDialogContent(e){let{attachmentsViewOptions:t,messages:n}=this,{attachmentInfos:r}=t,i=r.indexOf(e);return H(U,null,H(`div`,{class:Z.dialogHeader,key:`header`,slot:`content-top`},H(`span`,null,e.name),H(`calcite-button`,{appearance:`outline`,onclick:()=>{t.attachmentId=e.id,t.dialogId=null}},n.viewDetails)),H(`calcite-progress`,{type:this._attachmentsDialogPreviewLoading?`indeterminate`:`determinate`}),H(`div`,{class:Z.dialogContent,key:`content`},this._renderAttachmentsViewDetailsImage(e)),H(`calcite-pagination`,{pageSize:1,slot:`footer`,startItem:i+1,totalItems:r.length,onCalcitePaginationChange:e=>{let n=e.currentTarget.startItem-1,i=r[n]?.id;t.dialogId=i}}))}_onDialogClose(){let e=this.attachmentsViewOptions;e.dialogId!=null&&(e.dialogId=null),this._attachmentsDialogPreviewLoading=!1}_renderHeaderMenuAction(e){let{disabled:t,hidden:n,icon:r,text:i,clickFunction:a}=e;if(!n)return H(`calcite-action`,{disabled:t??this.menuConfig?.disabled,icon:r??void 0,key:i,slot:`header-menu-actions`,text:i,textEnabled:!0,title:i,onclick:()=>a()})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];let{messages:e}=this;return[this._showRefreshDataAction&&{icon:Q.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:Q.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:Q.clearSelection,text:e.clearSelection,clickFunction:()=>this.clearSelection()},this._showZoomToSelectionAction&&{icon:Q.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:Q.showSelected,text:e.showSelected,clickFunction:()=>{let{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:Q.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:Q.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(n).map(e=>e&&this._renderHeaderMenuAction(e))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map(({disabled:e,hidden:t,icon:n,label:r,clickFunction:i})=>this._renderHeaderMenuAction({hidden:typeof t==`function`?t():t,icon:n,text:r,disabled:typeof e==`function`?e():e,clickFunction:e=>i(e)}))??[]}_renderColumnVisibilityAction(){if(!this._showColumnVisibilityAction)return[];let{_columnVisibilityActions:e,id:t}=this,n=this.messages.menuText.columnVisibility;return H(`calcite-action`,{afterCreate:n=>e.set(t,n),afterRemoved:()=>e.delete(t),bind:this,disabled:this._columnVisibilityActionDisabled,icon:Q.showColumn,id:`${t}__toggle-columns-action`,slot:`header-actions-end`,text:n},this._effectiveVisibleElements.tooltips?H(`calcite-tooltip`,{closeOnClick:!0,overlayPositioning:`fixed`,placement:`bottom-end`,referenceElement:e.get(t),topLayerDisabled:this.topLayerDisabled},n):null)}_renderColumnVisibilityPopover(){if(!this._showColumnVisibilityAction||this._columnVisibilityActionDisabled)return;let e=this.visibleElements.columnVisibilityMenuItems.header,t=this.messages.menuText.columnVisibility;return H(`calcite-popover`,{autoClose:!0,class:Z.menuPopover,closable:e,heading:e?t:void 0,label:t,overlayPositioning:`fixed`,placement:this.columnVisibilityMenuConfig?.placement,referenceElement:this._columnVisibilityActions.get(this.id),topLayerDisabled:this.topLayerDisabled},this._renderColumnVisibilityList())}_renderColumnVisibilityList(){let{visibilityMenuColumns:e,messages:{menuText:t}}=this;if(e.length!==0)return H(`calcite-list`,{afterCreate:W,afterRemoved:G.bind(this),afterUpdate:W,bind:this,"data-node-ref":`_columnVisibilityList`,dir:this.direction,displayMode:`nested`,filterEnabled:this.visibleElements.columnVisibilityMenuItems.filter,filterPlaceholder:t.searchFields,label:t.fieldVisibility,selectionMode:`multiple`,onCalciteListChange:()=>this._syncColumnVisibility(),onCalciteListFilter:()=>this.scheduleRender()},this._renderColumnToggleAll(),e.map(e=>{let t=A(e)?e.columns?.map(e=>this._renderColumnListItem({column:e})):void 0;return this._renderColumnListItem({column:e,items:t})}),H(`calcite-notice`,{appearance:`transparent`,kind:`neutral`,open:!0,slot:`filter-no-results`},H(`div`,{slot:`message`},t.noMatchesFound)))}_syncColumnVisibility(){let{effectiveTable:e,_columnVisibilityList:t}=this;if(!t)return;let n=new Set(t.selectedItems.map(e=>e.value)),r=!!this.columnVisibilityMenuConfig?.frozenColumnsExcluded;e.allColumns.forEach(t=>{r&&(t.frozen||t.frozenToEnd)||(n.has(t.fieldName)?e.showColumn(t.fieldName):e.hideColumn(t.fieldName))})}_renderColumnToggleAll(){if(!this.visibleElements.columnVisibilityMenuItems.toggleAll)return;let{_columnVisibilityList:e}=this;if(e&&e.filteredItems?.length)return H(`calcite-button`,{appearance:`transparent`,width:`full`,onclick:()=>this._toggleAllColumns()},this._getColumnToggleAllText())}_getColumnToggleAllText(){let{_columnVisibilityList:e,effectiveTable:t,messages:{menuText:n}}=this;return e?e.filterText===``?t.allColumnsVisible?n.deselectAll:n.selectAll:this._allColumnsAreVisible(e.filteredItems.map(e=>e.value))?n.deselectAll:n.selectAll:``}_renderColumnListItem(e){let{column:t,items:n}=e,{effectiveLabel:r,fieldName:i,hidden:a}=t,o=!(!n?.length||a)||void 0;return H(`calcite-list-item`,{expanded:o,key:`toggle-columns__item-${i}`,label:r,metadata:{description:t.effectiveDescription,type:j(t)?t.field.type:void 0},selected:!a,value:i},n)}_renderLayerDropdown(){let e=this.messages.selectALayer;return H(`div`,{class:Z.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:`header-actions-start`},H(`calcite-dropdown`,{bind:this,maxItems:5,overlayPositioning:`fixed`,placement:`bottom-start`,topLayerDisabled:this.topLayerDisabled},H(`calcite-action`,{icon:Q.layers,slot:`trigger`,text:e,title:e}),H(`calcite-dropdown-group`,{selectionMode:`single`},this._effectiveLayers.map((e,t)=>this._renderLayerDropdownItem(e,t))??null)))}_renderLayerDropdownItem(e,t){let n=this.visibleElements.layerDropdownIcons;return H(`calcite-dropdown-item`,{iconStart:n?z(e):void 0,key:`dropdown-item-${t}`,label:e.title??``,selected:e===this.layer,value:e.id,onCalciteDropdownItemSelect:()=>this._onTableViewChange(()=>this.layer=e)},e.title)}_onRelatedNavigationItemClick(e){this.viewModel.drainRelatedTablesAboveIndex(e)}_collapseRelatedTable(e){this.viewModel.collapseRelatedTable(this.effectiveTable,e)}_onShowRelatedTable(e){this.showRelatedTableCallback||this.hasPendingEdits||(this._collapseRelatedTable(e),this._createRelatedTable(e))}async _createRelatedTable(e){let{autoRefreshEnabled:t,autoSaveEnabled:n,direction:r,editingEnabled:i,effectiveTable:a,multipleSelectionEnabled:o,paginationEnabled:s,pageSize:c,view:l,viewModel:u}=this,{layer:d,objectId:f,relatedLayer:p,relationshipId:m}=e;await d.load();let h=this.attachmentsEnabled&&F(d),g=new K({layer:d,autoRefreshEnabled:t,autoSaveEnabled:n,attachmentsEnabled:h,direction:r,editingEnabled:i,multipleSelectionEnabled:o,paginationEnabled:s,pageSize:c,relatedRecordsEnabled:!0,relationshipConfig:{objectId:f,relatedLayer:p,relationshipId:m},relationshipColumnConfigs:I(d,m),tableController:this,tableParent:a,view:l,showRelatedTableCallback:e=>u.emit(`show-related-table`,e)});this.relatedTables.add(g),this.scheduleRender()}_renderAttachmentsView(){switch(this.attachmentsViewOptions.effectiveMode){case`list`:return this._renderAttachmentsViewList();case`details`:return this._renderAttachmentsViewDetails();case`file`:return this._renderAttachmentsViewFile()}}_renderAttachmentsViewFile(){let e=this.attachmentsViewOptions,{objectId:t}=e;if(t!=null)return[H(`div`,{class:Z.attachmentsView,key:`attachments-view`},this._renderAttachmentsViewInformation(),H(`div`,{class:Z.attachmentsViewContent,key:`attachments-view-content`},H(`div`,{bind:this,class:Z.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},H(`calcite-icon`,{class:Z.attachmentsViewIcon,icon:Q.upload,scale:`l`}),this._renderAttachmentsViewFileLabelNode(),this._renderAttachmentsViewFileMessageNode(),H(`form`,{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:`attachments-form`},H(`fieldset`,null,this._renderAttachmentsViewFileNameNode(),H(`input`,{afterCreate:W,afterRemoved:G,afterUpdate:W,bind:this,"data-node-ref":`_attachmentsInput`,files:e.candidates,hidden:!0,name:`attachment`,type:`file`,onchange:e=>this._onAttachmentsViewCandidateChange(e)}),this._renderAttachmentsViewFileSelectNode(),this._renderAttachmentsViewFileSaveNode(),this._renderAttachmentsViewFileCancelNode())))))]}_renderAttachmentsViewFileLabelNode(){if(this.attachmentsViewOptions.fileMode===`replace`)return H(`span`,{class:Z.attachmentsViewDropAreaLabel,key:`replace-file-node`},this.messages.replaceFile)}_renderAttachmentsViewFileMessageNode(){let e=this.attachmentsViewOptions;if(e.hasCandidates)return;let{messages:t}=this,n=this.supportsAddAttachments?e.objectId==null?t.noFeature:t.dragAndDropToUpload:t.editingRestricted;return H(`span`,{class:Z.attachmentsViewDropAreaMessage,key:`message-node`},n)}_renderAttachmentsViewFileNameNode(){let e=this.attachmentsViewOptions.candidates,t=Array.from(e??[]).at(-1);if(t)return H(`span`,{class:Z.attachmentsViewDropAreaMessage,key:`filename-node`},t.name)}_renderAttachmentsViewFileSelectNode(){if(this.supportsAddAttachments)return H(`calcite-button`,{appearance:`outline-fill`,disabled:this.isSyncingAttachments,iconStart:Q.folderOpen,key:`select-node`,onclick:()=>{this._resetAttachmentsInput(),this._attachmentsInput?.click()}},this.messages.selectFile)}_renderAttachmentsViewFileSaveNode(){let{isSyncingAttachments:e,messages:t}=this,{attachmentInfo:n,hasCandidates:r}=this.attachmentsViewOptions;if(this.supportsAddAttachments&&r)return H(`calcite-button`,{appearance:`solid`,disabled:e,iconStart:Q.save,key:`save-node`,loading:e,onclick:()=>{this.saveAttachmentsViewForm()}},n?t.updateAttachment:t.addAttachment)}_renderAttachmentsViewFileCancelNode(){let{hasAttachments:e,hasCandidates:t}=this.attachmentsViewOptions;if(e||t)return H(`calcite-button`,{appearance:`transparent`,bind:this,disabled:this.isSyncingAttachments,key:`cancel-node`,onclick:()=>{this._resetAttachmentsInput(),this.attachmentsViewOptions.cancel()}},this.messagesCommon.cancel)}_renderAttachmentsViewDetails(){let{attachmentInfo:e}=this.attachmentsViewOptions;if(e)return[H(`div`,{class:Z.attachmentsView,key:`attachments-view`},this._renderAttachmentsViewInformation(),H(`div`,{class:Z.attachmentsViewContent,key:`attachments-view-content`},H(`div`,{class:Z.attachmentsViewDetails},this._renderAttachmentsViewDetailsPreview(e))))]}_renderAttachmentsViewDetailsPreview(e){let t=[this._renderAttachmentsViewDetailsImage(e)];if(S(e.contentType)){let n=this.messages.maximize;t.push(H(`calcite-action`,{icon:Q.expand,label:n,text:n,textEnabled:!0,title:n,onclick:t=>{t.preventDefault(),this.attachmentsViewOptions.dialogId=e.id}}))}return t}_renderAttachmentsViewDetailsImage(e){let{contentType:t,name:n,size:r,url:i}=e,{messages:a}=this;return S(t)?H(`img`,{afterCreate:()=>this._attachmentsDialogPreviewLoading=!0,alt:n,key:`thumbnail-image-${n}`,src:`${i}${i?.includes(`?`)?`&`:`?`}s=${r}`,title:n,onerror:()=>this._attachmentsDialogPreviewLoading=!1,onload:()=>this._attachmentsDialogPreviewLoading=!1}):[H(`calcite-icon`,{icon:C(t),key:`thumbnail-icon-${n}`,scale:`l`,textLabel:n,title:n}),a.noPreviewAvailable]}_renderAttachmentsViewInformation(){let{attachmentsViewOptions:e,messages:t,messagesUnits:n}=this,{attachmentInfo:r,objectId:i}=e;if(r&&i!=null)return H(`div`,{class:Z.attachmentsViewInformation,key:`information`},this._renderAttachmentViewInformationButtons(r,i),H(`span`,{class:Z.attachmentsViewInformationLabel,key:`file-label`},t.fileName),H(`span`,{class:Z.attachmentsViewInformationData,key:`file-value`},r.name),H(`span`,{class:Z.attachmentsViewInformationLabel,key:`type-label`},t.attachmentType),H(`span`,{class:Z.attachmentsViewInformationData,key:`type-value`},this._getLabelForAttachmentType(r)),this._renderAttachmentKeywordDetails(r),H(`span`,{class:Z.attachmentsViewInformationLabel,key:`size-label`},t.size),H(`span`,{class:Z.attachmentsViewInformationData,key:`size-span`},d(n,r.size??0)))}_renderAttachmentViewInformationButtons(e,t){let{attachmentsViewOptions:n,messages:r,messagesCommon:i}=this,a=n.effectiveMode!==`details`,o=e.id,s=[H(`calcite-button`,{appearance:`outline`,disabled:a,key:`download-button`,width:`full`,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(t,o)}},r.download)];return this.supportsUpdateAttachments&&s.push(H(`calcite-button`,{appearance:`outline`,disabled:a,key:`replace-button`,width:`full`,onclick:()=>{n.mode=`file`,n.attachmentId=o}},r.replace)),this.supportsDeleteAttachments&&s.push(H(`calcite-button`,{appearance:`outline`,disabled:a,key:`delete-button`,width:`full`,onclick:()=>{this.deleteAttachments(t,[o],!0)}},i.delete)),s}_renderAttachmentKeywordDetails({keywords:e}){if(e&&e!==``)return[H(`span`,{class:Z.attachmentsViewInformationLabel,key:`keyword-label`},this.messages.keyword),H(`span`,{class:Z.attachmentsViewInformationData,key:`keyword-value`},e)]}_renderAttachmentsViewList(){let{attachmentsViewOptions:e,isSyncingAttachments:t,messages:n,messagesUnits:r}=this,{attachmentInfos:i,objectId:a}=e;return H(`calcite-list`,{afterCreate:W,afterRemoved:G,afterUpdate:W,bind:this,class:Z.attachmentsViewList,"data-node-ref":`attachmentsList`,key:`attachments-list-${a}`,label:n?.attachments,loading:t,selectionMode:this.supportsDeleteAttachments?`multiple`:`none`,onCalciteListChange:()=>this.scheduleRender(),ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},...i?.map(t=>{let{id:i,name:o,size:s}=t,c=d(r,s??0);return H(`calcite-list-item`,{afterRemoved:()=>this.scheduleRender(),key:`attachment-${i}`,label:o,value:i},this._renderAttachmentsViewListPreview(t),H(`span`,{class:Z.attachmentsViewListFileSize,slot:`actions-end`,title:c},c),H(`calcite-action`,{icon:Q.downloadTo,key:`download`,label:o,slot:`actions-end`,text:n.downloadAttachment,title:n.downloadAttachment,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(a??-1,i)}}),H(`calcite-action`,{icon:Q.chevronRight,iconFlipRtl:!0,key:`details`,label:o,slot:`actions-end`,text:n.viewAttachment,title:n.viewAttachment,onclick:()=>{e.mode=`details`,e.attachmentId=i}}))}))}_renderAttachmentsViewListPreview(e){return H(`div`,{class:Z.attachmentsViewListThumbnail,slot:`content-start`},H(`span`,null,this._renderAttachmentsViewListImage(e)))}_renderAttachmentsViewListImage(e,t=64){let{contentType:n,name:r,size:i,url:a}=e,o=`${a}${a?.includes(`?`)?`&`:`?`}w=${t}&s=${i}`;return this.supportsResizeAttachments&&S(n)?H(`img`,{alt:r,key:`thumbnail-image-${r}`,src:o,title:r}):H(`calcite-icon`,{icon:C(n),key:`thumbnail-icon-${r}`,scale:`l`,textLabel:r,title:r})}_onAttachmentsViewCandidateChange({target:e}){this.attachmentsViewOptions.candidates=e?.files}_onAttachmentsViewDrop(e){e.preventDefault(),(this.supportsAddAttachments||this.supportsUpdateAttachments)&&(this.attachmentsViewOptions.mode=`file`,this.attachmentsViewOptions.candidates=e.dataTransfer?.files)}_resetAttachmentsInput(){this._attachmentsInput&&(this._attachmentsInput.value=``)}_getLabelForAttachmentType({contentType:e}){let t=this.messages,n=w(e);return t.attachmentTypes[n]}_renderNavigationBar(){let{effectiveTable:e,messages:n,messagesCommon:r,navigationScale:i,relatedTable:a,relatedTables:o}=this;if(!this._shouldShowNavigationBar)return;let{attachmentsList:s,attachmentsViewOptions:c,layer:l,supportsAddAttachments:u,supportsDeleteAttachments:d}=e;if(!l)return;let{attachmentInfos:f,objectId:p}=c,m=p!=null,h=f.length,g=s?.selectedItems?.length??0,_=`${l.objectIdField}: ${p}`,v=t(n.selectedCount,{count:g}),y=t(n.attachmentsCount,{count:h}),b=m?H(`calcite-action`,{bind:this,icon:Q.chevronRight,iconFlipRtl:!0,key:`navigation-feature`,scale:i,text:_,textEnabled:!0,title:_,onclick:()=>e.scrollToRow(p)}):void 0,x=m?H(`calcite-action`,{icon:Q.chevronRight,iconFlipRtl:!0,key:`navigation-attachments-label`,label:y,scale:i,text:y,textEnabled:!0,title:y,onclick:()=>{h>0&&(c.mode=`list`)}}):void 0,S=m?H(`calcite-chip`,{closable:!0,closed:g===0,key:`navigation-chip`,kind:`inverse`,label:v,scale:`s`,selected:!0,title:v,value:`selected`,onCalciteChipClose:()=>s?.selectedItems?.forEach(e=>e.selected=!1)},v):void 0,C=a?H(`calcite-label`,{layout:`inline`,scale:i},n.showAllTables,H(`calcite-switch`,{checked:this.allRelatedTablesVisible,scale:i,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,w=m&&c.effectiveMode===`list`&&p!=null&&g&&d?H(`calcite-action`,{icon:Q.delete,iconFlipRtl:!0,key:`attachments-trash-all`,scale:i,text:r.delete,textEnabled:!0,title:t(n.deleteAttachmentCount,{count:g}),onclick:()=>{e.deleteAttachments(p,s?.selectedItems?.map(e=>e.value)??[],!0)}}):void 0,T=m&&c.effectiveMode===`list`&&u?H(`calcite-action`,{bind:this,icon:Q.plus,iconFlipRtl:!0,key:`attachments-add`,scale:i,text:n.addAttachment,textEnabled:!0,title:n.addAttachment,onclick:()=>{c.objectId=p,c.attachmentId=null,c.mode=`file`}}):void 0;return H(`div`,{class:Z.tableNavigation,key:`table-nav`},H(`calcite-action`,{icon:Q.moveUp,iconFlipRtl:!0,key:`go-back`,scale:i,text:this.layer?.title??``,textEnabled:!1,title:a?n.exitRelatedRecords:n.exitAttachments,onclick:()=>this._onTableViewChange(this._resetNestedViews)}),o.toArray().map((e,t)=>this._renderRelatedTableNavigationAction(e,t)),b,x,H(`div`,null,S,C,w,T))}_renderRelatedTableNavigationAction(e,t){let n=this._getLabelForRelatedTableNavigationAction(e);return H(`calcite-action`,{icon:Q.chevronRight,iconFlipRtl:!0,key:t,scale:this.navigationScale,text:n,textEnabled:!0,title:e.layer?.title||``,onclick:()=>{(t!==this.relatedTables.length-1||this._attachmentsViewIsVisible)&&this._onTableViewChange(()=>this._onRelatedNavigationItemClick(t))}})}_getLabelForRelatedTableNavigationAction(e){let t=e.layer?.title;if(!t)return``;let{relatedTables:n}=this;return n.length<=1?t:n.indexOf(e)!==n.length-1&&t.length>20?`${t.slice(0,20)}...`:t}_allColumnsAreVisible(e){let t=this.columnVisibilityMenuConfig;return e.every(e=>{let n=this.findColumn(e);return n?t?.frozenColumnsExcluded&&(n.frozen||n.frozenToEnd)?!0:n.effectiveVisible:!1})}_toggleAllColumns(){let{_columnVisibilityList:e,effectiveTable:t}=this,n=e?.filteredItems.map(e=>e.value);e?.filterText!==``&&n?.length?this._allColumnsAreVisible(n)?n.forEach(e=>this.hideColumn(e)):n.forEach(e=>this.showColumn(e)):t.allColumnsVisible?t.visibilityMenuColumns.forEach(e=>t.hideColumn(e.fieldName)):t.visibilityMenuColumns.forEach(e=>t.showColumn(e.fieldName))}};e([f()],$.prototype,`_attachmentsDialogPreviewLoading`,void 0),e([f()],$.prototype,`_attachmentsInput`,void 0),e([f()],$.prototype,`_attachmentsViewIsVisible`,null),e([f()],$.prototype,`_columnVisibilityActions`,void 0),e([f()],$.prototype,`_columnVisibilityActionDisabled`,null),e([f()],$.prototype,`_columnVisibilityList`,void 0),e([f()],$.prototype,`_dialogIsOpen`,null),e([f()],$.prototype,`_effectiveDescription`,null),e([f()],$.prototype,`_effectiveLayers`,null),e([f()],$.prototype,`_effectiveTitle`,null),e([f()],$.prototype,`_effectiveVisibleElements`,null),e([f()],$.prototype,`_filteredTables`,null),e([f()],$.prototype,`_hasAttachmentsViewError`,null),e([f()],$.prototype,`_hasCustomMenuItems`,null),e([f()],$.prototype,`_hasDefaultMenuItems`,null),e([f()],$.prototype,`_shouldShowGrid`,null),e([f()],$.prototype,`_shouldShowMenu`,null),e([f()],$.prototype,`_showClearSelectionAction`,null),e([f()],$.prototype,`_showColumnVisibilityAction`,null),e([f()],$.prototype,`_showDeleteSelectionAction`,null),e([f()],$.prototype,`_showExportSelectionToCSVAction`,null),e([f()],$.prototype,`_showLayerDropdown`,null),e([f()],$.prototype,`_shouldShowNavigationBar`,null),e([f()],$.prototype,`_showRefreshDataAction`,null),e([f()],$.prototype,`_showSelectedRecordsShowSelectedAction`,null),e([f()],$.prototype,`_showSelectedRecordsShowAllAction`,null),e([f()],$.prototype,`_showZoomToSelectionAction`,null),e([f()],$.prototype,`_viewLayers`,null),e([f()],$.prototype,`attachmentsList`,void 0),e([f()],$.prototype,`direction`,null),e([f({readOnly:!0})],$.prototype,`grid`,null),e([f()],$.prototype,`actionColumn`,null),e([f()],$.prototype,`actionColumnConfig`,null),e([f({readOnly:!0})],$.prototype,`activeFilters`,null),e([f({readOnly:!0})],$.prototype,`activeSortOrders`,null),e([f()],$.prototype,`allColumns`,null),e([f()],$.prototype,`allColumnsVisible`,null),e([f({readOnly:!0})],$.prototype,`allRelatedTablesVisible`,null),e([f()],$.prototype,`allVisibleColumns`,null),e([f()],$.prototype,`attachmentsColumns`,null),e([f()],$.prototype,`attachmentsEnabled`,null),e([f()],$.prototype,`attachmentsViewOptions`,null),e([f({type:y})],$.prototype,`attributeTableTemplate`,null),e([f()],$.prototype,`autoRefreshEnabled`,null),e([f()],$.prototype,`autoSaveEnabled`,null),e([f()],$.prototype,`canAddRelatedFeature`,null),e([f()],$.prototype,`clearPrompt`,null),e([f()],$.prototype,`closed`,void 0),e([f()],$.prototype,`collapsed`,void 0),e([f()],$.prototype,`columnPerformanceModeEnabled`,null),e([f()],$.prototype,`columnReorderingEnabled`,null),e([f({readOnly:!0})],$.prototype,`columns`,null),e([f()],$.prototype,`columnVisibilityMenuConfig`,void 0),e([f()],$.prototype,`defaultSelectionManager`,null),e([f()],$.prototype,`definitionExpression`,null),e([f()],$.prototype,`description`,void 0),e([f()],$.prototype,`disabled`,void 0),e([f()],$.prototype,`editingEnabled`,null),e([f()],$.prototype,`effectiveSelectionManager`,null),e([f()],$.prototype,`effectiveSize`,null),e([f()],$.prototype,`effectiveTable`,null),e([f()],$.prototype,`effectiveTimeExtent`,null),e([f()],$.prototype,`fieldColumns`,null),e([f({types:m})],$.prototype,`filterGeometry`,null),e([f()],$.prototype,`filterBySelectionEnabled`,null),e([f()],$.prototype,`filterByViewExtent`,null),e([f()],$.prototype,`filterByLayerScaleRange`,null),e([f()],$.prototype,`groupColumns`,null),e([f()],$.prototype,`hasContingentValues`,null),e([f()],$.prototype,`hasInvalidPendingEdits`,null),e([f()],$.prototype,`hasPendingEdits`,null),e([f()],$.prototype,`hiddenFields`,null),e([f()],$.prototype,`highlightEnabled`,null),e([f()],$.prototype,`highlightIds`,null),e([f()],$.prototype,`icon`,null),e([f()],$.prototype,`initialSize`,null),e([f()],$.prototype,`isQueryingOrSyncing`,null),e([f()],$.prototype,`isSyncing`,null),e([f()],$.prototype,`isSyncingAttachments`,null),e([f()],$.prototype,`label`,null),e([f()],$.prototype,`layer`,null),e([f()],$.prototype,`layers`,null),e([f()],$.prototype,`layerView`,null),e([f()],$.prototype,`maxSize`,null),e([f(),B(`esri/widgets/FeatureTable/t9n/FeatureTable`)],$.prototype,`messages`,null),e([f(),B(`esri/t9n/common`)],$.prototype,`messagesCommon`,null),e([f(),B(`esri/widgets/Editor/t9n/Editor`)],$.prototype,`messagesEditor`,void 0),e([f(),B(`esri/core/t9n/Units`)],$.prototype,`messagesUnits`,null),e([f(),B(`esri/widgets/support/t9n/uriUtils`)],$.prototype,`messagesURIUtils`,null),e([f()],$.prototype,`menuConfig`,null),e([f()],$.prototype,`multipleSelectionEnabled`,null),e([f()],$.prototype,`multipleSelectionEnabledOverride`,null),e([f()],$.prototype,`multiSortEnabled`,null),e([f()],$.prototype,`multipleSortPriority`,null),e([f()],$.prototype,`navigationScale`,void 0),e([f()],$.prototype,`noDataMessage`,null),e([f()],$.prototype,`objectIds`,null),e([f()],$.prototype,`outFields`,null),e([f()],$.prototype,`pageCount`,null),e([f()],$.prototype,`pageIndex`,null),e([f()],$.prototype,`pageSize`,null),e([f()],$.prototype,`paginationEnabled`,null),e([f()],$.prototype,`pendingEditsCount`,null),e([f()],$.prototype,`prompt`,null),e([f()],$.prototype,`relatedRecordsEnabled`,null),e([f()],$.prototype,`relatedTable`,null),e([f()],$.prototype,`relatedTableHasContingentValues`,null),e([f()],$.prototype,`relatedTableHasInvalidPendingEdits`,null),e([f()],$.prototype,`relatedTableHasPendingEdits`,null),e([f()],$.prototype,`relatedTables`,null),e([f()],$.prototype,`relationship`,null),e([f()],$.prototype,`relationshipColumnConfigs`,null),e([f()],$.prototype,`relationshipColumns`,null),e([f()],$.prototype,`relationshipConfig`,null),e([f()],$.prototype,`relationshipInfos`,null),e([f()],$.prototype,`returnGeometryEnabled`,null),e([f()],$.prototype,`returnMEnabled`,null),e([f()],$.prototype,`returnZEnabled`,null),e([f()],$.prototype,`rowHighlightIds`,null),e([f()],$.prototype,`selectionManager`,null),e([f()],$.prototype,`selectionSource`,null),e([f()],$.prototype,`showAllRelatedTables`,null),e([f()],$.prototype,`showPrompt`,null),e([f()],$.prototype,`showRelatedTableCallback`,null),e([f()],$.prototype,`size`,null),e([f({readOnly:!0})],$.prototype,`state`,null),e([f()],$.prototype,`supportsAddAttachments`,null),e([f()],$.prototype,`supportsAttachments`,null),e([f()],$.prototype,`supportsDeleteAttachments`,null),e([f()],$.prototype,`supportsResizeAttachments`,null),e([f()],$.prototype,`supportsUpdateAttachments`,null),e([f()],$.prototype,`syncTemplateOnChangesEnabled`,null),e([f()],$.prototype,`syncViewSelection`,null),e([f()],$.prototype,`syncWithViewSelectionManager`,null),e([f({constructOnly:!0})],$.prototype,`tableController`,null),e([f({constructOnly:!0})],$.prototype,`tableParent`,null),e([f({type:M})],$.prototype,`tableTemplate`,null),e([f()],$.prototype,`tableTemplateOverride`,null),e([f()],$.prototype,`title`,void 0),e([f({type:b})],$.prototype,`timeExtent`,null),e([f()],$.prototype,`timeZone`,null),e([f()],$.prototype,`view`,null),e([f({type:O}),V([`cell-click`,`cell-dblclick`,`cell-pointerover`,`cell-pointerout`,`cell-keydown`,`column-reorder`,`show-related-table`])],$.prototype,`viewModel`,void 0),e([f()],$.prototype,`viewTimeEnabled`,null),e([f()],$.prototype,`visibleColumns`,null),e([f({type:k,nonNullable:!0})],$.prototype,`visibleElements`,void 0),e([f({type:k})],$.prototype,`visibleElementsOverride`,null),e([f()],$.prototype,`visibilityMenuColumns`,null),$=K=e([p(`esri.widgets.FeatureTable`)],$);const ee=$;export{ee as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as n}from"../core/arrayUtils.js";import{deprecateWidget as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{watch as a,sync as o,syncAndInitial as s,initial as c,on as l}from"../core/reactiveUtils.js";import{renderingSanitizer as u}from"../core/sanitizerUtils.js";import{formatFileSize as d}from"../core/unitFormatUtils.js";import{property as f,subclass as p}from"../core/accessorSupport/decorators.js";import{geometryTypes as m}from"../geometry/support/typeUtils.js";import{isLayerFromCatalog as h}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as g,isMapImageLayer as _,isSubtypeGroupLayer as v}from"../layers/support/layerUtils.js";import y from"../tables/AttributeTableTemplate.js";import b from"../time/TimeExtent.js";import x from"./Widget.js";import{isSupportedImage as S,getCalciteIconForAttachment as C,getAttachmentTypeCategory as w}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as T,Prompt as ee}from"./Editor/components/Prompt.js";import E from"./FeatureTable/ColumnMenuVisibleElements.js";import D from"./FeatureTable/FeatureTableViewModel.js";import O from"./FeatureTable/VisibleElements.js";import{isGroupColumn as k,isFieldColumn as A}from"./FeatureTable/support/columnUtils.js";import j from"./FeatureTable/support/TableTemplate.js";import{loadFieldColumnComponents as M,isIFeatureTableSupportedLayer as N,isIFeatureTableSupportedLayerWithAttachments as P,getRelationshipIdsToShow as F}from"./FeatureTable/support/tableUtils.js";import{createDropdownReference as I,loadCalciteComponents as L}from"./support/componentsUtils.js";import{globalCss as R}from"./support/globalCss.js";import{getIconForLayer as z}from"./support/iconUtils.js";import{messageBundle as B,vmEvent as V,tsx as H,tsxFragment as U}from"./support/widget.js";import{storeNode as W,discardNode as G}from"./support/widgetUtils.js";var K;const q=`esri-feature-table`,J=`${q}__dialog`,Y=`${q}__table-navigation`,X=`${q}__attachments-view`,Z={base:q,content:`${q}__content`,menuPopover:`${q}__menu-popover`,layerDropdownMenu:`${q}__layer-switcher-menu`,tableContainer:`${q}__table-container`,tableContainerWithAttachments:`${q}__table-container--attachments`,tableNavigation:Y,attachmentsView:X,attachmentsViewContent:`${X}__content`,attachmentsViewDetails:`${X}__details`,attachmentsViewDropArea:`${X}__drop-area`,attachmentsViewDropAreaLabel:`${X}__drop-area__label`,attachmentsViewDropAreaMessage:`${X}__drop-area__message`,attachmentsViewIcon:`${X}__icon`,attachmentsViewInformation:`${X}__information`,attachmentsViewInformationData:`${X}__information__data`,attachmentsViewInformationLabel:`${X}__information__label`,attachmentsViewList:`${X}__list`,attachmentsViewListFileSize:`${X}__list__filesize`,attachmentsViewListThumbnail:`${X}__list__thumbnail`,expanded:`${q}__expanded`,collapsed:`${q}__collapsed`,dialog:`${J}`,dialogContent:`${J}__content`,dialogHeader:`${J}__header`,footerMessage:`${q}__footer__message`,footerIconDanger:`${q}__footer__icon--danger`,footerIconSuccess:`${q}__footer__icon--success`},Q={checkCircle:`check-circle`,chevronRight:`chevron-right`,clearSelection:`clear-selection`,downloadTo:`download-to`,exclamationMarkTriangle:`exclamation-mark-triangle`,expand:`expand`,exportToCSV:`file-csv`,folderOpen:`folder-open`,delete:`trash`,layers:`layers`,moveUp:`move-up`,plus:`plus`,refresh:`refresh`,reset:`reset`,save:`save`,showAll:`selection-x`,showColumn:`show-column`,showSelected:`selection-filter`,table:`table`,upload:`upload`,zoomToSelection:`zoom-to-object`};let $=K=class extends x{constructor(e,t){super(e,t),this._layerDropdownReference=I(),this._attachmentsDialogPreviewLoading=!1,this._attachmentsInput=null,this._columnVisibilityActions=new Map,this._columnVisibilityList=null,this.attachmentsList=null,this.closed=!1,this.collapsed=!1,this.columnVisibilityMenuConfig=null,this.description=null,this.disabled=!1,this.messagesEditor=null,this.navigationScale=`m`,this.title=null,this.viewModel=new D,this.visibleElements=new O,this.announceDeprecation=()=>{r(i.getLogger(this),`Feature Table`,`arcgis-feature-table`,{version:`5.0`})},this._showDeleteSelectionPrompt=this._showDeleteSelectionPrompt.bind(this),this._showDiscardEditsPrompt=this._showDiscardEditsPrompt.bind(this),this._resetNestedViews=this._resetNestedViews.bind(this)}initialize(){this.addHandles([a(()=>[this.isQueryingOrSyncing,this.editingEnabled],()=>this.scheduleRender()),a(()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.columns.length],()=>{this.columns.forEach(e=>e.visibleElements=this._effectiveVisibleElements),this.refreshCellContent()},o),a(()=>[this.topLayerDisabled,this.columns],()=>this.columns.forEach(e=>e.topLayerDisabled=this.topLayerDisabled),s),a(()=>this._effectiveVisibleElements.selectionColumn,e=>{this.grid&&(this.grid.selectionColumnEnabled=e)},c),l(()=>this.viewModel,`show-related-table`,e=>this._onShowRelatedTable(e)),a(()=>this.editingEnabled,()=>{let{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)}),l(()=>this.effectiveTable,`column-reorder`,()=>this.scheduleRender())])}loadDependencies(){return Promise.all([L({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),alert:()=>import(`@esri/calcite-components/dist/components/calcite-alert`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),chip:()=>import(`@esri/calcite-components/dist/components/calcite-chip`),dialog:()=>import(`@esri/calcite-components/dist/components/calcite-dialog`),dropdown:()=>import(`@esri/calcite-components/dist/components/calcite-dropdown`),"dropdown-group":()=>import(`@esri/calcite-components/dist/components/calcite-dropdown-group`),"dropdown-item":()=>import(`@esri/calcite-components/dist/components/calcite-dropdown-item`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),pagination:()=>import(`@esri/calcite-components/dist/components/calcite-pagination`),panel:()=>import(`@esri/calcite-components/dist/components/calcite-panel`),popover:()=>import(`@esri/calcite-components/dist/components/calcite-popover`),progress:()=>import(`@esri/calcite-components/dist/components/calcite-progress`),switch:()=>import(`@esri/calcite-components/dist/components/calcite-switch`),tooltip:()=>import(`@esri/calcite-components/dist/components/calcite-tooltip`)}),T(),M()])}destroy(){this._layerDropdownReference.destroy(),this.drainRelatedTables(),this.clearPrompt()}get _attachmentsViewIsVisible(){return!!(this.attachmentsViewOptions.objectId!=null||this.relatedTables.some(e=>e.attachmentsViewOptions.objectId!=null))}get _columnVisibilityActionDisabled(){let e=this.effectiveTable;return e.menuConfig?.disabled??e.columns.length===0}get _dialogIsOpen(){return!!this.attachmentsViewOptions.dialogInfo}get _effectiveDescription(){let{description:e}=this;return e==null?void 0:u.sanitize(typeof e==`function`?e():e)}get _effectiveLayers(){let{layer:e,layers:t}=this,n=t?.length?t.filter(N):[],r=n.length?n:[...this._viewLayers];return e&&!r.includes(e)&&r.push(e),r}get _effectiveTitle(){let{layer:e,messages:n,state:r,highlightIds:i,title:a,size:o}=this;if(a)return u.sanitize(typeof a==`function`?a():a);if(!n)return``;if(!e)return n.noLayer;switch(r){case`disabled`:return n.errorLayer;case`ready`:case`loading`:return n.loading;case`error`:return n.errorData}return t(n.header,{title:u.sanitize(e.title),count:o,selected:i.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){let e=this.relatedTables.toArray(),t=e.length===1;return this.allRelatedTablesVisible?e:t?[e[0]]:this._attachmentsViewIsVisible?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return this.attachmentsViewOptions.error!=null}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showExportSelectionToCSVAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||this.relatedTables.length===1&&!this._attachmentsViewIsVisible}get _shouldShowMenu(){let{header:e,menu:t}=this._effectiveVisibleElements;return!!(e&&t&&(this._hasDefaultMenuItems||this._hasCustomMenuItems))}get _showClearSelectionAction(){return!!(this.effectiveTable.highlightIds.length&&this._effectiveVisibleElements.menuItems?.clearSelection&&!this._attachmentsViewIsVisible)}get _showColumnVisibilityAction(){let{columnVisibilityMenu:e,header:t,menu:n,menuItems:r}=this._effectiveVisibleElements;return!(!t||!n||!e||r?.toggleColumns===!1||this.showRelatedTableCallback||this.allRelatedTablesVisible||this._attachmentsViewIsVisible)}get _showDeleteSelectionAction(){return!!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete&&!this.relatedTables.length&&!this._attachmentsViewIsVisible)}get _showExportSelectionToCSVAction(){return!!(this._effectiveVisibleElements.menuItems.exportSelectionToCSV&&this.layer&&this.highlightIds.length&&!this.relatedTables.length)}get _showLayerDropdown(){return!!(this._effectiveLayers.length&&this._effectiveVisibleElements.layerDropdown)}get _shouldShowNavigationBar(){let e=!!this.relatedTable||this._attachmentsViewIsVisible;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){let e=this.objectIds.length,t=this.highlightIds.length;return!(!t||!this._effectiveVisibleElements.menuItems?.selectedRecordsShowSelectedToggle||e&&t===e||this.relatedTables.length||this._attachmentsViewIsVisible)}get _showSelectedRecordsShowAllAction(){return!!(this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle&&this.objectIds.length&&!this.relatedTables.length)}get _showZoomToSelectionAction(){let e=this.effectiveTable;return!!(e.view&&e.highlightIds.length&&!e.layer?.isTable&&this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){let e=this.view?.map;if(!e)return[];let t=new Set,n=e=>{N(e)&&!v(e)&&!t.has(e)&&(e.type!==`sublayer`||e.capabilities?.operations?.supportsQuery)&&(e.load().catch(()=>{}),t.add(e))},r=e=>{h(e)||e.type===`catalog-footprint`||(g(e)?(e.load().catch(()=>{}),e.layers?.forEach(n),e.tables?.forEach(n)):_(e)?(e.loadAll().catch(()=>{}),e.allSublayers?.forEach(n),e.subtables?.forEach(n)):v(e)?(e.loadAll().catch(()=>{}),e.sublayers?.forEach(n)):n(e))};return e.allLayers.forEach(r),e.allTables.forEach(r),[...t.values()]}get direction(){return this.viewModel.direction}set direction(e){this.viewModel.direction=e}get grid(){return this.viewModel.grid}get actionColumn(){return this.viewModel.actionColumn}get actionColumnConfig(){return this.viewModel.actionColumnConfig}set actionColumnConfig(e){this.viewModel.actionColumnConfig=e}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get allColumns(){return this.viewModel.allColumns}get allColumnsVisible(){return this.viewModel.allColumnsVisible}get allRelatedTablesVisible(){return this.viewModel.allRelatedTablesVisible}get allVisibleColumns(){return this.viewModel.allVisibleColumns}get attachmentsColumns(){return this.viewModel.attachmentsColumns}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get attachmentsViewOptions(){return this.viewModel.attachmentsViewOptions}set attachmentsViewOptions(e){this.viewModel.attachmentsViewOptions=e}get attributeTableTemplate(){return this.viewModel.attributeTableTemplate}set attributeTableTemplate(e){this.viewModel.attributeTableTemplate=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get autoSaveEnabled(){return this.viewModel.autoSaveEnabled}set autoSaveEnabled(e){this.viewModel.autoSaveEnabled=e}get canAddRelatedFeature(){return this.viewModel.canAddRelatedFeature}get clearPrompt(){return this.viewModel.clearPrompt}set clearPrompt(e){this.viewModel.clearPrompt=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get defaultSelectionManager(){return this.viewModel.defaultSelectionManager}get definitionExpression(){return this.viewModel.definitionExpression}set definitionExpression(e){this.viewModel.definitionExpression=e}get container(){return super.container}set container(e){super.container=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get effectiveSize(){return this.viewModel.effectiveSize}get effectiveTable(){return this.relatedTable||this}get effectiveTimeExtent(){return this.viewModel.effectiveTimeExtent}get fieldColumns(){return this.viewModel.fieldColumns}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get filterBySelectionEnabled(){return this.viewModel.filterBySelectionEnabled}set filterBySelectionEnabled(e){this.viewModel.filterBySelectionEnabled=e}get filterByViewExtent(){return this.viewModel.filterByViewExtent}set filterByViewExtent(e){this.viewModel.filterByViewExtent=e}get filterByLayerScaleRange(){return this.viewModel.filterByLayerScaleRange}set filterByLayerScaleRange(e){this.viewModel.filterByLayerScaleRange=e}get groupColumns(){return this.viewModel.groupColumns}get hasContingentValues(){return this.viewModel.hasContingentValues}get hasInvalidPendingEdits(){return this.viewModel.hasInvalidPendingEdits}get hasPendingEdits(){return this.viewModel.hasPendingEdits}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get icon(){return Q.table}set icon(e){this._overrideIfSome(`icon`,e)}get initialSize(){return this.viewModel.initialSize}set initialSize(e){this.viewModel.initialSize=e}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing}get isSyncing(){return this.viewModel.isSyncing}get isSyncingAttachments(){return this.viewModel.isSyncingAttachments}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get layerView(){return this.viewModel.layerView}get maxSize(){return this.viewModel.maxSize}set maxSize(e){this.viewModel.maxSize=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesUnits(){return this.viewModel.messagesUnits}set messagesUnits(e){this.viewModel.messagesUnits=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get menuConfig(){return this.viewModel.menuConfig}set menuConfig(e){this.viewModel.menuConfig=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multipleSelectionEnabledOverride(){return this.viewModel.multipleSelectionEnabledOverride}set multipleSelectionEnabledOverride(e){this.viewModel.multipleSelectionEnabledOverride=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get outFields(){return this.viewModel.outFields}set outFields(e){this.viewModel.outFields=e}get pageCount(){return this.viewModel.pageCount}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get pendingEditsCount(){return this.viewModel.pendingEditsCount}get prompt(){return this.viewModel.prompt}set prompt(e){this.viewModel.prompt=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.viewModel.relatedTable}get relatedTableHasContingentValues(){return this.viewModel.relatedTableHasContingentValues}get relatedTableHasInvalidPendingEdits(){return this.viewModel.relatedTableHasInvalidPendingEdits}get relatedTableHasPendingEdits(){return this.viewModel.relatedTableHasPendingEdits}get relatedTables(){return this.viewModel.relatedTables}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipColumns(){return this.viewModel.relationshipColumns}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get relationshipInfos(){return this.viewModel.relationshipInfos}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get returnMEnabled(){return this.viewModel.returnMEnabled}set returnMEnabled(e){this.viewModel.returnMEnabled=e}get returnZEnabled(){return this.viewModel.returnZEnabled}set returnZEnabled(e){this.viewModel.returnZEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=e}get showAllRelatedTables(){return this.viewModel.showAllRelatedTables}set showAllRelatedTables(e){this.viewModel.showAllRelatedTables=e}get showPrompt(){return this.viewModel.showPrompt}set showPrompt(e){this.viewModel.showPrompt=e}get showRelatedTableCallback(){return this.viewModel.showRelatedTableCallback}set showRelatedTableCallback(e){this.viewModel.showRelatedTableCallback=e}get size(){return this.viewModel.size}get state(){return this.viewModel.state}get supportsAddAttachments(){return this.viewModel.supportsAddAttachments}get supportsAttachments(){return this.viewModel.supportsAttachments}get supportsDeleteAttachments(){return this.viewModel.supportsDeleteAttachments}get supportsResizeAttachments(){return this.viewModel.supportsResizeAttachments}get supportsUpdateAttachments(){return this.viewModel.supportsUpdateAttachments}get syncTemplateOnChangesEnabled(){return this.viewModel.syncTemplateOnChangesEnabled}set syncTemplateOnChangesEnabled(e){this.viewModel.syncTemplateOnChangesEnabled=e}get syncViewSelection(){return this.viewModel.syncViewSelection}set syncViewSelection(e){this.viewModel.syncViewSelection=e}get syncWithViewSelectionManager(){return this.syncViewSelection}set syncWithViewSelectionManager(e){this.syncViewSelection=e}get tableController(){return this.viewModel.tableController}set tableController(e){this.viewModel.tableController=e}get tableParent(){return this.viewModel.tableParent}set tableParent(e){this.viewModel.tableParent=e}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get tableTemplateOverride(){return this.viewModel.tableTemplateOverride}set tableTemplateOverride(e){this.viewModel.tableTemplateOverride=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewTimeEnabled(){return this.viewModel.viewTimeEnabled}set viewTimeEnabled(e){this.viewModel.viewTimeEnabled=e}get visibleColumns(){return this.viewModel.visibleColumns}get visibleElementsOverride(){let{attachmentsViewOptions:e,relatedTable:t,tableController:n,visibleElements:r}=this,{columnDescriptions:i,columnMenus:a,tooltips:o}=r,s=e.objectId!=null;if(t)return new O({columnDescriptions:i,columnMenus:a,tooltips:o,close:r.close,header:r.header,layerDropdown:r.layerDropdown,layerDropdownIcons:r.layerDropdownIcons,menu:r.menu,menuItems:r.menuItems,progress:r.progress,selectionColumn:!1,columnMenuItems:new E({sortAscending:!1,sortDescending:!1})});if(n){let e=n.relatedTable===this,t=n.allRelatedTablesVisible,c=e&&r.selectionColumn&&!t&&!s,l=e&&!t&&!s;return new O({columnDescriptions:i,columnMenus:a,tooltips:o,selectionColumn:c,close:!1,header:!1,layerDropdown:!1,menu:!1,pendingEditsFooter:!1,progress:!1,columnMenuItems:new E({sortAscending:l,sortDescending:l})})}return s?new O({columnDescriptions:i,columnMenus:a,tooltips:o,close:r.close,header:r.header,layerDropdown:r.layerDropdown,layerDropdownIcons:r.layerDropdownIcons,menu:r.menu,menuItems:r.menuItems,progress:r.progress,selectionColumn:!1,columnMenuItems:new E({sortAscending:!1,sortDescending:!1})}):null}addPendingEdits(e){this.viewModel.addPendingEdits(e)}clearSelection(){this.effectiveTable.viewModel.clearSelection()}async deleteAttachments(e,t,n){e!=null&&t?.length&&(n?this._showDeleteAttachmentPrompt(e,t):await this.viewModel.deleteAttachments(e,t))}async deleteSelection(e){this.highlightIds.length&&(e?this._showDeleteSelectionPrompt():await this.viewModel.deleteSelection())}async discardPendingEdits(e,t){return t?this._showDiscardEditsPrompt(e):this.viewModel.discardPendingEdits(e)}async downloadAttachmentById(e,t){return this.viewModel.downloadAttachmentById(e,t)}drainRelatedTables(){this.viewModel.drainRelatedTables()}async exportSelectionToCSV(e){return this.viewModel.exportSelectionToCSV(e)}findColumn(e){return this.viewModel.findColumn(e)}getFeatureStoreItemByObjectId(e){return this.viewModel.getFeatureStoreItemByObjectId(e)}goToPage(e){this.viewModel.goToPage(e)}hideAllColumns(){this.viewModel.hideAllColumns()}hideColumn(e){this.grid?.hideColumn(e)}nextPage(){this.viewModel.nextPage()}previousPage(){this.viewModel.previousPage()}async refresh(){await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}async saveAttachmentsViewForm(){await this.viewModel.saveAttachmentsViewForm()}async savePendingEdits(){await this.viewModel.savePendingEdits()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollLeft(){this.viewModel.scrollLeft()}scrollToBottom(){this.viewModel.scrollToBottom()}scrollToIndex(e){this.viewModel.scrollToIndex(e)}scrollToRow(e){this.viewModel.scrollToRow(e)}scrollToTop(){this.viewModel.scrollToTop()}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}get visibilityMenuColumns(){let e=this.effectiveTable.columns;return this.columnVisibilityMenuConfig?.frozenColumnsExcluded?e.filter(e=>!e.frozen&&!e.frozenToEnd).toArray():e.toArray()}async zoomToSelection(){return this.effectiveTable.viewModel.zoomToSelection()}render(){let{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:n,state:r}=this;return H(`div`,{bind:this,class:this.classes(Z.base,R.widget)},H(`calcite-panel`,{bind:this,class:Z.content,closable:e.close,closed:this.closed,collapsed:this.collapsed,collapsible:e.collapse,description:this._effectiveDescription,dir:this.direction,disabled:this.disabled||r===`disabled`&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,key:`table-content`,loading:r===`loading`,menuOpen:!!n?.open,overlayPositioning:`fixed`,onCalcitePanelClose:()=>{this.closed=!0,this.emit(`close`)},onCalcitePanelToggle:e=>{this.collapsed=e.target.collapsed,this.emit(`toggle`)}},e.progress?H(`calcite-progress`,{type:t?`indeterminate`:`determinate`}):null,this._showLayerDropdown?this._renderLayerDropdown():null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderNavigationBar(),this._renderTables(),this._renderError(),this._renderFooterContent()),this._renderColumnVisibilityPopover(),this._renderPrompt(),this._renderDialog())}_renderTables(){let{grid:e,relatedTables:t}=this,n=this.classes(Z.tableContainer);if(t.length){let r=this.classes(Z.base,this.allRelatedTablesVisible?Z.expanded:Z.collapsed,this._attachmentsViewIsVisible?Z.tableContainerWithAttachments:void 0);return H(`div`,{class:n},H(`calcite-panel`,{overlayPositioning:`fixed`},H(`div`,null,[this._shouldShowGrid?H(`div`,{class:r},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map(e=>{let n=t.indexOf(e);return H(`div`,{class:r,key:`related-${n}`},e.render())}),,])))}return this.attachmentsViewOptions.objectId==null?[H(`div`,{class:n},e?.render()),this._renderPagination()]:H(`div`,{class:n},H(`calcite-panel`,{overlayPositioning:`fixed`},H(`div`,null,[H(`div`,{class:this.classes(Z.base,Z.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()])))}_renderPagination(){if(this.paginationEnabled)return H(`calcite-pagination`,{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>{this._attachmentsDialogPreviewLoading=!1,this.goToPage(e.currentTarget.startItem-1)}})}_renderError(){let{messages:e}=this;return H(`calcite-alert`,{autoClose:!0,autoCloseDuration:`fast`,icon:Q.exclamationMarkTriangle,kind:`danger`,label:e.errorOccured,open:this._hasAttachmentsViewError,slot:`alerts`,topLayerDisabled:this.topLayerDisabled,onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},H(`span`,{slot:`message`},e.errorOccured))}_renderFooterContent(){if(!this.hasPendingEdits||!this._effectiveVisibleElements.pendingEditsFooter)return;let{hasInvalidPendingEdits:e,isQueryingOrSyncing:t,messages:n,messagesCommon:r}=this,i=e||t,a=this.hasContingentValues,o=[H(`calcite-button`,{appearance:`outline`,disabled:t,iconStart:Q.reset,key:`footer-reset-button`,slot:`footer-end`,width:`auto`,onclick:()=>void this.discardPendingEdits()},r.reset),H(`calcite-button`,{disabled:i,iconStart:Q.save,key:`footer-save-button`,loading:this.isSyncing,slot:`footer-end`,width:`auto`,onclick:()=>{this.savePendingEdits()}},r.save)];if(a){let t=e?n.contingentValues.hasInvalidValues:n.contingentValues.hasValidValues,r=e?Q.exclamationMarkTriangle:Q.checkCircle,i=e?Z.footerIconDanger:Z.footerIconSuccess;o.push(H(`div`,{class:Z.footerMessage,key:`footer-message`,slot:`footer-start`},H(`calcite-icon`,{class:i,icon:r,scale:`s`,slot:`footer-start`}),t))}return o}_renderPrompt(){return this.prompt?H(ee,{...this.prompt,headingLevel:2}):void 0}_showDeleteSelectionPrompt(){let{messages:e,messagesCommon:n}=this,r=t(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:r,message:e.deleteRecordsRemoved,context:`danger`,actions:{primary:{label:n.delete,action:async()=>{try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,n){let{messages:r,messagesCommon:i}=this,a=t(r.deleteAttachmentCount,{count:n.length});this.showPrompt({title:a,message:r.deleteAttachmentConfirmation,context:`danger`,actions:{primary:{label:i.delete,action:async()=>{try{await this.deleteAttachments(e,n,!1)}finally{this.clearPrompt()}}},secondary:{label:i.cancel,action:()=>this.clearPrompt()}}})}async _showDiscardEditsPrompt(e){let t=Promise.withResolvers(),{messagesEditor:n}=this;return this.showPrompt({title:n.cancelEditTitle,message:n.cancelEditWarningMessage,context:`danger`,actions:{primary:{label:n.discardEdits,action:async()=>{try{await this.discardPendingEdits(e)}finally{t.resolve(!0)}}},secondary:{label:n.continueEditing,action:()=>t.resolve(!1)}}}),t.promise.finally(()=>this.clearPrompt())}_onTableViewChange(e){this.hasPendingEdits?this._showDiscardEditsPrompt().then(t=>t&&e()):e()}_resetNestedViews(){this.relatedTable&&this.drainRelatedTables(),this.effectiveTable.attachmentsViewOptions.objectId=null}_renderDialog(){let{attachmentsViewOptions:e,messages:t}=this,{objectId:n}=e;return H(`calcite-dialog`,{class:Z.dialog,description:this.viewModel.getFeatureTitleSync(n),heading:t.attachments,modal:!0,open:this._dialogIsOpen,placement:`cover`,width:`l`,onCalciteDialogClose:()=>this._onDialogClose()},this._renderDialogContent())}_renderDialogContent(){let e=this.attachmentsViewOptions.dialogInfo;if(e)return this._renderAttachmentsDialogContent(e)}_renderAttachmentsDialogContent(e){let{attachmentsViewOptions:t,messages:n}=this,{attachmentInfos:r}=t,i=r.indexOf(e);return H(U,null,H(`div`,{class:Z.dialogHeader,key:`header`,slot:`content-top`},H(`span`,null,e.name),H(`calcite-button`,{appearance:`outline`,onclick:()=>{t.attachmentId=e.id,t.dialogId=null}},n.viewDetails)),H(`calcite-progress`,{type:this._attachmentsDialogPreviewLoading?`indeterminate`:`determinate`}),H(`div`,{class:Z.dialogContent,key:`content`},this._renderAttachmentsViewDetailsImage(e)),H(`calcite-pagination`,{pageSize:1,slot:`footer`,startItem:i+1,totalItems:r.length,onCalcitePaginationChange:e=>{let n=e.currentTarget.startItem-1,i=r[n]?.id;t.dialogId=i}}))}_onDialogClose(){let e=this.attachmentsViewOptions;e.dialogId!=null&&(e.dialogId=null),this._attachmentsDialogPreviewLoading=!1}_renderHeaderMenuAction(e){let{disabled:t,hidden:n,icon:r,text:i,clickFunction:a}=e;if(!n)return H(`calcite-action`,{disabled:t??this.menuConfig?.disabled,icon:r??void 0,key:i,slot:`header-menu-actions`,text:i,textEnabled:!0,title:i,onclick:()=>a()})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];let{messages:e}=this;return[this._showRefreshDataAction&&{icon:Q.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:Q.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:Q.clearSelection,text:e.clearSelection,clickFunction:()=>this.clearSelection()},this._showZoomToSelectionAction&&{icon:Q.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:Q.showSelected,text:e.showSelected,clickFunction:()=>{let{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:Q.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:Q.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(n).map(e=>e&&this._renderHeaderMenuAction(e))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map(({disabled:e,hidden:t,icon:n,label:r,clickFunction:i})=>this._renderHeaderMenuAction({hidden:typeof t==`function`?t():t,icon:n,text:r,disabled:typeof e==`function`?e():e,clickFunction:e=>i(e)}))??[]}_renderColumnVisibilityAction(){if(!this._showColumnVisibilityAction)return[];let{_columnVisibilityActions:e,id:t}=this,n=this.messages.menuText.columnVisibility;return H(`calcite-action`,{afterCreate:n=>e.set(t,n),afterRemoved:()=>e.delete(t),bind:this,disabled:this._columnVisibilityActionDisabled,icon:Q.showColumn,id:`${t}__toggle-columns-action`,slot:`header-actions-end`,text:n},this._effectiveVisibleElements.tooltips?H(`calcite-tooltip`,{closeOnClick:!0,overlayPositioning:`fixed`,placement:`bottom-end`,referenceElement:e.get(t),topLayerDisabled:this.topLayerDisabled},n):null)}_renderColumnVisibilityPopover(){if(!this._showColumnVisibilityAction||this._columnVisibilityActionDisabled)return;let e=this.visibleElements.columnVisibilityMenuItems.header,t=this.messages.menuText.columnVisibility;return H(`calcite-popover`,{autoClose:!0,class:Z.menuPopover,closable:e,heading:e?t:void 0,label:t,overlayPositioning:`fixed`,placement:this.columnVisibilityMenuConfig?.placement,referenceElement:this._columnVisibilityActions.get(this.id),topLayerDisabled:this.topLayerDisabled},this._renderColumnVisibilityList())}_renderColumnVisibilityList(){let{visibilityMenuColumns:e,messages:{menuText:t}}=this;if(e.length!==0)return H(`calcite-list`,{afterCreate:W,afterRemoved:G.bind(this),afterUpdate:W,bind:this,"data-node-ref":`_columnVisibilityList`,dir:this.direction,displayMode:`nested`,filterEnabled:this.visibleElements.columnVisibilityMenuItems.filter,filterPlaceholder:t.searchFields,label:t.fieldVisibility,selectionMode:`multiple`,onCalciteListChange:()=>this._syncColumnVisibility(),onCalciteListFilter:()=>this.scheduleRender()},this._renderColumnToggleAll(),e.map(e=>{let t=k(e)?e.columns?.map(e=>this._renderColumnListItem({column:e})):void 0;return this._renderColumnListItem({column:e,items:t})}),H(`calcite-notice`,{appearance:`transparent`,kind:`neutral`,open:!0,slot:`filter-no-results`},H(`div`,{slot:`message`},t.noMatchesFound)))}_syncColumnVisibility(){let{effectiveTable:e,_columnVisibilityList:t}=this;if(!t)return;let n=new Set(t.selectedItems.map(e=>e.value)),r=!!this.columnVisibilityMenuConfig?.frozenColumnsExcluded;e.allColumns.forEach(t=>{r&&(t.frozen||t.frozenToEnd)||(n.has(t.fieldName)?e.showColumn(t.fieldName):e.hideColumn(t.fieldName))})}_renderColumnToggleAll(){if(!this.visibleElements.columnVisibilityMenuItems.toggleAll)return;let{_columnVisibilityList:e}=this;if(e&&e.filteredItems?.length)return H(`calcite-button`,{appearance:`transparent`,width:`full`,onclick:()=>this._toggleAllColumns()},this._getColumnToggleAllText())}_getColumnToggleAllText(){let{_columnVisibilityList:e,effectiveTable:t,messages:{menuText:n}}=this;return e?e.filterText===``?t.allColumnsVisible?n.deselectAll:n.selectAll:this._allColumnsAreVisible(e.filteredItems.map(e=>e.value))?n.deselectAll:n.selectAll:``}_renderColumnListItem(e){let{column:t,items:n}=e,{effectiveLabel:r,fieldName:i,hidden:a}=t,o=!(!n?.length||a)||void 0;return H(`calcite-list-item`,{expanded:o,key:`toggle-columns__item-${i}`,label:r,metadata:{description:t.effectiveDescription,type:A(t)?t.field.type:void 0},selected:!a,value:i},n)}_renderLayerDropdown(){let e=this.messages.selectALayer,{storeTrigger:t,destroy:n,referenceTrigger:r}=this._layerDropdownReference;return H(`div`,{class:Z.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:`header-actions-start`},H(`calcite-action`,{afterCreate:t,afterRemoved:n,afterUpdate:t,icon:Q.layers,text:e,title:e}),H(`calcite-dropdown`,{afterCreate:r,afterUpdate:r,bind:this,maxItems:5,overlayPositioning:`fixed`,placement:`bottom-start`,topLayerDisabled:this.topLayerDisabled},H(`calcite-dropdown-group`,{selectionMode:`single`},this._effectiveLayers.map((e,t)=>this._renderLayerDropdownItem(e,t))??null)))}_renderLayerDropdownItem(e,t){let n=this.visibleElements.layerDropdownIcons;return H(`calcite-dropdown-item`,{iconStart:n?z(e):void 0,key:`dropdown-item-${t}`,label:e.title??``,selected:e===this.layer,value:e.id,onCalciteDropdownItemSelect:()=>this._onTableViewChange(()=>this.layer=e)},e.title)}_onRelatedNavigationItemClick(e){this.viewModel.drainRelatedTablesAboveIndex(e)}_collapseRelatedTable(e){this.viewModel.collapseRelatedTable(this.effectiveTable,e)}_onShowRelatedTable(e){this.showRelatedTableCallback||this.hasPendingEdits||(this._collapseRelatedTable(e),this._createRelatedTable(e))}async _createRelatedTable(e){let{autoRefreshEnabled:t,autoSaveEnabled:n,direction:r,editingEnabled:i,effectiveTable:a,multipleSelectionEnabled:o,paginationEnabled:s,pageSize:c,view:l,viewModel:u}=this,{layer:d,objectId:f,relatedLayer:p,relationshipId:m}=e;await d.load();let h=this.attachmentsEnabled&&P(d),g=new K({layer:d,autoRefreshEnabled:t,autoSaveEnabled:n,attachmentsEnabled:h,direction:r,editingEnabled:i,multipleSelectionEnabled:o,paginationEnabled:s,pageSize:c,relatedRecordsEnabled:!0,relationshipConfig:{objectId:f,relatedLayer:p,relationshipId:m},relationshipColumnConfigs:F(d,m),tableController:this,tableParent:a,view:l,showRelatedTableCallback:e=>u.emit(`show-related-table`,e)});this.relatedTables.add(g),this.scheduleRender()}_renderAttachmentsView(){switch(this.attachmentsViewOptions.effectiveMode){case`list`:return this._renderAttachmentsViewList();case`details`:return this._renderAttachmentsViewDetails();case`file`:return this._renderAttachmentsViewFile()}}_renderAttachmentsViewFile(){let e=this.attachmentsViewOptions,{objectId:t}=e;if(t!=null)return[H(`div`,{class:Z.attachmentsView,key:`attachments-view`},this._renderAttachmentsViewInformation(),H(`div`,{class:Z.attachmentsViewContent,key:`attachments-view-content`},H(`div`,{bind:this,class:Z.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},H(`calcite-icon`,{class:Z.attachmentsViewIcon,icon:Q.upload,scale:`l`}),this._renderAttachmentsViewFileLabelNode(),this._renderAttachmentsViewFileMessageNode(),H(`form`,{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:`attachments-form`},H(`fieldset`,null,this._renderAttachmentsViewFileNameNode(),H(`input`,{afterCreate:W,afterRemoved:G,afterUpdate:W,bind:this,"data-node-ref":`_attachmentsInput`,files:e.candidates,hidden:!0,name:`attachment`,type:`file`,onchange:e=>this._onAttachmentsViewCandidateChange(e)}),this._renderAttachmentsViewFileSelectNode(),this._renderAttachmentsViewFileSaveNode(),this._renderAttachmentsViewFileCancelNode())))))]}_renderAttachmentsViewFileLabelNode(){if(this.attachmentsViewOptions.fileMode===`replace`)return H(`span`,{class:Z.attachmentsViewDropAreaLabel,key:`replace-file-node`},this.messages.replaceFile)}_renderAttachmentsViewFileMessageNode(){let e=this.attachmentsViewOptions;if(e.hasCandidates)return;let{messages:t}=this,n=this.supportsAddAttachments?e.objectId==null?t.noFeature:t.dragAndDropToUpload:t.editingRestricted;return H(`span`,{class:Z.attachmentsViewDropAreaMessage,key:`message-node`},n)}_renderAttachmentsViewFileNameNode(){let e=this.attachmentsViewOptions.candidates,t=Array.from(e??[]).at(-1);if(t)return H(`span`,{class:Z.attachmentsViewDropAreaMessage,key:`filename-node`},t.name)}_renderAttachmentsViewFileSelectNode(){if(this.supportsAddAttachments)return H(`calcite-button`,{appearance:`outline-fill`,disabled:this.isSyncingAttachments,iconStart:Q.folderOpen,key:`select-node`,onclick:()=>{this._resetAttachmentsInput(),this._attachmentsInput?.click()}},this.messages.selectFile)}_renderAttachmentsViewFileSaveNode(){let{isSyncingAttachments:e,messages:t}=this,{attachmentInfo:n,hasCandidates:r}=this.attachmentsViewOptions;if(this.supportsAddAttachments&&r)return H(`calcite-button`,{appearance:`solid`,disabled:e,iconStart:Q.save,key:`save-node`,loading:e,onclick:()=>{this.saveAttachmentsViewForm()}},n?t.updateAttachment:t.addAttachment)}_renderAttachmentsViewFileCancelNode(){let{hasAttachments:e,hasCandidates:t}=this.attachmentsViewOptions;if(e||t)return H(`calcite-button`,{appearance:`transparent`,bind:this,disabled:this.isSyncingAttachments,key:`cancel-node`,onclick:()=>{this._resetAttachmentsInput(),this.attachmentsViewOptions.cancel()}},this.messagesCommon.cancel)}_renderAttachmentsViewDetails(){let{attachmentInfo:e}=this.attachmentsViewOptions;if(e)return[H(`div`,{class:Z.attachmentsView,key:`attachments-view`},this._renderAttachmentsViewInformation(),H(`div`,{class:Z.attachmentsViewContent,key:`attachments-view-content`},H(`div`,{class:Z.attachmentsViewDetails},this._renderAttachmentsViewDetailsPreview(e))))]}_renderAttachmentsViewDetailsPreview(e){let t=[this._renderAttachmentsViewDetailsImage(e)];if(S(e.contentType)){let n=this.messages.maximize;t.push(H(`calcite-action`,{icon:Q.expand,label:n,text:n,textEnabled:!0,title:n,onclick:t=>{t.preventDefault(),this.attachmentsViewOptions.dialogId=e.id}}))}return t}_renderAttachmentsViewDetailsImage(e){let{contentType:t,name:n,size:r,url:i}=e,{messages:a}=this;return S(t)?H(`img`,{afterCreate:()=>this._attachmentsDialogPreviewLoading=!0,alt:n,key:`thumbnail-image-${n}`,src:`${i}${i?.includes(`?`)?`&`:`?`}s=${r}`,title:n,onerror:()=>this._attachmentsDialogPreviewLoading=!1,onload:()=>this._attachmentsDialogPreviewLoading=!1}):[H(`calcite-icon`,{icon:C(t),key:`thumbnail-icon-${n}`,scale:`l`,textLabel:n,title:n}),a.noPreviewAvailable]}_renderAttachmentsViewInformation(){let{attachmentsViewOptions:e,messages:t,messagesUnits:n}=this,{attachmentInfo:r,objectId:i}=e;if(r&&i!=null)return H(`div`,{class:Z.attachmentsViewInformation,key:`information`},this._renderAttachmentViewInformationButtons(r,i),H(`span`,{class:Z.attachmentsViewInformationLabel,key:`file-label`},t.fileName),H(`span`,{class:Z.attachmentsViewInformationData,key:`file-value`},r.name),H(`span`,{class:Z.attachmentsViewInformationLabel,key:`type-label`},t.attachmentType),H(`span`,{class:Z.attachmentsViewInformationData,key:`type-value`},this._getLabelForAttachmentType(r)),this._renderAttachmentKeywordDetails(r),H(`span`,{class:Z.attachmentsViewInformationLabel,key:`size-label`},t.size),H(`span`,{class:Z.attachmentsViewInformationData,key:`size-span`},d(n,r.size??0)))}_renderAttachmentViewInformationButtons(e,t){let{attachmentsViewOptions:n,messages:r,messagesCommon:i}=this,a=n.effectiveMode!==`details`,o=e.id,s=[H(`calcite-button`,{appearance:`outline`,disabled:a,key:`download-button`,width:`full`,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(t,o)}},r.download)];return this.supportsUpdateAttachments&&s.push(H(`calcite-button`,{appearance:`outline`,disabled:a,key:`replace-button`,width:`full`,onclick:()=>{n.mode=`file`,n.attachmentId=o}},r.replace)),this.supportsDeleteAttachments&&s.push(H(`calcite-button`,{appearance:`outline`,disabled:a,key:`delete-button`,width:`full`,onclick:()=>{this.deleteAttachments(t,[o],!0)}},i.delete)),s}_renderAttachmentKeywordDetails({keywords:e}){if(e&&e!==``)return[H(`span`,{class:Z.attachmentsViewInformationLabel,key:`keyword-label`},this.messages.keyword),H(`span`,{class:Z.attachmentsViewInformationData,key:`keyword-value`},e)]}_renderAttachmentsViewList(){let{attachmentsViewOptions:e,isSyncingAttachments:t,messages:n,messagesUnits:r}=this,{attachmentInfos:i,objectId:a}=e;return H(`calcite-list`,{afterCreate:W,afterRemoved:G,afterUpdate:W,bind:this,class:Z.attachmentsViewList,"data-node-ref":`attachmentsList`,key:`attachments-list-${a}`,label:n?.attachments,loading:t,selectionMode:this.supportsDeleteAttachments?`multiple`:`none`,onCalciteListChange:()=>this.scheduleRender(),ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},...i?.map(t=>{let{id:i,name:o,size:s}=t,c=d(r,s??0);return H(`calcite-list-item`,{afterRemoved:()=>this.scheduleRender(),key:`attachment-${i}`,label:o,value:i},this._renderAttachmentsViewListPreview(t),H(`span`,{class:Z.attachmentsViewListFileSize,slot:`actions-end`,title:c},c),H(`calcite-action`,{icon:Q.downloadTo,key:`download`,label:o,slot:`actions-end`,text:n.downloadAttachment,title:n.downloadAttachment,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(a??-1,i)}}),H(`calcite-action`,{icon:Q.chevronRight,iconFlipRtl:!0,key:`details`,label:o,slot:`actions-end`,text:n.viewAttachment,title:n.viewAttachment,onclick:()=>{e.mode=`details`,e.attachmentId=i}}))}))}_renderAttachmentsViewListPreview(e){return H(`div`,{class:Z.attachmentsViewListThumbnail,slot:`content-start`},H(`span`,null,this._renderAttachmentsViewListImage(e)))}_renderAttachmentsViewListImage(e,t=64){let{contentType:n,name:r,size:i,url:a}=e,o=`${a}${a?.includes(`?`)?`&`:`?`}w=${t}&s=${i}`;return this.supportsResizeAttachments&&S(n)?H(`img`,{alt:r,key:`thumbnail-image-${r}`,src:o,title:r}):H(`calcite-icon`,{icon:C(n),key:`thumbnail-icon-${r}`,scale:`l`,textLabel:r,title:r})}_onAttachmentsViewCandidateChange({target:e}){this.attachmentsViewOptions.candidates=e?.files}_onAttachmentsViewDrop(e){e.preventDefault(),(this.supportsAddAttachments||this.supportsUpdateAttachments)&&(this.attachmentsViewOptions.mode=`file`,this.attachmentsViewOptions.candidates=e.dataTransfer?.files)}_resetAttachmentsInput(){this._attachmentsInput&&(this._attachmentsInput.value=``)}_getLabelForAttachmentType({contentType:e}){let t=this.messages,n=w(e);return t.attachmentTypes[n]}_renderNavigationBar(){let{effectiveTable:e,messages:n,messagesCommon:r,navigationScale:i,relatedTable:a,relatedTables:o}=this;if(!this._shouldShowNavigationBar)return;let{attachmentsList:s,attachmentsViewOptions:c,layer:l,supportsAddAttachments:u,supportsDeleteAttachments:d}=e;if(!l)return;let{attachmentInfos:f,objectId:p}=c,m=p!=null,h=f.length,g=s?.selectedItems?.length??0,_=`${l.objectIdField}: ${p}`,v=t(n.selectedCount,{count:g}),y=t(n.attachmentsCount,{count:h}),b=m?H(`calcite-action`,{bind:this,icon:Q.chevronRight,iconFlipRtl:!0,key:`navigation-feature`,scale:i,text:_,textEnabled:!0,title:_,onclick:()=>e.scrollToRow(p)}):void 0,x=m?H(`calcite-action`,{icon:Q.chevronRight,iconFlipRtl:!0,key:`navigation-attachments-label`,label:y,scale:i,text:y,textEnabled:!0,title:y,onclick:()=>{h>0&&(c.mode=`list`)}}):void 0,S=m?H(`calcite-chip`,{closable:!0,closed:g===0,key:`navigation-chip`,kind:`inverse`,label:v,scale:`s`,selected:!0,title:v,value:`selected`,onCalciteChipClose:()=>s?.selectedItems?.forEach(e=>e.selected=!1)},v):void 0,C=a?H(`calcite-label`,{layout:`inline`,scale:i},n.showAllTables,H(`calcite-switch`,{checked:this.allRelatedTablesVisible,scale:i,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,w=m&&c.effectiveMode===`list`&&p!=null&&g&&d?H(`calcite-action`,{icon:Q.delete,iconFlipRtl:!0,key:`attachments-trash-all`,scale:i,text:r.delete,textEnabled:!0,title:t(n.deleteAttachmentCount,{count:g}),onclick:()=>{e.deleteAttachments(p,s?.selectedItems?.map(e=>e.value)??[],!0)}}):void 0,T=m&&c.effectiveMode===`list`&&u?H(`calcite-action`,{bind:this,icon:Q.plus,iconFlipRtl:!0,key:`attachments-add`,scale:i,text:n.addAttachment,textEnabled:!0,title:n.addAttachment,onclick:()=>{c.objectId=p,c.attachmentId=null,c.mode=`file`}}):void 0;return H(`div`,{class:Z.tableNavigation,key:`table-nav`},H(`calcite-action`,{icon:Q.moveUp,iconFlipRtl:!0,key:`go-back`,scale:i,text:this.layer?.title??``,textEnabled:!1,title:a?n.exitRelatedRecords:n.exitAttachments,onclick:()=>this._onTableViewChange(this._resetNestedViews)}),o.toArray().map((e,t)=>this._renderRelatedTableNavigationAction(e,t)),b,x,H(`div`,null,S,C,w,T))}_renderRelatedTableNavigationAction(e,t){let n=this._getLabelForRelatedTableNavigationAction(e);return H(`calcite-action`,{icon:Q.chevronRight,iconFlipRtl:!0,key:t,scale:this.navigationScale,text:n,textEnabled:!0,title:e.layer?.title||``,onclick:()=>{(t!==this.relatedTables.length-1||this._attachmentsViewIsVisible)&&this._onTableViewChange(()=>this._onRelatedNavigationItemClick(t))}})}_getLabelForRelatedTableNavigationAction(e){let t=e.layer?.title;if(!t)return``;let{relatedTables:n}=this;return n.length<=1?t:n.indexOf(e)!==n.length-1&&t.length>20?`${t.slice(0,20)}...`:t}_allColumnsAreVisible(e){let t=this.columnVisibilityMenuConfig;return e.every(e=>{let n=this.findColumn(e);return n?t?.frozenColumnsExcluded&&(n.frozen||n.frozenToEnd)?!0:n.effectiveVisible:!1})}_toggleAllColumns(){let{_columnVisibilityList:e,effectiveTable:t}=this,n=e?.filteredItems.map(e=>e.value);e?.filterText!==``&&n?.length?this._allColumnsAreVisible(n)?n.forEach(e=>this.hideColumn(e)):n.forEach(e=>this.showColumn(e)):t.allColumnsVisible?t.visibilityMenuColumns.forEach(e=>t.hideColumn(e.fieldName)):t.visibilityMenuColumns.forEach(e=>t.showColumn(e.fieldName))}};e([f()],$.prototype,`_attachmentsDialogPreviewLoading`,void 0),e([f()],$.prototype,`_attachmentsInput`,void 0),e([f()],$.prototype,`_attachmentsViewIsVisible`,null),e([f()],$.prototype,`_columnVisibilityActions`,void 0),e([f()],$.prototype,`_columnVisibilityActionDisabled`,null),e([f()],$.prototype,`_columnVisibilityList`,void 0),e([f()],$.prototype,`_dialogIsOpen`,null),e([f()],$.prototype,`_effectiveDescription`,null),e([f()],$.prototype,`_effectiveLayers`,null),e([f()],$.prototype,`_effectiveTitle`,null),e([f()],$.prototype,`_effectiveVisibleElements`,null),e([f()],$.prototype,`_filteredTables`,null),e([f()],$.prototype,`_hasAttachmentsViewError`,null),e([f()],$.prototype,`_hasCustomMenuItems`,null),e([f()],$.prototype,`_hasDefaultMenuItems`,null),e([f()],$.prototype,`_shouldShowGrid`,null),e([f()],$.prototype,`_shouldShowMenu`,null),e([f()],$.prototype,`_showClearSelectionAction`,null),e([f()],$.prototype,`_showColumnVisibilityAction`,null),e([f()],$.prototype,`_showDeleteSelectionAction`,null),e([f()],$.prototype,`_showExportSelectionToCSVAction`,null),e([f()],$.prototype,`_showLayerDropdown`,null),e([f()],$.prototype,`_shouldShowNavigationBar`,null),e([f()],$.prototype,`_showRefreshDataAction`,null),e([f()],$.prototype,`_showSelectedRecordsShowSelectedAction`,null),e([f()],$.prototype,`_showSelectedRecordsShowAllAction`,null),e([f()],$.prototype,`_showZoomToSelectionAction`,null),e([f()],$.prototype,`_viewLayers`,null),e([f()],$.prototype,`attachmentsList`,void 0),e([f()],$.prototype,`direction`,null),e([f({readOnly:!0})],$.prototype,`grid`,null),e([f()],$.prototype,`actionColumn`,null),e([f()],$.prototype,`actionColumnConfig`,null),e([f({readOnly:!0})],$.prototype,`activeFilters`,null),e([f({readOnly:!0})],$.prototype,`activeSortOrders`,null),e([f()],$.prototype,`allColumns`,null),e([f()],$.prototype,`allColumnsVisible`,null),e([f({readOnly:!0})],$.prototype,`allRelatedTablesVisible`,null),e([f()],$.prototype,`allVisibleColumns`,null),e([f()],$.prototype,`attachmentsColumns`,null),e([f()],$.prototype,`attachmentsEnabled`,null),e([f()],$.prototype,`attachmentsViewOptions`,null),e([f({type:y})],$.prototype,`attributeTableTemplate`,null),e([f()],$.prototype,`autoRefreshEnabled`,null),e([f()],$.prototype,`autoSaveEnabled`,null),e([f()],$.prototype,`canAddRelatedFeature`,null),e([f()],$.prototype,`clearPrompt`,null),e([f()],$.prototype,`closed`,void 0),e([f()],$.prototype,`collapsed`,void 0),e([f()],$.prototype,`columnPerformanceModeEnabled`,null),e([f()],$.prototype,`columnReorderingEnabled`,null),e([f({readOnly:!0})],$.prototype,`columns`,null),e([f()],$.prototype,`columnVisibilityMenuConfig`,void 0),e([f()],$.prototype,`defaultSelectionManager`,null),e([f()],$.prototype,`definitionExpression`,null),e([f()],$.prototype,`description`,void 0),e([f()],$.prototype,`disabled`,void 0),e([f()],$.prototype,`editingEnabled`,null),e([f()],$.prototype,`effectiveSelectionManager`,null),e([f()],$.prototype,`effectiveSize`,null),e([f()],$.prototype,`effectiveTable`,null),e([f()],$.prototype,`effectiveTimeExtent`,null),e([f()],$.prototype,`fieldColumns`,null),e([f({types:m})],$.prototype,`filterGeometry`,null),e([f()],$.prototype,`filterBySelectionEnabled`,null),e([f()],$.prototype,`filterByViewExtent`,null),e([f()],$.prototype,`filterByLayerScaleRange`,null),e([f()],$.prototype,`groupColumns`,null),e([f()],$.prototype,`hasContingentValues`,null),e([f()],$.prototype,`hasInvalidPendingEdits`,null),e([f()],$.prototype,`hasPendingEdits`,null),e([f()],$.prototype,`hiddenFields`,null),e([f()],$.prototype,`highlightEnabled`,null),e([f()],$.prototype,`highlightIds`,null),e([f()],$.prototype,`icon`,null),e([f()],$.prototype,`initialSize`,null),e([f()],$.prototype,`isQueryingOrSyncing`,null),e([f()],$.prototype,`isSyncing`,null),e([f()],$.prototype,`isSyncingAttachments`,null),e([f()],$.prototype,`label`,null),e([f()],$.prototype,`layer`,null),e([f()],$.prototype,`layers`,null),e([f()],$.prototype,`layerView`,null),e([f()],$.prototype,`maxSize`,null),e([f(),B(`esri/widgets/FeatureTable/t9n/FeatureTable`)],$.prototype,`messages`,null),e([f(),B(`esri/t9n/common`)],$.prototype,`messagesCommon`,null),e([f(),B(`esri/widgets/Editor/t9n/Editor`)],$.prototype,`messagesEditor`,void 0),e([f(),B(`esri/core/t9n/Units`)],$.prototype,`messagesUnits`,null),e([f(),B(`esri/widgets/support/t9n/uriUtils`)],$.prototype,`messagesURIUtils`,null),e([f()],$.prototype,`menuConfig`,null),e([f()],$.prototype,`multipleSelectionEnabled`,null),e([f()],$.prototype,`multipleSelectionEnabledOverride`,null),e([f()],$.prototype,`multiSortEnabled`,null),e([f()],$.prototype,`multipleSortPriority`,null),e([f()],$.prototype,`navigationScale`,void 0),e([f()],$.prototype,`noDataMessage`,null),e([f()],$.prototype,`objectIds`,null),e([f()],$.prototype,`outFields`,null),e([f()],$.prototype,`pageCount`,null),e([f()],$.prototype,`pageIndex`,null),e([f()],$.prototype,`pageSize`,null),e([f()],$.prototype,`paginationEnabled`,null),e([f()],$.prototype,`pendingEditsCount`,null),e([f()],$.prototype,`prompt`,null),e([f()],$.prototype,`relatedRecordsEnabled`,null),e([f()],$.prototype,`relatedTable`,null),e([f()],$.prototype,`relatedTableHasContingentValues`,null),e([f()],$.prototype,`relatedTableHasInvalidPendingEdits`,null),e([f()],$.prototype,`relatedTableHasPendingEdits`,null),e([f()],$.prototype,`relatedTables`,null),e([f()],$.prototype,`relationship`,null),e([f()],$.prototype,`relationshipColumnConfigs`,null),e([f()],$.prototype,`relationshipColumns`,null),e([f()],$.prototype,`relationshipConfig`,null),e([f()],$.prototype,`relationshipInfos`,null),e([f()],$.prototype,`returnGeometryEnabled`,null),e([f()],$.prototype,`returnMEnabled`,null),e([f()],$.prototype,`returnZEnabled`,null),e([f()],$.prototype,`rowHighlightIds`,null),e([f()],$.prototype,`selectionManager`,null),e([f()],$.prototype,`selectionSource`,null),e([f()],$.prototype,`showAllRelatedTables`,null),e([f()],$.prototype,`showPrompt`,null),e([f()],$.prototype,`showRelatedTableCallback`,null),e([f()],$.prototype,`size`,null),e([f({readOnly:!0})],$.prototype,`state`,null),e([f()],$.prototype,`supportsAddAttachments`,null),e([f()],$.prototype,`supportsAttachments`,null),e([f()],$.prototype,`supportsDeleteAttachments`,null),e([f()],$.prototype,`supportsResizeAttachments`,null),e([f()],$.prototype,`supportsUpdateAttachments`,null),e([f()],$.prototype,`syncTemplateOnChangesEnabled`,null),e([f()],$.prototype,`syncViewSelection`,null),e([f()],$.prototype,`syncWithViewSelectionManager`,null),e([f({constructOnly:!0})],$.prototype,`tableController`,null),e([f({constructOnly:!0})],$.prototype,`tableParent`,null),e([f({type:j})],$.prototype,`tableTemplate`,null),e([f()],$.prototype,`tableTemplateOverride`,null),e([f()],$.prototype,`title`,void 0),e([f({type:b})],$.prototype,`timeExtent`,null),e([f()],$.prototype,`timeZone`,null),e([f()],$.prototype,`view`,null),e([f({type:D}),V([`cell-click`,`cell-dblclick`,`cell-pointerover`,`cell-pointerout`,`cell-keydown`,`column-reorder`,`show-related-table`])],$.prototype,`viewModel`,void 0),e([f()],$.prototype,`viewTimeEnabled`,null),e([f()],$.prototype,`visibleColumns`,null),e([f({type:O,nonNullable:!0})],$.prototype,`visibleElements`,void 0),e([f({type:O})],$.prototype,`visibleElementsOverride`,null),e([f()],$.prototype,`visibilityMenuColumns`,null),$=K=e([p(`esri.widgets.FeatureTable`)],$);const te=$;export{te as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.js";import{stripHTML as n}from"../../core/string.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{loadActionUtilsComponents as a,renderAction as o}from"../../support/actions/actionUtils.js";import s from"../Widget.js";import{css as c}from"./css.js";import{zoomToFeature as l}from"../Popup/actions.js";import{loadCalciteComponents as u}from"../support/componentsUtils.js";import{tsx as d,tsxFragment as f,messageBundle as p}from"../support/widget.js";const m=l.clone();let h=class extends s{constructor(e,t){super(e,t),this.flowItems=null,this.messages=null,this.closed=!1,this.closable=!0,this.selectLastFlowItem=!0,this._handleOpenFeature=e=>{this.emit(`open-feature`,{feature:e})},this._handleZoomToFeature=e=>{this.emit(`zoom-to-feature`,{featureWidget:e})}}loadDependencies(){return Promise.all([a(),u({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),"action-bar":()=>import(`@esri/calcite-components/dist/components/calcite-action-bar`),"action-group":()=>import(`@esri/calcite-components/dist/components/calcite-action-group`),"flow-item":()=>import(`@esri/calcite-components/dist/components/calcite-flow-item`)})])}render(){let{flowItems:e}=this,t=e?.toArray();return d(f,null,t?.map((e,n)=>this._renderFlowItem(e,this.selectLastFlowItem&&n===t.length-1)))}_handleCloseClick(){this.emit(`close`)}_handleExitClick(){this.emit(`exit`)}_handleDrillInBackClick(){let{flowItems:e}=this,t=e?.pop();t&&(`activeCategory`in t.viewModel?(t.viewModel.activeCategory=null,e?.length||(t.viewModel.showAllEnabled=!1)):`showAllEnabled`in t.viewModel&&(t.viewModel.showAllEnabled=!1),t&&(t.viewModel=null,t.destroy()))}_getExitMessage(e){switch(e.flowType){case`feature`:case`feature-association`:return``;case`feature-relationship`:return this.messages.exitRelatedRecords;case`feature-utility-network-associations`:case`feature-utility-network-association-type`:return this.messages.exitAssociations}}_renderFlowItem(e,t){let{messages:r,closable:i,closed:a}=this,s=`graphic`in e&&!e.isTable,l=e.flowType===`feature-association`,u=this._getExitMessage(e),f=r.selectFeature;return d(`calcite-flow-item`,{bind:this,closable:i,closed:a,description:n(this._getDrillInFlowItemDescription(e)??``),heading:n(e.title??``),key:`flow-item-${e.viewModel.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleDrillInBackClick()},onCalciteFlowItemClose:this._handleCloseClick},d(`calcite-action`,{bind:this,class:c.actionExit,icon:`move-up`,key:`exit-action`,slot:`header-actions-start`,text:u,title:u,onclick:this._handleExitClick}),s?d(`calcite-action`,{bind:this,icon:`zoom-to-object`,key:`open-feature-action`,slot:`header-actions-end`,text:f,title:f,onclick:()=>this._handleOpenFeature(e)}):null,l?d(`calcite-action-bar`,{
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.js";import{stripHTML as n}from"../../core/string.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{loadActionUtilsComponents as a,renderAction as o}from"../../support/actions/actionUtils.js";import s from"../Widget.js";import{css as c}from"./css.js";import{zoomToFeature as l}from"../Popup/actions.js";import{loadCalciteComponents as u}from"../support/componentsUtils.js";import{tsx as d,tsxFragment as f,messageBundle as p}from"../support/widget.js";const m=l.clone();let h=class extends s{constructor(e,t){super(e,t),this.flowItems=null,this.messages=null,this.closed=!1,this.closable=!0,this.selectLastFlowItem=!0,this._handleOpenFeature=e=>{this.emit(`open-feature`,{feature:e})},this._handleZoomToFeature=e=>{this.emit(`zoom-to-feature`,{featureWidget:e})}}loadDependencies(){return Promise.all([a(),u({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),"action-bar":()=>import(`@esri/calcite-components/dist/components/calcite-action-bar`),"action-group":()=>import(`@esri/calcite-components/dist/components/calcite-action-group`),"flow-item":()=>import(`@esri/calcite-components/dist/components/calcite-flow-item`)})])}render(){let{flowItems:e}=this,t=e?.toArray();return d(f,null,t?.map((e,n)=>this._renderFlowItem(e,this.selectLastFlowItem&&n===t.length-1)))}_handleCloseClick(){this.emit(`close`)}_handleExitClick(){this.emit(`exit`)}_handleDrillInBackClick(){let{flowItems:e}=this,t=e?.pop();t&&(`activeCategory`in t.viewModel?(t.viewModel.activeCategory=null,e?.length||(t.viewModel.showAllEnabled=!1)):`showAllEnabled`in t.viewModel&&(t.viewModel.showAllEnabled=!1),t&&(t.viewModel=null,t.destroy()))}_getExitMessage(e){switch(e.flowType){case`feature`:case`feature-association`:return``;case`feature-relationship`:return this.messages.exitRelatedRecords;case`feature-utility-network-associations`:case`feature-utility-network-association-type`:return this.messages.exitAssociations}}_renderFlowItem(e,t){let{messages:r,closable:i,closed:a}=this,s=`graphic`in e&&!e.isTable,l=e.flowType===`feature-association`,u=this._getExitMessage(e),f=r.selectFeature;return d(`calcite-flow-item`,{bind:this,closable:i,closed:a,description:n(this._getDrillInFlowItemDescription(e)??``),heading:n(e.title??``),key:`flow-item-${e.viewModel.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleDrillInBackClick()},onCalciteFlowItemClose:this._handleCloseClick},d(`calcite-action`,{bind:this,class:c.actionExit,icon:`move-up`,key:`exit-action`,slot:`header-actions-start`,text:u,title:u,onclick:this._handleExitClick}),s?d(`calcite-action`,{bind:this,icon:`zoom-to-object`,key:`open-feature-action`,slot:`header-actions-end`,text:f,title:f,onclick:()=>this._handleOpenFeature(e)}):null,l?d(`calcite-action-bar`,{expanded:!0,expandToggleDisabled:!0,key:`header-action-bar`,scale:`s`,slot:`action-bar`},d(`calcite-action-group`,{overlayPositioning:`fixed`,scale:`s`},o(m,{key:`action-${m.uid}`,title:this._getActionTitle(m),text:this._getActionTitle(m),textEnabled:!0,onclick:()=>this._handleZoomToFeature(e),bind:this}))):null,d(`div`,{class:c.container},e.render()))}_getActionTitle(e){let{messages:n}=this,r=e.title??``;return e.id===`zoom-to-feature`?t(r,{messages:n}):r}_getDrillInFlowItemDescription(e){switch(e.flowType){case`feature`:case`feature-association`:case`feature-utility-network-associations`:return e.viewModel.description??``;case`feature-relationship`:return e.allItemsDescription;case`feature-utility-network-association-type`:return e.description??``}}};e([r()],h.prototype,`flowItems`,void 0),e([r(),p(`esri/widgets/Features/t9n/Features`)],h.prototype,`messages`,void 0),e([r()],h.prototype,`closed`,void 0),e([r()],h.prototype,`closable`,void 0),e([r()],h.prototype,`selectLastFlowItem`,void 0),h=e([i(`esri.widgets.Features.FeaturesDrillIn`)],h);export{h as default};
|
package/widgets/Features.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as n}from"../intl.js";import r from"../core/Collection.js";import{deprecateWidget as i}from"../core/deprecate.js";import a from"../core/Logger.js";import{ignoreAbortErrors as o}from"../core/promiseUtils.js";import{watch as s,initial as c,when as l}from"../core/reactiveUtils.js";import{waitAnimationFrame as u}from"../core/scheduling.js";import{throttle as d}from"../core/throttle.js";import{property as f,subclass as p}from"../core/accessorSupport/decorators.js";import{loadActionUtilsComponents as m,substituteActionImage as h,getActionStyles as g,renderAction as _}from"../support/actions/actionUtils.js";import v from"./Feature.js";import y from"./Spinner.js";import b from"./Widget.js";import{css as x}from"./Feature/resources.js";import{FeatureContentMixin as S}from"./Feature/support/FeatureContentMixin.js";import{css as C}from"./Features/css.js";import w from"./Features/FeaturesDrillIn.js";import T from"./Features/FeaturesViewModel.js";import E from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as D}from"./Popup/actions.js";import{zoomToLocation as O}from"./Popup/actionUtils.js";import{loadCalciteComponents as k}from"./support/componentsUtils.js";import{globalCss as A}from"./support/globalCss.js";import{Heading as j}from"./support/Heading.js";import{tsx as M,messageBundle as N,vmEvent as P}from"./support/widget.js";import{setFocus as F}from"./support/widgetUtils.js";const I=`selected-index`,L=`features-spinner`;function R(e){return e?.declaredClass.startsWith(`esri.layers.`)??!1}let z=class extends S(b){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new r,this._drillInWidget=new w({flowItems:this._drillInFlowItems}),this._rootNode=null,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new D,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new T({suppressDeprecationWarning:!0}),this.visibleElements=new E,this._previousFeature=()=>{this.viewModel.previous()},this._nextFeature=()=>{this.viewModel.next()},this._handleFeatureBack=()=>{this.initialDisplayMode===`list`?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this._openFeatureMenu()},this._handleFeatureMenuBack=()=>{this.initialDisplayMode===`list`?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this.featureMenuOpen&&this._closeFeatureMenu()},this._storeRootNode=e=>{this._rootNode=e},this._displaySpinnerThrottled=d(()=>this._displaySpinner(),25),e?.suppressDeprecationWarning!==!0&&i(a.getLogger(this),`Features`,`arcgis-features`,{version:`4.34`}),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,s(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),s(()=>this.viewModel?.active,e=>this._drillInWidget.closed=!e),s(()=>this.visibleElements?.closeButton,e=>this._drillInWidget.closable=e),s(()=>this.visibleElements?.spinner,e=>this._spinnerEnabledChange(e)),s(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),s(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),s(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),s(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),s(()=>this.selectedFeatureWidget?.viewModel,()=>this._destroyDrillInFlowItemWidgets()),s(()=>this.featureMenuOpen,()=>this._drillInWidget.selectLastFlowItem=this.initialDisplayMode===`list`||!this.featureMenuOpen,c),s(()=>{let e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]},()=>this._setTitleFromFeatureWidget()),s(()=>{let e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]},()=>this._setContentFromFeatureWidget()),s(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),s(()=>this._drillInFlowItems.length,()=>this._focusFlowItemNode()),this._drillInWidget.on(`close`,()=>this.close()),this._drillInWidget.on(`exit`,()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on(`open-feature`,({feature:e})=>this._openRelatedFeature(e)),this._drillInWidget.on(`zoom-to-feature`,({featureWidget:e})=>O(this.viewModel,e))])}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}loadDependencies(){return Promise.all([m(),k({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),"action-bar":()=>import(`@esri/calcite-components/dist/components/calcite-action-bar`),"action-group":()=>import(`@esri/calcite-components/dist/components/calcite-action-group`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),flow:()=>import(`@esri/calcite-components/dist/components/calcite-flow`),"flow-item":()=>import(`@esri/calcite-components/dist/components/calcite-flow-item`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),"list-item-group":()=>import(`@esri/calcite-components/dist/components/calcite-list-item-group`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`)})])}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;let e=this.view?.widthBreakpoint;return e===`xsmall`||e===`small`||e===`medium`}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&(this.initialDisplayMode===`list`||!!this.title&&!!this.content)}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get featureStream(){return this.viewModel.featureStream}set featureStream(e){this.viewModel.featureStream=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get initialDisplayMode(){return this.viewModel.initialDisplayMode}set initialDisplayMode(e){this.viewModel.initialDisplayMode=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){let e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;let{flowType:t}=e;return t===`feature-association`||t===`feature-relationship`?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){let{_feature:e,headingLevel:t,_drillInFlowItems:n,timeZone:r,spatialReference:i,map:a}=this,{selectedFeatureViewModel:o}=this.viewModel,s={title:!1};return o?(e?(e.viewModel=o,e.visibleElements=s):this._feature=new v({flowItems:n,headingLevel:t+1,timeZone:r,spatialReference:i,map:a,viewModel:o,visibleElements:s,suppressDeprecationWarning:!0}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){let{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():a.getLogger(this).warn(`Features can only be blurred when currently active.`)}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){let{active:e}=this.viewModel;e?this._focusFlowItemNode():a.getLogger(this).warn(`Features can only be focused when currently active.`)}next(){return this.viewModel.next()}open(e){this.removeHandles(I);let t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(l(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return M(`div`,{afterCreate:this._storeRootNode,bind:this,class:this.classes(C.base,A.widget,A.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this.initialDisplayMode===`list`?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?M(`div`,{class:C.header,key:`header-actions`},this._renderFeatureNavigation()):null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?M(`div`,{class:C.footer,key:`footer-actions`,slot:`footer`},this._renderFeatureNavigation()):null}_renderFeaturePaginationText(){let{messages:e,viewModel:r}=this,{featureCount:i,selectedFeatureIndex:a}=r;return M(`div`,{class:C.paginationText,key:`feature-pagination-text`},t(e.pageText,{index:n(a+1),total:n(i)}))}_renderFeatureMenuButton(){let{messages:e,viewModel:r}=this,{featureCount:i,selectedFeatureIndex:a,pendingPromisesCount:o,streamingFeatures:s}=r,c=o>0||s;return M(`calcite-action`,{bind:this,class:C.paginationMenuButton,icon:`list`,key:`feature-menu-button`,label:e.selectFeature,loading:c,text:t(e.pageText,{index:n(a+1),total:n(i)}),textEnabled:!0,title:e.selectFeature,onclick:this._handlePaginationMenuButton})}_renderPagination(){let{previous:e,next:t}=this.messagesCommon.pagination;return M(`calcite-action-bar`,{class:C.paginationActionBar,expandDisabled:!0,key:`pagination-action-bar`,layout:`horizontal`,overflowActionsDisabled:!0,scale:`s`},M(`calcite-action-group`,{scale:`s`},M(`calcite-action`,{class:C.paginationPrevious,icon:`chevron-left`,iconFlipRtl:!0,label:e,text:e,title:e,onclick:this._previousFeature}),M(`calcite-action`,{icon:`chevron-right`,iconFlipRtl:!0,label:t,text:t,title:t,onclick:this._nextFeature})))}_renderFeatureMenuItem(e){let{initialDisplayMode:t}=this,{selectedFeatureViewModel:n,featureViewModels:r}=this.viewModel,i=e===n,a=r.indexOf(e);return M(`calcite-list-item`,{bind:this,"data-feature-index":a,key:`feature-menu-item-${e.uid}`,selected:i,onblur:this._removeActiveFeature,onCalciteListItemSelect:this._selectFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature},M(`span`,{innerHTML:e.title||this.messagesCommon.untitled,slot:`content`}),t===`list`?M(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}):null)}_groupResultsByLayer(){let{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(e=>{let n=e?.graphic;if(!n)return;let{layer:r,sourceLayer:i}=n,a=(R(r)?r:null)||(R(i)?i:null),o=t.get(a)??[];t.set(a,[...o,e])}),t}_renderFeatureMenu(){let{messages:e,viewModel:t}=this,n=this._groupResultsByLayer(),r=this.initialDisplayMode===`list`?`none`:`single`;return t.featureViewModels.length?M(`calcite-list`,{displayMode:`flat`,label:e?.featuresList,selectionAppearance:`icon`,selectionMode:r},Array.from(n.keys(),e=>{let t=n.get(e)?.map(e=>this._renderFeatureMenuItem(e)),r=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&r!==null?M(`calcite-list-item-group`,{heading:r,key:e?.uid||`map-graphics`},t):t})):null}_renderHeaderAction(e,t){let n=e.title||``;return e.visible?M(`calcite-action`,{active:e.type===`toggle`&&e.value,bind:this,"data-action-id":e.id,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,slot:`header-actions-end`,text:n,title:n,onclick:this._triggerHeaderAction}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){let{headingLevel:e,visibleElements:t,_isCollapsed:n,_collapseEnabled:r,featureNavigationTop:i,_drillInFlowItems:a,initialDisplayMode:o,selectedFeature:s,featureMenuOpen:c}=this,{title:l,active:u}=this.viewModel,d=t.heading&&l?l:``;if(o===`list`&&!s)return null;let f=a.length===0&&(o===`list`?!!s:!c);return M(`calcite-flow-item`,{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[C.contentFeature]:!0,[C.flowItemCollapsed]:n}),closable:t.closeButton,closed:!u,collapsed:n,collapseDirection:i?`down`:`up`,collapsible:r,headingLevel:e,key:`root-flow-item`,selected:f,onCalciteFlowItemBack:this._handleFeatureBack,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?M(j,{class:this.classes(C.featuresHeading,A.heading),innerHTML:d,key:`header-content`,level:this.headingLevel,slot:`header-content`}):null,this._renderHeaderActions(),this._renderActionBar(),M(`div`,{class:this.classes(C.container,C.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){let{viewModel:e,visibleElements:n,featureMenuTitle:r,messages:i,messagesCommon:a,initialDisplayMode:o,featureMenuOpen:s,selectedFeature:c,_collapseEnabled:l,_isCollapsed:u,featureNavigationTop:d,headingLevel:f}=this,{active:p,featureViewModels:m,pendingPromisesCount:h,streamingFeatures:g}=e,_=h>0||g,{featureMenuHeading:v}=n,y=r??i.selectFeature;if(o===`feature`&&!s)return null;let b=o===`list`?!c:s;return M(`calcite-flow-item`,{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,class:this.classes({[C.flowItemCollapsed]:u}),closable:o===`list`&&n.closeButton,closed:!p,collapsed:o===`list`&&u,collapseDirection:d?`down`:`up`,collapsible:o===`list`&&l,description:v?t(i.total,{total:m.length}):void 0,heading:v?y:void 0,headingLevel:f,key:`feature-menu`,loading:e.waitingForContents,selected:b,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()},onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},o===`list`?this._renderHeaderActions():null,_?M(`calcite-loader`,{class:C.loader,inline:!0,key:`feature-menu-loader`,label:a.loading,slot:`header-actions-end`}):null,M(`div`,{class:C.container},this._renderFeatureMenu()),M(`div`,{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:C.featureMenuObserver}),o===`feature`?M(`calcite-button`,{appearance:`transparent`,slot:`footer-start`,width:`full`,onclick:this._handleFeatureMenuBack},a.back):null)}_renderContentContainer(){let e=this.initialDisplayMode===`list`?[this._renderFeatureMenuContainer(),this._renderContentFeature(),this._drillInWidget.render()]:[this._renderContentFeature(),this._drillInWidget.render(),this._renderFeatureMenuContainer()];return this.visibleElements.flow?M(`calcite-flow`,{key:`content-container`},e):e}_getFallbackIcon(e){let{className:t,icon:n}=e;if(n)return null;let r=h({action:e,feature:this.selectedFeature}),i={[C.icon]:!!t,[C.actionImage]:!!r};return t&&(i[t]=!0),r||t?M(`span`,{"aria-hidden":`true`,class:this.classes(C.icon,i),key:`icon`,styles:g(r)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?M(`calcite-action-bar`,{expandDisabled:!0,expanded:!this._hideActionText,key:`header-action-bar`,scale:`s`,slot:`action-bar`},M(`calcite-action-group`,{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:`fixed`,scale:`s`},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map((e,t)=>{let n=this._getActionTitle(e);return _(e,{key:`action-${t}`,title:n,text:n,textEnabled:!this._hideActionText,onclick:this._triggerAction,bind:this},this._getFallbackIcon(e))})}_renderContent(){let e=this.viewModel?.content;return e?typeof e==`string`?M(`div`,{class:x.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();let t=e.graphic,n=t?.geometry;if(n==null||t==null)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:n});let{labelPointExecute:r}=await import(`../geometry/operators/labelPointOperator.js`),i=r(n);this.open({features:[t],location:i??void 0}),this._focusFlowItemNode()}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e,this._focusFlowItemNode()}async _focusFlowItemNode(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;let e=this._focusAbortController.signal;await o(u(e));let t=this._rootNode?.querySelector(`calcite-flow-item[selected]`);F(t)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){let{viewModel:t}=this,n=e.currentTarget[`data-feature-index`];t.activeFeature=t.features?.[n]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){let t=e.currentTarget[`data-feature-index`];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.initialDisplayMode===`feature`?this._handleFeatureMenuBack():this._focusFlowItemNode()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){let{messages:n,selectedFeature:r,messagesCommon:i}=this,{id:a}=e,o=r?.attributes,s=e.title??``,c=a===`zoom-to-feature`?t(s,{messages:n}):a===`remove-selected-feature`?t(s,{messages:i}):a===`zoom-to-clustered-features`||a===`browse-clustered-features`?t(s,{messages:n}):e.title;return c&&o?t(c,o):c??``}_onMainKeydown(e){let{key:t}=e;t===`ArrowLeft`&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),t===`ArrowRight`&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode?.scrollContentTo({top:0})}_setContentFromFeatureWidget(){let{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){let{selectedFeatureWidget:e,messagesCommon:t}=this,n=e?.viewModel;e&&(this.viewModel.title=n?.state===`error`?t?.errorMessage:n?.title||``)}_addSelectedFeatureIndexHandle(){let e=s(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t));this.addHandles(e,I)}_selectedFeatureIndexUpdated(e,t){let{featureCount:n}=this.viewModel;n&&e!==t&&e!==-1&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode?.scrollContentTo({top:0}))}_triggerHeaderAction(e){let t=e.currentTarget;if(t.disabled)return;let n=t.dataset.actionUid,r=this.headerActions.find(({uid:e})=>e===n);r&&!r.disabled&&(r?.type===`toggle`&&(r.value=!r.value),this.emit(`trigger-header-action`,{action:r}))}_triggerAction(e){let t=e.currentTarget;if(t.disabled)return;let n=t.dataset.actionUid,{allActions:r}=this.viewModel,i=r.findIndex(e=>e.uid===n),a=r.at(i);a?.type===`toggle`&&(a.value=!a.value),this.viewModel.triggerAction(i)}_createSpinner(e){e&&(this._spinner=new y({view:e}),e.ui.add(this._spinner,{key:L,position:`manual`,internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){let{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){let{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{`showAllEnabled`in e.viewModel&&(e.viewModel.showAllEnabled=!1),`activeCategory`in e.viewModel&&(e.viewModel.activeCategory=null),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){let{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){let{_spinner:e}=this;if(!e)return;let{location:t,waitingForResult:n}=this.viewModel;n&&t?e.show({location:t}):e.hide()}_destroySpinner(){let{_spinner:e}=this;e&&(e.view?.ui?.remove(e,L),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([f()],z.prototype,`_drillInFlowItems`,void 0),e([f()],z.prototype,`_hideActionText`,null),e([f()],z.prototype,`_featureNavigationVisible`,null),e([f()],z.prototype,`_isCollapsed`,null),e([f()],z.prototype,`_collapseEnabled`,null),e([f({readOnly:!0})],z.prototype,`active`,null),e([f()],z.prototype,`collapsed`,void 0),e([f()],z.prototype,`content`,null),e([f()],z.prototype,`icon`,null),e([f()],z.prototype,`featureMenuOpen`,null),e([f()],z.prototype,`featureMenuTitle`,null),e([f()],z.prototype,`featureStream`,null),e([f()],z.prototype,`featureNavigationTop`,void 0),e([f()],z.prototype,`features`,null),e([f()],z.prototype,`goToOverride`,null),e([f({type:D})],z.prototype,`headerActions`,void 0),e([f()],z.prototype,`headingLevel`,void 0),e([f()],z.prototype,`initialDisplayMode`,null),e([f()],z.prototype,`location`,null),e([f()],z.prototype,`label`,null),e([f()],z.prototype,`map`,null),e([f(),N(`esri/widgets/Features/t9n/Features`)],z.prototype,`messages`,void 0),e([f(),N(`esri/t9n/common`)],z.prototype,`messagesCommon`,void 0),e([f()],z.prototype,`promises`,null),e([f()],z.prototype,`responsiveActionsEnabled`,void 0),e([f({readOnly:!0})],z.prototype,`selectedFeature`,null),e([f({readOnly:!0})],z.prototype,`selectedDrillInFeature`,null),e([f()],z.prototype,`selectedFeatureIndex`,null),e([f({readOnly:!0})],z.prototype,`selectedFeatureWidget`,null),e([f()],z.prototype,`spatialReference`,null),e([f()],z.prototype,`title`,null),e([f()],z.prototype,`timeZone`,null),e([f()],z.prototype,`updateLocationEnabled`,null),e([f()],z.prototype,`view`,null),e([f({type:T}),P([`triggerAction`,`trigger-action`])],z.prototype,`viewModel`,void 0),e([f({type:E,nonNullable:!0})],z.prototype,`visibleElements`,void 0),e([f()],z.prototype,`visible`,null),z=e([p(`esri.widgets.Features`)],z);export{z as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as n}from"../intl.js";import r from"../core/Collection.js";import{deprecateWidget as i}from"../core/deprecate.js";import a from"../core/Logger.js";import{ignoreAbortErrors as o}from"../core/promiseUtils.js";import{watch as s,initial as c,when as l}from"../core/reactiveUtils.js";import{waitAnimationFrame as u}from"../core/scheduling.js";import{throttle as d}from"../core/throttle.js";import{property as f,subclass as p}from"../core/accessorSupport/decorators.js";import{loadActionUtilsComponents as m,substituteActionImage as h,getActionStyles as g,renderAction as _}from"../support/actions/actionUtils.js";import v from"./Feature.js";import y from"./Spinner.js";import b from"./Widget.js";import{css as x}from"./Feature/resources.js";import{FeatureContentMixin as S}from"./Feature/support/FeatureContentMixin.js";import{css as C}from"./Features/css.js";import w from"./Features/FeaturesDrillIn.js";import T from"./Features/FeaturesViewModel.js";import E from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as D}from"./Popup/actions.js";import{zoomToLocation as O}from"./Popup/actionUtils.js";import{loadCalciteComponents as k}from"./support/componentsUtils.js";import{globalCss as A}from"./support/globalCss.js";import{Heading as j}from"./support/Heading.js";import{tsx as M,messageBundle as N,vmEvent as P}from"./support/widget.js";import{setFocus as F}from"./support/widgetUtils.js";const I=`selected-index`,L=`features-spinner`;function R(e){return e?.declaredClass.startsWith(`esri.layers.`)??!1}let z=class extends S(b){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new r,this._drillInWidget=new w({flowItems:this._drillInFlowItems}),this._rootNode=null,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new D,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new T({suppressDeprecationWarning:!0}),this.visibleElements=new E,this._previousFeature=()=>{this.viewModel.previous()},this._nextFeature=()=>{this.viewModel.next()},this._handleFeatureBack=()=>{this.initialDisplayMode===`list`?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this._openFeatureMenu()},this._handleFeatureMenuBack=()=>{this.initialDisplayMode===`list`?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this.featureMenuOpen&&this._closeFeatureMenu()},this._storeRootNode=e=>{this._rootNode=e},this._displaySpinnerThrottled=d(()=>this._displaySpinner(),25),e?.suppressDeprecationWarning!==!0&&i(a.getLogger(this),`Features`,`arcgis-features`,{version:`4.34`}),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,s(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),s(()=>this.viewModel?.active,e=>this._drillInWidget.closed=!e),s(()=>this.visibleElements?.closeButton,e=>this._drillInWidget.closable=e),s(()=>this.visibleElements?.spinner,e=>this._spinnerEnabledChange(e)),s(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),s(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),s(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),s(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),s(()=>this.selectedFeatureWidget?.viewModel,()=>this._destroyDrillInFlowItemWidgets()),s(()=>this.featureMenuOpen,()=>this._drillInWidget.selectLastFlowItem=this.initialDisplayMode===`list`||!this.featureMenuOpen,c),s(()=>{let e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]},()=>this._setTitleFromFeatureWidget()),s(()=>{let e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]},()=>this._setContentFromFeatureWidget()),s(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),s(()=>this._drillInFlowItems.length,()=>this._focusFlowItemNode()),this._drillInWidget.on(`close`,()=>this.close()),this._drillInWidget.on(`exit`,()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on(`open-feature`,({feature:e})=>this._openRelatedFeature(e)),this._drillInWidget.on(`zoom-to-feature`,({featureWidget:e})=>O(this.viewModel,e))])}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}loadDependencies(){return Promise.all([m(),k({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),"action-bar":()=>import(`@esri/calcite-components/dist/components/calcite-action-bar`),"action-group":()=>import(`@esri/calcite-components/dist/components/calcite-action-group`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),flow:()=>import(`@esri/calcite-components/dist/components/calcite-flow`),"flow-item":()=>import(`@esri/calcite-components/dist/components/calcite-flow-item`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),"list-item-group":()=>import(`@esri/calcite-components/dist/components/calcite-list-item-group`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`)})])}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;let e=this.view?.widthBreakpoint;return e===`xsmall`||e===`small`||e===`medium`}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&(this.initialDisplayMode===`list`||!!this.title&&!!this.content)}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get featureStream(){return this.viewModel.featureStream}set featureStream(e){this.viewModel.featureStream=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get initialDisplayMode(){return this.viewModel.initialDisplayMode}set initialDisplayMode(e){this.viewModel.initialDisplayMode=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){let e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;let{flowType:t}=e;return t===`feature-association`||t===`feature-relationship`?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){let{_feature:e,headingLevel:t,_drillInFlowItems:n,timeZone:r,spatialReference:i,map:a}=this,{selectedFeatureViewModel:o}=this.viewModel,s={title:!1};return o?(e?(e.viewModel=o,e.visibleElements=s):this._feature=new v({flowItems:n,headingLevel:t+1,timeZone:r,spatialReference:i,map:a,viewModel:o,visibleElements:s,suppressDeprecationWarning:!0}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){let{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():a.getLogger(this).warn(`Features can only be blurred when currently active.`)}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){let{active:e}=this.viewModel;e?this._focusFlowItemNode():a.getLogger(this).warn(`Features can only be focused when currently active.`)}next(){return this.viewModel.next()}open(e){this.removeHandles(I);let t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(l(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return M(`div`,{afterCreate:this._storeRootNode,bind:this,class:this.classes(C.base,A.widget,A.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this.initialDisplayMode===`list`?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?M(`div`,{class:C.header,key:`header-actions`},this._renderFeatureNavigation()):null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?M(`div`,{class:C.footer,key:`footer-actions`,slot:`footer`},this._renderFeatureNavigation()):null}_renderFeaturePaginationText(){let{messages:e,viewModel:r}=this,{featureCount:i,selectedFeatureIndex:a}=r;return M(`div`,{class:C.paginationText,key:`feature-pagination-text`},t(e.pageText,{index:n(a+1),total:n(i)}))}_renderFeatureMenuButton(){let{messages:e,viewModel:r}=this,{featureCount:i,selectedFeatureIndex:a,pendingPromisesCount:o,streamingFeatures:s}=r,c=o>0||s;return M(`calcite-action`,{bind:this,class:C.paginationMenuButton,icon:`list`,key:`feature-menu-button`,label:e.selectFeature,loading:c,text:t(e.pageText,{index:n(a+1),total:n(i)}),textEnabled:!0,title:e.selectFeature,onclick:this._handlePaginationMenuButton})}_renderPagination(){let{previous:e,next:t}=this.messagesCommon.pagination;return M(`calcite-action-bar`,{class:C.paginationActionBar,expandToggleDisabled:!0,key:`pagination-action-bar`,layout:`horizontal`,overflowMode:`none`,scale:`s`},M(`calcite-action-group`,{scale:`s`},M(`calcite-action`,{class:C.paginationPrevious,icon:`chevron-left`,iconFlipRtl:!0,label:e,text:e,title:e,onclick:this._previousFeature}),M(`calcite-action`,{icon:`chevron-right`,iconFlipRtl:!0,label:t,text:t,title:t,onclick:this._nextFeature})))}_renderFeatureMenuItem(e){let{initialDisplayMode:t}=this,{selectedFeatureViewModel:n,featureViewModels:r}=this.viewModel,i=e===n,a=r.indexOf(e);return M(`calcite-list-item`,{bind:this,"data-feature-index":a,key:`feature-menu-item-${e.uid}`,selected:i,onblur:this._removeActiveFeature,onCalciteListItemSelect:this._selectFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature},M(`span`,{innerHTML:e.title||this.messagesCommon.untitled,slot:`content`}),t===`list`?M(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}):null)}_groupResultsByLayer(){let{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(e=>{let n=e?.graphic;if(!n)return;let{layer:r,sourceLayer:i}=n,a=(R(r)?r:null)||(R(i)?i:null),o=t.get(a)??[];t.set(a,[...o,e])}),t}_renderFeatureMenu(){let{messages:e,viewModel:t}=this,n=this._groupResultsByLayer(),r=this.initialDisplayMode===`list`?`none`:`single`;return t.featureViewModels.length?M(`calcite-list`,{displayMode:`flat`,label:e?.featuresList,selectionAppearance:`icon`,selectionMode:r},Array.from(n.keys(),e=>{let t=n.get(e)?.map(e=>this._renderFeatureMenuItem(e)),r=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&r!==null?M(`calcite-list-item-group`,{heading:r,key:e?.uid||`map-graphics`},t):t})):null}_renderHeaderAction(e,t){let n=e.title||``;return e.visible?M(`calcite-action`,{active:e.type===`toggle`&&e.value,bind:this,"data-action-id":e.id,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,slot:`header-actions-end`,text:n,title:n,onclick:this._triggerHeaderAction}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){let{headingLevel:e,visibleElements:t,_isCollapsed:n,_collapseEnabled:r,featureNavigationTop:i,_drillInFlowItems:a,initialDisplayMode:o,selectedFeature:s,featureMenuOpen:c}=this,{title:l,active:u}=this.viewModel,d=t.heading&&l?l:``;if(o===`list`&&!s)return null;let f=a.length===0&&(o===`list`?!!s:!c);return M(`calcite-flow-item`,{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[C.contentFeature]:!0,[C.flowItemCollapsed]:n}),closable:t.closeButton,closed:!u,collapsed:n,collapseDirection:i?`down`:`up`,collapsible:r,headingLevel:e,key:`root-flow-item`,selected:f,onCalciteFlowItemBack:this._handleFeatureBack,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?M(j,{class:this.classes(C.featuresHeading,A.heading),innerHTML:d,key:`header-content`,level:this.headingLevel,slot:`header-content`}):null,this._renderHeaderActions(),this._renderActionBar(),M(`div`,{class:this.classes(C.container,C.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){let{viewModel:e,visibleElements:n,featureMenuTitle:r,messages:i,messagesCommon:a,initialDisplayMode:o,featureMenuOpen:s,selectedFeature:c,_collapseEnabled:l,_isCollapsed:u,featureNavigationTop:d,headingLevel:f}=this,{active:p,featureViewModels:m,pendingPromisesCount:h,streamingFeatures:g}=e,_=h>0||g,{featureMenuHeading:v}=n,y=r??i.selectFeature;if(o===`feature`&&!s)return null;let b=o===`list`?!c:s;return M(`calcite-flow-item`,{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,class:this.classes({[C.flowItemCollapsed]:u}),closable:o===`list`&&n.closeButton,closed:!p,collapsed:o===`list`&&u,collapseDirection:d?`down`:`up`,collapsible:o===`list`&&l,description:v?t(i.total,{total:m.length}):void 0,heading:v?y:void 0,headingLevel:f,key:`feature-menu`,loading:e.waitingForContents,selected:b,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()},onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},o===`list`?this._renderHeaderActions():null,_?M(`calcite-loader`,{class:C.loader,inline:!0,key:`feature-menu-loader`,label:a.loading,slot:`header-actions-end`}):null,M(`div`,{class:C.container},this._renderFeatureMenu()),M(`div`,{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:C.featureMenuObserver}),o===`feature`?M(`calcite-button`,{appearance:`transparent`,slot:`footer-start`,width:`full`,onclick:this._handleFeatureMenuBack},a.back):null)}_renderContentContainer(){let e=this.initialDisplayMode===`list`?[this._renderFeatureMenuContainer(),this._renderContentFeature(),this._drillInWidget.render()]:[this._renderContentFeature(),this._drillInWidget.render(),this._renderFeatureMenuContainer()];return this.visibleElements.flow?M(`calcite-flow`,{key:`content-container`},e):e}_getFallbackIcon(e){let{className:t,icon:n}=e;if(n)return null;let r=h({action:e,feature:this.selectedFeature}),i={[C.icon]:!!t,[C.actionImage]:!!r};return t&&(i[t]=!0),r||t?M(`span`,{"aria-hidden":`true`,class:this.classes(C.icon,i),key:`icon`,styles:g(r)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?M(`calcite-action-bar`,{expanded:!this._hideActionText,expandToggleDisabled:!0,key:`header-action-bar`,scale:`s`,slot:`action-bar`},M(`calcite-action-group`,{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:`fixed`,scale:`s`},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map((e,t)=>{let n=this._getActionTitle(e);return _(e,{key:`action-${t}`,title:n,text:n,textEnabled:!this._hideActionText,onclick:this._triggerAction,bind:this},this._getFallbackIcon(e))})}_renderContent(){let e=this.viewModel?.content;return e?typeof e==`string`?M(`div`,{class:x.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();let t=e.graphic,n=t?.geometry;if(n==null||t==null)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:n});let{labelPointExecute:r}=await import(`../geometry/operators/labelPointOperator.js`),i=r(n);this.open({features:[t],location:i??void 0}),this._focusFlowItemNode()}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e,this._focusFlowItemNode()}async _focusFlowItemNode(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;let e=this._focusAbortController.signal;await o(u(e));let t=this._rootNode?.querySelector(`calcite-flow-item[selected]`);F(t)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){let{viewModel:t}=this,n=e.currentTarget[`data-feature-index`];t.activeFeature=t.features?.[n]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){let t=e.currentTarget[`data-feature-index`];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.initialDisplayMode===`feature`?this._handleFeatureMenuBack():this._focusFlowItemNode()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){let{messages:n,selectedFeature:r,messagesCommon:i}=this,{id:a}=e,o=r?.attributes,s=e.title??``,c=a===`zoom-to-feature`?t(s,{messages:n}):a===`remove-selected-feature`?t(s,{messages:i}):a===`zoom-to-clustered-features`||a===`browse-clustered-features`?t(s,{messages:n}):e.title;return c&&o?t(c,o):c??``}_onMainKeydown(e){let{key:t}=e;t===`ArrowLeft`&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),t===`ArrowRight`&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode?.scrollContentTo({top:0})}_setContentFromFeatureWidget(){let{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){let{selectedFeatureWidget:e,messagesCommon:t}=this,n=e?.viewModel;e&&(this.viewModel.title=n?.state===`error`?t?.errorMessage:n?.title||``)}_addSelectedFeatureIndexHandle(){let e=s(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t));this.addHandles(e,I)}_selectedFeatureIndexUpdated(e,t){let{featureCount:n}=this.viewModel;n&&e!==t&&e!==-1&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode?.scrollContentTo({top:0}))}_triggerHeaderAction(e){let t=e.currentTarget;if(t.disabled)return;let n=t.dataset.actionUid,r=this.headerActions.find(({uid:e})=>e===n);r&&!r.disabled&&(r?.type===`toggle`&&(r.value=!r.value),this.emit(`trigger-header-action`,{action:r}))}_triggerAction(e){let t=e.currentTarget;if(t.disabled)return;let n=t.dataset.actionUid,{allActions:r}=this.viewModel,i=r.findIndex(e=>e.uid===n),a=r.at(i);a?.type===`toggle`&&(a.value=!a.value),this.viewModel.triggerAction(i)}_createSpinner(e){e&&(this._spinner=new y({view:e}),e.ui.add(this._spinner,{key:L,position:`manual`,internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){let{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){let{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{`showAllEnabled`in e.viewModel&&(e.viewModel.showAllEnabled=!1),`activeCategory`in e.viewModel&&(e.viewModel.activeCategory=null),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){let{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){let{_spinner:e}=this;if(!e)return;let{location:t,waitingForResult:n}=this.viewModel;n&&t?e.show({location:t}):e.hide()}_destroySpinner(){let{_spinner:e}=this;e&&(e.view?.ui?.remove(e,L),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([f()],z.prototype,`_drillInFlowItems`,void 0),e([f()],z.prototype,`_hideActionText`,null),e([f()],z.prototype,`_featureNavigationVisible`,null),e([f()],z.prototype,`_isCollapsed`,null),e([f()],z.prototype,`_collapseEnabled`,null),e([f({readOnly:!0})],z.prototype,`active`,null),e([f()],z.prototype,`collapsed`,void 0),e([f()],z.prototype,`content`,null),e([f()],z.prototype,`icon`,null),e([f()],z.prototype,`featureMenuOpen`,null),e([f()],z.prototype,`featureMenuTitle`,null),e([f()],z.prototype,`featureStream`,null),e([f()],z.prototype,`featureNavigationTop`,void 0),e([f()],z.prototype,`features`,null),e([f()],z.prototype,`goToOverride`,null),e([f({type:D})],z.prototype,`headerActions`,void 0),e([f()],z.prototype,`headingLevel`,void 0),e([f()],z.prototype,`initialDisplayMode`,null),e([f()],z.prototype,`location`,null),e([f()],z.prototype,`label`,null),e([f()],z.prototype,`map`,null),e([f(),N(`esri/widgets/Features/t9n/Features`)],z.prototype,`messages`,void 0),e([f(),N(`esri/t9n/common`)],z.prototype,`messagesCommon`,void 0),e([f()],z.prototype,`promises`,null),e([f()],z.prototype,`responsiveActionsEnabled`,void 0),e([f({readOnly:!0})],z.prototype,`selectedFeature`,null),e([f({readOnly:!0})],z.prototype,`selectedDrillInFeature`,null),e([f()],z.prototype,`selectedFeatureIndex`,null),e([f({readOnly:!0})],z.prototype,`selectedFeatureWidget`,null),e([f()],z.prototype,`spatialReference`,null),e([f()],z.prototype,`title`,null),e([f()],z.prototype,`timeZone`,null),e([f()],z.prototype,`updateLocationEnabled`,null),e([f()],z.prototype,`view`,null),e([f({type:T}),P([`triggerAction`,`trigger-action`])],z.prototype,`viewModel`,void 0),e([f({type:E,nonNullable:!0})],z.prototype,`visibleElements`,void 0),e([f()],z.prototype,`visible`,null),z=e([p(`esri.widgets.Features`)],z);export{z as default};
|