jianghu-ui 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jianghu-ui",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "JianghuJS UI Component Library with Storybook, Vue 2, and Vuetify 2",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -117,6 +117,17 @@
117
117
  clearable
118
118
  ></v-text-field>
119
119
 
120
+ <!-- 导出按钮 -->
121
+ <v-btn
122
+ v-if="toolbarConfig.export"
123
+ icon
124
+ small
125
+ @click="handleExport"
126
+ title="导出"
127
+ >
128
+ <v-icon>mdi-export-variant</v-icon>
129
+ </v-btn>
130
+
120
131
  <!-- 刷新按钮 -->
121
132
  <v-btn
122
133
  v-if="toolbarConfig.refresh"
@@ -244,7 +255,7 @@
244
255
  :single-select="singleSelectComputed"
245
256
  :value="selectedItems"
246
257
  :item-key="rowKey"
247
- :dense="dense"
258
+ :dense="tableDense"
248
259
  :multi-sort="multiSort"
249
260
  :must-sort="mustSort"
250
261
  :sort-by="internalSortBy"
@@ -964,6 +975,7 @@ export default {
964
975
  setting: true,
965
976
  density: true,
966
977
  fullscreen: false,
978
+ export: false, // Default to false, can be enabled via prop
967
979
  ...this.toolbar
968
980
  };
969
981
  }
@@ -972,7 +984,8 @@ export default {
972
984
  refresh: true,
973
985
  setting: true,
974
986
  density: true,
975
- fullscreen: false
987
+ fullscreen: false,
988
+ export: false // Default to false
976
989
  };
977
990
  },
978
991
  // 可见的表头
@@ -992,6 +1005,15 @@ export default {
992
1005
  }
993
1006
  ];
994
1007
  },
1008
+ tableDense() {
1009
+ if (this.currentDensity === 'compact') {
1010
+ return true;
1011
+ }
1012
+ // For 'medium' and 'default', we don't use the dense prop, but a custom class.
1013
+ // But we still respect the component's `dense` prop as a baseline.
1014
+ return this.dense;
1015
+ },
1016
+
995
1017
  // 密度样式类
996
1018
  densityClass() {
997
1019
  return {
@@ -1463,6 +1485,10 @@ export default {
1463
1485
  this.emitColumnStateChange();
1464
1486
  this.$forceUpdate();
1465
1487
  },
1488
+ // 导出表格
1489
+ handleExport() {
1490
+ this.$emit('export');
1491
+ },
1466
1492
  // 刷新表格
1467
1493
  async handleRefresh() {
1468
1494
  this.$emit('refresh');
@@ -2000,6 +2026,16 @@ export default {
2000
2026
  flex: 1;
2001
2027
  }
2002
2028
 
2029
+ /* --- 密度调整 --- */
2030
+ /* 中等密度 */
2031
+ .jh-pro-table ::v-deep .jh-table-medium.v-data-table > .v-data-table__wrapper > table > thead > tr > th {
2032
+ height: 40px;
2033
+ }
2034
+ .jh-pro-table ::v-deep .jh-table-medium.v-data-table > .v-data-table__wrapper > table > tbody > tr > td {
2035
+ height: 40px;
2036
+ }
2037
+
2038
+
2003
2039
  .jh-pro-table-header-right {
2004
2040
  display: flex;
2005
2041
  align-items: center;