stellar-ui-plus 1.17.22 → 1.17.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.
@@ -29,6 +29,7 @@
29
29
  | `maxHeight` | 表格最大高度 | `number / string` | - | - | - |
30
30
  | `selectionIconColor` | 配置选择项图标色 | `object` | - | - | - |
31
31
  | `isPopover` | 是否为超出单元格时气泡显示内容 | `boolean` | - | - | - |
32
+ | `popoverLine` | 单元格开启isPopover时,超过多少行才显示省略提示 | `number / string` | - | - | - |
32
33
 
33
34
 
34
35
  #### Events
@@ -45,7 +45,8 @@ const tableProps = {
45
45
  type: Object as PropType<typeof SELECTION_COLOR_CONFIG>,
46
46
  default: () => SELECTION_COLOR_CONFIG,
47
47
  },
48
- isPopover: [Boolean, null],
48
+ isPopover: [Boolean, null], // 单元格是否开启内容超长时省略显示并长按显示提示
49
+ popoverLine: { type: [Number, String], default: 1 }, // 单元格开启isPopover时,超过多少行才显示省略提示
49
50
  };
50
51
 
51
52
  export type TableProps = ExtractPropTypes<typeof tableProps>;
@@ -158,6 +158,11 @@
158
158
  "description": "是否为超出单元格时气泡显示内容",
159
159
  "type": "boolean"
160
160
  },
161
+ {
162
+ "name": "popoverLine",
163
+ "description": "单元格开启isPopover时,超过多少行才显示省略提示",
164
+ "type": "number | string"
165
+ },
161
166
  {
162
167
  "name": "[event]select",
163
168
  "description": "当用户手动勾选数据行的 Checkbox 时触发的事件",
@@ -9,9 +9,6 @@ import { groupByKeys } from './utils';
9
9
  import { useColorStore } from '../../store/color';
10
10
  let { getColor } = useColorStore();
11
11
 
12
- let tableLength = 0;
13
- let uuid = utils.guid();
14
-
15
12
  const componentName = `ste-table`;
16
13
  defineOptions({
17
14
  name: componentName,
@@ -70,6 +67,7 @@ const cmpRootStyle = computed(() => {
70
67
  '--table-height': utils.addUnit(props.height as string),
71
68
  '--table-max-height': utils.addUnit(props.maxHeight as string),
72
69
  '--ste-theme-color': utils.Color.hex2rgba(getColor().steThemeColor),
70
+ '--ste-table-popover-line': props.popoverLine,
73
71
  };
74
72
  return style;
75
73
  });
@@ -96,7 +94,6 @@ const cmpShowFixedPlaceholder = computed(() => {
96
94
  });
97
95
 
98
96
  const dataChangeFun = (fullLength: number = 0, val: any) => {
99
- tableLength = val.length;
100
97
  // 由于没有数据时会导致插槽无法渲染,然后表头无法显示,所以在无数据时先给默认值,让表头能渲染,再加延时,恢复成原来的数据
101
98
  if (val.length === 0) {
102
99
  tableData.value = [{}];
@@ -262,7 +259,7 @@ defineExpose({ clearSelection, toggleAllSelection, toggleRowSelection, getSelect
262
259
  </script>
263
260
 
264
261
  <template>
265
- <view class="ste-table-root" :class="[cmpRootClass]" :style="[cmpRootStyle]" v-if="tableData.length > 0" :id="'ste-table-' + uuid">
262
+ <view class="ste-table-root" :class="[cmpRootClass]" :style="[cmpRootStyle]">
266
263
  <view class="ste-table-content">
267
264
  <view class="fixed-placeholder" v-if="cmpShowFixedPlaceholder" />
268
265
  <view class="ste-table-header" :class="[getHeaderRowClass()]" :style="[getHeaderRowStyle() as CSSProperties]" v-if="showHeader">
@@ -153,7 +153,7 @@ function cellClick(this: any, event: any) {
153
153
  <template v-if="!parentProps.isPopover">
154
154
  {{ cellText() }}
155
155
  </template>
156
- <table-popover v-else :text="cellText()"></table-popover>
156
+ <table-popover v-else :text="cellText()" :line="parentProps.popoverLine"></table-popover>
157
157
  </view>
158
158
  </slot>
159
159
  <view class="cell-box" v-else>
@@ -9,6 +9,10 @@ const props = defineProps({
9
9
  type: [String, null],
10
10
  default: '',
11
11
  },
12
+ line: {
13
+ type: [Number, String],
14
+ default: 1,
15
+ }, // 配置超过多少行后才显示
12
16
  });
13
17
 
14
18
  const instance = getCurrentInstance() as unknown as ComponentPublicInstance;
@@ -38,7 +42,7 @@ const checkTextOverflow = async () => {
38
42
  let textData = await utils.querySelector<false>('.measure-text', instance);
39
43
 
40
44
  if (containerData && textData && textData.width && containerData.width) {
41
- isTextOverflow.value = textData.width > containerData.width;
45
+ isTextOverflow.value = textData.width > containerData.width * Number(props.line);
42
46
  }
43
47
  };
44
48
 
@@ -141,9 +145,13 @@ const doHide = () => {
141
145
  }
142
146
 
143
147
  .ellipsis-box {
144
- white-space: nowrap;
148
+ display: -webkit-box;
149
+ -webkit-line-clamp: var(--ste-table-popover-line);
150
+ line-clamp: var(--ste-table-popover-line);
151
+ -webkit-box-orient: vertical;
145
152
  overflow: hidden;
146
153
  text-overflow: ellipsis;
154
+ word-break: break-word;
147
155
  // #ifdef H5
148
156
  user-select: none;
149
157
  // #endif
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stellar-ui-plus",
3
- "version": "1.17.22",
3
+ "version": "1.17.23",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "MIT",