dfish-widget 1.0.98 → 1.0.100

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
@@ -5667,7 +5667,12 @@ const props = __props;
5667
5667
  return Array.isArray(props.current) ? props.current.includes(item[propValue]) : (props.current === item[propValue])
5668
5668
  };
5669
5669
 
5670
+ let autoFocus = true;
5671
+ let autoFocusTimer;
5670
5672
  const clickItem = (e, item) => {
5673
+ autoFocus = false;
5674
+ clearTimeout(autoFocusTimer);
5675
+ autoFocusTimer = setTimeout(() => autoFocus = true, 500);
5671
5676
  emits('click:item', e, item);
5672
5677
  };
5673
5678
 
@@ -5839,7 +5844,9 @@ const props = __props;
5839
5844
  expandTo(v);
5840
5845
  }
5841
5846
  }
5842
- focus(val[0]);
5847
+ if (autoFocus) {
5848
+ focus(val[0]);
5849
+ }
5843
5850
  };
5844
5851
 
5845
5852
  onMounted(async () => {
@@ -6294,14 +6301,24 @@ var script$K = {
6294
6301
  ref: 'quickCloseButton',
6295
6302
  data: {isQuickCloseButton: true},
6296
6303
  showDropIcon: false,
6297
- icon: '.f-i .f-i-ellipsis',
6304
+ icon: '.f-i .f-i-close',
6298
6305
  class: 'w-tabbar-quickclosebutton',
6299
- onDropClose: this.onMouseleave
6300
- }, {
6301
- default: () => [
6302
- h(script$11, {text: '关闭全部标签', onClick: this.closeAll, disabled: closeAllDisabled})
6303
- ]
6306
+ onClick: this.closeAll,
6307
+ disabled: closeAllDisabled,
6308
+ title: '关闭全部标签'
6304
6309
  }));
6310
+ // gut.push(h(Button, {
6311
+ // ref: 'quickCloseButton',
6312
+ // data: {isQuickCloseButton: true},
6313
+ // showDropIcon: false,
6314
+ // icon: '.f-i .f-i-ellipsis',
6315
+ // class: 'w-tabbar-quickclosebutton',
6316
+ // onDropClose: this.onMouseleave
6317
+ // }, {
6318
+ // default: () => [
6319
+ // h(Button, {text: '关闭全部标签', onClick: this.closeAll, disabled: closeAllDisabled})
6320
+ // ]
6321
+ // }))
6305
6322
  }
6306
6323
  }
6307
6324
  return this.html_scroll_slots(gut)
@@ -6723,9 +6740,16 @@ const props = __props;
6723
6740
  const isDisabled = (item, index) => {
6724
6741
  return typeof propDisabled === 'function' ? propDisabled(item, index) : item[propDisabled]
6725
6742
  };
6726
-
6743
+
6744
+ let autoFocus = true;
6745
+ let autoFocusTimer;
6727
6746
  const clickItem = (e, item) => {
6728
- if (!isDisabled(item)) emits('click:item', e, item);
6747
+ if (!isDisabled(item)) {
6748
+ autoFocus = false;
6749
+ clearTimeout(autoFocusTimer);
6750
+ autoFocusTimer = setTimeout(() => autoFocus = true, 500);
6751
+ emits('click:item', e, item);
6752
+ }
6729
6753
  };
6730
6754
 
6731
6755
  const clickToggle = (e, item) => {
@@ -6898,7 +6922,9 @@ const props = __props;
6898
6922
  expandTo(v);
6899
6923
  }
6900
6924
  }
6901
- focus(val[0]);
6925
+ if (autoFocus) {
6926
+ focus(val[0]);
6927
+ }
6902
6928
  };
6903
6929
 
6904
6930
  onMounted(async () => {
@@ -7619,7 +7645,16 @@ const {leafSymbol: leafSymbol$1} = $$1.symbol;
7619
7645
  onclick: e => {
7620
7646
  if (this.isNormal) {
7621
7647
  this.indeterminate = false;
7622
- } else e.preventDefault();
7648
+ if (this.x.cancelable && this.isChecked) {
7649
+ e.preventDefault();
7650
+ this.val(false);
7651
+ setTimeout(() => {
7652
+ this.$refs.v.checked = false;
7653
+ });
7654
+ }
7655
+ } else {
7656
+ e.preventDefault();
7657
+ }
7623
7658
  },
7624
7659
  onchange: this.onchange,
7625
7660
  ...this.input_prop,
@@ -9870,6 +9905,7 @@ var script$j = {
9870
9905
  name: 'w-radio',
9871
9906
  pubParentName: 'w-radiogroup',
9872
9907
  mixins: [script$A],
9908
+ props: ['cancelable'],
9873
9909
  methods: {
9874
9910
 
9875
9911
  },
@@ -11371,7 +11407,7 @@ var script$b = {
11371
11407
  return {
11372
11408
  showDrop: false,
11373
11409
  currentDate: null,
11374
- focusValue: null,
11410
+ lastValue: null,
11375
11411
  placeholder_type: 'placeholder_select',
11376
11412
  }
11377
11413
  },
@@ -11397,7 +11433,7 @@ var script$b = {
11397
11433
  return true
11398
11434
  },
11399
11435
  onfocus(e) {
11400
- this.focusValue = this.x.modelValue;
11436
+ this.lastValue = this.x.modelValue;
11401
11437
  this.baseFocus(e);
11402
11438
  },
11403
11439
  onkeyup() {
@@ -11420,7 +11456,7 @@ var script$b = {
11420
11456
  let v = this.x.modelValue;
11421
11457
  if (v) {
11422
11458
  if (!this.isUsableVal(v)) {
11423
- this.x.autoFix && this.val(this.focusValue);
11459
+ this.x.autoFix && this.val(this.lastValue);
11424
11460
  } else {
11425
11461
  let re = /\b(\d)\b/g;
11426
11462
  if (re.test(v)) {
@@ -11597,6 +11633,18 @@ var script$b = {
11597
11633
  'z-clearable': this.x.clearable,
11598
11634
  }
11599
11635
  }
11636
+ },
11637
+ mounted() {
11638
+ this.$watch('modelValue', (v) => {
11639
+ if (this.x.autoFix && v && (v = $$1.strTrim(v))) {
11640
+ if (!$$1.dateValid(v, this.x.format)) {
11641
+ let d = $$1.dateParse(v, this.x.format);
11642
+ v = $$1.dateFormat(d, this.x.format);
11643
+ this.val(v);
11644
+ }
11645
+ this.lastValue = v;
11646
+ }
11647
+ }, {immediate: true});
11600
11648
  }
11601
11649
  };
11602
11650
 
@@ -13083,6 +13131,7 @@ var script = {
13083
13131
  let v = (dist / (bar.width)) * (this.x.maxValue - this.x.minValue);
13084
13132
  v = $$1.numRange(v, this.x.minValue, this.x.maxValue);
13085
13133
  this.val(v);
13134
+ this.trigger('drop', v);
13086
13135
  }
13087
13136
  },
13088
13137
  html_input() {