Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
package.dist.features.InputElementsFormSupport.js.map Maven / Gradle / Ivy
{"version":3,"file":"InputElementsFormSupport.js","sourceRoot":"","sources":["../../src/features/InputElementsFormSupport.ts"],"names":[],"mappings":"AAUA,MAAM,eAAe,GAAG,CAAC,OAAuC,EAAE,EAAE;IACnE,IAAI,cAAc,CAAC,OAAO,CAAC,EAAE;QAC5B,YAAY,CAAC,OAAO,CAAC,CAAC;KACtB;AACF,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,OAA0B,EAAE,EAAE;IACnD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE;QAC9B,OAAO;KACP;IAED,eAAe,CAAC,OAAO,CAAC,CAAC;IAEzB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;QAClB,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;QACvC,OAAO;KACP;IAED,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,KAAK,EAAE,OAA0B,EAAE,EAAE;IAC5D,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE;QAC9B,OAAO;KACP;IACD,IAAI,OAAO,CAAC,YAAY,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE;QAC/E,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC;QACrD,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;KAC5F;SAAM;QACN,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;KACnC;AACF,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,OAAmB,EAAE,EAAE;IAC1C,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,OAAmB,EAAE,EAAE;IACzC,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,OAAuC,EAAgC,EAAE;IAChG,OAAO,oBAAoB,IAAI,OAAO,IAAI,MAAM,IAAI,OAAO,CAAC;AAC7D,CAAC,CAAC;AAEF,OAAO,EACN,eAAe,EACf,YAAY,EACZ,eAAe,EACf,UAAU,EACV,SAAS,GACT,CAAC","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"]}