33 parent::__construct();
36 $this->
setLogoUri(
'/bitrix/images/report/visualconstructor/view-number-block.jpg');
37 $this->
setComponentName(
'bitrix:report.visualconstructor.widget.content.numberblock');
39 $this->
setJsClassName(
'BX.Report.VisualConstructor.Widget.Content.NumberBlock');
50 $form = parent::prepareWidgetFormBeforeRender($form);
52 $secondReportConfigsContainer = $form->
getField(
'report_configurations_container_2');
55 if ($secondReportConfigsContainer instanceof
Container)
57 $firstGroupedReportContainer = $secondReportConfigsContainer;
59 $thirdReportConfigsContainer = $form->
getField(
'report_configurations_container_3');
60 if ($thirdReportConfigsContainer instanceof
Container)
62 $lastGroupedReportContainer = $thirdReportConfigsContainer;
66 $lastGroupedReportContainer = $secondReportConfigsContainer;
70 $div->setKey(
'report_configuration_big_container');
71 $div->addClass(
'report-configuration-big-container');
72 $form->
addFieldBefore($div->start(), $firstGroupedReportContainer);
73 $form->
addFieldAfter($div->end(), $lastGroupedReportContainer);
87 parent::collectWidgetHandlerFormElements($widgetHandler);
88 $widgetHandler->getFormElement(
'color')->
setDisplay(
false);
101 parent::collectReportHandlerFormElements($reportHandler);
102 $removeReportControlFormElement = $reportHandler->getFormElementByDataAttribute(
'role',
'report-remove-button');
105 if ($removeReportControlFormElement)
107 $removeReportControlFormElement->setDisplay(
false);
110 if (!$reportHandler->getConfiguration(
'color'))
112 $reportHandler->getConfiguration(
'color')->setValue(
'#4fc3f7');
113 $reportHandler->getFormElement(
'head_container_start')->addInlineStyle(
'background-color',
'#4fc3f7');
114 $reportHandler->getFormElement(
'main_container_start')->addInlineStyle(
'background-color',
'#4fc3f75f');
118 $whatWillCalculateField = $reportHandler->getFormElement(
'calculate');
119 $labelField = $reportHandler->getFormElement(
'label');
120 if ($whatWillCalculateField)
122 $labelField->addJsEventListener($whatWillCalculateField, $whatWillCalculateField::JS_EVENT_ON_CHANGE, array(
123 'class' =>
'BX.Report.VisualConstructor.FieldEventHandlers.Title',
124 'action' =>
'whatWillCalculateChange',
126 $labelField->addAssets(array(
127 'js' => array(
'/bitrix/js/report/js/visualconstructor/fields/reporttitle.js')
142 $resultWidget = parent::prepareWidgetContent($widget, $withCalculatedData);
144 if ($withCalculatedData)
146 $resultWidget[
'content'][
'params'][
'color'] = $widget->
getWidgetHandler()->getReportHandlers()[0]->getFormElement(
'color')->getValue();
147 $resultWidget[
'config'][
'title'] = $widget->
getWidgetHandler()->getReportHandlers()[0]->getFormElement(
'label')->getValue();
150 return $resultWidget;
162 $defaultColorList = array(
166 return $defaultColorList[$num % count($defaultColorList)];
static getMessage($code, $replace=null, $language=null)