antdv-next 1.5.5 → 1.6.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/_util/PurePanel.js +17 -14
- package/dist/_util/fallbackProp.d.ts +13 -0
- package/dist/_util/fallbackProp.js +15 -0
- package/dist/_util/hooks/useAllowClear.d.ts +19 -0
- package/dist/_util/hooks/useAllowClear.js +16 -0
- package/dist/_util/hooks/useMergeSemantic.js +3 -2
- package/dist/_util/omitUndefined.d.ts +13 -0
- package/dist/_util/omitUndefined.js +20 -0
- package/dist/_util/statusUtils.d.ts +1 -1
- package/dist/_util/vueNode.d.ts +2 -6
- package/dist/_util/wave/index.js +4 -2
- package/dist/_util/wave/style.d.ts +5 -1
- package/dist/_util/wave/useWave.d.ts +2 -1
- package/dist/_util/wave/useWave.js +4 -3
- package/dist/affix/style/index.d.ts +5 -1
- package/dist/alert/Alert.d.ts +6 -2
- package/dist/alert/Alert.js +131 -128
- package/dist/alert/style/index.d.ts +4 -1
- package/dist/alert/style/index.js +9 -6
- package/dist/anchor/style/index.d.ts +5 -1
- package/dist/antd-with-locales.esm.js +18451 -15882
- package/dist/antd-with-locales.js +80 -80
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +17338 -14784
- package/dist/antd.js +94 -94
- package/dist/app/style/index.d.ts +5 -1
- package/dist/avatar/style/index.d.ts +5 -1
- package/dist/badge/index.js +1 -1
- package/dist/badge/style/index.d.ts +5 -1
- package/dist/badge/style/index.js +2 -9
- package/dist/badge/style/ribbon.d.ts +5 -1
- package/dist/border-beam/style/index.d.ts +5 -1
- package/dist/breadcrumb/BreadcrumbItem.js +1 -1
- package/dist/breadcrumb/style/index.d.ts +5 -1
- package/dist/button/style/index.d.ts +5 -1
- package/dist/calendar/style/index.d.ts +4 -1
- package/dist/card/Card.js +1 -1
- package/dist/card/style/index.d.ts +5 -1
- package/dist/carousel/index.js +1 -1
- package/dist/carousel/style/index.d.ts +5 -1
- package/dist/carousel/style/index.js +1 -1
- package/dist/cascader/index.js +3 -2
- package/dist/cascader/style/index.d.ts +5 -1
- package/dist/cascader/style/panel.d.ts +5 -1
- package/dist/checkbox/style/index.d.ts +4 -1
- package/dist/collapse/Collapse.d.ts +2 -0
- package/dist/collapse/Collapse.js +5 -2
- package/dist/collapse/style/index.d.ts +4 -1
- package/dist/color-picker/ColorPicker.js +7 -11
- package/dist/color-picker/style/index.d.ts +5 -1
- package/dist/components.d.ts +2 -2
- package/dist/config-provider/context.d.ts +16 -21
- package/dist/config-provider/context.js +32 -38
- package/dist/config-provider/define.d.ts +3 -1
- package/dist/config-provider/hooks/useCSSVarCls.d.ts +3 -0
- package/dist/config-provider/hooks/useCSSVarCls.js +4 -3
- package/dist/config-provider/index.d.ts +2 -2
- package/dist/config-provider/index.js +24 -1
- package/dist/date-picker/generatePicker/generateRangePicker.js +10 -3
- package/dist/date-picker/generatePicker/generateSinglePicker.js +13 -5
- package/dist/date-picker/generatePicker/useComponents.d.ts +3 -3
- package/dist/date-picker/style/index.d.ts +5 -1
- package/dist/date-picker/util.d.ts +8 -12
- package/dist/date-picker/util.js +14 -7
- package/dist/descriptions/Cell.js +80 -75
- package/dist/descriptions/Row.js +14 -11
- package/dist/descriptions/hooks/useItems.d.ts +6 -6
- package/dist/descriptions/style/index.d.ts +5 -1
- package/dist/divider/style/index.d.ts +5 -1
- package/dist/drawer/DrawerPanel.js +6 -6
- package/dist/drawer/index.d.ts +0 -2
- package/dist/drawer/index.js +0 -1
- package/dist/drawer/style/index.d.ts +5 -1
- package/dist/dropdown/dropdown.js +2 -1
- package/dist/dropdown/style/index.d.ts +5 -1
- package/dist/empty/style/index.d.ts +5 -1
- package/dist/flex/index.js +1 -1
- package/dist/flex/style/index.d.ts +5 -1
- package/dist/float-button/FloatButtonGroup.js +1 -1
- package/dist/float-button/style/index.d.ts +5 -1
- package/dist/form/FormItem/index.js +36 -16
- package/dist/form/context.d.ts +1 -1
- package/dist/form/hooks/useVariant.d.ts +1 -1
- package/dist/form/style/index.d.ts +5 -1
- package/dist/grid/style/index.d.ts +5 -2
- package/dist/image/hooks/usePreviewConfig.d.ts +5 -5
- package/dist/image/style/index.d.ts +4 -1
- package/dist/index.d.ts +2 -2
- package/dist/input/style/index.d.ts +5 -2
- package/dist/input/style/otp.d.ts +5 -1
- package/dist/input/style/search.d.ts +5 -1
- package/dist/input/style/textarea.d.ts +5 -1
- package/dist/input-number/style/index.d.ts +5 -1
- package/dist/layout/style/index.d.ts +5 -1
- package/dist/layout/style/sider.d.ts +5 -1
- package/dist/listy/style/index.d.ts +5 -1
- package/dist/locale/useLocale.d.ts +1 -1
- package/dist/masonry/style/index.d.ts +4 -1
- package/dist/mentions/index.js +1 -1
- package/dist/mentions/style/index.d.ts +5 -1
- package/dist/menu/MenuItem.js +2 -1
- package/dist/menu/index.d.ts +2 -2
- package/dist/message/style/index.d.ts +5 -1
- package/dist/modal/style/index.d.ts +3 -1
- package/dist/notification/style/index.d.ts +4 -1
- package/dist/package.js +1 -1
- package/dist/pagination/style/index.d.ts +5 -1
- package/dist/popconfirm/style/index.d.ts +5 -1
- package/dist/popover/index.js +4 -3
- package/dist/popover/style/index.d.ts +5 -1
- package/dist/progress/style/index.d.ts +5 -1
- package/dist/qrcode/index.js +0 -21
- package/dist/qrcode/interface.d.ts +1 -1
- package/dist/qrcode/style/index.d.ts +5 -1
- package/dist/radio/style/index.d.ts +5 -1
- package/dist/rate/style/index.d.ts +5 -1
- package/dist/result/style/index.d.ts +5 -1
- package/dist/segmented/style/index.d.ts +5 -1
- package/dist/select/index.js +2 -2
- package/dist/select/style/index.d.ts +5 -1
- package/dist/skeleton/style/index.d.ts +5 -1
- package/dist/slider/style/index.d.ts +5 -1
- package/dist/space/Compact.d.ts +1 -1
- package/dist/space/style/addon.d.ts +5 -1
- package/dist/space/style/compact.d.ts +5 -1
- package/dist/space/style/index.d.ts +5 -1
- package/dist/spin/style/index.d.ts +5 -1
- package/dist/splitter/style/index.d.ts +5 -1
- package/dist/statistic/style/index.d.ts +5 -1
- package/dist/steps/style/index.d.ts +5 -1
- package/dist/switch/style/index.d.ts +5 -1
- package/dist/table/InternalTable.js +52 -48
- package/dist/table/hooks/useSelection.js +19 -6
- package/dist/table/style/index.d.ts +5 -1
- package/dist/table/style/selection.js +1 -1
- package/dist/table/util.d.ts +1 -1
- package/dist/tabs/style/index.d.ts +5 -1
- package/dist/tag/CheckableTagGroup.d.ts +2 -2
- package/dist/tag/hooks/useColor.d.ts +1 -1
- package/dist/tag/style/index.d.ts +5 -1
- package/dist/theme/context.js +2 -1
- package/dist/theme/useToken.d.ts +6 -2
- package/dist/theme/useToken.js +46 -14
- package/dist/theme/util/genStyleUtils.d.ts +13 -3
- package/dist/theme/util/genStyleUtils.js +42 -28
- package/dist/timeline/style/index.d.ts +5 -1
- package/dist/timeline/useItems.d.ts +2 -2
- package/dist/timeline/useItems.js +1 -1
- package/dist/tooltip/index.js +1 -1
- package/dist/tooltip/style/index.d.ts +2 -2
- package/dist/tour/style/index.d.ts +5 -1
- package/dist/transfer/Transfer.js +2 -0
- package/dist/transfer/style/index.d.ts +5 -1
- package/dist/tree/DirectoryTree.js +1 -1
- package/dist/tree/style/index.d.ts +4 -1
- package/dist/tree-select/index.js +1 -1
- package/dist/tree-select/style/index.d.ts +2 -2
- package/dist/typography/style/index.d.ts +5 -1
- package/dist/upload/style/index.d.ts +5 -1
- package/dist/version/token.json +1 -1
- package/global.d.ts +5 -0
- package/package.json +13 -13
- package/web-tags.json +4973 -2984
- package/web-types.json +13140 -7396
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, inject, provide, ref } from "vue";
|
|
1
|
+
import { computed, inject, provide, ref, toRef } from "vue";
|
|
2
2
|
//#region src/config-provider/context.ts
|
|
3
3
|
const defaultPrefixCls = "ant";
|
|
4
4
|
const defaultIconPrefixCls = "anticon";
|
|
@@ -17,26 +17,23 @@ function defaultGetPrefixCls(suffixCls, customizePrefixCls) {
|
|
|
17
17
|
if (customizePrefixCls) return customizePrefixCls;
|
|
18
18
|
return suffixCls ? `ant-${suffixCls}` : "ant";
|
|
19
19
|
}
|
|
20
|
+
const defaultConfigRef = ref({
|
|
21
|
+
getPrefixCls: defaultGetPrefixCls,
|
|
22
|
+
iconPrefixCls: defaultIconPrefixCls
|
|
23
|
+
});
|
|
20
24
|
function useConfig() {
|
|
21
|
-
return inject(ConfigConsumerKey,
|
|
22
|
-
getPrefixCls: defaultGetPrefixCls,
|
|
23
|
-
iconPrefixCls: defaultIconPrefixCls
|
|
24
|
-
}));
|
|
25
|
+
return inject(ConfigConsumerKey, defaultConfigRef);
|
|
25
26
|
}
|
|
26
27
|
function useBaseConfig(suffixCls, props) {
|
|
27
28
|
const config = useConfig();
|
|
28
29
|
return {
|
|
29
|
-
result:
|
|
30
|
-
modal:
|
|
31
|
-
timeline:
|
|
32
|
-
notification:
|
|
30
|
+
result: toRef(() => config.value?.result),
|
|
31
|
+
modal: toRef(() => config.value?.modal),
|
|
32
|
+
timeline: toRef(() => config.value?.timeline),
|
|
33
|
+
notification: toRef(() => config.value?.notification),
|
|
33
34
|
getPrefixCls: (suffixCls, prefixCls) => config.value?.getPrefixCls(suffixCls, prefixCls),
|
|
34
|
-
prefixCls:
|
|
35
|
-
|
|
36
|
-
}),
|
|
37
|
-
direction: computed(() => {
|
|
38
|
-
return config.value?.direction;
|
|
39
|
-
}),
|
|
35
|
+
prefixCls: toRef(() => config.value?.getPrefixCls(suffixCls, props?.prefixCls)),
|
|
36
|
+
direction: toRef(() => config.value?.direction),
|
|
40
37
|
getPopupContainer: config?.value.getPopupContainer
|
|
41
38
|
};
|
|
42
39
|
}
|
|
@@ -65,37 +62,34 @@ function useComponentConfig(propName) {
|
|
|
65
62
|
}
|
|
66
63
|
function useComponentBaseConfig(propName, props, keys, suffixCls) {
|
|
67
64
|
const context = useConfig();
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
});
|
|
71
|
-
const toRefs = (propValues) => {
|
|
65
|
+
const getPropValue = () => context.value[propName];
|
|
66
|
+
const toRefs = (getPropValues) => {
|
|
72
67
|
const result = {
|
|
73
|
-
classes:
|
|
74
|
-
styles:
|
|
75
|
-
class:
|
|
76
|
-
style:
|
|
68
|
+
classes: toRef(() => getPropValues()?.classes ?? EMPTY_OBJECT),
|
|
69
|
+
styles: toRef(() => getPropValues()?.styles ?? EMPTY_OBJECT),
|
|
70
|
+
class: toRef(() => getPropValues()?.class),
|
|
71
|
+
style: toRef(() => getPropValues()?.style)
|
|
72
|
+
};
|
|
73
|
+
const addKey = (key) => {
|
|
74
|
+
if (!result[key]) result[key] = toRef(() => getPropValues()?.[key]);
|
|
77
75
|
};
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (!result[key]) result[key] = computed(() => propValues.value?.[key]);
|
|
82
|
-
});
|
|
76
|
+
const current = getPropValues();
|
|
77
|
+
if (current) Object.keys(current).forEach(addKey);
|
|
78
|
+
keys?.forEach((key) => addKey(key));
|
|
83
79
|
return result;
|
|
84
80
|
};
|
|
85
81
|
return {
|
|
86
|
-
...toRefs(
|
|
87
|
-
direction:
|
|
88
|
-
prefixCls:
|
|
89
|
-
|
|
90
|
-
}),
|
|
91
|
-
rootPrefixCls: computed(() => context.value?.getPrefixCls()),
|
|
82
|
+
...toRefs(getPropValue),
|
|
83
|
+
direction: toRef(() => context.value.direction),
|
|
84
|
+
prefixCls: toRef(() => context.value?.getPrefixCls(suffixCls ?? propName, props?.prefixCls)),
|
|
85
|
+
rootPrefixCls: toRef(() => context.value?.getPrefixCls()),
|
|
92
86
|
getPopupContainer: context.value.getPopupContainer,
|
|
93
87
|
getPrefixCls: context.value.getPrefixCls,
|
|
94
88
|
getTargetContainer: context.value.getTargetContainer,
|
|
95
|
-
virtual:
|
|
96
|
-
renderEmpty:
|
|
97
|
-
popupMatchSelectWidth:
|
|
98
|
-
popupOverflow:
|
|
89
|
+
virtual: toRef(() => context.value.virtual),
|
|
90
|
+
renderEmpty: toRef(() => context.value.renderEmpty),
|
|
91
|
+
popupMatchSelectWidth: toRef(() => context.value.popupMatchSelectWidth),
|
|
92
|
+
popupOverflow: toRef(() => context.value.popupOverflow)
|
|
99
93
|
};
|
|
100
94
|
}
|
|
101
95
|
//#endregion
|
|
@@ -4,7 +4,7 @@ import { ColumnType } from "../table/interface.js";
|
|
|
4
4
|
import "../table/index.js";
|
|
5
5
|
import { Locale } from "../locale/index.js";
|
|
6
6
|
import { RenderEmptyHandler } from "./defaultRenderEmpty.js";
|
|
7
|
-
import { AlertConfig, AnchorStyleConfig, BadgeConfig, BreadcrumbConfig, ButtonConfig, CSPConfig, CalendarConfig, CardConfig, CascaderConfig, CheckboxConfig, CollapseConfig, ColorPickerConfig, ComponentStyleConfig, DatePickerConfig, DescriptionsConfig, DirectionType, DividerConfig, DrawerConfig, DropdownConfig, EmptyConfig, FlexConfig, FloatButtonConfig, FloatButtonGroupConfig, FormConfig, ImageConfig, InputConfig, InputNumberConfig, InputPasswordConfig, InputSearchConfig, ListyConfig, MasonryConfig, MentionsConfig, MenuConfig, ModalConfig, NotificationConfig, OTPConfig, PaginationConfig, PopconfirmConfig, PopoverConfig, PopupOverflow, ProgressConfig, RadioConfig, RangePickerConfig, ResultConfig, SegmentedConfig, SelectConfig, SkeletonConfig, SliderConfig, SpaceConfig, SpinConfig, SplitterConfig, StatisticConfig, StepsConfig, SwitchStyleConfig, TableConfig, TabsConfig, TagConfig, TextAreaConfig, ThemeConfig, TimePickerConfig, TimelineConfig, TooltipConfig, TourConfig, TransferConfig, TreeConfig, TreeSelectConfig, TypographyConfig, UploadConfig, Variant, WaveConfig } from "./context.js";
|
|
7
|
+
import { AlertConfig, AnchorStyleConfig, BadgeConfig, BreadcrumbConfig, ButtonConfig, CSPConfig, CalendarConfig, CardConfig, CardMetaConfig, CascaderConfig, CheckboxConfig, CollapseConfig, ColorPickerConfig, ComponentStyleConfig, DatePickerConfig, DescriptionsConfig, DirectionType, DividerConfig, DrawerConfig, DropdownConfig, EmptyConfig, FlexConfig, FloatButtonConfig, FloatButtonGroupConfig, FormConfig, ImageConfig, InputConfig, InputNumberConfig, InputPasswordConfig, InputSearchConfig, ListyConfig, MasonryConfig, MentionsConfig, MenuConfig, ModalConfig, NotificationConfig, OTPConfig, PaginationConfig, PopconfirmConfig, PopoverConfig, PopupOverflow, ProgressConfig, RadioConfig, RangePickerConfig, ResultConfig, RibbonConfig, SegmentedConfig, SelectConfig, SkeletonConfig, SliderConfig, SpaceConfig, SpinConfig, SplitterConfig, StatisticConfig, StepsConfig, SwitchStyleConfig, TableConfig, TabsConfig, TagConfig, TextAreaConfig, ThemeConfig, TimePickerConfig, TimelineConfig, TooltipConfig, TourConfig, TransferConfig, TreeConfig, TreeSelectConfig, TypographyConfig, UploadConfig, Variant, WaveConfig } from "./context.js";
|
|
8
8
|
//#region src/config-provider/define.d.ts
|
|
9
9
|
interface ConfigProviderProps {
|
|
10
10
|
getTargetContainer?: () => HTMLElement | Window;
|
|
@@ -89,6 +89,7 @@ interface ConfigProviderProps {
|
|
|
89
89
|
badge?: BadgeConfig;
|
|
90
90
|
radio?: RadioConfig;
|
|
91
91
|
rate?: ComponentStyleConfig;
|
|
92
|
+
ribbon?: RibbonConfig;
|
|
92
93
|
switch?: SwitchStyleConfig;
|
|
93
94
|
transfer?: TransferConfig;
|
|
94
95
|
avatar?: ComponentStyleConfig;
|
|
@@ -96,6 +97,7 @@ interface ConfigProviderProps {
|
|
|
96
97
|
tag?: TagConfig;
|
|
97
98
|
table?: TableConfig;
|
|
98
99
|
card?: CardConfig;
|
|
100
|
+
cardMeta?: CardMetaConfig;
|
|
99
101
|
tabs?: TabsConfig;
|
|
100
102
|
timeline?: TimelineConfig;
|
|
101
103
|
timePicker?: TimePickerConfig;
|
|
@@ -3,6 +3,9 @@ import { Ref } from "vue";
|
|
|
3
3
|
/**
|
|
4
4
|
* This hook is only for cssVar to add root className for components.
|
|
5
5
|
* If root ClassName is needed, this hook could be refactored with `-root`
|
|
6
|
+
*
|
|
7
|
+
* antd 6 always runs with CSS variables enabled (`useToken()` always yields a
|
|
8
|
+
* cssVar config), so the class is unconditional and no token lookup is needed.
|
|
6
9
|
* @param prefixCls
|
|
7
10
|
*/
|
|
8
11
|
declare function useCSSVarCls(prefixCls: Ref<string>): import("vue").ComputedRef<string>;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import useToken from "../../theme/useToken.js";
|
|
2
1
|
import { computed } from "vue";
|
|
3
2
|
//#region src/config-provider/hooks/useCSSVarCls.ts
|
|
4
3
|
/**
|
|
5
4
|
* This hook is only for cssVar to add root className for components.
|
|
6
5
|
* If root ClassName is needed, this hook could be refactored with `-root`
|
|
6
|
+
*
|
|
7
|
+
* antd 6 always runs with CSS variables enabled (`useToken()` always yields a
|
|
8
|
+
* cssVar config), so the class is unconditional and no token lookup is needed.
|
|
7
9
|
* @param prefixCls
|
|
8
10
|
*/
|
|
9
11
|
function useCSSVarCls(prefixCls) {
|
|
10
|
-
|
|
11
|
-
return computed(() => cssVar?.value ? `${prefixCls.value}-css-var` : "");
|
|
12
|
+
return computed(() => `${prefixCls.value}-css-var`);
|
|
12
13
|
}
|
|
13
14
|
//#endregion
|
|
14
15
|
export { useCSSVarCls as default };
|
|
@@ -30,8 +30,8 @@ declare function globalConfig(): {
|
|
|
30
30
|
getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string;
|
|
31
31
|
getIconPrefixCls: typeof getGlobalIconPrefixCls;
|
|
32
32
|
getRootPrefixCls: () => string;
|
|
33
|
-
getTheme: () =>
|
|
34
|
-
theme: import("vue").ComputedRef<
|
|
33
|
+
getTheme: () => Theme | ThemeConfig;
|
|
34
|
+
theme: import("vue").ComputedRef<Theme | ThemeConfig>;
|
|
35
35
|
locale: Locale | undefined;
|
|
36
36
|
holderRender: holderRenderType | undefined;
|
|
37
37
|
readonly appContext: AppContext | undefined;
|
|
@@ -154,9 +154,16 @@ const ProviderChildren = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
154
154
|
theme: mergedTheme.value,
|
|
155
155
|
direction: props.direction,
|
|
156
156
|
virtual: props.virtual,
|
|
157
|
+
popupMatchSelectWidth: props.popupMatchSelectWidth,
|
|
158
|
+
popupOverflow: props.popupOverflow,
|
|
157
159
|
locale: locale.value || props.legacyLocale,
|
|
158
160
|
space: props.space,
|
|
159
|
-
variant: props.variant
|
|
161
|
+
variant: props.variant,
|
|
162
|
+
calendar: props.calendar,
|
|
163
|
+
carousel: props.carousel,
|
|
164
|
+
cardMeta: props.cardMeta,
|
|
165
|
+
ribbon: props.ribbon,
|
|
166
|
+
warning: props.warning
|
|
160
167
|
};
|
|
161
168
|
const config = { ...parentConfig };
|
|
162
169
|
Object.keys(baseConfig).forEach((key) => {
|
|
@@ -515,6 +522,10 @@ const ProviderChildren = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
515
522
|
type: Object,
|
|
516
523
|
required: false
|
|
517
524
|
},
|
|
525
|
+
ribbon: {
|
|
526
|
+
type: Object,
|
|
527
|
+
required: false
|
|
528
|
+
},
|
|
518
529
|
switch: {
|
|
519
530
|
type: Object,
|
|
520
531
|
required: false
|
|
@@ -543,6 +554,10 @@ const ProviderChildren = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
543
554
|
type: Object,
|
|
544
555
|
required: false
|
|
545
556
|
},
|
|
557
|
+
cardMeta: {
|
|
558
|
+
type: Object,
|
|
559
|
+
required: false
|
|
560
|
+
},
|
|
546
561
|
tabs: {
|
|
547
562
|
type: Object,
|
|
548
563
|
required: false
|
|
@@ -883,6 +898,10 @@ const ConfigProvider = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
883
898
|
type: Object,
|
|
884
899
|
required: false
|
|
885
900
|
},
|
|
901
|
+
ribbon: {
|
|
902
|
+
type: Object,
|
|
903
|
+
required: false
|
|
904
|
+
},
|
|
886
905
|
switch: {
|
|
887
906
|
type: Object,
|
|
888
907
|
required: false
|
|
@@ -911,6 +930,10 @@ const ConfigProvider = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
911
930
|
type: Object,
|
|
912
931
|
required: false
|
|
913
932
|
},
|
|
933
|
+
cardMeta: {
|
|
934
|
+
type: Object,
|
|
935
|
+
required: false
|
|
936
|
+
},
|
|
914
937
|
tabs: {
|
|
915
938
|
type: Object,
|
|
916
939
|
required: false
|
|
@@ -31,6 +31,7 @@ function generateRangePicker(generateConfig) {
|
|
|
31
31
|
const { size: customizeSize, disabled: customDisabled, status: customStatus, variant: customVariant, classes, styles, rootClass, bordered } = toPropsRefs(props, "size", "disabled", "status", "variant", "classes", "styles", "rootClass", "bordered", "separator");
|
|
32
32
|
const pickerType = computed(() => props.picker === TIME ? "timePicker" : "datePicker");
|
|
33
33
|
const { prefixCls, direction, getPopupContainer, rootPrefixCls, class: contextClassName, style: contextStyle, separator: contextSeparator } = useComponentBaseConfig("rangePicker", props, ["separator"], "picker");
|
|
34
|
+
const { allowClear: contextAllowClear, clearIcon: contextClearIcon } = useComponentBaseConfig(pickerType.value, props, ["allowClear", "clearIcon"], "picker");
|
|
34
35
|
const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
|
|
35
36
|
const mergedSize = useSize((ctx) => customizeSize.value ?? compactSize.value ?? ctx);
|
|
36
37
|
const disabled = useDisabledContext();
|
|
@@ -50,7 +51,7 @@ function generateRangePicker(generateConfig) {
|
|
|
50
51
|
const rootCls = useCSSVarCls(prefixCls);
|
|
51
52
|
const [hashId, cssVarCls] = style_default(prefixCls, rootCls);
|
|
52
53
|
const mergedRootClassName = computed(() => clsx(hashId.value, cssVarCls.value, rootCls.value, rootClass.value));
|
|
53
|
-
const [contextLocale] = useLocale("
|
|
54
|
+
const [contextLocale] = useLocale("DatePicker", locale);
|
|
54
55
|
const locale$1 = computed(() => ({
|
|
55
56
|
...contextLocale?.value,
|
|
56
57
|
...props.locale ?? {}
|
|
@@ -108,11 +109,17 @@ function generateRangePicker(generateConfig) {
|
|
|
108
109
|
nativeElement: computed(() => innerRef.value?.nativeElement)
|
|
109
110
|
});
|
|
110
111
|
return () => {
|
|
111
|
-
const { placeholder, components, placement, suffixIcon, prefix, allowClear, popupClassName: _popupClassName, dropdownClassName: _dropdownClassName, popupStyle: _popupStyle, rootClass: _rootClass, classes: _classes, styles: _styles, status: _status, variant: _variant, bordered: _bordered, size: _size, disabled: _disabled, locale: _locale, getPopupContainer: _getPopupContainer, ...restProps } = props;
|
|
112
|
+
const { placeholder, components, placement, suffixIcon, prefix, allowClear, clearIcon, popupClassName: _popupClassName, dropdownClassName: _dropdownClassName, popupStyle: _popupStyle, rootClass: _rootClass, classes: _classes, styles: _styles, status: _status, variant: _variant, bordered: _bordered, size: _size, disabled: _disabled, locale: _locale, getPopupContainer: _getPopupContainer, ...restProps } = props;
|
|
112
113
|
const { className, style, restAttrs } = getAttrStyleAndClass(attrs, void 0, props);
|
|
113
114
|
const mergedSuffixIcon = getSlotPropsFnRun(slots, { suffixIcon }, "suffixIcon", false);
|
|
114
115
|
const mergedPrefix = getSlotPropsFnRun(slots, { prefix }, "prefix", false);
|
|
115
|
-
const [mergedAllowClear] = useIcons({
|
|
116
|
+
const [mergedAllowClear] = useIcons({
|
|
117
|
+
allowClear,
|
|
118
|
+
clearIcon
|
|
119
|
+
}, prefixCls.value, {
|
|
120
|
+
allowClear: contextAllowClear?.value,
|
|
121
|
+
clearIcon: contextClearIcon?.value
|
|
122
|
+
});
|
|
116
123
|
const mergedComponents = useComponents(components);
|
|
117
124
|
const { hasFeedback, status: contextStatus, feedbackIcon } = useFormItemInputContext().value;
|
|
118
125
|
const mergedStatus = getMergedStatus(contextStatus, customStatus.value);
|
|
@@ -10,6 +10,7 @@ import useCSSVarCls from "../../config-provider/hooks/useCSSVarCls.js";
|
|
|
10
10
|
import { useDisabledContext } from "../../config-provider/DisabledContext.js";
|
|
11
11
|
import locale from "../locale/en_US.js";
|
|
12
12
|
import useLocale from "../../locale/useLocale.js";
|
|
13
|
+
import { omitUndefined } from "../../_util/omitUndefined.js";
|
|
13
14
|
import { getMergedStatus, getStatusClassNames } from "../../_util/statusUtils.js";
|
|
14
15
|
import { useFormItemInputContext } from "../../form/context.js";
|
|
15
16
|
import { useVariants } from "../../form/hooks/useVariant.js";
|
|
@@ -22,7 +23,6 @@ import useComponents from "./useComponents.js";
|
|
|
22
23
|
import { computed, createVNode, defineComponent, mergeProps, shallowRef } from "vue";
|
|
23
24
|
import { clsx } from "@v-c/util";
|
|
24
25
|
import { getTransitionName } from "@v-c/util/dist/utils/transition";
|
|
25
|
-
import { omit } from "es-toolkit/compat";
|
|
26
26
|
import Picker from "@v-c/picker";
|
|
27
27
|
//#region src/date-picker/generatePicker/generateSinglePicker.tsx
|
|
28
28
|
function generatePicker(generateConfig) {
|
|
@@ -31,7 +31,11 @@ function generatePicker(generateConfig) {
|
|
|
31
31
|
const name = displayName ? `A${displayName}` : "ADatePicker";
|
|
32
32
|
return /* @__PURE__ */ defineComponent((props, { slots, attrs, emit, expose }) => {
|
|
33
33
|
const { getPopupContainer: customGetPopupContainer, size: customizeSize, disabled: customDisabled, status: customStatus, variant: customVariant, classes, styles, rootClass, bordered } = toPropsRefs(props, "prefixCls", "getPopupContainer", "size", "disabled", "status", "variant", "classes", "styles", "rootClass", "bordered");
|
|
34
|
-
const { prefixCls, direction, getPopupContainer, rootPrefixCls, class: contextClassName, style: contextStyle, suffixIcon: contextSuffixIcon } = useComponentBaseConfig(pickerType, props, [
|
|
34
|
+
const { prefixCls, direction, getPopupContainer, rootPrefixCls, class: contextClassName, style: contextStyle, suffixIcon: contextSuffixIcon, allowClear: contextAllowClear, clearIcon: contextClearIcon } = useComponentBaseConfig(pickerType, props, [
|
|
35
|
+
"suffixIcon",
|
|
36
|
+
"allowClear",
|
|
37
|
+
"clearIcon"
|
|
38
|
+
], "picker");
|
|
35
39
|
const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
|
|
36
40
|
const mergedSize = useSize((ctx) => customizeSize.value ?? compactSize.value ?? ctx);
|
|
37
41
|
const disabled = useDisabledContext();
|
|
@@ -117,14 +121,18 @@ function generatePicker(generateConfig) {
|
|
|
117
121
|
nativeElement: computed(() => innerRef.value?.nativeElement)
|
|
118
122
|
});
|
|
119
123
|
return () => {
|
|
120
|
-
const { placeholder, components, placement, suffixIcon, prefix, allowClear, popupClassName: _popupClassName, dropdownClassName: _dropdownClassName, popupStyle: _popupStyle, rootClass: _rootClass, classes: _classes, styles: _styles, status: _status, variant: _variant, bordered: _bordered, size: _size, disabled: _disabled, locale: _locale, getPopupContainer: _getPopupContainer, ...restProps } = props;
|
|
124
|
+
const { placeholder, components, placement, suffixIcon, prefix, allowClear, clearIcon, popupClassName: _popupClassName, dropdownClassName: _dropdownClassName, popupStyle: _popupStyle, rootClass: _rootClass, classes: _classes, styles: _styles, status: _status, variant: _variant, bordered: _bordered, size: _size, disabled: _disabled, locale: _locale, getPopupContainer: _getPopupContainer, ...restProps } = props;
|
|
121
125
|
const { className, style, restAttrs } = getAttrStyleAndClass(attrs, void 0, props);
|
|
122
126
|
const mergedSuffixIcon = getSlotPropsFnRun(slots, { suffixIcon }, "suffixIcon", false);
|
|
123
127
|
const mergedPrefix = getSlotPropsFnRun(slots, { prefix }, "prefix", false);
|
|
124
128
|
const [mergedAllowClear, removeIcon] = useIcons({
|
|
125
129
|
allowClear,
|
|
130
|
+
clearIcon,
|
|
126
131
|
removeIcon: props.removeIcon
|
|
127
|
-
}, prefixCls.value
|
|
132
|
+
}, prefixCls.value, {
|
|
133
|
+
allowClear: contextAllowClear?.value,
|
|
134
|
+
clearIcon: contextClearIcon?.value
|
|
135
|
+
});
|
|
128
136
|
const mergedComponents = useComponents(components);
|
|
129
137
|
const { hasFeedback, status: contextStatus, feedbackIcon } = useFormItemInputContext().value;
|
|
130
138
|
const mergedStatus = getMergedStatus(contextStatus, customStatus.value);
|
|
@@ -154,7 +162,7 @@ function generatePicker(generateConfig) {
|
|
|
154
162
|
const renderExtraFooter = slots.renderExtraFooter || props.renderExtraFooter ? (mode) => resolveRender("renderExtraFooter", [mode], mode) : void 0;
|
|
155
163
|
const panelRender = slots.panelRender || props.panelRender ? (panel) => resolveRender("panelRender", [panel], panel) : void 0;
|
|
156
164
|
const inputRender = slots.inputRender || props.inputRender ? (inputProps) => resolveRender("inputRender", [inputProps], inputProps) : void 0;
|
|
157
|
-
return createVNode(ContextIsolator, { "space": true }, { default: () => [createVNode(Picker, mergeProps(restAttrs, additionalProps,
|
|
165
|
+
return createVNode(ContextIsolator, { "space": true }, { default: () => [createVNode(Picker, mergeProps(restAttrs, additionalProps, omitUndefined(restProps, ["onKeydown"]), {
|
|
158
166
|
"ref": innerRef,
|
|
159
167
|
"placeholder": getPlaceholder(locale$1.value, mergedPicker.value, placeholder),
|
|
160
168
|
"suffix": suffixNode,
|
|
@@ -3,12 +3,12 @@ import "../../index.js";
|
|
|
3
3
|
import { Components } from "@v-c/picker";
|
|
4
4
|
//#region src/date-picker/generatePicker/useComponents.d.ts
|
|
5
5
|
declare function useComponents(components?: Components): {
|
|
6
|
-
date?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
|
|
7
6
|
time?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
|
|
8
|
-
|
|
7
|
+
year?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
|
|
9
8
|
month?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
|
|
9
|
+
date?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
|
|
10
|
+
week?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
|
|
10
11
|
quarter?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
|
|
11
|
-
year?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
|
|
12
12
|
decade?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
|
|
13
13
|
datetime?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
|
|
14
14
|
button: string | import("vue").DefineSetupFnComponent<ButtonProps, {}, {}, ButtonProps & {}, import("vue").PublicProps> | import("vue").DefineComponent;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
1
3
|
import { ComponentToken, PanelComponentToken, PickerPanelToken, initPanelComponentToken, initPickerPanelToken } from "./token.js";
|
|
2
4
|
import { genPanelStyle } from "./panel.js";
|
|
5
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
6
|
+
import "../../theme/interface/index.js";
|
|
3
7
|
//#region src/date-picker/style/index.d.ts
|
|
4
|
-
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
8
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
5
9
|
//#endregion
|
|
6
10
|
export { type ComponentToken, type PanelComponentToken, type PickerPanelToken, _default as default, genPanelStyle, initPanelComponentToken, initPickerPanelToken };
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import { RenderNodeFn } from "../_util/type.js";
|
|
1
|
+
import { RenderNodeFn, VueNode } from "../_util/type.js";
|
|
2
2
|
import "./generatePicker/index.js";
|
|
3
3
|
import { PickerLocale, PickerProps as PickerProps$1 } from "./generatePicker/interface.js";
|
|
4
|
+
import { AllowClear } from "../_util/hooks/useAllowClear.js";
|
|
4
5
|
import { PickerMode } from "@v-c/picker";
|
|
5
6
|
//#region src/date-picker/util.d.ts
|
|
6
7
|
declare function getPlaceholder(locale: PickerLocale, picker?: PickerMode, customizePlaceholder?: string): string;
|
|
7
8
|
declare function getRangePlaceholder(locale: PickerLocale, picker?: PickerMode, customizePlaceholder?: [string, string]): [string, string] | undefined;
|
|
8
|
-
declare function useIcons(props: Pick<PickerProps$1, 'allowClear' | 'removeIcon'>, prefixCls: string
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
__isTeleport?: never;
|
|
15
|
-
__isSuspense?: never;
|
|
16
|
-
} | RenderNodeFn<any[]> | (string | number | boolean | void | import("vue").Component | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
17
|
-
[key: string]: any;
|
|
18
|
-
}> | null | undefined)[] | null | undefined;
|
|
9
|
+
declare function useIcons(props: Pick<PickerProps$1, 'allowClear' | 'clearIcon' | 'removeIcon'>, prefixCls: string, context?: {
|
|
10
|
+
allowClear?: AllowClear;
|
|
11
|
+
clearIcon?: VueNode;
|
|
12
|
+
}): readonly [false, string | number | boolean | import("vue/jsx-runtime").JSX.Element | RenderNodeFn<any[]> | null] | readonly [{
|
|
13
|
+
readonly disabled?: boolean;
|
|
14
|
+
readonly clearIcon: any;
|
|
19
15
|
}, string | number | boolean | import("vue/jsx-runtime").JSX.Element | RenderNodeFn<any[]> | null];
|
|
20
16
|
//#endregion
|
|
21
17
|
export { getPlaceholder, getRangePlaceholder, useIcons };
|
package/dist/date-picker/util.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import useIcons$1 from "../select/useIcons.js";
|
|
2
|
+
import useAllowClear from "../_util/hooks/useAllowClear.js";
|
|
2
3
|
import { cloneVNode, isVNode } from "vue";
|
|
3
4
|
//#region src/date-picker/util.ts
|
|
4
5
|
function getPlaceholder(locale, picker, customizePlaceholder) {
|
|
@@ -19,18 +20,24 @@ function getRangePlaceholder(locale, picker, customizePlaceholder) {
|
|
|
19
20
|
if (picker === "time" && locale.timePickerLocale.rangePlaceholder) return locale.timePickerLocale.rangePlaceholder;
|
|
20
21
|
return locale.lang.rangePlaceholder;
|
|
21
22
|
}
|
|
22
|
-
function useIcons(props, prefixCls) {
|
|
23
|
-
const {
|
|
24
|
-
const { clearIcon, removeIcon } = useIcons$1({
|
|
23
|
+
function useIcons(props, prefixCls, context) {
|
|
24
|
+
const { removeIcon } = useIcons$1({
|
|
25
25
|
...props,
|
|
26
26
|
prefixCls,
|
|
27
27
|
componentName: "DatePicker"
|
|
28
28
|
});
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
const mergedAllowClear = useAllowClear({
|
|
30
|
+
allowClear: props.allowClear,
|
|
31
|
+
clearIcon: props.clearIcon,
|
|
32
|
+
contextAllowClear: context?.allowClear,
|
|
33
|
+
contextClearIcon: context?.clearIcon,
|
|
34
|
+
defaultAllowClear: true
|
|
35
|
+
});
|
|
36
|
+
if (!mergedAllowClear) return [false, removeIcon];
|
|
37
|
+
const { clearIcon: mergedClearIcon, ...rest } = mergedAllowClear;
|
|
31
38
|
return [{
|
|
32
|
-
clearIcon: isVNode(
|
|
33
|
-
...
|
|
39
|
+
clearIcon: isVNode(mergedClearIcon) ? cloneVNode(mergedClearIcon) : mergedClearIcon,
|
|
40
|
+
...rest
|
|
34
41
|
}, removeIcon];
|
|
35
42
|
}
|
|
36
43
|
//#endregion
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { normalizeStyle as normalizeStyle$1 } from "../_util/styleUtils.js";
|
|
1
2
|
import { getSlotPropsFnRun } from "../_util/tools.js";
|
|
3
|
+
import { isRenderable } from "../_util/is.js";
|
|
2
4
|
import { useDescriptionsCtx } from "./DescriptionsContext.js";
|
|
3
5
|
import { createVNode, defineComponent, mergeProps } from "vue";
|
|
4
6
|
import { classNames } from "@v-c/util";
|
|
5
7
|
//#region src/descriptions/Cell.tsx
|
|
6
|
-
function notEmpty(val) {
|
|
7
|
-
return val !== void 0 && val !== null;
|
|
8
|
-
}
|
|
9
8
|
const Cell = /* @__PURE__ */ defineComponent((props, { attrs, slots }) => {
|
|
10
9
|
const descContext = useDescriptionsCtx();
|
|
11
10
|
return () => {
|
|
@@ -14,19 +13,22 @@ const Cell = /* @__PURE__ */ defineComponent((props, { attrs, slots }) => {
|
|
|
14
13
|
const Component = component;
|
|
15
14
|
const label = getSlotPropsFnRun(slots, props, "label");
|
|
16
15
|
const content = getSlotPropsFnRun(slots, props, "content");
|
|
17
|
-
if (bordered)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
if (bordered) {
|
|
17
|
+
let typeStyle;
|
|
18
|
+
if (type === "label") typeStyle = styles?.label;
|
|
19
|
+
if (type === "content") typeStyle = styles?.content;
|
|
20
|
+
const mergedCellStyle = {
|
|
21
|
+
...normalizeStyle$1(attrs.style),
|
|
22
|
+
...typeStyle
|
|
23
|
+
};
|
|
24
|
+
return createVNode(Component, mergeProps({
|
|
25
|
+
"class": classNames({
|
|
26
|
+
[`${itemPrefixCls}-item-label`]: type === "label",
|
|
27
|
+
[`${itemPrefixCls}-item-content`]: type === "content"
|
|
28
|
+
}, type === "label" ? descriptionsClassNames?.label : void 0, type === "content" ? descriptionsClassNames?.content : void 0),
|
|
29
|
+
"colSpan": span
|
|
30
|
+
}, attrs, { "style": mergedCellStyle }), { default: () => [isRenderable(label) && createVNode("span", null, [label]), isRenderable(content) && createVNode("span", null, [content])] });
|
|
31
|
+
}
|
|
30
32
|
return createVNode(Component, mergeProps({ "class": classNames(`${itemPrefixCls}-item`) }, attrs, { "colSpan": span }), { default: () => [createVNode("div", { "class": `${itemPrefixCls}-item-container` }, [(label || label === 0) && createVNode("span", {
|
|
31
33
|
"class": classNames(`${itemPrefixCls}-item-label`, descriptionsClassNames?.label, { [`${itemPrefixCls}-item-no-colon`]: !colon }, classes?.label),
|
|
32
34
|
"style": styles?.label
|
|
@@ -35,65 +37,68 @@ const Cell = /* @__PURE__ */ defineComponent((props, { attrs, slots }) => {
|
|
|
35
37
|
"style": styles?.content
|
|
36
38
|
}, [content])])] });
|
|
37
39
|
};
|
|
38
|
-
}, {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
}, {
|
|
41
|
+
props: {
|
|
42
|
+
itemPrefixCls: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: true
|
|
45
|
+
},
|
|
46
|
+
span: {
|
|
47
|
+
type: Number,
|
|
48
|
+
required: true
|
|
49
|
+
},
|
|
50
|
+
component: {
|
|
51
|
+
type: String,
|
|
52
|
+
required: true
|
|
53
|
+
},
|
|
54
|
+
classes: {
|
|
55
|
+
type: Object,
|
|
56
|
+
required: false
|
|
57
|
+
},
|
|
58
|
+
styles: {
|
|
59
|
+
type: Object,
|
|
60
|
+
required: false
|
|
61
|
+
},
|
|
62
|
+
bordered: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
required: false,
|
|
65
|
+
default: void 0
|
|
66
|
+
},
|
|
67
|
+
label: {
|
|
68
|
+
type: [
|
|
69
|
+
Function,
|
|
70
|
+
String,
|
|
71
|
+
Number,
|
|
72
|
+
null,
|
|
73
|
+
Object,
|
|
74
|
+
Boolean
|
|
75
|
+
],
|
|
76
|
+
required: false,
|
|
77
|
+
default: void 0
|
|
78
|
+
},
|
|
79
|
+
content: {
|
|
80
|
+
type: [
|
|
81
|
+
Function,
|
|
82
|
+
String,
|
|
83
|
+
Number,
|
|
84
|
+
null,
|
|
85
|
+
Object,
|
|
86
|
+
Boolean
|
|
87
|
+
],
|
|
88
|
+
required: false,
|
|
89
|
+
default: void 0
|
|
90
|
+
},
|
|
91
|
+
type: {
|
|
92
|
+
type: String,
|
|
93
|
+
required: false
|
|
94
|
+
},
|
|
95
|
+
colon: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
required: false,
|
|
98
|
+
default: void 0
|
|
99
|
+
}
|
|
42
100
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
required: true
|
|
46
|
-
},
|
|
47
|
-
component: {
|
|
48
|
-
type: String,
|
|
49
|
-
required: true
|
|
50
|
-
},
|
|
51
|
-
classes: {
|
|
52
|
-
type: Object,
|
|
53
|
-
required: false
|
|
54
|
-
},
|
|
55
|
-
styles: {
|
|
56
|
-
type: Object,
|
|
57
|
-
required: false
|
|
58
|
-
},
|
|
59
|
-
bordered: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
required: false,
|
|
62
|
-
default: void 0
|
|
63
|
-
},
|
|
64
|
-
label: {
|
|
65
|
-
type: [
|
|
66
|
-
Function,
|
|
67
|
-
String,
|
|
68
|
-
Number,
|
|
69
|
-
null,
|
|
70
|
-
Object,
|
|
71
|
-
Boolean
|
|
72
|
-
],
|
|
73
|
-
required: false,
|
|
74
|
-
default: void 0
|
|
75
|
-
},
|
|
76
|
-
content: {
|
|
77
|
-
type: [
|
|
78
|
-
Function,
|
|
79
|
-
String,
|
|
80
|
-
Number,
|
|
81
|
-
null,
|
|
82
|
-
Object,
|
|
83
|
-
Boolean
|
|
84
|
-
],
|
|
85
|
-
required: false,
|
|
86
|
-
default: void 0
|
|
87
|
-
},
|
|
88
|
-
type: {
|
|
89
|
-
type: String,
|
|
90
|
-
required: false
|
|
91
|
-
},
|
|
92
|
-
colon: {
|
|
93
|
-
type: Boolean,
|
|
94
|
-
required: false,
|
|
95
|
-
default: void 0
|
|
96
|
-
}
|
|
97
|
-
} });
|
|
101
|
+
inheritAttrs: false
|
|
102
|
+
});
|
|
98
103
|
//#endregion
|
|
99
104
|
export { Cell as default };
|
package/dist/descriptions/Row.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { normalizeStyle as normalizeStyle$1 } from "../_util/styleUtils.js";
|
|
2
1
|
import { getSlotPropsFnRun } from "../_util/tools.js";
|
|
3
2
|
import { useDescriptionsCtx } from "./DescriptionsContext.js";
|
|
4
3
|
import Cell from "./Cell.js";
|
|
@@ -55,14 +54,21 @@ function renderCells(items, { colon, prefixCls, bordered, labelRender, contentRe
|
|
|
55
54
|
"content": showContent ? children : null,
|
|
56
55
|
"type": type
|
|
57
56
|
}, null);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"class": className,
|
|
61
|
-
"style": {
|
|
57
|
+
const mergedStyles = {
|
|
58
|
+
label: {
|
|
62
59
|
...rootStyles?.label,
|
|
63
|
-
...normalizeStyle$1(style) || {},
|
|
64
60
|
...styles?.label
|
|
65
61
|
},
|
|
62
|
+
content: {
|
|
63
|
+
...rootStyles?.content,
|
|
64
|
+
...styles?.content
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return [createVNode(Cell, {
|
|
68
|
+
"key": `label-${mergedKey}`,
|
|
69
|
+
"class": className,
|
|
70
|
+
"style": style,
|
|
71
|
+
"styles": mergedStyles,
|
|
66
72
|
"span": 1,
|
|
67
73
|
"colon": colon,
|
|
68
74
|
"component": component[0],
|
|
@@ -73,11 +79,8 @@ function renderCells(items, { colon, prefixCls, bordered, labelRender, contentRe
|
|
|
73
79
|
}, null), createVNode(Cell, {
|
|
74
80
|
"key": `content-${mergedKey}`,
|
|
75
81
|
"class": className,
|
|
76
|
-
"style":
|
|
77
|
-
|
|
78
|
-
...normalizeStyle$1(style) || {},
|
|
79
|
-
...styles?.content
|
|
80
|
-
},
|
|
82
|
+
"style": style,
|
|
83
|
+
"styles": mergedStyles,
|
|
81
84
|
"span": span * 2 - 1,
|
|
82
85
|
"component": component[1],
|
|
83
86
|
"itemPrefixCls": itemPrefixCls,
|