vxe-table 3.15.22 → 3.15.23

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 (46) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/src/cell.js +21 -7
  6. package/es/table/src/util.js +12 -15
  7. package/es/table/style.css +15 -6
  8. package/es/table/style.min.css +1 -1
  9. package/es/ui/index.js +1 -1
  10. package/es/ui/src/dom.js +6 -0
  11. package/es/ui/src/log.js +1 -1
  12. package/es/vxe-table/style.css +15 -6
  13. package/es/vxe-table/style.min.css +1 -1
  14. package/helper/vetur/attributes.json +1 -1
  15. package/helper/vetur/tags.json +1 -1
  16. package/lib/index.css +1 -1
  17. package/lib/index.min.css +1 -1
  18. package/lib/index.umd.js +32 -23
  19. package/lib/index.umd.min.js +1 -1
  20. package/lib/style.css +1 -1
  21. package/lib/style.min.css +1 -1
  22. package/lib/table/src/cell.js +13 -7
  23. package/lib/table/src/cell.min.js +1 -1
  24. package/lib/table/src/util.js +11 -14
  25. package/lib/table/src/util.min.js +1 -1
  26. package/lib/table/style/style.css +15 -6
  27. package/lib/table/style/style.min.css +1 -1
  28. package/lib/ui/index.js +1 -1
  29. package/lib/ui/index.min.js +1 -1
  30. package/lib/ui/src/dom.js +7 -0
  31. package/lib/ui/src/dom.min.js +1 -1
  32. package/lib/ui/src/log.js +1 -1
  33. package/lib/ui/src/log.min.js +1 -1
  34. package/lib/vxe-table/style/style.css +15 -6
  35. package/lib/vxe-table/style/style.min.css +1 -1
  36. package/package.json +1 -1
  37. package/packages/table/src/cell.ts +21 -7
  38. package/packages/table/src/util.ts +12 -16
  39. package/packages/ui/src/dom.ts +7 -0
  40. package/styles/components/table.scss +23 -15
  41. /package/es/{iconfont.1746836465256.ttf → iconfont.1746863438419.ttf} +0 -0
  42. /package/es/{iconfont.1746836465256.woff → iconfont.1746863438419.woff} +0 -0
  43. /package/es/{iconfont.1746836465256.woff2 → iconfont.1746863438419.woff2} +0 -0
  44. /package/lib/{iconfont.1746836465256.ttf → iconfont.1746863438419.ttf} +0 -0
  45. /package/lib/{iconfont.1746836465256.woff → iconfont.1746863438419.woff} +0 -0
  46. /package/lib/{iconfont.1746836465256.woff2 → iconfont.1746863438419.woff2} +0 -0
@@ -1,6 +1,6 @@
1
1
  import XEUtils from 'xe-utils'
2
2
  import { ColumnInfo } from './columnInfo'
3
- import { isScale, isPx } from '../../ui/src/dom'
3
+ import { isScale, isPx, queryElement } from '../../ui/src/dom'
4
4
  import { warnLog, errLog } from '../../ui/src/log'
5
5
  import { eqEmptyValue } from '../../ui/src/utils'
6
6
 
@@ -175,7 +175,7 @@ function getPaddingLeftRightSize (elem: any) {
175
175
  return 0
176
176
  }
177
177
 
178
- function getElementMarginWidth (elem: any) {
178
+ function getElementMarginAndWidth (elem: any) {
179
179
  if (elem) {
180
180
  const computedStyle = getComputedStyle(elem)
181
181
  const marginLeft = XEUtils.toNumber(computedStyle.marginLeft)
@@ -261,10 +261,6 @@ export function getRootColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMe
261
261
  return column
262
262
  }
263
263
 
264
- function queryCellElement (cell: any, selector: any) {
265
- return cell.querySelector('.vxe-cell' + selector)
266
- }
267
-
268
264
  export function toFilters (filters: any) {
269
265
  if (filters && XEUtils.isArray(filters)) {
270
266
  return filters.map(({ label, value, data, resetValue, checked }) => {
@@ -293,19 +289,19 @@ export function getColReMinWidth (params: any) {
293
289
  const showTitle = headOverflow === 'title'
294
290
  const showTooltip = headOverflow === true || headOverflow === 'tooltip'
295
291
  const hasEllipsis = showTitle || showTooltip || showEllipsis
296
- const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.6)
297
- const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryCellElement(cell, ''))
292
+ const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.8)
293
+ const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryElement(cell, ''))
298
294
  let mWidth = minTitleWidth + paddingLeftRight
299
295
  // 默认最小宽处理
300
296
  if (hasEllipsis) {
301
- const dragIconWidth = getPaddingLeftRightSize(queryCellElement(cell, '>.vxe-cell--drag-handle'))
302
- const checkboxIconWidth = getPaddingLeftRightSize(queryCellElement(cell, '>.vxe-cell--checkbox'))
303
- const requiredIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--required-icon'))
304
- const editIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--edit-icon'))
305
- const prefixIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell-title-prefix-icon'))
306
- const suffixIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell-title-suffix-icon'))
307
- const sortIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--sort'))
308
- const filterIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--filter'))
297
+ const dragIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--drag-handle'))
298
+ const checkboxIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--checkbox'))
299
+ const requiredIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--required-icon'))
300
+ const editIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--edit-icon'))
301
+ const prefixIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell-title-prefix-icon'))
302
+ const suffixIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell-title-suffix-icon'))
303
+ const sortIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--sort'))
304
+ const filterIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--filter'))
309
305
  mWidth += dragIconWidth + checkboxIconWidth + requiredIconWidth + editIconWidth + prefixIconWidth + suffixIconWidth + filterIconWidth + sortIconWidth
310
306
  }
311
307
  // 如果设置最小宽
@@ -82,6 +82,13 @@ export function toCssUnit (val?: number | string, unit = 'px') {
82
82
  return `${val || ''}`
83
83
  }
84
84
 
85
+ export function queryElement (elem: HTMLTableCellElement, selector: string) {
86
+ if (elem) {
87
+ return elem.querySelector<HTMLElement>(selector)
88
+ }
89
+ return null
90
+ }
91
+
85
92
  export function getDomNode () {
86
93
  const documentElement = document.documentElement
87
94
  const bodyElem = document.body
@@ -776,19 +776,25 @@ $btnThemeList: (
776
776
  // user-select: none;
777
777
  &.col--ellipsis {
778
778
  & > .vxe-cell {
779
- display: flex;
780
- align-items: center;
779
+ .vxe-cell--wrapper {
780
+ display: flex;
781
+ align-items: center;
782
+ .vxe-cell--drag-handle,
783
+ .vxe-cell--sort,
784
+ .vxe-cell--filter,
785
+ .vxe-cell-title-prefix-icon,
786
+ .vxe-cell-title-suffix-icon,
787
+ .vxe-cell--checkbox,
788
+ .vxe-cell-title-suffix-icon,
789
+ .vxe-cell--required-icon {
790
+ flex-shrink: 0;
791
+ }
792
+ }
781
793
  .vxe-cell--title {
782
794
  overflow: hidden;
783
795
  text-overflow: ellipsis;
784
796
  white-space: nowrap;
785
797
  }
786
- & > i,
787
- & > span {
788
- &:not(.vxe-cell--title) {
789
- flex-shrink: 0;
790
- }
791
- }
792
798
  }
793
799
  }
794
800
  .vxe-cell--required-icon {
@@ -797,14 +803,16 @@ $btnThemeList: (
797
803
  width: 0.8em;
798
804
  height: 1em;
799
805
  line-height: 1em;
800
- font-family: Verdana,Arial,Tahoma;
801
- font-weight: normal;
802
806
  position: relative;
803
- &:before {
804
- content: "*";
805
- position: absolute;
806
- left: 0;
807
- top: 0.2em;
807
+ & > i {
808
+ font-family: Verdana,Arial,Tahoma;
809
+ font-weight: normal;
810
+ &:before {
811
+ content: "*";
812
+ position: absolute;
813
+ left: 0;
814
+ top: 0.2em;
815
+ }
808
816
  }
809
817
  }
810
818
  // .vxe-cell--required-icon,