{"version":3,"file":"range-control.mjs","names":[],"sources":["../../../src/validated-form-controls/components/range-control.tsx"],"sourcesContent":["import { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { ControlWithError } from '@wordpress/ui';\nimport type { ValidatedControlProps } from './types';\nimport RangeControl from '../../range-control';\n\nconst UnforwardedValidatedRangeControl = (\n\t{\n\t\trequired,\n\t\tcustomValidity,\n\t\tmarkWhenOptional,\n\t\t...restProps\n\t}: React.ComponentProps< typeof RangeControl > & ValidatedControlProps,\n\tforwardedRef: React.ForwardedRef< HTMLInputElement >\n) => {\n\tconst validityTargetRef = useRef< HTMLInputElement >( null );\n\tconst mergedRefs = useMergeRefs( [ forwardedRef, validityTargetRef ] );\n\n\treturn (\n\t\t<ControlWithError\n\t\t\tclassName=\"components-validated-control\"\n\t\t\trequired={ required }\n\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\tcustomValidity={ customValidity }\n\t\t\tgetValidityTarget={ () => validityTargetRef.current }\n\t\t>\n\t\t\t<RangeControl ref={ mergedRefs } { ...restProps } />\n\t\t</ControlWithError>\n\t);\n};\n\nexport const ValidatedRangeControl = forwardRef(\n\tUnforwardedValidatedRangeControl\n);\nValidatedRangeControl.displayName = 'ValidatedRangeControl';\n"],"mappings":";;;;;;AAMA,MAAM,oCACL,EACC,UACA,gBACA,kBACA,GAAG,aAEJ,iBACI;CACJ,MAAM,oBAAoB,OAA4B,IAAK;CAC3D,MAAM,aAAa,aAAc,CAAE,cAAc,iBAAkB,CAAE;CAErE,OACC,oBAAC,kBAAD;EACC,WAAU;EACC;EACQ;EACF;EACjB,yBAA0B,kBAAkB;EAE5C,UAAA,oBAAC,cAAD;GAAc,KAAM;GAAa,GAAK;EAAa,CAAA;CAClC,CAAA;AAEpB;AAEA,MAAa,wBAAwB,WACpC,gCACD;AACA,sBAAsB,cAAc"}