vxe-pc-ui 4.11.41 → 4.11.42

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.
Files changed (81) hide show
  1. package/es/backtop/src/backtop.js +37 -21
  2. package/es/backtop/style.css +31 -49
  3. package/es/backtop/style.min.css +1 -1
  4. package/es/button/src/button.js +7 -2
  5. package/es/button/style.css +3 -0
  6. package/es/button/style.min.css +1 -1
  7. package/es/icon/{iconfont.1768022847278.ttf → iconfont.1768142303827.ttf} +0 -0
  8. package/es/icon/iconfont.1768142303827.woff +0 -0
  9. package/es/icon/iconfont.1768142303827.woff2 +0 -0
  10. package/es/icon/style.css +5 -1
  11. package/es/icon/style.min.css +1 -1
  12. package/{lib/icon/style/iconfont.1768022847278.ttf → es/iconfont.1768142303827.ttf} +0 -0
  13. package/es/iconfont.1768142303827.woff +0 -0
  14. package/es/iconfont.1768142303827.woff2 +0 -0
  15. package/es/layout-body/src/layout-body.js +13 -5
  16. package/es/style.css +1 -1
  17. package/es/style.min.css +1 -1
  18. package/es/ui/index.js +9 -2
  19. package/es/ui/src/log.js +1 -1
  20. package/es/vxe-backtop/style.css +31 -49
  21. package/es/vxe-backtop/style.min.css +1 -1
  22. package/es/vxe-button/style.css +3 -0
  23. package/es/vxe-button/style.min.css +1 -1
  24. package/es/vxe-icon/style.css +5 -1
  25. package/es/vxe-icon/style.min.css +1 -1
  26. package/lib/backtop/src/backtop.js +33 -13
  27. package/lib/backtop/src/backtop.min.js +1 -1
  28. package/lib/backtop/style/style.css +31 -49
  29. package/lib/backtop/style/style.min.css +1 -1
  30. package/lib/button/src/button.js +7 -1
  31. package/lib/button/src/button.min.js +1 -1
  32. package/lib/button/style/style.css +3 -0
  33. package/lib/button/style/style.min.css +1 -1
  34. package/lib/{iconfont.1768022847278.ttf → icon/style/iconfont.1768142303827.ttf} +0 -0
  35. package/lib/icon/style/iconfont.1768142303827.woff +0 -0
  36. package/lib/icon/style/iconfont.1768142303827.woff2 +0 -0
  37. package/lib/icon/style/style.css +5 -1
  38. package/lib/icon/style/style.min.css +5 -1
  39. package/{es/iconfont.1768022847278.ttf → lib/iconfont.1768142303827.ttf} +0 -0
  40. package/lib/iconfont.1768142303827.woff +0 -0
  41. package/lib/iconfont.1768142303827.woff2 +0 -0
  42. package/lib/index.umd.js +1535 -1492
  43. package/lib/index.umd.min.js +1 -1
  44. package/lib/layout-body/src/layout-body.js +13 -3
  45. package/lib/layout-body/src/layout-body.min.js +1 -1
  46. package/lib/style.css +1 -1
  47. package/lib/style.min.css +1 -1
  48. package/lib/ui/index.js +9 -2
  49. package/lib/ui/index.min.js +1 -1
  50. package/lib/ui/src/log.js +1 -1
  51. package/lib/ui/src/log.min.js +1 -1
  52. package/lib/vxe-backtop/style/style.css +31 -49
  53. package/lib/vxe-backtop/style/style.min.css +1 -1
  54. package/lib/vxe-button/style/style.css +3 -0
  55. package/lib/vxe-button/style/style.min.css +1 -1
  56. package/lib/vxe-icon/style/style.css +5 -1
  57. package/lib/vxe-icon/style/style.min.css +1 -1
  58. package/package.json +1 -1
  59. package/packages/backtop/src/backtop.ts +37 -21
  60. package/packages/button/src/button.ts +7 -2
  61. package/packages/layout-body/src/layout-body.ts +17 -5
  62. package/packages/ui/index.ts +8 -1
  63. package/styles/components/backtop.scss +41 -69
  64. package/styles/components/button.scss +3 -0
  65. package/styles/components/icon.scss +5 -1
  66. package/styles/icon/iconfont.ttf +0 -0
  67. package/styles/icon/iconfont.woff +0 -0
  68. package/styles/icon/iconfont.woff2 +0 -0
  69. package/styles/theme/base.scss +4 -0
  70. package/types/components/backtop.d.ts +10 -0
  71. package/types/components/button.d.ts +5 -3
  72. package/types/components/icon.d.ts +1 -1
  73. package/types/components/layout-body.d.ts +9 -2
  74. package/es/icon/iconfont.1768022847278.woff +0 -0
  75. package/es/icon/iconfont.1768022847278.woff2 +0 -0
  76. package/es/iconfont.1768022847278.woff +0 -0
  77. package/es/iconfont.1768022847278.woff2 +0 -0
  78. package/lib/icon/style/iconfont.1768022847278.woff +0 -0
  79. package/lib/icon/style/iconfont.1768022847278.woff2 +0 -0
  80. package/lib/iconfont.1768022847278.woff +0 -0
  81. package/lib/iconfont.1768022847278.woff2 +0 -0
package/lib/index.umd.js CHANGED
@@ -3661,14 +3661,14 @@ function checkDynamic() {
3661
3661
  }
3662
3662
  ;// CONCATENATED MODULE: ./packages/ui/src/log.ts
3663
3663
 
3664
- const log_version = `ui v${"4.11.41"}`;
3664
+ const log_version = `ui v${"4.11.42"}`;
3665
3665
  const warnLog = log.create('warn', log_version);
3666
3666
  const errLog = log.create('error', log_version);
3667
3667
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
3668
3668
 
3669
3669
 
3670
3670
 
3671
- const ui_version = "4.11.41";
3671
+ const ui_version = "4.11.42";
3672
3672
  index_esm_VxeUI.uiVersion = ui_version;
3673
3673
  index_esm_VxeUI.dynamicApp = dynamicApp;
3674
3674
  function config(options) {
@@ -3689,6 +3689,9 @@ setConfig({
3689
3689
  backtop: {
3690
3690
  showIcon: true,
3691
3691
  showContent: true,
3692
+ showTop: true,
3693
+ showBottom: true,
3694
+ shadow: true,
3692
3695
  threshold: 20
3693
3696
  },
3694
3697
  badge: {},
@@ -3859,7 +3862,11 @@ setConfig({
3859
3862
  controls: true
3860
3863
  },
3861
3864
  layoutAside: {},
3862
- layoutBody: {},
3865
+ layoutBody: {
3866
+ backtopConfig: {
3867
+ position: 'fixed'
3868
+ }
3869
+ },
3863
3870
  layoutContainer: {},
3864
3871
  layoutFooter: {},
3865
3872
  layoutHeader: {},
@@ -6057,729 +6064,795 @@ dynamicApp.use(VxeAvatar);
6057
6064
  index_esm_VxeUI.component(avatar);
6058
6065
  const Avatar = VxeAvatar;
6059
6066
  /* harmony default export */ var packages_avatar = (VxeAvatar);
6060
- ;// CONCATENATED MODULE: ./packages/backtop/src/backtop.ts
6067
+ ;// CONCATENATED MODULE: ./packages/ui/src/utils.ts
6068
+
6069
+
6070
+
6071
+ function isEnableConf(conf) {
6072
+ return conf && conf.enabled !== false;
6073
+ }
6074
+ function nextZIndex() {
6075
+ return index_esm.getNext();
6076
+ }
6077
+ function getLastZIndex() {
6078
+ return index_esm.getCurrent();
6079
+ }
6080
+ function nextSubZIndex() {
6081
+ return index_esm.getSubNext();
6082
+ }
6083
+ function getSubLastZIndex() {
6084
+ return index_esm.getSubCurrent();
6085
+ }
6086
+ function getGlobalDefaultConfig(value, globalValue) {
6087
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(value)) {
6088
+ return globalValue;
6089
+ }
6090
+ return value;
6091
+ }
6092
+ function getFuncText(content, args) {
6093
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(content)) {
6094
+ return '';
6095
+ }
6096
+ const translate = getConfig().translate;
6097
+ return `${translate ? translate('' + content, args) : content}`;
6098
+ }
6099
+ /**
6100
+ * 判断值为:'' | null | undefined 时都属于空值
6101
+ */
6102
+ function eqEmptyValue(cellValue) {
6103
+ return cellValue === null || cellValue === undefined || cellValue === '';
6104
+ }
6105
+ function handleBooleanDefaultValue(value) {
6106
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(value) ? value : null;
6107
+ }
6108
+ ;// CONCATENATED MODULE: ./packages/tooltip/src/tooltip.ts
6061
6109
 
6062
6110
 
6063
6111
 
6064
6112
 
6065
6113
 
6066
6114
 
6067
- function createInternalData() {
6068
- return {
6069
- targetEl: null
6070
- };
6071
- }
6072
- function createReactData() {
6073
- return {
6074
- showBtn: false
6075
- };
6076
- }
6077
- /* harmony default export */ var backtop = (defineVxeComponent({
6078
- name: 'VxeBacktop',
6115
+
6116
+
6117
+ /* harmony default export */ var tooltip = (defineVxeComponent({
6118
+ name: 'VxeTooltip',
6079
6119
  props: {
6080
- target: String,
6120
+ modelValue: Boolean,
6081
6121
  size: {
6082
6122
  type: String,
6083
- default: () => getConfig().backtop.size || getConfig().size
6123
+ default: () => getConfig().tooltip.size || getConfig().size
6084
6124
  },
6085
- circle: {
6086
- type: Boolean,
6087
- default: () => getConfig().backtop.circle
6125
+ selector: String,
6126
+ trigger: {
6127
+ type: String,
6128
+ default: () => getConfig().tooltip.trigger || 'hover'
6088
6129
  },
6089
- right: {
6130
+ theme: {
6131
+ type: String,
6132
+ default: () => getConfig().tooltip.theme || 'dark'
6133
+ },
6134
+ content: {
6090
6135
  type: [String, Number],
6091
- default: () => getConfig().backtop.right
6136
+ default: null
6092
6137
  },
6093
- bottom: {
6138
+ useHTML: Boolean,
6139
+ zIndex: [String, Number],
6140
+ popupClassName: [String, Function],
6141
+ width: {
6094
6142
  type: [String, Number],
6095
- default: () => getConfig().backtop.bottom
6143
+ default: () => getConfig().tooltip.Width
6096
6144
  },
6097
- status: {
6145
+ height: {
6098
6146
  type: [String, Number],
6099
- default: () => getConfig().backtop.status
6147
+ default: () => getConfig().tooltip.height
6100
6148
  },
6101
- icon: {
6102
- type: String,
6103
- default: () => getConfig().backtop.icon
6149
+ minWidth: {
6150
+ type: [String, Number],
6151
+ default: () => getConfig().tooltip.minWidth
6104
6152
  },
6105
- showIcon: {
6106
- type: Boolean,
6107
- default: () => getConfig().backtop.showIcon
6153
+ minHeight: {
6154
+ type: [String, Number],
6155
+ default: () => getConfig().tooltip.minHeight
6108
6156
  },
6109
- content: {
6157
+ maxWidth: {
6110
6158
  type: [String, Number],
6111
- default: () => getConfig().backtop.content
6159
+ default: () => getConfig().tooltip.maxWidth
6112
6160
  },
6113
- showContent: {
6161
+ maxHeight: {
6162
+ type: [String, Number],
6163
+ default: () => getConfig().tooltip.maxHeight
6164
+ },
6165
+ isArrow: {
6114
6166
  type: Boolean,
6115
- default: () => getConfig().backtop.showContent
6167
+ default: () => getConfig().tooltip.isArrow
6116
6168
  },
6117
- zIndex: {
6118
- type: [String, Number],
6119
- default: () => getConfig().backtop.zIndex
6169
+ enterable: {
6170
+ type: Boolean,
6171
+ default: () => getConfig().tooltip.enterable
6120
6172
  },
6121
- threshold: {
6122
- type: [String, Number],
6123
- default: () => getConfig().backtop.threshold
6173
+ enterDelay: {
6174
+ type: Number,
6175
+ default: () => getConfig().tooltip.enterDelay
6124
6176
  },
6125
- position: {
6126
- type: String,
6127
- default: () => getConfig().backtop.position
6177
+ leaveDelay: {
6178
+ type: Number,
6179
+ default: () => getConfig().tooltip.leaveDelay
6128
6180
  }
6129
6181
  },
6130
- emits: ['click'],
6182
+ emits: ['update:modelValue'],
6131
6183
  setup(props, context) {
6132
6184
  const {
6133
6185
  slots,
6134
6186
  emit
6135
6187
  } = context;
6136
6188
  const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
6137
- const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
6138
6189
  const {
6139
6190
  computeSize
6140
6191
  } = useSize(props);
6141
- const internalData = createInternalData();
6142
- const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(createReactData());
6143
- const refMaps = {
6144
- refElem
6145
- };
6192
+ const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
6193
+ target: null,
6194
+ isUpdate: false,
6195
+ visible: false,
6196
+ tipPos: null,
6197
+ tipContent: '',
6198
+ tipActive: false,
6199
+ tipTarget: null,
6200
+ tipZindex: 0,
6201
+ tipStore: {
6202
+ style: {},
6203
+ placement: '',
6204
+ arrowStyle: {}
6205
+ }
6206
+ });
6207
+ const internalData = {};
6208
+ const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
6209
+ const contentWrapperfElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
6146
6210
  const computeWrapperStyle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6147
6211
  const {
6148
- right,
6149
- bottom,
6150
- zIndex
6212
+ width,
6213
+ height,
6214
+ minHeight,
6215
+ minWidth,
6216
+ maxHeight,
6217
+ maxWidth
6151
6218
  } = props;
6152
6219
  const stys = {};
6153
- if (right) {
6154
- stys.right = toCssUnit(right);
6220
+ if (width) {
6221
+ stys.width = toCssUnit(width);
6155
6222
  }
6156
- if (bottom) {
6157
- stys.bottom = toCssUnit(bottom);
6223
+ if (height) {
6224
+ stys.height = toCssUnit(height);
6158
6225
  }
6159
- if (zIndex) {
6160
- stys.zIndex = zIndex;
6226
+ if (minWidth) {
6227
+ stys.minWidth = toCssUnit(minWidth);
6228
+ }
6229
+ if (minHeight) {
6230
+ stys.minHeight = toCssUnit(minHeight);
6231
+ }
6232
+ if (maxWidth) {
6233
+ stys.maxWidth = toCssUnit(maxWidth);
6234
+ }
6235
+ if (maxHeight) {
6236
+ stys.maxHeight = toCssUnit(maxHeight);
6161
6237
  }
6162
6238
  return stys;
6163
6239
  });
6164
- const computeMaps = {};
6165
- const $xeBacktop = {
6240
+ const refMaps = {
6241
+ refElem
6242
+ };
6243
+ const $xeTooltip = {
6166
6244
  xID,
6167
6245
  props,
6168
6246
  context,
6169
- internalData,
6170
6247
  reactData,
6171
- getRefMaps: () => refMaps,
6172
- getComputeMaps: () => computeMaps
6173
- };
6174
- const dispatchEvent = (type, params, evnt) => {
6175
- emit(type, createEvent(evnt, {
6176
- $backtop: $xeBacktop
6177
- }, params));
6248
+ internalData,
6249
+ getRefMaps: () => refMaps
6178
6250
  };
6179
- const handleScrollEvent = evnt => {
6251
+ let tooltipMethods = {};
6252
+ const updateTipStyle = () => {
6180
6253
  const {
6181
- threshold
6254
+ isArrow
6182
6255
  } = props;
6183
- const currentEl = evnt.currentTarget;
6184
- const scrollTop = currentEl.scrollTop;
6185
- reactData.showBtn = scrollTop > Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold));
6186
- };
6187
- const handleToTop = () => {
6188
- const {
6189
- targetEl
6190
- } = internalData;
6191
- if (!targetEl) {
6192
- return;
6193
- }
6194
- const scrollTop = targetEl.scrollTop;
6195
- if (scrollTop > 0) {
6196
- requestAnimationFrame(handleToTop);
6197
- const currScrollTop = scrollTop - Math.max(12, scrollTop / 6);
6198
- targetEl.scrollTop = currScrollTop > 10 ? currScrollTop : 0;
6199
- }
6200
- };
6201
- const removeScrollEvent = () => {
6202
- const {
6203
- targetEl
6204
- } = internalData;
6205
- if (targetEl) {
6206
- targetEl.removeEventListener('scroll', handleScrollEvent);
6207
- }
6208
- };
6209
- const addScrollEvent = () => {
6210
6256
  const {
6211
- targetEl
6212
- } = internalData;
6213
- if (targetEl) {
6214
- targetEl.addEventListener('scroll', handleScrollEvent, {
6215
- passive: true
6216
- });
6217
- }
6218
- };
6219
- const handleTargetElement = () => {
6220
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
6221
- const {
6222
- target
6223
- } = props;
6224
- if (!target) {
6225
- removeScrollEvent();
6226
- errLog('vxe.error.reqProp', ['target']);
6227
- return;
6228
- }
6229
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(target)) {
6230
- const tEl = document.querySelector(target);
6231
- if (!tEl) {
6232
- errLog('vxe.error.errProp', [`target=${target}`, 'body']);
6257
+ tipTarget: targetElem,
6258
+ tipStore,
6259
+ tipPos
6260
+ } = reactData;
6261
+ let top = '';
6262
+ let left = '';
6263
+ let panelPlacement = 'bottom';
6264
+ let arrowLeft = '';
6265
+ const panelElem = refElem.value;
6266
+ if (panelElem && targetElem) {
6267
+ const documentElement = document.documentElement;
6268
+ const bodyElem = document.body;
6269
+ const targetWidth = targetElem.offsetWidth;
6270
+ const targetHeight = targetElem.offsetHeight;
6271
+ const panelHeight = panelElem.offsetHeight;
6272
+ const panelWidth = panelElem.offsetWidth;
6273
+ const targetRect = targetElem.getBoundingClientRect();
6274
+ const visibleHeight = documentElement.clientHeight || bodyElem.clientHeight;
6275
+ const visibleWidth = documentElement.clientWidth || bodyElem.clientWidth;
6276
+ const marginSize = 6;
6277
+ top = targetRect.top + targetHeight;
6278
+ left = targetRect.left;
6279
+ if (tipPos && tipPos.x && tipPos.y) {
6280
+ if (isArrow) {
6281
+ left = left + Math.max(8, Math.min(targetWidth - 8, tipPos.oLeft)) - panelWidth / 2;
6282
+ } else {
6283
+ left = tipPos.x + 1;
6284
+ top = tipPos.y + 1;
6233
6285
  }
6234
- const {
6235
- targetEl
6236
- } = internalData;
6237
- if (targetEl !== tEl) {
6238
- removeScrollEvent();
6239
- internalData.targetEl = tEl;
6240
- addScrollEvent();
6286
+ } else {
6287
+ left = targetRect.left + (targetWidth - panelWidth) / 2;
6288
+ }
6289
+ // 如果下面不够放,则向上
6290
+ if (top + panelHeight + marginSize > visibleHeight) {
6291
+ panelPlacement = 'top';
6292
+ top = targetRect.top - panelHeight;
6293
+ }
6294
+ // 如果上面不够放,则向下(优先)
6295
+ if (top < marginSize) {
6296
+ panelPlacement = 'bottom';
6297
+ top = targetRect.top + targetHeight;
6298
+ }
6299
+ // 如果溢出右边
6300
+ if (left + panelWidth + marginSize > visibleWidth) {
6301
+ left -= left + panelWidth + marginSize - visibleWidth;
6302
+ }
6303
+ // 如果溢出左边
6304
+ if (left < marginSize) {
6305
+ left = marginSize;
6306
+ }
6307
+ // 箭头
6308
+ if (left === targetRect.left) {
6309
+ if (targetWidth <= panelWidth) {
6310
+ arrowLeft = targetWidth / 2;
6311
+ }
6312
+ } else if (left < targetRect.left) {
6313
+ if (left + panelWidth > targetRect.left + targetWidth) {
6314
+ arrowLeft = targetRect.left - left + targetWidth / 2;
6315
+ } else {
6316
+ arrowLeft = targetRect.left - left + (panelWidth - (targetRect.left - left)) / 2;
6241
6317
  }
6242
6318
  }
6243
- });
6319
+ tipStore.placement = panelPlacement;
6320
+ tipStore.style.top = `${top}px`;
6321
+ tipStore.style.left = `${left}px`;
6322
+ tipStore.arrowStyle.left = `${arrowLeft}px`;
6323
+ }
6244
6324
  };
6245
- const clickEvent = evnt => {
6246
- handleToTop();
6247
- dispatchEvent('click', {}, evnt);
6325
+ const updateValue = value => {
6326
+ if (value !== reactData.visible) {
6327
+ reactData.visible = value;
6328
+ reactData.isUpdate = true;
6329
+ emit('update:modelValue', value);
6330
+ }
6248
6331
  };
6249
- const tagMethods = {
6250
- dispatchEvent
6332
+ const updateZindex = () => {
6333
+ if (reactData.tipZindex < getLastZIndex()) {
6334
+ reactData.tipZindex = nextZIndex();
6335
+ }
6251
6336
  };
6252
- const tagPrivateMethods = {};
6253
- Object.assign($xeBacktop, tagMethods, tagPrivateMethods);
6254
- const renderVN = () => {
6255
- const {
6256
- circle,
6257
- position,
6258
- status,
6259
- icon,
6260
- showIcon,
6261
- content,
6262
- showContent
6263
- } = props;
6264
- const {
6265
- showBtn
6266
- } = reactData;
6267
- const wrapperStyle = computeWrapperStyle.value;
6268
- const vSize = computeSize.value;
6269
- const defaultSlot = slots.default;
6270
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6271
- ref: refElem,
6272
- class: ['vxe-backtop', position === 'fixed' ? 'is--' + position : 'is--absolute', {
6273
- [`size--${vSize}`]: vSize,
6274
- [`theme--${status}`]: status,
6275
- 'is--circle': circle,
6276
- 'is--visible': showBtn
6277
- }],
6278
- style: wrapperStyle,
6279
- onClick: clickEvent
6280
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6281
- class: 'vxe-backtop--inner'
6282
- }, [defaultSlot ? defaultSlot({}) : [showIcon ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6283
- class: 'vxe-backtop--icon'
6284
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
6285
- class: icon || getIcon().BACKTOP_TOP
6286
- })]) : renderEmptyElement($xeBacktop), showContent ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6287
- class: 'vxe-backtop--content'
6288
- }, `${content || ''}`) : renderEmptyElement($xeBacktop)]])]);
6337
+ const clickEvent = () => {
6338
+ if (reactData.visible) {
6339
+ tooltipMethods.close();
6340
+ } else {
6341
+ handleVisible(reactData.target || getSelectorEl(), props.content);
6342
+ }
6289
6343
  };
6290
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.target, () => {
6291
- handleTargetElement();
6292
- });
6293
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
6294
- handleTargetElement();
6295
- });
6296
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
6297
- removeScrollEvent();
6298
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(reactData, createReactData());
6299
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(internalData, createInternalData());
6300
- });
6301
- $xeBacktop.renderVN = renderVN;
6302
- return $xeBacktop;
6303
- },
6304
- render() {
6305
- return this.renderVN();
6306
- }
6307
- }));
6308
- ;// CONCATENATED MODULE: ./packages/backtop/index.ts
6309
-
6310
-
6311
-
6312
- const VxeBacktop = Object.assign({}, backtop, {
6313
- install(app) {
6314
- app.component(backtop.name, backtop);
6315
- }
6316
- });
6317
- dynamicApp.use(VxeBacktop);
6318
- index_esm_VxeUI.component(backtop);
6319
- const Backtop = VxeBacktop;
6320
- /* harmony default export */ var packages_backtop = (VxeBacktop);
6321
- ;// CONCATENATED MODULE: ./packages/badge/src/badge.ts
6322
-
6323
-
6324
-
6325
-
6326
- /* harmony default export */ var badge = (defineVxeComponent({
6327
- name: 'VxeBadge',
6328
- props: {
6329
- count: [String, Number],
6330
- dot: Boolean,
6331
- content: [String, Number],
6332
- size: {
6333
- type: String,
6334
- default: () => getConfig().badge.size || getConfig().size
6335
- }
6336
- },
6337
- emits: [],
6338
- setup(props, context) {
6339
- const {
6340
- emit,
6341
- slots
6342
- } = context;
6343
- const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
6344
- const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
6345
- const {
6346
- computeSize
6347
- } = useSize(props);
6348
- const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({});
6349
- const refMaps = {
6350
- refElem
6344
+ const targetMouseenterEvent = () => {
6345
+ handleVisible(reactData.target || getSelectorEl(), props.content);
6351
6346
  };
6352
- const computeCountNum = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6347
+ const targetMouseleaveEvent = () => {
6353
6348
  const {
6354
- count
6349
+ trigger,
6350
+ enterable,
6351
+ leaveDelay
6355
6352
  } = props;
6356
- return count ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(count) : 0;
6357
- });
6358
- const computeMaps = {};
6359
- const $xeBadge = {
6360
- xID,
6361
- props,
6362
- context,
6363
- reactData,
6364
- getRefMaps: () => refMaps,
6365
- getComputeMaps: () => computeMaps
6366
- };
6367
- const dispatchEvent = (type, params, evnt) => {
6368
- emit(type, createEvent(evnt, {
6369
- $badge: $xeBadge
6370
- }, params));
6353
+ reactData.tipActive = false;
6354
+ if (enterable && trigger === 'hover') {
6355
+ setTimeout(() => {
6356
+ if (!reactData.tipActive) {
6357
+ tooltipMethods.close();
6358
+ }
6359
+ }, leaveDelay);
6360
+ } else {
6361
+ tooltipMethods.close();
6362
+ }
6371
6363
  };
6372
- const collapsePaneMethods = {
6373
- dispatchEvent
6364
+ const wrapperMouseenterEvent = () => {
6365
+ reactData.tipActive = true;
6374
6366
  };
6375
- const collapsePanePrivateMethods = {};
6376
- Object.assign($xeBadge, collapsePaneMethods, collapsePanePrivateMethods);
6377
- const renderVN = () => {
6367
+ const wrapperMouseleaveEvent = () => {
6378
6368
  const {
6379
- dot,
6380
- content
6369
+ trigger,
6370
+ enterable,
6371
+ leaveDelay
6381
6372
  } = props;
6382
- const vSize = computeSize.value;
6383
- const countNum = computeCountNum.value;
6384
- const defaultSlot = slots.default;
6385
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6386
- ref: refElem,
6387
- class: ['vxe-badge', {
6388
- [`size--${vSize}`]: vSize,
6389
- 'is--dot': dot
6390
- }]
6391
- }, [defaultSlot || content ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6392
- class: 'vxe-badge--content'
6393
- }, defaultSlot ? defaultSlot({}) : `${content || ''}`) : [], countNum ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6394
- class: 'vxe-badge--count'
6395
- }, countNum > 99 ? '99+' : `${countNum}`) : renderEmptyElement($xeBadge)]);
6373
+ reactData.tipActive = false;
6374
+ if (enterable && trigger === 'hover') {
6375
+ setTimeout(() => {
6376
+ if (!reactData.tipActive) {
6377
+ tooltipMethods.close();
6378
+ }
6379
+ }, leaveDelay);
6380
+ }
6396
6381
  };
6397
- $xeBadge.renderVN = renderVN;
6398
- return $xeBadge;
6399
- },
6400
- render() {
6401
- return this.renderVN();
6402
- }
6403
- }));
6404
- ;// CONCATENATED MODULE: ./packages/badge/index.ts
6405
-
6406
-
6407
-
6408
- const VxeBadge = Object.assign({}, badge, {
6409
- install(app) {
6410
- app.component(badge.name, badge);
6411
- }
6412
- });
6413
- dynamicApp.use(VxeBadge);
6414
- index_esm_VxeUI.component(badge);
6415
- const Badge = VxeBadge;
6416
- /* harmony default export */ var packages_badge = (VxeBadge);
6417
- ;// CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb-item.ts
6418
-
6419
-
6420
-
6421
-
6422
- /* harmony default export */ var breadcrumb_item = (defineVxeComponent({
6423
- name: 'VxeBreadcrumbItem',
6424
- props: {
6425
- title: String,
6426
- routerLink: Object
6427
- },
6428
- emits: [],
6429
- setup(props, context) {
6430
- const {
6431
- slots
6432
- } = context;
6433
- const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
6434
- const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
6435
- const $xeBreadcrumb = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeBreadcrumb', null);
6436
- const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({});
6437
- const refMaps = {
6438
- refElem
6382
+ const showTip = () => {
6383
+ const {
6384
+ tipStore
6385
+ } = reactData;
6386
+ const el = refElem.value;
6387
+ if (el) {
6388
+ const parentNode = el.parentNode;
6389
+ if (!parentNode) {
6390
+ document.body.appendChild(el);
6391
+ }
6392
+ }
6393
+ updateValue(true);
6394
+ updateZindex();
6395
+ tipStore.placement = 'top';
6396
+ tipStore.style = {
6397
+ width: 'auto',
6398
+ left: 0,
6399
+ top: 0,
6400
+ zIndex: props.zIndex || reactData.tipZindex
6401
+ };
6402
+ tipStore.arrowStyle = {
6403
+ left: '50%'
6404
+ };
6405
+ return tooltipMethods.updatePlacement();
6439
6406
  };
6440
- const computeSeparator = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6441
- if ($xeBreadcrumb) {
6442
- return $xeBreadcrumb.props.separator;
6407
+ const handleDelayFn = () => {
6408
+ internalData.showDelayTip = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().debounce(() => {
6409
+ if (reactData.tipActive) {
6410
+ showTip();
6411
+ }
6412
+ }, props.enterDelay, {
6413
+ leading: false,
6414
+ trailing: true
6415
+ });
6416
+ };
6417
+ const handleVisible = (target, content, evnt) => {
6418
+ const contentSlot = slots.content;
6419
+ if (!contentSlot && (content === '' || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(content))) {
6420
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
6443
6421
  }
6444
- return '';
6445
- });
6446
- const clickEvent = evnt => {
6447
- if ($xeBreadcrumb) {
6448
- const item = {
6449
- title: props.title,
6450
- routerLink: props.routerLink
6451
- };
6452
- $xeBreadcrumb.handleClickLink(evnt, item);
6422
+ if (target) {
6423
+ const {
6424
+ showDelayTip
6425
+ } = internalData;
6426
+ const {
6427
+ trigger,
6428
+ enterDelay
6429
+ } = props;
6430
+ if (evnt) {
6431
+ reactData.tipPos = {
6432
+ x: evnt.clientX,
6433
+ y: evnt.clientY,
6434
+ oLeft: evnt.offsetX,
6435
+ oTop: evnt.offsetY
6436
+ };
6437
+ } else {
6438
+ reactData.tipPos = null;
6439
+ }
6440
+ reactData.tipActive = true;
6441
+ reactData.tipTarget = target;
6442
+ reactData.tipContent = content;
6443
+ if (reactData.visible) {
6444
+ return $xeTooltip.updatePlacement();
6445
+ }
6446
+ if (enterDelay && trigger === 'hover') {
6447
+ if (showDelayTip) {
6448
+ showDelayTip();
6449
+ }
6450
+ } else {
6451
+ return showTip();
6452
+ }
6453
6453
  }
6454
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
6454
6455
  };
6455
- const computeMaps = {};
6456
- const $xeBreadcrumbItem = {
6457
- xID,
6458
- props,
6459
- context,
6460
- reactData,
6461
- getRefMaps: () => refMaps,
6462
- getComputeMaps: () => computeMaps
6463
- };
6464
- const renderVN = () => {
6456
+ const getSelectorEl = () => {
6465
6457
  const {
6466
- title,
6467
- routerLink
6458
+ selector
6468
6459
  } = props;
6469
- const separator = computeSeparator.value;
6470
- const defaultSlot = slots.default;
6471
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6472
- ref: refElem,
6473
- class: 'vxe-breadcrumb-item',
6474
- onClick: clickEvent
6475
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6476
- class: 'vxe-breadcrumb-item--content'
6477
- }, [routerLink ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)('router-link'), {
6478
- class: 'vxe-breadcrumb-item--content-link',
6479
- title,
6480
- to: routerLink
6481
- }, {
6482
- default() {
6483
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6484
- class: 'vxe-breadcrumb-item--content-text'
6485
- }, defaultSlot ? defaultSlot({}) : `${title || ''}`);
6460
+ if (selector) {
6461
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isElement(selector)) {
6462
+ return selector;
6486
6463
  }
6487
- }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6488
- class: 'vxe-breadcrumb-item--content-text'
6489
- }, defaultSlot ? defaultSlot({}) : `${title || ''}`)]), separator ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6490
- class: 'vxe-breadcrumb-item--separator'
6491
- }, `${separator}`) : renderEmptyElement($xeBreadcrumbItem)]);
6492
- };
6493
- $xeBreadcrumbItem.renderVN = renderVN;
6494
- return $xeBreadcrumbItem;
6495
- },
6496
- render() {
6497
- return this.renderVN();
6498
- }
6499
- }));
6500
- ;// CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb.ts
6501
-
6502
-
6503
-
6504
-
6505
-
6506
- /* harmony default export */ var breadcrumb = (defineVxeComponent({
6507
- name: 'VxeBreadcrumb',
6508
- props: {
6509
- separator: {
6510
- type: String,
6511
- default: () => getConfig().breadcrumb.separator
6512
- },
6513
- options: Array
6514
- },
6515
- emits: ['click'],
6516
- setup(props, context) {
6517
- const {
6518
- emit,
6519
- slots
6520
- } = context;
6521
- const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
6522
- const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
6523
- const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({});
6524
- const refMaps = {
6525
- refElem
6526
- };
6527
- const computeMaps = {};
6528
- const $xeBreadcrumb = {
6529
- xID,
6530
- props,
6531
- context,
6532
- reactData,
6533
- getRefMaps: () => refMaps,
6534
- getComputeMaps: () => computeMaps
6464
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(selector)) {
6465
+ return document.querySelector(selector);
6466
+ }
6467
+ }
6468
+ return null;
6535
6469
  };
6536
- const breadcrumbMethods = {
6470
+ tooltipMethods = {
6537
6471
  dispatchEvent(type, params, evnt) {
6538
6472
  emit(type, createEvent(evnt, {
6539
- $breadcrumb: $xeBreadcrumb
6473
+ $tooltip: $xeTooltip
6540
6474
  }, params));
6541
- }
6542
- };
6543
- const breadcrumbPrivateMethods = {
6544
- handleClickLink(evnt, option) {
6545
- breadcrumbMethods.dispatchEvent('click', {
6546
- option
6547
- }, evnt);
6548
- }
6549
- };
6550
- Object.assign($xeBreadcrumb, breadcrumbMethods, breadcrumbPrivateMethods);
6551
- const renderItems = () => {
6552
- const {
6553
- options
6554
- } = props;
6555
- if (options && options.length) {
6556
- return options.map(item => {
6557
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(breadcrumb_item, {
6558
- title: item.title,
6559
- routerLink: item.routerLink
6560
- });
6475
+ },
6476
+ openByEvent(evnt, target, content) {
6477
+ return handleVisible(target || reactData.target || getSelectorEl(), content, evnt);
6478
+ },
6479
+ open(target, content) {
6480
+ return handleVisible(target || reactData.target || getSelectorEl(), content);
6481
+ },
6482
+ close() {
6483
+ reactData.tipPos = null;
6484
+ reactData.tipTarget = null;
6485
+ reactData.tipActive = false;
6486
+ Object.assign(reactData.tipStore, {
6487
+ style: {},
6488
+ placement: '',
6489
+ arrowStyle: null
6561
6490
  });
6562
- }
6563
- return [];
6564
- };
6565
- const renderVN = () => {
6566
- const defaultSlot = slots.default;
6567
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6568
- ref: refElem,
6569
- class: 'vxe-breadcrumb'
6570
- }, defaultSlot ? defaultSlot({}) : renderItems());
6491
+ updateValue(false);
6492
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
6493
+ },
6494
+ toVisible(target, content) {
6495
+ return handleVisible(target, content);
6496
+ },
6497
+ updatePlacement() {
6498
+ const {
6499
+ visible,
6500
+ tipTarget
6501
+ } = reactData;
6502
+ let el = refElem.value;
6503
+ if (visible && tipTarget && el) {
6504
+ updateTipStyle();
6505
+ }
6506
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
6507
+ el = refElem.value;
6508
+ if (tipTarget && el) {
6509
+ updateTipStyle();
6510
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
6511
+ updateTipStyle();
6512
+ });
6513
+ }
6514
+ });
6515
+ },
6516
+ isActived() {
6517
+ return reactData.tipActive;
6518
+ },
6519
+ setActived(active) {
6520
+ reactData.tipActive = !!active;
6521
+ }
6571
6522
  };
6572
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeBreadcrumb', $xeBreadcrumb);
6573
- $xeBreadcrumb.renderVN = renderVN;
6574
- return $xeBreadcrumb;
6523
+ const wheelEvent = evnt => {
6524
+ evnt.stopPropagation();
6525
+ };
6526
+ Object.assign($xeTooltip, tooltipMethods);
6527
+ const renderContent = () => {
6528
+ const {
6529
+ useHTML
6530
+ } = props;
6531
+ const {
6532
+ tipContent
6533
+ } = reactData;
6534
+ const wrapperStyle = computeWrapperStyle.value;
6535
+ const contentSlot = slots.content;
6536
+ const contVNs = [];
6537
+ if (contentSlot) {
6538
+ contVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6539
+ key: 1
6540
+ }, vn_getSlotVNs(contentSlot({}))));
6541
+ } else if (useHTML) {
6542
+ contVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6543
+ key: 2,
6544
+ innerHTML: tipContent
6545
+ }));
6546
+ } else {
6547
+ contVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6548
+ key: 3
6549
+ }, `${tipContent}`));
6550
+ }
6551
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6552
+ key: 3,
6553
+ ref: contentWrapperfElem,
6554
+ class: 'vxe-tooltip--content',
6555
+ style: wrapperStyle
6556
+ }, contVNs);
6557
+ };
6558
+ const renderVN = () => {
6559
+ const {
6560
+ popupClassName,
6561
+ theme,
6562
+ isArrow,
6563
+ enterable
6564
+ } = props;
6565
+ const {
6566
+ tipActive,
6567
+ visible,
6568
+ tipStore
6569
+ } = reactData;
6570
+ const defaultSlot = slots.default;
6571
+ const vSize = computeSize.value;
6572
+ let ons;
6573
+ if (enterable) {
6574
+ ons = {
6575
+ onMouseenter: wrapperMouseenterEvent,
6576
+ onMouseleave: wrapperMouseleaveEvent
6577
+ };
6578
+ }
6579
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6580
+ ref: refElem,
6581
+ class: ['vxe-tooltip--wrapper', `theme--${theme}`, popupClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(popupClassName) ? popupClassName({
6582
+ $tooltip: $xeTooltip
6583
+ }) : popupClassName : '', {
6584
+ [`size--${vSize}`]: vSize,
6585
+ [`placement--${tipStore.placement}`]: tipStore.placement,
6586
+ 'is--enterable': enterable,
6587
+ 'is--visible': visible,
6588
+ 'is--arrow': isArrow,
6589
+ 'is--active': tipActive
6590
+ }],
6591
+ style: tipStore.style,
6592
+ ...ons
6593
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6594
+ key: 'tby',
6595
+ class: 'vxe-tooltip--body'
6596
+ }, [renderContent(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6597
+ class: 'vxe-tooltip--arrow',
6598
+ style: tipStore.arrowStyle
6599
+ })]), ...(defaultSlot ? vn_getSlotVNs(defaultSlot({})) : [])]);
6600
+ };
6601
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.enterDelay, () => {
6602
+ handleDelayFn();
6603
+ });
6604
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.content, val => {
6605
+ reactData.tipContent = val;
6606
+ });
6607
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, val => {
6608
+ if (!reactData.isUpdate) {
6609
+ if (val) {
6610
+ handleVisible(reactData.target || getSelectorEl(), props.content);
6611
+ } else {
6612
+ tooltipMethods.close();
6613
+ }
6614
+ }
6615
+ reactData.isUpdate = false;
6616
+ });
6617
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
6618
+ const contentWrapperfEl = contentWrapperfElem.value;
6619
+ if (contentWrapperfEl) {
6620
+ contentWrapperfEl.addEventListener('wheel', wheelEvent, {
6621
+ passive: false
6622
+ });
6623
+ }
6624
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
6625
+ const {
6626
+ trigger,
6627
+ content
6628
+ } = props;
6629
+ const wrapperElem = refElem.value;
6630
+ if (wrapperElem) {
6631
+ const parentNode = wrapperElem.parentNode;
6632
+ if (parentNode) {
6633
+ reactData.tipContent = content;
6634
+ reactData.tipZindex = nextZIndex();
6635
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(wrapperElem.children, (elem, index) => {
6636
+ if (index) {
6637
+ parentNode.insertBefore(elem, wrapperElem);
6638
+ if (!reactData.target) {
6639
+ reactData.target = elem;
6640
+ }
6641
+ }
6642
+ });
6643
+ parentNode.removeChild(wrapperElem);
6644
+ const {
6645
+ target
6646
+ } = reactData;
6647
+ if (target) {
6648
+ if (trigger === 'hover') {
6649
+ target.onmouseenter = targetMouseenterEvent;
6650
+ target.onmouseleave = targetMouseleaveEvent;
6651
+ } else if (trigger === 'click') {
6652
+ target.onclick = clickEvent;
6653
+ }
6654
+ }
6655
+ if (props.modelValue) {
6656
+ handleVisible(target || getSelectorEl(), content);
6657
+ }
6658
+ }
6659
+ }
6660
+ });
6661
+ });
6662
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
6663
+ const {
6664
+ target
6665
+ } = reactData;
6666
+ const wrapperElem = refElem.value;
6667
+ if (target) {
6668
+ target.onmouseenter = null;
6669
+ target.onmouseleave = null;
6670
+ target.onclick = null;
6671
+ }
6672
+ const contentWrapperfEl = contentWrapperfElem.value;
6673
+ if (contentWrapperfEl) {
6674
+ contentWrapperfEl.removeEventListener('wheel', wheelEvent);
6675
+ }
6676
+ if (wrapperElem) {
6677
+ const parentNode = wrapperElem.parentNode;
6678
+ if (parentNode) {
6679
+ parentNode.removeChild(wrapperElem);
6680
+ }
6681
+ }
6682
+ });
6683
+ handleDelayFn();
6684
+ $xeTooltip.renderVN = renderVN;
6685
+ return $xeTooltip;
6575
6686
  },
6576
6687
  render() {
6577
6688
  return this.renderVN();
6578
6689
  }
6579
6690
  }));
6580
- ;// CONCATENATED MODULE: ./packages/breadcrumb/index.ts
6691
+ ;// CONCATENATED MODULE: ./packages/tooltip/index.ts
6581
6692
 
6582
6693
 
6583
6694
 
6584
- const VxeBreadcrumb = Object.assign({}, breadcrumb, {
6695
+ const VxeTooltip = Object.assign({}, tooltip, {
6585
6696
  install(app) {
6586
- app.component(breadcrumb.name, breadcrumb);
6697
+ app.component(tooltip.name, tooltip);
6587
6698
  }
6588
6699
  });
6589
- dynamicApp.use(VxeBreadcrumb);
6590
- index_esm_VxeUI.component(breadcrumb);
6591
- const Breadcrumb = VxeBreadcrumb;
6592
- /* harmony default export */ var packages_breadcrumb = (VxeBreadcrumb);
6593
- ;// CONCATENATED MODULE: ./packages/breadcrumb-item/index.ts
6700
+ dynamicApp.use(VxeTooltip);
6701
+ index_esm_VxeUI.component(tooltip);
6702
+ const Tooltip = VxeTooltip;
6703
+ /* harmony default export */ var packages_tooltip = (VxeTooltip);
6704
+ ;// CONCATENATED MODULE: ./packages/button/src/button.ts
6594
6705
 
6595
6706
 
6596
6707
 
6597
- const VxeBreadcrumbItem = Object.assign({}, breadcrumb_item, {
6598
- install(app) {
6599
- app.component(breadcrumb_item.name, breadcrumb_item);
6600
- }
6601
- });
6602
- dynamicApp.use(VxeBreadcrumbItem);
6603
- index_esm_VxeUI.component(breadcrumb_item);
6604
- const BreadcrumbItem = VxeBreadcrumbItem;
6605
- /* harmony default export */ var packages_breadcrumb_item = (VxeBreadcrumbItem);
6606
- ;// CONCATENATED MODULE: ./packages/ui/src/utils.ts
6607
6708
 
6608
6709
 
6609
6710
 
6610
- function isEnableConf(conf) {
6611
- return conf && conf.enabled !== false;
6612
- }
6613
- function nextZIndex() {
6614
- return index_esm.getNext();
6615
- }
6616
- function getLastZIndex() {
6617
- return index_esm.getCurrent();
6618
- }
6619
- function nextSubZIndex() {
6620
- return index_esm.getSubNext();
6621
- }
6622
- function getSubLastZIndex() {
6623
- return index_esm.getSubCurrent();
6624
- }
6625
- function getGlobalDefaultConfig(value, globalValue) {
6626
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(value)) {
6627
- return globalValue;
6628
- }
6629
- return value;
6630
- }
6631
- function getFuncText(content, args) {
6632
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(content)) {
6633
- return '';
6634
- }
6635
- const translate = getConfig().translate;
6636
- return `${translate ? translate('' + content, args) : content}`;
6637
- }
6638
- /**
6639
- * 判断值为:'' | null | undefined 时都属于空值
6640
- */
6641
- function eqEmptyValue(cellValue) {
6642
- return cellValue === null || cellValue === undefined || cellValue === '';
6643
- }
6644
- function handleBooleanDefaultValue(value) {
6645
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(value) ? value : null;
6646
- }
6647
- ;// CONCATENATED MODULE: ./packages/tooltip/src/tooltip.ts
6648
-
6649
-
6650
6711
 
6651
6712
 
6652
6713
 
6653
6714
 
6654
-
6655
-
6656
- /* harmony default export */ var tooltip = (defineVxeComponent({
6657
- name: 'VxeTooltip',
6715
+ const VxeButtonComponent = defineVxeComponent({
6716
+ name: 'VxeButton',
6658
6717
  props: {
6659
- modelValue: Boolean,
6718
+ /**
6719
+ * 按钮类型
6720
+ */
6721
+ type: String,
6722
+ mode: String,
6723
+ className: [String, Function],
6724
+ popupClassName: [String, Function],
6725
+ /**
6726
+ * 按钮尺寸
6727
+ */
6660
6728
  size: {
6661
6729
  type: String,
6662
- default: () => getConfig().tooltip.size || getConfig().size
6730
+ default: () => getConfig().button.size || getConfig().size
6663
6731
  },
6664
- selector: String,
6732
+ zIndex: Number,
6733
+ /**
6734
+ * 用来标识这一项
6735
+ */
6736
+ name: [String, Number],
6737
+ routerLink: Object,
6738
+ /**
6739
+ * 权限码
6740
+ */
6741
+ permissionCode: [String, Number],
6742
+ /**
6743
+ * 按钮内容
6744
+ */
6745
+ content: String,
6746
+ /**
6747
+ * 固定显示下拉面板的方向
6748
+ */
6749
+ placement: String,
6750
+ /**
6751
+ * 按钮状态
6752
+ */
6753
+ status: String,
6754
+ /**
6755
+ * 标题
6756
+ */
6757
+ title: String,
6758
+ shadow: Boolean,
6759
+ /**
6760
+ * 按钮的前缀图标,属于 prefix-icon 的简写
6761
+ */
6762
+ icon: String,
6763
+ iconRender: Object,
6764
+ /**
6765
+ * 按钮的前缀图标
6766
+ */
6767
+ prefixIcon: String,
6768
+ prefixRender: Object,
6769
+ /**
6770
+ * 按钮的后缀图标
6771
+ */
6772
+ suffixIcon: String,
6773
+ suffixRender: Object,
6774
+ /**
6775
+ * 圆角边框
6776
+ */
6777
+ round: Boolean,
6778
+ /**
6779
+ * 圆角按钮
6780
+ */
6781
+ circle: Boolean,
6782
+ /**
6783
+ * 是否禁用
6784
+ */
6785
+ disabled: Boolean,
6786
+ /**
6787
+ * 是否加载中
6788
+ */
6789
+ loading: Boolean,
6665
6790
  trigger: {
6666
6791
  type: String,
6667
- default: () => getConfig().tooltip.trigger || 'hover'
6668
- },
6669
- theme: {
6670
- type: String,
6671
- default: () => getConfig().tooltip.theme || 'dark'
6672
- },
6673
- content: {
6674
- type: [String, Number],
6675
- default: null
6676
- },
6677
- useHTML: Boolean,
6678
- zIndex: [String, Number],
6679
- popupClassName: [String, Function],
6680
- width: {
6681
- type: [String, Number],
6682
- default: () => getConfig().tooltip.Width
6683
- },
6684
- height: {
6685
- type: [String, Number],
6686
- default: () => getConfig().tooltip.height
6687
- },
6688
- minWidth: {
6689
- type: [String, Number],
6690
- default: () => getConfig().tooltip.minWidth
6691
- },
6692
- minHeight: {
6693
- type: [String, Number],
6694
- default: () => getConfig().tooltip.minHeight
6695
- },
6696
- maxWidth: {
6697
- type: [String, Number],
6698
- default: () => getConfig().tooltip.maxWidth
6699
- },
6700
- maxHeight: {
6701
- type: [String, Number],
6702
- default: () => getConfig().tooltip.maxHeight
6792
+ default: () => getConfig().button.trigger
6703
6793
  },
6704
- isArrow: {
6794
+ align: String,
6795
+ prefixTooltip: Object,
6796
+ suffixTooltip: Object,
6797
+ options: Array,
6798
+ showDropdownIcon: {
6705
6799
  type: Boolean,
6706
- default: () => getConfig().tooltip.isArrow
6800
+ default: () => getConfig().button.showDropdownIcon
6707
6801
  },
6708
- enterable: {
6802
+ /**
6803
+ * 在下拉面板关闭时销毁内容
6804
+ */
6805
+ destroyOnClose: {
6709
6806
  type: Boolean,
6710
- default: () => getConfig().tooltip.enterable
6711
- },
6712
- enterDelay: {
6713
- type: Number,
6714
- default: () => getConfig().tooltip.enterDelay
6807
+ default: () => getConfig().button.destroyOnClose
6715
6808
  },
6716
- leaveDelay: {
6717
- type: Number,
6718
- default: () => getConfig().tooltip.leaveDelay
6809
+ /**
6810
+ * 是否将弹框容器插入于 body 内
6811
+ */
6812
+ transfer: {
6813
+ type: Boolean,
6814
+ default: null
6719
6815
  }
6720
6816
  },
6721
- emits: ['update:modelValue'],
6817
+ emits: ['click', 'mouseenter', 'mouseleave', 'dropdown-click', 'dropdownClick', 'contextmenu'],
6722
6818
  setup(props, context) {
6723
6819
  const {
6724
6820
  slots,
6725
6821
  emit
6726
6822
  } = context;
6823
+ const $xeModal = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeModal', null);
6824
+ const $xeDrawer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeDrawer', null);
6825
+ const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', null);
6826
+ const $xeTree = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTree', null);
6827
+ const $xeForm = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeForm', null);
6828
+ const $xeButtonGroup = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeButtonGroup', null);
6727
6829
  const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
6728
6830
  const {
6729
6831
  computeSize
6730
6832
  } = useSize(props);
6833
+ const {
6834
+ computePermissionInfo
6835
+ } = usePermission(props);
6731
6836
  const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
6732
- target: null,
6733
- isUpdate: false,
6734
- visible: false,
6735
- tipPos: null,
6736
- tipContent: '',
6737
- tipActive: false,
6738
- tipTarget: null,
6739
- tipZindex: 0,
6740
- tipStore: {
6741
- style: {},
6742
- placement: '',
6743
- arrowStyle: {}
6744
- }
6837
+ initialized: false,
6838
+ visiblePanel: false,
6839
+ isAniVisible: false,
6840
+ isActivated: false,
6841
+ panelIndex: 0,
6842
+ panelStyle: {},
6843
+ panelPlacement: ''
6745
6844
  });
6746
- const internalData = {};
6845
+ const internalData = {
6846
+ showTime: undefined,
6847
+ tooltipTimeout: undefined
6848
+ };
6747
6849
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
6748
- const contentWrapperfElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
6749
- const computeWrapperStyle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6750
- const {
6751
- width,
6752
- height,
6753
- minHeight,
6754
- minWidth,
6755
- maxHeight,
6756
- maxWidth
6757
- } = props;
6758
- const stys = {};
6759
- if (width) {
6760
- stys.width = toCssUnit(width);
6761
- }
6762
- if (height) {
6763
- stys.height = toCssUnit(height);
6764
- }
6765
- if (minWidth) {
6766
- stys.minWidth = toCssUnit(minWidth);
6767
- }
6768
- if (minHeight) {
6769
- stys.minHeight = toCssUnit(minHeight);
6770
- }
6771
- if (maxWidth) {
6772
- stys.maxWidth = toCssUnit(maxWidth);
6773
- }
6774
- if (maxHeight) {
6775
- stys.maxHeight = toCssUnit(maxHeight);
6776
- }
6777
- return stys;
6778
- });
6850
+ const refButton = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
6851
+ const refBtnPanel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
6779
6852
  const refMaps = {
6780
6853
  refElem
6781
6854
  };
6782
- const $xeTooltip = {
6855
+ const $xeButton = {
6783
6856
  xID,
6784
6857
  props,
6785
6858
  context,
@@ -6787,859 +6860,261 @@ function handleBooleanDefaultValue(value) {
6787
6860
  internalData,
6788
6861
  getRefMaps: () => refMaps
6789
6862
  };
6790
- let tooltipMethods = {};
6791
- const updateTipStyle = () => {
6863
+ let buttonMethods = {};
6864
+ const computeBtnTransfer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6792
6865
  const {
6793
- isArrow
6866
+ transfer
6794
6867
  } = props;
6868
+ if (transfer === null) {
6869
+ const globalTransfer = getConfig().button.transfer;
6870
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(globalTransfer)) {
6871
+ return globalTransfer;
6872
+ }
6873
+ if ($xeTable || $xeTree || $xeModal || $xeDrawer || $xeForm) {
6874
+ return true;
6875
+ }
6876
+ }
6877
+ return transfer;
6878
+ });
6879
+ const computeBtnDisabled = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6795
6880
  const {
6796
- tipTarget: targetElem,
6797
- tipStore,
6798
- tipPos
6799
- } = reactData;
6800
- let top = '';
6801
- let left = '';
6802
- let panelPlacement = 'bottom';
6803
- let arrowLeft = '';
6804
- const panelElem = refElem.value;
6805
- if (panelElem && targetElem) {
6806
- const documentElement = document.documentElement;
6807
- const bodyElem = document.body;
6808
- const targetWidth = targetElem.offsetWidth;
6809
- const targetHeight = targetElem.offsetHeight;
6810
- const panelHeight = panelElem.offsetHeight;
6811
- const panelWidth = panelElem.offsetWidth;
6812
- const targetRect = targetElem.getBoundingClientRect();
6813
- const visibleHeight = documentElement.clientHeight || bodyElem.clientHeight;
6814
- const visibleWidth = documentElement.clientWidth || bodyElem.clientWidth;
6815
- const marginSize = 6;
6816
- top = targetRect.top + targetHeight;
6817
- left = targetRect.left;
6818
- if (tipPos && tipPos.x && tipPos.y) {
6819
- if (isArrow) {
6820
- left = left + Math.max(8, Math.min(targetWidth - 8, tipPos.oLeft)) - panelWidth / 2;
6821
- } else {
6822
- left = tipPos.x + 1;
6823
- top = tipPos.y + 1;
6824
- }
6825
- } else {
6826
- left = targetRect.left + (targetWidth - panelWidth) / 2;
6827
- }
6828
- // 如果下面不够放,则向上
6829
- if (top + panelHeight + marginSize > visibleHeight) {
6830
- panelPlacement = 'top';
6831
- top = targetRect.top - panelHeight;
6832
- }
6833
- // 如果上面不够放,则向下(优先)
6834
- if (top < marginSize) {
6835
- panelPlacement = 'bottom';
6836
- top = targetRect.top + targetHeight;
6837
- }
6838
- // 如果溢出右边
6839
- if (left + panelWidth + marginSize > visibleWidth) {
6840
- left -= left + panelWidth + marginSize - visibleWidth;
6841
- }
6842
- // 如果溢出左边
6843
- if (left < marginSize) {
6844
- left = marginSize;
6845
- }
6846
- // 箭头
6847
- if (left === targetRect.left) {
6848
- if (targetWidth <= panelWidth) {
6849
- arrowLeft = targetWidth / 2;
6850
- }
6851
- } else if (left < targetRect.left) {
6852
- if (left + panelWidth > targetRect.left + targetWidth) {
6853
- arrowLeft = targetRect.left - left + targetWidth / 2;
6854
- } else {
6855
- arrowLeft = targetRect.left - left + (panelWidth - (targetRect.left - left)) / 2;
6856
- }
6857
- }
6858
- tipStore.placement = panelPlacement;
6859
- tipStore.style.top = `${top}px`;
6860
- tipStore.style.left = `${left}px`;
6861
- tipStore.arrowStyle.left = `${arrowLeft}px`;
6881
+ disabled
6882
+ } = props;
6883
+ const permissionInfo = computePermissionInfo.value;
6884
+ return disabled || permissionInfo.disabled;
6885
+ });
6886
+ const computeIsFormBtn = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6887
+ const {
6888
+ type
6889
+ } = props;
6890
+ if (type) {
6891
+ return ['submit', 'reset', 'button'].indexOf(type) > -1;
6862
6892
  }
6863
- };
6864
- const updateValue = value => {
6865
- if (value !== reactData.visible) {
6866
- reactData.visible = value;
6867
- reactData.isUpdate = true;
6868
- emit('update:modelValue', value);
6893
+ return false;
6894
+ });
6895
+ const computeBtnMode = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6896
+ const {
6897
+ type,
6898
+ mode
6899
+ } = props;
6900
+ if (mode === 'text' || type === 'text' || $xeButtonGroup && $xeButtonGroup.props.mode === 'text') {
6901
+ return 'text';
6869
6902
  }
6870
- };
6871
- const updateZindex = () => {
6872
- if (reactData.tipZindex < getLastZIndex()) {
6873
- reactData.tipZindex = nextZIndex();
6903
+ return 'button';
6904
+ });
6905
+ const computeBtnStatus = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6906
+ const {
6907
+ status
6908
+ } = props;
6909
+ if (status) {
6910
+ return status;
6874
6911
  }
6875
- };
6876
- const clickEvent = () => {
6877
- if (reactData.visible) {
6878
- tooltipMethods.close();
6879
- } else {
6880
- handleVisible(reactData.target || getSelectorEl(), props.content);
6912
+ if ($xeButtonGroup) {
6913
+ return $xeButtonGroup.props.status;
6881
6914
  }
6882
- };
6883
- const targetMouseenterEvent = () => {
6884
- handleVisible(reactData.target || getSelectorEl(), props.content);
6885
- };
6886
- const targetMouseleaveEvent = () => {
6915
+ return '';
6916
+ });
6917
+ const computeBtnAlign = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6887
6918
  const {
6888
- trigger,
6889
- enterable,
6890
- leaveDelay
6919
+ align
6891
6920
  } = props;
6892
- reactData.tipActive = false;
6893
- if (enterable && trigger === 'hover') {
6894
- setTimeout(() => {
6895
- if (!reactData.tipActive) {
6896
- tooltipMethods.close();
6897
- }
6898
- }, leaveDelay);
6899
- } else {
6900
- tooltipMethods.close();
6921
+ if (align) {
6922
+ return align;
6901
6923
  }
6902
- };
6903
- const wrapperMouseenterEvent = () => {
6904
- reactData.tipActive = true;
6905
- };
6906
- const wrapperMouseleaveEvent = () => {
6924
+ if ($xeButtonGroup) {
6925
+ return $xeButtonGroup.props.align;
6926
+ }
6927
+ return false;
6928
+ });
6929
+ const computeBtnRound = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6907
6930
  const {
6908
- trigger,
6909
- enterable,
6910
- leaveDelay
6931
+ round
6911
6932
  } = props;
6912
- reactData.tipActive = false;
6913
- if (enterable && trigger === 'hover') {
6914
- setTimeout(() => {
6915
- if (!reactData.tipActive) {
6916
- tooltipMethods.close();
6917
- }
6918
- }, leaveDelay);
6933
+ if (round) {
6934
+ return round;
6919
6935
  }
6920
- };
6921
- const showTip = () => {
6922
- const {
6923
- tipStore
6924
- } = reactData;
6925
- const el = refElem.value;
6926
- if (el) {
6927
- const parentNode = el.parentNode;
6928
- if (!parentNode) {
6929
- document.body.appendChild(el);
6930
- }
6936
+ if ($xeButtonGroup) {
6937
+ return $xeButtonGroup.props.round;
6931
6938
  }
6932
- updateValue(true);
6933
- updateZindex();
6934
- tipStore.placement = 'top';
6935
- tipStore.style = {
6936
- width: 'auto',
6937
- left: 0,
6938
- top: 0,
6939
- zIndex: props.zIndex || reactData.tipZindex
6940
- };
6941
- tipStore.arrowStyle = {
6942
- left: '50%'
6943
- };
6944
- return tooltipMethods.updatePlacement();
6945
- };
6946
- const handleDelayFn = () => {
6947
- internalData.showDelayTip = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().debounce(() => {
6948
- if (reactData.tipActive) {
6949
- showTip();
6950
- }
6951
- }, props.enterDelay, {
6952
- leading: false,
6953
- trailing: true
6954
- });
6955
- };
6956
- const handleVisible = (target, content, evnt) => {
6957
- const contentSlot = slots.content;
6958
- if (!contentSlot && (content === '' || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(content))) {
6959
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
6939
+ return false;
6940
+ });
6941
+ const computeBtnCircle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6942
+ const {
6943
+ circle
6944
+ } = props;
6945
+ if (circle) {
6946
+ return circle;
6960
6947
  }
6961
- if (target) {
6962
- const {
6963
- showDelayTip
6964
- } = internalData;
6965
- const {
6966
- trigger,
6967
- enterDelay
6968
- } = props;
6969
- if (evnt) {
6970
- reactData.tipPos = {
6971
- x: evnt.clientX,
6972
- y: evnt.clientY,
6973
- oLeft: evnt.offsetX,
6974
- oTop: evnt.offsetY
6975
- };
6976
- } else {
6977
- reactData.tipPos = null;
6978
- }
6979
- reactData.tipActive = true;
6980
- reactData.tipTarget = target;
6981
- reactData.tipContent = content;
6982
- if (reactData.visible) {
6983
- return $xeTooltip.updatePlacement();
6984
- }
6985
- if (enterDelay && trigger === 'hover') {
6986
- if (showDelayTip) {
6987
- showDelayTip();
6988
- }
6989
- } else {
6990
- return showTip();
6991
- }
6948
+ if ($xeButtonGroup) {
6949
+ return $xeButtonGroup.props.circle;
6992
6950
  }
6993
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
6994
- };
6995
- const getSelectorEl = () => {
6951
+ return false;
6952
+ });
6953
+ const computeDownBtnList = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6996
6954
  const {
6997
- selector
6955
+ options
6998
6956
  } = props;
6999
- if (selector) {
7000
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isElement(selector)) {
7001
- return selector;
7002
- }
7003
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(selector)) {
7004
- return document.querySelector(selector);
7005
- }
6957
+ if (options) {
6958
+ return options.filter(item => {
6959
+ const {
6960
+ permissionCode
6961
+ } = item;
6962
+ return !permissionCode || permission.checkVisible(permissionCode);
6963
+ });
7006
6964
  }
7007
- return null;
7008
- };
7009
- tooltipMethods = {
7010
- dispatchEvent(type, params, evnt) {
7011
- emit(type, createEvent(evnt, {
7012
- $tooltip: $xeTooltip
7013
- }, params));
7014
- },
7015
- openByEvent(evnt, target, content) {
7016
- return handleVisible(target || reactData.target || getSelectorEl(), content, evnt);
7017
- },
7018
- open(target, content) {
7019
- return handleVisible(target || reactData.target || getSelectorEl(), content);
7020
- },
7021
- close() {
7022
- reactData.tipPos = null;
7023
- reactData.tipTarget = null;
7024
- reactData.tipActive = false;
7025
- Object.assign(reactData.tipStore, {
7026
- style: {},
7027
- placement: '',
7028
- arrowStyle: null
7029
- });
7030
- updateValue(false);
7031
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
7032
- },
7033
- toVisible(target, content) {
7034
- return handleVisible(target, content);
7035
- },
7036
- updatePlacement() {
7037
- const {
7038
- visible,
7039
- tipTarget
7040
- } = reactData;
7041
- let el = refElem.value;
7042
- if (visible && tipTarget && el) {
7043
- updateTipStyle();
7044
- }
7045
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
7046
- el = refElem.value;
7047
- if (tipTarget && el) {
7048
- updateTipStyle();
7049
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
7050
- updateTipStyle();
7051
- });
7052
- }
7053
- });
7054
- },
7055
- isActived() {
7056
- return reactData.tipActive;
7057
- },
7058
- setActived(active) {
7059
- reactData.tipActive = !!active;
6965
+ return [];
6966
+ });
6967
+ const computePrefixTipOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6968
+ return Object.assign({}, getConfig().button.prefixTooltip, props.prefixTooltip);
6969
+ });
6970
+ const computeSuffixTipOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6971
+ return Object.assign({}, getConfig().button.suffixTooltip, props.suffixTooltip);
6972
+ });
6973
+ const updateZindex = () => {
6974
+ const {
6975
+ zIndex
6976
+ } = props;
6977
+ if (zIndex) {
6978
+ reactData.panelIndex = zIndex;
6979
+ } else if (reactData.panelIndex < getLastZIndex()) {
6980
+ reactData.panelIndex = nextZIndex();
7060
6981
  }
7061
6982
  };
7062
- const wheelEvent = evnt => {
7063
- evnt.stopPropagation();
7064
- };
7065
- Object.assign($xeTooltip, tooltipMethods);
7066
- const renderContent = () => {
6983
+ const updatePlacement = () => {
7067
6984
  const {
7068
- useHTML
6985
+ placement
7069
6986
  } = props;
7070
6987
  const {
7071
- tipContent
6988
+ panelIndex
7072
6989
  } = reactData;
7073
- const wrapperStyle = computeWrapperStyle.value;
7074
- const contentSlot = slots.content;
7075
- const contVNs = [];
7076
- if (contentSlot) {
7077
- contVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7078
- key: 1
7079
- }, vn_getSlotVNs(contentSlot({}))));
7080
- } else if (useHTML) {
7081
- contVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7082
- key: 2,
7083
- innerHTML: tipContent
7084
- }));
7085
- } else {
7086
- contVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
7087
- key: 3
7088
- }, `${tipContent}`));
6990
+ const targetElem = refButton.value;
6991
+ const panelElem = refBtnPanel.value;
6992
+ const btnTransfer = computeBtnTransfer.value;
6993
+ const handleStyle = () => {
6994
+ const ppObj = updatePanelPlacement(targetElem, panelElem, {
6995
+ placement,
6996
+ teleportTo: btnTransfer
6997
+ });
6998
+ const panelStyle = Object.assign(ppObj.style, {
6999
+ zIndex: panelIndex
7000
+ });
7001
+ reactData.panelStyle = panelStyle;
7002
+ reactData.panelPlacement = ppObj.placement;
7003
+ };
7004
+ handleStyle();
7005
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(handleStyle);
7006
+ };
7007
+ const clickEvent = evnt => {
7008
+ if ($xeButtonGroup) {
7009
+ $xeButtonGroup.handleClick({
7010
+ name: props.name
7011
+ }, evnt);
7089
7012
  }
7090
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7091
- key: 3,
7092
- ref: contentWrapperfElem,
7093
- class: 'vxe-tooltip--content',
7094
- style: wrapperStyle
7095
- }, contVNs);
7013
+ dispatchEvent('click', {
7014
+ $event: evnt
7015
+ }, evnt);
7096
7016
  };
7097
- const renderVN = () => {
7098
- const {
7099
- popupClassName,
7100
- theme,
7101
- isArrow,
7102
- enterable
7103
- } = props;
7017
+ const downBtnClickEvent = (params, option) => {
7104
7018
  const {
7105
- tipActive,
7106
- visible,
7107
- tipStore
7108
- } = reactData;
7109
- const defaultSlot = slots.default;
7110
- const vSize = computeSize.value;
7111
- let ons;
7112
- if (enterable) {
7113
- ons = {
7114
- onMouseenter: wrapperMouseenterEvent,
7115
- onMouseleave: wrapperMouseleaveEvent
7116
- };
7019
+ $event
7020
+ } = params;
7021
+ hidePanel();
7022
+ dispatchEvent('dropdown-click', {
7023
+ name: option.name,
7024
+ option
7025
+ }, $event);
7026
+ };
7027
+ const mousedownDropdownEvent = evnt => {
7028
+ const isLeftBtn = evnt.button === 0;
7029
+ if (isLeftBtn) {
7030
+ evnt.stopPropagation();
7117
7031
  }
7118
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7119
- ref: refElem,
7120
- class: ['vxe-tooltip--wrapper', `theme--${theme}`, popupClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(popupClassName) ? popupClassName({
7121
- $tooltip: $xeTooltip
7122
- }) : popupClassName : '', {
7123
- [`size--${vSize}`]: vSize,
7124
- [`placement--${tipStore.placement}`]: tipStore.placement,
7125
- 'is--enterable': enterable,
7126
- 'is--visible': visible,
7127
- 'is--arrow': isArrow,
7128
- 'is--active': tipActive
7129
- }],
7130
- style: tipStore.style,
7131
- ...ons
7132
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7133
- key: 'tby',
7134
- class: 'vxe-tooltip--body'
7135
- }, [renderContent(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7136
- class: 'vxe-tooltip--arrow',
7137
- style: tipStore.arrowStyle
7138
- })]), ...(defaultSlot ? vn_getSlotVNs(defaultSlot({})) : [])]);
7139
7032
  };
7140
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.enterDelay, () => {
7141
- handleDelayFn();
7142
- });
7143
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.content, val => {
7144
- reactData.tipContent = val;
7145
- });
7146
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, val => {
7147
- if (!reactData.isUpdate) {
7148
- if (val) {
7149
- handleVisible(reactData.target || getSelectorEl(), props.content);
7150
- } else {
7151
- tooltipMethods.close();
7033
+ const clickDropdownEvent = evnt => {
7034
+ const dropdownElem = evnt.currentTarget;
7035
+ const panelElem = refBtnPanel.value;
7036
+ const {
7037
+ flag,
7038
+ targetElem
7039
+ } = getEventTargetNode(evnt, dropdownElem, 'vxe-button');
7040
+ if (flag) {
7041
+ if (panelElem) {
7042
+ panelElem.dataset.active = 'N';
7152
7043
  }
7153
- }
7154
- reactData.isUpdate = false;
7155
- });
7156
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
7157
- const contentWrapperfEl = contentWrapperfElem.value;
7158
- if (contentWrapperfEl) {
7159
- contentWrapperfEl.addEventListener('wheel', wheelEvent, {
7160
- passive: false
7161
- });
7162
- }
7163
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
7164
- const {
7165
- trigger,
7166
- content
7167
- } = props;
7168
- const wrapperElem = refElem.value;
7169
- if (wrapperElem) {
7170
- const parentNode = wrapperElem.parentNode;
7171
- if (parentNode) {
7172
- reactData.tipContent = content;
7173
- reactData.tipZindex = nextZIndex();
7174
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(wrapperElem.children, (elem, index) => {
7175
- if (index) {
7176
- parentNode.insertBefore(elem, wrapperElem);
7177
- if (!reactData.target) {
7178
- reactData.target = elem;
7179
- }
7180
- }
7181
- });
7182
- parentNode.removeChild(wrapperElem);
7183
- const {
7184
- target
7185
- } = reactData;
7186
- if (target) {
7187
- if (trigger === 'hover') {
7188
- target.onmouseenter = targetMouseenterEvent;
7189
- target.onmouseleave = targetMouseleaveEvent;
7190
- } else if (trigger === 'click') {
7191
- target.onclick = clickEvent;
7192
- }
7193
- }
7194
- if (props.modelValue) {
7195
- handleVisible(target || getSelectorEl(), content);
7196
- }
7044
+ reactData.visiblePanel = false;
7045
+ setTimeout(() => {
7046
+ if (!panelElem || panelElem.dataset.active !== 'Y') {
7047
+ reactData.isAniVisible = false;
7197
7048
  }
7198
- }
7199
- });
7200
- });
7201
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
7202
- const {
7203
- target
7204
- } = reactData;
7205
- const wrapperElem = refElem.value;
7206
- if (target) {
7207
- target.onmouseenter = null;
7208
- target.onmouseleave = null;
7209
- target.onclick = null;
7049
+ }, 350);
7050
+ dispatchEvent('dropdown-click', {
7051
+ name: targetElem.getAttribute('name'),
7052
+ option: null
7053
+ }, evnt);
7210
7054
  }
7211
- const contentWrapperfEl = contentWrapperfElem.value;
7212
- if (contentWrapperfEl) {
7213
- contentWrapperfEl.removeEventListener('wheel', wheelEvent);
7055
+ };
7056
+ const mouseenterDropdownEvent = () => {
7057
+ const panelElem = refBtnPanel.value;
7058
+ if (panelElem) {
7059
+ panelElem.dataset.active = 'Y';
7060
+ reactData.isAniVisible = true;
7061
+ setTimeout(() => {
7062
+ if (panelElem.dataset.active === 'Y') {
7063
+ reactData.visiblePanel = true;
7064
+ updateZindex();
7065
+ updatePlacement();
7066
+ setTimeout(() => {
7067
+ if (reactData.visiblePanel) {
7068
+ updatePlacement();
7069
+ }
7070
+ }, 50);
7071
+ }
7072
+ }, 20);
7214
7073
  }
7215
- if (wrapperElem) {
7216
- const parentNode = wrapperElem.parentNode;
7217
- if (parentNode) {
7218
- parentNode.removeChild(wrapperElem);
7219
- }
7074
+ };
7075
+ const mouseenterTargetEvent = evnt => {
7076
+ const {
7077
+ loading
7078
+ } = props;
7079
+ const btnDisabled = computeBtnDisabled.value;
7080
+ if (!(btnDisabled || loading)) {
7081
+ openPanel();
7082
+ mouseenterEvent(evnt);
7220
7083
  }
7221
- });
7222
- handleDelayFn();
7223
- $xeTooltip.renderVN = renderVN;
7224
- return $xeTooltip;
7225
- },
7226
- render() {
7227
- return this.renderVN();
7228
- }
7229
- }));
7230
- ;// CONCATENATED MODULE: ./packages/button/src/button.ts
7231
-
7232
-
7233
-
7234
-
7235
-
7236
-
7237
-
7238
-
7239
-
7240
-
7241
- const VxeButtonComponent = defineVxeComponent({
7242
- name: 'VxeButton',
7243
- props: {
7244
- /**
7245
- * 按钮类型
7246
- */
7247
- type: String,
7248
- mode: String,
7249
- className: [String, Function],
7250
- popupClassName: [String, Function],
7251
- /**
7252
- * 按钮尺寸
7253
- */
7254
- size: {
7255
- type: String,
7256
- default: () => getConfig().button.size || getConfig().size
7257
- },
7258
- zIndex: Number,
7259
- /**
7260
- * 用来标识这一项
7261
- */
7262
- name: [String, Number],
7263
- routerLink: Object,
7264
- /**
7265
- * 权限码
7266
- */
7267
- permissionCode: [String, Number],
7268
- /**
7269
- * 按钮内容
7270
- */
7271
- content: String,
7272
- /**
7273
- * 固定显示下拉面板的方向
7274
- */
7275
- placement: String,
7276
- /**
7277
- * 按钮状态
7278
- */
7279
- status: String,
7280
- /**
7281
- * 标题
7282
- */
7283
- title: String,
7284
- /**
7285
- * 按钮的前缀图标,属于 prefix-icon 的简写
7286
- */
7287
- icon: String,
7288
- iconRender: Object,
7289
- /**
7290
- * 按钮的前缀图标
7291
- */
7292
- prefixIcon: String,
7293
- prefixRender: Object,
7294
- /**
7295
- * 按钮的后缀图标
7296
- */
7297
- suffixIcon: String,
7298
- suffixRender: Object,
7299
- /**
7300
- * 圆角边框
7301
- */
7302
- round: Boolean,
7303
- /**
7304
- * 圆角按钮
7305
- */
7306
- circle: Boolean,
7307
- /**
7308
- * 是否禁用
7309
- */
7310
- disabled: Boolean,
7311
- /**
7312
- * 是否加载中
7313
- */
7314
- loading: Boolean,
7315
- trigger: {
7316
- type: String,
7317
- default: () => getConfig().button.trigger
7318
- },
7319
- align: String,
7320
- prefixTooltip: Object,
7321
- suffixTooltip: Object,
7322
- options: Array,
7323
- showDropdownIcon: {
7324
- type: Boolean,
7325
- default: () => getConfig().button.showDropdownIcon
7326
- },
7327
- /**
7328
- * 在下拉面板关闭时销毁内容
7329
- */
7330
- destroyOnClose: {
7331
- type: Boolean,
7332
- default: () => getConfig().button.destroyOnClose
7333
- },
7334
- /**
7335
- * 是否将弹框容器插入于 body 内
7336
- */
7337
- transfer: {
7338
- type: Boolean,
7339
- default: null
7340
- }
7341
- },
7342
- emits: ['click', 'mouseenter', 'mouseleave', 'dropdown-click', 'dropdownClick', 'contextmenu'],
7343
- setup(props, context) {
7344
- const {
7345
- slots,
7346
- emit
7347
- } = context;
7348
- const $xeModal = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeModal', null);
7349
- const $xeDrawer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeDrawer', null);
7350
- const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', null);
7351
- const $xeTree = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTree', null);
7352
- const $xeForm = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeForm', null);
7353
- const $xeButtonGroup = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeButtonGroup', null);
7354
- const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
7355
- const {
7356
- computeSize
7357
- } = useSize(props);
7358
- const {
7359
- computePermissionInfo
7360
- } = usePermission(props);
7361
- const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
7362
- initialized: false,
7363
- visiblePanel: false,
7364
- isAniVisible: false,
7365
- isActivated: false,
7366
- panelIndex: 0,
7367
- panelStyle: {},
7368
- panelPlacement: ''
7369
- });
7370
- const internalData = {
7371
- showTime: undefined,
7372
- tooltipTimeout: undefined
7373
7084
  };
7374
- const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
7375
- const refButton = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
7376
- const refBtnPanel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
7377
- const refMaps = {
7378
- refElem
7085
+ const mouseleaveTargetEvent = evnt => {
7086
+ hidePanel();
7087
+ mouseleaveEvent(evnt);
7379
7088
  };
7380
- const $xeButton = {
7381
- xID,
7382
- props,
7383
- context,
7384
- reactData,
7385
- internalData,
7386
- getRefMaps: () => refMaps
7089
+ const mouseenterEvent = evnt => {
7090
+ dispatchEvent('mouseenter', {}, evnt);
7387
7091
  };
7388
- let buttonMethods = {};
7389
- const computeBtnTransfer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
7092
+ const mouseleaveEvent = evnt => {
7093
+ dispatchEvent('mouseleave', {}, evnt);
7094
+ };
7095
+ const contextmenuEvent = evnt => {
7096
+ dispatchEvent('contextmenu', {}, evnt);
7097
+ };
7098
+ const clickTargetEvent = evnt => {
7390
7099
  const {
7391
- transfer
7100
+ loading,
7101
+ trigger
7392
7102
  } = props;
7393
- if (transfer === null) {
7394
- const globalTransfer = getConfig().button.transfer;
7395
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(globalTransfer)) {
7396
- return globalTransfer;
7397
- }
7398
- if ($xeTable || $xeTree || $xeModal || $xeDrawer || $xeForm) {
7399
- return true;
7103
+ const btnDisabled = computeBtnDisabled.value;
7104
+ if (!(btnDisabled || loading)) {
7105
+ if (trigger === 'click') {
7106
+ if (reactData.visiblePanel) {
7107
+ hidePanel();
7108
+ } else {
7109
+ openPanel();
7110
+ }
7400
7111
  }
7112
+ clickEvent(evnt);
7401
7113
  }
7402
- return transfer;
7403
- });
7404
- const computeBtnDisabled = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
7405
- const {
7406
- disabled
7407
- } = props;
7408
- const permissionInfo = computePermissionInfo.value;
7409
- return disabled || permissionInfo.disabled;
7410
- });
7411
- const computeIsFormBtn = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
7412
- const {
7413
- type
7414
- } = props;
7415
- if (type) {
7416
- return ['submit', 'reset', 'button'].indexOf(type) > -1;
7417
- }
7418
- return false;
7419
- });
7420
- const computeBtnMode = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
7114
+ };
7115
+ const openPanel = () => {
7421
7116
  const {
7422
- type,
7423
- mode
7424
- } = props;
7425
- if (mode === 'text' || type === 'text' || $xeButtonGroup && $xeButtonGroup.props.mode === 'text') {
7426
- return 'text';
7427
- }
7428
- return 'button';
7429
- });
7430
- const computeBtnStatus = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
7431
- const {
7432
- status
7433
- } = props;
7434
- if (status) {
7435
- return status;
7436
- }
7437
- if ($xeButtonGroup) {
7438
- return $xeButtonGroup.props.status;
7439
- }
7440
- return '';
7441
- });
7442
- const computeBtnAlign = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
7443
- const {
7444
- align
7445
- } = props;
7446
- if (align) {
7447
- return align;
7448
- }
7449
- if ($xeButtonGroup) {
7450
- return $xeButtonGroup.props.align;
7451
- }
7452
- return false;
7453
- });
7454
- const computeBtnRound = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
7455
- const {
7456
- round
7457
- } = props;
7458
- if (round) {
7459
- return round;
7460
- }
7461
- if ($xeButtonGroup) {
7462
- return $xeButtonGroup.props.round;
7463
- }
7464
- return false;
7465
- });
7466
- const computeBtnCircle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
7467
- const {
7468
- circle
7469
- } = props;
7470
- if (circle) {
7471
- return circle;
7472
- }
7473
- if ($xeButtonGroup) {
7474
- return $xeButtonGroup.props.circle;
7475
- }
7476
- return false;
7477
- });
7478
- const computeDownBtnList = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
7479
- const {
7480
- options
7481
- } = props;
7482
- if (options) {
7483
- return options.filter(item => {
7484
- const {
7485
- permissionCode
7486
- } = item;
7487
- return !permissionCode || permission.checkVisible(permissionCode);
7488
- });
7489
- }
7490
- return [];
7491
- });
7492
- const computePrefixTipOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
7493
- return Object.assign({}, getConfig().button.prefixTooltip, props.prefixTooltip);
7494
- });
7495
- const computeSuffixTipOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
7496
- return Object.assign({}, getConfig().button.suffixTooltip, props.suffixTooltip);
7497
- });
7498
- const updateZindex = () => {
7499
- const {
7500
- zIndex
7501
- } = props;
7502
- if (zIndex) {
7503
- reactData.panelIndex = zIndex;
7504
- } else if (reactData.panelIndex < getLastZIndex()) {
7505
- reactData.panelIndex = nextZIndex();
7506
- }
7507
- };
7508
- const updatePlacement = () => {
7509
- const {
7510
- placement
7511
- } = props;
7512
- const {
7513
- panelIndex
7514
- } = reactData;
7515
- const targetElem = refButton.value;
7516
- const panelElem = refBtnPanel.value;
7517
- const btnTransfer = computeBtnTransfer.value;
7518
- const handleStyle = () => {
7519
- const ppObj = updatePanelPlacement(targetElem, panelElem, {
7520
- placement,
7521
- teleportTo: btnTransfer
7522
- });
7523
- const panelStyle = Object.assign(ppObj.style, {
7524
- zIndex: panelIndex
7525
- });
7526
- reactData.panelStyle = panelStyle;
7527
- reactData.panelPlacement = ppObj.placement;
7528
- };
7529
- handleStyle();
7530
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(handleStyle);
7531
- };
7532
- const clickEvent = evnt => {
7533
- if ($xeButtonGroup) {
7534
- $xeButtonGroup.handleClick({
7535
- name: props.name
7536
- }, evnt);
7537
- }
7538
- dispatchEvent('click', {
7539
- $event: evnt
7540
- }, evnt);
7541
- };
7542
- const downBtnClickEvent = (params, option) => {
7543
- const {
7544
- $event
7545
- } = params;
7546
- hidePanel();
7547
- dispatchEvent('dropdown-click', {
7548
- name: option.name,
7549
- option
7550
- }, $event);
7551
- };
7552
- const mousedownDropdownEvent = evnt => {
7553
- const isLeftBtn = evnt.button === 0;
7554
- if (isLeftBtn) {
7555
- evnt.stopPropagation();
7556
- }
7557
- };
7558
- const clickDropdownEvent = evnt => {
7559
- const dropdownElem = evnt.currentTarget;
7560
- const panelElem = refBtnPanel.value;
7561
- const {
7562
- flag,
7563
- targetElem
7564
- } = getEventTargetNode(evnt, dropdownElem, 'vxe-button');
7565
- if (flag) {
7566
- if (panelElem) {
7567
- panelElem.dataset.active = 'N';
7568
- }
7569
- reactData.visiblePanel = false;
7570
- setTimeout(() => {
7571
- if (!panelElem || panelElem.dataset.active !== 'Y') {
7572
- reactData.isAniVisible = false;
7573
- }
7574
- }, 350);
7575
- dispatchEvent('dropdown-click', {
7576
- name: targetElem.getAttribute('name'),
7577
- option: null
7578
- }, evnt);
7579
- }
7580
- };
7581
- const mouseenterDropdownEvent = () => {
7582
- const panelElem = refBtnPanel.value;
7583
- if (panelElem) {
7584
- panelElem.dataset.active = 'Y';
7585
- reactData.isAniVisible = true;
7586
- setTimeout(() => {
7587
- if (panelElem.dataset.active === 'Y') {
7588
- reactData.visiblePanel = true;
7589
- updateZindex();
7590
- updatePlacement();
7591
- setTimeout(() => {
7592
- if (reactData.visiblePanel) {
7593
- updatePlacement();
7594
- }
7595
- }, 50);
7596
- }
7597
- }, 20);
7598
- }
7599
- };
7600
- const mouseenterTargetEvent = evnt => {
7601
- const {
7602
- loading
7603
- } = props;
7604
- const btnDisabled = computeBtnDisabled.value;
7605
- if (!(btnDisabled || loading)) {
7606
- openPanel();
7607
- mouseenterEvent(evnt);
7608
- }
7609
- };
7610
- const mouseleaveTargetEvent = evnt => {
7611
- hidePanel();
7612
- mouseleaveEvent(evnt);
7613
- };
7614
- const mouseenterEvent = evnt => {
7615
- dispatchEvent('mouseenter', {}, evnt);
7616
- };
7617
- const mouseleaveEvent = evnt => {
7618
- dispatchEvent('mouseleave', {}, evnt);
7619
- };
7620
- const contextmenuEvent = evnt => {
7621
- dispatchEvent('contextmenu', {}, evnt);
7622
- };
7623
- const clickTargetEvent = evnt => {
7624
- const {
7625
- loading,
7626
- trigger
7627
- } = props;
7628
- const btnDisabled = computeBtnDisabled.value;
7629
- if (!(btnDisabled || loading)) {
7630
- if (trigger === 'click') {
7631
- if (reactData.visiblePanel) {
7632
- hidePanel();
7633
- } else {
7634
- openPanel();
7635
- }
7636
- }
7637
- clickEvent(evnt);
7638
- }
7639
- };
7640
- const openPanel = () => {
7641
- const {
7642
- trigger
7117
+ trigger
7643
7118
  } = props;
7644
7119
  const panelElem = refBtnPanel.value;
7645
7120
  if (panelElem) {
@@ -7682,7 +7157,7 @@ const VxeButtonComponent = defineVxeComponent({
7682
7157
  hidePanel();
7683
7158
  };
7684
7159
  const renderTooltipIcon = (tipOpts, type) => {
7685
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(tooltip, {
7160
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(packages_tooltip, {
7686
7161
  useHTML: tipOpts.useHTML,
7687
7162
  content: tipOpts.content,
7688
7163
  enterable: tipOpts.enterable,
@@ -7833,6 +7308,7 @@ const VxeButtonComponent = defineVxeComponent({
7833
7308
  destroyOnClose,
7834
7309
  name,
7835
7310
  loading,
7311
+ shadow,
7836
7312
  showDropdownIcon
7837
7313
  } = props;
7838
7314
  const {
@@ -7884,6 +7360,7 @@ const VxeButtonComponent = defineVxeComponent({
7884
7360
  [`theme--${btnStatus}`]: btnStatus,
7885
7361
  'is--round': btnRound,
7886
7362
  'is--circle': btnCircle,
7363
+ 'is--shadow': shadow,
7887
7364
  'is--disabled': btnDisabled || loading,
7888
7365
  'is--loading': loading
7889
7366
  }],
@@ -7909,6 +7386,7 @@ const VxeButtonComponent = defineVxeComponent({
7909
7386
  [`theme--${btnStatus}`]: btnStatus,
7910
7387
  'is--round': btnRound,
7911
7388
  'is--circle': btnCircle,
7389
+ 'is--shadow': shadow,
7912
7390
  'is--disabled': btnDisabled || loading,
7913
7391
  'is--loading': loading
7914
7392
  }],
@@ -7966,90 +7444,658 @@ const VxeButtonComponent = defineVxeComponent({
7966
7444
  });
7967
7445
  }) : [])] : [])])]);
7968
7446
  }
7969
- if (routerLink) {
7970
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)('router-link'), {
7971
- ref: refButton,
7972
- class: ['vxe-button', 'vxe-button--link', `type--${btnMode}`, btnAlign ? `align--${btnAlign}` : '', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className({
7973
- $button: $xeButton
7974
- }) : className : '', {
7975
- [`size--${vSize}`]: vSize,
7976
- [`theme--${btnStatus}`]: btnStatus,
7977
- 'is--round': btnRound,
7978
- 'is--circle': btnCircle,
7979
- 'is--disabled': btnDisabled || loading,
7980
- 'is--loading': loading
7981
- }],
7982
- title,
7983
- name,
7984
- type: isFormBtn ? type : 'button',
7985
- disabled: btnDisabled || loading,
7986
- to: routerLink,
7987
- onClick: clickEvent,
7988
- onMouseenter: mouseenterEvent,
7989
- onMouseleave: mouseleaveEvent,
7990
- onContextmenu: contextmenuEvent
7991
- }, {
7992
- default() {
7993
- return renderContent();
7994
- }
7995
- });
7447
+ if (routerLink) {
7448
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)('router-link'), {
7449
+ ref: refButton,
7450
+ class: ['vxe-button', 'vxe-button--link', `type--${btnMode}`, btnAlign ? `align--${btnAlign}` : '', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className({
7451
+ $button: $xeButton
7452
+ }) : className : '', {
7453
+ [`size--${vSize}`]: vSize,
7454
+ [`theme--${btnStatus}`]: btnStatus,
7455
+ 'is--round': btnRound,
7456
+ 'is--circle': btnCircle,
7457
+ 'is--shadow': shadow,
7458
+ 'is--disabled': btnDisabled || loading,
7459
+ 'is--loading': loading
7460
+ }],
7461
+ title,
7462
+ name,
7463
+ type: isFormBtn ? type : 'button',
7464
+ disabled: btnDisabled || loading,
7465
+ to: routerLink,
7466
+ onClick: clickEvent,
7467
+ onMouseenter: mouseenterEvent,
7468
+ onMouseleave: mouseleaveEvent,
7469
+ onContextmenu: contextmenuEvent
7470
+ }, {
7471
+ default() {
7472
+ return renderContent();
7473
+ }
7474
+ });
7475
+ }
7476
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
7477
+ ref: refButton,
7478
+ class: ['vxe-button', `type--${btnMode}`, btnAlign ? `align--${btnAlign}` : '', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className({
7479
+ $button: $xeButton
7480
+ }) : className : '', {
7481
+ [`size--${vSize}`]: vSize,
7482
+ [`theme--${btnStatus}`]: btnStatus,
7483
+ 'is--round': btnRound,
7484
+ 'is--circle': btnCircle,
7485
+ 'is--shadow': shadow,
7486
+ 'is--disabled': btnDisabled || loading,
7487
+ 'is--loading': loading
7488
+ }],
7489
+ title,
7490
+ name,
7491
+ type: isFormBtn ? type : 'button',
7492
+ disabled: btnDisabled || loading,
7493
+ onClick: clickEvent,
7494
+ onMouseenter: mouseenterEvent,
7495
+ onMouseleave: mouseleaveEvent,
7496
+ onContextmenu: contextmenuEvent
7497
+ }, renderContent());
7498
+ };
7499
+ $xeButton.renderVN = renderVN;
7500
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
7501
+ if (props.type === 'text') {
7502
+ warnLog('vxe.error.delProp', ['[button] type=text', 'mode=text']);
7503
+ }
7504
+ globalEvents.on($xeButton, 'mousewheel', handleGlobalMousewheelEvent);
7505
+ globalEvents.on($xeButton, 'mousedown', handleGlobalMousedownEvent);
7506
+ globalEvents.on($xeButton, 'resize', handleGlobalResizeEvent);
7507
+ });
7508
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
7509
+ globalEvents.off($xeButton, 'mousewheel');
7510
+ globalEvents.off($xeButton, 'mousedown');
7511
+ globalEvents.off($xeButton, 'resize');
7512
+ });
7513
+ return $xeButton;
7514
+ },
7515
+ render() {
7516
+ return this.renderVN();
7517
+ }
7518
+ });
7519
+ /* harmony default export */ var src_button = (VxeButtonComponent);
7520
+ ;// CONCATENATED MODULE: ./packages/button/index.ts
7521
+
7522
+
7523
+
7524
+ const VxeButton = Object.assign({}, src_button, {
7525
+ install(app) {
7526
+ app.component(src_button.name, src_button);
7527
+ }
7528
+ });
7529
+ dynamicApp.use(VxeButton);
7530
+ index_esm_VxeUI.component(src_button);
7531
+ const Button = VxeButton;
7532
+ /* harmony default export */ var packages_button = (VxeButton);
7533
+ ;// CONCATENATED MODULE: ./packages/backtop/src/backtop.ts
7534
+
7535
+
7536
+
7537
+
7538
+
7539
+
7540
+
7541
+ function createInternalData() {
7542
+ return {
7543
+ targetEl: null
7544
+ };
7545
+ }
7546
+ function createReactData() {
7547
+ return {
7548
+ showBtn: false
7549
+ };
7550
+ }
7551
+ /* harmony default export */ var backtop = (defineVxeComponent({
7552
+ name: 'VxeBacktop',
7553
+ props: {
7554
+ target: String,
7555
+ size: {
7556
+ type: String,
7557
+ default: () => getConfig().backtop.size || getConfig().size
7558
+ },
7559
+ circle: {
7560
+ type: Boolean,
7561
+ default: () => getConfig().backtop.circle
7562
+ },
7563
+ right: {
7564
+ type: [String, Number],
7565
+ default: () => getConfig().backtop.right
7566
+ },
7567
+ bottom: {
7568
+ type: [String, Number],
7569
+ default: () => getConfig().backtop.bottom
7570
+ },
7571
+ status: {
7572
+ type: [String, Number],
7573
+ default: () => getConfig().backtop.status
7574
+ },
7575
+ icon: {
7576
+ type: String,
7577
+ default: () => getConfig().backtop.icon
7578
+ },
7579
+ showIcon: {
7580
+ type: Boolean,
7581
+ default: () => getConfig().backtop.showIcon
7582
+ },
7583
+ content: {
7584
+ type: [String, Number],
7585
+ default: () => getConfig().backtop.content
7586
+ },
7587
+ showContent: {
7588
+ type: Boolean,
7589
+ default: () => getConfig().backtop.showContent
7590
+ },
7591
+ showTop: {
7592
+ type: Boolean,
7593
+ default: () => getConfig().backtop.showTop
7594
+ },
7595
+ showBottom: {
7596
+ type: Boolean,
7597
+ default: () => getConfig().backtop.showBottom
7598
+ },
7599
+ shadow: {
7600
+ type: Boolean,
7601
+ default: () => getConfig().backtop.shadow
7602
+ },
7603
+ zIndex: {
7604
+ type: [String, Number],
7605
+ default: () => getConfig().backtop.zIndex
7606
+ },
7607
+ threshold: {
7608
+ type: [String, Number],
7609
+ default: () => getConfig().backtop.threshold
7610
+ },
7611
+ position: {
7612
+ type: String,
7613
+ default: () => getConfig().backtop.position
7614
+ }
7615
+ },
7616
+ emits: ['click'],
7617
+ setup(props, context) {
7618
+ const {
7619
+ slots,
7620
+ emit
7621
+ } = context;
7622
+ const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
7623
+ const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
7624
+ const {
7625
+ computeSize
7626
+ } = useSize(props);
7627
+ const internalData = createInternalData();
7628
+ const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(createReactData());
7629
+ const refMaps = {
7630
+ refElem
7631
+ };
7632
+ const computeWrapperStyle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
7633
+ const {
7634
+ right,
7635
+ bottom,
7636
+ zIndex
7637
+ } = props;
7638
+ const stys = {};
7639
+ if (right) {
7640
+ stys.right = toCssUnit(right);
7641
+ }
7642
+ if (bottom) {
7643
+ stys.bottom = toCssUnit(bottom);
7644
+ }
7645
+ if (zIndex) {
7646
+ stys.zIndex = zIndex;
7647
+ }
7648
+ return stys;
7649
+ });
7650
+ const computeMaps = {};
7651
+ const $xeBacktop = {
7652
+ xID,
7653
+ props,
7654
+ context,
7655
+ internalData,
7656
+ reactData,
7657
+ getRefMaps: () => refMaps,
7658
+ getComputeMaps: () => computeMaps
7659
+ };
7660
+ const dispatchEvent = (type, params, evnt) => {
7661
+ emit(type, createEvent(evnt, {
7662
+ $backtop: $xeBacktop
7663
+ }, params));
7664
+ };
7665
+ const handleScrollEvent = evnt => {
7666
+ const {
7667
+ threshold
7668
+ } = props;
7669
+ const currentEl = evnt.currentTarget;
7670
+ const scrollTop = currentEl.scrollTop;
7671
+ reactData.showBtn = scrollTop > Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold));
7672
+ };
7673
+ const handleToTop = () => {
7674
+ const {
7675
+ targetEl
7676
+ } = internalData;
7677
+ if (!targetEl) {
7678
+ return;
7679
+ }
7680
+ const scrollTop = targetEl.scrollTop;
7681
+ if (scrollTop > 0) {
7682
+ requestAnimationFrame(handleToTop);
7683
+ const currScrollTop = scrollTop - Math.max(12, scrollTop / 6);
7684
+ targetEl.scrollTop = currScrollTop > 10 ? currScrollTop : 0;
7685
+ }
7686
+ };
7687
+ const removeScrollEvent = () => {
7688
+ const {
7689
+ targetEl
7690
+ } = internalData;
7691
+ if (targetEl) {
7692
+ targetEl.removeEventListener('scroll', handleScrollEvent);
7693
+ }
7694
+ };
7695
+ const addScrollEvent = () => {
7696
+ const {
7697
+ targetEl
7698
+ } = internalData;
7699
+ if (targetEl) {
7700
+ targetEl.addEventListener('scroll', handleScrollEvent, {
7701
+ passive: true
7702
+ });
7703
+ }
7704
+ };
7705
+ const handleTargetElement = () => {
7706
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
7707
+ const {
7708
+ target
7709
+ } = props;
7710
+ if (!target) {
7711
+ removeScrollEvent();
7712
+ errLog('vxe.error.reqProp', ['target']);
7713
+ return;
7714
+ }
7715
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(target)) {
7716
+ const tEl = document.querySelector(target);
7717
+ if (!tEl) {
7718
+ errLog('vxe.error.errProp', [`target=${target}`, 'body']);
7719
+ }
7720
+ const {
7721
+ targetEl
7722
+ } = internalData;
7723
+ if (targetEl !== tEl) {
7724
+ removeScrollEvent();
7725
+ internalData.targetEl = tEl;
7726
+ addScrollEvent();
7727
+ }
7728
+ }
7729
+ });
7730
+ };
7731
+ const clickEvent = evnt => {
7732
+ handleToTop();
7733
+ dispatchEvent('click', {}, evnt);
7734
+ };
7735
+ const tagMethods = {
7736
+ dispatchEvent
7737
+ };
7738
+ const tagPrivateMethods = {};
7739
+ Object.assign($xeBacktop, tagMethods, tagPrivateMethods);
7740
+ const renderVN = () => {
7741
+ const {
7742
+ circle,
7743
+ position,
7744
+ status,
7745
+ icon,
7746
+ showIcon,
7747
+ content,
7748
+ showContent,
7749
+ showTop,
7750
+ showBottom,
7751
+ shadow
7752
+ } = props;
7753
+ const {
7754
+ showBtn
7755
+ } = reactData;
7756
+ const wrapperStyle = computeWrapperStyle.value;
7757
+ const vSize = computeSize.value;
7758
+ const defaultSlot = slots.default;
7759
+ const topSlot = slots.top;
7760
+ const bottomSlot = slots.bottom;
7761
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7762
+ ref: refElem,
7763
+ class: ['vxe-backtop', position === 'fixed' ? 'is--' + position : 'is--absolute', {
7764
+ [`size--${vSize}`]: vSize,
7765
+ 'is--visible': showBtn
7766
+ }],
7767
+ style: wrapperStyle
7768
+ }, [showTop && topSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7769
+ class: 'vxe-backtop--top-wrapper'
7770
+ }, topSlot({})) : renderEmptyElement($xeBacktop), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7771
+ class: 'vxe-backtop--content-wrapper',
7772
+ onClick: clickEvent
7773
+ }, [defaultSlot ? defaultSlot({}) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(packages_button, {
7774
+ circle,
7775
+ status,
7776
+ shadow,
7777
+ icon: showIcon ? icon || getIcon().BACKTOP_TOP : '',
7778
+ content: showContent ? content : ''
7779
+ })]]), showBottom && bottomSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7780
+ class: 'vxe-backtop--bottom-wrapper'
7781
+ }, bottomSlot({})) : renderEmptyElement($xeBacktop)]);
7782
+ };
7783
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.target, () => {
7784
+ handleTargetElement();
7785
+ });
7786
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
7787
+ handleTargetElement();
7788
+ });
7789
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
7790
+ removeScrollEvent();
7791
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(reactData, createReactData());
7792
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(internalData, createInternalData());
7793
+ });
7794
+ $xeBacktop.renderVN = renderVN;
7795
+ return $xeBacktop;
7796
+ },
7797
+ render() {
7798
+ return this.renderVN();
7799
+ }
7800
+ }));
7801
+ ;// CONCATENATED MODULE: ./packages/backtop/index.ts
7802
+
7803
+
7804
+
7805
+ const VxeBacktop = Object.assign({}, backtop, {
7806
+ install(app) {
7807
+ app.component(backtop.name, backtop);
7808
+ }
7809
+ });
7810
+ dynamicApp.use(VxeBacktop);
7811
+ index_esm_VxeUI.component(backtop);
7812
+ const Backtop = VxeBacktop;
7813
+ /* harmony default export */ var packages_backtop = (VxeBacktop);
7814
+ ;// CONCATENATED MODULE: ./packages/badge/src/badge.ts
7815
+
7816
+
7817
+
7818
+
7819
+ /* harmony default export */ var badge = (defineVxeComponent({
7820
+ name: 'VxeBadge',
7821
+ props: {
7822
+ count: [String, Number],
7823
+ dot: Boolean,
7824
+ content: [String, Number],
7825
+ size: {
7826
+ type: String,
7827
+ default: () => getConfig().badge.size || getConfig().size
7828
+ }
7829
+ },
7830
+ emits: [],
7831
+ setup(props, context) {
7832
+ const {
7833
+ emit,
7834
+ slots
7835
+ } = context;
7836
+ const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
7837
+ const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
7838
+ const {
7839
+ computeSize
7840
+ } = useSize(props);
7841
+ const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({});
7842
+ const refMaps = {
7843
+ refElem
7844
+ };
7845
+ const computeCountNum = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
7846
+ const {
7847
+ count
7848
+ } = props;
7849
+ return count ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(count) : 0;
7850
+ });
7851
+ const computeMaps = {};
7852
+ const $xeBadge = {
7853
+ xID,
7854
+ props,
7855
+ context,
7856
+ reactData,
7857
+ getRefMaps: () => refMaps,
7858
+ getComputeMaps: () => computeMaps
7859
+ };
7860
+ const dispatchEvent = (type, params, evnt) => {
7861
+ emit(type, createEvent(evnt, {
7862
+ $badge: $xeBadge
7863
+ }, params));
7864
+ };
7865
+ const collapsePaneMethods = {
7866
+ dispatchEvent
7867
+ };
7868
+ const collapsePanePrivateMethods = {};
7869
+ Object.assign($xeBadge, collapsePaneMethods, collapsePanePrivateMethods);
7870
+ const renderVN = () => {
7871
+ const {
7872
+ dot,
7873
+ content
7874
+ } = props;
7875
+ const vSize = computeSize.value;
7876
+ const countNum = computeCountNum.value;
7877
+ const defaultSlot = slots.default;
7878
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7879
+ ref: refElem,
7880
+ class: ['vxe-badge', {
7881
+ [`size--${vSize}`]: vSize,
7882
+ 'is--dot': dot
7883
+ }]
7884
+ }, [defaultSlot || content ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7885
+ class: 'vxe-badge--content'
7886
+ }, defaultSlot ? defaultSlot({}) : `${content || ''}`) : [], countNum ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
7887
+ class: 'vxe-badge--count'
7888
+ }, countNum > 99 ? '99+' : `${countNum}`) : renderEmptyElement($xeBadge)]);
7889
+ };
7890
+ $xeBadge.renderVN = renderVN;
7891
+ return $xeBadge;
7892
+ },
7893
+ render() {
7894
+ return this.renderVN();
7895
+ }
7896
+ }));
7897
+ ;// CONCATENATED MODULE: ./packages/badge/index.ts
7898
+
7899
+
7900
+
7901
+ const VxeBadge = Object.assign({}, badge, {
7902
+ install(app) {
7903
+ app.component(badge.name, badge);
7904
+ }
7905
+ });
7906
+ dynamicApp.use(VxeBadge);
7907
+ index_esm_VxeUI.component(badge);
7908
+ const Badge = VxeBadge;
7909
+ /* harmony default export */ var packages_badge = (VxeBadge);
7910
+ ;// CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb-item.ts
7911
+
7912
+
7913
+
7914
+
7915
+ /* harmony default export */ var breadcrumb_item = (defineVxeComponent({
7916
+ name: 'VxeBreadcrumbItem',
7917
+ props: {
7918
+ title: String,
7919
+ routerLink: Object
7920
+ },
7921
+ emits: [],
7922
+ setup(props, context) {
7923
+ const {
7924
+ slots
7925
+ } = context;
7926
+ const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
7927
+ const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
7928
+ const $xeBreadcrumb = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeBreadcrumb', null);
7929
+ const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({});
7930
+ const refMaps = {
7931
+ refElem
7932
+ };
7933
+ const computeSeparator = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
7934
+ if ($xeBreadcrumb) {
7935
+ return $xeBreadcrumb.props.separator;
7936
+ }
7937
+ return '';
7938
+ });
7939
+ const clickEvent = evnt => {
7940
+ if ($xeBreadcrumb) {
7941
+ const item = {
7942
+ title: props.title,
7943
+ routerLink: props.routerLink
7944
+ };
7945
+ $xeBreadcrumb.handleClickLink(evnt, item);
7996
7946
  }
7997
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
7998
- ref: refButton,
7999
- class: ['vxe-button', `type--${btnMode}`, btnAlign ? `align--${btnAlign}` : '', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className({
8000
- $button: $xeButton
8001
- }) : className : '', {
8002
- [`size--${vSize}`]: vSize,
8003
- [`theme--${btnStatus}`]: btnStatus,
8004
- 'is--round': btnRound,
8005
- 'is--circle': btnCircle,
8006
- 'is--disabled': btnDisabled || loading,
8007
- 'is--loading': loading
8008
- }],
7947
+ };
7948
+ const computeMaps = {};
7949
+ const $xeBreadcrumbItem = {
7950
+ xID,
7951
+ props,
7952
+ context,
7953
+ reactData,
7954
+ getRefMaps: () => refMaps,
7955
+ getComputeMaps: () => computeMaps
7956
+ };
7957
+ const renderVN = () => {
7958
+ const {
8009
7959
  title,
8010
- name,
8011
- type: isFormBtn ? type : 'button',
8012
- disabled: btnDisabled || loading,
8013
- onClick: clickEvent,
8014
- onMouseenter: mouseenterEvent,
8015
- onMouseleave: mouseleaveEvent,
8016
- onContextmenu: contextmenuEvent
8017
- }, renderContent());
7960
+ routerLink
7961
+ } = props;
7962
+ const separator = computeSeparator.value;
7963
+ const defaultSlot = slots.default;
7964
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
7965
+ ref: refElem,
7966
+ class: 'vxe-breadcrumb-item',
7967
+ onClick: clickEvent
7968
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
7969
+ class: 'vxe-breadcrumb-item--content'
7970
+ }, [routerLink ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)('router-link'), {
7971
+ class: 'vxe-breadcrumb-item--content-link',
7972
+ title,
7973
+ to: routerLink
7974
+ }, {
7975
+ default() {
7976
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
7977
+ class: 'vxe-breadcrumb-item--content-text'
7978
+ }, defaultSlot ? defaultSlot({}) : `${title || ''}`);
7979
+ }
7980
+ }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
7981
+ class: 'vxe-breadcrumb-item--content-text'
7982
+ }, defaultSlot ? defaultSlot({}) : `${title || ''}`)]), separator ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
7983
+ class: 'vxe-breadcrumb-item--separator'
7984
+ }, `${separator}`) : renderEmptyElement($xeBreadcrumbItem)]);
8018
7985
  };
8019
- $xeButton.renderVN = renderVN;
8020
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
8021
- if (props.type === 'text') {
8022
- warnLog('vxe.error.delProp', ['[button] type=text', 'mode=text']);
7986
+ $xeBreadcrumbItem.renderVN = renderVN;
7987
+ return $xeBreadcrumbItem;
7988
+ },
7989
+ render() {
7990
+ return this.renderVN();
7991
+ }
7992
+ }));
7993
+ ;// CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb.ts
7994
+
7995
+
7996
+
7997
+
7998
+
7999
+ /* harmony default export */ var breadcrumb = (defineVxeComponent({
8000
+ name: 'VxeBreadcrumb',
8001
+ props: {
8002
+ separator: {
8003
+ type: String,
8004
+ default: () => getConfig().breadcrumb.separator
8005
+ },
8006
+ options: Array
8007
+ },
8008
+ emits: ['click'],
8009
+ setup(props, context) {
8010
+ const {
8011
+ emit,
8012
+ slots
8013
+ } = context;
8014
+ const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
8015
+ const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
8016
+ const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({});
8017
+ const refMaps = {
8018
+ refElem
8019
+ };
8020
+ const computeMaps = {};
8021
+ const $xeBreadcrumb = {
8022
+ xID,
8023
+ props,
8024
+ context,
8025
+ reactData,
8026
+ getRefMaps: () => refMaps,
8027
+ getComputeMaps: () => computeMaps
8028
+ };
8029
+ const breadcrumbMethods = {
8030
+ dispatchEvent(type, params, evnt) {
8031
+ emit(type, createEvent(evnt, {
8032
+ $breadcrumb: $xeBreadcrumb
8033
+ }, params));
8023
8034
  }
8024
- globalEvents.on($xeButton, 'mousewheel', handleGlobalMousewheelEvent);
8025
- globalEvents.on($xeButton, 'mousedown', handleGlobalMousedownEvent);
8026
- globalEvents.on($xeButton, 'resize', handleGlobalResizeEvent);
8027
- });
8028
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
8029
- globalEvents.off($xeButton, 'mousewheel');
8030
- globalEvents.off($xeButton, 'mousedown');
8031
- globalEvents.off($xeButton, 'resize');
8032
- });
8033
- return $xeButton;
8035
+ };
8036
+ const breadcrumbPrivateMethods = {
8037
+ handleClickLink(evnt, option) {
8038
+ breadcrumbMethods.dispatchEvent('click', {
8039
+ option
8040
+ }, evnt);
8041
+ }
8042
+ };
8043
+ Object.assign($xeBreadcrumb, breadcrumbMethods, breadcrumbPrivateMethods);
8044
+ const renderItems = () => {
8045
+ const {
8046
+ options
8047
+ } = props;
8048
+ if (options && options.length) {
8049
+ return options.map(item => {
8050
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(breadcrumb_item, {
8051
+ title: item.title,
8052
+ routerLink: item.routerLink
8053
+ });
8054
+ });
8055
+ }
8056
+ return [];
8057
+ };
8058
+ const renderVN = () => {
8059
+ const defaultSlot = slots.default;
8060
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
8061
+ ref: refElem,
8062
+ class: 'vxe-breadcrumb'
8063
+ }, defaultSlot ? defaultSlot({}) : renderItems());
8064
+ };
8065
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeBreadcrumb', $xeBreadcrumb);
8066
+ $xeBreadcrumb.renderVN = renderVN;
8067
+ return $xeBreadcrumb;
8034
8068
  },
8035
8069
  render() {
8036
8070
  return this.renderVN();
8037
8071
  }
8072
+ }));
8073
+ ;// CONCATENATED MODULE: ./packages/breadcrumb/index.ts
8074
+
8075
+
8076
+
8077
+ const VxeBreadcrumb = Object.assign({}, breadcrumb, {
8078
+ install(app) {
8079
+ app.component(breadcrumb.name, breadcrumb);
8080
+ }
8038
8081
  });
8039
- /* harmony default export */ var src_button = (VxeButtonComponent);
8040
- ;// CONCATENATED MODULE: ./packages/button/index.ts
8082
+ dynamicApp.use(VxeBreadcrumb);
8083
+ index_esm_VxeUI.component(breadcrumb);
8084
+ const Breadcrumb = VxeBreadcrumb;
8085
+ /* harmony default export */ var packages_breadcrumb = (VxeBreadcrumb);
8086
+ ;// CONCATENATED MODULE: ./packages/breadcrumb-item/index.ts
8041
8087
 
8042
8088
 
8043
8089
 
8044
- const VxeButton = Object.assign({}, src_button, {
8090
+ const VxeBreadcrumbItem = Object.assign({}, breadcrumb_item, {
8045
8091
  install(app) {
8046
- app.component(src_button.name, src_button);
8092
+ app.component(breadcrumb_item.name, breadcrumb_item);
8047
8093
  }
8048
8094
  });
8049
- dynamicApp.use(VxeButton);
8050
- index_esm_VxeUI.component(src_button);
8051
- const Button = VxeButton;
8052
- /* harmony default export */ var packages_button = (VxeButton);
8095
+ dynamicApp.use(VxeBreadcrumbItem);
8096
+ index_esm_VxeUI.component(breadcrumb_item);
8097
+ const BreadcrumbItem = VxeBreadcrumbItem;
8098
+ /* harmony default export */ var packages_breadcrumb_item = (VxeBreadcrumbItem);
8053
8099
  ;// CONCATENATED MODULE: ./packages/button/src/button-group.ts
8054
8100
 
8055
8101
 
@@ -23689,19 +23735,6 @@ function destroyItem($xeForm, formItem) {
23689
23735
  }
23690
23736
  reactData.staticItems = staticItems.slice(0);
23691
23737
  }
23692
- ;// CONCATENATED MODULE: ./packages/tooltip/index.ts
23693
-
23694
-
23695
-
23696
- const VxeTooltip = Object.assign({}, tooltip, {
23697
- install(app) {
23698
- app.component(tooltip.name, tooltip);
23699
- }
23700
- });
23701
- dynamicApp.use(VxeTooltip);
23702
- index_esm_VxeUI.component(tooltip);
23703
- const Tooltip = VxeTooltip;
23704
- /* harmony default export */ var packages_tooltip = (VxeTooltip);
23705
23738
  ;// CONCATENATED MODULE: ./packages/icon/src/icon.ts
23706
23739
 
23707
23740
 
@@ -28264,6 +28297,18 @@ function layout_body_createReactData() {
28264
28297
  const vSize = computeSize.value;
28265
28298
  const defaultSlot = slots.default;
28266
28299
  const backtopSlot = slots.backtop;
28300
+ const backtopTopSlot = slots.backtopTop || slots['backtop-top'];
28301
+ const backtopBottomSlot = slots.backtopBottom || slots['backtop-bottom'];
28302
+ const backtopScopeSlots = {};
28303
+ if (backtopSlot) {
28304
+ backtopScopeSlots.default = backtopSlot;
28305
+ }
28306
+ if (backtopTopSlot) {
28307
+ backtopScopeSlots.top = backtopTopSlot;
28308
+ }
28309
+ if (backtopBottomSlot) {
28310
+ backtopScopeSlots.bottom = backtopBottomSlot;
28311
+ }
28267
28312
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
28268
28313
  ref: refElem,
28269
28314
  class: ['vxe-layout-body', {
@@ -28285,9 +28330,7 @@ function layout_body_createReactData() {
28285
28330
  /**
28286
28331
  * 回到顶部
28287
28332
  */
28288
- showBacktop ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(packages_backtop, backtopOpts, backtopSlot ? {
28289
- default: backtopSlot
28290
- } : undefined) : renderEmptyElement($xeLayoutBody)]);
28333
+ showBacktop ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(packages_backtop, backtopOpts, backtopScopeSlots) : renderEmptyElement($xeLayoutBody)]);
28291
28334
  };
28292
28335
  $xeLayoutBody.renderVN = renderVN;
28293
28336
  return $xeLayoutBody;