dfish-widget 1.0.133 → 1.0.134

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
@@ -2,7 +2,7 @@ import lodash from 'lodash';
2
2
  import jquery from 'jquery';
3
3
  import http from 'axios';
4
4
  import Qs from 'qs';
5
- import { nextTick, h, mergeProps, toRaw, resolveComponent, openBlock, createElementBlock, createStaticVNode, createElementVNode, createBlock, withCtx, Fragment, createVNode, renderList, toDisplayString, createTextVNode, createCommentVNode, inject, provide, renderSlot, Teleport, computed, resolveDirective, withDirectives, unref, markRaw, ref, onMounted, watch, normalizeStyle, normalizeClass, TransitionGroup, getCurrentInstance, createSlots, resolveDynamicComponent, withModifiers } from 'vue';
5
+ import { nextTick, h, mergeProps, toRaw, resolveComponent, openBlock, createElementBlock, createStaticVNode, createElementVNode, createBlock, withCtx, Fragment, createVNode, renderList, toDisplayString, createTextVNode, createCommentVNode, inject, provide, renderSlot, Teleport, computed, resolveDirective, withDirectives, unref, markRaw, ref, getCurrentInstance, onMounted, watch, normalizeStyle, normalizeClass, TransitionGroup, createSlots, resolveDynamicComponent, withModifiers } from 'vue';
6
6
  import ResizeObserver$1 from 'resize-observer-polyfill';
7
7
 
8
8
  let u = navigator.userAgent.toLowerCase();
@@ -1243,6 +1243,11 @@ $$1.string = function(a) {
1243
1243
  typeof a === 'object' ? JSON.stringify(a) : '' + a
1244
1244
  };
1245
1245
 
1246
+ /*
1247
+ * 表单返回值可能是字符串 '1,2,3',也可能是数组 [1,2,3],为了不影响已有的项目,给出这种修正
1248
+ */
1249
+ // Array.prototype.split = function() {return this}
1250
+
1246
1251
  // a -> object
1247
1252
  $$1.array = function(a) {
1248
1253
  return Array.isArray(a) ? a : a == null || a === '' ? [] : [a]
@@ -1749,7 +1754,8 @@ $$1.submit = (request, options = {}) => {
1749
1754
  };
1750
1755
 
1751
1756
  $$1.symbol = {
1752
- leafSymbol: Symbol('leaf')
1757
+ leafSymbol: Symbol('leaf'),
1758
+ changeSymbol: Symbol('change'),
1753
1759
  };
1754
1760
 
1755
1761
  window.addEventListener('unhandledrejection', (event) => {
@@ -3032,6 +3038,7 @@ var script$1k = {
3032
3038
  provideRangeParent: null,
3033
3039
  provideCompatGap: null,
3034
3040
  provideMenu_w: null,
3041
+ provideTripleboxContainer: null,
3035
3042
  }
3036
3043
  },
3037
3044
  beforeCreate() {
@@ -5035,6 +5042,7 @@ var script$$ = {
5035
5042
  _provideTable: this,
5036
5043
  provideLevel: -1,
5037
5044
  provideParentTR: null,
5045
+ provideTripleboxContainer: this
5038
5046
  }
5039
5047
  },
5040
5048
  data() {
@@ -5672,7 +5680,7 @@ var script$Q = /*#__PURE__*/Object.assign(__default__$1, {
5672
5680
  const props = __props;
5673
5681
 
5674
5682
 
5675
-
5683
+
5676
5684
 
5677
5685
 
5678
5686
  let {alias, itemHeight, current} = props;
@@ -5691,6 +5699,9 @@ const props = __props;
5691
5699
  const flow = ref();
5692
5700
  const xLoading = ref(false);
5693
5701
  const loading = computed(() => props.loading || xLoading.value);
5702
+
5703
+ provide('provideTripleboxContainer', getCurrentInstance());
5704
+
5694
5705
 
5695
5706
  const wrapStyle = computed(() => {
5696
5707
  return {
@@ -6639,6 +6650,7 @@ var script$F = {
6639
6650
  provideLevel: -1,
6640
6651
  provideParentLeaf: null,
6641
6652
  provideParentTR: null,
6653
+ provideTripleboxContainer: this
6642
6654
  }
6643
6655
  },
6644
6656
  methods: {
@@ -6772,6 +6784,8 @@ const props = __props;
6772
6784
  const flow = ref();
6773
6785
  const xLoading = ref(false);
6774
6786
  const loading = computed(() => props.loading || xLoading.value);
6787
+
6788
+ provide('provideTripleboxContainer', getCurrentInstance);
6775
6789
 
6776
6790
  const wrapStyle = computed(() => {
6777
6791
  return {
@@ -7576,7 +7590,7 @@ var script$C = {
7576
7590
 
7577
7591
  script$C.__file = "src/widgets/FormBase.vue";
7578
7592
 
7579
- const {leafSymbol: leafSymbol$1} = $$1.symbol;
7593
+ const {leafSymbol: leafSymbol$1,changeSymbol} = $$1.symbol;
7580
7594
 
7581
7595
  var script$B = {
7582
7596
  name: 'w-checkbox',
@@ -7643,11 +7657,14 @@ const {leafSymbol: leafSymbol$1} = $$1.symbol;
7643
7657
  });
7644
7658
  return r.join(',')
7645
7659
  }
7660
+ if (Array.isArray(a)) {
7661
+ a = a.join(',');
7662
+ }
7646
7663
  $$1.lodash.each(this.siblings(), f => f.val($$1.idsAny(a, f.checkValue)));
7647
7664
  },
7648
7665
  watchModelValue(v, ov) {
7649
7666
  if (ov != v) {
7650
- this.trigger('change', v);
7667
+ // this.trigger('change', v)
7651
7668
  this.parentTrigger('change', v);
7652
7669
  }
7653
7670
  },
@@ -7845,6 +7862,7 @@ const {leafSymbol} = $$1.symbol;
7845
7862
  name: 'w-triplebox',
7846
7863
  mixins: [script$B],
7847
7864
  props: ['all'],
7865
+ inject: ['provideTripleboxContainer'],
7848
7866
  created() {
7849
7867
  if (this.provideBoxParent) {
7850
7868
  if (this.data && !this.data[leafSymbol]) {
@@ -7911,17 +7929,24 @@ const {leafSymbol} = $$1.symbol;
7911
7929
  }
7912
7930
  }
7913
7931
  this.x.modelValue = mv;
7914
- let gv = this.groupFormVal();
7915
- gv = gv ? gv.split(',') : [];
7916
7932
  this.$emit('update:modelValue', mv);
7917
- this.trigger(event, gv);
7918
- this.parentTrigger('change', gv);
7933
+ if (!this.x.all) {
7934
+ this.parentTrigger(event, mv);
7935
+ }
7919
7936
  },
7920
7937
  formVal() {
7921
7938
  if (this.isDisabled) return ''
7922
7939
  let s = this.checkstate();
7923
7940
  return s == 1 || (this.x.partialSubmit && s == 2) ? this.$refs.v.value : ''
7924
7941
  },
7942
+ parentTrigger(e, v) {
7943
+ let c = this.provideTripleboxContainer;
7944
+ let d = c && c.el();
7945
+ if (d && d.getAttribute('wTripleboxValue') != v) {
7946
+ d.setAttribute('wTripleboxValue', v);
7947
+ this.trigger(e, v);
7948
+ }
7949
+ },
7925
7950
  onchange(e) {
7926
7951
  this.onbasechange(e);
7927
7952
  this.relate();