Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

36 lines
20 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define("exports ./componentsUtils ./loadable ./t9n ./locale ./interactive ./button ./chip ./icon ./loader ./observers ./component".split(" "),function(z,e,r,p,l,E,F,G,A,H,I,v){function B(){"undefined"!==typeof customElements&&["calcite-pagination","calcite-icon"].forEach(a=>{switch(a){case "calcite-pagination":customElements.get(a)||customElements.define(a,J);break;case "calcite-icon":customElements.get(a)||A.defineCustomElement()}})}function C(){"undefined"!==typeof customElements&&"calcite-table calcite-button calcite-chip calcite-icon calcite-loader calcite-pagination".split(" ").forEach(a=>
{switch(a){case "calcite-table":customElements.get(a)||customElements.define(a,D);break;case "calcite-button":customElements.get(a)||F.defineCustomElement();break;case "calcite-chip":customElements.get(a)||G.defineCustomElement();break;case "calcite-icon":customElements.get(a)||A.defineCustomElement();break;case "calcite-loader":customElements.get(a)||H.defineCustomElement();break;case "calcite-pagination":customElements.get(a)||B()}})}const t={width:{large:parseInt("1440px"),medium:parseInt("1152px"),
small:parseInt("768px"),xsmall:parseInt("476px"),xxsmall:parseInt("320px")}},J=e.proxyCustomElement(class extends e.H{constructor(){super();this.__registerHost();this.__attachShadow();this.calcitePaginationChange=e.createEvent(this,"calcitePaginationChange",6);this.resizeObserver=I.createObserver("resize",a=>a.forEach(this.resizeHandler));this.resizeHandler=({contentRect:{width:a}})=>this.setMaxItemsToBreakpoint(a);this.firstClicked=()=>{this.startItem=1;this.emitUpdate()};this.lastClicked=()=>{this.startItem=
this.lastStartItem;this.emitUpdate()};this.previousClicked=async()=>{await this.previousPage();this.emitUpdate()};this.nextClicked=async()=>{await this.nextPage();this.emitUpdate()};this.handlePageClick=a=>{this.startItem=parseInt(a.target.value,10);this.emitUpdate()};this.groupSeparator=!1;this.numberingSystem=this.messageOverrides=this.messages=void 0;this.pageSize=20;this.scale="m";this.startItem=1;this.totalItems=0;this.defaultMessages=void 0;this.effectiveLocale="";this.maxItems=1;this.isXXSmall=
this.lastStartItem=this.totalPages=void 0}onMessagesChange(){}handleTotalPages(){1>this.pageSize&&(this.pageSize=1);this.totalPages=this.totalItems/this.pageSize}effectiveLocaleChange(){p.updateMessages(this,this.effectiveLocale)}effectiveLocaleWatcher(){l.numberStringFormatter.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator}}handleLastStartItemChange(){const {totalItems:a,pageSize:b,totalPages:c}=this;this.lastStartItem=(0===a%
b?a-b:Math.floor(c)*b)+1}handleIsXXSmall(){this.isXXSmall=1===this.maxItems}connectedCallback(){l.connectLocalized(this);p.connectMessages(this);this.resizeObserver?.observe(this.el)}async componentWillLoad(){await p.setUpMessages(this);r.setUpLoadableComponent(this);this.handleTotalPages();this.handleLastStartItemChange();this.handleIsXXSmall()}componentDidLoad(){r.setComponentLoaded(this);this.setMaxItemsToBreakpoint(this.el.clientWidth)}disconnectedCallback(){l.disconnectLocalized(this);p.disconnectMessages(this);
this.resizeObserver?.disconnect()}async setFocus(){await r.componentFocusable(this);this.el.focus()}async nextPage(){this.startItem=Math.min(this.lastStartItem,this.startItem+this.pageSize)}async previousPage(){this.startItem=Math.max(1,this.startItem-this.pageSize)}async goTo(a){switch(a){case "start":this.startItem=1;break;case "end":this.startItem=this.lastStartItem;break;default:this.startItem=a>=Math.ceil(this.totalPages)?this.lastStartItem:0>=a?1:(a-1)*this.pageSize+1}}setMaxItemsToBreakpoint(a){t&&
a&&(this.maxItems=a>=t.width.medium?11:a>=t.width.small?9:a>=t.width.xsmall?7:a>=t.width.xxsmall?5:1)}showStartEllipsis(){return this.totalPages>this.maxItems&&Math.floor(this.startItem/this.pageSize)>this.maxItems-2-2}showEndEllipsis(){return this.totalPages>this.maxItems&&(this.totalItems-this.startItem)/this.pageSize>this.maxItems-2-1}emitUpdate(){this.calcitePaginationChange.emit()}renderEllipsis(a){return e.h("span",{class:"ellipsis","data-test-ellipsis":a,key:a},"\u2026")}renderItems(){const {totalItems:a,
pageSize:b,startItem:c,maxItems:f,totalPages:d,lastStartItem:g,isXXSmall:w}=this,k=[];if(w)return k.push(this.renderPage(c)),k;var h=a>b,m=this.showStartEllipsis();const x=this.showEndEllipsis();h&&k.push(this.renderPage(1));m&&k.push(this.renderEllipsis("start"));h=f-2-(x?1:0)-(m?1:0);let n;d-1<=h?(n=1+b,m=g-b):c/b<h?(n=1+b,m=1+h*b):c+h*b>=a?(n=g-h*b,m=g-b):(n=c-(h-1)/2*b,m=c+(h-1)/2*b);for(let y=0;y<h&&n<=m;y++)k.push(this.renderPage(n)),n+=b;x&&k.push(this.renderEllipsis("end"));k.push(this.renderPage(g));
return k}renderPage(a){var {pageSize:b}=this;b=Math.floor(a/b)+(1===b?0:1);l.numberStringFormatter.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};b=l.numberStringFormatter.localize(b.toString());const c=a===this.startItem;return e.h("button",{"aria-current":c?"page":"false",class:{page:!0,selected:c},onClick:this.handlePageClick,value:a},b)}renderPreviousChevron(){const {pageSize:a,startItem:b,messages:c}=this,f=1===a?b<=a:b<
a;return e.h("button",{"aria-label":c.previous,class:{chevron:!0,disabled:f},"data-test-chevron":"previous",disabled:f,key:"previous",onClick:this.previousClicked},e.h("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:v.getIconScale(this.scale)}))}renderNextChevron(){const {totalItems:a,pageSize:b,startItem:c,messages:f}=this,d=c+b>a;return e.h("button",{"aria-label":f.next,class:{chevron:!0,disabled:d},"data-test-chevron":"next",disabled:d,key:"next-button",onClick:this.nextClicked},e.h("calcite-icon",
{flipRtl:!0,icon:"chevron-right",scale:v.getIconScale(this.scale)}))}renderFirstChevron(){const {messages:a,startItem:b,isXXSmall:c}=this,f=1===b;return c?e.h("button",{"aria-label":a.first,class:{chevron:!0,disabled:f},disabled:f,key:"first-button",onClick:this.firstClicked},e.h("calcite-icon",{flipRtl:!0,icon:"chevron-start",scale:v.getIconScale(this.scale)})):null}renderLastChevron(){const {messages:a,startItem:b,isXXSmall:c,lastStartItem:f}=this,d=b===f;return c?e.h("button",{"aria-label":a.last,
class:{chevron:!0,disabled:d},disabled:d,key:"last-button",onClick:this.lastClicked},e.h("calcite-icon",{flipRtl:!0,icon:"chevron-end",scale:v.getIconScale(this.scale)})):null}render(){return e.h(e.Fragment,{key:"9d37f173bfa3e76e1d7ce4d2b013383d13e1c331"},this.renderFirstChevron(),this.renderPreviousChevron(),this.renderItems(),this.renderNextChevron(),this.renderLastChevron())}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],
totalItems:["handleTotalPages","handleLastStartItemChange"],pageSize:["handleTotalPages","handleLastStartItemChange"],effectiveLocale:["effectiveLocaleChange","effectiveLocaleWatcher"],totalPages:["handleLastStartItemChange"],maxItems:["handleIsXXSmall"]}}static get style(){return":host{display:flex;writing-mode:horizontal-tb}:host([scale\x3ds]) .chevron,:host([scale\x3ds]) .page,:host([scale\x3ds]) .ellipsis{block-size:1.5rem;padding-inline:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;min-inline-size:1.5rem}:host([scale\x3dm]) .chevron,:host([scale\x3dm]) .page,:host([scale\x3dm]) .ellipsis{block-size:2rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;min-inline-size:2rem}:host([scale\x3dl]) .chevron,:host([scale\x3dl]) .page,:host([scale\x3dl]) .ellipsis{block-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-inline-size:2.75rem}:host([scale\x3dl]) .chevron{padding-inline:0.625rem}:host([scale\x3dl]) .page,:host([scale\x3dl]) .ellipsis{padding-inline:0.75rem}:host button{outline-color:transparent}:host button:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}.chevron,.page,.ellipsis{margin:0px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;border-style:none;--tw-border-opacity:0;background-color:transparent;padding:0px;vertical-align:baseline;font-family:inherit;font-size:var(--calcite-font-size-0);line-height:1.25rem;color:var(--calcite-color-text-3)}.chevron,.page{cursor:pointer;border-block:2px solid transparent}.chevron:hover,.page:hover{color:var(--calcite-color-text-1);transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.page:hover{border-block-end-color:var(--calcite-color-border-2)}.page.selected{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);border-block-end-color:var(--calcite-color-brand)}.chevron:hover{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-brand)}.chevron:active{background-color:var(--calcite-color-foreground-3)}.chevron.disabled{pointer-events:none;background-color:transparent}.chevron.disabled\x3ecalcite-icon{opacity:var(--calcite-opacity-disabled)}:host([hidden]){display:none}[hidden]{display:none}"}},
[17,"calcite-pagination",{groupSeparator:[516,"group-separator"],messages:[1040],messageOverrides:[1040],numberingSystem:[1,"numbering-system"],pageSize:[1538,"page-size"],scale:[513],startItem:[1538,"start-item"],totalItems:[514,"total-items"],defaultMessages:[32],effectiveLocale:[32],maxItems:[32],totalPages:[32],lastStartItem:[32],isXXSmall:[32],setFocus:[64],nextPage:[64],previousPage:[64],goTo:[64]},void 0,{messageOverrides:["onMessagesChange"],totalItems:["handleTotalPages","handleLastStartItemChange"],
pageSize:["handleTotalPages","handleLastStartItemChange"],effectiveLocale:["effectiveLocaleChange","effectiveLocaleWatcher"],totalPages:["handleLastStartItemChange"],maxItems:["handleIsXXSmall"]}]);B();const D=e.proxyCustomElement(class extends e.H{constructor(){super();this.__registerHost();this.__attachShadow();this.calciteTableSelect=e.createEvent(this,"calciteTableSelect",6);this.calciteTablePageChange=e.createEvent(this,"calciteTablePageChange",6);this.calciteInternalTableRowFocusChange=e.createEvent(this,
"calciteInternalTableRowFocusChange",6);this.getSlottedRows=a=>a?.assignedElements({flatten:!0})?.filter(b=>b?.matches("calcite-table-row"));this.updateRows=()=>{const a=this.getSlottedRows(this.tableHeadSlotEl)||[],b=this.getSlottedRows(this.tableBodySlotEl)||[],c=this.getSlottedRows(this.tableFootSlotEl)||[],f=[...a,...b,...c];a?.forEach(d=>{const g=a?.indexOf(d);d.rowType="head";d.positionSection=g;d.positionSectionLocalized=this.localizeNumber((g+1).toString())});b?.forEach(d=>{const g=b?.indexOf(d);
d.rowType="body";d.positionSection=g;d.positionSectionLocalized=this.localizeNumber((g+1).toString())});c?.forEach(d=>{const g=c?.indexOf(d);d.rowType="foot";d.positionSection=g;d.positionSectionLocalized=this.localizeNumber((g+1).toString())});f?.forEach(d=>{d.interactionMode=this.interactionMode;d.selectionMode=this.selectionMode;d.bodyRowCount=b?.length;d.positionAll=f?.indexOf(d);d.numbered=this.numbered;d.scale=this.scale;d.readCellContentsToAT=this.readCellContentsToAT;d.lastVisibleRow=f?.indexOf(d)===
f.length-1});this.colCount=a[0]?.cellCount||a[0]?.querySelectorAll("calcite-table-header")?.length;this.headRows=a;this.bodyRows=b;this.footRows=c;this.allRows=f;this.updateSelectedItems();this.paginateRows()};this.handlePaginationChange=()=>{this.pageStartRow=this.paginationEl?.startItem||1;this.calciteTablePageChange.emit();this.updateRows()};this.paginateRows=()=>{this.bodyRows?.forEach(a=>{const b=a.positionSection+1,c=b>=this.pageStartRow&&b<this.pageStartRow+this.pageSize;a.hidden=0<this.pageSize&&
!c&&!this.footRows.includes(a);a.lastVisibleRow=b===this.pageStartRow+this.pageSize-1||b===this.bodyRows.length})};this.updateSelectedItems=a=>{const b=this.bodyRows?.filter(c=>c.selected);this.selectedItems=b;this.selectedCount=b?.length;this.allRows?.forEach(c=>{c.selectedRowCount=this.selectedCount;c.selectedRowCountLocalized=this.localizeNumber(this.selectedCount)});a&&this.calciteTableSelect.emit()};this.handleDeselectAllRows=()=>{this.bodyRows?.forEach(a=>{a.selected=!1});this.updateSelectedItems(!0)};
this.setSelectedItems=a=>{this.bodyRows?.forEach(b=>{b.selected="head"===a?.rowType?this.selectedCount!==this.bodyRows?.length:a===b?!b.selected:"multiple"===this.selectionMode?b.selected:!1});this.updateSelectedItems(!0)};this.localizeNumber=a=>{l.numberStringFormatter.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};return l.numberStringFormatter.localize(a.toString())};this.bordered=!1;this.caption=void 0;this.groupSeparator=
!1;this.interactionMode="interactive";this.layout="auto";this.numbered=!1;this.numberingSystem=void 0;this.pageSize=0;this.scale="m";this.selectionMode="none";this.striped=this.zebra=!1;this.selectedItems=[];this.messageOverrides=this.messages=void 0;this.colCount=0;this.pageStartRow=1;this.selectedCount=0;this.defaultMessages=this.readCellContentsToAT=void 0;this.effectiveLocale=""}handleNumberedChange(){this.updateRows()}onMessagesChange(){}effectiveLocaleChange(){p.updateMessages(this,this.effectiveLocale)}async componentWillLoad(){r.setUpLoadableComponent(this);
await p.setUpMessages(this);this.readCellContentsToAT=/safari/i.test(E.getUserAgentString());this.updateRows()}componentDidLoad(){r.setComponentLoaded(this)}connectedCallback(){l.connectLocalized(this);p.connectMessages(this)}disconnectedCallback(){l.disconnectLocalized(this);p.disconnectMessages(this)}calciteChipSelectListener(a){a.composedPath().includes(this.el)&&this.setSelectedItems(a.target)}calciteInternalTableRowFocusEvent(a){const b=a.detail.cellPosition;var c=a.detail.rowPosition;const f=
a.detail.destination;a=a.detail.lastCell;var d=this.bodyRows?.filter(u=>!u.hidden),g=this.allRows?.filter(u=>!u.hidden);const w=this.headRows[this.headRows.length-1]?.positionAll,k=d[0]?.positionAll;d=d[d.length-1]?.positionAll;const h=this.footRows[0]?.positionAll;g=g[g.length-1]?.positionAll;const m="next"===f&&c===w,x="previous"===f&&c===h,n="previous"===f&&c===k,y="next"===f&&c===d;let q;switch(f){case "first":q=0;break;case "last":q=g;break;case "next":q=m?k:y?h:c+1;break;case "previous":q=x?
d:n?w:c-1}c=this.allRows?.find(u=>u.positionAll===q)?.cellCount;void 0!==q&&this.calciteInternalTableRowFocusChange.emit({cellPosition:b>c?c:b,rowPosition:q,destination:f,lastCell:a})}renderSelectionArea(){const a=this.selectedItems?.filter(d=>d.hidden)?.length,b=this.localizeNumber(a?.toString()),c=`${this.localizeNumber(this.selectedCount?.toString())} ${this.messages.selected}`,f=`${b} ${this.messages.hiddenSelected}`;return e.h("div",{class:"selection-area"},e.h("calcite-chip",{kind:0<this.selectedCount?
"brand":"neutral",scale:this.scale,value:c},c),0<a&&e.h("calcite-chip",{icon:"hide-empty",scale:this.scale,title:f,value:f},b),0<this.selectedCount&&e.h("calcite-button",{"icon-start":"x",kind:"neutral",onClick:this.handleDeselectAllRows,round:!0,scale:this.scale,title:`${this.messages.clear} ${c} ${this.messages.row}`},this.messages.clear),e.h("div",{class:"selection-actions"},e.h("slot",{name:"selection-actions"})))}renderPaginationArea(){return e.h("div",{class:"pagination-area"},e.h("calcite-pagination",
{groupSeparator:this.groupSeparator,numberingSystem:this.numberingSystem,onCalcitePaginationChange:this.handlePaginationChange,pageSize:this.pageSize,scale:this.scale,startItem:1,totalItems:this.bodyRows?.length,ref:a=>this.paginationEl=a}))}renderTHead(){return e.h("thead",null,e.h("slot",{name:"table-header",onSlotchange:this.updateRows,ref:a=>this.tableHeadSlotEl=a}))}renderTBody(){return e.h("tbody",null,e.h("slot",{onSlotchange:this.updateRows,ref:a=>this.tableBodySlotEl=a}))}renderTFoot(){return e.h("tfoot",
null,e.h("slot",{name:"table-footer",onSlotchange:this.updateRows,ref:a=>this.tableFootSlotEl=a}))}render(){return e.h(e.Host,{key:"ef7ccc8c38ffa6a1f2168194360d210d95c93586"},e.h("div",{key:"5e6c5971b1175ea268c863b394295024d27b30da",class:"container"},"none"!==this.selectionMode&&this.renderSelectionArea(),e.h("div",{key:"668438589e52c53f20d9a9c97fd732bb5a423175",class:{bordered:this.bordered,striped:this.striped||this.zebra,["table-container"]:!0}},e.h("table",{key:"c8b35b353d207b4eab3a973a242e38c67642bba3",
"aria-colcount":this.colCount,"aria-multiselectable":"multiple"===this.selectionMode,"aria-rowcount":this.allRows?.length,class:{["table--fixed"]:"fixed"===this.layout},role:"interactive"===this.interactionMode?"grid":"table"},e.h("caption",{key:"1f5b24d93dc5a715f946e38e3dde002b7ba614ff",class:"assistive-text"},this.caption),this.renderTHead(),this.renderTBody(),this.renderTFoot())),0<this.pageSize&&this.renderPaginationArea()))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{groupSeparator:["handleNumberedChange"],
interactionMode:["handleNumberedChange"],numbered:["handleNumberedChange"],numberingSystem:["handleNumberedChange"],pageSize:["handleNumberedChange"],scale:["handleNumberedChange"],selectionMode:["handleNumberedChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return":host([scale\x3ds]){--calcite-internal-table-cell-padding:0.25rem;--calcite-internal-table-cell-font-size:var(--calcite-font-size--2);--calcite-internal-table-cell-font-size-secondary:var(--calcite-font-size--3)}:host([scale\x3dm]){--calcite-internal-table-cell-padding:0.5rem;--calcite-internal-table-cell-font-size:var(--calcite-font-size--1);--calcite-internal-table-cell-font-size-secondary:var(--calcite-font-size--2)}:host([scale\x3dl]){--calcite-internal-table-cell-padding:1rem;--calcite-internal-table-cell-font-size:var(--calcite-font-size-0);--calcite-internal-table-cell-font-size-secondary:var(--calcite-font-size--1)}:host{display:flex}.container{display:flex;block-size:100%;inline-size:100%;flex-direction:column}.table-container{overflow:auto;white-space:nowrap;border:1px solid var(--calcite-color-border-3)}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}table{inline-size:100%;border-collapse:collapse;overflow-x:scroll}.table--fixed{table-layout:fixed}.bordered ::slotted(calcite-table-row){--calcite-table-row-border-color:var(--calcite-color-border-3)}.striped ::slotted(calcite-table-row:nth-child(2n+1)){--calcite-table-row-background:var(--calcite-color-foreground-2)}.selection-actions{display:flex;flex-direction:row;margin-inline-start:auto}.selection-area{display:flex;flex-direction:row;align-items:center;padding-block:var(--calcite-internal-table-cell-padding)}.selection-area calcite-chip:last-of-type{margin-inline-end:0.5rem}.selection-area calcite-chip:last-of-type:not(:first-of-type){margin-inline-start:0.5rem}.selection-area calcite-button{margin-inline-end:1rem}.pagination-area{display:flex;inline-size:100%;flex-direction:row;justify-content:center;padding-block:var(--calcite-internal-table-cell-padding)}calcite-pagination{flex:1;justify-content:center}:host([hidden]){display:none}[hidden]{display:none}"}},
[1,"calcite-table",{bordered:[516],caption:[1],groupSeparator:[516,"group-separator"],interactionMode:[513,"interaction-mode"],layout:[513],numbered:[516],numberingSystem:[513,"numbering-system"],pageSize:[514,"page-size"],scale:[513],selectionMode:[513,"selection-mode"],zebra:[516],striped:[516],selectedItems:[1040],messages:[1040],messageOverrides:[1040],colCount:[32],pageStartRow:[32],selectedCount:[32],readCellContentsToAT:[32],defaultMessages:[32],effectiveLocale:[32]},[[0,"calciteTableRowSelect",
"calciteChipSelectListener"],[0,"calciteInternalTableRowFocusRequest","calciteInternalTableRowFocusEvent"]],{groupSeparator:["handleNumberedChange"],interactionMode:["handleNumberedChange"],numbered:["handleNumberedChange"],numberingSystem:["handleNumberedChange"],pageSize:["handleNumberedChange"],scale:["handleNumberedChange"],selectionMode:["handleNumberedChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);C();z.CalciteTable=D;z.defineCustomElement=C;Object.defineProperty(z,
Symbol.toStringTag,{value:"Module"})});