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
|
@@ -6,7 +6,7 @@ import { getTransitionName } from "@v-c/util/dist/utils/transition";
|
|
|
6
6
|
//#region src/image/hooks/useMergedPreviewConfig.ts
|
|
7
7
|
function useMergedPreviewConfig(previewConfig, contextPreviewConfig, prefixCls, mergedRootClassName, getContextPopupContainer, icons, defaultCover) {
|
|
8
8
|
const [zIndex] = useZIndex("ImagePreview", computed(() => previewConfig.value?.zIndex));
|
|
9
|
-
const [mergedPreviewMask, blurClassName] = useMergedMask(computed(() => previewConfig.value?.mask), computed(() => contextPreviewConfig.value?.mask), computed(() => `${prefixCls.value}-preview`));
|
|
9
|
+
const [mergedPreviewMask, blurClassName, mergedMaskClosable] = useMergedMask(computed(() => previewConfig.value?.mask), computed(() => contextPreviewConfig.value?.mask), computed(() => `${prefixCls.value}-preview`));
|
|
10
10
|
return computed(() => {
|
|
11
11
|
if (!previewConfig.value) return previewConfig.value;
|
|
12
12
|
const { cover, getContainer, closeIcon, rootClassName: previewRootClassName } = previewConfig.value;
|
|
@@ -21,6 +21,7 @@ function useMergedPreviewConfig(previewConfig, contextPreviewConfig, prefixCls,
|
|
|
21
21
|
closeIcon: closeIcon ?? contextCloseIcon,
|
|
22
22
|
rootClassName: clsx(mergedRootClassName.value, previewRootClassName),
|
|
23
23
|
mask: mergedPreviewMask.value,
|
|
24
|
+
maskClosable: mergedMaskClosable.value,
|
|
24
25
|
blurClassName: blurClassName.value?.mask
|
|
25
26
|
};
|
|
26
27
|
});
|
|
@@ -7,14 +7,14 @@ declare function usePreviewConfig<T extends PreviewConfig | GroupPreviewConfig>(
|
|
|
7
7
|
readonly onOpenChange: ((value: boolean, info: {
|
|
8
8
|
current: number;
|
|
9
9
|
}) => void) | undefined;
|
|
10
|
-
readonly cover: string | number | boolean | import("vue").
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
}> | import("vue").ComponentOptions<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, any, any, any, string, {}, {}, string, {}, {}, {}, string, import("vue").ComponentProvideOptions> | import("vue").FunctionalComponent<any, {}, any, {}> | {
|
|
10
|
+
readonly cover: string | number | boolean | import("vue").ComponentOptions<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, any, any, any, string, {}, {}, string, {}, {}, {}, string, import("vue").ComponentProvideOptions> | import("vue").FunctionalComponent<any, {}, any, {}> | {
|
|
13
11
|
new (...args: any[]): any;
|
|
14
12
|
__isFragment?: never;
|
|
15
13
|
__isTeleport?: never;
|
|
16
14
|
__isSuspense?: never;
|
|
17
|
-
} |
|
|
15
|
+
} | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}> | (string | number | boolean | void | import("vue").Component | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
18
18
|
[key: string]: any;
|
|
19
19
|
}> | null | undefined)[] | import("@v-c/image").CoverConfig | {
|
|
20
20
|
enabled?: boolean;
|
|
@@ -36,21 +36,21 @@ declare function usePreviewConfig<T extends PreviewConfig | GroupPreviewConfig>(
|
|
|
36
36
|
image: import("@v-c/image").ImgInfo;
|
|
37
37
|
}) => import("@v-c/util").VueNode;
|
|
38
38
|
readonly onChange?: (current: number, prevCurrent: number) => void;
|
|
39
|
-
readonly
|
|
40
|
-
readonly src?: string;
|
|
41
|
-
readonly alt?: string;
|
|
39
|
+
readonly wheel?: boolean;
|
|
42
40
|
readonly focusTrap?: boolean;
|
|
43
41
|
readonly afterOpenChange?: (open: boolean) => void;
|
|
44
42
|
readonly maskClosable?: boolean;
|
|
45
43
|
readonly zIndex?: number;
|
|
46
44
|
readonly getContainer?: import("@v-c/portal/dist/Portal.js").PortalProps["getContainer"];
|
|
47
45
|
readonly closeIcon?: import("@v-c/util").VueNode | boolean | null;
|
|
46
|
+
readonly motionName?: string;
|
|
47
|
+
readonly src?: string;
|
|
48
|
+
readonly alt?: string;
|
|
49
|
+
readonly icons?: import("@v-c/image/dist/Preview/index.js").OperationIcons;
|
|
48
50
|
readonly countRender?: (current: number, total: number) => import("@v-c/util").VueNode;
|
|
49
51
|
readonly scaleStep?: number;
|
|
50
52
|
readonly minScale?: number;
|
|
51
53
|
readonly maxScale?: number;
|
|
52
|
-
readonly wheel?: boolean;
|
|
53
|
-
readonly motionName?: string;
|
|
54
54
|
readonly movable?: boolean;
|
|
55
55
|
readonly onTransform?: (info: {
|
|
56
56
|
transform: import("@v-c/image/dist/hooks/useImageTransform.js").TransformType;
|
|
@@ -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";
|
|
@@ -51,6 +54,6 @@ declare function genBoxStyle(position?: PositionType): CSSObject;
|
|
|
51
54
|
declare const genImageCoverStyle: GenerateStyle<ImageToken, CSSObject>;
|
|
52
55
|
declare const genImagePreviewStyle: GenerateStyle<ImageToken, CSSObject>;
|
|
53
56
|
declare const prepareComponentToken: GetDefaultToken<'Image'>;
|
|
54
|
-
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>];
|
|
57
|
+
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>];
|
|
55
58
|
//#endregion
|
|
56
59
|
export { ComponentToken, ImageToken, PositionType, _default as default, genBoxStyle, genImageCoverStyle, genImagePreviewStyle, prepareComponentToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ import Pagination from "./pagination/Pagination.js";
|
|
|
19
19
|
import { PaginationProps } from "./pagination/index.js";
|
|
20
20
|
import Popover, { PopoverEmits, PopoverProps, PopoverRef, PopoverSlots } from "./popover/index.js";
|
|
21
21
|
import Popconfirm, { PopconfirmEmits, PopconfirmProps, PopconfirmSlots } from "./popconfirm/index.js";
|
|
22
|
+
import { SplitterEmits, SplitterSlots } from "./splitter/interface.js";
|
|
22
23
|
import _default$11, { SpinProps, SpinRef, SpinSlots } from "./spin/index.js";
|
|
23
24
|
import InternalCheckbox, { CheckboxEmits, CheckboxProps, CheckboxSlots } from "./checkbox/Checkbox.js";
|
|
24
25
|
import CheckboxGroup, { CheckboxGroupEmits, CheckboxGroupProps, CheckboxGroupSlots, CheckboxOptionType } from "./checkbox/Group.js";
|
|
@@ -104,7 +105,6 @@ import SkeletonWithSubComponents, { SkeletonProps, SkeletonRef } from "./skeleto
|
|
|
104
105
|
import Slider, { SliderEmits, SliderProps, SliderRef } from "./slider/index.js";
|
|
105
106
|
import { SpaceCompactProps, SpaceCompactRef } from "./space/Compact.js";
|
|
106
107
|
import Space, { SpaceAddon, SpaceCompact, SpaceProps, SpaceSize, SpaceSlots } from "./space/index.js";
|
|
107
|
-
import { SplitterEmits, SplitterSlots } from "./splitter/interface.js";
|
|
108
108
|
import Splitter, { SplitterRef } from "./splitter/Splitter.js";
|
|
109
109
|
import { SplitterPanel, SplitterProps } from "./splitter/index.js";
|
|
110
110
|
import { StatisticRef } from "./statistic/Statistic.js";
|
package/dist/input/Group.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
2
|
+
import { useFormItemInputContext, useFormItemInputContextProvider } from "../form/context.js";
|
|
2
3
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
3
4
|
import { getAttrStyleAndClass } from "../_util/hooks/useMergeSemantic.js";
|
|
4
5
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
5
|
-
import { useFormItemInputContext, useFormItemInputContextProvider } from "../form/context.js";
|
|
6
6
|
import style_default, { useSharedStyle } from "./style/index.js";
|
|
7
7
|
import { SpaceCompact } from "../space/index.js";
|
|
8
8
|
import { computed, createVNode, defineComponent, mergeProps } from "vue";
|
package/dist/input/Input.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { SemanticClassNamesType, SemanticStylesType } from "../_util/hooks/useMe
|
|
|
3
3
|
import "../_util/hooks/index.js";
|
|
4
4
|
import { SizeType } from "../config-provider/SizeContext.js";
|
|
5
5
|
import { InputStatus } from "../_util/statusUtils.js";
|
|
6
|
+
import { AllowClear } from "../_util/hooks/useAllowClear.js";
|
|
6
7
|
import { ComponentBaseProps, Variant } from "../config-provider/context.js";
|
|
7
8
|
import { CSSProperties, SlotsType } from "vue";
|
|
8
9
|
import { InputProps as InputProps$1, InputRef as InputRef$1 } from "@v-c/input";
|
|
@@ -44,7 +45,7 @@ interface BaseVcInputProps {
|
|
|
44
45
|
components?: InputProps$1['components'];
|
|
45
46
|
prefix?: VueNode;
|
|
46
47
|
suffix?: VueNode;
|
|
47
|
-
allowClear?:
|
|
48
|
+
allowClear?: AllowClear;
|
|
48
49
|
changeOnComposing?: InputProps$1['changeOnComposing'];
|
|
49
50
|
autoFocus?: boolean;
|
|
50
51
|
inputMode?: string;
|
package/dist/input/Input.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
2
|
+
import { useFormItemInputContext } from "../form/context.js";
|
|
2
3
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
3
4
|
import { useSize } from "../config-provider/hooks/useSize.js";
|
|
4
5
|
import { useCompactItemContext } from "../space/Compact.js";
|
|
@@ -8,10 +9,9 @@ import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
|
8
9
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
9
10
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
10
11
|
import { getMergedStatus, getStatusClassNames } from "../_util/statusUtils.js";
|
|
11
|
-
import { useFormItemInputContext } from "../form/context.js";
|
|
12
12
|
import useVariant from "../form/hooks/useVariant.js";
|
|
13
13
|
import style_default, { useSharedStyle } from "./style/index.js";
|
|
14
|
-
import
|
|
14
|
+
import useAllowClear, { useAllowClearLabel } from "../_util/hooks/useAllowClear.js";
|
|
15
15
|
import useRemovePasswordTimeout from "./hooks/useRemovePasswordTimeout.js";
|
|
16
16
|
import { Fragment, computed, createVNode, defineComponent, isVNode, mergeProps, shallowRef } from "vue";
|
|
17
17
|
import { clsx } from "@v-c/util";
|
|
@@ -83,9 +83,12 @@ const InternalInput = /* @__PURE__ */ defineComponent((props, { slots, expose, e
|
|
|
83
83
|
const mergedStatus = computed(() => getMergedStatus(contextStatus.value, customStatus.value));
|
|
84
84
|
const [mergedVariant, enableVariantCls] = useVariant("input", customVariant, bordered);
|
|
85
85
|
const removePasswordTimeout = useRemovePasswordTimeout(inputRef, true);
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
const getClearLabel = useAllowClearLabel();
|
|
87
|
+
const mergedAllowClear = computed(() => useAllowClear({
|
|
88
|
+
allowClear: props.allowClear,
|
|
89
|
+
contextAllowClear: contextAllowClear.value,
|
|
90
|
+
defaultLabel: getClearLabel()
|
|
91
|
+
}));
|
|
89
92
|
const mergedAutoComplete = computed(() => props.autoComplete ?? props.autocomplete ?? contextAutoComplete.value ?? contextAutocomplete.value);
|
|
90
93
|
const mergedChangeOnComposing = computed(() => props.changeOnComposing ?? contextChangeOnComposing.value);
|
|
91
94
|
expose({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EmptyEmit } from "../../_util/type.js";
|
|
2
|
-
import { InputProps } from "../Input.js";
|
|
2
|
+
import { InputEmits, InputProps } from "../Input.js";
|
|
3
3
|
import { SlotsType } from "vue";
|
|
4
4
|
//#region src/input/OTP/OTPInput.d.ts
|
|
5
5
|
interface OTPInputProps extends Omit<InputProps, 'onChange'> {
|
|
@@ -8,6 +8,7 @@ interface OTPInputProps extends Omit<InputProps, 'onChange'> {
|
|
|
8
8
|
value?: string;
|
|
9
9
|
onChange: (index: number, value: string) => void;
|
|
10
10
|
onActiveChange: (nextIndex: number) => void;
|
|
11
|
+
onFocus?: InputEmits['focus'];
|
|
11
12
|
mask?: boolean | string;
|
|
12
13
|
}
|
|
13
14
|
declare const OTPInput: import("vue").DefineSetupFnComponent<OTPInputProps, EmptyEmit, SlotsType<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAttrStyleAndClass } from "../../_util/hooks/useMergeSemantic.js";
|
|
2
2
|
import InternalInput from "../Input.js";
|
|
3
|
-
import { createVNode, defineComponent, mergeProps, shallowRef } from "vue";
|
|
3
|
+
import { computed, createVNode, defineComponent, mergeProps, shallowRef } from "vue";
|
|
4
4
|
import { clsx } from "@v-c/util";
|
|
5
5
|
import raf from "@v-c/util/dist/raf";
|
|
6
6
|
import { omit } from "es-toolkit";
|
|
@@ -11,7 +11,7 @@ const OTPInput = /* @__PURE__ */ defineComponent((props, { attrs, expose, slots
|
|
|
11
11
|
expose({
|
|
12
12
|
focus: (...args) => inputRef.value?.focus?.(...args),
|
|
13
13
|
blur: () => inputRef.value?.blur?.(),
|
|
14
|
-
input: inputRef
|
|
14
|
+
input: computed(() => inputRef.value?.input ?? null)
|
|
15
15
|
});
|
|
16
16
|
const syncSelection = () => {
|
|
17
17
|
raf(() => {
|
|
@@ -22,6 +22,10 @@ const OTPInput = /* @__PURE__ */ defineComponent((props, { attrs, expose, slots
|
|
|
22
22
|
const handleChange = (e) => {
|
|
23
23
|
props.onChange(props.index, e?.target?.value ?? "");
|
|
24
24
|
};
|
|
25
|
+
const handleInternalFocus = (e) => {
|
|
26
|
+
props.onFocus?.(e);
|
|
27
|
+
syncSelection();
|
|
28
|
+
};
|
|
25
29
|
const handleKeyDown = (event) => {
|
|
26
30
|
const { key, ctrlKey, metaKey } = event;
|
|
27
31
|
if (key === "ArrowLeft") props.onActiveChange(props.index - 1);
|
|
@@ -36,6 +40,7 @@ const OTPInput = /* @__PURE__ */ defineComponent((props, { attrs, expose, slots
|
|
|
36
40
|
"index",
|
|
37
41
|
"onChange",
|
|
38
42
|
"onActiveChange",
|
|
43
|
+
"onFocus",
|
|
39
44
|
"mask"
|
|
40
45
|
]);
|
|
41
46
|
return () => createVNode("span", {
|
|
@@ -53,7 +58,7 @@ const OTPInput = /* @__PURE__ */ defineComponent((props, { attrs, expose, slots
|
|
|
53
58
|
"onChange": handleChange,
|
|
54
59
|
"htmlSize": 1,
|
|
55
60
|
"onKeydown": handleKeyDown,
|
|
56
|
-
"onFocus":
|
|
61
|
+
"onFocus": handleInternalFocus,
|
|
57
62
|
"onMousedown": () => syncSelection(),
|
|
58
63
|
"onMouseup": () => syncSelection(),
|
|
59
64
|
"aria-label": `OTP Input ${props.index + 1}`
|
|
@@ -80,6 +85,10 @@ const OTPInput = /* @__PURE__ */ defineComponent((props, { attrs, expose, slots
|
|
|
80
85
|
type: Function,
|
|
81
86
|
required: true
|
|
82
87
|
},
|
|
88
|
+
onFocus: {
|
|
89
|
+
type: Function,
|
|
90
|
+
required: false
|
|
91
|
+
},
|
|
83
92
|
mask: {
|
|
84
93
|
type: [Boolean, String],
|
|
85
94
|
required: false,
|
|
@@ -18,7 +18,7 @@ interface OTPSemanticStyles {
|
|
|
18
18
|
}
|
|
19
19
|
type OTPClassNamesType = SemanticClassNamesType<OTPProps, OTPSemanticClassNames>;
|
|
20
20
|
type OTPStylesType = SemanticStylesType<OTPProps, OTPSemanticStyles>;
|
|
21
|
-
interface OTPProps extends ComponentBaseProps, Omit<HTMLAttributes, 'onChange' | 'onInput'>, OTPEmitsProps {
|
|
21
|
+
interface OTPProps extends ComponentBaseProps, Omit<HTMLAttributes, 'onChange' | 'onInput' | 'onFocus'>, OTPEmitsProps {
|
|
22
22
|
length?: number;
|
|
23
23
|
variant?: Variant;
|
|
24
24
|
size?: SizeType;
|
|
@@ -39,9 +39,11 @@ interface OTPEmits {
|
|
|
39
39
|
'change': (value: string) => void;
|
|
40
40
|
'input': (cells: string[]) => void;
|
|
41
41
|
'update:value': (value: string) => void;
|
|
42
|
+
'focus': (ev: FocusEvent) => void;
|
|
42
43
|
}
|
|
43
44
|
interface OTPEmitsProps {
|
|
44
45
|
onChange?: OTPEmits['change'];
|
|
46
|
+
onFocus?: OTPEmits['focus'];
|
|
45
47
|
onInput?: OTPEmits['input'];
|
|
46
48
|
'onUpdate:value'?: OTPEmits['update:value'];
|
|
47
49
|
}
|
package/dist/input/OTP/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { devUseWarning, isDev } from "../../_util/warning.js";
|
|
2
|
+
import { useFormItemInputContext, useFormItemInputContextProvider } from "../../form/context.js";
|
|
2
3
|
import { useComponentBaseConfig } from "../../config-provider/context.js";
|
|
3
4
|
import { useSize } from "../../config-provider/hooks/useSize.js";
|
|
4
5
|
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../../_util/hooks/useMergeSemantic.js";
|
|
5
6
|
import { toPropsRefs } from "../../_util/tools.js";
|
|
7
|
+
import { isRenderable } from "../../_util/is.js";
|
|
6
8
|
import { getMergedStatus } from "../../_util/statusUtils.js";
|
|
7
|
-
import { useFormItemInputContext, useFormItemInputContextProvider } from "../../form/context.js";
|
|
8
9
|
import useVariant from "../../form/hooks/useVariant.js";
|
|
9
10
|
import otp_default from "../style/otp.js";
|
|
10
11
|
import OTPInput from "./OTPInput.js";
|
|
@@ -55,7 +56,6 @@ const OTP = /* @__PURE__ */ defineComponent((props, { attrs, emit, slots }) => {
|
|
|
55
56
|
for (let i = 0; i < index; i += 1) if (!nextCells[i]) nextCells[i] = "";
|
|
56
57
|
if (txt.length <= 1) nextCells[index] = txt;
|
|
57
58
|
else nextCells = nextCells.slice(0, index).concat(strToArr(txt));
|
|
58
|
-
nextCells = nextCells.slice(0, mergedLength.value);
|
|
59
59
|
for (let i = nextCells.length - 1; i >= 0; i -= 1) {
|
|
60
60
|
if (nextCells[i]) break;
|
|
61
61
|
nextCells.pop();
|
|
@@ -64,21 +64,28 @@ const OTP = /* @__PURE__ */ defineComponent((props, { attrs, emit, slots }) => {
|
|
|
64
64
|
return strToArr(formattedValue).map((cell, i) => {
|
|
65
65
|
if (cell === " " && !nextCells[i]) return nextCells[i];
|
|
66
66
|
return cell;
|
|
67
|
-
});
|
|
67
|
+
}).slice(0, mergedLength.value);
|
|
68
68
|
};
|
|
69
69
|
const handleInputChange = (index, txt) => {
|
|
70
70
|
const nextCells = patchValue(index, txt);
|
|
71
|
+
triggerValueCellsChange(nextCells);
|
|
71
72
|
const nextIndex = Math.min(index + txt.length, mergedLength.value - 1);
|
|
72
73
|
if (nextIndex !== index && nextCells[index] !== void 0) inputRefs.value[nextIndex]?.focus?.();
|
|
73
|
-
triggerValueCellsChange(nextCells);
|
|
74
74
|
};
|
|
75
75
|
const handleActiveChange = (nextIndex) => {
|
|
76
76
|
inputRefs.value[nextIndex]?.focus?.();
|
|
77
77
|
};
|
|
78
|
+
const handleInputFocus = (event, index) => {
|
|
79
|
+
for (let i = 0; i < index; i += 1) if (!valueCells.value[i]) {
|
|
80
|
+
inputRefs.value[i]?.focus();
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
emit("focus", event);
|
|
84
|
+
};
|
|
78
85
|
const renderSeparator = (index) => {
|
|
79
86
|
const separator = slots.separator || props.separator;
|
|
80
87
|
const separatorNode = typeof separator === "function" ? separator({ index }) : separator;
|
|
81
|
-
if (!separatorNode) return null;
|
|
88
|
+
if (!isRenderable(separatorNode)) return null;
|
|
82
89
|
return createVNode("span", {
|
|
83
90
|
"key": `otp-sep-${index}`,
|
|
84
91
|
"class": clsx(`${prefixCls.value}-separator`, mergedClassNames.value.separator),
|
|
@@ -105,6 +112,7 @@ const OTP = /* @__PURE__ */ defineComponent((props, { attrs, emit, slots }) => {
|
|
|
105
112
|
"value": valueCells.value[index] || "",
|
|
106
113
|
"onChange": handleInputChange,
|
|
107
114
|
"onActiveChange": handleActiveChange,
|
|
115
|
+
"onFocus": (event) => handleInputFocus(event, index),
|
|
108
116
|
"autoFocus": index === 0 ? props.autoFocus : void 0,
|
|
109
117
|
"mask": props.mask,
|
|
110
118
|
"type": props.type,
|
|
@@ -202,7 +210,8 @@ const OTP = /* @__PURE__ */ defineComponent((props, { attrs, emit, slots }) => {
|
|
|
202
210
|
emits: [
|
|
203
211
|
"change",
|
|
204
212
|
"input",
|
|
205
|
-
"update:value"
|
|
213
|
+
"update:value",
|
|
214
|
+
"focus"
|
|
206
215
|
],
|
|
207
216
|
name: "AInputOtp",
|
|
208
217
|
inheritAttrs: false
|
package/dist/input/Password.js
CHANGED
|
@@ -21,10 +21,10 @@ const InternalPassword = /* @__PURE__ */ defineComponent((props, { slots, attrs,
|
|
|
21
21
|
const inputRef = shallowRef();
|
|
22
22
|
const removePasswordTimeout = useRemovePasswordTimeout(inputRef);
|
|
23
23
|
const visibilityToggle = computed(() => props.visibilityToggle ?? true);
|
|
24
|
-
const visibilityControlled = computed(() => typeof visibilityToggle.value === "object" && visibilityToggle.value.visible !== void 0);
|
|
25
|
-
const visible = shallowRef(visibilityControlled.value ? Boolean(visibilityToggle.value.visible) : false);
|
|
26
|
-
watch(visibilityToggle, (
|
|
27
|
-
if (visibilityControlled.value) visible.value = Boolean(
|
|
24
|
+
const visibilityControlled = computed(() => props.iconVisible !== void 0 || typeof visibilityToggle.value === "object" && visibilityToggle.value.visible !== void 0);
|
|
25
|
+
const visible = shallowRef(props.iconVisible ?? (visibilityControlled.value ? Boolean(visibilityToggle.value.visible) : false));
|
|
26
|
+
watch([visibilityToggle, () => props.iconVisible], ([toggle, iconVisible]) => {
|
|
27
|
+
if (visibilityControlled.value) visible.value = iconVisible ?? Boolean(toggle.visible);
|
|
28
28
|
});
|
|
29
29
|
const triggerVisibleChange = () => {
|
|
30
30
|
if (mergedDisabled.value || visibilityToggle.value === false) return;
|
|
@@ -32,6 +32,7 @@ const InternalPassword = /* @__PURE__ */ defineComponent((props, { slots, attrs,
|
|
|
32
32
|
const next = !visible.value;
|
|
33
33
|
if (!visibilityControlled.value) visible.value = next;
|
|
34
34
|
if (typeof visibilityToggle.value === "object") visibilityToggle.value.onVisibleChange?.(next);
|
|
35
|
+
emit("update:iconVisible", next);
|
|
35
36
|
};
|
|
36
37
|
const action = computed(() => props.action ?? "click");
|
|
37
38
|
const iconRender = (visible) => {
|
|
@@ -84,7 +85,8 @@ const InternalPassword = /* @__PURE__ */ defineComponent((props, { slots, attrs,
|
|
|
84
85
|
"suffix",
|
|
85
86
|
"inputPrefixCls",
|
|
86
87
|
"rootClass",
|
|
87
|
-
"prefixCls"
|
|
88
|
+
"prefixCls",
|
|
89
|
+
"iconVisible"
|
|
88
90
|
]);
|
|
89
91
|
const suffixSlot = getSlotPropsFnRun(slots, props, "suffix");
|
|
90
92
|
const visibilityIcon = getIcon();
|
package/dist/input/Search.js
CHANGED
|
@@ -2,6 +2,7 @@ import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
|
2
2
|
import { useSize } from "../config-provider/hooks/useSize.js";
|
|
3
3
|
import { useCompactItemContext } from "../space/Compact.js";
|
|
4
4
|
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
5
|
+
import fallbackProp from "../_util/fallbackProp.js";
|
|
5
6
|
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
6
7
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
7
8
|
import button_default from "../button/index.js";
|
|
@@ -31,7 +32,7 @@ const omitInputKeys = [
|
|
|
31
32
|
const InternalSearch = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit, expose }) => {
|
|
32
33
|
const composedRef = shallowRef(false);
|
|
33
34
|
const inputRef = shallowRef();
|
|
34
|
-
const { prefixCls, direction, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, getPrefixCls } = useComponentBaseConfig("inputSearch", props,
|
|
35
|
+
const { prefixCls, direction, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, searchIcon: contextSearchIcon, getPrefixCls } = useComponentBaseConfig("inputSearch", props, ["searchIcon"], "input-search");
|
|
35
36
|
const inputPrefixCls = computed(() => getPrefixCls("input", props.inputPrefixCls));
|
|
36
37
|
const { classes, styles, size: customizeSize, disabled: customDisabled, variant: customizeVariant, bordered } = toPropsRefs(props, "classes", "styles", "size", "disabled", "variant", "bordered");
|
|
37
38
|
const contextDisabled = useDisabledContext();
|
|
@@ -102,7 +103,7 @@ const InternalSearch = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
102
103
|
const enterButtonValue = props.enterButton ?? false;
|
|
103
104
|
const isBooleanEnterButton = typeof enterButtonValue === "boolean";
|
|
104
105
|
const searchIconFromSlot = getSlotPropsFnRun(slots, props, "searchIcon", false);
|
|
105
|
-
const searchIcon = isBooleanEnterButton ? searchIconFromSlot
|
|
106
|
+
const searchIcon = isBooleanEnterButton ? fallbackProp(searchIconFromSlot, contextSearchIcon.value, createVNode(SearchOutlined, null, null)) : null;
|
|
106
107
|
const buttonChildren = isBooleanEnterButton ? void 0 : enterButtonValue;
|
|
107
108
|
let buttonNode;
|
|
108
109
|
const enterButtonNode = buttonChildren;
|
|
@@ -140,6 +141,7 @@ const InternalSearch = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
140
141
|
"class": mergedClassName,
|
|
141
142
|
"style": mergedRootStyle
|
|
142
143
|
}, { hidden: props.hidden }, rootAttrs, { "size": mergedSize.value }), { default: () => [createVNode(InternalInput, mergeProps(inputAttrs, restInputProps, {
|
|
144
|
+
"type": "search",
|
|
143
145
|
"ref": inputRef,
|
|
144
146
|
"prefixCls": inputPrefixCls.value,
|
|
145
147
|
"size": mergedSize.value,
|
package/dist/input/TextArea.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { SemanticClassNamesType, SemanticStylesType } from "../_util/hooks/useMe
|
|
|
2
2
|
import "../_util/hooks/index.js";
|
|
3
3
|
import { SizeType } from "../config-provider/SizeContext.js";
|
|
4
4
|
import { InputStatus } from "../_util/statusUtils.js";
|
|
5
|
+
import { AllowClear } from "../_util/hooks/useAllowClear.js";
|
|
5
6
|
import { ComponentBaseProps, Variant } from "../config-provider/context.js";
|
|
6
7
|
import { CSSProperties, SlotsType } from "vue";
|
|
7
8
|
import { InputProps } from "@v-c/input";
|
|
@@ -25,7 +26,7 @@ interface TextAreaRef extends Pick<TextAreaRef$1, 'focus' | 'blur'> {
|
|
|
25
26
|
nativeElement: TextAreaRef$1['nativeElement'] | null;
|
|
26
27
|
}
|
|
27
28
|
type InputTextAreaRef = TextAreaRef;
|
|
28
|
-
interface TextAreaProps extends ComponentBaseProps, Omit<TextAreaProps$1, 'classNames' | 'styles' | 'onChange' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd' | 'onKeydown' | 'onPressEnter' | 'onResize' | 'maxLength' | 'readOnly' | 'minLength'>, TextAreaEmitsProps {
|
|
29
|
+
interface TextAreaProps extends ComponentBaseProps, Omit<TextAreaProps$1, 'classNames' | 'styles' | 'onChange' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd' | 'onKeydown' | 'onPressEnter' | 'onResize' | 'maxLength' | 'readOnly' | 'minLength' | 'allowClear'>, TextAreaEmitsProps {
|
|
29
30
|
/** @deprecated Use `variant` instead */
|
|
30
31
|
bordered?: boolean;
|
|
31
32
|
size?: SizeType;
|
|
@@ -38,6 +39,7 @@ interface TextAreaProps extends ComponentBaseProps, Omit<TextAreaProps$1, 'class
|
|
|
38
39
|
minlength?: number;
|
|
39
40
|
readonly?: boolean;
|
|
40
41
|
showCount?: InputProps['showCount'];
|
|
42
|
+
allowClear?: AllowClear;
|
|
41
43
|
}
|
|
42
44
|
interface TextAreaEmits {
|
|
43
45
|
'pressEnter': NonNullable<TextAreaProps$1['onPressEnter']>;
|
package/dist/input/TextArea.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
2
|
+
import { useFormItemInputContext } from "../form/context.js";
|
|
2
3
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
3
4
|
import { useSize } from "../config-provider/hooks/useSize.js";
|
|
4
5
|
import { useCompactItemContext } from "../space/Compact.js";
|
|
@@ -7,10 +8,9 @@ import { toPropsRefs } from "../_util/tools.js";
|
|
|
7
8
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
8
9
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
9
10
|
import { getMergedStatus, getStatusClassNames } from "../_util/statusUtils.js";
|
|
10
|
-
import { useFormItemInputContext } from "../form/context.js";
|
|
11
11
|
import useVariant from "../form/hooks/useVariant.js";
|
|
12
12
|
import { useSharedStyle } from "./style/index.js";
|
|
13
|
-
import
|
|
13
|
+
import useAllowClear, { useAllowClearLabel } from "../_util/hooks/useAllowClear.js";
|
|
14
14
|
import textarea_default from "./style/textarea.js";
|
|
15
15
|
import { computed, createVNode, defineComponent, mergeProps, onBeforeUnmount, shallowRef } from "vue";
|
|
16
16
|
import { clsx } from "@v-c/util";
|
|
@@ -56,7 +56,12 @@ const InternalTextArea = /* @__PURE__ */ defineComponent((props, { attrs, emit,
|
|
|
56
56
|
const hasFeedback = computed(() => formItemInputContext.value.hasFeedback);
|
|
57
57
|
const feedbackIcon = computed(() => formItemInputContext.value.feedbackIcon);
|
|
58
58
|
const [mergedVariant, enableVariantCls] = useVariant("textArea", customVariant, bordered);
|
|
59
|
-
const
|
|
59
|
+
const getClearLabel = useAllowClearLabel();
|
|
60
|
+
const mergedAllowClear = computed(() => useAllowClear({
|
|
61
|
+
allowClear: props.allowClear,
|
|
62
|
+
contextAllowClear: contextAllowClear.value,
|
|
63
|
+
defaultLabel: getClearLabel()
|
|
64
|
+
}));
|
|
60
65
|
const mergedChangeOnComposing = computed(() => props.changeOnComposing ?? contextChangeOnComposing.value);
|
|
61
66
|
const isMouseDown = shallowRef(false);
|
|
62
67
|
const resizeDirty = shallowRef(false);
|
|
@@ -202,6 +207,11 @@ const InternalTextArea = /* @__PURE__ */ defineComponent((props, { attrs, emit,
|
|
|
202
207
|
required: false,
|
|
203
208
|
default: void 0
|
|
204
209
|
},
|
|
210
|
+
allowClear: {
|
|
211
|
+
type: [Boolean, Object],
|
|
212
|
+
required: false,
|
|
213
|
+
default: void 0
|
|
214
|
+
},
|
|
205
215
|
rootClass: {
|
|
206
216
|
type: String,
|
|
207
217
|
required: false
|
|
@@ -222,11 +232,6 @@ const InternalTextArea = /* @__PURE__ */ defineComponent((props, { attrs, emit,
|
|
|
222
232
|
required: false,
|
|
223
233
|
default: void 0
|
|
224
234
|
},
|
|
225
|
-
allowClear: {
|
|
226
|
-
type: [Boolean, Object],
|
|
227
|
-
required: false,
|
|
228
|
-
default: void 0
|
|
229
|
-
},
|
|
230
235
|
suffix: {
|
|
231
236
|
type: [
|
|
232
237
|
Object,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
1
3
|
import { ComponentToken, InputToken, initComponentToken, initInputToken } from "./token.js";
|
|
4
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
2
5
|
import { GenerateStyle } from "../../theme/interface/index.js";
|
|
3
6
|
import "../../theme/internal.js";
|
|
4
7
|
import { CSSObject } from "@antdv-next/cssinjs";
|
|
@@ -15,7 +18,7 @@ declare const genInputGroupStyle: GenerateStyle<InputToken, CSSObject>;
|
|
|
15
18
|
declare const genInputStyle: GenerateStyle<InputToken, CSSObject>;
|
|
16
19
|
declare const genAllowClearStyle: GenerateStyle<InputToken, CSSObject>;
|
|
17
20
|
declare const genAffixStyle: GenerateStyle<InputToken, CSSObject>;
|
|
18
|
-
declare const useSharedStyle: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
19
|
-
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 useSharedStyle: (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>];
|
|
22
|
+
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>];
|
|
20
23
|
//#endregion
|
|
21
24
|
export { type ComponentToken, _default as default, genActiveStyle, genAffixStyle, genAllowClearStyle, genBasicInputStyle, genInputGroupStyle, genInputLargeStyle, genInputSmallStyle, genInputStyle, genPlaceholderStyle, initComponentToken, initInputToken, useSharedStyle };
|
|
@@ -93,7 +93,7 @@ const genInputGroupStyle = (token) => {
|
|
|
93
93
|
position: "relative",
|
|
94
94
|
padding: `0 ${unit(token.paddingInline)}`,
|
|
95
95
|
color: token.colorText,
|
|
96
|
-
fontWeight:
|
|
96
|
+
fontWeight: 400,
|
|
97
97
|
fontSize: token.inputFontSize,
|
|
98
98
|
textAlign: "center",
|
|
99
99
|
borderRadius: token.borderRadius,
|
|
@@ -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";
|
|
4
|
+
import "../../theme/interface/index.js";
|
|
1
5
|
//#region src/input/style/otp.d.ts
|
|
2
|
-
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>];
|
|
6
|
+
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>];
|
|
3
7
|
//#endregion
|
|
4
8
|
export { _default as default };
|
|
@@ -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";
|
|
4
|
+
import "../../theme/interface/index.js";
|
|
1
5
|
//#region src/input/style/search.d.ts
|
|
2
|
-
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>];
|
|
6
|
+
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>];
|
|
3
7
|
//#endregion
|
|
4
8
|
export { _default as default };
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
1
3
|
import { ComponentToken, initComponentToken, initInputToken } from "./token.js";
|
|
4
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
5
|
+
import "../../theme/interface/index.js";
|
|
2
6
|
//#region src/input/style/textarea.d.ts
|
|
3
|
-
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>];
|
|
7
|
+
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>];
|
|
4
8
|
//#endregion
|
|
5
9
|
export { type ComponentToken, _default as default, initComponentToken, initInputToken };
|
|
@@ -3,6 +3,7 @@ import { SemanticClassNamesType, SemanticStylesType } from "../_util/hooks/useMe
|
|
|
3
3
|
import "../_util/hooks/index.js";
|
|
4
4
|
import { SizeType } from "../config-provider/SizeContext.js";
|
|
5
5
|
import { InputStatus } from "../_util/statusUtils.js";
|
|
6
|
+
import { AllowClear } from "../_util/hooks/useAllowClear.js";
|
|
6
7
|
import { ComponentBaseProps, Variant } from "../config-provider/context.js";
|
|
7
8
|
import { CSSProperties, SlotsType } from "vue";
|
|
8
9
|
import { InputNumberProps as InputNumberProps$1, InputNumberRef as VcInputNumberRef, ValueType } from "@v-c/input-number";
|
|
@@ -41,12 +42,8 @@ interface InputNumberProps extends ComponentBaseProps, Omit<InputNumberProps$1,
|
|
|
41
42
|
addonAfter?: VueNode;
|
|
42
43
|
prefix?: VueNode;
|
|
43
44
|
suffix?: VueNode;
|
|
44
|
-
/** Show clear button, or customize it with `
|
|
45
|
-
allowClear?:
|
|
46
|
-
clearIcon?: VueNode;
|
|
47
|
-
disabled?: boolean;
|
|
48
|
-
label?: string;
|
|
49
|
-
};
|
|
45
|
+
/** Show clear button (cleared value: `null`), or customize it with `AllowClearConfig` */
|
|
46
|
+
allowClear?: AllowClear;
|
|
50
47
|
/** @deprecated Use `variant="borderless"` instead. */
|
|
51
48
|
bordered?: boolean;
|
|
52
49
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
2
|
+
import { useFormItemInputContext } from "../form/context.js";
|
|
2
3
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
3
4
|
import { useSize } from "../config-provider/hooks/useSize.js";
|
|
4
5
|
import { useCompactItemContext } from "../space/Compact.js";
|
|
@@ -8,9 +9,8 @@ import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
|
8
9
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
9
10
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
10
11
|
import { getMergedStatus, getStatusClassNames } from "../_util/statusUtils.js";
|
|
11
|
-
import { useFormItemInputContext } from "../form/context.js";
|
|
12
12
|
import useVariant from "../form/hooks/useVariant.js";
|
|
13
|
-
import
|
|
13
|
+
import useAllowClear, { useAllowClearLabel } from "../_util/hooks/useAllowClear.js";
|
|
14
14
|
import { SpaceAddon, SpaceCompact } from "../space/index.js";
|
|
15
15
|
import style_default from "./style/index.js";
|
|
16
16
|
import { Fragment, computed, createVNode, defineComponent, isVNode, mergeProps, shallowRef } from "vue";
|
|
@@ -69,6 +69,7 @@ const InputNumber = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit
|
|
|
69
69
|
warning(!(props.type === "number" && props.changeOnWheel), "usage", "When `type=\"number\"` is used with `changeOnWheel`, the wheel interaction may not work as expected. Remove `type=\"number\"` if not required.");
|
|
70
70
|
}
|
|
71
71
|
const { prefixCls, direction, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, allowClear: contextAllowClear } = useComponentBaseConfig("inputNumber", props, ["allowClear"], "input-number");
|
|
72
|
+
const getClearLabel = useAllowClearLabel();
|
|
72
73
|
const { classes, styles, rootClass, size: customSize, disabled: customDisabled, status: customStatus, bordered, variant: customVariant } = toPropsRefs(props, "classes", "styles", "rootClass", "size", "disabled", "status", "bordered", "variant");
|
|
73
74
|
const inputNumberRef = shallowRef();
|
|
74
75
|
expose({
|
|
@@ -177,7 +178,11 @@ const InputNumber = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit
|
|
|
177
178
|
};
|
|
178
179
|
const mergedSuffix = mergedSuffixFn();
|
|
179
180
|
const clearIconNode = slots.clearIcon?.();
|
|
180
|
-
const allowClear =
|
|
181
|
+
const allowClear = useAllowClear({
|
|
182
|
+
allowClear: props.allowClear,
|
|
183
|
+
contextAllowClear: contextAllowClear.value,
|
|
184
|
+
defaultLabel: getClearLabel()
|
|
185
|
+
});
|
|
181
186
|
const mergedAllowClear = clearIconNode && allowClear ? {
|
|
182
187
|
...typeof allowClear === "object" ? allowClear : {},
|
|
183
188
|
clearIcon: clearIconNode
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
1
3
|
import { ComponentToken } from "./token.js";
|
|
4
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
5
|
+
import "../../theme/interface/index.js";
|
|
2
6
|
//#region src/input-number/style/index.d.ts
|
|
3
|
-
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>];
|
|
7
|
+
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>];
|
|
4
8
|
//#endregion
|
|
5
9
|
export { type ComponentToken, _default as default };
|