@arcgis/core 5.2.0-next.114 → 5.2.0-next.115
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/Graphic.d.ts +5 -3
- package/applications/Urban/LineImagePattern3D.js +1 -1
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02f94f9d704f03ddb5c6.js +1 -0
- package/assets/esri/core/workers/chunks/{c517e732cab41093b2e0.js → 0312c40d94b248ad71e3.js} +1 -1
- package/assets/esri/core/workers/chunks/0463c807b37f01bbc35c.js +1 -0
- package/assets/esri/core/workers/chunks/0ff13f7a18b0123d253e.js +1 -0
- package/assets/esri/core/workers/chunks/2e0fd0536408053ac6f5.js +1 -0
- package/assets/esri/core/workers/chunks/{6b264006b96cbf93d8ed.js → 48d3da636be15581fd7d.js} +1 -1
- package/assets/esri/core/workers/chunks/515fe302743c0b46f7e0.js +1 -0
- package/assets/esri/core/workers/chunks/{982a396bd4fffa62e911.js → 526cc64ae46dec3fbeda.js} +1 -1
- package/assets/esri/core/workers/chunks/{d13cf2e8b24e978ea77c.js → 7243d5721bb6a7329055.js} +1 -1
- package/assets/esri/core/workers/chunks/{785206da3962ba23de16.js → 84b89c523d3e16a5ee46.js} +1 -1
- package/assets/esri/core/workers/chunks/{484b3e2a220c440ccbb4.js → 9b92c41907e2da80c288.js} +1 -1
- package/assets/esri/core/workers/chunks/{4d2553219ffd223b0e90.js → a774006be107e449bc29.js} +1 -1
- package/assets/esri/core/workers/chunks/b45ebb1b64ee7314375e.js +1 -0
- package/assets/esri/core/workers/chunks/{e0f417992889a6c41095.js → baa8bce361a2677533ec.js} +1 -1
- package/assets/esri/core/workers/chunks/{96ebf76661b12128ddd5.js → be4de7111bc21bc69de1.js} +1 -1
- package/assets/esri/core/workers/chunks/{e164acd876bbd42ed658.js → f18ee2eaa96d103627a6.js} +1 -1
- package/chunks/RibbonLine.glsl.js +63 -58
- package/config.js +1 -1
- package/core/screenUtils.js +1 -1
- package/core/units.js +1 -1
- package/graphic/getGraphicOriginTitle.d.ts +10 -0
- package/graphic/getGraphicOriginTitle.js +2 -0
- package/kernel.js +1 -1
- package/layers/MapNotesLayer.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/layers/support/Field.js +1 -1
- package/layers/support/TimeSeriesInfo.d.ts +1 -1
- package/layers/support/featurePopupQueryUtils.js +1 -1
- package/layers/support/timeSeriesUtils.js +1 -1
- package/layers/support/types.d.ts +1 -1
- package/layers/types.d.ts +1 -2
- package/package.json +2 -2
- package/portal/schemas/definitions.js +1 -1
- package/rest/support/OutDistance.d.ts +19 -18
- package/rest/support/Query.d.ts +48 -18
- package/smartMapping/renderers/support/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/patterns/LinePattern3D.js +1 -1
- package/symbols/patterns/LineStylePattern3D.js +1 -1
- package/symbols/patterns/LineTemplatePattern3D.js +1 -1
- package/symbols/patterns/utils.js +1 -1
- package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
- package/views/2d/support/clippingUtils.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/3d/support/buffer/InterleavedLayout.js +1 -1
- package/views/3d/webgl-engine/lib/AttributeView.js +2 -0
- package/views/3d/webgl-engine/lib/attributeViewUtils.js +2 -0
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterialBaseInstance.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/PopupView.d.ts +64 -2
- package/views/View2D.js +1 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/widgets/BasemapLayerList/BasemapLayerListViewModel.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/CatalogLayerList/CatalogLayerListViewModel.d.ts +2 -1
- package/widgets/CatalogLayerList/CatalogLayerListViewModel.js +1 -1
- package/widgets/CatalogLayerList/CatalogLayerListVisibleElements.d.ts +5 -1
- package/widgets/CatalogLayerList/types.d.ts +12 -1
- package/widgets/CatalogLayerList.d.ts +2 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/TableList/ListItem.d.ts +2 -0
- package/widgets/TableList/ListItemPanel.d.ts +4 -0
- package/widgets/TableList/TableListViewModel.d.ts +4 -0
- package/widgets/TableList/TableListViewModel.js +1 -1
- package/widgets/TableList/TableListVisibleElements.d.ts +6 -1
- package/widgets/TableList/types.d.ts +12 -1
- package/widgets/TableList.d.ts +3 -0
- package/widgets/TableList.js +1 -1
- package/assets/esri/core/workers/chunks/078ed48eb055dd213ee6.js +0 -1
- package/assets/esri/core/workers/chunks/1004e77593dfa506cd5d.js +0 -1
- package/assets/esri/core/workers/chunks/510a190a6f0a60ae38c3.js +0 -1
- package/assets/esri/core/workers/chunks/cd0f5cd0fefe7f49e3d8.js +0 -1
- package/assets/esri/core/workers/chunks/e6fb7b93cf73b05b1079.js +0 -1
- package/assets/esri/core/workers/chunks/f86ea5cf4814b458d50b.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../core/Collection.js";import{
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../core/Collection.js";import{deprecateUnnecessaryViewModel as s}from"../../core/deprecate.js";import{EventedAccessor as i}from"../../core/Evented.js";import o from"../../core/Logger.js";import{watch as r,initial as a,on as l}from"../../core/reactiveUtils.js";import{property as c,subclass as d}from"../../core/accessorSupport/decorators.js";import n from"../LayerList/ListItem.js";import{findLayerListMode as m}from"../LayerList/support/layerListUtils.js";const h={layerListMode:"layer-list-mode"},p="hide",y=e.ofType(n);let u=class extends i{constructor(t){super(t),this.catalogItems=new y,this.checkPublishStatusEnabled=!1,this.catalogLayer=null,this.listItemCreatedFunction=null,this.listModeDisabled=!1,this.view=null,t?.suppressDeprecationWarning||s(o.getLogger(this),"Catalog Layer List (Next)","arcgis-catalog-layer-list-next",{version:"5.2"})}normalizeCtorArgs(t){const{suppressDeprecationWarning:e,...s}=t??{};return s}initialize(){this.addHandles([r(()=>[this.catalogLayer?.loaded,this.view?.ready],()=>this._compileList(),a),l(()=>this.catalogLayer?.dynamicGroupLayer.layers,"change",()=>this._compileList()),r(()=>[this.listItemCreatedFunction,this.checkPublishStatusEnabled,this.listModeDisabled],()=>this._recompileList())])}destroy(){this.view=null,this._removeAllItems()}get state(){const{view:t,catalogLayer:e}=this;return t?.ready&&e?.loaded?"ready":t&&e?"loading":"disabled"}get totalItems(){return this.catalogItems.flatten(t=>t.children).length}triggerAction(t,e){t&&!t.disabled&&this.emit("trigger-action",{action:t,item:e})}_createListItem(t){const{view:e,listItemCreatedFunction:s,checkPublishStatusEnabled:i,listModeDisabled:o}=this;return new n({checkPublishStatusEnabled:i,listModeDisabled:o,layer:t,listItemCreatedFunction:s,view:e})}_removeAllItems(){this.catalogItems.destroyAll()}_getViewableLayers(t){return t?this.listModeDisabled?t:t.filter(t=>m(t)!==p):void 0}_watchLayersListMode(t){this.removeHandles(h.layerListMode),t&&!this.listModeDisabled&&this.addHandles(r(()=>t.filter(t=>"listMode"in t).map(t=>t.listMode).toArray(),()=>this._compileList()),h.layerListMode)}_compileList(){const{catalogLayer:t}=this;if(!t?.loaded)return;const e=t?.dynamicGroupLayer.layers;this._watchLayersListMode(e);const s=this._getViewableLayers(e);s?.length?(this._createNewItems(s),this._removeItems(s),this._sortItems(s)):this._removeAllItems()}_createNewItems(t){const{catalogItems:e}=this;t.forEach(t=>{e.some(e=>e.layer===t)||e.add(this._createListItem(t))})}_removeItems(t){const{catalogItems:e}=this,s=[];e.forEach(e=>{e&&t?.includes(e.layer)||s.push(e)}),e.destroyMany(s)}_sortItems(t){const{catalogItems:e}=this;e.sort((e,s)=>{const i=t.indexOf(e.layer),o=t.indexOf(s.layer);return i>o?-1:i<o?1:0})}_recompileList(){this._removeAllItems(),this._compileList()}};t([c({type:y})],u.prototype,"catalogItems",void 0),t([c()],u.prototype,"checkPublishStatusEnabled",void 0),t([c()],u.prototype,"catalogLayer",void 0),t([c()],u.prototype,"listItemCreatedFunction",void 0),t([c({nonNullable:!0})],u.prototype,"listModeDisabled",void 0),t([c({readOnly:!0})],u.prototype,"state",null),t([c()],u.prototype,"totalItems",null),t([c()],u.prototype,"view",void 0),u=t([d("esri.widgets.CatalogLayerList.CatalogLayerListViewModel")],u);export{u as default};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type Accessor from "../../core/Accessor.js";
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated since version 5.2. Use the [Catalog Layer List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-catalog-layer-list-next/) component instead.
|
|
5
|
+
* @since 5.0
|
|
6
|
+
*/
|
|
4
7
|
export interface CatalogLayerListVisibleElementsProperties extends Partial<Pick<CatalogLayerListVisibleElements, "closeButton" | "collapseButton" | "errors" | "filter" | "flow" | "heading" | "statusIndicators" | "temporaryLayerIndicators">> {}
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* The visible elements that are displayed within the catalog layer list.
|
|
8
11
|
* This provides the ability to turn on/off individual elements of the catalog layer list.
|
|
9
12
|
*
|
|
13
|
+
* @deprecated since version 5.2. Use the [Catalog Layer List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-catalog-layer-list-next/) component instead.
|
|
10
14
|
* @since 5.0
|
|
11
15
|
*/
|
|
12
16
|
export default class CatalogLayerListVisibleElements extends Accessor {
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the CatalogLayerList widget.
|
|
3
|
+
*
|
|
4
|
+
* @deprecated since version 5.2. Use the [Catalog Layer List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-catalog-layer-list-next/) component instead.
|
|
5
|
+
*/
|
|
6
|
+
import type CatalogLayerListViewModel from "./CatalogLayerListViewModel.js";
|
|
7
|
+
|
|
1
8
|
/**
|
|
2
9
|
* * Describes the current state of the list items in the [CatalogLayerListViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/CatalogLayerList/CatalogLayerListViewModel/).
|
|
3
10
|
*
|
|
11
|
+
* @deprecated since version 5.2. Use the [Catalog Layer List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-catalog-layer-list-next/) component instead.
|
|
4
12
|
* @since 5.0
|
|
5
13
|
*/
|
|
6
|
-
export type CatalogLayerListState = "ready" | "loading" | "disabled";
|
|
14
|
+
export type CatalogLayerListState = "ready" | "loading" | "disabled";
|
|
15
|
+
|
|
16
|
+
/** @deprecated since version 5.2. Use the [Catalog Layer List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-catalog-layer-list-next/) component instead. */
|
|
17
|
+
export type CatalogLayerListViewModelParams = Partial<Pick<CatalogLayerListViewModel, "catalogItems" | "listItemCreatedFunction" | "view">>;
|
|
@@ -15,6 +15,7 @@ import type { ListItemProperties } from "./LayerList/ListItem.js";
|
|
|
15
15
|
import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
|
|
16
16
|
import type { CatalogLayerListVisibleElementsProperties } from "./CatalogLayerList/CatalogLayerListVisibleElements.js";
|
|
17
17
|
|
|
18
|
+
/** @deprecated since version 5.2. Use the [Catalog Layer List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-catalog-layer-list-next/) component instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/). */
|
|
18
19
|
export interface CatalogLayerListProperties extends WidgetProperties, IdentifiableMixinProperties, Partial<Pick<CatalogLayerList, "catalogItems" | "catalogLayer" | "collapsed" | "filterPlaceholder" | "filterPredicate" | "filterText" | "headingLevel" | "listItemCreatedFunction" | "minFilterItems" | "selectionMode" | "view" | "visibilityAppearance">> {
|
|
19
20
|
/**
|
|
20
21
|
* Icon which represents the widget. It is typically used when the widget is controlled by another
|
|
@@ -76,7 +77,7 @@ export interface CatalogLayerListEvents extends CatalogLayerListViewModelEvents
|
|
|
76
77
|
*
|
|
77
78
|
* 
|
|
78
79
|
*
|
|
79
|
-
* @deprecated since version 5.0. Use the [Catalog Layer List](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-catalog-layer-list/) component instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
|
|
80
|
+
* @deprecated since version 5.0. Use the [Catalog Layer List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-catalog-layer-list-next/) component instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
|
|
80
81
|
* @since 4.30
|
|
81
82
|
* @see [CatalogLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/)
|
|
82
83
|
* @see [CatalogLayerListViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/CatalogLayerList/CatalogLayerListViewModel/)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{deprecateWidget as o}from"../core/deprecate.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import s from"../core/Logger.js";import l from"../core/ReactiveMap.js";import{on as a,initial as r,watch as n}from"../core/reactiveUtils.js";import{property as p,subclass as d}from"../core/accessorSupport/decorators.js";import c from"./Widget.js";import m from"./CatalogLayerList/CatalogLayerListViewModel.js";import h from"./CatalogLayerList/CatalogLayerListVisibleElements.js";import{css as y}from"./CatalogLayerList/css.js";import u from"./LayerList/LayerListItem.js";import g from"./LayerList/ListItem.js";import{minFilterItems as L,getItem as f,removeDestroyedListItems as _,setFilterPredicate as v}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as I}from"./support/componentsUtils.js";import{globalCss as w}from"./support/globalCss.js";import{calciteListFilterProps as b}from"./support/listUtils.js";import{tsx as C,messageBundle as F,vmEvent as M}from"./support/widget.js";import{setFocus as O}from"./support/widgetUtils.js";var T;const P=t.ofType(g),A="nested";let E=T=class extends(i(c)){constructor(e,i){super(e,i),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new l,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new l,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minFilterItems=L,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new P,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new h,this._onTablesOpen=e=>{this.onTablesOpen?this.onTablesOpen(e):(this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid)},this._onCatalogOpen=e=>{this.onCatalogOpen?this.onCatalogOpen(e):(this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid)},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(y.item));this._activeItem=f(t)},this.announceDeprecation=()=>{o(s.getLogger(this),"Catalog Layer List","arcgis-catalog-layer-list",{version:"5.0"})}}initialize(){this.addHandles([a(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),r),a(()=>this.viewModel.catalogItems,"change",()=>_(this.selectedItems),r),n(()=>[this.filterPredicate,this._rootListEl],()=>v(this._rootListEl,this.filterPredicate))])}loadDependencies(){return I({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),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"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get _visibleItems(){return this.catalogItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,o)=>this._renderLayerFlowItem(t,o===e.length-1))}get catalogItems(){return this.viewModel.catalogItems}set catalogItems(e){this.viewModel.catalogItems=e}get catalogLayer(){return this.viewModel.catalogLayer}set catalogLayer(e){this.viewModel.catalogLayer=e}get icon(){return"catalog-dataset"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[w.hidden]:"loading"===e,[w.disabled]:"disabled"===e};return C("div",{class:this.classes(y.base,w.widget,w.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:o}=this,i=o.get(e);if(i)return i;const s="catalog"===e.type?this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||o.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:o}=this;this._openedLayersController?.abort();const i=new AbortController,{signal:s}=i;this._openedLayersController=i,e.forEach((o,i)=>{t.includes(i)||(o.destroy(),e.delete(i))});const l=await Promise.all(t.map(e=>this._createFlowList(e,s)));if(s.aborted)return;o.removeAll(),o.addMany(l);const a=o.at(-1);a?"catalogLayer"in a?(this._set("catalogLayerList",a),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",a)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.forEach(e=>e.destroy()),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:o}=this;return e?.layer?C("calcite-tooltip",{key:`tooltip-${e.layer.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer.uid),topLayerDisabled:this.topLayerDisabled},o.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return C("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return C("div",{class:y.itemMessage,key:"esri-layer-list__no-items"},C("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:o,panel:i},s)=>{const l=()=>this._handlePanelFlowItemBack(i);return C("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:o,heading:i.title,headingLevel:this.headingLevel,key:`flow-panel-${i.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},i.render(),C("calcite-button",{appearance:"transparent",slot:"footer-start",width:"full",onclick:l},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,O(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,O(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:o,_filterEnabled:i,_rootGroupUid:s,visibleElements:{closeButton:l,collapseButton:a,heading:r,flow:n},selectionMode:p,filterText:d,filterPlaceholder:c,messages:m,openedLayers:h,_openedPanelItems:u}=this,g=[C("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:l,closed:!e,collapsed:t,collapsible:a,heading:r?m.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!h.length&&!u.length,onCalciteFlowItemClose:()=>this.visible=!1},o?.length?null:this._renderNoItems(),C("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},"data-layer-type":s,displayMode:A,filterEnabled:i,filterPlaceholder:c,filterProps:b,filterText:i?d:"",group:s,key:"root-list",label:m.widgetLabel,selectionAppearance:"border",selectionMode:p,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem},o.toArray().map(e=>this._renderItem(e)),i?C("div",{class:y.filterNoResults,slot:"filter-no-results"},C("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?n?C("calcite-flow",{key:"root-flow"},g):g:null}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,O(e))}_renderLayerFlowItem(e,t){const{messages:o,openedLayers:i}=this,s=e.title||this.messages.untitledLayer;return C("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:o["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),i.pop();const t=i.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_createCatalogLayerList(e){const{headingLevel:t,catalogOptions:o,view:i,filterPlaceholder:s,listItemCreatedFunction:l,minFilterItems:a,selectionMode:r,visibilityAppearance:n,onCatalogOpen:p,onTablesOpen:d}=this;return new T({headingLevel:t,view:i,filterPlaceholder:s,listItemCreatedFunction:l,minFilterItems:a,selectionMode:r,visibilityAppearance:n,...o,catalogLayer:e,onCatalogOpen:p,onTablesOpen:d})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await(import("./TableList.js")),{headingLevel:o,selectionMode:i}=this;return new t({headingLevel:o,selectionMode:i,...this._getTableListParams(e)})}_renderItem(e,t,o){return C(u,{activeItem:this._activeItem,css:y,displayMode:A,dragEnabled:!1,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:o,rootGroupUid:this._rootGroupUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:o}=this;if("none"===t)return;const i=e.target.selectedItems.map(e=>f(e)).filter(Boolean);o.removeAll(),o.addMany(i)}};e([p()],E.prototype,"_rootListEl",void 0),e([p()],E.prototype,"_activeItem",void 0),e([p()],E.prototype,"_tooltipReferenceMap",void 0),e([p()],E.prototype,"_focusRootFlowItem",void 0),e([p()],E.prototype,"_focusPanelFlowItem",void 0),e([p()],E.prototype,"_focusLayerFlowItem",void 0),e([p()],E.prototype,"_layerListMap",void 0),e([p()],E.prototype,"_filterEnabled",null),e([p()],E.prototype,"_visibleItems",null),e([p()],E.prototype,"_openedPanelItems",null),e([p()],E.prototype,"_renderedOpenLayerFlowItems",null),e([p()],E.prototype,"catalogItems",null),e([p()],E.prototype,"catalogLayer",null),e([p({readOnly:!0})],E.prototype,"catalogLayerList",void 0),e([p()],E.prototype,"catalogOptions",void 0),e([p()],E.prototype,"collapsed",void 0),e([p()],E.prototype,"filterPlaceholder",void 0),e([p()],E.prototype,"filterPredicate",void 0),e([p()],E.prototype,"filterText",void 0),e([p()],E.prototype,"headingLevel",void 0),e([p()],E.prototype,"icon",null),e([p()],E.prototype,"knowledgeGraphOptions",void 0),e([p()],E.prototype,"label",null),e([p()],E.prototype,"layerTablesEnabled",void 0),e([p()],E.prototype,"listItemCreatedFunction",null),e([p()],E.prototype,"mapImageOptions",void 0),e([p(),F("esri/widgets/CatalogLayerList/t9n/CatalogLayerList")],E.prototype,"messages",void 0),e([p(),F("esri/t9n/common")],E.prototype,"messagesCommon",void 0),e([p()],E.prototype,"minFilterItems",void 0),e([p({readOnly:!0})],E.prototype,"openedLayers",void 0),e([p({readOnly:!0})],E.prototype,"openedLayerLists",void 0),e([p()],E.prototype,"onCatalogOpen",void 0),e([p()],E.prototype,"onTablesOpen",void 0),e([p({type:P})],E.prototype,"selectedItems",void 0),e([p()],E.prototype,"selectionMode",void 0),e([p({readOnly:!0})],E.prototype,"tableList",void 0),e([p()],E.prototype,"tileOptions",void 0),e([p()],E.prototype,"view",null),e([M("trigger-action"),p({type:m})],E.prototype,"viewModel",void 0),e([p()],E.prototype,"visibilityAppearance",void 0),e([p({type:h,nonNullable:!0})],E.prototype,"visibleElements",void 0),E=T=e([d("esri.widgets.CatalogLayerList")],E);const k=E;export{k as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{deprecateWidget as o}from"../core/deprecate.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import s from"../core/Logger.js";import l from"../core/ReactiveMap.js";import{on as a,initial as r,watch as n}from"../core/reactiveUtils.js";import{property as p,subclass as d}from"../core/accessorSupport/decorators.js";import c from"./Widget.js";import m from"./CatalogLayerList/CatalogLayerListViewModel.js";import h from"./CatalogLayerList/CatalogLayerListVisibleElements.js";import{css as y}from"./CatalogLayerList/css.js";import u from"./LayerList/LayerListItem.js";import g from"./LayerList/ListItem.js";import{minFilterItems as L,getItem as f,removeDestroyedListItems as _,setFilterPredicate as v}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as I}from"./support/componentsUtils.js";import{globalCss as w}from"./support/globalCss.js";import{calciteListFilterProps as b}from"./support/listUtils.js";import{tsx as C,messageBundle as F,vmEvent as M}from"./support/widget.js";import{setFocus as O}from"./support/widgetUtils.js";var T;const P=t.ofType(g),A="nested";let E=T=class extends(i(c)){constructor(e,i){super(e,i),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new l,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new l,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minFilterItems=L,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new P,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new m({suppressDeprecationWarning:!0}),this.visibilityAppearance="default",this.visibleElements=new h,this._onTablesOpen=e=>{this.onTablesOpen?this.onTablesOpen(e):(this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid)},this._onCatalogOpen=e=>{this.onCatalogOpen?this.onCatalogOpen(e):(this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid)},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(y.item));this._activeItem=f(t)},!0!==e?.suppressDeprecationWarning&&(this.announceDeprecation=()=>{o(s.getLogger(this),"Catalog Layer List","arcgis-catalog-layer-list-next",{version:"5.0"})})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...o}=e;return o}initialize(){this.addHandles([a(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),r),a(()=>this.viewModel.catalogItems,"change",()=>_(this.selectedItems),r),n(()=>[this.filterPredicate,this._rootListEl],()=>v(this._rootListEl,this.filterPredicate))])}loadDependencies(){return I({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),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"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get _visibleItems(){return this.catalogItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,o)=>this._renderLayerFlowItem(t,o===e.length-1))}get catalogItems(){return this.viewModel.catalogItems}set catalogItems(e){this.viewModel.catalogItems=e}get catalogLayer(){return this.viewModel.catalogLayer}set catalogLayer(e){this.viewModel.catalogLayer=e}get icon(){return"catalog-dataset"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[w.hidden]:"loading"===e,[w.disabled]:"disabled"===e};return C("div",{class:this.classes(y.base,w.widget,w.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:o}=this,i=o.get(e);if(i)return i;const s="catalog"===e.type?this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||o.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:o}=this;this._openedLayersController?.abort();const i=new AbortController,{signal:s}=i;this._openedLayersController=i,e.forEach((o,i)=>{t.includes(i)||(o.destroy(),e.delete(i))});const l=await Promise.all(t.map(e=>this._createFlowList(e,s)));if(s.aborted)return;o.removeAll(),o.addMany(l);const a=o.at(-1);a?"catalogLayer"in a?(this._set("catalogLayerList",a),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",a)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.forEach(e=>e.destroy()),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:o}=this;return e?.layer?C("calcite-tooltip",{key:`tooltip-${e.layer.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer.uid),topLayerDisabled:this.topLayerDisabled},o.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return C("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return C("div",{class:y.itemMessage,key:"esri-layer-list__no-items"},C("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:o,panel:i},s)=>{const l=()=>this._handlePanelFlowItemBack(i);return C("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:o,heading:i.title,headingLevel:this.headingLevel,key:`flow-panel-${i.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},i.render(),C("calcite-button",{appearance:"transparent",slot:"footer-start",width:"full",onclick:l},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,O(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,O(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:o,_filterEnabled:i,_rootGroupUid:s,visibleElements:{closeButton:l,collapseButton:a,heading:r,flow:n},selectionMode:p,filterText:d,filterPlaceholder:c,messages:m,openedLayers:h,_openedPanelItems:u}=this,g=[C("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:l,closed:!e,collapsed:t,collapsible:a,heading:r?m.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!h.length&&!u.length,onCalciteFlowItemClose:()=>this.visible=!1},o?.length?null:this._renderNoItems(),C("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},"data-layer-type":s,displayMode:A,filterEnabled:i,filterPlaceholder:c,filterProps:b,filterText:i?d:"",group:s,key:"root-list",label:m.widgetLabel,selectionAppearance:"border",selectionMode:p,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem},o.toArray().map(e=>this._renderItem(e)),i?C("div",{class:y.filterNoResults,slot:"filter-no-results"},C("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?n?C("calcite-flow",{key:"root-flow"},g):g:null}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,O(e))}_renderLayerFlowItem(e,t){const{messages:o,openedLayers:i}=this,s=e.title||this.messages.untitledLayer;return C("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:o["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),i.pop();const t=i.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_createCatalogLayerList(e){const{headingLevel:t,catalogOptions:o,view:i,filterPlaceholder:s,listItemCreatedFunction:l,minFilterItems:a,selectionMode:r,visibilityAppearance:n,onCatalogOpen:p,onTablesOpen:d}=this;return new T({headingLevel:t,view:i,filterPlaceholder:s,listItemCreatedFunction:l,minFilterItems:a,selectionMode:r,visibilityAppearance:n,...o,catalogLayer:e,onCatalogOpen:p,onTablesOpen:d,suppressDeprecationWarning:!0})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await(import("./TableList.js")),{headingLevel:o,selectionMode:i}=this;return new t({headingLevel:o,selectionMode:i,...this._getTableListParams(e)})}_renderItem(e,t,o){return C(u,{activeItem:this._activeItem,css:y,displayMode:A,dragEnabled:!1,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:o,rootGroupUid:this._rootGroupUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:o}=this;if("none"===t)return;const i=e.target.selectedItems.map(e=>f(e)).filter(Boolean);o.removeAll(),o.addMany(i)}};e([p()],E.prototype,"_rootListEl",void 0),e([p()],E.prototype,"_activeItem",void 0),e([p()],E.prototype,"_tooltipReferenceMap",void 0),e([p()],E.prototype,"_focusRootFlowItem",void 0),e([p()],E.prototype,"_focusPanelFlowItem",void 0),e([p()],E.prototype,"_focusLayerFlowItem",void 0),e([p()],E.prototype,"_layerListMap",void 0),e([p()],E.prototype,"_filterEnabled",null),e([p()],E.prototype,"_visibleItems",null),e([p()],E.prototype,"_openedPanelItems",null),e([p()],E.prototype,"_renderedOpenLayerFlowItems",null),e([p()],E.prototype,"catalogItems",null),e([p()],E.prototype,"catalogLayer",null),e([p({readOnly:!0})],E.prototype,"catalogLayerList",void 0),e([p()],E.prototype,"catalogOptions",void 0),e([p()],E.prototype,"collapsed",void 0),e([p()],E.prototype,"filterPlaceholder",void 0),e([p()],E.prototype,"filterPredicate",void 0),e([p()],E.prototype,"filterText",void 0),e([p()],E.prototype,"headingLevel",void 0),e([p()],E.prototype,"icon",null),e([p()],E.prototype,"knowledgeGraphOptions",void 0),e([p()],E.prototype,"label",null),e([p()],E.prototype,"layerTablesEnabled",void 0),e([p()],E.prototype,"listItemCreatedFunction",null),e([p()],E.prototype,"mapImageOptions",void 0),e([p(),F("esri/widgets/CatalogLayerList/t9n/CatalogLayerList")],E.prototype,"messages",void 0),e([p(),F("esri/t9n/common")],E.prototype,"messagesCommon",void 0),e([p()],E.prototype,"minFilterItems",void 0),e([p({readOnly:!0})],E.prototype,"openedLayers",void 0),e([p({readOnly:!0})],E.prototype,"openedLayerLists",void 0),e([p()],E.prototype,"onCatalogOpen",void 0),e([p()],E.prototype,"onTablesOpen",void 0),e([p({type:P})],E.prototype,"selectedItems",void 0),e([p()],E.prototype,"selectionMode",void 0),e([p({readOnly:!0})],E.prototype,"tableList",void 0),e([p()],E.prototype,"tileOptions",void 0),e([p()],E.prototype,"view",null),e([M("trigger-action"),p({type:m})],E.prototype,"viewModel",void 0),e([p()],E.prototype,"visibilityAppearance",void 0),e([p({type:h,nonNullable:!0})],E.prototype,"visibleElements",void 0),E=T=e([d("esri.widgets.CatalogLayerList")],E);const k=E;export{k as default};
|
package/widgets/LayerList.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{deprecateWidget as i}from"../core/deprecate.js";import{IdentifiableMixin as o}from"../core/Identifiable.js";import s from"../core/Logger.js";import l from"../core/ReactiveMap.js";import{on as r,initial as a,watch as n}from"../core/reactiveUtils.js";import{property as d,subclass as p}from"../core/accessorSupport/decorators.js";import c from"./Widget.js";import{css as m}from"./LayerList/css.js";import h from"./LayerList/LayerListItem.js";import y from"./LayerList/LayerListViewModel.js";import u from"./LayerList/LayerListVisibleElements.js";import g from"./LayerList/ListItem.js";import{minDragEnabledItems as L,minFilterItems as _,getItem as f,getLayerType as v,removeDestroyedListItems as I,setFilterPredicate as w,sortLayersToIds as b,sortChildLayersToIds as C}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as F}from"./support/globalCss.js";import{calciteListFilterProps as M}from"./support/listUtils.js";import{tsx as O,messageBundle as T,vmEvent as P}from"./support/widget.js";import{setFocus as A}from"./support/widgetUtils.js";const D=t.ofType(g),R="nested";let k=class extends(o(c)){constructor(e,o){super(e,o),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new l,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new l,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=L,this.minFilterItems=_,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new D,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new y({suppressDeprecationWarning:!0}),this.visibilityAppearance="default",this.visibleElements=new u,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=f(e);if(!l?.sortable)return!1;const r=f(t),a=v(t),n=f(i),d=v(i),p=!!a&&!!d&&a===d,c={selected:l,from:r,to:n},m=t.group,h=i.group,y=r?.layer?.type??"",u=n?.layer?.type??"",g=new Set(["map-image","catalog","knowledge-graph"]),L="sublayer";return m&&h&&"function"==typeof s?s.call(null,c):p&&!g.has(y)&&!g.has(u)&&l?.layer?.type!==L},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(m.item));this._activeItem=f(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(o&&i&&!(t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o)){if(this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value,o===i){const e=Array.from(o.children).filter(e=>e?.matches("calcite-list-item")).map(e=>e.value);return void this._sortLayers(o,e)}null!=l&&this._moveLayerFromChildList({toEl:i,fromEl:o,dragEl:s,newIndex:l})}},this.announceDeprecation=()=>{i(s.getLogger(this),"Layer List","arcgis-layer-list",{version:"5.0"})}}initialize(){this.addHandles([r(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),a),r(()=>this.viewModel.operationalItems,"change",()=>I(this.selectedItems),a),n(()=>[this.filterPredicate,this._rootListEl],()=>w(this._rootListEl,this.filterPredicate))])}loadDependencies(){return E({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),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"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _totalItems(){return this.viewModel.operationalItems.flatten(e=>e.children.filter(e=>"catalog-dynamic-group"!==e.layer?.type)).length}get _visibleItems(){return this.operationalItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _dragEnabled(){return this._totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,i)=>this._renderLayerFlowItem(t,i===e.length-1))}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[F.hidden]:"loading"===e,[F.disabled]:"disabled"===e};return O("div",{class:this.classes(m.base,F.widget,F.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:i}=this,o=i.get(e);if(o)return o;const s="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const o=new AbortController,{signal:s}=o;this._openedLayersController=o,e.forEach((i,o)=>{t.includes(o)||(i.destroy(),e.delete(o))});const l=await Promise.all(t.map(e=>this._createFlowList(e,s)));if(s.aborted)return;i.removeAll(),i.addMany(l);const r=i.at(-1);r?"catalogLayer"in r?(this._set("catalogLayerList",r),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",r)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?O("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer?.uid),topLayerDisabled:this.topLayerDisabled},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return O("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return O("div",{class:m.itemMessage,key:"esri-layer-list__no-items"},O("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}async _createCatalogLayerList(e){const{default:t}=await(import("./CatalogLayerList.js")),{headingLevel:i,catalogOptions:o,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,_onCatalogOpen:p,_onTablesOpen:c,layerTablesEnabled:m}=this;return new t({headingLevel:i,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,...o,catalogLayer:e,layerTablesEnabled:m,onCatalogOpen:p,onTablesOpen:c})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await(import("./TableList.js")),{headingLevel:i,selectionMode:o,dragEnabled:s}=this;return new t({headingLevel:i,selectionMode:o,dragEnabled:s,...this._getTableListParams(e)})}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:o}=this,s=e.title||this.messages.untitledLayer;return O("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),o.pop();const t=o.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:i,panel:o},s)=>{const l=()=>this._handlePanelFlowItemBack(o);return O("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:o.title,headingLevel:this.headingLevel,key:`flow-panel-${o.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},o.render(),O("calcite-button",{appearance:"transparent",slot:"footer-start",width:"full",onclick:l},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,A(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,A(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,A(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:i,_openedPanelItems:o,_filterEnabled:s,_rootGroupUid:l,visibleElements:{closeButton:r,collapseButton:a,heading:n,flow:d},_dragEnabled:p,selectionMode:c,filterText:h,openedLayers:y,filterPlaceholder:u,messages:g}=this,L=[O("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:r,closed:!e,collapsed:t,collapsible:a,heading:n?g.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!y.length&&!o.length,onCalciteFlowItemClose:()=>this.visible=!1},i?.length?null:this._renderNoItems(),O("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":l,displayMode:R,dragEnabled:p,filterEnabled:s,filterPlaceholder:u,filterProps:M,filterText:s?h:"",group:l,key:"root-list",label:g.widgetLabel,selectionAppearance:"border",selectionMode:c,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail),onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem},i.toArray().map(e=>this._renderItem(e)),s?O("div",{class:m.filterNoResults,slot:"filter-no-results"},O("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?d?O("calcite-flow",{key:"root-flow"},L):L:null}_renderItem(e,t,i){return O(h,{activeItem:this._activeItem,canMove:this._canMove,css:m,displayMode:R,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:o}){const s=f(i),l=f(e),r=f(t);this.viewModel.moveListItem(s,r,l,o)}_handleCalciteListDragEnd({fromEl:e,dragEl:t,oldIndex:i}){null!=i&&e.insertBefore(t,e.children[i])}_sortLayers(e,t){if(e)if(e===this._rootListEl)b(this.view?.map?.layers,t);else{const i=f(e);if(!i)return;C(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map(e=>f(e)).filter(Boolean);i.removeAll(),i.addMany(o)}};e([d()],k.prototype,"_rootListEl",void 0),e([d()],k.prototype,"_activeItem",void 0),e([d()],k.prototype,"_tooltipReferenceMap",void 0),e([d()],k.prototype,"_focusRootFlowItem",void 0),e([d()],k.prototype,"_focusPanelFlowItem",void 0),e([d()],k.prototype,"_focusLayerFlowItem",void 0),e([d()],k.prototype,"_layerListMap",void 0),e([d()],k.prototype,"_totalItems",null),e([d()],k.prototype,"_visibleItems",null),e([d()],k.prototype,"_openedPanelItems",null),e([d()],k.prototype,"_dragEnabled",null),e([d()],k.prototype,"_filterEnabled",null),e([d()],k.prototype,"_renderedOpenLayerFlowItems",null),e([d({readOnly:!0})],k.prototype,"catalogLayerList",void 0),e([d()],k.prototype,"catalogOptions",void 0),e([d()],k.prototype,"collapsed",void 0),e([d()],k.prototype,"dragEnabled",void 0),e([d()],k.prototype,"filterPlaceholder",void 0),e([d()],k.prototype,"filterPredicate",void 0),e([d()],k.prototype,"filterText",void 0),e([d()],k.prototype,"headingLevel",void 0),e([d()],k.prototype,"icon",null),e([d()],k.prototype,"knowledgeGraphOptions",void 0),e([d()],k.prototype,"label",null),e([d()],k.prototype,"layerTablesEnabled",void 0),e([d()],k.prototype,"listItemCanGiveFunction",void 0),e([d()],k.prototype,"listItemCanReceiveFunction",void 0),e([d()],k.prototype,"listItemCreatedFunction",null),e([d()],k.prototype,"mapImageOptions",void 0),e([d(),T("esri/widgets/LayerList/t9n/LayerList")],k.prototype,"messages",void 0),e([d(),T("esri/t9n/common")],k.prototype,"messagesCommon",void 0),e([d()],k.prototype,"minDragEnabledItems",void 0),e([d()],k.prototype,"minFilterItems",void 0),e([d({readOnly:!0})],k.prototype,"openedLayers",void 0),e([d({readOnly:!0})],k.prototype,"openedLayerLists",void 0),e([d()],k.prototype,"operationalItems",null),e([d()],k.prototype,"selectedItems",void 0),e([d()],k.prototype,"selectionMode",void 0),e([d({readOnly:!0})],k.prototype,"tableList",void 0),e([d()],k.prototype,"tileOptions",void 0),e([d()],k.prototype,"view",null),e([P("trigger-action"),d({type:y})],k.prototype,"viewModel",void 0),e([d()],k.prototype,"visibilityAppearance",void 0),e([d({type:u,nonNullable:!0})],k.prototype,"visibleElements",void 0),k=e([p("esri.widgets.LayerList")],k);const j=k;export{j as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{deprecateWidget as i}from"../core/deprecate.js";import{IdentifiableMixin as o}from"../core/Identifiable.js";import s from"../core/Logger.js";import l from"../core/ReactiveMap.js";import{on as r,initial as a,watch as n}from"../core/reactiveUtils.js";import{property as d,subclass as p}from"../core/accessorSupport/decorators.js";import c from"./Widget.js";import{css as m}from"./LayerList/css.js";import h from"./LayerList/LayerListItem.js";import y from"./LayerList/LayerListViewModel.js";import u from"./LayerList/LayerListVisibleElements.js";import g from"./LayerList/ListItem.js";import{minDragEnabledItems as L,minFilterItems as _,getItem as f,getLayerType as v,removeDestroyedListItems as I,setFilterPredicate as w,sortLayersToIds as b,sortChildLayersToIds as C}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as F}from"./support/globalCss.js";import{calciteListFilterProps as M}from"./support/listUtils.js";import{tsx as O,messageBundle as T,vmEvent as P}from"./support/widget.js";import{setFocus as A}from"./support/widgetUtils.js";const D=t.ofType(g),R="nested";let k=class extends(o(c)){constructor(e,o){super(e,o),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new l,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new l,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=L,this.minFilterItems=_,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new D,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new y({suppressDeprecationWarning:!0}),this.visibilityAppearance="default",this.visibleElements=new u,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=f(e);if(!l?.sortable)return!1;const r=f(t),a=v(t),n=f(i),d=v(i),p=!!a&&!!d&&a===d,c={selected:l,from:r,to:n},m=t.group,h=i.group,y=r?.layer?.type??"",u=n?.layer?.type??"",g=new Set(["map-image","catalog","knowledge-graph"]),L="sublayer";return m&&h&&"function"==typeof s?s.call(null,c):p&&!g.has(y)&&!g.has(u)&&l?.layer?.type!==L},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(m.item));this._activeItem=f(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(o&&i&&!(t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o)){if(this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value,o===i){const e=Array.from(o.children).filter(e=>e?.matches("calcite-list-item")).map(e=>e.value);return void this._sortLayers(o,e)}null!=l&&this._moveLayerFromChildList({toEl:i,fromEl:o,dragEl:s,newIndex:l})}},this.announceDeprecation=()=>{i(s.getLogger(this),"Layer List","arcgis-layer-list",{version:"5.0"})}}initialize(){this.addHandles([r(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),a),r(()=>this.viewModel.operationalItems,"change",()=>I(this.selectedItems),a),n(()=>[this.filterPredicate,this._rootListEl],()=>w(this._rootListEl,this.filterPredicate))])}loadDependencies(){return E({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),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"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _totalItems(){return this.viewModel.operationalItems.flatten(e=>e.children.filter(e=>"catalog-dynamic-group"!==e.layer?.type)).length}get _visibleItems(){return this.operationalItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _dragEnabled(){return this._totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,i)=>this._renderLayerFlowItem(t,i===e.length-1))}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[F.hidden]:"loading"===e,[F.disabled]:"disabled"===e};return O("div",{class:this.classes(m.base,F.widget,F.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:i}=this,o=i.get(e);if(o)return o;const s="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const o=new AbortController,{signal:s}=o;this._openedLayersController=o,e.forEach((i,o)=>{t.includes(o)||(i.destroy(),e.delete(o))});const l=await Promise.all(t.map(e=>this._createFlowList(e,s)));if(s.aborted)return;i.removeAll(),i.addMany(l);const r=i.at(-1);r?"catalogLayer"in r?(this._set("catalogLayerList",r),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",r)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?O("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer?.uid),topLayerDisabled:this.topLayerDisabled},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return O("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return O("div",{class:m.itemMessage,key:"esri-layer-list__no-items"},O("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}async _createCatalogLayerList(e){const{default:t}=await(import("./CatalogLayerList.js")),{headingLevel:i,catalogOptions:o,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,_onCatalogOpen:p,_onTablesOpen:c,layerTablesEnabled:m}=this;return new t({headingLevel:i,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,...o,catalogLayer:e,layerTablesEnabled:m,onCatalogOpen:p,onTablesOpen:c,suppressDeprecationWarning:!0})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await(import("./TableList.js")),{headingLevel:i,selectionMode:o,dragEnabled:s}=this;return new t({headingLevel:i,selectionMode:o,dragEnabled:s,...this._getTableListParams(e)})}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:o}=this,s=e.title||this.messages.untitledLayer;return O("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),o.pop();const t=o.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:i,panel:o},s)=>{const l=()=>this._handlePanelFlowItemBack(o);return O("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:o.title,headingLevel:this.headingLevel,key:`flow-panel-${o.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},o.render(),O("calcite-button",{appearance:"transparent",slot:"footer-start",width:"full",onclick:l},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,A(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,A(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,A(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:i,_openedPanelItems:o,_filterEnabled:s,_rootGroupUid:l,visibleElements:{closeButton:r,collapseButton:a,heading:n,flow:d},_dragEnabled:p,selectionMode:c,filterText:h,openedLayers:y,filterPlaceholder:u,messages:g}=this,L=[O("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:r,closed:!e,collapsed:t,collapsible:a,heading:n?g.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!y.length&&!o.length,onCalciteFlowItemClose:()=>this.visible=!1},i?.length?null:this._renderNoItems(),O("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":l,displayMode:R,dragEnabled:p,filterEnabled:s,filterPlaceholder:u,filterProps:M,filterText:s?h:"",group:l,key:"root-list",label:g.widgetLabel,selectionAppearance:"border",selectionMode:c,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail),onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem},i.toArray().map(e=>this._renderItem(e)),s?O("div",{class:m.filterNoResults,slot:"filter-no-results"},O("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?d?O("calcite-flow",{key:"root-flow"},L):L:null}_renderItem(e,t,i){return O(h,{activeItem:this._activeItem,canMove:this._canMove,css:m,displayMode:R,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:o}){const s=f(i),l=f(e),r=f(t);this.viewModel.moveListItem(s,r,l,o)}_handleCalciteListDragEnd({fromEl:e,dragEl:t,oldIndex:i}){null!=i&&e.insertBefore(t,e.children[i])}_sortLayers(e,t){if(e)if(e===this._rootListEl)b(this.view?.map?.layers,t);else{const i=f(e);if(!i)return;C(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map(e=>f(e)).filter(Boolean);i.removeAll(),i.addMany(o)}};e([d()],k.prototype,"_rootListEl",void 0),e([d()],k.prototype,"_activeItem",void 0),e([d()],k.prototype,"_tooltipReferenceMap",void 0),e([d()],k.prototype,"_focusRootFlowItem",void 0),e([d()],k.prototype,"_focusPanelFlowItem",void 0),e([d()],k.prototype,"_focusLayerFlowItem",void 0),e([d()],k.prototype,"_layerListMap",void 0),e([d()],k.prototype,"_totalItems",null),e([d()],k.prototype,"_visibleItems",null),e([d()],k.prototype,"_openedPanelItems",null),e([d()],k.prototype,"_dragEnabled",null),e([d()],k.prototype,"_filterEnabled",null),e([d()],k.prototype,"_renderedOpenLayerFlowItems",null),e([d({readOnly:!0})],k.prototype,"catalogLayerList",void 0),e([d()],k.prototype,"catalogOptions",void 0),e([d()],k.prototype,"collapsed",void 0),e([d()],k.prototype,"dragEnabled",void 0),e([d()],k.prototype,"filterPlaceholder",void 0),e([d()],k.prototype,"filterPredicate",void 0),e([d()],k.prototype,"filterText",void 0),e([d()],k.prototype,"headingLevel",void 0),e([d()],k.prototype,"icon",null),e([d()],k.prototype,"knowledgeGraphOptions",void 0),e([d()],k.prototype,"label",null),e([d()],k.prototype,"layerTablesEnabled",void 0),e([d()],k.prototype,"listItemCanGiveFunction",void 0),e([d()],k.prototype,"listItemCanReceiveFunction",void 0),e([d()],k.prototype,"listItemCreatedFunction",null),e([d()],k.prototype,"mapImageOptions",void 0),e([d(),T("esri/widgets/LayerList/t9n/LayerList")],k.prototype,"messages",void 0),e([d(),T("esri/t9n/common")],k.prototype,"messagesCommon",void 0),e([d()],k.prototype,"minDragEnabledItems",void 0),e([d()],k.prototype,"minFilterItems",void 0),e([d({readOnly:!0})],k.prototype,"openedLayers",void 0),e([d({readOnly:!0})],k.prototype,"openedLayerLists",void 0),e([d()],k.prototype,"operationalItems",null),e([d()],k.prototype,"selectedItems",void 0),e([d()],k.prototype,"selectionMode",void 0),e([d({readOnly:!0})],k.prototype,"tableList",void 0),e([d()],k.prototype,"tileOptions",void 0),e([d()],k.prototype,"view",null),e([P("trigger-action"),d({type:y})],k.prototype,"viewModel",void 0),e([d()],k.prototype,"visibilityAppearance",void 0),e([d({type:u,nonNullable:!0})],k.prototype,"visibleElements",void 0),k=e([p("esri.widgets.LayerList")],k);const j=k;export{j as default};
|
|
@@ -13,6 +13,7 @@ import type { ActionButtonProperties } from "../../support/actions/ActionButton.
|
|
|
13
13
|
import type { ReadonlyArrayOrCollection } from "../../core/Collection.js";
|
|
14
14
|
import type { ListItemPanelProperties } from "./ListItemPanel.js";
|
|
15
15
|
|
|
16
|
+
/** @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead. */
|
|
16
17
|
export interface ListItemProperties extends IdentifiableMixinProperties, Partial<Pick<ListItem, "actionsOpen" | "hidden" | "layer" | "listModeDisabled" | "open" | "parent">> {
|
|
17
18
|
/** A nested 2-dimensional collection of actions that could be triggered on the item. */
|
|
18
19
|
actionsSections?: ReadonlyArrayOrCollection<ReadonlyArrayOrCollection<((ActionButtonProperties & { type: "button" }) | (ActionToggleProperties & { type: "toggle" }))>>;
|
|
@@ -51,6 +52,7 @@ export interface ListItemProperties extends IdentifiableMixinProperties, Partial
|
|
|
51
52
|
* associated properties and allows the developer to configure actions related to the table,
|
|
52
53
|
* and allows the developer to add content to the item related to the table.
|
|
53
54
|
*
|
|
55
|
+
* @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead.
|
|
54
56
|
* @since 4.17
|
|
55
57
|
* @see [TableList](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/)
|
|
56
58
|
* @see [TableListViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/TableListViewModel/)
|
|
@@ -4,6 +4,7 @@ import type { Icon } from "@esri/calcite-components/components/calcite-icon";
|
|
|
4
4
|
import type { IdentifiableMixin, IdentifiableMixinProperties } from "../../core/Identifiable.js";
|
|
5
5
|
import type { WidgetProperties } from "../Widget.js";
|
|
6
6
|
|
|
7
|
+
/** @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead. */
|
|
7
8
|
export interface ListItemPanelProperties extends WidgetProperties, IdentifiableMixinProperties, Partial<Pick<ListItemPanel, "content" | "disabled" | "flowEnabled" | "image" | "listItem" | "open" | "title">> {
|
|
8
9
|
/**
|
|
9
10
|
* Icon which represents the panel.
|
|
@@ -46,6 +47,7 @@ export interface ListItemPanelProperties extends WidgetProperties, IdentifiableM
|
|
|
46
47
|
* The content displayed in the ListItem panel. This can be a [String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String),
|
|
47
48
|
* a [Widget](https://developers.arcgis.com/javascript/latest/references/core/widgets/Widget/) instance, or an [HTMLElement](https://developer.mozilla.org/docs/Web/API/HTMLElement).
|
|
48
49
|
*
|
|
50
|
+
* @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead.
|
|
49
51
|
* @see [content](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/ListItemPanel/#content)
|
|
50
52
|
*/
|
|
51
53
|
export type ListItemPanelContent = Widget | HTMLElement | string;
|
|
@@ -54,6 +56,7 @@ export type ListItemPanelContent = Widget | HTMLElement | string;
|
|
|
54
56
|
* Defines the content(s) that can be displayed in a ListItem panel. This can be a single content item
|
|
55
57
|
* or an array of content items, allowing for flexible panel layouts.
|
|
56
58
|
*
|
|
59
|
+
* @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead.
|
|
57
60
|
* @see [content](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/ListItemPanel/#content)
|
|
58
61
|
*/
|
|
59
62
|
export type ListItemPanelContents = ListItemPanelContent | ListItemPanelContent[];
|
|
@@ -64,6 +67,7 @@ export type ListItemPanelContents = ListItemPanelContent | ListItemPanelContent[
|
|
|
64
67
|
* Rather, they are modified using the [TableList.listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/#listItemCreatedFunction)
|
|
65
68
|
* property in the [TableList](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/) widget.
|
|
66
69
|
*
|
|
70
|
+
* @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead.
|
|
67
71
|
* @since 4.29
|
|
68
72
|
* @see [TableList](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/)
|
|
69
73
|
* @see [ListItem](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/ListItem/)
|
|
@@ -9,8 +9,10 @@ import type { EventedAccessor } from "../../core/Evented.js";
|
|
|
9
9
|
import type { Action } from "../LayerList/types.js";
|
|
10
10
|
import type { ListItemModifier, State } from "./types.js";
|
|
11
11
|
|
|
12
|
+
/** @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead. */
|
|
12
13
|
export interface TableListViewModelProperties extends Partial<Pick<TableListViewModel, "checkPublishStatusEnabled" | "listItemCreatedFunction" | "listModeDisabled" | "map" | "tables">> {}
|
|
13
14
|
|
|
15
|
+
/** @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead. */
|
|
14
16
|
export interface TableListViewModelEvents {
|
|
15
17
|
/**
|
|
16
18
|
* Emitted when the user clicks an [action](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionButton/) or
|
|
@@ -25,6 +27,7 @@ export interface TableListViewModelEvents {
|
|
|
25
27
|
/**
|
|
26
28
|
* The event object for the `trigger-action` event in the table list.
|
|
27
29
|
*
|
|
30
|
+
* @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead.
|
|
28
31
|
* @see [@trigger-action](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/TableListViewModel/#event-trigger-action)
|
|
29
32
|
*/
|
|
30
33
|
export interface TableListViewModelTriggerActionEvent {
|
|
@@ -37,6 +40,7 @@ export interface TableListViewModelTriggerActionEvent {
|
|
|
37
40
|
/**
|
|
38
41
|
* Provides the logic for the [TableList](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/) widget and [component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list/).
|
|
39
42
|
*
|
|
43
|
+
* @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead.
|
|
40
44
|
* @since 4.17
|
|
41
45
|
* @see [TableList](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/) widget
|
|
42
46
|
* @see [Table List component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list/)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../core/Collection.js";import{
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../core/Collection.js";import{deprecateUnnecessaryViewModel as s}from"../../core/deprecate.js";import{EventedAccessor as i}from"../../core/Evented.js";import o from"../../core/Logger.js";import{watch as l,initial as r}from"../../core/reactiveUtils.js";import{property as a,subclass as d}from"../../core/accessorSupport/decorators.js";import{findLayerListMode as n}from"../LayerList/support/layerListUtils.js";import m from"./ListItem.js";const c={map:"map",layerListMode:"layer-list-mode"},h="hide",p=e.ofType(m);let b=class extends i{constructor(t){super(t),this.checkPublishStatusEnabled=!1,this.listItemCreatedFunction=null,this.listModeDisabled=!1,this.tableItems=new p,this.map=null,t?.suppressDeprecationWarning||s(o.getLogger(this),"Table List (Next)","arcgis-table-list-next",{version:"5.2"})}normalizeCtorArgs(t){const{suppressDeprecationWarning:e,...s}=t??{};return s}initialize(){this.addHandles([l(()=>[this.tables?.toArray(),this.map?.allTables.toArray()],()=>this._compileList(),r),l(()=>[this.map?.loaded,this.listItemCreatedFunction,this.checkPublishStatusEnabled,this.listModeDisabled],()=>this._recompileList())],c.map)}destroy(){this._removeAllItems(),this.map=null,this.tables=null}get tables(){return this.map?.allTables}set tables(t){this._overrideIfSome("tables",t)}get state(){const{map:t,tables:e}=this;if(!t)return e?"ready":"disabled";const s=t?.loadStatus;return"string"==typeof s?"loaded"===s?"ready":"loading"===s?"loading":"disabled":"ready"}get totalItems(){return this.tableItems.length}triggerAction(t,e){t&&!t.disabled&&this.emit("trigger-action",{action:t,item:e})}_removeAllItems(){this.tableItems.destroyAll()}_getViewableTables(t){return t?this.listModeDisabled?t:t.filter(t=>n(t)!==h):void 0}_watchTablesListMode(t){this.removeHandles(c.layerListMode),t&&!this.listModeDisabled&&this.addHandles(l(()=>t.filter(t=>"listMode"in t).map(t=>t.listMode).toArray(),()=>this._compileList()),c.layerListMode)}_compileList(){const{tables:t}=this;this._watchTablesListMode(t);const e=this._getViewableTables(t);e?.length?(this._createNewItems(e),this._removeItems(e),this._sortItems(e)):this._removeAllItems()}_createNewItems(t){const{tableItems:e,listItemCreatedFunction:s,checkPublishStatusEnabled:i}=this;t.forEach(t=>{e.some(e=>e.layer===t)||e.add(new m({checkPublishStatusEnabled:i,layer:t,listItemCreatedFunction:s}))})}_removeItems(t){const{tableItems:e}=this;e.forEach(s=>{if(!s)return;const i=t?.find(t=>s.layer===t);i||(e.remove(s),s.destroy())})}_sortItems(t){const{tableItems:e}=this;e.sort((e,s)=>{const i=t.indexOf(e.layer),o=t.indexOf(s.layer);return i>o?-1:i<o?1:0})}_recompileList(){this._removeAllItems(),this._compileList()}};t([a()],b.prototype,"checkPublishStatusEnabled",void 0),t([a()],b.prototype,"listItemCreatedFunction",void 0),t([a({nonNullable:!0})],b.prototype,"listModeDisabled",void 0),t([a({type:p,readOnly:!0})],b.prototype,"tableItems",void 0),t([a()],b.prototype,"tables",null),t([a()],b.prototype,"map",void 0),t([a({readOnly:!0})],b.prototype,"state",null),t([a()],b.prototype,"totalItems",null),b=t([d("esri.widgets.TableList.TableListViewModel")],b);export{b as default};
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type Accessor from "../../core/Accessor.js";
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead.
|
|
5
|
+
* @since 5.0
|
|
6
|
+
*/
|
|
4
7
|
export interface TableListVisibleElementsProperties extends Partial<Pick<TableListVisibleElements, "closeButton" | "collapseButton" | "errors" | "filter" | "flow" | "heading" | "statusIndicators" | "temporaryTableIndicators">> {}
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* The visible elements that are displayed within the table list.
|
|
8
11
|
* This provides the ability to turn on/off individual elements of the table list.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead.
|
|
9
14
|
*/
|
|
10
15
|
export default class TableListVisibleElements extends Accessor {
|
|
11
16
|
constructor(properties?: TableListVisibleElementsProperties);
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types used by the [TableList](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/) widget.
|
|
3
|
+
*
|
|
4
|
+
* @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead.
|
|
5
|
+
*/
|
|
1
6
|
import type ListItem from "./ListItem.js";
|
|
2
7
|
|
|
3
8
|
/**
|
|
4
9
|
* A function for customizing a list item as it is created in the table list.
|
|
5
10
|
*
|
|
6
11
|
* @param event - An object containing a list item created by the [TableList](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/).
|
|
12
|
+
* @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead.
|
|
7
13
|
* @since 5.0
|
|
8
14
|
* @see [TableList.listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/#listItemCreatedFunction)
|
|
9
15
|
* @see [TableListViewModel.listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/TableListViewModel/#listItemCreatedFunction)
|
|
10
16
|
*/
|
|
11
17
|
export type ListItemModifier = (event: ListItemModifierEvent) => void;
|
|
12
18
|
|
|
13
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead.
|
|
21
|
+
* @since 5.0
|
|
22
|
+
*/
|
|
14
23
|
export interface ListItemModifierEvent {
|
|
15
24
|
/**
|
|
16
25
|
* The event object passed to a listItemCreatedFunction in the layer lists.
|
|
17
26
|
* Provides access to the list item being created, allowing you to customize its properties, actions, panel content, or visibility before rendering.
|
|
18
27
|
*
|
|
28
|
+
* @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead.
|
|
19
29
|
* @since 5.0
|
|
20
30
|
* @see [TableList.listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/#listItemCreatedFunction)
|
|
21
31
|
* @see [TableListViewModel.listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/TableListViewModel/#listItemCreatedFunction)
|
|
@@ -26,6 +36,7 @@ export interface ListItemModifierEvent {
|
|
|
26
36
|
/**
|
|
27
37
|
* Describes the current state of the list items in the [TableListViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/TableListViewModel/).
|
|
28
38
|
*
|
|
39
|
+
* @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead.
|
|
29
40
|
* @since 5.0
|
|
30
41
|
* @see [TableListViewModel.state](https://developers.arcgis.com/javascript/latest/references/core/widgets/TableList/TableListViewModel/#state)
|
|
31
42
|
*/
|
package/widgets/TableList.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type { ListItemProperties } from "./TableList/ListItem.js";
|
|
|
15
15
|
import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
|
|
16
16
|
import type { TableListVisibleElementsProperties } from "./TableList/TableListVisibleElements.js";
|
|
17
17
|
|
|
18
|
+
/** @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead. */
|
|
18
19
|
export interface TableListProperties extends WidgetProperties, IdentifiableMixinProperties, Partial<Pick<TableList, "collapsed" | "dragEnabled" | "filterPlaceholder" | "filterPredicate" | "filterText" | "headingLevel" | "listItemCreatedFunction" | "map" | "minDragEnabledItems" | "minFilterItems" | "selectionMode">> {
|
|
19
20
|
/**
|
|
20
21
|
* Icon which represents the widget. It is typically used when the widget is controlled by another
|
|
@@ -64,6 +65,7 @@ export interface TableListProperties extends WidgetProperties, IdentifiableMixin
|
|
|
64
65
|
visibleElements?: TableListVisibleElementsProperties;
|
|
65
66
|
}
|
|
66
67
|
|
|
68
|
+
/** @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead. */
|
|
67
69
|
export interface TableListEvents extends TableListViewModelEvents {}
|
|
68
70
|
|
|
69
71
|
/**
|
|
@@ -347,5 +349,6 @@ declare const TableListSuperclass: typeof Widget & typeof IdentifiableMixin
|
|
|
347
349
|
*
|
|
348
350
|
* @param item - A list item
|
|
349
351
|
* created by the TableList.
|
|
352
|
+
* @deprecated since 5.2. Use the [Table List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-table-list-next/) component instead.
|
|
350
353
|
*/
|
|
351
354
|
export type FilterPredicate = (item: ListItem) => boolean;
|
package/widgets/TableList.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{deprecateWidget as i}from"../core/deprecate.js";import{IdentifiableMixin as o}from"../core/Identifiable.js";import s from"../core/Logger.js";import{on as l,initial as r,watch as n}from"../core/reactiveUtils.js";import{property as a,subclass as d}from"../core/accessorSupport/decorators.js";import c from"./Widget.js";import m from"./LayerList/LayerListItem.js";import{minDragEnabledItems as p,minFilterItems as h,getLayerType as u,removeDestroyedListItems as g,setFilterPredicate as f}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as I}from"./support/componentsUtils.js";import{globalCss as b}from"./support/globalCss.js";import{calciteListFilterProps as v}from"./support/listUtils.js";import{tsx as _,messageBundle as w,vmEvent as y}from"./support/widget.js";import{setFocus as L}from"./support/widgetUtils.js";import{css as E}from"./TableList/css.js";import C from"./TableList/ListItem.js";import M from"./TableList/TableListViewModel.js";import F from"./TableList/TableListVisibleElements.js";import{getItem as P,sortTablesToIds as D}from"./TableList/support/tableListUtils.js";const T="nested",U=t.ofType(C);let j=class extends(o(c)){constructor(e,t){super(e,t),this._rootListEl=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`table-${this.uid}`,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=p,this.minFilterItems=h,this.selectedItems=new U,this.selectionMode="none",this.viewModel=new M,this.visibleElements=new F,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=P(e);if(!l?.sortable)return!1;const r=P(t),n=u(t),a=P(i),d=u(i),c=!!n&&!!d&&n===d,m={selected:l,from:r,to:a},p=t.group,h=i.group;return p&&h&&"function"==typeof s?s.call(null,m):c},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(!o||!i||t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value;const r=Array.from(o.children).filter(e=>e?.matches("calcite-list-item")).map(e=>e.value);D(this.viewModel.tables,r)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this.announceDeprecation=()=>{i(s.getLogger(this),"Table List","arcgis-table-list",{version:"5.0"})}}initialize(){this.addHandles([l(()=>this.viewModel.tableItems,"change",()=>g(this.selectedItems),r),n(()=>[this.filterPredicate,this._rootListEl],()=>f(this._rootListEl,this.filterPredicate))])}loadDependencies(){return I({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),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"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}get _dragEnabled(){return this.viewModel.totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get _visibleItems(){return this.tableItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get icon(){return"table"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get tableItems(){return this.viewModel.tableItems}get tables(){return this.viewModel.tables}set tables(e){this.viewModel.tables=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[b.hidden]:"loading"===e,[b.disabled]:"disabled"===e};return _("div",{class:this.classes(E.base,b.widget,b.panel,t)},this._renderItems())}_renderNoItemsMessage(){return _("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return _("div",{class:E.itemMessage,key:"esri-layer-list__no-items"},_("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(){const{_openedPanelItems:e}=this;return e.toArray().map(({title:t,panel:i},o)=>{const s=()=>this._handlePanelFlowItemBack(i);return _("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:t,heading:i.title,headingLevel:this.headingLevel,key:`flow-panel-${i.uid}`,selected:o===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),s()}},i.render(),_("calcite-button",{appearance:"transparent",slot:"footer-start",width:"full",onclick:s},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,L(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,L(e))}_renderItems(){const{visible:e,collapsed:t,visibleElements:{closeButton:i,collapseButton:o,heading:s,flow:l},_dragEnabled:r,_visibleItems:n,_filterEnabled:a,_rootGroupUid:d,_openedPanelItems:c,selectionMode:m,messages:p,filterPlaceholder:h,filterText:u}=this,g=[_("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:i,closed:!e,collapsed:t,collapsible:o,heading:s?p.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!c.length,onCalciteFlowItemClose:()=>this.visible=!1},n?.length?null:this._renderNoItems(),_("calcite-list",{afterCreate:e=>{this._rootListEl=e},afterRemoved:()=>{this._rootListEl=null},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":d,displayMode:T,dragEnabled:r,filterEnabled:a,filterPlaceholder:h,filterProps:v,filterText:a?u:"",group:d,key:"root-list",label:p.widgetLabel,selectionAppearance:"border",selectionMode:m,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},n.toArray().map(e=>this._renderItem(e)),a?_("div",{class:E.filterNoResults,slot:"filter-no-results"},_("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems()];return e?l?_("calcite-flow",{key:"root-flow"},g):g:null}_handleCalciteListDragEnd({fromEl:e,dragEl:t,oldIndex:i}){null!=i&&e.insertBefore(t,e.children[i])}_renderItem(e){return _(m,{canMove:this._canMove,css:E,displayMode:T,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer.uid}`,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange})}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map(e=>P(e)).filter(Boolean);i.removeAll(),i.addMany(o)}};e([a()],j.prototype,"_rootListEl",void 0),e([a()],j.prototype,"_focusRootFlowItem",void 0),e([a()],j.prototype,"_focusPanelFlowItem",void 0),e([a()],j.prototype,"_dragEnabled",null),e([a()],j.prototype,"_filterEnabled",null),e([a()],j.prototype,"_visibleItems",null),e([a()],j.prototype,"_openedPanelItems",null),e([a()],j.prototype,"collapsed",void 0),e([a()],j.prototype,"dragEnabled",void 0),e([a()],j.prototype,"filterPlaceholder",void 0),e([a()],j.prototype,"filterPredicate",void 0),e([a()],j.prototype,"filterText",void 0),e([a()],j.prototype,"headingLevel",void 0),e([a()],j.prototype,"icon",null),e([a()],j.prototype,"label",null),e([a()],j.prototype,"listItemCanGiveFunction",void 0),e([a()],j.prototype,"listItemCanReceiveFunction",void 0),e([a()],j.prototype,"listItemCreatedFunction",null),e([a()],j.prototype,"map",null),e([a(),w("esri/widgets/TableList/t9n/TableList")],j.prototype,"messages",void 0),e([a(),w("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([a()],j.prototype,"minDragEnabledItems",void 0),e([a()],j.prototype,"minFilterItems",void 0),e([a({type:U})],j.prototype,"selectedItems",void 0),e([a()],j.prototype,"selectionMode",void 0),e([a({readOnly:!0})],j.prototype,"tableItems",null),e([a()],j.prototype,"tables",null),e([y("trigger-action"),a({type:M})],j.prototype,"viewModel",void 0),e([a({type:F,nonNullable:!0})],j.prototype,"visibleElements",void 0),j=e([d("esri.widgets.TableList")],j);const k=j;export{k as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{deprecateWidget as i}from"../core/deprecate.js";import{IdentifiableMixin as o}from"../core/Identifiable.js";import s from"../core/Logger.js";import{on as l,initial as r,watch as n}from"../core/reactiveUtils.js";import{property as a,subclass as d}from"../core/accessorSupport/decorators.js";import c from"./Widget.js";import m from"./LayerList/LayerListItem.js";import{minDragEnabledItems as p,minFilterItems as h,getLayerType as u,removeDestroyedListItems as g,setFilterPredicate as f}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as I}from"./support/componentsUtils.js";import{globalCss as b}from"./support/globalCss.js";import{calciteListFilterProps as v}from"./support/listUtils.js";import{tsx as _,messageBundle as w,vmEvent as y}from"./support/widget.js";import{setFocus as L}from"./support/widgetUtils.js";import{css as E}from"./TableList/css.js";import C from"./TableList/ListItem.js";import M from"./TableList/TableListViewModel.js";import F from"./TableList/TableListVisibleElements.js";import{getItem as P,sortTablesToIds as D}from"./TableList/support/tableListUtils.js";const T="nested",U=t.ofType(C);let j=class extends(o(c)){constructor(e,t){super(e,t),this._rootListEl=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`table-${this.uid}`,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=p,this.minFilterItems=h,this.selectedItems=new U,this.selectionMode="none",this.viewModel=new M({suppressDeprecationWarning:!0}),this.visibleElements=new F,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=P(e);if(!l?.sortable)return!1;const r=P(t),n=u(t),a=P(i),d=u(i),c=!!n&&!!d&&n===d,m={selected:l,from:r,to:a},p=t.group,h=i.group;return p&&h&&"function"==typeof s?s.call(null,m):c},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(!o||!i||t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value;const r=Array.from(o.children).filter(e=>e?.matches("calcite-list-item")).map(e=>e.value);D(this.viewModel.tables,r)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this.announceDeprecation=()=>{i(s.getLogger(this),"Table List","arcgis-table-list",{version:"5.0"})}}initialize(){this.addHandles([l(()=>this.viewModel.tableItems,"change",()=>g(this.selectedItems),r),n(()=>[this.filterPredicate,this._rootListEl],()=>f(this._rootListEl,this.filterPredicate))])}loadDependencies(){return I({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),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"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}get _dragEnabled(){return this.viewModel.totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get _visibleItems(){return this.tableItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get icon(){return"table"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get tableItems(){return this.viewModel.tableItems}get tables(){return this.viewModel.tables}set tables(e){this.viewModel.tables=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[b.hidden]:"loading"===e,[b.disabled]:"disabled"===e};return _("div",{class:this.classes(E.base,b.widget,b.panel,t)},this._renderItems())}_renderNoItemsMessage(){return _("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return _("div",{class:E.itemMessage,key:"esri-layer-list__no-items"},_("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(){const{_openedPanelItems:e}=this;return e.toArray().map(({title:t,panel:i},o)=>{const s=()=>this._handlePanelFlowItemBack(i);return _("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:t,heading:i.title,headingLevel:this.headingLevel,key:`flow-panel-${i.uid}`,selected:o===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),s()}},i.render(),_("calcite-button",{appearance:"transparent",slot:"footer-start",width:"full",onclick:s},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,L(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,L(e))}_renderItems(){const{visible:e,collapsed:t,visibleElements:{closeButton:i,collapseButton:o,heading:s,flow:l},_dragEnabled:r,_visibleItems:n,_filterEnabled:a,_rootGroupUid:d,_openedPanelItems:c,selectionMode:m,messages:p,filterPlaceholder:h,filterText:u}=this,g=[_("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:i,closed:!e,collapsed:t,collapsible:o,heading:s?p.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!c.length,onCalciteFlowItemClose:()=>this.visible=!1},n?.length?null:this._renderNoItems(),_("calcite-list",{afterCreate:e=>{this._rootListEl=e},afterRemoved:()=>{this._rootListEl=null},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":d,displayMode:T,dragEnabled:r,filterEnabled:a,filterPlaceholder:h,filterProps:v,filterText:a?u:"",group:d,key:"root-list",label:p.widgetLabel,selectionAppearance:"border",selectionMode:m,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},n.toArray().map(e=>this._renderItem(e)),a?_("div",{class:E.filterNoResults,slot:"filter-no-results"},_("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems()];return e?l?_("calcite-flow",{key:"root-flow"},g):g:null}_handleCalciteListDragEnd({fromEl:e,dragEl:t,oldIndex:i}){null!=i&&e.insertBefore(t,e.children[i])}_renderItem(e){return _(m,{canMove:this._canMove,css:E,displayMode:T,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer.uid}`,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange})}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map(e=>P(e)).filter(Boolean);i.removeAll(),i.addMany(o)}};e([a()],j.prototype,"_rootListEl",void 0),e([a()],j.prototype,"_focusRootFlowItem",void 0),e([a()],j.prototype,"_focusPanelFlowItem",void 0),e([a()],j.prototype,"_dragEnabled",null),e([a()],j.prototype,"_filterEnabled",null),e([a()],j.prototype,"_visibleItems",null),e([a()],j.prototype,"_openedPanelItems",null),e([a()],j.prototype,"collapsed",void 0),e([a()],j.prototype,"dragEnabled",void 0),e([a()],j.prototype,"filterPlaceholder",void 0),e([a()],j.prototype,"filterPredicate",void 0),e([a()],j.prototype,"filterText",void 0),e([a()],j.prototype,"headingLevel",void 0),e([a()],j.prototype,"icon",null),e([a()],j.prototype,"label",null),e([a()],j.prototype,"listItemCanGiveFunction",void 0),e([a()],j.prototype,"listItemCanReceiveFunction",void 0),e([a()],j.prototype,"listItemCreatedFunction",null),e([a()],j.prototype,"map",null),e([a(),w("esri/widgets/TableList/t9n/TableList")],j.prototype,"messages",void 0),e([a(),w("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([a()],j.prototype,"minDragEnabledItems",void 0),e([a()],j.prototype,"minFilterItems",void 0),e([a({type:U})],j.prototype,"selectedItems",void 0),e([a()],j.prototype,"selectionMode",void 0),e([a({readOnly:!0})],j.prototype,"tableItems",null),e([a()],j.prototype,"tables",null),e([y("trigger-action"),a({type:M})],j.prototype,"viewModel",void 0),e([a({type:F,nonNullable:!0})],j.prototype,"visibleElements",void 0),j=e([d("esri.widgets.TableList")],j);const k=j;export{k as default};
|