UNPKG

@arcgis/core

Version:

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

2 lines • 52.2 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as i}from"../core/arrayUtils.js";import{deprecateWidget as s}from"../core/deprecate.js";import n from"../core/Logger.js";import{createResolver as l}from"../core/promiseUtils.js";import{watch as o,sync as a,syncAndInitial as r,initial as c,on as d}from"../core/reactiveUtils.js";import{renderingSanitizer as h}from"../core/sanitizerUtils.js";import{formatFileSize as m}from"../core/unitFormatUtils.js";import{property as p,subclass as u}from"../core/accessorSupport/decorators.js";import{geometryTypes as g}from"../geometry/support/typeUtils.js";import{isLayerFromCatalog as w}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as b,isMapImageLayer as v,isSubtypeGroupLayer as y}from"../layers/support/layerUtils.js";import f from"../tables/AttributeTableTemplate.js";import _ from"../time/TimeExtent.js";import M from"./Widget.js";import{isSupportedImage as C,getCalciteIconForAttachment as V}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as A,Prompt as E}from"./Editor/components/Prompt.js";import S from"./FeatureTable/ColumnMenuVisibleElements.js";import T from"./FeatureTable/FeatureTableViewModel.js";import I from"./FeatureTable/VisibleElements.js";import{isGroupColumn as D}from"./FeatureTable/support/columnUtils.js";import P from"./FeatureTable/support/TableTemplate.js";import{loadFieldColumnComponents as R,isIFeatureTableSupportedLayer as k,isIFeatureTableSupportedLayerWithAttachments as x,getRelationshipIdsToShow as O}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as L}from"./support/componentsUtils.js";import{globalCss as F}from"./support/globalCss.js";import{getIconForLayer as j}from"./support/iconUtils.js";import{messageBundle as z,vmEvent as $,tsx as U,tsxFragment as N}from"./support/widget.js";import{storeNode as H,discardNode as B}from"./support/widgetUtils.js";var Z;const G="esri-feature-table",W=`${G}__dialog`,Q=`${G}__attachments-view`,K={base:G,content:`${G}__content`,menuPopover:`${G}__menu-popover`,layerDropdownMenu:`${G}__layer-switcher-menu`,tableContainer:`${G}__table-container`,tableContainerWithAttachments:`${G}__table-container--attachments`,tableNavigation:`${G}__table-navigation`,attachmentsView:Q,attachmentsViewContent:`${Q}__content`,attachmentsViewDetails:`${Q}__details`,attachmentsViewDropArea:`${Q}__drop-area`,attachmentsViewDropAreaLabel:`${Q}__drop-area__label`,attachmentsViewDropAreaMessage:`${Q}__drop-area__message`,attachmentsViewIcon:`${Q}__icon`,attachmentsViewInformation:`${Q}__information`,attachmentsViewInformationData:`${Q}__information__data`,attachmentsViewInformationLabel:`${Q}__information__label`,attachmentsViewList:`${Q}__list`,attachmentsViewListFileSize:`${Q}__list__filesize`,attachmentsViewListThumbnail:`${Q}__list__thumbnail`,expanded:`${G}__expanded`,collapsed:`${G}__collapsed`,dialog:`${W}`,dialogContent:`${W}__content`,dialogHeader:`${W}__header`,footerMessage:`${G}__footer__message`,footerIconDanger:`${G}__footer__icon--danger`,footerIconSuccess:`${G}__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 J=Z=class extends M{constructor(e,t){super(e,t),this._attachmentsDialogPreviewLoading=!1,this._attachmentsInput=null,this._columnVisibilityActions=new Map,this.attachmentsList=null,this.description=null,this.disabled=!1,this.messagesEditor=null,this.navigationScale="m",this.title=null,this.viewModel=new T,this.visibleElements=new I,this.announceDeprecation=()=>{s(n.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([o(()=>[this.isQueryingOrSyncing,this.editingEnabled],()=>this.scheduleRender()),o(()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.columns.length],()=>{this.columns.forEach(e=>e.visibleElements=this._effectiveVisibleElements),this.refreshCellContent()},a),o(()=>[this.topLayerDisabled,this.columns],()=>this.columns.forEach(e=>e.topLayerDisabled=this.topLayerDisabled),r),o(()=>this._effectiveVisibleElements.selectionColumn,e=>{this.grid&&(this.grid.selectionColumnEnabled=e)},c),d(()=>this.viewModel,"show-related-table",e=>this._onShowRelatedTable(e)),o(()=>this.editingEnabled,()=>{const{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)})])}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"),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")}),A(),R()])}destroy(){this.drainRelatedTables(),this.clearPrompt()}get _attachmentsViewIsVisible(){return!(null==this.attachmentsViewOptions.objectId&&!this.relatedTables.some(e=>null!=e.attachmentsViewOptions.objectId))}get _dialogIsOpen(){return!!this.attachmentsViewOptions.dialogInfo}get _effectiveDescription(){const{description:e}=this;return null!=e?h.sanitize("function"==typeof e?e():e):void 0}get _effectiveLayers(){const{layer:e,layers:t}=this,i=t?.length?t.filter(k):[],s=i.length?i:[...this._viewLayers];return e&&!s.includes(e)&&s.push(e),s}get _effectiveTitle(){const{layer:e,messages:i,state:s,highlightIds:n,title:l,size:o}=this;if(l)return h.sanitize("function"==typeof l?l():l);if(!i)return"";if(!e)return i.noLayer;switch(s){case"disabled":return i.errorLayer;case"ready":case"loading":return i.loading;case"error":return i.errorData}return t(i.header,{title:h.sanitize(e.title),count:o,selected:n.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){const e=this.relatedTables.toArray(),t=1===e.length;return this.allRelatedTablesVisible?e:t?[e[0]]:this._attachmentsViewIsVisible?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return null!=this.attachmentsViewOptions.error}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._showColumnsVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||1===this.relatedTables.length&&!this._attachmentsViewIsVisible}get _shouldShowMenu(){const{header:e,menu:t}=this._effectiveVisibleElements;return!(!e||!t||!this._hasDefaultMenuItems&&!this._hasCustomMenuItems)}get _showClearSelectionAction(){return!(!this.highlightIds.length||!this._effectiveVisibleElements.menuItems?.clearSelection||this.relatedTables.length||this._attachmentsViewIsVisible)}get _showColumnsVisibilityAction(){const{header:e,menu:t,menuItems:i}=this._effectiveVisibleElements;return!(!(e&&t&&i?.toggleColumns)||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(){const e=!!this.relatedTable||this._attachmentsViewIsVisible;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){const 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(){return!(!this.view||!this.highlightIds.length||this.effectiveTable.layer?.isTable||!this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){const e=this.view?.map;if(!e)return[];const t=new Set,i=e=>{!k(e)||y(e)||t.has(e)||"sublayer"===e.type&&!e.capabilities?.operations?.supportsQuery||(e.load(),t.add(e))},s=e=>{w(e)||"catalog-footprint"===e.type||(b(e)?(e.load(),e.layers?.forEach(i),e.tables?.forEach(i)):v(e)?(e.loadAll(),e.allSublayers?.forEach(i),e.subtables?.forEach(i)):y(e)?(e.loadAll(),e.sublayers?.forEach(i)):i(e))};return e.allLayers.forEach(s),e.allTables.forEach(s),[...t.values()]}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 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 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 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 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 visibleColumns(){return this.viewModel.visibleColumns}get visibleElementsOverride(){const{attachmentsViewOptions:e,relatedTable:t,tableController:i,visibleElements:s}=this,{columnDescriptions:n,columnMenus:l,tooltips:o}=s,a=null!=e.objectId;if(t)return new I({columnDescriptions:n,columnMenus:l,tooltips:o,close:s.close,header:s.header,layerDropdown:s.layerDropdown,layerDropdownIcons:s.layerDropdownIcons,menu:s.menu,menuItems:s.menuItems,progress:s.progress,selectionColumn:!1,columnMenuItems:new S({sortAscending:!1,sortDescending:!1})});if(i){const e=i.relatedTable===this,t=i.allRelatedTablesVisible,r=e&&s.selectionColumn&&!t&&!a,c=e&&!t&&!a;return new I({columnDescriptions:n,columnMenus:l,tooltips:o,selectionColumn:r,close:!1,header:!1,layerDropdown:!1,menu:!1,pendingEditsFooter:!1,progress:!1,columnMenuItems:new S({sortAscending:c,sortDescending:c})})}return a?new I({columnDescriptions:n,columnMenus:l,tooltips:o,close:s.close,header:s.header,layerDropdown:s.layerDropdown,layerDropdownIcons:s.layerDropdownIcons,menu:s.menu,menuItems:s.menuItems,progress:s.progress,selectionColumn:!1,columnMenuItems:new S({sortAscending:!1,sortDescending:!1})}):null}addPendingEdits(e){this.viewModel.addPendingEdits(e)}async deleteAttachments(e,t,i){null!=e&&t?.length&&(i?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)}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)}async zoomToSelection(){return this.effectiveTable.viewModel.zoomToSelection()}render(){const{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:i,state:s}=this;return U("div",{bind:this,class:this.classes(K.base,F.widget)},U("calcite-panel",{bind:this,class:K.content,closable:e.close,description:this._effectiveDescription,disabled:this.disabled||"disabled"===s&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,key:"table-content",loading:"loading"===s,menuOpen:!!i?.open,overlayPositioning:"fixed",onCalcitePanelClose:e=>{e.currentTarget.closed=!1,this.emit("close")}},e.progress?U("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(){const{grid:e,relatedTables:t}=this,i=this.classes(K.tableContainer);if(t.length){const s=this.classes(K.base,this.allRelatedTablesVisible?K.expanded:K.collapsed,this._attachmentsViewIsVisible?K.tableContainerWithAttachments:void 0);return U("div",{class:i},U("calcite-panel",{overlayPositioning:"fixed"},U("div",null,[this._shouldShowGrid?U("div",{class:s},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map(e=>{const i=t.indexOf(e);return U("div",{class:s,key:`related-${i}`},e.render())}),,])))}return null!=this.attachmentsViewOptions.objectId?U("div",{class:i},U("calcite-panel",{overlayPositioning:"fixed"},U("div",null,[U("div",{class:this.classes(K.base,K.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()]))):[U("div",{class:i},e?.render()),this._renderPagination()]}_renderPagination(){if(this.paginationEnabled)return U("calcite-pagination",{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>{this._attachmentsDialogPreviewLoading=!1,this.goToPage(e.currentTarget.startItem-1)}})}_renderError(){const{messages:e}=this;return U("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}},U("span",{slot:"message"},e.errorOccured))}_renderFooterContent(){if(!this.hasPendingEdits||!this._effectiveVisibleElements.pendingEditsFooter)return;const{hasInvalidPendingEdits:e,isQueryingOrSyncing:t,messages:i,messagesCommon:s}=this,n=e||t,l=this.hasContingentValues,o=[U("calcite-button",{appearance:"outline",disabled:t,iconStart:q.reset,key:"footer-reset-button",onclick:()=>{this.discardPendingEdits()},slot:"footer-end",width:"auto"},s.reset),U("calcite-button",{disabled:n,iconStart:q.save,key:"footer-save-button",loading:this.isSyncing,onclick:()=>{this.savePendingEdits()},slot:"footer-end",width:"auto"},s.save)];if(l){const t=e?i.contingentValues.hasInvalidValues:i.contingentValues.hasValidValues,s=e?q.exclamationMarkTriangle:q.checkCircle,n=e?K.footerIconDanger:K.footerIconSuccess;o.push(U("div",{class:K.footerMessage,key:"footer-message",slot:"footer-start"},U("calcite-icon",{class:n,icon:s,scale:"s",slot:"footer-start"}),t))}return o}_renderPrompt(){return this.prompt?U(E,{...this.prompt,headingLevel:2}):void 0}_showDeleteSelectionPrompt(){const{messages:e,messagesCommon:i}=this,s=t(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:s,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:i.delete,action:async()=>{try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,i){const{messages:s,messagesCommon:n}=this,l=t(s.deleteAttachmentCount,{count:i.length});this.showPrompt({title:l,message:s.deleteAttachmentConfirmation,context:"danger",actions:{primary:{label:n.delete,action:async()=>{try{await this.deleteAttachments(e,i,!1)}finally{this.clearPrompt()}}},secondary:{label:n.cancel,action:()=>this.clearPrompt()}}})}async _showDiscardEditsPrompt(e){const t=l(),{messagesEditor:i}=this;return this.showPrompt({title:i.cancelEditTitle,message:i.cancelEditWarningMessage,context:"danger",actions:{primary:{label:i.discardEdits,action:async()=>{try{await this.discardPendingEdits(e)}finally{t.resolve(!0)}}},secondary:{label:i.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(){const{attachmentsViewOptions:e,messages:t}=this,{objectId:i}=e;return U("calcite-dialog",{class:K.dialog,description:this.viewModel.getFeatureTitleSync(i),heading:t.attachments,modal:!0,open:this._dialogIsOpen,placement:"cover",width:"l",onCalciteDialogClose:()=>this._onDialogClose()},this._renderDialogContent())}_renderDialogContent(){const e=this.attachmentsViewOptions.dialogInfo;if(e)return this._renderAttachmentsDialogContent(e)}_renderAttachmentsDialogContent(e){const{attachmentsViewOptions:t,messages:i}=this,{attachmentInfos:s}=t,n=s.indexOf(e);return U(N,null,U("div",{class:K.dialogHeader,key:"header",slot:"content-top"},U("span",null,e.name),U("calcite-button",{appearance:"outline",onclick:()=>{t.attachmentId=e.id,t.dialogId=null}},i.viewDetails)),U("calcite-progress",{type:this._attachmentsDialogPreviewLoading?"indeterminate":"determinate"}),U("div",{class:K.dialogContent,key:"content"},this._renderAttachmentsViewDetailsImage(e)),U("calcite-pagination",{pageSize:1,slot:"footer",startItem:n+1,totalItems:s.length,onCalcitePaginationChange:e=>{const i=e.currentTarget.startItem-1,n=s[i]?.id;t.dialogId=n}}))}_onDialogClose(){const e=this.attachmentsViewOptions;null!=e.dialogId&&(e.dialogId=null),this._attachmentsDialogPreviewLoading=!1}_renderHeaderMenuAction(e){const{disabled:t,hidden:i,icon:s,text:n,clickFunction:l}=e;if(!i)return U("calcite-action",{disabled:t??this.menuConfig?.disabled,icon:s??void 0,key:n,onclick:()=>l(),slot:"header-menu-actions",text:n,textEnabled:!0,title:n})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];const{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.highlightIds?.removeAll()},this._showZoomToSelectionAction&&{icon:q.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:q.showSelected,text:e.showSelected,clickFunction:()=>{const{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(i).map(e=>e&&this._renderHeaderMenuAction(e))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map(({disabled:e,hidden:t,icon:i,label:s,clickFunction:n})=>this._renderHeaderMenuAction({hidden:"function"==typeof t?t():t,icon:i,text:s,disabled:e,clickFunction:e=>n(e)}))??[]}_renderColumnVisibilityAction(){if(!this._showColumnsVisibilityAction)return[];const{_columnVisibilityActions:e,effectiveTable:t,id:i}=this,s=this.messages.toggleColumns;return U("calcite-action",{afterCreate:t=>e.set(i,t),afterRemoved:()=>e.delete(i),bind:this,disabled:t.menuConfig?.disabled,icon:q.showColumn,id:`${i}__toggle-columns-action`,slot:"header-actions-end",text:s},this._effectiveVisibleElements.tooltips?U("calcite-tooltip",{closeOnClick:!0,overlayPositioning:"fixed",placement:"bottom-end",slot:"tooltip",topLayerDisabled:this.topLayerDisabled},s):null)}_renderColumnVisibilityPopover(){if(!this._showColumnsVisibilityAction||this.effectiveTable.menuConfig?.disabled)return;const{effectiveTable:e}=this,t=this.messages.toggleColumns;return U("calcite-popover",{autoClose:!0,class:K.menuPopover,label:t,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:this._columnVisibilityActions.get(this.id),topLayerDisabled:this.topLayerDisabled},U("calcite-list",{displayMode:"nested",filterEnabled:!0,filterPlaceholder:t,label:t,selectionMode:"multiple"},e.columns.toArray().map(t=>{const i=D(t)?t.columns?.map(t=>this._renderColumnListItem({column:t,table:e,ignoreSelect:!0})):void 0;return this._renderColumnListItem({column:t,table:e,items:i})})))}_renderColumnListItem(e){const{column:t,table:i,items:s,ignoreSelect:n}=e,{effectiveLabel:l,fieldName:o,hidden:a}=t;return U("calcite-list-item",{expanded:!(!s?.length||a)||void 0,key:`toggle-columns__item-${o}`,label:l,selected:!a,value:o,onCalciteListItemSelect:e=>{n&&e.stopPropagation(),i.toggleColumnVisibility(e.currentTarget.value)}},s)}_renderLayerDropdown(){const e=this.messages.selectALayer;return U("div",{class:K.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:"header-actions-start"},U("calcite-dropdown",{bind:this,maxItems:5,overlayPositioning:"fixed",placement:"bottom-start",topLayerDisabled:this.topLayerDisabled},U("calcite-action",{icon:q.layers,slot:"trigger",text:e,title:e}),U("calcite-dropdown-group",{selectionMode:"single"},this._effectiveLayers.map((e,t)=>this._renderLayerDropdownItem(e,t))??null)))}_renderLayerDropdownItem(e,t){const i=this.visibleElements.layerDropdownIcons;return U("calcite-dropdown-item",{iconStart:i?j(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){const{autoRefreshEnabled:t,autoSaveEnabled:i,editingEnabled:s,effectiveTable:n,multipleSelectionEnabled:l,paginationEnabled:o,pageSize:a,view:r,viewModel:c}=this,{layer:d,objectId:h,relatedLayer:m,relationshipId:p}=e;await d.load();const u=this.attachmentsEnabled&&x(d),g=new Z({layer:d,autoRefreshEnabled:t,autoSaveEnabled:i,attachmentsEnabled:u,editingEnabled:s,multipleSelectionEnabled:l,paginationEnabled:o,pageSize:a,relatedRecordsEnabled:!0,relationshipConfig:{objectId:h,relatedLayer:m,relationshipId:p},relationshipColumnConfigs:O(d,p),tableController:this,tableParent:n,view:r,showRelatedTableCallback:e=>c.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(){const e=this.attachmentsViewOptions,{objectId:t}=e;if(null!=t)return[U("div",{class:K.attachmentsView,key:"attachments-view"},this._renderAttachmentsViewInformation(),U("div",{class:K.attachmentsViewContent,key:"attachments-view-content"},U("div",{bind:this,class:K.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},U("calcite-icon",{class:K.attachmentsViewIcon,icon:q.upload,scale:"l"}),this._renderAttachmentsViewFileLabelNode(),this._renderAttachmentsViewFileMessageNode(),U("form",{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:"attachments-form"},U("fieldset",null,this._renderAttachmentsViewFileNameNode(),U("input",{afterCreate:H,afterRemoved:B,afterUpdate:H,bind:this,"data-node-ref":"_attachmentsInput",files:e.candidates,hidden:!0,name:"attachment",onchange:e=>this._onAttachmentsViewCandidateChange(e),type:"file"}),this._renderAttachmentsViewFileSelectNode(),this._renderAttachmentsViewFileSaveNode(),this._renderAttachmentsViewFileCancelNode())))))]}_renderAttachmentsViewFileLabelNode(){if("replace"===this.attachmentsViewOptions.fileMode)return U("span",{class:K.attachmentsViewDropAreaLabel,key:"replace-file-node"},this.messages.replaceFile)}_renderAttachmentsViewFileMessageNode(){const e=this.attachmentsViewOptions;if(e.hasCandidates)return;const{messages:t}=this,i=this.supportsAddAttachments?null==e.objectId?t.noFeature:t.dragAndDropToUpload:t.editingRestricted;return U("span",{class:K.attachmentsViewDropAreaMessage,key:"message-node"},i)}_renderAttachmentsViewFileNameNode(){const e=this.attachmentsViewOptions.candidates,t=Array.from(e??[]).at(-1);if(t)return U("span",{class:K.attachmentsViewDropAreaMessage,key:"filename-node"},t.name)}_renderAttachmentsViewFileSelectNode(){if(this.supportsAddAttachments)return U("calcite-button",{appearance:"outline-fill",disabled:this.isSyncingAttachments,iconStart:q.folderOpen,key:"select-node",onclick:()=>{this._resetAttachmentsInput(),this._attachmentsInput?.click()}},this.messages.selectFile)}_renderAttachmentsViewFileSaveNode(){const{isSyncingAttachments:e,messages:t}=this,{attachmentInfo:i,hasCandidates:s}=this.attachmentsViewOptions;if(this.supportsAddAttachments&&s)return U("calcite-button",{appearance:"solid",disabled:e,iconStart:q.save,key:"save-node",loading:e,onclick:()=>{this.saveAttachmentsViewForm()}},i?t.updateAttachment:t.addAttachment)}_renderAttachmentsViewFileCancelNode(){const{hasAttachments:e,hasCandidates:t}=this.attachmentsViewOptions;if(e||t)return U("calcite-button",{appearance:"transparent",bind:this,disabled:this.isSyncingAttachments,key:"cancel-node",onclick:()=>{this._resetAttachmentsInput(),this.attachmentsViewOptions.cancel()}},this.messagesCommon.cancel)}_renderAttachmentsViewDetails(){const{attachmentInfo:e}=this.attachmentsViewOptions;if(e)return[U("div",{class:K.attachmentsView,key:"attachments-view"},this._renderAttachmentsViewInformation(),U("div",{class:K.attachmentsViewContent,key:"attachments-view-content"},U("div",{class:K.attachmentsViewDetails},this._renderAttachmentsViewDetailsPreview(e))))]}_renderAttachmentsViewDetailsPreview(e){const t=[this._renderAttachmentsViewDetailsImage(e)];if(C(e.contentType)){const i=this.messages.maximize;t.push(U("calcite-action",{icon:q.expand,label:i,onclick:t=>{t.preventDefault(),this.attachmentsViewOptions.dialogId=e.id},text:i,textEnabled:!0,title:i}))}return t}_renderAttachmentsViewDetailsImage(e){const{contentType:t,name:i,size:s,url:n}=e,{messages:l}=this;return C(t)?U("img",{afterCreate:()=>this._attachmentsDialogPreviewLoading=!0,alt:i,key:`thumbnail-image-${i}`,onerror:()=>this._attachmentsDialogPreviewLoading=!1,onload:()=>this._attachmentsDialogPreviewLoading=!1,src:`${n}${n?.includes("?")?"&":"?"}s=${s}`,title:i}):[U("calcite-icon",{icon:V(t),key:`thumbnail-icon-${i}`,scale:"l",textLabel:i,title:i}),l.noPreviewAvailable]}_renderAttachmentsViewInformation(){const{attachmentsViewOptions:e,messages:t,messagesUnits:i}=this,{attachmentInfo:s,objectId:n}=e;if(s&&null!=n)return U("div",{class:K.attachmentsViewInformation,key:"information"},this._renderAttachmentViewInformationButtons(s,n),U("span",{class:K.attachmentsViewInformationLabel,key:"file-label"},t.fileName),U("span",{class:K.attachmentsViewInformationData,key:"file-value"},s.name),U("span",{class:K.attachmentsViewInformationLabel,key:"type-label"},t.attachmentType),U("span",{class:K.attachmentsViewInformationData,key:"type-value"},this._getLabelForAttachmentType(s)),this._renderAttachmentKeywordDetails(s),U("span",{class:K.attachmentsViewInformationLabel,key:"size-label"},t.size),U("span",{class:K.attachmentsViewInformationData,key:"size-span"},m(i,s.size??0)))}_renderAttachmentViewInformationButtons(e,t){const{attachmentsViewOptions:i,messages:s,messagesCommon:n}=this,l="details"!==i.effectiveMode,o=e.id,a=[U("calcite-button",{appearance:"outline",disabled:l,key:"download-button",onclick:e=>{e.preventDefault(),this.downloadAttachmentById(t,o)},width:"full"},s.download)];return this.supportsUpdateAttachments&&a.push(U("calcite-button",{appearance:"outline",disabled:l,key:"replace-button",onclick:()=>{i.mode="file",i.attachmentId=o},width:"full"},s.replace)),this.supportsDeleteAttachments&&a.push(U("calcite-button",{appearance:"outline",disabled:l,key:"delete-button",onclick:()=>{this.deleteAttachments(t,[o],!0)},width:"full"},n.delete)),a}_renderAttachmentKeywordDetails({keywords:e}){if(e&&""!==e)return[U("span",{class:K.attachmentsViewInformationLabel,key:"keyword-label"},this.messages.keyword),U("span",{class:K.attachmentsViewInformationData,key:"keyword-value"},e)]}_renderAttachmentsViewList(){const{attachmentsViewOptions:e,isSyncingAttachments:t,messages:i,messagesUnits:s}=this,{attachmentInfos:n,objectId:l}=e;return U("calcite-list",{afterCreate:H,afterRemoved:B,afterUpdate:H,bind:this,class:K.attachmentsViewList,"data-node-ref":"attachmentsList",key:`attachments-list-${l}`,label:i?.attachments,loading:t,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop,selectionMode:this.supportsDeleteAttachments?"multiple":"none",onCalciteListChange:()=>this.scheduleRender()},...n?.map(t=>{const{id:n,name:o,size:a}=t,r=m(s,a??0);return U("calcite-list-item",{afterRemoved:()=>this.scheduleRender(),key:`attachment-${n}`,label:o,value:n},this._renderAttachmentsViewListPreview(t),U("span",{class:K.attachmentsViewListFileSize,slot:"actions-end",title:r},r),U("calcite-action",{icon:q.downloadTo,key:"download",label:o,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(l??-1,n)},slot:"actions-end",text:i.downloadAttachment,title:i.downloadAttachment}),U("calcite-action",{icon:q.chevronRight,iconFlipRtl:!0,key:"details",label:o,onclick:()=>{e.mode="details",e.attachmentId=n},slot:"actions-end",text:i.viewAttachment,title:i.viewAttachment}))}))}_renderAttachmentsViewListPreview(e){return U("div",{class:K.attachmentsViewListThumbnail,slot:"content-start"},U("span",null,this._renderAttachmentsViewListImage(e)))}_renderAttachmentsViewListImage(e,t=64){const{contentType:i,name:s,size:n,url:l}=e,o=`${l}${l?.includes("?")?"&":"?"}w=${t}&s=${n}`;return this.supportsResizeAttachments&&C(i)?U("img",{alt:s,key:`thumbnail-image-${s}`,src:o,title:s}):U("calcite-icon",{icon:V(i),key:`thumbnail-icon-${s}`,scale:"l",textLabel:s,title:s})}_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}){const t=this.messages;return e.startsWith("image/")?t.attachmentTypes.image:e.startsWith("audio/")?t.attachmentTypes.audio:e.startsWith("video/")?t.attachmentTypes.video:e.startsWith("text/")||e.startsWith("application/")||e.startsWith("model/")?t.attachmentTypes.document:t.attachmentTypes.unknown}_renderNavigationBar(){const{effectiveTable:e,messages:i,messagesCommon:s,navigationScale:n,relatedTable:l,relatedTables:o}=this;if(!this._shouldShowNavigationBar)return;const{attachmentsList:a,attachmentsViewOptions:r,layer:c,supportsAddAttachments:d,supportsDeleteAttachments:h}=e;if(!c)return;const{attachmentInfos:m,objectId:p}=r,u=null!=p,g=m.length,w=a?.selectedItems?.length??0,b=`${c.objectIdField}: ${p}`,v=t(i.selectedCount,{count:w}),y=t(i.attachmentsCount,{count:g}),f=u?U("calcite-action",{bind:this,icon:q.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(p),scale:n,text:b,textEnabled:!0,title:b}):void 0,_=u?U("calcite-action",{icon:q.chevronRight,iconFlipRtl:!0,key:"navigation-attachments-label",label:y,onclick:()=>{g>0&&(r.mode="list")},scale:n,text:y,textEnabled:!0,title:y}):void 0,M=u?U("calcite-chip",{closable:!0,closed:0===w,key:"navigation-chip",kind:"inverse",label:v,scale:"s",selected:!0,title:v,value:"selected",onCalciteChipClose:()=>a?.selectedItems?.forEach(e=>e.selected=!1)},v):void 0,C=l?U("calcite-label",{layout:"inline",scale:n},i.showAllTables,U("calcite-switch",{checked:this.allRelatedTablesVisible,scale:n,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,V=u&&"list"===r.effectiveMode&&null!=p&&w&&h?U("calcite-action",{icon:q.delete,iconFlipRtl:!0,key:"attachments-trash-all",onclick:()=>{e.deleteAttachments(p,a?.selectedItems?.map(e=>e.value)??[],!0)},scale:n,text:s.delete,textEnabled:!0,title:t(i.deleteAttachmentCount,{count:w})}):void 0,A=u&&"list"===r.effectiveMode&&d?U("calcite-action",{bind:this,icon:q.plus,iconFlipRtl:!0,key:"attachments-add",onclick:()=>{r.objectId=p,r.attachmentId=null,r.mode="file"},scale:n,text:i.addAttachment,textEnabled:!0,title:i.addAttachment}):void 0;return U("div",{class:K.tableNavigation,key:"table-nav"},U("calcite-action",{icon:q.moveUp,iconFlipRtl:!0,key:"go-back",onclick:()=>this._onTableViewChange(this._resetNestedViews),scale:n,text:this.layer?.title??"",textEnabled:!1,title:l?i.exitRelatedRecords:i.exitAttachments}),o.toArray().map((e,t)=>this._renderRelatedTableNavigationAction(e,t)),f,_,U("div",null,M,C,V,A))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return U("calcite-action",{icon:q.chevronRight,iconFlipRtl:!0,key:t,onclick:()=>{(t!==this.relatedTables.length-1||this._attachmentsViewIsVisible)&&this._onTableViewChange(()=>this._onRelatedNavigationItemClick(t))},scale:this.navigationScale,text:i,textEnabled:!0,title:e.layer?.title||""})}_getLabelForRelatedTableNavigationAction(e){const t=e.layer?.title;if(!t)return"";const{relatedTables:i}=this;if(i.length<=1)return t;return i.indexOf(e)!==i.length-1&&t.length>20?`${t.slice(0,20)}...`:t}};e([p()],J.prototype,"_attachmentsDialogPreviewLoading",void 0),e([p()],J.prototype,"_attachmentsInput",void 0),e([p()],J.prototype,"_attachmentsViewIsVisible",null),e([p()],J.prototype,"_columnVisibilityActions",void 0),e([p()],J.prototype,"_dialogIsOpen",null),e([p()],J.prototype,"_effectiveDescription",null),e([p()],J.prototype,"_effectiveLayers",null),e([p()],J.prototype,"_effectiveTitle",null),e([p()],J.prototype,"_effectiveVisibleElements",null),e([p()],J.prototype,"_filteredTables",null),e([p()],J.prototype,"_hasAttachmentsViewError",null),e([p()],J.prototype,"_hasCustomMenuItems",null),e([p()],J.prototype,"_hasDefaultMenuItems",null),e([p()],J.prototype,"_shouldShowGrid",null),e([p()],J.prototype,"_shouldShowMenu",null),e([p()],J.prototype,"_showClearSelectionAction",null),e([p()],J.prototype,"_showColumnsVisibilityAction",null),e([p()],J.prototype,"_showDeleteSelectionAction",null),e([p()],J.prototype,"_showExportSelectionToCSVAction",null),e([p()],J.prototype,"_showLayerDropdown",null),e([p()],J.prototype,"_shouldShowNavigationBar",null),e([p()],J.prototype,"_showRefreshDataAction",null),e([p()],J.prototype,"_showSelectedRecordsShowSelectedAction",null),e([p()],J.prototype,"_showSelectedRecordsShowAllAction",null),e([p()],J.prototype,"_showZoomToSelectionAction",null),e([p()],J.prototype,"_viewLayers",null),e([p()],J.prototype,"attachmentsList",void 0),e([p({readOnly:!0})],J.prototype,"grid",null),e([p()],J.prototype,"actionColumn",null),e([p()],J.prototype,"actionColumnConfig",null),e([p({readOnly:!0})],J.prototype,"activeFilters",null),e([p({readOnly:!0})],J.prototype,"activeSortOrders",null),e([p()],J.prototype,"allColumns",null),e([p({readOnly:!0})],J.prototype,"allRelatedTablesVisible",null),e([p()],J.prototype,"allVisibleColumns",null),e([p()],J.prototype,"attachmentsColumns",null),e([p()],J.prototype,"attachmentsEnabled",null),e([p()],J.prototype,"attachmentsViewOptions",null),e([p({type:f})],J.prototype,"attributeTableTemplate",null),e([p()],J.prototype,"autoRefreshEnabled",null),e([p()],J.prototype,"autoSaveEnabled",null),e([p()],J.prototype,"canAddRelatedFeature",null),e([p()],J.prototype,"clearPrompt",null),e([p()],J.prototype,"columnPerformanceModeEnabled",null),e([p()],J.prototype,"columnReorderingEnabled",null),e([p({readOnly:!0})],J.prototype,"columns",null),e([p()],J.prototype,"definitionExpression",null),e([p()],J.prototype,"description",void 0),e([p()],J.prototype,"disabled",void 0),e([p()],J.prototype,"editingEnabled",null),e([p()],J.prototype,"effectiveSelectionManager",null),e([p()],J.prototype,"effectiveSize",null),e([p()],J.prototype,"effectiveTable",null),e([p()],J.prototype,"fieldColumns",null),e([p({types:g})],J.prototype,"filterGeometry",null),e([p()],J.prototype,"filterBySelectionEnabled",null),e([p()],J.prototype,"groupColumns",null),e([p()],J.prototype,"hasContingentValues",null),e([p()],J.prototype,"hasInvalidPendingEdits",null),e([p()],J.prototype,"hasPendingEdits",null),e([p()],J.prototype,"hiddenFields",null),e([p()],J.prototype,"highlightEnabled",null),e([p()],J.prototype,"highlightIds",null),e([p()],J.prototype,"icon",null),e([p()],J.prototype,"initialSize",null),e([p()],J.prototype,"isQueryingOrSyncing",null),e([p()],J.prototype,"isSyncing",null),e([p()],J.prototype,"isSyncingAttachments",null),e([p()],J.prototype,"label",null),e([p()],J.prototype,"layer",null),e([p()],J.prototype,"layers",null),e([p()],J.prototype,"layerView",null),e([p()],J.prototype,"maxSize",null),e([p(),z("esri/widgets/FeatureTable/t9n/FeatureTable")],J.prototype,"messages",null),e([p(),z("esri/t9n/common")],J.prototype,"messagesCommon",null),e([p(),z("esri/widgets/Editor/t9n/Editor")],J.prototype,"messagesEditor",void 0),e([p(),z("esri/core/t9n/Units")],J.prototype,"messagesUnits",null),e([p(),z("esri/widgets/support/t9n/uriUtils")],J.prototype,"messagesURIUtils",null),e([p()],J.prototype,"menuConfig",null),e([p()],J.prototype,"multipleSelectionEnabled",null),e([p()],J.prototype,"multipleSelectionEnabledOverride",null),e([p()],J.prototype,"multiSortEnabled",null),e([p()],J.prototype,"multipleSortPriority",null),e([p()],J.prototype,"navigationScale",void 0),e([p()],J.prototype,"noDataMessage",null),e([p()],J.prototype,"objectIds",null),e([p()],J.prototype,"outFields",null),e([p()],J.prototype,"pageCount",null),e([p()],J.prototype,"pageIndex",null),e([p()],J.prototype,"pageSize",null),e([p()],J.prototype,"paginationEnabled",null),e([p()],J.prototype,"pendingEditsCount",null),e([p()],J.prototype,"prompt",null),e([p()],J.prototype