inviqa / mx-widgetcomponent
inviqa/mx-widgetcomponent
Inviqa - MX Widget Component
MX_WidgetComponent
The module provides useful widget components to be able to create complex widgets in Magento 2.
List of available components
Image Picker
Allows to use the cms image uploader on the widget forms, which makes it easy to upload/select an image for the widget.
Features of this component:
- Upload cms image
- Select already uploaded cms image
- Configurable image choose button label
- Restrict the allowed images by with/height
- Restrict the allowed images by file size
- (allowed file types are configured in the cms module OOB)
Video Picker
Allows to use the cms uploader on the widget forms, which makes it easy to upload/select an video for the widget.
Features of this component:
- Upload cms video
- Select already uploaded cms video
- Configurable video choose button label
- Restrict the allowed videos by file size
- (allowed file types are configured in the specific xml file)
Date Picker
Allows to pick date using the default datepicker js component.
Features of this component:
- Date format is configurable
- Time format is configurable (if not provided only date chooser will appear)
- Image of the date-picker component is configurable
- Date field can be configured to be disabled (read-only)
Datetime Picker
Same as the datepicker component, just comes with a pre-configured time format, so it will appear as a date-time chooser by default.
Textarea
Allows to use textarea on the widget forms.
Features of this component:
- Visible width of a text area (cols) is configurable
- Visible number of lines in a text area (rows) is configurable
- Maximum number of characters allowed (maxlenght) is configurable
- Dinamically shows the number of characters remaining if maxlength configured
Checkbox
Allows to use checkboxes on the widget form. Useful for replacing the Yes/No select which usually used.
Features of this component:
- The checkbox value is configurable (by default it is '1' when checked)
SubWidget
Allows to embed a widget into another widget. Useful to create custom reusable widget components. E.g. a link sub-widget which is a combination of 3 fields: url, link text and 'should open in new window' can be reused in many widget.
Features of this component:
- The label of the sub-widget cofiguration button is configurable
- Allows to embed widget in any depth (sub-widget can also have a sub-widget)
For more information please see the Usage section.
Compatibility
Magento 2.X (tested in magento 2.0.10, 2.1.2, 2.2.3)
Usage
Image Picker
<parameter name="my_param" xsi:type="block" visible="true" required="false">
<label translate="true">Image</label>
<block class="MX\WidgetComponent\Block\Adminhtml\Component\ImagePicker">
<!-- Optional configuration parameters -->
<data>
<item name="dimension" xsi:type="array">
<item name="max-width" xsi:type="string">500</item>
<item name="max-height" xsi:type="string">500</item>
</item>
<item name="max-size" xsi:type="string">50000</item>
<item name="button" xsi:type="array">
<item name="open" xsi:type="string">Select Image...</item>
</item>
</data>
<!-- Optional configuration parameters -->
</block>
</parameter>
Video Picker
<parameter name="my_param" xsi:type="block" visible="true" required="false">
<label translate="true">Video</label>
<block class="MX\WidgetComponent\Block\Adminhtml\Component\VideoPicker">
<!-- Optional configuration parameters -->
<data>
<item name="max-size" xsi:type="string">500000</item>
<item name="button" xsi:type="array">
<item name="open" xsi:type="string">Select Video...</item>
</item>
</data>
<!-- Optional configuration parameters -->
</block>
</parameter>
Date Picker
<parameter name="my_param" xsi:type="block" visible="true" required="false">
<label translate="true">Date</label>
<block class="MX\WidgetComponent\Block\Adminhtml\Component\DatePicker">
<!-- Optional configuration parameters -->
<data>
<item name="dateFormat" xsi:type="string">yyyy-MM-dd</item>
<item name="timeFormat" xsi:type="string">HH:mm:ss</item>
<item name="image" xsi:type="string">path-to/url</item>
<item name="disabled" xsi:type="boolean">true</item>
</data>
<!-- Optional configuration parameters -->
</block>
</parameter>
Datetime Picker
<parameter name="my_param" xsi:type="block" visible="true" required="false">
<label translate="true">Datetime</label>
<block class="MX\WidgetComponent\Block\Adminhtml\Component\DateTimePicker">
<!-- Optional configuration parameters -->
<data>
<item name="dateFormat" xsi:type="string">yyyy-MM-dd</item>
<item name="timeFormat" xsi:type="string">HH:mm:ss</item>
<item name="image" xsi:type="string">path-to/url</item>
<item name="disabled" xsi:type="boolean">true</item>
</data>
<!-- Optional configuration parameters -->
</block>
</parameter>
Textarea
<parameter name="my_param" xsi:type="block" visible="true" required="false">
<label translate="true">Textarea</label>
<block class="MX\WidgetComponent\Block\Adminhtml\Component\Textarea">
<!-- Optional configuration parameters -->
<data>
<item name="cols" xsi:type="string">visible width of a text area</item>
<item name="rows" xsi:type="string">visible number of lines in a text area</item>
<item name="maxlength" xsi:type="string">maximum number of characters allowed in the text area</item>
</data>
<!-- Optional configuration parameters -->
</block>
</parameter>
Checkbox
<parameter name="my_param" xsi:type="block" visible="true" required="false">
<label translate="true">Checkbox</label>
<block class="MX\WidgetComponent\Block\Adminhtml\Component\Checkbox">
<!-- Optional configuration parameters -->
<data>
<item name="value" xsi:type="string">checkbox_value</item>
</data>
<!-- Optional configuration parameters -->
</block>
</parameter>
SubWidget
<parameter name="my_param" xsi:type="block" visible="true" required="true" sort_order="10">
<label translate="true">Sub-Widget</label>
<block class="MX\WidgetComponent\Block\Adminhtml\Component\SubWidget">
<data>
<!-- Optional configuration parameters -->
<item name="button-label" xsi:type="string">Subwidget configuration button text</item>
<!-- Optional configuration parameters -->
<item name="widget-type-id" xsi:type="string">the_id_of_the_sub_widget</item>
</data>
</block>
</parameter>
No changelog yet
The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 3.0.1 | stable | Fail | Not compatible Details | 2020-09-15 09:23:42 |
| 3.0.0 | stable | Not tested | Not yet tested Details | 2020-06-15 13:37:03 |
| 2.2.1 | stable | Not tested | Not yet tested Details | 2018-05-11 15:49:29 |
| 2.2.0 | stable | Not tested | Not yet tested Details | 2018-05-11 14:34:38 |
| 2.1.0 | stable | Not tested | Not yet tested Details | 2018-04-25 09:00:07 |
| 2.0.1 | stable | Not tested | Not yet tested Details | 2018-02-28 14:27:22 |
| 2.0.0 | stable | Not tested | Not yet tested Details | 2017-05-26 07:34:12 |
| 1.6.1 | stable | Not tested | Not yet tested Details | 2017-04-21 10:41:41 |
| 1.6.0 | stable | Not tested | Not yet tested Details | 2017-04-20 14:49:48 |
| 1.5.0 | stable | Not tested | Not yet tested Details | 2017-04-07 06:44:48 |
| 1.4.0 | stable | Not tested | Not yet tested Details | 2017-04-01 09:16:27 |
| 1.3.1 | stable | Not tested | Not yet tested Details | 2017-03-31 07:01:52 |
| 1.3.0 | stable | Not tested | Not yet tested Details | 2017-03-08 13:23:04 |
| 1.2.1 | stable | Not tested | Not yet tested Details | 2016-12-20 14:37:52 |
| 1.2.0 | stable | Not tested | Not yet tested Details | 2016-12-16 18:44:42 |
| 1.1.1 | stable | Not tested | Not yet tested Details | 2016-12-16 07:36:22 |
| 1.1.0 | stable | Not tested | Not yet tested Details | 2016-12-15 15:17:30 |
| 1.0.0 | stable | Not tested | Not yet tested Details | 2016-12-14 07:18:16 |
Requires 7
| Package | Constraint |
|---|---|
| php | >=5.5 |
| symfony/yaml | ~2.1|~3.0|^4.4 |
| magento/framework | ^100.1|^101.0|^102.0|^103.0 |
| magento/module-backend | ^100.1|^100.2|^101.0|^102.0 |
| magento/module-cms | ^101.0|^102.0|^103.0|^104.0 |
| magento/module-ui | ^100.1|^101.0 |
| magento/module-catalog | ^101.0|^102.0|^103.0|^104.0 |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. A phpcs finding can't make a module incompatible.
Static analysis
Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.
| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Fail | 73 | 9 errors, 64 warnings (ruleset: Magento2) — 15 auto-fixable with phpcbf |
| PHPMD | Warning | 12 | 12 rule violations (MissingImport:6, UnusedFormalParameter:4, IfStatementAssignment:2) |
| Cpd | Warning | 2 | 2 duplicated chunks spanning 99 total lines (min-lines=5, min-tokens=70) |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Unit tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Integration tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
Turn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.