@tagplus/components 0.2.105 → 0.2.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tp.umd.js CHANGED
@@ -8400,13 +8400,65 @@ var Multisuggest_component = normalizeComponent(
8400
8400
  /* harmony default export */ var components_Multisuggest = (Multisuggest);
8401
8401
  // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/components/InputNumber/InputNumber.vue?vue&type=script&lang=js&
8402
8402
 
8403
+
8404
+
8405
+
8406
+
8403
8407
  /* harmony default export */ var InputNumbervue_type_script_lang_js_ = ({
8404
8408
  name: 'TpInputNumber',
8405
8409
  extends: external_element_ui_["InputNumber"],
8410
+ props: {
8411
+ usarVirgula: {
8412
+ type: Boolean,
8413
+ default: true
8414
+ }
8415
+ },
8416
+ computed: {
8417
+ displayValue: function displayValue() {
8418
+ if (this.userInput !== null) {
8419
+ return this.userInput;
8420
+ }
8421
+
8422
+ var currentValue = this.currentValue;
8423
+
8424
+ if (typeof currentValue === 'number') {
8425
+ if (this.stepStrictly) {
8426
+ var stepPrecision = this.getPrecision(this.step);
8427
+ var precisionFactor = Math.pow(10, stepPrecision);
8428
+ currentValue = Math.round(currentValue / this.step) * precisionFactor * this.step / precisionFactor;
8429
+ }
8430
+
8431
+ if (this.precision !== undefined) {
8432
+ currentValue = currentValue.toFixed(this.precision);
8433
+ }
8434
+ }
8435
+
8436
+ if (this.usarVirgula) {
8437
+ currentValue = (currentValue + '').replace('.', ',');
8438
+ }
8439
+
8440
+ return currentValue;
8441
+ }
8442
+ },
8406
8443
  methods: {
8407
8444
  handleInput: function handleInput(value) {
8408
8445
  this.userInput = value;
8409
- this.$emit('change', value);
8446
+ this.$emit('change', Number(value.replace(',', '.')));
8447
+ },
8448
+ handleInputChange: function handleInputChange(value) {
8449
+ var newVal;
8450
+
8451
+ if (value === '') {
8452
+ newVal = undefined;
8453
+ } else {
8454
+ newVal = Number(value.replace(',', '.'));
8455
+ }
8456
+
8457
+ if (!isNaN(newVal) || value === '') {
8458
+ this.setCurrentValue(newVal);
8459
+ }
8460
+
8461
+ this.userInput = null;
8410
8462
  }
8411
8463
  }
8412
8464
  });