vxe-table 4.21.8 → 4.21.9

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 CHANGED
@@ -4,7 +4,7 @@ import XEUtils from 'xe-utils';
4
4
  import DomZIndex from 'dom-zindex';
5
5
  import { defineComponent, watch, reactive, h, ref, inject, createCommentVNode, onMounted, onUnmounted, provide, nextTick, TransitionGroup, computed, Teleport, resolveComponent, onActivated, onDeactivated, onBeforeUnmount } from 'vue';
6
6
 
7
- const { getConfig: getConfig$9 } = VxeUI;
7
+ const { getConfig: getConfig$a } = VxeUI;
8
8
  function isEnableConf(conf) {
9
9
  return conf && conf.enabled !== false;
10
10
  }
@@ -31,11 +31,11 @@ function getFuncText(content, args) {
31
31
  if (XEUtils.eqNull(content)) {
32
32
  return '';
33
33
  }
34
- const translate = getConfig$9().translate;
34
+ const translate = getConfig$a().translate;
35
35
  return `${translate ? translate('' + content, args) : content}`;
36
36
  }
37
37
  function formatText(value, placeholder) {
38
- return '' + (isEmptyValue(value) ? (placeholder ? getConfig$9().emptyCell : '') : value);
38
+ return '' + (isEmptyValue(value) ? (placeholder ? getConfig$a().emptyCell : '') : value);
39
39
  }
40
40
  /**
41
41
  * 判断值为:'' | null | undefined 时都属于空值
@@ -47,7 +47,7 @@ function getDefaultConfig(val1, def1) {
47
47
  return XEUtils.eqNull(val1) ? def1 : val1;
48
48
  }
49
49
 
50
- const version = "4.21.8";
50
+ const version = "4.21.9";
51
51
  VxeUI.version = version;
52
52
  VxeUI.tableVersion = version;
53
53
  VxeUI.setConfig({
@@ -441,7 +441,7 @@ VxeUI.setIcon({
441
441
  const setTheme = VxeUI.setTheme;
442
442
  const getTheme = VxeUI.getTheme;
443
443
  const setConfig = VxeUI.setConfig;
444
- const getConfig$8 = VxeUI.getConfig;
444
+ const getConfig$9 = VxeUI.getConfig;
445
445
  const setIcon = VxeUI.setIcon;
446
446
  const getIcon$8 = VxeUI.getIcon;
447
447
  const setLanguage = VxeUI.setLanguage;
@@ -931,7 +931,7 @@ function getPopupWrapperElement(panelElem) {
931
931
  }
932
932
 
933
933
  const { log } = VxeUI;
934
- const tableVersion = `table v${"4.21.8"}`;
934
+ const tableVersion = `table v${"4.21.9"}`;
935
935
  function createComponentLog(name) {
936
936
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
937
937
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
@@ -2253,7 +2253,7 @@ function getSlotVNs(vns) {
2253
2253
  return [vns];
2254
2254
  }
2255
2255
 
2256
- const { getI18n: getI18n$c, getIcon: getIcon$7, renderer: renderer$a, renderEmptyElement: renderEmptyElement$a } = VxeUI;
2256
+ const { getConfig: getConfig$8, getI18n: getI18n$c, getIcon: getIcon$7, renderer: renderer$a, renderEmptyElement: renderEmptyElement$a } = VxeUI;
2257
2257
  function renderTitlePrefixIcon(params) {
2258
2258
  const { $table, column } = params;
2259
2259
  const titlePrefix = column.titlePrefix || column.titleHelp;
@@ -2528,9 +2528,12 @@ function renderHeaderHandle(params) {
2528
2528
  const tableProps = $table.props;
2529
2529
  const { editConfig } = tableProps;
2530
2530
  const { type, filters, sortable, editRender, slots } = column;
2531
- const headerSlot = slots ? slots.header : null;
2532
- if (headerSlot) {
2533
- return renderTitleContent(params, $table.callSlot(headerSlot, params));
2531
+ // 兼容已废弃方式
2532
+ if (getConfig$8().tableHeadeSlotToTitleSlot !== 'obsolete') {
2533
+ const headerSlot = slots ? slots.header : null;
2534
+ if (headerSlot) {
2535
+ return renderTitleContent(params, $table.callSlot(headerSlot, params));
2536
+ }
2534
2537
  }
2535
2538
  switch (type) {
2536
2539
  case 'seq':
@@ -2590,11 +2593,18 @@ const Cell = {
2590
2593
  const { $table, column } = params;
2591
2594
  const tableProps = $table.props;
2592
2595
  const { editConfig } = tableProps;
2593
- const { editRender, cellRender } = column;
2596
+ const { slots, editRender, cellRender } = column;
2594
2597
  const isEnableEdit = editConfig && isEnableConf(editConfig);
2595
2598
  const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
2596
2599
  const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null;
2597
2600
  const renderOpts = editRenderOpts || cellRenderOpts;
2601
+ // 兼容已废弃方式
2602
+ if (getConfig$8().tableHeadeSlotToTitleSlot === 'obsolete') {
2603
+ const headerSlot = slots ? slots.header : null;
2604
+ if (headerSlot) {
2605
+ return renderTitleContent(params, $table.callSlot(headerSlot, params));
2606
+ }
2607
+ }
2598
2608
  if (renderOpts) {
2599
2609
  const compConf = renderer$a.get(renderOpts.name);
2600
2610
  if (compConf) {
@@ -2863,6 +2873,12 @@ const Cell = {
2863
2873
  */
2864
2874
  renderSeqHeader(params) {
2865
2875
  const { $table, column } = params;
2876
+ // 兼容已废弃方式
2877
+ if (getConfig$8().tableHeadeSlotToTitleSlot === 'obsolete') {
2878
+ const { slots } = column;
2879
+ const headerSlot = slots ? slots.header : null;
2880
+ return renderHeaderCellBaseVNs(params, renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : $table.getHeaderCellLabel(column)));
2881
+ }
2866
2882
  return renderHeaderCellBaseVNs(params, renderTitleContent(params, $table.getHeaderCellLabel(column)));
2867
2883
  },
2868
2884
  renderSeqCell(params) {
@@ -2892,6 +2908,17 @@ const Cell = {
2892
2908
  const { $table, column } = params;
2893
2909
  const { slots } = column;
2894
2910
  const titleSlot = slots ? slots.title : null;
2911
+ // 兼容已废弃方式
2912
+ if (getConfig$8().tableHeadeSlotToTitleSlot === 'obsolete') {
2913
+ const headerSlot = slots ? slots.header : null;
2914
+ return renderHeaderCellBaseVNs(params, renderTitleContent(params, headerSlot
2915
+ ? $table.callSlot(headerSlot, params)
2916
+ : [
2917
+ h('span', {
2918
+ class: 'vxe-radio--label'
2919
+ }, titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column))
2920
+ ]));
2921
+ }
2895
2922
  return renderHeaderCellBaseVNs(params, renderTitleContent(params, [
2896
2923
  h('span', {
2897
2924
  class: 'vxe-radio--label'
@@ -2973,6 +3000,13 @@ const Cell = {
2973
3000
  };
2974
3001
  }
2975
3002
  const checkboxParams = Object.assign(Object.assign({}, params), { checked: isAllCheckboxSelected, disabled: isAllCheckboxDisabled, indeterminate: isAllCheckboxIndeterminate });
3003
+ // 兼容已废弃方式
3004
+ if (getConfig$8().tableHeadeSlotToTitleSlot === 'obsolete') {
3005
+ const headerSlot = slots ? slots.header : null;
3006
+ if (headerSlot) {
3007
+ return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, $table.callSlot(headerSlot, checkboxParams)));
3008
+ }
3009
+ }
2976
3010
  if (checkStrictly ? !showHeader : showHeader === false) {
2977
3011
  return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, [
2978
3012
  h('span', {
@@ -34010,7 +34044,7 @@ var VxeUITableExport = /*#__PURE__*/Object.freeze({
34010
34044
  commands: commands$2,
34011
34045
  config: config,
34012
34046
  formats: formats$2,
34013
- getConfig: getConfig$8,
34047
+ getConfig: getConfig$9,
34014
34048
  getI18n: getI18n$e,
34015
34049
  getIcon: getIcon$8,
34016
34050
  getTheme: getTheme,
@@ -34038,4 +34072,4 @@ var VxeUITableExport = /*#__PURE__*/Object.freeze({
34038
34072
  version: version
34039
34073
  });
34040
34074
 
34041
- export { Colgroup, Column, Grid, Table, Toolbar, VXETable, VxeColgroup, VxeColumn, VxeGrid, VxeTable, VxeToolbar, _t, clipboard, commands$2 as commands, config, VxeUITableExport as default, formats$2 as formats, getConfig$8 as getConfig, getI18n$e as getI18n, getIcon$8 as getIcon, getTheme, globalEvents$3 as globalEvents, globalResize$1 as globalResize, hooks$8 as hooks, install, interceptor$1 as interceptor, log$1 as log, menus$1 as menus, modal, print, readFile, renderer$c as renderer, saveFile, setConfig, setI18n, setIcon, setLanguage, setTheme, setup, t, use, validators$1 as validators, version };
34075
+ export { Colgroup, Column, Grid, Table, Toolbar, VXETable, VxeColgroup, VxeColumn, VxeGrid, VxeTable, VxeToolbar, _t, clipboard, commands$2 as commands, config, VxeUITableExport as default, formats$2 as formats, getConfig$9 as getConfig, getI18n$e as getI18n, getIcon$8 as getIcon, getTheme, globalEvents$3 as globalEvents, globalResize$1 as globalResize, hooks$8 as hooks, install, interceptor$1 as interceptor, log$1 as log, menus$1 as menus, modal, print, readFile, renderer$c as renderer, saveFile, setConfig, setI18n, setIcon, setLanguage, setTheme, setup, t, use, validators$1 as validators, version };