All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.prod.features.InputElementsFormSupport.js.map Maven / Gradle / Ivy

{
  "version": 3,
  "sources": ["../../../src/features/InputElementsFormSupport.ts"],
  "sourcesContent": ["import type UI5Element from \"../UI5Element.js\";\n\ninterface IFormInputElement extends UI5Element {\n\tname?: string;\n\tformFormattedValue: FormData | string | null;\n\tformValidityMessage?: string;\n\tformValidity?: ValidityStateFlags;\n\tformElementAnchor?: () => HTMLElement | undefined | Promise;\n}\n\nconst updateFormValue = (element: IFormInputElement | UI5Element) => {\n\tif (isInputElement(element)) {\n\t\tsetFormValue(element);\n\t}\n};\n\nconst setFormValue = (element: IFormInputElement) => {\n\tif (!element._internals?.form) {\n\t\treturn;\n\t}\n\n\tsetFormValidity(element);\n\n\tif (!element.name) {\n\t\telement._internals?.setFormValue(null);\n\t\treturn;\n\t}\n\n\telement._internals.setFormValue(element.formFormattedValue);\n};\n\nconst setFormValidity = async (element: IFormInputElement) => {\n\tif (!element._internals?.form) {\n\t\treturn;\n\t}\n\tif (element.formValidity && Object.keys(element.formValidity).some(key => key)) {\n\t\tconst focusRef = await element.formElementAnchor?.();\n\t\telement._internals.setValidity(element.formValidity, element.formValidityMessage, focusRef);\n\t} else {\n\t\telement._internals.setValidity({});\n\t}\n};\n\nconst submitForm = (element: UI5Element) => {\n\telement._internals?.form?.requestSubmit();\n};\n\nconst resetForm = (element: UI5Element) => {\n\telement._internals?.form?.reset();\n};\n\nconst isInputElement = (element: IFormInputElement | UI5Element): element is IFormInputElement => {\n\treturn \"formFormattedValue\" in element && \"name\" in element;\n};\n\nexport {\n\tupdateFormValue,\n\tsetFormValue,\n\tsetFormValidity,\n\tsubmitForm,\n\tresetForm,\n};\n\nexport type {\n\tIFormInputElement,\n};\n"],
  "mappings": "aAUA,MAAMA,EAAmBC,GAA4C,CAChEC,EAAeD,CAAO,GACzBE,EAAaF,CAAO,CAEtB,EAEME,EAAgBF,GAA+B,CACpD,GAAKA,EAAQ,YAAY,KAMzB,IAFAG,EAAgBH,CAAO,EAEnB,CAACA,EAAQ,KAAM,CAClBA,EAAQ,YAAY,aAAa,IAAI,EACrC,MACD,CAEAA,EAAQ,WAAW,aAAaA,EAAQ,kBAAkB,EAC3D,EAEMG,EAAkB,MAAOH,GAA+B,CAC7D,GAAKA,EAAQ,YAAY,KAGzB,GAAIA,EAAQ,cAAgB,OAAO,KAAKA,EAAQ,YAAY,EAAE,KAAKI,GAAOA,CAAG,EAAG,CAC/E,MAAMC,EAAW,MAAML,EAAQ,oBAAoB,EACnDA,EAAQ,WAAW,YAAYA,EAAQ,aAAcA,EAAQ,oBAAqBK,CAAQ,CAC3F,MACCL,EAAQ,WAAW,YAAY,CAAC,CAAC,CAEnC,EAEMM,EAAcN,GAAwB,CAC3CA,EAAQ,YAAY,MAAM,cAAc,CACzC,EAEMO,EAAaP,GAAwB,CAC1CA,EAAQ,YAAY,MAAM,MAAM,CACjC,EAEMC,EAAkBD,GAChB,uBAAwBA,GAAW,SAAUA,EAGrD,OACCD,KAAA,gBACAG,KAAA,aACAC,KAAA,gBACAG,KAAA,WACAC,KAAA",
  "names": ["updateFormValue", "element", "isInputElement", "setFormValue", "setFormValidity", "key", "focusRef", "submitForm", "resetForm"]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy