vary-ui 3.21.94 → 3.21.96

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 (35) hide show
  1. package/dist/{Loading-Bv8tR0Xc.js → Loading-CKkzO7yB.js} +2 -2
  2. package/dist/{Wrap-4BVYzQTq.js → Wrap-Qmz0EVW5.js} +1 -1
  3. package/dist/lib/Button/Button.js +2 -2
  4. package/dist/lib/Card/Card.js +2 -2
  5. package/dist/lib/Checkbox/Checkbox.js +2 -2
  6. package/dist/lib/CheckboxGroup/CheckboxGroup.js +3 -3
  7. package/dist/lib/Confirm/Confirm.js +2 -2
  8. package/dist/lib/Date/Date.js +4 -4
  9. package/dist/lib/Dialog/Dialog.js +1 -1
  10. package/dist/lib/Divider/Divider.js +1 -1
  11. package/dist/lib/Field/Field.js +3 -3
  12. package/dist/lib/Form/Form.js +2 -2
  13. package/dist/lib/Input/Input.js +4 -4
  14. package/dist/lib/Link/Link.js +2 -2
  15. package/dist/lib/Loading/Loading.js +3 -3
  16. package/dist/lib/Menu/Menu.js +2 -2
  17. package/dist/lib/Message/Message.js +2 -2
  18. package/dist/lib/Pagination/Pagination.js +6 -6
  19. package/dist/lib/Popover/Popover.js +2 -2
  20. package/dist/lib/Radio/Radio.js +2 -2
  21. package/dist/lib/RadioGroup/RadioGroup.js +2 -2
  22. package/dist/lib/Scene/Scene.js +1 -1
  23. package/dist/lib/Scroll/Scroll.js +2 -2
  24. package/dist/lib/Select/Select.js +6 -6
  25. package/dist/lib/Skeleton/Skeleton.js +1 -1
  26. package/dist/lib/Tab/Tab.js +2 -2
  27. package/dist/lib/TabPanel/TabPanel.js +1 -1
  28. package/dist/lib/Table/Table.js +101 -10
  29. package/dist/lib/TableColumn/TableColumn.js +1 -1
  30. package/dist/vary-ui.js +6 -6
  31. package/package.json +1 -1
  32. /package/dist/{_plugin-vue_export-helper-DU8UcXwY.js → _plugin-vue_export-helper-ChYCHfwd.js} +0 -0
  33. /package/dist/{_tslib-CQ8ndaxg.js → _tslib-CbQlnWka.js} +0 -0
  34. /package/dist/{config-DTxZ1k-y.js → config-Bcz7l5A_.js} +0 -0
  35. /package/dist/{utils-DAd86Fdr.js → utils-DgWYHc6h.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, ref, onMounted, createVNode } from 'vue';
2
- import { c as config } from './config-DTxZ1k-y.js';
3
- import { _ as _export_sfc } from './_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { c as config } from './config-Bcz7l5A_.js';
3
+ import { _ as _export_sfc } from './_plugin-vue_export-helper-ChYCHfwd.js';
4
4
 
5
5
  var _a;
6
6
  var _sfc_main = /* @__PURE__ */ defineComponent({
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, createVNode } from 'vue';
2
- import { _ as _export_sfc } from './_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { _ as _export_sfc } from './_plugin-vue_export-helper-ChYCHfwd.js';
3
3
 
4
4
  var _sfc_main = /* @__PURE__ */ defineComponent({
5
5
  props: {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, computed, createVNode } from 'vue';
2
- import { c as config } from '../../config-DTxZ1k-y.js';
2
+ import { c as config } from '../../config-Bcz7l5A_.js';
3
3
  import { Icon } from '@iconify/vue';
4
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
4
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
5
5
 
6
6
  var _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  props: {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, createVNode, createTextVNode } from 'vue';
2
- import { c as config } from '../../config-DTxZ1k-y.js';
3
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { c as config } from '../../config-Bcz7l5A_.js';
3
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
4
4
 
5
5
  var _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  props: {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, ref, watch, inject, createVNode } from 'vue';
2
- import { c as config } from '../../config-DTxZ1k-y.js';
3
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { c as config } from '../../config-Bcz7l5A_.js';
3
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
4
4
 
5
5
  var _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  props: {
@@ -1,8 +1,8 @@
1
1
  import { defineComponent, ref, watch, provide, createVNode } from 'vue';
2
- import { i as isArray } from '../../utils-DAd86Fdr.js';
2
+ import { i as isArray } from '../../utils-DgWYHc6h.js';
3
3
  import Checkbox from '../Checkbox/Checkbox.js';
4
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
5
- import '../../config-DTxZ1k-y.js';
4
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
5
+ import '../../config-Bcz7l5A_.js';
6
6
 
7
7
  var _sfc_main = /* @__PURE__ */ defineComponent({
8
8
  props: {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, ref, createVNode, createApp, h } from 'vue';
2
2
  import Button from '../Button/Button.js';
3
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
4
- import '../../config-DTxZ1k-y.js';
3
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
4
+ import '../../config-Bcz7l5A_.js';
5
5
  import '@iconify/vue';
6
6
 
7
7
  var _sfc_main = /* @__PURE__ */ defineComponent({
@@ -1,11 +1,11 @@
1
1
  import { defineComponent, shallowRef, ref, reactive, watch, createVNode, createTextVNode } from 'vue';
2
- import { n as now, e as isTime, g as isYear, h as isMonth, d as isDate, f as isDateTime } from '../../utils-DAd86Fdr.js';
2
+ import { n as now, e as isTime, g as isYear, h as isMonth, d as isDate, f as isDateTime } from '../../utils-DgWYHc6h.js';
3
3
  import Popover from '../Popover/Popover.js';
4
4
  import Scroll from '../Scroll/Scroll.js';
5
5
  import Link from '../Link/Link.js';
6
- import { W as Wrap } from '../../Wrap-4BVYzQTq.js';
7
- import { c as config } from '../../config-DTxZ1k-y.js';
8
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
6
+ import { W as Wrap } from '../../Wrap-Qmz0EVW5.js';
7
+ import { c as config } from '../../config-Bcz7l5A_.js';
8
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
9
9
 
10
10
  const weeks = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
11
11
  const months = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"].map((r, i) => {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, watch, onMounted, onBeforeUnmount, createVNode, createTextVNode } from 'vue';
2
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
3
3
 
4
4
  var _sfc_main = /* @__PURE__ */ defineComponent({
5
5
  props: {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, createVNode } from 'vue';
2
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
3
3
 
4
4
  var _sfc_main = /* @__PURE__ */ defineComponent({
5
5
  props: {
@@ -1,8 +1,8 @@
1
1
  import { defineComponent, inject, ref, onMounted, onUnmounted, provide, createVNode } from 'vue';
2
- import { _ as __awaiter } from '../../_tslib-CQ8ndaxg.js';
3
- import { c as config } from '../../config-DTxZ1k-y.js';
2
+ import { _ as __awaiter } from '../../_tslib-CbQlnWka.js';
3
+ import { c as config } from '../../config-Bcz7l5A_.js';
4
4
  import Schema from 'async-validator';
5
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
5
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
6
6
 
7
7
  var _sfc_main = /* @__PURE__ */ defineComponent({
8
8
  props: {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, ref, provide, createVNode } from 'vue';
2
- import { _ as __awaiter } from '../../_tslib-CQ8ndaxg.js';
2
+ import { _ as __awaiter } from '../../_tslib-CbQlnWka.js';
3
3
  import Schema from 'async-validator';
4
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
4
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
5
5
 
6
6
  var _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  props: {
@@ -1,8 +1,8 @@
1
1
  import { defineComponent, ref, inject, watch, createVNode } from 'vue';
2
- import { W as Wrap } from '../../Wrap-4BVYzQTq.js';
3
- import { c as isFun } from '../../utils-DAd86Fdr.js';
4
- import { c as config } from '../../config-DTxZ1k-y.js';
5
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { W as Wrap } from '../../Wrap-Qmz0EVW5.js';
3
+ import { c as isFun } from '../../utils-DgWYHc6h.js';
4
+ import { c as config } from '../../config-Bcz7l5A_.js';
5
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
6
6
 
7
7
  var _sfc_main = /* @__PURE__ */ defineComponent({
8
8
  props: {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, createVNode } from 'vue';
2
- import { c as config } from '../../config-DTxZ1k-y.js';
3
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { c as config } from '../../config-Bcz7l5A_.js';
3
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
4
4
 
5
5
  var _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  props: {
@@ -1,7 +1,7 @@
1
1
  import { shallowRef, createApp, h } from 'vue';
2
- import { L as Loading } from '../../Loading-Bv8tR0Xc.js';
3
- import { c as config } from '../../config-DTxZ1k-y.js';
4
- import '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { L as Loading } from '../../Loading-CKkzO7yB.js';
3
+ import { c as config } from '../../config-Bcz7l5A_.js';
4
+ import '../../_plugin-vue_export-helper-ChYCHfwd.js';
5
5
 
6
6
  const defaultOptions = {
7
7
  lock: false,
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, ref, watch, createVNode } from 'vue';
2
- import { k as debounce } from '../../utils-DAd86Fdr.js';
2
+ import { k as debounce } from '../../utils-DgWYHc6h.js';
3
3
  import Scroll from '../Scroll/Scroll.js';
4
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
4
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
5
5
 
6
6
  var _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  props: {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, onMounted, h, createApp } from 'vue';
2
- import { c as config } from '../../config-DTxZ1k-y.js';
3
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { c as config } from '../../config-Bcz7l5A_.js';
3
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
4
4
 
5
5
  var _sfc_main = defineComponent({
6
6
  props: {
@@ -1,15 +1,15 @@
1
1
  import { defineComponent, ref, watch, createVNode, createTextVNode } from 'vue';
2
2
  import Select from '../Select/Select.js';
3
- import { c as config } from '../../config-DTxZ1k-y.js';
4
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
5
- import '../../_tslib-CQ8ndaxg.js';
6
- import '../../utils-DAd86Fdr.js';
3
+ import { c as config } from '../../config-Bcz7l5A_.js';
4
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
5
+ import '../../_tslib-CbQlnWka.js';
6
+ import '../../utils-DgWYHc6h.js';
7
7
  import '../Popover/Popover.js';
8
- import '../../Wrap-4BVYzQTq.js';
8
+ import '../../Wrap-Qmz0EVW5.js';
9
9
  import '../Input/Input.js';
10
10
  import '../Checkbox/Checkbox.js';
11
11
  import '../Scroll/Scroll.js';
12
- import '../../Loading-Bv8tR0Xc.js';
12
+ import '../../Loading-CKkzO7yB.js';
13
13
 
14
14
  var _sfc_main = /* @__PURE__ */ defineComponent({
15
15
  props: {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, shallowRef, ref, watch, onMounted, onBeforeUnmount, createVNode, nextTick } from 'vue';
2
- import { t as throttle } from '../../utils-DAd86Fdr.js';
3
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { t as throttle } from '../../utils-DgWYHc6h.js';
3
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
4
4
 
5
5
  var _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  props: {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, ref, watch, createVNode, inject } from 'vue';
2
- import { c as config } from '../../config-DTxZ1k-y.js';
3
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { c as config } from '../../config-Bcz7l5A_.js';
3
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
4
4
 
5
5
  var _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  props: {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, ref, watch, provide, createVNode } from 'vue';
2
2
  import Radio from '../Radio/Radio.js';
3
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
4
- import '../../config-DTxZ1k-y.js';
3
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
4
+ import '../../config-Bcz7l5A_.js';
5
5
 
6
6
  var _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  props: {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, renderSlot } from 'vue';
2
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
3
3
 
4
4
  var _sfc_main = /*@__PURE__*/ defineComponent({
5
5
  __name: 'Scene',
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, shallowRef, ref, onMounted, nextTick, onBeforeUnmount, createVNode } from 'vue';
2
- import { k as debounce } from '../../utils-DAd86Fdr.js';
3
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { k as debounce } from '../../utils-DgWYHc6h.js';
3
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
4
4
 
5
5
  /**
6
6
  * note:
@@ -1,14 +1,14 @@
1
1
  import { defineComponent, ref, shallowRef, reactive, watch, onMounted, createVNode, createTextVNode, nextTick, isVNode } from 'vue';
2
- import { _ as __awaiter } from '../../_tslib-CQ8ndaxg.js';
3
- import { k as debounce } from '../../utils-DAd86Fdr.js';
2
+ import { _ as __awaiter } from '../../_tslib-CbQlnWka.js';
3
+ import { k as debounce } from '../../utils-DgWYHc6h.js';
4
4
  import Popover from '../Popover/Popover.js';
5
- import { W as Wrap } from '../../Wrap-4BVYzQTq.js';
5
+ import { W as Wrap } from '../../Wrap-Qmz0EVW5.js';
6
6
  import Input from '../Input/Input.js';
7
7
  import Checkbox from '../Checkbox/Checkbox.js';
8
8
  import Scroll from '../Scroll/Scroll.js';
9
- import { c as config } from '../../config-DTxZ1k-y.js';
10
- import { L as Loading } from '../../Loading-Bv8tR0Xc.js';
11
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
9
+ import { c as config } from '../../config-Bcz7l5A_.js';
10
+ import { L as Loading } from '../../Loading-CKkzO7yB.js';
11
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
12
12
 
13
13
  /**
14
14
  关于远程搜索:
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, createVNode } from 'vue';
2
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
3
3
 
4
4
  var _sfc_main = /* @__PURE__ */ defineComponent({
5
5
  props: {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, ref, watch, onBeforeUnmount, createVNode } from 'vue';
2
- import { m as matchChildrenCoponent } from '../../utils-DAd86Fdr.js';
2
+ import { m as matchChildrenCoponent } from '../../utils-DgWYHc6h.js';
3
3
  import TabPanel from '../TabPanel/TabPanel.js';
4
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
4
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
5
5
 
6
6
  var _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  props: {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, createVNode } from 'vue';
2
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
3
3
 
4
4
  var _sfc_main = /* @__PURE__ */ defineComponent({
5
5
  setup(_props, {
@@ -1,10 +1,10 @@
1
1
  import { defineComponent, ref, shallowRef, reactive, computed, nextTick, onMounted, watch, onBeforeMount, createVNode, createTextVNode } from 'vue';
2
- import { k as debounce, m as matchChildrenCoponent } from '../../utils-DAd86Fdr.js';
2
+ import { k as debounce, m as matchChildrenCoponent } from '../../utils-DgWYHc6h.js';
3
3
  import Checkbox from '../Checkbox/Checkbox.js';
4
4
  import Scroll from '../Scroll/Scroll.js';
5
5
  import TableColumn from '../TableColumn/TableColumn.js';
6
- import { c as config } from '../../config-DTxZ1k-y.js';
7
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
6
+ import { c as config } from '../../config-Bcz7l5A_.js';
7
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
8
8
 
9
9
  let colKey = 0;
10
10
  var _sfc_main = /* @__PURE__ */ defineComponent({
@@ -186,6 +186,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
186
186
  order: ""
187
187
  }, _props.defaultSort)); // 用来保存排序的依据
188
188
  const defineWidth = ref(0); // 定义的宽度
189
+ // 保存展开的节点key
190
+ const expandedKeys = ref(new Set());
189
191
  function getRowKey(r) {
190
192
  const rowKey = typeof _props.rowKey === "function" ? _props.rowKey({
191
193
  row: r
@@ -207,15 +209,16 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
207
209
  const result = [];
208
210
  function flatten(rows, level = 0, parentId) {
209
211
  rows.forEach(row => {
212
+ const rowKey = getRowKey(row);
210
213
  const processedRow = Object.assign(Object.assign({}, row), {
211
214
  _level: level,
212
215
  _parentId: parentId,
213
- _expanded: false,
216
+ _expanded: expandedKeys.value.has(rowKey),
214
217
  _hasChildren: row.children && row.children.length > 0
215
218
  });
216
219
  result.push(processedRow);
217
220
  if (row.children && row.children.length > 0) {
218
- flatten(row.children, level + 1, getRowKey(row));
221
+ flatten(row.children, level + 1, rowKey);
219
222
  }
220
223
  });
221
224
  }
@@ -240,6 +243,12 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
240
243
  const targetRow = processedData.value.find(item => getRowKey(item) === rowKey);
241
244
  if (targetRow) {
242
245
  targetRow._expanded = !targetRow._expanded;
246
+ // 更新展开状态集合
247
+ if (targetRow._expanded) {
248
+ expandedKeys.value.add(rowKey);
249
+ } else {
250
+ expandedKeys.value.delete(rowKey);
251
+ }
243
252
  updateChildrenVisibility(targetRow, targetRow._expanded);
244
253
  }
245
254
  }
@@ -593,7 +602,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
593
602
  function expandAll() {
594
603
  processedData.value.forEach(row => {
595
604
  if (row._hasChildren) {
605
+ const rowKey = getRowKey(row);
596
606
  row._expanded = true;
607
+ expandedKeys.value.add(rowKey);
597
608
  updateChildrenVisibility(row, true);
598
609
  }
599
610
  });
@@ -602,11 +613,81 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
602
613
  function collapseAll() {
603
614
  processedData.value.forEach(row => {
604
615
  if (row._hasChildren) {
616
+ const rowKey = getRowKey(row);
605
617
  row._expanded = false;
618
+ expandedKeys.value.delete(rowKey);
606
619
  updateChildrenVisibility(row, false);
607
620
  }
608
621
  });
609
622
  }
623
+ // 展开指定行及其所有子行
624
+ function expandRow(rowKey) {
625
+ const findAndExpand = (data, targetKey) => {
626
+ for (const row of data) {
627
+ const currentKey = getRowKey(row);
628
+ if (currentKey === targetKey) {
629
+ // 找到目标行,展开它
630
+ if (row._hasChildren) {
631
+ row._expanded = true;
632
+ expandedKeys.value.add(currentKey);
633
+ updateChildrenVisibility(row, true);
634
+ }
635
+ return true;
636
+ }
637
+ // 如果有子行,递归查找
638
+ if (row.children && row.children.length > 0) {
639
+ if (findAndExpand(row.children, targetKey)) {
640
+ // 如果子行中找到了目标行,展开当前行
641
+ row._expanded = true;
642
+ expandedKeys.value.add(currentKey);
643
+ updateChildrenVisibility(row, true);
644
+ return true;
645
+ }
646
+ }
647
+ }
648
+ return false;
649
+ };
650
+ findAndExpand(originData, rowKey);
651
+ }
652
+ // 收起指定行及其所有子行
653
+ function collapseRow(rowKey) {
654
+ const findAndCollapse = (data, targetKey) => {
655
+ for (const row of data) {
656
+ const currentKey = getRowKey(row);
657
+ if (currentKey === targetKey) {
658
+ // 找到目标行,收起它
659
+ if (row._hasChildren) {
660
+ row._expanded = false;
661
+ expandedKeys.value.delete(currentKey);
662
+ updateChildrenVisibility(row, false);
663
+ }
664
+ return true;
665
+ }
666
+ // 如果有子行,递归查找
667
+ if (row.children && row.children.length > 0) {
668
+ if (findAndCollapse(row.children, targetKey)) {
669
+ // 如果子行中找到了目标行,收起当前行
670
+ row._expanded = false;
671
+ expandedKeys.value.delete(currentKey);
672
+ updateChildrenVisibility(row, false);
673
+ return true;
674
+ }
675
+ }
676
+ }
677
+ return false;
678
+ };
679
+ findAndCollapse(originData, rowKey);
680
+ }
681
+ // 获取当前展开的节点
682
+ function getExpandedKeys() {
683
+ return Array.from(expandedKeys.value);
684
+ }
685
+ // 设置展开的节点
686
+ function setExpandedKeys(keys) {
687
+ expandedKeys.value = new Set(keys);
688
+ // 重新处理数据以应用新的展开状态
689
+ processedData.value = processTableData(originData);
690
+ }
610
691
  _expose({
611
692
  toggleAllSelection,
612
693
  toggleRowSelection,
@@ -616,8 +697,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
616
697
  setSort,
617
698
  clearSort,
618
699
  expandAll,
619
- // 添加展开所有行方法
620
- collapseAll // 添加收起所有行方法
700
+ collapseAll,
701
+ expandRow,
702
+ collapseRow,
703
+ getExpandedKeys,
704
+ setExpandedKeys
621
705
  });
622
706
  onMounted(() => {
623
707
  init();
@@ -769,8 +853,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
769
853
  const rowKey = getRowKey(r);
770
854
  const hasChildren = r._hasChildren;
771
855
  const isExpanded = isRowExpanded(r);
772
- const indent = r._level * 20; // 每级缩进20px
773
- const showExpandCol = _props.expandProp && c.prop === _props.expandProp && hasChildren;
856
+ let indent = r._level * 10; // 每级缩进20px
857
+ let showExpandIcon = false;
858
+ if (_props.expandProp && c.prop === _props.expandProp) {
859
+ if (hasChildren) {
860
+ showExpandIcon = true;
861
+ } else {
862
+ indent += 20;
863
+ }
864
+ }
774
865
  let body = null;
775
866
  if (c.td) {
776
867
  body = c.td({
@@ -848,7 +939,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
848
939
  "style": {
849
940
  "text-align": c.align || "unset"
850
941
  }
851
- }, [showExpandCol && createVNode("span", {
942
+ }, [showExpandIcon && createVNode("span", {
852
943
  "class": ["v_table_expand_icon", {
853
944
  "v_table_expand_icon--expanded": isExpanded
854
945
  }],
@@ -1,5 +1,5 @@
1
1
  import { defineComponent } from 'vue';
2
- import { _ as _export_sfc } from '../../_plugin-vue_export-helper-DU8UcXwY.js';
2
+ import { _ as _export_sfc } from '../../_plugin-vue_export-helper-ChYCHfwd.js';
3
3
 
4
4
  var _sfc_main = /* @__PURE__ */ defineComponent({
5
5
  props: {
package/dist/vary-ui.js CHANGED
@@ -17,7 +17,7 @@ import Scroll from './lib/Scroll/Scroll.js';
17
17
  import Select from './lib/Select/Select.js';
18
18
  import Skeleton from './lib/Skeleton/Skeleton.js';
19
19
  import { defineComponent, ref, watch, createVNode, onMounted, onBeforeUnmount, createTextVNode, createApp, h } from 'vue';
20
- import { _ as _export_sfc } from './_plugin-vue_export-helper-DU8UcXwY.js';
20
+ import { _ as _export_sfc } from './_plugin-vue_export-helper-ChYCHfwd.js';
21
21
  import Tab from './lib/Tab/Tab.js';
22
22
  import Table from './lib/Table/Table.js';
23
23
  import TableColumn from './lib/TableColumn/TableColumn.js';
@@ -27,13 +27,13 @@ import RadioGroup from './lib/RadioGroup/RadioGroup.js';
27
27
  export { default as Message } from './lib/Message/Message.js';
28
28
  export { default as Confirm } from './lib/Confirm/Confirm.js';
29
29
  import './lib/Loading/Loading.js';
30
- import { c as config, s as setConfig } from './config-DTxZ1k-y.js';
30
+ import { c as config, s as setConfig } from './config-Bcz7l5A_.js';
31
31
  import { Icon } from '@iconify/vue';
32
32
  export { Icon } from '@iconify/vue';
33
- export { k as debounce, i as isArray, b as isBoolean, d as isDate, f as isDateTime, c as isFun, h as isMonth, j as isNumber, a as isObject, e as isTime, g as isYear, m as matchChildrenCoponent, n as now, t as throttle } from './utils-DAd86Fdr.js';
34
- import { L as Loading } from './Loading-Bv8tR0Xc.js';
35
- import './Wrap-4BVYzQTq.js';
36
- import './_tslib-CQ8ndaxg.js';
33
+ export { k as debounce, i as isArray, b as isBoolean, d as isDate, f as isDateTime, c as isFun, h as isMonth, j as isNumber, a as isObject, e as isTime, g as isYear, m as matchChildrenCoponent, n as now, t as throttle } from './utils-DgWYHc6h.js';
34
+ import { L as Loading } from './Loading-CKkzO7yB.js';
35
+ import './Wrap-Qmz0EVW5.js';
36
+ import './_tslib-CbQlnWka.js';
37
37
  import 'async-validator';
38
38
 
39
39
  var _sfc_main$2 = /* @__PURE__ */ defineComponent({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vary-ui",
3
- "version": "3.21.94",
3
+ "version": "3.21.96",
4
4
  "description": "vary-ui base vue3",
5
5
  "homepage": "https://varyui.com",
6
6
  "main": "dist/vary-ui.js",
File without changes
File without changes
File without changes