antdv-next 1.5.6 → 1.7.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/ContextIsolator.js +12 -3
- 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 +35 -0
- package/dist/_util/hooks/useAllowClear.js +34 -0
- package/dist/_util/hooks/useClosable.js +1 -1
- 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/tools.d.ts +3 -1
- package/dist/_util/tools.js +6 -1
- 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 +135 -129
- package/dist/alert/style/index.d.ts +7 -4
- package/dist/alert/style/index.js +12 -9
- package/dist/anchor/style/index.d.ts +5 -1
- package/dist/antd-with-locales.esm.js +21947 -18522
- package/dist/antd-with-locales.js +82 -82
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +19553 -16771
- package/dist/antd.js +82 -82
- package/dist/app/style/index.d.ts +5 -1
- package/dist/auto-complete/index.js +1 -0
- package/dist/avatar/Avatar.js +2 -4
- package/dist/avatar/AvatarContext.d.ts +2 -2
- 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/BorderBeam.d.ts +8 -1
- package/dist/border-beam/BorderBeam.js +28 -14
- package/dist/border-beam/index.d.ts +2 -2
- package/dist/border-beam/style/index.d.ts +5 -1
- package/dist/breadcrumb/BreadcrumbItem.js +2 -2
- 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/card/style/index.js +2 -2
- 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/Panel.js +3 -3
- package/dist/cascader/index.js +14 -6
- package/dist/cascader/style/index.d.ts +5 -1
- package/dist/cascader/style/panel.d.ts +5 -1
- package/dist/checkbox/Checkbox.js +6 -4
- package/dist/checkbox/Group.d.ts +19 -1
- package/dist/checkbox/Group.js +34 -5
- package/dist/checkbox/GroupContext.d.ts +3 -0
- package/dist/checkbox/index.d.ts +2 -2
- package/dist/checkbox/style/index.d.ts +4 -1
- package/dist/collapse/style/index.d.ts +4 -1
- package/dist/color-picker/ColorPicker.js +8 -12
- package/dist/color-picker/style/index.d.ts +5 -1
- package/dist/color-picker/style/input.js +1 -1
- package/dist/components.d.ts +1 -1
- 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 +29 -4
- package/dist/date-picker/generatePicker/generateSinglePicker.js +32 -6
- package/dist/date-picker/generatePicker/interface.d.ts +4 -0
- package/dist/date-picker/generatePicker/useComponents.d.ts +3 -3
- package/dist/date-picker/style/index.d.ts +5 -1
- package/dist/date-picker/style/panel.js +1 -1
- package/dist/date-picker/style/util.js +1 -1
- package/dist/date-picker/util.d.ts +10 -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 +10 -10
- package/dist/descriptions/style/index.d.ts +5 -1
- package/dist/descriptions/style/index.js +11 -13
- package/dist/divider/style/index.d.ts +5 -1
- package/dist/divider/style/index.js +1 -1
- package/dist/drawer/DrawerPanel.js +7 -7
- 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.d.ts +2 -0
- package/dist/dropdown/dropdown.js +11 -3
- package/dist/dropdown/style/index.d.ts +5 -1
- package/dist/dropdown/style/index.js +1 -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/ErrorList.js +1 -1
- package/dist/form/Form.js +1 -1
- package/dist/form/FormItem/ItemHolder.js +1 -1
- package/dist/form/FormItem/index.js +38 -18
- package/dist/form/FormItemInput.js +1 -1
- package/dist/form/FormItemLabel.js +1 -1
- package/dist/form/context.d.ts +1 -1
- package/dist/form/hooks/useVariant.d.ts +1 -1
- package/dist/form/hooks/useVariant.js +1 -1
- package/dist/form/style/index.d.ts +5 -1
- package/dist/grid/style/index.d.ts +5 -2
- package/dist/image/hooks/useMergedPreviewConfig.d.ts +1 -0
- package/dist/image/hooks/useMergedPreviewConfig.js +2 -1
- package/dist/image/hooks/usePreviewConfig.d.ts +9 -9
- package/dist/image/style/index.d.ts +4 -1
- package/dist/index.d.ts +1 -1
- package/dist/input/Group.js +1 -1
- package/dist/input/Input.d.ts +2 -1
- package/dist/input/Input.js +8 -5
- package/dist/input/OTP/OTPInput.d.ts +2 -1
- package/dist/input/OTP/OTPInput.js +12 -3
- package/dist/input/OTP/index.d.ts +3 -1
- package/dist/input/OTP/index.js +15 -6
- package/dist/input/Password.js +7 -5
- package/dist/input/Search.js +4 -2
- package/dist/input/TextArea.d.ts +3 -1
- package/dist/input/TextArea.js +13 -8
- package/dist/input/style/index.d.ts +5 -2
- package/dist/input/style/index.js +1 -1
- 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/index.d.ts +3 -6
- package/dist/input-number/index.js +8 -3
- package/dist/input-number/style/index.d.ts +5 -1
- package/dist/input-number/style/index.js +1 -5
- package/dist/layout/style/index.d.ts +5 -1
- package/dist/layout/style/sider.d.ts +5 -1
- package/dist/listy/index.d.ts +1 -1
- package/dist/listy/index.js +9 -7
- package/dist/listy/interface.d.ts +6 -1
- package/dist/listy/style/index.d.ts +5 -1
- package/dist/listy/style/index.js +4 -2
- package/dist/locale/ar_EG.js +9 -0
- package/dist/locale/az_AZ.js +9 -0
- package/dist/locale/bg_BG.js +9 -0
- package/dist/locale/bn_BD.js +9 -0
- package/dist/locale/by_BY.js +9 -0
- package/dist/locale/ca_ES.js +9 -0
- package/dist/locale/cs_CZ.js +9 -0
- package/dist/locale/da_DK.js +9 -0
- package/dist/locale/de_DE.js +9 -0
- package/dist/locale/el_GR.js +9 -0
- package/dist/locale/en_GB.js +11 -1
- package/dist/locale/en_US.js +11 -1
- package/dist/locale/es_ES.js +9 -0
- package/dist/locale/et_EE.js +9 -0
- package/dist/locale/eu_ES.js +9 -0
- package/dist/locale/fa_IR.js +9 -0
- package/dist/locale/fi_FI.js +10 -1
- package/dist/locale/fr_BE.js +9 -0
- package/dist/locale/fr_CA.js +9 -0
- package/dist/locale/fr_FR.js +9 -0
- package/dist/locale/ga_IE.js +9 -0
- package/dist/locale/gl_ES.js +9 -0
- package/dist/locale/he_IL.js +9 -0
- package/dist/locale/hi_IN.js +9 -0
- package/dist/locale/hr_HR.js +9 -0
- package/dist/locale/hu_HU.js +9 -0
- package/dist/locale/hy_AM.js +9 -0
- package/dist/locale/id_ID.js +9 -0
- package/dist/locale/index.d.ts +3 -0
- package/dist/locale/is_IS.js +9 -0
- package/dist/locale/it_IT.js +9 -0
- package/dist/locale/ja_JP.js +9 -0
- package/dist/locale/ka_GE.js +9 -0
- package/dist/locale/kk_KZ.js +9 -0
- package/dist/locale/km_KH.js +9 -0
- package/dist/locale/kmr_IQ.js +9 -0
- package/dist/locale/kn_IN.js +9 -0
- package/dist/locale/ko_KR.js +9 -0
- package/dist/locale/ku_IQ.js +9 -0
- package/dist/locale/lt_LT.js +9 -0
- package/dist/locale/lv_LV.js +9 -0
- package/dist/locale/mk_MK.js +9 -0
- package/dist/locale/ml_IN.js +9 -0
- package/dist/locale/mn_MN.js +9 -0
- package/dist/locale/mr_IN.js +9 -0
- package/dist/locale/ms_MY.js +9 -0
- package/dist/locale/my_MM.js +9 -0
- package/dist/locale/nb_NO.js +9 -0
- package/dist/locale/ne_NP.js +9 -0
- package/dist/locale/nl_BE.js +9 -0
- package/dist/locale/nl_NL.js +9 -0
- package/dist/locale/pl_PL.js +9 -0
- package/dist/locale/pt_BR.js +9 -0
- package/dist/locale/pt_PT.js +9 -0
- package/dist/locale/ro_RO.js +19 -10
- package/dist/locale/ru_RU.js +9 -0
- package/dist/locale/si_LK.js +9 -0
- package/dist/locale/sk_SK.js +9 -0
- package/dist/locale/sl_SI.js +9 -0
- package/dist/locale/sq_AL.js +9 -0
- package/dist/locale/sr_RS.js +9 -0
- package/dist/locale/sv_SE.js +9 -0
- package/dist/locale/ta_IN.js +10 -1
- package/dist/locale/th_TH.js +9 -0
- package/dist/locale/tk_TK.js +9 -0
- package/dist/locale/tr_TR.js +9 -0
- package/dist/locale/uk_UA.js +9 -0
- package/dist/locale/ur_PK.js +9 -0
- package/dist/locale/useLocale.d.ts +7 -2
- package/dist/locale/useLocale.js +12 -1
- package/dist/locale/uz_UZ.js +9 -0
- package/dist/locale/vi_VN.js +9 -0
- package/dist/locale/zh_CN.js +13 -3
- package/dist/locale/zh_HK.js +11 -1
- package/dist/locale/zh_TW.js +11 -1
- package/dist/masonry/Masonry.js +1 -1
- package/dist/masonry/style/index.d.ts +4 -1
- package/dist/mentions/index.d.ts +2 -3
- package/dist/mentions/index.js +10 -5
- package/dist/mentions/style/index.d.ts +5 -1
- package/dist/mentions/style/index.js +1 -1
- package/dist/menu/MenuContext.d.ts +2 -0
- package/dist/menu/MenuItem.js +25 -7
- package/dist/menu/index.js +5 -0
- package/dist/menu/menu.d.ts +3 -0
- package/dist/menu/menu.js +7 -0
- package/dist/message/style/index.d.ts +5 -1
- package/dist/modal/ConfirmDialog.js +14 -7
- package/dist/modal/style/index.d.ts +3 -1
- package/dist/notification/PurePanel.js +7 -12
- package/dist/notification/interface.d.ts +8 -0
- package/dist/notification/style/index.d.ts +4 -1
- package/dist/notification/style/index.js +1 -1
- package/dist/notification/style/placement.js +10 -7
- package/dist/notification/useNotification.js +5 -15
- package/dist/package.js +1 -1
- package/dist/pagination/Pagination.js +2 -2
- package/dist/pagination/style/index.d.ts +5 -1
- package/dist/pagination/useShowSizeChanger.d.ts +3 -0
- package/dist/pagination/useShowSizeChanger.js +1 -1
- package/dist/popconfirm/index.js +5 -5
- package/dist/popconfirm/style/index.d.ts +5 -1
- package/dist/popconfirm/style/index.js +1 -1
- package/dist/popover/index.js +5 -4
- package/dist/popover/style/index.d.ts +5 -1
- package/dist/popover/style/index.js +2 -2
- package/dist/progress/Circle.js +0 -8
- package/dist/progress/Line.js +1 -9
- package/dist/progress/Steps.js +0 -8
- package/dist/progress/progress.js +2 -14
- package/dist/progress/style/index.d.ts +5 -1
- package/dist/qrcode/index.js +4 -25
- package/dist/qrcode/interface.d.ts +1 -1
- package/dist/qrcode/style/index.d.ts +5 -1
- package/dist/radio/group.js +40 -7
- package/dist/radio/index.d.ts +2 -2
- package/dist/radio/interface.d.ts +19 -1
- package/dist/radio/radio.js +5 -3
- package/dist/radio/style/index.d.ts +5 -1
- package/dist/rate/style/index.d.ts +5 -1
- package/dist/result/index.js +3 -3
- package/dist/result/noFound.js +120 -140
- package/dist/result/serverError.js +132 -147
- package/dist/result/style/index.d.ts +5 -1
- package/dist/result/unauthorized.js +115 -129
- package/dist/segmented/index.js +1 -1
- package/dist/segmented/style/index.d.ts +5 -1
- package/dist/select/index.js +12 -5
- package/dist/select/style/dropdown.js +1 -1
- package/dist/select/style/index.d.ts +5 -1
- package/dist/select/style/index.js +2 -2
- package/dist/select/style/select-input-multiple.js +1 -1
- package/dist/select/usePopupRender.js +4 -1
- package/dist/skeleton/style/index.d.ts +5 -1
- package/dist/slider/index.d.ts +0 -3
- package/dist/slider/index.js +2 -2
- 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/SplitBar.js +9 -3
- package/dist/splitter/interface.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/steps/style/index.js +1 -1
- package/dist/steps/style/inline.js +1 -1
- package/dist/style/motion/collapse.js +4 -10
- package/dist/switch/style/index.d.ts +5 -1
- package/dist/table/ExpandIcon.d.ts +9 -4
- package/dist/table/ExpandIcon.js +42 -20
- package/dist/table/InternalTable.js +72 -62
- package/dist/table/hooks/useLazyKVMap.js +1 -1
- package/dist/table/hooks/useSelection.js +73 -15
- package/dist/table/interface.d.ts +8 -0
- package/dist/table/style/index.d.ts +5 -1
- package/dist/table/style/index.js +1 -1
- package/dist/table/style/selection.js +1 -1
- package/dist/table/style/sorter.js +2 -2
- package/dist/table/util.d.ts +1 -1
- package/dist/tabs/index.js +9 -2
- package/dist/tabs/style/index.d.ts +5 -1
- package/dist/tabs/style/index.js +1 -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/time-picker/index.js +34 -0
- package/dist/timeline/Timeline.js +1 -1
- 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/tooltip/style/index.js +1 -1
- package/dist/tour/panelRender.js +3 -2
- package/dist/tour/style/index.d.ts +5 -1
- package/dist/transfer/Section.js +2 -1
- package/dist/transfer/Transfer.js +3 -1
- 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/style/index.js +1 -1
- package/dist/tree-select/index.js +15 -9
- package/dist/tree-select/style/index.d.ts +2 -2
- package/dist/typography/Base/index.js +23 -2
- package/dist/typography/Link.js +5 -0
- package/dist/typography/Paragraph.js +5 -0
- package/dist/typography/Text.js +5 -0
- package/dist/typography/Title.js +5 -0
- package/dist/typography/hooks/useMergedConfig.js +1 -1
- package/dist/typography/interface.d.ts +8 -1
- package/dist/typography/style/index.d.ts +5 -1
- package/dist/typography/style/index.js +2 -1
- package/dist/typography/style/mixins.d.ts +2 -1
- package/dist/typography/style/mixins.js +26 -3
- package/dist/upload/Upload.d.ts +1 -0
- package/dist/upload/Upload.js +10 -3
- package/dist/upload/UploadList/ListItem.js +8 -3
- package/dist/upload/interface.d.ts +1 -0
- package/dist/upload/style/index.d.ts +5 -1
- package/dist/version/token-meta.json +1 -1
- package/dist/version/token.json +1 -1
- package/dist/watermark/index.js +1 -1
- package/global.d.ts +5 -0
- package/package.json +17 -17
- package/web-tags.json +5053 -3004
- package/web-types.json +13207 -7299
- package/dist/_util/getAllowClear.d.ts +0 -6
- package/dist/_util/getAllowClear.js +0 -11
package/dist/alert/Alert.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
2
|
import { getAttrStyleAndClass, pureAttrs, useMergeSemanticNoRef } from "../_util/hooks/useMergeSemantic.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getSlotPropsFnRun, toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
|
|
4
4
|
import { isRenderable } from "../_util/is.js";
|
|
5
5
|
import style_default from "./style/index.js";
|
|
6
6
|
import { Transition, computed, createVNode, defineComponent, mergeDefaults, mergeProps, shallowRef } from "vue";
|
|
7
7
|
import { classNames, clsx } from "@v-c/util";
|
|
8
8
|
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
9
9
|
import { CheckCircleFilled, CloseCircleFilled, CloseOutlined, ExclamationCircleFilled, InfoCircleFilled } from "@antdv-next/icons";
|
|
10
|
+
import pickAttrs from "@v-c/util/dist/pickAttrs";
|
|
10
11
|
//#region src/alert/Alert.tsx
|
|
11
12
|
const alertDefaultProps = { showIcon: void 0 };
|
|
12
13
|
const IconNode = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
@@ -25,135 +26,132 @@ const IconNode = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
25
26
|
warning: warningIcon ?? createVNode(ExclamationCircleFilled, null, null)
|
|
26
27
|
};
|
|
27
28
|
return createVNode("span", {
|
|
28
|
-
"class":
|
|
29
|
+
"class": className,
|
|
29
30
|
"style": style
|
|
30
31
|
}, [icon ?? iconMapFilled[type]]);
|
|
31
32
|
};
|
|
32
|
-
}, {
|
|
33
|
-
|
|
34
|
-
type:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
default: void 0
|
|
33
|
+
}, {
|
|
34
|
+
props: {
|
|
35
|
+
type: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: true
|
|
38
|
+
},
|
|
39
|
+
icon: {
|
|
40
|
+
type: [
|
|
41
|
+
Function,
|
|
42
|
+
String,
|
|
43
|
+
Number,
|
|
44
|
+
null,
|
|
45
|
+
Object,
|
|
46
|
+
Boolean
|
|
47
|
+
],
|
|
48
|
+
required: false,
|
|
49
|
+
default: void 0
|
|
50
|
+
},
|
|
51
|
+
successIcon: {
|
|
52
|
+
type: [
|
|
53
|
+
Function,
|
|
54
|
+
String,
|
|
55
|
+
Number,
|
|
56
|
+
null,
|
|
57
|
+
Object,
|
|
58
|
+
Boolean
|
|
59
|
+
],
|
|
60
|
+
required: false,
|
|
61
|
+
default: void 0
|
|
62
|
+
},
|
|
63
|
+
infoIcon: {
|
|
64
|
+
type: [
|
|
65
|
+
Function,
|
|
66
|
+
String,
|
|
67
|
+
Number,
|
|
68
|
+
null,
|
|
69
|
+
Object,
|
|
70
|
+
Boolean
|
|
71
|
+
],
|
|
72
|
+
required: false,
|
|
73
|
+
default: void 0
|
|
74
|
+
},
|
|
75
|
+
warningIcon: {
|
|
76
|
+
type: [
|
|
77
|
+
Function,
|
|
78
|
+
String,
|
|
79
|
+
Number,
|
|
80
|
+
null,
|
|
81
|
+
Object,
|
|
82
|
+
Boolean
|
|
83
|
+
],
|
|
84
|
+
required: false,
|
|
85
|
+
default: void 0
|
|
86
|
+
},
|
|
87
|
+
errorIcon: {
|
|
88
|
+
type: [
|
|
89
|
+
Function,
|
|
90
|
+
String,
|
|
91
|
+
Number,
|
|
92
|
+
null,
|
|
93
|
+
Object,
|
|
94
|
+
Boolean
|
|
95
|
+
],
|
|
96
|
+
required: false,
|
|
97
|
+
default: void 0
|
|
98
|
+
}
|
|
99
99
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
Function,
|
|
103
|
-
String,
|
|
104
|
-
Number,
|
|
105
|
-
null,
|
|
106
|
-
Object,
|
|
107
|
-
Boolean
|
|
108
|
-
],
|
|
109
|
-
required: false,
|
|
110
|
-
default: void 0
|
|
111
|
-
}
|
|
112
|
-
} });
|
|
100
|
+
inheritAttrs: false
|
|
101
|
+
});
|
|
113
102
|
const CloseIconNode = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
114
103
|
return () => {
|
|
115
|
-
const { isClosable, prefixCls, handleClose, ariaProps } = props;
|
|
104
|
+
const { isClosable, disabled, prefixCls, handleClose, ariaProps } = props;
|
|
116
105
|
const { className, style } = getAttrStyleAndClass(attrs);
|
|
117
|
-
const closeIcon = getSlotPropsFnRun(slots, props, "closeIcon");
|
|
118
|
-
const mergedCloseIcon =
|
|
106
|
+
const closeIcon = getSlotPropsFnRun(slots, props, "closeIcon", false);
|
|
107
|
+
const mergedCloseIcon = closeIcon === true || closeIcon === void 0 ? createVNode(CloseOutlined, null, null) : closeIcon;
|
|
119
108
|
return isClosable ? createVNode("button", mergeProps({
|
|
120
109
|
"type": "button",
|
|
110
|
+
"disabled": disabled,
|
|
121
111
|
"onClick": handleClose,
|
|
122
112
|
"class": clsx(`${prefixCls}-close-icon`, className),
|
|
123
|
-
"tabindex": 0,
|
|
124
113
|
"style": style
|
|
125
114
|
}, ariaProps), [mergedCloseIcon]) : null;
|
|
126
115
|
};
|
|
127
|
-
}, {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
String,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
116
|
+
}, {
|
|
117
|
+
props: {
|
|
118
|
+
isClosable: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
required: true
|
|
121
|
+
},
|
|
122
|
+
disabled: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
required: false,
|
|
125
|
+
default: void 0
|
|
126
|
+
},
|
|
127
|
+
prefixCls: {
|
|
128
|
+
type: String,
|
|
129
|
+
required: true
|
|
130
|
+
},
|
|
131
|
+
closeIcon: {
|
|
132
|
+
type: [
|
|
133
|
+
Function,
|
|
134
|
+
String,
|
|
135
|
+
Number,
|
|
136
|
+
null,
|
|
137
|
+
Object,
|
|
138
|
+
Boolean
|
|
139
|
+
],
|
|
140
|
+
required: false,
|
|
141
|
+
default: void 0
|
|
142
|
+
},
|
|
143
|
+
handleClose: {
|
|
144
|
+
type: Function,
|
|
145
|
+
required: true
|
|
146
|
+
},
|
|
147
|
+
ariaProps: {
|
|
148
|
+
type: Object,
|
|
149
|
+
required: true
|
|
150
|
+
}
|
|
150
151
|
},
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
} });
|
|
156
|
-
const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) => {
|
|
152
|
+
inheritAttrs: false
|
|
153
|
+
});
|
|
154
|
+
const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs, expose }) => {
|
|
157
155
|
const { closable: contextClosable, closeIcon: contextCloseIcon, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, direction, prefixCls, successIcon, errorIcon, infoIcon, warningIcon, variant: contextVariant } = useComponentBaseConfig("alert", props, [
|
|
158
156
|
"closable",
|
|
159
157
|
"closeIcon",
|
|
@@ -166,10 +164,13 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
|
|
|
166
164
|
const { classes, styles } = toPropsRefs$1(props, "classes", "styles");
|
|
167
165
|
const closed = shallowRef(false);
|
|
168
166
|
const internalRef = shallowRef();
|
|
167
|
+
expose({ nativeElement: internalRef });
|
|
169
168
|
const [hashId, cssVarCls] = style_default(prefixCls);
|
|
170
169
|
const handleClose = (e) => {
|
|
171
170
|
closed.value = true;
|
|
172
|
-
|
|
171
|
+
const closable = props.closable;
|
|
172
|
+
if (typeof closable === "object" && closable?.onClose) closable.onClose(e);
|
|
173
|
+
else emit("close", e);
|
|
173
174
|
};
|
|
174
175
|
const type = computed(() => {
|
|
175
176
|
if (props.type) return props.type;
|
|
@@ -222,19 +223,19 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
|
|
|
222
223
|
[`${prefixCls.value}-rtl`]: direction.value === "rtl"
|
|
223
224
|
}, contextClassName.value, className, rootClass, mergedClassNames.root, cssVarCls.value, hashId.value);
|
|
224
225
|
const mergedCloseIconFn = () => {
|
|
225
|
-
if (typeof closable === "object" && closable
|
|
226
|
-
const closeIcon =
|
|
227
|
-
if (closeIcon) return closeIcon;
|
|
228
|
-
if (typeof contextClosable.value === "object" && contextClosable.value) return contextClosable.value;
|
|
226
|
+
if (typeof closable === "object" && closable?.closeIcon) return closable.closeIcon;
|
|
227
|
+
const closeIcon = getSlotPropsFnRun(slots, props, "closeIcon", false);
|
|
228
|
+
if (closeIcon !== void 0) return closeIcon;
|
|
229
|
+
if (typeof contextClosable.value === "object" && contextClosable.value?.closeIcon) return contextClosable.value.closeIcon;
|
|
229
230
|
return contextCloseIcon.value;
|
|
230
231
|
};
|
|
231
232
|
const mergedCloseIcon = mergedCloseIconFn();
|
|
232
233
|
const mergedAriaPropsFn = () => {
|
|
233
234
|
const merged = closable ?? contextClosable.value;
|
|
234
|
-
if (typeof merged === "object") {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
235
|
+
if (typeof merged === "object" && merged) return pickAttrs(merged, {
|
|
236
|
+
aria: true,
|
|
237
|
+
data: true
|
|
238
|
+
});
|
|
238
239
|
return {};
|
|
239
240
|
};
|
|
240
241
|
const mergedAriaProps = mergedAriaPropsFn();
|
|
@@ -245,21 +246,25 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
|
|
|
245
246
|
"leaveActiveClass": `${prefixCls.value}-motion-leave ${prefixCls.value}-motion-leave-active`,
|
|
246
247
|
"leaveToClass": `${prefixCls.value}-motion-leave ${prefixCls.value}-motion-leave-active`,
|
|
247
248
|
"onBeforeLeave": handleBeforeLeave,
|
|
248
|
-
"onAfterLeave": () =>
|
|
249
|
+
"onAfterLeave": () => {
|
|
250
|
+
if (typeof closable === "object" && closable?.afterClose) closable.afterClose();
|
|
251
|
+
else props?.afterClose?.();
|
|
252
|
+
}
|
|
249
253
|
}, { default: () => [!closed.value ? createVNode("div", mergeProps({
|
|
250
254
|
"id": props.id,
|
|
251
255
|
"ref": internalRef,
|
|
252
256
|
"data-show": !closed.value,
|
|
253
257
|
"role": props.role || "alert",
|
|
254
258
|
"class": alertCls,
|
|
255
|
-
"style": [mergedStyles.root, style]
|
|
259
|
+
"style": [mergedStyles.root, style],
|
|
260
|
+
"onMouseenter": (e) => emit("mouseenter", e),
|
|
261
|
+
"onMouseleave": (e) => emit("mouseleave", e),
|
|
262
|
+
"onClick": (e) => emit("click", e)
|
|
256
263
|
}, pureAttrs(attrs)), [
|
|
257
264
|
isShowIcon ? createVNode(IconNode, {
|
|
258
|
-
"class": mergedClassNames.icon,
|
|
265
|
+
"class": clsx(`${prefixCls.value}-icon`, mergedClassNames.icon),
|
|
259
266
|
"style": mergedStyles.icon,
|
|
260
|
-
"description": description,
|
|
261
267
|
"icon": icon,
|
|
262
|
-
"prefixCls": prefixCls.value,
|
|
263
268
|
"type": type.value,
|
|
264
269
|
"successIcon": successIcon.value,
|
|
265
270
|
"infoIcon": infoIcon.value,
|
|
@@ -284,6 +289,7 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
|
|
|
284
289
|
"class": mergedClassNames.close,
|
|
285
290
|
"style": mergedStyles.close,
|
|
286
291
|
"isClosable": isClosable,
|
|
292
|
+
"disabled": typeof closable === "object" ? closable?.disabled : void 0,
|
|
287
293
|
"prefixCls": prefixCls.value,
|
|
288
294
|
"ariaProps": mergedAriaProps,
|
|
289
295
|
"handleClose": handleClose,
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
3
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
1
4
|
import { FullToken, GetDefaultToken } from "../../theme/interface/cssinjs-utils.js";
|
|
2
5
|
import { GenerateStyle } from "../../theme/interface/index.js";
|
|
3
6
|
import "../../theme/internal.js";
|
|
@@ -6,10 +9,10 @@ import { CSSObject } from "@antdv-next/cssinjs";
|
|
|
6
9
|
//#region src/alert/style/index.d.ts
|
|
7
10
|
interface ComponentToken {
|
|
8
11
|
/**
|
|
9
|
-
* @desc
|
|
10
|
-
* @descEN Border radius of
|
|
12
|
+
* @desc 容器圆角
|
|
13
|
+
* @descEN Border radius of the container
|
|
11
14
|
*/
|
|
12
|
-
|
|
15
|
+
containerBorderRadius: CSSProperties['borderRadius'];
|
|
13
16
|
/**
|
|
14
17
|
* @desc 默认内间距
|
|
15
18
|
* @descEN Default padding
|
|
@@ -31,6 +34,6 @@ declare const genBaseStyle: GenerateStyle<AlertToken, CSSObject>;
|
|
|
31
34
|
declare const genTypeStyle: GenerateStyle<AlertToken, CSSObject>;
|
|
32
35
|
declare const genActionStyle: GenerateStyle<AlertToken, CSSObject>;
|
|
33
36
|
declare const prepareComponentToken: GetDefaultToken<'Alert'>;
|
|
34
|
-
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>];
|
|
37
|
+
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>];
|
|
35
38
|
//#endregion
|
|
36
39
|
export { ComponentToken, _default as default, genActionStyle, genBaseStyle, genTypeStyle, prepareComponentToken };
|
|
@@ -10,7 +10,7 @@ function genAlertTypeStyle(bgColor, borderColor, iconColor, token, alertCls) {
|
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
const genBaseStyle = (token) => {
|
|
13
|
-
const { componentCls, motionDurationSlow: duration, marginXS, marginSM, fontSize, fontSizeLG, lineHeight, motionEaseInOutCirc,
|
|
13
|
+
const { componentCls, motionDurationSlow: duration, marginXS, marginSM, fontSize, fontSizeLG, lineHeight, motionEaseInOutCirc, containerBorderRadius, withDescriptionIconSize, colorText, colorTextHeading, withDescriptionPadding, defaultPadding } = token;
|
|
14
14
|
return { [componentCls]: {
|
|
15
15
|
...resetComponent(token),
|
|
16
16
|
position: "relative",
|
|
@@ -18,7 +18,7 @@ const genBaseStyle = (token) => {
|
|
|
18
18
|
alignItems: "center",
|
|
19
19
|
padding: defaultPadding,
|
|
20
20
|
wordWrap: "break-word",
|
|
21
|
-
borderRadius,
|
|
21
|
+
borderRadius: containerBorderRadius,
|
|
22
22
|
[`&${componentCls}-rtl`]: { direction: "rtl" },
|
|
23
23
|
[`${componentCls}-section`]: {
|
|
24
24
|
flex: 1,
|
|
@@ -94,7 +94,7 @@ const genTypeStyle = (token) => {
|
|
|
94
94
|
} };
|
|
95
95
|
};
|
|
96
96
|
const genActionStyle = (token) => {
|
|
97
|
-
const { componentCls, iconCls, motionDurationMid, marginXS, fontSizeIcon, colorIcon, colorIconHover } = token;
|
|
97
|
+
const { componentCls, iconCls, motionDurationMid, marginXS, fontSizeIcon, colorIcon, colorIconHover, colorTextDisabled } = token;
|
|
98
98
|
return { [componentCls]: {
|
|
99
99
|
[`${componentCls}-actions`]: { marginInlineStart: marginXS },
|
|
100
100
|
[`${componentCls}-close-icon`]: {
|
|
@@ -111,18 +111,21 @@ const genActionStyle = (token) => {
|
|
|
111
111
|
color: colorIcon,
|
|
112
112
|
transition: `color ${motionDurationMid}`,
|
|
113
113
|
"&:hover": { color: colorIconHover }
|
|
114
|
+
},
|
|
115
|
+
"&:disabled": {
|
|
116
|
+
cursor: "not-allowed",
|
|
117
|
+
color: colorTextDisabled,
|
|
118
|
+
[`${iconCls}-close`]: {
|
|
119
|
+
color: "inherit",
|
|
120
|
+
pointerEvents: "none"
|
|
121
|
+
}
|
|
114
122
|
}
|
|
115
|
-
},
|
|
116
|
-
"&-close-text": {
|
|
117
|
-
color: colorIcon,
|
|
118
|
-
transition: `color ${motionDurationMid}`,
|
|
119
|
-
"&:hover": { color: colorIconHover }
|
|
120
123
|
}
|
|
121
124
|
} };
|
|
122
125
|
};
|
|
123
126
|
const prepareComponentToken = (token) => {
|
|
124
127
|
return {
|
|
125
|
-
|
|
128
|
+
containerBorderRadius: token.borderRadiusLG,
|
|
126
129
|
withDescriptionIconSize: token.fontSizeHeading3,
|
|
127
130
|
defaultPadding: `${token.paddingContentVerticalSM}px 12px`,
|
|
128
131
|
withDescriptionPadding: `${token.paddingMD}px ${token.paddingContentHorizontalLG}px`
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
3
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
1
4
|
import { GetDefaultToken } from "../../theme/interface/cssinjs-utils.js";
|
|
5
|
+
import "../../theme/interface/index.js";
|
|
2
6
|
import "../../theme/internal.js";
|
|
3
7
|
//#region src/anchor/style/index.d.ts
|
|
4
8
|
interface ComponentToken {
|
|
@@ -14,6 +18,6 @@ interface ComponentToken {
|
|
|
14
18
|
linkPaddingInlineStart: number;
|
|
15
19
|
}
|
|
16
20
|
declare const prepareComponentToken: GetDefaultToken<'Anchor'>;
|
|
17
|
-
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>];
|
|
21
|
+
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>];
|
|
18
22
|
//#endregion
|
|
19
23
|
export { ComponentToken, _default as default, prepareComponentToken };
|