dfish-widget 1.0.84 → 1.0.86

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
@@ -3530,8 +3530,8 @@ const O = {},
3530
3530
  var script$1a = {
3531
3531
  name: 'w-dialog',
3532
3532
  mixins: [script$1c],
3533
- props: ['title', 'autoHide', 'context', 'prong', 'independent', 'timeout',
3534
- 'cover', 'position', 'snap', 'indent', 'offsetRange', 'local', 'fullScreen', 'hoverShowDrop', 'visible',
3533
+ props: ['title', 'autoHide', 'context', 'prong', 'independent', 'timeout', 'cover', 'coverProps',
3534
+ 'position', 'snap', 'indent', 'offsetRange', 'local', 'fullScreen', 'hoverShowDrop', 'visible',
3535
3535
  ...boundary
3536
3536
  ],
3537
3537
  emits: ['show', 'close', 'click:cover', 'update:visible'],
@@ -3783,11 +3783,17 @@ const O = {},
3783
3783
  },
3784
3784
  html() {
3785
3785
  let to = this.x.local ? this.getLocalElem() : '#w-dfish-pops';
3786
- let cover = this.x.cover && this.x.visible !== false && !this.isDeactivated ? h('div', {
3787
- ref: 'cover',
3788
- class: 'w-dialog-cover f-abs-full',
3789
- onclick: e => this.trigger('click:cover', e)
3790
- }) : null;
3786
+ let cover = null;
3787
+ if (this.x.cover && this.x.visible !== false && !this.isDeactivated) {
3788
+ let coverProps = {
3789
+ ref: 'cover',
3790
+ class: 'w-dialog-cover f-abs-full'
3791
+ };
3792
+ if (this.x.coverProps) {
3793
+ coverProps = mergeProps(coverProps, this.x.coverProps);
3794
+ }
3795
+ cover = h('div', coverProps);
3796
+ }
3791
3797
  let s = [cover, this.html_self(true)];
3792
3798
  let r = to ? h(Teleport, {to}, s) : s;
3793
3799
  return this.slotTarget ? [r, h(script$1b, null, {default: () => [this.slotTarget()]})] : r
@@ -4475,7 +4481,7 @@ var script$12 = {
4475
4481
  mouses: {
4476
4482
  onmouseenter: e => {
4477
4483
  if (!this.showDrop) {
4478
- if (this.pubParent && menuRelate(this.pubParent) && !menuRelate(this)) closeMenu();
4484
+ if (this.pubParent && menuRelate(this.pubParent) && !menuRelate()) ;
4479
4485
  if(this.x.hoverShowDrop) {
4480
4486
  this.drop();
4481
4487
  this.$nextTick(() => e.currentTarget.classList.add('z-hv'));
@@ -4502,12 +4508,10 @@ var script$12 = {
4502
4508
  drop() {
4503
4509
  if (this.hasChild) {
4504
4510
  this.showDrop = true;
4505
- } else {
4506
- closeMenu();
4507
4511
  }
4508
4512
  },
4509
4513
  closeDrop() {
4510
- this.showDrop = false;
4514
+ this.showDrop = false;
4511
4515
  },
4512
4516
  onclick(e) {
4513
4517
  if (this.isMore) {
@@ -4783,15 +4787,8 @@ script$10.__file = "src/widgets/Button.vue";
4783
4787
 
4784
4788
  let inst = null;
4785
4789
 
4786
- function closeMenu() {
4787
- if (inst) {
4788
- $$1.close(inst);
4789
- inst = null;
4790
- }
4791
- }
4792
-
4793
4790
  function menuRelate(ctx) {
4794
- return inst && (ctx.hasBubble(inst.context) || inst.hasBubble(ctx))
4791
+ return inst
4795
4792
  }
4796
4793
 
4797
4794
  var script$$ = {
@@ -4830,6 +4827,7 @@ let inst = null;
4830
4827
  // implement
4831
4828
  setVisibleSub(a) {
4832
4829
  if (a === false && this.currentMenuButton) {
4830
+ console.log('setVisibleSub');
4833
4831
  this.currentMenuButton.showDrop = false;
4834
4832
  // this.subMenu.setVisibleSub(a)
4835
4833
  }
@@ -4918,12 +4916,12 @@ let inst = null;
4918
4916
  }
4919
4917
  },
4920
4918
  mounted() {
4921
- if (!this.context || (this.context.$options && this.context.$options.name !== 'w-menubutton')) {
4922
- if (inst) {
4923
- $$1.close(inst);
4924
- }
4925
- inst = this;
4926
- }
4919
+ // if (!this.context || (this.context.$options && this.context.$options.name !== 'w-menubutton')) {
4920
+ // if (inst) {
4921
+ // $.close(inst)
4922
+ // }
4923
+ // inst = this
4924
+ // }
4927
4925
  }
4928
4926
  };
4929
4927
 
@@ -10430,9 +10428,8 @@ const suffixHooks = {
10430
10428
  name: 'w-fileupload',
10431
10429
  mixins: [script$A],
10432
10430
  props: ['uploadSrc', 'thumbnailSrc', 'downloadSrc', 'uploadLimit', 'sizeLimit', 'maxFileSize', 'minFileSize',
10433
- 'fileTypes', 'filter', 'success', 'error', 'itemWidth', 'click:item', 'align', 'vertical', 'gap'
10431
+ 'fileTypes', 'filter', 'success', 'error', 'itemWidth', 'align', 'vertical', 'gap'
10434
10432
  ],
10435
- emits: ['click:item'],
10436
10433
  data() {
10437
10434
  return {
10438
10435
  list: [],
@@ -10589,13 +10586,11 @@ const suffixHooks = {
10589
10586
  this.$emit('update:modelValue', v);
10590
10587
  this.trigger('change', v);
10591
10588
  },
10592
- clickItem(e, item, ctx) {
10593
- if (!item.value) return
10594
- if (this.getOn('click:item')) {
10595
- e.runType = 'click:item';
10596
- e.value = item.value;
10597
- this.trigger(e, item.value, ctx);
10598
- } else if (this.x.downloadSrc) {
10589
+ clickItem(e, item) {
10590
+ if (!item.value || !this.x.downloadSrc) return
10591
+ if (typeof this.x.downloadSrc === 'function') {
10592
+ this.x.downloadSrc(item.value);
10593
+ } else {
10599
10594
  $$1.download($$1.urlServer(this.x.downloadSrc, item.value, this.x.data));
10600
10595
  }
10601
10596
  },
@@ -10646,14 +10641,14 @@ const suffixHooks = {
10646
10641
  }, [
10647
10642
  h('i', {
10648
10643
  class: ['w-fileupload-value-icon f-i', 'f-i-file-' + getSuffix(name)],
10649
- onclick: e => this.clickItem(e, item, this)
10644
+ onclick: e => this.clickItem(e, item)
10650
10645
  }),
10651
10646
  item.error && h('div', {
10652
10647
  class: 'w-fileupload-value-error'
10653
10648
  }, $$1.loc.form.upload_error),
10654
10649
  h('div', {
10655
10650
  class: 'w-fileupload-value-text f-line-1',
10656
- onclick: e => this.clickItem(e, item, this)
10651
+ onclick: e => this.clickItem(e, item)
10657
10652
  }, name),
10658
10653
  button
10659
10654
  ])
@@ -11809,27 +11804,30 @@ script$6.__file = "src/widgets/Range.vue";
11809
11804
  var script$5 = {
11810
11805
  name: 'w-combobox',
11811
11806
  mixins: [script$A],
11812
- props: ['multiple', 'dropper', 'picker', 'dropProps', 'br', 'inputValue', 'clearable'],
11813
- emits: ['input', 'click:item', 'blur', 'focus', 'update:inputValue', 'clear'],
11807
+ props: ['multiple', 'strict', 'dropper', 'picker', 'dropProps', 'br', 'clearable'],
11808
+ emits: ['input', 'click:item', 'blur', 'focus', 'clear'],
11814
11809
  data() {
11815
11810
  return {
11816
11811
  hasBorder: true,
11817
11812
  text: '',
11818
11813
  showSuggest: false,
11819
11814
  sug_timer: null,
11820
- sensor_text: this.inputValue,
11815
+ sensor_text: this.getInputText(this.modelValue),
11821
11816
  sensor_width: null,
11822
11817
  }
11823
11818
  },
11824
- watch: {
11825
- inputValue(v) {
11826
- this.sensor_text = v;
11827
- }
11828
- },
11829
11819
  methods: {
11820
+ x_default() {
11821
+ return {
11822
+ strict: true
11823
+ }
11824
+ },
11830
11825
  // implement
11831
11826
  watchModelValue(v, ov) {
11832
11827
  this.clear();
11828
+ if (!this.x.strict) {
11829
+ this.sensor_text = this.getInputText(v);
11830
+ }
11833
11831
  const or = ov && ov.map ? ov.map(n => n.value).join(',') : '';
11834
11832
  const r = v && v.map ? v.map(n => n.value).join(',') : '';
11835
11833
  if (or != r) {
@@ -11837,7 +11835,18 @@ var script$5 = {
11837
11835
  }
11838
11836
  },
11839
11837
  getInputValue(mv) {
11840
- return typeof mv === 'string' ? mv : $$1.array(mv).map(v => v.value).join(',')
11838
+ if (typeof mv === 'string') {
11839
+ return mv
11840
+ }
11841
+ let r = $$1.array(mv).filter(v => v.value).map(v => v.value);
11842
+ if (!this.x.strict && this.sensor_text) {
11843
+ r.push(this.sensor_text);
11844
+ }
11845
+ return r.join(',')
11846
+ },
11847
+ getInputText(mv) {
11848
+ const n = $$1.array(mv).find(v => !v.value && v.text);
11849
+ return n ? n.text : ''
11841
11850
  },
11842
11851
  addVal(v) {
11843
11852
  let mv;
@@ -11891,7 +11900,6 @@ var script$5 = {
11891
11900
  oninput(e) {
11892
11901
  let v = e.target.value;
11893
11902
  this.sensor_text = v;
11894
- this.$emit('update:inputValue', v);
11895
11903
  clearTimeout(this.sug_timer);
11896
11904
  if (v === '') {
11897
11905
  this.suggest(false);
@@ -11973,7 +11981,7 @@ var script$5 = {
11973
11981
  html_options() {
11974
11982
  let m = this.x.modelValue;
11975
11983
  if (m && typeof m !== 'string') {
11976
- return [].concat(m).map(v => h('div', {
11984
+ return $$1.array(m).filter(v => v.value).map(v => h('div', {
11977
11985
  class: ['w-combobox-option f-flex-center', {
11978
11986
  'z-forbid': v.forbid
11979
11987
  }],
@@ -12010,7 +12018,6 @@ var script$5 = {
12010
12018
  onkeydown: this.onkeydown,
12011
12019
  onblur: this.onblur,
12012
12020
  onfocus: this.onfocus,
12013
-
12014
12021
  })
12015
12022
  ])
12016
12023
  },
@@ -12074,8 +12081,17 @@ var script$5 = {
12074
12081
  validHooks() {
12075
12082
  return {
12076
12083
  validateDefault: (v) => {
12077
- if (this.$refs.input.value)
12078
- return this.formErr({type: 'invalid_option'})
12084
+ if (this.sensor_text) {
12085
+ if (this.x.strict) {
12086
+ return this.formErr({type: 'invalid_option'})
12087
+ }
12088
+ if (!this.x.multiple) {
12089
+ const n = $$1.array(this.x.modelValue).find(v => v.value);
12090
+ if (n) {
12091
+ return this.formErr({type: 'maxSize'}, 1)
12092
+ }
12093
+ }
12094
+ }
12079
12095
  },
12080
12096
  ...this.pubValidHooks,
12081
12097
  }