@esri/solutions-components 0.7.4 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/t9n/map-tools/resources.json +2 -2
- package/dist/assets/t9n/map-tools/resources_en.json +2 -2
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +38 -20
- package/dist/cjs/calcite-alert_3.cjs.entry.js +17 -13
- package/dist/cjs/card-manager_3.cjs.entry.js +9 -9
- package/dist/cjs/crowdsource-manager.cjs.entry.js +30 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +70 -5
- package/dist/collection/components/edit-card/edit-card.js +30 -13
- package/dist/collection/components/info-card/info-card.js +12 -0
- package/dist/collection/components/layer-table/layer-table.css +7 -1
- package/dist/collection/components/layer-table/layer-table.js +7 -7
- package/dist/collection/components/map-card/map-card.js +1 -1
- package/dist/collection/components/map-fullscreen/map-fullscreen.js +33 -17
- package/dist/collection/components/map-tools/map-tools.js +22 -3
- package/dist/components/crowdsource-manager.js +34 -5
- package/dist/components/edit-card2.js +11 -13
- package/dist/components/info-card2.js +7 -1
- package/dist/components/layer-table2.js +8 -8
- package/dist/components/map-card2.js +1 -1
- package/dist/components/map-fullscreen2.js +17 -18
- package/dist/components/map-tools2.js +22 -3
- package/dist/esm/basemap-gallery_7.entry.js +38 -20
- package/dist/esm/calcite-alert_3.entry.js +17 -13
- package/dist/esm/card-manager_3.entry.js +9 -9
- package/dist/esm/crowdsource-manager.entry.js +30 -5
- package/dist/esm/loader.js +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-3272b303.entry.js → p-14236e25.entry.js} +1 -1
- package/dist/solutions-components/p-4b3ebd24.entry.js +6 -0
- package/dist/solutions-components/p-a4a0c7c5.entry.js +6 -0
- package/dist/solutions-components/p-b070bd54.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +27 -2
- package/dist/types/components/edit-card/edit-card.d.ts +5 -0
- package/dist/types/components/info-card/info-card.d.ts +4 -0
- package/dist/types/components/layer-table/layer-table.d.ts +1 -1
- package/dist/types/components/map-fullscreen/map-fullscreen.d.ts +14 -1
- package/dist/types/components/map-tools/map-tools.d.ts +8 -0
- package/dist/types/components.d.ts +40 -0
- package/dist/types/preact.d.ts +5 -2
- package/package.json +1 -1
- package/dist/solutions-components/p-089dc6bf.entry.js +0 -6
- package/dist/solutions-components/p-dfb33c83.entry.js +0 -6
- package/dist/solutions-components/p-ed254530.entry.js +0 -6
@@ -8,4 +8,4 @@ import{r as t,c as i,h as e,H as s,g as a}from"./p-78780f63.js";import{u as o,t
|
|
8
8
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
9
9
|
* See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
|
10
10
|
* v1.11.1-next.1
|
11
|
-
*/const _={slow:14e3,medium:1e4,fast:6e3},j="container",q=class{constructor(e){t(this,e),this.calciteAlertBeforeClose=i(this,"calciteAlertBeforeClose",6),this.calciteAlertClose=i(this,"calciteAlertClose",6),this.calciteAlertBeforeOpen=i(this,"calciteAlertBeforeOpen",6),this.calciteAlertOpen=i(this,"calciteAlertOpen",6),this.calciteInternalAlertSync=i(this,"calciteInternalAlertSync",6),this.calciteInternalAlertRegister=i(this,"calciteInternalAlertRegister",6),this.autoCloseTimeoutId=null,this.totalOpenTime=0,this.totalHoverTime=0,this.openTransitionProp="opacity",this.setTransitionEl=t=>{this.transitionEl=t},this.closeAlert=()=>{this.autoCloseTimeoutId=null,this.queued=!1,this.open=!1,this.queue=this.queue.filter((t=>t!==this.el)),this.determineActiveAlert(),this.calciteInternalAlertSync.emit({queue:this.queue})},this.actionsEndSlotChangeHandler=t=>{this.hasEndActions=o(t)},this.handleMouseOver=()=>{window.clearTimeout(this.autoCloseTimeoutId),this.totalOpenTime=Date.now()-this.initialOpenTime,this.lastMouseOverBegin=Date.now()},this.handleMouseLeave=()=>{const t=Date.now()-this.lastMouseOverBegin,i=_[this.autoCloseDuration]-this.totalOpenTime+this.totalHoverTime;this.totalHoverTime=this.totalHoverTime?t+this.totalHoverTime:t,this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),i)},this.open=!1,this.autoClose=!1,this.autoCloseDuration="medium",this.kind="brand",this.icon=void 0,this.iconFlipRtl=!1,this.label=void 0,this.numberingSystem=void 0,this.placement="bottom",this.scale="m",this.messages=void 0,this.messageOverrides=void 0,this.slottedInShell=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.hasEndActions=!1,this.queue=[],this.queueLength=0,this.queued=!1}openHandler(){v(this),this.open&&!this.queued&&this.calciteInternalAlertRegister.emit(),this.open||(this.queue=this.queue.filter((t=>t!==this.el)),this.calciteInternalAlertSync.emit({queue:this.queue}))}onMessagesChange(){}updateDuration(){this.autoClose&&this.autoCloseTimeoutId&&(window.clearTimeout(this.autoCloseTimeoutId),this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),_[this.autoCloseDuration]))}connectedCallback(){p(this),f(this),this.open&&!this.queued&&this.calciteInternalAlertRegister.emit()}async componentWillLoad(){h(this),await b(this),this.open&&v(this)}componentDidLoad(){d(this)}disconnectedCallback(){window.dispatchEvent(new CustomEvent("calciteInternalAlertUnregister",{detail:{alert:this.el}})),window.clearTimeout(this.autoCloseTimeoutId),window.clearTimeout(this.queueTimeout),m(this),w(this),this.slottedInShell=!1}render(){g.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,signDisplay:"always"};const{open:t,autoClose:i,label:a,placement:o,queued:l}=this,c=i?"alert":"alertdialog",h=!t,d=r(y,this.icon,this.kind),u=this.queueLength>1;return e(s,{"aria-hidden":n(h),"aria-label":a,"calcite-hydrated-hidden":h,role:c},e("div",{class:{[j]:!0,"container--queued":l,[`${j}--${o}`]:!0,"container--slotted-in-shell":this.slottedInShell},onPointerEnter:this.autoClose&&this.autoCloseTimeoutId?this.handleMouseOver:null,onPointerLeave:this.autoClose&&this.autoCloseTimeoutId?this.handleMouseLeave:null,ref:this.setTransitionEl},d&&this.renderIcon(d),e("div",{class:"text-container"},e("slot",{name:"title"}),e("slot",{name:"message"}),e("slot",{name:"link"})),this.renderActionsEnd(),u?this.renderQueueCount():null,this.renderCloseButton(),t&&!l&&i?e("div",{class:"dismiss-progress"}):null))}renderCloseButton(){return e("button",{"aria-label":this.messages.close,class:"close",key:"close",onClick:this.closeAlert,type:"button",ref:t=>this.closeButton=t},e("calcite-icon",{icon:"x",scale:c(this.scale)}))}renderQueueCount(){const t=g.numberFormatter.format(this.queueLength>2?this.queueLength-1:1);return e("div",{class:{"queue-count":!0,"queue-count--active":this.queueLength>1},key:"queue-count"},e("calcite-chip",{scale:this.scale,value:t},t))}renderActionsEnd(){return e("div",{class:"actions-end"},e("slot",{name:"actions-end",onSlotchange:this.actionsEndSlotChangeHandler}))}renderIcon(t){return e("div",{class:"icon"},e("calcite-icon",{flipRtl:this.iconFlipRtl,icon:t,scale:c(this.scale)}))}alertSync(t){this.queue!==t.detail.queue&&(this.queue=t.detail.queue),this.queueLength=this.queue.length,this.determineActiveAlert(),t.stopPropagation()}alertRegister(){this.open&&!this.queue.includes(this.el)&&(this.queued=!0,this.queue.push(this.el)),this.calciteInternalAlertSync.emit({queue:this.queue}),this.determineActiveAlert()}alertUnregister(t){const i=this.queue.filter((i=>i!==t.detail.alert));this.queue=i,window.dispatchEvent(new CustomEvent("calciteInternalAlertSync",{detail:{queue:i}}))}async setFocus(){await u(this);const t=l(this.el,{selector:"calcite-link"});if(this.closeButton||t)return t?t.setFocus():void(this.closeButton&&this.closeButton.focus())}effectiveLocaleChange(){k(this,this.effectiveLocale)}determineActiveAlert(){var t;(null===(t=this.queue)||void 0===t?void 0:t[0])===this.el&&(this.openAlert(),this.autoClose&&!this.autoCloseTimeoutId&&(this.initialOpenTime=Date.now(),this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),_[this.autoCloseDuration])))}onBeforeOpen(){this.calciteAlertBeforeOpen.emit()}onOpen(){this.calciteAlertOpen.emit()}onBeforeClose(){this.calciteAlertBeforeClose.emit()}onClose(){this.calciteAlertClose.emit()}openAlert(){window.clearTimeout(this.queueTimeout),this.queueTimeout=window.setTimeout((()=>this.queued=!1),300)}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],autoCloseDuration:["updateDuration"],effectiveLocale:["effectiveLocaleChange"]}}};q.style=':host{--calcite-alert-edge-distance:2rem;display:block}.container{pointer-events:none;position:fixed;z-index:var(--calcite-app-z-index-toast);margin-inline:auto;margin-block:0px;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:-moz-min-content;min-inline-size:min-content;align-items:center;justify-content:center;background-color:var(--calcite-ui-foreground-1);text-align:start;opacity:0;--tw-shadow:0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);--tw-shadow-colored:0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);container:responsive-container/inline-size;border-radius:var(--calcite-border-radius);border-block-start:0 solid transparent;border-inline:1px solid var(--calcite-ui-border-3);border-block-end:1px solid var(--calcite-ui-border-3);inline-size:var(--calcite-alert-width);max-inline-size:calc(100% - var(--calcite-alert-edge-distance) * 2);transition:var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), all var(--calcite-animation-timing) ease-in-out}.container--bottom,.container--top{inset-inline-end:0;inset-inline-start:0}.container[class*=bottom]{transform:translate3d(0, var(--calcite-alert-edge-distance), 0);inset-block-end:var(--calcite-alert-edge-distance)}.container[class*=top]{transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), 0);inset-block-start:var(--calcite-alert-edge-distance)}.container[class*=start]{inset-inline-start:var(--calcite-alert-edge-distance);inset-inline-end:auto}.container[class*=end]{inset-inline-end:var(--calcite-alert-edge-distance);inset-inline-start:auto}.icon{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0px;margin-block:auto;margin-inline-end:auto;padding-inline-start:var(--calcite-alert-spacing-token-large)}.close{display:flex;cursor:pointer;align-items:center;justify-content:flex-end;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;-webkit-appearance:none;padding:var(--calcite-alert-spacing-token-large);outline-color:transparent}.close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}.close:hover,.close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.close:active{background-color:var(--calcite-ui-foreground-3)}.queue-count{visibility:hidden;display:flex;min-inline-size:-moz-min-content;min-inline-size:min-content;cursor:default;align-items:center;justify-content:space-around;align-self:stretch;overflow:hidden;background-color:var(--calcite-ui-foreground-1);text-align:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline:0 solid transparent;border-start-end-radius:0}.queue-count--active{visibility:visible;opacity:1}.dismiss-progress{position:absolute;display:block;inline-size:100%;overflow:hidden;inset-inline:0;inset-block-start:-2px;block-size:2px;border-radius:var(--calcite-border-radius) var(--calcite-border-radius) 0 0}.dismiss-progress:after{position:absolute;inset-block-start:0px;display:block;block-size:2px;content:"";background-color:var(--calcite-alert-dismiss-progress-background);inset-inline-end:0}.actions-end{display:flex;align-self:stretch}.text-container{box-sizing:border-box;display:flex;min-inline-size:0px;flex:1 1 auto;flex-direction:column;overflow-wrap:break-word;padding-block:var(--calcite-alert-spacing-token-small);padding-inline:var(--calcite-alert-spacing-token-large) var(--calcite-alert-spacing-token-small)}.footer{position:relative;display:flex;inline-size:auto;justify-content:flex-end;align-self:stretch;padding-block-start:1px;block-size:inherit}:host([scale=s]){--calcite-alert-width:40em;--calcite-alert-spacing-token-small:0.5rem;--calcite-alert-spacing-token-large:0.75rem;--calcite-alert-footer-height:2rem;--calcite-alert-footer-divider-gap:0.125rem}:host([scale=s]) slot[name=title]::slotted(*),:host([scale=s]) *::slotted([slot=title]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) slot[name=message]::slotted(*),:host([scale=s]) *::slotted([slot=message]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) slot[name=link]::slotted(*),:host([scale=s]) *::slotted([slot=link]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .queue-count{margin-inline:0.5rem}:host([scale=s]) .container{--calcite-alert-min-height:3.5rem}:host([scale=m]){--calcite-alert-width:50em;--calcite-alert-spacing-token-small:0.75rem;--calcite-alert-spacing-token-large:1rem;--calcite-alert-footer-height:3rem;--calcite-alert-footer-divider-gap:0.25rem}:host([scale=m]) slot[name=title]::slotted(*),:host([scale=m]) *::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) slot[name=message]::slotted(*),:host([scale=m]) *::slotted([slot=message]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) slot[name=link]::slotted(*),:host([scale=m]) *::slotted([slot=link]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .queue-count{margin-inline:0.75rem}:host([scale=m]) .container{--calcite-alert-min-height:4.1875rem}:host([scale=l]){--calcite-alert-width:60em;--calcite-alert-spacing-token-small:1rem;--calcite-alert-spacing-token-large:1.25rem;--calcite-alert-footer-height:4rem;--calcite-alert-footer-divider-gap:0.5rem}:host([scale=l]) slot[name=title]::slotted(*),:host([scale=l]) *::slotted([slot=title]){margin-block-end:0.25rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) slot[name=message]::slotted(*),:host([scale=l]) *::slotted([slot=message]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) slot[name=link]::slotted(*),:host([scale=l]) *::slotted([slot=link]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .queue-count{margin-inline:1rem}:host([scale=l]) .container{--calcite-alert-min-height:5.625rem}:host([open]) .container:not(.container--queued){border-block-start-width:2px;opacity:1;pointer-events:initial}:host([open]) .container:not(.container--queued)[class*=bottom]{transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), inherit)}:host([open]) .container:not(.container--queued)[class*=top]{transform:translate3d(0, var(--calcite-alert-edge-distance), inherit)}:host([auto-close])>.queue-count{border-inline-end:0 solid transparent}slot[name=title]::slotted(*),*::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}slot[name=message]::slotted(*),*::slotted([slot=message]){margin:0px;display:inline;font-size:var(--calcite-font-size--1);line-height:1.375;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);margin-inline-end:0.5rem}slot[name=link]::slotted(*),*::slotted([slot=link]){display:inline-flex;color:var(--calcite-ui-text-link)}:host([kind=brand]) .container{border-block-start-color:var(--calcite-ui-brand)}:host([kind=brand]) .container .icon{color:var(--calcite-ui-brand)}:host([kind=info]) .container{border-block-start-color:var(--calcite-ui-info)}:host([kind=info]) .container .icon{color:var(--calcite-ui-info)}:host([kind=danger]) .container{border-block-start-color:var(--calcite-ui-danger)}:host([kind=danger]) .container .icon{color:var(--calcite-ui-danger)}:host([kind=success]) .container{border-block-start-color:var(--calcite-ui-success)}:host([kind=success]) .container .icon{color:var(--calcite-ui-success)}:host([kind=warning]) .container{border-block-start-color:var(--calcite-ui-warning)}:host([kind=warning]) .container .icon{color:var(--calcite-ui-warning)}:host([auto-close-duration=fast]) .dismiss-progress:after{animation:dismissProgress 6000ms ease-out}:host(:hover[auto-close-duration=fast]) .dismiss-progress:after{animation-play-state:paused}:host([auto-close-duration=medium]) .dismiss-progress:after{animation:dismissProgress 10000ms ease-out}:host(:hover[auto-close-duration=medium]) .dismiss-progress:after{animation-play-state:paused}:host([auto-close-duration=slow]) .dismiss-progress:after{animation:dismissProgress 14000ms ease-out}:host(:hover[auto-close-duration=slow]) .dismiss-progress:after{animation-play-state:paused}@keyframes dismissProgress{0%{inline-size:0px;opacity:0.75}100%{inline-size:100%;opacity:1}}.container--slotted-in-shell{position:absolute}:host([hidden]){display:none}[hidden]{display:none}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}';const W=class{constructor(e){t(this,e),this.closeEdit=i(this,"closeEdit",7),this.editsComplete=i(this,"editsComplete",7),this._shouldClose=!1,this.graphics=void 0,this.mapView=void 0,this.open=!1,this.graphicIndex=0,this._editorLoading=!1,this._translations=void 0}async graphicsWatchHandler(){0===this.graphics.length&&await this._closeEdit()}async openWatchHandler(t){var i;t&&(null===(i=this.graphics)||void 0===i?void 0:i.length)>0&&this.graphicIndex>-1&&(this._editorLoading=!0,await this._initEditorWidget(),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&await this._startUpdate(),this._editorLoading=!1),t||await this._closeEdit()}async featureSelectionChange(){await this._closeEdit()}async componentWillLoad(){await this._initModules(),await this._getTranslations()}async componentWillRender(){var t,i;(null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&(null===(i=this.graphics[0])||void 0===i?void 0:i.layer)&&(this._layer=this.graphics[0].layer,this._layerEditHandle&&this._layerEditHandle.remove(),this._layerEditHandle=this._layer.on("edits",(()=>{this.editsComplete.emit(),this._closeEdit()})))}render(){var t;const i=!((null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&this.graphics[0]&&this.graphics[0].layer.editingEnabled),a=this._editorLoading?"display-none":"position-absolute",o=this._editorLoading?"":"display-none";return e(s,null,e("div",{class:"position-absolute"},i?e("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},e("div",{slot:"message"},this._translations.enableEditing)):void 0,e("div",{class:"position-absolute",slot:"content"},e("div",{class:a,id:"feature-form",ref:t=>this._editContainer=t}),e("calcite-loader",{class:o,label:"",scale:"s"}))))}async _initModules(){const[t,i]=await x(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}async _initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div"),i=(await C(this.mapView)).map((t=>({layer:t,geometryUpdatesEnabled:!1})));this._editor=new this.Editor({allowedWorkflows:"update",view:this.mapView,layerInfos:i,visibleElements:{snappingControls:!1,sketchTooltipControls:!1},container:t}),this._editHandle&&this._attachmentHandle&&this._activeWorkflowHandle&&(this._editHandle.remove(),this._attachmentHandle.remove(),this._activeWorkflowHandle.remove()),this._attachmentHandle=this.reactiveUtils.when((()=>"adding-attachment"===this._editor.viewModel.state||"editing-attachment"===this._editor.viewModel.state||"creating-features"===this._editor.viewModel.state),(()=>{this._shouldClose=!1})),this._editHandle=this.reactiveUtils.when((()=>"ready"===this._editor.viewModel.state),(()=>{this._shouldClose?this._closeEdit():this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&this._startUpdate()})),this._activeWorkflowHandle=this.reactiveUtils.watch((()=>{var t;return null===(t=this._editor.viewModel.activeWorkflow)||void 0===t?void 0:t.activeWorkflow}),(t=>{"update-table-record"!==(null==t?void 0:t.type)&&"create-features"!==(null==t?void 0:t.type)||(this._shouldClose=!1)})),this._editContainer.appendChild(t)}}async _closeEdit(){var t,i,e;this._shouldClose=!0,(null===(t=this._editor)||void 0===t?void 0:t.activeWorkflow)&&await(null===(i=this._editor)||void 0===i?void 0:i.cancelWorkflow()),null===(e=this._editor)||void 0===e||e.destroy(),this._shouldClose=!1,this.closeEdit.emit()}async _startUpdate(){await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0}async _getTranslations(){const t=await z(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],open:["openWatchHandler"]}}};W.style=":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}#feature-form{--calcite-ui-background:none;padding-top:0px}.padding-sides-bottom-1{padding:0 1rem 1rem 1rem}.position-relative{position:relative}.esri-editor__prompt--danger{position:relative !important;width:100% !important;background-color:var(--calcite-ui-foreground-1) !important}.esri-feature__content-node{background-color:var(--calcite-ui-foreground-1) !important}.esri-editor__panel-toolbar{display:none !important}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}";const E=class{constructor(e){t(this,e),this.selectionChanged=i(this,"selectionChanged",7),this.graphics=void 0,this.isLoading=!1,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._alertOpen=!1,this._count="",this._editRecordOpen=!1,this._showListView=!1,this._translations=void 0}async graphicsWatchHandler(){var t;if(this._features||await this._initFeaturesWidget(),this.graphics.length>0){const i=null===(t=this.graphics[0])||void 0===t?void 0:t.layer;this._editEnabled=i.editingEnabled&&i.capabilities.operations.supportsUpdate,this._features.open({features:this.graphics})}else this._features.clear(),this._features.close()}async mapViewWatchHandler(){return await this._initFeaturesWidget()}async getSelectedFeature(){return this._features.selectedFeature}async closeEdit(){this._editRecordOpen=!1}async componentWillLoad(){await this._initModules(),await this._getTranslations()}render(){var t,i,a;const o=this.isLoading||this._editRecordOpen?"display-none":"position-absolute",n=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",l=!this.isLoading&&this._editRecordOpen||this._showListView?"display-none":"",r=(null===(i=null===(t=this._features)||void 0===t?void 0:t.features)||void 0===i?void 0:i.length)<2;return e(s,null,e("calcite-shell",null,e("calcite-loader",{class:this.isLoading?"":"display-none",label:this._translations.fetchingData}),e("div",{class:"esri-widget "+o,id:"features-node"}),e("div",{class:`${l} width-100`,slot:"footer"},e("div",{class:"display-flex top-border padding-1-2"},e("calcite-button",{appearance:"solid","icon-start":"pencil",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),e("calcite-tooltip",{label:"",placement:"bottom","reference-element":"solutions-edit"},e("span",null,this._translations.edit))),e("div",{class:"display-flex padding-1-2 button-container top-border"},e("div",{class:"min-width-100"},e("calcite-button",{appearance:"outline",disabled:r,id:"solutions-back",onClick:()=>this._back(),width:"full"},this._translations.back),e("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-back"},e("span",null,this._translations.back))),e("div",null,e("calcite-action",{icon:"list",onClick:()=>this._toggleListView(),scale:"s",text:this._getCount(),textEnabled:!0})),e("div",{class:"min-width-100"},e("calcite-button",{appearance:"outline",disabled:r,id:"solutions-next",onClick:()=>this._next(),width:"full"},this._translations.next),e("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-next"},e("span",null,this._translations.next))))),e("edit-card",{class:n,graphicIndex:null===(a=this._features)||void 0===a?void 0:a.selectedFeatureIndex,graphics:this.graphics,mapView:this.mapView,open:this._editRecordOpen}),e("calcite-alert",{icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},e("div",{slot:"title"},this._translations.editDisabled),e("div",{slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,i]=await x(["esri/widgets/Features","esri/core/reactiveUtils"]);this.Features=t,this.reactiveUtils=i}async _initFeaturesWidget(){return await this.mapView.when((()=>{this._features?this._features.view=this.mapView:(this._features=new this.Features({view:this.mapView,container:"features-node",visibleElements:{actionBar:!1,closeButton:!1,heading:!0}}),this.reactiveUtils.watch((()=>this._features.viewModel.featureMenuOpen),(t=>{t||(this._showListView=t)})),this.zoomAndScrollToSelected&&this.reactiveUtils.watch((()=>this._features.selectedFeatureIndex),(t=>{t>-1&&this.selectionChanged.emit(this._features.selectedFeature)})))}))}_alertClosed(){this._alertOpen=!1}_editRecordClosed(){this._editRecordOpen=!1}_openEditRecord(){this._editEnabled?this._editRecordOpen=!0:this._alertOpen=!0}_back(){this._features.previous(),this._count=this._getCount()}_next(){this._features.next(),this._count=this._getCount()}_getCount(){var t,i,e;const s=((null===(t=this._features)||void 0===t?void 0:t.viewModel.selectedFeatureIndex)+1).toString(),a=null===(e=null===(i=this._features)||void 0===i?void 0:i.features)||void 0===e?void 0:e.length.toString();return this._translations.indexOfTotal.replace("{{index}}",s).replace("{{total}}",a)}_toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async _getTranslations(){const t=await z(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};E.style=":host{display:block;--calcite-label-margin-bottom:0}table{border-collapse:collapse;width:100%}th,td{text-align:left;padding:8px}tr:nth-child(odd){background:var(--calcite-ui-foreground-2)}.bottom-border{padding-bottom:0.5rem;border-bottom:1px solid var(--calcite-ui-border-1)}.padding-1-2{padding:0.5rem}.padding-top-1-2{padding-top:0.5rem}.font-color-3{color:var(--calcite-ui-text-3)}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.esri-features__footer{display:none !important}.button-container{justify-content:space-between;align-items:center}.top-border{border-top:1px solid var(--calcite-ui-border-1)}.min-width-100{min-width:100px}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-ui-foreground-1) !important;height:100% !important}";export{q as calcite_alert,W as edit_card,E as info_card}
|
11
|
+
*/const _={slow:14e3,medium:1e4,fast:6e3},j="container",q=class{constructor(e){t(this,e),this.calciteAlertBeforeClose=i(this,"calciteAlertBeforeClose",6),this.calciteAlertClose=i(this,"calciteAlertClose",6),this.calciteAlertBeforeOpen=i(this,"calciteAlertBeforeOpen",6),this.calciteAlertOpen=i(this,"calciteAlertOpen",6),this.calciteInternalAlertSync=i(this,"calciteInternalAlertSync",6),this.calciteInternalAlertRegister=i(this,"calciteInternalAlertRegister",6),this.autoCloseTimeoutId=null,this.totalOpenTime=0,this.totalHoverTime=0,this.openTransitionProp="opacity",this.setTransitionEl=t=>{this.transitionEl=t},this.closeAlert=()=>{this.autoCloseTimeoutId=null,this.queued=!1,this.open=!1,this.queue=this.queue.filter((t=>t!==this.el)),this.determineActiveAlert(),this.calciteInternalAlertSync.emit({queue:this.queue})},this.actionsEndSlotChangeHandler=t=>{this.hasEndActions=o(t)},this.handleMouseOver=()=>{window.clearTimeout(this.autoCloseTimeoutId),this.totalOpenTime=Date.now()-this.initialOpenTime,this.lastMouseOverBegin=Date.now()},this.handleMouseLeave=()=>{const t=Date.now()-this.lastMouseOverBegin,i=_[this.autoCloseDuration]-this.totalOpenTime+this.totalHoverTime;this.totalHoverTime=this.totalHoverTime?t+this.totalHoverTime:t,this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),i)},this.open=!1,this.autoClose=!1,this.autoCloseDuration="medium",this.kind="brand",this.icon=void 0,this.iconFlipRtl=!1,this.label=void 0,this.numberingSystem=void 0,this.placement="bottom",this.scale="m",this.messages=void 0,this.messageOverrides=void 0,this.slottedInShell=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.hasEndActions=!1,this.queue=[],this.queueLength=0,this.queued=!1}openHandler(){v(this),this.open&&!this.queued&&this.calciteInternalAlertRegister.emit(),this.open||(this.queue=this.queue.filter((t=>t!==this.el)),this.calciteInternalAlertSync.emit({queue:this.queue}))}onMessagesChange(){}updateDuration(){this.autoClose&&this.autoCloseTimeoutId&&(window.clearTimeout(this.autoCloseTimeoutId),this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),_[this.autoCloseDuration]))}connectedCallback(){p(this),f(this),this.open&&!this.queued&&this.calciteInternalAlertRegister.emit()}async componentWillLoad(){h(this),await b(this),this.open&&v(this)}componentDidLoad(){d(this)}disconnectedCallback(){window.dispatchEvent(new CustomEvent("calciteInternalAlertUnregister",{detail:{alert:this.el}})),window.clearTimeout(this.autoCloseTimeoutId),window.clearTimeout(this.queueTimeout),m(this),w(this),this.slottedInShell=!1}render(){g.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,signDisplay:"always"};const{open:t,autoClose:i,label:a,placement:o,queued:l}=this,c=i?"alert":"alertdialog",h=!t,d=r(y,this.icon,this.kind),u=this.queueLength>1;return e(s,{"aria-hidden":n(h),"aria-label":a,"calcite-hydrated-hidden":h,role:c},e("div",{class:{[j]:!0,"container--queued":l,[`${j}--${o}`]:!0,"container--slotted-in-shell":this.slottedInShell},onPointerEnter:this.autoClose&&this.autoCloseTimeoutId?this.handleMouseOver:null,onPointerLeave:this.autoClose&&this.autoCloseTimeoutId?this.handleMouseLeave:null,ref:this.setTransitionEl},d&&this.renderIcon(d),e("div",{class:"text-container"},e("slot",{name:"title"}),e("slot",{name:"message"}),e("slot",{name:"link"})),this.renderActionsEnd(),u?this.renderQueueCount():null,this.renderCloseButton(),t&&!l&&i?e("div",{class:"dismiss-progress"}):null))}renderCloseButton(){return e("button",{"aria-label":this.messages.close,class:"close",key:"close",onClick:this.closeAlert,type:"button",ref:t=>this.closeButton=t},e("calcite-icon",{icon:"x",scale:c(this.scale)}))}renderQueueCount(){const t=g.numberFormatter.format(this.queueLength>2?this.queueLength-1:1);return e("div",{class:{"queue-count":!0,"queue-count--active":this.queueLength>1},key:"queue-count"},e("calcite-chip",{scale:this.scale,value:t},t))}renderActionsEnd(){return e("div",{class:"actions-end"},e("slot",{name:"actions-end",onSlotchange:this.actionsEndSlotChangeHandler}))}renderIcon(t){return e("div",{class:"icon"},e("calcite-icon",{flipRtl:this.iconFlipRtl,icon:t,scale:c(this.scale)}))}alertSync(t){this.queue!==t.detail.queue&&(this.queue=t.detail.queue),this.queueLength=this.queue.length,this.determineActiveAlert(),t.stopPropagation()}alertRegister(){this.open&&!this.queue.includes(this.el)&&(this.queued=!0,this.queue.push(this.el)),this.calciteInternalAlertSync.emit({queue:this.queue}),this.determineActiveAlert()}alertUnregister(t){const i=this.queue.filter((i=>i!==t.detail.alert));this.queue=i,window.dispatchEvent(new CustomEvent("calciteInternalAlertSync",{detail:{queue:i}}))}async setFocus(){await u(this);const t=l(this.el,{selector:"calcite-link"});if(this.closeButton||t)return t?t.setFocus():void(this.closeButton&&this.closeButton.focus())}effectiveLocaleChange(){k(this,this.effectiveLocale)}determineActiveAlert(){var t;(null===(t=this.queue)||void 0===t?void 0:t[0])===this.el&&(this.openAlert(),this.autoClose&&!this.autoCloseTimeoutId&&(this.initialOpenTime=Date.now(),this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),_[this.autoCloseDuration])))}onBeforeOpen(){this.calciteAlertBeforeOpen.emit()}onOpen(){this.calciteAlertOpen.emit()}onBeforeClose(){this.calciteAlertBeforeClose.emit()}onClose(){this.calciteAlertClose.emit()}openAlert(){window.clearTimeout(this.queueTimeout),this.queueTimeout=window.setTimeout((()=>this.queued=!1),300)}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],autoCloseDuration:["updateDuration"],effectiveLocale:["effectiveLocaleChange"]}}};q.style=':host{--calcite-alert-edge-distance:2rem;display:block}.container{pointer-events:none;position:fixed;z-index:var(--calcite-app-z-index-toast);margin-inline:auto;margin-block:0px;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:-moz-min-content;min-inline-size:min-content;align-items:center;justify-content:center;background-color:var(--calcite-ui-foreground-1);text-align:start;opacity:0;--tw-shadow:0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);--tw-shadow-colored:0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);container:responsive-container/inline-size;border-radius:var(--calcite-border-radius);border-block-start:0 solid transparent;border-inline:1px solid var(--calcite-ui-border-3);border-block-end:1px solid var(--calcite-ui-border-3);inline-size:var(--calcite-alert-width);max-inline-size:calc(100% - var(--calcite-alert-edge-distance) * 2);transition:var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), all var(--calcite-animation-timing) ease-in-out}.container--bottom,.container--top{inset-inline-end:0;inset-inline-start:0}.container[class*=bottom]{transform:translate3d(0, var(--calcite-alert-edge-distance), 0);inset-block-end:var(--calcite-alert-edge-distance)}.container[class*=top]{transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), 0);inset-block-start:var(--calcite-alert-edge-distance)}.container[class*=start]{inset-inline-start:var(--calcite-alert-edge-distance);inset-inline-end:auto}.container[class*=end]{inset-inline-end:var(--calcite-alert-edge-distance);inset-inline-start:auto}.icon{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0px;margin-block:auto;margin-inline-end:auto;padding-inline-start:var(--calcite-alert-spacing-token-large)}.close{display:flex;cursor:pointer;align-items:center;justify-content:flex-end;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;-webkit-appearance:none;padding:var(--calcite-alert-spacing-token-large);outline-color:transparent}.close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}.close:hover,.close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.close:active{background-color:var(--calcite-ui-foreground-3)}.queue-count{visibility:hidden;display:flex;min-inline-size:-moz-min-content;min-inline-size:min-content;cursor:default;align-items:center;justify-content:space-around;align-self:stretch;overflow:hidden;background-color:var(--calcite-ui-foreground-1);text-align:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline:0 solid transparent;border-start-end-radius:0}.queue-count--active{visibility:visible;opacity:1}.dismiss-progress{position:absolute;display:block;inline-size:100%;overflow:hidden;inset-inline:0;inset-block-start:-2px;block-size:2px;border-radius:var(--calcite-border-radius) var(--calcite-border-radius) 0 0}.dismiss-progress:after{position:absolute;inset-block-start:0px;display:block;block-size:2px;content:"";background-color:var(--calcite-alert-dismiss-progress-background);inset-inline-end:0}.actions-end{display:flex;align-self:stretch}.text-container{box-sizing:border-box;display:flex;min-inline-size:0px;flex:1 1 auto;flex-direction:column;overflow-wrap:break-word;padding-block:var(--calcite-alert-spacing-token-small);padding-inline:var(--calcite-alert-spacing-token-large) var(--calcite-alert-spacing-token-small)}.footer{position:relative;display:flex;inline-size:auto;justify-content:flex-end;align-self:stretch;padding-block-start:1px;block-size:inherit}:host([scale=s]){--calcite-alert-width:40em;--calcite-alert-spacing-token-small:0.5rem;--calcite-alert-spacing-token-large:0.75rem;--calcite-alert-footer-height:2rem;--calcite-alert-footer-divider-gap:0.125rem}:host([scale=s]) slot[name=title]::slotted(*),:host([scale=s]) *::slotted([slot=title]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) slot[name=message]::slotted(*),:host([scale=s]) *::slotted([slot=message]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) slot[name=link]::slotted(*),:host([scale=s]) *::slotted([slot=link]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .queue-count{margin-inline:0.5rem}:host([scale=s]) .container{--calcite-alert-min-height:3.5rem}:host([scale=m]){--calcite-alert-width:50em;--calcite-alert-spacing-token-small:0.75rem;--calcite-alert-spacing-token-large:1rem;--calcite-alert-footer-height:3rem;--calcite-alert-footer-divider-gap:0.25rem}:host([scale=m]) slot[name=title]::slotted(*),:host([scale=m]) *::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) slot[name=message]::slotted(*),:host([scale=m]) *::slotted([slot=message]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) slot[name=link]::slotted(*),:host([scale=m]) *::slotted([slot=link]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .queue-count{margin-inline:0.75rem}:host([scale=m]) .container{--calcite-alert-min-height:4.1875rem}:host([scale=l]){--calcite-alert-width:60em;--calcite-alert-spacing-token-small:1rem;--calcite-alert-spacing-token-large:1.25rem;--calcite-alert-footer-height:4rem;--calcite-alert-footer-divider-gap:0.5rem}:host([scale=l]) slot[name=title]::slotted(*),:host([scale=l]) *::slotted([slot=title]){margin-block-end:0.25rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) slot[name=message]::slotted(*),:host([scale=l]) *::slotted([slot=message]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) slot[name=link]::slotted(*),:host([scale=l]) *::slotted([slot=link]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .queue-count{margin-inline:1rem}:host([scale=l]) .container{--calcite-alert-min-height:5.625rem}:host([open]) .container:not(.container--queued){border-block-start-width:2px;opacity:1;pointer-events:initial}:host([open]) .container:not(.container--queued)[class*=bottom]{transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), inherit)}:host([open]) .container:not(.container--queued)[class*=top]{transform:translate3d(0, var(--calcite-alert-edge-distance), inherit)}:host([auto-close])>.queue-count{border-inline-end:0 solid transparent}slot[name=title]::slotted(*),*::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}slot[name=message]::slotted(*),*::slotted([slot=message]){margin:0px;display:inline;font-size:var(--calcite-font-size--1);line-height:1.375;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);margin-inline-end:0.5rem}slot[name=link]::slotted(*),*::slotted([slot=link]){display:inline-flex;color:var(--calcite-ui-text-link)}:host([kind=brand]) .container{border-block-start-color:var(--calcite-ui-brand)}:host([kind=brand]) .container .icon{color:var(--calcite-ui-brand)}:host([kind=info]) .container{border-block-start-color:var(--calcite-ui-info)}:host([kind=info]) .container .icon{color:var(--calcite-ui-info)}:host([kind=danger]) .container{border-block-start-color:var(--calcite-ui-danger)}:host([kind=danger]) .container .icon{color:var(--calcite-ui-danger)}:host([kind=success]) .container{border-block-start-color:var(--calcite-ui-success)}:host([kind=success]) .container .icon{color:var(--calcite-ui-success)}:host([kind=warning]) .container{border-block-start-color:var(--calcite-ui-warning)}:host([kind=warning]) .container .icon{color:var(--calcite-ui-warning)}:host([auto-close-duration=fast]) .dismiss-progress:after{animation:dismissProgress 6000ms ease-out}:host(:hover[auto-close-duration=fast]) .dismiss-progress:after{animation-play-state:paused}:host([auto-close-duration=medium]) .dismiss-progress:after{animation:dismissProgress 10000ms ease-out}:host(:hover[auto-close-duration=medium]) .dismiss-progress:after{animation-play-state:paused}:host([auto-close-duration=slow]) .dismiss-progress:after{animation:dismissProgress 14000ms ease-out}:host(:hover[auto-close-duration=slow]) .dismiss-progress:after{animation-play-state:paused}@keyframes dismissProgress{0%{inline-size:0px;opacity:0.75}100%{inline-size:100%;opacity:1}}.container--slotted-in-shell{position:absolute}:host([hidden]){display:none}[hidden]{display:none}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}';const W=class{constructor(e){t(this,e),this.closeEdit=i(this,"closeEdit",7),this.editsComplete=i(this,"editsComplete",7),this.refreshGraphics=i(this,"refreshGraphics",7),this._shouldClose=!1,this.graphics=void 0,this.mapView=void 0,this.open=!1,this.graphicIndex=0,this._editorLoading=!1,this._translations=void 0}async graphicsWatchHandler(){0===this.graphics.length&&await this._closeEdit()}async openWatchHandler(t){var i;t&&(null===(i=this.graphics)||void 0===i?void 0:i.length)>0&&this.graphicIndex>-1&&(this._editorLoading=!0,await this._initEditorWidget(),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&await this._startUpdate(),this._editorLoading=!1),t||await this._closeEdit()}async featureSelectionChange(){await this._closeEdit()}async componentWillLoad(){await this._initModules(),await this._getTranslations()}async componentWillRender(){var t,i;(null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&(null===(i=this.graphics[0])||void 0===i?void 0:i.layer)&&(this._layer=this.graphics[0].layer,this._layerEditHandle&&this._layerEditHandle.remove(),this._layerEditHandle=this._layer.on("edits",(()=>{this.editsComplete.emit(),this.open=!1})))}render(){var t;const i=!((null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&this.graphics[0]&&this.graphics[0].layer.editingEnabled),a=this._editorLoading?"display-none":"position-absolute",o=this._editorLoading?"":"display-none";return e(s,null,e("div",{class:"position-absolute"},i?e("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},e("div",{slot:"message"},this._translations.enableEditing)):void 0,e("div",{class:"position-absolute",slot:"content"},e("div",{class:a,id:"feature-form",ref:t=>this._editContainer=t}),e("calcite-loader",{class:o,label:"",scale:"s"}))))}async _initModules(){const[t,i]=await x(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}async _initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div"),i=(await C(this.mapView)).map((t=>({layer:t,geometryUpdatesEnabled:!1})));this._editor=new this.Editor({allowedWorkflows:"update",view:this.mapView,layerInfos:i,visibleElements:{snappingControls:!1,sketchTooltipControls:!1},container:t}),this._attachmentHandle&&this._activeWorkflowHandle&&(this._attachmentHandle.remove(),this._activeWorkflowHandle.remove()),this._attachmentHandle=this.reactiveUtils.when((()=>"adding-attachment"===this._editor.viewModel.state||"editing-attachment"===this._editor.viewModel.state||"creating-features"===this._editor.viewModel.state),(()=>{this._shouldClose=!1})),this._activeWorkflowHandle=this.reactiveUtils.watch((()=>{var t;return null===(t=this._editor.viewModel.activeWorkflow)||void 0===t?void 0:t.activeWorkflow}),(t=>{"update-table-record"!==(null==t?void 0:t.type)&&"create-features"!==(null==t?void 0:t.type)||(this._shouldClose=!1),(null==t?void 0:t.type)||(null==t?void 0:t.hasPendingEdits)||(this.open=!1)})),this._editContainer.appendChild(t)}}async _closeEdit(){var t,i,e,s;this._shouldClose=!0,(null===(t=this._editor)||void 0===t?void 0:t.activeWorkflow)&&await(null===(i=this._editor)||void 0===i?void 0:i.cancelWorkflow()),this.graphicIndex>-1&&(null===(e=this.graphics)||void 0===e?void 0:e.length)>0&&this.refreshGraphics.emit(this.graphics),null===(s=this._editor)||void 0===s||s.destroy(),this._shouldClose=!1,this.closeEdit.emit()}async _startUpdate(){await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0}async _getTranslations(){const t=await z(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],open:["openWatchHandler"]}}};W.style=":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}#feature-form{--calcite-ui-background:none;padding-top:0px}.padding-sides-bottom-1{padding:0 1rem 1rem 1rem}.position-relative{position:relative}.esri-editor__prompt--danger{position:relative !important;width:100% !important;background-color:var(--calcite-ui-foreground-1) !important}.esri-feature__content-node{background-color:var(--calcite-ui-foreground-1) !important}.esri-editor__panel-toolbar{display:none !important}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}";const E=class{constructor(e){t(this,e),this.selectionChanged=i(this,"selectionChanged",7),this.graphics=void 0,this.isLoading=!1,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._alertOpen=!1,this._count="",this._editRecordOpen=!1,this._showListView=!1,this._translations=void 0}async graphicsWatchHandler(){var t;if(this._features||await this._initFeaturesWidget(),this.graphics.length>0){const i=null===(t=this.graphics[0])||void 0===t?void 0:t.layer;this._editEnabled=i.editingEnabled&&i.capabilities.operations.supportsUpdate,this._features.open({features:this.graphics})}else this._features.clear(),this._features.close()}async mapViewWatchHandler(){return await this._initFeaturesWidget()}async getSelectedFeature(){return this._features.selectedFeature}async closeEdit(){this._editRecordOpen=!1}async refreshGraphics(t){this.graphics=[...t.detail]}async componentWillLoad(){await this._initModules(),await this._getTranslations()}render(){var t,i,a;const o=this.isLoading||this._editRecordOpen?"display-none":"position-absolute",n=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",l=!this.isLoading&&this._editRecordOpen||this._showListView?"display-none":"",r=(null===(i=null===(t=this._features)||void 0===t?void 0:t.features)||void 0===i?void 0:i.length)<2;return e(s,null,e("calcite-shell",null,e("calcite-loader",{class:this.isLoading?"":"display-none",label:this._translations.fetchingData}),e("div",{class:"esri-widget "+o,id:"features-node"}),e("div",{class:`${l} width-100`,slot:"footer"},e("div",{class:"display-flex top-border padding-1-2"},e("calcite-button",{appearance:"solid","icon-start":"pencil",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),e("calcite-tooltip",{label:"",placement:"bottom","reference-element":"solutions-edit"},e("span",null,this._translations.edit))),e("div",{class:"display-flex padding-1-2 button-container top-border"},e("div",{class:"min-width-100"},e("calcite-button",{appearance:"outline",disabled:r,id:"solutions-back",onClick:()=>this._back(),width:"full"},this._translations.back),e("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-back"},e("span",null,this._translations.back))),e("div",null,e("calcite-action",{icon:"list",onClick:()=>this._toggleListView(),scale:"s",text:this._getCount(),textEnabled:!0})),e("div",{class:"min-width-100"},e("calcite-button",{appearance:"outline",disabled:r,id:"solutions-next",onClick:()=>this._next(),width:"full"},this._translations.next),e("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-next"},e("span",null,this._translations.next))))),e("edit-card",{class:n,graphicIndex:null===(a=this._features)||void 0===a?void 0:a.selectedFeatureIndex,graphics:this.graphics,mapView:this.mapView,open:this._editRecordOpen}),e("calcite-alert",{icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},e("div",{slot:"title"},this._translations.editDisabled),e("div",{slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,i]=await x(["esri/widgets/Features","esri/core/reactiveUtils"]);this.Features=t,this.reactiveUtils=i}async _initFeaturesWidget(){return await this.mapView.when((()=>{this._features?this._features.view=this.mapView:(this._features=new this.Features({view:this.mapView,container:"features-node",visibleElements:{actionBar:!1,closeButton:!1,heading:!0}}),this.reactiveUtils.watch((()=>this._features.viewModel.featureMenuOpen),(t=>{t||(this._showListView=t)})),this.zoomAndScrollToSelected&&this.reactiveUtils.watch((()=>this._features.selectedFeatureIndex),(t=>{t>-1&&this.selectionChanged.emit(this._features.selectedFeature)})))}))}_alertClosed(){this._alertOpen=!1}_editRecordClosed(){this._editRecordOpen=!1}_openEditRecord(){this._editEnabled?this._editRecordOpen=!0:this._alertOpen=!0}_back(){this._features.previous(),this._count=this._getCount()}_next(){this._features.next(),this._count=this._getCount()}_getCount(){var t,i,e;const s=((null===(t=this._features)||void 0===t?void 0:t.viewModel.selectedFeatureIndex)+1).toString(),a=null===(e=null===(i=this._features)||void 0===i?void 0:i.features)||void 0===e?void 0:e.length.toString();return this._translations.indexOfTotal.replace("{{index}}",s).replace("{{total}}",a)}_toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async _getTranslations(){const t=await z(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};E.style=":host{display:block;--calcite-label-margin-bottom:0}table{border-collapse:collapse;width:100%}th,td{text-align:left;padding:8px}tr:nth-child(odd){background:var(--calcite-ui-foreground-2)}.bottom-border{padding-bottom:0.5rem;border-bottom:1px solid var(--calcite-ui-border-1)}.padding-1-2{padding:0.5rem}.padding-top-1-2{padding-top:0.5rem}.font-color-3{color:var(--calcite-ui-text-3)}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.esri-features__footer{display:none !important}.button-container{justify-content:space-between;align-items:center}.top-border{border-top:1px solid var(--calcite-ui-border-1)}.min-width-100{min-width:100px}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-ui-foreground-1) !important;height:100% !important}";export{q as calcite_alert,W as edit_card,E as info_card}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,h as i,H as s,g as e,c as a}from"./p-78780f63.js";import{l as h}from"./p-48ff9cea.js";import{g as n}from"./p-6b943f52.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const o=class{constructor(i){t(this,i),this.mapView=void 0,this.basemapConfig=void 0,this.basemapWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initBaseMapGallery(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return i(s,null,i("div",{ref:t=>{this._basemapElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t,i]=await h(["esri/widgets/BasemapGallery","esri/widgets/BasemapGallery/support/PortalBasemapsSource"]);this.BasemapGallery=t,this.PortalBasemapsSource=i}async _initBaseMapGallery(t){var i;if(this.BasemapGallery){this.basemapWidget&&this.basemapWidget.destroy();const s=new this.PortalBasemapsSource({query:(null===(i=this.basemapConfig)||void 0===i?void 0:i.basemapGroupId)?`id:${this.basemapConfig.basemapGroupId}`:null,filterFunction:this.basemapConfig?t=>!this.basemapConfig.basemapIdsToFilter.includes(t.portalItem.id):()=>!0});await s.refresh(),this.basemapWidget=new this.BasemapGallery({container:this._basemapElement,view:t,source:s})}}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};o.style=":host{display:block}";const r=class{constructor(i){t(this,i),this.enabled=void 0,this.floorFilterWidget=void 0,this.mapView=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initFloorFilter(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return i(s,null,i("div",{ref:t=>{this._floorFilterElement=t}}))}async _initModules(){const[t]=await h(["esri/widgets/FloorFilter"]);this.FloorFilter=t}_initFloorFilter(t){var i;t&&this.enabled&&this.FloorFilter&&(null===(i=null==t?void 0:t.map)||void 0===i?void 0:i.floorInfo)&&(this.floorFilterWidget?this.floorFilterWidget.view=t:this.floorFilterWidget=new this.FloorFilter({container:this._floorFilterElement,view:t}))}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};r.style=":host{display:block}";const l=class{constructor(i){t(this,i),this.fullscreenStateChange=a(this,"fullscreenStateChange",7),this.mapView=void 0,this.fullscreenWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this._initFullscreenWidget()}))}async componentWillLoad(){await this._initModules()}render(){return i(s,null,i("div",{class:"fullscreen-widget",ref:t=>{this._fullscreenElement=t}}))}async componentDidUpdate(){await this._initFullscreenWidget()}async componentDidLoad(){await this._initFullscreenWidget()}async _initModules(){const[t,i]=await h(["esri/widgets/Fullscreen","esri/core/reactiveUtils"]);this.Fullscreen=t,this.reactiveUtils=i}async _initFullscreenWidget(){this.mapView&&this._fullscreenElement&&!this.fullscreenWidget?(this.fullscreenWidget=new this.Fullscreen({view:this.mapView}),await this.fullscreenWidget.when((()=>{this._fullscreenStateChangeHandle&&this._fullscreenStateChangeHandle.remove(),this._fullscreenStateChangeHandle=this.reactiveUtils.watch((()=>this.fullscreenWidget.viewModel.state),(t=>this.fullscreenStateChange.emit(t)))}))):this.fullscreenWidget&&(this.fullscreenWidget.view=this.mapView)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};l.style=":host{display:block}";const c=class{constructor(i){t(this,i),this.mapView=void 0,this.legendWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initLegend(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return i(s,null,i("div",{ref:t=>{this._legendElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t]=await h(["esri/widgets/Legend"]);this.Legend=t}_initLegend(t){t&&this.Legend&&(this.legendWidget?this.legendWidget.view=t:this.legendWidget=new this.Legend({container:this._legendElement,view:t}))}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};c.style=":host{display:block}";const d=class{constructor(i){t(this,i),this.mapInfoChange=a(this,"mapInfoChange",7),this._loadedId="",this.mapInfos=[],this._mapListExpanded=!1,this._translations=void 0,this._webMapInfo=void 0}_webMapInfoWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&(this._loadedId=null==t?void 0:t.id,this.mapInfoChange.emit(t))}async mapInfosWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._webMapSelected(t[0])}async setMapByID(t){var i;const s=null===(i=this.mapInfos)||void 0===i?void 0:i.filter((i=>i.id===t));t&&(null==s?void 0:s.length)>0&&this._webMapSelected(s[0])}async componentWillLoad(){await this._getTranslations()}render(){return i(s,null,this._getToolbar(),this._getMapNameList(this._mapListExpanded))}async componentDidLoad(){const t=this.mapInfos&&this.mapInfos.length>0?this.mapInfos[0]:void 0;t&&this._webMapSelected(t)}_getMapPicker(){var t;const s="map-picker-expand-toggle";return i("div",{class:"width-full"},i("calcite-button",{alignment:"icon-end-space-between",appearance:"transparent",class:"width-full height-full",iconEnd:this._mapListExpanded?"chevron-up":"chevron-down",id:s,kind:"neutral",onClick:()=>this._chooseMap(),width:"full"},null===(t=this._webMapInfo)||void 0===t?void 0:t.name),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":s},i("span",null,this._translations.switchMap)))}_getToolbar(){return i("div",{class:"display-flex"},i("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getMapPicker()))}_getMapNameList(t){return i("div",{class:t?"map-list":"display-none"},i("calcite-list",{id:"mapList",ref:t=>this._list=t,selectionAppearance:"border",selectionMode:"single"},this.mapInfos.map((t=>i("calcite-list-item",{label:t.name,onClick:()=>this._webMapSelected(t),selected:t.id===this._loadedId,value:t.id})))))}_webMapSelected(t){this._mapListExpanded=!1,this._webMapInfo=t}_chooseMap(){this._mapListExpanded=!this._mapListExpanded}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{_webMapInfo:["_webMapInfoWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};d.style=":host{display:block;--solutions-theme-foreground-color:var(--calcite-ui-foreground-1)}.width-full{width:100%}.height-full{height:100%}.display-flex{display:flex}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:51px;width:100%}.map-list{position:absolute;display:flex;flex-direction:column;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-ui-background);z-index:1000;width:100%;height:-moz-fit-content;height:fit-content}.display-none{display:none}.align-center{align-items:center}";const p=class{constructor(i){t(this,i),this.mapView=void 0,this.popupEnabled=!1,this.resultGraphicEnabled=!1,this.searchConfiguration=void 0,this.searchTerm=void 0,this.searchWidget=void 0}async watchSearchConfigurationHandler(){this._initSearchWidget()}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initSearchWidget()}))}async componentWillLoad(){await this._initModules()}async componentDidLoad(){return this._initSearchWidget()}render(){return i(s,null,i("div",{class:"search-widget",ref:t=>{this._searchElement=t}}))}async _initModules(){const[t,i]=await h(["esri/widgets/Search","esri/layers/FeatureLayer"]);this.Search=t,this.FeatureLayer=i}_initSearchWidget(){if(this.mapView&&this._searchElement&&!this.searchWidget){let t={view:this.mapView,container:this._searchElement,searchTerm:this.searchTerm};if(this.searchConfiguration){const i=this._getSearchConfig(this.searchConfiguration,this.mapView);t=Object.assign({},i)}this.searchWidget=new this.Search(t),this.searchWidget.popupEnabled=this.popupEnabled,this.searchWidget.resultGraphicEnabled=this.resultGraphicEnabled}else this.searchWidget&&(this.searchWidget.view=this.mapView)}_getSearchConfig(t,i){const s=t.sources;return(null==s?void 0:s.length)>0?(t.includeDefaultSources=!1,s.forEach((t=>{var s,e;if(t.hasOwnProperty("layer")){const a=t,h=null===(s=a.layer)||void 0===s?void 0:s.id,n=h?i.map.findLayerById(h):null,o=null===(e=null==a?void 0:a.layer)||void 0===e?void 0:e.url;n?a.layer=n:o&&(a.layer=new this.FeatureLayer(o))}})),null==s||s.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===(null==i?void 0:i.name)&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t=Object.assign(Object.assign({},t),{includeDefaultSources:!0}),t}static get watchers(){return{searchConfiguration:["watchSearchConfigurationHandler"],mapView:["mapViewWatchHandler"]}}};p.style=":host{display:block}.search-widget{width:100% !important;border:1px solid var(--calcite-ui-border-input)}";const u=class{constructor(i){t(this,i),this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSearch=void 0,this.enableBasemap=void 0,this.basemapConfig=void 0,this.layout="vertical",this.mapView=void 0,this.searchConfiguration=void 0,this._hasFloorInfo=!1,this._translations=void 0,this._showTools=!0,this._showBasemapWidget=!1,this._showFloorFilter=!1,this._showFullscreen=!1,this._showLegendWidget=!1,this._showSearchWidget=!1}async mapViewWatchHandler(){await this.mapView.when((()=>{var t,i;this._hasFloorInfo=null===(i=null===(t=this.mapView)||void 0===t?void 0:t.map)||void 0===i?void 0:i.floorInfo}))}async _showBasemapWidgetWatchHandler(t){t?this.mapView.ui.add(this._basemapElement.basemapWidget,{position:"top-right",index:1}):this.mapView.ui.remove(this._basemapElement.basemapWidget)}async _showFloorFilterWatchHandler(t){const i=this._floorFilterElement.floorFilterWidget;t?this.mapView.ui.add(i,{position:"top-right",index:1}):this.mapView.ui.remove(i)}async _showFullscreenWatchHandler(t){const i=this._fullscreenElement.fullscreenWidget;t?"ready"===i.viewModel.state&&i.viewModel.enter():"active"===i.viewModel.state&&i.viewModel.exit()}async _showLegendWidgetWatchHandler(t){t?this.mapView.ui.add(this._legendElement.legendWidget,{position:"top-right",index:1}):this.mapView.ui.remove(this._legendElement.legendWidget)}async _showSearchWidgetWatchHandler(t){t?this.mapView.ui.add(this._searchElement.searchWidget,{position:"top-right",index:1}):this.mapView.ui.remove(this._searchElement.searchWidget)}async componentWillLoad(){await this._getTranslations()}render(){const t=this._showTools?"":"display-none",e=this._showSearchWidget?"":"display-none",a=this._showBasemapWidget?"":"display-none",h=this._showLegendWidget?"":"display-none",n=this._showFloorFilter?"":"display-none",o=this._showFullscreen?"":"display-none",r=this._showFullscreen?"full-screen-exit":"full-screen",l=this._showFullscreen?this._translations.exitFullscreen:this._translations.enterFullscreen;return i(s,null,i("div",{class:this.enableBasemap||this.enableFullscreen||this.enableLegend||this.enableSearch?"":"display-none"},i("div",{class:"box-shadow"},this._getActionGroup(this._showTools?"chevrons-up":"chevrons-down",!1,this._showTools?this._translations.collapse:this._translations.expand,(()=>this._toggleTools()))),i("div",{class:`margin-top-1-2 box-shadow ${t}`},this.enableLegend?this._getActionGroup("legend",!1,this._translations.legend,(()=>this._showLegend())):void 0,this.enableSearch?this._getActionGroup("magnifying-glass",!1,this._translations.search,(()=>this._search())):void 0,this.enableFullscreen?this._getActionGroup(r,!1,l,(()=>this._expand())):void 0,this.enableBasemap?this._getActionGroup("basemap",!1,this._translations.basemap,(()=>this._toggleBasemapPicker())):void 0,this.enableFloorFilter&&this._hasFloorInfo?this._getActionGroup("urban-model",!1,this._translations.floorFilter,(()=>this._toggleFloorFilter())):void 0)),i("basemap-gallery",{basemapConfig:this.basemapConfig,class:a,mapView:this.mapView,ref:t=>{this._basemapElement=t}}),i("map-search",{class:e,mapView:this.mapView,ref:t=>{this._searchElement=t},resultGraphicEnabled:!0,searchConfiguration:this.searchConfiguration}),i("map-legend",{class:h,mapView:this.mapView,ref:t=>{this._legendElement=t}}),i("map-fullscreen",{class:o,mapView:this.mapView,onFullscreenStateChange:t=>this._fullscreenStateChange(t.detail),ref:t=>{this._fullscreenElement=t}}),i("floor-filter",{class:n,enabled:this.enableFloorFilter,mapView:this.mapView,ref:t=>{this._floorFilterElement=t}}))}_fullscreenStateChange(t){"ready"===t&&this._showFullscreen?this._showFullscreen=!1:"active"!==t||this._showFullscreen||(this._showFullscreen=!0)}_getActionGroup(t,s,e,a){return i("div",{class:"border-bottom"},i("calcite-action",{alignment:"center",class:"square-40",compact:!1,disabled:s,icon:t,id:t,onClick:a,scale:"s",text:""},i("calcite-icon",{icon:"cheveron-up",scale:"s",slot:"icon"})),i("calcite-tooltip",{label:"",placement:"trailing","reference-element":t},i("span",null,e)))}_showLegend(){this._showLegendWidget=!this._showLegendWidget,this._showTools=!1}_search(){this._showSearchWidget=!this._showSearchWidget,this._showTools=!1}_toggleBasemapPicker(){this._showBasemapWidget=!this._showBasemapWidget,this._showTools=!1}_toggleFloorFilter(){this._showFloorFilter=!this._showFloorFilter,this._showTools=!1}_expand(){this._showFullscreen=!this._showFullscreen}_toggleTools(){this._showTools||(this._showBasemapWidget=!1,this._showSearchWidget=!1,this._showLegendWidget=!1,this._showFloorFilter=!1),this._showTools=!this._showTools}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],_showBasemapWidget:["_showBasemapWidgetWatchHandler"],_showFloorFilter:["_showFloorFilterWatchHandler"],_showFullscreen:["_showFullscreenWatchHandler"],_showLegendWidget:["_showLegendWidgetWatchHandler"],_showSearchWidget:["_showSearchWidgetWatchHandler"]}}};u.style=":host{display:block}.display-none{display:none}.margin-top-1-2{margin-top:0.5rem}.square-40{width:40px;height:40px}.width-40{width:40px}.square-40-41{width:40px;height:41px}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-3)}.box-shadow{box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}";export{o as basemap_gallery,r as floor_filter,l as map_fullscreen,c as map_legend,d as map_picker,p as map_search,u as map_tools}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,h as i,H as s,g as e,c as h}from"./p-78780f63.js";import{g as a}from"./p-6b943f52.js";import{q as o,a as l,g as n,b as d,c as r}from"./p-b7e2c75b.js";import{l as c}from"./p-48ff9cea.js";import{d as p}from"./p-d6050d57.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-4af32c75.js";import"./p-d89fff3a.js";import"./p-a230b270.js";import"./p-220ec0d1.js";const u=class{constructor(i){t(this,i),this.layer=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._cardLoading=!1,this._graphics=void 0,this._translations=void 0}async featureSelectionChange(t){const i=t.detail;this._cardLoading=!0;const s=i.length>0?await o(i,this.layer,[],!1,this.mapView.spatialReference):[];this._graphics=s.sort(((t,s)=>i.indexOf(t.getObjectId())-i.indexOf(s.getObjectId()))),this._cardLoading=!1}async layerSelectionChange(t){const i=t.detail[0];this.layer=await l(this.mapView,i)}async componentWillLoad(){await this._getTranslations()}render(){var t,e;const h=(null===(t=this._graphics)||void 0===t?void 0:t.length)>0?"":"display-none",a=(null===(e=this._graphics)||void 0===e?void 0:e.length)>0?"display-none":"";return i(s,null,i("div",{class:"overflow-auto height-full"},i("calcite-shell",{class:"position-relative "+h},i("div",null,i("info-card",{graphics:this._graphics,isLoading:this._cardLoading,mapView:this.mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))),i("calcite-shell",{class:"position-relative "+a},i("div",{class:"padding-1"},i("calcite-notice",{icon:"table",open:!0},i("div",{slot:"message"},this._translations.selectFeaturesToStart))))))}async _getTranslations(){const t=await a(this.el);this._translations=t[0]}get el(){return e(this)}};u.style=":host{display:block !important}.display-flex{display:flex}.display-none{display:none}.w-100{width:100%}.padding-bottom-1{padding-bottom:1rem}.padding-1{padding:1rem}.position-relative{position:relative}.focus-margin{margin:1px 1px 0px 1px}.overflow-auto{overflow:auto}.height-full{height:100%}card-manager{display:block}";const v=class{constructor(i){t(this,i),this.featureSelectionChange=h(this,"featureSelectionChange",7),this.openFilterOptions=h(this,"openFilterOptions",7),this._allIds=[],this._defaultGlobalIdHonored=!1,this._defaultOidHonored=!1,this._tableSorting=!1,this.onTableNodeCreate=t=>{this._tableNode=t},this.defaultLayerId=void 0,this.defaultGlobalId=void 0,this.defaultOid=void 0,this.enableAutoRefresh=void 0,this.enableColumnReorder=!0,this.enableCSV=void 0,this.enableInlineEdit=void 0,this.enableShare=void 0,this.enableZoom=void 0,this.mapInfo=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.showNewestFirst=void 0,this.zoomAndScrollToSelected=void 0,this._confirmDelete=!1,this._controlsThatFit=void 0,this._fetchingData=!1,this._isDeleting=!1,this._layer=void 0,this._selectedIndexes=[],this._showHideOpen=!1,this._showOnlySelected=!1,this._sortActive=!1,this._translations=void 0}enableZoomWatchHandler(){var t;(null===(t=this._toolInfos)||void 0===t?void 0:t.length)>0&&this._initToolInfos()}enableCSVWatchHandler(){var t;(null===(t=this._toolInfos)||void 0===t?void 0:t.length)>0&&this._initToolInfos()}enableInlineEditWatchHandler(){this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit)}_controlsThatFitWatchHandler(){const t=this._controlsThatFit?this._controlsThatFit.reduce(((t,i)=>(t.push(i.id),t)),[]):[];this._toolInfos=this._toolInfos.map((i=>{if(i&&this._controlsThatFit){const s=this._getId(i.icon);return i.isOverflow=t.indexOf(s)<0,i}}))}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._updateShareUrl(),this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",(t=>{this._mapClicked(t)})))}async _layerWatchHandler(){this._fetchingData=!0,await this._resetTable(),this._updateShareUrl(),this._fetchingData=!1}async _selectedIndexesWatchHandler(){this._updateShareUrl(),this._validateEnabledActions()}async _sortActiveWatchHandler(){this._sortActive||await this._sortTable()}async selectionChanged(t){if(this.zoomAndScrollToSelected){const i=t.detail,s=i.getObjectId(),e=this._table.viewModel.getObjectIdIndex(s);this._table.scrollToIndex(e);const h=i.layer;let a;this.mapView.allLayerViews.toArray().some((t=>{if(t.layer.title===h.title&&"feature"===t.layer.type)return a=t,!0})),a&&await n([s],a,this.mapView,!0)}}async editsComplete(){await this._refresh()}noLayersFound(){this._layer=void 0,this._allIds=[],this._clearSelection()}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initToolInfos(),this._resizeObserver=new ResizeObserver((()=>this._onResize()))}render(){const t=this._fetchingData?"display-none":"",e=this._fetchingData?"":"display-none",h=this._allIds.length.toString(),a=this._selectedIndexes.length.toString();return i(s,null,i("calcite-shell",null,this._getTableControlRow("header"),i("div",{class:"height-full-adjusted width-full"},i("calcite-panel",{class:"height-full width-full"},i("calcite-loader",{class:e,label:this._translations.fetchingData,scale:"l"}),i("div",{class:t,ref:this.onTableNodeCreate})),i("div",{class:"bottom-left text-color height-19"},this._translations.recordsSelected.replace("{{total}}",h).replace("{{selected}}",a)))),this._deleteMessage())}async componentDidLoad(){this._resizeObserver.observe(this._toolbar),document.onclick=t=>this._handleDocumentClick(t)}componentDidRender(){this._updateToolbar()}async _initModules(){const[t,i]=await c(["esri/widgets/FeatureTable","esri/core/reactiveUtils"]);this.FeatureTable=t,this.reactiveUtils=i}_onResize(){this._updateToolbar()}_getTableControlRow(t){return i("div",{class:"display-flex border-bottom height-51",ref:t=>this._toolbar=t,slot:t},this._getActionBar(),this._getDropdown("more-table-options"),this.enableShare?this._getShare("share"):void 0)}_getActionBar(){return i("calcite-action-bar",{expandDisabled:!0,expanded:!0,id:this._getId("bar"),layout:"horizontal"},i("div",{class:"border-end",id:"solutions-map-layer-picker-container"},i("map-layer-picker",{appearance:"transparent",defaultLayerId:this.defaultLayerId,mapView:this.mapView,onLayerSelectionChange:t=>this._layerSelectionChanged(t),onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,placeholderIcon:"layers",scale:"l",showTables:!0,type:"dropdown"})),this._getActions())}_getActions(){return this._getActionItems().reduce(((t,s)=>(s&&!s.isOverflow&&t.push(s.isDanger?this._getDangerAction(s.icon,s.label,s.func,s.disabled):s.isSublist?i("calcite-dropdown",{closeOnSelectDisabled:!0,id:this._getId(s.icon),onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:t=>this._showHideDropdown=t},this._getAction(this._showHideOpen?"chevron-down":s.icon,s.label,s.func,s.disabled,"trigger"),this._showHideOpen?this._getFieldlist():void 0):this._getAction(s.icon,s.label,s.func,s.disabled)),t)),[])}_getFieldlist(){return this._columnsInfo?i("calcite-dropdown-group",{"selection-mode":"multiple"},Object.keys(this._columnsInfo).map((t=>i("calcite-dropdown-item",{id:t,onClick:t=>{const i=t.target;this._columnsInfo[i.id]=i.selected,i.selected?this._table.showColumn(i.id):this._table.hideColumn(i.id)},selected:this._columnsInfo[t]},t)))):void 0}_validateEnabledActions(){const t=this._featuresSelected(),i=["zoom-to-object","trash","erase","selected-items-filter"];this._toolInfos.forEach((s=>{s&&i.indexOf(s.icon)>-1&&(s.disabled=!t)}))}_initToolInfos(){var t;const i=this._featuresSelected(),s=this._featuresEmpty();this._toolInfos=[this.enableZoom?{icon:"zoom-to-object",label:this._translations.zoom,func:()=>this._zoom(),disabled:!i,isOverflow:!1}:void 0,(null===(t=this.mapInfo)||void 0===t?void 0:t.filters)?{icon:"filter",label:this._translations.filters,func:()=>this._filter(),disabled:!1,isOverflow:!1}:void 0,this._deleteEnabled?{icon:"trash",label:this._translations.delete,func:()=>this._delete(),disabled:!i,isDanger:!0,isOverflow:!1}:void 0,{icon:"erase",label:this._translations.clearSelection,func:()=>this._clearSelection(),disabled:!i,isOverflow:!1},{icon:"selected-items-filter",label:this._showOnlySelected?this._translations.showAll:this._translations.showSelected,func:()=>this._toggleShowSelected(),disabled:!i,isOverflow:!1},{icon:"list-check-all",func:()=>this._selectAll(),label:this._translations.selectAll,disabled:s,isOverflow:!1},{icon:"compare",func:()=>this._switchSelected(),label:this._translations.switchSelected,disabled:s,isOverflow:!1},{icon:"refresh",func:()=>this._refresh(),label:this._translations.refresh,disabled:!1,isOverflow:!1},this.enableCSV?{icon:"export",func:()=>{this._exportToCSV()},label:this._translations.exportCSV,disabled:s,isOverflow:!1}:void 0,{icon:this._showHideOpen?"chevron-down":"chevron-right",func:()=>this._toggleShowHide(),label:this._translations.showHideColumns,disabled:!1,isOverflow:!1,isSublist:!0}],this._defaultVisibleToolSizeInfos=void 0}_featuresSelected(){return this._selectedIndexes.length>0}_featuresEmpty(){return 0===this._allIds.length}_updateToolbar(){this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout((()=>{clearTimeout(this._timeout),this._setToolbarSizeInfos();const t=this._toolbar.offsetWidth;let i=this._toolbarSizeInfos.reduce(((t,i)=>t+i.width),0);const s=["solutions-more","solutions-map-layer-picker-container","solutions-action-share"];if(i>t){if(this._toolbarSizeInfos.length>0){const e=[...this._toolbarSizeInfos].reverse().reduce(((e,h)=>(s.indexOf(h.id)<0&&(i>t?i-=h.width:e.push(h)),e)),[]).reverse();this._setControlsThatFit(e,s)}}else if(this._defaultVisibleToolSizeInfos){const e=this._toolbarSizeInfos.reduce(((t,i)=>(t.push(i.id),t)),[]);let h=!1;const a=[...this._defaultVisibleToolSizeInfos].reduce(((a,o)=>(!h&&s.indexOf(o.id)<0&&(e.indexOf(o.id)>-1||i+o.width<=t)?(e.indexOf(o.id)<0&&(i+=o.width),a.push(o)):s.indexOf(o.id)<0&&i+o.width>t&&(h=!0),a)),[]);this._setControlsThatFit(a,s)}}),5)}_setControlsThatFit(t,i){let s=JSON.stringify(t)!==JSON.stringify(this._controlsThatFit);document.getElementById("solutions-action-bar").childNodes.forEach((t=>{i.indexOf(t.id)<0&&!s&&(s=this._controlsThatFit.map((t=>t.id)).indexOf(t.id)<0)})),s&&(this._controlsThatFit=[...t])}_setToolbarSizeInfos(){let t=!1;this._toolbarSizeInfos=[],this._toolbar.childNodes.forEach(((i,s)=>{0===s?i.childNodes.forEach((i=>{this._toolbarSizeInfos.push({id:i.id,width:i.offsetWidth}),t||(t=i.offsetWidth>0)})):i.referenceElement||(this._toolbarSizeInfos.push({id:i.id,width:i.offsetWidth}),t||(t=i.offsetWidth>0))})),t&&!this._defaultVisibleToolSizeInfos&&(this._defaultVisibleToolSizeInfos=[...this._toolbarSizeInfos])}_getActionItems(){return this._toolInfos.filter((t=>t&&!t.isOverflow))}_getDropdown(t){const s=this._getDropdownItems();return s.length>0?i("calcite-dropdown",{closeOnSelectDisabled:!0,disabled:void 0===this._layer,id:"solutions-more",onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:t=>this._moreDropdown=t},i("calcite-action",{appearance:"solid",id:t,label:"",onClick:()=>this._closeShowHide(),slot:"trigger",text:""},i("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),i("calcite-dropdown-group",{"selection-mode":"none"},s.map((t=>i("calcite-dropdown-group",{class:t.disabled?"disabled":"",selectionMode:t.disabled?"none":"single"},i("calcite-dropdown-item",{iconStart:t.isSublist&&this._showHideOpen?"chevron-down":t.icon,id:"solutions-subset-list",onClick:t.func},t.label))))),this._showHideOpen?this._getFieldlist():void 0):void 0}_getDropdownItems(){return this._toolInfos.filter((t=>t&&t.isOverflow))}_getAction(t,s,e,h,a){const o=void 0===this._layer||h;return i("div",{class:"display-flex",id:this._getId(t),slot:a},i("calcite-action",{appearance:"solid",disabled:o,icon:t,id:t,label:s,onClick:e,text:s,textEnabled:!0}),this._getToolTip("bottom",t,s))}_getShare(t){return i("div",{class:"share-action",id:this._getId(t)},i("instant-apps-social-share",{autoUpdateShareUrl:!1,class:"instant-app-share",popoverButtonIconScale:"s",ref:t=>this._shareNode=t,scale:"m",shareButtonColor:"neutral",socialMedia:!0,view:this.mapView}),this._getToolTip("bottom",t,this._translations.share))}_updateShareUrl(){var t,i,s,e;const h=null===(t=this._shareNode)||void 0===t?void 0:t.shareUrl;if(!h)return;const a=new URL(h);(null===(i=this.mapInfo)||void 0===i?void 0:i.id)&&a.searchParams.set("webmap",this.mapInfo.id),(null===(s=this._layer)||void 0===s?void 0:s.id)&&a.searchParams.set("layer",this._layer.id),(null===(e=this._selectedIndexes)||void 0===e?void 0:e.length)>0&&a.searchParams.set("oid",this._selectedIndexes.join(",")),this._shareNode.shareUrl=a.href}_getToolTip(t,s,e){return i("calcite-tooltip",{placement:t,"reference-element":s},i("span",null,e))}_getId(t){return`solutions-action-${t}`}_getDangerAction(t,s,e,h){const a=void 0===this._layer||h;return i("div",{class:"display-flex",id:this._getId(t)},i("calcite-action",{appearance:"solid",disabled:a,id:t,onClick:e,text:""},i("calcite-button",{appearance:"transparent",iconStart:t,kind:"danger"},s)),this._getToolTip("bottom",t,s))}async _getTable(t,i){this._layer&&(await this._layer.when((()=>{this._table=new this.FeatureTable({autoRefreshEnabled:this.enableAutoRefresh,layer:this._layer,view:this.mapView,columnReorderingEnabled:this.enableColumnReorder,editingEnabled:this._editEnabled&&this.enableInlineEdit,highlightEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},tableTemplate:{columnTemplates:i},container:t})})),this._initColumnsInfo(),this._checkEditEnabled(),await this._table.when((()=>{this._table.highlightIds.on("change",(()=>{this._selectedIndexes=this._table.highlightIds.toArray().reverse(),this._showOnlySelected&&(this._featuresSelected()?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this._selectedIndexes)})),this.reactiveUtils.watch((()=>this._table.activeSortOrders),(t=>{var i,s,e,h;this._sortActive=!!this._layer&&(t.length>0&&"asc"===(null===(i=t[0])||void 0===i?void 0:i.direction)||"desc"===(null===(s=t[0])||void 0===s?void 0:s.direction)||null===(null===(e=t[0])||void 0===e?void 0:e.direction)&&(null===(h=t[0])||void 0===h?void 0:h.fieldName)===this._layer.objectIdField)}))})))}async _resetTable(){var t;this._clearSelection(),this._allIds=[],this.featureSelectionChange.emit(this._selectedIndexes);const i=this._getColumnTemplates(this._layer.id,null===(t=this._layer)||void 0===t?void 0:t.fields);this._allIds=await d(this._layer),this._table?i&&(this._table.tableTemplate.columnTemplates=i):await this._getTable(this._tableNode,i),this._table.layer=this._layer,this._table.view=this.mapView,this._checkEditEnabled(),this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit,this._initToolInfos(),await this._table.when((async()=>{var t,i;if(this._table.highlightIds.removeAll(),this._table.clearSelectionFilter(),this._initColumnsInfo(),!this._defaultOidHonored&&(null===(t=this.defaultOid)||void 0===t?void 0:t.length)>0&&this.defaultOid[0]>-1&&(this._selectDefaultFeature(this.defaultOid),this._defaultOidHonored=!0),!this._defaultGlobalIdHonored&&(null===(i=this.defaultGlobalId)||void 0===i?void 0:i.length)>0){const t=await r(this.defaultGlobalId,this._layer),i=(null==t?void 0:t.length)>0?t.map((t=>t.getObjectId())):void 0;i&&this._selectDefaultFeature(i),this._defaultGlobalIdHonored=!0}})),this._showOnlySelected=!1,this._sortActive=!1,await this._sortTable()}_initColumnsInfo(){this._columnsInfo=this._table.columns.reduce(((t,i)=>(t[i.name]=!i.hidden,t)),{})}_selectDefaultFeature(t){t.length>0&&(this._table.highlightIds.addMany(t),this._table.when((()=>{const i=this._table.viewModel.getObjectIdIndex(t[0]);this._table.viewModel.scrollToIndex(i)})))}_checkEditEnabled(){this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._deleteEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsDelete}async _sortTable(){this._table&&this._layer&&!this._sortActive&&!this._tableSorting&&this.showNewestFirst&&(this._tableSorting=!0,await this._table.when(),await this._layer.when((()=>{this._table.sortColumn(this._layer.objectIdField,"desc"),this._tableSorting=!1})))}_forceShowHide(){this._showHideDropdown&&(this._showHideDropdown.open=this._showHideOpen),this._moreDropdown&&(this._moreDropdown.open=this._showHideOpen)}_toggleShowHide(){this._showHideOpen=!this._showHideOpen}_closeShowHide(){this._showHideOpen=!1}_handleDocumentClick(t){var i;const s=null===(i=t.target)||void 0===i?void 0:i.id;this._showHideOpen&&Object.keys(this._columnsInfo).indexOf(s)<0&&"solutions-subset-list"!==s&&"chevron-right"!==s&&(this._closeShowHide(),this._moreDropdown&&(this._moreDropdown.open=!1),this._showHideDropdown&&(this._showHideDropdown.open=!1))}_deleteMessage(){return i("calcite-modal",{"aria-labelledby":"modal-title",kind:"danger",onCalciteModalClose:()=>this._deleteClosed(),open:this._confirmDelete},i("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},this._translations.deleteFeature),i("div",{slot:"content"},this._translations.confirm),i("calcite-button",{appearance:"outline",kind:"danger",onClick:()=>this._deleteClosed(),slot:"secondary",width:"full"},this._translations.cancel),i("calcite-button",{kind:"danger",loading:this._isDeleting,onClick:()=>{this._deleteFeatures()},slot:"primary",width:"full"},this._translations.delete))}async _deleteFeatures(){this._isDeleting=!0;const t=this._table.highlightIds.toArray().map((t=>({objectId:t})));await this._layer.applyEdits({deleteFeatures:t}),await this._table.refresh(),this._allIds=await d(this._layer),this._isDeleting=!1,this._deleteClosed()}async _mapClicked(t){const i={include:this._layer},s=await this.mapView.hitTest(t.screenPoint,i);s.results.length>0&&(s.results.forEach((t=>{this._clearSelection();const i=t.graphic.getObjectId(),s=this._table.highlightIds.indexOf(i);s>-1?this._table.highlightIds.removeAt(s):this._table.highlightIds.add(i)})),this._showOnlySelected&&this._table.filterBySelection())}_deleteClosed(){this._confirmDelete=!1}_selectAll(){const t=this._allIds;this._table.highlightIds.removeAll(),this._table.highlightIds.addMany(t),this._selectedIndexes=t}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._showOnlySelected?this._table.filterBySelection():this._table.clearSelectionFilter()}_clearSelection(){var t;this._selectedIndexes=[],null===(t=this._table)||void 0===t||t.highlightIds.removeAll()}_filter(){this.openFilterOptions.emit()}_switchSelected(){const t=[...this._selectedIndexes];this._table.highlightIds.removeAll();const i=this._allIds.reduce(((i,s)=>(t.indexOf(s)<0&&i.push(s),i)),[]).sort(((t,i)=>t-i));this._table.highlightIds.addMany(i),this._selectedIndexes=i}async _exportToCSV(){const t={},i=this._table.highlightIds.toArray();t[this._layer.id]={selectionSetNames:[this._layer.title],ids:i,layer:this._layer},p(null,t,!1,!1,!0)}async _refresh(){await this._table.refresh(),this.featureSelectionChange.emit(this._selectedIndexes)}_zoom(){this._table.zoomToSelection()}_delete(){this._confirmDelete=!0}async _layerSelectionChanged(t){var i;const s=t.detail[0];if(s!==(null===(i=this._layer)||void 0===i?void 0:i.id)||this._featuresEmpty()){this._fetchingData=!0;const t=await l(this.mapView,s);await t.when((()=>{this._layer=t}))}this._fetchingData=!1}_getColumnTemplates(t,i){var s;let e;null===(s=this.mapInfo.layerInfos)||void 0===s||s.some((i=>{if(i.id===t)return e=i,!0}));let h=null==e?void 0:e.columnTemplates;return i&&(h=h?h.map((t=>(i.some((i=>{if(i.name===t.fieldName)return t.label=i.alias,!0})),t))):i.map((t=>({type:"field",fieldName:t.name,label:t.alias})))),h}async _getTranslations(){const t=await a(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{enableZoom:["enableZoomWatchHandler"],enableCSV:["enableCSVWatchHandler"],enableInlineEdit:["enableInlineEditWatchHandler"],_controlsThatFit:["_controlsThatFitWatchHandler"],mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"],_selectedIndexes:["_selectedIndexesWatchHandler"],_sortActive:["_sortActiveWatchHandler"]}}};v.style=':host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.border-end{border-inline-end:1px solid var(--calcite-ui-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.height-50-px{height:50px}.bottom-left{position:absolute;left:0;bottom:0;padding-left:5px}html[dir="rtl"] .bottom-left{position:absolute;right:0;bottom:0;padding-right:5px}.height-19{height:19px}.background{background-color:var(--calcite-ui-background)}.text-color{color:var(--calcite-ui-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-ui-danger)}.esri-feature-table vaadin-grid{border:none !important}vaadin-grid-cell-content{padding:var(--lumo-space-xs) var(--lumo-space-m) !important;font-size:14px !important}.share-action{position:absolute;right:0;margin-top:4px;margin-inline-end:4px;margin-bottom:4px}html[dir="rtl"] .share-action{left:0}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled);pointer-events:none}.instant-app-share{height:42px !important;display:inline-flex}';const b=class{constructor(i){t(this,i),this.mapChanged=h(this,"mapChanged",7),this.beforeMapChanged=h(this,"beforeMapChanged",7),this._defaultWebmapHonored=!1,this._loadedId="",this.defaultWebmapId="",this.enableHome=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSearch=void 0,this.enableBasemap=void 0,this.basemapConfig=void 0,this.hidden=void 0,this.mapInfos=[],this.mapView=void 0,this.theme=void 0,this._searchConfiguration=void 0,this._webMapInfo=void 0}enableHomeWatchHandler(){this._initHome()}async mapInfoChange(t){await this._loadMap(t.detail)}async componentWillLoad(){await this._initModules()}render(){const t=this.hidden?"visibility-hidden":"",e="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light";return i(s,null,i("map-picker",{mapInfos:this.mapInfos,ref:t=>this._mapPicker=t}),i("div",{class:`map-height ${t}`,ref:t=>this._mapDiv=t}),i("map-tools",{basemapConfig:this.basemapConfig,class:`box-shadow ${e}`,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableLegend:this.enableLegend,enableSearch:this.enableSearch,mapView:this.mapView,ref:t=>this._mapTools=t,searchConfiguration:this._searchConfiguration}))}async _initModules(){const[t,i,s]=await c(["esri/WebMap","esri/views/MapView","esri/widgets/Home"]);this.WebMap=t,this.MapView=i,this.Home=s}async _loadMap(t){var i;const s=!this._defaultWebmapHonored&&this.defaultWebmapId,e=null===(i=this.mapInfos)||void 0===i?void 0:i.filter((t=>t.id===this.defaultWebmapId));this._webMapInfo=s&&e?e[0]:!(null==t?void 0:t.id)&&this.mapInfos.length>0?this.mapInfos[0]:t;const h=this._webMapInfo.id,a=s&&(null==t?void 0:t.id)===this.defaultWebmapId;if(this._loadedId!==h&&!s||a){const t=new this.WebMap({portalItem:{id:h}});this.mapView=new this.MapView({container:this._mapDiv,map:t,resizeAlign:"center"}),this._loadedId=h,this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),await this.mapView.when((()=>{this._initHome(),this.mapView.ui.add(this._mapTools,{position:"top-right",index:0}),this._defaultWebmapHonored=!!a||this._defaultWebmapHonored,this.mapChanged.emit({id:h,mapView:this.mapView})}))}else s&&(this._defaultWebmapHonored=!0,this._mapPicker.setMapByID(h))}_initHome(){this.enableHome?(this._homeWidget=new this.Home({view:this.mapView}),this.mapView.ui.add(this._homeWidget,{position:"top-left",index:3})):this._homeWidget&&this.mapView.ui.remove(this._homeWidget)}get el(){return e(this)}static get watchers(){return{enableHome:["enableHomeWatchHandler"]}}};b.style=":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 51px)}.box-shadow{box-shadow:none !important}.visibility-hidden{visibility:hidden}";export{u as card_manager,v as layer_table,b as map_card}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,h as i,H as e,g as s}from"./p-78780f63.js";import{g as h}from"./p-6b943f52.js";import{E as l}from"./p-4af32c75.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const a=class{constructor(i){t(this,i),this._shouldSetMapView=!1,this.classicGrid=!1,this.defaultCenter="",this.defaultGlobalId="",this.defaultLayer="",this.defaultLevel="",this.defaultOid="",this.defaultWebmap="",this.enableAutoRefresh=!1,this.enableColumnReorder=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableInlineEdit=!1,this.enableLegend=!0,this.enableSearch=!0,this.enableShare=!1,this.enableHome=!0,this.enableZoom=!0,this.enableBasemap=!0,this.basemapConfig=void 0,this.showNewestFirst=!0,this.hideMap=!1,this.mapInfos=[],this.onlyShowUpdatableLayers=!0,this.searchConfiguration=void 0,this.theme="light",this.zoomAndScrollToSelected=!1,this._expandPopup=!1,this._translations=void 0,this._layoutMode=l.GRID,this._mapView=void 0,this._panelOpen=!0}defaultCenterWatchHandler(){this._defaultCenter=this.defaultCenter?this.defaultCenter.split(";").map((t=>parseFloat(t))):void 0}defaultGlobalIdWatchHandler(){this._defaultGlobalId=this.defaultGlobalId?this.defaultGlobalId.indexOf(",")>-1?this.defaultGlobalId.split(","):[this.defaultGlobalId]:void 0}defaultOidWatchHandler(){this._defaultOid=this.defaultOid?this.defaultOid.indexOf(",")>-1?this.defaultOid.split(",").map((t=>parseInt(t,10))):[parseInt(this.defaultOid,10)]:void 0}defaultLevelWatchHandler(){this._defaultLevel=this.defaultLevel?parseInt(this.defaultLevel,10):void 0}enableZoomWatchHandler(){this._initMapZoom()}async layoutChanged(t){this._layoutMode=t.detail}async mapChanged(t){this._mapChange=t.detail,await this._mapChange.mapView.when((async()=>{await this._setMapView()}))}async beforeMapChanged(){this._expandPopup&&(this._shouldSetMapView=!0,this._expandPopup=!1)}async componentWillLoad(){await this._getTranslations()}render(){return i(e,null,i("calcite-shell",{class:"position-relative"},i("calcite-panel",{class:"width-full height-full"},this._getBody(this._layoutMode,this._panelOpen,this.hideMap))))}async componentDidRender(){this._shouldSetMapView&&(this._shouldSetMapView=!1,await this._setMapView())}_getDividerIcon(t,i){let e="";switch(t){case l.HORIZONTAL:e=this.classicGrid?i?"chevrons-down":"chevrons-up":i?"chevrons-up":"chevrons-down";break;case l.VERTICAL:e=this.classicGrid?i?"chevrons-right":"chevrons-left":i?"chevrons-left":"chevrons-right";break;case l.GRID:e=this.classicGrid?i?"chevrons-up":"chevrons-down":i?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(t,i){let e="";switch(t){case l.HORIZONTAL:e=(i?"height-1-2":"height-0")+" width-full position-relative";break;case l.GRID:e=this.classicGrid?(i?"position-relative":"position-absolute-53")+" height-full width-full display-flex":"height-full position-relative "+(i?"width-1-3":"width-0");break;case l.VERTICAL:e="height-full position-relative "+(i?"width-1-2":"width-0")}return e}_getTableSizeClass(t,i){let e="";switch(t){case l.HORIZONTAL:e=(i?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case l.GRID:e=this.classicGrid?(i?"height-full":"height-53")+" position-relative width-full display-flex":(i?"width-2-3":"width-full")+" height-full display-flex";break;case l.VERTICAL:e=(i?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(t,e,s){const h=this.classicGrid&&t===l.GRID&&e?"display-grid":t===l.HORIZONTAL?"":"display-flex";return i("calcite-panel",{class:"width-full height-full"},this.classicGrid?i("div",{class:`width-full height-full ${h}`},this._getTable(t,e),this._getMapAndCard(t,e,s)):i("div",{class:`width-full height-full ${h}`},this._getMapAndCard(t,e,s),this._getTable(t,e)))}_getMapAndCard(t,e,s){const h=this._getMapSizeClass(t,e);return this.classicGrid?i("div",{class:`${h} overflow-hidden`},this._getCardNode(),this._getMapNode(t,s)):i("div",{class:`${h} overflow-hidden`},this._getMapNode(t,s),this._getPopupExpandNode())}_getMapNode(t,e){var s;return i("div",{class:`${this.classicGrid&&t===l.GRID?"width-full":"adjusted-height-50"} overflow-hidden ${this.classicGrid&&t===l.GRID?"display-flex height-full width-1-2":t!==l.GRID||e?"display-none":""}`},i("map-card",{basemapConfig:this.basemapConfig,class:"width-full",defaultWebmapId:this.defaultWebmap,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,hidden:this._expandPopup,mapInfos:null===(s=this.mapInfos)||void 0===s?void 0:s.filter((t=>!1!==t.visible)),theme:this.theme}))}_getPopupExpandNode(){const t=this._expandPopup?"chevrons-down":"chevrons-up",e="expand-popup",s=this._expandPopup?this._translations.collapsePopup:this._translations.expandPopup,h="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light";return i("div",{class:"calcite-mode-dark "+(this._expandPopup?"position-absolute-50":"height-full")},i("calcite-panel",null,i("div",{class:"display-flex align-items-center",slot:"header-content"},i("calcite-icon",{icon:"information",scale:"s"}),i("div",{class:"padding-inline-start-75"},this._translations.information)),i("calcite-action",{icon:t,id:e,onClick:()=>this._togglePopup(),slot:"header-actions-end",text:""}),i("calcite-tooltip",{class:h,label:"",placement:"bottom","reference-element":e},i("span",null,s)),this._getCardNode()))}_togglePopup(){this._expandPopup=!this._expandPopup}_getCardNode(){return i("div",{class:"width-50 height-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},i("card-manager",{class:(this._expandPopup?"height-full":"height-50")+" width-full",mapView:null==this?void 0:this._mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))}_getTable(t,e){const s=this._getTableSizeClass(t,e),h=this._getDividerIcon(t,e),a=e?this._translations.close:this._translations.open,o="toggle-layout",d=this.defaultWebmap&&this.defaultLayer;return i("calcite-shell",{class:s+" border-bottom"},i("calcite-action-bar",{class:"border-sides",expandDisabled:!0,layout:t===l.HORIZONTAL||this.classicGrid?"horizontal":"vertical",slot:this.classicGrid&&t!==l.VERTICAL?"footer":this.classicGrid&&t===l.VERTICAL?"panel-end":t===l.HORIZONTAL?"header":"panel-start"},i("calcite-action",{class:"toggle-node",icon:h,id:o,onClick:()=>this._toggleLayout(),text:""}),i("calcite-tooltip",{label:a,placement:"bottom","reference-element":o},i("span",null,a))),i("div",{class:"width-full height-full position-relative"},i("layer-table",{defaultGlobalId:d?this._defaultGlobalId:void 0,defaultLayerId:d?this.defaultLayer:"",defaultOid:d&&!this.defaultGlobalId?this._defaultOid:void 0,enableAutoRefresh:this.enableAutoRefresh,enableCSV:this.enableCSV,enableColumnReorder:this.enableColumnReorder,enableInlineEdit:this.enableInlineEdit,enableShare:this.enableShare,enableZoom:this.enableZoom,mapInfo:this._mapInfo,mapView:null==this?void 0:this._mapView,onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,showNewestFirst:this.showNewestFirst,zoomAndScrollToSelected:this.zoomAndScrollToSelected})))}_toggleLayout(){this._panelOpen=!this._panelOpen}_getMapInfo(t){let i;return this.mapInfos.some((e=>{if(e.id===t)return i=e,!0})),i}async _setMapView(){this._mapInfo=this._getMapInfo(this._mapChange.id),this._mapView=this._mapChange.mapView,this._initMapZoom(),this._mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this._mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0)}_initMapZoom(){this.enableZoom?this.enableZoom&&this._mapView.ui.add({component:"zoom",position:"top-left",index:0}):this._mapView.ui.remove("zoom")}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{defaultCenter:["defaultCenterWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],defaultOid:["defaultOidWatchHandler"],defaultLevel:["defaultLevelWatchHandler"],enableZoom:["enableZoomWatchHandler"]}}};a.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-ui-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-ui-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-3)}.border-sides{border-left:1px solid var(--calcite-ui-border-3);border-right:1px solid var(--calcite-ui-border-3)}.position-relative{position:relative}.height-50{height:50%}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none}.height-53{height:53px}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}";export{a as crowdsource_manager}
|