persagy-vant 0.0.48 → 0.0.49

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.
@@ -198,10 +198,11 @@ var stdin_default = defineComponent({
198
198
  if (modelValue && getStringLength(modelValue) === +maxlength) {
199
199
  return modelValue;
200
200
  }
201
- const selectionEnd = (_a = inputRef.value) == null ? void 0 : _a.selectionEnd;
201
+ let selectionEnd = (_a = inputRef.value) == null ? void 0 : _a.selectionEnd;
202
202
  if (state.focused && selectionEnd) {
203
203
  const valueArr = [...value];
204
204
  const exceededLength = valueArr.length - +maxlength;
205
+ selectionEnd = getStringLength(value.slice(0, selectionEnd));
205
206
  valueArr.splice(selectionEnd - exceededLength, exceededLength);
206
207
  return valueArr.join("");
207
208
  }
@@ -212,7 +213,7 @@ var stdin_default = defineComponent({
212
213
  const updateValue = (value, trigger = "onChange") => {
213
214
  const originalValue = value;
214
215
  value = limitValueLength(value);
215
- const limitDiffLen = getStringLength(originalValue) - getStringLength(value);
216
+ const limitDiffLen = originalValue.length - value.length;
216
217
  if (props.type === "number" || props.type === "digit") {
217
218
  const isNumber = props.type === "number";
218
219
  value = formatNumber(value, isNumber, isNumber);
@@ -232,7 +233,7 @@ var stdin_default = defineComponent({
232
233
  selectionEnd
233
234
  } = inputRef.value;
234
235
  const bcoVal = cutString(originalValue, selectionEnd);
235
- formatterDiffLen = getStringLength(formatter(bcoVal)) - getStringLength(bcoVal);
236
+ formatterDiffLen = formatter(bcoVal).length - bcoVal.length;
236
237
  }
237
238
  }
238
239
  if (inputRef.value && inputRef.value.value !== value) {
@@ -243,7 +244,7 @@ var stdin_default = defineComponent({
243
244
  } = inputRef.value;
244
245
  inputRef.value.value = value;
245
246
  if (isDef(selectionStart) && isDef(selectionEnd)) {
246
- const valueLen = getStringLength(value);
247
+ const valueLen = value.length;
247
248
  if (limitDiffLen) {
248
249
  selectionStart -= limitDiffLen;
249
250
  selectionEnd -= limitDiffLen;
package/es/index.d.ts CHANGED
@@ -117,4 +117,4 @@ declare namespace _default {
117
117
  }
118
118
  export default _default;
119
119
  export function install(app: any): void;
120
- export const version: "0.0.48";
120
+ export const version: "0.0.49";
package/es/index.mjs CHANGED
@@ -110,7 +110,7 @@ import { Uploader } from "./uploader/index.mjs";
110
110
  import { VideoPreview } from "./video-preview/index.mjs";
111
111
  import { WorkOrderCard } from "./work-order-card/index.mjs";
112
112
  import { WorkOrderFilter } from "./work-order-filter/index.mjs";
113
- const version = "0.0.48";
113
+ const version = "0.0.49";
114
114
  function install(app) {
115
115
  const components = [
116
116
  ActionBar,
@@ -221,10 +221,11 @@ var stdin_default = (0, import_vue.defineComponent)({
221
221
  if (modelValue && (0, import_utils2.getStringLength)(modelValue) === +maxlength) {
222
222
  return modelValue;
223
223
  }
224
- const selectionEnd = (_a = inputRef.value) == null ? void 0 : _a.selectionEnd;
224
+ let selectionEnd = (_a = inputRef.value) == null ? void 0 : _a.selectionEnd;
225
225
  if (state.focused && selectionEnd) {
226
226
  const valueArr = [...value];
227
227
  const exceededLength = valueArr.length - +maxlength;
228
+ selectionEnd = (0, import_utils2.getStringLength)(value.slice(0, selectionEnd));
228
229
  valueArr.splice(selectionEnd - exceededLength, exceededLength);
229
230
  return valueArr.join("");
230
231
  }
@@ -235,7 +236,7 @@ var stdin_default = (0, import_vue.defineComponent)({
235
236
  const updateValue = (value, trigger = "onChange") => {
236
237
  const originalValue = value;
237
238
  value = limitValueLength(value);
238
- const limitDiffLen = (0, import_utils2.getStringLength)(originalValue) - (0, import_utils2.getStringLength)(value);
239
+ const limitDiffLen = originalValue.length - value.length;
239
240
  if (props.type === "number" || props.type === "digit") {
240
241
  const isNumber = props.type === "number";
241
242
  value = (0, import_utils.formatNumber)(value, isNumber, isNumber);
@@ -255,7 +256,7 @@ var stdin_default = (0, import_vue.defineComponent)({
255
256
  selectionEnd
256
257
  } = inputRef.value;
257
258
  const bcoVal = (0, import_utils2.cutString)(originalValue, selectionEnd);
258
- formatterDiffLen = (0, import_utils2.getStringLength)(formatter(bcoVal)) - (0, import_utils2.getStringLength)(bcoVal);
259
+ formatterDiffLen = formatter(bcoVal).length - bcoVal.length;
259
260
  }
260
261
  }
261
262
  if (inputRef.value && inputRef.value.value !== value) {
@@ -266,7 +267,7 @@ var stdin_default = (0, import_vue.defineComponent)({
266
267
  } = inputRef.value;
267
268
  inputRef.value.value = value;
268
269
  if ((0, import_utils.isDef)(selectionStart) && (0, import_utils.isDef)(selectionEnd)) {
269
- const valueLen = (0, import_utils2.getStringLength)(value);
270
+ const valueLen = value.length;
270
271
  if (limitDiffLen) {
271
272
  selectionStart -= limitDiffLen;
272
273
  selectionEnd -= limitDiffLen;
package/lib/index.d.ts CHANGED
@@ -117,4 +117,4 @@ declare namespace _default {
117
117
  }
118
118
  export default _default;
119
119
  export function install(app: any): void;
120
- export const version: "0.0.48";
120
+ export const version: "0.0.49";
package/lib/index.js CHANGED
@@ -248,7 +248,7 @@ __reExport(stdin_exports, require("./uploader"), module.exports);
248
248
  __reExport(stdin_exports, require("./video-preview"), module.exports);
249
249
  __reExport(stdin_exports, require("./work-order-card"), module.exports);
250
250
  __reExport(stdin_exports, require("./work-order-filter"), module.exports);
251
- const version = "0.0.48";
251
+ const version = "0.0.49";
252
252
  function install(app) {
253
253
  const components = [
254
254
  import_action_bar.ActionBar,
package/lib/vant.cjs.js CHANGED
@@ -4197,10 +4197,11 @@ var stdin_default$1K = vue.defineComponent({
4197
4197
  if (modelValue && getStringLength(modelValue) === +maxlength) {
4198
4198
  return modelValue;
4199
4199
  }
4200
- const selectionEnd = (_a = inputRef.value) == null ? void 0 : _a.selectionEnd;
4200
+ let selectionEnd = (_a = inputRef.value) == null ? void 0 : _a.selectionEnd;
4201
4201
  if (state.focused && selectionEnd) {
4202
4202
  const valueArr = [...value];
4203
4203
  const exceededLength = valueArr.length - +maxlength;
4204
+ selectionEnd = getStringLength(value.slice(0, selectionEnd));
4204
4205
  valueArr.splice(selectionEnd - exceededLength, exceededLength);
4205
4206
  return valueArr.join("");
4206
4207
  }
@@ -4211,7 +4212,7 @@ var stdin_default$1K = vue.defineComponent({
4211
4212
  const updateValue = (value, trigger = "onChange") => {
4212
4213
  const originalValue = value;
4213
4214
  value = limitValueLength(value);
4214
- const limitDiffLen = getStringLength(originalValue) - getStringLength(value);
4215
+ const limitDiffLen = originalValue.length - value.length;
4215
4216
  if (props2.type === "number" || props2.type === "digit") {
4216
4217
  const isNumber = props2.type === "number";
4217
4218
  value = formatNumber(value, isNumber, isNumber);
@@ -4231,7 +4232,7 @@ var stdin_default$1K = vue.defineComponent({
4231
4232
  selectionEnd
4232
4233
  } = inputRef.value;
4233
4234
  const bcoVal = cutString(originalValue, selectionEnd);
4234
- formatterDiffLen = getStringLength(formatter(bcoVal)) - getStringLength(bcoVal);
4235
+ formatterDiffLen = formatter(bcoVal).length - bcoVal.length;
4235
4236
  }
4236
4237
  }
4237
4238
  if (inputRef.value && inputRef.value.value !== value) {
@@ -4242,7 +4243,7 @@ var stdin_default$1K = vue.defineComponent({
4242
4243
  } = inputRef.value;
4243
4244
  inputRef.value.value = value;
4244
4245
  if (isDef(selectionStart) && isDef(selectionEnd)) {
4245
- const valueLen = getStringLength(value);
4246
+ const valueLen = value.length;
4246
4247
  if (limitDiffLen) {
4247
4248
  selectionStart -= limitDiffLen;
4248
4249
  selectionEnd -= limitDiffLen;
@@ -21842,7 +21843,7 @@ const Lazyload = {
21842
21843
  });
21843
21844
  }
21844
21845
  };
21845
- const version = "0.0.48";
21846
+ const version = "0.0.49";
21846
21847
  function install(app) {
21847
21848
  const components = [
21848
21849
  ActionBar,
package/lib/vant.es.js CHANGED
@@ -4195,10 +4195,11 @@ var stdin_default$1K = defineComponent({
4195
4195
  if (modelValue && getStringLength(modelValue) === +maxlength) {
4196
4196
  return modelValue;
4197
4197
  }
4198
- const selectionEnd = (_a = inputRef.value) == null ? void 0 : _a.selectionEnd;
4198
+ let selectionEnd = (_a = inputRef.value) == null ? void 0 : _a.selectionEnd;
4199
4199
  if (state.focused && selectionEnd) {
4200
4200
  const valueArr = [...value];
4201
4201
  const exceededLength = valueArr.length - +maxlength;
4202
+ selectionEnd = getStringLength(value.slice(0, selectionEnd));
4202
4203
  valueArr.splice(selectionEnd - exceededLength, exceededLength);
4203
4204
  return valueArr.join("");
4204
4205
  }
@@ -4209,7 +4210,7 @@ var stdin_default$1K = defineComponent({
4209
4210
  const updateValue = (value, trigger = "onChange") => {
4210
4211
  const originalValue = value;
4211
4212
  value = limitValueLength(value);
4212
- const limitDiffLen = getStringLength(originalValue) - getStringLength(value);
4213
+ const limitDiffLen = originalValue.length - value.length;
4213
4214
  if (props2.type === "number" || props2.type === "digit") {
4214
4215
  const isNumber = props2.type === "number";
4215
4216
  value = formatNumber(value, isNumber, isNumber);
@@ -4229,7 +4230,7 @@ var stdin_default$1K = defineComponent({
4229
4230
  selectionEnd
4230
4231
  } = inputRef.value;
4231
4232
  const bcoVal = cutString(originalValue, selectionEnd);
4232
- formatterDiffLen = getStringLength(formatter(bcoVal)) - getStringLength(bcoVal);
4233
+ formatterDiffLen = formatter(bcoVal).length - bcoVal.length;
4233
4234
  }
4234
4235
  }
4235
4236
  if (inputRef.value && inputRef.value.value !== value) {
@@ -4240,7 +4241,7 @@ var stdin_default$1K = defineComponent({
4240
4241
  } = inputRef.value;
4241
4242
  inputRef.value.value = value;
4242
4243
  if (isDef(selectionStart) && isDef(selectionEnd)) {
4243
- const valueLen = getStringLength(value);
4244
+ const valueLen = value.length;
4244
4245
  if (limitDiffLen) {
4245
4246
  selectionStart -= limitDiffLen;
4246
4247
  selectionEnd -= limitDiffLen;
@@ -21840,7 +21841,7 @@ const Lazyload = {
21840
21841
  });
21841
21842
  }
21842
21843
  };
21843
- const version = "0.0.48";
21844
+ const version = "0.0.49";
21844
21845
  function install(app) {
21845
21846
  const components = [
21846
21847
  ActionBar,
package/lib/vant.js CHANGED
@@ -5435,10 +5435,11 @@
5435
5435
  if (modelValue && getStringLength(modelValue) === +maxlength) {
5436
5436
  return modelValue;
5437
5437
  }
5438
- const selectionEnd = (_a = inputRef.value) == null ? void 0 : _a.selectionEnd;
5438
+ let selectionEnd = (_a = inputRef.value) == null ? void 0 : _a.selectionEnd;
5439
5439
  if (state.focused && selectionEnd) {
5440
5440
  const valueArr = [...value];
5441
5441
  const exceededLength = valueArr.length - +maxlength;
5442
+ selectionEnd = getStringLength(value.slice(0, selectionEnd));
5442
5443
  valueArr.splice(selectionEnd - exceededLength, exceededLength);
5443
5444
  return valueArr.join("");
5444
5445
  }
@@ -5449,7 +5450,7 @@
5449
5450
  const updateValue = (value, trigger2 = "onChange") => {
5450
5451
  const originalValue = value;
5451
5452
  value = limitValueLength(value);
5452
- const limitDiffLen = getStringLength(originalValue) - getStringLength(value);
5453
+ const limitDiffLen = originalValue.length - value.length;
5453
5454
  if (props2.type === "number" || props2.type === "digit") {
5454
5455
  const isNumber2 = props2.type === "number";
5455
5456
  value = formatNumber(value, isNumber2, isNumber2);
@@ -5469,7 +5470,7 @@
5469
5470
  selectionEnd
5470
5471
  } = inputRef.value;
5471
5472
  const bcoVal = cutString(originalValue, selectionEnd);
5472
- formatterDiffLen = getStringLength(formatter(bcoVal)) - getStringLength(bcoVal);
5473
+ formatterDiffLen = formatter(bcoVal).length - bcoVal.length;
5473
5474
  }
5474
5475
  }
5475
5476
  if (inputRef.value && inputRef.value.value !== value) {
@@ -5480,7 +5481,7 @@
5480
5481
  } = inputRef.value;
5481
5482
  inputRef.value.value = value;
5482
5483
  if (isDef(selectionStart) && isDef(selectionEnd)) {
5483
- const valueLen = getStringLength(value);
5484
+ const valueLen = value.length;
5484
5485
  if (limitDiffLen) {
5485
5486
  selectionStart -= limitDiffLen;
5486
5487
  selectionEnd -= limitDiffLen;
@@ -25429,7 +25430,7 @@
25429
25430
  });
25430
25431
  }
25431
25432
  };
25432
- const version = "0.0.48";
25433
+ const version = "0.0.49";
25433
25434
  function install(app) {
25434
25435
  const components = [
25435
25436
  ActionBar,