@sdata/web-vue 1.10.0 → 1.11.1

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/dist/sd.css +148 -952
  2. package/dist/sd.min.css +1 -1
  3. package/es/_components/input-label/style/input-label.scss +11 -51
  4. package/es/_components/select-view/select-view.d.ts +1 -1
  5. package/es/_components/select-view/style/index.css +0 -84
  6. package/es/_components/virtual-list/interface.d.ts +10 -1
  7. package/es/{table/hooks/use-table-virtual-size.d.ts → _components/virtual-list/use-virtual-size.d.ts} +4 -2
  8. package/es/{table/hooks/use-table-virtual-size.js → _components/virtual-list/use-virtual-size.js} +17 -20
  9. package/es/_components/virtual-list/virtual-list.js +64 -2
  10. package/es/_components/virtual-list/virtual-list.vue.d.ts +208 -0
  11. package/es/_components/virtual-list/virtual-list.vue_vue_type_script_lang.js +277 -5
  12. package/es/_utils/clipboard.js +2 -1
  13. package/es/auto-complete/auto-complete.d.ts +1 -1
  14. package/es/auto-complete/index.d.ts +24 -15
  15. package/es/auto-complete/style/index.css +0 -16
  16. package/es/auto-complete/style/index.scss +11 -26
  17. package/es/badge/style/index.scss +11 -41
  18. package/es/button/style/index.css +35 -445
  19. package/es/button/style/index.scss +57 -332
  20. package/es/card/style/index.scss +18 -52
  21. package/es/carousel/index.d.ts +1 -0
  22. package/es/cascader/cascader-panel.vue.d.ts +1 -1
  23. package/es/cascader/cascader.vue.d.ts +3 -3
  24. package/es/cascader/index.d.ts +10 -10
  25. package/es/cascader/interface.d.ts +5 -0
  26. package/es/color-picker/style/index.scss +17 -99
  27. package/es/config-provider/config-provider.vue.d.ts +1 -1
  28. package/es/config-provider/index.d.ts +4 -3
  29. package/es/date-picker/index.d.ts +21 -14
  30. package/es/date-picker/panels/date/index.vue.d.ts +1 -1
  31. package/es/date-picker/panels/week/index.vue.d.ts +7 -7
  32. package/es/date-picker/picker.vue.d.ts +1 -1
  33. package/es/date-picker/range-picker.vue.d.ts +1 -1
  34. package/es/descriptions/descriptions.d.ts +1 -1
  35. package/es/descriptions/index.d.ts +4 -4
  36. package/es/descriptions/style/index.scss +18 -63
  37. package/es/form/style/index.css +12 -176
  38. package/es/form/style/status.scss +36 -73
  39. package/es/index.css +148 -952
  40. package/es/index.d.ts +21 -20
  41. package/es/input/style/input.scss +14 -66
  42. package/es/input-number/index.d.ts +5 -0
  43. package/es/input-tag/style/index.css +0 -84
  44. package/es/input-tag/style/input-tag.scss +16 -170
  45. package/es/list/style/index.scss +12 -42
  46. package/es/menu/index.d.ts +8 -0
  47. package/es/menu/style/index.css +0 -178
  48. package/es/menu/style/index.scss +36 -139
  49. package/es/pagination/index.d.ts +3 -3
  50. package/es/pagination/interface.d.ts +2 -1
  51. package/es/pagination/page-options.js +1 -1
  52. package/es/pagination/page-options.vue.d.ts +72 -71
  53. package/es/pagination/page-options.vue_vue_type_script_lang.js +6 -0
  54. package/es/pagination/pagination.d.ts +3 -3
  55. package/es/pagination/style/index.css +0 -12
  56. package/es/pagination/style/index.scss +19 -76
  57. package/es/radio/index.d.ts +3 -0
  58. package/es/result/style/index.css +0 -16
  59. package/es/result/style/index.scss +12 -34
  60. package/es/select/index.d.ts +9 -9
  61. package/es/select/interface.d.ts +2 -1
  62. package/es/select/select.d.ts +3 -3
  63. package/es/slider/index.d.ts +6 -3
  64. package/es/slider/slider.vue.d.ts +1 -1
  65. package/es/steps/index.d.ts +2 -0
  66. package/es/switch/index.d.ts +3 -0
  67. package/es/table/context.d.ts +1 -1
  68. package/es/table/hooks/use-column-resize.d.ts +2 -3
  69. package/es/table/hooks/use-column-resize.js +48 -21
  70. package/es/table/hooks/use-drag.d.ts +4 -2
  71. package/es/table/hooks/use-drag.js +16 -2
  72. package/es/table/index.d.ts +22 -34
  73. package/es/table/interface.d.ts +21 -2
  74. package/es/table/style/index.css +97 -21
  75. package/es/table/style/index.scss +137 -125
  76. package/es/table/table-operation-td.d.ts +2 -2
  77. package/es/table/table-operation-td.js +4 -5
  78. package/es/table/table-operation-th.js +4 -4
  79. package/es/table/table-tbody.js +1 -1
  80. package/es/table/table-td.js +5 -6
  81. package/es/table/table-th.js +25 -24
  82. package/es/table/table-thead.js +1 -1
  83. package/es/table/table-tr.js +1 -1
  84. package/es/table/table.d.ts +12 -16
  85. package/es/table/table.js +399 -190
  86. package/es/tabs/index.d.ts +1 -0
  87. package/es/tabs/style/index.scss +53 -135
  88. package/es/tag/index.d.ts +3 -3
  89. package/es/tag/style/index.css +0 -84
  90. package/es/tag/style/index.scss +19 -146
  91. package/es/tag/tag.vue.d.ts +1 -1
  92. package/es/theme-provider/index.d.ts +9 -9
  93. package/es/time-picker/index.d.ts +1 -0
  94. package/es/timeline/index.d.ts +1 -0
  95. package/es/transfer/index.d.ts +1 -0
  96. package/es/transfer/interface.d.ts +1 -1
  97. package/es/tree/hooks/use-tree-data.d.ts +17 -29
  98. package/es/tree/index.d.ts +6 -1
  99. package/es/tree/interface.d.ts +2 -0
  100. package/es/tree/tree.js +1 -1
  101. package/es/tree/tree.vue.d.ts +3561 -13
  102. package/es/tree/tree.vue_vue_type_script_lang.js +21 -9
  103. package/es/tree-select/hooks/use-selected-state.js +3 -1
  104. package/es/tree-select/index.d.ts +3 -0
  105. package/es/tree-select/tree-select.vue.d.ts +1367 -3
  106. package/json/vetur-attributes.json +1 -6
  107. package/json/vetur-tags.json +0 -1
  108. package/json/web-types.json +7 -11
  109. package/package.json +1 -1
  110. package/es/style/theme/legacy-less-var.scss +0 -15
  111. package/es/table/table-col-group.js +0 -21
  112. package/es/table/table-col-group.vue_vue_type_script_lang.js +0 -32
  113. package/es/table/table-legacy-virtual-list.js +0 -47
  114. package/es/table/table-legacy-virtual-list.vue.d.ts +0 -156
  115. package/es/table/table-legacy-virtual-list.vue_vue_type_script_lang.js +0 -148
  116. package/es/table/table-virtual-list-item.d.ts +0 -22
  117. package/es/table/table-virtual-list-item.js +0 -37
@@ -11,7 +11,7 @@ import useCheckedState from "./hooks/use-checked-state.js";
11
11
  import { isLeafNode, isNodeExpandable, isNodeSelectable } from "./utils/index.js";
12
12
  import useTreeData from "./hooks/use-tree-data.js";
13
13
  import node_default from "./node.js";
14
- import { computed, defineComponent, provide, reactive, ref, toRefs } from "vue";
14
+ import { computed, defineComponent, provide, reactive, ref, toRefs, watch } from "vue";
15
15
  //#region components/tree/tree.vue?vue&type=script&lang.ts
16
16
  var TREE_VIRTUAL_ITEM_SIZE = {
17
17
  mini: 24,
@@ -120,10 +120,6 @@ var tree_vue_vue_type_script_lang_default = defineComponent({
120
120
  },
121
121
  `${prefixCls}-size-${size.value}`
122
122
  ]);
123
- const isDynamicVirtualList = computed(() => {
124
- if (!virtualListProps.value) return false;
125
- return virtualListProps.value.itemSize === void 0 && virtualListProps.value.minItemSize !== void 0;
126
- });
127
123
  const resolvedVirtualListProps = computed(() => {
128
124
  if (!virtualListProps.value) return;
129
125
  const nextVirtualListProps = _objectSpread2({}, virtualListProps.value);
@@ -133,7 +129,7 @@ var tree_vue_vue_type_script_lang_default = defineComponent({
133
129
  });
134
130
  const enableVirtualExpandAnimation = computed(() => {
135
131
  if (!virtualListProps.value) return animation.value;
136
- return animation.value && isDynamicVirtualList.value;
132
+ return false;
137
133
  });
138
134
  const treeStyle = computed(() => {
139
135
  if (!virtualListProps.value || virtualListProps.value.height !== void 0) return;
@@ -142,6 +138,9 @@ var tree_vue_vue_type_script_lang_default = defineComponent({
142
138
  minHeight: 0
143
139
  };
144
140
  });
141
+ const virtualListRef = ref(null);
142
+ const virtualListVersion = ref(0);
143
+ const virtualListKey = computed(() => `tree-virtual-list-${virtualListVersion.value}`);
145
144
  const switcherIcon = usePickSlots(slots, "switcher-icon");
146
145
  const loadingIcon = usePickSlots(slots, "loading-icon");
147
146
  const dragIcon = usePickSlots(slots, "drag-icon");
@@ -197,17 +196,29 @@ var tree_vue_vue_type_script_lang_default = defineComponent({
197
196
  return [];
198
197
  }
199
198
  const [expandedKeys, setExpandState] = useMergeState(getDefaultExpandedKeys(), reactive({ value: propExpandedKeys }));
199
+ watch(() => expandedKeys.value.join(","), () => {
200
+ if (!virtualListProps.value || enableVirtualExpandAnimation.value) return;
201
+ virtualListVersion.value += 1;
202
+ });
200
203
  const currentExpandKeys = ref([]);
201
204
  const visibleTreeNodeList = computed(() => {
202
205
  const expandedKeysSet = new Set(expandedKeys.value);
203
206
  const currentExpandKeysSet = new Set(currentExpandKeys.value);
204
- return flattenTreeData.value.filter((node) => {
207
+ const filteredNodeList = flattenTreeData.value.filter((node) => {
205
208
  var _node$pathParentKeys;
206
209
  if (!(!filterTreeNode || !filterTreeNode.value || (filterTreeNode === null || filterTreeNode === void 0 ? void 0 : filterTreeNode.value(node.treeNodeData)))) return false;
207
210
  const isRoot = isUndefined(node.parentKey);
208
211
  const isVisibleNode = (_node$pathParentKeys = node.pathParentKeys) === null || _node$pathParentKeys === void 0 ? void 0 : _node$pathParentKeys.every((_key) => expandedKeysSet.has(_key) && !currentExpandKeysSet.has(_key));
209
212
  return isRoot || isVisibleNode;
210
213
  });
214
+ const uniqueNodeList = [];
215
+ const seenNodeKeys = /* @__PURE__ */ new Set();
216
+ filteredNodeList.forEach((node) => {
217
+ if (seenNodeKeys.has(node.key)) return;
218
+ seenNodeKeys.add(node.key);
219
+ uniqueNodeList.push(node);
220
+ });
221
+ return uniqueNodeList;
211
222
  });
212
223
  function getPublicCheckedKeys(rawCheckedKeys, rawCheckedStrategy = checkedStrategy.value) {
213
224
  let publicCheckedKeys = [...rawCheckedKeys];
@@ -392,7 +403,7 @@ var tree_vue_vue_type_script_lang_default = defineComponent({
392
403
  }
393
404
  function onExpandEnd(key) {
394
405
  const index = currentExpandKeys.value.indexOf(key);
395
- currentExpandKeys.value.splice(index, 1);
406
+ if (index > -1) currentExpandKeys.value.splice(index, 1);
396
407
  }
397
408
  const treeContext = reactive({
398
409
  treeProps: props,
@@ -478,9 +489,10 @@ var tree_vue_vue_type_script_lang_default = defineComponent({
478
489
  classNames,
479
490
  treeStyle,
480
491
  resolvedVirtualListProps,
492
+ virtualListKey,
481
493
  visibleTreeNodeList,
482
494
  treeContext,
483
- virtualListRef: ref(),
495
+ virtualListRef,
484
496
  computedSelectedKeys: selectedKeys,
485
497
  computedExpandedKeys: expandedKeys,
486
498
  computedCheckedKeys: checkedKeys,
@@ -58,9 +58,11 @@ function useSelectedState(props) {
58
58
  if (fallbackResult === false) return;
59
59
  if (isObject(fallbackResult)) fallbackNodeData = fallbackResult;
60
60
  }
61
+ const fallbackLabel = fallbackNodeData === null || fallbackNodeData === void 0 ? void 0 : fallbackNodeData[nodeDataTitle];
62
+ const label = (_ref = (_ref2 = (_ref3 = (_ref4 = (_getLabel = getLabel(item)) !== null && _getLabel !== void 0 ? _getLabel : getPathLabel(key, node)) !== null && _ref4 !== void 0 ? _ref4 : typeof (node === null || node === void 0 ? void 0 : node.title) === "string" || typeof (node === null || node === void 0 ? void 0 : node.title) === "number" ? node.title : void 0) !== null && _ref3 !== void 0 ? _ref3 : originValueItem === null || originValueItem === void 0 ? void 0 : originValueItem.label) !== null && _ref2 !== void 0 ? _ref2 : typeof fallbackLabel === "string" || typeof fallbackLabel === "number" ? fallbackLabel : void 0) !== null && _ref !== void 0 ? _ref : key;
61
63
  res.push(_objectSpread2(_objectSpread2(_objectSpread2({}, isLabelValue(item) ? item : {}), originValueItem), {}, {
62
64
  value: key,
63
- label: (_ref = (_ref2 = (_ref3 = (_ref4 = (_getLabel = getLabel(item)) !== null && _getLabel !== void 0 ? _getLabel : getPathLabel(key, node)) !== null && _ref4 !== void 0 ? _ref4 : node === null || node === void 0 ? void 0 : node.title) !== null && _ref3 !== void 0 ? _ref3 : originValueItem === null || originValueItem === void 0 ? void 0 : originValueItem.label) !== null && _ref2 !== void 0 ? _ref2 : fallbackNodeData === null || fallbackNodeData === void 0 ? void 0 : fallbackNodeData[nodeDataTitle]) !== null && _ref !== void 0 ? _ref : key
65
+ label
64
66
  }));
65
67
  });
66
68
  }
@@ -1,5 +1,8 @@
1
1
  import type { SFCWithInstall } from '../_utils/types';
2
+ import type { TreeSelectProps } from './interface';
2
3
  import _TreeSelect from './tree-select.vue';
4
+ export type { ChangeHandler as TreeSelectChangeHandler, ClearHandler as TreeSelectClearHandler, FallbackOption as TreeSelectFallbackOption, FilterTreeNode as TreeSelectFilterTreeNode, LabelValue, PopupVisibleChangeHandler as TreeSelectPopupVisibleChangeHandler, SearchHandler as TreeSelectSearchHandler, TreeSelectProps, TreeSelectValue, } from './interface';
3
5
  declare const TreeSelect: SFCWithInstall<typeof _TreeSelect>;
4
6
  export type TreeSelectInstance = InstanceType<typeof _TreeSelect>;
7
+ export type TreeSelectLoadMore = NonNullable<TreeSelectProps['loadMore']>;
5
8
  export default TreeSelect;