@ecan-bi/datav 1.0.66 → 1.0.67

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/index.umd.js CHANGED
@@ -3236,26 +3236,33 @@
3236
3236
  const myValue = vue.computed(() => {
3237
3237
  const data = vue.unref(myData);
3238
3238
  const defaultValue = +props2.variableDefaultValue;
3239
- if (data == null && !isNaN(defaultValue))
3240
- return defaultValue;
3239
+ if (data == null) {
3240
+ if (!isNaN(defaultValue)) {
3241
+ return defaultValue;
3242
+ } else {
3243
+ return 0;
3244
+ }
3245
+ }
3241
3246
  const variables = props2.text.match(/\{.+\}/g) || [];
3242
3247
  let value;
3243
- const valueSet = new Set(Object.values(data));
3248
+ const valueSet = new Set(Object.keys(data));
3244
3249
  for (let i = 0; i < variables.length; i++) {
3245
3250
  const variable = variables[i];
3246
- if (valueSet.has(variables[i])) {
3247
- value = variable;
3251
+ const key = variable.slice(1, variable.length - 1);
3252
+ if (valueSet.has(key)) {
3253
+ value = data[key];
3248
3254
  break;
3249
3255
  }
3250
3256
  }
3251
- if (typeof value === "string" && !isNaN(+value)) {
3252
- value = +value;
3257
+ if (typeof value === "number") {
3258
+ value = value * 100;
3259
+ } else if (typeof value === "string" && !isNaN(+value)) {
3260
+ value = +value * 100;
3253
3261
  } else if (!isNaN(defaultValue)) {
3254
- value = defaultValue;
3262
+ value = defaultValue * 100;
3255
3263
  } else {
3256
3264
  value = 0;
3257
3265
  }
3258
- value = value * 100;
3259
3266
  if (props2.decimalFormat) {
3260
3267
  value = +value.toFixed(2);
3261
3268
  }
@@ -3378,7 +3385,7 @@
3378
3385
  }, 8, ["percent", "width", "type", "strokeColor", "strokeLinecap", "trailColor", "strokeWidth", "gapDegree", "onClick"])
3379
3386
  ], 4);
3380
3387
  }
3381
- const Proportion = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-95ca32ca"]]);
3388
+ const Proportion = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-4f7958e8"]]);
3382
3389
  const EcanProportion = withInstall(Proportion);
3383
3390
  const inputProps = {
3384
3391
  ...props,