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.

58 lines 2.29 kB
"use strict"; /** * Copyright © 2014-2026 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. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.CPDFRadiobuttonWidget = void 0; const CPDFOptions_1 = require("../../configuration/CPDFOptions"); const CPDFEnumUtils_1 = require("../../util/CPDFEnumUtils"); const CPDFWidget_1 = require("./CPDFWidget"); /** * Class representing a radiobutton form widget, storing basic information about the radiobutton form. * * @class CPDFRadiobuttonWidget * @group Forms * @property {boolean} isChecked The state of the radiobutton form widget. * @property {string} checkColor The checked state color of a radio button form widget. * @property {CPDFCheckStyle} checkStyle The style of the radiobutton form widget. */ class CPDFRadiobuttonWidget extends CPDFWidget_1.CPDFWidget { /** * The state of the radiobutton form widget. */ isChecked; checkColor; checkStyle; constructor(params) { super(params); this.type = 'radioButton'; this.isChecked = params.isChecked ?? false; this.checkColor = params.checkColor ?? '#000000'; this.checkStyle = (0, CPDFEnumUtils_1.safeParseEnumValue)(params.checkStyle, Object.values(CPDFOptions_1.CPDFCheckStyle), CPDFOptions_1.CPDFCheckStyle.CHECK); } /** * Update radiobutton widget properties with type safety * @param updates Partial object containing properties to update * @returns this instance for chaining * * @example * radiobuttonWidget.update({ * title: 'Updated Title', * isChecked: true, * checkColor: '#FF0000', * checkStyle: CPDFCheckStyle.CIRCLE * }); * await document.updateWidget(radiobuttonWidget); */ update(updates) { Object.assign(this, updates); return this; } } exports.CPDFRadiobuttonWidget = CPDFRadiobuttonWidget; //# sourceMappingURL=CPDFRadiobuttonWidget.js.map