dfish-widget 1.0.87 → 1.0.88

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
@@ -4472,7 +4472,7 @@ script$13.__file = "src/widgets/Img.vue";
4472
4472
  var script$12 = {
4473
4473
  pubParentName: 'w-buttonbar',
4474
4474
  mixins: [script$1h],
4475
- props: ['text', 'icon', 'focusIcon', 'face', 'target', 'closable', 'loading', 'disabled', 'vertical', 'hoverShowDrop', 'dropProps', 'dropIcon', 'showDropIcon'],
4475
+ props: ['text', 'icon', 'focusIcon', 'face', 'target', 'closable', 'dropToggle', 'loading', 'disabled', 'vertical', 'hoverShowDrop', 'dropProps', 'dropIcon', 'showDropIcon'],
4476
4476
  inject: ['providePubParent', 'provideMenu_w'],
4477
4477
  emits: ['click:close', 'dropClose'],
4478
4478
  data() {
@@ -4482,7 +4482,7 @@ var script$12 = {
4482
4482
  mouses: {
4483
4483
  onmouseenter: e => {
4484
4484
  if (!this.showDrop) {
4485
- if (this.pubParent && menuRelate(this.pubParent) && !menuRelate()) ;
4485
+ if (this.pubParent && menuRelate(this.pubParent) && !menuRelate(this)) closeMenu();
4486
4486
  if(this.x.hoverShowDrop) {
4487
4487
  this.drop();
4488
4488
  this.$nextTick(() => e.currentTarget.classList.add('z-hv'));
@@ -4509,14 +4509,23 @@ var script$12 = {
4509
4509
  drop() {
4510
4510
  if (this.hasChild) {
4511
4511
  this.showDrop = true;
4512
+ } else {
4513
+ closeMenu();
4512
4514
  }
4515
+ },
4516
+ isShowDrop() {
4517
+ return this.showDrop
4513
4518
  },
4514
4519
  closeDrop() {
4515
4520
  this.showDrop = false;
4516
4521
  },
4517
4522
  onclick(e) {
4518
4523
  if (this.isMore) {
4519
- this.drop();
4524
+ if (this.showDrop && this.x.dropToggle) {
4525
+ this.closeDrop();
4526
+ } else {
4527
+ this.drop();
4528
+ }
4520
4529
  }
4521
4530
  if (this.pubParent)
4522
4531
  this.pubParent.$emit('click:item', e);
@@ -4788,8 +4797,15 @@ script$10.__file = "src/widgets/Button.vue";
4788
4797
 
4789
4798
  let inst = null;
4790
4799
 
4800
+ function closeMenu() {
4801
+ if (inst) {
4802
+ $$1.close(inst);
4803
+ inst = null;
4804
+ }
4805
+ }
4806
+
4791
4807
  function menuRelate(ctx) {
4792
- return inst
4808
+ return inst && (ctx.hasBubble(inst.context) || inst.hasBubble(ctx))
4793
4809
  }
4794
4810
 
4795
4811
  var script$$ = {
@@ -4828,7 +4844,6 @@ let inst = null;
4828
4844
  // implement
4829
4845
  setVisibleSub(a) {
4830
4846
  if (a === false && this.currentMenuButton) {
4831
- console.log('setVisibleSub');
4832
4847
  this.currentMenuButton.showDrop = false;
4833
4848
  // this.subMenu.setVisibleSub(a)
4834
4849
  }
@@ -4917,12 +4932,12 @@ let inst = null;
4917
4932
  }
4918
4933
  },
4919
4934
  mounted() {
4920
- // if (!this.context || (this.context.$options && this.context.$options.name !== 'w-menubutton')) {
4921
- // if (inst) {
4922
- // $.close(inst)
4923
- // }
4924
- // inst = this
4925
- // }
4935
+ if (!this.context || (this.context.$options && this.context.$options.name !== 'w-menubutton')) {
4936
+ if (inst && inst.context !== this.context) {
4937
+ $$1.close(inst);
4938
+ }
4939
+ inst = this;
4940
+ }
4926
4941
  }
4927
4942
  };
4928
4943