@esri/solutions-components 0.6.25 → 0.6.26
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/calcite-alert_3.cjs.entry.js +24 -16
- package/dist/cjs/card-manager_3.cjs.entry.js +5 -2
- package/dist/cjs/crowdsource-manager.cjs.entry.js +2 -0
- package/dist/cjs/public-notification.cjs.entry.js +4 -4
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +2 -0
- package/dist/collection/components/edit-card/edit-card.js +24 -16
- package/dist/collection/components/map-card/map-card.js +5 -2
- package/dist/collection/components/public-notification/public-notification.css +0 -9
- package/dist/collection/components/public-notification/public-notification.js +3 -3
- package/dist/collection/demos/crowdsource-manager.html +3 -0
- package/dist/components/crowdsource-manager.js +2 -0
- package/dist/components/edit-card2.js +24 -16
- package/dist/components/map-card2.js +5 -2
- package/dist/components/public-notification.js +4 -4
- package/dist/esm/calcite-alert_3.entry.js +24 -16
- package/dist/esm/card-manager_3.entry.js +5 -2
- package/dist/esm/crowdsource-manager.entry.js +2 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/public-notification.entry.js +4 -4
- package/dist/solutions-components/demos/crowdsource-manager.html +3 -0
- package/dist/solutions-components/p-ce3b40ca.entry.js +6 -0
- package/dist/solutions-components/{p-f5a593f4.entry.js → p-de268445.entry.js} +1 -1
- package/dist/solutions-components/{p-3c4e583c.entry.js → p-e3bf18fc.entry.js} +1 -1
- package/dist/solutions-components/p-e48eb0b2.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/components/edit-card/edit-card.d.ts +12 -0
- package/dist/types/components/map-card/map-card.d.ts +1 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-25729b41.entry.js +0 -6
- package/dist/solutions-components/p-5bd796dd.entry.js +0 -6
@@ -8,4 +8,4 @@ import{r as t,c as i,h as n,H as e,g as s}from"./p-91c78d98.js";import{u as a,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.9.0
|
11
|
-
*/const _={slow:14e3,medium:1e4,fast:6e3},j="container",q=class{constructor(n){t(this,n),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.resizeObserver=y("resize",(t=>this.responsiveContainerWidth=t[0].contentRect.width)),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=a(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,this.responsiveContainerWidth=void 0}openHandler(){g(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(){var t;p(this),v(this),this.open&&!this.queued&&this.calciteInternalAlertRegister.emit(),this.transitionEl&&(null===(t=this.resizeObserver)||void 0===t||t.observe(this.transitionEl))}async componentWillLoad(){c(this);const[,t]=await Promise.all([f(this),k()]);this.breakpoints=t,this.open&&g(this)}componentDidLoad(){var t;h(this),null===(t=this.resizeObserver)||void 0===t||t.observe(this.transitionEl)}disconnectedCallback(){var t;window.dispatchEvent(new CustomEvent("calciteInternalAlertUnregister",{detail:{alert:this.el}})),window.clearTimeout(this.autoCloseTimeoutId),window.clearTimeout(this.queueTimeout),u(this),b(this),this.slottedInShell=!1,null===(t=this.resizeObserver)||void 0===t||t.disconnect()}render(){m.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,signDisplay:"always"};const{hasEndActions:t}=this,{open:i,autoClose:s,responsiveContainerWidth:a,label:l,placement:c,queued:h}=this,d=s?"alert":"alertdialog",p=this.breakpoints.width,u=a<p.small,g=a>=p.small,v=!i,f=r(x,this.icon,this.kind),b=this.queueLength>1;return n(e,{"aria-hidden":o(v),"aria-label":l,"calcite-hydrated-hidden":v,role:d},n("div",{class:{[j]:!0,"container--queued":h,[`${j}--${c}`]:!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},n("div",{class:"content-container"},f&&g?this.renderIcon(f):null,n("div",{class:"content"},f&&u?this.renderIcon(f):null,n("div",{class:"text-container"},n("slot",{name:"title"}),n("slot",{name:"message"}),n("slot",{name:"link"})))),u?this.renderCloseButton():null,n("div",{class:"footer",hidden:!t&&!b},this.renderActionsEnd(),b?this.renderQueueCount():null),g?this.renderCloseButton():null,i&&!h&&s?n("div",{class:"dismiss-progress"}):null))}renderCloseButton(){return n("button",{"aria-label":this.messages.close,class:"close",key:"close",onClick:this.closeAlert,type:"button",ref:t=>this.closeButton=t},n("calcite-icon",{icon:"x",scale:"l"===this.scale?"m":"s"}))}renderQueueCount(){const t=m.numberFormatter.format(this.queueLength>2?this.queueLength-1:1);return n("div",{class:{"queue-count":!0,"queue-count--active":this.queueLength>1},key:"queue-count"},n("calcite-chip",{scale:this.scale,value:t},t))}renderActionsEnd(){return n("div",{class:"actions-end"},n("slot",{name:"actions-end",onSlotchange:this.actionsEndSlotChangeHandler}))}renderIcon(t){return n("div",{class:"icon"},n("calcite-icon",{flipRtl:this.iconFlipRtl,icon:t,scale:"l"===this.scale?"m":"s"}))}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 d(this);const t=l(this.el,{selector:"calcite-link"});if(this.closeButton||t)return t?t.setFocus():void(this.closeButton&&this.closeButton.focus())}effectiveLocaleChange(){w(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 s(this)}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],autoCloseDuration:["updateDuration"],effectiveLocale:["effectiveLocaleChange"]}}};q.style='/**\n * Do not edit directly\n * Generated on Thu, 11 May 2023 18:56:13 GMT\n */\n/* mixins & extensions */\n/* helper to properly scale internal durations */\n/**\n* Currently only used in Checkbox.\n*/\n/**\n* CSS Custom Properties\n*\n* These properties can be overridden using the component\'s tag as selector.\n*\n* @prop --calcite-alert-width: Specifies the width of the component.\n*/\n:host {\n --calcite-alert-edge-distance: 2rem;\n display: block;\n}\n\n.container {\n pointer-events: none;\n position: fixed;\n z-index: var(--calcite-app-z-index-toast);\n margin-inline: auto;\n margin-block: 0px;\n box-sizing: border-box;\n display: flex;\n inline-size: 100%;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n background-color: var(--calcite-ui-foreground-1);\n text-align: start;\n opacity: 0;\n --tw-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);\n --tw-shadow-colored: 0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n container: responsive-container/inline-size;\n border-radius: var(--calcite-border-radius);\n border-block-start: 0 solid transparent;\n border-inline: 1px solid var(--calcite-ui-border-3);\n border-block-end: 1px solid var(--calcite-ui-border-3);\n inline-size: var(--calcite-alert-width);\n max-inline-size: calc(100% - var(--calcite-alert-edge-distance) * 2);\n 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;\n}\n.container--bottom, .container--top {\n inset-inline-end: 0;\n inset-inline-start: 0;\n}\n.container[class*=bottom] {\n transform: translate3d(0, var(--calcite-alert-edge-distance), 0);\n inset-block-end: var(--calcite-alert-edge-distance);\n}\n.container[class*=top] {\n transform: translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), 0);\n inset-block-start: var(--calcite-alert-edge-distance);\n}\n.container[class*=start] {\n inset-inline-start: var(--calcite-alert-edge-distance);\n inset-inline-end: auto;\n}\n.container[class*=end] {\n inset-inline-end: var(--calcite-alert-edge-distance);\n inset-inline-start: auto;\n}\n\n.content {\n box-sizing: border-box;\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n transition: all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;\n padding-block: var(--calcite-alert-spacing-token-small);\n padding-inline: var(--calcite-alert-spacing-token-large) var(--calcite-alert-spacing-token-small);\n}\n\n.icon {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n padding: 0px;\n margin-block-end: var(--calcite-alert-spacing-token-large);\n margin-inline-end: auto;\n}\n\n.close {\n display: flex;\n cursor: pointer;\n align-items: flex-start;\n justify-content: flex-end;\n align-self: flex-start;\n border-style: none;\n background-color: transparent;\n color: var(--calcite-ui-text-3);\n outline: 2px solid transparent;\n outline-offset: 2px;\n -webkit-appearance: none;\n padding: var(--calcite-alert-spacing-token-large);\n outline-color: transparent;\n}\n.close:focus {\n outline: 2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));\n 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 );\n}\n.close:hover, .close:focus {\n background-color: var(--calcite-ui-foreground-2);\n color: var(--calcite-ui-text-1);\n}\n.close:active {\n background-color: var(--calcite-ui-foreground-3);\n}\n\n.queue-count {\n visibility: hidden;\n display: flex;\n cursor: default;\n align-items: center;\n justify-content: space-around;\n align-self: stretch;\n overflow: hidden;\n background-color: var(--calcite-ui-foreground-1);\n text-align: center;\n font-weight: var(--calcite-font-weight-medium);\n color: var(--calcite-ui-text-2);\n opacity: 0;\n transition: all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;\n border-inline: 0 solid transparent;\n border-start-end-radius: 0;\n}\n.queue-count--active {\n visibility: visible;\n opacity: 1;\n}\n\n.dismiss-progress {\n position: absolute;\n display: block;\n inline-size: 100%;\n overflow: hidden;\n inset-inline: 0;\n inset-block-start: -2px;\n block-size: 2px;\n border-radius: var(--calcite-border-radius) var(--calcite-border-radius) 0 0;\n}\n.dismiss-progress:after {\n position: absolute;\n inset-block-start: 0px;\n display: block;\n block-size: 2px;\n content: "";\n background-color: var(--calcite-alert-dismiss-progress-background);\n inset-inline-end: 0;\n}\n\n.actions-end {\n display: flex;\n align-self: stretch;\n}\n\n.text-container {\n display: flex;\n min-inline-size: 0px;\n flex: 1 1 0%;\n flex-direction: column;\n overflow-wrap: break-word;\n}\n\n.content-container {\n display: flex;\n flex: 1 1 0%;\n}\n\n.footer {\n position: relative;\n order: 1;\n display: flex;\n inline-size: 100%;\n justify-content: flex-end;\n padding-block-start: 1px;\n block-size: var(--calcite-alert-footer-height);\n}\n.footer:before {\n content: "";\n position: absolute;\n inset-block-start: 0px;\n inset-inline: var(--calcite-alert-footer-divider-gap);\n border-block-start: 1px solid var(--calcite-ui-border-3);\n}\n\n:host([scale=s]) {\n --calcite-alert-width: 40em;\n --calcite-alert-spacing-token-small: 0.5rem;\n --calcite-alert-spacing-token-large: 0.75rem;\n --calcite-alert-footer-height: 2rem;\n --calcite-alert-footer-divider-gap: 0.125rem;\n}\n:host([scale=s]) slot[name=title]::slotted(*),\n:host([scale=s]) *::slotted([slot=title]) {\n font-size: var(--calcite-font-size--1);\n line-height: 1.375;\n}\n:host([scale=s]) slot[name=message]::slotted(*),\n:host([scale=s]) *::slotted([slot=message]) {\n font-size: var(--calcite-font-size--2);\n line-height: 1.375;\n}\n:host([scale=s]) slot[name=link]::slotted(*),\n:host([scale=s]) *::slotted([slot=link]) {\n font-size: var(--calcite-font-size--2);\n line-height: 1.375;\n}\n:host([scale=s]) .queue-count {\n margin-inline: 0.5rem;\n}\n:host([scale=s]) .container {\n --calcite-alert-min-height: 3.5rem;\n}\n\n:host([scale=m]) {\n --calcite-alert-width: 50em;\n --calcite-alert-spacing-token-small: 0.75rem;\n --calcite-alert-spacing-token-large: 1rem;\n --calcite-alert-footer-height: 3rem;\n --calcite-alert-footer-divider-gap: 0.25rem;\n}\n:host([scale=m]) slot[name=title]::slotted(*),\n:host([scale=m]) *::slotted([slot=title]) {\n font-size: var(--calcite-font-size-0);\n line-height: 1.375;\n}\n:host([scale=m]) slot[name=message]::slotted(*),\n:host([scale=m]) *::slotted([slot=message]) {\n font-size: var(--calcite-font-size--1);\n line-height: 1.375;\n}\n:host([scale=m]) slot[name=link]::slotted(*),\n:host([scale=m]) *::slotted([slot=link]) {\n font-size: var(--calcite-font-size--1);\n line-height: 1.375;\n}\n:host([scale=m]) .queue-count {\n margin-inline: 0.75rem;\n}\n:host([scale=m]) .container {\n --calcite-alert-min-height: 4.1875rem;\n}\n\n:host([scale=l]) {\n --calcite-alert-width: 60em;\n --calcite-alert-spacing-token-small: 1rem;\n --calcite-alert-spacing-token-large: 1.25rem;\n --calcite-alert-footer-height: 4rem;\n --calcite-alert-footer-divider-gap: 0.5rem;\n}\n:host([scale=l]) slot[name=title]::slotted(*),\n:host([scale=l]) *::slotted([slot=title]) {\n margin-block-end: 0.25rem;\n font-size: var(--calcite-font-size-1);\n line-height: 1.375;\n}\n:host([scale=l]) slot[name=message]::slotted(*),\n:host([scale=l]) *::slotted([slot=message]) {\n font-size: var(--calcite-font-size-0);\n line-height: 1.375;\n}\n:host([scale=l]) slot[name=link]::slotted(*),\n:host([scale=l]) *::slotted([slot=link]) {\n font-size: var(--calcite-font-size-0);\n line-height: 1.375;\n}\n:host([scale=l]) .queue-count {\n margin-inline: 1rem;\n}\n:host([scale=l]) .container {\n --calcite-alert-min-height: 5.625rem;\n}\n\n:host([open]) .container:not(.container--queued) {\n border-block-start-width: 2px;\n opacity: 1;\n pointer-events: initial;\n}\n:host([open]) .container:not(.container--queued)[class*=bottom] {\n transform: translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), inherit);\n}\n:host([open]) .container:not(.container--queued)[class*=top] {\n transform: translate3d(0, var(--calcite-alert-edge-distance), inherit);\n}\n\n:host([auto-close]) > .queue-count {\n border-inline-end: 0 solid transparent;\n}\n\nslot[name=title]::slotted(*),\n*::slotted([slot=title]) {\n font-size: var(--calcite-font-size-0);\n line-height: 1.375;\n font-weight: var(--calcite-font-weight-medium);\n color: var(--calcite-ui-text-1);\n}\n\nslot[name=message]::slotted(*),\n*::slotted([slot=message]) {\n margin: 0px;\n display: inline;\n font-size: var(--calcite-font-size--1);\n line-height: 1.375;\n font-weight: var(--calcite-font-weight-normal);\n color: var(--calcite-ui-text-2);\n margin-inline-end: 0.5rem;\n}\n\nslot[name=link]::slotted(*),\n*::slotted([slot=link]) {\n display: inline-flex;\n color: var(--calcite-ui-text-link);\n}\n\n:host([kind=brand]) .container {\n border-block-start-color: var(--calcite-ui-brand);\n}\n:host([kind=brand]) .container .icon {\n color: var(--calcite-ui-brand);\n}\n\n:host([kind=info]) .container {\n border-block-start-color: var(--calcite-ui-info);\n}\n:host([kind=info]) .container .icon {\n color: var(--calcite-ui-info);\n}\n\n:host([kind=danger]) .container {\n border-block-start-color: var(--calcite-ui-danger);\n}\n:host([kind=danger]) .container .icon {\n color: var(--calcite-ui-danger);\n}\n\n:host([kind=success]) .container {\n border-block-start-color: var(--calcite-ui-success);\n}\n:host([kind=success]) .container .icon {\n color: var(--calcite-ui-success);\n}\n\n:host([kind=warning]) .container {\n border-block-start-color: var(--calcite-ui-warning);\n}\n:host([kind=warning]) .container .icon {\n color: var(--calcite-ui-warning);\n}\n\n:host([auto-close-duration=fast]) .dismiss-progress:after {\n animation: dismissProgress 6000ms ease-out;\n}\n\n:host(:hover[auto-close-duration=fast]) .dismiss-progress:after {\n animation-play-state: paused;\n}\n\n:host([auto-close-duration=medium]) .dismiss-progress:after {\n animation: dismissProgress 10000ms ease-out;\n}\n\n:host(:hover[auto-close-duration=medium]) .dismiss-progress:after {\n animation-play-state: paused;\n}\n\n:host([auto-close-duration=slow]) .dismiss-progress:after {\n animation: dismissProgress 14000ms ease-out;\n}\n\n:host(:hover[auto-close-duration=slow]) .dismiss-progress:after {\n animation-play-state: paused;\n}\n\n@keyframes dismissProgress {\n 0% {\n inline-size: 0px;\n opacity: 0.75;\n }\n 100% {\n inline-size: 100%;\n opacity: 1;\n }\n}\n/**\n * Conditional styles for when Alert is slotted in Shell\n */\n.container--slotted-in-shell {\n position: absolute;\n}\n\n@container responsive-container (min-width: 476px) {\n .content {\n flex-direction: row;\n }\n .close {\n align-items: center;\n align-self: stretch;\n }\n .icon {\n justify-content: center;\n margin-inline-end: 0;\n margin-block: 0;\n padding-inline-end: var(--calcite-alert-spacing-token-large);\n }\n}\n@container responsive-container (min-width: 768px) {\n .close {\n align-self: stretch;\n }\n .footer {\n inline-size: auto;\n align-self: stretch;\n order: initial;\n block-size: inherit;\n }\n .footer:before {\n content: none;\n }\n .icon {\n padding-inline: var(--calcite-alert-spacing-token-large) 0;\n }\n}\n:host([hidden]) {\n display: none;\n}\n\n[hidden] {\n display: none;\n}\n\n:host([calcite-hydrated-hidden]) {\n visibility: hidden !important;\n pointer-events: none;\n}';const W=class{constructor(n){t(this,n),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&&(this._shouldClose=!1,this.closeEdit.emit())}async openWatchHandler(t){var i;t&&(null===(i=this.graphics)||void 0===i?void 0:i.length)>0&&this.graphicIndex>-1&&(this._editorLoading=!0,this._initEditorWidget(),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&(await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0),this._editorLoading=!1),t||(this._shouldClose=!1,this.closeEdit.emit())}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._editorLoading=!0,this.editsComplete.emit(),this._shouldClose=!1,this._initEditorWidget(),this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0,this._editorLoading=!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),s=this._editorLoading?"display-none":"",a=this._editorLoading?"":"display-none";return n(e,null,n("div",{class:"position-relative"},i?n("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},n("div",{slot:"message"},this._translations.enableEditing)):void 0,n("div",{slot:"content"},n("div",{class:s,id:"feature-form",ref:t=>this._editContainer=t}),n("calcite-loader",{class:a,scale:"s"}))))}async _initModules(){const[t,i]=await z(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}_initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div");this._editor=new this.Editor({allowedWorkflows:"update",view:this.mapView,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._shouldClose=!1,this.closeEdit.emit()):this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&(this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0)})),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 _getTranslations(){const t=await C(this.el);this._translations=t[0]}get el(){return s(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}";const A=class{constructor(n){t(this,n),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._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,s;const a=this.isLoading||this._editRecordOpen?"display-none":"position-absolute",o=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",l=!this.isLoading&&this._editRecordOpen?"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 n(e,null,n("calcite-shell",null,n("calcite-loader",{class:this.isLoading?"":"display-none",label:this._translations.fetchingData}),n("div",{class:"esri-widget "+a,id:"features-node"}),n("div",{class:`${l} width-100`,slot:"footer"},n("div",{class:"display-flex top-border padding-1-2"},n("calcite-button",{appearance:"solid","icon-start":"pencil",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),n("calcite-tooltip",{label:"",placement:"bottom","reference-element":"solutions-edit"},n("span",null,this._translations.edit))),n("div",{class:"display-flex padding-1-2 button-container top-border"},n("div",{class:"min-width-100"},n("calcite-button",{appearance:"outline",disabled:r,id:"solutions-back",onClick:()=>this._back(),width:"full"},this._translations.back),n("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-back"},n("span",null,this._translations.back))),n("div",null,this._getCount()),n("div",{class:"min-width-100"},n("calcite-button",{appearance:"outline",disabled:r,id:"solutions-next",onClick:()=>this._next(),width:"full"},this._translations.next),n("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-next"},n("span",null,this._translations.next))))),n("edit-card",{class:o,graphicIndex:null===(s=this._features)||void 0===s?void 0:s.selectedFeatureIndex,graphics:this.graphics,mapView:this.mapView,open:this._editRecordOpen}),n("calcite-alert",{icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},n("div",{slot:"title"},this._translations.editDisabled),n("div",{slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,i]=await z(["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.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,n;const e=((null===(t=this._features)||void 0===t?void 0:t.viewModel.selectedFeatureIndex)+1).toString(),s=null===(n=null===(i=this._features)||void 0===i?void 0:i.features)||void 0===n?void 0:n.length.toString();return this._translations.indexOfTotal.replace("{{index}}",e).replace("{{total}}",s)}async _getTranslations(){const t=await C(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};A.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,A as info_card}
|
11
|
+
*/const _={slow:14e3,medium:1e4,fast:6e3},j="container",q=class{constructor(n){t(this,n),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.resizeObserver=y("resize",(t=>this.responsiveContainerWidth=t[0].contentRect.width)),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=a(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,this.responsiveContainerWidth=void 0}openHandler(){g(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(){var t;p(this),v(this),this.open&&!this.queued&&this.calciteInternalAlertRegister.emit(),this.transitionEl&&(null===(t=this.resizeObserver)||void 0===t||t.observe(this.transitionEl))}async componentWillLoad(){c(this);const[,t]=await Promise.all([f(this),k()]);this.breakpoints=t,this.open&&g(this)}componentDidLoad(){var t;h(this),null===(t=this.resizeObserver)||void 0===t||t.observe(this.transitionEl)}disconnectedCallback(){var t;window.dispatchEvent(new CustomEvent("calciteInternalAlertUnregister",{detail:{alert:this.el}})),window.clearTimeout(this.autoCloseTimeoutId),window.clearTimeout(this.queueTimeout),u(this),b(this),this.slottedInShell=!1,null===(t=this.resizeObserver)||void 0===t||t.disconnect()}render(){m.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,signDisplay:"always"};const{hasEndActions:t}=this,{open:i,autoClose:s,responsiveContainerWidth:a,label:l,placement:c,queued:h}=this,d=s?"alert":"alertdialog",p=this.breakpoints.width,u=a<p.small,g=a>=p.small,v=!i,f=r(x,this.icon,this.kind),b=this.queueLength>1;return n(e,{"aria-hidden":o(v),"aria-label":l,"calcite-hydrated-hidden":v,role:d},n("div",{class:{[j]:!0,"container--queued":h,[`${j}--${c}`]:!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},n("div",{class:"content-container"},f&&g?this.renderIcon(f):null,n("div",{class:"content"},f&&u?this.renderIcon(f):null,n("div",{class:"text-container"},n("slot",{name:"title"}),n("slot",{name:"message"}),n("slot",{name:"link"})))),u?this.renderCloseButton():null,n("div",{class:"footer",hidden:!t&&!b},this.renderActionsEnd(),b?this.renderQueueCount():null),g?this.renderCloseButton():null,i&&!h&&s?n("div",{class:"dismiss-progress"}):null))}renderCloseButton(){return n("button",{"aria-label":this.messages.close,class:"close",key:"close",onClick:this.closeAlert,type:"button",ref:t=>this.closeButton=t},n("calcite-icon",{icon:"x",scale:"l"===this.scale?"m":"s"}))}renderQueueCount(){const t=m.numberFormatter.format(this.queueLength>2?this.queueLength-1:1);return n("div",{class:{"queue-count":!0,"queue-count--active":this.queueLength>1},key:"queue-count"},n("calcite-chip",{scale:this.scale,value:t},t))}renderActionsEnd(){return n("div",{class:"actions-end"},n("slot",{name:"actions-end",onSlotchange:this.actionsEndSlotChangeHandler}))}renderIcon(t){return n("div",{class:"icon"},n("calcite-icon",{flipRtl:this.iconFlipRtl,icon:t,scale:"l"===this.scale?"m":"s"}))}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 d(this);const t=l(this.el,{selector:"calcite-link"});if(this.closeButton||t)return t?t.setFocus():void(this.closeButton&&this.closeButton.focus())}effectiveLocaleChange(){w(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 s(this)}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],autoCloseDuration:["updateDuration"],effectiveLocale:["effectiveLocaleChange"]}}};q.style='/**\n * Do not edit directly\n * Generated on Thu, 11 May 2023 18:56:13 GMT\n */\n/* mixins & extensions */\n/* helper to properly scale internal durations */\n/**\n* Currently only used in Checkbox.\n*/\n/**\n* CSS Custom Properties\n*\n* These properties can be overridden using the component\'s tag as selector.\n*\n* @prop --calcite-alert-width: Specifies the width of the component.\n*/\n:host {\n --calcite-alert-edge-distance: 2rem;\n display: block;\n}\n\n.container {\n pointer-events: none;\n position: fixed;\n z-index: var(--calcite-app-z-index-toast);\n margin-inline: auto;\n margin-block: 0px;\n box-sizing: border-box;\n display: flex;\n inline-size: 100%;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n background-color: var(--calcite-ui-foreground-1);\n text-align: start;\n opacity: 0;\n --tw-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);\n --tw-shadow-colored: 0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n container: responsive-container/inline-size;\n border-radius: var(--calcite-border-radius);\n border-block-start: 0 solid transparent;\n border-inline: 1px solid var(--calcite-ui-border-3);\n border-block-end: 1px solid var(--calcite-ui-border-3);\n inline-size: var(--calcite-alert-width);\n max-inline-size: calc(100% - var(--calcite-alert-edge-distance) * 2);\n 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;\n}\n.container--bottom, .container--top {\n inset-inline-end: 0;\n inset-inline-start: 0;\n}\n.container[class*=bottom] {\n transform: translate3d(0, var(--calcite-alert-edge-distance), 0);\n inset-block-end: var(--calcite-alert-edge-distance);\n}\n.container[class*=top] {\n transform: translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), 0);\n inset-block-start: var(--calcite-alert-edge-distance);\n}\n.container[class*=start] {\n inset-inline-start: var(--calcite-alert-edge-distance);\n inset-inline-end: auto;\n}\n.container[class*=end] {\n inset-inline-end: var(--calcite-alert-edge-distance);\n inset-inline-start: auto;\n}\n\n.content {\n box-sizing: border-box;\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n transition: all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;\n padding-block: var(--calcite-alert-spacing-token-small);\n padding-inline: var(--calcite-alert-spacing-token-large) var(--calcite-alert-spacing-token-small);\n}\n\n.icon {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n padding: 0px;\n margin-block-end: var(--calcite-alert-spacing-token-large);\n margin-inline-end: auto;\n}\n\n.close {\n display: flex;\n cursor: pointer;\n align-items: flex-start;\n justify-content: flex-end;\n align-self: flex-start;\n border-style: none;\n background-color: transparent;\n color: var(--calcite-ui-text-3);\n outline: 2px solid transparent;\n outline-offset: 2px;\n -webkit-appearance: none;\n padding: var(--calcite-alert-spacing-token-large);\n outline-color: transparent;\n}\n.close:focus {\n outline: 2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));\n 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 );\n}\n.close:hover, .close:focus {\n background-color: var(--calcite-ui-foreground-2);\n color: var(--calcite-ui-text-1);\n}\n.close:active {\n background-color: var(--calcite-ui-foreground-3);\n}\n\n.queue-count {\n visibility: hidden;\n display: flex;\n cursor: default;\n align-items: center;\n justify-content: space-around;\n align-self: stretch;\n overflow: hidden;\n background-color: var(--calcite-ui-foreground-1);\n text-align: center;\n font-weight: var(--calcite-font-weight-medium);\n color: var(--calcite-ui-text-2);\n opacity: 0;\n transition: all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;\n border-inline: 0 solid transparent;\n border-start-end-radius: 0;\n}\n.queue-count--active {\n visibility: visible;\n opacity: 1;\n}\n\n.dismiss-progress {\n position: absolute;\n display: block;\n inline-size: 100%;\n overflow: hidden;\n inset-inline: 0;\n inset-block-start: -2px;\n block-size: 2px;\n border-radius: var(--calcite-border-radius) var(--calcite-border-radius) 0 0;\n}\n.dismiss-progress:after {\n position: absolute;\n inset-block-start: 0px;\n display: block;\n block-size: 2px;\n content: "";\n background-color: var(--calcite-alert-dismiss-progress-background);\n inset-inline-end: 0;\n}\n\n.actions-end {\n display: flex;\n align-self: stretch;\n}\n\n.text-container {\n display: flex;\n min-inline-size: 0px;\n flex: 1 1 0%;\n flex-direction: column;\n overflow-wrap: break-word;\n}\n\n.content-container {\n display: flex;\n flex: 1 1 0%;\n}\n\n.footer {\n position: relative;\n order: 1;\n display: flex;\n inline-size: 100%;\n justify-content: flex-end;\n padding-block-start: 1px;\n block-size: var(--calcite-alert-footer-height);\n}\n.footer:before {\n content: "";\n position: absolute;\n inset-block-start: 0px;\n inset-inline: var(--calcite-alert-footer-divider-gap);\n border-block-start: 1px solid var(--calcite-ui-border-3);\n}\n\n:host([scale=s]) {\n --calcite-alert-width: 40em;\n --calcite-alert-spacing-token-small: 0.5rem;\n --calcite-alert-spacing-token-large: 0.75rem;\n --calcite-alert-footer-height: 2rem;\n --calcite-alert-footer-divider-gap: 0.125rem;\n}\n:host([scale=s]) slot[name=title]::slotted(*),\n:host([scale=s]) *::slotted([slot=title]) {\n font-size: var(--calcite-font-size--1);\n line-height: 1.375;\n}\n:host([scale=s]) slot[name=message]::slotted(*),\n:host([scale=s]) *::slotted([slot=message]) {\n font-size: var(--calcite-font-size--2);\n line-height: 1.375;\n}\n:host([scale=s]) slot[name=link]::slotted(*),\n:host([scale=s]) *::slotted([slot=link]) {\n font-size: var(--calcite-font-size--2);\n line-height: 1.375;\n}\n:host([scale=s]) .queue-count {\n margin-inline: 0.5rem;\n}\n:host([scale=s]) .container {\n --calcite-alert-min-height: 3.5rem;\n}\n\n:host([scale=m]) {\n --calcite-alert-width: 50em;\n --calcite-alert-spacing-token-small: 0.75rem;\n --calcite-alert-spacing-token-large: 1rem;\n --calcite-alert-footer-height: 3rem;\n --calcite-alert-footer-divider-gap: 0.25rem;\n}\n:host([scale=m]) slot[name=title]::slotted(*),\n:host([scale=m]) *::slotted([slot=title]) {\n font-size: var(--calcite-font-size-0);\n line-height: 1.375;\n}\n:host([scale=m]) slot[name=message]::slotted(*),\n:host([scale=m]) *::slotted([slot=message]) {\n font-size: var(--calcite-font-size--1);\n line-height: 1.375;\n}\n:host([scale=m]) slot[name=link]::slotted(*),\n:host([scale=m]) *::slotted([slot=link]) {\n font-size: var(--calcite-font-size--1);\n line-height: 1.375;\n}\n:host([scale=m]) .queue-count {\n margin-inline: 0.75rem;\n}\n:host([scale=m]) .container {\n --calcite-alert-min-height: 4.1875rem;\n}\n\n:host([scale=l]) {\n --calcite-alert-width: 60em;\n --calcite-alert-spacing-token-small: 1rem;\n --calcite-alert-spacing-token-large: 1.25rem;\n --calcite-alert-footer-height: 4rem;\n --calcite-alert-footer-divider-gap: 0.5rem;\n}\n:host([scale=l]) slot[name=title]::slotted(*),\n:host([scale=l]) *::slotted([slot=title]) {\n margin-block-end: 0.25rem;\n font-size: var(--calcite-font-size-1);\n line-height: 1.375;\n}\n:host([scale=l]) slot[name=message]::slotted(*),\n:host([scale=l]) *::slotted([slot=message]) {\n font-size: var(--calcite-font-size-0);\n line-height: 1.375;\n}\n:host([scale=l]) slot[name=link]::slotted(*),\n:host([scale=l]) *::slotted([slot=link]) {\n font-size: var(--calcite-font-size-0);\n line-height: 1.375;\n}\n:host([scale=l]) .queue-count {\n margin-inline: 1rem;\n}\n:host([scale=l]) .container {\n --calcite-alert-min-height: 5.625rem;\n}\n\n:host([open]) .container:not(.container--queued) {\n border-block-start-width: 2px;\n opacity: 1;\n pointer-events: initial;\n}\n:host([open]) .container:not(.container--queued)[class*=bottom] {\n transform: translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), inherit);\n}\n:host([open]) .container:not(.container--queued)[class*=top] {\n transform: translate3d(0, var(--calcite-alert-edge-distance), inherit);\n}\n\n:host([auto-close]) > .queue-count {\n border-inline-end: 0 solid transparent;\n}\n\nslot[name=title]::slotted(*),\n*::slotted([slot=title]) {\n font-size: var(--calcite-font-size-0);\n line-height: 1.375;\n font-weight: var(--calcite-font-weight-medium);\n color: var(--calcite-ui-text-1);\n}\n\nslot[name=message]::slotted(*),\n*::slotted([slot=message]) {\n margin: 0px;\n display: inline;\n font-size: var(--calcite-font-size--1);\n line-height: 1.375;\n font-weight: var(--calcite-font-weight-normal);\n color: var(--calcite-ui-text-2);\n margin-inline-end: 0.5rem;\n}\n\nslot[name=link]::slotted(*),\n*::slotted([slot=link]) {\n display: inline-flex;\n color: var(--calcite-ui-text-link);\n}\n\n:host([kind=brand]) .container {\n border-block-start-color: var(--calcite-ui-brand);\n}\n:host([kind=brand]) .container .icon {\n color: var(--calcite-ui-brand);\n}\n\n:host([kind=info]) .container {\n border-block-start-color: var(--calcite-ui-info);\n}\n:host([kind=info]) .container .icon {\n color: var(--calcite-ui-info);\n}\n\n:host([kind=danger]) .container {\n border-block-start-color: var(--calcite-ui-danger);\n}\n:host([kind=danger]) .container .icon {\n color: var(--calcite-ui-danger);\n}\n\n:host([kind=success]) .container {\n border-block-start-color: var(--calcite-ui-success);\n}\n:host([kind=success]) .container .icon {\n color: var(--calcite-ui-success);\n}\n\n:host([kind=warning]) .container {\n border-block-start-color: var(--calcite-ui-warning);\n}\n:host([kind=warning]) .container .icon {\n color: var(--calcite-ui-warning);\n}\n\n:host([auto-close-duration=fast]) .dismiss-progress:after {\n animation: dismissProgress 6000ms ease-out;\n}\n\n:host(:hover[auto-close-duration=fast]) .dismiss-progress:after {\n animation-play-state: paused;\n}\n\n:host([auto-close-duration=medium]) .dismiss-progress:after {\n animation: dismissProgress 10000ms ease-out;\n}\n\n:host(:hover[auto-close-duration=medium]) .dismiss-progress:after {\n animation-play-state: paused;\n}\n\n:host([auto-close-duration=slow]) .dismiss-progress:after {\n animation: dismissProgress 14000ms ease-out;\n}\n\n:host(:hover[auto-close-duration=slow]) .dismiss-progress:after {\n animation-play-state: paused;\n}\n\n@keyframes dismissProgress {\n 0% {\n inline-size: 0px;\n opacity: 0.75;\n }\n 100% {\n inline-size: 100%;\n opacity: 1;\n }\n}\n/**\n * Conditional styles for when Alert is slotted in Shell\n */\n.container--slotted-in-shell {\n position: absolute;\n}\n\n@container responsive-container (min-width: 476px) {\n .content {\n flex-direction: row;\n }\n .close {\n align-items: center;\n align-self: stretch;\n }\n .icon {\n justify-content: center;\n margin-inline-end: 0;\n margin-block: 0;\n padding-inline-end: var(--calcite-alert-spacing-token-large);\n }\n}\n@container responsive-container (min-width: 768px) {\n .close {\n align-self: stretch;\n }\n .footer {\n inline-size: auto;\n align-self: stretch;\n order: initial;\n block-size: inherit;\n }\n .footer:before {\n content: none;\n }\n .icon {\n padding-inline: var(--calcite-alert-spacing-token-large) 0;\n }\n}\n:host([hidden]) {\n display: none;\n}\n\n[hidden] {\n display: none;\n}\n\n:host([calcite-hydrated-hidden]) {\n visibility: hidden !important;\n pointer-events: none;\n}';const W=class{constructor(n){t(this,n),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&&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,this._initEditorWidget(),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&await this._startUpdate(),this._editorLoading=!1),t||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),s=this._editorLoading?"display-none":"",a=this._editorLoading?"":"display-none";return n(e,null,n("div",{class:"position-relative"},i?n("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},n("div",{slot:"message"},this._translations.enableEditing)):void 0,n("div",{slot:"content"},n("div",{class:s,id:"feature-form",ref:t=>this._editContainer=t}),n("calcite-loader",{class:a,scale:"s"}))))}async _initModules(){const[t,i]=await z(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}_initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div");this._editor=new this.Editor({allowedWorkflows:"update",view:this.mapView,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)}}_closeEdit(){this._shouldClose=!1,this.closeEdit.emit()}async _startUpdate(){await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0}async _getTranslations(){const t=await C(this.el);this._translations=t[0]}get el(){return s(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}";const A=class{constructor(n){t(this,n),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._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,s;const a=this.isLoading||this._editRecordOpen?"display-none":"position-absolute",o=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",l=!this.isLoading&&this._editRecordOpen?"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 n(e,null,n("calcite-shell",null,n("calcite-loader",{class:this.isLoading?"":"display-none",label:this._translations.fetchingData}),n("div",{class:"esri-widget "+a,id:"features-node"}),n("div",{class:`${l} width-100`,slot:"footer"},n("div",{class:"display-flex top-border padding-1-2"},n("calcite-button",{appearance:"solid","icon-start":"pencil",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),n("calcite-tooltip",{label:"",placement:"bottom","reference-element":"solutions-edit"},n("span",null,this._translations.edit))),n("div",{class:"display-flex padding-1-2 button-container top-border"},n("div",{class:"min-width-100"},n("calcite-button",{appearance:"outline",disabled:r,id:"solutions-back",onClick:()=>this._back(),width:"full"},this._translations.back),n("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-back"},n("span",null,this._translations.back))),n("div",null,this._getCount()),n("div",{class:"min-width-100"},n("calcite-button",{appearance:"outline",disabled:r,id:"solutions-next",onClick:()=>this._next(),width:"full"},this._translations.next),n("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-next"},n("span",null,this._translations.next))))),n("edit-card",{class:o,graphicIndex:null===(s=this._features)||void 0===s?void 0:s.selectedFeatureIndex,graphics:this.graphics,mapView:this.mapView,open:this._editRecordOpen}),n("calcite-alert",{icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},n("div",{slot:"title"},this._translations.editDisabled),n("div",{slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,i]=await z(["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.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,n;const e=((null===(t=this._features)||void 0===t?void 0:t.viewModel.selectedFeatureIndex)+1).toString(),s=null===(n=null===(i=this._features)||void 0===i?void 0:i.features)||void 0===n?void 0:n.length.toString();return this._translations.indexOfTotal.replace("{{index}}",e).replace("{{total}}",s)}async _getTranslations(){const t=await C(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};A.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,A as info_card}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,h as i,H as s,g as e,c as a}from"./p-91c78d98.js";import{g as h}from"./p-99d8a839.js";import{q as o,a as l,g as n,b as c}from"./p-53bc5fc1.js";import{l as d}from"./p-05948b48.js";import{d as r}from"./p-37a58e04.js";import"./p-e1a4994d.js";import"./p-2a58e378.js";import"./p-ecc95259.js";const p=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 a=(null===(t=this._graphics)||void 0===t?void 0:t.length)>0?"":"display-none",h=(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 "+a},i("div",null,i("info-card",{graphics:this._graphics,isLoading:this._cardLoading,mapView:this.mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))),i("calcite-shell",{class:"position-relative "+h},i("div",{class:"padding-1"},i("calcite-notice",{icon:"table",open:!0},i("div",{slot:"message"},this._translations.selectFeaturesToStart))))))}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return e(this)}};p.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 m=class{constructor(i){t(this,i),this.featureSelectionChange=a(this,"featureSelectionChange",7),this.openFilterOptions=a(this,"openFilterOptions",7),this._allIds=[],this._tableSorting=!1,this.onTableNodeCreate=t=>{this._tableNode=t},this.enableAutoRefresh=void 0,this.enableCSV=void 0,this.enableInlineEdit=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._fetchingData=!1,this._isDeleting=!1,this._layer=void 0,this._selectedIndexes=[],this._showOnlySelected=!1,this._sortActive=!1,this._translations=void 0}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",(t=>{this._mapClicked(t)})))}async _layerWatchHandler(){this._fetchingData=!0,await this._resetTable(),this._fetchingData=!1}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 a=i.layer;let h;this.mapView.allLayerViews.toArray().some((t=>{if(t.layer.title===a.title&&"feature"===t.layer.type)return h=t,!0})),h&&await n([s],h,this.mapView,!0)}}editsComplete(){this._refresh()}noLayersFound(){this._layer=void 0,this._allIds=[],this._clearSelection()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){const t=this._fetchingData?"display-none":"",e=this._fetchingData?"":"display-none",a=this._allIds.length.toString(),h=this._selectedIndexes.length.toString();return i(s,null,i("calcite-shell",null,this._getTableControlRow("header"),i("div",{class:"height-full 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 background text-color"},this._translations.recordsSelected.replace("{{total}}",a).replace("{{selected}}",h)))),this._deleteMessage())}async _initModules(){const[t,i]=await d(["esri/widgets/FeatureTable","esri/core/reactiveUtils"]);this.FeatureTable=t,this.reactiveUtils=i}_getTableControlRow(t){var s;const e=this._selectedIndexes.length>0,a="more-table-options";return i("div",{class:"display-flex border-bottom height-51",slot:t},i("calcite-action-bar",{expandDisabled:!0,expanded:!0,layout:"horizontal"},i("div",{class:"border-end"},i("map-layer-picker",{appearance:"transparent",mapView:this.mapView,onLayerSelectionChange:t=>this._layerSelectionChanged(t),onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,placeholderIcon:"layers",scale:"l",showTables:!0,type:"dropdown"})),this._getAction("zoom-to-object",this._translations.zoom,(()=>this._zoom()),!e),(null===(s=this.mapInfo)||void 0===s?void 0:s.filters)?this._getAction("filter",this._translations.filters,(()=>this._filter()),!1):void 0,this._deleteEnabled?this._getDangerAction("trash",this._translations.delete,(()=>this._delete()),!e):void 0,this._getAction("erase",this._translations.clearSelection,(()=>this._clearSelection()),!e),this._getAction("selected-items-filter",this._showOnlySelected?this._translations.showAll:this._translations.showSelected,(()=>this._toggleShowSelected()),!e)),i("calcite-dropdown",{disabled:void 0===this._layer},i("calcite-action",{appearance:"solid",id:a,label:"",slot:"trigger",text:""},i("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),i("calcite-dropdown-group",{"selection-mode":"none"},i("calcite-dropdown-item",{iconStart:"list-check-all",onClick:()=>this._selectAll()},this._translations.selectAll),i("calcite-dropdown-item",{iconStart:"compare",onClick:()=>this._switchSelected()},this._translations.switchSelected),i("calcite-dropdown-item",{iconStart:"refresh",onClick:()=>this._refresh()},this._translations.refresh),this.enableCSV?i("calcite-dropdown-item",{iconStart:"export",onClick:()=>{this._exportToCSV()}},this._translations.exportCSV):void 0)),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":a},i("span",null,this._translations.moreOptions)))}_getAction(t,s,e,a){return i("div",{class:"display-flex"},i("calcite-action",{appearance:"solid",disabled:void 0===this._layer||a,icon:t,id:t,label:s,onClick:e,text:s,textEnabled:!0}),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},i("span",null,s)))}_getDangerAction(t,s,e,a){return i("div",{class:"display-flex"},i("calcite-action",{appearance:"solid",disabled:void 0===this._layer||a,id:t,onClick:e,text:""},i("calcite-button",{appearance:"transparent",iconStart:t,kind:"danger"},s)),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},i("span",null,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,editingEnabled:this._editEnabled&&this.enableInlineEdit,highlightEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},tableTemplate:{columnTemplates:i},container:t})})),this._checkEditEnabled(),await this._table.when((()=>{this._table.highlightIds.on("change",(()=>{this._selectedIndexes=this._table.highlightIds.toArray().reverse(),this._showOnlySelected&&(this._selectedIndexes.length>0?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this._selectedIndexes)})),this.reactiveUtils.watch((()=>this._table.activeSortOrders),(t=>{var i,s,e,a;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===(a=t[0])||void 0===a?void 0:a.fieldName)===this._layer.objectIdField)}))})))}async _resetTable(){this._table&&(this._clearSelection(),this._allIds=[],this.featureSelectionChange.emit(this._selectedIndexes),this._layer?(await this._layer.when((()=>{var t,i;const s=this._getColumnTemplates(this._layer.id,null===(i=null===(t=this._layer)||void 0===t?void 0:t.popupTemplate)||void 0===i?void 0:i.fieldInfos);this._table.layer=this._layer,this._table.tableTemplate.columnTemplates=s,this._table.view=this.mapView,this._checkEditEnabled(),this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit})),await this._table.when((()=>{this._table.clearSelectionFilter()})),this._showOnlySelected=!1,this._sortActive=!1,await this._sortTable()):(this._table.view=this.mapView,this._table.layer=this._layer))}_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})))}_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"},i("calcite-icon",{"aria-hidden":"true",class:"padding-end-1 danger-color",icon:"exclamation-mark-triangle",scale:"m"}),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 c(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.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},r(null,t,!1,!1,!0)}_refresh(){this._table.refresh()}_zoom(){this._table.zoomToSelection()}_delete(){this._confirmDelete=!0}async _layerSelectionChanged(t){var i,s,e;const a=t.detail[0];if(a!==(null===(i=this._layer)||void 0===i?void 0:i.id)||0===this._allIds.length){this._fetchingData=!0,this._layer=await l(this.mapView,a);const t=this._getColumnTemplates(a,null===(e=null===(s=this._layer)||void 0===s?void 0:s.popupTemplate)||void 0===e?void 0:e.fieldInfos);this._allIds=await c(this._layer),this._table?t&&(this._table.tableTemplate.columnTemplates=t):await this._getTable(this._tableNode,t),await this._table.when((()=>{this._table.highlightIds.removeAll()})),this._selectedIndexes=[],this._table.layer=this._layer,this._table.render()}this._sortActive=!1,await this._sortTable(),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 a=null==e?void 0:e.columnTemplates;return i&&(a=a?a.map((t=>(i.some((i=>{if(i.fieldName===t.fieldName)return t.label=i.label,!0})),t))):i.map((t=>({type:"field",fieldName:t.fieldName,label:t.label})))),a}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"],_sortActive:["_sortActiveWatchHandler"]}}};m.style=':host{display:block}.height-full{height:100%}.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}.bottom-left{position:absolute;left:0;bottom:0}html[dir="rtl"] .bottom-left{position:absolute;right:0;bottom:0}.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}';const v=class{constructor(i){t(this,i),this.mapChanged=a(this,"mapChanged",7),this.beforeMapChanged=a(this,"beforeMapChanged",7),this._loadedId="",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.mapInfos=[],this.mapView=void 0,this._searchConfiguration=void 0,this._webMapInfo=void 0}async mapInfoChange(t){await this._loadMap(t.detail)}async componentWillLoad(){await this._initModules()}render(){return i(s,null,i("map-picker",{mapInfos:this.mapInfos}),i("div",{class:"map-height",ref:t=>this._mapDiv=t}),i("map-tools",{basemapConfig:this.basemapConfig,class:"box-shadow",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 d(["esri/WebMap","esri/views/MapView","esri/widgets/Home"]);this.WebMap=t,this.MapView=i,this.Home=s}async _loadMap(t){let i=null==t?void 0:t.id;if(this._webMapInfo=(""===i||!i)&&this.mapInfos.length>0?this.mapInfos[0]:t,i=this._webMapInfo.id,this._loadedId!==i){const t=new this.WebMap({portalItem:{id:i}});this.mapView=new this.MapView({container:this._mapDiv,map:t,resizeAlign:"top-left"}),this._loadedId=i,this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),await this.mapView.when((()=>{const t=new this.Home({view:this.mapView});this.mapView.ui.add(t,{position:"top-left",index:3}),this.mapView.ui.add(this._mapTools,{position:"top-right",index:0}),this.mapChanged.emit({id:i,mapView:this.mapView})}))}}get el(){return e(this)}};v.style=":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 58px)}.box-shadow{box-shadow:none !important}";export{p as card_manager,m as layer_table,v as map_card}
|
6
|
+
import{r as t,h as i,H as s,g as e,c as a}from"./p-91c78d98.js";import{g as h}from"./p-99d8a839.js";import{q as o,a as l,g as n,b as c}from"./p-53bc5fc1.js";import{l as d}from"./p-05948b48.js";import{d as r}from"./p-37a58e04.js";import"./p-e1a4994d.js";import"./p-2a58e378.js";import"./p-ecc95259.js";const p=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 a=(null===(t=this._graphics)||void 0===t?void 0:t.length)>0?"":"display-none",h=(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 "+a},i("div",null,i("info-card",{graphics:this._graphics,isLoading:this._cardLoading,mapView:this.mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))),i("calcite-shell",{class:"position-relative "+h},i("div",{class:"padding-1"},i("calcite-notice",{icon:"table",open:!0},i("div",{slot:"message"},this._translations.selectFeaturesToStart))))))}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return e(this)}};p.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 m=class{constructor(i){t(this,i),this.featureSelectionChange=a(this,"featureSelectionChange",7),this.openFilterOptions=a(this,"openFilterOptions",7),this._allIds=[],this._tableSorting=!1,this.onTableNodeCreate=t=>{this._tableNode=t},this.enableAutoRefresh=void 0,this.enableCSV=void 0,this.enableInlineEdit=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._fetchingData=!1,this._isDeleting=!1,this._layer=void 0,this._selectedIndexes=[],this._showOnlySelected=!1,this._sortActive=!1,this._translations=void 0}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",(t=>{this._mapClicked(t)})))}async _layerWatchHandler(){this._fetchingData=!0,await this._resetTable(),this._fetchingData=!1}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 a=i.layer;let h;this.mapView.allLayerViews.toArray().some((t=>{if(t.layer.title===a.title&&"feature"===t.layer.type)return h=t,!0})),h&&await n([s],h,this.mapView,!0)}}editsComplete(){this._refresh()}noLayersFound(){this._layer=void 0,this._allIds=[],this._clearSelection()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){const t=this._fetchingData?"display-none":"",e=this._fetchingData?"":"display-none",a=this._allIds.length.toString(),h=this._selectedIndexes.length.toString();return i(s,null,i("calcite-shell",null,this._getTableControlRow("header"),i("div",{class:"height-full 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 background text-color"},this._translations.recordsSelected.replace("{{total}}",a).replace("{{selected}}",h)))),this._deleteMessage())}async _initModules(){const[t,i]=await d(["esri/widgets/FeatureTable","esri/core/reactiveUtils"]);this.FeatureTable=t,this.reactiveUtils=i}_getTableControlRow(t){var s;const e=this._selectedIndexes.length>0,a="more-table-options";return i("div",{class:"display-flex border-bottom height-51",slot:t},i("calcite-action-bar",{expandDisabled:!0,expanded:!0,layout:"horizontal"},i("div",{class:"border-end"},i("map-layer-picker",{appearance:"transparent",mapView:this.mapView,onLayerSelectionChange:t=>this._layerSelectionChanged(t),onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,placeholderIcon:"layers",scale:"l",showTables:!0,type:"dropdown"})),this._getAction("zoom-to-object",this._translations.zoom,(()=>this._zoom()),!e),(null===(s=this.mapInfo)||void 0===s?void 0:s.filters)?this._getAction("filter",this._translations.filters,(()=>this._filter()),!1):void 0,this._deleteEnabled?this._getDangerAction("trash",this._translations.delete,(()=>this._delete()),!e):void 0,this._getAction("erase",this._translations.clearSelection,(()=>this._clearSelection()),!e),this._getAction("selected-items-filter",this._showOnlySelected?this._translations.showAll:this._translations.showSelected,(()=>this._toggleShowSelected()),!e)),i("calcite-dropdown",{disabled:void 0===this._layer},i("calcite-action",{appearance:"solid",id:a,label:"",slot:"trigger",text:""},i("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),i("calcite-dropdown-group",{"selection-mode":"none"},i("calcite-dropdown-item",{iconStart:"list-check-all",onClick:()=>this._selectAll()},this._translations.selectAll),i("calcite-dropdown-item",{iconStart:"compare",onClick:()=>this._switchSelected()},this._translations.switchSelected),i("calcite-dropdown-item",{iconStart:"refresh",onClick:()=>this._refresh()},this._translations.refresh),this.enableCSV?i("calcite-dropdown-item",{iconStart:"export",onClick:()=>{this._exportToCSV()}},this._translations.exportCSV):void 0)),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":a},i("span",null,this._translations.moreOptions)))}_getAction(t,s,e,a){return i("div",{class:"display-flex"},i("calcite-action",{appearance:"solid",disabled:void 0===this._layer||a,icon:t,id:t,label:s,onClick:e,text:s,textEnabled:!0}),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},i("span",null,s)))}_getDangerAction(t,s,e,a){return i("div",{class:"display-flex"},i("calcite-action",{appearance:"solid",disabled:void 0===this._layer||a,id:t,onClick:e,text:""},i("calcite-button",{appearance:"transparent",iconStart:t,kind:"danger"},s)),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},i("span",null,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,editingEnabled:this._editEnabled&&this.enableInlineEdit,highlightEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},tableTemplate:{columnTemplates:i},container:t})})),this._checkEditEnabled(),await this._table.when((()=>{this._table.highlightIds.on("change",(()=>{this._selectedIndexes=this._table.highlightIds.toArray().reverse(),this._showOnlySelected&&(this._selectedIndexes.length>0?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this._selectedIndexes)})),this.reactiveUtils.watch((()=>this._table.activeSortOrders),(t=>{var i,s,e,a;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===(a=t[0])||void 0===a?void 0:a.fieldName)===this._layer.objectIdField)}))})))}async _resetTable(){this._table&&(this._clearSelection(),this._allIds=[],this.featureSelectionChange.emit(this._selectedIndexes),this._layer?(await this._layer.when((()=>{var t,i;const s=this._getColumnTemplates(this._layer.id,null===(i=null===(t=this._layer)||void 0===t?void 0:t.popupTemplate)||void 0===i?void 0:i.fieldInfos);this._table.layer=this._layer,this._table.tableTemplate.columnTemplates=s,this._table.view=this.mapView,this._checkEditEnabled(),this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit})),await this._table.when((()=>{this._table.clearSelectionFilter()})),this._showOnlySelected=!1,this._sortActive=!1,await this._sortTable()):(this._table.view=this.mapView,this._table.layer=this._layer))}_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})))}_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"},i("calcite-icon",{"aria-hidden":"true",class:"padding-end-1 danger-color",icon:"exclamation-mark-triangle",scale:"m"}),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 c(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.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},r(null,t,!1,!1,!0)}_refresh(){this._table.refresh()}_zoom(){this._table.zoomToSelection()}_delete(){this._confirmDelete=!0}async _layerSelectionChanged(t){var i,s,e;const a=t.detail[0];if(a!==(null===(i=this._layer)||void 0===i?void 0:i.id)||0===this._allIds.length){this._fetchingData=!0,this._layer=await l(this.mapView,a);const t=this._getColumnTemplates(a,null===(e=null===(s=this._layer)||void 0===s?void 0:s.popupTemplate)||void 0===e?void 0:e.fieldInfos);this._allIds=await c(this._layer),this._table?t&&(this._table.tableTemplate.columnTemplates=t):await this._getTable(this._tableNode,t),await this._table.when((()=>{this._table.highlightIds.removeAll()})),this._selectedIndexes=[],this._table.layer=this._layer,this._table.render()}this._sortActive=!1,await this._sortTable(),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 a=null==e?void 0:e.columnTemplates;return i&&(a=a?a.map((t=>(i.some((i=>{if(i.fieldName===t.fieldName)return t.label=i.label,!0})),t))):i.map((t=>({type:"field",fieldName:t.fieldName,label:t.label})))),a}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"],_sortActive:["_sortActiveWatchHandler"]}}};m.style=':host{display:block}.height-full{height:100%}.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}.bottom-left{position:absolute;left:0;bottom:0}html[dir="rtl"] .bottom-left{position:absolute;right:0;bottom:0}.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}';const v=class{constructor(i){t(this,i),this.mapChanged=a(this,"mapChanged",7),this.beforeMapChanged=a(this,"beforeMapChanged",7),this._loadedId="",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.mapInfos=[],this.mapView=void 0,this._searchConfiguration=void 0,this._webMapInfo=void 0}async mapInfoChange(t){await this._loadMap(t.detail)}async componentWillLoad(){await this._initModules(),this.esriConfig.portalUrl="https://holistic.mapsdevext.arcgis.com"}render(){return i(s,null,i("map-picker",{mapInfos:this.mapInfos}),i("div",{class:"map-height",ref:t=>this._mapDiv=t}),i("map-tools",{basemapConfig:this.basemapConfig,class:"box-shadow",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,e]=await d(["esri/WebMap","esri/views/MapView","esri/widgets/Home","esri/config"]);this.WebMap=t,this.MapView=i,this.Home=s,this.esriConfig=e}async _loadMap(t){let i=null==t?void 0:t.id;if(this._webMapInfo=(""===i||!i)&&this.mapInfos.length>0?this.mapInfos[0]:t,i=this._webMapInfo.id,this._loadedId!==i){const t=new this.WebMap({portalItem:{id:i}});this.mapView=new this.MapView({container:this._mapDiv,map:t,resizeAlign:"top-left"}),this._loadedId=i,this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),await this.mapView.when((()=>{const t=new this.Home({view:this.mapView});this.mapView.ui.add(t,{position:"top-left",index:3}),this.mapView.ui.add(this._mapTools,{position:"top-right",index:0}),this.mapChanged.emit({id:i,mapView:this.mapView})}))}}get el(){return e(this)}};v.style=":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 58px)}.box-shadow{box-shadow:none !important}";export{p as card_manager,m as layer_table,v 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-91c78d98.js";import{g as h}from"./p-99d8a839.js";import{E as l}from"./p-2a58e378.js";import"./p-e1a4994d.js";const a=class{constructor(i){t(this,i),this._shouldSetMapView=!1,this.classicGrid=!1,this.enableAutoRefresh=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableInlineEdit=!1,this.enableLegend=!0,this.enableSearch=!0,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}async layoutChanged(t){this._layoutMode=t.detail}async mapChanged(t){console.log("mapChanged"),this._mapChange=t.detail,await this._mapChange.mapView.when((()=>{console.log("mapView.when"),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))))}componentDidRender(){this._shouldSetMapView&&(this._shouldSetMapView=!1,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,h;return i("div",{class:`${this.classicGrid&&t===l.GRID?"width-full":this._expandPopup?"height-50-px":"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",enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter&&(null===(h=null===(s=this._mapView)||void 0===s?void 0:s.map)||void 0===h?void 0:h.floorInfo),enableFullscreen:this.enableFullscreen,enableLegend:this.enableLegend,enableSearch:this.enableSearch,mapInfos:this.mapInfos.filter((t=>!1!==t.visible))}))}_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 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",{class:"height-49-px",icon:t,id:e,onClick:()=>this._togglePopup(),slot:"header-actions-end"}),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:`${this._expandPopup?"width-50 adjusted-height-100-50":"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";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",{enableAutoRefresh:this.enableAutoRefresh,enableCSV:this.enableCSV,enableInlineEdit:this.enableInlineEdit,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}_setMapView(){this._mapInfo=this._getMapInfo(this._mapChange.id),this._mapView=this._mapChange.mapView,this._mapView.popupEnabled=!1}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return s(this)}};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-49-px{height:49px}.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}";export{a as crowdsource_manager}
|