![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-ui/view/base/web/js/form/components/ |
/** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** * @api */ define([ 'underscore', 'uiCollection' ], function (_, Collection) { 'use strict'; return Collection.extend({ defaults: { visible: true, label: '', showLabel: true, required: false, template: 'ui/group/group', fieldTemplate: 'ui/form/field', breakLine: true, validateWholeGroup: false, additionalClasses: {} }, /** * Extends this with defaults and config. * Then calls initObservable, iniListenes and extractData methods. */ initialize: function () { this._super() ._setClasses(); return this; }, /** * Calls initObservable of parent class. * Defines observable properties of instance. * * @return {Object} - reference to instance */ initObservable: function () { this._super() .observe('visible') .observe({ required: !!+this.required }); return this; }, /** * Extends 'additionalClasses' object. * * @returns {Group} Chainable. */ _setClasses: function () { var additional = this.additionalClasses, classes; if (_.isString(additional)) { additional = this.additionalClasses.split(' '); classes = this.additionalClasses = {}; additional.forEach(function (name) { classes[name] = true; }, this); } _.extend(this.additionalClasses, { 'admin__control-grouped': !this.breakLine, 'admin__control-fields': this.breakLine, required: this.required, _error: this.error, _disabled: this.disabled }); return this; }, /** * Defines if group has only one element. * @return {Boolean} */ isSingle: function () { return this.elems.getLength() === 1; }, /** * Defines if group has multiple elements. * @return {Boolean} */ isMultiple: function () { return this.elems.getLength() > 1; }, /** * Returns an array of child components previews. * * @returns {Array} */ getPreview: function () { return this.elems.map('getPreview'); } }); });