@arcgis/core 5.2.0-next.90 → 5.2.0-next.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/24a6b28db94e07a702a4.js +1 -0
- package/assets/esri/core/workers/chunks/9246e2468528650bdc7c.js +1 -0
- package/assets/esri/core/workers/chunks/9509bef285929c52c244.js +1 -0
- package/assets/esri/core/workers/chunks/ad404195107eadf91e16.js +1 -0
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/kernel.js +1 -1
- package/layers/ImageryTileLayer.d.ts +20 -20
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/MapImageLayer.d.ts +20 -21
- package/layers/catalog/CatalogFootprintLayer.d.ts +1 -1
- package/layers/mixins/FeatureLayerBase.d.ts +20 -21
- package/layers/support/DateTimeFieldFormat.d.ts +1 -1
- package/layers/support/FieldConfiguration.d.ts +1 -1
- package/package.json +4 -4
- package/popup/FeatureContent.d.ts +3 -3
- package/popup/FeatureContentCollection.d.ts +3 -3
- package/popup/FieldInfo.d.ts +18 -12
- package/popup/support/FieldInfoFormat.d.ts +13 -8
- package/portal/Portal.js +1 -1
- package/support/revision.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/effects/raymarching/DistanceFalloff.glsl.js +2 -2
- package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/SceneView.d.ts +64 -1
- package/views/SceneView.js +1 -1
- package/views/View2D.d.ts +17 -4
- package/views/support/LayerLayerViewInfo.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/webmap/InitialViewProperties.d.ts +1 -1
- package/webscene/SunLighting.d.ts +3 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +4 -4
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/BatchAttributeForm/inputs/TextElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.d.ts +12 -0
- package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +2 -0
- package/widgets/BatchAttributeForm/inputs/support/controllerUtils.d.ts +5 -0
- package/widgets/BatchAttributeForm/inputs/support/controllerUtils.js +2 -0
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Daylight.d.ts +4 -0
- package/widgets/Editor.d.ts +1 -1
- package/widgets/Feature/FeatureViewModel.d.ts +3 -3
- package/widgets/Feature.d.ts +3 -3
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +3 -3
- package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +1 -0
- package/widgets/FeatureTable.d.ts +1 -1
- package/widgets/Features/FeaturesViewModel.d.ts +3 -3
- package/widgets/Features.d.ts +2 -2
- package/widgets/TimeSlider.d.ts +3 -3
- package/assets/esri/core/workers/chunks/05fbd1f373cfa3724f0c.js +0 -1
- package/assets/esri/core/workers/chunks/27c0bed59626c7f64125.js +0 -1
- package/assets/esri/core/workers/chunks/41cf6163758d28fb1968.js +0 -1
- package/assets/esri/core/workers/chunks/e55507e4114b34d1ef4e.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as i}from"../core/deprecate.js";import a from"../core/Logger.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{destroyMaybe as s}from"../core/maybe.js";import l from"../core/ReactiveMap.js";import{watch as o,when as r,on as c,sync as d}from"../core/reactiveUtils.js";import{formatFileSize as m}from"../core/unitFormatUtils.js";import{property as u,subclass as h}from"../core/accessorSupport/decorators.js";import{formatDate as p}from"../intl/date.js";import{isIntegerField as g}from"../layers/support/fieldUtils.js";import{isString as v}from"../support/guards.js";import b from"./Widget.js";import{getAttachmentTypeCategory as f,getCalciteIconForAttachment as _}from"./Attachments/support/attachmentUtils.js";import{getAttachmentKey as C,isImageAttachment as y,getAttachmentFilenameParts as A}from"./BatchAttributeForm/attachmentUtils.js";import{getHiddenFieldsValidationErrorMessage as w,getVisibleFieldInputValidationErrorMessage as F,isElementTemplateWithInputType as I,subtypeChangeShouldPrompt as k,flattenInputs as M}from"./BatchAttributeForm/batchAttributeFormUtils.js";import x from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as D}from"./BatchAttributeForm/css.js";import{makeViewingEditedAttachmentFooterButtons as S,makeViewingAttachmentFooterButtons as E,makeCancelFooterButton as O,makeDefaultFooterButtons as T}from"./BatchAttributeForm/interfaceUtils.js";import L from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as V,isFieldInput as R,isTextElementInput as N,isRelationshipElementInput as U,isAttachmentElementInput as P,isUtilityNetworkAssociationsElementInput as B,differentValuesString as $,getNormalizedFieldName as z,isGroupedInput as j}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{clearMultipleChoiceOtherChoiceStateForViewModel as H,otherChoiceCheckedPlaceholderValue as W,canRestoreMultipleChoiceOtherChoiceDraftValue as G}from"./BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js";import{loadRelationshipDetailsComponents as Z,RelationshipDetails as q}from"./BatchAttributeForm/rendered-content/RelationshipDetails.js";import{Prompt as K}from"./Editor/components/Prompt.js";import{downloadAttachmentInfo as X}from"./FeatureTable/support/exportUtils.js";import{loadCalciteComponents as J}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as Q,getIntlOptionsForField as Y,prepareISOFieldValueForDateComponents as ee,prepareUnixFieldValueForDateComponents as te,normalizeTimeOnlyString as ie,getISOFieldValueFromDateComponents as ae,getUnixFieldValueFromDateComponents as ne}from"./support/dateUtils.js";import{globalCss as se}from"./support/globalCss.js";import{Heading as le}from"./support/Heading.js";import{calciteListFilterProps as oe}from"./support/listUtils.js";import{messageBundle as re,vmEvent as ce,tsx as de}from"./support/widget.js";import{setFocus as me}from"./support/widgetUtils.js";import{isEmptyValue as ue}from"./support/forms/formUtils.js";const he="data-element-id",pe="data-field-name",ge="esri_BatchAttributeForm_select_all",ve="esri_BatchAttributeForm_other_choice";let be=class extends b{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureFormMessages=null,this.featureTableMessages=null,this.messagesUnits=null,this.viewModel=new x,this.visibleElements=new L,this.groupDisplay="all",this._associationsList=null,this._associationsWidgetsMap=new l,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._pendingSubtypeChoice=null,this._batchSwitchInputInitialValues=new Map,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this.viewModel.activeRelationshipInput?.incrementPage()},{root:window.document}),this._attachmentDialogInfo=null,this._attachmentListFilterText="",this._attachmentFileInputMap=new Map,this._prompt=null,this._selectedAttachmentReplaceFileInput=null,this._afterListObserverCreated=e=>{this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)},this._afterListObserverRemoved=()=>{this._listObserverNode=null},this._maximizeSelectedAttachment=()=>{this._attachmentDialogInfo=this.selectedAttachmentDetails},this._enterAttachmentReplaceView=()=>{const e=this.selectedAttachmentDetails;this._canReplaceSelectedAttachment()&&e&&(e.input.clearValidationCriteriaState(),this.viewModel.setShowingSelectedAttachmentReplacePage(!0))},this._setSelectedAttachmentReplaceFileInput=e=>{this._selectedAttachmentReplaceFileInput=e},this._openSelectedAttachmentReplaceFilePicker=()=>{this._canReplaceSelectedAttachment()&&this._selectedAttachmentReplaceFileInput?.click()},this._resetSelectedAttachmentName=()=>{const e=this.selectedAttachmentDetails;if(!e?.attachment)return;const t=e.input.getAttachmentEditState(e.attachment).initialName;if(null==t)return;const i=e.input.template.elementId,a=C(e.attachment);this.viewModel.stageRenameAttachment(i,a,t)},this._closeAttachmentDialog=()=>{this.hideAttachmentDialog()},this._saveInputFromElement=this._saveInputFromElement.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{i(a.getLogger(this),"Editor","arcgis-editor",{version:"5.0"})})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...i}=e;return i}initialize(){this.addHandles([o(()=>this.features.toArray(),()=>{this._dateComponentMap.clear(),H(this.viewModel,{includeDraftValues:!0})}),o(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear(),this._resetTransientFormState(),H(this.viewModel),this._setFocusableInput()}),o(()=>this.viewModel.selectedAttachmentAddElementId,()=>{this.hideAttachmentDialog()}),r(()=>!this.selectedAttachmentDetails,()=>this.hideAttachmentDialog()),o(()=>this.viewModel.selectedAttachmentListElementId,()=>{this._attachmentListFilterText=""}),o(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),c(()=>this.viewModel,"submit",()=>{this.valid||this.goToFirstError()}),o(()=>[this._associationsEnabled,this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs],()=>this._setUpAssociationsWidgets(),d),o(()=>this.viewModel.activeAssociationsInput,e=>this._onActiveAssociationsInputChange(e)),o(()=>this.groupDisplay,()=>this._syncGroupInputStates())])}loadDependencies(){return Promise.all([J({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")}),Z()])}destroy(){this._destroyAssociationsWidgets(),this._associationsList=s(this._associationsList),this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get effectiveTitle(){const{features:e,messages:t,page:i}=this;return t?"replacing-attachment"===i?t.titles.replaceAttachment:"viewing-attachment-details"===i?t.titles.editAttachment:"adding-attachments"===i?t.titles.addAttachments:"viewing-attachments"===i?t.titles.attachments:1===e.length||this.activeFeatureIndex>-1?t.titles.editFeature:e.length>1?t.titles.editFeatures:"":""}get effectiveDisabled(){return this.disabledOrReadOnly||this.viewModel.updating}get disabledOrReadOnly(){return this.disabled||this.readOnly}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get footerButtonInfos(){if(!this.features.length||!this.messages||!this.messagesCommon)return[];const{messages:e,messagesCommon:t,page:i}=this,a=this.effectiveDisabled;if("adding-attachments"===i||"replacing-attachment"===i)return[];if("viewing-attachment-details"===i){const t=this.selectedAttachmentDetails,i=t?.input?.getAttachmentEditState(t.attachment);if(!t?.input||!i)return[];return i.isRenamed||i.isReplaced?S({doneOnclick:()=>this._setSelectedAttachment(null),messages:e.footerButtons,resetOnclick:()=>this._resetSelectedAttachmentChanges(),resetDisabled:this._disableAttachmentModification(t.input)}):E({deleteDisabled:this._disableAttachmentModification(t.input),deleteOnclick:()=>this._deleteSelectedAttachment(),doneOnclick:()=>this._setSelectedAttachment(null),messages:e.footerButtons})}return"viewing-associated-features"===i?O({messages:t,purpose:"cancel-viewing-associated-features",onclick:()=>this.goBack()}):"viewing-associated-layers"===i?O({messages:t,purpose:"cancel-viewing-associated-layers",onclick:()=>this.goBack()}):"viewing-attachments"===i||"viewing-related-records"===i?[]:T({disabled:a||!this.valid,formId:this._formId,messages:e,callback:()=>this.submit()})}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}get page(){return this.viewModel.page}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}get selectedAttachment(){return this.viewModel.selectedAttachment}get selectedAttachmentDetails(){return this.viewModel.selectedAttachmentDetails}get valid(){return this.viewModel.valid}get _formHeaderVisible(){return!("batch"===this.viewModel.mode||!this.viewModel.activeFeature)&&!(!this.viewModel.formDescription&&!this.viewModel.formTitle)}get _associationsEnabled(){const{callbacks:e}=this;return!(!e?.addAssociation&&!e?.editAssociatedFeature)}get _formId(){return`${this.id}-form`}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!e.addRelatedRecord&&!e.editRelatedRecord)}async goBack(){return this.viewModel.goBack()}async goHome(){return this.viewModel.goHome()}goToFirstError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),this._setFocusableInput(e.input),this.scheduleRender()}render(){return de("div",{class:this.classes(D.base,se.widget,se.panel)},this._renderContent(),this._renderAttachmentDialog(),this._prompt?de(K,{...this._prompt,headingLevel:this.headingLevel}):void 0)}setActiveAssociationsInput(e){this.viewModel.setActiveAssociationsInput(e)}setActiveAssociationsLayer(e){this.viewModel.setActiveAssociationsLayer(e)}setActiveAssociationType(e){this.viewModel.setActiveAssociationType(e)}submit(){return this.viewModel.submit()}get test(){return{saveInput:this._saveInput.bind(this),pendingSubtypeChoice:this._pendingSubtypeChoice}}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:i}=e.dataset,a=n(this._dateComponentMap,`${i}`,()=>({}));switch(t){case"date":a.date=e;break;case"time":a.time=e;break;case"timeZone":a.timeZone=e}}_renderContent(){const{messages:e,viewModel:i}=this,{status:a}=i;return"failed"===a?i.hasTooManyComplexFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyComplexFeatures,{num:i.maximumFeatureCountWithComplexForms})):i.hasTooManyFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyFeatures,{num:i.maximumFeatureCount})):e.formFailedToLoad:i.hasLayersWithContingentValues&&this.viewModel.features.length>1?this._renderErrorNotice(e.unsupportedContingentValues):"loading"===a&&this.visibleElements.loadingIndicator?de("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):0!==this.features.length?this._renderForm():void 0}_renderErrorNotice(e,t="warning"){return de("calcite-notice",{class:D.noticeError,icon:!0,kind:t,open:!0},de("div",{slot:"message"},e))}_renderForm(){return de("form",{class:D.form,id:this._formId,inert:!!this._prompt,onsubmit:this._onFormSubmit},this.viewModel.expressionEvaluationFailed&&this.visibleElements.expressionsErrorNotice&&this._renderErrorNotice(this.messages.expressionEvaluationFailed),this._renderInvisibleFieldsError(),this._renderPage())}_renderPage(){switch(this.page){case"adding-attachments":return this._renderAttachmentAddPage();case"viewing-attachment-details":case"replacing-attachment":return this._renderAttachmentDetailPage();case"viewing-attachments":return this._renderAttachmentListPage();case"viewing-associated-layers":case"viewing-associated-features":return this._renderViewingAssociationsPage();case"viewing-related-categories":case"viewing-related-records":return this._renderRelationshipListPage();default:return this._renderDefaultPage()}}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let a;if(!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(a=w(i,e.mode,this.messages),"batch"===this.viewModel.mode){const e=i.invalidHiddenInputs.filter(e=>"hidden:group-visibility-expression:all-features"===e.effectiveVisibilityCode||"hidden:visibility-expression:all-features"===e.visibilityCode);e.length>0?a+=` (${e.map(e=>e.label).join(", ")})`:a=null}else a=null;else if(t)return null;return a?this._renderErrorNotice(a,"danger"):null}_renderDefaultPage(){return[this._renderReadOnlyNotice(),this._renderFormHeader(),this._renderFormContent()]}_renderReadOnlyNotice(){if((this.disabled||this.readOnly)&&this.visibleElements.readOnlyNotice)return de("calcite-notice",{class:D.disabledNotice,"data-testid":"read-only-notice",icon:"read-only-non-editable",kind:"brand",open:!0,scale:"s",width:"full"},de("div",{slot:"message"},this.featureFormMessages.disabledForm))}_renderFormHeader(){const{formTitle:e,formDescription:t}=this.viewModel;if(!this._formHeaderVisible)return;const i=e?de(le,{key:"title",level:this.headingLevel},e):void 0,a=t?de("p",{class:D.description,key:"description"},t):void 0;return de("div",{class:D.formHeader},i,a)}_renderFormContent(){return this.viewModel.hasVisibleInputs?this.viewModel.activeForm.inputs.filter(e=>e.visible).map(e=>this._renderInput(e)):this._renderErrorNotice(this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason])}_renderInput(e){return V(e)?this._renderGroupInput(e):R(e)?this._renderLabeledField(e):N(e)?this._renderTextComponent(e):U(e)?this._renderRelationshipElementInput(e):P(e)?this._renderAttachmentElementInput(e):B(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:a}=e,n=t.filter(e=>e.visible),s=e.label??"",l=this._focusedFieldInput?.group===e,o="sequential"===this.groupDisplay;return de("calcite-block",{class:this.classes(D.group,o?D.groupSequential:null,l?D.groupActive:null,this.disabled?D.inputDisabled:null),collapsible:!0,description:e.description??void 0,expanded:a,heading:s,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:s,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0},onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},n.map(e=>this._renderInput(e)))}_renderLabeledField(e){const{elementId:i}=e.template,{label:a,required:n,dataType:s}=e,l=n?t(this.messages.requiredFieldLabel,{name:a}):a;return de("calcite-label",{"aria-label":l,class:D.label,key:`field--${i}`},de("div",{class:D.labelTextContent,key:"labelTextContainer"},a,n?de("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==s?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:i}=e;return"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):this._getMultipleChoiceController(e)?this._renderMultipleChoiceComponent({input:e,props:t}):"date"===i?this._renderDateComponents(e,t):(t.disabled=this.disabled,t.readOnly=t.readOnly||this.viewModel.updating,"number"===i?this._renderNumberComponent(e,t):this._renderStringComponent(e,t))}_renderAuxiliaryText(e){const{description:t}=e,i=this._getErrorToDisplay(e),a=i?F(e,i,this.messages):null;return a?de("calcite-input-message",{icon:!0,status:"invalid"},a):e.valueIsOutOfDomain&&(this._touchedInputs.has(e.template.elementId)||this.viewModel.submitHasBeenAttempted)?de("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):t?de("calcite-input-message",{class:D.description,icon:!1,status:"idle"},t):null}_renderCodedInputs({input:e,props:t}){const i=e.input?.type??null,a=e.codedValueOptions;switch(i){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:a,props:t});default:return this._renderComboBoxComponent({options:a,props:t,input:e})}}_renderMultipleChoiceComponent({input:e,props:t}){const{messages:i}=this,a=this._getMultipleChoiceController(e);if(!a)return null;const{input:n}=a,s=!0===n.includeSelectAllChoices,{checkboxStatesByValue:l,selectAllState:o}=a.selectionState,r=o.checked?i.deselectAllLabel:i.selectAllLabel,c=a.otherChoiceRenderState,d=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:!0})},m=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t})},u=t=>{const{fieldName:i}=c;i&&this._saveOtherChoiceCheckboxValue({input:e,isChecked:t.checked,otherChoiceFieldName:i})},h=t=>{this._saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:c.fieldName??void 0})};return de("div",{class:D.multipleChoiceInput,key:`${t.key}-multiple-choice-group`},s?this._renderMultipleChoiceSelectAllCheckbox({props:t,selectAllState:o,selectAllLabel:r,handleSelectAllCheckboxChange:d}):null,this._renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:l,handleChoiceCheckboxChange:m}),c.shouldShow?this._renderMultipleChoiceOtherChoice({props:t,includeSelectAllChoices:s,otherChoiceRenderState:c,handleOtherChoiceCheckboxChange:u,handleOtherChoiceInputChange:h,differentValuesPlaceholder:i.differentValuesPlaceholder}):null)}_renderMultipleChoiceSelectAllCheckbox({props:e,selectAllState:t,selectAllLabel:i,handleSelectAllCheckboxChange:a}){return de("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:t.checked,class:D.multipleChoiceSelectAll,"data-element-id":e[he],disabled:e.readOnly||e.disabled,indeterminate:t.indeterminate,key:`${e.key}-select-all`,label:i,labelText:i,value:ge,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>a(e),onfocus:e.onfocus})}_renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:i,handleChoiceCheckboxChange:a}){const n=this._getMultipleChoiceController(e);if(!n)return[];const{choices:s}=n;return s.map(e=>{const n=i.get(e.value)??{checked:!1,indeterminate:!1};return de("calcite-checkbox",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,"aria-invalid":t["aria-invalid"],checked:n.checked,class:t.class,"data-element-id":t[he],disabled:t.readOnly||t.disabled,indeterminate:n.indeterminate,key:`${t.key}-${e.value}`,label:e.label,labelText:e.label,value:e.value,onblur:t.onblur,onCalciteCheckboxChange:({currentTarget:e})=>a(e),onfocus:t.onfocus})})}_renderMultipleChoiceOtherChoice({props:e,includeSelectAllChoices:t,otherChoiceRenderState:i,handleOtherChoiceCheckboxChange:a,handleOtherChoiceInputChange:n,differentValuesPlaceholder:s}){const l=i.label??this.messages.otherOptionLabel;return de("div",{class:this.classes(D.multipleChoiceOtherChoice,t?D.multipleChoiceOtherChoiceWithSelectAll:null),key:`${e.key}-other-choice`},de("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:i.checkboxState.checked,class:e.class,"data-element-id":e[he],disabled:e.readOnly||e.disabled,indeterminate:i.checkboxState.indeterminate,key:`${e.key}-other-choice-checkbox`,label:l,labelText:l,value:ve,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>a(e),onfocus:e.onfocus}),i.checkboxState.checked?de("calcite-input",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],"aria-label":l,class:D.textElementInput,"data-element-id":e[he],disabled:e.readOnly||e.disabled,key:`${e.key}-other-choice-input`,maxLength:i.maxLength,placeholder:i.value===$?s:i.hint,status:i.status,type:"text",value:i.normalizedValue===$?"":i.normalizedValue?String(i.normalizedValue):"",onblur:e.onblur,onCalciteInputInput:({currentTarget:e})=>n(e),onfocus:e.onfocus}):null)}async _saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:i=!1}){this._markFieldInputTouched(e);const a=this._getMultipleChoiceController(e);if(!a)return;if(a.input&&!i&&"batch"===this.viewModel.mode)return void await this._saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t});const n=e.value,s=this._parseValue(t,e,i);s!==n&&await this.viewModel.setValue(e.template.elementId,s)}async _saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:i}){if(!i)return;const a=t.value,n=null==a||""===a?null:a,s=this._getMultipleChoiceController(e);if(!s)return;s.initializeExplicitOtherChoiceCheckedState(),s.stashOtherChoiceDraftValueForFeatures(e.features,n);const l=z(e,i);l&&await this.viewModel.setValueForFieldName(l,n,Array.from(e.features,e=>e.source))}async _saveOtherChoiceCheckboxValue({input:e,isChecked:t,otherChoiceFieldName:i}){const a=this._getMultipleChoiceController(e);if(!a)return;a.setExplicitOtherChoiceCheckedState(t),this._markFieldInputTouched(e),t||a.setOtherChoiceDraftValuesFromFeatures(e.features.toArray());const n=z(e,i);if(!n)return;const s=new Map;for(const l of e.features){const e=l.getAttribute(i);if(t){if(!ue(e))continue;const t=a.getOtherChoiceDraftValue(l),i=G(t)?t:W;s.set(l,i);continue}null!=e&&s.set(l,null)}0!==s.size&&await this.viewModel.setValuePerFeatureForFieldName(n,new Map(Array.from(s,([e,t])=>[e.source,t])))}async _saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t}){const i=this._getMultipleChoiceController(e);if(!i)return;const a=new Map(e.features.map(a=>[a,i.getUpdatedValueForFeature({choiceValue:t.value,currentValue:a.getAttribute(e.fieldName),isChecked:t.checked})]));0!==a.size&&await this.viewModel.setFieldInputValuePerFeature(e,a)}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===$||e.value===$)&&"batch"===this.viewModel.mode){const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[he]:t[he]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:i,options:[{name:this.messages.differentValuesPlaceholder,value:$,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return de("calcite-switch",{...t,checked:!!I(e.template,"switch")&&e.value===e.template.input.onValue,class:D.inputSwitch,disabled:t.readOnly||t.disabled,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInputFromElement(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:i}){const{trigger:a,dropdown:n,group:s}=i;return de("calcite-dropdown",{...n,topLayerDisabled:this.topLayerDisabled,onblur:()=>{this._focusedFieldInput=null},onCalciteDropdownSelect:({currentTarget:e})=>this._saveInputFromElement(e),onfocus:this._onComponentFocus},de("calcite-button",{...a},e===$?this.messages.differentValuesPlaceholder:e),de("calcite-dropdown-group",{selectionMode:s.mode},t.map(t=>de("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:i}){const a="INSERT"===this.viewModel.editType,n=this._touchedInputs.has(e?.template?.elementId),s=a&&e.showNoValueOptionEnabled&&!n?()=>{}:i.onblur,l={...i,onblur:s};return de("calcite-combobox",{...l,clearDisabled:e.isSubtypeField,selectionMode:"single",topLayerDisabled:this.topLayerDisabled,value:i.placeholder===this.messages.differentValuesPlaceholder?$:String(i.value),onCalciteComboboxChange:({currentTarget:t})=>{t.value!==$&&(e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveInputFromElement(t))}},this.renderComboboxOptionsList({input:e,options:t,props:i}))}renderComboboxOptionsList({input:e,options:t,props:i}){const a=e=>e.map(e=>{const{value:t}=e,a=ue(e.value)?this.messages.empty:e.name;return de("calcite-combobox-item",{heading:a,key:`#${t}`,selected:i.value===t,value:`${t}`})});let n=[];const{messages:s}=this;t.other.length>0&&n.push(de("calcite-combobox-item-group",{key:"other",label:s.other},a(t.other))),t.unsupported.length>0&&n.push(de("calcite-combobox-item-group",{key:"unsupported",label:s.unsupported},a(t.unsupported)));const l=a(t.recommended);n.length>0?n.unshift(de("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):n=l;const o=i.placeholder===this.messages.differentValuesPlaceholder,r=!o&&ue(i.value);return e.showNoValueOptionEnabled&&!t.containsEmptyOption&&n.unshift(de("calcite-combobox-item",{heading:e.showNoValueLabel||this.messages.empty,key:"empty-option",selected:r,value:""})),o&&n.unshift(de("calcite-combobox-item",{heading:this.messages.differentValuesPlaceholder,key:$,selected:!0,value:$})),n}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const a=[...t.recommended,...t.other,...t.unsupported].map(({name:t,value:a})=>this._renderRadioButtons({label:t,value:a,selected:a===e.value,props:i}));if(e.showNoValueOptionEnabled&&!t.containsEmptyOption){const t="",n=e.showNoValueLabel||this.messages.empty,s=ue(e.value);a.unshift(this._renderRadioButtons({label:n,value:t,selected:s,props:i}))}return de("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:D.inputRadioGroup,"data-field-name":i[pe],disabled:i.readOnly||i.disabled,key:`${i.key}-radio-group`,layout:"vertical",name:`${i.name}-${this.id}`,required:i.required},a,i.placeholder===this.messages.differentValuesPlaceholder?de("calcite-label",{class:D.placeholderRadio,key:i.label,layout:"inline"},de("calcite-radio-button",{checked:!0,class:D.inputRadio,disabled:!0,value:i.placeholder}),i.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:i,props:a}){return de("calcite-label",{class:D.inputRadioLabel,key:a.label,layout:"inline"},de("calcite-radio-button",{...a,afterCreate:void 0,afterUpdate:void 0,checked:t,class:D.inputRadio,disabled:a.readOnly||a.disabled,name:void 0,value:e,onblur:()=>{this._focusedFieldInput=null},onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInputFromElement(e)}}),i)}_renderStringComponent(e,t){const{template:i}=e;return!i.field.editable||this.readOnly?this._renderReadOnlyComponent(e):"text-area"===i.input?.type?de("calcite-text-area",{...t,class:this.classes(D.individualElement),resize:"vertical",value:t.value?String(t.value):"",onblur:i=>{t.onblur(i),e.userHasChangedValue&&this._saveInputFromElement(i.currentTarget)},onCalciteTextAreaInput:t=>{e.userHasChangedValue=!0,""===t.currentTarget.value&&this._saveInputFromElement(t.currentTarget)}}):de("calcite-input",{...t,class:this.classes(D.individualElement),type:"text",value:t.value?String(t.value):"",onblur:i=>{t.onblur(i),e.userHasChangedValue&&this._saveInputFromElement(i.currentTarget)},onCalciteInputInput:t=>{e.userHasChangedValue=!0,""===t.currentTarget.value&&this._saveInputFromElement(t.currentTarget)}})}_renderNumberComponent(e,t){const i=g(e.field);return de("calcite-input-number",{...t,integer:i,step:i?1:"any",type:"number",value:i&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onblur:i=>{t.onblur(i),e.userHasChangedValue&&this._saveInputFromElement(i.currentTarget)},onCalciteInputNumberInput:t=>{e.userHasChangedValue=!0,""===t.currentTarget.value&&this._saveInputFromElement(t.currentTarget)}})}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return de("calcite-input",{...i,class:this.classes(D.fieldInput,D.inputDisabled,D.individualElement),readOnly:!0,type:"text",value:String(t??i.value??"")})}_renderDateComponents(e,t){const{field:i}=e;let a;switch(i.type){case"date":a=this._renderDateFieldComponents(e,t);break;case"date-only":a=this._renderDateOnlyFieldComponent(e,t);break;case"time-only":a=this._renderTimeOnlyFieldComponent(e,t);break;case"timestamp-offset":a=this._renderTimestampOffsetFieldComponents(e,t);break;default:a=this._renderReadOnlyComponent(e,Q(i,t.value,{timeZone:e.effectiveTimeZone,...Y(e.template.field)}))}return e.value===$?[a,de("calcite-input-message",{icon:"information",key:"diff-values-message",status:"idle"},this.messages.differentValues)]:a}_renderDateOnlyFieldComponent(e,t){const{class:i,disabled:a,key:n,readOnly:s}=t,{rawMax:l,rawMin:o}=e.range;return de("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,class:i,"data-date-part":"date","data-element-id":t[he],"data-field-name":t[pe],disabled:a,key:`${n}-date-input`,max:v(l)?l:void 0,min:v(o)?o:void 0,overlayPositioning:"fixed",readOnly:s,topLayerDisabled:this.topLayerDisabled,value:e.value===$?"":e.value?String(e.value):"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:this._onComponentFocus})}_renderTimeOnlyFieldComponent(e,t){const{class:i,disabled:a,key:n,readOnly:s}=t;return de("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,class:i,"data-date-part":"time","data-element-id":t[he],"data-field-name":t[pe],disabled:a,key:`${n}-time-input`,overlayPositioning:"fixed",readOnly:s,step:e.timeStep,value:e.value===$?"":e.value?String(e.value):"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:this._onComponentFocus})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,disabled:a,key:n,readOnly:s}=t,{rawMax:l,rawMin:o}=e.range,r=e.effectiveTimeZone,c=ee(l,r),d=ee(o,r),m=ee(e.value===$?"":e.value,r),u=e.includeTimeOffset,h={afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,disabled:a,[he]:t[he],[pe]:t[pe],onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:s};return de("div",{class:D.dateInputContainer,key:`${n}-date-time-container`},de("calcite-input-date-picker",{...h,class:i,"data-date-part":"date",key:`${n}-date-input`,max:c?.date??void 0,min:d?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:m.date??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),de("calcite-input-time-picker",{...h,class:i,"data-date-part":"time",key:`${n}-time-input`,step:e.timeStep,value:m.time??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),u?de("calcite-input-time-zone",{...h,class:i,clearable:e.value===$||null==e.value,"data-date-part":"timeZone",key:`${n}-timezone-input`,value:m.timeZoneOffset||"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,disabled:a,key:n,readOnly:s,min:l,max:o}=t,r=e.effectiveTimeZone,c=te(e.value===$?"":e.value,r),d=te(o,r),m=te(l,r),u=e.includeTime,h={afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,disabled:a,[he]:t[he],[pe]:t[pe],onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:s};return de("div",{class:D.dateInputContainer,key:`${n}-date-time-container`},de("calcite-input-date-picker",{...h,class:i,"data-date-part":"date",key:`${n}-date-input`,max:d?.date??void 0,min:m?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:c.date??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),u?de("calcite-input-time-picker",{...h,"data-date-part":"time",key:`${n}-time-input`,step:1,value:c.time??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}_renderRelationshipElementInput(e){return this._relatedRecordsEnabled?de(q,{afterObserverCreated:this._afterListObserverCreated,afterObserverRemoved:this._afterListObserverRemoved,input:e,messages:this.messages,messagesCommon:this.messagesCommon,viewModel:this.viewModel}):null}_renderRelationshipListPage(){const{activeRelationshipInput:e}=this.viewModel;if(e)return this._renderRelationshipElementInput(e)}_renderAttachmentElementInput(e){if(!this.attachmentsEnabled)return;const{allAttachmentsVisibleOnDefaultPage:t,attachments:i,defaultPageAttachments:a,template:{description:n,elementId:s,label:l}}=e,o=t?i:a;return de("div",{class:D.attachmentElementInput,"data-testid":`attachment-element-${s}`,key:`attachment-element-${s}`},l?de("div",{class:D.attachmentElementLabel,key:`attachment-element-label-${s}`},l):null,n?de("div",{class:D.description,key:`attachment-element-description-${s}`},n):null,i.length?this._renderAttachmentList(e,o,{label:l||this.messagesCommon.details,viewAllCount:t?null:i.length}):de("div",{class:D.attachmentElementEmptyState,key:`attachment-element-empty-state-${s}`},this.messages.attachments.noAttachments),this._renderAttachmentAddAction(e))}_renderAttachmentListPage(){const e=this.viewModel.selectedAttachmentListInput;if(e)return de("div",{class:D.attachmentElementAllPanel,key:`attachment-element-all-panel-${e.template.elementId}`},this._renderAttachmentList(e,e.attachments,{filterEnabled:!0,label:this.messages.titles.attachments}))}_renderAttachmentList(e,t,i){const{filterEnabled:a,label:n,viewAllCount:s}=i;return de("calcite-list",{class:D.attachmentElementList,filterEnabled:a,filterPlaceholder:a?this.messages.attachments.searchAttachments:void 0,filterProps:a?oe:void 0,filterText:a?this._attachmentListFilterText:void 0,label:n,selectionAppearance:"border",selectionMode:"none",onCalciteListFilter:a?e=>{this._attachmentListFilterText=e.currentTarget.filterText??""}:void 0},this._renderAttachmentListItems(e,t),null!=s?this._renderViewAllAttachmentsItem(e,s):null)}_renderAttachmentListItems(e,t){const{elementId:i}=e.template;return t.map((t,a)=>{const n=this._formatAttachmentSize(t.size),s=this._getAttachmentLabel(t,a,n,e.displayFilename),l=s===n?void 0:n,o=C(t),r=e.isStagedAttachmentAddition(t),c=e.getAttachmentEditState(t),d=c.isDeleted,m=!d&&(r||c.isRenamed||c.isReplaced);return de("calcite-list-item",{class:D.attachmentElementListItem,description:l,key:`attachment-item-${o}`,label:s,onCalciteListItemSelect:r||d?void 0:()=>this._setSelectedAttachment({attachmentKey:o,elementId:i})},de("div",{class:D.attachmentElementListItemStart,slot:"content-start"},this._renderAttachmentPreviewThumbnail(t,s,e)),m?de("span",{class:D.attachmentElementListItemStagedIndicator,slot:"content-end"}):null,r?[de("calcite-action",{disabled:this._disableAttachmentModification(e),icon:"x",scale:"s",slot:"actions-end",text:this.messagesCommon.delete,title:this.messagesCommon.delete,onclick:()=>this.viewModel.stageDeleteAttachment(i,C(t))})]:d?de("calcite-chip",{label:this.messages.attachments.deleted,scale:"s",slot:"content-end"},this.messages.attachments.deleted):de("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))})}_renderViewAllAttachmentsItem(e,i){const{elementId:a}=e.template,{viewAll:n}=this.messages.attachments;return de("calcite-list-item",{class:D.attachmentElementListItem,description:t(this.messages.attachments.count,{count:i}),key:`attachment-item-view-all-${a}`,label:n,onCalciteListItemSelect:()=>this._setAttachmentListElementId(a)},de("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderAttachmentAddAction(e){const{elementId:t}=e.template,i=this.effectiveDisabled||e.addDisabled,a=this._renderAttachmentCountLimitsLabel(e),n=this._getAttachmentNoticeMessage(e),s=e.hasMinimumAttachmentCountNotMet||e.hasExceededAttachmentLimit?"danger":"info",l=e.canUploadFiles,o=e.isCaptureOnly&&!this.effectiveDisabled&&!n;return de("div",{class:D.attachmentElementAddActions,key:`attachment-element-add-actions-${t}`},l?de("calcite-button",{appearance:"outline",disabled:i,iconStart:"attachment",kind:"neutral",round:!0,scale:"s",onclick:()=>this._setAttachmentAddElementId(t)},this.messages.attachments.attach):null,this._renderAttachmentCaptureButton(e),o?this._renderAttachmentCaptureDisabledNotice(t):null,a?de("div",{class:D.attachmentElementEmptyActionHint},a):null,!this.effectiveDisabled&&n?de("calcite-notice",{closable:!1,icon:"danger"===s?"exclamation-mark-circle":"lightbulb",kind:s,open:!0,scale:"s",width:"full"},de("div",{slot:"message"},n)):null)}_renderAttachmentCaptureButton(e){if(!e.hasCaptureInputs)return null;const t=e.captureMediaType;return de("calcite-button",{appearance:"outline",disabled:!0,iconStart:fe(t),kind:"neutral",round:!0,scale:"s"},this._getCaptureButtonLabel(t))}_getAttachmentNoticeMessage(e){const t=this.messages.attachments;return e.hasUnsupportedFileTypeValidationError?this._getUnsupportedFileTypeMessage():e.hasMinimumAttachmentCountNotMet&&this._shouldShowMinimumAttachmentNotice(e)?t.minimumNotMet:e.hasExceededAttachmentLimit?t.attachmentLimitExceeded:e.hasReachedAttachmentLimit?t.attachmentLimitReached:null}_shouldShowMinimumAttachmentNotice(e){return e.hasAttachmentChanges||this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId)}_getCaptureButtonLabel(e){const{capture:t,recordAudio:i,takePhoto:a,takeVideo:n}=this.messages.attachments;switch(e){case"image":return a||t;case"video":return n||t;case"audio":return i||t;default:return t}}_renderAttachmentAddPage(){const e=this.viewModel.selectedAttachmentAddInput;return e?this._renderAttachmentAddPanel(e):null}_renderAttachmentAddPanel(e){const{maxAttachmentCount:t}=e,{elementId:i}=e.template;if(e.isCaptureOnly)return this._renderAttachmentCaptureDisabledNotice(i);const a=null==t||t-e.attachments.length>1,n=this.effectiveDisabled||e.addDisabled,s=this.messages.attachments,l=s.dragAndDropFile,o="upload",r=e=>{this._attachmentFileInputMap.set(i,e)};return de("div",{class:D.attachmentElementAddPanel,key:`attachment-element-add-panel-${i}`},de("input",{accept:e.accept,afterCreate:r,afterRemoved:()=>{this._attachmentFileInputMap.delete(i)},afterUpdate:r,class:D.attachmentElementFileInput,"data-element-id":i,disabled:n,multiple:a,type:"file",onchange:e=>{const t=e.currentTarget,a=t.files?Array.from(t.files):[];this._stageAttachmentFiles(i,a),t.value=""}}),de("div",{class:D.attachmentElementAddDropzone,"data-disabled":n?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),n)return;const t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this._stageAttachmentFiles(i,t)}},de("calcite-icon",{class:D.attachmentElementAddDropzoneIcon,icon:o,scale:"l"}),de("div",{class:D.attachmentElementAddDropzoneHeading},s.addFile),de("div",{class:D.attachmentElementAddDropzoneDetail,title:l},l),de("calcite-button",{appearance:"transparent",disabled:n,iconStart:"folder-open",kind:"brand",scale:"s",type:"button",onclick:e=>{e.stopPropagation(),this._openAttachmentFilePicker(i,n)}},s.selectFile)),this._renderAttachmentValidationCriteria(e,{includeCountCriteria:!0}))}_renderAttachmentCaptureDisabledNotice(e){return de("calcite-notice",{class:D.attachmentElementCaptureNotice,icon:!0,key:`attachment-element-capture-disabled-notice-${e}`,kind:"warning",open:!0,scale:"s"},de("div",{slot:"message"},this.messages.attachments.captureMethodNotSupported))}async _stageAttachmentFiles(e,t){if(0===t.length)return;const i=this.viewModel.selectedAttachmentAddInput;let a=!0;try{a=(await this.viewModel.stageAddAttachments(e,t)).length>0&&!i?.hasInvalidValidationCriteria&&!i?.hasUnsupportedFileTypeValidationError}finally{a&&this.viewModel.setSelectedAttachmentAddElementId(null)}}_openAttachmentFilePicker(e,t){t||this._attachmentFileInputMap.get(e)?.click()}_renderAttachmentDetailPage(){const e=this.selectedAttachmentDetails;if(!e)return;if("replacing-attachment"===this.page)return this._renderAttachmentReplacePanel(e);const{attachment:t,input:i}=e,a=C(t),n=!!i.getAttachmentPreviewUrl(t),s=!this._disableAttachmentModification(i)&&i.canUploadFiles,l=i.getAttachmentEditState(t);return de("div",{class:D.attachmentElementDetail,key:`attachment-detail-panel-${i.template.elementId}-${a}`},de("div",{class:D.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,i)),de("div",{class:D.attachmentElementDetailActions},y(t)?de("calcite-button",{appearance:"outline",disabled:!n,iconStart:"expand",kind:"neutral",label:this.messages.attachments.maximize,scale:"m",title:this.messages.attachments.maximize,onclick:this._maximizeSelectedAttachment}):null,de("calcite-button",{appearance:"outline",disabled:!n||l.isReplaced,iconStart:"download",kind:"neutral",label:this.messages.attachments.download,scale:"m",title:this.messages.attachments.download,onclick:()=>{this._downloadAttachment(t)}}),de("calcite-button",{appearance:"outline",disabled:!s,iconStart:"upload-to",kind:"neutral",label:this.messages.attachments.replace,scale:"m",title:this.messages.attachments.replace,onclick:this._enterAttachmentReplaceView})),de("div",{class:D.attachmentElementDetailMetadata},de("div",{class:D.attachmentElementDetailMetadataGroup},de("span",{class:D.attachmentElementDetailMetadataLabel},this.messages.attachments.fileName),this._renderFileNameContent(t,i)),de("div",{class:D.attachmentElementDetailMetadataGroup},de("span",{class:D.attachmentElementDetailMetadataLabel},this.messages.attachments.size),de("span",{class:D.attachmentElementDetailMetadataValue},this._formatAttachmentSize(t.size))),de("div",{class:D.attachmentElementDetailMetadataGroup},de("span",{class:D.attachmentElementDetailMetadataLabel},this.messages.attachments.type),de("span",{class:D.attachmentElementDetailMetadataValue},this._getLabelForAttachmentType(t)))))}_renderFileNameContent(e,t){if(!t.allowUserRename)return de("span",{class:D.attachmentElementDetailMetadataValue},e.name);const i=t.getAttachmentEditState(e),{baseName:a,extension:n}=A(e.name),s=this._disableAttachmentModification(t),l=!s&&0===e.name.trim().length;return[de("div",{class:D.attachmentElementDetailFileNameRow,key:"file-name-row"},de("calcite-input",{class:D.attachmentElementDetailFileNameInput,disabled:s,scale:"m",status:l?"invalid":"idle",suffixText:n,value:a,onCalciteInputInput:({currentTarget:e})=>this._renameSelectedAttachment(e.value)}),de("calcite-button",{appearance:"transparent",disabled:s||null==i.initialName||!i.isRenamed,iconStart:"reset",kind:"neutral",label:this.messages.footerButtons.reset,scale:"m",title:this.messages.footerButtons.reset,onclick:this._resetSelectedAttachmentName})),l?de("calcite-input-message",{icon:!0,key:"file-name-message",status:"invalid"},this.messages.validationErrors.cannotBeNull):null]}_renderAttachmentReplacePanel(e){const{attachment:t,input:i}=e,a=this._disableAttachmentModification(i)||!i.canUploadFiles,n=i.template.elementId;return de("div",{class:D.attachmentElementAddPanel,key:`attachment-replace-panel-${n}-${C(t)}`},de("input",{accept:i.accept,afterCreate:this._setSelectedAttachmentReplaceFileInput,afterRemoved:()=>{this._selectedAttachmentReplaceFileInput=null},afterUpdate:this._setSelectedAttachmentReplaceFileInput,class:D.attachmentElementFileInput,disabled:a,type:"file",onchange:e=>{const t=e.currentTarget,i=t.files?.[0];i&&this._stageSelectedAttachmentReplacement(i),t.value=""}}),de("div",{class:D.attachmentElementAddDropzone,"data-disabled":a?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),a)return;const t=e.dataTransfer?.files?.[0];t&&this._stageSelectedAttachmentReplacement(t)}},de("calcite-icon",{class:D.attachmentElementAddDropzoneIcon,icon:"refresh",scale:"l"}),de("div",{class:D.attachmentElementAddDropzoneHeading},this.messages.attachments.replace),de("div",{class:D.attachmentElementAddDropzoneDetail,title:this.messages.attachments.dragAndDropFile},this.messages.attachments.dragAndDropFile),de("calcite-button",{appearance:"transparent",disabled:a,iconStart:"folder-open",kind:"brand",scale:"s",onclick:e=>{e.stopPropagation(),this._openSelectedAttachmentReplaceFilePicker()}},this.messages.attachments.selectFile)),this._renderAttachmentValidationCriteria(i,{includeCountCriteria:!1}),de("div",{class:D.attachmentElementDetailMetadata},de("div",{class:D.attachmentElementDetailMetadataGroup},de("span",{class:D.attachmentElementDetailMetadataLabel},this.messages.attachments.fileToBeReplaced),de("span",{class:D.attachmentElementDetailMetadataValue},t.name))))}_renderAttachmentDialog(){const e=this._attachmentDialogInfo;if(!e)return null;const{attachment:t,input:i}=e;return de("calcite-dialog",{heading:t.name||this.messagesCommon.details,key:"attachment-preview-dialog",modal:!0,open:!0,placement:"cover",width:"l",onCalciteDialogClose:this._closeAttachmentDialog},de("div",{class:D.attachmentElementDialogPreview},this._renderAttachmentPreviewImageForInput(t,i)))}_setSelectedAttachment(e){e?.elementId&&this._touchedInputs.add(e.elementId),this.viewModel.setSelectedAttachment(e),e||this.hideAttachmentDialog()}_setAttachmentAddElementId(e){e&&this._touchedInputs.add(e),this.viewModel.setSelectedAttachmentAddElementId(e),this.viewModel.selectedAttachmentAddInput?.clearValidationCriteriaState(),this.hideAttachmentDialog()}_setAttachmentListElementId(e){e&&this._touchedInputs.add(e),this.viewModel.setSelectedAttachmentListElementId(e),this.hideAttachmentDialog()}_getAttachmentLabel(e,i,a,n){return!1!==n&&v(e.name)&&e.name.length>0?e.name:a!==this.messagesCommon.notApplicable?a:t(this.messages.attachments.attachmentNumberedLabel,{index:i+1})}_renderAttachmentCountLimitsLabel(e){const t=this.messages.attachments,i=null!=e.minAttachmentCount&&e.minAttachmentCount>0?this._renderAttachmentCountLimitLabel(t.minAttachmentsShort,e.minAttachmentCount,"min"):null,a=null!=e.maxAttachmentCount?this._renderAttachmentCountLimitLabel(t.maxAttachmentsShort,e.maxAttachmentCount,"max"):null;return i||a?[i,i&&a?de("span",{key:"attachment-count-limits-separator"},", "):null,a]:null}_renderAttachmentCountLimitLabel(e,i,a){const n="__count__",[s,l]=t(e,{count:n}).split(n);return de("span",{key:a},s,de("span",{class:D.attachmentElementEmptyActionHintValue},i),l)}_renderAttachmentValidationCriteria(e,{includeCountCriteria:t}){const i=this._getAttachmentValidationCriteria(e,{includeCountCriteria:t}),a=`attachment-validation-criteria-${e.template.elementId}`;return 0===i.length?null:de("div",{class:D.attachmentElementValidationCriteria,key:a},i.map(({key:e,message:t,state:i})=>de("calcite-notice",{appearance:"danger"===i?"outline-fill":"transparent",closable:!1,icon:!0,key:e,kind:i,open:!0,scale:"s",width:"full"},de("div",{slot:"message"},t))))}_getAttachmentValidationCriteria(e,{includeCountCriteria:i}){const a=[],n=e.validationCriterionStates,s=this.messages.attachments,l=this._getNestableAttachmentInputs(e.input);e.hasUnsupportedFileTypeValidationError&&a.push({key:"unsupported-file-type",message:this._getUnsupportedFileTypeMessage(),state:"danger"});for(const o of l)"document"===o.type&&null!=o.maxFileSize&&a.push({key:"maximum-file-size",message:t(s.maximumFileSize,{maxSize:this._formatAttachmentSizeLimitInMegabytes(o.maxFileSize)}),state:n.get("maximum-file-size")??"info"}),"audio"===o.type&&null!=o.maxDuration&&a.push({key:"maximum-audio-length",message:t(s.maximumAudioLength,{maxDuration:this._formatAttachmentDurationLimit(o.maxDuration)}),state:n.get("maximum-audio-length")??"info"}),"video"===o.type&&null!=o.maxDuration&&a.push({key:"maximum-video-length",message:t(s.maximumVideoLength,{maxDuration:this._formatAttachmentDurationLimit(o.maxDuration)}),state:n.get("maximum-video-length")??"info"}),"image"===o.type&&null!=o.maxImageSize&&a.push({key:"maximum-image-size",message:t(s.attachmentMustBeSmallerThan,{maxSize:`${o.maxImageSize}px`}),state:n.get("maximum-image-size")??"info"});return i&&null!=e.minAttachmentCount&&e.minAttachmentCount>0&&a.push({key:"minimum-number-of-files",message:t(s.minimumNumberOfFiles,{count:e.minAttachmentCount}),state:n.get("minimum-number-of-files")??"info"}),i&&null!=e.maxAttachmentCount&&a.push({key:"maximum-number-of-files",message:t(s.maximumNumberOfFiles,{count:e.maxAttachmentCount}),state:n.get("maximum-number-of-files")??"info"}),a}_getNestableAttachmentInputs(e){return null==e?[]:"attachment"===e.type?e.inputTypes?.slice()??[]:[e]}_getUnsupportedFileTypeMessage(){return this.featureTableMessages.errorFileUnsupported}_formatAttachmentSize(e){return null==e||Number.isNaN(e)?this.messagesCommon.notApplicable:m(this.messagesUnits,e)}_formatAttachmentSizeLimitInMegabytes(e){return m(this.messagesUnits,1048576*e)}_formatAttachmentDurationLimit(e){return p(1e3*Math.round(e),{...e>=3600?{hour:"2-digit",hourCycle:"h23"}:{},minute:"2-digit",second:"2-digit",timeZone:"UTC"})}_getLabelForAttachmentType({contentType:e}){if(!e)return this.messagesCommon.notApplicable;const t=this.messages.attachments.attachmentTypes,i=f(e);return t?.[i]||e}_renderAttachmentPreviewThumbnail(e,t,i){const a=i.getAttachmentPreviewUrl(e,64);return a&&y(e)?de("img",{alt:t,class:D.attachmentElementListItemThumb,src:a}):de("calcite-icon",{class:D.attachmentElementListItemIcon,icon:_(e.contentType),scale:"s"})}_renderAttachmentPreviewImageForInput(e,t){const i=t.getAttachmentPreviewUrl(e),a=e.name||this.messagesCommon.details;return i&&y(e)?de("img",{alt:a,class:D.attachmentElementDetailPreviewImage,src:i,title:a}):[de("calcite-icon",{class:D.attachmentElementDetailPreviewIcon,icon:_(e.contentType),scale:"l",textLabel:a,title:a}),this.messages.attachments.noPreviewAvailable]}async _downloadAttachment(e){await X(e)}_canReplaceSelectedAttachment(){return!this.effectiveDisabled&&!!this.selectedAttachmentDetails?.input.canUploadFiles}_exitAttachmentReplaceView(){this.viewModel.setShowingSelectedAttachmentReplacePage(!1),this._selectedAttachmentReplaceFileInput=null}async _stageSelectedAttachmentReplacement(e){const t=this.selectedAttachmentDetails;if(!t?.attachment)return;const i=t.input.template.elementId,a=C(t.attachment);let n=!1;try{n=await this.viewModel.stageReplaceAttachment(i,a,e)}finally{n&&this._exitAttachmentReplaceView()}}_renameSelectedAttachment(e){const t=this.selectedAttachmentDetails;if(!t?.attachment)return;const i=t.input.template.elementId,a=C(t.attachment);this.viewModel.stageRenameAttachment(i,a,e)}_resetSelectedAttachmentChanges(){const e=this.selectedAttachmentDetails;e?.attachment&&this.viewModel.resetAttachmentChanges(e.input.template.elementId,C(e.attachment))}_deleteSelectedAttachment(){const e=this.selectedAttachmentDetails;if(!e?.attachment||this._disableAttachmentModification(e.input))return;const t=e.input.template.elementId,i=C(e.attachment);this.viewModel.stageDeleteAttachment(t,i),this._setSelectedAttachment(null)}_disableAttachmentModification(e){return this.disabledOrReadOnly||!e.editable}hideAttachmentDialog(){this._attachmentDialogInfo=null}_renderTextComponent(e){const{elementId:t}=e.template;return de("div",{class:D.textElementInput,"data-testid":`text-element-${t}`,innerHTML:e.text,key:`text-element-${t}`})}_renderUtilityNetworkAssociationsElementInput(e){if(!this._associationsEnabled)return;const{elementId:t}=e.template;return de("div",{class:D.utilityNetworkAssociationsElementInput,"data-testid":t,key:t},this._associationsWidgetsMap.get(e)?.render())}getCommonInputProps(e){const{template:t,valid:i,value:a,minLength:n,maxLength:s,required:l,fieldName:o,editable:r,userHasChangedValue:c,range:{max:d,min:m}}=e,u=!r||this.readOnly,h=this.disabled||this.viewModel.updating;let p=t.hint??void 0,g=!1;return a===$&&(p=this.messages.differentValuesPlaceholder,g=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":i?"false":"true",class:this.classes(D.fieldInput,u?D.inputDisabled:null),status:!c&&!this.viewModel.submitHasBeenAttempted||i?"idle":"invalid",maxLength:s&&s>-1?s:void 0,minLength:n&&n>-1?n:void 0,key:t.elementId,label:o,name:o,max:null!=d?d:void 0,min:null!=m?m:void 0,disabled:h,readOnly:u,onblur:this._onComponentBlur,required:l,placeholder:p,value:g?"":a??"",[he]:t.elementId,[pe]:o,onfocus:this._onComponentFocus}}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(he))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),a=t||i;a&&this._afterComponentCreateOrUpdate(a)}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._isMultipleChoiceCheckbox(t,i)||this._markFieldInputTouched(i),this._focusedFieldInput=i}_markFieldInputTouched(e){this._touchedInputs.add(e.template.elementId)}_isMultipleChoiceCheckbox(e,t){return"CALCITE-CHECKBOX"===e.tagName&&null!=t.multipleChoiceController?.input}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),i=this._focusedFieldInput;this._attemptFocusOnNextRender&&i===t&&(this._attemptFocusOnNextRender=!1,me(e))}_onComponentBlur(){this._focusedFieldInput=null}_resetTransientFormState(){this._attemptFocusOnNextRender=!1,this._focusedFieldInput=null,this._attachmentDialogInfo=null,this._selectedAttachmentReplaceFileInput=null,this._attachmentListFilterText="",this._attachmentFileInputMap.clear(),this._touchedInputs.clear()}_parseValue(e,t,i=!1){const a=this._getMultipleChoiceController(t);if(a){const{input:t,values:n}=a;if(t&&n){const t=e;return a.getValueFromCheckboxChange({choiceValue:t.value,isChecked:t.checked,isSelectAllCheckbox:i})}}if(I(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const i of t.domain.codedValues)if(i.name===e.selectedItems[0].textContent)return i.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const n=e.value;return null==n||""===n?null:"number"===t.dataType?"-0"===n||"-0."===n||"-0,"===n?n:parseFloat(n):"date"===t.field.type?parseFloat(n):n}_getMultipleChoiceController(e){return e.multipleChoiceController}_saveInputFromElement(e){const t=this._getFieldInputFromHTMLElement(e);if(!t)return;const i=this._parseValue(e,t);this._saveInput(t,i)}_saveInput(e,t){const{elementId:i}=e.template,a=e?.value,{viewModel:s}=this;if(I(e.template,"switch")&&"single"!==s.mode){const t=n(this._batchSwitchInputInitialValues,e,()=>e.value);this._batchSwitchInputInitialValues.set(e,null===t?a:t)}t!==a&&(e.isSubtypeField&&"batch"!==s.mode&&k(s.activeLayer,a,t)?this._pendingSubtypeChoice||(this._pendingSubtypeChoice=this._handleSubtypeChoice(e,t)):s.setValue(i,t))}async _handleSubtypeChoice(e,i){const{value:a,template:n}=e,{elementId:s}=n,{messages:l,viewModel:o,messagesCommon:r}=this,{subtypes:c,activeFeatureIndex:d}=o;if(await o.setValue(s,i),!c?.length)return;const m=c.find(e=>e.code===i),u=c.find(e=>e.code===a)?.name??`${a}`;if(!m)return;const h=Promise.withResolvers();o.pendingSubtypeChoice=h;let p="update-fields";const g=[{label:l.subtypes.useDefaultValuesOption,value:"update-fields"},{label:l.subtypes.keepCurrentValuesOption,value:"keep-existing"}],v={context:"info",title:l.subtypes.changeWarningTitle,message:t(l.subtypes.changeWarning,{originalType:u,newType:m.name}),radios:g,defaultRadioSelection:"update-fields",onRadioSelection:e=>{p=e},actions:{primary:{label:r.apply,action:()=>h.resolve(p),type:"positive"},secondary:{label:r.cancel,type:"neutral",action:()=>h.resolve("undo")}},cancel:()=>h.reject()};try{this.showPrompt(v);switch(await h.promise){case"update-fields":await o.applySubtypeDefaults(m),await o.handleSubtypeChanged(d);break;case"keep-existing":await o.handleSubtypeChanged(d);break;case"undo":await this.viewModel.setValue(s,a)}}finally{o.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_afterDateComponentCreateOrUpdate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,a=e.field.type,n=this._dateComponentMap.get(`${i}`);if(!n)return;const s=e.effectiveTimeZone;let l=e.value===$?void 0:e.value,o=null;"date-only"===a?o=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===a?(l=ie(l),o=ie(t.value)):o="timestamp-offset"===a?null!=t.value?ae({dateComponent:n.date,timeComponent:n.time,oldValue:l,timeZoneComponent:n.timeZone,defaultTimeZone:s}):null:null!=t.value?ne({oldValue:l,dateComponent:n.date,timeZone:s,timeComponent:n.time?.value===$?void 0:n.time}):null,l!==o&&(null!==o&&t.value?this.viewModel.setValue(`${i}`,o):this.viewModel.setValue(`${i}`,null))}_getErrorToDisplay(e){const t=e.compositeError;return e.valid||!t?null:"contingent-values-validation-error::contingency-violation-error"===t||"contingent-values-validation-error::contingency-violation-warning"===t||this._touchedInputs.has(e.template.elementId)||this.viewModel.submitHasBeenAttempted?t:null}_renderViewingAssociationsPage(){return this._associationsList?.render()}_onActiveAssociationsInputChange(e){const t=this._associationsList;t&&(e?(t.associationInput=e,t.viewModel=e.viewModel):t.associationInput=null)}async _setUpAssociationsWidgets(){const e=this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs;if(this._associationsEnabled&&0!==e.length){await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.set(t,await this._createAssociationsWidget(t))}}async _setUpUtilityNetworkAssociationList(){if(this._associationsList)return;const e=(await(import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js"))).default;this._associationsList=new e({onSelectLayer:this._onSelectAssociatedLayer.bind(this),onSelectFeature:this._onEditAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)});const t=this.viewModel.activeAssociationsInput;t&&(this._associationsList.associationInput=t,this._associationsList.viewModel=t.viewModel)}async _createAssociationsWidget(e){return new(0,(await(import("./Feature/FeatureUtilityNetworkAssociations.js"))).default)({viewModel:e.viewModel,onSelectAssociationType:t=>this._onSelectAssociationType(e,t)})}_destroyAssociationsWidgets(){this._associationsWidgetsMap.forEach(e=>s(e)),this._associationsWidgetsMap.clear()}_onSelectAssociationType(e,{listType:t}){this.setActiveAssociationsInput(e),this.setActiveAssociationType(t)}_onSelectAssociatedLayer({layer:e}){this.setActiveAssociationsLayer(e)}async _onEditAssociatedFeature(e){const t=this.callbacks?.editAssociatedFeature,i=this.viewModel.activeAssociationsInput;if(!t||!i?.feature)return;const{association:a,feature:n}=e;await t({parentFeature:i.feature.plainGraphic,association:a,feature:n})}_onAddAssociation(e){const t=this.callbacks?.addAssociation,i=this.viewModel.activeAssociationsInput;if(!t||!i?.feature)return;const{associationType:a,utilityNetwork:n}=e;t({feature:i.feature.plainGraphic,associationType:a,utilityNetwork:n})}_setFocusableInput(e){const t=e&&R(e)?e:this._findFocusableInput(e);this._syncGroupInputStates(),this._focusedFieldInput=t,this._attemptFocusOnNextRender=!0}_findFocusableInput(e){const t=this.viewModel.activeForm.inputs;if(!t.length)return;const i=M(t);let a;if(e)if(V(e)){const t=e.inputs.find(e=>e.visible);a=t?i.indexOf(t):0}else{let n;if(j(e)&&!e.group.open){n=e.group.inputs.filter(R)[t.length-1]}else n=e;a=i.indexOf(n)+1}else a=0;for(let n=a;n<i.length;n++){const e=i[n];if(e.visible&&R(e)){if(this.disabledOrReadOnly&&("switch"===e?.inputType||"radio-buttons"===e?.inputType))continue;return e}}return null}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._setFocusableInput(t),"sequential"===this.groupDisplay&&this.viewModel.activeForm.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.activeForm?.allGroupInputs;if(!e.length)return;const t=e.filter(e=>e.open);0===t.length?e[0].open=!0:t.length>1&&t.slice(1).forEach(e=>e.open=!1)}};function fe(e){switch(e){case"audio":return _("audio/mpeg");case"video":return _("video/mp4");case"image":return _("image/png");default:return"camera"}}e([u()],be.prototype,"activeFeatureIndex",null),e([u()],be.prototype,"attachmentsEnabled",null),e([u()],be.prototype,"callbacks",null),e([u()],be.prototype,"disabled",null),e([u()],be.prototype,"effectiveTitle",null),e([u()],be.prototype,"effectiveDisabled",null),e([u()],be.prototype,"disabledOrReadOnly",null),e([u()],be.prototype,"features",null),e([u()],be.prototype,"footerButtonInfos",null),e([u()],be.prototype,"map",null),e([u()],be.prototype,"maximumFeatureCount",null),e([u()],be.prototype,"maximumFeatureCountWithComplexForms",null),e([u()],be.prototype,"spatialReference",null),e([u()],be.prototype,"layerInfos",null),e([u()],be.prototype,"timeZone",null),e([u()],be.prototype,"headingLevel",void 0),e([u()],be.prototype,"icon",null),e([u(),re("esri/t9n/common")],be.prototype,"messagesCommon",void 0),e([u(),re("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],be.prototype,"messages",void 0),e([u(),re("esri/widgets/FeatureForm/t9n/FeatureForm")],be.prototype,"featureFormMessages",void 0),e([u(),re("esri/widgets/FeatureTable/t9n/FeatureTable")],be.prototype,"featureTableMessages",void 0),e([u(),re("esri/core/t9n/Units")],be.prototype,"messagesUnits",void 0),e([u()],be.prototype,"page",null),e([u()],be.prototype,"readOnly",null),e([u()],be.prototype,"showPrompt",null),e([u()],be.prototype,"clearPrompt",null),e([u()],be.prototype,"selectedAttachment",null),e([u()],be.prototype,"selectedAttachmentDetails",null),e([u()],be.prototype,"valid",null),e([u({type:x}),ce(["attachments-change","value-change","values-change","submit"])],be.prototype,"viewModel",void 0),e([u({type:L,nonNullable:!0})],be.prototype,"visibleElements",void 0),e([u()],be.prototype,"groupDisplay",void 0),e([u()],be.prototype,"_formHeaderVisible",null),e([u()],be.prototype,"_associationsEnabled",null),e([u()],be.prototype,"_associationsList",void 0),e([u()],be.prototype,"_attemptFocusOnNextRender",void 0),e([u()],be.prototype,"_formId",null),e([u()],be.prototype,"_focusedFieldInput",void 0),e([u()],be.prototype,"_pendingSubtypeChoice",void 0),e([u()],be.prototype,"_relatedRecordsEnabled",null),e([u()],be.prototype,"_listObserverNode",void 0),e([u()],be.prototype,"_attachmentDialogInfo",void 0),e([u()],be.prototype,"_attachmentListFilterText",void 0),e([u()],be.prototype,"_prompt",void 0),e([u()],be.prototype,"test",null),be=e([h("esri.widgets.BatchAttributeForm")],be);const _e=be;export{_e as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as i}from"../core/deprecate.js";import a from"../core/Logger.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{destroyMaybe as s}from"../core/maybe.js";import l from"../core/ReactiveMap.js";import{watch as o,when as r,on as c,sync as d}from"../core/reactiveUtils.js";import{formatFileSize as m}from"../core/unitFormatUtils.js";import{property as u,subclass as h}from"../core/accessorSupport/decorators.js";import{formatDate as p}from"../intl/date.js";import{isIntegerField as g}from"../layers/support/fieldUtils.js";import{isString as v}from"../support/guards.js";import b from"./Widget.js";import{getAttachmentTypeCategory as f,getCalciteIconForAttachment as _}from"./Attachments/support/attachmentUtils.js";import{getAttachmentKey as C,isImageAttachment as y,getAttachmentFilenameParts as A}from"./BatchAttributeForm/attachmentUtils.js";import{getHiddenFieldsValidationErrorMessage as w,getVisibleFieldInputValidationErrorMessage as F,isElementTemplateWithInputType as I,subtypeChangeShouldPrompt as k,flattenInputs as M}from"./BatchAttributeForm/batchAttributeFormUtils.js";import x from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as D}from"./BatchAttributeForm/css.js";import{makeViewingEditedAttachmentFooterButtons as S,makeViewingAttachmentFooterButtons as E,makeCancelFooterButton as O,makeDefaultFooterButtons as T}from"./BatchAttributeForm/interfaceUtils.js";import L from"./BatchAttributeForm/VisibleElements.js";import{isMultipleChoiceController as V}from"./BatchAttributeForm/inputs/support/controllerUtils.js";import{isGroupInput as R,isFieldInput as N,isTextElementInput as U,isRelationshipElementInput as P,isAttachmentElementInput as B,isUtilityNetworkAssociationsElementInput as $,differentValuesString as z,getNormalizedFieldName as j,isGroupedInput as H}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{clearMultipleChoiceOtherChoiceStateForViewModel as W,otherChoiceCheckedPlaceholderValue as G,canRestoreMultipleChoiceOtherChoiceDraftValue as Z}from"./BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js";import{loadRelationshipDetailsComponents as q,RelationshipDetails as K}from"./BatchAttributeForm/rendered-content/RelationshipDetails.js";import{Prompt as X}from"./Editor/components/Prompt.js";import{downloadAttachmentInfo as J}from"./FeatureTable/support/exportUtils.js";import{loadCalciteComponents as Q}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as Y,getIntlOptionsForField as ee,prepareISOFieldValueForDateComponents as te,prepareUnixFieldValueForDateComponents as ie,normalizeTimeOnlyString as ae,getISOFieldValueFromDateComponents as ne,getUnixFieldValueFromDateComponents as se}from"./support/dateUtils.js";import{globalCss as le}from"./support/globalCss.js";import{Heading as oe}from"./support/Heading.js";import{calciteListFilterProps as re}from"./support/listUtils.js";import{messageBundle as ce,vmEvent as de,tsx as me}from"./support/widget.js";import{setFocus as ue}from"./support/widgetUtils.js";import{isEmptyValue as he}from"./support/forms/formUtils.js";const pe="data-element-id",ge="data-field-name",ve="esri_BatchAttributeForm_select_all",be="esri_BatchAttributeForm_other_choice";let fe=class extends b{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureFormMessages=null,this.featureTableMessages=null,this.messagesUnits=null,this.viewModel=new x,this.visibleElements=new L,this.groupDisplay="all",this._associationsList=null,this._associationsWidgetsMap=new l,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._pendingSubtypeChoice=null,this._batchSwitchInputInitialValues=new Map,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this.viewModel.activeRelationshipInput?.incrementPage()},{root:window.document}),this._attachmentDialogInfo=null,this._attachmentListFilterText="",this._attachmentFileInputMap=new Map,this._prompt=null,this._selectedAttachmentReplaceFileInput=null,this._afterListObserverCreated=e=>{this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)},this._afterListObserverRemoved=()=>{this._listObserverNode=null},this._maximizeSelectedAttachment=()=>{this._attachmentDialogInfo=this.selectedAttachmentDetails},this._enterAttachmentReplaceView=()=>{const e=this.selectedAttachmentDetails;this._canReplaceSelectedAttachment()&&e&&(e.input.clearValidationCriteriaState(),this.viewModel.setShowingSelectedAttachmentReplacePage(!0))},this._setSelectedAttachmentReplaceFileInput=e=>{this._selectedAttachmentReplaceFileInput=e},this._openSelectedAttachmentReplaceFilePicker=()=>{this._canReplaceSelectedAttachment()&&this._selectedAttachmentReplaceFileInput?.click()},this._resetSelectedAttachmentName=()=>{const e=this.selectedAttachmentDetails;if(!e?.attachment)return;const t=e.input.getAttachmentEditState(e.attachment).initialName;if(null==t)return;const i=e.input.template.elementId,a=C(e.attachment);this.viewModel.stageRenameAttachment(i,a,t)},this._closeAttachmentDialog=()=>{this.hideAttachmentDialog()},this._saveInputFromElement=this._saveInputFromElement.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{i(a.getLogger(this),"Editor","arcgis-editor",{version:"5.0"})})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...i}=e;return i}initialize(){this.addHandles([o(()=>this.features.toArray(),()=>{this._dateComponentMap.clear(),W(this.viewModel,{includeDraftValues:!0})}),o(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear(),this._resetTransientFormState(),W(this.viewModel),this._setFocusableInput()}),o(()=>this.viewModel.selectedAttachmentAddElementId,()=>{this.hideAttachmentDialog()}),r(()=>!this.selectedAttachmentDetails,()=>this.hideAttachmentDialog()),o(()=>this.viewModel.selectedAttachmentListElementId,()=>{this._attachmentListFilterText=""}),o(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),c(()=>this.viewModel,"submit",()=>{this.valid||this.goToFirstError()}),o(()=>[this._associationsEnabled,this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs],()=>this._setUpAssociationsWidgets(),d),o(()=>this.viewModel.activeAssociationsInput,e=>this._onActiveAssociationsInputChange(e)),o(()=>this.groupDisplay,()=>this._syncGroupInputStates())])}loadDependencies(){return Promise.all([Q({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")}),q()])}destroy(){this._destroyAssociationsWidgets(),this._associationsList=s(this._associationsList),this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get effectiveTitle(){const{features:e,messages:t,page:i}=this;return t?"replacing-attachment"===i?t.titles.replaceAttachment:"viewing-attachment-details"===i?t.titles.editAttachment:"adding-attachments"===i?t.titles.addAttachments:"viewing-attachments"===i?t.titles.attachments:1===e.length||this.activeFeatureIndex>-1?t.titles.editFeature:e.length>1?t.titles.editFeatures:"":""}get effectiveDisabled(){return this.disabledOrReadOnly||this.viewModel.updating}get disabledOrReadOnly(){return this.disabled||this.readOnly}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get footerButtonInfos(){if(!this.features.length||!this.messages||!this.messagesCommon)return[];const{messages:e,messagesCommon:t,page:i}=this,a=this.effectiveDisabled;if("adding-attachments"===i||"replacing-attachment"===i)return[];if("viewing-attachment-details"===i){const t=this.selectedAttachmentDetails,i=t?.input?.getAttachmentEditState(t.attachment);if(!t?.input||!i)return[];return i.isRenamed||i.isReplaced?S({doneOnclick:()=>this._setSelectedAttachment(null),messages:e.footerButtons,resetOnclick:()=>this._resetSelectedAttachmentChanges(),resetDisabled:this._disableAttachmentModification(t.input)}):E({deleteDisabled:this._disableAttachmentModification(t.input),deleteOnclick:()=>this._deleteSelectedAttachment(),doneOnclick:()=>this._setSelectedAttachment(null),messages:e.footerButtons})}return"viewing-associated-features"===i?O({messages:t,purpose:"cancel-viewing-associated-features",onclick:()=>this.goBack()}):"viewing-associated-layers"===i?O({messages:t,purpose:"cancel-viewing-associated-layers",onclick:()=>this.goBack()}):"viewing-attachments"===i||"viewing-related-records"===i?[]:T({disabled:a||!this.valid,formId:this._formId,messages:e,callback:()=>this.submit()})}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}get page(){return this.viewModel.page}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}get selectedAttachment(){return this.viewModel.selectedAttachment}get selectedAttachmentDetails(){return this.viewModel.selectedAttachmentDetails}get valid(){return this.viewModel.valid}get _formHeaderVisible(){return!("batch"===this.viewModel.mode||!this.viewModel.activeFeature)&&!(!this.viewModel.formDescription&&!this.viewModel.formTitle)}get _associationsEnabled(){const{callbacks:e}=this;return!(!e?.addAssociation&&!e?.editAssociatedFeature)}get _formId(){return`${this.id}-form`}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!e.addRelatedRecord&&!e.editRelatedRecord)}async goBack(){return this.viewModel.goBack()}async goHome(){return this.viewModel.goHome()}goToFirstError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),this._setFocusableInput(e.input),this.scheduleRender()}render(){return me("div",{class:this.classes(D.base,le.widget,le.panel)},this._renderContent(),this._renderAttachmentDialog(),this._prompt?me(X,{...this._prompt,headingLevel:this.headingLevel}):void 0)}setActiveAssociationsInput(e){this.viewModel.setActiveAssociationsInput(e)}setActiveAssociationsLayer(e){this.viewModel.setActiveAssociationsLayer(e)}setActiveAssociationType(e){this.viewModel.setActiveAssociationType(e)}submit(){return this.viewModel.submit()}get test(){return{saveInput:this._saveInput.bind(this),pendingSubtypeChoice:this._pendingSubtypeChoice}}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:i}=e.dataset,a=n(this._dateComponentMap,`${i}`,()=>({}));switch(t){case"date":a.date=e;break;case"time":a.time=e;break;case"timeZone":a.timeZone=e}}_renderContent(){const{messages:e,viewModel:i}=this,{status:a}=i;return"failed"===a?i.hasTooManyComplexFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyComplexFeatures,{num:i.maximumFeatureCountWithComplexForms})):i.hasTooManyFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyFeatures,{num:i.maximumFeatureCount})):e.formFailedToLoad:i.hasLayersWithContingentValues&&this.viewModel.features.length>1?this._renderErrorNotice(e.unsupportedContingentValues):"loading"===a&&this.visibleElements.loadingIndicator?me("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):0!==this.features.length?this._renderForm():void 0}_renderErrorNotice(e,t="warning"){return me("calcite-notice",{class:D.noticeError,icon:!0,kind:t,open:!0},me("div",{slot:"message"},e))}_renderForm(){return me("form",{class:D.form,id:this._formId,inert:!!this._prompt,onsubmit:this._onFormSubmit},this.viewModel.expressionEvaluationFailed&&this.visibleElements.expressionsErrorNotice&&this._renderErrorNotice(this.messages.expressionEvaluationFailed),this._renderInvisibleFieldsError(),this._renderPage())}_renderPage(){switch(this.page){case"adding-attachments":return this._renderAttachmentAddPage();case"viewing-attachment-details":case"replacing-attachment":return this._renderAttachmentDetailPage();case"viewing-attachments":return this._renderAttachmentListPage();case"viewing-associated-layers":case"viewing-associated-features":return this._renderViewingAssociationsPage();case"viewing-related-categories":case"viewing-related-records":return this._renderRelationshipListPage();default:return this._renderDefaultPage()}}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let a;if(!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(a=w(i,e.mode,this.messages),"batch"===this.viewModel.mode){const e=i.invalidHiddenInputs.filter(e=>"hidden:group-visibility-expression:all-features"===e.effectiveVisibilityCode||"hidden:visibility-expression:all-features"===e.visibilityCode);e.length>0?a+=` (${e.map(e=>e.label).join(", ")})`:a=null}else a=null;else if(t)return null;return a?this._renderErrorNotice(a,"danger"):null}_renderDefaultPage(){return[this._renderReadOnlyNotice(),this._renderFormHeader(),this._renderFormContent()]}_renderReadOnlyNotice(){if((this.disabled||this.readOnly)&&this.visibleElements.readOnlyNotice)return me("calcite-notice",{class:D.disabledNotice,"data-testid":"read-only-notice",icon:"read-only-non-editable",kind:"brand",open:!0,scale:"s",width:"full"},me("div",{slot:"message"},this.featureFormMessages.disabledForm))}_renderFormHeader(){const{formTitle:e,formDescription:t}=this.viewModel;if(!this._formHeaderVisible)return;const i=e?me(oe,{key:"title",level:this.headingLevel},e):void 0,a=t?me("p",{class:D.description,key:"description"},t):void 0;return me("div",{class:D.formHeader},i,a)}_renderFormContent(){return this.viewModel.hasVisibleInputs?this.viewModel.activeForm.inputs.filter(e=>e.visible).map(e=>this._renderInput(e)):this._renderErrorNotice(this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason])}_renderInput(e){return R(e)?this._renderGroupInput(e):N(e)?this._renderLabeledField(e):U(e)?this._renderTextComponent(e):P(e)?this._renderRelationshipElementInput(e):B(e)?this._renderAttachmentElementInput(e):$(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:a}=e,n=t.filter(e=>e.visible),s=e.label??"",l=this._focusedFieldInput?.group===e,o="sequential"===this.groupDisplay;return me("calcite-block",{class:this.classes(D.group,o?D.groupSequential:null,l?D.groupActive:null,this.disabled?D.inputDisabled:null),collapsible:!0,description:e.description??void 0,expanded:a,heading:s,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:s,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0},onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},n.map(e=>this._renderInput(e)))}_renderLabeledField(e){const{elementId:i}=e.template,{label:a,required:n,dataType:s}=e,l=n?t(this.messages.requiredFieldLabel,{name:a}):a;return me("calcite-label",{"aria-label":l,class:D.label,key:`field--${i}`},me("div",{class:D.labelTextContent,key:"labelTextContainer"},a,n?me("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==s?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:i}=e,a=this._getMultipleChoiceController(e);return"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):a?this._renderMultipleChoiceComponent({input:e,props:t}):"date"===i?this._renderDateComponents(e,t):(t.disabled=this.disabled,t.readOnly=t.readOnly||this.viewModel.updating,"number"===i?this._renderNumberComponent(e,t):this._renderStringComponent(e,t))}_renderAuxiliaryText(e){const{description:t}=e,i=this._getErrorToDisplay(e),a=i?F(e,i,this.messages):null;return a?me("calcite-input-message",{icon:!0,status:"invalid"},a):e.valueIsOutOfDomain&&(this._touchedInputs.has(e.template.elementId)||this.viewModel.submitHasBeenAttempted)?me("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):t?me("calcite-input-message",{class:D.description,icon:!1,status:"idle"},t):null}_renderCodedInputs({input:e,props:t}){const i=e.input?.type??null,a=e.codedValueOptions;switch(i){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:a,props:t});default:return this._renderComboBoxComponent({options:a,props:t,input:e})}}_renderMultipleChoiceComponent({input:e,props:t}){const{messages:i}=this,a=this._getMultipleChoiceController(e);if(!a)return null;const{input:n}=a,s=!0===n.includeSelectAllChoices,{checkboxStatesByValue:l,selectAllState:o}=a.selectionState,r=o.checked?i.deselectAllLabel:i.selectAllLabel,c=a.otherChoiceRenderState,d=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:!0})},m=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t})},u=t=>{const{fieldName:i}=c;i&&this._saveOtherChoiceCheckboxValue({input:e,isChecked:t.checked,otherChoiceFieldName:i})},h=t=>{this._saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:c.fieldName??void 0})};return me("div",{class:D.multipleChoiceInput,key:`${t.key}-multiple-choice-group`},s?this._renderMultipleChoiceSelectAllCheckbox({props:t,selectAllState:o,selectAllLabel:r,handleSelectAllCheckboxChange:d}):null,this._renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:l,handleChoiceCheckboxChange:m}),c.shouldShow?this._renderMultipleChoiceOtherChoice({props:t,includeSelectAllChoices:s,otherChoiceRenderState:c,handleOtherChoiceCheckboxChange:u,handleOtherChoiceInputChange:h,differentValuesPlaceholder:i.differentValuesPlaceholder}):null)}_renderMultipleChoiceSelectAllCheckbox({props:e,selectAllState:t,selectAllLabel:i,handleSelectAllCheckboxChange:a}){return me("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:t.checked,class:D.multipleChoiceSelectAll,"data-element-id":e[pe],disabled:e.readOnly||e.disabled,indeterminate:t.indeterminate,key:`${e.key}-select-all`,label:i,labelText:i,value:ve,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>a(e),onfocus:e.onfocus})}_renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:i,handleChoiceCheckboxChange:a}){const n=this._getMultipleChoiceController(e);if(!n)return[];const{choices:s}=n;return s.map(e=>{const n=i.get(e.value)??{checked:!1,indeterminate:!1};return me("calcite-checkbox",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,"aria-invalid":t["aria-invalid"],checked:n.checked,class:t.class,"data-element-id":t[pe],disabled:t.readOnly||t.disabled,indeterminate:n.indeterminate,key:`${t.key}-${e.value}`,label:e.label,labelText:e.label,value:e.value,onblur:t.onblur,onCalciteCheckboxChange:({currentTarget:e})=>a(e),onfocus:t.onfocus})})}_renderMultipleChoiceOtherChoice({props:e,includeSelectAllChoices:t,otherChoiceRenderState:i,handleOtherChoiceCheckboxChange:a,handleOtherChoiceInputChange:n,differentValuesPlaceholder:s}){const l=i.label??this.messages.otherOptionLabel;return me("div",{class:this.classes(D.multipleChoiceOtherChoice,t?D.multipleChoiceOtherChoiceWithSelectAll:null),key:`${e.key}-other-choice`},me("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:i.checkboxState.checked,class:e.class,"data-element-id":e[pe],disabled:e.readOnly||e.disabled,indeterminate:i.checkboxState.indeterminate,key:`${e.key}-other-choice-checkbox`,label:l,labelText:l,value:be,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>a(e),onfocus:e.onfocus}),i.checkboxState.checked?me("calcite-input",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],"aria-label":l,class:D.textElementInput,"data-element-id":e[pe],disabled:e.readOnly||e.disabled,key:`${e.key}-other-choice-input`,maxLength:i.maxLength,placeholder:i.value===z?s:i.hint,status:i.status,type:"text",value:i.normalizedValue===z?"":i.normalizedValue?String(i.normalizedValue):"",onblur:e.onblur,onCalciteInputInput:({currentTarget:e})=>n(e),onfocus:e.onfocus}):null)}async _saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:i=!1}){this._markFieldInputTouched(e);const a=this._getMultipleChoiceController(e);if(!a)return;if(a.input&&!i&&"batch"===this.viewModel.mode)return void await this._saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t});const n=e.value,s=this._parseValue(t,e,i);s!==n&&await this.viewModel.setValue(e.template.elementId,s)}async _saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:i}){if(!i)return;const a=t.value,n=null==a||""===a?null:a,s=this._getMultipleChoiceController(e);if(!s)return;s.initializeExplicitOtherChoiceCheckedState(),s.stashOtherChoiceDraftValueForFeatures(e.features,n);const l=j(e,i);l&&await this.viewModel.setValueForFieldName(l,n,Array.from(e.features,e=>e.source))}async _saveOtherChoiceCheckboxValue({input:e,isChecked:t,otherChoiceFieldName:i}){const a=this._getMultipleChoiceController(e);if(!a)return;a.setExplicitOtherChoiceCheckedState(t),this._markFieldInputTouched(e),t||a.setOtherChoiceDraftValuesFromFeatures(e.features.toArray());const n=j(e,i);if(!n)return;const s=new Map;for(const l of e.features){const e=l.getAttribute(i);if(t){if(!he(e))continue;const t=a.getOtherChoiceDraftValue(l),i=Z(t)?t:G;s.set(l,i);continue}null!=e&&s.set(l,null)}0!==s.size&&await this.viewModel.setValuePerFeatureForFieldName(n,new Map(Array.from(s,([e,t])=>[e.source,t])))}async _saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t}){const i=this._getMultipleChoiceController(e);if(!i)return;const a=new Map(e.features.map(a=>[a,i.getUpdatedValueForFeature({choiceValue:t.value,currentValue:a.getAttribute(e.fieldName),isChecked:t.checked})]));0!==a.size&&await this.viewModel.setFieldInputValuePerFeature(e,a)}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===z||e.value===z)&&"batch"===this.viewModel.mode){const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[pe]:t[pe]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:i,options:[{name:this.messages.differentValuesPlaceholder,value:z,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return me("calcite-switch",{...t,checked:!!I(e.template,"switch")&&e.value===e.template.input.onValue,class:D.inputSwitch,disabled:t.readOnly||t.disabled,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInputFromElement(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:i}){const{trigger:a,dropdown:n,group:s}=i;return me("calcite-dropdown",{...n,topLayerDisabled:this.topLayerDisabled,onblur:()=>{this._focusedFieldInput=null},onCalciteDropdownSelect:({currentTarget:e})=>this._saveInputFromElement(e),onfocus:this._onComponentFocus},me("calcite-button",{...a},e===z?this.messages.differentValuesPlaceholder:e),me("calcite-dropdown-group",{selectionMode:s.mode},t.map(t=>me("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:i}){const a="INSERT"===this.viewModel.editType,n=this._touchedInputs.has(e?.template?.elementId),s=a&&e.showNoValueOptionEnabled&&!n?()=>{}:i.onblur,l={...i,onblur:s};return me("calcite-combobox",{...l,clearDisabled:e.isSubtypeField,selectionMode:"single",topLayerDisabled:this.topLayerDisabled,value:i.placeholder===this.messages.differentValuesPlaceholder?z:String(i.value),onCalciteComboboxChange:({currentTarget:t})=>{t.value!==z&&(e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveInputFromElement(t))}},this.renderComboboxOptionsList({input:e,options:t,props:i}))}renderComboboxOptionsList({input:e,options:t,props:i}){const a=e=>e.map(e=>{const{value:t}=e,a=he(e.value)?this.messages.empty:e.name;return me("calcite-combobox-item",{heading:a,key:`#${t}`,selected:i.value===t,value:`${t}`})});let n=[];const{messages:s}=this;t.other.length>0&&n.push(me("calcite-combobox-item-group",{key:"other",label:s.other},a(t.other))),t.unsupported.length>0&&n.push(me("calcite-combobox-item-group",{key:"unsupported",label:s.unsupported},a(t.unsupported)));const l=a(t.recommended);n.length>0?n.unshift(me("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):n=l;const o=i.placeholder===this.messages.differentValuesPlaceholder,r=!o&&he(i.value);return e.showNoValueOptionEnabled&&!t.containsEmptyOption&&n.unshift(me("calcite-combobox-item",{heading:e.showNoValueLabel||this.messages.empty,key:"empty-option",selected:r,value:""})),o&&n.unshift(me("calcite-combobox-item",{heading:this.messages.differentValuesPlaceholder,key:z,selected:!0,value:z})),n}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const a=[...t.recommended,...t.other,...t.unsupported].map(({name:t,value:a})=>this._renderRadioButtons({label:t,value:a,selected:a===e.value,props:i}));if(e.showNoValueOptionEnabled&&!t.containsEmptyOption){const t="",n=e.showNoValueLabel||this.messages.empty,s=he(e.value);a.unshift(this._renderRadioButtons({label:n,value:t,selected:s,props:i}))}return me("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:D.inputRadioGroup,"data-field-name":i[ge],disabled:i.readOnly||i.disabled,key:`${i.key}-radio-group`,layout:"vertical",name:`${i.name}-${this.id}`,required:i.required},a,i.placeholder===this.messages.differentValuesPlaceholder?me("calcite-label",{class:D.placeholderRadio,key:i.label,layout:"inline"},me("calcite-radio-button",{checked:!0,class:D.inputRadio,disabled:!0,value:i.placeholder}),i.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:i,props:a}){return me("calcite-label",{class:D.inputRadioLabel,key:a.label,layout:"inline"},me("calcite-radio-button",{...a,afterCreate:void 0,afterUpdate:void 0,checked:t,class:D.inputRadio,disabled:a.readOnly||a.disabled,name:void 0,value:e,onblur:()=>{this._focusedFieldInput=null},onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInputFromElement(e)}}),i)}_renderStringComponent(e,t){const{template:i}=e;return!i.field.editable||this.readOnly?this._renderReadOnlyComponent(e):"text-area"===i.input?.type?me("calcite-text-area",{...t,class:this.classes(D.individualElement),resize:"vertical",value:t.value?String(t.value):"",onblur:i=>{t.onblur(i),e.userHasChangedValue&&this._saveInputFromElement(i.currentTarget)},onCalciteTextAreaInput:t=>{e.userHasChangedValue=!0,""===t.currentTarget.value&&this._saveInputFromElement(t.currentTarget)}}):me("calcite-input",{...t,class:this.classes(D.individualElement),type:"text",value:t.value?String(t.value):"",onblur:i=>{t.onblur(i),e.userHasChangedValue&&this._saveInputFromElement(i.currentTarget)},onCalciteInputInput:t=>{e.userHasChangedValue=!0,""===t.currentTarget.value&&this._saveInputFromElement(t.currentTarget)}})}_renderNumberComponent(e,t){const i=g(e.field);return me("calcite-input-number",{...t,integer:i,step:i?1:"any",type:"number",value:i&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onblur:i=>{t.onblur(i),e.userHasChangedValue&&this._saveInputFromElement(i.currentTarget)},onCalciteInputNumberInput:t=>{e.userHasChangedValue=!0,""===t.currentTarget.value&&this._saveInputFromElement(t.currentTarget)}})}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return me("calcite-input",{...i,class:this.classes(D.fieldInput,D.inputDisabled,D.individualElement),readOnly:!0,type:"text",value:String(t??i.value??"")})}_renderDateComponents(e,t){const{field:i}=e;let a;switch(i.type){case"date":a=this._renderDateFieldComponents(e,t);break;case"date-only":a=this._renderDateOnlyFieldComponent(e,t);break;case"time-only":a=this._renderTimeOnlyFieldComponent(e,t);break;case"timestamp-offset":a=this._renderTimestampOffsetFieldComponents(e,t);break;default:a=this._renderReadOnlyComponent(e,Y(i,t.value,{timeZone:e.effectiveTimeZone,...ee(e.template.field)}))}return e.value===z?[a,me("calcite-input-message",{icon:"information",key:"diff-values-message",status:"idle"},this.messages.differentValues)]:a}_renderDateOnlyFieldComponent(e,t){const{class:i,disabled:a,key:n,readOnly:s}=t,{rawMax:l,rawMin:o}=e.range;return me("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,class:i,"data-date-part":"date","data-element-id":t[pe],"data-field-name":t[ge],disabled:a,key:`${n}-date-input`,max:v(l)?l:void 0,min:v(o)?o:void 0,overlayPositioning:"fixed",readOnly:s,topLayerDisabled:this.topLayerDisabled,value:e.value===z?"":e.value?String(e.value):"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:this._onComponentFocus})}_renderTimeOnlyFieldComponent(e,t){const{class:i,disabled:a,key:n,readOnly:s}=t;return me("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,class:i,"data-date-part":"time","data-element-id":t[pe],"data-field-name":t[ge],disabled:a,key:`${n}-time-input`,overlayPositioning:"fixed",readOnly:s,step:e.timeStep,value:e.value===z?"":e.value?String(e.value):"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:this._onComponentFocus})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,disabled:a,key:n,readOnly:s}=t,{rawMax:l,rawMin:o}=e.range,r=e.effectiveTimeZone,c=te(l,r),d=te(o,r),m=te(e.value===z?"":e.value,r),u=e.includeTimeOffset,h={afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,disabled:a,[pe]:t[pe],[ge]:t[ge],onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:s};return me("div",{class:D.dateInputContainer,key:`${n}-date-time-container`},me("calcite-input-date-picker",{...h,class:i,"data-date-part":"date",key:`${n}-date-input`,max:c?.date??void 0,min:d?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:m.date??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),me("calcite-input-time-picker",{...h,class:i,"data-date-part":"time",key:`${n}-time-input`,step:e.timeStep,value:m.time??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),u?me("calcite-input-time-zone",{...h,class:i,clearable:e.value===z||null==e.value,"data-date-part":"timeZone",key:`${n}-timezone-input`,value:m.timeZoneOffset||"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,disabled:a,key:n,readOnly:s,min:l,max:o}=t,r=e.effectiveTimeZone,c=ie(e.value===z?"":e.value,r),d=ie(o,r),m=ie(l,r),u=e.includeTime,h={afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,disabled:a,[pe]:t[pe],[ge]:t[ge],onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:s};return me("div",{class:D.dateInputContainer,key:`${n}-date-time-container`},me("calcite-input-date-picker",{...h,class:i,"data-date-part":"date",key:`${n}-date-input`,max:d?.date??void 0,min:m?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:c.date??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),u?me("calcite-input-time-picker",{...h,"data-date-part":"time",key:`${n}-time-input`,step:1,value:c.time??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}_renderRelationshipElementInput(e){return this._relatedRecordsEnabled?me(K,{afterObserverCreated:this._afterListObserverCreated,afterObserverRemoved:this._afterListObserverRemoved,input:e,messages:this.messages,messagesCommon:this.messagesCommon,viewModel:this.viewModel}):null}_renderRelationshipListPage(){const{activeRelationshipInput:e}=this.viewModel;if(e)return this._renderRelationshipElementInput(e)}_renderAttachmentElementInput(e){if(!this.attachmentsEnabled)return;const{allAttachmentsVisibleOnDefaultPage:t,attachments:i,defaultPageAttachments:a,template:{description:n,elementId:s,label:l}}=e,o=t?i:a;return me("div",{class:D.attachmentElementInput,"data-testid":`attachment-element-${s}`,key:`attachment-element-${s}`},l?me("div",{class:D.attachmentElementLabel,key:`attachment-element-label-${s}`},l):null,n?me("div",{class:D.description,key:`attachment-element-description-${s}`},n):null,i.length?this._renderAttachmentList(e,o,{label:l||this.messagesCommon.details,viewAllCount:t?null:i.length}):me("div",{class:D.attachmentElementEmptyState,key:`attachment-element-empty-state-${s}`},this.messages.attachments.noAttachments),this._renderAttachmentAddAction(e))}_renderAttachmentListPage(){const e=this.viewModel.selectedAttachmentListInput;if(e)return me("div",{class:D.attachmentElementAllPanel,key:`attachment-element-all-panel-${e.template.elementId}`},this._renderAttachmentList(e,e.attachments,{filterEnabled:!0,label:this.messages.titles.attachments}))}_renderAttachmentList(e,t,i){const{filterEnabled:a,label:n,viewAllCount:s}=i;return me("calcite-list",{class:D.attachmentElementList,filterEnabled:a,filterPlaceholder:a?this.messages.attachments.searchAttachments:void 0,filterProps:a?re:void 0,filterText:a?this._attachmentListFilterText:void 0,label:n,selectionAppearance:"border",selectionMode:"none",onCalciteListFilter:a?e=>{this._attachmentListFilterText=e.currentTarget.filterText??""}:void 0},this._renderAttachmentListItems(e,t),null!=s?this._renderViewAllAttachmentsItem(e,s):null)}_renderAttachmentListItems(e,t){const{elementId:i}=e.template;return t.map((t,a)=>{const n=this._formatAttachmentSize(t.size),s=this._getAttachmentLabel(t,a,n,e.displayFilename),l=s===n?void 0:n,o=C(t),r=e.isStagedAttachmentAddition(t),c=e.getAttachmentEditState(t),d=c.isDeleted,m=!d&&(r||c.isRenamed||c.isReplaced);return me("calcite-list-item",{class:D.attachmentElementListItem,description:l,key:`attachment-item-${o}`,label:s,onCalciteListItemSelect:r||d?void 0:()=>this._setSelectedAttachment({attachmentKey:o,elementId:i})},me("div",{class:D.attachmentElementListItemStart,slot:"content-start"},this._renderAttachmentPreviewThumbnail(t,s,e)),m?me("span",{class:D.attachmentElementListItemStagedIndicator,slot:"content-end"}):null,r?[me("calcite-action",{disabled:this._disableAttachmentModification(e),icon:"x",scale:"s",slot:"actions-end",text:this.messagesCommon.delete,title:this.messagesCommon.delete,onclick:()=>this.viewModel.stageDeleteAttachment(i,C(t))})]:d?me("calcite-chip",{label:this.messages.attachments.deleted,scale:"s",slot:"content-end"},this.messages.attachments.deleted):me("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))})}_renderViewAllAttachmentsItem(e,i){const{elementId:a}=e.template,{viewAll:n}=this.messages.attachments;return me("calcite-list-item",{class:D.attachmentElementListItem,description:t(this.messages.attachments.count,{count:i}),key:`attachment-item-view-all-${a}`,label:n,onCalciteListItemSelect:()=>this._setAttachmentListElementId(a)},me("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderAttachmentAddAction(e){const{elementId:t}=e.template,i=this.effectiveDisabled||e.addDisabled,a=this._renderAttachmentCountLimitsLabel(e),n=this._getAttachmentNoticeMessage(e),s=e.hasMinimumAttachmentCountNotMet||e.hasExceededAttachmentLimit?"danger":"info",l=e.canUploadFiles,o=e.isCaptureOnly&&!this.effectiveDisabled&&!n;return me("div",{class:D.attachmentElementAddActions,key:`attachment-element-add-actions-${t}`},l?me("calcite-button",{appearance:"outline",disabled:i,iconStart:"attachment",kind:"neutral",round:!0,scale:"s",onclick:()=>this._setAttachmentAddElementId(t)},this.messages.attachments.attach):null,this._renderAttachmentCaptureButton(e),o?this._renderAttachmentCaptureDisabledNotice(t):null,a?me("div",{class:D.attachmentElementEmptyActionHint},a):null,!this.effectiveDisabled&&n?me("calcite-notice",{closable:!1,icon:"danger"===s?"exclamation-mark-circle":"lightbulb",kind:s,open:!0,scale:"s",width:"full"},me("div",{slot:"message"},n)):null)}_renderAttachmentCaptureButton(e){if(!e.hasCaptureInputs)return null;const t=e.captureMediaType;return me("calcite-button",{appearance:"outline",disabled:!0,iconStart:_e(t),kind:"neutral",round:!0,scale:"s"},this._getCaptureButtonLabel(t))}_getAttachmentNoticeMessage(e){const t=this.messages.attachments;return e.hasUnsupportedFileTypeValidationError?this._getUnsupportedFileTypeMessage():e.hasMinimumAttachmentCountNotMet&&this._shouldShowMinimumAttachmentNotice(e)?t.minimumNotMet:e.hasExceededAttachmentLimit?t.attachmentLimitExceeded:e.hasReachedAttachmentLimit?t.attachmentLimitReached:null}_shouldShowMinimumAttachmentNotice(e){return e.hasAttachmentChanges||this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId)}_getCaptureButtonLabel(e){const{capture:t,recordAudio:i,takePhoto:a,takeVideo:n}=this.messages.attachments;switch(e){case"image":return a||t;case"video":return n||t;case"audio":return i||t;default:return t}}_renderAttachmentAddPage(){const e=this.viewModel.selectedAttachmentAddInput;return e?this._renderAttachmentAddPanel(e):null}_renderAttachmentAddPanel(e){const{maxAttachmentCount:t}=e,{elementId:i}=e.template;if(e.isCaptureOnly)return this._renderAttachmentCaptureDisabledNotice(i);const a=null==t||t-e.attachments.length>1,n=this.effectiveDisabled||e.addDisabled,s=this.messages.attachments,l=s.dragAndDropFile,o="upload",r=e=>{this._attachmentFileInputMap.set(i,e)};return me("div",{class:D.attachmentElementAddPanel,key:`attachment-element-add-panel-${i}`},me("input",{accept:e.accept,afterCreate:r,afterRemoved:()=>{this._attachmentFileInputMap.delete(i)},afterUpdate:r,class:D.attachmentElementFileInput,"data-element-id":i,disabled:n,multiple:a,type:"file",onchange:e=>{const t=e.currentTarget,a=t.files?Array.from(t.files):[];this._stageAttachmentFiles(i,a),t.value=""}}),me("div",{class:D.attachmentElementAddDropzone,"data-disabled":n?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),n)return;const t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this._stageAttachmentFiles(i,t)}},me("calcite-icon",{class:D.attachmentElementAddDropzoneIcon,icon:o,scale:"l"}),me("div",{class:D.attachmentElementAddDropzoneHeading},s.addFile),me("div",{class:D.attachmentElementAddDropzoneDetail,title:l},l),me("calcite-button",{appearance:"transparent",disabled:n,iconStart:"folder-open",kind:"brand",scale:"s",type:"button",onclick:e=>{e.stopPropagation(),this._openAttachmentFilePicker(i,n)}},s.selectFile)),this._renderAttachmentValidationCriteria(e,{includeCountCriteria:!0}))}_renderAttachmentCaptureDisabledNotice(e){return me("calcite-notice",{class:D.attachmentElementCaptureNotice,icon:!0,key:`attachment-element-capture-disabled-notice-${e}`,kind:"warning",open:!0,scale:"s"},me("div",{slot:"message"},this.messages.attachments.captureMethodNotSupported))}async _stageAttachmentFiles(e,t){if(0===t.length)return;const i=this.viewModel.selectedAttachmentAddInput;let a=!0;try{a=(await this.viewModel.stageAddAttachments(e,t)).length>0&&!i?.hasInvalidValidationCriteria&&!i?.hasUnsupportedFileTypeValidationError}finally{a&&this.viewModel.setSelectedAttachmentAddElementId(null)}}_openAttachmentFilePicker(e,t){t||this._attachmentFileInputMap.get(e)?.click()}_renderAttachmentDetailPage(){const e=this.selectedAttachmentDetails;if(!e)return;if("replacing-attachment"===this.page)return this._renderAttachmentReplacePanel(e);const{attachment:t,input:i}=e,a=C(t),n=!!i.getAttachmentPreviewUrl(t),s=!this._disableAttachmentModification(i)&&i.canUploadFiles,l=i.getAttachmentEditState(t);return me("div",{class:D.attachmentElementDetail,key:`attachment-detail-panel-${i.template.elementId}-${a}`},me("div",{class:D.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,i)),me("div",{class:D.attachmentElementDetailActions},y(t)?me("calcite-button",{appearance:"outline",disabled:!n,iconStart:"expand",kind:"neutral",label:this.messages.attachments.maximize,scale:"m",title:this.messages.attachments.maximize,onclick:this._maximizeSelectedAttachment}):null,me("calcite-button",{appearance:"outline",disabled:!n||l.isReplaced,iconStart:"download",kind:"neutral",label:this.messages.attachments.download,scale:"m",title:this.messages.attachments.download,onclick:()=>{this._downloadAttachment(t)}}),me("calcite-button",{appearance:"outline",disabled:!s,iconStart:"upload-to",kind:"neutral",label:this.messages.attachments.replace,scale:"m",title:this.messages.attachments.replace,onclick:this._enterAttachmentReplaceView})),me("div",{class:D.attachmentElementDetailMetadata},me("div",{class:D.attachmentElementDetailMetadataGroup},me("span",{class:D.attachmentElementDetailMetadataLabel},this.messages.attachments.fileName),this._renderFileNameContent(t,i)),me("div",{class:D.attachmentElementDetailMetadataGroup},me("span",{class:D.attachmentElementDetailMetadataLabel},this.messages.attachments.size),me("span",{class:D.attachmentElementDetailMetadataValue},this._formatAttachmentSize(t.size))),me("div",{class:D.attachmentElementDetailMetadataGroup},me("span",{class:D.attachmentElementDetailMetadataLabel},this.messages.attachments.type),me("span",{class:D.attachmentElementDetailMetadataValue},this._getLabelForAttachmentType(t)))))}_renderFileNameContent(e,t){if(!t.allowUserRename)return me("span",{class:D.attachmentElementDetailMetadataValue},e.name);const i=t.getAttachmentEditState(e),{baseName:a,extension:n}=A(e.name),s=this._disableAttachmentModification(t),l=!s&&0===e.name.trim().length;return[me("div",{class:D.attachmentElementDetailFileNameRow,key:"file-name-row"},me("calcite-input",{class:D.attachmentElementDetailFileNameInput,disabled:s,scale:"m",status:l?"invalid":"idle",suffixText:n,value:a,onCalciteInputInput:({currentTarget:e})=>this._renameSelectedAttachment(e.value)}),me("calcite-button",{appearance:"transparent",disabled:s||null==i.initialName||!i.isRenamed,iconStart:"reset",kind:"neutral",label:this.messages.footerButtons.reset,scale:"m",title:this.messages.footerButtons.reset,onclick:this._resetSelectedAttachmentName})),l?me("calcite-input-message",{icon:!0,key:"file-name-message",status:"invalid"},this.messages.validationErrors.cannotBeNull):null]}_renderAttachmentReplacePanel(e){const{attachment:t,input:i}=e,a=this._disableAttachmentModification(i)||!i.canUploadFiles,n=i.template.elementId;return me("div",{class:D.attachmentElementAddPanel,key:`attachment-replace-panel-${n}-${C(t)}`},me("input",{accept:i.accept,afterCreate:this._setSelectedAttachmentReplaceFileInput,afterRemoved:()=>{this._selectedAttachmentReplaceFileInput=null},afterUpdate:this._setSelectedAttachmentReplaceFileInput,class:D.attachmentElementFileInput,disabled:a,type:"file",onchange:e=>{const t=e.currentTarget,i=t.files?.[0];i&&this._stageSelectedAttachmentReplacement(i),t.value=""}}),me("div",{class:D.attachmentElementAddDropzone,"data-disabled":a?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),a)return;const t=e.dataTransfer?.files?.[0];t&&this._stageSelectedAttachmentReplacement(t)}},me("calcite-icon",{class:D.attachmentElementAddDropzoneIcon,icon:"refresh",scale:"l"}),me("div",{class:D.attachmentElementAddDropzoneHeading},this.messages.attachments.replace),me("div",{class:D.attachmentElementAddDropzoneDetail,title:this.messages.attachments.dragAndDropFile},this.messages.attachments.dragAndDropFile),me("calcite-button",{appearance:"transparent",disabled:a,iconStart:"folder-open",kind:"brand",scale:"s",onclick:e=>{e.stopPropagation(),this._openSelectedAttachmentReplaceFilePicker()}},this.messages.attachments.selectFile)),this._renderAttachmentValidationCriteria(i,{includeCountCriteria:!1}),me("div",{class:D.attachmentElementDetailMetadata},me("div",{class:D.attachmentElementDetailMetadataGroup},me("span",{class:D.attachmentElementDetailMetadataLabel},this.messages.attachments.fileToBeReplaced),me("span",{class:D.attachmentElementDetailMetadataValue},t.name))))}_renderAttachmentDialog(){const e=this._attachmentDialogInfo;if(!e)return null;const{attachment:t,input:i}=e;return me("calcite-dialog",{heading:t.name||this.messagesCommon.details,key:"attachment-preview-dialog",modal:!0,open:!0,placement:"cover",width:"l",onCalciteDialogClose:this._closeAttachmentDialog},me("div",{class:D.attachmentElementDialogPreview},this._renderAttachmentPreviewImageForInput(t,i)))}_setSelectedAttachment(e){e?.elementId&&this._touchedInputs.add(e.elementId),this.viewModel.setSelectedAttachment(e),e||this.hideAttachmentDialog()}_setAttachmentAddElementId(e){e&&this._touchedInputs.add(e),this.viewModel.setSelectedAttachmentAddElementId(e),this.viewModel.selectedAttachmentAddInput?.clearValidationCriteriaState(),this.hideAttachmentDialog()}_setAttachmentListElementId(e){e&&this._touchedInputs.add(e),this.viewModel.setSelectedAttachmentListElementId(e),this.hideAttachmentDialog()}_getAttachmentLabel(e,i,a,n){return!1!==n&&v(e.name)&&e.name.length>0?e.name:a!==this.messagesCommon.notApplicable?a:t(this.messages.attachments.attachmentNumberedLabel,{index:i+1})}_renderAttachmentCountLimitsLabel(e){const t=this.messages.attachments,i=null!=e.minAttachmentCount&&e.minAttachmentCount>0?this._renderAttachmentCountLimitLabel(t.minAttachmentsShort,e.minAttachmentCount,"min"):null,a=null!=e.maxAttachmentCount?this._renderAttachmentCountLimitLabel(t.maxAttachmentsShort,e.maxAttachmentCount,"max"):null;return i||a?[i,i&&a?me("span",{key:"attachment-count-limits-separator"},", "):null,a]:null}_renderAttachmentCountLimitLabel(e,i,a){const n="__count__",[s,l]=t(e,{count:n}).split(n);return me("span",{key:a},s,me("span",{class:D.attachmentElementEmptyActionHintValue},i),l)}_renderAttachmentValidationCriteria(e,{includeCountCriteria:t}){const i=this._getAttachmentValidationCriteria(e,{includeCountCriteria:t}),a=`attachment-validation-criteria-${e.template.elementId}`;return 0===i.length?null:me("div",{class:D.attachmentElementValidationCriteria,key:a},i.map(({key:e,message:t,state:i})=>me("calcite-notice",{appearance:"danger"===i?"outline-fill":"transparent",closable:!1,icon:!0,key:e,kind:i,open:!0,scale:"s",width:"full"},me("div",{slot:"message"},t))))}_getAttachmentValidationCriteria(e,{includeCountCriteria:i}){const a=[],n=e.validationCriterionStates,s=this.messages.attachments,l=this._getNestableAttachmentInputs(e.input);e.hasUnsupportedFileTypeValidationError&&a.push({key:"unsupported-file-type",message:this._getUnsupportedFileTypeMessage(),state:"danger"});for(const o of l)"document"===o.type&&null!=o.maxFileSize&&a.push({key:"maximum-file-size",message:t(s.maximumFileSize,{maxSize:this._formatAttachmentSizeLimitInMegabytes(o.maxFileSize)}),state:n.get("maximum-file-size")??"info"}),"audio"===o.type&&null!=o.maxDuration&&a.push({key:"maximum-audio-length",message:t(s.maximumAudioLength,{maxDuration:this._formatAttachmentDurationLimit(o.maxDuration)}),state:n.get("maximum-audio-length")??"info"}),"video"===o.type&&null!=o.maxDuration&&a.push({key:"maximum-video-length",message:t(s.maximumVideoLength,{maxDuration:this._formatAttachmentDurationLimit(o.maxDuration)}),state:n.get("maximum-video-length")??"info"}),"image"===o.type&&null!=o.maxImageSize&&a.push({key:"maximum-image-size",message:t(s.attachmentMustBeSmallerThan,{maxSize:`${o.maxImageSize}px`}),state:n.get("maximum-image-size")??"info"});return i&&null!=e.minAttachmentCount&&e.minAttachmentCount>0&&a.push({key:"minimum-number-of-files",message:t(s.minimumNumberOfFiles,{count:e.minAttachmentCount}),state:n.get("minimum-number-of-files")??"info"}),i&&null!=e.maxAttachmentCount&&a.push({key:"maximum-number-of-files",message:t(s.maximumNumberOfFiles,{count:e.maxAttachmentCount}),state:n.get("maximum-number-of-files")??"info"}),a}_getNestableAttachmentInputs(e){return null==e?[]:"attachment"===e.type?e.inputTypes?.slice()??[]:[e]}_getUnsupportedFileTypeMessage(){return this.featureTableMessages.errorFileUnsupported}_formatAttachmentSize(e){return null==e||Number.isNaN(e)?this.messagesCommon.notApplicable:m(this.messagesUnits,e)}_formatAttachmentSizeLimitInMegabytes(e){return m(this.messagesUnits,1048576*e)}_formatAttachmentDurationLimit(e){return p(1e3*Math.round(e),{...e>=3600?{hour:"2-digit",hourCycle:"h23"}:{},minute:"2-digit",second:"2-digit",timeZone:"UTC"})}_getLabelForAttachmentType({contentType:e}){if(!e)return this.messagesCommon.notApplicable;const t=this.messages.attachments.attachmentTypes,i=f(e);return t?.[i]||e}_renderAttachmentPreviewThumbnail(e,t,i){const a=i.getAttachmentPreviewUrl(e,64);return a&&y(e)?me("img",{alt:t,class:D.attachmentElementListItemThumb,src:a}):me("calcite-icon",{class:D.attachmentElementListItemIcon,icon:_(e.contentType),scale:"s"})}_renderAttachmentPreviewImageForInput(e,t){const i=t.getAttachmentPreviewUrl(e),a=e.name||this.messagesCommon.details;return i&&y(e)?me("img",{alt:a,class:D.attachmentElementDetailPreviewImage,src:i,title:a}):[me("calcite-icon",{class:D.attachmentElementDetailPreviewIcon,icon:_(e.contentType),scale:"l",textLabel:a,title:a}),this.messages.attachments.noPreviewAvailable]}async _downloadAttachment(e){await J(e)}_canReplaceSelectedAttachment(){return!this.effectiveDisabled&&!!this.selectedAttachmentDetails?.input.canUploadFiles}_exitAttachmentReplaceView(){this.viewModel.setShowingSelectedAttachmentReplacePage(!1),this._selectedAttachmentReplaceFileInput=null}async _stageSelectedAttachmentReplacement(e){const t=this.selectedAttachmentDetails;if(!t?.attachment)return;const i=t.input.template.elementId,a=C(t.attachment);let n=!1;try{n=await this.viewModel.stageReplaceAttachment(i,a,e)}finally{n&&this._exitAttachmentReplaceView()}}_renameSelectedAttachment(e){const t=this.selectedAttachmentDetails;if(!t?.attachment)return;const i=t.input.template.elementId,a=C(t.attachment);this.viewModel.stageRenameAttachment(i,a,e)}_resetSelectedAttachmentChanges(){const e=this.selectedAttachmentDetails;e?.attachment&&this.viewModel.resetAttachmentChanges(e.input.template.elementId,C(e.attachment))}_deleteSelectedAttachment(){const e=this.selectedAttachmentDetails;if(!e?.attachment||this._disableAttachmentModification(e.input))return;const t=e.input.template.elementId,i=C(e.attachment);this.viewModel.stageDeleteAttachment(t,i),this._setSelectedAttachment(null)}_disableAttachmentModification(e){return this.disabledOrReadOnly||!e.editable}hideAttachmentDialog(){this._attachmentDialogInfo=null}_renderTextComponent(e){const{elementId:t}=e.template;return me("div",{class:D.textElementInput,"data-testid":`text-element-${t}`,innerHTML:e.text,key:`text-element-${t}`})}_renderUtilityNetworkAssociationsElementInput(e){if(!this._associationsEnabled)return;const{elementId:t}=e.template;return me("div",{class:D.utilityNetworkAssociationsElementInput,"data-testid":t,key:t},this._associationsWidgetsMap.get(e)?.render())}getCommonInputProps(e){const{template:t,valid:i,value:a,minLength:n,maxLength:s,required:l,fieldName:o,editable:r,userHasChangedValue:c,range:{max:d,min:m}}=e,u=!r||this.readOnly,h=this.disabled||this.viewModel.updating;let p=t.hint??void 0,g=!1;return a===z&&(p=this.messages.differentValuesPlaceholder,g=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":i?"false":"true",class:this.classes(D.fieldInput,u?D.inputDisabled:null),status:!c&&!this.viewModel.submitHasBeenAttempted||i?"idle":"invalid",maxLength:s&&s>-1?s:void 0,minLength:n&&n>-1?n:void 0,key:t.elementId,label:o,name:o,max:null!=d?d:void 0,min:null!=m?m:void 0,disabled:h,readOnly:u,onblur:this._onComponentBlur,required:l,placeholder:p,value:g?"":a??"",[pe]:t.elementId,[ge]:o,onfocus:this._onComponentFocus}}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(pe))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),a=t||i;a&&this._afterComponentCreateOrUpdate(a)}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._isMultipleChoiceCheckbox(t,i)||this._markFieldInputTouched(i),this._focusedFieldInput=i}_markFieldInputTouched(e){this._touchedInputs.add(e.template.elementId)}_isMultipleChoiceCheckbox(e,t){const i=this._getMultipleChoiceController(t);return"CALCITE-CHECKBOX"===e.tagName&&null!=i?.input}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),i=this._focusedFieldInput;this._attemptFocusOnNextRender&&i===t&&(this._attemptFocusOnNextRender=!1,ue(e))}_onComponentBlur(){this._focusedFieldInput=null}_resetTransientFormState(){this._attemptFocusOnNextRender=!1,this._focusedFieldInput=null,this._attachmentDialogInfo=null,this._selectedAttachmentReplaceFileInput=null,this._attachmentListFilterText="",this._attachmentFileInputMap.clear(),this._touchedInputs.clear()}_parseValue(e,t,i=!1){const a=this._getMultipleChoiceController(t);if(a){const{input:t,values:n}=a;if(t&&n){const t=e;return a.getValueFromCheckboxChange({choiceValue:t.value,isChecked:t.checked,isSelectAllCheckbox:i})}}if(I(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const i of t.domain.codedValues)if(i.name===e.selectedItems[0].textContent)return i.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const n=e.value;return null==n||""===n?null:"number"===t.dataType?"-0"===n||"-0."===n||"-0,"===n?n:parseFloat(n):"date"===t.field.type?parseFloat(n):n}_getMultipleChoiceController(e){return V(e.inputController)?e.inputController:null}_saveInputFromElement(e){const t=this._getFieldInputFromHTMLElement(e);if(!t)return;const i=this._parseValue(e,t);this._saveInput(t,i)}_saveInput(e,t){const{elementId:i}=e.template,a=e?.value,{viewModel:s}=this;if(I(e.template,"switch")&&"single"!==s.mode){const t=n(this._batchSwitchInputInitialValues,e,()=>e.value);this._batchSwitchInputInitialValues.set(e,null===t?a:t)}t!==a&&(e.isSubtypeField&&"batch"!==s.mode&&k(s.activeLayer,a,t)?this._pendingSubtypeChoice||(this._pendingSubtypeChoice=this._handleSubtypeChoice(e,t)):s.setValue(i,t))}async _handleSubtypeChoice(e,i){const{value:a,template:n}=e,{elementId:s}=n,{messages:l,viewModel:o,messagesCommon:r}=this,{subtypes:c,activeFeatureIndex:d}=o;if(await o.setValue(s,i),!c?.length)return;const m=c.find(e=>e.code===i),u=c.find(e=>e.code===a)?.name??`${a}`;if(!m)return;const h=Promise.withResolvers();o.pendingSubtypeChoice=h;let p="update-fields";const g=[{label:l.subtypes.useDefaultValuesOption,value:"update-fields"},{label:l.subtypes.keepCurrentValuesOption,value:"keep-existing"}],v={context:"info",title:l.subtypes.changeWarningTitle,message:t(l.subtypes.changeWarning,{originalType:u,newType:m.name}),radios:g,defaultRadioSelection:"update-fields",onRadioSelection:e=>{p=e},actions:{primary:{label:r.apply,action:()=>h.resolve(p),type:"positive"},secondary:{label:r.cancel,type:"neutral",action:()=>h.resolve("undo")}},cancel:()=>h.reject()};try{this.showPrompt(v);switch(await h.promise){case"update-fields":await o.applySubtypeDefaults(m),await o.handleSubtypeChanged(d);break;case"keep-existing":await o.handleSubtypeChanged(d);break;case"undo":await this.viewModel.setValue(s,a)}}finally{o.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_afterDateComponentCreateOrUpdate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,a=e.field.type,n=this._dateComponentMap.get(`${i}`);if(!n)return;const s=e.effectiveTimeZone;let l=e.value===z?void 0:e.value,o=null;"date-only"===a?o=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===a?(l=ae(l),o=ae(t.value)):o="timestamp-offset"===a?null!=t.value?ne({dateComponent:n.date,timeComponent:n.time,oldValue:l,timeZoneComponent:n.timeZone,defaultTimeZone:s}):null:null!=t.value?se({oldValue:l,dateComponent:n.date,timeZone:s,timeComponent:n.time?.value===z?void 0:n.time}):null,l!==o&&(null!==o&&t.value?this.viewModel.setValue(`${i}`,o):this.viewModel.setValue(`${i}`,null))}_getErrorToDisplay(e){const t=e.compositeError;return e.valid||!t?null:"contingent-values-validation-error::contingency-violation-error"===t||"contingent-values-validation-error::contingency-violation-warning"===t||this._touchedInputs.has(e.template.elementId)||this.viewModel.submitHasBeenAttempted?t:null}_renderViewingAssociationsPage(){return this._associationsList?.render()}_onActiveAssociationsInputChange(e){const t=this._associationsList;t&&(e?(t.associationInput=e,t.viewModel=e.viewModel):t.associationInput=null)}async _setUpAssociationsWidgets(){const e=this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs;if(this._associationsEnabled&&0!==e.length){await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.set(t,await this._createAssociationsWidget(t))}}async _setUpUtilityNetworkAssociationList(){if(this._associationsList)return;const e=(await(import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js"))).default;this._associationsList=new e({onSelectLayer:this._onSelectAssociatedLayer.bind(this),onSelectFeature:this._onEditAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)});const t=this.viewModel.activeAssociationsInput;t&&(this._associationsList.associationInput=t,this._associationsList.viewModel=t.viewModel)}async _createAssociationsWidget(e){return new(0,(await(import("./Feature/FeatureUtilityNetworkAssociations.js"))).default)({viewModel:e.viewModel,onSelectAssociationType:t=>this._onSelectAssociationType(e,t)})}_destroyAssociationsWidgets(){this._associationsWidgetsMap.forEach(e=>s(e)),this._associationsWidgetsMap.clear()}_onSelectAssociationType(e,{listType:t}){this.setActiveAssociationsInput(e),this.setActiveAssociationType(t)}_onSelectAssociatedLayer({layer:e}){this.setActiveAssociationsLayer(e)}async _onEditAssociatedFeature(e){const t=this.callbacks?.editAssociatedFeature,i=this.viewModel.activeAssociationsInput;if(!t||!i?.feature)return;const{association:a,feature:n}=e;await t({parentFeature:i.feature.plainGraphic,association:a,feature:n})}_onAddAssociation(e){const t=this.callbacks?.addAssociation,i=this.viewModel.activeAssociationsInput;if(!t||!i?.feature)return;const{associationType:a,utilityNetwork:n}=e;t({feature:i.feature.plainGraphic,associationType:a,utilityNetwork:n})}_setFocusableInput(e){const t=e&&N(e)?e:this._findFocusableInput(e);this._syncGroupInputStates(),this._focusedFieldInput=t,this._attemptFocusOnNextRender=!0}_findFocusableInput(e){const t=this.viewModel.activeForm.inputs;if(!t.length)return;const i=M(t);let a;if(e)if(R(e)){const t=e.inputs.find(e=>e.visible);a=t?i.indexOf(t):0}else{let n;if(H(e)&&!e.group.open){n=e.group.inputs.filter(N)[t.length-1]}else n=e;a=i.indexOf(n)+1}else a=0;for(let n=a;n<i.length;n++){const e=i[n];if(e.visible&&N(e)){if(this.disabledOrReadOnly&&("switch"===e?.inputType||"radio-buttons"===e?.inputType))continue;return e}}return null}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._setFocusableInput(t),"sequential"===this.groupDisplay&&this.viewModel.activeForm.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.activeForm?.allGroupInputs;if(!e.length)return;const t=e.filter(e=>e.open);0===t.length?e[0].open=!0:t.length>1&&t.slice(1).forEach(e=>e.open=!1)}};function _e(e){switch(e){case"audio":return _("audio/mpeg");case"video":return _("video/mp4");case"image":return _("image/png");default:return"camera"}}e([u()],fe.prototype,"activeFeatureIndex",null),e([u()],fe.prototype,"attachmentsEnabled",null),e([u()],fe.prototype,"callbacks",null),e([u()],fe.prototype,"disabled",null),e([u()],fe.prototype,"effectiveTitle",null),e([u()],fe.prototype,"effectiveDisabled",null),e([u()],fe.prototype,"disabledOrReadOnly",null),e([u()],fe.prototype,"features",null),e([u()],fe.prototype,"footerButtonInfos",null),e([u()],fe.prototype,"map",null),e([u()],fe.prototype,"maximumFeatureCount",null),e([u()],fe.prototype,"maximumFeatureCountWithComplexForms",null),e([u()],fe.prototype,"spatialReference",null),e([u()],fe.prototype,"layerInfos",null),e([u()],fe.prototype,"timeZone",null),e([u()],fe.prototype,"headingLevel",void 0),e([u()],fe.prototype,"icon",null),e([u(),ce("esri/t9n/common")],fe.prototype,"messagesCommon",void 0),e([u(),ce("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],fe.prototype,"messages",void 0),e([u(),ce("esri/widgets/FeatureForm/t9n/FeatureForm")],fe.prototype,"featureFormMessages",void 0),e([u(),ce("esri/widgets/FeatureTable/t9n/FeatureTable")],fe.prototype,"featureTableMessages",void 0),e([u(),ce("esri/core/t9n/Units")],fe.prototype,"messagesUnits",void 0),e([u()],fe.prototype,"page",null),e([u()],fe.prototype,"readOnly",null),e([u()],fe.prototype,"showPrompt",null),e([u()],fe.prototype,"clearPrompt",null),e([u()],fe.prototype,"selectedAttachment",null),e([u()],fe.prototype,"selectedAttachmentDetails",null),e([u()],fe.prototype,"valid",null),e([u({type:x}),de(["attachments-change","value-change","values-change","submit"])],fe.prototype,"viewModel",void 0),e([u({type:L,nonNullable:!0})],fe.prototype,"visibleElements",void 0),e([u()],fe.prototype,"groupDisplay",void 0),e([u()],fe.prototype,"_formHeaderVisible",null),e([u()],fe.prototype,"_associationsEnabled",null),e([u()],fe.prototype,"_associationsList",void 0),e([u()],fe.prototype,"_attemptFocusOnNextRender",void 0),e([u()],fe.prototype,"_formId",null),e([u()],fe.prototype,"_focusedFieldInput",void 0),e([u()],fe.prototype,"_pendingSubtypeChoice",void 0),e([u()],fe.prototype,"_relatedRecordsEnabled",null),e([u()],fe.prototype,"_listObserverNode",void 0),e([u()],fe.prototype,"_attachmentDialogInfo",void 0),e([u()],fe.prototype,"_attachmentListFilterText",void 0),e([u()],fe.prototype,"_prompt",void 0),e([u()],fe.prototype,"test",null),fe=e([h("esri.widgets.BatchAttributeForm")],fe);const Ce=fe;export{Ce as default};
|
package/widgets/Daylight.d.ts
CHANGED
|
@@ -134,6 +134,10 @@ export interface DaylightEvents extends DaylightViewModelEvents {}
|
|
|
134
134
|
* >
|
|
135
135
|
* > The Daylight widget uses UTC time and does not account for the daylight savings times in different countries and regions of the world.
|
|
136
136
|
* >
|
|
137
|
+
* > The widget does not use [SceneView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone). It uses the numeric
|
|
138
|
+
* > [DaylightViewModel.utcOffset](https://developers.arcgis.com/javascript/latest/references/core/widgets/Daylight/DaylightViewModel/#utcOffset) and
|
|
139
|
+
* > [SunLighting.displayUTCOffset](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SunLighting/#displayUTCOffset) properties.
|
|
140
|
+
* >
|
|
137
141
|
* > When the [SceneView.environment.lighting](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#environment) is of the type `virtual`, setting the time and date does not have an influence on the lighting conditions of the scene.
|
|
138
142
|
*
|
|
139
143
|
* @deprecated since version 4.34. Use the [Daylight component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-daylight/) instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
|
package/widgets/Editor.d.ts
CHANGED
|
@@ -283,7 +283,7 @@ export interface EditorEvents extends EditorViewModelEvents {}
|
|
|
283
283
|
* ## Editing date and time
|
|
284
284
|
*
|
|
285
285
|
* The Editor displays the `date` field [Field.type](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) in
|
|
286
|
-
* the
|
|
286
|
+
* the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone) by default.
|
|
287
287
|
* However, when working with the `timestamp-offset` type, the data is displayed using the stored date
|
|
288
288
|
* values from the service. For example, if the stored value is `2023-09-11T22:39:05.242-0400`, then
|
|
289
289
|
* the Editor will present three inputs to edit the date (`9/11/2023`), time (`10:39:05 PM`), and time
|
|
@@ -69,7 +69,7 @@ export interface FeatureViewModelProperties extends IdentifiableMixinProperties,
|
|
|
69
69
|
spatialReference?: SpatialReferenceProperties | null;
|
|
70
70
|
/**
|
|
71
71
|
* Dates and times displayed in the widget will be displayed in this time zone. By default this time zone is
|
|
72
|
-
* inherited from [MapView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/
|
|
72
|
+
* inherited from the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone). When a view is not associated with the widget
|
|
73
73
|
* then the property will fallback to the `system` time zone.
|
|
74
74
|
*
|
|
75
75
|
* **Possible Values**
|
|
@@ -243,7 +243,7 @@ export default class FeatureViewModel extends FeatureViewModelSuperclass {
|
|
|
243
243
|
get state(): State;
|
|
244
244
|
/**
|
|
245
245
|
* Dates and times displayed in the widget will be displayed in this time zone. By default this time zone is
|
|
246
|
-
* inherited from [MapView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/
|
|
246
|
+
* inherited from the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone). When a view is not associated with the widget
|
|
247
247
|
* then the property will fallback to the `system` time zone.
|
|
248
248
|
*
|
|
249
249
|
* **Possible Values**
|
|
@@ -272,7 +272,7 @@ export default class FeatureViewModel extends FeatureViewModelSuperclass {
|
|
|
272
272
|
* > The FeatureViewModel requires a view if the user expects it to display content in any of the following situations:
|
|
273
273
|
* > - The [graphic](https://developers.arcgis.com/javascript/latest/references/core/widgets/Feature/FeatureViewModel/#graphic) has a popupTemplate containing Arcade expressions in [ExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/popup/ExpressionInfo/) or [ExpressionContent](https://developers.arcgis.com/javascript/latest/references/core/popup/content/ExpressionContent/) that may use [geometry functions](https://developers.arcgis.com/arcade/function-reference/geometry_functions/) or reference the `$map` profile variable (i.e. access data from layers within a map).
|
|
274
274
|
* > - Content is displayed from the popup template of an [aggregate feature](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#isAggregate) (i.e. a [cluster](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/) or [bin](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionBinning/)).
|
|
275
|
-
* > - Values from `date` and `timestamp-offset` [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) should respect the
|
|
275
|
+
* > - Values from `date` and `timestamp-offset` [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) should respect the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone).
|
|
276
276
|
*/
|
|
277
277
|
accessor view: MapViewOrSceneView | null | undefined;
|
|
278
278
|
/** Indicates whether the feature is currently waiting for all of its content to finish loading. */
|
package/widgets/Feature.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ export interface FeatureProperties extends WidgetProperties, Partial<Pick<Featur
|
|
|
75
75
|
spatialReference?: SpatialReferenceProperties | null;
|
|
76
76
|
/**
|
|
77
77
|
* Dates and times displayed in the widget will be displayed in this time zone. By default this time zone is
|
|
78
|
-
* inherited from [MapView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/
|
|
78
|
+
* inherited from the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone). When a view is not associated with the widget
|
|
79
79
|
* then the property will fallback to the `system` time zone.
|
|
80
80
|
*
|
|
81
81
|
* **Possible Values**
|
|
@@ -314,7 +314,7 @@ export default class Feature extends Widget {
|
|
|
314
314
|
set spatialReference(value: SpatialReferenceProperties | null | undefined);
|
|
315
315
|
/**
|
|
316
316
|
* Dates and times displayed in the widget will be displayed in this time zone. By default this time zone is
|
|
317
|
-
* inherited from [MapView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/
|
|
317
|
+
* inherited from the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone). When a view is not associated with the widget
|
|
318
318
|
* then the property will fallback to the `system` time zone.
|
|
319
319
|
*
|
|
320
320
|
* **Possible Values**
|
|
@@ -343,7 +343,7 @@ export default class Feature extends Widget {
|
|
|
343
343
|
* > The Feature widget requires a view if the user expects it to display content in any of the following situations:
|
|
344
344
|
* > - The [graphic](https://developers.arcgis.com/javascript/latest/references/core/widgets/Feature/#graphic) has a popupTemplate containing Arcade expressions in [ExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/popup/ExpressionInfo/) or [ExpressionContent](https://developers.arcgis.com/javascript/latest/references/core/popup/content/ExpressionContent/) that use [geometry functions](https://developers.arcgis.com/arcade/function-reference/geometry_functions/) or reference the `$map` profile variable (i.e. access data from layers within a map).
|
|
345
345
|
* > - Content is displayed from the popup template of an [aggregate feature](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#isAggregate) (i.e. a [cluster](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/) or [bin](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionBinning/)).
|
|
346
|
-
* > - Values from `date` and `timestamp-offset` [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) should respect the
|
|
346
|
+
* > - Values from `date` and `timestamp-offset` [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) should respect the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone).
|
|
347
347
|
*/
|
|
348
348
|
accessor view: MapViewOrSceneView | null | undefined;
|
|
349
349
|
/**
|
|
@@ -1059,7 +1059,7 @@ export default class FeatureTableViewModel extends GridViewModel {
|
|
|
1059
1059
|
get timeExtent(): TimeExtent | null | undefined;
|
|
1060
1060
|
set timeExtent(value: TimeExtentProperties | null | undefined);
|
|
1061
1061
|
/**
|
|
1062
|
-
* Dates and times displayed in the
|
|
1062
|
+
* Dates and times displayed in the feature table will be in terms of this time zone. If not supplied, the view's time zone
|
|
1063
1063
|
* is typically used (if available). Depending on the field type, individual columns may have their own unique
|
|
1064
1064
|
* time zone behavior when the time zone itself is `unknown`.
|
|
1065
1065
|
*
|
|
@@ -1067,8 +1067,8 @@ export default class FeatureTableViewModel extends GridViewModel {
|
|
|
1067
1067
|
* >
|
|
1068
1068
|
* > The following considerations apply when working with date, time, and big integer field types:
|
|
1069
1069
|
* >
|
|
1070
|
-
* > By default, the [
|
|
1071
|
-
* > If the
|
|
1070
|
+
* > By default, the [Feature Table component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature-table/) displays `date` and `timestamp-offset` field [types](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) using the associated view's time zone. This time zone can be overridden with the component's [timeZone](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature-table/#timeZone) property.
|
|
1071
|
+
* > If the component's [view](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature-table/#view) and [timeZone](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature-table/#timeZone) properties aren't set, the table defaults to `system` time. The only time that this is not the case is when there is a [FeatureLayer.preferredTimeZone](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#preferredTimeZone) set on the table's layer. If the latter is true, the preferred time zone is used as opposed to `system`.
|
|
1072
1072
|
*
|
|
1073
1073
|
* @since 4.28
|
|
1074
1074
|
*/
|
|
@@ -200,6 +200,7 @@ export default abstract class ColumnTemplateBase extends ColumnTemplateBaseSuper
|
|
|
200
200
|
*
|
|
201
201
|
* @since 4.31
|
|
202
202
|
* @see [MapView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone)
|
|
203
|
+
* @see [SceneView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone)
|
|
203
204
|
*/
|
|
204
205
|
accessor timeZone: TimeZone | null | undefined;
|
|
205
206
|
/** The type of column that the template represents. */
|
|
@@ -1638,7 +1638,7 @@ export default class FeatureTable extends Widget<FeatureTableProperties> {
|
|
|
1638
1638
|
* >
|
|
1639
1639
|
* > The following considerations apply when working with date, time, and big integer field types:
|
|
1640
1640
|
* >
|
|
1641
|
-
* > By default, the [FeatureTable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/) displays
|
|
1641
|
+
* > By default, the [FeatureTable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/) displays time zones for `date` and `timestamp-offset` field [types](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) using the associated view's time zone. This time zone can be overridden by setting the table's [timeZone](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#timeZone) property.
|
|
1642
1642
|
* > If the table's [view](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#view) isn't set, and the table's [Feature.timeZone](https://developers.arcgis.com/javascript/latest/references/core/widgets/Feature/#timeZone) isn't set, the table defaults to `system` time. The only time that this is not the case is when there is a [FeatureLayer.preferredTimeZone](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#preferredTimeZone) set on the table's layer. If the latter is true, the preferred time zone is used as opposed to `system`.
|
|
1643
1643
|
*
|
|
1644
1644
|
* @since 4.28
|
|
@@ -86,7 +86,7 @@ export interface FeaturesViewModelProperties extends GoToProperties, Partial<Pic
|
|
|
86
86
|
spatialReference?: SpatialReferenceProperties | null;
|
|
87
87
|
/**
|
|
88
88
|
* Dates and times will be displayed in this time zone. By default this time zone is
|
|
89
|
-
* inherited from [MapView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/
|
|
89
|
+
* inherited from the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone) if the [view](https://developers.arcgis.com/javascript/latest/references/core/widgets/Features/FeaturesViewModel/#view) property is set. When a view is not associated with the widget view model,
|
|
90
90
|
* then the property will fallback to the `system` time zone.
|
|
91
91
|
*
|
|
92
92
|
* **Possible Values**
|
|
@@ -552,7 +552,7 @@ export default class FeaturesViewModel extends FeaturesViewModelSuperclass {
|
|
|
552
552
|
get streamingFeatures(): false;
|
|
553
553
|
/**
|
|
554
554
|
* Dates and times will be displayed in this time zone. By default this time zone is
|
|
555
|
-
* inherited from [MapView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/
|
|
555
|
+
* inherited from the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone) if the [view](https://developers.arcgis.com/javascript/latest/references/core/widgets/Features/FeaturesViewModel/#view) property is set. When a view is not associated with the widget view model,
|
|
556
556
|
* then the property will fallback to the `system` time zone.
|
|
557
557
|
*
|
|
558
558
|
* **Possible Values**
|
|
@@ -594,7 +594,7 @@ export default class FeaturesViewModel extends FeaturesViewModelSuperclass {
|
|
|
594
594
|
* > The FeaturesViewModel requires a view if the user expects it to display content in any of the following situations:
|
|
595
595
|
* > - The [features](https://developers.arcgis.com/javascript/latest/references/core/widgets/Features/FeaturesViewModel/#features) have a popupTemplate containing Arcade expressions in [ExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/popup/ExpressionInfo/) or [ExpressionContent](https://developers.arcgis.com/javascript/latest/references/core/popup/content/ExpressionContent/) that may use [geometry functions](https://developers.arcgis.com/arcade/function-reference/geometry_functions/) or reference the `$map` profile variable (i.e. access data from layers within a map).
|
|
596
596
|
* > - Content is displayed from the popup template of an [aggregate feature](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#isAggregate) (i.e. a [cluster](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/) or [bin](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionBinning/)).
|
|
597
|
-
* > - Values from `date` and `timestamp-offset` [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) should respect the
|
|
597
|
+
* > - Values from `date` and `timestamp-offset` [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) should respect the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone).
|
|
598
598
|
* > - When using the [fetchFeatures()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Features/FeaturesViewModel/#fetchFeatures) method or the `fetchFeatures` option in the [open()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Features/FeaturesViewModel/#open) method.
|
|
599
599
|
*/
|
|
600
600
|
accessor view: MapViewOrSceneView | null | undefined;
|
package/widgets/Features.d.ts
CHANGED
|
@@ -320,7 +320,7 @@ export default class Features extends Widget {
|
|
|
320
320
|
set spatialReference(value: SpatialReferenceProperties | null | undefined);
|
|
321
321
|
/**
|
|
322
322
|
* Dates and times displayed in the widget will be displayed in this time zone. By default this time zone is
|
|
323
|
-
* inherited from [MapView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/
|
|
323
|
+
* inherited from the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone) if the [view](https://developers.arcgis.com/javascript/latest/references/core/widgets/Features/#view) property is set. When a view is not associated with the widget
|
|
324
324
|
* then the property will fallback to the `system` time zone.
|
|
325
325
|
*
|
|
326
326
|
* **Possible Values**
|
|
@@ -355,7 +355,7 @@ export default class Features extends Widget {
|
|
|
355
355
|
* > The Features widget requires a view if:
|
|
356
356
|
* > - The [features](https://developers.arcgis.com/javascript/latest/references/core/widgets/Features/#features) have a popupTemplate containing Arcade expressions in [ExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/popup/ExpressionInfo/) or [ExpressionContent](https://developers.arcgis.com/javascript/latest/references/core/popup/content/ExpressionContent/) that may use [geometry functions](https://developers.arcgis.com/arcade/function-reference/geometry_functions/) or reference the `$map` profile variable (i.e. access data from layers within a map). Alternatively, set the [map](https://developers.arcgis.com/javascript/latest/references/core/widgets/Features/#map) property.
|
|
357
357
|
* > - Content is displayed from the popup template of an [aggregate feature](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#isAggregate) (i.e. a [cluster](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/) or [bin](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionBinning/)).
|
|
358
|
-
* > - Values from `date` and `timestamp-offset` [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) should respect the
|
|
358
|
+
* > - Values from `date` and `timestamp-offset` [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) should respect the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone). Alternatively, set the [timeZone](https://developers.arcgis.com/javascript/latest/references/core/widgets/Features/#timeZone) property.
|
|
359
359
|
* > - Using the [fetchFeatures()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Features/#fetchFeatures) method or the `fetchFeatures` option in the [open()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Features/#open) method.
|
|
360
360
|
* > - Using the `Zoom to` default action. If the `view` is not specified, set the [FeaturesViewModel.includeDefaultActions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Features/FeaturesViewModel/#includeDefaultActions) property to `false` to remove this default action.
|
|
361
361
|
*/
|
package/widgets/TimeSlider.d.ts
CHANGED
|
@@ -151,7 +151,7 @@ export interface TimeSliderProperties extends WidgetProperties, Partial<Pick<Tim
|
|
|
151
151
|
timeExtent?: TimeExtentProperties | null;
|
|
152
152
|
/**
|
|
153
153
|
* Dates and times displayed in the widget will be displayed in this time zone. By default this time zone is
|
|
154
|
-
* inherited from [MapView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/
|
|
154
|
+
* inherited from the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone). When a view is not associated with the widget
|
|
155
155
|
* then the property will fallback to the `system` time zone.
|
|
156
156
|
*
|
|
157
157
|
* **Possible Values**
|
|
@@ -413,7 +413,7 @@ export interface TimeSliderEvents extends TimeSliderViewModelEvents {}
|
|
|
413
413
|
*
|
|
414
414
|
* </details>
|
|
415
415
|
*
|
|
416
|
-
* @deprecated since version 5.0. Use the [Time
|
|
416
|
+
* @deprecated since version 5.0. Use the [Time Bar component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-bar/) instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
|
|
417
417
|
* @since 4.12
|
|
418
418
|
* @see [TimeSliderViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/TimeSliderViewModel/)
|
|
419
419
|
* @see [Sample - Time Slider component](https://developers.arcgis.com/javascript/latest/sample-code/timeslider/)
|
|
@@ -881,7 +881,7 @@ export default class TimeSlider extends Widget {
|
|
|
881
881
|
accessor timeVisible: boolean;
|
|
882
882
|
/**
|
|
883
883
|
* Dates and times displayed in the widget will be displayed in this time zone. By default this time zone is
|
|
884
|
-
* inherited from [MapView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/
|
|
884
|
+
* inherited from the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone). When a view is not associated with the widget
|
|
885
885
|
* then the property will fallback to the `system` time zone.
|
|
886
886
|
*
|
|
887
887
|
* **Possible Values**
|