@ticatec/topside-elements 1.0.6 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/app_layout/ClassicLayout.svelte +22 -11
- package/dist/app_layout/ClassicLayout.svelte.d.ts +6 -0
- package/dist/app_layout/ColumnsLayout.svelte +7 -4
- package/dist/app_layout/ColumnsLayout.svelte.d.ts +2 -0
- package/dist/app_layout/HeaderLayout.svelte +11 -2
- package/dist/app_layout/HeaderLayout.svelte.d.ts +4 -0
- package/dist/app_layout/README.md +23 -1
- package/dist/app_layout/README_CN.md +23 -1
- package/dist/app_layout/RowsLayout.svelte +7 -4
- package/dist/app_layout/RowsLayout.svelte.d.ts +2 -0
- package/dist/app_layout/SidebarLayout.svelte +11 -2
- package/dist/app_layout/SidebarLayout.svelte.d.ts +4 -0
- package/dist/data_table/DataTable.svelte +153 -12
- package/dist/data_table/DataTable.svelte.d.ts +22 -2
- package/dist/data_table/README.md +119 -38
- package/dist/data_table/README_CN.md +119 -38
- package/dist/data_table/index.d.ts +5 -0
- package/dist/data_table/index.js +2 -0
- package/dist/data_table/lib/IndicatorColumn.d.ts +2 -1
- package/dist/data_table/lib/RowExpansion.d.ts +84 -0
- package/dist/data_table/lib/RowExpansion.js +43 -0
- package/dist/data_table/parts/ActionsPanel.svelte +4 -0
- package/dist/data_table/parts/ActionsPanel.svelte.d.ts +2 -0
- package/dist/data_table/parts/ActionsRow.svelte +8 -1
- package/dist/data_table/parts/ActionsRow.svelte.d.ts +2 -0
- package/dist/data_table/parts/ContentPanel.svelte +9 -1
- package/dist/data_table/parts/ContentPanel.svelte.d.ts +4 -0
- package/dist/data_table/parts/DataRow.svelte +13 -2
- package/dist/data_table/parts/DataRow.svelte.d.ts +2 -0
- package/dist/data_table/parts/FixedColumnsPanel.svelte +11 -2
- package/dist/data_table/parts/FixedColumnsPanel.svelte.d.ts +6 -1
- package/dist/data_table/parts/FixedRow.svelte +19 -2
- package/dist/data_table/parts/FixedRow.svelte.d.ts +4 -0
- package/docs/components/README.md +6 -6
- package/docs/components/classic-layout/README.md +3 -0
- package/docs/components/columns-layout/README.md +1 -0
- package/docs/components/data-table/README.md +53 -1
- package/docs/components/header-layout/README.md +2 -0
- package/docs/components/rows-layout/README.md +1 -0
- package/docs/components/sidebar-layout/README.md +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### 新增
|
|
6
|
+
- **应用布局分割线**:SidebarLayout / HeaderLayout / ClassicLayout / ColumnsLayout / RowsLayout 新增 `divider`(默认 `true`),面板之间显示分割线;与 `*Resize`(能否拖动)相互独立——不可拖动时为固定线,可拖动但 `divider=false` 时线条为 0px、悬停 / 拖动时仅显示把手。SidebarLayout / HeaderLayout / ClassicLayout 新增 `headerDivider`,ClassicLayout 新增 `bottomDivider`(默认 `false`)。
|
|
7
|
+
|
|
8
|
+
### 行为变化
|
|
9
|
+
- 布局默认会显示面板之间的 1px 分割线(此前只有开启 `*Resize` 时才有)。自己用 border 画过分割线的页面会出现双线,去掉 border 或设 `divider={false}`。
|
|
10
|
+
|
|
11
|
+
### 修复
|
|
12
|
+
- ClassicLayout:`sidebarResize` 为真但没有 `sidebar` snippet 时不再渲染多余的分割线。
|
|
13
|
+
|
|
14
|
+
## 1.1.0
|
|
15
|
+
|
|
16
|
+
### 新增
|
|
17
|
+
- **DataTable 行展开重做(`rowExpansion` 属性)**:展开区组件、触发方式与控制方式分离。`showToggle`(默认 true)控制指示列的展开图标;`trigger: 'click' | 'dblclick'` 整行单击 / 双击切换(点到按钮、链接、输入框不触发);`isExpandable` 限制可展开行;`onExpandChange` 回调。
|
|
18
|
+
- **组件方法**:`expandRow(data)` / `collapseRow(data?)` / `toggleRowExpand(data)` / `isRowExpanded(data)` / `getExpandedRow()`,操作列按钮、外部按钮都可以借此控制展开。
|
|
19
|
+
- **行内事件请求**:自定义 `render` 单元格 / `ActionCell` / 展开区内部在任意元素上调用 `requestRowExpand(el)` / `requestRowCollapse(el)` / `requestRowToggle(el)`(或自行派发 `ROW_EXPAND_EVENT`),由 DataTable 定位所在行处理,不需要拿到表格实例。
|
|
20
|
+
- **展开区上下文**:展开区组件除 `data` 外还收到 `context: RowExpandContext`——`collapse()` 关闭本行、`actions` 为本行行动作(来自 `actionsColumn.getActions`)、`invoke(label)` 按标签执行行动作,可在展开区里直接做“编辑明细”等操作。
|
|
21
|
+
- 异步 `build` 期间切换到别的行时,过期的结果不再覆盖当前展开行。
|
|
22
|
+
|
|
23
|
+
### 变更
|
|
24
|
+
- `indicatorColumn.buildInlineComponent` 标记为 `@deprecated`,保留兼容(等价于 `rowExpansion = { build }`)。
|
|
25
|
+
|
|
26
|
+
### 测试与文档
|
|
27
|
+
- `topside-test-suite`:新增 `tests/elements/data_table/DataTable.expand.test.ts`(17 个用例);`/test/data/data-table/expand` 演示页扩充为图标 / 双击 + 展开区行动作 / 自定义单元格 + 组件方法三个示例。
|
|
28
|
+
- `data_table/README(_CN).md` 新增「行展开」章节与 `RowExpansion` / `RowExpandContext` 类型说明。
|
|
29
|
+
|
|
3
30
|
## 1.0.6
|
|
4
31
|
|
|
5
32
|
### 变更
|
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
rightBarResize?: boolean;
|
|
14
14
|
rightBarMaxWidth?: string | null;
|
|
15
15
|
rightBarMinWidth?: string | null;
|
|
16
|
+
/** 面板之间是否显示分割线,默认 true;与 *Resize(能否拖动)相互独立:可拖动但不显示线时,只在悬停 / 拖动时出现把手 */
|
|
17
|
+
divider?: boolean;
|
|
18
|
+
/** 头部与内容之间显示横向分割线,默认 false */
|
|
19
|
+
headerDivider?: boolean;
|
|
20
|
+
/** 内容与底部状态栏之间显示横向分割线,默认 false */
|
|
21
|
+
bottomDivider?: boolean;
|
|
16
22
|
header?: Snippet;
|
|
17
23
|
sidebar?: Snippet;
|
|
18
24
|
children?: Snippet;
|
|
@@ -31,6 +37,9 @@
|
|
|
31
37
|
rightBarResize = false,
|
|
32
38
|
rightBarMaxWidth = null,
|
|
33
39
|
rightBarMinWidth = null,
|
|
40
|
+
divider = true,
|
|
41
|
+
headerDivider = false,
|
|
42
|
+
bottomDivider = false,
|
|
34
43
|
header,
|
|
35
44
|
sidebar,
|
|
36
45
|
children,
|
|
@@ -51,17 +60,18 @@
|
|
|
51
60
|
<div class="header-area" style="height: {headerHeight}">
|
|
52
61
|
{@render header()}
|
|
53
62
|
</div>
|
|
63
|
+
{#if headerDivider}
|
|
64
|
+
<Split direction="horizontal"/>
|
|
65
|
+
{/if}
|
|
54
66
|
{/if}
|
|
55
67
|
<div class="middle-area">
|
|
56
68
|
{#if sidebar}
|
|
57
69
|
<div bind:this={sidebarPanel} class="sidebar" style="width: {sidebarWidth}; {maxWidth} {minWidth}">
|
|
58
|
-
{
|
|
59
|
-
{@render sidebar()}
|
|
60
|
-
{/if}
|
|
70
|
+
{@render sidebar()}
|
|
61
71
|
</div>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
{#if sidebarResize || divider}
|
|
73
|
+
<Split direction="vertical" bindingPanel={sidebarResize ? sidebarPanel : undefined} width={divider ? undefined : 0}/>
|
|
74
|
+
{/if}
|
|
65
75
|
{/if}
|
|
66
76
|
<div class="content-area">
|
|
67
77
|
{#if children}
|
|
@@ -69,17 +79,18 @@
|
|
|
69
79
|
{/if}
|
|
70
80
|
</div>
|
|
71
81
|
{#if rightSidebar}
|
|
72
|
-
{#if rightBarResize}
|
|
73
|
-
<Split direction="vertical" bindingPanel={rightBarPanel} reverse/>
|
|
82
|
+
{#if rightBarResize || divider}
|
|
83
|
+
<Split direction="vertical" bindingPanel={rightBarResize ? rightBarPanel : undefined} width={divider ? undefined : 0} reverse/>
|
|
74
84
|
{/if}
|
|
75
85
|
<div bind:this={rightBarPanel} class="right-sidebar" style="width: {rightBarWidth}; {rightMinWidth} {rightMaxWidth}">
|
|
76
|
-
{
|
|
77
|
-
{@render rightSidebar()}
|
|
78
|
-
{/if}
|
|
86
|
+
{@render rightSidebar()}
|
|
79
87
|
</div>
|
|
80
88
|
{/if}
|
|
81
89
|
</div>
|
|
82
90
|
{#if bottom}
|
|
91
|
+
{#if bottomDivider}
|
|
92
|
+
<Split direction="horizontal"/>
|
|
93
|
+
{/if}
|
|
83
94
|
<div class="bottom-area" style="height: {statusHeight}">
|
|
84
95
|
{@render bottom()}
|
|
85
96
|
</div>
|
|
@@ -10,6 +10,12 @@ interface Props {
|
|
|
10
10
|
rightBarResize?: boolean;
|
|
11
11
|
rightBarMaxWidth?: string | null;
|
|
12
12
|
rightBarMinWidth?: string | null;
|
|
13
|
+
/** 面板之间是否显示分割线,默认 true;与 *Resize(能否拖动)相互独立:可拖动但不显示线时,只在悬停 / 拖动时出现把手 */
|
|
14
|
+
divider?: boolean;
|
|
15
|
+
/** 头部与内容之间显示横向分割线,默认 false */
|
|
16
|
+
headerDivider?: boolean;
|
|
17
|
+
/** 内容与底部状态栏之间显示横向分割线,默认 false */
|
|
18
|
+
bottomDivider?: boolean;
|
|
13
19
|
header?: Snippet;
|
|
14
20
|
sidebar?: Snippet;
|
|
15
21
|
children?: Snippet;
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
rightMaxWidth?: string | null;
|
|
18
18
|
leftResize?: boolean;
|
|
19
19
|
rightResize?: boolean;
|
|
20
|
+
/** 面板之间是否显示分割线,默认 true;与 *Resize(能否拖动)相互独立:可拖动但不显示线时,只在悬停 / 拖动时出现把手 */
|
|
21
|
+
divider?: boolean;
|
|
20
22
|
left?: Snippet;
|
|
21
23
|
children?: Snippet;
|
|
22
24
|
right?: Snippet;
|
|
@@ -33,6 +35,7 @@
|
|
|
33
35
|
rightMaxWidth = null,
|
|
34
36
|
leftResize = false,
|
|
35
37
|
rightResize = false,
|
|
38
|
+
divider = true,
|
|
36
39
|
left,
|
|
37
40
|
children,
|
|
38
41
|
right
|
|
@@ -57,8 +60,8 @@
|
|
|
57
60
|
{@render left()}
|
|
58
61
|
{/if}
|
|
59
62
|
</div>
|
|
60
|
-
{#if leftResize}
|
|
61
|
-
<Split bindingPanel={leftPanel}/>
|
|
63
|
+
{#if leftResize || divider}
|
|
64
|
+
<Split bindingPanel={leftResize ? leftPanel : undefined} width={divider ? undefined : 0}/>
|
|
62
65
|
{/if}
|
|
63
66
|
<div class="center-panel">
|
|
64
67
|
{#if children}
|
|
@@ -66,8 +69,8 @@
|
|
|
66
69
|
{/if}
|
|
67
70
|
</div>
|
|
68
71
|
{#if right}
|
|
69
|
-
{#if rightResize}
|
|
70
|
-
<Split bindingPanel={rightPanel} reverse/>
|
|
72
|
+
{#if rightResize || divider}
|
|
73
|
+
<Split bindingPanel={rightResize ? rightPanel : undefined} width={divider ? undefined : 0} reverse/>
|
|
71
74
|
{/if}
|
|
72
75
|
<div bind:this={rightPanel} class="right-panel" style={rightStyle}>
|
|
73
76
|
{@render right()}
|
|
@@ -14,6 +14,8 @@ interface Props {
|
|
|
14
14
|
rightMaxWidth?: string | null;
|
|
15
15
|
leftResize?: boolean;
|
|
16
16
|
rightResize?: boolean;
|
|
17
|
+
/** 面板之间是否显示分割线,默认 true;与 *Resize(能否拖动)相互独立:可拖动但不显示线时,只在悬停 / 拖动时出现把手 */
|
|
18
|
+
divider?: boolean;
|
|
17
19
|
left?: Snippet;
|
|
18
20
|
children?: Snippet;
|
|
19
21
|
right?: Snippet;
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
sidebarResize?: boolean;
|
|
9
9
|
sidebarMaxWidth?: string | null;
|
|
10
10
|
sidebarMinWidth?: string | null;
|
|
11
|
+
/** 面板之间是否显示分割线,默认 true;与 *Resize(能否拖动)相互独立:可拖动但不显示线时,只在悬停 / 拖动时出现把手 */
|
|
12
|
+
divider?: boolean;
|
|
13
|
+
/** 头部与内容之间显示横向分割线,默认 false */
|
|
14
|
+
headerDivider?: boolean;
|
|
11
15
|
header?: Snippet;
|
|
12
16
|
sidebar?: Snippet;
|
|
13
17
|
children?: Snippet;
|
|
@@ -19,6 +23,8 @@
|
|
|
19
23
|
sidebarResize = false,
|
|
20
24
|
sidebarMaxWidth = null,
|
|
21
25
|
sidebarMinWidth = null,
|
|
26
|
+
divider = true,
|
|
27
|
+
headerDivider = false,
|
|
22
28
|
header,
|
|
23
29
|
sidebar,
|
|
24
30
|
children
|
|
@@ -34,6 +40,9 @@
|
|
|
34
40
|
<div class="header-area" style="height: {headerHeight}">
|
|
35
41
|
{@render header()}
|
|
36
42
|
</div>
|
|
43
|
+
{#if headerDivider}
|
|
44
|
+
<Split direction="horizontal"/>
|
|
45
|
+
{/if}
|
|
37
46
|
{/if}
|
|
38
47
|
<div class="content-wrapper">
|
|
39
48
|
{#if sidebar}
|
|
@@ -42,8 +51,8 @@
|
|
|
42
51
|
{@render sidebar()}
|
|
43
52
|
{/if}
|
|
44
53
|
</div>
|
|
45
|
-
{#if sidebarResize}
|
|
46
|
-
<Split direction="vertical" bindingPanel={sidebarPanel}/>
|
|
54
|
+
{#if sidebarResize || divider}
|
|
55
|
+
<Split direction="vertical" bindingPanel={sidebarResize ? sidebarPanel : undefined} width={divider ? undefined : 0}/>
|
|
47
56
|
{/if}
|
|
48
57
|
{/if}
|
|
49
58
|
<div class="main-content">
|
|
@@ -5,6 +5,10 @@ interface Props {
|
|
|
5
5
|
sidebarResize?: boolean;
|
|
6
6
|
sidebarMaxWidth?: string | null;
|
|
7
7
|
sidebarMinWidth?: string | null;
|
|
8
|
+
/** 面板之间是否显示分割线,默认 true;与 *Resize(能否拖动)相互独立:可拖动但不显示线时,只在悬停 / 拖动时出现把手 */
|
|
9
|
+
divider?: boolean;
|
|
10
|
+
/** 头部与内容之间显示横向分割线,默认 false */
|
|
11
|
+
headerDivider?: boolean;
|
|
8
12
|
header?: Snippet;
|
|
9
13
|
sidebar?: Snippet;
|
|
10
14
|
children?: Snippet;
|
|
@@ -38,7 +38,7 @@ npm install @ticatec/topside-elements
|
|
|
38
38
|
| **ColumnsLayout** | Left + center + right horizontal panels |
|
|
39
39
|
| **RowsLayout** | Top + center + bottom vertical panels |
|
|
40
40
|
|
|
41
|
-
All layouts accept `*Resize`
|
|
41
|
+
All layouts accept `*Resize` (draggable), `divider` (show line) and min/max constraints; panels without a corresponding snippet are not rendered.
|
|
42
42
|
|
|
43
43
|
---
|
|
44
44
|
|
|
@@ -51,6 +51,8 @@ Optional resizable sidebar on the left, plus a header area and content area stac
|
|
|
51
51
|
| Prop | Type | Default | Description |
|
|
52
52
|
|------|------|---------|-------------|
|
|
53
53
|
| `sidebarResize` | `boolean` | `false` | Enable sidebar resizing |
|
|
54
|
+
| `divider` | `boolean` | `true` | Show a divider line between panels; independent of `*Resize` |
|
|
55
|
+
| `headerDivider` | `boolean` | `false` | Show a horizontal line between header and content |
|
|
54
56
|
| `headerHeight` | `string` | `'48px'` | Height of the header area |
|
|
55
57
|
| `sidebarWidth` | `string` | `'300px'` | Initial width of the sidebar |
|
|
56
58
|
| `sidebarMaxWidth` | `string \| null` | `null` | Maximum sidebar width (only when `sidebarResize`) |
|
|
@@ -99,6 +101,8 @@ Header on top, with a sidebar + content area below the header.
|
|
|
99
101
|
| `headerHeight` | `string` | `'48px'` | Height of the header |
|
|
100
102
|
| `sidebarWidth` | `string` | `'300px'` | Width of the sidebar |
|
|
101
103
|
| `sidebarResize` | `boolean` | `false` | Enable sidebar resizing |
|
|
104
|
+
| `divider` | `boolean` | `true` | Show a divider line between panels; independent of `*Resize` |
|
|
105
|
+
| `headerDivider` | `boolean` | `false` | Show a horizontal line between header and content |
|
|
102
106
|
| `sidebarMaxWidth` | `string \| null` | `null` | Maximum sidebar width (only when `sidebarResize`) |
|
|
103
107
|
| `sidebarMinWidth` | `string \| null` | `null` | Minimum sidebar width (only when `sidebarResize`) |
|
|
104
108
|
|
|
@@ -145,6 +149,9 @@ Traditional desktop application layout: header, left sidebar, content area, opti
|
|
|
145
149
|
| `sidebarMaxWidth` | `string \| null` | `null` | Maximum left sidebar width (only when `sidebarResize`) |
|
|
146
150
|
| `sidebarMinWidth` | `string \| null` | `null` | Minimum left sidebar width (only when `sidebarResize`) |
|
|
147
151
|
| `rightBarResize` | `boolean` | `false` | Enable right sidebar resizing |
|
|
152
|
+
| `divider` | `boolean` | `true` | Show a divider line between panels; independent of `*Resize` |
|
|
153
|
+
| `headerDivider` | `boolean` | `false` | Show a horizontal line between header and content |
|
|
154
|
+
| `bottomDivider` | `boolean` | `false` | Show a horizontal line between content and status bar |
|
|
148
155
|
| `rightBarMaxWidth` | `string \| null` | `null` | Maximum right sidebar width (only when `rightBarResize`) |
|
|
149
156
|
| `rightBarMinWidth` | `string \| null` | `null` | Minimum right sidebar width (only when `rightBarResize`) |
|
|
150
157
|
|
|
@@ -207,6 +214,7 @@ Three-column horizontal layout: left + center + right. Center fills remaining sp
|
|
|
207
214
|
| `rightMaxWidth` | `string \| null` | `null` | Right column max-width |
|
|
208
215
|
| `leftResize` | `boolean` | `false` | Enable left column resizing |
|
|
209
216
|
| `rightResize` | `boolean` | `false` | Enable right column resizing |
|
|
217
|
+
| `divider` | `boolean` | `true` | Show a divider line between panels; independent of `*Resize` |
|
|
210
218
|
|
|
211
219
|
### Snippets
|
|
212
220
|
|
|
@@ -260,6 +268,7 @@ Three-row vertical layout: top + center + bottom. Center fills remaining space;
|
|
|
260
268
|
| `bottomMaxHeight` | `string \| null` | `null` | Bottom row max-height |
|
|
261
269
|
| `topResize` | `boolean` | `false` | Enable top row resizing |
|
|
262
270
|
| `bottomResize` | `boolean` | `false` | Enable bottom row resizing |
|
|
271
|
+
| `divider` | `boolean` | `true` | Show a divider line between panels; independent of `*Resize` |
|
|
263
272
|
|
|
264
273
|
### Snippets
|
|
265
274
|
|
|
@@ -295,6 +304,19 @@ Three-row vertical layout: top + center + bottom. Center fills remaining space;
|
|
|
295
304
|
|
|
296
305
|
---
|
|
297
306
|
|
|
307
|
+
## Dividers
|
|
308
|
+
|
|
309
|
+
Lines between panels are rendered by [Split](../general/split/README.md). `divider` and `*Resize` are independent switches:
|
|
310
|
+
|
|
311
|
+
| `*Resize` | `divider` | Result |
|
|
312
|
+
|---|---|---|
|
|
313
|
+
| `false` | `true` (default) | Fixed 1px line, not draggable |
|
|
314
|
+
| `true` | `true` | 1px line; a handle appears on hover; draggable |
|
|
315
|
+
| `true` | `false` | No visible line (0px), still draggable near the edge; handle on hover / drag |
|
|
316
|
+
| `false` | `false` | No divider |
|
|
317
|
+
|
|
318
|
+
SidebarLayout / HeaderLayout / ClassicLayout also have `headerDivider` (line below the header), and ClassicLayout has `bottomDivider` (line above the status bar); both default to off, since headers and status bars usually have their own background or border. Line color comes from `--topside-dividing-line-color`.
|
|
319
|
+
|
|
298
320
|
## Resizable Panels
|
|
299
321
|
|
|
300
322
|
When `*Resize` is enabled, a split handle is rendered between the panel and the center area:
|
|
@@ -38,7 +38,7 @@ npm install @ticatec/topside-elements
|
|
|
38
38
|
| **ColumnsLayout** | 左 + 中 + 右 三列水平布局 |
|
|
39
39
|
| **RowsLayout** | 上 + 中 + 下 三行垂直布局 |
|
|
40
40
|
|
|
41
|
-
所有布局都支持 `*Resize
|
|
41
|
+
所有布局都支持 `*Resize`(能否拖动)、`divider`(是否显示分割线)和 min/max 约束;未提供对应 snippet 的面板不会被渲染。
|
|
42
42
|
|
|
43
43
|
---
|
|
44
44
|
|
|
@@ -51,6 +51,8 @@ npm install @ticatec/topside-elements
|
|
|
51
51
|
| 属性 | 类型 | 默认值 | 描述 |
|
|
52
52
|
|------|------|---------|-------------|
|
|
53
53
|
| `sidebarResize` | `boolean` | `false` | 启用侧边栏调整大小 |
|
|
54
|
+
| `divider` | `boolean` | `true` | 面板之间是否显示分割线;与 `*Resize` 独立 |
|
|
55
|
+
| `headerDivider` | `boolean` | `false` | 顶栏与内容之间显示横向分割线 |
|
|
54
56
|
| `headerHeight` | `string` | `"48px"` | 标题区域高度 |
|
|
55
57
|
| `sidebarWidth` | `string` | `"300px"` | 侧边栏初始宽度 |
|
|
56
58
|
| `sidebarMaxWidth` | `string \| null` | `null` | 侧边栏最大宽度(仅当 `sidebarResize` 为真时生效) |
|
|
@@ -99,6 +101,8 @@ npm install @ticatec/topside-elements
|
|
|
99
101
|
| `headerHeight` | `string` | `"48px"` | 标题栏高度 |
|
|
100
102
|
| `sidebarWidth` | `string` | `"300px"` | 侧边栏宽度 |
|
|
101
103
|
| `sidebarResize` | `boolean` | `false` | 启用侧边栏调整大小 |
|
|
104
|
+
| `divider` | `boolean` | `true` | 面板之间是否显示分割线;与 `*Resize` 独立 |
|
|
105
|
+
| `headerDivider` | `boolean` | `false` | 顶栏与内容之间显示横向分割线 |
|
|
102
106
|
| `sidebarMaxWidth` | `string \| null` | `null` | 侧边栏最大宽度(仅当 `sidebarResize` 为真时生效) |
|
|
103
107
|
| `sidebarMinWidth` | `string \| null` | `null` | 侧边栏最小宽度(仅当 `sidebarResize` 为真时生效) |
|
|
104
108
|
|
|
@@ -145,6 +149,9 @@ npm install @ticatec/topside-elements
|
|
|
145
149
|
| `sidebarMaxWidth` | `string \| null` | `null` | 左侧边栏最大宽度(仅当 `sidebarResize` 为真时生效) |
|
|
146
150
|
| `sidebarMinWidth` | `string \| null` | `null` | 左侧边栏最小宽度(仅当 `sidebarResize` 为真时生效) |
|
|
147
151
|
| `rightBarResize` | `boolean` | `false` | 启用右侧边栏调整大小 |
|
|
152
|
+
| `divider` | `boolean` | `true` | 面板之间是否显示分割线;与 `*Resize` 独立 |
|
|
153
|
+
| `headerDivider` | `boolean` | `false` | 顶栏与内容之间显示横向分割线 |
|
|
154
|
+
| `bottomDivider` | `boolean` | `false` | 内容与状态栏之间显示横向分割线 |
|
|
148
155
|
| `rightBarMaxWidth` | `string \| null` | `null` | 右侧边栏最大宽度(仅当 `rightBarResize` 为真时生效) |
|
|
149
156
|
| `rightBarMinWidth` | `string \| null` | `null` | 右侧边栏最小宽度(仅当 `rightBarResize` 为真时生效) |
|
|
150
157
|
|
|
@@ -207,6 +214,7 @@ npm install @ticatec/topside-elements
|
|
|
207
214
|
| `rightMaxWidth` | `string \| null` | `null` | 右列最大宽度 |
|
|
208
215
|
| `leftResize` | `boolean` | `false` | 启用左列调整大小 |
|
|
209
216
|
| `rightResize` | `boolean` | `false` | 启用右列调整大小 |
|
|
217
|
+
| `divider` | `boolean` | `true` | 面板之间是否显示分割线;与 `*Resize` 独立 |
|
|
210
218
|
|
|
211
219
|
### Snippets
|
|
212
220
|
|
|
@@ -260,6 +268,7 @@ npm install @ticatec/topside-elements
|
|
|
260
268
|
| `bottomMaxHeight` | `string \| null` | `null` | 底部行最大高度 |
|
|
261
269
|
| `topResize` | `boolean` | `false` | 启用顶部行调整大小 |
|
|
262
270
|
| `bottomResize` | `boolean` | `false` | 启用底部行调整大小 |
|
|
271
|
+
| `divider` | `boolean` | `true` | 面板之间是否显示分割线;与 `*Resize` 独立 |
|
|
263
272
|
|
|
264
273
|
### Snippets
|
|
265
274
|
|
|
@@ -295,6 +304,19 @@ npm install @ticatec/topside-elements
|
|
|
295
304
|
|
|
296
305
|
---
|
|
297
306
|
|
|
307
|
+
## 分割线
|
|
308
|
+
|
|
309
|
+
面板之间的分割线由 [Split](../general/split/README_CN.md) 渲染,`divider` 与 `*Resize` 是两个独立的开关:
|
|
310
|
+
|
|
311
|
+
| `*Resize` | `divider` | 效果 |
|
|
312
|
+
|---|---|---|
|
|
313
|
+
| `false` | `true`(默认) | 固定的 1px 分割线,不可拖动 |
|
|
314
|
+
| `true` | `true` | 1px 分割线,悬停时中间出现把手,可拖动 |
|
|
315
|
+
| `true` | `false` | 不显示线(0px),靠近边界仍可拖动,悬停 / 拖动时出现把手 |
|
|
316
|
+
| `false` | `false` | 无分割线 |
|
|
317
|
+
|
|
318
|
+
SidebarLayout / HeaderLayout / ClassicLayout 另有 `headerDivider`(顶栏下方横线),ClassicLayout 还有 `bottomDivider`(状态栏上方横线),默认都关闭——顶栏和状态栏通常自带底色或边框。线条颜色由 `--topside-dividing-line-color` 控制。
|
|
319
|
+
|
|
298
320
|
## 可调整面板
|
|
299
321
|
|
|
300
322
|
当 `*Resize` 启用时,面板与中央区域之间会渲染一个拖动手柄:
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
bottomMaxHeight?: string | null;
|
|
18
18
|
topResize?: boolean;
|
|
19
19
|
bottomResize?: boolean;
|
|
20
|
+
/** 面板之间是否显示分割线,默认 true;与 *Resize(能否拖动)相互独立:可拖动但不显示线时,只在悬停 / 拖动时出现把手 */
|
|
21
|
+
divider?: boolean;
|
|
20
22
|
top?: Snippet;
|
|
21
23
|
children?: Snippet;
|
|
22
24
|
bottom?: Snippet;
|
|
@@ -33,6 +35,7 @@
|
|
|
33
35
|
bottomMaxHeight = null,
|
|
34
36
|
topResize = false,
|
|
35
37
|
bottomResize = false,
|
|
38
|
+
divider = true,
|
|
36
39
|
top,
|
|
37
40
|
children,
|
|
38
41
|
bottom
|
|
@@ -57,8 +60,8 @@
|
|
|
57
60
|
{@render top()}
|
|
58
61
|
{/if}
|
|
59
62
|
</div>
|
|
60
|
-
{#if topResize}
|
|
61
|
-
<Split bindingPanel={topPanel} direction="horizontal"/>
|
|
63
|
+
{#if topResize || divider}
|
|
64
|
+
<Split bindingPanel={topResize ? topPanel : undefined} width={divider ? undefined : 0} direction="horizontal"/>
|
|
62
65
|
{/if}
|
|
63
66
|
<div class="center-panel">
|
|
64
67
|
{#if children}
|
|
@@ -66,8 +69,8 @@
|
|
|
66
69
|
{/if}
|
|
67
70
|
</div>
|
|
68
71
|
{#if bottom}
|
|
69
|
-
{#if bottomResize}
|
|
70
|
-
<Split bindingPanel={bottomPanel} reverse direction="horizontal"/>
|
|
72
|
+
{#if bottomResize || divider}
|
|
73
|
+
<Split bindingPanel={bottomResize ? bottomPanel : undefined} width={divider ? undefined : 0} reverse direction="horizontal"/>
|
|
71
74
|
{/if}
|
|
72
75
|
<div bind:this={bottomPanel} class="bottom-panel" style={bottomStyle}>
|
|
73
76
|
{@render bottom()}
|
|
@@ -14,6 +14,8 @@ interface Props {
|
|
|
14
14
|
bottomMaxHeight?: string | null;
|
|
15
15
|
topResize?: boolean;
|
|
16
16
|
bottomResize?: boolean;
|
|
17
|
+
/** 面板之间是否显示分割线,默认 true;与 *Resize(能否拖动)相互独立:可拖动但不显示线时,只在悬停 / 拖动时出现把手 */
|
|
18
|
+
divider?: boolean;
|
|
17
19
|
top?: Snippet;
|
|
18
20
|
children?: Snippet;
|
|
19
21
|
bottom?: Snippet;
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
sidebarWidth?: string;
|
|
9
9
|
sidebarMaxWidth?: string | null;
|
|
10
10
|
sidebarMinWidth?: string | null;
|
|
11
|
+
/** 面板之间是否显示分割线,默认 true;与 *Resize(能否拖动)相互独立:可拖动但不显示线时,只在悬停 / 拖动时出现把手 */
|
|
12
|
+
divider?: boolean;
|
|
13
|
+
/** 头部与内容之间显示横向分割线,默认 false */
|
|
14
|
+
headerDivider?: boolean;
|
|
11
15
|
sidebar?: Snippet;
|
|
12
16
|
header?: Snippet;
|
|
13
17
|
children?: Snippet;
|
|
@@ -19,6 +23,8 @@
|
|
|
19
23
|
sidebarWidth = '300px',
|
|
20
24
|
sidebarMaxWidth = null,
|
|
21
25
|
sidebarMinWidth = null,
|
|
26
|
+
divider = true,
|
|
27
|
+
headerDivider = false,
|
|
22
28
|
sidebar,
|
|
23
29
|
header,
|
|
24
30
|
children
|
|
@@ -36,8 +42,8 @@
|
|
|
36
42
|
{@render sidebar()}
|
|
37
43
|
{/if}
|
|
38
44
|
</div>
|
|
39
|
-
{#if sidebarResize}
|
|
40
|
-
<Split direction="vertical" bindingPanel={sidebarPanel}/>
|
|
45
|
+
{#if sidebarResize || divider}
|
|
46
|
+
<Split direction="vertical" bindingPanel={sidebarResize ? sidebarPanel : undefined} width={divider ? undefined : 0}/>
|
|
41
47
|
{/if}
|
|
42
48
|
{/if}
|
|
43
49
|
<div class="main-content">
|
|
@@ -45,6 +51,9 @@
|
|
|
45
51
|
<div class="header-area" style="height: {headerHeight}">
|
|
46
52
|
{@render header()}
|
|
47
53
|
</div>
|
|
54
|
+
{#if headerDivider}
|
|
55
|
+
<Split direction="horizontal"/>
|
|
56
|
+
{/if}
|
|
48
57
|
{/if}
|
|
49
58
|
<div class="content-area">
|
|
50
59
|
{#if children}
|
|
@@ -5,6 +5,10 @@ interface Props {
|
|
|
5
5
|
sidebarWidth?: string;
|
|
6
6
|
sidebarMaxWidth?: string | null;
|
|
7
7
|
sidebarMinWidth?: string | null;
|
|
8
|
+
/** 面板之间是否显示分割线,默认 true;与 *Resize(能否拖动)相互独立:可拖动但不显示线时,只在悬停 / 拖动时出现把手 */
|
|
9
|
+
divider?: boolean;
|
|
10
|
+
/** 头部与内容之间显示横向分割线,默认 false */
|
|
11
|
+
headerDivider?: boolean;
|
|
8
12
|
sidebar?: Snippet;
|
|
9
13
|
header?: Snippet;
|
|
10
14
|
children?: Snippet;
|