bundle-user-defined-checkbox.js 682 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Copyright © Magento, Inc. All rights reserved.
  3. * See COPYING.txt for license details.
  4. */
  5. define([
  6. 'Magento_Ui/js/form/element/single-checkbox'
  7. ], function (Checkbox) {
  8. 'use strict';
  9. return Checkbox.extend({
  10. defaults: {
  11. listens: {
  12. inputType: 'onInputTypeChange'
  13. }
  14. },
  15. /**
  16. * Handler for "inputType" property
  17. *
  18. * @param {String} data
  19. */
  20. onInputTypeChange: function (data) {
  21. data === 'checkbox' || data === 'multi' ?
  22. this.clear()
  23. .visible(false) :
  24. this.visible(true);
  25. }
  26. });
  27. });