straw-ui-vue 0.1.63 → 0.2.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/components/st-button/base.d.ts +22 -22
- package/dist/components/st-date-picker/picker-classes.d.ts +3 -3
- package/dist/components/st-date-picker/types/st-picker-atoms.d.ts +4 -0
- package/dist/components/st-date-picker/types/st-picker-shared.d.ts +6 -2
- package/dist/components/st-message/base.d.ts +9 -1
- package/dist/components/st-splitter/index.d.ts +15 -22
- package/dist/components/st-splitter/st-splitter-group.d.ts +2 -0
- package/dist/components/st-splitter/st-splitter-panel.d.ts +1 -7
- package/dist/components/st-splitter/st-splitter.d.ts +2 -0
- package/dist/components/st-splitter/types/st-splitter-context.d.ts +65 -31
- package/dist/components/st-splitter/types/st-splitter-group-collapse.d.ts +10 -10
- package/dist/components/st-splitter/types/st-splitter-group-handle.d.ts +2 -2
- package/dist/components/st-splitter/types/st-splitter-group.d.ts +11 -2
- package/dist/components/st-splitter/types/st-splitter-panel.d.ts +8 -7
- package/dist/components/st-splitter/types/st-splitter.d.ts +46 -17
- package/dist/components/st-splitter/useSplitter.d.ts +6 -2
- package/dist/components/st-table/tableStyle.d.ts +2 -2
- package/dist/constants/choice-row.d.ts +1 -1
- package/dist/constants/config.d.ts +1 -1
- package/dist/constants/z-index.d.ts +27 -0
- package/dist/{forward-props-BJqcpGUj.js → forward-props-DZeyZuRz.js} +443 -442
- package/dist/straw-ui.js +1301 -1040
- package/dist/unocss-preset.d.ts +101 -1
- package/dist/unocss.js +49 -23
- package/dist/utils.js +1 -1
- package/dist/variables.css +128 -103
- package/dist/z-index-C50wdJsI.js +4 -0
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
* 折叠按钮所在位置
|
|
3
|
-
* start 分隔条起始侧(收起归属面板)、end 分隔条结束侧(收起后一个面板)、bar 收起条(展开该面板)
|
|
4
|
-
* */
|
|
5
|
-
export type StSplitterGroupCollapsePosition = 'start' | 'end' | 'bar';
|
|
1
|
+
import type { StSplitterBarSide } from './st-splitter.d.ts';
|
|
6
2
|
|
|
7
3
|
/**
|
|
8
4
|
* 折叠按钮原子属性接口
|
|
9
5
|
* */
|
|
10
6
|
export interface StSplitterGroupCollapseProps {
|
|
11
7
|
/**
|
|
12
|
-
*
|
|
8
|
+
* 分隔条索引
|
|
9
|
+
* */
|
|
10
|
+
barIndex: number;
|
|
11
|
+
/**
|
|
12
|
+
* 按钮位于分隔条哪一侧:start 作用于左侧(vertical 为上侧)面板,end 作用于右侧(下侧)面板
|
|
13
13
|
* */
|
|
14
|
-
|
|
14
|
+
side: StSplitterBarSide;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* 点击后执行的动作
|
|
17
17
|
* */
|
|
18
|
-
|
|
18
|
+
action: 'collapse' | 'restore';
|
|
19
19
|
/**
|
|
20
20
|
* 宿主是否处于悬浮态,仅 show-collapse-button 为 hover 时生效
|
|
21
21
|
* */
|
|
22
22
|
hovered?: boolean;
|
|
23
|
-
}
|
|
23
|
+
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { ClassValue, StyleValue, VNodeChild } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
StSplitterBarSide,
|
|
4
|
+
StSplitterCollapseTrigger,
|
|
5
|
+
StSplitterDirection,
|
|
6
|
+
StSplitterPanelConfig,
|
|
7
|
+
} from './st-splitter.d.ts';
|
|
3
8
|
|
|
4
9
|
/**
|
|
5
10
|
* 分屏容器组属性接口
|
|
@@ -49,6 +54,8 @@ export interface StSplitterGroupSlots {
|
|
|
49
54
|
export interface StSplitterGroupEmits {
|
|
50
55
|
/** 面板尺寸变化事件(拖拽结束时触发) */
|
|
51
56
|
resize: [panels: StSplitterPanelConfig[]];
|
|
57
|
+
/** 收起/恢复事件 */
|
|
58
|
+
collapse: [index: number, side: StSplitterBarSide, sizes: number[]];
|
|
52
59
|
}
|
|
53
60
|
|
|
54
61
|
/**
|
|
@@ -59,6 +66,8 @@ export interface StSplitterGroupExpose {
|
|
|
59
66
|
getPanels: () => StSplitterPanelConfig[];
|
|
60
67
|
/** 设置面板尺寸 */
|
|
61
68
|
setPanelSize: (id: string, size: number) => void;
|
|
69
|
+
/** 设置面板收起状态 */
|
|
70
|
+
setPanelCollapsed: (id: string, collapsed: boolean) => void;
|
|
62
71
|
/** 重置面板尺寸 */
|
|
63
72
|
resetSizes: () => void;
|
|
64
|
-
}
|
|
73
|
+
}
|
|
@@ -5,6 +5,11 @@ import type { StSplitterPanelConfig } from './st-splitter.d.ts';
|
|
|
5
5
|
* 面板组件属性接口
|
|
6
6
|
* */
|
|
7
7
|
export interface StSplitterPanelProps {
|
|
8
|
+
/**
|
|
9
|
+
* 面板尺寸(px)
|
|
10
|
+
* 省略时与其余未指定尺寸的面板平分剩余空间
|
|
11
|
+
* */
|
|
12
|
+
size?: number;
|
|
8
13
|
/**
|
|
9
14
|
* 最小尺寸
|
|
10
15
|
* */
|
|
@@ -13,10 +18,6 @@ export interface StSplitterPanelProps {
|
|
|
13
18
|
* 最大尺寸
|
|
14
19
|
* */
|
|
15
20
|
maxSize?: number;
|
|
16
|
-
/**
|
|
17
|
-
* 是否为弹性面板,自动填充剩余空间
|
|
18
|
-
* */
|
|
19
|
-
flex?: boolean;
|
|
20
21
|
/**
|
|
21
22
|
* 面板 class
|
|
22
23
|
* */
|
|
@@ -41,6 +42,6 @@ export interface StSplitterPanelSlots {
|
|
|
41
42
|
export interface StSplitterPanelExpose {
|
|
42
43
|
/** 获取面板配置 */
|
|
43
44
|
getConfig: () => StSplitterPanelConfig;
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
}
|
|
45
|
+
/** 设置面板收起状态 */
|
|
46
|
+
setCollapsed: (collapsed: boolean) => void;
|
|
47
|
+
}
|
|
@@ -12,9 +12,14 @@ export type StSplitterDirection = 'horizontal' | 'vertical';
|
|
|
12
12
|
export type StSplitterCollapseTrigger = 'never' | 'hover' | 'always';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* 分隔条侧位:start 作用于分隔条左侧(vertical 为上侧)面板,end 作用于右侧(下侧)面板
|
|
16
16
|
* */
|
|
17
|
-
export type
|
|
17
|
+
export type StSplitterBarSide = 'start' | 'end';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 折叠入口动作:collapse 收起该侧面板、restore 恢复该侧面板
|
|
21
|
+
* */
|
|
22
|
+
export type StSplitterCollapseAction = 'collapse' | 'restore';
|
|
18
23
|
|
|
19
24
|
/**
|
|
20
25
|
* 面板配置接口
|
|
@@ -25,37 +30,57 @@ export interface StSplitterPanelConfig {
|
|
|
25
30
|
* */
|
|
26
31
|
id: string;
|
|
27
32
|
/**
|
|
28
|
-
*
|
|
33
|
+
* 当前尺寸(px)
|
|
29
34
|
* */
|
|
30
35
|
size: number;
|
|
31
36
|
/**
|
|
32
37
|
* 最小尺寸
|
|
33
38
|
* */
|
|
34
|
-
minSize
|
|
39
|
+
minSize: number;
|
|
35
40
|
/**
|
|
36
41
|
* 最大尺寸
|
|
37
42
|
* */
|
|
38
|
-
maxSize
|
|
43
|
+
maxSize: number;
|
|
44
|
+
/**
|
|
45
|
+
* 是否处于收起态,等价于 size === 0
|
|
46
|
+
* */
|
|
47
|
+
collapsed: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* 收起前尺寸,仅在收起态保留,用于恢复
|
|
50
|
+
* */
|
|
51
|
+
prevSize?: number;
|
|
39
52
|
/**
|
|
40
|
-
*
|
|
53
|
+
* 空间寄存在哪个面板,仅在收起态保留
|
|
41
54
|
* */
|
|
42
|
-
|
|
55
|
+
lenderId?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 分隔条上的一个折叠入口
|
|
60
|
+
* */
|
|
61
|
+
export interface StSplitterBarArrow {
|
|
43
62
|
/**
|
|
44
|
-
*
|
|
63
|
+
* 作用目标面板ID
|
|
45
64
|
* */
|
|
46
|
-
|
|
65
|
+
panelId: string;
|
|
47
66
|
/**
|
|
48
|
-
*
|
|
67
|
+
* 点击后执行的动作
|
|
49
68
|
* */
|
|
50
|
-
|
|
69
|
+
action: StSplitterCollapseAction;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* 分隔条渲染状态
|
|
74
|
+
* */
|
|
75
|
+
export interface StSplitterBarState {
|
|
51
76
|
/**
|
|
52
|
-
*
|
|
77
|
+
* 分隔条索引,夹在 panels[index] 与 panels[index + 1] 之间
|
|
53
78
|
* */
|
|
54
|
-
|
|
79
|
+
index: number;
|
|
55
80
|
/**
|
|
56
|
-
*
|
|
81
|
+
* 两侧可用的折叠入口
|
|
57
82
|
* */
|
|
58
|
-
|
|
83
|
+
arrows: Partial<Record<StSplitterBarSide, StSplitterBarArrow>>;
|
|
59
84
|
}
|
|
60
85
|
|
|
61
86
|
/**
|
|
@@ -96,8 +121,10 @@ export interface StSplitterProps {
|
|
|
96
121
|
* 分屏组件事件接口
|
|
97
122
|
* */
|
|
98
123
|
export interface StSplitterEmits {
|
|
99
|
-
/**
|
|
124
|
+
/** 面板尺寸变化事件(拖拽结束时触发) */
|
|
100
125
|
resize: [panels: StSplitterPanelConfig[]];
|
|
126
|
+
/** 收起/恢复事件,index 为分隔条索引,side 为点击的一侧 */
|
|
127
|
+
collapse: [index: number, side: StSplitterBarSide, sizes: number[]];
|
|
101
128
|
}
|
|
102
129
|
|
|
103
130
|
/**
|
|
@@ -116,6 +143,8 @@ export interface StSplitterExpose {
|
|
|
116
143
|
getPanels: () => StSplitterPanelConfig[];
|
|
117
144
|
/** 设置面板尺寸 */
|
|
118
145
|
setPanelSize: (id: string, size: number) => void;
|
|
146
|
+
/** 设置面板收起状态 */
|
|
147
|
+
setPanelCollapsed: (id: string, collapsed: boolean) => void;
|
|
119
148
|
/** 重置面板尺寸 */
|
|
120
149
|
resetSizes: () => void;
|
|
121
|
-
}
|
|
150
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { StConstrainedSizesOptions, StConstrainedSizesResult, StSplitterInternalContext } from './types/st-splitter-context.d.ts';
|
|
3
|
-
import { StSplitterCollapseTrigger, StSplitterDirection } from './types/st-splitter.d.ts';
|
|
3
|
+
import { StSplitterBarSide, StSplitterCollapseTrigger, StSplitterDirection } from './types/st-splitter.d.ts';
|
|
4
4
|
/**
|
|
5
5
|
* 计算调整后的尺寸,考虑边界约束
|
|
6
6
|
* 确保左右面板尺寸都在各自的 min/max 范围内
|
|
@@ -11,8 +11,12 @@ export declare function calculateConstrainedSizes(options: StConstrainedSizesOpt
|
|
|
11
11
|
/**
|
|
12
12
|
* 分屏组件 composable
|
|
13
13
|
* 每次调用都会创建独立的状态实例,支持多个分屏组件并存
|
|
14
|
+
*
|
|
15
|
+
* 收起模型:尺寸在分隔条两侧的相邻面板之间一对一转移,
|
|
16
|
+
* 每个面板自行记录收起前尺寸与空间寄存的面板,恢复时按记录扣回。
|
|
14
17
|
* @param direction - 分屏方向的响应式引用
|
|
15
18
|
* @param showCollapseButton - 折叠按钮显示时机的响应式引用
|
|
19
|
+
* @param onCollapse - 用户点击折叠入口后的回调
|
|
16
20
|
* @returns 分屏上下文对象
|
|
17
21
|
* */
|
|
18
|
-
export declare function useSplitter(direction: Ref<StSplitterDirection>, showCollapseButton?: Ref<StSplitterCollapseTrigger
|
|
22
|
+
export declare function useSplitter(direction: Ref<StSplitterDirection>, showCollapseButton?: Ref<StSplitterCollapseTrigger>, onCollapse?: (index: number, side: StSplitterBarSide, sizes: number[]) => void): StSplitterInternalContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StTableColumn } from './types/st-table.d.ts';
|
|
2
2
|
import { StTableContext } from './types/st-table-context.d.ts';
|
|
3
|
-
/** 斑马行底色(=
|
|
4
|
-
export declare const TABLE_STRIPE_BG = "bg-
|
|
3
|
+
/** 斑马行底色(= neutral 以 50% 压在 background 上的不透明合成色) */
|
|
4
|
+
export declare const TABLE_STRIPE_BG = "bg-neutral-subtle-weak";
|
|
5
5
|
/** 行条带背景(仅斑马行着色,其余保持透明继承容器底色) */
|
|
6
6
|
export declare function tableStripeClass(stripe: boolean | undefined, rowIndex: number): string;
|
|
7
7
|
/** 需遮住下层滚动内容的背景(固定列单元格、合并覆盖层) */
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* 选项行基础类名
|
|
3
3
|
* st-menu-item / st-select-item 共用,保证选项行视觉一致
|
|
4
4
|
* */
|
|
5
|
-
export declare const choiceRowClasses = "flex items-center gap-2 px-3 py-1.25 rounded cursor-pointer transition-colors duration-100 select-none whitespace-nowrap text-3.25 leading-5 text-foreground hover:bg-
|
|
5
|
+
export declare const choiceRowClasses = "flex items-center gap-2 px-3 py-1.25 rounded cursor-pointer transition-colors duration-100 select-none whitespace-nowrap text-3.25 leading-5 text-foreground hover:bg-neutral-subtle";
|
|
@@ -4,7 +4,7 @@ import { StConfigKey } from '../types/config.d.ts';
|
|
|
4
4
|
*
|
|
5
5
|
* 第一次 nextZIndex() 返回 Z_INDEX_BASE + 1,可通过 setConfig('global', { Z_INDEX_BASE }) 覆盖。
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export { Z_INDEX_BASE } from './z-index.ts';
|
|
8
8
|
/**
|
|
9
9
|
* global 命名空间中会下沉为各预封装组件默认值的键
|
|
10
10
|
*
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 层级(z-index)规范
|
|
3
|
+
*
|
|
4
|
+
* 全库的 z-index 只有两类合法来源:
|
|
5
|
+
* 1. 本文件的命名层:需要跨组件比较层级的部件(浮层、容器内浮动件、容器级交互件);
|
|
6
|
+
* 2. 组件内部层:值域 0–Z_LAYER_INTERNAL_MAX,只在组件自己的层叠上下文内比较,
|
|
7
|
+
* 组件根必须建立层叠上下文(isolate),否则内部数值会泄漏到外部参与比较。
|
|
8
|
+
*
|
|
9
|
+
* 分层(由低到高):
|
|
10
|
+
* 0 内容
|
|
11
|
+
* 0–99 组件内部层(表格固定列、滚轮高亮、角标等)
|
|
12
|
+
* 100 容器内浮动件(滚动条轨道/滑块/导航/回顶)
|
|
13
|
+
* 200 容器级交互件(分隔条与折叠按钮)
|
|
14
|
+
* 1000+ 浮层(dialog / drawer / popover / panel / message)
|
|
15
|
+
*/
|
|
16
|
+
/** 组件内部层上限,超过此值的 z-index 必须登记为命名层 */
|
|
17
|
+
export declare const Z_LAYER_INTERNAL_MAX = 99;
|
|
18
|
+
/** 容器内浮动件:浮在容器内容之上、不与容器级交互件竞争 */
|
|
19
|
+
export declare const Z_LAYER_CHROME = 100;
|
|
20
|
+
/** 容器级交互件:必须压过容器内一切浮动件(如分隔条压过滚动条) */
|
|
21
|
+
export declare const Z_LAYER_CONTAINER = 200;
|
|
22
|
+
/**
|
|
23
|
+
* 浮层 z-index 起始值默认值
|
|
24
|
+
*
|
|
25
|
+
* 第一次 nextZIndex() 返回 Z_INDEX_BASE + 1,可通过 setConfig('global', { Z_INDEX_BASE }) 覆盖。
|
|
26
|
+
*/
|
|
27
|
+
export declare const Z_INDEX_BASE = 1000;
|