bundle-option-qty.js 816 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * Copyright © Magento, Inc. All rights reserved.
  3. * See COPYING.txt for license details.
  4. */
  5. define([
  6. 'Magento_Ui/js/form/element/abstract'
  7. ], function (Abstract) {
  8. 'use strict';
  9. return Abstract.extend({
  10. defaults: {
  11. valueUpdate: 'input',
  12. isInteger: true,
  13. validation: {
  14. 'validate-number': true
  15. }
  16. },
  17. /**
  18. * @inheritdoc
  19. */
  20. onUpdate: function () {
  21. this.validation['validate-digits'] = this.isInteger;
  22. this._super();
  23. },
  24. /**
  25. * @inheritdoc
  26. */
  27. hasChanged: function () {
  28. var notEqual = this.value() !== this.initialValue.toString();
  29. return !this.visible() ? false : notEqual;
  30. }
  31. });
  32. });