UNPKG

@compdfkit_pdf_sdk/react_native

Version:

ComPDFKit for React Native is a comprehensive SDK that allows you to quickly add PDF functionality to Android, iOS, and React Native applications.

56 lines (51 loc) 1.84 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CPDFRadiobuttonWidget = void 0; var _CPDFWidget = require("./CPDFWidget"); var _reactNative = require("react-native"); /** * Copyright © 2014-2025 PDF Technologies, Inc. All Rights Reserved. * * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT. * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES. * This notice may not be removed from this file. */ const { CPDFViewManager } = _reactNative.NativeModules; /** * Class representing a radiobutton form widget, storing basic information about the radiobutton form. */ class CPDFRadiobuttonWidget extends _CPDFWidget.CPDFWidget { /** * The state of the radiobutton form widget. */ constructor(viewerRef, params) { super(viewerRef, params); this.isChecked = params.isChecked ?? false; } /** * Set the checked state of a radiobutton form widget. * @param isChecked whether the radiobutton is checked or not. * @example * // Set the checked state of a radiobutton form widget. * await widget.setChecked(true); * // Update the appearance of the radiobutton form widget. * await widget.updateAp(); * @returns */ setChecked = async isChecked => { const tag = (0, _reactNative.findNodeHandle)(this._viewerRef); if (tag != null) { await CPDFViewManager.setWidgetIsChecked(tag, this.page, this.uuid, isChecked); this.isChecked = isChecked; return; } return Promise.reject(new Error('Unable to find the native view reference')); }; } exports.CPDFRadiobuttonWidget = CPDFRadiobuttonWidget; //# sourceMappingURL=CPDFRadiobuttonWidget.js.map