@yeepay/yee-boss-ui 0.1.6 → 0.1.7

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/README.md CHANGED
@@ -15,6 +15,7 @@
15
15
  - `YeeForm` Schema 查询表单。
16
16
  - `useYeeGrid` 与 `gridApi/formApi`。
17
17
  - `YeeDescriptions` 配置驱动的详情展示。
18
+ - `YeeEllipsisText` 单行/多行省略文本与按需完整提示。
18
19
  - `YeeFileUpload` 业务无关的文件选择与上传生命周期。
19
20
  - `YeeModal` 统一的 Modal / Drawer 容器。
20
21
  - `YeeSelect` 带完整文案提示的选择器。
@@ -89,6 +90,27 @@ export default {
89
90
 
90
91
  ## 通用业务组件
91
92
 
93
+ ### YeeEllipsisText
94
+
95
+ 通过 `line` 和 `maxWidth` 控制单行或多行省略;`tooltipWhenEllipsis` 开启后,仅在文本实际被截断时显示 Tooltip。`expand` 支持鼠标、Enter 和 Space 展开/收起,并通过 `expandChange` 通知状态变化。
96
+
97
+ ```vue
98
+ <YeeEllipsisText
99
+ :line="2"
100
+ :max-width="360"
101
+ expand
102
+ tooltip-when-ellipsis
103
+ @expand-change="handleExpandChange"
104
+ >
105
+ {{ remark }}
106
+ <template #tooltip>
107
+ 完整备注:{{ remark }}
108
+ </template>
109
+ </YeeEllipsisText>
110
+ ```
111
+
112
+ `placement` 支持 `top`、`right`、`bottom`、`left`;`ellipsisThreshold` 默认是 `3px`。还可使用 `tooltipMaxWidth`、`tooltipOverlayStyle`、`tooltipBackgroundColor`、`tooltipColor` 和 `tooltipFontSize` 调整提示内容。默认背景、文字和字号消费 Yee 的 `popover`、`popoverForeground` 与 `fontSize` Theme Tokens;未使用 `PlatformConfigProvider` 时回退到对应的 `--yee-*` CSS Variables。
113
+
92
114
  ### YeeDescriptions
93
115
 
94
116
  配置项使用稳定的 `name` 时,可通过 `content-${name}` 覆盖内容。`copyable` 仅复制展示值,`info` 用于补充说明。
@@ -0,0 +1,40 @@
1
+ import { CSSProperties } from 'vue';
2
+ import { YeeEllipsisTextProps } from './types';
3
+ declare function __VLS_template(): {
4
+ attrs: Partial<{}>;
5
+ slots: Readonly<{
6
+ default?(): unknown;
7
+ tooltip?(): unknown;
8
+ }> & {
9
+ default?(): unknown;
10
+ tooltip?(): unknown;
11
+ };
12
+ refs: {
13
+ text: HTMLDivElement;
14
+ };
15
+ rootEl: any;
16
+ };
17
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
18
+ declare const __VLS_component: import('vue').DefineComponent<YeeEllipsisTextProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
19
+ expandChange: (expanded: boolean) => any;
20
+ }, string, import('vue').PublicProps, Readonly<YeeEllipsisTextProps> & Readonly<{
21
+ onExpandChange?: (expanded: boolean) => any;
22
+ }>, {
23
+ line: number;
24
+ placement: import('./types').YeeEllipsisTextPlacement;
25
+ expand: boolean;
26
+ ellipsisThreshold: number;
27
+ maxWidth: number | string;
28
+ tooltip: boolean;
29
+ tooltipOverlayStyle: CSSProperties;
30
+ tooltipWhenEllipsis: boolean;
31
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
32
+ text: HTMLDivElement;
33
+ }, any>;
34
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
35
+ export default _default;
36
+ type __VLS_WithTemplateSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -0,0 +1,2 @@
1
+ export { default as YeeEllipsisText } from './YeeEllipsisText.vue';
2
+ export type { YeeEllipsisTextEmits, YeeEllipsisTextPlacement, YeeEllipsisTextProps, } from './types';
@@ -0,0 +1,31 @@
1
+ import { CSSProperties } from 'vue';
2
+ export type YeeEllipsisTextPlacement = 'bottom' | 'left' | 'right' | 'top';
3
+ export interface YeeEllipsisTextProps {
4
+ /** 是否允许点击文本展开全部内容。 */
5
+ expand?: boolean;
6
+ /** 判定文本截断时允许的像素误差。 */
7
+ ellipsisThreshold?: number;
8
+ /** 折叠状态下最多展示的行数。 */
9
+ line?: number;
10
+ /** 文本区域最大宽度,数字按 px 处理。 */
11
+ maxWidth?: number | string;
12
+ /** Tooltip 展示位置。 */
13
+ placement?: YeeEllipsisTextPlacement;
14
+ /** 是否启用 Tooltip。 */
15
+ tooltip?: boolean;
16
+ /** Tooltip 背景色。 */
17
+ tooltipBackgroundColor?: string;
18
+ /** Tooltip 文字颜色。 */
19
+ tooltipColor?: string;
20
+ /** Tooltip 字号,单位 px。 */
21
+ tooltipFontSize?: number;
22
+ /** Tooltip 最大宽度,单位 px。 */
23
+ tooltipMaxWidth?: number;
24
+ /** Tooltip 内容区域样式。 */
25
+ tooltipOverlayStyle?: CSSProperties;
26
+ /** 是否仅在文本实际被截断时启用 Tooltip。 */
27
+ tooltipWhenEllipsis?: boolean;
28
+ }
29
+ export interface YeeEllipsisTextEmits {
30
+ expandChange: [expanded: boolean];
31
+ }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { default as PlatformConfigProvider } from './components/PlatformConfigProvider.vue';
2
2
  export * from './components/descriptions';
3
+ export * from './components/ellipsis-text';
3
4
  export * from './components/file-upload';
4
5
  export * from './components/form';
5
6
  export * from './components/grid';