@sdata/web-vue 3.20.0 → 3.22.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 +1 -0
- package/dist/sd.min.css +1 -1
- package/es/cascader/cascader-option.js +7 -3
- package/es/cascader/cascader-panel.vue.d.ts +1 -0
- package/es/cascader/cascader-panel.vue_vue_type_script_setup_true_lang.js +7 -2
- package/es/cascader/cascader.vue.d.ts +21 -8
- package/es/cascader/cascader.vue_vue_type_script_setup_true_lang.js +38 -3
- package/es/cascader/context.d.ts +1 -0
- package/es/cascader/index.d.ts +1 -1
- package/es/cascader/style/index.css +1 -0
- package/es/cascader/style/index.scss +1 -0
- package/es/cascader/types.d.ts +13 -0
- package/es/color-picker/color-picker.js +13 -1
- package/es/color-picker/index.d.ts +1 -1
- package/es/color-picker/interface.d.ts +10 -0
- package/es/date-picker/index.d.ts +12 -1
- package/es/date-picker/interface.d.ts +19 -0
- package/es/date-picker/picker.vue.d.ts +23 -13
- package/es/date-picker/picker.vue_vue_type_script_setup_true_lang.js +23 -2
- package/es/date-picker/range-picker.vue.d.ts +25 -14
- package/es/date-picker/range-picker.vue_vue_type_script_setup_true_lang.js +21 -2
- package/es/index.css +1 -0
- package/es/select/index.d.ts +16 -1
- package/es/select/interface.d.ts +11 -0
- package/es/select/select.d.ts +9 -0
- package/es/select/select.js +33 -3
- package/es/time-picker/index.d.ts +12 -1
- package/es/time-picker/interface.d.ts +10 -0
- package/es/time-picker/time-picker.vue.d.ts +15 -4
- package/es/time-picker/time-picker.vue_vue_type_script_setup_true_lang.js +22 -2
- package/es/tree-select/index.d.ts +1 -1
- package/es/tree-select/interface.d.ts +11 -0
- package/es/tree-select/panel.d.ts +1 -0
- package/es/tree-select/panel.js +5 -0
- package/es/tree-select/tree-select.vue.d.ts +19 -1
- package/es/tree-select/tree-select.vue_vue_type_script_setup_true_lang.js +38 -5
- package/json/vetur-attributes.json +6 -0
- package/json/vetur-tags.json +3 -1
- package/json/web-types.json +17 -1
- package/package.json +1 -1
package/es/select/index.d.ts
CHANGED
|
@@ -116,6 +116,10 @@ declare const Select: {
|
|
|
116
116
|
type: import("vue").PropType<import("./interface").SelectOption[]>;
|
|
117
117
|
default: () => never[];
|
|
118
118
|
};
|
|
119
|
+
ellipsis: {
|
|
120
|
+
type: import("vue").PropType<boolean | "performant-ellipsis">;
|
|
121
|
+
default: boolean;
|
|
122
|
+
};
|
|
119
123
|
virtualListProps: {
|
|
120
124
|
type: import("vue").PropType<import("../_components/virtual-list/interface").VirtualListProps>;
|
|
121
125
|
};
|
|
@@ -197,6 +201,7 @@ declare const Select: {
|
|
|
197
201
|
}, import("vue").PublicProps, {
|
|
198
202
|
options: import("./interface").SelectOption[];
|
|
199
203
|
show: boolean;
|
|
204
|
+
ellipsis: boolean | "performant-ellipsis";
|
|
200
205
|
scrollbar: boolean | import("..").ScrollbarProps;
|
|
201
206
|
multiple: boolean;
|
|
202
207
|
disabled: boolean;
|
|
@@ -1474,6 +1479,10 @@ declare const Select: {
|
|
|
1474
1479
|
type: import("vue").PropType<import("./interface").SelectOption[]>;
|
|
1475
1480
|
default: () => never[];
|
|
1476
1481
|
};
|
|
1482
|
+
ellipsis: {
|
|
1483
|
+
type: import("vue").PropType<boolean | "performant-ellipsis">;
|
|
1484
|
+
default: boolean;
|
|
1485
|
+
};
|
|
1477
1486
|
virtualListProps: {
|
|
1478
1487
|
type: import("vue").PropType<import("../_components/virtual-list/interface").VirtualListProps>;
|
|
1479
1488
|
};
|
|
@@ -1540,6 +1549,7 @@ declare const Select: {
|
|
|
1540
1549
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
|
1541
1550
|
options: import("./interface").SelectOption[];
|
|
1542
1551
|
show: boolean;
|
|
1552
|
+
ellipsis: boolean | "performant-ellipsis";
|
|
1543
1553
|
scrollbar: boolean | import("..").ScrollbarProps;
|
|
1544
1554
|
multiple: boolean;
|
|
1545
1555
|
disabled: boolean;
|
|
@@ -1691,6 +1701,10 @@ declare const Select: {
|
|
|
1691
1701
|
type: import("vue").PropType<import("./interface").SelectOption[]>;
|
|
1692
1702
|
default: () => never[];
|
|
1693
1703
|
};
|
|
1704
|
+
ellipsis: {
|
|
1705
|
+
type: import("vue").PropType<boolean | "performant-ellipsis">;
|
|
1706
|
+
default: boolean;
|
|
1707
|
+
};
|
|
1694
1708
|
virtualListProps: {
|
|
1695
1709
|
type: import("vue").PropType<import("../_components/virtual-list/interface").VirtualListProps>;
|
|
1696
1710
|
};
|
|
@@ -1772,6 +1786,7 @@ declare const Select: {
|
|
|
1772
1786
|
}, string, {
|
|
1773
1787
|
options: import("./interface").SelectOption[];
|
|
1774
1788
|
show: boolean;
|
|
1789
|
+
ellipsis: boolean | "performant-ellipsis";
|
|
1775
1790
|
scrollbar: boolean | import("..").ScrollbarProps;
|
|
1776
1791
|
multiple: boolean;
|
|
1777
1792
|
disabled: boolean;
|
|
@@ -2932,5 +2947,5 @@ declare const Select: {
|
|
|
2932
2947
|
install: (app: App, options?: SDOptions) => void;
|
|
2933
2948
|
};
|
|
2934
2949
|
export type SelectInstance = InstanceType<typeof _Select>;
|
|
2935
|
-
export type { SelectProps, SelectOption, SelectOptionData, SelectOptionGroup, SelectFieldNames, FilterOption, SelectFallbackOption, } from './interface';
|
|
2950
|
+
export type { SelectProps, SelectOption, SelectOptionData, SelectOptionGroup, SelectFieldNames, SelectTriggerSlotProps, FilterOption, SelectFallbackOption, } from './interface';
|
|
2936
2951
|
export default Select;
|
package/es/select/interface.d.ts
CHANGED
|
@@ -5,6 +5,16 @@ import type { ScrollbarProps } from '../scrollbar';
|
|
|
5
5
|
import type { TriggerProps } from '../trigger';
|
|
6
6
|
export type SelectOptionValue = string | number | boolean | Record<string, unknown>;
|
|
7
7
|
export type SelectModelValue = SelectOptionValue | SelectOptionValue[] | null | undefined;
|
|
8
|
+
export interface SelectTriggerSlotProps {
|
|
9
|
+
value: SelectModelValue;
|
|
10
|
+
displayValue: string | string[];
|
|
11
|
+
inputValue: string;
|
|
12
|
+
selectedOptions: SelectOptionData[];
|
|
13
|
+
popupVisible: boolean;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
loading: boolean;
|
|
16
|
+
multiple: boolean;
|
|
17
|
+
}
|
|
8
18
|
export interface OptionValueWithKey {
|
|
9
19
|
value: SelectOptionValue;
|
|
10
20
|
key: string;
|
|
@@ -46,6 +56,7 @@ export type FilterOption = boolean | ((inputValue: string, option: SelectOptionD
|
|
|
46
56
|
export type SelectFallbackOption = (value: SelectOptionValue) => SelectOptionData;
|
|
47
57
|
export interface SelectProps extends FitWidthProps {
|
|
48
58
|
options?: SelectOption[];
|
|
59
|
+
ellipsis?: boolean | 'performant-ellipsis';
|
|
49
60
|
multiple?: boolean;
|
|
50
61
|
value?: SelectModelValue;
|
|
51
62
|
modelValue?: SelectModelValue;
|
package/es/select/select.d.ts
CHANGED
|
@@ -121,6 +121,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
121
121
|
type: PropType<SelectOption[]>;
|
|
122
122
|
default: () => never[];
|
|
123
123
|
};
|
|
124
|
+
ellipsis: {
|
|
125
|
+
type: PropType<boolean | "performant-ellipsis">;
|
|
126
|
+
default: boolean;
|
|
127
|
+
};
|
|
124
128
|
virtualListProps: {
|
|
125
129
|
type: PropType<VirtualListProps>;
|
|
126
130
|
};
|
|
@@ -298,6 +302,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
298
302
|
type: PropType<SelectOption[]>;
|
|
299
303
|
default: () => never[];
|
|
300
304
|
};
|
|
305
|
+
ellipsis: {
|
|
306
|
+
type: PropType<boolean | "performant-ellipsis">;
|
|
307
|
+
default: boolean;
|
|
308
|
+
};
|
|
301
309
|
virtualListProps: {
|
|
302
310
|
type: PropType<VirtualListProps>;
|
|
303
311
|
};
|
|
@@ -364,6 +372,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
364
372
|
}>, {
|
|
365
373
|
options: SelectOption[];
|
|
366
374
|
show: boolean;
|
|
375
|
+
ellipsis: boolean | "performant-ellipsis";
|
|
367
376
|
scrollbar: boolean | ScrollbarProps;
|
|
368
377
|
multiple: boolean;
|
|
369
378
|
disabled: boolean;
|
package/es/select/select.js
CHANGED
|
@@ -13,6 +13,7 @@ import Tooltip from "../tooltip/index.js";
|
|
|
13
13
|
import { getKeyFromValue, hasEmptyStringKey, isGroupOptionInfo, isValidOption } from "./utils.js";
|
|
14
14
|
import { useSelect } from "./hooks/use-select.js";
|
|
15
15
|
import select_dropdown_default from "./select-dropdown.js";
|
|
16
|
+
import Ellipsis, { PerformantEllipsis } from "../ellipsis/index.js";
|
|
16
17
|
import { debounce } from "../_utils/debounce.js";
|
|
17
18
|
import select_view_default from "../_components/select-view/select-view.js";
|
|
18
19
|
import { useAllowSearch } from "../_hooks/use-allow-search.js";
|
|
@@ -169,6 +170,14 @@ var select_default = /* @__PURE__ */ defineComponent({
|
|
|
169
170
|
type: Array,
|
|
170
171
|
default: () => []
|
|
171
172
|
},
|
|
173
|
+
/**
|
|
174
|
+
* @zh 是否使用 Ellipsis 组件渲染选项。传入 `performant-ellipsis` 时使用高性能省略实现
|
|
175
|
+
* @en Whether to render options with the Ellipsis component. Use `performant-ellipsis` for the performant implementation
|
|
176
|
+
*/
|
|
177
|
+
ellipsis: {
|
|
178
|
+
type: [Boolean, String],
|
|
179
|
+
default: true
|
|
180
|
+
},
|
|
172
181
|
virtualListProps: { type: Object },
|
|
173
182
|
triggerProps: { type: Object },
|
|
174
183
|
floatingOptions: { type: Object },
|
|
@@ -468,8 +477,20 @@ var select_default = /* @__PURE__ */ defineComponent({
|
|
|
468
477
|
}
|
|
469
478
|
return result;
|
|
470
479
|
});
|
|
471
|
-
const
|
|
472
|
-
|
|
480
|
+
const triggerValue = computed(() => {
|
|
481
|
+
const values = computedValueObjects.value.map((item) => item.value);
|
|
482
|
+
return props.multiple ? values : values[0];
|
|
483
|
+
});
|
|
484
|
+
const triggerDisplayValue = computed(() => {
|
|
485
|
+
var _labels$;
|
|
486
|
+
const labels = selectViewValue.value.map((item) => String(item.label));
|
|
487
|
+
return props.multiple ? labels : (_labels$ = labels[0]) !== null && _labels$ !== void 0 ? _labels$ : "";
|
|
488
|
+
});
|
|
489
|
+
const triggerSelectedOptions = computed(() => selectViewValue.value.map((item) => item.option).filter((option) => Boolean(option)));
|
|
490
|
+
const renderOptionEllipsis = (label) => {
|
|
491
|
+
if (props.ellipsis === false) return label;
|
|
492
|
+
return createVNode(props.ellipsis === "performant-ellipsis" ? PerformantEllipsis : Ellipsis, null, _isSlot(label) ? label : { default: () => [label] });
|
|
493
|
+
};
|
|
473
494
|
const getOptionContentFunc = (optionInfo) => {
|
|
474
495
|
if (isFunction(slots.option)) return () => {
|
|
475
496
|
var _slots$option;
|
|
@@ -610,7 +631,16 @@ var select_default = /* @__PURE__ */ defineComponent({
|
|
|
610
631
|
}, props.triggerProps, { "floatingOptions": (_props$floatingOption = props.floatingOptions) !== null && _props$floatingOption !== void 0 ? _props$floatingOption : (_props$triggerProps = props.triggerProps) === null || _props$triggerProps === void 0 ? void 0 : _props$triggerProps.floatingOptions }), {
|
|
611
632
|
default: () => {
|
|
612
633
|
var _slots$trigger, _slots$trigger2;
|
|
613
|
-
return [(_slots$trigger = (_slots$trigger2 = slots.trigger) === null || _slots$trigger2 === void 0 ? void 0 : _slots$trigger2.call(slots
|
|
634
|
+
return [(_slots$trigger = (_slots$trigger2 = slots.trigger) === null || _slots$trigger2 === void 0 ? void 0 : _slots$trigger2.call(slots, {
|
|
635
|
+
value: triggerValue.value,
|
|
636
|
+
displayValue: triggerDisplayValue.value,
|
|
637
|
+
inputValue: computedInputValue.value,
|
|
638
|
+
selectedOptions: triggerSelectedOptions.value,
|
|
639
|
+
popupVisible: computedPopupVisible.value,
|
|
640
|
+
disabled: mergedDisabled.value,
|
|
641
|
+
loading: props.loading,
|
|
642
|
+
multiple: props.multiple
|
|
643
|
+
})) !== null && _slots$trigger !== void 0 ? _slots$trigger : createVNode(select_view_default, mergeProps({
|
|
614
644
|
"ref": selectViewRef,
|
|
615
645
|
"class": prefixCls,
|
|
616
646
|
"modelValue": selectViewValue.value,
|
|
@@ -368,6 +368,17 @@ declare const TimePicker: {
|
|
|
368
368
|
hideDisabledOptions: boolean;
|
|
369
369
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
370
370
|
$slots: {
|
|
371
|
+
trigger?: (props: {
|
|
372
|
+
value: string | (string | undefined)[] | undefined;
|
|
373
|
+
date: Date | (Date | undefined)[] | undefined;
|
|
374
|
+
displayValue: string | (string | undefined)[];
|
|
375
|
+
inputValue: string | (string | undefined)[] | undefined;
|
|
376
|
+
popupVisible: boolean;
|
|
377
|
+
disabled: boolean;
|
|
378
|
+
readonly: boolean;
|
|
379
|
+
range: boolean;
|
|
380
|
+
}) => any;
|
|
381
|
+
} & {
|
|
371
382
|
prefix?: (props: {}) => any;
|
|
372
383
|
} & {
|
|
373
384
|
'suffix-icon'?: (props: {}) => any;
|
|
@@ -378,5 +389,5 @@ declare const TimePicker: {
|
|
|
378
389
|
install: (app: App, options?: SDOptions) => void;
|
|
379
390
|
};
|
|
380
391
|
export type TimePickerInstance = InstanceType<typeof _TimePicker>;
|
|
381
|
-
export type { TimeValue } from './interface';
|
|
392
|
+
export type { TimePickerTriggerSlotProps, TimeValue } from './interface';
|
|
382
393
|
export default TimePicker;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { Dayjs } from 'dayjs';
|
|
2
2
|
export type TimeValue = Date | string | number;
|
|
3
|
+
export interface TimePickerTriggerSlotProps {
|
|
4
|
+
value: string | Array<string | undefined> | undefined;
|
|
5
|
+
date: Date | Array<Date | undefined> | undefined;
|
|
6
|
+
displayValue: string | Array<string | undefined>;
|
|
7
|
+
inputValue: string | Array<string | undefined> | undefined;
|
|
8
|
+
popupVisible: boolean;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
readonly: boolean;
|
|
11
|
+
range: boolean;
|
|
12
|
+
}
|
|
3
13
|
export interface BasePanelProps {
|
|
4
14
|
disableConfirm: boolean;
|
|
5
15
|
use12Hours: boolean;
|
|
@@ -2,13 +2,24 @@ import { PropType } from 'vue';
|
|
|
2
2
|
import type { FloatingOptions } from '../_utils/floating';
|
|
3
3
|
import { Size } from '../_utils/constant';
|
|
4
4
|
import { TriggerProps } from '../trigger';
|
|
5
|
-
declare var
|
|
5
|
+
declare var __VLS_10: {
|
|
6
|
+
value: string | (string | undefined)[] | undefined;
|
|
7
|
+
date: Date | (Date | undefined)[] | undefined;
|
|
8
|
+
displayValue: string | (string | undefined)[];
|
|
9
|
+
inputValue: string | (string | undefined)[] | undefined;
|
|
10
|
+
popupVisible: boolean;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
readonly: boolean;
|
|
13
|
+
range: boolean;
|
|
14
|
+
}, __VLS_23: {}, __VLS_26: {}, __VLS_44: {};
|
|
6
15
|
type __VLS_Slots = {} & {
|
|
7
|
-
|
|
16
|
+
trigger?: (props: typeof __VLS_10) => any;
|
|
17
|
+
} & {
|
|
18
|
+
prefix?: (props: typeof __VLS_23) => any;
|
|
8
19
|
} & {
|
|
9
|
-
'suffix-icon'?: (props: typeof
|
|
20
|
+
'suffix-icon'?: (props: typeof __VLS_26) => any;
|
|
10
21
|
} & {
|
|
11
|
-
extra?: (props: typeof
|
|
22
|
+
extra?: (props: typeof __VLS_44) => any;
|
|
12
23
|
};
|
|
13
24
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
14
25
|
type: {
|
|
@@ -201,6 +201,11 @@ var time_picker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
201
201
|
const props = __props;
|
|
202
202
|
const emit = __emit;
|
|
203
203
|
/**
|
|
204
|
+
* @zh 自定义触发元素
|
|
205
|
+
* @en Custom trigger element
|
|
206
|
+
* @slot trigger
|
|
207
|
+
*/
|
|
208
|
+
/**
|
|
204
209
|
* @zh 输入框前缀
|
|
205
210
|
* @en Input box prefix
|
|
206
211
|
* @slot prefix
|
|
@@ -236,6 +241,12 @@ var time_picker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
236
241
|
isRange,
|
|
237
242
|
format: computedFormat
|
|
238
243
|
}));
|
|
244
|
+
const triggerValue = computed(() => getFormattedValue(computedValue.value, computedFormat.value));
|
|
245
|
+
const triggerDate = computed(() => getDateValue(computedValue.value));
|
|
246
|
+
const triggerDisplayValue = computed(() => {
|
|
247
|
+
var _triggerValue$value;
|
|
248
|
+
return (_triggerValue$value = triggerValue.value) !== null && _triggerValue$value !== void 0 ? _triggerValue$value : isRange.value ? [] : "";
|
|
249
|
+
});
|
|
239
250
|
const [panelVisible, setLocalVisible] = useMergeState(defaultPopupVisible.value, reactive({ value: popupVisible }));
|
|
240
251
|
const setPanelVisible = (newVisible) => {
|
|
241
252
|
if (newVisible !== panelVisible.value) {
|
|
@@ -438,7 +449,16 @@ var time_picker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
438
449
|
"hide-disabled-options",
|
|
439
450
|
"hide-footer"
|
|
440
451
|
]))], 2)]),
|
|
441
|
-
default: withCtx(() => [(
|
|
452
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "trigger", {
|
|
453
|
+
value: triggerValue.value,
|
|
454
|
+
date: triggerDate.value,
|
|
455
|
+
displayValue: triggerDisplayValue.value,
|
|
456
|
+
inputValue: unref(inputValue),
|
|
457
|
+
popupVisible: unref(panelVisible),
|
|
458
|
+
disabled: unref(mergedDisabled),
|
|
459
|
+
readonly: Boolean(__props.readonly),
|
|
460
|
+
range: isRange.value
|
|
461
|
+
}, () => [(openBlock(), createBlock(resolveDynamicComponent(InputComponent.value), mergeProps(_objectSpread2(_objectSpread2({}, _ctx.$attrs), inputProps.value), {
|
|
442
462
|
ref_key: "refInput",
|
|
443
463
|
ref: refInput,
|
|
444
464
|
"input-value": unref(inputValue),
|
|
@@ -483,7 +503,7 @@ var time_picker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
483
503
|
"fit-width-fallback",
|
|
484
504
|
"fit-width-fallback-text",
|
|
485
505
|
"onClear"
|
|
486
|
-
]))]),
|
|
506
|
+
]))])]),
|
|
487
507
|
_: 3
|
|
488
508
|
}, 16, [
|
|
489
509
|
"position",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SFCWithInstall } from '../_utils/types';
|
|
2
2
|
import type { TreeSelectProps } from './interface';
|
|
3
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';
|
|
4
|
+
export type { ChangeHandler as TreeSelectChangeHandler, ClearHandler as TreeSelectClearHandler, FallbackOption as TreeSelectFallbackOption, FilterTreeNode as TreeSelectFilterTreeNode, LabelValue, PopupVisibleChangeHandler as TreeSelectPopupVisibleChangeHandler, SearchHandler as TreeSelectSearchHandler, TreeSelectProps, TreeSelectTriggerSlotProps, TreeSelectValue, } from './interface';
|
|
5
5
|
declare const TreeSelect: SFCWithInstall<typeof _TreeSelect>;
|
|
6
6
|
export type TreeSelectInstance = InstanceType<typeof _TreeSelect>;
|
|
7
7
|
export type TreeSelectLoadMore = NonNullable<TreeSelectProps['loadMore']>;
|
|
@@ -9,6 +9,16 @@ export interface LabelValue {
|
|
|
9
9
|
label: string | number;
|
|
10
10
|
}
|
|
11
11
|
export type TreeSelectValue = TreeNodeKey | TreeNodeKey[] | LabelValue | LabelValue[];
|
|
12
|
+
export interface TreeSelectTriggerSlotProps {
|
|
13
|
+
value: TreeSelectValue | undefined;
|
|
14
|
+
displayValue: string | string[];
|
|
15
|
+
inputValue: string;
|
|
16
|
+
selectedOptions: TreeNodeData[];
|
|
17
|
+
popupVisible: boolean;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
loading: boolean;
|
|
20
|
+
multiple: boolean;
|
|
21
|
+
}
|
|
12
22
|
export type FilterTreeNode = (searchKey: string, nodeData: TreeNodeData) => boolean;
|
|
13
23
|
export type FallbackOption = boolean | ((key: TreeNodeKey) => TreeNodeData | boolean);
|
|
14
24
|
export type ChangeHandler = (selectedValue: TreeSelectValue | undefined) => void;
|
|
@@ -37,6 +47,7 @@ export interface TreeSelectProps extends FitWidthProps {
|
|
|
37
47
|
fieldNames: TreeFieldNames | undefined;
|
|
38
48
|
data: TreeNodeData[];
|
|
39
49
|
options: TreeNodeData[] | undefined;
|
|
50
|
+
ellipsis: TreeProps['ellipsis'] | undefined;
|
|
40
51
|
labelInValue: boolean;
|
|
41
52
|
treeCheckable: boolean;
|
|
42
53
|
checkable: boolean | undefined;
|
|
@@ -4,6 +4,7 @@ import { ScrollbarProps } from '../scrollbar';
|
|
|
4
4
|
import { TreeProps, TreeNodeKey } from '../tree/interface';
|
|
5
5
|
type TreeSelectPanelComponent = DefineComponent<{
|
|
6
6
|
treeProps: Partial<TreeProps> | undefined;
|
|
7
|
+
ellipsis: TreeProps['ellipsis'];
|
|
7
8
|
selectedKeys: TreeNodeKey[] | undefined;
|
|
8
9
|
showCheckable: boolean;
|
|
9
10
|
treeSlots: Slots;
|
package/es/tree-select/panel.js
CHANGED
|
@@ -16,6 +16,10 @@ var panel_default = /* @__PURE__ */ defineComponent({
|
|
|
16
16
|
type: Object,
|
|
17
17
|
default: () => ({})
|
|
18
18
|
},
|
|
19
|
+
ellipsis: {
|
|
20
|
+
type: [Boolean, String],
|
|
21
|
+
default: false
|
|
22
|
+
},
|
|
19
23
|
selectedKeys: { type: Array },
|
|
20
24
|
showCheckable: { type: Boolean },
|
|
21
25
|
treeSlots: {
|
|
@@ -54,6 +58,7 @@ var panel_default = /* @__PURE__ */ defineComponent({
|
|
|
54
58
|
};
|
|
55
59
|
const renderTree = () => {
|
|
56
60
|
return createVNode(Tree, mergeProps({ "ref": refTree }, computedTreeProps.value, {
|
|
61
|
+
"ellipsis": props.ellipsis,
|
|
57
62
|
"onSelect": onSelect,
|
|
58
63
|
"onCheck": onCheck
|
|
59
64
|
}), props.treeSlots);
|
|
@@ -7,7 +7,16 @@ import { ScrollbarProps } from '../scrollbar';
|
|
|
7
7
|
import { TreeFieldNames, TreeNodeData, TreeProps } from '../tree/interface';
|
|
8
8
|
import { TriggerProps } from '../trigger';
|
|
9
9
|
import { LabelValue, TreeSelectValue } from './interface';
|
|
10
|
-
declare var __VLS_16: {
|
|
10
|
+
declare var __VLS_16: {
|
|
11
|
+
value: TreeSelectValue | undefined;
|
|
12
|
+
displayValue: string | string[];
|
|
13
|
+
inputValue: string;
|
|
14
|
+
selectedOptions: TreeNodeData[];
|
|
15
|
+
popupVisible: boolean;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
multiple: boolean;
|
|
19
|
+
}, __VLS_32: {}, __VLS_35: any, __VLS_38: {
|
|
11
20
|
data: any;
|
|
12
21
|
}, __VLS_41: {}, __VLS_43: {}, __VLS_50: {}, __VLS_64: {};
|
|
13
22
|
type __VLS_Slots = {} & {
|
|
@@ -102,6 +111,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
102
111
|
options: {
|
|
103
112
|
type: PropType<TreeNodeData[]>;
|
|
104
113
|
};
|
|
114
|
+
ellipsis: {
|
|
115
|
+
type: PropType<TreeProps["ellipsis"]>;
|
|
116
|
+
default: undefined;
|
|
117
|
+
};
|
|
105
118
|
labelInValue: {
|
|
106
119
|
type: BooleanConstructor;
|
|
107
120
|
};
|
|
@@ -293,6 +306,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
293
306
|
options: {
|
|
294
307
|
type: PropType<TreeNodeData[]>;
|
|
295
308
|
};
|
|
309
|
+
ellipsis: {
|
|
310
|
+
type: PropType<TreeProps["ellipsis"]>;
|
|
311
|
+
default: undefined;
|
|
312
|
+
};
|
|
296
313
|
labelInValue: {
|
|
297
314
|
type: BooleanConstructor;
|
|
298
315
|
};
|
|
@@ -411,6 +428,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
411
428
|
"onPopup-visible-change"?: ((_visible: boolean) => any) | undefined;
|
|
412
429
|
}>, {
|
|
413
430
|
show: boolean;
|
|
431
|
+
ellipsis: import("../tree/interface").TreeEllipsis;
|
|
414
432
|
separator: string;
|
|
415
433
|
scrollbar: boolean | ScrollbarProps;
|
|
416
434
|
border: boolean;
|
|
@@ -167,6 +167,14 @@ var tree_select_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
167
167
|
* */
|
|
168
168
|
options: { type: Array },
|
|
169
169
|
/**
|
|
170
|
+
* @zh 是否使用 Ellipsis 组件渲染选项。传入 `performant-ellipsis` 时使用高性能省略实现
|
|
171
|
+
* @en Whether to render options with the Ellipsis component. Use `performant-ellipsis` for the performant implementation
|
|
172
|
+
*/
|
|
173
|
+
ellipsis: {
|
|
174
|
+
type: [Boolean, String],
|
|
175
|
+
default: void 0
|
|
176
|
+
},
|
|
177
|
+
/**
|
|
170
178
|
* @zh 设置value格式。默认是string,设置为true时候,value格式为: { label: string, value: string }
|
|
171
179
|
* @en Set the value format. The default is string, when set to true, the value format is: {label: string, value: string}
|
|
172
180
|
* */
|
|
@@ -439,8 +447,8 @@ var tree_select_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
439
447
|
});
|
|
440
448
|
const { mergedAllowClear } = useAllowClear(computed(() => props.allowClear || props.clearable));
|
|
441
449
|
const { mergedDropdownVirtualListProps } = useDropdownVirtualListProps(computed(() => {
|
|
442
|
-
var _props$virtualListPro, _treeProps$value;
|
|
443
|
-
return (_props$virtualListPro = props.virtualListProps) !== null && _props$virtualListPro !== void 0 ? _props$virtualListPro : (_treeProps$value = treeProps.value) === null || _treeProps$value === void 0 ? void 0 : _treeProps$value.virtualListProps;
|
|
450
|
+
var _ref, _props$virtualListPro, _treeProps$value;
|
|
451
|
+
return (_ref = (_props$virtualListPro = props.virtualListProps) !== null && _props$virtualListPro !== void 0 ? _props$virtualListPro : (_treeProps$value = treeProps.value) === null || _treeProps$value === void 0 ? void 0 : _treeProps$value.virtualListProps) !== null && _ref !== void 0 ? _ref : props.virtualScroll === true ? {} : void 0;
|
|
444
452
|
}));
|
|
445
453
|
const TreeSelectEmpty = configCtx === null || configCtx === void 0 || (_configCtx$slots$empt = (_configCtx$slots = configCtx.slots).empty) === null || _configCtx$slots$empt === void 0 || (_configCtx$slots$empt = _configCtx$slots$empt.call(_configCtx$slots, { component: "tree-select" })) === null || _configCtx$slots$empt === void 0 ? void 0 : _configCtx$slots$empt[0];
|
|
446
454
|
const mergedModelValue = computed(() => modelValue.value);
|
|
@@ -454,9 +462,13 @@ var tree_select_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
454
462
|
return (_checkStrategy$value = checkStrategy.value) !== null && _checkStrategy$value !== void 0 ? _checkStrategy$value : props.treeCheckedStrategy;
|
|
455
463
|
});
|
|
456
464
|
const mergedTreeProps = computed(() => {
|
|
465
|
+
var _ref3, _props$ellipsis2, _treeProps$value3;
|
|
457
466
|
const resolvedVirtualListProps = resolveDropdownVirtualListProps(mergedDropdownVirtualListProps.value, props.triggerProps);
|
|
458
|
-
if (virtualScroll.value !== false)
|
|
459
|
-
|
|
467
|
+
if (virtualScroll.value !== false) {
|
|
468
|
+
var _ref2, _props$ellipsis, _treeProps$value2;
|
|
469
|
+
return _objectSpread2(_objectSpread2({}, treeProps.value), {}, { ellipsis: (_ref2 = (_props$ellipsis = props.ellipsis) !== null && _props$ellipsis !== void 0 ? _props$ellipsis : (_treeProps$value2 = treeProps.value) === null || _treeProps$value2 === void 0 ? void 0 : _treeProps$value2.ellipsis) !== null && _ref2 !== void 0 ? _ref2 : true }, resolvedVirtualListProps ? { virtualListProps: resolvedVirtualListProps } : {});
|
|
470
|
+
}
|
|
471
|
+
const nextTreeProps = _objectSpread2(_objectSpread2({}, treeProps.value), {}, { ellipsis: (_ref3 = (_props$ellipsis2 = props.ellipsis) !== null && _props$ellipsis2 !== void 0 ? _props$ellipsis2 : (_treeProps$value3 = treeProps.value) === null || _treeProps$value3 === void 0 ? void 0 : _treeProps$value3.ellipsis) !== null && _ref3 !== void 0 ? _ref3 : true });
|
|
460
472
|
delete nextTreeProps.virtualListProps;
|
|
461
473
|
return nextTreeProps;
|
|
462
474
|
});
|
|
@@ -504,6 +516,16 @@ var tree_select_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
504
516
|
return _objectSpread2(_objectSpread2({}, i), {}, { option: node === null || node === void 0 ? void 0 : node.treeNodeData });
|
|
505
517
|
});
|
|
506
518
|
});
|
|
519
|
+
const triggerValue = computed(() => {
|
|
520
|
+
const values = labelInValue.value ? selectedValue.value : selectedKeys.value;
|
|
521
|
+
return isMultiple.value ? values : values === null || values === void 0 ? void 0 : values[0];
|
|
522
|
+
});
|
|
523
|
+
const triggerDisplayValue = computed(() => {
|
|
524
|
+
var _labels$;
|
|
525
|
+
const labels = selectViewValue.value.map((item) => String(item.label));
|
|
526
|
+
return isMultiple.value ? labels : (_labels$ = labels[0]) !== null && _labels$ !== void 0 ? _labels$ : "";
|
|
527
|
+
});
|
|
528
|
+
const triggerSelectedOptions = computed(() => selectViewValue.value.map((item) => item.option).filter((option) => Boolean(option)));
|
|
507
529
|
const setSelectedKeys = (newVal) => {
|
|
508
530
|
setLocalSelectedKeys(newVal);
|
|
509
531
|
nextTick(() => {
|
|
@@ -662,6 +684,7 @@ var tree_select_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
662
684
|
"selected-keys": unref(selectedKeys),
|
|
663
685
|
"show-checkable": mergedTreeCheckable.value,
|
|
664
686
|
scrollbar: __props.scrollbar,
|
|
687
|
+
ellipsis: mergedTreeProps.value.ellipsis,
|
|
665
688
|
"tree-props": _objectSpread2(_objectSpread2({
|
|
666
689
|
actionOnNodeClick: unref(selectable) === "leaf" ? "expand" : void 0,
|
|
667
690
|
blockNode: true
|
|
@@ -684,6 +707,7 @@ var tree_select_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
684
707
|
"selected-keys",
|
|
685
708
|
"show-checkable",
|
|
686
709
|
"scrollbar",
|
|
710
|
+
"ellipsis",
|
|
687
711
|
"tree-props",
|
|
688
712
|
"tree-slots"
|
|
689
713
|
])),
|
|
@@ -692,7 +716,16 @@ var tree_select_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
692
716
|
class: normalizeClass(`${unref(prefixCls)}-footer`)
|
|
693
717
|
}, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("", true)
|
|
694
718
|
], 6)]),
|
|
695
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "trigger", {
|
|
719
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "trigger", {
|
|
720
|
+
value: triggerValue.value,
|
|
721
|
+
displayValue: triggerDisplayValue.value,
|
|
722
|
+
inputValue: computedInputValue.value,
|
|
723
|
+
selectedOptions: triggerSelectedOptions.value,
|
|
724
|
+
popupVisible: unref(panelVisible),
|
|
725
|
+
disabled: unref(mergedDisabled),
|
|
726
|
+
loading: __props.loading,
|
|
727
|
+
multiple: isMultiple.value
|
|
728
|
+
}, () => [createVNode(unref(select_view_default), mergeProps({
|
|
696
729
|
ref_key: "refSelectView",
|
|
697
730
|
ref: refSelectView,
|
|
698
731
|
"model-value": selectViewValue.value,
|
|
@@ -2986,6 +2986,9 @@
|
|
|
2986
2986
|
"description": "Whether it is read-only",
|
|
2987
2987
|
"type": "boolean|string"
|
|
2988
2988
|
},
|
|
2989
|
+
"sd-select/ellipsis": {
|
|
2990
|
+
"description": "Whether to render options with the Ellipsis component. Use `performant-ellipsis` for the performant implementation"
|
|
2991
|
+
},
|
|
2989
2992
|
"sd-sender-header/open": {
|
|
2990
2993
|
"description": "Whether the header is expanded",
|
|
2991
2994
|
"type": "boolean"
|
|
@@ -4309,6 +4312,9 @@
|
|
|
4309
4312
|
"sd-tree-select/options": {
|
|
4310
4313
|
"description": "Data, Naive compatibility alias"
|
|
4311
4314
|
},
|
|
4315
|
+
"sd-tree-select/ellipsis": {
|
|
4316
|
+
"description": "Whether to render options with the Ellipsis component. Use `performant-ellipsis` for the performant implementation"
|
|
4317
|
+
},
|
|
4312
4318
|
"sd-tree-select/label-in-value": {
|
|
4313
4319
|
"description": "Set the value format. The default is string, when set to true, the value format is: {label: string, value: string}",
|
|
4314
4320
|
"type": "boolean"
|
package/json/vetur-tags.json
CHANGED
|
@@ -1211,7 +1211,8 @@
|
|
|
1211
1211
|
"fit-width",
|
|
1212
1212
|
"max-wfull",
|
|
1213
1213
|
"spin-props",
|
|
1214
|
-
"readonly"
|
|
1214
|
+
"readonly",
|
|
1215
|
+
"ellipsis"
|
|
1215
1216
|
]
|
|
1216
1217
|
},
|
|
1217
1218
|
"sd-selectable-card": {
|
|
@@ -1726,6 +1727,7 @@
|
|
|
1726
1727
|
"field-names",
|
|
1727
1728
|
"data",
|
|
1728
1729
|
"options",
|
|
1730
|
+
"ellipsis",
|
|
1729
1731
|
"label-in-value",
|
|
1730
1732
|
"tree-checkable",
|
|
1731
1733
|
"checkable",
|
package/json/web-types.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "@sdata/web-vue",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.21.0",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"types-syntax": "typescript",
|
|
@@ -7277,6 +7277,14 @@
|
|
|
7277
7277
|
"type": "boolean|string",
|
|
7278
7278
|
"kind": "expression"
|
|
7279
7279
|
}
|
|
7280
|
+
},
|
|
7281
|
+
{
|
|
7282
|
+
"name": "ellipsis",
|
|
7283
|
+
"description": "Whether to render options with the Ellipsis component. Use `performant-ellipsis` for the performant implementation",
|
|
7284
|
+
"value": {
|
|
7285
|
+
"type": "boolean | 'performant-ellipsis'",
|
|
7286
|
+
"kind": "expression"
|
|
7287
|
+
}
|
|
7280
7288
|
}
|
|
7281
7289
|
],
|
|
7282
7290
|
"events": [],
|
|
@@ -10407,6 +10415,14 @@
|
|
|
10407
10415
|
"kind": "expression"
|
|
10408
10416
|
}
|
|
10409
10417
|
},
|
|
10418
|
+
{
|
|
10419
|
+
"name": "ellipsis",
|
|
10420
|
+
"description": "Whether to render options with the Ellipsis component. Use `performant-ellipsis` for the performant implementation",
|
|
10421
|
+
"value": {
|
|
10422
|
+
"type": "TreeProps['ellipsis']",
|
|
10423
|
+
"kind": "expression"
|
|
10424
|
+
}
|
|
10425
|
+
},
|
|
10410
10426
|
{
|
|
10411
10427
|
"name": "label-in-value",
|
|
10412
10428
|
"description": "Set the value format. The default is string, when set to true, the value format is: {label: string, value: string}",
|