vxe-pc-ui 4.6.2 → 4.6.4
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/es/date-panel/src/date-panel.js +16 -3
- package/es/date-picker/src/date-picker.js +7 -4
- package/es/date-range-picker/src/date-range-picker.js +7 -6
- package/es/form/src/form.js +10 -5
- package/es/icon/style.css +1 -1
- package/es/print/src/print.js +2 -2
- package/es/print/src/util.js +72 -40
- 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/lib/date-panel/src/date-panel.js +15 -3
- package/lib/date-panel/src/date-panel.min.js +1 -1
- package/lib/date-picker/src/date-picker.js +8 -4
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/date-range-picker/src/date-range-picker.js +7 -6
- package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
- package/lib/form/src/form.js +14 -5
- package/lib/form/src/form.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +100 -59
- package/lib/index.umd.min.js +1 -1
- package/lib/print/src/print.js +1 -1
- package/lib/print/src/print.min.js +1 -1
- package/lib/print/src/util.js +54 -38
- package/lib/print/src/util.min.js +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/package.json +1 -1
- package/packages/date-panel/src/date-panel.ts +14 -3
- package/packages/date-picker/src/date-picker.ts +8 -5
- package/packages/date-range-picker/src/date-range-picker.ts +7 -6
- package/packages/form/src/form.ts +10 -5
- package/packages/print/src/print.ts +2 -2
- package/packages/print/src/util.ts +73 -39
- package/packages/ui/src/dom.ts +1 -1
- package/types/components/date-panel.d.ts +3 -1
- package/types/components/date-picker.d.ts +2 -0
- package/types/components/date-range-picker.d.ts +2 -0
- package/types/components/print.d.ts +21 -0
- /package/es/icon/{iconfont.1746880516307.ttf → iconfont.1747024965925.ttf} +0 -0
- /package/es/icon/{iconfont.1746880516307.woff → iconfont.1747024965925.woff} +0 -0
- /package/es/icon/{iconfont.1746880516307.woff2 → iconfont.1747024965925.woff2} +0 -0
- /package/es/{iconfont.1746880516307.ttf → iconfont.1747024965925.ttf} +0 -0
- /package/es/{iconfont.1746880516307.woff → iconfont.1747024965925.woff} +0 -0
- /package/es/{iconfont.1746880516307.woff2 → iconfont.1747024965925.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1746880516307.ttf → iconfont.1747024965925.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1746880516307.woff → iconfont.1747024965925.woff} +0 -0
- /package/lib/icon/style/{iconfont.1746880516307.woff2 → iconfont.1747024965925.woff2} +0 -0
- /package/lib/{iconfont.1746880516307.ttf → iconfont.1747024965925.ttf} +0 -0
- /package/lib/{iconfont.1746880516307.woff → iconfont.1747024965925.woff} +0 -0
- /package/lib/{iconfont.1746880516307.woff2 → iconfont.1747024965925.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -4213,14 +4213,14 @@ function checkDynamic() {
|
|
|
4213
4213
|
}
|
|
4214
4214
|
;// CONCATENATED MODULE: ./packages/ui/src/log.ts
|
|
4215
4215
|
|
|
4216
|
-
const log_version = `ui v${"4.6.
|
|
4216
|
+
const log_version = `ui v${"4.6.4"}`;
|
|
4217
4217
|
const warnLog = log.create('warn', log_version);
|
|
4218
4218
|
const errLog = log.create('error', log_version);
|
|
4219
4219
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
4220
4220
|
|
|
4221
4221
|
|
|
4222
4222
|
|
|
4223
|
-
const ui_version = "4.6.
|
|
4223
|
+
const ui_version = "4.6.4";
|
|
4224
4224
|
index_esm_VxeUI.uiVersion = ui_version;
|
|
4225
4225
|
index_esm_VxeUI.dynamicApp = dynamicApp;
|
|
4226
4226
|
function config(options) {
|
|
@@ -14635,6 +14635,7 @@ const Countdown = VxeCountdown;
|
|
|
14635
14635
|
type: [String, Number, Date],
|
|
14636
14636
|
default: () => getConfig().datePanel.endDate
|
|
14637
14637
|
},
|
|
14638
|
+
defaultDate: [String, Number, Date],
|
|
14638
14639
|
minDate: [String, Number, Date],
|
|
14639
14640
|
maxDate: [String, Number, Date],
|
|
14640
14641
|
startDay: {
|
|
@@ -15708,9 +15709,11 @@ const Countdown = VxeCountdown;
|
|
|
15708
15709
|
};
|
|
15709
15710
|
const dateOpenPanel = () => {
|
|
15710
15711
|
const {
|
|
15711
|
-
type
|
|
15712
|
+
type,
|
|
15713
|
+
defaultDate
|
|
15712
15714
|
} = props;
|
|
15713
15715
|
const isDateTimeType = computeIsDateTimeType.value;
|
|
15716
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
15714
15717
|
const dateValue = computeDateValue.value;
|
|
15715
15718
|
if (['year', 'quarter', 'month', 'week'].indexOf(type) > -1) {
|
|
15716
15719
|
reactData.datePanelType = type;
|
|
@@ -15722,7 +15725,16 @@ const Countdown = VxeCountdown;
|
|
|
15722
15725
|
dateMonthHandle(dateValue, 0);
|
|
15723
15726
|
dateParseValue(dateValue);
|
|
15724
15727
|
} else {
|
|
15725
|
-
|
|
15728
|
+
if (defaultDate) {
|
|
15729
|
+
const defDate = parseDate(defaultDate, dateValueFormat);
|
|
15730
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isValidDate(defDate)) {
|
|
15731
|
+
dateMonthHandle(defDate, 0);
|
|
15732
|
+
} else {
|
|
15733
|
+
dateNowHandle();
|
|
15734
|
+
}
|
|
15735
|
+
} else {
|
|
15736
|
+
dateNowHandle();
|
|
15737
|
+
}
|
|
15726
15738
|
}
|
|
15727
15739
|
if (isDateTimeType) {
|
|
15728
15740
|
reactData.datetimePanelValue = reactData.datePanelValue || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(Date.now(), 0, 'first');
|
|
@@ -15741,7 +15753,7 @@ const Countdown = VxeCountdown;
|
|
|
15741
15753
|
};
|
|
15742
15754
|
const datePanelMethods = {
|
|
15743
15755
|
dispatchEvent,
|
|
15744
|
-
|
|
15756
|
+
getModelValue() {
|
|
15745
15757
|
return reactData.inputValue;
|
|
15746
15758
|
},
|
|
15747
15759
|
setPanelDate(date) {
|
|
@@ -16339,6 +16351,7 @@ const DatePanel = VxeDatePanel;
|
|
|
16339
16351
|
type: [String, Number, Date],
|
|
16340
16352
|
default: () => getConfig().datePicker.endDate
|
|
16341
16353
|
},
|
|
16354
|
+
defaultDate: [String, Number, Date],
|
|
16342
16355
|
minDate: [String, Number, Date],
|
|
16343
16356
|
maxDate: [String, Number, Date],
|
|
16344
16357
|
startDay: {
|
|
@@ -16719,7 +16732,8 @@ const DatePanel = VxeDatePanel;
|
|
|
16719
16732
|
};
|
|
16720
16733
|
const panelChangeEvent = params => {
|
|
16721
16734
|
const {
|
|
16722
|
-
multiple
|
|
16735
|
+
multiple,
|
|
16736
|
+
autoClose
|
|
16723
16737
|
} = props;
|
|
16724
16738
|
const {
|
|
16725
16739
|
value,
|
|
@@ -16728,7 +16742,9 @@ const DatePanel = VxeDatePanel;
|
|
|
16728
16742
|
const isDateTimeType = computeIsDateTimeType.value;
|
|
16729
16743
|
handleChange(value, $event);
|
|
16730
16744
|
if (!multiple && !isDateTimeType) {
|
|
16731
|
-
|
|
16745
|
+
if (autoClose) {
|
|
16746
|
+
hidePanel();
|
|
16747
|
+
}
|
|
16732
16748
|
}
|
|
16733
16749
|
};
|
|
16734
16750
|
// 全局事件
|
|
@@ -17106,6 +17122,7 @@ const DatePanel = VxeDatePanel;
|
|
|
17106
17122
|
startDate: props.startDate,
|
|
17107
17123
|
endDate: props.endDate,
|
|
17108
17124
|
minDate: props.minDate,
|
|
17125
|
+
defaultDate: props.defaultDate,
|
|
17109
17126
|
maxDate: props.maxDate,
|
|
17110
17127
|
startDay: props.startDay,
|
|
17111
17128
|
labelFormat: props.labelFormat,
|
|
@@ -17113,8 +17130,7 @@ const DatePanel = VxeDatePanel;
|
|
|
17113
17130
|
festivalMethod: props.festivalMethod,
|
|
17114
17131
|
disabledMethod: props.disabledMethod,
|
|
17115
17132
|
selectDay: props.selectDay,
|
|
17116
|
-
onChange: panelChangeEvent
|
|
17117
|
-
onDateToday: hidePanel
|
|
17133
|
+
onChange: panelChangeEvent
|
|
17118
17134
|
})]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17119
17135
|
class: 'vxe-date-picker--layout-footer-wrapper'
|
|
17120
17136
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
@@ -17338,6 +17354,7 @@ const DatePicker = VxeDatePicker;
|
|
|
17338
17354
|
},
|
|
17339
17355
|
minDate: [String, Number, Date],
|
|
17340
17356
|
maxDate: [String, Number, Date],
|
|
17357
|
+
defaultDate: [String, Number, Date],
|
|
17341
17358
|
startDay: {
|
|
17342
17359
|
type: [String, Number],
|
|
17343
17360
|
default: () => getConfig().dateRangePicker.startDay
|
|
@@ -17767,8 +17784,8 @@ const DatePicker = VxeDatePicker;
|
|
|
17767
17784
|
const $startDatePanel = refStartDatePanel.value;
|
|
17768
17785
|
const $endDatePanel = refEndDatePanel.value;
|
|
17769
17786
|
if ($startDatePanel && $endDatePanel) {
|
|
17770
|
-
const startValue = $startDatePanel.
|
|
17771
|
-
const endValue = $endDatePanel.
|
|
17787
|
+
const startValue = $startDatePanel.getModelValue();
|
|
17788
|
+
const endValue = $endDatePanel.getModelValue();
|
|
17772
17789
|
if (!startValue || !endValue) {
|
|
17773
17790
|
handleChange('', '', {
|
|
17774
17791
|
type: 'check'
|
|
@@ -17848,8 +17865,8 @@ const DatePicker = VxeDatePicker;
|
|
|
17848
17865
|
const $startDatePanel = refStartDatePanel.value;
|
|
17849
17866
|
const $endDatePanel = refEndDatePanel.value;
|
|
17850
17867
|
if ($startDatePanel && $endDatePanel) {
|
|
17851
|
-
const startValue = $startDatePanel.
|
|
17852
|
-
const endValue = $endDatePanel.
|
|
17868
|
+
const startValue = $startDatePanel.getModelValue();
|
|
17869
|
+
const endValue = $endDatePanel.getModelValue();
|
|
17853
17870
|
if (startValue && endValue) {
|
|
17854
17871
|
$startDatePanel.confirmByEvent(evnt);
|
|
17855
17872
|
$endDatePanel.confirmByEvent(evnt);
|
|
@@ -17877,7 +17894,7 @@ const DatePicker = VxeDatePicker;
|
|
|
17877
17894
|
const $startDatePanel = refStartDatePanel.value;
|
|
17878
17895
|
const $endDatePanel = refEndDatePanel.value;
|
|
17879
17896
|
if ($startDatePanel && $endDatePanel) {
|
|
17880
|
-
const startValue = $startDatePanel.
|
|
17897
|
+
const startValue = $startDatePanel.getModelValue();
|
|
17881
17898
|
if (!endValue && startValue) {
|
|
17882
17899
|
$endDatePanel.setPanelDate(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringDate(startValue));
|
|
17883
17900
|
}
|
|
@@ -17902,7 +17919,7 @@ const DatePicker = VxeDatePicker;
|
|
|
17902
17919
|
const $startDatePanel = refStartDatePanel.value;
|
|
17903
17920
|
const $endDatePanel = refEndDatePanel.value;
|
|
17904
17921
|
if ($startDatePanel && $endDatePanel) {
|
|
17905
|
-
const endValue = $endDatePanel.
|
|
17922
|
+
const endValue = $endDatePanel.getModelValue();
|
|
17906
17923
|
if (!startValue && endValue) {
|
|
17907
17924
|
$startDatePanel.setPanelDate(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringDate(endValue));
|
|
17908
17925
|
}
|
|
@@ -20285,12 +20302,11 @@ const validErrorRuleValue = (rule, val) => {
|
|
|
20285
20302
|
}
|
|
20286
20303
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
20287
20304
|
};
|
|
20288
|
-
const getResetValue = (item, data) => {
|
|
20305
|
+
const getResetValue = (item, data, itemValue) => {
|
|
20289
20306
|
const {
|
|
20290
20307
|
field,
|
|
20291
20308
|
resetValue
|
|
20292
20309
|
} = item;
|
|
20293
|
-
const itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(data, field);
|
|
20294
20310
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(resetValue)) {
|
|
20295
20311
|
return resetValue({
|
|
20296
20312
|
field,
|
|
@@ -20299,7 +20315,7 @@ const validErrorRuleValue = (rule, val) => {
|
|
|
20299
20315
|
$form: $xeForm,
|
|
20300
20316
|
$grid: $xeGrid
|
|
20301
20317
|
});
|
|
20302
|
-
} else if (resetValue
|
|
20318
|
+
} else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(resetValue)) {
|
|
20303
20319
|
// 默认
|
|
20304
20320
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(itemValue)) {
|
|
20305
20321
|
return [];
|
|
@@ -20319,7 +20335,12 @@ const validErrorRuleValue = (rule, val) => {
|
|
|
20319
20335
|
itemRender
|
|
20320
20336
|
} = item;
|
|
20321
20337
|
if (isEnableConf(itemRender)) {
|
|
20322
|
-
const
|
|
20338
|
+
const {
|
|
20339
|
+
name,
|
|
20340
|
+
startField,
|
|
20341
|
+
endField
|
|
20342
|
+
} = itemRender;
|
|
20343
|
+
const compConf = renderer.get(name);
|
|
20323
20344
|
const fiResetMethod = compConf ? compConf.formItemResetMethod || compConf.itemResetMethod : null;
|
|
20324
20345
|
if (compConf && fiResetMethod) {
|
|
20325
20346
|
fiResetMethod({
|
|
@@ -20331,7 +20352,12 @@ const validErrorRuleValue = (rule, val) => {
|
|
|
20331
20352
|
$grid: $xeGrid
|
|
20332
20353
|
});
|
|
20333
20354
|
} else if (field) {
|
|
20334
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().
|
|
20355
|
+
const itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(data, field);
|
|
20356
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(data, field, getResetValue(item, data, itemValue));
|
|
20357
|
+
}
|
|
20358
|
+
if (startField && endField) {
|
|
20359
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(data, startField, getResetValue(item, data, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(data, startField)));
|
|
20360
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(data, endField, getResetValue(item, data, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(data, endField)));
|
|
20335
20361
|
}
|
|
20336
20362
|
}
|
|
20337
20363
|
});
|
|
@@ -46054,7 +46080,10 @@ const browseObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd
|
|
|
46054
46080
|
// 打印
|
|
46055
46081
|
let printFrame;
|
|
46056
46082
|
// 默认导出或打印的 HTML 样式
|
|
46057
|
-
const defaultHtmlStyle = 'body{
|
|
46083
|
+
const defaultHtmlStyle = 'body{padding:0;font-family:"Microsoft YaHei",微软雅黑,"MicrosoftJhengHei",华文细黑,STHeiti,MingLiu}body *{-webkit-box-sizing:border-box;box-sizing:border-box}.vxe-table{border-collapse:collapse;text-align:left;border-spacing:0}.vxe-table:not(.is--print){table-layout:fixed}.vxe-table,.vxe-table th,.vxe-table td,.vxe-table td{border-color:#D0D0D0;border-style:solid;border-width:0}.vxe-table.is--print{width:100%}.border--default,.border--full,.border--outer{border-top-width:1px}.border--default,.border--full,.border--outer{border-left-width:1px}.border--outer,.border--default th,.border--default td,.border--full th,.border--full td,.border--outer th,.border--inner th,.border--inner td{border-bottom-width:1px}.border--default,.border--outer,.border--full th,.border--full td{border-right-width:1px}.border--default th,.border--full th,.border--outer th{background-color:#f8f8f9}.vxe-table td>div,.vxe-table th>div{padding:.5em .4em}.col--center{text-align:center}.col--right{text-align:right}.vxe-table:not(.is--print) .col--ellipsis>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.vxe-table--tree-node{text-align:left}.vxe-table--tree-node-wrapper{position:relative}.vxe-table--tree-icon-wrapper{position:absolute;top:50%;width:1em;height:1em;text-align:center;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.vxe-table--tree-unfold-icon,.vxe-table--tree-fold-icon{position:absolute;width:0;height:0;border-style:solid;border-width:.5em;border-right-color:transparent;border-bottom-color:transparent}.vxe-table--tree-unfold-icon{left:.3em;top:0;border-left-color:#939599;border-top-color:transparent}.vxe-table--tree-fold-icon{left:0;top:.3em;border-left-color:transparent;border-top-color:#939599}.vxe-table--tree-cell{display:block;padding-left:1.5em}.vxe-table input[type="checkbox"]{margin:0}.vxe-table input[type="checkbox"],.vxe-table input[type="radio"],.vxe-table input[type="checkbox"]+span,.vxe-table input[type="radio"]+span{vertical-align:middle;padding-left:0.4em}';
|
|
46084
|
+
function trimHtml(html) {
|
|
46085
|
+
return `${html}`.replace(/(<!---->)/, '');
|
|
46086
|
+
}
|
|
46058
46087
|
function createPrintFrame() {
|
|
46059
46088
|
const frame = document.createElement('iframe');
|
|
46060
46089
|
frame.className = 'vxe-table--print-frame';
|
|
@@ -46085,44 +46114,51 @@ function getExportBlobByString(str, type) {
|
|
|
46085
46114
|
});
|
|
46086
46115
|
}
|
|
46087
46116
|
const defaultPrintMargin = 50;
|
|
46088
|
-
|
|
46117
|
+
const defaultFontColor = '#000000';
|
|
46118
|
+
function parsePageStyle(val) {
|
|
46119
|
+
const styOpts = Object.assign({}, val);
|
|
46120
|
+
const headStyOpts = Object.assign({}, styOpts.header);
|
|
46121
|
+
const titStyOpts = Object.assign({}, styOpts.title);
|
|
46122
|
+
const footStyOpts = Object.assign({}, styOpts.footer);
|
|
46123
|
+
const pnStyOpts = Object.assign({}, styOpts.pageNumber);
|
|
46089
46124
|
let mVal = defaultPrintMargin;
|
|
46090
|
-
let
|
|
46091
|
-
let
|
|
46092
|
-
let
|
|
46093
|
-
let
|
|
46094
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().
|
|
46095
|
-
mVal =
|
|
46096
|
-
|
|
46097
|
-
|
|
46098
|
-
|
|
46099
|
-
|
|
46100
|
-
} else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isPlainObject(val)) {
|
|
46101
|
-
if (val.margin) {
|
|
46102
|
-
mVal = val.margin;
|
|
46103
|
-
top = mVal;
|
|
46104
|
-
bottom = mVal;
|
|
46105
|
-
left = mVal;
|
|
46106
|
-
right = mVal;
|
|
46107
|
-
}
|
|
46108
|
-
if (val.marginTop) {
|
|
46109
|
-
top = val.marginTop;
|
|
46110
|
-
}
|
|
46111
|
-
if (val.marginBottom) {
|
|
46112
|
-
bottom = val.marginBottom;
|
|
46113
|
-
}
|
|
46114
|
-
if (val.marginLeft) {
|
|
46115
|
-
left = val.marginLeft;
|
|
46116
|
-
}
|
|
46117
|
-
if (val.marginRight) {
|
|
46118
|
-
right = val.marginRight;
|
|
46119
|
-
}
|
|
46125
|
+
let marginTop = mVal;
|
|
46126
|
+
let marginBottom = mVal;
|
|
46127
|
+
let marginLeft = mVal;
|
|
46128
|
+
let marginRight = mVal;
|
|
46129
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(styOpts.margin) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(styOpts.margin)) {
|
|
46130
|
+
mVal = styOpts.margin;
|
|
46131
|
+
marginTop = mVal;
|
|
46132
|
+
marginBottom = mVal;
|
|
46133
|
+
marginLeft = mVal;
|
|
46134
|
+
marginRight = mVal;
|
|
46120
46135
|
}
|
|
46121
46136
|
return {
|
|
46122
|
-
|
|
46123
|
-
|
|
46124
|
-
|
|
46125
|
-
|
|
46137
|
+
marginTop: toCssUnit(styOpts.marginTop || marginTop),
|
|
46138
|
+
marginBottom: toCssUnit(styOpts.marginBottom || marginBottom),
|
|
46139
|
+
marginLeft: toCssUnit(styOpts.marginLeft || marginLeft),
|
|
46140
|
+
marginRight: toCssUnit(styOpts.marginRight || marginRight),
|
|
46141
|
+
fontSize: toCssUnit(styOpts.fontSize),
|
|
46142
|
+
color: styOpts.color,
|
|
46143
|
+
textAlign: styOpts.textAlign,
|
|
46144
|
+
header: {
|
|
46145
|
+
height: toCssUnit(headStyOpts.height),
|
|
46146
|
+
textAlign: headStyOpts.textAlign
|
|
46147
|
+
},
|
|
46148
|
+
title: {
|
|
46149
|
+
color: titStyOpts.color,
|
|
46150
|
+
fontSize: toCssUnit(titStyOpts.fontSize),
|
|
46151
|
+
textAlign: titStyOpts.textAlign
|
|
46152
|
+
},
|
|
46153
|
+
footer: {
|
|
46154
|
+
height: toCssUnit(footStyOpts.height),
|
|
46155
|
+
textAlign: footStyOpts.textAlign
|
|
46156
|
+
},
|
|
46157
|
+
pageNumber: {
|
|
46158
|
+
color: pnStyOpts.color,
|
|
46159
|
+
fontSize: toCssUnit(pnStyOpts.fontSize),
|
|
46160
|
+
textAlign: pnStyOpts.textAlign
|
|
46161
|
+
}
|
|
46126
46162
|
};
|
|
46127
46163
|
}
|
|
46128
46164
|
function createHtmlPage(opts, printHtml) {
|
|
@@ -46130,8 +46166,13 @@ function createHtmlPage(opts, printHtml) {
|
|
|
46130
46166
|
pageStyle,
|
|
46131
46167
|
customStyle
|
|
46132
46168
|
} = opts;
|
|
46133
|
-
const
|
|
46134
|
-
|
|
46169
|
+
const pageStyObj = parsePageStyle(pageStyle);
|
|
46170
|
+
const headStyOpts = pageStyObj.header;
|
|
46171
|
+
const titStyOpts = pageStyObj.title;
|
|
46172
|
+
const footStyOpts = pageStyObj.header;
|
|
46173
|
+
const pnStyOpts = pageStyObj.pageNumber;
|
|
46174
|
+
const isPbMode = opts._pageBreaks || opts.pageBreaks && opts.pageBreaks.length;
|
|
46175
|
+
return ['<!DOCTYPE html><html>', '<head>', '<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">', `<title>${opts.title || ''}</title>`, '<style media="print">@page{size:auto;margin: 0mm;}</style>', `<style>body{font-size:${pageStyObj.fontSize || '14px'};color:${pageStyObj.color || defaultFontColor};text-align:${pageStyObj.textAlign || 'left'};}</style>`, '<style>', '.vxe-print-slots{display:none;}', '.vxe-print-page-break.align--center{text-align:center;}', '.vxe-print-page-break.align--left{text-align:left;}', '.vxe-print-page-break.align--right{text-align:right;}', '.vxe-print-page-break{break-before:always;page-break-before:always;display:flex;flex-direction:column;height:100vh;overflow:hidden;}', '.vxe-print-page-break--body{display:flex;flex-direction:row;flex-grow:1;overflow:hidden;}', '.vxe-print-page-break--left,.vxe-print-page-break--right{flex-shrink:0;height:100%;}', `.vxe-print-page-break--left{width:${pageStyObj.marginLeft};}`, `.vxe-print-page-break--right{width:${pageStyObj.marginRight};}`, '.vxe-print-page-break--header,.vxe-print-page-break--footer{display:flex;justify-content:center;flex-direction:column;flex-shrink:0;width:100%;}', `.vxe-print-page-break--header{height:${headStyOpts.height || pageStyObj.marginTop};padding:0 ${pageStyObj.marginLeft} 0 ${pageStyObj.marginRight};text-align:${headStyOpts.textAlign || 'left'};}`, `.vxe-print-page-break--header-title{font-size:${titStyOpts.fontSize || '1.6em'};color:${titStyOpts.color || defaultFontColor};text-align:${opts.headerAlign || pnStyOpts.textAlign || 'center'};}`, `.vxe-print-page-break--footer{height:${footStyOpts.height || pageStyObj.marginBottom};padding:0 ${pageStyObj.marginLeft} 0 ${pageStyObj.marginRight};text-align:${footStyOpts.textAlign || 'left'};}`, '.vxe-print-page-break--content{flex-grow:1;overflow:hidden;}', `.vxe-print-page-break--footer-page-number{font-size:${pnStyOpts.fontSize || '1.2em'};color:${pnStyOpts.color || defaultFontColor};text-align:${opts.footerAlign || pnStyOpts.textAlign || 'center'};}`, '</style>', '<style>.vxe-table{white-space:pre;}</style>', `<style>${defaultHtmlStyle}</style>`, isPbMode ? '<style>body{margin:0;}</style>' : `<style>body{margin:${pageStyObj.marginTop} ${pageStyObj.marginRight} ${pageStyObj.marginBottom} ${pageStyObj.marginLeft};}</style>`, customStyle ? `<style>${customStyle}</style>` : '', '</head>', '<body>', `${printHtml}`, '</body>', '</html>'].join('');
|
|
46135
46176
|
}
|
|
46136
46177
|
function handlePrint(opts, printHtml = '') {
|
|
46137
46178
|
const {
|
|
@@ -46405,7 +46446,7 @@ const PrintPageBreak = VxePrintPageBreak;
|
|
|
46405
46446
|
const elem = refElem.value;
|
|
46406
46447
|
return printHtml(Object.assign({}, props, {
|
|
46407
46448
|
_pageBreaks: !!reactData.staticPageBreaks.length,
|
|
46408
|
-
html: (elem ? elem.outerHTML : '') || props.html || props.content || ''
|
|
46449
|
+
html: trimHtml(elem ? elem.outerHTML : '') || props.html || props.content || ''
|
|
46409
46450
|
}));
|
|
46410
46451
|
}
|
|
46411
46452
|
};
|