@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.
- package/dist/sd.css +148 -952
- package/dist/sd.min.css +1 -1
- package/es/_components/input-label/style/input-label.scss +11 -51
- package/es/_components/select-view/select-view.d.ts +1 -1
- package/es/_components/select-view/style/index.css +0 -84
- package/es/_components/virtual-list/interface.d.ts +10 -1
- package/es/{table/hooks/use-table-virtual-size.d.ts → _components/virtual-list/use-virtual-size.d.ts} +4 -2
- package/es/{table/hooks/use-table-virtual-size.js → _components/virtual-list/use-virtual-size.js} +17 -20
- package/es/_components/virtual-list/virtual-list.js +64 -2
- package/es/_components/virtual-list/virtual-list.vue.d.ts +208 -0
- package/es/_components/virtual-list/virtual-list.vue_vue_type_script_lang.js +277 -5
- package/es/_utils/clipboard.js +2 -1
- package/es/auto-complete/auto-complete.d.ts +1 -1
- package/es/auto-complete/index.d.ts +24 -15
- package/es/auto-complete/style/index.css +0 -16
- package/es/auto-complete/style/index.scss +11 -26
- package/es/badge/style/index.scss +11 -41
- package/es/button/style/index.css +35 -445
- package/es/button/style/index.scss +57 -332
- package/es/card/style/index.scss +18 -52
- package/es/carousel/index.d.ts +1 -0
- package/es/cascader/cascader-panel.vue.d.ts +1 -1
- package/es/cascader/cascader.vue.d.ts +3 -3
- package/es/cascader/index.d.ts +10 -10
- package/es/cascader/interface.d.ts +5 -0
- package/es/color-picker/style/index.scss +17 -99
- package/es/config-provider/config-provider.vue.d.ts +1 -1
- package/es/config-provider/index.d.ts +4 -3
- package/es/date-picker/index.d.ts +21 -14
- package/es/date-picker/panels/date/index.vue.d.ts +1 -1
- package/es/date-picker/panels/week/index.vue.d.ts +7 -7
- package/es/date-picker/picker.vue.d.ts +1 -1
- package/es/date-picker/range-picker.vue.d.ts +1 -1
- package/es/descriptions/descriptions.d.ts +1 -1
- package/es/descriptions/index.d.ts +4 -4
- package/es/descriptions/style/index.scss +18 -63
- package/es/form/style/index.css +12 -176
- package/es/form/style/status.scss +36 -73
- package/es/index.css +148 -952
- package/es/index.d.ts +21 -20
- package/es/input/style/input.scss +14 -66
- package/es/input-number/index.d.ts +5 -0
- package/es/input-tag/style/index.css +0 -84
- package/es/input-tag/style/input-tag.scss +16 -170
- package/es/list/style/index.scss +12 -42
- package/es/menu/index.d.ts +8 -0
- package/es/menu/style/index.css +0 -178
- package/es/menu/style/index.scss +36 -139
- package/es/pagination/index.d.ts +3 -3
- package/es/pagination/interface.d.ts +2 -1
- package/es/pagination/page-options.js +1 -1
- package/es/pagination/page-options.vue.d.ts +72 -71
- package/es/pagination/page-options.vue_vue_type_script_lang.js +6 -0
- package/es/pagination/pagination.d.ts +3 -3
- package/es/pagination/style/index.css +0 -12
- package/es/pagination/style/index.scss +19 -76
- package/es/radio/index.d.ts +3 -0
- package/es/result/style/index.css +0 -16
- package/es/result/style/index.scss +12 -34
- package/es/select/index.d.ts +9 -9
- package/es/select/interface.d.ts +2 -1
- package/es/select/select.d.ts +3 -3
- package/es/slider/index.d.ts +6 -3
- package/es/slider/slider.vue.d.ts +1 -1
- package/es/steps/index.d.ts +2 -0
- package/es/switch/index.d.ts +3 -0
- package/es/table/context.d.ts +1 -1
- package/es/table/hooks/use-column-resize.d.ts +2 -3
- package/es/table/hooks/use-column-resize.js +48 -21
- package/es/table/hooks/use-drag.d.ts +4 -2
- package/es/table/hooks/use-drag.js +16 -2
- package/es/table/index.d.ts +22 -34
- package/es/table/interface.d.ts +21 -2
- package/es/table/style/index.css +97 -21
- package/es/table/style/index.scss +137 -125
- package/es/table/table-operation-td.d.ts +2 -2
- package/es/table/table-operation-td.js +4 -5
- package/es/table/table-operation-th.js +4 -4
- package/es/table/table-tbody.js +1 -1
- package/es/table/table-td.js +5 -6
- package/es/table/table-th.js +25 -24
- package/es/table/table-thead.js +1 -1
- package/es/table/table-tr.js +1 -1
- package/es/table/table.d.ts +12 -16
- package/es/table/table.js +399 -190
- package/es/tabs/index.d.ts +1 -0
- package/es/tabs/style/index.scss +53 -135
- package/es/tag/index.d.ts +3 -3
- package/es/tag/style/index.css +0 -84
- package/es/tag/style/index.scss +19 -146
- package/es/tag/tag.vue.d.ts +1 -1
- package/es/theme-provider/index.d.ts +9 -9
- package/es/time-picker/index.d.ts +1 -0
- package/es/timeline/index.d.ts +1 -0
- package/es/transfer/index.d.ts +1 -0
- package/es/transfer/interface.d.ts +1 -1
- package/es/tree/hooks/use-tree-data.d.ts +17 -29
- package/es/tree/index.d.ts +6 -1
- package/es/tree/interface.d.ts +2 -0
- package/es/tree/tree.js +1 -1
- package/es/tree/tree.vue.d.ts +3561 -13
- package/es/tree/tree.vue_vue_type_script_lang.js +21 -9
- package/es/tree-select/hooks/use-selected-state.js +3 -1
- package/es/tree-select/index.d.ts +3 -0
- package/es/tree-select/tree-select.vue.d.ts +1367 -3
- package/json/vetur-attributes.json +1 -6
- package/json/vetur-tags.json +0 -1
- package/json/web-types.json +7 -11
- package/package.json +1 -1
- package/es/style/theme/legacy-less-var.scss +0 -15
- package/es/table/table-col-group.js +0 -21
- package/es/table/table-col-group.vue_vue_type_script_lang.js +0 -32
- package/es/table/table-legacy-virtual-list.js +0 -47
- package/es/table/table-legacy-virtual-list.vue.d.ts +0 -156
- package/es/table/table-legacy-virtual-list.vue_vue_type_script_lang.js +0 -148
- package/es/table/table-virtual-list-item.d.ts +0 -22
- 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
|
|
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
|
-
|
|
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
|
|
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
|
|
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;
|