@ticatec/uniface-element 0.2.3 → 0.3.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/dist/accordion/README.md +169 -0
- package/dist/accordion/README_CN.md +176 -0
- package/dist/action-bar/README.md +275 -0
- package/dist/action-bar/README_CN.md +285 -0
- package/dist/app-layout/README.md +374 -0
- package/dist/app-layout/README_CN.md +381 -0
- package/dist/app-top-bar/README.md +357 -0
- package/dist/app-top-bar/README_CN.md +365 -0
- package/dist/attachment-files/AttachmentFilesField.svelte +67 -1
- package/dist/attachment-files/AttachmentFilesField.svelte.d.ts +8 -1
- package/dist/base-calendar/CalendarBase.svelte +0 -3
- package/dist/box/README.md +385 -0
- package/dist/box/README_CN.md +393 -0
- package/dist/breadcrumbs/README.md +442 -0
- package/dist/breadcrumbs/README_CN.md +442 -0
- package/dist/button/Button.svelte +27 -7
- package/dist/button/Button.svelte.d.ts +3 -1
- package/dist/button/IconButton.svelte +26 -6
- package/dist/button/IconButton.svelte.d.ts +3 -1
- package/dist/button/IconButton_README.md +513 -0
- package/dist/button/IconButton_README_CN.md +513 -0
- package/dist/button/README.md +428 -0
- package/dist/button/README_CN.md +428 -0
- package/dist/button/TextButton.svelte +26 -6
- package/dist/button/TextButton.svelte.d.ts +3 -1
- package/dist/button/TextButton_README.md +571 -0
- package/dist/button/TextButton_README_CN.md +571 -0
- package/dist/card/README.md +666 -0
- package/dist/card/README_CN.md +666 -0
- package/dist/cascade-options-select/CascadeOptionSelect.svelte +43 -7
- package/dist/cascade-options-select/CascadeOptionSelect.svelte.d.ts +3 -4
- package/dist/cascade-options-select/README.md +663 -2
- package/dist/cascade-options-select/README_CN.md +664 -0
- package/dist/checkbox/CheckBox.svelte +20 -6
- package/dist/checkbox/CheckBox.svelte.d.ts +4 -2
- package/dist/checkbox/README.md +562 -0
- package/dist/checkbox/README_CN.md +727 -0
- package/dist/common-editor/NumberInput.svelte +39 -26
- package/dist/common-editor/NumberInput.svelte.d.ts +5 -1
- package/dist/concise-data-table/ConciseListTable.svelte +133 -36
- package/dist/concise-data-table/ConciseListTable.svelte.d.ts +8 -1
- package/dist/concise-data-table/DataCell.svelte +5 -6
- package/dist/concise-data-table/DataRow.svelte +22 -2
- package/dist/concise-data-table/DataRow.svelte.d.ts +1 -0
- package/dist/concise-data-table/README.md +606 -0
- package/dist/concise-data-table/README_CN.md +611 -0
- package/dist/context-menu/ContextMenu.svelte +138 -21
- package/dist/context-menu/ContextMenu.svelte.d.ts +5 -0
- package/dist/context-menu/ContextMenuItem.d.ts +20 -4
- package/dist/context-menu/README.md +551 -0
- package/dist/context-menu/README_CN.md +551 -0
- package/dist/criteria-field/CriteriaField.svelte +3 -5
- package/dist/criteria-field/README.md +532 -0
- package/dist/criteria-field/README_CN.md +532 -0
- package/dist/data-table/README.md +712 -0
- package/dist/data-table/README_CN.md +712 -0
- package/dist/date-picker/DatePicker.svelte +44 -7
- package/dist/date-picker/DatePicker.svelte.d.ts +3 -4
- package/dist/date-picker/DateTimePicker.svelte +32 -8
- package/dist/date-picker/DateTimePicker.svelte.d.ts +3 -4
- package/dist/date-picker/README.md +326 -0
- package/dist/date-picker/README_CN.md +316 -0
- package/dist/date-picker/ScrollBar.svelte +18 -8
- package/dist/date-picker/ScrollBar.svelte.d.ts +1 -1
- package/dist/date-picker/TimePanel.svelte +5 -5
- package/dist/date-picker/TimePanel.svelte.d.ts +1 -1
- package/dist/date-range/README.md +374 -0
- package/dist/date-range/README_CN.md +374 -0
- package/dist/dialog/DialogBoard.svelte +1 -1
- package/dist/dialog/README.md +596 -0
- package/dist/dialog/README_CN.md +596 -0
- package/dist/drawer/README.md +679 -1
- package/dist/drawer/README_CN.md +679 -0
- package/dist/group-box/group-check-box/GroupCheckBox.svelte +62 -5
- package/dist/group-box/group-check-box/GroupCheckBox.svelte.d.ts +7 -2
- package/dist/group-box/group-check-box/README.md +749 -0
- package/dist/group-box/group-check-box/README_CN.md +750 -0
- package/dist/group-box/group-radio-box/GroupRadioBox.svelte +69 -4
- package/dist/group-box/group-radio-box/GroupRadioBox.svelte.d.ts +8 -2
- package/dist/group-box/group-radio-box/README.md +920 -0
- package/dist/group-box/group-radio-box/README_CN.md +920 -0
- package/dist/image-files/README.md +1346 -0
- package/dist/image-files/README_CN.md +1346 -0
- package/dist/input-options-select/InputOptionsSelect.svelte +161 -65
- package/dist/input-options-select/InputOptionsSelect.svelte.d.ts +4 -1
- package/dist/lib/forwardAllEvents.d.ts +3 -0
- package/dist/lib/forwardAllEvents.js +24 -0
- package/dist/list-box/README.md +579 -0
- package/dist/list-box/README_CN.md +682 -0
- package/dist/lookup-editor/LookupEditor.svelte +15 -3
- package/dist/lookup-editor/LookupEditor.svelte.d.ts +3 -4
- package/dist/lookup-editor/README.md +684 -0
- package/dist/lookup-editor/README_CN.md +684 -0
- package/dist/memo-editor/MemoEditor.svelte +77 -27
- package/dist/memo-editor/MemoEditor.svelte.d.ts +6 -3
- package/dist/memo-editor/README.md +819 -0
- package/dist/memo-editor/README_CN.md +819 -0
- package/dist/message-box/README.md +398 -0
- package/dist/message-box/README_CN.md +398 -0
- package/dist/number-editor/NumberEditor.svelte +2 -2
- package/dist/number-editor/NumberEditor.svelte.d.ts +1 -1
- package/dist/number-editor/README.md +353 -22
- package/dist/number-editor/README_CN.md +357 -0
- package/dist/number-range/README.md +443 -0
- package/dist/number-range/README_CN.md +443 -0
- package/dist/options-multi-select/OptionsMultiSelect.svelte +87 -12
- package/dist/options-multi-select/OptionsMultiSelect.svelte.d.ts +3 -1
- package/dist/options-multi-select/README.md +480 -0
- package/dist/options-multi-select/README_CN.md +480 -0
- package/dist/options-select/OptionsSelect.svelte +36 -5
- package/dist/options-select/OptionsSelect.svelte.d.ts +3 -4
- package/dist/options-select/README.md +632 -0
- package/dist/options-select/README_CN.md +632 -0
- package/dist/page/README.md +605 -0
- package/dist/page/README_CN.md +605 -0
- package/dist/pagination/README.md +946 -0
- package/dist/pagination/README_CN.md +946 -0
- package/dist/pagination-panel/README.md +1075 -0
- package/dist/pagination-panel/README_CN.md +1075 -0
- package/dist/popup-hint/README.md +841 -0
- package/dist/popup-hint/README_CN.md +840 -0
- package/dist/progress-bar/README.md +242 -0
- package/dist/progress-bar/README_CN.md +242 -0
- package/dist/progress-step-bar/README.md +316 -0
- package/dist/progress-step-bar/README_CN.md +316 -0
- package/dist/prompts-text-editor/PromptsTextEditor.svelte +6 -3
- package/dist/prompts-text-editor/PromptsTextEditor.svelte.d.ts +3 -1
- package/dist/prompts-text-editor/README.md +329 -0
- package/dist/prompts-text-editor/README_CN.md +329 -0
- package/dist/property-editor/README.md +969 -0
- package/dist/property-editor/README_CN.md +969 -0
- package/dist/radio-button/README.md +372 -0
- package/dist/radio-button/README_CN.md +372 -0
- package/dist/radio-button/RadioButton.svelte +32 -3
- package/dist/radio-button/RadioButton.svelte.d.ts +12 -1
- package/dist/search-box/README.md +425 -0
- package/dist/search-box/README_CN.md +424 -0
- package/dist/search-box/SearchBox.svelte +22 -6
- package/dist/search-box/SearchBox.svelte.d.ts +4 -1
- package/dist/tabs/README.md +919 -0
- package/dist/tabs/README_CN.md +920 -0
- package/dist/tag/README.md +922 -0
- package/dist/tag/README_CN.md +922 -0
- package/dist/text-editor/PasswordEditor.svelte +17 -2
- package/dist/text-editor/PasswordEditor.svelte.d.ts +3 -3
- package/dist/text-editor/PasswordEditor_README.md +551 -0
- package/dist/text-editor/PasswordEditor_README_CN.md +551 -0
- package/dist/text-editor/README.md +466 -0
- package/dist/text-editor/README_CN.md +466 -0
- package/dist/text-editor/TextEditor.svelte +51 -19
- package/dist/text-editor/TextEditor.svelte.d.ts +0 -1
- package/dist/ticatec-uniface-web.css +1 -0
- package/dist/time-editor/README.md +498 -24
- package/dist/time-editor/README_CN.md +498 -0
- package/dist/time-editor/TimeEditor.svelte +7 -3
- package/dist/time-editor/TimeEditor.svelte.d.ts +3 -1
- package/dist/toast/README.md +667 -0
- package/dist/toast/README_CN.md +667 -0
- package/dist/transfer/README.md +795 -0
- package/dist/transfer/Transfer.svelte +6 -4
- package/dist/transfer/Transfer.svelte.d.ts +3 -1
- package/dist/tree-view/README.md +761 -0
- package/dist/tree-view/README_CN.md +761 -0
- package/dist/tree-view/TreeView.svelte +5 -3
- package/dist/tree-view/TreeView.svelte.d.ts +3 -1
- package/dist/unit-number-editor/README.md +546 -20
- package/dist/unit-number-editor/README_CN.md +525 -0
- package/dist/unit-number-editor/UnitNumberEditor.svelte +62 -8
- package/dist/unit-number-editor/UnitNumberEditor.svelte.d.ts +5 -1
- package/docs/form-field/cn/README_CN.md +364 -0
- package/docs/form-field/en/README.md +364 -0
- package/docs/form-panel/flex-form/cn/README_CN.md +586 -0
- package/docs/form-panel/flex-form/en/README.md +586 -0
- package/docs/form-panel/flex-row-form/cn/README_CN.md +787 -0
- package/docs/form-panel/flex-row-form/en/README.md +787 -0
- package/docs/form-panel/grid-form/en/README.md +744 -0
- package/package.json +1 -1
- package/dist/drawer/README-CN.md +0 -1
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# ActionBar 组件
|
|
2
|
+
|
|
3
|
+
一个灵活的操作栏组件,用于组织和显示操作按钮,支持可选的分隔符。
|
|
4
|
+
|
|
5
|
+
## 功能特性
|
|
6
|
+
|
|
7
|
+
- **按钮组织**: 在水平布局中显示多个操作按钮
|
|
8
|
+
- **灵活配置**: 通过数据定义按钮或使用插槽内容
|
|
9
|
+
- **分隔符**: 使用`null`值在按钮组之间添加视觉分隔符
|
|
10
|
+
- **可定制样式**: 控制间距和应用自定义样式
|
|
11
|
+
- **按钮类型**: 支持所有按钮类型(主要、次要、危险等)
|
|
12
|
+
- **图标支持**: 在按钮标签旁显示图标
|
|
13
|
+
- **禁用状态**: 单个按钮禁用功能
|
|
14
|
+
- **响应式**: 适应容器宽度
|
|
15
|
+
|
|
16
|
+
## 基本用法
|
|
17
|
+
|
|
18
|
+
```svelte
|
|
19
|
+
<script>
|
|
20
|
+
import ActionBar, { type ButtonAction } from '@ticatec/uniface-element/ActionBar';
|
|
21
|
+
|
|
22
|
+
const actions: ButtonAction[] = [
|
|
23
|
+
{
|
|
24
|
+
label: '保存',
|
|
25
|
+
type: 'primary',
|
|
26
|
+
icon: 'icon_google_save',
|
|
27
|
+
handler: () => console.log('保存被点击')
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: '取消',
|
|
31
|
+
type: 'secondary',
|
|
32
|
+
handler: () => console.log('取消被点击')
|
|
33
|
+
}
|
|
34
|
+
];
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<ActionBar buttons={actions} />
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 属性参数
|
|
41
|
+
|
|
42
|
+
| 属性 | 类型 | 默认值 | 描述 |
|
|
43
|
+
|------|------|---------|-------------|
|
|
44
|
+
| `buttons` | `ButtonActions` | `[]` | 按钮操作数组或null表示分隔符 |
|
|
45
|
+
| `style` | `string` | `''` | 操作栏的自定义CSS样式 |
|
|
46
|
+
| `gap` | `number` | `8` | 按钮间距(像素) |
|
|
47
|
+
|
|
48
|
+
## ButtonAction 接口
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
interface ButtonAction {
|
|
52
|
+
label: string; // 按钮文本
|
|
53
|
+
disabled?: boolean; // 按钮是否禁用
|
|
54
|
+
icon?: string; // 图标类名(可选)
|
|
55
|
+
type?: ButtonType; // 按钮样式类型
|
|
56
|
+
handler?: MouseClickHandler; // 点击事件处理器
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
type ButtonActions = Array<ButtonAction | null>;
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## ButtonType 选项
|
|
63
|
+
|
|
64
|
+
组件支持所有标准按钮类型:
|
|
65
|
+
- `'primary'` - 主要操作按钮
|
|
66
|
+
- `'secondary'` - 次要操作按钮
|
|
67
|
+
- `'danger'` - 危险/删除操作按钮
|
|
68
|
+
- `'success'` - 成功/确认按钮
|
|
69
|
+
- `'warning'` - 警告按钮
|
|
70
|
+
- `'info'` - 信息按钮
|
|
71
|
+
|
|
72
|
+
## 使用示例
|
|
73
|
+
|
|
74
|
+
### 基础操作栏
|
|
75
|
+
|
|
76
|
+
```svelte
|
|
77
|
+
<script>
|
|
78
|
+
const basicActions = [
|
|
79
|
+
{ label: '新建', handler: createNew },
|
|
80
|
+
{ label: '编辑', handler: editItem },
|
|
81
|
+
{ label: '删除', type: 'danger', handler: deleteItem }
|
|
82
|
+
];
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<ActionBar buttons={basicActions} />
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 带图标
|
|
89
|
+
|
|
90
|
+
```svelte
|
|
91
|
+
<script>
|
|
92
|
+
const iconActions = [
|
|
93
|
+
{
|
|
94
|
+
label: '保存',
|
|
95
|
+
icon: 'icon_google_save',
|
|
96
|
+
type: 'primary',
|
|
97
|
+
handler: save
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: '打印',
|
|
101
|
+
icon: 'icon_google_print',
|
|
102
|
+
handler: print
|
|
103
|
+
}
|
|
104
|
+
];
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<ActionBar buttons={iconActions} />
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 带分隔符
|
|
111
|
+
|
|
112
|
+
```svelte
|
|
113
|
+
<script>
|
|
114
|
+
const actionsWithSeparators = [
|
|
115
|
+
{ label: '复制', handler: copy },
|
|
116
|
+
{ label: '粘贴', handler: paste },
|
|
117
|
+
null, // 分隔符
|
|
118
|
+
{ label: '删除', type: 'danger', handler: remove }
|
|
119
|
+
];
|
|
120
|
+
</script>
|
|
121
|
+
|
|
122
|
+
<ActionBar buttons={actionsWithSeparators} />
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### 自定义间距
|
|
126
|
+
|
|
127
|
+
```svelte
|
|
128
|
+
<ActionBar
|
|
129
|
+
buttons={actions}
|
|
130
|
+
gap={16}
|
|
131
|
+
style="padding: 12px; background: #f5f5f5;"
|
|
132
|
+
/>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 使用插槽内容
|
|
136
|
+
|
|
137
|
+
```svelte
|
|
138
|
+
<ActionBar>
|
|
139
|
+
<Button label="自定义" type="primary" />
|
|
140
|
+
<Button label="操作" type="secondary" />
|
|
141
|
+
</ActionBar>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## 动态操作
|
|
145
|
+
|
|
146
|
+
```svelte
|
|
147
|
+
<script>
|
|
148
|
+
let isEditing = false;
|
|
149
|
+
|
|
150
|
+
$: actions = isEditing ? [
|
|
151
|
+
{ label: '保存', type: 'primary', handler: save },
|
|
152
|
+
{ label: '取消', handler: cancel }
|
|
153
|
+
] : [
|
|
154
|
+
{ label: '编辑', handler: startEdit },
|
|
155
|
+
{ label: '删除', type: 'danger', handler: remove }
|
|
156
|
+
];
|
|
157
|
+
</script>
|
|
158
|
+
|
|
159
|
+
<ActionBar buttons={actions} />
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## 条件按钮
|
|
163
|
+
|
|
164
|
+
```svelte
|
|
165
|
+
<script>
|
|
166
|
+
let hasPermission = true;
|
|
167
|
+
let isLoading = false;
|
|
168
|
+
|
|
169
|
+
$: actions = [
|
|
170
|
+
{ label: '刷新', handler: refresh },
|
|
171
|
+
hasPermission ? {
|
|
172
|
+
label: '保存',
|
|
173
|
+
type: 'primary',
|
|
174
|
+
disabled: isLoading,
|
|
175
|
+
handler: save
|
|
176
|
+
} : null,
|
|
177
|
+
hasPermission ? {
|
|
178
|
+
label: '删除',
|
|
179
|
+
type: 'danger',
|
|
180
|
+
disabled: isLoading,
|
|
181
|
+
handler: remove
|
|
182
|
+
} : null
|
|
183
|
+
].filter(Boolean); // 移除null值
|
|
184
|
+
</script>
|
|
185
|
+
|
|
186
|
+
<ActionBar buttons={actions} />
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## 行为特性
|
|
190
|
+
|
|
191
|
+
### 按钮渲染
|
|
192
|
+
- 按钮使用内部Button组件渲染
|
|
193
|
+
- 每个按钮接收配置的标签、图标、类型和禁用状态
|
|
194
|
+
- 点击处理器自动绑定到按钮事件
|
|
195
|
+
|
|
196
|
+
### 分隔符
|
|
197
|
+
- 在按钮数组中使用`null`值插入视觉分隔符
|
|
198
|
+
- 分隔符显示为24px高度的垂直线
|
|
199
|
+
- 用于分组相关操作
|
|
200
|
+
|
|
201
|
+
### 回退内容
|
|
202
|
+
- 如果没有提供按钮或数组为空,显示插槽内容
|
|
203
|
+
- 允许完全自定义的操作栏布局
|
|
204
|
+
|
|
205
|
+
## 样式定制
|
|
206
|
+
|
|
207
|
+
组件使用以下CSS类:
|
|
208
|
+
|
|
209
|
+
- `.uniface-action-bar` - 主容器,使用flexbox布局
|
|
210
|
+
|
|
211
|
+
### CSS变量
|
|
212
|
+
|
|
213
|
+
您可以使用CSS自定义外观:
|
|
214
|
+
|
|
215
|
+
```css
|
|
216
|
+
.uniface-action-bar {
|
|
217
|
+
/* 自定义样式 */
|
|
218
|
+
background: #ffffff;
|
|
219
|
+
border: 1px solid #e0e0e0;
|
|
220
|
+
border-radius: 4px;
|
|
221
|
+
padding: 8px;
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## 无障碍访问
|
|
226
|
+
|
|
227
|
+
- 使用语义化按钮元素以支持正确的键盘导航
|
|
228
|
+
- 禁用按钮正确标记且不可交互
|
|
229
|
+
- 焦点管理遵循标准按钮行为
|
|
230
|
+
- 屏幕阅读器可以正确识别操作按钮
|
|
231
|
+
|
|
232
|
+
## 常见用例
|
|
233
|
+
|
|
234
|
+
### 工具栏操作
|
|
235
|
+
|
|
236
|
+
```svelte
|
|
237
|
+
<ActionBar buttons={[
|
|
238
|
+
{ label: '新建', icon: 'icon_google_add' },
|
|
239
|
+
{ label: '打开', icon: 'icon_google_folder_open' },
|
|
240
|
+
{ label: '保存', icon: 'icon_google_save' },
|
|
241
|
+
null,
|
|
242
|
+
{ label: '剪切', icon: 'icon_google_content_cut' },
|
|
243
|
+
{ label: '复制', icon: 'icon_google_content_copy' },
|
|
244
|
+
{ label: '粘贴', icon: 'icon_google_content_paste' }
|
|
245
|
+
]} />
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### 表单操作
|
|
249
|
+
|
|
250
|
+
```svelte
|
|
251
|
+
<ActionBar
|
|
252
|
+
buttons={[
|
|
253
|
+
{ label: '保存', type: 'primary', handler: submit },
|
|
254
|
+
{ label: '取消', handler: cancel }
|
|
255
|
+
]}
|
|
256
|
+
style="justify-content: flex-end; margin-top: 16px;"
|
|
257
|
+
/>
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### CRUD操作
|
|
261
|
+
|
|
262
|
+
```svelte
|
|
263
|
+
<ActionBar buttons={[
|
|
264
|
+
{ label: '创建', type: 'primary', handler: create },
|
|
265
|
+
{ label: '编辑', handler: edit },
|
|
266
|
+
{ label: '删除', type: 'danger', handler: remove },
|
|
267
|
+
null,
|
|
268
|
+
{ label: '刷新', handler: refresh }
|
|
269
|
+
]} />
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## 最佳实践
|
|
273
|
+
|
|
274
|
+
1. **分组相关操作**: 使用分隔符分组相关功能
|
|
275
|
+
2. **一致的图标**: 在整个应用程序中使用一致的图标样式
|
|
276
|
+
3. **按钮类型**: 使用适当的按钮类型(主要操作用primary,危险操作用danger)
|
|
277
|
+
4. **禁用状态**: 在操作不可用或加载期间禁用按钮
|
|
278
|
+
5. **响应式设计**: 考虑移动设备的按钮标签和间距
|
|
279
|
+
|
|
280
|
+
## 注意事项
|
|
281
|
+
|
|
282
|
+
- 按钮数组中的`null`值会自动渲染为分隔符
|
|
283
|
+
- 如果按钮数组为空,组件会显示插槽内容
|
|
284
|
+
- 所有按钮共享相同的间距设置
|
|
285
|
+
- 图标需要在项目中正确引入相应的图标库
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
# App Layout Components
|
|
2
|
+
|
|
3
|
+
A collection of flexible layout components for building application interfaces with headers, sidebars, and resizable panels.
|
|
4
|
+
|
|
5
|
+
## Available Components
|
|
6
|
+
|
|
7
|
+
- **SidebarLayout** - Layout with optional sidebar and header
|
|
8
|
+
- **HeaderLayout** - Layout with header and optional sidebar below
|
|
9
|
+
- **ClassicLayout** - Traditional application layout with header, sidebars, and status bar
|
|
10
|
+
- **ColumnsLayout** - Flexible column-based layout with resizable panels
|
|
11
|
+
- **RowsLayout** - Flexible row-based layout with resizable panels
|
|
12
|
+
|
|
13
|
+
## Import
|
|
14
|
+
|
|
15
|
+
```svelte
|
|
16
|
+
<script>
|
|
17
|
+
// Import individual layouts
|
|
18
|
+
import { SidebarLayout } from '@ticatec/uniface-element/app-layout';
|
|
19
|
+
import HeaderLayout from '@ticatec/uniface-element/app-layout/HeaderLayout';
|
|
20
|
+
import ClassicLayout from '@ticatec/uniface-element/app-layout/ClassicLayout';
|
|
21
|
+
import ColumnsLayout from '@ticatec/uniface-element/app-layout/ColumnsLayout';
|
|
22
|
+
import RowsLayout from '@ticatec/uniface-element/app-layout/RowsLayout';
|
|
23
|
+
</script>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## SidebarLayout
|
|
27
|
+
|
|
28
|
+
A layout with an optional resizable sidebar on the left and header area.
|
|
29
|
+
|
|
30
|
+
### Props
|
|
31
|
+
|
|
32
|
+
| Prop | Type | Default | Description |
|
|
33
|
+
|------|------|---------|-------------|
|
|
34
|
+
| `sidebarResize` | `boolean` | `false` | Enable sidebar resizing |
|
|
35
|
+
| `headerHeight` | `string` | `"48px"` | Height of the header area |
|
|
36
|
+
| `sidebarWidth` | `string` | `"300px"` | Initial width of the sidebar |
|
|
37
|
+
| `sidebarMaxWidth` | `string \| null` | `null` | Maximum sidebar width |
|
|
38
|
+
| `sidebarMinWidth` | `string \| null` | `null` | Minimum sidebar width |
|
|
39
|
+
|
|
40
|
+
### Slots
|
|
41
|
+
|
|
42
|
+
- `sidebar` - Content for the sidebar area
|
|
43
|
+
- `header` - Content for the header area
|
|
44
|
+
- `default` - Main content area
|
|
45
|
+
|
|
46
|
+
### Example
|
|
47
|
+
|
|
48
|
+
```svelte
|
|
49
|
+
<SidebarLayout
|
|
50
|
+
sidebarResize={true}
|
|
51
|
+
sidebarWidth="250px"
|
|
52
|
+
sidebarMinWidth="200px"
|
|
53
|
+
sidebarMaxWidth="400px"
|
|
54
|
+
>
|
|
55
|
+
<div slot="sidebar">
|
|
56
|
+
<!-- Navigation menu -->
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div slot="header">
|
|
60
|
+
<!-- Top bar content -->
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<!-- Main content -->
|
|
64
|
+
<div>Main application content</div>
|
|
65
|
+
</SidebarLayout>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## HeaderLayout
|
|
69
|
+
|
|
70
|
+
A layout with a header at the top and optional sidebar below the header.
|
|
71
|
+
|
|
72
|
+
### Props
|
|
73
|
+
|
|
74
|
+
| Prop | Type | Default | Description |
|
|
75
|
+
|------|------|---------|-------------|
|
|
76
|
+
| `headerHeight` | `string` | `"48px"` | Height of the header |
|
|
77
|
+
| `sidebarWidth` | `string` | `"300px"` | Width of the sidebar |
|
|
78
|
+
| `sidebarResize` | `boolean` | `false` | Enable sidebar resizing |
|
|
79
|
+
| `sidebarMaxWidth` | `string \| null` | `null` | Maximum sidebar width |
|
|
80
|
+
| `sidebarMinWidth` | `string \| null` | `null` | Minimum sidebar width |
|
|
81
|
+
|
|
82
|
+
### Slots
|
|
83
|
+
|
|
84
|
+
- `header` - Content for the header area
|
|
85
|
+
- `sidebar` - Content for the sidebar area
|
|
86
|
+
- `default` - Main content area
|
|
87
|
+
|
|
88
|
+
### Example
|
|
89
|
+
|
|
90
|
+
```svelte
|
|
91
|
+
<HeaderLayout headerHeight="60px" sidebarResize={true}>
|
|
92
|
+
<div slot="header">
|
|
93
|
+
<!-- App header -->
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<div slot="sidebar">
|
|
97
|
+
<!-- Side navigation -->
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<!-- Main content -->
|
|
101
|
+
<div>Page content</div>
|
|
102
|
+
</HeaderLayout>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## ClassicLayout
|
|
106
|
+
|
|
107
|
+
A traditional desktop application layout with header, left sidebar, optional right sidebar, and status bar.
|
|
108
|
+
|
|
109
|
+
### Props
|
|
110
|
+
|
|
111
|
+
| Prop | Type | Default | Description |
|
|
112
|
+
|------|------|---------|-------------|
|
|
113
|
+
| `headerHeight` | `string` | `"48px"` | Height of the header |
|
|
114
|
+
| `sidebarWidth` | `string` | `"300px"` | Width of the left sidebar |
|
|
115
|
+
| `statusHeight` | `string` | `"22px"` | Height of the status bar |
|
|
116
|
+
| `rightBarWidth` | `string` | `"240px"` | Width of the right sidebar |
|
|
117
|
+
| `sidebarResize` | `boolean` | `false` | Enable left sidebar resizing |
|
|
118
|
+
| `sidebarMaxWidth` | `string \| null` | `null` | Maximum left sidebar width |
|
|
119
|
+
| `sidebarMinWidth` | `string \| null` | `null` | Minimum left sidebar width |
|
|
120
|
+
| `rightBarResize` | `boolean` | `false` | Enable right sidebar resizing |
|
|
121
|
+
| `rightBarMaxWidth` | `string \| null` | `null` | Maximum right sidebar width |
|
|
122
|
+
| `rightBarMinWidth` | `string \| null` | `null` | Minimum right sidebar width |
|
|
123
|
+
|
|
124
|
+
### Slots
|
|
125
|
+
|
|
126
|
+
- `header` - Header content
|
|
127
|
+
- `sidebar` - Left sidebar content
|
|
128
|
+
- `right-sidebar` - Right sidebar content
|
|
129
|
+
- `bottom` - Status bar content
|
|
130
|
+
- `default` - Main content area
|
|
131
|
+
|
|
132
|
+
### Example
|
|
133
|
+
|
|
134
|
+
```svelte
|
|
135
|
+
<ClassicLayout
|
|
136
|
+
sidebarResize={true}
|
|
137
|
+
rightBarResize={true}
|
|
138
|
+
statusHeight="24px"
|
|
139
|
+
>
|
|
140
|
+
<div slot="header">
|
|
141
|
+
<!-- Application header -->
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<div slot="sidebar">
|
|
145
|
+
<!-- Left navigation -->
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div slot="right-sidebar">
|
|
149
|
+
<!-- Properties panel -->
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<div slot="bottom">
|
|
153
|
+
<!-- Status bar -->
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<!-- Main workspace -->
|
|
157
|
+
<div>Editor or main content</div>
|
|
158
|
+
</ClassicLayout>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## ColumnsLayout
|
|
162
|
+
|
|
163
|
+
A flexible column-based layout with resizable left and right panels.
|
|
164
|
+
|
|
165
|
+
### Props
|
|
166
|
+
|
|
167
|
+
| Prop | Type | Default | Description |
|
|
168
|
+
|------|------|---------|-------------|
|
|
169
|
+
| `width` | `string` | `"100%"` | Total width of the layout |
|
|
170
|
+
| `height` | `string` | `"100%"` | Total height of the layout |
|
|
171
|
+
| `leftWidth` | `string \| null` | `null` | Width of the left column |
|
|
172
|
+
| `rightWidth` | `string \| null` | `null` | Width of the right column |
|
|
173
|
+
| `leftMin` | `string \| null` | `null` | Minimum width of left column |
|
|
174
|
+
| `leftMax` | `string \| null` | `null` | Maximum width of left column |
|
|
175
|
+
| `rightMin` | `string \| null` | `null` | Minimum width of right column |
|
|
176
|
+
| `rightMax` | `string \| null` | `null` | Maximum width of right column |
|
|
177
|
+
| `leftResize` | `boolean` | `false` | Enable left column resizing |
|
|
178
|
+
| `rightResize` | `boolean` | `false` | Enable right column resizing |
|
|
179
|
+
|
|
180
|
+
### Slots
|
|
181
|
+
|
|
182
|
+
- `left` - Left column content
|
|
183
|
+
- `right` - Right column content
|
|
184
|
+
- `default` - Center column content
|
|
185
|
+
|
|
186
|
+
### Example
|
|
187
|
+
|
|
188
|
+
```svelte
|
|
189
|
+
<ColumnsLayout
|
|
190
|
+
leftResize={true}
|
|
191
|
+
rightResize={true}
|
|
192
|
+
leftWidth="200px"
|
|
193
|
+
rightWidth="300px"
|
|
194
|
+
leftMin="150px"
|
|
195
|
+
rightMin="250px"
|
|
196
|
+
>
|
|
197
|
+
<div slot="left">
|
|
198
|
+
<!-- Left panel -->
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<div slot="right">
|
|
202
|
+
<!-- Right panel -->
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
<!-- Center content -->
|
|
206
|
+
<div>Main content area</div>
|
|
207
|
+
</ColumnsLayout>
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## RowsLayout
|
|
211
|
+
|
|
212
|
+
A flexible row-based layout with resizable top and bottom panels.
|
|
213
|
+
|
|
214
|
+
### Props
|
|
215
|
+
|
|
216
|
+
| Prop | Type | Default | Description |
|
|
217
|
+
|------|------|---------|-------------|
|
|
218
|
+
| `width` | `string` | `"100%"` | Total width of the layout |
|
|
219
|
+
| `height` | `string` | `"100%"` | Total height of the layout |
|
|
220
|
+
| `topHeight` | `string \| null` | `null` | Height of the top row |
|
|
221
|
+
| `bottomHeight` | `string \| null` | `null` | Height of the bottom row |
|
|
222
|
+
| `topMin` | `string \| null` | `null` | Minimum height of top row |
|
|
223
|
+
| `topMax` | `string \| null` | `null` | Maximum height of top row |
|
|
224
|
+
| `bottomMin` | `string \| null` | `null` | Minimum height of bottom row |
|
|
225
|
+
| `bottomMax` | `string \| null` | `null` | Maximum height of bottom row |
|
|
226
|
+
| `topResize` | `boolean` | `false` | Enable top row resizing |
|
|
227
|
+
| `bottomResize` | `boolean` | `false` | Enable bottom row resizing |
|
|
228
|
+
|
|
229
|
+
### Slots
|
|
230
|
+
|
|
231
|
+
- `top` - Top row content
|
|
232
|
+
- `bottom` - Bottom row content
|
|
233
|
+
- `default` - Center row content
|
|
234
|
+
|
|
235
|
+
### Example
|
|
236
|
+
|
|
237
|
+
```svelte
|
|
238
|
+
<RowsLayout
|
|
239
|
+
topResize={true}
|
|
240
|
+
bottomResize={true}
|
|
241
|
+
topHeight="150px"
|
|
242
|
+
bottomHeight="100px"
|
|
243
|
+
topMin="100px"
|
|
244
|
+
bottomMin="80px"
|
|
245
|
+
>
|
|
246
|
+
<div slot="top">
|
|
247
|
+
<!-- Top panel -->
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
<div slot="bottom">
|
|
251
|
+
<!-- Bottom panel -->
|
|
252
|
+
</div>
|
|
253
|
+
|
|
254
|
+
<!-- Center content -->
|
|
255
|
+
<div>Main content area</div>
|
|
256
|
+
</RowsLayout>
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## Features
|
|
260
|
+
|
|
261
|
+
### Resizable Panels
|
|
262
|
+
All layout components support resizable panels when enabled:
|
|
263
|
+
- Drag the split handles to resize panels
|
|
264
|
+
- Respect minimum and maximum width/height constraints
|
|
265
|
+
- Smooth resizing with visual feedback
|
|
266
|
+
|
|
267
|
+
### Responsive Design
|
|
268
|
+
- Layouts adapt to container dimensions
|
|
269
|
+
- Flexible sizing with percentage and fixed units
|
|
270
|
+
- Overflow handling for content areas
|
|
271
|
+
|
|
272
|
+
### Slot-based Content
|
|
273
|
+
- Use named slots for different layout areas
|
|
274
|
+
- Optional slots are hidden when no content is provided
|
|
275
|
+
- Default slot for main content area
|
|
276
|
+
|
|
277
|
+
## Common Patterns
|
|
278
|
+
|
|
279
|
+
### Application Shell
|
|
280
|
+
|
|
281
|
+
```svelte
|
|
282
|
+
<ClassicLayout sidebarResize={true}>
|
|
283
|
+
<div slot="header" class="app-header">
|
|
284
|
+
<h1>My Application</h1>
|
|
285
|
+
<!-- Navigation, user menu, etc. -->
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
<div slot="sidebar" class="navigation">
|
|
289
|
+
<!-- Menu items -->
|
|
290
|
+
</div>
|
|
291
|
+
|
|
292
|
+
<div slot="bottom" class="status-bar">
|
|
293
|
+
<!-- Status information -->
|
|
294
|
+
</div>
|
|
295
|
+
|
|
296
|
+
<main class="main-content">
|
|
297
|
+
<!-- Page content -->
|
|
298
|
+
</main>
|
|
299
|
+
</ClassicLayout>
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Dashboard Layout
|
|
303
|
+
|
|
304
|
+
```svelte
|
|
305
|
+
<ColumnsLayout leftResize={true} rightResize={true}>
|
|
306
|
+
<div slot="left" class="sidebar">
|
|
307
|
+
<!-- Filters, navigation -->
|
|
308
|
+
</div>
|
|
309
|
+
|
|
310
|
+
<div slot="right" class="details-panel">
|
|
311
|
+
<!-- Item details, actions -->
|
|
312
|
+
</div>
|
|
313
|
+
|
|
314
|
+
<div class="dashboard-grid">
|
|
315
|
+
<!-- Main dashboard content -->
|
|
316
|
+
</div>
|
|
317
|
+
</ColumnsLayout>
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### Split View Editor
|
|
321
|
+
|
|
322
|
+
```svelte
|
|
323
|
+
<RowsLayout topResize={true} bottomResize={true}>
|
|
324
|
+
<div slot="top" class="editor-area">
|
|
325
|
+
<!-- Code editor -->
|
|
326
|
+
</div>
|
|
327
|
+
|
|
328
|
+
<div slot="bottom" class="output-panel">
|
|
329
|
+
<!-- Console, preview, etc. -->
|
|
330
|
+
</div>
|
|
331
|
+
|
|
332
|
+
<div class="file-explorer">
|
|
333
|
+
<!-- File tree, tabs -->
|
|
334
|
+
</div>
|
|
335
|
+
</RowsLayout>
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
## Styling
|
|
339
|
+
|
|
340
|
+
All layout components use flexbox for positioning and include:
|
|
341
|
+
|
|
342
|
+
- Proper overflow handling
|
|
343
|
+
- Border styling with CSS custom properties
|
|
344
|
+
- Gap spacing between panels
|
|
345
|
+
- Box-sizing: border-box for predictable sizing
|
|
346
|
+
|
|
347
|
+
### CSS Custom Properties
|
|
348
|
+
|
|
349
|
+
```css
|
|
350
|
+
:root {
|
|
351
|
+
--uniface-plain-border-color: #f0f0f0;
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
## Accessibility
|
|
356
|
+
|
|
357
|
+
- Proper semantic structure with container elements
|
|
358
|
+
- Keyboard navigation support through resizable splits
|
|
359
|
+
- Focus management during panel resizing
|
|
360
|
+
- Screen reader friendly layout structure
|
|
361
|
+
|
|
362
|
+
## Browser Support
|
|
363
|
+
|
|
364
|
+
- Modern browsers with flexbox support
|
|
365
|
+
- CSS custom properties support
|
|
366
|
+
- Drag and drop for resizing functionality
|
|
367
|
+
|
|
368
|
+
## Best Practices
|
|
369
|
+
|
|
370
|
+
1. **Choose the Right Layout**: Select the layout component that best fits your application structure
|
|
371
|
+
2. **Set Appropriate Constraints**: Use min/max width/height to prevent panels from becoming too small or large
|
|
372
|
+
3. **Consider Mobile**: Layouts may need responsive adjustments for mobile devices
|
|
373
|
+
4. **Content Overflow**: Ensure content areas have appropriate overflow handling
|
|
374
|
+
5. **Performance**: Minimize content in resizable panels for smooth resizing experience
|