@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.common.js CHANGED
@@ -8391,13 +8391,65 @@ var Multisuggest_component = normalizeComponent(
8391
8391
  /* harmony default export */ var components_Multisuggest = (Multisuggest);
8392
8392
  // 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&
8393
8393
 
8394
+
8395
+
8396
+
8397
+
8394
8398
  /* harmony default export */ var InputNumbervue_type_script_lang_js_ = ({
8395
8399
  name: 'TpInputNumber',
8396
8400
  extends: external_element_ui_["InputNumber"],
8401
+ props: {
8402
+ usarVirgula: {
8403
+ type: Boolean,
8404
+ default: true
8405
+ }
8406
+ },
8407
+ computed: {
8408
+ displayValue: function displayValue() {
8409
+ if (this.userInput !== null) {
8410
+ return this.userInput;
8411
+ }
8412
+
8413
+ var currentValue = this.currentValue;
8414
+
8415
+ if (typeof currentValue === 'number') {
8416
+ if (this.stepStrictly) {
8417
+ var stepPrecision = this.getPrecision(this.step);
8418
+ var precisionFactor = Math.pow(10, stepPrecision);
8419
+ currentValue = Math.round(currentValue / this.step) * precisionFactor * this.step / precisionFactor;
8420
+ }
8421
+
8422
+ if (this.precision !== undefined) {
8423
+ currentValue = currentValue.toFixed(this.precision);
8424
+ }
8425
+ }
8426
+
8427
+ if (this.usarVirgula) {
8428
+ currentValue = (currentValue + '').replace('.', ',');
8429
+ }
8430
+
8431
+ return currentValue;
8432
+ }
8433
+ },
8397
8434
  methods: {
8398
8435
  handleInput: function handleInput(value) {
8399
8436
  this.userInput = value;
8400
- this.$emit('change', value);
8437
+ this.$emit('change', Number(value.replace(',', '.')));
8438
+ },
8439
+ handleInputChange: function handleInputChange(value) {
8440
+ var newVal;
8441
+
8442
+ if (value === '') {
8443
+ newVal = undefined;
8444
+ } else {
8445
+ newVal = Number(value.replace(',', '.'));
8446
+ }
8447
+
8448
+ if (!isNaN(newVal) || value === '') {
8449
+ this.setCurrentValue(newVal);
8450
+ }
8451
+
8452
+ this.userInput = null;
8401
8453
  }
8402
8454
  }
8403
8455
  });