antdv-next 1.6.0 → 1.7.1
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/hooks/useAllowClear.d.ts +22 -6
- package/dist/_util/hooks/useAllowClear.js +24 -6
- package/dist/_util/hooks/useClosable.js +1 -1
- package/dist/_util/tools.d.ts +3 -1
- package/dist/_util/tools.js +6 -1
- package/dist/_util/vueNode.d.ts +17 -3
- package/dist/_util/vueNode.js +17 -1
- package/dist/affix/index.js +12 -9
- package/dist/alert/Alert.js +4 -1
- package/dist/alert/style/index.d.ts +3 -3
- package/dist/alert/style/index.js +3 -3
- package/dist/anchor/Anchor.js +11 -6
- package/dist/anchor/style/index.js +2 -3
- package/dist/antd-with-locales.esm.js +16276 -17343
- package/dist/antd-with-locales.js +81 -88
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +14015 -15728
- package/dist/antd.js +82 -89
- package/dist/auto-complete/index.js +1 -0
- package/dist/avatar/Avatar.js +3 -5
- package/dist/avatar/AvatarGroup.js +3 -5
- 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/breadcrumb/BreadcrumbItem.js +1 -1
- package/dist/breadcrumb/index.d.ts +8 -1
- package/dist/calendar/generateCalendar.d.ts +10 -10
- package/dist/calendar/index.d.ts +1 -1
- package/dist/card/index.d.ts +8 -1
- package/dist/card/style/index.js +5 -9
- package/dist/cascader/Panel.js +3 -3
- package/dist/cascader/hooks/useIcons.js +3 -2
- package/dist/cascader/index.d.ts +2 -0
- package/dist/cascader/index.js +12 -5
- package/dist/checkbox/Checkbox.js +6 -4
- package/dist/checkbox/Group.d.ts +19 -1
- package/dist/checkbox/Group.js +38 -9
- package/dist/checkbox/GroupContext.d.ts +3 -0
- package/dist/checkbox/index.d.ts +2 -2
- package/dist/color-picker/ColorPicker.js +1 -1
- package/dist/color-picker/style/input.js +7 -12
- package/dist/components.d.ts +24 -24
- package/dist/components.js +1 -2
- package/dist/config-provider/context.d.ts +3 -2
- package/dist/date-picker/generatePicker/generateRangePicker.js +24 -6
- package/dist/date-picker/generatePicker/generateSinglePicker.js +24 -6
- package/dist/date-picker/generatePicker/interface.d.ts +21 -5
- package/dist/date-picker/generatePicker/useComponents.d.ts +1 -14
- 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 +8 -2
- package/dist/descriptions/hooks/useItems.d.ts +6 -6
- package/dist/descriptions/style/index.js +11 -13
- package/dist/divider/style/index.js +1 -1
- package/dist/drawer/DrawerPanel.js +1 -1
- package/dist/dropdown/dropdown.d.ts +2 -0
- package/dist/dropdown/dropdown.js +9 -2
- package/dist/dropdown/style/index.js +1 -7
- package/dist/empty/index.js +2 -1
- package/dist/float-button/BackTop.js +2 -1
- package/dist/form/ErrorList.js +1 -1
- package/dist/form/Form.js +9 -8
- package/dist/form/FormItem/ItemHolder.js +1 -1
- package/dist/form/FormItem/index.js +11 -9
- package/dist/form/FormItemInput.js +1 -1
- package/dist/form/FormItemLabel.js +2 -2
- package/dist/form/context.d.ts +2 -2
- package/dist/form/hooks/useVariant.d.ts +1 -1
- package/dist/form/hooks/useVariant.js +1 -1
- package/dist/grid/hooks/useBreakpoint.js +12 -6
- package/dist/image/PreviewGroup.d.ts +9 -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 +7 -7
- package/dist/image/index.d.ts +3 -3
- package/dist/index.d.ts +26 -24
- package/dist/index.js +1 -2
- 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.js +3 -16
- package/dist/input-number/index.d.ts +3 -6
- package/dist/input-number/index.js +8 -3
- package/dist/input-number/style/index.js +1 -5
- package/dist/listy/index.d.ts +1 -1
- package/dist/listy/index.js +9 -7
- package/dist/listy/interface.d.ts +29 -5
- package/dist/listy/style/index.js +5 -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 +6 -1
- 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/mentions/index.d.ts +2 -3
- package/dist/mentions/index.js +9 -4
- package/dist/mentions/style/index.js +1 -1
- package/dist/menu/MenuContext.d.ts +2 -0
- package/dist/menu/MenuItem.js +23 -6
- 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.js +2 -1
- package/dist/modal/ConfirmDialog.js +14 -7
- package/dist/modal/PurePanel.js +2 -2
- package/dist/modal/style/confirm.js +1 -1
- package/dist/notification/PurePanel.js +7 -12
- package/dist/notification/interface.d.ts +8 -0
- package/dist/notification/style/index.d.ts +3 -0
- package/dist/notification/style/index.js +4 -5
- 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.js +12 -4
- package/dist/pagination/useShowSizeChanger.d.ts +3 -0
- package/dist/pagination/useShowSizeChanger.js +1 -1
- package/dist/popconfirm/index.js +6 -5
- package/dist/popconfirm/style/index.js +1 -1
- package/dist/popover/index.js +1 -1
- package/dist/popover/style/index.js +2 -2
- package/dist/progress/Circle.js +0 -8
- package/dist/progress/Line.js +3 -10
- package/dist/progress/Steps.js +0 -8
- package/dist/progress/progress.js +3 -15
- package/dist/qrcode/QrcodeStatus.js +2 -1
- package/dist/qrcode/index.js +4 -4
- 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/result/index.js +3 -3
- package/dist/result/noFound.js +120 -140
- package/dist/result/serverError.js +132 -147
- package/dist/result/unauthorized.js +115 -129
- package/dist/segmented/index.js +1 -1
- package/dist/select/index.js +10 -3
- package/dist/select/style/dropdown.js +1 -1
- package/dist/select/style/index.js +2 -2
- package/dist/select/style/select-input-multiple.js +1 -1
- package/dist/select/useIcons.d.ts +6 -2
- package/dist/select/usePopupRender.js +4 -1
- package/dist/slider/index.d.ts +6 -4
- package/dist/slider/index.js +7 -5
- package/dist/space/Compact.d.ts +1 -1
- package/dist/space/Item.d.ts +1 -0
- package/dist/space/Item.js +6 -2
- package/dist/space/index.js +1 -0
- package/dist/spin/Indicator/index.js +5 -1
- package/dist/splitter/SplitBar.js +9 -3
- package/dist/splitter/Splitter.js +8 -2
- package/dist/splitter/interface.d.ts +6 -1
- package/dist/statistic/Statistic.d.ts +3 -0
- package/dist/statistic/Statistic.js +2 -1
- package/dist/steps/index.js +9 -7
- 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/index.js +8 -2
- package/dist/table/ExpandIcon.d.ts +9 -4
- package/dist/table/ExpandIcon.js +42 -20
- package/dist/table/InternalTable.js +41 -20
- package/dist/table/hooks/useLazyKVMap.js +1 -1
- package/dist/table/hooks/useSelection.js +54 -9
- package/dist/table/index.d.ts +2 -2
- package/dist/table/interface.d.ts +8 -0
- package/dist/table/style/index.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.js +3 -7
- package/dist/tag/hooks/useColor.d.ts +1 -1
- package/dist/time-picker/index.d.ts +10 -9
- package/dist/time-picker/index.js +54 -83
- package/dist/timeline/Timeline.js +1 -1
- package/dist/tooltip/style/index.js +1 -2
- package/dist/tour/panelRender.js +3 -2
- package/dist/transfer/Section.js +2 -1
- package/dist/transfer/Transfer.js +1 -1
- package/dist/tree/DirectoryTree.d.ts +19 -7
- package/dist/tree/Tree.d.ts +73 -58
- package/dist/tree/index.d.ts +8 -5
- package/dist/tree/index.js +4 -3
- package/dist/tree/style/index.js +1 -1
- package/dist/tree-select/index.js +14 -8
- 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.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/utils.js +8 -3
- package/dist/version/token-meta.json +1 -1
- package/dist/version/token.json +1 -1
- package/dist/watermark/index.js +1 -1
- package/package.json +24 -24
- package/web-tags.json +79 -15
- package/web-types.json +196 -24
- package/dist/_util/getAllowClear.d.ts +0 -6
- package/dist/_util/getAllowClear.js +0 -11
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import { TreeEmits, TreeProps as TreeProps$1, TreeSlots } from "./Tree.js";
|
|
2
|
-
import { SlotsType } from "vue";
|
|
2
|
+
import { EmitFn, PublicProps, SlotsType } from "vue";
|
|
3
3
|
import { BasicDataNode, DataNode } from "@v-c/tree";
|
|
4
4
|
//#region src/tree/DirectoryTree.d.ts
|
|
5
5
|
type ExpandAction = false | 'click' | 'doubleClick';
|
|
6
|
-
interface DirectoryTreeProps<T extends BasicDataNode = DataNode> extends TreeProps$1<T>, DirectoryTreeEmitsProps {
|
|
6
|
+
interface DirectoryTreeProps<T extends BasicDataNode = DataNode> extends TreeProps$1<T>, DirectoryTreeEmitsProps<T> {
|
|
7
7
|
expandAction?: ExpandAction;
|
|
8
8
|
}
|
|
9
|
-
interface DirectoryTreeEmits extends TreeEmits {}
|
|
10
|
-
type DirectoryTreeEmitsProps = { [K in keyof DirectoryTreeEmits as `on${Capitalize<string & K>}`]?: DirectoryTreeEmits[K]; };
|
|
9
|
+
interface DirectoryTreeEmits<T extends BasicDataNode = DataNode> extends TreeEmits<T> {}
|
|
10
|
+
type DirectoryTreeEmitsProps<T extends BasicDataNode = DataNode> = { [K in keyof DirectoryTreeEmits<T> as `on${Capitalize<string & K>}`]?: DirectoryTreeEmits<T>[K]; };
|
|
11
11
|
type DirectoryTreeEmitsType = DirectoryTreeEmitsProps;
|
|
12
|
-
interface DirectoryTreeSlots extends TreeSlots {}
|
|
13
|
-
|
|
12
|
+
interface DirectoryTreeSlots<T extends BasicDataNode = DataNode> extends TreeSlots<T> {}
|
|
13
|
+
interface DirectoryTreeInstance<T extends BasicDataNode = DataNode> {
|
|
14
|
+
$props: DirectoryTreeProps<T> & PublicProps;
|
|
15
|
+
$emit: EmitFn<DirectoryTreeEmits<T>>;
|
|
16
|
+
$slots: DirectoryTreeSlots<T>;
|
|
17
|
+
}
|
|
18
|
+
interface DirectoryTreeConstructor {
|
|
19
|
+
new <T extends BasicDataNode = DataNode>(props: DirectoryTreeProps<T>): DirectoryTreeInstance<T>;
|
|
20
|
+
/**
|
|
21
|
+
* Non-generic fallback signature, see `TreeConstructor` in `./Tree.tsx`.
|
|
22
|
+
*/
|
|
23
|
+
new (props: DirectoryTreeProps<any>): DirectoryTreeInstance<any>;
|
|
24
|
+
}
|
|
25
|
+
declare const DirectoryTree: import("vue").DefineSetupFnComponent<DirectoryTreeProps<BasicDataNode>, DirectoryTreeEmits<DataNode>, SlotsType<DirectoryTreeSlots<DataNode>>, DirectoryTreeProps<BasicDataNode>, PublicProps>;
|
|
14
26
|
//#endregion
|
|
15
|
-
export { DirectoryTreeEmits, DirectoryTreeEmitsProps, DirectoryTreeEmitsType, DirectoryTreeProps, DirectoryTreeSlots, ExpandAction, DirectoryTree as default };
|
|
27
|
+
export { DirectoryTreeConstructor, DirectoryTreeEmits, DirectoryTreeEmitsProps, DirectoryTreeEmitsType, DirectoryTreeProps, DirectoryTreeSlots, ExpandAction, DirectoryTree as default };
|
package/dist/tree/Tree.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VueNode } from "../_util/type.js";
|
|
2
2
|
import { SemanticClassNamesType, SemanticStylesType } from "../_util/hooks/useMergeSemantic.js";
|
|
3
3
|
import "../_util/hooks/index.js";
|
|
4
|
-
import { CSSProperties, SlotsType } from "vue";
|
|
4
|
+
import { CSSProperties, EmitFn, PublicProps, SlotsType } from "vue";
|
|
5
5
|
import { BasicDataNode, DataNode, TreeProps as TreeProps$1, TreeRef } from "@v-c/tree";
|
|
6
6
|
import { Key as Key$1 } from "@v-c/util/dist/type";
|
|
7
7
|
//#region src/tree/Tree.d.ts
|
|
@@ -101,7 +101,7 @@ interface TreeSemanticStyles {
|
|
|
101
101
|
}
|
|
102
102
|
type TreeClassNamesType = SemanticClassNamesType<TreeProps, TreeSemanticClassNames>;
|
|
103
103
|
type TreeStylesType = SemanticStylesType<TreeProps, TreeSemanticStyles>;
|
|
104
|
-
interface TreeProps<T extends BasicDataNode = DataNode> extends Omit<TreeProps$1<T>, 'prefixCls' | 'showLine' | 'direction' | 'draggable' | 'className' | 'icon' | 'switcherIcon' | 'classNames' | 'rootClassName' | 'rootStyle' | 'styles' | 'onCheck' | 'onClick' | 'onBlur' | 'onDrop' | 'onLoad' | 'onActiveChange' | 'onContextMenu' | 'onDoubleClick' | 'onExpand' | 'onKeyDown' | 'onDragEnd' | 'onDragOver' | 'onDragStart' | 'onDragLeave' | 'onDragEnter' | 'tabIndex' | 'onSelect' | 'onFocus' | 'onMouseEnter' | 'onMouseLeave' | 'onRightClick' | 'onScroll' | 'style'>, TreeEmitsProps {
|
|
104
|
+
interface TreeProps<T extends BasicDataNode = DataNode> extends Omit<TreeProps$1<T>, 'prefixCls' | 'showLine' | 'direction' | 'draggable' | 'className' | 'icon' | 'switcherIcon' | 'classNames' | 'rootClassName' | 'rootStyle' | 'styles' | 'onCheck' | 'onClick' | 'onBlur' | 'onDrop' | 'onLoad' | 'onActiveChange' | 'onContextMenu' | 'onDoubleClick' | 'onExpand' | 'onKeyDown' | 'onDragEnd' | 'onDragOver' | 'onDragStart' | 'onDragLeave' | 'onDragEnter' | 'tabIndex' | 'onSelect' | 'onFocus' | 'onMouseEnter' | 'onMouseLeave' | 'onRightClick' | 'onScroll' | 'style'>, TreeEmitsProps<T> {
|
|
105
105
|
rootClass?: string;
|
|
106
106
|
showLine?: boolean | {
|
|
107
107
|
showLeafIcon: boolean | TreeLeafIcon;
|
|
@@ -153,70 +153,85 @@ interface TreeProps<T extends BasicDataNode = DataNode> extends Omit<TreeProps$1
|
|
|
153
153
|
blockNode?: boolean;
|
|
154
154
|
tabindex?: number;
|
|
155
155
|
}
|
|
156
|
-
interface TreeEmits {
|
|
157
|
-
'click': NonNullable<TreeProps$1['onClick']>;
|
|
158
|
-
'check': NonNullable<TreeProps$1['onCheck']>;
|
|
159
|
-
'expand': NonNullable<TreeProps$1['onExpand']>;
|
|
160
|
-
'select': NonNullable<TreeProps$1['onSelect']>;
|
|
161
|
-
'blur': NonNullable<TreeProps$1['onBlur']>;
|
|
162
|
-
'focus': NonNullable<TreeProps$1['onFocus']>;
|
|
163
|
-
'rightClick': NonNullable<TreeProps$1['onRightClick']>;
|
|
164
|
-
'dblclick': NonNullable<TreeProps$1['onDoubleClick']>;
|
|
165
|
-
'doubleClick': NonNullable<TreeProps$1['onDoubleClick']>;
|
|
166
|
-
'contextmenu': NonNullable<TreeProps$1['onContextMenu']>;
|
|
167
|
-
'dragstart': NonNullable<TreeProps$1['onDragStart']>;
|
|
168
|
-
'dragenter': NonNullable<TreeProps$1['onDragEnter']>;
|
|
169
|
-
'dragover': NonNullable<TreeProps$1['onDragOver']>;
|
|
170
|
-
'dragleave': NonNullable<TreeProps$1['onDragLeave']>;
|
|
171
|
-
'drop': NonNullable<TreeProps$1['onDrop']>;
|
|
172
|
-
'dragend': NonNullable<TreeProps$1['onDragEnd']>;
|
|
173
|
-
'load': NonNullable<TreeProps$1['onLoad']>;
|
|
174
|
-
'mouseleave': NonNullable<TreeProps$1['onMouseLeave']>;
|
|
175
|
-
'mouseenter': NonNullable<TreeProps$1['onMouseEnter']>;
|
|
176
|
-
'scroll': NonNullable<TreeProps$1['onScroll']>;
|
|
177
|
-
'activeChange': NonNullable<TreeProps$1['onActiveChange']>;
|
|
178
|
-
'keydown': NonNullable<TreeProps$1['onKeyDown']>;
|
|
156
|
+
interface TreeEmits<T extends BasicDataNode = DataNode> {
|
|
157
|
+
'click': NonNullable<TreeProps$1<T>['onClick']>;
|
|
158
|
+
'check': NonNullable<TreeProps$1<T>['onCheck']>;
|
|
159
|
+
'expand': NonNullable<TreeProps$1<T>['onExpand']>;
|
|
160
|
+
'select': NonNullable<TreeProps$1<T>['onSelect']>;
|
|
161
|
+
'blur': NonNullable<TreeProps$1<T>['onBlur']>;
|
|
162
|
+
'focus': NonNullable<TreeProps$1<T>['onFocus']>;
|
|
163
|
+
'rightClick': NonNullable<TreeProps$1<T>['onRightClick']>;
|
|
164
|
+
'dblclick': NonNullable<TreeProps$1<T>['onDoubleClick']>;
|
|
165
|
+
'doubleClick': NonNullable<TreeProps$1<T>['onDoubleClick']>;
|
|
166
|
+
'contextmenu': NonNullable<TreeProps$1<T>['onContextMenu']>;
|
|
167
|
+
'dragstart': NonNullable<TreeProps$1<T>['onDragStart']>;
|
|
168
|
+
'dragenter': NonNullable<TreeProps$1<T>['onDragEnter']>;
|
|
169
|
+
'dragover': NonNullable<TreeProps$1<T>['onDragOver']>;
|
|
170
|
+
'dragleave': NonNullable<TreeProps$1<T>['onDragLeave']>;
|
|
171
|
+
'drop': NonNullable<TreeProps$1<T>['onDrop']>;
|
|
172
|
+
'dragend': NonNullable<TreeProps$1<T>['onDragEnd']>;
|
|
173
|
+
'load': NonNullable<TreeProps$1<T>['onLoad']>;
|
|
174
|
+
'mouseleave': NonNullable<TreeProps$1<T>['onMouseLeave']>;
|
|
175
|
+
'mouseenter': NonNullable<TreeProps$1<T>['onMouseEnter']>;
|
|
176
|
+
'scroll': NonNullable<TreeProps$1<T>['onScroll']>;
|
|
177
|
+
'activeChange': NonNullable<TreeProps$1<T>['onActiveChange']>;
|
|
178
|
+
'keydown': NonNullable<TreeProps$1<T>['onKeyDown']>;
|
|
179
179
|
'update:expandedKeys': (keys: Key$1[]) => void;
|
|
180
180
|
'update:checkedKeys': (keys: Key$1[]) => void;
|
|
181
181
|
'update:selectedKeys': (keys: Key$1[]) => void;
|
|
182
182
|
'update:activeKey': (key: Key$1) => void;
|
|
183
183
|
}
|
|
184
|
-
interface TreeEmitsProps {
|
|
185
|
-
onClick?: TreeEmits['click'];
|
|
186
|
-
onCheck?: TreeEmits['check'];
|
|
187
|
-
onExpand?: TreeEmits['expand'];
|
|
188
|
-
onSelect?: TreeEmits['select'];
|
|
189
|
-
onBlur?: TreeEmits['blur'];
|
|
190
|
-
onFocus?: TreeEmits['focus'];
|
|
191
|
-
onRightClick?: TreeEmits['rightClick'];
|
|
192
|
-
onDblclick?: TreeEmits['dblclick'];
|
|
193
|
-
onDoubleClick?: TreeEmits['doubleClick'];
|
|
194
|
-
onContextmenu?: TreeEmits['contextmenu'];
|
|
195
|
-
onDragstart?: TreeEmits['dragstart'];
|
|
196
|
-
onDragenter?: TreeEmits['dragenter'];
|
|
197
|
-
onDragover?: TreeEmits['dragover'];
|
|
198
|
-
onDragleave?: TreeEmits['dragleave'];
|
|
199
|
-
onDrop?: TreeEmits['drop'];
|
|
200
|
-
onDragend?: TreeEmits['dragend'];
|
|
201
|
-
onLoad?: TreeEmits['load'];
|
|
202
|
-
onMouseleave?: TreeEmits['mouseleave'];
|
|
203
|
-
onMouseenter?: TreeEmits['mouseenter'];
|
|
204
|
-
onScroll?: TreeEmits['scroll'];
|
|
205
|
-
onActiveChange?: TreeEmits['activeChange'];
|
|
206
|
-
onKeydown?: TreeEmits['keydown'];
|
|
207
|
-
'onUpdate:expandedKeys'?: TreeEmits['update:expandedKeys'];
|
|
208
|
-
'onUpdate:checkedKeys'?: TreeEmits['update:checkedKeys'];
|
|
209
|
-
'onUpdate:selectedKeys'?: TreeEmits['update:selectedKeys'];
|
|
210
|
-
'onUpdate:activeKey'?: TreeEmits['update:activeKey'];
|
|
211
|
-
}
|
|
212
|
-
interface TreeSlots {
|
|
184
|
+
interface TreeEmitsProps<T extends BasicDataNode = DataNode> {
|
|
185
|
+
onClick?: TreeEmits<T>['click'];
|
|
186
|
+
onCheck?: TreeEmits<T>['check'];
|
|
187
|
+
onExpand?: TreeEmits<T>['expand'];
|
|
188
|
+
onSelect?: TreeEmits<T>['select'];
|
|
189
|
+
onBlur?: TreeEmits<T>['blur'];
|
|
190
|
+
onFocus?: TreeEmits<T>['focus'];
|
|
191
|
+
onRightClick?: TreeEmits<T>['rightClick'];
|
|
192
|
+
onDblclick?: TreeEmits<T>['dblclick'];
|
|
193
|
+
onDoubleClick?: TreeEmits<T>['doubleClick'];
|
|
194
|
+
onContextmenu?: TreeEmits<T>['contextmenu'];
|
|
195
|
+
onDragstart?: TreeEmits<T>['dragstart'];
|
|
196
|
+
onDragenter?: TreeEmits<T>['dragenter'];
|
|
197
|
+
onDragover?: TreeEmits<T>['dragover'];
|
|
198
|
+
onDragleave?: TreeEmits<T>['dragleave'];
|
|
199
|
+
onDrop?: TreeEmits<T>['drop'];
|
|
200
|
+
onDragend?: TreeEmits<T>['dragend'];
|
|
201
|
+
onLoad?: TreeEmits<T>['load'];
|
|
202
|
+
onMouseleave?: TreeEmits<T>['mouseleave'];
|
|
203
|
+
onMouseenter?: TreeEmits<T>['mouseenter'];
|
|
204
|
+
onScroll?: TreeEmits<T>['scroll'];
|
|
205
|
+
onActiveChange?: TreeEmits<T>['activeChange'];
|
|
206
|
+
onKeydown?: TreeEmits<T>['keydown'];
|
|
207
|
+
'onUpdate:expandedKeys'?: TreeEmits<T>['update:expandedKeys'];
|
|
208
|
+
'onUpdate:checkedKeys'?: TreeEmits<T>['update:checkedKeys'];
|
|
209
|
+
'onUpdate:selectedKeys'?: TreeEmits<T>['update:selectedKeys'];
|
|
210
|
+
'onUpdate:activeKey'?: TreeEmits<T>['update:activeKey'];
|
|
211
|
+
}
|
|
212
|
+
interface TreeSlots<T extends BasicDataNode = DataNode> {
|
|
213
213
|
switcherLoadingIcon: () => any;
|
|
214
214
|
switcherIcon: (props: AntTreeNodeProps) => any;
|
|
215
215
|
default: () => any;
|
|
216
216
|
draggableIcon: () => any;
|
|
217
217
|
icon: (props: AntdTreeNodeAttribute) => any;
|
|
218
|
-
titleRender: TreeProps$1['titleRender'];
|
|
219
|
-
}
|
|
220
|
-
|
|
218
|
+
titleRender: TreeProps$1<T>['titleRender'];
|
|
219
|
+
}
|
|
220
|
+
interface TreeInstance<T extends BasicDataNode = DataNode> {
|
|
221
|
+
$props: TreeProps<T> & PublicProps;
|
|
222
|
+
$emit: EmitFn<TreeEmits<T>>;
|
|
223
|
+
$slots: TreeSlots<T>;
|
|
224
|
+
}
|
|
225
|
+
interface TreeConstructor {
|
|
226
|
+
new <T extends BasicDataNode = DataNode>(props: TreeProps<T>): TreeInstance<T>;
|
|
227
|
+
/**
|
|
228
|
+
* Non-generic fallback signature. TypeScript infers from the last overload,
|
|
229
|
+
* so this keeps render-function usage like `h(Tree, props)` resolvable
|
|
230
|
+
* against Vue's `Constructor<P>` overload of `h` (see #634), while the
|
|
231
|
+
* generic signature above still drives template/Volar inference.
|
|
232
|
+
*/
|
|
233
|
+
new (props: TreeProps<any>): TreeInstance<any>;
|
|
234
|
+
}
|
|
235
|
+
declare const Tree: import("vue").DefineSetupFnComponent<TreeProps<BasicDataNode>, TreeEmits<DataNode>, SlotsType<TreeSlots<DataNode>>, TreeProps<BasicDataNode>, PublicProps>;
|
|
221
236
|
//#endregion
|
|
222
|
-
export { AntTreeNode, AntTreeNodeBaseEvent, AntTreeNodeCheckedEvent, AntTreeNodeDragEnterEvent, AntTreeNodeDropEvent, AntTreeNodeExpandedEvent, AntTreeNodeMouseEvent, AntTreeNodeProps, AntTreeNodeSelectedEvent, AntdTreeNodeAttribute, SwitcherIcon, TreeClassNamesType, TreeEmits, TreeEmitsProps, TreeLeafIcon, TreeNodeNormal, TreeProps, type TreeRef, TreeSemanticClassNames, TreeSemanticName, TreeSemanticStyles, TreeSlots, TreeStylesType, Tree as default };
|
|
237
|
+
export { AntTreeNode, AntTreeNodeBaseEvent, AntTreeNodeCheckedEvent, AntTreeNodeDragEnterEvent, AntTreeNodeDropEvent, AntTreeNodeExpandedEvent, AntTreeNodeMouseEvent, AntTreeNodeProps, AntTreeNodeSelectedEvent, AntdTreeNodeAttribute, SwitcherIcon, TreeClassNamesType, TreeConstructor, TreeEmits, TreeEmitsProps, TreeLeafIcon, TreeNodeNormal, TreeProps, type TreeRef, TreeSemanticClassNames, TreeSemanticName, TreeSemanticStyles, TreeSlots, TreeStylesType, Tree as default };
|
package/dist/tree/index.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { AntTreeNode, AntTreeNodeCheckedEvent, AntTreeNodeExpandedEvent, AntTreeNodeMouseEvent, AntTreeNodeProps, AntTreeNodeSelectedEvent, AntdTreeNodeAttribute, TreeConstructor, TreeEmits, TreeProps, TreeSlots } from "./Tree.js";
|
|
2
|
+
import { DirectoryTreeConstructor, DirectoryTreeEmits, DirectoryTreeProps, DirectoryTreeSlots, ExpandAction } from "./DirectoryTree.js";
|
|
3
|
+
import { App } from "vue";
|
|
3
4
|
import { BasicDataNode, DataNode, EventDataNode, TreeInstance, TreeNode, UseTreeConfig, useTree } from "@v-c/tree";
|
|
4
5
|
//#region src/tree/index.d.ts
|
|
5
|
-
declare const
|
|
6
|
-
|
|
6
|
+
declare const DirectoryTree: DirectoryTreeConstructor;
|
|
7
|
+
declare const Tree: TreeConstructor & {
|
|
8
|
+
DirectoryTree: DirectoryTreeConstructor;
|
|
7
9
|
TreeNode: typeof TreeNode;
|
|
8
10
|
useTree: typeof useTree;
|
|
11
|
+
install: (app: App) => void;
|
|
9
12
|
};
|
|
10
13
|
//#endregion
|
|
11
|
-
export { type AntTreeNode, type AntTreeNodeCheckedEvent, type AntTreeNodeExpandedEvent, type AntTreeNodeMouseEvent, type AntTreeNodeProps, type AntTreeNodeSelectedEvent, type AntdTreeNodeAttribute, type BasicDataNode, type DataNode, DirectoryTree, type DirectoryTreeEmits, type ExpandAction as DirectoryTreeExpandAction, type DirectoryTreeProps, type DirectoryTreeSlots, type EventDataNode, type TreeEmits, type TreeInstance, type TreeProps, type TreeSlots, type UseTreeConfig, Tree as default, useTree };
|
|
14
|
+
export { type AntTreeNode, type AntTreeNodeCheckedEvent, type AntTreeNodeExpandedEvent, type AntTreeNodeMouseEvent, type AntTreeNodeProps, type AntTreeNodeSelectedEvent, type AntdTreeNodeAttribute, type BasicDataNode, type DataNode, DirectoryTree, type DirectoryTreeConstructor, type DirectoryTreeEmits, type ExpandAction as DirectoryTreeExpandAction, type DirectoryTreeProps, type DirectoryTreeSlots, type EventDataNode, type TreeConstructor, type TreeEmits, type TreeInstance, type TreeProps, type TreeSlots, type UseTreeConfig, Tree as default, useTree };
|
package/dist/tree/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import Tree$1 from "./Tree.js";
|
|
2
|
-
import DirectoryTree from "./DirectoryTree.js";
|
|
2
|
+
import DirectoryTree$1 from "./DirectoryTree.js";
|
|
3
3
|
import { TreeNode, useTree } from "@v-c/tree";
|
|
4
4
|
//#region src/tree/index.tsx
|
|
5
|
+
const DirectoryTree = DirectoryTree$1;
|
|
5
6
|
const Tree = Tree$1;
|
|
6
7
|
Tree.DirectoryTree = DirectoryTree;
|
|
7
8
|
Tree.TreeNode = TreeNode;
|
|
8
9
|
Tree.useTree = useTree;
|
|
9
10
|
Tree.install = (app) => {
|
|
10
|
-
app.component(Tree.name, Tree);
|
|
11
|
-
app.component(DirectoryTree.name, DirectoryTree);
|
|
11
|
+
app.component(Tree$1.name, Tree$1);
|
|
12
|
+
app.component(DirectoryTree$1.name, DirectoryTree$1);
|
|
12
13
|
app.component("ATreeOption", TreeNode);
|
|
13
14
|
};
|
|
14
15
|
//#endregion
|
package/dist/tree/style/index.js
CHANGED
|
@@ -43,7 +43,7 @@ function genBaseStyle(prefixCls, token) {
|
|
|
43
43
|
const { treeCls, treeNodeCls, treeNodePadding, titleHeight, indentSize, switcherSize, motionDurationMid, nodeSelectedBg, nodeHoverBg, colorTextQuaternary, controlItemBgActiveDisabled } = token;
|
|
44
44
|
return { [treeCls]: {
|
|
45
45
|
...resetComponent(token),
|
|
46
|
-
["--
|
|
46
|
+
["--vc-virtual-list-scrollbar-bg"]: token.colorSplit,
|
|
47
47
|
background: token.colorBgContainer,
|
|
48
48
|
borderRadius: token.borderRadius,
|
|
49
49
|
transition: `background-color ${token.motionDurationSlow}`,
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
2
|
+
import { useFormItemInputContext } from "../form/context.js";
|
|
2
3
|
import { useComponentBaseConfig, useConfig } from "../config-provider/context.js";
|
|
3
4
|
import { useSize } from "../config-provider/hooks/useSize.js";
|
|
4
5
|
import useToken from "../theme/useToken.js";
|
|
5
6
|
import { useCompactItemContext } from "../space/Compact.js";
|
|
6
|
-
import { getAttrStyleAndClass, useMergeSemantic, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
7
|
+
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
7
8
|
import { useZIndex } from "../_util/hooks/useZIndex.js";
|
|
8
9
|
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
9
10
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
10
11
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
12
|
+
import { useLocaleGetter } from "../locale/useLocale.js";
|
|
11
13
|
import genPurePanel from "../_util/PurePanel.js";
|
|
12
14
|
import { getMergedStatus, getStatusClassNames } from "../_util/statusUtils.js";
|
|
13
15
|
import { DefaultRenderEmpty } from "../config-provider/defaultRenderEmpty.js";
|
|
14
|
-
import { useFormItemInputContext } from "../form/context.js";
|
|
15
16
|
import useVariant from "../form/hooks/useVariant.js";
|
|
16
17
|
import mergedBuiltinPlacements from "../select/mergedBuiltinPlacements.js";
|
|
17
18
|
import style_default from "../select/style/index.js";
|
|
@@ -71,7 +72,8 @@ const omitKeys = [
|
|
|
71
72
|
"classes"
|
|
72
73
|
];
|
|
73
74
|
const InternalTreeSelect = /* @__PURE__ */ defineComponent((props, { slots, expose, emit, attrs }) => {
|
|
74
|
-
const { prefixCls: treeSelectPrefixCls, getPopupContainer: getContextPopupContainer, direction, styles: contextStyles, classes: contextClassNames, switcherIcon, virtual, getPrefixCls, rootPrefixCls } = useComponentBaseConfig("treeSelect", props, ["switcherIcon"], "tree-select");
|
|
75
|
+
const { prefixCls: treeSelectPrefixCls, getPopupContainer: getContextPopupContainer, direction, class: contextClassName, style: contextStyle, styles: contextStyles, classes: contextClassNames, switcherIcon, virtual, getPrefixCls, rootPrefixCls } = useComponentBaseConfig("treeSelect", props, ["switcherIcon"], "tree-select");
|
|
76
|
+
const getGlobalLocale = useLocaleGetter("global");
|
|
75
77
|
const configCtx = useConfig();
|
|
76
78
|
const { prefixCls: customizePrefixCls, variant: customVariant, size: customizeSize, disabled: customDisabled, status: customStatus, classes, styles } = toPropsRefs(props, "prefixCls", "variant", "size", "disabled", "status", "classes", "styles");
|
|
77
79
|
const bordered = computed(() => props?.bordered ?? true);
|
|
@@ -114,7 +116,8 @@ const InternalTreeSelect = /* @__PURE__ */ defineComponent((props, { slots, expo
|
|
|
114
116
|
status: mergedStatus.value,
|
|
115
117
|
variant: variant.value
|
|
116
118
|
}));
|
|
117
|
-
const
|
|
119
|
+
const contextStyleRoot = useSemanticRootStyle(contextStyle);
|
|
120
|
+
const [mergedClassNames, mergedStyles] = useMergeSemantic(useToArr(contextClassNames, classes), useToArr(contextStyles, contextStyleRoot, styles), useToProps(mergedProps), computed(() => {
|
|
118
121
|
return { popup: { _default: "root" } };
|
|
119
122
|
}));
|
|
120
123
|
const mergedOnOpenChange = (open) => {
|
|
@@ -142,7 +145,7 @@ const InternalTreeSelect = /* @__PURE__ */ defineComponent((props, { slots, expo
|
|
|
142
145
|
const { popupClassName, dropdownClassName, rootClass, popupRender, dropdownRender, popupMatchSelectWidth, dropdownMatchSelectWidth, treeCheckable, multiple, allowClear, treeLine, listHeight, builtinPlacements, switcherIcon: customSwitcherIcon, treeIcon, getPopupContainer, choiceTransitionName, transitionName, treeExpandAction, showCheckedStrategy, treeCheckStrictly } = props;
|
|
143
146
|
const restProps = omit(props, omitKeys);
|
|
144
147
|
const treeTitleRender = slots?.treeTitleRender ?? props.treeTitleRender;
|
|
145
|
-
const mergedPopupClassName = clsx(popupClassName || dropdownClassName, `${treeSelectPrefixCls.value}-dropdown`, { [`${treeSelectPrefixCls.value}-dropdown-rtl`]: direction.value === "rtl" }, rootClass, mergedClassNames.value.
|
|
148
|
+
const mergedPopupClassName = clsx(popupClassName || dropdownClassName, `${treeSelectPrefixCls.value}-dropdown`, { [`${treeSelectPrefixCls.value}-dropdown-rtl`]: direction.value === "rtl" }, rootClass, mergedClassNames.value.popup?.root, cssVarCls.value, rootCls.value, treeSelectRootCls.value, hashId.value);
|
|
146
149
|
const { style, className, restAttrs } = getAttrStyleAndClass(attrs);
|
|
147
150
|
const mergedPopupRender = usePopupRender(popupRender || dropdownRender);
|
|
148
151
|
const customSuffixIcon = getSlotPropsFnRun(slots, props, "suffixIcon", false);
|
|
@@ -160,7 +163,11 @@ const InternalTreeSelect = /* @__PURE__ */ defineComponent((props, { slots, expo
|
|
|
160
163
|
prefixCls: prefixCls.value,
|
|
161
164
|
componentName: "TreeSelect"
|
|
162
165
|
});
|
|
163
|
-
const mergedAllowClear = allowClear
|
|
166
|
+
const mergedAllowClear = allowClear ? {
|
|
167
|
+
clearIcon,
|
|
168
|
+
label: getGlobalLocale().clear,
|
|
169
|
+
...typeof allowClear === "object" ? allowClear : {}
|
|
170
|
+
} : allowClear;
|
|
164
171
|
const notFoundContent = getSlotPropsFnRun(slots, props, "notFoundContent", false);
|
|
165
172
|
let mergedNotFound;
|
|
166
173
|
if (notFoundContent !== void 0) mergedNotFound = notFoundContent;
|
|
@@ -211,7 +218,7 @@ const InternalTreeSelect = /* @__PURE__ */ defineComponent((props, { slots, expo
|
|
|
211
218
|
[`${prefixCls.value}-rtl`]: direction.value === "rtl",
|
|
212
219
|
[`${prefixCls.value}-${variant.value}`]: enableVariantCls.value,
|
|
213
220
|
[`${prefixCls.value}-in-form-item`]: isFormItemInput
|
|
214
|
-
}, getStatusClassNames(prefixCls.value, mergedStatus.value, hasFeedback), compactItemClassnames.value, className, rootClass, mergedClassNames?.value?.root, cssVarCls.value, rootCls.value, treeSelectRootCls.value, hashId.value);
|
|
221
|
+
}, getStatusClassNames(prefixCls.value, mergedStatus.value, hasFeedback), compactItemClassnames.value, contextClassName.value, className, rootClass, mergedClassNames?.value?.root, cssVarCls.value, rootCls.value, treeSelectRootCls.value, hashId.value);
|
|
215
222
|
const mergedSwitcherIcon = slots?.switcherIcon ?? customSwitcherIcon ?? switcherIcon.value;
|
|
216
223
|
const renderSwitcherIcon = (nodeProps) => createVNode(SwitcherIconCom, {
|
|
217
224
|
"prefixCls": treePrefixCls.value,
|
|
@@ -252,7 +259,6 @@ const InternalTreeSelect = /* @__PURE__ */ defineComponent((props, { slots, expo
|
|
|
252
259
|
"treeMotion": null,
|
|
253
260
|
"popupClassName": mergedPopupClassName,
|
|
254
261
|
"popupStyle": {
|
|
255
|
-
...mergedStyles.value.root,
|
|
256
262
|
...mergedStyles.value.popup?.root,
|
|
257
263
|
zIndex: zIndex.value
|
|
258
264
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useComponentBaseConfig } from "../../config-provider/context.js";
|
|
2
|
+
import { genCssVar } from "../../theme/util/genStyleUtils.js";
|
|
2
3
|
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../../_util/hooks/useMergeSemantic.js";
|
|
3
4
|
import { toPropsRefs as toPropsRefs$1 } from "../../_util/tools.js";
|
|
4
5
|
import InternalTooltip from "../../tooltip/index.js";
|
|
@@ -22,6 +23,8 @@ import useDelayState from "@v-c/util/dist/hooks/useDelayState";
|
|
|
22
23
|
import ResizeObserver from "@v-c/resize-observer";
|
|
23
24
|
//#region src/typography/Base/index.tsx
|
|
24
25
|
const ELLIPSIS_STR = "...";
|
|
26
|
+
const DEFAULT_SHIMMER_DURATION = 1;
|
|
27
|
+
const DEFAULT_SHIMMER_CONFIG = { duration: DEFAULT_SHIMMER_DURATION };
|
|
25
28
|
const DECORATION_PROPS = [
|
|
26
29
|
"delete",
|
|
27
30
|
"mark",
|
|
@@ -54,7 +57,7 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
54
57
|
return val;
|
|
55
58
|
});
|
|
56
59
|
const editIconRef = shallowRef();
|
|
57
|
-
const { prefixCls, direction: contextDirection, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles } = useComponentBaseConfig("typography", props);
|
|
60
|
+
const { prefixCls, rootPrefixCls, direction: contextDirection, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles } = useComponentBaseConfig("typography", props);
|
|
58
61
|
const mergedDirection = computed(() => props.direction ?? contextDirection.value);
|
|
59
62
|
const { classes, styles } = toPropsRefs$1(props, "classes", "styles");
|
|
60
63
|
const mergedProps = computed(() => {
|
|
@@ -97,6 +100,7 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
97
100
|
triggerEdit(false);
|
|
98
101
|
};
|
|
99
102
|
const [enableCopy, copyConfig] = useMergedConfig(computed(() => props.copyable));
|
|
103
|
+
const [enableShimmer, shimmerConfig] = useMergedConfig(computed(() => props.shimmer), DEFAULT_SHIMMER_CONFIG);
|
|
100
104
|
const childrenNodes = shallowRef([]);
|
|
101
105
|
const { copied, copyLoading, onClick: onCopyClick } = useCopyClick({
|
|
102
106
|
copyConfig,
|
|
@@ -240,7 +244,7 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
240
244
|
"aria-label": ariaLabel,
|
|
241
245
|
"tabindex": tabIndex,
|
|
242
246
|
"style": mergedStyles.value.action
|
|
243
|
-
}, [icon || createVNode(EditOutlined,
|
|
247
|
+
}, [icon || createVNode(EditOutlined, null, null)])] }) : null;
|
|
244
248
|
};
|
|
245
249
|
const renderCopy = () => {
|
|
246
250
|
if (!enableCopy.value) return null;
|
|
@@ -281,6 +285,7 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
281
285
|
const componentCls = computed(() => classNames({
|
|
282
286
|
[`${prefixCls.value}-${props.type}`]: props.type,
|
|
283
287
|
[`${prefixCls.value}-disabled`]: props.disabled,
|
|
288
|
+
[`${prefixCls.value}-shimmer`]: enableShimmer.value && !props.disabled,
|
|
284
289
|
[`${prefixCls.value}-ellipsis`]: enableEllipsis.value,
|
|
285
290
|
[`${prefixCls.value}-ellipsis-single-line`]: cssTextOverflow.value,
|
|
286
291
|
[`${prefixCls.value}-ellipsis-multiple-line`]: cssLineClamp.value,
|
|
@@ -296,6 +301,15 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
296
301
|
};
|
|
297
302
|
const mergedClassName = classNames(componentCls.value, attrClass);
|
|
298
303
|
const mergedStyle = [
|
|
304
|
+
enableShimmer.value ? (() => {
|
|
305
|
+
const [varName] = genCssVar(rootPrefixCls.value, "typography");
|
|
306
|
+
const duration = shimmerConfig.value?.duration;
|
|
307
|
+
const [motionTime = DEFAULT_SHIMMER_DURATION, waitTime = 1] = Array.isArray(duration) ? duration : [duration];
|
|
308
|
+
return {
|
|
309
|
+
[varName("shimmer-motion-time")]: motionTime,
|
|
310
|
+
[varName("shimmer-wait-time")]: waitTime
|
|
311
|
+
};
|
|
312
|
+
})() : null,
|
|
299
313
|
mergedStyles.value.root,
|
|
300
314
|
cssLineClamp.value ? { WebkitLineClamp: rows.value } : null,
|
|
301
315
|
attrStyle
|
|
@@ -337,6 +351,8 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
337
351
|
"onClick": clickHandler,
|
|
338
352
|
"title": props.title,
|
|
339
353
|
"aria-label": topAriaLabel.value,
|
|
354
|
+
"aria-busy": enableShimmer.value ? !props.disabled : void 0,
|
|
355
|
+
"aria-disabled": enableShimmer.value && props.disabled ? true : void 0,
|
|
340
356
|
"rootClass": props.rootClass
|
|
341
357
|
}, restAttrs), { default: () => [createVNode(Ellipsis, mergeProps({
|
|
342
358
|
"enableMeasure": mergedEnableEllipsis.value && !cssEllipsis.value,
|
|
@@ -396,6 +412,11 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
396
412
|
required: false,
|
|
397
413
|
default: void 0
|
|
398
414
|
},
|
|
415
|
+
shimmer: {
|
|
416
|
+
type: [Boolean, Object],
|
|
417
|
+
required: false,
|
|
418
|
+
default: void 0
|
|
419
|
+
},
|
|
399
420
|
actions: {
|
|
400
421
|
type: Object,
|
|
401
422
|
required: false
|
package/dist/typography/Link.js
CHANGED
|
@@ -76,6 +76,11 @@ const Link = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
76
76
|
required: false,
|
|
77
77
|
default: void 0
|
|
78
78
|
},
|
|
79
|
+
shimmer: {
|
|
80
|
+
type: [Boolean, Object],
|
|
81
|
+
required: false,
|
|
82
|
+
default: void 0
|
|
83
|
+
},
|
|
79
84
|
actions: {
|
|
80
85
|
type: Object,
|
|
81
86
|
required: false
|
|
@@ -57,6 +57,11 @@ const Paragraph = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }
|
|
|
57
57
|
required: false,
|
|
58
58
|
default: void 0
|
|
59
59
|
},
|
|
60
|
+
shimmer: {
|
|
61
|
+
type: [Boolean, Object],
|
|
62
|
+
required: false,
|
|
63
|
+
default: void 0
|
|
64
|
+
},
|
|
60
65
|
actions: {
|
|
61
66
|
type: Object,
|
|
62
67
|
required: false
|
package/dist/typography/Text.js
CHANGED
|
@@ -73,6 +73,11 @@ const Text = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
73
73
|
required: false,
|
|
74
74
|
default: void 0
|
|
75
75
|
},
|
|
76
|
+
shimmer: {
|
|
77
|
+
type: [Boolean, Object],
|
|
78
|
+
required: false,
|
|
79
|
+
default: void 0
|
|
80
|
+
},
|
|
76
81
|
actions: {
|
|
77
82
|
type: Object,
|
|
78
83
|
required: false
|
package/dist/typography/Title.js
CHANGED
|
@@ -77,6 +77,11 @@ const Title = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
77
77
|
required: false,
|
|
78
78
|
default: void 0
|
|
79
79
|
},
|
|
80
|
+
shimmer: {
|
|
81
|
+
type: [Boolean, Object],
|
|
82
|
+
required: false,
|
|
83
|
+
default: void 0
|
|
84
|
+
},
|
|
80
85
|
actions: {
|
|
81
86
|
type: Object,
|
|
82
87
|
required: false
|
|
@@ -5,7 +5,7 @@ function useMergedConfig(propConfig, templateConfig) {
|
|
|
5
5
|
return [support, computed(() => {
|
|
6
6
|
const current = unref(propConfig);
|
|
7
7
|
return {
|
|
8
|
-
...templateConfig,
|
|
8
|
+
...support.value ? templateConfig : null,
|
|
9
9
|
...support.value && typeof current === "object" ? current : null
|
|
10
10
|
};
|
|
11
11
|
})];
|
|
@@ -63,6 +63,9 @@ interface TypographySemanticStyles {
|
|
|
63
63
|
}
|
|
64
64
|
type TypographyClassNamesType = SemanticClassNamesType<BlockProps, TypographySemanticClassNames>;
|
|
65
65
|
type TypographyStylesType = SemanticStylesType<BlockProps, TypographySemanticStyles>;
|
|
66
|
+
interface ShimmerConfig {
|
|
67
|
+
duration?: number | [motionTime: number, waitTime: number];
|
|
68
|
+
}
|
|
66
69
|
interface BlockProps extends ComponentBaseProps {
|
|
67
70
|
title?: string;
|
|
68
71
|
editable?: boolean | EditConfig;
|
|
@@ -70,6 +73,10 @@ interface BlockProps extends ComponentBaseProps {
|
|
|
70
73
|
type?: BaseType;
|
|
71
74
|
disabled?: boolean;
|
|
72
75
|
ellipsis?: boolean | EllipsisConfig;
|
|
76
|
+
/**
|
|
77
|
+
* @since 1.7.0
|
|
78
|
+
*/
|
|
79
|
+
shimmer?: boolean | ShimmerConfig;
|
|
73
80
|
/**
|
|
74
81
|
* @since 1.3.0
|
|
75
82
|
*/
|
|
@@ -110,4 +117,4 @@ interface TypographyBaseProps extends ComponentBaseProps {
|
|
|
110
117
|
title?: string;
|
|
111
118
|
}
|
|
112
119
|
//#endregion
|
|
113
|
-
export { ActionsConfig, BaseType, BlockProps, CopyConfig, EditConfig, EllipsisConfig, TypographyBaseEmits, TypographyBaseProps, TypographyClassNamesType, TypographySemanticClassNames, TypographySemanticStyles, TypographySlots, TypographyStylesType };
|
|
120
|
+
export { ActionsConfig, BaseType, BlockProps, CopyConfig, EditConfig, EllipsisConfig, ShimmerConfig, TypographyBaseEmits, TypographyBaseProps, TypographyClassNamesType, TypographySemanticClassNames, TypographySemanticStyles, TypographySlots, TypographyStylesType };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { operationUnit } from "../../style/index.js";
|
|
2
2
|
import { genStyleHooks } from "../../theme/util/genStyleUtils.js";
|
|
3
|
-
import { getCopyableStyles, getEditableStyles, getEllipsisStyles, getLinkStyles, getResetStyles, getTitleStyles } from "./mixins.js";
|
|
3
|
+
import { getCopyableStyles, getEditableStyles, getEllipsisStyles, getLinkStyles, getResetStyles, getShimmerStyles, getTitleStyles } from "./mixins.js";
|
|
4
4
|
//#region src/typography/style/index.ts
|
|
5
5
|
const genTypographyStyle = (token) => {
|
|
6
6
|
const { componentCls, titleMarginTop } = token;
|
|
@@ -64,6 +64,7 @@ const genTypographyStyle = (token) => {
|
|
|
64
64
|
...getEditableStyles(token),
|
|
65
65
|
...getCopyableStyles(token),
|
|
66
66
|
...getEllipsisStyles(),
|
|
67
|
+
[`&${componentCls}-shimmer`]: getShimmerStyles(token),
|
|
67
68
|
"&-rtl": { direction: "rtl" }
|
|
68
69
|
} };
|
|
69
70
|
};
|
|
@@ -9,5 +9,6 @@ declare const getResetStyles: GenerateStyle<TypographyToken, CSSObject>;
|
|
|
9
9
|
declare const getEditableStyles: GenerateStyle<TypographyToken, CSSObject>;
|
|
10
10
|
declare const getCopyableStyles: GenerateStyle<TypographyToken, CSSObject>;
|
|
11
11
|
declare function getEllipsisStyles(): CSSObject;
|
|
12
|
+
declare function getShimmerStyles(token: TypographyToken): CSSObject;
|
|
12
13
|
//#endregion
|
|
13
|
-
export { getCopyableStyles, getEditableStyles, getEllipsisStyles, getLinkStyles, getResetStyles, getTitleStyles };
|
|
14
|
+
export { getCopyableStyles, getEditableStyles, getEllipsisStyles, getLinkStyles, getResetStyles, getShimmerStyles, getTitleStyles };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { operationUnit } from "../../style/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { genCssVar } from "../../theme/util/genStyleUtils.js";
|
|
3
|
+
import { Keyframes, unit } from "@antdv-next/cssinjs";
|
|
3
4
|
import { gold } from "@ant-design/colors";
|
|
4
5
|
//#region src/typography/style/mixins.ts
|
|
5
6
|
function getTitleStyle(fontSize, lineHeight, color, token) {
|
|
@@ -172,7 +173,7 @@ const getEditableStyles = (token) => {
|
|
|
172
173
|
insetInlineEnd: token.calc(token.marginXS).add(2).equal(),
|
|
173
174
|
insetBlockEnd: token.marginXS,
|
|
174
175
|
color: token.colorIcon,
|
|
175
|
-
fontWeight:
|
|
176
|
+
fontWeight: 400,
|
|
176
177
|
fontSize: token.fontSize,
|
|
177
178
|
fontStyle: "normal",
|
|
178
179
|
pointerEvents: "none"
|
|
@@ -227,5 +228,27 @@ function getEllipsisStyles() {
|
|
|
227
228
|
}
|
|
228
229
|
};
|
|
229
230
|
}
|
|
231
|
+
function getShimmerStyles(token) {
|
|
232
|
+
const [, varRef] = genCssVar(token.antCls, "typography");
|
|
233
|
+
const motionTime = varRef("shimmer-motion-time", "1");
|
|
234
|
+
const waitTime = varRef("shimmer-wait-time", "1");
|
|
235
|
+
const shimmerAnimation = new Keyframes("antTypographyShimmer", {
|
|
236
|
+
"0%": { backgroundPosition: "-66.6667% 100%, 0 0" },
|
|
237
|
+
"100%": { backgroundPosition: `calc(166.6667% + 233.3334% * ${waitTime} / ${motionTime}) 100%, 0 0` }
|
|
238
|
+
});
|
|
239
|
+
return {
|
|
240
|
+
backgroundClip: "text, text",
|
|
241
|
+
WebkitBackgroundClip: "text, text",
|
|
242
|
+
WebkitTextFillColor: "transparent",
|
|
243
|
+
backgroundImage: ["linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), white, rgba(255, 255, 255, 0.8), transparent)", "linear-gradient(currentColor, currentColor)"].join(", "),
|
|
244
|
+
backgroundSize: "40% 100%, 100% 100%",
|
|
245
|
+
backgroundRepeat: "no-repeat",
|
|
246
|
+
animationName: shimmerAnimation,
|
|
247
|
+
animationDuration: `calc((${motionTime} + ${waitTime}) * 1s)`,
|
|
248
|
+
animationIterationCount: "infinite",
|
|
249
|
+
animationTimingFunction: "linear",
|
|
250
|
+
animationFillMode: "forwards"
|
|
251
|
+
};
|
|
252
|
+
}
|
|
230
253
|
//#endregion
|
|
231
|
-
export { getCopyableStyles, getEditableStyles, getEllipsisStyles, getLinkStyles, getResetStyles, getTitleStyles };
|
|
254
|
+
export { getCopyableStyles, getEditableStyles, getEllipsisStyles, getLinkStyles, getResetStyles, getShimmerStyles, getTitleStyles };
|
package/dist/upload/Upload.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ interface InternalUploadProps extends UploadProps$1, UploadEmitsProps {}
|
|
|
21
21
|
interface UploadEmitsProps {
|
|
22
22
|
onChange?: UploadEmits['change'];
|
|
23
23
|
onDrop?: UploadEmits['drop'];
|
|
24
|
+
onFocus?: UploadEmits['focus'];
|
|
24
25
|
'onUpdate:fileList'?: UploadEmits['update:fileList'];
|
|
25
26
|
}
|
|
26
27
|
declare const InternalUpload: import("vue").DefineSetupFnComponent<InternalUploadProps, UploadEmits<any>, SlotsType<UploadSlots<any>>, InternalUploadProps, import("vue").PublicProps>;
|
package/dist/upload/Upload.js
CHANGED
|
@@ -284,6 +284,9 @@ const InternalUpload = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
284
284
|
delete rcUploadProps.className;
|
|
285
285
|
delete rcUploadProps.style;
|
|
286
286
|
if (!hasChildren || mergedDisabled.value) delete rcUploadProps.id;
|
|
287
|
+
const onFocus = (e) => {
|
|
288
|
+
emit("focus", e);
|
|
289
|
+
};
|
|
287
290
|
const mergedRootCls = clsx(`${prefixCls.value}-wrapper`, contextClassName.value, mergedClassNames.value.root, rootClass.value, cssVarCls.value, rootCls.value, hashId.value, {
|
|
288
291
|
[`${prefixCls.value}-rtl`]: direction.value === "rtl",
|
|
289
292
|
[`${prefixCls.value}-picture-card-wrapper`]: listType.value === "picture-card",
|
|
@@ -300,7 +303,8 @@ const InternalUpload = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
300
303
|
return createVNode("span", mergeProps(restAttrs, {
|
|
301
304
|
"class": mergedRootCls,
|
|
302
305
|
"ref": wrapRef,
|
|
303
|
-
"style": mergedRootStyle
|
|
306
|
+
"style": mergedRootStyle,
|
|
307
|
+
"onFocusin": onFocus
|
|
304
308
|
}), [createVNode("div", {
|
|
305
309
|
"class": dragCls,
|
|
306
310
|
"style": mergedStyles.value.trigger,
|
|
@@ -322,12 +326,14 @@ const InternalUpload = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
322
326
|
if (listType.value === "picture-card" || listType.value === "picture-circle") return createVNode("span", mergeProps(restAttrs, {
|
|
323
327
|
"class": mergedRootCls,
|
|
324
328
|
"ref": wrapRef,
|
|
325
|
-
"style": mergedRootStyle
|
|
329
|
+
"style": mergedRootStyle,
|
|
330
|
+
"onFocusin": onFocus
|
|
326
331
|
}), [renderUploadList(uploadButton, hasChildren)]);
|
|
327
332
|
return createVNode("span", mergeProps(restAttrs, {
|
|
328
333
|
"class": mergedRootCls,
|
|
329
334
|
"ref": wrapRef,
|
|
330
|
-
"style": mergedRootStyle
|
|
335
|
+
"style": mergedRootStyle,
|
|
336
|
+
"onFocusin": onFocus
|
|
331
337
|
}), [uploadButton, renderUploadList()]);
|
|
332
338
|
};
|
|
333
339
|
}, {
|
|
@@ -504,6 +510,7 @@ const InternalUpload = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
504
510
|
emits: [
|
|
505
511
|
"change",
|
|
506
512
|
"drop",
|
|
513
|
+
"focus",
|
|
507
514
|
"update:fileList"
|
|
508
515
|
],
|
|
509
516
|
name: "AUpload",
|