@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.
Files changed (40) hide show
  1. package/dist/sd.css +1 -0
  2. package/dist/sd.min.css +1 -1
  3. package/es/cascader/cascader-option.js +7 -3
  4. package/es/cascader/cascader-panel.vue.d.ts +1 -0
  5. package/es/cascader/cascader-panel.vue_vue_type_script_setup_true_lang.js +7 -2
  6. package/es/cascader/cascader.vue.d.ts +21 -8
  7. package/es/cascader/cascader.vue_vue_type_script_setup_true_lang.js +38 -3
  8. package/es/cascader/context.d.ts +1 -0
  9. package/es/cascader/index.d.ts +1 -1
  10. package/es/cascader/style/index.css +1 -0
  11. package/es/cascader/style/index.scss +1 -0
  12. package/es/cascader/types.d.ts +13 -0
  13. package/es/color-picker/color-picker.js +13 -1
  14. package/es/color-picker/index.d.ts +1 -1
  15. package/es/color-picker/interface.d.ts +10 -0
  16. package/es/date-picker/index.d.ts +12 -1
  17. package/es/date-picker/interface.d.ts +19 -0
  18. package/es/date-picker/picker.vue.d.ts +23 -13
  19. package/es/date-picker/picker.vue_vue_type_script_setup_true_lang.js +23 -2
  20. package/es/date-picker/range-picker.vue.d.ts +25 -14
  21. package/es/date-picker/range-picker.vue_vue_type_script_setup_true_lang.js +21 -2
  22. package/es/index.css +1 -0
  23. package/es/select/index.d.ts +16 -1
  24. package/es/select/interface.d.ts +11 -0
  25. package/es/select/select.d.ts +9 -0
  26. package/es/select/select.js +33 -3
  27. package/es/time-picker/index.d.ts +12 -1
  28. package/es/time-picker/interface.d.ts +10 -0
  29. package/es/time-picker/time-picker.vue.d.ts +15 -4
  30. package/es/time-picker/time-picker.vue_vue_type_script_setup_true_lang.js +22 -2
  31. package/es/tree-select/index.d.ts +1 -1
  32. package/es/tree-select/interface.d.ts +11 -0
  33. package/es/tree-select/panel.d.ts +1 -0
  34. package/es/tree-select/panel.js +5 -0
  35. package/es/tree-select/tree-select.vue.d.ts +19 -1
  36. package/es/tree-select/tree-select.vue_vue_type_script_setup_true_lang.js +38 -5
  37. package/json/vetur-attributes.json +6 -0
  38. package/json/vetur-tags.json +3 -1
  39. package/json/web-types.json +17 -1
  40. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { getPrefixCls } from "../_utils/global-config.js";
2
2
  import { isFunction } from "../_utils/is.js";
3
3
  import IconLoading from "../icon/icon-loading/index.js";
4
- import { PerformantEllipsis } from "../ellipsis/index.js";
4
+ import Ellipsis, { PerformantEllipsis } from "../ellipsis/index.js";
5
5
  import IconRight from "../icon/icon-right/index.js";
6
6
  import Checkbox from "../checkbox/index.js";
7
7
  import Radio from "../radio/index.js";
@@ -82,15 +82,19 @@ var cascader_option_default = /* @__PURE__ */ defineComponent({
82
82
  }
83
83
  return getCheckedStatus(props.option, cascaderCtx.valueMap);
84
84
  });
85
+ const renderEllipsis = (label) => {
86
+ if (cascaderCtx.ellipsis === false) return label;
87
+ return createVNode(cascaderCtx.ellipsis === "performant-ellipsis" ? PerformantEllipsis : Ellipsis, null, _isSlot(label) ? label : { default: () => [label] });
88
+ };
85
89
  const renderLabelContent = () => {
86
90
  var _cascaderCtx$slots;
87
91
  if (props.pathLabel) {
88
92
  var _cascaderCtx$formatLa, _cascaderCtx$formatLa2;
89
93
  const label = (_cascaderCtx$formatLa = cascaderCtx === null || cascaderCtx === void 0 || (_cascaderCtx$formatLa2 = cascaderCtx.formatLabel) === null || _cascaderCtx$formatLa2 === void 0 ? void 0 : _cascaderCtx$formatLa2.call(cascaderCtx, props.option.path.map((item) => item.raw))) !== null && _cascaderCtx$formatLa !== void 0 ? _cascaderCtx$formatLa : getOptionLabel(props.option, { separator: cascaderCtx.separator });
90
- return createVNode(PerformantEllipsis, null, _isSlot(label) ? label : { default: () => [label] });
94
+ return renderEllipsis(label);
91
95
  }
92
96
  if ((_cascaderCtx$slots = cascaderCtx.slots) === null || _cascaderCtx$slots === void 0 ? void 0 : _cascaderCtx$slots.option) return cascaderCtx.slots.option({ data: props.option });
93
- return createVNode(PerformantEllipsis, null, { default: () => [props.option.label] });
97
+ return renderEllipsis(props.option.label);
94
98
  };
95
99
  const renderIcon = () => {
96
100
  if (isLoading.value) return createVNode(IconLoading, null, null);
@@ -12,6 +12,7 @@ declare const __VLS_base: import("vue").DefineComponent<CascaderPanelProps, {},
12
12
  "onUpdate:modelValue"?: ((value: CascaderModelValue) => any) | undefined;
13
13
  }>, {
14
14
  options: CascaderOption[];
15
+ ellipsis: boolean | "performant-ellipsis";
15
16
  multiple: boolean;
16
17
  valueKey: string;
17
18
  expandTrigger: import("./types").CascaderExpandTrigger;
@@ -18,6 +18,10 @@ var cascader_panel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
18
18
  type: Boolean,
19
19
  default: false
20
20
  },
21
+ ellipsis: {
22
+ type: [Boolean, String],
23
+ default: true
24
+ },
21
25
  modelValue: {},
22
26
  defaultValue: {},
23
27
  options: { default: () => [] },
@@ -45,7 +49,7 @@ var cascader_panel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
45
49
  if (pathMode) return;
46
50
  return "";
47
51
  };
48
- const { options, checkStrictly, loadMore, modelValue, valueKey, expandChild, expandTrigger, multiple, pathMode } = toRefs(props);
52
+ const { options, checkStrictly, loadMore, modelValue, valueKey, expandChild, expandTrigger, multiple, ellipsis, pathMode } = toRefs(props);
49
53
  const _value = ref((_props$defaultValue = props.defaultValue) !== null && _props$defaultValue !== void 0 ? _props$defaultValue : getDefaultValue(props.multiple, props.pathMode));
50
54
  watch(modelValue, (nextModelValue) => {
51
55
  if (isUndefined(nextModelValue) || isNull(nextModelValue)) _value.value = getDefaultValue(props.multiple, props.pathMode);
@@ -148,7 +152,8 @@ var cascader_panel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
148
152
  addLazyLoadOptions,
149
153
  slots,
150
154
  valueMap: computedValueMap,
151
- expandTrigger: expandTrigger.value
155
+ expandTrigger: expandTrigger.value,
156
+ ellipsis: ellipsis.value
152
157
  }));
153
158
  const handleKeyDown = getKeyDownHandler(/* @__PURE__ */ new Map([
154
159
  [KEYBOARD_KEY.ENTER, (_ev) => {
@@ -1,20 +1,32 @@
1
1
  import type { CascaderModelValue, CascaderOption } from './interface';
2
2
  import type { CascaderProps } from './types';
3
- declare var __VLS_30: any, __VLS_33: {}, __VLS_36: {}, __VLS_39: {}, __VLS_42: {}, __VLS_52: {}, __VLS_61: {};
3
+ declare var __VLS_16: {
4
+ value: CascaderModelValue;
5
+ displayValue: string | string[];
6
+ inputValue: string;
7
+ selectedOptions: CascaderOption[];
8
+ selectedPaths: CascaderOption[][];
9
+ popupVisible: boolean;
10
+ disabled: boolean;
11
+ loading: boolean;
12
+ multiple: boolean;
13
+ }, __VLS_32: any, __VLS_35: {}, __VLS_38: {}, __VLS_41: {}, __VLS_44: {}, __VLS_54: {}, __VLS_63: {};
4
14
  type __VLS_Slots = {} & {
5
- label?: (props: typeof __VLS_30) => any;
15
+ trigger?: (props: typeof __VLS_16) => any;
16
+ } & {
17
+ label?: (props: typeof __VLS_32) => any;
6
18
  } & {
7
- prefix?: (props: typeof __VLS_33) => any;
19
+ prefix?: (props: typeof __VLS_35) => any;
8
20
  } & {
9
- 'arrow-icon'?: (props: typeof __VLS_36) => any;
21
+ 'arrow-icon'?: (props: typeof __VLS_38) => any;
10
22
  } & {
11
- 'loading-icon'?: (props: typeof __VLS_39) => any;
23
+ 'loading-icon'?: (props: typeof __VLS_41) => any;
12
24
  } & {
13
- 'search-icon'?: (props: typeof __VLS_42) => any;
25
+ 'search-icon'?: (props: typeof __VLS_44) => any;
14
26
  } & {
15
- empty?: (props: typeof __VLS_52) => any;
27
+ empty?: (props: typeof __VLS_54) => any;
16
28
  } & {
17
- empty?: (props: typeof __VLS_61) => any;
29
+ empty?: (props: typeof __VLS_63) => any;
18
30
  };
19
31
  declare const __VLS_base: import("vue").DefineComponent<CascaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
32
  search: (value: string) => any;
@@ -42,6 +54,7 @@ declare const __VLS_base: import("vue").DefineComponent<CascaderProps, {}, {}, {
42
54
  onShowChange?: ((visible: boolean) => any) | undefined;
43
55
  }>, {
44
56
  options: CascaderOption[];
57
+ ellipsis: boolean | "performant-ellipsis";
45
58
  separator: string;
46
59
  multiple: boolean;
47
60
  disabled: boolean;
@@ -35,6 +35,10 @@ var cascader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
35
35
  type: Boolean,
36
36
  default: false
37
37
  },
38
+ ellipsis: {
39
+ type: [Boolean, String],
40
+ default: true
41
+ },
38
42
  modelValue: {},
39
43
  defaultValue: {},
40
44
  options: { default: () => [] },
@@ -136,6 +140,11 @@ var cascader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
136
140
  var _props$defaultValue;
137
141
  const props = __props;
138
142
  const emit = __emit;
143
+ /**
144
+ * @zh 自定义触发元素
145
+ * @en Custom trigger element
146
+ * @slot trigger
147
+ */
139
148
  const attrs = useAttrs();
140
149
  const slots = useSlots();
141
150
  const configCtx = inject(configProviderInjectionKey, void 0);
@@ -144,7 +153,7 @@ var cascader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
144
153
  if (pathMode) return;
145
154
  return "";
146
155
  };
147
- const { options, checkStrictly, loadMore, formatLabel, modelValue, disabled, valueKey, expandTrigger, expandChild, pathMode, multiple, popupVisible, show, defaultPopupVisible, defaultShow, error, size, placeholder, loading, spinProps, maxTagCount, tagNowrap, popupContainer, floatingOptions, searchOptionOnlyLabel } = toRefs(props);
156
+ const { options, checkStrictly, loadMore, formatLabel, modelValue, disabled, valueKey, expandTrigger, expandChild, pathMode, multiple, ellipsis, popupVisible, show, defaultPopupVisible, defaultShow, error, size, placeholder, loading, spinProps, maxTagCount, tagNowrap, popupContainer, floatingOptions, searchOptionOnlyLabel } = toRefs(props);
148
157
  const resolvedSpinProps = computed(() => _objectSpread2(_objectSpread2({}, configCtx === null || configCtx === void 0 ? void 0 : configCtx.cascaderSpinProps), spinProps.value));
149
158
  const _value = ref((_props$defaultValue = props.defaultValue) !== null && _props$defaultValue !== void 0 ? _props$defaultValue : getDefaultValue(props.multiple, props.pathMode));
150
159
  const _inputValue = ref(props.defaultInputValue);
@@ -400,6 +409,7 @@ var cascader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
400
409
  setSelectedPath,
401
410
  loadMore,
402
411
  expandTrigger,
412
+ ellipsis,
403
413
  addLazyLoadOptions,
404
414
  formatLabel,
405
415
  separator: props.separator,
@@ -484,6 +494,21 @@ var cascader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
484
494
  });
485
495
  return result;
486
496
  });
497
+ const triggerValue = computed(() => {
498
+ var _values$2;
499
+ const values = Array.from(computedValueMap.value.values());
500
+ return props.multiple ? values : (_values$2 = values[0]) !== null && _values$2 !== void 0 ? _values$2 : "";
501
+ });
502
+ const triggerDisplayValue = computed(() => {
503
+ var _labels$;
504
+ const labels = selectViewValue.value.map((item) => item.label);
505
+ return props.multiple ? labels : (_labels$ = labels[0]) !== null && _labels$ !== void 0 ? _labels$ : "";
506
+ });
507
+ const triggerSelectedPaths = computed(() => Array.from(computedValueMap.value.keys()).map((key) => {
508
+ var _leafOptionMap$get;
509
+ return (_leafOptionMap$get = leafOptionMap.get(key)) === null || _leafOptionMap$get === void 0 ? void 0 : _leafOptionMap$get.path.map((item) => item.raw);
510
+ }).filter((path) => Boolean(path)));
511
+ const triggerSelectedOptions = computed(() => triggerSelectedPaths.value.map((path) => path.at(-1)).filter((option) => Boolean(option)));
487
512
  return (_ctx, _cache) => {
488
513
  return openBlock(), createBlock(unref(Tooltip), {
489
514
  "popup-visible": unref(tipVisible),
@@ -556,7 +581,17 @@ var cascader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
556
581
  "spin-props",
557
582
  "virtual-list-props"
558
583
  ]))]),
559
- default: withCtx(() => [createVNode(unref(select_view_default), mergeProps({
584
+ default: withCtx(() => [renderSlot(_ctx.$slots, "trigger", {
585
+ value: triggerValue.value,
586
+ displayValue: triggerDisplayValue.value,
587
+ inputValue: computedInputValue.value,
588
+ selectedOptions: triggerSelectedOptions.value,
589
+ selectedPaths: triggerSelectedPaths.value,
590
+ popupVisible: unref(computedPopupVisible),
591
+ disabled: unref(mergedDisabled),
592
+ loading: unref(loading),
593
+ multiple: unref(multiple)
594
+ }, () => [createVNode(unref(select_view_default), mergeProps({
560
595
  "model-value": selectViewValue.value,
561
596
  "input-value": computedInputValue.value,
562
597
  disabled: unref(mergedDisabled),
@@ -624,7 +659,7 @@ var cascader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
624
659
  "tag-nowrap",
625
660
  "input-attrs",
626
661
  "onKeydown"
627
- ])]),
662
+ ])])]),
628
663
  _: 3
629
664
  }, 16, [
630
665
  "floating-options",
@@ -11,5 +11,6 @@ export interface CascaderContext {
11
11
  slots: Slots;
12
12
  valueMap: Map<string, CascaderSingleValue>;
13
13
  expandTrigger: 'click' | 'hover';
14
+ ellipsis: boolean | 'performant-ellipsis';
14
15
  }
15
16
  export declare const cascaderInjectionKey: InjectionKey<CascaderContext>;
@@ -10,6 +10,6 @@ declare const Cascader: CascaderComponent;
10
10
  export type CascaderInstance = InstanceType<typeof _Cascader>;
11
11
  export type CascaderPanelInstance = InstanceType<typeof _CascaderPanel>;
12
12
  export type { CascaderChangeHandler, CascaderFallback, CascaderFieldNames, CascaderFormatLabel, CascaderLoadMore, CascaderModelValue, CascaderOption, CascaderOptionValue, CascaderPathValue, CascaderSearchHandler, CascaderSingleValue, } from './interface';
13
- export type { CascaderEmits, CascaderPanelEmits, CascaderPanelProps, CascaderProps } from './types';
13
+ export type { CascaderEmits, CascaderPanelEmits, CascaderPanelProps, CascaderProps, CascaderTriggerSlotProps, } from './types';
14
14
  export { _CascaderPanel as CascaderPanel };
15
15
  export default Cascader;
@@ -230,6 +230,7 @@
230
230
  color: var(--sd-color-text-1);
231
231
  font-size: 14px;
232
232
  line-height: 36px;
233
+ text-align: left;
233
234
  background-color: transparent;
234
235
  cursor: pointer;
235
236
  }
@@ -136,6 +136,7 @@ $cascader-prefix-cls: string.unquote('#{theme.$prefix}-cascader');
136
136
  color: $cascader-color-item-text;
137
137
  font-size: $cascader-font-item-size;
138
138
  line-height: $cascader-size-item-height;
139
+ text-align: left;
139
140
  background-color: transparent;
140
141
  cursor: pointer;
141
142
 
@@ -6,9 +6,21 @@ import type { SpinProps } from '../spin';
6
6
  import type { TriggerProps } from '../trigger';
7
7
  import type { CascaderFallback, CascaderFieldNames, CascaderFormatLabel, CascaderLoadMore, CascaderModelValue, CascaderOption } from './interface';
8
8
  export type CascaderExpandTrigger = 'click' | 'hover';
9
+ export interface CascaderTriggerSlotProps {
10
+ value: CascaderModelValue;
11
+ displayValue: string | string[];
12
+ inputValue: string;
13
+ selectedOptions: CascaderOption[];
14
+ selectedPaths: CascaderOption[][];
15
+ popupVisible: boolean;
16
+ disabled: boolean;
17
+ loading: boolean;
18
+ multiple: boolean;
19
+ }
9
20
  export interface CascaderProps extends FitWidthProps {
10
21
  pathMode?: boolean;
11
22
  multiple?: boolean;
23
+ ellipsis?: boolean | 'performant-ellipsis';
12
24
  modelValue?: CascaderModelValue;
13
25
  defaultValue?: CascaderModelValue;
14
26
  options?: CascaderOption[];
@@ -65,6 +77,7 @@ export type CascaderEmits = {
65
77
  export interface CascaderPanelProps {
66
78
  pathMode?: boolean;
67
79
  multiple?: boolean;
80
+ ellipsis?: boolean | 'performant-ellipsis';
68
81
  modelValue?: CascaderModelValue;
69
82
  defaultValue?: CascaderModelValue;
70
83
  options?: CascaderOption[];
@@ -273,7 +273,19 @@ var color_picker_default = /* @__PURE__ */ defineComponent({
273
273
  "content": readonlyTipText.value,
274
274
  "position": "top"
275
275
  }, { default: () => [createVNode(Trigger, mergeProps({ "onPopupVisibleChange": onPopupVisibleChange }, mergedTriggerProps.value), {
276
- default: () => [slots.default ? slots.default() : renderTriggerInput()],
276
+ default: () => {
277
+ var _ref, _slots$trigger, _slots$trigger2, _slots$default;
278
+ return [(_ref = (_slots$trigger = (_slots$trigger2 = slots.trigger) === null || _slots$trigger2 === void 0 ? void 0 : _slots$trigger2.call(slots, {
279
+ value: mergedValue.value,
280
+ displayValue: triggerInputValue.value,
281
+ color: getColorObject(colorState.value),
282
+ popupVisible: popupVisible.value,
283
+ disabled: props.disabled,
284
+ readonly: Boolean(props.readonly),
285
+ format: normalizedFormat.value,
286
+ previewStyle: previewStyle.value
287
+ })) !== null && _slots$trigger !== void 0 ? _slots$trigger : (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)) !== null && _ref !== void 0 ? _ref : renderTriggerInput()];
288
+ },
277
289
  content: renderPanel
278
290
  })] });
279
291
  };
@@ -311,6 +311,6 @@ declare const ColorPicker: {
311
311
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
312
312
  install: (app: App, options?: SDOptions) => void;
313
313
  };
314
- export type { RGB, HSV, HSVA, Color, ColorMode, ColorModes, ColorFormat, ColorObject, ColorValueState, ColorPickerChangeTrigger, GradientColorPoint, RecentColorsValue, } from './interface';
314
+ export type { RGB, HSV, HSVA, Color, ColorMode, ColorModes, ColorFormat, ColorObject, ColorValueState, ColorPickerChangeTrigger, ColorPickerTriggerSlotProps, GradientColorPoint, RecentColorsValue, } from './interface';
315
315
  export type ColorPickerInstance = InstanceType<typeof _ColorPicker>;
316
316
  export default ColorPicker;
@@ -35,6 +35,16 @@ export type ColorFormat = 'HEX' | 'HEX8' | 'RGB' | 'RGBA' | 'HSL' | 'HSLA' | 'HS
35
35
  export type RecentColorsValue = string[] | boolean | null;
36
36
  export type ColorModes = ColorMode[];
37
37
  export type ColorPickerChangeTrigger = 'palette-saturation-brightness' | 'palette-saturation' | 'palette-brightness' | 'palette-hue-bar' | 'palette-alpha-bar' | 'input' | 'preset' | 'recent' | 'clear';
38
+ export interface ColorPickerTriggerSlotProps {
39
+ value: string;
40
+ displayValue: string;
41
+ color: ColorObject;
42
+ popupVisible: boolean;
43
+ disabled: boolean;
44
+ readonly: boolean;
45
+ format: ColorFormat;
46
+ previewStyle: Record<string, string>;
47
+ }
38
48
  export interface ColorObject {
39
49
  alpha: number;
40
50
  css: string;
@@ -7,7 +7,7 @@ import _QuarterPicker from './pickers/quarter-picker';
7
7
  import _WeekPicker from './pickers/week-picker';
8
8
  import _YearPicker from './pickers/year-picker';
9
9
  import _RangePicker from './range-picker.vue';
10
- export type { CalendarValue, DatePickerProps, DisabledDate, DisabledTime, DisabledTimeProps, FormatFunc, MonthPickerProps, PickerProps, QuarterPickerProps, RangeDisabledDate, RangeDisabledTime, RangePickerProps, ShortcutType, ValueFormat, WeekPickerProps, YearPickerProps, } from './interface';
10
+ export type { CalendarValue, DatePickerProps, DatePickerTriggerSlotProps, DisabledDate, DisabledTime, DisabledTimeProps, FormatFunc, MonthPickerProps, PickerProps, QuarterPickerProps, RangeDisabledDate, RangeDisabledTime, RangePickerProps, RangePickerTriggerSlotProps, ShortcutType, ValueFormat, WeekPickerProps, YearPickerProps, } from './interface';
11
11
  export type DatePickerChangeHandler = (value: CalendarValue | undefined, date: Date | undefined, dateString: string | undefined) => void;
12
12
  export type DatePickerSelectHandler = DatePickerChangeHandler;
13
13
  export type DatePickerOkHandler = DatePickerChangeHandler;
@@ -883,6 +883,17 @@ declare const DatePicker: {
883
883
  clearRangeOnReselect: boolean;
884
884
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
885
885
  $slots: {
886
+ trigger?: (props: {
887
+ value: (CalendarValue | undefined)[] | undefined;
888
+ date: (Date | undefined)[] | undefined;
889
+ displayValue: (string | undefined)[];
890
+ inputValue: (string | undefined)[] | undefined;
891
+ popupVisible: boolean;
892
+ disabled: boolean;
893
+ disabledInputs: boolean[];
894
+ readonly: boolean;
895
+ }) => any;
896
+ } & {
886
897
  default?: (props: {}) => any;
887
898
  } & {
888
899
  prefix?: (props: {}) => any;
@@ -22,6 +22,25 @@ export type RangeDisabledDate = (current: Date, type: 'start' | 'end') => boolea
22
22
  export type RangeDisabledTime = (current: Date, type: 'start' | 'end') => DisabledTimeProps;
23
23
  export type Mode = 'date' | 'year' | 'quarter' | 'month' | 'week';
24
24
  export type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
25
+ export interface DatePickerTriggerSlotProps {
26
+ value: CalendarValue | undefined;
27
+ date: Date | undefined;
28
+ displayValue: string;
29
+ inputValue: string | undefined;
30
+ popupVisible: boolean;
31
+ disabled: boolean;
32
+ readonly: boolean;
33
+ }
34
+ export interface RangePickerTriggerSlotProps {
35
+ value: Array<CalendarValue | undefined> | undefined;
36
+ date: Array<Date | undefined> | undefined;
37
+ displayValue: Array<string | undefined>;
38
+ inputValue: Array<string | undefined> | undefined;
39
+ popupVisible: boolean;
40
+ disabled: boolean;
41
+ disabledInputs: boolean[];
42
+ readonly: boolean;
43
+ }
25
44
  export interface DatePickerProps {
26
45
  dayStartOfWeek: WeekStart;
27
46
  format?: string | FormatFunc;
@@ -15,7 +15,15 @@ declare function onPanelShortcutClick(value: Dayjs, shortcut: ShortcutType): voi
15
15
  declare function onPanelHeaderLabelClick(type: 'year' | 'month'): void;
16
16
  declare function onMonthHeaderClick(): void;
17
17
  declare function onPanelHeaderSelect(date: Dayjs): void;
18
- declare var __VLS_10: {}, __VLS_26: {}, __VLS_29: {}, __VLS_37: {
18
+ declare var __VLS_10: {
19
+ value: string | number | Date | undefined;
20
+ date: Date | undefined;
21
+ displayValue: string;
22
+ inputValue: string | undefined;
23
+ popupVisible: boolean;
24
+ disabled: boolean;
25
+ readonly: boolean;
26
+ }, __VLS_12: {}, __VLS_28: {}, __VLS_31: {}, __VLS_39: {
19
27
  component: {
20
28
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
21
29
  mode: {
@@ -465,9 +473,9 @@ declare var __VLS_10: {}, __VLS_26: {}, __VLS_29: {}, __VLS_37: {
465
473
  shortcutsPosition: "left" | "right" | "bottom";
466
474
  hideTrigger: boolean;
467
475
  };
468
- }, __VLS_46: {}, __VLS_49: {
476
+ }, __VLS_48: {}, __VLS_51: {
469
477
  date: Date;
470
- }, __VLS_51: {
478
+ }, __VLS_53: {
471
479
  component: {
472
480
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
473
481
  mode: {
@@ -917,27 +925,29 @@ declare var __VLS_10: {}, __VLS_26: {}, __VLS_29: {}, __VLS_37: {
917
925
  shortcutsPosition: "left" | "right" | "bottom";
918
926
  hideTrigger: boolean;
919
927
  };
920
- }, __VLS_60: {}, __VLS_63: {
928
+ }, __VLS_62: {}, __VLS_65: {
921
929
  date: Date;
922
930
  };
923
931
  type __VLS_Slots = {} & {
924
- default?: (props: typeof __VLS_10) => any;
932
+ trigger?: (props: typeof __VLS_10) => any;
933
+ } & {
934
+ default?: (props: typeof __VLS_12) => any;
925
935
  } & {
926
- prefix?: (props: typeof __VLS_26) => any;
936
+ prefix?: (props: typeof __VLS_28) => any;
927
937
  } & {
928
- 'suffix-icon'?: (props: typeof __VLS_29) => any;
938
+ 'suffix-icon'?: (props: typeof __VLS_31) => any;
929
939
  } & {
930
- panelRender?: (props: typeof __VLS_37) => any;
940
+ panelRender?: (props: typeof __VLS_39) => any;
931
941
  } & {
932
- extra?: (props: typeof __VLS_46) => any;
942
+ extra?: (props: typeof __VLS_48) => any;
933
943
  } & {
934
- cell?: (props: typeof __VLS_49) => any;
944
+ cell?: (props: typeof __VLS_51) => any;
935
945
  } & {
936
- panelRender?: (props: typeof __VLS_51) => any;
946
+ panelRender?: (props: typeof __VLS_53) => any;
937
947
  } & {
938
- extra?: (props: typeof __VLS_60) => any;
948
+ extra?: (props: typeof __VLS_62) => any;
939
949
  } & {
940
- cell?: (props: typeof __VLS_63) => any;
950
+ cell?: (props: typeof __VLS_65) => any;
941
951
  };
942
952
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
943
953
  locale: {
@@ -282,6 +282,11 @@ var picker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
282
282
  const props = __props;
283
283
  const emit = __emit;
284
284
  /**
285
+ * @zh 自定义触发元素
286
+ * @en Custom trigger element
287
+ * @slot trigger
288
+ */
289
+ /**
285
290
  * @zh 自定义渲染面板
286
291
  * @en Customize panel rendering
287
292
  * @slot panelRender
@@ -445,6 +450,14 @@ var picker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
445
450
  return (_ref = (_previewValue$value = previewValue.value) !== null && _previewValue$value !== void 0 ? _previewValue$value : processValue.value) !== null && _ref !== void 0 ? _ref : selectedValue.value;
446
451
  });
447
452
  const [inputValue, setInputValue] = useState();
453
+ const triggerLocalValue = computed(() => selectedValue.value ? toLocal(selectedValue.value, utcOffset === null || utcOffset === void 0 ? void 0 : utcOffset.value, timezone === null || timezone === void 0 ? void 0 : timezone.value) : void 0);
454
+ const triggerValue = computed(() => selectedValue.value ? getReturnValue(selectedValue.value) : void 0);
455
+ const triggerDate = computed(() => getDateValue(triggerLocalValue.value));
456
+ const triggerDisplayValue = computed(() => {
457
+ var _getFormattedValue;
458
+ if (!triggerLocalValue.value) return "";
459
+ return isFunction(inputFormat.value) ? inputFormat.value(triggerLocalValue.value) : (_getFormattedValue = getFormattedValue(triggerLocalValue.value, inputFormat.value)) !== null && _getFormattedValue !== void 0 ? _getFormattedValue : "";
460
+ });
448
461
  const [panelVisible, setLocalPanelVisible] = useMergeState(defaultPopupVisible.value, reactive({ value: popupVisible }));
449
462
  const setPanelVisible = (newVisible) => {
450
463
  if (panelVisible.value !== newVisible) {
@@ -678,7 +691,15 @@ var picker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
678
691
  fn: withCtx((scope) => [renderSlot(_ctx.$slots, "cell", normalizeProps(guardReactiveProps(scope)))]),
679
692
  key: "1"
680
693
  } : void 0]), 1040))])]),
681
- default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(input_default, mergeProps(_ctx.$attrs, {
694
+ default: withCtx(() => [renderSlot(_ctx.$slots, "trigger", {
695
+ value: triggerValue.value,
696
+ date: triggerDate.value,
697
+ displayValue: triggerDisplayValue.value,
698
+ inputValue: unref(inputValue),
699
+ popupVisible: unref(panelVisible),
700
+ disabled: unref(mergedDisabled),
701
+ readonly: Boolean(unref(readonly))
702
+ }, () => [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(input_default, mergeProps(_ctx.$attrs, {
682
703
  ref_key: "refInput",
683
704
  ref: refInput,
684
705
  size: __props.size,
@@ -725,7 +746,7 @@ var picker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
725
746
  "input-value",
726
747
  "value",
727
748
  "format"
728
- ])])]),
749
+ ])])])]),
729
750
  _: 3
730
751
  }, 16, [
731
752
  "floating-options",
@@ -16,7 +16,16 @@ declare function onPanelShortcutMouseEnter(value: Array<Dayjs | undefined>): voi
16
16
  declare function onPanelShortcutMouseLeave(): void;
17
17
  declare function onPanelShortcutClick(value: Array<Dayjs | undefined>, shortcut: ShortcutType): void;
18
18
  declare function onPanelConfirm(): void;
19
- declare var __VLS_10: {}, __VLS_25: {}, __VLS_28: {}, __VLS_36: {}, __VLS_39: {
19
+ declare var __VLS_10: {
20
+ value: (CalendarValue | undefined)[] | undefined;
21
+ date: (Date | undefined)[] | undefined;
22
+ displayValue: (string | undefined)[];
23
+ inputValue: (string | undefined)[] | undefined;
24
+ popupVisible: boolean;
25
+ disabled: boolean;
26
+ disabledInputs: boolean[];
27
+ readonly: boolean;
28
+ }, __VLS_12: {}, __VLS_27: {}, __VLS_30: {}, __VLS_38: {}, __VLS_41: {
20
29
  component: {
21
30
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
22
31
  mode: {
@@ -652,10 +661,10 @@ declare var __VLS_10: {}, __VLS_25: {}, __VLS_28: {}, __VLS_36: {}, __VLS_39: {
652
661
  shortcutsPosition: "left" | "right" | "bottom";
653
662
  hideTrigger: boolean;
654
663
  };
655
- }, __VLS_48: {}, __VLS_51: {
664
+ }, __VLS_50: {}, __VLS_53: {
656
665
  type: string;
657
666
  date: Date;
658
- }, __VLS_53: {
667
+ }, __VLS_55: {
659
668
  component: {
660
669
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
661
670
  mode: {
@@ -1291,30 +1300,32 @@ declare var __VLS_10: {}, __VLS_25: {}, __VLS_28: {}, __VLS_36: {}, __VLS_39: {
1291
1300
  shortcutsPosition: "left" | "right" | "bottom";
1292
1301
  hideTrigger: boolean;
1293
1302
  };
1294
- }, __VLS_62: {}, __VLS_65: {
1303
+ }, __VLS_64: {}, __VLS_67: {
1295
1304
  type: string;
1296
1305
  date: Date;
1297
1306
  };
1298
1307
  type __VLS_Slots = {} & {
1299
- default?: (props: typeof __VLS_10) => any;
1308
+ trigger?: (props: typeof __VLS_10) => any;
1309
+ } & {
1310
+ default?: (props: typeof __VLS_12) => any;
1300
1311
  } & {
1301
- prefix?: (props: typeof __VLS_25) => any;
1312
+ prefix?: (props: typeof __VLS_27) => any;
1302
1313
  } & {
1303
- 'suffix-icon'?: (props: typeof __VLS_28) => any;
1314
+ 'suffix-icon'?: (props: typeof __VLS_30) => any;
1304
1315
  } & {
1305
- separator?: (props: typeof __VLS_36) => any;
1316
+ separator?: (props: typeof __VLS_38) => any;
1306
1317
  } & {
1307
- panelRender?: (props: typeof __VLS_39) => any;
1318
+ panelRender?: (props: typeof __VLS_41) => any;
1308
1319
  } & {
1309
- extra?: (props: typeof __VLS_48) => any;
1320
+ extra?: (props: typeof __VLS_50) => any;
1310
1321
  } & {
1311
- cell?: (props: typeof __VLS_51) => any;
1322
+ cell?: (props: typeof __VLS_53) => any;
1312
1323
  } & {
1313
- panelRender?: (props: typeof __VLS_53) => any;
1324
+ panelRender?: (props: typeof __VLS_55) => any;
1314
1325
  } & {
1315
- extra?: (props: typeof __VLS_62) => any;
1326
+ extra?: (props: typeof __VLS_64) => any;
1316
1327
  } & {
1317
- cell?: (props: typeof __VLS_65) => any;
1328
+ cell?: (props: typeof __VLS_67) => any;
1318
1329
  };
1319
1330
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
1320
1331
  mode: {
@@ -372,6 +372,16 @@ var range_picker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
372
372
  return (_ref = (_previewValue$value = previewValue.value) !== null && _previewValue$value !== void 0 ? _previewValue$value : processValue.value) !== null && _ref !== void 0 ? _ref : selectedValue.value;
373
373
  });
374
374
  const [inputValue, setInputValue] = useState();
375
+ const triggerLocalValue = computed(() => {
376
+ var _selectedValue$value;
377
+ return (_selectedValue$value = selectedValue.value) === null || _selectedValue$value === void 0 ? void 0 : _selectedValue$value.map((item) => item ? toLocal(item, utcOffset === null || utcOffset === void 0 ? void 0 : utcOffset.value, timezone === null || timezone === void 0 ? void 0 : timezone.value) : void 0);
378
+ });
379
+ const triggerValue = computed(() => selectedValue.value ? getReturnRangeValue(selectedValue.value, returnValueFormat.value, utcOffset === null || utcOffset === void 0 ? void 0 : utcOffset.value, timezone === null || timezone === void 0 ? void 0 : timezone.value) : void 0);
380
+ const triggerDate = computed(() => getDateValue(triggerLocalValue.value));
381
+ const triggerDisplayValue = computed(() => {
382
+ var _getFormattedValue;
383
+ return (_getFormattedValue = getFormattedValue(triggerLocalValue.value, computedFormat.value)) !== null && _getFormattedValue !== void 0 ? _getFormattedValue : [];
384
+ });
375
385
  const startHeaderMode = ref();
376
386
  const endHeaderMode = ref();
377
387
  const [panelVisible, setLocalPanelVisible] = useMergeState(defaultPopupVisible.value, reactive({ value: popupVisible }));
@@ -705,7 +715,16 @@ var range_picker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
705
715
  fn: withCtx((scope) => [renderSlot(_ctx.$slots, "cell", normalizeProps(guardReactiveProps(scope)))]),
706
716
  key: "1"
707
717
  } : void 0]), 1040))])]),
708
- default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(input_range_default, mergeProps({
718
+ default: withCtx(() => [renderSlot(_ctx.$slots, "trigger", {
719
+ value: triggerValue.value,
720
+ date: triggerDate.value,
721
+ displayValue: triggerDisplayValue.value,
722
+ inputValue: unref(inputValue),
723
+ popupVisible: unref(panelVisible),
724
+ disabled: triggerDisabled.value,
725
+ disabledInputs: disabledArray.value,
726
+ readonly: Boolean(__props.readonly)
727
+ }, () => [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(input_range_default, mergeProps({
709
728
  ref_key: "refInput",
710
729
  ref: refInput
711
730
  }, _ctx.$attrs, {
@@ -756,7 +775,7 @@ var range_picker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
756
775
  "input-value",
757
776
  "value",
758
777
  "format"
759
- ])])]),
778
+ ])])])]),
760
779
  _: 3
761
780
  }, 16, [
762
781
  "floating-options",
package/es/index.css CHANGED
@@ -17783,6 +17783,7 @@ body.sd-tour-active .sd-tour-popover * {
17783
17783
  color: var(--sd-color-text-1);
17784
17784
  font-size: 14px;
17785
17785
  line-height: 36px;
17786
+ text-align: left;
17786
17787
  background-color: transparent;
17787
17788
  cursor: pointer;
17788
17789
  }