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.
 
 

11 lines
4.1 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","./dom"],function(h,A,m){function B(a){return`${a.split("-").map((b,d)=>0===d?b:`${b[0].toUpperCase()}${b.slice(1)}`).join("")}${C.includes(a)?"Input":"Change"}`}function D(a,b){if(m.closestElementCrossShadowBoundary(b.parentElement,"[form]"))return!0;let d=!1;a.addEventListener("calciteInternalFormComponentRegister",c=>{d=c.composedPath().some(e=>r.has(e));c.stopPropagation()},{once:!0});b.dispatchEvent(new CustomEvent("calciteInternalFormComponentRegister",
{bubbles:!0,composed:!0}));return d}function E(a,{status:b,message:d,icon:c}){"status"in a&&(a.status=b);"validationIcon"in a&&"string"!==typeof a.validationIcon&&(a.validationIcon=c);"validationMessage"in a&&!a.validationMessage&&(a.validationMessage=d)}function v(a){return"CALCITE-RADIO-BUTTON"===a.nodeName?m.closestElementCrossShadowBoundary(a,"calcite-radio-button-group"):a}function w(a){const b=a?.target,d=b?.validationMessage,c=v(b?.parentElement);if(c){var e=c?.nodeName?.toLowerCase(),k=e?.split("-");
2>k.length||"calcite"!==k[0]||(a?.preventDefault(),"validity"in c&&(c.validity=b?.validity),c.dispatchEvent(F),E(c,{message:d,icon:!0,status:"invalid"}),a=B(e),c.addEventListener(a,()=>{"status"in c&&(c.status="idle");"validationIcon"in c&&!c.validationIcon&&(c.validationIcon=!1);"validationMessage"in c&&c.validationMessage===d&&(c.validationMessage="");"validity"in c&&(c.validity=b?.validity)},{once:!0}))}}function x(a){const {el:b,form:d}=a;return d?m.queryElementRoots(b,{id:d}):m.closestElementCrossShadowBoundary(b,
"form")}function G(){"status"in this&&(this.status="idle");"validationIcon"in this&&(this.validationIcon=!1);"validationMessage"in this&&(this.validationMessage="");"checked"in this?this.checked=this.defaultChecked:this.value=this.defaultValue}function H(a){const {el:b,formEl:d,name:c,value:e}=a,{ownerDocument:k}=b,n=b.querySelectorAll('input[slot\x3d"hidden-form-input"]');if(d&&c){var p=Array.isArray(e)?e:[e],l=[],y=new Set;n.forEach(f=>{const g=p.find(I=>I==f.value);null!=g?(y.add(g),z(a,f,g)):
l.push(f)});var q;p.forEach(f=>{if(!y.has(f)){var g=l.pop();g||(g=k.createElement("input"),g.slot="hidden-form-input");q||=k.createDocumentFragment();q.append(g);g.addEventListener("input",t);z(a,g,f)}});q&&b.append(q);l.forEach(f=>{f.removeEventListener("input",t);f.remove()})}else n.forEach(f=>{f.removeEventListener("input",t);f.remove()})}function z(a,b,d){const {defaultValue:c,disabled:e,form:k,name:n,required:p}=a;b.defaultValue=c;b.disabled=e;b.name=n;b.required=p;b.tabIndex=-1;k?b.setAttribute("form",
k):b.removeAttribute("form");"checked"in a?(b.checked=a.checked,b.defaultChecked=a.defaultChecked,b.value=a.checked?d||"on":""):b.value=d||"";a.syncHiddenFormInput?.(b);if((a=v(a.el))&&"validity"in a)for(const l in{...b?.validity})a.validity[l]=b.validity[l]}const C=["calcite-input","calcite-input-number","calcite-input-text","calcite-text-area"],u=new WeakMap,r=new WeakSet,F=new CustomEvent("calciteInvalid",{bubbles:!0,composed:!0}),t=a=>{a.target.dispatchEvent(new CustomEvent("calciteInternalHiddenInputInput",
{bubbles:!0}))};h.HiddenFormInputSlot=({component:a})=>{H(a);return A.h("slot",{name:"hidden-form-input"})};h.afterConnectDefaultValueSet=function(a,b){a.defaultValue=b};h.connectForm=function(a){const {el:b,value:d}=a,c=x(a);if(c&&!D(c,b)){a.formEl=c;a.defaultValue=d;"checked"in a&&(a.defaultChecked=a.checked);var e=(a.onFormReset||G).bind(a);c.addEventListener("reset",e);u.set(a.el,e);r.add(b)}};h.disconnectForm=function(a){const {el:b,formEl:d}=a;if(d){var c=u.get(b);d.removeEventListener("reset",
c);u.delete(b);a.formEl=null;r.delete(b)}};h.findAssociatedForm=x;h.internalHiddenInputInputEvent="calciteInternalHiddenInputInput";h.resetForm=function(a){a.formEl?.reset()};h.submitForm=function(a){const {formEl:b}=a;if(!b)return!1;b.addEventListener("invalid",w,!0);b.requestSubmit();b.removeEventListener("invalid",w,!0);requestAnimationFrame(()=>{const d=b.querySelectorAll("[status\x3dinvalid]");for(const c of d)if(c?.validationMessage){c?.setFocus();break}});return!0}});