@progress/sitefinity-nextjs-sdk
Version:
Provides OOB widgets developed using the Next.js framework, which includes an abstraction layer for Sitefinity communication. Additionally, it offers an expanded API, typings, and tools for further development and integration.
25 lines (24 loc) • 1.31 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { htmlAttributes } from '../../../editor/widget-framework/attributes';
import { getMinimumWidgetContext } from '../../../editor/widget-framework/widget-context';
import { Tracer } from '@progress/sitefinity-nextjs-sdk/diagnostics/empty';
import { RenderView } from '../../common/render-view';
import { CheckboxesDefaultView } from './checkboxes.view';
export function Checkboxes(props) {
const { span } = Tracer.traceWidget(props, false);
const entity = props.model.Properties;
const viewProps = {
choices: entity.Choices || [],
cssClass: entity.CssClass || '',
hasAdditionalChoice: entity.HasAdditionalChoice,
instructionalText: entity.InstructionalText || '',
label: entity.Label || '',
required: entity.Required,
requiredErrorMessage: entity.RequiredErrorMessage,
sfFieldName: entity.SfFieldName,
columnsNumber: entity.ColumnsNumber,
attributes: { ...htmlAttributes(props) },
widgetContext: getMinimumWidgetContext(props)
};
return (_jsx(RenderView, { viewName: props.model.Properties.SfViewName || undefined, widgetKey: props.model.Name, traceSpan: span, viewProps: viewProps, children: _jsx(CheckboxesDefaultView, { ...viewProps }) }));
}