@sdata/web-vue 1.7.1 → 1.9.0
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 +182 -1
- package/dist/sd.min.css +1 -1
- package/es/_components/input-label/input-label.js +30 -24
- package/es/_components/select-view/interface.d.ts +1 -0
- package/es/_components/select-view/select-view.d.ts +12 -3
- package/es/_components/select-view/select-view.js +38 -28
- package/es/_components/select-view/style/index.css +45 -0
- package/es/_hooks/use-allow-clear.d.ts +4 -0
- package/es/_hooks/use-allow-clear.js +20 -0
- package/es/_hooks/use-trigger.d.ts +4 -6
- package/es/_hooks/use-trigger.js +7 -5
- package/es/_utils/color.js +1 -18
- package/es/auto-complete/auto-complete.d.ts +1 -1
- package/es/auto-complete/auto-complete.js +4 -2
- package/es/auto-complete/index.d.ts +3 -3
- package/es/badge/badge.d.ts +1 -1
- package/es/badge/index.d.ts +3 -3
- package/es/carousel/carousel-arrow.vue.d.ts +1 -1
- package/es/carousel/carousel.d.ts +2 -2
- package/es/carousel/index.d.ts +6 -6
- package/es/cascader/cascader-panel.vue.d.ts +2 -2
- package/es/cascader/cascader.js +1 -1
- package/es/cascader/cascader.vue.d.ts +21 -11
- package/es/cascader/cascader.vue_vue_type_script_lang.js +4 -1
- package/es/cascader/index.d.ts +47 -26
- package/es/color-picker/color-picker.d.ts +115 -40
- package/es/color-picker/color-picker.js +146 -102
- package/es/color-picker/index.d.ts +217 -69
- package/es/color-picker/interface.d.ts +41 -0
- package/es/color-picker/palette.js +1 -1
- package/es/color-picker/panel.d.ts +73 -34
- package/es/color-picker/panel.js +423 -89
- package/es/color-picker/style/index.css +92 -1
- package/es/color-picker/style/index.scss +107 -1
- package/es/color-picker/utils.d.ts +89 -0
- package/es/color-picker/utils.js +456 -0
- package/es/config-provider/config-provider.vue.d.ts +10 -1
- package/es/config-provider/config-provider.vue_vue_type_script_lang.js +6 -1
- package/es/config-provider/context.d.ts +1 -0
- package/es/config-provider/index.d.ts +18 -3
- package/es/date-picker/index.d.ts +7 -6
- package/es/date-picker/picker.js +1 -1
- package/es/date-picker/picker.vue.d.ts +7 -6
- package/es/date-picker/picker.vue_vue_type_script_lang.js +4 -1
- package/es/date-picker/range-picker.js +1 -1
- package/es/date-picker/range-picker.vue.d.ts +7 -6
- package/es/date-picker/range-picker.vue_vue_type_script_lang.js +4 -1
- package/es/descriptions/descriptions.d.ts +2 -2
- package/es/descriptions/index.d.ts +6 -6
- package/es/drawer/drawer.vue_vue_type_script_lang.js +1 -1
- package/es/dropdown/dropdown-button.vue.d.ts +8 -8
- package/es/dropdown/dropdown-panel.vue.d.ts +2 -2
- package/es/dropdown/dropdown-submenu.vue.d.ts +8 -8
- package/es/dropdown/dropdown.vue.d.ts +8 -8
- package/es/dropdown/index.d.ts +32 -32
- package/es/ellipsis/ellipsis.vue.d.ts +13 -13
- package/es/ellipsis/ellipsis.vue_vue_type_script_lang.js +1 -1
- package/es/ellipsis/index.d.ts +56 -56
- package/es/ellipsis/performant-ellipsis.vue.d.ts +14 -14
- package/es/form/form-item-label.vue.d.ts +12 -12
- package/es/form/form-item.vue.d.ts +12 -12
- package/es/form/index.d.ts +12 -12
- package/es/grid/grid.vue.d.ts +1 -1
- package/es/grid/index.d.ts +3 -3
- package/es/image/image.vue.d.ts +12 -12
- package/es/image/preview-action.d.ts +12 -12
- package/es/image/preview-group.vue.d.ts +12 -12
- package/es/image/preview-toolbar.vue.d.ts +12 -12
- package/es/image/preview.vue.d.ts +12 -12
- package/es/index.css +182 -1
- package/es/index.js +2 -2
- package/es/input/input.js +4 -2
- package/es/input-number/input-number.js +4 -2
- package/es/input-tag/index.d.ts +6 -6
- package/es/input-tag/input-tag.d.ts +3 -3
- package/es/input-tag/input-tag.js +183 -32
- package/es/input-tag/style/index.css +45 -0
- package/es/input-tag/style/input-tag.scss +53 -0
- package/es/list/index.d.ts +3 -3
- package/es/list/list.d.ts +1 -1
- package/es/mention/mention.js +4 -2
- package/es/menu/sub-menu-pop.vue.d.ts +6 -6
- package/es/modal/modal.vue_vue_type_script_lang.js +1 -1
- package/es/overflow-list/index.d.ts +3 -3
- package/es/overflow-list/overflow-list.d.ts +1 -1
- package/es/pagination/page-options.vue.d.ts +188 -98
- package/es/popconfirm/index.d.ts +12 -12
- package/es/popconfirm/popconfirm.vue.d.ts +6 -6
- package/es/popover/index.d.ts +12 -12
- package/es/popover/popover.vue.d.ts +6 -6
- package/es/progress/index.d.ts +5 -5
- package/es/progress/line.vue.d.ts +1 -1
- package/es/progress/progress.vue.d.ts +2 -2
- package/es/rate/rate.js +4 -2
- package/es/scrollbar/index.d.ts +2 -2
- package/es/scrollbar/scrollbar.vue.d.ts +1 -1
- package/es/scrollbar/thumb.vue.d.ts +1 -1
- package/es/sd-vue.js +2 -2
- package/es/select/hooks/use-options.d.ts +9 -4
- package/es/select/hooks/use-options.js +2 -2
- package/es/select/hooks/use-select.d.ts +9 -4
- package/es/select/index.d.ts +188 -98
- package/es/select/interface.d.ts +57 -46
- package/es/select/select-dropdown.vue.d.ts +2 -2
- package/es/select/select.d.ts +107 -59
- package/es/select/select.js +182 -126
- package/es/select/utils.d.ts +1 -1
- package/es/select/utils.js +28 -10
- package/es/skeleton/index.d.ts +1 -1
- package/es/skeleton/line.vue.d.ts +1 -1
- package/es/slider/index.d.ts +27 -27
- package/es/slider/slider-button.vue.d.ts +12 -12
- package/es/slider/slider.vue.d.ts +13 -13
- package/es/space/index.d.ts +3 -3
- package/es/space/space.d.ts +1 -1
- package/es/statistic/index.d.ts +6 -6
- package/es/statistic/statistic.vue.d.ts +2 -2
- package/es/table/index.d.ts +6 -6
- package/es/table/table.d.ts +2 -2
- package/es/tabs/index.d.ts +9 -9
- package/es/tabs/tabs.d.ts +3 -3
- package/es/tag/index.d.ts +3 -3
- package/es/tag/tag.vue.d.ts +1 -1
- package/es/textarea/index.d.ts +3 -3
- package/es/textarea/textarea.vue.d.ts +1 -1
- package/es/textarea/textarea.vue_vue_type_script_lang.js +6 -2
- package/es/time-picker/index.d.ts +15 -12
- package/es/time-picker/time-picker.js +1 -1
- package/es/time-picker/time-picker.vue.d.ts +7 -6
- package/es/time-picker/time-picker.vue_vue_type_script_lang.js +4 -1
- package/es/tooltip/index.d.ts +12 -12
- package/es/tooltip/tooltip.vue.d.ts +6 -6
- package/es/transfer/index.d.ts +10 -10
- package/es/transfer/transfer-view.vue.d.ts +5 -5
- package/es/transfer/transfer.vue.d.ts +5 -5
- package/es/tree/index.d.ts +6 -6
- package/es/tree/tree.vue.d.ts +2 -2
- package/es/tree-select/hooks/use-selected-state.d.ts +2 -0
- package/es/tree-select/hooks/use-selected-state.js +26 -8
- package/es/tree-select/index.d.ts +268 -61
- package/es/tree-select/interface.d.ts +16 -3
- package/es/tree-select/panel.d.ts +6 -6
- package/es/tree-select/tree-select.js +29 -16
- package/es/tree-select/tree-select.vue.d.ts +144 -30
- package/es/tree-select/tree-select.vue_vue_type_script_lang.js +102 -22
- package/es/trigger/index.d.ts +6 -6
- package/es/trigger/trigger.d.ts +2 -2
- package/es/typography/operations.vue.d.ts +12 -12
- package/json/vetur-attributes.json +82 -178
- package/json/vetur-tags.json +24 -52
- package/json/web-types.json +164 -387
- package/package.json +9 -7
- package/es/color-picker/input-alpha.js +0 -32
- package/es/color-picker/input-hex.js +0 -73
- package/es/color-picker/input-rgb.js +0 -55
|
@@ -22,7 +22,18 @@ function getKeys(value) {
|
|
|
22
22
|
}
|
|
23
23
|
function useSelectedState(props) {
|
|
24
24
|
var _defaultValue$value;
|
|
25
|
-
const { defaultValue, modelValue, key2TreeNode, multiple, treeCheckable, fallbackOption, fieldNames } = toRefs(props);
|
|
25
|
+
const { defaultValue, modelValue, key2TreeNode, multiple, treeCheckable, fallbackOption, fieldNames, showPath, separator } = toRefs(props);
|
|
26
|
+
function getPathLabel(key, node) {
|
|
27
|
+
var _fieldNames$value, _separator$value;
|
|
28
|
+
if (!(showPath === null || showPath === void 0 ? void 0 : showPath.value) || !node) return;
|
|
29
|
+
const nodeDataTitle = (fieldNames === null || fieldNames === void 0 || (_fieldNames$value = fieldNames.value) === null || _fieldNames$value === void 0 ? void 0 : _fieldNames$value.title) || "title";
|
|
30
|
+
return [...node.pathParentKeys, key].map((pathKey) => key2TreeNode.value.get(pathKey)).filter((pathNode) => Boolean(pathNode)).map((pathNode) => {
|
|
31
|
+
const pathLabel = pathNode.treeNodeData[nodeDataTitle];
|
|
32
|
+
if (typeof pathLabel === "string" || typeof pathLabel === "number") return String(pathLabel);
|
|
33
|
+
if (typeof pathNode.title === "string" || typeof pathNode.title === "number") return String(pathNode.title);
|
|
34
|
+
return String(pathNode.key);
|
|
35
|
+
}).join((_separator$value = separator === null || separator === void 0 ? void 0 : separator.value) !== null && _separator$value !== void 0 ? _separator$value : " / ");
|
|
36
|
+
}
|
|
26
37
|
function normalizeValue(value) {
|
|
27
38
|
const validValue = (isArray(value) ? value : [value]).filter(isValidValue);
|
|
28
39
|
return (multiple === null || multiple === void 0 ? void 0 : multiple.value) || (treeCheckable === null || treeCheckable === void 0 ? void 0 : treeCheckable.value) ? validValue : validValue.slice(0, 1);
|
|
@@ -36,12 +47,12 @@ function useSelectedState(props) {
|
|
|
36
47
|
originValueMap.set(item.value, item);
|
|
37
48
|
});
|
|
38
49
|
validValue.forEach((item) => {
|
|
39
|
-
var _fieldNames$
|
|
50
|
+
var _fieldNames$value2, _ref, _ref2, _ref3, _ref4, _getLabel;
|
|
40
51
|
const key = getKey(item);
|
|
41
52
|
const originValueItem = originValueMap.get(key);
|
|
42
53
|
const node = key2TreeNode.value.get(key);
|
|
43
54
|
let fallbackNodeData = null;
|
|
44
|
-
const nodeDataTitle = (fieldNames === null || fieldNames === void 0 || (_fieldNames$
|
|
55
|
+
const nodeDataTitle = (fieldNames === null || fieldNames === void 0 || (_fieldNames$value2 = fieldNames.value) === null || _fieldNames$value2 === void 0 ? void 0 : _fieldNames$value2.title) || "title";
|
|
45
56
|
if (!node) {
|
|
46
57
|
const fallbackResult = isFunction(fallbackOption === null || fallbackOption === void 0 ? void 0 : fallbackOption.value) ? fallbackOption === null || fallbackOption === void 0 ? void 0 : fallbackOption.value(key) : fallbackOption === null || fallbackOption === void 0 ? void 0 : fallbackOption.value;
|
|
47
58
|
if (fallbackResult === false) return;
|
|
@@ -49,7 +60,7 @@ function useSelectedState(props) {
|
|
|
49
60
|
}
|
|
50
61
|
res.push(_objectSpread2(_objectSpread2(_objectSpread2({}, isLabelValue(item) ? item : {}), originValueItem), {}, {
|
|
51
62
|
value: key,
|
|
52
|
-
label: (_ref = (_ref2 = (_ref3 = (_getLabel = getLabel(item)) !== null && _getLabel !== void 0 ? _getLabel : 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
|
|
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
|
|
53
64
|
}));
|
|
54
65
|
});
|
|
55
66
|
}
|
|
@@ -67,11 +78,18 @@ function useSelectedState(props) {
|
|
|
67
78
|
});
|
|
68
79
|
const normalizeDefaultValue = normalizeValue((_defaultValue$value = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value) !== null && _defaultValue$value !== void 0 ? _defaultValue$value : []);
|
|
69
80
|
const defaultKeys = getKeys(normalizeDefaultValue);
|
|
70
|
-
const defaultLabelValues = getLabelValues(defaultKeys, getLabelValues(normalizeDefaultValue));
|
|
81
|
+
const defaultLabelValues = computed(() => getLabelValues(defaultKeys, getLabelValues(normalizeDefaultValue)));
|
|
71
82
|
const localValueKeys = ref(defaultKeys || []);
|
|
72
|
-
const localValue = ref(defaultLabelValues);
|
|
73
|
-
watch(
|
|
74
|
-
|
|
83
|
+
const localValue = ref(defaultLabelValues.value);
|
|
84
|
+
watch([
|
|
85
|
+
localValueKeys,
|
|
86
|
+
key2TreeNode,
|
|
87
|
+
fieldNames,
|
|
88
|
+
showPath,
|
|
89
|
+
separator,
|
|
90
|
+
defaultLabelValues
|
|
91
|
+
], () => {
|
|
92
|
+
localValue.value = getLabelValues(localValueKeys.value, defaultLabelValues.value);
|
|
75
93
|
});
|
|
76
94
|
watch([computedModelValueKeys, computedModelValue], ([valueKeys, value]) => {
|
|
77
95
|
localValueKeys.value = valueKeys || [];
|