12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{neverReached as t}from"../core/compilerUtils.js";import{isSome as i,isNone as a}from"../core/maybe.js";import{watch as s}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/accessorSupport/ensureType.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{getDomainRange as r}from"../layers/support/domainUtils.js";import{getFieldRange as o}from"../layers/support/fieldUtils.js";import u from"./Widget.js";import d from"./FeatureForm/FeatureFormViewModel.js";import{Heading as p,incrementHeadingLevel as c}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import{vmEvent as h}from"./support/decorators/vmEvent.js";import{tsx as f}from"./support/jsxFactory.js";import{DateTime as _}from"luxon";import{getLocale as g}from"../intl/locale.js";const v={base:"esri-feature-form",form:"esri-feature-form__form",formHeader:"esri-feature-form__form-header",label:"esri-feature-form__label",inputFieldWrapper:"esri-feature-form__input-wrapper",inputFieldLoader:"esri-feature-form__input-loader",inputField:"esri-feature-form__input",inputDate:"esri-feature-form__input--date",inputTime:"esri-feature-form__input--time",inputRadioGroup:"esri-feature-form__input--radio-group",inputRadio:"esri-feature-form__input--radio",inputRadioLabel:"esri-feature-form__input--radio-label",inputDisabled:"esri-feature-form__input--disabled",inputSwitch:"esri-feature-form__input--switch",inputInvalid:"esri-feature-form__input--invalid",inputIconInvalid:"esri-feature-form__input-icon--invalid",errorMessage:"esri-feature-form__field-error-message",description:"esri-feature-form__description-text",dateInputPart:"esri-feature-form__date-input-part",loneDateInputPart:"esri-feature-form__date-input-part--lone",dateInputContainer:"esri-feature-form__date-input-container",dateFormatHint:"esri-feature-form__date-format-hint",group:"esri-feature-form__group",groupLabel:"esri-feature-form__group-label",groupHeader:"esri-feature-form__group-header",groupHeading:"esri-feature-form__group-header",groupTitle:"esri-feature-form__group-title",groupDescription:"esri-feature-form__group-description",groupToggleIcon:"esri-feature-form__group-toggle-icon",groupCollapsed:"esri-feature-form__group--collapsed",groupSequential:"esri-feature-form__group--sequential",groupActive:"esri-feature-form__group--active",collapseIcon:"esri-icon-up",errorIcon:"esri-icon-notice-triangle",expandIcon:"esri-icon-down",widget:"esri-widget",panel:"esri-widget--panel",input:"esri-input",select:"esri-select"},b={datePattern:"D",timePattern:"tt"};function F(e){return e&&e.inputFields}const I="data-field-name";let y=class extends u{constructor(e,t){super(e,t),this._activeDateFieldEdit=null,this._activeInputName=null,this._activeNumberFieldEdit=null,this._fieldFocusNeeded=!1,this._fieldToInitialIncompatibleDomainValue=new Map,this._switchFieldsWithInitialIncompatibleValue=new Set,this._userUpdatedInputFieldNames=new Set,this.disabled=!1,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesTemplates=null,this.viewModel=new d,this._handleRadioInputChange=e=>{this._commitInputValue(e.target)},this._handleInputInput=e=>{this._commitInputValue(e.currentTarget,!0)},this._handleFormKeyDown=this._handleFormKeyDown.bind(this),this._handleInputBlur=this._handleInputBlur.bind(this),this._handleInputFocus=this._handleInputFocus.bind(this),this._handleNumberInputMouseDown=this._handleNumberInputMouseDown.bind(this),this._handleInputKeyDown=this._handleInputKeyDown.bind(this),this._handleOptionChange=this._handleOptionChange.bind(this),this._handleGroupClick=this._handleGroupClick.bind(this),this._handleSubmit=this._handleSubmit.bind(this),this._afterInputCreateOrUpdate=this._afterInputCreateOrUpdate.bind(this)}initialize(){this.addHandles([s((()=>this.feature),(()=>{const e=this._getFocusableInput("forward");this._activeInputName=e&&e.name,this._userUpdatedInputFieldNames.clear(),this._fieldToInitialIncompatibleDomainValue.clear(),this._switchFieldsWithInitialIncompatibleValue.clear(),this._fieldFocusNeeded=!0})),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._userUpdatedInputFieldNames.add(e))),this._activeInputName=t,this._fieldFocusNeeded=!0,this.scheduleRender()}}))])}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-combobox.js"),import("@esri/calcite-components/dist/components/calcite-combobox-item.js"),import("@esri/calcite-components/dist/components/calcite-combobox-item-group.js"),import("@esri/calcite-components/dist/components/calcite-input-message.js"),import("@esri/calcite-components/dist/components/calcite-progress.js"),import("@esri/calcite-components/dist/components/calcite-switch.js")])}destroy(){this._userUpdatedInputFieldNames.clear(),this._userUpdatedInputFieldNames=null}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return f("div",{class:this.classes(v.base,v.widget,v.panel)},"ready"===e?this.renderForm():null)}renderForm(){const{formTemplate:e}=this,t=i(e)&&e.title&&f(p,{key:"title",level:this.headingLevel},e.title),a=i(e)&&e.description&&f("p",{class:v.description,key:"description"},e.description),s=t||a?f("div",{class:v.formHeader},t,a):null;return f("form",{class:v.form,novalidate:!0,onsubmit:this._handleSubmit,onkeydown:this._handleFormKeyDown},s,this.renderFields())}renderFields(){const{viewModel:{inputFields:e}}=this;return e.filter((e=>e.visible)).map(((e,t)=>F(e)?this.renderGroup(e,t):this.renderLabeledField(e)))}renderGroup(e,t){const{formTemplate:a,disabled:s}=this,{description:n,inputFields:l,label:r,state:o}=e,u=l.filter((e=>e.visible)),d=this.viewModel.findField(this._activeInputName),m=!(!d||d.group!==e),h=`${this.id}_group_${t}`,_=`${this.id}_group-label_${t}`,g=`${this.id}_group-description_${t}`,b=n?f("p",{class:this.classes(v.groupDescription,v.description),id:g},n):null,F="sequential"===this.groupDisplay,I=F?m:"expanded"===o,y=I?v.collapseIcon:v.expandIcon;return f("fieldset",{"aria-expanded":I.toString(),"aria-labelledby":_,"aria-describedby":n?g:"",class:this.classes(v.group,F?v.groupSequential:null,I?null:v.groupCollapsed,m?v.groupActive:null,s?v.inputDisabled:null),disabled:s,"data-group":e,id:h,key:t,onclick:this._handleGroupClick},f("button",{role:F?"presentation":void 0,class:v.groupHeader,type:"button",tabIndex:F?-1:0},f("div",{class:v.groupTitle},f(p,{class:v.groupLabel,id:_,level:i(a)&&a.title?c(this.headingLevel):this.headingLevel},r),b),F?null:f("span",{class:this.classes(y,v.groupToggleIcon)})),u.map((e=>this.renderLabeledField(e))))}_getFocusableInput(e,t){const i=this.viewModel.allInputFields,a="forward"===e?i:i.slice().reverse();let s;if(t)if(F(t))s=a.indexOf(t.inputFields[0]);else{let i;if(this._isInputFieldInGroup(t)&&"collapsed"===t.group.state){const{inputFields:a}=t.group;i="forward"===e?a[a.length-1]:a[0]}else i=t;s=a.indexOf(i)+1}else s=0;for(let n=s;n<a.length;n++){const e=a[n];if(e.visible)return e}return null}renderLabeledField(e){const{feature:t,label:i,layer:a,type:s}=e;return f("label",{key:`${a.id}-${t.uid}-${e.name}`,class:v.label},[i,"unsupported"!==s?this.renderInputField(e):this.renderUnsupportedField(e),this.renderAuxiliaryText(e)])}renderInputField(e){const{domain:t,name:a,type:s,updating:n,value:l}=e,r=this.getCommonInputProps(e);if("coded-value"===t?.type){if(this._inputFieldHasInputType(e,"switch")){const{fieldElement:t}=e;if(!(this._switchFieldsWithInitialIncompatibleValue.has(a)||null==l||t.input.onValue!==l&&t.input.offValue!==l))return this.renderSwitchInputField(e,r);this._switchFieldsWithInitialIncompatibleValue.add(a)}return"radio-buttons"===e.inputType?this.renderRadioButtonsInputField(e,t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),r):this.renderSelectInputField(e,this._getFieldValueOptions(a,t),r)}if("datetime-picker"===e.inputType||"date"===s)return this.renderDateInputField(e,r);const o="number"===s?f("input",{type:"number",...r,value:i(this._activeNumberFieldEdit)&&this._activeNumberFieldEdit.fieldName===e.name?this._activeNumberFieldEdit.value:`${r.value}`}):"text-area"===e.inputType?f("textarea",{...r}):f("input",{type:"text",...r});return n?f("div",{class:v.inputFieldWrapper},o,f("div",{class:v.inputFieldLoader},f("calcite-progress",{type:"indeterminate"}))):o}_parseDateTime(e,t,i){if(i){let a=_.fromJSDate(this._parseDate(e,i));const s=_.fromMillis(t.value??Date.now());return a="date"===i?a.set({hour:s.hour,minute:s.minute,second:s.second}):a.set({day:s.day,month:s.month,year:s.year}),a.isValid?a.toMillis():null}const a=_.fromJSDate(this._parseDate(e));return a.isValid?a.toMillis():null}renderDateInputField(e,t){const{value:i,includeTime:a}=e,{date:s,time:n}=this._formatDate(0),l=`${this.id}-${t.key}`,r=`${l}-date`,o=`${l}-time`,{_activeDateFieldEdit:u}=this;let{date:d,time:p}=this._formatDate(i);return u?.fieldName===e.name&&(d=u.date.input?.value??d,p=u.time.input?.value??p),f("div",{key:`${t.key}-date`,class:v.dateInputContainer},f("div",{class:this.classes(v.dateInputPart,a?null:v.loneDateInputPart)},f("input",{"aria-label":e.label,"aria-describedby":r,type:"text",...t,"data-date-part":"date",class:this.classes(t.class,v.inputDate),value:d}),f("div",{class:v.dateFormatHint,id:r},s)),a?f("div",{class:v.dateInputPart,key:"time-input"},f("input",{"aria-describedby":o,"aria-label":e.label,type:"text",...t,"data-date-part":"time",class:this.classes(t.class,v.inputTime),value:p}),f("div",{class:v.dateFormatHint,id:o},n)):null)}renderUnsupportedField(e){const t=this.getCommonInputProps(e);return f("input",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,disabled:t.disabled,class:this.classes(v.input,v.inputField,v.inputDisabled),onfocus:t.onfocus,readOnly:!0,tabIndex:t.tabIndex,type:"text",value:t.value,[I]:t[I]})}renderSelectInputField(e,t,i){const{value:s}=e,{messages:n,messagesTemplates:l}=this,r=t.map((e=>e.map((e=>f("calcite-combobox-item",{value:`${e.value}`,"text-label":e.name,key:`#${e.value}`,selected:s===e.value}))))),[o,u]=r;this._registerIncompatibleValue(s,t.flat(),e,(e=>{u.unshift(f("calcite-combobox-item",{value:`${e}`,"text-label":`${e}`,key:"incompatible-option",readOnly:!0}))}));const d=u.length>0?[f("calcite-combobox-item-group",{key:"recommended",label:n.recommended},o),f("calcite-combobox-item-group",{key:"other",label:l.other},u)]:o,p=a(e.fieldElement)||this._inputFieldHasInputType(e,"combo-box")&&e.fieldElement.input.showNoValueOption;if(!e.required&&p){const t="",i=this._inputFieldHasInputType(e,"combo-box")&&e.fieldElement.input.noValueOptionLabel||this.messages.empty;d.unshift(f("calcite-combobox-item",{value:t,"text-label":this.messages.empty,key:"empty-option"},i))}return f("calcite-combobox",{...i,"selection-mode":"single","overlay-positioning":"fixed",disabled:i.disabled||i.readOnly,allowCustomValues:!1,onCalciteComboboxChange:e=>this._handleOptionChange(e.target)},d)}_registerIncompatibleValue(e,t,i,a){const s=this._fieldToInitialIncompatibleDomainValue,n=s.has(i.name);(n||null!=e&&""!==e&&!t.some((t=>t.value===e))||n)&&(n||s.set(i.name,e),a?.(s.get(i.name)))}renderRadioButtonsInputField(e,t,i){const{value:s}=e,n=t.map((t=>this.renderRadioButton({key:t.name,label:t.name,name:e.name,value:t.value,selected:t.value===s,props:i})));this._registerIncompatibleValue(s,t,e);const l=a(e.fieldElement)||this._inputFieldHasInputType(e,"radio-buttons")&&e.fieldElement.input.showNoValueOption;if(!e.required&&l){const t="",a=this._inputFieldHasInputType(e,"radio-buttons")&&e.fieldElement.input.noValueOptionLabel||this.messages.empty,l=s===t||null===s;n.unshift(this.renderRadioButton({key:"empty-option",label:a,name:e.name,value:t,selected:l,props:i}))}return f("div",{key:`${i.key}-radio`,class:v.inputRadioGroup},n)}renderSwitchInputField(e,t){const{value:i}=e,a=!!this._inputFieldHasInputType(e,"switch")&&i===e.fieldElement.input.onValue;return f("calcite-switch",{...t,class:v.inputSwitch,onCalciteSwitchChange:e=>{this._parseValue(e.currentTarget)},checked:a,disabled:t.disabled||t.readOnly})}renderRadioButton({key:e,name:t,value:i,selected:a,label:s,props:n}){return f("label",{key:e,class:v.inputRadioLabel},f("input",{...n,class:v.inputRadio,name:t,type:"radio",value:i,checked:a,onchange:this._handleRadioInputChange}),s)}renderAuxiliaryText(e){const t=this._userUpdatedInputFieldNames.has(e.name)&&!e.valid?e.errorMessage:i(this.viewModel.contingencyConstraintViolations.get(e.name))?this.messages.validationErrors.valuesIncompatible:i(e.valueExpressionExecutor)&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return i(t)?f("calcite-input-message",{status:"invalid",icon:!0,active:!0},t):e.description?f("div",{key:"description",class:v.description},e.description):void 0}getCommonInputProps(e){const{disabled:t,groupDisplay:a}=this,{editable:s,group:n,hint:l,maxLength:r,minLength:o,name:u,required:d,type:p,valid:c,value:m}=e,h=this._userUpdatedInputFieldNames.has(u),f=!s,_="all"===a&&i(n)&&"collapsed"===n.state;return{afterCreate:this._afterInputCreateOrUpdate,afterUpdate:this._afterInputCreateOrUpdate,"aria-invalid":c?"false":"true",class:this.classes(v.input,v.inputField,t||f?v.inputDisabled:null,h&&!c?v.inputInvalid:null),key:u,label:u,minlength:o>-1?`${o}`:"",maxlength:r>-1?`${r}`:"",...this._getNumberFieldConstraints(e),disabled:t,readOnly:f,value:null==m?"":`${m}`,[I]:u,onfocus:this._handleInputFocus,oninput:this._handleInputInput,onblur:this._handleInputBlur,onkeydown:this._handleInputKeyDown,onmousedown:"number"===p?this._handleNumberInputMouseDown:null,placeholder:"number"===p||"text"===p?l:"",required:d,tabIndex:_?-1:0}}_isInputFieldInGroup(e){return!F(e)&&i(e.group)}_handleNumberInputMouseDown({target:e}){e.focus(),this.scheduleRender()}_getFieldValueOptions(e,t){const i=t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),a=this.viewModel.fieldsWithContingentValues.has(e)?this._getContingentValueOptions(e):[];if(a.length>0){const e=new Set(a.map((e=>e.value)));return[a,i.filter((t=>!e.has(t.value)))]}return[i,[]]}_getContingentValueOptions(e){const t={};for(const n of this.viewModel.allInputFields){const{name:i,value:s}=n;!a(s)&&i!==e&&this.viewModel.fieldsWithContingentValues.has(i)&&(t[i]=s)}const i=this.viewModel.joinedContingentValues.slice(),s=new Map;for(const n of i){const i=n.values[e];if(a(i)||"code"!==i.objectType&&"null"!==i.objectType)continue;const{code:l,name:r}="null"===i.objectType?{code:"",name:this.messages.empty}:i.codedValue;if(s.has(l))continue;Object.entries(t).every((([e,t])=>!n.values.hasOwnProperty(e)||this._valueIsValidContingentValue(t,n.values[e])))&&s.set(l,{name:r,value:l})}return[...s.values()]}_getInputFieldFromInput(e){return this.viewModel.findField(e.getAttribute(I))}_getNumberFieldConstraints(e){const t=r(e.domain)||o(e.field);return t&&t.max!==Number.MAX_VALUE&&t.min!==Number.MIN_VALUE?t:{min:null,max:null}}_afterInputCreateOrUpdate(e){const{viewModel:t}=this,i=this._getInputFieldFromInput(e),a=t.findField(this._activeInputName),s=this._fieldToInitialIncompatibleDomainValue.get(i.name)===i.value;this._fieldFocusNeeded&&a===i&&("radio-buttons"!==i.inputType||s||e.checked)&&(this._fieldFocusNeeded=!1,this._isInputFieldInGroup(i)&&(i.group.state="expanded"),e.focus())}_handleInputFocus(e){const t=e.target,i=this._getInputFieldFromInput(t);this._activeInputName=i.name,"date"===i.type?this._syncDateFieldEdits(t):this._isNumberInputField(i)&&this._setUpNumberFieldEdit(t)}_isNumberInputField({domain:e,inputType:t="text-box",type:i}){return"number"===i&&"text-box"===t&&(!e||"coded-value"!==e.type)}_handleInputBlur(e){const t=e.target,a=this._getInputFieldFromInput(t);if("date"===a.type){const i=e.relatedTarget,s=i&&this._getInputFieldFromInput(i);if(s&&"date"===a.type&&"date"===s.type&&a.field===s.field){if(""!==t.value&&""===i.value){const s=i.getAttribute("data-date-part");i.value=this._formatDate(a.value??Date.now())[s],this._parseDate(t.value,t.getAttribute("data-date-part"))&&this._commitInputValue(e.target,!0,!1)}return}}"number"===a.type&&i(this._activeNumberFieldEdit)&&(this._activeNumberFieldEdit.input.value=`${a.value}`,this._activeNumberFieldEdit=null),this._commitInputValue(t),this.scheduleRender()}_commitInputValue(e,t=!1,a=!0){const s=this._getInputFieldFromInput(e);if(this._activeDateFieldEdit){const{date:i,time:n}=this._activeDateFieldEdit,l=this._parseDateTime(e.value,s,i.active?"date":"time"),r=null!==this.viewModel.getValue(s.name),o=i.input&&(n.input||!s.includeTime),u=null===l;if(t){if(u)return;(o||!a||r)&&this._updateDateFieldValue(s,l)}else{if(""===i.input?.value||""===n.input?.value)this._updateDateFieldValue(s,null);else if(o){const e=`${i.input.value} ${n.input?.value??""}`,t=this._parseDateTime(e,s);!(null!==t)&&r||this._updateDateFieldValue(s,t)}this._activeDateFieldEdit=null}}else i(this._activeNumberFieldEdit)&&this._isNumberInputField(s)&&(this._activeNumberFieldEdit.value=e.value),this._updateFieldValue(e)}_handleInputKeyDown(e){const{key:t,altKey:i,ctrlKey:a,metaKey:s}=e,n=this._getInputFieldFromInput(e.target);if("Enter"===t)this._isInputFieldInGroup(n)&&"collapsed"===n.group.state&&(n.group.state="expanded");else{const{type:l}=n.field,r="single"===l||"double"===l,o=!i&&!a&&!s;if(("integer"===l||"small-integer"===l||r)&&o&&1===t.length){const i=Number(t),a=["-","+"],s=["e","."],n=r?[...a,...s]:a;isNaN(i)&&!n.includes(t)&&e.preventDefault()}}}_setUpNumberFieldEdit(e){const t=this._getInputFieldFromInput(e);this._activeNumberFieldEdit={fieldName:t.name,input:e,value:e.value}}_syncDateFieldEdits(e){const t=this._getInputFieldFromInput(e);if("date"!==t.type)return;const i=e.getAttribute("data-date-part"),a="date"===i?{value:e.value,input:e,active:!0}:{...this._activeDateFieldEdit?.date,active:!1},s="time"===i?{value:e.value,input:e,active:!0}:{...this._activeDateFieldEdit?.time,active:!1};this._activeDateFieldEdit={fieldName:t.name,date:a,time:s}}_updateFieldValue(e){const t=e.getAttribute(I);if(this.viewModel.setValue(t,this._parseValue(e)),this._userUpdatedInputFieldNames.add(t),this.viewModel.fieldsWithContingentValues.has(t)){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>i(t))));this.viewModel.validateContingencyConstraints(e)}}_updateDateFieldValue(e,t){this.viewModel.setValue(e.name,t),this._userUpdatedInputFieldNames.add(e.name)}_parseValue(e){const t=this._getInputFieldFromInput(e),i=e.value;if(this._inputFieldHasInputType(t,"switch")&&"CALCITE-COMBOBOX"!==e.tagName)return e.checked?t.fieldElement.input.onValue:t.fieldElement.input.offValue;if("radio-buttons"===t.inputType&&"radio"===e.type&&!e.checked)return t.value;const{type:a}=t;if("number"===a)return i?parseFloat(i):null;if("date"===a){if(!i)return null;const a=Number(i);if(!isNaN(a))return a;const s=e.getAttribute("data-date-part"),n=this._parseDate(i,s);if(!n)return null;let l=_.fromJSDate(n);const r=t.domain,o=_.now();let u=o;if(r&&"range"===r.type){const e=_.fromMillis(r.maxValue);o<e&&(u=e)}const d=this.viewModel.getValue(t.name),p=null!=d?_.fromMillis(d):u;return l="date"===s?l.set({hour:p.hour,minute:p.minute,second:p.second}):l.set({day:p.day,month:p.month,year:p.year}),l.toMillis()}return i}_handleOptionChange(e){this._commitInputValue(e),this.scheduleRender()}_handleGroupClick(e){const t=e.currentTarget["data-group"],i="expanded"===t.state,a="sequential"===this.groupDisplay,s=`.${v.groupHeader}`;if(!(i&&!e.target.closest(s))){if(this._activeInputName=this._getFocusableInput("forward",t)?.name,a){const a=e.target.closest(s);if(i&&!a)return;this.viewModel.inputFields.forEach((e=>{F(e)&&e!==t&&(e.state="collapsed")}))}t.state=i?"collapsed":"expanded",this._fieldFocusNeeded=a,this.scheduleRender()}}_handleSubmit(e){e.preventDefault()}_handleFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_formatDate(e){if(null==e)return{date:"",time:""};const t=_.fromMillis(e,{locale:g(),numberingSystem:"latn"});return{date:t.toLocaleString({year:"numeric",month:"2-digit",day:"2-digit"}),time:t.toFormat(b.timePattern)}}_parseDate(e,t){if(null==e||""===e)return null;const{timePattern:i,datePattern:a}=b,s=t?"date"===t?a:i:`${a} ${i}`,n=_.fromFormat(e,s,{locale:g(),numberingSystem:"latn"});return n.isValid?n.toJSDate():null}_inputFieldHasInputType(e,t){return i(e.fieldElement)&&e.fieldElement.input?.type===t}_valueIsValidContingentValue(e,i){switch(i.objectType){case"any":return!0;case"null":return null==e;case"code":return e===i.codedValue?.code;case"range":return e>=i.minValue&&e<=i.maxValue;default:return t(i.objectType),!1}}};e([n()],y.prototype,"disabled",void 0),e([n()],y.prototype,"feature",null),e([n()],y.prototype,"formTemplate",null),e([n()],y.prototype,"groupDisplay",void 0),e([n()],y.prototype,"headingLevel",void 0),e([n()],y.prototype,"label",null),e([n()],y.prototype,"layer",null),e([n(),m("esri/widgets/FeatureForm/t9n/FeatureForm")],y.prototype,"messages",void 0),e([n(),m("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],y.prototype,"messagesTemplates",void 0),e([n()],y.prototype,"spatialReference",null),e([n()],y.prototype,"strict",null),e([n()],y.prototype,"view",null),e([n(),h(["value-change","submit"])],y.prototype,"viewModel",void 0),y=e([l("esri.widgets.FeatureForm")],y);const w=y;export{w as default};
|