dfish-widget 1.0.133 → 1.0.135
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 +45 -10
- package/lib/index.esm.js.map +1 -1
- package/package.json +1 -1
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,
|
|
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
|
},
|
|
@@ -7665,10 +7682,13 @@ const {leafSymbol: leafSymbol$1} = $$1.symbol;
|
|
|
7665
7682
|
if (!this.isNormal) return
|
|
7666
7683
|
this.val(a);
|
|
7667
7684
|
},
|
|
7685
|
+
siblingsContainer() {
|
|
7686
|
+
return this.ownerView.el()
|
|
7687
|
+
},
|
|
7668
7688
|
// @a -> T/F 是否只获取所有选中项, b -> 是否只选择可用的
|
|
7669
7689
|
siblings(a, b) {
|
|
7670
7690
|
return $$1.lodash.map($$1.q(':input[name="' + this.input_name + '"]:not([w-form-ignore] :input)' + (b ? ':not(:disabled)' : '') +
|
|
7671
|
-
(a === true ? ':checked' : a === false ? ':not(:checked)' : (a || '')), this.
|
|
7691
|
+
(a === true ? ':checked' : a === false ? ':not(:checked)' : (a || '')), this.siblingsContainer()), e => $$1(e))
|
|
7672
7692
|
},
|
|
7673
7693
|
relate() {
|
|
7674
7694
|
// implement
|
|
@@ -7845,6 +7865,7 @@ const {leafSymbol} = $$1.symbol;
|
|
|
7845
7865
|
name: 'w-triplebox',
|
|
7846
7866
|
mixins: [script$B],
|
|
7847
7867
|
props: ['all'],
|
|
7868
|
+
inject: ['provideTripleboxContainer'],
|
|
7848
7869
|
created() {
|
|
7849
7870
|
if (this.provideBoxParent) {
|
|
7850
7871
|
if (this.data && !this.data[leafSymbol]) {
|
|
@@ -7911,17 +7932,31 @@ const {leafSymbol} = $$1.symbol;
|
|
|
7911
7932
|
}
|
|
7912
7933
|
}
|
|
7913
7934
|
this.x.modelValue = mv;
|
|
7914
|
-
let gv = this.groupFormVal();
|
|
7915
|
-
gv = gv ? gv.split(',') : [];
|
|
7916
7935
|
this.$emit('update:modelValue', mv);
|
|
7917
|
-
this.
|
|
7918
|
-
|
|
7936
|
+
if (!this.x.all) {
|
|
7937
|
+
this.parentTrigger(event, this.groupFormVal());
|
|
7938
|
+
}
|
|
7919
7939
|
},
|
|
7920
7940
|
formVal() {
|
|
7921
7941
|
if (this.isDisabled) return ''
|
|
7922
7942
|
let s = this.checkstate();
|
|
7923
7943
|
return s == 1 || (this.x.partialSubmit && s == 2) ? this.$refs.v.value : ''
|
|
7924
7944
|
},
|
|
7945
|
+
siblingsContainer() {
|
|
7946
|
+
let c = this.provideTripleboxContainer;
|
|
7947
|
+
return (c && c.el()) || this.ownerView.el()
|
|
7948
|
+
},
|
|
7949
|
+
parentTrigger(e, v) {
|
|
7950
|
+
let c = this.provideTripleboxContainer;
|
|
7951
|
+
let d = c && c.el();
|
|
7952
|
+
if (v) {
|
|
7953
|
+
v = v.split(',').sort().join(',');
|
|
7954
|
+
}
|
|
7955
|
+
if (d && d.getAttribute('wTripleboxValue') != v) {
|
|
7956
|
+
d.setAttribute('wTripleboxValue', v);
|
|
7957
|
+
this.trigger(e, v);
|
|
7958
|
+
}
|
|
7959
|
+
},
|
|
7925
7960
|
onchange(e) {
|
|
7926
7961
|
this.onbasechange(e);
|
|
7927
7962
|
this.relate();
|