dfish-widget 1.0.62 → 1.0.64

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/lib/index.esm.js CHANGED
@@ -5467,7 +5467,7 @@ var script$O = /*#__PURE__*/Object.assign(__default__$1, {
5467
5467
  }
5468
5468
  },
5469
5469
  current: {
5470
- type: [String, Number]
5470
+ type: [String, Number, Array]
5471
5471
  },
5472
5472
  itemHeight: {
5473
5473
  type: [String, Number],
@@ -5553,7 +5553,7 @@ const props = __props;
5553
5553
  };
5554
5554
 
5555
5555
  const isCurrent = (item) => {
5556
- return props.current === item[propValue]
5556
+ return Array.isArray(props.current) ? props.current.includes(item[propValue]) : (props.current === item[propValue])
5557
5557
  };
5558
5558
 
5559
5559
  const clickItem = (e, item) => {
@@ -5699,14 +5699,19 @@ const props = __props;
5699
5699
  const watchCurrent = async (val) => {
5700
5700
  await nextTick();
5701
5701
  current = val;
5702
- if (!showList.value.find(n => n[propValue] === val)) {
5703
- const item = expandTo(val);
5704
- const i = flatList.value.indexOf(item);
5705
- if (i > -1) {
5706
- await nextTick();
5707
- wrap.value.scrollToY(((i + 1) * itemHeight) - (flow.value.height / 2));
5702
+ if (!val) return
5703
+ val = $$1.array(val);
5704
+ for (let v of val) {
5705
+ if (!showList.value.find(n => v == n[propValue])) {
5706
+ expandTo(v);
5708
5707
  }
5709
5708
  }
5709
+ const item = find(val[0]);
5710
+ const i = flatList.value.indexOf(item);
5711
+ if (i > -1) {
5712
+ await nextTick();
5713
+ wrap.value.scrollToY(((i + 1) * itemHeight) - (flow.value.height / 2));
5714
+ }
5710
5715
  };
5711
5716
 
5712
5717
  onMounted(async () => {
@@ -7051,6 +7056,9 @@ var script$A = {
7051
7056
  isFocusTarget(el) {
7052
7057
  // dao
7053
7058
  },
7059
+ getInputValue(mv) {
7060
+ return mv
7061
+ },
7054
7062
  // @original: 检测表单是否有修改,对照参考的值为初始值
7055
7063
  isModified(original) {
7056
7064
  let dv = original ? this.defaultValue : this.modifiedValue;
@@ -7059,7 +7067,7 @@ var script$A = {
7059
7067
  if (mv == null) mv = '';
7060
7068
  if (dv == mv)
7061
7069
  return false
7062
- return JSON.stringify(dv) != JSON.stringify(mv)
7070
+ return this.getInputValue(dv) != this.getInputValue(mv)
7063
7071
  },
7064
7072
  // @original: 设置为true,修改初始值
7065
7073
  saveModified(original) {
@@ -7211,7 +7219,7 @@ var script$A = {
7211
7219
  return r
7212
7220
  },
7213
7221
  input_value() {
7214
- return this.x.modelValue
7222
+ return this.getInputValue(this.x.modelValue)
7215
7223
  },
7216
7224
  input_name() {
7217
7225
  return this.x.name
@@ -7354,6 +7362,10 @@ var script$z = {
7354
7362
  this.parentTrigger('change', v);
7355
7363
  }
7356
7364
  },
7365
+ getInputValue(v) {
7366
+ // 如果没有定义value,必须返回空字符串。因为当<input type="checkbox">没有value属性时,它的表单值会变成"on"
7367
+ return v == null ? '' : v
7368
+ },
7357
7369
  parentTrigger(e, v) {
7358
7370
  if (this.pubParent && this.pubParent.watchValue != v) {
7359
7371
  this.pubParent.watchValue = v;
@@ -7394,21 +7406,13 @@ var script$z = {
7394
7406
  this.onbasechange(e);
7395
7407
  },
7396
7408
  isModified(original) {
7397
- if (this.pubParent) {
7398
- return this.pubParent.isModified(original)
7399
- } else {
7400
- let c = original ? this.defaultChecked : this.modifiedChecked;
7401
- return c == this.isChecked
7402
- }
7409
+ let c = original ? this.defaultChecked : this.modifiedChecked;
7410
+ return c != this.isChecked
7403
7411
  },
7404
7412
  saveModified(original) {
7405
- if (this.pubParent) {
7406
- this.pubParent.saveModified(original);
7407
- } else {
7408
- this.modifiedChecked = this.isChecked;
7409
- if (original) {
7410
- this.defaultChecked = this.modifiedChecked;
7411
- }
7413
+ this.modifiedChecked = this.isChecked;
7414
+ if (original) {
7415
+ this.defaultChecked = this.modifiedChecked;
7412
7416
  }
7413
7417
  },
7414
7418
  snapElem() {
@@ -7485,10 +7489,6 @@ var script$z = {
7485
7489
  input_name() {
7486
7490
  return this.x.name || (this.pubParent && this.pubParent.x.name)
7487
7491
  },
7488
- input_value() {
7489
- // 如果没有定义value,必须返回空字符串。因为当<input type="checkbox">没有value属性时,它的表单值会变成"on"
7490
- return this.x.value == null ? '' : this.x.value
7491
- },
7492
7492
  input_prop() {
7493
7493
  return {
7494
7494
  indeterminate: this.indeterminate,
@@ -10259,6 +10259,9 @@ const suffixHooks = {
10259
10259
  this.$emit('update:modelValue', v);
10260
10260
  this.trigger('change', v);
10261
10261
  },
10262
+ getInputValue(v) {
10263
+ return v.length == 0 ? '' : JSON.stringify(v)
10264
+ },
10262
10265
  getFileTypes() {
10263
10266
  let t = this.x.fileTypes;
10264
10267
  if (fileTypesAlias[t]) {
@@ -10521,8 +10524,7 @@ const suffixHooks = {
10521
10524
  }
10522
10525
  },
10523
10526
  input_value() {
10524
- let v = this.val();
10525
- return v.length == 0 ? '' : JSON.stringify(v)
10527
+ return this.getInputValue(this.val())
10526
10528
  },
10527
10529
  errorTipTarget() {
10528
10530
  return this.$refs.uploadbbr || this
@@ -11449,6 +11451,10 @@ var script$8 = {
11449
11451
  mixins: [script$9],
11450
11452
  props: ['picker', 'clearable'],
11451
11453
  methods: {
11454
+ // implement
11455
+ getInputValue(v) {
11456
+ return v && typeof v === 'object' ? JSON.stringify(v) : v == null ? '' : v
11457
+ },
11452
11458
  click(e) {
11453
11459
  if (this.$slots.default) {
11454
11460
  this.showDrop = !this.showDrop;
@@ -11497,10 +11503,6 @@ var script$8 = {
11497
11503
  hasVal() {
11498
11504
  return this.input_text
11499
11505
  },
11500
- input_value() {
11501
- let v = this.x.modelValue;
11502
- return v && typeof v === 'object' ? JSON.stringify(v) : v == null ? '' : v
11503
- },
11504
11506
  input_text() {
11505
11507
  let v = this.x.modelValue;
11506
11508
  if (v && typeof v === 'string') {
@@ -11612,6 +11614,7 @@ var script$5 = {
11612
11614
  }
11613
11615
  },
11614
11616
  methods: {
11617
+ // implement
11615
11618
  watchModelValue(v, ov) {
11616
11619
  this.clear();
11617
11620
  const or = ov && ov.map ? ov.map(n => n.value).join(',') : '';
@@ -11620,6 +11623,9 @@ var script$5 = {
11620
11623
  this.trigger('change', v);
11621
11624
  }
11622
11625
  },
11626
+ getInputValue(mv) {
11627
+ return typeof mv === 'string' ? mv : $$1.array(mv).map(v => v.value).join(',')
11628
+ },
11623
11629
  addVal(v) {
11624
11630
  let mv;
11625
11631
  if (this.x.multiple) {
@@ -11855,9 +11861,6 @@ var script$5 = {
11855
11861
  hasVal() {
11856
11862
  return this.input_value
11857
11863
  },
11858
- input_value() {
11859
- return typeof this.x.modelValue === 'string' ? this.x.modelValue : $$1.array(this.x.modelValue).map(v => v.value).join(',')
11860
- },
11861
11864
  input_title() {
11862
11865
  return typeof this.x.modelValue === 'string' ? '' : $$1.array(this.x.modelValue).map(v => v.text).join(', ')
11863
11866
  },
@@ -11921,6 +11924,9 @@ var script$4 = {
11921
11924
  strict: true
11922
11925
  }
11923
11926
  },
11927
+ getInputValue(mv) {
11928
+ return typeof mv === 'string' ? mv : $$1.array(mv).map(v => v.value).join(',')
11929
+ },
11924
11930
  initOptions(v) {
11925
11931
  if (v == null) v = this.x.modelValue;
11926
11932
  if (v && typeof v !== 'string') {
@@ -12316,9 +12322,6 @@ var script$4 = {
12316
12322
  hasVal() {
12317
12323
  return this.input_value
12318
12324
  },
12319
- input_value() {
12320
- return typeof this.x.modelValue === 'string' ? this.x.modelValue : $$1.array(this.x.modelValue).map(v => v.value).join(',')
12321
- },
12322
12325
  input_title() {
12323
12326
  return typeof this.x.modelValue === 'string' ? '' : $$1.array(this.x.modelValue).map(v => v.text || v.value).join(', ')
12324
12327
  },
@@ -12619,6 +12622,9 @@ var script$1 = {
12619
12622
  mixins: [script$A],
12620
12623
  props: ['vertical'],
12621
12624
  methods: {
12625
+ getInputValue(mv) {
12626
+ return mv == null ? '' : typeof mv === 'object' ? JSON.stringify(mv) : mv
12627
+ },
12622
12628
  html_input() {
12623
12629
  return [
12624
12630
  this.html_input_hidden(),
@@ -12637,10 +12643,6 @@ var script$1 = {
12637
12643
  }
12638
12644
  }
12639
12645
  },
12640
- input_value() {
12641
- let mv = this.x.modelValue;
12642
- return mv == null ? '' : typeof mv === 'object' ? JSON.stringify(mv) : mv
12643
- },
12644
12646
  html_class() {
12645
12647
  return [{
12646
12648
  'z-vertical': this.x.vertical,