vxe-pc-ui 4.14.26 → 4.14.27
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/dist/all.esm.js +224 -181
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/form/src/form-config-item.js +10 -6
- package/es/form/src/form.js +55 -15
- package/es/form/style.css +2 -2
- package/es/form/style.min.css +1 -1
- package/es/radio/style.css +2 -2
- package/es/radio/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-form/style.css +2 -2
- package/es/vxe-form/style.min.css +1 -1
- package/es/vxe-radio/style.css +2 -2
- package/es/vxe-radio/style.min.css +1 -1
- package/lib/form/src/form-config-item.js +11 -4
- package/lib/form/src/form-config-item.min.js +1 -1
- package/lib/form/src/form.js +69 -17
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/style/style.css +2 -2
- package/lib/form/style/style.min.css +1 -1
- package/lib/index.umd.js +256 -197
- package/lib/index.umd.min.js +1 -1
- package/lib/radio/style/style.css +2 -2
- package/lib/radio/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-form/style/style.css +2 -2
- package/lib/vxe-form/style/style.min.css +1 -1
- package/lib/vxe-radio/style/style.css +2 -2
- package/lib/vxe-radio/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/form/src/form-config-item.ts +12 -4
- package/packages/form/src/form.ts +58 -15
- package/packages/form/src/util.ts +1 -1
- package/styles/components/form.scss +2 -2
- package/styles/components/radio.scss +2 -2
- package/types/components/form.d.ts +22 -3
- package/types/components/notice-bar.d.ts +4 -0
- /package/es/icon/{iconfont.1780292459831.ttf → iconfont.1780477619002.ttf} +0 -0
- /package/es/icon/{iconfont.1780292459831.woff → iconfont.1780477619002.woff} +0 -0
- /package/es/icon/{iconfont.1780292459831.woff2 → iconfont.1780477619002.woff2} +0 -0
- /package/es/{iconfont.1780292459831.ttf → iconfont.1780477619002.ttf} +0 -0
- /package/es/{iconfont.1780292459831.woff → iconfont.1780477619002.woff} +0 -0
- /package/es/{iconfont.1780292459831.woff2 → iconfont.1780477619002.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1780292459831.ttf → iconfont.1780477619002.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1780292459831.woff → iconfont.1780477619002.woff} +0 -0
- /package/lib/icon/style/{iconfont.1780292459831.woff2 → iconfont.1780477619002.woff2} +0 -0
- /package/lib/{iconfont.1780292459831.ttf → iconfont.1780477619002.ttf} +0 -0
- /package/lib/{iconfont.1780292459831.woff → iconfont.1780477619002.woff} +0 -0
- /package/lib/{iconfont.1780292459831.woff2 → iconfont.1780477619002.woff2} +0 -0
package/dist/all.esm.js
CHANGED
|
@@ -80,11 +80,11 @@ function checkDynamic() {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
const version$1 = `ui v${"4.14.
|
|
83
|
+
const version$1 = `ui v${"4.14.27"}`;
|
|
84
84
|
const warnLog = log.create('warn', version$1);
|
|
85
85
|
const errLog = log.create('error', version$1);
|
|
86
86
|
|
|
87
|
-
const version = "4.14.
|
|
87
|
+
const version = "4.14.27";
|
|
88
88
|
VxeUI.uiVersion = version;
|
|
89
89
|
VxeUI.dynamicApp = dynamicApp;
|
|
90
90
|
function config(options) {
|
|
@@ -3778,7 +3778,7 @@ function createInternalData$d() {
|
|
|
3778
3778
|
targetEl: null
|
|
3779
3779
|
};
|
|
3780
3780
|
}
|
|
3781
|
-
function createReactData$
|
|
3781
|
+
function createReactData$9() {
|
|
3782
3782
|
return {
|
|
3783
3783
|
showBtn: false,
|
|
3784
3784
|
backtopZindex: 0
|
|
@@ -3858,7 +3858,7 @@ var VxeBacktopComponent = defineVxeComponent({
|
|
|
3858
3858
|
const refElem = ref();
|
|
3859
3859
|
const { computeSize } = useSize(props);
|
|
3860
3860
|
const internalData = createInternalData$d();
|
|
3861
|
-
const reactData = reactive(createReactData$
|
|
3861
|
+
const reactData = reactive(createReactData$9());
|
|
3862
3862
|
const refMaps = {
|
|
3863
3863
|
refElem
|
|
3864
3864
|
};
|
|
@@ -4035,7 +4035,7 @@ var VxeBacktopComponent = defineVxeComponent({
|
|
|
4035
4035
|
});
|
|
4036
4036
|
onBeforeUnmount(() => {
|
|
4037
4037
|
removeScrollEvent();
|
|
4038
|
-
XEUtils.assign(reactData, createReactData$
|
|
4038
|
+
XEUtils.assign(reactData, createReactData$9());
|
|
4039
4039
|
XEUtils.assign(internalData, createInternalData$d());
|
|
4040
4040
|
});
|
|
4041
4041
|
$xeBacktop.renderVN = renderVN;
|
|
@@ -13299,7 +13299,7 @@ function createInternalData$a() {
|
|
|
13299
13299
|
// leaveTime: null
|
|
13300
13300
|
};
|
|
13301
13301
|
}
|
|
13302
|
-
function createReactData$
|
|
13302
|
+
function createReactData$8() {
|
|
13303
13303
|
return {
|
|
13304
13304
|
visible: false,
|
|
13305
13305
|
activeOption: null,
|
|
@@ -13355,7 +13355,7 @@ var VxeContextMenuComponent = defineVxeComponent({
|
|
|
13355
13355
|
const refElem = ref();
|
|
13356
13356
|
const { computeSize } = useSize(props);
|
|
13357
13357
|
const internalData = createInternalData$a();
|
|
13358
|
-
const reactData = reactive(createReactData$
|
|
13358
|
+
const reactData = reactive(createReactData$8());
|
|
13359
13359
|
const refMaps = {
|
|
13360
13360
|
refElem
|
|
13361
13361
|
};
|
|
@@ -13910,7 +13910,7 @@ var VxeContextMenuComponent = defineVxeComponent({
|
|
|
13910
13910
|
globalEvents.off($xeContextMenu, 'keydown');
|
|
13911
13911
|
globalEvents.off($xeContextMenu, 'mousedown');
|
|
13912
13912
|
globalEvents.off($xeContextMenu, 'blur');
|
|
13913
|
-
XEUtils.assign(reactData, createReactData$
|
|
13913
|
+
XEUtils.assign(reactData, createReactData$8());
|
|
13914
13914
|
XEUtils.assign(internalData, createInternalData$a());
|
|
13915
13915
|
});
|
|
13916
13916
|
$xeContextMenu.renderVN = renderVN;
|
|
@@ -19675,26 +19675,182 @@ function renderItemContent($xeForm, item) {
|
|
|
19675
19675
|
}, contentVNs);
|
|
19676
19676
|
}
|
|
19677
19677
|
|
|
19678
|
+
const formItemProps = {
|
|
19679
|
+
title: String,
|
|
19680
|
+
field: String,
|
|
19681
|
+
span: {
|
|
19682
|
+
type: [String, Number],
|
|
19683
|
+
default: null
|
|
19684
|
+
},
|
|
19685
|
+
align: {
|
|
19686
|
+
type: String,
|
|
19687
|
+
default: null
|
|
19688
|
+
},
|
|
19689
|
+
verticalAlign: {
|
|
19690
|
+
type: String,
|
|
19691
|
+
default: null
|
|
19692
|
+
},
|
|
19693
|
+
titleBackground: {
|
|
19694
|
+
type: Boolean,
|
|
19695
|
+
default: null
|
|
19696
|
+
},
|
|
19697
|
+
titleBold: {
|
|
19698
|
+
type: Boolean,
|
|
19699
|
+
default: null
|
|
19700
|
+
},
|
|
19701
|
+
titleAlign: {
|
|
19702
|
+
type: String,
|
|
19703
|
+
default: null
|
|
19704
|
+
},
|
|
19705
|
+
titleWidth: {
|
|
19706
|
+
type: [String, Number],
|
|
19707
|
+
default: null
|
|
19708
|
+
},
|
|
19709
|
+
titleColon: {
|
|
19710
|
+
type: Boolean,
|
|
19711
|
+
default: null
|
|
19712
|
+
},
|
|
19713
|
+
titleAsterisk: {
|
|
19714
|
+
type: Boolean,
|
|
19715
|
+
default: null
|
|
19716
|
+
},
|
|
19717
|
+
showTitle: {
|
|
19718
|
+
type: Boolean,
|
|
19719
|
+
default: true
|
|
19720
|
+
},
|
|
19721
|
+
vertical: {
|
|
19722
|
+
type: Boolean,
|
|
19723
|
+
default: null
|
|
19724
|
+
},
|
|
19725
|
+
padding: {
|
|
19726
|
+
type: Boolean,
|
|
19727
|
+
default: null
|
|
19728
|
+
},
|
|
19729
|
+
formatter: [String, Function],
|
|
19730
|
+
className: [String, Function],
|
|
19731
|
+
contentClassName: [String, Function],
|
|
19732
|
+
contentStyle: [Object, Function],
|
|
19733
|
+
titleClassName: [String, Function],
|
|
19734
|
+
titleStyle: [Object, Function],
|
|
19735
|
+
titleOverflow: {
|
|
19736
|
+
type: [Boolean, String],
|
|
19737
|
+
default: null
|
|
19738
|
+
},
|
|
19739
|
+
titlePrefix: Object,
|
|
19740
|
+
titleSuffix: Object,
|
|
19741
|
+
resetValue: { default: null },
|
|
19742
|
+
visibleMethod: Function,
|
|
19743
|
+
visible: {
|
|
19744
|
+
type: Boolean,
|
|
19745
|
+
default: null
|
|
19746
|
+
},
|
|
19747
|
+
showContent: {
|
|
19748
|
+
type: Boolean,
|
|
19749
|
+
default: null
|
|
19750
|
+
},
|
|
19751
|
+
folding: Boolean,
|
|
19752
|
+
collapseNode: Boolean,
|
|
19753
|
+
itemRender: Object,
|
|
19754
|
+
rules: Array,
|
|
19755
|
+
params: Object
|
|
19756
|
+
};
|
|
19757
|
+
var VxeFormItemComponent = defineVxeComponent({
|
|
19758
|
+
name: 'VxeFormItem',
|
|
19759
|
+
props: formItemProps,
|
|
19760
|
+
setup(props, { slots }) {
|
|
19761
|
+
const xID = XEUtils.uniqueId();
|
|
19762
|
+
const refElem = ref();
|
|
19763
|
+
const $xeForm = inject('$xeForm', {});
|
|
19764
|
+
const $xeFormGroup = inject('$xeFormGroup', null);
|
|
19765
|
+
const formItem = reactive(createItem($xeForm, props));
|
|
19766
|
+
formItem.slots = slots;
|
|
19767
|
+
const formItemInfo = { itemConfig: formItem };
|
|
19768
|
+
provide('xeFormItemInfo', formItemInfo);
|
|
19769
|
+
const renderItem = ($xeForm, item) => {
|
|
19770
|
+
const formProps = $xeForm.props;
|
|
19771
|
+
const $xeGrid = $xeForm.xeGrid;
|
|
19772
|
+
const { data, readonly, disabled } = formProps;
|
|
19773
|
+
const { visible, field, itemRender, contentStyle, showContent } = item;
|
|
19774
|
+
const compConf = isEnableConf(itemRender) ? renderer.get(itemRender.name) : null;
|
|
19775
|
+
const itemStyle = compConf ? (compConf.formItemStyle || compConf.itemStyle) : null;
|
|
19776
|
+
const itemContentStyle = compConf ? (compConf.formItemContentStyle || compConf.itemContentStyle) : null;
|
|
19777
|
+
const params = { data, disabled, readonly, field, property: field, item, $form: $xeForm, $grid: $xeGrid };
|
|
19778
|
+
if (visible === false) {
|
|
19779
|
+
return renderEmptyElement($xeFormItem);
|
|
19780
|
+
}
|
|
19781
|
+
return h('div', {
|
|
19782
|
+
ref: refElem,
|
|
19783
|
+
key: item.id,
|
|
19784
|
+
itemid: item.id,
|
|
19785
|
+
class: getItemClass($xeForm, item),
|
|
19786
|
+
style: XEUtils.isFunction(itemStyle) ? itemStyle(params) : itemStyle
|
|
19787
|
+
}, [
|
|
19788
|
+
renderTitle($xeForm, item),
|
|
19789
|
+
showContent === false
|
|
19790
|
+
? renderEmptyElement($xeFormItem)
|
|
19791
|
+
: h('div', {
|
|
19792
|
+
class: getItemContentClass($xeForm, item),
|
|
19793
|
+
style: Object.assign({}, XEUtils.isFunction(itemContentStyle) ? itemContentStyle(params) : itemContentStyle, XEUtils.isFunction(contentStyle) ? contentStyle(params) : contentStyle)
|
|
19794
|
+
}, [
|
|
19795
|
+
renderItemContent($xeForm, item),
|
|
19796
|
+
renderItemErrorIcon($xeForm, item)
|
|
19797
|
+
])
|
|
19798
|
+
]);
|
|
19799
|
+
};
|
|
19800
|
+
const renderVN = () => {
|
|
19801
|
+
const customLayout = $xeForm ? $xeForm.props.customLayout : false;
|
|
19802
|
+
const item = formItem;
|
|
19803
|
+
return customLayout
|
|
19804
|
+
? renderItem($xeForm, item)
|
|
19805
|
+
: h('div', {
|
|
19806
|
+
ref: refElem
|
|
19807
|
+
});
|
|
19808
|
+
};
|
|
19809
|
+
const $xeFormItem = {
|
|
19810
|
+
xID,
|
|
19811
|
+
formItem,
|
|
19812
|
+
renderVN
|
|
19813
|
+
};
|
|
19814
|
+
watchItem(props, formItem);
|
|
19815
|
+
onMounted(() => {
|
|
19816
|
+
const elem = refElem.value;
|
|
19817
|
+
assembleItem($xeForm, elem, formItem, $xeFormGroup);
|
|
19818
|
+
});
|
|
19819
|
+
onUnmounted(() => {
|
|
19820
|
+
destroyItem($xeForm, formItem);
|
|
19821
|
+
});
|
|
19822
|
+
provide('$xeFormItem', $xeFormItem);
|
|
19823
|
+
provide('$xeFormGroup', null);
|
|
19824
|
+
return $xeFormItem;
|
|
19825
|
+
},
|
|
19826
|
+
render() {
|
|
19827
|
+
return this.renderVN();
|
|
19828
|
+
}
|
|
19829
|
+
});
|
|
19830
|
+
|
|
19678
19831
|
const VxeFormConfigItem = defineVxeComponent({
|
|
19679
19832
|
name: 'VxeFormConfigItem',
|
|
19680
|
-
props: {
|
|
19681
|
-
itemConfig: Object
|
|
19682
|
-
},
|
|
19833
|
+
props: Object.assign({ itemConfig: Object }, formItemProps),
|
|
19683
19834
|
setup(props) {
|
|
19684
19835
|
const $xeForm = inject('$xeForm', {});
|
|
19685
19836
|
const xeformiteminfo = { itemConfig: props.itemConfig };
|
|
19686
19837
|
provide('xeFormItemInfo', xeformiteminfo);
|
|
19838
|
+
const computeItemVisible = computed(() => {
|
|
19839
|
+
const { visible } = props.itemConfig;
|
|
19840
|
+
return visible;
|
|
19841
|
+
});
|
|
19687
19842
|
const renderItem = ($xeForm, item) => {
|
|
19688
19843
|
const formProps = $xeForm.props;
|
|
19689
19844
|
const $xeGrid = $xeForm.xeGrid;
|
|
19690
19845
|
const { data, readonly, disabled } = formProps;
|
|
19691
|
-
const {
|
|
19846
|
+
const { field, itemRender, contentStyle, children, showContent } = item;
|
|
19847
|
+
const itemVisible = computeItemVisible.value;
|
|
19692
19848
|
const compConf = isEnableConf(itemRender) ? renderer.get(itemRender.name) : null;
|
|
19693
19849
|
const itemStyle = compConf ? (compConf.formItemStyle || compConf.itemStyle) : null;
|
|
19694
19850
|
const itemContentStyle = compConf ? (compConf.formItemContentStyle || compConf.itemContentStyle) : null;
|
|
19695
19851
|
const params = { data, disabled, readonly, field, property: field, item, $form: $xeForm, $grid: $xeGrid };
|
|
19696
19852
|
const hasGroup = children && children.length > 0;
|
|
19697
|
-
if (
|
|
19853
|
+
if (itemVisible === false) {
|
|
19698
19854
|
return renderEmptyElement($xeForm);
|
|
19699
19855
|
}
|
|
19700
19856
|
return h('div', {
|
|
@@ -20353,6 +20509,14 @@ function checkRuleStatus(rule, data, val) {
|
|
|
20353
20509
|
}
|
|
20354
20510
|
return true;
|
|
20355
20511
|
}
|
|
20512
|
+
function createReactData$7() {
|
|
20513
|
+
return {
|
|
20514
|
+
collapseAll: false,
|
|
20515
|
+
staticItems: [],
|
|
20516
|
+
formItems: [],
|
|
20517
|
+
itemWidth: 0
|
|
20518
|
+
};
|
|
20519
|
+
}
|
|
20356
20520
|
function createInternalData$9() {
|
|
20357
20521
|
return {
|
|
20358
20522
|
meTimeout: undefined,
|
|
@@ -20361,7 +20525,9 @@ function createInternalData$9() {
|
|
|
20361
20525
|
item: null,
|
|
20362
20526
|
visible: false
|
|
20363
20527
|
},
|
|
20364
|
-
itemFormatCache: {}
|
|
20528
|
+
itemFormatCache: {},
|
|
20529
|
+
fullItemIdData: {},
|
|
20530
|
+
fullItemFieldData: {}
|
|
20365
20531
|
};
|
|
20366
20532
|
}
|
|
20367
20533
|
var VxeFormComponent = defineVxeComponent({
|
|
@@ -20460,12 +20626,7 @@ var VxeFormComponent = defineVxeComponent({
|
|
|
20460
20626
|
const $xeGrid = inject('$xeGrid', null);
|
|
20461
20627
|
const xID = XEUtils.uniqueId();
|
|
20462
20628
|
const { computeSize } = useSize(props);
|
|
20463
|
-
const reactData = reactive(
|
|
20464
|
-
collapseAll: props.collapseStatus,
|
|
20465
|
-
staticItems: [],
|
|
20466
|
-
formItems: [],
|
|
20467
|
-
itemWidth: 0
|
|
20468
|
-
});
|
|
20629
|
+
const reactData = reactive(createReactData$7());
|
|
20469
20630
|
const internalData = createInternalData$9();
|
|
20470
20631
|
const refElem = ref();
|
|
20471
20632
|
const refTooltip = ref();
|
|
@@ -20529,7 +20690,7 @@ var VxeFormComponent = defineVxeComponent({
|
|
|
20529
20690
|
}
|
|
20530
20691
|
return [];
|
|
20531
20692
|
};
|
|
20532
|
-
const
|
|
20693
|
+
const loadItems = (list) => {
|
|
20533
20694
|
if (list.length) {
|
|
20534
20695
|
list.forEach((item) => {
|
|
20535
20696
|
if (item.slots) {
|
|
@@ -20557,8 +20718,9 @@ var VxeFormComponent = defineVxeComponent({
|
|
|
20557
20718
|
return itemList;
|
|
20558
20719
|
};
|
|
20559
20720
|
const getItemByField = (field) => {
|
|
20560
|
-
const
|
|
20561
|
-
|
|
20721
|
+
const { fullItemFieldData } = internalData;
|
|
20722
|
+
const itemRest = fullItemFieldData[field];
|
|
20723
|
+
return itemRest ? itemRest.item : null;
|
|
20562
20724
|
};
|
|
20563
20725
|
const getCollapseStatus = () => {
|
|
20564
20726
|
return reactData.collapseAll;
|
|
@@ -20622,6 +20784,23 @@ var VxeFormComponent = defineVxeComponent({
|
|
|
20622
20784
|
}
|
|
20623
20785
|
return resetValue;
|
|
20624
20786
|
};
|
|
20787
|
+
const cacheItem = () => {
|
|
20788
|
+
const { formItems } = reactData;
|
|
20789
|
+
const itemIdData = {};
|
|
20790
|
+
const itemFieldData = {};
|
|
20791
|
+
XEUtils.eachTree(formItems, (item, index, items) => {
|
|
20792
|
+
const { id, field } = item;
|
|
20793
|
+
const itemRest = { item, items, index };
|
|
20794
|
+
if (id) {
|
|
20795
|
+
itemIdData[id] = itemRest;
|
|
20796
|
+
}
|
|
20797
|
+
if (field) {
|
|
20798
|
+
itemFieldData[field] = itemRest;
|
|
20799
|
+
}
|
|
20800
|
+
}, { children: 'children' });
|
|
20801
|
+
internalData.fullItemFieldData = itemFieldData;
|
|
20802
|
+
internalData.fullItemIdData = itemIdData;
|
|
20803
|
+
};
|
|
20625
20804
|
const reset = () => {
|
|
20626
20805
|
const { data } = props;
|
|
20627
20806
|
const itemList = getItems();
|
|
@@ -21002,10 +21181,25 @@ var VxeFormComponent = defineVxeComponent({
|
|
|
21002
21181
|
const handleGlobalResizeEvent = () => {
|
|
21003
21182
|
recalculate();
|
|
21004
21183
|
};
|
|
21184
|
+
const handleItemVisible = (visible) => {
|
|
21185
|
+
return function (fieldOrItems) {
|
|
21186
|
+
const objs = XEUtils.isArray(fieldOrItems) ? fieldOrItems : [fieldOrItems];
|
|
21187
|
+
objs.forEach(obj => {
|
|
21188
|
+
const item = handleFieldOrItem($xeForm, obj);
|
|
21189
|
+
if (item) {
|
|
21190
|
+
item.visible = visible;
|
|
21191
|
+
}
|
|
21192
|
+
});
|
|
21193
|
+
return nextTick();
|
|
21194
|
+
};
|
|
21195
|
+
};
|
|
21005
21196
|
formMethods = {
|
|
21006
21197
|
dispatchEvent(type, params, evnt) {
|
|
21007
21198
|
emit(type, createEvent(evnt, { $form: $xeForm, $grid: $xeGrid }, params));
|
|
21008
21199
|
},
|
|
21200
|
+
loadItems,
|
|
21201
|
+
showItem: handleItemVisible(true),
|
|
21202
|
+
hideItem: handleItemVisible(false),
|
|
21009
21203
|
reset,
|
|
21010
21204
|
validate,
|
|
21011
21205
|
validateField,
|
|
@@ -21054,12 +21248,12 @@ var VxeFormComponent = defineVxeComponent({
|
|
|
21054
21248
|
: formItems.map((item, index) => {
|
|
21055
21249
|
return h(VxeFormConfigItem, {
|
|
21056
21250
|
key: index,
|
|
21057
|
-
itemConfig: item
|
|
21251
|
+
itemConfig: item,
|
|
21252
|
+
visible: item.visible
|
|
21058
21253
|
});
|
|
21059
21254
|
})),
|
|
21060
21255
|
h('div', {
|
|
21061
|
-
class: 'vxe-form-slots'
|
|
21062
|
-
ref: 'hideItem'
|
|
21256
|
+
class: 'vxe-form-slots'
|
|
21063
21257
|
}, customLayout ? [] : (defaultSlot ? defaultSlot({}) : [])),
|
|
21064
21258
|
/**
|
|
21065
21259
|
* 加载中
|
|
@@ -21096,6 +21290,7 @@ var VxeFormComponent = defineVxeComponent({
|
|
|
21096
21290
|
watch(staticItemFlag, () => {
|
|
21097
21291
|
reactData.formItems = reactData.staticItems;
|
|
21098
21292
|
recalcFlag.value++;
|
|
21293
|
+
cacheItem();
|
|
21099
21294
|
});
|
|
21100
21295
|
const itemFlag = ref(0);
|
|
21101
21296
|
watch(() => props.items ? props.items.length : -1, () => {
|
|
@@ -21105,7 +21300,7 @@ var VxeFormComponent = defineVxeComponent({
|
|
|
21105
21300
|
itemFlag.value++;
|
|
21106
21301
|
});
|
|
21107
21302
|
watch(itemFlag, () => {
|
|
21108
|
-
|
|
21303
|
+
loadItems(props.items || []);
|
|
21109
21304
|
});
|
|
21110
21305
|
watch(() => props.collapseStatus, (value) => {
|
|
21111
21306
|
reactData.collapseAll = !!value;
|
|
@@ -21128,8 +21323,9 @@ var VxeFormComponent = defineVxeComponent({
|
|
|
21128
21323
|
globalEvents.off($xeForm, 'resize');
|
|
21129
21324
|
XEUtils.assign(internalData, createInternalData$9());
|
|
21130
21325
|
});
|
|
21326
|
+
reactData.collapseAll = !!props.collapseStatus;
|
|
21131
21327
|
if (props.items) {
|
|
21132
|
-
|
|
21328
|
+
loadItems(props.items);
|
|
21133
21329
|
}
|
|
21134
21330
|
provide('xeFormItemInfo', null);
|
|
21135
21331
|
provide('$xeForm', $xeForm);
|
|
@@ -21152,159 +21348,6 @@ dynamicApp.use(VxeForm);
|
|
|
21152
21348
|
VxeUI.component(VxeFormComponent);
|
|
21153
21349
|
const Form = VxeForm;
|
|
21154
21350
|
|
|
21155
|
-
const formItemProps = {
|
|
21156
|
-
title: String,
|
|
21157
|
-
field: String,
|
|
21158
|
-
span: {
|
|
21159
|
-
type: [String, Number],
|
|
21160
|
-
default: null
|
|
21161
|
-
},
|
|
21162
|
-
align: {
|
|
21163
|
-
type: String,
|
|
21164
|
-
default: null
|
|
21165
|
-
},
|
|
21166
|
-
verticalAlign: {
|
|
21167
|
-
type: String,
|
|
21168
|
-
default: null
|
|
21169
|
-
},
|
|
21170
|
-
titleBackground: {
|
|
21171
|
-
type: Boolean,
|
|
21172
|
-
default: null
|
|
21173
|
-
},
|
|
21174
|
-
titleBold: {
|
|
21175
|
-
type: Boolean,
|
|
21176
|
-
default: null
|
|
21177
|
-
},
|
|
21178
|
-
titleAlign: {
|
|
21179
|
-
type: String,
|
|
21180
|
-
default: null
|
|
21181
|
-
},
|
|
21182
|
-
titleWidth: {
|
|
21183
|
-
type: [String, Number],
|
|
21184
|
-
default: null
|
|
21185
|
-
},
|
|
21186
|
-
titleColon: {
|
|
21187
|
-
type: Boolean,
|
|
21188
|
-
default: null
|
|
21189
|
-
},
|
|
21190
|
-
titleAsterisk: {
|
|
21191
|
-
type: Boolean,
|
|
21192
|
-
default: null
|
|
21193
|
-
},
|
|
21194
|
-
showTitle: {
|
|
21195
|
-
type: Boolean,
|
|
21196
|
-
default: true
|
|
21197
|
-
},
|
|
21198
|
-
vertical: {
|
|
21199
|
-
type: Boolean,
|
|
21200
|
-
default: null
|
|
21201
|
-
},
|
|
21202
|
-
padding: {
|
|
21203
|
-
type: Boolean,
|
|
21204
|
-
default: null
|
|
21205
|
-
},
|
|
21206
|
-
formatter: [String, Function],
|
|
21207
|
-
className: [String, Function],
|
|
21208
|
-
contentClassName: [String, Function],
|
|
21209
|
-
contentStyle: [Object, Function],
|
|
21210
|
-
titleClassName: [String, Function],
|
|
21211
|
-
titleStyle: [Object, Function],
|
|
21212
|
-
titleOverflow: {
|
|
21213
|
-
type: [Boolean, String],
|
|
21214
|
-
default: null
|
|
21215
|
-
},
|
|
21216
|
-
titlePrefix: Object,
|
|
21217
|
-
titleSuffix: Object,
|
|
21218
|
-
resetValue: { default: null },
|
|
21219
|
-
visibleMethod: Function,
|
|
21220
|
-
visible: {
|
|
21221
|
-
type: Boolean,
|
|
21222
|
-
default: null
|
|
21223
|
-
},
|
|
21224
|
-
showContent: {
|
|
21225
|
-
type: Boolean,
|
|
21226
|
-
default: null
|
|
21227
|
-
},
|
|
21228
|
-
folding: Boolean,
|
|
21229
|
-
collapseNode: Boolean,
|
|
21230
|
-
itemRender: Object,
|
|
21231
|
-
rules: Array,
|
|
21232
|
-
params: Object
|
|
21233
|
-
};
|
|
21234
|
-
var VxeFormItemComponent = defineVxeComponent({
|
|
21235
|
-
name: 'VxeFormItem',
|
|
21236
|
-
props: formItemProps,
|
|
21237
|
-
setup(props, { slots }) {
|
|
21238
|
-
const xID = XEUtils.uniqueId();
|
|
21239
|
-
const refElem = ref();
|
|
21240
|
-
const $xeForm = inject('$xeForm', {});
|
|
21241
|
-
const $xeFormGroup = inject('$xeFormGroup', null);
|
|
21242
|
-
const formItem = reactive(createItem($xeForm, props));
|
|
21243
|
-
formItem.slots = slots;
|
|
21244
|
-
const formItemInfo = { itemConfig: formItem };
|
|
21245
|
-
provide('xeFormItemInfo', formItemInfo);
|
|
21246
|
-
const renderItem = ($xeForm, item) => {
|
|
21247
|
-
const formProps = $xeForm.props;
|
|
21248
|
-
const $xeGrid = $xeForm.xeGrid;
|
|
21249
|
-
const { data, readonly, disabled } = formProps;
|
|
21250
|
-
const { visible, field, itemRender, contentStyle, showContent } = item;
|
|
21251
|
-
const compConf = isEnableConf(itemRender) ? renderer.get(itemRender.name) : null;
|
|
21252
|
-
const itemStyle = compConf ? (compConf.formItemStyle || compConf.itemStyle) : null;
|
|
21253
|
-
const itemContentStyle = compConf ? (compConf.formItemContentStyle || compConf.itemContentStyle) : null;
|
|
21254
|
-
const params = { data, disabled, readonly, field, property: field, item, $form: $xeForm, $grid: $xeGrid };
|
|
21255
|
-
if (visible === false) {
|
|
21256
|
-
return renderEmptyElement($xeFormItem);
|
|
21257
|
-
}
|
|
21258
|
-
return h('div', {
|
|
21259
|
-
ref: refElem,
|
|
21260
|
-
key: item.id,
|
|
21261
|
-
itemid: item.id,
|
|
21262
|
-
class: getItemClass($xeForm, item),
|
|
21263
|
-
style: XEUtils.isFunction(itemStyle) ? itemStyle(params) : itemStyle
|
|
21264
|
-
}, [
|
|
21265
|
-
renderTitle($xeForm, item),
|
|
21266
|
-
showContent === false
|
|
21267
|
-
? renderEmptyElement($xeFormItem)
|
|
21268
|
-
: h('div', {
|
|
21269
|
-
class: getItemContentClass($xeForm, item),
|
|
21270
|
-
style: Object.assign({}, XEUtils.isFunction(itemContentStyle) ? itemContentStyle(params) : itemContentStyle, XEUtils.isFunction(contentStyle) ? contentStyle(params) : contentStyle)
|
|
21271
|
-
}, [
|
|
21272
|
-
renderItemContent($xeForm, item),
|
|
21273
|
-
renderItemErrorIcon($xeForm, item)
|
|
21274
|
-
])
|
|
21275
|
-
]);
|
|
21276
|
-
};
|
|
21277
|
-
const renderVN = () => {
|
|
21278
|
-
const customLayout = $xeForm ? $xeForm.props.customLayout : false;
|
|
21279
|
-
const item = formItem;
|
|
21280
|
-
return customLayout
|
|
21281
|
-
? renderItem($xeForm, item)
|
|
21282
|
-
: h('div', {
|
|
21283
|
-
ref: refElem
|
|
21284
|
-
});
|
|
21285
|
-
};
|
|
21286
|
-
const $xeFormItem = {
|
|
21287
|
-
xID,
|
|
21288
|
-
formItem,
|
|
21289
|
-
renderVN
|
|
21290
|
-
};
|
|
21291
|
-
watchItem(props, formItem);
|
|
21292
|
-
onMounted(() => {
|
|
21293
|
-
const elem = refElem.value;
|
|
21294
|
-
assembleItem($xeForm, elem, formItem, $xeFormGroup);
|
|
21295
|
-
});
|
|
21296
|
-
onUnmounted(() => {
|
|
21297
|
-
destroyItem($xeForm, formItem);
|
|
21298
|
-
});
|
|
21299
|
-
provide('$xeFormItem', $xeFormItem);
|
|
21300
|
-
provide('$xeFormGroup', null);
|
|
21301
|
-
return $xeFormItem;
|
|
21302
|
-
},
|
|
21303
|
-
render() {
|
|
21304
|
-
return this.renderVN();
|
|
21305
|
-
}
|
|
21306
|
-
});
|
|
21307
|
-
|
|
21308
21351
|
var VxeFormGroupComponent = defineVxeComponent({
|
|
21309
21352
|
name: 'VxeFormGroup',
|
|
21310
21353
|
props: formItemProps,
|