@unicom-cloud/ui 0.8.99 → 0.8.101
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/Anchor.js +3 -1
- package/Badge.js +7 -6
- package/Copy.js +49 -2
- package/Details.js +13 -2
- package/Divider.js +3 -2
- package/Flex.js +22 -0
- package/Grid.js +1 -1
- package/LiquidFill.js +3 -2
- package/Loading.js +16 -3
- package/Marquee.js +3 -2
- package/QrCode.js +3 -2
- package/Space.js +3 -3
- package/Splitter.js +5 -5
- package/SuspenseFallbackTest.js +2 -4
- package/Tag.js +3 -2
- package/Tour.js +3 -2
- package/alert/index.js +61 -64
- package/anchor/index.js +5 -3
- package/back-top/index.js +32 -33
- package/badge/index.js +19 -18
- package/calendar/index.js +85 -84
- package/components/common/development/index.js +44 -29
- package/components/common/empty/index.js +35 -23
- package/components/common/flex/index.js +64 -0
- package/components/common/flex/interface.js +9 -0
- package/components/common/higher-order/with-speech-synthesis/index.js +79 -55
- package/components/common/space/index.js +71 -91
- package/components/common/suspense-fallback-test/index.js +16 -0
- package/components/common/utils/toArray.js +12 -0
- package/copy/index.js +83 -35
- package/details/index.js +102 -62
- package/divider/index.js +27 -21
- package/empty/index.js +13 -13
- package/flex/index.js +47 -0
- package/flex/interface.js +1 -0
- package/grid/{GridItem.js → Item.js} +15 -15
- package/grid/index.js +1 -1
- package/icon/interface.js +1 -0
- package/icon-hover/interface.js +1 -0
- package/index.js +610 -599
- package/input/Button.js +39 -34
- package/input/Textarea.js +108 -104
- package/liquid-fill/index.js +3 -2
- package/loading/index.js +72 -53
- package/loading/interface.js +1 -0
- package/marquee/index.js +3 -2
- package/modal/Modal.js +73 -74
- package/package.json +1 -1
- package/portal/interface.js +1 -0
- package/qr-code/index.js +3 -2
- package/segmented/index.js +113 -105
- package/space/index.js +41 -35
- package/speech-synthesis/interface.js +1 -0
- package/spin/index.js +75 -62
- package/splitter/Panel.js +39 -0
- package/splitter/SplitBar.js +157 -0
- package/splitter/Splitter.js +135 -0
- package/splitter/hooks/useEvent.js +12 -0
- package/splitter/hooks/useItems.js +26 -0
- package/splitter/hooks/useResizable.js +26 -0
- package/splitter/hooks/useResize.js +68 -0
- package/splitter/hooks/useSizes.js +60 -0
- package/splitter/index.js +6 -115
- package/style.css +1 -1
- package/suspense-fallback-test/index.js +2 -11
- package/suspense-fallback-test/interface.js +1 -0
- package/table/Table.js +38 -38
- package/table/hook/useThResizable.js +72 -26
- package/table/tbody/Td.js +80 -77
- package/table/th-resizable/index.js +92 -35
- package/tag/index.js +42 -41
- package/tooltip/index.js +89 -82
- package/tour/index.js +5 -6
- package/trigger/index.js +67 -70
- package/types/common/development/index.d.ts +7 -1
- package/types/common/development/interface.d.ts +22 -0
- package/types/common/empty/index.d.ts +2 -1
- package/types/common/flex/index.d.ts +14 -0
- package/types/common/flex/interface.d.ts +62 -0
- package/types/common/higher-order/with-speech-synthesis/index.d.ts +6 -1
- package/types/common/higher-order/with-speech-synthesis/interface.d.ts +13 -0
- package/types/common/space/index.d.ts +4 -3
- package/types/common/space/interface.d.ts +10 -18
- package/types/common/suspense-fallback-test/index.d.ts +7 -0
- package/types/common/suspense-fallback-test/interface.d.ts +1 -0
- package/types/common/utils/PqbCSSTransition.d.ts +1 -1
- package/types/common/utils/toArray.d.ts +13 -0
- package/types/pc/affix/interface.d.ts +0 -2
- package/types/pc/alert/index.d.ts +3 -2
- package/types/pc/alert/interface.d.ts +7 -1
- package/types/pc/anchor/index.d.ts +2 -1
- package/types/pc/anchor/interface.d.ts +0 -2
- package/types/pc/auto-complete/interface.d.ts +0 -6
- package/types/pc/avatar/interface.d.ts +0 -4
- package/types/pc/badge/Count.d.ts +1 -1
- package/types/pc/breadcrumb/Item.d.ts +1 -1
- package/types/pc/breadcrumb/interface.d.ts +0 -3
- package/types/pc/calendar/Month.d.ts +1 -1
- package/types/pc/calendar/WeekList.d.ts +1 -1
- package/types/pc/calendar/Year.d.ts +1 -1
- package/types/pc/calendar/header/Panel.d.ts +1 -1
- package/types/pc/calendar/header/index.d.ts +1 -1
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/calendar/interface.d.ts +2 -1
- package/types/pc/carousel/interface.d.ts +2 -6
- package/types/pc/cascader/interface.d.ts +7 -19
- package/types/pc/cascader/panel/List.d.ts +1 -1
- package/types/pc/cascader/panel/Option.d.ts +1 -1
- package/types/pc/cascader/panel/Search.d.ts +1 -1
- package/types/pc/checkbox/Group.d.ts +2 -2
- package/types/pc/checkbox/GroupBlock.d.ts +1 -1
- package/types/pc/checkbox/IconCheck.d.ts +1 -1
- package/types/pc/checkbox/interface.d.ts +0 -1
- package/types/pc/collapse/interface.d.ts +0 -2
- package/types/pc/color-picker/InputRgb.d.ts +1 -1
- package/types/pc/color-picker/Palette.d.ts +1 -1
- package/types/pc/color-picker/interface.d.ts +0 -2
- package/types/pc/config-provider/ConfigProvider.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +17 -17
- package/types/pc/copy/index.d.ts +1 -1
- package/types/pc/copy/interface.d.ts +2 -1
- package/types/pc/date-picker/interface.d.ts +0 -17
- package/types/pc/date-picker/panel/Body.d.ts +1 -1
- package/types/pc/date-picker/panel/Footer.d.ts +1 -1
- package/types/pc/date-picker/panel/Header.d.ts +1 -1
- package/types/pc/date-picker/panel/WeekList.d.ts +1 -1
- package/types/pc/date-picker/panel/date/index.d.ts +1 -1
- package/types/pc/date-picker/panel/month/index.d.ts +1 -1
- package/types/pc/date-picker/panel/quarter/index.d.ts +1 -1
- package/types/pc/date-picker/panel/range/index.d.ts +1 -1
- package/types/pc/date-picker/panel/week/index.d.ts +1 -1
- package/types/pc/date-picker/panel/year/index.d.ts +1 -1
- package/types/pc/descriptions/index.d.ts +1 -1
- package/types/pc/descriptions/interface.d.ts +0 -1
- package/types/pc/details/index.d.ts +3 -2
- package/types/pc/details/interface.d.ts +16 -0
- package/types/pc/development/index.d.ts +2 -1
- package/types/pc/development/interface.d.ts +15 -0
- package/types/pc/divider/index.d.ts +7 -2
- package/types/pc/draggable/Item.d.ts +1 -1
- package/types/pc/draggable/index.d.ts +1 -1
- package/types/pc/drawer/interface.d.ts +0 -7
- package/types/pc/dropdown/interface.d.ts +0 -1
- package/types/pc/flex/index.d.ts +9 -0
- package/types/pc/flex/interface.d.ts +16 -0
- package/types/pc/form/Control.d.ts +1 -1
- package/types/pc/form/FormList.d.ts +1 -1
- package/types/pc/form/IconSymbol.d.ts +1 -1
- package/types/pc/form/interface.d.ts +9 -22
- package/types/pc/form/util.d.ts +1 -1
- package/types/pc/grid/index.d.ts +3 -3
- package/types/pc/grid/interface.d.ts +1 -6
- package/types/pc/icon/addFromIconFontCn.d.ts +1 -7
- package/types/pc/icon/index.d.ts +2 -7
- package/types/pc/icon/interface.d.ts +13 -0
- package/types/pc/icon-hover/index.d.ts +2 -8
- package/types/pc/icon-hover/interface.d.ts +8 -0
- package/types/pc/image/ImageFooter.d.ts +1 -1
- package/types/pc/image/ImagePreviewArrow.d.ts +1 -1
- package/types/pc/image/TriggerForToolbar.d.ts +1 -1
- package/types/pc/image/interface.d.ts +0 -13
- package/types/pc/index.d.ts +63 -50
- package/types/pc/input/Textarea.d.ts +2 -6
- package/types/pc/input/interface.d.ts +5 -13
- package/types/pc/input-number/interface.d.ts +0 -4
- package/types/pc/input-tag/interface.d.ts +0 -13
- package/types/pc/layout/interface.d.ts +0 -1
- package/types/pc/link/interface.d.ts +0 -1
- package/types/pc/list/interface.d.ts +0 -4
- package/types/pc/loading/index.d.ts +4 -3
- package/types/pc/loading/interface.d.ts +6 -0
- package/types/pc/menu/Indent.d.ts +1 -1
- package/types/pc/menu/OverflowWrap.d.ts +1 -1
- package/types/pc/menu/interface.d.ts +0 -8
- package/types/pc/menu/sub-menu/Inline.d.ts +1 -1
- package/types/pc/menu/sub-menu/Pop.d.ts +1 -1
- package/types/pc/message/interface.d.ts +0 -2
- package/types/pc/modal/interface.d.ts +0 -5
- package/types/pc/notification/interface.d.ts +0 -1
- package/types/pc/overflow-ellipsis/OverflowItem.d.ts +1 -1
- package/types/pc/overflow-ellipsis/index.d.ts +1 -1
- package/types/pc/pagination/PageItem.d.ts +3 -3
- package/types/pc/pagination/PageJumper.d.ts +1 -1
- package/types/pc/pagination/PageOption.d.ts +1 -1
- package/types/pc/pagination/interface.d.ts +0 -2
- package/types/pc/popconfirm/interface.d.ts +8 -10
- package/types/pc/popover/interface.d.ts +0 -1
- package/types/pc/portal/Portal.d.ts +2 -6
- package/types/pc/portal/index.d.ts +2 -9
- package/types/pc/portal/interface.d.ts +14 -0
- package/types/pc/progress/CircleProgress.d.ts +1 -1
- package/types/pc/progress/LineProgess.d.ts +1 -1
- package/types/pc/progress/StepProgress.d.ts +1 -1
- package/types/pc/progress/interface.d.ts +0 -3
- package/types/pc/radio/Group.d.ts +2 -2
- package/types/pc/radio/GroupBlock.d.ts +1 -1
- package/types/pc/radio/Radio.d.ts +1 -1
- package/types/pc/resize-box/ResizeTrigger.d.ts +1 -1
- package/types/pc/resize-box/interface.d.ts +1 -7
- package/types/pc/result/403.d.ts +1 -1
- package/types/pc/result/404.d.ts +1 -1
- package/types/pc/result/500.d.ts +1 -1
- package/types/pc/segmented/interface.d.ts +6 -6
- package/types/pc/select/interface.d.ts +0 -12
- package/types/pc/select-view/interface.d.ts +0 -7
- package/types/pc/skeleton/Image.d.ts +1 -1
- package/types/pc/skeleton/Text.d.ts +2 -1
- package/types/pc/slider/Button.d.ts +1 -1
- package/types/pc/slider/Input.d.ts +1 -1
- package/types/pc/slider/Tick.d.ts +1 -1
- package/types/pc/slider/interface.d.ts +0 -4
- package/types/pc/space/index.d.ts +7 -5
- package/types/pc/speech-synthesis/index.d.ts +3 -1
- package/types/pc/speech-synthesis/interface.d.ts +7 -0
- package/types/pc/spin/DotLoading.d.ts +1 -1
- package/types/pc/spin/interface.d.ts +4 -1
- package/types/pc/splitter/Panel.d.ts +8 -0
- package/types/pc/splitter/SplitBar.d.ts +21 -0
- package/types/pc/splitter/Splitter.d.ts +4 -0
- package/types/pc/splitter/hooks/useEvent.d.ts +3 -0
- package/types/pc/splitter/hooks/useItems.d.ts +10 -0
- package/types/pc/splitter/hooks/useResizable.d.ts +8 -0
- package/types/pc/splitter/hooks/useResize.d.ts +4 -0
- package/types/pc/splitter/hooks/useSizes.d.ts +5 -0
- package/types/pc/splitter/index.d.ts +8 -3
- package/types/pc/splitter/interface.d.ts +181 -38
- package/types/pc/statistic/interface.d.ts +0 -4
- package/types/pc/steps/interface.d.ts +0 -3
- package/types/pc/suspense-fallback-test/index.d.ts +2 -3
- package/types/pc/suspense-fallback-test/interface.d.ts +2 -0
- package/types/pc/table/ColGroup.d.ts +1 -1
- package/types/pc/table/hook/useThResizable.d.ts +2 -2
- package/types/pc/table/interface.d.ts +4 -15
- package/types/pc/table/summary/Cell.d.ts +1 -1
- package/types/pc/table/summary/Row.d.ts +1 -1
- package/types/pc/table/tbody/Td.d.ts +1 -1
- package/types/pc/table/tbody/index.d.ts +1 -1
- package/types/pc/table/tfoot/index.d.ts +1 -1
- package/types/pc/table/th-resizable/index.d.ts +1 -1
- package/types/pc/table/thead/Column.d.ts +1 -1
- package/types/pc/table/thead/index.d.ts +1 -1
- package/types/pc/tabs/TabContent.d.ts +1 -1
- package/types/pc/tabs/interface.d.ts +0 -7
- package/types/pc/tabs/tab-header/DropdownIcon.d.ts +1 -1
- package/types/pc/tabs/tab-header/TabInk.d.ts +1 -1
- package/types/pc/tabs/tab-header/TabNavIcon.d.ts +1 -1
- package/types/pc/tag/index.d.ts +2 -0
- package/types/pc/tag/interface.d.ts +0 -1
- package/types/pc/time-picker/Picker.d.ts +1 -1
- package/types/pc/time-picker/RangePicker.d.ts +1 -1
- package/types/pc/time-picker/TimeColumn.d.ts +1 -1
- package/types/pc/time-picker/TimePicker.d.ts +1 -1
- package/types/pc/time-picker/index.d.ts +1 -1
- package/types/pc/time-picker/interface.d.ts +0 -7
- package/types/pc/tooltip/interface.d.ts +4 -1
- package/types/pc/transfer/Item.d.ts +1 -1
- package/types/pc/transfer/List.d.ts +1 -1
- package/types/pc/transfer/interface.d.ts +2 -9
- package/types/pc/tree/Animation.d.ts +1 -1
- package/types/pc/tree/interface.d.ts +2 -8
- package/types/pc/tree-select/interface.d.ts +0 -8
- package/types/pc/trigger/interface.d.ts +0 -5
- package/types/pc/typography/EditContent.d.ts +2 -1
- package/types/pc/typography/Operations.d.ts +1 -1
- package/types/pc/typography/interface.d.ts +45 -30
- package/types/pc/upload/interface.d.ts +6 -11
- package/types/pc/upload/list/index.d.ts +1 -1
- package/types/pc/utils/index.d.ts +1 -0
- package/types/pc/utils/names.d.ts +6 -0
- package/types/pc/utils/toArray.d.ts +3 -0
- package/types/pc/verification-code/VerificationCode.d.ts +1 -1
- package/types/pc/verification-code/interface.d.ts +0 -2
- package/types/pc/virtual-list/VirtualList.d.ts +2 -38
- package/types/pc/virtual-list/index.d.ts +2 -1
- package/types/pc/virtual-list/interface.d.ts +56 -0
- package/types/pc/watermark/Watermark.d.ts +1 -1
- package/types/pc/watermark/interface.d.ts +0 -2
- package/typography/Base.js +73 -73
- package/typography/EditContent.js +43 -33
- package/typography/Ellipsis.js +117 -184
- package/typography/Operations.js +97 -49
- package/typography/useCssEllipsis.js +7 -6
- package/utils/index.js +117 -115
- package/utils/names.js +4 -0
- package/utils/toArray.js +5 -0
- package/version/index.js +1 -1
- package/virtual-list/interface.js +1 -0
- package/components/common/space/toArray.js +0 -11
- package/loading/style/index.module.less.js +0 -4
- package/types/common/space/toArray.d.ts +0 -3
- package/types/pc/suspense-fallback-test/style/index.d.ts +0 -1
- /package/{suspense-fallback-test/style/index.less.js → development/interface.js} +0 -0
- /package/types/pc/grid/{GridItem.d.ts → Item.d.ts} +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Options as ScrollIntoViewOptions } from '@unicom-cloud/scroll-into-view-if-needed';
|
|
2
|
+
import React, { CSSProperties, ReactNode, UIEvent } from 'react';
|
|
3
|
+
import { Key } from './util/item';
|
|
4
|
+
export type RenderFunc<T> = (item: T, index: number, props: {
|
|
5
|
+
style: React.CSSProperties;
|
|
6
|
+
itemIndex: number;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
type Status = 'NONE' | 'MEASURE_START' | 'MEASURE_DONE';
|
|
9
|
+
export interface VirtualListProps<T> extends Omit<React.HTMLAttributes<any>, 'children' | 'onScroll'> {
|
|
10
|
+
children: RenderFunc<T>;
|
|
11
|
+
data: T[];
|
|
12
|
+
height?: number | string;
|
|
13
|
+
itemHeight?: number;
|
|
14
|
+
wrapper?: string | React.FC<any> | React.ComponentClass<any>;
|
|
15
|
+
threshold?: number | null;
|
|
16
|
+
isStaticItemHeight?: boolean;
|
|
17
|
+
itemKey?: Key | ((item: T, index: number) => Key);
|
|
18
|
+
measureLongestItem?: boolean;
|
|
19
|
+
scrollOptions?: ScrollIntoViewOptions;
|
|
20
|
+
needFiller?: boolean;
|
|
21
|
+
/** Custom filler outer style */
|
|
22
|
+
outerStyle?: CSSProperties;
|
|
23
|
+
innerStyle?: CSSProperties;
|
|
24
|
+
onScroll?: (event: UIEvent<HTMLElement>, info: {
|
|
25
|
+
index: number;
|
|
26
|
+
}) => void;
|
|
27
|
+
wrapperChild?: string | React.FC<any> | React.ComponentClass<any>;
|
|
28
|
+
}
|
|
29
|
+
export type AvailableVirtualListProps = Pick<VirtualListProps<any>, 'height' | 'itemHeight' | 'threshold' | 'isStaticItemHeight' | 'scrollOptions' | 'onScroll' | 'wrapperChild'>;
|
|
30
|
+
export interface RelativeScroll {
|
|
31
|
+
itemIndex: number;
|
|
32
|
+
relativeTop: number;
|
|
33
|
+
}
|
|
34
|
+
export interface VirtualListState {
|
|
35
|
+
status: Status;
|
|
36
|
+
startIndex: number;
|
|
37
|
+
endIndex: number;
|
|
38
|
+
itemIndex: number;
|
|
39
|
+
itemOffsetPtg: number;
|
|
40
|
+
startItemTop: number;
|
|
41
|
+
scrollTop: number;
|
|
42
|
+
}
|
|
43
|
+
export type VirtualListHandle = {
|
|
44
|
+
dom: HTMLElement;
|
|
45
|
+
scrollTo: (arg: number | {
|
|
46
|
+
index: number;
|
|
47
|
+
options?: ScrollIntoViewOptions;
|
|
48
|
+
} | {
|
|
49
|
+
key: Key;
|
|
50
|
+
options?: ScrollIntoViewOptions;
|
|
51
|
+
}) => void;
|
|
52
|
+
};
|
|
53
|
+
export type ItemHeightMap = {
|
|
54
|
+
[p: string]: number;
|
|
55
|
+
};
|
|
56
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { WatermarkProps } from './interface';
|
|
2
|
-
export declare function WatermarkComponent(baseProps: WatermarkProps, _: any): import("react/jsx-
|
|
2
|
+
export declare function WatermarkComponent(baseProps: WatermarkProps, _: any): import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
declare const Watermark: import("react").ForwardRefExoticComponent<WatermarkProps & import("react").RefAttributes<unknown>>;
|
|
4
4
|
export default Watermark;
|
package/typography/Base.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsx as p, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsx as p, jsxs as ne, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
+
import re from "lodash/merge";
|
|
3
|
+
import _, { forwardRef as le, useContext as pe, useRef as ce, useState as W, useEffect as ae, useImperativeHandle as me } from "react";
|
|
4
4
|
import "../config-provider/ConfigProvider.js";
|
|
5
5
|
import de from "../components/common/hooks/useMergeValue.js";
|
|
6
6
|
import fe from "../components/common/hooks/useUpdateEffect.js";
|
|
7
7
|
import ue from "../popover/index.js";
|
|
8
8
|
import he from "../tooltip/index.js";
|
|
9
|
-
import
|
|
9
|
+
import q from "@unicom-cloud/utils/class-name";
|
|
10
10
|
import "../components/common/utils/is.js";
|
|
11
11
|
import { mergedToString as Ee } from "../components/common/utils/mergedToString.js";
|
|
12
12
|
import { omit as ge } from "../components/common/utils/omit.js";
|
|
13
13
|
import { resizeObserver as Ce } from "../components/common/utils/resizeObserver.js";
|
|
14
14
|
import { throttleByRaf as xe } from "../components/common/utils/throttleByRaf.js";
|
|
15
15
|
import Te from "./EditContent.js";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import be, { MEASURE_STATUS as
|
|
16
|
+
import Se from "./Operations.js";
|
|
17
|
+
import Ne from "./useCssEllipsis.js";
|
|
18
|
+
import be, { MEASURE_STATUS as A } from "./useEllipsis.js";
|
|
19
19
|
import we from "../config-provider/context.js";
|
|
20
|
-
import { isPlainObject as x, isUndefined as
|
|
20
|
+
import { isPlainObject as x, isUndefined as F } from "@unicom-cloud/utils/is";
|
|
21
21
|
function ye(s, f) {
|
|
22
22
|
const {
|
|
23
23
|
type: c,
|
|
24
|
-
bold:
|
|
24
|
+
bold: w,
|
|
25
25
|
disabled: T,
|
|
26
26
|
mark: u,
|
|
27
|
-
underline:
|
|
27
|
+
underline: S,
|
|
28
28
|
delete: a,
|
|
29
|
-
code:
|
|
29
|
+
code: y
|
|
30
30
|
} = s, l = [], h = [];
|
|
31
|
-
return c && h.push(`${f}-${c}`), T && h.push(`${f}-disabled`),
|
|
31
|
+
return c && h.push(`${f}-${c}`), T && h.push(`${f}-disabled`), w && l.push("b"), S && l.push("u"), a && l.push("del"), y && l.push("code"), u && l.push("mark"), {
|
|
32
32
|
component: l,
|
|
33
33
|
className: h
|
|
34
34
|
};
|
|
@@ -36,100 +36,100 @@ function ye(s, f) {
|
|
|
36
36
|
function $e(s, f) {
|
|
37
37
|
const {
|
|
38
38
|
componentType: c,
|
|
39
|
-
style:
|
|
39
|
+
style: w,
|
|
40
40
|
className: T,
|
|
41
41
|
children: u,
|
|
42
|
-
editable:
|
|
42
|
+
editable: S,
|
|
43
43
|
ellipsis: a,
|
|
44
|
-
heading:
|
|
44
|
+
heading: y,
|
|
45
45
|
blockquote: l,
|
|
46
46
|
...h
|
|
47
|
-
} = s,
|
|
47
|
+
} = s, I = pe(we), { getPrefixCls: L, rtl: O } = I, n = L?.("typography"), N = ce(null), { component: b, className: U } = ye(s, n), [V, z] = W(!1), [H, G] = W(0), $ = x(S) ? S : {}, J = "editing" in $ ? $.editing : V, D = "...", e = a ? {
|
|
48
48
|
rows: 1,
|
|
49
|
-
ellipsisStr:
|
|
49
|
+
ellipsisStr: D,
|
|
50
50
|
cssEllipsis: !1,
|
|
51
51
|
...x(a) ? a : {}
|
|
52
|
-
} : {},
|
|
52
|
+
} : {}, K = e.wrapper || _.Fragment, [i, Q] = de(!1, {
|
|
53
53
|
defaultValue: e.defaultExpanded,
|
|
54
54
|
value: e.expanded
|
|
55
|
-
}), { simpleEllipsis:
|
|
56
|
-
const r =
|
|
57
|
-
return /* @__PURE__ */
|
|
55
|
+
}), { simpleEllipsis: k, ellipsisStyle: X } = Ne(e), M = (t, o) => {
|
|
56
|
+
const r = F(e.ellipsisStr) ? D : e.ellipsisStr, d = !F(e.suffix) && e.suffix;
|
|
57
|
+
return /* @__PURE__ */ ne(K, { children: [
|
|
58
58
|
t,
|
|
59
|
-
o && !i &&
|
|
59
|
+
o && !i && !k ? r : "",
|
|
60
60
|
d,
|
|
61
|
-
|
|
61
|
+
ee(o)
|
|
62
62
|
] });
|
|
63
|
-
}, { ellipsisNode:
|
|
63
|
+
}, { ellipsisNode: Y, isEllipsis: m, measureStatus: j } = be({
|
|
64
64
|
...e,
|
|
65
65
|
children: u,
|
|
66
66
|
expanding: i,
|
|
67
|
-
width:
|
|
68
|
-
renderMeasureContent:
|
|
69
|
-
simpleEllipsis:
|
|
70
|
-
}),
|
|
67
|
+
width: H,
|
|
68
|
+
renderMeasureContent: M,
|
|
69
|
+
simpleEllipsis: k || i
|
|
70
|
+
}), Z = xe((t) => {
|
|
71
71
|
const { contentRect: o } = t?.[0];
|
|
72
72
|
if (o) {
|
|
73
|
-
const r =
|
|
73
|
+
const r = b.includes("code") ? o.width - 18 : o.width;
|
|
74
74
|
[
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
].includes(
|
|
75
|
+
A.NO_NEED_ELLIPSIS,
|
|
76
|
+
A.MEASURE_END
|
|
77
|
+
].includes(j) && G(r);
|
|
78
78
|
}
|
|
79
|
-
})
|
|
79
|
+
});
|
|
80
80
|
ae(() => {
|
|
81
|
-
const t = Ce([
|
|
81
|
+
const t = Ce([N.current], Z);
|
|
82
82
|
return () => {
|
|
83
83
|
t();
|
|
84
84
|
};
|
|
85
|
-
}, [
|
|
86
|
-
function
|
|
87
|
-
return /* @__PURE__ */ p(
|
|
88
|
-
|
|
85
|
+
}, [N.current]);
|
|
86
|
+
function ee(t) {
|
|
87
|
+
return /* @__PURE__ */ p(ie, { children: /* @__PURE__ */ p(
|
|
88
|
+
Se,
|
|
89
89
|
{
|
|
90
90
|
...s,
|
|
91
|
-
setEditing:
|
|
92
|
-
onClickExpand:
|
|
91
|
+
setEditing: z,
|
|
92
|
+
onClickExpand: te,
|
|
93
93
|
expanding: i,
|
|
94
94
|
isEllipsis: t,
|
|
95
|
-
currentContext:
|
|
95
|
+
currentContext: I
|
|
96
96
|
}
|
|
97
97
|
) });
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
99
|
+
function te(t) {
|
|
100
|
+
Q(!i), s.onClickExpand?.(t), e.onExpand?.(!i, t);
|
|
101
101
|
}
|
|
102
102
|
fe(() => {
|
|
103
103
|
e.onEllipsis?.(m);
|
|
104
|
-
}, [m]), me(f, () =>
|
|
104
|
+
}, [m]), me(f, () => N.current);
|
|
105
105
|
function B(t, o, r, d = {}) {
|
|
106
106
|
let g = t;
|
|
107
|
-
return o.forEach((
|
|
108
|
-
const
|
|
109
|
-
g =
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
return o.forEach((P, v) => {
|
|
108
|
+
const R = { className: `${n}-${P}` }, C = v === 0 ? d : {}, se = x(r.mark) && r.mark.color ? { style: { backgroundColor: r.mark.color }, ...C } : { ...C };
|
|
109
|
+
g = _.createElement(
|
|
110
|
+
P,
|
|
111
|
+
re({ ...se }, R),
|
|
112
112
|
g
|
|
113
113
|
);
|
|
114
114
|
}), g;
|
|
115
115
|
}
|
|
116
116
|
let E;
|
|
117
|
-
c === "Paragraph" ? E = l ? "blockquote" : "div" : c === "Title" ? E = `h${
|
|
118
|
-
function
|
|
119
|
-
const t = Ee(
|
|
120
|
-
style:
|
|
117
|
+
c === "Paragraph" ? E = l ? "blockquote" : "div" : c === "Title" ? E = `h${y}` : c === "Text" && (E = a ? "div" : "span");
|
|
118
|
+
function oe() {
|
|
119
|
+
const t = Ee(_.Children.toArray(u)), o = e.showTooltip, r = x(e.showTooltip) && e.showTooltip.type === "popover" ? "popover" : "tooltip", d = x(e.showTooltip) ? e.showTooltip.props || {} : {}, g = r === "popover" ? ue : he, v = {
|
|
120
|
+
style: w,
|
|
121
121
|
...m && !o && !i ? { title: t } : {}
|
|
122
|
-
},
|
|
122
|
+
}, R = m && o && !i, C = /* @__PURE__ */ p(
|
|
123
123
|
E,
|
|
124
124
|
{
|
|
125
|
-
ref:
|
|
126
|
-
className:
|
|
125
|
+
ref: N,
|
|
126
|
+
className: q(
|
|
127
127
|
n,
|
|
128
|
-
|
|
129
|
-
{ [`${n}-rtl`]:
|
|
128
|
+
U,
|
|
129
|
+
{ [`${n}-rtl`]: O },
|
|
130
130
|
T
|
|
131
131
|
),
|
|
132
|
-
...
|
|
132
|
+
...v,
|
|
133
133
|
...ge(h, [
|
|
134
134
|
"spacing",
|
|
135
135
|
"type",
|
|
@@ -147,41 +147,41 @@ function $e(s, f) {
|
|
|
147
147
|
"setEditing",
|
|
148
148
|
"forceShowExpand"
|
|
149
149
|
]),
|
|
150
|
-
children:
|
|
150
|
+
children: k && j !== A.INIT && !i && m ? B(
|
|
151
151
|
// CSS folding style, need to wrap the text separately.
|
|
152
|
-
|
|
153
|
-
/* @__PURE__ */ p("span", { style:
|
|
152
|
+
M(
|
|
153
|
+
/* @__PURE__ */ p("span", { style: X, children: u }),
|
|
154
154
|
m
|
|
155
155
|
),
|
|
156
|
-
|
|
156
|
+
b.length ? b : ["span"],
|
|
157
157
|
s,
|
|
158
158
|
// The simple-ellipsis class ensures that the ReactNode after the text is displayed correctly (no line breaks)
|
|
159
159
|
// Need to act on the immediate parent node of the text
|
|
160
160
|
{ className: `${n}-simple-ellipsis` }
|
|
161
|
-
) : B(
|
|
161
|
+
) : B(Y, b, s)
|
|
162
162
|
}
|
|
163
163
|
);
|
|
164
|
-
return
|
|
164
|
+
return R ? /* @__PURE__ */ p(g, { content: t, ...d, children: /* @__PURE__ */ p("span", { children: C }) }) : C;
|
|
165
165
|
}
|
|
166
|
-
return
|
|
166
|
+
return J ? /* @__PURE__ */ p(
|
|
167
167
|
Te,
|
|
168
168
|
{
|
|
169
169
|
ref: f,
|
|
170
170
|
...s,
|
|
171
|
-
className:
|
|
171
|
+
className: q(
|
|
172
172
|
n,
|
|
173
|
-
|
|
174
|
-
{ [`${n}-rtl`]:
|
|
173
|
+
U,
|
|
174
|
+
{ [`${n}-rtl`]: O },
|
|
175
175
|
`${n}-${E}`,
|
|
176
176
|
T
|
|
177
177
|
),
|
|
178
178
|
prefixCls: n,
|
|
179
|
-
setEditing:
|
|
180
|
-
editableConfig:
|
|
179
|
+
setEditing: z,
|
|
180
|
+
editableConfig: $
|
|
181
181
|
}
|
|
182
|
-
) :
|
|
182
|
+
) : oe();
|
|
183
183
|
}
|
|
184
|
-
const Ge =
|
|
184
|
+
const Ge = le($e);
|
|
185
185
|
export {
|
|
186
186
|
Ge as default
|
|
187
187
|
};
|
|
@@ -1,43 +1,53 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { mergedToString as
|
|
6
|
-
function
|
|
7
|
-
const { prefixCls:
|
|
8
|
-
`${
|
|
9
|
-
`${
|
|
10
|
-
|
|
11
|
-
),
|
|
12
|
-
|
|
13
|
-
if (
|
|
14
|
-
const { length:
|
|
15
|
-
|
|
2
|
+
import { forwardRef as C, useRef as P, useEffect as x } from "react";
|
|
3
|
+
import u from "../input/Input.js";
|
|
4
|
+
import N from "@unicom-cloud/utils/class-name";
|
|
5
|
+
import { mergedToString as $ } from "../components/common/utils/mergedToString.js";
|
|
6
|
+
function y(c, l) {
|
|
7
|
+
const { prefixCls: o, children: m, setEditing: d, editableConfig: n, style: p } = c, g = N(
|
|
8
|
+
`${o}-typography`,
|
|
9
|
+
`${o}-edit-content`,
|
|
10
|
+
c.className
|
|
11
|
+
), a = $(m), e = P(null);
|
|
12
|
+
x(() => {
|
|
13
|
+
if (e.current?.focus?.(), e.current && "dom" in e.current) {
|
|
14
|
+
const { length: t } = e.current.dom.value;
|
|
15
|
+
e.current.dom.setSelectionRange(t, t);
|
|
16
16
|
}
|
|
17
17
|
}, []);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
const r = () => {
|
|
19
|
+
d?.(!1), n?.onEnd?.(a);
|
|
20
|
+
}, E = (t) => {
|
|
21
|
+
n?.onChange?.(t);
|
|
22
|
+
}, h = () => r(), f = {
|
|
23
|
+
className: `${o}-edit-content-input`,
|
|
24
|
+
value: a,
|
|
25
|
+
onBlur: h,
|
|
26
|
+
onChange: E
|
|
27
|
+
};
|
|
28
|
+
let s;
|
|
29
|
+
return n?.inputProps ? s = /* @__PURE__ */ i(
|
|
30
|
+
u,
|
|
29
31
|
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
...f,
|
|
33
|
+
ref: e,
|
|
34
|
+
onPressEnter: r,
|
|
35
|
+
...n.inputProps
|
|
36
|
+
}
|
|
37
|
+
) : s = /* @__PURE__ */ i(
|
|
38
|
+
u.TextArea,
|
|
39
|
+
{
|
|
40
|
+
...f,
|
|
41
|
+
ref: e,
|
|
34
42
|
autoSize: !0,
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
onPressEnter: (t) => {
|
|
44
|
+
t.shiftKey || r();
|
|
45
|
+
},
|
|
46
|
+
...n?.textAreaProps
|
|
37
47
|
}
|
|
38
|
-
) });
|
|
48
|
+
), /* @__PURE__ */ i("div", { className: g, style: p, ref: l, children: s });
|
|
39
49
|
}
|
|
40
|
-
const b =
|
|
50
|
+
const b = C(y);
|
|
41
51
|
export {
|
|
42
52
|
b as default
|
|
43
53
|
};
|