eoss 0.1.0-alpha.47 → 0.1.0-alpha.49

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 (117) hide show
  1. package/lib/3.js +1 -1
  2. package/lib/autocomplete.js +6 -6
  3. package/lib/ca-login.js +2 -2
  4. package/lib/calendar.js +2 -2
  5. package/lib/cascader-panel.js +2 -2
  6. package/lib/cascader.js +4 -4
  7. package/lib/code-editor.js +2 -2
  8. package/lib/collapse-item.js +2 -2
  9. package/lib/collapse.js +2 -2
  10. package/lib/color-picker.js +2 -2
  11. package/lib/cron.js +4 -4
  12. package/lib/data-table.js +366 -20
  13. package/lib/date-picker.js +3 -3
  14. package/lib/dialog.js +12 -10
  15. package/lib/drawer.js +2 -2
  16. package/lib/dropdown-item.js +23 -4
  17. package/lib/dropdown.js +4 -4
  18. package/lib/empty.js +2 -2
  19. package/lib/eoss.common.js +734 -322
  20. package/lib/flow-group.js +2 -2
  21. package/lib/flow.js +7 -7
  22. package/lib/form-editor.js +2 -2
  23. package/lib/form.js +12 -11
  24. package/lib/guide.js +2 -2
  25. package/lib/icons.js +4 -4
  26. package/lib/index.js +1 -1
  27. package/lib/input.js +2 -2
  28. package/lib/loading.js +4 -4
  29. package/lib/lowcode-view.js +2 -2
  30. package/lib/lowcode.js +7 -50
  31. package/lib/main.js +5 -5
  32. package/lib/menu-item-group.js +5 -1
  33. package/lib/menu.js +33 -43
  34. package/lib/message-box.js +4 -4
  35. package/lib/message.js +2 -2
  36. package/lib/notification.js +2 -2
  37. package/lib/pagination.js +2 -2
  38. package/lib/process-module.js +2 -2
  39. package/lib/rate.js +2 -2
  40. package/lib/scrollbar.js +71 -87
  41. package/lib/select.js +23 -13
  42. package/lib/selector-panel.js +2 -2
  43. package/lib/selector.js +16 -18
  44. package/lib/slider.js +2 -2
  45. package/lib/step.js +2 -2
  46. package/lib/steps.js +4 -4
  47. package/lib/submenu.js +16 -24
  48. package/lib/switch.js +2 -2
  49. package/lib/table-column.js +69 -3
  50. package/lib/table.js +162 -56
  51. package/lib/tabs.js +2 -2
  52. package/lib/theme-chalk/autocomplete.css +1 -1
  53. package/lib/theme-chalk/cascader-panel.css +1 -1
  54. package/lib/theme-chalk/cascader.css +1 -1
  55. package/lib/theme-chalk/data-table.css +1 -1
  56. package/lib/theme-chalk/date-picker.css +1 -1
  57. package/lib/theme-chalk/form.css +1 -1
  58. package/lib/theme-chalk/index.css +1 -1
  59. package/lib/theme-chalk/input-number.css +1 -1
  60. package/lib/theme-chalk/input.css +1 -1
  61. package/lib/theme-chalk/menu.css +1 -1
  62. package/lib/theme-chalk/message-box.css +1 -1
  63. package/lib/theme-chalk/pagination.css +1 -1
  64. package/lib/theme-chalk/scrollbar.css +1 -1
  65. package/lib/theme-chalk/select.css +1 -1
  66. package/lib/theme-chalk/selector.css +1 -1
  67. package/lib/theme-chalk/slider.css +1 -1
  68. package/lib/theme-chalk/table.css +1 -1
  69. package/lib/theme-chalk/time-picker.css +1 -1
  70. package/lib/theme-chalk/time-select.css +1 -1
  71. package/lib/theme-chalk/transfer.css +1 -1
  72. package/lib/theme-chalk/tree.css +1 -1
  73. package/lib/theme-chalk/upload.css +1 -1
  74. package/lib/time-picker.js +2 -2
  75. package/lib/time-select.js +6 -6
  76. package/lib/toolbar.js +2 -2
  77. package/lib/transfer.js +4 -4
  78. package/lib/tree.js +8 -15
  79. package/lib/upload.js +20 -20
  80. package/lib/utils/popup/popup-manager.js +24 -8
  81. package/package.json +4 -1
  82. package/packages/data-table/src/data-table.vue +43 -8
  83. package/packages/data-table/src/sizer.vue +104 -87
  84. package/packages/dialog/src/dialog.vue +4 -2
  85. package/packages/dropdown/src/dropdown-item.vue +21 -3
  86. package/packages/form/src/form.vue +5 -8
  87. package/packages/icons/src/icons.vue +2 -2
  88. package/packages/lowcode/src/util/components.js +0 -59
  89. package/packages/menu/src/menu.vue +7 -21
  90. package/packages/menu/src/mixins.js +6 -1
  91. package/packages/menu/src/submenu.vue +7 -16
  92. package/packages/scrollbar/src/main.js +64 -78
  93. package/packages/select/src/select.vue +13 -6
  94. package/packages/selector/src/selector.vue +6 -13
  95. package/packages/table/src/config.js +48 -0
  96. package/packages/table/src/store/index.js +19 -4
  97. package/packages/table/src/store/watcher.js +14 -3
  98. package/packages/table/src/table-body.js +9 -4
  99. package/packages/table/src/table-column.js +17 -3
  100. package/packages/table/src/table-footer.js +4 -2
  101. package/packages/table/src/table-header.js +9 -6
  102. package/packages/table/src/table.vue +48 -27
  103. package/packages/theme-chalk/src/data-table.scss +4 -0
  104. package/packages/theme-chalk/src/form.scss +3 -0
  105. package/packages/theme-chalk/src/input.scss +2 -2
  106. package/packages/theme-chalk/src/menu.scss +8 -0
  107. package/packages/theme-chalk/src/mixins/function.scss +61 -12
  108. package/packages/theme-chalk/src/mixins/utils.scss +12 -0
  109. package/packages/theme-chalk/src/scrollbar.scss +4 -5
  110. package/packages/theme-chalk/src/selector.scss +6 -1
  111. package/packages/theme-chalk/src/table.scss +40 -0
  112. package/packages/theme-chalk/src/tree.scss +7 -6
  113. package/packages/theme-chalk/src/upload.scss +5 -0
  114. package/packages/tree/src/tree.vue +2 -13
  115. package/packages/upload/src/upload-list.vue +5 -10
  116. package/src/index.js +1 -1
  117. package/src/utils/popup/popup-manager.js +24 -9
@@ -114,7 +114,7 @@
114
114
  </table-footer>
115
115
  </div>
116
116
  <div
117
- v-if="fixedColumns.length > 0 && !dragSort"
117
+ v-if="fixedColumns.length > 0 && !dragEnabled"
118
118
  v-mousewheel="handleFixedMousewheel"
119
119
  class="es-table__fixed"
120
120
  ref="fixedWrapper"
@@ -212,7 +212,7 @@
212
212
  </div>
213
213
  </div>
214
214
  <div
215
- v-if="rightFixedColumns.length > 0 && !dragSort"
215
+ v-if="rightFixedColumns.length > 0 && !dragEnabled"
216
216
  v-mousewheel="handleFixedMousewheel"
217
217
  class="es-table__fixed-right"
218
218
  ref="rightFixedWrapper"
@@ -666,17 +666,6 @@ export default {
666
666
  * @default 'auto'
667
667
  */
668
668
  tooltipWidth: { type: String, default: 'auto' },
669
- /**
670
- * 是否开启拖拽排序
671
- * @type {Boolean}
672
- * @default false
673
- */
674
- dragSort: Boolean,
675
- /**
676
- * 拖拽排序的类名
677
- * @type {String}
678
- */
679
- dragSortClass: String,
680
669
  /**
681
670
  * 无限滚动的回调方法
682
671
  * @type {Function}
@@ -785,13 +774,7 @@ export default {
785
774
  return this.footerHeight || this.layout.footerHeight;
786
775
  },
787
776
  scrollStyle() {
788
- const {
789
- gutterWidth,
790
- headerHeight = 0,
791
- footerHeight = 0,
792
- scrollX,
793
- scrollY
794
- } = this.layout;
777
+ const { headerHeight = 0, footerHeight = 0 } = this.layout;
795
778
  let height = 0;
796
779
  let maxHeight = 0;
797
780
  if (this.height) {
@@ -805,15 +788,14 @@ export default {
805
788
  footerHeight -
806
789
  (this.showHeader ? headerHeight : 0);
807
790
  }
791
+ // 美化滚动条时原生条已由 CSS 隐藏(见 table.scss),不占位也就无需
792
+ // 按条宽加宽/加高容器;此前的 calc(100% + gutterWidth) 在浏览器缩放时
793
+ // 和实际条宽对不上,容器右、下两侧会露出一条灰边
808
794
  return {
809
- width:
810
- gutterWidth && scrollY ? `calc(100% + ${gutterWidth}px)` : '100%',
811
- height:
812
- height && gutterWidth
813
- ? height + (scrollX ? gutterWidth : 0) + 'px'
814
- : '100%',
795
+ width: '100%',
796
+ height: height ? height + 'px' : '100%',
815
797
  maxHeight: maxHeight ? maxHeight + 'px' : '',
816
- 'overflow-x': height && gutterWidth ? '' : 'hidden'
798
+ 'overflow-x': height ? '' : 'hidden'
817
799
  };
818
800
  },
819
801
  fixedBodyHeight() {
@@ -884,6 +866,27 @@ export default {
884
866
  rightFixedColumns: 'rightFixedColumns'
885
867
  }),
886
868
 
869
+ /**
870
+ * 是否开启行拖拽排序:有 type 为 drag 的列即开启,
871
+ * 该列自己渲染拖拽手柄图标(见 config.js 的 cellForced.drag)
872
+ * @returns {Boolean}
873
+ */
874
+ dragEnabled() {
875
+ return this.columns.some((column) => column.type === 'drag');
876
+ },
877
+
878
+ /**
879
+ * 是否同时配了拖拽排序和固定列:两者互斥(开启拖拽后固定层不渲染),
880
+ * 用于给一次显式告警,避免 fixed 静默失效
881
+ * @returns {Boolean}
882
+ */
883
+ dragFixedConflict() {
884
+ return (
885
+ this.dragEnabled &&
886
+ (this.fixedColumns.length > 0 || this.rightFixedColumns.length > 0)
887
+ );
888
+ },
889
+
887
890
  // 优化类名绑定,提高模板可读性
888
891
  getTableClasses() {
889
892
  const { isComplex, data } = this.store.states;
@@ -907,6 +910,24 @@ export default {
907
910
  },
908
911
 
909
912
  watch: {
913
+ dragFixedConflict: {
914
+ immediate: true,
915
+ handler(val) {
916
+ // 固定列靠另一张浮层表渲染,Sortable 只挪主表的行,两者没法共存;
917
+ // 冲突时告警一次,避免消费方配了 fixed 却发现不生效又查不到原因
918
+ if (
919
+ val &&
920
+ process.env.NODE_ENV !== 'production' &&
921
+ !this._dragFixedWarned
922
+ ) {
923
+ this._dragFixedWarned = true;
924
+ console.warn(
925
+ '[Warn][Table]存在 type 为 drag 的列时开启行拖拽排序,左右固定列不会渲染,fixed 不生效'
926
+ );
927
+ }
928
+ }
929
+ },
930
+
910
931
  // 优化高度变化监听,使用防抖减少频繁更新
911
932
  height: {
912
933
  immediate: true,
@@ -5,4 +5,8 @@
5
5
  @include m(main) {
6
6
  height: auto !important;
7
7
  }
8
+ @include e(sizer-btn) {
9
+ padding-top: 12px;
10
+ text-align: right;
11
+ }
8
12
  }
@@ -55,6 +55,9 @@
55
55
  width: 100%;
56
56
  height: 100%;
57
57
  overflow-x: hidden;
58
+ // 这个容器在非 inline/accordion 时自身滚动,原生条用 CSS 隐藏(不占位),
59
+ // 取代原先按条宽加宽容器的做法,缩放时才不会露出灰边
60
+ @include utils-hide-scrollbar;
58
61
  }
59
62
 
60
63
  @include b(form-content) {
@@ -159,7 +159,7 @@
159
159
  transition: all 0.3s;
160
160
  pointer-events: none;
161
161
  z-index: 2;
162
- display: flex;
162
+ display: inline-flex;
163
163
  align-items: center;
164
164
  justify-content: center;
165
165
  }
@@ -196,7 +196,7 @@
196
196
  margin-left: 4px;
197
197
  }
198
198
 
199
- &:after {
199
+ &::after {
200
200
  content: '';
201
201
  height: 100%;
202
202
  width: 0;
@@ -58,8 +58,11 @@
58
58
  }
59
59
  }
60
60
  }
61
+ // 菜单容器自己滚动,原生条用 CSS 隐藏(不占位),取代原先 styles 里
62
+ // calc(100% + 条宽) 的推出补偿,缩放时才不会露出灰边
61
63
  @include b(menu-container) {
62
64
  overflow: hidden;
65
+ @include utils-hide-scrollbar;
63
66
  }
64
67
  @include b(menu-scrollbar) {
65
68
  min-width: 200px;
@@ -437,8 +440,13 @@
437
440
  overflow: hidden;
438
441
  box-shadow: $--box-shadow-light;
439
442
  border-radius: $--border-radius-base;
443
+ // popup 菜单限高后靠这个 ul 自己滚动,原生条用 CSS 隐藏(不占位),
444
+ // 取代原先 marginRight: -条宽 的抵消做法(缩放时实际条宽小于抵消量,
445
+ // popup 右/下侧会露出灰边)
440
446
  & > .es-menu--popup {
441
447
  overflow-y: auto;
448
+
449
+ @include utils-hide-scrollbar;
442
450
  }
443
451
  }
444
452
  .horizontal-collapse-transition .es-submenu__title .es-submenu__icon-arrow {
@@ -1,5 +1,6 @@
1
1
  @use 'sass:color';
2
2
  @use 'sass:string';
3
+ @use 'sass:math';
3
4
 
4
5
  @import 'config.scss';
5
6
 
@@ -85,25 +86,73 @@
85
86
 
86
87
  /* Custom mix function for CSS variables
87
88
  -------------------------- */
89
+ $_hex-digits: '0123456789abcdef';
90
+
91
+ /* 解析 hex 串中第 $i、$i+1 位(1 起)组成的字节值 */
92
+ @function hex-pair($hex, $i) {
93
+ $d1: string.index($_hex-digits, string.slice($hex, $i, $i)) - 1;
94
+ $d2: string.index($_hex-digits, string.slice($hex, $i + 1, $i + 1)) - 1;
95
+ @return $d1 * 16 + $d2;
96
+ }
97
+
98
+ /* 编译期按权重混合两个 hex 串($weight 为 $hex1 占比),返回 hex 串;
99
+ 供主题变量场景产出回退色,sass 原生 mix 吃不了字符串 */
100
+ @function mix-hex($hex1, $hex2, $weight) {
101
+ $hex1: string.to-lower-case('#{$hex1}');
102
+ $hex2: string.to-lower-case('#{$hex2}');
103
+ @if string.slice($hex1, 1, 1) == '#' {
104
+ $hex1: string.slice($hex1, 2);
105
+ }
106
+ @if string.slice($hex2, 1, 1) == '#' {
107
+ $hex2: string.slice($hex2, 2);
108
+ }
109
+ $w: math.div($weight, 1%);
110
+ $out: '#';
111
+ @for $i from 0 to 3 {
112
+ $p: 1 + $i * 2;
113
+ $v1: hex-pair($hex1, $p);
114
+ $v2: hex-pair($hex2, $p);
115
+ $v: math.round(math.div($v1 * $w + $v2 * (100 - $w), 100));
116
+ $hi: math.floor(math.div($v, 16));
117
+ $lo: $v % 16;
118
+ $out: '#{$out}#{string.slice($_hex-digits, $hi + 1, $hi + 1)}#{string.slice($_hex-digits, $lo + 1, $lo + 1)}';
119
+ }
120
+ @return $out;
121
+ }
122
+
88
123
  @function custom-mix($color1, $color2, $weight: 50%) {
89
124
  // 提取默认颜色
90
125
  $color1-extracted: extract-default-color($color1);
91
126
  $color2-extracted: extract-default-color($color2);
92
127
 
93
- // 如果提取后仍然是字符串(非CSS颜色值),直接返回
94
- @if type-of($color1-extracted) ==
95
- 'string' or
96
- type-of($color2-extracted) ==
128
+ // 两边都是实色时走原生 mix
129
+ @if type-of($color1-extracted) !=
130
+ 'string' and
131
+ type-of($color2-extracted) !=
97
132
  'string'
98
133
  {
99
- // 如果第二个颜色是CSS变量,返回第二个颜色
100
- @if type-of($color2) == 'string' and string.index($color2, 'var(') != null {
101
- @return $color2;
102
- }
103
- // 否则返回第一个颜色
104
- @return $color1;
134
+ @return color.mix($color1-extracted, $color2-extracted, $weight);
105
135
  }
106
136
 
107
- // 使用原生mix函数混合颜色
108
- @return color.mix($color1-extracted, $color2-extracted, $weight);
137
+ // 主题变量场景:编译期用默认色混出回退值,
138
+ // 不能直接返回原色(plain 背景会塌成主色自身,与文字同色)
139
+ $fallback: mix-hex($color1-extracted, $color2-extracted, $weight);
140
+
141
+ // 白 × 主题主色 的淡色:接 updateTheme 运行时设置的色板变量。
142
+ // 色板编号是 ant 式:1-5 浅色阶、6 基色、7-10 深色阶,
143
+ // 白混比例到浅色阶位置对应为 90%→1 … 50%→5,超出范围只落回退值
144
+ @if type-of($color2) ==
145
+ 'string' and
146
+ string.index($color2, 'var(') !=
147
+ null and
148
+ string.index('#{$color1-extracted}', 'ffffff') !=
149
+ null
150
+ {
151
+ $level: 10 - math.div($weight, 10%);
152
+ @if $level >= 1 and $level <= 5 and math.round($level) == $level {
153
+ $varname: string.slice($color2, 5, string.index($color2, ',') - 1);
154
+ @return string.unquote('var(#{$varname}-light-#{$level}, #{$fallback})');
155
+ }
156
+ }
157
+ @return string.unquote($fallback);
109
158
  }
@@ -37,3 +37,15 @@
37
37
  text-overflow: ellipsis;
38
38
  white-space: nowrap;
39
39
  }
40
+
41
+ // 隐藏原生滚动条,三端各一条:关键是让它不占位。
42
+ // 只有不占位,才不需要用 calc(100% + 滚动条宽) 把原生条推出容器;
43
+ // 那种补偿按固定 15px 算,浏览器缩放时实际条宽会变小,容器右/下边就露出灰边。
44
+ @mixin utils-hide-scrollbar {
45
+ -ms-overflow-style: none; // IE10/11、Edge Legacy
46
+ scrollbar-width: none; // Firefox
47
+ &::-webkit-scrollbar {
48
+ width: 0;
49
+ height: 0;
50
+ }
51
+ }
@@ -1,4 +1,5 @@
1
1
  @import 'mixins/mixins.scss';
2
+ @import 'mixins/utils.scss';
2
3
  @import 'common/var.scss';
3
4
 
4
5
  @include b(scrollbar) {
@@ -15,14 +16,12 @@
15
16
  }
16
17
 
17
18
  @include e(wrap) {
19
+ height: 100%;
18
20
  overflow: scroll;
19
21
 
20
22
  @include m(hidden-default) {
21
- scrollbar-width: none;
22
- &::-webkit-scrollbar {
23
- width: 0;
24
- height: 0;
25
- }
23
+ // 原生条不占位,也就不需要 JS 做 gutter 补偿(缩放时那条灰边的根源)
24
+ @include utils-hide-scrollbar;
26
25
  }
27
26
  @include e(view) {
28
27
  &.is-infinite-scroll {
@@ -1,5 +1,6 @@
1
1
  @import 'common/var.scss';
2
2
  @import './mixins/mixins.scss';
3
+ @import './mixins/utils.scss';
3
4
 
4
5
  @include b(selector) {
5
6
  width: 100%;
@@ -29,7 +30,8 @@
29
30
  .es-input__clear {
30
31
  position: absolute;
31
32
  left: -24px;
32
- margin-top: 1px;
33
+ top: 50%;
34
+ margin-top: -17px;
33
35
  }
34
36
  .es-input__inner {
35
37
  border: 0;
@@ -73,6 +75,9 @@
73
75
  }
74
76
  @include m(wrapper) {
75
77
  padding: 12px 12px 8px 12px;
78
+ // 限高时这个内层容器自身滚动,原生条靠 CSS 隐藏(不占位),
79
+ // 取代原先 tagsStyle 里 calc(100% + 条宽) 的推出补偿
80
+ @include utils-hide-scrollbar;
76
81
  & > span {
77
82
  padding-top: 4px;
78
83
  }
@@ -1,4 +1,5 @@
1
1
  @import 'mixins/mixins.scss';
2
+ @import 'mixins/utils.scss';
2
3
  @import 'checkbox.scss';
3
4
  @import 'tag.scss';
4
5
  @import 'tooltip.scss';
@@ -67,6 +68,27 @@
67
68
  }
68
69
  }
69
70
 
71
+ // 拖拽排序列(type: 'drag')
72
+ @include e(drag-column) {
73
+ .cell {
74
+ padding: 0;
75
+ text-align: center;
76
+ }
77
+ }
78
+
79
+ // 拖拽手柄图标,也是 Sortable 的 handle
80
+ @include e(drag-handle) {
81
+ cursor: move;
82
+ color: $--color-text-secondary;
83
+ font-size: 14px;
84
+
85
+ // rules 判定为不可拖、或行数据 fixed 为 true
86
+ @include when(disabled) {
87
+ color: $--color-text-placeholder;
88
+ cursor: not-allowed;
89
+ }
90
+ }
91
+
70
92
  @include e(expanded-cell) {
71
93
  background-color: $--color-white;
72
94
 
@@ -130,10 +152,21 @@
130
152
  }
131
153
  @include when(center) {
132
154
  text-align: center;
155
+
156
+ // 可编辑列的控件包在 es-form-item__content(display: flex)里,
157
+ // flex 子项不吃祖先的 text-align,align 会看着失效(控件贴左),
158
+ // 这里让对齐方式穿过这层容器
159
+ .es-form-item__content {
160
+ justify-content: center;
161
+ }
133
162
  }
134
163
 
135
164
  @include when(right) {
136
165
  text-align: right;
166
+
167
+ .es-form-item__content {
168
+ justify-content: flex-end;
169
+ }
137
170
  }
138
171
 
139
172
  &.gutter {
@@ -457,6 +490,13 @@
457
490
  overflow: auto;
458
491
  position: relative;
459
492
 
493
+ // 美化滚动条时(根节点带 .es-scrollbar)原生条由自定义 Bar 取代,
494
+ // 用 CSS 让它不占位;此前靠 scrollStyle 里的 calc(100% + 条宽) 把它推出
495
+ // 容器,缩放时实际条宽小于补偿量,右、下两侧会露出灰边
496
+ .es-table.es-scrollbar & {
497
+ @include utils-hide-scrollbar;
498
+ }
499
+
460
500
  // @include when(scrolling-none) {
461
501
  // ~ .es-table__fixed,
462
502
  // ~ .es-table__fixed-right {
@@ -1,4 +1,5 @@
1
1
  @import 'mixins/mixins.scss';
2
+ @import 'mixins/utils.scss';
2
3
  @import 'common/var.scss';
3
4
  @import 'common/transition.scss';
4
5
  @import 'checkbox.scss';
@@ -24,10 +25,13 @@
24
25
  border-bottom: $--border-base;
25
26
  }
26
27
  @include e(view) {
27
- $--scrollbar-width: var(--scrollbar-width);
28
28
  overflow: scroll;
29
- width: calc(100% + #{$--scrollbar-width});
30
- height: calc(100% + #{$--scrollbar-width});
29
+ width: 100%;
30
+ height: 100%;
31
+ // 树体自带限高时这个容器滚动,原生条用 CSS 隐藏(不占位),
32
+ // 取代原先按 --scrollbar-width 加宽/加高把它推出容器的做法,
33
+ // 缩放时实际条宽小于推出量,右、下两侧会露出灰边
34
+ @include utils-hide-scrollbar;
31
35
  }
32
36
  @include e(container) {
33
37
  display: inline-block;
@@ -137,9 +141,6 @@
137
141
  }
138
142
  & > label.es-radio {
139
143
  margin-right: 0;
140
- .es-radio__input {
141
- margin-top: 3px;
142
- }
143
144
  }
144
145
  &:hover {
145
146
  background-color: $--tree-node-hover-background-color;
@@ -126,6 +126,11 @@
126
126
  }
127
127
  }
128
128
  }
129
+ // 限高时 body 里这个内层容器自身滚动,原生条靠 CSS 隐藏(不占位),
130
+ // 取代原先 barStyles 里 calc(100% + 条宽) 的推出补偿,缩放时不会露出灰边
131
+ .es-upload-lists__scroll {
132
+ @include utils-hide-scrollbar;
133
+ }
129
134
  @include e(drag-icon) {
130
135
  width: 36px;
131
136
  text-align: center;
@@ -76,11 +76,7 @@ import EsTreeNode from './tree-node.vue';
76
76
  import emitter from 'eoss/src/mixins/emitter';
77
77
  import { addClass, removeClass } from 'eoss/src/utils/dom';
78
78
  import Bar from 'eoss/src/components/bar';
79
- import {
80
- getScrollbarWidth,
81
- getScrollSize,
82
- scrollMove
83
- } from 'eoss/src/utils/scrollbar';
79
+ import { getScrollSize, scrollMove } from 'eoss/src/utils/scrollbar';
84
80
  import { throttle } from 'throttle-debounce';
85
81
  import { renderIcon } from 'eoss/src/utils/util';
86
82
  import Message from 'eoss/packages/message';
@@ -398,8 +394,7 @@ export default {
398
394
  },
399
395
  styles() {
400
396
  return {
401
- height: this.height,
402
- '--scrollbar-width': `${this.scrollbarWidth}px`
397
+ height: this.height
403
398
  };
404
399
  },
405
400
 
@@ -490,10 +485,6 @@ export default {
490
485
  * 当前选中节点的键值
491
486
  */
492
487
  currentKey: '',
493
- /**
494
- * 滚动条宽度
495
- */
496
- scrollbarWidth: 0,
497
488
  /**
498
489
  * 搜索配置
499
490
  */
@@ -586,8 +577,6 @@ export default {
586
577
  },
587
578
  created() {
588
579
  !this.lazy && this.getData();
589
- // 计算并存储滚动条宽度,避免重复计算
590
- this.scrollbarWidth = getScrollbarWidth();
591
580
  this.isTree = true;
592
581
 
593
582
  this.store = new TreeStore({
@@ -27,6 +27,7 @@
27
27
  </div>
28
28
  <div class="es-upload-lists__body" :style="styles">
29
29
  <div
30
+ class="es-upload-lists__scroll"
30
31
  :style="barStyles"
31
32
  ref="container"
32
33
  @scroll="handleScroll"
@@ -151,11 +152,7 @@
151
152
  import list from './list';
152
153
  import Sortable from 'sortablejs';
153
154
  import Bar from 'eoss/src/components/bar';
154
- import {
155
- getScrollbarWidth,
156
- getScrollSize,
157
- scrollMove
158
- } from 'eoss/src/utils/scrollbar';
155
+ import { getScrollSize, scrollMove } from 'eoss/src/utils/scrollbar';
159
156
  import { throttle } from 'throttle-debounce';
160
157
 
161
158
  import EsButtonGroup from 'eoss/packages/button-group';
@@ -223,12 +220,12 @@ export default {
223
220
  }
224
221
  },
225
222
  computed: {
223
+ // 列表容器自身滚动,原生条由 CSS 隐藏(见 upload.scss 的
224
+ // .es-upload-lists__scroll),不占位也就无需按条宽加宽容器把它推出去——
225
+ // 那样在浏览器缩放时量到的 15px 和实际渲染宽度对不上,右侧会露出一条灰边
226
226
  barStyles() {
227
- // 优化:使用预计算的滚动条宽度,避免重复计算
228
227
  if (this.height && this.height !== 'auto') {
229
- const barWidth = this.scrollbarWidth;
230
228
  return {
231
- width: `calc(100% + ${barWidth}px)`,
232
229
  height: '100%',
233
230
  'overflow-y': 'scroll'
234
231
  };
@@ -251,7 +248,6 @@ export default {
251
248
  },
252
249
  data() {
253
250
  return {
254
- scrollbarWidth: 0,
255
251
  moveTo: 0,
256
252
  barSize: 0
257
253
  };
@@ -260,7 +256,6 @@ export default {
260
256
  this.updated = throttle(300, () => this.getSize());
261
257
  },
262
258
  mounted() {
263
- this.scrollbarWidth = getScrollbarWidth();
264
259
  if (this.dragSort && !this.disabled) {
265
260
  this.sortable = new Sortable(this.$refs.listContainer.$el, {
266
261
  animation: 150,
package/src/index.js CHANGED
@@ -270,7 +270,7 @@ if (typeof window !== 'undefined' && window.Vue) {
270
270
  }
271
271
 
272
272
  export default {
273
- version: '0.1.0-alpha.47',
273
+ version: '0.1.0-alpha.49',
274
274
  install,
275
275
  CollapseTransition,
276
276
  Loading,
@@ -3,12 +3,27 @@ import { addClass, removeClass } from 'eoss/src/utils/dom';
3
3
 
4
4
  let hasModal = false;
5
5
  let hasInitZIndex = false;
6
- // 跨模块副本共享的 z-index 计数器宿主。
6
+ // 跨模块副本、跨微前端沙箱共享的 z-index 计数器宿主。
7
7
  // 低代码等场景会用 eoss / eoss/src / eoss/packages 多种身份加载本文件,
8
- // 导致出现多份 PopupManager、各自从 2000 起算,出现“后弹出的层级反而比先弹出的小”。
9
- // 把计数器挂到全局,所有副本共用同一条单调递增序列。
10
- const globalScope =
11
- typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {};
8
+ // 导致出现多份 PopupManager、各自从 2000 起算,出现“后弹出的层级反而比先弹出的小”;
9
+ // wujie 下各沙箱 window 也各自持有计数器时,与主应用(及 eoss-element 的 _$zIndex)不互通,
10
+ // 子应用弹窗层级会回落到小值被主应用遮罩盖住而“弹不出来”。
11
+ // 把计数器以与 eoss-element 相同的键(_$zIndex)挂到顶层窗口,所有副本、沙箱共用同一条单调递增序列。
12
+ const getGlobalScope = function() {
13
+ if (typeof window === 'undefined') {
14
+ return typeof global !== 'undefined' ? global : {};
15
+ }
16
+ let wind = window.__WUJIE_RAW_WINDOW__ || window;
17
+ try {
18
+ while (wind !== wind.parent && wind.parent.document) {
19
+ wind = wind.parent;
20
+ }
21
+ } catch (error) {
22
+ // 跨源父窗口时停在当前窗口(iframe 独立视口下计数器本就应各自独立)
23
+ }
24
+ return wind;
25
+ };
26
+ const globalScope = getGlobalScope();
12
27
 
13
28
  const getModal = function() {
14
29
  if (Vue.prototype.$isServer) return;
@@ -165,15 +180,15 @@ Object.defineProperty(PopupManager, 'zIndex', {
165
180
  configurable: true,
166
181
  get() {
167
182
  if (!hasInitZIndex) {
168
- if (globalScope.__EOSS_ZINDEX__ === undefined) {
169
- globalScope.__EOSS_ZINDEX__ = (Vue.prototype.$EOSS || {}).zIndex || 2000;
183
+ if (globalScope._$zIndex === undefined) {
184
+ globalScope._$zIndex = (Vue.prototype.$EOSS || {}).zIndex || 2000;
170
185
  }
171
186
  hasInitZIndex = true;
172
187
  }
173
- return globalScope.__EOSS_ZINDEX__;
188
+ return globalScope._$zIndex;
174
189
  },
175
190
  set(value) {
176
- globalScope.__EOSS_ZINDEX__ = value;
191
+ globalScope._$zIndex = value;
177
192
  }
178
193
  });
179
194